source map exposed
analyzed
https://4njbets.us.betfair.com/tpt/assets/talentPicksTool.4915b35a2fbd29184020.js
map: https://4njbets.us.betfair.com/tpt/assets/talentPicksTool.4915b35a2fbd29184020.js.map
2114 source files
12.1 MB map size
84 endpoints found
85 secrets found
discovered 5 hours, 21 minutes ago
2114
source files
12.1 MB
map size
85
secrets
84
endpoints
secrets from source map (85)
gcpKey
{'key': 'AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks'}
0.9
Source: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-stg/base.ts
gcpKey
{'key': 'AIzaSyCvQe2IeP1DnZT6v0PLK-n4bjK9RqcEarQ'}
0.9
Source: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/qa/base.ts
gcpKey
{'key': 'AIzaSyCvQe2IeP1DnZT6v0PLK-n4bjK9RqcEarQ'}
0.9
Source: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/default.ts
gcpKey
{'key': 'AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks'}
0.9
Source: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-prd/base.ts
gcpKey
{'key': 'AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks'}
0.9
Source: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/staging/base.ts
gcpKey
{'key': 'AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks'}
0.9
Source: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/production/base.ts
gcpKey
{'key': 'AIzaSyCvQe2IeP1DnZT6v0PLK-n4bjK9RqcEarQ'}
0.9
Source: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-int/base.ts
internal_url
typeof process.env.ENVIRONMENT === "string" &&
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/src/environment.ts
// process.env instead.
typeof process !== "undefined" &&
typeof process.env.ENVIRONMENT === "string" &&
(process.env.ENVIRONMENT === "dev"
? ("qa" as Env)
internal_url
if (hostname === "10.0.2.2") {
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/src/environment.ts
const getEnvironmentByHostname = (hostname?: string): Env => {
if (hostname === "10.0.2.2") {
return "aws-int";
}
internal_url
: `http://localhost:${process ? process.env.PORT : "8080"}`;
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/src/buildurl.ts
: ""
}`
: `http://localhost:${process ? process.env.PORT : "8080"}`;
const pathName = `${path.indexOf("/") === 0 ? "" : "/"}${encodeURI(path)}`;
internal_url
: `http://localhost:${process ? process.env.PORT : "8080"}`;
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/src/buildurl.ts
: ""
}`
: `http://localhost:${process ? process.env.PORT : "8080"}`;
const pathName = `${path.indexOf("/") === 0 ? "" : "/"}${encodeURI(path)}`;
internal_url
typeof process.env.ENVIRONMENT === "string" &&
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/src/utils.ts
window.location.hostname.includes("local")) ||
(typeof window === "undefined" &&
typeof process.env.ENVIRONMENT === "string" &&
process.env.ENVIRONMENT === "dev");
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/css-to-react-native/index.js
var propertiesWithoutUnits;
if (process.env.NODE_ENV !== 'production') {
propertiesWithoutUnits = ['aspectRatio', 'elevation', 'flexGrow', 'flexShrink', 'opacity', 'shadowOpacity', 'zIndex'];
}
internal_url
var validateFormat = process.env.NODE_ENV !== "production" ? function (format) {
0.8
Source map: webpack://frontend-tpt/../../node_modules/fbjs/lib/invariant.js
'use strict';
var validateFormat = process.env.NODE_ENV !== "production" ? function (format) {
if (format === undefined) {
throw new Error('invariant(...): Second argument must be a string.');
internal_url
var warning = process.env.NODE_ENV !== "production" ? function (condition, format) {
0.8
Source map: webpack://frontend-tpt/../../node_modules/fbjs/lib/warning.js
}
var warning = process.env.NODE_ENV !== "production" ? function (condition, format) {
if (format === undefined) {
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
internal_url
if (process.env.NODE_ENV === 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-is.production.min.js');
} else {
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/prop-types/index.js
*/
if (process.env.NODE_ENV !== 'production') {
var ReactIs = require('react-is');
internal_url
if (process.env.NODE_ENV === 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-dom/client.js
var m = require('react-dom');
if (process.env.NODE_ENV === 'production') {
exports.createRoot = m.createRoot;
exports.hydrateRoot = m.hydrateRoot;
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-dom/index.js
return;
}
if (process.env.NODE_ENV !== 'production') {
// This branch is unreachable because this function is only called
// in production, but the condition is true only in development.
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-id-swiper/lib/ReactIdSwiper.js
// Validate children props
if (!utils_1.validateChildren(children)) {
if (process.env.NODE_ENV !== 'production') {
console.warn('Children should be react element or an array of react element!!');
}
internal_url
if (process.env.NODE_ENV === 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-is/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-is.production.min.js');
} else {
internal_url
if (process.env.NODE_ENV === 'development') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-motion/lib/reorderKeys.js
function reorderKeys() {
if (process.env.NODE_ENV === 'development') {
if (!hasWarned) {
hasWarned = true;
internal_url
if (process.env.NODE_ENV === 'development') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-motion/lib/reorderKeys.js
function reorderKeys() {
if (process.env.NODE_ENV === 'development') {
if (!hasWarned) {
hasWarned = true;
internal_url
var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/AppRegistry/index.js
}
static runApplication(appKey, appParameters) {
var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';
if (isDevelopment) {
var params = (0, _objectSpread2.default)({}, appParameters);
internal_url
var __DEV__ = process.env.NODE_ENV !== 'production';
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.js */ var __DEV__ = process.env.NODE_ENV !== 'production'; var VirtualizedListContext = /*#__PURE__*/React.createContext(null); exports.VirtualizedListContext = VirtualizedListContext;
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Image/index.js
style = props.style,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
if (process.env.NODE_ENV !== 'production') {
if (props.children) {
throw new Error('The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.');
internal_url
if (process.env.NODE_ENV === 'test') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Platform/index.js
select: obj => 'web' in obj ? obj.web : obj.default,
get isTesting() {
if (process.env.NODE_ENV === 'test') {
return true;
}
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/ScrollView/index.js
};
this._handleScroll = e => {
if (process.env.NODE_ENV !== 'production') {
if (this.props.onScroll && this.props.scrollEventThrottle == null) {
console.log('You specified `onScroll` on a <ScrollView> but not ' + '`scrollEventThrottle`. You will only receive one event. ' + 'Using `16` you get all the events but be aware that it may ' + "cause frame drops, use a bigger number if you don't need as " + 'much precision.');
internal_url
return process.env.NODE_ENV !== 'production' ? prefix + "-" + name + "-" + hashedString : prefix + "-" + hashedString;
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/index.js
function createIdentifier(prefix, name, key) {
var hashedString = (0, _hash.default)(name + key);
return process.env.NODE_ENV !== 'production' ? prefix + "-" + name + "-" + hashedString : prefix + "-" + hashedString;
}
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/index.js
compiledStyles = compileAndInsertReset(styleObj, key.split('$raw')[0]);
} else {
if (process.env.NODE_ENV !== 'production') {
(0, _validate.validate)(styleObj);
styles[key] = Object.freeze(styleObj);
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Touchable/index.js
return null;
}
if (process.env.NODE_ENV !== 'production') {
throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!');
}
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/View/index.js
onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
if (process.env.NODE_ENV !== 'production') {
React.Children.toArray(props.children).forEach(item => {
if (typeof item === 'string') {
internal_url
var unimplementedViewStyles = process.env.NODE_ENV !== 'production' ? {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/UnimplementedView/index.js
}
}
var unimplementedViewStyles = process.env.NODE_ENV !== 'production' ? {
alignSelf: 'flex-start',
borderColor: 'red',
internal_url
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useElementLayout/index.js
}
} else if (!didWarn) {
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
console.warn('onLayout relies on ResizeObserver which is not supported by your browser. ' + 'Please include a polyfill, e.g., https://github.com/que-etc/resize-observer-polyfill.');
didWarn = true;
internal_url
var __DEV__ = process.env.NODE_ENV !== 'production';
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderTouchHistoryStore.js
*/
var __DEV__ = process.env.NODE_ENV !== 'production';
var MAX_TOUCH_BANK = 20;
function timestampForTouch(touch) {
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/warnOnce/index.js
*/
function warnOnce(key, message) {
if (process.env.NODE_ENV !== 'production') {
if (warnedKeys[key]) {
return;
internal_url
var __DEV__ = process.env.NODE_ENV !== 'production';
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedEvent.js
var _NativeAnimatedHelper = _interopRequireWildcard(require("./NativeAnimatedHelper"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var __DEV__ = process.env.NODE_ENV !== 'production';
function attachNativeEvent(viewRef, eventName, argMapping) {
// Find animated values in `argMapping` and create an array representing their
internal_url
var __DEV__ = process.env.NODE_ENV !== 'production';
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedInterpolation.js
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _normalizeColors = _interopRequireDefault(require("@react-native/normalize-colors"));
var __DEV__ = process.env.NODE_ENV !== 'production';
var linear = t => t;
internal_url
var __DEV__ = process.env.NODE_ENV !== 'production';
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/LayoutAnimation/index.js
var _Platform = _interopRequireDefault(require("../../../exports/Platform"));
var _UIManager = _interopRequireDefault(require("../../../exports/UIManager"));
var __DEV__ = process.env.NODE_ENV !== 'production';
function configureNext(config, onAnimationDidEnd) {
if (!_Platform.default.isTesting) {
internal_url
var __DEV__ = process.env.NODE_ENV !== 'production';
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/index.js */ var __DEV__ = process.env.NODE_ENV !== 'production'; var ON_EDGE_REACHED_EPSILON = 0.001; var _usedIndexForKey = false;
internal_url
if (process.env.NODE_ENV === 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-redux/node_modules/react-is/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-is.production.min.js');
} else {
internal_url
if (process.env.NODE_ENV === 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react.production.min.js');
} else {
internal_url
if (process.env.NODE_ENV === 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react/jsx-runtime.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-jsx-runtime.production.min.js');
} else {
internal_url
if (process.env.NODE_ENV === 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/scheduler/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/scheduler.production.min.js');
} else {
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-redux/es/components/Context.js
export var ReactReduxContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== 'production') {
ReactReduxContext.displayName = 'ReactRedux';
}
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-redux/es/components/Provider.js
}
if (process.env.NODE_ENV !== 'production') {
Provider.propTypes = {
store: PropTypes.shape({
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-redux/es/components/connectAdvanced.js
connectOptions = _objectWithoutPropertiesLoose(_ref2, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef", "forwardRef", "context"]);
if (process.env.NODE_ENV !== 'production') {
if (renderCountProp !== undefined) {
throw new Error("renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension");
internal_url
if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-redux/es/connect/wrapMapToProps.js
}
if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);
return props;
};
internal_url
if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-redux/es/connect/mergeProps.js
hasRunOnce = true;
mergedProps = nextMergedProps;
if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');
}
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-redux/es/connect/selectorFactory.js
var mergeProps = initMergeProps(dispatch, options);
if (process.env.NODE_ENV !== 'production') {
verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
}
internal_url
if (process.env.NODE_ENV !== 'production' && !contextValue) {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-redux/es/hooks/useReduxContext.js
var contextValue = useContext(ReactReduxContext);
if (process.env.NODE_ENV !== 'production' && !contextValue) {
throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>');
}
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-redux/es/hooks/useSelector.js
}
if (process.env.NODE_ENV !== 'production') {
if (!selector) {
throw new Error("You must pass a selector to useSelector");
internal_url
if (process.env.NODE_ENV !== "production") {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-router/dist/index.js
// from `getSnapshot`.
getServerSnapshot) {
if (process.env.NODE_ENV !== "production") {
if (!didWarnOld18Alpha) {
if ("startTransition" in React) {
internal_url
if (process.env.NODE_ENV !== "production") {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-router-dom/dist/index.js
}
if (process.env.NODE_ENV !== "production") {
HistoryRouter.displayName = "unstable_HistoryRouter";
}
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/redux/es/redux.js
var typeOfVal = typeof val;
if (process.env.NODE_ENV !== 'production') {
// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
function miniKindOf(val) {
internal_url
import{typeOf as e,isElement as t,isValidElementType as n}from"react-is";import r,{useState as o,useContext as s,useMemo as i,useEffect as a,useRef as c,createElement as u,useDebugValue as l,useLayoutEffect as d}from"react";import h from"shallowequal";import p from"@emotion/stylis";import f from"@emotion/unitless";import m from"@emotion/is-prop-valid";import y from"hoist-non-react-statics";function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var g=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},S=function(t){return null!==t&&"object"==typeof t&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!e(t)},w=Object.freeze([]),E=Object.freeze({});function b(e){return"function"==typeof e}function _(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function N(e){return e&&"string"==typeof e.styledComponentId}var A="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",C="5.3.1",I="undefined"!=typeof window&&"HTMLElement"in window,P=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),O={},R="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"}:{};function D(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],n=1,r=arguments.length;n<r;n+=1)t.push(n<0||arguments.length<=n?void 0:arguments[n]);return t.forEach((function(t){e=e.replace(/%[a-z]/,t)})),e}function j(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw"production"===process.env.NODE_ENV?new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):"")):new Error(D.apply(void 0,[R[e]].concat(n)).trim())}var T=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&j(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var i=this.indexOfGroup(e+1),a=0,c=t.length;a<c;a++)this.tag.insertRule(i,t[a])&&(this.groupSizes[e]++,i++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+=this.tag.getRule(s)+"/*!sc*/\n";return t},e}(),k=new Map,x=new Map,V=1,B=function(e){if(k.has(e))return k.get(e);for(;x.has(V);)V++;var t=V++;return"production"!==process.env.NODE_ENV&&((0|t)<0||t>1<<30)&&j(16,""+t),k.set(e,t),x.set(t,e),t},M=function(e){return x.get(e)},z=function(e,t){t>=V&&(V=t+1),k.set(e,t),x.set(t,e)},L="style["+A+'][data-styled-version="5.3.1"]',G=new RegExp("^"+A+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),F=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r)},Y=function(e,t){for(var n=(t.innerHTML||"").split("/*!sc*/\n"),r=[],o=0,s=n.length;o<s;o++){var i=n[o].trim();if(i){var a=i.match(G);if(a){var c=0|parseInt(a[1],10),u=a[2];0!==c&&(z(u,c),F(e,u,a[3]),e.getTag().insertRules(c,r)),r.length=0}else r.push(i)}}},q=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},H=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(A))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(A,"active"),r.setAttribute("data-styled-version","5.3.1");var i=q();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},$=function(){function e(e){var t=this.element=H(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}j(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),W=function(){function e(e){var t=this.element=H(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),U=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),J=I,X={isServer:!I,useCSSOMInjection:!P},Z=function(){function e(e,t,n){void 0===e&&(e=E),void 0===t&&(t={}),this.options=v({},X,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&I&&J&&(J=!1,function(e){for(var t=document.querySelectorAll(L),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(A)&&(Y(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return B(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(v({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new U(o):r?new $(o):new W(o),new T(e)));var e,t,n,r,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(B(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(B(e),n)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(B(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var s=M(o);if(void 0!==s){var i=e.names.get(s),a=t.getGroup(o);if(i&&a&&i.size){var c=A+".g"+o+'[id="'+s+'"]',u="";void 0!==i&&i.forEach((function(e){e.length>0&&(u+=e+",")})),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),K=/(a)(d)/gi,Q=function(e){return String.fromCharCode(e+(e>25?39:97))};function ee(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Q(t%52)+n;return(Q(t%52)+n).replace(K,"$1-$2")}var te=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ne=function(e){return te(5381,e)};function re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(b(n)&&!N(n))return!1}return!0}var oe=ne("5.3.1"),se=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&re(e),this.componentId=t,this.baseHash=te(oe,t),this.baseStyle=n,Z.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else{var s=Ne(this.rules,e,t,n).join(""),i=ee(te(this.baseHash,s)>>>0);if(!t.hasNameForId(r,i)){var a=n(s,"."+i,void 0,r);t.insertRules(r,i,a)}o.push(i),this.staticRulesId=i}else{for(var c=this.rules.length,u=te(this.baseHash,n.hash),l="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)l+=h,"production"!==process.env.NODE_ENV&&(u=te(u,h+d));else if(h){var p=Ne(h,e,t,n),f=Array.isArray(p)?p.join(""):p;u=te(u,f+d),l+=f}}if(l){var m=ee(u>>>0);if(!t.hasNameForId(r,m)){var y=n(l,"."+m,void 0,r);t.insertRules(r,m,y)}o.push(m)}}return o.join(" ")},e}(),ie=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ce(e){var t,n,r,o,s=void 0===e?E:e,i=s.options,a=void 0===i?E:i,c=s.plugins,u=void 0===c?w:c,l=new p(a),d=[],h=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),f=function(e,r,s){return 0===r&&-1!==ae.indexOf(s[n.length])||s.match(o)?e:"."+t};function m(e,s,i,a){void 0===a&&(a="&");var c=e.replace(ie,""),u=s&&i?i+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(i||!s?"":s,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f))},h,function(e){if(-2===e){var t=d;return d=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||j(15),te(e,t.name)}),5381).toString():"",m}var ue=r.createContext(),le=ue.Consumer,de=r.createContext(),he=(de.Consumer,new Z),pe=ce();function fe(){return s(ue)||he}function me(){return s(de)||pe}function ye(e){var t=o(e.stylisPlugins),n=t[0],s=t[1],c=fe(),u=i((function(){var t=c;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),l=i((function(){return ce({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return a((function(){h(n,e.stylisPlugins)||s(e.stylisPlugins)}),[e.stylisPlugins]),r.createElement(ue.Provider,{value:u},r.createElement(de.Provider,{value:l},"production"!==process.env.NODE_ENV?r.Children.only(e.children):e.children))}var ve=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=pe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return j(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=pe),this.name+e.hash},e}(),ge=/([A-Z])/,Se=/([A-Z])/g,we=/^ms-/,Ee=function(e){return"-"+e.toLowerCase()};function be(e){return ge.test(e)?e.replace(Se,Ee).replace(we,"-ms-"):e}var _e=function(e){return null==e||!1===e||""===e};function Ne(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a<c;a+=1)""!==(s=Ne(e[a],n,r,o))&&(Array.isArray(s)?i.push.apply(i,s):i.push(s));return i}if(_e(e))return"";if(N(e))return"."+e.styledComponentId;if(b(e)){if("function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!n)return e;var u=e(n);return"production"!==process.env.NODE_ENV&&t(u)&&console.warn(_(e)+" is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details."),Ne(u,n,r,o)}var l;return e instanceof ve?r?(e.inject(r,o),e.getName(o)):e:S(e)?function e(t,n){var r,o,s=[];for(var i in t)t.hasOwnProperty(i)&&!_e(t[i])&&(Array.isArray(t[i])&&t[i].isCss||b(t[i])?s.push(be(i)+":",t[i],";"):S(t[i])?s.push.apply(s,e(t[i],i)):s.push(be(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in f?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(s,["}"]):s}(e):e.toString()}var Ae=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return b(e)||S(e)?Ae(Ne(g(w,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:Ae(Ne(g(e,n)))}var Ie=/invalid hook call/i,Pe=new Set,Oe=function(e,t){if("production"!==process.env.NODE_ENV){var n="The component "+e+(t?' with the id of "'+t+'"':"")+" has been created dynamically.\nYou may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",r=console.error;try{var o=!0;console.error=function(e){if(Ie.test(e))o=!1,Pe.delete(n);else{for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];r.apply(void 0,[e].concat(s))}},c(),o&&!Pe.has(n)&&(console.warn(n),Pe.add(n))}catch(e){Ie.test(e.message)&&Pe.delete(n)}finally{console.error=r}}},Re=function(e,t,n){return void 0===n&&(n=E),e.theme!==n.theme&&e.theme||t||n.theme},De=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function Te(e){return e.replace(De,"-").replace(je,"")}var ke=function(e){return ee(ne(e)>>>0)};function xe(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Ve=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Be=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Me(e,t,n){var r=e[n];Ve(t)&&Ve(r)?ze(r,t):e[n]=t}function ze(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,s=n;o<s.length;o++){var i=s[o];if(Ve(i))for(var a in i)Be(a)&&Me(e,i[a],a)}return e}var Le=r.createContext(),Ge=Le.Consumer;function Fe(e){var t=s(Le),n=i((function(){return function(e,t){if(!e)return j(14);if(b(e)){var n=e(t);return"production"===process.env.NODE_ENV||null!==n&&!Array.isArray(n)&&"object"==typeof n?n:j(7)}return Array.isArray(e)||"object"!=typeof e?j(8):t?v({},t,{},e):e}(e.theme,t)}),[e.theme,t]);return e.children?r.createElement(Le.Provider,{value:n},e.children):null}var Ye={};function qe(e,t,n){var o=N(e),i=!xe(e),a=t.attrs,c=void 0===a?w:a,d=t.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":Te(e);Ye[n]=(Ye[n]||0)+1;var r=n+"-"+ke("5.3.1"+n+Ye[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):d,p=t.displayName,f=void 0===p?function(e){return xe(e)?"styled."+e:"Styled("+_(e)+")"}(e):p,g=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||h,S=o&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,A=t.shouldForwardProp;o&&e.shouldForwardProp&&(A=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var C,I=new se(n,g,o?e.componentStyle:void 0),P=I.isStatic&&0===c.length,O=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,d=e.shouldForwardProp,h=e.styledComponentId,p=e.target;"production"!==process.env.NODE_ENV&&l(h);var f=function(e,t,n){void 0===e&&(e=E);var r=v({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,s,i=e;for(t in b(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],s=i[t],n&&s?n+" "+s:n||s):i[t]})),[r,o]}(Re(t,s(Le),a)||E,t,o),y=f[0],g=f[1],S=function(e,t,n,r){var o=fe(),s=me(),i=t?e.generateAndInjectStyles(E,o,s):e.generateAndInjectStyles(n,o,s);return"production"!==process.env.NODE_ENV&&l(i),"production"!==process.env.NODE_ENV&&!t&&r&&r(i),i}(i,r,y,"production"!==process.env.NODE_ENV?e.warnTooManyClasses:void 0),w=n,_=g.$as||t.$as||g.as||t.as||p,N=xe(_),A=g!==t?v({},t,{},g):t,C={};for(var I in A)"$"!==I[0]&&"as"!==I&&("forwardedAs"===I?C.as=A[I]:(d?d(I,m,_):!N||m(I))&&(C[I]=A[I]));return t.style&&g.style!==t.style&&(C.style=v({},t.style,{},g.style)),C.className=Array.prototype.concat(c,h,S!==h?S:null,t.className,g.className).filter(Boolean).join(" "),C.ref=w,u(_,C)}(C,e,t,P)};return O.displayName=f,(C=r.forwardRef(O)).attrs=S,C.componentStyle=I,C.displayName=f,C.shouldForwardProp=A,C.foldedComponentIds=o?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):w,C.styledComponentId=g,C.target=o?e.target:e,C.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["componentId"]),s=r&&r+"-"+(xe(e)?e:Te(_(e)));return qe(e,v({},o,{attrs:S,componentId:s}),n)},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?ze({},e.defaultProps,t):t}}),"production"!==process.env.NODE_ENV&&(Oe(f,g),C.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'+t+'"':"";console.warn("Over 200 classes were generated for component "+e+s+".\nConsider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(f,g)),C.toString=function(){return"."+C.styledComponentId},i&&y(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C}var He=function(e){return function e(t,r,o){if(void 0===o&&(o=E),!n(r))return j(1,String(r));var s=function(){return t(r,o,Ce.apply(void 0,arguments))};return s.withConfig=function(n){return e(t,r,v({},o,{},n))},s.attrs=function(n){return e(t,r,v({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},s}(qe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){He[e]=He(e)}));var $e=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=re(e),Z.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var o=r(Ne(this.rules,t,n,r).join(""),""),s=this.componentId+e;n.insertRules(s,s,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&Z.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function We(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=Ce.apply(void 0,[e].concat(n)),a="sc-global-"+ke(JSON.stringify(i)),u=new $e(i,a);function l(e){var t=fe(),n=me(),o=s(Le),l=c(t.allocateGSInstance(a)).current;return"production"!==process.env.NODE_ENV&&r.Children.count(e.children)&&console.warn("The global style component "+a+" was given child JSX. createGlobalStyle does not render children."),"production"!==process.env.NODE_ENV&&i.some((function(e){return"string"==typeof e&&-1!==e.indexOf("@import")}))&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),t.server&&h(l,e,t,o,n),d((function(){if(!t.server)return h(l,e,t,o,n),function(){return u.removeStyles(l,t)}}),[l,e,t,o,n]),null}function h(e,t,n,r,o){if(u.isStatic)u.renderStyles(e,O,n,o);else{var s=v({},t,{theme:Re(t,r,l.defaultProps)});u.renderStyles(e,s,n,o)}}return"production"!==process.env.NODE_ENV&&Oe(a),r.memo(l)}function Ue(e){"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Ce.apply(void 0,[e].concat(n)).join(""),s=ke(o);return new ve(s,o)}var Je=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=q();return"<style "+[n&&'nonce="'+n+'"',A+'="true"','data-styled-version="5.3.1"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?j(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return j(2);var n=((t={})[A]="",t["data-styled-version"]="5.3.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=q();return o&&(n.nonce=o),[r.createElement("style",v({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Z({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?j(2):r.createElement(ye,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return j(3)},e}(),Xe=function(e){var t=r.forwardRef((function(t,n){var o=s(Le),i=e.defaultProps,a=Re(t,o,i);return"production"!==process.env.NODE_ENV&&void 0===a&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'+_(e)+'"'),r.createElement(e,v({},t,{theme:a,ref:n}))}));return y(t,e),t.displayName="WithTheme("+_(e)+")",t},Ze=function(){return s(Le)},Ke={StyleSheet:Z,masterSheet:he};"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native"),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window["__styled-components-init__"]=window["__styled-components-init__"]||0,1===window["__styled-components-init__"]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window["__styled-components-init__"]+=1);export default He;export{Je as ServerStyleSheet,le as StyleSheetConsumer,ue as StyleSheetContext,ye as StyleSheetManager,Ge as ThemeConsumer,Le as ThemeContext,Fe as ThemeProvider,Ke as __PRIVATE__,We as createGlobalStyle,Ce as css,N as isStyledComponent,Ue as keyframes,Ze as useTheme,C as version,Xe as withTheme};
0.8
Source map: webpack://frontend-tpt/../../node_modules/styled-components/dist/styled-components.browser.esm.js
import{typeOf as e,isElement as t,isValidElementType as n}from"react-is";import r,{useState as o,useContext as s,useMemo as i,useEffect as a,useRef as c,createElement as u,useDebugValue as l,useLayoutEffect as d}from"react";import h from"shallowequal";import p from"@emotion/stylis";import f from"@emotion/unitless";import m from"@emotion/is-prop-valid";import y from"hoist-non-react-statics";function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var g=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},S=function(t){return null!==t&&"object"==typeof t&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!e(t)},w=Object.freeze([]),E=Object.freeze({});function b(e){return"function"==typeof e}function _(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function N(e){return e&&"string"==typeof e.styledComponentId}var A="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",C="5.3.1",I="undefined"!=typeof window&&"HTMLElement"in window,P=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),O={},R="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"}:{};function D(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],n=1,r=arguments.length;n<r;n+=1)t.push(n<0||arguments.length<=n?void 0:arguments[n]);return t.forEach((function(t){e=e.replace(/%[a-z]/,t)})),e}function j(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw"production"===process.env.NODE_ENV?new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):"")):new Error(D.apply(void 0,[R[e]].concat(n)).trim())}var T=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&j(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var i=this.indexOfGroup(e+1),a=0,c=t.length;a<c;a++)this.tag.insertRule(i,t[a])&&(this.groupSizes[e]++,i++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+=this.tag.getRule(s)+"/*!sc*/\n";return t},e}(),k=new Map,x=new Map,V=1,B=function(e){if(k.has(e))return k.get(e);for(;x.has(V);)V++;var t=V++;return"production"!==process.env.NODE_ENV&&((0|t)<0||t>1<<30)&&j(16,""+t),k.set(e,t),x.set(t,e),t},M=function(e){return x.get(e)},z=function(e,t){t>=V&&(V=t+1),k.set(e,t),x.set(t,e)},L="style["+A+'][data-styled-version="5.3.1"]',G=new RegExp("^"+A+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),F=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r)},Y=function(e,t){for(var n=(t.innerHTML||"").split("/*!sc*/\n"),r=[],o=0,s=n.length;o<s;o++){var i=n[o].trim();if(i){var a=i.match(G);if(a){var c=0|parseInt(a[1],10),u=a[2];0!==c&&(z(u,c),F(e,u,a[3]),e.getTag().insertRules(c,r)),r.length=0}else r.push(i)}}},q=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},H=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(A))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(A,"active"),r.setAttribute("data-styled-version","5.3.1");var i=q();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},$=function(){function e(e){var t=this.element=H(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}j(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),W=function(){function e(e){var t=this.element=H(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),U=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),J=I,X={isServer:!I,useCSSOMInjection:!P},Z=function(){function e(e,t,n){void 0===e&&(e=E),void 0===t&&(t={}),this.options=v({},X,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&I&&J&&(J=!1,function(e){for(var t=document.querySelectorAll(L),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(A)&&(Y(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return B(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(v({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new U(o):r?new $(o):new W(o),new T(e)));var e,t,n,r,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(B(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(B(e),n)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(B(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var s=M(o);if(void 0!==s){var i=e.names.get(s),a=t.getGroup(o);if(i&&a&&i.size){var c=A+".g"+o+'[id="'+s+'"]',u="";void 0!==i&&i.forEach((function(e){e.length>0&&(u+=e+",")})),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),K=/(a)(d)/gi,Q=function(e){return String.fromCharCode(e+(e>25?39:97))};function ee(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Q(t%52)+n;return(Q(t%52)+n).replace(K,"$1-$2")}var te=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ne=function(e){return te(5381,e)};function re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(b(n)&&!N(n))return!1}return!0}var oe=ne("5.3.1"),se=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&re(e),this.componentId=t,this.baseHash=te(oe,t),this.baseStyle=n,Z.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else{var s=Ne(this.rules,e,t,n).join(""),i=ee(te(this.baseHash,s)>>>0);if(!t.hasNameForId(r,i)){var a=n(s,"."+i,void 0,r);t.insertRules(r,i,a)}o.push(i),this.staticRulesId=i}else{for(var c=this.rules.length,u=te(this.baseHash,n.hash),l="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)l+=h,"production"!==process.env.NODE_ENV&&(u=te(u,h+d));else if(h){var p=Ne(h,e,t,n),f=Array.isArray(p)?p.join(""):p;u=te(u,f+d),l+=f}}if(l){var m=ee(u>>>0);if(!t.hasNameForId(r,m)){var y=n(l,"."+m,void 0,r);t.insertRules(r,m,y)}o.push(m)}}return o.join(" ")},e}(),ie=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ce(e){var t,n,r,o,s=void 0===e?E:e,i=s.options,a=void 0===i?E:i,c=s.plugins,u=void 0===c?w:c,l=new p(a),d=[],h=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),f=function(e,r,s){return 0===r&&-1!==ae.indexOf(s[n.length])||s.match(o)?e:"."+t};function m(e,s,i,a){void 0===a&&(a="&");var c=e.replace(ie,""),u=s&&i?i+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(i||!s?"":s,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f))},h,function(e){if(-2===e){var t=d;return d=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||j(15),te(e,t.name)}),5381).toString():"",m}var ue=r.createContext(),le=ue.Consumer,de=r.createContext(),he=(de.Consumer,new Z),pe=ce();function fe(){return s(ue)||he}function me(){return s(de)||pe}function ye(e){var t=o(e.stylisPlugins),n=t[0],s=t[1],c=fe(),u=i((function(){var t=c;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),l=i((function(){return ce({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return a((function(){h(n,e.stylisPlugins)||s(e.stylisPlugins)}),[e.stylisPlugins]),r.createElement(ue.Provider,{value:u},r.createElement(de.Provider,{value:l},"production"!==process.env.NODE_ENV?r.Children.only(e.children):e.children))}var ve=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=pe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return j(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=pe),this.name+e.hash},e}(),ge=/([A-Z])/,Se=/([A-Z])/g,we=/^ms-/,Ee=function(e){return"-"+e.toLowerCase()};function be(e){return ge.test(e)?e.replace(Se,Ee).replace(we,"-ms-"):e}var _e=function(e){return null==e||!1===e||""===e};function Ne(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a<c;a+=1)""!==(s=Ne(e[a],n,r,o))&&(Array.isArray(s)?i.push.apply(i,s):i.push(s));return i}if(_e(e))return"";if(N(e))return"."+e.styledComponentId;if(b(e)){if("function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!n)return e;var u=e(n);return"production"!==process.env.NODE_ENV&&t(u)&&console.warn(_(e)+" is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details."),Ne(u,n,r,o)}var l;return e instanceof ve?r?(e.inject(r,o),e.getName(o)):e:S(e)?function e(t,n){var r,o,s=[];for(var i in t)t.hasOwnProperty(i)&&!_e(t[i])&&(Array.isArray(t[i])&&t[i].isCss||b(t[i])?s.push(be(i)+":",t[i],";"):S(t[i])?s.push.apply(s,e(t[i],i)):s.push(be(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in f?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(s,["}"]):s}(e):e.toString()}var Ae=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return b(e)||S(e)?Ae(Ne(g(w,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:Ae(Ne(g(e,n)))}var Ie=/invalid hook call/i,Pe=new Set,Oe=function(e,t){if("production"!==process.env.NODE_ENV){var n="The component "+e+(t?' with the id of "'+t+'"':"")+" has been created dynamically.\nYou may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",r=console.error;try{var o=!0;console.error=function(e){if(Ie.test(e))o=!1,Pe.delete(n);else{for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];r.apply(void 0,[e].concat(s))}},c(),o&&!Pe.has(n)&&(console.warn(n),Pe.add(n))}catch(e){Ie.test(e.message)&&Pe.delete(n)}finally{console.error=r}}},Re=function(e,t,n){return void 0===n&&(n=E),e.theme!==n.theme&&e.theme||t||n.theme},De=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function Te(e){return e.replace(De,"-").replace(je,"")}var ke=function(e){return ee(ne(e)>>>0)};function xe(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Ve=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Be=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Me(e,t,n){var r=e[n];Ve(t)&&Ve(r)?ze(r,t):e[n]=t}function ze(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,s=n;o<s.length;o++){var i=s[o];if(Ve(i))for(var a in i)Be(a)&&Me(e,i[a],a)}return e}var Le=r.createContext(),Ge=Le.Consumer;function Fe(e){var t=s(Le),n=i((function(){return function(e,t){if(!e)return j(14);if(b(e)){var n=e(t);return"production"===process.env.NODE_ENV||null!==n&&!Array.isArray(n)&&"object"==typeof n?n:j(7)}return Array.isArray(e)||"object"!=typeof e?j(8):t?v({},t,{},e):e}(e.theme,t)}),[e.theme,t]);return e.children?r.createElement(Le.Provider,{value:n},e.children):null}var Ye={};function qe(e,t,n){var o=N(e),i=!xe(e),a=t.attrs,c=void 0===a?w:a,d=t.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":Te(e);Ye[n]=(Ye[n]||0)+1;var r=n+"-"+ke("5.3.1"+n+Ye[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):d,p=t.displayName,f=void 0===p?function(e){return xe(e)?"styled."+e:"Styled("+_(e)+")"}(e):p,g=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||h,S=o&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,A=t.shouldForwardProp;o&&e.shouldForwardProp&&(A=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var C,I=new se(n,g,o?e.componentStyle:void 0),P=I.isStatic&&0===c.length,O=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,d=e.shouldForwardProp,h=e.styledComponentId,p=e.target;"production"!==process.env.NODE_ENV&&l(h);var f=function(e,t,n){void 0===e&&(e=E);var r=v({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,s,i=e;for(t in b(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],s=i[t],n&&s?n+" "+s:n||s):i[t]})),[r,o]}(Re(t,s(Le),a)||E,t,o),y=f[0],g=f[1],S=function(e,t,n,r){var o=fe(),s=me(),i=t?e.generateAndInjectStyles(E,o,s):e.generateAndInjectStyles(n,o,s);return"production"!==process.env.NODE_ENV&&l(i),"production"!==process.env.NODE_ENV&&!t&&r&&r(i),i}(i,r,y,"production"!==process.env.NODE_ENV?e.warnTooManyClasses:void 0),w=n,_=g.$as||t.$as||g.as||t.as||p,N=xe(_),A=g!==t?v({},t,{},g):t,C={};for(var I in A)"$"!==I[0]&&"as"!==I&&("forwardedAs"===I?C.as=A[I]:(d?d(I,m,_):!N||m(I))&&(C[I]=A[I]));return t.style&&g.style!==t.style&&(C.style=v({},t.style,{},g.style)),C.className=Array.prototype.concat(c,h,S!==h?S:null,t.className,g.className).filter(Boolean).join(" "),C.ref=w,u(_,C)}(C,e,t,P)};return O.displayName=f,(C=r.forwardRef(O)).attrs=S,C.componentStyle=I,C.displayName=f,C.shouldForwardProp=A,C.foldedComponentIds=o?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):w,C.styledComponentId=g,C.target=o?e.target:e,C.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["componentId"]),s=r&&r+"-"+(xe(e)?e:Te(_(e)));return qe(e,v({},o,{attrs:S,componentId:s}),n)},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?ze({},e.defaultProps,t):t}}),"production"!==process.env.NODE_ENV&&(Oe(f,g),C.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'+t+'"':"";console.warn("Over 200 classes were generated for component "+e+s+".\nConsider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(f,g)),C.toString=function(){return"."+C.styledComponentId},i&&y(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C}var He=function(e){return function e(t,r,o){if(void 0===o&&(o=E),!n(r))return j(1,String(r));var s=function(){return t(r,o,Ce.apply(void 0,arguments))};return s.withConfig=function(n){return e(t,r,v({},o,{},n))},s.attrs=function(n){return e(t,r,v({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},s}(qe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){He[e]=He(e)}));var $e=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=re(e),Z.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var o=r(Ne(this.rules,t,n,r).join(""),""),s=this.componentId+e;n.insertRules(s,s,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&Z.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function We(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=Ce.apply(void 0,[e].concat(n)),a="sc-global-"+ke(JSON.stringify(i)),u=new $e(i,a);function l(e){var t=fe(),n=me(),o=s(Le),l=c(t.allocateGSInstance(a)).current;return"production"!==process.env.NODE_ENV&&r.Children.count(e.children)&&console.warn("The global style component "+a+" was given child JSX. createGlobalStyle does not render children."),"production"!==process.env.NODE_ENV&&i.some((function(e){return"string"==typeof e&&-1!==e.indexOf("@import")}))&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),t.server&&h(l,e,t,o,n),d((function(){if(!t.server)return h(l,e,t,o,n),function(){return u.removeStyles(l,t)}}),[l,e,t,o,n]),null}function h(e,t,n,r,o){if(u.isStatic)u.renderStyles(e,O,n,o);else{var s=v({},t,{theme:Re(t,r,l.defaultProps)});u.renderStyles(e,s,n,o)}}return"production"!==process.env.NODE_ENV&&Oe(a),r.memo(l)}function Ue(e){"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Ce.apply(void 0,[e].concat(n)).join(""),s=ke(o);return new ve(s,o)}var Je=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=q();return"<style "+[n&&'nonce="'+n+'"',A+'="true"','data-styled-version="5.3.1"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?j(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return j(2);var n=((t={})[A]="",t["data-styled-version"]="5.3.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=q();return o&&(n.nonce=o),[r.createElement("style",v({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Z({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?j(2):r.createElement(ye,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return j(3)},e}(),Xe=function(e){var t=r.forwardRef((function(t,n){var o=s(Le),i=e.defaultProps,a=Re(t,o,i);return"production"!==process.env.NODE_ENV&&void 0===a&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'+_(e)+'"'),r.createElement(e,v({},t,{theme:a,ref:n}))}));return y(t,e),t.displayName="WithTheme("+_(e)+")",t},Ze=function(){return s(Le)},Ke={StyleSheet:Z,masterSheet:he};"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native"),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window["__styled-components-init__"]=window["__styled-components-init__"]||0,1===window["__styled-components-init__"]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window["__styled-components-init__"]+=1);export default He;export{Je as ServerStyleSheet,le as StyleSheetConsumer,ue as StyleSheetContext,ye as StyleSheetManager,Ge as ThemeConsumer,Le as ThemeContext,Fe as ThemeProvider,Ke as __PRIVATE__,We as createGlobalStyle,Ce as css,N as isStyledComponent,Ue as keyframes,Ze as useTheme,C as version,Xe as withTheme};
//# sourceMappingURL=styled-components.browser.esm.js.map
internal_url
Transition.propTypes = process.env.NODE_ENV !== "production" ? {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-transition-group/esm/Transition.js
Transition.contextType = TransitionGroupContext;
Transition.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* A React reference to DOM element that need to transition:
internal_url
CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, Transition.propTypes, {
0.8
Source map: webpack://frontend-tpt/../../node_modules/react-transition-group/esm/CSSTransition.js
classNames: ''
};
CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, Transition.propTypes, {
/**
* The animation classNames applied to the component as it appears, enters,
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js
}) : null);
if (process.env.NODE_ENV !== 'production') {
EmotionCacheContext.displayName = 'EmotionCacheContext';
}
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js
var createStyled = function createStyled(tag, options) {
if (process.env.NODE_ENV !== 'production') {
if (tag === undefined) {
throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
internal_url
if (process.env.NODE_ENV === 'test') return fn;
0.8
Source map: webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/platform.mjs
}
function $c87311424ea30a05$var$cached(fn) {
if (process.env.NODE_ENV === 'test') return fn;
let res = null;
return ()=>{
internal_url
let event = (0, $c87311424ea30a05$export$78551043582a6a98)() && (0, $c87311424ea30a05$export$9ac100e40613ea10)() && !(0, $c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
0.8
Source map: webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/openLink.mjs
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
let event = (0, $c87311424ea30a05$export$78551043582a6a98)() && (0, $c87311424ea30a05$export$9ac100e40613ea10)() && !(0, $c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
keyIdentifier: 'Enter',
metaKey: metaKey,
internal_url
} else if (process.env.NODE_ENV === 'test') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/usePress.mjs
cancel(e);
};
} else if (process.env.NODE_ENV === 'test') {
// NOTE: this fallback branch is entirely used by unit tests.
// All browsers now support pointer events, but JSDOM still does not.
internal_url
} else if (process.env.NODE_ENV === 'test') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/useFocusVisible.mjs
documentObject.addEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
} else if (process.env.NODE_ENV === 'test') {
documentObject.addEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
internal_url
if (shouldStopPropagation && process.env.NODE_ENV !== 'production') console.error('stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.');
0.8
Source map: webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/createEventHandler.mjs
},
stopPropagation () {
if (shouldStopPropagation && process.env.NODE_ENV !== 'production') console.error('stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.');
else shouldStopPropagation = true;
},
internal_url
if (process.env.NODE_ENV === 'production') return;
0.8
Source map: webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/useFocusable.mjs
let child = (0, $fcPuG$react).Children.only(children);
(0, $fcPuG$useEffect)(()=>{
if (process.env.NODE_ENV === 'production') return;
let el = ref.current;
if (!el || !(el instanceof (0, $fcPuG$getOwnerWindow)(el).Element)) {
internal_url
else if (process.env.NODE_ENV === 'test') document.addEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
0.8
Source map: webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/useHover.mjs
if (typeof document === 'undefined') return;
if (typeof PointerEvent !== 'undefined') document.addEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
else if (process.env.NODE_ENV === 'test') document.addEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
$6179b936705e76d3$var$hoverCount++;
return ()=>{
internal_url
return (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) || // $FlowFixMe
0.8
Source map: webpack://frontend-tpt/../../node_modules/styled-components/native/dist/styled-components.native.esm.js
//
function getComponentName(target) {
return (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) || // $FlowFixMe
target.displayName || // $FlowFixMe
target.name || 'Component';
internal_url
if (!tokenValue && process.env.NODE_ENV !== "production") {
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/hooks/useColorTokens.ts
const tokenValue = get(colorTokens, value);
if (!tokenValue && process.env.NODE_ENV !== "production") {
throw new Error(`Invalid color token: ${value}`);
}
internal_url
if (!tokenValue && process.env.NODE_ENV !== "production") {
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/hooks/useColorTokens/index.ts
const tokenValue = get(colorTokens, value);
if (!tokenValue && process.env.NODE_ENV !== "production") {
throw new Error(`Invalid color token: ${value}`);
}
internal_url
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return"'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return!!n&&!!n[Q]}function t(n){var r;return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return"production"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return"production"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];"production"!==process.env.NODE_ENV&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.g&&n(3,JSON.stringify(p(r)))}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c="add";m("Patches",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];"string"!=typeof p&&"number"!=typeof p&&(p=""+p),0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return"-"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=r.concat(n);t.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:r.concat(["length"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:"replace",path:[],value:r===H?void 0:r}),e.push({op:"replace",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,"size",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m("MapSet",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?g(c):O(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);export default fn;export{un as Immer,pn as applyPatches,K as castDraft,$ as castImmutable,ln as createDraft,R as current,J as enableAllPlugins,F as enableES5,C as enableMapSet,T as enablePatches,dn as finishDraft,d as freeze,L as immerable,r as isDraft,t as isDraftable,H as nothing,e as original,fn as produce,cn as produceWithPatches,sn as setAutoFreeze,vn as setUseProxies};
0.8
Source map: webpack://frontend-tpt/../../node_modules/immer/dist/immer.esm.mjs
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return"'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return!!n&&!!n[Q]}function t(n){var r;return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return"production"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return"production"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];"production"!==process.env.NODE_ENV&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.g&&n(3,JSON.stringify(p(r)))}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c="add";m("Patches",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];"string"!=typeof p&&"number"!=typeof p&&(p=""+p),0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return"-"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=r.concat(n);t.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:r.concat(["length"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:"replace",path:[],value:r===H?void 0:r}),e.push({op:"replace",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,"size",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m("MapSet",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?g(c):O(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);export default fn;export{un as Immer,pn as applyPatches,K as castDraft,$ as castImmutable,ln as createDraft,R as current,J as enableAllPlugins,F as enableES5,C as enableMapSet,T as enablePatches,dn as finishDraft,d as freeze,L as immerable,r as isDraft,t as isDraftable,H as nothing,e as original,fn as produce,cn as produceWithPatches,sn as setAutoFreeze,vn as setUseProxies};
//# sourceMappingURL=immer.esm.js.map
internal_url
if (process.env.NODE_ENV !== 'production') {
0.8
Source map: webpack://frontend-tpt/../../node_modules/@reduxjs/toolkit/node_modules/redux/es/redux.js
var typeOfVal = typeof val;
if (process.env.NODE_ENV !== 'production') {
typeOfVal = miniKindOf(val);
}
internal_url
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
0.8
Source map: webpack://frontend-tpt/../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js
throw new Error("`name` is a required option for createSlice");
}
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
if (options.initialState === void 0) {
console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
internal_url
var isProduction = process.env.NODE_ENV === "production";
0.8
Source map: webpack://frontend-tpt/../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js
}
// src/immutableStateInvariantMiddleware.ts
var isProduction = process.env.NODE_ENV === "production";
var prefix = "Invariant failed";
function invariant(condition, message) {
internal_url
throw process.env.NODE_ENV === "production" ? new InvariantError(17) : new InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" +
0.8
Source map: webpack://frontend-tpt/../../node_modules/apollo-utilities/lib/bundle.esm.js
}
else {
throw process.env.NODE_ENV === "production" ? new InvariantError(17) : new InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" +
'is not supported. Use variables instead of inline arguments to ' +
'overcome this limitation.');
internal_url
process.env.NODE_ENV === "production" ? invariant(hasOwnProperty.call(root, info.resultKey) ||
0.8
Source map: webpack://frontend-tpt/../../node_modules/graphql-anywhere/lib/bundle.esm.js
if (variables === void 0) { variables = {}; }
var resolver = function (fieldName, root, args, context, info) {
process.env.NODE_ENV === "production" ? invariant(hasOwnProperty.call(root, info.resultKey) ||
(!variables && hasVariableInclusions(info.field.directives)), 1) : invariant(hasOwnProperty.call(root, info.resultKey) ||
(!variables && hasVariableInclusions(info.field.directives)), info.resultKey + " missing on " + JSON.stringify(root));
internal_url
* uri: 'http://localhost:4000/',
0.8
Source map: webpack://frontend-tpt/../../node_modules/@apollo/client/core/ApolloClient.js
* // Provide required constructor fields
* cache: cache,
* uri: 'http://localhost:4000/',
*
* // Provide some optional constructor fields
internal_url
if (process.env.NODE_ENV === "development") {
0.8
Source map: webpack://frontend-tpt/./src/entry-client.tsx
);
if (process.env.NODE_ENV === "development") {
// @ts-ignore
if (module.hot) {
internal_url
if (process.env.NODE_ENV === "development") {
0.8
Source map: webpack://frontend-tpt/./src/entry-client.tsx
);
if (process.env.NODE_ENV === "development") {
// @ts-ignore
if (module.hot) {
internal_url
url: "https://storage.googleapis.com",
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-int/base.ts
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static-qa"
}
internal_url
url: "https://storage.googleapis.com",
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-prd/base.ts
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static"
}
internal_url
url: "https://storage.googleapis.com",
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-stg/base.ts
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static-staging"
}
internal_url
url: "https://storage.googleapis.com",
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/production/base.ts
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static"
}
internal_url
url: "https://storage.googleapis.com",
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/qa/base.ts
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static-qa"
}
internal_url
url: "https://storage.googleapis.com",
0.8
Source map: webpack://frontend-tpt/../../packages/tvg-lib-conf/content/staging/base.ts
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static-staging"
}
endpoints from source map (84)
GET
https://support.tvg.com
GET
https://support.tvg.com/tvg/s/articles/360005946853-Contact-Support
GET
http://www.ncpgambling.org/chat
GET
https://storage.googleapis.com
GET
https://sonarqube.gcp-dev.tvg.com
GET
https://promos-api.racing.fanduel.com
GET
../../version.js
GET
../common/stringifyForDisplay.js
GET
../globals/index.js
GET
../../utilities/index.js
GET
../../utilities/globals/index.js
GET
https://github.com/ungap/url-search-params
GET
../_lib/requiredArgs/index.js
GET
/sportsbook
GET
../_lib/toInteger/index.js
GET
../../../_lib/buildFormatLongFn/index.js
GET
../../../_lib/buildLocalizeFn/index.js
GET
../../../_lib/buildMatchPatternFn/index.js
GET
../../../_lib/buildMatchFn/index.js
GET
../../addLeadingZeros/index.js
GET
../../toDate/index.js
GET
../requiredArgs/index.js
GET
../startOfUTCISOWeek/index.js
GET
../toInteger/index.js
GET
../startOfUTCWeek/index.js
GET
../lightFormatters/index.js
GET
../../../_lib/getUTCDayOfYear/index.js
GET
../../../_lib/getUTCISOWeek/index.js
GET
../../../_lib/getUTCISOWeekYear/index.js
GET
../../../_lib/getUTCWeek/index.js
GET
../../../_lib/getUTCWeekYear/index.js
GET
../startOfUTCWeekYear/index.js
GET
../getUTCWeekYear/index.js
GET
../startOfUTCISOWeekYear/index.js
GET
../getUTCISOWeekYear/index.js
GET
../isValid/index.js
GET
../locale/en-US/index.js
GET
../subMilliseconds/index.js
GET
../toDate/index.js
GET
../_lib/format/formatters/index.js
GET
../_lib/format/longFormatters/index.js
GET
../_lib/getTimezoneOffsetInMilliseconds/index.js
GET
../_lib/protectedTokens/index.js
GET
../addMilliseconds/index.js
GET
/tracks/results
GET
/tracks/all-info
GET
../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js
GET
../base/dist/emotion-styled-base.browser.esm.js
GET
../../dist/emotion-element-c39617d8.browser.esm.js
GET
../../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js
GET
../differenceInCalendarDays/index.js
GET
../startOfDay/index.js
GET
/error
GET
../../utilities/caching/getMemoryInternals.js
GET
../utilities/globals/index.js
GET
../utilities/index.js
GET
../context/index.js
GET
../../errors/index.js
GET
../../core/index.js
GET
../parser/index.js
GET
../hooks/index.js
GET
../components/index.js
GET
https://api.storyblok.com/v1/cdn/stories
GET
../../utilities/caching/index.js
GET
../caching/getMemoryInternals.js
GET
../common/objects.js
GET
../common/canonicalStringify.js
GET
../utils/index.js
GET
../../../utilities/index.js
GET
../../utilities/common/incrementalResult.js
GET
../caching/index.js
GET
../common/arrays.js
GET
../core/index.js
GET
../common/canUse.js
GET
../core/types/common.js
GET
../core/cache.js
GET
../cache/index.js
GET
../link/core/index.js
GET
../utilities/common/incrementalResult.js
GET
../errors/index.js
GET
../version.js
GET
../link/http/index.js
GET
../utilities/caching/getMemoryInternals.js
GET
https://chrome.google.com/webstore/detail/
source file tree (2114)
2114 files with original sourcewebpack://frontend-tpt/webpack/runtime/create fake namespace object
var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
var leafPrototypes;
// create a fake namespace object
// mode & 1: value is a module id, require it
// mode & 2: merge all properties of value into the ns
// mode & 4: return value when already ns object
// mode & 16: return value when it's Promise-like
// mode & 8|1: behave like require
__webpack_require__.t = function(value, mode) {
if(mode & 1) value = this(value);
if(mode & 8) return value;
if(typeof value === 'object' && value) {
if((mode & 4) && value.__esModule) return value;
if((mode & 16) && typeof value.then === 'function') return value;
}
var ns = Object.create(null);
__webpack_require__.r(ns);
var def = {};
leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
}
def['default'] = () => (value);
__webpack_require__.d(ns, def);
return ns;
};
webpack://frontend-tpt/webpack/runtime/load script
var inProgress = {};
var dataWebpackPrefix = "frontend-tpt:";
// loadScript function to load a script via script tag
__webpack_require__.l = (url, done, key, chunkId) => {
if(inProgress[url]) { inProgress[url].push(done); return; }
var script, needAttach;
if(key !== undefined) {
var scripts = document.getElementsByTagName("script");
for(var i = 0; i < scripts.length; i++) {
var s = scripts[i];
if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
}
}
if(!script) {
needAttach = true;
script = document.createElement('script');
script.charset = 'utf-8';
script.timeout = 120;
if (__webpack_require__.nc) {
script.setAttribute("nonce", __webpack_require__.nc);
}
script.setAttribute("data-webpack", dataWebpackPrefix + key);
script.src = url;
}
inProgress[url] = [done];
var onScriptComplete = (prev, event) => {
// avoid mem leaks in IE.
script.onerror = script.onload = null;
clearTimeout(timeout);
var doneFns = inProgress[url];
delete inProgress[url];
script.parentNode && script.parentNode.removeChild(script);
doneFns && doneFns.forEach((fn) => (fn(event)));
if(prev) return prev(event);
}
var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
script.onerror = onScriptComplete.bind(null, script.onerror);
script.onload = onScriptComplete.bind(null, script.onload);
needAttach && document.head.appendChild(script);
};
webpack://frontend-tpt/../../node_modules/@amplitude/ua-parser-js/src/ua-parser.js
///////////////////////////////////////////////////////////////////////////////// /* UAParser.js v0.7.33 Copyright © 2012-2021 Faisal Salman <[email protected]> MIT License */ /* Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment. Demo : https://faisalman.github.io/ua-parser-js Source : https://github.com/faisalman/ua-parser-js */ ///////////////////////////////////////////////////////////////////////////////// (function (window, undefined) { "use strict"; ////////////// // Constants ///////////// var LIBVERSION = "0.7.33", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", MODEL = "model", NAME = "name", TYPE = "type", VENDOR = "vendor", VERSION = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", UA_MAX_LENGTH = 350; var AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", BROWSER = "Browser", CHROME = "Chrome", EDGE = "Edge", FIREFOX = "Firefox", GOOGLE = "Google", HUAWEI = "Huawei", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", OPERA = "Opera", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", FACEBOOK = "Facebook"; /////////// // Helper ////////// var extend = function (regexes, extensions) { var mergedRegexes = {}; for (var i in regexes) { if (extensions[i] && extensions[i].length % 2 === 0) { mergedRegexes[i] = extensions[i].concat(regexes[i]); } else { mergedRegexes[i] = regexes[i]; } } return mergedRegexes; }, enumerize = function (arr) { var enums = {}; for (var i = 0; i < arr.length; i++) { enums[arr[i].toUpperCase()] = arr[i]; } return enums; }, has = function (str1, str2) { return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false; }, lowerize = function (str) { return str.toLowerCase(); }, majorize = function (version) { return typeof version === STR_TYPE ? version.replace(/[^\d\.]/g, EMPTY).split(".")[0] : undefined; }, trim = function (str, len) { if (typeof str === STR_TYPE) { str = str.replace(/^\s\s*/, EMPTY); return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH); } }; /////////////// // Map helper ////////////// var rgxMapper = function (ua, arrays) { var i = 0, j, k, p, q, matches, match; // loop through all regexes maps while (i < arrays.length && !matches) { var regex = arrays[i], // even sequence (0,2,4,..) props = arrays[i + 1]; // odd sequence (1,3,5,..) j = k = 0; // try matching uastring with regexes while (j < regex.length && !matches) { matches = regex[j++].exec(ua); if (!!matches) { for (p = 0; p < props.length; p++) { match = matches[++k]; q = props[p]; // check if given property is actually array if (typeof q === OBJ_TYPE && q.length > 0) { if (q.length === 2) { if (typeof q[1] == FUNC_TYPE) { // assign modified match this[q[0]] = q[1].call(this, match); } else { // assign given value, ignore regex match this[q[0]] = q[1]; } } else if (q.length === 3) { // check whether function or regex if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) { // call function (usually string mapper) this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; } else { // sanitize match using given regex this[q[0]] = match ? match.replace(q[1], q[2]) : undefined; } } else if (q.length === 4) { this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; } } else { this[q] = match ? match : undefined; } } } } i += 2; } }, strMapper = function (str, map) { for (var i in map) { // check if current value is array if (typeof map[i] === OBJ_TYPE && map[i].length > 0) { for (var j = 0; j < map[i].length; j++) { if (has(map[i][j], str)) { return i === UNKNOWN ? undefined : i; } } } else if (has(map[i], str)) { return i === UNKNOWN ? undefined : i; } } return str; }; /////////////// // String map ////////////// // Safari < 3.0 var oldSafariMap = { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" }, windowsVersionMap = { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2000: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", 8.1: "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" }; ////////////// // Regex map ///////////// var regexes = { browser: [ [ /\b(?:crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS ], [VERSION, [NAME, "Chrome"]], [ /edg(?:e|ios|a)?\/([\w\.]+)/i // Microsoft Edge ], [VERSION, [NAME, "Edge"]], [ // Presto based /(opera mini)\/([-\w\.]+)/i, // Opera Mini /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, // Opera Mobi/Tablet /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i // Opera ], [NAME, VERSION], [ /opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0 ], [VERSION, [NAME, OPERA + " Mini"]], [ /\bopr\/([\w\.]+)/i // Opera Webkit ], [VERSION, [NAME, OPERA]], [ // Mixed /(kindle)\/([\w\.]+)/i, // Kindle /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer // Trident based /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser /(ba?idubrowser)[\/ ]?([\w\.]+)/i, // Baidu Browser /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ /(weibo)__([\d\.]+)/i // Weibo ], [NAME, VERSION], [ /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser ], [VERSION, [NAME, "UC" + BROWSER]], [ /microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser /\bqbcore\/([\w\.]+).+microm/i ], [VERSION, [NAME, "WeChat(Win) Desktop"]], [ /micromessenger\/([\w\.]+)/i // WeChat ], [VERSION, [NAME, "WeChat"]], [ /konqueror\/([\w\.]+)/i // Konqueror ], [VERSION, [NAME, "Konqueror"]], [ /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11 ], [VERSION, [NAME, "IE"]], [ /yabrowser\/([\w\.]+)/i // Yandex ], [VERSION, [NAME, "Yandex"]], [ /(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser ], [[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION], [ /\bfocus\/([\w\.]+)/i // Firefox Focus ], [VERSION, [NAME, FIREFOX + " Focus"]], [ /\bopt\/([\w\.]+)/i // Opera Touch ], [VERSION, [NAME, OPERA + " Touch"]], [ /coc_coc\w+\/([\w\.]+)/i // Coc Coc Browser ], [VERSION, [NAME, "Coc Coc"]], [ /dolfin\/([\w\.]+)/i // Dolphin ], [VERSION, [NAME, "Dolphin"]], [ /coast\/([\w\.]+)/i // Opera Coast ], [VERSION, [NAME, OPERA + " Coast"]], [ /miuibrowser\/([\w\.]+)/i // MIUI Browser ], [VERSION, [NAME, "MIUI " + BROWSER]], [ /fxios\/([-\w\.]+)/i // Firefox for iOS ], [VERSION, [NAME, FIREFOX]], [ /\bqihu|(qi?ho?o?|360)browser/i // 360 ], [[NAME, "360 " + BROWSER]], [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i], [[NAME, /(.+)/, "$1 " + BROWSER], VERSION], [ // Oculus/Samsung/Sailfish/Huawei Browser /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon ], [[NAME, /_/g, " "], VERSION], [ /(electron)\/([\w\.]+) safari/i, // Electron-based App /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/Baidu App/2345 Browser ], [NAME, VERSION], [ /(metasr)[\/ ]?([\w\.]+)/i, // SouGouBrowser /(lbbrowser)/i, // LieBao Browser /\[(linkedin)app\]/i // LinkedIn App for iOS & Android ], [NAME], [ // WebView /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android ], [[NAME, FACEBOOK], VERSION], [ /safari (line)\/([\w\.]+)/i, // Line App for iOS /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android /(chromium|instagram)[\/ ]([-\w\.]+)/i // Chromium/Instagram ], [NAME, VERSION], [ /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS ], [VERSION, [NAME, "GSA"]], [ /headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless ], [VERSION, [NAME, CHROME + " Headless"]], [ / wv\).+(chrome)\/([\w\.]+)/i // Chrome WebView ], [[NAME, CHROME + " WebView"], VERSION], [ /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i // Android Browser ], [VERSION, [NAME, "Android " + BROWSER]], [ /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia ], [NAME, VERSION], [ /version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i // Mobile Safari ], [VERSION, [NAME, "Mobile Safari"]], [ /version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile ], [VERSION, NAME], [ /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 ], [NAME, [VERSION, strMapper, oldSafariMap]], [/(webkit|khtml)\/([\w\.]+)/i], [NAME, VERSION], [ // Gecko based /(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape ], [[NAME, "Netscape"], VERSION], [ /mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality ], [VERSION, [NAME, FIREFOX + " Reality"]], [ /ekiohf.+(flow)\/([\w\.]+)/i, // Flow /(swiftfox)/i, // Swiftfox /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix /(firefox)\/([\w\.]+)/i, // Other Firefox-based /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, // Mozilla // Other /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser /(links) \(([\w\.]+)/i // Links ], [NAME, VERSION], [ /(cobalt)\/([\w\.]+)/i // Cobalt ], [NAME, [VERSION, /master.|lts./, ""]] ], cpu: [ [ /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i // AMD64 (x64) ], [[ARCHITECTURE, "amd64"]], [ /(ia32(?=;))/i // IA32 (quicktime) ], [[ARCHITECTURE, lowerize]], [ /((?:i[346]|x)86)[;\)]/i // IA32 (x86) ], [[ARCHITECTURE, "ia32"]], [ /\b(aarch64|arm(v?8e?l?|_?64))\b/i // ARM64 ], [[ARCHITECTURE, "arm64"]], [ /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i // ARMHF ], [[ARCHITECTURE, "armhf"]], [ // PocketPC mistakenly identified as PowerPC /windows (ce|mobile); ppc;/i ], [[ARCHITECTURE, "arm"]], [ /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i // PowerPC ], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [ /(sun4\w)[;\)]/i // SPARC ], [[ARCHITECTURE, "sparc"]], [ /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC ], [[ARCHITECTURE, lowerize]] ], device: [ [ ////////////////////////// // MOBILES & TABLETS // Ordered by popularity ///////////////////////// // Samsung /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i ], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [ /\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i, /samsung[- ]([-\w]+)/i, /sec-(sgh\w+)/i ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [ // Apple /((ipod|iphone)\d+,\d+)/i // iPod/iPhone model ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [ /(ipad\d+,\d+)/i // iPad model ], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [ /\((ip(?:hone|od)[\w ]*);/i // iPod/iPhone ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [ /\((ipad);[-\w\),; ]+apple/i, // iPad /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i ], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [/(macintosh);/i], [MODEL, [VENDOR, APPLE]], [ // Huawei /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i ], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [ /(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i ], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [ // Xiaomi /\b(poco[\w ]+)(?: bui|\))/i, // Xiaomi POCO /\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i // Xiaomi Mi ], [ [MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE, MOBILE] ], [ /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i // Mi Pad tablets ], [ [MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE, TABLET] ], [ // OPPO /; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i ], [MODEL, [VENDOR, "OPPO"], [TYPE, MOBILE]], [ // Vivo /vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i ], [MODEL, [VENDOR, "Vivo"], [TYPE, MOBILE]], [ // Realme /\b(rmx[12]\d{3})(?: bui|;|\))/i ], [MODEL, [VENDOR, "Realme"], [TYPE, MOBILE]], [ // Motorola /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i ], [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], [ // LG /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i ], [MODEL, [VENDOR, LG], [TYPE, TABLET]], [ /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i ], [MODEL, [VENDOR, LG], [TYPE, MOBILE]], [ // Lenovo /(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i ], [MODEL, [VENDOR, "Lenovo"], [TYPE, TABLET]], [ // Nokia /(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i ], [ [MODEL, /_/g, " "], [VENDOR, "Nokia"], [TYPE, MOBILE] ], [ // Google /(pixel c)\b/i // Google Pixel C ], [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], [ /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i // Google Pixel ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [ // Sony /droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i ], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], [ [MODEL, "Xperia Tablet"], [VENDOR, SONY], [TYPE, TABLET] ], [ // OnePlus / (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i ], [MODEL, [VENDOR, "OnePlus"], [TYPE, MOBILE]], [ // Amazon /(alexa)webm/i, /(kf[a-z]{2}wi)( bui|\))/i, // Kindle Fire without Silk /(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [ /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone ], [ [MODEL, /(.+)/g, "Fire Phone $1"], [VENDOR, AMAZON], [TYPE, MOBILE] ], [ // BlackBerry /(playbook);[-\w\),; ]+(rim)/i // BlackBerry PlayBook ], [MODEL, VENDOR, [TYPE, TABLET]], [ /\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i // BlackBerry 10 ], [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], [ // Asus /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i ], [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], [ // HTC /(nexus 9)/i // HTC Nexus 9 ], [MODEL, [VENDOR, "HTC"], [TYPE, TABLET]], [ /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, // HTC // ZTE /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony ], [VENDOR, [MODEL, /_/g, " "], [TYPE, MOBILE]], [ // Acer /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i ], [MODEL, [VENDOR, "Acer"], [TYPE, TABLET]], [ // Meizu /droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i ], [MODEL, [VENDOR, "Meizu"], [TYPE, MOBILE]], [ // Sharp /\b(sh-?[altvz]?\d\d[a-ekm]?)/i ], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [ // MIXED /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron /(hp) ([\w ]+\w)/i, // HP iPAQ /(asus)-?(\w+)/i, // Asus /(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia /(lenovo)[-_ ]?([-\w]+)/i, // Lenovo /(jolla)/i, // Jolla /(oppo) ?([\w ]+) bui/i // OPPO ], [VENDOR, MODEL, [TYPE, MOBILE]], [ /(archos) (gamepad2?)/i, // Archos /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad /(kindle)\/([\w\.]+)/i, // Kindle /(nook)[\w ]+build\/(\w+)/i, // Nook /(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets /(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets /(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets /(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone ], [VENDOR, MODEL, [TYPE, TABLET]], [ /(surface duo)/i // Surface Duo ], [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], [ /droid [\d\.]+; (fp\du?)(?: b|\))/i // Fairphone ], [MODEL, [VENDOR, "Fairphone"], [TYPE, MOBILE]], [ /(u304aa)/i // AT&T ], [MODEL, [VENDOR, "AT&T"], [TYPE, MOBILE]], [ /\bsie-(\w*)/i // Siemens ], [MODEL, [VENDOR, "Siemens"], [TYPE, MOBILE]], [ /\b(rct\w+) b/i // RCA Tablets ], [MODEL, [VENDOR, "RCA"], [TYPE, TABLET]], [ /\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets ], [MODEL, [VENDOR, "Dell"], [TYPE, TABLET]], [ /\b(q(?:mv|ta)\w+) b/i // Verizon Tablet ], [MODEL, [VENDOR, "Verizon"], [TYPE, TABLET]], [ /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet ], [MODEL, [VENDOR, "Barnes & Noble"], [TYPE, TABLET]], [/\b(tm\d{3}\w+) b/i], [MODEL, [VENDOR, "NuVision"], [TYPE, TABLET]], [ /\b(k88) b/i // ZTE K Series Tablet ], [MODEL, [VENDOR, "ZTE"], [TYPE, TABLET]], [ /\b(nx\d{3}j) b/i // ZTE Nubia ], [MODEL, [VENDOR, "ZTE"], [TYPE, MOBILE]], [ /\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile ], [MODEL, [VENDOR, "Swiss"], [TYPE, MOBILE]], [ /\b(zur\d{3}) b/i // Swiss ZUR Tablet ], [MODEL, [VENDOR, "Swiss"], [TYPE, TABLET]], [ /\b((zeki)?tb.*\b) b/i // Zeki Tablets ], [MODEL, [VENDOR, "Zeki"], [TYPE, TABLET]], [ /\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet ], [[VENDOR, "Dragon Touch"], MODEL, [TYPE, TABLET]], [ /\b(ns-?\w{0,9}) b/i // Insignia Tablets ], [MODEL, [VENDOR, "Insignia"], [TYPE, TABLET]], [ /\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets ], [MODEL, [VENDOR, "NextBook"], [TYPE, TABLET]], [ /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones ], [[VENDOR, "Voice"], MODEL, [TYPE, MOBILE]], [ /\b(lvtel\-)?(v1[12]) b/i // LvTel Phones ], [[VENDOR, "LvTel"], MODEL, [TYPE, MOBILE]], [ /\b(ph-1) /i // Essential PH-1 ], [MODEL, [VENDOR, "Essential"], [TYPE, MOBILE]], [ /\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets ], [MODEL, [VENDOR, "Envizen"], [TYPE, TABLET]], [ /\b(trio[-\w\. ]+) b/i // MachSpeed Tablets ], [MODEL, [VENDOR, "MachSpeed"], [TYPE, TABLET]], [ /\btu_(1491) b/i // Rotor Tablets ], [MODEL, [VENDOR, "Rotor"], [TYPE, TABLET]], [ /(shield[\w ]+) b/i // Nvidia Shield Tablets ], [MODEL, [VENDOR, "Nvidia"], [TYPE, TABLET]], [ /(sprint) (\w+)/i // Sprint Phones ], [VENDOR, MODEL, [TYPE, MOBILE]], [ /(kin\.[onetw]{3})/i // Microsoft Kin ], [ [MODEL, /\./g, " "], [VENDOR, MICROSOFT], [TYPE, MOBILE] ], [ /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i // Zebra ], [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], [ /////////////////// // CONSOLES /////////////////// /(ouya)/i, // Ouya /(nintendo) ([wids3utch]+)/i // Nintendo ], [VENDOR, MODEL, [TYPE, CONSOLE]], [ /droid.+; (shield) bui/i // Nvidia ], [MODEL, [VENDOR, "Nvidia"], [TYPE, CONSOLE]], [ /(playstation [345portablevi]+)/i // Playstation ], [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], [ /\b(xbox(?: one)?(?!; xbox))[\); ]/i // Microsoft Xbox ], [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], [ /////////////////// // SMARTTVS /////////////////// /smart-tv.+(samsung)/i // Samsung ], [VENDOR, [TYPE, SMARTTV]], [/hbbtv.+maple;(\d+)/i], [ [MODEL, /^/, "SmartTV"], [VENDOR, SAMSUNG], [TYPE, SMARTTV] ], [ /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i // LG SmartTV ], [ [VENDOR, LG], [TYPE, SMARTTV] ], [ /(apple) ?tv/i // Apple TV ], [VENDOR, [MODEL, APPLE + " TV"], [TYPE, SMARTTV]], [ /crkey/i // Google Chromecast ], [ [MODEL, CHROME + "cast"], [VENDOR, GOOGLE], [TYPE, SMARTTV] ], [ /droid.+aft(\w)( bui|\))/i // Fire TV ], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [ /\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i // Sharp ], [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]], [ /(bravia[\w ]+)( bui|\))/i // Sony ], [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], [ /(mitv-\w{5}) bui/i // Xiaomi ], [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]], [ /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku /hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i // HbbTV devices ], [ [VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV] ], [ /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i // SmartTV from Unidentified Vendors ], [[TYPE, SMARTTV]], [ /////////////////// // WEARABLES /////////////////// /((pebble))app/i // Pebble ], [VENDOR, MODEL, [TYPE, WEARABLE]], [ /droid.+; (glass) \d/i // Google Glass ], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [/droid.+; (wt63?0{2,3})\)/i], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [ /(quest( 2)?)/i // Oculus Quest ], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [ /////////////////// // EMBEDDED /////////////////// /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla ], [VENDOR, [TYPE, EMBEDDED]], [ //////////////////// // MIXED (GENERIC) /////////////////// /droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors ], [MODEL, [TYPE, MOBILE]], [ /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors ], [MODEL, [TYPE, TABLET]], [ /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i // Unidentifiable Tablet ], [[TYPE, TABLET]], [ /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile ], [[TYPE, MOBILE]], [ /(android[-\w\. ]{0,9});.+buil/i // Generic Android Device ], [MODEL, [VENDOR, "Generic"]] ], engine: [ [ /windows.+ edge\/([\w\.]+)/i // EdgeHTML ], [VERSION, [NAME, EDGE + "HTML"]], [ /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink ], [VERSION, [NAME, "Blink"]], [ /(presto)\/([\w\.]+)/i, // Presto /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna /ekioh(flow)\/([\w\.]+)/i, // Flow /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/ ]([23]\.[\d\.]+)/i // iCab ], [NAME, VERSION], [ /rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko ], [VERSION, NAME] ], os: [ [ // Windows /microsoft (windows) (vista|xp)/i // Windows (iTunes) ], [NAME, VERSION], [ /(windows) nt 6\.2; (arm)/i, // Windows RT /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, // Windows Phone /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i ], [NAME, [VERSION, strMapper, windowsVersionMap]], [/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i], [ [NAME, "Windows"], [VERSION, strMapper, windowsVersionMap] ], [ // iOS/macOS /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS /cfnetwork\/.+darwin/i ], [ [VERSION, /_/g, "."], [NAME, "iOS"] ], [ /(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i // Mac OS ], [ [NAME, "Mac OS"], [VERSION, /_/g, "."] ], [ // Mobile OSes /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, // Blackberry /(tizen|kaios)[\/ ]([\w\.]+)/i, // Tizen/KaiOS /\((series40);/i // Series 40 ], [NAME, VERSION], [ /\(bb(10);/i // BlackBerry 10 ], [VERSION, [NAME, BLACKBERRY]], [ /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i // Symbian ], [VERSION, [NAME, "Symbian"]], [ /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i // Firefox OS ], [VERSION, [NAME, FIREFOX + " OS"]], [ /web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS ], [VERSION, [NAME, "webOS"]], [ // Google Chromecast /crkey\/([\d\.]+)/i // Google Chromecast ], [VERSION, [NAME, CHROME + "cast"]], [ /(cros) [\w]+ ([\w\.]+\w)/i // Chromium OS ], [[NAME, "Chromium OS"], VERSION], [ // Console /(nintendo|playstation) ([wids345portablevuch]+)/i, // Nintendo/Playstation /(xbox); +xbox ([^\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S) // Other /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, // Joli/Palm /(mint)[\/\(\) ]?(\w*)/i, // Mint /(mageia|vectorlinux)[; ]/i, // Mageia/VectorLinux /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire /(hurd|linux) ?([\w\.]*)/i, // Hurd/Linux /(gnu) ?([\w\.]*)/i, // GNU /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly /(haiku) (\w+)/i // Haiku ], [NAME, VERSION], [ /(sunos) ?([\w\.\d]*)/i // Solaris ], [[NAME, "Solaris"], VERSION], [ /((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX /(unix) ?([\w\.]*)/i // UNIX ], [NAME, VERSION] ] }; ///////////////// // Constructor //////////////// var UAParser = function (ua, extensions) { if (typeof ua === OBJ_TYPE) { extensions = ua; ua = undefined; } if (!(this instanceof UAParser)) { return new UAParser(ua, extensions).getResult(); } var _ua = ua || (typeof window !== UNDEF_TYPE && window.navigator && window.navigator.userAgent ? window.navigator.userAgent : EMPTY); var _rgxmap = extensions ? extend(regexes, extensions) : regexes; this.getBrowser = function () { var _browser = {}; _browser[NAME] = undefined; _browser[VERSION] = undefined; rgxMapper.call(_browser, _ua, _rgxmap.browser); _browser.major = majorize(_browser.version); return _browser; }; this.getCPU = function () { var _cpu = {}; _cpu[ARCHITECTURE] = undefined; rgxMapper.call(_cpu, _ua, _rgxmap.cpu); return _cpu; }; this.getDevice = function () { var _device = {}; _device[VENDOR] = undefined; _device[MODEL] = undefined; _device[TYPE] = undefined; rgxMapper.call(_device, _ua, _rgxmap.device); return _device; }; this.getEngine = function () { var _engine = {}; _engine[NAME] = undefined; _engine[VERSION] = undefined; rgxMapper.call(_engine, _ua, _rgxmap.engine); return _engine; }; this.getOS = function () { var _os = {}; _os[NAME] = undefined; _os[VERSION] = undefined; rgxMapper.call(_os, _ua, _rgxmap.os); return _os; }; this.getResult = function () { return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() }; }; this.getUA = function () { return _ua; }; this.setUA = function (ua) { _ua = typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH ? trim(ua, UA_MAX_LENGTH) : ua; return this; }; this.setUA(_ua); return this; }; UAParser.VERSION = LIBVERSION; UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]); UAParser.CPU = enumerize([ARCHITECTURE]); UAParser.DEVICE = enumerize([ MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED ]); UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]); /////////// // Export ////////// // check js environment if (typeof exports !== UNDEF_TYPE) { // nodejs env if (typeof module !== UNDEF_TYPE && module.exports) { exports = module.exports = UAParser; } exports.UAParser = UAParser; } else { // requirejs env (optional) if (typeof define === FUNC_TYPE && define.amd) { define(function () { return UAParser; }); } else if (typeof window !== UNDEF_TYPE) { // browser env window.UAParser = UAParser; } } // jQuery/Zepto specific (optional) // Note: // In AMD env the global scope should be kept clean, but jQuery is an exception. // jQuery always exports to global scope, unless jQuery.noConflict(true) is used, // and we should catch that. var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto); if ($ && !$.ua) { var parser = new UAParser(); $.ua = parser.getResult(); $.ua.get = function () { return parser.getUA(); }; $.ua.set = function (ua) { parser.setUA(ua); var result = parser.getResult(); for (var prop in result) { $.ua[prop] = result[prop]; } }; } })(typeof window === "object" ? window : this);
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
module.exports = _arrayLikeToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js
var arrayLikeToArray = require("./arrayLikeToArray.js");
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return arrayLikeToArray(arr);
}
module.exports = _arrayWithoutHoles;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/assertThisInitialized.js
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/classCallCheck.js
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
module.exports = _classCallCheck;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/createClass.js
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
module.exports = _createClass;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/defineProperty.js
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/getPrototypeOf.js
function _getPrototypeOf(o) {
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
return _getPrototypeOf(o);
}
module.exports = _getPrototypeOf;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/inherits.js
var setPrototypeOf = require("./setPrototypeOf.js");
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) setPrototypeOf(subClass, superClass);
}
module.exports = _inherits;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/interopRequireDefault.js
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/iterableToArray.js
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
module.exports = _iterableToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/nonIterableSpread.js
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module.exports = _nonIterableSpread;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose.js");
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
module.exports = _objectWithoutProperties;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
module.exports = _objectWithoutPropertiesLoose;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
var _typeof = require("@babel/runtime/helpers/typeof")["default"];
var assertThisInitialized = require("./assertThisInitialized.js");
function _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === "object" || typeof call === "function")) {
return call;
}
return assertThisInitialized(self);
}
module.exports = _possibleConstructorReturn;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/setPrototypeOf.js
function _setPrototypeOf(o, p) {
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
return _setPrototypeOf(o, p);
}
module.exports = _setPrototypeOf;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/toConsumableArray.js
var arrayWithoutHoles = require("./arrayWithoutHoles.js");
var iterableToArray = require("./iterableToArray.js");
var unsupportedIterableToArray = require("./unsupportedIterableToArray.js");
var nonIterableSpread = require("./nonIterableSpread.js");
function _toConsumableArray(arr) {
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
}
module.exports = _toConsumableArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/typeof.js
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
}
return _typeof(obj);
}
module.exports = _typeof;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js
var arrayLikeToArray = require("./arrayLikeToArray.js");
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
}
module.exports = _unsupportedIterableToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
webpack://frontend-tpt/../../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var runtime = (function (exports) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define(obj, key, value) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
return obj[key];
}
try {
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
define({}, "");
} catch (err) {
define = function(obj, key, value) {
return obj[key] = value;
};
}
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
exports.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype =
Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunction.displayName = define(
GeneratorFunctionPrototype,
toStringTagSymbol,
"GeneratorFunction"
);
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
define(prototype, method, function(arg) {
return this._invoke(method, arg);
});
});
}
exports.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
exports.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
define(genFun, toStringTagSymbol, "GeneratorFunction");
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
exports.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return PromiseImpl.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return PromiseImpl.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration.
result.value = unwrapped;
resolve(result);
}, function(error) {
// If a rejected Promise was yielded, throw the rejection back
// into the async generator function so it can be handled there.
return invoke("throw", error, resolve, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
exports.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0) PromiseImpl = Promise;
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList),
PromiseImpl
);
return exports.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done
? GenStateCompleted
: GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
// Note: ["return"] must be used for ES3 parsing compatibility.
if (delegate.iterator["return"]) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (! info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value;
// Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
define(Gp, toStringTagSymbol, "Generator");
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function() {
return this;
};
Gp.toString = function() {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports.keys = function(object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
}
// Return an iterator with no values.
return { next: doneResult };
}
exports.values = values;
function doneResult() {
return { value: undefined, done: true };
}
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !! caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry &&
(type === "break" ||
type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" ||
record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
}
};
// Regardless of whether this script is executing as a CommonJS module
// or not, return the runtime object so that we can declare the variable
// regeneratorRuntime in the outer scope, which allows this module to be
// injected easily by `bin/regenerator --include-runtime script.js`.
return exports;
}(
// If this script is executing as a CommonJS module, use module.exports
// as the regeneratorRuntime namespace. Otherwise create a new empty
// object. Either way, the resulting object will be used to initialize
// the regeneratorRuntime variable at the top of this file.
typeof module === "object" ? module.exports : {}
));
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
Function("r", "regeneratorRuntime = r")(runtime);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/regenerator/index.js
module.exports = require("regenerator-runtime");
webpack://frontend-tpt/../../node_modules/accounting/accounting.js
/*!
* accounting.js v0.4.1
* Copyright 2014 Open Exchange Rates
*
* Freely distributable under the MIT license.
* Portions of accounting.js are inspired or borrowed from underscore.js
*
* Full details and documentation:
* http://openexchangerates.github.io/accounting.js/
*/
(function(root, undefined) {
/* --- Setup --- */
// Create the local library object, to be exported or referenced globally later
var lib = {};
// Current version
lib.version = '0.4.1';
/* --- Exposed settings --- */
// The library's settings configuration object. Contains default parameters for
// currency and number formatting
lib.settings = {
currency: {
symbol : "$", // default currency symbol is '$'
format : "%s%v", // controls output: %s = symbol, %v = value (can be object, see docs)
decimal : ".", // decimal point separator
thousand : ",", // thousands separator
precision : 2, // decimal places
grouping : 3 // digit grouping (not implemented yet)
},
number: {
precision : 0, // default precision on numbers is 0
grouping : 3, // digit grouping (not implemented yet)
thousand : ",",
decimal : "."
}
};
/* --- Internal Helper Methods --- */
// Store reference to possibly-available ECMAScript 5 methods for later
var nativeMap = Array.prototype.map,
nativeIsArray = Array.isArray,
toString = Object.prototype.toString;
/**
* Tests whether supplied parameter is a string
* from underscore.js
*/
function isString(obj) {
return !!(obj === '' || (obj && obj.charCodeAt && obj.substr));
}
/**
* Tests whether supplied parameter is a string
* from underscore.js, delegates to ECMA5's native Array.isArray
*/
function isArray(obj) {
return nativeIsArray ? nativeIsArray(obj) : toString.call(obj) === '[object Array]';
}
/**
* Tests whether supplied parameter is a true object
*/
function isObject(obj) {
return obj && toString.call(obj) === '[object Object]';
}
/**
* Extends an object with a defaults object, similar to underscore's _.defaults
*
* Used for abstracting parameter handling from API methods
*/
function defaults(object, defs) {
var key;
object = object || {};
defs = defs || {};
// Iterate over object non-prototype properties:
for (key in defs) {
if (defs.hasOwnProperty(key)) {
// Replace values with defaults only if undefined (allow empty/zero values):
if (object[key] == null) object[key] = defs[key];
}
}
return object;
}
/**
* Implementation of `Array.map()` for iteration loops
*
* Returns a new Array as a result of calling `iterator` on each array value.
* Defers to native Array.map if available
*/
function map(obj, iterator, context) {
var results = [], i, j;
if (!obj) return results;
// Use native .map method if it exists:
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
// Fallback for native .map:
for (i = 0, j = obj.length; i < j; i++ ) {
results[i] = iterator.call(context, obj[i], i, obj);
}
return results;
}
/**
* Check and normalise the value of precision (must be positive integer)
*/
function checkPrecision(val, base) {
val = Math.round(Math.abs(val));
return isNaN(val)? base : val;
}
/**
* Parses a format string or object and returns format obj for use in rendering
*
* `format` is either a string with the default (positive) format, or object
* containing `pos` (required), `neg` and `zero` values (or a function returning
* either a string or object)
*
* Either string or format.pos must contain "%v" (value) to be valid
*/
function checkCurrencyFormat(format) {
var defaults = lib.settings.currency.format;
// Allow function as format parameter (should return string or object):
if ( typeof format === "function" ) format = format();
// Format can be a string, in which case `value` ("%v") must be present:
if ( isString( format ) && format.match("%v") ) {
// Create and return positive, negative and zero formats:
return {
pos : format,
neg : format.replace("-", "").replace("%v", "-%v"),
zero : format
};
// If no format, or object is missing valid positive value, use defaults:
} else if ( !format || !format.pos || !format.pos.match("%v") ) {
// If defaults is a string, casts it to an object for faster checking next time:
return ( !isString( defaults ) ) ? defaults : lib.settings.currency.format = {
pos : defaults,
neg : defaults.replace("%v", "-%v"),
zero : defaults
};
}
// Otherwise, assume format was fine:
return format;
}
/* --- API Methods --- */
/**
* Takes a string/array of strings, removes all formatting/cruft and returns the raw float value
* Alias: `accounting.parse(string)`
*
* Decimal must be included in the regular expression to match floats (defaults to
* accounting.settings.number.decimal), so if the number uses a non-standard decimal
* separator, provide it as the second argument.
*
* Also matches bracketed negatives (eg. "$ (1.99)" => -1.99)
*
* Doesn't throw any errors (`NaN`s become 0) but this may change in future
*/
var unformat = lib.unformat = lib.parse = function(value, decimal) {
// Recursively unformat arrays:
if (isArray(value)) {
return map(value, function(val) {
return unformat(val, decimal);
});
}
// Fails silently (need decent errors):
value = value || 0;
// Return the value as-is if it's already a number:
if (typeof value === "number") return value;
// Default decimal point comes from settings, but could be set to eg. "," in opts:
decimal = decimal || lib.settings.number.decimal;
// Build regex to strip out everything except digits, decimal point and minus sign:
var regex = new RegExp("[^0-9-" + decimal + "]", ["g"]),
unformatted = parseFloat(
("" + value)
.replace(/\((.*)\)/, "-$1") // replace bracketed values with negatives
.replace(regex, '') // strip out any cruft
.replace(decimal, '.') // make sure decimal point is standard
);
// This will fail silently which may cause trouble, let's wait and see:
return !isNaN(unformatted) ? unformatted : 0;
};
/**
* Implementation of toFixed() that treats floats more like decimals
*
* Fixes binary rounding issues (eg. (0.615).toFixed(2) === "0.61") that present
* problems for accounting- and finance-related software.
*/
var toFixed = lib.toFixed = function(value, precision) {
precision = checkPrecision(precision, lib.settings.number.precision);
var power = Math.pow(10, precision);
// Multiply up by precision, round accurately, then divide and use native toFixed():
return (Math.round(lib.unformat(value) * power) / power).toFixed(precision);
};
/**
* Format a number, with comma-separated thousands and custom precision/decimal places
* Alias: `accounting.format()`
*
* Localise by overriding the precision and thousand / decimal separators
* 2nd parameter `precision` can be an object matching `settings.number`
*/
var formatNumber = lib.formatNumber = lib.format = function(number, precision, thousand, decimal) {
// Resursively format arrays:
if (isArray(number)) {
return map(number, function(val) {
return formatNumber(val, precision, thousand, decimal);
});
}
// Clean up number:
number = unformat(number);
// Build options object from second param (if object) or all params, extending defaults:
var opts = defaults(
(isObject(precision) ? precision : {
precision : precision,
thousand : thousand,
decimal : decimal
}),
lib.settings.number
),
// Clean up precision
usePrecision = checkPrecision(opts.precision),
// Do some calc:
negative = number < 0 ? "-" : "",
base = parseInt(toFixed(Math.abs(number || 0), usePrecision), 10) + "",
mod = base.length > 3 ? base.length % 3 : 0;
// Format the number:
return negative + (mod ? base.substr(0, mod) + opts.thousand : "") + base.substr(mod).replace(/(\d{3})(?=\d)/g, "$1" + opts.thousand) + (usePrecision ? opts.decimal + toFixed(Math.abs(number), usePrecision).split('.')[1] : "");
};
/**
* Format a number into currency
*
* Usage: accounting.formatMoney(number, symbol, precision, thousandsSep, decimalSep, format)
* defaults: (0, "$", 2, ",", ".", "%s%v")
*
* Localise by overriding the symbol, precision, thousand / decimal separators and format
* Second param can be an object matching `settings.currency` which is the easiest way.
*
* To do: tidy up the parameters
*/
var formatMoney = lib.formatMoney = function(number, symbol, precision, thousand, decimal, format) {
// Resursively format arrays:
if (isArray(number)) {
return map(number, function(val){
return formatMoney(val, symbol, precision, thousand, decimal, format);
});
}
// Clean up number:
number = unformat(number);
// Build options object from second param (if object) or all params, extending defaults:
var opts = defaults(
(isObject(symbol) ? symbol : {
symbol : symbol,
precision : precision,
thousand : thousand,
decimal : decimal,
format : format
}),
lib.settings.currency
),
// Check format (returns object with pos, neg and zero):
formats = checkCurrencyFormat(opts.format),
// Choose which format to use for this value:
useFormat = number > 0 ? formats.pos : number < 0 ? formats.neg : formats.zero;
// Return with currency symbol added:
return useFormat.replace('%s', opts.symbol).replace('%v', formatNumber(Math.abs(number), checkPrecision(opts.precision), opts.thousand, opts.decimal));
};
/**
* Format a list of numbers into an accounting column, padding with whitespace
* to line up currency symbols, thousand separators and decimals places
*
* List should be an array of numbers
* Second parameter can be an object containing keys that match the params
*
* Returns array of accouting-formatted number strings of same length
*
* NB: `white-space:pre` CSS rule is required on the list container to prevent
* browsers from collapsing the whitespace in the output strings.
*/
lib.formatColumn = function(list, symbol, precision, thousand, decimal, format) {
if (!list) return [];
// Build options object from second param (if object) or all params, extending defaults:
var opts = defaults(
(isObject(symbol) ? symbol : {
symbol : symbol,
precision : precision,
thousand : thousand,
decimal : decimal,
format : format
}),
lib.settings.currency
),
// Check format (returns object with pos, neg and zero), only need pos for now:
formats = checkCurrencyFormat(opts.format),
// Whether to pad at start of string or after currency symbol:
padAfterSymbol = formats.pos.indexOf("%s") < formats.pos.indexOf("%v") ? true : false,
// Store value for the length of the longest string in the column:
maxLength = 0,
// Format the list according to options, store the length of the longest string:
formatted = map(list, function(val, i) {
if (isArray(val)) {
// Recursively format columns if list is a multi-dimensional array:
return lib.formatColumn(val, opts);
} else {
// Clean up the value
val = unformat(val);
// Choose which format to use for this value (pos, neg or zero):
var useFormat = val > 0 ? formats.pos : val < 0 ? formats.neg : formats.zero,
// Format this value, push into formatted list and save the length:
fVal = useFormat.replace('%s', opts.symbol).replace('%v', formatNumber(Math.abs(val), checkPrecision(opts.precision), opts.thousand, opts.decimal));
if (fVal.length > maxLength) maxLength = fVal.length;
return fVal;
}
});
// Pad each number in the list and send back the column of numbers:
return map(formatted, function(val, i) {
// Only if this is a string (not a nested array, which would have already been padded):
if (isString(val) && val.length < maxLength) {
// Depending on symbol position, pad after symbol or at index 0:
return padAfterSymbol ? val.replace(opts.symbol, opts.symbol+(new Array(maxLength - val.length + 1).join(" "))) : (new Array(maxLength - val.length + 1).join(" ")) + val;
}
return val;
});
};
/* --- Module Definition --- */
// Export accounting for CommonJS. If being loaded as an AMD module, define it as such.
// Otherwise, just add `accounting` to the global object
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = lib;
}
exports.accounting = lib;
} else if (typeof define === 'function' && define.amd) {
// Return the library as an AMD module:
define([], function() {
return lib;
});
} else {
// Use accounting.noConflict to restore `accounting` back to its original value.
// Returns a reference to the library's `accounting` object;
// e.g. `var numbers = accounting.noConflict();`
lib.noConflict = (function(oldAccounting) {
return function() {
// Reset the value of the root's `accounting` variable:
root.accounting = oldAccounting;
// Delete the noConflict method:
lib.noConflict = undefined;
// Return reference to the library to re-assign it:
return lib;
};
})(root.accounting);
// Declare `fx` on the root (global/window) object:
root['accounting'] = lib;
}
// Root will be `window` in browser or `global` on the server:
}(this));
webpack://frontend-tpt/../../node_modules/axios/index.js
module.exports = require('./lib/axios');
webpack://frontend-tpt/../../node_modules/axios/lib/adapters/xhr.js
'use strict';
var utils = require('./../utils');
var settle = require('./../core/settle');
var cookies = require('./../helpers/cookies');
var buildURL = require('./../helpers/buildURL');
var buildFullPath = require('../core/buildFullPath');
var parseHeaders = require('./../helpers/parseHeaders');
var isURLSameOrigin = require('./../helpers/isURLSameOrigin');
var transitionalDefaults = require('../defaults/transitional');
var AxiosError = require('../core/AxiosError');
var CanceledError = require('../cancel/CanceledError');
var parseProtocol = require('../helpers/parseProtocol');
module.exports = function xhrAdapter(config) {
return new Promise(function dispatchXhrRequest(resolve, reject) {
var requestData = config.data;
var requestHeaders = config.headers;
var responseType = config.responseType;
var onCanceled;
function done() {
if (config.cancelToken) {
config.cancelToken.unsubscribe(onCanceled);
}
if (config.signal) {
config.signal.removeEventListener('abort', onCanceled);
}
}
if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
delete requestHeaders['Content-Type']; // Let the browser set it
}
var request = new XMLHttpRequest();
// HTTP basic authentication
if (config.auth) {
var username = config.auth.username || '';
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
}
var fullPath = buildFullPath(config.baseURL, config.url);
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
// Set the request timeout in MS
request.timeout = config.timeout;
function onloadend() {
if (!request) {
return;
}
// Prepare the response
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
request.responseText : request.response;
var response = {
data: responseData,
status: request.status,
statusText: request.statusText,
headers: responseHeaders,
config: config,
request: request
};
settle(function _resolve(value) {
resolve(value);
done();
}, function _reject(err) {
reject(err);
done();
}, response);
// Clean up request
request = null;
}
if ('onloadend' in request) {
// Use onloadend if available
request.onloadend = onloadend;
} else {
// Listen for ready state to emulate onloadend
request.onreadystatechange = function handleLoad() {
if (!request || request.readyState !== 4) {
return;
}
// The request errored out and we didn't get a response, this will be
// handled by onerror instead
// With one exception: request that using file: protocol, most browsers
// will return status as 0 even though it's a successful request
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
return;
}
// readystate handler is calling before onerror or ontimeout handlers,
// so we should call onloadend on the next 'tick'
setTimeout(onloadend);
};
}
// Handle browser request cancellation (as opposed to a manual cancellation)
request.onabort = function handleAbort() {
if (!request) {
return;
}
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
// Clean up request
request = null;
};
// Handle low level network errors
request.onerror = function handleError() {
// Real errors are hidden from us by the browser
// onerror should only fire if it's a network error
reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));
// Clean up request
request = null;
};
// Handle timeout
request.ontimeout = function handleTimeout() {
var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
var transitional = config.transitional || transitionalDefaults;
if (config.timeoutErrorMessage) {
timeoutErrorMessage = config.timeoutErrorMessage;
}
reject(new AxiosError(
timeoutErrorMessage,
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
config,
request));
// Clean up request
request = null;
};
// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if (utils.isStandardBrowserEnv()) {
// Add xsrf header
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
cookies.read(config.xsrfCookieName) :
undefined;
if (xsrfValue) {
requestHeaders[config.xsrfHeaderName] = xsrfValue;
}
}
// Add headers to the request
if ('setRequestHeader' in request) {
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
// Remove Content-Type if data is undefined
delete requestHeaders[key];
} else {
// Otherwise add header to the request
request.setRequestHeader(key, val);
}
});
}
// Add withCredentials to request if needed
if (!utils.isUndefined(config.withCredentials)) {
request.withCredentials = !!config.withCredentials;
}
// Add responseType to request if needed
if (responseType && responseType !== 'json') {
request.responseType = config.responseType;
}
// Handle progress if needed
if (typeof config.onDownloadProgress === 'function') {
request.addEventListener('progress', config.onDownloadProgress);
}
// Not all browsers support upload events
if (typeof config.onUploadProgress === 'function' && request.upload) {
request.upload.addEventListener('progress', config.onUploadProgress);
}
if (config.cancelToken || config.signal) {
// Handle cancellation
// eslint-disable-next-line func-names
onCanceled = function(cancel) {
if (!request) {
return;
}
reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
request.abort();
request = null;
};
config.cancelToken && config.cancelToken.subscribe(onCanceled);
if (config.signal) {
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
}
}
if (!requestData) {
requestData = null;
}
var protocol = parseProtocol(fullPath);
if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
return;
}
// Send the request
request.send(requestData);
});
};
webpack://frontend-tpt/../../node_modules/axios/lib/axios.js
'use strict';
var utils = require('./utils');
var bind = require('./helpers/bind');
var Axios = require('./core/Axios');
var mergeConfig = require('./core/mergeConfig');
var defaults = require('./defaults');
/**
* Create an instance of Axios
*
* @param {Object} defaultConfig The default config for the instance
* @return {Axios} A new instance of Axios
*/
function createInstance(defaultConfig) {
var context = new Axios(defaultConfig);
var instance = bind(Axios.prototype.request, context);
// Copy axios.prototype to instance
utils.extend(instance, Axios.prototype, context);
// Copy context to instance
utils.extend(instance, context);
// Factory for creating new instances
instance.create = function create(instanceConfig) {
return createInstance(mergeConfig(defaultConfig, instanceConfig));
};
return instance;
}
// Create the default instance to be exported
var axios = createInstance(defaults);
// Expose Axios class to allow class inheritance
axios.Axios = Axios;
// Expose Cancel & CancelToken
axios.CanceledError = require('./cancel/CanceledError');
axios.CancelToken = require('./cancel/CancelToken');
axios.isCancel = require('./cancel/isCancel');
axios.VERSION = require('./env/data').version;
axios.toFormData = require('./helpers/toFormData');
// Expose AxiosError class
axios.AxiosError = require('../lib/core/AxiosError');
// alias for CanceledError for backward compatibility
axios.Cancel = axios.CanceledError;
// Expose all/spread
axios.all = function all(promises) {
return Promise.all(promises);
};
axios.spread = require('./helpers/spread');
// Expose isAxiosError
axios.isAxiosError = require('./helpers/isAxiosError');
module.exports = axios;
// Allow use of default import syntax in TypeScript
module.exports.default = axios;
webpack://frontend-tpt/../../node_modules/axios/lib/cancel/CancelToken.js
'use strict';
var CanceledError = require('./CanceledError');
/**
* A `CancelToken` is an object that can be used to request cancellation of an operation.
*
* @class
* @param {Function} executor The executor function.
*/
function CancelToken(executor) {
if (typeof executor !== 'function') {
throw new TypeError('executor must be a function.');
}
var resolvePromise;
this.promise = new Promise(function promiseExecutor(resolve) {
resolvePromise = resolve;
});
var token = this;
// eslint-disable-next-line func-names
this.promise.then(function(cancel) {
if (!token._listeners) return;
var i;
var l = token._listeners.length;
for (i = 0; i < l; i++) {
token._listeners[i](cancel);
}
token._listeners = null;
});
// eslint-disable-next-line func-names
this.promise.then = function(onfulfilled) {
var _resolve;
// eslint-disable-next-line func-names
var promise = new Promise(function(resolve) {
token.subscribe(resolve);
_resolve = resolve;
}).then(onfulfilled);
promise.cancel = function reject() {
token.unsubscribe(_resolve);
};
return promise;
};
executor(function cancel(message) {
if (token.reason) {
// Cancellation has already been requested
return;
}
token.reason = new CanceledError(message);
resolvePromise(token.reason);
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
if (this.reason) {
throw this.reason;
}
};
/**
* Subscribe to the cancel signal
*/
CancelToken.prototype.subscribe = function subscribe(listener) {
if (this.reason) {
listener(this.reason);
return;
}
if (this._listeners) {
this._listeners.push(listener);
} else {
this._listeners = [listener];
}
};
/**
* Unsubscribe from the cancel signal
*/
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
if (!this._listeners) {
return;
}
var index = this._listeners.indexOf(listener);
if (index !== -1) {
this._listeners.splice(index, 1);
}
};
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
CancelToken.source = function source() {
var cancel;
var token = new CancelToken(function executor(c) {
cancel = c;
});
return {
token: token,
cancel: cancel
};
};
module.exports = CancelToken;
webpack://frontend-tpt/../../node_modules/axios/lib/cancel/CanceledError.js
'use strict';
var AxiosError = require('../core/AxiosError');
var utils = require('../utils');
/**
* A `CanceledError` is an object that is thrown when an operation is canceled.
*
* @class
* @param {string=} message The message.
*/
function CanceledError(message) {
// eslint-disable-next-line no-eq-null,eqeqeq
AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);
this.name = 'CanceledError';
}
utils.inherits(CanceledError, AxiosError, {
__CANCEL__: true
});
module.exports = CanceledError;
webpack://frontend-tpt/../../node_modules/axios/lib/cancel/isCancel.js
'use strict';
module.exports = function isCancel(value) {
return !!(value && value.__CANCEL__);
};
webpack://frontend-tpt/../../node_modules/axios/lib/core/Axios.js
'use strict';
var utils = require('./../utils');
var buildURL = require('../helpers/buildURL');
var InterceptorManager = require('./InterceptorManager');
var dispatchRequest = require('./dispatchRequest');
var mergeConfig = require('./mergeConfig');
var buildFullPath = require('./buildFullPath');
var validator = require('../helpers/validator');
var validators = validator.validators;
/**
* Create a new instance of Axios
*
* @param {Object} instanceConfig The default config for the instance
*/
function Axios(instanceConfig) {
this.defaults = instanceConfig;
this.interceptors = {
request: new InterceptorManager(),
response: new InterceptorManager()
};
}
/**
* Dispatch a request
*
* @param {Object} config The config specific for this request (merged with this.defaults)
*/
Axios.prototype.request = function request(configOrUrl, config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof configOrUrl === 'string') {
config = config || {};
config.url = configOrUrl;
} else {
config = configOrUrl || {};
}
config = mergeConfig(this.defaults, config);
// Set config.method
if (config.method) {
config.method = config.method.toLowerCase();
} else if (this.defaults.method) {
config.method = this.defaults.method.toLowerCase();
} else {
config.method = 'get';
}
var transitional = config.transitional;
if (transitional !== undefined) {
validator.assertOptions(transitional, {
silentJSONParsing: validators.transitional(validators.boolean),
forcedJSONParsing: validators.transitional(validators.boolean),
clarifyTimeoutError: validators.transitional(validators.boolean)
}, false);
}
// filter out skipped interceptors
var requestInterceptorChain = [];
var synchronousRequestInterceptors = true;
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
return;
}
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
});
var responseInterceptorChain = [];
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
});
var promise;
if (!synchronousRequestInterceptors) {
var chain = [dispatchRequest, undefined];
Array.prototype.unshift.apply(chain, requestInterceptorChain);
chain = chain.concat(responseInterceptorChain);
promise = Promise.resolve(config);
while (chain.length) {
promise = promise.then(chain.shift(), chain.shift());
}
return promise;
}
var newConfig = config;
while (requestInterceptorChain.length) {
var onFulfilled = requestInterceptorChain.shift();
var onRejected = requestInterceptorChain.shift();
try {
newConfig = onFulfilled(newConfig);
} catch (error) {
onRejected(error);
break;
}
}
try {
promise = dispatchRequest(newConfig);
} catch (error) {
return Promise.reject(error);
}
while (responseInterceptorChain.length) {
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
}
return promise;
};
Axios.prototype.getUri = function getUri(config) {
config = mergeConfig(this.defaults, config);
var fullPath = buildFullPath(config.baseURL, config.url);
return buildURL(fullPath, config.params, config.paramsSerializer);
};
// Provide aliases for supported request methods
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, config) {
return this.request(mergeConfig(config || {}, {
method: method,
url: url,
data: (config || {}).data
}));
};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
/*eslint func-names:0*/
function generateHTTPMethod(isForm) {
return function httpMethod(url, data, config) {
return this.request(mergeConfig(config || {}, {
method: method,
headers: isForm ? {
'Content-Type': 'multipart/form-data'
} : {},
url: url,
data: data
}));
};
}
Axios.prototype[method] = generateHTTPMethod();
Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
});
module.exports = Axios;
webpack://frontend-tpt/../../node_modules/axios/lib/core/AxiosError.js
'use strict';
var utils = require('../utils');
/**
* Create an Error with the specified message, config, error code, request and response.
*
* @param {string} message The error message.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
* @param {Object} [config] The config.
* @param {Object} [request] The request.
* @param {Object} [response] The response.
* @returns {Error} The created error.
*/
function AxiosError(message, code, config, request, response) {
Error.call(this);
this.message = message;
this.name = 'AxiosError';
code && (this.code = code);
config && (this.config = config);
request && (this.request = request);
response && (this.response = response);
}
utils.inherits(AxiosError, Error, {
toJSON: function toJSON() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: this.config,
code: this.code,
status: this.response && this.response.status ? this.response.status : null
};
}
});
var prototype = AxiosError.prototype;
var descriptors = {};
[
'ERR_BAD_OPTION_VALUE',
'ERR_BAD_OPTION',
'ECONNABORTED',
'ETIMEDOUT',
'ERR_NETWORK',
'ERR_FR_TOO_MANY_REDIRECTS',
'ERR_DEPRECATED',
'ERR_BAD_RESPONSE',
'ERR_BAD_REQUEST',
'ERR_CANCELED'
// eslint-disable-next-line func-names
].forEach(function(code) {
descriptors[code] = {value: code};
});
Object.defineProperties(AxiosError, descriptors);
Object.defineProperty(prototype, 'isAxiosError', {value: true});
// eslint-disable-next-line func-names
AxiosError.from = function(error, code, config, request, response, customProps) {
var axiosError = Object.create(prototype);
utils.toFlatObject(error, axiosError, function filter(obj) {
return obj !== Error.prototype;
});
AxiosError.call(axiosError, error.message, code, config, request, response);
axiosError.name = error.name;
customProps && Object.assign(axiosError, customProps);
return axiosError;
};
module.exports = AxiosError;
webpack://frontend-tpt/../../node_modules/axios/lib/core/InterceptorManager.js
'use strict';
var utils = require('./../utils');
function InterceptorManager() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
this.handlers.push({
fulfilled: fulfilled,
rejected: rejected,
synchronous: options ? options.synchronous : false,
runWhen: options ? options.runWhen : null
});
return this.handlers.length - 1;
};
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*/
InterceptorManager.prototype.eject = function eject(id) {
if (this.handlers[id]) {
this.handlers[id] = null;
}
};
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*/
InterceptorManager.prototype.forEach = function forEach(fn) {
utils.forEach(this.handlers, function forEachHandler(h) {
if (h !== null) {
fn(h);
}
});
};
module.exports = InterceptorManager;
webpack://frontend-tpt/../../node_modules/axios/lib/core/buildFullPath.js
'use strict';
var isAbsoluteURL = require('../helpers/isAbsoluteURL');
var combineURLs = require('../helpers/combineURLs');
/**
* Creates a new URL by combining the baseURL with the requestedURL,
* only when the requestedURL is not already an absolute URL.
* If the requestURL is absolute, this function returns the requestedURL untouched.
*
* @param {string} baseURL The base URL
* @param {string} requestedURL Absolute or relative URL to combine
* @returns {string} The combined full path
*/
module.exports = function buildFullPath(baseURL, requestedURL) {
if (baseURL && !isAbsoluteURL(requestedURL)) {
return combineURLs(baseURL, requestedURL);
}
return requestedURL;
};
webpack://frontend-tpt/../../node_modules/axios/lib/core/dispatchRequest.js
'use strict';
var utils = require('./../utils');
var transformData = require('./transformData');
var isCancel = require('../cancel/isCancel');
var defaults = require('../defaults');
var CanceledError = require('../cancel/CanceledError');
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
function throwIfCancellationRequested(config) {
if (config.cancelToken) {
config.cancelToken.throwIfRequested();
}
if (config.signal && config.signal.aborted) {
throw new CanceledError();
}
}
/**
* Dispatch a request to the server using the configured adapter.
*
* @param {object} config The config that is to be used for the request
* @returns {Promise} The Promise to be fulfilled
*/
module.exports = function dispatchRequest(config) {
throwIfCancellationRequested(config);
// Ensure headers exist
config.headers = config.headers || {};
// Transform request data
config.data = transformData.call(
config,
config.data,
config.headers,
config.transformRequest
);
// Flatten headers
config.headers = utils.merge(
config.headers.common || {},
config.headers[config.method] || {},
config.headers
);
utils.forEach(
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
function cleanHeaderConfig(method) {
delete config.headers[method];
}
);
var adapter = config.adapter || defaults.adapter;
return adapter(config).then(function onAdapterResolution(response) {
throwIfCancellationRequested(config);
// Transform response data
response.data = transformData.call(
config,
response.data,
response.headers,
config.transformResponse
);
return response;
}, function onAdapterRejection(reason) {
if (!isCancel(reason)) {
throwIfCancellationRequested(config);
// Transform response data
if (reason && reason.response) {
reason.response.data = transformData.call(
config,
reason.response.data,
reason.response.headers,
config.transformResponse
);
}
}
return Promise.reject(reason);
});
};
webpack://frontend-tpt/../../node_modules/axios/lib/core/mergeConfig.js
'use strict';
var utils = require('../utils');
/**
* Config-specific merge-function which creates a new config-object
* by merging two configuration objects together.
*
* @param {Object} config1
* @param {Object} config2
* @returns {Object} New object resulting from merging config2 to config1
*/
module.exports = function mergeConfig(config1, config2) {
// eslint-disable-next-line no-param-reassign
config2 = config2 || {};
var config = {};
function getMergedValue(target, source) {
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
return utils.merge(target, source);
} else if (utils.isPlainObject(source)) {
return utils.merge({}, source);
} else if (utils.isArray(source)) {
return source.slice();
}
return source;
}
// eslint-disable-next-line consistent-return
function mergeDeepProperties(prop) {
if (!utils.isUndefined(config2[prop])) {
return getMergedValue(config1[prop], config2[prop]);
} else if (!utils.isUndefined(config1[prop])) {
return getMergedValue(undefined, config1[prop]);
}
}
// eslint-disable-next-line consistent-return
function valueFromConfig2(prop) {
if (!utils.isUndefined(config2[prop])) {
return getMergedValue(undefined, config2[prop]);
}
}
// eslint-disable-next-line consistent-return
function defaultToConfig2(prop) {
if (!utils.isUndefined(config2[prop])) {
return getMergedValue(undefined, config2[prop]);
} else if (!utils.isUndefined(config1[prop])) {
return getMergedValue(undefined, config1[prop]);
}
}
// eslint-disable-next-line consistent-return
function mergeDirectKeys(prop) {
if (prop in config2) {
return getMergedValue(config1[prop], config2[prop]);
} else if (prop in config1) {
return getMergedValue(undefined, config1[prop]);
}
}
var mergeMap = {
'url': valueFromConfig2,
'method': valueFromConfig2,
'data': valueFromConfig2,
'baseURL': defaultToConfig2,
'transformRequest': defaultToConfig2,
'transformResponse': defaultToConfig2,
'paramsSerializer': defaultToConfig2,
'timeout': defaultToConfig2,
'timeoutMessage': defaultToConfig2,
'withCredentials': defaultToConfig2,
'adapter': defaultToConfig2,
'responseType': defaultToConfig2,
'xsrfCookieName': defaultToConfig2,
'xsrfHeaderName': defaultToConfig2,
'onUploadProgress': defaultToConfig2,
'onDownloadProgress': defaultToConfig2,
'decompress': defaultToConfig2,
'maxContentLength': defaultToConfig2,
'maxBodyLength': defaultToConfig2,
'beforeRedirect': defaultToConfig2,
'transport': defaultToConfig2,
'httpAgent': defaultToConfig2,
'httpsAgent': defaultToConfig2,
'cancelToken': defaultToConfig2,
'socketPath': defaultToConfig2,
'responseEncoding': defaultToConfig2,
'validateStatus': mergeDirectKeys
};
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
var merge = mergeMap[prop] || mergeDeepProperties;
var configValue = merge(prop);
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
});
return config;
};
webpack://frontend-tpt/../../node_modules/axios/lib/core/settle.js
'use strict';
var AxiosError = require('./AxiosError');
/**
* Resolve or reject a Promise based on response status.
*
* @param {Function} resolve A function that resolves the promise.
* @param {Function} reject A function that rejects the promise.
* @param {object} response The response.
*/
module.exports = function settle(resolve, reject, response) {
var validateStatus = response.config.validateStatus;
if (!response.status || !validateStatus || validateStatus(response.status)) {
resolve(response);
} else {
reject(new AxiosError(
'Request failed with status code ' + response.status,
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
response.config,
response.request,
response
));
}
};
webpack://frontend-tpt/../../node_modules/axios/lib/core/transformData.js
'use strict';
var utils = require('./../utils');
var defaults = require('../defaults');
/**
* Transform the data for a request or a response
*
* @param {Object|String} data The data to be transformed
* @param {Array} headers The headers for the request or response
* @param {Array|Function} fns A single function or Array of functions
* @returns {*} The resulting transformed data
*/
module.exports = function transformData(data, headers, fns) {
var context = this || defaults;
/*eslint no-param-reassign:0*/
utils.forEach(fns, function transform(fn) {
data = fn.call(context, data, headers);
});
return data;
};
webpack://frontend-tpt/../../node_modules/axios/lib/defaults/index.js
'use strict';
var utils = require('../utils');
var normalizeHeaderName = require('../helpers/normalizeHeaderName');
var AxiosError = require('../core/AxiosError');
var transitionalDefaults = require('./transitional');
var toFormData = require('../helpers/toFormData');
var DEFAULT_CONTENT_TYPE = {
'Content-Type': 'application/x-www-form-urlencoded'
};
function setContentTypeIfUnset(headers, value) {
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
headers['Content-Type'] = value;
}
}
function getDefaultAdapter() {
var adapter;
if (typeof XMLHttpRequest !== 'undefined') {
// For browsers use XHR adapter
adapter = require('../adapters/xhr');
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
// For node use HTTP adapter
adapter = require('../adapters/http');
}
return adapter;
}
function stringifySafely(rawValue, parser, encoder) {
if (utils.isString(rawValue)) {
try {
(parser || JSON.parse)(rawValue);
return utils.trim(rawValue);
} catch (e) {
if (e.name !== 'SyntaxError') {
throw e;
}
}
}
return (encoder || JSON.stringify)(rawValue);
}
var defaults = {
transitional: transitionalDefaults,
adapter: getDefaultAdapter(),
transformRequest: [function transformRequest(data, headers) {
normalizeHeaderName(headers, 'Accept');
normalizeHeaderName(headers, 'Content-Type');
if (utils.isFormData(data) ||
utils.isArrayBuffer(data) ||
utils.isBuffer(data) ||
utils.isStream(data) ||
utils.isFile(data) ||
utils.isBlob(data)
) {
return data;
}
if (utils.isArrayBufferView(data)) {
return data.buffer;
}
if (utils.isURLSearchParams(data)) {
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
return data.toString();
}
var isObjectPayload = utils.isObject(data);
var contentType = headers && headers['Content-Type'];
var isFileList;
if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
var _FormData = this.env && this.env.FormData;
return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
} else if (isObjectPayload || contentType === 'application/json') {
setContentTypeIfUnset(headers, 'application/json');
return stringifySafely(data);
}
return data;
}],
transformResponse: [function transformResponse(data) {
var transitional = this.transitional || defaults.transitional;
var silentJSONParsing = transitional && transitional.silentJSONParsing;
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
try {
return JSON.parse(data);
} catch (e) {
if (strictJSONParsing) {
if (e.name === 'SyntaxError') {
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
}
throw e;
}
}
}
return data;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: require('./env/FormData')
},
validateStatus: function validateStatus(status) {
return status >= 200 && status < 300;
},
headers: {
common: {
'Accept': 'application/json, text/plain, */*'
}
}
};
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
defaults.headers[method] = {};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
});
module.exports = defaults;
webpack://frontend-tpt/../../node_modules/axios/lib/defaults/transitional.js
'use strict';
module.exports = {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
};
webpack://frontend-tpt/../../node_modules/axios/lib/env/data.js
module.exports = {
"version": "0.27.2"
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/bind.js
'use strict';
module.exports = function bind(fn, thisArg) {
return function wrap() {
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
return fn.apply(thisArg, args);
};
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/buildURL.js
'use strict';
var utils = require('./../utils');
function encode(val) {
return encodeURIComponent(val).
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace(/%20/g, '+').
replace(/%5B/gi, '[').
replace(/%5D/gi, ']');
}
/**
* Build a URL by appending params to the end
*
* @param {string} url The base of the url (e.g., http://www.google.com)
* @param {object} [params] The params to be appended
* @returns {string} The formatted url
*/
module.exports = function buildURL(url, params, paramsSerializer) {
/*eslint no-param-reassign:0*/
if (!params) {
return url;
}
var serializedParams;
if (paramsSerializer) {
serializedParams = paramsSerializer(params);
} else if (utils.isURLSearchParams(params)) {
serializedParams = params.toString();
} else {
var parts = [];
utils.forEach(params, function serialize(val, key) {
if (val === null || typeof val === 'undefined') {
return;
}
if (utils.isArray(val)) {
key = key + '[]';
} else {
val = [val];
}
utils.forEach(val, function parseValue(v) {
if (utils.isDate(v)) {
v = v.toISOString();
} else if (utils.isObject(v)) {
v = JSON.stringify(v);
}
parts.push(encode(key) + '=' + encode(v));
});
});
serializedParams = parts.join('&');
}
if (serializedParams) {
var hashmarkIndex = url.indexOf('#');
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
}
return url;
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/combineURLs.js
'use strict';
/**
* Creates a new URL by combining the specified URLs
*
* @param {string} baseURL The base URL
* @param {string} relativeURL The relative URL
* @returns {string} The combined URL
*/
module.exports = function combineURLs(baseURL, relativeURL) {
return relativeURL
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
: baseURL;
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/cookies.js
'use strict';
var utils = require('./../utils');
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs support document.cookie
(function standardBrowserEnv() {
return {
write: function write(name, value, expires, path, domain, secure) {
var cookie = [];
cookie.push(name + '=' + encodeURIComponent(value));
if (utils.isNumber(expires)) {
cookie.push('expires=' + new Date(expires).toGMTString());
}
if (utils.isString(path)) {
cookie.push('path=' + path);
}
if (utils.isString(domain)) {
cookie.push('domain=' + domain);
}
if (secure === true) {
cookie.push('secure');
}
document.cookie = cookie.join('; ');
},
read: function read(name) {
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
},
remove: function remove(name) {
this.write(name, '', Date.now() - 86400000);
}
};
})() :
// Non standard browser env (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return {
write: function write() {},
read: function read() { return null; },
remove: function remove() {}
};
})()
);
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/isAbsoluteURL.js
'use strict';
/**
* Determines whether the specified URL is absolute
*
* @param {string} url The URL to test
* @returns {boolean} True if the specified URL is absolute, otherwise false
*/
module.exports = function isAbsoluteURL(url) {
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/isAxiosError.js
'use strict';
var utils = require('./../utils');
/**
* Determines whether the payload is an error thrown by Axios
*
* @param {*} payload The value to test
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
*/
module.exports = function isAxiosError(payload) {
return utils.isObject(payload) && (payload.isAxiosError === true);
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/isURLSameOrigin.js
'use strict';
var utils = require('./../utils');
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
(function standardBrowserEnv() {
var msie = /(msie|trident)/i.test(navigator.userAgent);
var urlParsingNode = document.createElement('a');
var originURL;
/**
* Parse a URL to discover it's components
*
* @param {String} url The URL to be parsed
* @returns {Object}
*/
function resolveURL(url) {
var href = url;
if (msie) {
// IE needs attribute set twice to normalize properties
urlParsingNode.setAttribute('href', href);
href = urlParsingNode.href;
}
urlParsingNode.setAttribute('href', href);
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
return {
href: urlParsingNode.href,
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
host: urlParsingNode.host,
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
hostname: urlParsingNode.hostname,
port: urlParsingNode.port,
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
urlParsingNode.pathname :
'/' + urlParsingNode.pathname
};
}
originURL = resolveURL(window.location.href);
/**
* Determine if a URL shares the same origin as the current location
*
* @param {String} requestURL The URL to test
* @returns {boolean} True if URL shares the same origin, otherwise false
*/
return function isURLSameOrigin(requestURL) {
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
return (parsed.protocol === originURL.protocol &&
parsed.host === originURL.host);
};
})() :
// Non standard browser envs (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return function isURLSameOrigin() {
return true;
};
})()
);
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/normalizeHeaderName.js
'use strict';
var utils = require('../utils');
module.exports = function normalizeHeaderName(headers, normalizedName) {
utils.forEach(headers, function processHeader(value, name) {
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
headers[normalizedName] = value;
delete headers[name];
}
});
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/null.js
// eslint-disable-next-line strict module.exports = null;
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/parseHeaders.js
'use strict';
var utils = require('./../utils');
// Headers whose duplicates are ignored by node
// c.f. https://nodejs.org/api/http.html#http_message_headers
var ignoreDuplicateOf = [
'age', 'authorization', 'content-length', 'content-type', 'etag',
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
'referer', 'retry-after', 'user-agent'
];
/**
* Parse headers into an object
*
* ```
* Date: Wed, 27 Aug 2014 08:58:49 GMT
* Content-Type: application/json
* Connection: keep-alive
* Transfer-Encoding: chunked
* ```
*
* @param {String} headers Headers needing to be parsed
* @returns {Object} Headers parsed into an object
*/
module.exports = function parseHeaders(headers) {
var parsed = {};
var key;
var val;
var i;
if (!headers) { return parsed; }
utils.forEach(headers.split('\n'), function parser(line) {
i = line.indexOf(':');
key = utils.trim(line.substr(0, i)).toLowerCase();
val = utils.trim(line.substr(i + 1));
if (key) {
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
return;
}
if (key === 'set-cookie') {
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
} else {
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
}
}
});
return parsed;
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/parseProtocol.js
'use strict';
module.exports = function parseProtocol(url) {
var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
return match && match[1] || '';
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/spread.js
'use strict';
/**
* Syntactic sugar for invoking a function and expanding an array for arguments.
*
* Common use case would be to use `Function.prototype.apply`.
*
* ```js
* function f(x, y, z) {}
* var args = [1, 2, 3];
* f.apply(null, args);
* ```
*
* With `spread` this example can be re-written.
*
* ```js
* spread(function(x, y, z) {})([1, 2, 3]);
* ```
*
* @param {Function} callback
* @returns {Function}
*/
module.exports = function spread(callback) {
return function wrap(arr) {
return callback.apply(null, arr);
};
};
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/toFormData.js
'use strict';
var utils = require('../utils');
/**
* Convert a data object to FormData
* @param {Object} obj
* @param {?Object} [formData]
* @returns {Object}
**/
function toFormData(obj, formData) {
// eslint-disable-next-line no-param-reassign
formData = formData || new FormData();
var stack = [];
function convertValue(value) {
if (value === null) return '';
if (utils.isDate(value)) {
return value.toISOString();
}
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
}
return value;
}
function build(data, parentKey) {
if (utils.isPlainObject(data) || utils.isArray(data)) {
if (stack.indexOf(data) !== -1) {
throw Error('Circular reference detected in ' + parentKey);
}
stack.push(data);
utils.forEach(data, function each(value, key) {
if (utils.isUndefined(value)) return;
var fullKey = parentKey ? parentKey + '.' + key : key;
var arr;
if (value && !parentKey && typeof value === 'object') {
if (utils.endsWith(key, '{}')) {
// eslint-disable-next-line no-param-reassign
value = JSON.stringify(value);
} else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
// eslint-disable-next-line func-names
arr.forEach(function(el) {
!utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
});
return;
}
}
build(value, fullKey);
});
stack.pop();
} else {
formData.append(parentKey, convertValue(data));
}
}
build(obj);
return formData;
}
module.exports = toFormData;
webpack://frontend-tpt/../../node_modules/axios/lib/helpers/validator.js
'use strict';
var VERSION = require('../env/data').version;
var AxiosError = require('../core/AxiosError');
var validators = {};
// eslint-disable-next-line func-names
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
validators[type] = function validator(thing) {
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
};
});
var deprecatedWarnings = {};
/**
* Transitional option validator
* @param {function|boolean?} validator - set to false if the transitional option has been removed
* @param {string?} version - deprecated version / removed since version
* @param {string?} message - some message with additional info
* @returns {function}
*/
validators.transitional = function transitional(validator, version, message) {
function formatMessage(opt, desc) {
return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
}
// eslint-disable-next-line func-names
return function(value, opt, opts) {
if (validator === false) {
throw new AxiosError(
formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
AxiosError.ERR_DEPRECATED
);
}
if (version && !deprecatedWarnings[opt]) {
deprecatedWarnings[opt] = true;
// eslint-disable-next-line no-console
console.warn(
formatMessage(
opt,
' has been deprecated since v' + version + ' and will be removed in the near future'
)
);
}
return validator ? validator(value, opt, opts) : true;
};
};
/**
* Assert object's properties type
* @param {object} options
* @param {object} schema
* @param {boolean?} allowUnknown
*/
function assertOptions(options, schema, allowUnknown) {
if (typeof options !== 'object') {
throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
}
var keys = Object.keys(options);
var i = keys.length;
while (i-- > 0) {
var opt = keys[i];
var validator = schema[opt];
if (validator) {
var value = options[opt];
var result = value === undefined || validator(value, opt, options);
if (result !== true) {
throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
}
continue;
}
if (allowUnknown !== true) {
throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
}
}
}
module.exports = {
assertOptions: assertOptions,
validators: validators
};
webpack://frontend-tpt/../../node_modules/axios/lib/utils.js
'use strict';
var bind = require('./helpers/bind');
// utils is a library of generic helper functions non-specific to axios
var toString = Object.prototype.toString;
// eslint-disable-next-line func-names
var kindOf = (function(cache) {
// eslint-disable-next-line func-names
return function(thing) {
var str = toString.call(thing);
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
};
})(Object.create(null));
function kindOfTest(type) {
type = type.toLowerCase();
return function isKindOf(thing) {
return kindOf(thing) === type;
};
}
/**
* Determine if a value is an Array
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Array, otherwise false
*/
function isArray(val) {
return Array.isArray(val);
}
/**
* Determine if a value is undefined
*
* @param {Object} val The value to test
* @returns {boolean} True if the value is undefined, otherwise false
*/
function isUndefined(val) {
return typeof val === 'undefined';
}
/**
* Determine if a value is a Buffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Buffer, otherwise false
*/
function isBuffer(val) {
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
}
/**
* Determine if a value is an ArrayBuffer
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
*/
var isArrayBuffer = kindOfTest('ArrayBuffer');
/**
* Determine if a value is a view on an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
*/
function isArrayBufferView(val) {
var result;
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
result = ArrayBuffer.isView(val);
} else {
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
}
return result;
}
/**
* Determine if a value is a String
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a String, otherwise false
*/
function isString(val) {
return typeof val === 'string';
}
/**
* Determine if a value is a Number
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Number, otherwise false
*/
function isNumber(val) {
return typeof val === 'number';
}
/**
* Determine if a value is an Object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Object, otherwise false
*/
function isObject(val) {
return val !== null && typeof val === 'object';
}
/**
* Determine if a value is a plain Object
*
* @param {Object} val The value to test
* @return {boolean} True if value is a plain Object, otherwise false
*/
function isPlainObject(val) {
if (kindOf(val) !== 'object') {
return false;
}
var prototype = Object.getPrototypeOf(val);
return prototype === null || prototype === Object.prototype;
}
/**
* Determine if a value is a Date
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a Date, otherwise false
*/
var isDate = kindOfTest('Date');
/**
* Determine if a value is a File
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a File, otherwise false
*/
var isFile = kindOfTest('File');
/**
* Determine if a value is a Blob
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a Blob, otherwise false
*/
var isBlob = kindOfTest('Blob');
/**
* Determine if a value is a FileList
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a File, otherwise false
*/
var isFileList = kindOfTest('FileList');
/**
* Determine if a value is a Function
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Function, otherwise false
*/
function isFunction(val) {
return toString.call(val) === '[object Function]';
}
/**
* Determine if a value is a Stream
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Stream, otherwise false
*/
function isStream(val) {
return isObject(val) && isFunction(val.pipe);
}
/**
* Determine if a value is a FormData
*
* @param {Object} thing The value to test
* @returns {boolean} True if value is an FormData, otherwise false
*/
function isFormData(thing) {
var pattern = '[object FormData]';
return thing && (
(typeof FormData === 'function' && thing instanceof FormData) ||
toString.call(thing) === pattern ||
(isFunction(thing.toString) && thing.toString() === pattern)
);
}
/**
* Determine if a value is a URLSearchParams object
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
*/
var isURLSearchParams = kindOfTest('URLSearchParams');
/**
* Trim excess whitespace off the beginning and end of a string
*
* @param {String} str The String to trim
* @returns {String} The String freed of excess whitespace
*/
function trim(str) {
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
}
/**
* Determine if we're running in a standard browser environment
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
*
* web workers:
* typeof window -> undefined
* typeof document -> undefined
*
* react-native:
* navigator.product -> 'ReactNative'
* nativescript
* navigator.product -> 'NativeScript' or 'NS'
*/
function isStandardBrowserEnv() {
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
navigator.product === 'NativeScript' ||
navigator.product === 'NS')) {
return false;
}
return (
typeof window !== 'undefined' &&
typeof document !== 'undefined'
);
}
/**
* Iterate over an Array or an Object invoking a function for each item.
*
* If `obj` is an Array callback will be called passing
* the value, index, and complete array for each item.
*
* If 'obj' is an Object callback will be called passing
* the value, key, and complete object for each property.
*
* @param {Object|Array} obj The object to iterate
* @param {Function} fn The callback to invoke for each item
*/
function forEach(obj, fn) {
// Don't bother if no value provided
if (obj === null || typeof obj === 'undefined') {
return;
}
// Force an array if not already something iterable
if (typeof obj !== 'object') {
/*eslint no-param-reassign:0*/
obj = [obj];
}
if (isArray(obj)) {
// Iterate over array values
for (var i = 0, l = obj.length; i < l; i++) {
fn.call(null, obj[i], i, obj);
}
} else {
// Iterate over object keys
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
fn.call(null, obj[key], key, obj);
}
}
}
}
/**
* Accepts varargs expecting each argument to be an object, then
* immutably merges the properties of each object and returns result.
*
* When multiple objects contain the same key the later object in
* the arguments list will take precedence.
*
* Example:
*
* ```js
* var result = merge({foo: 123}, {foo: 456});
* console.log(result.foo); // outputs 456
* ```
*
* @param {Object} obj1 Object to merge
* @returns {Object} Result of all merge properties
*/
function merge(/* obj1, obj2, obj3, ... */) {
var result = {};
function assignValue(val, key) {
if (isPlainObject(result[key]) && isPlainObject(val)) {
result[key] = merge(result[key], val);
} else if (isPlainObject(val)) {
result[key] = merge({}, val);
} else if (isArray(val)) {
result[key] = val.slice();
} else {
result[key] = val;
}
}
for (var i = 0, l = arguments.length; i < l; i++) {
forEach(arguments[i], assignValue);
}
return result;
}
/**
* Extends object a by mutably adding to it the properties of object b.
*
* @param {Object} a The object to be extended
* @param {Object} b The object to copy properties from
* @param {Object} thisArg The object to bind function to
* @return {Object} The resulting value of object a
*/
function extend(a, b, thisArg) {
forEach(b, function assignValue(val, key) {
if (thisArg && typeof val === 'function') {
a[key] = bind(val, thisArg);
} else {
a[key] = val;
}
});
return a;
}
/**
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
*
* @param {string} content with BOM
* @return {string} content value without BOM
*/
function stripBOM(content) {
if (content.charCodeAt(0) === 0xFEFF) {
content = content.slice(1);
}
return content;
}
/**
* Inherit the prototype methods from one constructor into another
* @param {function} constructor
* @param {function} superConstructor
* @param {object} [props]
* @param {object} [descriptors]
*/
function inherits(constructor, superConstructor, props, descriptors) {
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
constructor.prototype.constructor = constructor;
props && Object.assign(constructor.prototype, props);
}
/**
* Resolve object with deep prototype chain to a flat object
* @param {Object} sourceObj source object
* @param {Object} [destObj]
* @param {Function} [filter]
* @returns {Object}
*/
function toFlatObject(sourceObj, destObj, filter) {
var props;
var i;
var prop;
var merged = {};
destObj = destObj || {};
do {
props = Object.getOwnPropertyNames(sourceObj);
i = props.length;
while (i-- > 0) {
prop = props[i];
if (!merged[prop]) {
destObj[prop] = sourceObj[prop];
merged[prop] = true;
}
}
sourceObj = Object.getPrototypeOf(sourceObj);
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
return destObj;
}
/*
* determines whether a string ends with the characters of a specified string
* @param {String} str
* @param {String} searchString
* @param {Number} [position= 0]
* @returns {boolean}
*/
function endsWith(str, searchString, position) {
str = String(str);
if (position === undefined || position > str.length) {
position = str.length;
}
position -= searchString.length;
var lastIndex = str.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
}
/**
* Returns new array from array like object
* @param {*} [thing]
* @returns {Array}
*/
function toArray(thing) {
if (!thing) return null;
var i = thing.length;
if (isUndefined(i)) return null;
var arr = new Array(i);
while (i-- > 0) {
arr[i] = thing[i];
}
return arr;
}
// eslint-disable-next-line func-names
var isTypedArray = (function(TypedArray) {
// eslint-disable-next-line func-names
return function(thing) {
return TypedArray && thing instanceof TypedArray;
};
})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
module.exports = {
isArray: isArray,
isArrayBuffer: isArrayBuffer,
isBuffer: isBuffer,
isFormData: isFormData,
isArrayBufferView: isArrayBufferView,
isString: isString,
isNumber: isNumber,
isObject: isObject,
isPlainObject: isPlainObject,
isUndefined: isUndefined,
isDate: isDate,
isFile: isFile,
isBlob: isBlob,
isFunction: isFunction,
isStream: isStream,
isURLSearchParams: isURLSearchParams,
isStandardBrowserEnv: isStandardBrowserEnv,
forEach: forEach,
merge: merge,
extend: extend,
trim: trim,
stripBOM: stripBOM,
inherits: inherits,
toFlatObject: toFlatObject,
kindOf: kindOf,
kindOfTest: kindOfTest,
endsWith: endsWith,
toArray: toArray,
isTypedArray: isTypedArray,
isFileList: isFileList
};
webpack://frontend-tpt/../../packages/tvg-lib-api/protocolSetter.ts
import { get } from "lodash";
const getProtocol = () => (get(global, "appConf", false) ? "https:" : "");
export default getProtocol;
webpack://frontend-tpt/../../packages/tvg-lib-api/requester/index.ts
import axios from "axios";
import { get } from "lodash";
import tvgConf from "@tvg/conf";
const instance = axios.create();
function getInstance() {
if (tvgConf().isRN) {
if (get(global, "session.sessionId")) {
instance.defaults.headers = {
// @ts-ignore
"tvg-session-id": get(global, "session.sessionId", null)
};
}
}
return instance;
}
export default getInstance;
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-int/4njbets.ts
module.exports = {
domain: {
desktop: "4njbets-qa.us.betfair.com",
mobile: "4njbets-qa.us.betfair.com",
talentPicks: "4njbets-qa.us.betfair.com/talent-picks/",
equibase: "equibase-store-qa.us.betfair.com"
},
service_host: "service-qa.us.betfair.com",
recaptchaID: "6Lf-4hUqAAAAAGupa6W70kpZVsaFd7yaxz5pHD8r",
recaptchaIdNative: "6Le9B1YqAAAAAJEWJZsQittPtHDcjz6xLNORgHyI"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-int/base.ts
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_INT
} = require("../../utils/urp/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_FDR_INT,
AMPLITUDE_API_KEYS_XSELL: AMPLITUDE_API_KEYS_FDR_XSELL_INT
} = require("../../utils/fdr/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_MEP_INT
} = require("../../utils/mep/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_TVG4_INT
} = require("../../utils/tvg4/amplitude");
module.exports = {
domain: {
desktop: "www-qa.tvg.com",
mobile: "www-qa.tvg.com",
talentPicks: "www-qa.tvg.com/talent-picks/",
equibase: "equibase-store-qa.tvg.com"
},
externalDomain: {
support: "https://support.tvg.com",
contactSupport:
"https://support.tvg.com/tvg/s/articles/360005946853-Contact-Support",
NCPGamblingChat: "http://www.ncpgambling.org/chat"
},
service_host: "service-qa.tvg.com",
google: {
tvg4: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "desktop",
productVersion: "TVG4"
},
tvg5: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "desktop",
productVersion: "TVG5"
},
touch2: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "mobile_web",
productVersion: "MEP"
},
touch3: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "mobile_web",
productVersion: "MEP"
},
ios: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native"
},
ios2: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native"
},
fdrdesktop: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "desktop",
productVersion: "URP"
},
fdrmobile: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "mobile_web",
productVersion: "MEP"
},
fdrios: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "ios_native",
productVersion: "MEP"
},
fdrandroid: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidwrapper: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidgps: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdriosxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "MEP"
},
fdrandroidxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "android_apk"
},
androidwrapper: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "android_native",
productVersion: "android_gps"
},
tvgandroid: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "android_native",
productVersion: "android_apk"
},
iosnative: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native",
productVersion: "ios_native"
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static-qa"
}
},
amplitude: {
tvg5: {
amplitudeAPI: AMPLITUDE_API_KEYS_INT.QA,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_urp"
},
tvg5fdr: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_INT.QA,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "fdr_standalone_lobby"
},
fdrmobile: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_INT.QA,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "fdr_standalone_lobby"
},
fdrios: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_INT.QA,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_standalone_lobby"
},
fdrandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_INT.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "self_dist"
},
fdrandroidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_INT.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdrandroidgps: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_INT.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdriosxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_INT.QA,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_xsell_lobby"
},
fdrandroidxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_INT.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_xsell_lobby"
},
touch3: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_INT.QA,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "tvg_mep"
},
androidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_INT.QA,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvgandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_INT.QA,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvg4: {
amplitudeAPI: AMPLITUDE_API_KEYS_TVG4_INT.QA,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_tvg4"
}
},
clientId: "88a7876dc4c330f0dfa6c5c611818d62",
brazeId: "a728acfe-5f28-42c0-9c08-174ecb4394d5",
perimeterxId: "y2WzFjbX",
storyblokToken: "nfQPQOsxD6kiFQUOovpcEQtt",
storyblokVersion: "draft",
placesAPI: "AIzaSyCvQe2IeP1DnZT6v0PLK-n4bjK9RqcEarQ",
paypalID:
"AbOXWUz9wwf1L17esie_vpZ99gwz9hxQmobirFtIirrZbE3levMoS_lb7BWll5DnB2qB1m11Mmmge8JV",
apptentiveID: "61f08786218b3765d7000024",
apptentiveTvg5: "6204200f48b9d649d700005d",
apptentiveIosKey: "IOS-TVG-DEVELOPMENT-b03e074ea0dd",
apptentiveIosSignature: "693be9827104eaa410239b062acd34b8",
apptentiveAndroidKey: "ANDROID-TVG-DEVELOPMENT",
apptentiveAndroidSignature: "809f6458570a7d899a7ff37684765a4d",
sonarQube: {
serverUrl: "https://sonarqube.gcp-dev.tvg.com",
token: "8836caf742bb1c13755da2d957ba5d1674adbc43",
projectKey: "tvg-monorepo"
},
datadogRum: {
desktopApplicationId: "123b949b-108c-4306-bea0-9227242f5b17",
desktopClientToken: "pub748e107dd1bd28256dad4b1425dda2e3",
mobileApplicationId: "03715ae6-b7e2-4b30-ac7b-cf6a5bfdf763",
mobileClientToken: "pub333a7706c3a954d17d9db1becba22673",
fdrApplicationId: "c15f8a9f-f7a7-4108-97f3-9e81d2e936fb",
fdrClientToken: "pubf5bbdc9d5e227feae77a9ad9f5e1013a",
site: "datadoghq.com"
},
siftAccountId: "60f88a09293fb116c8220753",
siftApiKey: "9cc4454a4bfac8e3",
siftBeaconKey: "d9c3d7901c",
externalServices: {
cpp: "https://promos-api.racing.fanduel.com"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-int/fdr.ts
const {
STORYBLOK_TOKENS: STORYBLOK_TOKENS_INT
} = require("../../utils/fdr/storyblok");
const {
APPTENTIVE_TOKENS: APPTENTIVE_TOKENS_INT
} = require("../../utils/fdr/apptentive");
module.exports = {
domain: {
desktop: "racing.qa.fndl.dev",
mobile: "racing.qa.fndl.dev",
talentPicks: "racing.qa.fndl.dev/talent-picks/",
accountWallet: "account.racing.qa.fndl.dev",
equibase: "equibase-store.qa.fndl.dev"
},
service_host: "racing.qa.fndl.dev",
externalDomain: {
FDTermsConditions: "https://www.qa.fndl.dev/terms",
FDPolicy: "https://www.qa.fndl.dev/privacy",
FDRLoginBridge: "https://www.qa.fndl.dev/sso-auth/fdracing",
FDRSignup:
"https://www.qa.fndl.dev/join?next=%2Fsso-auth%2Ffdracing%3Fredirect_uri%3D"
},
externalServices: {
fanduel: "https://api.qa.fndl.dev",
cpp: "https://promos-api.racing.fanduel.qa.fndl.dev"
},
clientId: "a301e728606047a5b6522727d495b3ed",
brazeId: "d1c732dc-ad0d-49a5-acb7-d360cd0fee38",
storyblokToken: STORYBLOK_TOKENS_INT.QA,
storyblokVersion: "draft",
appTentiveIos: APPTENTIVE_TOKENS_INT.IOS.QA,
appTentiveAndroid: APPTENTIVE_TOKENS_INT.ANDROID.QA,
appTentiveWeb: APPTENTIVE_TOKENS_INT.WEB.QA
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-int/iowa.ts
module.exports = {
domain: {
desktop: "ia-qa.tvg.com",
mobile: "ia-qa.tvg.com",
talentPicks: "ia-qa.tvg.com/talent-picks/",
equibase: "equibase-store-qa.tvg.com"
},
recaptchaID: "6Lf-4hUqAAAAAGupa6W70kpZVsaFd7yaxz5pHD8r",
recaptchaIdNative: "6Le9B1YqAAAAAJEWJZsQittPtHDcjz6xLNORgHyI"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-int/pabets.ts
module.exports = {
domain: {
desktop: "pabets-qa.tvg.com",
mobile: "pabets-qa.tvg.com",
talentPicks: "pabets-qa.tvg.com/talent-picks/",
equibase: "equibase-store-qa.tvg.com"
},
recaptchaID: "6Lf-4hUqAAAAAGupa6W70kpZVsaFd7yaxz5pHD8r",
recaptchaIdNative: "6Le9B1YqAAAAAJEWJZsQittPtHDcjz6xLNORgHyI"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-int/tvg.ts
module.exports = {
domain: {
desktop: "www-qa.tvg.com",
mobile: "www-qa.tvg.com",
talentPicks: "www-qa.tvg.com/talent-picks/",
accountWallet: "account.racing.qa.fndl.dev",
equibase: "equibase-store-qa.tvg.com"
},
recaptchaID: "6Lf-4hUqAAAAAGupa6W70kpZVsaFd7yaxz5pHD8r",
recaptchaIdNative: "6Le9B1YqAAAAAJEWJZsQittPtHDcjz6xLNORgHyI"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-prd/4njbets.ts
module.exports = {
domain: {
desktop: "4njbets.us.betfair.com",
mobile: "4njbets.us.betfair.com",
talentPicks: "4njbets.us.betfair.com/talent-picks/",
equibase: "equibase-store.us.betfair.com"
},
service_host: "service.us.betfair.com",
recaptchaID: "6LdrNBgqAAAAAKKs_ZP23RQvTYPkSFdZQ9KK_j6K",
recaptchaIdNative: "6LfSQloqAAAAAFKuurdHLnObQ-r2CGo0TuuYdNq-"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-prd/base.ts
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_PRD
} = require("../../utils/urp/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_FDR_PRD,
AMPLITUDE_API_KEYS_XSELL: AMPLITUDE_API_KEYS_FDR_XSELL_PRD
} = require("../../utils/fdr/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_MEP_PRD
} = require("../../utils/mep/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_TVG4_PRD
} = require("../../utils/tvg4/amplitude");
module.exports = {
service_host: "service.tvg.com",
domain: {
desktop: "www.tvg.com",
mobile: "www.tvg.com",
talentPicks: "www.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
externalDomain: {
support: "https://support.tvg.com",
contactSupport:
"https://support.tvg.com/tvg/s/articles/360005946853-Contact-Support",
NCPGamblingChat: "http://www.ncpgambling.org/chat"
},
google: {
tvg4: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "desktop",
productVersion: "TVG4"
},
tvg5: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "desktop",
productVersion: "TVG5"
},
touch2: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "mobile_web",
productVersion: "MEP"
},
ios: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "ios_native"
},
touch3: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "mobile_web",
productVersion: "MEP"
},
ios2: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "ios_native"
},
fdrdesktop: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "desktop",
productVersion: "URP"
},
fdrmobile: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "mobile_web",
productVersion: "MEP"
},
fdrios: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "ios_native",
productVersion: "MEP"
},
fdrandroid: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidwrapper: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidgps: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdriosxsell: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "x-sell",
productVersion: "MEP"
},
fdrandroidxsell: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "x-sell",
productVersion: "android_apk"
},
androidwrapper: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_gps"
},
tvgandroid: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_apk"
},
iosnative: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "ios_native",
productVersion: "ios_native"
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static"
}
},
amplitude: {
tvg5: {
amplitudeAPI: AMPLITUDE_API_KEYS_PRD.PRODUCTION,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_urp"
},
tvg5fdr: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PRD.PRODUCTION,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "fdr_standalone_lobby"
},
fdrmobile: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PRD.PRODUCTION,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "fdr_standalone_lobby"
},
fdrios: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PRD.PRODUCTION,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_standalone_lobby"
},
fdrandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PRD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "self_dist"
},
fdrandroidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PRD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdrandroidgps: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PRD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdriosxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_PRD.PRODUCTION,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_xsell_lobby"
},
fdrandroidxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_PRD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_xsell_lobby"
},
touch3: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_PRD.PRODUCTION,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "tvg_mep"
},
androidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_PRD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvgandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_PRD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvg4: {
amplitudeAPI: AMPLITUDE_API_KEYS_TVG4_PRD.PRODUCTION,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_tvg4"
}
},
brazeId: "908c5857-650b-4f31-8ec7-63b15dc11d1d",
siftAccountId: "60f88a09293fb116c8220750",
siftApiKey: "2cd7fd28042a1454",
siftBeaconKey: "df80113946",
clientId: "eaf77f127ea003d4e275a3ed07d6f527",
perimeterxId: "TK74ox9H",
storyblokToken: "mBZqhnrYeUYWqvVh3OTCDgtt",
storyblokVersion: "published",
placesAPI: "AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks",
paypalID:
"AfOWmRjlT73hGanCAUypmRtFas_NsPcXek2_fL8XOIrJHBDoUxcSEVBQ72Ls4fc_2xgJSWK3gTDrgjhI",
apptentiveID: "61f087a65a8827645c000039",
apptentiveTvg5: "62041fcb5a88277d4900018f",
apptentiveIosKey: "IOS-TVG-HORSE-RACING-BETTING-APP",
apptentiveIosSignature: "c0b078503398c5fec509b1235058c955",
apptentiveAndroidKey: "ANDROID-TVG-PRODUCTION",
apptentiveAndroidSignature: "b09205fa5b98d7fdc161f1ca98b5d9b1",
sonarQube: {
serverUrl: "https://sonarqube.gcp-dev.tvg.com",
token: "8836caf742bb1c13755da2d957ba5d1674adbc43",
projectKey: "tvg-monorepo"
},
datadogRum: {
desktopApplicationId: "123b949b-108c-4306-bea0-9227242f5b17",
desktopClientToken: "pub748e107dd1bd28256dad4b1425dda2e3",
mobileApplicationId: "03715ae6-b7e2-4b30-ac7b-cf6a5bfdf763",
mobileClientToken: "pub333a7706c3a954d17d9db1becba22673",
fdrApplicationId: "c15f8a9f-f7a7-4108-97f3-9e81d2e936fb",
fdrClientToken: "pubf5bbdc9d5e227feae77a9ad9f5e1013a",
site: "datadoghq.com"
},
externalServices: {
cpp: "https://promos-api.racing.fanduel.com"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-prd/fdr.ts
const {
STORYBLOK_TOKENS: STORYBLOK_TOKENS_PRD
} = require("../../utils/fdr/storyblok");
const {
APPTENTIVE_TOKENS: APPTENTIVE_TOKENS_PRD
} = require("../../utils/fdr/apptentive");
module.exports = {
domain: {
desktop: "racing.fanduel.com",
mobile: "racing.fanduel.com",
talentPicks: "racing.fanduel.com/talent-picks/",
accountWallet: "account.racing.fanduel.com",
equibase: "equibase-store.fanduel.com"
},
service_host: "service.racing.fanduel.com",
externalDomain: {
FDTermsConditions: "https://fanduel.com/terms",
FDPolicy: "https://fanduel.com/privacy",
FDRLoginBridge: "https://fanduel.com/sso-auth/fdracing",
FDRSignup:
"https://www.fanduel.com/join?next=%2Fsso-auth%2Ffdracing%3Fredirect_uri%3D"
},
externalServices: {
fanduel: "https://api.fanduel.com",
cpp: "https://promos-api.racing.fanduel.com"
},
clientId: "a301e728606047a5b6522727d495b3ed",
brazeId: "e0b90c9d-dfd9-4809-a627-565a5cd7f3b2",
storyblokToken: STORYBLOK_TOKENS_PRD.PRODUCTION,
storyblokVersion: "published",
appTentiveIos: APPTENTIVE_TOKENS_PRD.IOS.PRODUCTION,
appTentiveAndroid: APPTENTIVE_TOKENS_PRD.ANDROID.PRODUCTION,
appTentiveWeb: APPTENTIVE_TOKENS_PRD.WEB.PRODUCTION
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-prd/iowa.ts
module.exports = {
domain: {
desktop: "ia.tvg.com",
mobile: "ia.tvg.com",
talentPicks: "ia.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LdrNBgqAAAAAKKs_ZP23RQvTYPkSFdZQ9KK_j6K",
recaptchaIdNative: "6LfSQloqAAAAAFKuurdHLnObQ-r2CGo0TuuYdNq-"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-prd/pabets.ts
module.exports = {
domain: {
desktop: "pabets.tvg.com",
mobile: "pabets.tvg.com",
talentPicks: "pabets.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LdrNBgqAAAAAKKs_ZP23RQvTYPkSFdZQ9KK_j6K",
recaptchaIdNative: "6LfSQloqAAAAAFKuurdHLnObQ-r2CGo0TuuYdNq-"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-prd/tvg.ts
module.exports = {
domain: {
desktop: "www.tvg.com",
mobile: "www.tvg.com",
talentPicks: "www.tvg.com/talent-picks/",
accountWallet: "account.racing.fanduel.com",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LdrNBgqAAAAAKKs_ZP23RQvTYPkSFdZQ9KK_j6K",
recaptchaIdNative: "6LfSQloqAAAAAFKuurdHLnObQ-r2CGo0TuuYdNq-"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-stg/4njbets.ts
module.exports = {
domain: {
desktop: "4njbets-staging.us.betfair.com",
mobile: "4njbets-staging.us.betfair.com",
talentPicks: "4njbets-staging.us.betfair.com/talent-picks/",
equibase: "equibase-store.us.betfair.com"
},
service_host: "service-staging.us.betfair.com",
recaptchaID: "6LeIYBcqAAAAAE2wDhSub9Ic8oeidAiiUt4gYM4a",
recaptchaIdNative: "6LfRQloqAAAAABY9v2RydlB10Lfgb5ODmvygHy3G"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-stg/base.ts
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_STG
} = require("../../utils/urp/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_FDR_STG,
AMPLITUDE_API_KEYS_XSELL: AMPLITUDE_API_KEYS_FDR_XSELL_STG
} = require("../../utils/fdr/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_MEP_STG
} = require("../../utils/mep/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_TVG4_STG
} = require("../../utils/tvg4/amplitude");
module.exports = {
domain: {
desktop: "www-staging.tvg.com",
mobile: "www-staging.tvg.com",
talentPicks: "www-staging.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
externalDomain: {
support: "https://support.tvg.com",
contactSupport:
"https://support.tvg.com/tvg/s/articles/360005946853-Contact-Support",
NCPGamblingChat: "http://www.ncpgambling.org/chat"
},
service_host: "service-staging.tvg.com",
google: {
tvg4: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "desktop",
productVersion: "TVG4"
},
tvg5: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "desktop",
productVersion: "TVG5"
},
touch2: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "mobile_web",
productVersion: "MEP"
},
ios: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "ios_native"
},
touch3: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "mobile_web",
productVersion: "MEP"
},
androidwrapper: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "android_native",
productVersion: "android_gps"
},
tvgandroid: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "android_native",
productVersion: "android_apk"
},
ios2: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "ios_native"
},
fdrdesktop: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "desktop",
productVersion: "URP"
},
fdrmobile: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "mobile_web",
productVersion: "MEP"
},
fdrios: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "ios_native",
productVersion: "MEP"
},
fdrandroid: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidwrapper: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidgps: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdriosxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "MEP"
},
fdrandroidxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "android_apk"
},
iosnative: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native",
productVersion: "ios_native"
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static-staging"
}
},
amplitude: {
tvg5: {
amplitudeAPI: AMPLITUDE_API_KEYS_STG.STAGING,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_urp"
},
tvg5fdr: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STG.STAGING,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "fdr_standalone_lobby"
},
fdrmobile: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STG.STAGING,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "fdr_standalone_lobby"
},
fdrios: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STG.STAGING,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_standalone_lobby"
},
fdrandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STG.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "self_dist"
},
fdrandroidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STG.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdrandroidgps: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STG.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdriosxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_STG.STAGING,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_xsell_lobby"
},
fdrandroidxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_STG.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_xsell_lobby"
},
touch3: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_STG.STAGING,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "tvg_mep"
},
androidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_STG.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvgandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_TVG4_STG.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvg4: {
amplitudeAPI: AMPLITUDE_API_KEYS_TVG4_STG.STAGING,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_tvg4"
}
},
clientId: "88a7876dc4c330f0dfa6c5c611818d62",
brazeId: "908c5857-650b-4f31-8ec7-63b15dc11d1d",
siftAccountId: "60f88a09293fb116c8220750",
siftApiKey: "2cd7fd28042a1454",
siftBeaconKey: "df80113946",
perimeterxId: "BMkUl9nm",
storyblokToken: "4LYunuxrMxUarw6vBokjKAtt",
storyblokVersion: "draft",
placesAPI: "AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks",
paypalID:
"AfOWmRjlT73hGanCAUypmRtFas_NsPcXek2_fL8XOIrJHBDoUxcSEVBQ72Ls4fc_2xgJSWK3gTDrgjhI",
apptentiveID: "61f08786218b3765d7000024",
apptentiveTvg5: "6204200f48b9d649d700005d",
apptentiveIosKey: "IOS-TVG-DEVELOPMENT-b03e074ea0dd",
apptentiveIosSignature: "693be9827104eaa410239b062acd34b8",
apptentiveAndroidKey: "ANDROID-TVG-DEVELOPMENT",
apptentiveAndroidSignature: "809f6458570a7d899a7ff37684765a4d",
sonarQube: {
serverUrl: "https://sonarqube.gcp-dev.tvg.com",
token: "8836caf742bb1c13755da2d957ba5d1674adbc43",
projectKey: "tvg-monorepo"
},
datadogRum: {
desktopApplicationId: "123b949b-108c-4306-bea0-9227242f5b17",
desktopClientToken: "pub748e107dd1bd28256dad4b1425dda2e3",
mobileApplicationId: "03715ae6-b7e2-4b30-ac7b-cf6a5bfdf763",
mobileClientToken: "pub333a7706c3a954d17d9db1becba22673",
fdrApplicationId: "c15f8a9f-f7a7-4108-97f3-9e81d2e936fb",
fdrClientToken: "pubf5bbdc9d5e227feae77a9ad9f5e1013a",
site: "datadoghq.com"
},
externalServices: {
cpp: "https://promos-api.racing.fanduel.com"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-stg/fdr.ts
const {
STORYBLOK_TOKENS: STORYBLOK_TOKENS_STG
} = require("../../utils/fdr/storyblok");
const {
APPTENTIVE_TOKENS: APPTENTIVE_TOKENS_STG
} = require("../../utils/fdr/apptentive");
module.exports = {
domain: {
desktop: "staging.racing.fanduel.com",
mobile: "staging.racing.fanduel.com",
talentPicks: "staging.racing.fanduel.com/talent-picks/",
accountWallet: "account.racing.fanduel.com",
equibase: "equibase-store.fanduel.com"
},
service_host: "service-staging.racing.fanduel.com",
externalDomain: {
FDTermsConditions: "https://fanduel.com/terms",
FDPolicy: "https://fanduel.com/privacy",
FDRLoginBridge: "https://fanduel.com/sso-auth/fdracing",
FDRSignup:
"https://www.fanduel.com/join?next=%2Fsso-auth%2Ffdracing%3Fredirect_uri%3D"
},
externalServices: {
fanduel: "https://api.fanduel.com",
cpp: "https://promos-api.racing.fanduel.com"
},
clientId: "a301e728606047a5b6522727d495b3ed",
brazeId: "e0b90c9d-dfd9-4809-a627-565a5cd7f3b2",
storyblokToken: STORYBLOK_TOKENS_STG.STAGING,
storyblokVersion: "draft",
appTentiveIos: APPTENTIVE_TOKENS_STG.IOS.PRODUCTION,
appTentiveAndroid: APPTENTIVE_TOKENS_STG.ANDROID.PRODUCTION,
appTentiveWeb: APPTENTIVE_TOKENS_STG.WEB.PRODUCTION
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-stg/iowa.ts
module.exports = {
domain: {
desktop: "ia-staging.tvg.com",
mobile: "ia-staging.tvg.com",
talentPicks: "ia-staging.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LeIYBcqAAAAAE2wDhSub9Ic8oeidAiiUt4gYM4a",
recaptchaIdNative: "6LfRQloqAAAAABY9v2RydlB10Lfgb5ODmvygHy3G"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-stg/pabets.ts
module.exports = {
domain: {
desktop: "pabets-staging.tvg.com",
mobile: "pabets-staging.tvg.com",
talentPicks: "pabets-staging.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LeIYBcqAAAAAE2wDhSub9Ic8oeidAiiUt4gYM4a",
recaptchaIdNative: "6LfRQloqAAAAABY9v2RydlB10Lfgb5ODmvygHy3G"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/aws-stg/tvg.ts
module.exports = {
domain: {
desktop: "www-staging.tvg.com",
mobile: "www-staging.tvg.com",
talentPicks: "www-staging.tvg.com/talent-picks/",
accountWallet: "account.racing.fanduel.com",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LeIYBcqAAAAAE2wDhSub9Ic8oeidAiiUt4gYM4a",
recaptchaIdNative: "6LfRQloqAAAAABY9v2RydlB10Lfgb5ODmvygHy3G"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/production/4njbets.ts
module.exports = {
domain: {
desktop: "4njbets.us.betfair.com",
mobile: "4njbets.us.betfair.com",
talentPicks: "4njbets.us.betfair.com/talent-picks/",
equibase: "equibase-store.us.betfair.com"
},
service_host: "service.us.betfair.com",
recaptchaID: "6LdrNBgqAAAAAKKs_ZP23RQvTYPkSFdZQ9KK_j6K",
recaptchaIdNative: "6LfSQloqAAAAAFKuurdHLnObQ-r2CGo0TuuYdNq-"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/production/base.ts
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_PROD
} = require("../../utils/urp/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_FDR_PROD,
AMPLITUDE_API_KEYS_XSELL: AMPLITUDE_API_KEYS_FDR_XSELL_PROD
} = require("../../utils/fdr/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_MEP_PROD
} = require("../../utils/mep/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_TVG4_PROD
} = require("../../utils/tvg4/amplitude");
module.exports = {
service_host: "service.tvg.com",
domain: {
desktop: "www.tvg.com",
mobile: "www.tvg.com",
talentPicks: "www.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
externalDomain: {
support: "https://support.tvg.com",
contactSupport:
"https://support.tvg.com/tvg/s/articles/360005946853-Contact-Support",
NCPGamblingChat: "http://www.ncpgambling.org/chat"
},
google: {
tvg4: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "desktop",
productVersion: "TVG4"
},
tvg5: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "desktop",
productVersion: "TVG5"
},
touch2: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "mobile_web",
productVersion: "MEP"
},
ios: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "ios_native"
},
touch3: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "mobile_web",
productVersion: "MEP"
},
ios2: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "ios_native"
},
fdrdesktop: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "desktop",
productVersion: "URP"
},
fdrmobile: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "mobile_web",
productVersion: "MEP"
},
fdrios: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "ios_native",
productVersion: "MEP"
},
fdrandroid: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidwrapper: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidgps: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdriosxsell: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "x-sell",
productVersion: "MEP"
},
fdrandroidxsell: {
gtmId: "NSHBQSR",
gtmEnv: "",
gtmAuth: "",
siteVersion: "x-sell",
productVersion: "android_apk"
},
androidwrapper: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_gps"
},
tvgandroid: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "android_native",
productVersion: "android_apk"
},
iosnative: {
gtmId: "KTDSBG",
gtmEnv: "",
gtmAuth: "",
siteVersion: "ios_native",
productVersion: "ios_native"
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static"
}
},
amplitude: {
tvg5: {
amplitudeAPI: AMPLITUDE_API_KEYS_PROD.PRODUCTION,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_urp"
},
tvg5fdr: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PROD.PRODUCTION,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "fdr_standalone_lobby"
},
fdrmobile: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PROD.PRODUCTION,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "fdr_standalone_lobby"
},
fdrios: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PROD.PRODUCTION,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_standalone_lobby"
},
fdrandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PROD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "self_dist"
},
fdrandroidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PROD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdrandroidgps: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_PROD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdriosxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_PROD.PRODUCTION,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_xsell_lobby"
},
fdrandroidxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_PROD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_xsell_lobby"
},
touch3: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_PROD.PRODUCTION,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "tvg_mep"
},
androidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_PROD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvgandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_PROD.PRODUCTION,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvg4: {
amplitudeAPI: AMPLITUDE_API_KEYS_TVG4_PROD.PRODUCTION,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_tvg4"
}
},
brazeId: "908c5857-650b-4f31-8ec7-63b15dc11d1d",
siftAccountId: "60f88a09293fb116c8220750",
siftApiKey: "2cd7fd28042a1454",
siftBeaconKey: "df80113946",
clientId: "eaf77f127ea003d4e275a3ed07d6f527",
perimeterxId: "TK74ox9H",
storyblokToken: "mBZqhnrYeUYWqvVh3OTCDgtt",
storyblokVersion: "published",
placesAPI: "AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks",
paypalID:
"AfOWmRjlT73hGanCAUypmRtFas_NsPcXek2_fL8XOIrJHBDoUxcSEVBQ72Ls4fc_2xgJSWK3gTDrgjhI",
apptentiveID: "61f087a65a8827645c000039",
apptentiveTvg5: "62041fcb5a88277d4900018f",
apptentiveIosKey: "IOS-TVG-HORSE-RACING-BETTING-APP",
apptentiveIosSignature: "c0b078503398c5fec509b1235058c955",
apptentiveAndroidKey: "ANDROID-TVG-PRODUCTION",
apptentiveAndroidSignature: "b09205fa5b98d7fdc161f1ca98b5d9b1",
sonarQube: {
serverUrl: "https://sonarqube.gcp-dev.tvg.com",
token: "8836caf742bb1c13755da2d957ba5d1674adbc43",
projectKey: "tvg-monorepo"
},
datadogRum: {
desktopApplicationId: "123b949b-108c-4306-bea0-9227242f5b17",
desktopClientToken: "pub748e107dd1bd28256dad4b1425dda2e3",
mobileApplicationId: "03715ae6-b7e2-4b30-ac7b-cf6a5bfdf763",
mobileClientToken: "pub333a7706c3a954d17d9db1becba22673",
fdrApplicationId: "c15f8a9f-f7a7-4108-97f3-9e81d2e936fb",
fdrClientToken: "pubf5bbdc9d5e227feae77a9ad9f5e1013a",
site: "datadoghq.com"
},
externalServices: {
cpp: "https://promos-api.racing.fanduel.com"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/production/fdr.ts
const {
STORYBLOK_TOKENS: STORYBLOK_TOKENS_PROD
} = require("../../utils/fdr/storyblok");
const {
APPTENTIVE_TOKENS: APPTENTIVE_TOKENS_PROD
} = require("../../utils/fdr/apptentive");
module.exports = {
domain: {
desktop: "racing.fanduel.com",
mobile: "racing.fanduel.com",
talentPicks: "racing.fanduel.com/talent-picks/",
accountWallet: "account.racing.fanduel.com",
equibase: "equibase-store.fanduel.com"
},
service_host: "service.racing.fanduel.com",
externalDomain: {
FDTermsConditions: "https://fanduel.com/terms",
FDPolicy: "https://fanduel.com/privacy",
FDRLoginBridge: "https://fanduel.com/sso-auth/fdracing",
FDRSignup:
"https://www.fanduel.com/join?next=%2Fsso-auth%2Ffdracing%3Fredirect_uri%3D"
},
externalServices: {
fanduel: "https://api.fanduel.com",
cpp: "https://promos-api.racing.fanduel.com"
},
clientId: "a301e728606047a5b6522727d495b3ed",
brazeId: "e0b90c9d-dfd9-4809-a627-565a5cd7f3b2",
storyblokToken: STORYBLOK_TOKENS_PROD.PRODUCTION,
storyblokVersion: "published",
appTentiveIos: APPTENTIVE_TOKENS_PROD.IOS.PRODUCTION,
appTentiveAndroid: APPTENTIVE_TOKENS_PROD.ANDROID.PRODUCTION,
appTentiveWeb: APPTENTIVE_TOKENS_PROD.WEB.PRODUCTION
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/production/iowa.ts
module.exports = {
domain: {
desktop: "ia.tvg.com",
mobile: "ia.tvg.com",
talentPicks: "ia.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LdrNBgqAAAAAKKs_ZP23RQvTYPkSFdZQ9KK_j6K",
recaptchaIdNative: "6LfSQloqAAAAAFKuurdHLnObQ-r2CGo0TuuYdNq-"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/production/pabets.ts
module.exports = {
domain: {
desktop: "pabets.tvg.com",
mobile: "pabets.tvg.com",
talentPicks: "pabets.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LdrNBgqAAAAAKKs_ZP23RQvTYPkSFdZQ9KK_j6K",
recaptchaIdNative: "6LfSQloqAAAAAFKuurdHLnObQ-r2CGo0TuuYdNq-"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/production/tvg.ts
module.exports = {
domain: {
desktop: "www.tvg.com",
mobile: "www.tvg.com",
talentPicks: "www.tvg.com/talent-picks/",
accountWallet: "account.racing.fanduel.com",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LdrNBgqAAAAAKKs_ZP23RQvTYPkSFdZQ9KK_j6K",
recaptchaIdNative: "6LfSQloqAAAAAFKuurdHLnObQ-r2CGo0TuuYdNq-"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/qa/4njbets.ts
module.exports = {
domain: {
desktop: "4njbets-qa.us.betfair.com",
mobile: "4njbets-qa.us.betfair.com",
talentPicks: "4njbets-qa.us.betfair.com/talent-picks/",
equibase: "equibase-store-qa.us.betfair.com"
},
service_host: "service-qa.us.betfair.com",
recaptchaID: "6Lf-4hUqAAAAAGupa6W70kpZVsaFd7yaxz5pHD8r",
recaptchaIdNative: "6Le9B1YqAAAAAJEWJZsQittPtHDcjz6xLNORgHyI"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/qa/base.ts
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_QA
} = require("../../utils/urp/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_FDR_QA,
AMPLITUDE_API_KEYS_XSELL: AMPLITUDE_API_KEYS_FDR_XSELL_QA
} = require("../../utils/fdr/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_MEP_QA
} = require("../../utils/mep/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_TVG4_QA
} = require("../../utils/tvg4/amplitude");
module.exports = {
domain: {
desktop: "www-qa.tvg.com",
mobile: "www-qa.tvg.com",
talentPicks: "www-qa.tvg.com/talent-picks/",
equibase: "equibase-store-qa.tvg.com"
},
externalDomain: {
support: "https://support.tvg.com",
contactSupport:
"https://support.tvg.com/tvg/s/articles/360005946853-Contact-Support",
NCPGamblingChat: "http://www.ncpgambling.org/chat"
},
service_host: "service-qa.tvg.com",
google: {
tvg4: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "desktop",
productVersion: "TVG4"
},
tvg5: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "desktop",
productVersion: "TVG5"
},
touch2: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "mobile_web",
productVersion: "MEP"
},
touch3: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "mobile_web",
productVersion: "MEP"
},
ios: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native"
},
ios2: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native"
},
fdrdesktop: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "desktop",
productVersion: "URP"
},
fdrmobile: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "mobile_web",
productVersion: "MEP"
},
fdrios: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "ios_native",
productVersion: "MEP"
},
fdrandroid: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidwrapper: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidgps: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdriosxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "MEP"
},
fdrandroidxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "android_apk"
},
androidwrapper: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "android_native",
productVersion: "android_gps"
},
tvgandroid: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "android_native",
productVersion: "android_apk"
},
iosnative: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native",
productVersion: "ios_native"
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static-qa"
}
},
amplitude: {
tvg5: {
amplitudeAPI: AMPLITUDE_API_KEYS_QA.QA,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_urp"
},
tvg5fdr: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_QA.QA,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "fdr_standalone_lobby"
},
fdrmobile: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_QA.QA,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "fdr_standalone_lobby"
},
fdrios: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_QA.QA,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_standalone_lobby"
},
fdrandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_QA.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "self_dist"
},
fdrandroidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_QA.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdrandroidgps: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_QA.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdriosxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_QA.QA,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_xsell_lobby"
},
fdrandroidxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_QA.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_xsell_lobby"
},
touch3: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_QA.QA,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "tvg_mep"
},
androidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_QA.QA,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvgandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_QA.QA,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvg4: {
amplitudeAPI: AMPLITUDE_API_KEYS_TVG4_QA.QA,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_tvg4"
}
},
clientId: "88a7876dc4c330f0dfa6c5c611818d62",
brazeId: "a728acfe-5f28-42c0-9c08-174ecb4394d5",
perimeterxId: "y2WzFjbX",
storyblokToken: "nfQPQOsxD6kiFQUOovpcEQtt",
storyblokVersion: "draft",
placesAPI: "AIzaSyCvQe2IeP1DnZT6v0PLK-n4bjK9RqcEarQ",
paypalID:
"AbOXWUz9wwf1L17esie_vpZ99gwz9hxQmobirFtIirrZbE3levMoS_lb7BWll5DnB2qB1m11Mmmge8JV",
apptentiveID: "61f08786218b3765d7000024",
apptentiveTvg5: "6204200f48b9d649d700005d",
apptentiveIosKey: "IOS-TVG-DEVELOPMENT-b03e074ea0dd",
apptentiveIosSignature: "693be9827104eaa410239b062acd34b8",
apptentiveAndroidKey: "ANDROID-TVG-DEVELOPMENT",
apptentiveAndroidSignature: "809f6458570a7d899a7ff37684765a4d",
sonarQube: {
serverUrl: "https://sonarqube.gcp-dev.tvg.com",
token: "8836caf742bb1c13755da2d957ba5d1674adbc43",
projectKey: "tvg-monorepo"
},
datadogRum: {
desktopApplicationId: "123b949b-108c-4306-bea0-9227242f5b17",
desktopClientToken: "pub748e107dd1bd28256dad4b1425dda2e3",
mobileApplicationId: "03715ae6-b7e2-4b30-ac7b-cf6a5bfdf763",
mobileClientToken: "pub333a7706c3a954d17d9db1becba22673",
fdrApplicationId: "c15f8a9f-f7a7-4108-97f3-9e81d2e936fb",
fdrClientToken: "pubf5bbdc9d5e227feae77a9ad9f5e1013a",
site: "datadoghq.com"
},
siftAccountId: "60f88a09293fb116c8220753",
siftApiKey: "9cc4454a4bfac8e3",
siftBeaconKey: "d9c3d7901c",
externalServices: {
cpp: "https://promos-api.racing.fanduel.com"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/qa/fdr.ts
const {
STORYBLOK_TOKENS: STORYBLOK_TOKENS_QA
} = require("../../utils/fdr/storyblok");
const {
APPTENTIVE_TOKENS: APPTENTIVE_TOKENS_QA
} = require("../../utils/fdr/apptentive");
module.exports = {
domain: {
desktop: "racing.qa.fndl.dev",
mobile: "racing.qa.fndl.dev",
talentPicks: "racing.qa.fndl.dev/talent-picks/",
accountWallet: "account.racing.qa.fndl.dev",
equibase: "equibase-store.qa.fndl.dev"
},
service_host: "racing.qa.fndl.dev",
externalDomain: {
FDTermsConditions: "https://www.qa.fndl.dev/terms",
FDPolicy: "https://www.qa.fndl.dev/privacy",
FDRLoginBridge: "https://www.qa.fndl.dev/sso-auth/fdracing",
FDRSignup:
"https://www.qa.fndl.dev/join?next=%2Fsso-auth%2Ffdracing%3Fredirect_uri%3D"
},
externalServices: {
fanduel: "https://api.qa.fndl.dev",
cpp: "https://promos-api.racing.fanduel.qa.fndl.dev"
},
clientId: "a301e728606047a5b6522727d495b3ed",
brazeId: "d1c732dc-ad0d-49a5-acb7-d360cd0fee38",
storyblokToken: STORYBLOK_TOKENS_QA.QA,
storyblokVersion: "draft",
appTentiveIos: APPTENTIVE_TOKENS_QA.IOS.QA,
appTentiveAndroid: APPTENTIVE_TOKENS_QA.ANDROID.QA,
appTentiveWeb: APPTENTIVE_TOKENS_QA.WEB.QA
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/qa/iowa.ts
module.exports = {
domain: {
desktop: "ia-qa.tvg.com",
mobile: "ia-qa.tvg.com",
talentPicks: "ia-qa.tvg.com/talent-picks/",
equibase: "equibase-store-qa.tvg.com"
},
recaptchaID: "6Lf-4hUqAAAAAGupa6W70kpZVsaFd7yaxz5pHD8r",
recaptchaIdNative: "6Le9B1YqAAAAAJEWJZsQittPtHDcjz6xLNORgHyI"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/qa/pabets.ts
module.exports = {
domain: {
desktop: "pabets-qa.tvg.com",
mobile: "pabets-qa.tvg.com",
talentPicks: "pabets-qa.tvg.com/talent-picks/",
equibase: "equibase-store-qa.tvg.com"
},
recaptchaID: "6Lf-4hUqAAAAAGupa6W70kpZVsaFd7yaxz5pHD8r",
recaptchaIdNative: "6Le9B1YqAAAAAJEWJZsQittPtHDcjz6xLNORgHyI"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/qa/tvg.ts
module.exports = {
domain: {
desktop: "www-qa.tvg.com",
mobile: "www-qa.tvg.com",
talentPicks: "www-qa.tvg.com/talent-picks/",
accountWallet: "account.racing.qa.fndl.dev",
equibase: "equibase-store-qa.tvg.com"
},
recaptchaID: "6Lf-4hUqAAAAAGupa6W70kpZVsaFd7yaxz5pHD8r",
recaptchaIdNative: "6Le9B1YqAAAAAJEWJZsQittPtHDcjz6xLNORgHyI"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/staging/4njbets.ts
module.exports = {
domain: {
desktop: "4njbets-staging.us.betfair.com",
mobile: "4njbets-staging.us.betfair.com",
talentPicks: "4njbets-staging.us.betfair.com/talent-picks/",
equibase: "equibase-store.us.betfair.com"
},
service_host: "service-staging.us.betfair.com",
recaptchaID: "6LeIYBcqAAAAAE2wDhSub9Ic8oeidAiiUt4gYM4a",
recaptchaIdNative: "6LfRQloqAAAAABY9v2RydlB10Lfgb5ODmvygHy3G"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/staging/base.ts
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_STAGING
} = require("../../utils/urp/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_FDR_STAGING,
AMPLITUDE_API_KEYS_XSELL: AMPLITUDE_API_KEYS_FDR_XSELL_STAGING
} = require("../../utils/fdr/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_MEP_STAGING
} = require("../../utils/mep/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_TVG4_STAGING
} = require("../../utils/tvg4/amplitude");
module.exports = {
domain: {
desktop: "www-staging.tvg.com",
mobile: "www-staging.tvg.com",
talentPicks: "www-staging.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
externalDomain: {
support: "https://support.tvg.com",
contactSupport:
"https://support.tvg.com/tvg/s/articles/360005946853-Contact-Support",
NCPGamblingChat: "http://www.ncpgambling.org/chat"
},
service_host: "service-staging.tvg.com",
google: {
tvg4: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "desktop",
productVersion: "TVG4"
},
tvg5: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "desktop",
productVersion: "TVG5"
},
touch2: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "mobile_web",
productVersion: "MEP"
},
ios: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "ios_native"
},
touch3: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "mobile_web",
productVersion: "MEP"
},
androidwrapper: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "android_native",
productVersion: "android_gps"
},
tvgandroid: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "android_native",
productVersion: "android_apk"
},
ios2: {
gtmId: "KTDSBG",
gtmEnv: "668",
gtmAuth: "Q3mmSetXL-9o6LJDN6Tz1A",
siteVersion: "ios_native"
},
fdrdesktop: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "desktop",
productVersion: "URP"
},
fdrmobile: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "mobile_web",
productVersion: "MEP"
},
fdrios: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "ios_native",
productVersion: "MEP"
},
fdrandroid: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidwrapper: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidgps: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdriosxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "MEP"
},
fdrandroidxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "android_apk"
},
iosnative: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native",
productVersion: "ios_native"
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static-staging"
}
},
amplitude: {
tvg5: {
amplitudeAPI: AMPLITUDE_API_KEYS_STAGING.STAGING,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_urp"
},
tvg5fdr: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STAGING.STAGING,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "fdr_standalone_lobby"
},
fdrmobile: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STAGING.STAGING,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "fdr_standalone_lobby"
},
fdrios: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STAGING.STAGING,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_standalone_lobby"
},
fdrandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STAGING.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "self_dist"
},
fdrandroidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STAGING.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdrandroidgps: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_STAGING.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdriosxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_STAGING.STAGING,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_xsell_lobby"
},
fdrandroidxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL_STAGING.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_xsell_lobby"
},
touch3: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_STAGING.STAGING,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "tvg_mep"
},
androidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP_STAGING.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvgandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_TVG4_STAGING.STAGING,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvg4: {
amplitudeAPI: AMPLITUDE_API_KEYS_TVG4_STAGING.STAGING,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_tvg4"
}
},
clientId: "88a7876dc4c330f0dfa6c5c611818d62",
brazeId: "908c5857-650b-4f31-8ec7-63b15dc11d1d",
siftAccountId: "60f88a09293fb116c8220750",
siftApiKey: "2cd7fd28042a1454",
siftBeaconKey: "df80113946",
perimeterxId: "BMkUl9nm",
storyblokToken: "4LYunuxrMxUarw6vBokjKAtt",
storyblokVersion: "draft",
placesAPI: "AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks",
paypalID:
"AfOWmRjlT73hGanCAUypmRtFas_NsPcXek2_fL8XOIrJHBDoUxcSEVBQ72Ls4fc_2xgJSWK3gTDrgjhI",
apptentiveID: "61f08786218b3765d7000024",
apptentiveTvg5: "6204200f48b9d649d700005d",
apptentiveIosKey: "IOS-TVG-DEVELOPMENT-b03e074ea0dd",
apptentiveIosSignature: "693be9827104eaa410239b062acd34b8",
apptentiveAndroidKey: "ANDROID-TVG-DEVELOPMENT",
apptentiveAndroidSignature: "809f6458570a7d899a7ff37684765a4d",
sonarQube: {
serverUrl: "https://sonarqube.gcp-dev.tvg.com",
token: "8836caf742bb1c13755da2d957ba5d1674adbc43",
projectKey: "tvg-monorepo"
},
datadogRum: {
desktopApplicationId: "123b949b-108c-4306-bea0-9227242f5b17",
desktopClientToken: "pub748e107dd1bd28256dad4b1425dda2e3",
mobileApplicationId: "03715ae6-b7e2-4b30-ac7b-cf6a5bfdf763",
mobileClientToken: "pub333a7706c3a954d17d9db1becba22673",
fdrApplicationId: "c15f8a9f-f7a7-4108-97f3-9e81d2e936fb",
fdrClientToken: "pubf5bbdc9d5e227feae77a9ad9f5e1013a",
site: "datadoghq.com"
},
externalServices: {
cpp: "https://promos-api.racing.fanduel.com"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/staging/fdr.ts
const {
STORYBLOK_TOKENS: STORYBLOK_TOKENS_STAGING
} = require("../../utils/fdr/storyblok");
const {
APPTENTIVE_TOKENS: APPTENTIVE_TOKENS_STAGING
} = require("../../utils/fdr/apptentive");
module.exports = {
domain: {
desktop: "staging.racing.fanduel.com",
mobile: "staging.racing.fanduel.com",
talentPicks: "staging.racing.fanduel.com/talent-picks/",
accountWallet: "account.racing.fanduel.com",
equibase: "equibase-store.fanduel.com"
},
service_host: "service-staging.racing.fanduel.com",
externalDomain: {
FDTermsConditions: "https://fanduel.com/terms",
FDPolicy: "https://fanduel.com/privacy",
FDRLoginBridge: "https://fanduel.com/sso-auth/fdracing",
FDRSignup:
"https://www.fanduel.com/join?next=%2Fsso-auth%2Ffdracing%3Fredirect_uri%3D"
},
externalServices: {
fanduel: "https://api.fanduel.com",
cpp: "https://promos-api.racing.fanduel.com"
},
clientId: "a301e728606047a5b6522727d495b3ed",
brazeId: "e0b90c9d-dfd9-4809-a627-565a5cd7f3b2",
storyblokToken: STORYBLOK_TOKENS_STAGING.STAGING,
storyblokVersion: "draft",
appTentiveIos: APPTENTIVE_TOKENS_STAGING.IOS.PRODUCTION,
appTentiveAndroid: APPTENTIVE_TOKENS_STAGING.ANDROID.PRODUCTION,
appTentiveWeb: APPTENTIVE_TOKENS_STAGING.WEB.PRODUCTION
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/staging/iowa.ts
module.exports = {
domain: {
desktop: "ia-staging.tvg.com",
mobile: "ia-staging.tvg.com",
talentPicks: "ia-staging.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LeIYBcqAAAAAE2wDhSub9Ic8oeidAiiUt4gYM4a",
recaptchaIdNative: "6LfRQloqAAAAABY9v2RydlB10Lfgb5ODmvygHy3G"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/staging/pabets.ts
module.exports = {
domain: {
desktop: "pabets-staging.tvg.com",
mobile: "pabets-staging.tvg.com",
talentPicks: "pabets-staging.tvg.com/talent-picks/",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LeIYBcqAAAAAE2wDhSub9Ic8oeidAiiUt4gYM4a",
recaptchaIdNative: "6LfRQloqAAAAABY9v2RydlB10Lfgb5ODmvygHy3G"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/staging/tvg.ts
module.exports = {
domain: {
desktop: "www-staging.tvg.com",
mobile: "www-staging.tvg.com",
talentPicks: "www-staging.tvg.com/talent-picks/",
accountWallet: "account.racing.fanduel.com",
equibase: "equibase-store.tvg.com"
},
recaptchaID: "6LeIYBcqAAAAAE2wDhSub9Ic8oeidAiiUt4gYM4a",
recaptchaIdNative: "6LfRQloqAAAAABY9v2RydlB10Lfgb5ODmvygHy3G"
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/brand.ts
import type { Brand } from "./types";
export const AWS_HOSTNAME_SUBDOMAIN = "racing.fndlext.net"; // AWS subdomain
export const BRAND_TVG = "tvg";
export const BRAND_FDR = "fdr";
export const BRAND_4NGBETS = "4njbets";
export const BRAND_PABETS = "pabets";
export const BRAND_IOWA = "iowa";
export const BRAND_ALL = [
BRAND_TVG,
BRAND_FDR,
BRAND_4NGBETS,
BRAND_PABETS,
BRAND_IOWA
];
export default (hostname: string | undefined): Brand => {
if (hostname) {
if (/(nj|4njbets)(\.|-)/gi.test(hostname)) {
return BRAND_4NGBETS;
}
if (/(pa|pabets)(\.|-)/gi.test(hostname)) {
return BRAND_PABETS;
}
if (/ia(\.|-)/gi.test(hostname)) {
return BRAND_IOWA;
}
if (
/fdbox|fanduel(\.|-)|racing/gi.test(
hostname.replace(AWS_HOSTNAME_SUBDOMAIN, "")
)
) {
return BRAND_FDR;
}
}
return BRAND_TVG;
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/environment.ts
import type { Env } from "./types";
import { isBrowser } from "./utils";
export const AW_ENV_MAPPING = {
dev: "dev",
qa: "qa",
staging: "prod",
production: "prod",
// aws environments
int: "qa",
stg: "prod",
prd: "prod"
};
const env: Env[] = [
"production",
"staging",
"qa",
"aws-stg",
"aws-int",
"aws-prd"
];
const defaultEnv: Env = env[5];
const getEnvironmentByHostname = (hostname?: string): Env => {
if (hostname === "10.0.2.2") {
return "aws-int";
}
if (!hostname) {
return defaultEnv;
}
// aws environments
if (/stg\./gi.test(hostname)) {
return "aws-stg";
}
if (/int\./gi.test(hostname)) {
return "aws-int";
}
if (/prd\./gi.test(hostname)) {
return "aws-prd";
}
// gcp environments
if (/(stage\.|staging\.|cert\.)/gi.test(hostname)) {
return "aws-stg";
}
if (/qa\.|dev\./gi.test(hostname)) {
return "aws-int";
}
return defaultEnv;
};
/* eslint-disable */
const getEnvironmentInBrowser = (): Env | false =>
!!window.__TVG_GLOBALS__ &&
!!window.__TVG_GLOBALS__.ENVIRONMENT &&
(window.__TVG_GLOBALS__.ENVIRONMENT as Env);
/* eslint-enable */
const getEnvironmentInServer = (): Env | false =>
// @FIXME in the next line we are doing an explicit typecast, that's why we
// need the `any` type. However we could try to find how to extend the type of
// process.env instead.
typeof process !== "undefined" &&
typeof process.env.ENVIRONMENT === "string" &&
(process.env.ENVIRONMENT === "dev"
? ("qa" as Env)
: env.includes(process.env.ENVIRONMENT as Env) &&
(process.env.ENVIRONMENT as Env));
/**
* When fetching an environment two variables have priority:
* - in the browser, node-grid should inject a global variable `__TVG_GLOBALS__.ENVIRONMENT`
* - in the server, the container has the variable ENVIRONMENT
* These two variables allows to be deterministic about the environment, and only
* if by some unknown reason they fail, then we check the hostname as a last resourt
*/
export default (hostname?: string): Env =>
// eslint-disable-next-line
isBrowser() && window.__TVG_GLOBALS__
? getEnvironmentInBrowser() || getEnvironmentByHostname(hostname)
: getEnvironmentInServer() || getEnvironmentByHostname(hostname);
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/default.ts
const { STORYBLOK_TOKENS } = require("../utils/fdr/storyblok");
const { APPTENTIVE_TOKENS } = require("../utils/fdr/apptentive");
const { AMPLITUDE_API_KEYS } = require("../utils/urp/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_FDR,
AMPLITUDE_API_KEYS_XSELL: AMPLITUDE_API_KEYS_FDR_XSELL
} = require("../utils/fdr/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_MEP
} = require("../utils/mep/amplitude");
const {
AMPLITUDE_API_KEYS: AMPLITUDE_API_KEYS_TVG4
} = require("../utils/tvg4/amplitude");
const defaultOption = {
domain: {
desktop: "www.tvg.com",
mobile: "touch.tvg.com",
talentPicks: "www.tvg.com/talent-picks/"
},
externalDomain: {
support: "https://support.tvg.com",
contactSupport:
"https://support.tvg.com/tvg/s/articles/360005946853-Contact-Support",
NCPGamblingChat: "http://www.ncpgambling.org/chat"
},
externalServices: {
cpp: "https://promos-api.racing.fanduel.com"
},
service_host: "service.tvg.com",
service: {
graph: "/graph/v2/query",
graphWS: "/graph/v2/subscriptions",
wtx: "/wtx/v1",
pay: "/pay/v1",
capi: "/capi/v1",
log: "/uel/v1/log-event",
usa: "/usa/v2",
uam: "/uam/v1",
prf: "/prf/v1",
geo: "/geo/v1",
uwt: "/uwt/v1",
wro: "/wro/v1",
uas: "/uas/v1",
slp: "/slp/v2",
ufc: "/ufc/v1",
rcn: "/rcn/v1",
tpm: "/tpm/v1",
fcp: "/fcp/v2/query",
rwd: "/rwd/v1",
pes: "/pes/v1",
pro: "/pro/v1",
rda: "/rda/v1/query",
fdr: "/fdr/v2",
wrc: "/wrc/v1",
cus: "/cus/v1",
pxp: "/pxp/v1/proxy",
gas: "/gas/v1/query",
gasUsers: "/gas/v1/users",
gasWS: "/gas/v1/subscriptions",
behg: "/behg/v1/query", // behg -> bets history graph
behgWS: "/behg/v1/subscriptions", // behg -> bets history graph
fem: "/fem/v1",
crf: "/crf/v1",
ach: "/ach/v1",
ccp: "/ccp/v1",
uc: "/uc/v1",
mpak: "/mpak/v1",
chk: "/chk/v1",
pnm: "/pnm/v1",
mzm: "/mzm/v1",
fed: "/gatewayfederation/v1/query",
fedWS: "/gatewayfederation/v1/subscription",
cosmo: "/cosmo/v1/graphql",
cosmoWS: "/cosmo/v1/graphql",
seo: "/seo/v1"
},
serviceName: {
graph: "service-javagraph",
graphWS: "service-javagraph-subscriptions",
wtx: "service-wtx",
pay: "service-pay",
capi: "service-capi",
log: "service-uel",
usa: "service-usa",
uam: "service-uam",
prf: "service-prf",
geo: "service-geo",
uwt: "service-uwt",
wro: "service-wro",
uas: "service-uas",
slp: "service-slp",
ufc: "service-ufc",
rcn: "service-rcn",
tpm: "service-tpm",
fcp: "service-fcp",
rwd: "service-rwd",
pes: "service-pes",
pro: "service-pro",
rda: "service-rda",
fdr: "service-fdr",
wrc: "service-wrc",
cus: "service-cus",
pxp: "service-pxp",
gas: "service-gas",
gasUsers: "service-gas",
gasWS: "service-gas-subscriptions",
behg: "service-behg",
behgWS: "service-behg",
fem: "service-fem",
crf: "service-crf",
ach: "service-ach",
ccp: "service-ccp",
uc: "service-uc",
mpak: "service-mpak",
chk: "service-chk",
pnm: "service-pnm",
mzm: "service-mzm",
seo: "service-seo"
},
google: {
tvg4: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "desktop",
productVersion: "TVG4"
},
tvg5: {
gtmId: "KTDSBG",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "desktop",
productVersion: "TVG5"
},
touch2: {
gtmId: "NX7J29",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "mobile_web",
productVersion: "MEP"
},
touch3: {
gtmId: "NX7J29",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "mobile_web",
productVersion: "MEP"
},
androidwrapper: {
gtmId: "NX7J29",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "android_native",
productVersion: "android_gps"
},
tvgandroid: {
gtmId: "NX7J29",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "android_native",
productVersion: "android_apk"
},
ios: {
gtmId: "NX7J29",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native"
},
ios2: {
gtmId: "NX7J29",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native"
},
fdrmobile: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "mobile_web",
productVersion: "MEP"
},
fdrios: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "ios_native",
productVersion: "MEP"
},
fdrandroid: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidwrapper: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdrandroidgps: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "android_native",
productVersion: "android_apk"
},
fdriosxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "MEP"
},
fdrandroidxsell: {
gtmId: "NSHBQSR",
gtmEnv: "5",
gtmAuth: "brY2SVdkc5NjBXD6t4kZTg",
siteVersion: "x-sell",
productVersion: "android_apk"
},
iosnative: {
gtmId: "NX7J29",
gtmEnv: "482",
gtmAuth: "EM7EyobnJbhcGWCe5IOyyw",
siteVersion: "ios_native",
productVersion: "ios_native"
}
},
amplitude: {
tvg5: {
amplitudeAPI: AMPLITUDE_API_KEYS.QA,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_urp"
},
fdrmobile: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR.QA,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "fdr_standalone_lobby"
},
fdrios: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR.QA,
siteVersion: "native",
sitePlatform: "ios",
product: "fdr_standalone_lobby"
},
fdrandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "self_dist"
},
fdrandroidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdrandroidgps: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR.QA,
siteVersion: "native",
sitePlatform: "android",
product: "fdr_standalone_lobby",
androidDistributionMethod: "google_playstore"
},
fdriosxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL.QA,
siteVersion: "x-sell",
sitePlatform: "ios",
product: "fdr_xsell_lobby"
},
fdrandroidxsell: {
amplitudeAPI: AMPLITUDE_API_KEYS_FDR_XSELL.QA,
siteVersion: "x-sell",
sitePlatform: "android",
product: "fdr_xsell_lobby"
},
touch3: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP.QA,
siteVersion: "mobile_web",
sitePlatform: "mobile_web",
product: "tvg_mep"
},
androidwrapper: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP.QA,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvgandroid: {
amplitudeAPI: AMPLITUDE_API_KEYS_MEP.QA,
siteVersion: "native",
sitePlatform: "android",
product: "tvg_mep",
androidDistributionMethod: "self_dist"
},
tvg4: {
amplitudeAPI: AMPLITUDE_API_KEYS_TVG4.QA,
siteVersion: "desktop",
sitePlatform: "desktop",
product: "tvg_tvg4"
}
},
clientId: "88a7876dc4c330f0dfa6c5c611818d62",
brazeId: "a728acfe-5f28-42c0-9c08-174ecb4394d5",
perimeterxId: "TK74ox9H",
storyblokToken: STORYBLOK_TOKENS.QA,
storyblokVersion: "draft",
placesAPI: "AIzaSyCvQe2IeP1DnZT6v0PLK-n4bjK9RqcEarQ",
paypalID:
"AbOXWUz9wwf1L17esie_vpZ99gwz9hxQmobirFtIirrZbE3levMoS_lb7BWll5DnB2qB1m11Mmmge8JV",
apptentiveID: "61f08786218b3765d7000024",
apptentiveTvg5: "6204200f48b9d649d700005d",
sonarQube: {
serverUrl: "https://sonarqube.gcp-dev.tvg.com",
token: "8836caf742bb1c13755da2d957ba5d1674adbc43",
projectKey: "tvg-monorepo"
},
datadogRum: {
desktopApplicationId: "123b949b-108c-4306-bea0-9227242f5b17",
desktopClientToken: "pub748e107dd1bd28256dad4b1425dda2e3",
mobileApplicationId: "03715ae6-b7e2-4b30-ac7b-cf6a5bfdf763",
mobileClientToken: "pub333a7706c3a954d17d9db1becba22673",
fdrApplicationId: "c15f8a9f-f7a7-4108-97f3-9e81d2e936fb",
fdrClientToken: "pubf5bbdc9d5e227feae77a9ad9f5e1013a",
site: "datadoghq.com"
},
siftAccountId: "60f88a09293fb116c8220753",
siftApiKey: "9cc4454a4bfac8e3",
siftBeaconKey: "d9c3d7901c",
appTentiveIos: APPTENTIVE_TOKENS.IOS.PRODUCTION,
appTentiveAndroid: APPTENTIVE_TOKENS.ANDROID.PRODUCTION,
appTentiveWeb: APPTENTIVE_TOKENS.WEB.PRODUCTION
};
export default defaultOption;
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/base.ts
/* eslint-disable global-require */
const base = {
qa: require("./qa/base"),
staging: require("./staging/base"),
production: require("./production/base"),
// aws environments
"aws-int": require("./aws-int/base"),
"aws-stg": require("./aws-stg/base"),
"aws-prd": require("./aws-prd/base")
};
export default base;
webpack://frontend-tpt/../../packages/tvg-lib-conf/content/brand.ts
/* eslint-disable global-require */
const brand = {
qa: {
"4njbets": require("./qa/4njbets"),
iowa: require("./qa/iowa"),
pabets: require("./qa/pabets"),
tvg: require("./qa/tvg"),
fdr: require("./qa/fdr"),
base: require("./qa/base")
},
staging: {
"4njbets": require("./staging/4njbets"),
iowa: require("./staging/iowa"),
pabets: require("./staging/pabets"),
tvg: require("./staging/tvg"),
fdr: require("./staging/fdr"),
base: require("./staging/base")
},
production: {
"4njbets": require("./production/4njbets"),
iowa: require("./production/iowa"),
pabets: require("./production/pabets"),
tvg: require("./production/tvg"),
fdr: require("./production/fdr"),
base: require("./production/base")
},
"aws-int": {
"4njbets": require("./aws-int/4njbets"),
iowa: require("./aws-int/iowa"),
pabets: require("./aws-int/pabets"),
tvg: require("./aws-int/tvg"),
fdr: require("./aws-int/fdr"),
base: require("./aws-int/base")
},
"aws-stg": {
"4njbets": require("./aws-stg/4njbets"),
iowa: require("./aws-stg/iowa"),
pabets: require("./aws-stg/pabets"),
tvg: require("./aws-stg/tvg"),
fdr: require("./aws-stg/fdr"),
base: require("./aws-stg/base")
},
"aws-prd": {
"4njbets": require("./aws-prd/4njbets"),
iowa: require("./aws-prd/iowa"),
pabets: require("./aws-prd/pabets"),
tvg: require("./aws-prd/tvg"),
fdr: require("./aws-prd/fdr"),
base: require("./aws-prd/base")
}
};
export default brand;
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/brazeDevice.ts
import { get } from "lodash";
import type { Product } from "./types";
const deviceMapped = {
touch3: {
iOS: "web_ios",
AndroidOS: "web_android"
},
ios2: {
iOS: "iOS",
AndroidOS: "Android"
},
tvg4: {
iOS: "desktop",
AndroidOS: "desktop"
},
fdrmobile: {
iOS: "web_ios",
AndroidOS: "web_android"
},
fdrios: {
iOS: "iOS",
AndroidOS: "Android"
},
fdrandroid: {
iOS: "iOS",
AndroidOS: "Android"
},
androidwrapper: {
iOS: "iOS",
AndroidOS: "Android"
}
};
export default (os: string, product: Product) =>
get(deviceMapped, `${product}.${os}`, "web_ios");
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/features.ts
import axios from "axios";
import { attempt } from "./utils";
import type {
ServiceConfig,
FeatureToggles,
Product,
Device,
Brand
} from "./types";
const parseFeatures = (featuresData: string): FeatureToggles | false => {
let features;
const data = attempt(() => JSON.parse(decodeURIComponent(featuresData)));
if (!(data instanceof Error) && typeof data === "object") {
features = data as FeatureToggles;
}
return features || false;
};
const readFeatures = (): FeatureToggles | false => {
let featuresObject;
/* eslint-disable */
if (
typeof window !== "undefined" &&
window.__TVG_GLOBALS__ &&
window.__TVG_GLOBALS__.FEATURE_TOGGLES
) {
featuresObject = parseFeatures(
window.__TVG_GLOBALS__.FEATURE_TOGGLES
) as FeatureToggles;
}
/* eslint-enable */
return featuresObject || false;
};
const getFeatures = (
service: ServiceConfig,
product: Product,
device: Device,
brand: Brand,
serverSide: boolean
): Promise<FeatureToggles | false> => {
const features = readFeatures();
if (features || (typeof window === "undefined" && !serverSide)) {
return Promise.resolve().then(() => features);
}
const requestOptions = {
url: `${service.capi}/featureToggles/${product}/${device}/${brand}`,
method: "GET",
withCredentials: true
};
return axios(requestOptions).then((result) =>
result.data
? result.data
: Promise.reject(new Error("No feature toggles returned"))
);
};
export default { readFeatures, getFeatures };
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/messages.ts
import axios from "axios";
import { attempt } from "./utils";
import type { Messages, Product, Device, Brand } from "./types";
let cachedMessages: Record<string, string> = {};
const parseMessages = (messagesData: string): Messages | {} => {
let messages = {};
const data = attempt(() => JSON.parse(decodeURIComponent(messagesData))) as
| { response: { [key: string]: string } }
| Error;
if (!(data instanceof Error) && typeof data === "object" && data.response) {
messages = data.response;
}
return messages;
};
const readMessages = (
namespaces: Array<string> | undefined = undefined
): Messages => {
let messagesObject = {};
// reads messages from server side injection stores in cache
/* eslint-disable */
if (
typeof window !== "undefined" &&
window.__TVG_GLOBALS__ &&
window.__TVG_GLOBALS__.MESSAGES
) {
messagesObject = parseMessages(window.__TVG_GLOBALS__.MESSAGES);
cachedMessages = { ...messagesObject, ...cachedMessages };
messagesObject = cachedMessages;
}
/* eslint-enable */
if (cachedMessages && Object.keys(cachedMessages).length > 0) {
// reads messages from cached data
if (namespaces) {
messagesObject = Object.assign(
{},
...namespaces.map((name) => cachedMessages[name])
);
} else {
const namespaceMap = Object.keys(cachedMessages);
messagesObject = Object.assign(
{},
...namespaceMap.map((name) => cachedMessages[name])
);
}
}
return messagesObject;
};
// @deprecated
const getMessages = (
namespaces: string[],
capiEndpoint: string,
product: Product,
device: Device,
brand: Brand,
forceFetch: boolean
): Promise<Messages | false> => {
if (!namespaces || !(namespaces instanceof Array)) {
return Promise.reject(new Error("No namespaces were provided"));
}
if (!forceFetch) {
const messages = readMessages(namespaces);
if (Object.keys(messages).length > 0 && messages.constructor === Object) {
return Promise.resolve().then(() => messages);
}
}
const requestOptions = {
url: `${capiEndpoint}/messages/namespace?product=${product}&device=${device}&brand=${brand}&namespace=${namespaces.join(
","
)}`,
method: "GET",
withCredentials: true
};
return axios(requestOptions).then((result) => {
let messagesMap = [];
let messages = {};
if (
!result.data ||
!result.data.response ||
result.data.response.length < 1
) {
Promise.reject(new Error("No messages returned"));
} else {
messagesMap = namespaces.map((k) => result.data.response[k]);
messages = messagesMap.reduce((cache, values, i) => {
const msgs: Record<string, string> = {};
msgs[namespaces[i]] = values;
return { ...cache, ...msgs };
}, messages);
cachedMessages = { ...cachedMessages, ...messages };
}
return Object.assign({}, ...messagesMap);
});
};
export default { readMessages, getMessages };
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/buildurl.ts
import queryString from "query-string";
import { get } from "lodash";
import type {
App,
Product,
Location,
Domain,
Params,
BrazeDevice
} from "./types";
import { isBrowser, isDev } from "./utils";
const microapps: App[] = ["rma", "dma", "prf", "referral"];
export default (
app: App | Product = "tvg4",
wrapper: boolean = false,
callback: string | boolean = false,
path: string = "",
params: Params | null = null,
relative: boolean = false
) =>
(
domain: Domain,
location: Location,
product: Product,
brazeDevice: BrazeDevice
) => {
let target: string = "";
let query: string = "";
const urlParams =
typeof params === "string" ? queryString.parse(params) : params;
const localhost = isBrowser()
? `http://${get(window, "location.hostname", "").trim()}${
get(window, "location.port", "").trim()
? `:${get(window, "location.port", "").trim()}`
: ""
}`
: `http://localhost:${process ? process.env.PORT : "8080"}`;
const pathName = `${path.indexOf("/") === 0 ? "" : "/"}${encodeURI(path)}`;
switch (app) {
case "rma":
target = `https://${domain.desktop}/registration${pathName}`;
break;
case "dma":
target = `https://${domain.desktop}/deposit${pathName}`;
break;
case "prf":
target = `https://${domain.desktop}/tvg-password-recovery/#${
path ? pathName : "/forgotcredentials"
}`;
break;
case "rgnative":
target = `https://${domain.desktop}/responsible-gaming-native`;
break;
case "promos":
target = `https://${domain.desktop}/promos${pathName}`;
break;
case "referral":
target = `https://${domain.desktop}/referral${pathName}`;
break;
case "talentPicks":
target = `https://${domain.talentPicks}${encodeURI(path)}`;
break;
case "accountWallet":
target = `https://${
domain.accountWallet || `account.${domain.mobile}`
}${pathName}`;
break;
case "tvg4":
case "touch3":
case "touch2":
case "ios":
case "ios2":
target = isDev()
? `${localhost}${pathName}`
: `https://${domain.mobile}${pathName}`;
break;
default:
target = isDev()
? `${localhost}${pathName}`
: `https://${domain.desktop}${pathName}`;
}
if (urlParams && Object.keys(urlParams)) {
query = Object.keys(urlParams)
.map((key) => {
const value = urlParams[key] || "";
return `${encodeURIComponent(key)}=${encodeURIComponent(
value as string
)}`;
})
.join("&");
}
let url = relative ? pathName : target;
if (microapps.includes(app as App)) {
url = `${target}?location=${location}&product=${product}${
wrapper ? "&wrapper=true" : ""
}&device=${brazeDevice}`;
if (callback) {
url = `${url}&callback=`;
if (typeof callback === "string") {
url = `${url}${encodeURIComponent(callback)}`;
} else if (
typeof callback === "boolean" &&
typeof document === "object"
) {
url = `${url}${encodeURIComponent(
`${document.location.host}${
document.location.pathname !== "/"
? document.location.pathname
: ""
}${document.location.search}`
)}`;
} else {
url = `${url}${encodeURIComponent(domain.desktop)}`;
}
}
url = `${url}${query ? "&" : ""}`;
} else {
url = `${url}${query ? "?" : ""}`;
}
return `${url}${query}`;
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/states.ts
export type StateType = {
abbreviation: string;
name: string;
wageringState: boolean;
};
export default [
{ abbreviation: "AL", name: "Alabama", wageringState: false },
{ abbreviation: "AK", name: "Alaska", wageringState: false },
{ abbreviation: "AZ", name: "Arizona", wageringState: true },
{ abbreviation: "AR", name: "Arkansas", wageringState: true },
{ abbreviation: "CA", name: "California", wageringState: true },
{ abbreviation: "CO", name: "Colorado", wageringState: true },
{ abbreviation: "CT", name: "Connecticut", wageringState: true },
{ abbreviation: "DE", name: "Delaware", wageringState: true },
{ abbreviation: "DC", name: "District of Columbia", wageringState: false },
{ abbreviation: "FL", name: "Florida", wageringState: true },
{ abbreviation: "GA", name: "Georgia", wageringState: false },
{ abbreviation: "HI", name: "Hawaii", wageringState: false },
{ abbreviation: "ID", name: "Idaho", wageringState: true },
{ abbreviation: "IL", name: "Illinois", wageringState: true },
{ abbreviation: "IN", name: "Indiana", wageringState: true },
{ abbreviation: "IA", name: "Iowa", wageringState: true },
{ abbreviation: "KS", name: "Kansas", wageringState: false },
{ abbreviation: "KY", name: "Kentucky", wageringState: true },
{ abbreviation: "LA", name: "Louisiana", wageringState: true },
{ abbreviation: "ME", name: "Maine", wageringState: false },
{ abbreviation: "MD", name: "Maryland", wageringState: true },
{ abbreviation: "MA", name: "Massachusetts", wageringState: true },
{ abbreviation: "MI", name: "Michigan", wageringState: true },
{ abbreviation: "MN", name: "Minnesota", wageringState: true },
{ abbreviation: "MS", name: "Mississippi", wageringState: false },
{ abbreviation: "MO", name: "Missouri", wageringState: false },
{ abbreviation: "MT", name: "Montana", wageringState: true },
{ abbreviation: "NE", name: "Nebraska", wageringState: false },
{ abbreviation: "NV", name: "Nevada", wageringState: false },
{ abbreviation: "NH", name: "New Hampshire", wageringState: true },
{ abbreviation: "NJ", name: "New Jersey", wageringState: true },
{ abbreviation: "NM", name: "New Mexico", wageringState: true },
{ abbreviation: "NY", name: "New York", wageringState: true },
{ abbreviation: "NC", name: "North Carolina", wageringState: false },
{ abbreviation: "ND", name: "North Dakota", wageringState: true },
{ abbreviation: "OH", name: "Ohio", wageringState: true },
{ abbreviation: "OK", name: "Oklahoma", wageringState: false },
{ abbreviation: "OR", name: "Oregon", wageringState: true },
{ abbreviation: "PA", name: "Pennsylvania", wageringState: true },
{ abbreviation: "RI", name: "Rhode Island", wageringState: true },
{ abbreviation: "SC", name: "South Carolina", wageringState: false },
{ abbreviation: "SD", name: "South Dakota", wageringState: true },
{ abbreviation: "TN", name: "Tennessee", wageringState: true },
{ abbreviation: "TX", name: "Texas", wageringState: false },
{ abbreviation: "UT", name: "Utah", wageringState: false },
{ abbreviation: "VT", name: "Vermont", wageringState: true },
{ abbreviation: "VA", name: "Virginia", wageringState: true },
{ abbreviation: "WA", name: "Washington", wageringState: true },
{ abbreviation: "WV", name: "West Virginia", wageringState: true },
{ abbreviation: "WI", name: "Wisconsin", wageringState: false },
{ abbreviation: "WY", name: "Wyoming", wageringState: true }
];
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/graphContext.ts
import type {
Context,
Brand,
Product,
Device,
GraphBrand,
GraphProduct,
GraphDevice
} from "./types";
const productMap = {
tvg4: "TVG4",
tvg5: "TVG5",
touch2: "Touch",
touch3: "Touch3",
ios2: "IOS2",
ios: "ios",
exchange: "exchange",
login: "login",
fdrmobile: "FDRMOBILE",
fdrios: "FDRIOS",
fdriosxsell: "FDRIOS",
fdrandroid: "FDRANDROID",
fdrandroidgps: "FDRANDROID",
fdrandroidxsell: "FDRANDROID",
iosnative: "iosnative",
androidnative: "androidnative",
androidwrapper: "ANDROIDWRAPPER",
tvgandroid: "TVGANDROID"
};
const deviceMap = { desktop: "Desktop", mobile: "Mobile", tablet: "Mobile" };
const brandMap = {
"4njbets": "4NJBets",
pabets: "PABets",
iowa: "IA",
tvg: "TVG",
fdr: "FDR"
};
export default (brand: Brand, product: Product, device: Device): Context => ({
brand: brandMap[brand] as GraphBrand,
product: productMap[product] as GraphProduct,
device: deviceMap[device] as GraphDevice
});
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/index.ts
import { get } from "lodash";
import MobileDetect from "mobile-detect";
import type { TvgConf, Product, Env } from "./types";
import tvgBrand, { BRAND_FDR } from "./brand";
import tvgEnvironment from "./environment";
import content from "./content";
import tvgDevice from "./device";
import getBrazeDevice from "./brazeDevice";
import tvgProduct, {
PRODUCTS_IOS,
PRODUCTS_FDR,
PRODUCTS_FDR_X_SELL
} from "./product";
import tvgLocation from "./location";
import tvgFeatures from "./features";
import tvgMessages from "./messages";
import tvgMetadata from "./metadata";
import buildUrl from "./buildurl";
import states from "./states";
import getGraphContext from "./graphContext";
import { isBrowser, isRN as isRNFunc } from "./utils";
const OS_IOS = "iOS";
let hostname: string;
let userAgent: string;
let setProduct = "tvg4" as Product;
const getBrand = (product: string, hostnameParam: string) =>
PRODUCTS_FDR.includes(product) ? BRAND_FDR : tvgBrand(hostnameParam);
const getAmplitudeConfig = (product: string, brand: string) => {
if (product === "tvg5" && brand === "fdr") {
return "tvg5fdr";
}
return product;
};
// appConf
// appConf is set on the react native app and contains the necessary info
// to instatiate tvgConf
const tvgConf = (
givenHostname: string | undefined = hostname,
givenUserAgent: string | undefined = userAgent,
givenProduct: Product | undefined = setProduct
): TvgConf => {
if (!givenHostname && typeof window !== "undefined" && window.location) {
// eslint-disable-next-line
hostname = window.location.hostname;
} else {
hostname = get(global, "appConf.hostname", null) || givenHostname;
}
if (!givenUserAgent && typeof window !== "undefined" && window.navigator) {
// eslint-disable-next-line
userAgent = window.navigator.userAgent;
} else {
userAgent = get(global, "appConf.userAgent", null) || givenUserAgent;
}
setProduct =
get(global, "appConf.product", null) || givenProduct || setProduct;
const uaInfo = new MobileDetect(userAgent);
const environment: Env =
get(global, "appConf.environment", null) || tvgEnvironment(hostname);
const isProduction = ["production", "aws-prd"].includes(environment);
const isStaging = ["staging", "aws-stg"].includes(environment);
const product = tvgProduct(setProduct);
const device =
get(global, "appConf.device", null) || tvgDevice(userAgent, product);
const os = PRODUCTS_IOS.includes(product)
? OS_IOS
: // @ts-ignore
(uaInfo.os(userAgent) as OS);
const features = tvgFeatures.readFeatures();
const messages = tvgMessages.readMessages();
const metadata = tvgMetadata();
const configs = content(environment);
const brand = getBrand(product, hostname);
const brandConfig = configs[brand];
const location = tvgLocation(brand);
const isRN = isRNFunc();
const gaContext = () => {
let finalProduct: string = product;
if (product === "androidwrapper" && brand === "fdr") {
finalProduct = "fdrandroidwrapper";
} else if (product === "tvg5" && brand === "fdr") {
finalProduct = "fdrdesktop";
}
return `google.${finalProduct}`;
};
const getForcedProductName = (forcedProduct: Product): Product => {
let finalProduct = forcedProduct;
if (PRODUCTS_FDR_X_SELL.includes(forcedProduct)) {
finalProduct = forcedProduct.replace("xsell", "") as Product; // Forcing cast to use Product type
} else if (forcedProduct === "fdrandroidgps") {
// FDR Google play store to side-loaded
finalProduct = "fdrandroid";
}
return finalProduct;
};
const amplitudeContext = `amplitude.${getAmplitudeConfig(product, brand)}`;
const brazeDevice = getBrazeDevice(os, product);
return {
brand,
device,
environment,
isProduction,
isStaging,
product,
features,
messages,
metadata,
os,
brazeDevice,
context: (productContext = product, forceStandalone = false) => {
const finalProduct = forceStandalone
? getForcedProductName(productContext)
: product;
return `${finalProduct}-${brand}`;
},
// @ts-ignore
config: (configPath) => get(brandConfig, configPath, brandConfig),
gaConfig: () => get(brandConfig, gaContext(), brandConfig),
amplitudeConfig: () => get(brandConfig, amplitudeContext, brandConfig),
getFeatures: (localDevice = device, serverSide = false) =>
tvgFeatures.getFeatures(
brandConfig.service,
getForcedProductName(product),
localDevice,
brand,
serverSide
),
getMessages: (namespaces, forceFetch = false) =>
tvgMessages.getMessages(
namespaces,
brandConfig.service.capi,
getForcedProductName(product),
device,
brand,
forceFetch
),
getStates: () => states,
getDomains: (name = "desktop") => {
const brandMap = Object.keys(configs);
// @ts-ignore
return brandMap.map((configBrand) => configs[configBrand].domain[name]);
},
getClientId: () =>
isBrowser()
? btoa(`${brandConfig.clientId}:`)
: Buffer.from(`${brandConfig.clientId}:`).toString("base64"),
getExternalDomain: () => get(brandConfig, "externalDomain", {}),
buildUrl: (options) => {
const {
app = product,
wrapper = false,
callback = false,
path = "",
params = null,
relative = false
} = options;
return buildUrl(
app,
wrapper,
callback,
path,
params,
relative
)(
brandConfig.domain,
brand === BRAND_FDR ? BRAND_FDR : location,
product,
brazeDevice
);
},
graphContext: () => getGraphContext(brand, product, device),
isRN,
isBrowser
};
};
let tvgConfInstance: TvgConf;
export default (
givenHostname: string | undefined = hostname,
givenUserAgent: string | undefined = userAgent,
givenProduct: Product | undefined = setProduct
) => {
if (
givenHostname !== hostname ||
givenUserAgent !== userAgent ||
givenProduct !== setProduct ||
!tvgConfInstance
) {
tvgConfInstance = tvgConf(givenHostname, givenUserAgent, givenProduct);
}
return tvgConfInstance;
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/device.ts
import MobileDetect from "mobile-detect";
import type { Device } from "./types";
import { PRODUCTS_MOBILE } from "./product";
export default (userAgent?: string, product?: string): Device => {
const uaInfo = new MobileDetect(userAgent || "");
let device = "desktop";
device = (uaInfo.mobile() && "mobile") || device;
device = (uaInfo.tablet() && "tablet") || device;
// tablet exception
if (device === "desktop") {
return PRODUCTS_MOBILE.includes(product || "") ? "tablet" : device;
}
return device as Device;
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/metadata.ts
import { attempt } from "./utils";
import type { Metadata } from "./types";
/* eslint-disable */
export default (): Metadata | false => {
let metadata;
if (
typeof window !== "undefined" &&
window.__TVG_GLOBALS__ &&
window.__TVG_GLOBALS__.METADATA
) {
const data = attempt(() =>
JSON.parse(decodeURIComponent(window.__TVG_GLOBALS__.METADATA || ""))
);
if (!(data instanceof Error)) {
metadata = data as Metadata;
}
}
return metadata || false;
};
/* eslint-enable */
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/content.ts
import type { Env, Content } from "./types";
import configBase from "./base";
import { BRAND_ALL } from "./brand";
import defaults from "../content/default";
import base from "../content/base";
import tvgBrand from "../content/brand";
export default (env: Env): Content => {
const confDefault: Content = {
tvg: defaults,
pabets: defaults,
iowa: defaults,
"4njbets": defaults,
fdr: defaults
};
const content: {
production: Content;
staging: Content;
qa: Content;
"aws-int": Content;
"aws-stg": Content;
"aws-prd": Content;
} = {
production: { ...confDefault },
staging: { ...confDefault },
qa: { ...confDefault },
"aws-int": { ...confDefault },
"aws-stg": { ...confDefault },
"aws-prd": { ...confDefault }
};
Object.keys(content).forEach((envName) =>
BRAND_ALL.map((brand) => {
// @ts-ignore
const baseConf = base[envName];
// @ts-ignore
const brandConf = tvgBrand[envName][brand];
// @ts-ignore
content[envName][brand] = {
// @ts-ignore
...content[envName][brand],
...baseConf,
...brandConf
};
return brand;
})
);
const config = BRAND_ALL.reduce(
(acc, brand) => ({
...acc,
// @ts-ignore
[brand]: configBase.config(content[env][brand])
}),
{}
);
// @ts-ignore
return config;
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/base.ts
import type { Config } from "./types";
import { isBrowser, isRN, getServiceHost } from "./utils";
import { ServiceConfig } from "./types";
export default {
config(envConfig: Config) {
const serviceHost = getServiceHost(envConfig);
const service: Record<string, string> = {};
const servicePort = 8080;
Object.keys(envConfig.service).forEach((key) => {
const serviceName = envConfig.serviceName[key as keyof ServiceConfig];
const servicePath = envConfig.service[key as keyof ServiceConfig];
service[key] =
isBrowser() || isRN()
? // not proud but for now we can live with this for cosmo instead of a major refactor
`${
key.includes("cosmo")
? serviceHost
.replace("service", "api")
// pregaria da avo ana mas a vida é dura
.replace("api.us.betfair.com", "tvg-api.us.betfair.com")
.replace(
"api-qa.us.betfair.com",
"tvg-api-qa.us.betfair.com"
)
.replace(
"api-staging.us.betfair.com",
"tvg-api-staging.us.betfair.com"
)
// again not proud but life is hard so this qa domain
.replace("racing.qa.fndl.dev", "api.racing.qa.fndl.dev")
.replace("api.int.api", "api.int")
: serviceHost
}${servicePath}`
: `http://${serviceName}:${servicePort}${servicePath}`;
});
return {
service_host: serviceHost,
service,
google: envConfig.google,
amplitude: envConfig.amplitude,
domain: {
desktop: envConfig.domain.desktop,
mobile: envConfig.domain.mobile,
talentPicks: envConfig.domain.talentPicks,
accountWallet: envConfig.domain.accountWallet,
equibase: envConfig.domain.equibase
},
externalDomain: envConfig.externalDomain,
externalServices: envConfig.externalServices,
clientId: envConfig.clientId,
brazeId: envConfig.brazeId,
perimeterxId: envConfig.perimeterxId,
paypalID: envConfig.paypalID,
apptentiveID: envConfig.apptentiveID,
apptentiveTvg5: envConfig.apptentiveTvg5,
storyblokToken: envConfig.storyblokToken,
storyblokVersion: envConfig.storyblokVersion,
placesAPI: envConfig.placesAPI,
sonarQube: envConfig.sonarQube,
datadogRum: envConfig.datadogRum,
siftAccountId: envConfig.siftAccountId,
siftApiKey: envConfig.siftApiKey,
siftBeaconKey: envConfig.siftBeaconKey,
appTentiveIos: envConfig.appTentiveIos,
appTentiveAndroid: envConfig.appTentiveAndroid,
appTentiveWeb: envConfig.appTentiveWeb,
recaptchaID: envConfig.recaptchaID,
recaptchaIdNative: envConfig.recaptchaIdNative
};
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/location.ts
import type { Location, Brand } from "./types";
export default (brand: Brand): Location => {
switch (brand) {
case "4njbets":
return "nj";
case "pabets":
return "pa";
case "iowa":
return "ia";
default:
return "all";
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/product.ts
import type { Product } from "./types";
export const PRODUCTS_WEB = ["touch2", "touch3", "fdrmobile"];
export const PRODUCTS_IOS = [
"ios",
"ios2",
"fdrios",
"fdriosxsell",
"iosnative"
];
export const PRODUCTS_FDR_X_SELL = ["fdriosxsell", "fdrandroidxsell"];
export const PRODUCTS_FDR = [
"fdrmobile",
"fdrios",
"fdrandroid",
"fdrandroidgps",
...PRODUCTS_FDR_X_SELL
];
export const PRODUCTS_ANDROID = [
"androidnative",
"fdrandroid",
"androidwrapper",
"tvgandroid",
"fdrandroidxsell",
"fdrandroidgps"
];
export const PRODUCTS_MOBILE = [
...new Set([
...PRODUCTS_WEB,
...PRODUCTS_IOS,
...PRODUCTS_FDR,
...PRODUCTS_ANDROID
])
];
/* eslint-disable */
export default (product: Product): Product => {
if (
typeof window !== "undefined" &&
window.__TVG_GLOBALS__ &&
window.__TVG_GLOBALS__.PRODUCT
) {
return window.__TVG_GLOBALS__.PRODUCT;
}
return product;
};
/* eslint-enable */
webpack://frontend-tpt/../../packages/tvg-lib-conf/src/utils.ts
import { get } from "lodash";
import type { Config } from "./types";
export const attempt = (fn: () => unknown): unknown | Error => {
let result;
try {
result = fn();
} catch (e) {
result = e;
}
return result;
};
export const isBrowser = (): boolean => typeof window !== "undefined";
export const isRN = (): boolean =>
typeof navigator !== "undefined" && navigator.product === "ReactNative";
export const isDev = (): boolean =>
(isBrowser() &&
typeof get(window, "location.hostname.includes") === "function" &&
window.location.hostname.includes("local")) ||
(typeof window === "undefined" &&
typeof process.env.ENVIRONMENT === "string" &&
process.env.ENVIRONMENT === "dev");
export const getServiceHost = (envConfig: Config) =>
isBrowser()
? `//${envConfig.service_host}`
: `http://${envConfig.service_host}`;
webpack://frontend-tpt/../../packages/tvg-lib-conf/utils/fdr/amplitude.ts
module.exports = {
AMPLITUDE_API_KEYS: {
QA: "4a003fec5c6b5c9075661fd874943089",
STAGING: "405e14af37a3efefe3ff469d65339811",
PRODUCTION: "7a02b3ee70357df0fedb2f073ee6b9d0"
},
AMPLITUDE_API_KEYS_XSELL: {
QA: "64d1bda80ee432dabc671f9f8e7ec563",
STAGING: "64d1bda80ee432dabc671f9f8e7ec563",
PRODUCTION: "e23053be3d840ae45b2a1f786ba058f3"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/utils/fdr/apptentive.ts
module.exports = {
APPTENTIVE_TOKENS: {
IOS: {
QA: {
APP_KEY: "IOS-FANDUEL-RACING-DEVELOPMENT",
APP_SIGNATURE: "b54c8aadfa24aa1dcb03dc8df0c725e7",
APPTENTIVE_ID: "61ead8decdc4334729000151"
},
STAGING: {
APP_KEY: "IOS-FANDUEL-RACING-BET-ON-HORSES",
APP_SIGNATURE: "625f98c1c017603845ead137e69e1e0e",
APPTENTIVE_ID: "61ead7d3cdc4334729000139"
},
PRODUCTION: {
APP_KEY: "IOS-FANDUEL-RACING-BET-ON-HORSES",
APP_SIGNATURE: "625f98c1c017603845ead137e69e1e0e",
APPTENTIVE_ID: "61ead7d3cdc4334729000139"
}
},
ANDROID: {
QA: {
APP_KEY: "ANDROID-FANDUEL-RACING-DEVELOPME",
APP_SIGNATURE: "a5ef70979e53a2691f4977ff2c03dfc1",
APPTENTIVE_ID: "61f056825a88276417000000"
},
STAGING: {
APP_KEY: "ANDROID-FANDUEL-RACING-PRODUCTIO",
APP_SIGNATURE: "b4eb937e986299560e802a801370b69d",
APPTENTIVE_ID: "61f0566e5a88276441000002"
},
PRODUCTION: {
APP_KEY: "ANDROID-FANDUEL-RACING-PRODUCTIO",
APP_SIGNATURE: "b4eb937e986299560e802a801370b69d",
APPTENTIVE_ID: "61f0566e5a88276441000002"
}
},
WEB: {
QA: {
APPTENTIVE_ID: "6204200f48b9d649d700005d"
},
STAGING: {
APPTENTIVE_ID: "62041fcb5a88277d4900018f"
},
PRODUCTION: {
APPTENTIVE_ID: "62041fcb5a88277d4900018f"
}
}
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/utils/fdr/storyblok.ts
module.exports = {
STORYBLOK_TOKENS: {
QA: "O5iNnduumLUeBTEXgAUvRgtt",
STAGING: "gH2jxeroVxBkGa6Uvekv1wtt",
PRODUCTION: "YngyYOiNVuwhQx0qf0oynQtt"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/utils/mep/amplitude.ts
module.exports = {
AMPLITUDE_API_KEYS: {
QA: "9f0f370fab408d6e388b0aedce7d7f5d",
STAGING: "fe68f6456a5b8261fb971f9ef7b0825f",
PRODUCTION: "b632c2d052db2bf1e2da225654d64cce"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/utils/tvg4/amplitude.ts
module.exports = {
AMPLITUDE_API_KEYS: {
QA: "5c88fe8d83b3fe0e258ce1ebb0e2963d",
STAGING: "e3cca0c4e7b31d9282bc6afa3538b70e",
PRODUCTION: "29fd9abf9fb0e60e22136ab6f59a84b1"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-conf/utils/urp/amplitude.ts
module.exports = {
AMPLITUDE_API_KEYS: {
QA: "5c88fe8d83b3fe0e258ce1ebb0e2963d",
STAGING: "e3cca0c4e7b31d9282bc6afa3538b70e",
PRODUCTION: "29fd9abf9fb0e60e22136ab6f59a84b1"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-login-service/cjs/requests/idRequest.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.onError = void 0;
var _conf = _interopRequireDefault(require("@tvg/conf"));
var _requester = _interopRequireDefault(require("@tvg/api/requester"));
var _helper = require("../services/helper");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const onError = () => ({
error: {
status: "error",
message: "Id request fail"
},
success: null
});
exports.onError = onError;
const onSuccess = response => ({
error: null,
success: {
status: "success",
wagerProfile: response.data.wagerProfile,
accountNumber: response.data.accountNumber
}
});
var _default = () => (0, _requester.default)()({
method: "get",
url: `${(0, _conf.default)().config("service.usa")}/session/context`,
headers: (0, _helper.tvgHeaders)(),
withCredentials: true
}).then(onSuccess).catch(onError);
exports.default = _default;
webpack://frontend-tpt/../../packages/tvg-lib-login-service/cjs/requests/login.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.loginAction = exports.onLoginError = exports.onLoginSuccess = void 0;
var _axios = _interopRequireDefault(require("axios"));
var _conf = _interopRequireDefault(require("@tvg/conf"));
var _protocolSetter = _interopRequireDefault(require("@tvg/api/protocolSetter"));
var _helper = require("../services/helper");
var _geocomply = _interopRequireDefault(require("../services/middleware/geocomply"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const onLoginSuccess = response => ({
success: {
status: "success",
data: response.data
},
error: null
});
exports.onLoginSuccess = onLoginSuccess;
const onLoginError = error => {
if (!error.response || !error.response.data || error.response.status >= 500) {
return {
error: {
status: "error",
message: "An error occurred and we could not log you in at this time. Please <a target='_blank' href='https://support.tvg.com/s/'>contact our customer service</a> for assistance."
},
success: null
};
}
const redirect = error.response.data.redirectUrl ? {
redirectUrl: error.response.data.redirectUrl
} : {};
const responsibleGamingExclusion = error.response.data.responsibleGamingExclusion ? {
responsibleGamingExclusion: error.response.data.responsibleGamingExclusion
} : {};
const remainingTries = {
remainingTries: error.response.data.remainingTries
};
return {
error: {
status: "error",
...{
message: (0, _helper.errorParser)(error.response.data.exception)
},
...redirect,
...responsibleGamingExclusion,
...remainingTries
},
success: null
};
};
exports.onLoginError = onLoginError;
const loginRequest = (payload, geo) => {
if (typeof window !== "undefined" && window.grecaptcha && window.grecaptcha.enterprise && (0, _conf.default)().config("recaptchaID")) {
return new Promise(resolve => {
window.grecaptcha.enterprise.ready(() => {
window.grecaptcha.enterprise.execute((0, _conf.default)().config("recaptchaID"), {
action: "LOGIN"
}).then(token => {
return (0, _axios.default)({
method: "post",
url: `${(0, _protocolSetter.default)()}${(0, _conf.default)().config().service.usa}/login`,
data: {
account: payload.account,
pin: payload.pin,
stateAbbr: payload.stateAbbr,
...geo
},
headers: {
...(0, _helper.tvgHeaders)(),
"X-Recaptcha-Token": token
},
withCredentials: true
}).then(onLoginSuccess).catch(onLoginError).then(resolve);
}).catch(e => {
resolve(e);
});
});
});
}
return (0, _axios.default)({
method: "post",
url: `${(0, _protocolSetter.default)()}${(0, _conf.default)().config().service.usa}/login`,
data: {
account: payload.account,
pin: payload.pin,
stateAbbr: payload.stateAbbr,
...geo
},
headers: {
...(0, _helper.tvgHeaders)()
},
withCredentials: true
}).then(onLoginSuccess).catch(onLoginError);
};
const loginAction = payload => (0, _geocomply.default)(payload, loginRequest, ((0, _conf.default)().device === "desktop" || (0, _conf.default)().product === "tvg4") && (0, _conf.default)().brand === "4njbets");
exports.loginAction = loginAction;
webpack://frontend-tpt/../../packages/tvg-lib-login-service/cjs/requests/logout.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.onLogoutError = exports.onLogoutSuccess = void 0;
var _axios = _interopRequireDefault(require("axios"));
var _conf = _interopRequireDefault(require("@tvg/conf"));
var _protocolSetter = _interopRequireDefault(require("@tvg/api/protocolSetter"));
var _helper = require("../services/helper");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const onLogoutSuccess = () => ({
success: {
status: "success"
},
error: null
});
exports.onLogoutSuccess = onLogoutSuccess;
const onLogoutError = error => {
if (!error.response || !error.response.data || error.response.status >= 500) {
return {
error: {
status: "error",
message: "Logout request fail"
},
success: null
};
}
return {
error: {
...{
status: "error"
},
...{
message: error.response.data.message || "Fail to logout"
}
},
success: null
};
};
exports.onLogoutError = onLogoutError;
var _default = () => (0, _axios.default)({
method: "post",
url: `${(0, _protocolSetter.default)()}${(0, _conf.default)().config().service.usa}/logout`,
headers: (0, _helper.tvgHeaders)(),
withCredentials: true
}).then(onLogoutSuccess).catch(onLogoutError);
exports.default = _default;
webpack://frontend-tpt/../../packages/tvg-lib-login-service/cjs/requests/profile.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.onError = void 0;
var _axios = _interopRequireDefault(require("axios"));
var _conf = _interopRequireDefault(require("@tvg/conf"));
var _helper = require("../services/helper");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const onError = () => ({
error: {
status: "error",
message: "Profile request fail"
},
success: null
});
exports.onError = onError;
const onSuccess = response => {
const user = {
accountNumber: response.data.accountNumber,
accountRoles: response.data.accountRoles,
firstName: response.data.firstName,
lastName: response.data.lastName,
primaryPhone: response.data.primaryPhone,
wagerStatus: response.data.wagerStatus,
emailAddress: response.data.emailAddress,
homeAddress: response.data.homeAddress,
mailingAddress: response.data.mailingAddress,
signalProviderId: response.data.signalProviderId,
userName: response.data.userName,
profile: response.data.profile,
pin: ""
};
return {
error: null,
success: {
status: "success",
data: {
user
}
}
};
};
var _default = userId => (0, _axios.default)({
method: "get",
url: `${(0, _conf.default)().config().service.uam}/users/${userId}/profile`,
headers: (0, _helper.tvgHeaders)(),
withCredentials: true
}).then(onSuccess).catch(onError);
exports.default = _default;
webpack://frontend-tpt/../../packages/tvg-lib-login-service/cjs/services/geoComply/index.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _axios = _interopRequireDefault(require("axios"));
var _lodash = require("lodash");
var _conf = _interopRequireDefault(require("@tvg/conf"));
var _errorMessages = _interopRequireDefault(require("./errorMessages.json"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const validateGeoPacket = (userId, geo) => {
const tvg = (0, _conf.default)();
return (0, _axios.default)({
method: "POST",
url: `${tvg.config().service.geo}/geopacket`,
headers: {
Accept: "application/json",
"x-tvg-context": tvg.context()
},
data: {
geo,
userId
}
});
};
class GeoComplySvc {
constructor() {
this.geoClient = null;
this.geoLicenseExpiration = null;
this.geoLicense = null;
this.hasChecked = false;
this.getPack = this.getPack.bind(this);
this.getLicence = this.getLicence.bind(this);
this.getGeoPacket = this.getGeoPacket.bind(this);
this.clientEmitMessage = this.clientEmitMessage.bind(this);
this.validateGeoPacket = validateGeoPacket;
this.softErrorMessage = "geocomply browser error";
if (typeof window !== "undefined") {
this.geoComplyIsPresent = window.GcHtml5;
if (!this.geoComplyIsPresent) {
console.log(_errorMessages.default.missingGeo);
} else {
this.geoClient = window.GcHtml5.createClient(null, null);
this.geoClient.setReason("GeoComply login for TVG");
this.geoClient.events.on("engine.success", (text, xml) => {
this.clientEmitMessage({
success: {
text,
xml
}
});
});
this.geoClient.events.on("browser.failed", code => {
this.clientEmitMessage({
error: {
code,
message: this.softErrorMessage
}
});
});
this.geoClient.events.on("revised.failed", code => {
this.clientEmitMessage({
error: {
code,
message: this.softErrorMessage
}
});
});
this.geoClient.events.on("config.failed", (code, message) => {
this.clientEmitMessage({
error: {
code,
message
}
});
});
this.geoClient.events.on("engine.failed", (code, message) => {
this.clientEmitMessage({
error: {
code,
message
}
});
});
}
}
}
clientEmitMessage(answer) {
this.geoClient.events.emit("geoPacketAvailable", answer);
}
getGeoPacket(userId, type = "login") {
if (!this.geoComplyIsPresent || (0, _conf.default)().brand !== "4njbets") {
return Promise.reject({});
}
if (!this.geoClient) {
this.geoClient = window.GcHtml5.createClient(null, null);
}
if (type === "revalidate") {
this.geoClient.setReason("GeoComply revalidate for TVG");
} else {
this.geoClient.setReason("GeoComply login for TVG");
}
if (!this.geoLicense) {
return this.getLicence(userId).then(() => this.getPack(userId));
}
return this.getPack(userId).then(res => {
this.hasChecked = false;
return res;
}).catch(err => {
this.hasChecked = false;
return err;
});
}
getLicence(userId) {
const tvg = (0, _conf.default)();
return (0, _axios.default)({
method: "get",
url: `${tvg.config().service.geo}/license${this.geoLicenseExpiration ? `?currentLicenseTimestamp=${this.geoLicenseExpiration}` : ""}`,
headers: {
Accept: "application/json",
"x-tvg-context": tvg.context()
}
}).then(response => {
this.geoLicenseExpiration = response.data.expiration;
this.geoLicense = response.data.license;
return userId;
}).catch(() => {
this.geoLicenseExpiration = null;
this.geoLicense = null;
return undefined;
});
}
getPack(userId) {
if (!this.geoClient || !this.geoLicense) {
return Promise.reject(_errorMessages.default.missingGeo);
}
if (!userId) {
return Promise.reject(_errorMessages.default.missingUserID);
}
return new Promise((resolve, reject) => {
this.geoClient.events.on("geoPacketAvailable", data => {
if (data.success) {
return resolve({
geo: data.success.text
});
}
return reject(data.error);
});
this.geoClient.setUserId(userId.trim().toLowerCase());
this.geoClient.setLicense(this.geoLicense);
this.geoClient.request();
});
}
}
exports.default = GeoComplySvc;
module.exports = exports.default;
webpack://frontend-tpt/../../packages/tvg-lib-login-service/cjs/services/helper.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildRedirectMessage = exports.errorParser = exports.TimeDiffService = exports.tvgHeaders = void 0;
var _conf = _interopRequireDefault(require("@tvg/conf"));
var _reactCookie = _interopRequireDefault(require("react-cookie"));
var _static = require("./static");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const tvgHeaders = () => ({
"content-type": "application/json",
"x-tvg-context": (0, _conf.default)().context(),
"x-requested-with": "XMLHttpRequest"
});
exports.tvgHeaders = tvgHeaders;
const timeDiff = [];
const TimeDiffService = {
markStart: mark => {
timeDiff[mark] = Date.now();
},
markEnd: mark => Date.now() - timeDiff[mark],
getMark: mark => timeDiff[mark]
};
exports.TimeDiffService = TimeDiffService;
const errorParser = error => error in _static.errors ? _static.errors[error] : "Fail to login.";
exports.errorParser = errorParser;
const buildRedirectMessage = (redirectUrl, capiRedirectMessage) => {
const capiMessage = JSON.parse(capiRedirectMessage);
const {
loginRedirectionTitle = "<brand> CUSTOMER",
loginRedirectionMessage = "Looks like you’re from <state>! Due to state regulation, we need to redirect you to <brand>"
} = capiMessage;
let brand = "tvg";
if (redirectUrl.indexOf("4njbets") > -1) {
brand = "4njbets";
} else if (redirectUrl.indexOf("ia-") > -1 || redirectUrl.indexOf("ia.tvg") > -1) {
brand = "iowa";
} else if (redirectUrl.indexOf("pabets") > -1) {
brand = "pabets";
}
const stateMap = {
"4njbets": {
brand: "4NJBets",
state: "New Jersey"
},
iowa: {
brand: "TVG - IA",
state: "Iowa"
},
pabets: {
brand: "PABets",
state: "Pennsylvania"
},
tvg: {
brand: "TVG",
state: "TVG"
}
};
return {
redirectMessage: loginRedirectionMessage.replace(/<state>/g, stateMap[brand].state).replace(/<brand>/g, stateMap[brand].brand),
redirectTitle: loginRedirectionTitle.replace(/<brand>/g, stateMap[brand].brand)
};
};
exports.buildRedirectMessage = buildRedirectMessage;
webpack://frontend-tpt/../../packages/tvg-lib-login-service/cjs/services/middleware/geocomply.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _index = _interopRequireDefault(require("../geoComply/index"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const geoComply = new _index.default();
var _default = (payload, fn, useGeocomply) => {
const newfn = geo => fn(payload, geo);
if (useGeocomply) {
return geoComply.getGeoPacket(payload.account).then(newfn).catch(newfn);
}
return fn(payload, {});
};
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../packages/tvg-lib-login-service/cjs/services/static.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CONSTANTS = exports.errors = void 0;
const errors = {
ACCOUNT_DISABLED: "loginFailureAccountDisabled",
ACCOUNT_LOCKED: "loginFailureAccountLocked",
ACCOUNT_UPDATE_REQUIRED: "loginFailureAccountUpdateRequired",
BLACK_LISTED_LOCATION: "blackListedLocation",
BLOCKED_SERVICE: "geoLocationBlockedService",
BLOCKED_SOFTWARE: "geoLocationBlockedSoftware",
GEO_SERVICE_FAILURE: "loginFailureGeneric",
INVALID_CREDENTIALS: "loginFailureInvalidCredentials",
INVALID_GEO: "geoLocationUnconfirmedOrInvalid",
INVALID_GEOPACKET: "geoLocationUnconfirmedOrInvalid",
INVALID_WAGERING_STATE: "loginFailureNonLegalState",
LOGIN_FAILED: "loginFailureGeneric",
LOGIN_REDIRECT: "loginSiteRedirect",
MISSING_TOKEN: "apiMissingUserSessionToken",
NON_LEGAL_STATE: "loginFailureNonLegalState",
OUT_OF_BOUNDARY: "geoLocationOutOfBoundary",
SESSION_NOT_FOUND: "apiUserSessionNotFound",
SESSION_TIMEOUT: "apiUserSessionTimedOut",
UNCONFIRMED_BOUNDARY: "geoLocationUnconfirmedOrInvalid",
USER_SESSION_LIMIT_REACHED: "loginFailureUserSessionLimitReached",
ACCOUNT_IN_TIMEOUT: "loginFailureRGTimeout",
ACCOUNT_SUSPENDED: "loginFailureRGSuspendedOrClose",
ACCOUNT_SELF_EXCLUDED: "loginFailureRGSuspendedOrClose",
InvalidPinException: "invalidPinException",
"com.tvg.pxp.exceptions.UserCompromisedCredentialsException": "userCompromisedCredentials"
};
exports.errors = errors;
const CONSTANTS = {
SET_SESSION_SUCCESS: "SET_SESSION_SUCCESS",
SET_SESSION_ERROR: "SET_SESSION_ERROR",
CLEAR_SESSION: "CLEAR_SESSION",
SET_USER: "SET_USER",
CMS_LOGIN_MESSAGES: "CMS_LOGIN_MESSAGES",
"TVG_LOGIN:DO_LOGIN": "TVG_LOGIN:DO_LOGIN",
"TVG_LOGIN:DO_LOGIN_FORM": "TVG_LOGIN:DO_LOGIN_FORM",
"TVG_LOGIN:DO_LOGOUT": "TVG_LOGIN:DO_LOGOUT",
"TVG_LOGIN:USER_SESSION_UPDATE": "TVG_LOGIN:USER_SESSION_UPDATE",
"TVG_LOGIN:OPEN_LOGIN_MODAL": "TVG_LOGIN:OPEN_LOGIN_MODAL",
"TVG_LOGIN:CLOSE_LOGIN_MODAL": "TVG_LOGIN:CLOSE_LOGIN_MODAL",
"TVG_LOGIN:VALIDATE_SESSION": "TVG_LOGIN:VALIDATE_SESSION",
"TVG_LOGIN:TOUCH_ID_ERROR": "TVG_LOGIN:TOUCH_ID_ERROR",
UPDATE_USER_DATA: "UPDATE_USER_DATA",
METRIC_USER_LOGIN: "user_login"
};
exports.CONSTANTS = CONSTANTS;
webpack://frontend-tpt/../../packages/tvg-lib-login-service/cjs/src/index.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _lodash = require("lodash");
var _cookies = require("@tvg/utils/cookies");
var _login = require("../requests/login");
var _logout = _interopRequireDefault(require("../requests/logout"));
var _idRequest = _interopRequireDefault(require("../requests/idRequest"));
var _profile = _interopRequireDefault(require("../requests/profile"));
var _helper = require("../services/helper");
var _static = require("../services/static");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class LoginService {
static doLogin(payload) {
_helper.TimeDiffService.markStart(_static.CONSTANTS.METRIC_USER_LOGIN);
return (0, _login.loginAction)(payload).then(response => {
if (response.success) {
response.success.data.userDetails.pin = payload.pin;
(0, _cookies.cookieService)("wp", true, (0, _lodash.get)(response, "success.data.userDetails.profile"));
(0, _cookies.cookieService)("hasLoginOnce", true, "true", 31622400);
(0, _lodash.attempt)(() => {
sessionStorage.setItem("userId", (0, _lodash.get)(response, "success.data.userDetails.accountNumber"));
localStorage.setItem("userAuthenticationState", (0, _lodash.get)(payload, "stateAbbr"));
});
}
if (payload && payload.callback && typeof payload.callback === "function") {
payload.callback(response.error, response.success);
}
return response;
}).catch(() => {});
}
static doLogout(payload) {
return (0, _logout.default)().then(response => {
if (payload && payload.callback && typeof payload.callback === "function") {
payload.callback(response.error, response.success);
}
if (response && response.success && typeof window !== "undefined") {
(0, _cookies.cookieService)("wp", false);
(0, _lodash.attempt)(() => {
sessionStorage.removeItem("userId");
localStorage.removeItem("isFirstTouch");
localStorage.removeItem("userAuthenticationState");
});
}
return response;
}).catch(() => {});
}
static requestProfile(userId) {
return (0, _profile.default)(userId).then(response => {
if (response.success) {
(0, _cookies.cookieService)("wp", true, (0, _lodash.get)(response, "success.data.user.profile"));
(0, _cookies.cookieService)("hasLoginOnce", true, "true", 31622400);
}
return response;
}).catch(() => {});
}
static validateSession() {
return (0, _idRequest.default)().then(response => {
if (response.success) {
(0, _lodash.attempt)(() => {
sessionStorage.setItem("userId", (0, _lodash.get)(response, "success.accountNumber"));
(0, _cookies.cookieService)("wp", true, (0, _lodash.get)(response, "success.wagerProfile"));
(0, _cookies.cookieService)("hasLoginOnce", true, "true", 31622400);
});
return this.requestProfile((0, _lodash.get)(response, "success.accountNumber"));
}
return response;
}).catch(() => {});
}
}
exports.default = LoginService;
module.exports = exports.default;
webpack://frontend-tpt/../../packages/tvg-lib-metrics-collector/src/metricsConfigurations.js
const counterDefaultTags = {
type: "counter",
value: "1"
};
module.exports = {
place_bets_error: {
...counterDefaultTags,
name: "place_bets_error"
},
open_video_error: {
...counterDefaultTags,
name: "open_video_error"
},
login_error: {
...counterDefaultTags,
name: "login_error"
},
bets_number: {
...counterDefaultTags,
name: "bets_number"
},
cancel_bets_number: {
...counterDefaultTags,
name: "cancel_bets_number"
},
bet_placement_time: {
name: "bet_placement_time",
type: "timer"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-utils/cookies.ts
// @ts-ignore
import cookie from "react-cookie";
const REGEX_PREFIX_TO_REMOVE = new RegExp("^(www|local)");
export const cookieService = (
cookieName: string,
actionType: boolean,
cookieValue?: string,
maxAge?: number
): void => {
if (typeof window !== "undefined") {
const domain = window.location.hostname;
const domainForCookie = REGEX_PREFIX_TO_REMOVE.test(domain)
? domain.substring(domain.indexOf("."))
: `.${domain}`;
if (cookie.load(cookieName, { domain: domainForCookie })) {
cookie.remove(cookieName, { domain: domainForCookie });
}
// add cookies with time
if (actionType) {
cookie.save(
cookieName,
cookieValue,
maxAge
? { domain: domainForCookie, maxAge }
: { domain: domainForCookie }
);
}
}
};
webpack://frontend-tpt/../../node_modules/camelize/index.js
module.exports = function(obj) {
if (typeof obj === 'string') return camelCase(obj);
return walk(obj);
};
function walk (obj) {
if (!obj || typeof obj !== 'object') return obj;
if (isDate(obj) || isRegex(obj)) return obj;
if (isArray(obj)) return map(obj, walk);
return reduce(objectKeys(obj), function (acc, key) {
var camel = camelCase(key);
acc[camel] = walk(obj[key]);
return acc;
}, {});
}
function camelCase(str) {
return str.replace(/[_.-](\w|$)/g, function (_,x) {
return x.toUpperCase();
});
}
var isArray = Array.isArray || function (obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
};
var isDate = function (obj) {
return Object.prototype.toString.call(obj) === '[object Date]';
};
var isRegex = function (obj) {
return Object.prototype.toString.call(obj) === '[object RegExp]';
};
var has = Object.prototype.hasOwnProperty;
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) {
if (has.call(obj, key)) keys.push(key);
}
return keys;
};
function map (xs, f) {
if (xs.map) return xs.map(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
res.push(f(xs[i], i));
}
return res;
}
function reduce (xs, f, acc) {
if (xs.reduce) return xs.reduce(f, acc);
for (var i = 0; i < xs.length; i++) {
acc = f(acc, xs[i], i);
}
return acc;
}
webpack://frontend-tpt/../../node_modules/cookie/index.js
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict';
/**
* Module exports.
* @public
*/
exports.parse = parse;
exports.serialize = serialize;
/**
* Module variables.
* @private
*/
var __toString = Object.prototype.toString
var __hasOwnProperty = Object.prototype.hasOwnProperty
/**
* RegExp to match cookie-name in RFC 6265 sec 4.1.1
* This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
* which has been replaced by the token definition in RFC 7230 appendix B.
*
* cookie-name = token
* token = 1*tchar
* tchar = "!" / "#" / "$" / "%" / "&" / "'" /
* "*" / "+" / "-" / "." / "^" / "_" /
* "`" / "|" / "~" / DIGIT / ALPHA
*/
var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
/**
* RegExp to match cookie-value in RFC 6265 sec 4.1.1
*
* cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
* cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
* ; US-ASCII characters excluding CTLs,
* ; whitespace DQUOTE, comma, semicolon,
* ; and backslash
*/
var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
/**
* RegExp to match domain-value in RFC 6265 sec 4.1.1
*
* domain-value = <subdomain>
* ; defined in [RFC1034], Section 3.5, as
* ; enhanced by [RFC1123], Section 2.1
* <subdomain> = <label> | <subdomain> "." <label>
* <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
* Labels must be 63 characters or less.
* 'let-dig' not 'letter' in the first char, per RFC1123
* <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
* <let-dig-hyp> = <let-dig> | "-"
* <let-dig> = <letter> | <digit>
* <letter> = any one of the 52 alphabetic characters A through Z in
* upper case and a through z in lower case
* <digit> = any one of the ten digits 0 through 9
*
* Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
*
* > (Note that a leading %x2E ("."), if present, is ignored even though that
* character is not permitted, but a trailing %x2E ("."), if present, will
* cause the user agent to ignore the attribute.)
*/
var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
/**
* RegExp to match path-value in RFC 6265 sec 4.1.1
*
* path-value = <any CHAR except CTLs or ";">
* CHAR = %x01-7F
* ; defined in RFC 5234 appendix B.1
*/
var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
/**
* Parse a cookie header.
*
* Parse the given cookie header string into an object
* The object has the various cookies as keys(names) => values
*
* @param {string} str
* @param {object} [opt]
* @return {object}
* @public
*/
function parse(str, opt) {
if (typeof str !== 'string') {
throw new TypeError('argument str must be a string');
}
var obj = {};
var len = str.length;
// RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.
if (len < 2) return obj;
var dec = (opt && opt.decode) || decode;
var index = 0;
var eqIdx = 0;
var endIdx = 0;
do {
eqIdx = str.indexOf('=', index);
if (eqIdx === -1) break; // No more cookie pairs.
endIdx = str.indexOf(';', index);
if (endIdx === -1) {
endIdx = len;
} else if (eqIdx > endIdx) {
// backtrack on prior semicolon
index = str.lastIndexOf(';', eqIdx - 1) + 1;
continue;
}
var keyStartIdx = startIndex(str, index, eqIdx);
var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
var key = str.slice(keyStartIdx, keyEndIdx);
// only assign once
if (!__hasOwnProperty.call(obj, key)) {
var valStartIdx = startIndex(str, eqIdx + 1, endIdx);
var valEndIdx = endIndex(str, endIdx, valStartIdx);
if (str.charCodeAt(valStartIdx) === 0x22 /* " */ && str.charCodeAt(valEndIdx - 1) === 0x22 /* " */) {
valStartIdx++;
valEndIdx--;
}
var val = str.slice(valStartIdx, valEndIdx);
obj[key] = tryDecode(val, dec);
}
index = endIdx + 1
} while (index < len);
return obj;
}
function startIndex(str, index, max) {
do {
var code = str.charCodeAt(index);
if (code !== 0x20 /* */ && code !== 0x09 /* \t */) return index;
} while (++index < max);
return max;
}
function endIndex(str, index, min) {
while (index > min) {
var code = str.charCodeAt(--index);
if (code !== 0x20 /* */ && code !== 0x09 /* \t */) return index + 1;
}
return min;
}
/**
* Serialize data into a cookie header.
*
* Serialize a name value pair into a cookie string suitable for
* http headers. An optional options object specifies cookie parameters.
*
* serialize('foo', 'bar', { httpOnly: true })
* => "foo=bar; httpOnly"
*
* @param {string} name
* @param {string} val
* @param {object} [opt]
* @return {string}
* @public
*/
function serialize(name, val, opt) {
var enc = (opt && opt.encode) || encodeURIComponent;
if (typeof enc !== 'function') {
throw new TypeError('option encode is invalid');
}
if (!cookieNameRegExp.test(name)) {
throw new TypeError('argument name is invalid');
}
var value = enc(val);
if (!cookieValueRegExp.test(value)) {
throw new TypeError('argument val is invalid');
}
var str = name + '=' + value;
if (!opt) return str;
if (null != opt.maxAge) {
var maxAge = Math.floor(opt.maxAge);
if (!isFinite(maxAge)) {
throw new TypeError('option maxAge is invalid')
}
str += '; Max-Age=' + maxAge;
}
if (opt.domain) {
if (!domainValueRegExp.test(opt.domain)) {
throw new TypeError('option domain is invalid');
}
str += '; Domain=' + opt.domain;
}
if (opt.path) {
if (!pathValueRegExp.test(opt.path)) {
throw new TypeError('option path is invalid');
}
str += '; Path=' + opt.path;
}
if (opt.expires) {
var expires = opt.expires
if (!isDate(expires) || isNaN(expires.valueOf())) {
throw new TypeError('option expires is invalid');
}
str += '; Expires=' + expires.toUTCString()
}
if (opt.httpOnly) {
str += '; HttpOnly';
}
if (opt.secure) {
str += '; Secure';
}
if (opt.partitioned) {
str += '; Partitioned'
}
if (opt.priority) {
var priority = typeof opt.priority === 'string'
? opt.priority.toLowerCase() : opt.priority;
switch (priority) {
case 'low':
str += '; Priority=Low'
break
case 'medium':
str += '; Priority=Medium'
break
case 'high':
str += '; Priority=High'
break
default:
throw new TypeError('option priority is invalid')
}
}
if (opt.sameSite) {
var sameSite = typeof opt.sameSite === 'string'
? opt.sameSite.toLowerCase() : opt.sameSite;
switch (sameSite) {
case true:
str += '; SameSite=Strict';
break;
case 'lax':
str += '; SameSite=Lax';
break;
case 'strict':
str += '; SameSite=Strict';
break;
case 'none':
str += '; SameSite=None';
break;
default:
throw new TypeError('option sameSite is invalid');
}
}
return str;
}
/**
* URL-decode string value. Optimized to skip native call when no %.
*
* @param {string} str
* @returns {string}
*/
function decode (str) {
return str.indexOf('%') !== -1
? decodeURIComponent(str)
: str
}
/**
* Determine if value is a Date.
*
* @param {*} val
* @private
*/
function isDate (val) {
return __toString.call(val) === '[object Date]';
}
/**
* Try decoding a string using a decoding function.
*
* @param {string} str
* @param {function} decode
* @private
*/
function tryDecode(str, decode) {
try {
return decode(str);
} catch (e) {
return str;
}
}
webpack://frontend-tpt/../../node_modules/cookies-next/lib/index.js
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasCookie = exports.deleteCookie = exports.setCookie = exports.getCookie = exports.getCookies = void 0;
var cookie_1 = require("cookie");
var isClientSide = function () { return typeof window !== 'undefined'; };
var isCookiesFromAppRouterMiddleware = function (cookieStore) {
if (!cookieStore)
return false;
return ('getAll' &&
'set' in cookieStore &&
typeof cookieStore.getAll === 'function' &&
typeof cookieStore.set === 'function');
};
var isContextFromAppRouterMiddleware = function (context) {
return ((!!(context === null || context === void 0 ? void 0 : context.req) && 'cookies' in context.req && isCookiesFromAppRouterMiddleware(context === null || context === void 0 ? void 0 : context.req.cookies)) ||
(!!(context === null || context === void 0 ? void 0 : context.res) && 'cookies' in context.res && isCookiesFromAppRouterMiddleware(context === null || context === void 0 ? void 0 : context.res.cookies)));
};
var transformAppRouterMiddlewareCookies = function (cookies) {
var _cookies = {};
cookies.getAll().forEach(function (_a) {
var name = _a.name, value = _a.value;
_cookies[name] = value;
});
return _cookies;
};
var stringify = function (value) {
if (value === void 0) { value = ''; }
try {
var result = JSON.stringify(value);
return /^[\{\[]/.test(result) ? result : value;
}
catch (e) {
return value;
}
};
var decode = function (str) {
if (!str)
return str;
return str.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
};
var getCookies = function (options) {
if (isContextFromAppRouterMiddleware(options) && (options === null || options === void 0 ? void 0 : options.req))
return transformAppRouterMiddlewareCookies(options.req.cookies);
var req;
// DefaultOptions['req] can be casted here because is narrowed by using the fn: isContextFromAppRouterMiddleware
if (options)
req = options.req;
if (!isClientSide()) {
// if cookie-parser is used in project get cookies from ctx.req.cookies
// if cookie-parser isn't used in project get cookies from ctx.req.headers.cookie
if (req && req.cookies)
return req.cookies;
if (req && req.headers.cookie)
return (0, cookie_1.parse)(req.headers.cookie);
return {};
}
var _cookies = {};
var documentCookies = document.cookie ? document.cookie.split('; ') : [];
for (var i = 0, len = documentCookies.length; i < len; i++) {
var cookieParts = documentCookies[i].split('=');
var _cookie = cookieParts.slice(1).join('=');
var name_1 = cookieParts[0];
_cookies[name_1] = _cookie;
}
return _cookies;
};
exports.getCookies = getCookies;
var getCookie = function (key, options) {
var _cookies = (0, exports.getCookies)(options);
var value = _cookies[key];
if (value === undefined)
return undefined;
return decode(value);
};
exports.getCookie = getCookie;
var setCookie = function (key, data, options) {
if (isContextFromAppRouterMiddleware(options)) {
var req = options.req, res = options.res, restOptions = __rest(options, ["req", "res"]);
var payload = __assign({ name: key, value: data }, restOptions);
if (req) {
req.cookies.set(payload);
}
if (res) {
res.cookies.set(payload);
}
return;
}
var _cookieOptions;
var _req;
var _res;
if (options) {
// DefaultOptions can be casted here because the AppRouterMiddlewareOptions is narrowed using the fn: isContextFromAppRouterMiddleware
var _a = options, req = _a.req, res = _a.res, _options = __rest(_a, ["req", "res"]);
_req = req;
_res = res;
_cookieOptions = _options;
}
var cookieStr = (0, cookie_1.serialize)(key, stringify(data), __assign({ path: '/' }, _cookieOptions));
if (!isClientSide()) {
if (_res && _req) {
var currentCookies = _res.getHeader('Set-Cookie');
if (!Array.isArray(currentCookies)) {
currentCookies = !currentCookies ? [] : [String(currentCookies)];
}
_res.setHeader('Set-Cookie', currentCookies.concat(cookieStr));
if (_req && _req.cookies) {
var _cookies = _req.cookies;
data === '' ? delete _cookies[key] : (_cookies[key] = stringify(data));
}
if (_req && _req.headers && _req.headers.cookie) {
var _cookies = (0, cookie_1.parse)(_req.headers.cookie);
data === '' ? delete _cookies[key] : (_cookies[key] = stringify(data));
_req.headers.cookie = Object.entries(_cookies).reduce(function (accum, item) {
return accum.concat("".concat(item[0], "=").concat(item[1], ";"));
}, '');
}
}
}
else {
document.cookie = cookieStr;
}
};
exports.setCookie = setCookie;
var deleteCookie = function (key, options) {
return (0, exports.setCookie)(key, '', __assign(__assign({}, options), { maxAge: -1 }));
};
exports.deleteCookie = deleteCookie;
var hasCookie = function (key, options) {
if (!key)
return false;
var cookie = (0, exports.getCookies)(options);
return cookie.hasOwnProperty(key);
};
exports.hasCookie = hasCookie;
webpack://frontend-tpt/../../node_modules/css-color-keywords/index.js
'use strict'
module.exports = require('./colors.json')
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/assignStyle.js
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function filterUniqueArray(arr) {
return arr.filter(function (val, index) {
return arr.lastIndexOf(val) === index;
});
}
export default function assignStyle(base) {
for (var i = 0, len = arguments.length <= 1 ? 0 : arguments.length - 1; i < len; ++i) {
var style = i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1];
for (var property in style) {
var value = style[property];
var baseValue = base[property];
if (baseValue && value) {
if (Array.isArray(baseValue)) {
base[property] = filterUniqueArray(baseValue.concat(value));
continue;
}
if (Array.isArray(value)) {
base[property] = filterUniqueArray([baseValue].concat(_toConsumableArray(value)));
continue;
}
if (_typeof(value) === 'object') {
base[property] = assignStyle({}, baseValue, value);
continue;
}
}
base[property] = value;
}
}
return base;
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/camelCaseProperty.js
var DASH = /-([a-z])/g;
var MS = /^Ms/g;
var cache = {};
function toUpper(match) {
return match[1].toUpperCase();
}
export default function camelCaseProperty(property) {
if (cache.hasOwnProperty(property)) {
return cache[property];
}
var camelProp = property.replace(DASH, toUpper).replace(MS, 'ms');
cache[property] = camelProp;
return camelProp;
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/hyphenateProperty.js
import hyphenateStyleName from 'hyphenate-style-name';
export default function hyphenateProperty(property) {
return hyphenateStyleName(property);
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/cssifyDeclaration.js
import hyphenateProperty from './hyphenateProperty';
export default function cssifyDeclaration(property, value) {
return hyphenateProperty(property) + ':' + value;
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/cssifyObject.js
import cssifyDeclaration from './cssifyDeclaration';
export default function cssifyObject(style) {
var css = '';
for (var property in style) {
var value = style[property];
if (typeof value !== 'string' && typeof value !== 'number') {
continue;
} // prevents the semicolon after
// the last rule declaration
if (css) {
css += ';';
}
css += cssifyDeclaration(property, value);
}
return css;
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/isPrefixedProperty.js
var RE = /^(Webkit|Moz|O|ms)/;
export default function isPrefixedProperty(property) {
return RE.test(property);
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/isPrefixedValue.js
var RE = /-webkit-|-moz-|-ms-/;
export default function isPrefixedValue(value) {
return typeof value === 'string' && RE.test(value);
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/isUnitlessProperty.js
import hyphenateProperty from './hyphenateProperty';
var unitlessProperties = {
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
fontWeight: true,
lineHeight: true,
opacity: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related properties
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true
};
var prefixedUnitlessProperties = ['animationIterationCount', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'gridColumn', 'gridColumnEnd', 'gridColumnStart', 'gridRow', 'gridRowEnd', 'gridRowStart', 'lineClamp', 'order'];
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
function getPrefixedProperty(prefix, property) {
return prefix + property.charAt(0).toUpperCase() + property.slice(1);
} // add all prefixed properties to the unitless properties
for (var i = 0, len = prefixedUnitlessProperties.length; i < len; ++i) {
var property = prefixedUnitlessProperties[i];
unitlessProperties[property] = true;
for (var j = 0, jLen = prefixes.length; j < jLen; ++j) {
unitlessProperties[getPrefixedProperty(prefixes[j], property)] = true;
}
} // add all hypenated properties as well
for (var _property in unitlessProperties) {
unitlessProperties[hyphenateProperty(_property)] = true;
}
export default function isUnitlessProperty(property) {
return unitlessProperties.hasOwnProperty(property);
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/unprefixProperty.js
var RE = /^(ms|Webkit|Moz|O)/;
export default function unprefixProperty(property) {
var propertyWithoutPrefix = property.replace(RE, '');
return propertyWithoutPrefix.charAt(0).toLowerCase() + propertyWithoutPrefix.slice(1);
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/normalizeProperty.js
import camelCaseProperty from './camelCaseProperty';
import unprefixProperty from './unprefixProperty';
export default function normalizeProperty(property) {
return unprefixProperty(camelCaseProperty(property));
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/resolveArrayValue.js
import hyphenateProperty from './hyphenateProperty';
export default function resolveArrayValue(property, value) {
return value.join(';' + hyphenateProperty(property) + ':');
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/es/unprefixValue.js
var RE = /(-ms-|-webkit-|-moz-|-o-)/g;
export default function unprefixValue(value) {
if (typeof value === 'string') {
return value.replace(RE, '');
}
return value;
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/lib/hyphenateProperty.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = hyphenateProperty;
var _hyphenateStyleName = require("hyphenate-style-name");
var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function hyphenateProperty(property) {
return (0, _hyphenateStyleName2["default"])(property);
}
webpack://frontend-tpt/../../node_modules/css-in-js-utils/lib/isPrefixedValue.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = isPrefixedValue;
var RE = /-webkit-|-moz-|-ms-/;
function isPrefixedValue(value) {
return typeof value === 'string' && RE.test(value);
}
webpack://frontend-tpt/../../node_modules/css-to-react-native/index.js
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopDefault(ex) {
return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex;
}
var parse = require('postcss-value-parser');
var parse__default = _interopDefault(parse);
var camelizeStyleName = _interopDefault(require('camelize'));
var cssColorKeywords = _interopDefault(require('css-color-keywords'));
var matchString = function matchString(node) {
if (node.type !== 'string') return null;
return node.value.replace(/\\([0-9a-f]{1,6})(?:\s|$)/gi, function (match, charCode) {
return String.fromCharCode(parseInt(charCode, 16));
}).replace(/\\/g, '');
};
var hexColorRe = /^(#(?:[0-9a-f]{3,4}){1,2})$/i;
var cssFunctionNameRe = /^(rgba?|hsla?|hwb|lab|lch|gray|color)$/;
var matchColor = function matchColor(node) {
if (node.type === 'word' && (hexColorRe.test(node.value) || node.value in cssColorKeywords || node.value === 'transparent')) {
return node.value;
} else if (node.type === 'function' && cssFunctionNameRe.test(node.value)) {
return parse.stringify(node);
}
return null;
};
var noneRe = /^(none)$/i;
var autoRe = /^(auto)$/i;
var identRe = /(^-?[_a-z][_a-z0-9-]*$)/i; // Note if these are wrong, you'll need to change index.js too
var numberRe = /^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?)$/i; // Note lengthRe is sneaky: you can omit units for 0
var lengthRe = /^(0$|(?:[+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?)(?=px$))/i;
var unsupportedUnitRe = /^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?(ch|em|ex|rem|vh|vw|vmin|vmax|cm|mm|in|pc|pt))$/i;
var angleRe = /^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?(?:deg|rad))$/i;
var percentRe = /^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?%)$/i;
var noopToken = function noopToken(predicate) {
return function (node) {
return predicate(node) ? '<token>' : null;
};
};
var valueForTypeToken = function valueForTypeToken(type) {
return function (node) {
return node.type === type ? node.value : null;
};
};
var regExpToken = function regExpToken(regExp, transform) {
if (transform === void 0) {
transform = String;
}
return function (node) {
if (node.type !== 'word') return null;
var match = node.value.match(regExp);
if (match === null) return null;
var value = transform(match[1]);
return value;
};
};
var SPACE = noopToken(function (node) {
return node.type === 'space';
});
var SLASH = noopToken(function (node) {
return node.type === 'div' && node.value === '/';
});
var COMMA = noopToken(function (node) {
return node.type === 'div' && node.value === ',';
});
var WORD = valueForTypeToken('word');
var NONE = regExpToken(noneRe);
var AUTO = regExpToken(autoRe);
var NUMBER = regExpToken(numberRe, Number);
var LENGTH = regExpToken(lengthRe, Number);
var UNSUPPORTED_LENGTH_UNIT = regExpToken(unsupportedUnitRe);
var ANGLE = regExpToken(angleRe, function (angle) {
return angle.toLowerCase();
});
var PERCENT = regExpToken(percentRe);
var IDENT = regExpToken(identRe);
var STRING = matchString;
var COLOR = matchColor;
var LINE = regExpToken(/^(none|underline|line-through)$/i);
var aspectRatio = function aspectRatio(tokenStream) {
var aspectRatio = tokenStream.expect(NUMBER);
if (tokenStream.hasTokens()) {
tokenStream.expect(SLASH);
aspectRatio /= tokenStream.expect(NUMBER);
}
return {
aspectRatio: aspectRatio
};
};
var BORDER_STYLE = regExpToken(/^(solid|dashed|dotted)$/);
var defaultBorderWidth = 1;
var defaultBorderColor = 'black';
var defaultBorderStyle = 'solid';
var border = function border(tokenStream) {
var borderWidth;
var borderColor;
var borderStyle;
if (tokenStream.matches(NONE)) {
tokenStream.expectEmpty();
return {
borderWidth: 0,
borderColor: 'black',
borderStyle: 'solid'
};
}
var partsParsed = 0;
while (partsParsed < 3 && tokenStream.hasTokens()) {
if (partsParsed !== 0) tokenStream.expect(SPACE);
if (borderWidth === undefined && tokenStream.matches(LENGTH, UNSUPPORTED_LENGTH_UNIT)) {
borderWidth = tokenStream.lastValue;
} else if (borderColor === undefined && tokenStream.matches(COLOR)) {
borderColor = tokenStream.lastValue;
} else if (borderStyle === undefined && tokenStream.matches(BORDER_STYLE)) {
borderStyle = tokenStream.lastValue;
} else {
tokenStream["throw"]();
}
partsParsed += 1;
}
tokenStream.expectEmpty();
if (borderWidth === undefined) borderWidth = defaultBorderWidth;
if (borderColor === undefined) borderColor = defaultBorderColor;
if (borderStyle === undefined) borderStyle = defaultBorderStyle;
return {
borderWidth: borderWidth,
borderColor: borderColor,
borderStyle: borderStyle
};
};
var directionFactory = function directionFactory(_ref) {
var _ref$types = _ref.types,
types = _ref$types === void 0 ? [LENGTH, UNSUPPORTED_LENGTH_UNIT, PERCENT] : _ref$types,
_ref$directions = _ref.directions,
directions = _ref$directions === void 0 ? ['Top', 'Right', 'Bottom', 'Left'] : _ref$directions,
_ref$prefix = _ref.prefix,
prefix = _ref$prefix === void 0 ? '' : _ref$prefix,
_ref$suffix = _ref.suffix,
suffix = _ref$suffix === void 0 ? '' : _ref$suffix;
return function (tokenStream) {
var _ref2;
var values = []; // borderWidth doesn't currently allow a percent value, but may do in the future
values.push(tokenStream.expect.apply(tokenStream, types));
while (values.length < 4 && tokenStream.hasTokens()) {
tokenStream.expect(SPACE);
values.push(tokenStream.expect.apply(tokenStream, types));
}
tokenStream.expectEmpty();
var top = values[0],
_values$ = values[1],
right = _values$ === void 0 ? top : _values$,
_values$2 = values[2],
bottom = _values$2 === void 0 ? top : _values$2,
_values$3 = values[3],
left = _values$3 === void 0 ? right : _values$3;
var keyFor = function keyFor(n) {
return "" + prefix + directions[n] + suffix;
};
return _ref2 = {}, _ref2[keyFor(0)] = top, _ref2[keyFor(1)] = right, _ref2[keyFor(2)] = bottom, _ref2[keyFor(3)] = left, _ref2;
};
};
var parseShadowOffset = function parseShadowOffset(tokenStream) {
var width = tokenStream.expect(LENGTH);
var height = tokenStream.matches(SPACE) ? tokenStream.expect(LENGTH) : width;
tokenStream.expectEmpty();
return {
width: width,
height: height
};
};
var parseShadow = function parseShadow(tokenStream) {
var offsetX;
var offsetY;
var radius;
var color;
if (tokenStream.matches(NONE)) {
tokenStream.expectEmpty();
return {
offset: {
width: 0,
height: 0
},
radius: 0,
color: 'black'
};
}
var didParseFirst = false;
while (tokenStream.hasTokens()) {
if (didParseFirst) tokenStream.expect(SPACE);
if (offsetX === undefined && tokenStream.matches(LENGTH, UNSUPPORTED_LENGTH_UNIT)) {
offsetX = tokenStream.lastValue;
tokenStream.expect(SPACE);
offsetY = tokenStream.expect(LENGTH, UNSUPPORTED_LENGTH_UNIT);
tokenStream.saveRewindPoint();
if (tokenStream.matches(SPACE) && tokenStream.matches(LENGTH, UNSUPPORTED_LENGTH_UNIT)) {
radius = tokenStream.lastValue;
} else {
tokenStream.rewind();
}
} else if (color === undefined && tokenStream.matches(COLOR)) {
color = tokenStream.lastValue;
} else {
tokenStream["throw"]();
}
didParseFirst = true;
}
if (offsetX === undefined) tokenStream["throw"]();
return {
offset: {
width: offsetX,
height: offsetY
},
radius: radius !== undefined ? radius : 0,
color: color !== undefined ? color : 'black'
};
};
var boxShadow = function boxShadow(tokenStream) {
var _parseShadow = parseShadow(tokenStream),
offset = _parseShadow.offset,
radius = _parseShadow.radius,
color = _parseShadow.color;
return {
shadowOffset: offset,
shadowRadius: radius,
shadowColor: color,
shadowOpacity: 1
};
};
var defaultFlexGrow = 1;
var defaultFlexShrink = 1;
var defaultFlexBasis = 0;
var flex = function flex(tokenStream) {
var flexGrow;
var flexShrink;
var flexBasis;
if (tokenStream.matches(NONE)) {
tokenStream.expectEmpty();
return {
flexGrow: 0,
flexShrink: 0,
flexBasis: 'auto'
};
}
tokenStream.saveRewindPoint();
if (tokenStream.matches(AUTO) && !tokenStream.hasTokens()) {
return {
flexGrow: 1,
flexShrink: 1,
flexBasis: 'auto'
};
}
tokenStream.rewind();
var partsParsed = 0;
while (partsParsed < 2 && tokenStream.hasTokens()) {
if (partsParsed !== 0) tokenStream.expect(SPACE);
if (flexGrow === undefined && tokenStream.matches(NUMBER)) {
flexGrow = tokenStream.lastValue;
tokenStream.saveRewindPoint();
if (tokenStream.matches(SPACE) && tokenStream.matches(NUMBER)) {
flexShrink = tokenStream.lastValue;
} else {
tokenStream.rewind();
}
} else if (flexBasis === undefined && tokenStream.matches(LENGTH, UNSUPPORTED_LENGTH_UNIT, PERCENT)) {
flexBasis = tokenStream.lastValue;
} else if (flexBasis === undefined && tokenStream.matches(AUTO)) {
flexBasis = 'auto';
} else {
tokenStream["throw"]();
}
partsParsed += 1;
}
tokenStream.expectEmpty();
if (flexGrow === undefined) flexGrow = defaultFlexGrow;
if (flexShrink === undefined) flexShrink = defaultFlexShrink;
if (flexBasis === undefined) flexBasis = defaultFlexBasis;
return {
flexGrow: flexGrow,
flexShrink: flexShrink,
flexBasis: flexBasis
};
};
var FLEX_WRAP = regExpToken(/(nowrap|wrap|wrap-reverse)/);
var FLEX_DIRECTION = regExpToken(/(row|row-reverse|column|column-reverse)/);
var defaultFlexWrap = 'nowrap';
var defaultFlexDirection = 'row';
var flexFlow = function flexFlow(tokenStream) {
var flexWrap;
var flexDirection;
var partsParsed = 0;
while (partsParsed < 2 && tokenStream.hasTokens()) {
if (partsParsed !== 0) tokenStream.expect(SPACE);
if (flexWrap === undefined && tokenStream.matches(FLEX_WRAP)) {
flexWrap = tokenStream.lastValue;
} else if (flexDirection === undefined && tokenStream.matches(FLEX_DIRECTION)) {
flexDirection = tokenStream.lastValue;
} else {
tokenStream["throw"]();
}
partsParsed += 1;
}
tokenStream.expectEmpty();
if (flexWrap === undefined) flexWrap = defaultFlexWrap;
if (flexDirection === undefined) flexDirection = defaultFlexDirection;
return {
flexWrap: flexWrap,
flexDirection: flexDirection
};
};
var fontFamily = function fontFamily(tokenStream) {
var fontFamily;
if (tokenStream.matches(STRING)) {
fontFamily = tokenStream.lastValue;
} else {
fontFamily = tokenStream.expect(IDENT);
while (tokenStream.hasTokens()) {
tokenStream.expect(SPACE);
var nextIdent = tokenStream.expect(IDENT);
fontFamily += " " + nextIdent;
}
}
tokenStream.expectEmpty();
return {
fontFamily: fontFamily
};
};
var NORMAL = regExpToken(/^(normal)$/);
var STYLE = regExpToken(/^(italic)$/);
var WEIGHT = regExpToken(/^([1-9]00|bold)$/);
var VARIANT = regExpToken(/^(small-caps)$/);
var defaultFontStyle = 'normal';
var defaultFontWeight = 'normal';
var defaultFontVariant = [];
var font = function font(tokenStream) {
var fontStyle;
var fontWeight;
var fontVariant; // let fontSize;
var lineHeight; // let fontFamily;
var numStyleWeightVariantMatched = 0;
while (numStyleWeightVariantMatched < 3 && tokenStream.hasTokens()) {
if (tokenStream.matches(NORMAL)) ;else if (fontStyle === undefined && tokenStream.matches(STYLE)) {
fontStyle = tokenStream.lastValue;
} else if (fontWeight === undefined && tokenStream.matches(WEIGHT)) {
fontWeight = tokenStream.lastValue;
} else if (fontVariant === undefined && tokenStream.matches(VARIANT)) {
fontVariant = [tokenStream.lastValue];
} else {
break;
}
tokenStream.expect(SPACE);
numStyleWeightVariantMatched += 1;
}
var fontSize = tokenStream.expect(LENGTH, UNSUPPORTED_LENGTH_UNIT);
if (tokenStream.matches(SLASH)) {
lineHeight = tokenStream.expect(LENGTH, UNSUPPORTED_LENGTH_UNIT);
}
tokenStream.expect(SPACE);
var _fontFamily = fontFamily(tokenStream),
fontFamily$1 = _fontFamily.fontFamily;
if (fontStyle === undefined) fontStyle = defaultFontStyle;
if (fontWeight === undefined) fontWeight = defaultFontWeight;
if (fontVariant === undefined) fontVariant = defaultFontVariant;
var out = {
fontStyle: fontStyle,
fontWeight: fontWeight,
fontVariant: fontVariant,
fontSize: fontSize,
fontFamily: fontFamily$1
};
if (lineHeight !== undefined) out.lineHeight = lineHeight;
return out;
};
var fontVariant = function fontVariant(tokenStream) {
var values = [tokenStream.expect(IDENT)];
while (tokenStream.hasTokens()) {
tokenStream.expect(SPACE);
values.push(tokenStream.expect(IDENT));
}
return {
fontVariant: values
};
};
var ALIGN_CONTENT = regExpToken(/(flex-(?:start|end)|center|stretch|space-(?:between|around))/);
var JUSTIFY_CONTENT = regExpToken(/(flex-(?:start|end)|center|space-(?:between|around|evenly))/);
var placeContent = function placeContent(tokenStream) {
var alignContent = tokenStream.expect(ALIGN_CONTENT);
var justifyContent;
if (tokenStream.hasTokens()) {
tokenStream.expect(SPACE);
justifyContent = tokenStream.expect(JUSTIFY_CONTENT);
} else {
justifyContent = 'stretch';
}
tokenStream.expectEmpty();
return {
alignContent: alignContent,
justifyContent: justifyContent
};
};
var STYLE$1 = regExpToken(/^(solid|double|dotted|dashed)$/);
var defaultTextDecorationLine = 'none';
var defaultTextDecorationStyle = 'solid';
var defaultTextDecorationColor = 'black';
var textDecoration = function textDecoration(tokenStream) {
var line;
var style;
var color;
var didParseFirst = false;
while (tokenStream.hasTokens()) {
if (didParseFirst) tokenStream.expect(SPACE);
if (line === undefined && tokenStream.matches(LINE)) {
var lines = [tokenStream.lastValue.toLowerCase()];
tokenStream.saveRewindPoint();
if (lines[0] !== 'none' && tokenStream.matches(SPACE) && tokenStream.matches(LINE)) {
lines.push(tokenStream.lastValue.toLowerCase()); // Underline comes before line-through
lines.sort().reverse();
} else {
tokenStream.rewind();
}
line = lines.join(' ');
} else if (style === undefined && tokenStream.matches(STYLE$1)) {
style = tokenStream.lastValue;
} else if (color === undefined && tokenStream.matches(COLOR)) {
color = tokenStream.lastValue;
} else {
tokenStream["throw"]();
}
didParseFirst = true;
}
return {
textDecorationLine: line !== undefined ? line : defaultTextDecorationLine,
textDecorationColor: color !== undefined ? color : defaultTextDecorationColor,
textDecorationStyle: style !== undefined ? style : defaultTextDecorationStyle
};
};
var textDecorationLine = function textDecorationLine(tokenStream) {
var lines = [];
var didParseFirst = false;
while (tokenStream.hasTokens()) {
if (didParseFirst) tokenStream.expect(SPACE);
lines.push(tokenStream.expect(LINE).toLowerCase());
didParseFirst = true;
}
lines.sort().reverse();
return {
textDecorationLine: lines.join(' ')
};
};
var textShadow = function textShadow(tokenStream) {
var _parseShadow2 = parseShadow(tokenStream),
offset = _parseShadow2.offset,
radius = _parseShadow2.radius,
color = _parseShadow2.color;
return {
textShadowOffset: offset,
textShadowRadius: radius,
textShadowColor: color
};
};
var oneOfType = function oneOfType(tokenType) {
return function (functionStream) {
var value = functionStream.expect(tokenType);
functionStream.expectEmpty();
return value;
};
};
var singleNumber = oneOfType(NUMBER);
var singleLength = oneOfType(LENGTH);
var singleAngle = oneOfType(ANGLE);
var xyTransformFactory = function xyTransformFactory(tokenType) {
return function (key, valueIfOmitted) {
return function (functionStream) {
var _ref3, _ref4;
var x = functionStream.expect(tokenType);
var y;
if (functionStream.hasTokens()) {
functionStream.expect(COMMA);
y = functionStream.expect(tokenType);
} else if (valueIfOmitted !== undefined) {
y = valueIfOmitted;
} else {
// Assumption, if x === y, then we can omit XY
// I.e. scale(5) => [{ scale: 5 }] rather than [{ scaleX: 5 }, { scaleY: 5 }]
return x;
}
functionStream.expectEmpty();
return [(_ref3 = {}, _ref3[key + "Y"] = y, _ref3), (_ref4 = {}, _ref4[key + "X"] = x, _ref4)];
};
};
};
var xyNumber = xyTransformFactory(NUMBER);
var xyLength = xyTransformFactory(LENGTH);
var xyAngle = xyTransformFactory(ANGLE);
var partTransforms = {
perspective: singleNumber,
scale: xyNumber('scale'),
scaleX: singleNumber,
scaleY: singleNumber,
translate: xyLength('translate', 0),
translateX: singleLength,
translateY: singleLength,
rotate: singleAngle,
rotateX: singleAngle,
rotateY: singleAngle,
rotateZ: singleAngle,
skewX: singleAngle,
skewY: singleAngle,
skew: xyAngle('skew', '0deg')
};
var transform = function transform(tokenStream) {
var transforms = [];
var didParseFirst = false;
while (tokenStream.hasTokens()) {
if (didParseFirst) tokenStream.expect(SPACE);
var functionStream = tokenStream.expectFunction();
var functionName = functionStream.functionName;
var transformedValues = partTransforms[functionName](functionStream);
if (!Array.isArray(transformedValues)) {
var _ref5;
transformedValues = [(_ref5 = {}, _ref5[functionName] = transformedValues, _ref5)];
}
transforms = transformedValues.concat(transforms);
didParseFirst = true;
}
return {
transform: transforms
};
};
var background = function background(tokenStream) {
return {
backgroundColor: tokenStream.expect(COLOR)
};
};
var borderColor = directionFactory({
types: [COLOR],
prefix: 'border',
suffix: 'Color'
});
var borderRadius = directionFactory({
directions: ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'],
prefix: 'border',
suffix: 'Radius'
});
var borderWidth = directionFactory({
prefix: 'border',
suffix: 'Width'
});
var margin = directionFactory({
types: [LENGTH, UNSUPPORTED_LENGTH_UNIT, PERCENT, AUTO],
prefix: 'margin'
});
var padding = directionFactory({
prefix: 'padding'
});
var fontWeight = function fontWeight(tokenStream) {
return {
fontWeight: tokenStream.expect(WORD) // Also match numbers as strings
};
};
var shadowOffset = function shadowOffset(tokenStream) {
return {
shadowOffset: parseShadowOffset(tokenStream)
};
};
var textShadowOffset = function textShadowOffset(tokenStream) {
return {
textShadowOffset: parseShadowOffset(tokenStream)
};
};
var transforms = {
aspectRatio: aspectRatio,
background: background,
border: border,
borderColor: borderColor,
borderRadius: borderRadius,
borderWidth: borderWidth,
boxShadow: boxShadow,
flex: flex,
flexFlow: flexFlow,
font: font,
fontFamily: fontFamily,
fontVariant: fontVariant,
fontWeight: fontWeight,
margin: margin,
padding: padding,
placeContent: placeContent,
shadowOffset: shadowOffset,
textShadow: textShadow,
textShadowOffset: textShadowOffset,
textDecoration: textDecoration,
textDecorationLine: textDecorationLine,
transform: transform
};
var propertiesWithoutUnits;
if (process.env.NODE_ENV !== 'production') {
propertiesWithoutUnits = ['aspectRatio', 'elevation', 'flexGrow', 'flexShrink', 'opacity', 'shadowOpacity', 'zIndex'];
}
var devPropertiesWithUnitsRegExp = propertiesWithoutUnits != null ? new RegExp(propertiesWithoutUnits.join('|')) : null;
var SYMBOL_MATCH = 'SYMBOL_MATCH';
var TokenStream =
/*#__PURE__*/
function () {
function TokenStream(nodes, parent) {
this.index = 0;
this.nodes = nodes;
this.functionName = parent != null ? parent.value : null;
this.lastValue = null;
this.rewindIndex = -1;
}
var _proto = TokenStream.prototype;
_proto.hasTokens = function hasTokens() {
return this.index <= this.nodes.length - 1;
};
_proto[SYMBOL_MATCH] = function () {
if (!this.hasTokens()) return null;
var node = this.nodes[this.index];
for (var i = 0; i < arguments.length; i += 1) {
var tokenDescriptor = i < 0 || arguments.length <= i ? undefined : arguments[i];
var value = tokenDescriptor(node);
if (value !== null) {
this.index += 1;
this.lastValue = value;
return value;
}
}
return null;
};
_proto.matches = function matches() {
return this[SYMBOL_MATCH].apply(this, arguments) !== null;
};
_proto.expect = function expect() {
var value = this[SYMBOL_MATCH].apply(this, arguments);
return value !== null ? value : this["throw"]();
};
_proto.matchesFunction = function matchesFunction() {
var node = this.nodes[this.index];
if (node.type !== 'function') return null;
var value = new TokenStream(node.nodes, node);
this.index += 1;
this.lastValue = null;
return value;
};
_proto.expectFunction = function expectFunction() {
var value = this.matchesFunction();
return value !== null ? value : this["throw"]();
};
_proto.expectEmpty = function expectEmpty() {
if (this.hasTokens()) this["throw"]();
};
_proto["throw"] = function _throw() {
throw new Error("Unexpected token type: " + this.nodes[this.index].type);
};
_proto.saveRewindPoint = function saveRewindPoint() {
this.rewindIndex = this.index;
};
_proto.rewind = function rewind() {
if (this.rewindIndex === -1) throw new Error('Internal error');
this.index = this.rewindIndex;
this.lastValue = null;
};
return TokenStream;
}();
/* eslint-disable no-param-reassign */
// Note if this is wrong, you'll need to change tokenTypes.js too
var numberOrLengthRe = /^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?)(?:px)?$/i;
var numberOnlyRe = /^[+-]?(?:\d*\.\d*|[1-9]\d*)(?:e[+-]?\d+)?$/i;
var boolRe = /^true|false$/i;
var nullRe = /^null$/i;
var undefinedRe = /^undefined$/i; // Undocumented export
var transformRawValue = function transformRawValue(propName, value) {
if (process.env.NODE_ENV !== 'production') {
var needsUnit = !devPropertiesWithUnitsRegExp.test(propName);
var isNumberWithoutUnit = numberOnlyRe.test(value);
if (needsUnit && isNumberWithoutUnit) {
// eslint-disable-next-line no-console
console.warn("Expected style \"" + propName + ": " + value + "\" to contain units");
}
if (!needsUnit && value !== '0' && !isNumberWithoutUnit) {
// eslint-disable-next-line no-console
console.warn("Expected style \"" + propName + ": " + value + "\" to be unitless");
}
}
var numberMatch = value.match(numberOrLengthRe);
if (numberMatch !== null) return Number(numberMatch[1]);
var boolMatch = value.match(boolRe);
if (boolMatch !== null) return boolMatch[0].toLowerCase() === 'true';
var nullMatch = value.match(nullRe);
if (nullMatch !== null) return null;
var undefinedMatch = value.match(undefinedRe);
if (undefinedMatch !== null) return undefined;
return value;
};
var baseTransformShorthandValue = function baseTransformShorthandValue(propName, value) {
var ast = parse__default(value);
var tokenStream = new TokenStream(ast.nodes);
return transforms[propName](tokenStream);
};
var transformShorthandValue = process.env.NODE_ENV === 'production' ? baseTransformShorthandValue : function (propName, value) {
try {
return baseTransformShorthandValue(propName, value);
} catch (e) {
throw new Error("Failed to parse declaration \"" + propName + ": " + value + "\"");
}
};
var getStylesForProperty = function getStylesForProperty(propName, inputValue, allowShorthand) {
var _ref6;
var isRawValue = allowShorthand === false || !(propName in transforms);
var value = inputValue.trim();
var propValues = isRawValue ? (_ref6 = {}, _ref6[propName] = transformRawValue(propName, value), _ref6) : transformShorthandValue(propName, value);
return propValues;
};
var getPropertyName = function getPropertyName(propName) {
var isCustomProp = /^--\w+/.test(propName);
if (isCustomProp) {
return propName;
}
return camelizeStyleName(propName);
};
var index = function index(rules, shorthandBlacklist) {
if (shorthandBlacklist === void 0) {
shorthandBlacklist = [];
}
return rules.reduce(function (accum, rule) {
var propertyName = getPropertyName(rule[0]);
var value = rule[1];
var allowShorthand = shorthandBlacklist.indexOf(propertyName) === -1;
return Object.assign(accum, getStylesForProperty(propertyName, value, allowShorthand));
}, {});
};
exports["default"] = index;
exports.getPropertyName = getPropertyName;
exports.getStylesForProperty = getStylesForProperty;
exports.transformRawValue = transformRawValue;
webpack://frontend-tpt/../../node_modules/currency-formatter/index.js
var accounting = require('accounting')
var assign = require('object-assign')
var localeCurrency = require('locale-currency')
var currencies = require('./currencies.json')
var localeFormats = require('./localeFormats.json')
var defaultCurrency = {
symbol: '',
thousandsSeparator: ',',
decimalSeparator: '.',
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: false,
decimalDigits: 2
}
var defaultLocaleFormat = {}
var formatMapping = [
{
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: false,
format: {
pos: '%s%v',
neg: '-%s%v',
zero: '%s%v'
}
},
{
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: true,
format: {
pos: '%s %v',
neg: '-%s %v',
zero: '%s %v'
}
},
{
symbolOnLeft: false,
spaceBetweenAmountAndSymbol: false,
format: {
pos: '%v%s',
neg: '-%v%s',
zero: '%v%s'
}
},
{
symbolOnLeft: false,
spaceBetweenAmountAndSymbol: true,
format: {
pos: '%v %s',
neg: '-%v %s',
zero: '%v %s'
}
}
]
function format(value, options) {
var code = options.code || (options.locale && localeCurrency.getCurrency(options.locale))
var localeMatch = /^([a-z]+)([_-]([a-z]+))?$/i.exec(options.locale) || []
var language = localeMatch[1]
var region = localeMatch[3]
var localeFormat = assign({}, defaultLocaleFormat,
localeFormats[language] || {},
localeFormats[language + '-' + region] || {})
var currency = assign({}, defaultCurrency, findCurrency(code), localeFormat)
var symbolOnLeft = currency.symbolOnLeft
var spaceBetweenAmountAndSymbol = currency.spaceBetweenAmountAndSymbol
var format = formatMapping.filter(function(f) {
return f.symbolOnLeft == symbolOnLeft && f.spaceBetweenAmountAndSymbol == spaceBetweenAmountAndSymbol
})[0].format
return accounting.formatMoney(value, {
symbol: isUndefined(options.symbol)
? currency.symbol
: options.symbol,
decimal: isUndefined(options.decimal)
? currency.decimalSeparator
: options.decimal,
thousand: isUndefined(options.thousand)
? currency.thousandsSeparator
: options.thousand,
precision: typeof options.precision === 'number'
? options.precision
: currency.decimalDigits,
format: ['string', 'object'].indexOf(typeof options.format) > -1
? options.format
: format
})
}
function findCurrency (currencyCode) {
return currencies[currencyCode]
}
function isUndefined (val) {
return typeof val === 'undefined'
}
function unformat(value, options) {
var code = options.code || (options.locale && localeCurrency.getCurrency(options.locale))
var localeFormat = localeFormats[options.locale] || defaultLocaleFormat
var currency = assign({}, defaultCurrency, findCurrency(code), localeFormat)
var decimal = isUndefined(options.decimal) ? currency.decimalSeparator : options.decimal
return accounting.unformat(value, decimal)
}
module.exports = {
defaultCurrency: defaultCurrency,
get currencies() {
// In favor of backwards compatibility, the currencies map is converted to an array here
return Object.keys(currencies).map(function(key) {
return currencies[key]
})
},
findCurrency: findCurrency,
format: format,
unformat: unformat
}
webpack://frontend-tpt/../../node_modules/decode-uri-component/index.js
'use strict';
var token = '%[a-f0-9]{2}';
var singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');
var multiMatcher = new RegExp('(' + token + ')+', 'gi');
function decodeComponents(components, split) {
try {
// Try to decode the entire string first
return [decodeURIComponent(components.join(''))];
} catch (err) {
// Do nothing
}
if (components.length === 1) {
return components;
}
split = split || 1;
// Split the array in 2 parts
var left = components.slice(0, split);
var right = components.slice(split);
return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
}
function decode(input) {
try {
return decodeURIComponent(input);
} catch (err) {
var tokens = input.match(singleMatcher) || [];
for (var i = 1; i < tokens.length; i++) {
input = decodeComponents(tokens, i).join('');
tokens = input.match(singleMatcher) || [];
}
return input;
}
}
function customDecodeURIComponent(input) {
// Keep track of all the replacements and prefill the map with the `BOM`
var replaceMap = {
'%FE%FF': '\uFFFD\uFFFD',
'%FF%FE': '\uFFFD\uFFFD'
};
var match = multiMatcher.exec(input);
while (match) {
try {
// Decode as big chunks as possible
replaceMap[match[0]] = decodeURIComponent(match[0]);
} catch (err) {
var result = decode(match[0]);
if (result !== match[0]) {
replaceMap[match[0]] = result;
}
}
match = multiMatcher.exec(input);
}
// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
replaceMap['%C2'] = '\uFFFD';
var entries = Object.keys(replaceMap);
for (var i = 0; i < entries.length; i++) {
// Replace all decoded components
var key = entries[i];
input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
}
return input;
}
module.exports = function (encodedURI) {
if (typeof encodedURI !== 'string') {
throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
}
try {
encodedURI = encodedURI.replace(/\+/g, ' ');
// Try the built in decoder first
return decodeURIComponent(encodedURI);
} catch (err) {
// Fallback to a more advanced decoder
return customDecodeURIComponent(encodedURI);
}
};
webpack://frontend-tpt/../../node_modules/fast-json-stable-stringify/index.js
'use strict';
module.exports = function (data, opts) {
if (!opts) opts = {};
if (typeof opts === 'function') opts = { cmp: opts };
var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
var cmp = opts.cmp && (function (f) {
return function (node) {
return function (a, b) {
var aobj = { key: a, value: node[a] };
var bobj = { key: b, value: node[b] };
return f(aobj, bobj);
};
};
})(opts.cmp);
var seen = [];
return (function stringify (node) {
if (node && node.toJSON && typeof node.toJSON === 'function') {
node = node.toJSON();
}
if (node === undefined) return;
if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
if (typeof node !== 'object') return JSON.stringify(node);
var i, out;
if (Array.isArray(node)) {
out = '[';
for (i = 0; i < node.length; i++) {
if (i) out += ',';
out += stringify(node[i]) || 'null';
}
return out + ']';
}
if (node === null) return 'null';
if (seen.indexOf(node) !== -1) {
if (cycles) return JSON.stringify('__cycle__');
throw new TypeError('Converting circular structure to JSON');
}
var seenIndex = seen.push(node) - 1;
var keys = Object.keys(node).sort(cmp && cmp(node));
out = '';
for (i = 0; i < keys.length; i++) {
var key = keys[i];
var value = stringify(node[key]);
if (!value) continue;
if (out) out += ',';
out += JSON.stringify(key) + ':' + value;
}
seen.splice(seenIndex, 1);
return '{' + out + '}';
})(data);
};
webpack://frontend-tpt/../../node_modules/fbjs/lib/emptyFunction.js
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = function emptyFunction() {};
emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function () {
return this;
};
emptyFunction.thatReturnsArgument = function (arg) {
return arg;
};
module.exports = emptyFunction;
webpack://frontend-tpt/../../node_modules/fbjs/lib/invariant.js
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
'use strict';
var validateFormat = process.env.NODE_ENV !== "production" ? function (format) {
if (format === undefined) {
throw new Error('invariant(...): Second argument must be a string.');
}
} : function (format) {};
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments to provide
* information about what broke and what you were expecting.
*
* The invariant message will be stripped in production, but the invariant will
* remain to ensure logic does not differ in production.
*/
function invariant(condition, format) {
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} else {
var argIndex = 0;
error = new Error(format.replace(/%s/g, function () {
return String(args[argIndex++]);
}));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // Skip invariant's own stack frame.
throw error;
}
}
module.exports = invariant;
webpack://frontend-tpt/../../node_modules/fbjs/lib/warning.js
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
var emptyFunction = require("./emptyFunction");
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
function printWarning(format) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
}
var warning = process.env.NODE_ENV !== "production" ? function (condition, format) {
if (format === undefined) {
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
}
if (!condition) {
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(void 0, [format].concat(args));
}
} : emptyFunction;
module.exports = warning;
webpack://frontend-tpt/../../node_modules/filter-obj/index.js
'use strict';
module.exports = function (obj, predicate) {
var ret = {};
var keys = Object.keys(obj);
var isArr = Array.isArray(predicate);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var val = obj[key];
if (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) {
ret[key] = val;
}
}
return ret;
};
webpack://frontend-tpt/../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
'use strict';
var reactIs = require('react-is');
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var FORWARD_REF_STATICS = {
'$$typeof': true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
var MEMO_STATICS = {
'$$typeof': true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
function getStatics(component) {
// React v16.11 and below
if (reactIs.isMemo(component)) {
return MEMO_STATICS;
} // React v16.12 and above
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
}
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') {
// don't hoist over string (html) components
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
// Avoid failures from read-only properties
defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
}
return targetComponent;
}
module.exports = hoistNonReactStatics;
webpack://frontend-tpt/../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
webpack://frontend-tpt/../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-is.production.min.js');
} else {
module.exports = require('./cjs/react-is.development.js');
}
webpack://frontend-tpt/../../node_modules/hyphenate-style-name/index.js
/* eslint-disable no-var, prefer-template */
var uppercasePattern = /[A-Z]/g
var msPattern = /^ms-/
var cache = {}
function toHyphenLower(match) {
return '-' + match.toLowerCase()
}
function hyphenateStyleName(name) {
if (cache.hasOwnProperty(name)) {
return cache[name]
}
var hName = name.replace(uppercasePattern, toHyphenLower)
return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
}
export default hyphenateStyleName
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/createPrefixer.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createPrefixer;
var _prefixProperty = require('./utils/prefixProperty');
var _prefixProperty2 = _interopRequireDefault(_prefixProperty);
var _prefixValue = require('./utils/prefixValue');
var _prefixValue2 = _interopRequireDefault(_prefixValue);
var _addNewValuesOnly = require('./utils/addNewValuesOnly');
var _addNewValuesOnly2 = _interopRequireDefault(_addNewValuesOnly);
var _isObject = require('./utils/isObject');
var _isObject2 = _interopRequireDefault(_isObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createPrefixer(_ref) {
var prefixMap = _ref.prefixMap,
plugins = _ref.plugins;
return function prefix(style) {
for (var property in style) {
var value = style[property];
// handle nested objects
if ((0, _isObject2.default)(value)) {
style[property] = prefix(value);
// handle array values
} else if (Array.isArray(value)) {
var combinedValue = [];
for (var i = 0, len = value.length; i < len; ++i) {
var processedValue = (0, _prefixValue2.default)(plugins, property, value[i], style, prefixMap);
(0, _addNewValuesOnly2.default)(combinedValue, processedValue || value[i]);
}
// only modify the value if it was touched
// by any plugin to prevent unnecessary mutations
if (combinedValue.length > 0) {
style[property] = combinedValue;
}
} else {
var _processedValue = (0, _prefixValue2.default)(plugins, property, value, style, prefixMap);
// only modify the value if it was touched
// by any plugin to prevent unnecessary mutations
if (_processedValue) {
style[property] = _processedValue;
}
style = (0, _prefixProperty2.default)(prefixMap, property, style);
}
}
return style;
};
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/plugins/backgroundClip.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = backgroundClip;
function backgroundClip() {
return null;
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/plugins/crossFade.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = crossFade;
var _cssInJsUtils = require('css-in-js-utils');
var CROSS_FADE_REGEX = /cross-fade\(/g;
// http://caniuse.com/#search=cross-fade
var prefixes = ['-webkit-', ''];
function crossFade(property, value) {
if (typeof value === 'string' && !(0, _cssInJsUtils.isPrefixedValue)(value) && value.indexOf('cross-fade(') !== -1) {
return prefixes.map(function (prefix) {
return value.replace(CROSS_FADE_REGEX, prefix + 'cross-fade(');
});
}
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/plugins/cursor.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cursor;
var prefixes = ['-webkit-', '-moz-', ''];
var values = {
'zoom-in': true,
'zoom-out': true,
grab: true,
grabbing: true
};
function cursor(property, value) {
if (property === 'cursor' && values.hasOwnProperty(value)) {
return prefixes.map(function (prefix) {
return prefix + value;
});
}
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/plugins/filter.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = filter;
var _cssInJsUtils = require('css-in-js-utils');
var FILTER_REGEX = /filter\(/g;
// http://caniuse.com/#feat=css-filter-function
var prefixes = ['-webkit-', ''];
function filter(property, value) {
if (typeof value === 'string' && !(0, _cssInJsUtils.isPrefixedValue)(value) && value.indexOf('filter(') !== -1) {
return prefixes.map(function (prefix) {
return value.replace(FILTER_REGEX, prefix + 'filter(');
});
}
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/plugins/imageSet.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = imageSet;
var _isPrefixedValue = require('css-in-js-utils/lib/isPrefixedValue');
var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// http://caniuse.com/#feat=css-image-set
var prefixes = ['-webkit-', ''];
function imageSet(property, value) {
if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.indexOf('image-set(') > -1) {
return prefixes.map(function (prefix) {
return value.replace(/image-set\(/g, prefix + 'image-set(');
});
}
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/plugins/logical.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = logical;
var alternativeProps = {
marginBlockStart: ['WebkitMarginBefore'],
marginBlockEnd: ['WebkitMarginAfter'],
marginInlineStart: ['WebkitMarginStart', 'MozMarginStart'],
marginInlineEnd: ['WebkitMarginEnd', 'MozMarginEnd'],
paddingBlockStart: ['WebkitPaddingBefore'],
paddingBlockEnd: ['WebkitPaddingAfter'],
paddingInlineStart: ['WebkitPaddingStart', 'MozPaddingStart'],
paddingInlineEnd: ['WebkitPaddingEnd', 'MozPaddingEnd'],
borderBlockStart: ['WebkitBorderBefore'],
borderBlockStartColor: ['WebkitBorderBeforeColor'],
borderBlockStartStyle: ['WebkitBorderBeforeStyle'],
borderBlockStartWidth: ['WebkitBorderBeforeWidth'],
borderBlockEnd: ['WebkitBorderAfter'],
borderBlockEndColor: ['WebkitBorderAfterColor'],
borderBlockEndStyle: ['WebkitBorderAfterStyle'],
borderBlockEndWidth: ['WebkitBorderAfterWidth'],
borderInlineStart: ['WebkitBorderStart', 'MozBorderStart'],
borderInlineStartColor: ['WebkitBorderStartColor', 'MozBorderStartColor'],
borderInlineStartStyle: ['WebkitBorderStartStyle', 'MozBorderStartStyle'],
borderInlineStartWidth: ['WebkitBorderStartWidth', 'MozBorderStartWidth'],
borderInlineEnd: ['WebkitBorderEnd', 'MozBorderEnd'],
borderInlineEndColor: ['WebkitBorderEndColor', 'MozBorderEndColor'],
borderInlineEndStyle: ['WebkitBorderEndStyle', 'MozBorderEndStyle'],
borderInlineEndWidth: ['WebkitBorderEndWidth', 'MozBorderEndWidth']
};
function logical(property, value, style) {
if (Object.prototype.hasOwnProperty.call(alternativeProps, property)) {
var alternativePropList = alternativeProps[property];
for (var i = 0, len = alternativePropList.length; i < len; ++i) {
style[alternativePropList[i]] = value;
}
}
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/plugins/position.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = position;
function position(property, value) {
if (property === 'position' && value === 'sticky') {
return ['-webkit-sticky', 'sticky'];
}
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/plugins/sizing.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = sizing;
var prefixes = ['-webkit-', '-moz-', ''];
var properties = {
maxHeight: true,
maxWidth: true,
width: true,
height: true,
columnWidth: true,
minWidth: true,
minHeight: true
};
var values = {
'min-content': true,
'max-content': true,
'fill-available': true,
'fit-content': true,
'contain-floats': true
};
function sizing(property, value) {
if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) {
return prefixes.map(function (prefix) {
return prefix + value;
});
}
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/plugins/transition.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = transition;
var _hyphenateProperty = require('css-in-js-utils/lib/hyphenateProperty');
var _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);
var _isPrefixedValue = require('css-in-js-utils/lib/isPrefixedValue');
var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);
var _capitalizeString = require('../utils/capitalizeString');
var _capitalizeString2 = _interopRequireDefault(_capitalizeString);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var properties = {
transition: true,
transitionProperty: true,
WebkitTransition: true,
WebkitTransitionProperty: true,
MozTransition: true,
MozTransitionProperty: true
};
var prefixMapping = {
Webkit: '-webkit-',
Moz: '-moz-',
ms: '-ms-'
};
function prefixValue(value, propertyPrefixMap) {
if ((0, _isPrefixedValue2.default)(value)) {
return value;
}
// only split multi values, not cubic beziers
var multipleValues = value.split(/,(?![^()]*(?:\([^()]*\))?\))/g);
for (var i = 0, len = multipleValues.length; i < len; ++i) {
var singleValue = multipleValues[i];
var values = [singleValue];
for (var property in propertyPrefixMap) {
var dashCaseProperty = (0, _hyphenateProperty2.default)(property);
if (singleValue.indexOf(dashCaseProperty) > -1 && dashCaseProperty !== 'order') {
var prefixes = propertyPrefixMap[property];
for (var j = 0, pLen = prefixes.length; j < pLen; ++j) {
// join all prefixes and create a new value
values.unshift(singleValue.replace(dashCaseProperty, prefixMapping[prefixes[j]] + dashCaseProperty));
}
}
}
multipleValues[i] = values.join(',');
}
return multipleValues.join(',');
}
function transition(property, value, style, propertyPrefixMap) {
// also check for already prefixed transitions
if (typeof value === 'string' && properties.hasOwnProperty(property)) {
var outputValue = prefixValue(value, propertyPrefixMap);
// if the property is already prefixed
var webkitOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) {
return !/-moz-|-ms-/.test(val);
}).join(',');
if (property.indexOf('Webkit') > -1) {
return webkitOutput;
}
var mozOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) {
return !/-webkit-|-ms-/.test(val);
}).join(',');
if (property.indexOf('Moz') > -1) {
return mozOutput;
}
style['Webkit' + (0, _capitalizeString2.default)(property)] = webkitOutput;
style['Moz' + (0, _capitalizeString2.default)(property)] = mozOutput;
return outputValue;
}
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/utils/addNewValuesOnly.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = addNewValuesOnly;
function addIfNew(list, value) {
if (list.indexOf(value) === -1) {
list.push(value);
}
}
function addNewValuesOnly(list, values) {
if (Array.isArray(values)) {
for (var i = 0, len = values.length; i < len; ++i) {
addIfNew(list, values[i]);
}
} else {
addIfNew(list, values);
}
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/utils/capitalizeString.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = capitalizeString;
function capitalizeString(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/utils/isObject.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isObject;
function isObject(value) {
return value instanceof Object && !Array.isArray(value);
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/utils/prefixProperty.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = prefixProperty;
var _capitalizeString = require('./capitalizeString');
var _capitalizeString2 = _interopRequireDefault(_capitalizeString);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function prefixProperty(prefixProperties, property, style) {
var requiredPrefixes = prefixProperties[property];
if (requiredPrefixes && style.hasOwnProperty(property)) {
var capitalizedProperty = (0, _capitalizeString2.default)(property);
for (var i = 0; i < requiredPrefixes.length; ++i) {
var prefixedProperty = requiredPrefixes[i] + capitalizedProperty;
if (!style[prefixedProperty]) {
style[prefixedProperty] = style[property];
}
}
}
return style;
}
webpack://frontend-tpt/../../node_modules/inline-style-prefixer/lib/utils/prefixValue.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = prefixValue;
function prefixValue(plugins, property, value, style, metaData) {
for (var i = 0, len = plugins.length; i < len; ++i) {
var processedValue = plugins[i](property, value, style, metaData);
// we can stop processing if a value is returned
// as all plugin criteria are unique
if (processedValue) {
return processedValue;
}
}
}
webpack://frontend-tpt/../../node_modules/is-node/index.js
// Coding standard for this project defined @ https://github.com/MatthewSH/standards/blob/master/JavaScript.md 'use strict'; exports = module.exports = !!(typeof process !== 'undefined' && process.versions && process.versions.node);
webpack://frontend-tpt/../../node_modules/locale-currency/index.js
var map = require("./map");
var getCountryCode = function(localeString) {
var components = localeString.split("_");
if (components.length == 2) {
return components.pop();
}
components = localeString.split("-");
if (components.length == 2) {
return components.pop();
}
return localeString;
}
exports.getCurrency = function(locale) {
var countryCode = getCountryCode(locale).toUpperCase();
if (countryCode in map) {
return map[countryCode];
}
return null;
}
exports.getLocales = function(currencyCode) {
currencyCode = currencyCode.toUpperCase();
var locales = [];
for (countryCode in map) {
if (map[countryCode] === currencyCode) {
locales.push(countryCode);
}
}
return locales;
}
webpack://frontend-tpt/../../node_modules/locale-currency/map.js
// Generated using ShowCurrencies.java
var map = {
AD: 'EUR',
AE: 'AED',
AF: 'AFN',
AG: 'XCD',
AI: 'XCD',
AL: 'ALL',
AM: 'AMD',
AN: 'ANG',
AO: 'AOA',
AR: 'ARS',
AS: 'USD',
AT: 'EUR',
AU: 'AUD',
AW: 'AWG',
AX: 'EUR',
AZ: 'AZN',
BA: 'BAM',
BB: 'BBD',
BD: 'BDT',
BE: 'EUR',
BF: 'XOF',
BG: 'BGN',
BH: 'BHD',
BI: 'BIF',
BJ: 'XOF',
BL: 'EUR',
BM: 'BMD',
BN: 'BND',
BO: 'BOB',
BQ: 'USD',
BR: 'BRL',
BS: 'BSD',
BT: 'BTN',
BV: 'NOK',
BW: 'BWP',
BY: 'BYR',
BZ: 'BZD',
CA: 'CAD',
CC: 'AUD',
CD: 'CDF',
CF: 'XAF',
CG: 'XAF',
CH: 'CHF',
CI: 'XOF',
CK: 'NZD',
CL: 'CLP',
CM: 'XAF',
CN: 'CNY',
CO: 'COP',
CR: 'CRC',
CU: 'CUP',
CV: 'CVE',
CW: 'ANG',
CX: 'AUD',
CY: 'EUR',
CZ: 'CZK',
DE: 'EUR',
DJ: 'DJF',
DK: 'DKK',
DM: 'XCD',
DO: 'DOP',
DZ: 'DZD',
EC: 'USD',
EE: 'EUR',
EG: 'EGP',
EH: 'MAD',
ER: 'ERN',
ES: 'EUR',
ET: 'ETB',
FI: 'EUR',
FJ: 'FJD',
FK: 'FKP',
FM: 'USD',
FO: 'DKK',
FR: 'EUR',
GA: 'XAF',
GB: 'GBP',
GD: 'XCD',
GE: 'GEL',
GF: 'EUR',
GG: 'GBP',
GH: 'GHS',
GI: 'GIP',
GL: 'DKK',
GM: 'GMD',
GN: 'GNF',
GP: 'EUR',
GQ: 'XAF',
GR: 'EUR',
GS: 'GBP',
GT: 'GTQ',
GU: 'USD',
GW: 'XOF',
GY: 'GYD',
HK: 'HKD',
HM: 'AUD',
HN: 'HNL',
HR: 'HRK',
HT: 'HTG',
HU: 'HUF',
ID: 'IDR',
IE: 'EUR',
IL: 'ILS',
IM: 'GBP',
IN: 'INR',
IO: 'USD',
IQ: 'IQD',
IR: 'IRR',
IS: 'ISK',
IT: 'EUR',
JE: 'GBP',
JM: 'JMD',
JO: 'JOD',
JP: 'JPY',
KE: 'KES',
KG: 'KGS',
KH: 'KHR',
KI: 'AUD',
KM: 'KMF',
KN: 'XCD',
KP: 'KPW',
KR: 'KRW',
KW: 'KWD',
KY: 'KYD',
KZ: 'KZT',
LA: 'LAK',
LB: 'LBP',
LC: 'XCD',
LI: 'CHF',
LK: 'LKR',
LR: 'LRD',
LS: 'LSL',
LT: 'LTL',
LU: 'EUR',
LV: 'LVL',
LY: 'LYD',
MA: 'MAD',
MC: 'EUR',
MD: 'MDL',
ME: 'EUR',
MF: 'EUR',
MG: 'MGA',
MH: 'USD',
MK: 'MKD',
ML: 'XOF',
MM: 'MMK',
MN: 'MNT',
MO: 'MOP',
MP: 'USD',
MQ: 'EUR',
MR: 'MRO',
MS: 'XCD',
MT: 'EUR',
MU: 'MUR',
MV: 'MVR',
MW: 'MWK',
MX: 'MXN',
MY: 'MYR',
MZ: 'MZN',
NA: 'NAD',
NC: 'XPF',
NE: 'XOF',
NF: 'AUD',
NG: 'NGN',
NI: 'NIO',
NL: 'EUR',
NO: 'NOK',
NP: 'NPR',
NR: 'AUD',
NU: 'NZD',
NZ: 'NZD',
OM: 'OMR',
PA: 'PAB',
PE: 'PEN',
PF: 'XPF',
PG: 'PGK',
PH: 'PHP',
PK: 'PKR',
PL: 'PLN',
PM: 'EUR',
PN: 'NZD',
PR: 'USD',
PS: 'ILS',
PT: 'EUR',
PW: 'USD',
PY: 'PYG',
QA: 'QAR',
RE: 'EUR',
RO: 'RON',
RS: 'RSD',
RU: 'RUB',
RW: 'RWF',
SA: 'SAR',
SB: 'SBD',
SC: 'SCR',
SD: 'SDG',
SE: 'SEK',
SG: 'SGD',
SH: 'SHP',
SI: 'EUR',
SJ: 'NOK',
SK: 'EUR',
SL: 'SLL',
SM: 'EUR',
SN: 'XOF',
SO: 'SOS',
SR: 'SRD',
ST: 'STD',
SV: 'SVC',
SX: 'ANG',
SY: 'SYP',
SZ: 'SZL',
TC: 'USD',
TD: 'XAF',
TF: 'EUR',
TG: 'XOF',
TH: 'THB',
TJ: 'TJS',
TK: 'NZD',
TL: 'USD',
TM: 'TMT',
TN: 'TND',
TO: 'TOP',
TR: 'TRY',
TT: 'TTD',
TV: 'AUD',
TW: 'TWD',
TZ: 'TZS',
UA: 'UAH',
UG: 'UGX',
UM: 'USD',
US: 'USD',
UY: 'UYU',
UZ: 'UZS',
VA: 'EUR',
VC: 'XCD',
VE: 'VEF',
VG: 'USD',
VI: 'USD',
VN: 'VND',
VU: 'VUV',
WF: 'XPF',
WS: 'WST',
YE: 'YER',
YT: 'EUR',
ZA: 'ZAR',
ZM: 'ZMK',
ZW: 'ZWL'
};
module.exports = map;
webpack://frontend-tpt/../../node_modules/lodash/_DataView.js
var getNative = require('./_getNative'),
root = require('./_root');
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
webpack://frontend-tpt/../../node_modules/lodash/_Hash.js
var hashClear = require('./_hashClear'),
hashDelete = require('./_hashDelete'),
hashGet = require('./_hashGet'),
hashHas = require('./_hashHas'),
hashSet = require('./_hashSet');
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
webpack://frontend-tpt/../../node_modules/lodash/_LazyWrapper.js
var baseCreate = require('./_baseCreate'),
baseLodash = require('./_baseLodash');
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
/**
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
*
* @private
* @constructor
* @param {*} value The value to wrap.
*/
function LazyWrapper(value) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__dir__ = 1;
this.__filtered__ = false;
this.__iteratees__ = [];
this.__takeCount__ = MAX_ARRAY_LENGTH;
this.__views__ = [];
}
// Ensure `LazyWrapper` is an instance of `baseLodash`.
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper;
module.exports = LazyWrapper;
webpack://frontend-tpt/../../node_modules/lodash/_ListCache.js
var listCacheClear = require('./_listCacheClear'),
listCacheDelete = require('./_listCacheDelete'),
listCacheGet = require('./_listCacheGet'),
listCacheHas = require('./_listCacheHas'),
listCacheSet = require('./_listCacheSet');
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
webpack://frontend-tpt/../../node_modules/lodash/_LodashWrapper.js
var baseCreate = require('./_baseCreate'),
baseLodash = require('./_baseLodash');
/**
* The base constructor for creating `lodash` wrapper objects.
*
* @private
* @param {*} value The value to wrap.
* @param {boolean} [chainAll] Enable explicit method chain sequences.
*/
function LodashWrapper(value, chainAll) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__chain__ = !!chainAll;
this.__index__ = 0;
this.__values__ = undefined;
}
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
LodashWrapper.prototype.constructor = LodashWrapper;
module.exports = LodashWrapper;
webpack://frontend-tpt/../../node_modules/lodash/_Map.js
var getNative = require('./_getNative'),
root = require('./_root');
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
webpack://frontend-tpt/../../node_modules/lodash/_MapCache.js
var mapCacheClear = require('./_mapCacheClear'),
mapCacheDelete = require('./_mapCacheDelete'),
mapCacheGet = require('./_mapCacheGet'),
mapCacheHas = require('./_mapCacheHas'),
mapCacheSet = require('./_mapCacheSet');
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
webpack://frontend-tpt/../../node_modules/lodash/_Promise.js
var getNative = require('./_getNative'),
root = require('./_root');
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
webpack://frontend-tpt/../../node_modules/lodash/_Set.js
var getNative = require('./_getNative'),
root = require('./_root');
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
webpack://frontend-tpt/../../node_modules/lodash/_SetCache.js
var MapCache = require('./_MapCache'),
setCacheAdd = require('./_setCacheAdd'),
setCacheHas = require('./_setCacheHas');
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
webpack://frontend-tpt/../../node_modules/lodash/_Stack.js
var ListCache = require('./_ListCache'),
stackClear = require('./_stackClear'),
stackDelete = require('./_stackDelete'),
stackGet = require('./_stackGet'),
stackHas = require('./_stackHas'),
stackSet = require('./_stackSet');
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;
webpack://frontend-tpt/../../node_modules/lodash/_Symbol.js
var root = require('./_root');
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
webpack://frontend-tpt/../../node_modules/lodash/_Uint8Array.js
var root = require('./_root');
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
webpack://frontend-tpt/../../node_modules/lodash/_WeakMap.js
var getNative = require('./_getNative'),
root = require('./_root');
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
webpack://frontend-tpt/../../node_modules/lodash/_apply.js
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
module.exports = apply;
webpack://frontend-tpt/../../node_modules/lodash/_arrayEach.js
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
module.exports = arrayEach;
webpack://frontend-tpt/../../node_modules/lodash/_arrayEvery.js
/**
* A specialized version of `_.every` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
*/
function arrayEvery(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (!predicate(array[index], index, array)) {
return false;
}
}
return true;
}
module.exports = arrayEvery;
webpack://frontend-tpt/../../node_modules/lodash/_arrayFilter.js
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
module.exports = arrayFilter;
webpack://frontend-tpt/../../node_modules/lodash/_arrayIncludes.js
var baseIndexOf = require('./_baseIndexOf');
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
module.exports = arrayIncludes;
webpack://frontend-tpt/../../node_modules/lodash/_arrayIncludesWith.js
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
module.exports = arrayIncludesWith;
webpack://frontend-tpt/../../node_modules/lodash/_arrayLikeKeys.js
var baseTimes = require('./_baseTimes'),
isArguments = require('./isArguments'),
isArray = require('./isArray'),
isBuffer = require('./isBuffer'),
isIndex = require('./_isIndex'),
isTypedArray = require('./isTypedArray');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
var isArr = isArray(value),
isArg = !isArr && isArguments(value),
isBuff = !isArr && !isArg && isBuffer(value),
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties.
isIndex(key, length)
))) {
result.push(key);
}
}
return result;
}
module.exports = arrayLikeKeys;
webpack://frontend-tpt/../../node_modules/lodash/_arrayMap.js
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
webpack://frontend-tpt/../../node_modules/lodash/_arrayPush.js
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
module.exports = arrayPush;
webpack://frontend-tpt/../../node_modules/lodash/_arrayReduce.js
/**
* A specialized version of `_.reduce` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduce(array, iteratee, accumulator, initAccum) {
var index = -1,
length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
module.exports = arrayReduce;
webpack://frontend-tpt/../../node_modules/lodash/_arraySome.js
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
module.exports = arraySome;
webpack://frontend-tpt/../../node_modules/lodash/_asciiSize.js
var baseProperty = require('./_baseProperty');
/**
* Gets the size of an ASCII `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
var asciiSize = baseProperty('length');
module.exports = asciiSize;
webpack://frontend-tpt/../../node_modules/lodash/_asciiToArray.js
/**
* Converts an ASCII `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function asciiToArray(string) {
return string.split('');
}
module.exports = asciiToArray;
webpack://frontend-tpt/../../node_modules/lodash/_asciiWords.js
/** Used to match words composed of alphanumeric characters. */
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
/**
* Splits an ASCII `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function asciiWords(string) {
return string.match(reAsciiWord) || [];
}
module.exports = asciiWords;
webpack://frontend-tpt/../../node_modules/lodash/_assignMergeValue.js
var baseAssignValue = require('./_baseAssignValue'),
eq = require('./eq');
/**
* This function is like `assignValue` except that it doesn't assign
* `undefined` values.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignMergeValue(object, key, value) {
if ((value !== undefined && !eq(object[key], value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
module.exports = assignMergeValue;
webpack://frontend-tpt/../../node_modules/lodash/_assignValue.js
var baseAssignValue = require('./_baseAssignValue'),
eq = require('./eq');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
module.exports = assignValue;
webpack://frontend-tpt/../../node_modules/lodash/_assocIndexOf.js
var eq = require('./eq');
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
module.exports = assocIndexOf;
webpack://frontend-tpt/../../node_modules/lodash/_baseAssign.js
var copyObject = require('./_copyObject'),
keys = require('./keys');
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
module.exports = baseAssign;
webpack://frontend-tpt/../../node_modules/lodash/_baseAssignIn.js
var copyObject = require('./_copyObject'),
keysIn = require('./keysIn');
/**
* The base implementation of `_.assignIn` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssignIn(object, source) {
return object && copyObject(source, keysIn(source), object);
}
module.exports = baseAssignIn;
webpack://frontend-tpt/../../node_modules/lodash/_baseAssignValue.js
var defineProperty = require('./_defineProperty');
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
module.exports = baseAssignValue;
webpack://frontend-tpt/../../node_modules/lodash/_baseClamp.js
/**
* The base implementation of `_.clamp` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
*/
function baseClamp(number, lower, upper) {
if (number === number) {
if (upper !== undefined) {
number = number <= upper ? number : upper;
}
if (lower !== undefined) {
number = number >= lower ? number : lower;
}
}
return number;
}
module.exports = baseClamp;
webpack://frontend-tpt/../../node_modules/lodash/_baseClone.js
var Stack = require('./_Stack'),
arrayEach = require('./_arrayEach'),
assignValue = require('./_assignValue'),
baseAssign = require('./_baseAssign'),
baseAssignIn = require('./_baseAssignIn'),
cloneBuffer = require('./_cloneBuffer'),
copyArray = require('./_copyArray'),
copySymbols = require('./_copySymbols'),
copySymbolsIn = require('./_copySymbolsIn'),
getAllKeys = require('./_getAllKeys'),
getAllKeysIn = require('./_getAllKeysIn'),
getTag = require('./_getTag'),
initCloneArray = require('./_initCloneArray'),
initCloneByTag = require('./_initCloneByTag'),
initCloneObject = require('./_initCloneObject'),
isArray = require('./isArray'),
isBuffer = require('./isBuffer'),
isMap = require('./isMap'),
isObject = require('./isObject'),
isSet = require('./isSet'),
keys = require('./keys'),
keysIn = require('./keysIn');
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} bitmask The bitmask flags.
* 1 - Deep clone
* 2 - Flatten inherited properties
* 4 - Clone symbols
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, bitmask, customizer, key, object, stack) {
var result,
isDeep = bitmask & CLONE_DEEP_FLAG,
isFlat = bitmask & CLONE_FLAT_FLAG,
isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== undefined) {
return result;
}
if (!isObject(value)) {
return value;
}
var isArr = isArray(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat
? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, isDeep);
}
}
// Check for circular references and return its corresponding clone.
stack || (stack = new Stack);
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
if (isSet(value)) {
value.forEach(function(subValue) {
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
});
} else if (isMap(value)) {
value.forEach(function(subValue, key) {
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
}
var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
}
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
module.exports = baseClone;
webpack://frontend-tpt/../../node_modules/lodash/_baseCreate.js
var isObject = require('./isObject');
/** Built-in value references. */
var objectCreate = Object.create;
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
function object() {}
return function(proto) {
if (!isObject(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object;
object.prototype = undefined;
return result;
};
}());
module.exports = baseCreate;
webpack://frontend-tpt/../../node_modules/lodash/_baseDifference.js
var SetCache = require('./_SetCache'),
arrayIncludes = require('./_arrayIncludes'),
arrayIncludesWith = require('./_arrayIncludesWith'),
arrayMap = require('./_arrayMap'),
baseUnary = require('./_baseUnary'),
cacheHas = require('./_cacheHas');
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of methods like `_.difference` without support
* for excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
}
else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee == null ? value : iteratee(value);
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
module.exports = baseDifference;
webpack://frontend-tpt/../../node_modules/lodash/_baseEach.js
var baseForOwn = require('./_baseForOwn'),
createBaseEach = require('./_createBaseEach');
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
module.exports = baseEach;
webpack://frontend-tpt/../../node_modules/lodash/_baseEvery.js
var baseEach = require('./_baseEach');
/**
* The base implementation of `_.every` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`
*/
function baseEvery(collection, predicate) {
var result = true;
baseEach(collection, function(value, index, collection) {
result = !!predicate(value, index, collection);
return result;
});
return result;
}
module.exports = baseEvery;
webpack://frontend-tpt/../../node_modules/lodash/_baseFindIndex.js
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
module.exports = baseFindIndex;
webpack://frontend-tpt/../../node_modules/lodash/_baseFindKey.js
/**
* The base implementation of methods like `_.findKey` and `_.findLastKey`,
* without support for iteratee shorthands, which iterates over `collection`
* using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the found element or its key, else `undefined`.
*/
function baseFindKey(collection, predicate, eachFunc) {
var result;
eachFunc(collection, function(value, key, collection) {
if (predicate(value, key, collection)) {
result = key;
return false;
}
});
return result;
}
module.exports = baseFindKey;
webpack://frontend-tpt/../../node_modules/lodash/_baseFlatten.js
var arrayPush = require('./_arrayPush'),
isFlattenable = require('./_isFlattenable');
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
module.exports = baseFlatten;
webpack://frontend-tpt/../../node_modules/lodash/_baseFor.js
var createBaseFor = require('./_createBaseFor');
/**
* The base implementation of `baseForOwn` which iterates over `object`
* properties returned by `keysFunc` and invokes `iteratee` for each property.
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseFor = createBaseFor();
module.exports = baseFor;
webpack://frontend-tpt/../../node_modules/lodash/_baseForOwn.js
var baseFor = require('./_baseFor'),
keys = require('./keys');
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
}
module.exports = baseForOwn;
webpack://frontend-tpt/../../node_modules/lodash/_baseGet.js
var castPath = require('./_castPath'),
toKey = require('./_toKey');
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = castPath(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
module.exports = baseGet;
webpack://frontend-tpt/../../node_modules/lodash/_baseGetAllKeys.js
var arrayPush = require('./_arrayPush'),
isArray = require('./isArray');
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
module.exports = baseGetAllKeys;
webpack://frontend-tpt/../../node_modules/lodash/_baseGetTag.js
var Symbol = require('./_Symbol'),
getRawTag = require('./_getRawTag'),
objectToString = require('./_objectToString');
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
webpack://frontend-tpt/../../node_modules/lodash/_baseHas.js
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
return object != null && hasOwnProperty.call(object, key);
}
module.exports = baseHas;
webpack://frontend-tpt/../../node_modules/lodash/_baseHasIn.js
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
module.exports = baseHasIn;
webpack://frontend-tpt/../../node_modules/lodash/_baseIndexOf.js
var baseFindIndex = require('./_baseFindIndex'),
baseIsNaN = require('./_baseIsNaN'),
strictIndexOf = require('./_strictIndexOf');
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value
? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex);
}
module.exports = baseIndexOf;
webpack://frontend-tpt/../../node_modules/lodash/_baseIntersection.js
var SetCache = require('./_SetCache'),
arrayIncludes = require('./_arrayIncludes'),
arrayIncludesWith = require('./_arrayIncludesWith'),
arrayMap = require('./_arrayMap'),
baseUnary = require('./_baseUnary'),
cacheHas = require('./_cacheHas');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
*/
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes,
length = arrays[0].length,
othLength = arrays.length,
othIndex = othLength,
caches = Array(othLength),
maxLength = Infinity,
result = [];
while (othIndex--) {
var array = arrays[othIndex];
if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee));
}
maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array)
: undefined;
}
array = arrays[0];
var index = -1,
seen = caches[0];
outer:
while (++index < length && result.length < maxLength) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (!(seen
? cacheHas(seen, computed)
: includes(result, computed, comparator)
)) {
othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache
? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator))
) {
continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
module.exports = baseIntersection;
webpack://frontend-tpt/../../node_modules/lodash/_baseIsArguments.js
var baseGetTag = require('./_baseGetTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
module.exports = baseIsArguments;
webpack://frontend-tpt/../../node_modules/lodash/_baseIsEqual.js
var baseIsEqualDeep = require('./_baseIsEqualDeep'),
isObjectLike = require('./isObjectLike');
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {boolean} bitmask The bitmask flags.
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Function} [customizer] The function to customize comparisons.
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, bitmask, customizer, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}
module.exports = baseIsEqual;
webpack://frontend-tpt/../../node_modules/lodash/_baseIsEqualDeep.js
var Stack = require('./_Stack'),
equalArrays = require('./_equalArrays'),
equalByTag = require('./_equalByTag'),
equalObjects = require('./_equalObjects'),
getTag = require('./_getTag'),
isArray = require('./isArray'),
isBuffer = require('./isBuffer'),
isTypedArray = require('./isTypedArray');
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
objectTag = '[object Object]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
module.exports = baseIsEqualDeep;
webpack://frontend-tpt/../../node_modules/lodash/_baseIsMap.js
var getTag = require('./_getTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var mapTag = '[object Map]';
/**
* The base implementation of `_.isMap` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
*/
function baseIsMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
}
module.exports = baseIsMap;
webpack://frontend-tpt/../../node_modules/lodash/_baseIsMatch.js
var Stack = require('./_Stack'),
baseIsEqual = require('./_baseIsEqual');
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack;
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result
)) {
return false;
}
}
}
return true;
}
module.exports = baseIsMatch;
webpack://frontend-tpt/../../node_modules/lodash/_baseIsNaN.js
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
module.exports = baseIsNaN;
webpack://frontend-tpt/../../node_modules/lodash/_baseIsNative.js
var isFunction = require('./isFunction'),
isMasked = require('./_isMasked'),
isObject = require('./isObject'),
toSource = require('./_toSource');
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
module.exports = baseIsNative;
webpack://frontend-tpt/../../node_modules/lodash/_baseIsSet.js
var getTag = require('./_getTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var setTag = '[object Set]';
/**
* The base implementation of `_.isSet` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
*/
function baseIsSet(value) {
return isObjectLike(value) && getTag(value) == setTag;
}
module.exports = baseIsSet;
webpack://frontend-tpt/../../node_modules/lodash/_baseIsTypedArray.js
var baseGetTag = require('./_baseGetTag'),
isLength = require('./isLength'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray(value) {
return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
module.exports = baseIsTypedArray;
webpack://frontend-tpt/../../node_modules/lodash/_baseIteratee.js
var baseMatches = require('./_baseMatches'),
baseMatchesProperty = require('./_baseMatchesProperty'),
identity = require('./identity'),
isArray = require('./isArray'),
property = require('./property');
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
module.exports = baseIteratee;
webpack://frontend-tpt/../../node_modules/lodash/_baseKeys.js
var isPrototype = require('./_isPrototype'),
nativeKeys = require('./_nativeKeys');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
module.exports = baseKeys;
webpack://frontend-tpt/../../node_modules/lodash/_baseKeysIn.js
var isObject = require('./isObject'),
isPrototype = require('./_isPrototype'),
nativeKeysIn = require('./_nativeKeysIn');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = baseKeysIn;
webpack://frontend-tpt/../../node_modules/lodash/_baseLodash.js
/**
* The function whose prototype chain sequence wrappers inherit from.
*
* @private
*/
function baseLodash() {
// No operation performed.
}
module.exports = baseLodash;
webpack://frontend-tpt/../../node_modules/lodash/_baseMap.js
var baseEach = require('./_baseEach'),
isArrayLike = require('./isArrayLike');
/**
* The base implementation of `_.map` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
module.exports = baseMap;
webpack://frontend-tpt/../../node_modules/lodash/_baseMatches.js
var baseIsMatch = require('./_baseIsMatch'),
getMatchData = require('./_getMatchData'),
matchesStrictComparable = require('./_matchesStrictComparable');
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
module.exports = baseMatches;
webpack://frontend-tpt/../../node_modules/lodash/_baseMatchesProperty.js
var baseIsEqual = require('./_baseIsEqual'),
get = require('./get'),
hasIn = require('./hasIn'),
isKey = require('./_isKey'),
isStrictComparable = require('./_isStrictComparable'),
matchesStrictComparable = require('./_matchesStrictComparable'),
toKey = require('./_toKey');
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
module.exports = baseMatchesProperty;
webpack://frontend-tpt/../../node_modules/lodash/_baseMerge.js
var Stack = require('./_Stack'),
assignMergeValue = require('./_assignMergeValue'),
baseFor = require('./_baseFor'),
baseMergeDeep = require('./_baseMergeDeep'),
isObject = require('./isObject'),
keysIn = require('./keysIn'),
safeGet = require('./_safeGet');
/**
* The base implementation of `_.merge` without support for multiple sources.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {number} srcIndex The index of `source`.
* @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) {
return;
}
baseFor(source, function(srcValue, key) {
stack || (stack = new Stack);
if (isObject(srcValue)) {
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
}
else {
var newValue = customizer
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) {
newValue = srcValue;
}
assignMergeValue(object, key, newValue);
}
}, keysIn);
}
module.exports = baseMerge;
webpack://frontend-tpt/../../node_modules/lodash/_baseMergeDeep.js
var assignMergeValue = require('./_assignMergeValue'),
cloneBuffer = require('./_cloneBuffer'),
cloneTypedArray = require('./_cloneTypedArray'),
copyArray = require('./_copyArray'),
initCloneObject = require('./_initCloneObject'),
isArguments = require('./isArguments'),
isArray = require('./isArray'),
isArrayLikeObject = require('./isArrayLikeObject'),
isBuffer = require('./isBuffer'),
isFunction = require('./isFunction'),
isObject = require('./isObject'),
isPlainObject = require('./isPlainObject'),
isTypedArray = require('./isTypedArray'),
safeGet = require('./_safeGet'),
toPlainObject = require('./toPlainObject');
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {number} srcIndex The index of `source`.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = safeGet(object, key),
srcValue = safeGet(source, key),
stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object, key, stacked);
return;
}
var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined;
var isCommon = newValue === undefined;
if (isCommon) {
var isArr = isArray(srcValue),
isBuff = !isArr && isBuffer(srcValue),
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (isArray(objValue)) {
newValue = objValue;
}
else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
}
else if (isBuff) {
isCommon = false;
newValue = cloneBuffer(srcValue, true);
}
else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray(srcValue, true);
}
else {
newValue = [];
}
}
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
newValue = objValue;
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || isFunction(objValue)) {
newValue = initCloneObject(srcValue);
}
}
else {
isCommon = false;
}
}
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack['delete'](srcValue);
}
assignMergeValue(object, key, newValue);
}
module.exports = baseMergeDeep;
webpack://frontend-tpt/../../node_modules/lodash/_baseOrderBy.js
var arrayMap = require('./_arrayMap'),
baseGet = require('./_baseGet'),
baseIteratee = require('./_baseIteratee'),
baseMap = require('./_baseMap'),
baseSortBy = require('./_baseSortBy'),
baseUnary = require('./_baseUnary'),
compareMultiple = require('./_compareMultiple'),
identity = require('./identity'),
isArray = require('./isArray');
/**
* The base implementation of `_.orderBy` without param guards.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
* @param {string[]} orders The sort orders of `iteratees`.
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
if (iteratees.length) {
iteratees = arrayMap(iteratees, function(iteratee) {
if (isArray(iteratee)) {
return function(value) {
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
}
}
return iteratee;
});
} else {
iteratees = [identity];
}
var index = -1;
iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) {
return iteratee(value);
});
return { 'criteria': criteria, 'index': ++index, 'value': value };
});
return baseSortBy(result, function(object, other) {
return compareMultiple(object, other, orders);
});
}
module.exports = baseOrderBy;
webpack://frontend-tpt/../../node_modules/lodash/_basePickBy.js
var baseGet = require('./_baseGet'),
baseSet = require('./_baseSet'),
castPath = require('./_castPath');
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, paths, predicate) {
var index = -1,
length = paths.length,
result = {};
while (++index < length) {
var path = paths[index],
value = baseGet(object, path);
if (predicate(value, path)) {
baseSet(result, castPath(path, object), value);
}
}
return result;
}
module.exports = basePickBy;
webpack://frontend-tpt/../../node_modules/lodash/_baseProperty.js
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
module.exports = baseProperty;
webpack://frontend-tpt/../../node_modules/lodash/_basePropertyDeep.js
var baseGet = require('./_baseGet');
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
module.exports = basePropertyDeep;
webpack://frontend-tpt/../../node_modules/lodash/_basePropertyOf.js
/**
* The base implementation of `_.propertyOf` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyOf(object) {
return function(key) {
return object == null ? undefined : object[key];
};
}
module.exports = basePropertyOf;
webpack://frontend-tpt/../../node_modules/lodash/_basePullAt.js
var baseUnset = require('./_baseUnset'),
isIndex = require('./_isIndex');
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* The base implementation of `_.pullAt` without support for individual
* indexes or capturing the removed elements.
*
* @private
* @param {Array} array The array to modify.
* @param {number[]} indexes The indexes of elements to remove.
* @returns {Array} Returns `array`.
*/
function basePullAt(array, indexes) {
var length = array ? indexes.length : 0,
lastIndex = length - 1;
while (length--) {
var index = indexes[length];
if (length == lastIndex || index !== previous) {
var previous = index;
if (isIndex(index)) {
splice.call(array, index, 1);
} else {
baseUnset(array, index);
}
}
}
return array;
}
module.exports = basePullAt;
webpack://frontend-tpt/../../node_modules/lodash/_baseReduce.js
/**
* The base implementation of `_.reduce` and `_.reduceRight`, without support
* for iteratee shorthands, which iterates over `collection` using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value.
* @param {boolean} initAccum Specify using the first or last element of
* `collection` as the initial value.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the accumulated value.
*/
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function(value, index, collection) {
accumulator = initAccum
? (initAccum = false, value)
: iteratee(accumulator, value, index, collection);
});
return accumulator;
}
module.exports = baseReduce;
webpack://frontend-tpt/../../node_modules/lodash/_baseRest.js
var identity = require('./identity'),
overRest = require('./_overRest'),
setToString = require('./_setToString');
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
return setToString(overRest(func, start, identity), func + '');
}
module.exports = baseRest;
webpack://frontend-tpt/../../node_modules/lodash/_baseSet.js
var assignValue = require('./_assignValue'),
castPath = require('./_castPath'),
isIndex = require('./_isIndex'),
isObject = require('./isObject'),
toKey = require('./_toKey');
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = castPath(path, object);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
return object;
}
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
module.exports = baseSet;
webpack://frontend-tpt/../../node_modules/lodash/_baseSetData.js
var identity = require('./identity'),
metaMap = require('./_metaMap');
/**
* The base implementation of `setData` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function(func, data) {
metaMap.set(func, data);
return func;
};
module.exports = baseSetData;
webpack://frontend-tpt/../../node_modules/lodash/_baseSetToString.js
var constant = require('./constant'),
defineProperty = require('./_defineProperty'),
identity = require('./identity');
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function(func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
module.exports = baseSetToString;
webpack://frontend-tpt/../../node_modules/lodash/_baseSlice.js
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : ((end - start) >>> 0);
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
module.exports = baseSlice;
webpack://frontend-tpt/../../node_modules/lodash/_baseSome.js
var baseEach = require('./_baseEach');
/**
* The base implementation of `_.some` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function baseSome(collection, predicate) {
var result;
baseEach(collection, function(value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
return !!result;
}
module.exports = baseSome;
webpack://frontend-tpt/../../node_modules/lodash/_baseSortBy.js
/**
* The base implementation of `_.sortBy` which uses `comparer` to define the
* sort order of `array` and replaces criteria objects with their corresponding
* values.
*
* @private
* @param {Array} array The array to sort.
* @param {Function} comparer The function to define sort order.
* @returns {Array} Returns `array`.
*/
function baseSortBy(array, comparer) {
var length = array.length;
array.sort(comparer);
while (length--) {
array[length] = array[length].value;
}
return array;
}
module.exports = baseSortBy;
webpack://frontend-tpt/../../node_modules/lodash/_baseTimes.js
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
module.exports = baseTimes;
webpack://frontend-tpt/../../node_modules/lodash/_baseToPairs.js
var arrayMap = require('./_arrayMap');
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
* of key-value pairs for `object` corresponding to the property names of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function(key) {
return [key, object[key]];
});
}
module.exports = baseToPairs;
webpack://frontend-tpt/../../node_modules/lodash/_baseToString.js
var Symbol = require('./_Symbol'),
arrayMap = require('./_arrayMap'),
isArray = require('./isArray'),
isSymbol = require('./isSymbol');
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = baseToString;
webpack://frontend-tpt/../../node_modules/lodash/_baseTrim.js
var trimmedEndIndex = require('./_trimmedEndIndex');
/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;
/**
* The base implementation of `_.trim`.
*
* @private
* @param {string} string The string to trim.
* @returns {string} Returns the trimmed string.
*/
function baseTrim(string) {
return string
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
: string;
}
module.exports = baseTrim;
webpack://frontend-tpt/../../node_modules/lodash/_baseUnary.js
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
module.exports = baseUnary;
webpack://frontend-tpt/../../node_modules/lodash/_baseUniq.js
var SetCache = require('./_SetCache'),
arrayIncludes = require('./_arrayIncludes'),
arrayIncludesWith = require('./_arrayIncludesWith'),
cacheHas = require('./_cacheHas'),
createSet = require('./_createSet'),
setToArray = require('./_setToArray');
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
module.exports = baseUniq;
webpack://frontend-tpt/../../node_modules/lodash/_baseUnset.js
var castPath = require('./_castPath'),
last = require('./last'),
parent = require('./_parent'),
toKey = require('./_toKey');
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
}
module.exports = baseUnset;
webpack://frontend-tpt/../../node_modules/lodash/_baseValues.js
var arrayMap = require('./_arrayMap');
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
* array of `object` property values corresponding to the property names
* of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
return arrayMap(props, function(key) {
return object[key];
});
}
module.exports = baseValues;
webpack://frontend-tpt/../../node_modules/lodash/_cacheHas.js
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
module.exports = cacheHas;
webpack://frontend-tpt/../../node_modules/lodash/_castArrayLikeObject.js
var isArrayLikeObject = require('./isArrayLikeObject');
/**
* Casts `value` to an empty array if it's not an array like object.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array|Object} Returns the cast array-like object.
*/
function castArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
module.exports = castArrayLikeObject;
webpack://frontend-tpt/../../node_modules/lodash/_castFunction.js
var identity = require('./identity');
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function castFunction(value) {
return typeof value == 'function' ? value : identity;
}
module.exports = castFunction;
webpack://frontend-tpt/../../node_modules/lodash/_castPath.js
var isArray = require('./isArray'),
isKey = require('./_isKey'),
stringToPath = require('./_stringToPath'),
toString = require('./toString');
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;
webpack://frontend-tpt/../../node_modules/lodash/_castSlice.js
var baseSlice = require('./_baseSlice');
/**
* Casts `array` to a slice if it's needed.
*
* @private
* @param {Array} array The array to inspect.
* @param {number} start The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the cast slice.
*/
function castSlice(array, start, end) {
var length = array.length;
end = end === undefined ? length : end;
return (!start && end >= length) ? array : baseSlice(array, start, end);
}
module.exports = castSlice;
webpack://frontend-tpt/../../node_modules/lodash/_cloneArrayBuffer.js
var Uint8Array = require('./_Uint8Array');
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
module.exports = cloneArrayBuffer;
webpack://frontend-tpt/../../node_modules/lodash/_cloneBuffer.js
var root = require('./_root');
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
/**
* Creates a clone of `buffer`.
*
* @private
* @param {Buffer} buffer The buffer to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Buffer} Returns the cloned buffer.
*/
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length = buffer.length,
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
buffer.copy(result);
return result;
}
module.exports = cloneBuffer;
webpack://frontend-tpt/../../node_modules/lodash/_cloneDataView.js
var cloneArrayBuffer = require('./_cloneArrayBuffer');
/**
* Creates a clone of `dataView`.
*
* @private
* @param {Object} dataView The data view to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned data view.
*/
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
module.exports = cloneDataView;
webpack://frontend-tpt/../../node_modules/lodash/_cloneRegExp.js
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
module.exports = cloneRegExp;
webpack://frontend-tpt/../../node_modules/lodash/_cloneSymbol.js
var Symbol = require('./_Symbol');
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* Creates a clone of the `symbol` object.
*
* @private
* @param {Object} symbol The symbol object to clone.
* @returns {Object} Returns the cloned symbol object.
*/
function cloneSymbol(symbol) {
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
module.exports = cloneSymbol;
webpack://frontend-tpt/../../node_modules/lodash/_cloneTypedArray.js
var cloneArrayBuffer = require('./_cloneArrayBuffer');
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
module.exports = cloneTypedArray;
webpack://frontend-tpt/../../node_modules/lodash/_compareAscending.js
var isSymbol = require('./isSymbol');
/**
* Compares values to sort them in ascending order.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function compareAscending(value, other) {
if (value !== other) {
var valIsDefined = value !== undefined,
valIsNull = value === null,
valIsReflexive = value === value,
valIsSymbol = isSymbol(value);
var othIsDefined = other !== undefined,
othIsNull = other === null,
othIsReflexive = other === other,
othIsSymbol = isSymbol(other);
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
(valIsNull && othIsDefined && othIsReflexive) ||
(!valIsDefined && othIsReflexive) ||
!valIsReflexive) {
return 1;
}
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
(othIsNull && valIsDefined && valIsReflexive) ||
(!othIsDefined && valIsReflexive) ||
!othIsReflexive) {
return -1;
}
}
return 0;
}
module.exports = compareAscending;
webpack://frontend-tpt/../../node_modules/lodash/_compareMultiple.js
var compareAscending = require('./_compareAscending');
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
* and stable sort them.
*
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
* specify an order of "desc" for descending or "asc" for ascending sort order
* of corresponding values.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {boolean[]|string[]} orders The order to sort by for each property.
* @returns {number} Returns the sort order indicator for `object`.
*/
function compareMultiple(object, other, orders) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length,
ordersLength = orders.length;
while (++index < length) {
var result = compareAscending(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order = orders[index];
return result * (order == 'desc' ? -1 : 1);
}
}
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to provide the same value for
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
// for more details.
//
// This also ensures a stable sort in V8 and other engines.
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
return object.index - other.index;
}
module.exports = compareMultiple;
webpack://frontend-tpt/../../node_modules/lodash/_composeArgs.js
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates an array that is the composition of partially applied arguments,
* placeholders, and provided arguments into a single array of arguments.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to prepend to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgs(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersLength = holders.length,
leftIndex = -1,
leftLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(leftLength + rangeLength),
isUncurried = !isCurried;
while (++leftIndex < leftLength) {
result[leftIndex] = partials[leftIndex];
}
while (++argsIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[holders[argsIndex]] = args[argsIndex];
}
}
while (rangeLength--) {
result[leftIndex++] = args[argsIndex++];
}
return result;
}
module.exports = composeArgs;
webpack://frontend-tpt/../../node_modules/lodash/_composeArgsRight.js
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This function is like `composeArgs` except that the arguments composition
* is tailored for `_.partialRight`.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to append to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgsRight(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersIndex = -1,
holdersLength = holders.length,
rightIndex = -1,
rightLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(rangeLength + rightLength),
isUncurried = !isCurried;
while (++argsIndex < rangeLength) {
result[argsIndex] = args[argsIndex];
}
var offset = argsIndex;
while (++rightIndex < rightLength) {
result[offset + rightIndex] = partials[rightIndex];
}
while (++holdersIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
}
}
return result;
}
module.exports = composeArgsRight;
webpack://frontend-tpt/../../node_modules/lodash/_copyArray.js
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
module.exports = copyArray;
webpack://frontend-tpt/../../node_modules/lodash/_copyObject.js
var assignValue = require('./_assignValue'),
baseAssignValue = require('./_baseAssignValue');
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
module.exports = copyObject;
webpack://frontend-tpt/../../node_modules/lodash/_copySymbols.js
var copyObject = require('./_copyObject'),
getSymbols = require('./_getSymbols');
/**
* Copies own symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
module.exports = copySymbols;
webpack://frontend-tpt/../../node_modules/lodash/_copySymbolsIn.js
var copyObject = require('./_copyObject'),
getSymbolsIn = require('./_getSymbolsIn');
/**
* Copies own and inherited symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
module.exports = copySymbolsIn;
webpack://frontend-tpt/../../node_modules/lodash/_coreJsData.js
var root = require('./_root');
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
webpack://frontend-tpt/../../node_modules/lodash/_countHolders.js
/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
}
module.exports = countHolders;
webpack://frontend-tpt/../../node_modules/lodash/_createAssigner.js
var baseRest = require('./_baseRest'),
isIterateeCall = require('./_isIterateeCall');
/**
* Creates a function like `_.assign`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return baseRest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer)
: undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
object = Object(object);
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, index, customizer);
}
}
return object;
});
}
module.exports = createAssigner;
webpack://frontend-tpt/../../node_modules/lodash/_createBaseEach.js
var isArrayLike = require('./isArrayLike');
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
module.exports = createBaseEach;
webpack://frontend-tpt/../../node_modules/lodash/_createBaseFor.js
/**
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
module.exports = createBaseFor;
webpack://frontend-tpt/../../node_modules/lodash/_createBind.js
var createCtor = require('./_createCtor'),
root = require('./_root');
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1;
/**
* Creates a function that wraps `func` to invoke it with the optional `this`
* binding of `thisArg`.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createBind(func, bitmask, thisArg) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
}
return wrapper;
}
module.exports = createBind;
webpack://frontend-tpt/../../node_modules/lodash/_createCaseFirst.js
var castSlice = require('./_castSlice'),
hasUnicode = require('./_hasUnicode'),
stringToArray = require('./_stringToArray'),
toString = require('./toString');
/**
* Creates a function like `_.lowerFirst`.
*
* @private
* @param {string} methodName The name of the `String` case method to use.
* @returns {Function} Returns the new case function.
*/
function createCaseFirst(methodName) {
return function(string) {
string = toString(string);
var strSymbols = hasUnicode(string)
? stringToArray(string)
: undefined;
var chr = strSymbols
? strSymbols[0]
: string.charAt(0);
var trailing = strSymbols
? castSlice(strSymbols, 1).join('')
: string.slice(1);
return chr[methodName]() + trailing;
};
}
module.exports = createCaseFirst;
webpack://frontend-tpt/../../node_modules/lodash/_createCompounder.js
var arrayReduce = require('./_arrayReduce'),
deburr = require('./deburr'),
words = require('./words');
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]";
/** Used to match apostrophes. */
var reApos = RegExp(rsApos, 'g');
/**
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
return function(string) {
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
};
}
module.exports = createCompounder;
webpack://frontend-tpt/../../node_modules/lodash/_createCtor.js
var baseCreate = require('./_baseCreate'),
isObject = require('./isObject');
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
return function() {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0: return new Ctor;
case 1: return new Ctor(args[0]);
case 2: return new Ctor(args[0], args[1]);
case 3: return new Ctor(args[0], args[1], args[2]);
case 4: return new Ctor(args[0], args[1], args[2], args[3]);
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
module.exports = createCtor;
webpack://frontend-tpt/../../node_modules/lodash/_createCurry.js
var apply = require('./_apply'),
createCtor = require('./_createCtor'),
createHybrid = require('./_createHybrid'),
createRecurry = require('./_createRecurry'),
getHolder = require('./_getHolder'),
replaceHolders = require('./_replaceHolders'),
root = require('./_root');
/**
* Creates a function that wraps `func` to enable currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {number} arity The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createCurry(func, bitmask, arity) {
var Ctor = createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length,
placeholder = getHolder(wrapper);
while (index--) {
args[index] = arguments[index];
}
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? []
: replaceHolders(args, placeholder);
length -= holders.length;
if (length < arity) {
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length);
}
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args);
}
return wrapper;
}
module.exports = createCurry;
webpack://frontend-tpt/../../node_modules/lodash/_createFind.js
var baseIteratee = require('./_baseIteratee'),
isArrayLike = require('./isArrayLike'),
keys = require('./keys');
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = baseIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
module.exports = createFind;
webpack://frontend-tpt/../../node_modules/lodash/_createHybrid.js
var composeArgs = require('./_composeArgs'),
composeArgsRight = require('./_composeArgsRight'),
countHolders = require('./_countHolders'),
createCtor = require('./_createCtor'),
createRecurry = require('./_createRecurry'),
getHolder = require('./_getHolder'),
reorder = require('./_reorder'),
replaceHolders = require('./_replaceHolders'),
root = require('./_root');
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_ARY_FLAG = 128,
WRAP_FLIP_FLAG = 512;
/**
* Creates a function that wraps `func` to invoke it with optional `this`
* binding of `thisArg`, partial application, and currying.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [partialsRight] The arguments to append to those provided
* to the new function.
* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
var isAry = bitmask & WRAP_ARY_FLAG,
isBind = bitmask & WRAP_BIND_FLAG,
isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
isFlip = bitmask & WRAP_FLIP_FLAG,
Ctor = isBindKey ? undefined : createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length;
while (index--) {
args[index] = arguments[index];
}
if (isCurried) {
var placeholder = getHolder(wrapper),
holdersCount = countHolders(args, placeholder);
}
if (partials) {
args = composeArgs(args, partials, holders, isCurried);
}
if (partialsRight) {
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
}
length -= holdersCount;
if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder);
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, thisArg,
args, newHolders, argPos, ary, arity - length
);
}
var thisBinding = isBind ? thisArg : this,
fn = isBindKey ? thisBinding[func] : func;
length = args.length;
if (argPos) {
args = reorder(args, argPos);
} else if (isFlip && length > 1) {
args.reverse();
}
if (isAry && ary < length) {
args.length = ary;
}
if (this && this !== root && this instanceof wrapper) {
fn = Ctor || createCtor(fn);
}
return fn.apply(thisBinding, args);
}
return wrapper;
}
module.exports = createHybrid;
webpack://frontend-tpt/../../node_modules/lodash/_createPartial.js
var apply = require('./_apply'),
createCtor = require('./_createCtor'),
root = require('./_root');
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1;
/**
* Creates a function that wraps `func` to invoke it with the `this` binding
* of `thisArg` and `partials` prepended to the arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} partials The arguments to prepend to those provided to
* the new function.
* @returns {Function} Returns the new wrapped function.
*/
function createPartial(func, bitmask, thisArg, partials) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var argsIndex = -1,
argsLength = arguments.length,
leftIndex = -1,
leftLength = partials.length,
args = Array(leftLength + argsLength),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
while (++leftIndex < leftLength) {
args[leftIndex] = partials[leftIndex];
}
while (argsLength--) {
args[leftIndex++] = arguments[++argsIndex];
}
return apply(fn, isBind ? thisArg : this, args);
}
return wrapper;
}
module.exports = createPartial;
webpack://frontend-tpt/../../node_modules/lodash/_createRecurry.js
var isLaziable = require('./_isLaziable'),
setData = require('./_setData'),
setWrapToString = require('./_setWrapToString');
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64;
/**
* Creates a function that wraps `func` to continue currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {Function} wrapFunc The function to create the `func` wrapper.
* @param {*} placeholder The placeholder value.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
var isCurry = bitmask & WRAP_CURRY_FLAG,
newHolders = isCurry ? holders : undefined,
newHoldersRight = isCurry ? undefined : holders,
newPartials = isCurry ? partials : undefined,
newPartialsRight = isCurry ? undefined : partials;
bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
}
var newData = [
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
newHoldersRight, argPos, ary, arity
];
var result = wrapFunc.apply(undefined, newData);
if (isLaziable(func)) {
setData(result, newData);
}
result.placeholder = placeholder;
return setWrapToString(result, func, bitmask);
}
module.exports = createRecurry;
webpack://frontend-tpt/../../node_modules/lodash/_createSet.js
var Set = require('./_Set'),
noop = require('./noop'),
setToArray = require('./_setToArray');
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
module.exports = createSet;
webpack://frontend-tpt/../../node_modules/lodash/_createToPairs.js
var baseToPairs = require('./_baseToPairs'),
getTag = require('./_getTag'),
mapToArray = require('./_mapToArray'),
setToPairs = require('./_setToPairs');
/** `Object#toString` result references. */
var mapTag = '[object Map]',
setTag = '[object Set]';
/**
* Creates a `_.toPairs` or `_.toPairsIn` function.
*
* @private
* @param {Function} keysFunc The function to get the keys of a given object.
* @returns {Function} Returns the new pairs function.
*/
function createToPairs(keysFunc) {
return function(object) {
var tag = getTag(object);
if (tag == mapTag) {
return mapToArray(object);
}
if (tag == setTag) {
return setToPairs(object);
}
return baseToPairs(object, keysFunc(object));
};
}
module.exports = createToPairs;
webpack://frontend-tpt/../../node_modules/lodash/_createWrap.js
var baseSetData = require('./_baseSetData'),
createBind = require('./_createBind'),
createCurry = require('./_createCurry'),
createHybrid = require('./_createHybrid'),
createPartial = require('./_createPartial'),
getData = require('./_getData'),
mergeData = require('./_mergeData'),
setData = require('./_setData'),
setWrapToString = require('./_setWrapToString'),
toInteger = require('./toInteger');
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates a function that either curries or invokes `func` with optional
* `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags.
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry` or `_.curryRight` of a bound function
* 8 - `_.curry`
* 16 - `_.curryRight`
* 32 - `_.partial`
* 64 - `_.partialRight`
* 128 - `_.rearg`
* 256 - `_.ary`
* 512 - `_.flip`
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to be partially applied.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
if (!isBindKey && typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
partials = holders = undefined;
}
ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
arity = arity === undefined ? arity : toInteger(arity);
length -= holders ? holders.length : 0;
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
var partialsRight = partials,
holdersRight = holders;
partials = holders = undefined;
}
var data = isBindKey ? undefined : getData(func);
var newData = [
func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
argPos, ary, arity
];
if (data) {
mergeData(newData, data);
}
func = newData[0];
bitmask = newData[1];
thisArg = newData[2];
partials = newData[3];
holders = newData[4];
arity = newData[9] = newData[9] === undefined
? (isBindKey ? 0 : func.length)
: nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
}
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
var result = createBind(func, bitmask, thisArg);
} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
result = createCurry(func, bitmask, arity);
} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
result = createPartial(func, bitmask, thisArg, partials);
} else {
result = createHybrid.apply(undefined, newData);
}
var setter = data ? baseSetData : setData;
return setWrapToString(setter(result, newData), func, bitmask);
}
module.exports = createWrap;
webpack://frontend-tpt/../../node_modules/lodash/_customOmitClone.js
var isPlainObject = require('./isPlainObject');
/**
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
* objects.
*
* @private
* @param {*} value The value to inspect.
* @param {string} key The key of the property to inspect.
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
*/
function customOmitClone(value) {
return isPlainObject(value) ? undefined : value;
}
module.exports = customOmitClone;
webpack://frontend-tpt/../../node_modules/lodash/_deburrLetter.js
var basePropertyOf = require('./_basePropertyOf');
/** Used to map Latin Unicode letters to basic Latin letters. */
var deburredLetters = {
// Latin-1 Supplement block.
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
'\xc7': 'C', '\xe7': 'c',
'\xd0': 'D', '\xf0': 'd',
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
'\xc6': 'Ae', '\xe6': 'ae',
'\xde': 'Th', '\xfe': 'th',
'\xdf': 'ss',
// Latin Extended-A block.
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
'\u0134': 'J', '\u0135': 'j',
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
'\u0163': 't', '\u0165': 't', '\u0167': 't',
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
'\u0174': 'W', '\u0175': 'w',
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
'\u0132': 'IJ', '\u0133': 'ij',
'\u0152': 'Oe', '\u0153': 'oe',
'\u0149': "'n", '\u017f': 's'
};
/**
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
* letters to basic Latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
var deburrLetter = basePropertyOf(deburredLetters);
module.exports = deburrLetter;
webpack://frontend-tpt/../../node_modules/lodash/_defineProperty.js
var getNative = require('./_getNative');
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
webpack://frontend-tpt/../../node_modules/lodash/_equalArrays.js
var SetCache = require('./_SetCache'),
arraySome = require('./_arraySome'),
cacheHas = require('./_cacheHas');
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Check that cyclic values are equal.
var arrStacked = stack.get(array);
var othStacked = stack.get(other);
if (arrStacked && othStacked) {
return arrStacked == other && othStacked == array;
}
var index = -1,
result = true,
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
module.exports = equalArrays;
webpack://frontend-tpt/../../node_modules/lodash/_equalByTag.js
var Symbol = require('./_Symbol'),
Uint8Array = require('./_Uint8Array'),
eq = require('./eq'),
equalArrays = require('./_equalArrays'),
mapToArray = require('./_mapToArray'),
setToArray = require('./_setToArray');
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]';
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
module.exports = equalByTag;
webpack://frontend-tpt/../../node_modules/lodash/_equalObjects.js
var getAllKeys = require('./_getAllKeys');
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
objProps = getAllKeys(object),
objLength = objProps.length,
othProps = getAllKeys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false;
}
}
// Check that cyclic values are equal.
var objStacked = stack.get(object);
var othStacked = stack.get(other);
if (objStacked && othStacked) {
return objStacked == other && othStacked == object;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
module.exports = equalObjects;
webpack://frontend-tpt/../../node_modules/lodash/_flatRest.js
var flatten = require('./flatten'),
overRest = require('./_overRest'),
setToString = require('./_setToString');
/**
* A specialized version of `baseRest` which flattens the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
function flatRest(func) {
return setToString(overRest(func, undefined, flatten), func + '');
}
module.exports = flatRest;
webpack://frontend-tpt/../../node_modules/lodash/_freeGlobal.js
/** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; module.exports = freeGlobal;
webpack://frontend-tpt/../../node_modules/lodash/_getAllKeys.js
var baseGetAllKeys = require('./_baseGetAllKeys'),
getSymbols = require('./_getSymbols'),
keys = require('./keys');
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
module.exports = getAllKeys;
webpack://frontend-tpt/../../node_modules/lodash/_getAllKeysIn.js
var baseGetAllKeys = require('./_baseGetAllKeys'),
getSymbolsIn = require('./_getSymbolsIn'),
keysIn = require('./keysIn');
/**
* Creates an array of own and inherited enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
module.exports = getAllKeysIn;
webpack://frontend-tpt/../../node_modules/lodash/_getData.js
var metaMap = require('./_metaMap'),
noop = require('./noop');
/**
* Gets metadata for `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
var getData = !metaMap ? noop : function(func) {
return metaMap.get(func);
};
module.exports = getData;
webpack://frontend-tpt/../../node_modules/lodash/_getFuncName.js
var realNames = require('./_realNames');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the name of `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
function getFuncName(func) {
var result = (func.name + ''),
array = realNames[result],
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
while (length--) {
var data = array[length],
otherFunc = data.func;
if (otherFunc == null || otherFunc == func) {
return data.name;
}
}
return result;
}
module.exports = getFuncName;
webpack://frontend-tpt/../../node_modules/lodash/_getHolder.js
/**
* Gets the argument placeholder value for `func`.
*
* @private
* @param {Function} func The function to inspect.
* @returns {*} Returns the placeholder value.
*/
function getHolder(func) {
var object = func;
return object.placeholder;
}
module.exports = getHolder;
webpack://frontend-tpt/../../node_modules/lodash/_getMapData.js
var isKeyable = require('./_isKeyable');
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
module.exports = getMapData;
webpack://frontend-tpt/../../node_modules/lodash/_getMatchData.js
var isStrictComparable = require('./_isStrictComparable'),
keys = require('./keys');
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
module.exports = getMatchData;
webpack://frontend-tpt/../../node_modules/lodash/_getNative.js
var baseIsNative = require('./_baseIsNative'),
getValue = require('./_getValue');
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;
webpack://frontend-tpt/../../node_modules/lodash/_getPrototype.js
var overArg = require('./_overArg');
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
webpack://frontend-tpt/../../node_modules/lodash/_getRawTag.js
var Symbol = require('./_Symbol');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;
webpack://frontend-tpt/../../node_modules/lodash/_getSymbols.js
var arrayFilter = require('./_arrayFilter'),
stubArray = require('./stubArray');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
module.exports = getSymbols;
webpack://frontend-tpt/../../node_modules/lodash/_getSymbolsIn.js
var arrayPush = require('./_arrayPush'),
getPrototype = require('./_getPrototype'),
getSymbols = require('./_getSymbols'),
stubArray = require('./stubArray');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;
webpack://frontend-tpt/../../node_modules/lodash/_getTag.js
var DataView = require('./_DataView'),
Map = require('./_Map'),
Promise = require('./_Promise'),
Set = require('./_Set'),
WeakMap = require('./_WeakMap'),
baseGetTag = require('./_baseGetTag'),
toSource = require('./_toSource');
/** `Object#toString` result references. */
var mapTag = '[object Map]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag;
}
}
return result;
};
}
module.exports = getTag;
webpack://frontend-tpt/../../node_modules/lodash/_getValue.js
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
module.exports = getValue;
webpack://frontend-tpt/../../node_modules/lodash/_getWrapDetails.js
/** Used to match wrap detail comments. */
var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
reSplitDetails = /,? & /;
/**
* Extracts wrapper details from the `source` body comment.
*
* @private
* @param {string} source The source to inspect.
* @returns {Array} Returns the wrapper details.
*/
function getWrapDetails(source) {
var match = source.match(reWrapDetails);
return match ? match[1].split(reSplitDetails) : [];
}
module.exports = getWrapDetails;
webpack://frontend-tpt/../../node_modules/lodash/_hasPath.js
var castPath = require('./_castPath'),
isArguments = require('./isArguments'),
isArray = require('./isArray'),
isIndex = require('./_isIndex'),
isLength = require('./isLength'),
toKey = require('./_toKey');
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object));
}
module.exports = hasPath;
webpack://frontend-tpt/../../node_modules/lodash/_hasUnicode.js
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsVarRange = '\\ufe0e\\ufe0f';
/** Used to compose unicode capture groups. */
var rsZWJ = '\\u200d';
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
/**
* Checks if `string` contains Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a symbol is found, else `false`.
*/
function hasUnicode(string) {
return reHasUnicode.test(string);
}
module.exports = hasUnicode;
webpack://frontend-tpt/../../node_modules/lodash/_hasUnicodeWord.js
/** Used to detect strings that need a more robust regexp to match words. */
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/**
* Checks if `string` contains a word composed of Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a word is found, else `false`.
*/
function hasUnicodeWord(string) {
return reHasUnicodeWord.test(string);
}
module.exports = hasUnicodeWord;
webpack://frontend-tpt/../../node_modules/lodash/_hashClear.js
var nativeCreate = require('./_nativeCreate');
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
module.exports = hashClear;
webpack://frontend-tpt/../../node_modules/lodash/_hashDelete.js
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
module.exports = hashDelete;
webpack://frontend-tpt/../../node_modules/lodash/_hashGet.js
var nativeCreate = require('./_nativeCreate');
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
module.exports = hashGet;
webpack://frontend-tpt/../../node_modules/lodash/_hashHas.js
var nativeCreate = require('./_nativeCreate');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
module.exports = hashHas;
webpack://frontend-tpt/../../node_modules/lodash/_hashSet.js
var nativeCreate = require('./_nativeCreate');
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;
webpack://frontend-tpt/../../node_modules/lodash/_initCloneArray.js
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = new array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
module.exports = initCloneArray;
webpack://frontend-tpt/../../node_modules/lodash/_initCloneByTag.js
var cloneArrayBuffer = require('./_cloneArrayBuffer'),
cloneDataView = require('./_cloneDataView'),
cloneRegExp = require('./_cloneRegExp'),
cloneSymbol = require('./_cloneSymbol'),
cloneTypedArray = require('./_cloneTypedArray');
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return new Ctor;
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return new Ctor;
case symbolTag:
return cloneSymbol(object);
}
}
module.exports = initCloneByTag;
webpack://frontend-tpt/../../node_modules/lodash/_initCloneObject.js
var baseCreate = require('./_baseCreate'),
getPrototype = require('./_getPrototype'),
isPrototype = require('./_isPrototype');
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object))
: {};
}
module.exports = initCloneObject;
webpack://frontend-tpt/../../node_modules/lodash/_insertWrapDetails.js
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
/**
* Inserts wrapper `details` in a comment at the top of the `source` body.
*
* @private
* @param {string} source The source to modify.
* @returns {Array} details The details to insert.
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length;
if (!length) {
return source;
}
var lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
module.exports = insertWrapDetails;
webpack://frontend-tpt/../../node_modules/lodash/_isFlattenable.js
var Symbol = require('./_Symbol'),
isArguments = require('./isArguments'),
isArray = require('./isArray');
/** Built-in value references. */
var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
module.exports = isFlattenable;
webpack://frontend-tpt/../../node_modules/lodash/_isIndex.js
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(type == 'number' ||
(type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length);
}
module.exports = isIndex;
webpack://frontend-tpt/../../node_modules/lodash/_isIterateeCall.js
var eq = require('./eq'),
isArrayLike = require('./isArrayLike'),
isIndex = require('./_isIndex'),
isObject = require('./isObject');
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
module.exports = isIterateeCall;
webpack://frontend-tpt/../../node_modules/lodash/_isKey.js
var isArray = require('./isArray'),
isSymbol = require('./isSymbol');
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/;
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
module.exports = isKey;
webpack://frontend-tpt/../../node_modules/lodash/_isKeyable.js
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
module.exports = isKeyable;
webpack://frontend-tpt/../../node_modules/lodash/_isLaziable.js
var LazyWrapper = require('./_LazyWrapper'),
getData = require('./_getData'),
getFuncName = require('./_getFuncName'),
lodash = require('./wrapperLodash');
/**
* Checks if `func` has a lazy counterpart.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` has a lazy counterpart,
* else `false`.
*/
function isLaziable(func) {
var funcName = getFuncName(func),
other = lodash[funcName];
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
return false;
}
if (func === other) {
return true;
}
var data = getData(other);
return !!data && func === data[0];
}
module.exports = isLaziable;
webpack://frontend-tpt/../../node_modules/lodash/_isMasked.js
var coreJsData = require('./_coreJsData');
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
module.exports = isMasked;
webpack://frontend-tpt/../../node_modules/lodash/_isPrototype.js
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
module.exports = isPrototype;
webpack://frontend-tpt/../../node_modules/lodash/_isStrictComparable.js
var isObject = require('./isObject');
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
module.exports = isStrictComparable;
webpack://frontend-tpt/../../node_modules/lodash/_listCacheClear.js
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
module.exports = listCacheClear;
webpack://frontend-tpt/../../node_modules/lodash/_listCacheDelete.js
var assocIndexOf = require('./_assocIndexOf');
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
module.exports = listCacheDelete;
webpack://frontend-tpt/../../node_modules/lodash/_listCacheGet.js
var assocIndexOf = require('./_assocIndexOf');
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
module.exports = listCacheGet;
webpack://frontend-tpt/../../node_modules/lodash/_listCacheHas.js
var assocIndexOf = require('./_assocIndexOf');
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
module.exports = listCacheHas;
webpack://frontend-tpt/../../node_modules/lodash/_listCacheSet.js
var assocIndexOf = require('./_assocIndexOf');
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
module.exports = listCacheSet;
webpack://frontend-tpt/../../node_modules/lodash/_mapCacheClear.js
var Hash = require('./_Hash'),
ListCache = require('./_ListCache'),
Map = require('./_Map');
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
module.exports = mapCacheClear;
webpack://frontend-tpt/../../node_modules/lodash/_mapCacheDelete.js
var getMapData = require('./_getMapData');
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
module.exports = mapCacheDelete;
webpack://frontend-tpt/../../node_modules/lodash/_mapCacheGet.js
var getMapData = require('./_getMapData');
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
module.exports = mapCacheGet;
webpack://frontend-tpt/../../node_modules/lodash/_mapCacheHas.js
var getMapData = require('./_getMapData');
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
module.exports = mapCacheHas;
webpack://frontend-tpt/../../node_modules/lodash/_mapCacheSet.js
var getMapData = require('./_getMapData');
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;
webpack://frontend-tpt/../../node_modules/lodash/_mapToArray.js
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
module.exports = mapToArray;
webpack://frontend-tpt/../../node_modules/lodash/_matchesStrictComparable.js
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object)));
};
}
module.exports = matchesStrictComparable;
webpack://frontend-tpt/../../node_modules/lodash/_memoizeCapped.js
var memoize = require('./memoize');
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
module.exports = memoizeCapped;
webpack://frontend-tpt/../../node_modules/lodash/_mergeData.js
var composeArgs = require('./_composeArgs'),
composeArgsRight = require('./_composeArgsRight'),
replaceHolders = require('./_replaceHolders');
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
* may be applied regardless of execution order. Methods like `_.ary` and
* `_.rearg` modify function arguments, making the order in which they are
* executed important, preventing the merging of metadata. However, we make
* an exception for a safe combined case where curried functions have `_.ary`
* and or `_.rearg` applied.
*
* @private
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo =
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
// Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) {
return data;
}
// Use source `thisArg` if available.
if (srcBitmask & WRAP_BIND_FLAG) {
data[2] = source[2];
// Set when currying a bound function.
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
}
// Compose partial arguments.
var value = source[3];
if (value) {
var partials = data[3];
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
}
// Compose partial right arguments.
value = source[5];
if (value) {
partials = data[5];
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
}
// Use source `argPos` if available.
value = source[7];
if (value) {
data[7] = value;
}
// Use source `ary` if it's smaller.
if (srcBitmask & WRAP_ARY_FLAG) {
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
}
// Use source `arity` if one is not provided.
if (data[9] == null) {
data[9] = source[9];
}
// Use source `func` and merge bitmasks.
data[0] = source[0];
data[1] = newBitmask;
return data;
}
module.exports = mergeData;
webpack://frontend-tpt/../../node_modules/lodash/_metaMap.js
var WeakMap = require('./_WeakMap');
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
module.exports = metaMap;
webpack://frontend-tpt/../../node_modules/lodash/_nativeCreate.js
var getNative = require('./_getNative');
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
webpack://frontend-tpt/../../node_modules/lodash/_nativeKeys.js
var overArg = require('./_overArg');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
webpack://frontend-tpt/../../node_modules/lodash/_nativeKeysIn.js
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
module.exports = nativeKeysIn;
webpack://frontend-tpt/../../node_modules/lodash/_nodeUtil.js
var freeGlobal = require('./_freeGlobal');
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
// Use `util.types` for Node.js 10+.
var types = freeModule && freeModule.require && freeModule.require('util').types;
if (types) {
return types;
}
// Legacy `process.binding('util')` for Node.js < 10.
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
module.exports = nodeUtil;
webpack://frontend-tpt/../../node_modules/lodash/_objectToString.js
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
module.exports = objectToString;
webpack://frontend-tpt/../../node_modules/lodash/_overArg.js
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
webpack://frontend-tpt/../../node_modules/lodash/_overRest.js
var apply = require('./_apply');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
module.exports = overRest;
webpack://frontend-tpt/../../node_modules/lodash/_parent.js
var baseGet = require('./_baseGet'),
baseSlice = require('./_baseSlice');
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
module.exports = parent;
webpack://frontend-tpt/../../node_modules/lodash/_realNames.js
/** Used to lookup unminified function names. */
var realNames = {};
module.exports = realNames;
webpack://frontend-tpt/../../node_modules/lodash/_reorder.js
var copyArray = require('./_copyArray'),
isIndex = require('./_isIndex');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Reorder `array` according to the specified indexes where the element at
* the first index is assigned as the first element, the element at
* the second index is assigned as the second element, and so on.
*
* @private
* @param {Array} array The array to reorder.
* @param {Array} indexes The arranged array indexes.
* @returns {Array} Returns `array`.
*/
function reorder(array, indexes) {
var arrLength = array.length,
length = nativeMin(indexes.length, arrLength),
oldArray = copyArray(array);
while (length--) {
var index = indexes[length];
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
}
return array;
}
module.exports = reorder;
webpack://frontend-tpt/../../node_modules/lodash/_replaceHolders.js
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/**
* Replaces all `placeholder` elements in `array` with an internal placeholder
* and returns an array of their indexes.
*
* @private
* @param {Array} array The array to modify.
* @param {*} placeholder The placeholder to replace.
* @returns {Array} Returns the new array of placeholder indexes.
*/
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value === placeholder || value === PLACEHOLDER) {
array[index] = PLACEHOLDER;
result[resIndex++] = index;
}
}
return result;
}
module.exports = replaceHolders;
webpack://frontend-tpt/../../node_modules/lodash/_root.js
var freeGlobal = require('./_freeGlobal');
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
webpack://frontend-tpt/../../node_modules/lodash/_safeGet.js
/**
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function safeGet(object, key) {
if (key === 'constructor' && typeof object[key] === 'function') {
return;
}
if (key == '__proto__') {
return;
}
return object[key];
}
module.exports = safeGet;
webpack://frontend-tpt/../../node_modules/lodash/_setCacheAdd.js
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
module.exports = setCacheAdd;
webpack://frontend-tpt/../../node_modules/lodash/_setCacheHas.js
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
module.exports = setCacheHas;
webpack://frontend-tpt/../../node_modules/lodash/_setData.js
var baseSetData = require('./_baseSetData'),
shortOut = require('./_shortOut');
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity
* function to avoid garbage collection pauses in V8. See
* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
* for more details.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var setData = shortOut(baseSetData);
module.exports = setData;
webpack://frontend-tpt/../../node_modules/lodash/_setToArray.js
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
module.exports = setToArray;
webpack://frontend-tpt/../../node_modules/lodash/_setToPairs.js
/**
* Converts `set` to its value-value pairs.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the value-value pairs.
*/
function setToPairs(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = [value, value];
});
return result;
}
module.exports = setToPairs;
webpack://frontend-tpt/../../node_modules/lodash/_setToString.js
var baseSetToString = require('./_baseSetToString'),
shortOut = require('./_shortOut');
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
module.exports = setToString;
webpack://frontend-tpt/../../node_modules/lodash/_setWrapToString.js
var getWrapDetails = require('./_getWrapDetails'),
insertWrapDetails = require('./_insertWrapDetails'),
setToString = require('./_setToString'),
updateWrapDetails = require('./_updateWrapDetails');
/**
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
* with wrapper details in a comment at the top of the source body.
*
* @private
* @param {Function} wrapper The function to modify.
* @param {Function} reference The reference function.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Function} Returns `wrapper`.
*/
function setWrapToString(wrapper, reference, bitmask) {
var source = (reference + '');
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
}
module.exports = setWrapToString;
webpack://frontend-tpt/../../node_modules/lodash/_shortOut.js
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
module.exports = shortOut;
webpack://frontend-tpt/../../node_modules/lodash/_stackClear.js
var ListCache = require('./_ListCache');
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
module.exports = stackClear;
webpack://frontend-tpt/../../node_modules/lodash/_stackDelete.js
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
module.exports = stackDelete;
webpack://frontend-tpt/../../node_modules/lodash/_stackGet.js
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
module.exports = stackGet;
webpack://frontend-tpt/../../node_modules/lodash/_stackHas.js
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
module.exports = stackHas;
webpack://frontend-tpt/../../node_modules/lodash/_stackSet.js
var ListCache = require('./_ListCache'),
Map = require('./_Map'),
MapCache = require('./_MapCache');
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
module.exports = stackSet;
webpack://frontend-tpt/../../node_modules/lodash/_strictIndexOf.js
/**
* A specialized version of `_.indexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
module.exports = strictIndexOf;
webpack://frontend-tpt/../../node_modules/lodash/_stringSize.js
var asciiSize = require('./_asciiSize'),
hasUnicode = require('./_hasUnicode'),
unicodeSize = require('./_unicodeSize');
/**
* Gets the number of symbols in `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the string size.
*/
function stringSize(string) {
return hasUnicode(string)
? unicodeSize(string)
: asciiSize(string);
}
module.exports = stringSize;
webpack://frontend-tpt/../../node_modules/lodash/_stringToArray.js
var asciiToArray = require('./_asciiToArray'),
hasUnicode = require('./_hasUnicode'),
unicodeToArray = require('./_unicodeToArray');
/**
* Converts `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function stringToArray(string) {
return hasUnicode(string)
? unicodeToArray(string)
: asciiToArray(string);
}
module.exports = stringToArray;
webpack://frontend-tpt/../../node_modules/lodash/_stringToPath.js
var memoizeCapped = require('./_memoizeCapped');
/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (string.charCodeAt(0) === 46 /* . */) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
module.exports = stringToPath;
webpack://frontend-tpt/../../node_modules/lodash/_toKey.js
var isSymbol = require('./isSymbol');
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = toKey;
webpack://frontend-tpt/../../node_modules/lodash/_toSource.js
/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
module.exports = toSource;
webpack://frontend-tpt/../../node_modules/lodash/_trimmedEndIndex.js
/** Used to match a single whitespace character. */
var reWhitespace = /\s/;
/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
* character of `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the index of the last non-whitespace character.
*/
function trimmedEndIndex(string) {
var index = string.length;
while (index-- && reWhitespace.test(string.charAt(index))) {}
return index;
}
module.exports = trimmedEndIndex;
webpack://frontend-tpt/../../node_modules/lodash/_unicodeSize.js
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsVarRange = '\\ufe0e\\ufe0f';
/** Used to compose unicode capture groups. */
var rsAstral = '[' + rsAstralRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsFitz = '\\ud83c[\\udffb-\\udfff]',
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
/**
* Gets the size of a Unicode `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
function unicodeSize(string) {
var result = reUnicode.lastIndex = 0;
while (reUnicode.test(string)) {
++result;
}
return result;
}
module.exports = unicodeSize;
webpack://frontend-tpt/../../node_modules/lodash/_unicodeToArray.js
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsVarRange = '\\ufe0e\\ufe0f';
/** Used to compose unicode capture groups. */
var rsAstral = '[' + rsAstralRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsFitz = '\\ud83c[\\udffb-\\udfff]',
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
/**
* Converts a Unicode `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function unicodeToArray(string) {
return string.match(reUnicode) || [];
}
module.exports = unicodeToArray;
webpack://frontend-tpt/../../node_modules/lodash/_unicodeWords.js
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsDingbatRange = '\\u2700-\\u27bf',
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
rsPunctuationRange = '\\u2000-\\u206f',
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
rsVarRange = '\\ufe0e\\ufe0f',
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]",
rsBreak = '[' + rsBreakRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsDigits = '\\d+',
rsDingbat = '[' + rsDingbatRange + ']',
rsLower = '[' + rsLowerRange + ']',
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
rsFitz = '\\ud83c[\\udffb-\\udfff]',
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsUpper = '[' + rsUpperRange + ']',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
/** Used to match complex or compound words. */
var reUnicodeWord = RegExp([
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
rsUpper + '+' + rsOptContrUpper,
rsOrdUpper,
rsOrdLower,
rsDigits,
rsEmoji
].join('|'), 'g');
/**
* Splits a Unicode `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function unicodeWords(string) {
return string.match(reUnicodeWord) || [];
}
module.exports = unicodeWords;
webpack://frontend-tpt/../../node_modules/lodash/_updateWrapDetails.js
var arrayEach = require('./_arrayEach'),
arrayIncludes = require('./_arrayIncludes');
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256,
WRAP_FLIP_FLAG = 512;
/** Used to associate wrap methods with their bit flags. */
var wrapFlags = [
['ary', WRAP_ARY_FLAG],
['bind', WRAP_BIND_FLAG],
['bindKey', WRAP_BIND_KEY_FLAG],
['curry', WRAP_CURRY_FLAG],
['curryRight', WRAP_CURRY_RIGHT_FLAG],
['flip', WRAP_FLIP_FLAG],
['partial', WRAP_PARTIAL_FLAG],
['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
['rearg', WRAP_REARG_FLAG]
];
/**
* Updates wrapper `details` based on `bitmask` flags.
*
* @private
* @returns {Array} details The details to modify.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Array} Returns `details`.
*/
function updateWrapDetails(details, bitmask) {
arrayEach(wrapFlags, function(pair) {
var value = '_.' + pair[0];
if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
details.push(value);
}
});
return details.sort();
}
module.exports = updateWrapDetails;
webpack://frontend-tpt/../../node_modules/lodash/_wrapperClone.js
var LazyWrapper = require('./_LazyWrapper'),
LodashWrapper = require('./_LodashWrapper'),
copyArray = require('./_copyArray');
/**
* Creates a clone of `wrapper`.
*
* @private
* @param {Object} wrapper The wrapper to clone.
* @returns {Object} Returns the cloned wrapper.
*/
function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
module.exports = wrapperClone;
webpack://frontend-tpt/../../node_modules/lodash/ary.js
var createWrap = require('./_createWrap');
/** Used to compose bitmasks for function metadata. */
var WRAP_ARY_FLAG = 128;
/**
* Creates a function that invokes `func`, with up to `n` arguments,
* ignoring any additional arguments.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @param {number} [n=func.length] The arity cap.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
* // => [6, 8, 10]
*/
function ary(func, n, guard) {
n = guard ? undefined : n;
n = (func && n == null) ? func.length : n;
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
}
module.exports = ary;
webpack://frontend-tpt/../../node_modules/lodash/attempt.js
var apply = require('./_apply'),
baseRest = require('./_baseRest'),
isError = require('./isError');
/**
* Attempts to invoke `func`, returning either the result or the caught error
* object. Any additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Function} func The function to attempt.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {*} Returns the `func` result or error object.
* @example
*
* // Avoid throwing errors for invalid selectors.
* var elements = _.attempt(function(selector) {
* return document.querySelectorAll(selector);
* }, '>_>');
*
* if (_.isError(elements)) {
* elements = [];
* }
*/
var attempt = baseRest(function(func, args) {
try {
return apply(func, undefined, args);
} catch (e) {
return isError(e) ? e : new Error(e);
}
});
module.exports = attempt;
webpack://frontend-tpt/../../node_modules/lodash/bind.js
var baseRest = require('./_baseRest'),
createWrap = require('./_createWrap'),
getHolder = require('./_getHolder'),
replaceHolders = require('./_replaceHolders');
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_PARTIAL_FLAG = 32;
/**
* Creates a function that invokes `func` with the `this` binding of `thisArg`
* and `partials` prepended to the arguments it receives.
*
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for partially applied arguments.
*
* **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
* property of bound functions.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to bind.
* @param {*} thisArg The `this` binding of `func`.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* function greet(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
*
* var object = { 'user': 'fred' };
*
* var bound = _.bind(greet, object, 'hi');
* bound('!');
* // => 'hi fred!'
*
* // Bound with placeholders.
* var bound = _.bind(greet, object, _, '!');
* bound('hi');
* // => 'hi fred!'
*/
var bind = baseRest(function(func, thisArg, partials) {
var bitmask = WRAP_BIND_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bind));
bitmask |= WRAP_PARTIAL_FLAG;
}
return createWrap(func, bitmask, thisArg, partials, holders);
});
// Assign default placeholders.
bind.placeholder = {};
module.exports = bind;
webpack://frontend-tpt/../../node_modules/lodash/bindAll.js
var arrayEach = require('./_arrayEach'),
baseAssignValue = require('./_baseAssignValue'),
bind = require('./bind'),
flatRest = require('./_flatRest'),
toKey = require('./_toKey');
/**
* Binds methods of an object to the object itself, overwriting the existing
* method.
*
* **Note:** This method doesn't set the "length" property of bound functions.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {Object} object The object to bind and assign the bound methods to.
* @param {...(string|string[])} methodNames The object method names to bind.
* @returns {Object} Returns `object`.
* @example
*
* var view = {
* 'label': 'docs',
* 'click': function() {
* console.log('clicked ' + this.label);
* }
* };
*
* _.bindAll(view, ['click']);
* jQuery(element).on('click', view.click);
* // => Logs 'clicked docs' when clicked.
*/
var bindAll = flatRest(function(object, methodNames) {
arrayEach(methodNames, function(key) {
key = toKey(key);
baseAssignValue(object, key, bind(object[key], object));
});
return object;
});
module.exports = bindAll;
webpack://frontend-tpt/../../node_modules/lodash/capitalize.js
var toString = require('./toString'),
upperFirst = require('./upperFirst');
/**
* Converts the first character of `string` to upper case and the remaining
* to lower case.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to capitalize.
* @returns {string} Returns the capitalized string.
* @example
*
* _.capitalize('FRED');
* // => 'Fred'
*/
function capitalize(string) {
return upperFirst(toString(string).toLowerCase());
}
module.exports = capitalize;
webpack://frontend-tpt/../../node_modules/lodash/clone.js
var baseClone = require('./_baseClone');
/** Used to compose bitmasks for cloning. */
var CLONE_SYMBOLS_FLAG = 4;
/**
* Creates a shallow clone of `value`.
*
* **Note:** This method is loosely based on the
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
* and supports cloning arrays, array buffers, booleans, date objects, maps,
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed
* arrays. The own enumerable properties of `arguments` objects are cloned
* as plain objects. An empty object is returned for uncloneable values such
* as error objects, functions, DOM nodes, and WeakMaps.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to clone.
* @returns {*} Returns the cloned value.
* @see _.cloneDeep
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var shallow = _.clone(objects);
* console.log(shallow[0] === objects[0]);
* // => true
*/
function clone(value) {
return baseClone(value, CLONE_SYMBOLS_FLAG);
}
module.exports = clone;
webpack://frontend-tpt/../../node_modules/lodash/cloneDeep.js
var baseClone = require('./_baseClone');
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_SYMBOLS_FLAG = 4;
/**
* This method is like `_.clone` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @returns {*} Returns the deep cloned value.
* @see _.clone
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var deep = _.cloneDeep(objects);
* console.log(deep[0] === objects[0]);
* // => false
*/
function cloneDeep(value) {
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
module.exports = cloneDeep;
webpack://frontend-tpt/../../node_modules/lodash/compact.js
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are falsey.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to compact.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[resIndex++] = value;
}
}
return result;
}
module.exports = compact;
webpack://frontend-tpt/../../node_modules/lodash/constant.js
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
module.exports = constant;
webpack://frontend-tpt/../../node_modules/lodash/curry.js
var createWrap = require('./_createWrap');
/** Used to compose bitmasks for function metadata. */
var WRAP_CURRY_FLAG = 8;
/**
* Creates a function that accepts arguments of `func` and either invokes
* `func` returning its result, if at least `arity` number of arguments have
* been provided, or returns a function that accepts the remaining `func`
* arguments, and so on. The arity of `func` may be specified if `func.length`
* is not sufficient.
*
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curry(abc);
*
* curried(1)(2)(3);
* // => [1, 2, 3]
*
* curried(1, 2)(3);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(1)(_, 3)(2);
* // => [1, 2, 3]
*/
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
return result;
}
// Assign default placeholders.
curry.placeholder = {};
module.exports = curry;
webpack://frontend-tpt/../../node_modules/lodash/debounce.js
var isObject = require('./isObject'),
now = require('./now'),
toNumber = require('./toNumber');
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
nativeMin = Math.min;
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
timeWaiting = wait - timeSinceLastCall;
return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
clearTimeout(timerId);
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
module.exports = debounce;
webpack://frontend-tpt/../../node_modules/lodash/deburr.js
var deburrLetter = require('./_deburrLetter'),
toString = require('./toString');
/** Used to match Latin Unicode letters (excluding mathematical operators). */
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
/** Used to compose unicode character classes. */
var rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
/** Used to compose unicode capture groups. */
var rsCombo = '[' + rsComboRange + ']';
/**
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
*/
var reComboMark = RegExp(rsCombo, 'g');
/**
* Deburrs `string` by converting
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
* letters to basic Latin letters and removing
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to deburr.
* @returns {string} Returns the deburred string.
* @example
*
* _.deburr('déjà vu');
* // => 'deja vu'
*/
function deburr(string) {
string = toString(string);
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
}
module.exports = deburr;
webpack://frontend-tpt/../../node_modules/lodash/endsWith.js
var baseClamp = require('./_baseClamp'),
baseToString = require('./_baseToString'),
toInteger = require('./toInteger'),
toString = require('./toString');
/**
* Checks if `string` ends with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=string.length] The position to search up to.
* @returns {boolean} Returns `true` if `string` ends with `target`,
* else `false`.
* @example
*
* _.endsWith('abc', 'c');
* // => true
*
* _.endsWith('abc', 'b');
* // => false
*
* _.endsWith('abc', 'b', 2);
* // => true
*/
function endsWith(string, target, position) {
string = toString(string);
target = baseToString(target);
var length = string.length;
position = position === undefined
? length
: baseClamp(toInteger(position), 0, length);
var end = position;
position -= target.length;
return position >= 0 && string.slice(position, end) == target;
}
module.exports = endsWith;
webpack://frontend-tpt/../../node_modules/lodash/eq.js
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
module.exports = eq;
webpack://frontend-tpt/../../node_modules/lodash/escapeRegExp.js
var toString = require('./toString');
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);
/**
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escapeRegExp('[lodash](https://lodash.com/)');
* // => '\[lodash\]\(https://lodash\.com/\)'
*/
function escapeRegExp(string) {
string = toString(string);
return (string && reHasRegExpChar.test(string))
? string.replace(reRegExpChar, '\\$&')
: string;
}
module.exports = escapeRegExp;
webpack://frontend-tpt/../../node_modules/lodash/every.js
var arrayEvery = require('./_arrayEvery'),
baseEvery = require('./_baseEvery'),
baseIteratee = require('./_baseIteratee'),
isArray = require('./isArray'),
isIterateeCall = require('./_isIterateeCall');
/**
* Checks if `predicate` returns truthy for **all** elements of `collection`.
* Iteration is stopped once `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* **Note:** This method returns `true` for
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
* elements of empty collections.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
* @example
*
* _.every([true, 1, null, 'yes'], Boolean);
* // => false
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.every(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.every(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.every(users, 'active');
* // => false
*/
function every(collection, predicate, guard) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, baseIteratee(predicate, 3));
}
module.exports = every;
webpack://frontend-tpt/../../node_modules/lodash/find.js
var createFind = require('./_createFind'),
findIndex = require('./findIndex');
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
module.exports = find;
webpack://frontend-tpt/../../node_modules/lodash/findIndex.js
var baseFindIndex = require('./_baseFindIndex'),
baseIteratee = require('./_baseIteratee'),
toInteger = require('./toInteger');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, baseIteratee(predicate, 3), index);
}
module.exports = findIndex;
webpack://frontend-tpt/../../node_modules/lodash/findKey.js
var baseFindKey = require('./_baseFindKey'),
baseForOwn = require('./_baseForOwn'),
baseIteratee = require('./_baseIteratee');
/**
* This method is like `_.find` except that it returns the key of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findKey(users, function(o) { return o.age < 40; });
* // => 'barney' (iteration order is not guaranteed)
*
* // The `_.matches` iteratee shorthand.
* _.findKey(users, { 'age': 1, 'active': true });
* // => 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findKey(users, 'active');
* // => 'barney'
*/
function findKey(object, predicate) {
return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);
}
module.exports = findKey;
webpack://frontend-tpt/../../node_modules/lodash/first.js
module.exports = require('./head');
webpack://frontend-tpt/../../node_modules/lodash/flatMap.js
var baseFlatten = require('./_baseFlatten'),
map = require('./map');
/**
* Creates a flattened array of values by running each element in `collection`
* thru `iteratee` and flattening the mapped results. The iteratee is invoked
* with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [n, n];
* }
*
* _.flatMap([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMap(collection, iteratee) {
return baseFlatten(map(collection, iteratee), 1);
}
module.exports = flatMap;
webpack://frontend-tpt/../../node_modules/lodash/flatten.js
var baseFlatten = require('./_baseFlatten');
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
module.exports = flatten;
webpack://frontend-tpt/../../node_modules/lodash/forEach.js
var arrayEach = require('./_arrayEach'),
baseEach = require('./_baseEach'),
castFunction = require('./_castFunction'),
isArray = require('./isArray');
/**
* Iterates over elements of `collection` and invokes `iteratee` for each element.
* The iteratee is invoked with three arguments: (value, index|key, collection).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* **Note:** As with other "Collections" methods, objects with a "length"
* property are iterated like arrays. To avoid this behavior use `_.forIn`
* or `_.forOwn` for object iteration.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias each
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEachRight
* @example
*
* _.forEach([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `1` then `2`.
*
* _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forEach(collection, iteratee) {
var func = isArray(collection) ? arrayEach : baseEach;
return func(collection, castFunction(iteratee));
}
module.exports = forEach;
webpack://frontend-tpt/../../node_modules/lodash/fp/_baseConvert.js
var mapping = require('./_mapping'),
fallbackHolder = require('./placeholder');
/** Built-in value reference. */
var push = Array.prototype.push;
/**
* Creates a function, with an arity of `n`, that invokes `func` with the
* arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} n The arity of the new function.
* @returns {Function} Returns the new function.
*/
function baseArity(func, n) {
return n == 2
? function(a, b) { return func.apply(undefined, arguments); }
: function(a) { return func.apply(undefined, arguments); };
}
/**
* Creates a function that invokes `func`, with up to `n` arguments, ignoring
* any additional arguments.
*
* @private
* @param {Function} func The function to cap arguments for.
* @param {number} n The arity cap.
* @returns {Function} Returns the new function.
*/
function baseAry(func, n) {
return n == 2
? function(a, b) { return func(a, b); }
: function(a) { return func(a); };
}
/**
* Creates a clone of `array`.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the cloned array.
*/
function cloneArray(array) {
var length = array ? array.length : 0,
result = Array(length);
while (length--) {
result[length] = array[length];
}
return result;
}
/**
* Creates a function that clones a given object using the assignment `func`.
*
* @private
* @param {Function} func The assignment function.
* @returns {Function} Returns the new cloner function.
*/
function createCloner(func) {
return function(object) {
return func({}, object);
};
}
/**
* A specialized version of `_.spread` which flattens the spread array into
* the arguments of the invoked `func`.
*
* @private
* @param {Function} func The function to spread arguments over.
* @param {number} start The start position of the spread.
* @returns {Function} Returns the new function.
*/
function flatSpread(func, start) {
return function() {
var length = arguments.length,
lastIndex = length - 1,
args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var array = args[start],
otherArgs = args.slice(0, start);
if (array) {
push.apply(otherArgs, array);
}
if (start != lastIndex) {
push.apply(otherArgs, args.slice(start + 1));
}
return func.apply(this, otherArgs);
};
}
/**
* Creates a function that wraps `func` and uses `cloner` to clone the first
* argument it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} cloner The function to clone arguments.
* @returns {Function} Returns the new immutable function.
*/
function wrapImmutable(func, cloner) {
return function() {
var length = arguments.length;
if (!length) {
return;
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var result = args[0] = cloner.apply(undefined, args);
func.apply(undefined, args);
return result;
};
}
/**
* The base implementation of `convert` which accepts a `util` object of methods
* required to perform conversions.
*
* @param {Object} util The util object.
* @param {string} name The name of the function to convert.
* @param {Function} func The function to convert.
* @param {Object} [options] The options object.
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
* @param {boolean} [options.curry=true] Specify currying.
* @param {boolean} [options.fixed=true] Specify fixed arity.
* @param {boolean} [options.immutable=true] Specify immutable operations.
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
* @returns {Function|Object} Returns the converted function or object.
*/
function baseConvert(util, name, func, options) {
var isLib = typeof name == 'function',
isObj = name === Object(name);
if (isObj) {
options = func;
func = name;
name = undefined;
}
if (func == null) {
throw new TypeError;
}
options || (options = {});
var config = {
'cap': 'cap' in options ? options.cap : true,
'curry': 'curry' in options ? options.curry : true,
'fixed': 'fixed' in options ? options.fixed : true,
'immutable': 'immutable' in options ? options.immutable : true,
'rearg': 'rearg' in options ? options.rearg : true
};
var defaultHolder = isLib ? func : fallbackHolder,
forceCurry = ('curry' in options) && options.curry,
forceFixed = ('fixed' in options) && options.fixed,
forceRearg = ('rearg' in options) && options.rearg,
pristine = isLib ? func.runInContext() : undefined;
var helpers = isLib ? func : {
'ary': util.ary,
'assign': util.assign,
'clone': util.clone,
'curry': util.curry,
'forEach': util.forEach,
'isArray': util.isArray,
'isError': util.isError,
'isFunction': util.isFunction,
'isWeakMap': util.isWeakMap,
'iteratee': util.iteratee,
'keys': util.keys,
'rearg': util.rearg,
'toInteger': util.toInteger,
'toPath': util.toPath
};
var ary = helpers.ary,
assign = helpers.assign,
clone = helpers.clone,
curry = helpers.curry,
each = helpers.forEach,
isArray = helpers.isArray,
isError = helpers.isError,
isFunction = helpers.isFunction,
isWeakMap = helpers.isWeakMap,
keys = helpers.keys,
rearg = helpers.rearg,
toInteger = helpers.toInteger,
toPath = helpers.toPath;
var aryMethodKeys = keys(mapping.aryMethod);
var wrappers = {
'castArray': function(castArray) {
return function() {
var value = arguments[0];
return isArray(value)
? castArray(cloneArray(value))
: castArray.apply(undefined, arguments);
};
},
'iteratee': function(iteratee) {
return function() {
var func = arguments[0],
arity = arguments[1],
result = iteratee(func, arity),
length = result.length;
if (config.cap && typeof arity == 'number') {
arity = arity > 2 ? (arity - 2) : 1;
return (length && length <= arity) ? result : baseAry(result, arity);
}
return result;
};
},
'mixin': function(mixin) {
return function(source) {
var func = this;
if (!isFunction(func)) {
return mixin(func, Object(source));
}
var pairs = [];
each(keys(source), function(key) {
if (isFunction(source[key])) {
pairs.push([key, func.prototype[key]]);
}
});
mixin(func, Object(source));
each(pairs, function(pair) {
var value = pair[1];
if (isFunction(value)) {
func.prototype[pair[0]] = value;
} else {
delete func.prototype[pair[0]];
}
});
return func;
};
},
'nthArg': function(nthArg) {
return function(n) {
var arity = n < 0 ? 1 : (toInteger(n) + 1);
return curry(nthArg(n), arity);
};
},
'rearg': function(rearg) {
return function(func, indexes) {
var arity = indexes ? indexes.length : 0;
return curry(rearg(func, indexes), arity);
};
},
'runInContext': function(runInContext) {
return function(context) {
return baseConvert(util, runInContext(context), options);
};
}
};
/*--------------------------------------------------------------------------*/
/**
* Casts `func` to a function with an arity capped iteratee if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @returns {Function} Returns the cast function.
*/
function castCap(name, func) {
if (config.cap) {
var indexes = mapping.iterateeRearg[name];
if (indexes) {
return iterateeRearg(func, indexes);
}
var n = !isLib && mapping.iterateeAry[name];
if (n) {
return iterateeAry(func, n);
}
}
return func;
}
/**
* Casts `func` to a curried function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castCurry(name, func, n) {
return (forceCurry || (config.curry && n > 1))
? curry(func, n)
: func;
}
/**
* Casts `func` to a fixed arity function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity cap.
* @returns {Function} Returns the cast function.
*/
function castFixed(name, func, n) {
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
var data = mapping.methodSpread[name],
start = data && data.start;
return start === undefined ? ary(func, n) : flatSpread(func, start);
}
return func;
}
/**
* Casts `func` to an rearged function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castRearg(name, func, n) {
return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]))
? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n])
: func;
}
/**
* Creates a clone of `object` by `path`.
*
* @private
* @param {Object} object The object to clone.
* @param {Array|string} path The path to clone by.
* @returns {Object} Returns the cloned object.
*/
function cloneByPath(object, path) {
path = toPath(path);
var index = -1,
length = path.length,
lastIndex = length - 1,
result = clone(Object(object)),
nested = result;
while (nested != null && ++index < length) {
var key = path[index],
value = nested[key];
if (value != null &&
!(isFunction(value) || isError(value) || isWeakMap(value))) {
nested[key] = clone(index == lastIndex ? value : Object(value));
}
nested = nested[key];
}
return result;
}
/**
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
* version with conversion `options` applied.
*
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function} Returns the converted `lodash`.
*/
function convertLib(options) {
return _.runInContext.convert(options)(undefined);
}
/**
* Create a converter function for `func` of `name`.
*
* @param {string} name The name of the function to convert.
* @param {Function} func The function to convert.
* @returns {Function} Returns the new converter function.
*/
function createConverter(name, func) {
var realName = mapping.aliasToReal[name] || name,
methodName = mapping.remap[realName] || realName,
oldOptions = options;
return function(options) {
var newUtil = isLib ? pristine : helpers,
newFunc = isLib ? pristine[methodName] : func,
newOptions = assign(assign({}, oldOptions), options);
return baseConvert(newUtil, realName, newFunc, newOptions);
};
}
/**
* Creates a function that wraps `func` to invoke its iteratee, with up to `n`
* arguments, ignoring any additional arguments.
*
* @private
* @param {Function} func The function to cap iteratee arguments for.
* @param {number} n The arity cap.
* @returns {Function} Returns the new function.
*/
function iterateeAry(func, n) {
return overArg(func, function(func) {
return typeof func == 'function' ? baseAry(func, n) : func;
});
}
/**
* Creates a function that wraps `func` to invoke its iteratee with arguments
* arranged according to the specified `indexes` where the argument value at
* the first index is provided as the first argument, the argument value at
* the second index is provided as the second argument, and so on.
*
* @private
* @param {Function} func The function to rearrange iteratee arguments for.
* @param {number[]} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
*/
function iterateeRearg(func, indexes) {
return overArg(func, function(func) {
var n = indexes.length;
return baseArity(rearg(baseAry(func, n), indexes), n);
});
}
/**
* Creates a function that invokes `func` with its first argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function() {
var length = arguments.length;
if (!length) {
return func();
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var index = config.rearg ? 0 : (length - 1);
args[index] = transform(args[index]);
return func.apply(undefined, args);
};
}
/**
* Creates a function that wraps `func` and applys the conversions
* rules by `name`.
*
* @private
* @param {string} name The name of the function to wrap.
* @param {Function} func The function to wrap.
* @returns {Function} Returns the converted function.
*/
function wrap(name, func, placeholder) {
var result,
realName = mapping.aliasToReal[name] || name,
wrapped = func,
wrapper = wrappers[realName];
if (wrapper) {
wrapped = wrapper(func);
}
else if (config.immutable) {
if (mapping.mutate.array[realName]) {
wrapped = wrapImmutable(func, cloneArray);
}
else if (mapping.mutate.object[realName]) {
wrapped = wrapImmutable(func, createCloner(func));
}
else if (mapping.mutate.set[realName]) {
wrapped = wrapImmutable(func, cloneByPath);
}
}
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(otherName) {
if (realName == otherName) {
var data = mapping.methodSpread[realName],
afterRearg = data && data.afterRearg;
result = afterRearg
? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey)
: castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);
result = castCap(realName, result);
result = castCurry(realName, result, aryKey);
return false;
}
});
return !result;
});
result || (result = wrapped);
if (result == func) {
result = forceCurry ? curry(result, 1) : function() {
return func.apply(this, arguments);
};
}
result.convert = createConverter(realName, func);
result.placeholder = func.placeholder = placeholder;
return result;
}
/*--------------------------------------------------------------------------*/
if (!isObj) {
return wrap(name, func, defaultHolder);
}
var _ = func;
// Convert methods by ary cap.
var pairs = [];
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(key) {
var func = _[mapping.remap[key] || key];
if (func) {
pairs.push([key, wrap(key, func, _)]);
}
});
});
// Convert remaining methods.
each(keys(_), function(key) {
var func = _[key];
if (typeof func == 'function') {
var length = pairs.length;
while (length--) {
if (pairs[length][0] == key) {
return;
}
}
func.convert = createConverter(key, func);
pairs.push([key, func]);
}
});
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
each(pairs, function(pair) {
_[pair[0]] = pair[1];
});
_.convert = convertLib;
_.placeholder = _;
// Assign aliases.
each(keys(_), function(key) {
each(mapping.realToAlias[key] || [], function(alias) {
_[alias] = _[key];
});
});
return _;
}
module.exports = baseConvert;
webpack://frontend-tpt/../../node_modules/lodash/fp/_mapping.js
/** Used to map aliases to their real names. */
exports.aliasToReal = {
// Lodash aliases.
'each': 'forEach',
'eachRight': 'forEachRight',
'entries': 'toPairs',
'entriesIn': 'toPairsIn',
'extend': 'assignIn',
'extendAll': 'assignInAll',
'extendAllWith': 'assignInAllWith',
'extendWith': 'assignInWith',
'first': 'head',
// Methods that are curried variants of others.
'conforms': 'conformsTo',
'matches': 'isMatch',
'property': 'get',
// Ramda aliases.
'__': 'placeholder',
'F': 'stubFalse',
'T': 'stubTrue',
'all': 'every',
'allPass': 'overEvery',
'always': 'constant',
'any': 'some',
'anyPass': 'overSome',
'apply': 'spread',
'assoc': 'set',
'assocPath': 'set',
'complement': 'negate',
'compose': 'flowRight',
'contains': 'includes',
'dissoc': 'unset',
'dissocPath': 'unset',
'dropLast': 'dropRight',
'dropLastWhile': 'dropRightWhile',
'equals': 'isEqual',
'identical': 'eq',
'indexBy': 'keyBy',
'init': 'initial',
'invertObj': 'invert',
'juxt': 'over',
'omitAll': 'omit',
'nAry': 'ary',
'path': 'get',
'pathEq': 'matchesProperty',
'pathOr': 'getOr',
'paths': 'at',
'pickAll': 'pick',
'pipe': 'flow',
'pluck': 'map',
'prop': 'get',
'propEq': 'matchesProperty',
'propOr': 'getOr',
'props': 'at',
'symmetricDifference': 'xor',
'symmetricDifferenceBy': 'xorBy',
'symmetricDifferenceWith': 'xorWith',
'takeLast': 'takeRight',
'takeLastWhile': 'takeRightWhile',
'unapply': 'rest',
'unnest': 'flatten',
'useWith': 'overArgs',
'where': 'conformsTo',
'whereEq': 'isMatch',
'zipObj': 'zipObject'
};
/** Used to map ary to method names. */
exports.aryMethod = {
'1': [
'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll',
'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse',
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
'uniqueId', 'words', 'zipAll'
],
'2': [
'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',
'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',
'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',
'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',
'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',
'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',
'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',
'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
'zipObjectDeep'
],
'3': [
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr',
'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith',
'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth',
'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd',
'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight',
'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy',
'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy',
'xorWith', 'zipWith'
],
'4': [
'fill', 'setWith', 'updateWith'
]
};
/** Used to map ary to rearg configs. */
exports.aryRearg = {
'2': [1, 0],
'3': [2, 0, 1],
'4': [3, 2, 0, 1]
};
/** Used to map method names to their iteratee ary. */
exports.iterateeAry = {
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'findFrom': 1,
'findIndex': 1,
'findIndexFrom': 1,
'findKey': 1,
'findLast': 1,
'findLastFrom': 1,
'findLastIndex': 1,
'findLastIndexFrom': 1,
'findLastKey': 1,
'flatMap': 1,
'flatMapDeep': 1,
'flatMapDepth': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
};
/** Used to map method names to iteratee rearg configs. */
exports.iterateeRearg = {
'mapKeys': [1],
'reduceRight': [1, 0]
};
/** Used to map method names to rearg configs. */
exports.methodRearg = {
'assignInAllWith': [1, 0],
'assignInWith': [1, 2, 0],
'assignAllWith': [1, 0],
'assignWith': [1, 2, 0],
'differenceBy': [1, 2, 0],
'differenceWith': [1, 2, 0],
'getOr': [2, 1, 0],
'intersectionBy': [1, 2, 0],
'intersectionWith': [1, 2, 0],
'isEqualWith': [1, 2, 0],
'isMatchWith': [2, 1, 0],
'mergeAllWith': [1, 0],
'mergeWith': [1, 2, 0],
'padChars': [2, 1, 0],
'padCharsEnd': [2, 1, 0],
'padCharsStart': [2, 1, 0],
'pullAllBy': [2, 1, 0],
'pullAllWith': [2, 1, 0],
'rangeStep': [1, 2, 0],
'rangeStepRight': [1, 2, 0],
'setWith': [3, 1, 2, 0],
'sortedIndexBy': [2, 1, 0],
'sortedLastIndexBy': [2, 1, 0],
'unionBy': [1, 2, 0],
'unionWith': [1, 2, 0],
'updateWith': [3, 1, 2, 0],
'xorBy': [1, 2, 0],
'xorWith': [1, 2, 0],
'zipWith': [1, 2, 0]
};
/** Used to map method names to spread configs. */
exports.methodSpread = {
'assignAll': { 'start': 0 },
'assignAllWith': { 'start': 0 },
'assignInAll': { 'start': 0 },
'assignInAllWith': { 'start': 0 },
'defaultsAll': { 'start': 0 },
'defaultsDeepAll': { 'start': 0 },
'invokeArgs': { 'start': 2 },
'invokeArgsMap': { 'start': 2 },
'mergeAll': { 'start': 0 },
'mergeAllWith': { 'start': 0 },
'partial': { 'start': 1 },
'partialRight': { 'start': 1 },
'without': { 'start': 1 },
'zipAll': { 'start': 0 }
};
/** Used to identify methods which mutate arrays or objects. */
exports.mutate = {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAllWith': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignAll': true,
'assignAllWith': true,
'assignIn': true,
'assignInAll': true,
'assignInAllWith': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsAll': true,
'defaultsDeep': true,
'defaultsDeepAll': true,
'merge': true,
'mergeAll': true,
'mergeAllWith': true,
'mergeWith': true,
},
'set': {
'set': true,
'setWith': true,
'unset': true,
'update': true,
'updateWith': true
}
};
/** Used to map real names to their aliases. */
exports.realToAlias = (function() {
var hasOwnProperty = Object.prototype.hasOwnProperty,
object = exports.aliasToReal,
result = {};
for (var key in object) {
var value = object[key];
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
return result;
}());
/** Used to map method names to other names. */
exports.remap = {
'assignAll': 'assign',
'assignAllWith': 'assignWith',
'assignInAll': 'assignIn',
'assignInAllWith': 'assignInWith',
'curryN': 'curry',
'curryRightN': 'curryRight',
'defaultsAll': 'defaults',
'defaultsDeepAll': 'defaultsDeep',
'findFrom': 'find',
'findIndexFrom': 'findIndex',
'findLastFrom': 'findLast',
'findLastIndexFrom': 'findLastIndex',
'getOr': 'get',
'includesFrom': 'includes',
'indexOfFrom': 'indexOf',
'invokeArgs': 'invoke',
'invokeArgsMap': 'invokeMap',
'lastIndexOfFrom': 'lastIndexOf',
'mergeAll': 'merge',
'mergeAllWith': 'mergeWith',
'padChars': 'pad',
'padCharsEnd': 'padEnd',
'padCharsStart': 'padStart',
'propertyOf': 'get',
'rangeStep': 'range',
'rangeStepRight': 'rangeRight',
'restFrom': 'rest',
'spreadFrom': 'spread',
'trimChars': 'trim',
'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart',
'zipAll': 'zip'
};
/** Used to track methods that skip fixing their arity. */
exports.skipFixed = {
'castArray': true,
'flow': true,
'flowRight': true,
'iteratee': true,
'mixin': true,
'rearg': true,
'runInContext': true
};
/** Used to track methods that skip rearranging arguments. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'bind': true,
'bindKey': true,
'concat': true,
'difference': true,
'divide': true,
'eq': true,
'gt': true,
'gte': true,
'isEqual': true,
'lt': true,
'lte': true,
'matchesProperty': true,
'merge': true,
'multiply': true,
'overArgs': true,
'partial': true,
'partialRight': true,
'propertyOf': true,
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true,
'zipObjectDeep': true
};
webpack://frontend-tpt/../../node_modules/lodash/fp/_util.js
module.exports = {
'ary': require('../ary'),
'assign': require('../_baseAssign'),
'clone': require('../clone'),
'curry': require('../curry'),
'forEach': require('../_arrayEach'),
'isArray': require('../isArray'),
'isError': require('../isError'),
'isFunction': require('../isFunction'),
'isWeakMap': require('../isWeakMap'),
'iteratee': require('../iteratee'),
'keys': require('../_baseKeys'),
'rearg': require('../rearg'),
'toInteger': require('../toInteger'),
'toPath': require('../toPath')
};
webpack://frontend-tpt/../../node_modules/lodash/fp/attempt.js
var convert = require('./convert'),
func = convert('attempt', require('../attempt'));
func.placeholder = require('./placeholder');
module.exports = func;
webpack://frontend-tpt/../../node_modules/lodash/fp/convert.js
var baseConvert = require('./_baseConvert'),
util = require('./_util');
/**
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
* version with conversion `options` applied. If `name` is an object its methods
* will be converted.
*
* @param {string} name The name of the function to wrap.
* @param {Function} [func] The function to wrap.
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function|Object} Returns the converted function or object.
*/
function convert(name, func, options) {
return baseConvert(util, name, func, options);
}
module.exports = convert;
webpack://frontend-tpt/../../node_modules/lodash/fp/get.js
var convert = require('./convert'),
func = convert('get', require('../get'));
func.placeholder = require('./placeholder');
module.exports = func;
webpack://frontend-tpt/../../node_modules/lodash/fp/merge.js
var convert = require('./convert'),
func = convert('merge', require('../merge'));
func.placeholder = require('./placeholder');
module.exports = func;
webpack://frontend-tpt/../../node_modules/lodash/fp/placeholder.js
/**
* The default argument placeholder value for methods.
*
* @type {Object}
*/
module.exports = {};
webpack://frontend-tpt/../../node_modules/lodash/fp/set.js
var convert = require('./convert'),
func = convert('set', require('../set'));
func.placeholder = require('./placeholder');
module.exports = func;
webpack://frontend-tpt/../../node_modules/lodash/fp/some.js
var convert = require('./convert'),
func = convert('some', require('../some'));
func.placeholder = require('./placeholder');
module.exports = func;
webpack://frontend-tpt/../../node_modules/lodash/get.js
var baseGet = require('./_baseGet');
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
webpack://frontend-tpt/../../node_modules/lodash/has.js
var baseHas = require('./_baseHas'),
hasPath = require('./_hasPath');
/**
* Checks if `path` is a direct property of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b');
* // => true
*
* _.has(object, ['a', 'b']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
}
module.exports = has;
webpack://frontend-tpt/../../node_modules/lodash/hasIn.js
var baseHasIn = require('./_baseHasIn'),
hasPath = require('./_hasPath');
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
module.exports = hasIn;
webpack://frontend-tpt/../../node_modules/lodash/head.js
/**
* Gets the first element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias first
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the first element of `array`.
* @example
*
* _.head([1, 2, 3]);
* // => 1
*
* _.head([]);
* // => undefined
*/
function head(array) {
return (array && array.length) ? array[0] : undefined;
}
module.exports = head;
webpack://frontend-tpt/../../node_modules/lodash/identity.js
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
webpack://frontend-tpt/../../node_modules/lodash/includes.js
var baseIndexOf = require('./_baseIndexOf'),
isArrayLike = require('./isArrayLike'),
isString = require('./isString'),
toInteger = require('./toInteger'),
values = require('./values');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Checks if `value` is in `collection`. If `collection` is a string, it's
* checked for a substring of `value`, otherwise
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* is used for equality comparisons. If `fromIndex` is negative, it's used as
* the offset from the end of `collection`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {boolean} Returns `true` if `value` is found, else `false`.
* @example
*
* _.includes([1, 2, 3], 1);
* // => true
*
* _.includes([1, 2, 3], 1, 2);
* // => false
*
* _.includes({ 'a': 1, 'b': 2 }, 1);
* // => true
*
* _.includes('abcd', 'bc');
* // => true
*/
function includes(collection, value, fromIndex, guard) {
collection = isArrayLike(collection) ? collection : values(collection);
fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
var length = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return isString(collection)
? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
: (!!length && baseIndexOf(collection, value, fromIndex) > -1);
}
module.exports = includes;
webpack://frontend-tpt/../../node_modules/lodash/indexOf.js
var baseIndexOf = require('./_baseIndexOf'),
toInteger = require('./toInteger');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Gets the index at which the first occurrence of `value` is found in `array`
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. If `fromIndex` is negative, it's used as the
* offset from the end of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.indexOf([1, 2, 1, 2], 2);
* // => 1
*
* // Search from the `fromIndex`.
* _.indexOf([1, 2, 1, 2], 2, 2);
* // => 3
*/
function indexOf(array, value, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseIndexOf(array, value, index);
}
module.exports = indexOf;
webpack://frontend-tpt/../../node_modules/lodash/intersection.js
var arrayMap = require('./_arrayMap'),
baseIntersection = require('./_baseIntersection'),
baseRest = require('./_baseRest'),
castArrayLikeObject = require('./_castArrayLikeObject');
/**
* Creates an array of unique values that are included in all given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersection([2, 1], [2, 3]);
* // => [2]
*/
var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped)
: [];
});
module.exports = intersection;
webpack://frontend-tpt/../../node_modules/lodash/isArguments.js
var baseIsArguments = require('./_baseIsArguments'),
isObjectLike = require('./isObjectLike');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
module.exports = isArguments;
webpack://frontend-tpt/../../node_modules/lodash/isArray.js
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
webpack://frontend-tpt/../../node_modules/lodash/isArrayLike.js
var isFunction = require('./isFunction'),
isLength = require('./isLength');
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
module.exports = isArrayLike;
webpack://frontend-tpt/../../node_modules/lodash/isArrayLikeObject.js
var isArrayLike = require('./isArrayLike'),
isObjectLike = require('./isObjectLike');
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
module.exports = isArrayLikeObject;
webpack://frontend-tpt/../../node_modules/lodash/isBuffer.js
var root = require('./_root'),
stubFalse = require('./stubFalse');
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
module.exports = isBuffer;
webpack://frontend-tpt/../../node_modules/lodash/isEmpty.js
var baseKeys = require('./_baseKeys'),
getTag = require('./_getTag'),
isArguments = require('./isArguments'),
isArray = require('./isArray'),
isArrayLike = require('./isArrayLike'),
isBuffer = require('./isBuffer'),
isPrototype = require('./_isPrototype'),
isTypedArray = require('./isTypedArray');
/** `Object#toString` result references. */
var mapTag = '[object Map]',
setTag = '[object Set]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if `value` is an empty object, collection, map, or set.
*
* Objects are considered empty if they have no own enumerable string keyed
* properties.
*
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
* jQuery-like collections are considered empty if they have a `length` of `0`.
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
* @example
*
* _.isEmpty(null);
* // => true
*
* _.isEmpty(true);
* // => true
*
* _.isEmpty(1);
* // => true
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({ 'a': 1 });
* // => false
*/
function isEmpty(value) {
if (value == null) {
return true;
}
if (isArrayLike(value) &&
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length;
}
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
if (isPrototype(value)) {
return !baseKeys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return true;
}
module.exports = isEmpty;
webpack://frontend-tpt/../../node_modules/lodash/isEqual.js
var baseIsEqual = require('./_baseIsEqual');
/**
* Performs a deep comparison between two values to determine if they are
* equivalent.
*
* **Note:** This method supports comparing arrays, array buffers, booleans,
* date objects, error objects, maps, numbers, `Object` objects, regexes,
* sets, strings, symbols, and typed arrays. `Object` objects are compared
* by their own, not inherited, enumerable properties. Functions and DOM
* nodes are compared by strict equality, i.e. `===`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.isEqual(object, other);
* // => true
*
* object === other;
* // => false
*/
function isEqual(value, other) {
return baseIsEqual(value, other);
}
module.exports = isEqual;
webpack://frontend-tpt/../../node_modules/lodash/isError.js
var baseGetTag = require('./_baseGetTag'),
isObjectLike = require('./isObjectLike'),
isPlainObject = require('./isPlainObject');
/** `Object#toString` result references. */
var domExcTag = '[object DOMException]',
errorTag = '[object Error]';
/**
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
* `SyntaxError`, `TypeError`, or `URIError` object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an error object, else `false`.
* @example
*
* _.isError(new Error);
* // => true
*
* _.isError(Error);
* // => false
*/
function isError(value) {
if (!isObjectLike(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == errorTag || tag == domExcTag ||
(typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
}
module.exports = isError;
webpack://frontend-tpt/../../node_modules/lodash/isFunction.js
var baseGetTag = require('./_baseGetTag'),
isObject = require('./isObject');
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
module.exports = isFunction;
webpack://frontend-tpt/../../node_modules/lodash/isLength.js
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;
webpack://frontend-tpt/../../node_modules/lodash/isMap.js
var baseIsMap = require('./_baseIsMap'),
baseUnary = require('./_baseUnary'),
nodeUtil = require('./_nodeUtil');
/* Node.js helper references. */
var nodeIsMap = nodeUtil && nodeUtil.isMap;
/**
* Checks if `value` is classified as a `Map` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
* @example
*
* _.isMap(new Map);
* // => true
*
* _.isMap(new WeakMap);
* // => false
*/
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
module.exports = isMap;
webpack://frontend-tpt/../../node_modules/lodash/isNaN.js
var isNumber = require('./isNumber');
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is based on
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
* `undefined` and other non-number values.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some
// ActiveX objects in IE.
return isNumber(value) && value != +value;
}
module.exports = isNaN;
webpack://frontend-tpt/../../node_modules/lodash/isNull.js
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
*/
function isNull(value) {
return value === null;
}
module.exports = isNull;
webpack://frontend-tpt/../../node_modules/lodash/isNumber.js
var baseGetTag = require('./_baseGetTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var numberTag = '[object Number]';
/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
* classified as numbers, use the `_.isFinite` method.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
* @example
*
* _.isNumber(3);
* // => true
*
* _.isNumber(Number.MIN_VALUE);
* // => true
*
* _.isNumber(Infinity);
* // => true
*
* _.isNumber('3');
* // => false
*/
function isNumber(value) {
return typeof value == 'number' ||
(isObjectLike(value) && baseGetTag(value) == numberTag);
}
module.exports = isNumber;
webpack://frontend-tpt/../../node_modules/lodash/isObject.js
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
module.exports = isObject;
webpack://frontend-tpt/../../node_modules/lodash/isObjectLike.js
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
webpack://frontend-tpt/../../node_modules/lodash/isPlainObject.js
var baseGetTag = require('./_baseGetTag'),
getPrototype = require('./_getPrototype'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
webpack://frontend-tpt/../../node_modules/lodash/isSet.js
var baseIsSet = require('./_baseIsSet'),
baseUnary = require('./_baseUnary'),
nodeUtil = require('./_nodeUtil');
/* Node.js helper references. */
var nodeIsSet = nodeUtil && nodeUtil.isSet;
/**
* Checks if `value` is classified as a `Set` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
* @example
*
* _.isSet(new Set);
* // => true
*
* _.isSet(new WeakSet);
* // => false
*/
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
module.exports = isSet;
webpack://frontend-tpt/../../node_modules/lodash/isString.js
var baseGetTag = require('./_baseGetTag'),
isArray = require('./isArray'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var stringTag = '[object String]';
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
}
module.exports = isString;
webpack://frontend-tpt/../../node_modules/lodash/isSymbol.js
var baseGetTag = require('./_baseGetTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
}
module.exports = isSymbol;
webpack://frontend-tpt/../../node_modules/lodash/isTypedArray.js
var baseIsTypedArray = require('./_baseIsTypedArray'),
baseUnary = require('./_baseUnary'),
nodeUtil = require('./_nodeUtil');
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
module.exports = isTypedArray;
webpack://frontend-tpt/../../node_modules/lodash/isUndefined.js
/**
* Checks if `value` is `undefined`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
* @example
*
* _.isUndefined(void 0);
* // => true
*
* _.isUndefined(null);
* // => false
*/
function isUndefined(value) {
return value === undefined;
}
module.exports = isUndefined;
webpack://frontend-tpt/../../node_modules/lodash/isWeakMap.js
var getTag = require('./_getTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var weakMapTag = '[object WeakMap]';
/**
* Checks if `value` is classified as a `WeakMap` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
* @example
*
* _.isWeakMap(new WeakMap);
* // => true
*
* _.isWeakMap(new Map);
* // => false
*/
function isWeakMap(value) {
return isObjectLike(value) && getTag(value) == weakMapTag;
}
module.exports = isWeakMap;
webpack://frontend-tpt/../../node_modules/lodash/iteratee.js
var baseClone = require('./_baseClone'),
baseIteratee = require('./_baseIteratee');
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;
/**
* Creates a function that invokes `func` with the arguments of the created
* function. If `func` is a property name, the created function returns the
* property value for a given element. If `func` is an array or object, the
* created function returns `true` for elements that contain the equivalent
* source properties, otherwise it returns `false`.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Util
* @param {*} [func=_.identity] The value to convert to a callback.
* @returns {Function} Returns the callback.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
* // => [{ 'user': 'barney', 'age': 36, 'active': true }]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, _.iteratee(['user', 'fred']));
* // => [{ 'user': 'fred', 'age': 40 }]
*
* // The `_.property` iteratee shorthand.
* _.map(users, _.iteratee('user'));
* // => ['barney', 'fred']
*
* // Create custom iteratee shorthands.
* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
* return !_.isRegExp(func) ? iteratee(func) : function(string) {
* return func.test(string);
* };
* });
*
* _.filter(['abc', 'def'], /ef/);
* // => ['def']
*/
function iteratee(func) {
return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
}
module.exports = iteratee;
webpack://frontend-tpt/../../node_modules/lodash/keys.js
var arrayLikeKeys = require('./_arrayLikeKeys'),
baseKeys = require('./_baseKeys'),
isArrayLike = require('./isArrayLike');
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
module.exports = keys;
webpack://frontend-tpt/../../node_modules/lodash/keysIn.js
var arrayLikeKeys = require('./_arrayLikeKeys'),
baseKeysIn = require('./_baseKeysIn'),
isArrayLike = require('./isArrayLike');
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = keysIn;
webpack://frontend-tpt/../../node_modules/lodash/last.js
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
module.exports = last;
webpack://frontend-tpt/../../node_modules/lodash/lodash.js
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
;(function() {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/** Used as the semantic version number. */
var VERSION = '4.17.21';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Error message constants. */
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
FUNC_ERROR_TEXT = 'Expected a function',
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256,
WRAP_FLIP_FLAG = 512;
/** Used as default options for `_.truncate`. */
var DEFAULT_TRUNC_LENGTH = 30,
DEFAULT_TRUNC_OMISSION = '...';
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/** Used to indicate the type of lazy iteratees. */
var LAZY_FILTER_FLAG = 1,
LAZY_MAP_FLAG = 2,
LAZY_WHILE_FLAG = 3;
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_SAFE_INTEGER = 9007199254740991,
MAX_INTEGER = 1.7976931348623157e+308,
NAN = 0 / 0;
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295,
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
/** Used to associate wrap methods with their bit flags. */
var wrapFlags = [
['ary', WRAP_ARY_FLAG],
['bind', WRAP_BIND_FLAG],
['bindKey', WRAP_BIND_KEY_FLAG],
['curry', WRAP_CURRY_FLAG],
['curryRight', WRAP_CURRY_RIGHT_FLAG],
['flip', WRAP_FLIP_FLAG],
['partial', WRAP_PARTIAL_FLAG],
['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
['rearg', WRAP_REARG_FLAG]
];
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
asyncTag = '[object AsyncFunction]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
domExcTag = '[object DOMException]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
nullTag = '[object Null]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
proxyTag = '[object Proxy]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
undefinedTag = '[object Undefined]',
weakMapTag = '[object WeakMap]',
weakSetTag = '[object WeakSet]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to match empty string literals in compiled template source. */
var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
/** Used to match HTML entities and HTML characters. */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
reUnescapedHtml = /[&<>"']/g,
reHasEscapedHtml = RegExp(reEscapedHtml.source),
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
/** Used to match template delimiters. */
var reEscape = /<%-([\s\S]+?)%>/g,
reEvaluate = /<%([\s\S]+?)%>/g,
reInterpolate = /<%=([\s\S]+?)%>/g;
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);
/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;
/** Used to match a single whitespace character. */
var reWhitespace = /\s/;
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
reSplitDetails = /,? & /;
/** Used to match words composed of alphanumeric characters. */
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
/**
* Used to validate the `validate` option in `_.template` variable.
*
* Forbids characters which could potentially change the meaning of the function argument definition:
* - "()," (modification of function parameters)
* - "=" (default value)
* - "[]{}" (destructuring of function parameters)
* - "/" (beginning of a comment)
* - whitespace
*/
var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Used to match
* [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
*/
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Used to match Latin Unicode letters (excluding mathematical operators). */
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
/** Used to ensure capturing order of template delimiters. */
var reNoMatch = /($^)/;
/** Used to match unescaped characters in compiled string literals. */
var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsDingbatRange = '\\u2700-\\u27bf',
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
rsPunctuationRange = '\\u2000-\\u206f',
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
rsVarRange = '\\ufe0e\\ufe0f',
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]",
rsAstral = '[' + rsAstralRange + ']',
rsBreak = '[' + rsBreakRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsDigits = '\\d+',
rsDingbat = '[' + rsDingbatRange + ']',
rsLower = '[' + rsLowerRange + ']',
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
rsFitz = '\\ud83c[\\udffb-\\udfff]',
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsUpper = '[' + rsUpperRange + ']',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
/** Used to match apostrophes. */
var reApos = RegExp(rsApos, 'g');
/**
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
*/
var reComboMark = RegExp(rsCombo, 'g');
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
/** Used to match complex or compound words. */
var reUnicodeWord = RegExp([
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
rsUpper + '+' + rsOptContrUpper,
rsOrdUpper,
rsOrdLower,
rsDigits,
rsEmoji
].join('|'), 'g');
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
/** Used to detect strings that need a more robust regexp to match words. */
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/** Used to assign default `context` object properties. */
var contextProps = [
'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
'_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
];
/** Used to make template sourceURLs easier to identify. */
var templateCounter = -1;
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;
/** Used to map Latin Unicode letters to basic Latin letters. */
var deburredLetters = {
// Latin-1 Supplement block.
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
'\xc7': 'C', '\xe7': 'c',
'\xd0': 'D', '\xf0': 'd',
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
'\xc6': 'Ae', '\xe6': 'ae',
'\xde': 'Th', '\xfe': 'th',
'\xdf': 'ss',
// Latin Extended-A block.
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
'\u0134': 'J', '\u0135': 'j',
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
'\u0163': 't', '\u0165': 't', '\u0167': 't',
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
'\u0174': 'W', '\u0175': 'w',
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
'\u0132': 'IJ', '\u0133': 'ij',
'\u0152': 'Oe', '\u0153': 'oe',
'\u0149': "'n", '\u017f': 's'
};
/** Used to map characters to HTML entities. */
var htmlEscapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
/** Used to map HTML entities to characters. */
var htmlUnescapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': "'"
};
/** Used to escape characters for inclusion in compiled string literals. */
var stringEscapes = {
'\\': '\\',
"'": "'",
'\n': 'n',
'\r': 'r',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
/** Built-in method references without a dependency on `root`. */
var freeParseFloat = parseFloat,
freeParseInt = parseInt;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
// Use `util.types` for Node.js 10+.
var types = freeModule && freeModule.require && freeModule.require('util').types;
if (types) {
return types;
}
// Legacy `process.binding('util')` for Node.js < 10.
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
/* Node.js helper references. */
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
nodeIsDate = nodeUtil && nodeUtil.isDate,
nodeIsMap = nodeUtil && nodeUtil.isMap,
nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
nodeIsSet = nodeUtil && nodeUtil.isSet,
nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/*--------------------------------------------------------------------------*/
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
/**
* A specialized version of `baseAggregator` for arrays.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function arrayAggregator(array, setter, iteratee, accumulator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
var value = array[index];
setter(accumulator, value, iteratee(value), array);
}
return accumulator;
}
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.forEachRight` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEachRight(array, iteratee) {
var length = array == null ? 0 : array.length;
while (length--) {
if (iteratee(array[length], length, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.every` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
*/
function arrayEvery(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (!predicate(array[index], index, array)) {
return false;
}
}
return true;
}
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
/**
* A specialized version of `_.reduce` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduce(array, iteratee, accumulator, initAccum) {
var index = -1,
length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
/**
* A specialized version of `_.reduceRight` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the last element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
var length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[--length];
}
while (length--) {
accumulator = iteratee(accumulator, array[length], length, array);
}
return accumulator;
}
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
/**
* Gets the size of an ASCII `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
var asciiSize = baseProperty('length');
/**
* Converts an ASCII `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function asciiToArray(string) {
return string.split('');
}
/**
* Splits an ASCII `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function asciiWords(string) {
return string.match(reAsciiWord) || [];
}
/**
* The base implementation of methods like `_.findKey` and `_.findLastKey`,
* without support for iteratee shorthands, which iterates over `collection`
* using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the found element or its key, else `undefined`.
*/
function baseFindKey(collection, predicate, eachFunc) {
var result;
eachFunc(collection, function(value, key, collection) {
if (predicate(value, key, collection)) {
result = key;
return false;
}
});
return result;
}
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value
? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex);
}
/**
* This function is like `baseIndexOf` except that it accepts a comparator.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @param {Function} comparator The comparator invoked per element.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOfWith(array, value, fromIndex, comparator) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (comparator(array[index], value)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
/**
* The base implementation of `_.mean` and `_.meanBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the mean.
*/
function baseMean(array, iteratee) {
var length = array == null ? 0 : array.length;
return length ? (baseSum(array, iteratee) / length) : NAN;
}
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.propertyOf` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyOf(object) {
return function(key) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.reduce` and `_.reduceRight`, without support
* for iteratee shorthands, which iterates over `collection` using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value.
* @param {boolean} initAccum Specify using the first or last element of
* `collection` as the initial value.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the accumulated value.
*/
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function(value, index, collection) {
accumulator = initAccum
? (initAccum = false, value)
: iteratee(accumulator, value, index, collection);
});
return accumulator;
}
/**
* The base implementation of `_.sortBy` which uses `comparer` to define the
* sort order of `array` and replaces criteria objects with their corresponding
* values.
*
* @private
* @param {Array} array The array to sort.
* @param {Function} comparer The function to define sort order.
* @returns {Array} Returns `array`.
*/
function baseSortBy(array, comparer) {
var length = array.length;
array.sort(comparer);
while (length--) {
array[length] = array[length].value;
}
return array;
}
/**
* The base implementation of `_.sum` and `_.sumBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the sum.
*/
function baseSum(array, iteratee) {
var result,
index = -1,
length = array.length;
while (++index < length) {
var current = iteratee(array[index]);
if (current !== undefined) {
result = result === undefined ? current : (result + current);
}
}
return result;
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
* of key-value pairs for `object` corresponding to the property names of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function(key) {
return [key, object[key]];
});
}
/**
* The base implementation of `_.trim`.
*
* @private
* @param {string} string The string to trim.
* @returns {string} Returns the trimmed string.
*/
function baseTrim(string) {
return string
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
: string;
}
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
* array of `object` property values corresponding to the property names
* of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
return arrayMap(props, function(key) {
return object[key];
});
}
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
/**
* Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the first unmatched string symbol.
*/
function charsStartIndex(strSymbols, chrSymbols) {
var index = -1,
length = strSymbols.length;
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the last unmatched string symbol.
*/
function charsEndIndex(strSymbols, chrSymbols) {
var index = strSymbols.length;
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
}
/**
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
* letters to basic Latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
var deburrLetter = basePropertyOf(deburredLetters);
/**
* Used by `_.escape` to convert characters to HTML entities.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
var escapeHtmlChar = basePropertyOf(htmlEscapes);
/**
* Used by `_.template` to escape characters for inclusion in compiled string literals.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeStringChar(chr) {
return '\\' + stringEscapes[chr];
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `string` contains Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a symbol is found, else `false`.
*/
function hasUnicode(string) {
return reHasUnicode.test(string);
}
/**
* Checks if `string` contains a word composed of Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a word is found, else `false`.
*/
function hasUnicodeWord(string) {
return reHasUnicodeWord.test(string);
}
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
/**
* Replaces all `placeholder` elements in `array` with an internal placeholder
* and returns an array of their indexes.
*
* @private
* @param {Array} array The array to modify.
* @param {*} placeholder The placeholder to replace.
* @returns {Array} Returns the new array of placeholder indexes.
*/
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value === placeholder || value === PLACEHOLDER) {
array[index] = PLACEHOLDER;
result[resIndex++] = index;
}
}
return result;
}
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
/**
* Converts `set` to its value-value pairs.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the value-value pairs.
*/
function setToPairs(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = [value, value];
});
return result;
}
/**
* A specialized version of `_.indexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* A specialized version of `_.lastIndexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictLastIndexOf(array, value, fromIndex) {
var index = fromIndex + 1;
while (index--) {
if (array[index] === value) {
return index;
}
}
return index;
}
/**
* Gets the number of symbols in `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the string size.
*/
function stringSize(string) {
return hasUnicode(string)
? unicodeSize(string)
: asciiSize(string);
}
/**
* Converts `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function stringToArray(string) {
return hasUnicode(string)
? unicodeToArray(string)
: asciiToArray(string);
}
/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
* character of `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the index of the last non-whitespace character.
*/
function trimmedEndIndex(string) {
var index = string.length;
while (index-- && reWhitespace.test(string.charAt(index))) {}
return index;
}
/**
* Used by `_.unescape` to convert HTML entities to characters.
*
* @private
* @param {string} chr The matched character to unescape.
* @returns {string} Returns the unescaped character.
*/
var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
/**
* Gets the size of a Unicode `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
function unicodeSize(string) {
var result = reUnicode.lastIndex = 0;
while (reUnicode.test(string)) {
++result;
}
return result;
}
/**
* Converts a Unicode `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function unicodeToArray(string) {
return string.match(reUnicode) || [];
}
/**
* Splits a Unicode `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function unicodeWords(string) {
return string.match(reUnicodeWord) || [];
}
/*--------------------------------------------------------------------------*/
/**
* Create a new pristine `lodash` function using the `context` object.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Util
* @param {Object} [context=root] The context object.
* @returns {Function} Returns a new `lodash` function.
* @example
*
* _.mixin({ 'foo': _.constant('foo') });
*
* var lodash = _.runInContext();
* lodash.mixin({ 'bar': lodash.constant('bar') });
*
* _.isFunction(_.foo);
* // => true
* _.isFunction(_.bar);
* // => false
*
* lodash.isFunction(lodash.foo);
* // => false
* lodash.isFunction(lodash.bar);
* // => true
*
* // Create a suped-up `defer` in Node.js.
* var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
*/
var runInContext = (function runInContext(context) {
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
/** Built-in constructor references. */
var Array = context.Array,
Date = context.Date,
Error = context.Error,
Function = context.Function,
Math = context.Math,
Object = context.Object,
RegExp = context.RegExp,
String = context.String,
TypeError = context.TypeError;
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = context['__core-js_shared__'];
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to generate unique IDs. */
var idCounter = 0;
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/** Used to restore the original `_` reference in `_.noConflict`. */
var oldDash = root._;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Buffer = moduleExports ? context.Buffer : undefined,
Symbol = context.Symbol,
Uint8Array = context.Uint8Array,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
getPrototype = overArg(Object.getPrototypeOf, Object),
objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice,
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
symIterator = Symbol ? Symbol.iterator : undefined,
symToStringTag = Symbol ? Symbol.toStringTag : undefined;
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
/** Mocked built-ins. */
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
ctxNow = Date && Date.now !== root.Date.now && Date.now,
ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
nativeFloor = Math.floor,
nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeIsFinite = context.isFinite,
nativeJoin = arrayProto.join,
nativeKeys = overArg(Object.keys, Object),
nativeMax = Math.max,
nativeMin = Math.min,
nativeNow = Date.now,
nativeParseInt = context.parseInt,
nativeRandom = Math.random,
nativeReverse = arrayProto.reverse;
/* Built-in method references that are verified to be native. */
var DataView = getNative(context, 'DataView'),
Map = getNative(context, 'Map'),
Promise = getNative(context, 'Promise'),
Set = getNative(context, 'Set'),
WeakMap = getNative(context, 'WeakMap'),
nativeCreate = getNative(Object, 'create');
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
/** Used to lookup unminified function names. */
var realNames = {};
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/*------------------------------------------------------------------------*/
/**
* Creates a `lodash` object which wraps `value` to enable implicit method
* chain sequences. Methods that operate on and return arrays, collections,
* and functions can be chained together. Methods that retrieve a single value
* or may return a primitive value will automatically end the chain sequence
* and return the unwrapped value. Otherwise, the value must be unwrapped
* with `_#value`.
*
* Explicit chain sequences, which must be unwrapped with `_#value`, may be
* enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, it's deferred until
* `_#value` is implicitly or explicitly called.
*
* Lazy evaluation allows several methods to support shortcut fusion.
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
* the creation of intermediate arrays and can greatly reduce the number of
* iteratee executions. Sections of a chain sequence qualify for shortcut
* fusion if the section is applied to an array and iteratees accept only
* one argument. The heuristic for whether a section qualifies for shortcut
* fusion is subject to change.
*
* Chaining is supported in custom builds as long as the `_#value` method is
* directly or indirectly included in the build.
*
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
*
* The chainable wrapper methods are:
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
* `zipObject`, `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
* `upperFirst`, `value`, and `words`
*
* @name _
* @constructor
* @category Seq
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]);
*
* // Returns an unwrapped value.
* wrapped.reduce(_.add);
* // => 6
*
* // Returns a wrapped value.
* var squares = wrapped.map(square);
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
if (value instanceof LodashWrapper) {
return value;
}
if (hasOwnProperty.call(value, '__wrapped__')) {
return wrapperClone(value);
}
}
return new LodashWrapper(value);
}
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
function object() {}
return function(proto) {
if (!isObject(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object;
object.prototype = undefined;
return result;
};
}());
/**
* The function whose prototype chain sequence wrappers inherit from.
*
* @private
*/
function baseLodash() {
// No operation performed.
}
/**
* The base constructor for creating `lodash` wrapper objects.
*
* @private
* @param {*} value The value to wrap.
* @param {boolean} [chainAll] Enable explicit method chain sequences.
*/
function LodashWrapper(value, chainAll) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__chain__ = !!chainAll;
this.__index__ = 0;
this.__values__ = undefined;
}
/**
* By default, the template delimiters used by lodash are like those in
* embedded Ruby (ERB) as well as ES2015 template strings. Change the
* following template settings to use alternative delimiters.
*
* @static
* @memberOf _
* @type {Object}
*/
lodash.templateSettings = {
/**
* Used to detect `data` property values to be HTML-escaped.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'escape': reEscape,
/**
* Used to detect code to be evaluated.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'evaluate': reEvaluate,
/**
* Used to detect `data` property values to inject.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'interpolate': reInterpolate,
/**
* Used to reference the data object in the template text.
*
* @memberOf _.templateSettings
* @type {string}
*/
'variable': '',
/**
* Used to import variables into the compiled template.
*
* @memberOf _.templateSettings
* @type {Object}
*/
'imports': {
/**
* A reference to the `lodash` function.
*
* @memberOf _.templateSettings.imports
* @type {Function}
*/
'_': lodash
}
};
// Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
lodash.prototype.constructor = lodash;
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
LodashWrapper.prototype.constructor = LodashWrapper;
/*------------------------------------------------------------------------*/
/**
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
*
* @private
* @constructor
* @param {*} value The value to wrap.
*/
function LazyWrapper(value) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__dir__ = 1;
this.__filtered__ = false;
this.__iteratees__ = [];
this.__takeCount__ = MAX_ARRAY_LENGTH;
this.__views__ = [];
}
/**
* Creates a clone of the lazy wrapper object.
*
* @private
* @name clone
* @memberOf LazyWrapper
* @returns {Object} Returns the cloned `LazyWrapper` object.
*/
function lazyClone() {
var result = new LazyWrapper(this.__wrapped__);
result.__actions__ = copyArray(this.__actions__);
result.__dir__ = this.__dir__;
result.__filtered__ = this.__filtered__;
result.__iteratees__ = copyArray(this.__iteratees__);
result.__takeCount__ = this.__takeCount__;
result.__views__ = copyArray(this.__views__);
return result;
}
/**
* Reverses the direction of lazy iteration.
*
* @private
* @name reverse
* @memberOf LazyWrapper
* @returns {Object} Returns the new reversed `LazyWrapper` object.
*/
function lazyReverse() {
if (this.__filtered__) {
var result = new LazyWrapper(this);
result.__dir__ = -1;
result.__filtered__ = true;
} else {
result = this.clone();
result.__dir__ *= -1;
}
return result;
}
/**
* Extracts the unwrapped value from its lazy wrapper.
*
* @private
* @name value
* @memberOf LazyWrapper
* @returns {*} Returns the unwrapped value.
*/
function lazyValue() {
var array = this.__wrapped__.value(),
dir = this.__dir__,
isArr = isArray(array),
isRight = dir < 0,
arrLength = isArr ? array.length : 0,
view = getView(0, arrLength, this.__views__),
start = view.start,
end = view.end,
length = end - start,
index = isRight ? end : (start - 1),
iteratees = this.__iteratees__,
iterLength = iteratees.length,
resIndex = 0,
takeCount = nativeMin(length, this.__takeCount__);
if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
return baseWrapperValue(array, this.__actions__);
}
var result = [];
outer:
while (length-- && resIndex < takeCount) {
index += dir;
var iterIndex = -1,
value = array[index];
while (++iterIndex < iterLength) {
var data = iteratees[iterIndex],
iteratee = data.iteratee,
type = data.type,
computed = iteratee(value);
if (type == LAZY_MAP_FLAG) {
value = computed;
} else if (!computed) {
if (type == LAZY_FILTER_FLAG) {
continue outer;
} else {
break outer;
}
}
}
result[resIndex++] = value;
}
return result;
}
// Ensure `LazyWrapper` is an instance of `baseLodash`.
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper;
/*------------------------------------------------------------------------*/
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/*------------------------------------------------------------------------*/
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/*------------------------------------------------------------------------*/
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/*------------------------------------------------------------------------*/
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
/*------------------------------------------------------------------------*/
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
/*------------------------------------------------------------------------*/
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
var isArr = isArray(value),
isArg = !isArr && isArguments(value),
isBuff = !isArr && !isArg && isBuffer(value),
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties.
isIndex(key, length)
))) {
result.push(key);
}
}
return result;
}
/**
* A specialized version of `_.sample` for arrays.
*
* @private
* @param {Array} array The array to sample.
* @returns {*} Returns the random element.
*/
function arraySample(array) {
var length = array.length;
return length ? array[baseRandom(0, length - 1)] : undefined;
}
/**
* A specialized version of `_.sampleSize` for arrays.
*
* @private
* @param {Array} array The array to sample.
* @param {number} n The number of elements to sample.
* @returns {Array} Returns the random elements.
*/
function arraySampleSize(array, n) {
return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
}
/**
* A specialized version of `_.shuffle` for arrays.
*
* @private
* @param {Array} array The array to shuffle.
* @returns {Array} Returns the new shuffled array.
*/
function arrayShuffle(array) {
return shuffleSelf(copyArray(array));
}
/**
* This function is like `assignValue` except that it doesn't assign
* `undefined` values.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignMergeValue(object, key, value) {
if ((value !== undefined && !eq(object[key], value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* Aggregates elements of `collection` on `accumulator` with keys transformed
* by `iteratee` and values set by `setter`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function baseAggregator(collection, setter, iteratee, accumulator) {
baseEach(collection, function(value, key, collection) {
setter(accumulator, value, iteratee(value), collection);
});
return accumulator;
}
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
/**
* The base implementation of `_.assignIn` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssignIn(object, source) {
return object && copyObject(source, keysIn(source), object);
}
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
/**
* The base implementation of `_.at` without support for individual paths.
*
* @private
* @param {Object} object The object to iterate over.
* @param {string[]} paths The property paths to pick.
* @returns {Array} Returns the picked elements.
*/
function baseAt(object, paths) {
var index = -1,
length = paths.length,
result = Array(length),
skip = object == null;
while (++index < length) {
result[index] = skip ? undefined : get(object, paths[index]);
}
return result;
}
/**
* The base implementation of `_.clamp` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
*/
function baseClamp(number, lower, upper) {
if (number === number) {
if (upper !== undefined) {
number = number <= upper ? number : upper;
}
if (lower !== undefined) {
number = number >= lower ? number : lower;
}
}
return number;
}
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} bitmask The bitmask flags.
* 1 - Deep clone
* 2 - Flatten inherited properties
* 4 - Clone symbols
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, bitmask, customizer, key, object, stack) {
var result,
isDeep = bitmask & CLONE_DEEP_FLAG,
isFlat = bitmask & CLONE_FLAT_FLAG,
isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== undefined) {
return result;
}
if (!isObject(value)) {
return value;
}
var isArr = isArray(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat
? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, isDeep);
}
}
// Check for circular references and return its corresponding clone.
stack || (stack = new Stack);
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
if (isSet(value)) {
value.forEach(function(subValue) {
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
});
} else if (isMap(value)) {
value.forEach(function(subValue, key) {
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
}
var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
}
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
/**
* The base implementation of `_.conforms` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new spec function.
*/
function baseConforms(source) {
var props = keys(source);
return function(object) {
return baseConformsTo(object, source, props);
};
}
/**
* The base implementation of `_.conformsTo` which accepts `props` to check.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property predicates to conform to.
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
*/
function baseConformsTo(object, source, props) {
var length = props.length;
if (object == null) {
return !length;
}
object = Object(object);
while (length--) {
var key = props[length],
predicate = source[key],
value = object[key];
if ((value === undefined && !(key in object)) || !predicate(value)) {
return false;
}
}
return true;
}
/**
* The base implementation of `_.delay` and `_.defer` which accepts `args`
* to provide to `func`.
*
* @private
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {Array} args The arguments to provide to `func`.
* @returns {number|Object} Returns the timer id or timeout object.
*/
function baseDelay(func, wait, args) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return setTimeout(function() { func.apply(undefined, args); }, wait);
}
/**
* The base implementation of methods like `_.difference` without support
* for excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
}
else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee == null ? value : iteratee(value);
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
/**
* The base implementation of `_.forEachRight` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEachRight = createBaseEach(baseForOwnRight, true);
/**
* The base implementation of `_.every` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`
*/
function baseEvery(collection, predicate) {
var result = true;
baseEach(collection, function(value, index, collection) {
result = !!predicate(value, index, collection);
return result;
});
return result;
}
/**
* The base implementation of methods like `_.max` and `_.min` which accepts a
* `comparator` to determine the extremum value.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The iteratee invoked per iteration.
* @param {Function} comparator The comparator used to compare values.
* @returns {*} Returns the extremum value.
*/
function baseExtremum(array, iteratee, comparator) {
var index = -1,
length = array.length;
while (++index < length) {
var value = array[index],
current = iteratee(value);
if (current != null && (computed === undefined
? (current === current && !isSymbol(current))
: comparator(current, computed)
)) {
var computed = current,
result = value;
}
}
return result;
}
/**
* The base implementation of `_.fill` without an iteratee call guard.
*
* @private
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
*/
function baseFill(array, value, start, end) {
var length = array.length;
start = toInteger(start);
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = (end === undefined || end > length) ? length : toInteger(end);
if (end < 0) {
end += length;
}
end = start > end ? 0 : toLength(end);
while (start < end) {
array[start++] = value;
}
return array;
}
/**
* The base implementation of `_.filter` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function baseFilter(collection, predicate) {
var result = [];
baseEach(collection, function(value, index, collection) {
if (predicate(value, index, collection)) {
result.push(value);
}
});
return result;
}
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
/**
* The base implementation of `baseForOwn` which iterates over `object`
* properties returned by `keysFunc` and invokes `iteratee` for each property.
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseFor = createBaseFor();
/**
* This function is like `baseFor` except that it iterates over properties
* in the opposite order.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseForRight = createBaseFor(true);
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
}
/**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwnRight(object, iteratee) {
return object && baseForRight(object, iteratee, keys);
}
/**
* The base implementation of `_.functions` which creates an array of
* `object` function property names filtered from `props`.
*
* @private
* @param {Object} object The object to inspect.
* @param {Array} props The property names to filter.
* @returns {Array} Returns the function names.
*/
function baseFunctions(object, props) {
return arrayFilter(props, function(key) {
return isFunction(object[key]);
});
}
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = castPath(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
/**
* The base implementation of `_.gt` which doesn't coerce arguments.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`,
* else `false`.
*/
function baseGt(value, other) {
return value > other;
}
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
return object != null && hasOwnProperty.call(object, key);
}
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
/**
* The base implementation of `_.inRange` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to check.
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
*/
function baseInRange(number, start, end) {
return number >= nativeMin(start, end) && number < nativeMax(start, end);
}
/**
* The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
*/
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes,
length = arrays[0].length,
othLength = arrays.length,
othIndex = othLength,
caches = Array(othLength),
maxLength = Infinity,
result = [];
while (othIndex--) {
var array = arrays[othIndex];
if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee));
}
maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array)
: undefined;
}
array = arrays[0];
var index = -1,
seen = caches[0];
outer:
while (++index < length && result.length < maxLength) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (!(seen
? cacheHas(seen, computed)
: includes(result, computed, comparator)
)) {
othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache
? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator))
) {
continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.invert` and `_.invertBy` which inverts
* `object` with values transformed by `iteratee` and set by `setter`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform values.
* @param {Object} accumulator The initial inverted object.
* @returns {Function} Returns `accumulator`.
*/
function baseInverter(object, setter, iteratee, accumulator) {
baseForOwn(object, function(value, key, object) {
setter(accumulator, iteratee(value), key, object);
});
return accumulator;
}
/**
* The base implementation of `_.invoke` without support for individual
* method arguments.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {Array} args The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
*/
function baseInvoke(object, path, args) {
path = castPath(path, object);
object = parent(object, path);
var func = object == null ? object : object[toKey(last(path))];
return func == null ? undefined : apply(func, object, args);
}
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
/**
* The base implementation of `_.isArrayBuffer` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
*/
function baseIsArrayBuffer(value) {
return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
}
/**
* The base implementation of `_.isDate` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
*/
function baseIsDate(value) {
return isObjectLike(value) && baseGetTag(value) == dateTag;
}
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {boolean} bitmask The bitmask flags.
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Function} [customizer] The function to customize comparisons.
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, bitmask, customizer, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
/**
* The base implementation of `_.isMap` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
*/
function baseIsMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
}
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack;
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result
)) {
return false;
}
}
}
return true;
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.isRegExp` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
*/
function baseIsRegExp(value) {
return isObjectLike(value) && baseGetTag(value) == regexpTag;
}
/**
* The base implementation of `_.isSet` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
*/
function baseIsSet(value) {
return isObjectLike(value) && getTag(value) == setTag;
}
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray(value) {
return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
/**
* The base implementation of `_.lt` which doesn't coerce arguments.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`,
* else `false`.
*/
function baseLt(value, other) {
return value < other;
}
/**
* The base implementation of `_.map` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
/**
* The base implementation of `_.merge` without support for multiple sources.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {number} srcIndex The index of `source`.
* @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) {
return;
}
baseFor(source, function(srcValue, key) {
stack || (stack = new Stack);
if (isObject(srcValue)) {
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
}
else {
var newValue = customizer
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) {
newValue = srcValue;
}
assignMergeValue(object, key, newValue);
}
}, keysIn);
}
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {number} srcIndex The index of `source`.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = safeGet(object, key),
srcValue = safeGet(source, key),
stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object, key, stacked);
return;
}
var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined;
var isCommon = newValue === undefined;
if (isCommon) {
var isArr = isArray(srcValue),
isBuff = !isArr && isBuffer(srcValue),
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (isArray(objValue)) {
newValue = objValue;
}
else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
}
else if (isBuff) {
isCommon = false;
newValue = cloneBuffer(srcValue, true);
}
else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray(srcValue, true);
}
else {
newValue = [];
}
}
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
newValue = objValue;
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || isFunction(objValue)) {
newValue = initCloneObject(srcValue);
}
}
else {
isCommon = false;
}
}
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack['delete'](srcValue);
}
assignMergeValue(object, key, newValue);
}
/**
* The base implementation of `_.nth` which doesn't coerce arguments.
*
* @private
* @param {Array} array The array to query.
* @param {number} n The index of the element to return.
* @returns {*} Returns the nth element of `array`.
*/
function baseNth(array, n) {
var length = array.length;
if (!length) {
return;
}
n += n < 0 ? length : 0;
return isIndex(n, length) ? array[n] : undefined;
}
/**
* The base implementation of `_.orderBy` without param guards.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
* @param {string[]} orders The sort orders of `iteratees`.
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
if (iteratees.length) {
iteratees = arrayMap(iteratees, function(iteratee) {
if (isArray(iteratee)) {
return function(value) {
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
}
}
return iteratee;
});
} else {
iteratees = [identity];
}
var index = -1;
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) {
return iteratee(value);
});
return { 'criteria': criteria, 'index': ++index, 'value': value };
});
return baseSortBy(result, function(object, other) {
return compareMultiple(object, other, orders);
});
}
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, paths) {
return basePickBy(object, paths, function(value, path) {
return hasIn(object, path);
});
}
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, paths, predicate) {
var index = -1,
length = paths.length,
result = {};
while (++index < length) {
var path = paths[index],
value = baseGet(object, path);
if (predicate(value, path)) {
baseSet(result, castPath(path, object), value);
}
}
return result;
}
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
/**
* The base implementation of `_.pullAllBy` without support for iteratee
* shorthands.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`.
*/
function basePullAll(array, values, iteratee, comparator) {
var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
index = -1,
length = values.length,
seen = array;
if (array === values) {
values = copyArray(values);
}
if (iteratee) {
seen = arrayMap(array, baseUnary(iteratee));
}
while (++index < length) {
var fromIndex = 0,
value = values[index],
computed = iteratee ? iteratee(value) : value;
while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
if (seen !== array) {
splice.call(seen, fromIndex, 1);
}
splice.call(array, fromIndex, 1);
}
}
return array;
}
/**
* The base implementation of `_.pullAt` without support for individual
* indexes or capturing the removed elements.
*
* @private
* @param {Array} array The array to modify.
* @param {number[]} indexes The indexes of elements to remove.
* @returns {Array} Returns `array`.
*/
function basePullAt(array, indexes) {
var length = array ? indexes.length : 0,
lastIndex = length - 1;
while (length--) {
var index = indexes[length];
if (length == lastIndex || index !== previous) {
var previous = index;
if (isIndex(index)) {
splice.call(array, index, 1);
} else {
baseUnset(array, index);
}
}
}
return array;
}
/**
* The base implementation of `_.random` without support for returning
* floating-point numbers.
*
* @private
* @param {number} lower The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the random number.
*/
function baseRandom(lower, upper) {
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
}
/**
* The base implementation of `_.range` and `_.rangeRight` which doesn't
* coerce arguments.
*
* @private
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @param {number} step The value to increment or decrement by.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the range of numbers.
*/
function baseRange(start, end, step, fromRight) {
var index = -1,
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
result = Array(length);
while (length--) {
result[fromRight ? length : ++index] = start;
start += step;
}
return result;
}
/**
* The base implementation of `_.repeat` which doesn't coerce arguments.
*
* @private
* @param {string} string The string to repeat.
* @param {number} n The number of times to repeat the string.
* @returns {string} Returns the repeated string.
*/
function baseRepeat(string, n) {
var result = '';
if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
return result;
}
// Leverage the exponentiation by squaring algorithm for a faster repeat.
// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
do {
if (n % 2) {
result += string;
}
n = nativeFloor(n / 2);
if (n) {
string += string;
}
} while (n);
return result;
}
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
return setToString(overRest(func, start, identity), func + '');
}
/**
* The base implementation of `_.sample`.
*
* @private
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
*/
function baseSample(collection) {
return arraySample(values(collection));
}
/**
* The base implementation of `_.sampleSize` without param guards.
*
* @private
* @param {Array|Object} collection The collection to sample.
* @param {number} n The number of elements to sample.
* @returns {Array} Returns the random elements.
*/
function baseSampleSize(collection, n) {
var array = values(collection);
return shuffleSelf(array, baseClamp(n, 0, array.length));
}
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = castPath(path, object);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
return object;
}
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
/**
* The base implementation of `setData` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function(func, data) {
metaMap.set(func, data);
return func;
};
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function(func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
/**
* The base implementation of `_.shuffle`.
*
* @private
* @param {Array|Object} collection The collection to shuffle.
* @returns {Array} Returns the new shuffled array.
*/
function baseShuffle(collection) {
return shuffleSelf(values(collection));
}
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : ((end - start) >>> 0);
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
/**
* The base implementation of `_.some` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function baseSome(collection, predicate) {
var result;
baseEach(collection, function(value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
return !!result;
}
/**
* The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
* performs a binary search of `array` to determine the index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndex(array, value, retHighest) {
var low = 0,
high = array == null ? low : array.length;
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
while (low < high) {
var mid = (low + high) >>> 1,
computed = array[mid];
if (computed !== null && !isSymbol(computed) &&
(retHighest ? (computed <= value) : (computed < value))) {
low = mid + 1;
} else {
high = mid;
}
}
return high;
}
return baseSortedIndexBy(array, value, identity, retHighest);
}
/**
* The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
* which invokes `iteratee` for `value` and each element of `array` to compute
* their sort ranking. The iteratee is invoked with one argument; (value).
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} iteratee The iteratee invoked per element.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndexBy(array, value, iteratee, retHighest) {
var low = 0,
high = array == null ? 0 : array.length;
if (high === 0) {
return 0;
}
value = iteratee(value);
var valIsNaN = value !== value,
valIsNull = value === null,
valIsSymbol = isSymbol(value),
valIsUndefined = value === undefined;
while (low < high) {
var mid = nativeFloor((low + high) / 2),
computed = iteratee(array[mid]),
othIsDefined = computed !== undefined,
othIsNull = computed === null,
othIsReflexive = computed === computed,
othIsSymbol = isSymbol(computed);
if (valIsNaN) {
var setLow = retHighest || othIsReflexive;
} else if (valIsUndefined) {
setLow = othIsReflexive && (retHighest || othIsDefined);
} else if (valIsNull) {
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
} else if (valIsSymbol) {
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
} else if (othIsNull || othIsSymbol) {
setLow = false;
} else {
setLow = retHighest ? (computed <= value) : (computed < value);
}
if (setLow) {
low = mid + 1;
} else {
high = mid;
}
}
return nativeMin(high, MAX_ARRAY_INDEX);
}
/**
* The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseSortedUniq(array, iteratee) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
if (!index || !eq(computed, seen)) {
var seen = computed;
result[resIndex++] = value === 0 ? 0 : value;
}
}
return result;
}
/**
* The base implementation of `_.toNumber` which doesn't ensure correct
* conversions of binary, hexadecimal, or octal string values.
*
* @private
* @param {*} value The value to process.
* @returns {number} Returns the number.
*/
function baseToNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
return +value;
}
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
}
/**
* The base implementation of `_.update`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to update.
* @param {Function} updater The function to produce the updated value.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseUpdate(object, path, updater, customizer) {
return baseSet(object, path, updater(baseGet(object, path)), customizer);
}
/**
* The base implementation of methods like `_.dropWhile` and `_.takeWhile`
* without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to query.
* @param {Function} predicate The function invoked per iteration.
* @param {boolean} [isDrop] Specify dropping elements instead of taking them.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the slice of `array`.
*/
function baseWhile(array, predicate, isDrop, fromRight) {
var length = array.length,
index = fromRight ? length : -1;
while ((fromRight ? index-- : ++index < length) &&
predicate(array[index], index, array)) {}
return isDrop
? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
: baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
}
/**
* The base implementation of `wrapperValue` which returns the result of
* performing a sequence of actions on the unwrapped `value`, where each
* successive action is supplied the return value of the previous.
*
* @private
* @param {*} value The unwrapped value.
* @param {Array} actions Actions to perform to resolve the unwrapped value.
* @returns {*} Returns the resolved value.
*/
function baseWrapperValue(value, actions) {
var result = value;
if (result instanceof LazyWrapper) {
result = result.value();
}
return arrayReduce(actions, function(result, action) {
return action.func.apply(action.thisArg, arrayPush([result], action.args));
}, result);
}
/**
* The base implementation of methods like `_.xor`, without support for
* iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of values.
*/
function baseXor(arrays, iteratee, comparator) {
var length = arrays.length;
if (length < 2) {
return length ? baseUniq(arrays[0]) : [];
}
var index = -1,
result = Array(length);
while (++index < length) {
var array = arrays[index],
othIndex = -1;
while (++othIndex < length) {
if (othIndex != index) {
result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
}
}
}
return baseUniq(baseFlatten(result, 1), iteratee, comparator);
}
/**
* This base implementation of `_.zipObject` which assigns values using `assignFunc`.
*
* @private
* @param {Array} props The property identifiers.
* @param {Array} values The property values.
* @param {Function} assignFunc The function to assign values.
* @returns {Object} Returns the new object.
*/
function baseZipObject(props, values, assignFunc) {
var index = -1,
length = props.length,
valsLength = values.length,
result = {};
while (++index < length) {
var value = index < valsLength ? values[index] : undefined;
assignFunc(result, props[index], value);
}
return result;
}
/**
* Casts `value` to an empty array if it's not an array like object.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array|Object} Returns the cast array-like object.
*/
function castArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function castFunction(value) {
return typeof value == 'function' ? value : identity;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
/**
* A `baseRest` alias which can be replaced with `identity` by module
* replacement plugins.
*
* @private
* @type {Function}
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
var castRest = baseRest;
/**
* Casts `array` to a slice if it's needed.
*
* @private
* @param {Array} array The array to inspect.
* @param {number} start The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the cast slice.
*/
function castSlice(array, start, end) {
var length = array.length;
end = end === undefined ? length : end;
return (!start && end >= length) ? array : baseSlice(array, start, end);
}
/**
* A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
*
* @private
* @param {number|Object} id The timer id or timeout object of the timer to clear.
*/
var clearTimeout = ctxClearTimeout || function(id) {
return root.clearTimeout(id);
};
/**
* Creates a clone of `buffer`.
*
* @private
* @param {Buffer} buffer The buffer to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Buffer} Returns the cloned buffer.
*/
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length = buffer.length,
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
buffer.copy(result);
return result;
}
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
/**
* Creates a clone of `dataView`.
*
* @private
* @param {Object} dataView The data view to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned data view.
*/
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
/**
* Creates a clone of the `symbol` object.
*
* @private
* @param {Object} symbol The symbol object to clone.
* @returns {Object} Returns the cloned symbol object.
*/
function cloneSymbol(symbol) {
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
/**
* Compares values to sort them in ascending order.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function compareAscending(value, other) {
if (value !== other) {
var valIsDefined = value !== undefined,
valIsNull = value === null,
valIsReflexive = value === value,
valIsSymbol = isSymbol(value);
var othIsDefined = other !== undefined,
othIsNull = other === null,
othIsReflexive = other === other,
othIsSymbol = isSymbol(other);
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
(valIsNull && othIsDefined && othIsReflexive) ||
(!valIsDefined && othIsReflexive) ||
!valIsReflexive) {
return 1;
}
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
(othIsNull && valIsDefined && valIsReflexive) ||
(!othIsDefined && valIsReflexive) ||
!othIsReflexive) {
return -1;
}
}
return 0;
}
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
* and stable sort them.
*
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
* specify an order of "desc" for descending or "asc" for ascending sort order
* of corresponding values.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {boolean[]|string[]} orders The order to sort by for each property.
* @returns {number} Returns the sort order indicator for `object`.
*/
function compareMultiple(object, other, orders) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length,
ordersLength = orders.length;
while (++index < length) {
var result = compareAscending(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order = orders[index];
return result * (order == 'desc' ? -1 : 1);
}
}
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to provide the same value for
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
// for more details.
//
// This also ensures a stable sort in V8 and other engines.
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
return object.index - other.index;
}
/**
* Creates an array that is the composition of partially applied arguments,
* placeholders, and provided arguments into a single array of arguments.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to prepend to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgs(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersLength = holders.length,
leftIndex = -1,
leftLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(leftLength + rangeLength),
isUncurried = !isCurried;
while (++leftIndex < leftLength) {
result[leftIndex] = partials[leftIndex];
}
while (++argsIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[holders[argsIndex]] = args[argsIndex];
}
}
while (rangeLength--) {
result[leftIndex++] = args[argsIndex++];
}
return result;
}
/**
* This function is like `composeArgs` except that the arguments composition
* is tailored for `_.partialRight`.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to append to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgsRight(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersIndex = -1,
holdersLength = holders.length,
rightIndex = -1,
rightLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(rangeLength + rightLength),
isUncurried = !isCurried;
while (++argsIndex < rangeLength) {
result[argsIndex] = args[argsIndex];
}
var offset = argsIndex;
while (++rightIndex < rightLength) {
result[offset + rightIndex] = partials[rightIndex];
}
while (++holdersIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
}
}
return result;
}
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
/**
* Copies own symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
/**
* Copies own and inherited symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
/**
* Creates a function like `_.groupBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} [initializer] The accumulator object initializer.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter, initializer) {
return function(collection, iteratee) {
var func = isArray(collection) ? arrayAggregator : baseAggregator,
accumulator = initializer ? initializer() : {};
return func(collection, setter, getIteratee(iteratee, 2), accumulator);
};
}
/**
* Creates a function like `_.assign`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return baseRest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer)
: undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
object = Object(object);
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, index, customizer);
}
}
return object;
});
}
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
/**
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
/**
* Creates a function that wraps `func` to invoke it with the optional `this`
* binding of `thisArg`.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createBind(func, bitmask, thisArg) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
}
return wrapper;
}
/**
* Creates a function like `_.lowerFirst`.
*
* @private
* @param {string} methodName The name of the `String` case method to use.
* @returns {Function} Returns the new case function.
*/
function createCaseFirst(methodName) {
return function(string) {
string = toString(string);
var strSymbols = hasUnicode(string)
? stringToArray(string)
: undefined;
var chr = strSymbols
? strSymbols[0]
: string.charAt(0);
var trailing = strSymbols
? castSlice(strSymbols, 1).join('')
: string.slice(1);
return chr[methodName]() + trailing;
};
}
/**
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
return function(string) {
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
};
}
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
return function() {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0: return new Ctor;
case 1: return new Ctor(args[0]);
case 2: return new Ctor(args[0], args[1]);
case 3: return new Ctor(args[0], args[1], args[2]);
case 4: return new Ctor(args[0], args[1], args[2], args[3]);
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
/**
* Creates a function that wraps `func` to enable currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {number} arity The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createCurry(func, bitmask, arity) {
var Ctor = createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length,
placeholder = getHolder(wrapper);
while (index--) {
args[index] = arguments[index];
}
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? []
: replaceHolders(args, placeholder);
length -= holders.length;
if (length < arity) {
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length);
}
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args);
}
return wrapper;
}
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = getIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
/**
* Creates a `_.flow` or `_.flowRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new flow function.
*/
function createFlow(fromRight) {
return flatRest(function(funcs) {
var length = funcs.length,
index = length,
prereq = LodashWrapper.prototype.thru;
if (fromRight) {
funcs.reverse();
}
while (index--) {
var func = funcs[index];
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
var wrapper = new LodashWrapper([], true);
}
}
index = wrapper ? index : length;
while (++index < length) {
func = funcs[index];
var funcName = getFuncName(func),
data = funcName == 'wrapper' ? getData(func) : undefined;
if (data && isLaziable(data[0]) &&
data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
!data[4].length && data[9] == 1
) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
wrapper = (func.length == 1 && isLaziable(func))
? wrapper[funcName]()
: wrapper.thru(func);
}
}
return function() {
var args = arguments,
value = args[0];
if (wrapper && args.length == 1 && isArray(value)) {
return wrapper.plant(value).value();
}
var index = 0,
result = length ? funcs[index].apply(this, args) : value;
while (++index < length) {
result = funcs[index].call(this, result);
}
return result;
};
});
}
/**
* Creates a function that wraps `func` to invoke it with optional `this`
* binding of `thisArg`, partial application, and currying.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [partialsRight] The arguments to append to those provided
* to the new function.
* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
var isAry = bitmask & WRAP_ARY_FLAG,
isBind = bitmask & WRAP_BIND_FLAG,
isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
isFlip = bitmask & WRAP_FLIP_FLAG,
Ctor = isBindKey ? undefined : createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length;
while (index--) {
args[index] = arguments[index];
}
if (isCurried) {
var placeholder = getHolder(wrapper),
holdersCount = countHolders(args, placeholder);
}
if (partials) {
args = composeArgs(args, partials, holders, isCurried);
}
if (partialsRight) {
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
}
length -= holdersCount;
if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder);
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, thisArg,
args, newHolders, argPos, ary, arity - length
);
}
var thisBinding = isBind ? thisArg : this,
fn = isBindKey ? thisBinding[func] : func;
length = args.length;
if (argPos) {
args = reorder(args, argPos);
} else if (isFlip && length > 1) {
args.reverse();
}
if (isAry && ary < length) {
args.length = ary;
}
if (this && this !== root && this instanceof wrapper) {
fn = Ctor || createCtor(fn);
}
return fn.apply(thisBinding, args);
}
return wrapper;
}
/**
* Creates a function like `_.invertBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} toIteratee The function to resolve iteratees.
* @returns {Function} Returns the new inverter function.
*/
function createInverter(setter, toIteratee) {
return function(object, iteratee) {
return baseInverter(object, setter, toIteratee(iteratee), {});
};
}
/**
* Creates a function that performs a mathematical operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @param {number} [defaultValue] The value used for `undefined` arguments.
* @returns {Function} Returns the new mathematical operation function.
*/
function createMathOperation(operator, defaultValue) {
return function(value, other) {
var result;
if (value === undefined && other === undefined) {
return defaultValue;
}
if (value !== undefined) {
result = value;
}
if (other !== undefined) {
if (result === undefined) {
return other;
}
if (typeof value == 'string' || typeof other == 'string') {
value = baseToString(value);
other = baseToString(other);
} else {
value = baseToNumber(value);
other = baseToNumber(other);
}
result = operator(value, other);
}
return result;
};
}
/**
* Creates a function like `_.over`.
*
* @private
* @param {Function} arrayFunc The function to iterate over iteratees.
* @returns {Function} Returns the new over function.
*/
function createOver(arrayFunc) {
return flatRest(function(iteratees) {
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
return baseRest(function(args) {
var thisArg = this;
return arrayFunc(iteratees, function(iteratee) {
return apply(iteratee, thisArg, args);
});
});
});
}
/**
* Creates the padding for `string` based on `length`. The `chars` string
* is truncated if the number of characters exceeds `length`.
*
* @private
* @param {number} length The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padding for `string`.
*/
function createPadding(length, chars) {
chars = chars === undefined ? ' ' : baseToString(chars);
var charsLength = chars.length;
if (charsLength < 2) {
return charsLength ? baseRepeat(chars, length) : chars;
}
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
return hasUnicode(chars)
? castSlice(stringToArray(result), 0, length).join('')
: result.slice(0, length);
}
/**
* Creates a function that wraps `func` to invoke it with the `this` binding
* of `thisArg` and `partials` prepended to the arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} partials The arguments to prepend to those provided to
* the new function.
* @returns {Function} Returns the new wrapped function.
*/
function createPartial(func, bitmask, thisArg, partials) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var argsIndex = -1,
argsLength = arguments.length,
leftIndex = -1,
leftLength = partials.length,
args = Array(leftLength + argsLength),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
while (++leftIndex < leftLength) {
args[leftIndex] = partials[leftIndex];
}
while (argsLength--) {
args[leftIndex++] = arguments[++argsIndex];
}
return apply(fn, isBind ? thisArg : this, args);
}
return wrapper;
}
/**
* Creates a `_.range` or `_.rangeRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new range function.
*/
function createRange(fromRight) {
return function(start, end, step) {
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
end = step = undefined;
}
// Ensure the sign of `-0` is preserved.
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
return baseRange(start, end, step, fromRight);
};
}
/**
* Creates a function that performs a relational operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @returns {Function} Returns the new relational operation function.
*/
function createRelationalOperation(operator) {
return function(value, other) {
if (!(typeof value == 'string' && typeof other == 'string')) {
value = toNumber(value);
other = toNumber(other);
}
return operator(value, other);
};
}
/**
* Creates a function that wraps `func` to continue currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {Function} wrapFunc The function to create the `func` wrapper.
* @param {*} placeholder The placeholder value.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
var isCurry = bitmask & WRAP_CURRY_FLAG,
newHolders = isCurry ? holders : undefined,
newHoldersRight = isCurry ? undefined : holders,
newPartials = isCurry ? partials : undefined,
newPartialsRight = isCurry ? undefined : partials;
bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
}
var newData = [
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
newHoldersRight, argPos, ary, arity
];
var result = wrapFunc.apply(undefined, newData);
if (isLaziable(func)) {
setData(result, newData);
}
result.placeholder = placeholder;
return setWrapToString(result, func, bitmask);
}
/**
* Creates a function like `_.round`.
*
* @private
* @param {string} methodName The name of the `Math` method to use when rounding.
* @returns {Function} Returns the new round function.
*/
function createRound(methodName) {
var func = Math[methodName];
return function(number, precision) {
number = toNumber(number);
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
if (precision && nativeIsFinite(number)) {
// Shift with exponential notation to avoid floating-point issues.
// See [MDN](https://mdn.io/round#Examples) for more details.
var pair = (toString(number) + 'e').split('e'),
value = func(pair[0] + 'e' + (+pair[1] + precision));
pair = (toString(value) + 'e').split('e');
return +(pair[0] + 'e' + (+pair[1] - precision));
}
return func(number);
};
}
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
/**
* Creates a `_.toPairs` or `_.toPairsIn` function.
*
* @private
* @param {Function} keysFunc The function to get the keys of a given object.
* @returns {Function} Returns the new pairs function.
*/
function createToPairs(keysFunc) {
return function(object) {
var tag = getTag(object);
if (tag == mapTag) {
return mapToArray(object);
}
if (tag == setTag) {
return setToPairs(object);
}
return baseToPairs(object, keysFunc(object));
};
}
/**
* Creates a function that either curries or invokes `func` with optional
* `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags.
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry` or `_.curryRight` of a bound function
* 8 - `_.curry`
* 16 - `_.curryRight`
* 32 - `_.partial`
* 64 - `_.partialRight`
* 128 - `_.rearg`
* 256 - `_.ary`
* 512 - `_.flip`
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to be partially applied.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
if (!isBindKey && typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
partials = holders = undefined;
}
ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
arity = arity === undefined ? arity : toInteger(arity);
length -= holders ? holders.length : 0;
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
var partialsRight = partials,
holdersRight = holders;
partials = holders = undefined;
}
var data = isBindKey ? undefined : getData(func);
var newData = [
func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
argPos, ary, arity
];
if (data) {
mergeData(newData, data);
}
func = newData[0];
bitmask = newData[1];
thisArg = newData[2];
partials = newData[3];
holders = newData[4];
arity = newData[9] = newData[9] === undefined
? (isBindKey ? 0 : func.length)
: nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
}
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
var result = createBind(func, bitmask, thisArg);
} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
result = createCurry(func, bitmask, arity);
} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
result = createPartial(func, bitmask, thisArg, partials);
} else {
result = createHybrid.apply(undefined, newData);
}
var setter = data ? baseSetData : setData;
return setWrapToString(setter(result, newData), func, bitmask);
}
/**
* Used by `_.defaults` to customize its `_.assignIn` use to assign properties
* of source objects to the destination object for all destination properties
* that resolve to `undefined`.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to assign.
* @param {Object} object The parent object of `objValue`.
* @returns {*} Returns the value to assign.
*/
function customDefaultsAssignIn(objValue, srcValue, key, object) {
if (objValue === undefined ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
return srcValue;
}
return objValue;
}
/**
* Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
* objects into destination objects that are passed thru.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to merge.
* @param {Object} object The parent object of `objValue`.
* @param {Object} source The parent object of `srcValue`.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
* @returns {*} Returns the value to assign.
*/
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
if (isObject(objValue) && isObject(srcValue)) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, objValue);
baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
stack['delete'](srcValue);
}
return objValue;
}
/**
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
* objects.
*
* @private
* @param {*} value The value to inspect.
* @param {string} key The key of the property to inspect.
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
*/
function customOmitClone(value) {
return isPlainObject(value) ? undefined : value;
}
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Check that cyclic values are equal.
var arrStacked = stack.get(array);
var othStacked = stack.get(other);
if (arrStacked && othStacked) {
return arrStacked == other && othStacked == array;
}
var index = -1,
result = true,
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
objProps = getAllKeys(object),
objLength = objProps.length,
othProps = getAllKeys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false;
}
}
// Check that cyclic values are equal.
var objStacked = stack.get(object);
var othStacked = stack.get(other);
if (objStacked && othStacked) {
return objStacked == other && othStacked == object;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
/**
* A specialized version of `baseRest` which flattens the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
function flatRest(func) {
return setToString(overRest(func, undefined, flatten), func + '');
}
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
/**
* Creates an array of own and inherited enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
/**
* Gets metadata for `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
var getData = !metaMap ? noop : function(func) {
return metaMap.get(func);
};
/**
* Gets the name of `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
function getFuncName(func) {
var result = (func.name + ''),
array = realNames[result],
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
while (length--) {
var data = array[length],
otherFunc = data.func;
if (otherFunc == null || otherFunc == func) {
return data.name;
}
}
return result;
}
/**
* Gets the argument placeholder value for `func`.
*
* @private
* @param {Function} func The function to inspect.
* @returns {*} Returns the placeholder value.
*/
function getHolder(func) {
var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
return object.placeholder;
}
/**
* Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
* this function returns the custom method, otherwise it returns `baseIteratee`.
* If arguments are provided, the chosen function is invoked with them and
* its result is returned.
*
* @private
* @param {*} [value] The value to convert to an iteratee.
* @param {number} [arity] The arity of the created iteratee.
* @returns {Function} Returns the chosen function or its result.
*/
function getIteratee() {
var result = lodash.iteratee || iteratee;
result = result === iteratee ? baseIteratee : result;
return arguments.length ? result(arguments[0], arguments[1]) : result;
}
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
/**
* Creates an array of the own enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag;
}
}
return result;
};
}
/**
* Gets the view, applying any `transforms` to the `start` and `end` positions.
*
* @private
* @param {number} start The start of the view.
* @param {number} end The end of the view.
* @param {Array} transforms The transformations to apply to the view.
* @returns {Object} Returns an object containing the `start` and `end`
* positions of the view.
*/
function getView(start, end, transforms) {
var index = -1,
length = transforms.length;
while (++index < length) {
var data = transforms[index],
size = data.size;
switch (data.type) {
case 'drop': start += size; break;
case 'dropRight': end -= size; break;
case 'take': end = nativeMin(end, start + size); break;
case 'takeRight': start = nativeMax(start, end - size); break;
}
}
return { 'start': start, 'end': end };
}
/**
* Extracts wrapper details from the `source` body comment.
*
* @private
* @param {string} source The source to inspect.
* @returns {Array} Returns the wrapper details.
*/
function getWrapDetails(source) {
var match = source.match(reWrapDetails);
return match ? match[1].split(reSplitDetails) : [];
}
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object));
}
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = new array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object))
: {};
}
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return new Ctor;
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return new Ctor;
case symbolTag:
return cloneSymbol(object);
}
}
/**
* Inserts wrapper `details` in a comment at the top of the `source` body.
*
* @private
* @param {string} source The source to modify.
* @returns {Array} details The details to insert.
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length;
if (!length) {
return source;
}
var lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(type == 'number' ||
(type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has a lazy counterpart.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` has a lazy counterpart,
* else `false`.
*/
function isLaziable(func) {
var funcName = getFuncName(func),
other = lodash[funcName];
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
return false;
}
if (func === other) {
return true;
}
var data = getData(other);
return !!data && func === data[0];
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Checks if `func` is capable of being masked.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `func` is maskable, else `false`.
*/
var isMaskable = coreJsData ? isFunction : stubFalse;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object)));
};
}
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
* may be applied regardless of execution order. Methods like `_.ary` and
* `_.rearg` modify function arguments, making the order in which they are
* executed important, preventing the merging of metadata. However, we make
* an exception for a safe combined case where curried functions have `_.ary`
* and or `_.rearg` applied.
*
* @private
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo =
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
// Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) {
return data;
}
// Use source `thisArg` if available.
if (srcBitmask & WRAP_BIND_FLAG) {
data[2] = source[2];
// Set when currying a bound function.
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
}
// Compose partial arguments.
var value = source[3];
if (value) {
var partials = data[3];
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
}
// Compose partial right arguments.
value = source[5];
if (value) {
partials = data[5];
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
}
// Use source `argPos` if available.
value = source[7];
if (value) {
data[7] = value;
}
// Use source `ary` if it's smaller.
if (srcBitmask & WRAP_ARY_FLAG) {
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
}
// Use source `arity` if one is not provided.
if (data[9] == null) {
data[9] = source[9];
}
// Use source `func` and merge bitmasks.
data[0] = source[0];
data[1] = newBitmask;
return data;
}
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
/**
* Reorder `array` according to the specified indexes where the element at
* the first index is assigned as the first element, the element at
* the second index is assigned as the second element, and so on.
*
* @private
* @param {Array} array The array to reorder.
* @param {Array} indexes The arranged array indexes.
* @returns {Array} Returns `array`.
*/
function reorder(array, indexes) {
var arrLength = array.length,
length = nativeMin(indexes.length, arrLength),
oldArray = copyArray(array);
while (length--) {
var index = indexes[length];
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
}
return array;
}
/**
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function safeGet(object, key) {
if (key === 'constructor' && typeof object[key] === 'function') {
return;
}
if (key == '__proto__') {
return;
}
return object[key];
}
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity
* function to avoid garbage collection pauses in V8. See
* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
* for more details.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var setData = shortOut(baseSetData);
/**
* A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
*
* @private
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @returns {number|Object} Returns the timer id or timeout object.
*/
var setTimeout = ctxSetTimeout || function(func, wait) {
return root.setTimeout(func, wait);
};
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
/**
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
* with wrapper details in a comment at the top of the source body.
*
* @private
* @param {Function} wrapper The function to modify.
* @param {Function} reference The reference function.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Function} Returns `wrapper`.
*/
function setWrapToString(wrapper, reference, bitmask) {
var source = (reference + '');
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
}
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
/**
* A specialized version of `_.shuffle` which mutates and sets the size of `array`.
*
* @private
* @param {Array} array The array to shuffle.
* @param {number} [size=array.length] The size of `array`.
* @returns {Array} Returns `array`.
*/
function shuffleSelf(array, size) {
var index = -1,
length = array.length,
lastIndex = length - 1;
size = size === undefined ? length : size;
while (++index < size) {
var rand = baseRandom(index, lastIndex),
value = array[rand];
array[rand] = array[index];
array[index] = value;
}
array.length = size;
return array;
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (string.charCodeAt(0) === 46 /* . */) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Updates wrapper `details` based on `bitmask` flags.
*
* @private
* @returns {Array} details The details to modify.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Array} Returns `details`.
*/
function updateWrapDetails(details, bitmask) {
arrayEach(wrapFlags, function(pair) {
var value = '_.' + pair[0];
if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
details.push(value);
}
});
return details.sort();
}
/**
* Creates a clone of `wrapper`.
*
* @private
* @param {Object} wrapper The wrapper to clone.
* @returns {Object} Returns the cloned wrapper.
*/
function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
/*------------------------------------------------------------------------*/
/**
* Creates an array of elements split into groups the length of `size`.
* If `array` can't be split evenly, the final chunk will be the remaining
* elements.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to process.
* @param {number} [size=1] The length of each chunk
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the new array of chunks.
* @example
*
* _.chunk(['a', 'b', 'c', 'd'], 2);
* // => [['a', 'b'], ['c', 'd']]
*
* _.chunk(['a', 'b', 'c', 'd'], 3);
* // => [['a', 'b', 'c'], ['d']]
*/
function chunk(array, size, guard) {
if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
size = 1;
} else {
size = nativeMax(toInteger(size), 0);
}
var length = array == null ? 0 : array.length;
if (!length || size < 1) {
return [];
}
var index = 0,
resIndex = 0,
result = Array(nativeCeil(length / size));
while (index < length) {
result[resIndex++] = baseSlice(array, index, (index += size));
}
return result;
}
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are falsey.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to compact.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[resIndex++] = value;
}
}
return result;
}
/**
* Creates a new array concatenating `array` with any additional arrays
* and/or values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to concatenate.
* @param {...*} [values] The values to concatenate.
* @returns {Array} Returns the new concatenated array.
* @example
*
* var array = [1];
* var other = _.concat(array, 2, [3], [[4]]);
*
* console.log(other);
* // => [1, 2, 3, [4]]
*
* console.log(array);
* // => [1]
*/
function concat() {
var length = arguments.length;
if (!length) {
return [];
}
var args = Array(length - 1),
array = arguments[0],
index = length;
while (index--) {
args[index - 1] = arguments[index];
}
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
}
/**
* Creates an array of `array` values not included in the other given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* **Note:** Unlike `_.pullAll`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.without, _.xor
* @example
*
* _.difference([2, 1], [2, 3]);
* // => [1]
*/
var difference = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: [];
});
/**
* This method is like `_.difference` except that it accepts `iteratee` which
* is invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. The order and references of result values are
* determined by the first array. The iteratee is invoked with one argument:
* (value).
*
* **Note:** Unlike `_.pullAllBy`, this method returns a new array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [1.2]
*
* // The `_.property` iteratee shorthand.
* _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var differenceBy = baseRest(function(array, values) {
var iteratee = last(values);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
: [];
});
/**
* This method is like `_.difference` except that it accepts `comparator`
* which is invoked to compare elements of `array` to `values`. The order and
* references of result values are determined by the first array. The comparator
* is invoked with two arguments: (arrVal, othVal).
*
* **Note:** Unlike `_.pullAllWith`, this method returns a new array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
*
* _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
* // => [{ 'x': 2, 'y': 1 }]
*/
var differenceWith = baseRest(function(array, values) {
var comparator = last(values);
if (isArrayLikeObject(comparator)) {
comparator = undefined;
}
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
: [];
});
/**
* Creates a slice of `array` with `n` elements dropped from the beginning.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.drop([1, 2, 3]);
* // => [2, 3]
*
* _.drop([1, 2, 3], 2);
* // => [3]
*
* _.drop([1, 2, 3], 5);
* // => []
*
* _.drop([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function drop(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
return baseSlice(array, n < 0 ? 0 : n, length);
}
/**
* Creates a slice of `array` with `n` elements dropped from the end.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.dropRight([1, 2, 3]);
* // => [1, 2]
*
* _.dropRight([1, 2, 3], 2);
* // => [1]
*
* _.dropRight([1, 2, 3], 5);
* // => []
*
* _.dropRight([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function dropRight(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` excluding elements dropped from the end.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.dropRightWhile(users, function(o) { return !o.active; });
* // => objects for ['barney']
*
* // The `_.matches` iteratee shorthand.
* _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
* // => objects for ['barney', 'fred']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.dropRightWhile(users, ['active', false]);
* // => objects for ['barney']
*
* // The `_.property` iteratee shorthand.
* _.dropRightWhile(users, 'active');
* // => objects for ['barney', 'fred', 'pebbles']
*/
function dropRightWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), true, true)
: [];
}
/**
* Creates a slice of `array` excluding elements dropped from the beginning.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.dropWhile(users, function(o) { return !o.active; });
* // => objects for ['pebbles']
*
* // The `_.matches` iteratee shorthand.
* _.dropWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['fred', 'pebbles']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.dropWhile(users, ['active', false]);
* // => objects for ['pebbles']
*
* // The `_.property` iteratee shorthand.
* _.dropWhile(users, 'active');
* // => objects for ['barney', 'fred', 'pebbles']
*/
function dropWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), true)
: [];
}
/**
* Fills elements of `array` with `value` from `start` up to, but not
* including, `end`.
*
* **Note:** This method mutates `array`.
*
* @static
* @memberOf _
* @since 3.2.0
* @category Array
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.fill(array, 'a');
* console.log(array);
* // => ['a', 'a', 'a']
*
* _.fill(Array(3), 2);
* // => [2, 2, 2]
*
* _.fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*/
function fill(array, value, start, end) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
start = 0;
end = length;
}
return baseFill(array, value, start, end);
}
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, getIteratee(predicate, 3), index);
}
/**
* This method is like `_.findIndex` except that it iterates over elements
* of `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
* // => 2
*
* // The `_.matches` iteratee shorthand.
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
* // => 0
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findLastIndex(users, ['active', false]);
* // => 2
*
* // The `_.property` iteratee shorthand.
* _.findLastIndex(users, 'active');
* // => 0
*/
function findLastIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = length - 1;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = fromIndex < 0
? nativeMax(length + index, 0)
: nativeMin(index, length - 1);
}
return baseFindIndex(array, getIteratee(predicate, 3), index, true);
}
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
/**
* Recursively flattens `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flattenDeep([1, [2, [3, [4]], 5]]);
* // => [1, 2, 3, 4, 5]
*/
function flattenDeep(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, INFINITY) : [];
}
/**
* Recursively flatten `array` up to `depth` times.
*
* @static
* @memberOf _
* @since 4.4.0
* @category Array
* @param {Array} array The array to flatten.
* @param {number} [depth=1] The maximum recursion depth.
* @returns {Array} Returns the new flattened array.
* @example
*
* var array = [1, [2, [3, [4]], 5]];
*
* _.flattenDepth(array, 1);
* // => [1, 2, [3, [4]], 5]
*
* _.flattenDepth(array, 2);
* // => [1, 2, 3, [4], 5]
*/
function flattenDepth(array, depth) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
depth = depth === undefined ? 1 : toInteger(depth);
return baseFlatten(array, depth);
}
/**
* The inverse of `_.toPairs`; this method returns an object composed
* from key-value `pairs`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} pairs The key-value pairs.
* @returns {Object} Returns the new object.
* @example
*
* _.fromPairs([['a', 1], ['b', 2]]);
* // => { 'a': 1, 'b': 2 }
*/
function fromPairs(pairs) {
var index = -1,
length = pairs == null ? 0 : pairs.length,
result = {};
while (++index < length) {
var pair = pairs[index];
result[pair[0]] = pair[1];
}
return result;
}
/**
* Gets the first element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias first
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the first element of `array`.
* @example
*
* _.head([1, 2, 3]);
* // => 1
*
* _.head([]);
* // => undefined
*/
function head(array) {
return (array && array.length) ? array[0] : undefined;
}
/**
* Gets the index at which the first occurrence of `value` is found in `array`
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. If `fromIndex` is negative, it's used as the
* offset from the end of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.indexOf([1, 2, 1, 2], 2);
* // => 1
*
* // Search from the `fromIndex`.
* _.indexOf([1, 2, 1, 2], 2, 2);
* // => 3
*/
function indexOf(array, value, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseIndexOf(array, value, index);
}
/**
* Gets all but the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.initial([1, 2, 3]);
* // => [1, 2]
*/
function initial(array) {
var length = array == null ? 0 : array.length;
return length ? baseSlice(array, 0, -1) : [];
}
/**
* Creates an array of unique values that are included in all given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersection([2, 1], [2, 3]);
* // => [2]
*/
var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped)
: [];
});
/**
* This method is like `_.intersection` except that it accepts `iteratee`
* which is invoked for each element of each `arrays` to generate the criterion
* by which they're compared. The order and references of result values are
* determined by the first array. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [2.1]
*
* // The `_.property` iteratee shorthand.
* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }]
*/
var intersectionBy = baseRest(function(arrays) {
var iteratee = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
if (iteratee === last(mapped)) {
iteratee = undefined;
} else {
mapped.pop();
}
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, getIteratee(iteratee, 2))
: [];
});
/**
* This method is like `_.intersection` except that it accepts `comparator`
* which is invoked to compare elements of `arrays`. The order and references
* of result values are determined by the first array. The comparator is
* invoked with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.intersectionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }]
*/
var intersectionWith = baseRest(function(arrays) {
var comparator = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
comparator = typeof comparator == 'function' ? comparator : undefined;
if (comparator) {
mapped.pop();
}
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, undefined, comparator)
: [];
});
/**
* Converts all elements in `array` into a string separated by `separator`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to convert.
* @param {string} [separator=','] The element separator.
* @returns {string} Returns the joined string.
* @example
*
* _.join(['a', 'b', 'c'], '~');
* // => 'a~b~c'
*/
function join(array, separator) {
return array == null ? '' : nativeJoin.call(array, separator);
}
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
/**
* This method is like `_.indexOf` except that it iterates over elements of
* `array` from right to left.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.lastIndexOf([1, 2, 1, 2], 2);
* // => 3
*
* // Search from the `fromIndex`.
* _.lastIndexOf([1, 2, 1, 2], 2, 2);
* // => 1
*/
function lastIndexOf(array, value, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = length;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
}
return value === value
? strictLastIndexOf(array, value, index)
: baseFindIndex(array, baseIsNaN, index, true);
}
/**
* Gets the element at index `n` of `array`. If `n` is negative, the nth
* element from the end is returned.
*
* @static
* @memberOf _
* @since 4.11.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=0] The index of the element to return.
* @returns {*} Returns the nth element of `array`.
* @example
*
* var array = ['a', 'b', 'c', 'd'];
*
* _.nth(array, 1);
* // => 'b'
*
* _.nth(array, -2);
* // => 'c';
*/
function nth(array, n) {
return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
}
/**
* Removes all given values from `array` using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
* to remove elements from an array by predicate.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {...*} [values] The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pull(array, 'a', 'c');
* console.log(array);
* // => ['b', 'b']
*/
var pull = baseRest(pullAll);
/**
* This method is like `_.pull` except that it accepts an array of values to remove.
*
* **Note:** Unlike `_.difference`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pullAll(array, ['a', 'c']);
* console.log(array);
* // => ['b', 'b']
*/
function pullAll(array, values) {
return (array && array.length && values && values.length)
? basePullAll(array, values)
: array;
}
/**
* This method is like `_.pullAll` except that it accepts `iteratee` which is
* invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. The iteratee is invoked with one argument: (value).
*
* **Note:** Unlike `_.differenceBy`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
*
* _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
* console.log(array);
* // => [{ 'x': 2 }]
*/
function pullAllBy(array, values, iteratee) {
return (array && array.length && values && values.length)
? basePullAll(array, values, getIteratee(iteratee, 2))
: array;
}
/**
* This method is like `_.pullAll` except that it accepts `comparator` which
* is invoked to compare elements of `array` to `values`. The comparator is
* invoked with two arguments: (arrVal, othVal).
*
* **Note:** Unlike `_.differenceWith`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
*
* _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
* console.log(array);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
*/
function pullAllWith(array, values, comparator) {
return (array && array.length && values && values.length)
? basePullAll(array, values, undefined, comparator)
: array;
}
/**
* Removes elements from `array` corresponding to `indexes` and returns an
* array of removed elements.
*
* **Note:** Unlike `_.at`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {...(number|number[])} [indexes] The indexes of elements to remove.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = ['a', 'b', 'c', 'd'];
* var pulled = _.pullAt(array, [1, 3]);
*
* console.log(array);
* // => ['a', 'c']
*
* console.log(pulled);
* // => ['b', 'd']
*/
var pullAt = flatRest(function(array, indexes) {
var length = array == null ? 0 : array.length,
result = baseAt(array, indexes);
basePullAt(array, arrayMap(indexes, function(index) {
return isIndex(index, length) ? +index : index;
}).sort(compareAscending));
return result;
});
/**
* Removes all elements from `array` that `predicate` returns truthy for
* and returns an array of the removed elements. The predicate is invoked
* with three arguments: (value, index, array).
*
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
* to pull elements from an array by value.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [1, 2, 3, 4];
* var evens = _.remove(array, function(n) {
* return n % 2 == 0;
* });
*
* console.log(array);
* // => [1, 3]
*
* console.log(evens);
* // => [2, 4]
*/
function remove(array, predicate) {
var result = [];
if (!(array && array.length)) {
return result;
}
var index = -1,
indexes = [],
length = array.length;
predicate = getIteratee(predicate, 3);
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result.push(value);
indexes.push(index);
}
}
basePullAt(array, indexes);
return result;
}
/**
* Reverses `array` so that the first element becomes the last, the second
* element becomes the second to last, and so on.
*
* **Note:** This method mutates `array` and is based on
* [`Array#reverse`](https://mdn.io/Array/reverse).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.reverse(array);
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function reverse(array) {
return array == null ? array : nativeReverse.call(array);
}
/**
* Creates a slice of `array` from `start` up to, but not including, `end`.
*
* **Note:** This method is used instead of
* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
* returned.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function slice(array, start, end) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
start = 0;
end = length;
}
else {
start = start == null ? 0 : toInteger(start);
end = end === undefined ? length : toInteger(end);
}
return baseSlice(array, start, end);
}
/**
* Uses a binary search to determine the lowest index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedIndex([30, 50], 40);
* // => 1
*/
function sortedIndex(array, value) {
return baseSortedIndex(array, value);
}
/**
* This method is like `_.sortedIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* var objects = [{ 'x': 4 }, { 'x': 5 }];
*
* _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.sortedIndexBy(objects, { 'x': 4 }, 'x');
* // => 0
*/
function sortedIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
}
/**
* This method is like `_.indexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedIndexOf([4, 5, 5, 5, 6], 5);
* // => 1
*/
function sortedIndexOf(array, value) {
var length = array == null ? 0 : array.length;
if (length) {
var index = baseSortedIndex(array, value);
if (index < length && eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.sortedIndex` except that it returns the highest
* index at which `value` should be inserted into `array` in order to
* maintain its sort order.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedLastIndex([4, 5, 5, 5, 6], 5);
* // => 4
*/
function sortedLastIndex(array, value) {
return baseSortedIndex(array, value, true);
}
/**
* This method is like `_.sortedLastIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* var objects = [{ 'x': 4 }, { 'x': 5 }];
*
* _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
* // => 1
*
* // The `_.property` iteratee shorthand.
* _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
* // => 1
*/
function sortedLastIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
}
/**
* This method is like `_.lastIndexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
* // => 3
*/
function sortedLastIndexOf(array, value) {
var length = array == null ? 0 : array.length;
if (length) {
var index = baseSortedIndex(array, value, true) - 1;
if (eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.uniq` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniq([1, 1, 2]);
* // => [1, 2]
*/
function sortedUniq(array) {
return (array && array.length)
? baseSortedUniq(array)
: [];
}
/**
* This method is like `_.uniqBy` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
* // => [1.1, 2.3]
*/
function sortedUniqBy(array, iteratee) {
return (array && array.length)
? baseSortedUniq(array, getIteratee(iteratee, 2))
: [];
}
/**
* Gets all but the first element of `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.tail([1, 2, 3]);
* // => [2, 3]
*/
function tail(array) {
var length = array == null ? 0 : array.length;
return length ? baseSlice(array, 1, length) : [];
}
/**
* Creates a slice of `array` with `n` elements taken from the beginning.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.take([1, 2, 3]);
* // => [1]
*
* _.take([1, 2, 3], 2);
* // => [1, 2]
*
* _.take([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.take([1, 2, 3], 0);
* // => []
*/
function take(array, n, guard) {
if (!(array && array.length)) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` with `n` elements taken from the end.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.takeRight([1, 2, 3]);
* // => [3]
*
* _.takeRight([1, 2, 3], 2);
* // => [2, 3]
*
* _.takeRight([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.takeRight([1, 2, 3], 0);
* // => []
*/
function takeRight(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, n < 0 ? 0 : n, length);
}
/**
* Creates a slice of `array` with elements taken from the end. Elements are
* taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.takeRightWhile(users, function(o) { return !o.active; });
* // => objects for ['fred', 'pebbles']
*
* // The `_.matches` iteratee shorthand.
* _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
* // => objects for ['pebbles']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeRightWhile(users, ['active', false]);
* // => objects for ['fred', 'pebbles']
*
* // The `_.property` iteratee shorthand.
* _.takeRightWhile(users, 'active');
* // => []
*/
function takeRightWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), false, true)
: [];
}
/**
* Creates a slice of `array` with elements taken from the beginning. Elements
* are taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.takeWhile(users, function(o) { return !o.active; });
* // => objects for ['barney', 'fred']
*
* // The `_.matches` iteratee shorthand.
* _.takeWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeWhile(users, ['active', false]);
* // => objects for ['barney', 'fred']
*
* // The `_.property` iteratee shorthand.
* _.takeWhile(users, 'active');
* // => []
*/
function takeWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3))
: [];
}
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
/**
* This method is like `_.union` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which uniqueness is computed. Result values are chosen from the first
* array in which the value occurs. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.unionBy([2.1], [1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
var unionBy = baseRest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
});
/**
* This method is like `_.union` except that it accepts `comparator` which
* is invoked to compare elements of `arrays`. Result values are chosen from
* the first array in which the value occurs. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.unionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var unionWith = baseRest(function(arrays) {
var comparator = last(arrays);
comparator = typeof comparator == 'function' ? comparator : undefined;
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons, in which only the first occurrence of each element
* is kept. The order of result values is determined by the order they occur
* in the array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniq([2, 1, 2]);
* // => [2, 1]
*/
function uniq(array) {
return (array && array.length) ? baseUniq(array) : [];
}
/**
* This method is like `_.uniq` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* uniqueness is computed. The order of result values is determined by the
* order they occur in the array. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniqBy([2.1, 1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
function uniqBy(array, iteratee) {
return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
}
/**
* This method is like `_.uniq` except that it accepts `comparator` which
* is invoked to compare elements of `array`. The order of result values is
* determined by the order they occur in the array.The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.uniqWith(objects, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
*/
function uniqWith(array, comparator) {
comparator = typeof comparator == 'function' ? comparator : undefined;
return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
}
/**
* This method is like `_.zip` except that it accepts an array of grouped
* elements and creates an array regrouping the elements to their pre-zip
* configuration.
*
* @static
* @memberOf _
* @since 1.2.0
* @category Array
* @param {Array} array The array of grouped elements to process.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
* // => [['a', 1, true], ['b', 2, false]]
*
* _.unzip(zipped);
* // => [['a', 'b'], [1, 2], [true, false]]
*/
function unzip(array) {
if (!(array && array.length)) {
return [];
}
var length = 0;
array = arrayFilter(array, function(group) {
if (isArrayLikeObject(group)) {
length = nativeMax(group.length, length);
return true;
}
});
return baseTimes(length, function(index) {
return arrayMap(array, baseProperty(index));
});
}
/**
* This method is like `_.unzip` except that it accepts `iteratee` to specify
* how regrouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Array
* @param {Array} array The array of grouped elements to process.
* @param {Function} [iteratee=_.identity] The function to combine
* regrouped values.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip([1, 2], [10, 20], [100, 200]);
* // => [[1, 10, 100], [2, 20, 200]]
*
* _.unzipWith(zipped, _.add);
* // => [3, 30, 300]
*/
function unzipWith(array, iteratee) {
if (!(array && array.length)) {
return [];
}
var result = unzip(array);
if (iteratee == null) {
return result;
}
return arrayMap(result, function(group) {
return apply(iteratee, undefined, group);
});
}
/**
* Creates an array excluding all given values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.pull`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...*} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.xor
* @example
*
* _.without([2, 1, 2, 3], 1, 2);
* // => [3]
*/
var without = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, values)
: [];
});
/**
* Creates an array of unique values that is the
* [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the given arrays. The order of result values is determined by the order
* they occur in the arrays.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.without
* @example
*
* _.xor([2, 1], [2, 3]);
* // => [1, 3]
*/
var xor = baseRest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
/**
* This method is like `_.xor` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which by which they're compared. The order of result values is determined
* by the order they occur in the arrays. The iteratee is invoked with one
* argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [1.2, 3.4]
*
* // The `_.property` iteratee shorthand.
* _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var xorBy = baseRest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
});
/**
* This method is like `_.xor` except that it accepts `comparator` which is
* invoked to compare elements of `arrays`. The order of result values is
* determined by the order they occur in the arrays. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.xorWith(objects, others, _.isEqual);
* // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var xorWith = baseRest(function(arrays) {
var comparator = last(arrays);
comparator = typeof comparator == 'function' ? comparator : undefined;
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
});
/**
* Creates an array of grouped elements, the first of which contains the
* first elements of the given arrays, the second of which contains the
* second elements of the given arrays, and so on.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zip(['a', 'b'], [1, 2], [true, false]);
* // => [['a', 1, true], ['b', 2, false]]
*/
var zip = baseRest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
/**
* This method is like `_.zipObject` except that it supports property paths.
*
* @static
* @memberOf _
* @since 4.1.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
* // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
*/
function zipObjectDeep(props, values) {
return baseZipObject(props || [], values || [], baseSet);
}
/**
* This method is like `_.zip` except that it accepts `iteratee` to specify
* how grouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @param {Function} [iteratee=_.identity] The function to combine
* grouped values.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
* return a + b + c;
* });
* // => [111, 222]
*/
var zipWith = baseRest(function(arrays) {
var length = arrays.length,
iteratee = length > 1 ? arrays[length - 1] : undefined;
iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
return unzipWith(arrays, iteratee);
});
/*------------------------------------------------------------------------*/
/**
* Creates a `lodash` wrapper instance that wraps `value` with explicit method
* chain sequences enabled. The result of such sequences must be unwrapped
* with `_#value`.
*
* @static
* @memberOf _
* @since 1.3.0
* @category Seq
* @param {*} value The value to wrap.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'pebbles', 'age': 1 }
* ];
*
* var youngest = _
* .chain(users)
* .sortBy('age')
* .map(function(o) {
* return o.user + ' is ' + o.age;
* })
* .head()
* .value();
* // => 'pebbles is 1'
*/
function chain(value) {
var result = lodash(value);
result.__chain__ = true;
return result;
}
/**
* This method invokes `interceptor` and returns `value`. The interceptor
* is invoked with one argument; (value). The purpose of this method is to
* "tap into" a method chain sequence in order to modify intermediate results.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Seq
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns `value`.
* @example
*
* _([1, 2, 3])
* .tap(function(array) {
* // Mutate input array.
* array.pop();
* })
* .reverse()
* .value();
* // => [2, 1]
*/
function tap(value, interceptor) {
interceptor(value);
return value;
}
/**
* This method is like `_.tap` except that it returns the result of `interceptor`.
* The purpose of this method is to "pass thru" values replacing intermediate
* results in a method chain sequence.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Seq
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns the result of `interceptor`.
* @example
*
* _(' abc ')
* .chain()
* .trim()
* .thru(function(value) {
* return [value];
* })
* .value();
* // => ['abc']
*/
function thru(value, interceptor) {
return interceptor(value);
}
/**
* This method is the wrapper version of `_.at`.
*
* @name at
* @memberOf _
* @since 1.0.0
* @category Seq
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _(object).at(['a[0].b.c', 'a[1]']).value();
* // => [3, 4]
*/
var wrapperAt = flatRest(function(paths) {
var length = paths.length,
start = length ? paths[0] : 0,
value = this.__wrapped__,
interceptor = function(object) { return baseAt(object, paths); };
if (length > 1 || this.__actions__.length ||
!(value instanceof LazyWrapper) || !isIndex(start)) {
return this.thru(interceptor);
}
value = value.slice(start, +start + (length ? 1 : 0));
value.__actions__.push({
'func': thru,
'args': [interceptor],
'thisArg': undefined
});
return new LodashWrapper(value, this.__chain__).thru(function(array) {
if (length && !array.length) {
array.push(undefined);
}
return array;
});
});
/**
* Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
*
* @name chain
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* // A sequence without explicit chaining.
* _(users).head();
* // => { 'user': 'barney', 'age': 36 }
*
* // A sequence with explicit chaining.
* _(users)
* .chain()
* .head()
* .pick('user')
* .value();
* // => { 'user': 'barney' }
*/
function wrapperChain() {
return chain(this);
}
/**
* Executes the chain sequence and returns the wrapped result.
*
* @name commit
* @memberOf _
* @since 3.2.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2];
* var wrapped = _(array).push(3);
*
* console.log(array);
* // => [1, 2]
*
* wrapped = wrapped.commit();
* console.log(array);
* // => [1, 2, 3]
*
* wrapped.last();
* // => 3
*
* console.log(array);
* // => [1, 2, 3]
*/
function wrapperCommit() {
return new LodashWrapper(this.value(), this.__chain__);
}
/**
* Gets the next value on a wrapped object following the
* [iterator protocol](https://mdn.io/iteration_protocols#iterator).
*
* @name next
* @memberOf _
* @since 4.0.0
* @category Seq
* @returns {Object} Returns the next iterator value.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped.next();
* // => { 'done': false, 'value': 1 }
*
* wrapped.next();
* // => { 'done': false, 'value': 2 }
*
* wrapped.next();
* // => { 'done': true, 'value': undefined }
*/
function wrapperNext() {
if (this.__values__ === undefined) {
this.__values__ = toArray(this.value());
}
var done = this.__index__ >= this.__values__.length,
value = done ? undefined : this.__values__[this.__index__++];
return { 'done': done, 'value': value };
}
/**
* Enables the wrapper to be iterable.
*
* @name Symbol.iterator
* @memberOf _
* @since 4.0.0
* @category Seq
* @returns {Object} Returns the wrapper object.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped[Symbol.iterator]() === wrapped;
* // => true
*
* Array.from(wrapped);
* // => [1, 2]
*/
function wrapperToIterator() {
return this;
}
/**
* Creates a clone of the chain sequence planting `value` as the wrapped value.
*
* @name plant
* @memberOf _
* @since 3.2.0
* @category Seq
* @param {*} value The value to plant.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2]).map(square);
* var other = wrapped.plant([3, 4]);
*
* other.value();
* // => [9, 16]
*
* wrapped.value();
* // => [1, 4]
*/
function wrapperPlant(value) {
var result,
parent = this;
while (parent instanceof baseLodash) {
var clone = wrapperClone(parent);
clone.__index__ = 0;
clone.__values__ = undefined;
if (result) {
previous.__wrapped__ = clone;
} else {
result = clone;
}
var previous = clone;
parent = parent.__wrapped__;
}
previous.__wrapped__ = value;
return result;
}
/**
* This method is the wrapper version of `_.reverse`.
*
* **Note:** This method mutates the wrapped array.
*
* @name reverse
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2, 3];
*
* _(array).reverse().value()
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function wrapperReverse() {
var value = this.__wrapped__;
if (value instanceof LazyWrapper) {
var wrapped = value;
if (this.__actions__.length) {
wrapped = new LazyWrapper(this);
}
wrapped = wrapped.reverse();
wrapped.__actions__.push({
'func': thru,
'args': [reverse],
'thisArg': undefined
});
return new LodashWrapper(wrapped, this.__chain__);
}
return this.thru(reverse);
}
/**
* Executes the chain sequence to resolve the unwrapped value.
*
* @name value
* @memberOf _
* @since 0.1.0
* @alias toJSON, valueOf
* @category Seq
* @returns {*} Returns the resolved unwrapped value.
* @example
*
* _([1, 2, 3]).value();
* // => [1, 2, 3]
*/
function wrapperValue() {
return baseWrapperValue(this.__wrapped__, this.__actions__);
}
/*------------------------------------------------------------------------*/
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The corresponding value of
* each key is the number of times the key was returned by `iteratee`. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.5.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.countBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': 1, '6': 2 }
*
* // The `_.property` iteratee shorthand.
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
var countBy = createAggregator(function(result, value, key) {
if (hasOwnProperty.call(result, key)) {
++result[key];
} else {
baseAssignValue(result, key, 1);
}
});
/**
* Checks if `predicate` returns truthy for **all** elements of `collection`.
* Iteration is stopped once `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* **Note:** This method returns `true` for
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
* elements of empty collections.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
* @example
*
* _.every([true, 1, null, 'yes'], Boolean);
* // => false
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.every(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.every(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.every(users, 'active');
* // => false
*/
function every(collection, predicate, guard) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* Iterates over elements of `collection`, returning an array of all elements
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* **Note:** Unlike `_.remove`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @see _.reject
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* _.filter(users, function(o) { return !o.active; });
* // => objects for ['fred']
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, { 'age': 36, 'active': true });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, ['active', false]);
* // => objects for ['fred']
*
* // The `_.property` iteratee shorthand.
* _.filter(users, 'active');
* // => objects for ['barney']
*
* // Combining several predicates using `_.overEvery` or `_.overSome`.
* _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
* // => objects for ['fred', 'barney']
*/
function filter(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, getIteratee(predicate, 3));
}
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
/**
* This method is like `_.find` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=collection.length-1] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* _.findLast([1, 2, 3, 4], function(n) {
* return n % 2 == 1;
* });
* // => 3
*/
var findLast = createFind(findLastIndex);
/**
* Creates a flattened array of values by running each element in `collection`
* thru `iteratee` and flattening the mapped results. The iteratee is invoked
* with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [n, n];
* }
*
* _.flatMap([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMap(collection, iteratee) {
return baseFlatten(map(collection, iteratee), 1);
}
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDeep([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMapDeep(collection, iteratee) {
return baseFlatten(map(collection, iteratee), INFINITY);
}
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results up to `depth` times.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {number} [depth=1] The maximum recursion depth.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDepth([1, 2], duplicate, 2);
* // => [[1, 1], [2, 2]]
*/
function flatMapDepth(collection, iteratee, depth) {
depth = depth === undefined ? 1 : toInteger(depth);
return baseFlatten(map(collection, iteratee), depth);
}
/**
* Iterates over elements of `collection` and invokes `iteratee` for each element.
* The iteratee is invoked with three arguments: (value, index|key, collection).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* **Note:** As with other "Collections" methods, objects with a "length"
* property are iterated like arrays. To avoid this behavior use `_.forIn`
* or `_.forOwn` for object iteration.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias each
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEachRight
* @example
*
* _.forEach([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `1` then `2`.
*
* _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forEach(collection, iteratee) {
var func = isArray(collection) ? arrayEach : baseEach;
return func(collection, getIteratee(iteratee, 3));
}
/**
* This method is like `_.forEach` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @alias eachRight
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEach
* @example
*
* _.forEachRight([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `2` then `1`.
*/
function forEachRight(collection, iteratee) {
var func = isArray(collection) ? arrayEachRight : baseEachRight;
return func(collection, getIteratee(iteratee, 3));
}
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The order of grouped values
* is determined by the order they occur in `collection`. The corresponding
* value of each key is an array of elements responsible for generating the
* key. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.groupBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': [4.2], '6': [6.1, 6.3] }
*
* // The `_.property` iteratee shorthand.
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
var groupBy = createAggregator(function(result, value, key) {
if (hasOwnProperty.call(result, key)) {
result[key].push(value);
} else {
baseAssignValue(result, key, [value]);
}
});
/**
* Checks if `value` is in `collection`. If `collection` is a string, it's
* checked for a substring of `value`, otherwise
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* is used for equality comparisons. If `fromIndex` is negative, it's used as
* the offset from the end of `collection`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {boolean} Returns `true` if `value` is found, else `false`.
* @example
*
* _.includes([1, 2, 3], 1);
* // => true
*
* _.includes([1, 2, 3], 1, 2);
* // => false
*
* _.includes({ 'a': 1, 'b': 2 }, 1);
* // => true
*
* _.includes('abcd', 'bc');
* // => true
*/
function includes(collection, value, fromIndex, guard) {
collection = isArrayLike(collection) ? collection : values(collection);
fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
var length = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return isString(collection)
? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
: (!!length && baseIndexOf(collection, value, fromIndex) > -1);
}
/**
* Invokes the method at `path` of each element in `collection`, returning
* an array of the results of each invoked method. Any additional arguments
* are provided to each invoked method. If `path` is a function, it's invoked
* for, and `this` bound to, each element in `collection`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array|Function|string} path The path of the method to invoke or
* the function invoked per iteration.
* @param {...*} [args] The arguments to invoke each method with.
* @returns {Array} Returns the array of results.
* @example
*
* _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
* // => [[1, 5, 7], [1, 2, 3]]
*
* _.invokeMap([123, 456], String.prototype.split, '');
* // => [['1', '2', '3'], ['4', '5', '6']]
*/
var invokeMap = baseRest(function(collection, path, args) {
var index = -1,
isFunc = typeof path == 'function',
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value) {
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
});
return result;
});
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The corresponding value of
* each key is the last element responsible for generating the key. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* var array = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
* _.keyBy(array, function(o) {
* return String.fromCharCode(o.code);
* });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
* _.keyBy(array, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*/
var keyBy = createAggregator(function(result, value, key) {
baseAssignValue(result, key, value);
});
/**
* Creates an array of values by running each element in `collection` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
* @example
*
* function square(n) {
* return n * n;
* }
*
* _.map([4, 8], square);
* // => [16, 64]
*
* _.map({ 'a': 4, 'b': 8 }, square);
* // => [16, 64] (iteration order is not guaranteed)
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* // The `_.property` iteratee shorthand.
* _.map(users, 'user');
* // => ['barney', 'fred']
*/
function map(collection, iteratee) {
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, getIteratee(iteratee, 3));
}
/**
* This method is like `_.sortBy` except that it allows specifying the sort
* orders of the iteratees to sort by. If `orders` is unspecified, all values
* are sorted in ascending order. Otherwise, specify an order of "desc" for
* descending or "asc" for ascending sort order of corresponding values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
* The iteratees to sort by.
* @param {string[]} [orders] The sort orders of `iteratees`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 34 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 36 }
* ];
*
* // Sort by `user` in ascending order and by `age` in descending order.
* _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*/
function orderBy(collection, iteratees, orders, guard) {
if (collection == null) {
return [];
}
if (!isArray(iteratees)) {
iteratees = iteratees == null ? [] : [iteratees];
}
orders = guard ? undefined : orders;
if (!isArray(orders)) {
orders = orders == null ? [] : [orders];
}
return baseOrderBy(collection, iteratees, orders);
}
/**
* Creates an array of elements split into two groups, the first of which
* contains elements `predicate` returns truthy for, the second of which
* contains elements `predicate` returns falsey for. The predicate is
* invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of grouped elements.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true },
* { 'user': 'pebbles', 'age': 1, 'active': false }
* ];
*
* _.partition(users, function(o) { return o.active; });
* // => objects for [['fred'], ['barney', 'pebbles']]
*
* // The `_.matches` iteratee shorthand.
* _.partition(users, { 'age': 1, 'active': false });
* // => objects for [['pebbles'], ['barney', 'fred']]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.partition(users, ['active', false]);
* // => objects for [['barney', 'pebbles'], ['fred']]
*
* // The `_.property` iteratee shorthand.
* _.partition(users, 'active');
* // => objects for [['fred'], ['barney', 'pebbles']]
*/
var partition = createAggregator(function(result, value, key) {
result[key ? 0 : 1].push(value);
}, function() { return [[], []]; });
/**
* Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` thru `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator`
* is not given, the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
* and `sortBy`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduceRight
* @example
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
* }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* return result;
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
*/
function reduce(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduce : baseReduce,
initAccum = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
}
/**
* This method is like `_.reduce` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduce
* @example
*
* var array = [[0, 1], [2, 3], [4, 5]];
*
* _.reduceRight(array, function(flattened, other) {
* return flattened.concat(other);
* }, []);
* // => [4, 5, 2, 3, 0, 1]
*/
function reduceRight(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduceRight : baseReduce,
initAccum = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
}
/**
* The opposite of `_.filter`; this method returns the elements of `collection`
* that `predicate` does **not** return truthy for.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @see _.filter
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true }
* ];
*
* _.reject(users, function(o) { return !o.active; });
* // => objects for ['fred']
*
* // The `_.matches` iteratee shorthand.
* _.reject(users, { 'age': 40, 'active': true });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.reject(users, ['active', false]);
* // => objects for ['fred']
*
* // The `_.property` iteratee shorthand.
* _.reject(users, 'active');
* // => objects for ['barney']
*/
function reject(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, negate(getIteratee(predicate, 3)));
}
/**
* Gets a random element from `collection`.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*/
function sample(collection) {
var func = isArray(collection) ? arraySample : baseSample;
return func(collection);
}
/**
* Gets `n` random elements at unique keys from `collection` up to the
* size of `collection`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @param {number} [n=1] The number of elements to sample.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the random elements.
* @example
*
* _.sampleSize([1, 2, 3], 2);
* // => [3, 1]
*
* _.sampleSize([1, 2, 3], 4);
* // => [2, 3, 1]
*/
function sampleSize(collection, n, guard) {
if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
n = 1;
} else {
n = toInteger(n);
}
var func = isArray(collection) ? arraySampleSize : baseSampleSize;
return func(collection, n);
}
/**
* Creates an array of shuffled values, using a version of the
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to shuffle.
* @returns {Array} Returns the new shuffled array.
* @example
*
* _.shuffle([1, 2, 3, 4]);
* // => [4, 1, 3, 2]
*/
function shuffle(collection) {
var func = isArray(collection) ? arrayShuffle : baseShuffle;
return func(collection);
}
/**
* Gets the size of `collection` by returning its length for array-like
* values or the number of own enumerable string keyed properties for objects.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @returns {number} Returns the collection size.
* @example
*
* _.size([1, 2, 3]);
* // => 3
*
* _.size({ 'a': 1, 'b': 2 });
* // => 2
*
* _.size('pebbles');
* // => 7
*/
function size(collection) {
if (collection == null) {
return 0;
}
if (isArrayLike(collection)) {
return isString(collection) ? stringSize(collection) : collection.length;
}
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
return baseKeys(collection).length;
}
/**
* Checks if `predicate` returns truthy for **any** element of `collection`.
* Iteration is stopped once `predicate` returns truthy. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
* @example
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.some(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.some(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.some(users, 'active');
* // => true
*/
function some(collection, predicate, guard) {
var func = isArray(collection) ? arraySome : baseSome;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection thru each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to sort by.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 30 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* _.sortBy(users, [function(o) { return o.user; }]);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
*
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
*/
var sortBy = baseRest(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
/*------------------------------------------------------------------------*/
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = ctxNow || function() {
return root.Date.now();
};
/*------------------------------------------------------------------------*/
/**
* The opposite of `_.before`; this method creates a function that invokes
* `func` once it's called `n` or more times.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {number} n The number of calls before `func` is invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var saves = ['profile', 'settings'];
*
* var done = _.after(saves.length, function() {
* console.log('done saving!');
* });
*
* _.forEach(saves, function(type) {
* asyncSave({ 'type': type, 'complete': done });
* });
* // => Logs 'done saving!' after the two async saves have completed.
*/
function after(n, func) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n < 1) {
return func.apply(this, arguments);
}
};
}
/**
* Creates a function that invokes `func`, with up to `n` arguments,
* ignoring any additional arguments.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @param {number} [n=func.length] The arity cap.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
* // => [6, 8, 10]
*/
function ary(func, n, guard) {
n = guard ? undefined : n;
n = (func && n == null) ? func.length : n;
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
}
/**
* Creates a function that invokes `func`, with the `this` binding and arguments
* of the created function, while it's called less than `n` times. Subsequent
* calls to the created function return the result of the last `func` invocation.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {number} n The number of calls at which `func` is no longer invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* jQuery(element).on('click', _.before(5, addContactToList));
* // => Allows adding up to 4 contacts to the list.
*/
function before(n, func) {
var result;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n > 0) {
result = func.apply(this, arguments);
}
if (n <= 1) {
func = undefined;
}
return result;
};
}
/**
* Creates a function that invokes `func` with the `this` binding of `thisArg`
* and `partials` prepended to the arguments it receives.
*
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for partially applied arguments.
*
* **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
* property of bound functions.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to bind.
* @param {*} thisArg The `this` binding of `func`.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* function greet(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
*
* var object = { 'user': 'fred' };
*
* var bound = _.bind(greet, object, 'hi');
* bound('!');
* // => 'hi fred!'
*
* // Bound with placeholders.
* var bound = _.bind(greet, object, _, '!');
* bound('hi');
* // => 'hi fred!'
*/
var bind = baseRest(function(func, thisArg, partials) {
var bitmask = WRAP_BIND_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bind));
bitmask |= WRAP_PARTIAL_FLAG;
}
return createWrap(func, bitmask, thisArg, partials, holders);
});
/**
* Creates a function that invokes the method at `object[key]` with `partials`
* prepended to the arguments it receives.
*
* This method differs from `_.bind` by allowing bound functions to reference
* methods that may be redefined or don't yet exist. See
* [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
* for more details.
*
* The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* @static
* @memberOf _
* @since 0.10.0
* @category Function
* @param {Object} object The object to invoke the method on.
* @param {string} key The key of the method.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* var object = {
* 'user': 'fred',
* 'greet': function(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
* };
*
* var bound = _.bindKey(object, 'greet', 'hi');
* bound('!');
* // => 'hi fred!'
*
* object.greet = function(greeting, punctuation) {
* return greeting + 'ya ' + this.user + punctuation;
* };
*
* bound('!');
* // => 'hiya fred!'
*
* // Bound with placeholders.
* var bound = _.bindKey(object, 'greet', _, '!');
* bound('hi');
* // => 'hiya fred!'
*/
var bindKey = baseRest(function(object, key, partials) {
var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bindKey));
bitmask |= WRAP_PARTIAL_FLAG;
}
return createWrap(key, bitmask, object, partials, holders);
});
/**
* Creates a function that accepts arguments of `func` and either invokes
* `func` returning its result, if at least `arity` number of arguments have
* been provided, or returns a function that accepts the remaining `func`
* arguments, and so on. The arity of `func` may be specified if `func.length`
* is not sufficient.
*
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curry(abc);
*
* curried(1)(2)(3);
* // => [1, 2, 3]
*
* curried(1, 2)(3);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(1)(_, 3)(2);
* // => [1, 2, 3]
*/
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
return result;
}
/**
* This method is like `_.curry` except that arguments are applied to `func`
* in the manner of `_.partialRight` instead of `_.partial`.
*
* The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curryRight(abc);
*
* curried(3)(2)(1);
* // => [1, 2, 3]
*
* curried(2, 3)(1);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(3)(1, _)(2);
* // => [1, 2, 3]
*/
function curryRight(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curryRight.placeholder;
return result;
}
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
timeWaiting = wait - timeSinceLastCall;
return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
clearTimeout(timerId);
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
/**
* Defers invoking the `func` until the current call stack has cleared. Any
* additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to defer.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.defer(function(text) {
* console.log(text);
* }, 'deferred');
* // => Logs 'deferred' after one millisecond.
*/
var defer = baseRest(function(func, args) {
return baseDelay(func, 1, args);
});
/**
* Invokes `func` after `wait` milliseconds. Any additional arguments are
* provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.delay(function(text) {
* console.log(text);
* }, 1000, 'later');
* // => Logs 'later' after one second.
*/
var delay = baseRest(function(func, wait, args) {
return baseDelay(func, toNumber(wait) || 0, args);
});
/**
* Creates a function that invokes `func` with arguments reversed.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to flip arguments for.
* @returns {Function} Returns the new flipped function.
* @example
*
* var flipped = _.flip(function() {
* return _.toArray(arguments);
* });
*
* flipped('a', 'b', 'c', 'd');
* // => ['d', 'c', 'b', 'a']
*/
function flip(func) {
return createWrap(func, WRAP_FLIP_FLAG);
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Expose `MapCache`.
memoize.Cache = MapCache;
/**
* Creates a function that negates the result of the predicate `func`. The
* `func` predicate is invoked with the `this` binding and arguments of the
* created function.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} predicate The predicate to negate.
* @returns {Function} Returns the new negated function.
* @example
*
* function isEven(n) {
* return n % 2 == 0;
* }
*
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
* // => [1, 3, 5]
*/
function negate(predicate) {
if (typeof predicate != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function() {
var args = arguments;
switch (args.length) {
case 0: return !predicate.call(this);
case 1: return !predicate.call(this, args[0]);
case 2: return !predicate.call(this, args[0], args[1]);
case 3: return !predicate.call(this, args[0], args[1], args[2]);
}
return !predicate.apply(this, args);
};
}
/**
* Creates a function that is restricted to invoking `func` once. Repeat calls
* to the function return the value of the first invocation. The `func` is
* invoked with the `this` binding and arguments of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // => `createApplication` is invoked once
*/
function once(func) {
return before(2, func);
}
/**
* Creates a function that invokes `func` with its arguments transformed.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Function
* @param {Function} func The function to wrap.
* @param {...(Function|Function[])} [transforms=[_.identity]]
* The argument transforms.
* @returns {Function} Returns the new function.
* @example
*
* function doubled(n) {
* return n * 2;
* }
*
* function square(n) {
* return n * n;
* }
*
* var func = _.overArgs(function(x, y) {
* return [x, y];
* }, [square, doubled]);
*
* func(9, 3);
* // => [81, 6]
*
* func(10, 5);
* // => [100, 10]
*/
var overArgs = castRest(function(func, transforms) {
transforms = (transforms.length == 1 && isArray(transforms[0]))
? arrayMap(transforms[0], baseUnary(getIteratee()))
: arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
var funcsLength = transforms.length;
return baseRest(function(args) {
var index = -1,
length = nativeMin(args.length, funcsLength);
while (++index < length) {
args[index] = transforms[index].call(this, args[index]);
}
return apply(func, this, args);
});
});
/**
* Creates a function that invokes `func` with `partials` prepended to the
* arguments it receives. This method is like `_.bind` except it does **not**
* alter the `this` binding.
*
* The `_.partial.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 0.2.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var sayHelloTo = _.partial(greet, 'hello');
* sayHelloTo('fred');
* // => 'hello fred'
*
* // Partially applied with placeholders.
* var greetFred = _.partial(greet, _, 'fred');
* greetFred('hi');
* // => 'hi fred'
*/
var partial = baseRest(function(func, partials) {
var holders = replaceHolders(partials, getHolder(partial));
return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
});
/**
* This method is like `_.partial` except that partially applied arguments
* are appended to the arguments it receives.
*
* The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var greetFred = _.partialRight(greet, 'fred');
* greetFred('hi');
* // => 'hi fred'
*
* // Partially applied with placeholders.
* var sayHelloTo = _.partialRight(greet, 'hello', _);
* sayHelloTo('fred');
* // => 'hello fred'
*/
var partialRight = baseRest(function(func, partials) {
var holders = replaceHolders(partials, getHolder(partialRight));
return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});
/**
* Creates a function that invokes `func` with arguments arranged according
* to the specified `indexes` where the argument value at the first index is
* provided as the first argument, the argument value at the second index is
* provided as the second argument, and so on.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to rearrange arguments for.
* @param {...(number|number[])} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
* @example
*
* var rearged = _.rearg(function(a, b, c) {
* return [a, b, c];
* }, [2, 0, 1]);
*
* rearged('b', 'c', 'a')
* // => ['a', 'b', 'c']
*/
var rearg = flatRest(function(func, indexes) {
return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
});
/**
* Creates a function that invokes `func` with the `this` binding of the
* created function and arguments from `start` and beyond provided as
* an array.
*
* **Note:** This method is based on the
* [rest parameter](https://mdn.io/rest_parameters).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.rest(function(what, names) {
* return what + ' ' + _.initial(names).join(', ') +
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
* });
*
* say('hello', 'fred', 'barney', 'pebbles');
* // => 'hello fred, barney, & pebbles'
*/
function rest(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start === undefined ? start : toInteger(start);
return baseRest(func, start);
}
/**
* Creates a function that invokes `func` with the `this` binding of the
* create function and an array of arguments much like
* [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
*
* **Note:** This method is based on the
* [spread operator](https://mdn.io/spread_operator).
*
* @static
* @memberOf _
* @since 3.2.0
* @category Function
* @param {Function} func The function to spread arguments over.
* @param {number} [start=0] The start position of the spread.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.spread(function(who, what) {
* return who + ' says ' + what;
* });
*
* say(['fred', 'hello']);
* // => 'fred says hello'
*
* var numbers = Promise.all([
* Promise.resolve(40),
* Promise.resolve(36)
* ]);
*
* numbers.then(_.spread(function(x, y) {
* return x + y;
* }));
* // => a Promise of 76
*/
function spread(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start == null ? 0 : nativeMax(toInteger(start), 0);
return baseRest(function(args) {
var array = args[start],
otherArgs = castSlice(args, 0, start);
if (array) {
arrayPush(otherArgs, array);
}
return apply(func, this, otherArgs);
});
}
/**
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide `options` to indicate whether `func`
* should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to throttle.
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=true]
* Specify invoking on the leading edge of the timeout.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* // Avoid excessively updating the position while scrolling.
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
*
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
* jQuery(element).on('click', throttled);
*
* // Cancel the trailing throttled invocation.
* jQuery(window).on('popstate', throttled.cancel);
*/
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject(options)) {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
return debounce(func, wait, {
'leading': leading,
'maxWait': wait,
'trailing': trailing
});
}
/**
* Creates a function that accepts up to one argument, ignoring any
* additional arguments.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.unary(parseInt));
* // => [6, 8, 10]
*/
function unary(func) {
return ary(func, 1);
}
/**
* Creates a function that provides `value` to `wrapper` as its first
* argument. Any additional arguments provided to the function are appended
* to those provided to the `wrapper`. The wrapper is invoked with the `this`
* binding of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {*} value The value to wrap.
* @param {Function} [wrapper=identity] The wrapper function.
* @returns {Function} Returns the new function.
* @example
*
* var p = _.wrap(_.escape, function(func, text) {
* return '<p>' + func(text) + '</p>';
* });
*
* p('fred, barney, & pebbles');
* // => '<p>fred, barney, & pebbles</p>'
*/
function wrap(value, wrapper) {
return partial(castFunction(wrapper), value);
}
/*------------------------------------------------------------------------*/
/**
* Casts `value` as an array if it's not one.
*
* @static
* @memberOf _
* @since 4.4.0
* @category Lang
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast array.
* @example
*
* _.castArray(1);
* // => [1]
*
* _.castArray({ 'a': 1 });
* // => [{ 'a': 1 }]
*
* _.castArray('abc');
* // => ['abc']
*
* _.castArray(null);
* // => [null]
*
* _.castArray(undefined);
* // => [undefined]
*
* _.castArray();
* // => []
*
* var array = [1, 2, 3];
* console.log(_.castArray(array) === array);
* // => true
*/
function castArray() {
if (!arguments.length) {
return [];
}
var value = arguments[0];
return isArray(value) ? value : [value];
}
/**
* Creates a shallow clone of `value`.
*
* **Note:** This method is loosely based on the
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
* and supports cloning arrays, array buffers, booleans, date objects, maps,
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed
* arrays. The own enumerable properties of `arguments` objects are cloned
* as plain objects. An empty object is returned for uncloneable values such
* as error objects, functions, DOM nodes, and WeakMaps.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to clone.
* @returns {*} Returns the cloned value.
* @see _.cloneDeep
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var shallow = _.clone(objects);
* console.log(shallow[0] === objects[0]);
* // => true
*/
function clone(value) {
return baseClone(value, CLONE_SYMBOLS_FLAG);
}
/**
* This method is like `_.clone` except that it accepts `customizer` which
* is invoked to produce the cloned value. If `customizer` returns `undefined`,
* cloning is handled by the method instead. The `customizer` is invoked with
* up to four arguments; (value [, index|key, object, stack]).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the cloned value.
* @see _.cloneDeepWith
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(false);
* }
* }
*
* var el = _.cloneWith(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => 'BODY'
* console.log(el.childNodes.length);
* // => 0
*/
function cloneWith(value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
}
/**
* This method is like `_.clone` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @returns {*} Returns the deep cloned value.
* @see _.clone
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var deep = _.cloneDeep(objects);
* console.log(deep[0] === objects[0]);
* // => false
*/
function cloneDeep(value) {
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
/**
* This method is like `_.cloneWith` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the deep cloned value.
* @see _.cloneWith
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(true);
* }
* }
*
* var el = _.cloneDeepWith(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => 'BODY'
* console.log(el.childNodes.length);
* // => 20
*/
function cloneDeepWith(value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
}
/**
* Checks if `object` conforms to `source` by invoking the predicate
* properties of `source` with the corresponding property values of `object`.
*
* **Note:** This method is equivalent to `_.conforms` when `source` is
* partially applied.
*
* @static
* @memberOf _
* @since 4.14.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property predicates to conform to.
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
* @example
*
* var object = { 'a': 1, 'b': 2 };
*
* _.conformsTo(object, { 'b': function(n) { return n > 1; } });
* // => true
*
* _.conformsTo(object, { 'b': function(n) { return n > 2; } });
* // => false
*/
function conformsTo(object, source) {
return source == null || baseConformsTo(object, source, keys(source));
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is greater than `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`,
* else `false`.
* @see _.lt
* @example
*
* _.gt(3, 1);
* // => true
*
* _.gt(3, 3);
* // => false
*
* _.gt(1, 3);
* // => false
*/
var gt = createRelationalOperation(baseGt);
/**
* Checks if `value` is greater than or equal to `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than or equal to
* `other`, else `false`.
* @see _.lte
* @example
*
* _.gte(3, 1);
* // => true
*
* _.gte(3, 3);
* // => true
*
* _.gte(1, 3);
* // => false
*/
var gte = createRelationalOperation(function(value, other) {
return value >= other;
});
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is classified as an `ArrayBuffer` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
* @example
*
* _.isArrayBuffer(new ArrayBuffer(2));
* // => true
*
* _.isArrayBuffer(new Array(2));
* // => false
*/
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is classified as a boolean primitive or object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
* @example
*
* _.isBoolean(false);
* // => true
*
* _.isBoolean(null);
* // => false
*/
function isBoolean(value) {
return value === true || value === false ||
(isObjectLike(value) && baseGetTag(value) == boolTag);
}
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
/**
* Checks if `value` is classified as a `Date` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
* @example
*
* _.isDate(new Date);
* // => true
*
* _.isDate('Mon April 23 2012');
* // => false
*/
var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
/**
* Checks if `value` is likely a DOM element.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
* @example
*
* _.isElement(document.body);
* // => true
*
* _.isElement('<body>');
* // => false
*/
function isElement(value) {
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
}
/**
* Checks if `value` is an empty object, collection, map, or set.
*
* Objects are considered empty if they have no own enumerable string keyed
* properties.
*
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
* jQuery-like collections are considered empty if they have a `length` of `0`.
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
* @example
*
* _.isEmpty(null);
* // => true
*
* _.isEmpty(true);
* // => true
*
* _.isEmpty(1);
* // => true
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({ 'a': 1 });
* // => false
*/
function isEmpty(value) {
if (value == null) {
return true;
}
if (isArrayLike(value) &&
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length;
}
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
if (isPrototype(value)) {
return !baseKeys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return true;
}
/**
* Performs a deep comparison between two values to determine if they are
* equivalent.
*
* **Note:** This method supports comparing arrays, array buffers, booleans,
* date objects, error objects, maps, numbers, `Object` objects, regexes,
* sets, strings, symbols, and typed arrays. `Object` objects are compared
* by their own, not inherited, enumerable properties. Functions and DOM
* nodes are compared by strict equality, i.e. `===`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.isEqual(object, other);
* // => true
*
* object === other;
* // => false
*/
function isEqual(value, other) {
return baseIsEqual(value, other);
}
/**
* This method is like `_.isEqual` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
* are handled by the method instead. The `customizer` is invoked with up to
* six arguments: (objValue, othValue [, index|key, object, other, stack]).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, othValue) {
* if (isGreeting(objValue) && isGreeting(othValue)) {
* return true;
* }
* }
*
* var array = ['hello', 'goodbye'];
* var other = ['hi', 'goodbye'];
*
* _.isEqualWith(array, other, customizer);
* // => true
*/
function isEqualWith(value, other, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
var result = customizer ? customizer(value, other) : undefined;
return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
}
/**
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
* `SyntaxError`, `TypeError`, or `URIError` object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an error object, else `false`.
* @example
*
* _.isError(new Error);
* // => true
*
* _.isError(Error);
* // => false
*/
function isError(value) {
if (!isObjectLike(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == errorTag || tag == domExcTag ||
(typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
}
/**
* Checks if `value` is a finite primitive number.
*
* **Note:** This method is based on
* [`Number.isFinite`](https://mdn.io/Number/isFinite).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
* @example
*
* _.isFinite(3);
* // => true
*
* _.isFinite(Number.MIN_VALUE);
* // => true
*
* _.isFinite(Infinity);
* // => false
*
* _.isFinite('3');
* // => false
*/
function isFinite(value) {
return typeof value == 'number' && nativeIsFinite(value);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
/**
* Checks if `value` is an integer.
*
* **Note:** This method is based on
* [`Number.isInteger`](https://mdn.io/Number/isInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an integer, else `false`.
* @example
*
* _.isInteger(3);
* // => true
*
* _.isInteger(Number.MIN_VALUE);
* // => false
*
* _.isInteger(Infinity);
* // => false
*
* _.isInteger('3');
* // => false
*/
function isInteger(value) {
return typeof value == 'number' && value == toInteger(value);
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Map` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
* @example
*
* _.isMap(new Map);
* // => true
*
* _.isMap(new WeakMap);
* // => false
*/
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
/**
* Performs a partial deep comparison between `object` and `source` to
* determine if `object` contains equivalent property values.
*
* **Note:** This method is equivalent to `_.matches` when `source` is
* partially applied.
*
* Partial comparisons will match empty array and empty object `source`
* values against any array or object value, respectively. See `_.isEqual`
* for a list of supported value comparisons.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* var object = { 'a': 1, 'b': 2 };
*
* _.isMatch(object, { 'b': 2 });
* // => true
*
* _.isMatch(object, { 'b': 1 });
* // => false
*/
function isMatch(object, source) {
return object === source || baseIsMatch(object, source, getMatchData(source));
}
/**
* This method is like `_.isMatch` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
* are handled by the method instead. The `customizer` is invoked with five
* arguments: (objValue, srcValue, index|key, object, source).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, srcValue) {
* if (isGreeting(objValue) && isGreeting(srcValue)) {
* return true;
* }
* }
*
* var object = { 'greeting': 'hello' };
* var source = { 'greeting': 'hi' };
*
* _.isMatchWith(object, source, customizer);
* // => true
*/
function isMatchWith(object, source, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseIsMatch(object, source, getMatchData(source), customizer);
}
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is based on
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
* `undefined` and other non-number values.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some
// ActiveX objects in IE.
return isNumber(value) && value != +value;
}
/**
* Checks if `value` is a pristine native function.
*
* **Note:** This method can't reliably detect native functions in the presence
* of the core-js package because core-js circumvents this kind of detection.
* Despite multiple requests, the core-js maintainer has made it clear: any
* attempt to fix the detection will be obstructed. As a result, we're left
* with little choice but to throw an error. Unfortunately, this also affects
* packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
* which rely on core-js.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (isMaskable(value)) {
throw new Error(CORE_ERROR_TEXT);
}
return baseIsNative(value);
}
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
*/
function isNull(value) {
return value === null;
}
/**
* Checks if `value` is `null` or `undefined`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
* @example
*
* _.isNil(null);
* // => true
*
* _.isNil(void 0);
* // => true
*
* _.isNil(NaN);
* // => false
*/
function isNil(value) {
return value == null;
}
/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
* classified as numbers, use the `_.isFinite` method.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
* @example
*
* _.isNumber(3);
* // => true
*
* _.isNumber(Number.MIN_VALUE);
* // => true
*
* _.isNumber(Infinity);
* // => true
*
* _.isNumber('3');
* // => false
*/
function isNumber(value) {
return typeof value == 'number' ||
(isObjectLike(value) && baseGetTag(value) == numberTag);
}
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
/**
* Checks if `value` is classified as a `RegExp` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
* @example
*
* _.isRegExp(/abc/);
* // => true
*
* _.isRegExp('/abc/');
* // => false
*/
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
/**
* Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
* double precision number which isn't the result of a rounded unsafe integer.
*
* **Note:** This method is based on
* [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
* @example
*
* _.isSafeInteger(3);
* // => true
*
* _.isSafeInteger(Number.MIN_VALUE);
* // => false
*
* _.isSafeInteger(Infinity);
* // => false
*
* _.isSafeInteger('3');
* // => false
*/
function isSafeInteger(value) {
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is classified as a `Set` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
* @example
*
* _.isSet(new Set);
* // => true
*
* _.isSet(new WeakSet);
* // => false
*/
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
}
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
/**
* Checks if `value` is `undefined`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
* @example
*
* _.isUndefined(void 0);
* // => true
*
* _.isUndefined(null);
* // => false
*/
function isUndefined(value) {
return value === undefined;
}
/**
* Checks if `value` is classified as a `WeakMap` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
* @example
*
* _.isWeakMap(new WeakMap);
* // => true
*
* _.isWeakMap(new Map);
* // => false
*/
function isWeakMap(value) {
return isObjectLike(value) && getTag(value) == weakMapTag;
}
/**
* Checks if `value` is classified as a `WeakSet` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
* @example
*
* _.isWeakSet(new WeakSet);
* // => true
*
* _.isWeakSet(new Set);
* // => false
*/
function isWeakSet(value) {
return isObjectLike(value) && baseGetTag(value) == weakSetTag;
}
/**
* Checks if `value` is less than `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`,
* else `false`.
* @see _.gt
* @example
*
* _.lt(1, 3);
* // => true
*
* _.lt(3, 3);
* // => false
*
* _.lt(3, 1);
* // => false
*/
var lt = createRelationalOperation(baseLt);
/**
* Checks if `value` is less than or equal to `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than or equal to
* `other`, else `false`.
* @see _.gte
* @example
*
* _.lte(1, 3);
* // => true
*
* _.lte(3, 3);
* // => true
*
* _.lte(3, 1);
* // => false
*/
var lte = createRelationalOperation(function(value, other) {
return value <= other;
});
/**
* Converts `value` to an array.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to convert.
* @returns {Array} Returns the converted array.
* @example
*
* _.toArray({ 'a': 1, 'b': 2 });
* // => [1, 2]
*
* _.toArray('abc');
* // => ['a', 'b', 'c']
*
* _.toArray(1);
* // => []
*
* _.toArray(null);
* // => []
*/
function toArray(value) {
if (!value) {
return [];
}
if (isArrayLike(value)) {
return isString(value) ? stringToArray(value) : copyArray(value);
}
if (symIterator && value[symIterator]) {
return iteratorToArray(value[symIterator]());
}
var tag = getTag(value),
func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
return func(value);
}
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
/**
* Converts `value` to an integer suitable for use as the length of an
* array-like object.
*
* **Note:** This method is based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toLength(3.2);
* // => 3
*
* _.toLength(Number.MIN_VALUE);
* // => 0
*
* _.toLength(Infinity);
* // => 4294967295
*
* _.toLength('3.2');
* // => 3
*/
function toLength(value) {
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
}
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
/**
* Converts `value` to a plain object flattening inherited enumerable string
* keyed properties of `value` to own properties of the plain object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {Object} Returns the converted plain object.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.assign({ 'a': 1 }, new Foo);
* // => { 'a': 1, 'b': 2 }
*
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
* // => { 'a': 1, 'b': 2, 'c': 3 }
*/
function toPlainObject(value) {
return copyObject(value, keysIn(value));
}
/**
* Converts `value` to a safe integer. A safe integer can be compared and
* represented correctly.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toSafeInteger(3.2);
* // => 3
*
* _.toSafeInteger(Number.MIN_VALUE);
* // => 0
*
* _.toSafeInteger(Infinity);
* // => 9007199254740991
*
* _.toSafeInteger('3.2');
* // => 3
*/
function toSafeInteger(value) {
return value
? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
: (value === 0 ? value : 0);
}
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/*------------------------------------------------------------------------*/
/**
* Assigns own enumerable string keyed properties of source objects to the
* destination object. Source objects are applied from left to right.
* Subsequent sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object` and is loosely based on
* [`Object.assign`](https://mdn.io/Object/assign).
*
* @static
* @memberOf _
* @since 0.10.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assignIn
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assign({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'c': 3 }
*/
var assign = createAssigner(function(object, source) {
if (isPrototype(source) || isArrayLike(source)) {
copyObject(source, keys(source), object);
return;
}
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
assignValue(object, key, source[key]);
}
}
});
/**
* This method is like `_.assign` except that it iterates over own and
* inherited source properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extend
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assign
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assignIn({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
*/
var assignIn = createAssigner(function(object, source) {
copyObject(source, keysIn(source), object);
});
/**
* This method is like `_.assignIn` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extendWith
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignInWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
copyObject(source, keysIn(source), object, customizer);
});
/**
* This method is like `_.assign` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignInWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
copyObject(source, keys(source), object, customizer);
});
/**
* Creates an array of values corresponding to `paths` of `object`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Array} Returns the picked values.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _.at(object, ['a[0].b.c', 'a[1]']);
* // => [3, 4]
*/
var at = flatRest(baseAt);
/**
* Creates an object that inherits from the `prototype` object. If a
* `properties` object is given, its own enumerable string keyed properties
* are assigned to the created object.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Object
* @param {Object} prototype The object to inherit from.
* @param {Object} [properties] The properties to assign to the object.
* @returns {Object} Returns the new object.
* @example
*
* function Shape() {
* this.x = 0;
* this.y = 0;
* }
*
* function Circle() {
* Shape.call(this);
* }
*
* Circle.prototype = _.create(Shape.prototype, {
* 'constructor': Circle
* });
*
* var circle = new Circle;
* circle instanceof Circle;
* // => true
*
* circle instanceof Shape;
* // => true
*/
function create(prototype, properties) {
var result = baseCreate(prototype);
return properties == null ? result : baseAssign(result, properties);
}
/**
* Assigns own and inherited enumerable string keyed properties of source
* objects to the destination object for all destination properties that
* resolve to `undefined`. Source objects are applied from left to right.
* Once a property is set, additional values of the same property are ignored.
*
* **Note:** This method mutates `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.defaultsDeep
* @example
*
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var defaults = baseRest(function(object, sources) {
object = Object(object);
var index = -1;
var length = sources.length;
var guard = length > 2 ? sources[2] : undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
length = 1;
}
while (++index < length) {
var source = sources[index];
var props = keysIn(source);
var propsIndex = -1;
var propsLength = props.length;
while (++propsIndex < propsLength) {
var key = props[propsIndex];
var value = object[key];
if (value === undefined ||
(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
object[key] = source[key];
}
}
}
return object;
});
/**
* This method is like `_.defaults` except that it recursively assigns
* default properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.defaults
* @example
*
* _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
* // => { 'a': { 'b': 2, 'c': 3 } }
*/
var defaultsDeep = baseRest(function(args) {
args.push(undefined, customDefaultsMerge);
return apply(mergeWith, undefined, args);
});
/**
* This method is like `_.find` except that it returns the key of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findKey(users, function(o) { return o.age < 40; });
* // => 'barney' (iteration order is not guaranteed)
*
* // The `_.matches` iteratee shorthand.
* _.findKey(users, { 'age': 1, 'active': true });
* // => 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findKey(users, 'active');
* // => 'barney'
*/
function findKey(object, predicate) {
return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
}
/**
* This method is like `_.findKey` except that it iterates over elements of
* a collection in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findLastKey(users, function(o) { return o.age < 40; });
* // => returns 'pebbles' assuming `_.findKey` returns 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.findLastKey(users, { 'age': 36, 'active': true });
* // => 'barney'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findLastKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findLastKey(users, 'active');
* // => 'pebbles'
*/
function findLastKey(object, predicate) {
return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
}
/**
* Iterates over own and inherited enumerable string keyed properties of an
* object and invokes `iteratee` for each property. The iteratee is invoked
* with three arguments: (value, key, object). Iteratee functions may exit
* iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forInRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forIn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
*/
function forIn(object, iteratee) {
return object == null
? object
: baseFor(object, getIteratee(iteratee, 3), keysIn);
}
/**
* This method is like `_.forIn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forIn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forInRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
*/
function forInRight(object, iteratee) {
return object == null
? object
: baseForRight(object, getIteratee(iteratee, 3), keysIn);
}
/**
* Iterates over own enumerable string keyed properties of an object and
* invokes `iteratee` for each property. The iteratee is invoked with three
* arguments: (value, key, object). Iteratee functions may exit iteration
* early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwnRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forOwn(object, iteratee) {
return object && baseForOwn(object, getIteratee(iteratee, 3));
}
/**
* This method is like `_.forOwn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwnRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
*/
function forOwnRight(object, iteratee) {
return object && baseForOwnRight(object, getIteratee(iteratee, 3));
}
/**
* Creates an array of function property names from own enumerable properties
* of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the function names.
* @see _.functionsIn
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functions(new Foo);
* // => ['a', 'b']
*/
function functions(object) {
return object == null ? [] : baseFunctions(object, keys(object));
}
/**
* Creates an array of function property names from own and inherited
* enumerable properties of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the function names.
* @see _.functions
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functionsIn(new Foo);
* // => ['a', 'b', 'c']
*/
function functionsIn(object) {
return object == null ? [] : baseFunctions(object, keysIn(object));
}
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
/**
* Checks if `path` is a direct property of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b');
* // => true
*
* _.has(object, ['a', 'b']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
}
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite
* property assignments of previous values.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Object
* @param {Object} object The object to invert.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
*/
var invert = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
result[value] = key;
}, constant(identity));
/**
* This method is like `_.invert` except that the inverted object is generated
* from the results of running each element of `object` thru `iteratee`. The
* corresponding inverted value of each inverted key is an array of keys
* responsible for generating the inverted value. The iteratee is invoked
* with one argument: (value).
*
* @static
* @memberOf _
* @since 4.1.0
* @category Object
* @param {Object} object The object to invert.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invertBy(object);
* // => { '1': ['a', 'c'], '2': ['b'] }
*
* _.invertBy(object, function(value) {
* return 'group' + value;
* });
* // => { 'group1': ['a', 'c'], 'group2': ['b'] }
*/
var invertBy = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}, getIteratee);
/**
* Invokes the method at `path` of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
* @example
*
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
*
* _.invoke(object, 'a[0].b.c.slice', 1, 3);
* // => [2, 3]
*/
var invoke = baseRest(baseInvoke);
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
/**
* The opposite of `_.mapValues`; this method creates an object with the
* same values as `object` and keys generated by running each own enumerable
* string keyed property of `object` thru `iteratee`. The iteratee is invoked
* with three arguments: (value, key, object).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapValues
* @example
*
* _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
* return key + value;
* });
* // => { 'a1': 1, 'b2': 2 }
*/
function mapKeys(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
baseAssignValue(result, iteratee(value, key, object), value);
});
return result;
}
/**
* Creates an object with the same keys as `object` and values generated
* by running each own enumerable string keyed property of `object` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, key, object).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapKeys
* @example
*
* var users = {
* 'fred': { 'user': 'fred', 'age': 40 },
* 'pebbles': { 'user': 'pebbles', 'age': 1 }
* };
*
* _.mapValues(users, function(o) { return o.age; });
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*
* // The `_.property` iteratee shorthand.
* _.mapValues(users, 'age');
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*/
function mapValues(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
baseAssignValue(result, key, iteratee(value, key, object));
});
return result;
}
/**
* This method is like `_.assign` except that it recursively merges own and
* inherited enumerable string keyed properties of source objects into the
* destination object. Source properties that resolve to `undefined` are
* skipped if a destination value exists. Array and plain object properties
* are merged recursively. Other objects and value types are overridden by
* assignment. Source objects are applied from left to right. Subsequent
* sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var object = {
* 'a': [{ 'b': 2 }, { 'd': 4 }]
* };
*
* var other = {
* 'a': [{ 'c': 3 }, { 'e': 5 }]
* };
*
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
var merge = createAssigner(function(object, source, srcIndex) {
baseMerge(object, source, srcIndex);
});
/**
* This method is like `_.merge` except that it accepts `customizer` which
* is invoked to produce the merged values of the destination and source
* properties. If `customizer` returns `undefined`, merging is handled by the
* method instead. The `customizer` is invoked with six arguments:
* (objValue, srcValue, key, object, source, stack).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} customizer The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* function customizer(objValue, srcValue) {
* if (_.isArray(objValue)) {
* return objValue.concat(srcValue);
* }
* }
*
* var object = { 'a': [1], 'b': [2] };
* var other = { 'a': [3], 'b': [4] };
*
* _.mergeWith(object, other, customizer);
* // => { 'a': [1, 3], 'b': [2, 4] }
*/
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
baseMerge(object, source, srcIndex, customizer);
});
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function(object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function(path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
/**
* The opposite of `_.pickBy`; this method creates an object composed of
* the own and inherited enumerable string keyed properties of `object` that
* `predicate` doesn't return truthy for. The predicate is invoked with two
* arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omitBy(object, _.isNumber);
* // => { 'b': '2' }
*/
function omitBy(object, predicate) {
return pickBy(object, negate(getIteratee(predicate)));
}
/**
* Creates an object composed of the picked `object` properties.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
var pick = flatRest(function(object, paths) {
return object == null ? {} : basePick(object, paths);
});
/**
* Creates an object composed of the `object` properties `predicate` returns
* truthy for. The predicate is invoked with two arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pickBy(object, _.isNumber);
* // => { 'a': 1, 'c': 3 }
*/
function pickBy(object, predicate) {
if (object == null) {
return {};
}
var props = arrayMap(getAllKeysIn(object), function(prop) {
return [prop];
});
predicate = getIteratee(predicate);
return basePickBy(object, props, function(value, path) {
return predicate(value, path[0]);
});
}
/**
* This method is like `_.get` except that if the resolved value is a
* function it's invoked with the `this` binding of its parent object and
* its result is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to resolve.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
*
* _.result(object, 'a[0].b.c1');
* // => 3
*
* _.result(object, 'a[0].b.c2');
* // => 4
*
* _.result(object, 'a[0].b.c3', 'default');
* // => 'default'
*
* _.result(object, 'a[0].b.c3', _.constant('default'));
* // => 'default'
*/
function result(object, path, defaultValue) {
path = castPath(path, object);
var index = -1,
length = path.length;
// Ensure the loop is entered when path is empty.
if (!length) {
length = 1;
object = undefined;
}
while (++index < length) {
var value = object == null ? undefined : object[toKey(path[index])];
if (value === undefined) {
index = length;
value = defaultValue;
}
object = isFunction(value) ? value.call(object) : value;
}
return object;
}
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
/**
* This method is like `_.set` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.setWith(object, '[0][1]', 'a', Object);
* // => { '0': { '1': 'a' } }
*/
function setWith(object, path, value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseSet(object, path, value, customizer);
}
/**
* Creates an array of own enumerable string keyed-value pairs for `object`
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its
* entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entries
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairs(new Foo);
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
*/
var toPairs = createToPairs(keys);
/**
* Creates an array of own and inherited enumerable string keyed-value pairs
* for `object` which can be consumed by `_.fromPairs`. If `object` is a map
* or set, its entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entriesIn
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairsIn(new Foo);
* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
*/
var toPairsIn = createToPairs(keysIn);
/**
* An alternative to `_.reduce`; this method transforms `object` to a new
* `accumulator` object which is the result of running each of its own
* enumerable string keyed properties thru `iteratee`, with each invocation
* potentially mutating the `accumulator` object. If `accumulator` is not
* provided, a new object with the same `[[Prototype]]` will be used. The
* iteratee is invoked with four arguments: (accumulator, value, key, object).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 1.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The custom accumulator value.
* @returns {*} Returns the accumulated value.
* @example
*
* _.transform([2, 3, 4], function(result, n) {
* result.push(n *= n);
* return n % 2 == 0;
* }, []);
* // => [4, 9]
*
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function transform(object, iteratee, accumulator) {
var isArr = isArray(object),
isArrLike = isArr || isBuffer(object) || isTypedArray(object);
iteratee = getIteratee(iteratee, 4);
if (accumulator == null) {
var Ctor = object && object.constructor;
if (isArrLike) {
accumulator = isArr ? new Ctor : [];
}
else if (isObject(object)) {
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
}
else {
accumulator = {};
}
}
(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
return iteratee(accumulator, value, index, object);
});
return accumulator;
}
/**
* Removes the property at `path` of `object`.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 7 } }] };
* _.unset(object, 'a[0].b.c');
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*
* _.unset(object, ['a', '0', 'b', 'c']);
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*/
function unset(object, path) {
return object == null ? true : baseUnset(object, path);
}
/**
* This method is like `_.set` except that accepts `updater` to produce the
* value to set. Use `_.updateWith` to customize `path` creation. The `updater`
* is invoked with one argument: (value).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} updater The function to produce the updated value.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.update(object, 'a[0].b.c', function(n) { return n * n; });
* console.log(object.a[0].b.c);
* // => 9
*
* _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
* console.log(object.x[0].y.z);
* // => 0
*/
function update(object, path, updater) {
return object == null ? object : baseUpdate(object, path, castFunction(updater));
}
/**
* This method is like `_.update` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} updater The function to produce the updated value.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.updateWith(object, '[0][1]', _.constant('a'), Object);
* // => { '0': { '1': 'a' } }
*/
function updateWith(object, path, updater, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
}
/**
* Creates an array of the own enumerable string keyed property values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.values(new Foo);
* // => [1, 2] (iteration order is not guaranteed)
*
* _.values('hi');
* // => ['h', 'i']
*/
function values(object) {
return object == null ? [] : baseValues(object, keys(object));
}
/**
* Creates an array of the own and inherited enumerable string keyed property
* values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.valuesIn(new Foo);
* // => [1, 2, 3] (iteration order is not guaranteed)
*/
function valuesIn(object) {
return object == null ? [] : baseValues(object, keysIn(object));
}
/*------------------------------------------------------------------------*/
/**
* Clamps `number` within the inclusive `lower` and `upper` bounds.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Number
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
* @example
*
* _.clamp(-10, -5, 5);
* // => -5
*
* _.clamp(10, -5, 5);
* // => 5
*/
function clamp(number, lower, upper) {
if (upper === undefined) {
upper = lower;
lower = undefined;
}
if (upper !== undefined) {
upper = toNumber(upper);
upper = upper === upper ? upper : 0;
}
if (lower !== undefined) {
lower = toNumber(lower);
lower = lower === lower ? lower : 0;
}
return baseClamp(toNumber(number), lower, upper);
}
/**
* Checks if `n` is between `start` and up to, but not including, `end`. If
* `end` is not specified, it's set to `start` with `start` then set to `0`.
* If `start` is greater than `end` the params are swapped to support
* negative ranges.
*
* @static
* @memberOf _
* @since 3.3.0
* @category Number
* @param {number} number The number to check.
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
* @see _.range, _.rangeRight
* @example
*
* _.inRange(3, 2, 4);
* // => true
*
* _.inRange(4, 8);
* // => true
*
* _.inRange(4, 2);
* // => false
*
* _.inRange(2, 2);
* // => false
*
* _.inRange(1.2, 2);
* // => true
*
* _.inRange(5.2, 4);
* // => false
*
* _.inRange(-3, -2, -6);
* // => true
*/
function inRange(number, start, end) {
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
number = toNumber(number);
return baseInRange(number, start, end);
}
/**
* Produces a random number between the inclusive `lower` and `upper` bounds.
* If only one argument is provided a number between `0` and the given number
* is returned. If `floating` is `true`, or either `lower` or `upper` are
* floats, a floating-point number is returned instead of an integer.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Number
* @param {number} [lower=0] The lower bound.
* @param {number} [upper=1] The upper bound.
* @param {boolean} [floating] Specify returning a floating-point number.
* @returns {number} Returns the random number.
* @example
*
* _.random(0, 5);
* // => an integer between 0 and 5
*
* _.random(5);
* // => also an integer between 0 and 5
*
* _.random(5, true);
* // => a floating-point number between 0 and 5
*
* _.random(1.2, 5.2);
* // => a floating-point number between 1.2 and 5.2
*/
function random(lower, upper, floating) {
if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
upper = floating = undefined;
}
if (floating === undefined) {
if (typeof upper == 'boolean') {
floating = upper;
upper = undefined;
}
else if (typeof lower == 'boolean') {
floating = lower;
lower = undefined;
}
}
if (lower === undefined && upper === undefined) {
lower = 0;
upper = 1;
}
else {
lower = toFinite(lower);
if (upper === undefined) {
upper = lower;
lower = 0;
} else {
upper = toFinite(upper);
}
}
if (lower > upper) {
var temp = lower;
lower = upper;
upper = temp;
}
if (floating || lower % 1 || upper % 1) {
var rand = nativeRandom();
return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
}
return baseRandom(lower, upper);
}
/*------------------------------------------------------------------------*/
/**
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the camel cased string.
* @example
*
* _.camelCase('Foo Bar');
* // => 'fooBar'
*
* _.camelCase('--foo-bar--');
* // => 'fooBar'
*
* _.camelCase('__FOO_BAR__');
* // => 'fooBar'
*/
var camelCase = createCompounder(function(result, word, index) {
word = word.toLowerCase();
return result + (index ? capitalize(word) : word);
});
/**
* Converts the first character of `string` to upper case and the remaining
* to lower case.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to capitalize.
* @returns {string} Returns the capitalized string.
* @example
*
* _.capitalize('FRED');
* // => 'Fred'
*/
function capitalize(string) {
return upperFirst(toString(string).toLowerCase());
}
/**
* Deburrs `string` by converting
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
* letters to basic Latin letters and removing
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to deburr.
* @returns {string} Returns the deburred string.
* @example
*
* _.deburr('déjà vu');
* // => 'deja vu'
*/
function deburr(string) {
string = toString(string);
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
}
/**
* Checks if `string` ends with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=string.length] The position to search up to.
* @returns {boolean} Returns `true` if `string` ends with `target`,
* else `false`.
* @example
*
* _.endsWith('abc', 'c');
* // => true
*
* _.endsWith('abc', 'b');
* // => false
*
* _.endsWith('abc', 'b', 2);
* // => true
*/
function endsWith(string, target, position) {
string = toString(string);
target = baseToString(target);
var length = string.length;
position = position === undefined
? length
: baseClamp(toInteger(position), 0, length);
var end = position;
position -= target.length;
return position >= 0 && string.slice(position, end) == target;
}
/**
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
* corresponding HTML entities.
*
* **Note:** No other characters are escaped. To escape additional
* characters use a third-party library like [_he_](https://mths.be/he).
*
* Though the ">" character is escaped for symmetry, characters like
* ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value. See
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
*
* When working with HTML you should always
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
* XSS vectors.
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function escape(string) {
string = toString(string);
return (string && reHasUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar)
: string;
}
/**
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escapeRegExp('[lodash](https://lodash.com/)');
* // => '\[lodash\]\(https://lodash\.com/\)'
*/
function escapeRegExp(string) {
string = toString(string);
return (string && reHasRegExpChar.test(string))
? string.replace(reRegExpChar, '\\$&')
: string;
}
/**
* Converts `string` to
* [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the kebab cased string.
* @example
*
* _.kebabCase('Foo Bar');
* // => 'foo-bar'
*
* _.kebabCase('fooBar');
* // => 'foo-bar'
*
* _.kebabCase('__FOO_BAR__');
* // => 'foo-bar'
*/
var kebabCase = createCompounder(function(result, word, index) {
return result + (index ? '-' : '') + word.toLowerCase();
});
/**
* Converts `string`, as space separated words, to lower case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.lowerCase('--Foo-Bar--');
* // => 'foo bar'
*
* _.lowerCase('fooBar');
* // => 'foo bar'
*
* _.lowerCase('__FOO_BAR__');
* // => 'foo bar'
*/
var lowerCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toLowerCase();
});
/**
* Converts the first character of `string` to lower case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.lowerFirst('Fred');
* // => 'fred'
*
* _.lowerFirst('FRED');
* // => 'fRED'
*/
var lowerFirst = createCaseFirst('toLowerCase');
/**
* Pads `string` on the left and right sides if it's shorter than `length`.
* Padding characters are truncated if they can't be evenly divided by `length`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.pad('abc', 8);
* // => ' abc '
*
* _.pad('abc', 8, '_-');
* // => '_-abc_-_'
*
* _.pad('abc', 3);
* // => 'abc'
*/
function pad(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
if (!length || strLength >= length) {
return string;
}
var mid = (length - strLength) / 2;
return (
createPadding(nativeFloor(mid), chars) +
string +
createPadding(nativeCeil(mid), chars)
);
}
/**
* Pads `string` on the right side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padEnd('abc', 6);
* // => 'abc '
*
* _.padEnd('abc', 6, '_-');
* // => 'abc_-_'
*
* _.padEnd('abc', 3);
* // => 'abc'
*/
function padEnd(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return (length && strLength < length)
? (string + createPadding(length - strLength, chars))
: string;
}
/**
* Pads `string` on the left side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padStart('abc', 6);
* // => ' abc'
*
* _.padStart('abc', 6, '_-');
* // => '_-_abc'
*
* _.padStart('abc', 3);
* // => 'abc'
*/
function padStart(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return (length && strLength < length)
? (createPadding(length - strLength, chars) + string)
: string;
}
/**
* Converts `string` to an integer of the specified radix. If `radix` is
* `undefined` or `0`, a `radix` of `10` is used unless `value` is a
* hexadecimal, in which case a `radix` of `16` is used.
*
* **Note:** This method aligns with the
* [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
*
* @static
* @memberOf _
* @since 1.1.0
* @category String
* @param {string} string The string to convert.
* @param {number} [radix=10] The radix to interpret `value` by.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {number} Returns the converted integer.
* @example
*
* _.parseInt('08');
* // => 8
*
* _.map(['6', '08', '10'], _.parseInt);
* // => [6, 8, 10]
*/
function parseInt(string, radix, guard) {
if (guard || radix == null) {
radix = 0;
} else if (radix) {
radix = +radix;
}
return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
}
/**
* Repeats the given string `n` times.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to repeat.
* @param {number} [n=1] The number of times to repeat the string.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the repeated string.
* @example
*
* _.repeat('*', 3);
* // => '***'
*
* _.repeat('abc', 2);
* // => 'abcabc'
*
* _.repeat('abc', 0);
* // => ''
*/
function repeat(string, n, guard) {
if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
n = 1;
} else {
n = toInteger(n);
}
return baseRepeat(toString(string), n);
}
/**
* Replaces matches for `pattern` in `string` with `replacement`.
*
* **Note:** This method is based on
* [`String#replace`](https://mdn.io/String/replace).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to modify.
* @param {RegExp|string} pattern The pattern to replace.
* @param {Function|string} replacement The match replacement.
* @returns {string} Returns the modified string.
* @example
*
* _.replace('Hi Fred', 'Fred', 'Barney');
* // => 'Hi Barney'
*/
function replace() {
var args = arguments,
string = toString(args[0]);
return args.length < 3 ? string : string.replace(args[1], args[2]);
}
/**
* Converts `string` to
* [snake case](https://en.wikipedia.org/wiki/Snake_case).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the snake cased string.
* @example
*
* _.snakeCase('Foo Bar');
* // => 'foo_bar'
*
* _.snakeCase('fooBar');
* // => 'foo_bar'
*
* _.snakeCase('--FOO-BAR--');
* // => 'foo_bar'
*/
var snakeCase = createCompounder(function(result, word, index) {
return result + (index ? '_' : '') + word.toLowerCase();
});
/**
* Splits `string` by `separator`.
*
* **Note:** This method is based on
* [`String#split`](https://mdn.io/String/split).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to split.
* @param {RegExp|string} separator The separator pattern to split by.
* @param {number} [limit] The length to truncate results to.
* @returns {Array} Returns the string segments.
* @example
*
* _.split('a-b-c', '-', 2);
* // => ['a', 'b']
*/
function split(string, separator, limit) {
if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
separator = limit = undefined;
}
limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
if (!limit) {
return [];
}
string = toString(string);
if (string && (
typeof separator == 'string' ||
(separator != null && !isRegExp(separator))
)) {
separator = baseToString(separator);
if (!separator && hasUnicode(string)) {
return castSlice(stringToArray(string), 0, limit);
}
}
return string.split(separator, limit);
}
/**
* Converts `string` to
* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
*
* @static
* @memberOf _
* @since 3.1.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar--');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__FOO_BAR__');
* // => 'FOO BAR'
*/
var startCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + upperFirst(word);
});
/**
* Checks if `string` starts with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=0] The position to search from.
* @returns {boolean} Returns `true` if `string` starts with `target`,
* else `false`.
* @example
*
* _.startsWith('abc', 'a');
* // => true
*
* _.startsWith('abc', 'b');
* // => false
*
* _.startsWith('abc', 'b', 1);
* // => true
*/
function startsWith(string, target, position) {
string = toString(string);
position = position == null
? 0
: baseClamp(toInteger(position), 0, string.length);
target = baseToString(target);
return string.slice(position, position + target.length) == target;
}
/**
* Creates a compiled template function that can interpolate data properties
* in "interpolate" delimiters, HTML-escape interpolated data properties in
* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
* properties may be accessed as free variables in the template. If a setting
* object is given, it takes precedence over `_.templateSettings` values.
*
* **Note:** In the development build `_.template` utilizes
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* for easier debugging.
*
* For more information on precompiling templates see
* [lodash's custom builds documentation](https://lodash.com/custom-builds).
*
* For more information on Chrome extension sandboxes see
* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The template string.
* @param {Object} [options={}] The options object.
* @param {RegExp} [options.escape=_.templateSettings.escape]
* The HTML "escape" delimiter.
* @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
* The "evaluate" delimiter.
* @param {Object} [options.imports=_.templateSettings.imports]
* An object to import into the template as free variables.
* @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
* The "interpolate" delimiter.
* @param {string} [options.sourceURL='lodash.templateSources[n]']
* The sourceURL of the compiled template.
* @param {string} [options.variable='obj']
* The data object variable name.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the compiled template function.
* @example
*
* // Use the "interpolate" delimiter to create a compiled template.
* var compiled = _.template('hello <%= user %>!');
* compiled({ 'user': 'fred' });
* // => 'hello fred!'
*
* // Use the HTML "escape" delimiter to escape data property values.
* var compiled = _.template('<b><%- value %></b>');
* compiled({ 'value': '<script>' });
* // => '<b><script></b>'
*
* // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
* var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
* compiled({ 'users': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // Use the internal `print` function in "evaluate" delimiters.
* var compiled = _.template('<% print("hello " + user); %>!');
* compiled({ 'user': 'barney' });
* // => 'hello barney!'
*
* // Use the ES template literal delimiter as an "interpolate" delimiter.
* // Disable support by replacing the "interpolate" delimiter.
* var compiled = _.template('hello ${ user }!');
* compiled({ 'user': 'pebbles' });
* // => 'hello pebbles!'
*
* // Use backslashes to treat delimiters as plain text.
* var compiled = _.template('<%= "\\<%- value %\\>" %>');
* compiled({ 'value': 'ignored' });
* // => '<%- value %>'
*
* // Use the `imports` option to import `jQuery` as `jq`.
* var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
* var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
* compiled({ 'users': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // Use the `sourceURL` option to specify a custom sourceURL for the template.
* var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
* compiled(data);
* // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
*
* // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
* compiled.source;
* // => function(data) {
* // var __t, __p = '';
* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
* // return __p;
* // }
*
* // Use custom template delimiters.
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
* var compiled = _.template('hello {{ user }}!');
* compiled({ 'user': 'mustache' });
* // => 'hello mustache!'
*
* // Use the `source` property to inline compiled templates for meaningful
* // line numbers in error messages and stack traces.
* fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
* var JST = {\
* "main": ' + _.template(mainText).source + '\
* };\
* ');
*/
function template(string, options, guard) {
// Based on John Resig's `tmpl` implementation
// (http://ejohn.org/blog/javascript-micro-templating/)
// and Laura Doktorova's doT.js (https://github.com/olado/doT).
var settings = lodash.templateSettings;
if (guard && isIterateeCall(string, options, guard)) {
options = undefined;
}
string = toString(string);
options = assignInWith({}, options, settings, customDefaultsAssignIn);
var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
importsKeys = keys(imports),
importsValues = baseValues(imports, importsKeys);
var isEscaping,
isEvaluating,
index = 0,
interpolate = options.interpolate || reNoMatch,
source = "__p += '";
// Compile the regexp to match each delimiter.
var reDelimiters = RegExp(
(options.escape || reNoMatch).source + '|' +
interpolate.source + '|' +
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
(options.evaluate || reNoMatch).source + '|$'
, 'g');
// Use a sourceURL for easier debugging.
// The sourceURL gets injected into the source that's eval-ed, so be careful
// to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
// and escape the comment, thus injecting code that gets evaled.
var sourceURL = '//# sourceURL=' +
(hasOwnProperty.call(options, 'sourceURL')
? (options.sourceURL + '').replace(/\s/g, ' ')
: ('lodash.templateSources[' + (++templateCounter) + ']')
) + '\n';
string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
interpolateValue || (interpolateValue = esTemplateValue);
// Escape characters that can't be included in string literals.
source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
// Replace delimiters with snippets.
if (escapeValue) {
isEscaping = true;
source += "' +\n__e(" + escapeValue + ") +\n'";
}
if (evaluateValue) {
isEvaluating = true;
source += "';\n" + evaluateValue + ";\n__p += '";
}
if (interpolateValue) {
source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
}
index = offset + match.length;
// The JS engine embedded in Adobe products needs `match` returned in
// order to produce the correct `offset` value.
return match;
});
source += "';\n";
// If `variable` is not specified wrap a with-statement around the generated
// code to add the data object to the top of the scope chain.
var variable = hasOwnProperty.call(options, 'variable') && options.variable;
if (!variable) {
source = 'with (obj) {\n' + source + '\n}\n';
}
// Throw an error if a forbidden character was found in `variable`, to prevent
// potential command injection attacks.
else if (reForbiddenIdentifierChars.test(variable)) {
throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
}
// Cleanup code by stripping empty strings.
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
.replace(reEmptyStringMiddle, '$1')
.replace(reEmptyStringTrailing, '$1;');
// Frame code as the function body.
source = 'function(' + (variable || 'obj') + ') {\n' +
(variable
? ''
: 'obj || (obj = {});\n'
) +
"var __t, __p = ''" +
(isEscaping
? ', __e = _.escape'
: ''
) +
(isEvaluating
? ', __j = Array.prototype.join;\n' +
"function print() { __p += __j.call(arguments, '') }\n"
: ';\n'
) +
source +
'return __p\n}';
var result = attempt(function() {
return Function(importsKeys, sourceURL + 'return ' + source)
.apply(undefined, importsValues);
});
// Provide the compiled function's source by its `toString` method or
// the `source` property as a convenience for inlining compiled templates.
result.source = source;
if (isError(result)) {
throw result;
}
return result;
}
/**
* Converts `string`, as a whole, to lower case just like
* [String#toLowerCase](https://mdn.io/toLowerCase).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.toLower('--Foo-Bar--');
* // => '--foo-bar--'
*
* _.toLower('fooBar');
* // => 'foobar'
*
* _.toLower('__FOO_BAR__');
* // => '__foo_bar__'
*/
function toLower(value) {
return toString(value).toLowerCase();
}
/**
* Converts `string`, as a whole, to upper case just like
* [String#toUpperCase](https://mdn.io/toUpperCase).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.toUpper('--foo-bar--');
* // => '--FOO-BAR--'
*
* _.toUpper('fooBar');
* // => 'FOOBAR'
*
* _.toUpper('__foo_bar__');
* // => '__FOO_BAR__'
*/
function toUpper(value) {
return toString(value).toUpperCase();
}
/**
* Removes leading and trailing whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trim(' abc ');
* // => 'abc'
*
* _.trim('-_-abc-_-', '_-');
* // => 'abc'
*
* _.map([' foo ', ' bar '], _.trim);
* // => ['foo', 'bar']
*/
function trim(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return baseTrim(string);
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
chrSymbols = stringToArray(chars),
start = charsStartIndex(strSymbols, chrSymbols),
end = charsEndIndex(strSymbols, chrSymbols) + 1;
return castSlice(strSymbols, start, end).join('');
}
/**
* Removes trailing whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trimEnd(' abc ');
* // => ' abc'
*
* _.trimEnd('-_-abc-_-', '_-');
* // => '-_-abc'
*/
function trimEnd(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.slice(0, trimmedEndIndex(string) + 1);
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
return castSlice(strSymbols, 0, end).join('');
}
/**
* Removes leading whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trimStart(' abc ');
* // => 'abc '
*
* _.trimStart('-_-abc-_-', '_-');
* // => 'abc-_-'
*/
function trimStart(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrimStart, '');
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
start = charsStartIndex(strSymbols, stringToArray(chars));
return castSlice(strSymbols, start).join('');
}
/**
* Truncates `string` if it's longer than the given maximum string length.
* The last characters of the truncated string are replaced with the omission
* string which defaults to "...".
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to truncate.
* @param {Object} [options={}] The options object.
* @param {number} [options.length=30] The maximum string length.
* @param {string} [options.omission='...'] The string to indicate text is omitted.
* @param {RegExp|string} [options.separator] The separator pattern to truncate to.
* @returns {string} Returns the truncated string.
* @example
*
* _.truncate('hi-diddly-ho there, neighborino');
* // => 'hi-diddly-ho there, neighbo...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'length': 24,
* 'separator': ' '
* });
* // => 'hi-diddly-ho there,...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'length': 24,
* 'separator': /,? +/
* });
* // => 'hi-diddly-ho there...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'omission': ' [...]'
* });
* // => 'hi-diddly-ho there, neig [...]'
*/
function truncate(string, options) {
var length = DEFAULT_TRUNC_LENGTH,
omission = DEFAULT_TRUNC_OMISSION;
if (isObject(options)) {
var separator = 'separator' in options ? options.separator : separator;
length = 'length' in options ? toInteger(options.length) : length;
omission = 'omission' in options ? baseToString(options.omission) : omission;
}
string = toString(string);
var strLength = string.length;
if (hasUnicode(string)) {
var strSymbols = stringToArray(string);
strLength = strSymbols.length;
}
if (length >= strLength) {
return string;
}
var end = length - stringSize(omission);
if (end < 1) {
return omission;
}
var result = strSymbols
? castSlice(strSymbols, 0, end).join('')
: string.slice(0, end);
if (separator === undefined) {
return result + omission;
}
if (strSymbols) {
end += (result.length - end);
}
if (isRegExp(separator)) {
if (string.slice(end).search(separator)) {
var match,
substring = result;
if (!separator.global) {
separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
}
separator.lastIndex = 0;
while ((match = separator.exec(substring))) {
var newEnd = match.index;
}
result = result.slice(0, newEnd === undefined ? end : newEnd);
}
} else if (string.indexOf(baseToString(separator), end) != end) {
var index = result.lastIndexOf(separator);
if (index > -1) {
result = result.slice(0, index);
}
}
return result + omission;
}
/**
* The inverse of `_.escape`; this method converts the HTML entities
* `&`, `<`, `>`, `"`, and `'` in `string` to
* their corresponding characters.
*
* **Note:** No other HTML entities are unescaped. To unescape additional
* HTML entities use a third-party library like [_he_](https://mths.be/he).
*
* @static
* @memberOf _
* @since 0.6.0
* @category String
* @param {string} [string=''] The string to unescape.
* @returns {string} Returns the unescaped string.
* @example
*
* _.unescape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function unescape(string) {
string = toString(string);
return (string && reHasEscapedHtml.test(string))
? string.replace(reEscapedHtml, unescapeHtmlChar)
: string;
}
/**
* Converts `string`, as space separated words, to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.upperCase('--foo-bar');
* // => 'FOO BAR'
*
* _.upperCase('fooBar');
* // => 'FOO BAR'
*
* _.upperCase('__foo_bar__');
* // => 'FOO BAR'
*/
var upperCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toUpperCase();
});
/**
* Converts the first character of `string` to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.upperFirst('fred');
* // => 'Fred'
*
* _.upperFirst('FRED');
* // => 'FRED'
*/
var upperFirst = createCaseFirst('toUpperCase');
/**
* Splits `string` into an array of its words.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {RegExp|string} [pattern] The pattern to match words.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the words of `string`.
* @example
*
* _.words('fred, barney, & pebbles');
* // => ['fred', 'barney', 'pebbles']
*
* _.words('fred, barney, & pebbles', /[^, ]+/g);
* // => ['fred', 'barney', '&', 'pebbles']
*/
function words(string, pattern, guard) {
string = toString(string);
pattern = guard ? undefined : pattern;
if (pattern === undefined) {
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
}
return string.match(pattern) || [];
}
/*------------------------------------------------------------------------*/
/**
* Attempts to invoke `func`, returning either the result or the caught error
* object. Any additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Function} func The function to attempt.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {*} Returns the `func` result or error object.
* @example
*
* // Avoid throwing errors for invalid selectors.
* var elements = _.attempt(function(selector) {
* return document.querySelectorAll(selector);
* }, '>_>');
*
* if (_.isError(elements)) {
* elements = [];
* }
*/
var attempt = baseRest(function(func, args) {
try {
return apply(func, undefined, args);
} catch (e) {
return isError(e) ? e : new Error(e);
}
});
/**
* Binds methods of an object to the object itself, overwriting the existing
* method.
*
* **Note:** This method doesn't set the "length" property of bound functions.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {Object} object The object to bind and assign the bound methods to.
* @param {...(string|string[])} methodNames The object method names to bind.
* @returns {Object} Returns `object`.
* @example
*
* var view = {
* 'label': 'docs',
* 'click': function() {
* console.log('clicked ' + this.label);
* }
* };
*
* _.bindAll(view, ['click']);
* jQuery(element).on('click', view.click);
* // => Logs 'clicked docs' when clicked.
*/
var bindAll = flatRest(function(object, methodNames) {
arrayEach(methodNames, function(key) {
key = toKey(key);
baseAssignValue(object, key, bind(object[key], object));
});
return object;
});
/**
* Creates a function that iterates over `pairs` and invokes the corresponding
* function of the first predicate to return truthy. The predicate-function
* pairs are invoked with the `this` binding and arguments of the created
* function.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {Array} pairs The predicate-function pairs.
* @returns {Function} Returns the new composite function.
* @example
*
* var func = _.cond([
* [_.matches({ 'a': 1 }), _.constant('matches A')],
* [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
* [_.stubTrue, _.constant('no match')]
* ]);
*
* func({ 'a': 1, 'b': 2 });
* // => 'matches A'
*
* func({ 'a': 0, 'b': 1 });
* // => 'matches B'
*
* func({ 'a': '1', 'b': '2' });
* // => 'no match'
*/
function cond(pairs) {
var length = pairs == null ? 0 : pairs.length,
toIteratee = getIteratee();
pairs = !length ? [] : arrayMap(pairs, function(pair) {
if (typeof pair[1] != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return [toIteratee(pair[0]), pair[1]];
});
return baseRest(function(args) {
var index = -1;
while (++index < length) {
var pair = pairs[index];
if (apply(pair[0], this, args)) {
return apply(pair[1], this, args);
}
}
});
}
/**
* Creates a function that invokes the predicate properties of `source` with
* the corresponding property values of a given object, returning `true` if
* all predicates return truthy, else `false`.
*
* **Note:** The created function is equivalent to `_.conformsTo` with
* `source` partially applied.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new spec function.
* @example
*
* var objects = [
* { 'a': 2, 'b': 1 },
* { 'a': 1, 'b': 2 }
* ];
*
* _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
* // => [{ 'a': 1, 'b': 2 }]
*/
function conforms(source) {
return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
}
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
/**
* Checks `value` to determine whether a default value should be returned in
* its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
* or `undefined`.
*
* @static
* @memberOf _
* @since 4.14.0
* @category Util
* @param {*} value The value to check.
* @param {*} defaultValue The default value.
* @returns {*} Returns the resolved value.
* @example
*
* _.defaultTo(1, 10);
* // => 1
*
* _.defaultTo(undefined, 10);
* // => 10
*/
function defaultTo(value, defaultValue) {
return (value == null || value !== value) ? defaultValue : value;
}
/**
* Creates a function that returns the result of invoking the given functions
* with the `this` binding of the created function, where each successive
* invocation is supplied the return value of the previous.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flowRight
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flow([_.add, square]);
* addSquare(1, 2);
* // => 9
*/
var flow = createFlow();
/**
* This method is like `_.flow` except that it creates a function that
* invokes the given functions from right to left.
*
* @static
* @since 3.0.0
* @memberOf _
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flow
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flowRight([square, _.add]);
* addSquare(1, 2);
* // => 9
*/
var flowRight = createFlow(true);
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
/**
* Creates a function that invokes `func` with the arguments of the created
* function. If `func` is a property name, the created function returns the
* property value for a given element. If `func` is an array or object, the
* created function returns `true` for elements that contain the equivalent
* source properties, otherwise it returns `false`.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Util
* @param {*} [func=_.identity] The value to convert to a callback.
* @returns {Function} Returns the callback.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
* // => [{ 'user': 'barney', 'age': 36, 'active': true }]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, _.iteratee(['user', 'fred']));
* // => [{ 'user': 'fred', 'age': 40 }]
*
* // The `_.property` iteratee shorthand.
* _.map(users, _.iteratee('user'));
* // => ['barney', 'fred']
*
* // Create custom iteratee shorthands.
* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
* return !_.isRegExp(func) ? iteratee(func) : function(string) {
* return func.test(string);
* };
* });
*
* _.filter(['abc', 'def'], /ef/);
* // => ['def']
*/
function iteratee(func) {
return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
}
/**
* Creates a function that performs a partial deep comparison between a given
* object and `source`, returning `true` if the given object has equivalent
* property values, else `false`.
*
* **Note:** The created function is equivalent to `_.isMatch` with `source`
* partially applied.
*
* Partial comparisons will match empty array and empty object `source`
* values against any array or object value, respectively. See `_.isEqual`
* for a list of supported value comparisons.
*
* **Note:** Multiple values can be checked by combining several matchers
* using `_.overSome`
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
* @example
*
* var objects = [
* { 'a': 1, 'b': 2, 'c': 3 },
* { 'a': 4, 'b': 5, 'c': 6 }
* ];
*
* _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
* // => [{ 'a': 4, 'b': 5, 'c': 6 }]
*
* // Checking for several possible values
* _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
*/
function matches(source) {
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
}
/**
* Creates a function that performs a partial deep comparison between the
* value at `path` of a given object to `srcValue`, returning `true` if the
* object value is equivalent, else `false`.
*
* **Note:** Partial comparisons will match empty array and empty object
* `srcValue` values against any array or object value, respectively. See
* `_.isEqual` for a list of supported value comparisons.
*
* **Note:** Multiple values can be checked by combining several matchers
* using `_.overSome`
*
* @static
* @memberOf _
* @since 3.2.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
* @example
*
* var objects = [
* { 'a': 1, 'b': 2, 'c': 3 },
* { 'a': 4, 'b': 5, 'c': 6 }
* ];
*
* _.find(objects, _.matchesProperty('a', 4));
* // => { 'a': 4, 'b': 5, 'c': 6 }
*
* // Checking for several possible values
* _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
*/
function matchesProperty(path, srcValue) {
return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
}
/**
* Creates a function that invokes the method at `path` of a given object.
* Any additional arguments are provided to the invoked method.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Util
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new invoker function.
* @example
*
* var objects = [
* { 'a': { 'b': _.constant(2) } },
* { 'a': { 'b': _.constant(1) } }
* ];
*
* _.map(objects, _.method('a.b'));
* // => [2, 1]
*
* _.map(objects, _.method(['a', 'b']));
* // => [2, 1]
*/
var method = baseRest(function(path, args) {
return function(object) {
return baseInvoke(object, path, args);
};
});
/**
* The opposite of `_.method`; this method creates a function that invokes
* the method at a given path of `object`. Any additional arguments are
* provided to the invoked method.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Util
* @param {Object} object The object to query.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new invoker function.
* @example
*
* var array = _.times(3, _.constant),
* object = { 'a': array, 'b': array, 'c': array };
*
* _.map(['a[2]', 'c[0]'], _.methodOf(object));
* // => [2, 0]
*
* _.map([['a', '2'], ['c', '0']], _.methodOf(object));
* // => [2, 0]
*/
var methodOf = baseRest(function(object, args) {
return function(path) {
return baseInvoke(object, path, args);
};
});
/**
* Adds all own enumerable string keyed function properties of a source
* object to the destination object. If `object` is a function, then methods
* are added to its prototype as well.
*
* **Note:** Use `_.runInContext` to create a pristine `lodash` function to
* avoid conflicts caused by modifying the original.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {Function|Object} [object=lodash] The destination object.
* @param {Object} source The object of functions to add.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.chain=true] Specify whether mixins are chainable.
* @returns {Function|Object} Returns `object`.
* @example
*
* function vowels(string) {
* return _.filter(string, function(v) {
* return /[aeiou]/i.test(v);
* });
* }
*
* _.mixin({ 'vowels': vowels });
* _.vowels('fred');
* // => ['e']
*
* _('fred').vowels().value();
* // => ['e']
*
* _.mixin({ 'vowels': vowels }, { 'chain': false });
* _('fred').vowels();
* // => ['e']
*/
function mixin(object, source, options) {
var props = keys(source),
methodNames = baseFunctions(source, props);
if (options == null &&
!(isObject(source) && (methodNames.length || !props.length))) {
options = source;
source = object;
object = this;
methodNames = baseFunctions(source, keys(source));
}
var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
isFunc = isFunction(object);
arrayEach(methodNames, function(methodName) {
var func = source[methodName];
object[methodName] = func;
if (isFunc) {
object.prototype[methodName] = function() {
var chainAll = this.__chain__;
if (chain || chainAll) {
var result = object(this.__wrapped__),
actions = result.__actions__ = copyArray(this.__actions__);
actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
result.__chain__ = chainAll;
return result;
}
return func.apply(object, arrayPush([this.value()], arguments));
};
}
});
return object;
}
/**
* Reverts the `_` variable to its previous value and returns a reference to
* the `lodash` function.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @returns {Function} Returns the `lodash` function.
* @example
*
* var lodash = _.noConflict();
*/
function noConflict() {
if (root._ === this) {
root._ = oldDash;
}
return this;
}
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
/**
* Creates a function that gets the argument at index `n`. If `n` is negative,
* the nth argument from the end is returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {number} [n=0] The index of the argument to return.
* @returns {Function} Returns the new pass-thru function.
* @example
*
* var func = _.nthArg(1);
* func('a', 'b', 'c', 'd');
* // => 'b'
*
* var func = _.nthArg(-2);
* func('a', 'b', 'c', 'd');
* // => 'c'
*/
function nthArg(n) {
n = toInteger(n);
return baseRest(function(args) {
return baseNth(args, n);
});
}
/**
* Creates a function that invokes `iteratees` with the arguments it receives
* and returns their results.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to invoke.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.over([Math.max, Math.min]);
*
* func(1, 2, 3, 4);
* // => [4, 1]
*/
var over = createOver(arrayMap);
/**
* Creates a function that checks if **all** of the `predicates` return
* truthy when invoked with the arguments it receives.
*
* Following shorthands are possible for providing predicates.
* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [predicates=[_.identity]]
* The predicates to check.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.overEvery([Boolean, isFinite]);
*
* func('1');
* // => true
*
* func(null);
* // => false
*
* func(NaN);
* // => false
*/
var overEvery = createOver(arrayEvery);
/**
* Creates a function that checks if **any** of the `predicates` return
* truthy when invoked with the arguments it receives.
*
* Following shorthands are possible for providing predicates.
* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [predicates=[_.identity]]
* The predicates to check.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.overSome([Boolean, isFinite]);
*
* func('1');
* // => true
*
* func(null);
* // => true
*
* func(NaN);
* // => false
*
* var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
* var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
*/
var overSome = createOver(arraySome);
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
/**
* The opposite of `_.property`; this method creates a function that returns
* the value at a given path of `object`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
* @example
*
* var array = [0, 1, 2],
* object = { 'a': array, 'b': array, 'c': array };
*
* _.map(['a[2]', 'c[0]'], _.propertyOf(object));
* // => [2, 0]
*
* _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
* // => [2, 0]
*/
function propertyOf(object) {
return function(path) {
return object == null ? undefined : baseGet(object, path);
};
}
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to, but not including, `end`. A step of `-1` is used if a negative
* `start` is specified without an `end` or `step`. If `end` is not specified,
* it's set to `start` with `start` then set to `0`.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the range of numbers.
* @see _.inRange, _.rangeRight
* @example
*
* _.range(4);
* // => [0, 1, 2, 3]
*
* _.range(-4);
* // => [0, -1, -2, -3]
*
* _.range(1, 5);
* // => [1, 2, 3, 4]
*
* _.range(0, 20, 5);
* // => [0, 5, 10, 15]
*
* _.range(0, -4, -1);
* // => [0, -1, -2, -3]
*
* _.range(1, 4, 0);
* // => [1, 1, 1]
*
* _.range(0);
* // => []
*/
var range = createRange();
/**
* This method is like `_.range` except that it populates values in
* descending order.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the range of numbers.
* @see _.inRange, _.range
* @example
*
* _.rangeRight(4);
* // => [3, 2, 1, 0]
*
* _.rangeRight(-4);
* // => [-3, -2, -1, 0]
*
* _.rangeRight(1, 5);
* // => [4, 3, 2, 1]
*
* _.rangeRight(0, 20, 5);
* // => [15, 10, 5, 0]
*
* _.rangeRight(0, -4, -1);
* // => [-3, -2, -1, 0]
*
* _.rangeRight(1, 4, 0);
* // => [1, 1, 1]
*
* _.rangeRight(0);
* // => []
*/
var rangeRight = createRange(true);
/**
* This method returns a new empty array.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Array} Returns the new empty array.
* @example
*
* var arrays = _.times(2, _.stubArray);
*
* console.log(arrays);
* // => [[], []]
*
* console.log(arrays[0] === arrays[1]);
* // => false
*/
function stubArray() {
return [];
}
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse() {
return false;
}
/**
* This method returns a new empty object.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Object} Returns the new empty object.
* @example
*
* var objects = _.times(2, _.stubObject);
*
* console.log(objects);
* // => [{}, {}]
*
* console.log(objects[0] === objects[1]);
* // => false
*/
function stubObject() {
return {};
}
/**
* This method returns an empty string.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {string} Returns the empty string.
* @example
*
* _.times(2, _.stubString);
* // => ['', '']
*/
function stubString() {
return '';
}
/**
* This method returns `true`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `true`.
* @example
*
* _.times(2, _.stubTrue);
* // => [true, true]
*/
function stubTrue() {
return true;
}
/**
* Invokes the iteratee `n` times, returning an array of the results of
* each invocation. The iteratee is invoked with one argument; (index).
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of results.
* @example
*
* _.times(3, String);
* // => ['0', '1', '2']
*
* _.times(4, _.constant(0));
* // => [0, 0, 0, 0]
*/
function times(n, iteratee) {
n = toInteger(n);
if (n < 1 || n > MAX_SAFE_INTEGER) {
return [];
}
var index = MAX_ARRAY_LENGTH,
length = nativeMin(n, MAX_ARRAY_LENGTH);
iteratee = getIteratee(iteratee);
n -= MAX_ARRAY_LENGTH;
var result = baseTimes(length, iteratee);
while (++index < n) {
iteratee(index);
}
return result;
}
/**
* Converts `value` to a property path array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {*} value The value to convert.
* @returns {Array} Returns the new property path array.
* @example
*
* _.toPath('a.b.c');
* // => ['a', 'b', 'c']
*
* _.toPath('a[0].b.c');
* // => ['a', '0', 'b', 'c']
*/
function toPath(value) {
if (isArray(value)) {
return arrayMap(value, toKey);
}
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
}
/**
* Generates a unique ID. If `prefix` is given, the ID is appended to it.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {string} [prefix=''] The value to prefix the ID with.
* @returns {string} Returns the unique ID.
* @example
*
* _.uniqueId('contact_');
* // => 'contact_104'
*
* _.uniqueId();
* // => '105'
*/
function uniqueId(prefix) {
var id = ++idCounter;
return toString(prefix) + id;
}
/*------------------------------------------------------------------------*/
/**
* Adds two numbers.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {number} augend The first number in an addition.
* @param {number} addend The second number in an addition.
* @returns {number} Returns the total.
* @example
*
* _.add(6, 4);
* // => 10
*/
var add = createMathOperation(function(augend, addend) {
return augend + addend;
}, 0);
/**
* Computes `number` rounded up to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round up.
* @param {number} [precision=0] The precision to round up to.
* @returns {number} Returns the rounded up number.
* @example
*
* _.ceil(4.006);
* // => 5
*
* _.ceil(6.004, 2);
* // => 6.01
*
* _.ceil(6040, -2);
* // => 6100
*/
var ceil = createRound('ceil');
/**
* Divide two numbers.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {number} dividend The first number in a division.
* @param {number} divisor The second number in a division.
* @returns {number} Returns the quotient.
* @example
*
* _.divide(6, 4);
* // => 1.5
*/
var divide = createMathOperation(function(dividend, divisor) {
return dividend / divisor;
}, 1);
/**
* Computes `number` rounded down to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round down.
* @param {number} [precision=0] The precision to round down to.
* @returns {number} Returns the rounded down number.
* @example
*
* _.floor(4.006);
* // => 4
*
* _.floor(0.046, 2);
* // => 0.04
*
* _.floor(4060, -2);
* // => 4000
*/
var floor = createRound('floor');
/**
* Computes the maximum value of `array`. If `array` is empty or falsey,
* `undefined` is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the maximum value.
* @example
*
* _.max([4, 2, 8, 6]);
* // => 8
*
* _.max([]);
* // => undefined
*/
function max(array) {
return (array && array.length)
? baseExtremum(array, identity, baseGt)
: undefined;
}
/**
* This method is like `_.max` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* the value is ranked. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {*} Returns the maximum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* _.maxBy(objects, function(o) { return o.n; });
* // => { 'n': 2 }
*
* // The `_.property` iteratee shorthand.
* _.maxBy(objects, 'n');
* // => { 'n': 2 }
*/
function maxBy(array, iteratee) {
return (array && array.length)
? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
: undefined;
}
/**
* Computes the mean of the values in `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the mean.
* @example
*
* _.mean([4, 2, 8, 6]);
* // => 5
*/
function mean(array) {
return baseMean(array, identity);
}
/**
* This method is like `_.mean` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the value to be averaged.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the mean.
* @example
*
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
*
* _.meanBy(objects, function(o) { return o.n; });
* // => 5
*
* // The `_.property` iteratee shorthand.
* _.meanBy(objects, 'n');
* // => 5
*/
function meanBy(array, iteratee) {
return baseMean(array, getIteratee(iteratee, 2));
}
/**
* Computes the minimum value of `array`. If `array` is empty or falsey,
* `undefined` is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the minimum value.
* @example
*
* _.min([4, 2, 8, 6]);
* // => 2
*
* _.min([]);
* // => undefined
*/
function min(array) {
return (array && array.length)
? baseExtremum(array, identity, baseLt)
: undefined;
}
/**
* This method is like `_.min` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* the value is ranked. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {*} Returns the minimum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* _.minBy(objects, function(o) { return o.n; });
* // => { 'n': 1 }
*
* // The `_.property` iteratee shorthand.
* _.minBy(objects, 'n');
* // => { 'n': 1 }
*/
function minBy(array, iteratee) {
return (array && array.length)
? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
: undefined;
}
/**
* Multiply two numbers.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {number} multiplier The first number in a multiplication.
* @param {number} multiplicand The second number in a multiplication.
* @returns {number} Returns the product.
* @example
*
* _.multiply(6, 4);
* // => 24
*/
var multiply = createMathOperation(function(multiplier, multiplicand) {
return multiplier * multiplicand;
}, 1);
/**
* Computes `number` rounded to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round.
* @param {number} [precision=0] The precision to round to.
* @returns {number} Returns the rounded number.
* @example
*
* _.round(4.006);
* // => 4
*
* _.round(4.006, 2);
* // => 4.01
*
* _.round(4060, -2);
* // => 4100
*/
var round = createRound('round');
/**
* Subtract two numbers.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {number} minuend The first number in a subtraction.
* @param {number} subtrahend The second number in a subtraction.
* @returns {number} Returns the difference.
* @example
*
* _.subtract(6, 4);
* // => 2
*/
var subtract = createMathOperation(function(minuend, subtrahend) {
return minuend - subtrahend;
}, 0);
/**
* Computes the sum of the values in `array`.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the sum.
* @example
*
* _.sum([4, 2, 8, 6]);
* // => 20
*/
function sum(array) {
return (array && array.length)
? baseSum(array, identity)
: 0;
}
/**
* This method is like `_.sum` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the value to be summed.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the sum.
* @example
*
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
*
* _.sumBy(objects, function(o) { return o.n; });
* // => 20
*
* // The `_.property` iteratee shorthand.
* _.sumBy(objects, 'n');
* // => 20
*/
function sumBy(array, iteratee) {
return (array && array.length)
? baseSum(array, getIteratee(iteratee, 2))
: 0;
}
/*------------------------------------------------------------------------*/
// Add methods that return wrapped values in chain sequences.
lodash.after = after;
lodash.ary = ary;
lodash.assign = assign;
lodash.assignIn = assignIn;
lodash.assignInWith = assignInWith;
lodash.assignWith = assignWith;
lodash.at = at;
lodash.before = before;
lodash.bind = bind;
lodash.bindAll = bindAll;
lodash.bindKey = bindKey;
lodash.castArray = castArray;
lodash.chain = chain;
lodash.chunk = chunk;
lodash.compact = compact;
lodash.concat = concat;
lodash.cond = cond;
lodash.conforms = conforms;
lodash.constant = constant;
lodash.countBy = countBy;
lodash.create = create;
lodash.curry = curry;
lodash.curryRight = curryRight;
lodash.debounce = debounce;
lodash.defaults = defaults;
lodash.defaultsDeep = defaultsDeep;
lodash.defer = defer;
lodash.delay = delay;
lodash.difference = difference;
lodash.differenceBy = differenceBy;
lodash.differenceWith = differenceWith;
lodash.drop = drop;
lodash.dropRight = dropRight;
lodash.dropRightWhile = dropRightWhile;
lodash.dropWhile = dropWhile;
lodash.fill = fill;
lodash.filter = filter;
lodash.flatMap = flatMap;
lodash.flatMapDeep = flatMapDeep;
lodash.flatMapDepth = flatMapDepth;
lodash.flatten = flatten;
lodash.flattenDeep = flattenDeep;
lodash.flattenDepth = flattenDepth;
lodash.flip = flip;
lodash.flow = flow;
lodash.flowRight = flowRight;
lodash.fromPairs = fromPairs;
lodash.functions = functions;
lodash.functionsIn = functionsIn;
lodash.groupBy = groupBy;
lodash.initial = initial;
lodash.intersection = intersection;
lodash.intersectionBy = intersectionBy;
lodash.intersectionWith = intersectionWith;
lodash.invert = invert;
lodash.invertBy = invertBy;
lodash.invokeMap = invokeMap;
lodash.iteratee = iteratee;
lodash.keyBy = keyBy;
lodash.keys = keys;
lodash.keysIn = keysIn;
lodash.map = map;
lodash.mapKeys = mapKeys;
lodash.mapValues = mapValues;
lodash.matches = matches;
lodash.matchesProperty = matchesProperty;
lodash.memoize = memoize;
lodash.merge = merge;
lodash.mergeWith = mergeWith;
lodash.method = method;
lodash.methodOf = methodOf;
lodash.mixin = mixin;
lodash.negate = negate;
lodash.nthArg = nthArg;
lodash.omit = omit;
lodash.omitBy = omitBy;
lodash.once = once;
lodash.orderBy = orderBy;
lodash.over = over;
lodash.overArgs = overArgs;
lodash.overEvery = overEvery;
lodash.overSome = overSome;
lodash.partial = partial;
lodash.partialRight = partialRight;
lodash.partition = partition;
lodash.pick = pick;
lodash.pickBy = pickBy;
lodash.property = property;
lodash.propertyOf = propertyOf;
lodash.pull = pull;
lodash.pullAll = pullAll;
lodash.pullAllBy = pullAllBy;
lodash.pullAllWith = pullAllWith;
lodash.pullAt = pullAt;
lodash.range = range;
lodash.rangeRight = rangeRight;
lodash.rearg = rearg;
lodash.reject = reject;
lodash.remove = remove;
lodash.rest = rest;
lodash.reverse = reverse;
lodash.sampleSize = sampleSize;
lodash.set = set;
lodash.setWith = setWith;
lodash.shuffle = shuffle;
lodash.slice = slice;
lodash.sortBy = sortBy;
lodash.sortedUniq = sortedUniq;
lodash.sortedUniqBy = sortedUniqBy;
lodash.split = split;
lodash.spread = spread;
lodash.tail = tail;
lodash.take = take;
lodash.takeRight = takeRight;
lodash.takeRightWhile = takeRightWhile;
lodash.takeWhile = takeWhile;
lodash.tap = tap;
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.toPairs = toPairs;
lodash.toPairsIn = toPairsIn;
lodash.toPath = toPath;
lodash.toPlainObject = toPlainObject;
lodash.transform = transform;
lodash.unary = unary;
lodash.union = union;
lodash.unionBy = unionBy;
lodash.unionWith = unionWith;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.uniqWith = uniqWith;
lodash.unset = unset;
lodash.unzip = unzip;
lodash.unzipWith = unzipWith;
lodash.update = update;
lodash.updateWith = updateWith;
lodash.values = values;
lodash.valuesIn = valuesIn;
lodash.without = without;
lodash.words = words;
lodash.wrap = wrap;
lodash.xor = xor;
lodash.xorBy = xorBy;
lodash.xorWith = xorWith;
lodash.zip = zip;
lodash.zipObject = zipObject;
lodash.zipObjectDeep = zipObjectDeep;
lodash.zipWith = zipWith;
// Add aliases.
lodash.entries = toPairs;
lodash.entriesIn = toPairsIn;
lodash.extend = assignIn;
lodash.extendWith = assignInWith;
// Add methods to `lodash.prototype`.
mixin(lodash, lodash);
/*------------------------------------------------------------------------*/
// Add methods that return unwrapped values in chain sequences.
lodash.add = add;
lodash.attempt = attempt;
lodash.camelCase = camelCase;
lodash.capitalize = capitalize;
lodash.ceil = ceil;
lodash.clamp = clamp;
lodash.clone = clone;
lodash.cloneDeep = cloneDeep;
lodash.cloneDeepWith = cloneDeepWith;
lodash.cloneWith = cloneWith;
lodash.conformsTo = conformsTo;
lodash.deburr = deburr;
lodash.defaultTo = defaultTo;
lodash.divide = divide;
lodash.endsWith = endsWith;
lodash.eq = eq;
lodash.escape = escape;
lodash.escapeRegExp = escapeRegExp;
lodash.every = every;
lodash.find = find;
lodash.findIndex = findIndex;
lodash.findKey = findKey;
lodash.findLast = findLast;
lodash.findLastIndex = findLastIndex;
lodash.findLastKey = findLastKey;
lodash.floor = floor;
lodash.forEach = forEach;
lodash.forEachRight = forEachRight;
lodash.forIn = forIn;
lodash.forInRight = forInRight;
lodash.forOwn = forOwn;
lodash.forOwnRight = forOwnRight;
lodash.get = get;
lodash.gt = gt;
lodash.gte = gte;
lodash.has = has;
lodash.hasIn = hasIn;
lodash.head = head;
lodash.identity = identity;
lodash.includes = includes;
lodash.indexOf = indexOf;
lodash.inRange = inRange;
lodash.invoke = invoke;
lodash.isArguments = isArguments;
lodash.isArray = isArray;
lodash.isArrayBuffer = isArrayBuffer;
lodash.isArrayLike = isArrayLike;
lodash.isArrayLikeObject = isArrayLikeObject;
lodash.isBoolean = isBoolean;
lodash.isBuffer = isBuffer;
lodash.isDate = isDate;
lodash.isElement = isElement;
lodash.isEmpty = isEmpty;
lodash.isEqual = isEqual;
lodash.isEqualWith = isEqualWith;
lodash.isError = isError;
lodash.isFinite = isFinite;
lodash.isFunction = isFunction;
lodash.isInteger = isInteger;
lodash.isLength = isLength;
lodash.isMap = isMap;
lodash.isMatch = isMatch;
lodash.isMatchWith = isMatchWith;
lodash.isNaN = isNaN;
lodash.isNative = isNative;
lodash.isNil = isNil;
lodash.isNull = isNull;
lodash.isNumber = isNumber;
lodash.isObject = isObject;
lodash.isObjectLike = isObjectLike;
lodash.isPlainObject = isPlainObject;
lodash.isRegExp = isRegExp;
lodash.isSafeInteger = isSafeInteger;
lodash.isSet = isSet;
lodash.isString = isString;
lodash.isSymbol = isSymbol;
lodash.isTypedArray = isTypedArray;
lodash.isUndefined = isUndefined;
lodash.isWeakMap = isWeakMap;
lodash.isWeakSet = isWeakSet;
lodash.join = join;
lodash.kebabCase = kebabCase;
lodash.last = last;
lodash.lastIndexOf = lastIndexOf;
lodash.lowerCase = lowerCase;
lodash.lowerFirst = lowerFirst;
lodash.lt = lt;
lodash.lte = lte;
lodash.max = max;
lodash.maxBy = maxBy;
lodash.mean = mean;
lodash.meanBy = meanBy;
lodash.min = min;
lodash.minBy = minBy;
lodash.stubArray = stubArray;
lodash.stubFalse = stubFalse;
lodash.stubObject = stubObject;
lodash.stubString = stubString;
lodash.stubTrue = stubTrue;
lodash.multiply = multiply;
lodash.nth = nth;
lodash.noConflict = noConflict;
lodash.noop = noop;
lodash.now = now;
lodash.pad = pad;
lodash.padEnd = padEnd;
lodash.padStart = padStart;
lodash.parseInt = parseInt;
lodash.random = random;
lodash.reduce = reduce;
lodash.reduceRight = reduceRight;
lodash.repeat = repeat;
lodash.replace = replace;
lodash.result = result;
lodash.round = round;
lodash.runInContext = runInContext;
lodash.sample = sample;
lodash.size = size;
lodash.snakeCase = snakeCase;
lodash.some = some;
lodash.sortedIndex = sortedIndex;
lodash.sortedIndexBy = sortedIndexBy;
lodash.sortedIndexOf = sortedIndexOf;
lodash.sortedLastIndex = sortedLastIndex;
lodash.sortedLastIndexBy = sortedLastIndexBy;
lodash.sortedLastIndexOf = sortedLastIndexOf;
lodash.startCase = startCase;
lodash.startsWith = startsWith;
lodash.subtract = subtract;
lodash.sum = sum;
lodash.sumBy = sumBy;
lodash.template = template;
lodash.times = times;
lodash.toFinite = toFinite;
lodash.toInteger = toInteger;
lodash.toLength = toLength;
lodash.toLower = toLower;
lodash.toNumber = toNumber;
lodash.toSafeInteger = toSafeInteger;
lodash.toString = toString;
lodash.toUpper = toUpper;
lodash.trim = trim;
lodash.trimEnd = trimEnd;
lodash.trimStart = trimStart;
lodash.truncate = truncate;
lodash.unescape = unescape;
lodash.uniqueId = uniqueId;
lodash.upperCase = upperCase;
lodash.upperFirst = upperFirst;
// Add aliases.
lodash.each = forEach;
lodash.eachRight = forEachRight;
lodash.first = head;
mixin(lodash, (function() {
var source = {};
baseForOwn(lodash, function(func, methodName) {
if (!hasOwnProperty.call(lodash.prototype, methodName)) {
source[methodName] = func;
}
});
return source;
}()), { 'chain': false });
/*------------------------------------------------------------------------*/
/**
* The semantic version number.
*
* @static
* @memberOf _
* @type {string}
*/
lodash.VERSION = VERSION;
// Assign default placeholders.
arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
lodash[methodName].placeholder = lodash;
});
// Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
arrayEach(['drop', 'take'], function(methodName, index) {
LazyWrapper.prototype[methodName] = function(n) {
n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
var result = (this.__filtered__ && !index)
? new LazyWrapper(this)
: this.clone();
if (result.__filtered__) {
result.__takeCount__ = nativeMin(n, result.__takeCount__);
} else {
result.__views__.push({
'size': nativeMin(n, MAX_ARRAY_LENGTH),
'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
});
}
return result;
};
LazyWrapper.prototype[methodName + 'Right'] = function(n) {
return this.reverse()[methodName](n).reverse();
};
});
// Add `LazyWrapper` methods that accept an `iteratee` value.
arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
var type = index + 1,
isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
LazyWrapper.prototype[methodName] = function(iteratee) {
var result = this.clone();
result.__iteratees__.push({
'iteratee': getIteratee(iteratee, 3),
'type': type
});
result.__filtered__ = result.__filtered__ || isFilter;
return result;
};
});
// Add `LazyWrapper` methods for `_.head` and `_.last`.
arrayEach(['head', 'last'], function(methodName, index) {
var takeName = 'take' + (index ? 'Right' : '');
LazyWrapper.prototype[methodName] = function() {
return this[takeName](1).value()[0];
};
});
// Add `LazyWrapper` methods for `_.initial` and `_.tail`.
arrayEach(['initial', 'tail'], function(methodName, index) {
var dropName = 'drop' + (index ? '' : 'Right');
LazyWrapper.prototype[methodName] = function() {
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
};
});
LazyWrapper.prototype.compact = function() {
return this.filter(identity);
};
LazyWrapper.prototype.find = function(predicate) {
return this.filter(predicate).head();
};
LazyWrapper.prototype.findLast = function(predicate) {
return this.reverse().find(predicate);
};
LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
if (typeof path == 'function') {
return new LazyWrapper(this);
}
return this.map(function(value) {
return baseInvoke(value, path, args);
});
});
LazyWrapper.prototype.reject = function(predicate) {
return this.filter(negate(getIteratee(predicate)));
};
LazyWrapper.prototype.slice = function(start, end) {
start = toInteger(start);
var result = this;
if (result.__filtered__ && (start > 0 || end < 0)) {
return new LazyWrapper(result);
}
if (start < 0) {
result = result.takeRight(-start);
} else if (start) {
result = result.drop(start);
}
if (end !== undefined) {
end = toInteger(end);
result = end < 0 ? result.dropRight(-end) : result.take(end - start);
}
return result;
};
LazyWrapper.prototype.takeRightWhile = function(predicate) {
return this.reverse().takeWhile(predicate).reverse();
};
LazyWrapper.prototype.toArray = function() {
return this.take(MAX_ARRAY_LENGTH);
};
// Add `LazyWrapper` methods to `lodash.prototype`.
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
isTaker = /^(?:head|last)$/.test(methodName),
lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
retUnwrapped = isTaker || /^find/.test(methodName);
if (!lodashFunc) {
return;
}
lodash.prototype[methodName] = function() {
var value = this.__wrapped__,
args = isTaker ? [1] : arguments,
isLazy = value instanceof LazyWrapper,
iteratee = args[0],
useLazy = isLazy || isArray(value);
var interceptor = function(value) {
var result = lodashFunc.apply(lodash, arrayPush([value], args));
return (isTaker && chainAll) ? result[0] : result;
};
if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
// Avoid lazy use if the iteratee has a "length" value other than `1`.
isLazy = useLazy = false;
}
var chainAll = this.__chain__,
isHybrid = !!this.__actions__.length,
isUnwrapped = retUnwrapped && !chainAll,
onlyLazy = isLazy && !isHybrid;
if (!retUnwrapped && useLazy) {
value = onlyLazy ? value : new LazyWrapper(this);
var result = func.apply(value, args);
result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
return new LodashWrapper(result, chainAll);
}
if (isUnwrapped && onlyLazy) {
return func.apply(this, args);
}
result = this.thru(interceptor);
return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
};
});
// Add `Array` methods to `lodash.prototype`.
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
var func = arrayProto[methodName],
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
lodash.prototype[methodName] = function() {
var args = arguments;
if (retUnwrapped && !this.__chain__) {
var value = this.value();
return func.apply(isArray(value) ? value : [], args);
}
return this[chainName](function(value) {
return func.apply(isArray(value) ? value : [], args);
});
};
});
// Map minified method names to their real names.
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
var lodashFunc = lodash[methodName];
if (lodashFunc) {
var key = lodashFunc.name + '';
if (!hasOwnProperty.call(realNames, key)) {
realNames[key] = [];
}
realNames[key].push({ 'name': methodName, 'func': lodashFunc });
}
});
realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
'name': 'wrapper',
'func': undefined
}];
// Add methods to `LazyWrapper`.
LazyWrapper.prototype.clone = lazyClone;
LazyWrapper.prototype.reverse = lazyReverse;
LazyWrapper.prototype.value = lazyValue;
// Add chain sequence methods to the `lodash` wrapper.
lodash.prototype.at = wrapperAt;
lodash.prototype.chain = wrapperChain;
lodash.prototype.commit = wrapperCommit;
lodash.prototype.next = wrapperNext;
lodash.prototype.plant = wrapperPlant;
lodash.prototype.reverse = wrapperReverse;
lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
// Add lazy aliases.
lodash.prototype.first = lodash.prototype.head;
if (symIterator) {
lodash.prototype[symIterator] = wrapperToIterator;
}
return lodash;
});
/*--------------------------------------------------------------------------*/
// Export lodash.
var _ = runInContext();
// Some AMD build optimizers, like r.js, check for condition patterns like:
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
// Expose Lodash on the global object to prevent errors when Lodash is
// loaded by a script tag in the presence of an AMD loader.
// See http://requirejs.org/docs/errors.html#mismatch for more details.
// Use `_.noConflict` to remove Lodash from the global object.
root._ = _;
// Define as an anonymous module so, through path mapping, it can be
// referenced as the "underscore" module.
define(function() {
return _;
});
}
// Check for `exports` after `define` in case a build optimizer adds it.
else if (freeModule) {
// Export for Node.js.
(freeModule.exports = _)._ = _;
// Export for CommonJS support.
freeExports._ = _;
}
else {
// Export to the global object.
root._ = _;
}
}.call(this));
webpack://frontend-tpt/../../node_modules/lodash/map.js
var arrayMap = require('./_arrayMap'),
baseIteratee = require('./_baseIteratee'),
baseMap = require('./_baseMap'),
isArray = require('./isArray');
/**
* Creates an array of values by running each element in `collection` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
* @example
*
* function square(n) {
* return n * n;
* }
*
* _.map([4, 8], square);
* // => [16, 64]
*
* _.map({ 'a': 4, 'b': 8 }, square);
* // => [16, 64] (iteration order is not guaranteed)
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* // The `_.property` iteratee shorthand.
* _.map(users, 'user');
* // => ['barney', 'fred']
*/
function map(collection, iteratee) {
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, baseIteratee(iteratee, 3));
}
module.exports = map;
webpack://frontend-tpt/../../node_modules/lodash/memoize.js
var MapCache = require('./_MapCache');
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Expose `MapCache`.
memoize.Cache = MapCache;
module.exports = memoize;
webpack://frontend-tpt/../../node_modules/lodash/merge.js
var baseMerge = require('./_baseMerge'),
createAssigner = require('./_createAssigner');
/**
* This method is like `_.assign` except that it recursively merges own and
* inherited enumerable string keyed properties of source objects into the
* destination object. Source properties that resolve to `undefined` are
* skipped if a destination value exists. Array and plain object properties
* are merged recursively. Other objects and value types are overridden by
* assignment. Source objects are applied from left to right. Subsequent
* sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var object = {
* 'a': [{ 'b': 2 }, { 'd': 4 }]
* };
*
* var other = {
* 'a': [{ 'c': 3 }, { 'e': 5 }]
* };
*
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
var merge = createAssigner(function(object, source, srcIndex) {
baseMerge(object, source, srcIndex);
});
module.exports = merge;
webpack://frontend-tpt/../../node_modules/lodash/negate.js
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that negates the result of the predicate `func`. The
* `func` predicate is invoked with the `this` binding and arguments of the
* created function.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} predicate The predicate to negate.
* @returns {Function} Returns the new negated function.
* @example
*
* function isEven(n) {
* return n % 2 == 0;
* }
*
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
* // => [1, 3, 5]
*/
function negate(predicate) {
if (typeof predicate != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function() {
var args = arguments;
switch (args.length) {
case 0: return !predicate.call(this);
case 1: return !predicate.call(this, args[0]);
case 2: return !predicate.call(this, args[0], args[1]);
case 3: return !predicate.call(this, args[0], args[1], args[2]);
}
return !predicate.apply(this, args);
};
}
module.exports = negate;
webpack://frontend-tpt/../../node_modules/lodash/noop.js
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
module.exports = noop;
webpack://frontend-tpt/../../node_modules/lodash/now.js
var root = require('./_root');
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = function() {
return root.Date.now();
};
module.exports = now;
webpack://frontend-tpt/../../node_modules/lodash/omit.js
var arrayMap = require('./_arrayMap'),
baseClone = require('./_baseClone'),
baseUnset = require('./_baseUnset'),
castPath = require('./_castPath'),
copyObject = require('./_copyObject'),
customOmitClone = require('./_customOmitClone'),
flatRest = require('./_flatRest'),
getAllKeysIn = require('./_getAllKeysIn');
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function(object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function(path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
module.exports = omit;
webpack://frontend-tpt/../../node_modules/lodash/omitBy.js
var baseIteratee = require('./_baseIteratee'),
negate = require('./negate'),
pickBy = require('./pickBy');
/**
* The opposite of `_.pickBy`; this method creates an object composed of
* the own and inherited enumerable string keyed properties of `object` that
* `predicate` doesn't return truthy for. The predicate is invoked with two
* arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omitBy(object, _.isNumber);
* // => { 'b': '2' }
*/
function omitBy(object, predicate) {
return pickBy(object, negate(baseIteratee(predicate)));
}
module.exports = omitBy;
webpack://frontend-tpt/../../node_modules/lodash/orderBy.js
var baseOrderBy = require('./_baseOrderBy'),
isArray = require('./isArray');
/**
* This method is like `_.sortBy` except that it allows specifying the sort
* orders of the iteratees to sort by. If `orders` is unspecified, all values
* are sorted in ascending order. Otherwise, specify an order of "desc" for
* descending or "asc" for ascending sort order of corresponding values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
* The iteratees to sort by.
* @param {string[]} [orders] The sort orders of `iteratees`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 34 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 36 }
* ];
*
* // Sort by `user` in ascending order and by `age` in descending order.
* _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*/
function orderBy(collection, iteratees, orders, guard) {
if (collection == null) {
return [];
}
if (!isArray(iteratees)) {
iteratees = iteratees == null ? [] : [iteratees];
}
orders = guard ? undefined : orders;
if (!isArray(orders)) {
orders = orders == null ? [] : [orders];
}
return baseOrderBy(collection, iteratees, orders);
}
module.exports = orderBy;
webpack://frontend-tpt/../../node_modules/lodash/pickBy.js
var arrayMap = require('./_arrayMap'),
baseIteratee = require('./_baseIteratee'),
basePickBy = require('./_basePickBy'),
getAllKeysIn = require('./_getAllKeysIn');
/**
* Creates an object composed of the `object` properties `predicate` returns
* truthy for. The predicate is invoked with two arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pickBy(object, _.isNumber);
* // => { 'a': 1, 'c': 3 }
*/
function pickBy(object, predicate) {
if (object == null) {
return {};
}
var props = arrayMap(getAllKeysIn(object), function(prop) {
return [prop];
});
predicate = baseIteratee(predicate);
return basePickBy(object, props, function(value, path) {
return predicate(value, path[0]);
});
}
module.exports = pickBy;
webpack://frontend-tpt/../../node_modules/lodash/property.js
var baseProperty = require('./_baseProperty'),
basePropertyDeep = require('./_basePropertyDeep'),
isKey = require('./_isKey'),
toKey = require('./_toKey');
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = property;
webpack://frontend-tpt/../../node_modules/lodash/rearg.js
var createWrap = require('./_createWrap'),
flatRest = require('./_flatRest');
/** Used to compose bitmasks for function metadata. */
var WRAP_REARG_FLAG = 256;
/**
* Creates a function that invokes `func` with arguments arranged according
* to the specified `indexes` where the argument value at the first index is
* provided as the first argument, the argument value at the second index is
* provided as the second argument, and so on.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to rearrange arguments for.
* @param {...(number|number[])} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
* @example
*
* var rearged = _.rearg(function(a, b, c) {
* return [a, b, c];
* }, [2, 0, 1]);
*
* rearged('b', 'c', 'a')
* // => ['a', 'b', 'c']
*/
var rearg = flatRest(function(func, indexes) {
return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
});
module.exports = rearg;
webpack://frontend-tpt/../../node_modules/lodash/reduce.js
var arrayReduce = require('./_arrayReduce'),
baseEach = require('./_baseEach'),
baseIteratee = require('./_baseIteratee'),
baseReduce = require('./_baseReduce'),
isArray = require('./isArray');
/**
* Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` thru `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator`
* is not given, the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
* and `sortBy`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduceRight
* @example
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
* }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* return result;
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
*/
function reduce(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduce : baseReduce,
initAccum = arguments.length < 3;
return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);
}
module.exports = reduce;
webpack://frontend-tpt/../../node_modules/lodash/remove.js
var baseIteratee = require('./_baseIteratee'),
basePullAt = require('./_basePullAt');
/**
* Removes all elements from `array` that `predicate` returns truthy for
* and returns an array of the removed elements. The predicate is invoked
* with three arguments: (value, index, array).
*
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
* to pull elements from an array by value.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [1, 2, 3, 4];
* var evens = _.remove(array, function(n) {
* return n % 2 == 0;
* });
*
* console.log(array);
* // => [1, 3]
*
* console.log(evens);
* // => [2, 4]
*/
function remove(array, predicate) {
var result = [];
if (!(array && array.length)) {
return result;
}
var index = -1,
indexes = [],
length = array.length;
predicate = baseIteratee(predicate, 3);
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result.push(value);
indexes.push(index);
}
}
basePullAt(array, indexes);
return result;
}
module.exports = remove;
webpack://frontend-tpt/../../node_modules/lodash/replace.js
var toString = require('./toString');
/**
* Replaces matches for `pattern` in `string` with `replacement`.
*
* **Note:** This method is based on
* [`String#replace`](https://mdn.io/String/replace).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to modify.
* @param {RegExp|string} pattern The pattern to replace.
* @param {Function|string} replacement The match replacement.
* @returns {string} Returns the modified string.
* @example
*
* _.replace('Hi Fred', 'Fred', 'Barney');
* // => 'Hi Barney'
*/
function replace() {
var args = arguments,
string = toString(args[0]);
return args.length < 3 ? string : string.replace(args[1], args[2]);
}
module.exports = replace;
webpack://frontend-tpt/../../node_modules/lodash/set.js
var baseSet = require('./_baseSet');
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
module.exports = set;
webpack://frontend-tpt/../../node_modules/lodash/size.js
var baseKeys = require('./_baseKeys'),
getTag = require('./_getTag'),
isArrayLike = require('./isArrayLike'),
isString = require('./isString'),
stringSize = require('./_stringSize');
/** `Object#toString` result references. */
var mapTag = '[object Map]',
setTag = '[object Set]';
/**
* Gets the size of `collection` by returning its length for array-like
* values or the number of own enumerable string keyed properties for objects.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @returns {number} Returns the collection size.
* @example
*
* _.size([1, 2, 3]);
* // => 3
*
* _.size({ 'a': 1, 'b': 2 });
* // => 2
*
* _.size('pebbles');
* // => 7
*/
function size(collection) {
if (collection == null) {
return 0;
}
if (isArrayLike(collection)) {
return isString(collection) ? stringSize(collection) : collection.length;
}
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
return baseKeys(collection).length;
}
module.exports = size;
webpack://frontend-tpt/../../node_modules/lodash/slice.js
var baseSlice = require('./_baseSlice'),
isIterateeCall = require('./_isIterateeCall'),
toInteger = require('./toInteger');
/**
* Creates a slice of `array` from `start` up to, but not including, `end`.
*
* **Note:** This method is used instead of
* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
* returned.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function slice(array, start, end) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
start = 0;
end = length;
}
else {
start = start == null ? 0 : toInteger(start);
end = end === undefined ? length : toInteger(end);
}
return baseSlice(array, start, end);
}
module.exports = slice;
webpack://frontend-tpt/../../node_modules/lodash/some.js
var arraySome = require('./_arraySome'),
baseIteratee = require('./_baseIteratee'),
baseSome = require('./_baseSome'),
isArray = require('./isArray'),
isIterateeCall = require('./_isIterateeCall');
/**
* Checks if `predicate` returns truthy for **any** element of `collection`.
* Iteration is stopped once `predicate` returns truthy. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
* @example
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.some(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.some(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.some(users, 'active');
* // => true
*/
function some(collection, predicate, guard) {
var func = isArray(collection) ? arraySome : baseSome;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, baseIteratee(predicate, 3));
}
module.exports = some;
webpack://frontend-tpt/../../node_modules/lodash/sortBy.js
var baseFlatten = require('./_baseFlatten'),
baseOrderBy = require('./_baseOrderBy'),
baseRest = require('./_baseRest'),
isIterateeCall = require('./_isIterateeCall');
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection thru each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to sort by.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 30 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* _.sortBy(users, [function(o) { return o.user; }]);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
*
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
*/
var sortBy = baseRest(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
module.exports = sortBy;
webpack://frontend-tpt/../../node_modules/lodash/startCase.js
var createCompounder = require('./_createCompounder'),
upperFirst = require('./upperFirst');
/**
* Converts `string` to
* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
*
* @static
* @memberOf _
* @since 3.1.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar--');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__FOO_BAR__');
* // => 'FOO BAR'
*/
var startCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + upperFirst(word);
});
module.exports = startCase;
webpack://frontend-tpt/../../node_modules/lodash/stubArray.js
/**
* This method returns a new empty array.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Array} Returns the new empty array.
* @example
*
* var arrays = _.times(2, _.stubArray);
*
* console.log(arrays);
* // => [[], []]
*
* console.log(arrays[0] === arrays[1]);
* // => false
*/
function stubArray() {
return [];
}
module.exports = stubArray;
webpack://frontend-tpt/../../node_modules/lodash/stubFalse.js
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse() {
return false;
}
module.exports = stubFalse;
webpack://frontend-tpt/../../node_modules/lodash/throttle.js
var debounce = require('./debounce'),
isObject = require('./isObject');
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide `options` to indicate whether `func`
* should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to throttle.
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=true]
* Specify invoking on the leading edge of the timeout.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* // Avoid excessively updating the position while scrolling.
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
*
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
* jQuery(element).on('click', throttled);
*
* // Cancel the trailing throttled invocation.
* jQuery(window).on('popstate', throttled.cancel);
*/
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject(options)) {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
return debounce(func, wait, {
'leading': leading,
'maxWait': wait,
'trailing': trailing
});
}
module.exports = throttle;
webpack://frontend-tpt/../../node_modules/lodash/times.js
var baseTimes = require('./_baseTimes'),
castFunction = require('./_castFunction'),
toInteger = require('./toInteger');
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Invokes the iteratee `n` times, returning an array of the results of
* each invocation. The iteratee is invoked with one argument; (index).
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of results.
* @example
*
* _.times(3, String);
* // => ['0', '1', '2']
*
* _.times(4, _.constant(0));
* // => [0, 0, 0, 0]
*/
function times(n, iteratee) {
n = toInteger(n);
if (n < 1 || n > MAX_SAFE_INTEGER) {
return [];
}
var index = MAX_ARRAY_LENGTH,
length = nativeMin(n, MAX_ARRAY_LENGTH);
iteratee = castFunction(iteratee);
n -= MAX_ARRAY_LENGTH;
var result = baseTimes(length, iteratee);
while (++index < n) {
iteratee(index);
}
return result;
}
module.exports = times;
webpack://frontend-tpt/../../node_modules/lodash/toFinite.js
var toNumber = require('./toNumber');
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308;
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
module.exports = toFinite;
webpack://frontend-tpt/../../node_modules/lodash/toInteger.js
var toFinite = require('./toFinite');
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
module.exports = toInteger;
webpack://frontend-tpt/../../node_modules/lodash/toNumber.js
var baseTrim = require('./_baseTrim'),
isObject = require('./isObject'),
isSymbol = require('./isSymbol');
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = toNumber;
webpack://frontend-tpt/../../node_modules/lodash/toPairs.js
var createToPairs = require('./_createToPairs'),
keys = require('./keys');
/**
* Creates an array of own enumerable string keyed-value pairs for `object`
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its
* entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entries
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairs(new Foo);
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
*/
var toPairs = createToPairs(keys);
module.exports = toPairs;
webpack://frontend-tpt/../../node_modules/lodash/toPath.js
var arrayMap = require('./_arrayMap'),
copyArray = require('./_copyArray'),
isArray = require('./isArray'),
isSymbol = require('./isSymbol'),
stringToPath = require('./_stringToPath'),
toKey = require('./_toKey'),
toString = require('./toString');
/**
* Converts `value` to a property path array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {*} value The value to convert.
* @returns {Array} Returns the new property path array.
* @example
*
* _.toPath('a.b.c');
* // => ['a', 'b', 'c']
*
* _.toPath('a[0].b.c');
* // => ['a', '0', 'b', 'c']
*/
function toPath(value) {
if (isArray(value)) {
return arrayMap(value, toKey);
}
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
}
module.exports = toPath;
webpack://frontend-tpt/../../node_modules/lodash/toPlainObject.js
var copyObject = require('./_copyObject'),
keysIn = require('./keysIn');
/**
* Converts `value` to a plain object flattening inherited enumerable string
* keyed properties of `value` to own properties of the plain object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {Object} Returns the converted plain object.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.assign({ 'a': 1 }, new Foo);
* // => { 'a': 1, 'b': 2 }
*
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
* // => { 'a': 1, 'b': 2, 'c': 3 }
*/
function toPlainObject(value) {
return copyObject(value, keysIn(value));
}
module.exports = toPlainObject;
webpack://frontend-tpt/../../node_modules/lodash/toString.js
var baseToString = require('./_baseToString');
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
module.exports = toString;
webpack://frontend-tpt/../../node_modules/lodash/uniqWith.js
var baseUniq = require('./_baseUniq');
/**
* This method is like `_.uniq` except that it accepts `comparator` which
* is invoked to compare elements of `array`. The order of result values is
* determined by the order they occur in the array.The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.uniqWith(objects, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
*/
function uniqWith(array, comparator) {
comparator = typeof comparator == 'function' ? comparator : undefined;
return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
}
module.exports = uniqWith;
webpack://frontend-tpt/../../node_modules/lodash/upperFirst.js
var createCaseFirst = require('./_createCaseFirst');
/**
* Converts the first character of `string` to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.upperFirst('fred');
* // => 'Fred'
*
* _.upperFirst('FRED');
* // => 'FRED'
*/
var upperFirst = createCaseFirst('toUpperCase');
module.exports = upperFirst;
webpack://frontend-tpt/../../node_modules/lodash/values.js
var baseValues = require('./_baseValues'),
keys = require('./keys');
/**
* Creates an array of the own enumerable string keyed property values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.values(new Foo);
* // => [1, 2] (iteration order is not guaranteed)
*
* _.values('hi');
* // => ['h', 'i']
*/
function values(object) {
return object == null ? [] : baseValues(object, keys(object));
}
module.exports = values;
webpack://frontend-tpt/../../node_modules/lodash/without.js
var baseDifference = require('./_baseDifference'),
baseRest = require('./_baseRest'),
isArrayLikeObject = require('./isArrayLikeObject');
/**
* Creates an array excluding all given values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.pull`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...*} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.xor
* @example
*
* _.without([2, 1, 2, 3], 1, 2);
* // => [3]
*/
var without = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, values)
: [];
});
module.exports = without;
webpack://frontend-tpt/../../node_modules/lodash/words.js
var asciiWords = require('./_asciiWords'),
hasUnicodeWord = require('./_hasUnicodeWord'),
toString = require('./toString'),
unicodeWords = require('./_unicodeWords');
/**
* Splits `string` into an array of its words.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {RegExp|string} [pattern] The pattern to match words.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the words of `string`.
* @example
*
* _.words('fred, barney, & pebbles');
* // => ['fred', 'barney', 'pebbles']
*
* _.words('fred, barney, & pebbles', /[^, ]+/g);
* // => ['fred', 'barney', '&', 'pebbles']
*/
function words(string, pattern, guard) {
string = toString(string);
pattern = guard ? undefined : pattern;
if (pattern === undefined) {
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
}
return string.match(pattern) || [];
}
module.exports = words;
webpack://frontend-tpt/../../node_modules/lodash/wrapperLodash.js
var LazyWrapper = require('./_LazyWrapper'),
LodashWrapper = require('./_LodashWrapper'),
baseLodash = require('./_baseLodash'),
isArray = require('./isArray'),
isObjectLike = require('./isObjectLike'),
wrapperClone = require('./_wrapperClone');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates a `lodash` object which wraps `value` to enable implicit method
* chain sequences. Methods that operate on and return arrays, collections,
* and functions can be chained together. Methods that retrieve a single value
* or may return a primitive value will automatically end the chain sequence
* and return the unwrapped value. Otherwise, the value must be unwrapped
* with `_#value`.
*
* Explicit chain sequences, which must be unwrapped with `_#value`, may be
* enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, it's deferred until
* `_#value` is implicitly or explicitly called.
*
* Lazy evaluation allows several methods to support shortcut fusion.
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
* the creation of intermediate arrays and can greatly reduce the number of
* iteratee executions. Sections of a chain sequence qualify for shortcut
* fusion if the section is applied to an array and iteratees accept only
* one argument. The heuristic for whether a section qualifies for shortcut
* fusion is subject to change.
*
* Chaining is supported in custom builds as long as the `_#value` method is
* directly or indirectly included in the build.
*
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
*
* The chainable wrapper methods are:
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
* `zipObject`, `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
* `upperFirst`, `value`, and `words`
*
* @name _
* @constructor
* @category Seq
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]);
*
* // Returns an unwrapped value.
* wrapped.reduce(_.add);
* // => 6
*
* // Returns a wrapped value.
* var squares = wrapped.map(square);
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
if (value instanceof LodashWrapper) {
return value;
}
if (hasOwnProperty.call(value, '__wrapped__')) {
return wrapperClone(value);
}
}
return new LodashWrapper(value);
}
// Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
lodash.prototype.constructor = lodash;
module.exports = lodash;
webpack://frontend-tpt/../../node_modules/memoize-one/dist/memoize-one.esm.js
var safeIsNaN = Number.isNaN ||
function ponyfill(value) {
return typeof value === 'number' && value !== value;
};
function isEqual(first, second) {
if (first === second) {
return true;
}
if (safeIsNaN(first) && safeIsNaN(second)) {
return true;
}
return false;
}
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i = 0; i < newInputs.length; i++) {
if (!isEqual(newInputs[i], lastInputs[i])) {
return false;
}
}
return true;
}
function memoizeOne(resultFn, isEqual) {
if (isEqual === void 0) { isEqual = areInputsEqual; }
var cache = null;
function memoized() {
var newArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
newArgs[_i] = arguments[_i];
}
if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) {
return cache.lastResult;
}
var lastResult = resultFn.apply(this, newArgs);
cache = {
lastResult: lastResult,
lastArgs: newArgs,
lastThis: this,
};
return lastResult;
}
memoized.clear = function clear() {
cache = null;
};
return memoized;
}
export { memoizeOne as default };
webpack://frontend-tpt/../../node_modules/mobile-detect/mobile-detect.js
// THIS FILE IS GENERATED - DO NOT EDIT!
/*!mobile-detect v1.4.5 2021-03-13*/
/*global module:false, define:false*/
/*jshint latedef:false*/
/*!@license Copyright 2013, Heinrich Goebl, License: MIT, see https://github.com/hgoebl/mobile-detect.js*/
(function (define, undefined) {
define(function () {
'use strict';
var impl = {};
impl.mobileDetectRules = {
"phones": {
"iPhone": "\\biPhone\\b|\\biPod\\b",
"BlackBerry": "BlackBerry|\\bBB10\\b|rim[0-9]+|\\b(BBA100|BBB100|BBD100|BBE100|BBF100|STH100)\\b-[0-9]+",
"Pixel": "; \\bPixel\\b",
"HTC": "HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel",
"Nexus": "Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 5X|Nexus 6",
"Dell": "Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b",
"Motorola": "Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b|XT1068|XT1092|XT1052",
"Samsung": "\\bSamsung\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F|SM-G610F|SM-G981B|SM-G892A|SM-A530F",
"LG": "\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)|LM-G710",
"Sony": "SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533|SOV34|601SO|F8332",
"Asus": "Asus.*Galaxy|PadFone.*Mobile",
"Xiaomi": "^(?!.*\\bx11\\b).*xiaomi.*$|POCOPHONE F1|MI 8|Redmi Note 9S|Redmi Note 5A Prime|N2G47H|M2001J2G|M2001J2I|M1805E10A|M2004J11G|M1902F1G|M2002J9G|M2004J19G|M2003J6A1G",
"NokiaLumia": "Lumia [0-9]{3,4}",
"Micromax": "Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b",
"Palm": "PalmSource|Palm",
"Vertu": "Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature",
"Pantech": "PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790",
"Fly": "IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250",
"Wiko": "KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM",
"iMobile": "i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)",
"SimValley": "\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b",
"Wolfgang": "AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q",
"Alcatel": "Alcatel",
"Nintendo": "Nintendo (3DS|Switch)",
"Amoi": "Amoi",
"INQ": "INQ",
"OnePlus": "ONEPLUS",
"GenericPhone": "Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser"
},
"tablets": {
"iPad": "iPad|iPad.*Mobile",
"NexusTablet": "Android.*Nexus[\\s]+(7|9|10)",
"GoogleTablet": "Android.*Pixel C",
"SamsungTablet": "SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y|SM-T585|SM-T285|SM-T825|SM-W708|SM-T835|SM-T830|SM-T837V|SM-T720|SM-T510|SM-T387V|SM-P610|SM-T290|SM-T515|SM-T590|SM-T595|SM-T725|SM-T817P|SM-P585N0|SM-T395|SM-T295|SM-T865|SM-P610N|SM-P615|SM-T970|SM-T380|SM-T5950|SM-T905|SM-T231|SM-T500|SM-T860",
"Kindle": "Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\b|Android.*Silk\/[0-9.]+ like Chrome\/[0-9.]+ (?!Mobile)",
"SurfaceTablet": "Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)",
"HPTablet": "HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10",
"AsusTablet": "^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\\bP027\\b|\\bP024\\b|\\bP00C\\b",
"BlackBerryTablet": "PlayBook|RIM Tablet",
"HTCtablet": "HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410",
"MotorolaTablet": "xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617",
"NookTablet": "Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2",
"AcerTablet": "Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20\\b|\\bA3-A30|A3-A40",
"ToshibaTablet": "Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO",
"LGTablet": "\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b",
"FujitsuTablet": "Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b",
"PrestigioTablet": "PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002",
"LenovoTablet": "Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)|TB-X103F|TB-X304X|TB-X304F|TB-X304L|TB-X505F|TB-X505L|TB-X505X|TB-X605F|TB-X605L|TB-8703F|TB-8703X|TB-8703N|TB-8704N|TB-8704F|TB-8704X|TB-8704V|TB-7304F|TB-7304I|TB-7304X|Tab2A7-10F|Tab2A7-20F|TB2-X30L|YT3-X50L|YT3-X50F|YT3-X50M|YT-X705F|YT-X703F|YT-X703L|YT-X705L|YT-X705X|TB2-X30F|TB2-X30L|TB2-X30M|A2107A-F|A2107A-H|TB3-730F|TB3-730M|TB3-730X|TB-7504F|TB-7504X|TB-X704F|TB-X104F|TB3-X70F|TB-X705F|TB-8504F|TB3-X70L|TB3-710F|TB-X704L",
"DellTablet": "Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7",
"YarvikTablet": "Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b",
"MedionTablet": "Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB",
"ArnovaTablet": "97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2",
"IntensoTablet": "INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004",
"IRUTablet": "M702pro",
"MegafonTablet": "MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b",
"EbodaTablet": "E-Boda (Supreme|Impresspeed|Izzycomm|Essential)",
"AllViewTablet": "Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)",
"ArchosTablet": "\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b",
"AinolTablet": "NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark",
"NokiaLumiaTablet": "Lumia 2520",
"SonyTablet": "Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP641|SGP612|SOT31|SGP771|SGP611|SGP612|SGP712",
"PhilipsTablet": "\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b",
"CubeTablet": "Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT",
"CobyTablet": "MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010",
"MIDTablet": "M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10",
"MSITablet": "MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b",
"SMiTTablet": "Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)",
"RockChipTablet": "Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A",
"FlyTablet": "IQ310|Fly Vision",
"bqTablet": "Android.*(bq)?.*\\b(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))\\b|Maxwell.*Lite|Maxwell.*Plus",
"HuaweiTablet": "MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|M2-A01L|BAH-L09|BAH-W09|AGS-L09|CMR-AL19",
"NecTablet": "\\bN-06D|\\bN-08D",
"PantechTablet": "Pantech.*P4100",
"BronchoTablet": "Broncho.*(N701|N708|N802|a710)",
"VersusTablet": "TOUCHPAD.*[78910]|\\bTOUCHTAB\\b",
"ZyncTablet": "z1000|Z99 2G|z930|z990|z909|Z919|z900",
"PositivoTablet": "TB07STA|TB10STA|TB07FTA|TB10FTA",
"NabiTablet": "Android.*\\bNabi",
"KoboTablet": "Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build",
"DanewTablet": "DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b",
"TexetTablet": "NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE",
"PlaystationTablet": "Playstation.*(Portable|Vita)",
"TrekstorTablet": "ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab",
"PyleAudioTablet": "\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b",
"AdvanTablet": "Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ",
"DanyTechTablet": "Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1",
"GalapadTablet": "Android [0-9.]+; [a-z-]+; \\bG1\\b",
"MicromaxTablet": "Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b",
"KarbonnTablet": "Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b",
"AllFineTablet": "Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide",
"PROSCANTablet": "\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b",
"YONESTablet": "BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026",
"ChangJiaTablet": "TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503",
"GUTablet": "TX-A1301|TX-M9002|Q702|kf026",
"PointOfViewTablet": "TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10",
"OvermaxTablet": "OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)|Qualcore 1027",
"HCLTablet": "HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync",
"DPSTablet": "DPS Dream 9|DPS Dual 7",
"VistureTablet": "V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10",
"CrestaTablet": "CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989",
"MediatekTablet": "\\bMT8125|MT8389|MT8135|MT8377\\b",
"ConcordeTablet": "Concorde([ ]+)?Tab|ConCorde ReadMan",
"GoCleverTablet": "GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042",
"ModecomTablet": "FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003",
"VoninoTablet": "\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b",
"ECSTablet": "V07OT2|TM105A|S10OT1|TR10CS1",
"StorexTablet": "eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab",
"VodafoneTablet": "SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497|VFD 1400",
"EssentielBTablet": "Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2",
"RossMoorTablet": "RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711",
"iMobileTablet": "i-mobile i-note",
"TolinoTablet": "tolino tab [0-9.]+|tolino shine",
"AudioSonicTablet": "\\bC-22Q|T7-QC|T-17B|T-17P\\b",
"AMPETablet": "Android.* A78 ",
"SkkTablet": "Android.* (SKYPAD|PHOENIX|CYCLOPS)",
"TecnoTablet": "TECNO P9|TECNO DP8D",
"JXDTablet": "Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b",
"iJoyTablet": "Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)",
"FX2Tablet": "FX2 PAD7|FX2 PAD10",
"XoroTablet": "KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151",
"ViewsonicTablet": "ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a",
"VerizonTablet": "QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1",
"OdysTablet": "LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10",
"CaptivaTablet": "CAPTIVA PAD",
"IconbitTablet": "NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S",
"TeclastTablet": "T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi",
"OndaTablet": "\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+|V10 \\b4G\\b",
"JaytechTablet": "TPC-PA762",
"BlaupunktTablet": "Endeavour 800NG|Endeavour 1010",
"DigmaTablet": "\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b",
"EvolioTablet": "ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b",
"LavaTablet": "QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b",
"AocTablet": "MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712",
"MpmanTablet": "MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010",
"CelkonTablet": "CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b",
"WolderTablet": "miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b",
"MediacomTablet": "M-MPI10C3G|M-SP10EG|M-SP10EGP|M-SP10HXAH|M-SP7HXAH|M-SP10HXBH|M-SP8HXAH|M-SP8MXA",
"MiTablet": "\\bMI PAD\\b|\\bHM NOTE 1W\\b",
"NibiruTablet": "Nibiru M1|Nibiru Jupiter One",
"NexoTablet": "NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI",
"LeaderTablet": "TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100",
"UbislateTablet": "UbiSlate[\\s]?7C",
"PocketBookTablet": "Pocketbook",
"KocasoTablet": "\\b(TB-1207)\\b",
"HisenseTablet": "\\b(F5281|E2371)\\b",
"Hudl": "Hudl HT7S3|Hudl 2",
"TelstraTablet": "T-Hub2",
"GenericTablet": "Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b|WVT101|TM1088|KT107"
},
"oss": {
"AndroidOS": "Android",
"BlackBerryOS": "blackberry|\\bBB10\\b|rim tablet os",
"PalmOS": "PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino",
"SymbianOS": "Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b",
"WindowsMobileOS": "Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Windows Mobile|Windows Phone [0-9.]+|WCE;",
"WindowsPhoneOS": "Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;",
"iOS": "\\biPhone.*Mobile|\\biPod|\\biPad|AppleCoreMedia",
"iPadOS": "CPU OS 13",
"SailfishOS": "Sailfish",
"MeeGoOS": "MeeGo",
"MaemoOS": "Maemo",
"JavaOS": "J2ME\/|\\bMIDP\\b|\\bCLDC\\b",
"webOS": "webOS|hpwOS",
"badaOS": "\\bBada\\b",
"BREWOS": "BREW"
},
"uas": {
"Chrome": "\\bCrMo\\b|CriOS|Android.*Chrome\/[.0-9]* (Mobile)?",
"Dolfin": "\\bDolfin\\b",
"Opera": "Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+$|Coast\/[0-9.]+",
"Skyfire": "Skyfire",
"Edge": "\\bEdgiOS\\b|Mobile Safari\/[.0-9]* Edge",
"IE": "IEMobile|MSIEMobile",
"Firefox": "fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS",
"Bolt": "bolt",
"TeaShark": "teashark",
"Blazer": "Blazer",
"Safari": "Version((?!\\bEdgiOS\\b).)*Mobile.*Safari|Safari.*Mobile|MobileSafari",
"WeChat": "\\bMicroMessenger\\b",
"UCBrowser": "UC.*Browser|UCWEB",
"baiduboxapp": "baiduboxapp",
"baidubrowser": "baidubrowser",
"DiigoBrowser": "DiigoBrowser",
"Mercury": "\\bMercury\\b",
"ObigoBrowser": "Obigo",
"NetFront": "NF-Browser",
"GenericBrowser": "NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger",
"PaleMoon": "Android.*PaleMoon|Mobile.*PaleMoon"
},
"props": {
"Mobile": "Mobile\/[VER]",
"Build": "Build\/[VER]",
"Version": "Version\/[VER]",
"VendorID": "VendorID\/[VER]",
"iPad": "iPad.*CPU[a-z ]+[VER]",
"iPhone": "iPhone.*CPU[a-z ]+[VER]",
"iPod": "iPod.*CPU[a-z ]+[VER]",
"Kindle": "Kindle\/[VER]",
"Chrome": [
"Chrome\/[VER]",
"CriOS\/[VER]",
"CrMo\/[VER]"
],
"Coast": [
"Coast\/[VER]"
],
"Dolfin": "Dolfin\/[VER]",
"Firefox": [
"Firefox\/[VER]",
"FxiOS\/[VER]"
],
"Fennec": "Fennec\/[VER]",
"Edge": "Edge\/[VER]",
"IE": [
"IEMobile\/[VER];",
"IEMobile [VER]",
"MSIE [VER];",
"Trident\/[0-9.]+;.*rv:[VER]"
],
"NetFront": "NetFront\/[VER]",
"NokiaBrowser": "NokiaBrowser\/[VER]",
"Opera": [
" OPR\/[VER]",
"Opera Mini\/[VER]",
"Version\/[VER]"
],
"Opera Mini": "Opera Mini\/[VER]",
"Opera Mobi": "Version\/[VER]",
"UCBrowser": [
"UCWEB[VER]",
"UC.*Browser\/[VER]"
],
"MQQBrowser": "MQQBrowser\/[VER]",
"MicroMessenger": "MicroMessenger\/[VER]",
"baiduboxapp": "baiduboxapp\/[VER]",
"baidubrowser": "baidubrowser\/[VER]",
"SamsungBrowser": "SamsungBrowser\/[VER]",
"Iron": "Iron\/[VER]",
"Safari": [
"Version\/[VER]",
"Safari\/[VER]"
],
"Skyfire": "Skyfire\/[VER]",
"Tizen": "Tizen\/[VER]",
"Webkit": "webkit[ \/][VER]",
"PaleMoon": "PaleMoon\/[VER]",
"SailfishBrowser": "SailfishBrowser\/[VER]",
"Gecko": "Gecko\/[VER]",
"Trident": "Trident\/[VER]",
"Presto": "Presto\/[VER]",
"Goanna": "Goanna\/[VER]",
"iOS": " \\bi?OS\\b [VER][ ;]{1}",
"Android": "Android [VER]",
"Sailfish": "Sailfish [VER]",
"BlackBerry": [
"BlackBerry[\\w]+\/[VER]",
"BlackBerry.*Version\/[VER]",
"Version\/[VER]"
],
"BREW": "BREW [VER]",
"Java": "Java\/[VER]",
"Windows Phone OS": [
"Windows Phone OS [VER]",
"Windows Phone [VER]"
],
"Windows Phone": "Windows Phone [VER]",
"Windows CE": "Windows CE\/[VER]",
"Windows NT": "Windows NT [VER]",
"Symbian": [
"SymbianOS\/[VER]",
"Symbian\/[VER]"
],
"webOS": [
"webOS\/[VER]",
"hpwOS\/[VER];"
]
},
"utils": {
"Bot": "Googlebot|facebookexternalhit|Google-AMPHTML|s~amp-validator|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom|contentkingapp|AspiegelBot",
"MobileBot": "Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\/M1A1-R2D2",
"DesktopMode": "WPDesktop",
"TV": "SonyDTV|HbbTV",
"WebKit": "(webkit)[ \/]([\\w.]+)",
"Console": "\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|Nintendo Switch|PLAYSTATION|Xbox)\\b",
"Watch": "SM-V700"
}
};
// following patterns come from http://detectmobilebrowsers.com/
impl.detectMobileBrowsers = {
fullPattern: /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,
shortPattern: /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,
tabletPattern: /android|ipad|playbook|silk/i
};
var hasOwnProp = Object.prototype.hasOwnProperty,
isArray;
impl.FALLBACK_PHONE = 'UnknownPhone';
impl.FALLBACK_TABLET = 'UnknownTablet';
impl.FALLBACK_MOBILE = 'UnknownMobile';
isArray = ('isArray' in Array) ?
Array.isArray : function (value) { return Object.prototype.toString.call(value) === '[object Array]'; };
function equalIC(a, b) {
return a != null && b != null && a.toLowerCase() === b.toLowerCase();
}
function containsIC(array, value) {
var valueLC, i, len = array.length;
if (!len || !value) {
return false;
}
valueLC = value.toLowerCase();
for (i = 0; i < len; ++i) {
if (valueLC === array[i].toLowerCase()) {
return true;
}
}
return false;
}
function convertPropsToRegExp(object) {
for (var key in object) {
if (hasOwnProp.call(object, key)) {
object[key] = new RegExp(object[key], 'i');
}
}
}
function prepareUserAgent(userAgent) {
return (userAgent || '').substr(0, 500); // mitigate vulnerable to ReDoS
}
(function init() {
var key, values, value, i, len, verPos, mobileDetectRules = impl.mobileDetectRules;
for (key in mobileDetectRules.props) {
if (hasOwnProp.call(mobileDetectRules.props, key)) {
values = mobileDetectRules.props[key];
if (!isArray(values)) {
values = [values];
}
len = values.length;
for (i = 0; i < len; ++i) {
value = values[i];
verPos = value.indexOf('[VER]');
if (verPos >= 0) {
value = value.substring(0, verPos) + '([\\w._\\+]+)' + value.substring(verPos + 5);
}
values[i] = new RegExp(value, 'i');
}
mobileDetectRules.props[key] = values;
}
}
convertPropsToRegExp(mobileDetectRules.oss);
convertPropsToRegExp(mobileDetectRules.phones);
convertPropsToRegExp(mobileDetectRules.tablets);
convertPropsToRegExp(mobileDetectRules.uas);
convertPropsToRegExp(mobileDetectRules.utils);
// copy some patterns to oss0 which are tested first (see issue#15)
mobileDetectRules.oss0 = {
WindowsPhoneOS: mobileDetectRules.oss.WindowsPhoneOS,
WindowsMobileOS: mobileDetectRules.oss.WindowsMobileOS
};
}());
/**
* Test userAgent string against a set of rules and find the first matched key.
* @param {Object} rules (key is String, value is RegExp)
* @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent').
* @returns {String|null} the matched key if found, otherwise <tt>null</tt>
* @private
*/
impl.findMatch = function(rules, userAgent) {
for (var key in rules) {
if (hasOwnProp.call(rules, key)) {
if (rules[key].test(userAgent)) {
return key;
}
}
}
return null;
};
/**
* Test userAgent string against a set of rules and return an array of matched keys.
* @param {Object} rules (key is String, value is RegExp)
* @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent').
* @returns {Array} an array of matched keys, may be empty when there is no match, but not <tt>null</tt>
* @private
*/
impl.findMatches = function(rules, userAgent) {
var result = [];
for (var key in rules) {
if (hasOwnProp.call(rules, key)) {
if (rules[key].test(userAgent)) {
result.push(key);
}
}
}
return result;
};
/**
* Check the version of the given property in the User-Agent.
*
* @param {String} propertyName
* @param {String} userAgent
* @return {String} version or <tt>null</tt> if version not found
* @private
*/
impl.getVersionStr = function (propertyName, userAgent) {
var props = impl.mobileDetectRules.props, patterns, i, len, match;
if (hasOwnProp.call(props, propertyName)) {
patterns = props[propertyName];
len = patterns.length;
for (i = 0; i < len; ++i) {
match = patterns[i].exec(userAgent);
if (match !== null) {
return match[1];
}
}
}
return null;
};
/**
* Check the version of the given property in the User-Agent.
* Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)
*
* @param {String} propertyName
* @param {String} userAgent
* @return {Number} version or <tt>NaN</tt> if version not found
* @private
*/
impl.getVersion = function (propertyName, userAgent) {
var version = impl.getVersionStr(propertyName, userAgent);
return version ? impl.prepareVersionNo(version) : NaN;
};
/**
* Prepare the version number.
*
* @param {String} version
* @return {Number} the version number as a floating number
* @private
*/
impl.prepareVersionNo = function (version) {
var numbers;
numbers = version.split(/[a-z._ \/\-]/i);
if (numbers.length === 1) {
version = numbers[0];
}
if (numbers.length > 1) {
version = numbers[0] + '.';
numbers.shift();
version += numbers.join('');
}
return Number(version);
};
impl.isMobileFallback = function (userAgent) {
return impl.detectMobileBrowsers.fullPattern.test(userAgent) ||
impl.detectMobileBrowsers.shortPattern.test(userAgent.substr(0,4));
};
impl.isTabletFallback = function (userAgent) {
return impl.detectMobileBrowsers.tabletPattern.test(userAgent);
};
impl.prepareDetectionCache = function (cache, userAgent, maxPhoneWidth) {
if (cache.mobile !== undefined) {
return;
}
var phone, tablet, phoneSized;
// first check for stronger tablet rules, then phone (see issue#5)
tablet = impl.findMatch(impl.mobileDetectRules.tablets, userAgent);
if (tablet) {
cache.mobile = cache.tablet = tablet;
cache.phone = null;
return; // unambiguously identified as tablet
}
phone = impl.findMatch(impl.mobileDetectRules.phones, userAgent);
if (phone) {
cache.mobile = cache.phone = phone;
cache.tablet = null;
return; // unambiguously identified as phone
}
// our rules haven't found a match -> try more general fallback rules
if (impl.isMobileFallback(userAgent)) {
phoneSized = MobileDetect.isPhoneSized(maxPhoneWidth);
if (phoneSized === undefined) {
cache.mobile = impl.FALLBACK_MOBILE;
cache.tablet = cache.phone = null;
} else if (phoneSized) {
cache.mobile = cache.phone = impl.FALLBACK_PHONE;
cache.tablet = null;
} else {
cache.mobile = cache.tablet = impl.FALLBACK_TABLET;
cache.phone = null;
}
} else if (impl.isTabletFallback(userAgent)) {
cache.mobile = cache.tablet = impl.FALLBACK_TABLET;
cache.phone = null;
} else {
// not mobile at all!
cache.mobile = cache.tablet = cache.phone = null;
}
};
// t is a reference to a MobileDetect instance
impl.mobileGrade = function (t) {
// impl note:
// To keep in sync w/ Mobile_Detect.php easily, the following code is tightly aligned to the PHP version.
// When changes are made in Mobile_Detect.php, copy this method and replace:
// $this-> / t.
// self::MOBILE_GRADE_(.) / '$1'
// , self::VERSION_TYPE_FLOAT / (nothing)
// isIOS() / os('iOS')
// [reg] / (nothing) <-- jsdelivr complaining about unescaped unicode character U+00AE
var $isMobile = t.mobile() !== null;
if (
// Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1)
t.os('iOS') && t.version('iPad')>=4.3 ||
t.os('iOS') && t.version('iPhone')>=3.1 ||
t.os('iOS') && t.version('iPod')>=3.1 ||
// Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5)
// Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM
// Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices
// Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7
( t.version('Android')>2.1 && t.is('Webkit') ) ||
// Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800
t.version('Windows Phone OS')>=7.0 ||
// Blackberry 7 - Tested on BlackBerry Torch 9810
// Blackberry 6.0 - Tested on the Torch 9800 and Style 9670
t.is('BlackBerry') && t.version('BlackBerry')>=6.0 ||
// Blackberry Playbook (1.0-2.0) - Tested on PlayBook
t.match('Playbook.*Tablet') ||
// Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0)
( t.version('webOS')>=1.4 && t.match('Palm|Pre|Pixi') ) ||
// Palm WebOS 3.0 - Tested on HP TouchPad
t.match('hp.*TouchPad') ||
// Firefox Mobile (12 Beta) - Tested on Android 2.3 device
( t.is('Firefox') && t.version('Firefox')>=12 ) ||
// Chrome for Android - Tested on Android 4.0, 4.1 device
( t.is('Chrome') && t.is('AndroidOS') && t.version('Android')>=4.0 ) ||
// Skyfire 4.1 - Tested on Android 2.3 device
( t.is('Skyfire') && t.version('Skyfire')>=4.1 && t.is('AndroidOS') && t.version('Android')>=2.3 ) ||
// Opera Mobile 11.5-12: Tested on Android 2.3
( t.is('Opera') && t.version('Opera Mobi')>11 && t.is('AndroidOS') ) ||
// Meego 1.2 - Tested on Nokia 950 and N9
t.is('MeeGoOS') ||
// Tizen (pre-release) - Tested on early hardware
t.is('Tizen') ||
// Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser
// @todo: more tests here!
t.is('Dolfin') && t.version('Bada')>=2.0 ||
// UC Browser - Tested on Android 2.3 device
( (t.is('UC Browser') || t.is('Dolfin')) && t.version('Android')>=2.3 ) ||
// Kindle 3 and Fire - Tested on the built-in WebKit browser for each
( t.match('Kindle Fire') ||
t.is('Kindle') && t.version('Kindle')>=3.0 ) ||
// Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet
t.is('AndroidOS') && t.is('NookTablet') ||
// Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7
t.version('Chrome')>=11 && !$isMobile ||
// Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7
t.version('Safari')>=5.0 && !$isMobile ||
// Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7
t.version('Firefox')>=4.0 && !$isMobile ||
// Internet Explorer 7-9 - Tested on Windows XP, Vista and 7
t.version('MSIE')>=7.0 && !$isMobile ||
// Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7
// @reference: http://my.opera.com/community/openweb/idopera/
t.version('Opera')>=10 && !$isMobile
){
return 'A';
}
if (
t.os('iOS') && t.version('iPad')<4.3 ||
t.os('iOS') && t.version('iPhone')<3.1 ||
t.os('iOS') && t.version('iPod')<3.1 ||
// Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770
t.is('Blackberry') && t.version('BlackBerry')>=5 && t.version('BlackBerry')<6 ||
//Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3
( t.version('Opera Mini')>=5.0 && t.version('Opera Mini')<=6.5 &&
(t.version('Android')>=2.3 || t.is('iOS')) ) ||
// Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1)
t.match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') ||
// @todo: report this (tested on Nokia N71)
t.version('Opera Mobi')>=11 && t.is('SymbianOS')
){
return 'B';
}
if (
// Blackberry 4.x - Tested on the Curve 8330
t.version('BlackBerry')<5.0 ||
// Windows Mobile - Tested on the HTC Leo (WinMo 5.2)
t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile')<=5.2
){
return 'C';
}
//All older smartphone platforms and featurephones - Any device that doesn't support media queries
//will receive the basic, C grade experience.
return 'C';
};
impl.detectOS = function (ua) {
return impl.findMatch(impl.mobileDetectRules.oss0, ua) ||
impl.findMatch(impl.mobileDetectRules.oss, ua);
};
impl.getDeviceSmallerSide = function () {
return window.screen.width < window.screen.height ?
window.screen.width :
window.screen.height;
};
/**
* Constructor for MobileDetect object.
* <br>
* Such an object will keep a reference to the given user-agent string and cache most of the detect queries.<br>
* <div style="background-color: #d9edf7; border: 1px solid #bce8f1; color: #3a87ad; padding: 14px; border-radius: 2px; margin-top: 20px">
* <strong>Find information how to download and install:</strong>
* <a href="https://github.com/hgoebl/mobile-detect.js/">github.com/hgoebl/mobile-detect.js/</a>
* </div>
*
* @example <pre>
* var md = new MobileDetect(window.navigator.userAgent);
* if (md.mobile()) {
* location.href = (md.mobileGrade() === 'A') ? '/mobile/' : '/lynx/';
* }
* </pre>
*
* @param {string} userAgent typically taken from window.navigator.userAgent or http_header['User-Agent']
* @param {number} [maxPhoneWidth=600] <strong>only for browsers</strong> specify a value for the maximum
* width of smallest device side (in logical "CSS" pixels) until a device detected as mobile will be handled
* as phone.
* This is only used in cases where the device cannot be classified as phone or tablet.<br>
* See <a href="http://developer.android.com/guide/practices/screens_support.html">Declaring Tablet Layouts
* for Android</a>.<br>
* If you provide a value < 0, then this "fuzzy" check is disabled.
* @constructor
* @global
*/
function MobileDetect(userAgent, maxPhoneWidth) {
this.ua = prepareUserAgent(userAgent);
this._cache = {};
//600dp is typical 7" tablet minimum width
this.maxPhoneWidth = maxPhoneWidth || 600;
}
MobileDetect.prototype = {
constructor: MobileDetect,
/**
* Returns the detected phone or tablet type or <tt>null</tt> if it is not a mobile device.
* <br>
* For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.<br>
* <br>
* If the device is not detected by the regular expressions from Mobile-Detect, a test is made against
* the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test
* is positive, a value of <code>UnknownPhone</code>, <code>UnknownTablet</code> or
* <code>UnknownMobile</code> is returned.<br>
* When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br>
* <br>
* When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code>
* and <code>UnknownMobile</code>, so you will get <code>UnknownMobile</code> here.<br>
* Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for:
* {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}.
* In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use.
* <br>
* In most cases you will use the return value just as a boolean.
*
* @returns {String} the key for the phone family or tablet family, e.g. "Nexus".
* @function MobileDetect#mobile
*/
mobile: function () {
impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth);
return this._cache.mobile;
},
/**
* Returns the detected phone type/family string or <tt>null</tt>.
* <br>
* The returned tablet (family or producer) is one of following keys:<br>
* <br><tt>iPhone, BlackBerry, Pixel, HTC, Nexus, Dell, Motorola, Samsung, LG, Sony, Asus,
* Xiaomi, NokiaLumia, Micromax, Palm, Vertu, Pantech, Fly, Wiko, iMobile,
* SimValley, Wolfgang, Alcatel, Nintendo, Amoi, INQ, OnePlus, GenericPhone</tt><br>
* <br>
* If the device is not detected by the regular expressions from Mobile-Detect, a test is made against
* the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test
* is positive, a value of <code>UnknownPhone</code> or <code>UnknownMobile</code> is returned.<br>
* When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br>
* <br>
* When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code>
* and <code>UnknownMobile</code>, so you will get <code>null</code> here, while {@link MobileDetect#mobile}
* will return <code>UnknownMobile</code>.<br>
* Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for:
* {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}.
* In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use.
* <br>
* In most cases you will use the return value just as a boolean.
*
* @returns {String} the key of the phone family or producer, e.g. "iPhone"
* @function MobileDetect#phone
*/
phone: function () {
impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth);
return this._cache.phone;
},
/**
* Returns the detected tablet type/family string or <tt>null</tt>.
* <br>
* The returned tablet (family or producer) is one of following keys:<br>
* <br><tt>iPad, NexusTablet, GoogleTablet, SamsungTablet, Kindle, SurfaceTablet,
* HPTablet, AsusTablet, BlackBerryTablet, HTCtablet, MotorolaTablet, NookTablet,
* AcerTablet, ToshibaTablet, LGTablet, FujitsuTablet, PrestigioTablet,
* LenovoTablet, DellTablet, YarvikTablet, MedionTablet, ArnovaTablet,
* IntensoTablet, IRUTablet, MegafonTablet, EbodaTablet, AllViewTablet,
* ArchosTablet, AinolTablet, NokiaLumiaTablet, SonyTablet, PhilipsTablet,
* CubeTablet, CobyTablet, MIDTablet, MSITablet, SMiTTablet, RockChipTablet,
* FlyTablet, bqTablet, HuaweiTablet, NecTablet, PantechTablet, BronchoTablet,
* VersusTablet, ZyncTablet, PositivoTablet, NabiTablet, KoboTablet, DanewTablet,
* TexetTablet, PlaystationTablet, TrekstorTablet, PyleAudioTablet, AdvanTablet,
* DanyTechTablet, GalapadTablet, MicromaxTablet, KarbonnTablet, AllFineTablet,
* PROSCANTablet, YONESTablet, ChangJiaTablet, GUTablet, PointOfViewTablet,
* OvermaxTablet, HCLTablet, DPSTablet, VistureTablet, CrestaTablet,
* MediatekTablet, ConcordeTablet, GoCleverTablet, ModecomTablet, VoninoTablet,
* ECSTablet, StorexTablet, VodafoneTablet, EssentielBTablet, RossMoorTablet,
* iMobileTablet, TolinoTablet, AudioSonicTablet, AMPETablet, SkkTablet,
* TecnoTablet, JXDTablet, iJoyTablet, FX2Tablet, XoroTablet, ViewsonicTablet,
* VerizonTablet, OdysTablet, CaptivaTablet, IconbitTablet, TeclastTablet,
* OndaTablet, JaytechTablet, BlaupunktTablet, DigmaTablet, EvolioTablet,
* LavaTablet, AocTablet, MpmanTablet, CelkonTablet, WolderTablet, MediacomTablet,
* MiTablet, NibiruTablet, NexoTablet, LeaderTablet, UbislateTablet,
* PocketBookTablet, KocasoTablet, HisenseTablet, Hudl, TelstraTablet,
* GenericTablet</tt><br>
* <br>
* If the device is not detected by the regular expressions from Mobile-Detect, a test is made against
* the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test
* is positive, a value of <code>UnknownTablet</code> or <code>UnknownMobile</code> is returned.<br>
* When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br>
* <br>
* When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code>
* and <code>UnknownMobile</code>, so you will get <code>null</code> here, while {@link MobileDetect#mobile}
* will return <code>UnknownMobile</code>.<br>
* Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for:
* {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}.
* In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use.
* <br>
* In most cases you will use the return value just as a boolean.
*
* @returns {String} the key of the tablet family or producer, e.g. "SamsungTablet"
* @function MobileDetect#tablet
*/
tablet: function () {
impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth);
return this._cache.tablet;
},
/**
* Returns the (first) detected user-agent string or <tt>null</tt>.
* <br>
* The returned user-agent is one of following keys:<br>
* <br><tt>Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, Blazer,
* Safari, WeChat, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, Mercury,
* ObigoBrowser, NetFront, GenericBrowser, PaleMoon</tt><br>
* <br>
* In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare
* cases where a mobile device pretends to be more than one particular browser. You can get the
* list of all matches with {@link MobileDetect#userAgents} or check for a particular value by
* providing one of the defined keys as first argument to {@link MobileDetect#is}.
*
* @returns {String} the key for the detected user-agent or <tt>null</tt>
* @function MobileDetect#userAgent
*/
userAgent: function () {
if (this._cache.userAgent === undefined) {
this._cache.userAgent = impl.findMatch(impl.mobileDetectRules.uas, this.ua);
}
return this._cache.userAgent;
},
/**
* Returns all detected user-agent strings.
* <br>
* The array is empty or contains one or more of following keys:<br>
* <br><tt>Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, Blazer,
* Safari, WeChat, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, Mercury,
* ObigoBrowser, NetFront, GenericBrowser, PaleMoon</tt><br>
* <br>
* In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare
* cases where a mobile device pretends to be more than one particular browser. You can get the
* list of all matches with {@link MobileDetect#userAgents} or check for a particular value by
* providing one of the defined keys as first argument to {@link MobileDetect#is}.
*
* @returns {Array} the array of detected user-agent keys or <tt>[]</tt>
* @function MobileDetect#userAgents
*/
userAgents: function () {
if (this._cache.userAgents === undefined) {
this._cache.userAgents = impl.findMatches(impl.mobileDetectRules.uas, this.ua);
}
return this._cache.userAgents;
},
/**
* Returns the detected operating system string or <tt>null</tt>.
* <br>
* The operating system is one of following keys:<br>
* <br><tt>AndroidOS, BlackBerryOS, PalmOS, SymbianOS, WindowsMobileOS, WindowsPhoneOS,
* iOS, iPadOS, SailfishOS, MeeGoOS, MaemoOS, JavaOS, webOS, badaOS, BREWOS</tt><br>
*
* @returns {String} the key for the detected operating system.
* @function MobileDetect#os
*/
os: function () {
if (this._cache.os === undefined) {
this._cache.os = impl.detectOS(this.ua);
}
return this._cache.os;
},
/**
* Get the version (as Number) of the given property in the User-Agent.
* <br>
* Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)
*
* @param {String} key a key defining a thing which has a version.<br>
* You can use one of following keys:<br>
* <br><tt>Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast,
* Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini,
* Opera Mobi, UCBrowser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser,
* SamsungBrowser, Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon,
* SailfishBrowser, Gecko, Trident, Presto, Goanna, iOS, Android, Sailfish,
* BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows CE, Windows
* NT, Symbian, webOS</tt><br>
*
* @returns {Number} the version as float or <tt>NaN</tt> if User-Agent doesn't contain this version.
* Be careful when comparing this value with '==' operator!
* @function MobileDetect#version
*/
version: function (key) {
return impl.getVersion(key, this.ua);
},
/**
* Get the version (as String) of the given property in the User-Agent.
* <br>
*
* @param {String} key a key defining a thing which has a version.<br>
* You can use one of following keys:<br>
* <br><tt>Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast,
* Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini,
* Opera Mobi, UCBrowser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser,
* SamsungBrowser, Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon,
* SailfishBrowser, Gecko, Trident, Presto, Goanna, iOS, Android, Sailfish,
* BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows CE, Windows
* NT, Symbian, webOS</tt><br>
*
* @returns {String} the "raw" version as String or <tt>null</tt> if User-Agent doesn't contain this version.
*
* @function MobileDetect#versionStr
*/
versionStr: function (key) {
return impl.getVersionStr(key, this.ua);
},
/**
* Global test key against userAgent, os, phone, tablet and some other properties of userAgent string.
*
* @param {String} key the key (case-insensitive) of a userAgent, an operating system, phone or
* tablet family.<br>
* For a complete list of possible values, see {@link MobileDetect#userAgent},
* {@link MobileDetect#os}, {@link MobileDetect#phone}, {@link MobileDetect#tablet}.<br>
* Additionally you have following keys:<br>
* <br><tt>Bot, MobileBot, DesktopMode, TV, WebKit, Console, Watch</tt><br>
*
* @returns {boolean} <tt>true</tt> when the given key is one of the defined keys of userAgent, os, phone,
* tablet or one of the listed additional keys, otherwise <tt>false</tt>
* @function MobileDetect#is
*/
is: function (key) {
return containsIC(this.userAgents(), key) ||
equalIC(key, this.os()) ||
equalIC(key, this.phone()) ||
equalIC(key, this.tablet()) ||
containsIC(impl.findMatches(impl.mobileDetectRules.utils, this.ua), key);
},
/**
* Do a quick test against navigator::userAgent.
*
* @param {String|RegExp} pattern the pattern, either as String or RegExp
* (a string will be converted to a case-insensitive RegExp).
* @returns {boolean} <tt>true</tt> when the pattern matches, otherwise <tt>false</tt>
* @function MobileDetect#match
*/
match: function (pattern) {
if (!(pattern instanceof RegExp)) {
pattern = new RegExp(pattern, 'i');
}
return pattern.test(this.ua);
},
/**
* Checks whether the mobile device can be considered as phone regarding <code>screen.width</code>.
* <br>
* Obviously this method makes sense in browser environments only (not for Node.js)!
* @param {number} [maxPhoneWidth] the maximum logical pixels (aka. CSS-pixels) to be considered as phone.<br>
* The argument is optional and if not present or falsy, the value of the constructor is taken.
* @returns {boolean|undefined} <code>undefined</code> if screen size wasn't detectable, else <code>true</code>
* when screen.width is less or equal to maxPhoneWidth, otherwise <code>false</code>.<br>
* Will always return <code>undefined</code> server-side.
*/
isPhoneSized: function (maxPhoneWidth) {
return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth);
},
/**
* Returns the mobile grade ('A', 'B', 'C').
*
* @returns {String} one of the mobile grades ('A', 'B', 'C').
* @function MobileDetect#mobileGrade
*/
mobileGrade: function () {
if (this._cache.grade === undefined) {
this._cache.grade = impl.mobileGrade(this);
}
return this._cache.grade;
}
};
// environment-dependent
if (typeof window !== 'undefined' && window.screen) {
MobileDetect.isPhoneSized = function (maxPhoneWidth) {
return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth;
};
} else {
MobileDetect.isPhoneSized = function () {};
}
// should not be replaced by a completely new object - just overwrite existing methods
MobileDetect._impl = impl;
MobileDetect.version = '1.4.5 2021-03-13';
return MobileDetect;
}); // end of call of define()
})((function (undefined) {
if (typeof module !== 'undefined' && module.exports) {
return function (factory) { module.exports = factory(); };
} else if (typeof define === 'function' && define.amd) {
return define;
} else if (typeof window !== 'undefined') {
return function (factory) { window.MobileDetect = factory(); };
} else {
// please file a bug if you get this error!
throw new Error('unknown environment');
}
})());
webpack://frontend-tpt/../../node_modules/moment/locale/ sync ^\.\/(en)$
function webpackEmptyContext(req) {
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
}
webpackEmptyContext.keys = () => ([]);
webpackEmptyContext.resolve = webpackEmptyContext;
webpackEmptyContext.id = 39253;
module.exports = webpackEmptyContext;
webpack://frontend-tpt/../../node_modules/moment/moment.js
//! moment.js
//! version : 2.29.4
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.moment = factory()
}(this, (function () { 'use strict';
var hookCallback;
function hooks() {
return hookCallback.apply(null, arguments);
}
// This is done to register the method called with moment()
// without creating circular dependencies.
function setHookCallback(callback) {
hookCallback = callback;
}
function isArray(input) {
return (
input instanceof Array ||
Object.prototype.toString.call(input) === '[object Array]'
);
}
function isObject(input) {
// IE8 will treat undefined and null as object if it wasn't for
// input != null
return (
input != null &&
Object.prototype.toString.call(input) === '[object Object]'
);
}
function hasOwnProp(a, b) {
return Object.prototype.hasOwnProperty.call(a, b);
}
function isObjectEmpty(obj) {
if (Object.getOwnPropertyNames) {
return Object.getOwnPropertyNames(obj).length === 0;
} else {
var k;
for (k in obj) {
if (hasOwnProp(obj, k)) {
return false;
}
}
return true;
}
}
function isUndefined(input) {
return input === void 0;
}
function isNumber(input) {
return (
typeof input === 'number' ||
Object.prototype.toString.call(input) === '[object Number]'
);
}
function isDate(input) {
return (
input instanceof Date ||
Object.prototype.toString.call(input) === '[object Date]'
);
}
function map(arr, fn) {
var res = [],
i,
arrLen = arr.length;
for (i = 0; i < arrLen; ++i) {
res.push(fn(arr[i], i));
}
return res;
}
function extend(a, b) {
for (var i in b) {
if (hasOwnProp(b, i)) {
a[i] = b[i];
}
}
if (hasOwnProp(b, 'toString')) {
a.toString = b.toString;
}
if (hasOwnProp(b, 'valueOf')) {
a.valueOf = b.valueOf;
}
return a;
}
function createUTC(input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, true).utc();
}
function defaultParsingFlags() {
// We need to deep clone this object.
return {
empty: false,
unusedTokens: [],
unusedInput: [],
overflow: -2,
charsLeftOver: 0,
nullInput: false,
invalidEra: null,
invalidMonth: null,
invalidFormat: false,
userInvalidated: false,
iso: false,
parsedDateParts: [],
era: null,
meridiem: null,
rfc2822: false,
weekdayMismatch: false,
};
}
function getParsingFlags(m) {
if (m._pf == null) {
m._pf = defaultParsingFlags();
}
return m._pf;
}
var some;
if (Array.prototype.some) {
some = Array.prototype.some;
} else {
some = function (fun) {
var t = Object(this),
len = t.length >>> 0,
i;
for (i = 0; i < len; i++) {
if (i in t && fun.call(this, t[i], i, t)) {
return true;
}
}
return false;
};
}
function isValid(m) {
if (m._isValid == null) {
var flags = getParsingFlags(m),
parsedParts = some.call(flags.parsedDateParts, function (i) {
return i != null;
}),
isNowValid =
!isNaN(m._d.getTime()) &&
flags.overflow < 0 &&
!flags.empty &&
!flags.invalidEra &&
!flags.invalidMonth &&
!flags.invalidWeekday &&
!flags.weekdayMismatch &&
!flags.nullInput &&
!flags.invalidFormat &&
!flags.userInvalidated &&
(!flags.meridiem || (flags.meridiem && parsedParts));
if (m._strict) {
isNowValid =
isNowValid &&
flags.charsLeftOver === 0 &&
flags.unusedTokens.length === 0 &&
flags.bigHour === undefined;
}
if (Object.isFrozen == null || !Object.isFrozen(m)) {
m._isValid = isNowValid;
} else {
return isNowValid;
}
}
return m._isValid;
}
function createInvalid(flags) {
var m = createUTC(NaN);
if (flags != null) {
extend(getParsingFlags(m), flags);
} else {
getParsingFlags(m).userInvalidated = true;
}
return m;
}
// Plugins that add properties should also add the key here (null value),
// so we can properly clone ourselves.
var momentProperties = (hooks.momentProperties = []),
updateInProgress = false;
function copyConfig(to, from) {
var i,
prop,
val,
momentPropertiesLen = momentProperties.length;
if (!isUndefined(from._isAMomentObject)) {
to._isAMomentObject = from._isAMomentObject;
}
if (!isUndefined(from._i)) {
to._i = from._i;
}
if (!isUndefined(from._f)) {
to._f = from._f;
}
if (!isUndefined(from._l)) {
to._l = from._l;
}
if (!isUndefined(from._strict)) {
to._strict = from._strict;
}
if (!isUndefined(from._tzm)) {
to._tzm = from._tzm;
}
if (!isUndefined(from._isUTC)) {
to._isUTC = from._isUTC;
}
if (!isUndefined(from._offset)) {
to._offset = from._offset;
}
if (!isUndefined(from._pf)) {
to._pf = getParsingFlags(from);
}
if (!isUndefined(from._locale)) {
to._locale = from._locale;
}
if (momentPropertiesLen > 0) {
for (i = 0; i < momentPropertiesLen; i++) {
prop = momentProperties[i];
val = from[prop];
if (!isUndefined(val)) {
to[prop] = val;
}
}
}
return to;
}
// Moment prototype object
function Moment(config) {
copyConfig(this, config);
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
if (!this.isValid()) {
this._d = new Date(NaN);
}
// Prevent infinite loop in case updateOffset creates new moment
// objects.
if (updateInProgress === false) {
updateInProgress = true;
hooks.updateOffset(this);
updateInProgress = false;
}
}
function isMoment(obj) {
return (
obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
);
}
function warn(msg) {
if (
hooks.suppressDeprecationWarnings === false &&
typeof console !== 'undefined' &&
console.warn
) {
console.warn('Deprecation warning: ' + msg);
}
}
function deprecate(msg, fn) {
var firstTime = true;
return extend(function () {
if (hooks.deprecationHandler != null) {
hooks.deprecationHandler(null, msg);
}
if (firstTime) {
var args = [],
arg,
i,
key,
argLen = arguments.length;
for (i = 0; i < argLen; i++) {
arg = '';
if (typeof arguments[i] === 'object') {
arg += '\n[' + i + '] ';
for (key in arguments[0]) {
if (hasOwnProp(arguments[0], key)) {
arg += key + ': ' + arguments[0][key] + ', ';
}
}
arg = arg.slice(0, -2); // Remove trailing comma and space
} else {
arg = arguments[i];
}
args.push(arg);
}
warn(
msg +
'\nArguments: ' +
Array.prototype.slice.call(args).join('') +
'\n' +
new Error().stack
);
firstTime = false;
}
return fn.apply(this, arguments);
}, fn);
}
var deprecations = {};
function deprecateSimple(name, msg) {
if (hooks.deprecationHandler != null) {
hooks.deprecationHandler(name, msg);
}
if (!deprecations[name]) {
warn(msg);
deprecations[name] = true;
}
}
hooks.suppressDeprecationWarnings = false;
hooks.deprecationHandler = null;
function isFunction(input) {
return (
(typeof Function !== 'undefined' && input instanceof Function) ||
Object.prototype.toString.call(input) === '[object Function]'
);
}
function set(config) {
var prop, i;
for (i in config) {
if (hasOwnProp(config, i)) {
prop = config[i];
if (isFunction(prop)) {
this[i] = prop;
} else {
this['_' + i] = prop;
}
}
}
this._config = config;
// Lenient ordinal parsing accepts just a number in addition to
// number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
// TODO: Remove "ordinalParse" fallback in next major release.
this._dayOfMonthOrdinalParseLenient = new RegExp(
(this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
'|' +
/\d{1,2}/.source
);
}
function mergeConfigs(parentConfig, childConfig) {
var res = extend({}, parentConfig),
prop;
for (prop in childConfig) {
if (hasOwnProp(childConfig, prop)) {
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
res[prop] = {};
extend(res[prop], parentConfig[prop]);
extend(res[prop], childConfig[prop]);
} else if (childConfig[prop] != null) {
res[prop] = childConfig[prop];
} else {
delete res[prop];
}
}
}
for (prop in parentConfig) {
if (
hasOwnProp(parentConfig, prop) &&
!hasOwnProp(childConfig, prop) &&
isObject(parentConfig[prop])
) {
// make sure changes to properties don't modify parent config
res[prop] = extend({}, res[prop]);
}
}
return res;
}
function Locale(config) {
if (config != null) {
this.set(config);
}
}
var keys;
if (Object.keys) {
keys = Object.keys;
} else {
keys = function (obj) {
var i,
res = [];
for (i in obj) {
if (hasOwnProp(obj, i)) {
res.push(i);
}
}
return res;
};
}
var defaultCalendar = {
sameDay: '[Today at] LT',
nextDay: '[Tomorrow at] LT',
nextWeek: 'dddd [at] LT',
lastDay: '[Yesterday at] LT',
lastWeek: '[Last] dddd [at] LT',
sameElse: 'L',
};
function calendar(key, mom, now) {
var output = this._calendar[key] || this._calendar['sameElse'];
return isFunction(output) ? output.call(mom, now) : output;
}
function zeroFill(number, targetLength, forceSign) {
var absNumber = '' + Math.abs(number),
zerosToFill = targetLength - absNumber.length,
sign = number >= 0;
return (
(sign ? (forceSign ? '+' : '') : '-') +
Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
absNumber
);
}
var formattingTokens =
/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
formatFunctions = {},
formatTokenFunctions = {};
// token: 'M'
// padded: ['MM', 2]
// ordinal: 'Mo'
// callback: function () { this.month() + 1 }
function addFormatToken(token, padded, ordinal, callback) {
var func = callback;
if (typeof callback === 'string') {
func = function () {
return this[callback]();
};
}
if (token) {
formatTokenFunctions[token] = func;
}
if (padded) {
formatTokenFunctions[padded[0]] = function () {
return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
};
}
if (ordinal) {
formatTokenFunctions[ordinal] = function () {
return this.localeData().ordinal(
func.apply(this, arguments),
token
);
};
}
}
function removeFormattingTokens(input) {
if (input.match(/\[[\s\S]/)) {
return input.replace(/^\[|\]$/g, '');
}
return input.replace(/\\/g, '');
}
function makeFormatFunction(format) {
var array = format.match(formattingTokens),
i,
length;
for (i = 0, length = array.length; i < length; i++) {
if (formatTokenFunctions[array[i]]) {
array[i] = formatTokenFunctions[array[i]];
} else {
array[i] = removeFormattingTokens(array[i]);
}
}
return function (mom) {
var output = '',
i;
for (i = 0; i < length; i++) {
output += isFunction(array[i])
? array[i].call(mom, format)
: array[i];
}
return output;
};
}
// format date using native date object
function formatMoment(m, format) {
if (!m.isValid()) {
return m.localeData().invalidDate();
}
format = expandFormat(format, m.localeData());
formatFunctions[format] =
formatFunctions[format] || makeFormatFunction(format);
return formatFunctions[format](m);
}
function expandFormat(format, locale) {
var i = 5;
function replaceLongDateFormatTokens(input) {
return locale.longDateFormat(input) || input;
}
localFormattingTokens.lastIndex = 0;
while (i >= 0 && localFormattingTokens.test(format)) {
format = format.replace(
localFormattingTokens,
replaceLongDateFormatTokens
);
localFormattingTokens.lastIndex = 0;
i -= 1;
}
return format;
}
var defaultLongDateFormat = {
LTS: 'h:mm:ss A',
LT: 'h:mm A',
L: 'MM/DD/YYYY',
LL: 'MMMM D, YYYY',
LLL: 'MMMM D, YYYY h:mm A',
LLLL: 'dddd, MMMM D, YYYY h:mm A',
};
function longDateFormat(key) {
var format = this._longDateFormat[key],
formatUpper = this._longDateFormat[key.toUpperCase()];
if (format || !formatUpper) {
return format;
}
this._longDateFormat[key] = formatUpper
.match(formattingTokens)
.map(function (tok) {
if (
tok === 'MMMM' ||
tok === 'MM' ||
tok === 'DD' ||
tok === 'dddd'
) {
return tok.slice(1);
}
return tok;
})
.join('');
return this._longDateFormat[key];
}
var defaultInvalidDate = 'Invalid date';
function invalidDate() {
return this._invalidDate;
}
var defaultOrdinal = '%d',
defaultDayOfMonthOrdinalParse = /\d{1,2}/;
function ordinal(number) {
return this._ordinal.replace('%d', number);
}
var defaultRelativeTime = {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
ss: '%d seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
w: 'a week',
ww: '%d weeks',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years',
};
function relativeTime(number, withoutSuffix, string, isFuture) {
var output = this._relativeTime[string];
return isFunction(output)
? output(number, withoutSuffix, string, isFuture)
: output.replace(/%d/i, number);
}
function pastFuture(diff, output) {
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
}
var aliases = {};
function addUnitAlias(unit, shorthand) {
var lowerCase = unit.toLowerCase();
aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
}
function normalizeUnits(units) {
return typeof units === 'string'
? aliases[units] || aliases[units.toLowerCase()]
: undefined;
}
function normalizeObjectUnits(inputObject) {
var normalizedInput = {},
normalizedProp,
prop;
for (prop in inputObject) {
if (hasOwnProp(inputObject, prop)) {
normalizedProp = normalizeUnits(prop);
if (normalizedProp) {
normalizedInput[normalizedProp] = inputObject[prop];
}
}
}
return normalizedInput;
}
var priorities = {};
function addUnitPriority(unit, priority) {
priorities[unit] = priority;
}
function getPrioritizedUnits(unitsObj) {
var units = [],
u;
for (u in unitsObj) {
if (hasOwnProp(unitsObj, u)) {
units.push({ unit: u, priority: priorities[u] });
}
}
units.sort(function (a, b) {
return a.priority - b.priority;
});
return units;
}
function isLeapYear(year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
}
function absFloor(number) {
if (number < 0) {
// -0 -> 0
return Math.ceil(number) || 0;
} else {
return Math.floor(number);
}
}
function toInt(argumentForCoercion) {
var coercedNumber = +argumentForCoercion,
value = 0;
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
value = absFloor(coercedNumber);
}
return value;
}
function makeGetSet(unit, keepTime) {
return function (value) {
if (value != null) {
set$1(this, unit, value);
hooks.updateOffset(this, keepTime);
return this;
} else {
return get(this, unit);
}
};
}
function get(mom, unit) {
return mom.isValid()
? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
: NaN;
}
function set$1(mom, unit, value) {
if (mom.isValid() && !isNaN(value)) {
if (
unit === 'FullYear' &&
isLeapYear(mom.year()) &&
mom.month() === 1 &&
mom.date() === 29
) {
value = toInt(value);
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
value,
mom.month(),
daysInMonth(value, mom.month())
);
} else {
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
}
}
}
// MOMENTS
function stringGet(units) {
units = normalizeUnits(units);
if (isFunction(this[units])) {
return this[units]();
}
return this;
}
function stringSet(units, value) {
if (typeof units === 'object') {
units = normalizeObjectUnits(units);
var prioritized = getPrioritizedUnits(units),
i,
prioritizedLen = prioritized.length;
for (i = 0; i < prioritizedLen; i++) {
this[prioritized[i].unit](units[prioritized[i].unit]);
}
} else {
units = normalizeUnits(units);
if (isFunction(this[units])) {
return this[units](value);
}
}
return this;
}
var match1 = /\d/, // 0 - 9
match2 = /\d\d/, // 00 - 99
match3 = /\d{3}/, // 000 - 999
match4 = /\d{4}/, // 0000 - 9999
match6 = /[+-]?\d{6}/, // -999999 - 999999
match1to2 = /\d\d?/, // 0 - 99
match3to4 = /\d\d\d\d?/, // 999 - 9999
match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
match1to3 = /\d{1,3}/, // 0 - 999
match1to4 = /\d{1,4}/, // 0 - 9999
match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
matchUnsigned = /\d+/, // 0 - inf
matchSigned = /[+-]?\d+/, // -inf - inf
matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
// any word (or two) characters or numbers including two/three word month in arabic.
// includes scottish gaelic two word and hyphenated months
matchWord =
/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
regexes;
regexes = {};
function addRegexToken(token, regex, strictRegex) {
regexes[token] = isFunction(regex)
? regex
: function (isStrict, localeData) {
return isStrict && strictRegex ? strictRegex : regex;
};
}
function getParseRegexForToken(token, config) {
if (!hasOwnProp(regexes, token)) {
return new RegExp(unescapeFormat(token));
}
return regexes[token](config._strict, config._locale);
}
// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
function unescapeFormat(s) {
return regexEscape(
s
.replace('\\', '')
.replace(
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
function (matched, p1, p2, p3, p4) {
return p1 || p2 || p3 || p4;
}
)
);
}
function regexEscape(s) {
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
var tokens = {};
function addParseToken(token, callback) {
var i,
func = callback,
tokenLen;
if (typeof token === 'string') {
token = [token];
}
if (isNumber(callback)) {
func = function (input, array) {
array[callback] = toInt(input);
};
}
tokenLen = token.length;
for (i = 0; i < tokenLen; i++) {
tokens[token[i]] = func;
}
}
function addWeekParseToken(token, callback) {
addParseToken(token, function (input, array, config, token) {
config._w = config._w || {};
callback(input, config._w, config, token);
});
}
function addTimeToArrayFromToken(token, input, config) {
if (input != null && hasOwnProp(tokens, token)) {
tokens[token](input, config._a, config, token);
}
}
var YEAR = 0,
MONTH = 1,
DATE = 2,
HOUR = 3,
MINUTE = 4,
SECOND = 5,
MILLISECOND = 6,
WEEK = 7,
WEEKDAY = 8;
function mod(n, x) {
return ((n % x) + x) % x;
}
var indexOf;
if (Array.prototype.indexOf) {
indexOf = Array.prototype.indexOf;
} else {
indexOf = function (o) {
// I know
var i;
for (i = 0; i < this.length; ++i) {
if (this[i] === o) {
return i;
}
}
return -1;
};
}
function daysInMonth(year, month) {
if (isNaN(year) || isNaN(month)) {
return NaN;
}
var modMonth = mod(month, 12);
year += (month - modMonth) / 12;
return modMonth === 1
? isLeapYear(year)
? 29
: 28
: 31 - ((modMonth % 7) % 2);
}
// FORMATTING
addFormatToken('M', ['MM', 2], 'Mo', function () {
return this.month() + 1;
});
addFormatToken('MMM', 0, 0, function (format) {
return this.localeData().monthsShort(this, format);
});
addFormatToken('MMMM', 0, 0, function (format) {
return this.localeData().months(this, format);
});
// ALIASES
addUnitAlias('month', 'M');
// PRIORITY
addUnitPriority('month', 8);
// PARSING
addRegexToken('M', match1to2);
addRegexToken('MM', match1to2, match2);
addRegexToken('MMM', function (isStrict, locale) {
return locale.monthsShortRegex(isStrict);
});
addRegexToken('MMMM', function (isStrict, locale) {
return locale.monthsRegex(isStrict);
});
addParseToken(['M', 'MM'], function (input, array) {
array[MONTH] = toInt(input) - 1;
});
addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
var month = config._locale.monthsParse(input, token, config._strict);
// if we didn't find a month name, mark the date as invalid.
if (month != null) {
array[MONTH] = month;
} else {
getParsingFlags(config).invalidMonth = input;
}
});
// LOCALES
var defaultLocaleMonths =
'January_February_March_April_May_June_July_August_September_October_November_December'.split(
'_'
),
defaultLocaleMonthsShort =
'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
defaultMonthsShortRegex = matchWord,
defaultMonthsRegex = matchWord;
function localeMonths(m, format) {
if (!m) {
return isArray(this._months)
? this._months
: this._months['standalone'];
}
return isArray(this._months)
? this._months[m.month()]
: this._months[
(this._months.isFormat || MONTHS_IN_FORMAT).test(format)
? 'format'
: 'standalone'
][m.month()];
}
function localeMonthsShort(m, format) {
if (!m) {
return isArray(this._monthsShort)
? this._monthsShort
: this._monthsShort['standalone'];
}
return isArray(this._monthsShort)
? this._monthsShort[m.month()]
: this._monthsShort[
MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
][m.month()];
}
function handleStrictParse(monthName, format, strict) {
var i,
ii,
mom,
llc = monthName.toLocaleLowerCase();
if (!this._monthsParse) {
// this is not used
this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
for (i = 0; i < 12; ++i) {
mom = createUTC([2000, i]);
this._shortMonthsParse[i] = this.monthsShort(
mom,
''
).toLocaleLowerCase();
this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
}
}
if (strict) {
if (format === 'MMM') {
ii = indexOf.call(this._shortMonthsParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._longMonthsParse, llc);
return ii !== -1 ? ii : null;
}
} else {
if (format === 'MMM') {
ii = indexOf.call(this._shortMonthsParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._longMonthsParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._longMonthsParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._shortMonthsParse, llc);
return ii !== -1 ? ii : null;
}
}
}
function localeMonthsParse(monthName, format, strict) {
var i, mom, regex;
if (this._monthsParseExact) {
return handleStrictParse.call(this, monthName, format, strict);
}
if (!this._monthsParse) {
this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
}
// TODO: add sorting
// Sorting makes sure if one month (or abbr) is a prefix of another
// see sorting in computeMonthsParse
for (i = 0; i < 12; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, i]);
if (strict && !this._longMonthsParse[i]) {
this._longMonthsParse[i] = new RegExp(
'^' + this.months(mom, '').replace('.', '') + '$',
'i'
);
this._shortMonthsParse[i] = new RegExp(
'^' + this.monthsShort(mom, '').replace('.', '') + '$',
'i'
);
}
if (!strict && !this._monthsParse[i]) {
regex =
'^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
}
// test the regex
if (
strict &&
format === 'MMMM' &&
this._longMonthsParse[i].test(monthName)
) {
return i;
} else if (
strict &&
format === 'MMM' &&
this._shortMonthsParse[i].test(monthName)
) {
return i;
} else if (!strict && this._monthsParse[i].test(monthName)) {
return i;
}
}
}
// MOMENTS
function setMonth(mom, value) {
var dayOfMonth;
if (!mom.isValid()) {
// No op
return mom;
}
if (typeof value === 'string') {
if (/^\d+$/.test(value)) {
value = toInt(value);
} else {
value = mom.localeData().monthsParse(value);
// TODO: Another silent failure?
if (!isNumber(value)) {
return mom;
}
}
}
dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
return mom;
}
function getSetMonth(value) {
if (value != null) {
setMonth(this, value);
hooks.updateOffset(this, true);
return this;
} else {
return get(this, 'Month');
}
}
function getDaysInMonth() {
return daysInMonth(this.year(), this.month());
}
function monthsShortRegex(isStrict) {
if (this._monthsParseExact) {
if (!hasOwnProp(this, '_monthsRegex')) {
computeMonthsParse.call(this);
}
if (isStrict) {
return this._monthsShortStrictRegex;
} else {
return this._monthsShortRegex;
}
} else {
if (!hasOwnProp(this, '_monthsShortRegex')) {
this._monthsShortRegex = defaultMonthsShortRegex;
}
return this._monthsShortStrictRegex && isStrict
? this._monthsShortStrictRegex
: this._monthsShortRegex;
}
}
function monthsRegex(isStrict) {
if (this._monthsParseExact) {
if (!hasOwnProp(this, '_monthsRegex')) {
computeMonthsParse.call(this);
}
if (isStrict) {
return this._monthsStrictRegex;
} else {
return this._monthsRegex;
}
} else {
if (!hasOwnProp(this, '_monthsRegex')) {
this._monthsRegex = defaultMonthsRegex;
}
return this._monthsStrictRegex && isStrict
? this._monthsStrictRegex
: this._monthsRegex;
}
}
function computeMonthsParse() {
function cmpLenRev(a, b) {
return b.length - a.length;
}
var shortPieces = [],
longPieces = [],
mixedPieces = [],
i,
mom;
for (i = 0; i < 12; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, i]);
shortPieces.push(this.monthsShort(mom, ''));
longPieces.push(this.months(mom, ''));
mixedPieces.push(this.months(mom, ''));
mixedPieces.push(this.monthsShort(mom, ''));
}
// Sorting makes sure if one month (or abbr) is a prefix of another it
// will match the longer piece.
shortPieces.sort(cmpLenRev);
longPieces.sort(cmpLenRev);
mixedPieces.sort(cmpLenRev);
for (i = 0; i < 12; i++) {
shortPieces[i] = regexEscape(shortPieces[i]);
longPieces[i] = regexEscape(longPieces[i]);
}
for (i = 0; i < 24; i++) {
mixedPieces[i] = regexEscape(mixedPieces[i]);
}
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
this._monthsShortRegex = this._monthsRegex;
this._monthsStrictRegex = new RegExp(
'^(' + longPieces.join('|') + ')',
'i'
);
this._monthsShortStrictRegex = new RegExp(
'^(' + shortPieces.join('|') + ')',
'i'
);
}
// FORMATTING
addFormatToken('Y', 0, 0, function () {
var y = this.year();
return y <= 9999 ? zeroFill(y, 4) : '+' + y;
});
addFormatToken(0, ['YY', 2], 0, function () {
return this.year() % 100;
});
addFormatToken(0, ['YYYY', 4], 0, 'year');
addFormatToken(0, ['YYYYY', 5], 0, 'year');
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
// ALIASES
addUnitAlias('year', 'y');
// PRIORITIES
addUnitPriority('year', 1);
// PARSING
addRegexToken('Y', matchSigned);
addRegexToken('YY', match1to2, match2);
addRegexToken('YYYY', match1to4, match4);
addRegexToken('YYYYY', match1to6, match6);
addRegexToken('YYYYYY', match1to6, match6);
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
addParseToken('YYYY', function (input, array) {
array[YEAR] =
input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
});
addParseToken('YY', function (input, array) {
array[YEAR] = hooks.parseTwoDigitYear(input);
});
addParseToken('Y', function (input, array) {
array[YEAR] = parseInt(input, 10);
});
// HELPERS
function daysInYear(year) {
return isLeapYear(year) ? 366 : 365;
}
// HOOKS
hooks.parseTwoDigitYear = function (input) {
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
};
// MOMENTS
var getSetYear = makeGetSet('FullYear', true);
function getIsLeapYear() {
return isLeapYear(this.year());
}
function createDate(y, m, d, h, M, s, ms) {
// can't just apply() to create a date:
// https://stackoverflow.com/q/181348
var date;
// the date constructor remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0) {
// preserve leap years using a full 400 year cycle, then reset
date = new Date(y + 400, m, d, h, M, s, ms);
if (isFinite(date.getFullYear())) {
date.setFullYear(y);
}
} else {
date = new Date(y, m, d, h, M, s, ms);
}
return date;
}
function createUTCDate(y) {
var date, args;
// the Date.UTC function remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0) {
args = Array.prototype.slice.call(arguments);
// preserve leap years using a full 400 year cycle, then reset
args[0] = y + 400;
date = new Date(Date.UTC.apply(null, args));
if (isFinite(date.getUTCFullYear())) {
date.setUTCFullYear(y);
}
} else {
date = new Date(Date.UTC.apply(null, arguments));
}
return date;
}
// start-of-first-week - start-of-year
function firstWeekOffset(year, dow, doy) {
var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
fwd = 7 + dow - doy,
// first-week day local weekday -- which local weekday is fwd
fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
return -fwdlw + fwd - 1;
}
// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
var localWeekday = (7 + weekday - dow) % 7,
weekOffset = firstWeekOffset(year, dow, doy),
dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
resYear,
resDayOfYear;
if (dayOfYear <= 0) {
resYear = year - 1;
resDayOfYear = daysInYear(resYear) + dayOfYear;
} else if (dayOfYear > daysInYear(year)) {
resYear = year + 1;
resDayOfYear = dayOfYear - daysInYear(year);
} else {
resYear = year;
resDayOfYear = dayOfYear;
}
return {
year: resYear,
dayOfYear: resDayOfYear,
};
}
function weekOfYear(mom, dow, doy) {
var weekOffset = firstWeekOffset(mom.year(), dow, doy),
week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
resWeek,
resYear;
if (week < 1) {
resYear = mom.year() - 1;
resWeek = week + weeksInYear(resYear, dow, doy);
} else if (week > weeksInYear(mom.year(), dow, doy)) {
resWeek = week - weeksInYear(mom.year(), dow, doy);
resYear = mom.year() + 1;
} else {
resYear = mom.year();
resWeek = week;
}
return {
week: resWeek,
year: resYear,
};
}
function weeksInYear(year, dow, doy) {
var weekOffset = firstWeekOffset(year, dow, doy),
weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
}
// FORMATTING
addFormatToken('w', ['ww', 2], 'wo', 'week');
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
// ALIASES
addUnitAlias('week', 'w');
addUnitAlias('isoWeek', 'W');
// PRIORITIES
addUnitPriority('week', 5);
addUnitPriority('isoWeek', 5);
// PARSING
addRegexToken('w', match1to2);
addRegexToken('ww', match1to2, match2);
addRegexToken('W', match1to2);
addRegexToken('WW', match1to2, match2);
addWeekParseToken(
['w', 'ww', 'W', 'WW'],
function (input, week, config, token) {
week[token.substr(0, 1)] = toInt(input);
}
);
// HELPERS
// LOCALES
function localeWeek(mom) {
return weekOfYear(mom, this._week.dow, this._week.doy).week;
}
var defaultLocaleWeek = {
dow: 0, // Sunday is the first day of the week.
doy: 6, // The week that contains Jan 6th is the first week of the year.
};
function localeFirstDayOfWeek() {
return this._week.dow;
}
function localeFirstDayOfYear() {
return this._week.doy;
}
// MOMENTS
function getSetWeek(input) {
var week = this.localeData().week(this);
return input == null ? week : this.add((input - week) * 7, 'd');
}
function getSetISOWeek(input) {
var week = weekOfYear(this, 1, 4).week;
return input == null ? week : this.add((input - week) * 7, 'd');
}
// FORMATTING
addFormatToken('d', 0, 'do', 'day');
addFormatToken('dd', 0, 0, function (format) {
return this.localeData().weekdaysMin(this, format);
});
addFormatToken('ddd', 0, 0, function (format) {
return this.localeData().weekdaysShort(this, format);
});
addFormatToken('dddd', 0, 0, function (format) {
return this.localeData().weekdays(this, format);
});
addFormatToken('e', 0, 0, 'weekday');
addFormatToken('E', 0, 0, 'isoWeekday');
// ALIASES
addUnitAlias('day', 'd');
addUnitAlias('weekday', 'e');
addUnitAlias('isoWeekday', 'E');
// PRIORITY
addUnitPriority('day', 11);
addUnitPriority('weekday', 11);
addUnitPriority('isoWeekday', 11);
// PARSING
addRegexToken('d', match1to2);
addRegexToken('e', match1to2);
addRegexToken('E', match1to2);
addRegexToken('dd', function (isStrict, locale) {
return locale.weekdaysMinRegex(isStrict);
});
addRegexToken('ddd', function (isStrict, locale) {
return locale.weekdaysShortRegex(isStrict);
});
addRegexToken('dddd', function (isStrict, locale) {
return locale.weekdaysRegex(isStrict);
});
addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
var weekday = config._locale.weekdaysParse(input, token, config._strict);
// if we didn't get a weekday name, mark the date as invalid
if (weekday != null) {
week.d = weekday;
} else {
getParsingFlags(config).invalidWeekday = input;
}
});
addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
week[token] = toInt(input);
});
// HELPERS
function parseWeekday(input, locale) {
if (typeof input !== 'string') {
return input;
}
if (!isNaN(input)) {
return parseInt(input, 10);
}
input = locale.weekdaysParse(input);
if (typeof input === 'number') {
return input;
}
return null;
}
function parseIsoWeekday(input, locale) {
if (typeof input === 'string') {
return locale.weekdaysParse(input) % 7 || 7;
}
return isNaN(input) ? null : input;
}
// LOCALES
function shiftWeekdays(ws, n) {
return ws.slice(n, 7).concat(ws.slice(0, n));
}
var defaultLocaleWeekdays =
'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
defaultWeekdaysRegex = matchWord,
defaultWeekdaysShortRegex = matchWord,
defaultWeekdaysMinRegex = matchWord;
function localeWeekdays(m, format) {
var weekdays = isArray(this._weekdays)
? this._weekdays
: this._weekdays[
m && m !== true && this._weekdays.isFormat.test(format)
? 'format'
: 'standalone'
];
return m === true
? shiftWeekdays(weekdays, this._week.dow)
: m
? weekdays[m.day()]
: weekdays;
}
function localeWeekdaysShort(m) {
return m === true
? shiftWeekdays(this._weekdaysShort, this._week.dow)
: m
? this._weekdaysShort[m.day()]
: this._weekdaysShort;
}
function localeWeekdaysMin(m) {
return m === true
? shiftWeekdays(this._weekdaysMin, this._week.dow)
: m
? this._weekdaysMin[m.day()]
: this._weekdaysMin;
}
function handleStrictParse$1(weekdayName, format, strict) {
var i,
ii,
mom,
llc = weekdayName.toLocaleLowerCase();
if (!this._weekdaysParse) {
this._weekdaysParse = [];
this._shortWeekdaysParse = [];
this._minWeekdaysParse = [];
for (i = 0; i < 7; ++i) {
mom = createUTC([2000, 1]).day(i);
this._minWeekdaysParse[i] = this.weekdaysMin(
mom,
''
).toLocaleLowerCase();
this._shortWeekdaysParse[i] = this.weekdaysShort(
mom,
''
).toLocaleLowerCase();
this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
}
}
if (strict) {
if (format === 'dddd') {
ii = indexOf.call(this._weekdaysParse, llc);
return ii !== -1 ? ii : null;
} else if (format === 'ddd') {
ii = indexOf.call(this._shortWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
}
} else {
if (format === 'dddd') {
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._shortWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else if (format === 'ddd') {
ii = indexOf.call(this._shortWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._minWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._shortWeekdaysParse, llc);
return ii !== -1 ? ii : null;
}
}
}
function localeWeekdaysParse(weekdayName, format, strict) {
var i, mom, regex;
if (this._weekdaysParseExact) {
return handleStrictParse$1.call(this, weekdayName, format, strict);
}
if (!this._weekdaysParse) {
this._weekdaysParse = [];
this._minWeekdaysParse = [];
this._shortWeekdaysParse = [];
this._fullWeekdaysParse = [];
}
for (i = 0; i < 7; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, 1]).day(i);
if (strict && !this._fullWeekdaysParse[i]) {
this._fullWeekdaysParse[i] = new RegExp(
'^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
'i'
);
this._shortWeekdaysParse[i] = new RegExp(
'^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
'i'
);
this._minWeekdaysParse[i] = new RegExp(
'^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
'i'
);
}
if (!this._weekdaysParse[i]) {
regex =
'^' +
this.weekdays(mom, '') +
'|^' +
this.weekdaysShort(mom, '') +
'|^' +
this.weekdaysMin(mom, '');
this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
}
// test the regex
if (
strict &&
format === 'dddd' &&
this._fullWeekdaysParse[i].test(weekdayName)
) {
return i;
} else if (
strict &&
format === 'ddd' &&
this._shortWeekdaysParse[i].test(weekdayName)
) {
return i;
} else if (
strict &&
format === 'dd' &&
this._minWeekdaysParse[i].test(weekdayName)
) {
return i;
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
return i;
}
}
}
// MOMENTS
function getSetDayOfWeek(input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
if (input != null) {
input = parseWeekday(input, this.localeData());
return this.add(input - day, 'd');
} else {
return day;
}
}
function getSetLocaleDayOfWeek(input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
return input == null ? weekday : this.add(input - weekday, 'd');
}
function getSetISODayOfWeek(input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
// behaves the same as moment#day except
// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
// as a setter, sunday should belong to the previous week.
if (input != null) {
var weekday = parseIsoWeekday(input, this.localeData());
return this.day(this.day() % 7 ? weekday : weekday - 7);
} else {
return this.day() || 7;
}
}
function weekdaysRegex(isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysStrictRegex;
} else {
return this._weekdaysRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysRegex')) {
this._weekdaysRegex = defaultWeekdaysRegex;
}
return this._weekdaysStrictRegex && isStrict
? this._weekdaysStrictRegex
: this._weekdaysRegex;
}
}
function weekdaysShortRegex(isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysShortStrictRegex;
} else {
return this._weekdaysShortRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysShortRegex')) {
this._weekdaysShortRegex = defaultWeekdaysShortRegex;
}
return this._weekdaysShortStrictRegex && isStrict
? this._weekdaysShortStrictRegex
: this._weekdaysShortRegex;
}
}
function weekdaysMinRegex(isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysMinStrictRegex;
} else {
return this._weekdaysMinRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysMinRegex')) {
this._weekdaysMinRegex = defaultWeekdaysMinRegex;
}
return this._weekdaysMinStrictRegex && isStrict
? this._weekdaysMinStrictRegex
: this._weekdaysMinRegex;
}
}
function computeWeekdaysParse() {
function cmpLenRev(a, b) {
return b.length - a.length;
}
var minPieces = [],
shortPieces = [],
longPieces = [],
mixedPieces = [],
i,
mom,
minp,
shortp,
longp;
for (i = 0; i < 7; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, 1]).day(i);
minp = regexEscape(this.weekdaysMin(mom, ''));
shortp = regexEscape(this.weekdaysShort(mom, ''));
longp = regexEscape(this.weekdays(mom, ''));
minPieces.push(minp);
shortPieces.push(shortp);
longPieces.push(longp);
mixedPieces.push(minp);
mixedPieces.push(shortp);
mixedPieces.push(longp);
}
// Sorting makes sure if one weekday (or abbr) is a prefix of another it
// will match the longer piece.
minPieces.sort(cmpLenRev);
shortPieces.sort(cmpLenRev);
longPieces.sort(cmpLenRev);
mixedPieces.sort(cmpLenRev);
this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
this._weekdaysShortRegex = this._weekdaysRegex;
this._weekdaysMinRegex = this._weekdaysRegex;
this._weekdaysStrictRegex = new RegExp(
'^(' + longPieces.join('|') + ')',
'i'
);
this._weekdaysShortStrictRegex = new RegExp(
'^(' + shortPieces.join('|') + ')',
'i'
);
this._weekdaysMinStrictRegex = new RegExp(
'^(' + minPieces.join('|') + ')',
'i'
);
}
// FORMATTING
function hFormat() {
return this.hours() % 12 || 12;
}
function kFormat() {
return this.hours() || 24;
}
addFormatToken('H', ['HH', 2], 0, 'hour');
addFormatToken('h', ['hh', 2], 0, hFormat);
addFormatToken('k', ['kk', 2], 0, kFormat);
addFormatToken('hmm', 0, 0, function () {
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
});
addFormatToken('hmmss', 0, 0, function () {
return (
'' +
hFormat.apply(this) +
zeroFill(this.minutes(), 2) +
zeroFill(this.seconds(), 2)
);
});
addFormatToken('Hmm', 0, 0, function () {
return '' + this.hours() + zeroFill(this.minutes(), 2);
});
addFormatToken('Hmmss', 0, 0, function () {
return (
'' +
this.hours() +
zeroFill(this.minutes(), 2) +
zeroFill(this.seconds(), 2)
);
});
function meridiem(token, lowercase) {
addFormatToken(token, 0, 0, function () {
return this.localeData().meridiem(
this.hours(),
this.minutes(),
lowercase
);
});
}
meridiem('a', true);
meridiem('A', false);
// ALIASES
addUnitAlias('hour', 'h');
// PRIORITY
addUnitPriority('hour', 13);
// PARSING
function matchMeridiem(isStrict, locale) {
return locale._meridiemParse;
}
addRegexToken('a', matchMeridiem);
addRegexToken('A', matchMeridiem);
addRegexToken('H', match1to2);
addRegexToken('h', match1to2);
addRegexToken('k', match1to2);
addRegexToken('HH', match1to2, match2);
addRegexToken('hh', match1to2, match2);
addRegexToken('kk', match1to2, match2);
addRegexToken('hmm', match3to4);
addRegexToken('hmmss', match5to6);
addRegexToken('Hmm', match3to4);
addRegexToken('Hmmss', match5to6);
addParseToken(['H', 'HH'], HOUR);
addParseToken(['k', 'kk'], function (input, array, config) {
var kInput = toInt(input);
array[HOUR] = kInput === 24 ? 0 : kInput;
});
addParseToken(['a', 'A'], function (input, array, config) {
config._isPm = config._locale.isPM(input);
config._meridiem = input;
});
addParseToken(['h', 'hh'], function (input, array, config) {
array[HOUR] = toInt(input);
getParsingFlags(config).bigHour = true;
});
addParseToken('hmm', function (input, array, config) {
var pos = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos));
array[MINUTE] = toInt(input.substr(pos));
getParsingFlags(config).bigHour = true;
});
addParseToken('hmmss', function (input, array, config) {
var pos1 = input.length - 4,
pos2 = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos1));
array[MINUTE] = toInt(input.substr(pos1, 2));
array[SECOND] = toInt(input.substr(pos2));
getParsingFlags(config).bigHour = true;
});
addParseToken('Hmm', function (input, array, config) {
var pos = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos));
array[MINUTE] = toInt(input.substr(pos));
});
addParseToken('Hmmss', function (input, array, config) {
var pos1 = input.length - 4,
pos2 = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos1));
array[MINUTE] = toInt(input.substr(pos1, 2));
array[SECOND] = toInt(input.substr(pos2));
});
// LOCALES
function localeIsPM(input) {
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
// Using charAt should be more compatible.
return (input + '').toLowerCase().charAt(0) === 'p';
}
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
// Setting the hour should keep the time, because the user explicitly
// specified which hour they want. So trying to maintain the same hour (in
// a new timezone) makes sense. Adding/subtracting hours does not follow
// this rule.
getSetHour = makeGetSet('Hours', true);
function localeMeridiem(hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'pm' : 'PM';
} else {
return isLower ? 'am' : 'AM';
}
}
var baseConfig = {
calendar: defaultCalendar,
longDateFormat: defaultLongDateFormat,
invalidDate: defaultInvalidDate,
ordinal: defaultOrdinal,
dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
relativeTime: defaultRelativeTime,
months: defaultLocaleMonths,
monthsShort: defaultLocaleMonthsShort,
week: defaultLocaleWeek,
weekdays: defaultLocaleWeekdays,
weekdaysMin: defaultLocaleWeekdaysMin,
weekdaysShort: defaultLocaleWeekdaysShort,
meridiemParse: defaultLocaleMeridiemParse,
};
// internal storage for locale config files
var locales = {},
localeFamilies = {},
globalLocale;
function commonPrefix(arr1, arr2) {
var i,
minl = Math.min(arr1.length, arr2.length);
for (i = 0; i < minl; i += 1) {
if (arr1[i] !== arr2[i]) {
return i;
}
}
return minl;
}
function normalizeLocale(key) {
return key ? key.toLowerCase().replace('_', '-') : key;
}
// pick the locale from the array
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
function chooseLocale(names) {
var i = 0,
j,
next,
locale,
split;
while (i < names.length) {
split = normalizeLocale(names[i]).split('-');
j = split.length;
next = normalizeLocale(names[i + 1]);
next = next ? next.split('-') : null;
while (j > 0) {
locale = loadLocale(split.slice(0, j).join('-'));
if (locale) {
return locale;
}
if (
next &&
next.length >= j &&
commonPrefix(split, next) >= j - 1
) {
//the next array item is better than a shallower substring of this one
break;
}
j--;
}
i++;
}
return globalLocale;
}
function isLocaleNameSane(name) {
// Prevent names that look like filesystem paths, i.e contain '/' or '\'
return name.match('^[^/\\\\]*$') != null;
}
function loadLocale(name) {
var oldLocale = null,
aliasedRequire;
// TODO: Find a better way to register and load all the locales in Node
if (
locales[name] === undefined &&
typeof module !== 'undefined' &&
module &&
module.exports &&
isLocaleNameSane(name)
) {
try {
oldLocale = globalLocale._abbr;
aliasedRequire = require;
aliasedRequire('./locale/' + name);
getSetGlobalLocale(oldLocale);
} catch (e) {
// mark as not found to avoid repeating expensive file require call causing high CPU
// when trying to find en-US, en_US, en-us for every format call
locales[name] = null; // null means not found
}
}
return locales[name];
}
// This function will load locale and then set the global locale. If
// no arguments are passed in, it will simply return the current global
// locale key.
function getSetGlobalLocale(key, values) {
var data;
if (key) {
if (isUndefined(values)) {
data = getLocale(key);
} else {
data = defineLocale(key, values);
}
if (data) {
// moment.duration._locale = moment._locale = data;
globalLocale = data;
} else {
if (typeof console !== 'undefined' && console.warn) {
//warn user if arguments are passed but the locale could not be set
console.warn(
'Locale ' + key + ' not found. Did you forget to load it?'
);
}
}
}
return globalLocale._abbr;
}
function defineLocale(name, config) {
if (config !== null) {
var locale,
parentConfig = baseConfig;
config.abbr = name;
if (locales[name] != null) {
deprecateSimple(
'defineLocaleOverride',
'use moment.updateLocale(localeName, config) to change ' +
'an existing locale. moment.defineLocale(localeName, ' +
'config) should only be used for creating a new locale ' +
'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
);
parentConfig = locales[name]._config;
} else if (config.parentLocale != null) {
if (locales[config.parentLocale] != null) {
parentConfig = locales[config.parentLocale]._config;
} else {
locale = loadLocale(config.parentLocale);
if (locale != null) {
parentConfig = locale._config;
} else {
if (!localeFamilies[config.parentLocale]) {
localeFamilies[config.parentLocale] = [];
}
localeFamilies[config.parentLocale].push({
name: name,
config: config,
});
return null;
}
}
}
locales[name] = new Locale(mergeConfigs(parentConfig, config));
if (localeFamilies[name]) {
localeFamilies[name].forEach(function (x) {
defineLocale(x.name, x.config);
});
}
// backwards compat for now: also set the locale
// make sure we set the locale AFTER all child locales have been
// created, so we won't end up with the child locale set.
getSetGlobalLocale(name);
return locales[name];
} else {
// useful for testing
delete locales[name];
return null;
}
}
function updateLocale(name, config) {
if (config != null) {
var locale,
tmpLocale,
parentConfig = baseConfig;
if (locales[name] != null && locales[name].parentLocale != null) {
// Update existing child locale in-place to avoid memory-leaks
locales[name].set(mergeConfigs(locales[name]._config, config));
} else {
// MERGE
tmpLocale = loadLocale(name);
if (tmpLocale != null) {
parentConfig = tmpLocale._config;
}
config = mergeConfigs(parentConfig, config);
if (tmpLocale == null) {
// updateLocale is called for creating a new locale
// Set abbr so it will have a name (getters return
// undefined otherwise).
config.abbr = name;
}
locale = new Locale(config);
locale.parentLocale = locales[name];
locales[name] = locale;
}
// backwards compat for now: also set the locale
getSetGlobalLocale(name);
} else {
// pass null for config to unupdate, useful for tests
if (locales[name] != null) {
if (locales[name].parentLocale != null) {
locales[name] = locales[name].parentLocale;
if (name === getSetGlobalLocale()) {
getSetGlobalLocale(name);
}
} else if (locales[name] != null) {
delete locales[name];
}
}
}
return locales[name];
}
// returns locale data
function getLocale(key) {
var locale;
if (key && key._locale && key._locale._abbr) {
key = key._locale._abbr;
}
if (!key) {
return globalLocale;
}
if (!isArray(key)) {
//short-circuit everything else
locale = loadLocale(key);
if (locale) {
return locale;
}
key = [key];
}
return chooseLocale(key);
}
function listLocales() {
return keys(locales);
}
function checkOverflow(m) {
var overflow,
a = m._a;
if (a && getParsingFlags(m).overflow === -2) {
overflow =
a[MONTH] < 0 || a[MONTH] > 11
? MONTH
: a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
? DATE
: a[HOUR] < 0 ||
a[HOUR] > 24 ||
(a[HOUR] === 24 &&
(a[MINUTE] !== 0 ||
a[SECOND] !== 0 ||
a[MILLISECOND] !== 0))
? HOUR
: a[MINUTE] < 0 || a[MINUTE] > 59
? MINUTE
: a[SECOND] < 0 || a[SECOND] > 59
? SECOND
: a[MILLISECOND] < 0 || a[MILLISECOND] > 999
? MILLISECOND
: -1;
if (
getParsingFlags(m)._overflowDayOfYear &&
(overflow < YEAR || overflow > DATE)
) {
overflow = DATE;
}
if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
overflow = WEEK;
}
if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
overflow = WEEKDAY;
}
getParsingFlags(m).overflow = overflow;
}
return m;
}
// iso 8601 regex
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
var extendedIsoRegex =
/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
basicIsoRegex =
/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
isoDates = [
['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
['GGGG-[W]WW', /\d{4}-W\d\d/, false],
['YYYY-DDD', /\d{4}-\d{3}/],
['YYYY-MM', /\d{4}-\d\d/, false],
['YYYYYYMMDD', /[+-]\d{10}/],
['YYYYMMDD', /\d{8}/],
['GGGG[W]WWE', /\d{4}W\d{3}/],
['GGGG[W]WW', /\d{4}W\d{2}/, false],
['YYYYDDD', /\d{7}/],
['YYYYMM', /\d{6}/, false],
['YYYY', /\d{4}/, false],
],
// iso time formats and regexes
isoTimes = [
['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
['HH:mm:ss', /\d\d:\d\d:\d\d/],
['HH:mm', /\d\d:\d\d/],
['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
['HHmmss', /\d\d\d\d\d\d/],
['HHmm', /\d\d\d\d/],
['HH', /\d\d/],
],
aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
rfc2822 =
/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
obsOffsets = {
UT: 0,
GMT: 0,
EDT: -4 * 60,
EST: -5 * 60,
CDT: -5 * 60,
CST: -6 * 60,
MDT: -6 * 60,
MST: -7 * 60,
PDT: -7 * 60,
PST: -8 * 60,
};
// date from iso format
function configFromISO(config) {
var i,
l,
string = config._i,
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
allowTime,
dateFormat,
timeFormat,
tzFormat,
isoDatesLen = isoDates.length,
isoTimesLen = isoTimes.length;
if (match) {
getParsingFlags(config).iso = true;
for (i = 0, l = isoDatesLen; i < l; i++) {
if (isoDates[i][1].exec(match[1])) {
dateFormat = isoDates[i][0];
allowTime = isoDates[i][2] !== false;
break;
}
}
if (dateFormat == null) {
config._isValid = false;
return;
}
if (match[3]) {
for (i = 0, l = isoTimesLen; i < l; i++) {
if (isoTimes[i][1].exec(match[3])) {
// match[2] should be 'T' or space
timeFormat = (match[2] || ' ') + isoTimes[i][0];
break;
}
}
if (timeFormat == null) {
config._isValid = false;
return;
}
}
if (!allowTime && timeFormat != null) {
config._isValid = false;
return;
}
if (match[4]) {
if (tzRegex.exec(match[4])) {
tzFormat = 'Z';
} else {
config._isValid = false;
return;
}
}
config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
configFromStringAndFormat(config);
} else {
config._isValid = false;
}
}
function extractFromRFC2822Strings(
yearStr,
monthStr,
dayStr,
hourStr,
minuteStr,
secondStr
) {
var result = [
untruncateYear(yearStr),
defaultLocaleMonthsShort.indexOf(monthStr),
parseInt(dayStr, 10),
parseInt(hourStr, 10),
parseInt(minuteStr, 10),
];
if (secondStr) {
result.push(parseInt(secondStr, 10));
}
return result;
}
function untruncateYear(yearStr) {
var year = parseInt(yearStr, 10);
if (year <= 49) {
return 2000 + year;
} else if (year <= 999) {
return 1900 + year;
}
return year;
}
function preprocessRFC2822(s) {
// Remove comments and folding whitespace and replace multiple-spaces with a single space
return s
.replace(/\([^()]*\)|[\n\t]/g, ' ')
.replace(/(\s\s+)/g, ' ')
.replace(/^\s\s*/, '')
.replace(/\s\s*$/, '');
}
function checkWeekday(weekdayStr, parsedInput, config) {
if (weekdayStr) {
// TODO: Replace the vanilla JS Date object with an independent day-of-week check.
var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
weekdayActual = new Date(
parsedInput[0],
parsedInput[1],
parsedInput[2]
).getDay();
if (weekdayProvided !== weekdayActual) {
getParsingFlags(config).weekdayMismatch = true;
config._isValid = false;
return false;
}
}
return true;
}
function calculateOffset(obsOffset, militaryOffset, numOffset) {
if (obsOffset) {
return obsOffsets[obsOffset];
} else if (militaryOffset) {
// the only allowed military tz is Z
return 0;
} else {
var hm = parseInt(numOffset, 10),
m = hm % 100,
h = (hm - m) / 100;
return h * 60 + m;
}
}
// date and time from ref 2822 format
function configFromRFC2822(config) {
var match = rfc2822.exec(preprocessRFC2822(config._i)),
parsedArray;
if (match) {
parsedArray = extractFromRFC2822Strings(
match[4],
match[3],
match[2],
match[5],
match[6],
match[7]
);
if (!checkWeekday(match[1], parsedArray, config)) {
return;
}
config._a = parsedArray;
config._tzm = calculateOffset(match[8], match[9], match[10]);
config._d = createUTCDate.apply(null, config._a);
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
getParsingFlags(config).rfc2822 = true;
} else {
config._isValid = false;
}
}
// date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
function configFromString(config) {
var matched = aspNetJsonRegex.exec(config._i);
if (matched !== null) {
config._d = new Date(+matched[1]);
return;
}
configFromISO(config);
if (config._isValid === false) {
delete config._isValid;
} else {
return;
}
configFromRFC2822(config);
if (config._isValid === false) {
delete config._isValid;
} else {
return;
}
if (config._strict) {
config._isValid = false;
} else {
// Final attempt, use Input Fallback
hooks.createFromInputFallback(config);
}
}
hooks.createFromInputFallback = deprecate(
'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',
function (config) {
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
}
);
// Pick the first defined of two or three arguments.
function defaults(a, b, c) {
if (a != null) {
return a;
}
if (b != null) {
return b;
}
return c;
}
function currentDateArray(config) {
// hooks is actually the exported moment object
var nowValue = new Date(hooks.now());
if (config._useUTC) {
return [
nowValue.getUTCFullYear(),
nowValue.getUTCMonth(),
nowValue.getUTCDate(),
];
}
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
}
// convert an array to a date.
// the array should mirror the parameters below
// note: all values past the year are optional and will default to the lowest possible value.
// [year, month, day , hour, minute, second, millisecond]
function configFromArray(config) {
var i,
date,
input = [],
currentDate,
expectedWeekday,
yearToUse;
if (config._d) {
return;
}
currentDate = currentDateArray(config);
//compute day of the year from weeks and weekdays
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
dayOfYearFromWeekInfo(config);
}
//if the day of the year is set, figure out what it is
if (config._dayOfYear != null) {
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
if (
config._dayOfYear > daysInYear(yearToUse) ||
config._dayOfYear === 0
) {
getParsingFlags(config)._overflowDayOfYear = true;
}
date = createUTCDate(yearToUse, 0, config._dayOfYear);
config._a[MONTH] = date.getUTCMonth();
config._a[DATE] = date.getUTCDate();
}
// Default to current date.
// * if no year, month, day of month are given, default to today
// * if day of month is given, default month and year
// * if month is given, default only year
// * if year is given, don't default anything
for (i = 0; i < 3 && config._a[i] == null; ++i) {
config._a[i] = input[i] = currentDate[i];
}
// Zero out whatever was not defaulted, including time
for (; i < 7; i++) {
config._a[i] = input[i] =
config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
}
// Check for 24:00:00.000
if (
config._a[HOUR] === 24 &&
config._a[MINUTE] === 0 &&
config._a[SECOND] === 0 &&
config._a[MILLISECOND] === 0
) {
config._nextDay = true;
config._a[HOUR] = 0;
}
config._d = (config._useUTC ? createUTCDate : createDate).apply(
null,
input
);
expectedWeekday = config._useUTC
? config._d.getUTCDay()
: config._d.getDay();
// Apply timezone offset from input. The actual utcOffset can be changed
// with parseZone.
if (config._tzm != null) {
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
}
if (config._nextDay) {
config._a[HOUR] = 24;
}
// check for mismatching day of week
if (
config._w &&
typeof config._w.d !== 'undefined' &&
config._w.d !== expectedWeekday
) {
getParsingFlags(config).weekdayMismatch = true;
}
}
function dayOfYearFromWeekInfo(config) {
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
w = config._w;
if (w.GG != null || w.W != null || w.E != null) {
dow = 1;
doy = 4;
// TODO: We need to take the current isoWeekYear, but that depends on
// how we interpret now (local, utc, fixed offset). So create
// a now version of current config (take local/utc/offset flags, and
// create now).
weekYear = defaults(
w.GG,
config._a[YEAR],
weekOfYear(createLocal(), 1, 4).year
);
week = defaults(w.W, 1);
weekday = defaults(w.E, 1);
if (weekday < 1 || weekday > 7) {
weekdayOverflow = true;
}
} else {
dow = config._locale._week.dow;
doy = config._locale._week.doy;
curWeek = weekOfYear(createLocal(), dow, doy);
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
// Default to current week.
week = defaults(w.w, curWeek.week);
if (w.d != null) {
// weekday -- low day numbers are considered next week
weekday = w.d;
if (weekday < 0 || weekday > 6) {
weekdayOverflow = true;
}
} else if (w.e != null) {
// local weekday -- counting starts from beginning of week
weekday = w.e + dow;
if (w.e < 0 || w.e > 6) {
weekdayOverflow = true;
}
} else {
// default to beginning of week
weekday = dow;
}
}
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
getParsingFlags(config)._overflowWeeks = true;
} else if (weekdayOverflow != null) {
getParsingFlags(config)._overflowWeekday = true;
} else {
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
config._a[YEAR] = temp.year;
config._dayOfYear = temp.dayOfYear;
}
}
// constant that refers to the ISO standard
hooks.ISO_8601 = function () {};
// constant that refers to the RFC 2822 form
hooks.RFC_2822 = function () {};
// date from string and format string
function configFromStringAndFormat(config) {
// TODO: Move this to another part of the creation flow to prevent circular deps
if (config._f === hooks.ISO_8601) {
configFromISO(config);
return;
}
if (config._f === hooks.RFC_2822) {
configFromRFC2822(config);
return;
}
config._a = [];
getParsingFlags(config).empty = true;
// This array is used to make a Date, either with `new Date` or `Date.UTC`
var string = '' + config._i,
i,
parsedInput,
tokens,
token,
skipped,
stringLength = string.length,
totalParsedInputLength = 0,
era,
tokenLen;
tokens =
expandFormat(config._f, config._locale).match(formattingTokens) || [];
tokenLen = tokens.length;
for (i = 0; i < tokenLen; i++) {
token = tokens[i];
parsedInput = (string.match(getParseRegexForToken(token, config)) ||
[])[0];
if (parsedInput) {
skipped = string.substr(0, string.indexOf(parsedInput));
if (skipped.length > 0) {
getParsingFlags(config).unusedInput.push(skipped);
}
string = string.slice(
string.indexOf(parsedInput) + parsedInput.length
);
totalParsedInputLength += parsedInput.length;
}
// don't parse if it's not a known token
if (formatTokenFunctions[token]) {
if (parsedInput) {
getParsingFlags(config).empty = false;
} else {
getParsingFlags(config).unusedTokens.push(token);
}
addTimeToArrayFromToken(token, parsedInput, config);
} else if (config._strict && !parsedInput) {
getParsingFlags(config).unusedTokens.push(token);
}
}
// add remaining unparsed input length to the string
getParsingFlags(config).charsLeftOver =
stringLength - totalParsedInputLength;
if (string.length > 0) {
getParsingFlags(config).unusedInput.push(string);
}
// clear _12h flag if hour is <= 12
if (
config._a[HOUR] <= 12 &&
getParsingFlags(config).bigHour === true &&
config._a[HOUR] > 0
) {
getParsingFlags(config).bigHour = undefined;
}
getParsingFlags(config).parsedDateParts = config._a.slice(0);
getParsingFlags(config).meridiem = config._meridiem;
// handle meridiem
config._a[HOUR] = meridiemFixWrap(
config._locale,
config._a[HOUR],
config._meridiem
);
// handle era
era = getParsingFlags(config).era;
if (era !== null) {
config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
}
configFromArray(config);
checkOverflow(config);
}
function meridiemFixWrap(locale, hour, meridiem) {
var isPm;
if (meridiem == null) {
// nothing to do
return hour;
}
if (locale.meridiemHour != null) {
return locale.meridiemHour(hour, meridiem);
} else if (locale.isPM != null) {
// Fallback
isPm = locale.isPM(meridiem);
if (isPm && hour < 12) {
hour += 12;
}
if (!isPm && hour === 12) {
hour = 0;
}
return hour;
} else {
// this is not supposed to happen
return hour;
}
}
// date from string and array of format strings
function configFromStringAndArray(config) {
var tempConfig,
bestMoment,
scoreToBeat,
i,
currentScore,
validFormatFound,
bestFormatIsValid = false,
configfLen = config._f.length;
if (configfLen === 0) {
getParsingFlags(config).invalidFormat = true;
config._d = new Date(NaN);
return;
}
for (i = 0; i < configfLen; i++) {
currentScore = 0;
validFormatFound = false;
tempConfig = copyConfig({}, config);
if (config._useUTC != null) {
tempConfig._useUTC = config._useUTC;
}
tempConfig._f = config._f[i];
configFromStringAndFormat(tempConfig);
if (isValid(tempConfig)) {
validFormatFound = true;
}
// if there is any input that was not parsed add a penalty for that format
currentScore += getParsingFlags(tempConfig).charsLeftOver;
//or tokens
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
getParsingFlags(tempConfig).score = currentScore;
if (!bestFormatIsValid) {
if (
scoreToBeat == null ||
currentScore < scoreToBeat ||
validFormatFound
) {
scoreToBeat = currentScore;
bestMoment = tempConfig;
if (validFormatFound) {
bestFormatIsValid = true;
}
}
} else {
if (currentScore < scoreToBeat) {
scoreToBeat = currentScore;
bestMoment = tempConfig;
}
}
}
extend(config, bestMoment || tempConfig);
}
function configFromObject(config) {
if (config._d) {
return;
}
var i = normalizeObjectUnits(config._i),
dayOrDate = i.day === undefined ? i.date : i.day;
config._a = map(
[i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
function (obj) {
return obj && parseInt(obj, 10);
}
);
configFromArray(config);
}
function createFromConfig(config) {
var res = new Moment(checkOverflow(prepareConfig(config)));
if (res._nextDay) {
// Adding is smart enough around DST
res.add(1, 'd');
res._nextDay = undefined;
}
return res;
}
function prepareConfig(config) {
var input = config._i,
format = config._f;
config._locale = config._locale || getLocale(config._l);
if (input === null || (format === undefined && input === '')) {
return createInvalid({ nullInput: true });
}
if (typeof input === 'string') {
config._i = input = config._locale.preparse(input);
}
if (isMoment(input)) {
return new Moment(checkOverflow(input));
} else if (isDate(input)) {
config._d = input;
} else if (isArray(format)) {
configFromStringAndArray(config);
} else if (format) {
configFromStringAndFormat(config);
} else {
configFromInput(config);
}
if (!isValid(config)) {
config._d = null;
}
return config;
}
function configFromInput(config) {
var input = config._i;
if (isUndefined(input)) {
config._d = new Date(hooks.now());
} else if (isDate(input)) {
config._d = new Date(input.valueOf());
} else if (typeof input === 'string') {
configFromString(config);
} else if (isArray(input)) {
config._a = map(input.slice(0), function (obj) {
return parseInt(obj, 10);
});
configFromArray(config);
} else if (isObject(input)) {
configFromObject(config);
} else if (isNumber(input)) {
// from milliseconds
config._d = new Date(input);
} else {
hooks.createFromInputFallback(config);
}
}
function createLocalOrUTC(input, format, locale, strict, isUTC) {
var c = {};
if (format === true || format === false) {
strict = format;
format = undefined;
}
if (locale === true || locale === false) {
strict = locale;
locale = undefined;
}
if (
(isObject(input) && isObjectEmpty(input)) ||
(isArray(input) && input.length === 0)
) {
input = undefined;
}
// object construction must be done this way.
// https://github.com/moment/moment/issues/1423
c._isAMomentObject = true;
c._useUTC = c._isUTC = isUTC;
c._l = locale;
c._i = input;
c._f = format;
c._strict = strict;
return createFromConfig(c);
}
function createLocal(input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, false);
}
var prototypeMin = deprecate(
'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
function () {
var other = createLocal.apply(null, arguments);
if (this.isValid() && other.isValid()) {
return other < this ? this : other;
} else {
return createInvalid();
}
}
),
prototypeMax = deprecate(
'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
function () {
var other = createLocal.apply(null, arguments);
if (this.isValid() && other.isValid()) {
return other > this ? this : other;
} else {
return createInvalid();
}
}
);
// Pick a moment m from moments so that m[fn](other) is true for all
// other. This relies on the function fn to be transitive.
//
// moments should either be an array of moment objects or an array, whose
// first element is an array of moment objects.
function pickBy(fn, moments) {
var res, i;
if (moments.length === 1 && isArray(moments[0])) {
moments = moments[0];
}
if (!moments.length) {
return createLocal();
}
res = moments[0];
for (i = 1; i < moments.length; ++i) {
if (!moments[i].isValid() || moments[i][fn](res)) {
res = moments[i];
}
}
return res;
}
// TODO: Use [].sort instead?
function min() {
var args = [].slice.call(arguments, 0);
return pickBy('isBefore', args);
}
function max() {
var args = [].slice.call(arguments, 0);
return pickBy('isAfter', args);
}
var now = function () {
return Date.now ? Date.now() : +new Date();
};
var ordering = [
'year',
'quarter',
'month',
'week',
'day',
'hour',
'minute',
'second',
'millisecond',
];
function isDurationValid(m) {
var key,
unitHasDecimal = false,
i,
orderLen = ordering.length;
for (key in m) {
if (
hasOwnProp(m, key) &&
!(
indexOf.call(ordering, key) !== -1 &&
(m[key] == null || !isNaN(m[key]))
)
) {
return false;
}
}
for (i = 0; i < orderLen; ++i) {
if (m[ordering[i]]) {
if (unitHasDecimal) {
return false; // only allow non-integers for smallest unit
}
if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
unitHasDecimal = true;
}
}
}
return true;
}
function isValid$1() {
return this._isValid;
}
function createInvalid$1() {
return createDuration(NaN);
}
function Duration(duration) {
var normalizedInput = normalizeObjectUnits(duration),
years = normalizedInput.year || 0,
quarters = normalizedInput.quarter || 0,
months = normalizedInput.month || 0,
weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
days = normalizedInput.day || 0,
hours = normalizedInput.hour || 0,
minutes = normalizedInput.minute || 0,
seconds = normalizedInput.second || 0,
milliseconds = normalizedInput.millisecond || 0;
this._isValid = isDurationValid(normalizedInput);
// representation for dateAddRemove
this._milliseconds =
+milliseconds +
seconds * 1e3 + // 1000
minutes * 6e4 + // 1000 * 60
hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
// Because of dateAddRemove treats 24 hours as different from a
// day when working around DST, we need to store them separately
this._days = +days + weeks * 7;
// It is impossible to translate months into days without knowing
// which months you are are talking about, so we have to store
// it separately.
this._months = +months + quarters * 3 + years * 12;
this._data = {};
this._locale = getLocale();
this._bubble();
}
function isDuration(obj) {
return obj instanceof Duration;
}
function absRound(number) {
if (number < 0) {
return Math.round(-1 * number) * -1;
} else {
return Math.round(number);
}
}
// compare two arrays, return the number of differences
function compareArrays(array1, array2, dontConvert) {
var len = Math.min(array1.length, array2.length),
lengthDiff = Math.abs(array1.length - array2.length),
diffs = 0,
i;
for (i = 0; i < len; i++) {
if (
(dontConvert && array1[i] !== array2[i]) ||
(!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
) {
diffs++;
}
}
return diffs + lengthDiff;
}
// FORMATTING
function offset(token, separator) {
addFormatToken(token, 0, 0, function () {
var offset = this.utcOffset(),
sign = '+';
if (offset < 0) {
offset = -offset;
sign = '-';
}
return (
sign +
zeroFill(~~(offset / 60), 2) +
separator +
zeroFill(~~offset % 60, 2)
);
});
}
offset('Z', ':');
offset('ZZ', '');
// PARSING
addRegexToken('Z', matchShortOffset);
addRegexToken('ZZ', matchShortOffset);
addParseToken(['Z', 'ZZ'], function (input, array, config) {
config._useUTC = true;
config._tzm = offsetFromString(matchShortOffset, input);
});
// HELPERS
// timezone chunker
// '+10:00' > ['10', '00']
// '-1530' > ['-15', '30']
var chunkOffset = /([\+\-]|\d\d)/gi;
function offsetFromString(matcher, string) {
var matches = (string || '').match(matcher),
chunk,
parts,
minutes;
if (matches === null) {
return null;
}
chunk = matches[matches.length - 1] || [];
parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
minutes = +(parts[1] * 60) + toInt(parts[2]);
return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
}
// Return a moment from input, that is local/utc/zone equivalent to model.
function cloneWithOffset(input, model) {
var res, diff;
if (model._isUTC) {
res = model.clone();
diff =
(isMoment(input) || isDate(input)
? input.valueOf()
: createLocal(input).valueOf()) - res.valueOf();
// Use low-level api, because this fn is low-level api.
res._d.setTime(res._d.valueOf() + diff);
hooks.updateOffset(res, false);
return res;
} else {
return createLocal(input).local();
}
}
function getDateOffset(m) {
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
// https://github.com/moment/moment/pull/1871
return -Math.round(m._d.getTimezoneOffset());
}
// HOOKS
// This function will be called whenever a moment is mutated.
// It is intended to keep the offset in sync with the timezone.
hooks.updateOffset = function () {};
// MOMENTS
// keepLocalTime = true means only change the timezone, without
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
// +0200, so we adjust the time as needed, to be valid.
//
// Keeping the time actually adds/subtracts (one hour)
// from the actual represented time. That is why we call updateOffset
// a second time. In case it wants us to change the offset again
// _changeInProgress == true case, then we have to adjust, because
// there is no such time in the given timezone.
function getSetOffset(input, keepLocalTime, keepMinutes) {
var offset = this._offset || 0,
localAdjust;
if (!this.isValid()) {
return input != null ? this : NaN;
}
if (input != null) {
if (typeof input === 'string') {
input = offsetFromString(matchShortOffset, input);
if (input === null) {
return this;
}
} else if (Math.abs(input) < 16 && !keepMinutes) {
input = input * 60;
}
if (!this._isUTC && keepLocalTime) {
localAdjust = getDateOffset(this);
}
this._offset = input;
this._isUTC = true;
if (localAdjust != null) {
this.add(localAdjust, 'm');
}
if (offset !== input) {
if (!keepLocalTime || this._changeInProgress) {
addSubtract(
this,
createDuration(input - offset, 'm'),
1,
false
);
} else if (!this._changeInProgress) {
this._changeInProgress = true;
hooks.updateOffset(this, true);
this._changeInProgress = null;
}
}
return this;
} else {
return this._isUTC ? offset : getDateOffset(this);
}
}
function getSetZone(input, keepLocalTime) {
if (input != null) {
if (typeof input !== 'string') {
input = -input;
}
this.utcOffset(input, keepLocalTime);
return this;
} else {
return -this.utcOffset();
}
}
function setOffsetToUTC(keepLocalTime) {
return this.utcOffset(0, keepLocalTime);
}
function setOffsetToLocal(keepLocalTime) {
if (this._isUTC) {
this.utcOffset(0, keepLocalTime);
this._isUTC = false;
if (keepLocalTime) {
this.subtract(getDateOffset(this), 'm');
}
}
return this;
}
function setOffsetToParsedOffset() {
if (this._tzm != null) {
this.utcOffset(this._tzm, false, true);
} else if (typeof this._i === 'string') {
var tZone = offsetFromString(matchOffset, this._i);
if (tZone != null) {
this.utcOffset(tZone);
} else {
this.utcOffset(0, true);
}
}
return this;
}
function hasAlignedHourOffset(input) {
if (!this.isValid()) {
return false;
}
input = input ? createLocal(input).utcOffset() : 0;
return (this.utcOffset() - input) % 60 === 0;
}
function isDaylightSavingTime() {
return (
this.utcOffset() > this.clone().month(0).utcOffset() ||
this.utcOffset() > this.clone().month(5).utcOffset()
);
}
function isDaylightSavingTimeShifted() {
if (!isUndefined(this._isDSTShifted)) {
return this._isDSTShifted;
}
var c = {},
other;
copyConfig(c, this);
c = prepareConfig(c);
if (c._a) {
other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
this._isDSTShifted =
this.isValid() && compareArrays(c._a, other.toArray()) > 0;
} else {
this._isDSTShifted = false;
}
return this._isDSTShifted;
}
function isLocal() {
return this.isValid() ? !this._isUTC : false;
}
function isUtcOffset() {
return this.isValid() ? this._isUTC : false;
}
function isUtc() {
return this.isValid() ? this._isUTC && this._offset === 0 : false;
}
// ASP.NET json date format regex
var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
// and further modified to allow for strings containing both week and day
isoRegex =
/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
function createDuration(input, key) {
var duration = input,
// matching against regexp is expensive, do it on demand
match = null,
sign,
ret,
diffRes;
if (isDuration(input)) {
duration = {
ms: input._milliseconds,
d: input._days,
M: input._months,
};
} else if (isNumber(input) || !isNaN(+input)) {
duration = {};
if (key) {
duration[key] = +input;
} else {
duration.milliseconds = +input;
}
} else if ((match = aspNetRegex.exec(input))) {
sign = match[1] === '-' ? -1 : 1;
duration = {
y: 0,
d: toInt(match[DATE]) * sign,
h: toInt(match[HOUR]) * sign,
m: toInt(match[MINUTE]) * sign,
s: toInt(match[SECOND]) * sign,
ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
};
} else if ((match = isoRegex.exec(input))) {
sign = match[1] === '-' ? -1 : 1;
duration = {
y: parseIso(match[2], sign),
M: parseIso(match[3], sign),
w: parseIso(match[4], sign),
d: parseIso(match[5], sign),
h: parseIso(match[6], sign),
m: parseIso(match[7], sign),
s: parseIso(match[8], sign),
};
} else if (duration == null) {
// checks for null or undefined
duration = {};
} else if (
typeof duration === 'object' &&
('from' in duration || 'to' in duration)
) {
diffRes = momentsDifference(
createLocal(duration.from),
createLocal(duration.to)
);
duration = {};
duration.ms = diffRes.milliseconds;
duration.M = diffRes.months;
}
ret = new Duration(duration);
if (isDuration(input) && hasOwnProp(input, '_locale')) {
ret._locale = input._locale;
}
if (isDuration(input) && hasOwnProp(input, '_isValid')) {
ret._isValid = input._isValid;
}
return ret;
}
createDuration.fn = Duration.prototype;
createDuration.invalid = createInvalid$1;
function parseIso(inp, sign) {
// We'd normally use ~~inp for this, but unfortunately it also
// converts floats to ints.
// inp may be undefined, so careful calling replace on it.
var res = inp && parseFloat(inp.replace(',', '.'));
// apply sign while we're at it
return (isNaN(res) ? 0 : res) * sign;
}
function positiveMomentsDifference(base, other) {
var res = {};
res.months =
other.month() - base.month() + (other.year() - base.year()) * 12;
if (base.clone().add(res.months, 'M').isAfter(other)) {
--res.months;
}
res.milliseconds = +other - +base.clone().add(res.months, 'M');
return res;
}
function momentsDifference(base, other) {
var res;
if (!(base.isValid() && other.isValid())) {
return { milliseconds: 0, months: 0 };
}
other = cloneWithOffset(other, base);
if (base.isBefore(other)) {
res = positiveMomentsDifference(base, other);
} else {
res = positiveMomentsDifference(other, base);
res.milliseconds = -res.milliseconds;
res.months = -res.months;
}
return res;
}
// TODO: remove 'name' arg after deprecation is removed
function createAdder(direction, name) {
return function (val, period) {
var dur, tmp;
//invert the arguments, but complain about it
if (period !== null && !isNaN(+period)) {
deprecateSimple(
name,
'moment().' +
name +
'(period, number) is deprecated. Please use moment().' +
name +
'(number, period). ' +
'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
);
tmp = val;
val = period;
period = tmp;
}
dur = createDuration(val, period);
addSubtract(this, dur, direction);
return this;
};
}
function addSubtract(mom, duration, isAdding, updateOffset) {
var milliseconds = duration._milliseconds,
days = absRound(duration._days),
months = absRound(duration._months);
if (!mom.isValid()) {
// No op
return;
}
updateOffset = updateOffset == null ? true : updateOffset;
if (months) {
setMonth(mom, get(mom, 'Month') + months * isAdding);
}
if (days) {
set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
}
if (milliseconds) {
mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
}
if (updateOffset) {
hooks.updateOffset(mom, days || months);
}
}
var add = createAdder(1, 'add'),
subtract = createAdder(-1, 'subtract');
function isString(input) {
return typeof input === 'string' || input instanceof String;
}
// type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
function isMomentInput(input) {
return (
isMoment(input) ||
isDate(input) ||
isString(input) ||
isNumber(input) ||
isNumberOrStringArray(input) ||
isMomentInputObject(input) ||
input === null ||
input === undefined
);
}
function isMomentInputObject(input) {
var objectTest = isObject(input) && !isObjectEmpty(input),
propertyTest = false,
properties = [
'years',
'year',
'y',
'months',
'month',
'M',
'days',
'day',
'd',
'dates',
'date',
'D',
'hours',
'hour',
'h',
'minutes',
'minute',
'm',
'seconds',
'second',
's',
'milliseconds',
'millisecond',
'ms',
],
i,
property,
propertyLen = properties.length;
for (i = 0; i < propertyLen; i += 1) {
property = properties[i];
propertyTest = propertyTest || hasOwnProp(input, property);
}
return objectTest && propertyTest;
}
function isNumberOrStringArray(input) {
var arrayTest = isArray(input),
dataTypeTest = false;
if (arrayTest) {
dataTypeTest =
input.filter(function (item) {
return !isNumber(item) && isString(input);
}).length === 0;
}
return arrayTest && dataTypeTest;
}
function isCalendarSpec(input) {
var objectTest = isObject(input) && !isObjectEmpty(input),
propertyTest = false,
properties = [
'sameDay',
'nextDay',
'lastDay',
'nextWeek',
'lastWeek',
'sameElse',
],
i,
property;
for (i = 0; i < properties.length; i += 1) {
property = properties[i];
propertyTest = propertyTest || hasOwnProp(input, property);
}
return objectTest && propertyTest;
}
function getCalendarFormat(myMoment, now) {
var diff = myMoment.diff(now, 'days', true);
return diff < -6
? 'sameElse'
: diff < -1
? 'lastWeek'
: diff < 0
? 'lastDay'
: diff < 1
? 'sameDay'
: diff < 2
? 'nextDay'
: diff < 7
? 'nextWeek'
: 'sameElse';
}
function calendar$1(time, formats) {
// Support for single parameter, formats only overload to the calendar function
if (arguments.length === 1) {
if (!arguments[0]) {
time = undefined;
formats = undefined;
} else if (isMomentInput(arguments[0])) {
time = arguments[0];
formats = undefined;
} else if (isCalendarSpec(arguments[0])) {
formats = arguments[0];
time = undefined;
}
}
// We want to compare the start of today, vs this.
// Getting start-of-today depends on whether we're local/utc/offset or not.
var now = time || createLocal(),
sod = cloneWithOffset(now, this).startOf('day'),
format = hooks.calendarFormat(this, sod) || 'sameElse',
output =
formats &&
(isFunction(formats[format])
? formats[format].call(this, now)
: formats[format]);
return this.format(
output || this.localeData().calendar(format, this, createLocal(now))
);
}
function clone() {
return new Moment(this);
}
function isAfter(input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units) || 'millisecond';
if (units === 'millisecond') {
return this.valueOf() > localInput.valueOf();
} else {
return localInput.valueOf() < this.clone().startOf(units).valueOf();
}
}
function isBefore(input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units) || 'millisecond';
if (units === 'millisecond') {
return this.valueOf() < localInput.valueOf();
} else {
return this.clone().endOf(units).valueOf() < localInput.valueOf();
}
}
function isBetween(from, to, units, inclusivity) {
var localFrom = isMoment(from) ? from : createLocal(from),
localTo = isMoment(to) ? to : createLocal(to);
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
return false;
}
inclusivity = inclusivity || '()';
return (
(inclusivity[0] === '('
? this.isAfter(localFrom, units)
: !this.isBefore(localFrom, units)) &&
(inclusivity[1] === ')'
? this.isBefore(localTo, units)
: !this.isAfter(localTo, units))
);
}
function isSame(input, units) {
var localInput = isMoment(input) ? input : createLocal(input),
inputMs;
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units) || 'millisecond';
if (units === 'millisecond') {
return this.valueOf() === localInput.valueOf();
} else {
inputMs = localInput.valueOf();
return (
this.clone().startOf(units).valueOf() <= inputMs &&
inputMs <= this.clone().endOf(units).valueOf()
);
}
}
function isSameOrAfter(input, units) {
return this.isSame(input, units) || this.isAfter(input, units);
}
function isSameOrBefore(input, units) {
return this.isSame(input, units) || this.isBefore(input, units);
}
function diff(input, units, asFloat) {
var that, zoneDelta, output;
if (!this.isValid()) {
return NaN;
}
that = cloneWithOffset(input, this);
if (!that.isValid()) {
return NaN;
}
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
units = normalizeUnits(units);
switch (units) {
case 'year':
output = monthDiff(this, that) / 12;
break;
case 'month':
output = monthDiff(this, that);
break;
case 'quarter':
output = monthDiff(this, that) / 3;
break;
case 'second':
output = (this - that) / 1e3;
break; // 1000
case 'minute':
output = (this - that) / 6e4;
break; // 1000 * 60
case 'hour':
output = (this - that) / 36e5;
break; // 1000 * 60 * 60
case 'day':
output = (this - that - zoneDelta) / 864e5;
break; // 1000 * 60 * 60 * 24, negate dst
case 'week':
output = (this - that - zoneDelta) / 6048e5;
break; // 1000 * 60 * 60 * 24 * 7, negate dst
default:
output = this - that;
}
return asFloat ? output : absFloor(output);
}
function monthDiff(a, b) {
if (a.date() < b.date()) {
// end-of-month calculations work correct when the start month has more
// days than the end month.
return -monthDiff(b, a);
}
// difference in months
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
// b is in (anchor - 1 month, anchor + 1 month)
anchor = a.clone().add(wholeMonthDiff, 'months'),
anchor2,
adjust;
if (b - anchor < 0) {
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor - anchor2);
} else {
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor2 - anchor);
}
//check for negative zero, return zero if negative zero
return -(wholeMonthDiff + adjust) || 0;
}
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
function toString() {
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
}
function toISOString(keepOffset) {
if (!this.isValid()) {
return null;
}
var utc = keepOffset !== true,
m = utc ? this.clone().utc() : this;
if (m.year() < 0 || m.year() > 9999) {
return formatMoment(
m,
utc
? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
: 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
);
}
if (isFunction(Date.prototype.toISOString)) {
// native implementation is ~50x faster, use it when we can
if (utc) {
return this.toDate().toISOString();
} else {
return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
.toISOString()
.replace('Z', formatMoment(m, 'Z'));
}
}
return formatMoment(
m,
utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
);
}
/**
* Return a human readable representation of a moment that can
* also be evaluated to get a new moment which is the same
*
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
*/
function inspect() {
if (!this.isValid()) {
return 'moment.invalid(/* ' + this._i + ' */)';
}
var func = 'moment',
zone = '',
prefix,
year,
datetime,
suffix;
if (!this.isLocal()) {
func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
zone = 'Z';
}
prefix = '[' + func + '("]';
year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
datetime = '-MM-DD[T]HH:mm:ss.SSS';
suffix = zone + '[")]';
return this.format(prefix + year + datetime + suffix);
}
function format(inputString) {
if (!inputString) {
inputString = this.isUtc()
? hooks.defaultFormatUtc
: hooks.defaultFormat;
}
var output = formatMoment(this, inputString);
return this.localeData().postformat(output);
}
function from(time, withoutSuffix) {
if (
this.isValid() &&
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
) {
return createDuration({ to: this, from: time })
.locale(this.locale())
.humanize(!withoutSuffix);
} else {
return this.localeData().invalidDate();
}
}
function fromNow(withoutSuffix) {
return this.from(createLocal(), withoutSuffix);
}
function to(time, withoutSuffix) {
if (
this.isValid() &&
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
) {
return createDuration({ from: this, to: time })
.locale(this.locale())
.humanize(!withoutSuffix);
} else {
return this.localeData().invalidDate();
}
}
function toNow(withoutSuffix) {
return this.to(createLocal(), withoutSuffix);
}
// If passed a locale key, it will set the locale for this
// instance. Otherwise, it will return the locale configuration
// variables for this instance.
function locale(key) {
var newLocaleData;
if (key === undefined) {
return this._locale._abbr;
} else {
newLocaleData = getLocale(key);
if (newLocaleData != null) {
this._locale = newLocaleData;
}
return this;
}
}
var lang = deprecate(
'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
function (key) {
if (key === undefined) {
return this.localeData();
} else {
return this.locale(key);
}
}
);
function localeData() {
return this._locale;
}
var MS_PER_SECOND = 1000,
MS_PER_MINUTE = 60 * MS_PER_SECOND,
MS_PER_HOUR = 60 * MS_PER_MINUTE,
MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
// actual modulo - handles negative numbers (for dates before 1970):
function mod$1(dividend, divisor) {
return ((dividend % divisor) + divisor) % divisor;
}
function localStartOfDate(y, m, d) {
// the date constructor remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0) {
// preserve leap years using a full 400 year cycle, then reset
return new Date(y + 400, m, d) - MS_PER_400_YEARS;
} else {
return new Date(y, m, d).valueOf();
}
}
function utcStartOfDate(y, m, d) {
// Date.UTC remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0) {
// preserve leap years using a full 400 year cycle, then reset
return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
} else {
return Date.UTC(y, m, d);
}
}
function startOf(units) {
var time, startOfDate;
units = normalizeUnits(units);
if (units === undefined || units === 'millisecond' || !this.isValid()) {
return this;
}
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
switch (units) {
case 'year':
time = startOfDate(this.year(), 0, 1);
break;
case 'quarter':
time = startOfDate(
this.year(),
this.month() - (this.month() % 3),
1
);
break;
case 'month':
time = startOfDate(this.year(), this.month(), 1);
break;
case 'week':
time = startOfDate(
this.year(),
this.month(),
this.date() - this.weekday()
);
break;
case 'isoWeek':
time = startOfDate(
this.year(),
this.month(),
this.date() - (this.isoWeekday() - 1)
);
break;
case 'day':
case 'date':
time = startOfDate(this.year(), this.month(), this.date());
break;
case 'hour':
time = this._d.valueOf();
time -= mod$1(
time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
MS_PER_HOUR
);
break;
case 'minute':
time = this._d.valueOf();
time -= mod$1(time, MS_PER_MINUTE);
break;
case 'second':
time = this._d.valueOf();
time -= mod$1(time, MS_PER_SECOND);
break;
}
this._d.setTime(time);
hooks.updateOffset(this, true);
return this;
}
function endOf(units) {
var time, startOfDate;
units = normalizeUnits(units);
if (units === undefined || units === 'millisecond' || !this.isValid()) {
return this;
}
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
switch (units) {
case 'year':
time = startOfDate(this.year() + 1, 0, 1) - 1;
break;
case 'quarter':
time =
startOfDate(
this.year(),
this.month() - (this.month() % 3) + 3,
1
) - 1;
break;
case 'month':
time = startOfDate(this.year(), this.month() + 1, 1) - 1;
break;
case 'week':
time =
startOfDate(
this.year(),
this.month(),
this.date() - this.weekday() + 7
) - 1;
break;
case 'isoWeek':
time =
startOfDate(
this.year(),
this.month(),
this.date() - (this.isoWeekday() - 1) + 7
) - 1;
break;
case 'day':
case 'date':
time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
break;
case 'hour':
time = this._d.valueOf();
time +=
MS_PER_HOUR -
mod$1(
time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
MS_PER_HOUR
) -
1;
break;
case 'minute':
time = this._d.valueOf();
time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
break;
case 'second':
time = this._d.valueOf();
time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
break;
}
this._d.setTime(time);
hooks.updateOffset(this, true);
return this;
}
function valueOf() {
return this._d.valueOf() - (this._offset || 0) * 60000;
}
function unix() {
return Math.floor(this.valueOf() / 1000);
}
function toDate() {
return new Date(this.valueOf());
}
function toArray() {
var m = this;
return [
m.year(),
m.month(),
m.date(),
m.hour(),
m.minute(),
m.second(),
m.millisecond(),
];
}
function toObject() {
var m = this;
return {
years: m.year(),
months: m.month(),
date: m.date(),
hours: m.hours(),
minutes: m.minutes(),
seconds: m.seconds(),
milliseconds: m.milliseconds(),
};
}
function toJSON() {
// new Date(NaN).toJSON() === null
return this.isValid() ? this.toISOString() : null;
}
function isValid$2() {
return isValid(this);
}
function parsingFlags() {
return extend({}, getParsingFlags(this));
}
function invalidAt() {
return getParsingFlags(this).overflow;
}
function creationData() {
return {
input: this._i,
format: this._f,
locale: this._locale,
isUTC: this._isUTC,
strict: this._strict,
};
}
addFormatToken('N', 0, 0, 'eraAbbr');
addFormatToken('NN', 0, 0, 'eraAbbr');
addFormatToken('NNN', 0, 0, 'eraAbbr');
addFormatToken('NNNN', 0, 0, 'eraName');
addFormatToken('NNNNN', 0, 0, 'eraNarrow');
addFormatToken('y', ['y', 1], 'yo', 'eraYear');
addFormatToken('y', ['yy', 2], 0, 'eraYear');
addFormatToken('y', ['yyy', 3], 0, 'eraYear');
addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
addRegexToken('N', matchEraAbbr);
addRegexToken('NN', matchEraAbbr);
addRegexToken('NNN', matchEraAbbr);
addRegexToken('NNNN', matchEraName);
addRegexToken('NNNNN', matchEraNarrow);
addParseToken(
['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
function (input, array, config, token) {
var era = config._locale.erasParse(input, token, config._strict);
if (era) {
getParsingFlags(config).era = era;
} else {
getParsingFlags(config).invalidEra = input;
}
}
);
addRegexToken('y', matchUnsigned);
addRegexToken('yy', matchUnsigned);
addRegexToken('yyy', matchUnsigned);
addRegexToken('yyyy', matchUnsigned);
addRegexToken('yo', matchEraYearOrdinal);
addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
addParseToken(['yo'], function (input, array, config, token) {
var match;
if (config._locale._eraYearOrdinalRegex) {
match = input.match(config._locale._eraYearOrdinalRegex);
}
if (config._locale.eraYearOrdinalParse) {
array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
} else {
array[YEAR] = parseInt(input, 10);
}
});
function localeEras(m, format) {
var i,
l,
date,
eras = this._eras || getLocale('en')._eras;
for (i = 0, l = eras.length; i < l; ++i) {
switch (typeof eras[i].since) {
case 'string':
// truncate time
date = hooks(eras[i].since).startOf('day');
eras[i].since = date.valueOf();
break;
}
switch (typeof eras[i].until) {
case 'undefined':
eras[i].until = +Infinity;
break;
case 'string':
// truncate time
date = hooks(eras[i].until).startOf('day').valueOf();
eras[i].until = date.valueOf();
break;
}
}
return eras;
}
function localeErasParse(eraName, format, strict) {
var i,
l,
eras = this.eras(),
name,
abbr,
narrow;
eraName = eraName.toUpperCase();
for (i = 0, l = eras.length; i < l; ++i) {
name = eras[i].name.toUpperCase();
abbr = eras[i].abbr.toUpperCase();
narrow = eras[i].narrow.toUpperCase();
if (strict) {
switch (format) {
case 'N':
case 'NN':
case 'NNN':
if (abbr === eraName) {
return eras[i];
}
break;
case 'NNNN':
if (name === eraName) {
return eras[i];
}
break;
case 'NNNNN':
if (narrow === eraName) {
return eras[i];
}
break;
}
} else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
return eras[i];
}
}
}
function localeErasConvertYear(era, year) {
var dir = era.since <= era.until ? +1 : -1;
if (year === undefined) {
return hooks(era.since).year();
} else {
return hooks(era.since).year() + (year - era.offset) * dir;
}
}
function getEraName() {
var i,
l,
val,
eras = this.localeData().eras();
for (i = 0, l = eras.length; i < l; ++i) {
// truncate time
val = this.clone().startOf('day').valueOf();
if (eras[i].since <= val && val <= eras[i].until) {
return eras[i].name;
}
if (eras[i].until <= val && val <= eras[i].since) {
return eras[i].name;
}
}
return '';
}
function getEraNarrow() {
var i,
l,
val,
eras = this.localeData().eras();
for (i = 0, l = eras.length; i < l; ++i) {
// truncate time
val = this.clone().startOf('day').valueOf();
if (eras[i].since <= val && val <= eras[i].until) {
return eras[i].narrow;
}
if (eras[i].until <= val && val <= eras[i].since) {
return eras[i].narrow;
}
}
return '';
}
function getEraAbbr() {
var i,
l,
val,
eras = this.localeData().eras();
for (i = 0, l = eras.length; i < l; ++i) {
// truncate time
val = this.clone().startOf('day').valueOf();
if (eras[i].since <= val && val <= eras[i].until) {
return eras[i].abbr;
}
if (eras[i].until <= val && val <= eras[i].since) {
return eras[i].abbr;
}
}
return '';
}
function getEraYear() {
var i,
l,
dir,
val,
eras = this.localeData().eras();
for (i = 0, l = eras.length; i < l; ++i) {
dir = eras[i].since <= eras[i].until ? +1 : -1;
// truncate time
val = this.clone().startOf('day').valueOf();
if (
(eras[i].since <= val && val <= eras[i].until) ||
(eras[i].until <= val && val <= eras[i].since)
) {
return (
(this.year() - hooks(eras[i].since).year()) * dir +
eras[i].offset
);
}
}
return this.year();
}
function erasNameRegex(isStrict) {
if (!hasOwnProp(this, '_erasNameRegex')) {
computeErasParse.call(this);
}
return isStrict ? this._erasNameRegex : this._erasRegex;
}
function erasAbbrRegex(isStrict) {
if (!hasOwnProp(this, '_erasAbbrRegex')) {
computeErasParse.call(this);
}
return isStrict ? this._erasAbbrRegex : this._erasRegex;
}
function erasNarrowRegex(isStrict) {
if (!hasOwnProp(this, '_erasNarrowRegex')) {
computeErasParse.call(this);
}
return isStrict ? this._erasNarrowRegex : this._erasRegex;
}
function matchEraAbbr(isStrict, locale) {
return locale.erasAbbrRegex(isStrict);
}
function matchEraName(isStrict, locale) {
return locale.erasNameRegex(isStrict);
}
function matchEraNarrow(isStrict, locale) {
return locale.erasNarrowRegex(isStrict);
}
function matchEraYearOrdinal(isStrict, locale) {
return locale._eraYearOrdinalRegex || matchUnsigned;
}
function computeErasParse() {
var abbrPieces = [],
namePieces = [],
narrowPieces = [],
mixedPieces = [],
i,
l,
eras = this.eras();
for (i = 0, l = eras.length; i < l; ++i) {
namePieces.push(regexEscape(eras[i].name));
abbrPieces.push(regexEscape(eras[i].abbr));
narrowPieces.push(regexEscape(eras[i].narrow));
mixedPieces.push(regexEscape(eras[i].name));
mixedPieces.push(regexEscape(eras[i].abbr));
mixedPieces.push(regexEscape(eras[i].narrow));
}
this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
this._erasNarrowRegex = new RegExp(
'^(' + narrowPieces.join('|') + ')',
'i'
);
}
// FORMATTING
addFormatToken(0, ['gg', 2], 0, function () {
return this.weekYear() % 100;
});
addFormatToken(0, ['GG', 2], 0, function () {
return this.isoWeekYear() % 100;
});
function addWeekYearFormatToken(token, getter) {
addFormatToken(0, [token, token.length], 0, getter);
}
addWeekYearFormatToken('gggg', 'weekYear');
addWeekYearFormatToken('ggggg', 'weekYear');
addWeekYearFormatToken('GGGG', 'isoWeekYear');
addWeekYearFormatToken('GGGGG', 'isoWeekYear');
// ALIASES
addUnitAlias('weekYear', 'gg');
addUnitAlias('isoWeekYear', 'GG');
// PRIORITY
addUnitPriority('weekYear', 1);
addUnitPriority('isoWeekYear', 1);
// PARSING
addRegexToken('G', matchSigned);
addRegexToken('g', matchSigned);
addRegexToken('GG', match1to2, match2);
addRegexToken('gg', match1to2, match2);
addRegexToken('GGGG', match1to4, match4);
addRegexToken('gggg', match1to4, match4);
addRegexToken('GGGGG', match1to6, match6);
addRegexToken('ggggg', match1to6, match6);
addWeekParseToken(
['gggg', 'ggggg', 'GGGG', 'GGGGG'],
function (input, week, config, token) {
week[token.substr(0, 2)] = toInt(input);
}
);
addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
week[token] = hooks.parseTwoDigitYear(input);
});
// MOMENTS
function getSetWeekYear(input) {
return getSetWeekYearHelper.call(
this,
input,
this.week(),
this.weekday(),
this.localeData()._week.dow,
this.localeData()._week.doy
);
}
function getSetISOWeekYear(input) {
return getSetWeekYearHelper.call(
this,
input,
this.isoWeek(),
this.isoWeekday(),
1,
4
);
}
function getISOWeeksInYear() {
return weeksInYear(this.year(), 1, 4);
}
function getISOWeeksInISOWeekYear() {
return weeksInYear(this.isoWeekYear(), 1, 4);
}
function getWeeksInYear() {
var weekInfo = this.localeData()._week;
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
}
function getWeeksInWeekYear() {
var weekInfo = this.localeData()._week;
return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
}
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
var weeksTarget;
if (input == null) {
return weekOfYear(this, dow, doy).year;
} else {
weeksTarget = weeksInYear(input, dow, doy);
if (week > weeksTarget) {
week = weeksTarget;
}
return setWeekAll.call(this, input, week, weekday, dow, doy);
}
}
function setWeekAll(weekYear, week, weekday, dow, doy) {
var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
this.year(date.getUTCFullYear());
this.month(date.getUTCMonth());
this.date(date.getUTCDate());
return this;
}
// FORMATTING
addFormatToken('Q', 0, 'Qo', 'quarter');
// ALIASES
addUnitAlias('quarter', 'Q');
// PRIORITY
addUnitPriority('quarter', 7);
// PARSING
addRegexToken('Q', match1);
addParseToken('Q', function (input, array) {
array[MONTH] = (toInt(input) - 1) * 3;
});
// MOMENTS
function getSetQuarter(input) {
return input == null
? Math.ceil((this.month() + 1) / 3)
: this.month((input - 1) * 3 + (this.month() % 3));
}
// FORMATTING
addFormatToken('D', ['DD', 2], 'Do', 'date');
// ALIASES
addUnitAlias('date', 'D');
// PRIORITY
addUnitPriority('date', 9);
// PARSING
addRegexToken('D', match1to2);
addRegexToken('DD', match1to2, match2);
addRegexToken('Do', function (isStrict, locale) {
// TODO: Remove "ordinalParse" fallback in next major release.
return isStrict
? locale._dayOfMonthOrdinalParse || locale._ordinalParse
: locale._dayOfMonthOrdinalParseLenient;
});
addParseToken(['D', 'DD'], DATE);
addParseToken('Do', function (input, array) {
array[DATE] = toInt(input.match(match1to2)[0]);
});
// MOMENTS
var getSetDayOfMonth = makeGetSet('Date', true);
// FORMATTING
addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
// ALIASES
addUnitAlias('dayOfYear', 'DDD');
// PRIORITY
addUnitPriority('dayOfYear', 4);
// PARSING
addRegexToken('DDD', match1to3);
addRegexToken('DDDD', match3);
addParseToken(['DDD', 'DDDD'], function (input, array, config) {
config._dayOfYear = toInt(input);
});
// HELPERS
// MOMENTS
function getSetDayOfYear(input) {
var dayOfYear =
Math.round(
(this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
) + 1;
return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
}
// FORMATTING
addFormatToken('m', ['mm', 2], 0, 'minute');
// ALIASES
addUnitAlias('minute', 'm');
// PRIORITY
addUnitPriority('minute', 14);
// PARSING
addRegexToken('m', match1to2);
addRegexToken('mm', match1to2, match2);
addParseToken(['m', 'mm'], MINUTE);
// MOMENTS
var getSetMinute = makeGetSet('Minutes', false);
// FORMATTING
addFormatToken('s', ['ss', 2], 0, 'second');
// ALIASES
addUnitAlias('second', 's');
// PRIORITY
addUnitPriority('second', 15);
// PARSING
addRegexToken('s', match1to2);
addRegexToken('ss', match1to2, match2);
addParseToken(['s', 'ss'], SECOND);
// MOMENTS
var getSetSecond = makeGetSet('Seconds', false);
// FORMATTING
addFormatToken('S', 0, 0, function () {
return ~~(this.millisecond() / 100);
});
addFormatToken(0, ['SS', 2], 0, function () {
return ~~(this.millisecond() / 10);
});
addFormatToken(0, ['SSS', 3], 0, 'millisecond');
addFormatToken(0, ['SSSS', 4], 0, function () {
return this.millisecond() * 10;
});
addFormatToken(0, ['SSSSS', 5], 0, function () {
return this.millisecond() * 100;
});
addFormatToken(0, ['SSSSSS', 6], 0, function () {
return this.millisecond() * 1000;
});
addFormatToken(0, ['SSSSSSS', 7], 0, function () {
return this.millisecond() * 10000;
});
addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
return this.millisecond() * 100000;
});
addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
return this.millisecond() * 1000000;
});
// ALIASES
addUnitAlias('millisecond', 'ms');
// PRIORITY
addUnitPriority('millisecond', 16);
// PARSING
addRegexToken('S', match1to3, match1);
addRegexToken('SS', match1to3, match2);
addRegexToken('SSS', match1to3, match3);
var token, getSetMillisecond;
for (token = 'SSSS'; token.length <= 9; token += 'S') {
addRegexToken(token, matchUnsigned);
}
function parseMs(input, array) {
array[MILLISECOND] = toInt(('0.' + input) * 1000);
}
for (token = 'S'; token.length <= 9; token += 'S') {
addParseToken(token, parseMs);
}
getSetMillisecond = makeGetSet('Milliseconds', false);
// FORMATTING
addFormatToken('z', 0, 0, 'zoneAbbr');
addFormatToken('zz', 0, 0, 'zoneName');
// MOMENTS
function getZoneAbbr() {
return this._isUTC ? 'UTC' : '';
}
function getZoneName() {
return this._isUTC ? 'Coordinated Universal Time' : '';
}
var proto = Moment.prototype;
proto.add = add;
proto.calendar = calendar$1;
proto.clone = clone;
proto.diff = diff;
proto.endOf = endOf;
proto.format = format;
proto.from = from;
proto.fromNow = fromNow;
proto.to = to;
proto.toNow = toNow;
proto.get = stringGet;
proto.invalidAt = invalidAt;
proto.isAfter = isAfter;
proto.isBefore = isBefore;
proto.isBetween = isBetween;
proto.isSame = isSame;
proto.isSameOrAfter = isSameOrAfter;
proto.isSameOrBefore = isSameOrBefore;
proto.isValid = isValid$2;
proto.lang = lang;
proto.locale = locale;
proto.localeData = localeData;
proto.max = prototypeMax;
proto.min = prototypeMin;
proto.parsingFlags = parsingFlags;
proto.set = stringSet;
proto.startOf = startOf;
proto.subtract = subtract;
proto.toArray = toArray;
proto.toObject = toObject;
proto.toDate = toDate;
proto.toISOString = toISOString;
proto.inspect = inspect;
if (typeof Symbol !== 'undefined' && Symbol.for != null) {
proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
return 'Moment<' + this.format() + '>';
};
}
proto.toJSON = toJSON;
proto.toString = toString;
proto.unix = unix;
proto.valueOf = valueOf;
proto.creationData = creationData;
proto.eraName = getEraName;
proto.eraNarrow = getEraNarrow;
proto.eraAbbr = getEraAbbr;
proto.eraYear = getEraYear;
proto.year = getSetYear;
proto.isLeapYear = getIsLeapYear;
proto.weekYear = getSetWeekYear;
proto.isoWeekYear = getSetISOWeekYear;
proto.quarter = proto.quarters = getSetQuarter;
proto.month = getSetMonth;
proto.daysInMonth = getDaysInMonth;
proto.week = proto.weeks = getSetWeek;
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
proto.weeksInYear = getWeeksInYear;
proto.weeksInWeekYear = getWeeksInWeekYear;
proto.isoWeeksInYear = getISOWeeksInYear;
proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
proto.date = getSetDayOfMonth;
proto.day = proto.days = getSetDayOfWeek;
proto.weekday = getSetLocaleDayOfWeek;
proto.isoWeekday = getSetISODayOfWeek;
proto.dayOfYear = getSetDayOfYear;
proto.hour = proto.hours = getSetHour;
proto.minute = proto.minutes = getSetMinute;
proto.second = proto.seconds = getSetSecond;
proto.millisecond = proto.milliseconds = getSetMillisecond;
proto.utcOffset = getSetOffset;
proto.utc = setOffsetToUTC;
proto.local = setOffsetToLocal;
proto.parseZone = setOffsetToParsedOffset;
proto.hasAlignedHourOffset = hasAlignedHourOffset;
proto.isDST = isDaylightSavingTime;
proto.isLocal = isLocal;
proto.isUtcOffset = isUtcOffset;
proto.isUtc = isUtc;
proto.isUTC = isUtc;
proto.zoneAbbr = getZoneAbbr;
proto.zoneName = getZoneName;
proto.dates = deprecate(
'dates accessor is deprecated. Use date instead.',
getSetDayOfMonth
);
proto.months = deprecate(
'months accessor is deprecated. Use month instead',
getSetMonth
);
proto.years = deprecate(
'years accessor is deprecated. Use year instead',
getSetYear
);
proto.zone = deprecate(
'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
getSetZone
);
proto.isDSTShifted = deprecate(
'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
isDaylightSavingTimeShifted
);
function createUnix(input) {
return createLocal(input * 1000);
}
function createInZone() {
return createLocal.apply(null, arguments).parseZone();
}
function preParsePostFormat(string) {
return string;
}
var proto$1 = Locale.prototype;
proto$1.calendar = calendar;
proto$1.longDateFormat = longDateFormat;
proto$1.invalidDate = invalidDate;
proto$1.ordinal = ordinal;
proto$1.preparse = preParsePostFormat;
proto$1.postformat = preParsePostFormat;
proto$1.relativeTime = relativeTime;
proto$1.pastFuture = pastFuture;
proto$1.set = set;
proto$1.eras = localeEras;
proto$1.erasParse = localeErasParse;
proto$1.erasConvertYear = localeErasConvertYear;
proto$1.erasAbbrRegex = erasAbbrRegex;
proto$1.erasNameRegex = erasNameRegex;
proto$1.erasNarrowRegex = erasNarrowRegex;
proto$1.months = localeMonths;
proto$1.monthsShort = localeMonthsShort;
proto$1.monthsParse = localeMonthsParse;
proto$1.monthsRegex = monthsRegex;
proto$1.monthsShortRegex = monthsShortRegex;
proto$1.week = localeWeek;
proto$1.firstDayOfYear = localeFirstDayOfYear;
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
proto$1.weekdays = localeWeekdays;
proto$1.weekdaysMin = localeWeekdaysMin;
proto$1.weekdaysShort = localeWeekdaysShort;
proto$1.weekdaysParse = localeWeekdaysParse;
proto$1.weekdaysRegex = weekdaysRegex;
proto$1.weekdaysShortRegex = weekdaysShortRegex;
proto$1.weekdaysMinRegex = weekdaysMinRegex;
proto$1.isPM = localeIsPM;
proto$1.meridiem = localeMeridiem;
function get$1(format, index, field, setter) {
var locale = getLocale(),
utc = createUTC().set(setter, index);
return locale[field](utc, format);
}
function listMonthsImpl(format, index, field) {
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
if (index != null) {
return get$1(format, index, field, 'month');
}
var i,
out = [];
for (i = 0; i < 12; i++) {
out[i] = get$1(format, i, field, 'month');
}
return out;
}
// ()
// (5)
// (fmt, 5)
// (fmt)
// (true)
// (true, 5)
// (true, fmt, 5)
// (true, fmt)
function listWeekdaysImpl(localeSorted, format, index, field) {
if (typeof localeSorted === 'boolean') {
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
} else {
format = localeSorted;
index = format;
localeSorted = false;
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
}
var locale = getLocale(),
shift = localeSorted ? locale._week.dow : 0,
i,
out = [];
if (index != null) {
return get$1(format, (index + shift) % 7, field, 'day');
}
for (i = 0; i < 7; i++) {
out[i] = get$1(format, (i + shift) % 7, field, 'day');
}
return out;
}
function listMonths(format, index) {
return listMonthsImpl(format, index, 'months');
}
function listMonthsShort(format, index) {
return listMonthsImpl(format, index, 'monthsShort');
}
function listWeekdays(localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
}
function listWeekdaysShort(localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
}
function listWeekdaysMin(localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
}
getSetGlobalLocale('en', {
eras: [
{
since: '0001-01-01',
until: +Infinity,
offset: 1,
name: 'Anno Domini',
narrow: 'AD',
abbr: 'AD',
},
{
since: '0000-12-31',
until: -Infinity,
offset: 1,
name: 'Before Christ',
narrow: 'BC',
abbr: 'BC',
},
],
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
ordinal: function (number) {
var b = number % 10,
output =
toInt((number % 100) / 10) === 1
? 'th'
: b === 1
? 'st'
: b === 2
? 'nd'
: b === 3
? 'rd'
: 'th';
return number + output;
},
});
// Side effect imports
hooks.lang = deprecate(
'moment.lang is deprecated. Use moment.locale instead.',
getSetGlobalLocale
);
hooks.langData = deprecate(
'moment.langData is deprecated. Use moment.localeData instead.',
getLocale
);
var mathAbs = Math.abs;
function abs() {
var data = this._data;
this._milliseconds = mathAbs(this._milliseconds);
this._days = mathAbs(this._days);
this._months = mathAbs(this._months);
data.milliseconds = mathAbs(data.milliseconds);
data.seconds = mathAbs(data.seconds);
data.minutes = mathAbs(data.minutes);
data.hours = mathAbs(data.hours);
data.months = mathAbs(data.months);
data.years = mathAbs(data.years);
return this;
}
function addSubtract$1(duration, input, value, direction) {
var other = createDuration(input, value);
duration._milliseconds += direction * other._milliseconds;
duration._days += direction * other._days;
duration._months += direction * other._months;
return duration._bubble();
}
// supports only 2.0-style add(1, 's') or add(duration)
function add$1(input, value) {
return addSubtract$1(this, input, value, 1);
}
// supports only 2.0-style subtract(1, 's') or subtract(duration)
function subtract$1(input, value) {
return addSubtract$1(this, input, value, -1);
}
function absCeil(number) {
if (number < 0) {
return Math.floor(number);
} else {
return Math.ceil(number);
}
}
function bubble() {
var milliseconds = this._milliseconds,
days = this._days,
months = this._months,
data = this._data,
seconds,
minutes,
hours,
years,
monthsFromDays;
// if we have a mix of positive and negative values, bubble down first
// check: https://github.com/moment/moment/issues/2166
if (
!(
(milliseconds >= 0 && days >= 0 && months >= 0) ||
(milliseconds <= 0 && days <= 0 && months <= 0)
)
) {
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
days = 0;
months = 0;
}
// The following code bubbles up values, see the tests for
// examples of what that means.
data.milliseconds = milliseconds % 1000;
seconds = absFloor(milliseconds / 1000);
data.seconds = seconds % 60;
minutes = absFloor(seconds / 60);
data.minutes = minutes % 60;
hours = absFloor(minutes / 60);
data.hours = hours % 24;
days += absFloor(hours / 24);
// convert days to months
monthsFromDays = absFloor(daysToMonths(days));
months += monthsFromDays;
days -= absCeil(monthsToDays(monthsFromDays));
// 12 months -> 1 year
years = absFloor(months / 12);
months %= 12;
data.days = days;
data.months = months;
data.years = years;
return this;
}
function daysToMonths(days) {
// 400 years have 146097 days (taking into account leap year rules)
// 400 years have 12 months === 4800
return (days * 4800) / 146097;
}
function monthsToDays(months) {
// the reverse of daysToMonths
return (months * 146097) / 4800;
}
function as(units) {
if (!this.isValid()) {
return NaN;
}
var days,
months,
milliseconds = this._milliseconds;
units = normalizeUnits(units);
if (units === 'month' || units === 'quarter' || units === 'year') {
days = this._days + milliseconds / 864e5;
months = this._months + daysToMonths(days);
switch (units) {
case 'month':
return months;
case 'quarter':
return months / 3;
case 'year':
return months / 12;
}
} else {
// handle milliseconds separately because of floating point math errors (issue #1867)
days = this._days + Math.round(monthsToDays(this._months));
switch (units) {
case 'week':
return days / 7 + milliseconds / 6048e5;
case 'day':
return days + milliseconds / 864e5;
case 'hour':
return days * 24 + milliseconds / 36e5;
case 'minute':
return days * 1440 + milliseconds / 6e4;
case 'second':
return days * 86400 + milliseconds / 1000;
// Math.floor prevents floating point math errors here
case 'millisecond':
return Math.floor(days * 864e5) + milliseconds;
default:
throw new Error('Unknown unit ' + units);
}
}
}
// TODO: Use this.as('ms')?
function valueOf$1() {
if (!this.isValid()) {
return NaN;
}
return (
this._milliseconds +
this._days * 864e5 +
(this._months % 12) * 2592e6 +
toInt(this._months / 12) * 31536e6
);
}
function makeAs(alias) {
return function () {
return this.as(alias);
};
}
var asMilliseconds = makeAs('ms'),
asSeconds = makeAs('s'),
asMinutes = makeAs('m'),
asHours = makeAs('h'),
asDays = makeAs('d'),
asWeeks = makeAs('w'),
asMonths = makeAs('M'),
asQuarters = makeAs('Q'),
asYears = makeAs('y');
function clone$1() {
return createDuration(this);
}
function get$2(units) {
units = normalizeUnits(units);
return this.isValid() ? this[units + 's']() : NaN;
}
function makeGetter(name) {
return function () {
return this.isValid() ? this._data[name] : NaN;
};
}
var milliseconds = makeGetter('milliseconds'),
seconds = makeGetter('seconds'),
minutes = makeGetter('minutes'),
hours = makeGetter('hours'),
days = makeGetter('days'),
months = makeGetter('months'),
years = makeGetter('years');
function weeks() {
return absFloor(this.days() / 7);
}
var round = Math.round,
thresholds = {
ss: 44, // a few seconds to seconds
s: 45, // seconds to minute
m: 45, // minutes to hour
h: 22, // hours to day
d: 26, // days to month/week
w: null, // weeks to month
M: 11, // months to year
};
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
}
function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
var duration = createDuration(posNegDuration).abs(),
seconds = round(duration.as('s')),
minutes = round(duration.as('m')),
hours = round(duration.as('h')),
days = round(duration.as('d')),
months = round(duration.as('M')),
weeks = round(duration.as('w')),
years = round(duration.as('y')),
a =
(seconds <= thresholds.ss && ['s', seconds]) ||
(seconds < thresholds.s && ['ss', seconds]) ||
(minutes <= 1 && ['m']) ||
(minutes < thresholds.m && ['mm', minutes]) ||
(hours <= 1 && ['h']) ||
(hours < thresholds.h && ['hh', hours]) ||
(days <= 1 && ['d']) ||
(days < thresholds.d && ['dd', days]);
if (thresholds.w != null) {
a =
a ||
(weeks <= 1 && ['w']) ||
(weeks < thresholds.w && ['ww', weeks]);
}
a = a ||
(months <= 1 && ['M']) ||
(months < thresholds.M && ['MM', months]) ||
(years <= 1 && ['y']) || ['yy', years];
a[2] = withoutSuffix;
a[3] = +posNegDuration > 0;
a[4] = locale;
return substituteTimeAgo.apply(null, a);
}
// This function allows you to set the rounding function for relative time strings
function getSetRelativeTimeRounding(roundingFunction) {
if (roundingFunction === undefined) {
return round;
}
if (typeof roundingFunction === 'function') {
round = roundingFunction;
return true;
}
return false;
}
// This function allows you to set a threshold for relative time strings
function getSetRelativeTimeThreshold(threshold, limit) {
if (thresholds[threshold] === undefined) {
return false;
}
if (limit === undefined) {
return thresholds[threshold];
}
thresholds[threshold] = limit;
if (threshold === 's') {
thresholds.ss = limit - 1;
}
return true;
}
function humanize(argWithSuffix, argThresholds) {
if (!this.isValid()) {
return this.localeData().invalidDate();
}
var withSuffix = false,
th = thresholds,
locale,
output;
if (typeof argWithSuffix === 'object') {
argThresholds = argWithSuffix;
argWithSuffix = false;
}
if (typeof argWithSuffix === 'boolean') {
withSuffix = argWithSuffix;
}
if (typeof argThresholds === 'object') {
th = Object.assign({}, thresholds, argThresholds);
if (argThresholds.s != null && argThresholds.ss == null) {
th.ss = argThresholds.s - 1;
}
}
locale = this.localeData();
output = relativeTime$1(this, !withSuffix, th, locale);
if (withSuffix) {
output = locale.pastFuture(+this, output);
}
return locale.postformat(output);
}
var abs$1 = Math.abs;
function sign(x) {
return (x > 0) - (x < 0) || +x;
}
function toISOString$1() {
// for ISO strings we do not use the normal bubbling rules:
// * milliseconds bubble up until they become hours
// * days do not bubble at all
// * months bubble up until they become years
// This is because there is no context-free conversion between hours and days
// (think of clock changes)
// and also not between days and months (28-31 days per month)
if (!this.isValid()) {
return this.localeData().invalidDate();
}
var seconds = abs$1(this._milliseconds) / 1000,
days = abs$1(this._days),
months = abs$1(this._months),
minutes,
hours,
years,
s,
total = this.asSeconds(),
totalSign,
ymSign,
daysSign,
hmsSign;
if (!total) {
// this is the same as C#'s (Noda) and python (isodate)...
// but not other JS (goog.date)
return 'P0D';
}
// 3600 seconds -> 60 minutes -> 1 hour
minutes = absFloor(seconds / 60);
hours = absFloor(minutes / 60);
seconds %= 60;
minutes %= 60;
// 12 months -> 1 year
years = absFloor(months / 12);
months %= 12;
// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
totalSign = total < 0 ? '-' : '';
ymSign = sign(this._months) !== sign(total) ? '-' : '';
daysSign = sign(this._days) !== sign(total) ? '-' : '';
hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
return (
totalSign +
'P' +
(years ? ymSign + years + 'Y' : '') +
(months ? ymSign + months + 'M' : '') +
(days ? daysSign + days + 'D' : '') +
(hours || minutes || seconds ? 'T' : '') +
(hours ? hmsSign + hours + 'H' : '') +
(minutes ? hmsSign + minutes + 'M' : '') +
(seconds ? hmsSign + s + 'S' : '')
);
}
var proto$2 = Duration.prototype;
proto$2.isValid = isValid$1;
proto$2.abs = abs;
proto$2.add = add$1;
proto$2.subtract = subtract$1;
proto$2.as = as;
proto$2.asMilliseconds = asMilliseconds;
proto$2.asSeconds = asSeconds;
proto$2.asMinutes = asMinutes;
proto$2.asHours = asHours;
proto$2.asDays = asDays;
proto$2.asWeeks = asWeeks;
proto$2.asMonths = asMonths;
proto$2.asQuarters = asQuarters;
proto$2.asYears = asYears;
proto$2.valueOf = valueOf$1;
proto$2._bubble = bubble;
proto$2.clone = clone$1;
proto$2.get = get$2;
proto$2.milliseconds = milliseconds;
proto$2.seconds = seconds;
proto$2.minutes = minutes;
proto$2.hours = hours;
proto$2.days = days;
proto$2.weeks = weeks;
proto$2.months = months;
proto$2.years = years;
proto$2.humanize = humanize;
proto$2.toISOString = toISOString$1;
proto$2.toString = toISOString$1;
proto$2.toJSON = toISOString$1;
proto$2.locale = locale;
proto$2.localeData = localeData;
proto$2.toIsoString = deprecate(
'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
toISOString$1
);
proto$2.lang = lang;
// FORMATTING
addFormatToken('X', 0, 0, 'unix');
addFormatToken('x', 0, 0, 'valueOf');
// PARSING
addRegexToken('x', matchSigned);
addRegexToken('X', matchTimestamp);
addParseToken('X', function (input, array, config) {
config._d = new Date(parseFloat(input) * 1000);
});
addParseToken('x', function (input, array, config) {
config._d = new Date(toInt(input));
});
//! moment.js
hooks.version = '2.29.4';
setHookCallback(createLocal);
hooks.fn = proto;
hooks.min = min;
hooks.max = max;
hooks.now = now;
hooks.utc = createUTC;
hooks.unix = createUnix;
hooks.months = listMonths;
hooks.isDate = isDate;
hooks.locale = getSetGlobalLocale;
hooks.invalid = createInvalid;
hooks.duration = createDuration;
hooks.isMoment = isMoment;
hooks.weekdays = listWeekdays;
hooks.parseZone = createInZone;
hooks.localeData = getLocale;
hooks.isDuration = isDuration;
hooks.monthsShort = listMonthsShort;
hooks.weekdaysMin = listWeekdaysMin;
hooks.defineLocale = defineLocale;
hooks.updateLocale = updateLocale;
hooks.locales = listLocales;
hooks.weekdaysShort = listWeekdaysShort;
hooks.normalizeUnits = normalizeUnits;
hooks.relativeTimeRounding = getSetRelativeTimeRounding;
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
hooks.calendarFormat = getCalendarFormat;
hooks.prototype = proto;
// currently HTML5 input type only supports 24-hour formats
hooks.HTML5_FMT = {
DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
DATE: 'YYYY-MM-DD', // <input type="date" />
TIME: 'HH:mm', // <input type="time" />
TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
WEEK: 'GGGG-[W]WW', // <input type="week" />
MONTH: 'YYYY-MM', // <input type="month" />
};
return hooks;
})));
webpack://frontend-tpt/../../node_modules/node-fetch/browser.js
"use strict";
// ref: https://github.com/tc39/proposal-global
var getGlobal = function () {
// the only reliable means to get the global object is
// `Function('return this')()`
// However, this causes CSP violations in Chrome apps.
if (typeof self !== 'undefined') { return self; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
throw new Error('unable to locate global object');
}
var global = getGlobal();
module.exports = exports = global.fetch;
// Needed for TypeScript and Webpack.
if (global.fetch) {
exports.default = global.fetch.bind(global);
}
exports.Headers = global.Headers;
exports.Request = global.Request;
exports.Response = global.Response;
webpack://frontend-tpt/../../node_modules/nullthrows/nullthrows.js
'use strict';
function nullthrows(x, message) {
if (x != null) {
return x;
}
var error = new Error(message !== undefined ? message : 'Got unexpected ' + x);
error.framesToPop = 1; // Skip nullthrows's own stack frame.
throw error;
}
module.exports = nullthrows;
module.exports.default = nullthrows;
Object.defineProperty(module.exports, '__esModule', {value: true});
webpack://frontend-tpt/../../node_modules/numeral/numeral.js
/*! @preserve
* numeral.js
* version : 2.0.6
* author : Adam Draper
* license : MIT
* http://adamwdraper.github.com/Numeral-js/
*/
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory();
} else {
global.numeral = factory();
}
}(this, function () {
/************************************
Variables
************************************/
var numeral,
_,
VERSION = '2.0.6',
formats = {},
locales = {},
defaults = {
currentLocale: 'en',
zeroFormat: null,
nullFormat: null,
defaultFormat: '0,0',
scalePercentBy100: true
},
options = {
currentLocale: defaults.currentLocale,
zeroFormat: defaults.zeroFormat,
nullFormat: defaults.nullFormat,
defaultFormat: defaults.defaultFormat,
scalePercentBy100: defaults.scalePercentBy100
};
/************************************
Constructors
************************************/
// Numeral prototype object
function Numeral(input, number) {
this._input = input;
this._value = number;
}
numeral = function(input) {
var value,
kind,
unformatFunction,
regexp;
if (numeral.isNumeral(input)) {
value = input.value();
} else if (input === 0 || typeof input === 'undefined') {
value = 0;
} else if (input === null || _.isNaN(input)) {
value = null;
} else if (typeof input === 'string') {
if (options.zeroFormat && input === options.zeroFormat) {
value = 0;
} else if (options.nullFormat && input === options.nullFormat || !input.replace(/[^0-9]+/g, '').length) {
value = null;
} else {
for (kind in formats) {
regexp = typeof formats[kind].regexps.unformat === 'function' ? formats[kind].regexps.unformat() : formats[kind].regexps.unformat;
if (regexp && input.match(regexp)) {
unformatFunction = formats[kind].unformat;
break;
}
}
unformatFunction = unformatFunction || numeral._.stringToNumber;
value = unformatFunction(input);
}
} else {
value = Number(input)|| null;
}
return new Numeral(input, value);
};
// version number
numeral.version = VERSION;
// compare numeral object
numeral.isNumeral = function(obj) {
return obj instanceof Numeral;
};
// helper functions
numeral._ = _ = {
// formats numbers separators, decimals places, signs, abbreviations
numberToFormat: function(value, format, roundingFunction) {
var locale = locales[numeral.options.currentLocale],
negP = false,
optDec = false,
leadingCount = 0,
abbr = '',
trillion = 1000000000000,
billion = 1000000000,
million = 1000000,
thousand = 1000,
decimal = '',
neg = false,
abbrForce, // force abbreviation
abs,
min,
max,
power,
int,
precision,
signed,
thousands,
output;
// make sure we never format a null value
value = value || 0;
abs = Math.abs(value);
// see if we should use parentheses for negative number or if we should prefix with a sign
// if both are present we default to parentheses
if (numeral._.includes(format, '(')) {
negP = true;
format = format.replace(/[\(|\)]/g, '');
} else if (numeral._.includes(format, '+') || numeral._.includes(format, '-')) {
signed = numeral._.includes(format, '+') ? format.indexOf('+') : value < 0 ? format.indexOf('-') : -1;
format = format.replace(/[\+|\-]/g, '');
}
// see if abbreviation is wanted
if (numeral._.includes(format, 'a')) {
abbrForce = format.match(/a(k|m|b|t)?/);
abbrForce = abbrForce ? abbrForce[1] : false;
// check for space before abbreviation
if (numeral._.includes(format, ' a')) {
abbr = ' ';
}
format = format.replace(new RegExp(abbr + 'a[kmbt]?'), '');
if (abs >= trillion && !abbrForce || abbrForce === 't') {
// trillion
abbr += locale.abbreviations.trillion;
value = value / trillion;
} else if (abs < trillion && abs >= billion && !abbrForce || abbrForce === 'b') {
// billion
abbr += locale.abbreviations.billion;
value = value / billion;
} else if (abs < billion && abs >= million && !abbrForce || abbrForce === 'm') {
// million
abbr += locale.abbreviations.million;
value = value / million;
} else if (abs < million && abs >= thousand && !abbrForce || abbrForce === 'k') {
// thousand
abbr += locale.abbreviations.thousand;
value = value / thousand;
}
}
// check for optional decimals
if (numeral._.includes(format, '[.]')) {
optDec = true;
format = format.replace('[.]', '.');
}
// break number and format
int = value.toString().split('.')[0];
precision = format.split('.')[1];
thousands = format.indexOf(',');
leadingCount = (format.split('.')[0].split(',')[0].match(/0/g) || []).length;
if (precision) {
if (numeral._.includes(precision, '[')) {
precision = precision.replace(']', '');
precision = precision.split('[');
decimal = numeral._.toFixed(value, (precision[0].length + precision[1].length), roundingFunction, precision[1].length);
} else {
decimal = numeral._.toFixed(value, precision.length, roundingFunction);
}
int = decimal.split('.')[0];
if (numeral._.includes(decimal, '.')) {
decimal = locale.delimiters.decimal + decimal.split('.')[1];
} else {
decimal = '';
}
if (optDec && Number(decimal.slice(1)) === 0) {
decimal = '';
}
} else {
int = numeral._.toFixed(value, 0, roundingFunction);
}
// check abbreviation again after rounding
if (abbr && !abbrForce && Number(int) >= 1000 && abbr !== locale.abbreviations.trillion) {
int = String(Number(int) / 1000);
switch (abbr) {
case locale.abbreviations.thousand:
abbr = locale.abbreviations.million;
break;
case locale.abbreviations.million:
abbr = locale.abbreviations.billion;
break;
case locale.abbreviations.billion:
abbr = locale.abbreviations.trillion;
break;
}
}
// format number
if (numeral._.includes(int, '-')) {
int = int.slice(1);
neg = true;
}
if (int.length < leadingCount) {
for (var i = leadingCount - int.length; i > 0; i--) {
int = '0' + int;
}
}
if (thousands > -1) {
int = int.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + locale.delimiters.thousands);
}
if (format.indexOf('.') === 0) {
int = '';
}
output = int + decimal + (abbr ? abbr : '');
if (negP) {
output = (negP && neg ? '(' : '') + output + (negP && neg ? ')' : '');
} else {
if (signed >= 0) {
output = signed === 0 ? (neg ? '-' : '+') + output : output + (neg ? '-' : '+');
} else if (neg) {
output = '-' + output;
}
}
return output;
},
// unformats numbers separators, decimals places, signs, abbreviations
stringToNumber: function(string) {
var locale = locales[options.currentLocale],
stringOriginal = string,
abbreviations = {
thousand: 3,
million: 6,
billion: 9,
trillion: 12
},
abbreviation,
value,
i,
regexp;
if (options.zeroFormat && string === options.zeroFormat) {
value = 0;
} else if (options.nullFormat && string === options.nullFormat || !string.replace(/[^0-9]+/g, '').length) {
value = null;
} else {
value = 1;
if (locale.delimiters.decimal !== '.') {
string = string.replace(/\./g, '').replace(locale.delimiters.decimal, '.');
}
for (abbreviation in abbreviations) {
regexp = new RegExp('[^a-zA-Z]' + locale.abbreviations[abbreviation] + '(?:\\)|(\\' + locale.currency.symbol + ')?(?:\\))?)?$');
if (stringOriginal.match(regexp)) {
value *= Math.pow(10, abbreviations[abbreviation]);
break;
}
}
// check for negative number
value *= (string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2 ? 1 : -1;
// remove non numbers
string = string.replace(/[^0-9\.]+/g, '');
value *= Number(string);
}
return value;
},
isNaN: function(value) {
return typeof value === 'number' && isNaN(value);
},
includes: function(string, search) {
return string.indexOf(search) !== -1;
},
insert: function(string, subString, start) {
return string.slice(0, start) + subString + string.slice(start);
},
reduce: function(array, callback /*, initialValue*/) {
if (this === null) {
throw new TypeError('Array.prototype.reduce called on null or undefined');
}
if (typeof callback !== 'function') {
throw new TypeError(callback + ' is not a function');
}
var t = Object(array),
len = t.length >>> 0,
k = 0,
value;
if (arguments.length === 3) {
value = arguments[2];
} else {
while (k < len && !(k in t)) {
k++;
}
if (k >= len) {
throw new TypeError('Reduce of empty array with no initial value');
}
value = t[k++];
}
for (; k < len; k++) {
if (k in t) {
value = callback(value, t[k], k, t);
}
}
return value;
},
/**
* Computes the multiplier necessary to make x >= 1,
* effectively eliminating miscalculations caused by
* finite precision.
*/
multiplier: function (x) {
var parts = x.toString().split('.');
return parts.length < 2 ? 1 : Math.pow(10, parts[1].length);
},
/**
* Given a variable number of arguments, returns the maximum
* multiplier that must be used to normalize an operation involving
* all of them.
*/
correctionFactor: function () {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(accum, next) {
var mn = _.multiplier(next);
return accum > mn ? accum : mn;
}, 1);
},
/**
* Implementation of toFixed() that treats floats more like decimals
*
* Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present
* problems for accounting- and finance-related software.
*/
toFixed: function(value, maxDecimals, roundingFunction, optionals) {
var splitValue = value.toString().split('.'),
minDecimals = maxDecimals - (optionals || 0),
boundedPrecision,
optionalsRegExp,
power,
output;
// Use the smallest precision value possible to avoid errors from floating point representation
if (splitValue.length === 2) {
boundedPrecision = Math.min(Math.max(splitValue[1].length, minDecimals), maxDecimals);
} else {
boundedPrecision = minDecimals;
}
power = Math.pow(10, boundedPrecision);
// Multiply up by precision, round accurately, then divide and use native toFixed():
output = (roundingFunction(value + 'e+' + boundedPrecision) / power).toFixed(boundedPrecision);
if (optionals > maxDecimals - boundedPrecision) {
optionalsRegExp = new RegExp('\\.?0{1,' + (optionals - (maxDecimals - boundedPrecision)) + '}$');
output = output.replace(optionalsRegExp, '');
}
return output;
}
};
// avaliable options
numeral.options = options;
// avaliable formats
numeral.formats = formats;
// avaliable formats
numeral.locales = locales;
// This function sets the current locale. If
// no arguments are passed in, it will simply return the current global
// locale key.
numeral.locale = function(key) {
if (key) {
options.currentLocale = key.toLowerCase();
}
return options.currentLocale;
};
// This function provides access to the loaded locale data. If
// no arguments are passed in, it will simply return the current
// global locale object.
numeral.localeData = function(key) {
if (!key) {
return locales[options.currentLocale];
}
key = key.toLowerCase();
if (!locales[key]) {
throw new Error('Unknown locale : ' + key);
}
return locales[key];
};
numeral.reset = function() {
for (var property in defaults) {
options[property] = defaults[property];
}
};
numeral.zeroFormat = function(format) {
options.zeroFormat = typeof(format) === 'string' ? format : null;
};
numeral.nullFormat = function (format) {
options.nullFormat = typeof(format) === 'string' ? format : null;
};
numeral.defaultFormat = function(format) {
options.defaultFormat = typeof(format) === 'string' ? format : '0.0';
};
numeral.register = function(type, name, format) {
name = name.toLowerCase();
if (this[type + 's'][name]) {
throw new TypeError(name + ' ' + type + ' already registered.');
}
this[type + 's'][name] = format;
return format;
};
numeral.validate = function(val, culture) {
var _decimalSep,
_thousandSep,
_currSymbol,
_valArray,
_abbrObj,
_thousandRegEx,
localeData,
temp;
//coerce val to string
if (typeof val !== 'string') {
val += '';
if (console.warn) {
console.warn('Numeral.js: Value is not string. It has been co-erced to: ', val);
}
}
//trim whitespaces from either sides
val = val.trim();
//if val is just digits return true
if (!!val.match(/^\d+$/)) {
return true;
}
//if val is empty return false
if (val === '') {
return false;
}
//get the decimal and thousands separator from numeral.localeData
try {
//check if the culture is understood by numeral. if not, default it to current locale
localeData = numeral.localeData(culture);
} catch (e) {
localeData = numeral.localeData(numeral.locale());
}
//setup the delimiters and currency symbol based on culture/locale
_currSymbol = localeData.currency.symbol;
_abbrObj = localeData.abbreviations;
_decimalSep = localeData.delimiters.decimal;
if (localeData.delimiters.thousands === '.') {
_thousandSep = '\\.';
} else {
_thousandSep = localeData.delimiters.thousands;
}
// validating currency symbol
temp = val.match(/^[^\d]+/);
if (temp !== null) {
val = val.substr(1);
if (temp[0] !== _currSymbol) {
return false;
}
}
//validating abbreviation symbol
temp = val.match(/[^\d]+$/);
if (temp !== null) {
val = val.slice(0, -1);
if (temp[0] !== _abbrObj.thousand && temp[0] !== _abbrObj.million && temp[0] !== _abbrObj.billion && temp[0] !== _abbrObj.trillion) {
return false;
}
}
_thousandRegEx = new RegExp(_thousandSep + '{2}');
if (!val.match(/[^\d.,]/g)) {
_valArray = val.split(_decimalSep);
if (_valArray.length > 2) {
return false;
} else {
if (_valArray.length < 2) {
return ( !! _valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx));
} else {
if (_valArray[0].length === 1) {
return ( !! _valArray[0].match(/^\d+$/) && !_valArray[0].match(_thousandRegEx) && !! _valArray[1].match(/^\d+$/));
} else {
return ( !! _valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx) && !! _valArray[1].match(/^\d+$/));
}
}
}
}
return false;
};
/************************************
Numeral Prototype
************************************/
numeral.fn = Numeral.prototype = {
clone: function() {
return numeral(this);
},
format: function(inputString, roundingFunction) {
var value = this._value,
format = inputString || options.defaultFormat,
kind,
output,
formatFunction;
// make sure we have a roundingFunction
roundingFunction = roundingFunction || Math.round;
// format based on value
if (value === 0 && options.zeroFormat !== null) {
output = options.zeroFormat;
} else if (value === null && options.nullFormat !== null) {
output = options.nullFormat;
} else {
for (kind in formats) {
if (format.match(formats[kind].regexps.format)) {
formatFunction = formats[kind].format;
break;
}
}
formatFunction = formatFunction || numeral._.numberToFormat;
output = formatFunction(value, format, roundingFunction);
}
return output;
},
value: function() {
return this._value;
},
input: function() {
return this._input;
},
set: function(value) {
this._value = Number(value);
return this;
},
add: function(value) {
var corrFactor = _.correctionFactor.call(null, this._value, value);
function cback(accum, curr, currI, O) {
return accum + Math.round(corrFactor * curr);
}
this._value = _.reduce([this._value, value], cback, 0) / corrFactor;
return this;
},
subtract: function(value) {
var corrFactor = _.correctionFactor.call(null, this._value, value);
function cback(accum, curr, currI, O) {
return accum - Math.round(corrFactor * curr);
}
this._value = _.reduce([value], cback, Math.round(this._value * corrFactor)) / corrFactor;
return this;
},
multiply: function(value) {
function cback(accum, curr, currI, O) {
var corrFactor = _.correctionFactor(accum, curr);
return Math.round(accum * corrFactor) * Math.round(curr * corrFactor) / Math.round(corrFactor * corrFactor);
}
this._value = _.reduce([this._value, value], cback, 1);
return this;
},
divide: function(value) {
function cback(accum, curr, currI, O) {
var corrFactor = _.correctionFactor(accum, curr);
return Math.round(accum * corrFactor) / Math.round(curr * corrFactor);
}
this._value = _.reduce([this._value, value], cback);
return this;
},
difference: function(value) {
return Math.abs(numeral(this._value).subtract(value).value());
}
};
/************************************
Default Locale && Format
************************************/
numeral.register('locale', 'en', {
delimiters: {
thousands: ',',
decimal: '.'
},
abbreviations: {
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't'
},
ordinal: function(number) {
var b = number % 10;
return (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
},
currency: {
symbol: '$'
}
});
(function() {
numeral.register('format', 'bps', {
regexps: {
format: /(BPS)/,
unformat: /(BPS)/
},
format: function(value, format, roundingFunction) {
var space = numeral._.includes(format, ' BPS') ? ' ' : '',
output;
value = value * 10000;
// check for space before BPS
format = format.replace(/\s?BPS/, '');
output = numeral._.numberToFormat(value, format, roundingFunction);
if (numeral._.includes(output, ')')) {
output = output.split('');
output.splice(-1, 0, space + 'BPS');
output = output.join('');
} else {
output = output + space + 'BPS';
}
return output;
},
unformat: function(string) {
return +(numeral._.stringToNumber(string) * 0.0001).toFixed(15);
}
});
})();
(function() {
var decimal = {
base: 1000,
suffixes: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
},
binary = {
base: 1024,
suffixes: ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
};
var allSuffixes = decimal.suffixes.concat(binary.suffixes.filter(function (item) {
return decimal.suffixes.indexOf(item) < 0;
}));
var unformatRegex = allSuffixes.join('|');
// Allow support for BPS (http://www.investopedia.com/terms/b/basispoint.asp)
unformatRegex = '(' + unformatRegex.replace('B', 'B(?!PS)') + ')';
numeral.register('format', 'bytes', {
regexps: {
format: /([0\s]i?b)/,
unformat: new RegExp(unformatRegex)
},
format: function(value, format, roundingFunction) {
var output,
bytes = numeral._.includes(format, 'ib') ? binary : decimal,
suffix = numeral._.includes(format, ' b') || numeral._.includes(format, ' ib') ? ' ' : '',
power,
min,
max;
// check for space before
format = format.replace(/\s?i?b/, '');
for (power = 0; power <= bytes.suffixes.length; power++) {
min = Math.pow(bytes.base, power);
max = Math.pow(bytes.base, power + 1);
if (value === null || value === 0 || value >= min && value < max) {
suffix += bytes.suffixes[power];
if (min > 0) {
value = value / min;
}
break;
}
}
output = numeral._.numberToFormat(value, format, roundingFunction);
return output + suffix;
},
unformat: function(string) {
var value = numeral._.stringToNumber(string),
power,
bytesMultiplier;
if (value) {
for (power = decimal.suffixes.length - 1; power >= 0; power--) {
if (numeral._.includes(string, decimal.suffixes[power])) {
bytesMultiplier = Math.pow(decimal.base, power);
break;
}
if (numeral._.includes(string, binary.suffixes[power])) {
bytesMultiplier = Math.pow(binary.base, power);
break;
}
}
value *= (bytesMultiplier || 1);
}
return value;
}
});
})();
(function() {
numeral.register('format', 'currency', {
regexps: {
format: /(\$)/
},
format: function(value, format, roundingFunction) {
var locale = numeral.locales[numeral.options.currentLocale],
symbols = {
before: format.match(/^([\+|\-|\(|\s|\$]*)/)[0],
after: format.match(/([\+|\-|\)|\s|\$]*)$/)[0]
},
output,
symbol,
i;
// strip format of spaces and $
format = format.replace(/\s?\$\s?/, '');
// format the number
output = numeral._.numberToFormat(value, format, roundingFunction);
// update the before and after based on value
if (value >= 0) {
symbols.before = symbols.before.replace(/[\-\(]/, '');
symbols.after = symbols.after.replace(/[\-\)]/, '');
} else if (value < 0 && (!numeral._.includes(symbols.before, '-') && !numeral._.includes(symbols.before, '('))) {
symbols.before = '-' + symbols.before;
}
// loop through each before symbol
for (i = 0; i < symbols.before.length; i++) {
symbol = symbols.before[i];
switch (symbol) {
case '$':
output = numeral._.insert(output, locale.currency.symbol, i);
break;
case ' ':
output = numeral._.insert(output, ' ', i + locale.currency.symbol.length - 1);
break;
}
}
// loop through each after symbol
for (i = symbols.after.length - 1; i >= 0; i--) {
symbol = symbols.after[i];
switch (symbol) {
case '$':
output = i === symbols.after.length - 1 ? output + locale.currency.symbol : numeral._.insert(output, locale.currency.symbol, -(symbols.after.length - (1 + i)));
break;
case ' ':
output = i === symbols.after.length - 1 ? output + ' ' : numeral._.insert(output, ' ', -(symbols.after.length - (1 + i) + locale.currency.symbol.length - 1));
break;
}
}
return output;
}
});
})();
(function() {
numeral.register('format', 'exponential', {
regexps: {
format: /(e\+|e-)/,
unformat: /(e\+|e-)/
},
format: function(value, format, roundingFunction) {
var output,
exponential = typeof value === 'number' && !numeral._.isNaN(value) ? value.toExponential() : '0e+0',
parts = exponential.split('e');
format = format.replace(/e[\+|\-]{1}0/, '');
output = numeral._.numberToFormat(Number(parts[0]), format, roundingFunction);
return output + 'e' + parts[1];
},
unformat: function(string) {
var parts = numeral._.includes(string, 'e+') ? string.split('e+') : string.split('e-'),
value = Number(parts[0]),
power = Number(parts[1]);
power = numeral._.includes(string, 'e-') ? power *= -1 : power;
function cback(accum, curr, currI, O) {
var corrFactor = numeral._.correctionFactor(accum, curr),
num = (accum * corrFactor) * (curr * corrFactor) / (corrFactor * corrFactor);
return num;
}
return numeral._.reduce([value, Math.pow(10, power)], cback, 1);
}
});
})();
(function() {
numeral.register('format', 'ordinal', {
regexps: {
format: /(o)/
},
format: function(value, format, roundingFunction) {
var locale = numeral.locales[numeral.options.currentLocale],
output,
ordinal = numeral._.includes(format, ' o') ? ' ' : '';
// check for space before
format = format.replace(/\s?o/, '');
ordinal += locale.ordinal(value);
output = numeral._.numberToFormat(value, format, roundingFunction);
return output + ordinal;
}
});
})();
(function() {
numeral.register('format', 'percentage', {
regexps: {
format: /(%)/,
unformat: /(%)/
},
format: function(value, format, roundingFunction) {
var space = numeral._.includes(format, ' %') ? ' ' : '',
output;
if (numeral.options.scalePercentBy100) {
value = value * 100;
}
// check for space before %
format = format.replace(/\s?\%/, '');
output = numeral._.numberToFormat(value, format, roundingFunction);
if (numeral._.includes(output, ')')) {
output = output.split('');
output.splice(-1, 0, space + '%');
output = output.join('');
} else {
output = output + space + '%';
}
return output;
},
unformat: function(string) {
var number = numeral._.stringToNumber(string);
if (numeral.options.scalePercentBy100) {
return number * 0.01;
}
return number;
}
});
})();
(function() {
numeral.register('format', 'time', {
regexps: {
format: /(:)/,
unformat: /(:)/
},
format: function(value, format, roundingFunction) {
var hours = Math.floor(value / 60 / 60),
minutes = Math.floor((value - (hours * 60 * 60)) / 60),
seconds = Math.round(value - (hours * 60 * 60) - (minutes * 60));
return hours + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
},
unformat: function(string) {
var timeArray = string.split(':'),
seconds = 0;
// turn hours and minutes into seconds and add them all up
if (timeArray.length === 3) {
// hours
seconds = seconds + (Number(timeArray[0]) * 60 * 60);
// minutes
seconds = seconds + (Number(timeArray[1]) * 60);
// seconds
seconds = seconds + Number(timeArray[2]);
} else if (timeArray.length === 2) {
// minutes
seconds = seconds + (Number(timeArray[0]) * 60);
// seconds
seconds = seconds + Number(timeArray[1]);
}
return Number(seconds);
}
});
})();
return numeral;
}));
webpack://frontend-tpt/../../node_modules/object-assign/index.js
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
webpack://frontend-tpt/../../node_modules/performance-now/lib/performance-now.js
// Generated by CoffeeScript 1.12.2
(function() {
var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
module.exports = function() {
return performance.now();
};
} else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
module.exports = function() {
return (getNanoSeconds() - nodeLoadTime) / 1e6;
};
hrtime = process.hrtime;
getNanoSeconds = function() {
var hr;
hr = hrtime();
return hr[0] * 1e9 + hr[1];
};
moduleLoadTime = getNanoSeconds();
upTime = process.uptime() * 1e9;
nodeLoadTime = moduleLoadTime - upTime;
} else if (Date.now) {
module.exports = function() {
return Date.now() - loadTime;
};
loadTime = Date.now();
} else {
module.exports = function() {
return new Date().getTime() - loadTime;
};
loadTime = new Date().getTime();
}
}).call(this);
//# sourceMappingURL=performance-now.js.map
webpack://frontend-tpt/../../node_modules/postcss-value-parser/lib/index.js
var parse = require("./parse");
var walk = require("./walk");
var stringify = require("./stringify");
function ValueParser(value) {
if (this instanceof ValueParser) {
this.nodes = parse(value);
return this;
}
return new ValueParser(value);
}
ValueParser.prototype.toString = function() {
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
};
ValueParser.prototype.walk = function(cb, bubble) {
walk(this.nodes, cb, bubble);
return this;
};
ValueParser.unit = require("./unit");
ValueParser.walk = walk;
ValueParser.stringify = stringify;
module.exports = ValueParser;
webpack://frontend-tpt/../../node_modules/postcss-value-parser/lib/parse.js
var openParentheses = "(".charCodeAt(0);
var closeParentheses = ")".charCodeAt(0);
var singleQuote = "'".charCodeAt(0);
var doubleQuote = '"'.charCodeAt(0);
var backslash = "\\".charCodeAt(0);
var slash = "/".charCodeAt(0);
var comma = ",".charCodeAt(0);
var colon = ":".charCodeAt(0);
var star = "*".charCodeAt(0);
var uLower = "u".charCodeAt(0);
var uUpper = "U".charCodeAt(0);
var plus = "+".charCodeAt(0);
var isUnicodeRange = /^[a-f0-9?-]+$/i;
module.exports = function(input) {
var tokens = [];
var value = input;
var next,
quote,
prev,
token,
escape,
escapePos,
whitespacePos,
parenthesesOpenPos;
var pos = 0;
var code = value.charCodeAt(pos);
var max = value.length;
var stack = [{ nodes: tokens }];
var balanced = 0;
var parent;
var name = "";
var before = "";
var after = "";
while (pos < max) {
// Whitespaces
if (code <= 32) {
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
token = value.slice(pos, next);
prev = tokens[tokens.length - 1];
if (code === closeParentheses && balanced) {
after = token;
} else if (prev && prev.type === "div") {
prev.after = token;
prev.sourceEndIndex += token.length;
} else if (
code === comma ||
code === colon ||
(code === slash &&
value.charCodeAt(next + 1) !== star &&
(!parent ||
(parent && parent.type === "function" && parent.value !== "calc")))
) {
before = token;
} else {
tokens.push({
type: "space",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
}
pos = next;
// Quotes
} else if (code === singleQuote || code === doubleQuote) {
next = pos;
quote = code === singleQuote ? "'" : '"';
token = {
type: "string",
sourceIndex: pos,
quote: quote
};
do {
escape = false;
next = value.indexOf(quote, next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += quote;
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
token.value = value.slice(pos + 1, next);
token.sourceEndIndex = token.unclosed ? next : next + 1;
tokens.push(token);
pos = next + 1;
code = value.charCodeAt(pos);
// Comments
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
next = value.indexOf("*/", pos);
token = {
type: "comment",
sourceIndex: pos,
sourceEndIndex: next + 2
};
if (next === -1) {
token.unclosed = true;
next = value.length;
token.sourceEndIndex = next;
}
token.value = value.slice(pos + 2, next);
tokens.push(token);
pos = next + 2;
code = value.charCodeAt(pos);
// Operation within calc
} else if (
(code === slash || code === star) &&
parent &&
parent.type === "function" &&
parent.value === "calc"
) {
token = value[pos];
tokens.push({
type: "word",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token
});
pos += 1;
code = value.charCodeAt(pos);
// Dividers
} else if (code === slash || code === comma || code === colon) {
token = value[pos];
tokens.push({
type: "div",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token,
before: before,
after: ""
});
before = "";
pos += 1;
code = value.charCodeAt(pos);
// Open parentheses
} else if (openParentheses === code) {
// Whitespaces after open parentheses
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
parenthesesOpenPos = pos;
token = {
type: "function",
sourceIndex: pos - name.length,
value: name,
before: value.slice(parenthesesOpenPos + 1, next)
};
pos = next;
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
next -= 1;
do {
escape = false;
next = value.indexOf(")", next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += ")";
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
// Whitespaces before closed
whitespacePos = next;
do {
whitespacePos -= 1;
code = value.charCodeAt(whitespacePos);
} while (code <= 32);
if (parenthesesOpenPos < whitespacePos) {
if (pos !== whitespacePos + 1) {
token.nodes = [
{
type: "word",
sourceIndex: pos,
sourceEndIndex: whitespacePos + 1,
value: value.slice(pos, whitespacePos + 1)
}
];
} else {
token.nodes = [];
}
if (token.unclosed && whitespacePos + 1 !== next) {
token.after = "";
token.nodes.push({
type: "space",
sourceIndex: whitespacePos + 1,
sourceEndIndex: next,
value: value.slice(whitespacePos + 1, next)
});
} else {
token.after = value.slice(whitespacePos + 1, next);
token.sourceEndIndex = next;
}
} else {
token.after = "";
token.nodes = [];
}
pos = next + 1;
token.sourceEndIndex = token.unclosed ? next : pos;
code = value.charCodeAt(pos);
tokens.push(token);
} else {
balanced += 1;
token.after = "";
token.sourceEndIndex = pos + 1;
tokens.push(token);
stack.push(token);
tokens = token.nodes = [];
parent = token;
}
name = "";
// Close parentheses
} else if (closeParentheses === code && balanced) {
pos += 1;
code = value.charCodeAt(pos);
parent.after = after;
parent.sourceEndIndex += after.length;
after = "";
balanced -= 1;
stack[stack.length - 1].sourceEndIndex = pos;
stack.pop();
parent = stack[balanced];
tokens = parent.nodes;
// Words
} else {
next = pos;
do {
if (code === backslash) {
next += 1;
}
next += 1;
code = value.charCodeAt(next);
} while (
next < max &&
!(
code <= 32 ||
code === singleQuote ||
code === doubleQuote ||
code === comma ||
code === colon ||
code === slash ||
code === openParentheses ||
(code === star &&
parent &&
parent.type === "function" &&
parent.value === "calc") ||
(code === slash &&
parent.type === "function" &&
parent.value === "calc") ||
(code === closeParentheses && balanced)
)
);
token = value.slice(pos, next);
if (openParentheses === code) {
name = token;
} else if (
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
plus === token.charCodeAt(1) &&
isUnicodeRange.test(token.slice(2))
) {
tokens.push({
type: "unicode-range",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
} else {
tokens.push({
type: "word",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
}
pos = next;
}
}
for (pos = stack.length - 1; pos; pos -= 1) {
stack[pos].unclosed = true;
stack[pos].sourceEndIndex = value.length;
}
return stack[0].nodes;
};
webpack://frontend-tpt/../../node_modules/postcss-value-parser/lib/stringify.js
function stringifyNode(node, custom) {
var type = node.type;
var value = node.value;
var buf;
var customResult;
if (custom && (customResult = custom(node)) !== undefined) {
return customResult;
} else if (type === "word" || type === "space") {
return value;
} else if (type === "string") {
buf = node.quote || "";
return buf + value + (node.unclosed ? "" : buf);
} else if (type === "comment") {
return "/*" + value + (node.unclosed ? "" : "*/");
} else if (type === "div") {
return (node.before || "") + value + (node.after || "");
} else if (Array.isArray(node.nodes)) {
buf = stringify(node.nodes, custom);
if (type !== "function") {
return buf;
}
return (
value +
"(" +
(node.before || "") +
buf +
(node.after || "") +
(node.unclosed ? "" : ")")
);
}
return value;
}
function stringify(nodes, custom) {
var result, i;
if (Array.isArray(nodes)) {
result = "";
for (i = nodes.length - 1; ~i; i -= 1) {
result = stringifyNode(nodes[i], custom) + result;
}
return result;
}
return stringifyNode(nodes, custom);
}
module.exports = stringify;
webpack://frontend-tpt/../../node_modules/postcss-value-parser/lib/unit.js
var minus = "-".charCodeAt(0);
var plus = "+".charCodeAt(0);
var dot = ".".charCodeAt(0);
var exp = "e".charCodeAt(0);
var EXP = "E".charCodeAt(0);
// Check if three code points would start a number
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
function likeNumber(value) {
var code = value.charCodeAt(0);
var nextCode;
if (code === plus || code === minus) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) {
return true;
}
var nextNextCode = value.charCodeAt(2);
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
return true;
}
return false;
}
if (code === dot) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) {
return true;
}
return false;
}
if (code >= 48 && code <= 57) {
return true;
}
return false;
}
// Consume a number
// https://www.w3.org/TR/css-syntax-3/#consume-number
module.exports = function(value) {
var pos = 0;
var length = value.length;
var code;
var nextCode;
var nextNextCode;
if (length === 0 || !likeNumber(value)) {
return false;
}
code = value.charCodeAt(pos);
if (code === plus || code === minus) {
pos++;
}
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
if (code === dot && nextCode >= 48 && nextCode <= 57) {
pos += 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
nextNextCode = value.charCodeAt(pos + 2);
if (
(code === exp || code === EXP) &&
((nextCode >= 48 && nextCode <= 57) ||
((nextCode === plus || nextCode === minus) &&
nextNextCode >= 48 &&
nextNextCode <= 57))
) {
pos += nextCode === plus || nextCode === minus ? 3 : 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
}
return {
number: value.slice(0, pos),
unit: value.slice(pos)
};
};
webpack://frontend-tpt/../../node_modules/postcss-value-parser/lib/walk.js
module.exports = function walk(nodes, cb, bubble) {
var i, max, node, result;
for (i = 0, max = nodes.length; i < max; i += 1) {
node = nodes[i];
if (!bubble) {
result = cb(node, i, nodes);
}
if (
result !== false &&
node.type === "function" &&
Array.isArray(node.nodes)
) {
walk(node.nodes, cb, bubble);
}
if (bubble) {
cb(node, i, nodes);
}
}
};
webpack://frontend-tpt/../../node_modules/prop-types/factoryWithThrowingShims.js
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
function emptyFunction() {}
function emptyFunctionWithReset() {}
emptyFunctionWithReset.resetWarningCache = emptyFunction;
module.exports = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
// It is still safe when called from React.
return;
}
var err = new Error(
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use PropTypes.checkPropTypes() to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
err.name = 'Invariant Violation';
throw err;
};
shim.isRequired = shim;
function getShim() {
return shim;
};
// Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes = {
array: shim,
bigint: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
elementType: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim,
checkPropTypes: emptyFunctionWithReset,
resetWarningCache: emptyFunction
};
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
webpack://frontend-tpt/../../node_modules/prop-types/index.js
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (process.env.NODE_ENV !== 'production') {
var ReactIs = require('react-is');
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = require('./factoryWithThrowingShims')();
}
webpack://frontend-tpt/../../node_modules/prop-types/lib/ReactPropTypesSecret.js
/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret;
webpack://frontend-tpt/../../node_modules/query-string/index.js
'use strict';
const strictUriEncode = require('strict-uri-encode');
const decodeComponent = require('decode-uri-component');
const splitOnFirst = require('split-on-first');
const filterObject = require('filter-obj');
const isNullOrUndefined = value => value === null || value === undefined;
const encodeFragmentIdentifier = Symbol('encodeFragmentIdentifier');
function encoderForArrayFormat(options) {
switch (options.arrayFormat) {
case 'index':
return key => (result, value) => {
const index = result.length;
if (
value === undefined ||
(options.skipNull && value === null) ||
(options.skipEmptyString && value === '')
) {
return result;
}
if (value === null) {
return [...result, [encode(key, options), '[', index, ']'].join('')];
}
return [
...result,
[encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')
];
};
case 'bracket':
return key => (result, value) => {
if (
value === undefined ||
(options.skipNull && value === null) ||
(options.skipEmptyString && value === '')
) {
return result;
}
if (value === null) {
return [...result, [encode(key, options), '[]'].join('')];
}
return [...result, [encode(key, options), '[]=', encode(value, options)].join('')];
};
case 'colon-list-separator':
return key => (result, value) => {
if (
value === undefined ||
(options.skipNull && value === null) ||
(options.skipEmptyString && value === '')
) {
return result;
}
if (value === null) {
return [...result, [encode(key, options), ':list='].join('')];
}
return [...result, [encode(key, options), ':list=', encode(value, options)].join('')];
};
case 'comma':
case 'separator':
case 'bracket-separator': {
const keyValueSep = options.arrayFormat === 'bracket-separator' ?
'[]=' :
'=';
return key => (result, value) => {
if (
value === undefined ||
(options.skipNull && value === null) ||
(options.skipEmptyString && value === '')
) {
return result;
}
// Translate null to an empty string so that it doesn't serialize as 'null'
value = value === null ? '' : value;
if (result.length === 0) {
return [[encode(key, options), keyValueSep, encode(value, options)].join('')];
}
return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
};
}
default:
return key => (result, value) => {
if (
value === undefined ||
(options.skipNull && value === null) ||
(options.skipEmptyString && value === '')
) {
return result;
}
if (value === null) {
return [...result, encode(key, options)];
}
return [...result, [encode(key, options), '=', encode(value, options)].join('')];
};
}
}
function parserForArrayFormat(options) {
let result;
switch (options.arrayFormat) {
case 'index':
return (key, value, accumulator) => {
result = /\[(\d*)\]$/.exec(key);
key = key.replace(/\[\d*\]$/, '');
if (!result) {
accumulator[key] = value;
return;
}
if (accumulator[key] === undefined) {
accumulator[key] = {};
}
accumulator[key][result[1]] = value;
};
case 'bracket':
return (key, value, accumulator) => {
result = /(\[\])$/.exec(key);
key = key.replace(/\[\]$/, '');
if (!result) {
accumulator[key] = value;
return;
}
if (accumulator[key] === undefined) {
accumulator[key] = [value];
return;
}
accumulator[key] = [].concat(accumulator[key], value);
};
case 'colon-list-separator':
return (key, value, accumulator) => {
result = /(:list)$/.exec(key);
key = key.replace(/:list$/, '');
if (!result) {
accumulator[key] = value;
return;
}
if (accumulator[key] === undefined) {
accumulator[key] = [value];
return;
}
accumulator[key] = [].concat(accumulator[key], value);
};
case 'comma':
case 'separator':
return (key, value, accumulator) => {
const isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator);
const isEncodedArray = (typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator));
value = isEncodedArray ? decode(value, options) : value;
const newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);
accumulator[key] = newValue;
};
case 'bracket-separator':
return (key, value, accumulator) => {
const isArray = /(\[\])$/.test(key);
key = key.replace(/\[\]$/, '');
if (!isArray) {
accumulator[key] = value ? decode(value, options) : value;
return;
}
const arrayValue = value === null ?
[] :
value.split(options.arrayFormatSeparator).map(item => decode(item, options));
if (accumulator[key] === undefined) {
accumulator[key] = arrayValue;
return;
}
accumulator[key] = [].concat(accumulator[key], arrayValue);
};
default:
return (key, value, accumulator) => {
if (accumulator[key] === undefined) {
accumulator[key] = value;
return;
}
accumulator[key] = [].concat(accumulator[key], value);
};
}
}
function validateArrayFormatSeparator(value) {
if (typeof value !== 'string' || value.length !== 1) {
throw new TypeError('arrayFormatSeparator must be single character string');
}
}
function encode(value, options) {
if (options.encode) {
return options.strict ? strictUriEncode(value) : encodeURIComponent(value);
}
return value;
}
function decode(value, options) {
if (options.decode) {
return decodeComponent(value);
}
return value;
}
function keysSorter(input) {
if (Array.isArray(input)) {
return input.sort();
}
if (typeof input === 'object') {
return keysSorter(Object.keys(input))
.sort((a, b) => Number(a) - Number(b))
.map(key => input[key]);
}
return input;
}
function removeHash(input) {
const hashStart = input.indexOf('#');
if (hashStart !== -1) {
input = input.slice(0, hashStart);
}
return input;
}
function getHash(url) {
let hash = '';
const hashStart = url.indexOf('#');
if (hashStart !== -1) {
hash = url.slice(hashStart);
}
return hash;
}
function extract(input) {
input = removeHash(input);
const queryStart = input.indexOf('?');
if (queryStart === -1) {
return '';
}
return input.slice(queryStart + 1);
}
function parseValue(value, options) {
if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {
value = Number(value);
} else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
value = value.toLowerCase() === 'true';
}
return value;
}
function parse(query, options) {
options = Object.assign({
decode: true,
sort: true,
arrayFormat: 'none',
arrayFormatSeparator: ',',
parseNumbers: false,
parseBooleans: false
}, options);
validateArrayFormatSeparator(options.arrayFormatSeparator);
const formatter = parserForArrayFormat(options);
// Create an object with no prototype
const ret = Object.create(null);
if (typeof query !== 'string') {
return ret;
}
query = query.trim().replace(/^[?#&]/, '');
if (!query) {
return ret;
}
for (const param of query.split('&')) {
if (param === '') {
continue;
}
let [key, value] = splitOnFirst(options.decode ? param.replace(/\+/g, ' ') : param, '=');
// Missing `=` should be `null`:
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
value = value === undefined ? null : ['comma', 'separator', 'bracket-separator'].includes(options.arrayFormat) ? value : decode(value, options);
formatter(decode(key, options), value, ret);
}
for (const key of Object.keys(ret)) {
const value = ret[key];
if (typeof value === 'object' && value !== null) {
for (const k of Object.keys(value)) {
value[k] = parseValue(value[k], options);
}
} else {
ret[key] = parseValue(value, options);
}
}
if (options.sort === false) {
return ret;
}
return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
const value = ret[key];
if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {
// Sort object keys, not values
result[key] = keysSorter(value);
} else {
result[key] = value;
}
return result;
}, Object.create(null));
}
exports.extract = extract;
exports.parse = parse;
exports.stringify = (object, options) => {
if (!object) {
return '';
}
options = Object.assign({
encode: true,
strict: true,
arrayFormat: 'none',
arrayFormatSeparator: ','
}, options);
validateArrayFormatSeparator(options.arrayFormatSeparator);
const shouldFilter = key => (
(options.skipNull && isNullOrUndefined(object[key])) ||
(options.skipEmptyString && object[key] === '')
);
const formatter = encoderForArrayFormat(options);
const objectCopy = {};
for (const key of Object.keys(object)) {
if (!shouldFilter(key)) {
objectCopy[key] = object[key];
}
}
const keys = Object.keys(objectCopy);
if (options.sort !== false) {
keys.sort(options.sort);
}
return keys.map(key => {
const value = object[key];
if (value === undefined) {
return '';
}
if (value === null) {
return encode(key, options);
}
if (Array.isArray(value)) {
if (value.length === 0 && options.arrayFormat === 'bracket-separator') {
return encode(key, options) + '[]';
}
return value
.reduce(formatter(key), [])
.join('&');
}
return encode(key, options) + '=' + encode(value, options);
}).filter(x => x.length > 0).join('&');
};
exports.parseUrl = (url, options) => {
options = Object.assign({
decode: true
}, options);
const [url_, hash] = splitOnFirst(url, '#');
return Object.assign(
{
url: url_.split('?')[0] || '',
query: parse(extract(url), options)
},
options && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {}
);
};
exports.stringifyUrl = (object, options) => {
options = Object.assign({
encode: true,
strict: true,
[encodeFragmentIdentifier]: true
}, options);
const url = removeHash(object.url).split('?')[0] || '';
const queryFromUrl = exports.extract(object.url);
const parsedQueryFromUrl = exports.parse(queryFromUrl, {sort: false});
const query = Object.assign(parsedQueryFromUrl, object.query);
let queryString = exports.stringify(query, options);
if (queryString) {
queryString = `?${queryString}`;
}
let hash = getHash(object.url);
if (object.fragmentIdentifier) {
hash = `#${options[encodeFragmentIdentifier] ? encode(object.fragmentIdentifier, options) : object.fragmentIdentifier}`;
}
return `${url}${queryString}${hash}`;
};
exports.pick = (input, filter, options) => {
options = Object.assign({
parseFragmentIdentifier: true,
[encodeFragmentIdentifier]: false
}, options);
const {url, query, fragmentIdentifier} = exports.parseUrl(input, options);
return exports.stringifyUrl({
url,
query: filterObject(query, filter),
fragmentIdentifier
}, options);
};
exports.exclude = (input, filter, options) => {
const exclusionFilter = Array.isArray(filter) ? key => !filter.includes(key) : (key, value) => !filter(key, value);
return exports.pick(input, exclusionFilter, options);
};
webpack://frontend-tpt/../../node_modules/raf/index.js
var now = require('performance-now')
, root = typeof window === 'undefined' ? global : window
, vendors = ['moz', 'webkit']
, suffix = 'AnimationFrame'
, raf = root['request' + suffix]
, caf = root['cancel' + suffix] || root['cancelRequest' + suffix]
for(var i = 0; !raf && i < vendors.length; i++) {
raf = root[vendors[i] + 'Request' + suffix]
caf = root[vendors[i] + 'Cancel' + suffix]
|| root[vendors[i] + 'CancelRequest' + suffix]
}
// Some versions of FF have rAF but not cAF
if(!raf || !caf) {
var last = 0
, id = 0
, queue = []
, frameDuration = 1000 / 60
raf = function(callback) {
if(queue.length === 0) {
var _now = now()
, next = Math.max(0, frameDuration - (_now - last))
last = next + _now
setTimeout(function() {
var cp = queue.slice(0)
// Clear queue here to prevent
// callbacks from appending listeners
// to the current frame's queue
queue.length = 0
for(var i = 0; i < cp.length; i++) {
if(!cp[i].cancelled) {
try{
cp[i].callback(last)
} catch(e) {
setTimeout(function() { throw e }, 0)
}
}
}
}, Math.round(next))
}
queue.push({
handle: ++id,
callback: callback,
cancelled: false
})
return id
}
caf = function(handle) {
for(var i = 0; i < queue.length; i++) {
if(queue[i].handle === handle) {
queue[i].cancelled = true
}
}
}
}
module.exports = function(fn) {
// Wrap in a new function to prevent
// `cancel` potentially being assigned
// to the native rAF function
return raf.call(root, fn)
}
module.exports.cancel = function() {
caf.apply(root, arguments)
}
module.exports.polyfill = function(object) {
if (!object) {
object = root;
}
object.requestAnimationFrame = raf
object.cancelAnimationFrame = caf
}
webpack://frontend-tpt/../../node_modules/react-collapse/lib/Collapse.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Collapse = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactMotion = require('react-motion');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _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; }
function _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; }
var SPRING_PRECISION = 1;
var WAITING = 'WAITING';
var RESIZING = 'RESIZING';
var RESTING = 'RESTING';
var IDLING = 'IDLING';
var noop = function noop() {
return null;
};
var css = {
collapse: 'ReactCollapse--collapse',
content: 'ReactCollapse--content'
};
var Collapse = exports.Collapse = function (_React$PureComponent) {
_inherits(Collapse, _React$PureComponent);
function Collapse(props) {
_classCallCheck(this, Collapse);
var _this = _possibleConstructorReturn(this, (Collapse.__proto__ || Object.getPrototypeOf(Collapse)).call(this, props));
_initialiseProps.call(_this);
_this.state = {
currentState: IDLING,
from: 0,
to: 0
};
return _this;
}
_createClass(Collapse, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _props = this.props,
isOpened = _props.isOpened,
forceInitialAnimation = _props.forceInitialAnimation,
onRest = _props.onRest;
if (isOpened) {
var to = this.getTo();
if (forceInitialAnimation) {
var from = this.wrapper.clientHeight;
this.setState({ currentState: RESIZING, from: from, to: to });
} else {
this.setState({ currentState: IDLING, from: to, to: to });
}
}
onRest();
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (nextProps.hasNestedCollapse) {
// For nested collapses we do not need to change to waiting state
// and should keep `height:auto`
// Because children will be animated and height will not jump anyway
// See https://github.com/nkbt/react-collapse/issues/76 for more details
if (nextProps.isOpened !== this.props.isOpened) {
// Still go to WAITING state if own isOpened was changed
this.setState({ currentState: WAITING });
}
} else if (this.state.currentState === IDLING && (nextProps.isOpened || this.props.isOpened)) {
this.setState({ currentState: WAITING });
}
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(_, prevState) {
var _props2 = this.props,
isOpened = _props2.isOpened,
onRest = _props2.onRest,
onMeasure = _props2.onMeasure;
if (this.state.currentState === IDLING) {
onRest();
return;
}
if (prevState.to !== this.state.to) {
onMeasure({ height: this.state.to, width: this.content.clientWidth });
}
var from = this.wrapper.clientHeight;
var to = isOpened ? this.getTo() : 0;
if (from !== to) {
this.setState({ currentState: RESIZING, from: from, to: to });
return;
}
if (this.state.currentState === RESTING || this.state.currentState === WAITING) {
this.setState({ currentState: IDLING, from: from, to: to });
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
cancelAnimationFrame(this.raf);
}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(_reactMotion.Motion, _extends({}, this.getMotionProps(), {
onRest: this.onRest,
children: this.renderContent }));
}
}]);
return Collapse;
}(_react2.default.PureComponent);
Collapse.propTypes = {
isOpened: _propTypes2.default.bool.isRequired,
springConfig: _propTypes2.default.objectOf(_propTypes2.default.number),
forceInitialAnimation: _propTypes2.default.bool,
hasNestedCollapse: _propTypes2.default.bool,
fixedHeight: _propTypes2.default.number,
theme: _propTypes2.default.objectOf(_propTypes2.default.string),
style: _propTypes2.default.object,
onRender: _propTypes2.default.func,
onRest: _propTypes2.default.func,
onMeasure: _propTypes2.default.func,
children: _propTypes2.default.node.isRequired
};
Collapse.defaultProps = {
forceInitialAnimation: false,
hasNestedCollapse: false,
fixedHeight: -1,
style: {},
theme: css,
onRender: noop,
onRest: noop,
onMeasure: noop
};
var _initialiseProps = function _initialiseProps() {
var _this2 = this;
this.onContentRef = function (content) {
_this2.content = content;
};
this.onWrapperRef = function (wrapper) {
_this2.wrapper = wrapper;
};
this.onRest = function () {
_this2.raf = requestAnimationFrame(_this2.setResting);
};
this.setResting = function () {
_this2.setState({ currentState: RESTING });
};
this.getTo = function () {
var fixedHeight = _this2.props.fixedHeight;
return fixedHeight > -1 ? fixedHeight : _this2.content.clientHeight;
};
this.getWrapperStyle = function (height) {
if (_this2.state.currentState === IDLING && _this2.state.to) {
var fixedHeight = _this2.props.fixedHeight;
if (fixedHeight > -1) {
return { overflow: 'hidden', height: fixedHeight };
}
return { height: 'auto' };
}
if (_this2.state.currentState === WAITING && !_this2.state.to) {
return { overflow: 'hidden', height: 0 };
}
return { overflow: 'hidden', height: Math.max(0, height) };
};
this.getMotionProps = function () {
var springConfig = _this2.props.springConfig;
return _this2.state.currentState === IDLING ? {
// When completely stable, instantly jump to the position
defaultStyle: { height: _this2.state.to },
style: { height: _this2.state.to }
} : {
// Otherwise, animate
defaultStyle: { height: _this2.state.from },
style: { height: (0, _reactMotion.spring)(_this2.state.to, _extends({ precision: SPRING_PRECISION }, springConfig)) }
};
};
this.renderContent = function (_ref) {
var height = _ref.height;
// eslint-disable-line
var _props3 = _this2.props,
_isOpened = _props3.isOpened,
_springConfig = _props3.springConfig,
_forceInitialAnimation = _props3.forceInitialAnimation,
_hasNestedCollapse = _props3.hasNestedCollapse,
_fixedHeight = _props3.fixedHeight,
theme = _props3.theme,
style = _props3.style,
onRender = _props3.onRender,
_onRest = _props3.onRest,
_onMeasure = _props3.onMeasure,
children = _props3.children,
props = _objectWithoutProperties(_props3, ['isOpened', 'springConfig', 'forceInitialAnimation', 'hasNestedCollapse', 'fixedHeight', 'theme', 'style', 'onRender', 'onRest', 'onMeasure', 'children']);
var _state = _this2.state,
from = _state.from,
to = _state.to;
// DANGEROUS, use with caution, never do setState with it
onRender({ current: height, from: from, to: to });
return _react2.default.createElement(
'div',
_extends({
ref: _this2.onWrapperRef,
className: theme.collapse,
style: _extends({}, _this2.getWrapperStyle(Math.max(0, height)), style)
}, props),
_react2.default.createElement(
'div',
{ ref: _this2.onContentRef, className: theme.content },
children
)
);
};
};
webpack://frontend-tpt/../../node_modules/react-collapse/lib/UnmountClosed.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UnmountClosed = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Collapse = require('./Collapse');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _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; }
function _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; }
var UnmountClosed = exports.UnmountClosed = function (_React$PureComponent) {
_inherits(UnmountClosed, _React$PureComponent);
function UnmountClosed(props) {
_classCallCheck(this, UnmountClosed);
var _this = _possibleConstructorReturn(this, (UnmountClosed.__proto__ || Object.getPrototypeOf(UnmountClosed)).call(this, props));
_this.componentWillReceiveProps = function (_ref) {
var isOpened = _ref.isOpened;
if (!_this.props.isOpened && isOpened) {
_this.setState({
forceInitialAnimation: true,
shouldUnmount: false
});
}
};
_this.onRest = function () {
var _this$props = _this.props,
isOpened = _this$props.isOpened,
onRest = _this$props.onRest;
if (!isOpened) {
_this.setState({ shouldUnmount: true });
}
if (onRest) {
onRest.apply(undefined, arguments);
}
};
_this.state = {
shouldUnmount: !_this.props.isOpened,
forceInitialAnimation: !_this.props.isOpened
};
return _this;
}
_createClass(UnmountClosed, [{
key: 'render',
value: function render() {
var _props = this.props,
isOpened = _props.isOpened,
_onRest = _props.onRest,
props = _objectWithoutProperties(_props, ['isOpened', 'onRest']);
var _state = this.state,
forceInitialAnimation = _state.forceInitialAnimation,
shouldUnmount = _state.shouldUnmount;
return shouldUnmount ? null : _react2.default.createElement(_Collapse.Collapse, _extends({
forceInitialAnimation: forceInitialAnimation,
isOpened: isOpened,
onRest: this.onRest
}, props));
}
}]);
return UnmountClosed;
}(_react2.default.PureComponent);
UnmountClosed.propTypes = {
isOpened: _propTypes2.default.bool.isRequired,
onRest: _propTypes2.default.func
};
webpack://frontend-tpt/../../node_modules/react-collapse/lib/index.js
'use strict';
var _require = require('./Collapse'),
Collapse = _require.Collapse;
var _require2 = require('./UnmountClosed'),
UnmountClosed = _require2.UnmountClosed;
UnmountClosed.Collapse = Collapse;
UnmountClosed.UnmountClosed = UnmountClosed;
module.exports = UnmountClosed;
webpack://frontend-tpt/../../node_modules/react-cookie/build/cookie.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.load = load;
exports.select = select;
exports.save = save;
exports.remove = remove;
exports.setRawCookie = setRawCookie;
exports.plugToRequest = plugToRequest;
var _cookie = require('cookie');
var _cookie2 = _interopRequireDefault(_cookie);
var _objectAssign = require('object-assign');
var _objectAssign2 = _interopRequireDefault(_objectAssign);
var _isNode = require('is-node');
var _isNode2 = _interopRequireDefault(_isNode);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _rawCookie = {};
var _res = undefined;
function _isResWritable() {
return _res && !_res.headersSent;
}
function load(name, doNotParse, opt) {
var cookies = _isNode2.default ? _rawCookie : _cookie2.default.parse(document.cookie, opt);
var cookieVal = cookies && cookies[name];
if (typeof doNotParse === 'undefined') {
doNotParse = !cookieVal || cookieVal[0] !== '{' && cookieVal[0] !== '[';
}
if (!doNotParse) {
try {
cookieVal = JSON.parse(cookieVal);
} catch (e) {
// Not serialized object
}
}
return cookieVal;
}
function select(regex) {
var cookies = _isNode2.default ? _rawCookie : _cookie2.default.parse(document.cookie);
if (!cookies) {
return {};
}
if (!regex) {
return cookies;
}
return Object.keys(cookies).reduce(function (accumulator, name) {
if (!regex.test(name)) {
return accumulator;
}
var newCookie = {};
newCookie[name] = cookies[name];
return (0, _objectAssign2.default)({}, accumulator, newCookie);
}, {});
}
function save(name, val, opt) {
_rawCookie[name] = val;
// allow you to work with cookies as objects.
if ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object') {
_rawCookie[name] = JSON.stringify(val);
}
// Cookies only work in the browser
if (!_isNode2.default) {
document.cookie = _cookie2.default.serialize(name, _rawCookie[name], opt);
}
if (_isResWritable() && _res.cookie) {
var expressOpt = _extends({}, opt);
if (expressOpt.maxAge) {
// the standard for maxAge is seconds but express uses milliseconds
expressOpt.maxAge = opt.maxAge * 1000;
}
_res.cookie(name, val, opt);
}
}
function remove(name, opt) {
delete _rawCookie[name];
if (typeof opt === 'undefined') {
opt = {};
} else if (typeof opt === 'string') {
// Will be deprecated in future versions
opt = { path: opt };
} else {
// Prevent mutation of opt below
opt = (0, _objectAssign2.default)({}, opt);
}
if (typeof document !== 'undefined') {
opt.expires = new Date(1970, 1, 1, 0, 0, 1);
opt.maxAge = 0;
document.cookie = _cookie2.default.serialize(name, '', opt);
}
if (_isResWritable() && _res.clearCookie) {
_res.clearCookie(name, opt);
}
}
function setRawCookie(rawCookie) {
if (rawCookie) {
_rawCookie = _cookie2.default.parse(rawCookie);
} else {
_rawCookie = {};
}
}
function plugToRequest(req, res) {
if (req.cookie) {
_rawCookie = req.cookie;
} else if (req.cookies) {
_rawCookie = req.cookies;
} else if (req.headers && req.headers.cookie) {
setRawCookie(req.headers.cookie);
} else {
_rawCookie = {};
}
_res = res;
return function unplug() {
_res = null;
_rawCookie = {};
};
}
exports.default = {
setRawCookie: setRawCookie,
load: load,
select: select,
save: save,
remove: remove,
plugToRequest: plugToRequest
};
webpack://frontend-tpt/../../node_modules/react-dom/cjs/react-dom.production.min.js
/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*
Modernizr 3.0.0pre (Custom Build) | MIT
*/
'use strict';var aa=require("react"),ca=require("scheduler");function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var da=new Set,ea={};function fa(a,b){ha(a,b);ha(a+"Capture",b)}
function ha(a,b){ea[a]=b;for(a=0;a<b.length;a++)da.add(b[a])}
var ia=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la=
{},ma={};function oa(a){if(ja.call(ma,a))return!0;if(ja.call(la,a))return!1;if(ka.test(a))return ma[a]=!0;la[a]=!0;return!1}function pa(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}
function qa(a,b,c,d){if(null===b||"undefined"===typeof b||pa(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});
["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});
["checked","multiple","muted","selected"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(ra,
sa);z[b]=new v(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});
z.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});
function ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2<b.length)||"o"!==b[0]&&"O"!==b[0]||"n"!==b[1]&&"N"!==b[1])qa(b,c,e,d)&&(c=null),d||null===e?oa(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c)))}
var ua=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va=Symbol.for("react.element"),wa=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),Ba=Symbol.for("react.provider"),Ca=Symbol.for("react.context"),Da=Symbol.for("react.forward_ref"),Ea=Symbol.for("react.suspense"),Fa=Symbol.for("react.suspense_list"),Ga=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");
var Ia=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Ja=Symbol.iterator;function Ka(a){if(null===a||"object"!==typeof a)return null;a=Ja&&a[Ja]||a["@@iterator"];return"function"===typeof a?a:null}var A=Object.assign,La;function Ma(a){if(void 0===La)try{throw Error();}catch(c){var b=c.stack.trim().match(/\n( *(at )?)/);La=b&&b[1]||""}return"\n"+La+a}var Na=!1;
function Oa(a,b){if(!a||Na)return"";Na=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error();},Object.defineProperty(b.prototype,"props",{set:function(){throw Error();}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(b,[])}catch(l){var d=l}Reflect.construct(a,[],b)}else{try{b.call()}catch(l){d=l}a.call(b.prototype)}else{try{throw Error();}catch(l){d=l}a()}}catch(l){if(l&&d&&"string"===typeof l.stack){for(var e=l.stack.split("\n"),
f=d.stack.split("\n"),g=e.length-1,h=f.length-1;1<=g&&0<=h&&e[g]!==f[h];)h--;for(;1<=g&&0<=h;g--,h--)if(e[g]!==f[h]){if(1!==g||1!==h){do if(g--,h--,0>h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?Ma(a):""}
function Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return""}}
function Qa(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||"Context")+".Consumer";case Ba:return(a._context.displayName||"Context")+".Provider";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||
b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||"Memo";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}
function Ra(a){var b=a.type;switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(b);case 8:return b===za?"StrictMode":"Mode";case 22:return"Offscreen";
case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Sa(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}}
function Ta(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}
function Ua(a){var b=Ta(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=
null;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Ta(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}
function Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,"checked",b,!1)}
function bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?cb(a,b.type,c):b.hasOwnProperty("defaultValue")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}
function db(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}
function cb(a,b,c){if("number"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}var eb=Array.isArray;
function fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=""+Sa(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}
function gb(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(p(91));return A({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function hb(a,b){var c=b.value;if(null==c){c=b.children;b=b.defaultValue;if(null!=c){if(null!=b)throw Error(p(92));if(eb(c)){if(1<c.length)throw Error(p(93));c=c[0]}b=c}null==b&&(b="");c=b}a._wrapperState={initialValue:Sa(c)}}
function ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&""!==b&&null!==b&&(a.value=b)}function kb(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}
function lb(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?kb(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}
var mb,nb=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if("http://www.w3.org/2000/svg"!==a.namespaceURI||"innerHTML"in a)a.innerHTML=b;else{mb=mb||document.createElement("div");mb.innerHTML="<svg>"+b.valueOf().toString()+"</svg>";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});
function ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}
var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,
zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(""+b).trim():b+"px"}
function sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=rb(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});
function ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if("object"!==typeof b.dangerouslySetInnerHTML||!("__html"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(p(62));}}
function vb(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;
function Bb(a){if(a=Cb(a)){if("function"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a<b.length;a++)Bb(b[a])}}function Gb(a,b){return a(b)}function Hb(){}var Ib=!1;function Jb(a,b,c){if(Ib)return a(b,c);Ib=!0;try{return Gb(a,b,c)}finally{if(Ib=!1,null!==zb||null!==Ab)Hb(),Fb()}}
function Kb(a,b){var c=a.stateNode;if(null===c)return null;var d=Db(c);if(null===d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&"function"!==
typeof c)throw Error(p(231,b,typeof c));return c}var Lb=!1;if(ia)try{var Mb={};Object.defineProperty(Mb,"passive",{get:function(){Lb=!0}});window.addEventListener("test",Mb,Mb);window.removeEventListener("test",Mb,Mb)}catch(a){Lb=!1}function Nb(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(m){this.onError(m)}}var Ob=!1,Pb=null,Qb=!1,Rb=null,Sb={onError:function(a){Ob=!0;Pb=a}};function Tb(a,b,c,d,e,f,g,h,k){Ob=!1;Pb=null;Nb.apply(Sb,arguments)}
function Ub(a,b,c,d,e,f,g,h,k){Tb.apply(this,arguments);if(Ob){if(Ob){var l=Pb;Ob=!1;Pb=null}else throw Error(p(198));Qb||(Qb=!0,Rb=l)}}function Vb(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.flags&4098)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function Wb(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function Xb(a){if(Vb(a)!==a)throw Error(p(188));}
function Yb(a){var b=a.alternate;if(!b){b=Vb(a);if(null===b)throw Error(p(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return Xb(e),a;if(f===d)return Xb(e),b;f=f.sibling}throw Error(p(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===
c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(p(189));}}if(c.alternate!==d)throw Error(p(190));}if(3!==c.tag)throw Error(p(188));return c.stateNode.current===c?a:b}function Zb(a){a=Yb(a);return null!==a?$b(a):null}function $b(a){if(5===a.tag||6===a.tag)return a;for(a=a.child;null!==a;){var b=$b(a);if(null!==b)return b;a=a.sibling}return null}
var ac=ca.unstable_scheduleCallback,bc=ca.unstable_cancelCallback,cc=ca.unstable_shouldYield,dc=ca.unstable_requestPaint,B=ca.unstable_now,ec=ca.unstable_getCurrentPriorityLevel,fc=ca.unstable_ImmediatePriority,gc=ca.unstable_UserBlockingPriority,hc=ca.unstable_NormalPriority,ic=ca.unstable_LowPriority,jc=ca.unstable_IdlePriority,kc=null,lc=null;function mc(a){if(lc&&"function"===typeof lc.onCommitFiberRoot)try{lc.onCommitFiberRoot(kc,a,void 0,128===(a.current.flags&128))}catch(b){}}
var oc=Math.clz32?Math.clz32:nc,pc=Math.log,qc=Math.LN2;function nc(a){a>>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;
function tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;
default:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0<b;)c=31-oc(b),e=1<<c,d|=a[c],b&=~e;return d}
function vc(a,b){switch(a){case 1:case 2:case 4:return b+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return b+5E3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}
function wc(a,b){for(var c=a.suspendedLanes,d=a.pingedLanes,e=a.expirationTimes,f=a.pendingLanes;0<f;){var g=31-oc(f),h=1<<g,k=e[g];if(-1===k){if(0===(h&c)||0!==(h&d))e[g]=vc(h,b)}else k<=b&&(a.expiredLanes|=h);f&=~h}}function xc(a){a=a.pendingLanes&-1073741825;return 0!==a?a:a&1073741824?1073741824:0}function yc(){var a=rc;rc<<=1;0===(rc&4194240)&&(rc=64);return a}function zc(a){for(var b=[],c=0;31>c;c++)b.push(a);return b}
function Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0<c;){var e=31-oc(c),f=1<<e;b[e]=0;d[e]=-1;a[e]=-1;c&=~f}}
function Cc(a,b){var c=a.entangledLanes|=b;for(a=a.entanglements;c;){var d=31-oc(c),e=1<<d;e&b|a[d]&b&&(a[d]|=b);c&=~e}}var C=0;function Dc(a){a&=-a;return 1<a?4<a?0!==(a&268435455)?16:536870912:4:1}var Ec,Fc,Gc,Hc,Ic,Jc=!1,Kc=[],Lc=null,Mc=null,Nc=null,Oc=new Map,Pc=new Map,Qc=[],Rc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
function Sc(a,b){switch(a){case "focusin":case "focusout":Lc=null;break;case "dragenter":case "dragleave":Mc=null;break;case "mouseover":case "mouseout":Nc=null;break;case "pointerover":case "pointerout":Oc.delete(b.pointerId);break;case "gotpointercapture":case "lostpointercapture":Pc.delete(b.pointerId)}}
function Tc(a,b,c,d,e,f){if(null===a||a.nativeEvent!==f)return a={blockedOn:b,domEventName:c,eventSystemFlags:d,nativeEvent:f,targetContainers:[e]},null!==b&&(b=Cb(b),null!==b&&Fc(b)),a;a.eventSystemFlags|=d;b=a.targetContainers;null!==e&&-1===b.indexOf(e)&&b.push(e);return a}
function Uc(a,b,c,d,e){switch(b){case "focusin":return Lc=Tc(Lc,a,b,c,d,e),!0;case "dragenter":return Mc=Tc(Mc,a,b,c,d,e),!0;case "mouseover":return Nc=Tc(Nc,a,b,c,d,e),!0;case "pointerover":var f=e.pointerId;Oc.set(f,Tc(Oc.get(f)||null,a,b,c,d,e));return!0;case "gotpointercapture":return f=e.pointerId,Pc.set(f,Tc(Pc.get(f)||null,a,b,c,d,e)),!0}return!1}
function Vc(a){var b=Wc(a.target);if(null!==b){var c=Vb(b);if(null!==c)if(b=c.tag,13===b){if(b=Wb(c),null!==b){a.blockedOn=b;Ic(a.priority,function(){Gc(c)});return}}else if(3===b&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null}
function Xc(a){if(null!==a.blockedOn)return!1;for(var b=a.targetContainers;0<b.length;){var c=Yc(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null===c){c=a.nativeEvent;var d=new c.constructor(c.type,c);wb=d;c.target.dispatchEvent(d);wb=null}else return b=Cb(c),null!==b&&Fc(b),a.blockedOn=c,!1;b.shift()}return!0}function Zc(a,b,c){Xc(a)&&c.delete(b)}function $c(){Jc=!1;null!==Lc&&Xc(Lc)&&(Lc=null);null!==Mc&&Xc(Mc)&&(Mc=null);null!==Nc&&Xc(Nc)&&(Nc=null);Oc.forEach(Zc);Pc.forEach(Zc)}
function ad(a,b){a.blockedOn===b&&(a.blockedOn=null,Jc||(Jc=!0,ca.unstable_scheduleCallback(ca.unstable_NormalPriority,$c)))}
function bd(a){function b(b){return ad(b,a)}if(0<Kc.length){ad(Kc[0],a);for(var c=1;c<Kc.length;c++){var d=Kc[c];d.blockedOn===a&&(d.blockedOn=null)}}null!==Lc&&ad(Lc,a);null!==Mc&&ad(Mc,a);null!==Nc&&ad(Nc,a);Oc.forEach(b);Pc.forEach(b);for(c=0;c<Qc.length;c++)d=Qc[c],d.blockedOn===a&&(d.blockedOn=null);for(;0<Qc.length&&(c=Qc[0],null===c.blockedOn);)Vc(c),null===c.blockedOn&&Qc.shift()}var cd=ua.ReactCurrentBatchConfig,dd=!0;
function ed(a,b,c,d){var e=C,f=cd.transition;cd.transition=null;try{C=1,fd(a,b,c,d)}finally{C=e,cd.transition=f}}function gd(a,b,c,d){var e=C,f=cd.transition;cd.transition=null;try{C=4,fd(a,b,c,d)}finally{C=e,cd.transition=f}}
function fd(a,b,c,d){if(dd){var e=Yc(a,b,c,d);if(null===e)hd(a,b,d,id,c),Sc(a,d);else if(Uc(e,a,b,c,d))d.stopPropagation();else if(Sc(a,d),b&4&&-1<Rc.indexOf(a)){for(;null!==e;){var f=Cb(e);null!==f&&Ec(f);f=Yc(a,b,c,d);null===f&&hd(a,b,d,id,c);if(f===e)break;e=f}null!==e&&d.stopPropagation()}else hd(a,b,d,null,c)}}var id=null;
function Yc(a,b,c,d){id=null;a=xb(d);a=Wc(a);if(null!==a)if(b=Vb(a),null===b)a=null;else if(c=b.tag,13===c){a=Wb(b);if(null!==a)return a;a=null}else if(3===c){if(b.stateNode.current.memoizedState.isDehydrated)return 3===b.tag?b.stateNode.containerInfo:null;a=null}else b!==a&&(a=null);id=a;return null}
function jd(a){switch(a){case "cancel":case "click":case "close":case "contextmenu":case "copy":case "cut":case "auxclick":case "dblclick":case "dragend":case "dragstart":case "drop":case "focusin":case "focusout":case "input":case "invalid":case "keydown":case "keypress":case "keyup":case "mousedown":case "mouseup":case "paste":case "pause":case "play":case "pointercancel":case "pointerdown":case "pointerup":case "ratechange":case "reset":case "resize":case "seeked":case "submit":case "touchcancel":case "touchend":case "touchstart":case "volumechange":case "change":case "selectionchange":case "textInput":case "compositionstart":case "compositionend":case "compositionupdate":case "beforeblur":case "afterblur":case "beforeinput":case "blur":case "fullscreenchange":case "focus":case "hashchange":case "popstate":case "select":case "selectstart":return 1;case "drag":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "mousemove":case "mouseout":case "mouseover":case "pointermove":case "pointerout":case "pointerover":case "scroll":case "toggle":case "touchmove":case "wheel":case "mouseenter":case "mouseleave":case "pointerenter":case "pointerleave":return 4;
case "message":switch(ec()){case fc:return 1;case gc:return 4;case hc:case ic:return 16;case jc:return 536870912;default:return 16}default:return 16}}var kd=null,ld=null,md=null;function nd(){if(md)return md;var a,b=ld,c=b.length,d,e="value"in kd?kd.value:kd.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return md=e.slice(a,1<d?1-d:void 0)}
function od(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function pd(){return!0}function qd(){return!1}
function rd(a){function b(b,d,e,f,g){this._reactName=b;this._targetInst=e;this.type=d;this.nativeEvent=f;this.target=g;this.currentTarget=null;for(var c in a)a.hasOwnProperty(c)&&(b=a[c],this[c]=b?b(f):f[c]);this.isDefaultPrevented=(null!=f.defaultPrevented?f.defaultPrevented:!1===f.returnValue)?pd:qd;this.isPropagationStopped=qd;return this}A(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&
(a.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd});return b}
var sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=A({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=A({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if("movementX"in
a)return a.movementX;a!==yd&&(yd&&"mousemove"===a.type?(wd=a.screenX-yd.screenX,xd=a.screenY-yd.screenY):xd=wd=0,yd=a);return wd},movementY:function(a){return"movementY"in a?a.movementY:xd}}),Bd=rd(Ad),Cd=A({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=A({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=A({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=A({},sd,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=A({},sd,{data:0}),Ld=rd(Kd),Md={Esc:"Escape",
Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",
119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pd(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Od[a])?!!b[a]:!1}function zd(){return Pd}
var Qd=A({},ud,{key:function(a){if(a.key){var b=Md[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=od(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?Nd[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(a){return"keypress"===a.type?od(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===
a.type?od(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),Rd=rd(Qd),Sd=A({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=A({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=A({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=A({},Ad,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},
deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae=ia&&"CompositionEvent"in window,be=null;ia&&"documentMode"in document&&(be=document.documentMode);var ce=ia&&"TextEvent"in window&&!be,de=ia&&(!ae||be&&8<be&&11>=be),ee=String.fromCharCode(32),fe=!1;
function ge(a,b){switch(a){case "keyup":return-1!==$d.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "focusout":return!0;default:return!1}}function he(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case "compositionend":return he(b);case "keypress":if(32!==b.which)return null;fe=!0;return ee;case "textInput":return a=b.data,a===ee&&fe?null:a;default:return null}}
function ke(a,b){if(ie)return"compositionend"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case "compositionend":return de&&"ko"!==b.locale?null:b.data;default:return null}}
var le={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!le[a.type]:"textarea"===b?!0:!1}function ne(a,b,c,d){Eb(d);b=oe(b,"onChange");0<b.length&&(c=new td("onChange","change",null,c,d),a.push({event:c,listeners:b}))}var pe=null,qe=null;function re(a){se(a,0)}function te(a){var b=ue(a);if(Wa(b))return a}
function ve(a,b){if("change"===a)return b}var we=!1;if(ia){var xe;if(ia){var ye="oninput"in document;if(!ye){var ze=document.createElement("div");ze.setAttribute("oninput","return;");ye="function"===typeof ze.oninput}xe=ye}else xe=!1;we=xe&&(!document.documentMode||9<document.documentMode)}function Ae(){pe&&(pe.detachEvent("onpropertychange",Be),qe=pe=null)}function Be(a){if("value"===a.propertyName&&te(qe)){var b=[];ne(b,qe,a,xb(a));Jb(re,b)}}
function Ce(a,b,c){"focusin"===a?(Ae(),pe=b,qe=c,pe.attachEvent("onpropertychange",Be)):"focusout"===a&&Ae()}function De(a){if("selectionchange"===a||"keyup"===a||"keydown"===a)return te(qe)}function Ee(a,b){if("click"===a)return te(b)}function Fe(a,b){if("input"===a||"change"===a)return te(b)}function Ge(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var He="function"===typeof Object.is?Object.is:Ge;
function Ie(a,b){if(He(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var e=c[d];if(!ja.call(b,e)||!He(a[e],b[e]))return!1}return!0}function Je(a){for(;a&&a.firstChild;)a=a.firstChild;return a}
function Ke(a,b){var c=Je(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}
function Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}
function Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,
d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c<b.length;c++)a=b[c],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}
var Pe=ia&&"documentMode"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;
function Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,"selectionStart"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,"onSelect"),0<d.length&&(b=new td("onSelect","select",null,b,c),a.push({event:b,listeners:d}),b.target=Qe)))}
function Ve(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var We={animationend:Ve("Animation","AnimationEnd"),animationiteration:Ve("Animation","AnimationIteration"),animationstart:Ve("Animation","AnimationStart"),transitionend:Ve("Transition","TransitionEnd")},Xe={},Ye={};
ia&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete We.animationend.animation,delete We.animationiteration.animation,delete We.animationstart.animation),"TransitionEvent"in window||delete We.transitionend.transition);function Ze(a){if(Xe[a])return Xe[a];if(!We[a])return a;var b=We[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Ye)return Xe[a]=b[c];return a}var $e=Ze("animationend"),af=Ze("animationiteration"),bf=Ze("animationstart"),cf=Ze("transitionend"),df=new Map,ef="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");
function ff(a,b){df.set(a,b);fa(b,[a])}for(var gf=0;gf<ef.length;gf++){var hf=ef[gf],jf=hf.toLowerCase(),kf=hf[0].toUpperCase()+hf.slice(1);ff(jf,"on"+kf)}ff($e,"onAnimationEnd");ff(af,"onAnimationIteration");ff(bf,"onAnimationStart");ff("dblclick","onDoubleClick");ff("focusin","onFocus");ff("focusout","onBlur");ff(cf,"onTransitionEnd");ha("onMouseEnter",["mouseout","mouseover"]);ha("onMouseLeave",["mouseout","mouseover"]);ha("onPointerEnter",["pointerout","pointerover"]);
ha("onPointerLeave",["pointerout","pointerover"]);fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));
fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mf=new Set("cancel close invalid load scroll toggle".split(" ").concat(lf));
function nf(a,b,c){var d=a.type||"unknown-event";a.currentTarget=c;Ub(d,b,void 0,a);a.currentTarget=null}
function se(a,b){b=0!==(b&4);for(var c=0;c<a.length;c++){var d=a[c],e=d.event;d=d.listeners;a:{var f=void 0;if(b)for(var g=d.length-1;0<=g;g--){var h=d[g],k=h.instance,l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;nf(e,h,l);f=k}else for(g=0;g<d.length;g++){h=d[g];k=h.instance;l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;nf(e,h,l);f=k}}}if(Qb)throw a=Rb,Qb=!1,Rb=null,a;}
function D(a,b){var c=b[of];void 0===c&&(c=b[of]=new Set);var d=a+"__bubble";c.has(d)||(pf(b,a,2,!1),c.add(d))}function qf(a,b,c){var d=0;b&&(d|=4);pf(c,a,d,b)}var rf="_reactListening"+Math.random().toString(36).slice(2);function sf(a){if(!a[rf]){a[rf]=!0;da.forEach(function(b){"selectionchange"!==b&&(mf.has(b)||qf(b,!1,a),qf(b,!0,a))});var b=9===a.nodeType?a:a.ownerDocument;null===b||b[rf]||(b[rf]=!0,qf("selectionchange",!1,b))}}
function pf(a,b,c,d){switch(jd(b)){case 1:var e=ed;break;case 4:e=gd;break;default:e=fd}c=e.bind(null,b,c,a);e=void 0;!Lb||"touchstart"!==b&&"touchmove"!==b&&"wheel"!==b||(e=!0);d?void 0!==e?a.addEventListener(b,c,{capture:!0,passive:e}):a.addEventListener(b,c,!0):void 0!==e?a.addEventListener(b,c,{passive:e}):a.addEventListener(b,c,!1)}
function hd(a,b,c,d,e){var f=d;if(0===(b&1)&&0===(b&2)&&null!==d)a:for(;;){if(null===d)return;var g=d.tag;if(3===g||4===g){var h=d.stateNode.containerInfo;if(h===e||8===h.nodeType&&h.parentNode===e)break;if(4===g)for(g=d.return;null!==g;){var k=g.tag;if(3===k||4===k)if(k=g.stateNode.containerInfo,k===e||8===k.nodeType&&k.parentNode===e)return;g=g.return}for(;null!==h;){g=Wc(h);if(null===g)return;k=g.tag;if(5===k||6===k){d=f=g;continue a}h=h.parentNode}}d=d.return}Jb(function(){var d=f,e=xb(c),g=[];
a:{var h=df.get(a);if(void 0!==h){var k=td,n=a;switch(a){case "keypress":if(0===od(c))break a;case "keydown":case "keyup":k=Rd;break;case "focusin":n="focus";k=Fd;break;case "focusout":n="blur";k=Fd;break;case "beforeblur":case "afterblur":k=Fd;break;case "click":if(2===c.button)break a;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":k=Bd;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":k=
Dd;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":k=Vd;break;case $e:case af:case bf:k=Hd;break;case cf:k=Xd;break;case "scroll":k=vd;break;case "wheel":k=Zd;break;case "copy":case "cut":case "paste":k=Jd;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":k=Td}var t=0!==(b&4),J=!t&&"scroll"===a,x=t?null!==h?h+"Capture":null:h;t=[];for(var w=d,u;null!==
w;){u=w;var F=u.stateNode;5===u.tag&&null!==F&&(u=F,null!==x&&(F=Kb(w,x),null!=F&&t.push(tf(w,F,u))));if(J)break;w=w.return}0<t.length&&(h=new k(h,n,null,c,e),g.push({event:h,listeners:t}))}}if(0===(b&7)){a:{h="mouseover"===a||"pointerover"===a;k="mouseout"===a||"pointerout"===a;if(h&&c!==wb&&(n=c.relatedTarget||c.fromElement)&&(Wc(n)||n[uf]))break a;if(k||h){h=e.window===e?e:(h=e.ownerDocument)?h.defaultView||h.parentWindow:window;if(k){if(n=c.relatedTarget||c.toElement,k=d,n=n?Wc(n):null,null!==
n&&(J=Vb(n),n!==J||5!==n.tag&&6!==n.tag))n=null}else k=null,n=d;if(k!==n){t=Bd;F="onMouseLeave";x="onMouseEnter";w="mouse";if("pointerout"===a||"pointerover"===a)t=Td,F="onPointerLeave",x="onPointerEnter",w="pointer";J=null==k?h:ue(k);u=null==n?h:ue(n);h=new t(F,w+"leave",k,c,e);h.target=J;h.relatedTarget=u;F=null;Wc(e)===d&&(t=new t(x,w+"enter",n,c,e),t.target=u,t.relatedTarget=J,F=t);J=F;if(k&&n)b:{t=k;x=n;w=0;for(u=t;u;u=vf(u))w++;u=0;for(F=x;F;F=vf(F))u++;for(;0<w-u;)t=vf(t),w--;for(;0<u-w;)x=
vf(x),u--;for(;w--;){if(t===x||null!==x&&t===x.alternate)break b;t=vf(t);x=vf(x)}t=null}else t=null;null!==k&&wf(g,h,k,t,!1);null!==n&&null!==J&&wf(g,J,n,t,!0)}}}a:{h=d?ue(d):window;k=h.nodeName&&h.nodeName.toLowerCase();if("select"===k||"input"===k&&"file"===h.type)var na=ve;else if(me(h))if(we)na=Fe;else{na=De;var xa=Ce}else(k=h.nodeName)&&"input"===k.toLowerCase()&&("checkbox"===h.type||"radio"===h.type)&&(na=Ee);if(na&&(na=na(a,d))){ne(g,na,c,e);break a}xa&&xa(a,h,d);"focusout"===a&&(xa=h._wrapperState)&&
xa.controlled&&"number"===h.type&&cb(h,"number",h.value)}xa=d?ue(d):window;switch(a){case "focusin":if(me(xa)||"true"===xa.contentEditable)Qe=xa,Re=d,Se=null;break;case "focusout":Se=Re=Qe=null;break;case "mousedown":Te=!0;break;case "contextmenu":case "mouseup":case "dragend":Te=!1;Ue(g,c,e);break;case "selectionchange":if(Pe)break;case "keydown":case "keyup":Ue(g,c,e)}var $a;if(ae)b:{switch(a){case "compositionstart":var ba="onCompositionStart";break b;case "compositionend":ba="onCompositionEnd";
break b;case "compositionupdate":ba="onCompositionUpdate";break b}ba=void 0}else ie?ge(a,c)&&(ba="onCompositionEnd"):"keydown"===a&&229===c.keyCode&&(ba="onCompositionStart");ba&&(de&&"ko"!==c.locale&&(ie||"onCompositionStart"!==ba?"onCompositionEnd"===ba&&ie&&($a=nd()):(kd=e,ld="value"in kd?kd.value:kd.textContent,ie=!0)),xa=oe(d,ba),0<xa.length&&(ba=new Ld(ba,a,null,c,e),g.push({event:ba,listeners:xa}),$a?ba.data=$a:($a=he(c),null!==$a&&(ba.data=$a))));if($a=ce?je(a,c):ke(a,c))d=oe(d,"onBeforeInput"),
0<d.length&&(e=new Ld("onBeforeInput","beforeinput",null,c,e),g.push({event:e,listeners:d}),e.data=$a)}se(g,b)})}function tf(a,b,c){return{instance:a,listener:b,currentTarget:c}}function oe(a,b){for(var c=b+"Capture",d=[];null!==a;){var e=a,f=e.stateNode;5===e.tag&&null!==f&&(e=f,f=Kb(a,c),null!=f&&d.unshift(tf(a,f,e)),f=Kb(a,b),null!=f&&d.push(tf(a,f,e)));a=a.return}return d}function vf(a){if(null===a)return null;do a=a.return;while(a&&5!==a.tag);return a?a:null}
function wf(a,b,c,d,e){for(var f=b._reactName,g=[];null!==c&&c!==d;){var h=c,k=h.alternate,l=h.stateNode;if(null!==k&&k===d)break;5===h.tag&&null!==l&&(h=l,e?(k=Kb(c,f),null!=k&&g.unshift(tf(c,k,h))):e||(k=Kb(c,f),null!=k&&g.push(tf(c,k,h))));c=c.return}0!==g.length&&a.push({event:b,listeners:g})}var xf=/\r\n?/g,yf=/\u0000|\uFFFD/g;function zf(a){return("string"===typeof a?a:""+a).replace(xf,"\n").replace(yf,"")}function Af(a,b,c){b=zf(b);if(zf(a)!==b&&c)throw Error(p(425));}function Bf(){}
var Cf=null,Df=null;function Ef(a,b){return"textarea"===a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}
var Ff="function"===typeof setTimeout?setTimeout:void 0,Gf="function"===typeof clearTimeout?clearTimeout:void 0,Hf="function"===typeof Promise?Promise:void 0,Jf="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof Hf?function(a){return Hf.resolve(null).then(a).catch(If)}:Ff;function If(a){setTimeout(function(){throw a;})}
function Kf(a,b){var c=b,d=0;do{var e=c.nextSibling;a.removeChild(c);if(e&&8===e.nodeType)if(c=e.data,"/$"===c){if(0===d){a.removeChild(e);bd(b);return}d--}else"$"!==c&&"$?"!==c&&"$!"!==c||d++;c=e}while(c);bd(b)}function Lf(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break;if(8===b){b=a.data;if("$"===b||"$!"===b||"$?"===b)break;if("/$"===b)return null}}return a}
function Mf(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if("$"===c||"$!"===c||"$?"===c){if(0===b)return a;b--}else"/$"===c&&b++}a=a.previousSibling}return null}var Nf=Math.random().toString(36).slice(2),Of="__reactFiber$"+Nf,Pf="__reactProps$"+Nf,uf="__reactContainer$"+Nf,of="__reactEvents$"+Nf,Qf="__reactListeners$"+Nf,Rf="__reactHandles$"+Nf;
function Wc(a){var b=a[Of];if(b)return b;for(var c=a.parentNode;c;){if(b=c[uf]||c[Of]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=Mf(a);null!==a;){if(c=a[Of])return c;a=Mf(a)}return b}a=c;c=a.parentNode}return null}function Cb(a){a=a[Of]||a[uf];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function ue(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(p(33));}function Db(a){return a[Pf]||null}var Sf=[],Tf=-1;function Uf(a){return{current:a}}
function E(a){0>Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}
function Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||"Unknown",e));return A({},c,d)}
function cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}
function jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a<c.length;a++){var d=c[a];do d=d(!0);while(null!==d)}eg=null;fg=!1}catch(e){throw null!==eg&&(eg=eg.slice(a+1)),ac(fc,jg),e;}finally{C=b,gg=!1}}return null}var kg=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(a,b){kg[lg++]=ng;kg[lg++]=mg;mg=a;ng=b}
function ug(a,b,c){og[pg++]=rg;og[pg++]=sg;og[pg++]=qg;qg=a;var d=rg;a=sg;var e=32-oc(d)-1;d&=~(1<<e);c+=1;var f=32-oc(b)+e;if(30<f){var g=e-e%5;f=(d&(1<<g)-1).toString(32);d>>=g;e-=g;rg=1<<32-oc(b)+e|c<<e|d;sg=f+a}else rg=1<<f|c<<e|d,sg=a}function vg(a){null!==a.return&&(tg(a,1),ug(a,1,0))}function wg(a){for(;a===mg;)mg=kg[--lg],kg[lg]=null,ng=kg[--lg],kg[lg]=null;for(;a===qg;)qg=og[--pg],og[pg]=null,sg=og[--pg],og[pg]=null,rg=og[--pg],og[pg]=null}var xg=null,yg=null,I=!1,zg=null;
function Ag(a,b){var c=Bg(5,null,null,0);c.elementType="DELETED";c.stateNode=b;c.return=a;b=a.deletions;null===b?(a.deletions=[c],a.flags|=16):b.push(c)}
function Cg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,xg=a,yg=Lf(b.firstChild),!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,xg=a,yg=null,!0):!1;case 13:return b=8!==b.nodeType?null:b,null!==b?(c=null!==qg?{id:rg,overflow:sg}:null,a.memoizedState={dehydrated:b,treeContext:c,retryLane:1073741824},c=Bg(18,null,null,0),c.stateNode=b,c.return=a,a.child=c,xg=a,yg=
null,!0):!1;default:return!1}}function Dg(a){return 0!==(a.mode&1)&&0===(a.flags&128)}function Eg(a){if(I){var b=yg;if(b){var c=b;if(!Cg(a,b)){if(Dg(a))throw Error(p(418));b=Lf(c.nextSibling);var d=xg;b&&Cg(a,b)?Ag(d,c):(a.flags=a.flags&-4097|2,I=!1,xg=a)}}else{if(Dg(a))throw Error(p(418));a.flags=a.flags&-4097|2;I=!1;xg=a}}}function Fg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;xg=a}
function Gg(a){if(a!==xg)return!1;if(!I)return Fg(a),I=!0,!1;var b;(b=3!==a.tag)&&!(b=5!==a.tag)&&(b=a.type,b="head"!==b&&"body"!==b&&!Ef(a.type,a.memoizedProps));if(b&&(b=yg)){if(Dg(a))throw Hg(),Error(p(418));for(;b;)Ag(a,b),b=Lf(b.nextSibling)}Fg(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(p(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if("/$"===c){if(0===b){yg=Lf(a.nextSibling);break a}b--}else"$"!==c&&"$!"!==c&&"$?"!==c||b++}a=a.nextSibling}yg=
null}}else yg=xg?Lf(a.stateNode.nextSibling):null;return!0}function Hg(){for(var a=yg;a;)a=Lf(a.nextSibling)}function Ig(){yg=xg=null;I=!1}function Jg(a){null===zg?zg=[a]:zg.push(a)}var Kg=ua.ReactCurrentBatchConfig;function Lg(a,b){if(a&&a.defaultProps){b=A({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}var Mg=Uf(null),Ng=null,Og=null,Pg=null;function Qg(){Pg=Og=Ng=null}function Rg(a){var b=Mg.current;E(Mg);a._currentValue=b}
function Sg(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}function Tg(a,b){Ng=a;Pg=Og=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(Ug=!0),a.firstContext=null)}
function Vg(a){var b=a._currentValue;if(Pg!==a)if(a={context:a,memoizedValue:b,next:null},null===Og){if(null===Ng)throw Error(p(308));Og=a;Ng.dependencies={lanes:0,firstContext:a}}else Og=Og.next=a;return b}var Wg=null;function Xg(a){null===Wg?Wg=[a]:Wg.push(a)}function Yg(a,b,c,d){var e=b.interleaved;null===e?(c.next=c,Xg(b)):(c.next=e.next,e.next=c);b.interleaved=c;return Zg(a,d)}
function Zg(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}var $g=!1;function ah(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}
function bh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ch(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}
function dh(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(K&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return Zg(a,c)}e=d.interleaved;null===e?(b.next=b,Xg(d)):(b.next=e.next,e.next=b);d.interleaved=b;return Zg(a,c)}function eh(a,b,c){b=b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}
function fh(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=
b;c.lastBaseUpdate=b}
function gh(a,b,c,d){var e=a.updateQueue;$g=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var m=a.alternate;null!==m&&(m=m.updateQueue,h=m.lastBaseUpdate,h!==g&&(null===h?m.firstBaseUpdate=l:h.next=l,m.lastBaseUpdate=k))}if(null!==f){var q=e.baseState;g=0;m=l=k=null;h=f;do{var r=h.lane,y=h.eventTime;if((d&r)===r){null!==m&&(m=m.next={eventTime:y,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,
next:null});a:{var n=a,t=h;r=b;y=c;switch(t.tag){case 1:n=t.payload;if("function"===typeof n){q=n.call(y,q,r);break a}q=n;break a;case 3:n.flags=n.flags&-65537|128;case 0:n=t.payload;r="function"===typeof n?n.call(y,q,r):n;if(null===r||void 0===r)break a;q=A({},q,r);break a;case 2:$g=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,r=e.effects,null===r?e.effects=[h]:r.push(h))}else y={eventTime:y,lane:r,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===m?(l=m=y,k=q):m=m.next=y,g|=r;
h=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else r=h,h=r.next,r.next=null,e.lastBaseUpdate=r,e.shared.pending=null}while(1);null===m&&(k=q);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=m;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);hh|=g;a.lanes=g;a.memoizedState=q}}
function ih(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;b<a.length;b++){var d=a[b],e=d.callback;if(null!==e){d.callback=null;d=c;if("function"!==typeof e)throw Error(p(191,e));e.call(d)}}}var jh=(new aa.Component).refs;function kh(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:A({},b,c);a.memoizedState=c;0===a.lanes&&(a.updateQueue.baseState=c)}
var nh={isMounted:function(a){return(a=a._reactInternals)?Vb(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternals;var d=L(),e=lh(a),f=ch(d,e);f.payload=b;void 0!==c&&null!==c&&(f.callback=c);b=dh(a,f,e);null!==b&&(mh(b,a,e,d),eh(b,a,e))},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=L(),e=lh(a),f=ch(d,e);f.tag=1;f.payload=b;void 0!==c&&null!==c&&(f.callback=c);b=dh(a,f,e);null!==b&&(mh(b,a,e,d),eh(b,a,e))},enqueueForceUpdate:function(a,b){a=a._reactInternals;var c=L(),d=
lh(a),e=ch(c,d);e.tag=2;void 0!==b&&null!==b&&(e.callback=b);b=dh(a,e,d);null!==b&&(mh(b,a,d,c),eh(b,a,d))}};function oh(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!Ie(c,d)||!Ie(e,f):!0}
function ph(a,b,c){var d=!1,e=Vf;var f=b.contextType;"object"===typeof f&&null!==f?f=Vg(f):(e=Zf(b)?Xf:H.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Yf(a,e):Vf);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=nh;a.stateNode=b;b._reactInternals=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}
function qh(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&nh.enqueueReplaceState(b,b.state,null)}
function rh(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=jh;ah(a);var f=b.contextType;"object"===typeof f&&null!==f?e.context=Vg(f):(f=Zf(b)?Xf:H.current,e.context=Yf(a,f));e.state=a.memoizedState;f=b.getDerivedStateFromProps;"function"===typeof f&&(kh(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&"function"!==typeof e.componentWillMount||(b=e.state,
"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&nh.enqueueReplaceState(e,e.state,null),gh(a,c,e,d),e.state=a.memoizedState);"function"===typeof e.componentDidMount&&(a.flags|=4194308)}
function sh(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!==c.tag)throw Error(p(309));var d=c.stateNode}if(!d)throw Error(p(147,a));var e=d,f=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===f)return b.ref;b=function(a){var b=e.refs;b===jh&&(b=e.refs={});null===a?delete b[f]:b[f]=a};b._stringRef=f;return b}if("string"!==typeof a)throw Error(p(284));if(!c._owner)throw Error(p(290,a));}return a}
function th(a,b){a=Object.prototype.toString.call(b);throw Error(p(31,"[object Object]"===a?"object with keys {"+Object.keys(b).join(", ")+"}":a));}function uh(a){var b=a._init;return b(a._payload)}
function vh(a){function b(b,c){if(a){var d=b.deletions;null===d?(b.deletions=[c],b.flags|=16):d.push(c)}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b){a=wh(a,b);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return b.flags|=1048576,c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.flags|=2,c):d;b.flags|=2;return c}function g(b){a&&
null===b.alternate&&(b.flags|=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=xh(c,a.mode,d),b.return=a,b;b=e(b,c);b.return=a;return b}function k(a,b,c,d){var f=c.type;if(f===ya)return m(a,b,c.props.children,d,c.key);if(null!==b&&(b.elementType===f||"object"===typeof f&&null!==f&&f.$$typeof===Ha&&uh(f)===b.type))return d=e(b,c.props),d.ref=sh(a,b,c),d.return=a,d;d=yh(c.type,c.key,c.props,null,a.mode,d);d.ref=sh(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||
b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return b=zh(c,a.mode,d),b.return=a,b;b=e(b,c.children||[]);b.return=a;return b}function m(a,b,c,d,f){if(null===b||7!==b.tag)return b=Ah(c,a.mode,d,f),b.return=a,b;b=e(b,c);b.return=a;return b}function q(a,b,c){if("string"===typeof b&&""!==b||"number"===typeof b)return b=xh(""+b,a.mode,c),b.return=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case va:return c=yh(b.type,b.key,b.props,null,a.mode,c),
c.ref=sh(a,null,b),c.return=a,c;case wa:return b=zh(b,a.mode,c),b.return=a,b;case Ha:var d=b._init;return q(a,d(b._payload),c)}if(eb(b)||Ka(b))return b=Ah(b,a.mode,c,null),b.return=a,b;th(a,b)}return null}function r(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c&&""!==c||"number"===typeof c)return null!==e?null:h(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case va:return c.key===e?k(a,b,c,d):null;case wa:return c.key===e?l(a,b,c,d):null;case Ha:return e=c._init,r(a,
b,e(c._payload),d)}if(eb(c)||Ka(c))return null!==e?null:m(a,b,c,d,null);th(a,c)}return null}function y(a,b,c,d,e){if("string"===typeof d&&""!==d||"number"===typeof d)return a=a.get(c)||null,h(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case va:return a=a.get(null===d.key?c:d.key)||null,k(b,a,d,e);case wa:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e);case Ha:var f=d._init;return y(a,b,c,f(d._payload),e)}if(eb(d)||Ka(d))return a=a.get(c)||null,m(b,a,d,e,null);th(b,d)}return null}
function n(e,g,h,k){for(var l=null,m=null,u=g,w=g=0,x=null;null!==u&&w<h.length;w++){u.index>w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;w<h.length;w++)u=q(e,h[w],k),null!==u&&(g=f(u,g,w),null===m?l=u:m.sibling=u,m=u);I&&tg(e,w);return l}for(u=d(e,u);w<h.length;w++)x=y(u,e,w,h[w],k),null!==x&&(a&&null!==x.alternate&&u.delete(null===
x.key?w:x.key),g=f(x,g,w),null===m?l=x:m.sibling=x,m=x);a&&u.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function t(e,g,h,k){var l=Ka(h);if("function"!==typeof l)throw Error(p(150));h=l.call(h);if(null==h)throw Error(p(151));for(var u=l=null,m=g,w=g=0,x=null,n=h.next();null!==m&&!n.done;w++,n=h.next()){m.index>w?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,
m),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){"object"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=
f.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==
d;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):
(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}
function Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);
function Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];
function Oh(){for(var a=0;a<Nh.length;a++)Nh[a]._workInProgressVersionPrimary=null;Nh.length=0}var Ph=ua.ReactCurrentDispatcher,Qh=ua.ReactCurrentBatchConfig,Rh=0,N=null,O=null,P=null,Sh=!1,Th=!1,Uh=0,Vh=0;function Q(){throw Error(p(321));}function Wh(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!He(a[c],b[c]))return!1;return!0}
function Xh(a,b,c,d,e,f){Rh=f;N=b;b.memoizedState=null;b.updateQueue=null;b.lanes=0;Ph.current=null===a||null===a.memoizedState?Yh:Zh;a=c(d,e);if(Th){f=0;do{Th=!1;Uh=0;if(25<=f)throw Error(p(301));f+=1;P=O=null;b.updateQueue=null;Ph.current=$h;a=c(d,e)}while(Th)}Ph.current=ai;b=null!==O&&null!==O.next;Rh=0;P=O=N=null;Sh=!1;if(b)throw Error(p(300));return a}function bi(){var a=0!==Uh;Uh=0;return a}
function ci(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===P?N.memoizedState=P=a:P=P.next=a;return P}function di(){if(null===O){var a=N.alternate;a=null!==a?a.memoizedState:null}else a=O.next;var b=null===P?N.memoizedState:P.next;if(null!==b)P=b,O=a;else{if(null===a)throw Error(p(310));O=a;a={memoizedState:O.memoizedState,baseState:O.baseState,baseQueue:O.baseQueue,queue:O.queue,next:null};null===P?N.memoizedState=P=a:P=P.next=a}return P}
function ei(a,b){return"function"===typeof b?b(a):b}
function fi(a){var b=di(),c=b.queue;if(null===c)throw Error(p(311));c.lastRenderedReducer=a;var d=O,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){f=e.next;d=d.baseState;var h=g=null,k=null,l=f;do{var m=l.lane;if((Rh&m)===m)null!==k&&(k=k.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),d=l.hasEagerState?l.eagerState:a(d,l.action);else{var q={lane:m,action:l.action,hasEagerState:l.hasEagerState,
eagerState:l.eagerState,next:null};null===k?(h=k=q,g=d):k=k.next=q;N.lanes|=m;hh|=m}l=l.next}while(null!==l&&l!==f);null===k?g=d:k.next=h;He(d,b.memoizedState)||(Ug=!0);b.memoizedState=d;b.baseState=g;b.baseQueue=k;c.lastRenderedState=d}a=c.interleaved;if(null!==a){e=a;do f=e.lane,N.lanes|=f,hh|=f,e=e.next;while(e!==a)}else null===e&&(c.lanes=0);return[b.memoizedState,c.dispatch]}
function gi(a){var b=di(),c=b.queue;if(null===c)throw Error(p(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(Ug=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}function hi(){}
function ii(a,b){var c=N,d=di(),e=b(),f=!He(d.memoizedState,e);f&&(d.memoizedState=e,Ug=!0);d=d.queue;ji(ki.bind(null,c,d,a),[a]);if(d.getSnapshot!==b||f||null!==P&&P.memoizedState.tag&1){c.flags|=2048;li(9,mi.bind(null,c,d,e,b),void 0,null);if(null===R)throw Error(p(349));0!==(Rh&30)||ni(c,b,e)}return e}function ni(a,b,c){a.flags|=16384;a={getSnapshot:b,value:c};b=N.updateQueue;null===b?(b={lastEffect:null,stores:null},N.updateQueue=b,b.stores=[a]):(c=b.stores,null===c?b.stores=[a]:c.push(a))}
function mi(a,b,c,d){b.value=c;b.getSnapshot=d;oi(b)&&pi(a)}function ki(a,b,c){return c(function(){oi(b)&&pi(a)})}function oi(a){var b=a.getSnapshot;a=a.value;try{var c=b();return!He(a,c)}catch(d){return!0}}function pi(a){var b=Zg(a,1);null!==b&&mh(b,a,1,-1)}
function qi(a){var b=ci();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ei,lastRenderedState:a};b.queue=a;a=a.dispatch=ri.bind(null,N,a);return[b.memoizedState,a]}
function li(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=N.updateQueue;null===b?(b={lastEffect:null,stores:null},N.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}function si(){return di().memoizedState}function ti(a,b,c,d){var e=ci();N.flags|=a;e.memoizedState=li(1|b,c,void 0,void 0===d?null:d)}
function ui(a,b,c,d){var e=di();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;f=g.destroy;if(null!==d&&Wh(d,g.deps)){e.memoizedState=li(b,c,f,d);return}}N.flags|=a;e.memoizedState=li(1|b,c,f,d)}function vi(a,b){return ti(8390656,8,a,b)}function ji(a,b){return ui(2048,8,a,b)}function wi(a,b){return ui(4,2,a,b)}function xi(a,b){return ui(4,4,a,b)}
function yi(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function zi(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ui(4,4,yi.bind(null,b,a),c)}function Ai(){}function Bi(a,b){var c=di();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Wh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}
function Ci(a,b){var c=di();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Wh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}function Di(a,b,c){if(0===(Rh&21))return a.baseState&&(a.baseState=!1,Ug=!0),a.memoizedState=c;He(c,b)||(c=yc(),N.lanes|=c,hh|=c,a.baseState=!0);return b}function Ei(a,b){var c=C;C=0!==c&&4>c?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}
function Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}
function ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}
function Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}
var ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,
4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=
ci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,
f,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=":"+b+"R"+c;c=Uh++;0<c&&(b+="H"+c.toString(32));b+=":"}else c=Vh++,b=":"+b+"r"+c.toString(32)+":";return a.memoizedState=b},unstable_isNewReconciler:!1},Zh={readContext:Vg,useCallback:Bi,useContext:Vg,useEffect:ji,useImperativeHandle:zi,useInsertionEffect:wi,useLayoutEffect:xi,useMemo:Ci,useReducer:fi,useRef:si,useState:function(){return fi(ei)},
useDebugValue:Ai,useDeferredValue:function(a){var b=di();return Di(b,O.memoizedState,a)},useTransition:function(){var a=fi(ei)[0],b=di().memoizedState;return[a,b]},useMutableSource:hi,useSyncExternalStore:ii,useId:Fi,unstable_isNewReconciler:!1},$h={readContext:Vg,useCallback:Bi,useContext:Vg,useEffect:ji,useImperativeHandle:zi,useInsertionEffect:wi,useLayoutEffect:xi,useMemo:Ci,useReducer:gi,useRef:si,useState:function(){return gi(ei)},useDebugValue:Ai,useDeferredValue:function(a){var b=di();return null===
O?b.memoizedState=a:Di(b,O.memoizedState,a)},useTransition:function(){var a=gi(ei)[0],b=di().memoizedState;return[a,b]},useMutableSource:hi,useSyncExternalStore:ii,useId:Fi,unstable_isNewReconciler:!1};function Ki(a,b){try{var c="",d=b;do c+=Pa(d),d=d.return;while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+"\n"+f.stack}return{value:a,source:b,stack:e,digest:null}}function Li(a,b,c){return{value:a,source:null,stack:null!=c?c:null,digest:null!=b?b:null}}
function Mi(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}var Ni="function"===typeof WeakMap?WeakMap:Map;function Oi(a,b,c){c=ch(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Pi||(Pi=!0,Qi=d);Mi(a,b)};return c}
function Ri(a,b,c){c=ch(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)};c.callback=function(){Mi(a,b)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){Mi(a,b);"function"!==typeof d&&(null===Si?Si=new Set([this]):Si.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}
function Ti(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new Ni;var e=new Set;d.set(b,e)}else e=d.get(b),void 0===e&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=Ui.bind(null,a,b,c),b.then(a,a))}function Vi(a){do{var b;if(b=13===a.tag)b=a.memoizedState,b=null!==b?null!==b.dehydrated?!0:!1:!0;if(b)return a;a=a.return}while(null!==a);return null}
function Wi(a,b,c,d,e){if(0===(a.mode&1))return a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:(b=ch(-1,1),b.tag=2,dh(c,b,1))),c.lanes|=1),a;a.flags|=65536;a.lanes=e;return a}var Xi=ua.ReactCurrentOwner,Ug=!1;function Yi(a,b,c,d){b.child=null===a?Ch(b,null,c,d):Bh(b,a.child,c,d)}
function Zi(a,b,c,d,e){c=c.render;var f=b.ref;Tg(b,e);d=Xh(a,b,c,d,f,e);c=bi();if(null!==a&&!Ug)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,$i(a,b,e);I&&c&&vg(b);b.flags|=1;Yi(a,b,d,e);return b.child}
function aj(a,b,c,d,e){if(null===a){var f=c.type;if("function"===typeof f&&!bj(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,cj(a,b,f,d,e);a=yh(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:Ie;if(c(g,d)&&a.ref===b.ref)return $i(a,b,e)}b.flags|=1;a=wh(f,d);a.ref=b.ref;a.return=b;return b.child=a}
function cj(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(Ie(f,d)&&a.ref===b.ref)if(Ug=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(Ug=!0);else return b.lanes=a.lanes,$i(a,b,e)}return dj(a,b,c,d,e)}
function ej(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(fj,gj),gj|=c;else{if(0===(c&1073741824))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,G(fj,gj),gj|=a,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null};d=null!==f?f.baseLanes:c;G(fj,gj);gj|=d}else null!==
f?(d=f.baseLanes|c,b.memoizedState=null):d=c,G(fj,gj),gj|=d;Yi(a,b,e,c);return b.child}function hj(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function dj(a,b,c,d,e){var f=Zf(c)?Xf:H.current;f=Yf(b,f);Tg(b,e);c=Xh(a,b,c,d,f,e);d=bi();if(null!==a&&!Ug)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,$i(a,b,e);I&&d&&vg(b);b.flags|=1;Yi(a,b,c,e);return b.child}
function ij(a,b,c,d,e){if(Zf(c)){var f=!0;cg(b)}else f=!1;Tg(b,e);if(null===b.stateNode)jj(a,b),ph(b,c,d),rh(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"===typeof l&&null!==l?l=Vg(l):(l=Zf(c)?Xf:H.current,l=Yf(b,l));var m=c.getDerivedStateFromProps,q="function"===typeof m||"function"===typeof g.getSnapshotBeforeUpdate;q||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||
(h!==d||k!==l)&&qh(b,g,d,l);$g=!1;var r=b.memoizedState;g.state=r;gh(b,d,g,e);k=b.memoizedState;h!==d||r!==k||Wf.current||$g?("function"===typeof m&&(kh(b,c,m,d),k=b.memoizedState),(h=$g||oh(b,c,h,d,r,k,l))?(q||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount||("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4194308)):
("function"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;bh(a,b);h=b.memoizedProps;l=b.type===b.elementType?h:Lg(b.type,h);g.props=l;q=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=Vg(k):(k=Zf(c)?Xf:H.current,k=Yf(b,k));var y=c.getDerivedStateFromProps;(m="function"===typeof y||"function"===typeof g.getSnapshotBeforeUpdate)||
"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==q||r!==k)&&qh(b,g,d,k);$g=!1;r=b.memoizedState;g.state=r;gh(b,d,g,e);var n=b.memoizedState;h!==q||r!==n||Wf.current||$g?("function"===typeof y&&(kh(b,c,y,d),n=b.memoizedState),(l=$g||oh(b,c,l,d,r,n,k)||!1)?(m||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,n,k),"function"===typeof g.UNSAFE_componentWillUpdate&&
g.UNSAFE_componentWillUpdate(d,n,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=n),g.props=d,g.state=n,g.context=k,d=l):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===
a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return kj(a,b,c,d,f,e)}
function kj(a,b,c,d,e,f){hj(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&dg(b,c,!1),$i(a,b,f);d=b.stateNode;Xi.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Bh(b,a.child,null,f),b.child=Bh(b,null,h,f)):Yi(a,b,h,f);b.memoizedState=d.state;e&&dg(b,c,!0);return b.child}function lj(a){var b=a.stateNode;b.pendingContext?ag(a,b.pendingContext,b.pendingContext!==b.context):b.context&&ag(a,b.context,!1);Ih(a,b.containerInfo)}
function mj(a,b,c,d,e){Ig();Jg(e);b.flags|=256;Yi(a,b,c,d);return b.child}var nj={dehydrated:null,treeContext:null,retryLane:0};function oj(a){return{baseLanes:a,cachePool:null,transitions:null}}
function pj(a,b,c){var d=b.pendingProps,e=M.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;G(M,e&1);if(null===a){Eg(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:"$!"===a.data?b.lanes=8:b.lanes=1073741824,null;g=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,g={mode:"hidden",children:g},0===(d&1)&&null!==f?(f.childLanes=0,f.pendingProps=
g):f=qj(g,d,0,null),a=Ah(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=oj(c),b.memoizedState=nj,a):rj(b,g)}e=a.memoizedState;if(null!==e&&(h=e.dehydrated,null!==h))return sj(a,b,g,d,h,e,c);if(f){f=d.fallback;g=b.mode;e=a.child;h=e.sibling;var k={mode:"hidden",children:d.children};0===(g&1)&&b.child!==e?(d=b.child,d.childLanes=0,d.pendingProps=k,b.deletions=null):(d=wh(e,k),d.subtreeFlags=e.subtreeFlags&14680064);null!==h?f=wh(h,f):(f=Ah(f,g,c,null),f.flags|=2);f.return=
b;d.return=b;d.sibling=f;b.child=d;d=f;f=b.child;g=a.child.memoizedState;g=null===g?oj(c):{baseLanes:g.baseLanes|c,cachePool:null,transitions:g.transitions};f.memoizedState=g;f.childLanes=a.childLanes&~c;b.memoizedState=nj;return d}f=a.child;a=f.sibling;d=wh(f,{mode:"visible",children:d.children});0===(b.mode&1)&&(d.lanes=c);d.return=b;d.sibling=null;null!==a&&(c=b.deletions,null===c?(b.deletions=[a],b.flags|=16):c.push(a));b.child=d;b.memoizedState=null;return d}
function rj(a,b){b=qj({mode:"visible",children:b},a.mode,0,null);b.return=a;return a.child=b}function tj(a,b,c,d){null!==d&&Jg(d);Bh(b,a.child,null,c);a=rj(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a}
function sj(a,b,c,d,e,f,g){if(c){if(b.flags&256)return b.flags&=-257,d=Li(Error(p(422))),tj(a,b,g,d);if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=qj({mode:"visible",children:d.children},e,0,null);f=Ah(f,e,g,null);f.flags|=2;d.return=b;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&Bh(b,a.child,null,g);b.child.memoizedState=oj(g);b.memoizedState=nj;return f}if(0===(b.mode&1))return tj(a,b,g,null);if("$!"===e.data){d=e.nextSibling&&e.nextSibling.dataset;
if(d)var h=d.dgst;d=h;f=Error(p(419));d=Li(f,d,void 0);return tj(a,b,g,d)}h=0!==(g&a.childLanes);if(Ug||h){d=R;if(null!==d){switch(g&-g){case 4:e=2;break;case 16:e=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:e=32;break;case 536870912:e=268435456;break;default:e=0}e=0!==(e&(d.suspendedLanes|g))?0:e;
0!==e&&e!==f.retryLane&&(f.retryLane=e,Zg(a,e),mh(d,a,e,-1))}uj();d=Li(Error(p(421)));return tj(a,b,g,d)}if("$?"===e.data)return b.flags|=128,b.child=a.child,b=vj.bind(null,a),e._reactRetry=b,null;a=f.treeContext;yg=Lf(e.nextSibling);xg=b;I=!0;zg=null;null!==a&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=a.id,sg=a.overflow,qg=b);b=rj(b,d.children);b.flags|=4096;return b}function wj(a,b,c){a.lanes|=b;var d=a.alternate;null!==d&&(d.lanes|=b);Sg(a.return,b,c)}
function xj(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}
function yj(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;Yi(a,b,d.children,c);d=M.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&wj(a,c,b);else if(19===a.tag)wj(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}G(M,d);if(0===(b.mode&1))b.memoizedState=
null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===Mh(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);xj(b,!1,e,c,f);break;case "backwards":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===Mh(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}xj(b,!0,c,null,f);break;case "together":xj(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}
function jj(a,b){0===(b.mode&1)&&null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2)}function $i(a,b,c){null!==a&&(b.dependencies=a.dependencies);hh|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(p(153));if(null!==b.child){a=b.child;c=wh(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=wh(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}
function zj(a,b,c){switch(b.tag){case 3:lj(b);Ig();break;case 5:Kh(b);break;case 1:Zf(b.type)&&cg(b);break;case 4:Ih(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;G(Mg,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return G(M,M.current&1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return pj(a,b,c);G(M,M.current&1);a=$i(a,b,c);return null!==a?a.sibling:null}G(M,M.current&1);break;case 19:d=0!==(c&
b.childLanes);if(0!==(a.flags&128)){if(d)return yj(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);G(M,M.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,ej(a,b,c)}return $i(a,b,c)}var Aj,Bj,Cj,Dj;
Aj=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};Bj=function(){};
Cj=function(a,b,c,d){var e=a.memoizedProps;if(e!==d){a=b.stateNode;Hh(Eh.current);var f=null;switch(c){case "input":e=Ya(a,e);d=Ya(a,d);f=[];break;case "select":e=A({},e,{value:void 0});d=A({},d,{value:void 0});f=[];break;case "textarea":e=gb(a,e);d=gb(a,d);f=[];break;default:"function"!==typeof e.onClick&&"function"===typeof d.onClick&&(a.onclick=Bf)}ub(c,d);var g;c=null;for(l in e)if(!d.hasOwnProperty(l)&&e.hasOwnProperty(l)&&null!=e[l])if("style"===l){var h=e[l];for(g in h)h.hasOwnProperty(g)&&
(c||(c={}),c[g]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(ea.hasOwnProperty(l)?f||(f=[]):(f=f||[]).push(l,null));for(l in d){var k=d[l];h=null!=e?e[l]:void 0;if(d.hasOwnProperty(l)&&k!==h&&(null!=k||null!=h))if("style"===l)if(h){for(g in h)!h.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(c||(c={}),c[g]="");for(g in k)k.hasOwnProperty(g)&&h[g]!==k[g]&&(c||(c={}),c[g]=k[g])}else c||(f||(f=[]),f.push(l,
c)),c=k;else"dangerouslySetInnerHTML"===l?(k=k?k.__html:void 0,h=h?h.__html:void 0,null!=k&&h!==k&&(f=f||[]).push(l,k)):"children"===l?"string"!==typeof k&&"number"!==typeof k||(f=f||[]).push(l,""+k):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(ea.hasOwnProperty(l)?(null!=k&&"onScroll"===l&&D("scroll",a),f||h===k||(f=[])):(f=f||[]).push(l,k))}c&&(f=f||[]).push("style",c);var l=f;if(b.updateQueue=l)b.flags|=4}};Dj=function(a,b,c,d){c!==d&&(b.flags|=4)};
function Ej(a,b){if(!I)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}
function S(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags&14680064,d|=e.flags&14680064,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;a.subtreeFlags|=d;a.childLanes=c;return b}
function Fj(a,b,c){var d=b.pendingProps;wg(b);switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S(b),null;case 1:return Zf(b.type)&&$f(),S(b),null;case 3:d=b.stateNode;Jh();E(Wf);E(H);Oh();d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)Gg(b)?b.flags|=4:null===a||a.memoizedState.isDehydrated&&0===(b.flags&256)||(b.flags|=1024,null!==zg&&(Gj(zg),zg=null));Bj(a,b);S(b);return null;case 5:Lh(b);var e=Hh(Gh.current);
c=b.type;if(null!==a&&null!=b.stateNode)Cj(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(p(166));S(b);return null}a=Hh(Eh.current);if(Gg(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Of]=b;d[Pf]=f;a=0!==(b.mode&1);switch(c){case "dialog":D("cancel",d);D("close",d);break;case "iframe":case "object":case "embed":D("load",d);break;case "video":case "audio":for(e=0;e<lf.length;e++)D(lf[e],d);break;case "source":D("error",d);break;case "img":case "image":case "link":D("error",
d);D("load",d);break;case "details":D("toggle",d);break;case "input":Za(d,f);D("invalid",d);break;case "select":d._wrapperState={wasMultiple:!!f.multiple};D("invalid",d);break;case "textarea":hb(d,f),D("invalid",d)}ub(c,f);e=null;for(var g in f)if(f.hasOwnProperty(g)){var h=f[g];"children"===g?"string"===typeof h?d.textContent!==h&&(!0!==f.suppressHydrationWarning&&Af(d.textContent,h,a),e=["children",h]):"number"===typeof h&&d.textContent!==""+h&&(!0!==f.suppressHydrationWarning&&Af(d.textContent,
h,a),e=["children",""+h]):ea.hasOwnProperty(g)&&null!=h&&"onScroll"===g&&D("scroll",d)}switch(c){case "input":Va(d);db(d,f,!0);break;case "textarea":Va(d);jb(d);break;case "select":case "option":break;default:"function"===typeof f.onClick&&(d.onclick=Bf)}d=e;b.updateQueue=d;null!==d&&(b.flags|=4)}else{g=9===e.nodeType?e:e.ownerDocument;"http://www.w3.org/1999/xhtml"===a&&(a=kb(c));"http://www.w3.org/1999/xhtml"===a?"script"===c?(a=g.createElement("div"),a.innerHTML="<script>\x3c/script>",a=a.removeChild(a.firstChild)):
"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case "dialog":D("cancel",a);D("close",a);e=d;break;case "iframe":case "object":case "embed":D("load",a);e=d;break;case "video":case "audio":for(e=0;e<lf.length;e++)D(lf[e],a);e=d;break;case "source":D("error",a);e=d;break;case "img":case "image":case "link":D("error",
a);D("load",a);e=d;break;case "details":D("toggle",a);e=d;break;case "input":Za(a,d);e=Ya(a,d);D("invalid",a);break;case "option":e=d;break;case "select":a._wrapperState={wasMultiple:!!d.multiple};e=A({},d,{value:void 0});D("invalid",a);break;case "textarea":hb(a,d);e=gb(a,d);D("invalid",a);break;default:e=d}ub(c,e);h=e;for(f in h)if(h.hasOwnProperty(f)){var k=h[f];"style"===f?sb(a,k):"dangerouslySetInnerHTML"===f?(k=k?k.__html:void 0,null!=k&&nb(a,k)):"children"===f?"string"===typeof k?("textarea"!==
c||""!==k)&&ob(a,k):"number"===typeof k&&ob(a,""+k):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(ea.hasOwnProperty(f)?null!=k&&"onScroll"===f&&D("scroll",a):null!=k&&ta(a,f,k,g))}switch(c){case "input":Va(a);db(a,d,!1);break;case "textarea":Va(a);jb(a);break;case "option":null!=d.value&&a.setAttribute("value",""+Sa(d.value));break;case "select":a.multiple=!!d.multiple;f=d.value;null!=f?fb(a,!!d.multiple,f,!1):null!=d.defaultValue&&fb(a,!!d.multiple,d.defaultValue,
!0);break;default:"function"===typeof e.onClick&&(a.onclick=Bf)}switch(c){case "button":case "input":case "select":case "textarea":d=!!d.autoFocus;break a;case "img":d=!0;break a;default:d=!1}}d&&(b.flags|=4)}null!==b.ref&&(b.flags|=512,b.flags|=2097152)}S(b);return null;case 6:if(a&&null!=b.stateNode)Dj(a,b,a.memoizedProps,d);else{if("string"!==typeof d&&null===b.stateNode)throw Error(p(166));c=Hh(Gh.current);Hh(Eh.current);if(Gg(b)){d=b.stateNode;c=b.memoizedProps;d[Of]=b;if(f=d.nodeValue!==c)if(a=
xg,null!==a)switch(a.tag){case 3:Af(d.nodeValue,c,0!==(a.mode&1));break;case 5:!0!==a.memoizedProps.suppressHydrationWarning&&Af(d.nodeValue,c,0!==(a.mode&1))}f&&(b.flags|=4)}else d=(9===c.nodeType?c:c.ownerDocument).createTextNode(d),d[Of]=b,b.stateNode=d}S(b);return null;case 13:E(M);d=b.memoizedState;if(null===a||null!==a.memoizedState&&null!==a.memoizedState.dehydrated){if(I&&null!==yg&&0!==(b.mode&1)&&0===(b.flags&128))Hg(),Ig(),b.flags|=98560,f=!1;else if(f=Gg(b),null!==d&&null!==d.dehydrated){if(null===
a){if(!f)throw Error(p(318));f=b.memoizedState;f=null!==f?f.dehydrated:null;if(!f)throw Error(p(317));f[Of]=b}else Ig(),0===(b.flags&128)&&(b.memoizedState=null),b.flags|=4;S(b);f=!1}else null!==zg&&(Gj(zg),zg=null),f=!0;if(!f)return b.flags&65536?b:null}if(0!==(b.flags&128))return b.lanes=c,b;d=null!==d;d!==(null!==a&&null!==a.memoizedState)&&d&&(b.child.flags|=8192,0!==(b.mode&1)&&(null===a||0!==(M.current&1)?0===T&&(T=3):uj()));null!==b.updateQueue&&(b.flags|=4);S(b);return null;case 4:return Jh(),
Bj(a,b),null===a&&sf(b.stateNode.containerInfo),S(b),null;case 10:return Rg(b.type._context),S(b),null;case 17:return Zf(b.type)&&$f(),S(b),null;case 19:E(M);f=b.memoizedState;if(null===f)return S(b),null;d=0!==(b.flags&128);g=f.rendering;if(null===g)if(d)Ej(f,!1);else{if(0!==T||null!==a&&0!==(a.flags&128))for(a=b.child;null!==a;){g=Mh(a);if(null!==g){b.flags|=128;Ej(f,!1);d=g.updateQueue;null!==d&&(b.updateQueue=d,b.flags|=4);b.subtreeFlags=0;d=c;for(c=b.child;null!==c;)f=c,a=d,f.flags&=14680066,
g=f.alternate,null===g?(f.childLanes=0,f.lanes=a,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=g.childLanes,f.lanes=g.lanes,f.child=g.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=g.memoizedProps,f.memoizedState=g.memoizedState,f.updateQueue=g.updateQueue,f.type=g.type,a=g.dependencies,f.dependencies=null===a?null:{lanes:a.lanes,firstContext:a.firstContext}),c=c.sibling;G(M,M.current&1|2);return b.child}a=
a.sibling}null!==f.tail&&B()>Hj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=
b,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}
function Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),
null;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj="function"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;
function Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=
q.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;
case 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent="":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}
function Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}}
function Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}
function Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}
function Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}
function Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}
function ak(a,b,c){if(lc&&"function"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;
Zj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==
c.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}
function dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;d<c.length;d++){var e=c[d];try{var f=a,g=b,h=g;a:for(;null!==h;){switch(h.tag){case 5:X=h.stateNode;Yj=!1;break a;case 3:X=h.stateNode.containerInfo;Yj=!0;break a;case 4:X=h.stateNode.containerInfo;Yj=!0;break a}h=h.return}if(null===X)throw Error(p(160));ak(f,g,e);X=null;Yj=!1;var k=e.alternate;null!==k&&(k.return=null);e.return=null}catch(l){W(e,b,l)}}if(b.subtreeFlags&12854)for(b=b.child;null!==b;)ek(b,a),b=b.sibling}
function ek(a,b){var c=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:dk(b,a);fk(a);if(d&4){try{Qj(3,a,a.return),Rj(3,a)}catch(t){W(a,a.return,t)}try{Qj(5,a,a.return)}catch(t){W(a,a.return,t)}}break;case 1:dk(b,a);fk(a);d&512&&null!==c&&Mj(c,c.return);break;case 5:dk(b,a);fk(a);d&512&&null!==c&&Mj(c,c.return);if(a.flags&32){var e=a.stateNode;try{ob(e,"")}catch(t){W(a,a.return,t)}}if(d&4&&(e=a.stateNode,null!=e)){var f=a.memoizedProps,g=null!==c?c.memoizedProps:f,h=a.type,k=a.updateQueue;
a.updateQueue=null;if(null!==k)try{"input"===h&&"radio"===f.type&&null!=f.name&&ab(e,f);vb(h,g);var l=vb(h,f);for(g=0;g<k.length;g+=2){var m=k[g],q=k[g+1];"style"===m?sb(e,q):"dangerouslySetInnerHTML"===m?nb(e,q):"children"===m?ob(e,q):ta(e,m,q,l)}switch(h){case "input":bb(e,f);break;case "textarea":ib(e,f);break;case "select":var r=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=!!f.multiple;var y=f.value;null!=y?fb(e,!!f.multiple,y,!1):r!==!!f.multiple&&(null!=f.defaultValue?fb(e,!!f.multiple,
f.defaultValue,!0):fb(e,!!f.multiple,f.multiple?[]:"",!1))}e[Pf]=f}catch(t){W(a,a.return,t)}}break;case 6:dk(b,a);fk(a);if(d&4){if(null===a.stateNode)throw Error(p(162));e=a.stateNode;f=a.memoizedProps;try{e.nodeValue=f}catch(t){W(a,a.return,t)}}break;case 3:dk(b,a);fk(a);if(d&4&&null!==c&&c.memoizedState.isDehydrated)try{bd(b.containerInfo)}catch(t){W(a,a.return,t)}break;case 4:dk(b,a);fk(a);break;case 13:dk(b,a);fk(a);e=a.child;e.flags&8192&&(f=null!==e.memoizedState,e.stateNode.isHidden=f,!f||
null!==e.alternate&&null!==e.alternate.memoizedState||(gk=B()));d&4&&bk(a);break;case 22:m=null!==c&&null!==c.memoizedState;a.mode&1?(U=(l=U)||m,dk(b,a),U=l):dk(b,a);fk(a);if(d&8192){l=null!==a.memoizedState;if((a.stateNode.isHidden=l)&&!m&&0!==(a.mode&1))for(V=a,m=a.child;null!==m;){for(q=V=m;null!==V;){r=V;y=r.child;switch(r.tag){case 0:case 11:case 14:case 15:Qj(4,r,r.return);break;case 1:Mj(r,r.return);var n=r.stateNode;if("function"===typeof n.componentWillUnmount){d=r;c=r.return;try{b=d,n.props=
b.memoizedProps,n.state=b.memoizedState,n.componentWillUnmount()}catch(t){W(d,c,t)}}break;case 5:Mj(r,r.return);break;case 22:if(null!==r.memoizedState){hk(q);continue}}null!==y?(y.return=r,V=y):hk(q)}m=m.sibling}a:for(m=null,q=a;;){if(5===q.tag){if(null===m){m=q;try{e=q.stateNode,l?(f=e.style,"function"===typeof f.setProperty?f.setProperty("display","none","important"):f.display="none"):(h=q.stateNode,k=q.memoizedProps.style,g=void 0!==k&&null!==k&&k.hasOwnProperty("display")?k.display:null,h.style.display=
rb("display",g))}catch(t){W(a,a.return,t)}}}else if(6===q.tag){if(null===m)try{q.stateNode.nodeValue=l?"":q.memoizedProps}catch(t){W(a,a.return,t)}}else if((22!==q.tag&&23!==q.tag||null===q.memoizedState||q===a)&&null!==q.child){q.child.return=q;q=q.child;continue}if(q===a)break a;for(;null===q.sibling;){if(null===q.return||q.return===a)break a;m===q&&(m=null);q=q.return}m===q&&(m=null);q.sibling.return=q.return;q=q.sibling}}break;case 19:dk(b,a);fk(a);d&4&&bk(a);break;case 21:break;default:dk(b,
a),fk(a)}}function fk(a){var b=a.flags;if(b&2){try{a:{for(var c=a.return;null!==c;){if(Uj(c)){var d=c;break a}c=c.return}throw Error(p(160));}switch(d.tag){case 5:var e=d.stateNode;d.flags&32&&(ob(e,""),d.flags&=-33);var f=Vj(a);Xj(a,f,e);break;case 3:case 4:var g=d.stateNode.containerInfo,h=Vj(a);Wj(a,h,g);break;default:throw Error(p(161));}}catch(k){W(a,a.return,k)}a.flags&=-3}b&4096&&(a.flags&=-4097)}function ik(a,b,c){V=a;jk(a,b,c)}
function jk(a,b,c){for(var d=0!==(a.mode&1);null!==V;){var e=V,f=e.child;if(22===e.tag&&d){var g=null!==e.memoizedState||Kj;if(!g){var h=e.alternate,k=null!==h&&null!==h.memoizedState||U;h=Kj;var l=U;Kj=g;if((U=k)&&!l)for(V=e;null!==V;)g=V,k=g.child,22===g.tag&&null!==g.memoizedState?kk(e):null!==k?(k.return=g,V=k):kk(e);for(;null!==f;)V=f,jk(f,b,c),f=f.sibling;V=e;Kj=h;U=l}lk(a,b,c)}else 0!==(e.subtreeFlags&8772)&&null!==f?(f.return=e,V=f):lk(a,b,c)}}
function lk(a){for(;null!==V;){var b=V;if(0!==(b.flags&8772)){var c=b.alternate;try{if(0!==(b.flags&8772))switch(b.tag){case 0:case 11:case 15:U||Rj(5,b);break;case 1:var d=b.stateNode;if(b.flags&4&&!U)if(null===c)d.componentDidMount();else{var e=b.elementType===b.type?c.memoizedProps:Lg(b.type,c.memoizedProps);d.componentDidUpdate(e,c.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var f=b.updateQueue;null!==f&&ih(b,f,d);break;case 3:var g=b.updateQueue;if(null!==g){c=null;if(null!==b.child)switch(b.child.tag){case 5:c=
b.child.stateNode;break;case 1:c=b.child.stateNode}ih(b,g,c)}break;case 5:var h=b.stateNode;if(null===c&&b.flags&4){c=h;var k=b.memoizedProps;switch(b.type){case "button":case "input":case "select":case "textarea":k.autoFocus&&c.focus();break;case "img":k.src&&(c.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(null===b.memoizedState){var l=b.alternate;if(null!==l){var m=l.memoizedState;if(null!==m){var q=m.dehydrated;null!==q&&bd(q)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;
default:throw Error(p(163));}U||b.flags&512&&Sj(b)}catch(r){W(b,b.return,r)}}if(b===a){V=null;break}c=b.sibling;if(null!==c){c.return=b.return;V=c;break}V=b.return}}function hk(a){for(;null!==V;){var b=V;if(b===a){V=null;break}var c=b.sibling;if(null!==c){c.return=b.return;V=c;break}V=b.return}}
function kk(a){for(;null!==V;){var b=V;try{switch(b.tag){case 0:case 11:case 15:var c=b.return;try{Rj(4,b)}catch(k){W(b,c,k)}break;case 1:var d=b.stateNode;if("function"===typeof d.componentDidMount){var e=b.return;try{d.componentDidMount()}catch(k){W(b,e,k)}}var f=b.return;try{Sj(b)}catch(k){W(b,f,k)}break;case 5:var g=b.return;try{Sj(b)}catch(k){W(b,g,k)}}}catch(k){W(b,b.return,k)}if(b===a){V=null;break}var h=b.sibling;if(null!==h){h.return=b.return;V=h;break}V=b.return}}
var mk=Math.ceil,nk=ua.ReactCurrentDispatcher,ok=ua.ReactCurrentOwner,pk=ua.ReactCurrentBatchConfig,K=0,R=null,Y=null,Z=0,gj=0,fj=Uf(0),T=0,qk=null,hh=0,rk=0,sk=0,tk=null,uk=null,gk=0,Hj=Infinity,vk=null,Pi=!1,Qi=null,Si=null,wk=!1,xk=null,yk=0,zk=0,Ak=null,Bk=-1,Ck=0;function L(){return 0!==(K&6)?B():-1!==Bk?Bk:Bk=B()}
function lh(a){if(0===(a.mode&1))return 1;if(0!==(K&2)&&0!==Z)return Z&-Z;if(null!==Kg.transition)return 0===Ck&&(Ck=yc()),Ck;a=C;if(0!==a)return a;a=window.event;a=void 0===a?16:jd(a.type);return a}function mh(a,b,c,d){if(50<zk)throw zk=0,Ak=null,Error(p(185));Ac(a,c,d);if(0===(K&2)||a!==R)a===R&&(0===(K&2)&&(rk|=c),4===T&&Dk(a,Z)),Ek(a,d),1===c&&0===K&&0===(b.mode&1)&&(Hj=B()+500,fg&&jg())}
function Ek(a,b){var c=a.callbackNode;wc(a,b);var d=uc(a,a===R?Z:0);if(0===d)null!==c&&bc(c),a.callbackNode=null,a.callbackPriority=0;else if(b=d&-d,a.callbackPriority!==b){null!=c&&bc(c);if(1===b)0===a.tag?ig(Fk.bind(null,a)):hg(Fk.bind(null,a)),Jf(function(){0===(K&6)&&jg()}),c=null;else{switch(Dc(d)){case 1:c=fc;break;case 4:c=gc;break;case 16:c=hc;break;case 536870912:c=jc;break;default:c=hc}c=Gk(c,Hk.bind(null,a))}a.callbackPriority=b;a.callbackNode=c}}
function Hk(a,b){Bk=-1;Ck=0;if(0!==(K&6))throw Error(p(327));var c=a.callbackNode;if(Ik()&&a.callbackNode!==c)return null;var d=uc(a,a===R?Z:0);if(0===d)return null;if(0!==(d&30)||0!==(d&a.expiredLanes)||b)b=Jk(a,d);else{b=d;var e=K;K|=2;var f=Kk();if(R!==a||Z!==b)vk=null,Hj=B()+500,Lk(a,b);do try{Mk();break}catch(h){Nk(a,h)}while(1);Qg();nk.current=f;K=e;null!==Y?b=0:(R=null,Z=0,b=T)}if(0!==b){2===b&&(e=xc(a),0!==e&&(d=e,b=Ok(a,e)));if(1===b)throw c=qk,Lk(a,0),Dk(a,d),Ek(a,B()),c;if(6===b)Dk(a,d);
else{e=a.current.alternate;if(0===(d&30)&&!Pk(e)&&(b=Jk(a,d),2===b&&(f=xc(a),0!==f&&(d=f,b=Ok(a,f))),1===b))throw c=qk,Lk(a,0),Dk(a,d),Ek(a,B()),c;a.finishedWork=e;a.finishedLanes=d;switch(b){case 0:case 1:throw Error(p(345));case 2:Qk(a,uk,vk);break;case 3:Dk(a,d);if((d&130023424)===d&&(b=gk+500-B(),10<b)){if(0!==uc(a,0))break;e=a.suspendedLanes;if((e&d)!==d){L();a.pingedLanes|=a.suspendedLanes&e;break}a.timeoutHandle=Ff(Qk.bind(null,a,uk,vk),b);break}Qk(a,uk,vk);break;case 4:Dk(a,d);if((d&4194240)===
d)break;b=a.eventTimes;for(e=-1;0<d;){var g=31-oc(d);f=1<<g;g=b[g];g>e&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10<d){a.timeoutHandle=Ff(Qk.bind(null,a,uk,vk),d);break}Qk(a,uk,vk);break;case 5:Qk(a,uk,vk);break;default:throw Error(p(329));}}}Ek(a,B());return a.callbackNode===c?Hk.bind(null,a):null}
function Ok(a,b){var c=tk;a.current.memoizedState.isDehydrated&&(Lk(a,b).flags|=256);a=Jk(a,b);2!==a&&(b=uk,uk=c,null!==b&&Gj(b));return a}function Gj(a){null===uk?uk=a:uk.push.apply(uk,a)}
function Pk(a){for(var b=a;;){if(b.flags&16384){var c=b.updateQueue;if(null!==c&&(c=c.stores,null!==c))for(var d=0;d<c.length;d++){var e=c[d],f=e.getSnapshot;e=e.value;try{if(!He(f(),e))return!1}catch(g){return!1}}}c=b.child;if(b.subtreeFlags&16384&&null!==c)c.return=b,b=c;else{if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return!0;b=b.return}b.sibling.return=b.return;b=b.sibling}}return!0}
function Dk(a,b){b&=~sk;b&=~rk;a.suspendedLanes|=b;a.pingedLanes&=~b;for(a=a.expirationTimes;0<b;){var c=31-oc(b),d=1<<c;a[c]=-1;b&=~d}}function Fk(a){if(0!==(K&6))throw Error(p(327));Ik();var b=uc(a,0);if(0===(b&1))return Ek(a,B()),null;var c=Jk(a,b);if(0!==a.tag&&2===c){var d=xc(a);0!==d&&(b=d,c=Ok(a,d))}if(1===c)throw c=qk,Lk(a,0),Dk(a,b),Ek(a,B()),c;if(6===c)throw Error(p(345));a.finishedWork=a.current.alternate;a.finishedLanes=b;Qk(a,uk,vk);Ek(a,B());return null}
function Rk(a,b){var c=K;K|=1;try{return a(b)}finally{K=c,0===K&&(Hj=B()+500,fg&&jg())}}function Sk(a){null!==xk&&0===xk.tag&&0===(K&6)&&Ik();var b=K;K|=1;var c=pk.transition,d=C;try{if(pk.transition=null,C=1,a)return a()}finally{C=d,pk.transition=c,K=b,0===(K&6)&&jg()}}function Ij(){gj=fj.current;E(fj)}
function Lk(a,b){a.finishedWork=null;a.finishedLanes=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,Gf(c));if(null!==Y)for(c=Y.return;null!==c;){var d=c;wg(d);switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&$f();break;case 3:Jh();E(Wf);E(H);Oh();break;case 5:Lh(d);break;case 4:Jh();break;case 13:E(M);break;case 19:E(M);break;case 10:Rg(d.type._context);break;case 22:case 23:Ij()}c=c.return}R=a;Y=a=wh(a.current,null);Z=gj=b;T=0;qk=null;sk=rk=hh=0;uk=tk=null;if(null!==Wg){for(b=
0;b<Wg.length;b++)if(c=Wg[b],d=c.interleaved,null!==d){c.interleaved=null;var e=d.next,f=c.pending;if(null!==f){var g=f.next;f.next=e;d.next=g}c.pending=d}Wg=null}return a}
function Nk(a,b){do{var c=Y;try{Qg();Ph.current=ai;if(Sh){for(var d=N.memoizedState;null!==d;){var e=d.queue;null!==e&&(e.pending=null);d=d.next}Sh=!1}Rh=0;P=O=N=null;Th=!1;Uh=0;ok.current=null;if(null===c||null===c.return){T=1;qk=b;Y=null;break}a:{var f=a,g=c.return,h=c,k=b;b=Z;h.flags|=32768;if(null!==k&&"object"===typeof k&&"function"===typeof k.then){var l=k,m=h,q=m.tag;if(0===(m.mode&1)&&(0===q||11===q||15===q)){var r=m.alternate;r?(m.updateQueue=r.updateQueue,m.memoizedState=r.memoizedState,
m.lanes=r.lanes):(m.updateQueue=null,m.memoizedState=null)}var y=Vi(g);if(null!==y){y.flags&=-257;Wi(y,g,h,f,b);y.mode&1&&Ti(f,l,b);b=y;k=l;var n=b.updateQueue;if(null===n){var t=new Set;t.add(k);b.updateQueue=t}else n.add(k);break a}else{if(0===(b&1)){Ti(f,l,b);uj();break a}k=Error(p(426))}}else if(I&&h.mode&1){var J=Vi(g);if(null!==J){0===(J.flags&65536)&&(J.flags|=256);Wi(J,g,h,f,b);Jg(Ki(k,h));break a}}f=k=Ki(k,h);4!==T&&(T=2);null===tk?tk=[f]:tk.push(f);f=g;do{switch(f.tag){case 3:f.flags|=65536;
b&=-b;f.lanes|=b;var x=Oi(f,k,b);fh(f,x);break a;case 1:h=k;var w=f.type,u=f.stateNode;if(0===(f.flags&128)&&("function"===typeof w.getDerivedStateFromError||null!==u&&"function"===typeof u.componentDidCatch&&(null===Si||!Si.has(u)))){f.flags|=65536;b&=-b;f.lanes|=b;var F=Ri(f,h,b);fh(f,F);break a}}f=f.return}while(null!==f)}Tk(c)}catch(na){b=na;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)}function Kk(){var a=nk.current;nk.current=ai;return null===a?ai:a}
function uj(){if(0===T||3===T||2===T)T=4;null===R||0===(hh&268435455)&&0===(rk&268435455)||Dk(R,Z)}function Jk(a,b){var c=K;K|=2;var d=Kk();if(R!==a||Z!==b)vk=null,Lk(a,b);do try{Uk();break}catch(e){Nk(a,e)}while(1);Qg();K=c;nk.current=d;if(null!==Y)throw Error(p(261));R=null;Z=0;return T}function Uk(){for(;null!==Y;)Vk(Y)}function Mk(){for(;null!==Y&&!cc();)Vk(Y)}function Vk(a){var b=Wk(a.alternate,a,gj);a.memoizedProps=a.pendingProps;null===b?Tk(a):Y=b;ok.current=null}
function Tk(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&32768)){if(c=Fj(c,b,gj),null!==c){Y=c;return}}else{c=Jj(c,b);if(null!==c){c.flags&=32767;Y=c;return}if(null!==a)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{T=6;Y=null;return}}b=b.sibling;if(null!==b){Y=b;return}Y=b=a}while(null!==b);0===T&&(T=5)}function Qk(a,b,c){var d=C,e=pk.transition;try{pk.transition=null,C=1,Xk(a,b,c,d)}finally{pk.transition=e,C=d}return null}
function Xk(a,b,c,d){do Ik();while(null!==xk);if(0!==(K&6))throw Error(p(327));c=a.finishedWork;var e=a.finishedLanes;if(null===c)return null;a.finishedWork=null;a.finishedLanes=0;if(c===a.current)throw Error(p(177));a.callbackNode=null;a.callbackPriority=0;var f=c.lanes|c.childLanes;Bc(a,f);a===R&&(Y=R=null,Z=0);0===(c.subtreeFlags&2064)&&0===(c.flags&2064)||wk||(wk=!0,Gk(hc,function(){Ik();return null}));f=0!==(c.flags&15990);if(0!==(c.subtreeFlags&15990)||f){f=pk.transition;pk.transition=null;
var g=C;C=1;var h=K;K|=4;ok.current=null;Pj(a,c);ek(c,a);Oe(Df);dd=!!Cf;Df=Cf=null;a.current=c;ik(c,a,e);dc();K=h;C=g;pk.transition=f}else a.current=c;wk&&(wk=!1,xk=a,yk=e);f=a.pendingLanes;0===f&&(Si=null);mc(c.stateNode,d);Ek(a,B());if(null!==b)for(d=a.onRecoverableError,c=0;c<b.length;c++)e=b[c],d(e.value,{componentStack:e.stack,digest:e.digest});if(Pi)throw Pi=!1,a=Qi,Qi=null,a;0!==(yk&1)&&0!==a.tag&&Ik();f=a.pendingLanes;0!==(f&1)?a===Ak?zk++:(zk=0,Ak=a):zk=0;jg();return null}
function Ik(){if(null!==xk){var a=Dc(yk),b=pk.transition,c=C;try{pk.transition=null;C=16>a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;k<h.length;k++){var l=h[k];for(V=l;null!==V;){var m=V;switch(m.tag){case 0:case 11:case 15:Qj(8,m,f)}var q=m.child;if(null!==q)q.return=m,V=q;else for(;null!==V;){m=V;var r=m.sibling,y=m.return;Tj(m);if(m===
l){V=null;break}if(null!==r){r.return=y;V=r;break}V=y}}}var n=f.alternate;if(null!==n){var t=n.child;if(null!==t){n.child=null;do{var J=t.sibling;t.sibling=null;t=J}while(null!==t)}}V=f}}if(0!==(f.subtreeFlags&2064)&&null!==g)g.return=f,V=g;else b:for(;null!==V;){f=V;if(0!==(f.flags&2048))switch(f.tag){case 0:case 11:case 15:Qj(9,f,f.return)}var x=f.sibling;if(null!==x){x.return=f.return;V=x;break b}V=f.return}}var w=a.current;for(V=w;null!==V;){g=V;var u=g.child;if(0!==(g.subtreeFlags&2064)&&null!==
u)u.return=g,V=u;else b:for(g=w;null!==V;){h=V;if(0!==(h.flags&2048))try{switch(h.tag){case 0:case 11:case 15:Rj(9,h)}}catch(na){W(h,h.return,na)}if(h===g){V=null;break b}var F=h.sibling;if(null!==F){F.return=h.return;V=F;break b}V=h.return}}K=e;jg();if(lc&&"function"===typeof lc.onPostCommitFiberRoot)try{lc.onPostCommitFiberRoot(kc,a)}catch(na){}d=!0}return d}finally{C=c,pk.transition=b}}return!1}function Yk(a,b,c){b=Ki(c,b);b=Oi(a,b,1);a=dh(a,b,1);b=L();null!==a&&(Ac(a,1,b),Ek(a,b))}
function W(a,b,c){if(3===a.tag)Yk(a,a,c);else for(;null!==b;){if(3===b.tag){Yk(b,a,c);break}else if(1===b.tag){var d=b.stateNode;if("function"===typeof b.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Si||!Si.has(d))){a=Ki(c,a);a=Ri(b,a,1);b=dh(b,a,1);a=L();null!==b&&(Ac(b,1,a),Ek(b,a));break}}b=b.return}}
function Ui(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);b=L();a.pingedLanes|=a.suspendedLanes&c;R===a&&(Z&c)===c&&(4===T||3===T&&(Z&130023424)===Z&&500>B()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}
function ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;
Wk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;"object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=
null,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,
d,""));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=
f,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),
hj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;
g=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,
c,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),
b.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}
function al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}
function $k(a){if("function"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}
function wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};
c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}
function yh(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)bj(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;
break a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,""));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}
function zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}
function bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=
null}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:wa,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}
function el(a){if(!a)return Vf;a=a._reactInternals;a:{if(Vb(a)!==a||1!==a.tag)throw Error(p(170));var b=a;do{switch(b.tag){case 3:b=b.stateNode.context;break a;case 1:if(Zf(b.type)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break a}}b=b.return}while(null!==b);throw Error(p(171));}if(1===a.tag){var c=a.type;if(Zf(c))return bg(a,c,b)}return b}
function fl(a,b,c,d,e,f,g,h,k){a=cl(c,d,!0,a,e,f,g,h,k);a.context=el(null);c=a.current;d=L();e=lh(c);f=ch(d,e);f.callback=void 0!==b&&null!==b?b:null;dh(c,f,e);a.current.lanes=e;Ac(a,e,d);Ek(a,d);return a}function gl(a,b,c,d){var e=b.current,f=L(),g=lh(e);c=el(c);null===b.context?b.context=c:b.pendingContext=c;b=ch(f,g);b.payload={element:a};d=void 0===d?null:d;null!==d&&(b.callback=d);a=dh(e,b,g);null!==a&&(mh(a,e,g,f),eh(a,e,g));return g}
function hl(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function il(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c<b?c:b}}function jl(a,b){il(a,b);(a=a.alternate)&&il(a,b)}function kl(){return null}var ll="function"===typeof reportError?reportError:function(a){console.error(a)};function ml(a){this._internalRoot=a}
nl.prototype.render=ml.prototype.render=function(a){var b=this._internalRoot;if(null===b)throw Error(p(409));gl(a,b,null,null)};nl.prototype.unmount=ml.prototype.unmount=function(){var a=this._internalRoot;if(null!==a){this._internalRoot=null;var b=a.containerInfo;Sk(function(){gl(null,a,null,null)});b[uf]=null}};function nl(a){this._internalRoot=a}
nl.prototype.unstable_scheduleHydration=function(a){if(a){var b=Hc();a={blockedOn:null,target:a,priority:b};for(var c=0;c<Qc.length&&0!==b&&b<Qc[c].priority;c++);Qc.splice(c,0,a);0===c&&Vc(a)}};function ol(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType)}function pl(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function ql(){}
function rl(a,b,c,d,e){if(e){if("function"===typeof d){var f=d;d=function(){var a=hl(g);f.call(a)}}var g=fl(b,d,a,0,null,!1,!1,"",ql);a._reactRootContainer=g;a[uf]=g.current;sf(8===a.nodeType?a.parentNode:a);Sk();return g}for(;e=a.lastChild;)a.removeChild(e);if("function"===typeof d){var h=d;d=function(){var a=hl(k);h.call(a)}}var k=cl(a,0,!1,null,null,!1,!1,"",ql);a._reactRootContainer=k;a[uf]=k.current;sf(8===a.nodeType?a.parentNode:a);Sk(function(){gl(b,k,c,d)});return k}
function sl(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f;if("function"===typeof e){var h=e;e=function(){var a=hl(g);h.call(a)}}gl(b,g,a,e)}else g=rl(c,b,a,e,d);return hl(g)}Ec=function(a){switch(a.tag){case 3:var b=a.stateNode;if(b.current.memoizedState.isDehydrated){var c=tc(b.pendingLanes);0!==c&&(Cc(b,c|1),Ek(b,B()),0===(K&6)&&(Hj=B()+500,jg()))}break;case 13:Sk(function(){var b=Zg(a,1);if(null!==b){var c=L();mh(b,a,1,c)}}),jl(a,1)}};
Fc=function(a){if(13===a.tag){var b=Zg(a,134217728);if(null!==b){var c=L();mh(b,a,134217728,c)}jl(a,134217728)}};Gc=function(a){if(13===a.tag){var b=lh(a),c=Zg(a,b);if(null!==c){var d=L();mh(c,a,b,d)}jl(a,b)}};Hc=function(){return C};Ic=function(a,b){var c=C;try{return C=a,b()}finally{C=c}};
yb=function(a,b,c){switch(b){case "input":bb(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Db(d);if(!e)throw Error(p(90));Wa(d);bb(d,e)}}}break;case "textarea":ib(a,c);break;case "select":b=c.value,null!=b&&fb(a,!!c.multiple,b,!1)}};Gb=Rk;Hb=Sk;
var tl={usingClientEntryPoint:!1,Events:[Cb,ue,Db,Eb,Fb,Rk]},ul={findFiberByHostInstance:Wc,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"};
var vl={bundleType:ul.bundleType,version:ul.version,rendererPackageName:ul.rendererPackageName,rendererConfig:ul.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=Zb(a);return null===a?null:a.stateNode},findFiberByHostInstance:ul.findFiberByHostInstance||
kl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var wl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wl.isDisabled&&wl.supportsFiber)try{kc=wl.inject(vl),lc=wl}catch(a){}}exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tl;
exports.createPortal=function(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ol(b))throw Error(p(200));return dl(a,b,null,c)};exports.createRoot=function(a,b){if(!ol(a))throw Error(p(299));var c=!1,d="",e=ll;null!==b&&void 0!==b&&(!0===b.unstable_strictMode&&(c=!0),void 0!==b.identifierPrefix&&(d=b.identifierPrefix),void 0!==b.onRecoverableError&&(e=b.onRecoverableError));b=cl(a,1,!1,null,null,c,!1,d,e);a[uf]=b.current;sf(8===a.nodeType?a.parentNode:a);return new ml(b)};
exports.findDOMNode=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternals;if(void 0===b){if("function"===typeof a.render)throw Error(p(188));a=Object.keys(a).join(",");throw Error(p(268,a));}a=Zb(b);a=null===a?null:a.stateNode;return a};exports.flushSync=function(a){return Sk(a)};exports.hydrate=function(a,b,c){if(!pl(b))throw Error(p(200));return sl(null,a,b,!0,c)};
exports.hydrateRoot=function(a,b,c){if(!ol(a))throw Error(p(405));var d=null!=c&&c.hydratedSources||null,e=!1,f="",g=ll;null!==c&&void 0!==c&&(!0===c.unstable_strictMode&&(e=!0),void 0!==c.identifierPrefix&&(f=c.identifierPrefix),void 0!==c.onRecoverableError&&(g=c.onRecoverableError));b=fl(b,null,a,1,null!=c?c:null,e,!1,f,g);a[uf]=b.current;sf(a);if(d)for(a=0;a<d.length;a++)c=d[a],e=c._getVersion,e=e(c._source),null==b.mutableSourceEagerHydrationData?b.mutableSourceEagerHydrationData=[c,e]:b.mutableSourceEagerHydrationData.push(c,
e);return new nl(b)};exports.render=function(a,b,c){if(!pl(b))throw Error(p(200));return sl(null,a,b,!1,c)};exports.unmountComponentAtNode=function(a){if(!pl(a))throw Error(p(40));return a._reactRootContainer?(Sk(function(){sl(null,null,a,!1,function(){a._reactRootContainer=null;a[uf]=null})}),!0):!1};exports.unstable_batchedUpdates=Rk;
exports.unstable_renderSubtreeIntoContainer=function(a,b,c,d){if(!pl(c))throw Error(p(200));if(null==a||void 0===a._reactInternals)throw Error(p(38));return sl(a,b,c,!1,d)};exports.version="18.2.0-next-9e3b772b8-20220608";
webpack://frontend-tpt/../../node_modules/react-dom/client.js
'use strict';
var m = require('react-dom');
if (process.env.NODE_ENV === 'production') {
exports.createRoot = m.createRoot;
exports.hydrateRoot = m.hydrateRoot;
} else {
var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
exports.createRoot = function(c, o) {
i.usingClientEntryPoint = true;
try {
return m.createRoot(c, o);
} finally {
i.usingClientEntryPoint = false;
}
};
exports.hydrateRoot = function(c, h, o) {
i.usingClientEntryPoint = true;
try {
return m.hydrateRoot(c, h, o);
} finally {
i.usingClientEntryPoint = false;
}
};
}
webpack://frontend-tpt/../../node_modules/react-dom/index.js
'use strict';
function checkDCE() {
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
) {
return;
}
if (process.env.NODE_ENV !== 'production') {
// This branch is unreachable because this function is only called
// in production, but the condition is true only in development.
// Therefore if the branch is still here, dead code elimination wasn't
// properly applied.
// Don't change the message. React DevTools relies on it. Also make sure
// this message doesn't occur elsewhere in this function, or it will cause
// a false positive.
throw new Error('^_^');
}
try {
// Verify that the code above has been dead code eliminated (DCE'd).
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
} catch (err) {
// DevTools shouldn't crash React, no matter what.
// We should still report in case we break this code.
console.error(err);
}
}
if (process.env.NODE_ENV === 'production') {
// DCE check should happen before ReactDOM bundle executes so that
// DevTools can report bad minification during injection.
checkDCE();
module.exports = require('./cjs/react-dom.production.min.js');
} else {
module.exports = require('./cjs/react-dom.development.js');
}
webpack://frontend-tpt/../../node_modules/react-id-swiper/lib/ReactIdSwiper.js
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importStar(require("react"));
var swiper_1 = __importDefault(require("swiper"));
var object_assign_1 = __importDefault(require("object-assign"));
var utils_1 = require("./utils");
var hooks_1 = require("./hooks");
var ReactIdSwiper = react_1.forwardRef(function (props, externalRef) {
var activeSlideKey = props.activeSlideKey, ContainerEl = props.ContainerEl, children = props.children, containerClass = props.containerClass, navigation = props.navigation, noSwiping = props.noSwiping, pagination = props.pagination, parallax = props.parallax, parallaxEl = props.parallaxEl, WrapperEl = props.WrapperEl, wrapperClass = props.wrapperClass, rebuildOnUpdate = props.rebuildOnUpdate, renderScrollbar = props.renderScrollbar, renderPagination = props.renderPagination, renderPrevButton = props.renderPrevButton, renderNextButton = props.renderNextButton, renderParallax = props.renderParallax, rtl = props.rtl, scrollbar = props.scrollbar, shouldSwiperUpdate = props.shouldSwiperUpdate, slideClass = props.slideClass, loop = props.loop;
// Define swiper instance ref
var swiperInstanceRef = react_1.useRef(null);
// Internal ref
var swiperNodeRef = react_1.useRef(null);
// Forked ref
var ref = hooks_1.useForkRef(swiperNodeRef, externalRef);
// Get current active slide key
var getActiveSlideIndexFromProps = react_1.useCallback(function () {
if (!activeSlideKey) {
return null;
}
var activeSlideId = 0;
// In loop mode first slide index should be 1
var id = loop ? 1 : 0;
react_1.Children.forEach(children, function (child) {
if (react_1.isValidElement(child)) {
if (child.key === activeSlideKey) {
activeSlideId = id;
}
id += 1;
}
});
return activeSlideId;
}, [activeSlideKey, children, loop]);
// Destroy swiper
var destroySwiper = react_1.useCallback(function () {
if (swiperInstanceRef.current !== null) {
swiperInstanceRef.current.destroy(true, true);
utils_1.setRef(swiperInstanceRef, null);
}
}, []);
// Initialize swiper
var buildSwiper = react_1.useCallback(function () {
if (swiperNodeRef.current && swiperInstanceRef.current === null) {
utils_1.setRef(swiperInstanceRef, new swiper_1.default(swiperNodeRef.current, object_assign_1.default({}, props)));
}
}, [props]);
// Render slides
var renderContent = function (e) {
if (!utils_1.isReactElement(e)) {
return null;
}
var slideClassNames = [slideClass, e.props.className];
if (noSwiping) {
slideClassNames.push('swiper-no-swiping');
}
return react_1.cloneElement(e, __assign(__assign({}, e.props), { className: slideClassNames.join(' ').trim() }));
};
// Destroy Swiper instance when component is unmounted
react_1.useEffect(function () {
return function () { return destroySwiper(); };
}, [destroySwiper]);
react_1.useEffect(function () {
buildSwiper();
if (swiperInstanceRef.current !== null) {
if (rebuildOnUpdate) {
destroySwiper();
buildSwiper();
}
else if (shouldSwiperUpdate) {
swiperInstanceRef.current.update();
}
var numSlides = swiperInstanceRef.current.slides.length;
if (numSlides <= swiperInstanceRef.current.activeIndex) {
var index = Math.max(numSlides - 1, 0);
swiperInstanceRef.current.slideTo(index);
}
var slideToIndex = getActiveSlideIndexFromProps();
if (slideToIndex !== null) {
swiperInstanceRef.current.slideTo(slideToIndex);
}
}
}, [
destroySwiper,
getActiveSlideIndexFromProps,
rebuildOnUpdate,
shouldSwiperUpdate,
buildSwiper
]);
// No render if wrapper elements are not provided
if (!children || !ContainerEl || !WrapperEl) {
return null;
}
// Validate children props
if (!utils_1.validateChildren(children)) {
if (process.env.NODE_ENV !== 'production') {
console.warn('Children should be react element or an array of react element!!');
}
return null;
}
return (react_1.default.createElement(ContainerEl, { className: containerClass, dir: rtl && 'rtl', ref: ref },
parallax && parallaxEl && renderParallax && renderParallax(props),
react_1.default.createElement(WrapperEl, { className: wrapperClass }, react_1.Children.map(children, renderContent)),
pagination && pagination.el && renderPagination && renderPagination(props),
scrollbar && scrollbar.el && renderScrollbar && renderScrollbar(props),
navigation && navigation.nextEl && renderNextButton && renderNextButton(props),
navigation && navigation.prevEl && renderPrevButton && renderPrevButton(props)));
});
// Default props
ReactIdSwiper.defaultProps = {
containerClass: 'swiper-container',
wrapperClass: 'swiper-wrapper',
slideClass: 'swiper-slide',
ContainerEl: 'div',
WrapperEl: 'div',
renderScrollbar: function (_a) {
var scrollbar = _a.scrollbar;
return scrollbar ? react_1.default.createElement("div", { className: utils_1.classNames(scrollbar.el) }) : null;
},
renderPagination: function (_a) {
var pagination = _a.pagination;
return pagination ? react_1.default.createElement("div", { className: utils_1.classNames(pagination.el) }) : null;
},
renderPrevButton: function (_a) {
var navigation = _a.navigation;
return navigation ? react_1.default.createElement("div", { className: utils_1.classNames(navigation.prevEl) }) : null;
},
renderNextButton: function (_a) {
var navigation = _a.navigation;
return navigation ? react_1.default.createElement("div", { className: utils_1.classNames(navigation.nextEl) }) : null;
},
renderParallax: function (_a) {
var parallaxEl = _a.parallaxEl;
return parallaxEl ? (react_1.default.createElement("div", { className: utils_1.classNames(parallaxEl.el), "data-swiper-parallax": parallaxEl.value })) : null;
}
};
ReactIdSwiper.displayName = 'ReactIdSwiper';
exports.default = ReactIdSwiper;
webpack://frontend-tpt/../../node_modules/react-id-swiper/lib/hooks.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useForkRef = void 0;
var react_1 = require("react");
var utils_1 = require("./utils");
exports.useForkRef = function (refA, refB) {
return react_1.useMemo(function () {
if (refA == null && refB == null) {
return null;
}
return function (refValue) {
utils_1.setRef(refA, refValue);
utils_1.setRef(refB, refValue);
};
}, [refA, refB]);
};
webpack://frontend-tpt/../../node_modules/react-id-swiper/lib/index.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var ReactIdSwiper_1 = __importDefault(require("./ReactIdSwiper"));
// React-id-swiper
exports.default = ReactIdSwiper_1.default;
webpack://frontend-tpt/../../node_modules/react-id-swiper/lib/utils.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setRef = exports.isModuleAvailable = exports.isReactElement = exports.validateChildren = exports.classNames = void 0;
var react_1 = require("react");
exports.classNames = function (el) {
if (typeof el === 'string') {
return el.split('.').join(' ').trim();
}
else if (el instanceof HTMLElement) {
return el.className;
}
return '';
};
exports.validateChildren = function (children) {
var isValid = true;
if (Array.isArray(children)) {
react_1.Children.forEach(children, function (child) {
if (!react_1.isValidElement(child)) {
isValid = false;
}
});
}
else {
isValid = react_1.isValidElement(children);
}
return isValid;
};
exports.isReactElement = function (element) {
return react_1.isValidElement(element) &&
(typeof element.type === 'string' ||
typeof element.type === 'function' ||
typeof element.type === 'object');
};
exports.isModuleAvailable = function (modules, moduleName) {
var moduleAvailable = false;
for (var i = 0; i < modules.length; i++) {
if (modules[i].name === moduleName) {
moduleAvailable = true;
break;
}
}
return moduleAvailable;
};
exports.setRef = function (ref, value) {
if (typeof ref === 'function') {
ref(value);
}
else if (ref) {
ref.current = value;
}
};
webpack://frontend-tpt/../../node_modules/react-is/cjs/react-is.production.min.js
/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;
exports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};
exports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;
webpack://frontend-tpt/../../node_modules/react-is/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-is.production.min.js');
} else {
module.exports = require('./cjs/react-is.development.js');
}
webpack://frontend-tpt/../../node_modules/react-motion/lib/Motion.js
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _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; }
var _mapToZero = require('./mapToZero');
var _mapToZero2 = _interopRequireDefault(_mapToZero);
var _stripStyle = require('./stripStyle');
var _stripStyle2 = _interopRequireDefault(_stripStyle);
var _stepper3 = require('./stepper');
var _stepper4 = _interopRequireDefault(_stepper3);
var _performanceNow = require('performance-now');
var _performanceNow2 = _interopRequireDefault(_performanceNow);
var _raf = require('raf');
var _raf2 = _interopRequireDefault(_raf);
var _shouldStopAnimation = require('./shouldStopAnimation');
var _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var msPerFrame = 1000 / 60;
var Motion = (function (_React$Component) {
_inherits(Motion, _React$Component);
_createClass(Motion, null, [{
key: 'propTypes',
value: {
// TOOD: warn against putting a config in here
defaultStyle: _propTypes2['default'].objectOf(_propTypes2['default'].number),
style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired,
children: _propTypes2['default'].func.isRequired,
onRest: _propTypes2['default'].func
},
enumerable: true
}]);
function Motion(props) {
var _this = this;
_classCallCheck(this, Motion);
_React$Component.call(this, props);
this.wasAnimating = false;
this.animationID = null;
this.prevTime = 0;
this.accumulatedTime = 0;
this.unreadPropStyle = null;
this.clearUnreadPropStyle = function (destStyle) {
var dirty = false;
var _state = _this.state;
var currentStyle = _state.currentStyle;
var currentVelocity = _state.currentVelocity;
var lastIdealStyle = _state.lastIdealStyle;
var lastIdealVelocity = _state.lastIdealVelocity;
for (var key in destStyle) {
if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {
continue;
}
var styleValue = destStyle[key];
if (typeof styleValue === 'number') {
if (!dirty) {
dirty = true;
currentStyle = _extends({}, currentStyle);
currentVelocity = _extends({}, currentVelocity);
lastIdealStyle = _extends({}, lastIdealStyle);
lastIdealVelocity = _extends({}, lastIdealVelocity);
}
currentStyle[key] = styleValue;
currentVelocity[key] = 0;
lastIdealStyle[key] = styleValue;
lastIdealVelocity[key] = 0;
}
}
if (dirty) {
_this.setState({ currentStyle: currentStyle, currentVelocity: currentVelocity, lastIdealStyle: lastIdealStyle, lastIdealVelocity: lastIdealVelocity });
}
};
this.startAnimationIfNecessary = function () {
// TODO: when config is {a: 10} and dest is {a: 10} do we raf once and
// call cb? No, otherwise accidental parent rerender causes cb trigger
_this.animationID = _raf2['default'](function (timestamp) {
// check if we need to animate in the first place
var propsStyle = _this.props.style;
if (_shouldStopAnimation2['default'](_this.state.currentStyle, propsStyle, _this.state.currentVelocity)) {
if (_this.wasAnimating && _this.props.onRest) {
_this.props.onRest();
}
// no need to cancel animationID here; shouldn't have any in flight
_this.animationID = null;
_this.wasAnimating = false;
_this.accumulatedTime = 0;
return;
}
_this.wasAnimating = true;
var currentTime = timestamp || _performanceNow2['default']();
var timeDelta = currentTime - _this.prevTime;
_this.prevTime = currentTime;
_this.accumulatedTime = _this.accumulatedTime + timeDelta;
// more than 10 frames? prolly switched browser tab. Restart
if (_this.accumulatedTime > msPerFrame * 10) {
_this.accumulatedTime = 0;
}
if (_this.accumulatedTime === 0) {
// no need to cancel animationID here; shouldn't have any in flight
_this.animationID = null;
_this.startAnimationIfNecessary();
return;
}
var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;
var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);
var newLastIdealStyle = {};
var newLastIdealVelocity = {};
var newCurrentStyle = {};
var newCurrentVelocity = {};
for (var key in propsStyle) {
if (!Object.prototype.hasOwnProperty.call(propsStyle, key)) {
continue;
}
var styleValue = propsStyle[key];
if (typeof styleValue === 'number') {
newCurrentStyle[key] = styleValue;
newCurrentVelocity[key] = 0;
newLastIdealStyle[key] = styleValue;
newLastIdealVelocity[key] = 0;
} else {
var newLastIdealStyleValue = _this.state.lastIdealStyle[key];
var newLastIdealVelocityValue = _this.state.lastIdealVelocity[key];
for (var i = 0; i < framesToCatchUp; i++) {
var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
newLastIdealStyleValue = _stepper[0];
newLastIdealVelocityValue = _stepper[1];
}
var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
var nextIdealX = _stepper2[0];
var nextIdealV = _stepper2[1];
newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;
newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;
newLastIdealStyle[key] = newLastIdealStyleValue;
newLastIdealVelocity[key] = newLastIdealVelocityValue;
}
}
_this.animationID = null;
// the amount we're looped over above
_this.accumulatedTime -= framesToCatchUp * msPerFrame;
_this.setState({
currentStyle: newCurrentStyle,
currentVelocity: newCurrentVelocity,
lastIdealStyle: newLastIdealStyle,
lastIdealVelocity: newLastIdealVelocity
});
_this.unreadPropStyle = null;
_this.startAnimationIfNecessary();
});
};
this.state = this.defaultState();
}
Motion.prototype.defaultState = function defaultState() {
var _props = this.props;
var defaultStyle = _props.defaultStyle;
var style = _props.style;
var currentStyle = defaultStyle || _stripStyle2['default'](style);
var currentVelocity = _mapToZero2['default'](currentStyle);
return {
currentStyle: currentStyle,
currentVelocity: currentVelocity,
lastIdealStyle: currentStyle,
lastIdealVelocity: currentVelocity
};
};
// it's possible that currentStyle's value is stale: if props is immediately
// changed from 0 to 400 to spring(0) again, the async currentStyle is still
// at 0 (didn't have time to tick and interpolate even once). If we naively
// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).
// In reality currentStyle should be 400
Motion.prototype.componentDidMount = function componentDidMount() {
this.prevTime = _performanceNow2['default']();
this.startAnimationIfNecessary();
};
Motion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {
if (this.unreadPropStyle != null) {
// previous props haven't had the chance to be set yet; set them here
this.clearUnreadPropStyle(this.unreadPropStyle);
}
this.unreadPropStyle = props.style;
if (this.animationID == null) {
this.prevTime = _performanceNow2['default']();
this.startAnimationIfNecessary();
}
};
Motion.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.animationID != null) {
_raf2['default'].cancel(this.animationID);
this.animationID = null;
}
};
Motion.prototype.render = function render() {
var renderedChildren = this.props.children(this.state.currentStyle);
return renderedChildren && _react2['default'].Children.only(renderedChildren);
};
return Motion;
})(_react2['default'].Component);
exports['default'] = Motion;
module.exports = exports['default'];
// after checking for unreadPropStyle != null, we manually go set the
// non-interpolating values (those that are a number, without a spring
// config)
webpack://frontend-tpt/../../node_modules/react-motion/lib/StaggeredMotion.js
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _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; }
var _mapToZero = require('./mapToZero');
var _mapToZero2 = _interopRequireDefault(_mapToZero);
var _stripStyle = require('./stripStyle');
var _stripStyle2 = _interopRequireDefault(_stripStyle);
var _stepper3 = require('./stepper');
var _stepper4 = _interopRequireDefault(_stepper3);
var _performanceNow = require('performance-now');
var _performanceNow2 = _interopRequireDefault(_performanceNow);
var _raf = require('raf');
var _raf2 = _interopRequireDefault(_raf);
var _shouldStopAnimation = require('./shouldStopAnimation');
var _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var msPerFrame = 1000 / 60;
function shouldStopAnimationAll(currentStyles, styles, currentVelocities) {
for (var i = 0; i < currentStyles.length; i++) {
if (!_shouldStopAnimation2['default'](currentStyles[i], styles[i], currentVelocities[i])) {
return false;
}
}
return true;
}
var StaggeredMotion = (function (_React$Component) {
_inherits(StaggeredMotion, _React$Component);
_createClass(StaggeredMotion, null, [{
key: 'propTypes',
value: {
// TOOD: warn against putting a config in here
defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].objectOf(_propTypes2['default'].number)),
styles: _propTypes2['default'].func.isRequired,
children: _propTypes2['default'].func.isRequired
},
enumerable: true
}]);
function StaggeredMotion(props) {
var _this = this;
_classCallCheck(this, StaggeredMotion);
_React$Component.call(this, props);
this.animationID = null;
this.prevTime = 0;
this.accumulatedTime = 0;
this.unreadPropStyles = null;
this.clearUnreadPropStyle = function (unreadPropStyles) {
var _state = _this.state;
var currentStyles = _state.currentStyles;
var currentVelocities = _state.currentVelocities;
var lastIdealStyles = _state.lastIdealStyles;
var lastIdealVelocities = _state.lastIdealVelocities;
var someDirty = false;
for (var i = 0; i < unreadPropStyles.length; i++) {
var unreadPropStyle = unreadPropStyles[i];
var dirty = false;
for (var key in unreadPropStyle) {
if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {
continue;
}
var styleValue = unreadPropStyle[key];
if (typeof styleValue === 'number') {
if (!dirty) {
dirty = true;
someDirty = true;
currentStyles[i] = _extends({}, currentStyles[i]);
currentVelocities[i] = _extends({}, currentVelocities[i]);
lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);
lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);
}
currentStyles[i][key] = styleValue;
currentVelocities[i][key] = 0;
lastIdealStyles[i][key] = styleValue;
lastIdealVelocities[i][key] = 0;
}
}
}
if (someDirty) {
_this.setState({ currentStyles: currentStyles, currentVelocities: currentVelocities, lastIdealStyles: lastIdealStyles, lastIdealVelocities: lastIdealVelocities });
}
};
this.startAnimationIfNecessary = function () {
// TODO: when config is {a: 10} and dest is {a: 10} do we raf once and
// call cb? No, otherwise accidental parent rerender causes cb trigger
_this.animationID = _raf2['default'](function (timestamp) {
var destStyles = _this.props.styles(_this.state.lastIdealStyles);
// check if we need to animate in the first place
if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities)) {
// no need to cancel animationID here; shouldn't have any in flight
_this.animationID = null;
_this.accumulatedTime = 0;
return;
}
var currentTime = timestamp || _performanceNow2['default']();
var timeDelta = currentTime - _this.prevTime;
_this.prevTime = currentTime;
_this.accumulatedTime = _this.accumulatedTime + timeDelta;
// more than 10 frames? prolly switched browser tab. Restart
if (_this.accumulatedTime > msPerFrame * 10) {
_this.accumulatedTime = 0;
}
if (_this.accumulatedTime === 0) {
// no need to cancel animationID here; shouldn't have any in flight
_this.animationID = null;
_this.startAnimationIfNecessary();
return;
}
var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;
var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);
var newLastIdealStyles = [];
var newLastIdealVelocities = [];
var newCurrentStyles = [];
var newCurrentVelocities = [];
for (var i = 0; i < destStyles.length; i++) {
var destStyle = destStyles[i];
var newCurrentStyle = {};
var newCurrentVelocity = {};
var newLastIdealStyle = {};
var newLastIdealVelocity = {};
for (var key in destStyle) {
if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {
continue;
}
var styleValue = destStyle[key];
if (typeof styleValue === 'number') {
newCurrentStyle[key] = styleValue;
newCurrentVelocity[key] = 0;
newLastIdealStyle[key] = styleValue;
newLastIdealVelocity[key] = 0;
} else {
var newLastIdealStyleValue = _this.state.lastIdealStyles[i][key];
var newLastIdealVelocityValue = _this.state.lastIdealVelocities[i][key];
for (var j = 0; j < framesToCatchUp; j++) {
var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
newLastIdealStyleValue = _stepper[0];
newLastIdealVelocityValue = _stepper[1];
}
var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
var nextIdealX = _stepper2[0];
var nextIdealV = _stepper2[1];
newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;
newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;
newLastIdealStyle[key] = newLastIdealStyleValue;
newLastIdealVelocity[key] = newLastIdealVelocityValue;
}
}
newCurrentStyles[i] = newCurrentStyle;
newCurrentVelocities[i] = newCurrentVelocity;
newLastIdealStyles[i] = newLastIdealStyle;
newLastIdealVelocities[i] = newLastIdealVelocity;
}
_this.animationID = null;
// the amount we're looped over above
_this.accumulatedTime -= framesToCatchUp * msPerFrame;
_this.setState({
currentStyles: newCurrentStyles,
currentVelocities: newCurrentVelocities,
lastIdealStyles: newLastIdealStyles,
lastIdealVelocities: newLastIdealVelocities
});
_this.unreadPropStyles = null;
_this.startAnimationIfNecessary();
});
};
this.state = this.defaultState();
}
StaggeredMotion.prototype.defaultState = function defaultState() {
var _props = this.props;
var defaultStyles = _props.defaultStyles;
var styles = _props.styles;
var currentStyles = defaultStyles || styles().map(_stripStyle2['default']);
var currentVelocities = currentStyles.map(function (currentStyle) {
return _mapToZero2['default'](currentStyle);
});
return {
currentStyles: currentStyles,
currentVelocities: currentVelocities,
lastIdealStyles: currentStyles,
lastIdealVelocities: currentVelocities
};
};
StaggeredMotion.prototype.componentDidMount = function componentDidMount() {
this.prevTime = _performanceNow2['default']();
this.startAnimationIfNecessary();
};
StaggeredMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {
if (this.unreadPropStyles != null) {
// previous props haven't had the chance to be set yet; set them here
this.clearUnreadPropStyle(this.unreadPropStyles);
}
this.unreadPropStyles = props.styles(this.state.lastIdealStyles);
if (this.animationID == null) {
this.prevTime = _performanceNow2['default']();
this.startAnimationIfNecessary();
}
};
StaggeredMotion.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.animationID != null) {
_raf2['default'].cancel(this.animationID);
this.animationID = null;
}
};
StaggeredMotion.prototype.render = function render() {
var renderedChildren = this.props.children(this.state.currentStyles);
return renderedChildren && _react2['default'].Children.only(renderedChildren);
};
return StaggeredMotion;
})(_react2['default'].Component);
exports['default'] = StaggeredMotion;
module.exports = exports['default'];
// it's possible that currentStyle's value is stale: if props is immediately
// changed from 0 to 400 to spring(0) again, the async currentStyle is still
// at 0 (didn't have time to tick and interpolate even once). If we naively
// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).
// In reality currentStyle should be 400
// after checking for unreadPropStyles != null, we manually go set the
// non-interpolating values (those that are a number, without a spring
// config)
webpack://frontend-tpt/../../node_modules/react-motion/lib/TransitionMotion.js
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _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; }
var _mapToZero = require('./mapToZero');
var _mapToZero2 = _interopRequireDefault(_mapToZero);
var _stripStyle = require('./stripStyle');
var _stripStyle2 = _interopRequireDefault(_stripStyle);
var _stepper3 = require('./stepper');
var _stepper4 = _interopRequireDefault(_stepper3);
var _mergeDiff = require('./mergeDiff');
var _mergeDiff2 = _interopRequireDefault(_mergeDiff);
var _performanceNow = require('performance-now');
var _performanceNow2 = _interopRequireDefault(_performanceNow);
var _raf = require('raf');
var _raf2 = _interopRequireDefault(_raf);
var _shouldStopAnimation = require('./shouldStopAnimation');
var _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var msPerFrame = 1000 / 60;
// the children function & (potential) styles function asks as param an
// Array<TransitionPlainStyle>, where each TransitionPlainStyle is of the format
// {key: string, data?: any, style: PlainStyle}. However, the way we keep
// internal states doesn't contain such a data structure (check the state and
// TransitionMotionState). So when children function and others ask for such
// data we need to generate them on the fly by combining mergedPropsStyles and
// currentStyles/lastIdealStyles
function rehydrateStyles(mergedPropsStyles, unreadPropStyles, plainStyles) {
// Copy the value to a `const` so that Flow understands that the const won't
// change and will be non-nullable in the callback below.
var cUnreadPropStyles = unreadPropStyles;
if (cUnreadPropStyles == null) {
return mergedPropsStyles.map(function (mergedPropsStyle, i) {
return {
key: mergedPropsStyle.key,
data: mergedPropsStyle.data,
style: plainStyles[i]
};
});
}
return mergedPropsStyles.map(function (mergedPropsStyle, i) {
for (var j = 0; j < cUnreadPropStyles.length; j++) {
if (cUnreadPropStyles[j].key === mergedPropsStyle.key) {
return {
key: cUnreadPropStyles[j].key,
data: cUnreadPropStyles[j].data,
style: plainStyles[i]
};
}
}
return { key: mergedPropsStyle.key, data: mergedPropsStyle.data, style: plainStyles[i] };
});
}
function shouldStopAnimationAll(currentStyles, destStyles, currentVelocities, mergedPropsStyles) {
if (mergedPropsStyles.length !== destStyles.length) {
return false;
}
for (var i = 0; i < mergedPropsStyles.length; i++) {
if (mergedPropsStyles[i].key !== destStyles[i].key) {
return false;
}
}
// we have the invariant that mergedPropsStyles and
// currentStyles/currentVelocities/last* are synced in terms of cells, see
// mergeAndSync comment for more info
for (var i = 0; i < mergedPropsStyles.length; i++) {
if (!_shouldStopAnimation2['default'](currentStyles[i], destStyles[i].style, currentVelocities[i])) {
return false;
}
}
return true;
}
// core key merging logic
// things to do: say previously merged style is {a, b}, dest style (prop) is {b,
// c}, previous current (interpolating) style is {a, b}
// **invariant**: current[i] corresponds to merged[i] in terms of key
// steps:
// turn merged style into {a?, b, c}
// add c, value of c is destStyles.c
// maybe remove a, aka call willLeave(a), then merged is either {b, c} or {a, b, c}
// turn current (interpolating) style from {a, b} into {a?, b, c}
// maybe remove a
// certainly add c, value of c is willEnter(c)
// loop over merged and construct new current
// dest doesn't change, that's owner's
function mergeAndSync(willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldLastIdealStyles, oldLastIdealVelocities) {
var newMergedPropsStyles = _mergeDiff2['default'](oldMergedPropsStyles, destStyles, function (oldIndex, oldMergedPropsStyle) {
var leavingStyle = willLeave(oldMergedPropsStyle);
if (leavingStyle == null) {
didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });
return null;
}
if (_shouldStopAnimation2['default'](oldCurrentStyles[oldIndex], leavingStyle, oldCurrentVelocities[oldIndex])) {
didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });
return null;
}
return { key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data, style: leavingStyle };
});
var newCurrentStyles = [];
var newCurrentVelocities = [];
var newLastIdealStyles = [];
var newLastIdealVelocities = [];
for (var i = 0; i < newMergedPropsStyles.length; i++) {
var newMergedPropsStyleCell = newMergedPropsStyles[i];
var foundOldIndex = null;
for (var j = 0; j < oldMergedPropsStyles.length; j++) {
if (oldMergedPropsStyles[j].key === newMergedPropsStyleCell.key) {
foundOldIndex = j;
break;
}
}
// TODO: key search code
if (foundOldIndex == null) {
var plainStyle = willEnter(newMergedPropsStyleCell);
newCurrentStyles[i] = plainStyle;
newLastIdealStyles[i] = plainStyle;
var velocity = _mapToZero2['default'](newMergedPropsStyleCell.style);
newCurrentVelocities[i] = velocity;
newLastIdealVelocities[i] = velocity;
} else {
newCurrentStyles[i] = oldCurrentStyles[foundOldIndex];
newLastIdealStyles[i] = oldLastIdealStyles[foundOldIndex];
newCurrentVelocities[i] = oldCurrentVelocities[foundOldIndex];
newLastIdealVelocities[i] = oldLastIdealVelocities[foundOldIndex];
}
}
return [newMergedPropsStyles, newCurrentStyles, newCurrentVelocities, newLastIdealStyles, newLastIdealVelocities];
}
var TransitionMotion = (function (_React$Component) {
_inherits(TransitionMotion, _React$Component);
_createClass(TransitionMotion, null, [{
key: 'propTypes',
value: {
defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].shape({
key: _propTypes2['default'].string.isRequired,
data: _propTypes2['default'].any,
style: _propTypes2['default'].objectOf(_propTypes2['default'].number).isRequired
})),
styles: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].arrayOf(_propTypes2['default'].shape({
key: _propTypes2['default'].string.isRequired,
data: _propTypes2['default'].any,
style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired
}))]).isRequired,
children: _propTypes2['default'].func.isRequired,
willEnter: _propTypes2['default'].func,
willLeave: _propTypes2['default'].func,
didLeave: _propTypes2['default'].func
},
enumerable: true
}, {
key: 'defaultProps',
value: {
willEnter: function willEnter(styleThatEntered) {
return _stripStyle2['default'](styleThatEntered.style);
},
// recall: returning null makes the current unmounting TransitionStyle
// disappear immediately
willLeave: function willLeave() {
return null;
},
didLeave: function didLeave() {}
},
enumerable: true
}]);
function TransitionMotion(props) {
var _this = this;
_classCallCheck(this, TransitionMotion);
_React$Component.call(this, props);
this.unmounting = false;
this.animationID = null;
this.prevTime = 0;
this.accumulatedTime = 0;
this.unreadPropStyles = null;
this.clearUnreadPropStyle = function (unreadPropStyles) {
var _mergeAndSync = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, unreadPropStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);
var mergedPropsStyles = _mergeAndSync[0];
var currentStyles = _mergeAndSync[1];
var currentVelocities = _mergeAndSync[2];
var lastIdealStyles = _mergeAndSync[3];
var lastIdealVelocities = _mergeAndSync[4];
for (var i = 0; i < unreadPropStyles.length; i++) {
var unreadPropStyle = unreadPropStyles[i].style;
var dirty = false;
for (var key in unreadPropStyle) {
if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {
continue;
}
var styleValue = unreadPropStyle[key];
if (typeof styleValue === 'number') {
if (!dirty) {
dirty = true;
currentStyles[i] = _extends({}, currentStyles[i]);
currentVelocities[i] = _extends({}, currentVelocities[i]);
lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);
lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);
mergedPropsStyles[i] = {
key: mergedPropsStyles[i].key,
data: mergedPropsStyles[i].data,
style: _extends({}, mergedPropsStyles[i].style)
};
}
currentStyles[i][key] = styleValue;
currentVelocities[i][key] = 0;
lastIdealStyles[i][key] = styleValue;
lastIdealVelocities[i][key] = 0;
mergedPropsStyles[i].style[key] = styleValue;
}
}
}
// unlike the other 2 components, we can't detect staleness and optionally
// opt out of setState here. each style object's data might contain new
// stuff we're not/cannot compare
_this.setState({
currentStyles: currentStyles,
currentVelocities: currentVelocities,
mergedPropsStyles: mergedPropsStyles,
lastIdealStyles: lastIdealStyles,
lastIdealVelocities: lastIdealVelocities
});
};
this.startAnimationIfNecessary = function () {
if (_this.unmounting) {
return;
}
// TODO: when config is {a: 10} and dest is {a: 10} do we raf once and
// call cb? No, otherwise accidental parent rerender causes cb trigger
_this.animationID = _raf2['default'](function (timestamp) {
// https://github.com/chenglou/react-motion/pull/420
// > if execution passes the conditional if (this.unmounting), then
// executes async defaultRaf and after that component unmounts and after
// that the callback of defaultRaf is called, then setState will be called
// on unmounted component.
if (_this.unmounting) {
return;
}
var propStyles = _this.props.styles;
var destStyles = typeof propStyles === 'function' ? propStyles(rehydrateStyles(_this.state.mergedPropsStyles, _this.unreadPropStyles, _this.state.lastIdealStyles)) : propStyles;
// check if we need to animate in the first place
if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities, _this.state.mergedPropsStyles)) {
// no need to cancel animationID here; shouldn't have any in flight
_this.animationID = null;
_this.accumulatedTime = 0;
return;
}
var currentTime = timestamp || _performanceNow2['default']();
var timeDelta = currentTime - _this.prevTime;
_this.prevTime = currentTime;
_this.accumulatedTime = _this.accumulatedTime + timeDelta;
// more than 10 frames? prolly switched browser tab. Restart
if (_this.accumulatedTime > msPerFrame * 10) {
_this.accumulatedTime = 0;
}
if (_this.accumulatedTime === 0) {
// no need to cancel animationID here; shouldn't have any in flight
_this.animationID = null;
_this.startAnimationIfNecessary();
return;
}
var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;
var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);
var _mergeAndSync2 = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, destStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);
var newMergedPropsStyles = _mergeAndSync2[0];
var newCurrentStyles = _mergeAndSync2[1];
var newCurrentVelocities = _mergeAndSync2[2];
var newLastIdealStyles = _mergeAndSync2[3];
var newLastIdealVelocities = _mergeAndSync2[4];
for (var i = 0; i < newMergedPropsStyles.length; i++) {
var newMergedPropsStyle = newMergedPropsStyles[i].style;
var newCurrentStyle = {};
var newCurrentVelocity = {};
var newLastIdealStyle = {};
var newLastIdealVelocity = {};
for (var key in newMergedPropsStyle) {
if (!Object.prototype.hasOwnProperty.call(newMergedPropsStyle, key)) {
continue;
}
var styleValue = newMergedPropsStyle[key];
if (typeof styleValue === 'number') {
newCurrentStyle[key] = styleValue;
newCurrentVelocity[key] = 0;
newLastIdealStyle[key] = styleValue;
newLastIdealVelocity[key] = 0;
} else {
var newLastIdealStyleValue = newLastIdealStyles[i][key];
var newLastIdealVelocityValue = newLastIdealVelocities[i][key];
for (var j = 0; j < framesToCatchUp; j++) {
var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
newLastIdealStyleValue = _stepper[0];
newLastIdealVelocityValue = _stepper[1];
}
var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
var nextIdealX = _stepper2[0];
var nextIdealV = _stepper2[1];
newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;
newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;
newLastIdealStyle[key] = newLastIdealStyleValue;
newLastIdealVelocity[key] = newLastIdealVelocityValue;
}
}
newLastIdealStyles[i] = newLastIdealStyle;
newLastIdealVelocities[i] = newLastIdealVelocity;
newCurrentStyles[i] = newCurrentStyle;
newCurrentVelocities[i] = newCurrentVelocity;
}
_this.animationID = null;
// the amount we're looped over above
_this.accumulatedTime -= framesToCatchUp * msPerFrame;
_this.setState({
currentStyles: newCurrentStyles,
currentVelocities: newCurrentVelocities,
lastIdealStyles: newLastIdealStyles,
lastIdealVelocities: newLastIdealVelocities,
mergedPropsStyles: newMergedPropsStyles
});
_this.unreadPropStyles = null;
_this.startAnimationIfNecessary();
});
};
this.state = this.defaultState();
}
TransitionMotion.prototype.defaultState = function defaultState() {
var _props = this.props;
var defaultStyles = _props.defaultStyles;
var styles = _props.styles;
var willEnter = _props.willEnter;
var willLeave = _props.willLeave;
var didLeave = _props.didLeave;
var destStyles = typeof styles === 'function' ? styles(defaultStyles) : styles;
// this is special. for the first time around, we don't have a comparison
// between last (no last) and current merged props. we'll compute last so:
// say default is {a, b} and styles (dest style) is {b, c}, we'll
// fabricate last as {a, b}
var oldMergedPropsStyles = undefined;
if (defaultStyles == null) {
oldMergedPropsStyles = destStyles;
} else {
oldMergedPropsStyles = defaultStyles.map(function (defaultStyleCell) {
// TODO: key search code
for (var i = 0; i < destStyles.length; i++) {
if (destStyles[i].key === defaultStyleCell.key) {
return destStyles[i];
}
}
return defaultStyleCell;
});
}
var oldCurrentStyles = defaultStyles == null ? destStyles.map(function (s) {
return _stripStyle2['default'](s.style);
}) : defaultStyles.map(function (s) {
return _stripStyle2['default'](s.style);
});
var oldCurrentVelocities = defaultStyles == null ? destStyles.map(function (s) {
return _mapToZero2['default'](s.style);
}) : defaultStyles.map(function (s) {
return _mapToZero2['default'](s.style);
});
var _mergeAndSync3 = mergeAndSync(
// Because this is an old-style createReactClass component, Flow doesn't
// understand that the willEnter and willLeave props have default values
// and will always be present.
willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldCurrentStyles, // oldLastIdealStyles really
oldCurrentVelocities);
var mergedPropsStyles = _mergeAndSync3[0];
var currentStyles = _mergeAndSync3[1];
var currentVelocities = _mergeAndSync3[2];
var lastIdealStyles = _mergeAndSync3[3];
var lastIdealVelocities = _mergeAndSync3[4];
// oldLastIdealVelocities really
return {
currentStyles: currentStyles,
currentVelocities: currentVelocities,
lastIdealStyles: lastIdealStyles,
lastIdealVelocities: lastIdealVelocities,
mergedPropsStyles: mergedPropsStyles
};
};
// after checking for unreadPropStyles != null, we manually go set the
// non-interpolating values (those that are a number, without a spring
// config)
TransitionMotion.prototype.componentDidMount = function componentDidMount() {
this.prevTime = _performanceNow2['default']();
this.startAnimationIfNecessary();
};
TransitionMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {
if (this.unreadPropStyles) {
// previous props haven't had the chance to be set yet; set them here
this.clearUnreadPropStyle(this.unreadPropStyles);
}
var styles = props.styles;
if (typeof styles === 'function') {
this.unreadPropStyles = styles(rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.lastIdealStyles));
} else {
this.unreadPropStyles = styles;
}
if (this.animationID == null) {
this.prevTime = _performanceNow2['default']();
this.startAnimationIfNecessary();
}
};
TransitionMotion.prototype.componentWillUnmount = function componentWillUnmount() {
this.unmounting = true;
if (this.animationID != null) {
_raf2['default'].cancel(this.animationID);
this.animationID = null;
}
};
TransitionMotion.prototype.render = function render() {
var hydratedStyles = rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.currentStyles);
var renderedChildren = this.props.children(hydratedStyles);
return renderedChildren && _react2['default'].Children.only(renderedChildren);
};
return TransitionMotion;
})(_react2['default'].Component);
exports['default'] = TransitionMotion;
module.exports = exports['default'];
// list of styles, each containing interpolating values. Part of what's passed
// to children function. Notice that this is
// Array<ActualInterpolatingStyleObject>, without the wrapper that is {key: ...,
// data: ... style: ActualInterpolatingStyleObject}. Only mergedPropsStyles
// contains the key & data info (so that we only have a single source of truth
// for these, and to save space). Check the comment for `rehydrateStyles` to
// see how we regenerate the entirety of what's passed to children function
// the array that keeps track of currently rendered stuff! Including stuff
// that you've unmounted but that's still animating. This is where it lives
// it's possible that currentStyle's value is stale: if props is immediately
// changed from 0 to 400 to spring(0) again, the async currentStyle is still
// at 0 (didn't have time to tick and interpolate even once). If we naively
// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).
// In reality currentStyle should be 400
webpack://frontend-tpt/../../node_modules/react-motion/lib/mapToZero.js
// currently used to initiate the velocity style object to 0
'use strict';
exports.__esModule = true;
exports['default'] = mapToZero;
function mapToZero(obj) {
var ret = {};
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
ret[key] = 0;
}
}
return ret;
}
module.exports = exports['default'];
webpack://frontend-tpt/../../node_modules/react-motion/lib/mergeDiff.js
// core keys merging algorithm. If previous render's keys are [a, b], and the
// next render's [c, b, d], what's the final merged keys and ordering?
// - c and a must both be before b
// - b before d
// - ordering between a and c ambiguous
// this reduces to merging two partially ordered lists (e.g. lists where not
// every item has a definite ordering, like comparing a and c above). For the
// ambiguous ordering we deterministically choose to place the next render's
// item after the previous'; so c after a
// this is called a topological sorting. Except the existing algorithms don't
// work well with js bc of the amount of allocation, and isn't optimized for our
// current use-case bc the runtime is linear in terms of edges (see wiki for
// meaning), which is huge when two lists have many common elements
'use strict';
exports.__esModule = true;
exports['default'] = mergeDiff;
function mergeDiff(prev, next, onRemove) {
// bookkeeping for easier access of a key's index below. This is 2 allocations +
// potentially triggering chrome hash map mode for objs (so it might be faster
var prevKeyIndex = {};
for (var i = 0; i < prev.length; i++) {
prevKeyIndex[prev[i].key] = i;
}
var nextKeyIndex = {};
for (var i = 0; i < next.length; i++) {
nextKeyIndex[next[i].key] = i;
}
// first, an overly elaborate way of merging prev and next, eliminating
// duplicates (in terms of keys). If there's dupe, keep the item in next).
// This way of writing it saves allocations
var ret = [];
for (var i = 0; i < next.length; i++) {
ret[i] = next[i];
}
for (var i = 0; i < prev.length; i++) {
if (!Object.prototype.hasOwnProperty.call(nextKeyIndex, prev[i].key)) {
// this is called my TM's `mergeAndSync`, which calls willLeave. We don't
// merge in keys that the user desires to kill
var fill = onRemove(i, prev[i]);
if (fill != null) {
ret.push(fill);
}
}
}
// now all the items all present. Core sorting logic to have the right order
return ret.sort(function (a, b) {
var nextOrderA = nextKeyIndex[a.key];
var nextOrderB = nextKeyIndex[b.key];
var prevOrderA = prevKeyIndex[a.key];
var prevOrderB = prevKeyIndex[b.key];
if (nextOrderA != null && nextOrderB != null) {
// both keys in next
return nextKeyIndex[a.key] - nextKeyIndex[b.key];
} else if (prevOrderA != null && prevOrderB != null) {
// both keys in prev
return prevKeyIndex[a.key] - prevKeyIndex[b.key];
} else if (nextOrderA != null) {
// key a in next, key b in prev
// how to determine the order between a and b? We find a "pivot" (term
// abuse), a key present in both prev and next, that is sandwiched between
// a and b. In the context of our above example, if we're comparing a and
// d, b's (the only) pivot
for (var i = 0; i < next.length; i++) {
var pivot = next[i].key;
if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {
continue;
}
if (nextOrderA < nextKeyIndex[pivot] && prevOrderB > prevKeyIndex[pivot]) {
return -1;
} else if (nextOrderA > nextKeyIndex[pivot] && prevOrderB < prevKeyIndex[pivot]) {
return 1;
}
}
// pluggable. default to: next bigger than prev
return 1;
}
// prevOrderA, nextOrderB
for (var i = 0; i < next.length; i++) {
var pivot = next[i].key;
if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {
continue;
}
if (nextOrderB < nextKeyIndex[pivot] && prevOrderA > prevKeyIndex[pivot]) {
return 1;
} else if (nextOrderB > nextKeyIndex[pivot] && prevOrderA < prevKeyIndex[pivot]) {
return -1;
}
}
// pluggable. default to: next bigger than prev
return -1;
});
}
module.exports = exports['default'];
// to loop through and find a key's index each time), but I no longer care
webpack://frontend-tpt/../../node_modules/react-motion/lib/presets.js
"use strict";
exports.__esModule = true;
exports["default"] = {
noWobble: { stiffness: 170, damping: 26 }, // the default, if nothing provided
gentle: { stiffness: 120, damping: 14 },
wobbly: { stiffness: 180, damping: 12 },
stiff: { stiffness: 210, damping: 20 }
};
module.exports = exports["default"];
webpack://frontend-tpt/../../node_modules/react-motion/lib/react-motion.js
'use strict';
exports.__esModule = true;
function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; }
var _Motion = require('./Motion');
exports.Motion = _interopRequire(_Motion);
var _StaggeredMotion = require('./StaggeredMotion');
exports.StaggeredMotion = _interopRequire(_StaggeredMotion);
var _TransitionMotion = require('./TransitionMotion');
exports.TransitionMotion = _interopRequire(_TransitionMotion);
var _spring = require('./spring');
exports.spring = _interopRequire(_spring);
var _presets = require('./presets');
exports.presets = _interopRequire(_presets);
var _stripStyle = require('./stripStyle');
exports.stripStyle = _interopRequire(_stripStyle);
// deprecated, dummy warning function
var _reorderKeys = require('./reorderKeys');
exports.reorderKeys = _interopRequire(_reorderKeys);
webpack://frontend-tpt/../../node_modules/react-motion/lib/reorderKeys.js
'use strict';
exports.__esModule = true;
exports['default'] = reorderKeys;
var hasWarned = false;
function reorderKeys() {
if (process.env.NODE_ENV === 'development') {
if (!hasWarned) {
hasWarned = true;
console.error('`reorderKeys` has been removed, since it is no longer needed for TransitionMotion\'s new styles array API.');
}
}
}
module.exports = exports['default'];
webpack://frontend-tpt/../../node_modules/react-motion/lib/shouldStopAnimation.js
// usage assumption: currentStyle values have already been rendered but it says
// nothing of whether currentStyle is stale (see unreadPropStyle)
'use strict';
exports.__esModule = true;
exports['default'] = shouldStopAnimation;
function shouldStopAnimation(currentStyle, style, currentVelocity) {
for (var key in style) {
if (!Object.prototype.hasOwnProperty.call(style, key)) {
continue;
}
if (currentVelocity[key] !== 0) {
return false;
}
var styleValue = typeof style[key] === 'number' ? style[key] : style[key].val;
// stepper will have already taken care of rounding precision errors, so
// won't have such thing as 0.9999 !=== 1
if (currentStyle[key] !== styleValue) {
return false;
}
}
return true;
}
module.exports = exports['default'];
webpack://frontend-tpt/../../node_modules/react-motion/lib/spring.js
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports['default'] = spring;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _presets = require('./presets');
var _presets2 = _interopRequireDefault(_presets);
var defaultConfig = _extends({}, _presets2['default'].noWobble, {
precision: 0.01
});
function spring(val, config) {
return _extends({}, defaultConfig, config, { val: val });
}
module.exports = exports['default'];
webpack://frontend-tpt/../../node_modules/react-motion/lib/stepper.js
// stepper is used a lot. Saves allocation to return the same array wrapper.
// This is fine and danger-free against mutations because the callsite
// immediately destructures it and gets the numbers inside without passing the
"use strict";
exports.__esModule = true;
exports["default"] = stepper;
var reusedTuple = [0, 0];
function stepper(secondPerFrame, x, v, destX, k, b, precision) {
// Spring stiffness, in kg / s^2
// for animations, destX is really spring length (spring at rest). initial
// position is considered as the stretched/compressed position of a spring
var Fspring = -k * (x - destX);
// Damping, in kg / s
var Fdamper = -b * v;
// usually we put mass here, but for animation purposes, specifying mass is a
// bit redundant. you could simply adjust k and b accordingly
// let a = (Fspring + Fdamper) / mass;
var a = Fspring + Fdamper;
var newV = v + a * secondPerFrame;
var newX = x + newV * secondPerFrame;
if (Math.abs(newV) < precision && Math.abs(newX - destX) < precision) {
reusedTuple[0] = destX;
reusedTuple[1] = 0;
return reusedTuple;
}
reusedTuple[0] = newX;
reusedTuple[1] = newV;
return reusedTuple;
}
module.exports = exports["default"];
// array reference around.
webpack://frontend-tpt/../../node_modules/react-motion/lib/stripStyle.js
// turn {x: {val: 1, stiffness: 1, damping: 2}, y: 2} generated by
// `{x: spring(1, {stiffness: 1, damping: 2}), y: 2}` into {x: 1, y: 2}
'use strict';
exports.__esModule = true;
exports['default'] = stripStyle;
function stripStyle(style) {
var ret = {};
for (var key in style) {
if (!Object.prototype.hasOwnProperty.call(style, key)) {
continue;
}
ret[key] = typeof style[key] === 'number' ? style[key] : style[key].val;
}
return ret;
}
module.exports = exports['default'];
webpack://frontend-tpt/../../node_modules/react-motion/node_modules/performance-now/lib/performance-now.js
// Generated by CoffeeScript 1.7.1
(function() {
var getNanoSeconds, hrtime, loadTime;
if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
module.exports = function() {
return performance.now();
};
} else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
module.exports = function() {
return (getNanoSeconds() - loadTime) / 1e6;
};
hrtime = process.hrtime;
getNanoSeconds = function() {
var hr;
hr = hrtime();
return hr[0] * 1e9 + hr[1];
};
loadTime = getNanoSeconds();
} else if (Date.now) {
module.exports = function() {
return Date.now() - loadTime;
};
loadTime = Date.now();
} else {
module.exports = function() {
return new Date().getTime() - loadTime;
};
loadTime = new Date().getTime();
}
}).call(this);
webpack://frontend-tpt/../../node_modules/react-native-svg/lib/module/ReactNativeSVG.web.js
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WebShape=exports.Use=exports.TextPath=exports.Text=exports.TSpan=exports.Symbol=exports.Svg=exports.Stop=exports.Rect=exports.RadialGradient=exports.Polyline=exports.Polygon=exports.Pattern=exports.Path=exports.Mask=exports.Marker=exports.LinearGradient=exports.Line=exports.Image=exports.G=exports.ForeignObject=exports.Ellipse=exports.Defs=exports.ClipPath=exports.Circle=void 0;var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _assertThisInitialized2=_interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _SvgTouchableMixin=_interopRequireDefault(require("./lib/SvgTouchableMixin"));var _resolve=require("./lib/resolve");var _excluded=["translate","translateX","translateY","scale","rotation","skewX","skewY","originX","originY","fontFamily","fontSize","fontWeight","fontStyle","style","forwardedRef"],_excluded2=["x","y"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var createElement=_reactNative.createElement||_reactNative.unstable_createElement;var hasTouchableProperty=function hasTouchableProperty(props){return props.onPress||props.onPressIn||props.onPressOut||props.onLongPress;};var prepare=function prepare(self){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:self.props;var translate=props.translate,translateX=props.translateX,translateY=props.translateY,scale=props.scale,rotation=props.rotation,skewX=props.skewX,skewY=props.skewY,originX=props.originX,originY=props.originY,fontFamily=props.fontFamily,fontSize=props.fontSize,fontWeight=props.fontWeight,fontStyle=props.fontStyle,style=props.style,forwardedRef=props.forwardedRef,rest=(0,_objectWithoutProperties2.default)(props,_excluded);var clean=Object.assign({},hasTouchableProperty(props)?{onStartShouldSetResponder:self.touchableHandleStartShouldSetResponder,onResponderTerminationRequest:self.touchableHandleResponderTerminationRequest,onResponderGrant:self.touchableHandleResponderGrant,onResponderMove:self.touchableHandleResponderMove,onResponderRelease:self.touchableHandleResponderRelease,onResponderTerminate:self.touchableHandleResponderTerminate}:null,rest);var transform=[];if(originX!=null||originY!=null){transform.push("translate("+(originX||0)+", "+(originY||0)+")");}if(translate!=null){transform.push("translate("+translate+")");}if(translateX!=null||translateY!=null){transform.push("translate("+(translateX||0)+", "+(translateY||0)+")");}if(scale!=null){transform.push("scale("+scale+")");}if(rotation!=null){transform.push("rotate("+rotation+")");}if(skewX!=null){transform.push("skewX("+skewX+")");}if(skewY!=null){transform.push("skewY("+skewY+")");}if(originX!=null||originY!=null){transform.push("translate("+(-originX||0)+", "+(-originY||0)+")");}if(transform.length){clean.transform=transform.join(' ');}if(forwardedRef){clean.ref=forwardedRef;}var styles={};if(fontFamily!=null){styles.fontFamily=fontFamily;}if(fontSize!=null){styles.fontSize=fontSize;}if(fontWeight!=null){styles.fontWeight=fontWeight;}if(fontStyle!=null){styles.fontStyle=fontStyle;}clean.style=(0,_resolve.resolve)(style,styles);return clean;};var getBoundingClientRect=function getBoundingClientRect(node){if(node){var isElement=node.nodeType===1;if(isElement&&typeof node.getBoundingClientRect==='function'){return node.getBoundingClientRect();}}};var measureLayout=function measureLayout(node,callback){var relativeNode=node&&node.parentNode;if(relativeNode){setTimeout(function(){var relativeRect=getBoundingClientRect(relativeNode);var _getBoundingClientRec=getBoundingClientRect(node),height=_getBoundingClientRec.height,left=_getBoundingClientRec.left,top=_getBoundingClientRec.top,width=_getBoundingClientRec.width;var x=left-relativeRect.left;var y=top-relativeRect.top;callback(x,y,width,height,left,top);},0);}};function remeasure(){var tag=this.state.touchable.responderID;if(tag==null){return;}measureLayout(tag,this._handleQueryLayout);}var WebShape=function(_React$Component){(0,_inherits2.default)(WebShape,_React$Component);var _super=_createSuper(WebShape);function WebShape(props,context){var _this;(0,_classCallCheck2.default)(this,WebShape);_this=_super.call(this,props,context);(0,_defineProperty2.default)((0,_assertThisInitialized2.default)(_this),"_remeasureMetricsOnActivation",void 0);(0,_defineProperty2.default)((0,_assertThisInitialized2.default)(_this),"touchableHandleStartShouldSetResponder",void 0);(0,_defineProperty2.default)((0,_assertThisInitialized2.default)(_this),"touchableHandleResponderMove",void 0);(0,_defineProperty2.default)((0,_assertThisInitialized2.default)(_this),"touchableHandleResponderGrant",void 0);(0,_defineProperty2.default)((0,_assertThisInitialized2.default)(_this),"touchableHandleResponderRelease",void 0);(0,_defineProperty2.default)((0,_assertThisInitialized2.default)(_this),"touchableHandleResponderTerminate",void 0);(0,_defineProperty2.default)((0,_assertThisInitialized2.default)(_this),"touchableHandleResponderTerminationRequest",void 0);if(hasTouchableProperty(props)){(0,_SvgTouchableMixin.default)((0,_assertThisInitialized2.default)(_this));}_this._remeasureMetricsOnActivation=remeasure.bind((0,_assertThisInitialized2.default)(_this));return _this;}return(0,_createClass2.default)(WebShape);}(React.Component);exports.WebShape=WebShape;var Circle=function(_WebShape){(0,_inherits2.default)(Circle,_WebShape);var _super2=_createSuper(Circle);function Circle(){(0,_classCallCheck2.default)(this,Circle);return _super2.apply(this,arguments);}(0,_createClass2.default)(Circle,[{key:"render",value:function render(){return createElement('circle',prepare(this));}}]);return Circle;}(WebShape);exports.Circle=Circle;var ClipPath=function(_WebShape2){(0,_inherits2.default)(ClipPath,_WebShape2);var _super3=_createSuper(ClipPath);function ClipPath(){(0,_classCallCheck2.default)(this,ClipPath);return _super3.apply(this,arguments);}(0,_createClass2.default)(ClipPath,[{key:"render",value:function render(){return createElement('clipPath',prepare(this));}}]);return ClipPath;}(WebShape);exports.ClipPath=ClipPath;var Defs=function(_WebShape3){(0,_inherits2.default)(Defs,_WebShape3);var _super4=_createSuper(Defs);function Defs(){(0,_classCallCheck2.default)(this,Defs);return _super4.apply(this,arguments);}(0,_createClass2.default)(Defs,[{key:"render",value:function render(){return createElement('defs',prepare(this));}}]);return Defs;}(WebShape);exports.Defs=Defs;var Ellipse=function(_WebShape4){(0,_inherits2.default)(Ellipse,_WebShape4);var _super5=_createSuper(Ellipse);function Ellipse(){(0,_classCallCheck2.default)(this,Ellipse);return _super5.apply(this,arguments);}(0,_createClass2.default)(Ellipse,[{key:"render",value:function render(){return createElement('ellipse',prepare(this));}}]);return Ellipse;}(WebShape);exports.Ellipse=Ellipse;var G=function(_WebShape5){(0,_inherits2.default)(G,_WebShape5);var _super6=_createSuper(G);function G(){(0,_classCallCheck2.default)(this,G);return _super6.apply(this,arguments);}(0,_createClass2.default)(G,[{key:"render",value:function render(){var _this$props=this.props,x=_this$props.x,y=_this$props.y,rest=(0,_objectWithoutProperties2.default)(_this$props,_excluded2);if((x||y)&&!rest.translate){rest.translate=(x||0)+", "+(y||0);}return createElement('g',prepare(this,rest));}}]);return G;}(WebShape);exports.G=G;var Image=function(_WebShape6){(0,_inherits2.default)(Image,_WebShape6);var _super7=_createSuper(Image);function Image(){(0,_classCallCheck2.default)(this,Image);return _super7.apply(this,arguments);}(0,_createClass2.default)(Image,[{key:"render",value:function render(){return createElement('image',prepare(this));}}]);return Image;}(WebShape);exports.Image=Image;var Line=function(_WebShape7){(0,_inherits2.default)(Line,_WebShape7);var _super8=_createSuper(Line);function Line(){(0,_classCallCheck2.default)(this,Line);return _super8.apply(this,arguments);}(0,_createClass2.default)(Line,[{key:"render",value:function render(){return createElement('line',prepare(this));}}]);return Line;}(WebShape);exports.Line=Line;var LinearGradient=function(_WebShape8){(0,_inherits2.default)(LinearGradient,_WebShape8);var _super9=_createSuper(LinearGradient);function LinearGradient(){(0,_classCallCheck2.default)(this,LinearGradient);return _super9.apply(this,arguments);}(0,_createClass2.default)(LinearGradient,[{key:"render",value:function render(){return createElement('linearGradient',prepare(this));}}]);return LinearGradient;}(WebShape);exports.LinearGradient=LinearGradient;var Path=function(_WebShape9){(0,_inherits2.default)(Path,_WebShape9);var _super10=_createSuper(Path);function Path(){(0,_classCallCheck2.default)(this,Path);return _super10.apply(this,arguments);}(0,_createClass2.default)(Path,[{key:"render",value:function render(){return createElement('path',prepare(this));}}]);return Path;}(WebShape);exports.Path=Path;var Polygon=function(_WebShape10){(0,_inherits2.default)(Polygon,_WebShape10);var _super11=_createSuper(Polygon);function Polygon(){(0,_classCallCheck2.default)(this,Polygon);return _super11.apply(this,arguments);}(0,_createClass2.default)(Polygon,[{key:"render",value:function render(){return createElement('polygon',prepare(this));}}]);return Polygon;}(WebShape);exports.Polygon=Polygon;var Polyline=function(_WebShape11){(0,_inherits2.default)(Polyline,_WebShape11);var _super12=_createSuper(Polyline);function Polyline(){(0,_classCallCheck2.default)(this,Polyline);return _super12.apply(this,arguments);}(0,_createClass2.default)(Polyline,[{key:"render",value:function render(){return createElement('polyline',prepare(this));}}]);return Polyline;}(WebShape);exports.Polyline=Polyline;var RadialGradient=function(_WebShape12){(0,_inherits2.default)(RadialGradient,_WebShape12);var _super13=_createSuper(RadialGradient);function RadialGradient(){(0,_classCallCheck2.default)(this,RadialGradient);return _super13.apply(this,arguments);}(0,_createClass2.default)(RadialGradient,[{key:"render",value:function render(){return createElement('radialGradient',prepare(this));}}]);return RadialGradient;}(WebShape);exports.RadialGradient=RadialGradient;var Rect=function(_WebShape13){(0,_inherits2.default)(Rect,_WebShape13);var _super14=_createSuper(Rect);function Rect(){(0,_classCallCheck2.default)(this,Rect);return _super14.apply(this,arguments);}(0,_createClass2.default)(Rect,[{key:"render",value:function render(){return createElement('rect',prepare(this));}}]);return Rect;}(WebShape);exports.Rect=Rect;var Stop=function(_WebShape14){(0,_inherits2.default)(Stop,_WebShape14);var _super15=_createSuper(Stop);function Stop(){(0,_classCallCheck2.default)(this,Stop);return _super15.apply(this,arguments);}(0,_createClass2.default)(Stop,[{key:"render",value:function render(){return createElement('stop',prepare(this));}}]);return Stop;}(WebShape);exports.Stop=Stop;var Svg=function(_WebShape15){(0,_inherits2.default)(Svg,_WebShape15);var _super16=_createSuper(Svg);function Svg(){(0,_classCallCheck2.default)(this,Svg);return _super16.apply(this,arguments);}(0,_createClass2.default)(Svg,[{key:"render",value:function render(){return createElement('svg',prepare(this));}}]);return Svg;}(WebShape);exports.Svg=Svg;var Symbol=function(_WebShape16){(0,_inherits2.default)(Symbol,_WebShape16);var _super17=_createSuper(Symbol);function Symbol(){(0,_classCallCheck2.default)(this,Symbol);return _super17.apply(this,arguments);}(0,_createClass2.default)(Symbol,[{key:"render",value:function render(){return createElement('symbol',prepare(this));}}]);return Symbol;}(WebShape);exports.Symbol=Symbol;var Text=function(_WebShape17){(0,_inherits2.default)(Text,_WebShape17);var _super18=_createSuper(Text);function Text(){(0,_classCallCheck2.default)(this,Text);return _super18.apply(this,arguments);}(0,_createClass2.default)(Text,[{key:"render",value:function render(){return createElement('text',prepare(this));}}]);return Text;}(WebShape);exports.Text=Text;var TSpan=function(_WebShape18){(0,_inherits2.default)(TSpan,_WebShape18);var _super19=_createSuper(TSpan);function TSpan(){(0,_classCallCheck2.default)(this,TSpan);return _super19.apply(this,arguments);}(0,_createClass2.default)(TSpan,[{key:"render",value:function render(){return createElement('tspan',prepare(this));}}]);return TSpan;}(WebShape);exports.TSpan=TSpan;var TextPath=function(_WebShape19){(0,_inherits2.default)(TextPath,_WebShape19);var _super20=_createSuper(TextPath);function TextPath(){(0,_classCallCheck2.default)(this,TextPath);return _super20.apply(this,arguments);}(0,_createClass2.default)(TextPath,[{key:"render",value:function render(){return createElement('textPath',prepare(this));}}]);return TextPath;}(WebShape);exports.TextPath=TextPath;var Use=function(_WebShape20){(0,_inherits2.default)(Use,_WebShape20);var _super21=_createSuper(Use);function Use(){(0,_classCallCheck2.default)(this,Use);return _super21.apply(this,arguments);}(0,_createClass2.default)(Use,[{key:"render",value:function render(){return createElement('use',prepare(this));}}]);return Use;}(WebShape);exports.Use=Use;var Mask=function(_WebShape21){(0,_inherits2.default)(Mask,_WebShape21);var _super22=_createSuper(Mask);function Mask(){(0,_classCallCheck2.default)(this,Mask);return _super22.apply(this,arguments);}(0,_createClass2.default)(Mask,[{key:"render",value:function render(){return createElement('mask',prepare(this));}}]);return Mask;}(WebShape);exports.Mask=Mask;var ForeignObject=function(_WebShape22){(0,_inherits2.default)(ForeignObject,_WebShape22);var _super23=_createSuper(ForeignObject);function ForeignObject(){(0,_classCallCheck2.default)(this,ForeignObject);return _super23.apply(this,arguments);}(0,_createClass2.default)(ForeignObject,[{key:"render",value:function render(){return createElement('foreignObject',prepare(this));}}]);return ForeignObject;}(WebShape);exports.ForeignObject=ForeignObject;var Marker=function(_WebShape23){(0,_inherits2.default)(Marker,_WebShape23);var _super24=_createSuper(Marker);function Marker(){(0,_classCallCheck2.default)(this,Marker);return _super24.apply(this,arguments);}(0,_createClass2.default)(Marker,[{key:"render",value:function render(){return createElement('marker',prepare(this));}}]);return Marker;}(WebShape);exports.Marker=Marker;var Pattern=function(_WebShape24){(0,_inherits2.default)(Pattern,_WebShape24);var _super25=_createSuper(Pattern);function Pattern(){(0,_classCallCheck2.default)(this,Pattern);return _super25.apply(this,arguments);}(0,_createClass2.default)(Pattern,[{key:"render",value:function render(){return createElement('pattern',prepare(this));}}]);return Pattern;}(WebShape);exports.Pattern=Pattern;var _default=Svg;exports.default=_default;
//# sourceMappingURL=ReactNativeSVG.web.js.map
webpack://frontend-tpt/../../node_modules/react-native-svg/lib/module/lib/SvgTouchableMixin.js
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var PRESS_RETENTION_OFFSET={top:20,left:20,right:20,bottom:30};var Mixin=_reactNative.Touchable.Mixin;var _touchableHandleStartShouldSetResponder=Mixin.touchableHandleStartShouldSetResponder,_touchableHandleResponderTerminationRequest=Mixin.touchableHandleResponderTerminationRequest,_touchableHandleResponderGrant=Mixin.touchableHandleResponderGrant,_touchableHandleResponderMove=Mixin.touchableHandleResponderMove,_touchableHandleResponderRelease=Mixin.touchableHandleResponderRelease,_touchableHandleResponderTerminate=Mixin.touchableHandleResponderTerminate,touchableGetInitialState=Mixin.touchableGetInitialState;var SvgTouchableMixin=Object.assign({},Mixin,{touchableHandleStartShouldSetResponder:function touchableHandleStartShouldSetResponder(e){var onStartShouldSetResponder=this.props.onStartShouldSetResponder;if(onStartShouldSetResponder){return onStartShouldSetResponder(e);}else{return _touchableHandleStartShouldSetResponder.call(this,e);}},touchableHandleResponderTerminationRequest:function touchableHandleResponderTerminationRequest(e){var onResponderTerminationRequest=this.props.onResponderTerminationRequest;if(onResponderTerminationRequest){return onResponderTerminationRequest(e);}else{return _touchableHandleResponderTerminationRequest.call(this,e);}},touchableHandleResponderGrant:function touchableHandleResponderGrant(e){var onResponderGrant=this.props.onResponderGrant;if(onResponderGrant){return onResponderGrant(e);}else{return _touchableHandleResponderGrant.call(this,e);}},touchableHandleResponderMove:function touchableHandleResponderMove(e){var onResponderMove=this.props.onResponderMove;if(onResponderMove){return onResponderMove(e);}else{return _touchableHandleResponderMove.call(this,e);}},touchableHandleResponderRelease:function touchableHandleResponderRelease(e){var onResponderRelease=this.props.onResponderRelease;if(onResponderRelease){return onResponderRelease(e);}else{return _touchableHandleResponderRelease.call(this,e);}},touchableHandleResponderTerminate:function touchableHandleResponderTerminate(e){var onResponderTerminate=this.props.onResponderTerminate;if(onResponderTerminate){return onResponderTerminate(e);}else{return _touchableHandleResponderTerminate.call(this,e);}},touchableHandlePress:function touchableHandlePress(e){var onPress=this.props.onPress;onPress&&onPress(e);},touchableHandleActivePressIn:function touchableHandleActivePressIn(e){var onPressIn=this.props.onPressIn;onPressIn&&onPressIn(e);},touchableHandleActivePressOut:function touchableHandleActivePressOut(e){var onPressOut=this.props.onPressOut;onPressOut&&onPressOut(e);},touchableHandleLongPress:function touchableHandleLongPress(e){var onLongPress=this.props.onLongPress;onLongPress&&onLongPress(e);},touchableGetPressRectOffset:function touchableGetPressRectOffset(){var pressRetentionOffset=this.props.pressRetentionOffset;return pressRetentionOffset||PRESS_RETENTION_OFFSET;},touchableGetHitSlop:function touchableGetHitSlop(){var hitSlop=this.props.hitSlop;return hitSlop;},touchableGetHighlightDelayMS:function touchableGetHighlightDelayMS(){var delayPressIn=this.props.delayPressIn;return delayPressIn||0;},touchableGetLongPressDelayMS:function touchableGetLongPressDelayMS(){var delayLongPress=this.props.delayLongPress;return delayLongPress===0?0:delayLongPress||500;},touchableGetPressOutDelayMS:function touchableGetPressOutDelayMS(){var delayPressOut=this.props.delayPressOut;return delayPressOut||0;}});var touchKeys=Object.keys(SvgTouchableMixin);var touchVals=touchKeys.map(function(key){return SvgTouchableMixin[key];});var numTouchKeys=touchKeys.length;var _default=function _default(target){for(var i=0;i<numTouchKeys;i++){var key=touchKeys[i];var val=touchVals[i];if(typeof val==='function'){target[key]=val.bind(target);}else{target[key]=val;}}target.state=touchableGetInitialState();};exports.default=_default;
//# sourceMappingURL=SvgTouchableMixin.js.map
webpack://frontend-tpt/../../node_modules/react-native-svg/lib/module/lib/resolve.js
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.resolve=resolve;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _reactNative=require("react-native");function resolve(styleProp,cleanedProps){if(styleProp){return _reactNative.StyleSheet?[styleProp,cleanedProps]:styleProp[Symbol.iterator]?Object.assign.apply(Object,[{}].concat((0,_toConsumableArray2.default)(styleProp),[cleanedProps])):Object.assign({},styleProp,cleanedProps);}else{return cleanedProps;}}
//# sourceMappingURL=resolve.js.map
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/AccessibilityInfo/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function isScreenReaderEnabled() {
return new Promise((resolve, reject) => {
resolve(true);
});
}
var prefersReducedMotionMedia = _canUseDom.default && typeof window.matchMedia === 'function' ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;
function isReduceMotionEnabled() {
return new Promise((resolve, reject) => {
resolve(prefersReducedMotionMedia ? prefersReducedMotionMedia.matches : true);
});
}
function addChangeListener(fn) {
if (prefersReducedMotionMedia != null) {
prefersReducedMotionMedia.addEventListener != null ? prefersReducedMotionMedia.addEventListener('change', fn) : prefersReducedMotionMedia.addListener(fn);
}
}
function removeChangeListener(fn) {
if (prefersReducedMotionMedia != null) {
prefersReducedMotionMedia.removeEventListener != null ? prefersReducedMotionMedia.removeEventListener('change', fn) : prefersReducedMotionMedia.removeListener(fn);
}
}
var handlers = {};
var AccessibilityInfo = {
/**
* Query whether a screen reader is currently enabled.
*
* Returns a promise which resolves to a boolean.
* The result is `true` when a screen reader is enabled and `false` otherwise.
*/
isScreenReaderEnabled,
/**
* Query whether the user prefers reduced motion.
*
* Returns a promise which resolves to a boolean.
* The result is `true` when a screen reader is enabled and `false` otherwise.
*/
isReduceMotionEnabled,
/**
* Deprecated
*/
fetch: isScreenReaderEnabled,
/**
* Add an event handler. Supported events: reduceMotionChanged
*/
addEventListener: function addEventListener(eventName, handler) {
if (eventName === 'reduceMotionChanged') {
if (!prefersReducedMotionMedia) {
return;
}
var listener = event => {
handler(event.matches);
};
addChangeListener(listener);
handlers[handler] = listener;
}
return {
remove: () => AccessibilityInfo.removeEventListener(eventName, handler)
};
},
/**
* Set accessibility focus to a react component.
*/
setAccessibilityFocus: function setAccessibilityFocus(reactTag) {},
/**
* Post a string to be announced by the screen reader.
*/
announceForAccessibility: function announceForAccessibility(announcement) {},
/**
* Remove an event handler.
*/
removeEventListener: function removeEventListener(eventName, handler) {
if (eventName === 'reduceMotionChanged') {
var listener = handlers[handler];
if (!listener || !prefersReducedMotionMedia) {
return;
}
removeChangeListener(listener);
}
return;
}
};
var _default = AccessibilityInfo;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/ActivityIndicator/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _excluded = ["animating", "color", "hidesWhenStopped", "size", "style"];
var createSvgCircle = style => /*#__PURE__*/React.createElement("circle", {
cx: "16",
cy: "16",
fill: "none",
r: "14",
strokeWidth: "4",
style: style
});
var ActivityIndicator = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var _props$animating = props.animating,
animating = _props$animating === void 0 ? true : _props$animating,
_props$color = props.color,
color = _props$color === void 0 ? '#1976D2' : _props$color,
_props$hidesWhenStopp = props.hidesWhenStopped,
hidesWhenStopped = _props$hidesWhenStopp === void 0 ? true : _props$hidesWhenStopp,
_props$size = props.size,
size = _props$size === void 0 ? 'small' : _props$size,
style = props.style,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
var svg = /*#__PURE__*/React.createElement("svg", {
height: "100%",
viewBox: "0 0 32 32",
width: "100%"
}, createSvgCircle({
stroke: color,
opacity: 0.2
}), createSvgCircle({
stroke: color,
strokeDasharray: 80,
strokeDashoffset: 60
}));
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, other, {
"aria-valuemax": 1,
"aria-valuemin": 0,
ref: forwardedRef,
role: "progressbar",
style: [styles.container, style]
}), /*#__PURE__*/React.createElement(_View.default, {
children: svg,
style: [typeof size === 'number' ? {
height: size,
width: size
} : indicatorSizes[size], styles.animation, !animating && styles.animationPause, !animating && hidesWhenStopped && styles.hidesWhenStopped]
}));
});
ActivityIndicator.displayName = 'ActivityIndicator';
var styles = _StyleSheet.default.create({
container: {
alignItems: 'center',
justifyContent: 'center'
},
hidesWhenStopped: {
visibility: 'hidden'
},
animation: {
animationDuration: '0.75s',
animationKeyframes: [{
'0%': {
transform: 'rotate(0deg)'
},
'100%': {
transform: 'rotate(360deg)'
}
}],
animationTimingFunction: 'linear',
animationIterationCount: 'infinite'
},
animationPause: {
animationPlayState: 'paused'
}
});
var indicatorSizes = _StyleSheet.default.create({
small: {
width: 20,
height: 20
},
large: {
width: 36,
height: 36
}
});
var _default = ActivityIndicator;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Alert/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
class Alert {
static alert() {}
}
var _default = Alert;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Animated/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _Animated = _interopRequireDefault(require("../../vendor/react-native/Animated/Animated"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _Animated.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var RootTagContext = /*#__PURE__*/React.createContext(null);
var AppContainer = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var children = props.children,
WrapperComponent = props.WrapperComponent;
var innerView = /*#__PURE__*/React.createElement(_View.default, {
children: children,
key: 1,
style: styles.appContainer
});
if (WrapperComponent) {
innerView = /*#__PURE__*/React.createElement(WrapperComponent, null, innerView);
}
return /*#__PURE__*/React.createElement(RootTagContext.Provider, {
value: props.rootTag
}, /*#__PURE__*/React.createElement(_View.default, {
ref: forwardedRef,
style: styles.appContainer
}, innerView));
});
AppContainer.displayName = 'AppContainer';
var _default = AppContainer;
exports.default = _default;
var styles = _StyleSheet.default.create({
appContainer: {
flex: 1,
pointerEvents: 'box-none'
}
});
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/AppRegistry/index.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _unmountComponentAtNode = _interopRequireDefault(require("../unmountComponentAtNode"));
var _renderApplication = _interopRequireWildcard(require("./renderApplication"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var emptyObject = {};
var runnables = {};
var componentProviderInstrumentationHook = component => component();
var wrapperComponentProvider;
/**
* `AppRegistry` is the JS entry point to running all React Native apps.
*/
class AppRegistry {
static getAppKeys() {
return Object.keys(runnables);
}
static getApplication(appKey, appParameters) {
(0, _invariant.default)(runnables[appKey] && runnables[appKey].getApplication, "Application " + appKey + " has not been registered. " + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');
return runnables[appKey].getApplication(appParameters);
}
static registerComponent(appKey, componentProvider) {
runnables[appKey] = {
getApplication: appParameters => (0, _renderApplication.getApplication)(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject, wrapperComponentProvider && wrapperComponentProvider(appParameters)),
run: appParameters => (0, _renderApplication.default)(componentProviderInstrumentationHook(componentProvider), wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback, {
hydrate: appParameters.hydrate || false,
initialProps: appParameters.initialProps || emptyObject,
mode: appParameters.mode || 'concurrent',
rootTag: appParameters.rootTag
})
};
return appKey;
}
static registerConfig(config) {
config.forEach(_ref => {
var appKey = _ref.appKey,
component = _ref.component,
run = _ref.run;
if (run) {
AppRegistry.registerRunnable(appKey, run);
} else {
(0, _invariant.default)(component, 'No component provider passed in');
AppRegistry.registerComponent(appKey, component);
}
});
}
// TODO: fix style sheet creation when using this method
static registerRunnable(appKey, run) {
runnables[appKey] = {
run
};
return appKey;
}
static runApplication(appKey, appParameters) {
var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';
if (isDevelopment) {
var params = (0, _objectSpread2.default)({}, appParameters);
params.rootTag = "#" + params.rootTag.id;
console.log("Running application \"" + appKey + "\" with appParams:\n", params, "\nDevelopment-level warnings: " + (isDevelopment ? 'ON' : 'OFF') + "." + ("\nPerformance optimizations: " + (isDevelopment ? 'OFF' : 'ON') + "."));
}
(0, _invariant.default)(runnables[appKey] && runnables[appKey].run, "Application \"" + appKey + "\" has not been registered. " + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');
return runnables[appKey].run(appParameters);
}
static setComponentProviderInstrumentationHook(hook) {
componentProviderInstrumentationHook = hook;
}
static setWrapperComponentProvider(provider) {
wrapperComponentProvider = provider;
}
static unmountApplicationComponentAtRootTag(rootTag) {
(0, _unmountComponentAtNode.default)(rootTag);
}
}
exports.default = AppRegistry;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/AppRegistry/renderApplication.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = renderApplication;
exports.getApplication = getApplication;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _AppContainer = _interopRequireDefault(require("./AppContainer"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _render = _interopRequireWildcard(require("../render"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _react = _interopRequireDefault(require("react"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function renderApplication(RootComponent, WrapperComponent, callback, options) {
var shouldHydrate = options.hydrate,
initialProps = options.initialProps,
mode = options.mode,
rootTag = options.rootTag;
var renderFn = shouldHydrate ? mode === 'concurrent' ? _render.hydrate : _render.hydrateLegacy : mode === 'concurrent' ? _render.render : _render.default;
(0, _invariant.default)(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag);
return renderFn( /*#__PURE__*/_react.default.createElement(_AppContainer.default, {
WrapperComponent: WrapperComponent,
ref: callback,
rootTag: rootTag
}, /*#__PURE__*/_react.default.createElement(RootComponent, initialProps)), rootTag);
}
function getApplication(RootComponent, initialProps, WrapperComponent) {
var element = /*#__PURE__*/_react.default.createElement(_AppContainer.default, {
WrapperComponent: WrapperComponent,
rootTag: {}
}, /*#__PURE__*/_react.default.createElement(RootComponent, initialProps));
// Don't escape CSS text
var getStyleElement = props => {
var sheet = _StyleSheet.default.getSheet();
return /*#__PURE__*/_react.default.createElement("style", (0, _extends2.default)({}, props, {
dangerouslySetInnerHTML: {
__html: sheet.textContent
},
id: sheet.id
}));
};
return {
element,
getStyleElement
};
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/AppState/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _EventEmitter = _interopRequireDefault(require("../../vendor/react-native/vendor/emitter/EventEmitter"));
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
// Android 4.4 browser
var isPrefixed = _canUseDom.default && !document.hasOwnProperty('hidden') && document.hasOwnProperty('webkitHidden');
var EVENT_TYPES = ['change', 'memoryWarning'];
var VISIBILITY_CHANGE_EVENT = isPrefixed ? 'webkitvisibilitychange' : 'visibilitychange';
var VISIBILITY_STATE_PROPERTY = isPrefixed ? 'webkitVisibilityState' : 'visibilityState';
var AppStates = {
BACKGROUND: 'background',
ACTIVE: 'active'
};
var changeEmitter = null;
class AppState {
static get currentState() {
if (!AppState.isAvailable) {
return AppStates.ACTIVE;
}
switch (document[VISIBILITY_STATE_PROPERTY]) {
case 'hidden':
case 'prerender':
case 'unloaded':
return AppStates.BACKGROUND;
default:
return AppStates.ACTIVE;
}
}
static addEventListener(type, handler) {
if (AppState.isAvailable) {
(0, _invariant.default)(EVENT_TYPES.indexOf(type) !== -1, 'Trying to subscribe to unknown event: "%s"', type);
if (type === 'change') {
if (!changeEmitter) {
changeEmitter = new _EventEmitter.default();
document.addEventListener(VISIBILITY_CHANGE_EVENT, () => {
if (changeEmitter) {
changeEmitter.emit('change', AppState.currentState);
}
}, false);
}
return changeEmitter.addListener(type, handler);
}
}
}
}
exports.default = AppState;
AppState.isAvailable = _canUseDom.default && document[VISIBILITY_STATE_PROPERTY];
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Appearance/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function getQuery() {
return _canUseDom.default && window.matchMedia != null ? window.matchMedia('(prefers-color-scheme: dark)') : null;
}
var query = getQuery();
var listenerMapping = new WeakMap();
var Appearance = {
getColorScheme() {
return query && query.matches ? 'dark' : 'light';
},
addChangeListener(listener) {
var mappedListener = listenerMapping.get(listener);
if (!mappedListener) {
mappedListener = _ref => {
var matches = _ref.matches;
listener({
colorScheme: matches ? 'dark' : 'light'
});
};
listenerMapping.set(listener, mappedListener);
}
if (query) {
query.addListener(mappedListener);
}
function remove() {
var mappedListener = listenerMapping.get(listener);
if (query && mappedListener) {
query.removeListener(mappedListener);
}
listenerMapping.delete(listener);
}
return {
remove
};
}
};
var _default = Appearance;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/BackHandler/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function emptyFunction() {}
var BackHandler = {
exitApp: emptyFunction,
addEventListener() {
console.error('BackHandler is not supported on web and should not be used.');
return {
remove: emptyFunction
};
},
removeEventListener: emptyFunction
};
var _default = BackHandler;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Button/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _TouchableOpacity = _interopRequireDefault(require("../TouchableOpacity"));
var _Text = _interopRequireDefault(require("../Text"));
var _warnOnce = require("../../modules/warnOnce");
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var Button = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
(0, _warnOnce.warnOnce)('Button', 'Button is deprecated. Please use Pressable.');
var accessibilityLabel = props.accessibilityLabel,
color = props.color,
disabled = props.disabled,
onPress = props.onPress,
testID = props.testID,
title = props.title;
return /*#__PURE__*/React.createElement(_TouchableOpacity.default, {
accessibilityLabel: accessibilityLabel,
accessibilityRole: "button",
disabled: disabled,
focusable: !disabled,
onPress: onPress,
ref: forwardedRef,
style: [styles.button, color && {
backgroundColor: color
}, disabled && styles.buttonDisabled],
testID: testID
}, /*#__PURE__*/React.createElement(_Text.default, {
style: [styles.text, disabled && styles.textDisabled]
}, title));
});
Button.displayName = 'Button';
var styles = _StyleSheet.default.create({
button: {
backgroundColor: '#2196F3',
borderRadius: 2
},
text: {
color: '#fff',
fontWeight: '500',
padding: 8,
textAlign: 'center',
textTransform: 'uppercase'
},
buttonDisabled: {
backgroundColor: '#dfdfdf'
},
textDisabled: {
color: '#a1a1a1'
}
});
var _default = Button;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/CheckBox/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _createElement = _interopRequireDefault(require("../createElement"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _excluded = ["aria-readonly", "color", "disabled", "onChange", "onValueChange", "readOnly", "style", "value"];
var CheckBox = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var ariaReadOnly = props['aria-readonly'],
color = props.color,
disabled = props.disabled,
onChange = props.onChange,
onValueChange = props.onValueChange,
readOnly = props.readOnly,
style = props.style,
value = props.value,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
function handleChange(event) {
var value = event.nativeEvent.target.checked;
event.nativeEvent.value = value;
onChange && onChange(event);
onValueChange && onValueChange(value);
}
var fakeControl = /*#__PURE__*/React.createElement(_View.default, {
style: [styles.fakeControl, value && styles.fakeControlChecked,
// custom color
value && color && {
backgroundColor: color,
borderColor: color
}, disabled && styles.fakeControlDisabled, value && disabled && styles.fakeControlCheckedAndDisabled]
});
var nativeControl = (0, _createElement.default)('input', {
checked: value,
disabled: disabled,
onChange: handleChange,
readOnly: readOnly === true || ariaReadOnly === true || other.accessibilityReadOnly === true,
ref: forwardedRef,
style: [styles.nativeControl, styles.cursorInherit],
type: 'checkbox'
});
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, other, {
"aria-disabled": disabled,
"aria-readonly": ariaReadOnly,
style: [styles.root, style, disabled && styles.cursorDefault]
}), fakeControl, nativeControl);
});
CheckBox.displayName = 'CheckBox';
var styles = _StyleSheet.default.create({
root: {
cursor: 'pointer',
height: 16,
userSelect: 'none',
width: 16
},
cursorDefault: {
cursor: 'default'
},
cursorInherit: {
cursor: 'inherit'
},
fakeControl: {
alignItems: 'center',
backgroundColor: '#fff',
borderColor: '#657786',
borderRadius: 2,
borderStyle: 'solid',
borderWidth: 2,
height: '100%',
justifyContent: 'center',
width: '100%'
},
fakeControlChecked: {
backgroundColor: '#009688',
backgroundImage: 'url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K")',
backgroundRepeat: 'no-repeat',
borderColor: '#009688'
},
fakeControlDisabled: {
borderColor: '#CCD6DD'
},
fakeControlCheckedAndDisabled: {
backgroundColor: '#AAB8C2',
borderColor: '#AAB8C2'
},
nativeControl: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _StyleSheet.default.absoluteFillObject), {}, {
height: '100%',
margin: 0,
appearance: 'none',
padding: 0,
width: '100%'
})
});
var _default = CheckBox;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Clipboard/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var clipboardAvailable;
class Clipboard {
static isAvailable() {
if (clipboardAvailable === undefined) {
clipboardAvailable = typeof document.queryCommandSupported === 'function' && document.queryCommandSupported('copy');
}
return clipboardAvailable;
}
static getString() {
return Promise.resolve('');
}
static setString(text) {
var success = false;
var body = document.body;
if (body) {
// add the text to a hidden node
var node = document.createElement('span');
node.textContent = text;
node.style.opacity = '0';
node.style.position = 'absolute';
node.style.whiteSpace = 'pre-wrap';
node.style.userSelect = 'auto';
body.appendChild(node);
// select the text
var selection = window.getSelection();
selection.removeAllRanges();
var range = document.createRange();
range.selectNodeContents(node);
selection.addRange(range);
// attempt to copy
try {
document.execCommand('copy');
success = true;
} catch (e) {}
// remove selection and node
selection.removeAllRanges();
body.removeChild(node);
}
return success;
}
}
exports.default = Clipboard;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/DeviceEventEmitter/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _RCTDeviceEventEmitter = _interopRequireDefault(require("../../vendor/react-native/EventEmitter/RCTDeviceEventEmitter"));
var _default = _RCTDeviceEventEmitter.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Dimensions/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var dimensions = {
window: {
fontScale: 1,
height: 0,
scale: 1,
width: 0
},
screen: {
fontScale: 1,
height: 0,
scale: 1,
width: 0
}
};
var listeners = {};
var shouldInit = _canUseDom.default;
function update() {
if (!_canUseDom.default) {
return;
}
var win = window;
var height;
var width;
/**
* iOS does not update viewport dimensions on keyboard open/close.
* window.visualViewport(https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport)
* is used instead of document.documentElement.clientHeight (which remains as a fallback)
*/
if (win.visualViewport) {
var visualViewport = win.visualViewport;
/**
* We are multiplying by scale because height and width from visual viewport
* also react to pinch zoom, and become smaller when zoomed. But it is not desired
* behaviour, since originally documentElement client height and width were used,
* and they do not react to pinch zoom.
*/
height = Math.round(visualViewport.height * visualViewport.scale);
width = Math.round(visualViewport.width * visualViewport.scale);
} else {
var docEl = win.document.documentElement;
height = docEl.clientHeight;
width = docEl.clientWidth;
}
dimensions.window = {
fontScale: 1,
height,
scale: win.devicePixelRatio || 1,
width
};
dimensions.screen = {
fontScale: 1,
height: win.screen.height,
scale: win.devicePixelRatio || 1,
width: win.screen.width
};
}
function handleResize() {
update();
if (Array.isArray(listeners['change'])) {
listeners['change'].forEach(handler => handler(dimensions));
}
}
class Dimensions {
static get(dimension) {
if (shouldInit) {
shouldInit = false;
update();
}
(0, _invariant.default)(dimensions[dimension], "No dimension set for key " + dimension);
return dimensions[dimension];
}
static set(initialDimensions) {
if (initialDimensions) {
if (_canUseDom.default) {
(0, _invariant.default)(false, 'Dimensions cannot be set in the browser');
} else {
if (initialDimensions.screen != null) {
dimensions.screen = initialDimensions.screen;
}
if (initialDimensions.window != null) {
dimensions.window = initialDimensions.window;
}
}
}
}
static addEventListener(type, handler) {
listeners[type] = listeners[type] || [];
listeners[type].push(handler);
return {
remove: () => {
this.removeEventListener(type, handler);
}
};
}
static removeEventListener(type, handler) {
if (Array.isArray(listeners[type])) {
listeners[type] = listeners[type].filter(_handler => _handler !== handler);
}
}
}
exports.default = Dimensions;
if (_canUseDom.default) {
if (window.visualViewport) {
window.visualViewport.addEventListener('resize', handleResize, false);
} else {
window.addEventListener('resize', handleResize, false);
}
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Easing/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _Easing = _interopRequireDefault(require("../../vendor/react-native/Animated/Easing"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _Easing.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/FlatList/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _FlatList = _interopRequireDefault(require("../../vendor/react-native/FlatList"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _FlatList.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/I18nManager/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var I18nManager = {
allowRTL() {
return;
},
forceRTL() {
return;
},
getConstants() {
return {
isRTL: false
};
}
};
var _default = I18nManager;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Image/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _createElement = _interopRequireDefault(require("../createElement"));
var _AssetRegistry = require("../../modules/AssetRegistry");
var _preprocess = require("../StyleSheet/preprocess");
var _ImageLoader = _interopRequireDefault(require("../../modules/ImageLoader"));
var _PixelRatio = _interopRequireDefault(require("../PixelRatio"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _TextAncestorContext = _interopRequireDefault(require("../Text/TextAncestorContext"));
var _View = _interopRequireDefault(require("../View"));
var _warnOnce = require("../../modules/warnOnce");
var _excluded = ["aria-label", "blurRadius", "defaultSource", "draggable", "onError", "onLayout", "onLoad", "onLoadEnd", "onLoadStart", "pointerEvents", "source", "style"];
var ERRORED = 'ERRORED';
var LOADED = 'LOADED';
var LOADING = 'LOADING';
var IDLE = 'IDLE';
var _filterId = 0;
var svgDataUriPattern = /^(data:image\/svg\+xml;utf8,)(.*)/;
function createTintColorSVG(tintColor, id) {
return tintColor && id != null ? /*#__PURE__*/React.createElement("svg", {
style: {
position: 'absolute',
height: 0,
visibility: 'hidden',
width: 0
}
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("filter", {
id: "tint-" + id,
suppressHydrationWarning: true
}, /*#__PURE__*/React.createElement("feFlood", {
floodColor: "" + tintColor,
key: tintColor
}), /*#__PURE__*/React.createElement("feComposite", {
in2: "SourceAlpha",
operator: "atop"
})))) : null;
}
function extractNonStandardStyleProps(style, blurRadius, filterId, tintColorProp) {
var flatStyle = _StyleSheet.default.flatten(style);
var filter = flatStyle.filter,
resizeMode = flatStyle.resizeMode,
shadowOffset = flatStyle.shadowOffset,
tintColor = flatStyle.tintColor;
if (flatStyle.resizeMode) {
(0, _warnOnce.warnOnce)('Image.style.resizeMode', 'Image: style.resizeMode is deprecated. Please use props.resizeMode.');
}
if (flatStyle.tintColor) {
(0, _warnOnce.warnOnce)('Image.style.tintColor', 'Image: style.tintColor is deprecated. Please use props.tintColor.');
}
// Add CSS filters
// React Native exposes these features as props and proprietary styles
var filters = [];
var _filter = null;
if (filter) {
filters.push(filter);
}
if (blurRadius) {
filters.push("blur(" + blurRadius + "px)");
}
if (shadowOffset) {
var shadowString = (0, _preprocess.createBoxShadowValue)(flatStyle);
if (shadowString) {
filters.push("drop-shadow(" + shadowString + ")");
}
}
if ((tintColorProp || tintColor) && filterId != null) {
filters.push("url(#tint-" + filterId + ")");
}
if (filters.length > 0) {
_filter = filters.join(' ');
}
return [resizeMode, _filter, tintColor];
}
function resolveAssetDimensions(source) {
if (typeof source === 'number') {
var _getAssetByID = (0, _AssetRegistry.getAssetByID)(source),
_height = _getAssetByID.height,
_width = _getAssetByID.width;
return {
height: _height,
width: _width
};
} else if (source != null && !Array.isArray(source) && typeof source === 'object') {
var _height2 = source.height,
_width2 = source.width;
return {
height: _height2,
width: _width2
};
}
}
function resolveAssetUri(source) {
var uri = null;
if (typeof source === 'number') {
// get the URI from the packager
var asset = (0, _AssetRegistry.getAssetByID)(source);
if (asset == null) {
throw new Error("Image: asset with ID \"" + source + "\" could not be found. Please check the image source or packager.");
}
var scale = asset.scales[0];
if (asset.scales.length > 1) {
var preferredScale = _PixelRatio.default.get();
// Get the scale which is closest to the preferred scale
scale = asset.scales.reduce((prev, curr) => Math.abs(curr - preferredScale) < Math.abs(prev - preferredScale) ? curr : prev);
}
var scaleSuffix = scale !== 1 ? "@" + scale + "x" : '';
uri = asset ? asset.httpServerLocation + "/" + asset.name + scaleSuffix + "." + asset.type : '';
} else if (typeof source === 'string') {
uri = source;
} else if (source && typeof source.uri === 'string') {
uri = source.uri;
}
if (uri) {
var match = uri.match(svgDataUriPattern);
// inline SVG markup may contain characters (e.g., #, ") that need to be escaped
if (match) {
var prefix = match[1],
svg = match[2];
var encodedSvg = encodeURIComponent(svg);
return "" + prefix + encodedSvg;
}
}
return uri;
}
var Image = /*#__PURE__*/React.forwardRef((props, ref) => {
var ariaLabel = props['aria-label'],
blurRadius = props.blurRadius,
defaultSource = props.defaultSource,
draggable = props.draggable,
onError = props.onError,
onLayout = props.onLayout,
onLoad = props.onLoad,
onLoadEnd = props.onLoadEnd,
onLoadStart = props.onLoadStart,
pointerEvents = props.pointerEvents,
source = props.source,
style = props.style,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
if (process.env.NODE_ENV !== 'production') {
if (props.children) {
throw new Error('The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.');
}
}
var _React$useState = React.useState(() => {
var uri = resolveAssetUri(source);
if (uri != null) {
var isLoaded = _ImageLoader.default.has(uri);
if (isLoaded) {
return LOADED;
}
}
return IDLE;
}),
state = _React$useState[0],
updateState = _React$useState[1];
var _React$useState2 = React.useState({}),
layout = _React$useState2[0],
updateLayout = _React$useState2[1];
var hasTextAncestor = React.useContext(_TextAncestorContext.default);
var hiddenImageRef = React.useRef(null);
var filterRef = React.useRef(_filterId++);
var requestRef = React.useRef(null);
var shouldDisplaySource = state === LOADED || state === LOADING && defaultSource == null;
var _extractNonStandardSt = extractNonStandardStyleProps(style, blurRadius, filterRef.current, props.tintColor),
_resizeMode = _extractNonStandardSt[0],
filter = _extractNonStandardSt[1],
_tintColor = _extractNonStandardSt[2];
var resizeMode = props.resizeMode || _resizeMode || 'cover';
var tintColor = props.tintColor || _tintColor;
var selectedSource = shouldDisplaySource ? source : defaultSource;
var displayImageUri = resolveAssetUri(selectedSource);
var imageSizeStyle = resolveAssetDimensions(selectedSource);
var backgroundImage = displayImageUri ? "url(\"" + displayImageUri + "\")" : null;
var backgroundSize = getBackgroundSize();
// Accessibility image allows users to trigger the browser's image context menu
var hiddenImage = displayImageUri ? (0, _createElement.default)('img', {
alt: ariaLabel || '',
style: styles.accessibilityImage$raw,
draggable: draggable || false,
ref: hiddenImageRef,
src: displayImageUri
}) : null;
function getBackgroundSize() {
if (hiddenImageRef.current != null && (resizeMode === 'center' || resizeMode === 'repeat')) {
var _hiddenImageRef$curre = hiddenImageRef.current,
naturalHeight = _hiddenImageRef$curre.naturalHeight,
naturalWidth = _hiddenImageRef$curre.naturalWidth;
var _height3 = layout.height,
_width3 = layout.width;
if (naturalHeight && naturalWidth && _height3 && _width3) {
var scaleFactor = Math.min(1, _width3 / naturalWidth, _height3 / naturalHeight);
var x = Math.ceil(scaleFactor * naturalWidth);
var y = Math.ceil(scaleFactor * naturalHeight);
return x + "px " + y + "px";
}
}
}
function handleLayout(e) {
if (resizeMode === 'center' || resizeMode === 'repeat' || onLayout) {
var _layout = e.nativeEvent.layout;
onLayout && onLayout(e);
updateLayout(_layout);
}
}
// Image loading
var uri = resolveAssetUri(source);
React.useEffect(() => {
abortPendingRequest();
if (uri != null) {
updateState(LOADING);
if (onLoadStart) {
onLoadStart();
}
requestRef.current = _ImageLoader.default.load(uri, function load(e) {
updateState(LOADED);
if (onLoad) {
onLoad(e);
}
if (onLoadEnd) {
onLoadEnd();
}
}, function error() {
updateState(ERRORED);
if (onError) {
onError({
nativeEvent: {
error: "Failed to load resource " + uri + " (404)"
}
});
}
if (onLoadEnd) {
onLoadEnd();
}
});
}
function abortPendingRequest() {
if (requestRef.current != null) {
_ImageLoader.default.abort(requestRef.current);
requestRef.current = null;
}
}
return abortPendingRequest;
}, [uri, requestRef, updateState, onError, onLoad, onLoadEnd, onLoadStart]);
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, rest, {
"aria-label": ariaLabel,
onLayout: handleLayout,
pointerEvents: pointerEvents,
ref: ref,
style: [styles.root, hasTextAncestor && styles.inline, imageSizeStyle, style, styles.undo,
// TEMP: avoid deprecated shadow props regression
// until Image refactored to use createElement.
{
boxShadow: null
}]
}), /*#__PURE__*/React.createElement(_View.default, {
style: [styles.image, resizeModeStyles[resizeMode], {
backgroundImage,
filter
}, backgroundSize != null && {
backgroundSize
}],
suppressHydrationWarning: true
}), hiddenImage, createTintColorSVG(tintColor, filterRef.current));
});
Image.displayName = 'Image';
// $FlowIgnore: This is the correct type, but casting makes it unhappy since the variables aren't defined yet
var ImageWithStatics = Image;
ImageWithStatics.getSize = function (uri, success, failure) {
_ImageLoader.default.getSize(uri, success, failure);
};
ImageWithStatics.prefetch = function (uri) {
return _ImageLoader.default.prefetch(uri);
};
ImageWithStatics.queryCache = function (uris) {
return _ImageLoader.default.queryCache(uris);
};
var styles = _StyleSheet.default.create({
root: {
flexBasis: 'auto',
overflow: 'hidden',
zIndex: 0
},
inline: {
display: 'inline-flex'
},
undo: {
// These styles are converted to CSS filters applied to the
// element displaying the background image.
blurRadius: null,
shadowColor: null,
shadowOpacity: null,
shadowOffset: null,
shadowRadius: null,
tintColor: null,
// These styles are not supported
overlayColor: null,
resizeMode: null
},
image: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _StyleSheet.default.absoluteFillObject), {}, {
backgroundColor: 'transparent',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
backgroundSize: 'cover',
height: '100%',
width: '100%',
zIndex: -1
}),
accessibilityImage$raw: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _StyleSheet.default.absoluteFillObject), {}, {
height: '100%',
opacity: 0,
width: '100%',
zIndex: -1
})
});
var resizeModeStyles = _StyleSheet.default.create({
center: {
backgroundSize: 'auto'
},
contain: {
backgroundSize: 'contain'
},
cover: {
backgroundSize: 'cover'
},
none: {
backgroundPosition: '0',
backgroundSize: 'auto'
},
repeat: {
backgroundPosition: '0',
backgroundRepeat: 'repeat',
backgroundSize: 'auto'
},
stretch: {
backgroundSize: '100% 100%'
}
});
var _default = ImageWithStatics;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/ImageBackground/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _Image = _interopRequireDefault(require("../Image"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _excluded = ["children", "style", "imageStyle", "imageRef"];
var emptyObject = {};
/**
* Very simple drop-in replacement for <Image> which supports nesting views.
*/
var ImageBackground = /*#__PURE__*/(0, React.forwardRef)((props, forwardedRef) => {
var children = props.children,
_props$style = props.style,
style = _props$style === void 0 ? emptyObject : _props$style,
imageStyle = props.imageStyle,
imageRef = props.imageRef,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
var _StyleSheet$flatten = _StyleSheet.default.flatten(style),
height = _StyleSheet$flatten.height,
width = _StyleSheet$flatten.width;
return /*#__PURE__*/React.createElement(_View.default, {
ref: forwardedRef,
style: style
}, /*#__PURE__*/React.createElement(_Image.default, (0, _extends2.default)({}, rest, {
ref: imageRef,
style: [{
// Temporary Workaround:
// Current (imperfect yet) implementation of <Image> overwrites width and height styles
// (which is not quite correct), and these styles conflict with explicitly set styles
// of <ImageBackground> and with our internal layout model here.
// So, we have to proxy/reapply these styles explicitly for actual <Image> component.
// This workaround should be removed after implementing proper support of
// intrinsic content size of the <Image>.
width,
height,
zIndex: -1
}, _StyleSheet.default.absoluteFill, imageStyle]
})), children);
});
ImageBackground.displayName = 'ImageBackground';
var _default = ImageBackground;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/InteractionManager/TaskQueue.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
class TaskQueue {
constructor(_ref) {
var onMoreTasks = _ref.onMoreTasks;
this._onMoreTasks = onMoreTasks;
this._queueStack = [{
tasks: [],
popable: true
}];
}
enqueue(task) {
this._getCurrentQueue().push(task);
}
enqueueTasks(tasks) {
tasks.forEach(task => this.enqueue(task));
}
cancelTasks(tasksToCancel) {
this._queueStack = this._queueStack.map(queue => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, queue), {}, {
tasks: queue.tasks.filter(task => tasksToCancel.indexOf(task) === -1)
})).filter((queue, idx) => queue.tasks.length > 0 || idx === 0);
}
hasTasksToProcess() {
return this._getCurrentQueue().length > 0;
}
/**
* Executes the next task in the queue.
*/
processNext() {
var queue = this._getCurrentQueue();
if (queue.length) {
var task = queue.shift();
try {
if (typeof task === 'object' && task.gen) {
this._genPromise(task);
} else if (typeof task === 'object' && task.run) {
task.run();
} else {
(0, _invariant.default)(typeof task === 'function', 'Expected Function, SimpleTask, or PromiseTask, but got:\n' + JSON.stringify(task, null, 2));
task();
}
} catch (e) {
e.message = 'TaskQueue: Error with task ' + (task.name || '') + ': ' + e.message;
throw e;
}
}
}
_getCurrentQueue() {
var stackIdx = this._queueStack.length - 1;
var queue = this._queueStack[stackIdx];
if (queue.popable && queue.tasks.length === 0 && stackIdx > 0) {
this._queueStack.pop();
return this._getCurrentQueue();
} else {
return queue.tasks;
}
}
_genPromise(task) {
var length = this._queueStack.push({
tasks: [],
popable: false
});
var stackIdx = length - 1;
var stackItem = this._queueStack[stackIdx];
task.gen().then(() => {
stackItem.popable = true;
this.hasTasksToProcess() && this._onMoreTasks();
}).catch(ex => {
setTimeout(() => {
ex.message = "TaskQueue: Error resolving Promise in task " + task.name + ": " + ex.message;
throw ex;
}, 0);
});
}
}
var _default = TaskQueue;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/InteractionManager/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _TaskQueue = _interopRequireDefault(require("./TaskQueue"));
var _EventEmitter = _interopRequireDefault(require("../../vendor/react-native/vendor/emitter/EventEmitter"));
var _requestIdleCallback = _interopRequireDefault(require("../../modules/requestIdleCallback"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _emitter = new _EventEmitter.default();
var InteractionManager = {
Events: {
interactionStart: 'interactionStart',
interactionComplete: 'interactionComplete'
},
/**
* Schedule a function to run after all interactions have completed.
*/
runAfterInteractions(task) {
var tasks = [];
var promise = new Promise(resolve => {
_scheduleUpdate();
if (task) {
tasks.push(task);
}
tasks.push({
run: resolve,
name: 'resolve ' + (task && task.name || '?')
});
_taskQueue.enqueueTasks(tasks);
});
return {
then: promise.then.bind(promise),
done: promise.then.bind(promise),
cancel: () => {
_taskQueue.cancelTasks(tasks);
}
};
},
/**
* Notify manager that an interaction has started.
*/
createInteractionHandle() {
_scheduleUpdate();
var handle = ++_inc;
_addInteractionSet.add(handle);
return handle;
},
/**
* Notify manager that an interaction has completed.
*/
clearInteractionHandle(handle) {
(0, _invariant.default)(!!handle, 'Must provide a handle to clear.');
_scheduleUpdate();
_addInteractionSet.delete(handle);
_deleteInteractionSet.add(handle);
},
addListener: _emitter.addListener.bind(_emitter),
/**
*
* @param deadline
*/
setDeadline(deadline) {
_deadline = deadline;
}
};
var _interactionSet = new Set();
var _addInteractionSet = new Set();
var _deleteInteractionSet = new Set();
var _taskQueue = new _TaskQueue.default({
onMoreTasks: _scheduleUpdate
});
var _nextUpdateHandle = 0;
var _inc = 0;
var _deadline = -1;
/**
* Schedule an asynchronous update to the interaction state.
*/
function _scheduleUpdate() {
if (!_nextUpdateHandle) {
if (_deadline > 0) {
_nextUpdateHandle = setTimeout(_processUpdate);
} else {
_nextUpdateHandle = (0, _requestIdleCallback.default)(_processUpdate);
}
}
}
/**
* Notify listeners, process queue, etc
*/
function _processUpdate() {
_nextUpdateHandle = 0;
var interactionCount = _interactionSet.size;
_addInteractionSet.forEach(handle => _interactionSet.add(handle));
_deleteInteractionSet.forEach(handle => _interactionSet.delete(handle));
var nextInteractionCount = _interactionSet.size;
if (interactionCount !== 0 && nextInteractionCount === 0) {
_emitter.emit(InteractionManager.Events.interactionComplete);
} else if (interactionCount === 0 && nextInteractionCount !== 0) {
_emitter.emit(InteractionManager.Events.interactionStart);
}
if (nextInteractionCount === 0) {
// It seems that we can't know the running time of the current event loop,
// we can only calculate the running time of the current task queue.
var begin = Date.now();
while (_taskQueue.hasTasksToProcess()) {
_taskQueue.processNext();
if (_deadline > 0 && Date.now() - begin >= _deadline) {
_scheduleUpdate();
break;
}
}
}
_addInteractionSet.clear();
_deleteInteractionSet.clear();
}
var _default = InteractionManager;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Keyboard/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _dismissKeyboard = _interopRequireDefault(require("../../modules/dismissKeyboard"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
// in the future we can use https://github.com/w3c/virtual-keyboard
var Keyboard = {
isVisible() {
return false;
},
addListener() {
return {
remove: () => {}
};
},
dismiss() {
(0, _dismissKeyboard.default)();
},
removeAllListeners() {},
removeListener() {}
};
var _default = Keyboard;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/KeyboardAvoidingView/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _View = _interopRequireDefault(require("../View"));
var _excluded = ["behavior", "contentContainerStyle", "keyboardVerticalOffset"];
class KeyboardAvoidingView extends React.Component {
constructor() {
super(...arguments);
this.frame = null;
this.onLayout = event => {
this.frame = event.nativeEvent.layout;
};
}
relativeKeyboardHeight(keyboardFrame) {
var frame = this.frame;
if (!frame || !keyboardFrame) {
return 0;
}
var keyboardY = keyboardFrame.screenY - (this.props.keyboardVerticalOffset || 0);
return Math.max(frame.y + frame.height - keyboardY, 0);
}
onKeyboardChange(event) {}
render() {
var _this$props = this.props,
behavior = _this$props.behavior,
contentContainerStyle = _this$props.contentContainerStyle,
keyboardVerticalOffset = _this$props.keyboardVerticalOffset,
rest = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({
onLayout: this.onLayout
}, rest));
}
}
var _default = KeyboardAvoidingView;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/LayoutAnimation/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _LayoutAnimation = _interopRequireDefault(require("../../vendor/react-native/LayoutAnimation"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _LayoutAnimation.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Linking/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var initialURL = _canUseDom.default ? window.location.href : '';
class Linking {
constructor() {
this._eventCallbacks = {};
}
_dispatchEvent(event) {
for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
data[_key - 1] = arguments[_key];
}
var listeners = this._eventCallbacks[event];
if (listeners != null && Array.isArray(listeners)) {
listeners.map(listener => {
listener(...data);
});
}
}
/**
* Adds a event listener for the specified event. The callback will be called when the
* said event is dispatched.
*/
addEventListener(eventType, callback) {
var _this = this;
if (!_this._eventCallbacks[eventType]) {
_this._eventCallbacks[eventType] = [callback];
}
_this._eventCallbacks[eventType].push(callback);
return {
remove() {
var callbacks = _this._eventCallbacks[eventType];
var filteredCallbacks = callbacks.filter(c => c.toString() !== callback.toString());
_this._eventCallbacks[eventType] = filteredCallbacks;
}
};
}
/**
* Removes a previously added event listener for the specified event. The callback must
* be the same object as the one passed to `addEventListener`.
*/
removeEventListener(eventType, callback) {
console.error("Linking.removeEventListener('" + eventType + "', ...): Method has been " + 'deprecated. Please instead use `remove()` on the subscription ' + 'returned by `Linking.addEventListener`.');
var callbacks = this._eventCallbacks[eventType];
var filteredCallbacks = callbacks.filter(c => c.toString() !== callback.toString());
this._eventCallbacks[eventType] = filteredCallbacks;
}
canOpenURL() {
return Promise.resolve(true);
}
getInitialURL() {
return Promise.resolve(initialURL);
}
/**
* Try to open the given url in a secure fashion. The method returns a Promise object.
* If a target is passed (including undefined) that target will be used, otherwise '_blank'.
* If the url opens, the promise is resolved. If not, the promise is rejected.
* Dispatches the `onOpen` event if `url` is opened successfully.
*/
openURL(url, target) {
if (arguments.length === 1) {
target = '_blank';
}
try {
open(url, target);
this._dispatchEvent('onOpen', url);
return Promise.resolve();
} catch (e) {
return Promise.reject(e);
}
}
_validateURL(url) {
(0, _invariant.default)(typeof url === 'string', 'Invalid URL: should be a string. Was: ' + url);
(0, _invariant.default)(url, 'Invalid URL: cannot be empty');
}
}
var open = (url, target) => {
if (_canUseDom.default) {
var urlToOpen = new URL(url, window.location).toString();
if (urlToOpen.indexOf('tel:') === 0) {
window.location = urlToOpen;
} else {
window.open(urlToOpen, target, 'noopener');
}
}
};
var _default = new Linking();
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/LogBox/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) 2016-present, Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var LogBox = {
ignoreLogs() {},
ignoreAllLogs() {},
uninstall() {},
install() {}
};
var _default = LogBox;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Modal/ModalAnimation.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _createElement = _interopRequireDefault(require("../createElement"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var ANIMATION_DURATION = 300;
function getAnimationStyle(animationType, visible) {
if (animationType === 'slide') {
return visible ? animatedSlideInStyles : animatedSlideOutStyles;
}
if (animationType === 'fade') {
return visible ? animatedFadeInStyles : animatedFadeOutStyles;
}
return visible ? styles.container : styles.hidden;
}
function ModalAnimation(props) {
var animationType = props.animationType,
children = props.children,
onDismiss = props.onDismiss,
onShow = props.onShow,
visible = props.visible;
var _React$useState = React.useState(false),
isRendering = _React$useState[0],
setIsRendering = _React$useState[1];
var wasVisible = React.useRef(false);
var wasRendering = React.useRef(false);
var isAnimated = animationType && animationType !== 'none';
var animationEndCallback = React.useCallback(e => {
if (e && e.currentTarget !== e.target) {
// If the event was generated for something NOT this element we
// should ignore it as it's not relevant to us
return;
}
if (visible) {
if (onShow) {
onShow();
}
} else {
setIsRendering(false);
}
}, [onShow, visible]);
React.useEffect(() => {
if (wasRendering.current && !isRendering && onDismiss) {
onDismiss();
}
wasRendering.current = isRendering;
}, [isRendering, onDismiss]);
React.useEffect(() => {
if (visible) {
setIsRendering(true);
}
if (visible !== wasVisible.current && !isAnimated) {
// Manually call `animationEndCallback` if no animation is used
animationEndCallback();
}
wasVisible.current = visible;
}, [isAnimated, visible, animationEndCallback]);
return isRendering || visible ? (0, _createElement.default)('div', {
style: isRendering ? getAnimationStyle(animationType, visible) : styles.hidden,
onAnimationEnd: animationEndCallback,
children
}) : null;
}
var styles = _StyleSheet.default.create({
container: {
position: 'fixed',
top: 0,
right: 0,
bottom: 0,
left: 0,
zIndex: 9999
},
animatedIn: {
animationDuration: ANIMATION_DURATION + "ms",
animationTimingFunction: 'ease-in'
},
animatedOut: {
pointerEvents: 'none',
animationDuration: ANIMATION_DURATION + "ms",
animationTimingFunction: 'ease-out'
},
fadeIn: {
opacity: 1,
animationKeyframes: {
'0%': {
opacity: 0
},
'100%': {
opacity: 1
}
}
},
fadeOut: {
opacity: 0,
animationKeyframes: {
'0%': {
opacity: 1
},
'100%': {
opacity: 0
}
}
},
slideIn: {
transform: 'translateY(0%)',
animationKeyframes: {
'0%': {
transform: 'translateY(100%)'
},
'100%': {
transform: 'translateY(0%)'
}
}
},
slideOut: {
transform: 'translateY(100%)',
animationKeyframes: {
'0%': {
transform: 'translateY(0%)'
},
'100%': {
transform: 'translateY(100%)'
}
}
},
hidden: {
opacity: 0
}
});
var animatedSlideInStyles = [styles.container, styles.animatedIn, styles.slideIn];
var animatedSlideOutStyles = [styles.container, styles.animatedOut, styles.slideOut];
var animatedFadeInStyles = [styles.container, styles.animatedIn, styles.fadeIn];
var animatedFadeOutStyles = [styles.container, styles.animatedOut, styles.fadeOut];
var _default = ModalAnimation;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Modal/ModalContent.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _View = _interopRequireDefault(require("../View"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
var _excluded = ["active", "children", "onRequestClose", "transparent"];
var ModalContent = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var active = props.active,
children = props.children,
onRequestClose = props.onRequestClose,
transparent = props.transparent,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
React.useEffect(() => {
if (_canUseDom.default) {
var closeOnEscape = e => {
if (active && e.key === 'Escape') {
e.stopPropagation();
if (onRequestClose) {
onRequestClose();
}
}
};
document.addEventListener('keyup', closeOnEscape, false);
return () => document.removeEventListener('keyup', closeOnEscape, false);
}
}, [active, onRequestClose]);
var style = React.useMemo(() => {
return [styles.modal, transparent ? styles.modalTransparent : styles.modalOpaque];
}, [transparent]);
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, rest, {
"aria-modal": true,
ref: forwardedRef,
role: active ? 'dialog' : null,
style: style
}), /*#__PURE__*/React.createElement(_View.default, {
style: styles.container
}, children));
});
var styles = _StyleSheet.default.create({
modal: {
position: 'fixed',
top: 0,
right: 0,
bottom: 0,
left: 0
},
modalTransparent: {
backgroundColor: 'transparent'
},
modalOpaque: {
backgroundColor: 'white'
},
container: {
top: 0,
flex: 1
}
});
var _default = ModalContent;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Modal/ModalFocusTrap.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _View = _interopRequireDefault(require("../View"));
var _createElement = _interopRequireDefault(require("../createElement"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _UIManager = _interopRequireDefault(require("../UIManager"));
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* This Component is used to "wrap" the modal we're opening
* so that changing focus via tab will never leave the document.
*
* This allows us to properly trap the focus within a modal
* even if the modal is at the start or end of a document.
*/
var FocusBracket = () => {
return (0, _createElement.default)('div', {
role: 'none',
tabIndex: 0,
style: styles.focusBracket
});
};
function attemptFocus(element) {
if (!_canUseDom.default) {
return false;
}
try {
element.focus();
} catch (e) {
// Do nothing
}
return document.activeElement === element;
}
function focusFirstDescendant(element) {
for (var i = 0; i < element.childNodes.length; i++) {
var child = element.childNodes[i];
if (attemptFocus(child) || focusFirstDescendant(child)) {
return true;
}
}
return false;
}
function focusLastDescendant(element) {
for (var i = element.childNodes.length - 1; i >= 0; i--) {
var child = element.childNodes[i];
if (attemptFocus(child) || focusLastDescendant(child)) {
return true;
}
}
return false;
}
var ModalFocusTrap = _ref => {
var active = _ref.active,
children = _ref.children;
var trapElementRef = React.useRef();
var focusRef = React.useRef({
trapFocusInProgress: false,
lastFocusedElement: null
});
React.useEffect(() => {
if (_canUseDom.default) {
var trapFocus = () => {
// We should not trap focus if:
// - The modal hasn't fully initialized with an HTMLElement ref
// - Focus is already in the process of being trapped (e.g., we're refocusing)
// - isTrapActive prop being falsey tells us to do nothing
if (trapElementRef.current == null || focusRef.current.trapFocusInProgress || !active) {
return;
}
try {
focusRef.current.trapFocusInProgress = true;
if (document.activeElement instanceof Node && !trapElementRef.current.contains(document.activeElement)) {
// To handle keyboard focusing we can make an assumption here.
// If you're tabbing through the focusable elements, the previously
// active element will either be the first or the last.
// If the previously selected element is the "first" descendant
// and we're leaving it - this means that we should be looping
// around to the other side of the modal.
var hasFocused = focusFirstDescendant(trapElementRef.current);
if (focusRef.current.lastFocusedElement === document.activeElement) {
hasFocused = focusLastDescendant(trapElementRef.current);
}
// If we couldn't focus a new element then we need to focus onto the trap target
if (!hasFocused && trapElementRef.current != null && document.activeElement) {
_UIManager.default.focus(trapElementRef.current);
}
}
} finally {
focusRef.current.trapFocusInProgress = false;
}
focusRef.current.lastFocusedElement = document.activeElement;
};
// Call the trapFocus callback at least once when this modal has been activated.
trapFocus();
document.addEventListener('focus', trapFocus, true);
return () => document.removeEventListener('focus', trapFocus, true);
}
}, [active]);
// To be fully compliant with WCAG we need to refocus element that triggered opening modal
// after closing it
React.useEffect(function () {
if (_canUseDom.default) {
var lastFocusedElementOutsideTrap = document.activeElement;
return function () {
if (lastFocusedElementOutsideTrap && document.contains(lastFocusedElementOutsideTrap)) {
_UIManager.default.focus(lastFocusedElementOutsideTrap);
}
};
}
}, []);
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FocusBracket, null), /*#__PURE__*/React.createElement(_View.default, {
ref: trapElementRef
}, children), /*#__PURE__*/React.createElement(FocusBracket, null));
};
var _default = ModalFocusTrap;
exports.default = _default;
var styles = _StyleSheet.default.create({
focusBracket: {
outlineStyle: 'none'
}
});
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Modal/ModalPortal.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactDom = _interopRequireDefault(require("react-dom"));
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function ModalPortal(props) {
var children = props.children;
var elementRef = React.useRef(null);
if (_canUseDom.default && !elementRef.current) {
var element = document.createElement('div');
if (element && document.body) {
document.body.appendChild(element);
elementRef.current = element;
}
}
React.useEffect(() => {
if (_canUseDom.default) {
return () => {
if (document.body && elementRef.current) {
document.body.removeChild(elementRef.current);
elementRef.current = null;
}
};
}
}, []);
return elementRef.current && _canUseDom.default ? /*#__PURE__*/_reactDom.default.createPortal(children, elementRef.current) : null;
}
var _default = ModalPortal;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Modal/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _ModalPortal = _interopRequireDefault(require("./ModalPortal"));
var _ModalAnimation = _interopRequireDefault(require("./ModalAnimation"));
var _ModalContent = _interopRequireDefault(require("./ModalContent"));
var _ModalFocusTrap = _interopRequireDefault(require("./ModalFocusTrap"));
var _excluded = ["animationType", "children", "onDismiss", "onRequestClose", "onShow", "transparent", "visible"];
var uniqueModalIdentifier = 0;
var activeModalStack = [];
var activeModalListeners = {};
function notifyActiveModalListeners() {
if (activeModalStack.length === 0) {
return;
}
var activeModalId = activeModalStack[activeModalStack.length - 1];
activeModalStack.forEach(modalId => {
if (modalId in activeModalListeners) {
activeModalListeners[modalId](modalId === activeModalId);
}
});
}
function removeActiveModal(modalId) {
if (modalId in activeModalListeners) {
// Before removing this listener we should probably tell it
// that it's no longer the active modal for sure.
activeModalListeners[modalId](false);
delete activeModalListeners[modalId];
}
var index = activeModalStack.indexOf(modalId);
if (index !== -1) {
activeModalStack.splice(index, 1);
notifyActiveModalListeners();
}
}
function addActiveModal(modalId, listener) {
removeActiveModal(modalId);
activeModalStack.push(modalId);
activeModalListeners[modalId] = listener;
notifyActiveModalListeners();
}
var Modal = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var animationType = props.animationType,
children = props.children,
onDismiss = props.onDismiss,
onRequestClose = props.onRequestClose,
onShow = props.onShow,
transparent = props.transparent,
_props$visible = props.visible,
visible = _props$visible === void 0 ? true : _props$visible,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
// Set a unique model identifier so we can correctly route
// dismissals and check the layering of modals.
var modalId = React.useMemo(() => uniqueModalIdentifier++, []);
var _React$useState = React.useState(false),
isActive = _React$useState[0],
setIsActive = _React$useState[1];
var onDismissCallback = React.useCallback(() => {
removeActiveModal(modalId);
if (onDismiss) {
onDismiss();
}
}, [modalId, onDismiss]);
var onShowCallback = React.useCallback(() => {
addActiveModal(modalId, setIsActive);
if (onShow) {
onShow();
}
}, [modalId, onShow]);
React.useEffect(() => {
return () => removeActiveModal(modalId);
}, [modalId]);
return /*#__PURE__*/React.createElement(_ModalPortal.default, null, /*#__PURE__*/React.createElement(_ModalAnimation.default, {
animationType: animationType,
onDismiss: onDismissCallback,
onShow: onShowCallback,
visible: visible
}, /*#__PURE__*/React.createElement(_ModalFocusTrap.default, {
active: isActive
}, /*#__PURE__*/React.createElement(_ModalContent.default, (0, _extends2.default)({}, rest, {
active: isActive,
onRequestClose: onRequestClose,
ref: forwardedRef,
transparent: transparent
}), children))));
});
var _default = Modal;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/NativeEventEmitter/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _NativeEventEmitter = _interopRequireDefault(require("../../vendor/react-native/EventEmitter/NativeEventEmitter"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _NativeEventEmitter.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/NativeModules/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _UIManager = _interopRequireDefault(require("../UIManager"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
// NativeModules shim
var NativeModules = {
UIManager: _UIManager.default
};
var _default = NativeModules;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/PanResponder/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _PanResponder = _interopRequireDefault(require("../../vendor/react-native/PanResponder"));
var _default = _PanResponder.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Picker/PickerItem.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = PickerItem;
var _createElement = _interopRequireDefault(require("../createElement"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function PickerItem(props) {
var color = props.color,
label = props.label,
testID = props.testID,
value = props.value;
var style = {
color
};
return (0, _createElement.default)('option', {
children: label,
style,
testID,
value
});
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Picker/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _createElement = _interopRequireDefault(require("../createElement"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
var _usePlatformMethods = _interopRequireDefault(require("../../modules/usePlatformMethods"));
var _PickerItem = _interopRequireDefault(require("./PickerItem"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _excluded = ["children", "enabled", "onValueChange", "selectedValue", "style", "testID", "itemStyle", "mode", "prompt"];
var Picker = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var children = props.children,
enabled = props.enabled,
onValueChange = props.onValueChange,
selectedValue = props.selectedValue,
style = props.style,
testID = props.testID,
itemStyle = props.itemStyle,
mode = props.mode,
prompt = props.prompt,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
var hostRef = React.useRef(null);
function handleChange(e) {
var _e$target = e.target,
selectedIndex = _e$target.selectedIndex,
value = _e$target.value;
if (onValueChange) {
onValueChange(value, selectedIndex);
}
}
// $FlowFixMe
var supportedProps = (0, _objectSpread2.default)({
children,
disabled: enabled === false ? true : undefined,
onChange: handleChange,
style: [styles.initial, style],
testID,
value: selectedValue
}, other);
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
var setRef = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, forwardedRef);
supportedProps.ref = setRef;
return (0, _createElement.default)('select', supportedProps);
});
// $FlowFixMe
Picker.Item = _PickerItem.default;
var styles = _StyleSheet.default.create({
initial: {
fontFamily: 'System',
fontSize: 'inherit',
margin: 0
}
});
var _default = Picker;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/PixelRatio/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _Dimensions = _interopRequireDefault(require("../Dimensions"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* PixelRatio gives access to the device pixel density.
*/
class PixelRatio {
/**
* Returns the device pixel density.
*/
static get() {
return _Dimensions.default.get('window').scale;
}
/**
* No equivalent for Web
*/
static getFontScale() {
return _Dimensions.default.get('window').fontScale || PixelRatio.get();
}
/**
* Converts a layout size (dp) to pixel size (px).
* Guaranteed to return an integer number.
*/
static getPixelSizeForLayoutSize(layoutSize) {
return Math.round(layoutSize * PixelRatio.get());
}
/**
* Rounds a layout size (dp) to the nearest layout size that corresponds to
* an integer number of pixels. For example, on a device with a PixelRatio
* of 3, `PixelRatio.roundToNearestPixel(8.4) = 8.33`, which corresponds to
* exactly (8.33 * 3) = 25 pixels.
*/
static roundToNearestPixel(layoutSize) {
var ratio = PixelRatio.get();
return Math.round(layoutSize * ratio) / ratio;
}
}
exports.default = PixelRatio;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Platform/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var Platform = {
OS: 'web',
select: obj => 'web' in obj ? obj.web : obj.default,
get isTesting() {
if (process.env.NODE_ENV === 'test') {
return true;
}
return false;
}
};
var _default = Platform;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Pressable/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
var _useHover = _interopRequireDefault(require("../../modules/useHover"));
var _usePressEvents = _interopRequireDefault(require("../../modules/usePressEvents"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _excluded = ["children", "delayLongPress", "delayPressIn", "delayPressOut", "disabled", "onBlur", "onContextMenu", "onFocus", "onHoverIn", "onHoverOut", "onKeyDown", "onLongPress", "onPress", "onPressMove", "onPressIn", "onPressOut", "style", "tabIndex", "testOnly_hovered", "testOnly_pressed"];
/**
* Component used to build display components that should respond to whether the
* component is currently pressed or not.
*/
function Pressable(props, forwardedRef) {
var children = props.children,
delayLongPress = props.delayLongPress,
delayPressIn = props.delayPressIn,
delayPressOut = props.delayPressOut,
disabled = props.disabled,
onBlur = props.onBlur,
onContextMenu = props.onContextMenu,
onFocus = props.onFocus,
onHoverIn = props.onHoverIn,
onHoverOut = props.onHoverOut,
onKeyDown = props.onKeyDown,
onLongPress = props.onLongPress,
onPress = props.onPress,
onPressMove = props.onPressMove,
onPressIn = props.onPressIn,
onPressOut = props.onPressOut,
style = props.style,
tabIndex = props.tabIndex,
testOnly_hovered = props.testOnly_hovered,
testOnly_pressed = props.testOnly_pressed,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
var _useForceableState = useForceableState(testOnly_hovered === true),
hovered = _useForceableState[0],
setHovered = _useForceableState[1];
var _useForceableState2 = useForceableState(false),
focused = _useForceableState2[0],
setFocused = _useForceableState2[1];
var _useForceableState3 = useForceableState(testOnly_pressed === true),
pressed = _useForceableState3[0],
setPressed = _useForceableState3[1];
var hostRef = (0, React.useRef)(null);
var setRef = (0, _useMergeRefs.default)(forwardedRef, hostRef);
var pressConfig = (0, React.useMemo)(() => ({
delayLongPress,
delayPressStart: delayPressIn,
delayPressEnd: delayPressOut,
disabled,
onLongPress,
onPress,
onPressChange: setPressed,
onPressStart: onPressIn,
onPressMove,
onPressEnd: onPressOut
}), [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressMove, onPressOut, setPressed]);
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
var onContextMenuPress = pressEventHandlers.onContextMenu,
onKeyDownPress = pressEventHandlers.onKeyDown;
(0, _useHover.default)(hostRef, {
contain: true,
disabled,
onHoverChange: setHovered,
onHoverStart: onHoverIn,
onHoverEnd: onHoverOut
});
var interactionState = {
hovered,
focused,
pressed
};
var blurHandler = React.useCallback(e => {
if (e.nativeEvent.target === hostRef.current) {
setFocused(false);
if (onBlur != null) {
onBlur(e);
}
}
}, [hostRef, setFocused, onBlur]);
var focusHandler = React.useCallback(e => {
if (e.nativeEvent.target === hostRef.current) {
setFocused(true);
if (onFocus != null) {
onFocus(e);
}
}
}, [hostRef, setFocused, onFocus]);
var contextMenuHandler = React.useCallback(e => {
if (onContextMenuPress != null) {
onContextMenuPress(e);
}
if (onContextMenu != null) {
onContextMenu(e);
}
}, [onContextMenu, onContextMenuPress]);
var keyDownHandler = React.useCallback(e => {
if (onKeyDownPress != null) {
onKeyDownPress(e);
}
if (onKeyDown != null) {
onKeyDown(e);
}
}, [onKeyDown, onKeyDownPress]);
var _tabIndex;
if (tabIndex !== undefined) {
_tabIndex = tabIndex;
} else {
_tabIndex = disabled ? -1 : 0;
}
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, rest, pressEventHandlers, {
"aria-disabled": disabled,
onBlur: blurHandler,
onContextMenu: contextMenuHandler,
onFocus: focusHandler,
onKeyDown: keyDownHandler,
ref: setRef,
style: [disabled ? styles.disabled : styles.active, typeof style === 'function' ? style(interactionState) : style],
tabIndex: _tabIndex
}), typeof children === 'function' ? children(interactionState) : children);
}
function useForceableState(forced) {
var _useState = (0, React.useState)(false),
bool = _useState[0],
setBool = _useState[1];
return [bool || forced, setBool];
}
var styles = _StyleSheet.default.create({
active: {
cursor: 'pointer',
touchAction: 'manipulation'
},
disabled: {
pointerEvents: 'box-none'
}
});
var MemoedPressable = /*#__PURE__*/(0, React.memo)( /*#__PURE__*/(0, React.forwardRef)(Pressable));
MemoedPressable.displayName = 'Pressable';
var _default = MemoedPressable;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/ProgressBar/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _excluded = ["color", "indeterminate", "progress", "trackColor", "style"];
var ProgressBar = /*#__PURE__*/React.forwardRef((props, ref) => {
var _props$color = props.color,
color = _props$color === void 0 ? '#1976D2' : _props$color,
_props$indeterminate = props.indeterminate,
indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate,
_props$progress = props.progress,
progress = _props$progress === void 0 ? 0 : _props$progress,
_props$trackColor = props.trackColor,
trackColor = _props$trackColor === void 0 ? 'transparent' : _props$trackColor,
style = props.style,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
var percentageProgress = progress * 100;
var width = indeterminate ? '25%' : percentageProgress + "%";
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, other, {
"aria-valuemax": 100,
"aria-valuemin": 0,
"aria-valuenow": indeterminate ? null : percentageProgress,
ref: ref,
role: "progressbar",
style: [styles.track, style, {
backgroundColor: trackColor
}]
}), /*#__PURE__*/React.createElement(_View.default, {
style: [{
backgroundColor: color,
width
}, styles.progress, indeterminate && styles.animation]
}));
});
ProgressBar.displayName = 'ProgressBar';
var styles = _StyleSheet.default.create({
track: {
forcedColorAdjust: 'none',
height: 5,
overflow: 'hidden',
userSelect: 'none',
zIndex: 0
},
progress: {
forcedColorAdjust: 'none',
height: '100%',
zIndex: -1
},
animation: {
animationDuration: '1s',
animationKeyframes: [{
'0%': {
transform: 'translateX(-100%)'
},
'100%': {
transform: 'translateX(400%)'
}
}],
animationTimingFunction: 'linear',
animationIterationCount: 'infinite'
}
});
var _default = ProgressBar;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/RefreshControl/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _View = _interopRequireDefault(require("../View"));
var _react = _interopRequireDefault(require("react"));
var _excluded = ["colors", "enabled", "onRefresh", "progressBackgroundColor", "progressViewOffset", "refreshing", "size", "tintColor", "title", "titleColor"];
function RefreshControl(props) {
var colors = props.colors,
enabled = props.enabled,
onRefresh = props.onRefresh,
progressBackgroundColor = props.progressBackgroundColor,
progressViewOffset = props.progressViewOffset,
refreshing = props.refreshing,
size = props.size,
tintColor = props.tintColor,
title = props.title,
titleColor = props.titleColor,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
return /*#__PURE__*/_react.default.createElement(_View.default, rest);
}
var _default = RefreshControl;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/SafeAreaView/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
var _excluded = ["style"];
var cssFunction = function () {
if (_canUseDom.default && window.CSS && window.CSS.supports && window.CSS.supports('top: constant(safe-area-inset-top)')) {
return 'constant';
}
return 'env';
}();
var SafeAreaView = /*#__PURE__*/React.forwardRef((props, ref) => {
var style = props.style,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, rest, {
ref: ref,
style: [styles.root, style]
}));
});
SafeAreaView.displayName = 'SafeAreaView';
var styles = _StyleSheet.default.create({
root: {
paddingTop: cssFunction + "(safe-area-inset-top)",
paddingRight: cssFunction + "(safe-area-inset-right)",
paddingBottom: cssFunction + "(safe-area-inset-bottom)",
paddingLeft: cssFunction + "(safe-area-inset-left)"
}
});
var _default = SafeAreaView;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/ScrollView/ScrollViewBase.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
var _excluded = ["onScroll", "onTouchMove", "onWheel", "scrollEnabled", "scrollEventThrottle", "showsHorizontalScrollIndicator", "showsVerticalScrollIndicator", "style"];
function normalizeScrollEvent(e) {
return {
nativeEvent: {
contentOffset: {
get x() {
return e.target.scrollLeft;
},
get y() {
return e.target.scrollTop;
}
},
contentSize: {
get height() {
return e.target.scrollHeight;
},
get width() {
return e.target.scrollWidth;
}
},
layoutMeasurement: {
get height() {
return e.target.offsetHeight;
},
get width() {
return e.target.offsetWidth;
}
}
},
timeStamp: Date.now()
};
}
function shouldEmitScrollEvent(lastTick, eventThrottle) {
var timeSinceLastTick = Date.now() - lastTick;
return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;
}
/**
* Encapsulates the Web-specific scroll throttling and disabling logic
*/
var ScrollViewBase = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var onScroll = props.onScroll,
onTouchMove = props.onTouchMove,
onWheel = props.onWheel,
_props$scrollEnabled = props.scrollEnabled,
scrollEnabled = _props$scrollEnabled === void 0 ? true : _props$scrollEnabled,
_props$scrollEventThr = props.scrollEventThrottle,
scrollEventThrottle = _props$scrollEventThr === void 0 ? 0 : _props$scrollEventThr,
showsHorizontalScrollIndicator = props.showsHorizontalScrollIndicator,
showsVerticalScrollIndicator = props.showsVerticalScrollIndicator,
style = props.style,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
var scrollState = React.useRef({
isScrolling: false,
scrollLastTick: 0
});
var scrollTimeout = React.useRef(null);
var scrollRef = React.useRef(null);
function createPreventableScrollHandler(handler) {
return e => {
if (scrollEnabled) {
if (handler) {
handler(e);
}
}
};
}
function handleScroll(e) {
e.stopPropagation();
if (e.target === scrollRef.current) {
e.persist();
// A scroll happened, so the scroll resets the scrollend timeout.
if (scrollTimeout.current != null) {
clearTimeout(scrollTimeout.current);
}
scrollTimeout.current = setTimeout(() => {
handleScrollEnd(e);
}, 100);
if (scrollState.current.isScrolling) {
// Scroll last tick may have changed, check if we need to notify
if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {
handleScrollTick(e);
}
} else {
// Weren't scrolling, so we must have just started
handleScrollStart(e);
}
}
}
function handleScrollStart(e) {
scrollState.current.isScrolling = true;
handleScrollTick(e);
}
function handleScrollTick(e) {
scrollState.current.scrollLastTick = Date.now();
if (onScroll) {
onScroll(normalizeScrollEvent(e));
}
}
function handleScrollEnd(e) {
scrollState.current.isScrolling = false;
if (onScroll) {
onScroll(normalizeScrollEvent(e));
}
}
var hideScrollbar = showsHorizontalScrollIndicator === false || showsVerticalScrollIndicator === false;
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, rest, {
onScroll: handleScroll,
onTouchMove: createPreventableScrollHandler(onTouchMove),
onWheel: createPreventableScrollHandler(onWheel),
ref: (0, _useMergeRefs.default)(scrollRef, forwardedRef),
style: [style, !scrollEnabled && styles.scrollDisabled, hideScrollbar && styles.hideScrollbar]
}));
});
// Chrome doesn't support e.preventDefault in this case; touch-action must be
// used to disable scrolling.
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
var styles = _StyleSheet.default.create({
scrollDisabled: {
overflowX: 'hidden',
overflowY: 'hidden',
touchAction: 'none'
},
hideScrollbar: {
scrollbarWidth: 'none'
}
});
var _default = ScrollViewBase;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/ScrollView/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _Dimensions = _interopRequireDefault(require("../Dimensions"));
var _dismissKeyboard = _interopRequireDefault(require("../../modules/dismissKeyboard"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _mergeRefs = _interopRequireDefault(require("../../modules/mergeRefs"));
var _Platform = _interopRequireDefault(require("../Platform"));
var _ScrollViewBase = _interopRequireDefault(require("./ScrollViewBase"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _TextInputState = _interopRequireDefault(require("../../modules/TextInputState"));
var _UIManager = _interopRequireDefault(require("../UIManager"));
var _View = _interopRequireDefault(require("../View"));
var _react = _interopRequireDefault(require("react"));
var _warning = _interopRequireDefault(require("fbjs/lib/warning"));
var _excluded = ["contentContainerStyle", "horizontal", "onContentSizeChange", "refreshControl", "stickyHeaderIndices", "pagingEnabled", "forwardedRef", "keyboardDismissMode", "onScroll", "centerContent"];
var emptyObject = {};
var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;
class ScrollView extends _react.default.Component {
constructor() {
super(...arguments);
this._scrollNodeRef = null;
this._innerViewRef = null;
this.isTouching = false;
this.lastMomentumScrollBeginTime = 0;
this.lastMomentumScrollEndTime = 0;
this.observedScrollSinceBecomingResponder = false;
this.becameResponderWhileAnimating = false;
this.scrollResponderHandleScrollShouldSetResponder = () => {
return this.isTouching;
};
this.scrollResponderHandleStartShouldSetResponderCapture = e => {
// First see if we want to eat taps while the keyboard is up
// var currentlyFocusedTextInput = TextInputState.currentlyFocusedField();
// if (!this.props.keyboardShouldPersistTaps &&
// currentlyFocusedTextInput != null &&
// e.target !== currentlyFocusedTextInput) {
// return true;
// }
return this.scrollResponderIsAnimating();
};
this.scrollResponderHandleTerminationRequest = () => {
return !this.observedScrollSinceBecomingResponder;
};
this.scrollResponderHandleTouchEnd = e => {
var nativeEvent = e.nativeEvent;
this.isTouching = nativeEvent.touches.length !== 0;
this.props.onTouchEnd && this.props.onTouchEnd(e);
};
this.scrollResponderHandleResponderRelease = e => {
this.props.onResponderRelease && this.props.onResponderRelease(e);
// By default scroll views will unfocus a textField
// if another touch occurs outside of it
var currentlyFocusedTextInput = _TextInputState.default.currentlyFocusedField();
if (!this.props.keyboardShouldPersistTaps && currentlyFocusedTextInput != null && e.target !== currentlyFocusedTextInput && !this.observedScrollSinceBecomingResponder && !this.becameResponderWhileAnimating) {
this.props.onScrollResponderKeyboardDismissed && this.props.onScrollResponderKeyboardDismissed(e);
_TextInputState.default.blurTextInput(currentlyFocusedTextInput);
}
};
this.scrollResponderHandleScroll = e => {
this.observedScrollSinceBecomingResponder = true;
this.props.onScroll && this.props.onScroll(e);
};
this.scrollResponderHandleResponderGrant = e => {
this.observedScrollSinceBecomingResponder = false;
this.props.onResponderGrant && this.props.onResponderGrant(e);
this.becameResponderWhileAnimating = this.scrollResponderIsAnimating();
};
this.scrollResponderHandleScrollBeginDrag = e => {
this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);
};
this.scrollResponderHandleScrollEndDrag = e => {
this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);
};
this.scrollResponderHandleMomentumScrollBegin = e => {
this.lastMomentumScrollBeginTime = Date.now();
this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);
};
this.scrollResponderHandleMomentumScrollEnd = e => {
this.lastMomentumScrollEndTime = Date.now();
this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);
};
this.scrollResponderHandleTouchStart = e => {
this.isTouching = true;
this.props.onTouchStart && this.props.onTouchStart(e);
};
this.scrollResponderHandleTouchMove = e => {
this.props.onTouchMove && this.props.onTouchMove(e);
};
this.scrollResponderIsAnimating = () => {
var now = Date.now();
var timeSinceLastMomentumScrollEnd = now - this.lastMomentumScrollEndTime;
var isAnimating = timeSinceLastMomentumScrollEnd < IS_ANIMATING_TOUCH_START_THRESHOLD_MS || this.lastMomentumScrollEndTime < this.lastMomentumScrollBeginTime;
return isAnimating;
};
this.scrollResponderScrollTo = (x, y, animated) => {
if (typeof x === 'number') {
console.warn('`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.');
} else {
var _ref = x || emptyObject;
x = _ref.x;
y = _ref.y;
animated = _ref.animated;
}
var node = this.getScrollableNode();
var left = x || 0;
var top = y || 0;
if (node != null) {
if (typeof node.scroll === 'function') {
node.scroll({
top,
left,
behavior: !animated ? 'auto' : 'smooth'
});
} else {
node.scrollLeft = left;
node.scrollTop = top;
}
}
};
this.scrollResponderZoomTo = (rect, animated) => {
if (_Platform.default.OS !== 'ios') {
(0, _invariant.default)('zoomToRect is not implemented');
}
};
this.scrollResponderScrollNativeHandleToKeyboard = (nodeHandle, additionalOffset, preventNegativeScrollOffset) => {
this.additionalScrollOffset = additionalOffset || 0;
this.preventNegativeScrollOffset = !!preventNegativeScrollOffset;
_UIManager.default.measureLayout(nodeHandle, this.getInnerViewNode(), this.scrollResponderTextInputFocusError, this.scrollResponderInputMeasureAndScrollToKeyboard);
};
this.scrollResponderInputMeasureAndScrollToKeyboard = (left, top, width, height) => {
var keyboardScreenY = _Dimensions.default.get('window').height;
if (this.keyboardWillOpenTo) {
keyboardScreenY = this.keyboardWillOpenTo.endCoordinates.screenY;
}
var scrollOffsetY = top - keyboardScreenY + height + this.additionalScrollOffset;
// By default, this can scroll with negative offset, pulling the content
// down so that the target component's bottom meets the keyboard's top.
// If requested otherwise, cap the offset at 0 minimum to avoid content
// shifting down.
if (this.preventNegativeScrollOffset) {
scrollOffsetY = Math.max(0, scrollOffsetY);
}
this.scrollResponderScrollTo({
x: 0,
y: scrollOffsetY,
animated: true
});
this.additionalOffset = 0;
this.preventNegativeScrollOffset = false;
};
this.scrollResponderKeyboardWillShow = e => {
this.keyboardWillOpenTo = e;
this.props.onKeyboardWillShow && this.props.onKeyboardWillShow(e);
};
this.scrollResponderKeyboardWillHide = e => {
this.keyboardWillOpenTo = null;
this.props.onKeyboardWillHide && this.props.onKeyboardWillHide(e);
};
this.scrollResponderKeyboardDidShow = e => {
// TODO(7693961): The event for DidShow is not available on iOS yet.
// Use the one from WillShow and do not assign.
if (e) {
this.keyboardWillOpenTo = e;
}
this.props.onKeyboardDidShow && this.props.onKeyboardDidShow(e);
};
this.scrollResponderKeyboardDidHide = e => {
this.keyboardWillOpenTo = null;
this.props.onKeyboardDidHide && this.props.onKeyboardDidHide(e);
};
this.flashScrollIndicators = () => {
this.scrollResponderFlashScrollIndicators();
};
this.getScrollResponder = () => {
return this;
};
this.getScrollableNode = () => {
return this._scrollNodeRef;
};
this.getInnerViewRef = () => {
return this._innerViewRef;
};
this.getInnerViewNode = () => {
return this._innerViewRef;
};
this.getNativeScrollRef = () => {
return this._scrollNodeRef;
};
this.scrollTo = (y, x, animated) => {
if (typeof y === 'number') {
console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.');
} else {
var _ref2 = y || emptyObject;
x = _ref2.x;
y = _ref2.y;
animated = _ref2.animated;
}
this.scrollResponderScrollTo({
x: x || 0,
y: y || 0,
animated: animated !== false
});
};
this.scrollToEnd = options => {
// Default to true
var animated = (options && options.animated) !== false;
var horizontal = this.props.horizontal;
var scrollResponderNode = this.getScrollableNode();
var x = horizontal ? scrollResponderNode.scrollWidth : 0;
var y = horizontal ? 0 : scrollResponderNode.scrollHeight;
this.scrollResponderScrollTo({
x,
y,
animated
});
};
this._handleContentOnLayout = e => {
var _e$nativeEvent$layout = e.nativeEvent.layout,
width = _e$nativeEvent$layout.width,
height = _e$nativeEvent$layout.height;
this.props.onContentSizeChange(width, height);
};
this._handleScroll = e => {
if (process.env.NODE_ENV !== 'production') {
if (this.props.onScroll && this.props.scrollEventThrottle == null) {
console.log('You specified `onScroll` on a <ScrollView> but not ' + '`scrollEventThrottle`. You will only receive one event. ' + 'Using `16` you get all the events but be aware that it may ' + "cause frame drops, use a bigger number if you don't need as " + 'much precision.');
}
}
if (this.props.keyboardDismissMode === 'on-drag') {
(0, _dismissKeyboard.default)();
}
this.scrollResponderHandleScroll(e);
};
this._setInnerViewRef = node => {
this._innerViewRef = node;
};
this._setScrollNodeRef = node => {
this._scrollNodeRef = node;
// ScrollView needs to add more methods to the hostNode in addition to those
// added by `usePlatformMethods`. This is temporarily until an API like
// `ScrollView.scrollTo(hostNode, { x, y })` is added to React Native.
if (node != null) {
node.getScrollResponder = this.getScrollResponder;
node.getInnerViewNode = this.getInnerViewNode;
node.getInnerViewRef = this.getInnerViewRef;
node.getNativeScrollRef = this.getNativeScrollRef;
node.getScrollableNode = this.getScrollableNode;
node.scrollTo = this.scrollTo;
node.scrollToEnd = this.scrollToEnd;
node.flashScrollIndicators = this.flashScrollIndicators;
node.scrollResponderZoomTo = this.scrollResponderZoomTo;
node.scrollResponderScrollNativeHandleToKeyboard = this.scrollResponderScrollNativeHandleToKeyboard;
}
var ref = (0, _mergeRefs.default)(this.props.forwardedRef);
ref(node);
};
}
/**
* Merely touch starting is not sufficient for a scroll view to become the
* responder. Being the "responder" means that the very next touch move/end
* event will result in an action/movement.
*
* Invoke this from an `onStartShouldSetResponder` event.
*
* `onStartShouldSetResponder` is used when the next move/end will trigger
* some UI movement/action, but when you want to yield priority to views
* nested inside of the view.
*
* There may be some cases where scroll views actually should return `true`
* from `onStartShouldSetResponder`: Any time we are detecting a standard tap
* that gives priority to nested views.
*
* - If a single tap on the scroll view triggers an action such as
* recentering a map style view yet wants to give priority to interaction
* views inside (such as dropped pins or labels), then we would return true
* from this method when there is a single touch.
*
* - Similar to the previous case, if a two finger "tap" should trigger a
* zoom, we would check the `touches` count, and if `>= 2`, we would return
* true.
*
*/
scrollResponderHandleStartShouldSetResponder() {
return false;
}
/**
* There are times when the scroll view wants to become the responder
* (meaning respond to the next immediate `touchStart/touchEnd`), in a way
* that *doesn't* give priority to nested views (hence the capture phase):
*
* - Currently animating.
* - Tapping anywhere that is not the focused input, while the keyboard is
* up (which should dismiss the keyboard).
*
* Invoke this from an `onStartShouldSetResponderCapture` event.
*/
/**
* Invoke this from an `onResponderReject` event.
*
* Some other element is not yielding its role as responder. Normally, we'd
* just disable the `UIScrollView`, but a touch has already began on it, the
* `UIScrollView` will not accept being disabled after that. The easiest
* solution for now is to accept the limitation of disallowing this
* altogether. To improve this, find a way to disable the `UIScrollView` after
* a touch has already started.
*/
scrollResponderHandleResponderReject() {
(0, _warning.default)(false, "ScrollView doesn't take rejection well - scrolls anyway");
}
/**
* We will allow the scroll view to give up its lock iff it acquired the lock
* during an animation. This is a very useful default that happens to satisfy
* many common user experiences.
*
* - Stop a scroll on the left edge, then turn that into an outer view's
* backswipe.
* - Stop a scroll mid-bounce at the top, continue pulling to have the outer
* view dismiss.
* - However, without catching the scroll view mid-bounce (while it is
* motionless), if you drag far enough for the scroll view to become
* responder (and therefore drag the scroll view a bit), any backswipe
* navigation of a swipe gesture higher in the view hierarchy, should be
* rejected.
*/
/**
* Displays the scroll indicators momentarily.
*/
scrollResponderFlashScrollIndicators() {}
/**
* This method should be used as the callback to onFocus in a TextInputs'
* parent view. Note that any module using this mixin needs to return
* the parent view's ref in getScrollViewRef() in order to use this method.
* @param {any} nodeHandle The TextInput node handle
* @param {number} additionalOffset The scroll view's top "contentInset".
* Default is 0.
* @param {bool} preventNegativeScrolling Whether to allow pulling the content
* down to make it meet the keyboard's top. Default is false.
*/
scrollResponderTextInputFocusError(e) {
console.error('Error measuring text field: ', e);
}
/**
* Warning, this may be called several times for a single keyboard opening.
* It's best to store the information in this method and then take any action
* at a later point (either in `keyboardDidShow` or other).
*
* Here's the order that events occur in:
* - focus
* - willShow {startCoordinates, endCoordinates} several times
* - didShow several times
* - blur
* - willHide {startCoordinates, endCoordinates} several times
* - didHide several times
*
* The `ScrollResponder` providesModule callbacks for each of these events.
* Even though any user could have easily listened to keyboard events
* themselves, using these `props` callbacks ensures that ordering of events
* is consistent - and not dependent on the order that the keyboard events are
* subscribed to. This matters when telling the scroll view to scroll to where
* the keyboard is headed - the scroll responder better have been notified of
* the keyboard destination before being instructed to scroll to where the
* keyboard will be. Stick to the `ScrollResponder` callbacks, and everything
* will work.
*
* WARNING: These callbacks will fire even if a keyboard is displayed in a
* different navigation pane. Filter out the events to determine if they are
* relevant to you. (For example, only if you receive these callbacks after
* you had explicitly focused a node etc).
*/
render() {
var _this$props = this.props,
contentContainerStyle = _this$props.contentContainerStyle,
horizontal = _this$props.horizontal,
onContentSizeChange = _this$props.onContentSizeChange,
refreshControl = _this$props.refreshControl,
stickyHeaderIndices = _this$props.stickyHeaderIndices,
pagingEnabled = _this$props.pagingEnabled,
forwardedRef = _this$props.forwardedRef,
keyboardDismissMode = _this$props.keyboardDismissMode,
onScroll = _this$props.onScroll,
centerContent = _this$props.centerContent,
other = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
if (process.env.NODE_ENV !== 'production' && this.props.style) {
var style = _StyleSheet.default.flatten(this.props.style);
var childLayoutProps = ['alignItems', 'justifyContent'].filter(prop => style && style[prop] !== undefined);
(0, _invariant.default)(childLayoutProps.length === 0, "ScrollView child layout (" + JSON.stringify(childLayoutProps) + ") " + 'must be applied through the contentContainerStyle prop.');
}
var contentSizeChangeProps = {};
if (onContentSizeChange) {
contentSizeChangeProps = {
onLayout: this._handleContentOnLayout
};
}
var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);
var children = hasStickyHeaderIndices || pagingEnabled ? _react.default.Children.map(this.props.children, (child, i) => {
var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;
if (child != null && (isSticky || pagingEnabled)) {
return /*#__PURE__*/_react.default.createElement(_View.default, {
style: [isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild]
}, child);
} else {
return child;
}
}) : this.props.children;
var contentContainer = /*#__PURE__*/_react.default.createElement(_View.default, (0, _extends2.default)({}, contentSizeChangeProps, {
children: children,
collapsable: false,
ref: this._setInnerViewRef,
style: [horizontal && styles.contentContainerHorizontal, centerContent && styles.contentContainerCenterContent, contentContainerStyle]
}));
var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;
var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;
var props = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, other), {}, {
style: [baseStyle, pagingEnabled && pagingEnabledStyle, this.props.style],
onTouchStart: this.scrollResponderHandleTouchStart,
onTouchMove: this.scrollResponderHandleTouchMove,
onTouchEnd: this.scrollResponderHandleTouchEnd,
onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag,
onScrollEndDrag: this.scrollResponderHandleScrollEndDrag,
onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin,
onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd,
onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder,
onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture,
onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder,
onScroll: this._handleScroll,
onResponderGrant: this.scrollResponderHandleResponderGrant,
onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest,
onResponderTerminate: this.scrollResponderHandleTerminate,
onResponderRelease: this.scrollResponderHandleResponderRelease,
onResponderReject: this.scrollResponderHandleResponderReject
});
var ScrollViewClass = _ScrollViewBase.default;
(0, _invariant.default)(ScrollViewClass !== undefined, 'ScrollViewClass must not be undefined');
var scrollView = /*#__PURE__*/_react.default.createElement(ScrollViewClass, (0, _extends2.default)({}, props, {
ref: this._setScrollNodeRef
}), contentContainer);
if (refreshControl) {
return /*#__PURE__*/_react.default.cloneElement(refreshControl, {
style: props.style
}, scrollView);
}
return scrollView;
}
}
var commonStyle = {
flexGrow: 1,
flexShrink: 1,
// Enable hardware compositing in modern browsers.
// Creates a new layer with its own backing surface that can significantly
// improve scroll performance.
transform: 'translateZ(0)',
// iOS native scrolling
WebkitOverflowScrolling: 'touch'
};
var styles = _StyleSheet.default.create({
baseVertical: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, commonStyle), {}, {
flexDirection: 'column',
overflowX: 'hidden',
overflowY: 'auto'
}),
baseHorizontal: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, commonStyle), {}, {
flexDirection: 'row',
overflowX: 'auto',
overflowY: 'hidden'
}),
contentContainerHorizontal: {
flexDirection: 'row'
},
contentContainerCenterContent: {
justifyContent: 'center',
flexGrow: 1
},
stickyHeader: {
position: 'sticky',
top: 0,
zIndex: 10
},
pagingEnabledHorizontal: {
scrollSnapType: 'x mandatory'
},
pagingEnabledVertical: {
scrollSnapType: 'y mandatory'
},
pagingEnabledChild: {
scrollSnapAlign: 'start'
}
});
var ForwardedScrollView = /*#__PURE__*/_react.default.forwardRef((props, forwardedRef) => {
return /*#__PURE__*/_react.default.createElement(ScrollView, (0, _extends2.default)({}, props, {
forwardedRef: forwardedRef
}));
});
ForwardedScrollView.displayName = 'ScrollView';
var _default = ForwardedScrollView;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/SectionList/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _SectionList = _interopRequireDefault(require("../../vendor/react-native/SectionList"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _SectionList.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Share/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
class Share {
static share(content, options) {
if (options === void 0) {
options = {};
}
(0, _invariant.default)(typeof content === 'object' && content !== null, 'Content to share must be a valid object');
(0, _invariant.default)(typeof content.url === 'string' || typeof content.message === 'string', 'At least one of URL and message is required');
(0, _invariant.default)(typeof options === 'object' && options !== null, 'Options must be a valid object');
(0, _invariant.default)(!content.title || typeof content.title === 'string', 'Invalid title: title should be a string.');
if (window.navigator.share !== undefined) {
return window.navigator.share({
title: content.title,
text: content.message,
url: content.url
});
} else {
return Promise.reject(new Error('Share is not supported in this browser'));
}
}
/**
* The content was successfully shared.
*/
static get sharedAction() {
return 'sharedAction';
}
/**
* The dialog has been dismissed.
* @platform ios
*/
static get dismissedAction() {
return 'dismissedAction';
}
}
var _default = Share;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StatusBar/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var emptyFunction = () => {};
function StatusBar() {
return null;
}
StatusBar.setBackgroundColor = emptyFunction;
StatusBar.setBarStyle = emptyFunction;
StatusBar.setHidden = emptyFunction;
StatusBar.setNetworkActivityIndicatorVisible = emptyFunction;
StatusBar.setTranslucent = emptyFunction;
var _default = StatusBar;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/createReactDOMStyle.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _normalizeValueWithProperty = _interopRequireDefault(require("./normalizeValueWithProperty"));
var _canUseDom = _interopRequireDefault(require("../../../modules/canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* The browser implements the CSS cascade, where the order of properties is a
* factor in determining which styles to paint. React Native is different. It
* gives giving precedence to the more specific style property. For example,
* the value of `paddingTop` takes precedence over that of `padding`.
*
* This module creates mutally exclusive style declarations by expanding all of
* React Native's supported shortform properties (e.g. `padding`) to their
* longfrom equivalents.
*/
var emptyObject = {};
var supportsCSS3TextDecoration = !_canUseDom.default || window.CSS != null && window.CSS.supports != null && (window.CSS.supports('text-decoration-line', 'none') || window.CSS.supports('-webkit-text-decoration-line', 'none'));
var MONOSPACE_FONT_STACK = 'monospace,monospace';
var SYSTEM_FONT_STACK = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
var STYLE_SHORT_FORM_EXPANSIONS = {
borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],
borderBlockColor: ['borderTopColor', 'borderBottomColor'],
borderInlineColor: ['borderRightColor', 'borderLeftColor'],
borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],
borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],
borderBlockStyle: ['borderTopStyle', 'borderBottomStyle'],
borderInlineStyle: ['borderRightStyle', 'borderLeftStyle'],
borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],
borderBlockWidth: ['borderTopWidth', 'borderBottomWidth'],
borderInlineWidth: ['borderRightWidth', 'borderLeftWidth'],
insetBlock: ['top', 'bottom'],
insetInline: ['left', 'right'],
marginBlock: ['marginTop', 'marginBottom'],
marginInline: ['marginRight', 'marginLeft'],
paddingBlock: ['paddingTop', 'paddingBottom'],
paddingInline: ['paddingRight', 'paddingLeft'],
overflow: ['overflowX', 'overflowY'],
overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'],
borderBlockStartColor: ['borderTopColor'],
borderBlockStartStyle: ['borderTopStyle'],
borderBlockStartWidth: ['borderTopWidth'],
borderBlockEndColor: ['borderBottomColor'],
borderBlockEndStyle: ['borderBottomStyle'],
borderBlockEndWidth: ['borderBottomWidth'],
//borderInlineStartColor: ['borderLeftColor'],
//borderInlineStartStyle: ['borderLeftStyle'],
//borderInlineStartWidth: ['borderLeftWidth'],
//borderInlineEndColor: ['borderRightColor'],
//borderInlineEndStyle: ['borderRightStyle'],
//borderInlineEndWidth: ['borderRightWidth'],
borderEndStartRadius: ['borderBottomLeftRadius'],
borderEndEndRadius: ['borderBottomRightRadius'],
borderStartStartRadius: ['borderTopLeftRadius'],
borderStartEndRadius: ['borderTopRightRadius'],
insetBlockEnd: ['bottom'],
insetBlockStart: ['top'],
//insetInlineEnd: ['right'],
//insetInlineStart: ['left'],
marginBlockStart: ['marginTop'],
marginBlockEnd: ['marginBottom'],
//marginInlineStart: ['marginLeft'],
//marginInlineEnd: ['marginRight'],
paddingBlockStart: ['paddingTop'],
paddingBlockEnd: ['paddingBottom']
//paddingInlineStart: ['marginLeft'],
//paddingInlineEnd: ['marginRight'],
};
/**
* Reducer
*/
var createReactDOMStyle = (style, isInline) => {
if (!style) {
return emptyObject;
}
var resolvedStyle = {};
var _loop = function _loop() {
var value = style[prop];
if (
// Ignore everything with a null value
value == null) {
return "continue";
}
if (prop === 'backgroundClip') {
// TODO: remove once this issue is fixed
// https://github.com/rofrischmann/inline-style-prefixer/issues/159
if (value === 'text') {
resolvedStyle.backgroundClip = value;
resolvedStyle.WebkitBackgroundClip = value;
}
} else if (prop === 'flex') {
if (value === -1) {
resolvedStyle.flexGrow = 0;
resolvedStyle.flexShrink = 1;
resolvedStyle.flexBasis = 'auto';
} else {
resolvedStyle.flex = value;
}
} else if (prop === 'font') {
resolvedStyle[prop] = value.replace('System', SYSTEM_FONT_STACK);
} else if (prop === 'fontFamily') {
if (value.indexOf('System') > -1) {
var stack = value.split(/,\s*/);
stack[stack.indexOf('System')] = SYSTEM_FONT_STACK;
resolvedStyle[prop] = stack.join(',');
} else if (value === 'monospace') {
resolvedStyle[prop] = MONOSPACE_FONT_STACK;
} else {
resolvedStyle[prop] = value;
}
} else if (prop === 'textDecorationLine') {
// use 'text-decoration' for browsers that only support CSS2
// text-decoration (e.g., IE, Edge)
if (!supportsCSS3TextDecoration) {
resolvedStyle.textDecoration = value;
} else {
resolvedStyle.textDecorationLine = value;
}
} else if (prop === 'writingDirection') {
resolvedStyle.direction = value;
} else {
var _value = (0, _normalizeValueWithProperty.default)(style[prop], prop);
var longFormProperties = STYLE_SHORT_FORM_EXPANSIONS[prop];
if (isInline && prop === 'inset') {
if (style.insetInline == null) {
resolvedStyle.left = _value;
resolvedStyle.right = _value;
}
if (style.insetBlock == null) {
resolvedStyle.top = _value;
resolvedStyle.bottom = _value;
}
} else if (isInline && prop === 'margin') {
if (style.marginInline == null) {
resolvedStyle.marginLeft = _value;
resolvedStyle.marginRight = _value;
}
if (style.marginBlock == null) {
resolvedStyle.marginTop = _value;
resolvedStyle.marginBottom = _value;
}
} else if (isInline && prop === 'padding') {
if (style.paddingInline == null) {
resolvedStyle.paddingLeft = _value;
resolvedStyle.paddingRight = _value;
}
if (style.paddingBlock == null) {
resolvedStyle.paddingTop = _value;
resolvedStyle.paddingBottom = _value;
}
} else if (longFormProperties) {
longFormProperties.forEach((longForm, i) => {
// The value of any longform property in the original styles takes
// precedence over the shortform's value.
if (style[longForm] == null) {
resolvedStyle[longForm] = _value;
}
});
} else {
resolvedStyle[prop] = _value;
}
}
};
for (var prop in style) {
var _ret = _loop();
if (_ret === "continue") continue;
}
return resolvedStyle;
};
var _default = createReactDOMStyle;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/hash.js
"use strict"; exports.__esModule = true; exports.default = void 0; /* eslint-disable */ /** * JS Implementation of MurmurHash2 * * @author <a href="mailto:[email protected]">Gary Court</a> * @see http://github.com/garycourt/murmurhash-js * @author <a href="mailto:[email protected]">Austin Appleby</a> * @see http://sites.google.com/site/murmurhash/ * * @param {string} str ASCII only * @param {number} seed Positive integer only * @return {number} 32-bit positive integer hash * * */ function murmurhash2_32_gc(str, seed) { var l = str.length, h = seed ^ l, i = 0, k; while (l >= 4) { k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16); k ^= k >>> 24; k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16); h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k; l -= 4; ++i; } switch (l) { case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16; case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8; case 1: h ^= str.charCodeAt(i) & 0xff; h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16); } h ^= h >>> 13; h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16); h ^= h >>> 15; return h >>> 0; } var hash = str => murmurhash2_32_gc(str, 1).toString(36); var _default = hash; exports.default = _default; module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/hyphenateStyleName.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var uppercasePattern = /[A-Z]/g;
var msPattern = /^ms-/;
var cache = {};
function toHyphenLower(match) {
return '-' + match.toLowerCase();
}
function hyphenateStyleName(name) {
if (name in cache) {
return cache[name];
}
var hName = name.replace(uppercasePattern, toHyphenLower);
return cache[name] = msPattern.test(hName) ? '-' + hName : hName;
}
var _default = hyphenateStyleName;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.atomic = atomic;
exports.classic = classic;
exports.inline = inline;
exports.stringifyValueWithProperty = stringifyValueWithProperty;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _createReactDOMStyle = _interopRequireDefault(require("./createReactDOMStyle"));
var _hash = _interopRequireDefault(require("./hash"));
var _hyphenateStyleName = _interopRequireDefault(require("./hyphenateStyleName"));
var _normalizeValueWithProperty = _interopRequireDefault(require("./normalizeValueWithProperty"));
var _prefixStyles = _interopRequireDefault(require("../../../modules/prefixStyles"));
var _excluded = ["animationKeyframes"];
var cache = new Map();
var emptyObject = {};
var classicGroup = 1;
var atomicGroup = 3;
var customGroup = {
borderColor: 2,
borderRadius: 2,
borderStyle: 2,
borderWidth: 2,
display: 2,
flex: 2,
inset: 2,
margin: 2,
overflow: 2,
overscrollBehavior: 2,
padding: 2,
insetBlock: 2.1,
insetInline: 2.1,
marginInline: 2.1,
marginBlock: 2.1,
paddingInline: 2.1,
paddingBlock: 2.1,
borderBlockStartColor: 2.2,
borderBlockStartStyle: 2.2,
borderBlockStartWidth: 2.2,
borderBlockEndColor: 2.2,
borderBlockEndStyle: 2.2,
borderBlockEndWidth: 2.2,
borderInlineStartColor: 2.2,
borderInlineStartStyle: 2.2,
borderInlineStartWidth: 2.2,
borderInlineEndColor: 2.2,
borderInlineEndStyle: 2.2,
borderInlineEndWidth: 2.2,
borderEndStartRadius: 2.2,
borderEndEndRadius: 2.2,
borderStartStartRadius: 2.2,
borderStartEndRadius: 2.2,
insetBlockEnd: 2.2,
insetBlockStart: 2.2,
insetInlineEnd: 2.2,
insetInlineStart: 2.2,
marginBlockStart: 2.2,
marginBlockEnd: 2.2,
marginInlineStart: 2.2,
marginInlineEnd: 2.2,
paddingBlockStart: 2.2,
paddingBlockEnd: 2.2,
paddingInlineStart: 2.2,
paddingInlineEnd: 2.2
};
var borderTopLeftRadius = 'borderTopLeftRadius';
var borderTopRightRadius = 'borderTopRightRadius';
var borderBottomLeftRadius = 'borderBottomLeftRadius';
var borderBottomRightRadius = 'borderBottomRightRadius';
var borderLeftColor = 'borderLeftColor';
var borderLeftStyle = 'borderLeftStyle';
var borderLeftWidth = 'borderLeftWidth';
var borderRightColor = 'borderRightColor';
var borderRightStyle = 'borderRightStyle';
var borderRightWidth = 'borderRightWidth';
var right = 'right';
var marginLeft = 'marginLeft';
var marginRight = 'marginRight';
var paddingLeft = 'paddingLeft';
var paddingRight = 'paddingRight';
var left = 'left';
// Map of LTR property names to their BiDi equivalent.
var PROPERTIES_FLIP = {
[borderTopLeftRadius]: borderTopRightRadius,
[borderTopRightRadius]: borderTopLeftRadius,
[borderBottomLeftRadius]: borderBottomRightRadius,
[borderBottomRightRadius]: borderBottomLeftRadius,
[borderLeftColor]: borderRightColor,
[borderLeftStyle]: borderRightStyle,
[borderLeftWidth]: borderRightWidth,
[borderRightColor]: borderLeftColor,
[borderRightStyle]: borderLeftStyle,
[borderRightWidth]: borderLeftWidth,
[left]: right,
[marginLeft]: marginRight,
[marginRight]: marginLeft,
[paddingLeft]: paddingRight,
[paddingRight]: paddingLeft,
[right]: left
};
// Map of I18N property names to their LTR equivalent.
var PROPERTIES_I18N = {
borderStartStartRadius: borderTopLeftRadius,
borderStartEndRadius: borderTopRightRadius,
borderEndStartRadius: borderBottomLeftRadius,
borderEndEndRadius: borderBottomRightRadius,
borderInlineStartColor: borderLeftColor,
borderInlineStartStyle: borderLeftStyle,
borderInlineStartWidth: borderLeftWidth,
borderInlineEndColor: borderRightColor,
borderInlineEndStyle: borderRightStyle,
borderInlineEndWidth: borderRightWidth,
insetInlineEnd: right,
insetInlineStart: left,
marginInlineStart: marginLeft,
marginInlineEnd: marginRight,
paddingInlineStart: paddingLeft,
paddingInlineEnd: paddingRight
};
var PROPERTIES_VALUE = ['clear', 'float', 'textAlign'];
function atomic(style) {
var compiledStyle = {
$$css: true
};
var compiledRules = [];
function atomicCompile(srcProp, prop, value) {
var valueString = stringifyValueWithProperty(value, prop);
var cacheKey = prop + valueString;
var cachedResult = cache.get(cacheKey);
var identifier;
if (cachedResult != null) {
identifier = cachedResult[0];
compiledRules.push(cachedResult[1]);
} else {
var v = srcProp !== prop ? cacheKey : valueString;
identifier = createIdentifier('r', srcProp, v);
var order = customGroup[srcProp] || atomicGroup;
var rules = createAtomicRules(identifier, prop, value);
var orderedRules = [rules, order];
compiledRules.push(orderedRules);
cache.set(cacheKey, [identifier, orderedRules]);
}
return identifier;
}
Object.keys(style).sort().forEach(srcProp => {
var value = style[srcProp];
if (value != null) {
var localizeableValue;
// BiDi flip values
if (PROPERTIES_VALUE.indexOf(srcProp) > -1) {
var _left = atomicCompile(srcProp, srcProp, 'left');
var _right = atomicCompile(srcProp, srcProp, 'right');
if (value === 'start') {
localizeableValue = [_left, _right];
} else if (value === 'end') {
localizeableValue = [_right, _left];
}
}
// BiDi flip properties
var propPolyfill = PROPERTIES_I18N[srcProp];
if (propPolyfill != null) {
var ltr = atomicCompile(srcProp, propPolyfill, value);
var rtl = atomicCompile(srcProp, PROPERTIES_FLIP[propPolyfill], value);
localizeableValue = [ltr, rtl];
}
// BiDi flip transitionProperty value
if (srcProp === 'transitionProperty') {
var values = Array.isArray(value) ? value : [value];
var polyfillIndices = [];
for (var i = 0; i < values.length; i++) {
var val = values[i];
if (typeof val === 'string' && PROPERTIES_I18N[val] != null) {
polyfillIndices.push(i);
}
}
if (polyfillIndices.length > 0) {
var ltrPolyfillValues = [...values];
var rtlPolyfillValues = [...values];
polyfillIndices.forEach(i => {
var ltrVal = ltrPolyfillValues[i];
if (typeof ltrVal === 'string') {
var ltrPolyfill = PROPERTIES_I18N[ltrVal];
var rtlPolyfill = PROPERTIES_FLIP[ltrPolyfill];
ltrPolyfillValues[i] = ltrPolyfill;
rtlPolyfillValues[i] = rtlPolyfill;
var _ltr = atomicCompile(srcProp, srcProp, ltrPolyfillValues);
var _rtl = atomicCompile(srcProp, srcProp, rtlPolyfillValues);
localizeableValue = [_ltr, _rtl];
}
});
}
}
if (localizeableValue == null) {
localizeableValue = atomicCompile(srcProp, srcProp, value);
} else {
compiledStyle['$$css$localize'] = true;
}
compiledStyle[srcProp] = localizeableValue;
}
});
return [compiledStyle, compiledRules];
}
/**
* Compile simple style object to classic CSS rules.
* No support for 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
*/
function classic(style, name) {
var compiledStyle = {
$$css: true
};
var compiledRules = [];
var animationKeyframes = style.animationKeyframes,
rest = (0, _objectWithoutPropertiesLoose2.default)(style, _excluded);
var identifier = createIdentifier('css', name, JSON.stringify(style));
var selector = "." + identifier;
var animationName;
if (animationKeyframes != null) {
var _processKeyframesValu = processKeyframesValue(animationKeyframes),
animationNames = _processKeyframesValu[0],
keyframesRules = _processKeyframesValu[1];
animationName = animationNames.join(',');
compiledRules.push(...keyframesRules);
}
var block = createDeclarationBlock((0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
animationName
}));
compiledRules.push("" + selector + block);
compiledStyle[identifier] = identifier;
return [compiledStyle, [[compiledRules, classicGroup]]];
}
/**
* Compile simple style object to inline DOM styles.
* No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
*/
function inline(originalStyle, isRTL) {
var style = originalStyle || emptyObject;
var frozenProps = {};
var nextStyle = {};
var _loop = function _loop() {
var originalValue = style[originalProp];
var prop = originalProp;
var value = originalValue;
if (!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null) {
return "continue";
}
// BiDi flip values
if (PROPERTIES_VALUE.indexOf(originalProp) > -1) {
if (originalValue === 'start') {
value = isRTL ? 'right' : 'left';
} else if (originalValue === 'end') {
value = isRTL ? 'left' : 'right';
}
}
// BiDi flip properties
var propPolyfill = PROPERTIES_I18N[originalProp];
if (propPolyfill != null) {
prop = isRTL ? PROPERTIES_FLIP[propPolyfill] : propPolyfill;
}
// BiDi flip transitionProperty value
if (originalProp === 'transitionProperty') {
// $FlowFixMe
var originalValues = Array.isArray(originalValue) ? originalValue : [originalValue];
originalValues.forEach((val, i) => {
if (typeof val === 'string') {
var valuePolyfill = PROPERTIES_I18N[val];
if (valuePolyfill != null) {
originalValues[i] = isRTL ? PROPERTIES_FLIP[valuePolyfill] : valuePolyfill;
value = originalValues.join(' ');
}
}
});
}
// Create finalized style
if (!frozenProps[prop]) {
nextStyle[prop] = value;
}
if (prop === originalProp) {
frozenProps[prop] = true;
}
// if (PROPERTIES_I18N.hasOwnProperty(originalProp)) {
// frozenProps[prop] = true;
//}
};
for (var originalProp in style) {
var _ret = _loop();
if (_ret === "continue") continue;
}
return (0, _createReactDOMStyle.default)(nextStyle, true);
}
/**
* Create a value string that normalizes different input values with a common
* output.
*/
function stringifyValueWithProperty(value, property) {
// e.g., 0 => '0px', 'black' => 'rgba(0,0,0,1)'
var normalizedValue = (0, _normalizeValueWithProperty.default)(value, property);
return typeof normalizedValue !== 'string' ? JSON.stringify(normalizedValue || '') : normalizedValue;
}
/**
* Create the Atomic CSS rules needed for a given StyleSheet rule.
* Translates StyleSheet declarations to CSS.
*/
function createAtomicRules(identifier, property, value) {
var rules = [];
var selector = "." + identifier;
// Handle non-standard properties and object values that require multiple
// CSS rules to be created.
switch (property) {
case 'animationKeyframes':
{
var _processKeyframesValu2 = processKeyframesValue(value),
animationNames = _processKeyframesValu2[0],
keyframesRules = _processKeyframesValu2[1];
var block = createDeclarationBlock({
animationName: animationNames.join(',')
});
rules.push("" + selector + block, ...keyframesRules);
break;
}
// Equivalent to using '::placeholder'
case 'placeholderTextColor':
{
var _block = createDeclarationBlock({
color: value,
opacity: 1
});
rules.push(selector + "::-webkit-input-placeholder" + _block, selector + "::-moz-placeholder" + _block, selector + ":-ms-input-placeholder" + _block, selector + "::placeholder" + _block);
break;
}
// Polyfill for additional 'pointer-events' values
// See d13f78622b233a0afc0c7a200c0a0792c8ca9e58
case 'pointerEvents':
{
var finalValue = value;
if (value === 'auto' || value === 'box-only') {
finalValue = 'auto!important';
if (value === 'box-only') {
var _block2 = createDeclarationBlock({
pointerEvents: 'none'
});
rules.push(selector + ">*" + _block2);
}
} else if (value === 'none' || value === 'box-none') {
finalValue = 'none!important';
if (value === 'box-none') {
var _block3 = createDeclarationBlock({
pointerEvents: 'auto'
});
rules.push(selector + ">*" + _block3);
}
}
var _block4 = createDeclarationBlock({
pointerEvents: finalValue
});
rules.push("" + selector + _block4);
break;
}
// Polyfill for draft spec
// https://drafts.csswg.org/css-scrollbars-1/
case 'scrollbarWidth':
{
if (value === 'none') {
rules.push(selector + "::-webkit-scrollbar{display:none}");
}
var _block5 = createDeclarationBlock({
scrollbarWidth: value
});
rules.push("" + selector + _block5);
break;
}
default:
{
var _block6 = createDeclarationBlock({
[property]: value
});
rules.push("" + selector + _block6);
break;
}
}
return rules;
}
/**
* Creates a CSS declaration block from a StyleSheet object.
*/
function createDeclarationBlock(style) {
var domStyle = (0, _prefixStyles.default)((0, _createReactDOMStyle.default)(style));
var declarationsString = Object.keys(domStyle).map(property => {
var value = domStyle[property];
var prop = (0, _hyphenateStyleName.default)(property);
// The prefixer may return an array of values:
// { display: [ '-webkit-flex', 'flex' ] }
// to represent "fallback" declarations
// { display: -webkit-flex; display: flex; }
if (Array.isArray(value)) {
return value.map(v => prop + ":" + v).join(';');
} else {
return prop + ":" + value;
}
})
// Once properties are hyphenated, this will put the vendor
// prefixed and short-form properties first in the list.
.sort().join(';');
return "{" + declarationsString + ";}";
}
/**
* An identifier is associated with a unique set of styles.
*/
function createIdentifier(prefix, name, key) {
var hashedString = (0, _hash.default)(name + key);
return process.env.NODE_ENV !== 'production' ? prefix + "-" + name + "-" + hashedString : prefix + "-" + hashedString;
}
/**
* Create individual CSS keyframes rules.
*/
function createKeyframes(keyframes) {
var prefixes = ['-webkit-', ''];
var identifier = createIdentifier('r', 'animation', JSON.stringify(keyframes));
var steps = '{' + Object.keys(keyframes).map(stepName => {
var rule = keyframes[stepName];
var block = createDeclarationBlock(rule);
return "" + stepName + block;
}).join('') + '}';
var rules = prefixes.map(prefix => {
return "@" + prefix + "keyframes " + identifier + steps;
});
return [identifier, rules];
}
/**
* Create CSS keyframes rules and names from a StyleSheet keyframes object.
*/
function processKeyframesValue(keyframesValue) {
if (typeof keyframesValue === 'number') {
throw new Error("Invalid CSS keyframes type: " + typeof keyframesValue);
}
var animationNames = [];
var rules = [];
var value = Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue];
value.forEach(keyframes => {
if (typeof keyframes === 'string') {
// Support external animation libraries (identifiers only)
animationNames.push(keyframes);
} else {
// Create rules for each of the keyframes
var _createKeyframes = createKeyframes(keyframes),
identifier = _createKeyframes[0],
keyframesRules = _createKeyframes[1];
animationNames.push(identifier);
rules.push(...keyframesRules);
}
});
return [animationNames, rules];
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/normalizeColor.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _isWebColor = _interopRequireDefault(require("../../../modules/isWebColor"));
var _processColor = _interopRequireDefault(require("../../../exports/processColor"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var normalizeColor = function normalizeColor(color, opacity) {
if (opacity === void 0) {
opacity = 1;
}
if (color == null) return;
if (typeof color === 'string' && (0, _isWebColor.default)(color)) {
return color;
}
var colorInt = (0, _processColor.default)(color);
if (colorInt != null) {
var r = colorInt >> 16 & 255;
var g = colorInt >> 8 & 255;
var b = colorInt & 255;
var a = (colorInt >> 24 & 255) / 255;
var alpha = (a * opacity).toFixed(2);
return "rgba(" + r + "," + g + "," + b + "," + alpha + ")";
}
};
var _default = normalizeColor;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/normalizeValueWithProperty.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = normalizeValueWithProperty;
var _unitlessNumbers = _interopRequireDefault(require("./unitlessNumbers"));
var _normalizeColor = _interopRequireDefault(require("./normalizeColor"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var colorProps = {
backgroundColor: true,
borderColor: true,
borderTopColor: true,
borderRightColor: true,
borderBottomColor: true,
borderLeftColor: true,
color: true,
shadowColor: true,
textDecorationColor: true,
textShadowColor: true
};
function normalizeValueWithProperty(value, property) {
var returnValue = value;
if ((property == null || !_unitlessNumbers.default[property]) && typeof value === 'number') {
returnValue = value + "px";
} else if (property != null && colorProps[property]) {
returnValue = (0, _normalizeColor.default)(value);
}
return returnValue;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/compiler/unitlessNumbers.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var unitlessNumbers = {
animationIterationCount: true,
aspectRatio: true,
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
flexOrder: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
fontWeight: true,
gridRow: true,
gridRowEnd: true,
gridRowGap: true,
gridRowStart: true,
gridColumn: true,
gridColumnEnd: true,
gridColumnGap: true,
gridColumnStart: true,
lineClamp: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true,
// transform types
scale: true,
scaleX: true,
scaleY: true,
scaleZ: true,
// RN properties
shadowOpacity: true
};
/**
* Support style names that may come passed in prefixed by adding permutations
* of vendor prefixes.
*/
var prefixes = ['ms', 'Moz', 'O', 'Webkit'];
var prefixKey = (prefix, key) => {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
};
Object.keys(unitlessNumbers).forEach(prop => {
prefixes.forEach(prefix => {
unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
});
});
var _default = unitlessNumbers;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/dom/createCSSStyleSheet.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = createCSSStyleSheet;
var _canUseDom = _interopRequireDefault(require("../../../modules/canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
// $FlowFixMe: HTMLStyleElement is incorrectly typed - https://github.com/facebook/flow/issues/2696
function createCSSStyleSheet(id, rootNode, textContent) {
if (_canUseDom.default) {
var root = rootNode != null ? rootNode : document;
var element = root.getElementById(id);
if (element == null) {
element = document.createElement('style');
element.setAttribute('id', id);
if (typeof textContent === 'string') {
element.appendChild(document.createTextNode(textContent));
}
if (root instanceof ShadowRoot) {
root.insertBefore(element, root.firstChild);
} else {
var head = root.head;
if (head) {
head.insertBefore(element, head.firstChild);
}
}
}
// $FlowFixMe: HTMLElement is incorrectly typed
return element.sheet;
} else {
return null;
}
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/dom/createOrderedCSSStyleSheet.js
"use strict";
exports.__esModule = true;
exports.default = createOrderedCSSStyleSheet;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var slice = Array.prototype.slice;
/**
* Order-based insertion of CSS.
*
* Each rule is associated with a numerically defined group.
* Groups are ordered within the style sheet according to their number, with the
* lowest first.
*
* Groups are implemented using marker rules. The selector of the first rule of
* each group is used only to encode the group number for hydration. An
* alternative implementation could rely on CSSMediaRule, allowing groups to be
* treated as a sub-sheet, but the Edge implementation of CSSMediaRule is
* broken.
* https://developer.mozilla.org/en-US/docs/Web/API/CSSMediaRule
* https://gist.github.com/necolas/aa0c37846ad6bd3b05b727b959e82674
*/
function createOrderedCSSStyleSheet(sheet) {
var groups = {};
var selectors = {};
/**
* Hydrate approximate record from any existing rules in the sheet.
*/
if (sheet != null) {
var group;
slice.call(sheet.cssRules).forEach((cssRule, i) => {
var cssText = cssRule.cssText;
// Create record of existing selectors and rules
if (cssText.indexOf('stylesheet-group') > -1) {
group = decodeGroupRule(cssRule);
groups[group] = {
start: i,
rules: [cssText]
};
} else {
var selectorText = getSelectorText(cssText);
if (selectorText != null) {
selectors[selectorText] = true;
groups[group].rules.push(cssText);
}
}
});
}
function sheetInsert(sheet, group, text) {
var orderedGroups = getOrderedGroups(groups);
var groupIndex = orderedGroups.indexOf(group);
var nextGroupIndex = groupIndex + 1;
var nextGroup = orderedGroups[nextGroupIndex];
// Insert rule before the next group, or at the end of the stylesheet
var position = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet.cssRules.length;
var isInserted = insertRuleAt(sheet, text, position);
if (isInserted) {
// Set the starting index of the new group
if (groups[group].start == null) {
groups[group].start = position;
}
// Increment the starting index of all subsequent groups
for (var i = nextGroupIndex; i < orderedGroups.length; i += 1) {
var groupNumber = orderedGroups[i];
var previousStart = groups[groupNumber].start || 0;
groups[groupNumber].start = previousStart + 1;
}
}
return isInserted;
}
var OrderedCSSStyleSheet = {
/**
* The textContent of the style sheet.
*/
getTextContent() {
return getOrderedGroups(groups).map(group => {
var rules = groups[group].rules;
// Sorting provides deterministic order of styles in group for
// build-time extraction of the style sheet.
var marker = rules.shift();
rules.sort();
rules.unshift(marker);
return rules.join('\n');
}).join('\n');
},
/**
* Insert a rule into the style sheet
*/
insert(cssText, groupValue) {
var group = Number(groupValue);
// Create a new group.
if (groups[group] == null) {
var markerRule = encodeGroupRule(group);
// Create the internal record.
groups[group] = {
start: null,
rules: [markerRule]
};
// Update CSSOM.
if (sheet != null) {
sheetInsert(sheet, group, markerRule);
}
}
// selectorText is more reliable than cssText for insertion checks. The
// browser excludes vendor-prefixed properties and rewrites certain values
// making cssText more likely to be different from what was inserted.
var selectorText = getSelectorText(cssText);
if (selectorText != null && selectors[selectorText] == null) {
// Update the internal records.
selectors[selectorText] = true;
groups[group].rules.push(cssText);
// Update CSSOM.
if (sheet != null) {
var isInserted = sheetInsert(sheet, group, cssText);
if (!isInserted) {
// Revert internal record change if a rule was rejected (e.g.,
// unrecognized pseudo-selector)
groups[group].rules.pop();
}
}
}
}
};
return OrderedCSSStyleSheet;
}
/**
* Helper functions
*/
function encodeGroupRule(group) {
return "[stylesheet-group=\"" + group + "\"]{}";
}
var groupPattern = /["']/g;
function decodeGroupRule(cssRule) {
return Number(cssRule.selectorText.split(groupPattern)[1]);
}
function getOrderedGroups(obj) {
return Object.keys(obj).map(Number).sort((a, b) => a > b ? 1 : -1);
}
var selectorPattern = /\s*([,])\s*/g;
function getSelectorText(cssText) {
var selector = cssText.split('{')[0].trim();
return selector !== '' ? selector.replace(selectorPattern, '$1') : null;
}
function insertRuleAt(root, cssText, position) {
try {
// $FlowFixMe: Flow is missing CSSOM types needed to type 'root'.
root.insertRule(cssText, position);
return true;
} catch (e) {
// JSDOM doesn't support `CSSSMediaRule#insertRule`.
// Also ignore errors that occur from attempting to insert vendor-prefixed selectors.
return false;
}
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/dom/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.createSheet = createSheet;
var _canUseDom = _interopRequireDefault(require("../../../modules/canUseDom"));
var _createCSSStyleSheet = _interopRequireDefault(require("./createCSSStyleSheet"));
var _createOrderedCSSStyleSheet = _interopRequireDefault(require("./createOrderedCSSStyleSheet"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var defaultId = 'react-native-stylesheet';
var roots = new WeakMap();
var sheets = [];
var initialRules = [
// minimal top-level reset
'html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}', 'body{margin:0;}',
// minimal form pseudo-element reset
'button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}', 'input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}'];
function createSheet(root, id) {
if (id === void 0) {
id = defaultId;
}
var sheet;
if (_canUseDom.default) {
var rootNode = root != null ? root.getRootNode() : document;
// Create the initial style sheet
if (sheets.length === 0) {
sheet = (0, _createOrderedCSSStyleSheet.default)((0, _createCSSStyleSheet.default)(id));
initialRules.forEach(rule => {
sheet.insert(rule, 0);
});
roots.set(rootNode, sheets.length);
sheets.push(sheet);
} else {
var index = roots.get(rootNode);
if (index == null) {
var initialSheet = sheets[0];
// If we're creating a new sheet, populate it with existing styles
var textContent = initialSheet != null ? initialSheet.getTextContent() : '';
// Cast rootNode to 'any' because Flow types for getRootNode are wrong
sheet = (0, _createOrderedCSSStyleSheet.default)((0, _createCSSStyleSheet.default)(id, rootNode, textContent));
roots.set(rootNode, sheets.length);
sheets.push(sheet);
} else {
sheet = sheets[index];
}
}
} else {
// Create the initial style sheet
if (sheets.length === 0) {
sheet = (0, _createOrderedCSSStyleSheet.default)((0, _createCSSStyleSheet.default)(id));
initialRules.forEach(rule => {
sheet.insert(rule, 0);
});
sheets.push(sheet);
} else {
sheet = sheets[0];
}
}
return {
getTextContent() {
return sheet.getTextContent();
},
id,
insert(cssText, groupValue) {
sheets.forEach(s => {
s.insert(cssText, groupValue);
});
}
};
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _compiler = require("./compiler");
var _dom = require("./dom");
var _transformLocalizeStyle = require("styleq/transform-localize-style");
var _preprocess = require("./preprocess");
var _styleq = require("styleq");
var _validate = require("./validate");
var _canUseDom = _interopRequireDefault(require("../../modules/canUseDom"));
var _excluded = ["writingDirection"];
var staticStyleMap = new WeakMap();
var sheet = (0, _dom.createSheet)();
var defaultPreprocessOptions = {
shadow: true,
textShadow: true
};
function customStyleq(styles, options) {
if (options === void 0) {
options = {};
}
var _options = options,
writingDirection = _options.writingDirection,
preprocessOptions = (0, _objectWithoutPropertiesLoose2.default)(_options, _excluded);
var isRTL = writingDirection === 'rtl';
return _styleq.styleq.factory({
transform(style) {
var compiledStyle = staticStyleMap.get(style);
if (compiledStyle != null) {
return (0, _transformLocalizeStyle.localizeStyle)(compiledStyle, isRTL);
}
return (0, _preprocess.preprocess)(style, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultPreprocessOptions), preprocessOptions));
}
})(styles);
}
function insertRules(compiledOrderedRules) {
compiledOrderedRules.forEach(_ref => {
var rules = _ref[0],
order = _ref[1];
if (sheet != null) {
rules.forEach(rule => {
sheet.insert(rule, order);
});
}
});
}
function compileAndInsertAtomic(style) {
var _atomic = (0, _compiler.atomic)((0, _preprocess.preprocess)(style, defaultPreprocessOptions)),
compiledStyle = _atomic[0],
compiledOrderedRules = _atomic[1];
insertRules(compiledOrderedRules);
return compiledStyle;
}
function compileAndInsertReset(style, key) {
var _classic = (0, _compiler.classic)(style, key),
compiledStyle = _classic[0],
compiledOrderedRules = _classic[1];
insertRules(compiledOrderedRules);
return compiledStyle;
}
/* ----- API ----- */
var absoluteFillObject = {
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0
};
var absoluteFill = create({
x: (0, _objectSpread2.default)({}, absoluteFillObject)
}).x;
/**
* create
*/
function create(styles) {
Object.keys(styles).forEach(key => {
var styleObj = styles[key];
// Only compile at runtime if the style is not already compiled
if (styleObj != null && styleObj.$$css !== true) {
var compiledStyles;
if (key.indexOf('$raw') > -1) {
compiledStyles = compileAndInsertReset(styleObj, key.split('$raw')[0]);
} else {
if (process.env.NODE_ENV !== 'production') {
(0, _validate.validate)(styleObj);
styles[key] = Object.freeze(styleObj);
}
compiledStyles = compileAndInsertAtomic(styleObj);
}
staticStyleMap.set(styleObj, compiledStyles);
}
});
return styles;
}
/**
* compose
*/
function compose(style1, style2) {
if (process.env.NODE_ENV !== 'production') {
/* eslint-disable prefer-rest-params */
var len = arguments.length;
if (len > 2) {
var readableStyles = [...arguments].map(a => flatten(a));
throw new Error("StyleSheet.compose() only accepts 2 arguments, received " + len + ": " + JSON.stringify(readableStyles));
}
/* eslint-enable prefer-rest-params */
console.warn('StyleSheet.compose(a, b) is deprecated; use array syntax, i.e., [a,b].');
}
return [style1, style2];
}
/**
* flatten
*/
function flatten() {
for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {
styles[_key] = arguments[_key];
}
var flatArray = styles.flat(Infinity);
var result = {};
for (var i = 0; i < flatArray.length; i++) {
var style = flatArray[i];
if (style != null && typeof style === 'object') {
// $FlowFixMe
Object.assign(result, style);
}
}
return result;
}
/**
* getSheet
*/
function getSheet() {
return {
id: sheet.id,
textContent: sheet.getTextContent()
};
}
/**
* resolve
*/
function StyleSheet(styles, options) {
if (options === void 0) {
options = {};
}
var isRTL = options.writingDirection === 'rtl';
var styleProps = customStyleq(styles, options);
if (Array.isArray(styleProps) && styleProps[1] != null) {
styleProps[1] = (0, _compiler.inline)(styleProps[1], isRTL);
}
return styleProps;
}
StyleSheet.absoluteFill = absoluteFill;
StyleSheet.absoluteFillObject = absoluteFillObject;
StyleSheet.create = create;
StyleSheet.compose = compose;
StyleSheet.flatten = flatten;
StyleSheet.getSheet = getSheet;
// `hairlineWidth` is not implemented using screen density as browsers may
// round sub-pixel values down to `0`, causing the line not to be rendered.
StyleSheet.hairlineWidth = 1;
if (_canUseDom.default && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = StyleSheet.flatten;
}
var stylesheet = StyleSheet;
var _default = stylesheet;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/preprocess.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.preprocess = exports.default = exports.createTransformValue = exports.createTextShadowValue = exports.createBoxShadowValue = void 0;
var _normalizeColor = _interopRequireDefault(require("./compiler/normalizeColor"));
var _normalizeValueWithProperty = _interopRequireDefault(require("./compiler/normalizeValueWithProperty"));
var _warnOnce = require("../../modules/warnOnce");
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var emptyObject = {};
/**
* Shadows
*/
var defaultOffset = {
height: 0,
width: 0
};
var createBoxShadowValue = style => {
var shadowColor = style.shadowColor,
shadowOffset = style.shadowOffset,
shadowOpacity = style.shadowOpacity,
shadowRadius = style.shadowRadius;
var _ref = shadowOffset || defaultOffset,
height = _ref.height,
width = _ref.width;
var offsetX = (0, _normalizeValueWithProperty.default)(width);
var offsetY = (0, _normalizeValueWithProperty.default)(height);
var blurRadius = (0, _normalizeValueWithProperty.default)(shadowRadius || 0);
var color = (0, _normalizeColor.default)(shadowColor || 'black', shadowOpacity);
if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
return offsetX + " " + offsetY + " " + blurRadius + " " + color;
}
};
exports.createBoxShadowValue = createBoxShadowValue;
var createTextShadowValue = style => {
var textShadowColor = style.textShadowColor,
textShadowOffset = style.textShadowOffset,
textShadowRadius = style.textShadowRadius;
var _ref2 = textShadowOffset || defaultOffset,
height = _ref2.height,
width = _ref2.width;
var radius = textShadowRadius || 0;
var offsetX = (0, _normalizeValueWithProperty.default)(width);
var offsetY = (0, _normalizeValueWithProperty.default)(height);
var blurRadius = (0, _normalizeValueWithProperty.default)(radius);
var color = (0, _normalizeValueWithProperty.default)(textShadowColor, 'textShadowColor');
if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {
return offsetX + " " + offsetY + " " + blurRadius + " " + color;
}
};
// { scale: 2 } => 'scale(2)'
// { translateX: 20 } => 'translateX(20px)'
// { matrix: [1,2,3,4,5,6] } => 'matrix(1,2,3,4,5,6)'
exports.createTextShadowValue = createTextShadowValue;
var mapTransform = transform => {
var type = Object.keys(transform)[0];
var value = transform[type];
if (type === 'matrix' || type === 'matrix3d') {
return type + "(" + value.join(',') + ")";
} else {
var normalizedValue = (0, _normalizeValueWithProperty.default)(value, type);
return type + "(" + normalizedValue + ")";
}
};
var createTransformValue = value => {
return value.map(mapTransform).join(' ');
};
exports.createTransformValue = createTransformValue;
var PROPERTIES_STANDARD = {
borderBottomEndRadius: 'borderEndEndRadius',
borderBottomStartRadius: 'borderEndStartRadius',
borderTopEndRadius: 'borderStartEndRadius',
borderTopStartRadius: 'borderStartStartRadius',
borderEndColor: 'borderInlineEndColor',
borderEndStyle: 'borderInlineEndStyle',
borderEndWidth: 'borderInlineEndWidth',
borderStartColor: 'borderInlineStartColor',
borderStartStyle: 'borderInlineStartStyle',
borderStartWidth: 'borderInlineStartWidth',
end: 'insetInlineEnd',
marginEnd: 'marginInlineEnd',
marginHorizontal: 'marginInline',
marginStart: 'marginInlineStart',
marginVertical: 'marginBlock',
paddingEnd: 'paddingInlineEnd',
paddingHorizontal: 'paddingInline',
paddingStart: 'paddingInlineStart',
paddingVertical: 'paddingBlock',
start: 'insetInlineStart'
};
var ignoredProps = {
elevation: true,
overlayColor: true,
resizeMode: true,
tintColor: true
};
/**
* Preprocess styles
*/
var preprocess = function preprocess(originalStyle, options) {
if (options === void 0) {
options = {};
}
var style = originalStyle || emptyObject;
var nextStyle = {};
// Convert shadow styles
if (options.shadow === true, style.shadowColor != null || style.shadowOffset != null || style.shadowOpacity != null || style.shadowRadius != null) {
(0, _warnOnce.warnOnce)('shadowStyles', "\"shadow*\" style props are deprecated. Use \"boxShadow\".");
var boxShadowValue = createBoxShadowValue(style);
if (boxShadowValue != null && nextStyle.boxShadow == null) {
var boxShadow = style.boxShadow;
var value = boxShadow ? boxShadow + ", " + boxShadowValue : boxShadowValue;
nextStyle.boxShadow = value;
}
}
// Convert text shadow styles
if (options.textShadow === true, style.textShadowColor != null || style.textShadowOffset != null || style.textShadowRadius != null) {
(0, _warnOnce.warnOnce)('textShadowStyles', "\"textShadow*\" style props are deprecated. Use \"textShadow\".");
var textShadowValue = createTextShadowValue(style);
if (textShadowValue != null && nextStyle.textShadow == null) {
var textShadow = style.textShadow;
var _value = textShadow ? textShadow + ", " + textShadowValue : textShadowValue;
nextStyle.textShadow = _value;
}
}
for (var originalProp in style) {
if (
// Ignore some React Native styles
ignoredProps[originalProp] != null || originalProp === 'shadowColor' || originalProp === 'shadowOffset' || originalProp === 'shadowOpacity' || originalProp === 'shadowRadius' || originalProp === 'textShadowColor' || originalProp === 'textShadowOffset' || originalProp === 'textShadowRadius') {
continue;
}
var originalValue = style[originalProp];
var prop = PROPERTIES_STANDARD[originalProp] || originalProp;
var _value2 = originalValue;
if (!Object.prototype.hasOwnProperty.call(style, originalProp) || prop !== originalProp && style[prop] != null) {
continue;
}
if (prop === 'aspectRatio' && typeof _value2 === 'number') {
nextStyle[prop] = _value2.toString();
} else if (prop === 'fontVariant') {
if (Array.isArray(_value2) && _value2.length > 0) {
(0, _warnOnce.warnOnce)('fontVariant', '"fontVariant" style array value is deprecated. Use space-separated values.');
_value2 = _value2.join(' ');
}
nextStyle[prop] = _value2;
} else if (prop === 'textAlignVertical') {
(0, _warnOnce.warnOnce)('textAlignVertical', '"textAlignVertical" style is deprecated. Use "verticalAlign".');
if (style.verticalAlign == null) {
nextStyle.verticalAlign = _value2 === 'center' ? 'middle' : _value2;
}
} else if (prop === 'transform') {
if (Array.isArray(_value2)) {
_value2 = createTransformValue(_value2);
}
nextStyle.transform = _value2;
} else {
nextStyle[prop] = _value2;
}
}
// $FlowIgnore
return nextStyle;
};
exports.preprocess = preprocess;
var _default = preprocess;
exports.default = _default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/StyleSheet/validate.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.validate = validate;
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var invalidShortforms = {
background: true,
borderBottom: true,
borderLeft: true,
borderRight: true,
borderTop: true,
font: true,
grid: true,
outline: true,
textDecoration: true
};
var invalidMultiValueShortforms = {
flex: true,
margin: true,
padding: true,
borderColor: true,
borderRadius: true,
borderStyle: true,
borderWidth: true,
inset: true,
insetBlock: true,
insetInline: true,
marginBlock: true,
marginInline: true,
marginHorizontal: true,
marginVertical: true,
paddingBlock: true,
paddingInline: true,
paddingHorizontal: true,
paddingVertical: true,
overflow: true,
overscrollBehavior: true,
backgroundPosition: true
};
function error(message) {
console.error(message);
}
function validate(obj) {
for (var k in obj) {
var prop = k.trim();
var value = obj[prop];
var isInvalid = false;
if (value === null) {
continue;
}
if (typeof value === 'string' && value.indexOf('!important') > -1) {
error("Invalid style declaration \"" + prop + ":" + value + "\". Values cannot include \"!important\"");
isInvalid = true;
} else {
var suggestion = '';
if (prop === 'animation' || prop === 'animationName') {
suggestion = 'Did you mean "animationKeyframes"?';
isInvalid = true;
} else if (prop === 'direction') {
suggestion = 'Did you mean "writingDirection"?';
isInvalid = true;
} else if (invalidShortforms[prop]) {
suggestion = 'Please use long-form properties.';
isInvalid = true;
} else if (invalidMultiValueShortforms[prop]) {
if (typeof value === 'string' && (0, _postcssValueParser.default)(value).nodes.length > 1) {
suggestion = "Value is \"" + value + "\" but only single values are supported.";
isInvalid = true;
}
}
if (suggestion !== '') {
error("Invalid style property of \"" + prop + "\". " + suggestion);
}
}
if (isInvalid) {
delete obj[k];
}
}
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Switch/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _createElement = _interopRequireDefault(require("../createElement"));
var _multiplyStyleLengthValue = _interopRequireDefault(require("../../modules/multiplyStyleLengthValue"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _excluded = ["aria-label", "accessibilityLabel", "activeThumbColor", "activeTrackColor", "disabled", "onValueChange", "style", "thumbColor", "trackColor", "value"];
var emptyObject = {};
var thumbDefaultBoxShadow = '0px 1px 3px rgba(0,0,0,0.5)';
var thumbFocusedBoxShadow = thumbDefaultBoxShadow + ", 0 0 0 10px rgba(0,0,0,0.1)";
var defaultActiveTrackColor = '#A3D3CF';
var defaultTrackColor = '#939393';
var defaultDisabledTrackColor = '#D5D5D5';
var defaultActiveThumbColor = '#009688';
var defaultThumbColor = '#FAFAFA';
var defaultDisabledThumbColor = '#BDBDBD';
var Switch = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var ariaLabel = props['aria-label'],
accessibilityLabel = props.accessibilityLabel,
activeThumbColor = props.activeThumbColor,
activeTrackColor = props.activeTrackColor,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
onValueChange = props.onValueChange,
_props$style = props.style,
style = _props$style === void 0 ? emptyObject : _props$style,
thumbColor = props.thumbColor,
trackColor = props.trackColor,
_props$value = props.value,
value = _props$value === void 0 ? false : _props$value,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
var thumbRef = React.useRef(null);
function handleChange(event) {
if (onValueChange != null) {
onValueChange(event.nativeEvent.target.checked);
}
}
function handleFocusState(event) {
var isFocused = event.nativeEvent.type === 'focus';
var boxShadow = isFocused ? thumbFocusedBoxShadow : thumbDefaultBoxShadow;
if (thumbRef.current != null) {
thumbRef.current.style.boxShadow = boxShadow;
}
}
var _StyleSheet$flatten = _StyleSheet.default.flatten(style),
styleHeight = _StyleSheet$flatten.height,
styleWidth = _StyleSheet$flatten.width;
var height = styleHeight || '20px';
var minWidth = (0, _multiplyStyleLengthValue.default)(height, 2);
var width = styleWidth > minWidth ? styleWidth : minWidth;
var trackBorderRadius = (0, _multiplyStyleLengthValue.default)(height, 0.5);
var trackCurrentColor = function () {
if (value === true) {
if (trackColor != null && typeof trackColor === 'object') {
return trackColor.true;
} else {
return activeTrackColor !== null && activeTrackColor !== void 0 ? activeTrackColor : defaultActiveTrackColor;
}
} else {
if (trackColor != null && typeof trackColor === 'object') {
return trackColor.false;
} else {
return trackColor !== null && trackColor !== void 0 ? trackColor : defaultTrackColor;
}
}
}();
var thumbCurrentColor = value ? activeThumbColor !== null && activeThumbColor !== void 0 ? activeThumbColor : defaultActiveThumbColor : thumbColor !== null && thumbColor !== void 0 ? thumbColor : defaultThumbColor;
var thumbHeight = height;
var thumbWidth = thumbHeight;
var rootStyle = [styles.root, style, disabled && styles.cursorDefault, {
height,
width
}];
var disabledTrackColor = function () {
if (value === true) {
if (typeof activeTrackColor === 'string' && activeTrackColor != null || typeof trackColor === 'object' && trackColor != null && trackColor.true) {
return trackCurrentColor;
} else {
return defaultDisabledTrackColor;
}
} else {
if (typeof trackColor === 'string' && trackColor != null || typeof trackColor === 'object' && trackColor != null && trackColor.false) {
return trackCurrentColor;
} else {
return defaultDisabledTrackColor;
}
}
}();
var disabledThumbColor = function () {
if (value === true) {
if (activeThumbColor == null) {
return defaultDisabledThumbColor;
} else {
return thumbCurrentColor;
}
} else {
if (thumbColor == null) {
return defaultDisabledThumbColor;
} else {
return thumbCurrentColor;
}
}
}();
var trackStyle = [styles.track, {
backgroundColor: disabled ? disabledTrackColor : trackCurrentColor,
borderRadius: trackBorderRadius
}];
var thumbStyle = [styles.thumb, value && styles.thumbActive, {
backgroundColor: disabled ? disabledThumbColor : thumbCurrentColor,
height: thumbHeight,
marginStart: value ? (0, _multiplyStyleLengthValue.default)(thumbWidth, -1) : 0,
width: thumbWidth
}];
var nativeControl = (0, _createElement.default)('input', {
'aria-label': ariaLabel || accessibilityLabel,
checked: value,
disabled: disabled,
onBlur: handleFocusState,
onChange: handleChange,
onFocus: handleFocusState,
ref: forwardedRef,
style: [styles.nativeControl, styles.cursorInherit],
type: 'checkbox',
role: 'switch'
});
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, other, {
style: rootStyle
}), /*#__PURE__*/React.createElement(_View.default, {
style: trackStyle
}), /*#__PURE__*/React.createElement(_View.default, {
ref: thumbRef,
style: thumbStyle
}), nativeControl);
});
Switch.displayName = 'Switch';
var styles = _StyleSheet.default.create({
root: {
cursor: 'pointer',
userSelect: 'none'
},
cursorDefault: {
cursor: 'default'
},
cursorInherit: {
cursor: 'inherit'
},
track: (0, _objectSpread2.default)((0, _objectSpread2.default)({
forcedColorAdjust: 'none'
}, _StyleSheet.default.absoluteFillObject), {}, {
height: '70%',
margin: 'auto',
transitionDuration: '0.1s',
width: '100%'
}),
thumb: {
forcedColorAdjust: 'none',
alignSelf: 'flex-start',
borderRadius: '100%',
boxShadow: thumbDefaultBoxShadow,
start: '0%',
transform: 'translateZ(0)',
transitionDuration: '0.1s'
},
thumbActive: {
insetInlineStart: '100%'
},
nativeControl: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _StyleSheet.default.absoluteFillObject), {}, {
height: '100%',
margin: 0,
appearance: 'none',
padding: 0,
width: '100%'
})
});
var _default = Switch;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Text/TextAncestorContext.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
var _react = require("react");
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var TextAncestorContext = /*#__PURE__*/(0, _react.createContext)(false);
var _default = TextAncestorContext;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Text/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _createElement = _interopRequireDefault(require("../createElement"));
var forwardedProps = _interopRequireWildcard(require("../../modules/forwardedProps"));
var _pick = _interopRequireDefault(require("../../modules/pick"));
var _useElementLayout = _interopRequireDefault(require("../../modules/useElementLayout"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
var _usePlatformMethods = _interopRequireDefault(require("../../modules/usePlatformMethods"));
var _useResponderEvents = _interopRequireDefault(require("../../modules/useResponderEvents"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _TextAncestorContext = _interopRequireDefault(require("./TextAncestorContext"));
var _useLocale = require("../../modules/useLocale");
var _warnOnce = require("../../modules/warnOnce");
var _excluded = ["hrefAttrs", "numberOfLines", "onClick", "onLayout", "onPress", "onMoveShouldSetResponder", "onMoveShouldSetResponderCapture", "onResponderEnd", "onResponderGrant", "onResponderMove", "onResponderReject", "onResponderRelease", "onResponderStart", "onResponderTerminate", "onResponderTerminationRequest", "onScrollShouldSetResponder", "onScrollShouldSetResponderCapture", "onSelectionChangeShouldSetResponder", "onSelectionChangeShouldSetResponderCapture", "onStartShouldSetResponder", "onStartShouldSetResponderCapture", "selectable"];
var forwardPropsList = Object.assign({}, forwardedProps.defaultProps, forwardedProps.accessibilityProps, forwardedProps.clickProps, forwardedProps.focusProps, forwardedProps.keyboardProps, forwardedProps.mouseProps, forwardedProps.touchProps, forwardedProps.styleProps, {
href: true,
lang: true,
pointerEvents: true
});
var pickProps = props => (0, _pick.default)(props, forwardPropsList);
var Text = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var hrefAttrs = props.hrefAttrs,
numberOfLines = props.numberOfLines,
onClick = props.onClick,
onLayout = props.onLayout,
onPress = props.onPress,
onMoveShouldSetResponder = props.onMoveShouldSetResponder,
onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture,
onResponderEnd = props.onResponderEnd,
onResponderGrant = props.onResponderGrant,
onResponderMove = props.onResponderMove,
onResponderReject = props.onResponderReject,
onResponderRelease = props.onResponderRelease,
onResponderStart = props.onResponderStart,
onResponderTerminate = props.onResponderTerminate,
onResponderTerminationRequest = props.onResponderTerminationRequest,
onScrollShouldSetResponder = props.onScrollShouldSetResponder,
onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture,
onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder = props.onStartShouldSetResponder,
onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture,
selectable = props.selectable,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
if (selectable != null) {
(0, _warnOnce.warnOnce)('selectable', 'selectable prop is deprecated. Use styles.userSelect.');
}
var hasTextAncestor = React.useContext(_TextAncestorContext.default);
var hostRef = React.useRef(null);
var _useLocaleContext = (0, _useLocale.useLocaleContext)(),
contextDirection = _useLocaleContext.direction;
(0, _useElementLayout.default)(hostRef, onLayout);
(0, _useResponderEvents.default)(hostRef, {
onMoveShouldSetResponder,
onMoveShouldSetResponderCapture,
onResponderEnd,
onResponderGrant,
onResponderMove,
onResponderReject,
onResponderRelease,
onResponderStart,
onResponderTerminate,
onResponderTerminationRequest,
onScrollShouldSetResponder,
onScrollShouldSetResponderCapture,
onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder,
onStartShouldSetResponderCapture
});
var handleClick = React.useCallback(e => {
if (onClick != null) {
onClick(e);
} else if (onPress != null) {
e.stopPropagation();
onPress(e);
}
}, [onClick, onPress]);
var component = hasTextAncestor ? 'span' : 'div';
var langDirection = props.lang != null ? (0, _useLocale.getLocaleDirection)(props.lang) : null;
var componentDirection = props.dir || langDirection;
var writingDirection = componentDirection || contextDirection;
var supportedProps = pickProps(rest);
supportedProps.dir = componentDirection;
// 'auto' by default allows browsers to infer writing direction (root elements only)
if (!hasTextAncestor) {
supportedProps.dir = componentDirection != null ? componentDirection : 'auto';
}
if (onClick || onPress) {
supportedProps.onClick = handleClick;
}
supportedProps.style = [numberOfLines != null && numberOfLines > 1 && {
WebkitLineClamp: numberOfLines
}, hasTextAncestor === true ? styles.textHasAncestor$raw : styles.text$raw, numberOfLines === 1 && styles.textOneLine, numberOfLines != null && numberOfLines > 1 && styles.textMultiLine, props.style, selectable === true && styles.selectable, selectable === false && styles.notSelectable, onPress && styles.pressable];
if (props.href != null) {
component = 'a';
if (hrefAttrs != null) {
var download = hrefAttrs.download,
rel = hrefAttrs.rel,
target = hrefAttrs.target;
if (download != null) {
supportedProps.download = download;
}
if (rel != null) {
supportedProps.rel = rel;
}
if (typeof target === 'string') {
supportedProps.target = target.charAt(0) !== '_' ? '_' + target : target;
}
}
}
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
var setRef = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, forwardedRef);
supportedProps.ref = setRef;
var element = (0, _createElement.default)(component, supportedProps, {
writingDirection
});
return hasTextAncestor ? element : /*#__PURE__*/React.createElement(_TextAncestorContext.default.Provider, {
value: true
}, element);
});
Text.displayName = 'Text';
var textStyle = {
backgroundColor: 'transparent',
border: '0 solid black',
boxSizing: 'border-box',
color: 'black',
display: 'inline',
font: '14px System',
listStyle: 'none',
margin: 0,
padding: 0,
position: 'relative',
textAlign: 'start',
textDecoration: 'none',
whiteSpace: 'pre-wrap',
wordWrap: 'break-word'
};
var styles = _StyleSheet.default.create({
text$raw: textStyle,
textHasAncestor$raw: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, textStyle), {}, {
color: 'inherit',
font: 'inherit',
textAlign: 'inherit',
whiteSpace: 'inherit'
}),
textOneLine: {
maxWidth: '100%',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
wordWrap: 'normal'
},
// See #13
textMultiLine: {
display: '-webkit-box',
maxWidth: '100%',
overflow: 'hidden',
textOverflow: 'ellipsis',
WebkitBoxOrient: 'vertical'
},
notSelectable: {
userSelect: 'none'
},
selectable: {
userSelect: 'text'
},
pressable: {
cursor: 'pointer'
}
});
var _default = Text;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/TextInput/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _createElement = _interopRequireDefault(require("../createElement"));
var forwardedProps = _interopRequireWildcard(require("../../modules/forwardedProps"));
var _pick = _interopRequireDefault(require("../../modules/pick"));
var _useElementLayout = _interopRequireDefault(require("../../modules/useElementLayout"));
var _useLayoutEffect = _interopRequireDefault(require("../../modules/useLayoutEffect"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
var _usePlatformMethods = _interopRequireDefault(require("../../modules/usePlatformMethods"));
var _useResponderEvents = _interopRequireDefault(require("../../modules/useResponderEvents"));
var _useLocale = require("../../modules/useLocale");
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _TextInputState = _interopRequireDefault(require("../../modules/TextInputState"));
var _warnOnce = require("../../modules/warnOnce");
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* Determines whether a 'selection' prop differs from a node's existing
* selection state.
*/
var isSelectionStale = (node, selection) => {
var selectionEnd = node.selectionEnd,
selectionStart = node.selectionStart;
var start = selection.start,
end = selection.end;
return start !== selectionStart || end !== selectionEnd;
};
/**
* Certain input types do no support 'selectSelectionRange' and will throw an
* error.
*/
var setSelection = (node, selection) => {
if (isSelectionStale(node, selection)) {
var start = selection.start,
end = selection.end;
try {
node.setSelectionRange(start, end || start);
} catch (e) {}
}
};
var forwardPropsList = Object.assign({}, forwardedProps.defaultProps, forwardedProps.accessibilityProps, forwardedProps.clickProps, forwardedProps.focusProps, forwardedProps.keyboardProps, forwardedProps.mouseProps, forwardedProps.touchProps, forwardedProps.styleProps, {
autoCapitalize: true,
autoComplete: true,
autoCorrect: true,
autoFocus: true,
defaultValue: true,
disabled: true,
lang: true,
maxLength: true,
onChange: true,
onScroll: true,
placeholder: true,
pointerEvents: true,
readOnly: true,
rows: true,
spellCheck: true,
value: true,
type: true
});
var pickProps = props => (0, _pick.default)(props, forwardPropsList);
// If an Input Method Editor is processing key input, the 'keyCode' is 229.
// https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode
function isEventComposing(nativeEvent) {
return nativeEvent.isComposing || nativeEvent.keyCode === 229;
}
var focusTimeout = null;
var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var _props$autoCapitalize = props.autoCapitalize,
autoCapitalize = _props$autoCapitalize === void 0 ? 'sentences' : _props$autoCapitalize,
autoComplete = props.autoComplete,
autoCompleteType = props.autoCompleteType,
_props$autoCorrect = props.autoCorrect,
autoCorrect = _props$autoCorrect === void 0 ? true : _props$autoCorrect,
blurOnSubmit = props.blurOnSubmit,
caretHidden = props.caretHidden,
clearTextOnFocus = props.clearTextOnFocus,
dir = props.dir,
editable = props.editable,
enterKeyHint = props.enterKeyHint,
inputMode = props.inputMode,
keyboardType = props.keyboardType,
_props$multiline = props.multiline,
multiline = _props$multiline === void 0 ? false : _props$multiline,
numberOfLines = props.numberOfLines,
onBlur = props.onBlur,
onChange = props.onChange,
onChangeText = props.onChangeText,
onContentSizeChange = props.onContentSizeChange,
onFocus = props.onFocus,
onKeyPress = props.onKeyPress,
onLayout = props.onLayout,
onMoveShouldSetResponder = props.onMoveShouldSetResponder,
onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture,
onResponderEnd = props.onResponderEnd,
onResponderGrant = props.onResponderGrant,
onResponderMove = props.onResponderMove,
onResponderReject = props.onResponderReject,
onResponderRelease = props.onResponderRelease,
onResponderStart = props.onResponderStart,
onResponderTerminate = props.onResponderTerminate,
onResponderTerminationRequest = props.onResponderTerminationRequest,
onScrollShouldSetResponder = props.onScrollShouldSetResponder,
onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture,
onSelectionChange = props.onSelectionChange,
onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder = props.onStartShouldSetResponder,
onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture,
onSubmitEditing = props.onSubmitEditing,
placeholderTextColor = props.placeholderTextColor,
_props$readOnly = props.readOnly,
readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
returnKeyType = props.returnKeyType,
rows = props.rows,
_props$secureTextEntr = props.secureTextEntry,
secureTextEntry = _props$secureTextEntr === void 0 ? false : _props$secureTextEntr,
selection = props.selection,
selectTextOnFocus = props.selectTextOnFocus,
spellCheck = props.spellCheck;
var type;
var _inputMode;
if (inputMode != null) {
_inputMode = inputMode;
if (inputMode === 'email') {
type = 'email';
} else if (inputMode === 'tel') {
type = 'tel';
} else if (inputMode === 'search') {
type = 'search';
} else if (inputMode === 'url') {
type = 'url';
} else {
type = 'text';
}
} else if (keyboardType != null) {
(0, _warnOnce.warnOnce)('keyboardType', 'keyboardType is deprecated. Use inputMode.');
switch (keyboardType) {
case 'email-address':
type = 'email';
break;
case 'number-pad':
case 'numeric':
_inputMode = 'numeric';
break;
case 'decimal-pad':
_inputMode = 'decimal';
break;
case 'phone-pad':
type = 'tel';
break;
case 'search':
case 'web-search':
type = 'search';
break;
case 'url':
type = 'url';
break;
default:
type = 'text';
}
}
if (secureTextEntry) {
type = 'password';
}
var dimensions = React.useRef({
height: null,
width: null
});
var hostRef = React.useRef(null);
var prevSelection = React.useRef(null);
var prevSecureTextEntry = React.useRef(false);
React.useEffect(() => {
if (hostRef.current && prevSelection.current) {
setSelection(hostRef.current, prevSelection.current);
}
prevSecureTextEntry.current = secureTextEntry;
}, [secureTextEntry]);
var handleContentSizeChange = React.useCallback(hostNode => {
if (multiline && onContentSizeChange && hostNode != null) {
var newHeight = hostNode.scrollHeight;
var newWidth = hostNode.scrollWidth;
if (newHeight !== dimensions.current.height || newWidth !== dimensions.current.width) {
dimensions.current.height = newHeight;
dimensions.current.width = newWidth;
onContentSizeChange({
nativeEvent: {
contentSize: {
height: dimensions.current.height,
width: dimensions.current.width
}
}
});
}
}
}, [multiline, onContentSizeChange]);
var imperativeRef = React.useMemo(() => hostNode => {
// TextInput needs to add more methods to the hostNode in addition to those
// added by `usePlatformMethods`. This is temporarily until an API like
// `TextInput.clear(hostRef)` is added to React Native.
if (hostNode != null) {
hostNode.clear = function () {
if (hostNode != null) {
hostNode.value = '';
}
};
hostNode.isFocused = function () {
return hostNode != null && _TextInputState.default.currentlyFocusedField() === hostNode;
};
handleContentSizeChange(hostNode);
}
}, [handleContentSizeChange]);
function handleBlur(e) {
_TextInputState.default._currentlyFocusedNode = null;
if (onBlur) {
e.nativeEvent.text = e.target.value;
onBlur(e);
}
}
function handleChange(e) {
var hostNode = e.target;
var text = hostNode.value;
e.nativeEvent.text = text;
handleContentSizeChange(hostNode);
if (onChange) {
onChange(e);
}
if (onChangeText) {
onChangeText(text);
}
}
function handleFocus(e) {
var hostNode = e.target;
if (onFocus) {
e.nativeEvent.text = hostNode.value;
onFocus(e);
}
if (hostNode != null) {
_TextInputState.default._currentlyFocusedNode = hostNode;
if (clearTextOnFocus) {
hostNode.value = '';
}
if (selectTextOnFocus) {
// Safari requires selection to occur in a setTimeout
if (focusTimeout != null) {
clearTimeout(focusTimeout);
}
focusTimeout = setTimeout(() => {
if (hostNode != null) {
hostNode.select();
}
}, 0);
}
}
}
function handleKeyDown(e) {
var hostNode = e.target;
// Prevent key events bubbling (see #612)
e.stopPropagation();
var blurOnSubmitDefault = !multiline;
var shouldBlurOnSubmit = blurOnSubmit == null ? blurOnSubmitDefault : blurOnSubmit;
var nativeEvent = e.nativeEvent;
var isComposing = isEventComposing(nativeEvent);
if (onKeyPress) {
onKeyPress(e);
}
if (e.key === 'Enter' && !e.shiftKey &&
// Do not call submit if composition is occuring.
!isComposing && !e.isDefaultPrevented()) {
if ((blurOnSubmit || !multiline) && onSubmitEditing) {
// prevent "Enter" from inserting a newline or submitting a form
e.preventDefault();
nativeEvent.text = e.target.value;
onSubmitEditing(e);
}
if (shouldBlurOnSubmit && hostNode != null) {
setTimeout(() => hostNode.blur(), 0);
}
}
}
function handleSelectionChange(e) {
try {
var _e$target = e.target,
selectionStart = _e$target.selectionStart,
selectionEnd = _e$target.selectionEnd;
var _selection = {
start: selectionStart,
end: selectionEnd
};
if (onSelectionChange) {
e.nativeEvent.selection = _selection;
e.nativeEvent.text = e.target.value;
onSelectionChange(e);
}
if (prevSecureTextEntry.current === secureTextEntry) {
prevSelection.current = _selection;
}
} catch (e) {}
}
(0, _useLayoutEffect.default)(() => {
var node = hostRef.current;
if (node != null && selection != null) {
setSelection(node, selection);
}
if (document.activeElement === node) {
_TextInputState.default._currentlyFocusedNode = node;
}
}, [hostRef, selection]);
var component = multiline ? 'textarea' : 'input';
(0, _useElementLayout.default)(hostRef, onLayout);
(0, _useResponderEvents.default)(hostRef, {
onMoveShouldSetResponder,
onMoveShouldSetResponderCapture,
onResponderEnd,
onResponderGrant,
onResponderMove,
onResponderReject,
onResponderRelease,
onResponderStart,
onResponderTerminate,
onResponderTerminationRequest,
onScrollShouldSetResponder,
onScrollShouldSetResponderCapture,
onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder,
onStartShouldSetResponderCapture
});
var _useLocaleContext = (0, _useLocale.useLocaleContext)(),
contextDirection = _useLocaleContext.direction;
var supportedProps = pickProps(props);
supportedProps.autoCapitalize = autoCapitalize;
supportedProps.autoComplete = autoComplete || autoCompleteType || 'on';
supportedProps.autoCorrect = autoCorrect ? 'on' : 'off';
// 'auto' by default allows browsers to infer writing direction
supportedProps.dir = dir !== undefined ? dir : 'auto';
if (returnKeyType != null) {
(0, _warnOnce.warnOnce)('returnKeyType', 'returnKeyType is deprecated. Use enterKeyHint.');
}
supportedProps.enterKeyHint = enterKeyHint || returnKeyType;
supportedProps.inputMode = _inputMode;
supportedProps.onBlur = handleBlur;
supportedProps.onChange = handleChange;
supportedProps.onFocus = handleFocus;
supportedProps.onKeyDown = handleKeyDown;
supportedProps.onSelect = handleSelectionChange;
if (editable != null) {
(0, _warnOnce.warnOnce)('editable', 'editable is deprecated. Use readOnly.');
}
supportedProps.readOnly = readOnly === true || editable === false;
if (numberOfLines != null) {
(0, _warnOnce.warnOnce)('numberOfLines', 'TextInput numberOfLines is deprecated. Use rows.');
}
supportedProps.rows = multiline ? rows != null ? rows : numberOfLines : 1;
supportedProps.spellCheck = spellCheck != null ? spellCheck : autoCorrect;
supportedProps.style = [{
'--placeholderTextColor': placeholderTextColor
}, styles.textinput$raw, styles.placeholder, props.style, caretHidden && styles.caretHidden];
supportedProps.type = multiline ? undefined : type;
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
var setRef = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, imperativeRef, forwardedRef);
supportedProps.ref = setRef;
var langDirection = props.lang != null ? (0, _useLocale.getLocaleDirection)(props.lang) : null;
var componentDirection = props.dir || langDirection;
var writingDirection = componentDirection || contextDirection;
var element = (0, _createElement.default)(component, supportedProps, {
writingDirection
});
return element;
});
TextInput.displayName = 'TextInput';
// $FlowFixMe
TextInput.State = _TextInputState.default;
var styles = _StyleSheet.default.create({
textinput$raw: {
MozAppearance: 'textfield',
WebkitAppearance: 'none',
backgroundColor: 'transparent',
border: '0 solid black',
borderRadius: 0,
boxSizing: 'border-box',
font: '14px System',
margin: 0,
padding: 0,
resize: 'none'
},
placeholder: {
placeholderTextColor: 'var(--placeholderTextColor)'
},
caretHidden: {
caretColor: 'transparent'
}
});
var _default = TextInput;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Touchable/BoundingDimensions.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _PooledClass = _interopRequireDefault(require("../../vendor/react-native/PooledClass"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var twoArgumentPooler = _PooledClass.default.twoArgumentPooler;
/**
* PooledClass representing the bounding rectangle of a region.
*/
function BoundingDimensions(width, height) {
this.width = width;
this.height = height;
}
BoundingDimensions.prototype.destructor = function () {
this.width = null;
this.height = null;
};
BoundingDimensions.getPooledFromElement = function (element) {
return BoundingDimensions.getPooled(element.offsetWidth, element.offsetHeight);
};
_PooledClass.default.addPoolingTo(BoundingDimensions, twoArgumentPooler);
var _default = BoundingDimensions;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Touchable/Position.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _PooledClass = _interopRequireDefault(require("../../vendor/react-native/PooledClass"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var twoArgumentPooler = _PooledClass.default.twoArgumentPooler;
function Position(left, top) {
this.left = left;
this.top = top;
}
Position.prototype.destructor = function () {
this.left = null;
this.top = null;
};
_PooledClass.default.addPoolingTo(Position, twoArgumentPooler);
var _default = Position;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Touchable/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _AccessibilityUtil = _interopRequireDefault(require("../../modules/AccessibilityUtil"));
var _BoundingDimensions = _interopRequireDefault(require("./BoundingDimensions"));
var _normalizeColors = _interopRequireDefault(require("@react-native/normalize-colors"));
var _Position = _interopRequireDefault(require("./Position"));
var _react = _interopRequireDefault(require("react"));
var _UIManager = _interopRequireDefault(require("../UIManager"));
var _View = _interopRequireDefault(require("../View"));
var _warnOnce = require("../../modules/warnOnce");
var extractSingleTouch = nativeEvent => {
var touches = nativeEvent.touches;
var changedTouches = nativeEvent.changedTouches;
var hasTouches = touches && touches.length > 0;
var hasChangedTouches = changedTouches && changedTouches.length > 0;
return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent;
};
/**
* `Touchable`: Taps done right.
*
* You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable`
* will measure time/geometry and tells you when to give feedback to the user.
*
* ====================== Touchable Tutorial ===============================
* The `Touchable` mixin helps you handle the "press" interaction. It analyzes
* the geometry of elements, and observes when another responder (scroll view
* etc) has stolen the touch lock. It notifies your component when it should
* give feedback to the user. (bouncing/highlighting/unhighlighting).
*
* - When a touch was activated (typically you highlight)
* - When a touch was deactivated (typically you unhighlight)
* - When a touch was "pressed" - a touch ended while still within the geometry
* of the element, and no other element (like scroller) has "stolen" touch
* lock ("responder") (Typically you bounce the element).
*
* A good tap interaction isn't as simple as you might think. There should be a
* slight delay before showing a highlight when starting a touch. If a
* subsequent touch move exceeds the boundary of the element, it should
* unhighlight, but if that same touch is brought back within the boundary, it
* should rehighlight again. A touch can move in and out of that boundary
* several times, each time toggling highlighting, but a "press" is only
* triggered if that touch ends while within the element's boundary and no
* scroller (or anything else) has stolen the lock on touches.
*
* To create a new type of component that handles interaction using the
* `Touchable` mixin, do the following:
*
* - Initialize the `Touchable` state.
*
* getInitialState: function() {
* return merge(this.touchableGetInitialState(), yourComponentState);
* }
*
* - Add a method to get your touchable component's node.
* getTouchableNode: function() {
* return this.touchableRef.current
* }
*
* - Choose the rendered component who's touches should start the interactive
* sequence. On that rendered node, forward all `Touchable` responder
* handlers. You can choose any rendered node you like. Choose a node whose
* hit target you'd like to instigate the interaction sequence:
*
* // In render function:
* return (
* <View
* ref={this.touchableRef}
* onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
* onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}
* onResponderGrant={this.touchableHandleResponderGrant}
* onResponderMove={this.touchableHandleResponderMove}
* onResponderRelease={this.touchableHandleResponderRelease}
* onResponderTerminate={this.touchableHandleResponderTerminate}>
* <View>
* Even though the hit detection/interactions are triggered by the
* wrapping (typically larger) node, we usually end up implementing
* custom logic that highlights this inner one.
* </View>
* </View>
* );
*
* - You may set up your own handlers for each of these events, so long as you
* also invoke the `touchable*` handlers inside of your custom handler.
*
* - Implement the handlers on your component class in order to provide
* feedback to the user. See documentation for each of these class methods
* that you should implement.
*
* touchableHandlePress: function() {
* this.performBounceAnimation(); // or whatever you want to do.
* },
* touchableHandleActivePressIn: function() {
* this.beginHighlighting(...); // Whatever you like to convey activation
* },
* touchableHandleActivePressOut: function() {
* this.endHighlighting(...); // Whatever you like to convey deactivation
* },
*
* - There are more advanced methods you can implement (see documentation below):
* touchableGetHighlightDelayMS: function() {
* return 20;
* }
* // In practice, *always* use a predeclared constant (conserve memory).
* touchableGetPressRectOffset: function() {
* return {top: 20, left: 20, right: 20, bottom: 100};
* }
*/
/**
* Touchable states.
*/
var States = {
NOT_RESPONDER: 'NOT_RESPONDER',
// Not the responder
RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN',
// Responder, inactive, in the `PressRect`
RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT',
// Responder, inactive, out of `PressRect`
RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN',
// Responder, active, in the `PressRect`
RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT',
// Responder, active, out of `PressRect`
RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN',
// Responder, active, in the `PressRect`, after long press threshold
RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT',
// Responder, active, out of `PressRect`, after long press threshold
ERROR: 'ERROR'
};
/*
* Quick lookup map for states that are considered to be "active"
*/
var baseStatesConditions = {
NOT_RESPONDER: false,
RESPONDER_INACTIVE_PRESS_IN: false,
RESPONDER_INACTIVE_PRESS_OUT: false,
RESPONDER_ACTIVE_PRESS_IN: false,
RESPONDER_ACTIVE_PRESS_OUT: false,
RESPONDER_ACTIVE_LONG_PRESS_IN: false,
RESPONDER_ACTIVE_LONG_PRESS_OUT: false,
ERROR: false
};
var IsActive = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, baseStatesConditions), {}, {
RESPONDER_ACTIVE_PRESS_OUT: true,
RESPONDER_ACTIVE_PRESS_IN: true
});
/**
* Quick lookup for states that are considered to be "pressing" and are
* therefore eligible to result in a "selection" if the press stops.
*/
var IsPressingIn = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, baseStatesConditions), {}, {
RESPONDER_INACTIVE_PRESS_IN: true,
RESPONDER_ACTIVE_PRESS_IN: true,
RESPONDER_ACTIVE_LONG_PRESS_IN: true
});
var IsLongPressingIn = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, baseStatesConditions), {}, {
RESPONDER_ACTIVE_LONG_PRESS_IN: true
});
/**
* Inputs to the state machine.
*/
var Signals = {
DELAY: 'DELAY',
RESPONDER_GRANT: 'RESPONDER_GRANT',
RESPONDER_RELEASE: 'RESPONDER_RELEASE',
RESPONDER_TERMINATED: 'RESPONDER_TERMINATED',
ENTER_PRESS_RECT: 'ENTER_PRESS_RECT',
LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT',
LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED'
};
/**
* Mapping from States x Signals => States
*/
var Transitions = {
NOT_RESPONDER: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
RESPONDER_RELEASE: States.ERROR,
RESPONDER_TERMINATED: States.ERROR,
ENTER_PRESS_RECT: States.ERROR,
LEAVE_PRESS_RECT: States.ERROR,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_INACTIVE_PRESS_IN: {
DELAY: States.RESPONDER_ACTIVE_PRESS_IN,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_INACTIVE_PRESS_OUT: {
DELAY: States.RESPONDER_ACTIVE_PRESS_OUT,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_ACTIVE_PRESS_IN: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
},
RESPONDER_ACTIVE_PRESS_OUT: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_ACTIVE_LONG_PRESS_IN: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
},
RESPONDER_ACTIVE_LONG_PRESS_OUT: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
error: {
DELAY: States.NOT_RESPONDER,
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.NOT_RESPONDER,
LEAVE_PRESS_RECT: States.NOT_RESPONDER,
LONG_PRESS_DETECTED: States.NOT_RESPONDER
}
};
// ==== Typical Constants for integrating into UI components ====
// var HIT_EXPAND_PX = 20;
// var HIT_VERT_OFFSET_PX = 10;
var HIGHLIGHT_DELAY_MS = 130;
var PRESS_EXPAND_PX = 20;
var LONG_PRESS_THRESHOLD = 500;
var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;
var LONG_PRESS_ALLOWED_MOVEMENT = 10;
// Default amount "active" region protrudes beyond box
/**
* By convention, methods prefixed with underscores are meant to be @private,
* and not @protected. Mixers shouldn't access them - not even to provide them
* as callback handlers.
*
*
* ========== Geometry =========
* `Touchable` only assumes that there exists a `HitRect` node. The `PressRect`
* is an abstract box that is extended beyond the `HitRect`.
*
* +--------------------------+
* | | - "Start" events in `HitRect` cause `HitRect`
* | +--------------------+ | to become the responder.
* | | +--------------+ | | - `HitRect` is typically expanded around
* | | | | | | the `VisualRect`, but shifted downward.
* | | | VisualRect | | | - After pressing down, after some delay,
* | | | | | | and before letting up, the Visual React
* | | +--------------+ | | will become "active". This makes it eligible
* | | HitRect | | for being highlighted (so long as the
* | +--------------------+ | press remains in the `PressRect`).
* | PressRect o |
* +----------------------|---+
* Out Region |
* +-----+ This gap between the `HitRect` and
* `PressRect` allows a touch to move far away
* from the original hit rect, and remain
* highlighted, and eligible for a "Press".
* Customize this via
* `touchableGetPressRectOffset()`.
*
*
*
* ======= State Machine =======
*
* +-------------+ <---+ RESPONDER_RELEASE
* |NOT_RESPONDER|
* +-------------+ <---+ RESPONDER_TERMINATED
* +
* | RESPONDER_GRANT (HitRect)
* v
* +---------------------------+ DELAY +-------------------------+ T + DELAY +------------------------------+
* |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN|
* +---------------------------+ +-------------------------+ +------------------------------+
* + ^ + ^ + ^
* |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ |LEAVE_ |ENTER_
* |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT
* | | | | | |
* v + v + v +
* +----------------------------+ DELAY +--------------------------+ +-------------------------------+
* |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT| |RESPONDER_ACTIVE_LONG_PRESS_OUT|
* +----------------------------+ +--------------------------+ +-------------------------------+
*
* T + DELAY => LONG_PRESS_DELAY_MS + DELAY
*
* Not drawn are the side effects of each transition. The most important side
* effect is the `touchableHandlePress` abstract method invocation that occurs
* when a responder is released while in either of the "Press" states.
*
* The other important side effects are the highlight abstract method
* invocations (internal callbacks) to be implemented by the mixer.
*
*
* @lends Touchable.prototype
*/
var TouchableMixin = {
// HACK (part 1): basic support for touchable interactions using a keyboard
componentDidMount: function componentDidMount() {
(0, _warnOnce.warnOnce)('TouchableMixin', 'TouchableMixin is deprecated. Please use Pressable.');
var touchableNode = this.getTouchableNode && this.getTouchableNode();
if (touchableNode && touchableNode.addEventListener) {
this._touchableBlurListener = e => {
if (this._isTouchableKeyboardActive) {
if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) {
this.touchableHandleResponderTerminate({
nativeEvent: e
});
}
this._isTouchableKeyboardActive = false;
}
};
touchableNode.addEventListener('blur', this._touchableBlurListener);
}
},
/**
* Clear all timeouts on unmount
*/
componentWillUnmount: function componentWillUnmount() {
var touchableNode = this.getTouchableNode && this.getTouchableNode();
if (touchableNode && touchableNode.addEventListener) {
touchableNode.removeEventListener('blur', this._touchableBlurListener);
}
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
// Clear DOM nodes
this.pressInLocation = null;
this.state.touchable.responderID = null;
},
/**
* It's prefer that mixins determine state in this way, having the class
* explicitly mix the state in the one and only `getInitialState` method.
*
* @return {object} State object to be placed inside of
* `this.state.touchable`.
*/
touchableGetInitialState: function touchableGetInitialState() {
return {
touchable: {
touchState: undefined,
responderID: null
}
};
},
// ==== Hooks to Gesture Responder system ====
/**
* Must return true if embedded in a native platform scroll view.
*/
touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() {
return !this.props.rejectResponderTermination;
},
/**
* Must return true to start the process of `Touchable`.
*/
touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() {
return !this.props.disabled;
},
/**
* Return true to cancel press on long press.
*/
touchableLongPressCancelsPress: function touchableLongPressCancelsPress() {
return true;
},
/**
* Place as callback for a DOM element's `onResponderGrant` event.
* @param {SyntheticEvent} e Synthetic event from event system.
*
*/
touchableHandleResponderGrant: function touchableHandleResponderGrant(e) {
var dispatchID = e.currentTarget;
// Since e is used in a callback invoked on another event loop
// (as in setTimeout etc), we need to call e.persist() on the
// event to make sure it doesn't get reused in the event object pool.
e.persist();
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
this.pressOutDelayTimeout = null;
this.state.touchable.touchState = States.NOT_RESPONDER;
this.state.touchable.responderID = dispatchID;
this._receiveSignal(Signals.RESPONDER_GRANT, e);
var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS;
delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;
if (delayMS !== 0) {
this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);
} else {
this._handleDelay(e);
}
var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS;
longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;
this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS);
},
/**
* Place as callback for a DOM element's `onResponderRelease` event.
*/
touchableHandleResponderRelease: function touchableHandleResponderRelease(e) {
this.pressInLocation = null;
this._receiveSignal(Signals.RESPONDER_RELEASE, e);
},
/**
* Place as callback for a DOM element's `onResponderTerminate` event.
*/
touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) {
this.pressInLocation = null;
this._receiveSignal(Signals.RESPONDER_TERMINATED, e);
},
/**
* Place as callback for a DOM element's `onResponderMove` event.
*/
touchableHandleResponderMove: function touchableHandleResponderMove(e) {
// Measurement may not have returned yet.
if (!this.state.touchable.positionOnActivate) {
return;
}
var positionOnActivate = this.state.touchable.positionOnActivate;
var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;
var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : {
left: PRESS_EXPAND_PX,
right: PRESS_EXPAND_PX,
top: PRESS_EXPAND_PX,
bottom: PRESS_EXPAND_PX
};
var pressExpandLeft = pressRectOffset.left;
var pressExpandTop = pressRectOffset.top;
var pressExpandRight = pressRectOffset.right;
var pressExpandBottom = pressRectOffset.bottom;
var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null;
if (hitSlop) {
pressExpandLeft += hitSlop.left || 0;
pressExpandTop += hitSlop.top || 0;
pressExpandRight += hitSlop.right || 0;
pressExpandBottom += hitSlop.bottom || 0;
}
var touch = extractSingleTouch(e.nativeEvent);
var pageX = touch && touch.pageX;
var pageY = touch && touch.pageY;
if (this.pressInLocation) {
var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY);
if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {
this._cancelLongPressDelayTimeout();
}
}
var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom;
if (isTouchWithinActive) {
var prevState = this.state.touchable.touchState;
this._receiveSignal(Signals.ENTER_PRESS_RECT, e);
var curState = this.state.touchable.touchState;
if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) {
// fix for t7967420
this._cancelLongPressDelayTimeout();
}
} else {
this._cancelLongPressDelayTimeout();
this._receiveSignal(Signals.LEAVE_PRESS_RECT, e);
}
},
/**
* Invoked when the item receives focus. Mixers might override this to
* visually distinguish the `VisualRect` so that the user knows that it
* currently has the focus. Most platforms only support a single element being
* focused at a time, in which case there may have been a previously focused
* element that was blurred just prior to this. This can be overridden when
* using `Touchable.Mixin.withoutDefaultFocusAndBlur`.
*/
touchableHandleFocus: function touchableHandleFocus(e) {
this.props.onFocus && this.props.onFocus(e);
},
/**
* Invoked when the item loses focus. Mixers might override this to
* visually distinguish the `VisualRect` so that the user knows that it
* no longer has focus. Most platforms only support a single element being
* focused at a time, in which case the focus may have moved to another.
* This can be overridden when using
* `Touchable.Mixin.withoutDefaultFocusAndBlur`.
*/
touchableHandleBlur: function touchableHandleBlur(e) {
this.props.onBlur && this.props.onBlur(e);
},
// ==== Abstract Application Callbacks ====
/**
* Invoked when the item should be highlighted. Mixers should implement this
* to visually distinguish the `VisualRect` so that the user knows that
* releasing a touch will result in a "selection" (analog to click).
*
* @abstract
* touchableHandleActivePressIn: function,
*/
/**
* Invoked when the item is "active" (in that it is still eligible to become
* a "select") but the touch has left the `PressRect`. Usually the mixer will
* want to unhighlight the `VisualRect`. If the user (while pressing) moves
* back into the `PressRect` `touchableHandleActivePressIn` will be invoked
* again and the mixer should probably highlight the `VisualRect` again. This
* event will not fire on an `touchEnd/mouseUp` event, only move events while
* the user is depressing the mouse/touch.
*
* @abstract
* touchableHandleActivePressOut: function
*/
/**
* Invoked when the item is "selected" - meaning the interaction ended by
* letting up while the item was either in the state
* `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`.
*
* @abstract
* touchableHandlePress: function
*/
/**
* Invoked when the item is long pressed - meaning the interaction ended by
* letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If
* `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will
* be called as it normally is. If `touchableHandleLongPress` is provided, by
* default any `touchableHandlePress` callback will not be invoked. To
* override this default behavior, override `touchableLongPressCancelsPress`
* to return false. As a result, `touchableHandlePress` will be called when
* lifting up, even if `touchableHandleLongPress` has also been called.
*
* @abstract
* touchableHandleLongPress: function
*/
/**
* Returns the number of millis to wait before triggering a highlight.
*
* @abstract
* touchableGetHighlightDelayMS: function
*/
/**
* Returns the amount to extend the `HitRect` into the `PressRect`. Positive
* numbers mean the size expands outwards.
*
* @abstract
* touchableGetPressRectOffset: function
*/
// ==== Internal Logic ====
/**
* Measures the `HitRect` node on activation. The Bounding rectangle is with
* respect to viewport - not page, so adding the `pageXOffset/pageYOffset`
* should result in points that are in the same coordinate system as an
* event's `globalX/globalY` data values.
*
* - Consider caching this for the lifetime of the component, or possibly
* being able to share this cache between any `ScrollMap` view.
*
* @sideeffects
* @private
*/
_remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() {
var tag = this.state.touchable.responderID;
if (tag == null) {
return;
}
_UIManager.default.measure(tag, this._handleQueryLayout);
},
_handleQueryLayout: function _handleQueryLayout(l, t, w, h, globalX, globalY) {
//don't do anything UIManager failed to measure node
if (!l && !t && !w && !h && !globalX && !globalY) {
return;
}
this.state.touchable.positionOnActivate && _Position.default.release(this.state.touchable.positionOnActivate);
this.state.touchable.dimensionsOnActivate &&
// $FlowFixMe
_BoundingDimensions.default.release(this.state.touchable.dimensionsOnActivate);
this.state.touchable.positionOnActivate = _Position.default.getPooled(globalX, globalY);
// $FlowFixMe
this.state.touchable.dimensionsOnActivate = _BoundingDimensions.default.getPooled(w, h);
},
_handleDelay: function _handleDelay(e) {
this.touchableDelayTimeout = null;
this._receiveSignal(Signals.DELAY, e);
},
_handleLongDelay: function _handleLongDelay(e) {
this.longPressDelayTimeout = null;
var curState = this.state.touchable.touchState;
if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {
console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');
} else {
this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);
}
},
/**
* Receives a state machine signal, performs side effects of the transition
* and stores the new state. Validates the transition as well.
*
* @param {Signals} signal State machine signal.
* @throws Error if invalid state transition or unrecognized signal.
* @sideeffects
*/
_receiveSignal: function _receiveSignal(signal, e) {
var responderID = this.state.touchable.responderID;
var curState = this.state.touchable.touchState;
var nextState = Transitions[curState] && Transitions[curState][signal];
if (!responderID && signal === Signals.RESPONDER_RELEASE) {
return;
}
if (!nextState) {
throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`');
}
if (nextState === States.ERROR) {
throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`');
}
if (curState !== nextState) {
this._performSideEffectsForTransition(curState, nextState, signal, e);
this.state.touchable.touchState = nextState;
}
},
_cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() {
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
this.longPressDelayTimeout = null;
},
_isHighlight: function _isHighlight(state) {
return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN;
},
_savePressInLocation: function _savePressInLocation(e) {
var touch = extractSingleTouch(e.nativeEvent);
var pageX = touch && touch.pageX;
var pageY = touch && touch.pageY;
var locationX = touch && touch.locationX;
var locationY = touch && touch.locationY;
this.pressInLocation = {
pageX,
pageY,
locationX,
locationY
};
},
_getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) {
var deltaX = aX - bX;
var deltaY = aY - bY;
return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
},
/**
* Will perform a transition between touchable states, and identify any
* highlighting or unhighlighting that must be performed for this particular
* transition.
*
* @param {States} curState Current Touchable state.
* @param {States} nextState Next Touchable state.
* @param {Signal} signal Signal that triggered the transition.
* @param {Event} e Native event.
* @sideeffects
*/
_performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) {
var curIsHighlight = this._isHighlight(curState);
var newIsHighlight = this._isHighlight(nextState);
var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE;
if (isFinalSignal) {
this._cancelLongPressDelayTimeout();
}
var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN;
var isActiveTransition = !IsActive[curState] && IsActive[nextState];
if (isInitialTransition || isActiveTransition) {
this._remeasureMetricsOnActivation();
}
if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) {
this.touchableHandleLongPress && this.touchableHandleLongPress(e);
}
if (newIsHighlight && !curIsHighlight) {
this._startHighlight(e);
} else if (!newIsHighlight && curIsHighlight) {
this._endHighlight(e);
}
if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {
var hasLongPressHandler = !!this.props.onLongPress;
var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && (
// We *are* long pressing.. // But either has no long handler
!hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it.
var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress;
if (shouldInvokePress && this.touchableHandlePress) {
if (!newIsHighlight && !curIsHighlight) {
// we never highlighted because of delay, but we should highlight now
this._startHighlight(e);
this._endHighlight(e);
}
this.touchableHandlePress(e);
}
}
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
this.touchableDelayTimeout = null;
},
_playTouchSound: function _playTouchSound() {
_UIManager.default.playTouchSound();
},
_startHighlight: function _startHighlight(e) {
this._savePressInLocation(e);
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
},
_endHighlight: function _endHighlight(e) {
if (this.touchableHandleActivePressOut) {
if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {
this.pressOutDelayTimeout = setTimeout(() => {
this.touchableHandleActivePressOut(e);
}, this.touchableGetPressOutDelayMS());
} else {
this.touchableHandleActivePressOut(e);
}
}
},
// HACK (part 2): basic support for touchable interactions using a keyboard (including
// delays and longPress)
touchableHandleKeyEvent: function touchableHandleKeyEvent(e) {
var type = e.type,
key = e.key;
if (key === 'Enter' || key === ' ') {
if (type === 'keydown') {
if (!this._isTouchableKeyboardActive) {
if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) {
this.touchableHandleResponderGrant(e);
this._isTouchableKeyboardActive = true;
}
}
} else if (type === 'keyup') {
if (this._isTouchableKeyboardActive) {
if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) {
this.touchableHandleResponderRelease(e);
this._isTouchableKeyboardActive = false;
}
}
}
e.stopPropagation();
// prevent the default behaviour unless the Touchable functions as a link
// and Enter is pressed
if (!(key === 'Enter' && _AccessibilityUtil.default.propsToAriaRole(this.props) === 'link')) {
e.preventDefault();
}
}
},
withoutDefaultFocusAndBlur: {}
};
/**
* Provide an optional version of the mixin where `touchableHandleFocus` and
* `touchableHandleBlur` can be overridden. This allows appropriate defaults to
* be set on TV platforms, without breaking existing implementations of
* `Touchable`.
*/
var touchableHandleFocus = TouchableMixin.touchableHandleFocus,
touchableHandleBlur = TouchableMixin.touchableHandleBlur,
TouchableMixinWithoutDefaultFocusAndBlur = (0, _objectWithoutPropertiesLoose2.default)(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]);
TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur;
var Touchable = {
Mixin: TouchableMixin,
TOUCH_TARGET_DEBUG: false,
// Highlights all touchable targets. Toggle with Inspector.
/**
* Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android).
*/
renderDebugView: _ref => {
var color = _ref.color,
hitSlop = _ref.hitSlop;
if (!Touchable.TOUCH_TARGET_DEBUG) {
return null;
}
if (process.env.NODE_ENV !== 'production') {
throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!');
}
var debugHitSlopStyle = {};
hitSlop = hitSlop || {
top: 0,
bottom: 0,
left: 0,
right: 0
};
for (var key in hitSlop) {
debugHitSlopStyle[key] = -hitSlop[key];
}
var normalizedColor = (0, _normalizeColors.default)(color);
if (typeof normalizedColor !== 'number') {
return null;
}
var hexColor = '#' + ('00000000' + normalizedColor.toString(16)).substr(-8);
return /*#__PURE__*/_react.default.createElement(_View.default, {
pointerEvents: "none",
style: (0, _objectSpread2.default)({
position: 'absolute',
borderColor: hexColor.slice(0, -2) + '55',
// More opaque
borderWidth: 1,
borderStyle: 'dashed',
backgroundColor: hexColor.slice(0, -2) + '0F'
}, debugHitSlopStyle)
});
}
};
var _default = Touchable;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/TouchableHighlight/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
var _usePressEvents = _interopRequireDefault(require("../../modules/usePressEvents"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _warnOnce = require("../../modules/warnOnce");
var _excluded = ["activeOpacity", "children", "delayPressIn", "delayPressOut", "delayLongPress", "disabled", "focusable", "onHideUnderlay", "onLongPress", "onPress", "onPressIn", "onPressOut", "onShowUnderlay", "rejectResponderTermination", "style", "testOnly_pressed", "underlayColor"];
function createExtraStyles(activeOpacity, underlayColor) {
return {
child: {
opacity: activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.85
},
underlay: {
backgroundColor: underlayColor === undefined ? 'black' : underlayColor
}
};
}
function hasPressHandler(props) {
return props.onPress != null || props.onPressIn != null || props.onPressOut != null || props.onLongPress != null;
}
/**
* A wrapper for making views respond properly to touches.
* On press down, the opacity of the wrapped view is decreased, which allows
* the underlay color to show through, darkening or tinting the view.
*
* The underlay comes from wrapping the child in a new View, which can affect
* layout, and sometimes cause unwanted visual artifacts if not used correctly,
* for example if the backgroundColor of the wrapped view isn't explicitly set
* to an opaque color.
*
* TouchableHighlight must have one child (not zero or more than one).
* If you wish to have several child components, wrap them in a View.
*/
function TouchableHighlight(props, forwardedRef) {
(0, _warnOnce.warnOnce)('TouchableHighlight', 'TouchableHighlight is deprecated. Please use Pressable.');
var activeOpacity = props.activeOpacity,
children = props.children,
delayPressIn = props.delayPressIn,
delayPressOut = props.delayPressOut,
delayLongPress = props.delayLongPress,
disabled = props.disabled,
focusable = props.focusable,
onHideUnderlay = props.onHideUnderlay,
onLongPress = props.onLongPress,
onPress = props.onPress,
onPressIn = props.onPressIn,
onPressOut = props.onPressOut,
onShowUnderlay = props.onShowUnderlay,
rejectResponderTermination = props.rejectResponderTermination,
style = props.style,
testOnly_pressed = props.testOnly_pressed,
underlayColor = props.underlayColor,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
var hostRef = (0, React.useRef)(null);
var setRef = (0, _useMergeRefs.default)(forwardedRef, hostRef);
var _useState = (0, React.useState)(testOnly_pressed === true ? createExtraStyles(activeOpacity, underlayColor) : null),
extraStyles = _useState[0],
setExtraStyles = _useState[1];
var showUnderlay = (0, React.useCallback)(() => {
if (!hasPressHandler(props)) {
return;
}
setExtraStyles(createExtraStyles(activeOpacity, underlayColor));
if (onShowUnderlay != null) {
onShowUnderlay();
}
}, [activeOpacity, onShowUnderlay, props, underlayColor]);
var hideUnderlay = (0, React.useCallback)(() => {
if (testOnly_pressed === true) {
return;
}
if (hasPressHandler(props)) {
setExtraStyles(null);
if (onHideUnderlay != null) {
onHideUnderlay();
}
}
}, [onHideUnderlay, props, testOnly_pressed]);
var pressConfig = (0, React.useMemo)(() => ({
cancelable: !rejectResponderTermination,
disabled,
delayLongPress,
delayPressStart: delayPressIn,
delayPressEnd: delayPressOut,
onLongPress,
onPress,
onPressStart(event) {
showUnderlay();
if (onPressIn != null) {
onPressIn(event);
}
},
onPressEnd(event) {
hideUnderlay();
if (onPressOut != null) {
onPressOut(event);
}
}
}), [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination, showUnderlay, hideUnderlay]);
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
var child = React.Children.only(children);
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, rest, pressEventHandlers, {
accessibilityDisabled: disabled,
focusable: !disabled && focusable !== false,
pointerEvents: disabled ? 'box-none' : undefined,
ref: setRef,
style: [styles.root, style, !disabled && styles.actionable, extraStyles && extraStyles.underlay]
}), /*#__PURE__*/React.cloneElement(child, {
style: [child.props.style, extraStyles && extraStyles.child]
}));
}
var styles = _StyleSheet.default.create({
root: {
userSelect: 'none'
},
actionable: {
cursor: 'pointer',
touchAction: 'manipulation'
}
});
var MemoedTouchableHighlight = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(TouchableHighlight));
MemoedTouchableHighlight.displayName = 'TouchableHighlight';
var _default = MemoedTouchableHighlight;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/TouchableNativeFeedback/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _UnimplementedView = _interopRequireDefault(require("../../modules/UnimplementedView"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _UnimplementedView.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/TouchableOpacity/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
var _usePressEvents = _interopRequireDefault(require("../../modules/usePressEvents"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _View = _interopRequireDefault(require("../View"));
var _warnOnce = require("../../modules/warnOnce");
var _excluded = ["activeOpacity", "delayPressIn", "delayPressOut", "delayLongPress", "disabled", "focusable", "onLongPress", "onPress", "onPressIn", "onPressOut", "rejectResponderTermination", "style"];
/**
* A wrapper for making views respond properly to touches.
* On press down, the opacity of the wrapped view is decreased, dimming it.
*/
function TouchableOpacity(props, forwardedRef) {
(0, _warnOnce.warnOnce)('TouchableOpacity', 'TouchableOpacity is deprecated. Please use Pressable.');
var activeOpacity = props.activeOpacity,
delayPressIn = props.delayPressIn,
delayPressOut = props.delayPressOut,
delayLongPress = props.delayLongPress,
disabled = props.disabled,
focusable = props.focusable,
onLongPress = props.onLongPress,
onPress = props.onPress,
onPressIn = props.onPressIn,
onPressOut = props.onPressOut,
rejectResponderTermination = props.rejectResponderTermination,
style = props.style,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
var hostRef = (0, React.useRef)(null);
var setRef = (0, _useMergeRefs.default)(forwardedRef, hostRef);
var _useState = (0, React.useState)('0s'),
duration = _useState[0],
setDuration = _useState[1];
var _useState2 = (0, React.useState)(null),
opacityOverride = _useState2[0],
setOpacityOverride = _useState2[1];
var setOpacityTo = (0, React.useCallback)((value, duration) => {
setOpacityOverride(value);
setDuration(duration ? duration / 1000 + "s" : '0s');
}, [setOpacityOverride, setDuration]);
var setOpacityActive = (0, React.useCallback)(duration => {
setOpacityTo(activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.2, duration);
}, [activeOpacity, setOpacityTo]);
var setOpacityInactive = (0, React.useCallback)(duration => {
setOpacityTo(null, duration);
}, [setOpacityTo]);
var pressConfig = (0, React.useMemo)(() => ({
cancelable: !rejectResponderTermination,
disabled,
delayLongPress,
delayPressStart: delayPressIn,
delayPressEnd: delayPressOut,
onLongPress,
onPress,
onPressStart(event) {
var isGrant = event.dispatchConfig != null ? event.dispatchConfig.registrationName === 'onResponderGrant' : event.type === 'keydown';
setOpacityActive(isGrant ? 0 : 150);
if (onPressIn != null) {
onPressIn(event);
}
},
onPressEnd(event) {
setOpacityInactive(250);
if (onPressOut != null) {
onPressOut(event);
}
}
}), [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination, setOpacityActive, setOpacityInactive]);
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
return /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({}, rest, pressEventHandlers, {
accessibilityDisabled: disabled,
focusable: !disabled && focusable !== false,
pointerEvents: disabled ? 'box-none' : undefined,
ref: setRef,
style: [styles.root, !disabled && styles.actionable, style, opacityOverride != null && {
opacity: opacityOverride
}, {
transitionDuration: duration
}]
}));
}
var styles = _StyleSheet.default.create({
root: {
transitionProperty: 'opacity',
transitionDuration: '0.15s',
userSelect: 'none'
},
actionable: {
cursor: 'pointer',
touchAction: 'manipulation'
}
});
var MemoedTouchableOpacity = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(TouchableOpacity));
MemoedTouchableOpacity.displayName = 'TouchableOpacity';
var _default = MemoedTouchableOpacity;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/TouchableWithoutFeedback/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _pick = _interopRequireDefault(require("../../modules/pick"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
var _usePressEvents = _interopRequireDefault(require("../../modules/usePressEvents"));
var _warnOnce = require("../../modules/warnOnce");
var forwardPropsList = {
accessibilityDisabled: true,
accessibilityLabel: true,
accessibilityLiveRegion: true,
accessibilityRole: true,
accessibilityState: true,
accessibilityValue: true,
children: true,
disabled: true,
focusable: true,
nativeID: true,
onBlur: true,
onFocus: true,
onLayout: true,
testID: true
};
var pickProps = props => (0, _pick.default)(props, forwardPropsList);
function TouchableWithoutFeedback(props, forwardedRef) {
(0, _warnOnce.warnOnce)('TouchableWithoutFeedback', 'TouchableWithoutFeedback is deprecated. Please use Pressable.');
var delayPressIn = props.delayPressIn,
delayPressOut = props.delayPressOut,
delayLongPress = props.delayLongPress,
disabled = props.disabled,
focusable = props.focusable,
onLongPress = props.onLongPress,
onPress = props.onPress,
onPressIn = props.onPressIn,
onPressOut = props.onPressOut,
rejectResponderTermination = props.rejectResponderTermination;
var hostRef = (0, React.useRef)(null);
var pressConfig = (0, React.useMemo)(() => ({
cancelable: !rejectResponderTermination,
disabled,
delayLongPress,
delayPressStart: delayPressIn,
delayPressEnd: delayPressOut,
onLongPress,
onPress,
onPressStart: onPressIn,
onPressEnd: onPressOut
}), [disabled, delayPressIn, delayPressOut, delayLongPress, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination]);
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
var element = React.Children.only(props.children);
var children = [element.props.children];
var supportedProps = pickProps(props);
supportedProps.accessibilityDisabled = disabled;
supportedProps.focusable = !disabled && focusable !== false;
supportedProps.ref = (0, _useMergeRefs.default)(forwardedRef, hostRef, element.ref);
var elementProps = Object.assign(supportedProps, pressEventHandlers);
return /*#__PURE__*/React.cloneElement(element, elementProps, ...children);
}
var MemoedTouchableWithoutFeedback = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(TouchableWithoutFeedback));
MemoedTouchableWithoutFeedback.displayName = 'TouchableWithoutFeedback';
var _default = MemoedTouchableWithoutFeedback;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/UIManager/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _getBoundingClientRect = _interopRequireDefault(require("../../modules/getBoundingClientRect"));
var _setValueForStyles = _interopRequireDefault(require("../../modules/setValueForStyles"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var getRect = node => {
var height = node.offsetHeight;
var width = node.offsetWidth;
var left = node.offsetLeft;
var top = node.offsetTop;
node = node.offsetParent;
while (node && node.nodeType === 1 /* Node.ELEMENT_NODE */) {
left += node.offsetLeft + node.clientLeft - node.scrollLeft;
top += node.offsetTop + node.clientTop - node.scrollTop;
node = node.offsetParent;
}
top -= window.scrollY;
left -= window.scrollX;
return {
width,
height,
top,
left
};
};
var measureLayout = (node, relativeToNativeNode, callback) => {
var relativeNode = relativeToNativeNode || node && node.parentNode;
if (node && relativeNode) {
setTimeout(() => {
if (node.isConnected && relativeNode.isConnected) {
var relativeRect = getRect(relativeNode);
var _getRect = getRect(node),
height = _getRect.height,
left = _getRect.left,
top = _getRect.top,
width = _getRect.width;
var x = left - relativeRect.left;
var y = top - relativeRect.top;
callback(x, y, width, height, left, top);
}
}, 0);
}
};
var elementsToIgnore = {
A: true,
BODY: true,
INPUT: true,
SELECT: true,
TEXTAREA: true
};
var UIManager = {
blur(node) {
try {
node.blur();
} catch (err) {}
},
focus(node) {
try {
var name = node.nodeName;
// A tabIndex of -1 allows element to be programmatically focused but
// prevents keyboard focus. We don't want to set the tabindex value on
// elements that should not prevent keyboard focus.
if (node.getAttribute('tabIndex') == null && node.isContentEditable !== true && elementsToIgnore[name] == null) {
node.setAttribute('tabIndex', '-1');
}
node.focus();
} catch (err) {}
},
measure(node, callback) {
measureLayout(node, null, callback);
},
measureInWindow(node, callback) {
if (node) {
setTimeout(() => {
var _getBoundingClientRec = (0, _getBoundingClientRect.default)(node),
height = _getBoundingClientRec.height,
left = _getBoundingClientRec.left,
top = _getBoundingClientRec.top,
width = _getBoundingClientRec.width;
callback(left, top, width, height);
}, 0);
}
},
measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
measureLayout(node, relativeToNativeNode, onSuccess);
},
updateView(node, props) {
for (var prop in props) {
if (!Object.prototype.hasOwnProperty.call(props, prop)) {
continue;
}
var value = props[prop];
switch (prop) {
case 'style':
{
(0, _setValueForStyles.default)(node, value);
break;
}
case 'class':
case 'className':
{
node.setAttribute('class', value);
break;
}
case 'text':
case 'value':
// native platforms use `text` prop to replace text input value
node.value = value;
break;
default:
node.setAttribute(prop, value);
}
}
},
configureNextLayoutAnimation(config, onAnimationDidEnd) {
onAnimationDidEnd();
},
// mocks
setLayoutAnimationEnabledExperimental() {}
};
var _default = UIManager;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/Vibration/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var vibrate = pattern => {
if ('vibrate' in window.navigator) {
window.navigator.vibrate(pattern);
}
};
var Vibration = {
cancel() {
vibrate(0);
},
vibrate(pattern) {
if (pattern === void 0) {
pattern = 400;
}
vibrate(pattern);
}
};
var _default = Vibration;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/View/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _createElement = _interopRequireDefault(require("../createElement"));
var forwardedProps = _interopRequireWildcard(require("../../modules/forwardedProps"));
var _pick = _interopRequireDefault(require("../../modules/pick"));
var _useElementLayout = _interopRequireDefault(require("../../modules/useElementLayout"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
var _usePlatformMethods = _interopRequireDefault(require("../../modules/usePlatformMethods"));
var _useResponderEvents = _interopRequireDefault(require("../../modules/useResponderEvents"));
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
var _TextAncestorContext = _interopRequireDefault(require("../Text/TextAncestorContext"));
var _useLocale = require("../../modules/useLocale");
var _excluded = ["hrefAttrs", "onLayout", "onMoveShouldSetResponder", "onMoveShouldSetResponderCapture", "onResponderEnd", "onResponderGrant", "onResponderMove", "onResponderReject", "onResponderRelease", "onResponderStart", "onResponderTerminate", "onResponderTerminationRequest", "onScrollShouldSetResponder", "onScrollShouldSetResponderCapture", "onSelectionChangeShouldSetResponder", "onSelectionChangeShouldSetResponderCapture", "onStartShouldSetResponder", "onStartShouldSetResponderCapture"];
var forwardPropsList = Object.assign({}, forwardedProps.defaultProps, forwardedProps.accessibilityProps, forwardedProps.clickProps, forwardedProps.focusProps, forwardedProps.keyboardProps, forwardedProps.mouseProps, forwardedProps.touchProps, forwardedProps.styleProps, {
href: true,
lang: true,
onScroll: true,
onWheel: true,
pointerEvents: true
});
var pickProps = props => (0, _pick.default)(props, forwardPropsList);
var View = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var hrefAttrs = props.hrefAttrs,
onLayout = props.onLayout,
onMoveShouldSetResponder = props.onMoveShouldSetResponder,
onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture,
onResponderEnd = props.onResponderEnd,
onResponderGrant = props.onResponderGrant,
onResponderMove = props.onResponderMove,
onResponderReject = props.onResponderReject,
onResponderRelease = props.onResponderRelease,
onResponderStart = props.onResponderStart,
onResponderTerminate = props.onResponderTerminate,
onResponderTerminationRequest = props.onResponderTerminationRequest,
onScrollShouldSetResponder = props.onScrollShouldSetResponder,
onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture,
onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder = props.onStartShouldSetResponder,
onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture,
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
if (process.env.NODE_ENV !== 'production') {
React.Children.toArray(props.children).forEach(item => {
if (typeof item === 'string') {
console.error("Unexpected text node: " + item + ". A text node cannot be a child of a <View>.");
}
});
}
var hasTextAncestor = React.useContext(_TextAncestorContext.default);
var hostRef = React.useRef(null);
var _useLocaleContext = (0, _useLocale.useLocaleContext)(),
contextDirection = _useLocaleContext.direction;
(0, _useElementLayout.default)(hostRef, onLayout);
(0, _useResponderEvents.default)(hostRef, {
onMoveShouldSetResponder,
onMoveShouldSetResponderCapture,
onResponderEnd,
onResponderGrant,
onResponderMove,
onResponderReject,
onResponderRelease,
onResponderStart,
onResponderTerminate,
onResponderTerminationRequest,
onScrollShouldSetResponder,
onScrollShouldSetResponderCapture,
onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder,
onStartShouldSetResponderCapture
});
var component = 'div';
var langDirection = props.lang != null ? (0, _useLocale.getLocaleDirection)(props.lang) : null;
var componentDirection = props.dir || langDirection;
var writingDirection = componentDirection || contextDirection;
var supportedProps = pickProps(rest);
supportedProps.dir = componentDirection;
supportedProps.style = [styles.view$raw, hasTextAncestor && styles.inline, props.style];
if (props.href != null) {
component = 'a';
if (hrefAttrs != null) {
var download = hrefAttrs.download,
rel = hrefAttrs.rel,
target = hrefAttrs.target;
if (download != null) {
supportedProps.download = download;
}
if (rel != null) {
supportedProps.rel = rel;
}
if (typeof target === 'string') {
supportedProps.target = target.charAt(0) !== '_' ? '_' + target : target;
}
}
}
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
var setRef = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, forwardedRef);
supportedProps.ref = setRef;
return (0, _createElement.default)(component, supportedProps, {
writingDirection
});
});
View.displayName = 'View';
var styles = _StyleSheet.default.create({
view$raw: {
alignItems: 'stretch',
backgroundColor: 'transparent',
border: '0 solid black',
boxSizing: 'border-box',
display: 'flex',
flexBasis: 'auto',
flexDirection: 'column',
flexShrink: 0,
listStyle: 'none',
margin: 0,
minHeight: 0,
minWidth: 0,
padding: 0,
position: 'relative',
textDecoration: 'none',
zIndex: 0
},
inline: {
display: 'inline-flex'
}
});
var _default = View;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/VirtualizedList/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _VirtualizedList = _interopRequireDefault(require("../../vendor/react-native/VirtualizedList"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _VirtualizedList.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/YellowBox/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _UnimplementedView = _interopRequireDefault(require("../../modules/UnimplementedView"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function YellowBox(props) {
return /*#__PURE__*/_react.default.createElement(_UnimplementedView.default, props);
}
YellowBox.ignoreWarnings = () => {};
var _default = YellowBox;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/createElement/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AccessibilityUtil = _interopRequireDefault(require("../../modules/AccessibilityUtil"));
var _createDOMProps = _interopRequireDefault(require("../../modules/createDOMProps"));
var _react = _interopRequireDefault(require("react"));
var _useLocale = require("../../modules/useLocale");
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var createElement = (component, props, options) => {
// Use equivalent platform elements where possible.
var accessibilityComponent;
if (component && component.constructor === String) {
accessibilityComponent = _AccessibilityUtil.default.propsToAccessibilityComponent(props);
}
var Component = accessibilityComponent || component;
var domProps = (0, _createDOMProps.default)(Component, props, options);
var element = /*#__PURE__*/_react.default.createElement(Component, domProps);
// Update locale context if element's writing direction prop changes
var elementWithLocaleProvider = domProps.dir ? /*#__PURE__*/_react.default.createElement(_useLocale.LocaleProvider, {
children: element,
direction: domProps.dir,
locale: domProps.lang
}) : element;
return elementWithLocaleProvider;
};
var _default = createElement;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/findNodeHandle/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
var _reactDom = require("react-dom");
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* @deprecated imperatively finding the DOM element of a react component has been deprecated in React 18.
* You should use ref properties on the component instead.
*/
var findNodeHandle = component => {
var node;
try {
node = (0, _reactDom.findDOMNode)(component);
} catch (e) {}
return node;
};
var _default = findNodeHandle;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/processColor/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _normalizeColors = _interopRequireDefault(require("@react-native/normalize-colors"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var processColor = color => {
if (color === undefined || color === null) {
return color;
}
// convert number and hex
var int32Color = (0, _normalizeColors.default)(color);
if (int32Color === undefined || int32Color === null) {
return undefined;
}
int32Color = (int32Color << 24 | int32Color >>> 8) >>> 0;
return int32Color;
};
var _default = processColor;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/render/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = renderLegacy;
exports.hydrate = hydrate;
exports.hydrateLegacy = hydrateLegacy;
exports.render = render;
var _reactDom = require("react-dom");
var _client = require("react-dom/client");
var _unmountComponentAtNode = _interopRequireDefault(require("../unmountComponentAtNode"));
var _dom = require("../StyleSheet/dom");
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function hydrate(element, root) {
(0, _dom.createSheet)(root);
return (0, _client.hydrateRoot)(root, element);
}
function render(element, root) {
(0, _dom.createSheet)(root);
var reactRoot = (0, _client.createRoot)(root);
reactRoot.render(element);
return reactRoot;
}
function hydrateLegacy(element, root, callback) {
(0, _dom.createSheet)(root);
(0, _reactDom.hydrate)(element, root, callback);
return {
unmount: function unmount() {
return (0, _unmountComponentAtNode.default)(root);
}
};
}
function renderLegacy(element, root, callback) {
(0, _dom.createSheet)(root);
(0, _reactDom.render)(element, root, callback);
return {
unmount: function unmount() {
return (0, _unmountComponentAtNode.default)(root);
}
};
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/unmountComponentAtNode/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
var _reactDom = require("react-dom");
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _reactDom.unmountComponentAtNode;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/useColorScheme/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = useColorScheme;
var React = _interopRequireWildcard(require("react"));
var _Appearance = _interopRequireDefault(require("../Appearance"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function useColorScheme() {
var _React$useState = React.useState(_Appearance.default.getColorScheme()),
colorScheme = _React$useState[0],
setColorScheme = _React$useState[1];
React.useEffect(() => {
function listener(appearance) {
setColorScheme(appearance.colorScheme);
}
var _Appearance$addChange = _Appearance.default.addChangeListener(listener),
remove = _Appearance$addChange.remove;
return remove;
});
return colorScheme;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/useLocaleContext/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
var _useLocale = require("../../modules/useLocale");
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _default = _useLocale.useLocaleContext;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/exports/useWindowDimensions/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = useWindowDimensions;
var _Dimensions = _interopRequireDefault(require("../Dimensions"));
var _react = require("react");
function useWindowDimensions() {
var _useState = (0, _react.useState)(() => _Dimensions.default.get('window')),
dims = _useState[0],
setDims = _useState[1];
(0, _react.useEffect)(() => {
function handleChange(_ref) {
var window = _ref.window;
if (window != null) {
setDims(window);
}
}
_Dimensions.default.addEventListener('change', handleChange);
// We might have missed an update between calling `get` in render and
// `addEventListener` in this handler, so we set it here. If there was
// no change, React will filter out this update as a no-op.
setDims(_Dimensions.default.get('window'));
return () => {
_Dimensions.default.removeEventListener('change', handleChange);
};
}, []);
return dims;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.useWindowDimensions = exports.useLocaleContext = exports.useColorScheme = exports.unstable_createElement = exports.unmountComponentAtNode = exports.render = exports.processColor = exports.findNodeHandle = exports.YellowBox = exports.VirtualizedList = exports.View = exports.Vibration = exports.UIManager = exports.TouchableWithoutFeedback = exports.TouchableOpacity = exports.TouchableNativeFeedback = exports.TouchableHighlight = exports.Touchable = exports.TextInput = exports.Text = exports.Switch = exports.StyleSheet = exports.StatusBar = exports.Share = exports.SectionList = exports.ScrollView = exports.SafeAreaView = exports.RefreshControl = exports.ProgressBar = exports.Pressable = exports.Platform = exports.PixelRatio = exports.Picker = exports.PanResponder = exports.NativeModules = exports.NativeEventEmitter = exports.Modal = exports.LogBox = exports.Linking = exports.LayoutAnimation = exports.KeyboardAvoidingView = exports.Keyboard = exports.InteractionManager = exports.ImageBackground = exports.Image = exports.I18nManager = exports.FlatList = exports.Easing = exports.Dimensions = exports.DeviceEventEmitter = exports.Clipboard = exports.CheckBox = exports.Button = exports.BackHandler = exports.Appearance = exports.AppState = exports.AppRegistry = exports.Animated = exports.Alert = exports.ActivityIndicator = exports.AccessibilityInfo = void 0;
var _createElement = _interopRequireDefault(require("./exports/createElement"));
exports.unstable_createElement = _createElement.default;
var _findNodeHandle = _interopRequireDefault(require("./exports/findNodeHandle"));
exports.findNodeHandle = _findNodeHandle.default;
var _processColor = _interopRequireDefault(require("./exports/processColor"));
exports.processColor = _processColor.default;
var _render = _interopRequireDefault(require("./exports/render"));
exports.render = _render.default;
var _unmountComponentAtNode = _interopRequireDefault(require("./exports/unmountComponentAtNode"));
exports.unmountComponentAtNode = _unmountComponentAtNode.default;
var _NativeModules = _interopRequireDefault(require("./exports/NativeModules"));
exports.NativeModules = _NativeModules.default;
var _AccessibilityInfo = _interopRequireDefault(require("./exports/AccessibilityInfo"));
exports.AccessibilityInfo = _AccessibilityInfo.default;
var _Alert = _interopRequireDefault(require("./exports/Alert"));
exports.Alert = _Alert.default;
var _Animated = _interopRequireDefault(require("./exports/Animated"));
exports.Animated = _Animated.default;
var _Appearance = _interopRequireDefault(require("./exports/Appearance"));
exports.Appearance = _Appearance.default;
var _AppRegistry = _interopRequireDefault(require("./exports/AppRegistry"));
exports.AppRegistry = _AppRegistry.default;
var _AppState = _interopRequireDefault(require("./exports/AppState"));
exports.AppState = _AppState.default;
var _BackHandler = _interopRequireDefault(require("./exports/BackHandler"));
exports.BackHandler = _BackHandler.default;
var _Clipboard = _interopRequireDefault(require("./exports/Clipboard"));
exports.Clipboard = _Clipboard.default;
var _Dimensions = _interopRequireDefault(require("./exports/Dimensions"));
exports.Dimensions = _Dimensions.default;
var _Easing = _interopRequireDefault(require("./exports/Easing"));
exports.Easing = _Easing.default;
var _I18nManager = _interopRequireDefault(require("./exports/I18nManager"));
exports.I18nManager = _I18nManager.default;
var _Keyboard = _interopRequireDefault(require("./exports/Keyboard"));
exports.Keyboard = _Keyboard.default;
var _InteractionManager = _interopRequireDefault(require("./exports/InteractionManager"));
exports.InteractionManager = _InteractionManager.default;
var _LayoutAnimation = _interopRequireDefault(require("./exports/LayoutAnimation"));
exports.LayoutAnimation = _LayoutAnimation.default;
var _Linking = _interopRequireDefault(require("./exports/Linking"));
exports.Linking = _Linking.default;
var _NativeEventEmitter = _interopRequireDefault(require("./exports/NativeEventEmitter"));
exports.NativeEventEmitter = _NativeEventEmitter.default;
var _PanResponder = _interopRequireDefault(require("./exports/PanResponder"));
exports.PanResponder = _PanResponder.default;
var _PixelRatio = _interopRequireDefault(require("./exports/PixelRatio"));
exports.PixelRatio = _PixelRatio.default;
var _Platform = _interopRequireDefault(require("./exports/Platform"));
exports.Platform = _Platform.default;
var _Share = _interopRequireDefault(require("./exports/Share"));
exports.Share = _Share.default;
var _StyleSheet = _interopRequireDefault(require("./exports/StyleSheet"));
exports.StyleSheet = _StyleSheet.default;
var _UIManager = _interopRequireDefault(require("./exports/UIManager"));
exports.UIManager = _UIManager.default;
var _Vibration = _interopRequireDefault(require("./exports/Vibration"));
exports.Vibration = _Vibration.default;
var _ActivityIndicator = _interopRequireDefault(require("./exports/ActivityIndicator"));
exports.ActivityIndicator = _ActivityIndicator.default;
var _Button = _interopRequireDefault(require("./exports/Button"));
exports.Button = _Button.default;
var _CheckBox = _interopRequireDefault(require("./exports/CheckBox"));
exports.CheckBox = _CheckBox.default;
var _FlatList = _interopRequireDefault(require("./exports/FlatList"));
exports.FlatList = _FlatList.default;
var _Image = _interopRequireDefault(require("./exports/Image"));
exports.Image = _Image.default;
var _ImageBackground = _interopRequireDefault(require("./exports/ImageBackground"));
exports.ImageBackground = _ImageBackground.default;
var _KeyboardAvoidingView = _interopRequireDefault(require("./exports/KeyboardAvoidingView"));
exports.KeyboardAvoidingView = _KeyboardAvoidingView.default;
var _Modal = _interopRequireDefault(require("./exports/Modal"));
exports.Modal = _Modal.default;
var _Picker = _interopRequireDefault(require("./exports/Picker"));
exports.Picker = _Picker.default;
var _Pressable = _interopRequireDefault(require("./exports/Pressable"));
exports.Pressable = _Pressable.default;
var _ProgressBar = _interopRequireDefault(require("./exports/ProgressBar"));
exports.ProgressBar = _ProgressBar.default;
var _RefreshControl = _interopRequireDefault(require("./exports/RefreshControl"));
exports.RefreshControl = _RefreshControl.default;
var _SafeAreaView = _interopRequireDefault(require("./exports/SafeAreaView"));
exports.SafeAreaView = _SafeAreaView.default;
var _ScrollView = _interopRequireDefault(require("./exports/ScrollView"));
exports.ScrollView = _ScrollView.default;
var _SectionList = _interopRequireDefault(require("./exports/SectionList"));
exports.SectionList = _SectionList.default;
var _StatusBar = _interopRequireDefault(require("./exports/StatusBar"));
exports.StatusBar = _StatusBar.default;
var _Switch = _interopRequireDefault(require("./exports/Switch"));
exports.Switch = _Switch.default;
var _Text = _interopRequireDefault(require("./exports/Text"));
exports.Text = _Text.default;
var _TextInput = _interopRequireDefault(require("./exports/TextInput"));
exports.TextInput = _TextInput.default;
var _Touchable = _interopRequireDefault(require("./exports/Touchable"));
exports.Touchable = _Touchable.default;
var _TouchableHighlight = _interopRequireDefault(require("./exports/TouchableHighlight"));
exports.TouchableHighlight = _TouchableHighlight.default;
var _TouchableNativeFeedback = _interopRequireDefault(require("./exports/TouchableNativeFeedback"));
exports.TouchableNativeFeedback = _TouchableNativeFeedback.default;
var _TouchableOpacity = _interopRequireDefault(require("./exports/TouchableOpacity"));
exports.TouchableOpacity = _TouchableOpacity.default;
var _TouchableWithoutFeedback = _interopRequireDefault(require("./exports/TouchableWithoutFeedback"));
exports.TouchableWithoutFeedback = _TouchableWithoutFeedback.default;
var _View = _interopRequireDefault(require("./exports/View"));
exports.View = _View.default;
var _VirtualizedList = _interopRequireDefault(require("./exports/VirtualizedList"));
exports.VirtualizedList = _VirtualizedList.default;
var _YellowBox = _interopRequireDefault(require("./exports/YellowBox"));
exports.YellowBox = _YellowBox.default;
var _LogBox = _interopRequireDefault(require("./exports/LogBox"));
exports.LogBox = _LogBox.default;
var _DeviceEventEmitter = _interopRequireDefault(require("./exports/DeviceEventEmitter"));
exports.DeviceEventEmitter = _DeviceEventEmitter.default;
var _useColorScheme = _interopRequireDefault(require("./exports/useColorScheme"));
exports.useColorScheme = _useColorScheme.default;
var _useLocaleContext = _interopRequireDefault(require("./exports/useLocaleContext"));
exports.useLocaleContext = _useLocaleContext.default;
var _useWindowDimensions = _interopRequireDefault(require("./exports/useWindowDimensions"));
exports.useWindowDimensions = _useWindowDimensions.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _isDisabled = _interopRequireDefault(require("./isDisabled"));
var _propsToAccessibilityComponent = _interopRequireDefault(require("./propsToAccessibilityComponent"));
var _propsToAriaRole = _interopRequireDefault(require("./propsToAriaRole"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var AccessibilityUtil = {
isDisabled: _isDisabled.default,
propsToAccessibilityComponent: _propsToAccessibilityComponent.default,
propsToAriaRole: _propsToAriaRole.default
};
var _default = AccessibilityUtil;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/isDisabled.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var isDisabled = props => props.disabled || Array.isArray(props.accessibilityStates) && props.accessibilityStates.indexOf('disabled') > -1;
var _default = isDisabled;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _propsToAriaRole = _interopRequireDefault(require("./propsToAriaRole"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var roleComponents = {
article: 'article',
banner: 'header',
blockquote: 'blockquote',
button: 'button',
code: 'code',
complementary: 'aside',
contentinfo: 'footer',
deletion: 'del',
emphasis: 'em',
figure: 'figure',
insertion: 'ins',
form: 'form',
list: 'ul',
listitem: 'li',
main: 'main',
navigation: 'nav',
paragraph: 'p',
region: 'section',
strong: 'strong'
};
var emptyObject = {};
var propsToAccessibilityComponent = function propsToAccessibilityComponent(props) {
if (props === void 0) {
props = emptyObject;
}
// special-case for "label" role which doesn't map to an ARIA role
if (props.accessibilityRole === 'label') {
return 'label';
}
var role = (0, _propsToAriaRole.default)(props);
if (role) {
if (role === 'heading') {
var level = props.accessibilityLevel || props['aria-level'];
if (level != null) {
return "h" + level;
}
return 'h1';
}
return roleComponents[role];
}
};
var _default = propsToAccessibilityComponent;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var accessibilityRoleToWebRole = {
adjustable: 'slider',
button: 'button',
header: 'heading',
image: 'img',
imagebutton: null,
keyboardkey: null,
label: null,
link: 'link',
none: 'presentation',
search: 'search',
summary: 'region',
text: null
};
var propsToAriaRole = _ref => {
var accessibilityRole = _ref.accessibilityRole,
role = _ref.role;
var _role = role || accessibilityRole;
if (_role) {
var inferredRole = accessibilityRoleToWebRole[_role];
if (inferredRole !== null) {
// ignore roles that don't map to web
return inferredRole || _role;
}
}
};
var _default = propsToAriaRole;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/AssetRegistry/index.js
"use strict";
exports.__esModule = true;
exports.getAssetByID = getAssetByID;
exports.registerAsset = registerAsset;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var assets = [];
function registerAsset(asset) {
// `push` returns new array length, so the first asset will
// get id 1 (not 0) to make the value truthy
return assets.push(asset);
}
function getAssetByID(assetId) {
return assets[assetId - 1];
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/ImageLoader/index.js
"use strict";
exports.__esModule = true;
exports.default = exports.ImageUriCache = void 0;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var dataUriPattern = /^data:/;
class ImageUriCache {
static has(uri) {
var entries = ImageUriCache._entries;
var isDataUri = dataUriPattern.test(uri);
return isDataUri || Boolean(entries[uri]);
}
static add(uri) {
var entries = ImageUriCache._entries;
var lastUsedTimestamp = Date.now();
if (entries[uri]) {
entries[uri].lastUsedTimestamp = lastUsedTimestamp;
entries[uri].refCount += 1;
} else {
entries[uri] = {
lastUsedTimestamp,
refCount: 1
};
}
}
static remove(uri) {
var entries = ImageUriCache._entries;
if (entries[uri]) {
entries[uri].refCount -= 1;
}
// Free up entries when the cache is "full"
ImageUriCache._cleanUpIfNeeded();
}
static _cleanUpIfNeeded() {
var entries = ImageUriCache._entries;
var imageUris = Object.keys(entries);
if (imageUris.length + 1 > ImageUriCache._maximumEntries) {
var leastRecentlyUsedKey;
var leastRecentlyUsedEntry;
imageUris.forEach(uri => {
var entry = entries[uri];
if ((!leastRecentlyUsedEntry || entry.lastUsedTimestamp < leastRecentlyUsedEntry.lastUsedTimestamp) && entry.refCount === 0) {
leastRecentlyUsedKey = uri;
leastRecentlyUsedEntry = entry;
}
});
if (leastRecentlyUsedKey) {
delete entries[leastRecentlyUsedKey];
}
}
}
}
exports.ImageUriCache = ImageUriCache;
ImageUriCache._maximumEntries = 256;
ImageUriCache._entries = {};
var id = 0;
var requests = {};
var ImageLoader = {
abort(requestId) {
var image = requests["" + requestId];
if (image) {
image.onerror = null;
image.onload = null;
image = null;
delete requests["" + requestId];
}
},
getSize(uri, success, failure) {
var complete = false;
var interval = setInterval(callback, 16);
var requestId = ImageLoader.load(uri, callback, errorCallback);
function callback() {
var image = requests["" + requestId];
if (image) {
var naturalHeight = image.naturalHeight,
naturalWidth = image.naturalWidth;
if (naturalHeight && naturalWidth) {
success(naturalWidth, naturalHeight);
complete = true;
}
}
if (complete) {
ImageLoader.abort(requestId);
clearInterval(interval);
}
}
function errorCallback() {
if (typeof failure === 'function') {
failure();
}
ImageLoader.abort(requestId);
clearInterval(interval);
}
},
has(uri) {
return ImageUriCache.has(uri);
},
load(uri, onLoad, onError) {
id += 1;
var image = new window.Image();
image.onerror = onError;
image.onload = e => {
// avoid blocking the main thread
var onDecode = () => onLoad({
nativeEvent: e
});
if (typeof image.decode === 'function') {
// Safari currently throws exceptions when decoding svgs.
// We want to catch that error and allow the load handler
// to be forwarded to the onLoad handler in this case
image.decode().then(onDecode, onDecode);
} else {
setTimeout(onDecode, 0);
}
};
image.src = uri;
requests["" + id] = image;
return id;
},
prefetch(uri) {
return new Promise((resolve, reject) => {
ImageLoader.load(uri, () => {
// Add the uri to the cache so it can be immediately displayed when used
// but also immediately remove it to correctly reflect that it has no active references
ImageUriCache.add(uri);
ImageUriCache.remove(uri);
resolve();
}, reject);
});
},
queryCache(uris) {
var result = {};
uris.forEach(u => {
if (ImageUriCache.has(u)) {
result[u] = 'disk/memory';
}
});
return Promise.resolve(result);
}
};
var _default = ImageLoader;
exports.default = _default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/TextInputState/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _UIManager = _interopRequireDefault(require("../../exports/UIManager"));
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* This class is responsible for coordinating the "focused"
* state for TextInputs. All calls relating to the keyboard
* should be funneled through here
*/
var TextInputState = {
/**
* Internal state
*/
_currentlyFocusedNode: null,
/**
* Returns the ID of the currently focused text field, if one exists
* If no text field is focused it returns null
*/
currentlyFocusedField() {
if (document.activeElement !== this._currentlyFocusedNode) {
this._currentlyFocusedNode = null;
}
return this._currentlyFocusedNode;
},
/**
* @param {Object} TextInputID id of the text field to focus
* Focuses the specified text field
* noop if the text field was already focused
*/
focusTextInput(textFieldNode) {
if (textFieldNode !== null) {
this._currentlyFocusedNode = textFieldNode;
if (document.activeElement !== textFieldNode) {
_UIManager.default.focus(textFieldNode);
}
}
},
/**
* @param {Object} textFieldNode id of the text field to focus
* Unfocuses the specified text field
* noop if it wasn't focused
*/
blurTextInput(textFieldNode) {
if (textFieldNode !== null) {
this._currentlyFocusedNode = null;
if (document.activeElement === textFieldNode) {
_UIManager.default.blur(textFieldNode);
}
}
}
};
var _default = TextInputState;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/UnimplementedView/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _View = _interopRequireDefault(require("../../exports/View"));
var _react = _interopRequireDefault(require("react"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* Common implementation for a simple stubbed view.
*/
class UnimplementedView extends _react.default.Component {
render() {
return /*#__PURE__*/_react.default.createElement(_View.default, {
style: [unimplementedViewStyles, this.props.style]
}, this.props.children);
}
}
var unimplementedViewStyles = process.env.NODE_ENV !== 'production' ? {
alignSelf: 'flex-start',
borderColor: 'red',
borderWidth: 1
} : {};
var _default = UnimplementedView;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/addEventListener/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.addEventListener = addEventListener;
var _canUseDom = _interopRequireDefault(require("../canUseDom"));
var emptyFunction = () => {};
function supportsPassiveEvents() {
var supported = false;
// Check if browser supports event with passive listeners
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
if (_canUseDom.default) {
try {
var options = {};
Object.defineProperty(options, 'passive', {
get() {
supported = true;
return false;
}
});
window.addEventListener('test', null, options);
window.removeEventListener('test', null, options);
} catch (e) {}
}
return supported;
}
var canUsePassiveEvents = supportsPassiveEvents();
function getOptions(options) {
if (options == null) {
return false;
}
return canUsePassiveEvents ? options : Boolean(options.capture);
}
/**
* Shim generic API compatibility with ReactDOM's synthetic events, without needing the
* large amount of code ReactDOM uses to do this. Ideally we wouldn't use a synthetic
* event wrapper at all.
*/
function isPropagationStopped() {
return this.cancelBubble;
}
function isDefaultPrevented() {
return this.defaultPrevented;
}
function normalizeEvent(event) {
event.nativeEvent = event;
event.persist = emptyFunction;
event.isDefaultPrevented = isDefaultPrevented;
event.isPropagationStopped = isPropagationStopped;
return event;
}
/**
*
*/
function addEventListener(target, type, listener, options) {
var opts = getOptions(options);
var compatListener = e => listener(normalizeEvent(e));
target.addEventListener(type, compatListener, opts);
return function removeEventListener() {
if (target != null) {
target.removeEventListener(type, compatListener, opts);
}
};
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/canUseDom/index.js
"use strict"; exports.__esModule = true; exports.default = void 0; /** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); var _default = canUseDOM; exports.default = _default; module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/createDOMProps/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _AccessibilityUtil = _interopRequireDefault(require("../AccessibilityUtil"));
var _StyleSheet2 = _interopRequireDefault(require("../../exports/StyleSheet"));
var _warnOnce = require("../warnOnce");
var _excluded = ["aria-activedescendant", "accessibilityActiveDescendant", "aria-atomic", "accessibilityAtomic", "aria-autocomplete", "accessibilityAutoComplete", "aria-busy", "accessibilityBusy", "aria-checked", "accessibilityChecked", "aria-colcount", "accessibilityColumnCount", "aria-colindex", "accessibilityColumnIndex", "aria-colspan", "accessibilityColumnSpan", "aria-controls", "accessibilityControls", "aria-current", "accessibilityCurrent", "aria-describedby", "accessibilityDescribedBy", "aria-details", "accessibilityDetails", "aria-disabled", "accessibilityDisabled", "aria-errormessage", "accessibilityErrorMessage", "aria-expanded", "accessibilityExpanded", "aria-flowto", "accessibilityFlowTo", "aria-haspopup", "accessibilityHasPopup", "aria-hidden", "accessibilityHidden", "aria-invalid", "accessibilityInvalid", "aria-keyshortcuts", "accessibilityKeyShortcuts", "aria-label", "accessibilityLabel", "aria-labelledby", "accessibilityLabelledBy", "aria-level", "accessibilityLevel", "aria-live", "accessibilityLiveRegion", "aria-modal", "accessibilityModal", "aria-multiline", "accessibilityMultiline", "aria-multiselectable", "accessibilityMultiSelectable", "aria-orientation", "accessibilityOrientation", "aria-owns", "accessibilityOwns", "aria-placeholder", "accessibilityPlaceholder", "aria-posinset", "accessibilityPosInSet", "aria-pressed", "accessibilityPressed", "aria-readonly", "accessibilityReadOnly", "aria-required", "accessibilityRequired", "role", "accessibilityRole", "aria-roledescription", "accessibilityRoleDescription", "aria-rowcount", "accessibilityRowCount", "aria-rowindex", "accessibilityRowIndex", "aria-rowspan", "accessibilityRowSpan", "aria-selected", "accessibilitySelected", "aria-setsize", "accessibilitySetSize", "aria-sort", "accessibilitySort", "aria-valuemax", "accessibilityValueMax", "aria-valuemin", "accessibilityValueMin", "aria-valuenow", "accessibilityValueNow", "aria-valuetext", "accessibilityValueText", "dataSet", "focusable", "id", "nativeID", "pointerEvents", "style", "tabIndex", "testID"];
var emptyObject = {};
var hasOwnProperty = Object.prototype.hasOwnProperty;
var isArray = Array.isArray;
var uppercasePattern = /[A-Z]/g;
function toHyphenLower(match) {
return '-' + match.toLowerCase();
}
function hyphenateString(str) {
return str.replace(uppercasePattern, toHyphenLower);
}
function processIDRefList(idRefList) {
return isArray(idRefList) ? idRefList.join(' ') : idRefList;
}
var pointerEventsStyles = _StyleSheet2.default.create({
auto: {
pointerEvents: 'auto'
},
'box-none': {
pointerEvents: 'box-none'
},
'box-only': {
pointerEvents: 'box-only'
},
none: {
pointerEvents: 'none'
}
});
var createDOMProps = (elementType, props, options) => {
if (!props) {
props = emptyObject;
}
var _props = props,
ariaActiveDescendant = _props['aria-activedescendant'],
accessibilityActiveDescendant = _props.accessibilityActiveDescendant,
ariaAtomic = _props['aria-atomic'],
accessibilityAtomic = _props.accessibilityAtomic,
ariaAutoComplete = _props['aria-autocomplete'],
accessibilityAutoComplete = _props.accessibilityAutoComplete,
ariaBusy = _props['aria-busy'],
accessibilityBusy = _props.accessibilityBusy,
ariaChecked = _props['aria-checked'],
accessibilityChecked = _props.accessibilityChecked,
ariaColumnCount = _props['aria-colcount'],
accessibilityColumnCount = _props.accessibilityColumnCount,
ariaColumnIndex = _props['aria-colindex'],
accessibilityColumnIndex = _props.accessibilityColumnIndex,
ariaColumnSpan = _props['aria-colspan'],
accessibilityColumnSpan = _props.accessibilityColumnSpan,
ariaControls = _props['aria-controls'],
accessibilityControls = _props.accessibilityControls,
ariaCurrent = _props['aria-current'],
accessibilityCurrent = _props.accessibilityCurrent,
ariaDescribedBy = _props['aria-describedby'],
accessibilityDescribedBy = _props.accessibilityDescribedBy,
ariaDetails = _props['aria-details'],
accessibilityDetails = _props.accessibilityDetails,
ariaDisabled = _props['aria-disabled'],
accessibilityDisabled = _props.accessibilityDisabled,
ariaErrorMessage = _props['aria-errormessage'],
accessibilityErrorMessage = _props.accessibilityErrorMessage,
ariaExpanded = _props['aria-expanded'],
accessibilityExpanded = _props.accessibilityExpanded,
ariaFlowTo = _props['aria-flowto'],
accessibilityFlowTo = _props.accessibilityFlowTo,
ariaHasPopup = _props['aria-haspopup'],
accessibilityHasPopup = _props.accessibilityHasPopup,
ariaHidden = _props['aria-hidden'],
accessibilityHidden = _props.accessibilityHidden,
ariaInvalid = _props['aria-invalid'],
accessibilityInvalid = _props.accessibilityInvalid,
ariaKeyShortcuts = _props['aria-keyshortcuts'],
accessibilityKeyShortcuts = _props.accessibilityKeyShortcuts,
ariaLabel = _props['aria-label'],
accessibilityLabel = _props.accessibilityLabel,
ariaLabelledBy = _props['aria-labelledby'],
accessibilityLabelledBy = _props.accessibilityLabelledBy,
ariaLevel = _props['aria-level'],
accessibilityLevel = _props.accessibilityLevel,
ariaLive = _props['aria-live'],
accessibilityLiveRegion = _props.accessibilityLiveRegion,
ariaModal = _props['aria-modal'],
accessibilityModal = _props.accessibilityModal,
ariaMultiline = _props['aria-multiline'],
accessibilityMultiline = _props.accessibilityMultiline,
ariaMultiSelectable = _props['aria-multiselectable'],
accessibilityMultiSelectable = _props.accessibilityMultiSelectable,
ariaOrientation = _props['aria-orientation'],
accessibilityOrientation = _props.accessibilityOrientation,
ariaOwns = _props['aria-owns'],
accessibilityOwns = _props.accessibilityOwns,
ariaPlaceholder = _props['aria-placeholder'],
accessibilityPlaceholder = _props.accessibilityPlaceholder,
ariaPosInSet = _props['aria-posinset'],
accessibilityPosInSet = _props.accessibilityPosInSet,
ariaPressed = _props['aria-pressed'],
accessibilityPressed = _props.accessibilityPressed,
ariaReadOnly = _props['aria-readonly'],
accessibilityReadOnly = _props.accessibilityReadOnly,
ariaRequired = _props['aria-required'],
accessibilityRequired = _props.accessibilityRequired,
ariaRole = _props.role,
accessibilityRole = _props.accessibilityRole,
ariaRoleDescription = _props['aria-roledescription'],
accessibilityRoleDescription = _props.accessibilityRoleDescription,
ariaRowCount = _props['aria-rowcount'],
accessibilityRowCount = _props.accessibilityRowCount,
ariaRowIndex = _props['aria-rowindex'],
accessibilityRowIndex = _props.accessibilityRowIndex,
ariaRowSpan = _props['aria-rowspan'],
accessibilityRowSpan = _props.accessibilityRowSpan,
ariaSelected = _props['aria-selected'],
accessibilitySelected = _props.accessibilitySelected,
ariaSetSize = _props['aria-setsize'],
accessibilitySetSize = _props.accessibilitySetSize,
ariaSort = _props['aria-sort'],
accessibilitySort = _props.accessibilitySort,
ariaValueMax = _props['aria-valuemax'],
accessibilityValueMax = _props.accessibilityValueMax,
ariaValueMin = _props['aria-valuemin'],
accessibilityValueMin = _props.accessibilityValueMin,
ariaValueNow = _props['aria-valuenow'],
accessibilityValueNow = _props.accessibilityValueNow,
ariaValueText = _props['aria-valuetext'],
accessibilityValueText = _props.accessibilityValueText,
dataSet = _props.dataSet,
focusable = _props.focusable,
id = _props.id,
nativeID = _props.nativeID,
pointerEvents = _props.pointerEvents,
style = _props.style,
tabIndex = _props.tabIndex,
testID = _props.testID,
domProps = (0, _objectWithoutPropertiesLoose2.default)(_props, _excluded);
if (accessibilityDisabled != null) {
(0, _warnOnce.warnOnce)('accessibilityDisabled', "accessibilityDisabled is deprecated.");
}
var disabled = ariaDisabled || accessibilityDisabled;
var role = _AccessibilityUtil.default.propsToAriaRole(props);
// ACCESSIBILITY
if (accessibilityActiveDescendant != null) {
(0, _warnOnce.warnOnce)('accessibilityActiveDescendant', "accessibilityActiveDescendant is deprecated. Use aria-activedescendant.");
}
var _ariaActiveDescendant = ariaActiveDescendant != null ? ariaActiveDescendant : accessibilityActiveDescendant;
if (_ariaActiveDescendant != null) {
domProps['aria-activedescendant'] = _ariaActiveDescendant;
}
if (accessibilityAtomic != null) {
(0, _warnOnce.warnOnce)('accessibilityAtomic', "accessibilityAtomic is deprecated. Use aria-atomic.");
}
var _ariaAtomic = ariaAtomic != null ? ariaActiveDescendant : accessibilityAtomic;
if (_ariaAtomic != null) {
domProps['aria-atomic'] = _ariaAtomic;
}
if (accessibilityAutoComplete != null) {
(0, _warnOnce.warnOnce)('accessibilityAutoComplete', "accessibilityAutoComplete is deprecated. Use aria-autocomplete.");
}
var _ariaAutoComplete = ariaAutoComplete != null ? ariaAutoComplete : accessibilityAutoComplete;
if (_ariaAutoComplete != null) {
domProps['aria-autocomplete'] = _ariaAutoComplete;
}
if (accessibilityBusy != null) {
(0, _warnOnce.warnOnce)('accessibilityBusy', "accessibilityBusy is deprecated. Use aria-busy.");
}
var _ariaBusy = ariaBusy != null ? ariaBusy : accessibilityBusy;
if (_ariaBusy != null) {
domProps['aria-busy'] = _ariaBusy;
}
if (accessibilityChecked != null) {
(0, _warnOnce.warnOnce)('accessibilityChecked', "accessibilityChecked is deprecated. Use aria-checked.");
}
var _ariaChecked = ariaChecked != null ? ariaChecked : accessibilityChecked;
if (_ariaChecked != null) {
domProps['aria-checked'] = _ariaChecked;
}
if (accessibilityColumnCount != null) {
(0, _warnOnce.warnOnce)('accessibilityColumnCount', "accessibilityColumnCount is deprecated. Use aria-colcount.");
}
var _ariaColumnCount = ariaColumnCount != null ? ariaColumnCount : accessibilityColumnCount;
if (_ariaColumnCount != null) {
domProps['aria-colcount'] = _ariaColumnCount;
}
if (accessibilityColumnIndex != null) {
(0, _warnOnce.warnOnce)('accessibilityColumnIndex', "accessibilityColumnIndex is deprecated. Use aria-colindex.");
}
var _ariaColumnIndex = ariaColumnIndex != null ? ariaColumnIndex : accessibilityColumnIndex;
if (_ariaColumnIndex != null) {
domProps['aria-colindex'] = _ariaColumnIndex;
}
if (accessibilityColumnSpan != null) {
(0, _warnOnce.warnOnce)('accessibilityColumnSpan', "accessibilityColumnSpan is deprecated. Use aria-colspan.");
}
var _ariaColumnSpan = ariaColumnSpan != null ? ariaColumnSpan : accessibilityColumnSpan;
if (_ariaColumnSpan != null) {
domProps['aria-colspan'] = _ariaColumnSpan;
}
if (accessibilityControls != null) {
(0, _warnOnce.warnOnce)('accessibilityControls', "accessibilityControls is deprecated. Use aria-controls.");
}
var _ariaControls = ariaControls != null ? ariaControls : accessibilityControls;
if (_ariaControls != null) {
domProps['aria-controls'] = processIDRefList(_ariaControls);
}
if (accessibilityCurrent != null) {
(0, _warnOnce.warnOnce)('accessibilityCurrent', "accessibilityCurrent is deprecated. Use aria-current.");
}
var _ariaCurrent = ariaCurrent != null ? ariaCurrent : accessibilityCurrent;
if (_ariaCurrent != null) {
domProps['aria-current'] = _ariaCurrent;
}
if (accessibilityDescribedBy != null) {
(0, _warnOnce.warnOnce)('accessibilityDescribedBy', "accessibilityDescribedBy is deprecated. Use aria-describedby.");
}
var _ariaDescribedBy = ariaDescribedBy != null ? ariaDescribedBy : accessibilityDescribedBy;
if (_ariaDescribedBy != null) {
domProps['aria-describedby'] = processIDRefList(_ariaDescribedBy);
}
if (accessibilityDetails != null) {
(0, _warnOnce.warnOnce)('accessibilityDetails', "accessibilityDetails is deprecated. Use aria-details.");
}
var _ariaDetails = ariaDetails != null ? ariaDetails : accessibilityDetails;
if (_ariaDetails != null) {
domProps['aria-details'] = _ariaDetails;
}
if (disabled === true) {
domProps['aria-disabled'] = true;
// Enhance with native semantics
if (elementType === 'button' || elementType === 'form' || elementType === 'input' || elementType === 'select' || elementType === 'textarea') {
domProps.disabled = true;
}
}
if (accessibilityErrorMessage != null) {
(0, _warnOnce.warnOnce)('accessibilityErrorMessage', "accessibilityErrorMessage is deprecated. Use aria-errormessage.");
}
var _ariaErrorMessage = ariaErrorMessage != null ? ariaErrorMessage : accessibilityErrorMessage;
if (_ariaErrorMessage != null) {
domProps['aria-errormessage'] = _ariaErrorMessage;
}
if (accessibilityExpanded != null) {
(0, _warnOnce.warnOnce)('accessibilityExpanded', "accessibilityExpanded is deprecated. Use aria-expanded.");
}
var _ariaExpanded = ariaExpanded != null ? ariaExpanded : accessibilityExpanded;
if (_ariaExpanded != null) {
domProps['aria-expanded'] = _ariaExpanded;
}
if (accessibilityFlowTo != null) {
(0, _warnOnce.warnOnce)('accessibilityFlowTo', "accessibilityFlowTo is deprecated. Use aria-flowto.");
}
var _ariaFlowTo = ariaFlowTo != null ? ariaFlowTo : accessibilityFlowTo;
if (_ariaFlowTo != null) {
domProps['aria-flowto'] = processIDRefList(_ariaFlowTo);
}
if (accessibilityHasPopup != null) {
(0, _warnOnce.warnOnce)('accessibilityHasPopup', "accessibilityHasPopup is deprecated. Use aria-haspopup.");
}
var _ariaHasPopup = ariaHasPopup != null ? ariaHasPopup : accessibilityHasPopup;
if (_ariaHasPopup != null) {
domProps['aria-haspopup'] = _ariaHasPopup;
}
if (accessibilityHidden != null) {
(0, _warnOnce.warnOnce)('accessibilityHidden', "accessibilityHidden is deprecated. Use aria-hidden.");
}
var _ariaHidden = ariaHidden != null ? ariaHidden : accessibilityHidden;
if (_ariaHidden === true) {
domProps['aria-hidden'] = _ariaHidden;
}
if (accessibilityInvalid != null) {
(0, _warnOnce.warnOnce)('accessibilityInvalid', "accessibilityInvalid is deprecated. Use aria-invalid.");
}
var _ariaInvalid = ariaInvalid != null ? ariaInvalid : accessibilityInvalid;
if (_ariaInvalid != null) {
domProps['aria-invalid'] = _ariaInvalid;
}
if (accessibilityKeyShortcuts != null) {
(0, _warnOnce.warnOnce)('accessibilityKeyShortcuts', "accessibilityKeyShortcuts is deprecated. Use aria-keyshortcuts.");
}
var _ariaKeyShortcuts = ariaKeyShortcuts != null ? ariaKeyShortcuts : accessibilityKeyShortcuts;
if (_ariaKeyShortcuts != null) {
domProps['aria-keyshortcuts'] = processIDRefList(_ariaKeyShortcuts);
}
if (accessibilityLabel != null) {
(0, _warnOnce.warnOnce)('accessibilityLabel', "accessibilityLabel is deprecated. Use aria-label.");
}
var _ariaLabel = ariaLabel != null ? ariaLabel : accessibilityLabel;
if (_ariaLabel != null) {
domProps['aria-label'] = _ariaLabel;
}
if (accessibilityLabelledBy != null) {
(0, _warnOnce.warnOnce)('accessibilityLabelledBy', "accessibilityLabelledBy is deprecated. Use aria-labelledby.");
}
var _ariaLabelledBy = ariaLabelledBy != null ? ariaLabelledBy : accessibilityLabelledBy;
if (_ariaLabelledBy != null) {
domProps['aria-labelledby'] = processIDRefList(_ariaLabelledBy);
}
if (accessibilityLevel != null) {
(0, _warnOnce.warnOnce)('accessibilityLevel', "accessibilityLevel is deprecated. Use aria-level.");
}
var _ariaLevel = ariaLevel != null ? ariaLevel : accessibilityLevel;
if (_ariaLevel != null) {
domProps['aria-level'] = _ariaLevel;
}
if (accessibilityLiveRegion != null) {
(0, _warnOnce.warnOnce)('accessibilityLiveRegion', "accessibilityLiveRegion is deprecated. Use aria-live.");
}
var _ariaLive = ariaLive != null ? ariaLive : accessibilityLiveRegion;
if (_ariaLive != null) {
domProps['aria-live'] = _ariaLive === 'none' ? 'off' : _ariaLive;
}
if (accessibilityModal != null) {
(0, _warnOnce.warnOnce)('accessibilityModal', "accessibilityModal is deprecated. Use aria-modal.");
}
var _ariaModal = ariaModal != null ? ariaModal : accessibilityModal;
if (_ariaModal != null) {
domProps['aria-modal'] = _ariaModal;
}
if (accessibilityMultiline != null) {
(0, _warnOnce.warnOnce)('accessibilityMultiline', "accessibilityMultiline is deprecated. Use aria-multiline.");
}
var _ariaMultiline = ariaMultiline != null ? ariaMultiline : accessibilityMultiline;
if (_ariaMultiline != null) {
domProps['aria-multiline'] = _ariaMultiline;
}
if (accessibilityMultiSelectable != null) {
(0, _warnOnce.warnOnce)('accessibilityMultiSelectable', "accessibilityMultiSelectable is deprecated. Use aria-multiselectable.");
}
var _ariaMultiSelectable = ariaMultiSelectable != null ? ariaMultiSelectable : accessibilityMultiSelectable;
if (_ariaMultiSelectable != null) {
domProps['aria-multiselectable'] = _ariaMultiSelectable;
}
if (accessibilityOrientation != null) {
(0, _warnOnce.warnOnce)('accessibilityOrientation', "accessibilityOrientation is deprecated. Use aria-orientation.");
}
var _ariaOrientation = ariaOrientation != null ? ariaOrientation : accessibilityOrientation;
if (_ariaOrientation != null) {
domProps['aria-orientation'] = _ariaOrientation;
}
if (accessibilityOwns != null) {
(0, _warnOnce.warnOnce)('accessibilityOwns', "accessibilityOwns is deprecated. Use aria-owns.");
}
var _ariaOwns = ariaOwns != null ? ariaOwns : accessibilityOwns;
if (_ariaOwns != null) {
domProps['aria-owns'] = processIDRefList(_ariaOwns);
}
if (accessibilityPlaceholder != null) {
(0, _warnOnce.warnOnce)('accessibilityPlaceholder', "accessibilityPlaceholder is deprecated. Use aria-placeholder.");
}
var _ariaPlaceholder = ariaPlaceholder != null ? ariaPlaceholder : accessibilityPlaceholder;
if (_ariaPlaceholder != null) {
domProps['aria-placeholder'] = _ariaPlaceholder;
}
if (accessibilityPosInSet != null) {
(0, _warnOnce.warnOnce)('accessibilityPosInSet', "accessibilityPosInSet is deprecated. Use aria-posinset.");
}
var _ariaPosInSet = ariaPosInSet != null ? ariaPosInSet : accessibilityPosInSet;
if (_ariaPosInSet != null) {
domProps['aria-posinset'] = _ariaPosInSet;
}
if (accessibilityPressed != null) {
(0, _warnOnce.warnOnce)('accessibilityPressed', "accessibilityPressed is deprecated. Use aria-pressed.");
}
var _ariaPressed = ariaPressed != null ? ariaPressed : accessibilityPressed;
if (_ariaPressed != null) {
domProps['aria-pressed'] = _ariaPressed;
}
if (accessibilityReadOnly != null) {
(0, _warnOnce.warnOnce)('accessibilityReadOnly', "accessibilityReadOnly is deprecated. Use aria-readonly.");
}
var _ariaReadOnly = ariaReadOnly != null ? ariaReadOnly : accessibilityReadOnly;
if (_ariaReadOnly != null) {
domProps['aria-readonly'] = _ariaReadOnly;
// Enhance with native semantics
if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {
domProps.readOnly = true;
}
}
if (accessibilityRequired != null) {
(0, _warnOnce.warnOnce)('accessibilityRequired', "accessibilityRequired is deprecated. Use aria-required.");
}
var _ariaRequired = ariaRequired != null ? ariaRequired : accessibilityRequired;
if (_ariaRequired != null) {
domProps['aria-required'] = _ariaRequired;
// Enhance with native semantics
if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {
domProps.required = accessibilityRequired;
}
}
if (accessibilityRole != null) {
(0, _warnOnce.warnOnce)('accessibilityRole', "accessibilityRole is deprecated. Use role.");
}
if (role != null) {
// 'presentation' synonym has wider browser support
domProps['role'] = role === 'none' ? 'presentation' : role;
}
if (accessibilityRoleDescription != null) {
(0, _warnOnce.warnOnce)('accessibilityRoleDescription', "accessibilityRoleDescription is deprecated. Use aria-roledescription.");
}
var _ariaRoleDescription = ariaRoleDescription != null ? ariaRoleDescription : accessibilityRoleDescription;
if (_ariaRoleDescription != null) {
domProps['aria-roledescription'] = _ariaRoleDescription;
}
if (accessibilityRowCount != null) {
(0, _warnOnce.warnOnce)('accessibilityRowCount', "accessibilityRowCount is deprecated. Use aria-rowcount.");
}
var _ariaRowCount = ariaRowCount != null ? ariaRowCount : accessibilityRowCount;
if (_ariaRowCount != null) {
domProps['aria-rowcount'] = _ariaRowCount;
}
if (accessibilityRowIndex != null) {
(0, _warnOnce.warnOnce)('accessibilityRowIndex', "accessibilityRowIndex is deprecated. Use aria-rowindex.");
}
var _ariaRowIndex = ariaRowIndex != null ? ariaRowIndex : accessibilityRowIndex;
if (_ariaRowIndex != null) {
domProps['aria-rowindex'] = _ariaRowIndex;
}
if (accessibilityRowSpan != null) {
(0, _warnOnce.warnOnce)('accessibilityRowSpan', "accessibilityRowSpan is deprecated. Use aria-rowspan.");
}
var _ariaRowSpan = ariaRowSpan != null ? ariaRowSpan : accessibilityRowSpan;
if (_ariaRowSpan != null) {
domProps['aria-rowspan'] = _ariaRowSpan;
}
if (accessibilitySelected != null) {
(0, _warnOnce.warnOnce)('accessibilitySelected', "accessibilitySelected is deprecated. Use aria-selected.");
}
var _ariaSelected = ariaSelected != null ? ariaSelected : accessibilitySelected;
if (_ariaSelected != null) {
domProps['aria-selected'] = _ariaSelected;
}
if (accessibilitySetSize != null) {
(0, _warnOnce.warnOnce)('accessibilitySetSize', "accessibilitySetSize is deprecated. Use aria-setsize.");
}
var _ariaSetSize = ariaSetSize != null ? ariaSetSize : accessibilitySetSize;
if (_ariaSetSize != null) {
domProps['aria-setsize'] = _ariaSetSize;
}
if (accessibilitySort != null) {
(0, _warnOnce.warnOnce)('accessibilitySort', "accessibilitySort is deprecated. Use aria-sort.");
}
var _ariaSort = ariaSort != null ? ariaSort : accessibilitySort;
if (_ariaSort != null) {
domProps['aria-sort'] = _ariaSort;
}
if (accessibilityValueMax != null) {
(0, _warnOnce.warnOnce)('accessibilityValueMax', "accessibilityValueMax is deprecated. Use aria-valuemax.");
}
var _ariaValueMax = ariaValueMax != null ? ariaValueMax : accessibilityValueMax;
if (_ariaValueMax != null) {
domProps['aria-valuemax'] = _ariaValueMax;
}
if (accessibilityValueMin != null) {
(0, _warnOnce.warnOnce)('accessibilityValueMin', "accessibilityValueMin is deprecated. Use aria-valuemin.");
}
var _ariaValueMin = ariaValueMin != null ? ariaValueMin : accessibilityValueMin;
if (_ariaValueMin != null) {
domProps['aria-valuemin'] = _ariaValueMin;
}
if (accessibilityValueNow != null) {
(0, _warnOnce.warnOnce)('accessibilityValueNow', "accessibilityValueNow is deprecated. Use aria-valuenow.");
}
var _ariaValueNow = ariaValueNow != null ? ariaValueNow : accessibilityValueNow;
if (_ariaValueNow != null) {
domProps['aria-valuenow'] = _ariaValueNow;
}
if (accessibilityValueText != null) {
(0, _warnOnce.warnOnce)('accessibilityValueText', "accessibilityValueText is deprecated. Use aria-valuetext.");
}
var _ariaValueText = ariaValueText != null ? ariaValueText : accessibilityValueText;
if (_ariaValueText != null) {
domProps['aria-valuetext'] = _ariaValueText;
}
// "dataSet" replaced with "data-*"
if (dataSet != null) {
for (var dataProp in dataSet) {
if (hasOwnProperty.call(dataSet, dataProp)) {
var dataName = hyphenateString(dataProp);
var dataValue = dataSet[dataProp];
if (dataValue != null) {
domProps["data-" + dataName] = dataValue;
}
}
}
}
// FOCUS
if (tabIndex === 0 || tabIndex === '0' || tabIndex === -1 || tabIndex === '-1') {
domProps.tabIndex = tabIndex;
} else {
if (focusable != null) {
(0, _warnOnce.warnOnce)('focusable', "focusable is deprecated.");
}
// "focusable" indicates that an element may be a keyboard tab-stop.
if (focusable === false) {
domProps.tabIndex = '-1';
}
if (
// These native elements are keyboard focusable by default
elementType === 'a' || elementType === 'button' || elementType === 'input' || elementType === 'select' || elementType === 'textarea') {
if (focusable === false || accessibilityDisabled === true) {
domProps.tabIndex = '-1';
}
} else if (
// These roles are made keyboard focusable by default
role === 'button' || role === 'checkbox' || role === 'link' || role === 'radio' || role === 'textbox' || role === 'switch') {
if (focusable !== false) {
domProps.tabIndex = '0';
}
} else {
// Everything else must explicitly set the prop
if (focusable === true) {
domProps.tabIndex = '0';
}
}
}
// Resolve styles
if (pointerEvents != null) {
(0, _warnOnce.warnOnce)('pointerEvents', "props.pointerEvents is deprecated. Use style.pointerEvents");
}
var _StyleSheet = (0, _StyleSheet2.default)([style, pointerEvents && pointerEventsStyles[pointerEvents]], (0, _objectSpread2.default)({
writingDirection: 'ltr'
}, options)),
className = _StyleSheet[0],
inlineStyle = _StyleSheet[1];
if (className) {
domProps.className = className;
}
if (inlineStyle) {
domProps.style = inlineStyle;
}
// OTHER
// Native element ID
if (nativeID != null) {
(0, _warnOnce.warnOnce)('nativeID', "nativeID is deprecated. Use id.");
}
var _id = id != null ? id : nativeID;
if (_id != null) {
domProps.id = _id;
}
// Automated test IDs
if (testID != null) {
domProps['data-testid'] = testID;
}
if (domProps.type == null && elementType === 'button') {
domProps.type = 'button';
}
return domProps;
};
var _default = createDOMProps;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/dismissKeyboard/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _TextInputState = _interopRequireDefault(require("../TextInputState"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var dismissKeyboard = () => {
_TextInputState.default.blurTextInput(_TextInputState.default.currentlyFocusedField());
};
var _default = dismissKeyboard;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/forwardedProps/index.js
"use strict";
exports.__esModule = true;
exports.touchProps = exports.styleProps = exports.mouseProps = exports.keyboardProps = exports.focusProps = exports.defaultProps = exports.clickProps = exports.accessibilityProps = void 0;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var defaultProps = {
children: true,
dataSet: true,
dir: true,
id: true,
ref: true,
suppressHydrationWarning: true,
tabIndex: true,
testID: true,
// @deprecated
focusable: true,
nativeID: true
};
exports.defaultProps = defaultProps;
var accessibilityProps = {
'aria-activedescendant': true,
'aria-atomic': true,
'aria-autocomplete': true,
'aria-busy': true,
'aria-checked': true,
'aria-colcount': true,
'aria-colindex': true,
'aria-colspan': true,
'aria-controls': true,
'aria-current': true,
'aria-describedby': true,
'aria-details': true,
'aria-disabled': true,
'aria-errormessage': true,
'aria-expanded': true,
'aria-flowto': true,
'aria-haspopup': true,
'aria-hidden': true,
'aria-invalid': true,
'aria-keyshortcuts': true,
'aria-label': true,
'aria-labelledby': true,
'aria-level': true,
'aria-live': true,
'aria-modal': true,
'aria-multiline': true,
'aria-multiselectable': true,
'aria-orientation': true,
'aria-owns': true,
'aria-placeholder': true,
'aria-posinset': true,
'aria-pressed': true,
'aria-readonly': true,
'aria-required': true,
role: true,
'aria-roledescription': true,
'aria-rowcount': true,
'aria-rowindex': true,
'aria-rowspan': true,
'aria-selected': true,
'aria-setsize': true,
'aria-sort': true,
'aria-valuemax': true,
'aria-valuemin': true,
'aria-valuenow': true,
'aria-valuetext': true,
// @deprecated
accessibilityActiveDescendant: true,
accessibilityAtomic: true,
accessibilityAutoComplete: true,
accessibilityBusy: true,
accessibilityChecked: true,
accessibilityColumnCount: true,
accessibilityColumnIndex: true,
accessibilityColumnSpan: true,
accessibilityControls: true,
accessibilityCurrent: true,
accessibilityDescribedBy: true,
accessibilityDetails: true,
accessibilityDisabled: true,
accessibilityErrorMessage: true,
accessibilityExpanded: true,
accessibilityFlowTo: true,
accessibilityHasPopup: true,
accessibilityHidden: true,
accessibilityInvalid: true,
accessibilityKeyShortcuts: true,
accessibilityLabel: true,
accessibilityLabelledBy: true,
accessibilityLevel: true,
accessibilityLiveRegion: true,
accessibilityModal: true,
accessibilityMultiline: true,
accessibilityMultiSelectable: true,
accessibilityOrientation: true,
accessibilityOwns: true,
accessibilityPlaceholder: true,
accessibilityPosInSet: true,
accessibilityPressed: true,
accessibilityReadOnly: true,
accessibilityRequired: true,
accessibilityRole: true,
accessibilityRoleDescription: true,
accessibilityRowCount: true,
accessibilityRowIndex: true,
accessibilityRowSpan: true,
accessibilitySelected: true,
accessibilitySetSize: true,
accessibilitySort: true,
accessibilityValueMax: true,
accessibilityValueMin: true,
accessibilityValueNow: true,
accessibilityValueText: true
};
exports.accessibilityProps = accessibilityProps;
var clickProps = {
onClick: true,
onAuxClick: true,
onContextMenu: true,
onGotPointerCapture: true,
onLostPointerCapture: true,
onPointerCancel: true,
onPointerDown: true,
onPointerEnter: true,
onPointerMove: true,
onPointerLeave: true,
onPointerOut: true,
onPointerOver: true,
onPointerUp: true
};
exports.clickProps = clickProps;
var focusProps = {
onBlur: true,
onFocus: true
};
exports.focusProps = focusProps;
var keyboardProps = {
onKeyDown: true,
onKeyDownCapture: true,
onKeyUp: true,
onKeyUpCapture: true
};
exports.keyboardProps = keyboardProps;
var mouseProps = {
onMouseDown: true,
onMouseEnter: true,
onMouseLeave: true,
onMouseMove: true,
onMouseOver: true,
onMouseOut: true,
onMouseUp: true
};
exports.mouseProps = mouseProps;
var touchProps = {
onTouchCancel: true,
onTouchCancelCapture: true,
onTouchEnd: true,
onTouchEndCapture: true,
onTouchMove: true,
onTouchMoveCapture: true,
onTouchStart: true,
onTouchStartCapture: true
};
exports.touchProps = touchProps;
var styleProps = {
style: true
};
exports.styleProps = styleProps;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/getBoundingClientRect/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var getBoundingClientRect = node => {
if (node != null) {
var isElement = node.nodeType === 1; /* Node.ELEMENT_NODE */
if (isElement && typeof node.getBoundingClientRect === 'function') {
return node.getBoundingClientRect();
}
}
};
var _default = getBoundingClientRect;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/isSelectionValid/index.js
"use strict";
exports.__esModule = true;
exports.default = isSelectionValid;
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function isSelectionValid() {
var selection = window.getSelection();
var string = selection.toString();
var anchorNode = selection.anchorNode;
var focusNode = selection.focusNode;
var isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE;
return string.length >= 1 && string !== '\n' && isTextNode;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/isWebColor/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var isWebColor = color => color === 'currentcolor' || color === 'currentColor' || color === 'inherit' || color.indexOf('var(') === 0;
var _default = isWebColor;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/mergeRefs/index.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = mergeRefs;
var React = _interopRequireWildcard(require("react"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function mergeRefs() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return function forwardRef(node) {
args.forEach(ref => {
if (ref == null) {
return;
}
if (typeof ref === 'function') {
ref(node);
return;
}
if (typeof ref === 'object') {
ref.current = node;
return;
}
console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref " + String(ref));
});
};
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/modality/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.addModalityListener = addModalityListener;
exports.getActiveModality = getActiveModality;
exports.getModality = getModality;
exports.testOnly_resetActiveModality = testOnly_resetActiveModality;
var _addEventListener = require("../addEventListener");
var _canUseDom = _interopRequireDefault(require("../canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var supportsPointerEvent = () => !!(typeof window !== 'undefined' && window.PointerEvent != null);
var activeModality = 'keyboard';
var modality = 'keyboard';
var previousModality;
var previousActiveModality;
var isEmulatingMouseEvents = false;
var listeners = new Set();
var KEYBOARD = 'keyboard';
var MOUSE = 'mouse';
var TOUCH = 'touch';
var BLUR = 'blur';
var CONTEXTMENU = 'contextmenu';
var FOCUS = 'focus';
var KEYDOWN = 'keydown';
var MOUSEDOWN = 'mousedown';
var MOUSEMOVE = 'mousemove';
var MOUSEUP = 'mouseup';
var POINTERDOWN = 'pointerdown';
var POINTERMOVE = 'pointermove';
var SCROLL = 'scroll';
var SELECTIONCHANGE = 'selectionchange';
var TOUCHCANCEL = 'touchcancel';
var TOUCHMOVE = 'touchmove';
var TOUCHSTART = 'touchstart';
var VISIBILITYCHANGE = 'visibilitychange';
var bubbleOptions = {
passive: true
};
var captureOptions = {
capture: true,
passive: true
};
function restoreModality() {
if (previousModality != null || previousActiveModality != null) {
if (previousModality != null) {
modality = previousModality;
previousModality = null;
}
if (previousActiveModality != null) {
activeModality = previousActiveModality;
previousActiveModality = null;
}
callListeners();
}
}
function onBlurWindow() {
previousModality = modality;
previousActiveModality = activeModality;
activeModality = KEYBOARD;
modality = KEYBOARD;
callListeners();
// for fallback events
isEmulatingMouseEvents = false;
}
function onFocusWindow() {
restoreModality();
}
function onKeyDown(event) {
if (event.metaKey || event.altKey || event.ctrlKey) {
return;
}
if (modality !== KEYBOARD) {
modality = KEYBOARD;
activeModality = KEYBOARD;
callListeners();
}
}
function onVisibilityChange() {
if (document.visibilityState !== 'hidden') {
restoreModality();
}
}
function onPointerish(event) {
var eventType = event.type;
if (supportsPointerEvent()) {
if (eventType === POINTERDOWN) {
if (activeModality !== event.pointerType) {
modality = event.pointerType;
activeModality = event.pointerType;
callListeners();
}
return;
}
if (eventType === POINTERMOVE) {
if (modality !== event.pointerType) {
modality = event.pointerType;
callListeners();
}
return;
}
}
// Fallback for non-PointerEvent environment
else {
if (!isEmulatingMouseEvents) {
if (eventType === MOUSEDOWN) {
if (activeModality !== MOUSE) {
modality = MOUSE;
activeModality = MOUSE;
callListeners();
}
}
if (eventType === MOUSEMOVE) {
if (modality !== MOUSE) {
modality = MOUSE;
callListeners();
}
}
}
// Flag when browser may produce emulated events
if (eventType === TOUCHSTART) {
isEmulatingMouseEvents = true;
if (event.touches && event.touches.length > 1) {
isEmulatingMouseEvents = false;
}
if (activeModality !== TOUCH) {
modality = TOUCH;
activeModality = TOUCH;
callListeners();
}
return;
}
// Remove flag after emulated events are finished or cancelled, and if an
// event occurs that cuts short a touch event sequence.
if (eventType === CONTEXTMENU || eventType === MOUSEUP || eventType === SELECTIONCHANGE || eventType === SCROLL || eventType === TOUCHCANCEL || eventType === TOUCHMOVE) {
isEmulatingMouseEvents = false;
}
}
}
if (_canUseDom.default) {
// Window events
(0, _addEventListener.addEventListener)(window, BLUR, onBlurWindow, bubbleOptions);
(0, _addEventListener.addEventListener)(window, FOCUS, onFocusWindow, bubbleOptions);
// Must be capture phase because 'stopPropagation' might prevent these
// events bubbling to the document.
(0, _addEventListener.addEventListener)(document, KEYDOWN, onKeyDown, captureOptions);
(0, _addEventListener.addEventListener)(document, VISIBILITYCHANGE, onVisibilityChange, captureOptions);
(0, _addEventListener.addEventListener)(document, POINTERDOWN, onPointerish, captureOptions);
(0, _addEventListener.addEventListener)(document, POINTERMOVE, onPointerish, captureOptions);
// Fallback events
(0, _addEventListener.addEventListener)(document, CONTEXTMENU, onPointerish, captureOptions);
(0, _addEventListener.addEventListener)(document, MOUSEDOWN, onPointerish, captureOptions);
(0, _addEventListener.addEventListener)(document, MOUSEMOVE, onPointerish, captureOptions);
(0, _addEventListener.addEventListener)(document, MOUSEUP, onPointerish, captureOptions);
(0, _addEventListener.addEventListener)(document, TOUCHCANCEL, onPointerish, captureOptions);
(0, _addEventListener.addEventListener)(document, TOUCHMOVE, onPointerish, captureOptions);
(0, _addEventListener.addEventListener)(document, TOUCHSTART, onPointerish, captureOptions);
(0, _addEventListener.addEventListener)(document, SELECTIONCHANGE, onPointerish, captureOptions);
(0, _addEventListener.addEventListener)(document, SCROLL, onPointerish, captureOptions);
}
function callListeners() {
var value = {
activeModality,
modality
};
listeners.forEach(listener => {
listener(value);
});
}
function getActiveModality() {
return activeModality;
}
function getModality() {
return modality;
}
function addModalityListener(listener) {
listeners.add(listener);
return () => {
listeners.delete(listener);
};
}
function testOnly_resetActiveModality() {
isEmulatingMouseEvents = false;
activeModality = KEYBOARD;
modality = KEYBOARD;
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/multiplyStyleLengthValue/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var CSS_UNIT_RE = /^[+-]?\d*(?:\.\d+)?(?:[Ee][+-]?\d+)?(%|\w*)/;
var getUnit = str => str.match(CSS_UNIT_RE)[1];
var isNumeric = n => {
return !isNaN(parseFloat(n)) && isFinite(n);
};
var multiplyStyleLengthValue = (value, multiple) => {
if (typeof value === 'string') {
var number = parseFloat(value) * multiple;
var unit = getUnit(value);
return "" + number + unit;
} else if (isNumeric(value)) {
return value * multiple;
}
};
var _default = multiplyStyleLengthValue;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/pick/index.js
"use strict";
exports.__esModule = true;
exports.default = pick;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function pick(obj, list) {
var nextObj = {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (list[key] === true) {
nextObj[key] = obj[key];
}
}
}
return nextObj;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/prefixStyles/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _createPrefixer = _interopRequireDefault(require("inline-style-prefixer/lib/createPrefixer"));
var _static = _interopRequireDefault(require("./static"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var prefixAll = (0, _createPrefixer.default)(_static.default);
var _default = prefixAll;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/prefixStyles/static.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _backgroundClip = _interopRequireDefault(require("inline-style-prefixer/lib/plugins/backgroundClip"));
var _crossFade = _interopRequireDefault(require("inline-style-prefixer/lib/plugins/crossFade"));
var _cursor = _interopRequireDefault(require("inline-style-prefixer/lib/plugins/cursor"));
var _filter = _interopRequireDefault(require("inline-style-prefixer/lib/plugins/filter"));
var _imageSet = _interopRequireDefault(require("inline-style-prefixer/lib/plugins/imageSet"));
var _logical = _interopRequireDefault(require("inline-style-prefixer/lib/plugins/logical"));
var _position = _interopRequireDefault(require("inline-style-prefixer/lib/plugins/position"));
var _sizing = _interopRequireDefault(require("inline-style-prefixer/lib/plugins/sizing"));
var _transition = _interopRequireDefault(require("inline-style-prefixer/lib/plugins/transition"));
var w = ['Webkit'];
var m = ['Moz'];
var wm = ['Webkit', 'Moz'];
var wms = ['Webkit', 'ms'];
var wmms = ['Webkit', 'Moz', 'ms'];
var _default = {
plugins: [_backgroundClip.default, _crossFade.default, _cursor.default, _filter.default, _imageSet.default, _logical.default, _position.default, _sizing.default, _transition.default],
prefixMap: {
appearance: wmms,
userSelect: wm,
textEmphasisPosition: wms,
textEmphasis: wms,
textEmphasisStyle: wms,
textEmphasisColor: wms,
boxDecorationBreak: wms,
clipPath: w,
maskImage: wms,
maskMode: wms,
maskRepeat: wms,
maskPosition: wms,
maskClip: wms,
maskOrigin: wms,
maskSize: wms,
maskComposite: wms,
mask: wms,
maskBorderSource: wms,
maskBorderMode: wms,
maskBorderSlice: wms,
maskBorderWidth: wms,
maskBorderOutset: wms,
maskBorderRepeat: wms,
maskBorder: wms,
maskType: wms,
textDecorationStyle: w,
textDecorationSkip: w,
textDecorationLine: w,
textDecorationColor: w,
filter: w,
breakAfter: w,
breakBefore: w,
breakInside: w,
columnCount: w,
columnFill: w,
columnGap: w,
columnRule: w,
columnRuleColor: w,
columnRuleStyle: w,
columnRuleWidth: w,
columns: w,
columnSpan: w,
columnWidth: w,
backdropFilter: w,
hyphens: w,
flowInto: w,
flowFrom: w,
regionFragment: w,
textOrientation: w,
tabSize: m,
fontKerning: w,
textSizeAdjust: w
}
};
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/requestIdleCallback/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = exports.cancelIdleCallback = void 0;
var _canUseDom = _interopRequireDefault(require("../canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var _requestIdleCallback = function _requestIdleCallback(cb, options) {
return setTimeout(() => {
var start = Date.now();
cb({
didTimeout: false,
timeRemaining() {
return Math.max(0, 50 - (Date.now() - start));
}
});
}, 1);
};
var _cancelIdleCallback = function _cancelIdleCallback(id) {
clearTimeout(id);
};
var isSupported = _canUseDom.default && typeof window.requestIdleCallback !== 'undefined';
var requestIdleCallback = isSupported ? window.requestIdleCallback : _requestIdleCallback;
var cancelIdleCallback = isSupported ? window.cancelIdleCallback : _cancelIdleCallback;
exports.cancelIdleCallback = cancelIdleCallback;
var _default = requestIdleCallback;
exports.default = _default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/setValueForStyles/dangerousStyleValue.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _unitlessNumbers = _interopRequireDefault(require("../unitlessNumbers"));
/* eslint-disable */
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* From React 16.0.0
*
*/
/**
* Convert a value into the proper css writable value. The style name `name`
* should be logical (no hyphens), as specified
* in `CSSProperty.isUnitlessNumber`.
*
* @param {string} name CSS property name such as `topMargin`.
* @param {*} value CSS property value such as `10px`.
* @return {string} Normalized style value with dimensions applied.
*/
function dangerousStyleValue(name, value, isCustomProperty) {
// Note that we've removed escapeTextForBrowser() calls here since the
// whole string will be escaped when the attribute is injected into
// the markup. If you provide unsafe user data here they can inject
// arbitrary CSS which may be problematic (I couldn't repro this):
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
// http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
// This is not an XSS hole but instead a potential CSS injection issue
// which has lead to a greater discussion about how we're going to
// trust URLs moving forward. See #2115901
var isEmpty = value == null || typeof value === 'boolean' || value === '';
if (isEmpty) {
return '';
}
if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(_unitlessNumbers.default.hasOwnProperty(name) && _unitlessNumbers.default[name])) {
return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
}
return ('' + value).trim();
}
var _default = dangerousStyleValue;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/setValueForStyles/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _dangerousStyleValue = _interopRequireDefault(require("./dangerousStyleValue"));
/* eslint-disable */
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* From React 16.3.0
*
*/
/**
* Sets the value for multiple styles on a node. If a value is specified as
* '' (empty string), the corresponding style property will be unset.
*
* @param {DOMElement} node
* @param {object} styles
*/
function setValueForStyles(node, styles) {
var style = node.style;
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
var isCustomProperty = styleName.indexOf('--') === 0;
var styleValue = (0, _dangerousStyleValue.default)(styleName, styles[styleName], isCustomProperty);
if (styleName === 'float') {
styleName = 'cssFloat';
}
if (isCustomProperty) {
style.setProperty(styleName, styleValue);
} else {
style[styleName] = styleValue;
}
}
}
var _default = setValueForStyles;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/unitlessNumbers/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Nicolas Gallagher.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var unitlessNumbers = {
animationIterationCount: true,
aspectRatio: true,
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
flexOrder: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
fontWeight: true,
gridRow: true,
gridRowEnd: true,
gridRowGap: true,
gridRowStart: true,
gridColumn: true,
gridColumnEnd: true,
gridColumnGap: true,
gridColumnStart: true,
lineClamp: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true,
// transform types
scale: true,
scaleX: true,
scaleY: true,
scaleZ: true,
// RN properties
shadowOpacity: true
};
/**
* Support style names that may come passed in prefixed by adding permutations
* of vendor prefixes.
*/
var prefixes = ['ms', 'Moz', 'O', 'Webkit'];
var prefixKey = (prefix, key) => {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
};
Object.keys(unitlessNumbers).forEach(prop => {
prefixes.forEach(prefix => {
unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
});
});
var _default = unitlessNumbers;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useElementLayout/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = useElementLayout;
var _useLayoutEffect = _interopRequireDefault(require("../useLayoutEffect"));
var _UIManager = _interopRequireDefault(require("../../exports/UIManager"));
var _canUseDom = _interopRequireDefault(require("../canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var DOM_LAYOUT_HANDLER_NAME = '__reactLayoutHandler';
var didWarn = !_canUseDom.default;
var resizeObserver = null;
function getResizeObserver() {
if (_canUseDom.default && typeof window.ResizeObserver !== 'undefined') {
if (resizeObserver == null) {
resizeObserver = new window.ResizeObserver(function (entries) {
entries.forEach(entry => {
var node = entry.target;
var onLayout = node[DOM_LAYOUT_HANDLER_NAME];
if (typeof onLayout === 'function') {
// We still need to measure the view because browsers don't yet provide
// border-box dimensions in the entry
_UIManager.default.measure(node, (x, y, width, height, left, top) => {
var event = {
// $FlowFixMe
nativeEvent: {
layout: {
x,
y,
width,
height,
left,
top
}
},
timeStamp: Date.now()
};
Object.defineProperty(event.nativeEvent, 'target', {
enumerable: true,
get: () => entry.target
});
onLayout(event);
});
}
});
});
}
} else if (!didWarn) {
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
console.warn('onLayout relies on ResizeObserver which is not supported by your browser. ' + 'Please include a polyfill, e.g., https://github.com/que-etc/resize-observer-polyfill.');
didWarn = true;
}
}
return resizeObserver;
}
function useElementLayout(ref, onLayout) {
var observer = getResizeObserver();
(0, _useLayoutEffect.default)(() => {
var node = ref.current;
if (node != null) {
node[DOM_LAYOUT_HANDLER_NAME] = onLayout;
}
}, [ref, onLayout]);
// Observing is done in a separate effect to avoid this effect running
// when 'onLayout' changes.
(0, _useLayoutEffect.default)(() => {
var node = ref.current;
if (node != null && observer != null) {
if (typeof node[DOM_LAYOUT_HANDLER_NAME] === 'function') {
observer.observe(node);
} else {
observer.unobserve(node);
}
}
return () => {
if (node != null && observer != null) {
observer.unobserve(node);
}
};
}, [ref, observer]);
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useEvent/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = useEvent;
var _addEventListener = require("../addEventListener");
var _useLayoutEffect = _interopRequireDefault(require("../useLayoutEffect"));
var _useStable = _interopRequireDefault(require("../useStable"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* This can be used with any event type include custom events.
*
* const click = useEvent('click', options);
* useEffect(() => {
* click.setListener(target, onClick);
* return () => click.clear();
* }).
*/
function useEvent(eventType, options) {
var targetListeners = (0, _useStable.default)(() => new Map());
var addListener = (0, _useStable.default)(() => {
return (target, callback) => {
var removeTargetListener = targetListeners.get(target);
if (removeTargetListener != null) {
removeTargetListener();
}
if (callback == null) {
targetListeners.delete(target);
callback = () => {};
}
var removeEventListener = (0, _addEventListener.addEventListener)(target, eventType, callback, options);
targetListeners.set(target, removeEventListener);
return removeEventListener;
};
});
(0, _useLayoutEffect.default)(() => {
return () => {
targetListeners.forEach(removeListener => {
removeListener();
});
targetListeners.clear();
};
}, [targetListeners]);
return addListener;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useHover/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = useHover;
var _modality = require("../modality");
var _useEvent = _interopRequireDefault(require("../useEvent"));
var _useLayoutEffect = _interopRequireDefault(require("../useLayoutEffect"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* Implementation
*/
var emptyObject = {};
var opts = {
passive: true
};
var lockEventType = 'react-gui:hover:lock';
var unlockEventType = 'react-gui:hover:unlock';
var supportsPointerEvent = () => !!(typeof window !== 'undefined' && window.PointerEvent != null);
function dispatchCustomEvent(target, type, payload) {
var event = document.createEvent('CustomEvent');
var _ref = payload || emptyObject,
_ref$bubbles = _ref.bubbles,
bubbles = _ref$bubbles === void 0 ? true : _ref$bubbles,
_ref$cancelable = _ref.cancelable,
cancelable = _ref$cancelable === void 0 ? true : _ref$cancelable,
detail = _ref.detail;
event.initCustomEvent(type, bubbles, cancelable, detail);
target.dispatchEvent(event);
}
// This accounts for the non-PointerEvent fallback events.
function getPointerType(event) {
var pointerType = event.pointerType;
return pointerType != null ? pointerType : (0, _modality.getModality)();
}
function useHover(targetRef, config) {
var contain = config.contain,
disabled = config.disabled,
onHoverStart = config.onHoverStart,
onHoverChange = config.onHoverChange,
onHoverUpdate = config.onHoverUpdate,
onHoverEnd = config.onHoverEnd;
var canUsePE = supportsPointerEvent();
var addMoveListener = (0, _useEvent.default)(canUsePE ? 'pointermove' : 'mousemove', opts);
var addEnterListener = (0, _useEvent.default)(canUsePE ? 'pointerenter' : 'mouseenter', opts);
var addLeaveListener = (0, _useEvent.default)(canUsePE ? 'pointerleave' : 'mouseleave', opts);
// These custom events are used to implement the "contain" prop.
var addLockListener = (0, _useEvent.default)(lockEventType, opts);
var addUnlockListener = (0, _useEvent.default)(unlockEventType, opts);
(0, _useLayoutEffect.default)(() => {
var target = targetRef.current;
if (target !== null) {
/**
* End the hover gesture
*/
var hoverEnd = function hoverEnd(e) {
if (onHoverEnd != null) {
onHoverEnd(e);
}
if (onHoverChange != null) {
onHoverChange(false);
}
// Remove the listeners once finished.
addMoveListener(target, null);
addLeaveListener(target, null);
};
/**
* Leave element
*/
var leaveListener = function leaveListener(e) {
var target = targetRef.current;
if (target != null && getPointerType(e) !== 'touch') {
if (contain) {
dispatchCustomEvent(target, unlockEventType);
}
hoverEnd(e);
}
};
/**
* Move within element
*/
var moveListener = function moveListener(e) {
if (getPointerType(e) !== 'touch') {
if (onHoverUpdate != null) {
// Not all browsers have these properties
if (e.x == null) {
e.x = e.clientX;
}
if (e.y == null) {
e.y = e.clientY;
}
onHoverUpdate(e);
}
}
};
/**
* Start the hover gesture
*/
var hoverStart = function hoverStart(e) {
if (onHoverStart != null) {
onHoverStart(e);
}
if (onHoverChange != null) {
onHoverChange(true);
}
// Set the listeners needed for the rest of the hover gesture.
if (onHoverUpdate != null) {
addMoveListener(target, !disabled ? moveListener : null);
}
addLeaveListener(target, !disabled ? leaveListener : null);
};
/**
* Enter element
*/
var enterListener = function enterListener(e) {
var target = targetRef.current;
if (target != null && getPointerType(e) !== 'touch') {
if (contain) {
dispatchCustomEvent(target, lockEventType);
}
hoverStart(e);
var lockListener = function lockListener(lockEvent) {
if (lockEvent.target !== target) {
hoverEnd(e);
}
};
var unlockListener = function unlockListener(lockEvent) {
if (lockEvent.target !== target) {
hoverStart(e);
}
};
addLockListener(target, !disabled ? lockListener : null);
addUnlockListener(target, !disabled ? unlockListener : null);
}
};
addEnterListener(target, !disabled ? enterListener : null);
}
}, [addEnterListener, addMoveListener, addLeaveListener, addLockListener, addUnlockListener, contain, disabled, onHoverStart, onHoverChange, onHoverUpdate, onHoverEnd, targetRef]);
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useLayoutEffect/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _react = require("react");
var _canUseDom = _interopRequireDefault(require("../canUseDom"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* useLayoutEffect throws an error on the server. On the few occasions where is
* problematic, use this hook.
*
*
*/
var useLayoutEffectImpl = _canUseDom.default ? _react.useLayoutEffect : _react.useEffect;
var _default = useLayoutEffectImpl;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useLocale/index.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.LocaleProvider = LocaleProvider;
exports.getLocaleDirection = getLocaleDirection;
exports.useLocaleContext = useLocaleContext;
var _react = _interopRequireWildcard(require("react"));
var _isLocaleRTL = require("./isLocaleRTL");
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var defaultLocale = {
direction: 'ltr',
locale: 'en-US'
};
var LocaleContext = /*#__PURE__*/(0, _react.createContext)(defaultLocale);
function getLocaleDirection(locale) {
return (0, _isLocaleRTL.isLocaleRTL)(locale) ? 'rtl' : 'ltr';
}
function LocaleProvider(props) {
var direction = props.direction,
locale = props.locale,
children = props.children;
var needsContext = direction || locale;
return needsContext ? /*#__PURE__*/_react.default.createElement(LocaleContext.Provider, {
children: children,
value: {
direction: locale ? getLocaleDirection(locale) : direction,
locale
}
}) : children;
}
function useLocaleContext() {
return (0, _react.useContext)(LocaleContext);
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useLocale/isLocaleRTL.js
"use strict";
exports.__esModule = true;
exports.isLocaleRTL = isLocaleRTL;
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var rtlScripts = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']);
var rtlLangs = new Set(['ae',
// Avestan
'ar',
// Arabic
'arc',
// Aramaic
'bcc',
// Southern Balochi
'bqi',
// Bakthiari
'ckb',
// Sorani
'dv',
// Dhivehi
'fa', 'far',
// Persian
'glk',
// Gilaki
'he', 'iw',
// Hebrew
'khw',
// Khowar
'ks',
// Kashmiri
'ku',
// Kurdish
'mzn',
// Mazanderani
'nqo',
// N'Ko
'pnb',
// Western Punjabi
'ps',
// Pashto
'sd',
// Sindhi
'ug',
// Uyghur
'ur',
// Urdu
'yi' // Yiddish
]);
var cache = new Map();
/**
* Determine the writing direction of a locale
*/
function isLocaleRTL(locale) {
var cachedRTL = cache.get(locale);
if (cachedRTL) {
return cachedRTL;
}
var isRTL = false;
// $FlowFixMe
if (Intl.Locale) {
// $FlowFixMe
var script = new Intl.Locale(locale).maximize().script;
isRTL = rtlScripts.has(script);
} else {
// Fallback to inferring from language
var lang = locale.split('-')[0];
isRTL = rtlLangs.has(lang);
}
cache.set(locale, isRTL);
return isRTL;
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useMergeRefs/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = useMergeRefs;
var React = _interopRequireWildcard(require("react"));
var _mergeRefs = _interopRequireDefault(require("../mergeRefs"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function useMergeRefs() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return React.useMemo(() => (0, _mergeRefs.default)(...args),
// eslint-disable-next-line
[...args]);
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/usePlatformMethods/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = usePlatformMethods;
var _UIManager = _interopRequireDefault(require("../../exports/UIManager"));
var _useStable = _interopRequireDefault(require("../useStable"));
/**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* Adds non-standard methods to the hode element. This is temporarily until an
* API like `ReactNative.measure(hostRef, callback)` is added to React Native.
*/
function usePlatformMethods(_ref) {
var pointerEvents = _ref.pointerEvents,
style = _ref.style;
// Avoid creating a new ref on every render.
var ref = (0, _useStable.default)(() => hostNode => {
if (hostNode != null) {
hostNode.measure = callback => _UIManager.default.measure(hostNode, callback);
hostNode.measureLayout = (relativeToNode, success, failure) => _UIManager.default.measureLayout(hostNode, relativeToNode, failure, success);
hostNode.measureInWindow = callback => _UIManager.default.measureInWindow(hostNode, callback);
}
});
return ref;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/usePressEvents/PressResponder.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
exports.__esModule = true;
exports.default = void 0;
var DELAY = 'DELAY';
var ERROR = 'ERROR';
var LONG_PRESS_DETECTED = 'LONG_PRESS_DETECTED';
var NOT_RESPONDER = 'NOT_RESPONDER';
var RESPONDER_ACTIVE_LONG_PRESS_START = 'RESPONDER_ACTIVE_LONG_PRESS_START';
var RESPONDER_ACTIVE_PRESS_START = 'RESPONDER_ACTIVE_PRESS_START';
var RESPONDER_INACTIVE_PRESS_START = 'RESPONDER_INACTIVE_PRESS_START';
var RESPONDER_GRANT = 'RESPONDER_GRANT';
var RESPONDER_RELEASE = 'RESPONDER_RELEASE';
var RESPONDER_TERMINATED = 'RESPONDER_TERMINATED';
var Transitions = Object.freeze({
NOT_RESPONDER: {
DELAY: ERROR,
RESPONDER_GRANT: RESPONDER_INACTIVE_PRESS_START,
RESPONDER_RELEASE: ERROR,
RESPONDER_TERMINATED: ERROR,
LONG_PRESS_DETECTED: ERROR
},
RESPONDER_INACTIVE_PRESS_START: {
DELAY: RESPONDER_ACTIVE_PRESS_START,
RESPONDER_GRANT: ERROR,
RESPONDER_RELEASE: NOT_RESPONDER,
RESPONDER_TERMINATED: NOT_RESPONDER,
LONG_PRESS_DETECTED: ERROR
},
RESPONDER_ACTIVE_PRESS_START: {
DELAY: ERROR,
RESPONDER_GRANT: ERROR,
RESPONDER_RELEASE: NOT_RESPONDER,
RESPONDER_TERMINATED: NOT_RESPONDER,
LONG_PRESS_DETECTED: RESPONDER_ACTIVE_LONG_PRESS_START
},
RESPONDER_ACTIVE_LONG_PRESS_START: {
DELAY: ERROR,
RESPONDER_GRANT: ERROR,
RESPONDER_RELEASE: NOT_RESPONDER,
RESPONDER_TERMINATED: NOT_RESPONDER,
LONG_PRESS_DETECTED: RESPONDER_ACTIVE_LONG_PRESS_START
},
ERROR: {
DELAY: NOT_RESPONDER,
RESPONDER_GRANT: RESPONDER_INACTIVE_PRESS_START,
RESPONDER_RELEASE: NOT_RESPONDER,
RESPONDER_TERMINATED: NOT_RESPONDER,
LONG_PRESS_DETECTED: NOT_RESPONDER
}
});
var getElementRole = element => element.getAttribute('role');
var getElementType = element => element.tagName.toLowerCase();
var isActiveSignal = signal => signal === RESPONDER_ACTIVE_PRESS_START || signal === RESPONDER_ACTIVE_LONG_PRESS_START;
var isButtonRole = element => getElementRole(element) === 'button';
var isPressStartSignal = signal => signal === RESPONDER_INACTIVE_PRESS_START || signal === RESPONDER_ACTIVE_PRESS_START || signal === RESPONDER_ACTIVE_LONG_PRESS_START;
var isTerminalSignal = signal => signal === RESPONDER_TERMINATED || signal === RESPONDER_RELEASE;
var isValidKeyPress = event => {
var key = event.key,
target = event.target;
var isSpacebar = key === ' ' || key === 'Spacebar';
var isButtonish = getElementType(target) === 'button' || isButtonRole(target);
return key === 'Enter' || isSpacebar && isButtonish;
};
var DEFAULT_LONG_PRESS_DELAY_MS = 450; // 500 - 50
var DEFAULT_PRESS_DELAY_MS = 50;
/**
* =========================== PressResponder Tutorial ===========================
*
* The `PressResponder` class helps you create press interactions by analyzing the
* geometry of elements and observing when another responder (e.g. ScrollView)
* has stolen the touch lock. It offers hooks for your component to provide
* interaction feedback to the user:
*
* - When a press has activated (e.g. highlight an element)
* - When a press has deactivated (e.g. un-highlight an element)
* - When a press sould trigger an action, meaning it activated and deactivated
* while within the geometry of the element without the lock being stolen.
*
* A high quality interaction isn't as simple as you might think. There should
* be a slight delay before activation. Moving your finger beyond an element's
* bounds should trigger deactivation, but moving the same finger back within an
* element's bounds should trigger reactivation.
*
* In order to use `PressResponder`, do the following:
*
* const pressResponder = new PressResponder(config);
*
* 2. Choose the rendered component who should collect the press events. On that
* element, spread `pressability.getEventHandlers()` into its props.
*
* return (
* <View {...this.state.pressResponder.getEventHandlers()} />
* );
*
* 3. Reset `PressResponder` when your component unmounts.
*
* componentWillUnmount() {
* this.state.pressResponder.reset();
* }
*
* ==================== Implementation Details ====================
*
* `PressResponder` only assumes that there exists a `HitRect` node. The `PressRect`
* is an abstract box that is extended beyond the `HitRect`.
*
* # Geometry
*
* ┌────────────────────────┐
* │ ┌──────────────────┐ │ - Presses start anywhere within `HitRect`.
* │ │ ┌────────────┐ │ │
* │ │ │ VisualRect │ │ │
* │ │ └────────────┘ │ │ - When pressed down for sufficient amount of time
* │ │ HitRect │ │ before letting up, `VisualRect` activates.
* │ └──────────────────┘ │
* │ Out Region o │
* └────────────────────│───┘
* └────── When the press is released outside the `HitRect`,
* the responder is NOT eligible for a "press".
*
* # State Machine
*
* ┌───────────────┐ ◀──── RESPONDER_RELEASE
* │ NOT_RESPONDER │
* └───┬───────────┘ ◀──── RESPONDER_TERMINATED
* │
* │ RESPONDER_GRANT (HitRect)
* │
* ▼
* ┌─────────────────────┐ ┌───────────────────┐ ┌───────────────────┐
* │ RESPONDER_INACTIVE_ │ DELAY │ RESPONDER_ACTIVE_ │ T + DELAY │ RESPONDER_ACTIVE_ │
* │ PRESS_START ├────────▶ │ PRESS_START ├────────────▶ │ LONG_PRESS_START │
* └─────────────────────┘ └───────────────────┘ └───────────────────┘
*
* T + DELAY => LONG_PRESS_DELAY + DELAY
*
* Not drawn are the side effects of each transition. The most important side
* effect is the invocation of `onLongPress`. Only when the browser produces a
* `click` event is `onPress` invoked.
*/
class PressResponder {
constructor(config) {
this._eventHandlers = null;
this._isPointerTouch = false;
this._longPressDelayTimeout = null;
this._longPressDispatched = false;
this._pressDelayTimeout = null;
this._pressOutDelayTimeout = null;
this._touchState = NOT_RESPONDER;
this._responderElement = null;
this.configure(config);
}
configure(config) {
this._config = config;
}
/**
* Resets any pending timers. This should be called on unmount.
*/
reset() {
this._cancelLongPressDelayTimeout();
this._cancelPressDelayTimeout();
this._cancelPressOutDelayTimeout();
}
/**
* Returns a set of props to spread into the interactive element.
*/
getEventHandlers() {
if (this._eventHandlers == null) {
this._eventHandlers = this._createEventHandlers();
}
return this._eventHandlers;
}
_createEventHandlers() {
var start = (event, shouldDelay) => {
event.persist();
this._cancelPressOutDelayTimeout();
this._longPressDispatched = false;
this._selectionTerminated = false;
this._touchState = NOT_RESPONDER;
this._isPointerTouch = event.nativeEvent.type === 'touchstart';
this._receiveSignal(RESPONDER_GRANT, event);
var delayPressStart = normalizeDelay(this._config.delayPressStart, 0, DEFAULT_PRESS_DELAY_MS);
if (shouldDelay !== false && delayPressStart > 0) {
this._pressDelayTimeout = setTimeout(() => {
this._receiveSignal(DELAY, event);
}, delayPressStart);
} else {
this._receiveSignal(DELAY, event);
}
var delayLongPress = normalizeDelay(this._config.delayLongPress, 10, DEFAULT_LONG_PRESS_DELAY_MS);
this._longPressDelayTimeout = setTimeout(() => {
this._handleLongPress(event);
}, delayLongPress + delayPressStart);
};
var end = event => {
this._receiveSignal(RESPONDER_RELEASE, event);
};
var keyupHandler = event => {
var onPress = this._config.onPress;
var target = event.target;
if (this._touchState !== NOT_RESPONDER && isValidKeyPress(event)) {
end(event);
document.removeEventListener('keyup', keyupHandler);
var role = target.getAttribute('role');
var elementType = getElementType(target);
var isNativeInteractiveElement = role === 'link' || elementType === 'a' || elementType === 'button' || elementType === 'input' || elementType === 'select' || elementType === 'textarea';
var isActiveElement = this._responderElement === target;
if (onPress != null && !isNativeInteractiveElement && isActiveElement) {
onPress(event);
}
this._responderElement = null;
}
};
return {
onStartShouldSetResponder: event => {
var disabled = this._config.disabled;
if (disabled && isButtonRole(event.currentTarget)) {
event.stopPropagation();
}
if (disabled == null) {
return true;
}
return !disabled;
},
onKeyDown: event => {
var disabled = this._config.disabled;
var key = event.key,
target = event.target;
if (!disabled && isValidKeyPress(event)) {
if (this._touchState === NOT_RESPONDER) {
start(event, false);
this._responderElement = target;
// Listen to 'keyup' on document to account for situations where
// focus is moved to another element during 'keydown'.
document.addEventListener('keyup', keyupHandler);
}
var isSpacebarKey = key === ' ' || key === 'Spacebar';
var role = getElementRole(target);
var isButtonLikeRole = role === 'button' || role === 'menuitem';
if (isSpacebarKey && isButtonLikeRole && getElementType(target) !== 'button') {
// Prevent spacebar scrolling the window if using non-native button
event.preventDefault();
}
event.stopPropagation();
}
},
onResponderGrant: event => start(event),
onResponderMove: event => {
if (this._config.onPressMove != null) {
this._config.onPressMove(event);
}
var touch = getTouchFromResponderEvent(event);
if (this._touchActivatePosition != null) {
var deltaX = this._touchActivatePosition.pageX - touch.pageX;
var deltaY = this._touchActivatePosition.pageY - touch.pageY;
if (Math.hypot(deltaX, deltaY) > 10) {
this._cancelLongPressDelayTimeout();
}
}
},
onResponderRelease: event => end(event),
onResponderTerminate: event => {
if (event.nativeEvent.type === 'selectionchange') {
this._selectionTerminated = true;
}
this._receiveSignal(RESPONDER_TERMINATED, event);
},
onResponderTerminationRequest: event => {
var _this$_config = this._config,
cancelable = _this$_config.cancelable,
disabled = _this$_config.disabled,
onLongPress = _this$_config.onLongPress;
// If `onLongPress` is provided, don't terminate on `contextmenu` as default
// behavior will be prevented for non-mouse pointers.
if (!disabled && onLongPress != null && this._isPointerTouch && event.nativeEvent.type === 'contextmenu') {
return false;
}
if (cancelable == null) {
return true;
}
return cancelable;
},
// NOTE: this diverges from react-native in 3 significant ways:
// * The `onPress` callback is not connected to the responder system (the native
// `click` event must be used but is dispatched in many scenarios where no pointers
// are on the screen.) Therefore, it's possible for `onPress` to be called without
// `onPress{Start,End}` being called first.
// * The `onPress` callback is only be called on the first ancestor of the native
// `click` target that is using the PressResponder.
// * The event's `nativeEvent` is a `MouseEvent` not a `TouchEvent`.
onClick: event => {
var _this$_config2 = this._config,
disabled = _this$_config2.disabled,
onPress = _this$_config2.onPress;
if (!disabled) {
// If long press dispatched, cancel default click behavior.
// If the responder terminated because text was selected during the gesture,
// cancel the default click behavior.
event.stopPropagation();
if (this._longPressDispatched || this._selectionTerminated) {
event.preventDefault();
} else if (onPress != null && event.altKey === false) {
onPress(event);
}
} else {
if (isButtonRole(event.currentTarget)) {
event.stopPropagation();
}
}
},
// If `onLongPress` is provided and a touch pointer is being used, prevent the
// default context menu from opening.
onContextMenu: event => {
var _this$_config3 = this._config,
disabled = _this$_config3.disabled,
onLongPress = _this$_config3.onLongPress;
if (!disabled) {
if (onLongPress != null && this._isPointerTouch && !event.defaultPrevented) {
event.preventDefault();
event.stopPropagation();
}
} else {
if (isButtonRole(event.currentTarget)) {
event.stopPropagation();
}
}
}
};
}
/**
* Receives a state machine signal, performs side effects of the transition
* and stores the new state. Validates the transition as well.
*/
_receiveSignal(signal, event) {
var prevState = this._touchState;
var nextState = null;
if (Transitions[prevState] != null) {
nextState = Transitions[prevState][signal];
}
if (this._touchState === NOT_RESPONDER && signal === RESPONDER_RELEASE) {
return;
}
if (nextState == null || nextState === ERROR) {
console.error("PressResponder: Invalid signal " + signal + " for state " + prevState + " on responder");
} else if (prevState !== nextState) {
this._performTransitionSideEffects(prevState, nextState, signal, event);
this._touchState = nextState;
}
}
/**
* Performs a transition between touchable states and identify any activations
* or deactivations (and callback invocations).
*/
_performTransitionSideEffects(prevState, nextState, signal, event) {
if (isTerminalSignal(signal)) {
// Pressable suppression of contextmenu on windows.
// On Windows, the contextmenu is displayed after pointerup.
// https://github.com/necolas/react-native-web/issues/2296
setTimeout(() => {
this._isPointerTouch = false;
}, 0);
this._touchActivatePosition = null;
this._cancelLongPressDelayTimeout();
}
if (isPressStartSignal(prevState) && signal === LONG_PRESS_DETECTED) {
var onLongPress = this._config.onLongPress;
// Long press is not supported for keyboards because 'click' can be dispatched
// immediately (and multiple times) after 'keydown'.
if (onLongPress != null && event.nativeEvent.key == null) {
onLongPress(event);
this._longPressDispatched = true;
}
}
var isPrevActive = isActiveSignal(prevState);
var isNextActive = isActiveSignal(nextState);
if (!isPrevActive && isNextActive) {
this._activate(event);
} else if (isPrevActive && !isNextActive) {
this._deactivate(event);
}
if (isPressStartSignal(prevState) && signal === RESPONDER_RELEASE) {
var _this$_config4 = this._config,
_onLongPress = _this$_config4.onLongPress,
onPress = _this$_config4.onPress;
if (onPress != null) {
var isPressCanceledByLongPress = _onLongPress != null && prevState === RESPONDER_ACTIVE_LONG_PRESS_START;
if (!isPressCanceledByLongPress) {
// If we never activated (due to delays), activate and deactivate now.
if (!isNextActive && !isPrevActive) {
this._activate(event);
this._deactivate(event);
}
}
}
}
this._cancelPressDelayTimeout();
}
_activate(event) {
var _this$_config5 = this._config,
onPressChange = _this$_config5.onPressChange,
onPressStart = _this$_config5.onPressStart;
var touch = getTouchFromResponderEvent(event);
this._touchActivatePosition = {
pageX: touch.pageX,
pageY: touch.pageY
};
if (onPressStart != null) {
onPressStart(event);
}
if (onPressChange != null) {
onPressChange(true);
}
}
_deactivate(event) {
var _this$_config6 = this._config,
onPressChange = _this$_config6.onPressChange,
onPressEnd = _this$_config6.onPressEnd;
function end() {
if (onPressEnd != null) {
onPressEnd(event);
}
if (onPressChange != null) {
onPressChange(false);
}
}
var delayPressEnd = normalizeDelay(this._config.delayPressEnd);
if (delayPressEnd > 0) {
this._pressOutDelayTimeout = setTimeout(() => {
end();
}, delayPressEnd);
} else {
end();
}
}
_handleLongPress(event) {
if (this._touchState === RESPONDER_ACTIVE_PRESS_START || this._touchState === RESPONDER_ACTIVE_LONG_PRESS_START) {
this._receiveSignal(LONG_PRESS_DETECTED, event);
}
}
_cancelLongPressDelayTimeout() {
if (this._longPressDelayTimeout != null) {
clearTimeout(this._longPressDelayTimeout);
this._longPressDelayTimeout = null;
}
}
_cancelPressDelayTimeout() {
if (this._pressDelayTimeout != null) {
clearTimeout(this._pressDelayTimeout);
this._pressDelayTimeout = null;
}
}
_cancelPressOutDelayTimeout() {
if (this._pressOutDelayTimeout != null) {
clearTimeout(this._pressOutDelayTimeout);
this._pressOutDelayTimeout = null;
}
}
}
exports.default = PressResponder;
function normalizeDelay(delay, min, fallback) {
if (min === void 0) {
min = 0;
}
if (fallback === void 0) {
fallback = 0;
}
return Math.max(min, delay !== null && delay !== void 0 ? delay : fallback);
}
function getTouchFromResponderEvent(event) {
var _event$nativeEvent = event.nativeEvent,
changedTouches = _event$nativeEvent.changedTouches,
touches = _event$nativeEvent.touches;
if (touches != null && touches.length > 0) {
return touches[0];
}
if (changedTouches != null && changedTouches.length > 0) {
return changedTouches[0];
}
return event.nativeEvent;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/usePressEvents/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = usePressEvents;
var _PressResponder = _interopRequireDefault(require("./PressResponder"));
var _react = require("react");
function usePressEvents(hostRef, config) {
var pressResponderRef = (0, _react.useRef)(null);
if (pressResponderRef.current == null) {
pressResponderRef.current = new _PressResponder.default(config);
}
var pressResponder = pressResponderRef.current;
// Re-configure to use the current node and configuration.
(0, _react.useEffect)(() => {
pressResponder.configure(config);
}, [config, pressResponder]);
// Reset the `pressResponder` when cleanup needs to occur. This is
// a separate effect because we do not want to rest the responder when `config` changes.
(0, _react.useEffect)(() => {
return () => {
pressResponder.reset();
};
}, [pressResponder]);
(0, _react.useDebugValue)(config);
return pressResponder.getEventHandlers();
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderEventTypes.js
"use strict";
exports.__esModule = true;
exports.TOUCH_START = exports.TOUCH_MOVE = exports.TOUCH_END = exports.TOUCH_CANCEL = exports.SELECTION_CHANGE = exports.SELECT = exports.SCROLL = exports.MOUSE_UP = exports.MOUSE_MOVE = exports.MOUSE_DOWN = exports.MOUSE_CANCEL = exports.FOCUS_OUT = exports.CONTEXT_MENU = exports.BLUR = void 0;
exports.isCancelish = isCancelish;
exports.isEndish = isEndish;
exports.isMoveish = isMoveish;
exports.isScroll = isScroll;
exports.isSelectionChange = isSelectionChange;
exports.isStartish = isStartish;
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var BLUR = 'blur';
exports.BLUR = BLUR;
var CONTEXT_MENU = 'contextmenu';
exports.CONTEXT_MENU = CONTEXT_MENU;
var FOCUS_OUT = 'focusout';
exports.FOCUS_OUT = FOCUS_OUT;
var MOUSE_DOWN = 'mousedown';
exports.MOUSE_DOWN = MOUSE_DOWN;
var MOUSE_MOVE = 'mousemove';
exports.MOUSE_MOVE = MOUSE_MOVE;
var MOUSE_UP = 'mouseup';
exports.MOUSE_UP = MOUSE_UP;
var MOUSE_CANCEL = 'dragstart';
exports.MOUSE_CANCEL = MOUSE_CANCEL;
var TOUCH_START = 'touchstart';
exports.TOUCH_START = TOUCH_START;
var TOUCH_MOVE = 'touchmove';
exports.TOUCH_MOVE = TOUCH_MOVE;
var TOUCH_END = 'touchend';
exports.TOUCH_END = TOUCH_END;
var TOUCH_CANCEL = 'touchcancel';
exports.TOUCH_CANCEL = TOUCH_CANCEL;
var SCROLL = 'scroll';
exports.SCROLL = SCROLL;
var SELECT = 'select';
exports.SELECT = SELECT;
var SELECTION_CHANGE = 'selectionchange';
exports.SELECTION_CHANGE = SELECTION_CHANGE;
function isStartish(eventType) {
return eventType === TOUCH_START || eventType === MOUSE_DOWN;
}
function isMoveish(eventType) {
return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;
}
function isEndish(eventType) {
return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType);
}
function isCancelish(eventType) {
return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;
}
function isScroll(eventType) {
return eventType === SCROLL;
}
function isSelectionChange(eventType) {
return eventType === SELECT || eventType === SELECTION_CHANGE;
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderSystem.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.addNode = addNode;
exports.attachListeners = attachListeners;
exports.getResponderNode = getResponderNode;
exports.removeNode = removeNode;
exports.terminateResponder = terminateResponder;
var _createResponderEvent = _interopRequireDefault(require("./createResponderEvent"));
var _ResponderEventTypes = require("./ResponderEventTypes");
var _utils = require("./utils");
var _ResponderTouchHistoryStore = require("./ResponderTouchHistoryStore");
var _canUseDom = _interopRequireDefault(require("../canUseDom"));
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* RESPONDER EVENT SYSTEM
*
* A single, global "interaction lock" on views. For a view to be the "responder" means
* that pointer interactions are exclusive to that view and none other. The "interaction
* lock" can be transferred (only) to ancestors of the current "responder" as long as
* pointers continue to be active.
*
* Responder being granted:
*
* A view can become the "responder" after the following events:
* * "pointerdown" (implemented using "touchstart", "mousedown")
* * "pointermove" (implemented using "touchmove", "mousemove")
* * "scroll" (while a pointer is down)
* * "selectionchange" (while a pointer is down)
*
* If nothing is already the "responder", the event propagates to (capture) and from
* (bubble) the event target until a view returns `true` for
* `on*ShouldSetResponder(Capture)`.
*
* If something is already the responder, the event propagates to (capture) and from
* (bubble) the lowest common ancestor of the event target and the current "responder".
* Then negotiation happens between the current "responder" and a view that wants to
* become the "responder": see the timing diagram below.
*
* (NOTE: Scrolled views either automatically become the "responder" or release the
* "interaction lock". A native scroll view that isn't built on top of the responder
* system must result in the current "responder" being notified that it no longer has
* the "interaction lock" - the native system has taken over.
*
* Responder being released:
*
* As soon as there are no more active pointers that *started* inside descendants
* of the *current* "responder", an `onResponderRelease` event is dispatched to the
* current "responder", and the responder lock is released.
*
* Typical sequence of events:
* * startShouldSetResponder
* * responderGrant/Reject
* * responderStart
* * responderMove
* * responderEnd
* * responderRelease
*/
/* Negotiation Performed
+-----------------------+
/ \
Process low level events to + Current Responder + wantsResponderID
determine who to perform negot-| (if any exists at all) |
iation/transition | Otherwise just pass through|
-------------------------------+----------------------------+------------------+
Bubble to find first ID | |
to return true:wantsResponderID| |
| |
+--------------+ | |
| onTouchStart | | |
+------+-------+ none | |
| return| |
+-----------v-------------+true| +------------------------+ |
|onStartShouldSetResponder|----->| onResponderStart (cur) |<-----------+
+-----------+-------------+ | +------------------------+ | |
| | | +--------+-------+
| returned true for| false:REJECT +-------->|onResponderReject
| wantsResponderID | | | +----------------+
| (now attempt | +------------------+-----+ |
| handoff) | | onResponder | |
+------------------->| TerminationRequest | |
| +------------------+-----+ |
| | | +----------------+
| true:GRANT +-------->|onResponderGrant|
| | +--------+-------+
| +------------------------+ | |
| | onResponderTerminate |<-----------+
| +------------------+-----+ |
| | | +----------------+
| +-------->|onResponderStart|
| | +----------------+
Bubble to find first ID | |
to return true:wantsResponderID| |
| |
+-------------+ | |
| onTouchMove | | |
+------+------+ none | |
| return| |
+-----------v-------------+true| +------------------------+ |
|onMoveShouldSetResponder |----->| onResponderMove (cur) |<-----------+
+-----------+-------------+ | +------------------------+ | |
| | | +--------+-------+
| returned true for| false:REJECT +-------->|onResponderReject
| wantsResponderID | | | +----------------+
| (now attempt | +------------------+-----+ |
| handoff) | | onResponder | |
+------------------->| TerminationRequest| |
| +------------------+-----+ |
| | | +----------------+
| true:GRANT +-------->|onResponderGrant|
| | +--------+-------+
| +------------------------+ | |
| | onResponderTerminate |<-----------+
| +------------------+-----+ |
| | | +----------------+
| +-------->|onResponderMove |
| | +----------------+
| |
| |
Some active touch started| |
inside current responder | +------------------------+ |
+------------------------->| onResponderEnd | |
| | +------------------------+ |
+---+---------+ | |
| onTouchEnd | | |
+---+---------+ | |
| | +------------------------+ |
+------------------------->| onResponderEnd | |
No active touches started| +-----------+------------+ |
inside current responder | | |
| v |
| +------------------------+ |
| | onResponderRelease | |
| +------------------------+ |
| |
+ + */
var emptyObject = {};
/* ------------ IMPLEMENTATION ------------ */
var startRegistration = ['onStartShouldSetResponderCapture', 'onStartShouldSetResponder', {
bubbles: true
}];
var moveRegistration = ['onMoveShouldSetResponderCapture', 'onMoveShouldSetResponder', {
bubbles: true
}];
var scrollRegistration = ['onScrollShouldSetResponderCapture', 'onScrollShouldSetResponder', {
bubbles: false
}];
var shouldSetResponderEvents = {
touchstart: startRegistration,
mousedown: startRegistration,
touchmove: moveRegistration,
mousemove: moveRegistration,
scroll: scrollRegistration
};
var emptyResponder = {
id: null,
idPath: null,
node: null
};
var responderListenersMap = new Map();
var isEmulatingMouseEvents = false;
var trackedTouchCount = 0;
var currentResponder = {
id: null,
node: null,
idPath: null
};
var responderTouchHistoryStore = new _ResponderTouchHistoryStore.ResponderTouchHistoryStore();
function changeCurrentResponder(responder) {
currentResponder = responder;
}
function getResponderConfig(id) {
var config = responderListenersMap.get(id);
return config != null ? config : emptyObject;
}
/**
* Process native events
*
* A single event listener is used to manage the responder system.
* All pointers are tracked in the ResponderTouchHistoryStore. Native events
* are interpreted in terms of the Responder System and checked to see if
* the responder should be transferred. Each host node that is attached to
* the Responder System has an ID, which is used to look up its associated
* callbacks.
*/
function eventListener(domEvent) {
var eventType = domEvent.type;
var eventTarget = domEvent.target;
/**
* Manage emulated events and early bailout.
* Since PointerEvent is not used yet (lack of support in older Safari), it's
* necessary to manually manage the mess of browser touch/mouse events.
* And bailout early for termination events when there is no active responder.
*/
// Flag when browser may produce emulated events
if (eventType === 'touchstart') {
isEmulatingMouseEvents = true;
}
// Remove flag when browser will not produce emulated events
if (eventType === 'touchmove' || trackedTouchCount > 1) {
isEmulatingMouseEvents = false;
}
// Ignore various events in particular circumstances
if (
// Ignore browser emulated mouse events
eventType === 'mousedown' && isEmulatingMouseEvents || eventType === 'mousemove' && isEmulatingMouseEvents ||
// Ignore mousemove if a mousedown didn't occur first
eventType === 'mousemove' && trackedTouchCount < 1) {
return;
}
// Remove flag after emulated events are finished
if (isEmulatingMouseEvents && eventType === 'mouseup') {
if (trackedTouchCount === 0) {
isEmulatingMouseEvents = false;
}
return;
}
var isStartEvent = (0, _ResponderEventTypes.isStartish)(eventType) && (0, _utils.isPrimaryPointerDown)(domEvent);
var isMoveEvent = (0, _ResponderEventTypes.isMoveish)(eventType);
var isEndEvent = (0, _ResponderEventTypes.isEndish)(eventType);
var isScrollEvent = (0, _ResponderEventTypes.isScroll)(eventType);
var isSelectionChangeEvent = (0, _ResponderEventTypes.isSelectionChange)(eventType);
var responderEvent = (0, _createResponderEvent.default)(domEvent, responderTouchHistoryStore);
/**
* Record the state of active pointers
*/
if (isStartEvent || isMoveEvent || isEndEvent) {
if (domEvent.touches) {
trackedTouchCount = domEvent.touches.length;
} else {
if (isStartEvent) {
trackedTouchCount = 1;
} else if (isEndEvent) {
trackedTouchCount = 0;
}
}
responderTouchHistoryStore.recordTouchTrack(eventType, responderEvent.nativeEvent);
}
/**
* Responder System logic
*/
var eventPaths = (0, _utils.getResponderPaths)(domEvent);
var wasNegotiated = false;
var wantsResponder;
// If an event occured that might change the current responder...
if (isStartEvent || isMoveEvent || isScrollEvent && trackedTouchCount > 0) {
// If there is already a responder, prune the event paths to the lowest common ancestor
// of the existing responder and deepest target of the event.
var currentResponderIdPath = currentResponder.idPath;
var eventIdPath = eventPaths.idPath;
if (currentResponderIdPath != null && eventIdPath != null) {
var lowestCommonAncestor = (0, _utils.getLowestCommonAncestor)(currentResponderIdPath, eventIdPath);
if (lowestCommonAncestor != null) {
var indexOfLowestCommonAncestor = eventIdPath.indexOf(lowestCommonAncestor);
// Skip the current responder so it doesn't receive unexpected "shouldSet" events.
var index = indexOfLowestCommonAncestor + (lowestCommonAncestor === currentResponder.id ? 1 : 0);
eventPaths = {
idPath: eventIdPath.slice(index),
nodePath: eventPaths.nodePath.slice(index)
};
} else {
eventPaths = null;
}
}
if (eventPaths != null) {
// If a node wants to become the responder, attempt to transfer.
wantsResponder = findWantsResponder(eventPaths, domEvent, responderEvent);
if (wantsResponder != null) {
// Sets responder if none exists, or negotates with existing responder.
attemptTransfer(responderEvent, wantsResponder);
wasNegotiated = true;
}
}
}
// If there is now a responder, invoke its callbacks for the lifecycle of the gesture.
if (currentResponder.id != null && currentResponder.node != null) {
var _currentResponder = currentResponder,
id = _currentResponder.id,
node = _currentResponder.node;
var _getResponderConfig = getResponderConfig(id),
onResponderStart = _getResponderConfig.onResponderStart,
onResponderMove = _getResponderConfig.onResponderMove,
onResponderEnd = _getResponderConfig.onResponderEnd,
onResponderRelease = _getResponderConfig.onResponderRelease,
onResponderTerminate = _getResponderConfig.onResponderTerminate,
onResponderTerminationRequest = _getResponderConfig.onResponderTerminationRequest;
responderEvent.bubbles = false;
responderEvent.cancelable = false;
responderEvent.currentTarget = node;
// Start
if (isStartEvent) {
if (onResponderStart != null) {
responderEvent.dispatchConfig.registrationName = 'onResponderStart';
onResponderStart(responderEvent);
}
}
// Move
else if (isMoveEvent) {
if (onResponderMove != null) {
responderEvent.dispatchConfig.registrationName = 'onResponderMove';
onResponderMove(responderEvent);
}
} else {
var isTerminateEvent = (0, _ResponderEventTypes.isCancelish)(eventType) ||
// native context menu
eventType === 'contextmenu' ||
// window blur
eventType === 'blur' && eventTarget === window ||
// responder (or ancestors) blur
eventType === 'blur' && eventTarget.contains(node) && domEvent.relatedTarget !== node ||
// native scroll without using a pointer
isScrollEvent && trackedTouchCount === 0 ||
// native scroll on node that is parent of the responder (allow siblings to scroll)
isScrollEvent && eventTarget.contains(node) && eventTarget !== node ||
// native select/selectionchange on node
isSelectionChangeEvent && (0, _utils.hasValidSelection)(domEvent);
var isReleaseEvent = isEndEvent && !isTerminateEvent && !(0, _utils.hasTargetTouches)(node, domEvent.touches);
// End
if (isEndEvent) {
if (onResponderEnd != null) {
responderEvent.dispatchConfig.registrationName = 'onResponderEnd';
onResponderEnd(responderEvent);
}
}
// Release
if (isReleaseEvent) {
if (onResponderRelease != null) {
responderEvent.dispatchConfig.registrationName = 'onResponderRelease';
onResponderRelease(responderEvent);
}
changeCurrentResponder(emptyResponder);
}
// Terminate
if (isTerminateEvent) {
var shouldTerminate = true;
// Responders can still avoid termination but only for these events.
if (eventType === 'contextmenu' || eventType === 'scroll' || eventType === 'selectionchange') {
// Only call this function is it wasn't already called during negotiation.
if (wasNegotiated) {
shouldTerminate = false;
} else if (onResponderTerminationRequest != null) {
responderEvent.dispatchConfig.registrationName = 'onResponderTerminationRequest';
if (onResponderTerminationRequest(responderEvent) === false) {
shouldTerminate = false;
}
}
}
if (shouldTerminate) {
if (onResponderTerminate != null) {
responderEvent.dispatchConfig.registrationName = 'onResponderTerminate';
onResponderTerminate(responderEvent);
}
changeCurrentResponder(emptyResponder);
isEmulatingMouseEvents = false;
trackedTouchCount = 0;
}
}
}
}
}
/**
* Walk the event path to/from the target node. At each node, stop and call the
* relevant "shouldSet" functions for the given event type. If any of those functions
* call "stopPropagation" on the event, stop searching for a responder.
*/
function findWantsResponder(eventPaths, domEvent, responderEvent) {
var shouldSetCallbacks = shouldSetResponderEvents[domEvent.type]; // for Flow
if (shouldSetCallbacks != null) {
var idPath = eventPaths.idPath,
nodePath = eventPaths.nodePath;
var shouldSetCallbackCaptureName = shouldSetCallbacks[0];
var shouldSetCallbackBubbleName = shouldSetCallbacks[1];
var bubbles = shouldSetCallbacks[2].bubbles;
var check = function check(id, node, callbackName) {
var config = getResponderConfig(id);
var shouldSetCallback = config[callbackName];
if (shouldSetCallback != null) {
responderEvent.currentTarget = node;
if (shouldSetCallback(responderEvent) === true) {
// Start the path from the potential responder
var prunedIdPath = idPath.slice(idPath.indexOf(id));
return {
id,
node,
idPath: prunedIdPath
};
}
}
};
// capture
for (var i = idPath.length - 1; i >= 0; i--) {
var id = idPath[i];
var node = nodePath[i];
var result = check(id, node, shouldSetCallbackCaptureName);
if (result != null) {
return result;
}
if (responderEvent.isPropagationStopped() === true) {
return;
}
}
// bubble
if (bubbles) {
for (var _i = 0; _i < idPath.length; _i++) {
var _id = idPath[_i];
var _node = nodePath[_i];
var _result = check(_id, _node, shouldSetCallbackBubbleName);
if (_result != null) {
return _result;
}
if (responderEvent.isPropagationStopped() === true) {
return;
}
}
} else {
var _id2 = idPath[0];
var _node2 = nodePath[0];
var target = domEvent.target;
if (target === _node2) {
return check(_id2, _node2, shouldSetCallbackBubbleName);
}
}
}
}
/**
* Attempt to transfer the responder.
*/
function attemptTransfer(responderEvent, wantsResponder) {
var _currentResponder2 = currentResponder,
currentId = _currentResponder2.id,
currentNode = _currentResponder2.node;
var id = wantsResponder.id,
node = wantsResponder.node;
var _getResponderConfig2 = getResponderConfig(id),
onResponderGrant = _getResponderConfig2.onResponderGrant,
onResponderReject = _getResponderConfig2.onResponderReject;
responderEvent.bubbles = false;
responderEvent.cancelable = false;
responderEvent.currentTarget = node;
// Set responder
if (currentId == null) {
if (onResponderGrant != null) {
responderEvent.currentTarget = node;
responderEvent.dispatchConfig.registrationName = 'onResponderGrant';
onResponderGrant(responderEvent);
}
changeCurrentResponder(wantsResponder);
}
// Negotiate with current responder
else {
var _getResponderConfig3 = getResponderConfig(currentId),
onResponderTerminate = _getResponderConfig3.onResponderTerminate,
onResponderTerminationRequest = _getResponderConfig3.onResponderTerminationRequest;
var allowTransfer = true;
if (onResponderTerminationRequest != null) {
responderEvent.currentTarget = currentNode;
responderEvent.dispatchConfig.registrationName = 'onResponderTerminationRequest';
if (onResponderTerminationRequest(responderEvent) === false) {
allowTransfer = false;
}
}
if (allowTransfer) {
// Terminate existing responder
if (onResponderTerminate != null) {
responderEvent.currentTarget = currentNode;
responderEvent.dispatchConfig.registrationName = 'onResponderTerminate';
onResponderTerminate(responderEvent);
}
// Grant next responder
if (onResponderGrant != null) {
responderEvent.currentTarget = node;
responderEvent.dispatchConfig.registrationName = 'onResponderGrant';
onResponderGrant(responderEvent);
}
changeCurrentResponder(wantsResponder);
} else {
// Reject responder request
if (onResponderReject != null) {
responderEvent.currentTarget = node;
responderEvent.dispatchConfig.registrationName = 'onResponderReject';
onResponderReject(responderEvent);
}
}
}
}
/* ------------ PUBLIC API ------------ */
/**
* Attach Listeners
*
* Use native events as ReactDOM doesn't have a non-plugin API to implement
* this system.
*/
var documentEventsCapturePhase = ['blur', 'scroll'];
var documentEventsBubblePhase = [
// mouse
'mousedown', 'mousemove', 'mouseup', 'dragstart',
// touch
'touchstart', 'touchmove', 'touchend', 'touchcancel',
// other
'contextmenu', 'select', 'selectionchange'];
function attachListeners() {
if (_canUseDom.default && window.__reactResponderSystemActive == null) {
window.addEventListener('blur', eventListener);
documentEventsBubblePhase.forEach(eventType => {
document.addEventListener(eventType, eventListener);
});
documentEventsCapturePhase.forEach(eventType => {
document.addEventListener(eventType, eventListener, true);
});
window.__reactResponderSystemActive = true;
}
}
/**
* Register a node with the ResponderSystem.
*/
function addNode(id, node, config) {
(0, _utils.setResponderId)(node, id);
responderListenersMap.set(id, config);
}
/**
* Unregister a node with the ResponderSystem.
*/
function removeNode(id) {
if (currentResponder.id === id) {
terminateResponder();
}
if (responderListenersMap.has(id)) {
responderListenersMap.delete(id);
}
}
/**
* Allow the current responder to be terminated from within components to support
* more complex requirements, such as use with other React libraries for working
* with scroll views, input views, etc.
*/
function terminateResponder() {
var _currentResponder3 = currentResponder,
id = _currentResponder3.id,
node = _currentResponder3.node;
if (id != null && node != null) {
var _getResponderConfig4 = getResponderConfig(id),
onResponderTerminate = _getResponderConfig4.onResponderTerminate;
if (onResponderTerminate != null) {
var event = (0, _createResponderEvent.default)({}, responderTouchHistoryStore);
event.currentTarget = node;
onResponderTerminate(event);
}
changeCurrentResponder(emptyResponder);
}
isEmulatingMouseEvents = false;
trackedTouchCount = 0;
}
/**
* Allow unit tests to inspect the current responder in the system.
* FOR TESTING ONLY.
*/
function getResponderNode() {
return currentResponder.node;
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useResponderEvents/ResponderTouchHistoryStore.js
"use strict";
exports.__esModule = true;
exports.ResponderTouchHistoryStore = void 0;
var _ResponderEventTypes = require("./ResponderEventTypes");
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* Tracks the position and time of each active touch by `touch.identifier`. We
* should typically only see IDs in the range of 1-20 because IDs get recycled
* when touches end and start again.
*/
var __DEV__ = process.env.NODE_ENV !== 'production';
var MAX_TOUCH_BANK = 20;
function timestampForTouch(touch) {
// The legacy internal implementation provides "timeStamp", which has been
// renamed to "timestamp".
return touch.timeStamp || touch.timestamp;
}
/**
* TODO: Instead of making gestures recompute filtered velocity, we could
* include a built in velocity computation that can be reused globally.
*/
function createTouchRecord(touch) {
return {
touchActive: true,
startPageX: touch.pageX,
startPageY: touch.pageY,
startTimeStamp: timestampForTouch(touch),
currentPageX: touch.pageX,
currentPageY: touch.pageY,
currentTimeStamp: timestampForTouch(touch),
previousPageX: touch.pageX,
previousPageY: touch.pageY,
previousTimeStamp: timestampForTouch(touch)
};
}
function resetTouchRecord(touchRecord, touch) {
touchRecord.touchActive = true;
touchRecord.startPageX = touch.pageX;
touchRecord.startPageY = touch.pageY;
touchRecord.startTimeStamp = timestampForTouch(touch);
touchRecord.currentPageX = touch.pageX;
touchRecord.currentPageY = touch.pageY;
touchRecord.currentTimeStamp = timestampForTouch(touch);
touchRecord.previousPageX = touch.pageX;
touchRecord.previousPageY = touch.pageY;
touchRecord.previousTimeStamp = timestampForTouch(touch);
}
function getTouchIdentifier(_ref) {
var identifier = _ref.identifier;
if (identifier == null) {
console.error('Touch object is missing identifier.');
}
if (__DEV__) {
if (identifier > MAX_TOUCH_BANK) {
console.error('Touch identifier %s is greater than maximum supported %s which causes ' + 'performance issues backfilling array locations for all of the indices.', identifier, MAX_TOUCH_BANK);
}
}
return identifier;
}
function recordTouchStart(touch, touchHistory) {
var identifier = getTouchIdentifier(touch);
var touchRecord = touchHistory.touchBank[identifier];
if (touchRecord) {
resetTouchRecord(touchRecord, touch);
} else {
touchHistory.touchBank[identifier] = createTouchRecord(touch);
}
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
}
function recordTouchMove(touch, touchHistory) {
var touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
if (touchRecord) {
touchRecord.touchActive = true;
touchRecord.previousPageX = touchRecord.currentPageX;
touchRecord.previousPageY = touchRecord.currentPageY;
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
touchRecord.currentPageX = touch.pageX;
touchRecord.currentPageY = touch.pageY;
touchRecord.currentTimeStamp = timestampForTouch(touch);
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
} else {
console.warn('Cannot record touch move without a touch start.\n', "Touch Move: " + printTouch(touch) + "\n", "Touch Bank: " + printTouchBank(touchHistory));
}
}
function recordTouchEnd(touch, touchHistory) {
var touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
if (touchRecord) {
touchRecord.touchActive = false;
touchRecord.previousPageX = touchRecord.currentPageX;
touchRecord.previousPageY = touchRecord.currentPageY;
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
touchRecord.currentPageX = touch.pageX;
touchRecord.currentPageY = touch.pageY;
touchRecord.currentTimeStamp = timestampForTouch(touch);
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
} else {
console.warn('Cannot record touch end without a touch start.\n', "Touch End: " + printTouch(touch) + "\n", "Touch Bank: " + printTouchBank(touchHistory));
}
}
function printTouch(touch) {
return JSON.stringify({
identifier: touch.identifier,
pageX: touch.pageX,
pageY: touch.pageY,
timestamp: timestampForTouch(touch)
});
}
function printTouchBank(touchHistory) {
var touchBank = touchHistory.touchBank;
var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
if (touchBank.length > MAX_TOUCH_BANK) {
printed += ' (original size: ' + touchBank.length + ')';
}
return printed;
}
class ResponderTouchHistoryStore {
constructor() {
this._touchHistory = {
touchBank: [],
//Array<TouchRecord>
numberActiveTouches: 0,
// If there is only one active touch, we remember its location. This prevents
// us having to loop through all of the touches all the time in the most
// common case.
indexOfSingleActiveTouch: -1,
mostRecentTimeStamp: 0
};
}
recordTouchTrack(topLevelType, nativeEvent) {
var touchHistory = this._touchHistory;
if ((0, _ResponderEventTypes.isMoveish)(topLevelType)) {
nativeEvent.changedTouches.forEach(touch => recordTouchMove(touch, touchHistory));
} else if ((0, _ResponderEventTypes.isStartish)(topLevelType)) {
nativeEvent.changedTouches.forEach(touch => recordTouchStart(touch, touchHistory));
touchHistory.numberActiveTouches = nativeEvent.touches.length;
if (touchHistory.numberActiveTouches === 1) {
touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier;
}
} else if ((0, _ResponderEventTypes.isEndish)(topLevelType)) {
nativeEvent.changedTouches.forEach(touch => recordTouchEnd(touch, touchHistory));
touchHistory.numberActiveTouches = nativeEvent.touches.length;
if (touchHistory.numberActiveTouches === 1) {
var touchBank = touchHistory.touchBank;
for (var i = 0; i < touchBank.length; i++) {
var touchTrackToCheck = touchBank[i];
if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {
touchHistory.indexOfSingleActiveTouch = i;
break;
}
}
if (__DEV__) {
var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];
if (!(activeRecord != null && activeRecord.touchActive)) {
console.error('Cannot find single active touch.');
}
}
}
}
}
get touchHistory() {
return this._touchHistory;
}
}
exports.ResponderTouchHistoryStore = ResponderTouchHistoryStore;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useResponderEvents/createResponderEvent.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = createResponderEvent;
var _getBoundingClientRect = _interopRequireDefault(require("../../modules/getBoundingClientRect"));
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var emptyFunction = () => {};
var emptyObject = {};
var emptyArray = [];
/**
* Safari produces very large identifiers that would cause the `touchBank` array
* length to be so large as to crash the browser, if not normalized like this.
* In the future the `touchBank` should use an object/map instead.
*/
function normalizeIdentifier(identifier) {
return identifier > 20 ? identifier % 20 : identifier;
}
/**
* Converts a native DOM event to a ResponderEvent.
* Mouse events are transformed into fake touch events.
*/
function createResponderEvent(domEvent, responderTouchHistoryStore) {
var rect;
var propagationWasStopped = false;
var changedTouches;
var touches;
var domEventChangedTouches = domEvent.changedTouches;
var domEventType = domEvent.type;
var metaKey = domEvent.metaKey === true;
var shiftKey = domEvent.shiftKey === true;
var force = domEventChangedTouches && domEventChangedTouches[0].force || 0;
var identifier = normalizeIdentifier(domEventChangedTouches && domEventChangedTouches[0].identifier || 0);
var clientX = domEventChangedTouches && domEventChangedTouches[0].clientX || domEvent.clientX;
var clientY = domEventChangedTouches && domEventChangedTouches[0].clientY || domEvent.clientY;
var pageX = domEventChangedTouches && domEventChangedTouches[0].pageX || domEvent.pageX;
var pageY = domEventChangedTouches && domEventChangedTouches[0].pageY || domEvent.pageY;
var preventDefault = typeof domEvent.preventDefault === 'function' ? domEvent.preventDefault.bind(domEvent) : emptyFunction;
var timestamp = domEvent.timeStamp;
function normalizeTouches(touches) {
return Array.prototype.slice.call(touches).map(touch => {
return {
force: touch.force,
identifier: normalizeIdentifier(touch.identifier),
get locationX() {
return locationX(touch.clientX);
},
get locationY() {
return locationY(touch.clientY);
},
pageX: touch.pageX,
pageY: touch.pageY,
target: touch.target,
timestamp
};
});
}
if (domEventChangedTouches != null) {
changedTouches = normalizeTouches(domEventChangedTouches);
touches = normalizeTouches(domEvent.touches);
} else {
var emulatedTouches = [{
force,
identifier,
get locationX() {
return locationX(clientX);
},
get locationY() {
return locationY(clientY);
},
pageX,
pageY,
target: domEvent.target,
timestamp
}];
changedTouches = emulatedTouches;
touches = domEventType === 'mouseup' || domEventType === 'dragstart' ? emptyArray : emulatedTouches;
}
var responderEvent = {
bubbles: true,
cancelable: true,
// `currentTarget` is set before dispatch
currentTarget: null,
defaultPrevented: domEvent.defaultPrevented,
dispatchConfig: emptyObject,
eventPhase: domEvent.eventPhase,
isDefaultPrevented() {
return domEvent.defaultPrevented;
},
isPropagationStopped() {
return propagationWasStopped;
},
isTrusted: domEvent.isTrusted,
nativeEvent: {
altKey: false,
ctrlKey: false,
metaKey,
shiftKey,
changedTouches,
force,
identifier,
get locationX() {
return locationX(clientX);
},
get locationY() {
return locationY(clientY);
},
pageX,
pageY,
target: domEvent.target,
timestamp,
touches,
type: domEventType
},
persist: emptyFunction,
preventDefault,
stopPropagation() {
propagationWasStopped = true;
},
target: domEvent.target,
timeStamp: timestamp,
touchHistory: responderTouchHistoryStore.touchHistory
};
// Using getters and functions serves two purposes:
// 1) The value of `currentTarget` is not initially available.
// 2) Measuring the clientRect may cause layout jank and should only be done on-demand.
function locationX(x) {
rect = rect || (0, _getBoundingClientRect.default)(responderEvent.currentTarget);
if (rect) {
return x - rect.left;
}
}
function locationY(y) {
rect = rect || (0, _getBoundingClientRect.default)(responderEvent.currentTarget);
if (rect) {
return y - rect.top;
}
}
return responderEvent;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useResponderEvents/index.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = useResponderEvents;
var React = _interopRequireWildcard(require("react"));
var ResponderSystem = _interopRequireWildcard(require("./ResponderSystem"));
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
/**
* Hook for integrating the Responder System into React
*
* function SomeComponent({ onStartShouldSetResponder }) {
* const ref = useRef(null);
* useResponderEvents(ref, { onStartShouldSetResponder });
* return <div ref={ref} />
* }
*/
var emptyObject = {};
var idCounter = 0;
function useStable(getInitialValue) {
var ref = React.useRef(null);
if (ref.current == null) {
ref.current = getInitialValue();
}
return ref.current;
}
function useResponderEvents(hostRef, config) {
if (config === void 0) {
config = emptyObject;
}
var id = useStable(() => idCounter++);
var isAttachedRef = React.useRef(false);
// This is a separate effects so it doesn't run when the config changes.
// On initial mount, attach global listeners if needed.
// On unmount, remove node potentially attached to the Responder System.
React.useEffect(() => {
ResponderSystem.attachListeners();
return () => {
ResponderSystem.removeNode(id);
};
}, [id]);
// Register and unregister with the Responder System as necessary
React.useEffect(() => {
var _config = config,
onMoveShouldSetResponder = _config.onMoveShouldSetResponder,
onMoveShouldSetResponderCapture = _config.onMoveShouldSetResponderCapture,
onScrollShouldSetResponder = _config.onScrollShouldSetResponder,
onScrollShouldSetResponderCapture = _config.onScrollShouldSetResponderCapture,
onSelectionChangeShouldSetResponder = _config.onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture = _config.onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder = _config.onStartShouldSetResponder,
onStartShouldSetResponderCapture = _config.onStartShouldSetResponderCapture;
var requiresResponderSystem = onMoveShouldSetResponder != null || onMoveShouldSetResponderCapture != null || onScrollShouldSetResponder != null || onScrollShouldSetResponderCapture != null || onSelectionChangeShouldSetResponder != null || onSelectionChangeShouldSetResponderCapture != null || onStartShouldSetResponder != null || onStartShouldSetResponderCapture != null;
var node = hostRef.current;
if (requiresResponderSystem) {
ResponderSystem.addNode(id, node, config);
isAttachedRef.current = true;
} else if (isAttachedRef.current) {
ResponderSystem.removeNode(id);
isAttachedRef.current = false;
}
}, [config, hostRef, id]);
React.useDebugValue({
isResponder: hostRef.current === ResponderSystem.getResponderNode()
});
React.useDebugValue(config);
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useResponderEvents/utils.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.getLowestCommonAncestor = getLowestCommonAncestor;
exports.getResponderPaths = getResponderPaths;
exports.hasTargetTouches = hasTargetTouches;
exports.hasValidSelection = hasValidSelection;
exports.isPrimaryPointerDown = isPrimaryPointerDown;
exports.setResponderId = setResponderId;
var _isSelectionValid = _interopRequireDefault(require("../../modules/isSelectionValid"));
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var keyName = '__reactResponderId';
function getEventPath(domEvent) {
// The 'selectionchange' event always has the 'document' as the target.
// Use the anchor node as the initial target to reconstruct a path.
// (We actually only need the first "responder" node in practice.)
if (domEvent.type === 'selectionchange') {
var target = window.getSelection().anchorNode;
return composedPathFallback(target);
} else {
var path = domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
return path;
}
}
function composedPathFallback(target) {
var path = [];
while (target != null && target !== document.body) {
path.push(target);
target = target.parentNode;
}
return path;
}
/**
* Retrieve the responderId from a host node
*/
function getResponderId(node) {
if (node != null) {
return node[keyName];
}
return null;
}
/**
* Store the responderId on a host node
*/
function setResponderId(node, id) {
if (node != null) {
node[keyName] = id;
}
}
/**
* Filter the event path to contain only the nodes attached to the responder system
*/
function getResponderPaths(domEvent) {
var idPath = [];
var nodePath = [];
var eventPath = getEventPath(domEvent);
for (var i = 0; i < eventPath.length; i++) {
var node = eventPath[i];
var id = getResponderId(node);
if (id != null) {
idPath.push(id);
nodePath.push(node);
}
}
return {
idPath,
nodePath
};
}
/**
* Walk the paths and find the first common ancestor
*/
function getLowestCommonAncestor(pathA, pathB) {
var pathALength = pathA.length;
var pathBLength = pathB.length;
if (
// If either path is empty
pathALength === 0 || pathBLength === 0 ||
// If the last elements aren't the same there can't be a common ancestor
// that is connected to the responder system
pathA[pathALength - 1] !== pathB[pathBLength - 1]) {
return null;
}
var itemA = pathA[0];
var indexA = 0;
var itemB = pathB[0];
var indexB = 0;
// If A is deeper, skip indices that can't match.
if (pathALength - pathBLength > 0) {
indexA = pathALength - pathBLength;
itemA = pathA[indexA];
pathALength = pathBLength;
}
// If B is deeper, skip indices that can't match
if (pathBLength - pathALength > 0) {
indexB = pathBLength - pathALength;
itemB = pathB[indexB];
pathBLength = pathALength;
}
// Walk in lockstep until a match is found
var depth = pathALength;
while (depth--) {
if (itemA === itemB) {
return itemA;
}
itemA = pathA[indexA++];
itemB = pathB[indexB++];
}
return null;
}
/**
* Determine whether any of the active touches are within the current responder.
* This cannot rely on W3C `targetTouches`, as neither IE11 nor Safari implement it.
*/
function hasTargetTouches(target, touches) {
if (!touches || touches.length === 0) {
return false;
}
for (var i = 0; i < touches.length; i++) {
var node = touches[i].target;
if (node != null) {
if (target.contains(node)) {
return true;
}
}
}
return false;
}
/**
* Ignore 'selectionchange' events that don't correspond with a person's intent to
* select text.
*/
function hasValidSelection(domEvent) {
if (domEvent.type === 'selectionchange') {
return (0, _isSelectionValid.default)();
}
return domEvent.type === 'select';
}
/**
* Events are only valid if the primary button was used without specific modifier keys.
*/
function isPrimaryPointerDown(domEvent) {
var altKey = domEvent.altKey,
button = domEvent.button,
buttons = domEvent.buttons,
ctrlKey = domEvent.ctrlKey,
type = domEvent.type;
var isTouch = type === 'touchstart' || type === 'touchmove';
var isPrimaryMouseDown = type === 'mousedown' && (button === 0 || buttons === 1);
var isPrimaryMouseMove = type === 'mousemove' && buttons === 1;
var noModifiers = altKey === false && ctrlKey === false;
if (isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers) {
return true;
}
return false;
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/useStable/index.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = useStable;
var React = _interopRequireWildcard(require("react"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var UNINITIALIZED = typeof Symbol === 'function' && typeof Symbol() === 'symbol' ? Symbol() : Object.freeze({});
function useStable(getInitialValue) {
var ref = React.useRef(UNINITIALIZED);
if (ref.current === UNINITIALIZED) {
ref.current = getInitialValue();
}
// $FlowFixMe (#64650789) Trouble refining types where `Symbol` is concerned.
return ref.current;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/modules/warnOnce/index.js
"use strict";
exports.__esModule = true;
exports.warnOnce = warnOnce;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
var warnedKeys = {};
/**
* A simple function that prints a warning message once per session.
*
* @param {string} key - The key used to ensure the message is printed once.
* This should be unique to the callsite.
* @param {string} message - The message to print
*/
function warnOnce(key, message) {
if (process.env.NODE_ENV !== 'production') {
if (warnedKeys[key]) {
return;
}
console.warn(message);
warnedKeys[key] = true;
}
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/Animated.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _Platform = _interopRequireDefault(require("../../../exports/Platform"));
var _AnimatedFlatList = _interopRequireDefault(require("./components/AnimatedFlatList"));
var _AnimatedImage = _interopRequireDefault(require("./components/AnimatedImage"));
var _AnimatedScrollView = _interopRequireDefault(require("./components/AnimatedScrollView"));
var _AnimatedSectionList = _interopRequireDefault(require("./components/AnimatedSectionList"));
var _AnimatedText = _interopRequireDefault(require("./components/AnimatedText"));
var _AnimatedView = _interopRequireDefault(require("./components/AnimatedView"));
var _AnimatedMock = _interopRequireDefault(require("./AnimatedMock"));
var _AnimatedImplementation = _interopRequireDefault(require("./AnimatedImplementation"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
var Animated = _Platform.default.isTesting ? _AnimatedMock.default : _AnimatedImplementation.default;
var _default = (0, _objectSpread2.default)({
FlatList: _AnimatedFlatList.default,
Image: _AnimatedImage.default,
ScrollView: _AnimatedScrollView.default,
SectionList: _AnimatedSectionList.default,
Text: _AnimatedText.default,
View: _AnimatedView.default
}, Animated);
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedEvent.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.AnimatedEvent = void 0;
exports.attachNativeEvent = attachNativeEvent;
var _AnimatedValue = _interopRequireDefault(require("./nodes/AnimatedValue"));
var _NativeAnimatedHelper = _interopRequireWildcard(require("./NativeAnimatedHelper"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var __DEV__ = process.env.NODE_ENV !== 'production';
function attachNativeEvent(viewRef, eventName, argMapping) {
// Find animated values in `argMapping` and create an array representing their
// key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x'].
var eventMappings = [];
var traverse = (value, path) => {
if (value instanceof _AnimatedValue.default) {
value.__makeNative();
eventMappings.push({
nativeEventPath: path,
animatedValueTag: value.__getNativeTag()
});
} else if (typeof value === 'object') {
for (var _key in value) {
traverse(value[_key], path.concat(_key));
}
}
};
(0, _invariant.default)(argMapping[0] && argMapping[0].nativeEvent, 'Native driven events only support animated values contained inside `nativeEvent`.');
// Assume that the event containing `nativeEvent` is always the first argument.
traverse(argMapping[0].nativeEvent, []);
if (viewRef != null) {
eventMappings.forEach(mapping => {
_NativeAnimatedHelper.default.API.addAnimatedEventToView(viewRef, eventName, mapping);
});
}
return {
detach() {
if (viewRef != null) {
eventMappings.forEach(mapping => {
_NativeAnimatedHelper.default.API.removeAnimatedEventFromView(viewRef, eventName,
// $FlowFixMe[incompatible-call]
mapping.animatedValueTag);
});
}
}
};
}
function validateMapping(argMapping, args) {
var validate = (recMapping, recEvt, key) => {
if (recMapping instanceof _AnimatedValue.default) {
(0, _invariant.default)(typeof recEvt === 'number', 'Bad mapping of event key ' + key + ', should be number but got ' + typeof recEvt);
return;
}
if (typeof recEvt === 'number') {
(0, _invariant.default)(recMapping instanceof _AnimatedValue.default, 'Bad mapping of type ' + typeof recMapping + ' for key ' + key + ', event value must map to AnimatedValue');
return;
}
(0, _invariant.default)(typeof recMapping === 'object', 'Bad mapping of type ' + typeof recMapping + ' for key ' + key);
(0, _invariant.default)(typeof recEvt === 'object', 'Bad event of type ' + typeof recEvt + ' for key ' + key);
for (var mappingKey in recMapping) {
validate(recMapping[mappingKey], recEvt[mappingKey], mappingKey);
}
};
(0, _invariant.default)(args.length >= argMapping.length, 'Event has less arguments than mapping');
argMapping.forEach((mapping, idx) => {
validate(mapping, args[idx], 'arg' + idx);
});
}
class AnimatedEvent {
constructor(argMapping, config) {
this._listeners = [];
this._argMapping = argMapping;
if (config == null) {
console.warn('Animated.event now requires a second argument for options');
config = {
useNativeDriver: false
};
}
if (config.listener) {
this.__addListener(config.listener);
}
this._callListeners = this._callListeners.bind(this);
this._attachedEvent = null;
this.__isNative = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(config);
}
__addListener(callback) {
this._listeners.push(callback);
}
__removeListener(callback) {
this._listeners = this._listeners.filter(listener => listener !== callback);
}
__attach(viewRef, eventName) {
(0, _invariant.default)(this.__isNative, 'Only native driven events need to be attached.');
this._attachedEvent = attachNativeEvent(viewRef, eventName, this._argMapping);
}
__detach(viewTag, eventName) {
(0, _invariant.default)(this.__isNative, 'Only native driven events need to be detached.');
this._attachedEvent && this._attachedEvent.detach();
}
__getHandler() {
var _this = this;
if (this.__isNative) {
if (__DEV__) {
var _validatedMapping = false;
return function () {
for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
args[_key2] = arguments[_key2];
}
if (!_validatedMapping) {
validateMapping(_this._argMapping, args);
_validatedMapping = true;
}
_this._callListeners(...args);
};
} else {
return this._callListeners;
}
}
var validatedMapping = false;
return function () {
for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
args[_key3] = arguments[_key3];
}
if (__DEV__ && !validatedMapping) {
validateMapping(_this._argMapping, args);
validatedMapping = true;
}
var traverse = (recMapping, recEvt, key) => {
if (recMapping instanceof _AnimatedValue.default) {
if (typeof recEvt === 'number') {
recMapping.setValue(recEvt);
}
} else if (typeof recMapping === 'object') {
for (var mappingKey in recMapping) {
/* $FlowFixMe(>=0.120.0) This comment suppresses an error found
* when Flow v0.120 was deployed. To see the error, delete this
* comment and run Flow. */
traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);
}
}
};
_this._argMapping.forEach((mapping, idx) => {
traverse(mapping, args[idx], 'arg' + idx);
});
_this._callListeners(...args);
};
}
_callListeners() {
for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
args[_key4] = arguments[_key4];
}
this._listeners.forEach(listener => listener(...args));
}
}
exports.AnimatedEvent = AnimatedEvent;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedImplementation.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _AnimatedEvent = require("./AnimatedEvent");
var _AnimatedAddition = _interopRequireDefault(require("./nodes/AnimatedAddition"));
var _AnimatedDiffClamp = _interopRequireDefault(require("./nodes/AnimatedDiffClamp"));
var _AnimatedDivision = _interopRequireDefault(require("./nodes/AnimatedDivision"));
var _AnimatedInterpolation = _interopRequireDefault(require("./nodes/AnimatedInterpolation"));
var _AnimatedModulo = _interopRequireDefault(require("./nodes/AnimatedModulo"));
var _AnimatedMultiplication = _interopRequireDefault(require("./nodes/AnimatedMultiplication"));
var _AnimatedNode = _interopRequireDefault(require("./nodes/AnimatedNode"));
var _AnimatedProps = _interopRequireDefault(require("./nodes/AnimatedProps"));
var _AnimatedSubtraction = _interopRequireDefault(require("./nodes/AnimatedSubtraction"));
var _AnimatedTracking = _interopRequireDefault(require("./nodes/AnimatedTracking"));
var _AnimatedValue = _interopRequireDefault(require("./nodes/AnimatedValue"));
var _AnimatedValueXY = _interopRequireDefault(require("./nodes/AnimatedValueXY"));
var _DecayAnimation = _interopRequireDefault(require("./animations/DecayAnimation"));
var _SpringAnimation = _interopRequireDefault(require("./animations/SpringAnimation"));
var _TimingAnimation = _interopRequireDefault(require("./animations/TimingAnimation"));
var _createAnimatedComponent = _interopRequireDefault(require("./createAnimatedComponent"));
var _AnimatedColor = _interopRequireDefault(require("./nodes/AnimatedColor"));
var add = function add(a, b) {
return new _AnimatedAddition.default(a, b);
};
var subtract = function subtract(a, b) {
return new _AnimatedSubtraction.default(a, b);
};
var divide = function divide(a, b) {
return new _AnimatedDivision.default(a, b);
};
var multiply = function multiply(a, b) {
return new _AnimatedMultiplication.default(a, b);
};
var modulo = function modulo(a, modulus) {
return new _AnimatedModulo.default(a, modulus);
};
var diffClamp = function diffClamp(a, min, max) {
return new _AnimatedDiffClamp.default(a, min, max);
};
var _combineCallbacks = function _combineCallbacks(callback, config) {
if (callback && config.onComplete) {
return function () {
config.onComplete && config.onComplete(...arguments);
callback && callback(...arguments);
};
} else {
return callback || config.onComplete;
}
};
var maybeVectorAnim = function maybeVectorAnim(value, config, anim) {
if (value instanceof _AnimatedValueXY.default) {
var configX = (0, _objectSpread2.default)({}, config);
var configY = (0, _objectSpread2.default)({}, config);
for (var key in config) {
var _config$key = config[key],
x = _config$key.x,
y = _config$key.y;
if (x !== undefined && y !== undefined) {
configX[key] = x;
configY[key] = y;
}
}
var aX = anim(value.x, configX);
var aY = anim(value.y, configY);
// We use `stopTogether: false` here because otherwise tracking will break
// because the second animation will get stopped before it can update.
return parallel([aX, aY], {
stopTogether: false
});
} else if (value instanceof _AnimatedColor.default) {
var configR = (0, _objectSpread2.default)({}, config);
var configG = (0, _objectSpread2.default)({}, config);
var configB = (0, _objectSpread2.default)({}, config);
var configA = (0, _objectSpread2.default)({}, config);
for (var _key in config) {
var _config$_key = config[_key],
r = _config$_key.r,
g = _config$_key.g,
b = _config$_key.b,
a = _config$_key.a;
if (r !== undefined && g !== undefined && b !== undefined && a !== undefined) {
configR[_key] = r;
configG[_key] = g;
configB[_key] = b;
configA[_key] = a;
}
}
var aR = anim(value.r, configR);
var aG = anim(value.g, configG);
var aB = anim(value.b, configB);
var aA = anim(value.a, configA);
// We use `stopTogether: false` here because otherwise tracking will break
// because the second animation will get stopped before it can update.
return parallel([aR, aG, aB, aA], {
stopTogether: false
});
}
return null;
};
var spring = function spring(value, config) {
var _start = function start(animatedValue, configuration, callback) {
callback = _combineCallbacks(callback, configuration);
var singleValue = animatedValue;
var singleConfig = configuration;
singleValue.stopTracking();
if (configuration.toValue instanceof _AnimatedNode.default) {
singleValue.track(new _AnimatedTracking.default(singleValue, configuration.toValue, _SpringAnimation.default, singleConfig, callback));
} else {
singleValue.animate(new _SpringAnimation.default(singleConfig), callback);
}
};
return maybeVectorAnim(value, config, spring) || {
start: function start(callback) {
_start(value, config, callback);
},
stop: function stop() {
value.stopAnimation();
},
reset: function reset() {
value.resetAnimation();
},
_startNativeLoop: function _startNativeLoop(iterations) {
var singleConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
iterations
});
_start(value, singleConfig);
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return config.useNativeDriver || false;
}
};
};
var timing = function timing(value, config) {
var _start2 = function start(animatedValue, configuration, callback) {
callback = _combineCallbacks(callback, configuration);
var singleValue = animatedValue;
var singleConfig = configuration;
singleValue.stopTracking();
if (configuration.toValue instanceof _AnimatedNode.default) {
singleValue.track(new _AnimatedTracking.default(singleValue, configuration.toValue, _TimingAnimation.default, singleConfig, callback));
} else {
singleValue.animate(new _TimingAnimation.default(singleConfig), callback);
}
};
return maybeVectorAnim(value, config, timing) || {
start: function start(callback) {
_start2(value, config, callback);
},
stop: function stop() {
value.stopAnimation();
},
reset: function reset() {
value.resetAnimation();
},
_startNativeLoop: function _startNativeLoop(iterations) {
var singleConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
iterations
});
_start2(value, singleConfig);
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return config.useNativeDriver || false;
}
};
};
var decay = function decay(value, config) {
var _start3 = function start(animatedValue, configuration, callback) {
callback = _combineCallbacks(callback, configuration);
var singleValue = animatedValue;
var singleConfig = configuration;
singleValue.stopTracking();
singleValue.animate(new _DecayAnimation.default(singleConfig), callback);
};
return maybeVectorAnim(value, config, decay) || {
start: function start(callback) {
_start3(value, config, callback);
},
stop: function stop() {
value.stopAnimation();
},
reset: function reset() {
value.resetAnimation();
},
_startNativeLoop: function _startNativeLoop(iterations) {
var singleConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
iterations
});
_start3(value, singleConfig);
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return config.useNativeDriver || false;
}
};
};
var sequence = function sequence(animations) {
var current = 0;
return {
start: function start(callback) {
var onComplete = function onComplete(result) {
if (!result.finished) {
callback && callback(result);
return;
}
current++;
if (current === animations.length) {
callback && callback(result);
return;
}
animations[current].start(onComplete);
};
if (animations.length === 0) {
callback && callback({
finished: true
});
} else {
animations[current].start(onComplete);
}
},
stop: function stop() {
if (current < animations.length) {
animations[current].stop();
}
},
reset: function reset() {
animations.forEach((animation, idx) => {
if (idx <= current) {
animation.reset();
}
});
current = 0;
},
_startNativeLoop: function _startNativeLoop() {
throw new Error('Loops run using the native driver cannot contain Animated.sequence animations');
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return false;
}
};
};
var parallel = function parallel(animations, config) {
var doneCount = 0;
// Make sure we only call stop() at most once for each animation
var hasEnded = {};
var stopTogether = !(config && config.stopTogether === false);
var result = {
start: function start(callback) {
if (doneCount === animations.length) {
callback && callback({
finished: true
});
return;
}
animations.forEach((animation, idx) => {
var cb = function cb(endResult) {
hasEnded[idx] = true;
doneCount++;
if (doneCount === animations.length) {
doneCount = 0;
callback && callback(endResult);
return;
}
if (!endResult.finished && stopTogether) {
result.stop();
}
};
if (!animation) {
cb({
finished: true
});
} else {
animation.start(cb);
}
});
},
stop: function stop() {
animations.forEach((animation, idx) => {
!hasEnded[idx] && animation.stop();
hasEnded[idx] = true;
});
},
reset: function reset() {
animations.forEach((animation, idx) => {
animation.reset();
hasEnded[idx] = false;
doneCount = 0;
});
},
_startNativeLoop: function _startNativeLoop() {
throw new Error('Loops run using the native driver cannot contain Animated.parallel animations');
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return false;
}
};
return result;
};
var delay = function delay(time) {
// Would be nice to make a specialized implementation
return timing(new _AnimatedValue.default(0), {
toValue: 0,
delay: time,
duration: 0,
useNativeDriver: false
});
};
var stagger = function stagger(time, animations) {
return parallel(animations.map((animation, i) => {
return sequence([delay(time * i), animation]);
}));
};
var loop = function loop(animation, // $FlowFixMe[prop-missing]
_temp) {
var _ref = _temp === void 0 ? {} : _temp,
_ref$iterations = _ref.iterations,
iterations = _ref$iterations === void 0 ? -1 : _ref$iterations,
_ref$resetBeforeItera = _ref.resetBeforeIteration,
resetBeforeIteration = _ref$resetBeforeItera === void 0 ? true : _ref$resetBeforeItera;
var isFinished = false;
var iterationsSoFar = 0;
return {
start: function start(callback) {
var restart = function restart(result) {
if (result === void 0) {
result = {
finished: true
};
}
if (isFinished || iterationsSoFar === iterations || result.finished === false) {
callback && callback(result);
} else {
iterationsSoFar++;
resetBeforeIteration && animation.reset();
animation.start(restart);
}
};
if (!animation || iterations === 0) {
callback && callback({
finished: true
});
} else {
if (animation._isUsingNativeDriver()) {
animation._startNativeLoop(iterations);
} else {
restart(); // Start looping recursively on the js thread
}
}
},
stop: function stop() {
isFinished = true;
animation.stop();
},
reset: function reset() {
iterationsSoFar = 0;
isFinished = false;
animation.reset();
},
_startNativeLoop: function _startNativeLoop() {
throw new Error('Loops run using the native driver cannot contain Animated.loop animations');
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return animation._isUsingNativeDriver();
}
};
};
function forkEvent(event, listener) {
if (!event) {
return listener;
} else if (event instanceof _AnimatedEvent.AnimatedEvent) {
event.__addListener(listener);
return event;
} else {
return function () {
typeof event === 'function' && event(...arguments);
listener(...arguments);
};
}
}
function unforkEvent(event, listener) {
if (event && event instanceof _AnimatedEvent.AnimatedEvent) {
event.__removeListener(listener);
}
}
var event = function event(argMapping, config) {
var animatedEvent = new _AnimatedEvent.AnimatedEvent(argMapping, config);
if (animatedEvent.__isNative) {
return animatedEvent;
} else {
return animatedEvent.__getHandler();
}
};
// All types of animated nodes that represent scalar numbers and can be interpolated (etc)
/**
* The `Animated` library is designed to make animations fluid, powerful, and
* easy to build and maintain. `Animated` focuses on declarative relationships
* between inputs and outputs, with configurable transforms in between, and
* simple `start`/`stop` methods to control time-based animation execution.
* If additional transforms are added, be sure to include them in
* AnimatedMock.js as well.
*
* See https://reactnative.dev/docs/animated
*/
var _default = {
/**
* Standard value class for driving animations. Typically initialized with
* `new Animated.Value(0);`
*
* See https://reactnative.dev/docs/animated#value
*/
Value: _AnimatedValue.default,
/**
* 2D value class for driving 2D animations, such as pan gestures.
*
* See https://reactnative.dev/docs/animatedvaluexy
*/
ValueXY: _AnimatedValueXY.default,
/**
* Value class for driving color animations.
*/
Color: _AnimatedColor.default,
/**
* Exported to use the Interpolation type in flow.
*
* See https://reactnative.dev/docs/animated#interpolation
*/
Interpolation: _AnimatedInterpolation.default,
/**
* Exported for ease of type checking. All animated values derive from this
* class.
*
* See https://reactnative.dev/docs/animated#node
*/
Node: _AnimatedNode.default,
/**
* Animates a value from an initial velocity to zero based on a decay
* coefficient.
*
* See https://reactnative.dev/docs/animated#decay
*/
decay,
/**
* Animates a value along a timed easing curve. The Easing module has tons of
* predefined curves, or you can use your own function.
*
* See https://reactnative.dev/docs/animated#timing
*/
timing,
/**
* Animates a value according to an analytical spring model based on
* damped harmonic oscillation.
*
* See https://reactnative.dev/docs/animated#spring
*/
spring,
/**
* Creates a new Animated value composed from two Animated values added
* together.
*
* See https://reactnative.dev/docs/animated#add
*/
add,
/**
* Creates a new Animated value composed by subtracting the second Animated
* value from the first Animated value.
*
* See https://reactnative.dev/docs/animated#subtract
*/
subtract,
/**
* Creates a new Animated value composed by dividing the first Animated value
* by the second Animated value.
*
* See https://reactnative.dev/docs/animated#divide
*/
divide,
/**
* Creates a new Animated value composed from two Animated values multiplied
* together.
*
* See https://reactnative.dev/docs/animated#multiply
*/
multiply,
/**
* Creates a new Animated value that is the (non-negative) modulo of the
* provided Animated value.
*
* See https://reactnative.dev/docs/animated#modulo
*/
modulo,
/**
* Create a new Animated value that is limited between 2 values. It uses the
* difference between the last value so even if the value is far from the
* bounds it will start changing when the value starts getting closer again.
*
* See https://reactnative.dev/docs/animated#diffclamp
*/
diffClamp,
/**
* Starts an animation after the given delay.
*
* See https://reactnative.dev/docs/animated#delay
*/
delay,
/**
* Starts an array of animations in order, waiting for each to complete
* before starting the next. If the current running animation is stopped, no
* following animations will be started.
*
* See https://reactnative.dev/docs/animated#sequence
*/
sequence,
/**
* Starts an array of animations all at the same time. By default, if one
* of the animations is stopped, they will all be stopped. You can override
* this with the `stopTogether` flag.
*
* See https://reactnative.dev/docs/animated#parallel
*/
parallel,
/**
* Array of animations may run in parallel (overlap), but are started in
* sequence with successive delays. Nice for doing trailing effects.
*
* See https://reactnative.dev/docs/animated#stagger
*/
stagger,
/**
* Loops a given animation continuously, so that each time it reaches the
* end, it resets and begins again from the start.
*
* See https://reactnative.dev/docs/animated#loop
*/
loop,
/**
* Takes an array of mappings and extracts values from each arg accordingly,
* then calls `setValue` on the mapped outputs.
*
* See https://reactnative.dev/docs/animated#event
*/
event,
/**
* Make any React component Animatable. Used to create `Animated.View`, etc.
*
* See https://reactnative.dev/docs/animated#createanimatedcomponent
*/
createAnimatedComponent: _createAnimatedComponent.default,
/**
* Imperative API to attach an animated value to an event on a view. Prefer
* using `Animated.event` with `useNativeDrive: true` if possible.
*
* See https://reactnative.dev/docs/animated#attachnativeevent
*/
attachNativeEvent: _AnimatedEvent.attachNativeEvent,
/**
* Advanced imperative API for snooping on animated events that are passed in
* through props. Use values directly where possible.
*
* See https://reactnative.dev/docs/animated#forkevent
*/
forkEvent,
unforkEvent,
/**
* Expose Event class, so it can be used as a type for type checkers.
*/
Event: _AnimatedEvent.AnimatedEvent
};
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/AnimatedMock.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _AnimatedEvent = require("./AnimatedEvent");
var _AnimatedImplementation = _interopRequireDefault(require("./AnimatedImplementation"));
var _AnimatedInterpolation = _interopRequireDefault(require("./nodes/AnimatedInterpolation"));
var _AnimatedNode = _interopRequireDefault(require("./nodes/AnimatedNode"));
var _AnimatedValue = _interopRequireDefault(require("./nodes/AnimatedValue"));
var _AnimatedValueXY = _interopRequireDefault(require("./nodes/AnimatedValueXY"));
var _createAnimatedComponent = _interopRequireDefault(require("./createAnimatedComponent"));
var _AnimatedColor = _interopRequireDefault(require("./nodes/AnimatedColor"));
/**
* Animations are a source of flakiness in snapshot testing. This mock replaces
* animation functions from AnimatedImplementation with empty animations for
* predictability in tests. When possible the animation will run immediately
* to the final state.
*/
// Prevent any callback invocation from recursively triggering another
// callback, which may trigger another animation
var inAnimationCallback = false;
function mockAnimationStart(start) {
return callback => {
var guardedCallback = callback == null ? callback : function () {
if (inAnimationCallback) {
console.warn('Ignoring recursive animation callback when running mock animations');
return;
}
inAnimationCallback = true;
try {
callback(...arguments);
} finally {
inAnimationCallback = false;
}
};
start(guardedCallback);
};
}
var emptyAnimation = {
start: () => {},
stop: () => {},
reset: () => {},
_startNativeLoop: () => {},
_isUsingNativeDriver: () => {
return false;
}
};
var mockCompositeAnimation = animations => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, emptyAnimation), {}, {
start: mockAnimationStart(callback => {
animations.forEach(animation => animation.start());
callback == null ? void 0 : callback({
finished: true
});
})
});
var spring = function spring(value, config) {
var anyValue = value;
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, emptyAnimation), {}, {
start: mockAnimationStart(callback => {
anyValue.setValue(config.toValue);
callback == null ? void 0 : callback({
finished: true
});
})
});
};
var timing = function timing(value, config) {
var anyValue = value;
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, emptyAnimation), {}, {
start: mockAnimationStart(callback => {
anyValue.setValue(config.toValue);
callback == null ? void 0 : callback({
finished: true
});
})
});
};
var decay = function decay(value, config) {
return emptyAnimation;
};
var sequence = function sequence(animations) {
return mockCompositeAnimation(animations);
};
var parallel = function parallel(animations, config) {
return mockCompositeAnimation(animations);
};
var delay = function delay(time) {
return emptyAnimation;
};
var stagger = function stagger(time, animations) {
return mockCompositeAnimation(animations);
};
var loop = function loop(animation, // $FlowFixMe[prop-missing]
_temp) {
var _ref = _temp === void 0 ? {} : _temp,
_ref$iterations = _ref.iterations,
iterations = _ref$iterations === void 0 ? -1 : _ref$iterations;
return emptyAnimation;
};
var _default = {
Value: _AnimatedValue.default,
ValueXY: _AnimatedValueXY.default,
Color: _AnimatedColor.default,
Interpolation: _AnimatedInterpolation.default,
Node: _AnimatedNode.default,
decay,
timing,
spring,
add: _AnimatedImplementation.default.add,
subtract: _AnimatedImplementation.default.subtract,
divide: _AnimatedImplementation.default.divide,
multiply: _AnimatedImplementation.default.multiply,
modulo: _AnimatedImplementation.default.modulo,
diffClamp: _AnimatedImplementation.default.diffClamp,
delay,
sequence,
parallel,
stagger,
loop,
event: _AnimatedImplementation.default.event,
createAnimatedComponent: _createAnimatedComponent.default,
attachNativeEvent: _AnimatedEvent.attachNativeEvent,
forkEvent: _AnimatedImplementation.default.forkEvent,
unforkEvent: _AnimatedImplementation.default.unforkEvent,
Event: _AnimatedEvent.AnimatedEvent
};
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/Easing.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _bezier2 = _interopRequireDefault(require("./bezier"));
var ease;
/**
* The `Easing` module implements common easing functions. This module is used
* by [Animate.timing()](docs/animate.html#timing) to convey physically
* believable motion in animations.
*
* You can find a visualization of some common easing functions at
* http://easings.net/
*
* ### Predefined animations
*
* The `Easing` module provides several predefined animations through the
* following methods:
*
* - [`back`](docs/easing.html#back) provides a simple animation where the
* object goes slightly back before moving forward
* - [`bounce`](docs/easing.html#bounce) provides a bouncing animation
* - [`ease`](docs/easing.html#ease) provides a simple inertial animation
* - [`elastic`](docs/easing.html#elastic) provides a simple spring interaction
*
* ### Standard functions
*
* Three standard easing functions are provided:
*
* - [`linear`](docs/easing.html#linear)
* - [`quad`](docs/easing.html#quad)
* - [`cubic`](docs/easing.html#cubic)
*
* The [`poly`](docs/easing.html#poly) function can be used to implement
* quartic, quintic, and other higher power functions.
*
* ### Additional functions
*
* Additional mathematical functions are provided by the following methods:
*
* - [`bezier`](docs/easing.html#bezier) provides a cubic bezier curve
* - [`circle`](docs/easing.html#circle) provides a circular function
* - [`sin`](docs/easing.html#sin) provides a sinusoidal function
* - [`exp`](docs/easing.html#exp) provides an exponential function
*
* The following helpers are used to modify other easing functions.
*
* - [`in`](docs/easing.html#in) runs an easing function forwards
* - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical
* - [`out`](docs/easing.html#out) runs an easing function backwards
*/
class Easing {
/**
* A stepping function, returns 1 for any positive value of `n`.
*/
static step0(n) {
return n > 0 ? 1 : 0;
}
/**
* A stepping function, returns 1 if `n` is greater than or equal to 1.
*/
static step1(n) {
return n >= 1 ? 1 : 0;
}
/**
* A linear function, `f(t) = t`. Position correlates to elapsed time one to
* one.
*
* http://cubic-bezier.com/#0,0,1,1
*/
static linear(t) {
return t;
}
/**
* A simple inertial interaction, similar to an object slowly accelerating to
* speed.
*
* http://cubic-bezier.com/#.42,0,1,1
*/
static ease(t) {
if (!ease) {
ease = Easing.bezier(0.42, 0, 1, 1);
}
return ease(t);
}
/**
* A quadratic function, `f(t) = t * t`. Position equals the square of elapsed
* time.
*
* http://easings.net/#easeInQuad
*/
static quad(t) {
return t * t;
}
/**
* A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed
* time.
*
* http://easings.net/#easeInCubic
*/
static cubic(t) {
return t * t * t;
}
/**
* A power function. Position is equal to the Nth power of elapsed time.
*
* n = 4: http://easings.net/#easeInQuart
* n = 5: http://easings.net/#easeInQuint
*/
static poly(n) {
return t => Math.pow(t, n);
}
/**
* A sinusoidal function.
*
* http://easings.net/#easeInSine
*/
static sin(t) {
return 1 - Math.cos(t * Math.PI / 2);
}
/**
* A circular function.
*
* http://easings.net/#easeInCirc
*/
static circle(t) {
return 1 - Math.sqrt(1 - t * t);
}
/**
* An exponential function.
*
* http://easings.net/#easeInExpo
*/
static exp(t) {
return Math.pow(2, 10 * (t - 1));
}
/**
* A simple elastic interaction, similar to a spring oscillating back and
* forth.
*
* Default bounciness is 1, which overshoots a little bit once. 0 bounciness
* doesn't overshoot at all, and bounciness of N > 1 will overshoot about N
* times.
*
* http://easings.net/#easeInElastic
*/
static elastic(bounciness) {
if (bounciness === void 0) {
bounciness = 1;
}
var p = bounciness * Math.PI;
return t => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p);
}
/**
* Use with `Animated.parallel()` to create a simple effect where the object
* animates back slightly as the animation starts.
*
* Wolfram Plot:
*
* - http://tiny.cc/back_default (s = 1.70158, default)
*/
static back(s) {
if (s === void 0) {
s = 1.70158;
}
return t => t * t * ((s + 1) * t - s);
}
/**
* Provides a simple bouncing effect.
*
* http://easings.net/#easeInBounce
*/
static bounce(t) {
if (t < 1 / 2.75) {
return 7.5625 * t * t;
}
if (t < 2 / 2.75) {
var _t = t - 1.5 / 2.75;
return 7.5625 * _t * _t + 0.75;
}
if (t < 2.5 / 2.75) {
var _t2 = t - 2.25 / 2.75;
return 7.5625 * _t2 * _t2 + 0.9375;
}
var t2 = t - 2.625 / 2.75;
return 7.5625 * t2 * t2 + 0.984375;
}
/**
* Provides a cubic bezier curve, equivalent to CSS Transitions'
* `transition-timing-function`.
*
* A useful tool to visualize cubic bezier curves can be found at
* http://cubic-bezier.com/
*/
static bezier(x1, y1, x2, y2) {
return (0, _bezier2.default)(x1, y1, x2, y2);
}
/**
* Runs an easing function forwards.
*/
static in(easing) {
return easing;
}
/**
* Runs an easing function backwards.
*/
static out(easing) {
return t => 1 - easing(1 - t);
}
/**
* Makes any easing function symmetrical. The easing function will run
* forwards for half of the duration, then backwards for the rest of the
* duration.
*/
static inOut(easing) {
return t => {
if (t < 0.5) {
return easing(t * 2) / 2;
}
return 1 - easing((1 - t) * 2) / 2;
};
}
}
var _default = Easing;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/NativeAnimatedHelper.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.API = void 0;
exports.addWhitelistedInterpolationParam = addWhitelistedInterpolationParam;
exports.addWhitelistedStyleProp = addWhitelistedStyleProp;
exports.addWhitelistedTransformProp = addWhitelistedTransformProp;
exports.assertNativeAnimatedModule = assertNativeAnimatedModule;
exports.default = void 0;
exports.generateNewAnimationId = generateNewAnimationId;
exports.generateNewNodeTag = generateNewNodeTag;
exports.isSupportedColorStyleProp = isSupportedColorStyleProp;
exports.isSupportedInterpolationParam = isSupportedInterpolationParam;
exports.isSupportedStyleProp = isSupportedStyleProp;
exports.isSupportedTransformProp = isSupportedTransformProp;
exports.shouldUseNativeDriver = shouldUseNativeDriver;
exports.transformDataType = transformDataType;
exports.validateInterpolation = validateInterpolation;
exports.validateStyles = validateStyles;
exports.validateTransform = validateTransform;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _NativeAnimatedModule = _interopRequireDefault(require("./NativeAnimatedModule"));
var _NativeAnimatedTurboModule = _interopRequireDefault(require("./NativeAnimatedTurboModule"));
var _NativeEventEmitter = _interopRequireDefault(require("../EventEmitter/NativeEventEmitter"));
var _Platform = _interopRequireDefault(require("../Utilities/Platform"));
var _ReactNativeFeatureFlags = _interopRequireDefault(require("../ReactNative/ReactNativeFeatureFlags"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _RCTDeviceEventEmitter = _interopRequireDefault(require("../EventEmitter/RCTDeviceEventEmitter"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
// TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%.
var NativeAnimatedModule = _Platform.default.OS === 'ios' && global.RN$Bridgeless === true ? _NativeAnimatedTurboModule.default : _NativeAnimatedModule.default;
var __nativeAnimatedNodeTagCount = 1; /* used for animated nodes */
var __nativeAnimationIdCount = 1; /* used for started animations */
var nativeEventEmitter;
var waitingForQueuedOperations = new Set();
var queueOperations = false;
var queue = [];
// $FlowFixMe
var singleOpQueue = [];
var useSingleOpBatching = false;
_Platform.default.OS === 'android' && !!(NativeAnimatedModule != null && NativeAnimatedModule.queueAndExecuteBatchedOperations) && _ReactNativeFeatureFlags.default.animatedShouldUseSingleOp();
var flushQueueTimeout = null;
var eventListenerGetValueCallbacks = {};
var eventListenerAnimationFinishedCallbacks = {};
var globalEventEmitterGetValueListener = null;
var globalEventEmitterAnimationFinishedListener = null;
var nativeOps = useSingleOpBatching ? function () {
var apis = ['createAnimatedNode',
// 1
'updateAnimatedNodeConfig',
// 2
'getValue',
// 3
'startListeningToAnimatedNodeValue',
// 4
'stopListeningToAnimatedNodeValue',
// 5
'connectAnimatedNodes',
// 6
'disconnectAnimatedNodes',
// 7
'startAnimatingNode',
// 8
'stopAnimation',
// 9
'setAnimatedNodeValue',
// 10
'setAnimatedNodeOffset',
// 11
'flattenAnimatedNodeOffset',
// 12
'extractAnimatedNodeOffset',
// 13
'connectAnimatedNodeToView',
// 14
'disconnectAnimatedNodeFromView',
// 15
'restoreDefaultValues',
// 16
'dropAnimatedNode',
// 17
'addAnimatedEventToView',
// 18
'removeAnimatedEventFromView',
// 19
'addListener',
// 20
'removeListener' // 21
];
return apis.reduce((acc, functionName, i) => {
// These indices need to be kept in sync with the indices in native (see NativeAnimatedModule in Java, or the equivalent for any other native platform).
// $FlowFixMe[prop-missing]
acc[functionName] = i + 1;
return acc;
}, {});
}() : NativeAnimatedModule;
/**
* Wrappers around NativeAnimatedModule to provide flow and autocomplete support for
* the native module methods, and automatic queue management on Android
*/
var API = {
getValue: function getValue(tag, saveValueCallback) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
if (useSingleOpBatching) {
if (saveValueCallback) {
eventListenerGetValueCallbacks[tag] = saveValueCallback;
}
// $FlowFixMe
API.queueOperation(nativeOps.getValue, tag);
} else {
API.queueOperation(nativeOps.getValue, tag, saveValueCallback);
}
},
setWaitingForIdentifier: function setWaitingForIdentifier(id) {
waitingForQueuedOperations.add(id);
queueOperations = true;
if (_ReactNativeFeatureFlags.default.animatedShouldDebounceQueueFlush() && flushQueueTimeout) {
clearTimeout(flushQueueTimeout);
}
},
unsetWaitingForIdentifier: function unsetWaitingForIdentifier(id) {
waitingForQueuedOperations.delete(id);
if (waitingForQueuedOperations.size === 0) {
queueOperations = false;
API.disableQueue();
}
},
disableQueue: function disableQueue() {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
if (_ReactNativeFeatureFlags.default.animatedShouldDebounceQueueFlush()) {
var prevTimeout = flushQueueTimeout;
clearImmediate(prevTimeout);
flushQueueTimeout = setImmediate(API.flushQueue);
} else {
API.flushQueue();
}
},
flushQueue: function flushQueue() {
/*
invariant(NativeAnimatedModule, 'Native animated module is not available');
flushQueueTimeout = null;
// Early returns before calling any APIs
if (useSingleOpBatching && singleOpQueue.length === 0) {
return;
}
if (!useSingleOpBatching && queue.length === 0) {
return;
}
if (useSingleOpBatching) {
// Set up event listener for callbacks if it's not set up
if (
!globalEventEmitterGetValueListener ||
!globalEventEmitterAnimationFinishedListener
) {
setupGlobalEventEmitterListeners();
}
// Single op batching doesn't use callback functions, instead we
// use RCTDeviceEventEmitter. This reduces overhead of sending lots of
// JSI functions across to native code; but also, TM infrastructure currently
// does not support packing a function into native arrays.
NativeAnimatedModule.queueAndExecuteBatchedOperations?.(singleOpQueue);
singleOpQueue.length = 0;
} else {
Platform.OS === 'android' && NativeAnimatedModule.startOperationBatch?.();
for (let q = 0, l = queue.length; q < l; q++) {
queue[q]();
}
queue.length = 0;
Platform.OS === 'android' &&
NativeAnimatedModule.finishOperationBatch?.();
}
*/
},
queueOperation: function queueOperation(fn) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (useSingleOpBatching) {
// Get the command ID from the queued function, and push that ID and any arguments needed to execute the operation
// $FlowFixMe: surprise, fn is actually a number
singleOpQueue.push(fn, ...args);
return;
}
// If queueing is explicitly on, *or* the queue has not yet
// been flushed, use the queue. This is to prevent operations
// from being executed out of order.
if (queueOperations || queue.length !== 0) {
queue.push(() => fn(...args));
} else {
fn(...args);
}
},
createAnimatedNode: function createAnimatedNode(tag, config) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.createAnimatedNode, tag, config);
},
updateAnimatedNodeConfig: function updateAnimatedNodeConfig(tag, config) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
//if (nativeOps.updateAnimatedNodeConfig) {
// API.queueOperation(nativeOps.updateAnimatedNodeConfig, tag, config);
//}
},
startListeningToAnimatedNodeValue: function startListeningToAnimatedNodeValue(tag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.startListeningToAnimatedNodeValue, tag);
},
stopListeningToAnimatedNodeValue: function stopListeningToAnimatedNodeValue(tag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.stopListeningToAnimatedNodeValue, tag);
},
connectAnimatedNodes: function connectAnimatedNodes(parentTag, childTag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.connectAnimatedNodes, parentTag, childTag);
},
disconnectAnimatedNodes: function disconnectAnimatedNodes(parentTag, childTag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.disconnectAnimatedNodes, parentTag, childTag);
},
startAnimatingNode: function startAnimatingNode(animationId, nodeTag, config, endCallback) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
if (useSingleOpBatching) {
if (endCallback) {
eventListenerAnimationFinishedCallbacks[animationId] = endCallback;
}
// $FlowFixMe
API.queueOperation(nativeOps.startAnimatingNode, animationId, nodeTag, config);
} else {
API.queueOperation(nativeOps.startAnimatingNode, animationId, nodeTag, config, endCallback);
}
},
stopAnimation: function stopAnimation(animationId) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.stopAnimation, animationId);
},
setAnimatedNodeValue: function setAnimatedNodeValue(nodeTag, value) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.setAnimatedNodeValue, nodeTag, value);
},
setAnimatedNodeOffset: function setAnimatedNodeOffset(nodeTag, offset) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.setAnimatedNodeOffset, nodeTag, offset);
},
flattenAnimatedNodeOffset: function flattenAnimatedNodeOffset(nodeTag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.flattenAnimatedNodeOffset, nodeTag);
},
extractAnimatedNodeOffset: function extractAnimatedNodeOffset(nodeTag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.extractAnimatedNodeOffset, nodeTag);
},
connectAnimatedNodeToView: function connectAnimatedNodeToView(nodeTag, viewTag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.connectAnimatedNodeToView, nodeTag, viewTag);
},
disconnectAnimatedNodeFromView: function disconnectAnimatedNodeFromView(nodeTag, viewTag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.disconnectAnimatedNodeFromView, nodeTag, viewTag);
},
restoreDefaultValues: function restoreDefaultValues(nodeTag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
// Backwards compat with older native runtimes, can be removed later.
if (nativeOps.restoreDefaultValues != null) {
API.queueOperation(nativeOps.restoreDefaultValues, nodeTag);
}
},
dropAnimatedNode: function dropAnimatedNode(tag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.dropAnimatedNode, tag);
},
addAnimatedEventToView: function addAnimatedEventToView(viewTag, eventName, eventMapping) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.addAnimatedEventToView, viewTag, eventName, eventMapping);
},
removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag) {
(0, _invariant.default)(nativeOps, 'Native animated module is not available');
API.queueOperation(nativeOps.removeAnimatedEventFromView, viewTag, eventName, animatedNodeTag);
}
};
exports.API = API;
function setupGlobalEventEmitterListeners() {
globalEventEmitterGetValueListener = _RCTDeviceEventEmitter.default.addListener('onNativeAnimatedModuleGetValue', function (params) {
var tag = params.tag;
var callback = eventListenerGetValueCallbacks[tag];
if (!callback) {
return;
}
callback(params.value);
delete eventListenerGetValueCallbacks[tag];
});
globalEventEmitterAnimationFinishedListener = _RCTDeviceEventEmitter.default.addListener('onNativeAnimatedModuleAnimationFinished', function (params) {
var animationId = params.animationId;
var callback = eventListenerAnimationFinishedCallbacks[animationId];
if (!callback) {
return;
}
callback(params);
delete eventListenerAnimationFinishedCallbacks[animationId];
});
}
/**
* Styles allowed by the native animated implementation.
*
* In general native animated implementation should support any numeric or color property that
* doesn't need to be updated through the shadow view hierarchy (all non-layout properties).
*/
var SUPPORTED_COLOR_STYLES = {
backgroundColor: true,
borderBottomColor: true,
borderColor: true,
borderEndColor: true,
borderLeftColor: true,
borderRightColor: true,
borderStartColor: true,
borderTopColor: true,
color: true,
tintColor: true
};
var SUPPORTED_STYLES = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, SUPPORTED_COLOR_STYLES), {}, {
borderBottomEndRadius: true,
borderBottomLeftRadius: true,
borderBottomRightRadius: true,
borderBottomStartRadius: true,
borderRadius: true,
borderTopEndRadius: true,
borderTopLeftRadius: true,
borderTopRightRadius: true,
borderTopStartRadius: true,
elevation: true,
opacity: true,
transform: true,
zIndex: true,
/* ios styles */
shadowOpacity: true,
shadowRadius: true,
/* legacy android transform properties */
scaleX: true,
scaleY: true,
translateX: true,
translateY: true
});
var SUPPORTED_TRANSFORMS = {
translateX: true,
translateY: true,
scale: true,
scaleX: true,
scaleY: true,
rotate: true,
rotateX: true,
rotateY: true,
rotateZ: true,
perspective: true
};
var SUPPORTED_INTERPOLATION_PARAMS = {
inputRange: true,
outputRange: true,
extrapolate: true,
extrapolateRight: true,
extrapolateLeft: true
};
function addWhitelistedStyleProp(prop) {
SUPPORTED_STYLES[prop] = true;
}
function addWhitelistedTransformProp(prop) {
SUPPORTED_TRANSFORMS[prop] = true;
}
function addWhitelistedInterpolationParam(param) {
SUPPORTED_INTERPOLATION_PARAMS[param] = true;
}
function isSupportedColorStyleProp(prop) {
return SUPPORTED_COLOR_STYLES.hasOwnProperty(prop);
}
function isSupportedStyleProp(prop) {
return SUPPORTED_STYLES.hasOwnProperty(prop);
}
function isSupportedTransformProp(prop) {
return SUPPORTED_TRANSFORMS.hasOwnProperty(prop);
}
function isSupportedInterpolationParam(param) {
return SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(param);
}
function validateTransform(configs) {
configs.forEach(config => {
if (!isSupportedTransformProp(config.property)) {
throw new Error("Property '" + config.property + "' is not supported by native animated module");
}
});
}
function validateStyles(styles) {
for (var _key2 in styles) {
if (!isSupportedStyleProp(_key2)) {
throw new Error("Style property '" + _key2 + "' is not supported by native animated module");
}
}
}
function validateInterpolation(config) {
for (var _key3 in config) {
if (!isSupportedInterpolationParam(_key3)) {
throw new Error("Interpolation property '" + _key3 + "' is not supported by native animated module");
}
}
}
function generateNewNodeTag() {
return __nativeAnimatedNodeTagCount++;
}
function generateNewAnimationId() {
return __nativeAnimationIdCount++;
}
function assertNativeAnimatedModule() {
(0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available');
}
var _warnedMissingNativeAnimated = false;
function shouldUseNativeDriver(config) {
if (config.useNativeDriver == null) {
console.warn('Animated: `useNativeDriver` was not specified. This is a required ' + 'option and must be explicitly set to `true` or `false`');
}
if (config.useNativeDriver === true && !NativeAnimatedModule) {
if (!_warnedMissingNativeAnimated) {
console.warn('Animated: `useNativeDriver` is not supported because the native ' + 'animated module is missing. Falling back to JS-based animation. To ' + 'resolve this, add `RCTAnimation` module to this app, or remove ' + '`useNativeDriver`. ' + 'Make sure to run `bundle exec pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md');
_warnedMissingNativeAnimated = true;
}
return false;
}
return config.useNativeDriver || false;
}
function transformDataType(value) {
// Change the string type to number type so we can reuse the same logic in
// iOS and Android platform
if (typeof value !== 'string') {
return value;
}
if (/deg$/.test(value)) {
var degrees = parseFloat(value) || 0;
var radians = degrees * Math.PI / 180.0;
return radians;
} else {
return value;
}
}
var _default = {
API,
isSupportedColorStyleProp,
isSupportedStyleProp,
isSupportedTransformProp,
isSupportedInterpolationParam,
addWhitelistedStyleProp,
addWhitelistedTransformProp,
addWhitelistedInterpolationParam,
validateStyles,
validateTransform,
validateInterpolation,
generateNewNodeTag,
generateNewAnimationId,
assertNativeAnimatedModule,
shouldUseNativeDriver,
transformDataType,
// $FlowExpectedError[unsafe-getters-setters] - unsafe getter lint suppresion
// $FlowExpectedError[missing-type-arg] - unsafe getter lint suppresion
get nativeEventEmitter() {
if (!nativeEventEmitter) {
nativeEventEmitter = new _NativeEventEmitter.default(
// T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior
// If you want to use the native module on other platforms, please remove this condition and test its behavior
_Platform.default.OS !== 'ios' ? null : NativeAnimatedModule);
}
return nativeEventEmitter;
}
};
exports.default = _default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/NativeAnimatedModule.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var TurboModuleRegistry = _interopRequireWildcard(require("../TurboModule/TurboModuleRegistry"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
var _default = TurboModuleRegistry.get('NativeAnimatedModule');
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/NativeAnimatedTurboModule.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var TurboModuleRegistry = _interopRequireWildcard(require("../TurboModule/TurboModuleRegistry"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
var _default = TurboModuleRegistry.get('NativeAnimatedTurboModule');
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/SpringConfig.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
*/
'use strict';
exports.__esModule = true;
exports.default = void 0;
function stiffnessFromOrigamiValue(oValue) {
return (oValue - 30) * 3.62 + 194;
}
function dampingFromOrigamiValue(oValue) {
return (oValue - 8) * 3 + 25;
}
function fromOrigamiTensionAndFriction(tension, friction) {
return {
stiffness: stiffnessFromOrigamiValue(tension),
damping: dampingFromOrigamiValue(friction)
};
}
function fromBouncinessAndSpeed(bounciness, speed) {
function normalize(value, startValue, endValue) {
return (value - startValue) / (endValue - startValue);
}
function projectNormal(n, start, end) {
return start + n * (end - start);
}
function linearInterpolation(t, start, end) {
return t * end + (1 - t) * start;
}
function quadraticOutInterpolation(t, start, end) {
return linearInterpolation(2 * t - t * t, start, end);
}
function b3Friction1(x) {
return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28;
}
function b3Friction2(x) {
return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2;
}
function b3Friction3(x) {
return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84;
}
function b3Nobounce(tension) {
if (tension <= 18) {
return b3Friction1(tension);
} else if (tension > 18 && tension <= 44) {
return b3Friction2(tension);
} else {
return b3Friction3(tension);
}
}
var b = normalize(bounciness / 1.7, 0, 20);
b = projectNormal(b, 0, 0.8);
var s = normalize(speed / 1.7, 0, 20);
var bouncyTension = projectNormal(s, 0.5, 200);
var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01);
return {
stiffness: stiffnessFromOrigamiValue(bouncyTension),
damping: dampingFromOrigamiValue(bouncyFriction)
};
}
var _default = {
fromOrigamiTensionAndFriction,
fromBouncinessAndSpeed
};
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/Animation.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _NativeAnimatedHelper = _interopRequireDefault(require("../NativeAnimatedHelper"));
var startNativeAnimationNextId = 1;
// Important note: start() and stop() will only be called at most once.
// Once an animation has been stopped or finished its course, it will
// not be reused.
class Animation {
start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {}
stop() {
if (this.__nativeId) {
_NativeAnimatedHelper.default.API.stopAnimation(this.__nativeId);
}
}
__getNativeAnimationConfig() {
// Subclasses that have corresponding animation implementation done in native
// should override this method
throw new Error('This animation type cannot be offloaded to native');
}
// Helper function for subclasses to make sure onEnd is only called once.
__debouncedOnEnd(result) {
var onEnd = this.__onEnd;
this.__onEnd = null;
onEnd && onEnd(result);
}
__startNativeAnimation(animatedValue) {
var startNativeAnimationWaitId = startNativeAnimationNextId + ":startAnimation";
startNativeAnimationNextId += 1;
_NativeAnimatedHelper.default.API.setWaitingForIdentifier(startNativeAnimationWaitId);
try {
var config = this.__getNativeAnimationConfig();
animatedValue.__makeNative(config.platformConfig);
this.__nativeId = _NativeAnimatedHelper.default.generateNewAnimationId();
_NativeAnimatedHelper.default.API.startAnimatingNode(this.__nativeId, animatedValue.__getNativeTag(), config,
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
this.__debouncedOnEnd.bind(this));
} catch (e) {
throw e;
} finally {
_NativeAnimatedHelper.default.API.unsetWaitingForIdentifier(startNativeAnimationWaitId);
}
}
}
var _default = Animation;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/DecayAnimation.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _Animation = _interopRequireDefault(require("./Animation"));
var _NativeAnimatedHelper = require("../NativeAnimatedHelper");
class DecayAnimation extends _Animation.default {
constructor(config) {
var _config$deceleration, _config$isInteraction, _config$iterations;
super();
this._deceleration = (_config$deceleration = config.deceleration) !== null && _config$deceleration !== void 0 ? _config$deceleration : 0.998;
this._velocity = config.velocity;
this._useNativeDriver = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(config);
this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !this._useNativeDriver;
this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;
}
__getNativeAnimationConfig() {
return {
type: 'decay',
deceleration: this._deceleration,
velocity: this._velocity,
iterations: this.__iterations
};
}
start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
this.__active = true;
this._lastValue = fromValue;
this._fromValue = fromValue;
this._onUpdate = onUpdate;
this.__onEnd = onEnd;
this._startTime = Date.now();
if (this._useNativeDriver) {
this.__startNativeAnimation(animatedValue);
} else {
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
}
}
onUpdate() {
var now = Date.now();
var value = this._fromValue + this._velocity / (1 - this._deceleration) * (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime)));
this._onUpdate(value);
if (Math.abs(this._lastValue - value) < 0.1) {
this.__debouncedOnEnd({
finished: true
});
return;
}
this._lastValue = value;
if (this.__active) {
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
}
}
stop() {
super.stop();
this.__active = false;
global.cancelAnimationFrame(this._animationFrame);
this.__debouncedOnEnd({
finished: false
});
}
}
var _default = DecayAnimation;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/SpringAnimation.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _Animation = _interopRequireDefault(require("./Animation"));
var _SpringConfig = _interopRequireDefault(require("../SpringConfig"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _NativeAnimatedHelper = require("../NativeAnimatedHelper");
var _AnimatedColor = _interopRequireDefault(require("../nodes/AnimatedColor"));
class SpringAnimation extends _Animation.default {
constructor(config) {
var _config$overshootClam, _config$restDisplacem, _config$restSpeedThre, _config$velocity, _config$velocity2, _config$delay, _config$isInteraction, _config$iterations;
super();
this._overshootClamping = (_config$overshootClam = config.overshootClamping) !== null && _config$overshootClam !== void 0 ? _config$overshootClam : false;
this._restDisplacementThreshold = (_config$restDisplacem = config.restDisplacementThreshold) !== null && _config$restDisplacem !== void 0 ? _config$restDisplacem : 0.001;
this._restSpeedThreshold = (_config$restSpeedThre = config.restSpeedThreshold) !== null && _config$restSpeedThre !== void 0 ? _config$restSpeedThre : 0.001;
this._initialVelocity = (_config$velocity = config.velocity) !== null && _config$velocity !== void 0 ? _config$velocity : 0;
this._lastVelocity = (_config$velocity2 = config.velocity) !== null && _config$velocity2 !== void 0 ? _config$velocity2 : 0;
this._toValue = config.toValue;
this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;
this._useNativeDriver = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(config);
this._platformConfig = config.platformConfig;
this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !this._useNativeDriver;
this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;
if (config.stiffness !== undefined || config.damping !== undefined || config.mass !== undefined) {
var _config$stiffness, _config$damping, _config$mass;
(0, _invariant.default)(config.bounciness === undefined && config.speed === undefined && config.tension === undefined && config.friction === undefined, 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');
this._stiffness = (_config$stiffness = config.stiffness) !== null && _config$stiffness !== void 0 ? _config$stiffness : 100;
this._damping = (_config$damping = config.damping) !== null && _config$damping !== void 0 ? _config$damping : 10;
this._mass = (_config$mass = config.mass) !== null && _config$mass !== void 0 ? _config$mass : 1;
} else if (config.bounciness !== undefined || config.speed !== undefined) {
var _config$bounciness, _config$speed;
// Convert the origami bounciness/speed values to stiffness/damping
// We assume mass is 1.
(0, _invariant.default)(config.tension === undefined && config.friction === undefined && config.stiffness === undefined && config.damping === undefined && config.mass === undefined, 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');
var springConfig = _SpringConfig.default.fromBouncinessAndSpeed((_config$bounciness = config.bounciness) !== null && _config$bounciness !== void 0 ? _config$bounciness : 8, (_config$speed = config.speed) !== null && _config$speed !== void 0 ? _config$speed : 12);
this._stiffness = springConfig.stiffness;
this._damping = springConfig.damping;
this._mass = 1;
} else {
var _config$tension, _config$friction;
// Convert the origami tension/friction values to stiffness/damping
// We assume mass is 1.
var _springConfig = _SpringConfig.default.fromOrigamiTensionAndFriction((_config$tension = config.tension) !== null && _config$tension !== void 0 ? _config$tension : 40, (_config$friction = config.friction) !== null && _config$friction !== void 0 ? _config$friction : 7);
this._stiffness = _springConfig.stiffness;
this._damping = _springConfig.damping;
this._mass = 1;
}
(0, _invariant.default)(this._stiffness > 0, 'Stiffness value must be greater than 0');
(0, _invariant.default)(this._damping > 0, 'Damping value must be greater than 0');
(0, _invariant.default)(this._mass > 0, 'Mass value must be greater than 0');
}
__getNativeAnimationConfig() {
var _this$_initialVelocit;
return {
type: 'spring',
overshootClamping: this._overshootClamping,
restDisplacementThreshold: this._restDisplacementThreshold,
restSpeedThreshold: this._restSpeedThreshold,
stiffness: this._stiffness,
damping: this._damping,
mass: this._mass,
initialVelocity: (_this$_initialVelocit = this._initialVelocity) !== null && _this$_initialVelocit !== void 0 ? _this$_initialVelocit : this._lastVelocity,
toValue: this._toValue,
iterations: this.__iterations,
platformConfig: this._platformConfig
};
}
start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
this.__active = true;
this._startPosition = fromValue;
this._lastPosition = this._startPosition;
this._onUpdate = onUpdate;
this.__onEnd = onEnd;
this._lastTime = Date.now();
this._frameTime = 0.0;
if (previousAnimation instanceof SpringAnimation) {
var internalState = previousAnimation.getInternalState();
this._lastPosition = internalState.lastPosition;
this._lastVelocity = internalState.lastVelocity;
// Set the initial velocity to the last velocity
this._initialVelocity = this._lastVelocity;
this._lastTime = internalState.lastTime;
}
var start = () => {
if (this._useNativeDriver) {
this.__startNativeAnimation(animatedValue);
} else {
this.onUpdate();
}
};
// If this._delay is more than 0, we start after the timeout.
if (this._delay) {
this._timeout = setTimeout(start, this._delay);
} else {
start();
}
}
getInternalState() {
return {
lastPosition: this._lastPosition,
lastVelocity: this._lastVelocity,
lastTime: this._lastTime
};
}
/**
* This spring model is based off of a damped harmonic oscillator
* (https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator).
*
* We use the closed form of the second order differential equation:
*
* x'' + (2ζ⍵_0)x' + ⍵^2x = 0
*
* where
* ⍵_0 = √(k / m) (undamped angular frequency of the oscillator),
* ζ = c / 2√mk (damping ratio),
* c = damping constant
* k = stiffness
* m = mass
*
* The derivation of the closed form is described in detail here:
* http://planetmath.org/sites/default/files/texpdf/39745.pdf
*
* This algorithm happens to match the algorithm used by CASpringAnimation,
* a QuartzCore (iOS) API that creates spring animations.
*/
onUpdate() {
// If for some reason we lost a lot of frames (e.g. process large payload or
// stopped in the debugger), we only advance by 4 frames worth of
// computation and will continue on the next frame. It's better to have it
// running at faster speed than jumping to the end.
var MAX_STEPS = 64;
var now = Date.now();
if (now > this._lastTime + MAX_STEPS) {
now = this._lastTime + MAX_STEPS;
}
var deltaTime = (now - this._lastTime) / 1000;
this._frameTime += deltaTime;
var c = this._damping;
var m = this._mass;
var k = this._stiffness;
var v0 = -this._initialVelocity;
var zeta = c / (2 * Math.sqrt(k * m)); // damping ratio
var omega0 = Math.sqrt(k / m); // undamped angular frequency of the oscillator (rad/ms)
var omega1 = omega0 * Math.sqrt(1.0 - zeta * zeta); // exponential decay
var x0 = this._toValue - this._startPosition; // calculate the oscillation from x0 = 1 to x = 0
var position = 0.0;
var velocity = 0.0;
var t = this._frameTime;
if (zeta < 1) {
// Under damped
var envelope = Math.exp(-zeta * omega0 * t);
position = this._toValue - envelope * ((v0 + zeta * omega0 * x0) / omega1 * Math.sin(omega1 * t) + x0 * Math.cos(omega1 * t));
// This looks crazy -- it's actually just the derivative of the
// oscillation function
velocity = zeta * omega0 * envelope * (Math.sin(omega1 * t) * (v0 + zeta * omega0 * x0) / omega1 + x0 * Math.cos(omega1 * t)) - envelope * (Math.cos(omega1 * t) * (v0 + zeta * omega0 * x0) - omega1 * x0 * Math.sin(omega1 * t));
} else {
// Critically damped
var _envelope = Math.exp(-omega0 * t);
position = this._toValue - _envelope * (x0 + (v0 + omega0 * x0) * t);
velocity = _envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0));
}
this._lastTime = now;
this._lastPosition = position;
this._lastVelocity = velocity;
this._onUpdate(position);
if (!this.__active) {
// a listener might have stopped us in _onUpdate
return;
}
// Conditions for stopping the spring animation
var isOvershooting = false;
if (this._overshootClamping && this._stiffness !== 0) {
if (this._startPosition < this._toValue) {
isOvershooting = position > this._toValue;
} else {
isOvershooting = position < this._toValue;
}
}
var isVelocity = Math.abs(velocity) <= this._restSpeedThreshold;
var isDisplacement = true;
if (this._stiffness !== 0) {
isDisplacement = Math.abs(this._toValue - position) <= this._restDisplacementThreshold;
}
if (isOvershooting || isVelocity && isDisplacement) {
if (this._stiffness !== 0) {
// Ensure that we end up with a round value
this._lastPosition = this._toValue;
this._lastVelocity = 0;
this._onUpdate(this._toValue);
}
this.__debouncedOnEnd({
finished: true
});
return;
}
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
}
stop() {
super.stop();
this.__active = false;
clearTimeout(this._timeout);
global.cancelAnimationFrame(this._animationFrame);
this.__debouncedOnEnd({
finished: false
});
}
}
var _default = SpringAnimation;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/animations/TimingAnimation.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedValue = _interopRequireDefault(require("../nodes/AnimatedValue"));
var _AnimatedValueXY = _interopRequireDefault(require("../nodes/AnimatedValueXY"));
var _AnimatedInterpolation = _interopRequireDefault(require("../nodes/AnimatedInterpolation"));
var _Easing = _interopRequireDefault(require("../../../../exports/Easing"));
var _Animation = _interopRequireDefault(require("./Animation"));
var _NativeAnimatedHelper = require("../NativeAnimatedHelper");
var _AnimatedColor = _interopRequireDefault(require("../nodes/AnimatedColor"));
var _easeInOut;
function easeInOut() {
if (!_easeInOut) {
_easeInOut = _Easing.default.inOut(_Easing.default.ease);
}
return _easeInOut;
}
class TimingAnimation extends _Animation.default {
constructor(config) {
var _config$easing, _config$duration, _config$delay, _config$iterations, _config$isInteraction;
super();
this._toValue = config.toValue;
this._easing = (_config$easing = config.easing) !== null && _config$easing !== void 0 ? _config$easing : easeInOut();
this._duration = (_config$duration = config.duration) !== null && _config$duration !== void 0 ? _config$duration : 500;
this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;
this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;
this._useNativeDriver = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(config);
this._platformConfig = config.platformConfig;
this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !this._useNativeDriver;
}
__getNativeAnimationConfig() {
var frameDuration = 1000.0 / 60.0;
var frames = [];
var numFrames = Math.round(this._duration / frameDuration);
for (var frame = 0; frame < numFrames; frame++) {
frames.push(this._easing(frame / numFrames));
}
frames.push(this._easing(1));
return {
type: 'frames',
frames,
toValue: this._toValue,
iterations: this.__iterations,
platformConfig: this._platformConfig
};
}
start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
this.__active = true;
this._fromValue = fromValue;
this._onUpdate = onUpdate;
this.__onEnd = onEnd;
var start = () => {
// Animations that sometimes have 0 duration and sometimes do not
// still need to use the native driver when duration is 0 so as to
// not cause intermixed JS and native animations.
if (this._duration === 0 && !this._useNativeDriver) {
this._onUpdate(this._toValue);
this.__debouncedOnEnd({
finished: true
});
} else {
this._startTime = Date.now();
if (this._useNativeDriver) {
this.__startNativeAnimation(animatedValue);
} else {
this._animationFrame = requestAnimationFrame(
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
this.onUpdate.bind(this));
}
}
};
if (this._delay) {
this._timeout = setTimeout(start, this._delay);
} else {
start();
}
}
onUpdate() {
var now = Date.now();
if (now >= this._startTime + this._duration) {
if (this._duration === 0) {
this._onUpdate(this._toValue);
} else {
this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue));
}
this.__debouncedOnEnd({
finished: true
});
return;
}
this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue));
if (this.__active) {
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
}
}
stop() {
super.stop();
this.__active = false;
clearTimeout(this._timeout);
global.cancelAnimationFrame(this._animationFrame);
this.__debouncedOnEnd({
finished: false
});
}
}
var _default = TimingAnimation;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/bezier.js
/**
* Portions Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* BezierEasing - use bezier curve for transition easing function
* https://github.com/gre/bezier-easing
* @copyright 2014-2015 Gaëtan Renaudeau. MIT License.
*/
'use strict';
// These values are established by empiricism with tests (tradeoff: performance VS precision)
exports.__esModule = true;
exports.default = bezier;
var NEWTON_ITERATIONS = 4;
var NEWTON_MIN_SLOPE = 0.001;
var SUBDIVISION_PRECISION = 0.0000001;
var SUBDIVISION_MAX_ITERATIONS = 10;
var kSplineTableSize = 11;
var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
var float32ArraySupported = typeof Float32Array === 'function';
function A(aA1, aA2) {
return 1.0 - 3.0 * aA2 + 3.0 * aA1;
}
function B(aA1, aA2) {
return 3.0 * aA2 - 6.0 * aA1;
}
function C(aA1) {
return 3.0 * aA1;
}
// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
function calcBezier(aT, aA1, aA2) {
return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
}
// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
function getSlope(aT, aA1, aA2) {
return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
}
function binarySubdivide(aX, _aA, _aB, mX1, mX2) {
var currentX,
currentT,
i = 0,
aA = _aA,
aB = _aB;
do {
currentT = aA + (aB - aA) / 2.0;
currentX = calcBezier(currentT, mX1, mX2) - aX;
if (currentX > 0.0) {
aB = currentT;
} else {
aA = currentT;
}
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
return currentT;
}
function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {
var aGuessT = _aGuessT;
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
var currentSlope = getSlope(aGuessT, mX1, mX2);
if (currentSlope === 0.0) {
return aGuessT;
}
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
aGuessT -= currentX / currentSlope;
}
return aGuessT;
}
function bezier(mX1, mY1, mX2, mY2) {
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
throw new Error('bezier x values must be in [0, 1] range');
}
// Precompute samples table
var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
if (mX1 !== mY1 || mX2 !== mY2) {
for (var i = 0; i < kSplineTableSize; ++i) {
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
}
}
function getTForX(aX) {
var intervalStart = 0.0;
var currentSample = 1;
var lastSample = kSplineTableSize - 1;
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
intervalStart += kSampleStepSize;
}
--currentSample;
// Interpolate to provide an initial guess for t
var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
var guessForT = intervalStart + dist * kSampleStepSize;
var initialSlope = getSlope(guessForT, mX1, mX2);
if (initialSlope >= NEWTON_MIN_SLOPE) {
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
} else if (initialSlope === 0.0) {
return guessForT;
} else {
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
}
}
return function BezierEasing(x) {
if (mX1 === mY1 && mX2 === mY2) {
return x; // linear
}
// Because JavaScript number are imprecise, we should guarantee the extremes are right.
if (x === 0) {
return 0;
}
if (x === 1) {
return 1;
}
return calcBezier(getTForX(x), mY1, mY2);
};
}
;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedFlatList.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var React = _interopRequireWildcard(require("react"));
var _FlatList = _interopRequireDefault(require("../../../../exports/FlatList"));
var _createAnimatedComponent = _interopRequireDefault(require("../createAnimatedComponent"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* @see https://github.com/facebook/react-native/commit/b8c8562
*/
var FlatListWithEventThrottle = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(_FlatList.default, (0, _extends2.default)({
scrollEventThrottle: 0.0001
}, props, {
ref: ref
})));
var _default = (0, _createAnimatedComponent.default)(FlatListWithEventThrottle);
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedImage.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _Image = _interopRequireDefault(require("../../../../exports/Image"));
var _createAnimatedComponent = _interopRequireDefault(require("../createAnimatedComponent"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
var _default = (0, _createAnimatedComponent.default)(_Image.default);
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedScrollView.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var React = _interopRequireWildcard(require("react"));
var _ScrollView = _interopRequireDefault(require("../../../../exports/ScrollView"));
var _createAnimatedComponent = _interopRequireDefault(require("../createAnimatedComponent"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* @see https://github.com/facebook/react-native/commit/b8c8562
*/
var ScrollViewWithEventThrottle = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(_ScrollView.default, (0, _extends2.default)({
scrollEventThrottle: 0.0001
}, props, {
ref: ref
})));
var _default = (0, _createAnimatedComponent.default)(ScrollViewWithEventThrottle);
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedSectionList.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var React = _interopRequireWildcard(require("react"));
var _SectionList = _interopRequireDefault(require("../../../../exports/SectionList"));
var _createAnimatedComponent = _interopRequireDefault(require("../createAnimatedComponent"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* @see https://github.com/facebook/react-native/commit/b8c8562
*/
var SectionListWithEventThrottle = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(_SectionList.default, (0, _extends2.default)({
scrollEventThrottle: 0.0001
}, props, {
ref: ref
})));
var _default = (0, _createAnimatedComponent.default)(SectionListWithEventThrottle);
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedText.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _Text = _interopRequireDefault(require("../../../../exports/Text"));
var _createAnimatedComponent = _interopRequireDefault(require("../createAnimatedComponent"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
var _default = (0, _createAnimatedComponent.default)(_Text.default);
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/components/AnimatedView.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _View = _interopRequireDefault(require("../../../../exports/View"));
var _createAnimatedComponent = _interopRequireDefault(require("../createAnimatedComponent"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
var _default = (0, _createAnimatedComponent.default)(_View.default);
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/createAnimatedComponent.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = createAnimatedComponent;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _useAnimatedProps2 = _interopRequireDefault(require("./useAnimatedProps"));
var _useMergeRefs = _interopRequireDefault(require("../Utilities/useMergeRefs"));
var _StyleSheet = _interopRequireDefault(require("../../../exports/StyleSheet"));
var _View = _interopRequireDefault(require("../../../exports/View"));
var React = _interopRequireWildcard(require("react"));
var _excluded = ["style"];
/**
* Experimental implementation of `createAnimatedComponent` that is intended to
* be compatible with concurrent rendering.
*/
function createAnimatedComponent(Component) {
return /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
var _useAnimatedProps = (0, _useAnimatedProps2.default)(props),
reducedProps = _useAnimatedProps[0],
callbackRef = _useAnimatedProps[1];
var ref = (0, _useMergeRefs.default)(callbackRef, forwardedRef);
// Some components require explicit passthrough values for animation
// to work properly. For example, if an animated component is
// transformed and Pressable, onPress will not work after transform
// without these passthrough values.
// $FlowFixMe[prop-missing]
var passthroughAnimatedPropExplicitValues = reducedProps.passthroughAnimatedPropExplicitValues,
style = reducedProps.style;
var _ref = passthroughAnimatedPropExplicitValues !== null && passthroughAnimatedPropExplicitValues !== void 0 ? passthroughAnimatedPropExplicitValues : {},
passthroughStyle = _ref.style,
passthroughProps = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
var mergedStyle = [style, passthroughStyle];
return /*#__PURE__*/React.createElement(Component, (0, _extends2.default)({}, reducedProps, passthroughProps, {
style: mergedStyle,
ref: ref
}));
});
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedAddition.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedInterpolation = _interopRequireDefault(require("./AnimatedInterpolation"));
var _AnimatedValue = _interopRequireDefault(require("./AnimatedValue"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
class AnimatedAddition extends _AnimatedWithChildren.default {
constructor(a, b) {
super();
this._a = typeof a === 'number' ? new _AnimatedValue.default(a) : a;
this._b = typeof b === 'number' ? new _AnimatedValue.default(b) : b;
}
__makeNative(platformConfig) {
this._a.__makeNative(platformConfig);
this._b.__makeNative(platformConfig);
super.__makeNative(platformConfig);
}
__getValue() {
return this._a.__getValue() + this._b.__getValue();
}
interpolate(config) {
return new _AnimatedInterpolation.default(this, config);
}
__attach() {
this._a.__addChild(this);
this._b.__addChild(this);
}
__detach() {
this._a.__removeChild(this);
this._b.__removeChild(this);
super.__detach();
}
__getNativeConfig() {
return {
type: 'addition',
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
};
}
}
var _default = AnimatedAddition;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedColor.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedValue = _interopRequireDefault(require("./AnimatedValue"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
var _normalizeColors = _interopRequireDefault(require("@react-native/normalize-colors"));
var _NativeAnimatedHelper = _interopRequireDefault(require("../NativeAnimatedHelper"));
var NativeAnimatedAPI = _NativeAnimatedHelper.default.API;
var defaultColor = {
r: 0,
g: 0,
b: 0,
a: 1.0
};
var _uniqueId = 1;
var processColorObject = color => {
return color;
};
/* eslint no-bitwise: 0 */
function processColor(color) {
if (color === undefined || color === null) {
return null;
}
if (isRgbaValue(color)) {
// $FlowIgnore[incompatible-cast] - Type is verified above
return color;
}
var normalizedColor = (0, _normalizeColors.default)(
// $FlowIgnore[incompatible-cast] - Type is verified above
color);
if (normalizedColor === undefined || normalizedColor === null) {
return null;
}
if (typeof normalizedColor === 'object') {
var processedColorObj = processColorObject(normalizedColor);
if (processedColorObj != null) {
return processedColorObj;
}
} else if (typeof normalizedColor === 'number') {
var r = (normalizedColor & 0xff000000) >>> 24;
var g = (normalizedColor & 0x00ff0000) >>> 16;
var b = (normalizedColor & 0x0000ff00) >>> 8;
var a = (normalizedColor & 0x000000ff) / 255;
return {
r,
g,
b,
a
};
}
return null;
}
function isRgbaValue(value) {
return value && typeof value.r === 'number' && typeof value.g === 'number' && typeof value.b === 'number' && typeof value.a === 'number';
}
function isRgbaAnimatedValue(value) {
return value && value.r instanceof _AnimatedValue.default && value.g instanceof _AnimatedValue.default && value.b instanceof _AnimatedValue.default && value.a instanceof _AnimatedValue.default;
}
class AnimatedColor extends _AnimatedWithChildren.default {
constructor(valueIn, config) {
super();
this._listeners = {};
var value = valueIn !== null && valueIn !== void 0 ? valueIn : defaultColor;
if (isRgbaAnimatedValue(value)) {
// $FlowIgnore[incompatible-cast] - Type is verified above
var rgbaAnimatedValue = value;
this.r = rgbaAnimatedValue.r;
this.g = rgbaAnimatedValue.g;
this.b = rgbaAnimatedValue.b;
this.a = rgbaAnimatedValue.a;
} else {
var _processColor;
var processedColor = // $FlowIgnore[incompatible-cast] - Type is verified above
(_processColor = processColor(value)) !== null && _processColor !== void 0 ? _processColor : defaultColor;
var initColor = defaultColor;
if (isRgbaValue(processedColor)) {
// $FlowIgnore[incompatible-cast] - Type is verified above
initColor = processedColor;
} else {
// $FlowIgnore[incompatible-cast] - Type is verified above
this.nativeColor = processedColor;
}
this.r = new _AnimatedValue.default(initColor.r);
this.g = new _AnimatedValue.default(initColor.g);
this.b = new _AnimatedValue.default(initColor.b);
this.a = new _AnimatedValue.default(initColor.a);
}
if (this.nativeColor || config && config.useNativeDriver) {
this.__makeNative();
}
}
/**
* Directly set the value. This will stop any animations running on the value
* and update all the bound properties.
*/
setValue(value) {
var _processColor2;
var shouldUpdateNodeConfig = false;
if (this.__isNative) {
var nativeTag = this.__getNativeTag();
NativeAnimatedAPI.setWaitingForIdentifier(nativeTag.toString());
}
var processedColor = (_processColor2 = processColor(value)) !== null && _processColor2 !== void 0 ? _processColor2 : defaultColor;
if (isRgbaValue(processedColor)) {
// $FlowIgnore[incompatible-type] - Type is verified above
var rgbaValue = processedColor;
this.r.setValue(rgbaValue.r);
this.g.setValue(rgbaValue.g);
this.b.setValue(rgbaValue.b);
this.a.setValue(rgbaValue.a);
if (this.nativeColor != null) {
this.nativeColor = null;
shouldUpdateNodeConfig = true;
}
} else {
// $FlowIgnore[incompatible-type] - Type is verified above
var nativeColor = processedColor;
if (this.nativeColor !== nativeColor) {
this.nativeColor = nativeColor;
shouldUpdateNodeConfig = true;
}
}
if (this.__isNative) {
var _nativeTag = this.__getNativeTag();
if (shouldUpdateNodeConfig) {
NativeAnimatedAPI.updateAnimatedNodeConfig(_nativeTag, this.__getNativeConfig());
}
NativeAnimatedAPI.unsetWaitingForIdentifier(_nativeTag.toString());
}
}
/**
* Sets an offset that is applied on top of whatever value is set, whether
* via `setValue`, an animation, or `Animated.event`. Useful for compensating
* things like the start of a pan gesture.
*/
setOffset(offset) {
this.r.setOffset(offset.r);
this.g.setOffset(offset.g);
this.b.setOffset(offset.b);
this.a.setOffset(offset.a);
}
/**
* Merges the offset value into the base value and resets the offset to zero.
* The final output of the value is unchanged.
*/
flattenOffset() {
this.r.flattenOffset();
this.g.flattenOffset();
this.b.flattenOffset();
this.a.flattenOffset();
}
/**
* Sets the offset value to the base value, and resets the base value to
* zero. The final output of the value is unchanged.
*/
extractOffset() {
this.r.extractOffset();
this.g.extractOffset();
this.b.extractOffset();
this.a.extractOffset();
}
/**
* Adds an asynchronous listener to the value so you can observe updates from
* animations. This is useful because there is no way to synchronously read
* the value because it might be driven natively.
*
* Returns a string that serves as an identifier for the listener.
*/
addListener(callback) {
var id = String(_uniqueId++);
var jointCallback = _ref => {
var number = _ref.value;
callback(this.__getValue());
};
this._listeners[id] = {
r: this.r.addListener(jointCallback),
g: this.g.addListener(jointCallback),
b: this.b.addListener(jointCallback),
a: this.a.addListener(jointCallback)
};
return id;
}
/**
* Unregister a listener. The `id` param shall match the identifier
* previously returned by `addListener()`.
*/
removeListener(id) {
this.r.removeListener(this._listeners[id].r);
this.g.removeListener(this._listeners[id].g);
this.b.removeListener(this._listeners[id].b);
this.a.removeListener(this._listeners[id].a);
delete this._listeners[id];
}
/**
* Remove all registered listeners.
*/
removeAllListeners() {
this.r.removeAllListeners();
this.g.removeAllListeners();
this.b.removeAllListeners();
this.a.removeAllListeners();
this._listeners = {};
}
/**
* Stops any running animation or tracking. `callback` is invoked with the
* final value after stopping the animation, which is useful for updating
* state to match the animation position with layout.
*/
stopAnimation(callback) {
this.r.stopAnimation();
this.g.stopAnimation();
this.b.stopAnimation();
this.a.stopAnimation();
callback && callback(this.__getValue());
}
/**
* Stops any animation and resets the value to its original.
*/
resetAnimation(callback) {
this.r.resetAnimation();
this.g.resetAnimation();
this.b.resetAnimation();
this.a.resetAnimation();
callback && callback(this.__getValue());
}
__getValue() {
if (this.nativeColor != null) {
return this.nativeColor;
} else {
return "rgba(" + this.r.__getValue() + ", " + this.g.__getValue() + ", " + this.b.__getValue() + ", " + this.a.__getValue() + ")";
}
}
__attach() {
this.r.__addChild(this);
this.g.__addChild(this);
this.b.__addChild(this);
this.a.__addChild(this);
super.__attach();
}
__detach() {
this.r.__removeChild(this);
this.g.__removeChild(this);
this.b.__removeChild(this);
this.a.__removeChild(this);
super.__detach();
}
__makeNative(platformConfig) {
this.r.__makeNative(platformConfig);
this.g.__makeNative(platformConfig);
this.b.__makeNative(platformConfig);
this.a.__makeNative(platformConfig);
super.__makeNative(platformConfig);
}
__getNativeConfig() {
return {
type: 'color',
r: this.r.__getNativeTag(),
g: this.g.__getNativeTag(),
b: this.b.__getNativeTag(),
a: this.a.__getNativeTag(),
nativeColor: this.nativeColor
};
}
}
exports.default = AnimatedColor;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedDiffClamp.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedInterpolation = _interopRequireDefault(require("./AnimatedInterpolation"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
class AnimatedDiffClamp extends _AnimatedWithChildren.default {
constructor(a, min, max) {
super();
this._a = a;
this._min = min;
this._max = max;
this._value = this._lastValue = this._a.__getValue();
}
__makeNative(platformConfig) {
this._a.__makeNative(platformConfig);
super.__makeNative(platformConfig);
}
interpolate(config) {
return new _AnimatedInterpolation.default(this, config);
}
__getValue() {
var value = this._a.__getValue();
var diff = value - this._lastValue;
this._lastValue = value;
this._value = Math.min(Math.max(this._value + diff, this._min), this._max);
return this._value;
}
__attach() {
this._a.__addChild(this);
}
__detach() {
this._a.__removeChild(this);
super.__detach();
}
__getNativeConfig() {
return {
type: 'diffclamp',
input: this._a.__getNativeTag(),
min: this._min,
max: this._max
};
}
}
var _default = AnimatedDiffClamp;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedDivision.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedInterpolation = _interopRequireDefault(require("./AnimatedInterpolation"));
var _AnimatedNode = _interopRequireDefault(require("./AnimatedNode"));
var _AnimatedValue = _interopRequireDefault(require("./AnimatedValue"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
class AnimatedDivision extends _AnimatedWithChildren.default {
constructor(a, b) {
super();
this._warnedAboutDivideByZero = false;
if (b === 0 || b instanceof _AnimatedNode.default && b.__getValue() === 0) {
console.error('Detected potential division by zero in AnimatedDivision');
}
this._a = typeof a === 'number' ? new _AnimatedValue.default(a) : a;
this._b = typeof b === 'number' ? new _AnimatedValue.default(b) : b;
}
__makeNative(platformConfig) {
this._a.__makeNative(platformConfig);
this._b.__makeNative(platformConfig);
super.__makeNative(platformConfig);
}
__getValue() {
var a = this._a.__getValue();
var b = this._b.__getValue();
if (b === 0) {
// Prevent spamming the console/LogBox
if (!this._warnedAboutDivideByZero) {
console.error('Detected division by zero in AnimatedDivision');
this._warnedAboutDivideByZero = true;
}
// Passing infinity/NaN to Fabric will cause a native crash
return 0;
}
this._warnedAboutDivideByZero = false;
return a / b;
}
interpolate(config) {
return new _AnimatedInterpolation.default(this, config);
}
__attach() {
this._a.__addChild(this);
this._b.__addChild(this);
}
__detach() {
this._a.__removeChild(this);
this._b.__removeChild(this);
super.__detach();
}
__getNativeConfig() {
return {
type: 'division',
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
};
}
}
var _default = AnimatedDivision;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedInterpolation.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/* eslint no-bitwise: 0 */
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
var _NativeAnimatedHelper = _interopRequireDefault(require("../NativeAnimatedHelper"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _normalizeColors = _interopRequireDefault(require("@react-native/normalize-colors"));
var __DEV__ = process.env.NODE_ENV !== 'production';
var linear = t => t;
/**
* Very handy helper to map input ranges to output ranges with an easing
* function and custom behavior outside of the ranges.
*/
function createInterpolation(config) {
if (config.outputRange && typeof config.outputRange[0] === 'string') {
return createInterpolationFromStringOutputRange(config);
}
var outputRange = config.outputRange;
var inputRange = config.inputRange;
if (__DEV__) {
checkInfiniteRange('outputRange', outputRange);
checkInfiniteRange('inputRange', inputRange);
checkValidInputRange(inputRange);
(0, _invariant.default)(inputRange.length === outputRange.length, 'inputRange (' + inputRange.length + ') and outputRange (' + outputRange.length + ') must have the same length');
}
var easing = config.easing || linear;
var extrapolateLeft = 'extend';
if (config.extrapolateLeft !== undefined) {
extrapolateLeft = config.extrapolateLeft;
} else if (config.extrapolate !== undefined) {
extrapolateLeft = config.extrapolate;
}
var extrapolateRight = 'extend';
if (config.extrapolateRight !== undefined) {
extrapolateRight = config.extrapolateRight;
} else if (config.extrapolate !== undefined) {
extrapolateRight = config.extrapolate;
}
return input => {
(0, _invariant.default)(typeof input === 'number', 'Cannot interpolation an input which is not a number');
var range = findRange(input, inputRange);
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight);
};
}
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight) {
var result = input;
// Extrapolate
if (result < inputMin) {
if (extrapolateLeft === 'identity') {
return result;
} else if (extrapolateLeft === 'clamp') {
result = inputMin;
} else if (extrapolateLeft === 'extend') {
// noop
}
}
if (result > inputMax) {
if (extrapolateRight === 'identity') {
return result;
} else if (extrapolateRight === 'clamp') {
result = inputMax;
} else if (extrapolateRight === 'extend') {
// noop
}
}
if (outputMin === outputMax) {
return outputMin;
}
if (inputMin === inputMax) {
if (input <= inputMin) {
return outputMin;
}
return outputMax;
}
// Input Range
if (inputMin === -Infinity) {
result = -result;
} else if (inputMax === Infinity) {
result = result - inputMin;
} else {
result = (result - inputMin) / (inputMax - inputMin);
}
// Easing
result = easing(result);
// Output Range
if (outputMin === -Infinity) {
result = -result;
} else if (outputMax === Infinity) {
result = result + outputMin;
} else {
result = result * (outputMax - outputMin) + outputMin;
}
return result;
}
function colorToRgba(input) {
var normalizedColor = (0, _normalizeColors.default)(input);
if (normalizedColor === null || typeof normalizedColor !== 'number') {
return input;
}
normalizedColor = normalizedColor || 0;
var r = (normalizedColor & 0xff000000) >>> 24;
var g = (normalizedColor & 0x00ff0000) >>> 16;
var b = (normalizedColor & 0x0000ff00) >>> 8;
var a = (normalizedColor & 0x000000ff) / 255;
return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
}
var stringShapeRegex = /[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g;
/**
* Supports string shapes by extracting numbers so new values can be computed,
* and recombines those values into new strings of the same shape. Supports
* things like:
*
* rgba(123, 42, 99, 0.36) // colors
* -45deg // values with units
*/
function createInterpolationFromStringOutputRange(config) {
var outputRange = config.outputRange;
(0, _invariant.default)(outputRange.length >= 2, 'Bad output range');
outputRange = outputRange.map(colorToRgba);
checkPattern(outputRange);
// ['rgba(0, 100, 200, 0)', 'rgba(50, 150, 250, 0.5)']
// ->
// [
// [0, 50],
// [100, 150],
// [200, 250],
// [0, 0.5],
// ]
/* $FlowFixMe[incompatible-use] (>=0.18.0): `outputRange[0].match()` can
* return `null`. Need to guard against this possibility. */
var outputRanges = outputRange[0].match(stringShapeRegex).map(() => []);
outputRange.forEach(value => {
/* $FlowFixMe[incompatible-use] (>=0.18.0): `value.match()` can return
* `null`. Need to guard against this possibility. */
value.match(stringShapeRegex).forEach((number, i) => {
outputRanges[i].push(+number);
});
});
var interpolations = outputRange[0].match(stringShapeRegex)
/* $FlowFixMe[incompatible-use] (>=0.18.0): `outputRange[0].match()` can
* return `null`. Need to guard against this possibility. */
/* $FlowFixMe[incompatible-call] (>=0.18.0): `outputRange[0].match()` can
* return `null`. Need to guard against this possibility. */.map((value, i) => {
return createInterpolation((0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
outputRange: outputRanges[i]
}));
});
// rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to
// round the opacity (4th column).
var shouldRound = isRgbOrRgba(outputRange[0]);
return input => {
var i = 0;
// 'rgba(0, 100, 200, 0)'
// ->
// 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'
return outputRange[0].replace(stringShapeRegex, () => {
var val = +interpolations[i++](input);
if (shouldRound) {
val = i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000;
}
return String(val);
});
};
}
function isRgbOrRgba(range) {
return typeof range === 'string' && range.startsWith('rgb');
}
function checkPattern(arr) {
var pattern = arr[0].replace(stringShapeRegex, '');
for (var i = 1; i < arr.length; ++i) {
(0, _invariant.default)(pattern === arr[i].replace(stringShapeRegex, ''), 'invalid pattern ' + arr[0] + ' and ' + arr[i]);
}
}
function findRange(input, inputRange) {
var i;
for (i = 1; i < inputRange.length - 1; ++i) {
if (inputRange[i] >= input) {
break;
}
}
return i - 1;
}
function checkValidInputRange(arr) {
(0, _invariant.default)(arr.length >= 2, 'inputRange must have at least 2 elements');
var message = 'inputRange must be monotonically non-decreasing ' + String(arr);
for (var i = 1; i < arr.length; ++i) {
(0, _invariant.default)(arr[i] >= arr[i - 1], message);
}
}
function checkInfiniteRange(name, arr) {
(0, _invariant.default)(arr.length >= 2, name + ' must have at least 2 elements');
(0, _invariant.default)(arr.length !== 2 || arr[0] !== -Infinity || arr[1] !== Infinity,
/* $FlowFixMe[incompatible-type] (>=0.13.0) - In the addition expression
* below this comment, one or both of the operands may be something that
* doesn't cleanly convert to a string, like undefined, null, and object,
* etc. If you really mean this implicit string conversion, you can do
* something like String(myThing) */
name + 'cannot be ]-infinity;+infinity[ ' + arr);
}
class AnimatedInterpolation extends _AnimatedWithChildren.default {
// Export for testing.
constructor(parent, config) {
super();
this._parent = parent;
this._config = config;
this._interpolation = createInterpolation(config);
}
__makeNative(platformConfig) {
this._parent.__makeNative(platformConfig);
super.__makeNative(platformConfig);
}
__getValue() {
var parentValue = this._parent.__getValue();
(0, _invariant.default)(typeof parentValue === 'number', 'Cannot interpolate an input which is not a number.');
return this._interpolation(parentValue);
}
interpolate(config) {
return new AnimatedInterpolation(this, config);
}
__attach() {
this._parent.__addChild(this);
}
__detach() {
this._parent.__removeChild(this);
super.__detach();
}
__transformDataType(range) {
return range.map(_NativeAnimatedHelper.default.transformDataType);
}
__getNativeConfig() {
if (__DEV__) {
_NativeAnimatedHelper.default.validateInterpolation(this._config);
}
return {
inputRange: this._config.inputRange,
// Only the `outputRange` can contain strings so we don't need to transform `inputRange` here
outputRange: this.__transformDataType(this._config.outputRange),
extrapolateLeft: this._config.extrapolateLeft || this._config.extrapolate || 'extend',
extrapolateRight: this._config.extrapolateRight || this._config.extrapolate || 'extend',
type: 'interpolation'
};
}
}
AnimatedInterpolation.__createInterpolation = createInterpolation;
var _default = AnimatedInterpolation;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedModulo.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedInterpolation = _interopRequireDefault(require("./AnimatedInterpolation"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
class AnimatedModulo extends _AnimatedWithChildren.default {
constructor(a, modulus) {
super();
this._a = a;
this._modulus = modulus;
}
__makeNative(platformConfig) {
this._a.__makeNative(platformConfig);
super.__makeNative(platformConfig);
}
__getValue() {
return (this._a.__getValue() % this._modulus + this._modulus) % this._modulus;
}
interpolate(config) {
return new _AnimatedInterpolation.default(this, config);
}
__attach() {
this._a.__addChild(this);
}
__detach() {
this._a.__removeChild(this);
super.__detach();
}
__getNativeConfig() {
return {
type: 'modulus',
input: this._a.__getNativeTag(),
modulus: this._modulus
};
}
}
var _default = AnimatedModulo;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedMultiplication.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedInterpolation = _interopRequireDefault(require("./AnimatedInterpolation"));
var _AnimatedValue = _interopRequireDefault(require("./AnimatedValue"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
class AnimatedMultiplication extends _AnimatedWithChildren.default {
constructor(a, b) {
super();
this._a = typeof a === 'number' ? new _AnimatedValue.default(a) : a;
this._b = typeof b === 'number' ? new _AnimatedValue.default(b) : b;
}
__makeNative(platformConfig) {
this._a.__makeNative(platformConfig);
this._b.__makeNative(platformConfig);
super.__makeNative(platformConfig);
}
__getValue() {
return this._a.__getValue() * this._b.__getValue();
}
interpolate(config) {
return new _AnimatedInterpolation.default(this, config);
}
__attach() {
this._a.__addChild(this);
this._b.__addChild(this);
}
__detach() {
this._a.__removeChild(this);
this._b.__removeChild(this);
super.__detach();
}
__getNativeConfig() {
return {
type: 'multiplication',
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
};
}
}
var _default = AnimatedMultiplication;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedNode.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _NativeAnimatedHelper = _interopRequireDefault(require("../NativeAnimatedHelper"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var NativeAnimatedAPI = _NativeAnimatedHelper.default.API;
var _uniqueId = 1;
// Note(vjeux): this would be better as an interface but flow doesn't
// support them yet
class AnimatedNode {
__attach() {}
__detach() {
if (this.__isNative && this.__nativeTag != null) {
_NativeAnimatedHelper.default.API.dropAnimatedNode(this.__nativeTag);
this.__nativeTag = undefined;
}
}
__getValue() {}
__getAnimatedValue() {
return this.__getValue();
}
__addChild(child) {}
__removeChild(child) {}
__getChildren() {
return [];
}
/* Methods and props used by native Animated impl */
constructor() {
this._listeners = {};
}
__makeNative(platformConfig) {
if (!this.__isNative) {
throw new Error('This node cannot be made a "native" animated node');
}
this._platformConfig = platformConfig;
if (this.hasListeners()) {
this._startListeningToNativeValueUpdates();
}
}
/**
* Adds an asynchronous listener to the value so you can observe updates from
* animations. This is useful because there is no way to
* synchronously read the value because it might be driven natively.
*
* See https://reactnative.dev/docs/animatedvalue#addlistener
*/
addListener(callback) {
var id = String(_uniqueId++);
this._listeners[id] = callback;
if (this.__isNative) {
this._startListeningToNativeValueUpdates();
}
return id;
}
/**
* Unregister a listener. The `id` param shall match the identifier
* previously returned by `addListener()`.
*
* See https://reactnative.dev/docs/animatedvalue#removelistener
*/
removeListener(id) {
delete this._listeners[id];
if (this.__isNative && !this.hasListeners()) {
this._stopListeningForNativeValueUpdates();
}
}
/**
* Remove all registered listeners.
*
* See https://reactnative.dev/docs/animatedvalue#removealllisteners
*/
removeAllListeners() {
this._listeners = {};
if (this.__isNative) {
this._stopListeningForNativeValueUpdates();
}
}
hasListeners() {
return !!Object.keys(this._listeners).length;
}
_startListeningToNativeValueUpdates() {
if (this.__nativeAnimatedValueListener && !this.__shouldUpdateListenersForNewNativeTag) {
return;
}
if (this.__shouldUpdateListenersForNewNativeTag) {
this.__shouldUpdateListenersForNewNativeTag = false;
this._stopListeningForNativeValueUpdates();
}
NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());
this.__nativeAnimatedValueListener = _NativeAnimatedHelper.default.nativeEventEmitter.addListener('onAnimatedValueUpdate', data => {
if (data.tag !== this.__getNativeTag()) {
return;
}
this.__onAnimatedValueUpdateReceived(data.value);
});
}
__onAnimatedValueUpdateReceived(value) {
this.__callListeners(value);
}
__callListeners(value) {
for (var _key in this._listeners) {
this._listeners[_key]({
value
});
}
}
_stopListeningForNativeValueUpdates() {
if (!this.__nativeAnimatedValueListener) {
return;
}
this.__nativeAnimatedValueListener.remove();
this.__nativeAnimatedValueListener = null;
NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());
}
__getNativeTag() {
var _this$__nativeTag;
_NativeAnimatedHelper.default.assertNativeAnimatedModule();
(0, _invariant.default)(this.__isNative, 'Attempt to get native tag from node not marked as "native"');
var nativeTag = (_this$__nativeTag = this.__nativeTag) !== null && _this$__nativeTag !== void 0 ? _this$__nativeTag : _NativeAnimatedHelper.default.generateNewNodeTag();
if (this.__nativeTag == null) {
this.__nativeTag = nativeTag;
var config = this.__getNativeConfig();
if (this._platformConfig) {
config.platformConfig = this._platformConfig;
}
_NativeAnimatedHelper.default.API.createAnimatedNode(nativeTag, config);
this.__shouldUpdateListenersForNewNativeTag = true;
}
return nativeTag;
}
__getNativeConfig() {
throw new Error('This JS animated node type cannot be used as native animated node');
}
toJSON() {
return this.__getValue();
}
__getPlatformConfig() {
return this._platformConfig;
}
__setPlatformConfig(platformConfig) {
this._platformConfig = platformConfig;
}
}
var _default = AnimatedNode;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedProps.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _AnimatedEvent = require("../AnimatedEvent");
var _AnimatedNode = _interopRequireDefault(require("./AnimatedNode"));
var _AnimatedStyle = _interopRequireDefault(require("./AnimatedStyle"));
var _NativeAnimatedHelper = _interopRequireDefault(require("../NativeAnimatedHelper"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
class AnimatedProps extends _AnimatedNode.default {
constructor(props, callback) {
super();
if (props.style) {
props = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
style: new _AnimatedStyle.default(props.style)
});
}
this._props = props;
this._callback = callback;
this.__attach();
}
__getValue() {
var props = {};
for (var key in this._props) {
var value = this._props[key];
if (value instanceof _AnimatedNode.default) {
if (!value.__isNative || value instanceof _AnimatedStyle.default) {
// We cannot use value of natively driven nodes this way as the value we have access from
// JS may not be up to date.
props[key] = value.__getValue();
}
} else if (value instanceof _AnimatedEvent.AnimatedEvent) {
props[key] = value.__getHandler();
} else {
props[key] = value;
}
}
return props;
}
__getAnimatedValue() {
var props = {};
for (var key in this._props) {
var value = this._props[key];
if (value instanceof _AnimatedNode.default) {
props[key] = value.__getAnimatedValue();
}
}
return props;
}
__attach() {
for (var key in this._props) {
var value = this._props[key];
if (value instanceof _AnimatedNode.default) {
value.__addChild(this);
}
}
}
__detach() {
if (this.__isNative && this._animatedView) {
this.__disconnectAnimatedView();
}
for (var key in this._props) {
var value = this._props[key];
if (value instanceof _AnimatedNode.default) {
value.__removeChild(this);
}
}
super.__detach();
}
update() {
this._callback();
}
__makeNative() {
if (!this.__isNative) {
this.__isNative = true;
for (var key in this._props) {
var value = this._props[key];
if (value instanceof _AnimatedNode.default) {
value.__makeNative();
}
}
if (this._animatedView) {
this.__connectAnimatedView();
}
}
}
setNativeView(animatedView) {
if (this._animatedView === animatedView) {
return;
}
this._animatedView = animatedView;
if (this.__isNative) {
this.__connectAnimatedView();
}
}
__connectAnimatedView() {
(0, _invariant.default)(this.__isNative, 'Expected node to be marked as "native"');
var nativeViewTag = this._animatedView;
(0, _invariant.default)(nativeViewTag != null, 'Unable to locate attached view in the native tree');
_NativeAnimatedHelper.default.API.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag);
}
__disconnectAnimatedView() {
(0, _invariant.default)(this.__isNative, 'Expected node to be marked as "native"');
var nativeViewTag = this._animatedView;
(0, _invariant.default)(nativeViewTag != null, 'Unable to locate attached view in the native tree');
_NativeAnimatedHelper.default.API.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag);
}
__restoreDefaultValues() {
// When using the native driver, view properties need to be restored to
// their default values manually since react no longer tracks them. This
// is needed to handle cases where a prop driven by native animated is removed
// after having been changed natively by an animation.
if (this.__isNative) {
_NativeAnimatedHelper.default.API.restoreDefaultValues(this.__getNativeTag());
}
}
__getNativeConfig() {
var propsConfig = {};
for (var propKey in this._props) {
var value = this._props[propKey];
if (value instanceof _AnimatedNode.default) {
value.__makeNative();
propsConfig[propKey] = value.__getNativeTag();
}
}
return {
type: 'props',
props: propsConfig
};
}
}
var _default = AnimatedProps;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedStyle.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedNode = _interopRequireDefault(require("./AnimatedNode"));
var _AnimatedTransform = _interopRequireDefault(require("./AnimatedTransform"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
var _NativeAnimatedHelper = _interopRequireDefault(require("../NativeAnimatedHelper"));
var _StyleSheet = _interopRequireDefault(require("../../../../exports/StyleSheet"));
var flattenStyle = _StyleSheet.default.flatten;
function createAnimatedStyle(inputStyle) {
var style = flattenStyle(inputStyle);
var animatedStyles = {};
for (var key in style) {
var value = style[key];
if (key === 'transform' && Array.isArray(value)) {
animatedStyles[key] = new _AnimatedTransform.default(value);
} else if (value instanceof _AnimatedNode.default) {
animatedStyles[key] = value;
} else if (value && !Array.isArray(value) && typeof value === 'object') {
animatedStyles[key] = createAnimatedStyle(value);
}
}
return animatedStyles;
}
class AnimatedStyle extends _AnimatedWithChildren.default {
constructor(style) {
super();
this._inputStyle = style;
this._style = createAnimatedStyle(style);
}
// Recursively get values for nested styles (like iOS's shadowOffset)
_walkStyleAndGetValues(style) {
var updatedStyle = {};
for (var key in style) {
var value = style[key];
if (value instanceof _AnimatedNode.default) {
if (!value.__isNative) {
// We cannot use value of natively driven nodes this way as the value we have access from
// JS may not be up to date.
updatedStyle[key] = value.__getValue();
}
} else if (value && !Array.isArray(value) && typeof value === 'object') {
// Support animating nested values (for example: shadowOffset.height)
updatedStyle[key] = this._walkStyleAndGetValues(value);
} else {
updatedStyle[key] = value;
}
}
return updatedStyle;
}
__getValue() {
return [this._inputStyle, this._walkStyleAndGetValues(this._style)];
}
// Recursively get animated values for nested styles (like iOS's shadowOffset)
_walkStyleAndGetAnimatedValues(style) {
var updatedStyle = {};
for (var key in style) {
var value = style[key];
if (value instanceof _AnimatedNode.default) {
updatedStyle[key] = value.__getAnimatedValue();
} else if (value && !Array.isArray(value) && typeof value === 'object') {
// Support animating nested values (for example: shadowOffset.height)
updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value);
}
}
return updatedStyle;
}
__getAnimatedValue() {
return this._walkStyleAndGetAnimatedValues(this._style);
}
__attach() {
for (var key in this._style) {
var value = this._style[key];
if (value instanceof _AnimatedNode.default) {
value.__addChild(this);
}
}
}
__detach() {
for (var key in this._style) {
var value = this._style[key];
if (value instanceof _AnimatedNode.default) {
value.__removeChild(this);
}
}
super.__detach();
}
__makeNative() {
for (var key in this._style) {
var value = this._style[key];
if (value instanceof _AnimatedNode.default) {
value.__makeNative();
}
}
super.__makeNative();
}
__getNativeConfig() {
var styleConfig = {};
for (var styleKey in this._style) {
if (this._style[styleKey] instanceof _AnimatedNode.default) {
var style = this._style[styleKey];
style.__makeNative();
styleConfig[styleKey] = style.__getNativeTag();
}
}
_NativeAnimatedHelper.default.validateStyles(styleConfig);
return {
type: 'style',
style: styleConfig
};
}
}
var _default = AnimatedStyle;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedSubtraction.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedInterpolation = _interopRequireDefault(require("./AnimatedInterpolation"));
var _AnimatedValue = _interopRequireDefault(require("./AnimatedValue"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
class AnimatedSubtraction extends _AnimatedWithChildren.default {
constructor(a, b) {
super();
this._a = typeof a === 'number' ? new _AnimatedValue.default(a) : a;
this._b = typeof b === 'number' ? new _AnimatedValue.default(b) : b;
}
__makeNative(platformConfig) {
this._a.__makeNative(platformConfig);
this._b.__makeNative(platformConfig);
super.__makeNative(platformConfig);
}
__getValue() {
return this._a.__getValue() - this._b.__getValue();
}
interpolate(config) {
return new _AnimatedInterpolation.default(this, config);
}
__attach() {
this._a.__addChild(this);
this._b.__addChild(this);
}
__detach() {
this._a.__removeChild(this);
this._b.__removeChild(this);
super.__detach();
}
__getNativeConfig() {
return {
type: 'subtraction',
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
};
}
}
var _default = AnimatedSubtraction;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedTracking.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _AnimatedValue = _interopRequireDefault(require("./AnimatedValue"));
var _AnimatedNode = _interopRequireDefault(require("./AnimatedNode"));
var _NativeAnimatedHelper = require("../NativeAnimatedHelper");
class AnimatedTracking extends _AnimatedNode.default {
constructor(value, parent, animationClass, animationConfig, callback) {
super();
this._value = value;
this._parent = parent;
this._animationClass = animationClass;
this._animationConfig = animationConfig;
this._useNativeDriver = (0, _NativeAnimatedHelper.shouldUseNativeDriver)(animationConfig);
this._callback = callback;
this.__attach();
}
__makeNative() {
this.__isNative = true;
this._parent.__makeNative();
super.__makeNative();
this._value.__makeNative();
}
__getValue() {
return this._parent.__getValue();
}
__attach() {
this._parent.__addChild(this);
if (this._useNativeDriver) {
// when the tracking starts we need to convert this node to a "native node"
// so that the parent node will be made "native" too. This is necessary as
// if we don't do this `update` method will get called. At that point it
// may be too late as it would mean the JS driver has already started
// updating node values
this.__makeNative();
}
}
__detach() {
this._parent.__removeChild(this);
super.__detach();
}
update() {
this._value.animate(new this._animationClass((0, _objectSpread2.default)((0, _objectSpread2.default)({}, this._animationConfig), {}, {
toValue: this._animationConfig.toValue.__getValue()
})), this._callback);
}
__getNativeConfig() {
var animation = new this._animationClass((0, _objectSpread2.default)((0, _objectSpread2.default)({}, this._animationConfig), {}, {
// remove toValue from the config as it's a ref to Animated.Value
toValue: undefined
}));
var animationConfig = animation.__getNativeAnimationConfig();
return {
type: 'tracking',
animationId: (0, _NativeAnimatedHelper.generateNewAnimationId)(),
animationConfig,
toValue: this._parent.__getNativeTag(),
value: this._value.__getNativeTag()
};
}
}
var _default = AnimatedTracking;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedTransform.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedNode = _interopRequireDefault(require("./AnimatedNode"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
var _NativeAnimatedHelper = _interopRequireDefault(require("../NativeAnimatedHelper"));
class AnimatedTransform extends _AnimatedWithChildren.default {
constructor(transforms) {
super();
this._transforms = transforms;
}
__makeNative() {
this._transforms.forEach(transform => {
for (var key in transform) {
var value = transform[key];
if (value instanceof _AnimatedNode.default) {
value.__makeNative();
}
}
});
super.__makeNative();
}
__getValue() {
return this._transforms.map(transform => {
var result = {};
for (var key in transform) {
var value = transform[key];
if (value instanceof _AnimatedNode.default) {
result[key] = value.__getValue();
} else {
result[key] = value;
}
}
return result;
});
}
__getAnimatedValue() {
return this._transforms.map(transform => {
var result = {};
for (var key in transform) {
var value = transform[key];
if (value instanceof _AnimatedNode.default) {
result[key] = value.__getAnimatedValue();
} else {
// All transform components needed to recompose matrix
result[key] = value;
}
}
return result;
});
}
__attach() {
this._transforms.forEach(transform => {
for (var key in transform) {
var value = transform[key];
if (value instanceof _AnimatedNode.default) {
value.__addChild(this);
}
}
});
}
__detach() {
this._transforms.forEach(transform => {
for (var key in transform) {
var value = transform[key];
if (value instanceof _AnimatedNode.default) {
value.__removeChild(this);
}
}
});
super.__detach();
}
__getNativeConfig() {
var transConfigs = [];
this._transforms.forEach(transform => {
for (var key in transform) {
var value = transform[key];
if (value instanceof _AnimatedNode.default) {
transConfigs.push({
type: 'animated',
property: key,
nodeTag: value.__getNativeTag()
});
} else {
transConfigs.push({
type: 'static',
property: key,
value: _NativeAnimatedHelper.default.transformDataType(value)
});
}
}
});
_NativeAnimatedHelper.default.validateTransform(transConfigs);
return {
type: 'transform',
transforms: transConfigs
};
}
}
var _default = AnimatedTransform;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedValue.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedInterpolation = _interopRequireDefault(require("./AnimatedInterpolation"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
var _InteractionManager = _interopRequireDefault(require("../../../../exports/InteractionManager"));
var _NativeAnimatedHelper = _interopRequireDefault(require("../NativeAnimatedHelper"));
var NativeAnimatedAPI = _NativeAnimatedHelper.default.API;
/**
* Animated works by building a directed acyclic graph of dependencies
* transparently when you render your Animated components.
*
* new Animated.Value(0)
* .interpolate() .interpolate() new Animated.Value(1)
* opacity translateY scale
* style transform
* View#234 style
* View#123
*
* A) Top Down phase
* When an Animated.Value is updated, we recursively go down through this
* graph in order to find leaf nodes: the views that we flag as needing
* an update.
*
* B) Bottom Up phase
* When a view is flagged as needing an update, we recursively go back up
* in order to build the new value that it needs. The reason why we need
* this two-phases process is to deal with composite props such as
* transform which can receive values from multiple parents.
*/
function _flush(rootNode) {
var animatedStyles = new Set();
function findAnimatedStyles(node) {
/* $FlowFixMe[prop-missing] (>=0.68.0 site=react_native_fb) This comment
* suppresses an error found when Flow v0.68 was deployed. To see the error
* delete this comment and run Flow. */
if (typeof node.update === 'function') {
animatedStyles.add(node);
} else {
node.__getChildren().forEach(findAnimatedStyles);
}
}
findAnimatedStyles(rootNode);
// $FlowFixMe[prop-missing]
animatedStyles.forEach(animatedStyle => animatedStyle.update());
}
/**
* Some operations are executed only on batch end, which is _mostly_ scheduled when
* Animated component props change. For some of the changes which require immediate execution
* (e.g. setValue), we create a separate batch in case none is scheduled.
*/
function _executeAsAnimatedBatch(id, operation) {
NativeAnimatedAPI.setWaitingForIdentifier(id);
operation();
NativeAnimatedAPI.unsetWaitingForIdentifier(id);
}
/**
* Standard value for driving animations. One `Animated.Value` can drive
* multiple properties in a synchronized fashion, but can only be driven by one
* mechanism at a time. Using a new mechanism (e.g. starting a new animation,
* or calling `setValue`) will stop any previous ones.
*
* See https://reactnative.dev/docs/animatedvalue
*/
class AnimatedValue extends _AnimatedWithChildren.default {
constructor(value, config) {
super();
if (typeof value !== 'number') {
throw new Error('AnimatedValue: Attempting to set value to undefined');
}
this._startingValue = this._value = value;
this._offset = 0;
this._animation = null;
if (config && config.useNativeDriver) {
this.__makeNative();
}
}
__detach() {
if (this.__isNative) {
NativeAnimatedAPI.getValue(this.__getNativeTag(), value => {
this._value = value - this._offset;
});
}
this.stopAnimation();
super.__detach();
}
__getValue() {
return this._value + this._offset;
}
/**
* Directly set the value. This will stop any animations running on the value
* and update all the bound properties.
*
* See https://reactnative.dev/docs/animatedvalue#setvalue
*/
setValue(value) {
if (this._animation) {
this._animation.stop();
this._animation = null;
}
this._updateValue(value, !this.__isNative /* don't perform a flush for natively driven values */);
if (this.__isNative) {
_executeAsAnimatedBatch(this.__getNativeTag().toString(), () => NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value));
}
}
/**
* Sets an offset that is applied on top of whatever value is set, whether via
* `setValue`, an animation, or `Animated.event`. Useful for compensating
* things like the start of a pan gesture.
*
* See https://reactnative.dev/docs/animatedvalue#setoffset
*/
setOffset(offset) {
this._offset = offset;
if (this.__isNative) {
NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset);
}
}
/**
* Merges the offset value into the base value and resets the offset to zero.
* The final output of the value is unchanged.
*
* See https://reactnative.dev/docs/animatedvalue#flattenoffset
*/
flattenOffset() {
this._value += this._offset;
this._offset = 0;
if (this.__isNative) {
NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag());
}
}
/**
* Sets the offset value to the base value, and resets the base value to zero.
* The final output of the value is unchanged.
*
* See https://reactnative.dev/docs/animatedvalue#extractoffset
*/
extractOffset() {
this._offset += this._value;
this._value = 0;
if (this.__isNative) {
NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag());
}
}
/**
* Stops any running animation or tracking. `callback` is invoked with the
* final value after stopping the animation, which is useful for updating
* state to match the animation position with layout.
*
* See https://reactnative.dev/docs/animatedvalue#stopanimation
*/
stopAnimation(callback) {
this.stopTracking();
this._animation && this._animation.stop();
this._animation = null;
if (callback) {
if (this.__isNative) {
NativeAnimatedAPI.getValue(this.__getNativeTag(), callback);
} else {
callback(this.__getValue());
}
}
}
/**
* Stops any animation and resets the value to its original.
*
* See https://reactnative.dev/docs/animatedvalue#resetanimation
*/
resetAnimation(callback) {
this.stopAnimation(callback);
this._value = this._startingValue;
if (this.__isNative) {
NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), this._startingValue);
}
}
__onAnimatedValueUpdateReceived(value) {
this._updateValue(value, false /*flush*/);
}
/**
* Interpolates the value before updating the property, e.g. mapping 0-1 to
* 0-10.
*/
interpolate(config) {
return new _AnimatedInterpolation.default(this, config);
}
/**
* Typically only used internally, but could be used by a custom Animation
* class.
*
* See https://reactnative.dev/docs/animatedvalue#animate
*/
animate(animation, callback) {
var handle = null;
if (animation.__isInteraction) {
handle = _InteractionManager.default.createInteractionHandle();
}
var previousAnimation = this._animation;
this._animation && this._animation.stop();
this._animation = animation;
animation.start(this._value, value => {
// Natively driven animations will never call into that callback
this._updateValue(value, true /* flush */);
}, result => {
this._animation = null;
if (handle !== null) {
_InteractionManager.default.clearInteractionHandle(handle);
}
callback && callback(result);
}, previousAnimation, this);
}
/**
* Typically only used internally.
*/
stopTracking() {
this._tracking && this._tracking.__detach();
this._tracking = null;
}
/**
* Typically only used internally.
*/
track(tracking) {
this.stopTracking();
this._tracking = tracking;
// Make sure that the tracking animation starts executing
this._tracking && this._tracking.update();
}
_updateValue(value, flush) {
if (value === undefined) {
throw new Error('AnimatedValue: Attempting to set value to undefined');
}
this._value = value;
if (flush) {
_flush(this);
}
super.__callListeners(this.__getValue());
}
__getNativeConfig() {
return {
type: 'value',
value: this._value,
offset: this._offset
};
}
}
var _default = AnimatedValue;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedValueXY.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _AnimatedValue = _interopRequireDefault(require("./AnimatedValue"));
var _AnimatedWithChildren = _interopRequireDefault(require("./AnimatedWithChildren"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _uniqueId = 1;
/**
* 2D Value for driving 2D animations, such as pan gestures. Almost identical
* API to normal `Animated.Value`, but multiplexed.
*
* See https://reactnative.dev/docs/animatedvaluexy.html
*/
class AnimatedValueXY extends _AnimatedWithChildren.default {
constructor(valueIn) {
super();
var value = valueIn || {
x: 0,
y: 0
}; // fixme: shouldn't need `: any`
if (typeof value.x === 'number' && typeof value.y === 'number') {
this.x = new _AnimatedValue.default(value.x);
this.y = new _AnimatedValue.default(value.y);
} else {
(0, _invariant.default)(value.x instanceof _AnimatedValue.default && value.y instanceof _AnimatedValue.default, 'AnimatedValueXY must be initialized with an object of numbers or ' + 'AnimatedValues.');
this.x = value.x;
this.y = value.y;
}
this._listeners = {};
}
/**
* Directly set the value. This will stop any animations running on the value
* and update all the bound properties.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#setvalue
*/
setValue(value) {
this.x.setValue(value.x);
this.y.setValue(value.y);
}
/**
* Sets an offset that is applied on top of whatever value is set, whether
* via `setValue`, an animation, or `Animated.event`. Useful for compensating
* things like the start of a pan gesture.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#setoffset
*/
setOffset(offset) {
this.x.setOffset(offset.x);
this.y.setOffset(offset.y);
}
/**
* Merges the offset value into the base value and resets the offset to zero.
* The final output of the value is unchanged.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#flattenoffset
*/
flattenOffset() {
this.x.flattenOffset();
this.y.flattenOffset();
}
/**
* Sets the offset value to the base value, and resets the base value to
* zero. The final output of the value is unchanged.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#extractoffset
*/
extractOffset() {
this.x.extractOffset();
this.y.extractOffset();
}
__getValue() {
return {
x: this.x.__getValue(),
y: this.y.__getValue()
};
}
/**
* Stops any animation and resets the value to its original.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#resetanimation
*/
resetAnimation(callback) {
this.x.resetAnimation();
this.y.resetAnimation();
callback && callback(this.__getValue());
}
/**
* Stops any running animation or tracking. `callback` is invoked with the
* final value after stopping the animation, which is useful for updating
* state to match the animation position with layout.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#stopanimation
*/
stopAnimation(callback) {
this.x.stopAnimation();
this.y.stopAnimation();
callback && callback(this.__getValue());
}
/**
* Adds an asynchronous listener to the value so you can observe updates from
* animations. This is useful because there is no way to synchronously read
* the value because it might be driven natively.
*
* Returns a string that serves as an identifier for the listener.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#addlistener
*/
addListener(callback) {
var id = String(_uniqueId++);
var jointCallback = _ref => {
var number = _ref.value;
callback(this.__getValue());
};
this._listeners[id] = {
x: this.x.addListener(jointCallback),
y: this.y.addListener(jointCallback)
};
return id;
}
/**
* Unregister a listener. The `id` param shall match the identifier
* previously returned by `addListener()`.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#removelistener
*/
removeListener(id) {
this.x.removeListener(this._listeners[id].x);
this.y.removeListener(this._listeners[id].y);
delete this._listeners[id];
}
/**
* Remove all registered listeners.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#removealllisteners
*/
removeAllListeners() {
this.x.removeAllListeners();
this.y.removeAllListeners();
this._listeners = {};
}
/**
* Converts `{x, y}` into `{left, top}` for use in style.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#getlayout
*/
getLayout() {
return {
left: this.x,
top: this.y
};
}
/**
* Converts `{x, y}` into a useable translation transform.
*
* See https://reactnative.dev/docs/animatedvaluexy.html#gettranslatetransform
*/
getTranslateTransform() {
return [{
translateX: this.x
}, {
translateY: this.y
}];
}
}
var _default = AnimatedValueXY;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/nodes/AnimatedWithChildren.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelperLoose"));
var _AnimatedNode = _interopRequireDefault(require("./AnimatedNode"));
var _NativeAnimatedHelper = _interopRequireDefault(require("../NativeAnimatedHelper"));
class AnimatedWithChildren extends _AnimatedNode.default {
constructor() {
super();
this._children = [];
}
__makeNative(platformConfig) {
if (!this.__isNative) {
this.__isNative = true;
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(this._children), _step; !(_step = _iterator()).done;) {
var child = _step.value;
child.__makeNative(platformConfig);
_NativeAnimatedHelper.default.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());
}
}
super.__makeNative(platformConfig);
}
__addChild(child) {
if (this._children.length === 0) {
this.__attach();
}
this._children.push(child);
if (this.__isNative) {
// Only accept "native" animated nodes as children
child.__makeNative(this.__getPlatformConfig());
_NativeAnimatedHelper.default.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());
}
}
__removeChild(child) {
var index = this._children.indexOf(child);
if (index === -1) {
console.warn("Trying to remove a child that doesn't exist");
return;
}
if (this.__isNative && child.__isNative) {
_NativeAnimatedHelper.default.API.disconnectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());
}
this._children.splice(index, 1);
if (this._children.length === 0) {
this.__detach();
}
}
__getChildren() {
return this._children;
}
__callListeners(value) {
super.__callListeners(value);
if (!this.__isNative) {
for (var _iterator2 = (0, _createForOfIteratorHelperLoose2.default)(this._children), _step2; !(_step2 = _iterator2()).done;) {
var child = _step2.value;
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
if (child.__getValue) {
child.__callListeners(child.__getValue());
}
}
}
}
}
var _default = AnimatedWithChildren;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Animated/useAnimatedProps.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = useAnimatedProps;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _AnimatedProps = _interopRequireDefault(require("./nodes/AnimatedProps"));
var _AnimatedEvent = require("./AnimatedEvent");
var _useRefEffect = _interopRequireDefault(require("../Utilities/useRefEffect"));
var _NativeAnimatedHelper = _interopRequireDefault(require("./NativeAnimatedHelper"));
var _react = require("react");
var _useLayoutEffect = _interopRequireDefault(require("../../../modules/useLayoutEffect"));
function useAnimatedProps(props) {
var _useReducer = (0, _react.useReducer)(count => count + 1, 0),
scheduleUpdate = _useReducer[1];
var onUpdateRef = (0, _react.useRef)(null);
// TODO: Only invalidate `node` if animated props or `style` change. In the
// previous implementation, we permitted `style` to override props with the
// same name property name as styles, so we can probably continue doing that.
// The ordering of other props *should* not matter.
var node = (0, _react.useMemo)(() => new _AnimatedProps.default(props, () => onUpdateRef.current == null ? void 0 : onUpdateRef.current()), [props]);
useAnimatedPropsLifecycle(node);
// TODO: This "effect" does three things:
//
// 1) Call `setNativeView`.
// 2) Update `onUpdateRef`.
// 3) Update listeners for `AnimatedEvent` props.
//
// Ideally, each of these would be separat "effects" so that they are not
// unnecessarily re-run when irrelevant dependencies change. For example, we
// should be able to hoist all `AnimatedEvent` props and only do #3 if either
// the `AnimatedEvent` props change or `instance` changes.
//
// But there is no way to transparently compose three separate callback refs,
// so we just combine them all into one for now.
var refEffect = (0, _react.useCallback)(instance => {
// NOTE: This may be called more often than necessary (e.g. when `props`
// changes), but `setNativeView` already optimizes for that.
node.setNativeView(instance);
// NOTE: This callback is only used by the JavaScript animation driver.
onUpdateRef.current = () => {
// Schedule an update for this component to update `reducedProps`,
// but do not compute it immediately. If a parent also updated, we
// need to merge those new props in before updating.
scheduleUpdate();
};
var target = getEventTarget(instance);
var events = [];
for (var propName in props) {
var propValue = props[propName];
if (propValue instanceof _AnimatedEvent.AnimatedEvent && propValue.__isNative) {
propValue.__attach(target, propName);
events.push([propName, propValue]);
}
}
return () => {
onUpdateRef.current = null;
for (var _i = 0, _events = events; _i < _events.length; _i++) {
var _events$_i = _events[_i],
_propName = _events$_i[0],
_propValue = _events$_i[1];
_propValue.__detach(target, _propName);
}
};
}, [props, node]);
var callbackRef = (0, _useRefEffect.default)(refEffect);
return [reduceAnimatedProps(node), callbackRef];
}
function reduceAnimatedProps(node) {
// Force `collapsable` to be false so that the native view is not flattened.
// Flattened views cannot be accurately referenced by the native driver.
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, node.__getValue()), {}, {
collapsable: false
});
}
/**
* Manages the lifecycle of the supplied `AnimatedProps` by invoking `__attach`
* and `__detach`. However, this is more complicated because `AnimatedProps`
* uses reference counting to determine when to recursively detach its children
* nodes. So in order to optimize this, we avoid detaching until the next attach
* unless we are unmounting.
*/
function useAnimatedPropsLifecycle(node) {
var prevNodeRef = (0, _react.useRef)(null);
var isUnmountingRef = (0, _react.useRef)(false);
(0, _react.useEffect)(() => {
// It is ok for multiple components to call `flushQueue` because it noops
// if the queue is empty. When multiple animated components are mounted at
// the same time. Only first component flushes the queue and the others will noop.
_NativeAnimatedHelper.default.API.flushQueue();
});
(0, _useLayoutEffect.default)(() => {
isUnmountingRef.current = false;
return () => {
isUnmountingRef.current = true;
};
}, []);
(0, _useLayoutEffect.default)(() => {
node.__attach();
if (prevNodeRef.current != null) {
var prevNode = prevNodeRef.current;
// TODO: Stop restoring default values (unless `reset` is called).
prevNode.__restoreDefaultValues();
prevNode.__detach();
prevNodeRef.current = null;
}
return () => {
if (isUnmountingRef.current) {
// NOTE: Do not restore default values on unmount, see D18197735.
node.__detach();
} else {
prevNodeRef.current = node;
}
};
}, [node]);
}
function getEventTarget(instance) {
return typeof instance === 'object' && typeof (instance == null ? void 0 : instance.getScrollableNode) === 'function' ?
// $FlowFixMe[incompatible-use] - Legacy instance assumptions.
instance.getScrollableNode() : instance;
}
// $FlowFixMe[unclear-type] - Legacy instance assumptions.
function isFabricInstance(instance) {
var _instance$getScrollRe;
return hasFabricHandle(instance) ||
// Some components have a setNativeProps function but aren't a host component
// such as lists like FlatList and SectionList. These should also use
// forceUpdate in Fabric since setNativeProps doesn't exist on the underlying
// host component. This crazy hack is essentially special casing those lists and
// ScrollView itself to use forceUpdate in Fabric.
// If these components end up using forwardRef then these hacks can go away
// as instance would actually be the underlying host component and the above check
// would be sufficient.
hasFabricHandle(instance == null ? void 0 : instance.getNativeScrollRef == null ? void 0 : instance.getNativeScrollRef()) || hasFabricHandle(instance == null ? void 0 : instance.getScrollResponder == null ? void 0 : (_instance$getScrollRe = instance.getScrollResponder()) == null ? void 0 : _instance$getScrollRe.getNativeScrollRef == null ? void 0 : _instance$getScrollRe.getNativeScrollRef());
}
// $FlowFixMe[unclear-type] - Legacy instance assumptions.
function hasFabricHandle(instance) {
var _instance$_internalIn, _instance$_internalIn2;
// eslint-disable-next-line dot-notation
return (instance == null ? void 0 : (_instance$_internalIn = instance['_internalInstanceHandle']) == null ? void 0 : (_instance$_internalIn2 = _instance$_internalIn.stateNode) == null ? void 0 : _instance$_internalIn2.canonical) != null;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Batchinator/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _InteractionManager = _interopRequireDefault(require("../../../exports/InteractionManager"));
/**
* A simple class for batching up invocations of a low-pri callback. A timeout is set to run the
* callback once after a delay, no matter how many times it's scheduled. Once the delay is reached,
* InteractionManager.runAfterInteractions is used to invoke the callback after any hi-pri
* interactions are done running.
*
* Make sure to cleanup with dispose(). Example:
*
* class Widget extends React.Component {
* _batchedSave: new Batchinator(() => this._saveState, 1000);
* _saveSate() {
* // save this.state to disk
* }
* componentDidUpdate() {
* this._batchedSave.schedule();
* }
* componentWillUnmount() {
* this._batchedSave.dispose();
* }
* ...
* }
*/
class Batchinator {
constructor(callback, delayMS) {
this._delay = delayMS;
this._callback = callback;
}
/*
* Cleanup any pending tasks.
*
* By default, if there is a pending task the callback is run immediately. Set the option abort to
* true to not call the callback if it was pending.
*/
dispose(options) {
if (options === void 0) {
options = {
abort: false
};
}
if (this._taskHandle) {
this._taskHandle.cancel();
if (!options.abort) {
this._callback();
}
this._taskHandle = null;
}
}
schedule() {
if (this._taskHandle) {
return;
}
var timeoutHandle = setTimeout(() => {
this._taskHandle = _InteractionManager.default.runAfterInteractions(() => {
// Note that we clear the handle before invoking the callback so that if the callback calls
// schedule again, it will actually schedule another task.
this._taskHandle = null;
this._callback();
});
}, this._delay);
this._taskHandle = {
cancel: () => clearTimeout(timeoutHandle)
};
}
}
var _default = Batchinator;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/EventEmitter/NativeEventEmitter.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _Platform = _interopRequireDefault(require("../../../exports/Platform"));
var _RCTDeviceEventEmitter = _interopRequireDefault(require("./RCTDeviceEventEmitter"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
/**
* `NativeEventEmitter` is intended for use by Native Modules to emit events to
* JavaScript listeners. If a `NativeModule` is supplied to the constructor, it
* will be notified (via `addListener` and `removeListeners`) when the listener
* count changes to manage "native memory".
*
* Currently, all native events are fired via a global `RCTDeviceEventEmitter`.
* This means event names must be globally unique, and it means that call sites
* can theoretically listen to `RCTDeviceEventEmitter` (although discouraged).
*/
class NativeEventEmitter {
constructor(nativeModule) {
if (_Platform.default.OS === 'ios') {
(0, _invariant.default)(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.');
this._nativeModule = nativeModule;
}
}
addListener(eventType, listener, context) {
var _this$_nativeModule;
(_this$_nativeModule = this._nativeModule) == null ? void 0 : _this$_nativeModule.addListener(eventType);
var subscription = _RCTDeviceEventEmitter.default.addListener(eventType, listener, context);
return {
remove: () => {
if (subscription != null) {
var _this$_nativeModule2;
(_this$_nativeModule2 = this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1);
// $FlowFixMe[incompatible-use]
subscription.remove();
subscription = null;
}
}
};
}
/**
* @deprecated Use `remove` on the EventSubscription from `addListener`.
*/
removeListener(eventType, listener) {
var _this$_nativeModule3;
(_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(1);
// NOTE: This will report a deprecation notice via `console.error`.
// $FlowFixMe[prop-missing] - `removeListener` exists but is deprecated.
_RCTDeviceEventEmitter.default.removeListener(eventType, listener);
}
emit(eventType) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
// Generally, `RCTDeviceEventEmitter` is directly invoked. But this is
// included for completeness.
_RCTDeviceEventEmitter.default.emit(eventType, ...args);
}
removeAllListeners(eventType) {
var _this$_nativeModule4;
(0, _invariant.default)(eventType != null, '`NativeEventEmitter.removeAllListener()` requires a non-null argument.');
(_this$_nativeModule4 = this._nativeModule) == null ? void 0 : _this$_nativeModule4.removeListeners(this.listenerCount(eventType));
_RCTDeviceEventEmitter.default.removeAllListeners(eventType);
}
listenerCount(eventType) {
return _RCTDeviceEventEmitter.default.listenerCount(eventType);
}
}
exports.default = NativeEventEmitter;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/EventEmitter/RCTDeviceEventEmitter.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _EventEmitter = _interopRequireDefault(require("../vendor/emitter/EventEmitter"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* Global EventEmitter used by the native platform to emit events to JavaScript.
* Events are identified by globally unique event names.
*
* NativeModules that emit events should instead subclass `NativeEventEmitter`.
*/
var _default = new _EventEmitter.default();
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/FillRateHelper/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
class Info {
constructor() {
this.any_blank_count = 0;
this.any_blank_ms = 0;
this.any_blank_speed_sum = 0;
this.mostly_blank_count = 0;
this.mostly_blank_ms = 0;
this.pixels_blank = 0;
this.pixels_sampled = 0;
this.pixels_scrolled = 0;
this.total_time_spent = 0;
this.sample_count = 0;
}
}
var DEBUG = false;
var _listeners = [];
var _minSampleCount = 10;
var _sampleRate = DEBUG ? 1 : null;
/**
* A helper class for detecting when the maximem fill rate of `VirtualizedList` is exceeded.
* By default the sampling rate is set to zero and this will do nothing. If you want to collect
* samples (e.g. to log them), make sure to call `FillRateHelper.setSampleRate(0.0-1.0)`.
*
* Listeners and sample rate are global for all `VirtualizedList`s - typical usage will combine with
* `SceneTracker.getActiveScene` to determine the context of the events.
*/
class FillRateHelper {
static addListener(callback) {
if (_sampleRate === null) {
console.warn('Call `FillRateHelper.setSampleRate` before `addListener`.');
}
_listeners.push(callback);
return {
remove: () => {
_listeners = _listeners.filter(listener => callback !== listener);
}
};
}
static setSampleRate(sampleRate) {
_sampleRate = sampleRate;
}
static setMinSampleCount(minSampleCount) {
_minSampleCount = minSampleCount;
}
constructor(getFrameMetrics) {
this._anyBlankStartTime = null;
this._enabled = false;
this._info = new Info();
this._mostlyBlankStartTime = null;
this._samplesStartTime = null;
this._getFrameMetrics = getFrameMetrics;
this._enabled = (_sampleRate || 0) > Math.random();
this._resetData();
}
activate() {
if (this._enabled && this._samplesStartTime == null) {
DEBUG && console.debug('FillRateHelper: activate');
this._samplesStartTime = global.performance.now();
}
}
deactivateAndFlush() {
if (!this._enabled) {
return;
}
var start = this._samplesStartTime; // const for flow
if (start == null) {
DEBUG && console.debug('FillRateHelper: bail on deactivate with no start time');
return;
}
if (this._info.sample_count < _minSampleCount) {
// Don't bother with under-sampled events.
this._resetData();
return;
}
var total_time_spent = global.performance.now() - start;
var info = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this._info), {}, {
total_time_spent
});
if (DEBUG) {
var derived = {
avg_blankness: this._info.pixels_blank / this._info.pixels_sampled,
avg_speed: this._info.pixels_scrolled / (total_time_spent / 1000),
avg_speed_when_any_blank: this._info.any_blank_speed_sum / this._info.any_blank_count,
any_blank_per_min: this._info.any_blank_count / (total_time_spent / 1000 / 60),
any_blank_time_frac: this._info.any_blank_ms / total_time_spent,
mostly_blank_per_min: this._info.mostly_blank_count / (total_time_spent / 1000 / 60),
mostly_blank_time_frac: this._info.mostly_blank_ms / total_time_spent
};
for (var key in derived) {
// $FlowFixMe[prop-missing]
derived[key] = Math.round(1000 * derived[key]) / 1000;
}
console.debug('FillRateHelper deactivateAndFlush: ', {
derived,
info
});
}
_listeners.forEach(listener => listener(info));
this._resetData();
}
computeBlankness(props, cellsAroundViewport, scrollMetrics) {
if (!this._enabled || props.getItemCount(props.data) === 0 || cellsAroundViewport.last < cellsAroundViewport.first || this._samplesStartTime == null) {
return 0;
}
var dOffset = scrollMetrics.dOffset,
offset = scrollMetrics.offset,
velocity = scrollMetrics.velocity,
visibleLength = scrollMetrics.visibleLength;
// Denominator metrics that we track for all events - most of the time there is no blankness and
// we want to capture that.
this._info.sample_count++;
this._info.pixels_sampled += Math.round(visibleLength);
this._info.pixels_scrolled += Math.round(Math.abs(dOffset));
var scrollSpeed = Math.round(Math.abs(velocity) * 1000); // px / sec
// Whether blank now or not, record the elapsed time blank if we were blank last time.
var now = global.performance.now();
if (this._anyBlankStartTime != null) {
this._info.any_blank_ms += now - this._anyBlankStartTime;
}
this._anyBlankStartTime = null;
if (this._mostlyBlankStartTime != null) {
this._info.mostly_blank_ms += now - this._mostlyBlankStartTime;
}
this._mostlyBlankStartTime = null;
var blankTop = 0;
var first = cellsAroundViewport.first;
var firstFrame = this._getFrameMetrics(first, props);
while (first <= cellsAroundViewport.last && (!firstFrame || !firstFrame.inLayout)) {
firstFrame = this._getFrameMetrics(first, props);
first++;
}
// Only count blankTop if we aren't rendering the first item, otherwise we will count the header
// as blank.
if (firstFrame && first > 0) {
blankTop = Math.min(visibleLength, Math.max(0, firstFrame.offset - offset));
}
var blankBottom = 0;
var last = cellsAroundViewport.last;
var lastFrame = this._getFrameMetrics(last, props);
while (last >= cellsAroundViewport.first && (!lastFrame || !lastFrame.inLayout)) {
lastFrame = this._getFrameMetrics(last, props);
last--;
}
// Only count blankBottom if we aren't rendering the last item, otherwise we will count the
// footer as blank.
if (lastFrame && last < props.getItemCount(props.data) - 1) {
var bottomEdge = lastFrame.offset + lastFrame.length;
blankBottom = Math.min(visibleLength, Math.max(0, offset + visibleLength - bottomEdge));
}
var pixels_blank = Math.round(blankTop + blankBottom);
var blankness = pixels_blank / visibleLength;
if (blankness > 0) {
this._anyBlankStartTime = now;
this._info.any_blank_speed_sum += scrollSpeed;
this._info.any_blank_count++;
this._info.pixels_blank += pixels_blank;
if (blankness > 0.5) {
this._mostlyBlankStartTime = now;
this._info.mostly_blank_count++;
}
} else if (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) {
this.deactivateAndFlush();
}
return blankness;
}
enabled() {
return this._enabled;
}
_resetData() {
this._anyBlankStartTime = null;
this._info = new Info();
this._mostlyBlankStartTime = null;
this._samplesStartTime = null;
}
}
var _default = FillRateHelper;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/FlatList/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _View = _interopRequireDefault(require("../../../exports/View"));
var _StyleSheet = _interopRequireDefault(require("../../../exports/StyleSheet"));
var _deepDiffer = _interopRequireDefault(require("../deepDiffer"));
var _Platform = _interopRequireDefault(require("../../../exports/Platform"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var React = _interopRequireWildcard(require("react"));
var _VirtualizedList = _interopRequireDefault(require("../VirtualizedList"));
var _VirtualizeUtils = require("../VirtualizeUtils");
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
var _excluded = ["numColumns", "columnWrapperStyle", "removeClippedSubviews", "strictMode"];
/**
* Default Props Helper Functions
* Use the following helper functions for default values
*/
// removeClippedSubviewsOrDefault(this.props.removeClippedSubviews)
function removeClippedSubviewsOrDefault(removeClippedSubviews) {
return removeClippedSubviews !== null && removeClippedSubviews !== void 0 ? removeClippedSubviews : _Platform.default.OS === 'android';
}
// numColumnsOrDefault(this.props.numColumns)
function numColumnsOrDefault(numColumns) {
return numColumns !== null && numColumns !== void 0 ? numColumns : 1;
}
function isArrayLike(data) {
// $FlowExpectedError[incompatible-use]
return typeof Object(data).length === 'number';
}
/**
* A performant interface for rendering simple, flat lists, supporting the most handy features:
*
* - Fully cross-platform.
* - Optional horizontal mode.
* - Configurable viewability callbacks.
* - Header support.
* - Footer support.
* - Separator support.
* - Pull to Refresh.
* - Scroll loading.
* - ScrollToIndex support.
*
* If you need section support, use [`<SectionList>`](docs/sectionlist.html).
*
* Minimal Example:
*
* <FlatList
* data={[{key: 'a'}, {key: 'b'}]}
* renderItem={({item}) => <Text>{item.key}</Text>}
* />
*
* More complex, multi-select example demonstrating `PureComponent` usage for perf optimization and avoiding bugs.
*
* - By binding the `onPressItem` handler, the props will remain `===` and `PureComponent` will
* prevent wasteful re-renders unless the actual `id`, `selected`, or `title` props change, even
* if the components rendered in `MyListItem` did not have such optimizations.
* - By passing `extraData={this.state}` to `FlatList` we make sure `FlatList` itself will re-render
* when the `state.selected` changes. Without setting this prop, `FlatList` would not know it
* needs to re-render any items because it is also a `PureComponent` and the prop comparison will
* not show any changes.
* - `keyExtractor` tells the list to use the `id`s for the react keys instead of the default `key` property.
*
*
* class MyListItem extends React.PureComponent {
* _onPress = () => {
* this.props.onPressItem(this.props.id);
* };
*
* render() {
* const textColor = this.props.selected ? "red" : "black";
* return (
* <TouchableOpacity onPress={this._onPress}>
* <View>
* <Text style={{ color: textColor }}>
* {this.props.title}
* </Text>
* </View>
* </TouchableOpacity>
* );
* }
* }
*
* class MultiSelectList extends React.PureComponent {
* state = {selected: (new Map(): Map<string, boolean>)};
*
* _keyExtractor = (item, index) => item.id;
*
* _onPressItem = (id: string) => {
* // updater functions are preferred for transactional updates
* this.setState((state) => {
* // copy the map rather than modifying state.
* const selected = new Map(state.selected);
* selected.set(id, !selected.get(id)); // toggle
* return {selected};
* });
* };
*
* _renderItem = ({item}) => (
* <MyListItem
* id={item.id}
* onPressItem={this._onPressItem}
* selected={!!this.state.selected.get(item.id)}
* title={item.title}
* />
* );
*
* render() {
* return (
* <FlatList
* data={this.props.data}
* extraData={this.state}
* keyExtractor={this._keyExtractor}
* renderItem={this._renderItem}
* />
* );
* }
* }
*
* This is a convenience wrapper around [`<VirtualizedList>`](docs/virtualizedlist.html),
* and thus inherits its props (as well as those of `ScrollView`) that aren't explicitly listed
* here, along with the following caveats:
*
* - Internal state is not preserved when content scrolls out of the render window. Make sure all
* your data is captured in the item data or external stores like Flux, Redux, or Relay.
* - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop
* (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on
* changes. This includes the `data` prop and parent component state.
* - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously
* offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see
* blank content. This is a tradeoff that can be adjusted to suit the needs of each application,
* and we are working on improving it behind the scenes.
* - By default, the list looks for a `key` prop on each item and uses that for the React key.
* Alternatively, you can provide a custom `keyExtractor` prop.
*
* Also inherits [ScrollView Props](docs/scrollview.html#props), unless it is nested in another FlatList of same orientation.
*/
class FlatList extends React.PureComponent {
/**
* Scrolls to the end of the content. May be janky without `getItemLayout` prop.
*/
scrollToEnd(params) {
if (this._listRef) {
this._listRef.scrollToEnd(params);
}
}
/**
* Scrolls to the item at the specified index such that it is positioned in the viewable area
* such that `viewPosition` 0 places it at the top, 1 at the bottom, and 0.5 centered in the
* middle. `viewOffset` is a fixed number of pixels to offset the final target position.
*
* Note: cannot scroll to locations outside the render window without specifying the
* `getItemLayout` prop.
*/
scrollToIndex(params) {
if (this._listRef) {
this._listRef.scrollToIndex(params);
}
}
/**
* Requires linear scan through data - use `scrollToIndex` instead if possible.
*
* Note: cannot scroll to locations outside the render window without specifying the
* `getItemLayout` prop.
*/
scrollToItem(params) {
if (this._listRef) {
this._listRef.scrollToItem(params);
}
}
/**
* Scroll to a specific content pixel offset in the list.
*
* Check out [scrollToOffset](docs/virtualizedlist.html#scrolltooffset) of VirtualizedList
*/
scrollToOffset(params) {
if (this._listRef) {
this._listRef.scrollToOffset(params);
}
}
/**
* Tells the list an interaction has occurred, which should trigger viewability calculations, e.g.
* if `waitForInteractions` is true and the user has not scrolled. This is typically called by
* taps on items or by navigation actions.
*/
recordInteraction() {
if (this._listRef) {
this._listRef.recordInteraction();
}
}
/**
* Displays the scroll indicators momentarily.
*
* @platform ios
*/
flashScrollIndicators() {
if (this._listRef) {
this._listRef.flashScrollIndicators();
}
}
/**
* Provides a handle to the underlying scroll responder.
*/
getScrollResponder() {
if (this._listRef) {
return this._listRef.getScrollResponder();
}
}
/**
* Provides a reference to the underlying host component
*/
getNativeScrollRef() {
if (this._listRef) {
/* $FlowFixMe[incompatible-return] Suppresses errors found when fixing
* TextInput typing */
return this._listRef.getScrollRef();
}
}
getScrollableNode() {
if (this._listRef) {
return this._listRef.getScrollableNode();
}
}
constructor(_props) {
super(_props);
this._virtualizedListPairs = [];
this._captureRef = ref => {
this._listRef = ref;
};
this._getItem = (data, index) => {
var numColumns = numColumnsOrDefault(this.props.numColumns);
if (numColumns > 1) {
var ret = [];
for (var kk = 0; kk < numColumns; kk++) {
var itemIndex = index * numColumns + kk;
if (itemIndex < data.length) {
var _item = data[itemIndex];
ret.push(_item);
}
}
return ret;
} else {
return data[index];
}
};
this._getItemCount = data => {
// Legacy behavior of FlatList was to forward "undefined" length if invalid
// data like a non-arraylike object is passed. VirtualizedList would then
// coerce this, and the math would work out to no-op. For compatibility, if
// invalid data is passed, we tell VirtualizedList there are zero items
// available to prevent it from trying to read from the invalid data
// (without propagating invalidly typed data).
if (data != null && isArrayLike(data)) {
var numColumns = numColumnsOrDefault(this.props.numColumns);
return numColumns > 1 ? Math.ceil(data.length / numColumns) : data.length;
} else {
return 0;
}
};
this._keyExtractor = (items, index) => {
var _this$props$keyExtrac;
var numColumns = numColumnsOrDefault(this.props.numColumns);
var keyExtractor = (_this$props$keyExtrac = this.props.keyExtractor) !== null && _this$props$keyExtrac !== void 0 ? _this$props$keyExtrac : _VirtualizeUtils.keyExtractor;
if (numColumns > 1) {
(0, _invariant.default)(Array.isArray(items), 'FlatList: Encountered internal consistency error, expected each item to consist of an ' + 'array with 1-%s columns; instead, received a single item.', numColumns);
return items.map((item, kk) => keyExtractor(item, index * numColumns + kk)).join(':');
}
// $FlowFixMe[incompatible-call] Can't call keyExtractor with an array
return keyExtractor(items, index);
};
this._renderer = (ListItemComponent, renderItem, columnWrapperStyle, numColumns, extraData
// $FlowFixMe[missing-local-annot]
) => {
var cols = numColumnsOrDefault(numColumns);
var render = props => {
if (ListItemComponent) {
// $FlowFixMe[not-a-component] Component isn't valid
// $FlowFixMe[incompatible-type-arg] Component isn't valid
// $FlowFixMe[incompatible-return] Component isn't valid
return /*#__PURE__*/React.createElement(ListItemComponent, props);
} else if (renderItem) {
// $FlowFixMe[incompatible-call]
return renderItem(props);
} else {
return null;
}
};
var renderProp = info => {
if (cols > 1) {
var _item2 = info.item,
_index = info.index;
(0, _invariant.default)(Array.isArray(_item2), 'Expected array of items with numColumns > 1');
return /*#__PURE__*/React.createElement(_View.default, {
style: [styles.row, columnWrapperStyle]
}, _item2.map((it, kk) => {
var element = render({
// $FlowFixMe[incompatible-call]
item: it,
index: _index * cols + kk,
separators: info.separators
});
return element != null ? /*#__PURE__*/React.createElement(React.Fragment, {
key: kk
}, element) : null;
}));
} else {
return render(info);
}
};
return ListItemComponent ? {
ListItemComponent: renderProp
} : {
renderItem: renderProp
};
};
this._memoizedRenderer = (0, _memoizeOne.default)(this._renderer);
this._checkProps(this.props);
if (this.props.viewabilityConfigCallbackPairs) {
this._virtualizedListPairs = this.props.viewabilityConfigCallbackPairs.map(pair => ({
viewabilityConfig: pair.viewabilityConfig,
onViewableItemsChanged: this._createOnViewableItemsChanged(pair.onViewableItemsChanged)
}));
} else if (this.props.onViewableItemsChanged) {
this._virtualizedListPairs.push({
/* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This
* comment suppresses an error found when Flow v0.63 was deployed. To
* see the error delete this comment and run Flow. */
viewabilityConfig: this.props.viewabilityConfig,
onViewableItemsChanged: this._createOnViewableItemsChanged(this.props.onViewableItemsChanged)
});
}
}
// $FlowFixMe[missing-local-annot]
componentDidUpdate(prevProps) {
(0, _invariant.default)(prevProps.numColumns === this.props.numColumns, 'Changing numColumns on the fly is not supported. Change the key prop on FlatList when ' + 'changing the number of columns to force a fresh render of the component.');
(0, _invariant.default)(prevProps.onViewableItemsChanged === this.props.onViewableItemsChanged, 'Changing onViewableItemsChanged on the fly is not supported');
(0, _invariant.default)(!(0, _deepDiffer.default)(prevProps.viewabilityConfig, this.props.viewabilityConfig), 'Changing viewabilityConfig on the fly is not supported');
(0, _invariant.default)(prevProps.viewabilityConfigCallbackPairs === this.props.viewabilityConfigCallbackPairs, 'Changing viewabilityConfigCallbackPairs on the fly is not supported');
this._checkProps(this.props);
}
// $FlowFixMe[missing-local-annot]
_checkProps(props) {
var getItem = props.getItem,
getItemCount = props.getItemCount,
horizontal = props.horizontal,
columnWrapperStyle = props.columnWrapperStyle,
onViewableItemsChanged = props.onViewableItemsChanged,
viewabilityConfigCallbackPairs = props.viewabilityConfigCallbackPairs;
var numColumns = numColumnsOrDefault(this.props.numColumns);
(0, _invariant.default)(!getItem && !getItemCount, 'FlatList does not support custom data formats.');
if (numColumns > 1) {
(0, _invariant.default)(!horizontal, 'numColumns does not support horizontal.');
} else {
(0, _invariant.default)(!columnWrapperStyle, 'columnWrapperStyle not supported for single column lists');
}
(0, _invariant.default)(!(onViewableItemsChanged && viewabilityConfigCallbackPairs), 'FlatList does not support setting both onViewableItemsChanged and ' + 'viewabilityConfigCallbackPairs.');
}
_pushMultiColumnViewable(arr, v) {
var _this$props$keyExtrac2;
var numColumns = numColumnsOrDefault(this.props.numColumns);
var keyExtractor = (_this$props$keyExtrac2 = this.props.keyExtractor) !== null && _this$props$keyExtrac2 !== void 0 ? _this$props$keyExtrac2 : _VirtualizeUtils.keyExtractor;
v.item.forEach((item, ii) => {
(0, _invariant.default)(v.index != null, 'Missing index!');
var index = v.index * numColumns + ii;
arr.push((0, _objectSpread2.default)((0, _objectSpread2.default)({}, v), {}, {
item,
key: keyExtractor(item, index),
index
}));
});
}
_createOnViewableItemsChanged(onViewableItemsChanged
// $FlowFixMe[missing-local-annot]
) {
return info => {
var numColumns = numColumnsOrDefault(this.props.numColumns);
if (onViewableItemsChanged) {
if (numColumns > 1) {
var changed = [];
var viewableItems = [];
info.viewableItems.forEach(v => this._pushMultiColumnViewable(viewableItems, v));
info.changed.forEach(v => this._pushMultiColumnViewable(changed, v));
onViewableItemsChanged({
viewableItems,
changed
});
} else {
onViewableItemsChanged(info);
}
}
};
}
render() {
var _this$props = this.props,
numColumns = _this$props.numColumns,
columnWrapperStyle = _this$props.columnWrapperStyle,
_removeClippedSubviews = _this$props.removeClippedSubviews,
_this$props$strictMod = _this$props.strictMode,
strictMode = _this$props$strictMod === void 0 ? false : _this$props$strictMod,
restProps = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
var renderer = strictMode ? this._memoizedRenderer : this._renderer;
return (
/*#__PURE__*/
// $FlowFixMe[incompatible-exact] - `restProps` (`Props`) is inexact.
React.createElement(_VirtualizedList.default, (0, _extends2.default)({}, restProps, {
getItem: this._getItem,
getItemCount: this._getItemCount,
keyExtractor: this._keyExtractor,
ref: this._captureRef,
viewabilityConfigCallbackPairs: this._virtualizedListPairs,
removeClippedSubviews: removeClippedSubviewsOrDefault(_removeClippedSubviews)
}, renderer(this.props.ListItemComponent, this.props.renderItem, columnWrapperStyle, numColumns, this.props.extraData)))
);
}
}
var styles = _StyleSheet.default.create({
row: {
flexDirection: 'row'
}
});
var _default = FlatList;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/LayoutAnimation/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _Platform = _interopRequireDefault(require("../../../exports/Platform"));
var _UIManager = _interopRequireDefault(require("../../../exports/UIManager"));
var __DEV__ = process.env.NODE_ENV !== 'production';
function configureNext(config, onAnimationDidEnd) {
if (!_Platform.default.isTesting) {
_UIManager.default.configureNextLayoutAnimation(config, onAnimationDidEnd !== null && onAnimationDidEnd !== void 0 ? onAnimationDidEnd : function () {}, function () {} /* unused onError */);
}
}
function create(duration, type, property) {
return {
duration,
create: {
type,
property
},
update: {
type
},
delete: {
type,
property
}
};
}
var Presets = {
easeInEaseOut: create(300, 'easeInEaseOut', 'opacity'),
linear: create(500, 'linear', 'opacity'),
spring: {
duration: 700,
create: {
type: 'linear',
property: 'opacity'
},
update: {
type: 'spring',
springDamping: 0.4
},
delete: {
type: 'linear',
property: 'opacity'
}
}
};
/**
* Automatically animates views to their new positions when the
* next layout happens.
*
* A common way to use this API is to call it before calling `setState`.
*
* Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`:
*
* UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
*/
var LayoutAnimation = {
/**
* Schedules an animation to happen on the next layout.
*
* @param config Specifies animation properties:
*
* - `duration` in milliseconds
* - `create`, `AnimationConfig` for animating in new views
* - `update`, `AnimationConfig` for animating views that have been updated
*
* @param onAnimationDidEnd Called when the animation finished.
* Only supported on iOS.
* @param onError Called on error. Only supported on iOS.
*/
configureNext,
/**
* Helper for creating a config for `configureNext`.
*/
create,
Types: Object.freeze({
spring: 'spring',
linear: 'linear',
easeInEaseOut: 'easeInEaseOut',
easeIn: 'easeIn',
easeOut: 'easeOut',
keyboard: 'keyboard'
}),
Properties: Object.freeze({
opacity: 'opacity',
scaleX: 'scaleX',
scaleY: 'scaleY',
scaleXY: 'scaleXY'
}),
checkConfig() {
console.error('LayoutAnimation.checkConfig(...) has been disabled.');
},
Presets,
easeInEaseOut: configureNext.bind(null, Presets.easeInEaseOut),
linear: configureNext.bind(null, Presets.linear),
spring: configureNext.bind(null, Presets.spring)
};
var _default = LayoutAnimation;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/PanResponder/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _InteractionManager = _interopRequireDefault(require("../../../exports/InteractionManager"));
var _TouchHistoryMath = _interopRequireDefault(require("../TouchHistoryMath"));
var currentCentroidXOfTouchesChangedAfter = _TouchHistoryMath.default.currentCentroidXOfTouchesChangedAfter;
var currentCentroidYOfTouchesChangedAfter = _TouchHistoryMath.default.currentCentroidYOfTouchesChangedAfter;
var previousCentroidXOfTouchesChangedAfter = _TouchHistoryMath.default.previousCentroidXOfTouchesChangedAfter;
var previousCentroidYOfTouchesChangedAfter = _TouchHistoryMath.default.previousCentroidYOfTouchesChangedAfter;
var currentCentroidX = _TouchHistoryMath.default.currentCentroidX;
var currentCentroidY = _TouchHistoryMath.default.currentCentroidY;
/**
* `PanResponder` reconciles several touches into a single gesture. It makes
* single-touch gestures resilient to extra touches, and can be used to
* recognize simple multi-touch gestures.
*
* By default, `PanResponder` holds an `InteractionManager` handle to block
* long-running JS events from interrupting active gestures.
*
* It provides a predictable wrapper of the responder handlers provided by the
* [gesture responder system](docs/gesture-responder-system.html).
* For each handler, it provides a new `gestureState` object alongside the
* native event object:
*
* ```
* onPanResponderMove: (event, gestureState) => {}
* ```
*
* A native event is a synthetic touch event with the following form:
*
* - `nativeEvent`
* + `changedTouches` - Array of all touch events that have changed since the last event
* + `identifier` - The ID of the touch
* + `locationX` - The X position of the touch, relative to the element
* + `locationY` - The Y position of the touch, relative to the element
* + `pageX` - The X position of the touch, relative to the root element
* + `pageY` - The Y position of the touch, relative to the root element
* + `target` - The node id of the element receiving the touch event
* + `timestamp` - A time identifier for the touch, useful for velocity calculation
* + `touches` - Array of all current touches on the screen
*
* A `gestureState` object has the following:
*
* - `stateID` - ID of the gestureState- persisted as long as there at least
* one touch on screen
* - `moveX` - the latest screen coordinates of the recently-moved touch
* - `moveY` - the latest screen coordinates of the recently-moved touch
* - `x0` - the screen coordinates of the responder grant
* - `y0` - the screen coordinates of the responder grant
* - `dx` - accumulated distance of the gesture since the touch started
* - `dy` - accumulated distance of the gesture since the touch started
* - `vx` - current velocity of the gesture
* - `vy` - current velocity of the gesture
* - `numberActiveTouches` - Number of touches currently on screen
*
* ### Basic Usage
*
* ```
* componentWillMount: function() {
* this._panResponder = PanResponder.create({
* // Ask to be the responder:
* onStartShouldSetPanResponder: (evt, gestureState) => true,
* onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
* onMoveShouldSetPanResponder: (evt, gestureState) => true,
* onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,
*
* onPanResponderGrant: (evt, gestureState) => {
* // The gesture has started. Show visual feedback so the user knows
* // what is happening!
*
* // gestureState.d{x,y} will be set to zero now
* },
* onPanResponderMove: (evt, gestureState) => {
* // The most recent move distance is gestureState.move{X,Y}
*
* // The accumulated gesture distance since becoming responder is
* // gestureState.d{x,y}
* },
* onPanResponderTerminationRequest: (evt, gestureState) => true,
* onPanResponderRelease: (evt, gestureState) => {
* // The user has released all touches while this view is the
* // responder. This typically means a gesture has succeeded
* },
* onPanResponderTerminate: (evt, gestureState) => {
* // Another component has become the responder, so this gesture
* // should be cancelled
* },
* onShouldBlockNativeResponder: (evt, gestureState) => {
* // Returns whether this component should block native components from becoming the JS
* // responder. Returns true by default. Is currently only supported on android.
* return true;
* },
* });
* },
*
* render: function() {
* return (
* <View {...this._panResponder.panHandlers} />
* );
* },
*
* ```
*
* ### Working Example
*
* To see it in action, try the
* [PanResponder example in RNTester](https://github.com/facebook/react-native/blob/master/RNTester/js/PanResponderExample.js)
*/
var PanResponder = {
/**
*
* A graphical explanation of the touch data flow:
*
* +----------------------------+ +--------------------------------+
* | ResponderTouchHistoryStore | |TouchHistoryMath |
* +----------------------------+ +----------+---------------------+
* |Global store of touchHistory| |Allocation-less math util |
* |including activeness, start | |on touch history (centroids |
* |position, prev/cur position.| |and multitouch movement etc) |
* | | | |
* +----^-----------------------+ +----^---------------------------+
* | |
* | (records relevant history |
* | of touches relevant for |
* | implementing higher level |
* | gestures) |
* | |
* +----+-----------------------+ +----|---------------------------+
* | ResponderEventPlugin | | | Your App/Component |
* +----------------------------+ +----|---------------------------+
* |Negotiates which view gets | Low level | | High level |
* |onResponderMove events. | events w/ | +-+-------+ events w/ |
* |Also records history into | touchHistory| | Pan | multitouch + |
* |ResponderTouchHistoryStore. +---------------->Responder+-----> accumulative|
* +----------------------------+ attached to | | | distance and |
* each event | +---------+ velocity. |
* | |
* | |
* +--------------------------------+
*
*
*
* Gesture that calculates cumulative movement over time in a way that just
* "does the right thing" for multiple touches. The "right thing" is very
* nuanced. When moving two touches in opposite directions, the cumulative
* distance is zero in each dimension. When two touches move in parallel five
* pixels in the same direction, the cumulative distance is five, not ten. If
* two touches start, one moves five in a direction, then stops and the other
* touch moves fives in the same direction, the cumulative distance is ten.
*
* This logic requires a kind of processing of time "clusters" of touch events
* so that two touch moves that essentially occur in parallel but move every
* other frame respectively, are considered part of the same movement.
*
* Explanation of some of the non-obvious fields:
*
* - moveX/moveY: If no move event has been observed, then `(moveX, moveY)` is
* invalid. If a move event has been observed, `(moveX, moveY)` is the
* centroid of the most recently moved "cluster" of active touches.
* (Currently all move have the same timeStamp, but later we should add some
* threshold for what is considered to be "moving"). If a palm is
* accidentally counted as a touch, but a finger is moving greatly, the palm
* will move slightly, but we only want to count the single moving touch.
* - x0/y0: Centroid location (non-cumulative) at the time of becoming
* responder.
* - dx/dy: Cumulative touch distance - not the same thing as sum of each touch
* distance. Accounts for touch moves that are clustered together in time,
* moving the same direction. Only valid when currently responder (otherwise,
* it only represents the drag distance below the threshold).
* - vx/vy: Velocity.
*/
_initializeGestureState(gestureState) {
gestureState.moveX = 0;
gestureState.moveY = 0;
gestureState.x0 = 0;
gestureState.y0 = 0;
gestureState.dx = 0;
gestureState.dy = 0;
gestureState.vx = 0;
gestureState.vy = 0;
gestureState.numberActiveTouches = 0;
// All `gestureState` accounts for timeStamps up until:
gestureState._accountsForMovesUpTo = 0;
},
/**
* This is nuanced and is necessary. It is incorrect to continuously take all
* active *and* recently moved touches, find the centroid, and track how that
* result changes over time. Instead, we must take all recently moved
* touches, and calculate how the centroid has changed just for those
* recently moved touches, and append that change to an accumulator. This is
* to (at least) handle the case where the user is moving three fingers, and
* then one of the fingers stops but the other two continue.
*
* This is very different than taking all of the recently moved touches and
* storing their centroid as `dx/dy`. For correctness, we must *accumulate
* changes* in the centroid of recently moved touches.
*
* There is also some nuance with how we handle multiple moved touches in a
* single event. With the way `ReactNativeEventEmitter` dispatches touches as
* individual events, multiple touches generate two 'move' events, each of
* them triggering `onResponderMove`. But with the way `PanResponder` works,
* all of the gesture inference is performed on the first dispatch, since it
* looks at all of the touches (even the ones for which there hasn't been a
* native dispatch yet). Therefore, `PanResponder` does not call
* `onResponderMove` passed the first dispatch. This diverges from the
* typical responder callback pattern (without using `PanResponder`), but
* avoids more dispatches than necessary.
*/
_updateGestureStateOnMove(gestureState, touchHistory) {
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
gestureState.moveX = currentCentroidXOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo);
gestureState.moveY = currentCentroidYOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo);
var movedAfter = gestureState._accountsForMovesUpTo;
var prevX = previousCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);
var x = currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);
var prevY = previousCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);
var y = currentCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);
var nextDX = gestureState.dx + (x - prevX);
var nextDY = gestureState.dy + (y - prevY);
// TODO: This must be filtered intelligently.
var dt = touchHistory.mostRecentTimeStamp - gestureState._accountsForMovesUpTo;
gestureState.vx = (nextDX - gestureState.dx) / dt;
gestureState.vy = (nextDY - gestureState.dy) / dt;
gestureState.dx = nextDX;
gestureState.dy = nextDY;
gestureState._accountsForMovesUpTo = touchHistory.mostRecentTimeStamp;
},
/**
* @param {object} config Enhanced versions of all of the responder callbacks
* that provide not only the typical `ResponderSyntheticEvent`, but also the
* `PanResponder` gesture state. Simply replace the word `Responder` with
* `PanResponder` in each of the typical `onResponder*` callbacks. For
* example, the `config` object would look like:
*
* - `onMoveShouldSetPanResponder: (e, gestureState) => {...}`
* - `onMoveShouldSetPanResponderCapture: (e, gestureState) => {...}`
* - `onStartShouldSetPanResponder: (e, gestureState) => {...}`
* - `onStartShouldSetPanResponderCapture: (e, gestureState) => {...}`
* - `onPanResponderReject: (e, gestureState) => {...}`
* - `onPanResponderGrant: (e, gestureState) => {...}`
* - `onPanResponderStart: (e, gestureState) => {...}`
* - `onPanResponderEnd: (e, gestureState) => {...}`
* - `onPanResponderRelease: (e, gestureState) => {...}`
* - `onPanResponderMove: (e, gestureState) => {...}`
* - `onPanResponderTerminate: (e, gestureState) => {...}`
* - `onPanResponderTerminationRequest: (e, gestureState) => {...}`
* - `onShouldBlockNativeResponder: (e, gestureState) => {...}`
*
* In general, for events that have capture equivalents, we update the
* gestureState once in the capture phase and can use it in the bubble phase
* as well.
*
* Be careful with onStartShould* callbacks. They only reflect updated
* `gestureState` for start/end events that bubble/capture to the Node.
* Once the node is the responder, you can rely on every start/end event
* being processed by the gesture and `gestureState` being updated
* accordingly. (numberActiveTouches) may not be totally accurate unless you
* are the responder.
*/
create(config) {
var interactionState = {
handle: null,
shouldCancelClick: false,
timeout: null
};
var gestureState = {
// Useful for debugging
stateID: Math.random(),
moveX: 0,
moveY: 0,
x0: 0,
y0: 0,
dx: 0,
dy: 0,
vx: 0,
vy: 0,
numberActiveTouches: 0,
_accountsForMovesUpTo: 0
};
var panHandlers = {
onStartShouldSetResponder(event) {
return config.onStartShouldSetPanResponder == null ? false : config.onStartShouldSetPanResponder(event, gestureState);
},
onMoveShouldSetResponder(event) {
return config.onMoveShouldSetPanResponder == null ? false : config.onMoveShouldSetPanResponder(event, gestureState);
},
onStartShouldSetResponderCapture(event) {
// TODO: Actually, we should reinitialize the state any time
// touches.length increases from 0 active to > 0 active.
if (event.nativeEvent.touches.length === 1) {
PanResponder._initializeGestureState(gestureState);
}
gestureState.numberActiveTouches = event.touchHistory.numberActiveTouches;
return config.onStartShouldSetPanResponderCapture != null ? config.onStartShouldSetPanResponderCapture(event, gestureState) : false;
},
onMoveShouldSetResponderCapture(event) {
var touchHistory = event.touchHistory;
// Responder system incorrectly dispatches should* to current responder
// Filter out any touch moves past the first one - we would have
// already processed multi-touch geometry during the first event.
if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {
return false;
}
PanResponder._updateGestureStateOnMove(gestureState, touchHistory);
return config.onMoveShouldSetPanResponderCapture ? config.onMoveShouldSetPanResponderCapture(event, gestureState) : false;
},
onResponderGrant(event) {
if (!interactionState.handle) {
interactionState.handle = _InteractionManager.default.createInteractionHandle();
}
if (interactionState.timeout) {
clearInteractionTimeout(interactionState);
}
interactionState.shouldCancelClick = true;
gestureState.x0 = currentCentroidX(event.touchHistory);
gestureState.y0 = currentCentroidY(event.touchHistory);
gestureState.dx = 0;
gestureState.dy = 0;
if (config.onPanResponderGrant) {
config.onPanResponderGrant(event, gestureState);
}
// TODO: t7467124 investigate if this can be removed
return config.onShouldBlockNativeResponder == null ? true : config.onShouldBlockNativeResponder(event, gestureState);
},
onResponderReject(event) {
clearInteractionHandle(interactionState, config.onPanResponderReject, event, gestureState);
},
onResponderRelease(event) {
clearInteractionHandle(interactionState, config.onPanResponderRelease, event, gestureState);
setInteractionTimeout(interactionState);
PanResponder._initializeGestureState(gestureState);
},
onResponderStart(event) {
var touchHistory = event.touchHistory;
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
if (config.onPanResponderStart) {
config.onPanResponderStart(event, gestureState);
}
},
onResponderMove(event) {
var touchHistory = event.touchHistory;
// Guard against the dispatch of two touch moves when there are two
// simultaneously changed touches.
if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {
return;
}
// Filter out any touch moves past the first one - we would have
// already processed multi-touch geometry during the first event.
PanResponder._updateGestureStateOnMove(gestureState, touchHistory);
if (config.onPanResponderMove) {
config.onPanResponderMove(event, gestureState);
}
},
onResponderEnd(event) {
var touchHistory = event.touchHistory;
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
clearInteractionHandle(interactionState, config.onPanResponderEnd, event, gestureState);
},
onResponderTerminate(event) {
clearInteractionHandle(interactionState, config.onPanResponderTerminate, event, gestureState);
setInteractionTimeout(interactionState);
PanResponder._initializeGestureState(gestureState);
},
onResponderTerminationRequest(event) {
return config.onPanResponderTerminationRequest == null ? true : config.onPanResponderTerminationRequest(event, gestureState);
},
// We do not want to trigger 'click' activated gestures or native behaviors
// on any pan target that is under a mouse cursor when it is released.
// Browsers will natively cancel 'click' events on a target if a non-mouse
// active pointer moves.
onClickCapture: event => {
if (interactionState.shouldCancelClick === true) {
event.stopPropagation();
event.preventDefault();
}
}
};
return {
panHandlers,
getInteractionHandle() {
return interactionState.handle;
}
};
}
};
function clearInteractionHandle(interactionState, callback, event, gestureState) {
if (interactionState.handle) {
_InteractionManager.default.clearInteractionHandle(interactionState.handle);
interactionState.handle = null;
}
if (callback) {
callback(event, gestureState);
}
}
function clearInteractionTimeout(interactionState) {
clearTimeout(interactionState.timeout);
}
function setInteractionTimeout(interactionState) {
interactionState.timeout = setTimeout(() => {
interactionState.shouldCancelClick = false;
}, 250);
}
var _default = PanResponder;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/PooledClass/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
/* eslint-disable */
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* From React 16.0.0
*/
var twoArgumentPooler = function twoArgumentPooler(a1, a2) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2);
return instance;
} else {
return new Klass(a1, a2);
}
};
var standardReleaser = function standardReleaser(instance) {
var Klass = this;
instance.destructor();
if (Klass.instancePool.length < Klass.poolSize) {
Klass.instancePool.push(instance);
}
};
var DEFAULT_POOL_SIZE = 10;
var DEFAULT_POOLER = twoArgumentPooler;
/**
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
* itself (statically) not adding any prototypical fields. Any CopyConstructor
* you give this may have a `poolSize` property, and will look for a
* prototypical `destructor` on instances.
*
* @param {Function} CopyConstructor Constructor that can be used to reset.
* @param {Function} pooler Customizable pooler.
*/
var addPoolingTo = function addPoolingTo(CopyConstructor, pooler) {
// Casting as any so that flow ignores the actual implementation and trusts
// it to match the type we declared
var NewKlass = CopyConstructor;
NewKlass.instancePool = [];
NewKlass.getPooled = pooler || DEFAULT_POOLER;
if (!NewKlass.poolSize) {
NewKlass.poolSize = DEFAULT_POOL_SIZE;
}
NewKlass.release = standardReleaser;
return NewKlass;
};
var PooledClass = {
addPoolingTo: addPoolingTo,
twoArgumentPooler: twoArgumentPooler
};
var _default = PooledClass;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/ReactNative/ReactNativeFeatureFlags.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
exports.__esModule = true;
exports.default = void 0;
var ReactNativeFeatureFlags = {
isLayoutAnimationEnabled: () => true,
shouldEmitW3CPointerEvents: () => false,
shouldPressibilityUseW3CPointerEventsForHover: () => false,
animatedShouldDebounceQueueFlush: () => false,
animatedShouldUseSingleOp: () => false
};
var _default = ReactNativeFeatureFlags;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/SectionList/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _Platform = _interopRequireDefault(require("../../../exports/Platform"));
var React = _interopRequireWildcard(require("react"));
var _VirtualizedSectionList = _interopRequireDefault(require("../VirtualizedSectionList"));
var _excluded = ["stickySectionHeadersEnabled"];
/**
* A performant interface for rendering sectioned lists, supporting the most handy features:
*
* - Fully cross-platform.
* - Configurable viewability callbacks.
* - List header support.
* - List footer support.
* - Item separator support.
* - Section header support.
* - Section separator support.
* - Heterogeneous data and item rendering support.
* - Pull to Refresh.
* - Scroll loading.
*
* If you don't need section support and want a simpler interface, use
* [`<FlatList>`](https://reactnative.dev/docs/flatlist).
*
* Simple Examples:
*
* <SectionList
* renderItem={({item}) => <ListItem title={item} />}
* renderSectionHeader={({section}) => <Header title={section.title} />}
* sections={[ // homogeneous rendering between sections
* {data: [...], title: ...},
* {data: [...], title: ...},
* {data: [...], title: ...},
* ]}
* />
*
* <SectionList
* sections={[ // heterogeneous rendering between sections
* {data: [...], renderItem: ...},
* {data: [...], renderItem: ...},
* {data: [...], renderItem: ...},
* ]}
* />
*
* This is a convenience wrapper around [`<VirtualizedList>`](docs/virtualizedlist),
* and thus inherits its props (as well as those of `ScrollView`) that aren't explicitly listed
* here, along with the following caveats:
*
* - Internal state is not preserved when content scrolls out of the render window. Make sure all
* your data is captured in the item data or external stores like Flux, Redux, or Relay.
* - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop
* (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on
* changes. This includes the `data` prop and parent component state.
* - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously
* offscreen. This means it's possible to scroll faster than the fill rate and momentarily see
* blank content. This is a tradeoff that can be adjusted to suit the needs of each application,
* and we are working on improving it behind the scenes.
* - By default, the list looks for a `key` prop on each item and uses that for the React key.
* Alternatively, you can provide a custom `keyExtractor` prop.
*
*/
class SectionList extends React.PureComponent {
constructor() {
super(...arguments);
this._captureRef = ref => {
this._wrapperListRef = ref;
};
}
/**
* Scrolls to the item at the specified `sectionIndex` and `itemIndex` (within the section)
* positioned in the viewable area such that `viewPosition` 0 places it at the top (and may be
* covered by a sticky header), 1 at the bottom, and 0.5 centered in the middle. `viewOffset` is a
* fixed number of pixels to offset the final target position, e.g. to compensate for sticky
* headers.
*
* Note: cannot scroll to locations outside the render window without specifying the
* `getItemLayout` prop.
*/
scrollToLocation(params) {
if (this._wrapperListRef != null) {
this._wrapperListRef.scrollToLocation(params);
}
}
/**
* Tells the list an interaction has occurred, which should trigger viewability calculations, e.g.
* if `waitForInteractions` is true and the user has not scrolled. This is typically called by
* taps on items or by navigation actions.
*/
recordInteraction() {
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
listRef && listRef.recordInteraction();
}
/**
* Displays the scroll indicators momentarily.
*
* @platform ios
*/
flashScrollIndicators() {
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
listRef && listRef.flashScrollIndicators();
}
/**
* Provides a handle to the underlying scroll responder.
*/
getScrollResponder() {
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
if (listRef) {
return listRef.getScrollResponder();
}
}
getScrollableNode() {
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
if (listRef) {
return listRef.getScrollableNode();
}
}
render() {
var _this$props = this.props,
_stickySectionHeadersEnabled = _this$props.stickySectionHeadersEnabled,
restProps = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
var stickySectionHeadersEnabled = _stickySectionHeadersEnabled !== null && _stickySectionHeadersEnabled !== void 0 ? _stickySectionHeadersEnabled : _Platform.default.OS === 'ios';
return /*#__PURE__*/React.createElement(_VirtualizedSectionList.default, (0, _extends2.default)({}, restProps, {
stickySectionHeadersEnabled: stickySectionHeadersEnabled,
ref: this._captureRef,
getItemCount: items => items.length,
getItem: (items, index) => items[index]
}));
}
}
exports.default = SectionList;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/TouchHistoryMath/index.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
var TouchHistoryMath = {
/**
* This code is optimized and not intended to look beautiful. This allows
* computing of touch centroids that have moved after `touchesChangedAfter`
* timeStamp. You can compute the current centroid involving all touches
* moves after `touchesChangedAfter`, or you can compute the previous
* centroid of all touches that were moved after `touchesChangedAfter`.
*
* @param {TouchHistoryMath} touchHistory Standard Responder touch track
* data.
* @param {number} touchesChangedAfter timeStamp after which moved touches
* are considered "actively moving" - not just "active".
* @param {boolean} isXAxis Consider `x` dimension vs. `y` dimension.
* @param {boolean} ofCurrent Compute current centroid for actively moving
* touches vs. previous centroid of now actively moving touches.
* @return {number} value of centroid in specified dimension.
*/
centroidDimension: function centroidDimension(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) {
var touchBank = touchHistory.touchBank;
var total = 0;
var count = 0;
var oneTouchData = touchHistory.numberActiveTouches === 1 ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null;
if (oneTouchData !== null) {
if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {
total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;
count = 1;
}
} else {
for (var i = 0; i < touchBank.length; i++) {
var touchTrack = touchBank[i];
if (touchTrack !== null && touchTrack !== undefined && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) {
var toAdd = void 0; // Yuck, program temporarily in invalid state.
if (ofCurrent && isXAxis) {
toAdd = touchTrack.currentPageX;
} else if (ofCurrent && !isXAxis) {
toAdd = touchTrack.currentPageY;
} else if (!ofCurrent && isXAxis) {
toAdd = touchTrack.previousPageX;
} else {
toAdd = touchTrack.previousPageY;
}
total += toAdd;
count++;
}
}
}
return count > 0 ? total / count : TouchHistoryMath.noCentroid;
},
currentCentroidXOfTouchesChangedAfter: function currentCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {
return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true,
// isXAxis
true // ofCurrent
);
},
currentCentroidYOfTouchesChangedAfter: function currentCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {
return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false,
// isXAxis
true // ofCurrent
);
},
previousCentroidXOfTouchesChangedAfter: function previousCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {
return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true,
// isXAxis
false // ofCurrent
);
},
previousCentroidYOfTouchesChangedAfter: function previousCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) {
return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false,
// isXAxis
false // ofCurrent
);
},
currentCentroidX: function currentCentroidX(touchHistory) {
return TouchHistoryMath.centroidDimension(touchHistory, 0,
// touchesChangedAfter
true,
// isXAxis
true // ofCurrent
);
},
currentCentroidY: function currentCentroidY(touchHistory) {
return TouchHistoryMath.centroidDimension(touchHistory, 0,
// touchesChangedAfter
false,
// isXAxis
true // ofCurrent
);
},
noCentroid: -1
};
var _default = TouchHistoryMath;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/TurboModule/TurboModuleRegistry.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.get = get;
exports.getEnforcing = getEnforcing;
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
function get(name) {
return null;
}
function getEnforcing(name) {
var module = get(name);
(0, _invariant.default)(module != null, "TurboModuleRegistry.getEnforcing(...): '" + name + "' could not be found. " + 'Verify that a module by this name is registered in the native binary.');
return module;
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/Platform.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _Platform = _interopRequireDefault(require("../../../exports/Platform"));
var _default = _Platform.default;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/clamp.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
*/
'use strict';
function clamp(min, value, max) {
if (value < min) {
return min;
}
if (value > max) {
return max;
}
return value;
}
module.exports = clamp;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/useMergeRefs.js
"use strict";
exports.__esModule = true;
exports.default = useMergeRefs;
var _react = require("react");
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* Constructs a new ref that forwards new values to each of the given refs. The
* given refs will always be invoked in the order that they are supplied.
*
* WARNING: A known problem of merging refs using this approach is that if any
* of the given refs change, the returned callback ref will also be changed. If
* the returned callback ref is supplied as a `ref` to a React element, this may
* lead to problems with the given refs being invoked more times than desired.
*/
function useMergeRefs() {
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
refs[_key] = arguments[_key];
}
return (0, _react.useCallback)(current => {
for (var _i = 0, _refs = refs; _i < _refs.length; _i++) {
var ref = _refs[_i];
if (ref != null) {
if (typeof ref === 'function') {
ref(current);
} else {
ref.current = current;
}
}
}
}, [...refs] // eslint-disable-line react-hooks/exhaustive-deps
);
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/Utilities/useRefEffect.js
"use strict";
exports.__esModule = true;
exports.default = useRefEffect;
var _react = require("react");
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* Constructs a callback ref that provides similar semantics as `useEffect`. The
* supplied `effect` callback will be called with non-null component instances.
* The `effect` callback can also optionally return a cleanup function.
*
* When a component is updated or unmounted, the cleanup function is called. The
* `effect` callback will then be called again, if applicable.
*
* When a new `effect` callback is supplied, the previously returned cleanup
* function will be called before the new `effect` callback is called with the
* same instance.
*
* WARNING: The `effect` callback should be stable (e.g. using `useCallback`).
*/
function useRefEffect(effect) {
var cleanupRef = (0, _react.useRef)(undefined);
return (0, _react.useCallback)(instance => {
if (cleanupRef.current) {
cleanupRef.current();
cleanupRef.current = undefined;
}
if (instance != null) {
cleanupRef.current = effect(instance);
}
}, [effect]);
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/ViewabilityHelper/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelperLoose"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
/**
* A Utility class for calculating viewable items based on current metrics like scroll position and
* layout.
*
* An item is said to be in a "viewable" state when any of the following
* is true for longer than `minimumViewTime` milliseconds (after an interaction if `waitForInteraction`
* is true):
*
* - Occupying >= `viewAreaCoveragePercentThreshold` of the view area XOR fraction of the item
* visible in the view area >= `itemVisiblePercentThreshold`.
* - Entirely visible on screen
*/
class ViewabilityHelper {
constructor(config) {
if (config === void 0) {
config = {
viewAreaCoveragePercentThreshold: 0
};
}
this._hasInteracted = false;
this._timers = new Set();
this._viewableIndices = [];
this._viewableItems = new Map();
this._config = config;
}
/**
* Cleanup, e.g. on unmount. Clears any pending timers.
*/
dispose() {
/* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This
* comment suppresses an error found when Flow v0.63 was deployed. To see
* the error delete this comment and run Flow. */
this._timers.forEach(clearTimeout);
}
/**
* Determines which items are viewable based on the current metrics and config.
*/
computeViewableItems(props, scrollOffset, viewportHeight, getFrameMetrics,
// Optional optimization to reduce the scan size
renderRange) {
var itemCount = props.getItemCount(props.data);
var _this$_config = this._config,
itemVisiblePercentThreshold = _this$_config.itemVisiblePercentThreshold,
viewAreaCoveragePercentThreshold = _this$_config.viewAreaCoveragePercentThreshold;
var viewAreaMode = viewAreaCoveragePercentThreshold != null;
var viewablePercentThreshold = viewAreaMode ? viewAreaCoveragePercentThreshold : itemVisiblePercentThreshold;
(0, _invariant.default)(viewablePercentThreshold != null && itemVisiblePercentThreshold != null !== (viewAreaCoveragePercentThreshold != null), 'Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold');
var viewableIndices = [];
if (itemCount === 0) {
return viewableIndices;
}
var firstVisible = -1;
var _ref = renderRange || {
first: 0,
last: itemCount - 1
},
first = _ref.first,
last = _ref.last;
if (last >= itemCount) {
console.warn('Invalid render range computing viewability ' + JSON.stringify({
renderRange,
itemCount
}));
return [];
}
for (var idx = first; idx <= last; idx++) {
var metrics = getFrameMetrics(idx, props);
if (!metrics) {
continue;
}
var top = metrics.offset - scrollOffset;
var bottom = top + metrics.length;
if (top < viewportHeight && bottom > 0) {
firstVisible = idx;
if (_isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, metrics.length)) {
viewableIndices.push(idx);
}
} else if (firstVisible >= 0) {
break;
}
}
return viewableIndices;
}
/**
* Figures out which items are viewable and how that has changed from before and calls
* `onViewableItemsChanged` as appropriate.
*/
onUpdate(props, scrollOffset, viewportHeight, getFrameMetrics, createViewToken, onViewableItemsChanged,
// Optional optimization to reduce the scan size
renderRange) {
var itemCount = props.getItemCount(props.data);
if (this._config.waitForInteraction && !this._hasInteracted || itemCount === 0 || !getFrameMetrics(0, props)) {
return;
}
var viewableIndices = [];
if (itemCount) {
viewableIndices = this.computeViewableItems(props, scrollOffset, viewportHeight, getFrameMetrics, renderRange);
}
if (this._viewableIndices.length === viewableIndices.length && this._viewableIndices.every((v, ii) => v === viewableIndices[ii])) {
// We might get a lot of scroll events where visibility doesn't change and we don't want to do
// extra work in those cases.
return;
}
this._viewableIndices = viewableIndices;
if (this._config.minimumViewTime) {
var handle = setTimeout(() => {
/* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This
* comment suppresses an error found when Flow v0.63 was deployed. To
* see the error delete this comment and run Flow. */
this._timers.delete(handle);
this._onUpdateSync(props, viewableIndices, onViewableItemsChanged, createViewToken);
}, this._config.minimumViewTime);
/* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This
* comment suppresses an error found when Flow v0.63 was deployed. To see
* the error delete this comment and run Flow. */
this._timers.add(handle);
} else {
this._onUpdateSync(props, viewableIndices, onViewableItemsChanged, createViewToken);
}
}
/**
* clean-up cached _viewableIndices to evaluate changed items on next update
*/
resetViewableIndices() {
this._viewableIndices = [];
}
/**
* Records that an interaction has happened even if there has been no scroll.
*/
recordInteraction() {
this._hasInteracted = true;
}
_onUpdateSync(props, viewableIndicesToCheck, onViewableItemsChanged, createViewToken) {
// Filter out indices that have gone out of view since this call was scheduled.
viewableIndicesToCheck = viewableIndicesToCheck.filter(ii => this._viewableIndices.includes(ii));
var prevItems = this._viewableItems;
var nextItems = new Map(viewableIndicesToCheck.map(ii => {
var viewable = createViewToken(ii, true, props);
return [viewable.key, viewable];
}));
var changed = [];
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(nextItems), _step; !(_step = _iterator()).done;) {
var _step$value = _step.value,
key = _step$value[0],
viewable = _step$value[1];
if (!prevItems.has(key)) {
changed.push(viewable);
}
}
for (var _iterator2 = (0, _createForOfIteratorHelperLoose2.default)(prevItems), _step2; !(_step2 = _iterator2()).done;) {
var _step2$value = _step2.value,
_key = _step2$value[0],
_viewable = _step2$value[1];
if (!nextItems.has(_key)) {
changed.push((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _viewable), {}, {
isViewable: false
}));
}
}
if (changed.length > 0) {
this._viewableItems = nextItems;
onViewableItemsChanged({
viewableItems: Array.from(nextItems.values()),
changed,
viewabilityConfig: this._config
});
}
}
}
function _isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, itemLength) {
if (_isEntirelyVisible(top, bottom, viewportHeight)) {
return true;
} else {
var pixels = _getPixelsVisible(top, bottom, viewportHeight);
var percent = 100 * (viewAreaMode ? pixels / viewportHeight : pixels / itemLength);
return percent >= viewablePercentThreshold;
}
}
function _getPixelsVisible(top, bottom, viewportHeight) {
var visibleHeight = Math.min(bottom, viewportHeight) - Math.max(top, 0);
return Math.max(0, visibleHeight);
}
function _isEntirelyVisible(top, bottom, viewportHeight) {
return top >= 0 && bottom <= viewportHeight && bottom > top;
}
var _default = ViewabilityHelper;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizeUtils/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
exports.__esModule = true;
exports.computeWindowedRenderLimits = computeWindowedRenderLimits;
exports.elementsThatOverlapOffsets = elementsThatOverlapOffsets;
exports.keyExtractor = keyExtractor;
exports.newRangeCount = newRangeCount;
/**
* Used to find the indices of the frames that overlap the given offsets. Useful for finding the
* items that bound different windows of content, such as the visible area or the buffered overscan
* area.
*/
function elementsThatOverlapOffsets(offsets, props, getFrameMetrics, zoomScale) {
if (zoomScale === void 0) {
zoomScale = 1;
}
var itemCount = props.getItemCount(props.data);
var result = [];
for (var offsetIndex = 0; offsetIndex < offsets.length; offsetIndex++) {
var currentOffset = offsets[offsetIndex];
var left = 0;
var right = itemCount - 1;
while (left <= right) {
// eslint-disable-next-line no-bitwise
var mid = left + (right - left >>> 1);
var frame = getFrameMetrics(mid, props);
var scaledOffsetStart = frame.offset * zoomScale;
var scaledOffsetEnd = (frame.offset + frame.length) * zoomScale;
// We want the first frame that contains the offset, with inclusive bounds. Thus, for the
// first frame the scaledOffsetStart is inclusive, while for other frames it is exclusive.
if (mid === 0 && currentOffset < scaledOffsetStart || mid !== 0 && currentOffset <= scaledOffsetStart) {
right = mid - 1;
} else if (currentOffset > scaledOffsetEnd) {
left = mid + 1;
} else {
result[offsetIndex] = mid;
break;
}
}
}
return result;
}
/**
* Computes the number of elements in the `next` range that are new compared to the `prev` range.
* Handy for calculating how many new items will be rendered when the render window changes so we
* can restrict the number of new items render at once so that content can appear on the screen
* faster.
*/
function newRangeCount(prev, next) {
return next.last - next.first + 1 - Math.max(0, 1 + Math.min(next.last, prev.last) - Math.max(next.first, prev.first));
}
/**
* Custom logic for determining which items should be rendered given the current frame and scroll
* metrics, as well as the previous render state. The algorithm may evolve over time, but generally
* prioritizes the visible area first, then expands that with overscan regions ahead and behind,
* biased in the direction of scroll.
*/
function computeWindowedRenderLimits(props, maxToRenderPerBatch, windowSize, prev, getFrameMetricsApprox, scrollMetrics) {
var itemCount = props.getItemCount(props.data);
if (itemCount === 0) {
return {
first: 0,
last: -1
};
}
var offset = scrollMetrics.offset,
velocity = scrollMetrics.velocity,
visibleLength = scrollMetrics.visibleLength,
_scrollMetrics$zoomSc = scrollMetrics.zoomScale,
zoomScale = _scrollMetrics$zoomSc === void 0 ? 1 : _scrollMetrics$zoomSc;
// Start with visible area, then compute maximum overscan region by expanding from there, biased
// in the direction of scroll. Total overscan area is capped, which should cap memory consumption
// too.
var visibleBegin = Math.max(0, offset);
var visibleEnd = visibleBegin + visibleLength;
var overscanLength = (windowSize - 1) * visibleLength;
// Considering velocity seems to introduce more churn than it's worth.
var leadFactor = 0.5; // Math.max(0, Math.min(1, velocity / 25 + 0.5));
var fillPreference = velocity > 1 ? 'after' : velocity < -1 ? 'before' : 'none';
var overscanBegin = Math.max(0, visibleBegin - (1 - leadFactor) * overscanLength);
var overscanEnd = Math.max(0, visibleEnd + leadFactor * overscanLength);
var lastItemOffset = getFrameMetricsApprox(itemCount - 1, props).offset * zoomScale;
if (lastItemOffset < overscanBegin) {
// Entire list is before our overscan window
return {
first: Math.max(0, itemCount - 1 - maxToRenderPerBatch),
last: itemCount - 1
};
}
// Find the indices that correspond to the items at the render boundaries we're targeting.
var _elementsThatOverlapO = elementsThatOverlapOffsets([overscanBegin, visibleBegin, visibleEnd, overscanEnd], props, getFrameMetricsApprox, zoomScale),
overscanFirst = _elementsThatOverlapO[0],
first = _elementsThatOverlapO[1],
last = _elementsThatOverlapO[2],
overscanLast = _elementsThatOverlapO[3];
overscanFirst = overscanFirst == null ? 0 : overscanFirst;
first = first == null ? Math.max(0, overscanFirst) : first;
overscanLast = overscanLast == null ? itemCount - 1 : overscanLast;
last = last == null ? Math.min(overscanLast, first + maxToRenderPerBatch - 1) : last;
var visible = {
first,
last
};
// We want to limit the number of new cells we're rendering per batch so that we can fill the
// content on the screen quickly. If we rendered the entire overscan window at once, the user
// could be staring at white space for a long time waiting for a bunch of offscreen content to
// render.
var newCellCount = newRangeCount(prev, visible);
while (true) {
if (first <= overscanFirst && last >= overscanLast) {
// If we fill the entire overscan range, we're done.
break;
}
var maxNewCells = newCellCount >= maxToRenderPerBatch;
var firstWillAddMore = first <= prev.first || first > prev.last;
var firstShouldIncrement = first > overscanFirst && (!maxNewCells || !firstWillAddMore);
var lastWillAddMore = last >= prev.last || last < prev.first;
var lastShouldIncrement = last < overscanLast && (!maxNewCells || !lastWillAddMore);
if (maxNewCells && !firstShouldIncrement && !lastShouldIncrement) {
// We only want to stop if we've hit maxNewCells AND we cannot increment first or last
// without rendering new items. This let's us preserve as many already rendered items as
// possible, reducing render churn and keeping the rendered overscan range as large as
// possible.
break;
}
if (firstShouldIncrement && !(fillPreference === 'after' && lastShouldIncrement && lastWillAddMore)) {
if (firstWillAddMore) {
newCellCount++;
}
first--;
}
if (lastShouldIncrement && !(fillPreference === 'before' && firstShouldIncrement && firstWillAddMore)) {
if (lastWillAddMore) {
newCellCount++;
}
last++;
}
}
if (!(last >= first && first >= 0 && last < itemCount && first >= overscanFirst && last <= overscanLast && first <= visible.first && last >= visible.last)) {
throw new Error('Bad window calculation ' + JSON.stringify({
first,
last,
itemCount,
overscanFirst,
overscanLast,
visible
}));
}
return {
first,
last
};
}
function keyExtractor(item, index) {
if (typeof item === 'object' && (item == null ? void 0 : item.key) != null) {
return item.key;
}
if (typeof item === 'object' && (item == null ? void 0 : item.id) != null) {
return item.id;
}
return String(index);
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.CellRenderMask = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
class CellRenderMask {
constructor(numCells) {
(0, _invariant.default)(numCells >= 0, 'CellRenderMask must contain a non-negative number os cells');
this._numCells = numCells;
if (numCells === 0) {
this._regions = [];
} else {
this._regions = [{
first: 0,
last: numCells - 1,
isSpacer: true
}];
}
}
enumerateRegions() {
return this._regions;
}
addCells(cells) {
(0, _invariant.default)(cells.first >= 0 && cells.first < this._numCells && cells.last >= -1 && cells.last < this._numCells && cells.last >= cells.first - 1, 'CellRenderMask.addCells called with invalid cell range');
// VirtualizedList uses inclusive ranges, where zero-count states are
// possible. E.g. [0, -1] for no cells, starting at 0.
if (cells.last < cells.first) {
return;
}
var _this$_findRegion = this._findRegion(cells.first),
firstIntersect = _this$_findRegion[0],
firstIntersectIdx = _this$_findRegion[1];
var _this$_findRegion2 = this._findRegion(cells.last),
lastIntersect = _this$_findRegion2[0],
lastIntersectIdx = _this$_findRegion2[1];
// Fast-path if the cells to add are already all present in the mask. We
// will otherwise need to do some mutation.
if (firstIntersectIdx === lastIntersectIdx && !firstIntersect.isSpacer) {
return;
}
// We need to replace the existing covered regions with 1-3 new regions
// depending whether we need to split spacers out of overlapping regions.
var newLeadRegion = [];
var newTailRegion = [];
var newMainRegion = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, cells), {}, {
isSpacer: false
});
if (firstIntersect.first < newMainRegion.first) {
if (firstIntersect.isSpacer) {
newLeadRegion.push({
first: firstIntersect.first,
last: newMainRegion.first - 1,
isSpacer: true
});
} else {
newMainRegion.first = firstIntersect.first;
}
}
if (lastIntersect.last > newMainRegion.last) {
if (lastIntersect.isSpacer) {
newTailRegion.push({
first: newMainRegion.last + 1,
last: lastIntersect.last,
isSpacer: true
});
} else {
newMainRegion.last = lastIntersect.last;
}
}
var replacementRegions = [...newLeadRegion, newMainRegion, ...newTailRegion];
var numRegionsToDelete = lastIntersectIdx - firstIntersectIdx + 1;
this._regions.splice(firstIntersectIdx, numRegionsToDelete, ...replacementRegions);
}
numCells() {
return this._numCells;
}
equals(other) {
return this._numCells === other._numCells && this._regions.length === other._regions.length && this._regions.every((region, i) => region.first === other._regions[i].first && region.last === other._regions[i].last && region.isSpacer === other._regions[i].isSpacer);
}
_findRegion(cellIdx) {
var firstIdx = 0;
var lastIdx = this._regions.length - 1;
while (firstIdx <= lastIdx) {
var middleIdx = Math.floor((firstIdx + lastIdx) / 2);
var middleRegion = this._regions[middleIdx];
if (cellIdx >= middleRegion.first && cellIdx <= middleRegion.last) {
return [middleRegion, middleIdx];
} else if (cellIdx < middleRegion.first) {
lastIdx = middleIdx - 1;
} else if (cellIdx > middleRegion.last) {
firstIdx = middleIdx + 1;
}
}
(0, _invariant.default)(false, "A region was not found containing cellIdx " + cellIdx);
}
}
exports.CellRenderMask = CellRenderMask;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelperLoose"));
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
class ChildListCollection {
constructor() {
this._cellKeyToChildren = new Map();
this._childrenToCellKey = new Map();
}
add(list, cellKey) {
var _this$_cellKeyToChild;
(0, _invariant.default)(!this._childrenToCellKey.has(list), 'Trying to add already present child list');
var cellLists = (_this$_cellKeyToChild = this._cellKeyToChildren.get(cellKey)) !== null && _this$_cellKeyToChild !== void 0 ? _this$_cellKeyToChild : new Set();
cellLists.add(list);
this._cellKeyToChildren.set(cellKey, cellLists);
this._childrenToCellKey.set(list, cellKey);
}
remove(list) {
var cellKey = this._childrenToCellKey.get(list);
(0, _invariant.default)(cellKey != null, 'Trying to remove non-present child list');
this._childrenToCellKey.delete(list);
var cellLists = this._cellKeyToChildren.get(cellKey);
(0, _invariant.default)(cellLists, '_cellKeyToChildren should contain cellKey');
cellLists.delete(list);
if (cellLists.size === 0) {
this._cellKeyToChildren.delete(cellKey);
}
}
forEach(fn) {
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(this._cellKeyToChildren.values()), _step; !(_step = _iterator()).done;) {
var listSet = _step.value;
for (var _iterator2 = (0, _createForOfIteratorHelperLoose2.default)(listSet), _step2; !(_step2 = _iterator2()).done;) {
var list = _step2.value;
fn(list);
}
}
}
forEachInCell(cellKey, fn) {
var _this$_cellKeyToChild2;
var listSet = (_this$_cellKeyToChild2 = this._cellKeyToChildren.get(cellKey)) !== null && _this$_cellKeyToChild2 !== void 0 ? _this$_cellKeyToChild2 : [];
for (var _iterator3 = (0, _createForOfIteratorHelperLoose2.default)(listSet), _step3; !(_step3 = _iterator3()).done;) {
var list = _step3.value;
fn(list);
}
}
anyInCell(cellKey, fn) {
var _this$_cellKeyToChild3;
var listSet = (_this$_cellKeyToChild3 = this._cellKeyToChildren.get(cellKey)) !== null && _this$_cellKeyToChild3 !== void 0 ? _this$_cellKeyToChild3 : [];
for (var _iterator4 = (0, _createForOfIteratorHelperLoose2.default)(listSet), _step4; !(_step4 = _iterator4()).done;) {
var list = _step4.value;
if (fn(list)) {
return true;
}
}
return false;
}
size() {
return this._childrenToCellKey.size;
}
}
exports.default = ChildListCollection;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var React = _interopRequireWildcard(require("react"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* `setState` is called asynchronously, and should not rely on the value of
* `this.props` or `this.state`:
* https://reactjs.org/docs/state-and-lifecycle.html#state-updates-may-be-asynchronous
*
* SafePureComponent adds runtime enforcement, to catch cases where these
* variables are read in a state updater function, instead of the ones passed
* in.
*/
class StateSafePureComponent extends React.PureComponent {
constructor(props) {
super(props);
this._inAsyncStateUpdate = false;
this._installSetStateHooks();
}
setState(partialState, callback) {
if (typeof partialState === 'function') {
super.setState((state, props) => {
this._inAsyncStateUpdate = true;
var ret;
try {
ret = partialState(state, props);
} catch (err) {
throw err;
} finally {
this._inAsyncStateUpdate = false;
}
return ret;
}, callback);
} else {
super.setState(partialState, callback);
}
}
_installSetStateHooks() {
var that = this;
var props = this.props,
state = this.state;
Object.defineProperty(this, 'props', {
get() {
(0, _invariant.default)(!that._inAsyncStateUpdate, '"this.props" should not be accessed during state updates');
return props;
},
set(newProps) {
props = newProps;
}
});
Object.defineProperty(this, 'state', {
get() {
(0, _invariant.default)(!that._inAsyncStateUpdate, '"this.state" should not be acceessed during state updates');
return state;
},
set(newState) {
state = newState;
}
});
}
}
exports.default = StateSafePureComponent;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _View = _interopRequireDefault(require("../../../exports/View"));
var _StyleSheet = _interopRequireDefault(require("../../../exports/StyleSheet"));
var _VirtualizedListContext = require("./VirtualizedListContext.js");
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var React = _interopRequireWildcard(require("react"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
class CellRenderer extends React.Component {
constructor() {
super(...arguments);
this.state = {
separatorProps: {
highlighted: false,
leadingItem: this.props.item
}
};
this._separators = {
highlight: () => {
var _this$props = this.props,
cellKey = _this$props.cellKey,
prevCellKey = _this$props.prevCellKey;
this.props.onUpdateSeparators([cellKey, prevCellKey], {
highlighted: true
});
},
unhighlight: () => {
var _this$props2 = this.props,
cellKey = _this$props2.cellKey,
prevCellKey = _this$props2.prevCellKey;
this.props.onUpdateSeparators([cellKey, prevCellKey], {
highlighted: false
});
},
updateProps: (select, newProps) => {
var _this$props3 = this.props,
cellKey = _this$props3.cellKey,
prevCellKey = _this$props3.prevCellKey;
this.props.onUpdateSeparators([select === 'leading' ? prevCellKey : cellKey], newProps);
}
};
this._onLayout = nativeEvent => {
this.props.onCellLayout && this.props.onCellLayout(nativeEvent, this.props.cellKey, this.props.index);
};
}
static getDerivedStateFromProps(props, prevState) {
return {
separatorProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, prevState.separatorProps), {}, {
leadingItem: props.item
})
};
}
// TODO: consider factoring separator stuff out of VirtualizedList into FlatList since it's not
// reused by SectionList and we can keep VirtualizedList simpler.
// $FlowFixMe[missing-local-annot]
updateSeparatorProps(newProps) {
this.setState(state => ({
separatorProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.separatorProps), newProps)
}));
}
componentWillUnmount() {
this.props.onUnmount(this.props.cellKey);
}
_renderElement(renderItem, ListItemComponent, item, index) {
if (renderItem && ListItemComponent) {
console.warn('VirtualizedList: Both ListItemComponent and renderItem props are present. ListItemComponent will take' + ' precedence over renderItem.');
}
if (ListItemComponent) {
/* $FlowFixMe[not-a-component] (>=0.108.0 site=react_native_fb) This
* comment suppresses an error found when Flow v0.108 was deployed. To
* see the error, delete this comment and run Flow. */
/* $FlowFixMe[incompatible-type-arg] (>=0.108.0 site=react_native_fb)
* This comment suppresses an error found when Flow v0.108 was deployed.
* To see the error, delete this comment and run Flow. */
return /*#__PURE__*/React.createElement(ListItemComponent, {
item,
index,
separators: this._separators
});
}
if (renderItem) {
return renderItem({
item,
index,
separators: this._separators
});
}
(0, _invariant.default)(false, 'VirtualizedList: Either ListItemComponent or renderItem props are required but none were found.');
}
render() {
var _this$props4 = this.props,
CellRendererComponent = _this$props4.CellRendererComponent,
ItemSeparatorComponent = _this$props4.ItemSeparatorComponent,
ListItemComponent = _this$props4.ListItemComponent,
cellKey = _this$props4.cellKey,
horizontal = _this$props4.horizontal,
item = _this$props4.item,
index = _this$props4.index,
inversionStyle = _this$props4.inversionStyle,
onCellFocusCapture = _this$props4.onCellFocusCapture,
onCellLayout = _this$props4.onCellLayout,
renderItem = _this$props4.renderItem;
var element = this._renderElement(renderItem, ListItemComponent, item, index);
// NOTE: that when this is a sticky header, `onLayout` will get automatically extracted and
// called explicitly by `ScrollViewStickyHeader`.
var itemSeparator = /*#__PURE__*/React.isValidElement(ItemSeparatorComponent) ?
// $FlowFixMe[incompatible-type]
ItemSeparatorComponent :
// $FlowFixMe[incompatible-type]
ItemSeparatorComponent && /*#__PURE__*/React.createElement(ItemSeparatorComponent, this.state.separatorProps);
var cellStyle = inversionStyle ? horizontal ? [styles.rowReverse, inversionStyle] : [styles.columnReverse, inversionStyle] : horizontal ? [styles.row, inversionStyle] : inversionStyle;
var result = !CellRendererComponent ? /*#__PURE__*/React.createElement(_View.default, (0, _extends2.default)({
style: cellStyle,
onFocusCapture: onCellFocusCapture
}, onCellLayout && {
onLayout: this._onLayout
}), element, itemSeparator) : /*#__PURE__*/React.createElement(CellRendererComponent, (0, _extends2.default)({
cellKey: cellKey,
index: index,
item: item,
style: cellStyle,
onFocusCapture: onCellFocusCapture
}, onCellLayout && {
onLayout: this._onLayout
}), element, itemSeparator);
return /*#__PURE__*/React.createElement(_VirtualizedListContext.VirtualizedListCellContextProvider, {
cellKey: this.props.cellKey
}, result);
}
}
exports.default = CellRenderer;
var styles = _StyleSheet.default.create({
row: {
flexDirection: 'row'
},
rowReverse: {
flexDirection: 'row-reverse'
},
columnReverse: {
flexDirection: 'column-reverse'
}
});
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.VirtualizedListCellContextProvider = VirtualizedListCellContextProvider;
exports.VirtualizedListContext = void 0;
exports.VirtualizedListContextProvider = VirtualizedListContextProvider;
exports.VirtualizedListContextResetter = VirtualizedListContextResetter;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var React = _interopRequireWildcard(require("react"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
var __DEV__ = process.env.NODE_ENV !== 'production';
var VirtualizedListContext = /*#__PURE__*/React.createContext(null);
exports.VirtualizedListContext = VirtualizedListContext;
if (__DEV__) {
VirtualizedListContext.displayName = 'VirtualizedListContext';
}
/**
* Resets the context. Intended for use by portal-like components (e.g. Modal).
*/
function VirtualizedListContextResetter(_ref) {
var children = _ref.children;
return /*#__PURE__*/React.createElement(VirtualizedListContext.Provider, {
value: null
}, children);
}
/**
* Sets the context with memoization. Intended to be used by `VirtualizedList`.
*/
function VirtualizedListContextProvider(_ref2) {
var children = _ref2.children,
value = _ref2.value;
// Avoid setting a newly created context object if the values are identical.
var context = (0, React.useMemo)(() => ({
cellKey: null,
getScrollMetrics: value.getScrollMetrics,
horizontal: value.horizontal,
getOutermostParentListRef: value.getOutermostParentListRef,
registerAsNestedChild: value.registerAsNestedChild,
unregisterAsNestedChild: value.unregisterAsNestedChild
}), [value.getScrollMetrics, value.horizontal, value.getOutermostParentListRef, value.registerAsNestedChild, value.unregisterAsNestedChild]);
return /*#__PURE__*/React.createElement(VirtualizedListContext.Provider, {
value: context
}, children);
}
/**
* Sets the `cellKey`. Intended to be used by `VirtualizedList` for each cell.
*/
function VirtualizedListCellContextProvider(_ref3) {
var cellKey = _ref3.cellKey,
children = _ref3.children;
// Avoid setting a newly created context object if the values are identical.
var currContext = (0, React.useContext)(VirtualizedListContext);
var context = (0, React.useMemo)(() => currContext == null ? null : (0, _objectSpread2.default)((0, _objectSpread2.default)({}, currContext), {}, {
cellKey
}), [currContext, cellKey]);
return /*#__PURE__*/React.createElement(VirtualizedListContext.Provider, {
value: context
}, children);
}
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedList/index.js
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelperLoose"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _RefreshControl = _interopRequireDefault(require("../../../exports/RefreshControl"));
var _ScrollView = _interopRequireDefault(require("../../../exports/ScrollView"));
var _View = _interopRequireDefault(require("../../../exports/View"));
var _StyleSheet = _interopRequireDefault(require("../../../exports/StyleSheet"));
var _findNodeHandle = _interopRequireDefault(require("../../../exports/findNodeHandle"));
var _Batchinator = _interopRequireDefault(require("../Batchinator"));
var _clamp = _interopRequireDefault(require("../Utilities/clamp"));
var _infoLog = _interopRequireDefault(require("../infoLog"));
var _CellRenderMask = require("./CellRenderMask");
var _ChildListCollection = _interopRequireDefault(require("./ChildListCollection"));
var _FillRateHelper = _interopRequireDefault(require("../FillRateHelper"));
var _StateSafePureComponent = _interopRequireDefault(require("./StateSafePureComponent"));
var _ViewabilityHelper = _interopRequireDefault(require("../ViewabilityHelper"));
var _VirtualizedListCellRenderer = _interopRequireDefault(require("./VirtualizedListCellRenderer"));
var _VirtualizedListContext = require("./VirtualizedListContext.js");
var _VirtualizeUtils = require("../VirtualizeUtils");
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var _nullthrows = _interopRequireDefault(require("nullthrows"));
var React = _interopRequireWildcard(require("react"));
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
var __DEV__ = process.env.NODE_ENV !== 'production';
var ON_EDGE_REACHED_EPSILON = 0.001;
var _usedIndexForKey = false;
var _keylessItemComponentName = '';
/**
* Default Props Helper Functions
* Use the following helper functions for default values
*/
// horizontalOrDefault(this.props.horizontal)
function horizontalOrDefault(horizontal) {
return horizontal !== null && horizontal !== void 0 ? horizontal : false;
}
// initialNumToRenderOrDefault(this.props.initialNumToRender)
function initialNumToRenderOrDefault(initialNumToRender) {
return initialNumToRender !== null && initialNumToRender !== void 0 ? initialNumToRender : 10;
}
// maxToRenderPerBatchOrDefault(this.props.maxToRenderPerBatch)
function maxToRenderPerBatchOrDefault(maxToRenderPerBatch) {
return maxToRenderPerBatch !== null && maxToRenderPerBatch !== void 0 ? maxToRenderPerBatch : 10;
}
// onStartReachedThresholdOrDefault(this.props.onStartReachedThreshold)
function onStartReachedThresholdOrDefault(onStartReachedThreshold) {
return onStartReachedThreshold !== null && onStartReachedThreshold !== void 0 ? onStartReachedThreshold : 2;
}
// onEndReachedThresholdOrDefault(this.props.onEndReachedThreshold)
function onEndReachedThresholdOrDefault(onEndReachedThreshold) {
return onEndReachedThreshold !== null && onEndReachedThreshold !== void 0 ? onEndReachedThreshold : 2;
}
// getScrollingThreshold(visibleLength, onEndReachedThreshold)
function getScrollingThreshold(threshold, visibleLength) {
return threshold * visibleLength / 2;
}
// scrollEventThrottleOrDefault(this.props.scrollEventThrottle)
function scrollEventThrottleOrDefault(scrollEventThrottle) {
return scrollEventThrottle !== null && scrollEventThrottle !== void 0 ? scrollEventThrottle : 50;
}
// windowSizeOrDefault(this.props.windowSize)
function windowSizeOrDefault(windowSize) {
return windowSize !== null && windowSize !== void 0 ? windowSize : 21;
}
function findLastWhere(arr, predicate) {
for (var i = arr.length - 1; i >= 0; i--) {
if (predicate(arr[i])) {
return arr[i];
}
}
return null;
}
/**
* Base implementation for the more convenient [`<FlatList>`](https://reactnative.dev/docs/flatlist)
* and [`<SectionList>`](https://reactnative.dev/docs/sectionlist) components, which are also better
* documented. In general, this should only really be used if you need more flexibility than
* `FlatList` provides, e.g. for use with immutable data instead of plain arrays.
*
* Virtualization massively improves memory consumption and performance of large lists by
* maintaining a finite render window of active items and replacing all items outside of the render
* window with appropriately sized blank space. The window adapts to scrolling behavior, and items
* are rendered incrementally with low-pri (after any running interactions) if they are far from the
* visible area, or with hi-pri otherwise to minimize the potential of seeing blank space.
*
* Some caveats:
*
* - Internal state is not preserved when content scrolls out of the render window. Make sure all
* your data is captured in the item data or external stores like Flux, Redux, or Relay.
* - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop
* (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on
* changes. This includes the `data` prop and parent component state.
* - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously
* offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see
* blank content. This is a tradeoff that can be adjusted to suit the needs of each application,
* and we are working on improving it behind the scenes.
* - By default, the list looks for a `key` or `id` prop on each item and uses that for the React key.
* Alternatively, you can provide a custom `keyExtractor` prop.
* - As an effort to remove defaultProps, use helper functions when referencing certain props
*
*/
class VirtualizedList extends _StateSafePureComponent.default {
// scrollToEnd may be janky without getItemLayout prop
scrollToEnd(params) {
var animated = params ? params.animated : true;
var veryLast = this.props.getItemCount(this.props.data) - 1;
if (veryLast < 0) {
return;
}
var frame = this.__getFrameMetricsApprox(veryLast, this.props);
var offset = Math.max(0, frame.offset + frame.length + this._footerLength - this._scrollMetrics.visibleLength);
if (this._scrollRef == null) {
return;
}
if (this._scrollRef.scrollTo == null) {
console.warn('No scrollTo method provided. This may be because you have two nested ' + 'VirtualizedLists with the same orientation, or because you are ' + 'using a custom component that does not implement scrollTo.');
return;
}
this._scrollRef.scrollTo(horizontalOrDefault(this.props.horizontal) ? {
x: offset,
animated
} : {
y: offset,
animated
});
}
// scrollToIndex may be janky without getItemLayout prop
scrollToIndex(params) {
var _this$props = this.props,
data = _this$props.data,
horizontal = _this$props.horizontal,
getItemCount = _this$props.getItemCount,
getItemLayout = _this$props.getItemLayout,
onScrollToIndexFailed = _this$props.onScrollToIndexFailed;
var animated = params.animated,
index = params.index,
viewOffset = params.viewOffset,
viewPosition = params.viewPosition;
(0, _invariant.default)(index >= 0, "scrollToIndex out of range: requested index " + index + " but minimum is 0");
(0, _invariant.default)(getItemCount(data) >= 1, "scrollToIndex out of range: item length " + getItemCount(data) + " but minimum is 1");
(0, _invariant.default)(index < getItemCount(data), "scrollToIndex out of range: requested index " + index + " is out of 0 to " + (getItemCount(data) - 1));
if (!getItemLayout && index > this._highestMeasuredFrameIndex) {
(0, _invariant.default)(!!onScrollToIndexFailed, 'scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, ' + 'otherwise there is no way to know the location of offscreen indices or handle failures.');
onScrollToIndexFailed({
averageItemLength: this._averageCellLength,
highestMeasuredFrameIndex: this._highestMeasuredFrameIndex,
index
});
return;
}
var frame = this.__getFrameMetricsApprox(Math.floor(index), this.props);
var offset = Math.max(0, this._getOffsetApprox(index, this.props) - (viewPosition || 0) * (this._scrollMetrics.visibleLength - frame.length)) - (viewOffset || 0);
if (this._scrollRef == null) {
return;
}
if (this._scrollRef.scrollTo == null) {
console.warn('No scrollTo method provided. This may be because you have two nested ' + 'VirtualizedLists with the same orientation, or because you are ' + 'using a custom component that does not implement scrollTo.');
return;
}
this._scrollRef.scrollTo(horizontal ? {
x: offset,
animated
} : {
y: offset,
animated
});
}
// scrollToItem may be janky without getItemLayout prop. Required linear scan through items -
// use scrollToIndex instead if possible.
scrollToItem(params) {
var item = params.item;
var _this$props2 = this.props,
data = _this$props2.data,
getItem = _this$props2.getItem,
getItemCount = _this$props2.getItemCount;
var itemCount = getItemCount(data);
for (var _index = 0; _index < itemCount; _index++) {
if (getItem(data, _index) === item) {
this.scrollToIndex((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
index: _index
}));
break;
}
}
}
/**
* Scroll to a specific content pixel offset in the list.
*
* Param `offset` expects the offset to scroll to.
* In case of `horizontal` is true, the offset is the x-value,
* in any other case the offset is the y-value.
*
* Param `animated` (`true` by default) defines whether the list
* should do an animation while scrolling.
*/
scrollToOffset(params) {
var animated = params.animated,
offset = params.offset;
if (this._scrollRef == null) {
return;
}
if (this._scrollRef.scrollTo == null) {
console.warn('No scrollTo method provided. This may be because you have two nested ' + 'VirtualizedLists with the same orientation, or because you are ' + 'using a custom component that does not implement scrollTo.');
return;
}
this._scrollRef.scrollTo(horizontalOrDefault(this.props.horizontal) ? {
x: offset,
animated
} : {
y: offset,
animated
});
}
recordInteraction() {
this._nestedChildLists.forEach(childList => {
childList.recordInteraction();
});
this._viewabilityTuples.forEach(t => {
t.viewabilityHelper.recordInteraction();
});
this._updateViewableItems(this.props, this.state.cellsAroundViewport);
}
flashScrollIndicators() {
if (this._scrollRef == null) {
return;
}
this._scrollRef.flashScrollIndicators();
}
/**
* Provides a handle to the underlying scroll responder.
* Note that `this._scrollRef` might not be a `ScrollView`, so we
* need to check that it responds to `getScrollResponder` before calling it.
*/
getScrollResponder() {
if (this._scrollRef && this._scrollRef.getScrollResponder) {
return this._scrollRef.getScrollResponder();
}
}
getScrollableNode() {
if (this._scrollRef && this._scrollRef.getScrollableNode) {
return this._scrollRef.getScrollableNode();
} else {
return this._scrollRef;
}
}
getScrollRef() {
if (this._scrollRef && this._scrollRef.getScrollRef) {
return this._scrollRef.getScrollRef();
} else {
return this._scrollRef;
}
}
_getCellKey() {
var _this$context;
return ((_this$context = this.context) == null ? void 0 : _this$context.cellKey) || 'rootList';
}
// $FlowFixMe[missing-local-annot]
hasMore() {
return this._hasMore;
}
// $FlowFixMe[missing-local-annot]
constructor(_props) {
var _this$props$updateCel;
super(_props);
this._getScrollMetrics = () => {
return this._scrollMetrics;
};
this._getOutermostParentListRef = () => {
if (this._isNestedWithSameOrientation()) {
return this.context.getOutermostParentListRef();
} else {
return this;
}
};
this._registerAsNestedChild = childList => {
this._nestedChildLists.add(childList.ref, childList.cellKey);
if (this._hasInteracted) {
childList.ref.recordInteraction();
}
};
this._unregisterAsNestedChild = childList => {
this._nestedChildLists.remove(childList.ref);
};
this._onUpdateSeparators = (keys, newProps) => {
keys.forEach(key => {
var ref = key != null && this._cellRefs[key];
ref && ref.updateSeparatorProps(newProps);
});
};
this._getSpacerKey = isVertical => isVertical ? 'height' : 'width';
this._averageCellLength = 0;
this._cellRefs = {};
this._frames = {};
this._footerLength = 0;
this._hasTriggeredInitialScrollToIndex = false;
this._hasInteracted = false;
this._hasMore = false;
this._hasWarned = {};
this._headerLength = 0;
this._hiPriInProgress = false;
this._highestMeasuredFrameIndex = 0;
this._indicesToKeys = new Map();
this._lastFocusedCellKey = null;
this._nestedChildLists = new _ChildListCollection.default();
this._offsetFromParentVirtualizedList = 0;
this._prevParentOffset = 0;
this._scrollMetrics = {
contentLength: 0,
dOffset: 0,
dt: 10,
offset: 0,
timestamp: 0,
velocity: 0,
visibleLength: 0,
zoomScale: 1
};
this._scrollRef = null;
this._sentStartForContentLength = 0;
this._sentEndForContentLength = 0;
this._totalCellLength = 0;
this._totalCellsMeasured = 0;
this._viewabilityTuples = [];
this._captureScrollRef = ref => {
this._scrollRef = ref;
};
this._defaultRenderScrollComponent = props => {
var onRefresh = props.onRefresh;
if (this._isNestedWithSameOrientation()) {
// $FlowFixMe[prop-missing] - Typing ReactNativeComponent revealed errors
return /*#__PURE__*/React.createElement(_View.default, props);
} else if (onRefresh) {
var _props$refreshing;
(0, _invariant.default)(typeof props.refreshing === 'boolean', '`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `' + JSON.stringify((_props$refreshing = props.refreshing) !== null && _props$refreshing !== void 0 ? _props$refreshing : 'undefined') + '`');
return (
/*#__PURE__*/
// $FlowFixMe[prop-missing] Invalid prop usage
// $FlowFixMe[incompatible-use]
React.createElement(_ScrollView.default, (0, _extends2.default)({}, props, {
refreshControl: props.refreshControl == null ? /*#__PURE__*/React.createElement(_RefreshControl.default
// $FlowFixMe[incompatible-type]
, {
refreshing: props.refreshing,
onRefresh: onRefresh,
progressViewOffset: props.progressViewOffset
}) : props.refreshControl
}))
);
} else {
// $FlowFixMe[prop-missing] Invalid prop usage
// $FlowFixMe[incompatible-use]
return /*#__PURE__*/React.createElement(_ScrollView.default, props);
}
};
this._onCellLayout = (e, cellKey, index) => {
var layout = e.nativeEvent.layout;
var next = {
offset: this._selectOffset(layout),
length: this._selectLength(layout),
index,
inLayout: true
};
var curr = this._frames[cellKey];
if (!curr || next.offset !== curr.offset || next.length !== curr.length || index !== curr.index) {
this._totalCellLength += next.length - (curr ? curr.length : 0);
this._totalCellsMeasured += curr ? 0 : 1;
this._averageCellLength = this._totalCellLength / this._totalCellsMeasured;
this._frames[cellKey] = next;
this._highestMeasuredFrameIndex = Math.max(this._highestMeasuredFrameIndex, index);
this._scheduleCellsToRenderUpdate();
} else {
this._frames[cellKey].inLayout = true;
}
this._triggerRemeasureForChildListsInCell(cellKey);
this._computeBlankness();
this._updateViewableItems(this.props, this.state.cellsAroundViewport);
};
this._onCellUnmount = cellKey => {
delete this._cellRefs[cellKey];
var curr = this._frames[cellKey];
if (curr) {
this._frames[cellKey] = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, curr), {}, {
inLayout: false
});
}
};
this._onLayout = e => {
if (this._isNestedWithSameOrientation()) {
// Need to adjust our scroll metrics to be relative to our containing
// VirtualizedList before we can make claims about list item viewability
this.measureLayoutRelativeToContainingList();
} else {
this._scrollMetrics.visibleLength = this._selectLength(e.nativeEvent.layout);
}
this.props.onLayout && this.props.onLayout(e);
this._scheduleCellsToRenderUpdate();
this._maybeCallOnEdgeReached();
};
this._onLayoutEmpty = e => {
this.props.onLayout && this.props.onLayout(e);
};
this._onLayoutFooter = e => {
this._triggerRemeasureForChildListsInCell(this._getFooterCellKey());
this._footerLength = this._selectLength(e.nativeEvent.layout);
};
this._onLayoutHeader = e => {
this._headerLength = this._selectLength(e.nativeEvent.layout);
};
this._onContentSizeChange = (width, height) => {
if (width > 0 && height > 0 && this.props.initialScrollIndex != null && this.props.initialScrollIndex > 0 && !this._hasTriggeredInitialScrollToIndex) {
if (this.props.contentOffset == null) {
if (this.props.initialScrollIndex < this.props.getItemCount(this.props.data)) {
this.scrollToIndex({
animated: false,
index: (0, _nullthrows.default)(this.props.initialScrollIndex)
});
} else {
this.scrollToEnd({
animated: false
});
}
}
this._hasTriggeredInitialScrollToIndex = true;
}
if (this.props.onContentSizeChange) {
this.props.onContentSizeChange(width, height);
}
this._scrollMetrics.contentLength = this._selectLength({
height,
width
});
this._scheduleCellsToRenderUpdate();
this._maybeCallOnEdgeReached();
};
this._convertParentScrollMetrics = metrics => {
// Offset of the top of the nested list relative to the top of its parent's viewport
var offset = metrics.offset - this._offsetFromParentVirtualizedList;
// Child's visible length is the same as its parent's
var visibleLength = metrics.visibleLength;
var dOffset = offset - this._scrollMetrics.offset;
var contentLength = this._scrollMetrics.contentLength;
return {
visibleLength,
contentLength,
offset,
dOffset
};
};
this._onScroll = e => {
this._nestedChildLists.forEach(childList => {
childList._onScroll(e);
});
if (this.props.onScroll) {
this.props.onScroll(e);
}
var timestamp = e.timeStamp;
var visibleLength = this._selectLength(e.nativeEvent.layoutMeasurement);
var contentLength = this._selectLength(e.nativeEvent.contentSize);
var offset = this._selectOffset(e.nativeEvent.contentOffset);
var dOffset = offset - this._scrollMetrics.offset;
if (this._isNestedWithSameOrientation()) {
if (this._scrollMetrics.contentLength === 0) {
// Ignore scroll events until onLayout has been called and we
// know our offset from our offset from our parent
return;
}
var _this$_convertParentS = this._convertParentScrollMetrics({
visibleLength,
offset
});
visibleLength = _this$_convertParentS.visibleLength;
contentLength = _this$_convertParentS.contentLength;
offset = _this$_convertParentS.offset;
dOffset = _this$_convertParentS.dOffset;
}
var dt = this._scrollMetrics.timestamp ? Math.max(1, timestamp - this._scrollMetrics.timestamp) : 1;
var velocity = dOffset / dt;
if (dt > 500 && this._scrollMetrics.dt > 500 && contentLength > 5 * visibleLength && !this._hasWarned.perf) {
(0, _infoLog.default)('VirtualizedList: You have a large list that is slow to update - make sure your ' + 'renderItem function renders components that follow React performance best practices ' + 'like PureComponent, shouldComponentUpdate, etc.', {
dt,
prevDt: this._scrollMetrics.dt,
contentLength
});
this._hasWarned.perf = true;
}
// For invalid negative values (w/ RTL), set this to 1.
var zoomScale = e.nativeEvent.zoomScale < 0 ? 1 : e.nativeEvent.zoomScale;
this._scrollMetrics = {
contentLength,
dt,
dOffset,
offset,
timestamp,
velocity,
visibleLength,
zoomScale
};
this._updateViewableItems(this.props, this.state.cellsAroundViewport);
if (!this.props) {
return;
}
this._maybeCallOnEdgeReached();
if (velocity !== 0) {
this._fillRateHelper.activate();
}
this._computeBlankness();
this._scheduleCellsToRenderUpdate();
};
this._onScrollBeginDrag = e => {
this._nestedChildLists.forEach(childList => {
childList._onScrollBeginDrag(e);
});
this._viewabilityTuples.forEach(tuple => {
tuple.viewabilityHelper.recordInteraction();
});
this._hasInteracted = true;
this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);
};
this._onScrollEndDrag = e => {
this._nestedChildLists.forEach(childList => {
childList._onScrollEndDrag(e);
});
var velocity = e.nativeEvent.velocity;
if (velocity) {
this._scrollMetrics.velocity = this._selectOffset(velocity);
}
this._computeBlankness();
this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);
};
this._onMomentumScrollBegin = e => {
this._nestedChildLists.forEach(childList => {
childList._onMomentumScrollBegin(e);
});
this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);
};
this._onMomentumScrollEnd = e => {
this._nestedChildLists.forEach(childList => {
childList._onMomentumScrollEnd(e);
});
this._scrollMetrics.velocity = 0;
this._computeBlankness();
this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);
};
this._updateCellsToRender = () => {
this._updateViewableItems(this.props, this.state.cellsAroundViewport);
this.setState((state, props) => {
var cellsAroundViewport = this._adjustCellsAroundViewport(props, state.cellsAroundViewport);
var renderMask = VirtualizedList._createRenderMask(props, cellsAroundViewport, this._getNonViewportRenderRegions(props));
if (cellsAroundViewport.first === state.cellsAroundViewport.first && cellsAroundViewport.last === state.cellsAroundViewport.last && renderMask.equals(state.renderMask)) {
return null;
}
return {
cellsAroundViewport,
renderMask
};
});
};
this._createViewToken = (index, isViewable, props
// $FlowFixMe[missing-local-annot]
) => {
var data = props.data,
getItem = props.getItem;
var item = getItem(data, index);
return {
index,
item,
key: this._keyExtractor(item, index, props),
isViewable
};
};
this._getOffsetApprox = (index, props) => {
if (Number.isInteger(index)) {
return this.__getFrameMetricsApprox(index, props).offset;
} else {
var frameMetrics = this.__getFrameMetricsApprox(Math.floor(index), props);
var remainder = index - Math.floor(index);
return frameMetrics.offset + remainder * frameMetrics.length;
}
};
this.__getFrameMetricsApprox = (index, props) => {
var frame = this._getFrameMetrics(index, props);
if (frame && frame.index === index) {
// check for invalid frames due to row re-ordering
return frame;
} else {
var data = props.data,
getItemCount = props.getItemCount,
getItemLayout = props.getItemLayout;
(0, _invariant.default)(index >= 0 && index < getItemCount(data), 'Tried to get frame for out of range index ' + index);
(0, _invariant.default)(!getItemLayout, 'Should not have to estimate frames when a measurement metrics function is provided');
return {
length: this._averageCellLength,
offset: this._averageCellLength * index
};
}
};
this._getFrameMetrics = (index, props) => {
var data = props.data,
getItem = props.getItem,
getItemCount = props.getItemCount,
getItemLayout = props.getItemLayout;
(0, _invariant.default)(index >= 0 && index < getItemCount(data), 'Tried to get frame for out of range index ' + index);
var item = getItem(data, index);
var frame = this._frames[this._keyExtractor(item, index, props)];
if (!frame || frame.index !== index) {
if (getItemLayout) {
/* $FlowFixMe[prop-missing] (>=0.63.0 site=react_native_fb) This comment
* suppresses an error found when Flow v0.63 was deployed. To see the error
* delete this comment and run Flow. */
return getItemLayout(data, index);
}
}
return frame;
};
this._getNonViewportRenderRegions = props => {
// Keep a viewport's worth of content around the last focused cell to allow
// random navigation around it without any blanking. E.g. tabbing from one
// focused item out of viewport to another.
if (!(this._lastFocusedCellKey && this._cellRefs[this._lastFocusedCellKey])) {
return [];
}
var lastFocusedCellRenderer = this._cellRefs[this._lastFocusedCellKey];
var focusedCellIndex = lastFocusedCellRenderer.props.index;
var itemCount = props.getItemCount(props.data);
// The last cell we rendered may be at a new index. Bail if we don't know
// where it is.
if (focusedCellIndex >= itemCount || this._keyExtractor(props.getItem(props.data, focusedCellIndex), focusedCellIndex, props) !== this._lastFocusedCellKey) {
return [];
}
var first = focusedCellIndex;
var heightOfCellsBeforeFocused = 0;
for (var i = first - 1; i >= 0 && heightOfCellsBeforeFocused < this._scrollMetrics.visibleLength; i--) {
first--;
heightOfCellsBeforeFocused += this.__getFrameMetricsApprox(i, props).length;
}
var last = focusedCellIndex;
var heightOfCellsAfterFocused = 0;
for (var _i = last + 1; _i < itemCount && heightOfCellsAfterFocused < this._scrollMetrics.visibleLength; _i++) {
last++;
heightOfCellsAfterFocused += this.__getFrameMetricsApprox(_i, props).length;
}
return [{
first,
last
}];
};
this._checkProps(_props);
this._fillRateHelper = new _FillRateHelper.default(this._getFrameMetrics);
this._updateCellsToRenderBatcher = new _Batchinator.default(this._updateCellsToRender, (_this$props$updateCel = this.props.updateCellsBatchingPeriod) !== null && _this$props$updateCel !== void 0 ? _this$props$updateCel : 50);
if (this.props.viewabilityConfigCallbackPairs) {
this._viewabilityTuples = this.props.viewabilityConfigCallbackPairs.map(pair => ({
viewabilityHelper: new _ViewabilityHelper.default(pair.viewabilityConfig),
onViewableItemsChanged: pair.onViewableItemsChanged
}));
} else {
var _this$props3 = this.props,
onViewableItemsChanged = _this$props3.onViewableItemsChanged,
viewabilityConfig = _this$props3.viewabilityConfig;
if (onViewableItemsChanged) {
this._viewabilityTuples.push({
viewabilityHelper: new _ViewabilityHelper.default(viewabilityConfig),
onViewableItemsChanged: onViewableItemsChanged
});
}
}
var initialRenderRegion = VirtualizedList._initialRenderRegion(_props);
this.state = {
cellsAroundViewport: initialRenderRegion,
renderMask: VirtualizedList._createRenderMask(_props, initialRenderRegion)
};
// REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.
// For issue https://github.com/necolas/react-native-web/issues/995
this.invertedWheelEventHandler = ev => {
var scrollOffset = this.props.horizontal ? ev.target.scrollLeft : ev.target.scrollTop;
var scrollLength = this.props.horizontal ? ev.target.scrollWidth : ev.target.scrollHeight;
var clientLength = this.props.horizontal ? ev.target.clientWidth : ev.target.clientHeight;
var isEventTargetScrollable = scrollLength > clientLength;
var delta = this.props.horizontal ? ev.deltaX || ev.wheelDeltaX : ev.deltaY || ev.wheelDeltaY;
var leftoverDelta = delta;
if (isEventTargetScrollable) {
leftoverDelta = delta < 0 ? Math.min(delta + scrollOffset, 0) : Math.max(delta - (scrollLength - clientLength - scrollOffset), 0);
}
var targetDelta = delta - leftoverDelta;
if (this.props.inverted && this._scrollRef && this._scrollRef.getScrollableNode) {
var node = this._scrollRef.getScrollableNode();
if (this.props.horizontal) {
ev.target.scrollLeft += targetDelta;
var nextScrollLeft = node.scrollLeft - leftoverDelta;
node.scrollLeft = !this.props.getItemLayout ? Math.min(nextScrollLeft, this._totalCellLength) : nextScrollLeft;
} else {
ev.target.scrollTop += targetDelta;
var nextScrollTop = node.scrollTop - leftoverDelta;
node.scrollTop = !this.props.getItemLayout ? Math.min(nextScrollTop, this._totalCellLength) : nextScrollTop;
}
ev.preventDefault();
}
};
}
_checkProps(props) {
var onScroll = props.onScroll,
windowSize = props.windowSize,
getItemCount = props.getItemCount,
data = props.data,
initialScrollIndex = props.initialScrollIndex;
(0, _invariant.default)(
// $FlowFixMe[prop-missing]
!onScroll || !onScroll.__isNative, 'Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent ' + 'to support native onScroll events with useNativeDriver');
(0, _invariant.default)(windowSizeOrDefault(windowSize) > 0, 'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.');
(0, _invariant.default)(getItemCount, 'VirtualizedList: The "getItemCount" prop must be provided');
var itemCount = getItemCount(data);
if (initialScrollIndex != null && !this._hasTriggeredInitialScrollToIndex && (initialScrollIndex < 0 || itemCount > 0 && initialScrollIndex >= itemCount) && !this._hasWarned.initialScrollIndex) {
console.warn("initialScrollIndex \"" + initialScrollIndex + "\" is not valid (list has " + itemCount + " items)");
this._hasWarned.initialScrollIndex = true;
}
if (__DEV__ && !this._hasWarned.flexWrap) {
// $FlowFixMe[underconstrained-implicit-instantiation]
var flatStyles = _StyleSheet.default.flatten(this.props.contentContainerStyle);
if (flatStyles != null && flatStyles.flexWrap === 'wrap') {
console.warn('`flexWrap: `wrap`` is not supported with the `VirtualizedList` components.' + 'Consider using `numColumns` with `FlatList` instead.');
this._hasWarned.flexWrap = true;
}
}
}
static _createRenderMask(props, cellsAroundViewport, additionalRegions) {
var itemCount = props.getItemCount(props.data);
(0, _invariant.default)(cellsAroundViewport.first >= 0 && cellsAroundViewport.last >= cellsAroundViewport.first - 1 && cellsAroundViewport.last < itemCount, "Invalid cells around viewport \"[" + cellsAroundViewport.first + ", " + cellsAroundViewport.last + "]\" was passed to VirtualizedList._createRenderMask");
var renderMask = new _CellRenderMask.CellRenderMask(itemCount);
if (itemCount > 0) {
var allRegions = [cellsAroundViewport, ...(additionalRegions !== null && additionalRegions !== void 0 ? additionalRegions : [])];
for (var _i2 = 0, _allRegions = allRegions; _i2 < _allRegions.length; _i2++) {
var region = _allRegions[_i2];
renderMask.addCells(region);
}
// The initially rendered cells are retained as part of the
// "scroll-to-top" optimization
if (props.initialScrollIndex == null || props.initialScrollIndex <= 0) {
var initialRegion = VirtualizedList._initialRenderRegion(props);
renderMask.addCells(initialRegion);
}
// The layout coordinates of sticker headers may be off-screen while the
// actual header is on-screen. Keep the most recent before the viewport
// rendered, even if its layout coordinates are not in viewport.
var stickyIndicesSet = new Set(props.stickyHeaderIndices);
VirtualizedList._ensureClosestStickyHeader(props, stickyIndicesSet, renderMask, cellsAroundViewport.first);
}
return renderMask;
}
static _initialRenderRegion(props) {
var _props$initialScrollI;
var itemCount = props.getItemCount(props.data);
var firstCellIndex = Math.max(0, Math.min(itemCount - 1, Math.floor((_props$initialScrollI = props.initialScrollIndex) !== null && _props$initialScrollI !== void 0 ? _props$initialScrollI : 0)));
var lastCellIndex = Math.min(itemCount, firstCellIndex + initialNumToRenderOrDefault(props.initialNumToRender)) - 1;
return {
first: firstCellIndex,
last: lastCellIndex
};
}
static _ensureClosestStickyHeader(props, stickyIndicesSet, renderMask, cellIdx) {
var stickyOffset = props.ListHeaderComponent ? 1 : 0;
for (var itemIdx = cellIdx - 1; itemIdx >= 0; itemIdx--) {
if (stickyIndicesSet.has(itemIdx + stickyOffset)) {
renderMask.addCells({
first: itemIdx,
last: itemIdx
});
break;
}
}
}
_adjustCellsAroundViewport(props, cellsAroundViewport) {
var data = props.data,
getItemCount = props.getItemCount;
var onEndReachedThreshold = onEndReachedThresholdOrDefault(props.onEndReachedThreshold);
var _this$_scrollMetrics = this._scrollMetrics,
contentLength = _this$_scrollMetrics.contentLength,
offset = _this$_scrollMetrics.offset,
visibleLength = _this$_scrollMetrics.visibleLength;
var distanceFromEnd = contentLength - visibleLength - offset;
// Wait until the scroll view metrics have been set up. And until then,
// we will trust the initialNumToRender suggestion
if (visibleLength <= 0 || contentLength <= 0) {
return cellsAroundViewport.last >= getItemCount(data) ? VirtualizedList._constrainToItemCount(cellsAroundViewport, props) : cellsAroundViewport;
}
var newCellsAroundViewport;
if (props.disableVirtualization) {
var renderAhead = distanceFromEnd < onEndReachedThreshold * visibleLength ? maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch) : 0;
newCellsAroundViewport = {
first: 0,
last: Math.min(cellsAroundViewport.last + renderAhead, getItemCount(data) - 1)
};
} else {
// If we have a non-zero initialScrollIndex and run this before we've scrolled,
// we'll wipe out the initialNumToRender rendered elements starting at initialScrollIndex.
// So let's wait until we've scrolled the view to the right place. And until then,
// we will trust the initialScrollIndex suggestion.
// Thus, we want to recalculate the windowed render limits if any of the following hold:
// - initialScrollIndex is undefined or is 0
// - initialScrollIndex > 0 AND scrolling is complete
// - initialScrollIndex > 0 AND the end of the list is visible (this handles the case
// where the list is shorter than the visible area)
if (props.initialScrollIndex && !this._scrollMetrics.offset && Math.abs(distanceFromEnd) >= Number.EPSILON) {
return cellsAroundViewport.last >= getItemCount(data) ? VirtualizedList._constrainToItemCount(cellsAroundViewport, props) : cellsAroundViewport;
}
newCellsAroundViewport = (0, _VirtualizeUtils.computeWindowedRenderLimits)(props, maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch), windowSizeOrDefault(props.windowSize), cellsAroundViewport, this.__getFrameMetricsApprox, this._scrollMetrics);
(0, _invariant.default)(newCellsAroundViewport.last < getItemCount(data), 'computeWindowedRenderLimits() should return range in-bounds');
}
if (this._nestedChildLists.size() > 0) {
// If some cell in the new state has a child list in it, we should only render
// up through that item, so that we give that list a chance to render.
// Otherwise there's churn from multiple child lists mounting and un-mounting
// their items.
// Will this prevent rendering if the nested list doesn't realize the end?
var childIdx = this._findFirstChildWithMore(newCellsAroundViewport.first, newCellsAroundViewport.last);
newCellsAroundViewport.last = childIdx !== null && childIdx !== void 0 ? childIdx : newCellsAroundViewport.last;
}
return newCellsAroundViewport;
}
_findFirstChildWithMore(first, last) {
for (var ii = first; ii <= last; ii++) {
var cellKeyForIndex = this._indicesToKeys.get(ii);
if (cellKeyForIndex != null && this._nestedChildLists.anyInCell(cellKeyForIndex, childList => childList.hasMore())) {
return ii;
}
}
return null;
}
componentDidMount() {
if (this._isNestedWithSameOrientation()) {
this.context.registerAsNestedChild({
ref: this,
cellKey: this.context.cellKey
});
}
// REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.
this.setupWebWheelHandler();
}
componentWillUnmount() {
if (this._isNestedWithSameOrientation()) {
this.context.unregisterAsNestedChild({
ref: this
});
}
this._updateCellsToRenderBatcher.dispose({
abort: true
});
this._viewabilityTuples.forEach(tuple => {
tuple.viewabilityHelper.dispose();
});
this._fillRateHelper.deactivateAndFlush();
// REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.
this.teardownWebWheelHandler();
}
// REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.
setupWebWheelHandler() {
if (this._scrollRef && this._scrollRef.getScrollableNode) {
this._scrollRef.getScrollableNode().addEventListener('wheel', this.invertedWheelEventHandler, {
passive: true
});
} else {
setTimeout(() => this.setupWebWheelHandler(), 50);
return;
}
}
// REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.
teardownWebWheelHandler() {
if (this._scrollRef && this._scrollRef.getScrollableNode) {
this._scrollRef.getScrollableNode().removeEventListener('wheel', this.invertedWheelEventHandler);
}
}
static getDerivedStateFromProps(newProps, prevState) {
// first and last could be stale (e.g. if a new, shorter items props is passed in), so we make
// sure we're rendering a reasonable range here.
var itemCount = newProps.getItemCount(newProps.data);
if (itemCount === prevState.renderMask.numCells()) {
return prevState;
}
var constrainedCells = VirtualizedList._constrainToItemCount(prevState.cellsAroundViewport, newProps);
return {
cellsAroundViewport: constrainedCells,
renderMask: VirtualizedList._createRenderMask(newProps, constrainedCells)
};
}
_pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, first, last, inversionStyle) {
var _this = this;
var _this$props4 = this.props,
CellRendererComponent = _this$props4.CellRendererComponent,
ItemSeparatorComponent = _this$props4.ItemSeparatorComponent,
ListHeaderComponent = _this$props4.ListHeaderComponent,
ListItemComponent = _this$props4.ListItemComponent,
data = _this$props4.data,
debug = _this$props4.debug,
getItem = _this$props4.getItem,
getItemCount = _this$props4.getItemCount,
getItemLayout = _this$props4.getItemLayout,
horizontal = _this$props4.horizontal,
renderItem = _this$props4.renderItem;
var stickyOffset = ListHeaderComponent ? 1 : 0;
var end = getItemCount(data) - 1;
var prevCellKey;
last = Math.min(end, last);
var _loop = function _loop() {
var item = getItem(data, ii);
var key = _this._keyExtractor(item, ii, _this.props);
_this._indicesToKeys.set(ii, key);
if (stickyIndicesFromProps.has(ii + stickyOffset)) {
stickyHeaderIndices.push(cells.length);
}
var shouldListenForLayout = getItemLayout == null || debug || _this._fillRateHelper.enabled();
cells.push( /*#__PURE__*/React.createElement(_VirtualizedListCellRenderer.default, (0, _extends2.default)({
CellRendererComponent: CellRendererComponent,
ItemSeparatorComponent: ii < end ? ItemSeparatorComponent : undefined,
ListItemComponent: ListItemComponent,
cellKey: key,
horizontal: horizontal,
index: ii,
inversionStyle: inversionStyle,
item: item,
key: key,
prevCellKey: prevCellKey,
onUpdateSeparators: _this._onUpdateSeparators,
onCellFocusCapture: e => _this._onCellFocusCapture(key),
onUnmount: _this._onCellUnmount,
ref: _ref => {
_this._cellRefs[key] = _ref;
},
renderItem: renderItem
}, shouldListenForLayout && {
onCellLayout: _this._onCellLayout
})));
prevCellKey = key;
};
for (var ii = first; ii <= last; ii++) {
_loop();
}
}
static _constrainToItemCount(cells, props) {
var itemCount = props.getItemCount(props.data);
var last = Math.min(itemCount - 1, cells.last);
var maxToRenderPerBatch = maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch);
return {
first: (0, _clamp.default)(0, itemCount - 1 - maxToRenderPerBatch, cells.first),
last
};
}
_isNestedWithSameOrientation() {
var nestedContext = this.context;
return !!(nestedContext && !!nestedContext.horizontal === horizontalOrDefault(this.props.horizontal));
}
_keyExtractor(item, index, props
// $FlowFixMe[missing-local-annot]
) {
if (props.keyExtractor != null) {
return props.keyExtractor(item, index);
}
var key = (0, _VirtualizeUtils.keyExtractor)(item, index);
if (key === String(index)) {
_usedIndexForKey = true;
if (item.type && item.type.displayName) {
_keylessItemComponentName = item.type.displayName;
}
}
return key;
}
render() {
this._checkProps(this.props);
var _this$props5 = this.props,
ListEmptyComponent = _this$props5.ListEmptyComponent,
ListFooterComponent = _this$props5.ListFooterComponent,
ListHeaderComponent = _this$props5.ListHeaderComponent;
var _this$props6 = this.props,
data = _this$props6.data,
horizontal = _this$props6.horizontal;
var inversionStyle = this.props.inverted ? horizontalOrDefault(this.props.horizontal) ? styles.horizontallyInverted : styles.verticallyInverted : null;
var cells = [];
var stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);
var stickyHeaderIndices = [];
// 1. Add cell for ListHeaderComponent
if (ListHeaderComponent) {
if (stickyIndicesFromProps.has(0)) {
stickyHeaderIndices.push(0);
}
var _element = /*#__PURE__*/React.isValidElement(ListHeaderComponent) ? ListHeaderComponent :
/*#__PURE__*/
// $FlowFixMe[not-a-component]
// $FlowFixMe[incompatible-type-arg]
React.createElement(ListHeaderComponent, null);
cells.push( /*#__PURE__*/React.createElement(_VirtualizedListContext.VirtualizedListCellContextProvider, {
cellKey: this._getCellKey() + '-header',
key: "$header"
}, /*#__PURE__*/React.createElement(_View.default, {
onLayout: this._onLayoutHeader,
style: [inversionStyle, this.props.ListHeaderComponentStyle]
},
// $FlowFixMe[incompatible-type] - Typing ReactNativeComponent revealed errors
_element)));
}
// 2a. Add a cell for ListEmptyComponent if applicable
var itemCount = this.props.getItemCount(data);
if (itemCount === 0 && ListEmptyComponent) {
var _element2 = /*#__PURE__*/React.isValidElement(ListEmptyComponent) ? ListEmptyComponent :
/*#__PURE__*/
// $FlowFixMe[not-a-component]
// $FlowFixMe[incompatible-type-arg]
React.createElement(ListEmptyComponent, null);
cells.push( /*#__PURE__*/React.createElement(_VirtualizedListContext.VirtualizedListCellContextProvider, {
cellKey: this._getCellKey() + '-empty',
key: "$empty"
}, /*#__PURE__*/React.cloneElement(_element2, {
onLayout: event => {
this._onLayoutEmpty(event);
if (_element2.props.onLayout) {
_element2.props.onLayout(event);
}
},
style: [inversionStyle, _element2.props.style]
})));
}
// 2b. Add cells and spacers for each item
if (itemCount > 0) {
_usedIndexForKey = false;
_keylessItemComponentName = '';
var spacerKey = this._getSpacerKey(!horizontal);
var renderRegions = this.state.renderMask.enumerateRegions();
var lastSpacer = findLastWhere(renderRegions, r => r.isSpacer);
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(renderRegions), _step; !(_step = _iterator()).done;) {
var section = _step.value;
if (section.isSpacer) {
// Legacy behavior is to avoid spacers when virtualization is
// disabled (including head spacers on initial render).
if (this.props.disableVirtualization) {
continue;
}
// Without getItemLayout, we limit our tail spacer to the _highestMeasuredFrameIndex to
// prevent the user for hyperscrolling into un-measured area because otherwise content will
// likely jump around as it renders in above the viewport.
var isLastSpacer = section === lastSpacer;
var constrainToMeasured = isLastSpacer && !this.props.getItemLayout;
var last = constrainToMeasured ? (0, _clamp.default)(section.first - 1, section.last, this._highestMeasuredFrameIndex) : section.last;
var firstMetrics = this.__getFrameMetricsApprox(section.first, this.props);
var lastMetrics = this.__getFrameMetricsApprox(last, this.props);
var spacerSize = lastMetrics.offset + lastMetrics.length - firstMetrics.offset;
cells.push( /*#__PURE__*/React.createElement(_View.default, {
key: "$spacer-" + section.first,
style: {
[spacerKey]: spacerSize
}
}));
} else {
this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, section.first, section.last, inversionStyle);
}
}
if (!this._hasWarned.keys && _usedIndexForKey) {
console.warn('VirtualizedList: missing keys for items, make sure to specify a key or id property on each ' + 'item or provide a custom keyExtractor.', _keylessItemComponentName);
this._hasWarned.keys = true;
}
}
// 3. Add cell for ListFooterComponent
if (ListFooterComponent) {
var _element3 = /*#__PURE__*/React.isValidElement(ListFooterComponent) ? ListFooterComponent :
/*#__PURE__*/
// $FlowFixMe[not-a-component]
// $FlowFixMe[incompatible-type-arg]
React.createElement(ListFooterComponent, null);
cells.push( /*#__PURE__*/React.createElement(_VirtualizedListContext.VirtualizedListCellContextProvider, {
cellKey: this._getFooterCellKey(),
key: "$footer"
}, /*#__PURE__*/React.createElement(_View.default, {
onLayout: this._onLayoutFooter,
style: [inversionStyle, this.props.ListFooterComponentStyle]
},
// $FlowFixMe[incompatible-type] - Typing ReactNativeComponent revealed errors
_element3)));
}
// 4. Render the ScrollView
var scrollProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.props), {}, {
onContentSizeChange: this._onContentSizeChange,
onLayout: this._onLayout,
onScroll: this._onScroll,
onScrollBeginDrag: this._onScrollBeginDrag,
onScrollEndDrag: this._onScrollEndDrag,
onMomentumScrollBegin: this._onMomentumScrollBegin,
onMomentumScrollEnd: this._onMomentumScrollEnd,
scrollEventThrottle: scrollEventThrottleOrDefault(this.props.scrollEventThrottle),
// TODO: Android support
invertStickyHeaders: this.props.invertStickyHeaders !== undefined ? this.props.invertStickyHeaders : this.props.inverted,
stickyHeaderIndices,
style: inversionStyle ? [inversionStyle, this.props.style] : this.props.style
});
this._hasMore = this.state.cellsAroundViewport.last < itemCount - 1;
var innerRet = /*#__PURE__*/React.createElement(_VirtualizedListContext.VirtualizedListContextProvider, {
value: {
cellKey: null,
getScrollMetrics: this._getScrollMetrics,
horizontal: horizontalOrDefault(this.props.horizontal),
getOutermostParentListRef: this._getOutermostParentListRef,
registerAsNestedChild: this._registerAsNestedChild,
unregisterAsNestedChild: this._unregisterAsNestedChild
}
}, /*#__PURE__*/React.cloneElement((this.props.renderScrollComponent || this._defaultRenderScrollComponent)(scrollProps), {
ref: this._captureScrollRef
}, cells));
var ret = innerRet;
/* https://github.com/necolas/react-native-web/issues/2239: Re-enable when ScrollView.Context.Consumer is available.
if (__DEV__) {
ret = (
<ScrollView.Context.Consumer>
{scrollContext => {
if (
scrollContext != null &&
!scrollContext.horizontal ===
!horizontalOrDefault(this.props.horizontal) &&
!this._hasWarned.nesting &&
this.context == null &&
this.props.scrollEnabled !== false
) {
// TODO (T46547044): use React.warn once 16.9 is sync'd: https://github.com/facebook/react/pull/15170
console.error(
'VirtualizedLists should never be nested inside plain ScrollViews with the same ' +
'orientation because it can break windowing and other functionality - use another ' +
'VirtualizedList-backed container instead.',
);
this._hasWarned.nesting = true;
}
return innerRet;
}}
</ScrollView.Context.Consumer>
);
}*/
if (this.props.debug) {
return /*#__PURE__*/React.createElement(_View.default, {
style: styles.debug
}, ret, this._renderDebugOverlay());
} else {
return ret;
}
}
componentDidUpdate(prevProps) {
var _this$props7 = this.props,
data = _this$props7.data,
extraData = _this$props7.extraData;
if (data !== prevProps.data || extraData !== prevProps.extraData) {
// clear the viewableIndices cache to also trigger
// the onViewableItemsChanged callback with the new data
this._viewabilityTuples.forEach(tuple => {
tuple.viewabilityHelper.resetViewableIndices();
});
}
// The `this._hiPriInProgress` is guaranteeing a hiPri cell update will only happen
// once per fiber update. The `_scheduleCellsToRenderUpdate` will set it to true
// if a hiPri update needs to perform. If `componentDidUpdate` is triggered with
// `this._hiPriInProgress=true`, means it's triggered by the hiPri update. The
// `_scheduleCellsToRenderUpdate` will check this condition and not perform
// another hiPri update.
var hiPriInProgress = this._hiPriInProgress;
this._scheduleCellsToRenderUpdate();
// Make sure setting `this._hiPriInProgress` back to false after `componentDidUpdate`
// is triggered with `this._hiPriInProgress = true`
if (hiPriInProgress) {
this._hiPriInProgress = false;
}
}
_computeBlankness() {
this._fillRateHelper.computeBlankness(this.props, this.state.cellsAroundViewport, this._scrollMetrics);
}
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
* LTI update could not be added via codemod */
_onCellFocusCapture(cellKey) {
this._lastFocusedCellKey = cellKey;
this._updateCellsToRender();
}
_triggerRemeasureForChildListsInCell(cellKey) {
this._nestedChildLists.forEachInCell(cellKey, childList => {
childList.measureLayoutRelativeToContainingList();
});
}
measureLayoutRelativeToContainingList() {
// TODO (T35574538): findNodeHandle sometimes crashes with "Unable to find
// node on an unmounted component" during scrolling
try {
if (!this._scrollRef) {
return;
}
// We are assuming that getOutermostParentListRef().getScrollRef()
// is a non-null reference to a ScrollView
this._scrollRef.measureLayout(this.context.getOutermostParentListRef().getScrollRef(), (x, y, width, height) => {
this._offsetFromParentVirtualizedList = this._selectOffset({
x,
y
});
this._scrollMetrics.contentLength = this._selectLength({
width,
height
});
var scrollMetrics = this._convertParentScrollMetrics(this.context.getScrollMetrics());
var metricsChanged = this._scrollMetrics.visibleLength !== scrollMetrics.visibleLength || this._scrollMetrics.offset !== scrollMetrics.offset;
if (metricsChanged) {
this._scrollMetrics.visibleLength = scrollMetrics.visibleLength;
this._scrollMetrics.offset = scrollMetrics.offset;
// If metrics of the scrollView changed, then we triggered remeasure for child list
// to ensure VirtualizedList has the right information.
this._nestedChildLists.forEach(childList => {
childList.measureLayoutRelativeToContainingList();
});
}
}, error => {
console.warn("VirtualizedList: Encountered an error while measuring a list's" + ' offset from its containing VirtualizedList.');
});
} catch (error) {
console.warn('measureLayoutRelativeToContainingList threw an error', error.stack);
}
}
_getFooterCellKey() {
return this._getCellKey() + '-footer';
}
// $FlowFixMe[missing-local-annot]
_renderDebugOverlay() {
var normalize = this._scrollMetrics.visibleLength / (this._scrollMetrics.contentLength || 1);
var framesInLayout = [];
var itemCount = this.props.getItemCount(this.props.data);
for (var ii = 0; ii < itemCount; ii++) {
var frame = this.__getFrameMetricsApprox(ii, this.props);
/* $FlowFixMe[prop-missing] (>=0.68.0 site=react_native_fb) This comment
* suppresses an error found when Flow v0.68 was deployed. To see the
* error delete this comment and run Flow. */
if (frame.inLayout) {
framesInLayout.push(frame);
}
}
var windowTop = this.__getFrameMetricsApprox(this.state.cellsAroundViewport.first, this.props).offset;
var frameLast = this.__getFrameMetricsApprox(this.state.cellsAroundViewport.last, this.props);
var windowLen = frameLast.offset + frameLast.length - windowTop;
var visTop = this._scrollMetrics.offset;
var visLen = this._scrollMetrics.visibleLength;
return /*#__PURE__*/React.createElement(_View.default, {
style: [styles.debugOverlayBase, styles.debugOverlay]
}, framesInLayout.map((f, ii) => /*#__PURE__*/React.createElement(_View.default, {
key: 'f' + ii,
style: [styles.debugOverlayBase, styles.debugOverlayFrame, {
top: f.offset * normalize,
height: f.length * normalize
}]
})), /*#__PURE__*/React.createElement(_View.default, {
style: [styles.debugOverlayBase, styles.debugOverlayFrameLast, {
top: windowTop * normalize,
height: windowLen * normalize
}]
}), /*#__PURE__*/React.createElement(_View.default, {
style: [styles.debugOverlayBase, styles.debugOverlayFrameVis, {
top: visTop * normalize,
height: visLen * normalize
}]
}));
}
_selectLength(metrics) {
return !horizontalOrDefault(this.props.horizontal) ? metrics.height : metrics.width;
}
_selectOffset(metrics) {
return !horizontalOrDefault(this.props.horizontal) ? metrics.y : metrics.x;
}
_maybeCallOnEdgeReached() {
var _this$props8 = this.props,
data = _this$props8.data,
getItemCount = _this$props8.getItemCount,
onStartReached = _this$props8.onStartReached,
onStartReachedThreshold = _this$props8.onStartReachedThreshold,
onEndReached = _this$props8.onEndReached,
onEndReachedThreshold = _this$props8.onEndReachedThreshold,
initialScrollIndex = _this$props8.initialScrollIndex;
var _this$_scrollMetrics2 = this._scrollMetrics,
contentLength = _this$_scrollMetrics2.contentLength,
visibleLength = _this$_scrollMetrics2.visibleLength,
offset = _this$_scrollMetrics2.offset;
var distanceFromStart = offset;
var distanceFromEnd = contentLength - visibleLength - offset;
// Especially when oERT is zero it's necessary to 'floor' very small distance values to be 0
// since debouncing causes us to not fire this event for every single "pixel" we scroll and can thus
// be at the edge of the list with a distance approximating 0 but not quite there.
if (distanceFromStart < ON_EDGE_REACHED_EPSILON) {
distanceFromStart = 0;
}
if (distanceFromEnd < ON_EDGE_REACHED_EPSILON) {
distanceFromEnd = 0;
}
// TODO: T121172172 Look into why we're "defaulting" to a threshold of 2px
// when oERT is not present (different from 2 viewports used elsewhere)
var DEFAULT_THRESHOLD_PX = 2;
var startThreshold = onStartReachedThreshold != null ? onStartReachedThreshold * visibleLength : DEFAULT_THRESHOLD_PX;
var endThreshold = onEndReachedThreshold != null ? onEndReachedThreshold * visibleLength : DEFAULT_THRESHOLD_PX;
var isWithinStartThreshold = distanceFromStart <= startThreshold;
var isWithinEndThreshold = distanceFromEnd <= endThreshold;
// First check if the user just scrolled within the end threshold
// and call onEndReached only once for a given content length,
// and only if onStartReached is not being executed
if (onEndReached && this.state.cellsAroundViewport.last === getItemCount(data) - 1 && isWithinEndThreshold && this._scrollMetrics.contentLength !== this._sentEndForContentLength) {
this._sentEndForContentLength = this._scrollMetrics.contentLength;
onEndReached({
distanceFromEnd
});
}
// Next check if the user just scrolled within the start threshold
// and call onStartReached only once for a given content length,
// and only if onEndReached is not being executed
else if (onStartReached != null && this.state.cellsAroundViewport.first === 0 && isWithinStartThreshold && this._scrollMetrics.contentLength !== this._sentStartForContentLength) {
// On initial mount when using initialScrollIndex the offset will be 0 initially
// and will trigger an unexpected onStartReached. To avoid this we can use
// timestamp to differentiate between the initial scroll metrics and when we actually
// received the first scroll event.
if (!initialScrollIndex || this._scrollMetrics.timestamp !== 0) {
this._sentStartForContentLength = this._scrollMetrics.contentLength;
onStartReached({
distanceFromStart
});
}
}
// If the user scrolls away from the start or end and back again,
// cause onStartReached or onEndReached to be triggered again
else {
this._sentStartForContentLength = isWithinStartThreshold ? this._sentStartForContentLength : 0;
this._sentEndForContentLength = isWithinEndThreshold ? this._sentEndForContentLength : 0;
}
}
_scheduleCellsToRenderUpdate() {
var _this$state$cellsArou = this.state.cellsAroundViewport,
first = _this$state$cellsArou.first,
last = _this$state$cellsArou.last;
var _this$_scrollMetrics3 = this._scrollMetrics,
offset = _this$_scrollMetrics3.offset,
visibleLength = _this$_scrollMetrics3.visibleLength,
velocity = _this$_scrollMetrics3.velocity;
var itemCount = this.props.getItemCount(this.props.data);
var hiPri = false;
var onStartReachedThreshold = onStartReachedThresholdOrDefault(this.props.onStartReachedThreshold);
var onEndReachedThreshold = onEndReachedThresholdOrDefault(this.props.onEndReachedThreshold);
// Mark as high priority if we're close to the start of the first item
// But only if there are items before the first rendered item
if (first > 0) {
var distTop = offset - this.__getFrameMetricsApprox(first, this.props).offset;
hiPri = distTop < 0 || velocity < -2 && distTop < getScrollingThreshold(onStartReachedThreshold, visibleLength);
}
// Mark as high priority if we're close to the end of the last item
// But only if there are items after the last rendered item
if (!hiPri && last >= 0 && last < itemCount - 1) {
var distBottom = this.__getFrameMetricsApprox(last, this.props).offset - (offset + visibleLength);
hiPri = distBottom < 0 || velocity > 2 && distBottom < getScrollingThreshold(onEndReachedThreshold, visibleLength);
}
// Only trigger high-priority updates if we've actually rendered cells,
// and with that size estimate, accurately compute how many cells we should render.
// Otherwise, it would just render as many cells as it can (of zero dimension),
// each time through attempting to render more (limited by maxToRenderPerBatch),
// starving the renderer from actually laying out the objects and computing _averageCellLength.
// If this is triggered in an `componentDidUpdate` followed by a hiPri cellToRenderUpdate
// We shouldn't do another hipri cellToRenderUpdate
if (hiPri && (this._averageCellLength || this.props.getItemLayout) && !this._hiPriInProgress) {
this._hiPriInProgress = true;
// Don't worry about interactions when scrolling quickly; focus on filling content as fast
// as possible.
this._updateCellsToRenderBatcher.dispose({
abort: true
});
this._updateCellsToRender();
return;
} else {
this._updateCellsToRenderBatcher.schedule();
}
}
_updateViewableItems(props, cellsAroundViewport) {
this._viewabilityTuples.forEach(tuple => {
tuple.viewabilityHelper.onUpdate(props, this._scrollMetrics.offset, this._scrollMetrics.visibleLength, this._getFrameMetrics, this._createViewToken, tuple.onViewableItemsChanged, cellsAroundViewport);
});
}
}
VirtualizedList.contextType = _VirtualizedListContext.VirtualizedListContext;
var styles = _StyleSheet.default.create({
verticallyInverted: {
transform: 'scaleY(-1)'
},
horizontallyInverted: {
transform: 'scaleX(-1)'
},
debug: {
flex: 1
},
debugOverlayBase: {
position: 'absolute',
top: 0,
right: 0
},
debugOverlay: {
bottom: 0,
width: 20,
borderColor: 'blue',
borderWidth: 1
},
debugOverlayFrame: {
left: 0,
backgroundColor: 'orange'
},
debugOverlayFrameLast: {
left: 0,
borderColor: 'green',
borderWidth: 2
},
debugOverlayFrameVis: {
left: 0,
borderColor: 'red',
borderWidth: 2
}
});
var _default = VirtualizedList;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/VirtualizedSectionList/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelperLoose"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _View = _interopRequireDefault(require("../../../exports/View"));
var _VirtualizedList = _interopRequireDefault(require("../VirtualizedList"));
var _VirtualizeUtils = require("../VirtualizeUtils");
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
var React = _interopRequireWildcard(require("react"));
var _excluded = ["ItemSeparatorComponent", "SectionSeparatorComponent", "renderItem", "renderSectionFooter", "renderSectionHeader", "sections", "stickySectionHeadersEnabled"];
/**
* Right now this just flattens everything into one list and uses VirtualizedList under the
* hood. The only operation that might not scale well is concatting the data arrays of all the
* sections when new props are received, which should be plenty fast for up to ~10,000 items.
*/
class VirtualizedSectionList extends React.PureComponent {
constructor() {
super(...arguments);
this._keyExtractor = (item, index) => {
var info = this._subExtractor(index);
return info && info.key || String(index);
};
this._convertViewable = viewable => {
var _info$index;
(0, _invariant.default)(viewable.index != null, 'Received a broken ViewToken');
var info = this._subExtractor(viewable.index);
if (!info) {
return null;
}
var keyExtractorWithNullableIndex = info.section.keyExtractor;
var keyExtractorWithNonNullableIndex = this.props.keyExtractor || _VirtualizeUtils.keyExtractor;
var key = keyExtractorWithNullableIndex != null ? keyExtractorWithNullableIndex(viewable.item, info.index) : keyExtractorWithNonNullableIndex(viewable.item, (_info$index = info.index) !== null && _info$index !== void 0 ? _info$index : 0);
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, viewable), {}, {
index: info.index,
key,
section: info.section
});
};
this._onViewableItemsChanged = _ref => {
var viewableItems = _ref.viewableItems,
changed = _ref.changed;
var onViewableItemsChanged = this.props.onViewableItemsChanged;
if (onViewableItemsChanged != null) {
onViewableItemsChanged({
viewableItems: viewableItems.map(this._convertViewable, this).filter(Boolean),
changed: changed.map(this._convertViewable, this).filter(Boolean)
});
}
};
this._renderItem = listItemCount =>
// eslint-disable-next-line react/no-unstable-nested-components
_ref2 => {
var item = _ref2.item,
index = _ref2.index;
var info = this._subExtractor(index);
if (!info) {
return null;
}
var infoIndex = info.index;
if (infoIndex == null) {
var section = info.section;
if (info.header === true) {
var renderSectionHeader = this.props.renderSectionHeader;
return renderSectionHeader ? renderSectionHeader({
section
}) : null;
} else {
var renderSectionFooter = this.props.renderSectionFooter;
return renderSectionFooter ? renderSectionFooter({
section
}) : null;
}
} else {
var renderItem = info.section.renderItem || this.props.renderItem;
var SeparatorComponent = this._getSeparatorComponent(index, info, listItemCount);
(0, _invariant.default)(renderItem, 'no renderItem!');
return /*#__PURE__*/React.createElement(ItemWithSeparator, {
SeparatorComponent: SeparatorComponent,
LeadingSeparatorComponent: infoIndex === 0 ? this.props.SectionSeparatorComponent : undefined,
cellKey: info.key,
index: infoIndex,
item: item,
leadingItem: info.leadingItem,
leadingSection: info.leadingSection,
prevCellKey: (this._subExtractor(index - 1) || {}).key
// Callback to provide updateHighlight for this item
,
setSelfHighlightCallback: this._setUpdateHighlightFor,
setSelfUpdatePropsCallback: this._setUpdatePropsFor
// Provide child ability to set highlight/updateProps for previous item using prevCellKey
,
updateHighlightFor: this._updateHighlightFor,
updatePropsFor: this._updatePropsFor,
renderItem: renderItem,
section: info.section,
trailingItem: info.trailingItem,
trailingSection: info.trailingSection,
inverted: !!this.props.inverted
});
}
};
this._updatePropsFor = (cellKey, value) => {
var updateProps = this._updatePropsMap[cellKey];
if (updateProps != null) {
updateProps(value);
}
};
this._updateHighlightFor = (cellKey, value) => {
var updateHighlight = this._updateHighlightMap[cellKey];
if (updateHighlight != null) {
updateHighlight(value);
}
};
this._setUpdateHighlightFor = (cellKey, updateHighlightFn) => {
if (updateHighlightFn != null) {
this._updateHighlightMap[cellKey] = updateHighlightFn;
} else {
// $FlowFixMe[prop-missing]
delete this._updateHighlightFor[cellKey];
}
};
this._setUpdatePropsFor = (cellKey, updatePropsFn) => {
if (updatePropsFn != null) {
this._updatePropsMap[cellKey] = updatePropsFn;
} else {
delete this._updatePropsMap[cellKey];
}
};
this._updateHighlightMap = {};
this._updatePropsMap = {};
this._captureRef = ref => {
this._listRef = ref;
};
}
scrollToLocation(params) {
var index = params.itemIndex;
for (var i = 0; i < params.sectionIndex; i++) {
index += this.props.getItemCount(this.props.sections[i].data) + 2;
}
var viewOffset = params.viewOffset || 0;
if (this._listRef == null) {
return;
}
if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) {
var frame = this._listRef.__getFrameMetricsApprox(index - params.itemIndex, this._listRef.props);
viewOffset += frame.length;
}
var toIndexParams = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
viewOffset,
index
});
// $FlowFixMe[incompatible-use]
this._listRef.scrollToIndex(toIndexParams);
}
getListRef() {
return this._listRef;
}
render() {
var _this$props = this.props,
ItemSeparatorComponent = _this$props.ItemSeparatorComponent,
SectionSeparatorComponent = _this$props.SectionSeparatorComponent,
_renderItem = _this$props.renderItem,
renderSectionFooter = _this$props.renderSectionFooter,
renderSectionHeader = _this$props.renderSectionHeader,
_sections = _this$props.sections,
stickySectionHeadersEnabled = _this$props.stickySectionHeadersEnabled,
passThroughProps = (0, _objectWithoutPropertiesLoose2.default)(_this$props, _excluded);
var listHeaderOffset = this.props.ListHeaderComponent ? 1 : 0;
var stickyHeaderIndices = this.props.stickySectionHeadersEnabled ? [] : undefined;
var itemCount = 0;
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(this.props.sections), _step; !(_step = _iterator()).done;) {
var section = _step.value;
// Track the section header indices
if (stickyHeaderIndices != null) {
stickyHeaderIndices.push(itemCount + listHeaderOffset);
}
// Add two for the section header and footer.
itemCount += 2;
itemCount += this.props.getItemCount(section.data);
}
var renderItem = this._renderItem(itemCount);
return /*#__PURE__*/React.createElement(_VirtualizedList.default, (0, _extends2.default)({}, passThroughProps, {
keyExtractor: this._keyExtractor,
stickyHeaderIndices: stickyHeaderIndices,
renderItem: renderItem,
data: this.props.sections,
getItem: (sections, index) => this._getItem(this.props, sections, index),
getItemCount: () => itemCount,
onViewableItemsChanged: this.props.onViewableItemsChanged ? this._onViewableItemsChanged : undefined,
ref: this._captureRef
}));
}
_getItem(props, sections, index) {
if (!sections) {
return null;
}
var itemIdx = index - 1;
for (var i = 0; i < sections.length; i++) {
var section = sections[i];
var sectionData = section.data;
var itemCount = props.getItemCount(sectionData);
if (itemIdx === -1 || itemIdx === itemCount) {
// We intend for there to be overflow by one on both ends of the list.
// This will be for headers and footers. When returning a header or footer
// item the section itself is the item.
return section;
} else if (itemIdx < itemCount) {
// If we are in the bounds of the list's data then return the item.
return props.getItem(sectionData, itemIdx);
} else {
itemIdx -= itemCount + 2; // Add two for the header and footer
}
}
return null;
}
// $FlowFixMe[missing-local-annot]
_subExtractor(index) {
var itemIndex = index;
var _this$props2 = this.props,
getItem = _this$props2.getItem,
getItemCount = _this$props2.getItemCount,
keyExtractor = _this$props2.keyExtractor,
sections = _this$props2.sections;
for (var i = 0; i < sections.length; i++) {
var section = sections[i];
var sectionData = section.data;
var key = section.key || String(i);
itemIndex -= 1; // The section adds an item for the header
if (itemIndex >= getItemCount(sectionData) + 1) {
itemIndex -= getItemCount(sectionData) + 1; // The section adds an item for the footer.
} else if (itemIndex === -1) {
return {
section,
key: key + ':header',
index: null,
header: true,
trailingSection: sections[i + 1]
};
} else if (itemIndex === getItemCount(sectionData)) {
return {
section,
key: key + ':footer',
index: null,
header: false,
trailingSection: sections[i + 1]
};
} else {
var extractor = section.keyExtractor || keyExtractor || _VirtualizeUtils.keyExtractor;
return {
section,
key: key + ':' + extractor(getItem(sectionData, itemIndex), itemIndex),
index: itemIndex,
leadingItem: getItem(sectionData, itemIndex - 1),
leadingSection: sections[i - 1],
trailingItem: getItem(sectionData, itemIndex + 1),
trailingSection: sections[i + 1]
};
}
}
}
_getSeparatorComponent(index, info, listItemCount) {
info = info || this._subExtractor(index);
if (!info) {
return null;
}
var ItemSeparatorComponent = info.section.ItemSeparatorComponent || this.props.ItemSeparatorComponent;
var SectionSeparatorComponent = this.props.SectionSeparatorComponent;
var isLastItemInList = index === listItemCount - 1;
var isLastItemInSection = info.index === this.props.getItemCount(info.section.data) - 1;
if (SectionSeparatorComponent && isLastItemInSection) {
return SectionSeparatorComponent;
}
if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) {
return ItemSeparatorComponent;
}
return null;
}
}
function ItemWithSeparator(props) {
var LeadingSeparatorComponent = props.LeadingSeparatorComponent,
SeparatorComponent = props.SeparatorComponent,
cellKey = props.cellKey,
prevCellKey = props.prevCellKey,
setSelfHighlightCallback = props.setSelfHighlightCallback,
updateHighlightFor = props.updateHighlightFor,
setSelfUpdatePropsCallback = props.setSelfUpdatePropsCallback,
updatePropsFor = props.updatePropsFor,
item = props.item,
index = props.index,
section = props.section,
inverted = props.inverted;
var _React$useState = React.useState(false),
leadingSeparatorHiglighted = _React$useState[0],
setLeadingSeparatorHighlighted = _React$useState[1];
var _React$useState2 = React.useState(false),
separatorHighlighted = _React$useState2[0],
setSeparatorHighlighted = _React$useState2[1];
var _React$useState3 = React.useState({
leadingItem: props.leadingItem,
leadingSection: props.leadingSection,
section: props.section,
trailingItem: props.item,
trailingSection: props.trailingSection
}),
leadingSeparatorProps = _React$useState3[0],
setLeadingSeparatorProps = _React$useState3[1];
var _React$useState4 = React.useState({
leadingItem: props.item,
leadingSection: props.leadingSection,
section: props.section,
trailingItem: props.trailingItem,
trailingSection: props.trailingSection
}),
separatorProps = _React$useState4[0],
setSeparatorProps = _React$useState4[1];
React.useEffect(() => {
setSelfHighlightCallback(cellKey, setSeparatorHighlighted);
// $FlowFixMe[incompatible-call]
setSelfUpdatePropsCallback(cellKey, setSeparatorProps);
return () => {
setSelfUpdatePropsCallback(cellKey, null);
setSelfHighlightCallback(cellKey, null);
};
}, [cellKey, setSelfHighlightCallback, setSeparatorProps, setSelfUpdatePropsCallback]);
var separators = {
highlight: () => {
setLeadingSeparatorHighlighted(true);
setSeparatorHighlighted(true);
if (prevCellKey != null) {
updateHighlightFor(prevCellKey, true);
}
},
unhighlight: () => {
setLeadingSeparatorHighlighted(false);
setSeparatorHighlighted(false);
if (prevCellKey != null) {
updateHighlightFor(prevCellKey, false);
}
},
updateProps: (select, newProps) => {
if (select === 'leading') {
if (LeadingSeparatorComponent != null) {
setLeadingSeparatorProps((0, _objectSpread2.default)((0, _objectSpread2.default)({}, leadingSeparatorProps), newProps));
} else if (prevCellKey != null) {
// update the previous item's separator
updatePropsFor(prevCellKey, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, leadingSeparatorProps), newProps));
}
} else if (select === 'trailing' && SeparatorComponent != null) {
setSeparatorProps((0, _objectSpread2.default)((0, _objectSpread2.default)({}, separatorProps), newProps));
}
}
};
var element = props.renderItem({
item,
index,
section,
separators
});
var leadingSeparator = LeadingSeparatorComponent != null && /*#__PURE__*/React.createElement(LeadingSeparatorComponent, (0, _extends2.default)({
highlighted: leadingSeparatorHiglighted
}, leadingSeparatorProps));
var separator = SeparatorComponent != null && /*#__PURE__*/React.createElement(SeparatorComponent, (0, _extends2.default)({
highlighted: separatorHighlighted
}, separatorProps));
return leadingSeparator || separator ? /*#__PURE__*/React.createElement(_View.default, null, inverted === false ? leadingSeparator : separator, element, inverted === false ? separator : leadingSeparator) : element;
}
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
* parameters */
// $FlowFixMe[method-unbinding]
var _default = VirtualizedSectionList;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/deepDiffer/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
*/
'use strict';
/*
* @returns {bool} true if different, false if equal
*/
exports.__esModule = true;
exports.default = void 0;
var deepDiffer = function deepDiffer(one, two, maxDepth) {
if (maxDepth === void 0) {
maxDepth = -1;
}
if (maxDepth === 0) {
return true;
}
if (one === two) {
// Short circuit on identical object references instead of traversing them.
return false;
}
if (typeof one === 'function' && typeof two === 'function') {
// We consider all functions equal
return false;
}
if (typeof one !== 'object' || one === null) {
// Primitives can be directly compared
return one !== two;
}
if (typeof two !== 'object' || two === null) {
// We know they are different because the previous case would have triggered
// otherwise.
return true;
}
if (one.constructor !== two.constructor) {
return true;
}
if (Array.isArray(one)) {
// We know two is also an array because the constructors are equal
var len = one.length;
if (two.length !== len) {
return true;
}
for (var ii = 0; ii < len; ii++) {
if (deepDiffer(one[ii], two[ii], maxDepth - 1)) {
return true;
}
}
} else {
for (var key in one) {
if (deepDiffer(one[key], two[key], maxDepth - 1)) {
return true;
}
}
for (var twoKey in two) {
// The only case we haven't checked yet is keys that are in two but aren't
// in one, which means they are different.
if (one[twoKey] === undefined && two[twoKey] !== undefined) {
return true;
}
}
}
return false;
};
var _default = deepDiffer;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/infoLog/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
*/
'use strict';
/**
* Intentional info-level logging for clear separation from ad-hoc console debug logging.
*/
exports.__esModule = true;
exports.default = void 0;
function infoLog() {
return console.log(...arguments);
}
var _default = infoLog;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/dist/cjs/vendor/react-native/vendor/emitter/EventEmitter.js
"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* EventEmitter manages listeners and publishes events to them.
*
* EventEmitter accepts a single type parameter that defines the valid events
* and associated listener argument(s).
*
* @example
*
* const emitter = new EventEmitter<{
* success: [number, string],
* error: [Error],
* }>();
*
* emitter.on('success', (statusCode, responseText) => {...});
* emitter.emit('success', 200, '...');
*
* emitter.on('error', error => {...});
* emitter.emit('error', new Error('Resource not found'));
*
*/
class EventEmitter {
constructor() {
this._registry = {};
}
/**
* Registers a listener that is called when the supplied event is emitted.
* Returns a subscription that has a `remove` method to undo registration.
*/
addListener(eventType, listener, context) {
var registrations = allocate(this._registry, eventType);
var registration = {
context,
listener,
remove() {
registrations.delete(registration);
}
};
registrations.add(registration);
return registration;
}
/**
* Emits the supplied event. Additional arguments supplied to `emit` will be
* passed through to each of the registered listeners.
*
* If a listener modifies the listeners registered for the same event, those
* changes will not be reflected in the current invocation of `emit`.
*/
emit(eventType) {
var registrations = this._registry[eventType];
if (registrations != null) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
for (var _i = 0, _arr = [...registrations]; _i < _arr.length; _i++) {
var registration = _arr[_i];
registration.listener.apply(registration.context, args);
}
}
}
/**
* Removes all registered listeners.
*/
removeAllListeners(eventType) {
if (eventType == null) {
this._registry = {};
} else {
delete this._registry[eventType];
}
}
/**
* Returns the number of registered listeners for the supplied event.
*/
listenerCount(eventType) {
var registrations = this._registry[eventType];
return registrations == null ? 0 : registrations.size;
}
}
exports.default = EventEmitter;
function allocate(registry, eventType) {
var registrations = registry[eventType];
if (registrations == null) {
registrations = new Set();
registry[eventType] = registrations;
}
return registrations;
}
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@react-native/normalize-colors/index.js
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @noflow
*/
/* eslint no-bitwise: 0 */
'use strict';
function normalizeColor(color) {
if (typeof color === 'number') {
if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) {
return color;
}
return null;
}
if (typeof color !== 'string') {
return null;
}
const matchers = getMatchers();
let match;
// Ordered based on occurrences on Facebook codebase
if ((match = matchers.hex6.exec(color))) {
return parseInt(match[1] + 'ff', 16) >>> 0;
}
const colorFromKeyword = normalizeKeyword(color);
if (colorFromKeyword != null) {
return colorFromKeyword;
}
if ((match = matchers.rgb.exec(color))) {
return (
((parse255(match[1]) << 24) | // r
(parse255(match[2]) << 16) | // g
(parse255(match[3]) << 8) | // b
0x000000ff) >>> // a
0
);
}
if ((match = matchers.rgba.exec(color))) {
// rgba(R G B / A) notation
if (match[6] !== undefined) {
return (
((parse255(match[6]) << 24) | // r
(parse255(match[7]) << 16) | // g
(parse255(match[8]) << 8) | // b
parse1(match[9])) >>> // a
0
);
}
// rgba(R, G, B, A) notation
return (
((parse255(match[2]) << 24) | // r
(parse255(match[3]) << 16) | // g
(parse255(match[4]) << 8) | // b
parse1(match[5])) >>> // a
0
);
}
if ((match = matchers.hex3.exec(color))) {
return (
parseInt(
match[1] +
match[1] + // r
match[2] +
match[2] + // g
match[3] +
match[3] + // b
'ff', // a
16,
) >>> 0
);
}
// https://drafts.csswg.org/css-color-4/#hex-notation
if ((match = matchers.hex8.exec(color))) {
return parseInt(match[1], 16) >>> 0;
}
if ((match = matchers.hex4.exec(color))) {
return (
parseInt(
match[1] +
match[1] + // r
match[2] +
match[2] + // g
match[3] +
match[3] + // b
match[4] +
match[4], // a
16,
) >>> 0
);
}
if ((match = matchers.hsl.exec(color))) {
return (
(hslToRgb(
parse360(match[1]), // h
parsePercentage(match[2]), // s
parsePercentage(match[3]), // l
) |
0x000000ff) >>> // a
0
);
}
if ((match = matchers.hsla.exec(color))) {
// hsla(H S L / A) notation
if (match[6] !== undefined) {
return (
(hslToRgb(
parse360(match[6]), // h
parsePercentage(match[7]), // s
parsePercentage(match[8]), // l
) |
parse1(match[9])) >>> // a
0
);
}
// hsla(H, S, L, A) notation
return (
(hslToRgb(
parse360(match[2]), // h
parsePercentage(match[3]), // s
parsePercentage(match[4]), // l
) |
parse1(match[5])) >>> // a
0
);
}
if ((match = matchers.hwb.exec(color))) {
return (
(hwbToRgb(
parse360(match[1]), // h
parsePercentage(match[2]), // w
parsePercentage(match[3]), // b
) |
0x000000ff) >>> // a
0
);
}
return null;
}
function hue2rgb(p, q, t) {
if (t < 0) {
t += 1;
}
if (t > 1) {
t -= 1;
}
if (t < 1 / 6) {
return p + (q - p) * 6 * t;
}
if (t < 1 / 2) {
return q;
}
if (t < 2 / 3) {
return p + (q - p) * (2 / 3 - t) * 6;
}
return p;
}
function hslToRgb(h, s, l) {
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
const p = 2 * l - q;
const r = hue2rgb(p, q, h + 1 / 3);
const g = hue2rgb(p, q, h);
const b = hue2rgb(p, q, h - 1 / 3);
return (
(Math.round(r * 255) << 24) |
(Math.round(g * 255) << 16) |
(Math.round(b * 255) << 8)
);
}
function hwbToRgb(h, w, b) {
if (w + b >= 1) {
const gray = Math.round((w * 255) / (w + b));
return (gray << 24) | (gray << 16) | (gray << 8);
}
const red = hue2rgb(0, 1, h + 1 / 3) * (1 - w - b) + w;
const green = hue2rgb(0, 1, h) * (1 - w - b) + w;
const blue = hue2rgb(0, 1, h - 1 / 3) * (1 - w - b) + w;
return (
(Math.round(red * 255) << 24) |
(Math.round(green * 255) << 16) |
(Math.round(blue * 255) << 8)
);
}
const NUMBER = '[-+]?\\d*\\.?\\d+';
const PERCENTAGE = NUMBER + '%';
function call(...args) {
return '\\(\\s*(' + args.join(')\\s*,?\\s*(') + ')\\s*\\)';
}
function callWithSlashSeparator(...args) {
return (
'\\(\\s*(' +
args.slice(0, args.length - 1).join(')\\s*,?\\s*(') +
')\\s*/\\s*(' +
args[args.length - 1] +
')\\s*\\)'
);
}
function commaSeparatedCall(...args) {
return '\\(\\s*(' + args.join(')\\s*,\\s*(') + ')\\s*\\)';
}
let cachedMatchers;
function getMatchers() {
if (cachedMatchers === undefined) {
cachedMatchers = {
rgb: new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)),
rgba: new RegExp(
'rgba(' +
commaSeparatedCall(NUMBER, NUMBER, NUMBER, NUMBER) +
'|' +
callWithSlashSeparator(NUMBER, NUMBER, NUMBER, NUMBER) +
')',
),
hsl: new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)),
hsla: new RegExp(
'hsla(' +
commaSeparatedCall(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) +
'|' +
callWithSlashSeparator(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) +
')',
),
hwb: new RegExp('hwb' + call(NUMBER, PERCENTAGE, PERCENTAGE)),
hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#([0-9a-fA-F]{6})$/,
hex8: /^#([0-9a-fA-F]{8})$/,
};
}
return cachedMatchers;
}
function parse255(str) {
const int = parseInt(str, 10);
if (int < 0) {
return 0;
}
if (int > 255) {
return 255;
}
return int;
}
function parse360(str) {
const int = parseFloat(str);
return (((int % 360) + 360) % 360) / 360;
}
function parse1(str) {
const num = parseFloat(str);
if (num < 0) {
return 0;
}
if (num > 1) {
return 255;
}
return Math.round(num * 255);
}
function parsePercentage(str) {
// parseFloat conveniently ignores the final %
const int = parseFloat(str);
if (int < 0) {
return 0;
}
if (int > 100) {
return 1;
}
return int / 100;
}
function normalizeKeyword(name) {
// prettier-ignore
switch (name) {
case 'transparent': return 0x00000000;
// http://www.w3.org/TR/css3-color/#svg-color
case 'aliceblue': return 0xf0f8ffff;
case 'antiquewhite': return 0xfaebd7ff;
case 'aqua': return 0x00ffffff;
case 'aquamarine': return 0x7fffd4ff;
case 'azure': return 0xf0ffffff;
case 'beige': return 0xf5f5dcff;
case 'bisque': return 0xffe4c4ff;
case 'black': return 0x000000ff;
case 'blanchedalmond': return 0xffebcdff;
case 'blue': return 0x0000ffff;
case 'blueviolet': return 0x8a2be2ff;
case 'brown': return 0xa52a2aff;
case 'burlywood': return 0xdeb887ff;
case 'burntsienna': return 0xea7e5dff;
case 'cadetblue': return 0x5f9ea0ff;
case 'chartreuse': return 0x7fff00ff;
case 'chocolate': return 0xd2691eff;
case 'coral': return 0xff7f50ff;
case 'cornflowerblue': return 0x6495edff;
case 'cornsilk': return 0xfff8dcff;
case 'crimson': return 0xdc143cff;
case 'cyan': return 0x00ffffff;
case 'darkblue': return 0x00008bff;
case 'darkcyan': return 0x008b8bff;
case 'darkgoldenrod': return 0xb8860bff;
case 'darkgray': return 0xa9a9a9ff;
case 'darkgreen': return 0x006400ff;
case 'darkgrey': return 0xa9a9a9ff;
case 'darkkhaki': return 0xbdb76bff;
case 'darkmagenta': return 0x8b008bff;
case 'darkolivegreen': return 0x556b2fff;
case 'darkorange': return 0xff8c00ff;
case 'darkorchid': return 0x9932ccff;
case 'darkred': return 0x8b0000ff;
case 'darksalmon': return 0xe9967aff;
case 'darkseagreen': return 0x8fbc8fff;
case 'darkslateblue': return 0x483d8bff;
case 'darkslategray': return 0x2f4f4fff;
case 'darkslategrey': return 0x2f4f4fff;
case 'darkturquoise': return 0x00ced1ff;
case 'darkviolet': return 0x9400d3ff;
case 'deeppink': return 0xff1493ff;
case 'deepskyblue': return 0x00bfffff;
case 'dimgray': return 0x696969ff;
case 'dimgrey': return 0x696969ff;
case 'dodgerblue': return 0x1e90ffff;
case 'firebrick': return 0xb22222ff;
case 'floralwhite': return 0xfffaf0ff;
case 'forestgreen': return 0x228b22ff;
case 'fuchsia': return 0xff00ffff;
case 'gainsboro': return 0xdcdcdcff;
case 'ghostwhite': return 0xf8f8ffff;
case 'gold': return 0xffd700ff;
case 'goldenrod': return 0xdaa520ff;
case 'gray': return 0x808080ff;
case 'green': return 0x008000ff;
case 'greenyellow': return 0xadff2fff;
case 'grey': return 0x808080ff;
case 'honeydew': return 0xf0fff0ff;
case 'hotpink': return 0xff69b4ff;
case 'indianred': return 0xcd5c5cff;
case 'indigo': return 0x4b0082ff;
case 'ivory': return 0xfffff0ff;
case 'khaki': return 0xf0e68cff;
case 'lavender': return 0xe6e6faff;
case 'lavenderblush': return 0xfff0f5ff;
case 'lawngreen': return 0x7cfc00ff;
case 'lemonchiffon': return 0xfffacdff;
case 'lightblue': return 0xadd8e6ff;
case 'lightcoral': return 0xf08080ff;
case 'lightcyan': return 0xe0ffffff;
case 'lightgoldenrodyellow': return 0xfafad2ff;
case 'lightgray': return 0xd3d3d3ff;
case 'lightgreen': return 0x90ee90ff;
case 'lightgrey': return 0xd3d3d3ff;
case 'lightpink': return 0xffb6c1ff;
case 'lightsalmon': return 0xffa07aff;
case 'lightseagreen': return 0x20b2aaff;
case 'lightskyblue': return 0x87cefaff;
case 'lightslategray': return 0x778899ff;
case 'lightslategrey': return 0x778899ff;
case 'lightsteelblue': return 0xb0c4deff;
case 'lightyellow': return 0xffffe0ff;
case 'lime': return 0x00ff00ff;
case 'limegreen': return 0x32cd32ff;
case 'linen': return 0xfaf0e6ff;
case 'magenta': return 0xff00ffff;
case 'maroon': return 0x800000ff;
case 'mediumaquamarine': return 0x66cdaaff;
case 'mediumblue': return 0x0000cdff;
case 'mediumorchid': return 0xba55d3ff;
case 'mediumpurple': return 0x9370dbff;
case 'mediumseagreen': return 0x3cb371ff;
case 'mediumslateblue': return 0x7b68eeff;
case 'mediumspringgreen': return 0x00fa9aff;
case 'mediumturquoise': return 0x48d1ccff;
case 'mediumvioletred': return 0xc71585ff;
case 'midnightblue': return 0x191970ff;
case 'mintcream': return 0xf5fffaff;
case 'mistyrose': return 0xffe4e1ff;
case 'moccasin': return 0xffe4b5ff;
case 'navajowhite': return 0xffdeadff;
case 'navy': return 0x000080ff;
case 'oldlace': return 0xfdf5e6ff;
case 'olive': return 0x808000ff;
case 'olivedrab': return 0x6b8e23ff;
case 'orange': return 0xffa500ff;
case 'orangered': return 0xff4500ff;
case 'orchid': return 0xda70d6ff;
case 'palegoldenrod': return 0xeee8aaff;
case 'palegreen': return 0x98fb98ff;
case 'paleturquoise': return 0xafeeeeff;
case 'palevioletred': return 0xdb7093ff;
case 'papayawhip': return 0xffefd5ff;
case 'peachpuff': return 0xffdab9ff;
case 'peru': return 0xcd853fff;
case 'pink': return 0xffc0cbff;
case 'plum': return 0xdda0ddff;
case 'powderblue': return 0xb0e0e6ff;
case 'purple': return 0x800080ff;
case 'rebeccapurple': return 0x663399ff;
case 'red': return 0xff0000ff;
case 'rosybrown': return 0xbc8f8fff;
case 'royalblue': return 0x4169e1ff;
case 'saddlebrown': return 0x8b4513ff;
case 'salmon': return 0xfa8072ff;
case 'sandybrown': return 0xf4a460ff;
case 'seagreen': return 0x2e8b57ff;
case 'seashell': return 0xfff5eeff;
case 'sienna': return 0xa0522dff;
case 'silver': return 0xc0c0c0ff;
case 'skyblue': return 0x87ceebff;
case 'slateblue': return 0x6a5acdff;
case 'slategray': return 0x708090ff;
case 'slategrey': return 0x708090ff;
case 'snow': return 0xfffafaff;
case 'springgreen': return 0x00ff7fff;
case 'steelblue': return 0x4682b4ff;
case 'tan': return 0xd2b48cff;
case 'teal': return 0x008080ff;
case 'thistle': return 0xd8bfd8ff;
case 'tomato': return 0xff6347ff;
case 'turquoise': return 0x40e0d0ff;
case 'violet': return 0xee82eeff;
case 'wheat': return 0xf5deb3ff;
case 'white': return 0xffffffff;
case 'whitesmoke': return 0xf5f5f5ff;
case 'yellow': return 0xffff00ff;
case 'yellowgreen': return 0x9acd32ff;
}
return null;
}
module.exports = normalizeColor;
webpack://frontend-tpt/../../node_modules/react-number-format/lib/number_format.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var _utils = require("./utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
var propTypes = {
thousandSeparator: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.oneOf([true])]),
decimalSeparator: _propTypes.default.string,
decimalScale: _propTypes.default.number,
fixedDecimalScale: _propTypes.default.bool,
displayType: _propTypes.default.oneOf(['input', 'text']),
prefix: _propTypes.default.string,
suffix: _propTypes.default.string,
format: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]),
removeFormatting: _propTypes.default.func,
mask: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
value: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
isNumericString: _propTypes.default.bool,
customInput: _propTypes.default.func,
allowNegative: _propTypes.default.bool,
allowEmptyFormatting: _propTypes.default.bool,
onValueChange: _propTypes.default.func,
onKeyDown: _propTypes.default.func,
onMouseUp: _propTypes.default.func,
onChange: _propTypes.default.func,
onFocus: _propTypes.default.func,
onBlur: _propTypes.default.func,
type: _propTypes.default.oneOf(['text', 'tel']),
isAllowed: _propTypes.default.func,
renderText: _propTypes.default.func,
getInputRef: _propTypes.default.func
};
var defaultProps = {
displayType: 'input',
decimalSeparator: '.',
fixedDecimalScale: false,
prefix: '',
suffix: '',
allowNegative: true,
allowEmptyFormatting: false,
isNumericString: false,
type: 'text',
onValueChange: _utils.noop,
onChange: _utils.noop,
onKeyDown: _utils.noop,
onMouseUp: _utils.noop,
onFocus: _utils.noop,
onBlur: _utils.noop,
isAllowed: _utils.returnTrue,
getInputRef: _utils.noop
};
var NumberFormat =
/*#__PURE__*/
function (_React$Component) {
_inherits(NumberFormat, _React$Component);
function NumberFormat(props) {
var _this;
_classCallCheck(this, NumberFormat);
_this = _possibleConstructorReturn(this, _getPrototypeOf(NumberFormat).call(this, props)); //validate props
_this.validateProps();
var formattedValue = _this.formatValueProp();
_this.state = {
value: formattedValue,
numAsString: _this.removeFormatting(formattedValue)
};
_this.selectionBeforeInput = {
selectionStart: 0,
selectionEnd: 0
};
_this.onChange = _this.onChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));
_this.onKeyDown = _this.onKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
_this.onMouseUp = _this.onMouseUp.bind(_assertThisInitialized(_assertThisInitialized(_this)));
_this.onFocus = _this.onFocus.bind(_assertThisInitialized(_assertThisInitialized(_this)));
_this.onBlur = _this.onBlur.bind(_assertThisInitialized(_assertThisInitialized(_this)));
return _this;
}
_createClass(NumberFormat, [{
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
this.updateValueIfRequired(prevProps);
}
}, {
key: "updateValueIfRequired",
value: function updateValueIfRequired(prevProps) {
var props = this.props,
state = this.state;
if (prevProps !== props) {
//validate props
this.validateProps();
var stateValue = state.value;
var lastNumStr = state.numAsString || '';
var lastValueWithNewFormat = this.formatNumString(lastNumStr);
var formattedValue = props.value === undefined ? lastValueWithNewFormat : this.formatValueProp();
var numAsString = this.removeFormatting(formattedValue);
var floatValue = parseFloat(numAsString);
var lastFloatValue = parseFloat(lastNumStr);
if ((!isNaN(floatValue) || !isNaN(lastFloatValue)) && floatValue !== lastFloatValue || lastValueWithNewFormat !== stateValue) {
this.setState({
value: formattedValue,
numAsString: numAsString
});
}
}
}
/** Misc methods **/
}, {
key: "getFloatString",
value: function getFloatString() {
var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var decimalScale = this.props.decimalScale;
var _this$getSeparators = this.getSeparators(),
decimalSeparator = _this$getSeparators.decimalSeparator;
var numRegex = this.getNumberRegex(true); //remove negation for regex check
var hasNegation = num[0] === '-';
if (hasNegation) num = num.replace('-', ''); //if decimal scale is zero remove decimal and number after decimalSeparator
if (decimalSeparator && decimalScale === 0) {
num = num.split(decimalSeparator)[0];
}
num = (num.match(numRegex) || []).join('').replace(decimalSeparator, '.'); //remove extra decimals
var firstDecimalIndex = num.indexOf('.');
if (firstDecimalIndex !== -1) {
num = "".concat(num.substring(0, firstDecimalIndex), ".").concat(num.substring(firstDecimalIndex + 1, num.length).replace(new RegExp((0, _utils.escapeRegExp)(decimalSeparator), 'g'), ''));
} //add negation back
if (hasNegation) num = '-' + num;
return num;
} //returned regex assumes decimalSeparator is as per prop
}, {
key: "getNumberRegex",
value: function getNumberRegex(g, ignoreDecimalSeparator) {
var _this$props = this.props,
format = _this$props.format,
decimalScale = _this$props.decimalScale;
var _this$getSeparators2 = this.getSeparators(),
decimalSeparator = _this$getSeparators2.decimalSeparator;
return new RegExp('\\d' + (decimalSeparator && decimalScale !== 0 && !ignoreDecimalSeparator && !format ? '|' + (0, _utils.escapeRegExp)(decimalSeparator) : ''), g ? 'g' : undefined);
}
}, {
key: "getSeparators",
value: function getSeparators() {
var decimalSeparator = this.props.decimalSeparator;
var thousandSeparator = this.props.thousandSeparator;
if (thousandSeparator === true) {
thousandSeparator = ',';
}
return {
decimalSeparator: decimalSeparator,
thousandSeparator: thousandSeparator
};
}
}, {
key: "getMaskAtIndex",
value: function getMaskAtIndex(index) {
var _this$props$mask = this.props.mask,
mask = _this$props$mask === void 0 ? ' ' : _this$props$mask;
if (typeof mask === 'string') {
return mask;
}
return mask[index] || ' ';
}
}, {
key: "getValueObject",
value: function getValueObject(formattedValue, numAsString) {
var floatValue = parseFloat(numAsString);
return {
formattedValue: formattedValue,
value: numAsString,
floatValue: isNaN(floatValue) ? undefined : floatValue
};
}
}, {
key: "validateProps",
value: function validateProps() {
var mask = this.props.mask; //validate decimalSeparator and thousandSeparator
var _this$getSeparators3 = this.getSeparators(),
decimalSeparator = _this$getSeparators3.decimalSeparator,
thousandSeparator = _this$getSeparators3.thousandSeparator;
if (decimalSeparator === thousandSeparator) {
throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: ".concat(thousandSeparator, " (thousandSeparator = {true} is same as thousandSeparator = \",\")\n decimalSeparator: ").concat(decimalSeparator, " (default value for decimalSeparator is .)\n "));
} //validate mask
if (mask) {
var maskAsStr = mask === 'string' ? mask : mask.toString();
if (maskAsStr.match(/\d/g)) {
throw new Error("\n Mask ".concat(mask, " should not contain numeric character;\n "));
}
}
}
/** Misc methods end **/
/** caret specific methods **/
}, {
key: "setPatchedCaretPosition",
value: function setPatchedCaretPosition(el, caretPos, currentValue) {
/* setting caret position within timeout of 0ms is required for mobile chrome,
otherwise browser resets the caret position after we set it
We are also setting it without timeout so that in normal browser we don't see the flickering */
(0, _utils.setCaretPosition)(el, caretPos);
setTimeout(function () {
if (el.value === currentValue) (0, _utils.setCaretPosition)(el, caretPos);
}, 0);
}
/* This keeps the caret within typing area so people can't type in between prefix or suffix */
}, {
key: "correctCaretPosition",
value: function correctCaretPosition(value, caretPos, direction) {
var _this$props2 = this.props,
prefix = _this$props2.prefix,
suffix = _this$props2.suffix,
format = _this$props2.format; //if value is empty return 0
if (value === '') return 0; //caret position should be between 0 and value length
caretPos = (0, _utils.clamp)(caretPos, 0, value.length); //in case of format as number limit between prefix and suffix
if (!format) {
var hasNegation = value[0] === '-';
return (0, _utils.clamp)(caretPos, prefix.length + (hasNegation ? 1 : 0), value.length - suffix.length);
} //in case if custom format method don't do anything
if (typeof format === 'function') return caretPos;
/* in case format is string find the closest # position from the caret position */
//in case the caretPos have input value on it don't do anything
if (format[caretPos] === '#' && (0, _utils.charIsNumber)(value[caretPos])) return caretPos; //if caretPos is just after input value don't do anything
if (format[caretPos - 1] === '#' && (0, _utils.charIsNumber)(value[caretPos - 1])) return caretPos; //find the nearest caret position
var firstHashPosition = format.indexOf('#');
var lastHashPosition = format.lastIndexOf('#'); //limit the cursor between the first # position and the last # position
caretPos = (0, _utils.clamp)(caretPos, firstHashPosition, lastHashPosition + 1);
var nextPos = format.substring(caretPos, format.length).indexOf('#');
var caretLeftBound = caretPos;
var caretRightBound = caretPos + (nextPos === -1 ? 0 : nextPos); //get the position where the last number is present
while (caretLeftBound > firstHashPosition && (format[caretLeftBound] !== '#' || !(0, _utils.charIsNumber)(value[caretLeftBound]))) {
caretLeftBound -= 1;
}
var goToLeft = !(0, _utils.charIsNumber)(value[caretRightBound]) || direction === 'left' && caretPos !== firstHashPosition || caretPos - caretLeftBound < caretRightBound - caretPos;
if (goToLeft) {
//check if number should be taken after the bound or after it
//if number preceding a valid number keep it after
return (0, _utils.charIsNumber)(value[caretLeftBound]) ? caretLeftBound + 1 : caretLeftBound;
}
return caretRightBound;
}
}, {
key: "getCaretPosition",
value: function getCaretPosition(inputValue, formattedValue, caretPos) {
var format = this.props.format;
var stateValue = this.state.value;
var numRegex = this.getNumberRegex(true);
var inputNumber = (inputValue.match(numRegex) || []).join('');
var formattedNumber = (formattedValue.match(numRegex) || []).join('');
var j, i;
j = 0;
for (i = 0; i < caretPos; i++) {
var currentInputChar = inputValue[i] || '';
var currentFormatChar = formattedValue[j] || ''; //no need to increase new cursor position if formatted value does not have those characters
//case inputValue = 1a23 and formattedValue = 123
if (!currentInputChar.match(numRegex) && currentInputChar !== currentFormatChar) continue; //When we are striping out leading zeros maintain the new cursor position
//Case inputValue = 00023 and formattedValue = 23;
if (currentInputChar === '0' && currentFormatChar.match(numRegex) && currentFormatChar !== '0' && inputNumber.length !== formattedNumber.length) continue; //we are not using currentFormatChar because j can change here
while (currentInputChar !== formattedValue[j] && j < formattedValue.length) {
j++;
}
j++;
}
if (typeof format === 'string' && !stateValue) {
//set it to the maximum value so it goes after the last number
j = formattedValue.length;
} //correct caret position if its outside of editable area
j = this.correctCaretPosition(formattedValue, j);
return j;
}
/** caret specific methods ends **/
/** methods to remove formattting **/
}, {
key: "removePrefixAndSuffix",
value: function removePrefixAndSuffix(val) {
var _this$props3 = this.props,
format = _this$props3.format,
prefix = _this$props3.prefix,
suffix = _this$props3.suffix; //remove prefix and suffix
if (!format && val) {
var isNegative = val[0] === '-'; //remove negation sign
if (isNegative) val = val.substring(1, val.length); //remove prefix
val = prefix && val.indexOf(prefix) === 0 ? val.substring(prefix.length, val.length) : val; //remove suffix
var suffixLastIndex = val.lastIndexOf(suffix);
val = suffix && suffixLastIndex !== -1 && suffixLastIndex === val.length - suffix.length ? val.substring(0, suffixLastIndex) : val; //add negation sign back
if (isNegative) val = '-' + val;
}
return val;
}
}, {
key: "removePatternFormatting",
value: function removePatternFormatting(val) {
var format = this.props.format;
var formatArray = format.split('#').filter(function (str) {
return str !== '';
});
var start = 0;
var numStr = '';
for (var i = 0, ln = formatArray.length; i <= ln; i++) {
var part = formatArray[i] || ''; //if i is the last fragment take the index of end of the value
//For case like +1 (911) 911 91 91 having pattern +1 (###) ### ## ##
var index = i === ln ? val.length : val.indexOf(part, start);
/* in any case if we don't find the pattern part in the value assume the val as numeric string
This will be also in case if user has started typing, in any other case it will not be -1
unless wrong prop value is provided */
if (index === -1) {
numStr = val;
break;
} else {
numStr += val.substring(start, index);
start = index + part.length;
}
}
return (numStr.match(/\d/g) || []).join('');
}
}, {
key: "removeFormatting",
value: function removeFormatting(val) {
var _this$props4 = this.props,
format = _this$props4.format,
removeFormatting = _this$props4.removeFormatting;
if (!val) return val;
if (!format) {
val = this.removePrefixAndSuffix(val);
val = this.getFloatString(val);
} else if (typeof format === 'string') {
val = this.removePatternFormatting(val);
} else if (typeof removeFormatting === 'function') {
//condition need to be handled if format method is provide,
val = removeFormatting(val);
} else {
val = (val.match(/\d/g) || []).join('');
}
return val;
}
/** methods to remove formattting end **/
/*** format specific methods start ***/
/**
* Format when # based string is provided
* @param {string} numStr Numeric String
* @return {string} formatted Value
*/
}, {
key: "formatWithPattern",
value: function formatWithPattern(numStr) {
var format = this.props.format;
var hashCount = 0;
var formattedNumberAry = format.split('');
for (var i = 0, ln = format.length; i < ln; i++) {
if (format[i] === '#') {
formattedNumberAry[i] = numStr[hashCount] || this.getMaskAtIndex(hashCount);
hashCount += 1;
}
}
return formattedNumberAry.join('');
}
/**
* @param {string} numStr Numeric string/floatString] It always have decimalSeparator as .
* @return {string} formatted Value
*/
}, {
key: "formatAsNumber",
value: function formatAsNumber(numStr) {
var _this$props5 = this.props,
decimalScale = _this$props5.decimalScale,
fixedDecimalScale = _this$props5.fixedDecimalScale,
prefix = _this$props5.prefix,
suffix = _this$props5.suffix,
allowNegative = _this$props5.allowNegative;
var _this$getSeparators4 = this.getSeparators(),
thousandSeparator = _this$getSeparators4.thousandSeparator,
decimalSeparator = _this$getSeparators4.decimalSeparator;
var hasDecimalSeparator = numStr.indexOf('.') !== -1 || decimalScale && fixedDecimalScale;
var _splitDecimal = (0, _utils.splitDecimal)(numStr, allowNegative),
beforeDecimal = _splitDecimal.beforeDecimal,
afterDecimal = _splitDecimal.afterDecimal,
addNegation = _splitDecimal.addNegation; // eslint-disable-line prefer-const
//apply decimal precision if its defined
if (decimalScale !== undefined) afterDecimal = (0, _utils.limitToScale)(afterDecimal, decimalScale, fixedDecimalScale);
if (thousandSeparator) {
beforeDecimal = beforeDecimal.replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + thousandSeparator);
} //add prefix and suffix
if (prefix) beforeDecimal = prefix + beforeDecimal;
if (suffix) afterDecimal = afterDecimal + suffix; //restore negation sign
if (addNegation) beforeDecimal = '-' + beforeDecimal;
numStr = beforeDecimal + (hasDecimalSeparator && decimalSeparator || '') + afterDecimal;
return numStr;
}
}, {
key: "formatNumString",
value: function formatNumString() {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var _this$props6 = this.props,
format = _this$props6.format,
allowEmptyFormatting = _this$props6.allowEmptyFormatting;
var formattedValue = value;
if (value === '' && !allowEmptyFormatting) {
formattedValue = '';
} else if (value === '-' && !format) {
formattedValue = '-';
value = '';
} else if (typeof format === 'string') {
formattedValue = this.formatWithPattern(formattedValue);
} else if (typeof format === 'function') {
formattedValue = format(formattedValue);
} else {
formattedValue = this.formatAsNumber(formattedValue);
}
return formattedValue;
}
}, {
key: "formatValueProp",
value: function formatValueProp() {
var _this$props7 = this.props,
format = _this$props7.format,
decimalScale = _this$props7.decimalScale,
fixedDecimalScale = _this$props7.fixedDecimalScale,
allowEmptyFormatting = _this$props7.allowEmptyFormatting;
var _this$props8 = this.props,
value = _this$props8.value,
isNumericString = _this$props8.isNumericString;
var isNonNumericFalsy = !value && value !== 0;
if (isNonNumericFalsy && allowEmptyFormatting) {
value = '';
} // if value is not defined return empty string
if (isNonNumericFalsy && !allowEmptyFormatting) return '';
if (typeof value === 'number') {
value = value.toString();
isNumericString = true;
} //round the number based on decimalScale
//format only if non formatted value is provided
if (isNumericString && !format && typeof decimalScale === 'number') {
value = (0, _utils.roundToPrecision)(value, decimalScale, fixedDecimalScale);
}
var formattedValue = isNumericString ? this.formatNumString(value) : this.formatInput(value);
return formattedValue;
}
}, {
key: "formatNegation",
value: function formatNegation() {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var allowNegative = this.props.allowNegative;
var negationRegex = new RegExp('(-)');
var doubleNegationRegex = new RegExp('(-)(.)*(-)'); // Check number has '-' value
var hasNegation = negationRegex.test(value); // Check number has 2 or more '-' values
var removeNegation = doubleNegationRegex.test(value); //remove negation
value = value.replace(/-/g, '');
if (hasNegation && !removeNegation && allowNegative) {
value = '-' + value;
}
return value;
}
}, {
key: "formatInput",
value: function formatInput() {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var format = this.props.format; //format negation only if we are formatting as number
if (!format) {
value = this.formatNegation(value);
} //remove formatting from number
value = this.removeFormatting(value);
return this.formatNumString(value);
}
/*** format specific methods end ***/
}, {
key: "isCharacterAFormat",
value: function isCharacterAFormat(caretPos, value) {
var _this$props9 = this.props,
format = _this$props9.format,
prefix = _this$props9.prefix,
suffix = _this$props9.suffix,
decimalScale = _this$props9.decimalScale,
fixedDecimalScale = _this$props9.fixedDecimalScale;
var _this$getSeparators5 = this.getSeparators(),
decimalSeparator = _this$getSeparators5.decimalSeparator; //check within format pattern
if (typeof format === 'string' && format[caretPos] !== '#') return true; //check in number format
if (!format && (caretPos < prefix.length || caretPos >= value.length - suffix.length || decimalScale && fixedDecimalScale && value[caretPos] === decimalSeparator)) {
return true;
}
return false;
}
}, {
key: "checkIfFormatGotDeleted",
value: function checkIfFormatGotDeleted(start, end, value) {
for (var i = start; i < end; i++) {
if (this.isCharacterAFormat(i, value)) return true;
}
return false;
}
/**
* This will check if any formatting got removed by the delete or backspace and reset the value
* It will also work as fallback if android chome keyDown handler does not work
**/
}, {
key: "correctInputValue",
value: function correctInputValue(caretPos, lastValue, value) {
var _this$props10 = this.props,
format = _this$props10.format,
decimalSeparator = _this$props10.decimalSeparator,
allowNegative = _this$props10.allowNegative,
prefix = _this$props10.prefix,
suffix = _this$props10.suffix;
var lastNumStr = this.state.numAsString || '';
var _this$selectionBefore = this.selectionBeforeInput,
selectionStart = _this$selectionBefore.selectionStart,
selectionEnd = _this$selectionBefore.selectionEnd;
var _findChangedIndex = (0, _utils.findChangedIndex)(lastValue, value),
start = _findChangedIndex.start,
end = _findChangedIndex.end;
/* don't do anyhting if something got added,
or if value is empty string (when whole input is cleared)
or whole input is replace with a number
*/
var leftBound = !!format ? 0 : prefix.length;
var rightBound = lastValue.length - (!!format ? 0 : suffix.length);
if (value.length > lastValue.length || !value.length || start === end || selectionStart === 0 && selectionEnd === lastValue.length || selectionStart === leftBound && selectionEnd === rightBound) {
return value;
} //if format got deleted reset the value to last value
if (this.checkIfFormatGotDeleted(start, end, lastValue)) {
value = lastValue;
} //for numbers check if beforeDecimal got deleted and there is nothing after decimal,
//clear all numbers in such case while keeping the - sign
if (!format) {
var numericString = this.removeFormatting(value);
var _splitDecimal2 = (0, _utils.splitDecimal)(numericString, allowNegative),
beforeDecimal = _splitDecimal2.beforeDecimal,
afterDecimal = _splitDecimal2.afterDecimal,
addNegation = _splitDecimal2.addNegation; // eslint-disable-line prefer-const
//clear only if something got deleted
var isBeforeDecimalPoint = caretPos < value.indexOf(decimalSeparator) + 1;
if (numericString.length < lastNumStr.length && isBeforeDecimalPoint && beforeDecimal === '' && !parseFloat(afterDecimal)) {
return addNegation ? '-' : '';
}
}
return value;
}
}, {
key: "onChange",
value: function onChange(e) {
e.persist();
var el = e.target;
var inputValue = el.value;
var state = this.state,
props = this.props;
var isAllowed = props.isAllowed;
var lastValue = state.value || '';
/*Max of selectionStart and selectionEnd is taken for the patch of pixel and other mobile device caret bug*/
var currentCaretPosition = Math.max(el.selectionStart, el.selectionEnd);
inputValue = this.correctInputValue(currentCaretPosition, lastValue, inputValue);
var formattedValue = this.formatInput(inputValue) || '';
var numAsString = this.removeFormatting(formattedValue);
var valueObj = this.getValueObject(formattedValue, numAsString);
if (!isAllowed(valueObj)) {
formattedValue = lastValue;
} //set the value imperatively, this is required for IE fix
el.value = formattedValue; //get the caret position
var caretPos = this.getCaretPosition(inputValue, formattedValue, currentCaretPosition); //set caret position
this.setPatchedCaretPosition(el, caretPos, formattedValue); //change the state
if (formattedValue !== lastValue) {
this.setState({
value: formattedValue,
numAsString: numAsString
}, function () {
props.onValueChange(valueObj, e);
props.onChange(e);
});
} else {
props.onChange(e);
}
}
}, {
key: "onBlur",
value: function onBlur(e) {
var _this2 = this;
var props = this.props,
state = this.state;
var format = props.format,
onBlur = props.onBlur;
var numAsString = state.numAsString;
var lastValue = state.value;
if (!format) {
numAsString = (0, _utils.fixLeadingZero)(numAsString);
var formattedValue = this.formatNumString(numAsString); //change the state
if (formattedValue !== lastValue) {
// the event needs to be persisted because its properties can be accessed in an asynchronous way
e.persist();
this.setState({
value: formattedValue,
numAsString: numAsString
}, function () {
var valueObj = _this2.getValueObject(formattedValue, numAsString);
props.onValueChange(valueObj, e);
onBlur(e);
});
return;
}
}
onBlur(e);
}
}, {
key: "onKeyDown",
value: function onKeyDown(e) {
var _this3 = this;
var el = e.target;
var key = e.key;
var selectionStart = el.selectionStart,
selectionEnd = el.selectionEnd,
_el$value = el.value,
value = _el$value === void 0 ? '' : _el$value;
var expectedCaretPosition;
var _this$props11 = this.props,
decimalScale = _this$props11.decimalScale,
fixedDecimalScale = _this$props11.fixedDecimalScale,
prefix = _this$props11.prefix,
suffix = _this$props11.suffix,
format = _this$props11.format,
onKeyDown = _this$props11.onKeyDown,
onValueChange = _this$props11.onValueChange;
var ignoreDecimalSeparator = decimalScale !== undefined && fixedDecimalScale;
var numRegex = this.getNumberRegex(false, ignoreDecimalSeparator);
var negativeRegex = new RegExp('-');
var isPatternFormat = typeof format === 'string';
this.selectionBeforeInput = {
selectionStart: selectionStart,
selectionEnd: selectionEnd //Handle backspace and delete against non numerical/decimal characters or arrow keys
};
if (key === 'ArrowLeft' || key === 'Backspace') {
expectedCaretPosition = selectionStart - 1;
} else if (key === 'ArrowRight') {
expectedCaretPosition = selectionStart + 1;
} else if (key === 'Delete') {
expectedCaretPosition = selectionStart;
} //if expectedCaretPosition is not set it means we don't want to Handle keyDown
//also if multiple characters are selected don't handle
if (expectedCaretPosition === undefined || selectionStart !== selectionEnd) {
onKeyDown(e);
return;
}
var newCaretPosition = expectedCaretPosition;
var leftBound = isPatternFormat ? format.indexOf('#') : prefix.length;
var rightBound = isPatternFormat ? format.lastIndexOf('#') + 1 : value.length - suffix.length;
if (key === 'ArrowLeft' || key === 'ArrowRight') {
var direction = key === 'ArrowLeft' ? 'left' : 'right';
newCaretPosition = this.correctCaretPosition(value, expectedCaretPosition, direction);
} else if (key === 'Delete' && !numRegex.test(value[expectedCaretPosition]) && !negativeRegex.test(value[expectedCaretPosition])) {
while (!numRegex.test(value[newCaretPosition]) && newCaretPosition < rightBound) {
newCaretPosition++;
}
} else if (key === 'Backspace' && !numRegex.test(value[expectedCaretPosition])) {
/* NOTE: This is special case when backspace is pressed on a
negative value while the cursor position is after prefix. We can't handle it on onChange because
we will not have any information of keyPress
*/
if (selectionStart <= leftBound + 1 && value[0] === '-' && typeof format === 'undefined') {
var newValue = value.substring(1);
var numAsString = this.removeFormatting(newValue);
var valueObj = this.getValueObject(newValue, numAsString); //persist event before performing async task
e.persist();
this.setState({
value: newValue,
numAsString: numAsString
}, function () {
_this3.setPatchedCaretPosition(el, newCaretPosition, newValue);
onValueChange(valueObj, e);
});
} else if (!negativeRegex.test(value[expectedCaretPosition])) {
while (!numRegex.test(value[newCaretPosition - 1]) && newCaretPosition > leftBound) {
newCaretPosition--;
}
newCaretPosition = this.correctCaretPosition(value, newCaretPosition, 'left');
}
}
if (newCaretPosition !== expectedCaretPosition || expectedCaretPosition < leftBound || expectedCaretPosition > rightBound) {
e.preventDefault();
this.setPatchedCaretPosition(el, newCaretPosition, value);
}
/* NOTE: this is just required for unit test as we need to get the newCaretPosition,
Remove this when you find different solution */
if (e.isUnitTestRun) {
this.setPatchedCaretPosition(el, newCaretPosition, value);
}
this.props.onKeyDown(e);
}
/** required to handle the caret position when click anywhere within the input **/
}, {
key: "onMouseUp",
value: function onMouseUp(e) {
var el = e.target;
/**
* NOTE: we have to give default value for value as in case when custom input is provided
* value can come as undefined when nothing is provided on value prop.
*/
var selectionStart = el.selectionStart,
selectionEnd = el.selectionEnd,
_el$value2 = el.value,
value = _el$value2 === void 0 ? '' : _el$value2;
if (selectionStart === selectionEnd) {
var caretPosition = this.correctCaretPosition(value, selectionStart);
if (caretPosition !== selectionStart) {
this.setPatchedCaretPosition(el, caretPosition, value);
}
}
this.props.onMouseUp(e);
}
}, {
key: "onFocus",
value: function onFocus(e) {
var _this4 = this;
// Workaround Chrome and Safari bug https://bugs.chromium.org/p/chromium/issues/detail?id=779328
// (onFocus event target selectionStart is always 0 before setTimeout)
e.persist();
setTimeout(function () {
var el = e.target;
var selectionStart = el.selectionStart,
selectionEnd = el.selectionEnd,
_el$value3 = el.value,
value = _el$value3 === void 0 ? '' : _el$value3;
var caretPosition = _this4.correctCaretPosition(value, selectionStart); //setPatchedCaretPosition only when everything is not selected on focus (while tabbing into the field)
if (caretPosition !== selectionStart && !(selectionStart === 0 && selectionEnd === value.length)) {
_this4.setPatchedCaretPosition(el, caretPosition, value);
}
_this4.props.onFocus(e);
}, 0);
}
}, {
key: "render",
value: function render() {
var _this$props12 = this.props,
type = _this$props12.type,
displayType = _this$props12.displayType,
customInput = _this$props12.customInput,
renderText = _this$props12.renderText,
getInputRef = _this$props12.getInputRef;
var value = this.state.value;
var otherProps = (0, _utils.omit)(this.props, propTypes);
var inputProps = _extends({}, otherProps, {
type: type,
value: value,
onChange: this.onChange,
onKeyDown: this.onKeyDown,
onMouseUp: this.onMouseUp,
onFocus: this.onFocus,
onBlur: this.onBlur
});
if (displayType === 'text') {
return renderText ? renderText(value) || null : _react.default.createElement("span", _extends({}, otherProps, {
ref: getInputRef
}), value);
} else if (customInput) {
var CustomInput = customInput;
return _react.default.createElement(CustomInput, inputProps);
}
return _react.default.createElement("input", _extends({}, inputProps, {
ref: getInputRef
}));
}
}]);
return NumberFormat;
}(_react.default.Component);
NumberFormat.propTypes = propTypes;
NumberFormat.defaultProps = defaultProps;
var _default = NumberFormat;
exports.default = _default;
module.exports = exports.default;
webpack://frontend-tpt/../../node_modules/react-number-format/lib/utils.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.noop = noop;
exports.returnTrue = returnTrue;
exports.charIsNumber = charIsNumber;
exports.escapeRegExp = escapeRegExp;
exports.splitDecimal = splitDecimal;
exports.fixLeadingZero = fixLeadingZero;
exports.limitToScale = limitToScale;
exports.roundToPrecision = roundToPrecision;
exports.omit = omit;
exports.setCaretPosition = setCaretPosition;
exports.findChangedIndex = findChangedIndex;
exports.clamp = clamp;
// basic noop function
function noop() {}
function returnTrue() {
return true;
}
function charIsNumber(char) {
return !!(char || '').match(/\d/);
}
function escapeRegExp(str) {
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
} //spilt a float number into different parts beforeDecimal, afterDecimal, and negation
function splitDecimal(numStr) {
var allowNegative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var hasNagation = numStr[0] === '-';
var addNegation = hasNagation && allowNegative;
numStr = numStr.replace('-', '');
var parts = numStr.split('.');
var beforeDecimal = parts[0];
var afterDecimal = parts[1] || '';
return {
beforeDecimal: beforeDecimal,
afterDecimal: afterDecimal,
hasNagation: hasNagation,
addNegation: addNegation
};
}
function fixLeadingZero(numStr) {
if (!numStr) return numStr;
var isNegative = numStr[0] === '-';
if (isNegative) numStr = numStr.substring(1, numStr.length);
var parts = numStr.split('.');
var beforeDecimal = parts[0].replace(/^0+/, '') || '0';
var afterDecimal = parts[1] || '';
return "".concat(isNegative ? '-' : '').concat(beforeDecimal).concat(afterDecimal ? ".".concat(afterDecimal) : '');
}
/**
* limit decimal numbers to given scale
* Not used .fixedTo because that will break with big numbers
*/
function limitToScale(numStr, scale, fixedDecimalScale) {
var str = '';
var filler = fixedDecimalScale ? '0' : '';
for (var i = 0; i <= scale - 1; i++) {
str += numStr[i] || filler;
}
return str;
}
/**
* This method is required to round prop value to given scale.
* Not used .round or .fixedTo because that will break with big numbers
*/
function roundToPrecision(numStr, scale, fixedDecimalScale) {
//if number is empty don't do anything return empty string
if (['', '-'].indexOf(numStr) !== -1) return numStr;
var shoudHaveDecimalSeparator = numStr.indexOf('.') !== -1 && scale;
var _splitDecimal = splitDecimal(numStr),
beforeDecimal = _splitDecimal.beforeDecimal,
afterDecimal = _splitDecimal.afterDecimal,
hasNagation = _splitDecimal.hasNagation;
var roundedDecimalParts = parseFloat("0.".concat(afterDecimal || '0')).toFixed(scale).split('.');
var intPart = beforeDecimal.split('').reverse().reduce(function (roundedStr, current, idx) {
if (roundedStr.length > idx) {
return (Number(roundedStr[0]) + Number(current)).toString() + roundedStr.substring(1, roundedStr.length);
}
return current + roundedStr;
}, roundedDecimalParts[0]);
var decimalPart = limitToScale(roundedDecimalParts[1] || '', Math.min(scale, afterDecimal.length), fixedDecimalScale);
var negation = hasNagation ? '-' : '';
var decimalSeparator = shoudHaveDecimalSeparator ? '.' : '';
return "".concat(negation).concat(intPart).concat(decimalSeparator).concat(decimalPart);
}
function omit(obj, keyMaps) {
var filteredObj = {};
Object.keys(obj).forEach(function (key) {
if (!keyMaps[key]) filteredObj[key] = obj[key];
});
return filteredObj;
}
/** set the caret positon in an input field **/
function setCaretPosition(el, caretPos) {
el.value = el.value; // ^ this is used to not only get "focus", but
// to make sure we don't have it everything -selected-
// (it causes an issue in chrome, and having it doesn't hurt any other browser)
if (el !== null) {
if (el.createTextRange) {
var range = el.createTextRange();
range.move('character', caretPos);
range.select();
return true;
} // (el.selectionStart === 0 added for Firefox bug)
if (el.selectionStart || el.selectionStart === 0) {
el.focus();
el.setSelectionRange(caretPos, caretPos);
return true;
} // fail city, fortunately this never happens (as far as I've tested) :)
el.focus();
return false;
}
}
/**
Given previous value and newValue it returns the index
start - end to which values have changed.
This function makes assumption about only consecutive
characters are changed which is correct assumption for caret input.
*/
function findChangedIndex(prevValue, newValue) {
var i = 0,
j = 0;
var prevLength = prevValue.length;
var newLength = newValue.length;
while (prevValue[i] === newValue[i] && i < prevLength) {
i++;
} //check what has been changed from last
while (prevValue[prevLength - 1 - j] === newValue[newLength - 1 - j] && newLength - j > i && prevLength - j > i) {
j++;
}
return {
start: i,
end: prevLength - j
};
}
/*
Returns a number whose value is limited to the given range
*/
function clamp(num, min, max) {
return Math.min(Math.max(num, min), max);
}
webpack://frontend-tpt/../../node_modules/react-redux/node_modules/react-is/cjs/react-is.production.min.js
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
webpack://frontend-tpt/../../node_modules/react-redux/node_modules/react-is/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-is.production.min.js');
} else {
module.exports = require('./cjs/react-is.development.js');
}
webpack://frontend-tpt/../../node_modules/react/cjs/react-jsx-runtime.production.min.js
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var f=require("react"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;
webpack://frontend-tpt/../../node_modules/react/cjs/react.production.min.js
/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){if(null===a||"object"!==typeof a)return null;a=z&&a[z]||a["@@iterator"];return"function"===typeof a?a:null}
var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};
E.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;
H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};
function M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}
function N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return"object"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g;function Q(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
function R(a,b,e,d,c){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=""===d?"."+Q(h,0):d,I(c)?(e="",null!=a&&(e=a.replace(P,"$&/")+"/"),R(c,b,e,"",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;h=0;d=""===d?".":d+":";if(I(a))for(var g=0;g<a.length;g++){k=
a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if("object"===k)throw b=String(a),Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}
function S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,"","",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}
var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};function X(){throw Error("act(...) is not supported in production builds of React.");}
exports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};exports.Component=E;exports.Fragment=p;exports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;exports.act=X;
exports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);
for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};
exports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=X;exports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};
exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};exports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};
exports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};exports.useTransition=function(){return U.current.useTransition()};exports.version="18.3.1";
webpack://frontend-tpt/../../node_modules/react/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react.production.min.js');
} else {
module.exports = require('./cjs/react.development.js');
}
webpack://frontend-tpt/../../node_modules/react/jsx-runtime.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-jsx-runtime.production.min.js');
} else {
module.exports = require('./cjs/react-jsx-runtime.development.js');
}
webpack://frontend-tpt/../../node_modules/rehackt/index.js
"use strict";
module.exports = require("react");
webpack://frontend-tpt/../../node_modules/scheduler/cjs/scheduler.production.min.js
/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,w=e>>>1;d<w;){var m=2*(d+1)-1,C=a[m],n=m+1,x=a[n];if(0>g(C,c))n<e&&0>g(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(n<e&&0>g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}
function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null;
"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}
function J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;
function M(){return exports.unstable_now()-Q<P?!1:!0}function R(){if(null!==O){var a=exports.unstable_now();Q=a;var b=!0;try{b=O(!0,a)}finally{b?S():(N=!1,O=null)}}else N=!1}var S;if("function"===typeof F)S=function(){F(R)};else if("undefined"!==typeof MessageChannel){var T=new MessageChannel,U=T.port2;T.port1.onmessage=R;S=function(){U.postMessage(null)}}else S=function(){D(R,0)};function I(a){O=a;N||(N=!0,S())}function K(a,b){L=D(function(){a(exports.unstable_now())},b)}
exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){A||z||(A=!0,I(J))};
exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<a?Math.floor(1E3/a):5};exports.unstable_getCurrentPriorityLevel=function(){return y};exports.unstable_getFirstCallbackNode=function(){return h(r)};exports.unstable_next=function(a){switch(y){case 1:case 2:case 3:var b=3;break;default:b=y}var c=y;y=b;try{return a()}finally{y=c}};exports.unstable_pauseExecution=function(){};
exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=y;y=a;try{return b()}finally{y=c}};
exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=c+e;a={id:u++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};
exports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};
webpack://frontend-tpt/../../node_modules/scheduler/index.js
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/scheduler.production.min.js');
} else {
module.exports = require('./cjs/scheduler.development.js');
}
webpack://frontend-tpt/../../node_modules/shallowequal/index.js
//
module.exports = function shallowEqual(objA, objB, compare, compareContext) {
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
if (ret !== void 0) {
return !!ret;
}
if (objA === objB) {
return true;
}
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
// Test for A's keys different from B.
for (var idx = 0; idx < keysA.length; idx++) {
var key = keysA[idx];
if (!bHasOwnProperty(key)) {
return false;
}
var valueA = objA[key];
var valueB = objB[key];
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
if (ret === false || (ret === void 0 && valueA !== valueB)) {
return false;
}
}
return true;
};
webpack://frontend-tpt/../../node_modules/split-on-first/index.js
'use strict';
module.exports = (string, separator) => {
if (!(typeof string === 'string' && typeof separator === 'string')) {
throw new TypeError('Expected the arguments to be of type `string`');
}
if (separator === '') {
return [string];
}
const separatorIndex = string.indexOf(separator);
if (separatorIndex === -1) {
return [string];
}
return [
string.slice(0, separatorIndex),
string.slice(separatorIndex + separator.length)
];
};
webpack://frontend-tpt/../../node_modules/strict-uri-encode/index.js
'use strict';
module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
webpack://frontend-tpt/../../node_modules/styleq/dist/styleq.js
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.styleq = void 0;
var cache = new WeakMap();
var compiledKey = '$$css';
function createStyleq(options) {
var disableCache;
var disableMix;
var transform;
if (options != null) {
disableCache = options.disableCache === true;
disableMix = options.disableMix === true;
transform = options.transform;
}
return function styleq() {
// Keep track of property commits to the className
var definedProperties = []; // The className and inline style to build up
var className = '';
var inlineStyle = null; // The current position in the cache graph
var nextCache = disableCache ? null : cache; // This way of creating an array from arguments is fastest
var styles = new Array(arguments.length);
for (var i = 0; i < arguments.length; i++) {
styles[i] = arguments[i];
} // Iterate over styles from last to first
while (styles.length > 0) {
var possibleStyle = styles.pop(); // Skip empty items
if (possibleStyle == null || possibleStyle === false) {
continue;
} // Push nested styles back onto the stack to be processed
if (Array.isArray(possibleStyle)) {
for (var _i = 0; _i < possibleStyle.length; _i++) {
styles.push(possibleStyle[_i]);
}
continue;
} // Process an individual style object
var style = transform != null ? transform(possibleStyle) : possibleStyle;
if (style.$$css) {
// Build up the class names defined by this object
var classNameChunk = ''; // Check the cache to see if we've already done this work
if (nextCache != null && nextCache.has(style)) {
// Cache: read
var cacheEntry = nextCache.get(style);
if (cacheEntry != null) {
classNameChunk = cacheEntry[0]; // $FlowIgnore
definedProperties.push.apply(definedProperties, cacheEntry[1]);
nextCache = cacheEntry[2];
}
} // Update the chunks with data from this object
else {
// The properties defined by this object
var definedPropertiesChunk = [];
for (var prop in style) {
var value = style[prop];
if (prop === compiledKey) continue; // Each property value is used as an HTML class name
// { 'debug.string': 'debug.string', opacity: 's-jskmnoqp' }
if (typeof value === 'string' || value === null) {
// Only add to chunks if this property hasn't already been seen
if (!definedProperties.includes(prop)) {
definedProperties.push(prop);
if (nextCache != null) {
definedPropertiesChunk.push(prop);
}
if (typeof value === 'string') {
classNameChunk += classNameChunk ? ' ' + value : value;
}
}
} // If we encounter a value that isn't a string or `null`
else {
console.error("styleq: ".concat(prop, " typeof ").concat(String(value), " is not \"string\" or \"null\"."));
}
} // Cache: write
if (nextCache != null) {
// Create the next WeakMap for this sequence of styles
var weakMap = new WeakMap();
nextCache.set(style, [classNameChunk, definedPropertiesChunk, weakMap]);
nextCache = weakMap;
}
} // Order of classes in chunks matches property-iteration order of style
// object. Order of chunks matches passed order of styles from first to
// last (which we iterate over in reverse).
if (classNameChunk) {
className = className ? classNameChunk + ' ' + className : classNameChunk;
}
} // ----- DYNAMIC: Process inline style object -----
else {
if (disableMix) {
if (inlineStyle == null) {
inlineStyle = {};
}
inlineStyle = Object.assign({}, style, inlineStyle);
} else {
var subStyle = null;
for (var _prop in style) {
var _value = style[_prop];
if (_value !== undefined) {
if (!definedProperties.includes(_prop)) {
if (_value != null) {
if (inlineStyle == null) {
inlineStyle = {};
}
if (subStyle == null) {
subStyle = {};
}
subStyle[_prop] = _value;
}
definedProperties.push(_prop); // Cache is unnecessary overhead if results can't be reused.
nextCache = null;
}
}
}
if (subStyle != null) {
inlineStyle = Object.assign(subStyle, inlineStyle);
}
}
}
}
var styleProps = [className, inlineStyle];
return styleProps;
};
}
var styleq = createStyleq();
exports.styleq = styleq;
styleq.factory = createStyleq;
webpack://frontend-tpt/../../node_modules/styleq/dist/transform-localize-style.js
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.localizeStyle = localizeStyle;
var cache = new WeakMap();
var markerProp = '$$css$localize';
/**
* The compiler polyfills logical properties and values, generating a class
* name for both writing directions. The style objects are annotated by
* the compiler as needing this runtime transform. The results are memoized.
*
* { '$$css$localize': true, float: [ 'float-left', 'float-right' ] }
* => { float: 'float-left' }
*/
function compileStyle(style, isRTL) {
// Create a new compiled style for styleq
var compiledStyle = {};
for (var prop in style) {
if (prop !== markerProp) {
var value = style[prop];
if (Array.isArray(value)) {
compiledStyle[prop] = isRTL ? value[1] : value[0];
} else {
compiledStyle[prop] = value;
}
}
}
return compiledStyle;
}
function localizeStyle(style, isRTL) {
if (style[markerProp] != null) {
var compiledStyleIndex = isRTL ? 1 : 0; // Check the cache in case we've already seen this object
if (cache.has(style)) {
var _cachedStyles = cache.get(style);
var _compiledStyle = _cachedStyles[compiledStyleIndex];
if (_compiledStyle == null) {
// Update the missing cache entry
_compiledStyle = compileStyle(style, isRTL);
_cachedStyles[compiledStyleIndex] = _compiledStyle;
cache.set(style, _cachedStyles);
}
return _compiledStyle;
} // Create a new compiled style for styleq
var compiledStyle = compileStyle(style, isRTL);
var cachedStyles = new Array(2);
cachedStyles[compiledStyleIndex] = compiledStyle;
cache.set(style, cachedStyles);
return compiledStyle;
}
return style;
}
webpack://frontend-tpt/../../node_modules/styleq/transform-localize-style.js
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
module.exports = require('./dist/transform-localize-style');
webpack://frontend-tpt/../../node_modules/supports-color/browser.js
'use strict';
module.exports = {
stdout: false,
stderr: false
};
webpack://frontend-tpt/../../node_modules/ssr-window/ssr-window.esm.js
/**
* SSR Window 3.0.0
* Better handling for window object in SSR environment
* https://github.com/nolimits4web/ssr-window
*
* Copyright 2020, Vladimir Kharlampidi
*
* Licensed under MIT
*
* Released on: November 9, 2020
*/
/* eslint-disable no-param-reassign */
function isObject(obj) {
return (obj !== null &&
typeof obj === 'object' &&
'constructor' in obj &&
obj.constructor === Object);
}
function extend(target, src) {
if (target === void 0) { target = {}; }
if (src === void 0) { src = {}; }
Object.keys(src).forEach(function (key) {
if (typeof target[key] === 'undefined')
target[key] = src[key];
else if (isObject(src[key]) &&
isObject(target[key]) &&
Object.keys(src[key]).length > 0) {
extend(target[key], src[key]);
}
});
}
var ssrDocument = {
body: {},
addEventListener: function () { },
removeEventListener: function () { },
activeElement: {
blur: function () { },
nodeName: '',
},
querySelector: function () {
return null;
},
querySelectorAll: function () {
return [];
},
getElementById: function () {
return null;
},
createEvent: function () {
return {
initEvent: function () { },
};
},
createElement: function () {
return {
children: [],
childNodes: [],
style: {},
setAttribute: function () { },
getElementsByTagName: function () {
return [];
},
};
},
createElementNS: function () {
return {};
},
importNode: function () {
return null;
},
location: {
hash: '',
host: '',
hostname: '',
href: '',
origin: '',
pathname: '',
protocol: '',
search: '',
},
};
function getDocument() {
var doc = typeof document !== 'undefined' ? document : {};
extend(doc, ssrDocument);
return doc;
}
var ssrWindow = {
document: ssrDocument,
navigator: {
userAgent: '',
},
location: {
hash: '',
host: '',
hostname: '',
href: '',
origin: '',
pathname: '',
protocol: '',
search: '',
},
history: {
replaceState: function () { },
pushState: function () { },
go: function () { },
back: function () { },
},
CustomEvent: function CustomEvent() {
return this;
},
addEventListener: function () { },
removeEventListener: function () { },
getComputedStyle: function () {
return {
getPropertyValue: function () {
return '';
},
};
},
Image: function () { },
Date: function () { },
screen: {},
setTimeout: function () { },
clearTimeout: function () { },
matchMedia: function () {
return {};
},
requestAnimationFrame: function (callback) {
if (typeof setTimeout === 'undefined') {
callback();
return null;
}
return setTimeout(callback, 0);
},
cancelAnimationFrame: function (id) {
if (typeof setTimeout === 'undefined') {
return;
}
clearTimeout(id);
},
};
function getWindow() {
var win = typeof window !== 'undefined' ? window : {};
extend(win, ssrWindow);
return win;
}
export { extend, getDocument, getWindow, ssrDocument, ssrWindow };
webpack://frontend-tpt/../../node_modules/dom7/dom7.esm.js
/**
* Dom7 3.0.0
* Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API
* https://framework7.io/docs/dom7.html
*
* Copyright 2020, Vladimir Kharlampidi
*
* Licensed under MIT
*
* Released on: November 9, 2020
*/
import { getWindow, getDocument } from 'ssr-window';
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _construct(Parent, args, Class) {
if (_isNativeReflectConstruct()) {
_construct = Reflect.construct;
} else {
_construct = function _construct(Parent, args, Class) {
var a = [null];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class) _setPrototypeOf(instance, Class.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}
function _isNativeFunction(fn) {
return Function.toString.call(fn).indexOf("[native code]") !== -1;
}
function _wrapNativeSuper(Class) {
var _cache = typeof Map === "function" ? new Map() : undefined;
_wrapNativeSuper = function _wrapNativeSuper(Class) {
if (Class === null || !_isNativeFunction(Class)) return Class;
if (typeof Class !== "function") {
throw new TypeError("Super expression must either be null or a function");
}
if (typeof _cache !== "undefined") {
if (_cache.has(Class)) return _cache.get(Class);
_cache.set(Class, Wrapper);
}
function Wrapper() {
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
}
Wrapper.prototype = Object.create(Class.prototype, {
constructor: {
value: Wrapper,
enumerable: false,
writable: true,
configurable: true
}
});
return _setPrototypeOf(Wrapper, Class);
};
return _wrapNativeSuper(Class);
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
/* eslint-disable no-proto */
function makeReactive(obj) {
var proto = obj.__proto__;
Object.defineProperty(obj, '__proto__', {
get: function get() {
return proto;
},
set: function set(value) {
proto.__proto__ = value;
}
});
}
var Dom7 = /*#__PURE__*/function (_Array) {
_inheritsLoose(Dom7, _Array);
function Dom7(items) {
var _this;
_this = _Array.call.apply(_Array, [this].concat(items)) || this;
makeReactive(_assertThisInitialized(_this));
return _this;
}
return Dom7;
}( /*#__PURE__*/_wrapNativeSuper(Array));
function arrayFlat(arr) {
if (arr === void 0) {
arr = [];
}
var res = [];
arr.forEach(function (el) {
if (Array.isArray(el)) {
res.push.apply(res, arrayFlat(el));
} else {
res.push(el);
}
});
return res;
}
function arrayFilter(arr, callback) {
return Array.prototype.filter.call(arr, callback);
}
function arrayUnique(arr) {
var uniqueArray = [];
for (var i = 0; i < arr.length; i += 1) {
if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]);
}
return uniqueArray;
}
function toCamelCase(string) {
return string.toLowerCase().replace(/-(.)/g, function (match, group) {
return group.toUpperCase();
});
}
function qsa(selector, context) {
if (typeof selector !== 'string') {
return [selector];
}
var a = [];
var res = context.querySelectorAll(selector);
for (var i = 0; i < res.length; i += 1) {
a.push(res[i]);
}
return a;
}
function $(selector, context) {
var window = getWindow();
var document = getDocument();
var arr = [];
if (!context && selector instanceof Dom7) {
return selector;
}
if (!selector) {
return new Dom7(arr);
}
if (typeof selector === 'string') {
var html = selector.trim();
if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {
var toCreate = 'div';
if (html.indexOf('<li') === 0) toCreate = 'ul';
if (html.indexOf('<tr') === 0) toCreate = 'tbody';
if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr';
if (html.indexOf('<tbody') === 0) toCreate = 'table';
if (html.indexOf('<option') === 0) toCreate = 'select';
var tempParent = document.createElement(toCreate);
tempParent.innerHTML = html;
for (var i = 0; i < tempParent.childNodes.length; i += 1) {
arr.push(tempParent.childNodes[i]);
}
} else {
arr = qsa(selector.trim(), context || document);
} // arr = qsa(selector, document);
} else if (selector.nodeType || selector === window || selector === document) {
arr.push(selector);
} else if (Array.isArray(selector)) {
if (selector instanceof Dom7) return selector;
arr = selector;
}
return new Dom7(arrayUnique(arr));
}
$.fn = Dom7.prototype;
function addClass() {
for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {
classes[_key] = arguments[_key];
}
var classNames = arrayFlat(classes.map(function (c) {
return c.split(' ');
}));
this.forEach(function (el) {
var _el$classList;
(_el$classList = el.classList).add.apply(_el$classList, classNames);
});
return this;
}
function removeClass() {
for (var _len2 = arguments.length, classes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
classes[_key2] = arguments[_key2];
}
var classNames = arrayFlat(classes.map(function (c) {
return c.split(' ');
}));
this.forEach(function (el) {
var _el$classList2;
(_el$classList2 = el.classList).remove.apply(_el$classList2, classNames);
});
return this;
}
function toggleClass() {
for (var _len3 = arguments.length, classes = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
classes[_key3] = arguments[_key3];
}
var classNames = arrayFlat(classes.map(function (c) {
return c.split(' ');
}));
this.forEach(function (el) {
classNames.forEach(function (className) {
el.classList.toggle(className);
});
});
}
function hasClass() {
for (var _len4 = arguments.length, classes = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
classes[_key4] = arguments[_key4];
}
var classNames = arrayFlat(classes.map(function (c) {
return c.split(' ');
}));
return arrayFilter(this, function (el) {
return classNames.filter(function (className) {
return el.classList.contains(className);
}).length > 0;
}).length > 0;
}
function attr(attrs, value) {
if (arguments.length === 1 && typeof attrs === 'string') {
// Get attr
if (this[0]) return this[0].getAttribute(attrs);
return undefined;
} // Set attrs
for (var i = 0; i < this.length; i += 1) {
if (arguments.length === 2) {
// String
this[i].setAttribute(attrs, value);
} else {
// Object
for (var attrName in attrs) {
this[i][attrName] = attrs[attrName];
this[i].setAttribute(attrName, attrs[attrName]);
}
}
}
return this;
}
function removeAttr(attr) {
for (var i = 0; i < this.length; i += 1) {
this[i].removeAttribute(attr);
}
return this;
}
function prop(props, value) {
if (arguments.length === 1 && typeof props === 'string') {
// Get prop
if (this[0]) return this[0][props];
} else {
// Set props
for (var i = 0; i < this.length; i += 1) {
if (arguments.length === 2) {
// String
this[i][props] = value;
} else {
// Object
for (var propName in props) {
this[i][propName] = props[propName];
}
}
}
return this;
}
return this;
}
function data(key, value) {
var el;
if (typeof value === 'undefined') {
el = this[0];
if (!el) return undefined; // Get value
if (el.dom7ElementDataStorage && key in el.dom7ElementDataStorage) {
return el.dom7ElementDataStorage[key];
}
var dataKey = el.getAttribute("data-" + key);
if (dataKey) {
return dataKey;
}
return undefined;
} // Set value
for (var i = 0; i < this.length; i += 1) {
el = this[i];
if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {};
el.dom7ElementDataStorage[key] = value;
}
return this;
}
function removeData(key) {
for (var i = 0; i < this.length; i += 1) {
var el = this[i];
if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) {
el.dom7ElementDataStorage[key] = null;
delete el.dom7ElementDataStorage[key];
}
}
}
function dataset() {
var el = this[0];
if (!el) return undefined;
var dataset = {}; // eslint-disable-line
if (el.dataset) {
for (var dataKey in el.dataset) {
dataset[dataKey] = el.dataset[dataKey];
}
} else {
for (var i = 0; i < el.attributes.length; i += 1) {
var _attr = el.attributes[i];
if (_attr.name.indexOf('data-') >= 0) {
dataset[toCamelCase(_attr.name.split('data-')[1])] = _attr.value;
}
}
}
for (var key in dataset) {
if (dataset[key] === 'false') dataset[key] = false;else if (dataset[key] === 'true') dataset[key] = true;else if (parseFloat(dataset[key]) === dataset[key] * 1) dataset[key] *= 1;
}
return dataset;
}
function val(value) {
if (typeof value === 'undefined') {
// get value
var el = this[0];
if (!el) return undefined;
if (el.multiple && el.nodeName.toLowerCase() === 'select') {
var values = [];
for (var i = 0; i < el.selectedOptions.length; i += 1) {
values.push(el.selectedOptions[i].value);
}
return values;
}
return el.value;
} // set value
for (var _i = 0; _i < this.length; _i += 1) {
var _el = this[_i];
if (Array.isArray(value) && _el.multiple && _el.nodeName.toLowerCase() === 'select') {
for (var j = 0; j < _el.options.length; j += 1) {
_el.options[j].selected = value.indexOf(_el.options[j].value) >= 0;
}
} else {
_el.value = value;
}
}
return this;
}
function value(value) {
return this.val(value);
}
function transform(transform) {
for (var i = 0; i < this.length; i += 1) {
this[i].style.transform = transform;
}
return this;
}
function transition(duration) {
for (var i = 0; i < this.length; i += 1) {
this[i].style.transitionDuration = typeof duration !== 'string' ? duration + "ms" : duration;
}
return this;
}
function on() {
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key5] = arguments[_key5];
}
var eventType = args[0],
targetSelector = args[1],
listener = args[2],
capture = args[3];
if (typeof args[1] === 'function') {
eventType = args[0];
listener = args[1];
capture = args[2];
targetSelector = undefined;
}
if (!capture) capture = false;
function handleLiveEvent(e) {
var target = e.target;
if (!target) return;
var eventData = e.target.dom7EventData || [];
if (eventData.indexOf(e) < 0) {
eventData.unshift(e);
}
if ($(target).is(targetSelector)) listener.apply(target, eventData);else {
var _parents = $(target).parents(); // eslint-disable-line
for (var k = 0; k < _parents.length; k += 1) {
if ($(_parents[k]).is(targetSelector)) listener.apply(_parents[k], eventData);
}
}
}
function handleEvent(e) {
var eventData = e && e.target ? e.target.dom7EventData || [] : [];
if (eventData.indexOf(e) < 0) {
eventData.unshift(e);
}
listener.apply(this, eventData);
}
var events = eventType.split(' ');
var j;
for (var i = 0; i < this.length; i += 1) {
var el = this[i];
if (!targetSelector) {
for (j = 0; j < events.length; j += 1) {
var event = events[j];
if (!el.dom7Listeners) el.dom7Listeners = {};
if (!el.dom7Listeners[event]) el.dom7Listeners[event] = [];
el.dom7Listeners[event].push({
listener: listener,
proxyListener: handleEvent
});
el.addEventListener(event, handleEvent, capture);
}
} else {
// Live events
for (j = 0; j < events.length; j += 1) {
var _event = events[j];
if (!el.dom7LiveListeners) el.dom7LiveListeners = {};
if (!el.dom7LiveListeners[_event]) el.dom7LiveListeners[_event] = [];
el.dom7LiveListeners[_event].push({
listener: listener,
proxyListener: handleLiveEvent
});
el.addEventListener(_event, handleLiveEvent, capture);
}
}
}
return this;
}
function off() {
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
args[_key6] = arguments[_key6];
}
var eventType = args[0],
targetSelector = args[1],
listener = args[2],
capture = args[3];
if (typeof args[1] === 'function') {
eventType = args[0];
listener = args[1];
capture = args[2];
targetSelector = undefined;
}
if (!capture) capture = false;
var events = eventType.split(' ');
for (var i = 0; i < events.length; i += 1) {
var event = events[i];
for (var j = 0; j < this.length; j += 1) {
var el = this[j];
var handlers = void 0;
if (!targetSelector && el.dom7Listeners) {
handlers = el.dom7Listeners[event];
} else if (targetSelector && el.dom7LiveListeners) {
handlers = el.dom7LiveListeners[event];
}
if (handlers && handlers.length) {
for (var k = handlers.length - 1; k >= 0; k -= 1) {
var handler = handlers[k];
if (listener && handler.listener === listener) {
el.removeEventListener(event, handler.proxyListener, capture);
handlers.splice(k, 1);
} else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) {
el.removeEventListener(event, handler.proxyListener, capture);
handlers.splice(k, 1);
} else if (!listener) {
el.removeEventListener(event, handler.proxyListener, capture);
handlers.splice(k, 1);
}
}
}
}
}
return this;
}
function once() {
var dom = this;
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}
var eventName = args[0],
targetSelector = args[1],
listener = args[2],
capture = args[3];
if (typeof args[1] === 'function') {
eventName = args[0];
listener = args[1];
capture = args[2];
targetSelector = undefined;
}
function onceHandler() {
for (var _len8 = arguments.length, eventArgs = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
eventArgs[_key8] = arguments[_key8];
}
listener.apply(this, eventArgs);
dom.off(eventName, targetSelector, onceHandler, capture);
if (onceHandler.dom7proxy) {
delete onceHandler.dom7proxy;
}
}
onceHandler.dom7proxy = listener;
return dom.on(eventName, targetSelector, onceHandler, capture);
}
function trigger() {
var window = getWindow();
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
args[_key9] = arguments[_key9];
}
var events = args[0].split(' ');
var eventData = args[1];
for (var i = 0; i < events.length; i += 1) {
var event = events[i];
for (var j = 0; j < this.length; j += 1) {
var el = this[j];
if (window.CustomEvent) {
var evt = new window.CustomEvent(event, {
detail: eventData,
bubbles: true,
cancelable: true
});
el.dom7EventData = args.filter(function (data, dataIndex) {
return dataIndex > 0;
});
el.dispatchEvent(evt);
el.dom7EventData = [];
delete el.dom7EventData;
}
}
}
return this;
}
function transitionEnd(callback) {
var dom = this;
function fireCallBack(e) {
if (e.target !== this) return;
callback.call(this, e);
dom.off('transitionend', fireCallBack);
}
if (callback) {
dom.on('transitionend', fireCallBack);
}
return this;
}
function animationEnd(callback) {
var dom = this;
function fireCallBack(e) {
if (e.target !== this) return;
callback.call(this, e);
dom.off('animationend', fireCallBack);
}
if (callback) {
dom.on('animationend', fireCallBack);
}
return this;
}
function width() {
var window = getWindow();
if (this[0] === window) {
return window.innerWidth;
}
if (this.length > 0) {
return parseFloat(this.css('width'));
}
return null;
}
function outerWidth(includeMargins) {
if (this.length > 0) {
if (includeMargins) {
var _styles = this.styles();
return this[0].offsetWidth + parseFloat(_styles.getPropertyValue('margin-right')) + parseFloat(_styles.getPropertyValue('margin-left'));
}
return this[0].offsetWidth;
}
return null;
}
function height() {
var window = getWindow();
if (this[0] === window) {
return window.innerHeight;
}
if (this.length > 0) {
return parseFloat(this.css('height'));
}
return null;
}
function outerHeight(includeMargins) {
if (this.length > 0) {
if (includeMargins) {
var _styles2 = this.styles();
return this[0].offsetHeight + parseFloat(_styles2.getPropertyValue('margin-top')) + parseFloat(_styles2.getPropertyValue('margin-bottom'));
}
return this[0].offsetHeight;
}
return null;
}
function offset() {
if (this.length > 0) {
var window = getWindow();
var document = getDocument();
var el = this[0];
var box = el.getBoundingClientRect();
var body = document.body;
var clientTop = el.clientTop || body.clientTop || 0;
var clientLeft = el.clientLeft || body.clientLeft || 0;
var scrollTop = el === window ? window.scrollY : el.scrollTop;
var scrollLeft = el === window ? window.scrollX : el.scrollLeft;
return {
top: box.top + scrollTop - clientTop,
left: box.left + scrollLeft - clientLeft
};
}
return null;
}
function hide() {
for (var i = 0; i < this.length; i += 1) {
this[i].style.display = 'none';
}
return this;
}
function show() {
var window = getWindow();
for (var i = 0; i < this.length; i += 1) {
var el = this[i];
if (el.style.display === 'none') {
el.style.display = '';
}
if (window.getComputedStyle(el, null).getPropertyValue('display') === 'none') {
// Still not visible
el.style.display = 'block';
}
}
return this;
}
function styles() {
var window = getWindow();
if (this[0]) return window.getComputedStyle(this[0], null);
return {};
}
function css(props, value) {
var window = getWindow();
var i;
if (arguments.length === 1) {
if (typeof props === 'string') {
// .css('width')
if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props);
} else {
// .css({ width: '100px' })
for (i = 0; i < this.length; i += 1) {
for (var _prop in props) {
this[i].style[_prop] = props[_prop];
}
}
return this;
}
}
if (arguments.length === 2 && typeof props === 'string') {
// .css('width', '100px')
for (i = 0; i < this.length; i += 1) {
this[i].style[props] = value;
}
return this;
}
return this;
}
function each(callback) {
if (!callback) return this;
this.forEach(function (el, index) {
callback.apply(el, [el, index]);
});
return this;
}
function filter(callback) {
var result = arrayFilter(this, callback);
return $(result);
}
function html(html) {
if (typeof html === 'undefined') {
return this[0] ? this[0].innerHTML : null;
}
for (var i = 0; i < this.length; i += 1) {
this[i].innerHTML = html;
}
return this;
}
function text(text) {
if (typeof text === 'undefined') {
return this[0] ? this[0].textContent.trim() : null;
}
for (var i = 0; i < this.length; i += 1) {
this[i].textContent = text;
}
return this;
}
function is(selector) {
var window = getWindow();
var document = getDocument();
var el = this[0];
var compareWith;
var i;
if (!el || typeof selector === 'undefined') return false;
if (typeof selector === 'string') {
if (el.matches) return el.matches(selector);
if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);
if (el.msMatchesSelector) return el.msMatchesSelector(selector);
compareWith = $(selector);
for (i = 0; i < compareWith.length; i += 1) {
if (compareWith[i] === el) return true;
}
return false;
}
if (selector === document) {
return el === document;
}
if (selector === window) {
return el === window;
}
if (selector.nodeType || selector instanceof Dom7) {
compareWith = selector.nodeType ? [selector] : selector;
for (i = 0; i < compareWith.length; i += 1) {
if (compareWith[i] === el) return true;
}
return false;
}
return false;
}
function index() {
var child = this[0];
var i;
if (child) {
i = 0; // eslint-disable-next-line
while ((child = child.previousSibling) !== null) {
if (child.nodeType === 1) i += 1;
}
return i;
}
return undefined;
}
function eq(index) {
if (typeof index === 'undefined') return this;
var length = this.length;
if (index > length - 1) {
return $([]);
}
if (index < 0) {
var returnIndex = length + index;
if (returnIndex < 0) return $([]);
return $([this[returnIndex]]);
}
return $([this[index]]);
}
function append() {
var newChild;
var document = getDocument();
for (var k = 0; k < arguments.length; k += 1) {
newChild = k < 0 || arguments.length <= k ? undefined : arguments[k];
for (var i = 0; i < this.length; i += 1) {
if (typeof newChild === 'string') {
var tempDiv = document.createElement('div');
tempDiv.innerHTML = newChild;
while (tempDiv.firstChild) {
this[i].appendChild(tempDiv.firstChild);
}
} else if (newChild instanceof Dom7) {
for (var j = 0; j < newChild.length; j += 1) {
this[i].appendChild(newChild[j]);
}
} else {
this[i].appendChild(newChild);
}
}
}
return this;
}
function appendTo(parent) {
$(parent).append(this);
return this;
}
function prepend(newChild) {
var document = getDocument();
var i;
var j;
for (i = 0; i < this.length; i += 1) {
if (typeof newChild === 'string') {
var tempDiv = document.createElement('div');
tempDiv.innerHTML = newChild;
for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) {
this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);
}
} else if (newChild instanceof Dom7) {
for (j = 0; j < newChild.length; j += 1) {
this[i].insertBefore(newChild[j], this[i].childNodes[0]);
}
} else {
this[i].insertBefore(newChild, this[i].childNodes[0]);
}
}
return this;
}
function prependTo(parent) {
$(parent).prepend(this);
return this;
}
function insertBefore(selector) {
var before = $(selector);
for (var i = 0; i < this.length; i += 1) {
if (before.length === 1) {
before[0].parentNode.insertBefore(this[i], before[0]);
} else if (before.length > 1) {
for (var j = 0; j < before.length; j += 1) {
before[j].parentNode.insertBefore(this[i].cloneNode(true), before[j]);
}
}
}
}
function insertAfter(selector) {
var after = $(selector);
for (var i = 0; i < this.length; i += 1) {
if (after.length === 1) {
after[0].parentNode.insertBefore(this[i], after[0].nextSibling);
} else if (after.length > 1) {
for (var j = 0; j < after.length; j += 1) {
after[j].parentNode.insertBefore(this[i].cloneNode(true), after[j].nextSibling);
}
}
}
}
function next(selector) {
if (this.length > 0) {
if (selector) {
if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) {
return $([this[0].nextElementSibling]);
}
return $([]);
}
if (this[0].nextElementSibling) return $([this[0].nextElementSibling]);
return $([]);
}
return $([]);
}
function nextAll(selector) {
var nextEls = [];
var el = this[0];
if (!el) return $([]);
while (el.nextElementSibling) {
var _next = el.nextElementSibling; // eslint-disable-line
if (selector) {
if ($(_next).is(selector)) nextEls.push(_next);
} else nextEls.push(_next);
el = _next;
}
return $(nextEls);
}
function prev(selector) {
if (this.length > 0) {
var el = this[0];
if (selector) {
if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) {
return $([el.previousElementSibling]);
}
return $([]);
}
if (el.previousElementSibling) return $([el.previousElementSibling]);
return $([]);
}
return $([]);
}
function prevAll(selector) {
var prevEls = [];
var el = this[0];
if (!el) return $([]);
while (el.previousElementSibling) {
var _prev = el.previousElementSibling; // eslint-disable-line
if (selector) {
if ($(_prev).is(selector)) prevEls.push(_prev);
} else prevEls.push(_prev);
el = _prev;
}
return $(prevEls);
}
function siblings(selector) {
return this.nextAll(selector).add(this.prevAll(selector));
}
function parent(selector) {
var parents = []; // eslint-disable-line
for (var i = 0; i < this.length; i += 1) {
if (this[i].parentNode !== null) {
if (selector) {
if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode);
} else {
parents.push(this[i].parentNode);
}
}
}
return $(parents);
}
function parents(selector) {
var parents = []; // eslint-disable-line
for (var i = 0; i < this.length; i += 1) {
var _parent = this[i].parentNode; // eslint-disable-line
while (_parent) {
if (selector) {
if ($(_parent).is(selector)) parents.push(_parent);
} else {
parents.push(_parent);
}
_parent = _parent.parentNode;
}
}
return $(parents);
}
function closest(selector) {
var closest = this; // eslint-disable-line
if (typeof selector === 'undefined') {
return $([]);
}
if (!closest.is(selector)) {
closest = closest.parents(selector).eq(0);
}
return closest;
}
function find(selector) {
var foundElements = [];
for (var i = 0; i < this.length; i += 1) {
var found = this[i].querySelectorAll(selector);
for (var j = 0; j < found.length; j += 1) {
foundElements.push(found[j]);
}
}
return $(foundElements);
}
function children(selector) {
var children = []; // eslint-disable-line
for (var i = 0; i < this.length; i += 1) {
var childNodes = this[i].children;
for (var j = 0; j < childNodes.length; j += 1) {
if (!selector || $(childNodes[j]).is(selector)) {
children.push(childNodes[j]);
}
}
}
return $(children);
}
function remove() {
for (var i = 0; i < this.length; i += 1) {
if (this[i].parentNode) this[i].parentNode.removeChild(this[i]);
}
return this;
}
function detach() {
return this.remove();
}
function add() {
var dom = this;
var i;
var j;
for (var _len10 = arguments.length, els = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
els[_key10] = arguments[_key10];
}
for (i = 0; i < els.length; i += 1) {
var toAdd = $(els[i]);
for (j = 0; j < toAdd.length; j += 1) {
dom.push(toAdd[j]);
}
}
return dom;
}
function empty() {
for (var i = 0; i < this.length; i += 1) {
var el = this[i];
if (el.nodeType === 1) {
for (var j = 0; j < el.childNodes.length; j += 1) {
if (el.childNodes[j].parentNode) {
el.childNodes[j].parentNode.removeChild(el.childNodes[j]);
}
}
el.textContent = '';
}
}
return this;
}
function scrollTo() {
var window = getWindow();
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var left = args[0],
top = args[1],
duration = args[2],
easing = args[3],
callback = args[4];
if (args.length === 4 && typeof easing === 'function') {
callback = easing;
left = args[0];
top = args[1];
duration = args[2];
callback = args[3];
easing = args[4];
}
if (typeof easing === 'undefined') easing = 'swing';
return this.each(function animate() {
var el = this;
var currentTop;
var currentLeft;
var maxTop;
var maxLeft;
var newTop;
var newLeft;
var scrollTop; // eslint-disable-line
var scrollLeft; // eslint-disable-line
var animateTop = top > 0 || top === 0;
var animateLeft = left > 0 || left === 0;
if (typeof easing === 'undefined') {
easing = 'swing';
}
if (animateTop) {
currentTop = el.scrollTop;
if (!duration) {
el.scrollTop = top;
}
}
if (animateLeft) {
currentLeft = el.scrollLeft;
if (!duration) {
el.scrollLeft = left;
}
}
if (!duration) return;
if (animateTop) {
maxTop = el.scrollHeight - el.offsetHeight;
newTop = Math.max(Math.min(top, maxTop), 0);
}
if (animateLeft) {
maxLeft = el.scrollWidth - el.offsetWidth;
newLeft = Math.max(Math.min(left, maxLeft), 0);
}
var startTime = null;
if (animateTop && newTop === currentTop) animateTop = false;
if (animateLeft && newLeft === currentLeft) animateLeft = false;
function render(time) {
if (time === void 0) {
time = new Date().getTime();
}
if (startTime === null) {
startTime = time;
}
var progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
var easeProgress = easing === 'linear' ? progress : 0.5 - Math.cos(progress * Math.PI) / 2;
var done;
if (animateTop) scrollTop = currentTop + easeProgress * (newTop - currentTop);
if (animateLeft) scrollLeft = currentLeft + easeProgress * (newLeft - currentLeft);
if (animateTop && newTop > currentTop && scrollTop >= newTop) {
el.scrollTop = newTop;
done = true;
}
if (animateTop && newTop < currentTop && scrollTop <= newTop) {
el.scrollTop = newTop;
done = true;
}
if (animateLeft && newLeft > currentLeft && scrollLeft >= newLeft) {
el.scrollLeft = newLeft;
done = true;
}
if (animateLeft && newLeft < currentLeft && scrollLeft <= newLeft) {
el.scrollLeft = newLeft;
done = true;
}
if (done) {
if (callback) callback();
return;
}
if (animateTop) el.scrollTop = scrollTop;
if (animateLeft) el.scrollLeft = scrollLeft;
window.requestAnimationFrame(render);
}
window.requestAnimationFrame(render);
});
} // scrollTop(top, duration, easing, callback) {
function scrollTop() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
var top = args[0],
duration = args[1],
easing = args[2],
callback = args[3];
if (args.length === 3 && typeof easing === 'function') {
top = args[0];
duration = args[1];
callback = args[2];
easing = args[3];
}
var dom = this;
if (typeof top === 'undefined') {
if (dom.length > 0) return dom[0].scrollTop;
return null;
}
return dom.scrollTo(undefined, top, duration, easing, callback);
}
function scrollLeft() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
var left = args[0],
duration = args[1],
easing = args[2],
callback = args[3];
if (args.length === 3 && typeof easing === 'function') {
left = args[0];
duration = args[1];
callback = args[2];
easing = args[3];
}
var dom = this;
if (typeof left === 'undefined') {
if (dom.length > 0) return dom[0].scrollLeft;
return null;
}
return dom.scrollTo(left, undefined, duration, easing, callback);
}
function animate(initialProps, initialParams) {
var window = getWindow();
var els = this;
var a = {
props: Object.assign({}, initialProps),
params: Object.assign({
duration: 300,
easing: 'swing' // or 'linear'
/* Callbacks
begin(elements)
complete(elements)
progress(elements, complete, remaining, start, tweenValue)
*/
}, initialParams),
elements: els,
animating: false,
que: [],
easingProgress: function easingProgress(easing, progress) {
if (easing === 'swing') {
return 0.5 - Math.cos(progress * Math.PI) / 2;
}
if (typeof easing === 'function') {
return easing(progress);
}
return progress;
},
stop: function stop() {
if (a.frameId) {
window.cancelAnimationFrame(a.frameId);
}
a.animating = false;
a.elements.each(function (el) {
var element = el;
delete element.dom7AnimateInstance;
});
a.que = [];
},
done: function done(complete) {
a.animating = false;
a.elements.each(function (el) {
var element = el;
delete element.dom7AnimateInstance;
});
if (complete) complete(els);
if (a.que.length > 0) {
var que = a.que.shift();
a.animate(que[0], que[1]);
}
},
animate: function animate(props, params) {
if (a.animating) {
a.que.push([props, params]);
return a;
}
var elements = []; // Define & Cache Initials & Units
a.elements.each(function (el, index) {
var initialFullValue;
var initialValue;
var unit;
var finalValue;
var finalFullValue;
if (!el.dom7AnimateInstance) a.elements[index].dom7AnimateInstance = a;
elements[index] = {
container: el
};
Object.keys(props).forEach(function (prop) {
initialFullValue = window.getComputedStyle(el, null).getPropertyValue(prop).replace(',', '.');
initialValue = parseFloat(initialFullValue);
unit = initialFullValue.replace(initialValue, '');
finalValue = parseFloat(props[prop]);
finalFullValue = props[prop] + unit;
elements[index][prop] = {
initialFullValue: initialFullValue,
initialValue: initialValue,
unit: unit,
finalValue: finalValue,
finalFullValue: finalFullValue,
currentValue: initialValue
};
});
});
var startTime = null;
var time;
var elementsDone = 0;
var propsDone = 0;
var done;
var began = false;
a.animating = true;
function render() {
time = new Date().getTime();
var progress;
var easeProgress; // let el;
if (!began) {
began = true;
if (params.begin) params.begin(els);
}
if (startTime === null) {
startTime = time;
}
if (params.progress) {
// eslint-disable-next-line
params.progress(els, Math.max(Math.min((time - startTime) / params.duration, 1), 0), startTime + params.duration - time < 0 ? 0 : startTime + params.duration - time, startTime);
}
elements.forEach(function (element) {
var el = element;
if (done || el.done) return;
Object.keys(props).forEach(function (prop) {
if (done || el.done) return;
progress = Math.max(Math.min((time - startTime) / params.duration, 1), 0);
easeProgress = a.easingProgress(params.easing, progress);
var _el$prop = el[prop],
initialValue = _el$prop.initialValue,
finalValue = _el$prop.finalValue,
unit = _el$prop.unit;
el[prop].currentValue = initialValue + easeProgress * (finalValue - initialValue);
var currentValue = el[prop].currentValue;
if (finalValue > initialValue && currentValue >= finalValue || finalValue < initialValue && currentValue <= finalValue) {
el.container.style[prop] = finalValue + unit;
propsDone += 1;
if (propsDone === Object.keys(props).length) {
el.done = true;
elementsDone += 1;
}
if (elementsDone === elements.length) {
done = true;
}
}
if (done) {
a.done(params.complete);
return;
}
el.container.style[prop] = currentValue + unit;
});
});
if (done) return; // Then call
a.frameId = window.requestAnimationFrame(render);
}
a.frameId = window.requestAnimationFrame(render);
return a;
}
};
if (a.elements.length === 0) {
return els;
}
var animateInstance;
for (var i = 0; i < a.elements.length; i += 1) {
if (a.elements[i].dom7AnimateInstance) {
animateInstance = a.elements[i].dom7AnimateInstance;
} else a.elements[i].dom7AnimateInstance = a;
}
if (!animateInstance) {
animateInstance = a;
}
if (initialProps === 'stop') {
animateInstance.stop();
} else {
animateInstance.animate(a.props, a.params);
}
return els;
}
function stop() {
var els = this;
for (var i = 0; i < els.length; i += 1) {
if (els[i].dom7AnimateInstance) {
els[i].dom7AnimateInstance.stop();
}
}
}
var noTrigger = 'resize scroll'.split(' ');
function shortcut(name) {
function eventHandler() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (typeof args[0] === 'undefined') {
for (var i = 0; i < this.length; i += 1) {
if (noTrigger.indexOf(name) < 0) {
if (name in this[i]) this[i][name]();else {
$(this[i]).trigger(name);
}
}
}
return this;
}
return this.on.apply(this, [name].concat(args));
}
return eventHandler;
}
var click = shortcut('click');
var blur = shortcut('blur');
var focus = shortcut('focus');
var focusin = shortcut('focusin');
var focusout = shortcut('focusout');
var keyup = shortcut('keyup');
var keydown = shortcut('keydown');
var keypress = shortcut('keypress');
var submit = shortcut('submit');
var change = shortcut('change');
var mousedown = shortcut('mousedown');
var mousemove = shortcut('mousemove');
var mouseup = shortcut('mouseup');
var mouseenter = shortcut('mouseenter');
var mouseleave = shortcut('mouseleave');
var mouseout = shortcut('mouseout');
var mouseover = shortcut('mouseover');
var touchstart = shortcut('touchstart');
var touchend = shortcut('touchend');
var touchmove = shortcut('touchmove');
var resize = shortcut('resize');
var scroll = shortcut('scroll');
export default $;
export { $, add, addClass, animate, animationEnd, append, appendTo, attr, blur, change, children, click, closest, css, data, dataset, detach, each, empty, eq, filter, find, focus, focusin, focusout, hasClass, height, hide, html, index, insertAfter, insertBefore, is, keydown, keypress, keyup, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, next, nextAll, off, offset, on, once, outerHeight, outerWidth, parent, parents, prepend, prependTo, prev, prevAll, prop, remove, removeAttr, removeClass, removeData, resize, scroll, scrollLeft, scrollTo, scrollTop, show, siblings, stop, styles, submit, text, toggleClass, touchend, touchmove, touchstart, transform, transition, transitionEnd, trigger, val, value, width };
webpack://frontend-tpt/../../node_modules/swiper/esm/utils/dom.js
import { $, addClass, removeClass, hasClass, toggleClass, attr, removeAttr, transform, transition, on, off, trigger, transitionEnd, outerWidth, outerHeight, styles, offset, css, each, html, text, is, index, eq, append, prepend, next, nextAll, prev, prevAll, parent, parents, closest, find, children, filter, remove } from 'dom7';
var Methods = {
addClass: addClass,
removeClass: removeClass,
hasClass: hasClass,
toggleClass: toggleClass,
attr: attr,
removeAttr: removeAttr,
transform: transform,
transition: transition,
on: on,
off: off,
trigger: trigger,
transitionEnd: transitionEnd,
outerWidth: outerWidth,
outerHeight: outerHeight,
styles: styles,
offset: offset,
css: css,
each: each,
html: html,
text: text,
is: is,
index: index,
eq: eq,
append: append,
prepend: prepend,
next: next,
nextAll: nextAll,
prev: prev,
prevAll: prevAll,
parent: parent,
parents: parents,
closest: closest,
find: find,
children: children,
filter: filter,
remove: remove
};
Object.keys(Methods).forEach(function (methodName) {
Object.defineProperty($.fn, methodName, {
value: Methods[methodName],
writable: true
});
});
export default $;
webpack://frontend-tpt/../../node_modules/swiper/esm/utils/utils.js
import { getDocument, getWindow } from 'ssr-window';
function deleteProps(obj) {
var object = obj;
Object.keys(object).forEach(function (key) {
try {
object[key] = null;
} catch (e) {// no getter for object
}
try {
delete object[key];
} catch (e) {// something got wrong
}
});
}
function nextTick(callback, delay) {
if (delay === void 0) {
delay = 0;
}
return setTimeout(callback, delay);
}
function now() {
return Date.now();
}
function getComputedStyle(el) {
var window = getWindow();
var style;
if (window.getComputedStyle) {
style = window.getComputedStyle(el, null);
}
if (!style && el.currentStyle) {
style = el.currentStyle;
}
if (!style) {
style = el.style;
}
return style;
}
function getTranslate(el, axis) {
if (axis === void 0) {
axis = 'x';
}
var window = getWindow();
var matrix;
var curTransform;
var transformMatrix;
var curStyle = getComputedStyle(el, null);
if (window.WebKitCSSMatrix) {
curTransform = curStyle.transform || curStyle.webkitTransform;
if (curTransform.split(',').length > 6) {
curTransform = curTransform.split(', ').map(function (a) {
return a.replace(',', '.');
}).join(', ');
} // Some old versions of Webkit choke when 'none' is passed; pass
// empty string instead in this case
transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
} else {
transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
matrix = transformMatrix.toString().split(',');
}
if (axis === 'x') {
// Latest Chrome and webkits Fix
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; // Crazy IE10 Matrix
else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); // Normal Browsers
else curTransform = parseFloat(matrix[4]);
}
if (axis === 'y') {
// Latest Chrome and webkits Fix
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; // Crazy IE10 Matrix
else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); // Normal Browsers
else curTransform = parseFloat(matrix[5]);
}
return curTransform || 0;
}
function isObject(o) {
return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';
}
function isNode(node) {
// eslint-disable-next-line
if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {
return node instanceof HTMLElement;
}
return node && (node.nodeType === 1 || node.nodeType === 11);
}
function extend() {
var to = Object(arguments.length <= 0 ? undefined : arguments[0]);
var noExtend = ['__proto__', 'constructor', 'prototype'];
for (var i = 1; i < arguments.length; i += 1) {
var nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];
if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
var keysArray = Object.keys(Object(nextSource)).filter(function (key) {
return noExtend.indexOf(key) < 0;
});
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
var nextKey = keysArray[nextIndex];
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
if (desc !== undefined && desc.enumerable) {
if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
if (nextSource[nextKey].__swiper__) {
to[nextKey] = nextSource[nextKey];
} else {
extend(to[nextKey], nextSource[nextKey]);
}
} else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
to[nextKey] = {};
if (nextSource[nextKey].__swiper__) {
to[nextKey] = nextSource[nextKey];
} else {
extend(to[nextKey], nextSource[nextKey]);
}
} else {
to[nextKey] = nextSource[nextKey];
}
}
}
}
}
return to;
}
function bindModuleMethods(instance, obj) {
Object.keys(obj).forEach(function (key) {
if (isObject(obj[key])) {
Object.keys(obj[key]).forEach(function (subKey) {
if (typeof obj[key][subKey] === 'function') {
obj[key][subKey] = obj[key][subKey].bind(instance);
}
});
}
instance[key] = obj[key];
});
}
function classesToSelector(classes) {
if (classes === void 0) {
classes = '';
}
return "." + classes.trim().replace(/([\.:!\/])/g, '\\$1') // eslint-disable-line
.replace(/ /g, '.');
}
function createElementIfNotDefined($container, params, createElements, checkProps) {
var document = getDocument();
if (createElements) {
Object.keys(checkProps).forEach(function (key) {
if (!params[key] && params.auto === true) {
var element = document.createElement('div');
element.className = checkProps[key];
$container.append(element);
params[key] = element;
}
});
}
return params;
}
export { deleteProps, nextTick, now, getTranslate, isObject, extend, bindModuleMethods, getComputedStyle, classesToSelector, createElementIfNotDefined };
webpack://frontend-tpt/../../node_modules/swiper/esm/utils/get-support.js
import { getWindow, getDocument } from 'ssr-window';
var support;
function calcSupport() {
var window = getWindow();
var document = getDocument();
return {
touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch),
pointerEvents: !!window.PointerEvent && 'maxTouchPoints' in window.navigator && window.navigator.maxTouchPoints >= 0,
observer: function checkObserver() {
return 'MutationObserver' in window || 'WebkitMutationObserver' in window;
}(),
passiveListener: function checkPassiveListener() {
var supportsPassive = false;
try {
var opts = Object.defineProperty({}, 'passive', {
// eslint-disable-next-line
get: function get() {
supportsPassive = true;
}
});
window.addEventListener('testPassiveListener', null, opts);
} catch (e) {// No support
}
return supportsPassive;
}(),
gestures: function checkGestures() {
return 'ongesturestart' in window;
}()
};
}
function getSupport() {
if (!support) {
support = calcSupport();
}
return support;
}
export { getSupport };
webpack://frontend-tpt/../../node_modules/swiper/esm/utils/get-device.js
import { getWindow } from 'ssr-window';
import { getSupport } from './get-support';
var device;
function calcDevice(_temp) {
var _ref = _temp === void 0 ? {} : _temp,
userAgent = _ref.userAgent;
var support = getSupport();
var window = getWindow();
var platform = window.navigator.platform;
var ua = userAgent || window.navigator.userAgent;
var device = {
ios: false,
android: false
};
var screenWidth = window.screen.width;
var screenHeight = window.screen.height;
var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
var iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
var windows = platform === 'Win32';
var macos = platform === 'MacIntel'; // iPadOs 13 fix
var iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];
if (!ipad && macos && support.touch && iPadScreens.indexOf(screenWidth + "x" + screenHeight) >= 0) {
ipad = ua.match(/(Version)\/([\d.]+)/);
if (!ipad) ipad = [0, 1, '13_0_0'];
macos = false;
} // Android
if (android && !windows) {
device.os = 'android';
device.android = true;
}
if (ipad || iphone || ipod) {
device.os = 'ios';
device.ios = true;
} // Export object
return device;
}
function getDevice(overrides) {
if (overrides === void 0) {
overrides = {};
}
if (!device) {
device = calcDevice(overrides);
}
return device;
}
export { getDevice };
webpack://frontend-tpt/../../node_modules/swiper/esm/utils/get-browser.js
import { getWindow } from 'ssr-window';
var browser;
function calcBrowser() {
var window = getWindow();
function isSafari() {
var ua = window.navigator.userAgent.toLowerCase();
return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;
}
return {
isEdge: !!window.navigator.userAgent.match(/Edge/g),
isSafari: isSafari(),
isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)
};
}
function getBrowser() {
if (!browser) {
browser = calcBrowser();
}
return browser;
}
export { getBrowser };
webpack://frontend-tpt/../../node_modules/swiper/esm/modules/resize/resize.js
import { getWindow } from 'ssr-window';
import { extend } from '../../utils/utils';
var supportsResizeObserver = function supportsResizeObserver() {
var window = getWindow();
return typeof window.ResizeObserver !== 'undefined';
};
export default {
name: 'resize',
create: function create() {
var swiper = this;
extend(swiper, {
resize: {
observer: null,
createObserver: function createObserver() {
if (!swiper || swiper.destroyed || !swiper.initialized) return;
swiper.resize.observer = new ResizeObserver(function (entries) {
var width = swiper.width,
height = swiper.height;
var newWidth = width;
var newHeight = height;
entries.forEach(function (_ref) {
var contentBoxSize = _ref.contentBoxSize,
contentRect = _ref.contentRect,
target = _ref.target;
if (target && target !== swiper.el) return;
newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
});
if (newWidth !== width || newHeight !== height) {
swiper.resize.resizeHandler();
}
});
swiper.resize.observer.observe(swiper.el);
},
removeObserver: function removeObserver() {
if (swiper.resize.observer && swiper.resize.observer.unobserve && swiper.el) {
swiper.resize.observer.unobserve(swiper.el);
swiper.resize.observer = null;
}
},
resizeHandler: function resizeHandler() {
if (!swiper || swiper.destroyed || !swiper.initialized) return;
swiper.emit('beforeResize');
swiper.emit('resize');
},
orientationChangeHandler: function orientationChangeHandler() {
if (!swiper || swiper.destroyed || !swiper.initialized) return;
swiper.emit('orientationchange');
}
}
});
},
on: {
init: function init(swiper) {
var window = getWindow();
if (swiper.params.resizeObserver && supportsResizeObserver()) {
swiper.resize.createObserver();
return;
} // Emit resize
window.addEventListener('resize', swiper.resize.resizeHandler); // Emit orientationchange
window.addEventListener('orientationchange', swiper.resize.orientationChangeHandler);
},
destroy: function destroy(swiper) {
var window = getWindow();
swiper.resize.removeObserver();
window.removeEventListener('resize', swiper.resize.resizeHandler);
window.removeEventListener('orientationchange', swiper.resize.orientationChangeHandler);
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/modules/observer/observer.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { getWindow } from 'ssr-window';
import { bindModuleMethods } from '../../utils/utils';
var Observer = {
attach: function attach(target, options) {
if (options === void 0) {
options = {};
}
var window = getWindow();
var swiper = this;
var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
var observer = new ObserverFunc(function (mutations) {
// The observerUpdate event should only be triggered
// once despite the number of mutations. Additional
// triggers are redundant and are very costly
if (mutations.length === 1) {
swiper.emit('observerUpdate', mutations[0]);
return;
}
var observerUpdate = function observerUpdate() {
swiper.emit('observerUpdate', mutations[0]);
};
if (window.requestAnimationFrame) {
window.requestAnimationFrame(observerUpdate);
} else {
window.setTimeout(observerUpdate, 0);
}
});
observer.observe(target, {
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
childList: typeof options.childList === 'undefined' ? true : options.childList,
characterData: typeof options.characterData === 'undefined' ? true : options.characterData
});
swiper.observer.observers.push(observer);
},
init: function init() {
var swiper = this;
if (!swiper.support.observer || !swiper.params.observer) return;
if (swiper.params.observeParents) {
var containerParents = swiper.$el.parents();
for (var i = 0; i < containerParents.length; i += 1) {
swiper.observer.attach(containerParents[i]);
}
} // Observe container
swiper.observer.attach(swiper.$el[0], {
childList: swiper.params.observeSlideChildren
}); // Observe wrapper
swiper.observer.attach(swiper.$wrapperEl[0], {
attributes: false
});
},
destroy: function destroy() {
var swiper = this;
swiper.observer.observers.forEach(function (observer) {
observer.disconnect();
});
swiper.observer.observers = [];
}
};
export default {
name: 'observer',
params: {
observer: false,
observeParents: false,
observeSlideChildren: false
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
observer: _extends({}, Observer, {
observers: []
})
});
},
on: {
init: function init(swiper) {
swiper.observer.init();
},
destroy: function destroy(swiper) {
swiper.observer.destroy();
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/events-emitter.js
/* eslint-disable no-underscore-dangle */
export default {
on: function on(events, handler, priority) {
var self = this;
if (typeof handler !== 'function') return self;
var method = priority ? 'unshift' : 'push';
events.split(' ').forEach(function (event) {
if (!self.eventsListeners[event]) self.eventsListeners[event] = [];
self.eventsListeners[event][method](handler);
});
return self;
},
once: function once(events, handler, priority) {
var self = this;
if (typeof handler !== 'function') return self;
function onceHandler() {
self.off(events, onceHandler);
if (onceHandler.__emitterProxy) {
delete onceHandler.__emitterProxy;
}
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
handler.apply(self, args);
}
onceHandler.__emitterProxy = handler;
return self.on(events, onceHandler, priority);
},
onAny: function onAny(handler, priority) {
var self = this;
if (typeof handler !== 'function') return self;
var method = priority ? 'unshift' : 'push';
if (self.eventsAnyListeners.indexOf(handler) < 0) {
self.eventsAnyListeners[method](handler);
}
return self;
},
offAny: function offAny(handler) {
var self = this;
if (!self.eventsAnyListeners) return self;
var index = self.eventsAnyListeners.indexOf(handler);
if (index >= 0) {
self.eventsAnyListeners.splice(index, 1);
}
return self;
},
off: function off(events, handler) {
var self = this;
if (!self.eventsListeners) return self;
events.split(' ').forEach(function (event) {
if (typeof handler === 'undefined') {
self.eventsListeners[event] = [];
} else if (self.eventsListeners[event]) {
self.eventsListeners[event].forEach(function (eventHandler, index) {
if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {
self.eventsListeners[event].splice(index, 1);
}
});
}
});
return self;
},
emit: function emit() {
var self = this;
if (!self.eventsListeners) return self;
var events;
var data;
var context;
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (typeof args[0] === 'string' || Array.isArray(args[0])) {
events = args[0];
data = args.slice(1, args.length);
context = self;
} else {
events = args[0].events;
data = args[0].data;
context = args[0].context || self;
}
data.unshift(context);
var eventsArray = Array.isArray(events) ? events : events.split(' ');
eventsArray.forEach(function (event) {
if (self.eventsAnyListeners && self.eventsAnyListeners.length) {
self.eventsAnyListeners.forEach(function (eventHandler) {
eventHandler.apply(context, [event].concat(data));
});
}
if (self.eventsListeners && self.eventsListeners[event]) {
self.eventsListeners[event].forEach(function (eventHandler) {
eventHandler.apply(context, data);
});
}
});
return self;
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/index.js
import updateSize from './updateSize';
import updateSlides from './updateSlides';
import updateAutoHeight from './updateAutoHeight';
import updateSlidesOffset from './updateSlidesOffset';
import updateSlidesProgress from './updateSlidesProgress';
import updateProgress from './updateProgress';
import updateSlidesClasses from './updateSlidesClasses';
import updateActiveIndex from './updateActiveIndex';
import updateClickedSlide from './updateClickedSlide';
export default {
updateSize: updateSize,
updateSlides: updateSlides,
updateAutoHeight: updateAutoHeight,
updateSlidesOffset: updateSlidesOffset,
updateSlidesProgress: updateSlidesProgress,
updateProgress: updateProgress,
updateSlidesClasses: updateSlidesClasses,
updateActiveIndex: updateActiveIndex,
updateClickedSlide: updateClickedSlide
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/updateSize.js
import { extend } from '../../../utils/utils';
export default function updateSize() {
var swiper = this;
var width;
var height;
var $el = swiper.$el;
if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {
width = swiper.params.width;
} else {
width = $el[0].clientWidth;
}
if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {
height = swiper.params.height;
} else {
height = $el[0].clientHeight;
}
if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {
return;
} // Subtract paddings
width = width - parseInt($el.css('padding-left') || 0, 10) - parseInt($el.css('padding-right') || 0, 10);
height = height - parseInt($el.css('padding-top') || 0, 10) - parseInt($el.css('padding-bottom') || 0, 10);
if (Number.isNaN(width)) width = 0;
if (Number.isNaN(height)) height = 0;
extend(swiper, {
width: width,
height: height,
size: swiper.isHorizontal() ? width : height
});
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/updateSlides.js
import { extend } from '../../../utils/utils';
export default function updateSlides() {
var swiper = this;
function getDirectionLabel(property) {
if (swiper.isHorizontal()) {
return property;
} // prettier-ignore
return {
'width': 'height',
'margin-top': 'margin-left',
'margin-bottom ': 'margin-right',
'margin-left': 'margin-top',
'margin-right': 'margin-bottom',
'padding-left': 'padding-top',
'padding-right': 'padding-bottom',
'marginRight': 'marginBottom'
}[property];
}
function getDirectionPropertyValue(node, label) {
return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);
}
var params = swiper.params;
var $wrapperEl = swiper.$wrapperEl,
swiperSize = swiper.size,
rtl = swiper.rtlTranslate,
wrongRTL = swiper.wrongRTL;
var isVirtual = swiper.virtual && params.virtual.enabled;
var previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
var slides = $wrapperEl.children("." + swiper.params.slideClass);
var slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
var snapGrid = [];
var slidesGrid = [];
var slidesSizesGrid = [];
var offsetBefore = params.slidesOffsetBefore;
if (typeof offsetBefore === 'function') {
offsetBefore = params.slidesOffsetBefore.call(swiper);
}
var offsetAfter = params.slidesOffsetAfter;
if (typeof offsetAfter === 'function') {
offsetAfter = params.slidesOffsetAfter.call(swiper);
}
var previousSnapGridLength = swiper.snapGrid.length;
var previousSlidesGridLength = swiper.slidesGrid.length;
var spaceBetween = params.spaceBetween;
var slidePosition = -offsetBefore;
var prevSlideSize = 0;
var index = 0;
if (typeof swiperSize === 'undefined') {
return;
}
if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;
}
swiper.virtualSize = -spaceBetween; // reset margins
if (rtl) slides.css({
marginLeft: '',
marginBottom: '',
marginTop: ''
});else slides.css({
marginRight: '',
marginBottom: '',
marginTop: ''
});
var slidesNumberEvenToRows;
if (params.slidesPerColumn > 1) {
if (Math.floor(slidesLength / params.slidesPerColumn) === slidesLength / swiper.params.slidesPerColumn) {
slidesNumberEvenToRows = slidesLength;
} else {
slidesNumberEvenToRows = Math.ceil(slidesLength / params.slidesPerColumn) * params.slidesPerColumn;
}
if (params.slidesPerView !== 'auto' && params.slidesPerColumnFill === 'row') {
slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, params.slidesPerView * params.slidesPerColumn);
}
} // Calc slides
var slideSize;
var slidesPerColumn = params.slidesPerColumn;
var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;
var numFullColumns = Math.floor(slidesLength / params.slidesPerColumn);
for (var i = 0; i < slidesLength; i += 1) {
slideSize = 0;
var slide = slides.eq(i);
if (params.slidesPerColumn > 1) {
// Set slides order
var newSlideOrderIndex = void 0;
var column = void 0;
var row = void 0;
if (params.slidesPerColumnFill === 'row' && params.slidesPerGroup > 1) {
var groupIndex = Math.floor(i / (params.slidesPerGroup * params.slidesPerColumn));
var slideIndexInGroup = i - params.slidesPerColumn * params.slidesPerGroup * groupIndex;
var columnsInGroup = groupIndex === 0 ? params.slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * slidesPerColumn * params.slidesPerGroup) / slidesPerColumn), params.slidesPerGroup);
row = Math.floor(slideIndexInGroup / columnsInGroup);
column = slideIndexInGroup - row * columnsInGroup + groupIndex * params.slidesPerGroup;
newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;
slide.css({
'-webkit-box-ordinal-group': newSlideOrderIndex,
'-moz-box-ordinal-group': newSlideOrderIndex,
'-ms-flex-order': newSlideOrderIndex,
'-webkit-order': newSlideOrderIndex,
order: newSlideOrderIndex
});
} else if (params.slidesPerColumnFill === 'column') {
column = Math.floor(i / slidesPerColumn);
row = i - column * slidesPerColumn;
if (column > numFullColumns || column === numFullColumns && row === slidesPerColumn - 1) {
row += 1;
if (row >= slidesPerColumn) {
row = 0;
column += 1;
}
}
} else {
row = Math.floor(i / slidesPerRow);
column = i - row * slidesPerRow;
}
slide.css(getDirectionLabel('margin-top'), row !== 0 ? params.spaceBetween && params.spaceBetween + "px" : '');
}
if (slide.css('display') === 'none') continue; // eslint-disable-line
if (params.slidesPerView === 'auto') {
var slideStyles = getComputedStyle(slide[0]);
var currentTransform = slide[0].style.transform;
var currentWebKitTransform = slide[0].style.webkitTransform;
if (currentTransform) {
slide[0].style.transform = 'none';
}
if (currentWebKitTransform) {
slide[0].style.webkitTransform = 'none';
}
if (params.roundLengths) {
slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);
} else {
// eslint-disable-next-line
var width = getDirectionPropertyValue(slideStyles, 'width');
var paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');
var paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');
var marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');
var marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');
var boxSizing = slideStyles.getPropertyValue('box-sizing');
if (boxSizing && boxSizing === 'border-box') {
slideSize = width + marginLeft + marginRight;
} else {
var _slide$ = slide[0],
clientWidth = _slide$.clientWidth,
offsetWidth = _slide$.offsetWidth;
slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);
}
}
if (currentTransform) {
slide[0].style.transform = currentTransform;
}
if (currentWebKitTransform) {
slide[0].style.webkitTransform = currentWebKitTransform;
}
if (params.roundLengths) slideSize = Math.floor(slideSize);
} else {
slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
if (params.roundLengths) slideSize = Math.floor(slideSize);
if (slides[i]) {
slides[i].style[getDirectionLabel('width')] = slideSize + "px";
}
}
if (slides[i]) {
slides[i].swiperSlideSize = slideSize;
}
slidesSizesGrid.push(slideSize);
if (params.centeredSlides) {
slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
if (params.roundLengths) slidePosition = Math.floor(slidePosition);
if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
slidesGrid.push(slidePosition);
} else {
if (params.roundLengths) slidePosition = Math.floor(slidePosition);
if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);
slidesGrid.push(slidePosition);
slidePosition = slidePosition + slideSize + spaceBetween;
}
swiper.virtualSize += slideSize + spaceBetween;
prevSlideSize = slideSize;
index += 1;
}
swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
var newSlidesGrid;
if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {
$wrapperEl.css({
width: swiper.virtualSize + params.spaceBetween + "px"
});
}
if (params.setWrapperSize) {
var _$wrapperEl$css;
$wrapperEl.css((_$wrapperEl$css = {}, _$wrapperEl$css[getDirectionLabel('width')] = swiper.virtualSize + params.spaceBetween + "px", _$wrapperEl$css));
}
if (params.slidesPerColumn > 1) {
var _$wrapperEl$css2;
swiper.virtualSize = (slideSize + params.spaceBetween) * slidesNumberEvenToRows;
swiper.virtualSize = Math.ceil(swiper.virtualSize / params.slidesPerColumn) - params.spaceBetween;
$wrapperEl.css((_$wrapperEl$css2 = {}, _$wrapperEl$css2[getDirectionLabel('width')] = swiper.virtualSize + params.spaceBetween + "px", _$wrapperEl$css2));
if (params.centeredSlides) {
newSlidesGrid = [];
for (var _i = 0; _i < snapGrid.length; _i += 1) {
var slidesGridItem = snapGrid[_i];
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
if (snapGrid[_i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);
}
snapGrid = newSlidesGrid;
}
} // Remove last grid elements depending on width
if (!params.centeredSlides) {
newSlidesGrid = [];
for (var _i2 = 0; _i2 < snapGrid.length; _i2 += 1) {
var _slidesGridItem = snapGrid[_i2];
if (params.roundLengths) _slidesGridItem = Math.floor(_slidesGridItem);
if (snapGrid[_i2] <= swiper.virtualSize - swiperSize) {
newSlidesGrid.push(_slidesGridItem);
}
}
snapGrid = newSlidesGrid;
if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
snapGrid.push(swiper.virtualSize - swiperSize);
}
}
if (snapGrid.length === 0) snapGrid = [0];
if (params.spaceBetween !== 0) {
var _slides$filter$css;
var key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight');
slides.filter(function (_, slideIndex) {
if (!params.cssMode) return true;
if (slideIndex === slides.length - 1) {
return false;
}
return true;
}).css((_slides$filter$css = {}, _slides$filter$css[key] = spaceBetween + "px", _slides$filter$css));
}
if (params.centeredSlides && params.centeredSlidesBounds) {
var allSlidesSize = 0;
slidesSizesGrid.forEach(function (slideSizeValue) {
allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
});
allSlidesSize -= params.spaceBetween;
var maxSnap = allSlidesSize - swiperSize;
snapGrid = snapGrid.map(function (snap) {
if (snap < 0) return -offsetBefore;
if (snap > maxSnap) return maxSnap + offsetAfter;
return snap;
});
}
if (params.centerInsufficientSlides) {
var _allSlidesSize = 0;
slidesSizesGrid.forEach(function (slideSizeValue) {
_allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
});
_allSlidesSize -= params.spaceBetween;
if (_allSlidesSize < swiperSize) {
var allSlidesOffset = (swiperSize - _allSlidesSize) / 2;
snapGrid.forEach(function (snap, snapIndex) {
snapGrid[snapIndex] = snap - allSlidesOffset;
});
slidesGrid.forEach(function (snap, snapIndex) {
slidesGrid[snapIndex] = snap + allSlidesOffset;
});
}
}
extend(swiper, {
slides: slides,
snapGrid: snapGrid,
slidesGrid: slidesGrid,
slidesSizesGrid: slidesSizesGrid
});
if (slidesLength !== previousSlidesLength) {
swiper.emit('slidesLengthChange');
}
if (snapGrid.length !== previousSnapGridLength) {
if (swiper.params.watchOverflow) swiper.checkOverflow();
swiper.emit('snapGridLengthChange');
}
if (slidesGrid.length !== previousSlidesGridLength) {
swiper.emit('slidesGridLengthChange');
}
if (params.watchSlidesProgress || params.watchSlidesVisibility) {
swiper.updateSlidesOffset();
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/updateAutoHeight.js
export default function updateAutoHeight(speed) {
var swiper = this;
var activeSlides = [];
var isVirtual = swiper.virtual && swiper.params.virtual.enabled;
var newHeight = 0;
var i;
if (typeof speed === 'number') {
swiper.setTransition(speed);
} else if (speed === true) {
swiper.setTransition(swiper.params.speed);
}
var getSlideByIndex = function getSlideByIndex(index) {
if (isVirtual) {
return swiper.slides.filter(function (el) {
return parseInt(el.getAttribute('data-swiper-slide-index'), 10) === index;
})[0];
}
return swiper.slides.eq(index)[0];
}; // Find slides currently in view
if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {
if (swiper.params.centeredSlides) {
swiper.visibleSlides.each(function (slide) {
activeSlides.push(slide);
});
} else {
for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
var index = swiper.activeIndex + i;
if (index > swiper.slides.length && !isVirtual) break;
activeSlides.push(getSlideByIndex(index));
}
}
} else {
activeSlides.push(getSlideByIndex(swiper.activeIndex));
} // Find new height from highest slide in view
for (i = 0; i < activeSlides.length; i += 1) {
if (typeof activeSlides[i] !== 'undefined') {
var height = activeSlides[i].offsetHeight;
newHeight = height > newHeight ? height : newHeight;
}
} // Update Height
if (newHeight) swiper.$wrapperEl.css('height', newHeight + "px");
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/updateSlidesOffset.js
export default function updateSlidesOffset() {
var swiper = this;
var slides = swiper.slides;
for (var i = 0; i < slides.length; i += 1) {
slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop;
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/updateSlidesProgress.js
import $ from '../../../utils/dom';
export default function updateSlidesProgress(translate) {
if (translate === void 0) {
translate = this && this.translate || 0;
}
var swiper = this;
var params = swiper.params;
var slides = swiper.slides,
rtl = swiper.rtlTranslate;
if (slides.length === 0) return;
if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
var offsetCenter = -translate;
if (rtl) offsetCenter = translate; // Visible Slides
slides.removeClass(params.slideVisibleClass);
swiper.visibleSlidesIndexes = [];
swiper.visibleSlides = [];
for (var i = 0; i < slides.length; i += 1) {
var slide = slides[i];
var slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slide.swiperSlideOffset) / (slide.swiperSlideSize + params.spaceBetween);
if (params.watchSlidesVisibility || params.centeredSlides && params.autoHeight) {
var slideBefore = -(offsetCenter - slide.swiperSlideOffset);
var slideAfter = slideBefore + swiper.slidesSizesGrid[i];
var isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
if (isVisible) {
swiper.visibleSlides.push(slide);
swiper.visibleSlidesIndexes.push(i);
slides.eq(i).addClass(params.slideVisibleClass);
}
}
slide.progress = rtl ? -slideProgress : slideProgress;
}
swiper.visibleSlides = $(swiper.visibleSlides);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/updateProgress.js
import { extend } from '../../../utils/utils';
export default function updateProgress(translate) {
var swiper = this;
if (typeof translate === 'undefined') {
var multiplier = swiper.rtlTranslate ? -1 : 1; // eslint-disable-next-line
translate = swiper && swiper.translate && swiper.translate * multiplier || 0;
}
var params = swiper.params;
var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
var progress = swiper.progress,
isBeginning = swiper.isBeginning,
isEnd = swiper.isEnd;
var wasBeginning = isBeginning;
var wasEnd = isEnd;
if (translatesDiff === 0) {
progress = 0;
isBeginning = true;
isEnd = true;
} else {
progress = (translate - swiper.minTranslate()) / translatesDiff;
isBeginning = progress <= 0;
isEnd = progress >= 1;
}
extend(swiper, {
progress: progress,
isBeginning: isBeginning,
isEnd: isEnd
});
if (params.watchSlidesProgress || params.watchSlidesVisibility || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);
if (isBeginning && !wasBeginning) {
swiper.emit('reachBeginning toEdge');
}
if (isEnd && !wasEnd) {
swiper.emit('reachEnd toEdge');
}
if (wasBeginning && !isBeginning || wasEnd && !isEnd) {
swiper.emit('fromEdge');
}
swiper.emit('progress', progress);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/updateSlidesClasses.js
export default function updateSlidesClasses() {
var swiper = this;
var slides = swiper.slides,
params = swiper.params,
$wrapperEl = swiper.$wrapperEl,
activeIndex = swiper.activeIndex,
realIndex = swiper.realIndex;
var isVirtual = swiper.virtual && params.virtual.enabled;
slides.removeClass(params.slideActiveClass + " " + params.slideNextClass + " " + params.slidePrevClass + " " + params.slideDuplicateActiveClass + " " + params.slideDuplicateNextClass + " " + params.slideDuplicatePrevClass);
var activeSlide;
if (isVirtual) {
activeSlide = swiper.$wrapperEl.find("." + params.slideClass + "[data-swiper-slide-index=\"" + activeIndex + "\"]");
} else {
activeSlide = slides.eq(activeIndex);
} // Active classes
activeSlide.addClass(params.slideActiveClass);
if (params.loop) {
// Duplicate to all looped slides
if (activeSlide.hasClass(params.slideDuplicateClass)) {
$wrapperEl.children("." + params.slideClass + ":not(." + params.slideDuplicateClass + ")[data-swiper-slide-index=\"" + realIndex + "\"]").addClass(params.slideDuplicateActiveClass);
} else {
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass + "[data-swiper-slide-index=\"" + realIndex + "\"]").addClass(params.slideDuplicateActiveClass);
}
} // Next Slide
var nextSlide = activeSlide.nextAll("." + params.slideClass).eq(0).addClass(params.slideNextClass);
if (params.loop && nextSlide.length === 0) {
nextSlide = slides.eq(0);
nextSlide.addClass(params.slideNextClass);
} // Prev Slide
var prevSlide = activeSlide.prevAll("." + params.slideClass).eq(0).addClass(params.slidePrevClass);
if (params.loop && prevSlide.length === 0) {
prevSlide = slides.eq(-1);
prevSlide.addClass(params.slidePrevClass);
}
if (params.loop) {
// Duplicate to all looped slides
if (nextSlide.hasClass(params.slideDuplicateClass)) {
$wrapperEl.children("." + params.slideClass + ":not(." + params.slideDuplicateClass + ")[data-swiper-slide-index=\"" + nextSlide.attr('data-swiper-slide-index') + "\"]").addClass(params.slideDuplicateNextClass);
} else {
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass + "[data-swiper-slide-index=\"" + nextSlide.attr('data-swiper-slide-index') + "\"]").addClass(params.slideDuplicateNextClass);
}
if (prevSlide.hasClass(params.slideDuplicateClass)) {
$wrapperEl.children("." + params.slideClass + ":not(." + params.slideDuplicateClass + ")[data-swiper-slide-index=\"" + prevSlide.attr('data-swiper-slide-index') + "\"]").addClass(params.slideDuplicatePrevClass);
} else {
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass + "[data-swiper-slide-index=\"" + prevSlide.attr('data-swiper-slide-index') + "\"]").addClass(params.slideDuplicatePrevClass);
}
}
swiper.emitSlidesClasses();
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/updateActiveIndex.js
import { extend } from '../../../utils/utils';
export default function updateActiveIndex(newActiveIndex) {
var swiper = this;
var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
var slidesGrid = swiper.slidesGrid,
snapGrid = swiper.snapGrid,
params = swiper.params,
previousIndex = swiper.activeIndex,
previousRealIndex = swiper.realIndex,
previousSnapIndex = swiper.snapIndex;
var activeIndex = newActiveIndex;
var snapIndex;
if (typeof activeIndex === 'undefined') {
for (var i = 0; i < slidesGrid.length; i += 1) {
if (typeof slidesGrid[i + 1] !== 'undefined') {
if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
activeIndex = i;
} else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
activeIndex = i + 1;
}
} else if (translate >= slidesGrid[i]) {
activeIndex = i;
}
} // Normalize slideIndex
if (params.normalizeSlideIndex) {
if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;
}
}
if (snapGrid.indexOf(translate) >= 0) {
snapIndex = snapGrid.indexOf(translate);
} else {
var skip = Math.min(params.slidesPerGroupSkip, activeIndex);
snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
}
if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
if (activeIndex === previousIndex) {
if (snapIndex !== previousSnapIndex) {
swiper.snapIndex = snapIndex;
swiper.emit('snapIndexChange');
}
return;
} // Get real index
var realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10);
extend(swiper, {
snapIndex: snapIndex,
realIndex: realIndex,
previousIndex: previousIndex,
activeIndex: activeIndex
});
swiper.emit('activeIndexChange');
swiper.emit('snapIndexChange');
if (previousRealIndex !== realIndex) {
swiper.emit('realIndexChange');
}
if (swiper.initialized || swiper.params.runCallbacksOnInit) {
swiper.emit('slideChange');
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/update/updateClickedSlide.js
import $ from '../../../utils/dom';
export default function updateClickedSlide(e) {
var swiper = this;
var params = swiper.params;
var slide = $(e.target).closest("." + params.slideClass)[0];
var slideFound = false;
var slideIndex;
if (slide) {
for (var i = 0; i < swiper.slides.length; i += 1) {
if (swiper.slides[i] === slide) {
slideFound = true;
slideIndex = i;
break;
}
}
}
if (slide && slideFound) {
swiper.clickedSlide = slide;
if (swiper.virtual && swiper.params.virtual.enabled) {
swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10);
} else {
swiper.clickedIndex = slideIndex;
}
} else {
swiper.clickedSlide = undefined;
swiper.clickedIndex = undefined;
return;
}
if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {
swiper.slideToClickedSlide();
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/slide/index.js
import slideTo from './slideTo';
import slideToLoop from './slideToLoop';
import slideNext from './slideNext';
import slidePrev from './slidePrev';
import slideReset from './slideReset';
import slideToClosest from './slideToClosest';
import slideToClickedSlide from './slideToClickedSlide';
export default {
slideTo: slideTo,
slideToLoop: slideToLoop,
slideNext: slideNext,
slidePrev: slidePrev,
slideReset: slideReset,
slideToClosest: slideToClosest,
slideToClickedSlide: slideToClickedSlide
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/slide/slideTo.js
export default function slideTo(index, speed, runCallbacks, internal, initial) {
if (index === void 0) {
index = 0;
}
if (speed === void 0) {
speed = this.params.speed;
}
if (runCallbacks === void 0) {
runCallbacks = true;
}
if (typeof index !== 'number' && typeof index !== 'string') {
throw new Error("The 'index' argument cannot have type other than 'number' or 'string'. [" + typeof index + "] given.");
}
if (typeof index === 'string') {
/**
* The `index` argument converted from `string` to `number`.
* @type {number}
*/
var indexAsNumber = parseInt(index, 10);
/**
* Determines whether the `index` argument is a valid `number`
* after being converted from the `string` type.
* @type {boolean}
*/
var isValidNumber = isFinite(indexAsNumber);
if (!isValidNumber) {
throw new Error("The passed-in 'index' (string) couldn't be converted to 'number'. [" + index + "] given.");
} // Knowing that the converted `index` is a valid number,
// we can update the original argument's value.
index = indexAsNumber;
}
var swiper = this;
var slideIndex = index;
if (slideIndex < 0) slideIndex = 0;
var params = swiper.params,
snapGrid = swiper.snapGrid,
slidesGrid = swiper.slidesGrid,
previousIndex = swiper.previousIndex,
activeIndex = swiper.activeIndex,
rtl = swiper.rtlTranslate,
wrapperEl = swiper.wrapperEl,
enabled = swiper.enabled;
if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
return false;
}
var skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
var snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) {
swiper.emit('beforeSlideChangeStart');
}
var translate = -snapGrid[snapIndex]; // Update progress
swiper.updateProgress(translate); // Normalize slideIndex
if (params.normalizeSlideIndex) {
for (var i = 0; i < slidesGrid.length; i += 1) {
var normalizedTranslate = -Math.floor(translate * 100);
var normalizedGird = Math.floor(slidesGrid[i] * 100);
var normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);
if (typeof slidesGrid[i + 1] !== 'undefined') {
if (normalizedTranslate >= normalizedGird && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGird) / 2) {
slideIndex = i;
} else if (normalizedTranslate >= normalizedGird && normalizedTranslate < normalizedGridNext) {
slideIndex = i + 1;
}
} else if (normalizedTranslate >= normalizedGird) {
slideIndex = i;
}
}
} // Directions locks
if (swiper.initialized && slideIndex !== activeIndex) {
if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {
return false;
}
if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
if ((activeIndex || 0) !== slideIndex) return false;
}
}
var direction;
if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; // Update Index
if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
swiper.updateActiveIndex(slideIndex); // Update Height
if (params.autoHeight) {
swiper.updateAutoHeight();
}
swiper.updateSlidesClasses();
if (params.effect !== 'slide') {
swiper.setTranslate(translate);
}
if (direction !== 'reset') {
swiper.transitionStart(runCallbacks, direction);
swiper.transitionEnd(runCallbacks, direction);
}
return false;
}
if (params.cssMode) {
var isH = swiper.isHorizontal();
var t = -translate;
if (rtl) {
t = wrapperEl.scrollWidth - wrapperEl.offsetWidth - t;
}
if (speed === 0) {
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
} else {
// eslint-disable-next-line
if (wrapperEl.scrollTo) {
var _wrapperEl$scrollTo;
wrapperEl.scrollTo((_wrapperEl$scrollTo = {}, _wrapperEl$scrollTo[isH ? 'left' : 'top'] = t, _wrapperEl$scrollTo.behavior = 'smooth', _wrapperEl$scrollTo));
} else {
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
}
}
return true;
}
if (speed === 0) {
swiper.setTransition(0);
swiper.setTranslate(translate);
swiper.updateActiveIndex(slideIndex);
swiper.updateSlidesClasses();
swiper.emit('beforeTransitionStart', speed, internal);
swiper.transitionStart(runCallbacks, direction);
swiper.transitionEnd(runCallbacks, direction);
} else {
swiper.setTransition(speed);
swiper.setTranslate(translate);
swiper.updateActiveIndex(slideIndex);
swiper.updateSlidesClasses();
swiper.emit('beforeTransitionStart', speed, internal);
swiper.transitionStart(runCallbacks, direction);
if (!swiper.animating) {
swiper.animating = true;
if (!swiper.onSlideToWrapperTransitionEnd) {
swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
if (!swiper || swiper.destroyed) return;
if (e.target !== this) return;
swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
swiper.onSlideToWrapperTransitionEnd = null;
delete swiper.onSlideToWrapperTransitionEnd;
swiper.transitionEnd(runCallbacks, direction);
};
}
swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
}
}
return true;
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/slide/slideToLoop.js
export default function slideToLoop(index, speed, runCallbacks, internal) {
if (index === void 0) {
index = 0;
}
if (speed === void 0) {
speed = this.params.speed;
}
if (runCallbacks === void 0) {
runCallbacks = true;
}
var swiper = this;
var newIndex = index;
if (swiper.params.loop) {
newIndex += swiper.loopedSlides;
}
return swiper.slideTo(newIndex, speed, runCallbacks, internal);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/slide/slideNext.js
/* eslint no-unused-vars: "off" */
export default function slideNext(speed, runCallbacks, internal) {
if (speed === void 0) {
speed = this.params.speed;
}
if (runCallbacks === void 0) {
runCallbacks = true;
}
var swiper = this;
var params = swiper.params,
animating = swiper.animating,
enabled = swiper.enabled;
if (!enabled) return swiper;
var increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup;
if (params.loop) {
if (animating && params.loopPreventsSlide) return false;
swiper.loopFix(); // eslint-disable-next-line
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
}
return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/slide/slidePrev.js
/* eslint no-unused-vars: "off" */
export default function slidePrev(speed, runCallbacks, internal) {
if (speed === void 0) {
speed = this.params.speed;
}
if (runCallbacks === void 0) {
runCallbacks = true;
}
var swiper = this;
var params = swiper.params,
animating = swiper.animating,
snapGrid = swiper.snapGrid,
slidesGrid = swiper.slidesGrid,
rtlTranslate = swiper.rtlTranslate,
enabled = swiper.enabled;
if (!enabled) return swiper;
if (params.loop) {
if (animating && params.loopPreventsSlide) return false;
swiper.loopFix(); // eslint-disable-next-line
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
}
var translate = rtlTranslate ? swiper.translate : -swiper.translate;
function normalize(val) {
if (val < 0) return -Math.floor(Math.abs(val));
return Math.floor(val);
}
var normalizedTranslate = normalize(translate);
var normalizedSnapGrid = snapGrid.map(function (val) {
return normalize(val);
});
var prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
if (typeof prevSnap === 'undefined' && params.cssMode) {
snapGrid.forEach(function (snap) {
if (!prevSnap && normalizedTranslate >= snap) prevSnap = snap;
});
}
var prevIndex;
if (typeof prevSnap !== 'undefined') {
prevIndex = slidesGrid.indexOf(prevSnap);
if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;
}
return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/slide/slideReset.js
/* eslint no-unused-vars: "off" */
export default function slideReset(speed, runCallbacks, internal) {
if (speed === void 0) {
speed = this.params.speed;
}
if (runCallbacks === void 0) {
runCallbacks = true;
}
var swiper = this;
return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/slide/slideToClosest.js
/* eslint no-unused-vars: "off" */
export default function slideToClosest(speed, runCallbacks, internal, threshold) {
if (speed === void 0) {
speed = this.params.speed;
}
if (runCallbacks === void 0) {
runCallbacks = true;
}
if (threshold === void 0) {
threshold = 0.5;
}
var swiper = this;
var index = swiper.activeIndex;
var skip = Math.min(swiper.params.slidesPerGroupSkip, index);
var snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
if (translate >= swiper.snapGrid[snapIndex]) {
// The current translate is on or after the current snap index, so the choice
// is between the current index and the one after it.
var currentSnap = swiper.snapGrid[snapIndex];
var nextSnap = swiper.snapGrid[snapIndex + 1];
if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {
index += swiper.params.slidesPerGroup;
}
} else {
// The current translate is before the current snap index, so the choice
// is between the current index and the one before it.
var prevSnap = swiper.snapGrid[snapIndex - 1];
var _currentSnap = swiper.snapGrid[snapIndex];
if (translate - prevSnap <= (_currentSnap - prevSnap) * threshold) {
index -= swiper.params.slidesPerGroup;
}
}
index = Math.max(index, 0);
index = Math.min(index, swiper.slidesGrid.length - 1);
return swiper.slideTo(index, speed, runCallbacks, internal);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/slide/slideToClickedSlide.js
import $ from '../../../utils/dom';
import { nextTick } from '../../../utils/utils';
export default function slideToClickedSlide() {
var swiper = this;
var params = swiper.params,
$wrapperEl = swiper.$wrapperEl;
var slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
var slideToIndex = swiper.clickedIndex;
var realIndex;
if (params.loop) {
if (swiper.animating) return;
realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);
if (params.centeredSlides) {
if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
swiper.loopFix();
slideToIndex = $wrapperEl.children("." + params.slideClass + "[data-swiper-slide-index=\"" + realIndex + "\"]:not(." + params.slideDuplicateClass + ")").eq(0).index();
nextTick(function () {
swiper.slideTo(slideToIndex);
});
} else {
swiper.slideTo(slideToIndex);
}
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
swiper.loopFix();
slideToIndex = $wrapperEl.children("." + params.slideClass + "[data-swiper-slide-index=\"" + realIndex + "\"]:not(." + params.slideDuplicateClass + ")").eq(0).index();
nextTick(function () {
swiper.slideTo(slideToIndex);
});
} else {
swiper.slideTo(slideToIndex);
}
} else {
swiper.slideTo(slideToIndex);
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/loop/index.js
import loopCreate from './loopCreate';
import loopFix from './loopFix';
import loopDestroy from './loopDestroy';
export default {
loopCreate: loopCreate,
loopFix: loopFix,
loopDestroy: loopDestroy
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/loop/loopCreate.js
import { getDocument } from 'ssr-window';
import $ from '../../../utils/dom';
export default function loopCreate() {
var swiper = this;
var document = getDocument();
var params = swiper.params,
$wrapperEl = swiper.$wrapperEl; // Remove duplicated slides
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass).remove();
var slides = $wrapperEl.children("." + params.slideClass);
if (params.loopFillGroupWithBlank) {
var blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup;
if (blankSlidesNum !== params.slidesPerGroup) {
for (var i = 0; i < blankSlidesNum; i += 1) {
var blankNode = $(document.createElement('div')).addClass(params.slideClass + " " + params.slideBlankClass);
$wrapperEl.append(blankNode);
}
slides = $wrapperEl.children("." + params.slideClass);
}
}
if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length;
swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));
swiper.loopedSlides += params.loopAdditionalSlides;
if (swiper.loopedSlides > slides.length) {
swiper.loopedSlides = slides.length;
}
var prependSlides = [];
var appendSlides = [];
slides.each(function (el, index) {
var slide = $(el);
if (index < swiper.loopedSlides) {
appendSlides.push(el);
}
if (index < slides.length && index >= slides.length - swiper.loopedSlides) {
prependSlides.push(el);
}
slide.attr('data-swiper-slide-index', index);
});
for (var _i = 0; _i < appendSlides.length; _i += 1) {
$wrapperEl.append($(appendSlides[_i].cloneNode(true)).addClass(params.slideDuplicateClass));
}
for (var _i2 = prependSlides.length - 1; _i2 >= 0; _i2 -= 1) {
$wrapperEl.prepend($(prependSlides[_i2].cloneNode(true)).addClass(params.slideDuplicateClass));
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/loop/loopFix.js
export default function loopFix() {
var swiper = this;
swiper.emit('beforeLoopFix');
var activeIndex = swiper.activeIndex,
slides = swiper.slides,
loopedSlides = swiper.loopedSlides,
allowSlidePrev = swiper.allowSlidePrev,
allowSlideNext = swiper.allowSlideNext,
snapGrid = swiper.snapGrid,
rtl = swiper.rtlTranslate;
var newIndex;
swiper.allowSlidePrev = true;
swiper.allowSlideNext = true;
var snapTranslate = -snapGrid[activeIndex];
var diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding
if (activeIndex < loopedSlides) {
newIndex = slides.length - loopedSlides * 3 + activeIndex;
newIndex += loopedSlides;
var slideChanged = swiper.slideTo(newIndex, 0, false, true);
if (slideChanged && diff !== 0) {
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
}
} else if (activeIndex >= slides.length - loopedSlides) {
// Fix For Positive Oversliding
newIndex = -slides.length + activeIndex + loopedSlides;
newIndex += loopedSlides;
var _slideChanged = swiper.slideTo(newIndex, 0, false, true);
if (_slideChanged && diff !== 0) {
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
}
}
swiper.allowSlidePrev = allowSlidePrev;
swiper.allowSlideNext = allowSlideNext;
swiper.emit('loopFix');
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/loop/loopDestroy.js
export default function loopDestroy() {
var swiper = this;
var $wrapperEl = swiper.$wrapperEl,
params = swiper.params,
slides = swiper.slides;
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass + ",." + params.slideClass + "." + params.slideBlankClass).remove();
slides.removeAttr('data-swiper-slide-index');
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/events/onTouchStart.js
import { getWindow, getDocument } from 'ssr-window';
import $ from '../../../utils/dom';
import { extend, now } from '../../../utils/utils'; // Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
function closestElement(selector, base) {
if (base === void 0) {
base = this;
}
function __closestFrom(el) {
if (!el || el === getDocument() || el === getWindow()) return null;
if (el.assignedSlot) el = el.assignedSlot;
var found = el.closest(selector);
return found || __closestFrom(el.getRootNode().host);
}
return __closestFrom(base);
}
export default function onTouchStart(event) {
var swiper = this;
var document = getDocument();
var window = getWindow();
var data = swiper.touchEventsData;
var params = swiper.params,
touches = swiper.touches,
enabled = swiper.enabled;
if (!enabled) return;
if (swiper.animating && params.preventInteractionOnTransition) {
return;
}
var e = event;
if (e.originalEvent) e = e.originalEvent;
var $targetEl = $(e.target);
if (params.touchEventsTarget === 'wrapper') {
if (!$targetEl.closest(swiper.wrapperEl).length) return;
}
data.isTouchEvent = e.type === 'touchstart';
if (!data.isTouchEvent && 'which' in e && e.which === 3) return;
if (!data.isTouchEvent && 'button' in e && e.button > 0) return;
if (data.isTouched && data.isMoved) return; // change target el for shadow root component
var swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';
if (swipingClassHasValue && e.target && e.target.shadowRoot && event.path && event.path[0]) {
$targetEl = $(event.path[0]);
}
var noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : "." + params.noSwipingClass;
var isTargetShadow = !!(e.target && e.target.shadowRoot); // use closestElement for shadow root element to get the actual closest for nested shadow root element
if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, e.target) : $targetEl.closest(noSwipingSelector)[0])) {
swiper.allowClick = true;
return;
}
if (params.swipeHandler) {
if (!$targetEl.closest(params.swipeHandler)[0]) return;
}
touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
var startX = touches.currentX;
var startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
var edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
var edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
if (edgeSwipeDetection === 'prevent') {
event.preventDefault();
} else {
return;
}
}
extend(data, {
isTouched: true,
isMoved: false,
allowTouchCallbacks: true,
isScrolling: undefined,
startMoving: undefined
});
touches.startX = startX;
touches.startY = startY;
data.touchStartTime = now();
swiper.allowClick = true;
swiper.updateSize();
swiper.swipeDirection = undefined;
if (params.threshold > 0) data.allowThresholdMove = false;
if (e.type !== 'touchstart') {
var preventDefault = true;
if ($targetEl.is(data.focusableElements)) preventDefault = false;
if (document.activeElement && $(document.activeElement).is(data.focusableElements) && document.activeElement !== $targetEl[0]) {
document.activeElement.blur();
}
var shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !$targetEl[0].isContentEditable) {
e.preventDefault();
}
}
swiper.emit('touchStart', e);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/events/onTouchMove.js
import { getDocument } from 'ssr-window';
import $ from '../../../utils/dom';
import { extend, now } from '../../../utils/utils';
export default function onTouchMove(event) {
var document = getDocument();
var swiper = this;
var data = swiper.touchEventsData;
var params = swiper.params,
touches = swiper.touches,
rtl = swiper.rtlTranslate,
enabled = swiper.enabled;
if (!enabled) return;
var e = event;
if (e.originalEvent) e = e.originalEvent;
if (!data.isTouched) {
if (data.startMoving && data.isScrolling) {
swiper.emit('touchMoveOpposite', e);
}
return;
}
if (data.isTouchEvent && e.type !== 'touchmove') return;
var targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);
var pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;
var pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;
if (e.preventedByNestedSwiper) {
touches.startX = pageX;
touches.startY = pageY;
return;
}
if (!swiper.allowTouchMove) {
// isMoved = true;
swiper.allowClick = false;
if (data.isTouched) {
extend(touches, {
startX: pageX,
startY: pageY,
currentX: pageX,
currentY: pageY
});
data.touchStartTime = now();
}
return;
}
if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {
if (swiper.isVertical()) {
// Vertical
if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {
data.isTouched = false;
data.isMoved = false;
return;
}
} else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
return;
}
}
if (data.isTouchEvent && document.activeElement) {
if (e.target === document.activeElement && $(e.target).is(data.focusableElements)) {
data.isMoved = true;
swiper.allowClick = false;
return;
}
}
if (data.allowTouchCallbacks) {
swiper.emit('touchMove', e);
}
if (e.targetTouches && e.targetTouches.length > 1) return;
touches.currentX = pageX;
touches.currentY = pageY;
var diffX = touches.currentX - touches.startX;
var diffY = touches.currentY - touches.startY;
if (swiper.params.threshold && Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2)) < swiper.params.threshold) return;
if (typeof data.isScrolling === 'undefined') {
var touchAngle;
if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {
data.isScrolling = false;
} else {
// eslint-disable-next-line
if (diffX * diffX + diffY * diffY >= 25) {
touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;
data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;
}
}
}
if (data.isScrolling) {
swiper.emit('touchMoveOpposite', e);
}
if (typeof data.startMoving === 'undefined') {
if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
data.startMoving = true;
}
}
if (data.isScrolling) {
data.isTouched = false;
return;
}
if (!data.startMoving) {
return;
}
swiper.allowClick = false;
if (!params.cssMode && e.cancelable) {
e.preventDefault();
}
if (params.touchMoveStopPropagation && !params.nested) {
e.stopPropagation();
}
if (!data.isMoved) {
if (params.loop) {
swiper.loopFix();
}
data.startTranslate = swiper.getTranslate();
swiper.setTransition(0);
if (swiper.animating) {
swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');
}
data.allowMomentumBounce = false; // Grab Cursor
if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
swiper.setGrabCursor(true);
}
swiper.emit('sliderFirstMove', e);
}
swiper.emit('sliderMove', e);
data.isMoved = true;
var diff = swiper.isHorizontal() ? diffX : diffY;
touches.diff = diff;
diff *= params.touchRatio;
if (rtl) diff = -diff;
swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
data.currentTranslate = diff + data.startTranslate;
var disableParentSwiper = true;
var resistanceRatio = params.resistanceRatio;
if (params.touchReleaseOnEdges) {
resistanceRatio = 0;
}
if (diff > 0 && data.currentTranslate > swiper.minTranslate()) {
disableParentSwiper = false;
if (params.resistance) data.currentTranslate = swiper.minTranslate() - 1 + Math.pow(-swiper.minTranslate() + data.startTranslate + diff, resistanceRatio);
} else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {
disableParentSwiper = false;
if (params.resistance) data.currentTranslate = swiper.maxTranslate() + 1 - Math.pow(swiper.maxTranslate() - data.startTranslate - diff, resistanceRatio);
}
if (disableParentSwiper) {
e.preventedByNestedSwiper = true;
} // Directions locks
if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
data.currentTranslate = data.startTranslate;
}
if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
data.currentTranslate = data.startTranslate;
}
if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {
data.currentTranslate = data.startTranslate;
} // Threshold
if (params.threshold > 0) {
if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
if (!data.allowThresholdMove) {
data.allowThresholdMove = true;
touches.startX = touches.currentX;
touches.startY = touches.currentY;
data.currentTranslate = data.startTranslate;
touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
return;
}
} else {
data.currentTranslate = data.startTranslate;
return;
}
}
if (!params.followFinger || params.cssMode) return; // Update active index in free mode
if (params.freeMode || params.watchSlidesProgress || params.watchSlidesVisibility) {
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
}
if (params.freeMode) {
// Velocity
if (data.velocities.length === 0) {
data.velocities.push({
position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
time: data.touchStartTime
});
}
data.velocities.push({
position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
time: now()
});
} // Update progress
swiper.updateProgress(data.currentTranslate); // Update translate
swiper.setTranslate(data.currentTranslate);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/events/onTouchEnd.js
import { now, nextTick } from '../../../utils/utils';
export default function onTouchEnd(event) {
var swiper = this;
var data = swiper.touchEventsData;
var params = swiper.params,
touches = swiper.touches,
rtl = swiper.rtlTranslate,
$wrapperEl = swiper.$wrapperEl,
slidesGrid = swiper.slidesGrid,
snapGrid = swiper.snapGrid,
enabled = swiper.enabled;
if (!enabled) return;
var e = event;
if (e.originalEvent) e = e.originalEvent;
if (data.allowTouchCallbacks) {
swiper.emit('touchEnd', e);
}
data.allowTouchCallbacks = false;
if (!data.isTouched) {
if (data.isMoved && params.grabCursor) {
swiper.setGrabCursor(false);
}
data.isMoved = false;
data.startMoving = false;
return;
} // Return Grab Cursor
if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
swiper.setGrabCursor(false);
} // Time diff
var touchEndTime = now();
var timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click
if (swiper.allowClick) {
swiper.updateClickedSlide(e);
swiper.emit('tap click', e);
if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {
swiper.emit('doubleTap doubleClick', e);
}
}
data.lastClickTime = now();
nextTick(function () {
if (!swiper.destroyed) swiper.allowClick = true;
});
if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
data.isTouched = false;
data.isMoved = false;
data.startMoving = false;
return;
}
data.isTouched = false;
data.isMoved = false;
data.startMoving = false;
var currentPos;
if (params.followFinger) {
currentPos = rtl ? swiper.translate : -swiper.translate;
} else {
currentPos = -data.currentTranslate;
}
if (params.cssMode) {
return;
}
if (params.freeMode) {
if (currentPos < -swiper.minTranslate()) {
swiper.slideTo(swiper.activeIndex);
return;
}
if (currentPos > -swiper.maxTranslate()) {
if (swiper.slides.length < snapGrid.length) {
swiper.slideTo(snapGrid.length - 1);
} else {
swiper.slideTo(swiper.slides.length - 1);
}
return;
}
if (params.freeModeMomentum) {
if (data.velocities.length > 1) {
var lastMoveEvent = data.velocities.pop();
var velocityEvent = data.velocities.pop();
var distance = lastMoveEvent.position - velocityEvent.position;
var time = lastMoveEvent.time - velocityEvent.time;
swiper.velocity = distance / time;
swiper.velocity /= 2;
if (Math.abs(swiper.velocity) < params.freeModeMinimumVelocity) {
swiper.velocity = 0;
} // this implies that the user stopped moving a finger then released.
// There would be no events with distance zero, so the last event is stale.
if (time > 150 || now() - lastMoveEvent.time > 300) {
swiper.velocity = 0;
}
} else {
swiper.velocity = 0;
}
swiper.velocity *= params.freeModeMomentumVelocityRatio;
data.velocities.length = 0;
var momentumDuration = 1000 * params.freeModeMomentumRatio;
var momentumDistance = swiper.velocity * momentumDuration;
var newPosition = swiper.translate + momentumDistance;
if (rtl) newPosition = -newPosition;
var doBounce = false;
var afterBouncePosition;
var bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeModeMomentumBounceRatio;
var needsLoopFix;
if (newPosition < swiper.maxTranslate()) {
if (params.freeModeMomentumBounce) {
if (newPosition + swiper.maxTranslate() < -bounceAmount) {
newPosition = swiper.maxTranslate() - bounceAmount;
}
afterBouncePosition = swiper.maxTranslate();
doBounce = true;
data.allowMomentumBounce = true;
} else {
newPosition = swiper.maxTranslate();
}
if (params.loop && params.centeredSlides) needsLoopFix = true;
} else if (newPosition > swiper.minTranslate()) {
if (params.freeModeMomentumBounce) {
if (newPosition - swiper.minTranslate() > bounceAmount) {
newPosition = swiper.minTranslate() + bounceAmount;
}
afterBouncePosition = swiper.minTranslate();
doBounce = true;
data.allowMomentumBounce = true;
} else {
newPosition = swiper.minTranslate();
}
if (params.loop && params.centeredSlides) needsLoopFix = true;
} else if (params.freeModeSticky) {
var nextSlide;
for (var j = 0; j < snapGrid.length; j += 1) {
if (snapGrid[j] > -newPosition) {
nextSlide = j;
break;
}
}
if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
newPosition = snapGrid[nextSlide];
} else {
newPosition = snapGrid[nextSlide - 1];
}
newPosition = -newPosition;
}
if (needsLoopFix) {
swiper.once('transitionEnd', function () {
swiper.loopFix();
});
} // Fix duration
if (swiper.velocity !== 0) {
if (rtl) {
momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
} else {
momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
}
if (params.freeModeSticky) {
// If freeModeSticky is active and the user ends a swipe with a slow-velocity
// event, then durations can be 20+ seconds to slide one (or zero!) slides.
// It's easy to see this when simulating touch with mouse events. To fix this,
// limit single-slide swipes to the default slide duration. This also has the
// nice side effect of matching slide speed if the user stopped moving before
// lifting finger or mouse vs. moving slowly before lifting the finger/mouse.
// For faster swipes, also apply limits (albeit higher ones).
var moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
var currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
if (moveDistance < currentSlideSize) {
momentumDuration = params.speed;
} else if (moveDistance < 2 * currentSlideSize) {
momentumDuration = params.speed * 1.5;
} else {
momentumDuration = params.speed * 2.5;
}
}
} else if (params.freeModeSticky) {
swiper.slideToClosest();
return;
}
if (params.freeModeMomentumBounce && doBounce) {
swiper.updateProgress(afterBouncePosition);
swiper.setTransition(momentumDuration);
swiper.setTranslate(newPosition);
swiper.transitionStart(true, swiper.swipeDirection);
swiper.animating = true;
$wrapperEl.transitionEnd(function () {
if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;
swiper.emit('momentumBounce');
swiper.setTransition(params.speed);
setTimeout(function () {
swiper.setTranslate(afterBouncePosition);
$wrapperEl.transitionEnd(function () {
if (!swiper || swiper.destroyed) return;
swiper.transitionEnd();
});
}, 0);
});
} else if (swiper.velocity) {
swiper.updateProgress(newPosition);
swiper.setTransition(momentumDuration);
swiper.setTranslate(newPosition);
swiper.transitionStart(true, swiper.swipeDirection);
if (!swiper.animating) {
swiper.animating = true;
$wrapperEl.transitionEnd(function () {
if (!swiper || swiper.destroyed) return;
swiper.transitionEnd();
});
}
} else {
swiper.emit('_freeModeNoMomentumRelease');
swiper.updateProgress(newPosition);
}
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
} else if (params.freeModeSticky) {
swiper.slideToClosest();
return;
} else if (params.freeMode) {
swiper.emit('_freeModeNoMomentumRelease');
}
if (!params.freeModeMomentum || timeDiff >= params.longSwipesMs) {
swiper.updateProgress();
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
}
return;
} // Find current slide
var stopIndex = 0;
var groupSize = swiper.slidesSizesGrid[0];
for (var i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
var _increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
if (typeof slidesGrid[i + _increment] !== 'undefined') {
if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + _increment]) {
stopIndex = i;
groupSize = slidesGrid[i + _increment] - slidesGrid[i];
}
} else if (currentPos >= slidesGrid[i]) {
stopIndex = i;
groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
}
} // Find current slide size
var ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
var increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
if (timeDiff > params.longSwipesMs) {
// Long touches
if (!params.longSwipes) {
swiper.slideTo(swiper.activeIndex);
return;
}
if (swiper.swipeDirection === 'next') {
if (ratio >= params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex);
}
if (swiper.swipeDirection === 'prev') {
if (ratio > 1 - params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex);
}
} else {
// Short swipes
if (!params.shortSwipes) {
swiper.slideTo(swiper.activeIndex);
return;
}
var isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
if (!isNavButtonTarget) {
if (swiper.swipeDirection === 'next') {
swiper.slideTo(stopIndex + increment);
}
if (swiper.swipeDirection === 'prev') {
swiper.slideTo(stopIndex);
}
} else if (e.target === swiper.navigation.nextEl) {
swiper.slideTo(stopIndex + increment);
} else {
swiper.slideTo(stopIndex);
}
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/events/onResize.js
export default function onResize() {
var swiper = this;
var params = swiper.params,
el = swiper.el;
if (el && el.offsetWidth === 0) return; // Breakpoints
if (params.breakpoints) {
swiper.setBreakpoint();
} // Save locks
var allowSlideNext = swiper.allowSlideNext,
allowSlidePrev = swiper.allowSlidePrev,
snapGrid = swiper.snapGrid; // Disable locks on resize
swiper.allowSlideNext = true;
swiper.allowSlidePrev = true;
swiper.updateSize();
swiper.updateSlides();
swiper.updateSlidesClasses();
if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) {
swiper.slideTo(swiper.slides.length - 1, 0, false, true);
} else {
swiper.slideTo(swiper.activeIndex, 0, false, true);
}
if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
swiper.autoplay.run();
} // Return locks after resize
swiper.allowSlidePrev = allowSlidePrev;
swiper.allowSlideNext = allowSlideNext;
if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
swiper.checkOverflow();
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/events/onClick.js
export default function onClick(e) {
var swiper = this;
if (!swiper.enabled) return;
if (!swiper.allowClick) {
if (swiper.params.preventClicks) e.preventDefault();
if (swiper.params.preventClicksPropagation && swiper.animating) {
e.stopPropagation();
e.stopImmediatePropagation();
}
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/events/onScroll.js
export default function onScroll() {
var swiper = this;
var wrapperEl = swiper.wrapperEl,
rtlTranslate = swiper.rtlTranslate,
enabled = swiper.enabled;
if (!enabled) return;
swiper.previousTranslate = swiper.translate;
if (swiper.isHorizontal()) {
if (rtlTranslate) {
swiper.translate = wrapperEl.scrollWidth - wrapperEl.offsetWidth - wrapperEl.scrollLeft;
} else {
swiper.translate = -wrapperEl.scrollLeft;
}
} else {
swiper.translate = -wrapperEl.scrollTop;
} // eslint-disable-next-line
if (swiper.translate === -0) swiper.translate = 0;
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
var newProgress;
var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
if (translatesDiff === 0) {
newProgress = 0;
} else {
newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;
}
if (newProgress !== swiper.progress) {
swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
}
swiper.emit('setTranslate', swiper.translate, false);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/events/index.js
import { getDocument } from 'ssr-window';
import onTouchStart from './onTouchStart';
import onTouchMove from './onTouchMove';
import onTouchEnd from './onTouchEnd';
import onResize from './onResize';
import onClick from './onClick';
import onScroll from './onScroll';
var dummyEventAttached = false;
function dummyEventListener() {}
function attachEvents() {
var swiper = this;
var document = getDocument();
var params = swiper.params,
touchEvents = swiper.touchEvents,
el = swiper.el,
wrapperEl = swiper.wrapperEl,
device = swiper.device,
support = swiper.support;
swiper.onTouchStart = onTouchStart.bind(swiper);
swiper.onTouchMove = onTouchMove.bind(swiper);
swiper.onTouchEnd = onTouchEnd.bind(swiper);
if (params.cssMode) {
swiper.onScroll = onScroll.bind(swiper);
}
swiper.onClick = onClick.bind(swiper);
var capture = !!params.nested; // Touch Events
if (!support.touch && support.pointerEvents) {
el.addEventListener(touchEvents.start, swiper.onTouchStart, false);
document.addEventListener(touchEvents.move, swiper.onTouchMove, capture);
document.addEventListener(touchEvents.end, swiper.onTouchEnd, false);
} else {
if (support.touch) {
var passiveListener = touchEvents.start === 'touchstart' && support.passiveListener && params.passiveListeners ? {
passive: true,
capture: false
} : false;
el.addEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
el.addEventListener(touchEvents.move, swiper.onTouchMove, support.passiveListener ? {
passive: false,
capture: capture
} : capture);
el.addEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
if (touchEvents.cancel) {
el.addEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);
}
if (!dummyEventAttached) {
document.addEventListener('touchstart', dummyEventListener);
dummyEventAttached = true;
}
}
if (params.simulateTouch && !device.ios && !device.android || params.simulateTouch && !support.touch && device.ios) {
el.addEventListener('mousedown', swiper.onTouchStart, false);
document.addEventListener('mousemove', swiper.onTouchMove, capture);
document.addEventListener('mouseup', swiper.onTouchEnd, false);
}
} // Prevent Links Clicks
if (params.preventClicks || params.preventClicksPropagation) {
el.addEventListener('click', swiper.onClick, true);
}
if (params.cssMode) {
wrapperEl.addEventListener('scroll', swiper.onScroll);
} // Resize handler
if (params.updateOnWindowResize) {
swiper.on(device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);
} else {
swiper.on('observerUpdate', onResize, true);
}
}
function detachEvents() {
var swiper = this;
var document = getDocument();
var params = swiper.params,
touchEvents = swiper.touchEvents,
el = swiper.el,
wrapperEl = swiper.wrapperEl,
device = swiper.device,
support = swiper.support;
var capture = !!params.nested; // Touch Events
if (!support.touch && support.pointerEvents) {
el.removeEventListener(touchEvents.start, swiper.onTouchStart, false);
document.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
document.removeEventListener(touchEvents.end, swiper.onTouchEnd, false);
} else {
if (support.touch) {
var passiveListener = touchEvents.start === 'onTouchStart' && support.passiveListener && params.passiveListeners ? {
passive: true,
capture: false
} : false;
el.removeEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
el.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
el.removeEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
if (touchEvents.cancel) {
el.removeEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);
}
}
if (params.simulateTouch && !device.ios && !device.android || params.simulateTouch && !support.touch && device.ios) {
el.removeEventListener('mousedown', swiper.onTouchStart, false);
document.removeEventListener('mousemove', swiper.onTouchMove, capture);
document.removeEventListener('mouseup', swiper.onTouchEnd, false);
}
} // Prevent Links Clicks
if (params.preventClicks || params.preventClicksPropagation) {
el.removeEventListener('click', swiper.onClick, true);
}
if (params.cssMode) {
wrapperEl.removeEventListener('scroll', swiper.onScroll);
} // Resize handler
swiper.off(device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize);
}
export default {
attachEvents: attachEvents,
detachEvents: detachEvents
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/classes/index.js
import addClasses from './addClasses';
import removeClasses from './removeClasses';
export default {
addClasses: addClasses,
removeClasses: removeClasses
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/classes/addClasses.js
function prepareClasses(entries, prefix) {
var resultClasses = [];
entries.forEach(function (item) {
if (typeof item === 'object') {
Object.keys(item).forEach(function (classNames) {
if (item[classNames]) {
resultClasses.push(prefix + classNames);
}
});
} else if (typeof item === 'string') {
resultClasses.push(prefix + item);
}
});
return resultClasses;
}
export default function addClasses() {
var swiper = this;
var classNames = swiper.classNames,
params = swiper.params,
rtl = swiper.rtl,
$el = swiper.$el,
device = swiper.device,
support = swiper.support; // prettier-ignore
var suffixes = prepareClasses(['initialized', params.direction, {
'pointer-events': support.pointerEvents && !support.touch
}, {
'free-mode': params.freeMode
}, {
'autoheight': params.autoHeight
}, {
'rtl': rtl
}, {
'multirow': params.slidesPerColumn > 1
}, {
'multirow-column': params.slidesPerColumn > 1 && params.slidesPerColumnFill === 'column'
}, {
'android': device.android
}, {
'ios': device.ios
}, {
'css-mode': params.cssMode
}], params.containerModifierClass);
classNames.push.apply(classNames, suffixes);
$el.addClass([].concat(classNames).join(' '));
swiper.emitContainerClasses();
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/classes/removeClasses.js
export default function removeClasses() {
var swiper = this;
var $el = swiper.$el,
classNames = swiper.classNames;
$el.removeClass(classNames.join(' '));
swiper.emitContainerClasses();
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/defaults.js
export default {
init: true,
direction: 'horizontal',
touchEventsTarget: 'container',
initialSlide: 0,
speed: 300,
cssMode: false,
updateOnWindowResize: true,
resizeObserver: false,
nested: false,
createElements: false,
enabled: true,
focusableElements: 'input, select, option, textarea, button, video, label',
// Overrides
width: null,
height: null,
//
preventInteractionOnTransition: false,
// ssr
userAgent: null,
url: null,
// To support iOS's swipe-to-go-back gesture (when being used in-app).
edgeSwipeDetection: false,
edgeSwipeThreshold: 20,
// Free mode
freeMode: false,
freeModeMomentum: true,
freeModeMomentumRatio: 1,
freeModeMomentumBounce: true,
freeModeMomentumBounceRatio: 1,
freeModeMomentumVelocityRatio: 1,
freeModeSticky: false,
freeModeMinimumVelocity: 0.02,
// Autoheight
autoHeight: false,
// Set wrapper width
setWrapperSize: false,
// Virtual Translate
virtualTranslate: false,
// Effects
effect: 'slide',
// 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
// Breakpoints
breakpoints: undefined,
breakpointsBase: 'window',
// Slides grid
spaceBetween: 0,
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerColumnFill: 'column',
slidesPerGroup: 1,
slidesPerGroupSkip: 0,
centeredSlides: false,
centeredSlidesBounds: false,
slidesOffsetBefore: 0,
// in px
slidesOffsetAfter: 0,
// in px
normalizeSlideIndex: true,
centerInsufficientSlides: false,
// Disable swiper and hide navigation when container not overflow
watchOverflow: false,
// Round length
roundLengths: false,
// Touches
touchRatio: 1,
touchAngle: 45,
simulateTouch: true,
shortSwipes: true,
longSwipes: true,
longSwipesRatio: 0.5,
longSwipesMs: 300,
followFinger: true,
allowTouchMove: true,
threshold: 0,
touchMoveStopPropagation: false,
touchStartPreventDefault: true,
touchStartForcePreventDefault: false,
touchReleaseOnEdges: false,
// Unique Navigation Elements
uniqueNavElements: true,
// Resistance
resistance: true,
resistanceRatio: 0.85,
// Progress
watchSlidesProgress: false,
watchSlidesVisibility: false,
// Cursor
grabCursor: false,
// Clicks
preventClicks: true,
preventClicksPropagation: true,
slideToClickedSlide: false,
// Images
preloadImages: true,
updateOnImagesReady: true,
// loop
loop: false,
loopAdditionalSlides: 0,
loopedSlides: null,
loopFillGroupWithBlank: false,
loopPreventsSlide: true,
// Swiping/no swiping
allowSlidePrev: true,
allowSlideNext: true,
swipeHandler: null,
// '.swipe-handler',
noSwiping: true,
noSwipingClass: 'swiper-no-swiping',
noSwipingSelector: null,
// Passive Listeners
passiveListeners: true,
// NS
containerModifierClass: 'swiper-container-',
// NEW
slideClass: 'swiper-slide',
slideBlankClass: 'swiper-slide-invisible-blank',
slideActiveClass: 'swiper-slide-active',
slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
slideVisibleClass: 'swiper-slide-visible',
slideDuplicateClass: 'swiper-slide-duplicate',
slideNextClass: 'swiper-slide-next',
slideDuplicateNextClass: 'swiper-slide-duplicate-next',
slidePrevClass: 'swiper-slide-prev',
slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
wrapperClass: 'swiper-wrapper',
// Callbacks
runCallbacksOnInit: true,
// Internals
_emitClasses: false
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/core-class.js
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
/* eslint no-param-reassign: "off" */
import { getDocument } from 'ssr-window';
import $ from '../../utils/dom';
import { extend, now, deleteProps } from '../../utils/utils';
import { getSupport } from '../../utils/get-support';
import { getDevice } from '../../utils/get-device';
import { getBrowser } from '../../utils/get-browser';
import Resize from '../../modules/resize/resize';
import Observer from '../../modules/observer/observer';
import modular from './modular';
import eventsEmitter from './events-emitter';
import update from './update/index';
import translate from './translate/index';
import transition from './transition/index';
import slide from './slide/index';
import loop from './loop/index';
import grabCursor from './grab-cursor/index';
import manipulation from './manipulation/index';
import events from './events/index';
import breakpoints from './breakpoints/index';
import classes from './classes/index';
import images from './images/index';
import checkOverflow from './check-overflow/index';
import defaults from './defaults';
var prototypes = {
modular: modular,
eventsEmitter: eventsEmitter,
update: update,
translate: translate,
transition: transition,
slide: slide,
loop: loop,
grabCursor: grabCursor,
manipulation: manipulation,
events: events,
breakpoints: breakpoints,
checkOverflow: checkOverflow,
classes: classes,
images: images
};
var extendedDefaults = {};
var Swiper = /*#__PURE__*/function () {
function Swiper() {
var el;
var params;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
params = args[0];
} else {
el = args[0];
params = args[1];
}
if (!params) params = {};
params = extend({}, params);
if (el && !params.el) params.el = el;
if (params.el && $(params.el).length > 1) {
var swipers = [];
$(params.el).each(function (containerEl) {
var newParams = extend({}, params, {
el: containerEl
});
swipers.push(new Swiper(newParams));
});
return swipers;
} // Swiper Instance
var swiper = this;
swiper.__swiper__ = true;
swiper.support = getSupport();
swiper.device = getDevice({
userAgent: params.userAgent
});
swiper.browser = getBrowser();
swiper.eventsListeners = {};
swiper.eventsAnyListeners = [];
if (typeof swiper.modules === 'undefined') {
swiper.modules = {};
}
Object.keys(swiper.modules).forEach(function (moduleName) {
var module = swiper.modules[moduleName];
if (module.params) {
var moduleParamName = Object.keys(module.params)[0];
var moduleParams = module.params[moduleParamName];
if (typeof moduleParams !== 'object' || moduleParams === null) return;
if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) {
params[moduleParamName] = {
auto: true
};
}
if (!(moduleParamName in params && 'enabled' in moduleParams)) return;
if (params[moduleParamName] === true) {
params[moduleParamName] = {
enabled: true
};
}
if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {
params[moduleParamName].enabled = true;
}
if (!params[moduleParamName]) params[moduleParamName] = {
enabled: false
};
}
}); // Extend defaults with modules params
var swiperParams = extend({}, defaults);
swiper.useParams(swiperParams); // Extend defaults with passed params
swiper.params = extend({}, swiperParams, extendedDefaults, params);
swiper.originalParams = extend({}, swiper.params);
swiper.passedParams = extend({}, params); // add event listeners
if (swiper.params && swiper.params.on) {
Object.keys(swiper.params.on).forEach(function (eventName) {
swiper.on(eventName, swiper.params.on[eventName]);
});
}
if (swiper.params && swiper.params.onAny) {
swiper.onAny(swiper.params.onAny);
} // Save Dom lib
swiper.$ = $; // Extend Swiper
extend(swiper, {
enabled: swiper.params.enabled,
el: el,
// Classes
classNames: [],
// Slides
slides: $(),
slidesGrid: [],
snapGrid: [],
slidesSizesGrid: [],
// isDirection
isHorizontal: function isHorizontal() {
return swiper.params.direction === 'horizontal';
},
isVertical: function isVertical() {
return swiper.params.direction === 'vertical';
},
// Indexes
activeIndex: 0,
realIndex: 0,
//
isBeginning: true,
isEnd: false,
// Props
translate: 0,
previousTranslate: 0,
progress: 0,
velocity: 0,
animating: false,
// Locks
allowSlideNext: swiper.params.allowSlideNext,
allowSlidePrev: swiper.params.allowSlidePrev,
// Touch Events
touchEvents: function touchEvents() {
var touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];
var desktop = ['mousedown', 'mousemove', 'mouseup'];
if (swiper.support.pointerEvents) {
desktop = ['pointerdown', 'pointermove', 'pointerup'];
}
swiper.touchEventsTouch = {
start: touch[0],
move: touch[1],
end: touch[2],
cancel: touch[3]
};
swiper.touchEventsDesktop = {
start: desktop[0],
move: desktop[1],
end: desktop[2]
};
return swiper.support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;
}(),
touchEventsData: {
isTouched: undefined,
isMoved: undefined,
allowTouchCallbacks: undefined,
touchStartTime: undefined,
isScrolling: undefined,
currentTranslate: undefined,
startTranslate: undefined,
allowThresholdMove: undefined,
// Form elements to match
focusableElements: swiper.params.focusableElements,
// Last click time
lastClickTime: now(),
clickTimeout: undefined,
// Velocities
velocities: [],
allowMomentumBounce: undefined,
isTouchEvent: undefined,
startMoving: undefined
},
// Clicks
allowClick: true,
// Touches
allowTouchMove: swiper.params.allowTouchMove,
touches: {
startX: 0,
startY: 0,
currentX: 0,
currentY: 0,
diff: 0
},
// Images
imagesToLoad: [],
imagesLoaded: 0
}); // Install Modules
swiper.useModules();
swiper.emit('_swiper'); // Init
if (swiper.params.init) {
swiper.init();
} // Return app instance
return swiper;
}
var _proto = Swiper.prototype;
_proto.enable = function enable() {
var swiper = this;
if (swiper.enabled) return;
swiper.enabled = true;
if (swiper.params.grabCursor) {
swiper.setGrabCursor();
}
swiper.emit('enable');
};
_proto.disable = function disable() {
var swiper = this;
if (!swiper.enabled) return;
swiper.enabled = false;
if (swiper.params.grabCursor) {
swiper.unsetGrabCursor();
}
swiper.emit('disable');
};
_proto.setProgress = function setProgress(progress, speed) {
var swiper = this;
progress = Math.min(Math.max(progress, 0), 1);
var min = swiper.minTranslate();
var max = swiper.maxTranslate();
var current = (max - min) * progress + min;
swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
};
_proto.emitContainerClasses = function emitContainerClasses() {
var swiper = this;
if (!swiper.params._emitClasses || !swiper.el) return;
var classes = swiper.el.className.split(' ').filter(function (className) {
return className.indexOf('swiper-container') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;
});
swiper.emit('_containerClasses', classes.join(' '));
};
_proto.getSlideClasses = function getSlideClasses(slideEl) {
var swiper = this;
return slideEl.className.split(' ').filter(function (className) {
return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;
}).join(' ');
};
_proto.emitSlidesClasses = function emitSlidesClasses() {
var swiper = this;
if (!swiper.params._emitClasses || !swiper.el) return;
var updates = [];
swiper.slides.each(function (slideEl) {
var classNames = swiper.getSlideClasses(slideEl);
updates.push({
slideEl: slideEl,
classNames: classNames
});
swiper.emit('_slideClass', slideEl, classNames);
});
swiper.emit('_slideClasses', updates);
};
_proto.slidesPerViewDynamic = function slidesPerViewDynamic() {
var swiper = this;
var params = swiper.params,
slides = swiper.slides,
slidesGrid = swiper.slidesGrid,
swiperSize = swiper.size,
activeIndex = swiper.activeIndex;
var spv = 1;
if (params.centeredSlides) {
var slideSize = slides[activeIndex].swiperSlideSize;
var breakLoop;
for (var i = activeIndex + 1; i < slides.length; i += 1) {
if (slides[i] && !breakLoop) {
slideSize += slides[i].swiperSlideSize;
spv += 1;
if (slideSize > swiperSize) breakLoop = true;
}
}
for (var _i = activeIndex - 1; _i >= 0; _i -= 1) {
if (slides[_i] && !breakLoop) {
slideSize += slides[_i].swiperSlideSize;
spv += 1;
if (slideSize > swiperSize) breakLoop = true;
}
}
} else {
for (var _i2 = activeIndex + 1; _i2 < slides.length; _i2 += 1) {
if (slidesGrid[_i2] - slidesGrid[activeIndex] < swiperSize) {
spv += 1;
}
}
}
return spv;
};
_proto.update = function update() {
var swiper = this;
if (!swiper || swiper.destroyed) return;
var snapGrid = swiper.snapGrid,
params = swiper.params; // Breakpoints
if (params.breakpoints) {
swiper.setBreakpoint();
}
swiper.updateSize();
swiper.updateSlides();
swiper.updateProgress();
swiper.updateSlidesClasses();
function setTranslate() {
var translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
var newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
swiper.setTranslate(newTranslate);
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
}
var translated;
if (swiper.params.freeMode) {
setTranslate();
if (swiper.params.autoHeight) {
swiper.updateAutoHeight();
}
} else {
if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);
} else {
translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
}
if (!translated) {
setTranslate();
}
}
if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
swiper.checkOverflow();
}
swiper.emit('update');
};
_proto.changeDirection = function changeDirection(newDirection, needUpdate) {
if (needUpdate === void 0) {
needUpdate = true;
}
var swiper = this;
var currentDirection = swiper.params.direction;
if (!newDirection) {
// eslint-disable-next-line
newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
}
if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {
return swiper;
}
swiper.$el.removeClass("" + swiper.params.containerModifierClass + currentDirection).addClass("" + swiper.params.containerModifierClass + newDirection);
swiper.emitContainerClasses();
swiper.params.direction = newDirection;
swiper.slides.each(function (slideEl) {
if (newDirection === 'vertical') {
slideEl.style.width = '';
} else {
slideEl.style.height = '';
}
});
swiper.emit('changeDirection');
if (needUpdate) swiper.update();
return swiper;
};
_proto.mount = function mount(el) {
var swiper = this;
if (swiper.mounted) return true; // Find el
var $el = $(el || swiper.params.el);
el = $el[0];
if (!el) {
return false;
}
el.swiper = swiper;
var getWrapperSelector = function getWrapperSelector() {
return "." + (swiper.params.wrapperClass || '').trim().split(' ').join('.');
};
var getWrapper = function getWrapper() {
if (el && el.shadowRoot && el.shadowRoot.querySelector) {
var res = $(el.shadowRoot.querySelector(getWrapperSelector())); // Children needs to return slot items
res.children = function (options) {
return $el.children(options);
};
return res;
}
return $el.children(getWrapperSelector());
}; // Find Wrapper
var $wrapperEl = getWrapper();
if ($wrapperEl.length === 0 && swiper.params.createElements) {
var document = getDocument();
var wrapper = document.createElement('div');
$wrapperEl = $(wrapper);
wrapper.className = swiper.params.wrapperClass;
$el.append(wrapper);
$el.children("." + swiper.params.slideClass).each(function (slideEl) {
$wrapperEl.append(slideEl);
});
}
extend(swiper, {
$el: $el,
el: el,
$wrapperEl: $wrapperEl,
wrapperEl: $wrapperEl[0],
mounted: true,
// RTL
rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl',
rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
wrongRTL: $wrapperEl.css('display') === '-webkit-box'
});
return true;
};
_proto.init = function init(el) {
var swiper = this;
if (swiper.initialized) return swiper;
var mounted = swiper.mount(el);
if (mounted === false) return swiper;
swiper.emit('beforeInit'); // Set breakpoint
if (swiper.params.breakpoints) {
swiper.setBreakpoint();
} // Add Classes
swiper.addClasses(); // Create loop
if (swiper.params.loop) {
swiper.loopCreate();
} // Update size
swiper.updateSize(); // Update slides
swiper.updateSlides();
if (swiper.params.watchOverflow) {
swiper.checkOverflow();
} // Set Grab Cursor
if (swiper.params.grabCursor && swiper.enabled) {
swiper.setGrabCursor();
}
if (swiper.params.preloadImages) {
swiper.preloadImages();
} // Slide To Initial Slide
if (swiper.params.loop) {
swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit, false, true);
} else {
swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);
} // Attach events
swiper.attachEvents(); // Init Flag
swiper.initialized = true; // Emit
swiper.emit('init');
swiper.emit('afterInit');
return swiper;
};
_proto.destroy = function destroy(deleteInstance, cleanStyles) {
if (deleteInstance === void 0) {
deleteInstance = true;
}
if (cleanStyles === void 0) {
cleanStyles = true;
}
var swiper = this;
var params = swiper.params,
$el = swiper.$el,
$wrapperEl = swiper.$wrapperEl,
slides = swiper.slides;
if (typeof swiper.params === 'undefined' || swiper.destroyed) {
return null;
}
swiper.emit('beforeDestroy'); // Init Flag
swiper.initialized = false; // Detach events
swiper.detachEvents(); // Destroy loop
if (params.loop) {
swiper.loopDestroy();
} // Cleanup styles
if (cleanStyles) {
swiper.removeClasses();
$el.removeAttr('style');
$wrapperEl.removeAttr('style');
if (slides && slides.length) {
slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index');
}
}
swiper.emit('destroy'); // Detach emitter events
Object.keys(swiper.eventsListeners).forEach(function (eventName) {
swiper.off(eventName);
});
if (deleteInstance !== false) {
swiper.$el[0].swiper = null;
deleteProps(swiper);
}
swiper.destroyed = true;
return null;
};
Swiper.extendDefaults = function extendDefaults(newDefaults) {
extend(extendedDefaults, newDefaults);
};
Swiper.installModule = function installModule(module) {
if (!Swiper.prototype.modules) Swiper.prototype.modules = {};
var name = module.name || Object.keys(Swiper.prototype.modules).length + "_" + now();
Swiper.prototype.modules[name] = module;
};
Swiper.use = function use(module) {
if (Array.isArray(module)) {
module.forEach(function (m) {
return Swiper.installModule(m);
});
return Swiper;
}
Swiper.installModule(module);
return Swiper;
};
_createClass(Swiper, null, [{
key: "extendedDefaults",
get: function get() {
return extendedDefaults;
}
}, {
key: "defaults",
get: function get() {
return defaults;
}
}]);
return Swiper;
}();
Object.keys(prototypes).forEach(function (prototypeGroup) {
Object.keys(prototypes[prototypeGroup]).forEach(function (protoMethod) {
Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
});
});
Swiper.use([Resize, Observer]);
export default Swiper;
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/modular.js
import { extend } from '../../utils/utils';
export default {
useParams: function useParams(instanceParams) {
var instance = this;
if (!instance.modules) return;
Object.keys(instance.modules).forEach(function (moduleName) {
var module = instance.modules[moduleName]; // Extend params
if (module.params) {
extend(instanceParams, module.params);
}
});
},
useModules: function useModules(modulesParams) {
if (modulesParams === void 0) {
modulesParams = {};
}
var instance = this;
if (!instance.modules) return;
Object.keys(instance.modules).forEach(function (moduleName) {
var module = instance.modules[moduleName];
var moduleParams = modulesParams[moduleName] || {}; // Add event listeners
if (module.on && instance.on) {
Object.keys(module.on).forEach(function (moduleEventName) {
instance.on(moduleEventName, module.on[moduleEventName]);
});
} // Module create callback
if (module.create) {
module.create.bind(instance)(moduleParams);
}
});
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/translate/index.js
import getTranslate from './getTranslate';
import setTranslate from './setTranslate';
import minTranslate from './minTranslate';
import maxTranslate from './maxTranslate';
import translateTo from './translateTo';
export default {
getTranslate: getTranslate,
setTranslate: setTranslate,
minTranslate: minTranslate,
maxTranslate: maxTranslate,
translateTo: translateTo
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/translate/getTranslate.js
import { getTranslate } from '../../../utils/utils';
export default function getSwiperTranslate(axis) {
if (axis === void 0) {
axis = this.isHorizontal() ? 'x' : 'y';
}
var swiper = this;
var params = swiper.params,
rtl = swiper.rtlTranslate,
translate = swiper.translate,
$wrapperEl = swiper.$wrapperEl;
if (params.virtualTranslate) {
return rtl ? -translate : translate;
}
if (params.cssMode) {
return translate;
}
var currentTranslate = getTranslate($wrapperEl[0], axis);
if (rtl) currentTranslate = -currentTranslate;
return currentTranslate || 0;
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/translate/setTranslate.js
export default function setTranslate(translate, byController) {
var swiper = this;
var rtl = swiper.rtlTranslate,
params = swiper.params,
$wrapperEl = swiper.$wrapperEl,
wrapperEl = swiper.wrapperEl,
progress = swiper.progress;
var x = 0;
var y = 0;
var z = 0;
if (swiper.isHorizontal()) {
x = rtl ? -translate : translate;
} else {
y = translate;
}
if (params.roundLengths) {
x = Math.floor(x);
y = Math.floor(y);
}
if (params.cssMode) {
wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;
} else if (!params.virtualTranslate) {
$wrapperEl.transform("translate3d(" + x + "px, " + y + "px, " + z + "px)");
}
swiper.previousTranslate = swiper.translate;
swiper.translate = swiper.isHorizontal() ? x : y; // Check if we need to update progress
var newProgress;
var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
if (translatesDiff === 0) {
newProgress = 0;
} else {
newProgress = (translate - swiper.minTranslate()) / translatesDiff;
}
if (newProgress !== progress) {
swiper.updateProgress(translate);
}
swiper.emit('setTranslate', swiper.translate, byController);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/translate/minTranslate.js
export default function minTranslate() {
return -this.snapGrid[0];
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/translate/maxTranslate.js
export default function maxTranslate() {
return -this.snapGrid[this.snapGrid.length - 1];
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/translate/translateTo.js
export default function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
if (translate === void 0) {
translate = 0;
}
if (speed === void 0) {
speed = this.params.speed;
}
if (runCallbacks === void 0) {
runCallbacks = true;
}
if (translateBounds === void 0) {
translateBounds = true;
}
var swiper = this;
var params = swiper.params,
wrapperEl = swiper.wrapperEl;
if (swiper.animating && params.preventInteractionOnTransition) {
return false;
}
var minTranslate = swiper.minTranslate();
var maxTranslate = swiper.maxTranslate();
var newTranslate;
if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; // Update progress
swiper.updateProgress(newTranslate);
if (params.cssMode) {
var isH = swiper.isHorizontal();
if (speed === 0) {
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
} else {
// eslint-disable-next-line
if (wrapperEl.scrollTo) {
var _wrapperEl$scrollTo;
wrapperEl.scrollTo((_wrapperEl$scrollTo = {}, _wrapperEl$scrollTo[isH ? 'left' : 'top'] = -newTranslate, _wrapperEl$scrollTo.behavior = 'smooth', _wrapperEl$scrollTo));
} else {
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
}
}
return true;
}
if (speed === 0) {
swiper.setTransition(0);
swiper.setTranslate(newTranslate);
if (runCallbacks) {
swiper.emit('beforeTransitionStart', speed, internal);
swiper.emit('transitionEnd');
}
} else {
swiper.setTransition(speed);
swiper.setTranslate(newTranslate);
if (runCallbacks) {
swiper.emit('beforeTransitionStart', speed, internal);
swiper.emit('transitionStart');
}
if (!swiper.animating) {
swiper.animating = true;
if (!swiper.onTranslateToWrapperTransitionEnd) {
swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
if (!swiper || swiper.destroyed) return;
if (e.target !== this) return;
swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
swiper.onTranslateToWrapperTransitionEnd = null;
delete swiper.onTranslateToWrapperTransitionEnd;
if (runCallbacks) {
swiper.emit('transitionEnd');
}
};
}
swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
}
}
return true;
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/transition/index.js
import setTransition from './setTransition';
import transitionStart from './transitionStart';
import transitionEnd from './transitionEnd';
export default {
setTransition: setTransition,
transitionStart: transitionStart,
transitionEnd: transitionEnd
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/transition/setTransition.js
export default function setTransition(duration, byController) {
var swiper = this;
if (!swiper.params.cssMode) {
swiper.$wrapperEl.transition(duration);
}
swiper.emit('setTransition', duration, byController);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/transition/transitionStart.js
export default function transitionStart(runCallbacks, direction) {
if (runCallbacks === void 0) {
runCallbacks = true;
}
var swiper = this;
var activeIndex = swiper.activeIndex,
params = swiper.params,
previousIndex = swiper.previousIndex;
if (params.cssMode) return;
if (params.autoHeight) {
swiper.updateAutoHeight();
}
var dir = direction;
if (!dir) {
if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
}
swiper.emit('transitionStart');
if (runCallbacks && activeIndex !== previousIndex) {
if (dir === 'reset') {
swiper.emit('slideResetTransitionStart');
return;
}
swiper.emit('slideChangeTransitionStart');
if (dir === 'next') {
swiper.emit('slideNextTransitionStart');
} else {
swiper.emit('slidePrevTransitionStart');
}
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/transition/transitionEnd.js
export default function transitionEnd(runCallbacks, direction) {
if (runCallbacks === void 0) {
runCallbacks = true;
}
var swiper = this;
var activeIndex = swiper.activeIndex,
previousIndex = swiper.previousIndex,
params = swiper.params;
swiper.animating = false;
if (params.cssMode) return;
swiper.setTransition(0);
var dir = direction;
if (!dir) {
if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
}
swiper.emit('transitionEnd');
if (runCallbacks && activeIndex !== previousIndex) {
if (dir === 'reset') {
swiper.emit('slideResetTransitionEnd');
return;
}
swiper.emit('slideChangeTransitionEnd');
if (dir === 'next') {
swiper.emit('slideNextTransitionEnd');
} else {
swiper.emit('slidePrevTransitionEnd');
}
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/grab-cursor/index.js
import setGrabCursor from './setGrabCursor';
import unsetGrabCursor from './unsetGrabCursor';
export default {
setGrabCursor: setGrabCursor,
unsetGrabCursor: unsetGrabCursor
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/grab-cursor/setGrabCursor.js
export default function setGrabCursor(moving) {
var swiper = this;
if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;
var el = swiper.el;
el.style.cursor = 'move';
el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';
el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab';
el.style.cursor = moving ? 'grabbing' : 'grab';
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/grab-cursor/unsetGrabCursor.js
export default function unsetGrabCursor() {
var swiper = this;
if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {
return;
}
swiper.el.style.cursor = '';
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/manipulation/index.js
import appendSlide from './appendSlide';
import prependSlide from './prependSlide';
import addSlide from './addSlide';
import removeSlide from './removeSlide';
import removeAllSlides from './removeAllSlides';
export default {
appendSlide: appendSlide,
prependSlide: prependSlide,
addSlide: addSlide,
removeSlide: removeSlide,
removeAllSlides: removeAllSlides
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/manipulation/appendSlide.js
export default function appendSlide(slides) {
var swiper = this;
var $wrapperEl = swiper.$wrapperEl,
params = swiper.params;
if (params.loop) {
swiper.loopDestroy();
}
if (typeof slides === 'object' && 'length' in slides) {
for (var i = 0; i < slides.length; i += 1) {
if (slides[i]) $wrapperEl.append(slides[i]);
}
} else {
$wrapperEl.append(slides);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && swiper.support.observer)) {
swiper.update();
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/manipulation/prependSlide.js
export default function prependSlide(slides) {
var swiper = this;
var params = swiper.params,
$wrapperEl = swiper.$wrapperEl,
activeIndex = swiper.activeIndex;
if (params.loop) {
swiper.loopDestroy();
}
var newActiveIndex = activeIndex + 1;
if (typeof slides === 'object' && 'length' in slides) {
for (var i = 0; i < slides.length; i += 1) {
if (slides[i]) $wrapperEl.prepend(slides[i]);
}
newActiveIndex = activeIndex + slides.length;
} else {
$wrapperEl.prepend(slides);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && swiper.support.observer)) {
swiper.update();
}
swiper.slideTo(newActiveIndex, 0, false);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/manipulation/addSlide.js
export default function addSlide(index, slides) {
var swiper = this;
var $wrapperEl = swiper.$wrapperEl,
params = swiper.params,
activeIndex = swiper.activeIndex;
var activeIndexBuffer = activeIndex;
if (params.loop) {
activeIndexBuffer -= swiper.loopedSlides;
swiper.loopDestroy();
swiper.slides = $wrapperEl.children("." + params.slideClass);
}
var baseLength = swiper.slides.length;
if (index <= 0) {
swiper.prependSlide(slides);
return;
}
if (index >= baseLength) {
swiper.appendSlide(slides);
return;
}
var newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;
var slidesBuffer = [];
for (var i = baseLength - 1; i >= index; i -= 1) {
var currentSlide = swiper.slides.eq(i);
currentSlide.remove();
slidesBuffer.unshift(currentSlide);
}
if (typeof slides === 'object' && 'length' in slides) {
for (var _i = 0; _i < slides.length; _i += 1) {
if (slides[_i]) $wrapperEl.append(slides[_i]);
}
newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;
} else {
$wrapperEl.append(slides);
}
for (var _i2 = 0; _i2 < slidesBuffer.length; _i2 += 1) {
$wrapperEl.append(slidesBuffer[_i2]);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && swiper.support.observer)) {
swiper.update();
}
if (params.loop) {
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
} else {
swiper.slideTo(newActiveIndex, 0, false);
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/manipulation/removeSlide.js
export default function removeSlide(slidesIndexes) {
var swiper = this;
var params = swiper.params,
$wrapperEl = swiper.$wrapperEl,
activeIndex = swiper.activeIndex;
var activeIndexBuffer = activeIndex;
if (params.loop) {
activeIndexBuffer -= swiper.loopedSlides;
swiper.loopDestroy();
swiper.slides = $wrapperEl.children("." + params.slideClass);
}
var newActiveIndex = activeIndexBuffer;
var indexToRemove;
if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {
for (var i = 0; i < slidesIndexes.length; i += 1) {
indexToRemove = slidesIndexes[i];
if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();
if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
}
newActiveIndex = Math.max(newActiveIndex, 0);
} else {
indexToRemove = slidesIndexes;
if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();
if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
newActiveIndex = Math.max(newActiveIndex, 0);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && swiper.support.observer)) {
swiper.update();
}
if (params.loop) {
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
} else {
swiper.slideTo(newActiveIndex, 0, false);
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/manipulation/removeAllSlides.js
export default function removeAllSlides() {
var swiper = this;
var slidesIndexes = [];
for (var i = 0; i < swiper.slides.length; i += 1) {
slidesIndexes.push(i);
}
swiper.removeSlide(slidesIndexes);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/breakpoints/index.js
import setBreakpoint from './setBreakpoint';
import getBreakpoint from './getBreakpoint';
export default {
setBreakpoint: setBreakpoint,
getBreakpoint: getBreakpoint
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/breakpoints/setBreakpoint.js
import { extend } from '../../../utils/utils';
export default function setBreakpoint() {
var swiper = this;
var activeIndex = swiper.activeIndex,
initialized = swiper.initialized,
_swiper$loopedSlides = swiper.loopedSlides,
loopedSlides = _swiper$loopedSlides === void 0 ? 0 : _swiper$loopedSlides,
params = swiper.params,
$el = swiper.$el;
var breakpoints = params.breakpoints;
if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; // Get breakpoint for window width and update parameters
var breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);
if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
var breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
if (breakpointOnlyParams) {
['slidesPerView', 'spaceBetween', 'slidesPerGroup', 'slidesPerGroupSkip', 'slidesPerColumn'].forEach(function (param) {
var paramValue = breakpointOnlyParams[param];
if (typeof paramValue === 'undefined') return;
if (param === 'slidesPerView' && (paramValue === 'AUTO' || paramValue === 'auto')) {
breakpointOnlyParams[param] = 'auto';
} else if (param === 'slidesPerView') {
breakpointOnlyParams[param] = parseFloat(paramValue);
} else {
breakpointOnlyParams[param] = parseInt(paramValue, 10);
}
});
}
var breakpointParams = breakpointOnlyParams || swiper.originalParams;
var wasMultiRow = params.slidesPerColumn > 1;
var isMultiRow = breakpointParams.slidesPerColumn > 1;
var wasEnabled = params.enabled;
if (wasMultiRow && !isMultiRow) {
$el.removeClass(params.containerModifierClass + "multirow " + params.containerModifierClass + "multirow-column");
swiper.emitContainerClasses();
} else if (!wasMultiRow && isMultiRow) {
$el.addClass(params.containerModifierClass + "multirow");
if (breakpointParams.slidesPerColumnFill && breakpointParams.slidesPerColumnFill === 'column' || !breakpointParams.slidesPerColumnFill && params.slidesPerColumnFill === 'column') {
$el.addClass(params.containerModifierClass + "multirow-column");
}
swiper.emitContainerClasses();
}
var directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
var needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
if (directionChanged && initialized) {
swiper.changeDirection();
}
extend(swiper.params, breakpointParams);
var isEnabled = swiper.params.enabled;
extend(swiper, {
allowTouchMove: swiper.params.allowTouchMove,
allowSlideNext: swiper.params.allowSlideNext,
allowSlidePrev: swiper.params.allowSlidePrev
});
if (wasEnabled && !isEnabled) {
swiper.disable();
} else if (!wasEnabled && isEnabled) {
swiper.enable();
}
swiper.currentBreakpoint = breakpoint;
swiper.emit('_beforeBreakpoint', breakpointParams);
if (needsReLoop && initialized) {
swiper.loopDestroy();
swiper.loopCreate();
swiper.updateSlides();
swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false);
}
swiper.emit('breakpoint', breakpointParams);
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/breakpoints/getBreakpoint.js
import { getWindow } from 'ssr-window';
export default function getBreakpoint(breakpoints, base, containerEl) {
if (base === void 0) {
base = 'window';
}
if (!breakpoints || base === 'container' && !containerEl) return undefined;
var breakpoint = false;
var window = getWindow();
var currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;
var points = Object.keys(breakpoints).map(function (point) {
if (typeof point === 'string' && point.indexOf('@') === 0) {
var minRatio = parseFloat(point.substr(1));
var value = currentHeight * minRatio;
return {
value: value,
point: point
};
}
return {
value: point,
point: point
};
});
points.sort(function (a, b) {
return parseInt(a.value, 10) - parseInt(b.value, 10);
});
for (var i = 0; i < points.length; i += 1) {
var _points$i = points[i],
point = _points$i.point,
value = _points$i.value;
if (base === 'window') {
if (window.matchMedia("(min-width: " + value + "px)").matches) {
breakpoint = point;
}
} else if (value <= containerEl.clientWidth) {
breakpoint = point;
}
}
return breakpoint || 'max';
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/check-overflow/index.js
function checkOverflow() {
var swiper = this;
var params = swiper.params;
var wasLocked = swiper.isLocked;
var lastSlidePosition = swiper.slides.length > 0 && params.slidesOffsetBefore + params.spaceBetween * (swiper.slides.length - 1) + swiper.slides[0].offsetWidth * swiper.slides.length;
if (params.slidesOffsetBefore && params.slidesOffsetAfter && lastSlidePosition) {
swiper.isLocked = lastSlidePosition <= swiper.size;
} else {
swiper.isLocked = swiper.snapGrid.length === 1;
}
swiper.allowSlideNext = !swiper.isLocked;
swiper.allowSlidePrev = !swiper.isLocked; // events
if (wasLocked !== swiper.isLocked) swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
if (wasLocked && wasLocked !== swiper.isLocked) {
swiper.isEnd = false;
if (swiper.navigation) swiper.navigation.update();
}
}
export default {
checkOverflow: checkOverflow
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/images/index.js
import loadImage from './loadImage';
import preloadImages from './preloadImages';
export default {
loadImage: loadImage,
preloadImages: preloadImages
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/images/loadImage.js
import { getWindow } from 'ssr-window';
import $ from '../../../utils/dom';
export default function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) {
var window = getWindow();
var image;
function onReady() {
if (callback) callback();
}
var isPicture = $(imageEl).parent('picture')[0];
if (!isPicture && (!imageEl.complete || !checkForComplete)) {
if (src) {
image = new window.Image();
image.onload = onReady;
image.onerror = onReady;
if (sizes) {
image.sizes = sizes;
}
if (srcset) {
image.srcset = srcset;
}
if (src) {
image.src = src;
}
} else {
onReady();
}
} else {
// image already loaded...
onReady();
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/core/images/preloadImages.js
export default function preloadImages() {
var swiper = this;
swiper.imagesToLoad = swiper.$el.find('img');
function onReady() {
if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;
if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;
if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
if (swiper.params.updateOnImagesReady) swiper.update();
swiper.emit('imagesReady');
}
}
for (var i = 0; i < swiper.imagesToLoad.length; i += 1) {
var imageEl = swiper.imagesToLoad[i];
swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady);
}
}
webpack://frontend-tpt/../../node_modules/swiper/esm/components/virtual/virtual.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import $ from '../../utils/dom';
import { extend, bindModuleMethods } from '../../utils/utils';
var Virtual = {
update: function update(force) {
var swiper = this;
var _swiper$params = swiper.params,
slidesPerView = _swiper$params.slidesPerView,
slidesPerGroup = _swiper$params.slidesPerGroup,
centeredSlides = _swiper$params.centeredSlides;
var _swiper$params$virtua = swiper.params.virtual,
addSlidesBefore = _swiper$params$virtua.addSlidesBefore,
addSlidesAfter = _swiper$params$virtua.addSlidesAfter;
var _swiper$virtual = swiper.virtual,
previousFrom = _swiper$virtual.from,
previousTo = _swiper$virtual.to,
slides = _swiper$virtual.slides,
previousSlidesGrid = _swiper$virtual.slidesGrid,
renderSlide = _swiper$virtual.renderSlide,
previousOffset = _swiper$virtual.offset;
swiper.updateActiveIndex();
var activeIndex = swiper.activeIndex || 0;
var offsetProp;
if (swiper.rtlTranslate) offsetProp = 'right';else offsetProp = swiper.isHorizontal() ? 'left' : 'top';
var slidesAfter;
var slidesBefore;
if (centeredSlides) {
slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter;
slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore;
} else {
slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesAfter;
slidesBefore = slidesPerGroup + addSlidesBefore;
}
var from = Math.max((activeIndex || 0) - slidesBefore, 0);
var to = Math.min((activeIndex || 0) + slidesAfter, slides.length - 1);
var offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0);
extend(swiper.virtual, {
from: from,
to: to,
offset: offset,
slidesGrid: swiper.slidesGrid
});
function onRendered() {
swiper.updateSlides();
swiper.updateProgress();
swiper.updateSlidesClasses();
if (swiper.lazy && swiper.params.lazy.enabled) {
swiper.lazy.load();
}
}
if (previousFrom === from && previousTo === to && !force) {
if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) {
swiper.slides.css(offsetProp, offset + "px");
}
swiper.updateProgress();
return;
}
if (swiper.params.virtual.renderExternal) {
swiper.params.virtual.renderExternal.call(swiper, {
offset: offset,
from: from,
to: to,
slides: function getSlides() {
var slidesToRender = [];
for (var i = from; i <= to; i += 1) {
slidesToRender.push(slides[i]);
}
return slidesToRender;
}()
});
if (swiper.params.virtual.renderExternalUpdate) {
onRendered();
}
return;
}
var prependIndexes = [];
var appendIndexes = [];
if (force) {
swiper.$wrapperEl.find("." + swiper.params.slideClass).remove();
} else {
for (var i = previousFrom; i <= previousTo; i += 1) {
if (i < from || i > to) {
swiper.$wrapperEl.find("." + swiper.params.slideClass + "[data-swiper-slide-index=\"" + i + "\"]").remove();
}
}
}
for (var _i = 0; _i < slides.length; _i += 1) {
if (_i >= from && _i <= to) {
if (typeof previousTo === 'undefined' || force) {
appendIndexes.push(_i);
} else {
if (_i > previousTo) appendIndexes.push(_i);
if (_i < previousFrom) prependIndexes.push(_i);
}
}
}
appendIndexes.forEach(function (index) {
swiper.$wrapperEl.append(renderSlide(slides[index], index));
});
prependIndexes.sort(function (a, b) {
return b - a;
}).forEach(function (index) {
swiper.$wrapperEl.prepend(renderSlide(slides[index], index));
});
swiper.$wrapperEl.children('.swiper-slide').css(offsetProp, offset + "px");
onRendered();
},
renderSlide: function renderSlide(slide, index) {
var swiper = this;
var params = swiper.params.virtual;
if (params.cache && swiper.virtual.cache[index]) {
return swiper.virtual.cache[index];
}
var $slideEl = params.renderSlide ? $(params.renderSlide.call(swiper, slide, index)) : $("<div class=\"" + swiper.params.slideClass + "\" data-swiper-slide-index=\"" + index + "\">" + slide + "</div>");
if (!$slideEl.attr('data-swiper-slide-index')) $slideEl.attr('data-swiper-slide-index', index);
if (params.cache) swiper.virtual.cache[index] = $slideEl;
return $slideEl;
},
appendSlide: function appendSlide(slides) {
var swiper = this;
if (typeof slides === 'object' && 'length' in slides) {
for (var i = 0; i < slides.length; i += 1) {
if (slides[i]) swiper.virtual.slides.push(slides[i]);
}
} else {
swiper.virtual.slides.push(slides);
}
swiper.virtual.update(true);
},
prependSlide: function prependSlide(slides) {
var swiper = this;
var activeIndex = swiper.activeIndex;
var newActiveIndex = activeIndex + 1;
var numberOfNewSlides = 1;
if (Array.isArray(slides)) {
for (var i = 0; i < slides.length; i += 1) {
if (slides[i]) swiper.virtual.slides.unshift(slides[i]);
}
newActiveIndex = activeIndex + slides.length;
numberOfNewSlides = slides.length;
} else {
swiper.virtual.slides.unshift(slides);
}
if (swiper.params.virtual.cache) {
var cache = swiper.virtual.cache;
var newCache = {};
Object.keys(cache).forEach(function (cachedIndex) {
var $cachedEl = cache[cachedIndex];
var cachedElIndex = $cachedEl.attr('data-swiper-slide-index');
if (cachedElIndex) {
$cachedEl.attr('data-swiper-slide-index', parseInt(cachedElIndex, 10) + 1);
}
newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = $cachedEl;
});
swiper.virtual.cache = newCache;
}
swiper.virtual.update(true);
swiper.slideTo(newActiveIndex, 0);
},
removeSlide: function removeSlide(slidesIndexes) {
var swiper = this;
if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) return;
var activeIndex = swiper.activeIndex;
if (Array.isArray(slidesIndexes)) {
for (var i = slidesIndexes.length - 1; i >= 0; i -= 1) {
swiper.virtual.slides.splice(slidesIndexes[i], 1);
if (swiper.params.virtual.cache) {
delete swiper.virtual.cache[slidesIndexes[i]];
}
if (slidesIndexes[i] < activeIndex) activeIndex -= 1;
activeIndex = Math.max(activeIndex, 0);
}
} else {
swiper.virtual.slides.splice(slidesIndexes, 1);
if (swiper.params.virtual.cache) {
delete swiper.virtual.cache[slidesIndexes];
}
if (slidesIndexes < activeIndex) activeIndex -= 1;
activeIndex = Math.max(activeIndex, 0);
}
swiper.virtual.update(true);
swiper.slideTo(activeIndex, 0);
},
removeAllSlides: function removeAllSlides() {
var swiper = this;
swiper.virtual.slides = [];
if (swiper.params.virtual.cache) {
swiper.virtual.cache = {};
}
swiper.virtual.update(true);
swiper.slideTo(0, 0);
}
};
export default {
name: 'virtual',
params: {
virtual: {
enabled: false,
slides: [],
cache: true,
renderSlide: null,
renderExternal: null,
renderExternalUpdate: true,
addSlidesBefore: 0,
addSlidesAfter: 0
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
virtual: _extends({}, Virtual, {
slides: swiper.params.virtual.slides,
cache: {}
})
});
},
on: {
beforeInit: function beforeInit(swiper) {
if (!swiper.params.virtual.enabled) return;
swiper.classNames.push(swiper.params.containerModifierClass + "virtual");
var overwriteParams = {
watchSlidesProgress: true
};
extend(swiper.params, overwriteParams);
extend(swiper.originalParams, overwriteParams);
if (!swiper.params.initialSlide) {
swiper.virtual.update();
}
},
setTranslate: function setTranslate(swiper) {
if (!swiper.params.virtual.enabled) return;
swiper.virtual.update();
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/keyboard/keyboard.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
/* eslint-disable consistent-return */
import { getWindow, getDocument } from 'ssr-window';
import $ from '../../utils/dom';
import { bindModuleMethods } from '../../utils/utils';
var Keyboard = {
handle: function handle(event) {
var swiper = this;
if (!swiper.enabled) return;
var window = getWindow();
var document = getDocument();
var rtl = swiper.rtlTranslate;
var e = event;
if (e.originalEvent) e = e.originalEvent; // jquery fix
var kc = e.keyCode || e.charCode;
var pageUpDown = swiper.params.keyboard.pageUpDown;
var isPageUp = pageUpDown && kc === 33;
var isPageDown = pageUpDown && kc === 34;
var isArrowLeft = kc === 37;
var isArrowRight = kc === 39;
var isArrowUp = kc === 38;
var isArrowDown = kc === 40; // Directions locks
if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) {
return false;
}
if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) {
return false;
}
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
return undefined;
}
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
return undefined;
}
if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
var inView = false; // Check that swiper should be inside of visible area of window
if (swiper.$el.parents("." + swiper.params.slideClass).length > 0 && swiper.$el.parents("." + swiper.params.slideActiveClass).length === 0) {
return undefined;
}
var $el = swiper.$el;
var swiperWidth = $el[0].clientWidth;
var swiperHeight = $el[0].clientHeight;
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
var swiperOffset = swiper.$el.offset();
if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft;
var swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]];
for (var i = 0; i < swiperCoord.length; i += 1) {
var point = swiperCoord[i];
if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {
if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line
inView = true;
}
}
if (!inView) return undefined;
}
if (swiper.isHorizontal()) {
if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
}
if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
} else {
if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
}
if (isPageDown || isArrowDown) swiper.slideNext();
if (isPageUp || isArrowUp) swiper.slidePrev();
}
swiper.emit('keyPress', kc);
return undefined;
},
enable: function enable() {
var swiper = this;
var document = getDocument();
if (swiper.keyboard.enabled) return;
$(document).on('keydown', swiper.keyboard.handle);
swiper.keyboard.enabled = true;
},
disable: function disable() {
var swiper = this;
var document = getDocument();
if (!swiper.keyboard.enabled) return;
$(document).off('keydown', swiper.keyboard.handle);
swiper.keyboard.enabled = false;
}
};
export default {
name: 'keyboard',
params: {
keyboard: {
enabled: false,
onlyInViewport: true,
pageUpDown: true
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
keyboard: _extends({
enabled: false
}, Keyboard)
});
},
on: {
init: function init(swiper) {
if (swiper.params.keyboard.enabled) {
swiper.keyboard.enable();
}
},
destroy: function destroy(swiper) {
if (swiper.keyboard.enabled) {
swiper.keyboard.disable();
}
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/mousewheel/mousewheel.js
/* eslint-disable consistent-return */
import { getWindow, getDocument } from 'ssr-window';
import $ from '../../utils/dom';
import { now, nextTick, bindModuleMethods } from '../../utils/utils';
function isEventSupported() {
var document = getDocument();
var eventName = 'onwheel';
var isSupported = (eventName in document);
if (!isSupported) {
var element = document.createElement('div');
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] === 'function';
}
if (!isSupported && document.implementation && document.implementation.hasFeature && // always returns true in newer browsers as per the standard.
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
document.implementation.hasFeature('', '') !== true) {
// This is the only way to test support for the `wheel` event in IE9+.
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
}
return isSupported;
}
var Mousewheel = {
lastScrollTime: now(),
lastEventBeforeSnap: undefined,
recentWheelEvents: [],
event: function event() {
var window = getWindow();
if (window.navigator.userAgent.indexOf('firefox') > -1) return 'DOMMouseScroll';
return isEventSupported() ? 'wheel' : 'mousewheel';
},
normalize: function normalize(e) {
// Reasonable defaults
var PIXEL_STEP = 10;
var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800;
var sX = 0;
var sY = 0; // spinX, spinY
var pX = 0;
var pY = 0; // pixelX, pixelY
// Legacy
if ('detail' in e) {
sY = e.detail;
}
if ('wheelDelta' in e) {
sY = -e.wheelDelta / 120;
}
if ('wheelDeltaY' in e) {
sY = -e.wheelDeltaY / 120;
}
if ('wheelDeltaX' in e) {
sX = -e.wheelDeltaX / 120;
} // side scrolling on FF with DOMMouseScroll
if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) {
sX = sY;
sY = 0;
}
pX = sX * PIXEL_STEP;
pY = sY * PIXEL_STEP;
if ('deltaY' in e) {
pY = e.deltaY;
}
if ('deltaX' in e) {
pX = e.deltaX;
}
if (e.shiftKey && !pX) {
// if user scrolls with shift he wants horizontal scroll
pX = pY;
pY = 0;
}
if ((pX || pY) && e.deltaMode) {
if (e.deltaMode === 1) {
// delta in LINE units
pX *= LINE_HEIGHT;
pY *= LINE_HEIGHT;
} else {
// delta in PAGE units
pX *= PAGE_HEIGHT;
pY *= PAGE_HEIGHT;
}
} // Fall-back if spin cannot be determined
if (pX && !sX) {
sX = pX < 1 ? -1 : 1;
}
if (pY && !sY) {
sY = pY < 1 ? -1 : 1;
}
return {
spinX: sX,
spinY: sY,
pixelX: pX,
pixelY: pY
};
},
handleMouseEnter: function handleMouseEnter() {
var swiper = this;
if (!swiper.enabled) return;
swiper.mouseEntered = true;
},
handleMouseLeave: function handleMouseLeave() {
var swiper = this;
if (!swiper.enabled) return;
swiper.mouseEntered = false;
},
handle: function handle(event) {
var e = event;
var disableParentSwiper = true;
var swiper = this;
if (!swiper.enabled) return;
var params = swiper.params.mousewheel;
if (swiper.params.cssMode) {
e.preventDefault();
}
var target = swiper.$el;
if (swiper.params.mousewheel.eventsTarget !== 'container') {
target = $(swiper.params.mousewheel.eventsTarget);
}
if (!swiper.mouseEntered && !target[0].contains(e.target) && !params.releaseOnEdges) return true;
if (e.originalEvent) e = e.originalEvent; // jquery fix
var delta = 0;
var rtlFactor = swiper.rtlTranslate ? -1 : 1;
var data = Mousewheel.normalize(e);
if (params.forceToAxis) {
if (swiper.isHorizontal()) {
if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true;
} else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true;
} else {
delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY;
}
if (delta === 0) return true;
if (params.invert) delta = -delta; // Get the scroll positions
var positions = swiper.getTranslate() + delta * params.sensitivity;
if (positions >= swiper.minTranslate()) positions = swiper.minTranslate();
if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate(); // When loop is true:
// the disableParentSwiper will be true.
// When loop is false:
// if the scroll positions is not on edge,
// then the disableParentSwiper will be true.
// if the scroll on edge positions,
// then the disableParentSwiper will be false.
disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate());
if (disableParentSwiper && swiper.params.nested) e.stopPropagation();
if (!swiper.params.freeMode) {
// Register the new event in a variable which stores the relevant data
var newEvent = {
time: now(),
delta: Math.abs(delta),
direction: Math.sign(delta),
raw: event
}; // Keep the most recent events
var recentWheelEvents = swiper.mousewheel.recentWheelEvents;
if (recentWheelEvents.length >= 2) {
recentWheelEvents.shift(); // only store the last N events
}
var prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;
recentWheelEvents.push(newEvent); // If there is at least one previous recorded event:
// If direction has changed or
// if the scroll is quicker than the previous one:
// Animate the slider.
// Else (this is the first time the wheel is moved):
// Animate the slider.
if (prevEvent) {
if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) {
swiper.mousewheel.animateSlider(newEvent);
}
} else {
swiper.mousewheel.animateSlider(newEvent);
} // If it's time to release the scroll:
// Return now so you don't hit the preventDefault.
if (swiper.mousewheel.releaseScroll(newEvent)) {
return true;
}
} else {
// Freemode or scrollContainer:
// If we recently snapped after a momentum scroll, then ignore wheel events
// to give time for the deceleration to finish. Stop ignoring after 500 msecs
// or if it's a new scroll (larger delta or inverse sign as last event before
// an end-of-momentum snap).
var _newEvent = {
time: now(),
delta: Math.abs(delta),
direction: Math.sign(delta)
};
var lastEventBeforeSnap = swiper.mousewheel.lastEventBeforeSnap;
var ignoreWheelEvents = lastEventBeforeSnap && _newEvent.time < lastEventBeforeSnap.time + 500 && _newEvent.delta <= lastEventBeforeSnap.delta && _newEvent.direction === lastEventBeforeSnap.direction;
if (!ignoreWheelEvents) {
swiper.mousewheel.lastEventBeforeSnap = undefined;
if (swiper.params.loop) {
swiper.loopFix();
}
var position = swiper.getTranslate() + delta * params.sensitivity;
var wasBeginning = swiper.isBeginning;
var wasEnd = swiper.isEnd;
if (position >= swiper.minTranslate()) position = swiper.minTranslate();
if (position <= swiper.maxTranslate()) position = swiper.maxTranslate();
swiper.setTransition(0);
swiper.setTranslate(position);
swiper.updateProgress();
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) {
swiper.updateSlidesClasses();
}
if (swiper.params.freeModeSticky) {
// When wheel scrolling starts with sticky (aka snap) enabled, then detect
// the end of a momentum scroll by storing recent (N=15?) wheel events.
// 1. do all N events have decreasing or same (absolute value) delta?
// 2. did all N events arrive in the last M (M=500?) msecs?
// 3. does the earliest event have an (absolute value) delta that's
// at least P (P=1?) larger than the most recent event's delta?
// 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels?
// If 1-4 are "yes" then we're near the end of a momentum scroll deceleration.
// Snap immediately and ignore remaining wheel events in this scroll.
// See comment above for "remaining wheel events in this scroll" determination.
// If 1-4 aren't satisfied, then wait to snap until 500ms after the last event.
clearTimeout(swiper.mousewheel.timeout);
swiper.mousewheel.timeout = undefined;
var _recentWheelEvents = swiper.mousewheel.recentWheelEvents;
if (_recentWheelEvents.length >= 15) {
_recentWheelEvents.shift(); // only store the last N events
}
var _prevEvent = _recentWheelEvents.length ? _recentWheelEvents[_recentWheelEvents.length - 1] : undefined;
var firstEvent = _recentWheelEvents[0];
_recentWheelEvents.push(_newEvent);
if (_prevEvent && (_newEvent.delta > _prevEvent.delta || _newEvent.direction !== _prevEvent.direction)) {
// Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log.
_recentWheelEvents.splice(0);
} else if (_recentWheelEvents.length >= 15 && _newEvent.time - firstEvent.time < 500 && firstEvent.delta - _newEvent.delta >= 1 && _newEvent.delta <= 6) {
// We're at the end of the deceleration of a momentum scroll, so there's no need
// to wait for more events. Snap ASAP on the next tick.
// Also, because there's some remaining momentum we'll bias the snap in the
// direction of the ongoing scroll because it's better UX for the scroll to snap
// in the same direction as the scroll instead of reversing to snap. Therefore,
// if it's already scrolled more than 20% in the current direction, keep going.
var snapToThreshold = delta > 0 ? 0.8 : 0.2;
swiper.mousewheel.lastEventBeforeSnap = _newEvent;
_recentWheelEvents.splice(0);
swiper.mousewheel.timeout = nextTick(function () {
swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
}, 0); // no delay; move on next tick
}
if (!swiper.mousewheel.timeout) {
// if we get here, then we haven't detected the end of a momentum scroll, so
// we'll consider a scroll "complete" when there haven't been any wheel events
// for 500ms.
swiper.mousewheel.timeout = nextTick(function () {
var snapToThreshold = 0.5;
swiper.mousewheel.lastEventBeforeSnap = _newEvent;
_recentWheelEvents.splice(0);
swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
}, 500);
}
} // Emit event
if (!ignoreWheelEvents) swiper.emit('scroll', e); // Stop autoplay
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop(); // Return page scroll on edge positions
if (position === swiper.minTranslate() || position === swiper.maxTranslate()) return true;
}
}
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
return false;
},
animateSlider: function animateSlider(newEvent) {
var swiper = this;
var window = getWindow();
if (this.params.mousewheel.thresholdDelta && newEvent.delta < this.params.mousewheel.thresholdDelta) {
// Prevent if delta of wheel scroll delta is below configured threshold
return false;
}
if (this.params.mousewheel.thresholdTime && now() - swiper.mousewheel.lastScrollTime < this.params.mousewheel.thresholdTime) {
// Prevent if time between scrolls is below configured threshold
return false;
} // If the movement is NOT big enough and
// if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider):
// Don't go any further (avoid insignificant scroll movement).
if (newEvent.delta >= 6 && now() - swiper.mousewheel.lastScrollTime < 60) {
// Return false as a default
return true;
} // If user is scrolling towards the end:
// If the slider hasn't hit the latest slide or
// if the slider is a loop and
// if the slider isn't moving right now:
// Go to next slide and
// emit a scroll event.
// Else (the user is scrolling towards the beginning) and
// if the slider hasn't hit the first slide or
// if the slider is a loop and
// if the slider isn't moving right now:
// Go to prev slide and
// emit a scroll event.
if (newEvent.direction < 0) {
if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) {
swiper.slideNext();
swiper.emit('scroll', newEvent.raw);
}
} else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) {
swiper.slidePrev();
swiper.emit('scroll', newEvent.raw);
} // If you got here is because an animation has been triggered so store the current time
swiper.mousewheel.lastScrollTime = new window.Date().getTime(); // Return false as a default
return false;
},
releaseScroll: function releaseScroll(newEvent) {
var swiper = this;
var params = swiper.params.mousewheel;
if (newEvent.direction < 0) {
if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) {
// Return true to animate scroll on edges
return true;
}
} else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) {
// Return true to animate scroll on edges
return true;
}
return false;
},
enable: function enable() {
var swiper = this;
var event = Mousewheel.event();
if (swiper.params.cssMode) {
swiper.wrapperEl.removeEventListener(event, swiper.mousewheel.handle);
return true;
}
if (!event) return false;
if (swiper.mousewheel.enabled) return false;
var target = swiper.$el;
if (swiper.params.mousewheel.eventsTarget !== 'container') {
target = $(swiper.params.mousewheel.eventsTarget);
}
target.on('mouseenter', swiper.mousewheel.handleMouseEnter);
target.on('mouseleave', swiper.mousewheel.handleMouseLeave);
target.on(event, swiper.mousewheel.handle);
swiper.mousewheel.enabled = true;
return true;
},
disable: function disable() {
var swiper = this;
var event = Mousewheel.event();
if (swiper.params.cssMode) {
swiper.wrapperEl.addEventListener(event, swiper.mousewheel.handle);
return true;
}
if (!event) return false;
if (!swiper.mousewheel.enabled) return false;
var target = swiper.$el;
if (swiper.params.mousewheel.eventsTarget !== 'container') {
target = $(swiper.params.mousewheel.eventsTarget);
}
target.off(event, swiper.mousewheel.handle);
swiper.mousewheel.enabled = false;
return true;
}
};
export default {
name: 'mousewheel',
params: {
mousewheel: {
enabled: false,
releaseOnEdges: false,
invert: false,
forceToAxis: false,
sensitivity: 1,
eventsTarget: 'container',
thresholdDelta: null,
thresholdTime: null
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
mousewheel: {
enabled: false,
lastScrollTime: now(),
lastEventBeforeSnap: undefined,
recentWheelEvents: [],
enable: Mousewheel.enable,
disable: Mousewheel.disable,
handle: Mousewheel.handle,
handleMouseEnter: Mousewheel.handleMouseEnter,
handleMouseLeave: Mousewheel.handleMouseLeave,
animateSlider: Mousewheel.animateSlider,
releaseScroll: Mousewheel.releaseScroll
}
});
},
on: {
init: function init(swiper) {
if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) {
swiper.mousewheel.disable();
}
if (swiper.params.mousewheel.enabled) swiper.mousewheel.enable();
},
destroy: function destroy(swiper) {
if (swiper.params.cssMode) {
swiper.mousewheel.enable();
}
if (swiper.mousewheel.enabled) swiper.mousewheel.disable();
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/navigation/navigation.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import $ from '../../utils/dom';
import { extend, bindModuleMethods, createElementIfNotDefined } from '../../utils/utils';
var Navigation = {
toggleEl: function toggleEl($el, disabled) {
$el[disabled ? 'addClass' : 'removeClass'](this.params.navigation.disabledClass);
if ($el[0] && $el[0].tagName === 'BUTTON') $el[0].disabled = disabled;
},
update: function update() {
// Update Navigation Buttons
var swiper = this;
var params = swiper.params.navigation;
var toggleEl = swiper.navigation.toggleEl;
if (swiper.params.loop) return;
var _swiper$navigation = swiper.navigation,
$nextEl = _swiper$navigation.$nextEl,
$prevEl = _swiper$navigation.$prevEl;
if ($prevEl && $prevEl.length > 0) {
if (swiper.isBeginning) {
toggleEl($prevEl, true);
} else {
toggleEl($prevEl, false);
}
if (swiper.params.watchOverflow && swiper.enabled) {
$prevEl[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
}
}
if ($nextEl && $nextEl.length > 0) {
if (swiper.isEnd) {
toggleEl($nextEl, true);
} else {
toggleEl($nextEl, false);
}
if (swiper.params.watchOverflow && swiper.enabled) {
$nextEl[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
}
}
},
onPrevClick: function onPrevClick(e) {
var swiper = this;
e.preventDefault();
if (swiper.isBeginning && !swiper.params.loop) return;
swiper.slidePrev();
},
onNextClick: function onNextClick(e) {
var swiper = this;
e.preventDefault();
if (swiper.isEnd && !swiper.params.loop) return;
swiper.slideNext();
},
init: function init() {
var swiper = this;
var params = swiper.params.navigation;
swiper.params.navigation = createElementIfNotDefined(swiper.$el, swiper.params.navigation, swiper.params.createElements, {
nextEl: 'swiper-button-next',
prevEl: 'swiper-button-prev'
});
if (!(params.nextEl || params.prevEl)) return;
var $nextEl;
var $prevEl;
if (params.nextEl) {
$nextEl = $(params.nextEl);
if (swiper.params.uniqueNavElements && typeof params.nextEl === 'string' && $nextEl.length > 1 && swiper.$el.find(params.nextEl).length === 1) {
$nextEl = swiper.$el.find(params.nextEl);
}
}
if (params.prevEl) {
$prevEl = $(params.prevEl);
if (swiper.params.uniqueNavElements && typeof params.prevEl === 'string' && $prevEl.length > 1 && swiper.$el.find(params.prevEl).length === 1) {
$prevEl = swiper.$el.find(params.prevEl);
}
}
if ($nextEl && $nextEl.length > 0) {
$nextEl.on('click', swiper.navigation.onNextClick);
}
if ($prevEl && $prevEl.length > 0) {
$prevEl.on('click', swiper.navigation.onPrevClick);
}
extend(swiper.navigation, {
$nextEl: $nextEl,
nextEl: $nextEl && $nextEl[0],
$prevEl: $prevEl,
prevEl: $prevEl && $prevEl[0]
});
if (!swiper.enabled) {
if ($nextEl) $nextEl.addClass(params.lockClass);
if ($prevEl) $prevEl.addClass(params.lockClass);
}
},
destroy: function destroy() {
var swiper = this;
var _swiper$navigation2 = swiper.navigation,
$nextEl = _swiper$navigation2.$nextEl,
$prevEl = _swiper$navigation2.$prevEl;
if ($nextEl && $nextEl.length) {
$nextEl.off('click', swiper.navigation.onNextClick);
$nextEl.removeClass(swiper.params.navigation.disabledClass);
}
if ($prevEl && $prevEl.length) {
$prevEl.off('click', swiper.navigation.onPrevClick);
$prevEl.removeClass(swiper.params.navigation.disabledClass);
}
}
};
export default {
name: 'navigation',
params: {
navigation: {
nextEl: null,
prevEl: null,
hideOnClick: false,
disabledClass: 'swiper-button-disabled',
hiddenClass: 'swiper-button-hidden',
lockClass: 'swiper-button-lock'
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
navigation: _extends({}, Navigation)
});
},
on: {
init: function init(swiper) {
swiper.navigation.init();
swiper.navigation.update();
},
toEdge: function toEdge(swiper) {
swiper.navigation.update();
},
fromEdge: function fromEdge(swiper) {
swiper.navigation.update();
},
destroy: function destroy(swiper) {
swiper.navigation.destroy();
},
'enable disable': function enableDisable(swiper) {
var _swiper$navigation3 = swiper.navigation,
$nextEl = _swiper$navigation3.$nextEl,
$prevEl = _swiper$navigation3.$prevEl;
if ($nextEl) {
$nextEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass);
}
if ($prevEl) {
$prevEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass);
}
},
click: function click(swiper, e) {
var _swiper$navigation4 = swiper.navigation,
$nextEl = _swiper$navigation4.$nextEl,
$prevEl = _swiper$navigation4.$prevEl;
var targetEl = e.target;
if (swiper.params.navigation.hideOnClick && !$(targetEl).is($prevEl) && !$(targetEl).is($nextEl)) {
if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
var isHidden;
if ($nextEl) {
isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass);
} else if ($prevEl) {
isHidden = $prevEl.hasClass(swiper.params.navigation.hiddenClass);
}
if (isHidden === true) {
swiper.emit('navigationShow');
} else {
swiper.emit('navigationHide');
}
if ($nextEl) {
$nextEl.toggleClass(swiper.params.navigation.hiddenClass);
}
if ($prevEl) {
$prevEl.toggleClass(swiper.params.navigation.hiddenClass);
}
}
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/pagination/pagination.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import $ from '../../utils/dom';
import { extend, bindModuleMethods, classesToSelector, createElementIfNotDefined } from '../../utils/utils';
var Pagination = {
update: function update() {
// Render || Update Pagination bullets/items
var swiper = this;
var rtl = swiper.rtl;
var params = swiper.params.pagination;
if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;
var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
var $el = swiper.pagination.$el; // Current/Total
var current;
var total = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
if (swiper.params.loop) {
current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup);
if (current > slidesLength - 1 - swiper.loopedSlides * 2) {
current -= slidesLength - swiper.loopedSlides * 2;
}
if (current > total - 1) current -= total;
if (current < 0 && swiper.params.paginationType !== 'bullets') current = total + current;
} else if (typeof swiper.snapIndex !== 'undefined') {
current = swiper.snapIndex;
} else {
current = swiper.activeIndex || 0;
} // Types
if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
var bullets = swiper.pagination.bullets;
var firstIndex;
var lastIndex;
var midIndex;
if (params.dynamicBullets) {
swiper.pagination.bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true);
$el.css(swiper.isHorizontal() ? 'width' : 'height', swiper.pagination.bulletSize * (params.dynamicMainBullets + 4) + "px");
if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) {
swiper.pagination.dynamicBulletIndex += current - swiper.previousIndex;
if (swiper.pagination.dynamicBulletIndex > params.dynamicMainBullets - 1) {
swiper.pagination.dynamicBulletIndex = params.dynamicMainBullets - 1;
} else if (swiper.pagination.dynamicBulletIndex < 0) {
swiper.pagination.dynamicBulletIndex = 0;
}
}
firstIndex = current - swiper.pagination.dynamicBulletIndex;
lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
midIndex = (lastIndex + firstIndex) / 2;
}
bullets.removeClass(params.bulletActiveClass + " " + params.bulletActiveClass + "-next " + params.bulletActiveClass + "-next-next " + params.bulletActiveClass + "-prev " + params.bulletActiveClass + "-prev-prev " + params.bulletActiveClass + "-main");
if ($el.length > 1) {
bullets.each(function (bullet) {
var $bullet = $(bullet);
var bulletIndex = $bullet.index();
if (bulletIndex === current) {
$bullet.addClass(params.bulletActiveClass);
}
if (params.dynamicBullets) {
if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
$bullet.addClass(params.bulletActiveClass + "-main");
}
if (bulletIndex === firstIndex) {
$bullet.prev().addClass(params.bulletActiveClass + "-prev").prev().addClass(params.bulletActiveClass + "-prev-prev");
}
if (bulletIndex === lastIndex) {
$bullet.next().addClass(params.bulletActiveClass + "-next").next().addClass(params.bulletActiveClass + "-next-next");
}
}
});
} else {
var $bullet = bullets.eq(current);
var bulletIndex = $bullet.index();
$bullet.addClass(params.bulletActiveClass);
if (params.dynamicBullets) {
var $firstDisplayedBullet = bullets.eq(firstIndex);
var $lastDisplayedBullet = bullets.eq(lastIndex);
for (var i = firstIndex; i <= lastIndex; i += 1) {
bullets.eq(i).addClass(params.bulletActiveClass + "-main");
}
if (swiper.params.loop) {
if (bulletIndex >= bullets.length - params.dynamicMainBullets) {
for (var _i = params.dynamicMainBullets; _i >= 0; _i -= 1) {
bullets.eq(bullets.length - _i).addClass(params.bulletActiveClass + "-main");
}
bullets.eq(bullets.length - params.dynamicMainBullets - 1).addClass(params.bulletActiveClass + "-prev");
} else {
$firstDisplayedBullet.prev().addClass(params.bulletActiveClass + "-prev").prev().addClass(params.bulletActiveClass + "-prev-prev");
$lastDisplayedBullet.next().addClass(params.bulletActiveClass + "-next").next().addClass(params.bulletActiveClass + "-next-next");
}
} else {
$firstDisplayedBullet.prev().addClass(params.bulletActiveClass + "-prev").prev().addClass(params.bulletActiveClass + "-prev-prev");
$lastDisplayedBullet.next().addClass(params.bulletActiveClass + "-next").next().addClass(params.bulletActiveClass + "-next-next");
}
}
}
if (params.dynamicBullets) {
var dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
var bulletsOffset = (swiper.pagination.bulletSize * dynamicBulletsLength - swiper.pagination.bulletSize) / 2 - midIndex * swiper.pagination.bulletSize;
var offsetProp = rtl ? 'right' : 'left';
bullets.css(swiper.isHorizontal() ? offsetProp : 'top', bulletsOffset + "px");
}
}
if (params.type === 'fraction') {
$el.find(classesToSelector(params.currentClass)).text(params.formatFractionCurrent(current + 1));
$el.find(classesToSelector(params.totalClass)).text(params.formatFractionTotal(total));
}
if (params.type === 'progressbar') {
var progressbarDirection;
if (params.progressbarOpposite) {
progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
} else {
progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
}
var scale = (current + 1) / total;
var scaleX = 1;
var scaleY = 1;
if (progressbarDirection === 'horizontal') {
scaleX = scale;
} else {
scaleY = scale;
}
$el.find(classesToSelector(params.progressbarFillClass)).transform("translate3d(0,0,0) scaleX(" + scaleX + ") scaleY(" + scaleY + ")").transition(swiper.params.speed);
}
if (params.type === 'custom' && params.renderCustom) {
$el.html(params.renderCustom(swiper, current + 1, total));
swiper.emit('paginationRender', $el[0]);
} else {
swiper.emit('paginationUpdate', $el[0]);
}
if (swiper.params.watchOverflow && swiper.enabled) {
$el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
}
},
render: function render() {
// Render Container
var swiper = this;
var params = swiper.params.pagination;
if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;
var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
var $el = swiper.pagination.$el;
var paginationHTML = '';
if (params.type === 'bullets') {
var numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
if (swiper.params.freeMode && !swiper.params.loop && numberOfBullets > slidesLength) {
numberOfBullets = slidesLength;
}
for (var i = 0; i < numberOfBullets; i += 1) {
if (params.renderBullet) {
paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
} else {
paginationHTML += "<" + params.bulletElement + " class=\"" + params.bulletClass + "\"></" + params.bulletElement + ">";
}
}
$el.html(paginationHTML);
swiper.pagination.bullets = $el.find(classesToSelector(params.bulletClass));
}
if (params.type === 'fraction') {
if (params.renderFraction) {
paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
} else {
paginationHTML = "<span class=\"" + params.currentClass + "\"></span>" + ' / ' + ("<span class=\"" + params.totalClass + "\"></span>");
}
$el.html(paginationHTML);
}
if (params.type === 'progressbar') {
if (params.renderProgressbar) {
paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
} else {
paginationHTML = "<span class=\"" + params.progressbarFillClass + "\"></span>";
}
$el.html(paginationHTML);
}
if (params.type !== 'custom') {
swiper.emit('paginationRender', swiper.pagination.$el[0]);
}
},
init: function init() {
var swiper = this;
swiper.params.pagination = createElementIfNotDefined(swiper.$el, swiper.params.pagination, swiper.params.createElements, {
el: 'swiper-pagination'
});
var params = swiper.params.pagination;
if (!params.el) return;
var $el = $(params.el);
if ($el.length === 0) return;
if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1) {
$el = swiper.$el.find(params.el);
}
if (params.type === 'bullets' && params.clickable) {
$el.addClass(params.clickableClass);
}
$el.addClass(params.modifierClass + params.type);
if (params.type === 'bullets' && params.dynamicBullets) {
$el.addClass("" + params.modifierClass + params.type + "-dynamic");
swiper.pagination.dynamicBulletIndex = 0;
if (params.dynamicMainBullets < 1) {
params.dynamicMainBullets = 1;
}
}
if (params.type === 'progressbar' && params.progressbarOpposite) {
$el.addClass(params.progressbarOppositeClass);
}
if (params.clickable) {
$el.on('click', classesToSelector(params.bulletClass), function onClick(e) {
e.preventDefault();
var index = $(this).index() * swiper.params.slidesPerGroup;
if (swiper.params.loop) index += swiper.loopedSlides;
swiper.slideTo(index);
});
}
extend(swiper.pagination, {
$el: $el,
el: $el[0]
});
if (!swiper.enabled) {
$el.addClass(params.lockClass);
}
},
destroy: function destroy() {
var swiper = this;
var params = swiper.params.pagination;
if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;
var $el = swiper.pagination.$el;
$el.removeClass(params.hiddenClass);
$el.removeClass(params.modifierClass + params.type);
if (swiper.pagination.bullets) swiper.pagination.bullets.removeClass(params.bulletActiveClass);
if (params.clickable) {
$el.off('click', classesToSelector(params.bulletClass));
}
}
};
export default {
name: 'pagination',
params: {
pagination: {
el: null,
bulletElement: 'span',
clickable: false,
hideOnClick: false,
renderBullet: null,
renderProgressbar: null,
renderFraction: null,
renderCustom: null,
progressbarOpposite: false,
type: 'bullets',
// 'bullets' or 'progressbar' or 'fraction' or 'custom'
dynamicBullets: false,
dynamicMainBullets: 1,
formatFractionCurrent: function formatFractionCurrent(number) {
return number;
},
formatFractionTotal: function formatFractionTotal(number) {
return number;
},
bulletClass: 'swiper-pagination-bullet',
bulletActiveClass: 'swiper-pagination-bullet-active',
modifierClass: 'swiper-pagination-',
// NEW
currentClass: 'swiper-pagination-current',
totalClass: 'swiper-pagination-total',
hiddenClass: 'swiper-pagination-hidden',
progressbarFillClass: 'swiper-pagination-progressbar-fill',
progressbarOppositeClass: 'swiper-pagination-progressbar-opposite',
clickableClass: 'swiper-pagination-clickable',
// NEW
lockClass: 'swiper-pagination-lock'
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
pagination: _extends({
dynamicBulletIndex: 0
}, Pagination)
});
},
on: {
init: function init(swiper) {
swiper.pagination.init();
swiper.pagination.render();
swiper.pagination.update();
},
activeIndexChange: function activeIndexChange(swiper) {
if (swiper.params.loop) {
swiper.pagination.update();
} else if (typeof swiper.snapIndex === 'undefined') {
swiper.pagination.update();
}
},
snapIndexChange: function snapIndexChange(swiper) {
if (!swiper.params.loop) {
swiper.pagination.update();
}
},
slidesLengthChange: function slidesLengthChange(swiper) {
if (swiper.params.loop) {
swiper.pagination.render();
swiper.pagination.update();
}
},
snapGridLengthChange: function snapGridLengthChange(swiper) {
if (!swiper.params.loop) {
swiper.pagination.render();
swiper.pagination.update();
}
},
destroy: function destroy(swiper) {
swiper.pagination.destroy();
},
'enable disable': function enableDisable(swiper) {
var $el = swiper.pagination.$el;
if ($el) {
$el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.pagination.lockClass);
}
},
click: function click(swiper, e) {
var targetEl = e.target;
if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && swiper.pagination.$el.length > 0 && !$(targetEl).hasClass(swiper.params.pagination.bulletClass)) {
if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;
var isHidden = swiper.pagination.$el.hasClass(swiper.params.pagination.hiddenClass);
if (isHidden === true) {
swiper.emit('paginationShow');
} else {
swiper.emit('paginationHide');
}
swiper.pagination.$el.toggleClass(swiper.params.pagination.hiddenClass);
}
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/scrollbar/scrollbar.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { getDocument } from 'ssr-window';
import $ from '../../utils/dom';
import { extend, nextTick, bindModuleMethods, createElementIfNotDefined } from '../../utils/utils';
var Scrollbar = {
setTranslate: function setTranslate() {
var swiper = this;
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
var scrollbar = swiper.scrollbar,
rtl = swiper.rtlTranslate,
progress = swiper.progress;
var dragSize = scrollbar.dragSize,
trackSize = scrollbar.trackSize,
$dragEl = scrollbar.$dragEl,
$el = scrollbar.$el;
var params = swiper.params.scrollbar;
var newSize = dragSize;
var newPos = (trackSize - dragSize) * progress;
if (rtl) {
newPos = -newPos;
if (newPos > 0) {
newSize = dragSize - newPos;
newPos = 0;
} else if (-newPos + dragSize > trackSize) {
newSize = trackSize + newPos;
}
} else if (newPos < 0) {
newSize = dragSize + newPos;
newPos = 0;
} else if (newPos + dragSize > trackSize) {
newSize = trackSize - newPos;
}
if (swiper.isHorizontal()) {
$dragEl.transform("translate3d(" + newPos + "px, 0, 0)");
$dragEl[0].style.width = newSize + "px";
} else {
$dragEl.transform("translate3d(0px, " + newPos + "px, 0)");
$dragEl[0].style.height = newSize + "px";
}
if (params.hide) {
clearTimeout(swiper.scrollbar.timeout);
$el[0].style.opacity = 1;
swiper.scrollbar.timeout = setTimeout(function () {
$el[0].style.opacity = 0;
$el.transition(400);
}, 1000);
}
},
setTransition: function setTransition(duration) {
var swiper = this;
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
swiper.scrollbar.$dragEl.transition(duration);
},
updateSize: function updateSize() {
var swiper = this;
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
var scrollbar = swiper.scrollbar;
var $dragEl = scrollbar.$dragEl,
$el = scrollbar.$el;
$dragEl[0].style.width = '';
$dragEl[0].style.height = '';
var trackSize = swiper.isHorizontal() ? $el[0].offsetWidth : $el[0].offsetHeight;
var divider = swiper.size / swiper.virtualSize;
var moveDivider = divider * (trackSize / swiper.size);
var dragSize;
if (swiper.params.scrollbar.dragSize === 'auto') {
dragSize = trackSize * divider;
} else {
dragSize = parseInt(swiper.params.scrollbar.dragSize, 10);
}
if (swiper.isHorizontal()) {
$dragEl[0].style.width = dragSize + "px";
} else {
$dragEl[0].style.height = dragSize + "px";
}
if (divider >= 1) {
$el[0].style.display = 'none';
} else {
$el[0].style.display = '';
}
if (swiper.params.scrollbar.hide) {
$el[0].style.opacity = 0;
}
extend(scrollbar, {
trackSize: trackSize,
divider: divider,
moveDivider: moveDivider,
dragSize: dragSize
});
if (swiper.params.watchOverflow && swiper.enabled) {
scrollbar.$el[swiper.isLocked ? 'addClass' : 'removeClass'](swiper.params.scrollbar.lockClass);
}
},
getPointerPosition: function getPointerPosition(e) {
var swiper = this;
if (swiper.isHorizontal()) {
return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientX : e.clientX;
}
return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientY : e.clientY;
},
setDragPosition: function setDragPosition(e) {
var swiper = this;
var scrollbar = swiper.scrollbar,
rtl = swiper.rtlTranslate;
var $el = scrollbar.$el,
dragSize = scrollbar.dragSize,
trackSize = scrollbar.trackSize,
dragStartPos = scrollbar.dragStartPos;
var positionRatio;
positionRatio = (scrollbar.getPointerPosition(e) - $el.offset()[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize);
positionRatio = Math.max(Math.min(positionRatio, 1), 0);
if (rtl) {
positionRatio = 1 - positionRatio;
}
var position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio;
swiper.updateProgress(position);
swiper.setTranslate(position);
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
},
onDragStart: function onDragStart(e) {
var swiper = this;
var params = swiper.params.scrollbar;
var scrollbar = swiper.scrollbar,
$wrapperEl = swiper.$wrapperEl;
var $el = scrollbar.$el,
$dragEl = scrollbar.$dragEl;
swiper.scrollbar.isTouched = true;
swiper.scrollbar.dragStartPos = e.target === $dragEl[0] || e.target === $dragEl ? scrollbar.getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null;
e.preventDefault();
e.stopPropagation();
$wrapperEl.transition(100);
$dragEl.transition(100);
scrollbar.setDragPosition(e);
clearTimeout(swiper.scrollbar.dragTimeout);
$el.transition(0);
if (params.hide) {
$el.css('opacity', 1);
}
if (swiper.params.cssMode) {
swiper.$wrapperEl.css('scroll-snap-type', 'none');
}
swiper.emit('scrollbarDragStart', e);
},
onDragMove: function onDragMove(e) {
var swiper = this;
var scrollbar = swiper.scrollbar,
$wrapperEl = swiper.$wrapperEl;
var $el = scrollbar.$el,
$dragEl = scrollbar.$dragEl;
if (!swiper.scrollbar.isTouched) return;
if (e.preventDefault) e.preventDefault();else e.returnValue = false;
scrollbar.setDragPosition(e);
$wrapperEl.transition(0);
$el.transition(0);
$dragEl.transition(0);
swiper.emit('scrollbarDragMove', e);
},
onDragEnd: function onDragEnd(e) {
var swiper = this;
var params = swiper.params.scrollbar;
var scrollbar = swiper.scrollbar,
$wrapperEl = swiper.$wrapperEl;
var $el = scrollbar.$el;
if (!swiper.scrollbar.isTouched) return;
swiper.scrollbar.isTouched = false;
if (swiper.params.cssMode) {
swiper.$wrapperEl.css('scroll-snap-type', '');
$wrapperEl.transition('');
}
if (params.hide) {
clearTimeout(swiper.scrollbar.dragTimeout);
swiper.scrollbar.dragTimeout = nextTick(function () {
$el.css('opacity', 0);
$el.transition(400);
}, 1000);
}
swiper.emit('scrollbarDragEnd', e);
if (params.snapOnRelease) {
swiper.slideToClosest();
}
},
enableDraggable: function enableDraggable() {
var swiper = this;
if (!swiper.params.scrollbar.el) return;
var document = getDocument();
var scrollbar = swiper.scrollbar,
touchEventsTouch = swiper.touchEventsTouch,
touchEventsDesktop = swiper.touchEventsDesktop,
params = swiper.params,
support = swiper.support;
var $el = scrollbar.$el;
var target = $el[0];
var activeListener = support.passiveListener && params.passiveListeners ? {
passive: false,
capture: false
} : false;
var passiveListener = support.passiveListener && params.passiveListeners ? {
passive: true,
capture: false
} : false;
if (!target) return;
if (!support.touch) {
target.addEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);
document.addEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);
document.addEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);
} else {
target.addEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);
target.addEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);
target.addEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);
}
},
disableDraggable: function disableDraggable() {
var swiper = this;
if (!swiper.params.scrollbar.el) return;
var document = getDocument();
var scrollbar = swiper.scrollbar,
touchEventsTouch = swiper.touchEventsTouch,
touchEventsDesktop = swiper.touchEventsDesktop,
params = swiper.params,
support = swiper.support;
var $el = scrollbar.$el;
var target = $el[0];
var activeListener = support.passiveListener && params.passiveListeners ? {
passive: false,
capture: false
} : false;
var passiveListener = support.passiveListener && params.passiveListeners ? {
passive: true,
capture: false
} : false;
if (!target) return;
if (!support.touch) {
target.removeEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);
document.removeEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);
document.removeEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);
} else {
target.removeEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);
target.removeEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);
target.removeEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);
}
},
init: function init() {
var swiper = this;
var scrollbar = swiper.scrollbar,
$swiperEl = swiper.$el;
swiper.params.scrollbar = createElementIfNotDefined($swiperEl, swiper.params.scrollbar, swiper.params.createElements, {
el: 'swiper-scrollbar'
});
var params = swiper.params.scrollbar;
if (!params.el) return;
var $el = $(params.el);
if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1 && $swiperEl.find(params.el).length === 1) {
$el = $swiperEl.find(params.el);
}
var $dragEl = $el.find("." + swiper.params.scrollbar.dragClass);
if ($dragEl.length === 0) {
$dragEl = $("<div class=\"" + swiper.params.scrollbar.dragClass + "\"></div>");
$el.append($dragEl);
}
extend(scrollbar, {
$el: $el,
el: $el[0],
$dragEl: $dragEl,
dragEl: $dragEl[0]
});
if (params.draggable) {
scrollbar.enableDraggable();
}
if ($el) {
$el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass);
}
},
destroy: function destroy() {
var swiper = this;
swiper.scrollbar.disableDraggable();
}
};
export default {
name: 'scrollbar',
params: {
scrollbar: {
el: null,
dragSize: 'auto',
hide: false,
draggable: false,
snapOnRelease: true,
lockClass: 'swiper-scrollbar-lock',
dragClass: 'swiper-scrollbar-drag'
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
scrollbar: _extends({
isTouched: false,
timeout: null,
dragTimeout: null
}, Scrollbar)
});
},
on: {
init: function init(swiper) {
swiper.scrollbar.init();
swiper.scrollbar.updateSize();
swiper.scrollbar.setTranslate();
},
update: function update(swiper) {
swiper.scrollbar.updateSize();
},
resize: function resize(swiper) {
swiper.scrollbar.updateSize();
},
observerUpdate: function observerUpdate(swiper) {
swiper.scrollbar.updateSize();
},
setTranslate: function setTranslate(swiper) {
swiper.scrollbar.setTranslate();
},
setTransition: function setTransition(swiper, duration) {
swiper.scrollbar.setTransition(duration);
},
'enable disable': function enableDisable(swiper) {
var $el = swiper.scrollbar.$el;
if ($el) {
$el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass);
}
},
destroy: function destroy(swiper) {
swiper.scrollbar.destroy();
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/parallax/parallax.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import $ from '../../utils/dom';
import { bindModuleMethods } from '../../utils/utils';
var Parallax = {
setTransform: function setTransform(el, progress) {
var swiper = this;
var rtl = swiper.rtl;
var $el = $(el);
var rtlFactor = rtl ? -1 : 1;
var p = $el.attr('data-swiper-parallax') || '0';
var x = $el.attr('data-swiper-parallax-x');
var y = $el.attr('data-swiper-parallax-y');
var scale = $el.attr('data-swiper-parallax-scale');
var opacity = $el.attr('data-swiper-parallax-opacity');
if (x || y) {
x = x || '0';
y = y || '0';
} else if (swiper.isHorizontal()) {
x = p;
y = '0';
} else {
y = p;
x = '0';
}
if (x.indexOf('%') >= 0) {
x = parseInt(x, 10) * progress * rtlFactor + "%";
} else {
x = x * progress * rtlFactor + "px";
}
if (y.indexOf('%') >= 0) {
y = parseInt(y, 10) * progress + "%";
} else {
y = y * progress + "px";
}
if (typeof opacity !== 'undefined' && opacity !== null) {
var currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress));
$el[0].style.opacity = currentOpacity;
}
if (typeof scale === 'undefined' || scale === null) {
$el.transform("translate3d(" + x + ", " + y + ", 0px)");
} else {
var currentScale = scale - (scale - 1) * (1 - Math.abs(progress));
$el.transform("translate3d(" + x + ", " + y + ", 0px) scale(" + currentScale + ")");
}
},
setTranslate: function setTranslate() {
var swiper = this;
var $el = swiper.$el,
slides = swiper.slides,
progress = swiper.progress,
snapGrid = swiper.snapGrid;
$el.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(function (el) {
swiper.parallax.setTransform(el, progress);
});
slides.each(function (slideEl, slideIndex) {
var slideProgress = slideEl.progress;
if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') {
slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1);
}
slideProgress = Math.min(Math.max(slideProgress, -1), 1);
$(slideEl).find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(function (el) {
swiper.parallax.setTransform(el, slideProgress);
});
});
},
setTransition: function setTransition(duration) {
if (duration === void 0) {
duration = this.params.speed;
}
var swiper = this;
var $el = swiper.$el;
$el.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(function (parallaxEl) {
var $parallaxEl = $(parallaxEl);
var parallaxDuration = parseInt($parallaxEl.attr('data-swiper-parallax-duration'), 10) || duration;
if (duration === 0) parallaxDuration = 0;
$parallaxEl.transition(parallaxDuration);
});
}
};
export default {
name: 'parallax',
params: {
parallax: {
enabled: false
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
parallax: _extends({}, Parallax)
});
},
on: {
beforeInit: function beforeInit(swiper) {
if (!swiper.params.parallax.enabled) return;
swiper.params.watchSlidesProgress = true;
swiper.originalParams.watchSlidesProgress = true;
},
init: function init(swiper) {
if (!swiper.params.parallax.enabled) return;
swiper.parallax.setTranslate();
},
setTranslate: function setTranslate(swiper) {
if (!swiper.params.parallax.enabled) return;
swiper.parallax.setTranslate();
},
setTransition: function setTransition(swiper, duration) {
if (!swiper.params.parallax.enabled) return;
swiper.parallax.setTransition(duration);
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/zoom/zoom.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { getWindow } from 'ssr-window';
import $ from '../../utils/dom';
import { bindModuleMethods, getTranslate } from '../../utils/utils';
var Zoom = {
// Calc Scale From Multi-touches
getDistanceBetweenTouches: function getDistanceBetweenTouches(e) {
if (e.targetTouches.length < 2) return 1;
var x1 = e.targetTouches[0].pageX;
var y1 = e.targetTouches[0].pageY;
var x2 = e.targetTouches[1].pageX;
var y2 = e.targetTouches[1].pageY;
var distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
return distance;
},
// Events
onGestureStart: function onGestureStart(e) {
var swiper = this;
var support = swiper.support;
var params = swiper.params.zoom;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
zoom.fakeGestureTouched = false;
zoom.fakeGestureMoved = false;
if (!support.gestures) {
if (e.type !== 'touchstart' || e.type === 'touchstart' && e.targetTouches.length < 2) {
return;
}
zoom.fakeGestureTouched = true;
gesture.scaleStart = Zoom.getDistanceBetweenTouches(e);
}
if (!gesture.$slideEl || !gesture.$slideEl.length) {
gesture.$slideEl = $(e.target).closest("." + swiper.params.slideClass);
if (gesture.$slideEl.length === 0) gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas, picture, .swiper-zoom-target');
gesture.$imageWrapEl = gesture.$imageEl.parent("." + params.containerClass);
gesture.maxRatio = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
if (gesture.$imageWrapEl.length === 0) {
gesture.$imageEl = undefined;
return;
}
}
if (gesture.$imageEl) {
gesture.$imageEl.transition(0);
}
swiper.zoom.isScaling = true;
},
onGestureChange: function onGestureChange(e) {
var swiper = this;
var support = swiper.support;
var params = swiper.params.zoom;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
if (!support.gestures) {
if (e.type !== 'touchmove' || e.type === 'touchmove' && e.targetTouches.length < 2) {
return;
}
zoom.fakeGestureMoved = true;
gesture.scaleMove = Zoom.getDistanceBetweenTouches(e);
}
if (!gesture.$imageEl || gesture.$imageEl.length === 0) {
if (e.type === 'gesturechange') zoom.onGestureStart(e);
return;
}
if (support.gestures) {
zoom.scale = e.scale * zoom.currentScale;
} else {
zoom.scale = gesture.scaleMove / gesture.scaleStart * zoom.currentScale;
}
if (zoom.scale > gesture.maxRatio) {
zoom.scale = gesture.maxRatio - 1 + Math.pow(zoom.scale - gesture.maxRatio + 1, 0.5);
}
if (zoom.scale < params.minRatio) {
zoom.scale = params.minRatio + 1 - Math.pow(params.minRatio - zoom.scale + 1, 0.5);
}
gesture.$imageEl.transform("translate3d(0,0,0) scale(" + zoom.scale + ")");
},
onGestureEnd: function onGestureEnd(e) {
var swiper = this;
var device = swiper.device;
var support = swiper.support;
var params = swiper.params.zoom;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
if (!support.gestures) {
if (!zoom.fakeGestureTouched || !zoom.fakeGestureMoved) {
return;
}
if (e.type !== 'touchend' || e.type === 'touchend' && e.changedTouches.length < 2 && !device.android) {
return;
}
zoom.fakeGestureTouched = false;
zoom.fakeGestureMoved = false;
}
if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio);
gesture.$imageEl.transition(swiper.params.speed).transform("translate3d(0,0,0) scale(" + zoom.scale + ")");
zoom.currentScale = zoom.scale;
zoom.isScaling = false;
if (zoom.scale === 1) gesture.$slideEl = undefined;
},
onTouchStart: function onTouchStart(e) {
var swiper = this;
var device = swiper.device;
var zoom = swiper.zoom;
var gesture = zoom.gesture,
image = zoom.image;
if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
if (image.isTouched) return;
if (device.android && e.cancelable) e.preventDefault();
image.isTouched = true;
image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
},
onTouchMove: function onTouchMove(e) {
var swiper = this;
var zoom = swiper.zoom;
var gesture = zoom.gesture,
image = zoom.image,
velocity = zoom.velocity;
if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
swiper.allowClick = false;
if (!image.isTouched || !gesture.$slideEl) return;
if (!image.isMoved) {
image.width = gesture.$imageEl[0].offsetWidth;
image.height = gesture.$imageEl[0].offsetHeight;
image.startX = getTranslate(gesture.$imageWrapEl[0], 'x') || 0;
image.startY = getTranslate(gesture.$imageWrapEl[0], 'y') || 0;
gesture.slideWidth = gesture.$slideEl[0].offsetWidth;
gesture.slideHeight = gesture.$slideEl[0].offsetHeight;
gesture.$imageWrapEl.transition(0);
} // Define if we need image drag
var scaledWidth = image.width * zoom.scale;
var scaledHeight = image.height * zoom.scale;
if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) return;
image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0);
image.maxX = -image.minX;
image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);
image.maxY = -image.minY;
image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
if (!image.isMoved && !zoom.isScaling) {
if (swiper.isHorizontal() && (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x || Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)) {
image.isTouched = false;
return;
}
if (!swiper.isHorizontal() && (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y || Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)) {
image.isTouched = false;
return;
}
}
if (e.cancelable) {
e.preventDefault();
}
e.stopPropagation();
image.isMoved = true;
image.currentX = image.touchesCurrent.x - image.touchesStart.x + image.startX;
image.currentY = image.touchesCurrent.y - image.touchesStart.y + image.startY;
if (image.currentX < image.minX) {
image.currentX = image.minX + 1 - Math.pow(image.minX - image.currentX + 1, 0.8);
}
if (image.currentX > image.maxX) {
image.currentX = image.maxX - 1 + Math.pow(image.currentX - image.maxX + 1, 0.8);
}
if (image.currentY < image.minY) {
image.currentY = image.minY + 1 - Math.pow(image.minY - image.currentY + 1, 0.8);
}
if (image.currentY > image.maxY) {
image.currentY = image.maxY - 1 + Math.pow(image.currentY - image.maxY + 1, 0.8);
} // Velocity
if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x;
if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y;
if (!velocity.prevTime) velocity.prevTime = Date.now();
velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2;
velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2;
if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0;
if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0;
velocity.prevPositionX = image.touchesCurrent.x;
velocity.prevPositionY = image.touchesCurrent.y;
velocity.prevTime = Date.now();
gesture.$imageWrapEl.transform("translate3d(" + image.currentX + "px, " + image.currentY + "px,0)");
},
onTouchEnd: function onTouchEnd() {
var swiper = this;
var zoom = swiper.zoom;
var gesture = zoom.gesture,
image = zoom.image,
velocity = zoom.velocity;
if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
if (!image.isTouched || !image.isMoved) {
image.isTouched = false;
image.isMoved = false;
return;
}
image.isTouched = false;
image.isMoved = false;
var momentumDurationX = 300;
var momentumDurationY = 300;
var momentumDistanceX = velocity.x * momentumDurationX;
var newPositionX = image.currentX + momentumDistanceX;
var momentumDistanceY = velocity.y * momentumDurationY;
var newPositionY = image.currentY + momentumDistanceY; // Fix duration
if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x);
if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y);
var momentumDuration = Math.max(momentumDurationX, momentumDurationY);
image.currentX = newPositionX;
image.currentY = newPositionY; // Define if we need image drag
var scaledWidth = image.width * zoom.scale;
var scaledHeight = image.height * zoom.scale;
image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0);
image.maxX = -image.minX;
image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);
image.maxY = -image.minY;
image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX);
image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY);
gesture.$imageWrapEl.transition(momentumDuration).transform("translate3d(" + image.currentX + "px, " + image.currentY + "px,0)");
},
onTransitionEnd: function onTransitionEnd() {
var swiper = this;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
if (gesture.$slideEl && swiper.previousIndex !== swiper.activeIndex) {
if (gesture.$imageEl) {
gesture.$imageEl.transform('translate3d(0,0,0) scale(1)');
}
if (gesture.$imageWrapEl) {
gesture.$imageWrapEl.transform('translate3d(0,0,0)');
}
zoom.scale = 1;
zoom.currentScale = 1;
gesture.$slideEl = undefined;
gesture.$imageEl = undefined;
gesture.$imageWrapEl = undefined;
}
},
// Toggle Zoom
toggle: function toggle(e) {
var swiper = this;
var zoom = swiper.zoom;
if (zoom.scale && zoom.scale !== 1) {
// Zoom Out
zoom.out();
} else {
// Zoom In
zoom.in(e);
}
},
in: function _in(e) {
var swiper = this;
var window = getWindow();
var zoom = swiper.zoom;
var params = swiper.params.zoom;
var gesture = zoom.gesture,
image = zoom.image;
if (!gesture.$slideEl) {
if (e && e.target) {
gesture.$slideEl = $(e.target).closest("." + swiper.params.slideClass);
}
if (!gesture.$slideEl) {
if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) {
gesture.$slideEl = swiper.$wrapperEl.children("." + swiper.params.slideActiveClass);
} else {
gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
}
}
gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas, picture, .swiper-zoom-target');
gesture.$imageWrapEl = gesture.$imageEl.parent("." + params.containerClass);
}
if (!gesture.$imageEl || gesture.$imageEl.length === 0 || !gesture.$imageWrapEl || gesture.$imageWrapEl.length === 0) return;
gesture.$slideEl.addClass("" + params.zoomedSlideClass);
var touchX;
var touchY;
var offsetX;
var offsetY;
var diffX;
var diffY;
var translateX;
var translateY;
var imageWidth;
var imageHeight;
var scaledWidth;
var scaledHeight;
var translateMinX;
var translateMinY;
var translateMaxX;
var translateMaxY;
var slideWidth;
var slideHeight;
if (typeof image.touchesStart.x === 'undefined' && e) {
touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX;
touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY;
} else {
touchX = image.touchesStart.x;
touchY = image.touchesStart.y;
}
zoom.scale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
zoom.currentScale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
if (e) {
slideWidth = gesture.$slideEl[0].offsetWidth;
slideHeight = gesture.$slideEl[0].offsetHeight;
offsetX = gesture.$slideEl.offset().left + window.scrollX;
offsetY = gesture.$slideEl.offset().top + window.scrollY;
diffX = offsetX + slideWidth / 2 - touchX;
diffY = offsetY + slideHeight / 2 - touchY;
imageWidth = gesture.$imageEl[0].offsetWidth;
imageHeight = gesture.$imageEl[0].offsetHeight;
scaledWidth = imageWidth * zoom.scale;
scaledHeight = imageHeight * zoom.scale;
translateMinX = Math.min(slideWidth / 2 - scaledWidth / 2, 0);
translateMinY = Math.min(slideHeight / 2 - scaledHeight / 2, 0);
translateMaxX = -translateMinX;
translateMaxY = -translateMinY;
translateX = diffX * zoom.scale;
translateY = diffY * zoom.scale;
if (translateX < translateMinX) {
translateX = translateMinX;
}
if (translateX > translateMaxX) {
translateX = translateMaxX;
}
if (translateY < translateMinY) {
translateY = translateMinY;
}
if (translateY > translateMaxY) {
translateY = translateMaxY;
}
} else {
translateX = 0;
translateY = 0;
}
gesture.$imageWrapEl.transition(300).transform("translate3d(" + translateX + "px, " + translateY + "px,0)");
gesture.$imageEl.transition(300).transform("translate3d(0,0,0) scale(" + zoom.scale + ")");
},
out: function out() {
var swiper = this;
var zoom = swiper.zoom;
var params = swiper.params.zoom;
var gesture = zoom.gesture;
if (!gesture.$slideEl) {
if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) {
gesture.$slideEl = swiper.$wrapperEl.children("." + swiper.params.slideActiveClass);
} else {
gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
}
gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas, picture, .swiper-zoom-target');
gesture.$imageWrapEl = gesture.$imageEl.parent("." + params.containerClass);
}
if (!gesture.$imageEl || gesture.$imageEl.length === 0 || !gesture.$imageWrapEl || gesture.$imageWrapEl.length === 0) return;
zoom.scale = 1;
zoom.currentScale = 1;
gesture.$imageWrapEl.transition(300).transform('translate3d(0,0,0)');
gesture.$imageEl.transition(300).transform('translate3d(0,0,0) scale(1)');
gesture.$slideEl.removeClass("" + params.zoomedSlideClass);
gesture.$slideEl = undefined;
},
toggleGestures: function toggleGestures(method) {
var swiper = this;
var zoom = swiper.zoom;
var selector = zoom.slideSelector,
passive = zoom.passiveListener;
swiper.$wrapperEl[method]('gesturestart', selector, zoom.onGestureStart, passive);
swiper.$wrapperEl[method]('gesturechange', selector, zoom.onGestureChange, passive);
swiper.$wrapperEl[method]('gestureend', selector, zoom.onGestureEnd, passive);
},
enableGestures: function enableGestures() {
if (this.zoom.gesturesEnabled) return;
this.zoom.gesturesEnabled = true;
this.zoom.toggleGestures('on');
},
disableGestures: function disableGestures() {
if (!this.zoom.gesturesEnabled) return;
this.zoom.gesturesEnabled = false;
this.zoom.toggleGestures('off');
},
// Attach/Detach Events
enable: function enable() {
var swiper = this;
var support = swiper.support;
var zoom = swiper.zoom;
if (zoom.enabled) return;
zoom.enabled = true;
var passiveListener = swiper.touchEvents.start === 'touchstart' && support.passiveListener && swiper.params.passiveListeners ? {
passive: true,
capture: false
} : false;
var activeListenerWithCapture = support.passiveListener ? {
passive: false,
capture: true
} : true;
var slideSelector = "." + swiper.params.slideClass;
swiper.zoom.passiveListener = passiveListener;
swiper.zoom.slideSelector = slideSelector; // Scale image
if (support.gestures) {
swiper.$wrapperEl.on(swiper.touchEvents.start, swiper.zoom.enableGestures, passiveListener);
swiper.$wrapperEl.on(swiper.touchEvents.end, swiper.zoom.disableGestures, passiveListener);
} else if (swiper.touchEvents.start === 'touchstart') {
swiper.$wrapperEl.on(swiper.touchEvents.start, slideSelector, zoom.onGestureStart, passiveListener);
swiper.$wrapperEl.on(swiper.touchEvents.move, slideSelector, zoom.onGestureChange, activeListenerWithCapture);
swiper.$wrapperEl.on(swiper.touchEvents.end, slideSelector, zoom.onGestureEnd, passiveListener);
if (swiper.touchEvents.cancel) {
swiper.$wrapperEl.on(swiper.touchEvents.cancel, slideSelector, zoom.onGestureEnd, passiveListener);
}
} // Move image
swiper.$wrapperEl.on(swiper.touchEvents.move, "." + swiper.params.zoom.containerClass, zoom.onTouchMove, activeListenerWithCapture);
},
disable: function disable() {
var swiper = this;
var zoom = swiper.zoom;
if (!zoom.enabled) return;
var support = swiper.support;
swiper.zoom.enabled = false;
var passiveListener = swiper.touchEvents.start === 'touchstart' && support.passiveListener && swiper.params.passiveListeners ? {
passive: true,
capture: false
} : false;
var activeListenerWithCapture = support.passiveListener ? {
passive: false,
capture: true
} : true;
var slideSelector = "." + swiper.params.slideClass; // Scale image
if (support.gestures) {
swiper.$wrapperEl.off(swiper.touchEvents.start, swiper.zoom.enableGestures, passiveListener);
swiper.$wrapperEl.off(swiper.touchEvents.end, swiper.zoom.disableGestures, passiveListener);
} else if (swiper.touchEvents.start === 'touchstart') {
swiper.$wrapperEl.off(swiper.touchEvents.start, slideSelector, zoom.onGestureStart, passiveListener);
swiper.$wrapperEl.off(swiper.touchEvents.move, slideSelector, zoom.onGestureChange, activeListenerWithCapture);
swiper.$wrapperEl.off(swiper.touchEvents.end, slideSelector, zoom.onGestureEnd, passiveListener);
if (swiper.touchEvents.cancel) {
swiper.$wrapperEl.off(swiper.touchEvents.cancel, slideSelector, zoom.onGestureEnd, passiveListener);
}
} // Move image
swiper.$wrapperEl.off(swiper.touchEvents.move, "." + swiper.params.zoom.containerClass, zoom.onTouchMove, activeListenerWithCapture);
}
};
export default {
name: 'zoom',
params: {
zoom: {
enabled: false,
maxRatio: 3,
minRatio: 1,
toggle: true,
containerClass: 'swiper-zoom-container',
zoomedSlideClass: 'swiper-slide-zoomed'
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
zoom: _extends({
enabled: false,
scale: 1,
currentScale: 1,
isScaling: false,
gesture: {
$slideEl: undefined,
slideWidth: undefined,
slideHeight: undefined,
$imageEl: undefined,
$imageWrapEl: undefined,
maxRatio: 3
},
image: {
isTouched: undefined,
isMoved: undefined,
currentX: undefined,
currentY: undefined,
minX: undefined,
minY: undefined,
maxX: undefined,
maxY: undefined,
width: undefined,
height: undefined,
startX: undefined,
startY: undefined,
touchesStart: {},
touchesCurrent: {}
},
velocity: {
x: undefined,
y: undefined,
prevPositionX: undefined,
prevPositionY: undefined,
prevTime: undefined
}
}, Zoom)
});
var scale = 1;
Object.defineProperty(swiper.zoom, 'scale', {
get: function get() {
return scale;
},
set: function set(value) {
if (scale !== value) {
var imageEl = swiper.zoom.gesture.$imageEl ? swiper.zoom.gesture.$imageEl[0] : undefined;
var slideEl = swiper.zoom.gesture.$slideEl ? swiper.zoom.gesture.$slideEl[0] : undefined;
swiper.emit('zoomChange', value, imageEl, slideEl);
}
scale = value;
}
});
},
on: {
init: function init(swiper) {
if (swiper.params.zoom.enabled) {
swiper.zoom.enable();
}
},
destroy: function destroy(swiper) {
swiper.zoom.disable();
},
touchStart: function touchStart(swiper, e) {
if (!swiper.zoom.enabled) return;
swiper.zoom.onTouchStart(e);
},
touchEnd: function touchEnd(swiper, e) {
if (!swiper.zoom.enabled) return;
swiper.zoom.onTouchEnd(e);
},
doubleTap: function doubleTap(swiper, e) {
if (!swiper.animating && swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) {
swiper.zoom.toggle(e);
}
},
transitionEnd: function transitionEnd(swiper) {
if (swiper.zoom.enabled && swiper.params.zoom.enabled) {
swiper.zoom.onTransitionEnd();
}
},
slideChange: function slideChange(swiper) {
if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) {
swiper.zoom.onTransitionEnd();
}
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/lazy/lazy.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { getWindow } from 'ssr-window';
import $ from '../../utils/dom';
import { bindModuleMethods } from '../../utils/utils';
var Lazy = {
loadInSlide: function loadInSlide(index, loadInDuplicate) {
if (loadInDuplicate === void 0) {
loadInDuplicate = true;
}
var swiper = this;
var params = swiper.params.lazy;
if (typeof index === 'undefined') return;
if (swiper.slides.length === 0) return;
var isVirtual = swiper.virtual && swiper.params.virtual.enabled;
var $slideEl = isVirtual ? swiper.$wrapperEl.children("." + swiper.params.slideClass + "[data-swiper-slide-index=\"" + index + "\"]") : swiper.slides.eq(index);
var $images = $slideEl.find("." + params.elementClass + ":not(." + params.loadedClass + "):not(." + params.loadingClass + ")");
if ($slideEl.hasClass(params.elementClass) && !$slideEl.hasClass(params.loadedClass) && !$slideEl.hasClass(params.loadingClass)) {
$images.push($slideEl[0]);
}
if ($images.length === 0) return;
$images.each(function (imageEl) {
var $imageEl = $(imageEl);
$imageEl.addClass(params.loadingClass);
var background = $imageEl.attr('data-background');
var src = $imageEl.attr('data-src');
var srcset = $imageEl.attr('data-srcset');
var sizes = $imageEl.attr('data-sizes');
var $pictureEl = $imageEl.parent('picture');
swiper.loadImage($imageEl[0], src || background, srcset, sizes, false, function () {
if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper && !swiper.params || swiper.destroyed) return;
if (background) {
$imageEl.css('background-image', "url(\"" + background + "\")");
$imageEl.removeAttr('data-background');
} else {
if (srcset) {
$imageEl.attr('srcset', srcset);
$imageEl.removeAttr('data-srcset');
}
if (sizes) {
$imageEl.attr('sizes', sizes);
$imageEl.removeAttr('data-sizes');
}
if ($pictureEl.length) {
$pictureEl.children('source').each(function (sourceEl) {
var $source = $(sourceEl);
if ($source.attr('data-srcset')) {
$source.attr('srcset', $source.attr('data-srcset'));
$source.removeAttr('data-srcset');
}
});
}
if (src) {
$imageEl.attr('src', src);
$imageEl.removeAttr('data-src');
}
}
$imageEl.addClass(params.loadedClass).removeClass(params.loadingClass);
$slideEl.find("." + params.preloaderClass).remove();
if (swiper.params.loop && loadInDuplicate) {
var slideOriginalIndex = $slideEl.attr('data-swiper-slide-index');
if ($slideEl.hasClass(swiper.params.slideDuplicateClass)) {
var originalSlide = swiper.$wrapperEl.children("[data-swiper-slide-index=\"" + slideOriginalIndex + "\"]:not(." + swiper.params.slideDuplicateClass + ")");
swiper.lazy.loadInSlide(originalSlide.index(), false);
} else {
var duplicatedSlide = swiper.$wrapperEl.children("." + swiper.params.slideDuplicateClass + "[data-swiper-slide-index=\"" + slideOriginalIndex + "\"]");
swiper.lazy.loadInSlide(duplicatedSlide.index(), false);
}
}
swiper.emit('lazyImageReady', $slideEl[0], $imageEl[0]);
if (swiper.params.autoHeight) {
swiper.updateAutoHeight();
}
});
swiper.emit('lazyImageLoad', $slideEl[0], $imageEl[0]);
});
},
load: function load() {
var swiper = this;
var $wrapperEl = swiper.$wrapperEl,
swiperParams = swiper.params,
slides = swiper.slides,
activeIndex = swiper.activeIndex;
var isVirtual = swiper.virtual && swiperParams.virtual.enabled;
var params = swiperParams.lazy;
var slidesPerView = swiperParams.slidesPerView;
if (slidesPerView === 'auto') {
slidesPerView = 0;
}
function slideExist(index) {
if (isVirtual) {
if ($wrapperEl.children("." + swiperParams.slideClass + "[data-swiper-slide-index=\"" + index + "\"]").length) {
return true;
}
} else if (slides[index]) return true;
return false;
}
function slideIndex(slideEl) {
if (isVirtual) {
return $(slideEl).attr('data-swiper-slide-index');
}
return $(slideEl).index();
}
if (!swiper.lazy.initialImageLoaded) swiper.lazy.initialImageLoaded = true;
if (swiper.params.watchSlidesVisibility) {
$wrapperEl.children("." + swiperParams.slideVisibleClass).each(function (slideEl) {
var index = isVirtual ? $(slideEl).attr('data-swiper-slide-index') : $(slideEl).index();
swiper.lazy.loadInSlide(index);
});
} else if (slidesPerView > 1) {
for (var i = activeIndex; i < activeIndex + slidesPerView; i += 1) {
if (slideExist(i)) swiper.lazy.loadInSlide(i);
}
} else {
swiper.lazy.loadInSlide(activeIndex);
}
if (params.loadPrevNext) {
if (slidesPerView > 1 || params.loadPrevNextAmount && params.loadPrevNextAmount > 1) {
var amount = params.loadPrevNextAmount;
var spv = slidesPerView;
var maxIndex = Math.min(activeIndex + spv + Math.max(amount, spv), slides.length);
var minIndex = Math.max(activeIndex - Math.max(spv, amount), 0); // Next Slides
for (var _i = activeIndex + slidesPerView; _i < maxIndex; _i += 1) {
if (slideExist(_i)) swiper.lazy.loadInSlide(_i);
} // Prev Slides
for (var _i2 = minIndex; _i2 < activeIndex; _i2 += 1) {
if (slideExist(_i2)) swiper.lazy.loadInSlide(_i2);
}
} else {
var nextSlide = $wrapperEl.children("." + swiperParams.slideNextClass);
if (nextSlide.length > 0) swiper.lazy.loadInSlide(slideIndex(nextSlide));
var prevSlide = $wrapperEl.children("." + swiperParams.slidePrevClass);
if (prevSlide.length > 0) swiper.lazy.loadInSlide(slideIndex(prevSlide));
}
}
},
checkInViewOnLoad: function checkInViewOnLoad() {
var window = getWindow();
var swiper = this;
if (!swiper || swiper.destroyed) return;
var $scrollElement = swiper.params.lazy.scrollingElement ? $(swiper.params.lazy.scrollingElement) : $(window);
var isWindow = $scrollElement[0] === window;
var scrollElementWidth = isWindow ? window.innerWidth : $scrollElement[0].offsetWidth;
var scrollElementHeight = isWindow ? window.innerHeight : $scrollElement[0].offsetHeight;
var swiperOffset = swiper.$el.offset();
var rtl = swiper.rtlTranslate;
var inView = false;
if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft;
var swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiper.width, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiper.height], [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height]];
for (var i = 0; i < swiperCoord.length; i += 1) {
var point = swiperCoord[i];
if (point[0] >= 0 && point[0] <= scrollElementWidth && point[1] >= 0 && point[1] <= scrollElementHeight) {
if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line
inView = true;
}
}
var passiveListener = swiper.touchEvents.start === 'touchstart' && swiper.support.passiveListener && swiper.params.passiveListeners ? {
passive: true,
capture: false
} : false;
if (inView) {
swiper.lazy.load();
$scrollElement.off('scroll', swiper.lazy.checkInViewOnLoad, passiveListener);
} else if (!swiper.lazy.scrollHandlerAttached) {
swiper.lazy.scrollHandlerAttached = true;
$scrollElement.on('scroll', swiper.lazy.checkInViewOnLoad, passiveListener);
}
}
};
export default {
name: 'lazy',
params: {
lazy: {
checkInView: false,
enabled: false,
loadPrevNext: false,
loadPrevNextAmount: 1,
loadOnTransitionStart: false,
scrollingElement: '',
elementClass: 'swiper-lazy',
loadingClass: 'swiper-lazy-loading',
loadedClass: 'swiper-lazy-loaded',
preloaderClass: 'swiper-lazy-preloader'
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
lazy: _extends({
initialImageLoaded: false
}, Lazy)
});
},
on: {
beforeInit: function beforeInit(swiper) {
if (swiper.params.lazy.enabled && swiper.params.preloadImages) {
swiper.params.preloadImages = false;
}
},
init: function init(swiper) {
if (swiper.params.lazy.enabled && !swiper.params.loop && swiper.params.initialSlide === 0) {
if (swiper.params.lazy.checkInView) {
swiper.lazy.checkInViewOnLoad();
} else {
swiper.lazy.load();
}
}
},
scroll: function scroll(swiper) {
if (swiper.params.freeMode && !swiper.params.freeModeSticky) {
swiper.lazy.load();
}
},
'scrollbarDragMove resize _freeModeNoMomentumRelease': function lazyLoad(swiper) {
if (swiper.params.lazy.enabled) {
swiper.lazy.load();
}
},
transitionStart: function transitionStart(swiper) {
if (swiper.params.lazy.enabled) {
if (swiper.params.lazy.loadOnTransitionStart || !swiper.params.lazy.loadOnTransitionStart && !swiper.lazy.initialImageLoaded) {
swiper.lazy.load();
}
}
},
transitionEnd: function transitionEnd(swiper) {
if (swiper.params.lazy.enabled && !swiper.params.lazy.loadOnTransitionStart) {
swiper.lazy.load();
}
},
slideChange: function slideChange(swiper) {
var _swiper$params = swiper.params,
lazy = _swiper$params.lazy,
cssMode = _swiper$params.cssMode,
watchSlidesVisibility = _swiper$params.watchSlidesVisibility,
watchSlidesProgress = _swiper$params.watchSlidesProgress,
touchReleaseOnEdges = _swiper$params.touchReleaseOnEdges,
resistanceRatio = _swiper$params.resistanceRatio;
if (lazy.enabled && (cssMode || (watchSlidesVisibility || watchSlidesProgress) && (touchReleaseOnEdges || resistanceRatio === 0))) {
swiper.lazy.load();
}
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/controller/controller.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
/* eslint no-bitwise: ["error", { "allow": [">>"] }] */
import { nextTick, bindModuleMethods } from '../../utils/utils';
var Controller = {
LinearSpline: function LinearSpline(x, y) {
var binarySearch = function search() {
var maxIndex;
var minIndex;
var guess;
return function (array, val) {
minIndex = -1;
maxIndex = array.length;
while (maxIndex - minIndex > 1) {
guess = maxIndex + minIndex >> 1;
if (array[guess] <= val) {
minIndex = guess;
} else {
maxIndex = guess;
}
}
return maxIndex;
};
}();
this.x = x;
this.y = y;
this.lastIndex = x.length - 1; // Given an x value (x2), return the expected y2 value:
// (x1,y1) is the known point before given value,
// (x3,y3) is the known point after given value.
var i1;
var i3;
this.interpolate = function interpolate(x2) {
if (!x2) return 0; // Get the indexes of x1 and x3 (the array indexes before and after given x2):
i3 = binarySearch(this.x, x2);
i1 = i3 - 1; // We have our indexes i1 & i3, so we can calculate already:
// y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1];
};
return this;
},
// xxx: for now i will just save one spline function to to
getInterpolateFunction: function getInterpolateFunction(c) {
var swiper = this;
if (!swiper.controller.spline) {
swiper.controller.spline = swiper.params.loop ? new Controller.LinearSpline(swiper.slidesGrid, c.slidesGrid) : new Controller.LinearSpline(swiper.snapGrid, c.snapGrid);
}
},
setTranslate: function setTranslate(_setTranslate, byController) {
var swiper = this;
var controlled = swiper.controller.control;
var multiplier;
var controlledTranslate;
var Swiper = swiper.constructor;
function setControlledTranslate(c) {
// this will create an Interpolate function based on the snapGrids
// x is the Grid of the scrolled scroller and y will be the controlled scroller
// it makes sense to create this only once and recall it for the interpolation
// the function does a lot of value caching for performance
var translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;
if (swiper.params.controller.by === 'slide') {
swiper.controller.getInterpolateFunction(c); // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
// but it did not work out
controlledTranslate = -swiper.controller.spline.interpolate(-translate);
}
if (!controlledTranslate || swiper.params.controller.by === 'container') {
multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());
controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate();
}
if (swiper.params.controller.inverse) {
controlledTranslate = c.maxTranslate() - controlledTranslate;
}
c.updateProgress(controlledTranslate);
c.setTranslate(controlledTranslate, swiper);
c.updateActiveIndex();
c.updateSlidesClasses();
}
if (Array.isArray(controlled)) {
for (var i = 0; i < controlled.length; i += 1) {
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
setControlledTranslate(controlled[i]);
}
}
} else if (controlled instanceof Swiper && byController !== controlled) {
setControlledTranslate(controlled);
}
},
setTransition: function setTransition(duration, byController) {
var swiper = this;
var Swiper = swiper.constructor;
var controlled = swiper.controller.control;
var i;
function setControlledTransition(c) {
c.setTransition(duration, swiper);
if (duration !== 0) {
c.transitionStart();
if (c.params.autoHeight) {
nextTick(function () {
c.updateAutoHeight();
});
}
c.$wrapperEl.transitionEnd(function () {
if (!controlled) return;
if (c.params.loop && swiper.params.controller.by === 'slide') {
c.loopFix();
}
c.transitionEnd();
});
}
}
if (Array.isArray(controlled)) {
for (i = 0; i < controlled.length; i += 1) {
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
setControlledTransition(controlled[i]);
}
}
} else if (controlled instanceof Swiper && byController !== controlled) {
setControlledTransition(controlled);
}
}
};
export default {
name: 'controller',
params: {
controller: {
control: undefined,
inverse: false,
by: 'slide' // or 'container'
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
controller: _extends({
control: swiper.params.controller.control
}, Controller)
});
},
on: {
update: function update(swiper) {
if (!swiper.controller.control) return;
if (swiper.controller.spline) {
swiper.controller.spline = undefined;
delete swiper.controller.spline;
}
},
resize: function resize(swiper) {
if (!swiper.controller.control) return;
if (swiper.controller.spline) {
swiper.controller.spline = undefined;
delete swiper.controller.spline;
}
},
observerUpdate: function observerUpdate(swiper) {
if (!swiper.controller.control) return;
if (swiper.controller.spline) {
swiper.controller.spline = undefined;
delete swiper.controller.spline;
}
},
setTranslate: function setTranslate(swiper, translate, byController) {
if (!swiper.controller.control) return;
swiper.controller.setTranslate(translate, byController);
},
setTransition: function setTransition(swiper, duration, byController) {
if (!swiper.controller.control) return;
swiper.controller.setTransition(duration, byController);
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/a11y/a11y.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import $ from '../../utils/dom';
import { bindModuleMethods, classesToSelector } from '../../utils/utils';
var A11y = {
getRandomNumber: function getRandomNumber(size) {
if (size === void 0) {
size = 16;
}
var randomChar = function randomChar() {
return Math.round(16 * Math.random()).toString(16);
};
return 'x'.repeat(size).replace(/x/g, randomChar);
},
makeElFocusable: function makeElFocusable($el) {
$el.attr('tabIndex', '0');
return $el;
},
makeElNotFocusable: function makeElNotFocusable($el) {
$el.attr('tabIndex', '-1');
return $el;
},
addElRole: function addElRole($el, role) {
$el.attr('role', role);
return $el;
},
addElRoleDescription: function addElRoleDescription($el, description) {
$el.attr('aria-roledescription', description);
return $el;
},
addElControls: function addElControls($el, controls) {
$el.attr('aria-controls', controls);
return $el;
},
addElLabel: function addElLabel($el, label) {
$el.attr('aria-label', label);
return $el;
},
addElId: function addElId($el, id) {
$el.attr('id', id);
return $el;
},
addElLive: function addElLive($el, live) {
$el.attr('aria-live', live);
return $el;
},
disableEl: function disableEl($el) {
$el.attr('aria-disabled', true);
return $el;
},
enableEl: function enableEl($el) {
$el.attr('aria-disabled', false);
return $el;
},
onEnterOrSpaceKey: function onEnterOrSpaceKey(e) {
if (e.keyCode !== 13 && e.keyCode !== 32) return;
var swiper = this;
var params = swiper.params.a11y;
var $targetEl = $(e.target);
if (swiper.navigation && swiper.navigation.$nextEl && $targetEl.is(swiper.navigation.$nextEl)) {
if (!(swiper.isEnd && !swiper.params.loop)) {
swiper.slideNext();
}
if (swiper.isEnd) {
swiper.a11y.notify(params.lastSlideMessage);
} else {
swiper.a11y.notify(params.nextSlideMessage);
}
}
if (swiper.navigation && swiper.navigation.$prevEl && $targetEl.is(swiper.navigation.$prevEl)) {
if (!(swiper.isBeginning && !swiper.params.loop)) {
swiper.slidePrev();
}
if (swiper.isBeginning) {
swiper.a11y.notify(params.firstSlideMessage);
} else {
swiper.a11y.notify(params.prevSlideMessage);
}
}
if (swiper.pagination && $targetEl.is(classesToSelector(swiper.params.pagination.bulletClass))) {
$targetEl[0].click();
}
},
notify: function notify(message) {
var swiper = this;
var notification = swiper.a11y.liveRegion;
if (notification.length === 0) return;
notification.html('');
notification.html(message);
},
updateNavigation: function updateNavigation() {
var swiper = this;
if (swiper.params.loop || !swiper.navigation) return;
var _swiper$navigation = swiper.navigation,
$nextEl = _swiper$navigation.$nextEl,
$prevEl = _swiper$navigation.$prevEl;
if ($prevEl && $prevEl.length > 0) {
if (swiper.isBeginning) {
swiper.a11y.disableEl($prevEl);
swiper.a11y.makeElNotFocusable($prevEl);
} else {
swiper.a11y.enableEl($prevEl);
swiper.a11y.makeElFocusable($prevEl);
}
}
if ($nextEl && $nextEl.length > 0) {
if (swiper.isEnd) {
swiper.a11y.disableEl($nextEl);
swiper.a11y.makeElNotFocusable($nextEl);
} else {
swiper.a11y.enableEl($nextEl);
swiper.a11y.makeElFocusable($nextEl);
}
}
},
updatePagination: function updatePagination() {
var swiper = this;
var params = swiper.params.a11y;
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
swiper.pagination.bullets.each(function (bulletEl) {
var $bulletEl = $(bulletEl);
swiper.a11y.makeElFocusable($bulletEl);
if (!swiper.params.pagination.renderBullet) {
swiper.a11y.addElRole($bulletEl, 'button');
swiper.a11y.addElLabel($bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, $bulletEl.index() + 1));
}
});
}
},
init: function init() {
var swiper = this;
var params = swiper.params.a11y;
swiper.$el.append(swiper.a11y.liveRegion); // Container
var $containerEl = swiper.$el;
if (params.containerRoleDescriptionMessage) {
swiper.a11y.addElRoleDescription($containerEl, params.containerRoleDescriptionMessage);
}
if (params.containerMessage) {
swiper.a11y.addElLabel($containerEl, params.containerMessage);
} // Wrapper
var $wrapperEl = swiper.$wrapperEl;
var wrapperId = $wrapperEl.attr('id') || "swiper-wrapper-" + swiper.a11y.getRandomNumber(16);
var live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';
swiper.a11y.addElId($wrapperEl, wrapperId);
swiper.a11y.addElLive($wrapperEl, live); // Slide
if (params.itemRoleDescriptionMessage) {
swiper.a11y.addElRoleDescription($(swiper.slides), params.itemRoleDescriptionMessage);
}
swiper.a11y.addElRole($(swiper.slides), params.slideRole);
var slidesLength = swiper.params.loop ? swiper.slides.filter(function (el) {
return !el.classList.contains(swiper.params.slideDuplicateClass);
}).length : swiper.slides.length;
swiper.slides.each(function (slideEl, index) {
var $slideEl = $(slideEl);
var slideIndex = swiper.params.loop ? parseInt($slideEl.attr('data-swiper-slide-index'), 10) : index;
var ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength);
swiper.a11y.addElLabel($slideEl, ariaLabelMessage);
}); // Navigation
var $nextEl;
var $prevEl;
if (swiper.navigation && swiper.navigation.$nextEl) {
$nextEl = swiper.navigation.$nextEl;
}
if (swiper.navigation && swiper.navigation.$prevEl) {
$prevEl = swiper.navigation.$prevEl;
}
if ($nextEl && $nextEl.length) {
swiper.a11y.makeElFocusable($nextEl);
if ($nextEl[0].tagName !== 'BUTTON') {
swiper.a11y.addElRole($nextEl, 'button');
$nextEl.on('keydown', swiper.a11y.onEnterOrSpaceKey);
}
swiper.a11y.addElLabel($nextEl, params.nextSlideMessage);
swiper.a11y.addElControls($nextEl, wrapperId);
}
if ($prevEl && $prevEl.length) {
swiper.a11y.makeElFocusable($prevEl);
if ($prevEl[0].tagName !== 'BUTTON') {
swiper.a11y.addElRole($prevEl, 'button');
$prevEl.on('keydown', swiper.a11y.onEnterOrSpaceKey);
}
swiper.a11y.addElLabel($prevEl, params.prevSlideMessage);
swiper.a11y.addElControls($prevEl, wrapperId);
} // Pagination
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
swiper.pagination.$el.on('keydown', classesToSelector(swiper.params.pagination.bulletClass), swiper.a11y.onEnterOrSpaceKey);
}
},
destroy: function destroy() {
var swiper = this;
if (swiper.a11y.liveRegion && swiper.a11y.liveRegion.length > 0) swiper.a11y.liveRegion.remove();
var $nextEl;
var $prevEl;
if (swiper.navigation && swiper.navigation.$nextEl) {
$nextEl = swiper.navigation.$nextEl;
}
if (swiper.navigation && swiper.navigation.$prevEl) {
$prevEl = swiper.navigation.$prevEl;
}
if ($nextEl) {
$nextEl.off('keydown', swiper.a11y.onEnterOrSpaceKey);
}
if ($prevEl) {
$prevEl.off('keydown', swiper.a11y.onEnterOrSpaceKey);
} // Pagination
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
swiper.pagination.$el.off('keydown', classesToSelector(swiper.params.pagination.bulletClass), swiper.a11y.onEnterOrSpaceKey);
}
}
};
export default {
name: 'a11y',
params: {
a11y: {
enabled: true,
notificationClass: 'swiper-notification',
prevSlideMessage: 'Previous slide',
nextSlideMessage: 'Next slide',
firstSlideMessage: 'This is the first slide',
lastSlideMessage: 'This is the last slide',
paginationBulletMessage: 'Go to slide {{index}}',
slideLabelMessage: '{{index}} / {{slidesLength}}',
containerMessage: null,
containerRoleDescriptionMessage: null,
itemRoleDescriptionMessage: null,
slideRole: 'group'
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
a11y: _extends({}, A11y, {
liveRegion: $("<span class=\"" + swiper.params.a11y.notificationClass + "\" aria-live=\"assertive\" aria-atomic=\"true\"></span>")
})
});
},
on: {
afterInit: function afterInit(swiper) {
if (!swiper.params.a11y.enabled) return;
swiper.a11y.init();
swiper.a11y.updateNavigation();
},
toEdge: function toEdge(swiper) {
if (!swiper.params.a11y.enabled) return;
swiper.a11y.updateNavigation();
},
fromEdge: function fromEdge(swiper) {
if (!swiper.params.a11y.enabled) return;
swiper.a11y.updateNavigation();
},
paginationUpdate: function paginationUpdate(swiper) {
if (!swiper.params.a11y.enabled) return;
swiper.a11y.updatePagination();
},
destroy: function destroy(swiper) {
if (!swiper.params.a11y.enabled) return;
swiper.a11y.destroy();
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/history/history.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { getWindow } from 'ssr-window';
import { bindModuleMethods } from '../../utils/utils';
var History = {
init: function init() {
var swiper = this;
var window = getWindow();
if (!swiper.params.history) return;
if (!window.history || !window.history.pushState) {
swiper.params.history.enabled = false;
swiper.params.hashNavigation.enabled = true;
return;
}
var history = swiper.history;
history.initialized = true;
history.paths = History.getPathValues(swiper.params.url);
if (!history.paths.key && !history.paths.value) return;
history.scrollToSlide(0, history.paths.value, swiper.params.runCallbacksOnInit);
if (!swiper.params.history.replaceState) {
window.addEventListener('popstate', swiper.history.setHistoryPopState);
}
},
destroy: function destroy() {
var swiper = this;
var window = getWindow();
if (!swiper.params.history.replaceState) {
window.removeEventListener('popstate', swiper.history.setHistoryPopState);
}
},
setHistoryPopState: function setHistoryPopState() {
var swiper = this;
swiper.history.paths = History.getPathValues(swiper.params.url);
swiper.history.scrollToSlide(swiper.params.speed, swiper.history.paths.value, false);
},
getPathValues: function getPathValues(urlOverride) {
var window = getWindow();
var location;
if (urlOverride) {
location = new URL(urlOverride);
} else {
location = window.location;
}
var pathArray = location.pathname.slice(1).split('/').filter(function (part) {
return part !== '';
});
var total = pathArray.length;
var key = pathArray[total - 2];
var value = pathArray[total - 1];
return {
key: key,
value: value
};
},
setHistory: function setHistory(key, index) {
var swiper = this;
var window = getWindow();
if (!swiper.history.initialized || !swiper.params.history.enabled) return;
var location;
if (swiper.params.url) {
location = new URL(swiper.params.url);
} else {
location = window.location;
}
var slide = swiper.slides.eq(index);
var value = History.slugify(slide.attr('data-history'));
if (swiper.params.history.root.length > 0) {
var root = swiper.params.history.root;
if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1);
value = root + "/" + key + "/" + value;
} else if (!location.pathname.includes(key)) {
value = key + "/" + value;
}
var currentState = window.history.state;
if (currentState && currentState.value === value) {
return;
}
if (swiper.params.history.replaceState) {
window.history.replaceState({
value: value
}, null, value);
} else {
window.history.pushState({
value: value
}, null, value);
}
},
slugify: function slugify(text) {
return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, '');
},
scrollToSlide: function scrollToSlide(speed, value, runCallbacks) {
var swiper = this;
if (value) {
for (var i = 0, length = swiper.slides.length; i < length; i += 1) {
var slide = swiper.slides.eq(i);
var slideHistory = History.slugify(slide.attr('data-history'));
if (slideHistory === value && !slide.hasClass(swiper.params.slideDuplicateClass)) {
var index = slide.index();
swiper.slideTo(index, speed, runCallbacks);
}
}
} else {
swiper.slideTo(0, speed, runCallbacks);
}
}
};
export default {
name: 'history',
params: {
history: {
enabled: false,
root: '',
replaceState: false,
key: 'slides'
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
history: _extends({}, History)
});
},
on: {
init: function init(swiper) {
if (swiper.params.history.enabled) {
swiper.history.init();
}
},
destroy: function destroy(swiper) {
if (swiper.params.history.enabled) {
swiper.history.destroy();
}
},
'transitionEnd _freeModeNoMomentumRelease': function transitionEnd_freeModeNoMomentumRelease(swiper) {
if (swiper.history.initialized) {
swiper.history.setHistory(swiper.params.history.key, swiper.activeIndex);
}
},
slideChange: function slideChange(swiper) {
if (swiper.history.initialized && swiper.params.cssMode) {
swiper.history.setHistory(swiper.params.history.key, swiper.activeIndex);
}
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/hash-navigation/hash-navigation.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { getWindow, getDocument } from 'ssr-window';
import $ from '../../utils/dom';
import { bindModuleMethods } from '../../utils/utils';
var HashNavigation = {
onHashChange: function onHashChange() {
var swiper = this;
var document = getDocument();
swiper.emit('hashChange');
var newHash = document.location.hash.replace('#', '');
var activeSlideHash = swiper.slides.eq(swiper.activeIndex).attr('data-hash');
if (newHash !== activeSlideHash) {
var newIndex = swiper.$wrapperEl.children("." + swiper.params.slideClass + "[data-hash=\"" + newHash + "\"]").index();
if (typeof newIndex === 'undefined') return;
swiper.slideTo(newIndex);
}
},
setHash: function setHash() {
var swiper = this;
var window = getWindow();
var document = getDocument();
if (!swiper.hashNavigation.initialized || !swiper.params.hashNavigation.enabled) return;
if (swiper.params.hashNavigation.replaceState && window.history && window.history.replaceState) {
window.history.replaceState(null, null, "#" + swiper.slides.eq(swiper.activeIndex).attr('data-hash') || '');
swiper.emit('hashSet');
} else {
var slide = swiper.slides.eq(swiper.activeIndex);
var hash = slide.attr('data-hash') || slide.attr('data-history');
document.location.hash = hash || '';
swiper.emit('hashSet');
}
},
init: function init() {
var swiper = this;
var document = getDocument();
var window = getWindow();
if (!swiper.params.hashNavigation.enabled || swiper.params.history && swiper.params.history.enabled) return;
swiper.hashNavigation.initialized = true;
var hash = document.location.hash.replace('#', '');
if (hash) {
var speed = 0;
for (var i = 0, length = swiper.slides.length; i < length; i += 1) {
var slide = swiper.slides.eq(i);
var slideHash = slide.attr('data-hash') || slide.attr('data-history');
if (slideHash === hash && !slide.hasClass(swiper.params.slideDuplicateClass)) {
var index = slide.index();
swiper.slideTo(index, speed, swiper.params.runCallbacksOnInit, true);
}
}
}
if (swiper.params.hashNavigation.watchState) {
$(window).on('hashchange', swiper.hashNavigation.onHashChange);
}
},
destroy: function destroy() {
var swiper = this;
var window = getWindow();
if (swiper.params.hashNavigation.watchState) {
$(window).off('hashchange', swiper.hashNavigation.onHashChange);
}
}
};
export default {
name: 'hash-navigation',
params: {
hashNavigation: {
enabled: false,
replaceState: false,
watchState: false
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
hashNavigation: _extends({
initialized: false
}, HashNavigation)
});
},
on: {
init: function init(swiper) {
if (swiper.params.hashNavigation.enabled) {
swiper.hashNavigation.init();
}
},
destroy: function destroy(swiper) {
if (swiper.params.hashNavigation.enabled) {
swiper.hashNavigation.destroy();
}
},
'transitionEnd _freeModeNoMomentumRelease': function transitionEnd_freeModeNoMomentumRelease(swiper) {
if (swiper.hashNavigation.initialized) {
swiper.hashNavigation.setHash();
}
},
slideChange: function slideChange(swiper) {
if (swiper.hashNavigation.initialized && swiper.params.cssMode) {
swiper.hashNavigation.setHash();
}
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/autoplay/autoplay.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
/* eslint no-underscore-dangle: "off" */
import { getDocument } from 'ssr-window';
import { nextTick, bindModuleMethods } from '../../utils/utils';
var Autoplay = {
run: function run() {
var swiper = this;
var $activeSlideEl = swiper.slides.eq(swiper.activeIndex);
var delay = swiper.params.autoplay.delay;
if ($activeSlideEl.attr('data-swiper-autoplay')) {
delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;
}
clearTimeout(swiper.autoplay.timeout);
swiper.autoplay.timeout = nextTick(function () {
var autoplayResult;
if (swiper.params.autoplay.reverseDirection) {
if (swiper.params.loop) {
swiper.loopFix();
autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);
swiper.emit('autoplay');
} else if (!swiper.isBeginning) {
autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);
swiper.emit('autoplay');
} else if (!swiper.params.autoplay.stopOnLastSlide) {
autoplayResult = swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);
swiper.emit('autoplay');
} else {
swiper.autoplay.stop();
}
} else if (swiper.params.loop) {
swiper.loopFix();
autoplayResult = swiper.slideNext(swiper.params.speed, true, true);
swiper.emit('autoplay');
} else if (!swiper.isEnd) {
autoplayResult = swiper.slideNext(swiper.params.speed, true, true);
swiper.emit('autoplay');
} else if (!swiper.params.autoplay.stopOnLastSlide) {
autoplayResult = swiper.slideTo(0, swiper.params.speed, true, true);
swiper.emit('autoplay');
} else {
swiper.autoplay.stop();
}
if (swiper.params.cssMode && swiper.autoplay.running) swiper.autoplay.run();else if (autoplayResult === false) {
swiper.autoplay.run();
}
}, delay);
},
start: function start() {
var swiper = this;
if (typeof swiper.autoplay.timeout !== 'undefined') return false;
if (swiper.autoplay.running) return false;
swiper.autoplay.running = true;
swiper.emit('autoplayStart');
swiper.autoplay.run();
return true;
},
stop: function stop() {
var swiper = this;
if (!swiper.autoplay.running) return false;
if (typeof swiper.autoplay.timeout === 'undefined') return false;
if (swiper.autoplay.timeout) {
clearTimeout(swiper.autoplay.timeout);
swiper.autoplay.timeout = undefined;
}
swiper.autoplay.running = false;
swiper.emit('autoplayStop');
return true;
},
pause: function pause(speed) {
var swiper = this;
if (!swiper.autoplay.running) return;
if (swiper.autoplay.paused) return;
if (swiper.autoplay.timeout) clearTimeout(swiper.autoplay.timeout);
swiper.autoplay.paused = true;
if (speed === 0 || !swiper.params.autoplay.waitForTransition) {
swiper.autoplay.paused = false;
swiper.autoplay.run();
} else {
['transitionend', 'webkitTransitionEnd'].forEach(function (event) {
swiper.$wrapperEl[0].addEventListener(event, swiper.autoplay.onTransitionEnd);
});
}
},
onVisibilityChange: function onVisibilityChange() {
var swiper = this;
var document = getDocument();
if (document.visibilityState === 'hidden' && swiper.autoplay.running) {
swiper.autoplay.pause();
}
if (document.visibilityState === 'visible' && swiper.autoplay.paused) {
swiper.autoplay.run();
swiper.autoplay.paused = false;
}
},
onTransitionEnd: function onTransitionEnd(e) {
var swiper = this;
if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return;
if (e.target !== swiper.$wrapperEl[0]) return;
['transitionend', 'webkitTransitionEnd'].forEach(function (event) {
swiper.$wrapperEl[0].removeEventListener(event, swiper.autoplay.onTransitionEnd);
});
swiper.autoplay.paused = false;
if (!swiper.autoplay.running) {
swiper.autoplay.stop();
} else {
swiper.autoplay.run();
}
},
onMouseEnter: function onMouseEnter() {
var swiper = this;
if (swiper.params.autoplay.disableOnInteraction) {
swiper.autoplay.stop();
} else {
swiper.autoplay.pause();
}
['transitionend', 'webkitTransitionEnd'].forEach(function (event) {
swiper.$wrapperEl[0].removeEventListener(event, swiper.autoplay.onTransitionEnd);
});
},
onMouseLeave: function onMouseLeave() {
var swiper = this;
if (swiper.params.autoplay.disableOnInteraction) {
return;
}
swiper.autoplay.paused = false;
swiper.autoplay.run();
},
attachMouseEvents: function attachMouseEvents() {
var swiper = this;
if (swiper.params.autoplay.pauseOnMouseEnter) {
swiper.$el.on('mouseenter', swiper.autoplay.onMouseEnter);
swiper.$el.on('mouseleave', swiper.autoplay.onMouseLeave);
}
},
detachMouseEvents: function detachMouseEvents() {
var swiper = this;
swiper.$el.off('mouseenter', swiper.autoplay.onMouseEnter);
swiper.$el.off('mouseleave', swiper.autoplay.onMouseLeave);
}
};
export default {
name: 'autoplay',
params: {
autoplay: {
enabled: false,
delay: 3000,
waitForTransition: true,
disableOnInteraction: true,
stopOnLastSlide: false,
reverseDirection: false,
pauseOnMouseEnter: false
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
autoplay: _extends({}, Autoplay, {
running: false,
paused: false
})
});
},
on: {
init: function init(swiper) {
if (swiper.params.autoplay.enabled) {
swiper.autoplay.start();
var document = getDocument();
document.addEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);
swiper.autoplay.attachMouseEvents();
}
},
beforeTransitionStart: function beforeTransitionStart(swiper, speed, internal) {
if (swiper.autoplay.running) {
if (internal || !swiper.params.autoplay.disableOnInteraction) {
swiper.autoplay.pause(speed);
} else {
swiper.autoplay.stop();
}
}
},
sliderFirstMove: function sliderFirstMove(swiper) {
if (swiper.autoplay.running) {
if (swiper.params.autoplay.disableOnInteraction) {
swiper.autoplay.stop();
} else {
swiper.autoplay.pause();
}
}
},
touchEnd: function touchEnd(swiper) {
if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) {
swiper.autoplay.run();
}
},
destroy: function destroy(swiper) {
swiper.autoplay.detachMouseEvents();
if (swiper.autoplay.running) {
swiper.autoplay.stop();
}
var document = getDocument();
document.removeEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/effect-fade/effect-fade.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { extend, bindModuleMethods } from '../../utils/utils';
var Fade = {
setTranslate: function setTranslate() {
var swiper = this;
var slides = swiper.slides;
for (var i = 0; i < slides.length; i += 1) {
var $slideEl = swiper.slides.eq(i);
var offset = $slideEl[0].swiperSlideOffset;
var tx = -offset;
if (!swiper.params.virtualTranslate) tx -= swiper.translate;
var ty = 0;
if (!swiper.isHorizontal()) {
ty = tx;
tx = 0;
}
var slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs($slideEl[0].progress), 0) : 1 + Math.min(Math.max($slideEl[0].progress, -1), 0);
$slideEl.css({
opacity: slideOpacity
}).transform("translate3d(" + tx + "px, " + ty + "px, 0px)");
}
},
setTransition: function setTransition(duration) {
var swiper = this;
var slides = swiper.slides,
$wrapperEl = swiper.$wrapperEl;
slides.transition(duration);
if (swiper.params.virtualTranslate && duration !== 0) {
var eventTriggered = false;
slides.transitionEnd(function () {
if (eventTriggered) return;
if (!swiper || swiper.destroyed) return;
eventTriggered = true;
swiper.animating = false;
var triggerEvents = ['webkitTransitionEnd', 'transitionend'];
for (var i = 0; i < triggerEvents.length; i += 1) {
$wrapperEl.trigger(triggerEvents[i]);
}
});
}
}
};
export default {
name: 'effect-fade',
params: {
fadeEffect: {
crossFade: false
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
fadeEffect: _extends({}, Fade)
});
},
on: {
beforeInit: function beforeInit(swiper) {
if (swiper.params.effect !== 'fade') return;
swiper.classNames.push(swiper.params.containerModifierClass + "fade");
var overwriteParams = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: true,
spaceBetween: 0,
virtualTranslate: true
};
extend(swiper.params, overwriteParams);
extend(swiper.originalParams, overwriteParams);
},
setTranslate: function setTranslate(swiper) {
if (swiper.params.effect !== 'fade') return;
swiper.fadeEffect.setTranslate();
},
setTransition: function setTransition(swiper, duration) {
if (swiper.params.effect !== 'fade') return;
swiper.fadeEffect.setTransition(duration);
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/effect-cube/effect-cube.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import $ from '../../utils/dom';
import { extend, bindModuleMethods } from '../../utils/utils';
var Cube = {
setTranslate: function setTranslate() {
var swiper = this;
var $el = swiper.$el,
$wrapperEl = swiper.$wrapperEl,
slides = swiper.slides,
swiperWidth = swiper.width,
swiperHeight = swiper.height,
rtl = swiper.rtlTranslate,
swiperSize = swiper.size,
browser = swiper.browser;
var params = swiper.params.cubeEffect;
var isHorizontal = swiper.isHorizontal();
var isVirtual = swiper.virtual && swiper.params.virtual.enabled;
var wrapperRotate = 0;
var $cubeShadowEl;
if (params.shadow) {
if (isHorizontal) {
$cubeShadowEl = $wrapperEl.find('.swiper-cube-shadow');
if ($cubeShadowEl.length === 0) {
$cubeShadowEl = $('<div class="swiper-cube-shadow"></div>');
$wrapperEl.append($cubeShadowEl);
}
$cubeShadowEl.css({
height: swiperWidth + "px"
});
} else {
$cubeShadowEl = $el.find('.swiper-cube-shadow');
if ($cubeShadowEl.length === 0) {
$cubeShadowEl = $('<div class="swiper-cube-shadow"></div>');
$el.append($cubeShadowEl);
}
}
}
for (var i = 0; i < slides.length; i += 1) {
var $slideEl = slides.eq(i);
var slideIndex = i;
if (isVirtual) {
slideIndex = parseInt($slideEl.attr('data-swiper-slide-index'), 10);
}
var slideAngle = slideIndex * 90;
var round = Math.floor(slideAngle / 360);
if (rtl) {
slideAngle = -slideAngle;
round = Math.floor(-slideAngle / 360);
}
var progress = Math.max(Math.min($slideEl[0].progress, 1), -1);
var tx = 0;
var ty = 0;
var tz = 0;
if (slideIndex % 4 === 0) {
tx = -round * 4 * swiperSize;
tz = 0;
} else if ((slideIndex - 1) % 4 === 0) {
tx = 0;
tz = -round * 4 * swiperSize;
} else if ((slideIndex - 2) % 4 === 0) {
tx = swiperSize + round * 4 * swiperSize;
tz = swiperSize;
} else if ((slideIndex - 3) % 4 === 0) {
tx = -swiperSize;
tz = 3 * swiperSize + swiperSize * 4 * round;
}
if (rtl) {
tx = -tx;
}
if (!isHorizontal) {
ty = tx;
tx = 0;
}
var transform = "rotateX(" + (isHorizontal ? 0 : -slideAngle) + "deg) rotateY(" + (isHorizontal ? slideAngle : 0) + "deg) translate3d(" + tx + "px, " + ty + "px, " + tz + "px)";
if (progress <= 1 && progress > -1) {
wrapperRotate = slideIndex * 90 + progress * 90;
if (rtl) wrapperRotate = -slideIndex * 90 - progress * 90;
}
$slideEl.transform(transform);
if (params.slideShadows) {
// Set shadows
var shadowBefore = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
var shadowAfter = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
if (shadowBefore.length === 0) {
shadowBefore = $("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'left' : 'top') + "\"></div>");
$slideEl.append(shadowBefore);
}
if (shadowAfter.length === 0) {
shadowAfter = $("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'right' : 'bottom') + "\"></div>");
$slideEl.append(shadowAfter);
}
if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
}
}
$wrapperEl.css({
'-webkit-transform-origin': "50% 50% -" + swiperSize / 2 + "px",
'-moz-transform-origin': "50% 50% -" + swiperSize / 2 + "px",
'-ms-transform-origin': "50% 50% -" + swiperSize / 2 + "px",
'transform-origin': "50% 50% -" + swiperSize / 2 + "px"
});
if (params.shadow) {
if (isHorizontal) {
$cubeShadowEl.transform("translate3d(0px, " + (swiperWidth / 2 + params.shadowOffset) + "px, " + -swiperWidth / 2 + "px) rotateX(90deg) rotateZ(0deg) scale(" + params.shadowScale + ")");
} else {
var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;
var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);
var scale1 = params.shadowScale;
var scale2 = params.shadowScale / multiplier;
var offset = params.shadowOffset;
$cubeShadowEl.transform("scale3d(" + scale1 + ", 1, " + scale2 + ") translate3d(0px, " + (swiperHeight / 2 + offset) + "px, " + -swiperHeight / 2 / scale2 + "px) rotateX(-90deg)");
}
}
var zFactor = browser.isSafari || browser.isWebView ? -swiperSize / 2 : 0;
$wrapperEl.transform("translate3d(0px,0," + zFactor + "px) rotateX(" + (swiper.isHorizontal() ? 0 : wrapperRotate) + "deg) rotateY(" + (swiper.isHorizontal() ? -wrapperRotate : 0) + "deg)");
},
setTransition: function setTransition(duration) {
var swiper = this;
var $el = swiper.$el,
slides = swiper.slides;
slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) {
$el.find('.swiper-cube-shadow').transition(duration);
}
}
};
export default {
name: 'effect-cube',
params: {
cubeEffect: {
slideShadows: true,
shadow: true,
shadowOffset: 20,
shadowScale: 0.94
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
cubeEffect: _extends({}, Cube)
});
},
on: {
beforeInit: function beforeInit(swiper) {
if (swiper.params.effect !== 'cube') return;
swiper.classNames.push(swiper.params.containerModifierClass + "cube");
swiper.classNames.push(swiper.params.containerModifierClass + "3d");
var overwriteParams = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: true,
resistanceRatio: 0,
spaceBetween: 0,
centeredSlides: false,
virtualTranslate: true
};
extend(swiper.params, overwriteParams);
extend(swiper.originalParams, overwriteParams);
},
setTranslate: function setTranslate(swiper) {
if (swiper.params.effect !== 'cube') return;
swiper.cubeEffect.setTranslate();
},
setTransition: function setTransition(swiper, duration) {
if (swiper.params.effect !== 'cube') return;
swiper.cubeEffect.setTransition(duration);
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/effect-flip/effect-flip.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import $ from '../../utils/dom';
import { extend, bindModuleMethods } from '../../utils/utils';
var Flip = {
setTranslate: function setTranslate() {
var swiper = this;
var slides = swiper.slides,
rtl = swiper.rtlTranslate;
for (var i = 0; i < slides.length; i += 1) {
var $slideEl = slides.eq(i);
var progress = $slideEl[0].progress;
if (swiper.params.flipEffect.limitRotation) {
progress = Math.max(Math.min($slideEl[0].progress, 1), -1);
}
var offset = $slideEl[0].swiperSlideOffset;
var rotate = -180 * progress;
var rotateY = rotate;
var rotateX = 0;
var tx = -offset;
var ty = 0;
if (!swiper.isHorizontal()) {
ty = tx;
tx = 0;
rotateX = -rotateY;
rotateY = 0;
} else if (rtl) {
rotateY = -rotateY;
}
$slideEl[0].style.zIndex = -Math.abs(Math.round(progress)) + slides.length;
if (swiper.params.flipEffect.slideShadows) {
// Set shadows
var shadowBefore = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
var shadowAfter = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
if (shadowBefore.length === 0) {
shadowBefore = $("<div class=\"swiper-slide-shadow-" + (swiper.isHorizontal() ? 'left' : 'top') + "\"></div>");
$slideEl.append(shadowBefore);
}
if (shadowAfter.length === 0) {
shadowAfter = $("<div class=\"swiper-slide-shadow-" + (swiper.isHorizontal() ? 'right' : 'bottom') + "\"></div>");
$slideEl.append(shadowAfter);
}
if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
}
$slideEl.transform("translate3d(" + tx + "px, " + ty + "px, 0px) rotateX(" + rotateX + "deg) rotateY(" + rotateY + "deg)");
}
},
setTransition: function setTransition(duration) {
var swiper = this;
var slides = swiper.slides,
activeIndex = swiper.activeIndex,
$wrapperEl = swiper.$wrapperEl;
slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
if (swiper.params.virtualTranslate && duration !== 0) {
var eventTriggered = false; // eslint-disable-next-line
slides.eq(activeIndex).transitionEnd(function onTransitionEnd() {
if (eventTriggered) return;
if (!swiper || swiper.destroyed) return; // if (!$(this).hasClass(swiper.params.slideActiveClass)) return;
eventTriggered = true;
swiper.animating = false;
var triggerEvents = ['webkitTransitionEnd', 'transitionend'];
for (var i = 0; i < triggerEvents.length; i += 1) {
$wrapperEl.trigger(triggerEvents[i]);
}
});
}
}
};
export default {
name: 'effect-flip',
params: {
flipEffect: {
slideShadows: true,
limitRotation: true
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
flipEffect: _extends({}, Flip)
});
},
on: {
beforeInit: function beforeInit(swiper) {
if (swiper.params.effect !== 'flip') return;
swiper.classNames.push(swiper.params.containerModifierClass + "flip");
swiper.classNames.push(swiper.params.containerModifierClass + "3d");
var overwriteParams = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: true,
spaceBetween: 0,
virtualTranslate: true
};
extend(swiper.params, overwriteParams);
extend(swiper.originalParams, overwriteParams);
},
setTranslate: function setTranslate(swiper) {
if (swiper.params.effect !== 'flip') return;
swiper.flipEffect.setTranslate();
},
setTransition: function setTransition(swiper, duration) {
if (swiper.params.effect !== 'flip') return;
swiper.flipEffect.setTransition(duration);
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/effect-coverflow/effect-coverflow.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import $ from '../../utils/dom';
import { bindModuleMethods } from '../../utils/utils';
var Coverflow = {
setTranslate: function setTranslate() {
var swiper = this;
var swiperWidth = swiper.width,
swiperHeight = swiper.height,
slides = swiper.slides,
slidesSizesGrid = swiper.slidesSizesGrid;
var params = swiper.params.coverflowEffect;
var isHorizontal = swiper.isHorizontal();
var transform = swiper.translate;
var center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2;
var rotate = isHorizontal ? params.rotate : -params.rotate;
var translate = params.depth; // Each slide offset from center
for (var i = 0, length = slides.length; i < length; i += 1) {
var $slideEl = slides.eq(i);
var slideSize = slidesSizesGrid[i];
var slideOffset = $slideEl[0].swiperSlideOffset;
var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * params.modifier;
var rotateY = isHorizontal ? rotate * offsetMultiplier : 0;
var rotateX = isHorizontal ? 0 : rotate * offsetMultiplier; // var rotateZ = 0
var translateZ = -translate * Math.abs(offsetMultiplier);
var stretch = params.stretch; // Allow percentage to make a relative stretch for responsive sliders
if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) {
stretch = parseFloat(params.stretch) / 100 * slideSize;
}
var translateY = isHorizontal ? 0 : stretch * offsetMultiplier;
var translateX = isHorizontal ? stretch * offsetMultiplier : 0;
var scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier); // Fix for ultra small values
if (Math.abs(translateX) < 0.001) translateX = 0;
if (Math.abs(translateY) < 0.001) translateY = 0;
if (Math.abs(translateZ) < 0.001) translateZ = 0;
if (Math.abs(rotateY) < 0.001) rotateY = 0;
if (Math.abs(rotateX) < 0.001) rotateX = 0;
if (Math.abs(scale) < 0.001) scale = 0;
var slideTransform = "translate3d(" + translateX + "px," + translateY + "px," + translateZ + "px) rotateX(" + rotateX + "deg) rotateY(" + rotateY + "deg) scale(" + scale + ")";
$slideEl.transform(slideTransform);
$slideEl[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
if (params.slideShadows) {
// Set shadows
var $shadowBeforeEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
var $shadowAfterEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
if ($shadowBeforeEl.length === 0) {
$shadowBeforeEl = $("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'left' : 'top') + "\"></div>");
$slideEl.append($shadowBeforeEl);
}
if ($shadowAfterEl.length === 0) {
$shadowAfterEl = $("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'right' : 'bottom') + "\"></div>");
$slideEl.append($shadowAfterEl);
}
if ($shadowBeforeEl.length) $shadowBeforeEl[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
if ($shadowAfterEl.length) $shadowAfterEl[0].style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0;
}
}
},
setTransition: function setTransition(duration) {
var swiper = this;
swiper.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
}
};
export default {
name: 'effect-coverflow',
params: {
coverflowEffect: {
rotate: 50,
stretch: 0,
depth: 100,
scale: 1,
modifier: 1,
slideShadows: true
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
coverflowEffect: _extends({}, Coverflow)
});
},
on: {
beforeInit: function beforeInit(swiper) {
if (swiper.params.effect !== 'coverflow') return;
swiper.classNames.push(swiper.params.containerModifierClass + "coverflow");
swiper.classNames.push(swiper.params.containerModifierClass + "3d");
swiper.params.watchSlidesProgress = true;
swiper.originalParams.watchSlidesProgress = true;
},
setTranslate: function setTranslate(swiper) {
if (swiper.params.effect !== 'coverflow') return;
swiper.coverflowEffect.setTranslate();
},
setTransition: function setTransition(swiper, duration) {
if (swiper.params.effect !== 'coverflow') return;
swiper.coverflowEffect.setTransition(duration);
}
}
};
webpack://frontend-tpt/../../node_modules/swiper/esm/components/thumbs/thumbs.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { extend, isObject, bindModuleMethods } from '../../utils/utils';
import $ from '../../utils/dom';
var Thumbs = {
init: function init() {
var swiper = this;
var thumbsParams = swiper.params.thumbs;
if (swiper.thumbs.initialized) return false;
swiper.thumbs.initialized = true;
var SwiperClass = swiper.constructor;
if (thumbsParams.swiper instanceof SwiperClass) {
swiper.thumbs.swiper = thumbsParams.swiper;
extend(swiper.thumbs.swiper.originalParams, {
watchSlidesProgress: true,
slideToClickedSlide: false
});
extend(swiper.thumbs.swiper.params, {
watchSlidesProgress: true,
slideToClickedSlide: false
});
} else if (isObject(thumbsParams.swiper)) {
swiper.thumbs.swiper = new SwiperClass(extend({}, thumbsParams.swiper, {
watchSlidesVisibility: true,
watchSlidesProgress: true,
slideToClickedSlide: false
}));
swiper.thumbs.swiperCreated = true;
}
swiper.thumbs.swiper.$el.addClass(swiper.params.thumbs.thumbsContainerClass);
swiper.thumbs.swiper.on('tap', swiper.thumbs.onThumbClick);
return true;
},
onThumbClick: function onThumbClick() {
var swiper = this;
var thumbsSwiper = swiper.thumbs.swiper;
if (!thumbsSwiper) return;
var clickedIndex = thumbsSwiper.clickedIndex;
var clickedSlide = thumbsSwiper.clickedSlide;
if (clickedSlide && $(clickedSlide).hasClass(swiper.params.thumbs.slideThumbActiveClass)) return;
if (typeof clickedIndex === 'undefined' || clickedIndex === null) return;
var slideToIndex;
if (thumbsSwiper.params.loop) {
slideToIndex = parseInt($(thumbsSwiper.clickedSlide).attr('data-swiper-slide-index'), 10);
} else {
slideToIndex = clickedIndex;
}
if (swiper.params.loop) {
var currentIndex = swiper.activeIndex;
if (swiper.slides.eq(currentIndex).hasClass(swiper.params.slideDuplicateClass)) {
swiper.loopFix(); // eslint-disable-next-line
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
currentIndex = swiper.activeIndex;
}
var prevIndex = swiper.slides.eq(currentIndex).prevAll("[data-swiper-slide-index=\"" + slideToIndex + "\"]").eq(0).index();
var nextIndex = swiper.slides.eq(currentIndex).nextAll("[data-swiper-slide-index=\"" + slideToIndex + "\"]").eq(0).index();
if (typeof prevIndex === 'undefined') slideToIndex = nextIndex;else if (typeof nextIndex === 'undefined') slideToIndex = prevIndex;else if (nextIndex - currentIndex < currentIndex - prevIndex) slideToIndex = nextIndex;else slideToIndex = prevIndex;
}
swiper.slideTo(slideToIndex);
},
update: function update(initial) {
var swiper = this;
var thumbsSwiper = swiper.thumbs.swiper;
if (!thumbsSwiper) return;
var slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
var autoScrollOffset = swiper.params.thumbs.autoScrollOffset;
var useOffset = autoScrollOffset && !thumbsSwiper.params.loop;
if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {
var currentThumbsIndex = thumbsSwiper.activeIndex;
var newThumbsIndex;
var direction;
if (thumbsSwiper.params.loop) {
if (thumbsSwiper.slides.eq(currentThumbsIndex).hasClass(thumbsSwiper.params.slideDuplicateClass)) {
thumbsSwiper.loopFix(); // eslint-disable-next-line
thumbsSwiper._clientLeft = thumbsSwiper.$wrapperEl[0].clientLeft;
currentThumbsIndex = thumbsSwiper.activeIndex;
} // Find actual thumbs index to slide to
var prevThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).prevAll("[data-swiper-slide-index=\"" + swiper.realIndex + "\"]").eq(0).index();
var nextThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).nextAll("[data-swiper-slide-index=\"" + swiper.realIndex + "\"]").eq(0).index();
if (typeof prevThumbsIndex === 'undefined') {
newThumbsIndex = nextThumbsIndex;
} else if (typeof nextThumbsIndex === 'undefined') {
newThumbsIndex = prevThumbsIndex;
} else if (nextThumbsIndex - currentThumbsIndex === currentThumbsIndex - prevThumbsIndex) {
newThumbsIndex = thumbsSwiper.params.slidesPerGroup > 1 ? nextThumbsIndex : currentThumbsIndex;
} else if (nextThumbsIndex - currentThumbsIndex < currentThumbsIndex - prevThumbsIndex) {
newThumbsIndex = nextThumbsIndex;
} else {
newThumbsIndex = prevThumbsIndex;
}
direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';
} else {
newThumbsIndex = swiper.realIndex;
direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev';
}
if (useOffset) {
newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset;
}
if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) {
if (thumbsSwiper.params.centeredSlides) {
if (newThumbsIndex > currentThumbsIndex) {
newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1;
} else {
newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
}
} else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) {// newThumbsIndex = newThumbsIndex - slidesPerView + 1;
}
thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);
}
} // Activate thumbs
var thumbsToActivate = 1;
var thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass;
if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) {
thumbsToActivate = swiper.params.slidesPerView;
}
if (!swiper.params.thumbs.multipleActiveThumbs) {
thumbsToActivate = 1;
}
thumbsToActivate = Math.floor(thumbsToActivate);
thumbsSwiper.slides.removeClass(thumbActiveClass);
if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) {
for (var i = 0; i < thumbsToActivate; i += 1) {
thumbsSwiper.$wrapperEl.children("[data-swiper-slide-index=\"" + (swiper.realIndex + i) + "\"]").addClass(thumbActiveClass);
}
} else {
for (var _i = 0; _i < thumbsToActivate; _i += 1) {
thumbsSwiper.slides.eq(swiper.realIndex + _i).addClass(thumbActiveClass);
}
}
}
};
export default {
name: 'thumbs',
params: {
thumbs: {
swiper: null,
multipleActiveThumbs: true,
autoScrollOffset: 0,
slideThumbActiveClass: 'swiper-slide-thumb-active',
thumbsContainerClass: 'swiper-container-thumbs'
}
},
create: function create() {
var swiper = this;
bindModuleMethods(swiper, {
thumbs: _extends({
swiper: null,
initialized: false
}, Thumbs)
});
},
on: {
beforeInit: function beforeInit(swiper) {
var thumbs = swiper.params.thumbs;
if (!thumbs || !thumbs.swiper) return;
swiper.thumbs.init();
swiper.thumbs.update(true);
},
slideChange: function slideChange(swiper) {
if (!swiper.thumbs.swiper) return;
swiper.thumbs.update();
},
update: function update(swiper) {
if (!swiper.thumbs.swiper) return;
swiper.thumbs.update();
},
resize: function resize(swiper) {
if (!swiper.thumbs.swiper) return;
swiper.thumbs.update();
},
observerUpdate: function observerUpdate(swiper) {
if (!swiper.thumbs.swiper) return;
swiper.thumbs.update();
},
setTransition: function setTransition(swiper, duration) {
var thumbsSwiper = swiper.thumbs.swiper;
if (!thumbsSwiper) return;
thumbsSwiper.setTransition(duration);
},
beforeDestroy: function beforeDestroy(swiper) {
var thumbsSwiper = swiper.thumbs.swiper;
if (!thumbsSwiper) return;
if (swiper.thumbs.swiperCreated && thumbsSwiper) {
thumbsSwiper.destroy();
}
}
}
};
webpack://frontend-tpt/../../node_modules/ua-parser-js/src/ua-parser.js
///////////////////////////////////////////////////////////////////////////////// /* UAParser.js v1.0.39 Copyright © 2012-2021 Faisal Salman <[email protected]> MIT License *//* Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment. Demo : https://faisalman.github.io/ua-parser-js Source : https://github.com/faisalman/ua-parser-js */ ///////////////////////////////////////////////////////////////////////////////// (function (window, undefined) { 'use strict'; ////////////// // Constants ///////////// var LIBVERSION = '1.0.39', EMPTY = '', UNKNOWN = '?', FUNC_TYPE = 'function', UNDEF_TYPE = 'undefined', OBJ_TYPE = 'object', STR_TYPE = 'string', MAJOR = 'major', MODEL = 'model', NAME = 'name', TYPE = 'type', VENDOR = 'vendor', VERSION = 'version', ARCHITECTURE= 'architecture', CONSOLE = 'console', MOBILE = 'mobile', TABLET = 'tablet', SMARTTV = 'smarttv', WEARABLE = 'wearable', EMBEDDED = 'embedded', UA_MAX_LENGTH = 500; var AMAZON = 'Amazon', APPLE = 'Apple', ASUS = 'ASUS', BLACKBERRY = 'BlackBerry', BROWSER = 'Browser', CHROME = 'Chrome', EDGE = 'Edge', FIREFOX = 'Firefox', GOOGLE = 'Google', HUAWEI = 'Huawei', LG = 'LG', MICROSOFT = 'Microsoft', MOTOROLA = 'Motorola', OPERA = 'Opera', SAMSUNG = 'Samsung', SHARP = 'Sharp', SONY = 'Sony', XIAOMI = 'Xiaomi', ZEBRA = 'Zebra', FACEBOOK = 'Facebook', CHROMIUM_OS = 'Chromium OS', MAC_OS = 'Mac OS', SUFFIX_BROWSER = ' Browser'; /////////// // Helper ////////// var extend = function (regexes, extensions) { var mergedRegexes = {}; for (var i in regexes) { if (extensions[i] && extensions[i].length % 2 === 0) { mergedRegexes[i] = extensions[i].concat(regexes[i]); } else { mergedRegexes[i] = regexes[i]; } } return mergedRegexes; }, enumerize = function (arr) { var enums = {}; for (var i=0; i<arr.length; i++) { enums[arr[i].toUpperCase()] = arr[i]; } return enums; }, has = function (str1, str2) { return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false; }, lowerize = function (str) { return str.toLowerCase(); }, majorize = function (version) { return typeof(version) === STR_TYPE ? version.replace(/[^\d\.]/g, EMPTY).split('.')[0] : undefined; }, trim = function (str, len) { if (typeof(str) === STR_TYPE) { str = str.replace(/^\s\s*/, EMPTY); return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH); } }; /////////////// // Map helper ////////////// var rgxMapper = function (ua, arrays) { var i = 0, j, k, p, q, matches, match; // loop through all regexes maps while (i < arrays.length && !matches) { var regex = arrays[i], // even sequence (0,2,4,..) props = arrays[i + 1]; // odd sequence (1,3,5,..) j = k = 0; // try matching uastring with regexes while (j < regex.length && !matches) { if (!regex[j]) { break; } matches = regex[j++].exec(ua); if (!!matches) { for (p = 0; p < props.length; p++) { match = matches[++k]; q = props[p]; // check if given property is actually array if (typeof q === OBJ_TYPE && q.length > 0) { if (q.length === 2) { if (typeof q[1] == FUNC_TYPE) { // assign modified match this[q[0]] = q[1].call(this, match); } else { // assign given value, ignore regex match this[q[0]] = q[1]; } } else if (q.length === 3) { // check whether function or regex if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) { // call function (usually string mapper) this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; } else { // sanitize match using given regex this[q[0]] = match ? match.replace(q[1], q[2]) : undefined; } } else if (q.length === 4) { this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; } } else { this[q] = match ? match : undefined; } } } } i += 2; } }, strMapper = function (str, map) { for (var i in map) { // check if current value is array if (typeof map[i] === OBJ_TYPE && map[i].length > 0) { for (var j = 0; j < map[i].length; j++) { if (has(map[i][j], str)) { return (i === UNKNOWN) ? undefined : i; } } } else if (has(map[i], str)) { return (i === UNKNOWN) ? undefined : i; } } return map.hasOwnProperty('*') ? map['*'] : str; }; /////////////// // String map ////////////// // Safari < 3.0 var oldSafariMap = { '1.0' : '/8', '1.2' : '/1', '1.3' : '/3', '2.0' : '/412', '2.0.2' : '/416', '2.0.3' : '/417', '2.0.4' : '/419', '?' : '/' }, windowsVersionMap = { 'ME' : '4.90', 'NT 3.11' : 'NT3.51', 'NT 4.0' : 'NT4.0', '2000' : 'NT 5.0', 'XP' : ['NT 5.1', 'NT 5.2'], 'Vista' : 'NT 6.0', '7' : 'NT 6.1', '8' : 'NT 6.2', '8.1' : 'NT 6.3', '10' : ['NT 6.4', 'NT 10.0'], 'RT' : 'ARM' }; ////////////// // Regex map ///////////// var regexes = { browser : [[ /\b(?:crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS ], [VERSION, [NAME, 'Chrome']], [ /edg(?:e|ios|a)?\/([\w\.]+)/i // Microsoft Edge ], [VERSION, [NAME, 'Edge']], [ // Presto based /(opera mini)\/([-\w\.]+)/i, // Opera Mini /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, // Opera Mobi/Tablet /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i // Opera ], [NAME, VERSION], [ /opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0 ], [VERSION, [NAME, OPERA+' Mini']], [ /\bop(?:rg)?x\/([\w\.]+)/i // Opera GX ], [VERSION, [NAME, OPERA+' GX']], [ /\bopr\/([\w\.]+)/i // Opera Webkit ], [VERSION, [NAME, OPERA]], [ // Mixed /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i // Baidu ], [VERSION, [NAME, 'Baidu']], [ /(kindle)\/([\w\.]+)/i, // Kindle /(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer/Sleipnir // Trident based /(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i, // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar/Helio /(heytap|ovi)browser\/([\d\.]+)/i, // HeyTap/Ovi /(weibo)__([\d\.]+)/i // Weibo ], [NAME, VERSION], [ /quark(?:pc)?\/([-\w\.]+)/i // Quark ], [VERSION, [NAME, 'Quark']], [ /\bddg\/([\w\.]+)/i // DuckDuckGo ], [VERSION, [NAME, 'DuckDuckGo']], [ /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser ], [VERSION, [NAME, 'UC'+BROWSER]], [ /microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser /\bqbcore\/([\w\.]+).+microm/i, /micromessenger\/([\w\.]+)/i // WeChat ], [VERSION, [NAME, 'WeChat']], [ /konqueror\/([\w\.]+)/i // Konqueror ], [VERSION, [NAME, 'Konqueror']], [ /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11 ], [VERSION, [NAME, 'IE']], [ /ya(?:search)?browser\/([\w\.]+)/i // Yandex ], [VERSION, [NAME, 'Yandex']], [ /slbrowser\/([\w\.]+)/i // Smart Lenovo Browser ], [VERSION, [NAME, 'Smart Lenovo '+BROWSER]], [ /(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser ], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [ /\bfocus\/([\w\.]+)/i // Firefox Focus ], [VERSION, [NAME, FIREFOX+' Focus']], [ /\bopt\/([\w\.]+)/i // Opera Touch ], [VERSION, [NAME, OPERA+' Touch']], [ /coc_coc\w+\/([\w\.]+)/i // Coc Coc Browser ], [VERSION, [NAME, 'Coc Coc']], [ /dolfin\/([\w\.]+)/i // Dolphin ], [VERSION, [NAME, 'Dolphin']], [ /coast\/([\w\.]+)/i // Opera Coast ], [VERSION, [NAME, OPERA+' Coast']], [ /miuibrowser\/([\w\.]+)/i // MIUI Browser ], [VERSION, [NAME, 'MIUI '+BROWSER]], [ /fxios\/([-\w\.]+)/i // Firefox for iOS ], [VERSION, [NAME, FIREFOX]], [ /\bqihu|(qi?ho?o?|360)browser/i // 360 ], [[NAME, '360' + SUFFIX_BROWSER]], [ /\b(qq)\/([\w\.]+)/i // QQ ], [[NAME, /(.+)/, '$1Browser'], VERSION], [ /(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i ], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser/PicoBrowser /samsungbrowser\/([\w\.]+)/i // Samsung Internet ], [VERSION, [NAME, SAMSUNG + ' Internet']], [ /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon ], [[NAME, /_/g, ' '], VERSION], [ /metasr[\/ ]?([\d\.]+)/i // Sogou Explorer ], [VERSION, [NAME, 'Sogou Explorer']], [ /(sogou)mo\w+\/([\d\.]+)/i // Sogou Mobile ], [[NAME, 'Sogou Mobile'], VERSION], [ /(electron)\/([\w\.]+) safari/i, // Electron-based App /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla /m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/2345 Browser ], [NAME, VERSION], [ /(lbbrowser|rekonq)/i, // LieBao Browser/Rekonq /\[(linkedin)app\]/i // LinkedIn App for iOS & Android ], [NAME], [ // WebView /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android ], [[NAME, FACEBOOK], VERSION], [ /(Klarna)\/([\w\.]+)/i, // Klarna Shopping Browser for iOS & Android /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp /safari (line)\/([\w\.]+)/i, // Line App for iOS /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android /(alipay)client\/([\w\.]+)/i, // Alipay /(twitter)(?:and| f.+e\/([\w\.]+))/i, // Twitter /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i // Chromium/Instagram/Snapchat ], [NAME, VERSION], [ /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS ], [VERSION, [NAME, 'GSA']], [ /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok ], [VERSION, [NAME, 'TikTok']], [ /headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless ], [VERSION, [NAME, CHROME+' Headless']], [ / wv\).+(chrome)\/([\w\.]+)/i // Chrome WebView ], [[NAME, CHROME+' WebView'], VERSION], [ /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i // Android Browser ], [VERSION, [NAME, 'Android '+BROWSER]], [ /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia ], [NAME, VERSION], [ /version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i // Mobile Safari ], [VERSION, [NAME, 'Mobile Safari']], [ /version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile ], [VERSION, NAME], [ /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 ], [NAME, [VERSION, strMapper, oldSafariMap]], [ /(webkit|khtml)\/([\w\.]+)/i ], [NAME, VERSION], [ // Gecko based /(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape ], [[NAME, 'Netscape'], VERSION], [ /(wolvic)\/([\w\.]+)/i // Wolvic ], [NAME, VERSION], [ /mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality ], [VERSION, [NAME, FIREFOX+' Reality']], [ /ekiohf.+(flow)\/([\w\.]+)/i, // Flow /(swiftfox)/i, // Swiftfox /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i, // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix /(firefox)\/([\w\.]+)/i, // Other Firefox-based /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, // Mozilla // Other /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Obigo/Mosaic/Go/ICE/UP.Browser /(links) \(([\w\.]+)/i // Links ], [NAME, [VERSION, /_/g, '.']], [ /(cobalt)\/([\w\.]+)/i // Cobalt ], [NAME, [VERSION, /master.|lts./, ""]] ], cpu : [[ /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i // AMD64 (x64) ], [[ARCHITECTURE, 'amd64']], [ /(ia32(?=;))/i // IA32 (quicktime) ], [[ARCHITECTURE, lowerize]], [ /((?:i[346]|x)86)[;\)]/i // IA32 (x86) ], [[ARCHITECTURE, 'ia32']], [ /\b(aarch64|arm(v?8e?l?|_?64))\b/i // ARM64 ], [[ARCHITECTURE, 'arm64']], [ /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i // ARMHF ], [[ARCHITECTURE, 'armhf']], [ // PocketPC mistakenly identified as PowerPC /windows (ce|mobile); ppc;/i ], [[ARCHITECTURE, 'arm']], [ /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i // PowerPC ], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [ /(sun4\w)[;\)]/i // SPARC ], [[ARCHITECTURE, 'sparc']], [ /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC ], [[ARCHITECTURE, lowerize]] ], device : [[ ////////////////////////// // MOBILES & TABLETS ///////////////////////// // Samsung /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i ], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [ /\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]((?!sm-[lr])[-\w]+)/i, /sec-(sgh\w+)/i ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [ // Apple /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i // iPod/iPhone ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [ /\((ipad);[-\w\),; ]+apple/i, // iPad /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i ], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [ /(macintosh);/i ], [MODEL, [VENDOR, APPLE]], [ // Sharp /\b(sh-?[altvz]?\d\d[a-ekm]?)/i ], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [ // Huawei /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i ], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [ /(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i ], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [ // Xiaomi /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i, // Xiaomi POCO /\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, // Xiaomi Redmi 'numeric' models /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i // Xiaomi Mi ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [ /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, // Redmi Pad /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i // Mi Pad tablets ],[[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, TABLET]], [ // OPPO /; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i ], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [ /\b(opd2\d{3}a?) bui/i ], [MODEL, [VENDOR, 'OPPO'], [TYPE, TABLET]], [ // Vivo /vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i ], [MODEL, [VENDOR, 'Vivo'], [TYPE, MOBILE]], [ // Realme /\b(rmx[1-3]\d{3})(?: bui|;|\))/i ], [MODEL, [VENDOR, 'Realme'], [TYPE, MOBILE]], [ // Motorola /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i ], [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], [ /\b(mz60\d|xoom[2 ]{0,2}) build\//i ], [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], [ // LG /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i ], [MODEL, [VENDOR, LG], [TYPE, TABLET]], [ /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i ], [MODEL, [VENDOR, LG], [TYPE, MOBILE]], [ // Lenovo /(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [ // Nokia /(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i ], [[MODEL, /_/g, ' '], [VENDOR, 'Nokia'], [TYPE, MOBILE]], [ // Google /(pixel c)\b/i // Google Pixel C ], [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], [ /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i // Google Pixel ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [ // Sony /droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i ], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [ /sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i ], [[MODEL, 'Xperia Tablet'], [VENDOR, SONY], [TYPE, TABLET]], [ // OnePlus / (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [ // Amazon /(alexa)webm/i, /(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i, // Kindle Fire without Silk / Echo Show /(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [ /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone ], [[MODEL, /(.+)/g, 'Fire Phone $1'], [VENDOR, AMAZON], [TYPE, MOBILE]], [ // BlackBerry /(playbook);[-\w\),; ]+(rim)/i // BlackBerry PlayBook ], [MODEL, VENDOR, [TYPE, TABLET]], [ /\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i // BlackBerry 10 ], [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], [ // Asus /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i ], [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], [ / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i ], [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], [ // HTC /(nexus 9)/i // HTC Nexus 9 ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [ /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, // HTC // ZTE /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [ // TCL /droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i ], [MODEL, [VENDOR, 'TCL'], [TYPE, TABLET]], [ // itel /(itel) ((\w+))/i ], [[VENDOR, lowerize], MODEL, [TYPE, strMapper, { 'tablet' : ['p10001l', 'w7001'], '*' : 'mobile' }]], [ // Acer /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [ // Meizu /droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [ // Ulefone /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i ], [MODEL, [VENDOR, 'Ulefone'], [TYPE, MOBILE]], [ // Nothing /droid.+; (a(?:015|06[35]|142p?))/i ], [MODEL, [VENDOR, 'Nothing'], [TYPE, MOBILE]], [ // MIXED /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i, // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron /(hp) ([\w ]+\w)/i, // HP iPAQ /(asus)-?(\w+)/i, // Asus /(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia /(lenovo)[-_ ]?([-\w]+)/i, // Lenovo /(jolla)/i, // Jolla /(oppo) ?([\w ]+) bui/i // OPPO ], [VENDOR, MODEL, [TYPE, MOBILE]], [ /(kobo)\s(ereader|touch)/i, // Kobo /(archos) (gamepad2?)/i, // Archos /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad /(kindle)\/([\w\.]+)/i, // Kindle /(nook)[\w ]+build\/(\w+)/i, // Nook /(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets /(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets /(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets /(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone ], [VENDOR, MODEL, [TYPE, TABLET]], [ /(surface duo)/i // Surface Duo ], [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], [ /droid [\d\.]+; (fp\du?)(?: b|\))/i // Fairphone ], [MODEL, [VENDOR, 'Fairphone'], [TYPE, MOBILE]], [ /(u304aa)/i // AT&T ], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [ /\bsie-(\w*)/i // Siemens ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [ /\b(rct\w+) b/i // RCA Tablets ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [ /\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [ /\b(q(?:mv|ta)\w+) b/i // Verizon Tablet ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [ /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet ], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [ /\b(tm\d{3}\w+) b/i ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [ /\b(k88) b/i // ZTE K Series Tablet ], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [ /\b(nx\d{3}j) b/i // ZTE Nubia ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [ /\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [ /\b(zur\d{3}) b/i // Swiss ZUR Tablet ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [ /\b((zeki)?tb.*\b) b/i // Zeki Tablets ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [ /\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [ /\b(ns-?\w{0,9}) b/i // Insignia Tablets ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [ /\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [ /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [ /\b(lvtel\-)?(v1[12]) b/i // LvTel Phones ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [ /\b(ph-1) /i // Essential PH-1 ], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [ /\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [ /\b(trio[-\w\. ]+) b/i // MachSpeed Tablets ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [ /\btu_(1491) b/i // Rotor Tablets ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [ /(shield[\w ]+) b/i // Nvidia Shield Tablets ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, TABLET]], [ /(sprint) (\w+)/i // Sprint Phones ], [VENDOR, MODEL, [TYPE, MOBILE]], [ /(kin\.[onetw]{3})/i // Microsoft Kin ], [[MODEL, /\./g, ' '], [VENDOR, MICROSOFT], [TYPE, MOBILE]], [ /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i // Zebra ], [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], [ /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i ], [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], [ /////////////////// // SMARTTVS /////////////////// /smart-tv.+(samsung)/i // Samsung ], [VENDOR, [TYPE, SMARTTV]], [ /hbbtv.+maple;(\d+)/i ], [[MODEL, /^/, 'SmartTV'], [VENDOR, SAMSUNG], [TYPE, SMARTTV]], [ /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i // LG SmartTV ], [[VENDOR, LG], [TYPE, SMARTTV]], [ /(apple) ?tv/i // Apple TV ], [VENDOR, [MODEL, APPLE+' TV'], [TYPE, SMARTTV]], [ /crkey/i // Google Chromecast ], [[MODEL, CHROME+'cast'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [ /droid.+aft(\w+)( bui|\))/i // Fire TV ], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [ /\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i // Sharp ], [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],[ /(bravia[\w ]+)( bui|\))/i // Sony ], [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], [ /(mitv-\w{5}) bui/i // Xiaomi ], [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]], [ /Hbbtv.*(technisat) (.*);/i // TechniSAT ], [VENDOR, MODEL, [TYPE, SMARTTV]], [ /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i // HbbTV devices ], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [ /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i // SmartTV from Unidentified Vendors ], [[TYPE, SMARTTV]], [ /////////////////// // CONSOLES /////////////////// /(ouya)/i, // Ouya /(nintendo) ([wids3utch]+)/i // Nintendo ], [VENDOR, MODEL, [TYPE, CONSOLE]], [ /droid.+; (shield) bui/i // Nvidia ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [ /(playstation [345portablevi]+)/i // Playstation ], [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], [ /\b(xbox(?: one)?(?!; xbox))[\); ]/i // Microsoft Xbox ], [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], [ /////////////////// // WEARABLES /////////////////// /\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i // Samsung Galaxy Watch ], [MODEL, [VENDOR, SAMSUNG], [TYPE, WEARABLE]], [ /((pebble))app/i // Pebble ], [VENDOR, MODEL, [TYPE, WEARABLE]], [ /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i // Apple Watch ], [MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]], [ /droid.+; (glass) \d/i // Google Glass ], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [ /droid.+; (wt63?0{2,3})\)/i ], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [ /(quest( \d| pro)?)/i // Oculus Quest ], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [ /////////////////// // EMBEDDED /////////////////// /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla ], [VENDOR, [TYPE, EMBEDDED]], [ /(aeobc)\b/i // Echo Dot ], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [ //////////////////// // MIXED (GENERIC) /////////////////// /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors ], [MODEL, [TYPE, MOBILE]], [ /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors ], [MODEL, [TYPE, TABLET]], [ /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i // Unidentifiable Tablet ], [[TYPE, TABLET]], [ /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile ], [[TYPE, MOBILE]], [ /(android[-\w\. ]{0,9});.+buil/i // Generic Android Device ], [MODEL, [VENDOR, 'Generic']] ], engine : [[ /windows.+ edge\/([\w\.]+)/i // EdgeHTML ], [VERSION, [NAME, EDGE+'HTML']], [ /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink ], [VERSION, [NAME, 'Blink']], [ /(presto)\/([\w\.]+)/i, // Presto /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna /ekioh(flow)\/([\w\.]+)/i, // Flow /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab /\b(libweb)/i ], [NAME, VERSION], [ /rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko ], [VERSION, NAME] ], os : [[ // Windows /microsoft (windows) (vista|xp)/i // Windows (iTunes) ], [NAME, VERSION], [ /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i // Windows Phone ], [NAME, [VERSION, strMapper, windowsVersionMap]], [ /windows nt 6\.2; (arm)/i, // Windows RT /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i, /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i ], [[VERSION, strMapper, windowsVersionMap], [NAME, 'Windows']], [ // iOS/macOS /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, /cfnetwork\/.+darwin/i ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [ /(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i // Mac OS ], [[NAME, MAC_OS], [VERSION, /_/g, '.']], [ // Mobile OSes /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, // Blackberry /(tizen|kaios)[\/ ]([\w\.]+)/i, // Tizen/KaiOS /\((series40);/i // Series 40 ], [NAME, VERSION], [ /\(bb(10);/i // BlackBerry 10 ], [VERSION, [NAME, BLACKBERRY]], [ /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i // Symbian ], [VERSION, [NAME, 'Symbian']], [ /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i // Firefox OS ], [VERSION, [NAME, FIREFOX+' OS']], [ /web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS ], [VERSION, [NAME, 'webOS']], [ /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i // watchOS ], [VERSION, [NAME, 'watchOS']], [ // Google Chromecast /crkey\/([\d\.]+)/i // Google Chromecast ], [VERSION, [NAME, CHROME+'cast']], [ /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i // Chromium OS ], [[NAME, CHROMIUM_OS], VERSION],[ // Smart TVs /panasonic;(viera)/i, // Panasonic Viera /(netrange)mmh/i, // Netrange /(nettv)\/(\d+\.[\w\.]+)/i, // NetTV // Console /(nintendo|playstation) ([wids345portablevuch]+)/i, // Nintendo/Playstation /(xbox); +xbox ([^\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S) // Other /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, // Joli/Palm /(mint)[\/\(\) ]?(\w*)/i, // Mint /(mageia|vectorlinux)[; ]/i, // Mageia/VectorLinux /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire /(hurd|linux) ?([\w\.]*)/i, // Hurd/Linux /(gnu) ?([\w\.]*)/i, // GNU /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly /(haiku) (\w+)/i // Haiku ], [NAME, VERSION], [ /(sunos) ?([\w\.\d]*)/i // Solaris ], [[NAME, 'Solaris'], VERSION], [ /((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS /(unix) ?([\w\.]*)/i // UNIX ], [NAME, VERSION] ] }; ///////////////// // Constructor //////////////// var UAParser = function (ua, extensions) { if (typeof ua === OBJ_TYPE) { extensions = ua; ua = undefined; } if (!(this instanceof UAParser)) { return new UAParser(ua, extensions).getResult(); } var _navigator = (typeof window !== UNDEF_TYPE && window.navigator) ? window.navigator : undefined; var _ua = ua || ((_navigator && _navigator.userAgent) ? _navigator.userAgent : EMPTY); var _uach = (_navigator && _navigator.userAgentData) ? _navigator.userAgentData : undefined; var _rgxmap = extensions ? extend(regexes, extensions) : regexes; var _isSelfNav = _navigator && _navigator.userAgent == _ua; this.getBrowser = function () { var _browser = {}; _browser[NAME] = undefined; _browser[VERSION] = undefined; rgxMapper.call(_browser, _ua, _rgxmap.browser); _browser[MAJOR] = majorize(_browser[VERSION]); // Brave-specific detection if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) { _browser[NAME] = 'Brave'; } return _browser; }; this.getCPU = function () { var _cpu = {}; _cpu[ARCHITECTURE] = undefined; rgxMapper.call(_cpu, _ua, _rgxmap.cpu); return _cpu; }; this.getDevice = function () { var _device = {}; _device[VENDOR] = undefined; _device[MODEL] = undefined; _device[TYPE] = undefined; rgxMapper.call(_device, _ua, _rgxmap.device); if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) { _device[TYPE] = MOBILE; } // iPadOS-specific detection: identified as Mac, but has some iOS-only properties if (_isSelfNav && _device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) { _device[MODEL] = 'iPad'; _device[TYPE] = TABLET; } return _device; }; this.getEngine = function () { var _engine = {}; _engine[NAME] = undefined; _engine[VERSION] = undefined; rgxMapper.call(_engine, _ua, _rgxmap.engine); return _engine; }; this.getOS = function () { var _os = {}; _os[NAME] = undefined; _os[VERSION] = undefined; rgxMapper.call(_os, _ua, _rgxmap.os); if (_isSelfNav && !_os[NAME] && _uach && _uach.platform && _uach.platform != 'Unknown') { _os[NAME] = _uach.platform .replace(/chrome os/i, CHROMIUM_OS) .replace(/macos/i, MAC_OS); // backward compatibility } return _os; }; this.getResult = function () { return { ua : this.getUA(), browser : this.getBrowser(), engine : this.getEngine(), os : this.getOS(), device : this.getDevice(), cpu : this.getCPU() }; }; this.getUA = function () { return _ua; }; this.setUA = function (ua) { _ua = (typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH) ? trim(ua, UA_MAX_LENGTH) : ua; return this; }; this.setUA(_ua); return this; }; UAParser.VERSION = LIBVERSION; UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]); UAParser.CPU = enumerize([ARCHITECTURE]); UAParser.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]); UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]); /////////// // Export ////////// // check js environment if (typeof(exports) !== UNDEF_TYPE) { // nodejs env if (typeof module !== UNDEF_TYPE && module.exports) { exports = module.exports = UAParser; } exports.UAParser = UAParser; } else { // requirejs env (optional) if (typeof(define) === FUNC_TYPE && define.amd) { define(function () { return UAParser; }); } else if (typeof window !== UNDEF_TYPE) { // browser env window.UAParser = UAParser; } } // jQuery/Zepto specific (optional) // Note: // In AMD env the global scope should be kept clean, but jQuery is an exception. // jQuery always exports to global scope, unless jQuery.noConflict(true) is used, // and we should catch that. var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto); if ($ && !$.ua) { var parser = new UAParser(); $.ua = parser.getResult(); $.ua.get = function () { return parser.getUA(); }; $.ua.set = function (ua) { parser.setUA(ua); var result = parser.getResult(); for (var prop in result) { $.ua[prop] = result[prop]; } }; } })(typeof window === 'object' ? window : this);
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/arrayLikeToArray.js
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js
var unsupportedIterableToArray = require("./unsupportedIterableToArray.js");
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (it) return (it = it.call(o)).next.bind(it);
if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it) o = it;
var i = 0;
return function () {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module.exports = _createForOfIteratorHelperLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/defineProperty.js
var toPropertyKey = require("./toPropertyKey.js");
function _defineProperty(obj, key, value) {
key = toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/extends.js
function _extends() {
module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
return _extends.apply(this, arguments);
}
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/interopRequireDefault.js
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/interopRequireWildcard.js
var _typeof = require("./typeof.js")["default"];
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function") return null;
var cacheBabelInterop = new WeakMap();
var cacheNodeInterop = new WeakMap();
return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
return {
"default": obj
};
}
var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) {
return cache.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key in obj) {
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
newObj["default"] = obj;
if (cache) {
cache.set(obj, newObj);
}
return newObj;
}
module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/objectSpread2.js
var defineProperty = require("./defineProperty.js");
function ownKeys(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function (r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread2(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
defineProperty(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/toPrimitive.js
var _typeof = require("./typeof.js")["default"];
function _toPrimitive(input, hint) {
if (_typeof(input) !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (_typeof(res) !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/toPropertyKey.js
var _typeof = require("./typeof.js")["default"];
var toPrimitive = require("./toPrimitive.js");
function _toPropertyKey(arg) {
var key = toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/typeof.js
function _typeof(o) {
"@babel/helpers - typeof";
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/react-native-web/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js
var arrayLikeToArray = require("./arrayLikeToArray.js");
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
}
module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
export default function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
export default function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
import arrayWithoutHoles from "./arrayWithoutHoles.js";
import iterableToArray from "./iterableToArray.js";
import unsupportedIterableToArray from "./unsupportedIterableToArray.js";
import nonIterableSpread from "./nonIterableSpread.js";
export default function _toConsumableArray(arr) {
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
import arrayLikeToArray from "./arrayLikeToArray.js";
export default function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return arrayLikeToArray(arr);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
export default function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
export default function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/typeof.js
export default function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
import arrayLikeToArray from "./arrayLikeToArray.js";
export default function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
}
webpack://frontend-tpt/webpack/bootstrap
// The module cache
var __webpack_module_cache__ = {};
// The require function
function __webpack_require__(moduleId) {
// Check if module is in cache
var cachedModule = __webpack_module_cache__[moduleId];
if (cachedModule !== undefined) {
return cachedModule.exports;
}
// Create a new module (and put it into the cache)
var module = __webpack_module_cache__[moduleId] = {
id: moduleId,
loaded: false,
exports: {}
};
// Execute the module function
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
// Flag the module as loaded
module.loaded = true;
// Return the exports of the module
return module.exports;
}
// expose the modules object (__webpack_modules__)
__webpack_require__.m = __webpack_modules__;
webpack://frontend-tpt/webpack/runtime/amd define
__webpack_require__.amdD = function () {
throw new Error('define cannot be used indirect');
};
webpack://frontend-tpt/webpack/runtime/amd options
__webpack_require__.amdO = {};
webpack://frontend-tpt/webpack/runtime/compat get default export
// getDefaultExport function for compatibility with non-harmony modules
__webpack_require__.n = (module) => {
var getter = module && module.__esModule ?
() => (module['default']) :
() => (module);
__webpack_require__.d(getter, { a: getter });
return getter;
};
webpack://frontend-tpt/webpack/runtime/define property getters
// define getter functions for harmony exports
__webpack_require__.d = (exports, definition) => {
for(var key in definition) {
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
}
}
};
webpack://frontend-tpt/webpack/runtime/ensure chunk
__webpack_require__.f = {};
// This file contains only the entry chunk.
// The chunk loading function for additional chunks
__webpack_require__.e = (chunkId) => {
return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
__webpack_require__.f[key](chunkId, promises);
return promises;
}, []));
};
webpack://frontend-tpt/webpack/runtime/get javascript chunk filename
// This function allow to reference async chunks
__webpack_require__.u = (chunkId) => {
// return url for filenames based on template
return "" + chunkId + "." + __webpack_require__.h() + ".js";
};
webpack://frontend-tpt/webpack/runtime/get mini-css chunk filename
// This function allow to reference async chunks
__webpack_require__.miniCssF = (chunkId) => {
// return url for filenames based on template
return undefined;
};
webpack://frontend-tpt/webpack/runtime/getFullHash
__webpack_require__.h = () => ("4915b35a2fbd29184020")
webpack://frontend-tpt/webpack/runtime/global
__webpack_require__.g = (function() {
if (typeof globalThis === 'object') return globalThis;
try {
return this || new Function('return this')();
} catch (e) {
if (typeof window === 'object') return window;
}
})();
webpack://frontend-tpt/webpack/runtime/hasOwnProperty shorthand
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
webpack://frontend-tpt/webpack/runtime/make namespace object
// define __esModule on exports
__webpack_require__.r = (exports) => {
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
}
Object.defineProperty(exports, '__esModule', { value: true });
};
webpack://frontend-tpt/webpack/runtime/node module decorator
__webpack_require__.nmd = (module) => {
module.paths = [];
if (!module.children) module.children = [];
return module;
};
webpack://frontend-tpt/webpack/runtime/publicPath
__webpack_require__.p = "/tpt/assets/";
webpack://frontend-tpt/webpack/runtime/jsonp chunk loading
// no baseURI
// object to store loaded and loading chunks
// undefined = chunk not loaded, null = chunk preloaded/prefetched
// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
var installedChunks = {
296: 0
};
__webpack_require__.f.j = (chunkId, promises) => {
// JSONP chunk loading for javascript
var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
if(installedChunkData !== 0) { // 0 means "already installed".
// a Promise means "currently loading".
if(installedChunkData) {
promises.push(installedChunkData[2]);
} else {
if(true) { // all chunks have JS
// setup Promise in chunk cache
var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
promises.push(installedChunkData[2] = promise);
// start chunk loading
var url = __webpack_require__.p + __webpack_require__.u(chunkId);
// create error before stack unwound to get useful stacktrace later
var error = new Error();
var loadingEnded = (event) => {
if(__webpack_require__.o(installedChunks, chunkId)) {
installedChunkData = installedChunks[chunkId];
if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
if(installedChunkData) {
var errorType = event && (event.type === 'load' ? 'missing' : event.type);
var realSrc = event && event.target && event.target.src;
error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
error.name = 'ChunkLoadError';
error.type = errorType;
error.request = realSrc;
installedChunkData[1](error);
}
}
};
__webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
}
}
}
};
// no prefetching
// no preloaded
// no HMR
// no HMR manifest
// no on chunks loaded
// install a JSONP callback for chunk loading
var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
var [chunkIds, moreModules, runtime] = data;
// add "moreModules" to the modules object,
// then flag all "chunkIds" as loaded and fire callback
var moduleId, chunkId, i = 0;
if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
for(moduleId in moreModules) {
if(__webpack_require__.o(moreModules, moduleId)) {
__webpack_require__.m[moduleId] = moreModules[moduleId];
}
}
if(runtime) var result = runtime(__webpack_require__);
}
if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
for(;i < chunkIds.length; i++) {
chunkId = chunkIds[i];
if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
installedChunks[chunkId][0]();
}
installedChunks[chunkId] = 0;
}
}
var chunkLoadingGlobal = self["talentPicksToolJsonOutput"] = self["talentPicksToolJsonOutput"] || [];
chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/jsx.js
var REACT_ELEMENT_TYPE;
export default function _createRawReactElement(type, props, key, children) {
if (!REACT_ELEMENT_TYPE) {
REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7;
}
var defaultProps = type && type.defaultProps;
var childrenLength = arguments.length - 3;
if (!props && childrenLength !== 0) {
props = {
children: void 0
};
}
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = new Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 3];
}
props.children = childArray;
}
if (props && defaultProps) {
for (var propName in defaultProps) {
if (props[propName] === void 0) {
props[propName] = defaultProps[propName];
}
}
} else if (!props) {
props = defaultProps || {};
}
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key === undefined ? null : "" + key,
ref: null,
props: props,
_owner: null
};
}
webpack://frontend-tpt/../../node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
export function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
export var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
export function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
export function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
export function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
export function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
export function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
export function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
export function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
export function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
export function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
export var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
export function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
export function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
export function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
export function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
export function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
export function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
export function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
export function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
export function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
export function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
export function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
export function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
}
export function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
export function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
export function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
export function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
export function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
export function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
function next() {
while (env.stack.length) {
var rec = env.stack.pop();
try {
var result = rec.dispose && rec.dispose.call(rec.value);
if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
catch (e) {
fail(e);
}
}
if (env.hasError) throw env.error;
}
return next();
}
export default {
__extends,
__assign,
__rest,
__decorate,
__param,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
};
webpack://frontend-tpt/../../node_modules/ts-invariant/lib/invariant.js
import { __extends } from "tslib";
var genericMessage = "Invariant Violation";
var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) {
obj.__proto__ = proto;
return obj;
} : _a;
var InvariantError = /** @class */ (function (_super) {
__extends(InvariantError, _super);
function InvariantError(message) {
if (message === void 0) { message = genericMessage; }
var _this = _super.call(this, typeof message === "number"
? genericMessage + ": " + message + " (see https://github.com/apollographql/invariant-packages)"
: message) || this;
_this.framesToPop = 1;
_this.name = genericMessage;
setPrototypeOf(_this, InvariantError.prototype);
return _this;
}
return InvariantError;
}(Error));
export { InvariantError };
export function invariant(condition, message) {
if (!condition) {
throw new InvariantError(message);
}
}
var verbosityLevels = ["debug", "log", "warn", "error", "silent"];
var verbosityLevel = verbosityLevels.indexOf("log");
function wrapConsoleMethod(name) {
return function () {
if (verbosityLevels.indexOf(name) >= verbosityLevel) {
// Default to console.log if this host environment happens not to provide
// all the console.* methods we need.
var method = console[name] || console.log;
return method.apply(console, arguments);
}
};
}
(function (invariant) {
invariant.debug = wrapConsoleMethod("debug");
invariant.log = wrapConsoleMethod("log");
invariant.warn = wrapConsoleMethod("warn");
invariant.error = wrapConsoleMethod("error");
})(invariant || (invariant = {}));
export function setVerbosity(level) {
var old = verbosityLevels[verbosityLevel];
verbosityLevel = Math.max(0, verbosityLevels.indexOf(level));
return old;
}
export default invariant;
//# sourceMappingURL=invariant.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/version.js
export var version = "3.9.4"; //# sourceMappingURL=version.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/globals/maybe.js
export function maybe(thunk) {
try {
return thunk();
}
catch (_a) { }
}
//# sourceMappingURL=maybe.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/globals/global.js
import { maybe } from "./maybe.js";
export default (maybe(function () { return globalThis; }) ||
maybe(function () { return window; }) ||
maybe(function () { return self; }) ||
maybe(function () { return global; }) || // We don't expect the Function constructor ever to be invoked at runtime, as
// long as at least one of globalThis, window, self, or global is defined, so
// we are under no obligation to make it easy for static analysis tools to
// detect syntactic usage of the Function constructor. If you think you can
// improve your static analysis to detect this obfuscation, think again. This
// is an arms race you cannot win, at least not in JavaScript.
maybe(function () {
return maybe.constructor("return this")();
}));
//# sourceMappingURL=global.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/makeUniqueId.js
var prefixCounts = new Map();
// These IDs won't be globally unique, but they will be unique within this
// process, thanks to the counter, and unguessable thanks to the random suffix.
export function makeUniqueId(prefix) {
var count = prefixCounts.get(prefix) || 1;
prefixCounts.set(prefix, count + 1);
return "".concat(prefix, ":").concat(count, ":").concat(Math.random().toString(36).slice(2));
}
//# sourceMappingURL=makeUniqueId.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/stringifyForDisplay.js
import { makeUniqueId } from "./makeUniqueId.js";
export function stringifyForDisplay(value, space) {
if (space === void 0) { space = 0; }
var undefId = makeUniqueId("stringifyForDisplay");
return JSON.stringify(value, function (key, value) {
return value === void 0 ? undefId : value;
}, space)
.split(JSON.stringify(undefId))
.join("<undefined>");
}
//# sourceMappingURL=stringifyForDisplay.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/globals/invariantWrappers.js
import { invariant as originalInvariant, InvariantError } from "ts-invariant";
import { version } from "../../version.js";
import global from "./global.js";
import { stringifyForDisplay } from "../common/stringifyForDisplay.js";
function wrap(fn) {
return function (message) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
if (typeof message === "number") {
var arg0 = message;
message = getHandledErrorMsg(arg0);
if (!message) {
message = getFallbackErrorMsg(arg0, args);
args = [];
}
}
fn.apply(void 0, [message].concat(args));
};
}
var invariant = Object.assign(function invariant(condition, message) {
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
if (!condition) {
originalInvariant(condition, getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args));
}
}, {
debug: wrap(originalInvariant.debug),
log: wrap(originalInvariant.log),
warn: wrap(originalInvariant.warn),
error: wrap(originalInvariant.error),
});
/**
* Returns an InvariantError.
*
* `message` can only be a string, a concatenation of strings, or a ternary statement
* that results in a string. This will be enforced on build, where the message will
* be replaced with a message number.
* String substitutions with %s are supported and will also return
* pretty-stringified objects.
* Excess `optionalParams` will be swallowed.
*/
function newInvariantError(message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
return new InvariantError(getHandledErrorMsg(message, optionalParams) ||
getFallbackErrorMsg(message, optionalParams));
}
var ApolloErrorMessageHandler = Symbol.for("ApolloErrorMessageHandler_" + version);
function stringify(arg) {
return typeof arg == "string" ? arg : (stringifyForDisplay(arg, 2).slice(0, 1000));
}
function getHandledErrorMsg(message, messageArgs) {
if (messageArgs === void 0) { messageArgs = []; }
if (!message)
return;
return (global[ApolloErrorMessageHandler] &&
global[ApolloErrorMessageHandler](message, messageArgs.map(stringify)));
}
function getFallbackErrorMsg(message, messageArgs) {
if (messageArgs === void 0) { messageArgs = []; }
if (!message)
return;
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
version: version,
message: message,
args: messageArgs.map(stringify),
})));
}
export { invariant, InvariantError, newInvariantError, ApolloErrorMessageHandler, };
//# sourceMappingURL=invariantWrappers.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/globals/index.js
import { invariant, newInvariantError, InvariantError, } from "./invariantWrappers.js";
export { maybe } from "./maybe.js";
export { default as global } from "./global.js";
export { invariant, newInvariantError, InvariantError };
/**
* @deprecated we do not use this internally anymore,
* it is just exported for backwards compatibility
*/
// this file is extempt from automatic `__DEV__` replacement
// so we have to write it out here
// @ts-ignore
export var DEV = globalThis.__DEV__ !== false;
export { DEV as __DEV__ };
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/canUse.js
import { maybe } from "../globals/index.js";
export var canUseWeakMap = typeof WeakMap === "function" &&
!maybe(function () { return navigator.product == "ReactNative" && !global.HermesInternal; });
export var canUseWeakSet = typeof WeakSet === "function";
export var canUseSymbol = typeof Symbol === "function" && typeof Symbol.for === "function";
export var canUseAsyncIteratorSymbol = canUseSymbol && Symbol.asyncIterator;
export var canUseDOM = typeof maybe(function () { return window.document.createElement; }) === "function";
var usingJSDOM =
// Following advice found in this comment from @domenic (maintainer of jsdom):
// https://github.com/jsdom/jsdom/issues/1537#issuecomment-229405327
//
// Since we control the version of Jest and jsdom used when running Apollo
// Client tests, and that version is recent enought to include " jsdom/x.y.z"
// at the end of the user agent string, I believe this case is all we need to
// check. Testing for "Node.js" was recommended for backwards compatibility
// with older version of jsdom, but we don't have that problem.
maybe(function () { return navigator.userAgent.indexOf("jsdom") >= 0; }) || false;
// Our tests should all continue to pass if we remove this !usingJSDOM
// condition, thereby allowing useLayoutEffect when using jsdom. Unfortunately,
// if we allow useLayoutEffect, then useSyncExternalStore generates many
// warnings about useLayoutEffect doing nothing on the server. While these
// warnings are harmless, this !usingJSDOM condition seems to be the best way to
// prevent them (i.e. skipping useLayoutEffect when using jsdom).
export var canUseLayoutEffect = canUseDOM && !usingJSDOM;
//# sourceMappingURL=canUse.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/context/ApolloContext.js
import * as React from "rehackt";
import { canUseSymbol } from "../../utilities/index.js";
import { invariant } from "../../utilities/globals/index.js";
// To make sure Apollo Client doesn't create more than one React context
// (which can lead to problems like having an Apollo Client instance added
// in one context, then attempting to retrieve it from another different
// context), a single Apollo context is created and tracked in global state.
var contextKey = canUseSymbol ? Symbol.for("__APOLLO_CONTEXT__") : "__APOLLO_CONTEXT__";
export function getApolloContext() {
invariant("createContext" in React, 45);
var context = React.createContext[contextKey];
if (!context) {
Object.defineProperty(React.createContext, contextKey, {
value: (context = React.createContext({})),
enumerable: false,
writable: false,
configurable: true,
});
context.displayName = "ApolloContext";
}
return context;
}
/**
* @deprecated This function has no "resetting" effect since Apollo Client 3.4.12,
* and will be removed in the next major version of Apollo Client.
* If you want to get the Apollo Context, use `getApolloContext` instead.
*/
export var resetApolloContext = getApolloContext;
//# sourceMappingURL=ApolloContext.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/context/ApolloProvider.js
import { __assign } from "tslib";
import { invariant } from "../../utilities/globals/index.js";
import * as React from "rehackt";
import { getApolloContext } from "./ApolloContext.js";
export var ApolloProvider = function (_a) {
var client = _a.client, children = _a.children;
var ApolloContext = getApolloContext();
var parentContext = React.useContext(ApolloContext);
var context = React.useMemo(function () {
return __assign(__assign({}, parentContext), { client: client || parentContext.client });
}, [parentContext, client]);
invariant(context.client, 46);
return (React.createElement(ApolloContext.Provider, { value: context }, children));
};
//# sourceMappingURL=ApolloProvider.js.map
webpack://frontend-tpt/../../node_modules/react-redux/es/components/Context.js
import React from 'react';
export var ReactReduxContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== 'production') {
ReactReduxContext.displayName = 'ReactRedux';
}
export default ReactReduxContext;
webpack://frontend-tpt/../../node_modules/react-redux/es/utils/batch.js
// Default to a dummy "batch" implementation that just runs the callback
function defaultNoopBatch(callback) {
callback();
}
var batch = defaultNoopBatch; // Allow injecting another batching function later
export var setBatch = function setBatch(newBatch) {
return batch = newBatch;
}; // Supply a getter just to skip dealing with ESM bindings
export var getBatch = function getBatch() {
return batch;
};
webpack://frontend-tpt/../../node_modules/react-redux/es/utils/Subscription.js
import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as
// well as nesting subscriptions of descendant components, so that we can ensure the
// ancestor components re-render before descendants
var nullListeners = {
notify: function notify() {}
};
function createListenerCollection() {
var batch = getBatch();
var first = null;
var last = null;
return {
clear: function clear() {
first = null;
last = null;
},
notify: function notify() {
batch(function () {
var listener = first;
while (listener) {
listener.callback();
listener = listener.next;
}
});
},
get: function get() {
var listeners = [];
var listener = first;
while (listener) {
listeners.push(listener);
listener = listener.next;
}
return listeners;
},
subscribe: function subscribe(callback) {
var isSubscribed = true;
var listener = last = {
callback: callback,
next: null,
prev: last
};
if (listener.prev) {
listener.prev.next = listener;
} else {
first = listener;
}
return function unsubscribe() {
if (!isSubscribed || first === null) return;
isSubscribed = false;
if (listener.next) {
listener.next.prev = listener.prev;
} else {
last = listener.prev;
}
if (listener.prev) {
listener.prev.next = listener.next;
} else {
first = listener.next;
}
};
}
};
}
var Subscription = /*#__PURE__*/function () {
function Subscription(store, parentSub) {
this.store = store;
this.parentSub = parentSub;
this.unsubscribe = null;
this.listeners = nullListeners;
this.handleChangeWrapper = this.handleChangeWrapper.bind(this);
}
var _proto = Subscription.prototype;
_proto.addNestedSub = function addNestedSub(listener) {
this.trySubscribe();
return this.listeners.subscribe(listener);
};
_proto.notifyNestedSubs = function notifyNestedSubs() {
this.listeners.notify();
};
_proto.handleChangeWrapper = function handleChangeWrapper() {
if (this.onStateChange) {
this.onStateChange();
}
};
_proto.isSubscribed = function isSubscribed() {
return Boolean(this.unsubscribe);
};
_proto.trySubscribe = function trySubscribe() {
if (!this.unsubscribe) {
this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.handleChangeWrapper) : this.store.subscribe(this.handleChangeWrapper);
this.listeners = createListenerCollection();
}
};
_proto.tryUnsubscribe = function tryUnsubscribe() {
if (this.unsubscribe) {
this.unsubscribe();
this.unsubscribe = null;
this.listeners.clear();
this.listeners = nullListeners;
}
};
return Subscription;
}();
export { Subscription as default };
webpack://frontend-tpt/../../node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js
import { useEffect, useLayoutEffect } from 'react'; // React currently throws a warning when using useLayoutEffect on the server.
// To get around it, we can conditionally useEffect on the server (no-op) and
// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store
// subscription callback always has the selector from the latest render commit
// available, otherwise a store update may happen between render and the effect,
// which may cause missed updates; we also must ensure the store subscription
// is created synchronously, otherwise a store update may occur before the
// subscription is created and an inconsistent state may be observed
export var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;
webpack://frontend-tpt/../../node_modules/react-redux/es/components/Provider.js
import React, { useMemo } from 'react';
import PropTypes from 'prop-types';
import { ReactReduxContext } from './Context';
import Subscription from '../utils/Subscription';
import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';
function Provider(_ref) {
var store = _ref.store,
context = _ref.context,
children = _ref.children;
var contextValue = useMemo(function () {
var subscription = new Subscription(store);
subscription.onStateChange = subscription.notifyNestedSubs;
return {
store: store,
subscription: subscription
};
}, [store]);
var previousState = useMemo(function () {
return store.getState();
}, [store]);
useIsomorphicLayoutEffect(function () {
var subscription = contextValue.subscription;
subscription.trySubscribe();
if (previousState !== store.getState()) {
subscription.notifyNestedSubs();
}
return function () {
subscription.tryUnsubscribe();
subscription.onStateChange = null;
};
}, [contextValue, previousState]);
var Context = context || ReactReduxContext;
return /*#__PURE__*/React.createElement(Context.Provider, {
value: contextValue
}, children);
}
if (process.env.NODE_ENV !== 'production') {
Provider.propTypes = {
store: PropTypes.shape({
subscribe: PropTypes.func.isRequired,
dispatch: PropTypes.func.isRequired,
getState: PropTypes.func.isRequired
}),
context: PropTypes.object,
children: PropTypes.any
};
}
export default Provider;
webpack://frontend-tpt/../../node_modules/react-redux/node_modules/@babel/runtime/helpers/esm/extends.js
export default function _extends() {
_extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
webpack://frontend-tpt/../../node_modules/react-redux/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
export default function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
webpack://frontend-tpt/../../node_modules/react-redux/es/components/connectAdvanced.js
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import hoistStatics from 'hoist-non-react-statics';
import React, { useContext, useMemo, useRef, useReducer } from 'react';
import { isValidElementType, isContextConsumer } from 'react-is';
import Subscription from '../utils/Subscription';
import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';
import { ReactReduxContext } from './Context'; // Define some constant arrays just to avoid re-creating these
var EMPTY_ARRAY = [];
var NO_SUBSCRIPTION_ARRAY = [null, null];
var stringifyComponent = function stringifyComponent(Comp) {
try {
return JSON.stringify(Comp);
} catch (err) {
return String(Comp);
}
};
function storeStateUpdatesReducer(state, action) {
var updateCount = state[1];
return [action.payload, updateCount + 1];
}
function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {
useIsomorphicLayoutEffect(function () {
return effectFunc.apply(void 0, effectArgs);
}, dependencies);
}
function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs) {
// We want to capture the wrapper props and child props we used for later comparisons
lastWrapperProps.current = wrapperProps;
lastChildProps.current = actualChildProps;
renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update
if (childPropsFromStoreUpdate.current) {
childPropsFromStoreUpdate.current = null;
notifyNestedSubs();
}
}
function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch) {
// If we're not subscribed to the store, nothing to do here
if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts
var didUnsubscribe = false;
var lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component
var checkForUpdates = function checkForUpdates() {
if (didUnsubscribe) {
// Don't run stale listeners.
// Redux doesn't guarantee unsubscriptions happen until next dispatch.
return;
}
var latestStoreState = store.getState();
var newChildProps, error;
try {
// Actually run the selector with the most recent store state and wrapper props
// to determine what the child props should be
newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);
} catch (e) {
error = e;
lastThrownError = e;
}
if (!error) {
lastThrownError = null;
} // If the child props haven't changed, nothing to do here - cascade the subscription update
if (newChildProps === lastChildProps.current) {
if (!renderIsScheduled.current) {
notifyNestedSubs();
}
} else {
// Save references to the new child props. Note that we track the "child props from store update"
// as a ref instead of a useState/useReducer because we need a way to determine if that value has
// been processed. If this went into useState/useReducer, we couldn't clear out the value without
// forcing another re-render, which we don't want.
lastChildProps.current = newChildProps;
childPropsFromStoreUpdate.current = newChildProps;
renderIsScheduled.current = true; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render
forceComponentUpdateDispatch({
type: 'STORE_UPDATED',
payload: {
error: error
}
});
}
}; // Actually subscribe to the nearest connected ancestor (or store)
subscription.onStateChange = checkForUpdates;
subscription.trySubscribe(); // Pull data from the store after first render in case the store has
// changed since we began.
checkForUpdates();
var unsubscribeWrapper = function unsubscribeWrapper() {
didUnsubscribe = true;
subscription.tryUnsubscribe();
subscription.onStateChange = null;
if (lastThrownError) {
// It's possible that we caught an error due to a bad mapState function, but the
// parent re-rendered without this component and we're about to unmount.
// This shouldn't happen as long as we do top-down subscriptions correctly, but
// if we ever do those wrong, this throw will surface the error in our tests.
// In that case, throw the error from here so it doesn't get lost.
throw lastThrownError;
}
};
return unsubscribeWrapper;
}
var initStateUpdates = function initStateUpdates() {
return [null, 0];
};
export default function connectAdvanced(
/*
selectorFactory is a func that is responsible for returning the selector function used to
compute new props from state, props, and dispatch. For example:
export default connectAdvanced((dispatch, options) => (state, props) => ({
thing: state.things[props.thingId],
saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
}))(YourComponent)
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
outside of their selector as an optimization. Options passed to connectAdvanced are passed to
the selectorFactory, along with displayName and WrappedComponent, as the second argument.
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
props. Do not use connectAdvanced directly without memoizing results between calls to your
selector, otherwise the Connect component will re-render on every state or props change.
*/
selectorFactory, // options object:
_ref) {
if (_ref === void 0) {
_ref = {};
}
var _ref2 = _ref,
_ref2$getDisplayName = _ref2.getDisplayName,
getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {
return "ConnectAdvanced(" + name + ")";
} : _ref2$getDisplayName,
_ref2$methodName = _ref2.methodName,
methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,
_ref2$renderCountProp = _ref2.renderCountProp,
renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,
_ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,
shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,
_ref2$storeKey = _ref2.storeKey,
storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,
_ref2$withRef = _ref2.withRef,
withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,
_ref2$forwardRef = _ref2.forwardRef,
forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,
_ref2$context = _ref2.context,
context = _ref2$context === void 0 ? ReactReduxContext : _ref2$context,
connectOptions = _objectWithoutPropertiesLoose(_ref2, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef", "forwardRef", "context"]);
if (process.env.NODE_ENV !== 'production') {
if (renderCountProp !== undefined) {
throw new Error("renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension");
}
if (withRef) {
throw new Error('withRef is removed. To access the wrapped instance, use a ref on the connected component');
}
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: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. ' + 'You may also pass a {context : MyContext} option to connect';
if (storeKey !== 'store') {
throw new Error('storeKey has been removed and does not do anything. ' + customStoreWarningMessage);
}
}
var Context = context;
return function wrapWithConnect(WrappedComponent) {
if (process.env.NODE_ENV !== 'production' && !isValidElementType(WrappedComponent)) {
throw new Error("You must pass a component to the function returned by " + (methodName + ". Instead received " + stringifyComponent(WrappedComponent)));
}
var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
var displayName = getDisplayName(wrappedComponentName);
var selectorFactoryOptions = _extends({}, connectOptions, {
getDisplayName: getDisplayName,
methodName: methodName,
renderCountProp: renderCountProp,
shouldHandleStateChanges: shouldHandleStateChanges,
storeKey: storeKey,
displayName: displayName,
wrappedComponentName: wrappedComponentName,
WrappedComponent: WrappedComponent
});
var pure = connectOptions.pure;
function createChildSelector(store) {
return selectorFactory(store.dispatch, selectorFactoryOptions);
} // If we aren't running in "pure" mode, we don't want to memoize values.
// To avoid conditionally calling hooks, we fall back to a tiny wrapper
// that just executes the given callback immediately.
var usePureOnlyMemo = pure ? useMemo : function (callback) {
return callback();
};
function ConnectFunction(props) {
var _useMemo = useMemo(function () {
// Distinguish between actual "data" props that were passed to the wrapper component,
// and values needed to control behavior (forwarded refs, alternate context instances).
// To maintain the wrapperProps object reference, memoize this destructuring.
var reactReduxForwardedRef = props.reactReduxForwardedRef,
wrapperProps = _objectWithoutPropertiesLoose(props, ["reactReduxForwardedRef"]);
return [props.context, reactReduxForwardedRef, wrapperProps];
}, [props]),
propsContext = _useMemo[0],
reactReduxForwardedRef = _useMemo[1],
wrapperProps = _useMemo[2];
var ContextToUse = useMemo(function () {
// Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.
// Memoize the check that determines which context instance we should use.
return propsContext && propsContext.Consumer && isContextConsumer( /*#__PURE__*/React.createElement(propsContext.Consumer, null)) ? propsContext : Context;
}, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available
var contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context.
// We'll check to see if it _looks_ like a Redux store first.
// This allows us to pass through a `store` prop that is just a plain value.
var didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);
var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);
if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {
throw new Error("Could not find \"store\" in the context of " + ("\"" + displayName + "\". Either wrap the root component in a <Provider>, ") + "or pass a custom React context provider to <Provider> and the corresponding " + ("React context consumer to " + displayName + " in connect options."));
} // Based on the previous check, one of these must be true
var store = didStoreComeFromProps ? props.store : contextValue.store;
var childPropsSelector = useMemo(function () {
// The child props selector needs the store reference as an input.
// Re-create this selector whenever the store changes.
return createChildSelector(store);
}, [store]);
var _useMemo2 = useMemo(function () {
if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component
// connected to the store via props shouldn't use subscription from context, or vice versa.
var subscription = new Subscription(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
// the middle of the notification loop, where `subscription` will then be null. This can
// probably be avoided if Subscription's listeners logic is changed to not call listeners
// that have been unsubscribed in the middle of the notification loop.
var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);
return [subscription, notifyNestedSubs];
}, [store, didStoreComeFromProps, contextValue]),
subscription = _useMemo2[0],
notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary,
// and memoize that value to avoid unnecessary context updates.
var overriddenContextValue = useMemo(function () {
if (didStoreComeFromProps) {
// This component is directly subscribed to a store from props.
// We don't want descendants reading from this store - pass down whatever
// the existing context value is from the nearest connected ancestor.
return contextValue;
} // Otherwise, put this component's subscription instance into context, so that
// connected descendants won't update until after this component is done
return _extends({}, contextValue, {
subscription: subscription
});
}, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update
// causes a change to the calculated child component props (or we caught an error in mapState)
var _useReducer = useReducer(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates),
_useReducer$ = _useReducer[0],
previousStateUpdateResult = _useReducer$[0],
forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards
if (previousStateUpdateResult && previousStateUpdateResult.error) {
throw previousStateUpdateResult.error;
} // Set up refs to coordinate values between the subscription effect and the render logic
var lastChildProps = useRef();
var lastWrapperProps = useRef(wrapperProps);
var childPropsFromStoreUpdate = useRef();
var renderIsScheduled = useRef(false);
var actualChildProps = usePureOnlyMemo(function () {
// Tricky logic here:
// - This render may have been triggered by a Redux store update that produced new child props
// - However, we may have gotten new wrapper props after that
// If we have new child props, and the same wrapper props, we know we should use the new child props as-is.
// But, if we have new wrapper props, those might change the child props, so we have to recalculate things.
// So, we'll use the child props from store update only if the wrapper props are the same as last time.
if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {
return childPropsFromStoreUpdate.current;
} // TODO We're reading the store directly in render() here. Bad idea?
// This will likely cause Bad Things (TM) to happen in Concurrent Mode.
// Note that we do this because on renders _not_ caused by store updates, we need the latest store state
// to determine what the child props should be.
return childPropsSelector(store.getState(), wrapperProps);
}, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns
// about useLayoutEffect in SSR, so we try to detect environment and fall back to
// just useEffect instead to avoid the warning, since neither will run anyway.
useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs]); // Our re-subscribe logic only runs when the store/subscription setup changes
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.
// We memoize the elements for the rendered child component as an optimization.
var renderedWrappedComponent = useMemo(function () {
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, actualChildProps, {
ref: reactReduxForwardedRef
}));
}, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering
// that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.
var renderedChild = useMemo(function () {
if (shouldHandleStateChanges) {
// If this component is subscribed to store updates, we need to pass its own
// subscription instance down to our descendants. That means rendering the same
// Context instance, and putting a different value into the context.
return /*#__PURE__*/React.createElement(ContextToUse.Provider, {
value: overriddenContextValue
}, renderedWrappedComponent);
}
return renderedWrappedComponent;
}, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);
return renderedChild;
} // If we're in "pure" mode, ensure our wrapper component only re-renders when incoming props have changed.
var Connect = pure ? React.memo(ConnectFunction) : ConnectFunction;
Connect.WrappedComponent = WrappedComponent;
Connect.displayName = ConnectFunction.displayName = displayName;
if (forwardRef) {
var forwarded = React.forwardRef(function forwardConnectRef(props, ref) {
return /*#__PURE__*/React.createElement(Connect, _extends({}, props, {
reactReduxForwardedRef: ref
}));
});
forwarded.displayName = displayName;
forwarded.WrappedComponent = WrappedComponent;
return hoistStatics(forwarded, WrappedComponent);
}
return hoistStatics(Connect, WrappedComponent);
};
}
webpack://frontend-tpt/../../node_modules/react-redux/es/utils/shallowEqual.js
function is(x, y) {
if (x === y) {
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
return x !== x && y !== y;
}
}
export default function shallowEqual(objA, objB) {
if (is(objA, objB)) return true;
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) return false;
for (var i = 0; i < keysA.length; i++) {
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
webpack://frontend-tpt/../../node_modules/react-redux/es/connect/wrapMapToProps.js
import verifyPlainObject from '../utils/verifyPlainObject';
export function wrapMapToPropsConstant(getConstant) {
return function initConstantSelector(dispatch, options) {
var constant = getConstant(dispatch, options);
function constantSelector() {
return constant;
}
constantSelector.dependsOnOwnProps = false;
return constantSelector;
};
} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
// whether mapToProps needs to be invoked when props have changed.
//
// A length of one signals that mapToProps does not depend on props from the parent component.
// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
// therefore not reporting its length accurately..
export function getDependsOnOwnProps(mapToProps) {
return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
// this function wraps mapToProps in a proxy function which does several things:
//
// * Detects whether the mapToProps function being called depends on props, which
// is used by selectorFactory to decide if it should reinvoke on props changes.
//
// * On first call, handles mapToProps if returns another function, and treats that
// new function as the true mapToProps for subsequent calls.
//
// * On first call, verifies the first result is a plain object, in order to warn
// the developer that their mapToProps function is not returning a valid result.
//
export function wrapMapToPropsFunc(mapToProps, methodName) {
return function initProxySelector(dispatch, _ref) {
var displayName = _ref.displayName;
var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
}; // allow detectFactoryAndVerify to get ownProps
proxy.dependsOnOwnProps = true;
proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
proxy.mapToProps = mapToProps;
proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
var props = proxy(stateOrDispatch, ownProps);
if (typeof props === 'function') {
proxy.mapToProps = props;
proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
props = proxy(stateOrDispatch, ownProps);
}
if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);
return props;
};
return proxy;
};
}
webpack://frontend-tpt/../../node_modules/react-redux/es/connect/mapDispatchToProps.js
import bindActionCreators from '../utils/bindActionCreators';
import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';
export function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;
}
export function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {
return {
dispatch: dispatch
};
}) : undefined;
}
export function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {
return bindActionCreators(mapDispatchToProps, dispatch);
}) : undefined;
}
export default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];
webpack://frontend-tpt/../../node_modules/react-redux/es/utils/bindActionCreators.js
export default function bindActionCreators(actionCreators, dispatch) {
var boundActionCreators = {};
var _loop = function _loop(key) {
var actionCreator = actionCreators[key];
if (typeof actionCreator === 'function') {
boundActionCreators[key] = function () {
return dispatch(actionCreator.apply(void 0, arguments));
};
}
};
for (var key in actionCreators) {
_loop(key);
}
return boundActionCreators;
}
webpack://frontend-tpt/../../node_modules/react-redux/es/connect/mapStateToProps.js
import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';
export function whenMapStateToPropsIsFunction(mapStateToProps) {
return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;
}
export function whenMapStateToPropsIsMissing(mapStateToProps) {
return !mapStateToProps ? wrapMapToPropsConstant(function () {
return {};
}) : undefined;
}
export default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];
webpack://frontend-tpt/../../node_modules/react-redux/es/connect/mergeProps.js
import _extends from "@babel/runtime/helpers/esm/extends";
import verifyPlainObject from '../utils/verifyPlainObject';
export function defaultMergeProps(stateProps, dispatchProps, ownProps) {
return _extends({}, ownProps, stateProps, dispatchProps);
}
export function wrapMergePropsFunc(mergeProps) {
return function initMergePropsProxy(dispatch, _ref) {
var displayName = _ref.displayName,
pure = _ref.pure,
areMergedPropsEqual = _ref.areMergedPropsEqual;
var hasRunOnce = false;
var mergedProps;
return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
if (hasRunOnce) {
if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
} else {
hasRunOnce = true;
mergedProps = nextMergedProps;
if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');
}
return mergedProps;
};
};
}
export function whenMergePropsIsFunction(mergeProps) {
return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
}
export function whenMergePropsIsOmitted(mergeProps) {
return !mergeProps ? function () {
return defaultMergeProps;
} : undefined;
}
export default [whenMergePropsIsFunction, whenMergePropsIsOmitted];
webpack://frontend-tpt/../../node_modules/react-redux/es/connect/selectorFactory.js
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import verifySubselectors from './verifySubselectors';
export function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
return function impureFinalPropsSelector(state, ownProps) {
return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
};
}
export function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
var areStatesEqual = _ref.areStatesEqual,
areOwnPropsEqual = _ref.areOwnPropsEqual,
areStatePropsEqual = _ref.areStatePropsEqual;
var hasRunAtLeastOnce = false;
var state;
var ownProps;
var stateProps;
var dispatchProps;
var mergedProps;
function handleFirstCall(firstState, firstOwnProps) {
state = firstState;
ownProps = firstOwnProps;
stateProps = mapStateToProps(state, ownProps);
dispatchProps = mapDispatchToProps(dispatch, ownProps);
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
hasRunAtLeastOnce = true;
return mergedProps;
}
function handleNewPropsAndNewState() {
stateProps = mapStateToProps(state, ownProps);
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleNewProps() {
if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleNewState() {
var nextStateProps = mapStateToProps(state, ownProps);
var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
stateProps = nextStateProps;
if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleSubsequentCalls(nextState, nextOwnProps) {
var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
var stateChanged = !areStatesEqual(nextState, state);
state = nextState;
ownProps = nextOwnProps;
if (propsChanged && stateChanged) return handleNewPropsAndNewState();
if (propsChanged) return handleNewProps();
if (stateChanged) return handleNewState();
return mergedProps;
}
return function pureFinalPropsSelector(nextState, nextOwnProps) {
return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
};
} // TODO: Add more comments
// If pure is true, the selector returned by selectorFactory will memoize its results,
// allowing connectAdvanced's shouldComponentUpdate to return false if final
// props have not changed. If false, the selector will always return a new
// object and shouldComponentUpdate will always return true.
export default function finalPropsSelectorFactory(dispatch, _ref2) {
var initMapStateToProps = _ref2.initMapStateToProps,
initMapDispatchToProps = _ref2.initMapDispatchToProps,
initMergeProps = _ref2.initMergeProps,
options = _objectWithoutPropertiesLoose(_ref2, ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"]);
var mapStateToProps = initMapStateToProps(dispatch, options);
var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
var mergeProps = initMergeProps(dispatch, options);
if (process.env.NODE_ENV !== 'production') {
verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
}
var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
}
webpack://frontend-tpt/../../node_modules/react-redux/es/connect/connect.js
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import connectAdvanced from '../components/connectAdvanced';
import shallowEqual from '../utils/shallowEqual';
import defaultMapDispatchToPropsFactories from './mapDispatchToProps';
import defaultMapStateToPropsFactories from './mapStateToProps';
import defaultMergePropsFactories from './mergeProps';
import defaultSelectorFactory from './selectorFactory';
/*
connect is a facade over connectAdvanced. It turns its args into a compatible
selectorFactory, which has the signature:
(dispatch, options) => (nextState, nextOwnProps) => nextFinalProps
connect passes its args to connectAdvanced as options, which will in turn pass them to
selectorFactory each time a Connect component instance is instantiated or hot reloaded.
selectorFactory returns a final props selector from its mapStateToProps,
mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,
mergePropsFactories, and pure args.
The resulting final props selector is called by the Connect component instance whenever
it receives new props or store state.
*/
function match(arg, factories, name) {
for (var i = factories.length - 1; i >= 0; i--) {
var result = factories[i](arg);
if (result) return result;
}
return function (dispatch, options) {
throw new Error("Invalid value of type " + typeof arg + " for " + name + " argument when connecting component " + options.wrappedComponentName + ".");
};
}
function strictEqual(a, b) {
return a === b;
} // createConnect with default args builds the 'official' connect behavior. Calling it with
// different options opens up some testing and extensibility scenarios
export function createConnect(_temp) {
var _ref = _temp === void 0 ? {} : _temp,
_ref$connectHOC = _ref.connectHOC,
connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,
_ref$mergePropsFactor = _ref.mergePropsFactories,
mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,
_ref$selectorFactory = _ref.selectorFactory,
selectorFactory = _ref$selectorFactory === void 0 ? defaultSelectorFactory : _ref$selectorFactory;
return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {
if (_ref2 === void 0) {
_ref2 = {};
}
var _ref3 = _ref2,
_ref3$pure = _ref3.pure,
pure = _ref3$pure === void 0 ? true : _ref3$pure,
_ref3$areStatesEqual = _ref3.areStatesEqual,
areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,
_ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,
areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,
_ref3$areStatePropsEq = _ref3.areStatePropsEqual,
areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,
_ref3$areMergedPropsE = _ref3.areMergedPropsEqual,
areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,
extraOptions = _objectWithoutPropertiesLoose(_ref3, ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"]);
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');
return connectHOC(selectorFactory, _extends({
// used in error messages
methodName: 'connect',
// used to compute Connect's displayName from the wrapped component's displayName.
getDisplayName: function getDisplayName(name) {
return "Connect(" + name + ")";
},
// if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes
shouldHandleStateChanges: Boolean(mapStateToProps),
// passed through to selectorFactory
initMapStateToProps: initMapStateToProps,
initMapDispatchToProps: initMapDispatchToProps,
initMergeProps: initMergeProps,
pure: pure,
areStatesEqual: areStatesEqual,
areOwnPropsEqual: areOwnPropsEqual,
areStatePropsEqual: areStatePropsEqual,
areMergedPropsEqual: areMergedPropsEqual
}, extraOptions));
};
}
export default /*#__PURE__*/createConnect();
webpack://frontend-tpt/../../node_modules/react-redux/es/hooks/useReduxContext.js
import { useContext } from 'react';
import { ReactReduxContext } from '../components/Context';
/**
* A hook to access the value of the `ReactReduxContext`. This is a low-level
* hook that you should usually not need to call directly.
*
* @returns {any} the value of the `ReactReduxContext`
*
* @example
*
* import React from 'react'
* import { useReduxContext } from 'react-redux'
*
* export const CounterComponent = ({ value }) => {
* const { store } = useReduxContext()
* return <div>{store.getState()}</div>
* }
*/
export function useReduxContext() {
var contextValue = useContext(ReactReduxContext);
if (process.env.NODE_ENV !== 'production' && !contextValue) {
throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>');
}
return contextValue;
}
webpack://frontend-tpt/../../node_modules/react-redux/es/hooks/useStore.js
import { useContext } from 'react';
import { ReactReduxContext } from '../components/Context';
import { useReduxContext as useDefaultReduxContext } from './useReduxContext';
/**
* Hook factory, which creates a `useStore` hook bound to a given context.
*
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
* @returns {Function} A `useStore` hook bound to the specified context.
*/
export function createStoreHook(context) {
if (context === void 0) {
context = ReactReduxContext;
}
var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {
return useContext(context);
};
return function useStore() {
var _useReduxContext = useReduxContext(),
store = _useReduxContext.store;
return store;
};
}
/**
* A hook to access the redux store.
*
* @returns {any} the redux store
*
* @example
*
* import React from 'react'
* import { useStore } from 'react-redux'
*
* export const ExampleComponent = () => {
* const store = useStore()
* return <div>{store.getState()}</div>
* }
*/
export var useStore = /*#__PURE__*/createStoreHook();
webpack://frontend-tpt/../../node_modules/react-redux/es/hooks/useDispatch.js
import { ReactReduxContext } from '../components/Context';
import { useStore as useDefaultStore, createStoreHook } from './useStore';
/**
* Hook factory, which creates a `useDispatch` hook bound to a given context.
*
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
* @returns {Function} A `useDispatch` hook bound to the specified context.
*/
export function createDispatchHook(context) {
if (context === void 0) {
context = ReactReduxContext;
}
var useStore = context === ReactReduxContext ? useDefaultStore : createStoreHook(context);
return function useDispatch() {
var store = useStore();
return store.dispatch;
};
}
/**
* A hook to access the redux `dispatch` function.
*
* @returns {any|function} redux store's `dispatch` function
*
* @example
*
* import React, { useCallback } from 'react'
* import { useDispatch } from 'react-redux'
*
* export const CounterComponent = ({ value }) => {
* const dispatch = useDispatch()
* const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
* return (
* <div>
* <span>{value}</span>
* <button onClick={increaseCounter}>Increase counter</button>
* </div>
* )
* }
*/
export var useDispatch = /*#__PURE__*/createDispatchHook();
webpack://frontend-tpt/../../node_modules/react-redux/es/hooks/useSelector.js
import { useReducer, useRef, useMemo, useContext, useDebugValue } from 'react';
import { useReduxContext as useDefaultReduxContext } from './useReduxContext';
import Subscription from '../utils/Subscription';
import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';
import { ReactReduxContext } from '../components/Context';
var refEquality = function refEquality(a, b) {
return a === b;
};
function useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub) {
var _useReducer = useReducer(function (s) {
return s + 1;
}, 0),
forceRender = _useReducer[1];
var subscription = useMemo(function () {
return new Subscription(store, contextSub);
}, [store, contextSub]);
var latestSubscriptionCallbackError = useRef();
var latestSelector = useRef();
var latestStoreState = useRef();
var latestSelectedState = useRef();
var storeState = store.getState();
var selectedState;
try {
if (selector !== latestSelector.current || storeState !== latestStoreState.current || latestSubscriptionCallbackError.current) {
var newSelectedState = selector(storeState); // ensure latest selected state is reused so that a custom equality function can result in identical references
if (latestSelectedState.current === undefined || !equalityFn(newSelectedState, latestSelectedState.current)) {
selectedState = newSelectedState;
} else {
selectedState = latestSelectedState.current;
}
} else {
selectedState = latestSelectedState.current;
}
} catch (err) {
if (latestSubscriptionCallbackError.current) {
err.message += "\nThe error may be correlated with this previous error:\n" + latestSubscriptionCallbackError.current.stack + "\n\n";
}
throw err;
}
useIsomorphicLayoutEffect(function () {
latestSelector.current = selector;
latestStoreState.current = storeState;
latestSelectedState.current = selectedState;
latestSubscriptionCallbackError.current = undefined;
});
useIsomorphicLayoutEffect(function () {
function checkForUpdates() {
try {
var newStoreState = store.getState();
var _newSelectedState = latestSelector.current(newStoreState);
if (equalityFn(_newSelectedState, latestSelectedState.current)) {
return;
}
latestSelectedState.current = _newSelectedState;
latestStoreState.current = newStoreState;
} catch (err) {
// we ignore all errors here, since when the component
// is re-rendered, the selectors are called again, and
// will throw again, if neither props nor store state
// changed
latestSubscriptionCallbackError.current = err;
}
forceRender();
}
subscription.onStateChange = checkForUpdates;
subscription.trySubscribe();
checkForUpdates();
return function () {
return subscription.tryUnsubscribe();
};
}, [store, subscription]);
return selectedState;
}
/**
* Hook factory, which creates a `useSelector` hook bound to a given context.
*
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
* @returns {Function} A `useSelector` hook bound to the specified context.
*/
export function createSelectorHook(context) {
if (context === void 0) {
context = ReactReduxContext;
}
var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {
return useContext(context);
};
return function useSelector(selector, equalityFn) {
if (equalityFn === void 0) {
equalityFn = refEquality;
}
if (process.env.NODE_ENV !== 'production') {
if (!selector) {
throw new Error("You must pass a selector to useSelector");
}
if (typeof selector !== 'function') {
throw new Error("You must pass a function as a selector to useSelector");
}
if (typeof equalityFn !== 'function') {
throw new Error("You must pass a function as an equality function to useSelector");
}
}
var _useReduxContext = useReduxContext(),
store = _useReduxContext.store,
contextSub = _useReduxContext.subscription;
var selectedState = useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);
useDebugValue(selectedState);
return selectedState;
};
}
/**
* A hook to access the redux store's state. This hook takes a selector function
* as an argument. The selector is called with the store state.
*
* This hook takes an optional equality comparison function as the second parameter
* that allows you to customize the way the selected state is compared to determine
* whether the component needs to be re-rendered.
*
* @param {Function} selector the selector function
* @param {Function=} equalityFn the function that will be used to determine equality
*
* @returns {any} the selected state
*
* @example
*
* import React from 'react'
* import { useSelector } from 'react-redux'
*
* export const CounterComponent = () => {
* const counter = useSelector(state => state.counter)
* return <div>{counter}</div>
* }
*/
export var useSelector = /*#__PURE__*/createSelectorHook();
webpack://frontend-tpt/../../node_modules/@remix-run/router/dist/router.js
/**
* @remix-run/router v1.0.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
////////////////////////////////////////////////////////////////////////////////
//#region Types and Constants
////////////////////////////////////////////////////////////////////////////////
/**
* Actions represent the type of change to a location value.
*/
var Action;
(function (Action) {
/**
* A POP indicates a change to an arbitrary index in the history stack, such
* as a back or forward navigation. It does not describe the direction of the
* navigation, only that the current index changed.
*
* Note: This is the default action for newly created history objects.
*/
Action["Pop"] = "POP";
/**
* A PUSH indicates a new entry being added to the history stack, such as when
* a link is clicked and a new page loads. When this happens, all subsequent
* entries in the stack are lost.
*/
Action["Push"] = "PUSH";
/**
* A REPLACE indicates the entry at the current index in the history stack
* being replaced by a new one.
*/
Action["Replace"] = "REPLACE";
})(Action || (Action = {}));
const PopStateEventType = "popstate";
/**
* Memory history stores the current location in memory. It is designed for use
* in stateful non-browser environments like tests and React Native.
*/
function createMemoryHistory(options) {
if (options === void 0) {
options = {};
}
let {
initialEntries = ["/"],
initialIndex,
v5Compat = false
} = options;
let entries; // Declare so we can access from createMemoryLocation
entries = initialEntries.map((entry, index) => createMemoryLocation(entry, typeof entry === "string" ? null : entry.state, index === 0 ? "default" : undefined));
let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex);
let action = Action.Pop;
let listener = null;
function clampIndex(n) {
return Math.min(Math.max(n, 0), entries.length - 1);
}
function getCurrentLocation() {
return entries[index];
}
function createMemoryLocation(to, state, key) {
if (state === void 0) {
state = null;
}
let location = createLocation(entries ? getCurrentLocation().pathname : "/", to, state, key);
warning$1(location.pathname.charAt(0) === "/", "relative pathnames are not supported in memory history: " + JSON.stringify(to));
return location;
}
let history = {
get index() {
return index;
},
get action() {
return action;
},
get location() {
return getCurrentLocation();
},
createHref(to) {
return typeof to === "string" ? to : createPath(to);
},
push(to, state) {
action = Action.Push;
let nextLocation = createMemoryLocation(to, state);
index += 1;
entries.splice(index, entries.length, nextLocation);
if (v5Compat && listener) {
listener({
action,
location: nextLocation
});
}
},
replace(to, state) {
action = Action.Replace;
let nextLocation = createMemoryLocation(to, state);
entries[index] = nextLocation;
if (v5Compat && listener) {
listener({
action,
location: nextLocation
});
}
},
go(delta) {
action = Action.Pop;
index = clampIndex(index + delta);
if (listener) {
listener({
action,
location: getCurrentLocation()
});
}
},
listen(fn) {
listener = fn;
return () => {
listener = null;
};
}
};
return history;
}
/**
* Browser history stores the location in regular URLs. This is the standard for
* most web apps, but it requires some configuration on the server to ensure you
* serve the same app at multiple URLs.
*
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory
*/
function createBrowserHistory(options) {
if (options === void 0) {
options = {};
}
function createBrowserLocation(window, globalHistory) {
let {
pathname,
search,
hash
} = window.location;
return createLocation("", {
pathname,
search,
hash
}, // state defaults to `null` because `window.history.state` does
globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default");
}
function createBrowserHref(window, to) {
return typeof to === "string" ? to : createPath(to);
}
return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);
}
/**
* Hash history stores the location in window.location.hash. This makes it ideal
* for situations where you don't want to send the location to the server for
* some reason, either because you do cannot configure it or the URL space is
* reserved for something else.
*
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory
*/
function createHashHistory(options) {
if (options === void 0) {
options = {};
}
function createHashLocation(window, globalHistory) {
let {
pathname = "/",
search = "",
hash = ""
} = parsePath(window.location.hash.substr(1));
return createLocation("", {
pathname,
search,
hash
}, // state defaults to `null` because `window.history.state` does
globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default");
}
function createHashHref(window, to) {
let base = window.document.querySelector("base");
let href = "";
if (base && base.getAttribute("href")) {
let url = window.location.href;
let hashIndex = url.indexOf("#");
href = hashIndex === -1 ? url : url.slice(0, hashIndex);
}
return href + "#" + (typeof to === "string" ? to : createPath(to));
}
function validateHashLocation(location, to) {
warning$1(location.pathname.charAt(0) === "/", "relative pathnames are not supported in hash history.push(" + JSON.stringify(to) + ")");
}
return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options);
} //#endregion
////////////////////////////////////////////////////////////////////////////////
//#region UTILS
////////////////////////////////////////////////////////////////////////////////
function warning$1(cond, message) {
if (!cond) {
// eslint-disable-next-line no-console
if (typeof console !== "undefined") console.warn(message);
try {
// Welcome to debugging history!
//
// This error is thrown as a convenience so you can more easily
// find the source for a warning that appears in the console by
// enabling "pause on exceptions" in your JavaScript debugger.
throw new Error(message); // eslint-disable-next-line no-empty
} catch (e) {}
}
}
function createKey() {
return Math.random().toString(36).substr(2, 8);
}
/**
* For browser-based histories, we combine the state and key into an object
*/
function getHistoryState(location) {
return {
usr: location.state,
key: location.key
};
}
/**
* Creates a Location object with a unique key from the given Path
*/
function createLocation(current, to, state, key) {
if (state === void 0) {
state = null;
}
let location = _extends({
pathname: typeof current === "string" ? current : current.pathname,
search: "",
hash: ""
}, typeof to === "string" ? parsePath(to) : to, {
state,
// TODO: This could be cleaned up. push/replace should probably just take
// full Locations now and avoid the need to run through this flow at all
// But that's a pretty big refactor to the current test suite so going to
// keep as is for the time being and just let any incoming keys take precedence
key: to && to.key || key || createKey()
});
return location;
}
/**
* Creates a string URL path from the given pathname, search, and hash components.
*/
function createPath(_ref) {
let {
pathname = "/",
search = "",
hash = ""
} = _ref;
if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search;
if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash;
return pathname;
}
/**
* Parses a string URL path into its separate pathname, search, and hash components.
*/
function parsePath(path) {
let parsedPath = {};
if (path) {
let hashIndex = path.indexOf("#");
if (hashIndex >= 0) {
parsedPath.hash = path.substr(hashIndex);
path = path.substr(0, hashIndex);
}
let searchIndex = path.indexOf("?");
if (searchIndex >= 0) {
parsedPath.search = path.substr(searchIndex);
path = path.substr(0, searchIndex);
}
if (path) {
parsedPath.pathname = path;
}
}
return parsedPath;
}
function getUrlBasedHistory(getLocation, createHref, validateLocation, options) {
if (options === void 0) {
options = {};
}
let {
window = document.defaultView,
v5Compat = false
} = options;
let globalHistory = window.history;
let action = Action.Pop;
let listener = null;
function handlePop() {
action = Action.Pop;
if (listener) {
listener({
action,
location: history.location
});
}
}
function push(to, state) {
action = Action.Push;
let location = createLocation(history.location, to, state);
if (validateLocation) validateLocation(location, to);
let historyState = getHistoryState(location);
let url = history.createHref(location); // try...catch because iOS limits us to 100 pushState calls :/
try {
globalHistory.pushState(historyState, "", url);
} catch (error) {
// They are going to lose state here, but there is no real
// way to warn them about it since the page will refresh...
window.location.assign(url);
}
if (v5Compat && listener) {
listener({
action,
location
});
}
}
function replace(to, state) {
action = Action.Replace;
let location = createLocation(history.location, to, state);
if (validateLocation) validateLocation(location, to);
let historyState = getHistoryState(location);
let url = history.createHref(location);
globalHistory.replaceState(historyState, "", url);
if (v5Compat && listener) {
listener({
action,
location: location
});
}
}
let history = {
get action() {
return action;
},
get location() {
return getLocation(window, globalHistory);
},
listen(fn) {
if (listener) {
throw new Error("A history only accepts one active listener");
}
window.addEventListener(PopStateEventType, handlePop);
listener = fn;
return () => {
window.removeEventListener(PopStateEventType, handlePop);
listener = null;
};
},
createHref(to) {
return createHref(window, to);
},
push,
replace,
go(n) {
return globalHistory.go(n);
}
};
return history;
} //#endregion
var ResultType;
(function (ResultType) {
ResultType["data"] = "data";
ResultType["deferred"] = "deferred";
ResultType["redirect"] = "redirect";
ResultType["error"] = "error";
})(ResultType || (ResultType = {}));
function isIndexRoute(route) {
return route.index === true;
} // Walk the route tree generating unique IDs where necessary so we are working
// solely with AgnosticDataRouteObject's within the Router
function convertRoutesToDataRoutes(routes, parentPath, allIds) {
if (parentPath === void 0) {
parentPath = [];
}
if (allIds === void 0) {
allIds = new Set();
}
return routes.map((route, index) => {
let treePath = [...parentPath, index];
let id = typeof route.id === "string" ? route.id : treePath.join("-");
invariant(route.index !== true || !route.children, "Cannot specify children on an index route");
invariant(!allIds.has(id), "Found a route id collision on id \"" + id + "\". Route " + "id's must be globally unique within Data Router usages");
allIds.add(id);
if (isIndexRoute(route)) {
let indexRoute = _extends({}, route, {
id
});
return indexRoute;
} else {
let pathOrLayoutRoute = _extends({}, route, {
id,
children: route.children ? convertRoutesToDataRoutes(route.children, treePath, allIds) : undefined
});
return pathOrLayoutRoute;
}
});
}
/**
* Matches the given routes to a location and returns the match data.
*
* @see https://reactrouter.com/docs/en/v6/utils/match-routes
*/
function matchRoutes(routes, locationArg, basename) {
if (basename === void 0) {
basename = "/";
}
let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
let pathname = stripBasename(location.pathname || "/", basename);
if (pathname == null) {
return null;
}
let branches = flattenRoutes(routes);
rankRouteBranches(branches);
let matches = null;
for (let i = 0; matches == null && i < branches.length; ++i) {
matches = matchRouteBranch(branches[i], pathname);
}
return matches;
}
function flattenRoutes(routes, branches, parentsMeta, parentPath) {
if (branches === void 0) {
branches = [];
}
if (parentsMeta === void 0) {
parentsMeta = [];
}
if (parentPath === void 0) {
parentPath = "";
}
routes.forEach((route, index) => {
let meta = {
relativePath: route.path || "",
caseSensitive: route.caseSensitive === true,
childrenIndex: index,
route
};
if (meta.relativePath.startsWith("/")) {
invariant(meta.relativePath.startsWith(parentPath), "Absolute route path \"" + meta.relativePath + "\" nested under path " + ("\"" + parentPath + "\" is not valid. An absolute child route path ") + "must start with the combined path of all its parent routes.");
meta.relativePath = meta.relativePath.slice(parentPath.length);
}
let path = joinPaths([parentPath, meta.relativePath]);
let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array so we traverse the
// route tree depth-first and child routes appear before their parents in
// the "flattened" version.
if (route.children && route.children.length > 0) {
invariant( // Our types know better, but runtime JS may not!
// @ts-expect-error
route.index !== true, "Index routes must not have child routes. Please remove " + ("all child routes from route path \"" + path + "\"."));
flattenRoutes(route.children, branches, routesMeta, path);
} // Routes without a path shouldn't ever match by themselves unless they are
// index routes, so don't add them to the list of possible branches.
if (route.path == null && !route.index) {
return;
}
branches.push({
path,
score: computeScore(path, route.index),
routesMeta
});
});
return branches;
}
function rankRouteBranches(branches) {
branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first
: compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));
}
const paramRe = /^:\w+$/;
const dynamicSegmentValue = 3;
const indexRouteValue = 2;
const emptySegmentValue = 1;
const staticSegmentValue = 10;
const splatPenalty = -2;
const isSplat = s => s === "*";
function computeScore(path, index) {
let segments = path.split("/");
let initialScore = segments.length;
if (segments.some(isSplat)) {
initialScore += splatPenalty;
}
if (index) {
initialScore += indexRouteValue;
}
return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);
}
function compareIndexes(a, b) {
let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);
return siblings ? // If two routes are siblings, we should try to match the earlier sibling
// first. This allows people to have fine-grained control over the matching
// behavior by simply putting routes with identical paths in the order they
// want them tried.
a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index,
// so they sort equally.
0;
}
function matchRouteBranch(branch, pathname) {
let {
routesMeta
} = branch;
let matchedParams = {};
let matchedPathname = "/";
let matches = [];
for (let i = 0; i < routesMeta.length; ++i) {
let meta = routesMeta[i];
let end = i === routesMeta.length - 1;
let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
let match = matchPath({
path: meta.relativePath,
caseSensitive: meta.caseSensitive,
end
}, remainingPathname);
if (!match) return null;
Object.assign(matchedParams, match.params);
let route = meta.route;
matches.push({
// TODO: Can this as be avoided?
params: matchedParams,
pathname: joinPaths([matchedPathname, match.pathname]),
pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])),
route
});
if (match.pathnameBase !== "/") {
matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);
}
}
return matches;
}
/**
* Returns a path with params interpolated.
*
* @see https://reactrouter.com/docs/en/v6/utils/generate-path
*/
function generatePath(path, params) {
if (params === void 0) {
params = {};
}
return path.replace(/:(\w+)/g, (_, key) => {
invariant(params[key] != null, "Missing \":" + key + "\" param");
return params[key];
}).replace(/(\/?)\*/, (_, prefix, __, str) => {
const star = "*";
if (params[star] == null) {
// If no splat was provided, trim the trailing slash _unless_ it's
// the entire path
return str === "/*" ? "/" : "";
} // Apply the splat
return "" + prefix + params[star];
});
}
/**
* Performs pattern matching on a URL pathname and returns information about
* the match.
*
* @see https://reactrouter.com/docs/en/v6/utils/match-path
*/
function matchPath(pattern, pathname) {
if (typeof pattern === "string") {
pattern = {
path: pattern,
caseSensitive: false,
end: true
};
}
let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);
let match = pathname.match(matcher);
if (!match) return null;
let matchedPathname = match[0];
let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
let captureGroups = match.slice(1);
let params = paramNames.reduce((memo, paramName, index) => {
// We need to compute the pathnameBase here using the raw splat value
// instead of using params["*"] later because it will be decoded then
if (paramName === "*") {
let splatValue = captureGroups[index] || "";
pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
}
memo[paramName] = safelyDecodeURIComponent(captureGroups[index] || "", paramName);
return memo;
}, {});
return {
params,
pathname: matchedPathname,
pathnameBase,
pattern
};
}
function compilePath(path, caseSensitive, end) {
if (caseSensitive === void 0) {
caseSensitive = false;
}
if (end === void 0) {
end = true;
}
warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\"."));
let paramNames = [];
let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below
.replace(/^\/*/, "/") // Make sure it has a leading /
.replace(/[\\.*+^$?{}|()[\]]/g, "\\$&") // Escape special regex chars
.replace(/:(\w+)/g, (_, paramName) => {
paramNames.push(paramName);
return "([^\\/]+)";
});
if (path.endsWith("*")) {
paramNames.push("*");
regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest
: "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"]
} else if (end) {
// When matching to the end, ignore trailing slashes
regexpSource += "\\/*$";
} else if (path !== "" && path !== "/") {
// If our path is non-empty and contains anything beyond an initial slash,
// then we have _some_ form of path in our regex so we should expect to
// match only if we find the end of this path segment. Look for an optional
// non-captured trailing slash (to match a portion of the URL) or the end
// of the path (if we've matched to the end). We used to do this with a
// word boundary but that gives false positives on routes like
// /user-preferences since `-` counts as a word boundary.
regexpSource += "(?:(?=\\/|$))";
} else ;
let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i");
return [matcher, paramNames];
}
function safelyDecodeURIComponent(value, paramName) {
try {
return decodeURIComponent(value);
} catch (error) {
warning(false, "The value for the URL param \"" + paramName + "\" will not be decoded because" + (" the string \"" + value + "\" is a malformed URL segment. This is probably") + (" due to a bad percent encoding (" + error + ")."));
return value;
}
}
/**
* @private
*/
function stripBasename(pathname, basename) {
if (basename === "/") return pathname;
if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
return null;
} // We want to leave trailing slash behavior in the user's control, so if they
// specify a basename with a trailing slash, we should support it
let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
let nextChar = pathname.charAt(startIndex);
if (nextChar && nextChar !== "/") {
// pathname does not start with basename/
return null;
}
return pathname.slice(startIndex) || "/";
}
function invariant(value, message) {
if (value === false || value === null || typeof value === "undefined") {
throw new Error(message);
}
}
/**
* @private
*/
function warning(cond, message) {
if (!cond) {
// eslint-disable-next-line no-console
if (typeof console !== "undefined") console.warn(message);
try {
// Welcome to debugging React Router!
//
// This error is thrown as a convenience so you can more easily
// find the source for a warning that appears in the console by
// enabling "pause on exceptions" in your JavaScript debugger.
throw new Error(message); // eslint-disable-next-line no-empty
} catch (e) {}
}
}
/**
* Returns a resolved path object relative to the given pathname.
*
* @see https://reactrouter.com/docs/en/v6/utils/resolve-path
*/
function resolvePath(to, fromPathname) {
if (fromPathname === void 0) {
fromPathname = "/";
}
let {
pathname: toPathname,
search = "",
hash = ""
} = typeof to === "string" ? parsePath(to) : to;
let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
return {
pathname,
search: normalizeSearch(search),
hash: normalizeHash(hash)
};
}
function resolvePathname(relativePath, fromPathname) {
let segments = fromPathname.replace(/\/+$/, "").split("/");
let relativeSegments = relativePath.split("/");
relativeSegments.forEach(segment => {
if (segment === "..") {
// Keep the root "" segment so the pathname starts at /
if (segments.length > 1) segments.pop();
} else if (segment !== ".") {
segments.push(segment);
}
});
return segments.length > 1 ? segments.join("/") : "/";
}
function getInvalidPathError(char, field, dest, path) {
return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + "a string in <Link to=\"...\"> and the router will parse it for you.";
}
/**
* @private
*/
function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
if (isPathRelative === void 0) {
isPathRelative = false;
}
let to;
if (typeof toArg === "string") {
to = parsePath(toArg);
} else {
to = _extends({}, toArg);
invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to));
invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to));
invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to));
}
let isEmptyPath = toArg === "" || to.pathname === "";
let toPathname = isEmptyPath ? "/" : to.pathname;
let from; // Routing is relative to the current pathname if explicitly requested.
//
// If a pathname is explicitly provided in `to`, it should be relative to the
// route context. This is explained in `Note on `<Link to>` values` in our
// migration guide from v5 as a means of disambiguation between `to` values
// that begin with `/` and those that do not. However, this is problematic for
// `to` values that do not provide a pathname. `to` can simply be a search or
// hash string, in which case we should assume that the navigation is relative
// to the current location's pathname and *not* the route pathname.
if (isPathRelative || toPathname == null) {
from = locationPathname;
} else {
let routePathnameIndex = routePathnames.length - 1;
if (toPathname.startsWith("..")) {
let toSegments = toPathname.split("/"); // Each leading .. segment means "go up one route" instead of "go up one
// URL segment". This is a key difference from how <a href> works and a
// major reason we call this a "to" value instead of a "href".
while (toSegments[0] === "..") {
toSegments.shift();
routePathnameIndex -= 1;
}
to.pathname = toSegments.join("/");
} // If there are more ".." segments than parent routes, resolve relative to
// the root / URL.
from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
}
let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original "to" had one
let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"); // Or if this was a link to the current path which has a trailing slash
let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
path.pathname += "/";
}
return path;
}
/**
* @private
*/
function getToPathname(to) {
// Empty strings should be treated the same as / paths
return to === "" || to.pathname === "" ? "/" : typeof to === "string" ? parsePath(to).pathname : to.pathname;
}
/**
* @private
*/
const joinPaths = paths => paths.join("/").replace(/\/\/+/g, "/");
/**
* @private
*/
const normalizePathname = pathname => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
/**
* @private
*/
const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
/**
* @private
*/
const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
/**
* This is a shortcut for creating `application/json` responses. Converts `data`
* to JSON and sets the `Content-Type` header.
*/
const json = function json(data, init) {
if (init === void 0) {
init = {};
}
let responseInit = typeof init === "number" ? {
status: init
} : init;
let headers = new Headers(responseInit.headers);
if (!headers.has("Content-Type")) {
headers.set("Content-Type", "application/json; charset=utf-8");
}
return new Response(JSON.stringify(data), _extends({}, responseInit, {
headers
}));
};
class AbortedDeferredError extends Error {}
class DeferredData {
constructor(data) {
this.pendingKeys = new Set();
this.subscriber = undefined;
invariant(data && typeof data === "object" && !Array.isArray(data), "defer() only accepts plain objects"); // Set up an AbortController + Promise we can race against to exit early
// cancellation
let reject;
this.abortPromise = new Promise((_, r) => reject = r);
this.controller = new AbortController();
let onAbort = () => reject(new AbortedDeferredError("Deferred data aborted"));
this.unlistenAbortSignal = () => this.controller.signal.removeEventListener("abort", onAbort);
this.controller.signal.addEventListener("abort", onAbort);
this.data = Object.entries(data).reduce((acc, _ref) => {
let [key, value] = _ref;
return Object.assign(acc, {
[key]: this.trackPromise(key, value)
});
}, {});
}
trackPromise(key, value) {
if (!(value instanceof Promise)) {
return value;
}
this.pendingKeys.add(key); // We store a little wrapper promise that will be extended with
// _data/_error props upon resolve/reject
let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, null, data), error => this.onSettle(promise, key, error)); // Register rejection listeners to avoid uncaught promise rejections on
// errors or aborted deferred values
promise.catch(() => {});
Object.defineProperty(promise, "_tracked", {
get: () => true
});
return promise;
}
onSettle(promise, key, error, data) {
if (this.controller.signal.aborted && error instanceof AbortedDeferredError) {
this.unlistenAbortSignal();
Object.defineProperty(promise, "_error", {
get: () => error
});
return Promise.reject(error);
}
this.pendingKeys.delete(key);
if (this.done) {
// Nothing left to abort!
this.unlistenAbortSignal();
}
const subscriber = this.subscriber;
if (error) {
Object.defineProperty(promise, "_error", {
get: () => error
});
subscriber && subscriber(false);
return Promise.reject(error);
}
Object.defineProperty(promise, "_data", {
get: () => data
});
subscriber && subscriber(false);
return data;
}
subscribe(fn) {
this.subscriber = fn;
}
cancel() {
this.controller.abort();
this.pendingKeys.forEach((v, k) => this.pendingKeys.delete(k));
let subscriber = this.subscriber;
subscriber && subscriber(true);
}
async resolveData(signal) {
let aborted = false;
if (!this.done) {
let onAbort = () => this.cancel();
signal.addEventListener("abort", onAbort);
aborted = await new Promise(resolve => {
this.subscribe(aborted => {
signal.removeEventListener("abort", onAbort);
if (aborted || this.done) {
resolve(aborted);
}
});
});
}
return aborted;
}
get done() {
return this.pendingKeys.size === 0;
}
get unwrappedData() {
invariant(this.data !== null && this.done, "Can only unwrap data on initialized and settled deferreds");
return Object.entries(this.data).reduce((acc, _ref2) => {
let [key, value] = _ref2;
return Object.assign(acc, {
[key]: unwrapTrackedPromise(value)
});
}, {});
}
}
function isTrackedPromise(value) {
return value instanceof Promise && value._tracked === true;
}
function unwrapTrackedPromise(value) {
if (!isTrackedPromise(value)) {
return value;
}
if (value._error) {
throw value._error;
}
return value._data;
}
function defer(data) {
return new DeferredData(data);
}
/**
* A redirect response. Sets the status code and the `Location` header.
* Defaults to "302 Found".
*/
const redirect = function redirect(url, init) {
if (init === void 0) {
init = 302;
}
let responseInit = init;
if (typeof responseInit === "number") {
responseInit = {
status: responseInit
};
} else if (typeof responseInit.status === "undefined") {
responseInit.status = 302;
}
let headers = new Headers(responseInit.headers);
headers.set("Location", url);
return new Response(null, _extends({}, responseInit, {
headers
}));
};
/**
* @private
* Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies
*/
class ErrorResponse {
constructor(status, statusText, data) {
this.status = status;
this.statusText = statusText || "";
this.data = data;
}
}
/**
* Check if the given error is an ErrorResponse generated from a 4xx/5xx
* Response throw from an action/loader
*/
function isRouteErrorResponse(e) {
return e instanceof ErrorResponse;
}
const IDLE_NAVIGATION = {
state: "idle",
location: undefined,
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined
};
const IDLE_FETCHER = {
state: "idle",
data: undefined,
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined
}; //#endregion
////////////////////////////////////////////////////////////////////////////////
//#region createRouter
////////////////////////////////////////////////////////////////////////////////
/**
* Create a router and listen to history POP navigations
*/
function createRouter(init) {
invariant(init.routes.length > 0, "You must provide a non-empty routes array to createRouter");
let dataRoutes = convertRoutesToDataRoutes(init.routes); // Cleanup function for history
let unlistenHistory = null; // Externally-provided functions to call on all state changes
let subscribers = new Set(); // Externally-provided object to hold scroll restoration locations during routing
let savedScrollPositions = null; // Externally-provided function to get scroll restoration keys
let getScrollRestorationKey = null; // Externally-provided function to get current scroll position
let getScrollPosition = null; // One-time flag to control the initial hydration scroll restoration. Because
// we don't get the saved positions from <ScrollRestoration /> until _after_
// the initial render, we need to manually trigger a separate updateState to
// send along the restoreScrollPosition
let initialScrollRestored = false;
let initialMatches = matchRoutes(dataRoutes, init.history.location, init.basename);
let initialErrors = null;
if (initialMatches == null) {
// If we do not match a user-provided-route, fall back to the root
// to allow the error boundary to take over
let {
matches,
route,
error
} = getNotFoundMatches(dataRoutes);
initialMatches = matches;
initialErrors = {
[route.id]: error
};
}
let initialized = !initialMatches.some(m => m.route.loader) || init.hydrationData != null;
let router;
let state = {
historyAction: init.history.action,
location: init.history.location,
matches: initialMatches,
initialized,
navigation: IDLE_NAVIGATION,
restoreScrollPosition: null,
preventScrollReset: false,
revalidation: "idle",
loaderData: init.hydrationData && init.hydrationData.loaderData || {},
actionData: init.hydrationData && init.hydrationData.actionData || null,
errors: init.hydrationData && init.hydrationData.errors || initialErrors,
fetchers: new Map()
}; // -- Stateful internal variables to manage navigations --
// Current navigation in progress (to be committed in completeNavigation)
let pendingAction = Action.Pop; // Should the current navigation prevent the scroll reset if scroll cannot
// be restored?
let pendingPreventScrollReset = false; // AbortController for the active navigation
let pendingNavigationController; // We use this to avoid touching history in completeNavigation if a
// revalidation is entirely uninterrupted
let isUninterruptedRevalidation = false; // Use this internal flag to force revalidation of all loaders:
// - submissions (completed or interrupted)
// - useRevalidate()
// - X-Remix-Revalidate (from redirect)
let isRevalidationRequired = false; // Use this internal array to capture routes that require revalidation due
// to a cancelled deferred on action submission
let cancelledDeferredRoutes = []; // Use this internal array to capture fetcher loads that were cancelled by an
// action navigation and require revalidation
let cancelledFetcherLoads = []; // AbortControllers for any in-flight fetchers
let fetchControllers = new Map(); // Track loads based on the order in which they started
let incrementingLoadId = 0; // Track the outstanding pending navigation data load to be compared against
// the globally incrementing load when a fetcher load lands after a completed
// navigation
let pendingNavigationLoadId = -1; // Fetchers that triggered data reloads as a result of their actions
let fetchReloadIds = new Map(); // Fetchers that triggered redirect navigations from their actions
let fetchRedirectIds = new Set(); // Most recent href/match for fetcher.load calls for fetchers
let fetchLoadMatches = new Map(); // Store DeferredData instances for active route matches. When a
// route loader returns defer() we stick one in here. Then, when a nested
// promise resolves we update loaderData. If a new navigation starts we
// cancel active deferreds for eliminated routes.
let activeDeferreds = new Map(); // Initialize the router, all side effects should be kicked off from here.
// Implemented as a Fluent API for ease of:
// let router = createRouter(init).initialize();
function initialize() {
// If history informs us of a POP navigation, start the navigation but do not update
// state. We'll update our own state once the navigation completes
unlistenHistory = init.history.listen(_ref => {
let {
action: historyAction,
location
} = _ref;
return startNavigation(historyAction, location);
}); // Kick off initial data load if needed. Use Pop to avoid modifying history
if (!state.initialized) {
startNavigation(Action.Pop, state.location);
}
return router;
} // Clean up a router and it's side effects
function dispose() {
if (unlistenHistory) {
unlistenHistory();
}
subscribers.clear();
pendingNavigationController && pendingNavigationController.abort();
state.fetchers.forEach((_, key) => deleteFetcher(key));
} // Subscribe to state updates for the router
function subscribe(fn) {
subscribers.add(fn);
return () => subscribers.delete(fn);
} // Update our state and notify the calling context of the change
function updateState(newState) {
state = _extends({}, state, newState);
subscribers.forEach(subscriber => subscriber(state));
} // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION
// and setting state.[historyAction/location/matches] to the new route.
// - Location is a required param
// - Navigation will always be set to IDLE_NAVIGATION
// - Can pass any other state in newState
function completeNavigation(location, newState) {
var _state$navigation$for;
// Deduce if we're in a loading/actionReload state:
// - We have committed actionData in the store
// - The current navigation was a submission
// - We're past the submitting state and into the loading state
// - The location we've finished loading is different from the submission
// location, indicating we redirected from the action (avoids false
// positives for loading/submissionRedirect when actionData returned
// on a prior submission)
let isActionReload = state.actionData != null && state.navigation.formMethod != null && state.navigation.state === "loading" && ((_state$navigation$for = state.navigation.formAction) == null ? void 0 : _state$navigation$for.split("?")[0]) === location.pathname; // Always preserve any existing loaderData from re-used routes
let newLoaderData = newState.loaderData ? {
loaderData: mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [])
} : {};
updateState(_extends({}, isActionReload ? {} : {
actionData: null
}, newState, newLoaderData, {
historyAction: pendingAction,
location,
initialized: true,
navigation: IDLE_NAVIGATION,
revalidation: "idle",
// Don't restore on submission navigations
restoreScrollPosition: state.navigation.formData ? false : getSavedScrollPosition(location, newState.matches || state.matches),
preventScrollReset: pendingPreventScrollReset
}));
if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) {
init.history.push(location, location.state);
} else if (pendingAction === Action.Replace) {
init.history.replace(location, location.state);
} // Reset stateful navigation vars
pendingAction = Action.Pop;
pendingPreventScrollReset = false;
isUninterruptedRevalidation = false;
isRevalidationRequired = false;
cancelledDeferredRoutes = [];
cancelledFetcherLoads = [];
} // Trigger a navigation event, which can either be a numerical POP or a PUSH
// replace with an optional submission
async function navigate(to, opts) {
if (typeof to === "number") {
init.history.go(to);
return;
}
let {
path,
submission,
error
} = normalizeNavigateOptions(to, opts);
let location = createLocation(state.location, path, opts && opts.state);
let historyAction = (opts && opts.replace) === true || submission != null ? Action.Replace : Action.Push;
let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : undefined;
return await startNavigation(historyAction, location, {
submission,
// Send through the formData serialization error if we have one so we can
// render at the right error boundary after we match routes
pendingError: error,
preventScrollReset,
replace: opts && opts.replace
});
} // Revalidate all current loaders. If a navigation is in progress or if this
// is interrupted by a navigation, allow this to "succeed" by calling all
// loaders during the next loader round
function revalidate() {
interruptActiveLoads();
updateState({
revalidation: "loading"
}); // If we're currently submitting an action, we don't need to start a new
// navigation, we'll just let the follow up loader execution call all loaders
if (state.navigation.state === "submitting") {
return;
} // If we're currently in an idle state, start a new navigation for the current
// action/location and mark it as uninterrupted, which will skip the history
// update in completeNavigation
if (state.navigation.state === "idle") {
startNavigation(state.historyAction, state.location, {
startUninterruptedRevalidation: true
});
return;
} // Otherwise, if we're currently in a loading state, just start a new
// navigation to the navigation.location but do not trigger an uninterrupted
// revalidation so that history correctly updates once the navigation completes
startNavigation(pendingAction || state.historyAction, state.navigation.location, {
overrideNavigation: state.navigation
});
} // Start a navigation to the given action/location. Can optionally provide a
// overrideNavigation which will override the normalLoad in the case of a redirect
// navigation
async function startNavigation(historyAction, location, opts) {
// Abort any in-progress navigations and start a new one. Unset any ongoing
// uninterrupted revalidations unless told otherwise, since we want this
// new navigation to update history normally
pendingNavigationController && pendingNavigationController.abort();
pendingNavigationController = null;
pendingAction = historyAction;
isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; // Save the current scroll position every time we start a new navigation,
// and track whether we should reset scroll on completion
saveScrollPosition(state.location, state.matches);
pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;
let loadingNavigation = opts && opts.overrideNavigation;
let matches = matchRoutes(dataRoutes, location, init.basename); // Short circuit with a 404 on the root error boundary if we match nothing
if (!matches) {
let {
matches: notFoundMatches,
route,
error
} = getNotFoundMatches(dataRoutes); // Cancel all pending deferred on 404s since we don't keep any routes
cancelActiveDeferreds();
completeNavigation(location, {
matches: notFoundMatches,
loaderData: {},
errors: {
[route.id]: error
}
});
return;
} // Short circuit if it's only a hash change
if (isHashChangeOnly(state.location, location)) {
completeNavigation(location, {
matches
});
return;
} // Create a controller/Request for this navigation
pendingNavigationController = new AbortController();
let request = createRequest(location, pendingNavigationController.signal, opts && opts.submission);
let pendingActionData;
let pendingError;
if (opts && opts.pendingError) {
// If we have a pendingError, it means the user attempted a GET submission
// with binary FormData so assign here and skip to handleLoaders. That
// way we handle calling loaders above the boundary etc. It's not really
// different from an actionError in that sense.
pendingError = {
[findNearestBoundary(matches).route.id]: opts.pendingError
};
} else if (opts && opts.submission) {
// Call action if we received an action submission
let actionOutput = await handleAction(request, location, opts.submission, matches, {
replace: opts.replace
});
if (actionOutput.shortCircuited) {
return;
}
pendingActionData = actionOutput.pendingActionData;
pendingError = actionOutput.pendingActionError;
let navigation = _extends({
state: "loading",
location
}, opts.submission);
loadingNavigation = navigation;
} // Call loaders
let {
shortCircuited,
loaderData,
errors
} = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.replace, pendingActionData, pendingError);
if (shortCircuited) {
return;
} // Clean up now that the action/loaders have completed. Don't clean up if
// we short circuited because pendingNavigationController will have already
// been assigned to a new controller for the next navigation
pendingNavigationController = null;
completeNavigation(location, {
matches,
loaderData,
errors
});
} // Call the action matched by the leaf route for this navigation and handle
// redirects/errors
async function handleAction(request, location, submission, matches, opts) {
interruptActiveLoads(); // Put us in a submitting state
let navigation = _extends({
state: "submitting",
location
}, submission);
updateState({
navigation
}); // Call our action and get the result
let result;
let actionMatch = getTargetMatch(matches, location);
if (!actionMatch.route.action) {
result = getMethodNotAllowedResult(location);
} else {
result = await callLoaderOrAction("action", request, actionMatch);
if (request.signal.aborted) {
return {
shortCircuited: true
};
}
}
if (isRedirectResult(result)) {
let redirectNavigation = _extends({
state: "loading",
location: createLocation(state.location, result.location)
}, submission);
await startRedirectNavigation(result, redirectNavigation, opts && opts.replace);
return {
shortCircuited: true
};
}
if (isErrorResult(result)) {
// Store off the pending error - we use it to determine which loaders
// to call and will commit it when we complete the navigation
let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); // By default, all submissions are REPLACE navigations, but if the
// action threw an error that'll be rendered in an errorElement, we fall
// back to PUSH so that the user can use the back button to get back to
// the pre-submission form location to try again
if ((opts && opts.replace) !== true) {
pendingAction = Action.Push;
}
return {
pendingActionError: {
[boundaryMatch.route.id]: result.error
}
};
}
if (isDeferredResult(result)) {
throw new Error("defer() is not supported in actions");
}
return {
pendingActionData: {
[actionMatch.route.id]: result.data
}
};
} // Call all applicable loaders for the given matches, handling redirects,
// errors, etc.
async function handleLoaders(request, location, matches, overrideNavigation, submission, replace, pendingActionData, pendingError) {
// Figure out the right navigation we want to use for data loading
let loadingNavigation = overrideNavigation;
if (!loadingNavigation) {
let navigation = {
state: "loading",
location,
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined
};
loadingNavigation = navigation;
}
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, pendingActionData, pendingError, fetchLoadMatches); // Cancel pending deferreds for no-longer-matched routes or routes we're
// about to reload. Note that if this is an action reload we would have
// already cancelled all pending deferreds so this would be a no-op
cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId)); // Short circuit if we have no loaders to run
if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {
completeNavigation(location, {
matches,
loaderData: mergeLoaderData(state.loaderData, {}, matches),
// Commit pending error if we're short circuiting
errors: pendingError || null,
actionData: pendingActionData || null
});
return {
shortCircuited: true
};
} // If this is an uninterrupted revalidation, we remain in our current idle
// state. If not, we need to switch to our loading state and load data,
// preserving any new action data or existing action data (in the case of
// a revalidation interrupting an actionReload)
if (!isUninterruptedRevalidation) {
revalidatingFetchers.forEach(_ref2 => {
let [key] = _ref2;
const fetcher = state.fetchers.get(key);
let revalidatingFetcher = {
state: "loading",
data: fetcher && fetcher.data,
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined
};
state.fetchers.set(key, revalidatingFetcher);
});
updateState(_extends({
navigation: loadingNavigation,
actionData: pendingActionData || state.actionData || null
}, revalidatingFetchers.length > 0 ? {
fetchers: new Map(state.fetchers)
} : {}));
}
pendingNavigationLoadId = ++incrementingLoadId;
revalidatingFetchers.forEach(_ref3 => {
let [key] = _ref3;
return fetchControllers.set(key, pendingNavigationController);
});
let {
results,
loaderResults,
fetcherResults
} = await callLoadersAndMaybeResolveData(state.matches, matchesToLoad, revalidatingFetchers, request);
if (request.signal.aborted) {
return {
shortCircuited: true
};
} // Clean up _after_ loaders have completed. Don't clean up if we short
// circuited because fetchControllers would have been aborted and
// reassigned to new controllers for the next navigation
revalidatingFetchers.forEach(_ref4 => {
let [key] = _ref4;
return fetchControllers.delete(key);
}); // If any loaders returned a redirect Response, start a new REPLACE navigation
let redirect = findRedirect(results);
if (redirect) {
let redirectNavigation = getLoaderRedirect(state, redirect);
await startRedirectNavigation(redirect, redirectNavigation, replace);
return {
shortCircuited: true
};
} // Process and commit output from loaders
let {
loaderData,
errors
} = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds); // Wire up subscribers to update loaderData as promises settle
activeDeferreds.forEach((deferredData, routeId) => {
deferredData.subscribe(aborted => {
// Note: No need to updateState here since the TrackedPromise on
// loaderData is stable across resolve/reject
// Remove this instance if we were aborted or if promises have settled
if (aborted || deferredData.done) {
activeDeferreds.delete(routeId);
}
});
});
markFetchRedirectsDone();
let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);
return _extends({
loaderData,
errors
}, didAbortFetchLoads || revalidatingFetchers.length > 0 ? {
fetchers: new Map(state.fetchers)
} : {});
}
function getFetcher(key) {
return state.fetchers.get(key) || IDLE_FETCHER;
} // Trigger a fetcher load/submit for the given fetcher key
function fetch(key, routeId, href, opts) {
if (typeof AbortController === "undefined") {
throw new Error("router.fetch() was called during the server render, but it shouldn't be. " + "You are likely calling a useFetcher() method in the body of your component. " + "Try moving it to a useEffect or a callback.");
}
if (fetchControllers.has(key)) abortFetcher(key);
let matches = matchRoutes(dataRoutes, href, init.basename);
if (!matches) {
setFetcherError(key, routeId, new ErrorResponse(404, "Not Found", null));
return;
}
let {
path,
submission
} = normalizeNavigateOptions(href, opts, true);
let match = getTargetMatch(matches, path);
if (submission) {
handleFetcherAction(key, routeId, path, match, submission);
return;
} // Store off the match so we can call it's shouldRevalidate on subsequent
// revalidations
fetchLoadMatches.set(key, [path, match]);
handleFetcherLoader(key, routeId, path, match);
} // Call the action for the matched fetcher.submit(), and then handle redirects,
// errors, and revalidation
async function handleFetcherAction(key, routeId, path, match, submission) {
interruptActiveLoads();
fetchLoadMatches.delete(key);
if (!match.route.action) {
let {
error
} = getMethodNotAllowedResult(path);
setFetcherError(key, routeId, error);
return;
} // Put this fetcher into it's submitting state
let existingFetcher = state.fetchers.get(key);
let fetcher = _extends({
state: "submitting"
}, submission, {
data: existingFetcher && existingFetcher.data
});
state.fetchers.set(key, fetcher);
updateState({
fetchers: new Map(state.fetchers)
}); // Call the action for the fetcher
let abortController = new AbortController();
let fetchRequest = createRequest(path, abortController.signal, submission);
fetchControllers.set(key, abortController);
let actionResult = await callLoaderOrAction("action", fetchRequest, match);
if (fetchRequest.signal.aborted) {
// We can delete this so long as we weren't aborted by ou our own fetcher
// re-submit which would have put _new_ controller is in fetchControllers
if (fetchControllers.get(key) === abortController) {
fetchControllers.delete(key);
}
return;
}
if (isRedirectResult(actionResult)) {
fetchControllers.delete(key);
fetchRedirectIds.add(key);
let loadingFetcher = _extends({
state: "loading"
}, submission, {
data: undefined
});
state.fetchers.set(key, loadingFetcher);
updateState({
fetchers: new Map(state.fetchers)
});
let redirectNavigation = _extends({
state: "loading",
location: createLocation(state.location, actionResult.location)
}, submission);
await startRedirectNavigation(actionResult, redirectNavigation);
return;
} // Process any non-redirect errors thrown
if (isErrorResult(actionResult)) {
setFetcherError(key, routeId, actionResult.error);
return;
}
if (isDeferredResult(actionResult)) {
invariant(false, "defer() is not supported in actions");
} // Start the data load for current matches, or the next location if we're
// in the middle of a navigation
let nextLocation = state.navigation.location || state.location;
let revalidationRequest = createRequest(nextLocation, abortController.signal);
let matches = state.navigation.state !== "idle" ? matchRoutes(dataRoutes, state.navigation.location, init.basename) : state.matches;
invariant(matches, "Didn't find any matches after fetcher action");
let loadId = ++incrementingLoadId;
fetchReloadIds.set(key, loadId);
let loadFetcher = _extends({
state: "loading",
data: actionResult.data
}, submission);
state.fetchers.set(key, loadFetcher);
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(state, matches, submission, nextLocation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, {
[match.route.id]: actionResult.data
}, undefined, // No need to send through errors since we short circuit above
fetchLoadMatches); // Put all revalidating fetchers into the loading state, except for the
// current fetcher which we want to keep in it's current loading state which
// contains it's action submission info + action data
revalidatingFetchers.filter(_ref5 => {
let [staleKey] = _ref5;
return staleKey !== key;
}).forEach(_ref6 => {
let [staleKey] = _ref6;
let existingFetcher = state.fetchers.get(staleKey);
let revalidatingFetcher = {
state: "loading",
data: existingFetcher && existingFetcher.data,
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined
};
state.fetchers.set(staleKey, revalidatingFetcher);
fetchControllers.set(staleKey, abortController);
});
updateState({
fetchers: new Map(state.fetchers)
});
let {
results,
loaderResults,
fetcherResults
} = await callLoadersAndMaybeResolveData(state.matches, matchesToLoad, revalidatingFetchers, revalidationRequest);
if (abortController.signal.aborted) {
return;
}
fetchReloadIds.delete(key);
fetchControllers.delete(key);
revalidatingFetchers.forEach(_ref7 => {
let [staleKey] = _ref7;
return fetchControllers.delete(staleKey);
});
let redirect = findRedirect(results);
if (redirect) {
let redirectNavigation = getLoaderRedirect(state, redirect);
await startRedirectNavigation(redirect, redirectNavigation);
return;
} // Process and commit output from loaders
let {
loaderData,
errors
} = processLoaderData(state, state.matches, matchesToLoad, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds);
let doneFetcher = {
state: "idle",
data: actionResult.data,
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined
};
state.fetchers.set(key, doneFetcher);
let didAbortFetchLoads = abortStaleFetchLoads(loadId); // If we are currently in a navigation loading state and this fetcher is
// more recent than the navigation, we want the newer data so abort the
// navigation and complete it with the fetcher data
if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) {
invariant(pendingAction, "Expected pending action");
pendingNavigationController && pendingNavigationController.abort();
completeNavigation(state.navigation.location, {
matches,
loaderData,
errors,
fetchers: new Map(state.fetchers)
});
} else {
// otherwise just update with the fetcher data, preserving any existing
// loaderData for loaders that did not need to reload. We have to
// manually merge here since we aren't going through completeNavigation
updateState(_extends({
errors,
loaderData: mergeLoaderData(state.loaderData, loaderData, matches)
}, didAbortFetchLoads ? {
fetchers: new Map(state.fetchers)
} : {}));
isRevalidationRequired = false;
}
} // Call the matched loader for fetcher.load(), handling redirects, errors, etc.
async function handleFetcherLoader(key, routeId, path, match) {
let existingFetcher = state.fetchers.get(key); // Put this fetcher into it's loading state
let loadingFetcher = {
state: "loading",
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined,
data: existingFetcher && existingFetcher.data
};
state.fetchers.set(key, loadingFetcher);
updateState({
fetchers: new Map(state.fetchers)
}); // Call the loader for this fetcher route match
let abortController = new AbortController();
let fetchRequest = createRequest(path, abortController.signal);
fetchControllers.set(key, abortController);
let result = await callLoaderOrAction("loader", fetchRequest, match); // Deferred isn't supported or fetcher loads, await everything and treat it
// as a normal load. resolveDeferredData will return undefined if this
// fetcher gets aborted, so we just leave result untouched and short circuit
// below if that happens
if (isDeferredResult(result)) {
result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result;
} // We can delete this so long as we weren't aborted by ou our own fetcher
// re-load which would have put _new_ controller is in fetchControllers
if (fetchControllers.get(key) === abortController) {
fetchControllers.delete(key);
}
if (fetchRequest.signal.aborted) {
return;
} // If the loader threw a redirect Response, start a new REPLACE navigation
if (isRedirectResult(result)) {
let redirectNavigation = getLoaderRedirect(state, result);
await startRedirectNavigation(result, redirectNavigation);
return;
} // Process any non-redirect errors thrown
if (isErrorResult(result)) {
let boundaryMatch = findNearestBoundary(state.matches, routeId);
state.fetchers.delete(key); // TODO: In remix, this would reset to IDLE_NAVIGATION if it was a catch -
// do we need to behave any differently with our non-redirect errors?
// What if it was a non-redirect Response?
updateState({
fetchers: new Map(state.fetchers),
errors: {
[boundaryMatch.route.id]: result.error
}
});
return;
}
invariant(!isDeferredResult(result), "Unhandled fetcher deferred data"); // Put the fetcher back into an idle state
let doneFetcher = {
state: "idle",
data: result.data,
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined
};
state.fetchers.set(key, doneFetcher);
updateState({
fetchers: new Map(state.fetchers)
});
}
/**
* Utility function to handle redirects returned from an action or loader.
* Normally, a redirect "replaces" the navigation that triggered it. So, for
* example:
*
* - user is on /a
* - user clicks a link to /b
* - loader for /b redirects to /c
*
* In a non-JS app the browser would track the in-flight navigation to /b and
* then replace it with /c when it encountered the redirect response. In
* the end it would only ever update the URL bar with /c.
*
* In client-side routing using pushState/replaceState, we aim to emulate
* this behavior and we also do not update history until the end of the
* navigation (including processed redirects). This means that we never
* actually touch history until we've processed redirects, so we just use
* the history action from the original navigation (PUSH or REPLACE).
*/
async function startRedirectNavigation(redirect, navigation, replace) {
if (redirect.revalidate) {
isRevalidationRequired = true;
}
invariant(navigation.location, "Expected a location on the redirect navigation"); // There's no need to abort on redirects, since we don't detect the
// redirect until the action/loaders have settled
pendingNavigationController = null;
let redirectHistoryAction = replace === true ? Action.Replace : Action.Push;
await startNavigation(redirectHistoryAction, navigation.location, {
overrideNavigation: navigation
});
}
async function callLoadersAndMaybeResolveData(currentMatches, matchesToLoad, fetchersToLoad, request) {
// Call all navigation loaders and revalidating fetcher loaders in parallel,
// then slice off the results into separate arrays so we can handle them
// accordingly
let results = await Promise.all([...matchesToLoad.map(m => callLoaderOrAction("loader", request, m)), ...fetchersToLoad.map(_ref8 => {
let [, href, match] = _ref8;
return callLoaderOrAction("loader", createRequest(href, request.signal), match);
})]);
let loaderResults = results.slice(0, matchesToLoad.length);
let fetcherResults = results.slice(matchesToLoad.length);
await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, request.signal, false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map(_ref9 => {
let [,, match] = _ref9;
return match;
}), fetcherResults, request.signal, true)]);
return {
results,
loaderResults,
fetcherResults
};
}
function interruptActiveLoads() {
// Every interruption triggers a revalidation
isRevalidationRequired = true; // Cancel pending route-level deferreds and mark cancelled routes for
// revalidation
cancelledDeferredRoutes.push(...cancelActiveDeferreds()); // Abort in-flight fetcher loads
fetchLoadMatches.forEach((_, key) => {
if (fetchControllers.has(key)) {
cancelledFetcherLoads.push(key);
abortFetcher(key);
}
});
}
function setFetcherError(key, routeId, error) {
let boundaryMatch = findNearestBoundary(state.matches, routeId);
deleteFetcher(key);
updateState({
errors: {
[boundaryMatch.route.id]: error
},
fetchers: new Map(state.fetchers)
});
}
function deleteFetcher(key) {
if (fetchControllers.has(key)) abortFetcher(key);
fetchLoadMatches.delete(key);
fetchReloadIds.delete(key);
fetchRedirectIds.delete(key);
state.fetchers.delete(key);
}
function abortFetcher(key) {
let controller = fetchControllers.get(key);
invariant(controller, "Expected fetch controller: " + key);
controller.abort();
fetchControllers.delete(key);
}
function markFetchersDone(keys) {
for (let key of keys) {
let fetcher = getFetcher(key);
let doneFetcher = {
state: "idle",
data: fetcher.data,
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined
};
state.fetchers.set(key, doneFetcher);
}
}
function markFetchRedirectsDone() {
let doneKeys = [];
for (let key of fetchRedirectIds) {
let fetcher = state.fetchers.get(key);
invariant(fetcher, "Expected fetcher: " + key);
if (fetcher.state === "loading") {
fetchRedirectIds.delete(key);
doneKeys.push(key);
}
}
markFetchersDone(doneKeys);
}
function abortStaleFetchLoads(landedId) {
let yeetedKeys = [];
for (let [key, id] of fetchReloadIds) {
if (id < landedId) {
let fetcher = state.fetchers.get(key);
invariant(fetcher, "Expected fetcher: " + key);
if (fetcher.state === "loading") {
abortFetcher(key);
fetchReloadIds.delete(key);
yeetedKeys.push(key);
}
}
}
markFetchersDone(yeetedKeys);
return yeetedKeys.length > 0;
}
function cancelActiveDeferreds(predicate) {
let cancelledRouteIds = [];
activeDeferreds.forEach((dfd, routeId) => {
if (!predicate || predicate(routeId)) {
// Cancel the deferred - but do not remove from activeDeferreds here -
// we rely on the subscribers to do that so our tests can assert proper
// cleanup via _internalActiveDeferreds
dfd.cancel();
cancelledRouteIds.push(routeId);
activeDeferreds.delete(routeId);
}
});
return cancelledRouteIds;
} // Opt in to capturing and reporting scroll positions during navigations,
// used by the <ScrollRestoration> component
function enableScrollRestoration(positions, getPosition, getKey) {
savedScrollPositions = positions;
getScrollPosition = getPosition;
getScrollRestorationKey = getKey || (location => location.key); // Perform initial hydration scroll restoration, since we miss the boat on
// the initial updateState() because we've not yet rendered <ScrollRestoration/>
// and therefore have no savedScrollPositions available
if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {
initialScrollRestored = true;
let y = getSavedScrollPosition(state.location, state.matches);
if (y != null) {
updateState({
restoreScrollPosition: y
});
}
}
return () => {
savedScrollPositions = null;
getScrollPosition = null;
getScrollRestorationKey = null;
};
}
function saveScrollPosition(location, matches) {
if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {
let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData));
let key = getScrollRestorationKey(location, userMatches) || location.key;
savedScrollPositions[key] = getScrollPosition();
}
}
function getSavedScrollPosition(location, matches) {
if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {
let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData));
let key = getScrollRestorationKey(location, userMatches) || location.key;
let y = savedScrollPositions[key];
if (typeof y === "number") {
return y;
}
}
return null;
}
router = {
get basename() {
return init.basename;
},
get state() {
return state;
},
get routes() {
return dataRoutes;
},
initialize,
subscribe,
enableScrollRestoration,
navigate,
fetch,
revalidate,
createHref,
getFetcher,
deleteFetcher,
dispose,
_internalFetchControllers: fetchControllers,
_internalActiveDeferreds: activeDeferreds
};
return router;
} //#endregion
////////////////////////////////////////////////////////////////////////////////
//#region createStaticHandler
////////////////////////////////////////////////////////////////////////////////
function unstable_createStaticHandler(routes) {
invariant(routes.length > 0, "You must provide a non-empty routes array to unstable_createStaticHandler");
let dataRoutes = convertRoutesToDataRoutes(routes);
async function query(request) {
let {
location,
result
} = await queryImpl(request);
if (result instanceof Response) {
return result;
} // When returning StaticHandlerContext, we patch back in the location here
// since we need it for React Context. But this helps keep our submit and
// loadRouteData operating on a Request instead of a Location
return _extends({
location
}, result);
}
async function queryRoute(request, routeId) {
let {
result
} = await queryImpl(request, routeId);
if (result instanceof Response) {
return result;
}
let error = result.errors ? Object.values(result.errors)[0] : undefined;
if (error !== undefined) {
// While we always re-throw Responses returned from loaders/actions
// directly for route requests and prevent the unwrapping into an
// ErrorResponse, we still need this for error cases _prior_ the
// execution of the loader/action, such as a 404/405 error.
if (isRouteErrorResponse(error)) {
return new Response(error.data, {
status: error.status,
statusText: error.statusText
});
} // If we got back result.errors, that means the loader/action threw
// _something_ that wasn't a Response, but it's not guaranteed/required
// to be an `instanceof Error` either, so we have to use throw here to
// preserve the "error" state outside of queryImpl.
throw error;
} // Pick off the right state value to return
let routeData = [result.actionData, result.loaderData].find(v => v);
let value = Object.values(routeData || {})[0];
if (isRouteErrorResponse(value)) {
return new Response(value.data, {
status: value.status,
statusText: value.statusText
});
}
return value;
}
async function queryImpl(request, routeId) {
invariant(request.method !== "HEAD", "query()/queryRoute() do not support HEAD requests");
invariant(request.signal, "query()/queryRoute() requests must contain an AbortController signal");
let {
location,
matches,
shortCircuitState
} = matchRequest(request, routeId);
try {
if (shortCircuitState) {
return {
location,
result: shortCircuitState
};
}
if (request.method !== "GET") {
let result = await submit(request, matches, getTargetMatch(matches, location), routeId != null);
return {
location,
result
};
}
let result = await loadRouteData(request, matches, routeId != null);
return {
location,
result: _extends({}, result, {
actionData: null,
actionHeaders: {}
})
};
} catch (e) {
if (e instanceof Response) {
return {
location,
result: e
};
}
throw e;
}
}
async function submit(request, matches, actionMatch, isRouteRequest) {
let result;
if (!actionMatch.route.action) {
let href = createHref(new URL(request.url));
result = getMethodNotAllowedResult(href);
} else {
result = await callLoaderOrAction("action", request, actionMatch, true, isRouteRequest);
if (request.signal.aborted) {
let method = isRouteRequest ? "queryRoute" : "query";
throw new Error(method + "() call aborted");
}
}
if (isRedirectResult(result)) {
// Uhhhh - this should never happen, we should always throw these from
// calLoaderOrAction, but the type narrowing here keeps TS happy and we
// can get back on the "throw all redirect responses" train here should
// this ever happen :/
throw new Response(null, {
status: result.status,
headers: {
Location: result.location
}
});
}
if (isDeferredResult(result)) {
throw new Error("defer() is not supported in actions");
}
if (isRouteRequest) {
if (isErrorResult(result)) {
let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);
return {
matches: [actionMatch],
loaderData: {},
actionData: null,
errors: {
[boundaryMatch.route.id]: result.error
},
// Note: statusCode + headers are unused here since queryRoute will
// return the raw Response or value
statusCode: 500,
loaderHeaders: {},
actionHeaders: {}
};
}
return {
matches: [actionMatch],
loaderData: {},
actionData: {
[actionMatch.route.id]: result.data
},
errors: null,
// Note: statusCode + headers are unused here since queryRoute will
// return the raw Response or value
statusCode: 200,
loaderHeaders: {},
actionHeaders: {}
};
}
if (isErrorResult(result)) {
// Store off the pending error - we use it to determine which loaders
// to call and will commit it when we complete the navigation
let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);
let context = await loadRouteData(request, matches, isRouteRequest, {
[boundaryMatch.route.id]: result.error
}); // action status codes take precedence over loader status codes
return _extends({}, context, {
statusCode: isRouteErrorResponse(result.error) ? result.error.status : 500,
actionData: null,
actionHeaders: _extends({}, result.headers ? {
[actionMatch.route.id]: result.headers
} : {})
});
}
let context = await loadRouteData(request, matches, isRouteRequest);
return _extends({}, context, result.statusCode ? {
statusCode: result.statusCode
} : {}, {
actionData: {
[actionMatch.route.id]: result.data
},
actionHeaders: _extends({}, result.headers ? {
[actionMatch.route.id]: result.headers
} : {})
});
}
async function loadRouteData(request, matches, isRouteRequest, pendingActionError) {
let matchesToLoad = getLoaderMatchesUntilBoundary(matches, Object.keys(pendingActionError || {})[0]).filter(m => m.route.loader); // Short circuit if we have no loaders to run
if (matchesToLoad.length === 0) {
return {
matches,
loaderData: {},
errors: pendingActionError || null,
statusCode: 200,
loaderHeaders: {}
};
}
let results = await Promise.all([...matchesToLoad.map(m => callLoaderOrAction("loader", request, m, true, isRouteRequest))]);
if (request.signal.aborted) {
let method = isRouteRequest ? "queryRoute" : "query";
throw new Error(method + "() call aborted");
} // Can't do anything with these without the Remix side of things, so just
// cancel them for now
results.forEach(result => {
if (isDeferredResult(result)) {
result.deferredData.cancel();
}
}); // Process and commit output from loaders
let context = processRouteLoaderData(matches, matchesToLoad, results, pendingActionError);
return _extends({}, context, {
matches
});
}
function matchRequest(req, routeId) {
let url = new URL(req.url);
let location = createLocation("", createPath(url), null, "default");
let matches = matchRoutes(dataRoutes, location);
if (matches && routeId) {
matches = matches.filter(m => m.route.id === routeId);
} // Short circuit with a 404 if we match nothing
if (!matches) {
let {
matches: notFoundMatches,
route,
error
} = getNotFoundMatches(dataRoutes);
return {
location,
matches: notFoundMatches,
shortCircuitState: {
matches: notFoundMatches,
loaderData: {},
actionData: null,
errors: {
[route.id]: error
},
statusCode: 404,
loaderHeaders: {},
actionHeaders: {}
}
};
}
return {
location,
matches
};
}
return {
dataRoutes,
query,
queryRoute
};
} //#endregion
////////////////////////////////////////////////////////////////////////////////
//#region Helpers
////////////////////////////////////////////////////////////////////////////////
/**
* Given an existing StaticHandlerContext and an error thrown at render time,
* provide an updated StaticHandlerContext suitable for a second SSR render
*/
function getStaticContextFromError(routes, context, error) {
let newContext = _extends({}, context, {
statusCode: 500,
errors: {
[context._deepestRenderedBoundaryId || routes[0].id]: error
}
});
return newContext;
} // Normalize navigation options by converting formMethod=GET formData objects to
// URLSearchParams so they behave identically to links with query params
function normalizeNavigateOptions(to, opts, isFetcher) {
if (isFetcher === void 0) {
isFetcher = false;
}
let path = typeof to === "string" ? to : createPath(to); // Return location verbatim on non-submission navigations
if (!opts || !("formMethod" in opts) && !("formData" in opts)) {
return {
path
};
} // Create a Submission on non-GET navigations
if (opts.formMethod != null && opts.formMethod !== "get") {
return {
path,
submission: {
formMethod: opts.formMethod,
formAction: createHref(parsePath(path)),
formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded",
formData: opts.formData
}
};
} // No formData to flatten for GET submission
if (!opts.formData) {
return {
path
};
} // Flatten submission onto URLSearchParams for GET submissions
let parsedPath = parsePath(path);
try {
let searchParams = convertFormDataToSearchParams(opts.formData); // Since fetcher GET submissions only run a single loader (as opposed to
// navigation GET submissions which run all loaders), we need to preserve
// any incoming ?index params
if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {
searchParams.append("index", "");
}
parsedPath.search = "?" + searchParams;
} catch (e) {
return {
path,
error: new ErrorResponse(400, "Bad Request", "Cannot submit binary form data using GET")
};
}
return {
path: createPath(parsedPath)
};
}
function getLoaderRedirect(state, redirect) {
let {
formMethod,
formAction,
formEncType,
formData
} = state.navigation;
let navigation = {
state: "loading",
location: createLocation(state.location, redirect.location),
formMethod: formMethod || undefined,
formAction: formAction || undefined,
formEncType: formEncType || undefined,
formData: formData || undefined
};
return navigation;
} // Filter out all routes below any caught error as they aren't going to
// render so we don't need to load them
function getLoaderMatchesUntilBoundary(matches, boundaryId) {
let boundaryMatches = matches;
if (boundaryId) {
let index = matches.findIndex(m => m.route.id === boundaryId);
if (index >= 0) {
boundaryMatches = matches.slice(0, index);
}
}
return boundaryMatches;
}
function getMatchesToLoad(state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, pendingActionData, pendingError, fetchLoadMatches) {
let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : null; // Pick navigation matches that are net-new or qualify for revalidation
let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;
let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);
let navigationMatches = boundaryMatches.filter((match, index) => match.route.loader != null && (isNewLoader(state.loaderData, state.matches[index], match) || // If this route had a pending deferred cancelled it must be revalidated
cancelledDeferredRoutes.some(id => id === match.route.id) || shouldRevalidateLoader(state.location, state.matches[index], submission, location, match, isRevalidationRequired, actionResult))); // Pick fetcher.loads that need to be revalidated
let revalidatingFetchers = [];
fetchLoadMatches && fetchLoadMatches.forEach((_ref10, key) => {
let [href, match] = _ref10;
// This fetcher was cancelled from a prior action submission - force reload
if (cancelledFetcherLoads.includes(key)) {
revalidatingFetchers.push([key, href, match]);
} else if (isRevalidationRequired) {
let shouldRevalidate = shouldRevalidateLoader(href, match, submission, href, match, isRevalidationRequired, actionResult);
if (shouldRevalidate) {
revalidatingFetchers.push([key, href, match]);
}
}
});
return [navigationMatches, revalidatingFetchers];
}
function isNewLoader(currentLoaderData, currentMatch, match) {
let isNew = // [a] -> [a, b]
!currentMatch || // [a, b] -> [a, c]
match.route.id !== currentMatch.route.id; // Handle the case that we don't have data for a re-used route, potentially
// from a prior error or from a cancelled pending deferred
let isMissingData = currentLoaderData[match.route.id] === undefined; // Always load if this is a net-new route or we don't yet have data
return isNew || isMissingData;
}
function isNewRouteInstance(currentMatch, match) {
let currentPath = currentMatch.route.path;
return (// param change for this match, /users/123 -> /users/456
currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path
// e.g. /files/images/avatar.jpg -> files/finances.xls
currentPath && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"]
);
}
function shouldRevalidateLoader(currentLocation, currentMatch, submission, location, match, isRevalidationRequired, actionResult) {
let currentUrl = createURL(currentLocation);
let currentParams = currentMatch.params;
let nextUrl = createURL(location);
let nextParams = match.params; // This is the default implementation as to when we revalidate. If the route
// provides it's own implementation, then we give them full control but
// provide this value so they can leverage it if needed after they check
// their own specific use cases
// Note that fetchers always provide the same current/next locations so the
// URL-based checks here don't apply to fetcher shouldRevalidate calls
let defaultShouldRevalidate = isNewRouteInstance(currentMatch, match) || // Clicked the same link, resubmitted a GET form
currentUrl.toString() === nextUrl.toString() || // Search params affect all loaders
currentUrl.search !== nextUrl.search || // Forced revalidation due to submission, useRevalidate, or X-Remix-Revalidate
isRevalidationRequired;
if (match.route.shouldRevalidate) {
let routeChoice = match.route.shouldRevalidate(_extends({
currentUrl,
currentParams,
nextUrl,
nextParams
}, submission, {
actionResult,
defaultShouldRevalidate
}));
if (typeof routeChoice === "boolean") {
return routeChoice;
}
}
return defaultShouldRevalidate;
}
async function callLoaderOrAction(type, request, match, skipRedirects, isRouteRequest) {
if (skipRedirects === void 0) {
skipRedirects = false;
}
if (isRouteRequest === void 0) {
isRouteRequest = false;
}
let resultType;
let result; // Setup a promise we can race against so that abort signals short circuit
let reject;
let abortPromise = new Promise((_, r) => reject = r);
let onReject = () => reject();
request.signal.addEventListener("abort", onReject);
try {
let handler = match.route[type];
invariant(handler, "Could not find the " + type + " to run on the \"" + match.route.id + "\" route");
result = await Promise.race([handler({
request,
params: match.params
}), abortPromise]);
} catch (e) {
resultType = ResultType.error;
result = e;
} finally {
request.signal.removeEventListener("abort", onReject);
}
if (result instanceof Response) {
// Process redirects
let status = result.status;
let location = result.headers.get("Location"); // For SSR single-route requests, we want to hand Responses back directly
// without unwrapping
if (isRouteRequest) {
throw result;
}
if (status >= 300 && status <= 399 && location != null) {
// Don't process redirects in the router during SSR document requests.
// Instead, throw the Response and let the server handle it with an HTTP
// redirect
if (skipRedirects) {
throw result;
}
return {
type: ResultType.redirect,
status,
location,
revalidate: result.headers.get("X-Remix-Revalidate") !== null
};
}
let data;
let contentType = result.headers.get("Content-Type");
if (contentType && contentType.startsWith("application/json")) {
data = await result.json();
} else {
data = await result.text();
}
if (resultType === ResultType.error) {
return {
type: resultType,
error: new ErrorResponse(status, result.statusText, data),
headers: result.headers
};
}
return {
type: ResultType.data,
data,
statusCode: result.status,
headers: result.headers
};
}
if (resultType === ResultType.error) {
return {
type: resultType,
error: result
};
}
if (result instanceof DeferredData) {
return {
type: ResultType.deferred,
deferredData: result
};
}
return {
type: ResultType.data,
data: result
};
}
function createRequest(location, signal, submission) {
let url = createURL(location).toString();
let init = {
signal
};
if (submission) {
let {
formMethod,
formEncType,
formData
} = submission;
init.method = formMethod.toUpperCase();
init.body = formEncType === "application/x-www-form-urlencoded" ? convertFormDataToSearchParams(formData) : formData;
} // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)
return new Request(url, init);
}
function convertFormDataToSearchParams(formData) {
let searchParams = new URLSearchParams();
for (let [key, value] of formData.entries()) {
invariant(typeof value === "string", 'File inputs are not supported with encType "application/x-www-form-urlencoded", ' + 'please use "multipart/form-data" instead.');
searchParams.append(key, value);
}
return searchParams;
}
function processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds) {
// Fill in loaderData/errors from our loaders
let loaderData = {};
let errors = null;
let statusCode;
let foundError = false;
let loaderHeaders = {}; // Process loader results into state.loaderData/state.errors
results.forEach((result, index) => {
let id = matchesToLoad[index].route.id;
invariant(!isRedirectResult(result), "Cannot handle redirect results in processLoaderData");
if (isErrorResult(result)) {
// Look upwards from the matched route for the closest ancestor
// error boundary, defaulting to the root match
let boundaryMatch = findNearestBoundary(matches, id);
let error = result.error; // If we have a pending action error, we report it at the highest-route
// that throws a loader error, and then clear it out to indicate that
// it was consumed
if (pendingError) {
error = Object.values(pendingError)[0];
pendingError = undefined;
}
errors = Object.assign(errors || {}, {
[boundaryMatch.route.id]: error
}); // Once we find our first (highest) error, we set the status code and
// prevent deeper status codes from overriding
if (!foundError) {
foundError = true;
statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;
}
if (result.headers) {
loaderHeaders[id] = result.headers;
}
} else if (isDeferredResult(result)) {
activeDeferreds && activeDeferreds.set(id, result.deferredData);
loaderData[id] = result.deferredData.data; // TODO: Add statusCode/headers once we wire up streaming in Remix
} else {
loaderData[id] = result.data; // Error status codes always override success status codes, but if all
// loaders are successful we take the deepest status code.
if (result.statusCode != null && result.statusCode !== 200 && !foundError) {
statusCode = result.statusCode;
}
if (result.headers) {
loaderHeaders[id] = result.headers;
}
}
}); // If we didn't consume the pending action error (i.e., all loaders
// resolved), then consume it here
if (pendingError) {
errors = pendingError;
}
return {
loaderData,
errors,
statusCode: statusCode || 200,
loaderHeaders
};
}
function processLoaderData(state, matches, matchesToLoad, results, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds) {
let {
loaderData,
errors
} = processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds); // Process results from our revalidating fetchers
for (let index = 0; index < revalidatingFetchers.length; index++) {
let [key,, match] = revalidatingFetchers[index];
invariant(fetcherResults !== undefined && fetcherResults[index] !== undefined, "Did not find corresponding fetcher result");
let result = fetcherResults[index]; // Process fetcher non-redirect errors
if (isErrorResult(result)) {
let boundaryMatch = findNearestBoundary(state.matches, match.route.id);
if (!(errors && errors[boundaryMatch.route.id])) {
errors = _extends({}, errors, {
[boundaryMatch.route.id]: result.error
});
}
state.fetchers.delete(key);
} else if (isRedirectResult(result)) {
// Should never get here, redirects should get processed above, but we
// keep this to type narrow to a success result in the else
throw new Error("Unhandled fetcher revalidation redirect");
} else if (isDeferredResult(result)) {
// Should never get here, deferred data should be awaited for fetchers
// in resolveDeferredResults
throw new Error("Unhandled fetcher deferred data");
} else {
let doneFetcher = {
state: "idle",
data: result.data,
formMethod: undefined,
formAction: undefined,
formEncType: undefined,
formData: undefined
};
state.fetchers.set(key, doneFetcher);
}
}
return {
loaderData,
errors
};
}
function mergeLoaderData(loaderData, newLoaderData, matches) {
let mergedLoaderData = _extends({}, newLoaderData);
matches.forEach(match => {
let id = match.route.id;
if (newLoaderData[id] === undefined && loaderData[id] !== undefined) {
mergedLoaderData[id] = loaderData[id];
}
});
return mergedLoaderData;
} // Find the nearest error boundary, looking upwards from the leaf route (or the
// route specified by routeId) for the closest ancestor error boundary,
// defaulting to the root match
function findNearestBoundary(matches, routeId) {
let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches];
return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0];
}
function getNotFoundMatches(routes) {
// Prefer a root layout route if present, otherwise shim in a route object
let route = routes.find(r => r.index || r.path === "" || r.path === "/") || {
id: "__shim-404-route__"
};
return {
matches: [{
params: {},
pathname: "",
pathnameBase: "",
route
}],
route,
error: new ErrorResponse(404, "Not Found", null)
};
}
function getMethodNotAllowedResult(path) {
let href = typeof path === "string" ? path : createHref(path);
console.warn("You're trying to submit to a route that does not have an action. To " + "fix this, please add an `action` function to the route for " + ("[" + href + "]"));
return {
type: ResultType.error,
error: new ErrorResponse(405, "Method Not Allowed", "No action found for [" + href + "]")
};
} // Find any returned redirect errors, starting from the lowest match
function findRedirect(results) {
for (let i = results.length - 1; i >= 0; i--) {
let result = results[i];
if (isRedirectResult(result)) {
return result;
}
}
} // Create an href to represent a "server" URL without the hash
function createHref(location) {
return (location.pathname || "") + (location.search || "");
}
function isHashChangeOnly(a, b) {
return a.pathname === b.pathname && a.search === b.search && a.hash !== b.hash;
}
function isDeferredResult(result) {
return result.type === ResultType.deferred;
}
function isErrorResult(result) {
return result.type === ResultType.error;
}
function isRedirectResult(result) {
return (result && result.type) === ResultType.redirect;
}
async function resolveDeferredResults(currentMatches, matchesToLoad, results, signal, isFetcher, currentLoaderData) {
for (let index = 0; index < results.length; index++) {
let result = results[index];
let match = matchesToLoad[index];
let currentMatch = currentMatches.find(m => m.route.id === match.route.id);
let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;
if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {
// Note: we do not have to touch activeDeferreds here since we race them
// against the signal in resolveDeferredData and they'll get aborted
// there if needed
await resolveDeferredData(result, signal, isFetcher).then(result => {
if (result) {
results[index] = result || results[index];
}
});
}
}
}
async function resolveDeferredData(result, signal, unwrap) {
if (unwrap === void 0) {
unwrap = false;
}
let aborted = await result.deferredData.resolveData(signal);
if (aborted) {
return;
}
if (unwrap) {
try {
return {
type: ResultType.data,
data: result.deferredData.unwrappedData
};
} catch (e) {
// Handle any TrackedPromise._error values encountered while unwrapping
return {
type: ResultType.error,
error: e
};
}
}
return {
type: ResultType.data,
data: result.deferredData.data
};
}
function hasNakedIndexQuery(search) {
return new URLSearchParams(search).getAll("index").some(v => v === "");
} // Note: This should match the format exported by useMatches, so if you change
// this please also change that :) Eventually we'll DRY this up
function createUseMatchesMatch(match, loaderData) {
let {
route,
pathname,
params
} = match;
return {
id: route.id,
pathname,
params,
data: loaderData[route.id],
handle: route.handle
};
}
function getTargetMatch(matches, location) {
let search = typeof location === "string" ? parsePath(location).search : location.search;
if (matches[matches.length - 1].route.index && !hasNakedIndexQuery(search || "")) {
return matches.slice(-2)[0];
}
return matches.slice(-1)[0];
}
function createURL(location) {
let base = typeof window !== "undefined" && typeof window.location !== "undefined" ? window.location.origin : "unknown://unknown";
let href = typeof location === "string" ? location : createHref(location);
return new URL(href, base);
} //#endregion
export { AbortedDeferredError, Action, ErrorResponse, IDLE_FETCHER, IDLE_NAVIGATION, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, createRouter, defer, generatePath, getStaticContextFromError, getToPathname, invariant, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, parsePath, redirect, resolvePath, resolveTo, stripBasename, unstable_createStaticHandler, warning };
//# sourceMappingURL=router.js.map
webpack://frontend-tpt/../../node_modules/react-redux/es/index.js
import Provider from './components/Provider';
import connectAdvanced from './components/connectAdvanced';
import { ReactReduxContext } from './components/Context';
import connect from './connect/connect';
import { useDispatch, createDispatchHook } from './hooks/useDispatch';
import { useSelector, createSelectorHook } from './hooks/useSelector';
import { useStore, createStoreHook } from './hooks/useStore';
import { setBatch } from './utils/batch';
import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';
import shallowEqual from './utils/shallowEqual';
setBatch(batch);
export { Provider, connectAdvanced, ReactReduxContext, connect, batch, useDispatch, createDispatchHook, useSelector, createSelectorHook, useStore, createStoreHook, shallowEqual };
webpack://frontend-tpt/../../node_modules/react-router/dist/index.js
/**
* React Router v6.4.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
import { invariant, resolveTo, joinPaths, matchPath, warning, parsePath, matchRoutes, Action, isRouteErrorResponse, createMemoryHistory, stripBasename, AbortedDeferredError, createRouter } from '@remix-run/router';
export { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, resolvePath } from '@remix-run/router';
import * as React from 'react';
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
function isPolyfill(x, y) {
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
;
}
const is = typeof Object.is === "function" ? Object.is : isPolyfill; // Intentionally not using named imports because Rollup uses dynamic
// dispatch for CommonJS interop named imports.
const {
useState,
useEffect,
useLayoutEffect,
useDebugValue
} = React;
let didWarnOld18Alpha = false;
let didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
// because of a very particular set of implementation details and assumptions
// -- change any one of them and it will break. The most important assumption
// is that updates are always synchronous, because concurrent rendering is
// only available in versions of React that also have a built-in
// useSyncExternalStore API. And we only use this shim when the built-in API
// does not exist.
//
// Do not assume that the clever hacks used by this hook also work in general.
// The point of this shim is to replace the need for hacks by other libraries.
function useSyncExternalStore$2(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
// React do not expose a way to check if we're hydrating. So users of the shim
// will need to track that themselves and return the correct value
// from `getSnapshot`.
getServerSnapshot) {
if (process.env.NODE_ENV !== "production") {
if (!didWarnOld18Alpha) {
if ("startTransition" in React) {
didWarnOld18Alpha = true;
console.error("You are using an outdated, pre-release alpha of React 18 that " + "does not support useSyncExternalStore. The " + "use-sync-external-store shim will not work correctly. Upgrade " + "to a newer pre-release.");
}
}
} // Read the current snapshot from the store on every render. Again, this
// breaks the rules of React, and only works here because of specific
// implementation details, most importantly that updates are
// always synchronous.
const value = getSnapshot();
if (process.env.NODE_ENV !== "production") {
if (!didWarnUncachedGetSnapshot) {
const cachedValue = getSnapshot();
if (!is(value, cachedValue)) {
console.error("The result of getSnapshot should be cached to avoid an infinite loop");
didWarnUncachedGetSnapshot = true;
}
}
} // Because updates are synchronous, we don't queue them. Instead we force a
// re-render whenever the subscribed state changes by updating an some
// arbitrary useState hook. Then, during render, we call getSnapshot to read
// the current value.
//
// Because we don't actually use the state returned by the useState hook, we
// can save a bit of memory by storing other stuff in that slot.
//
// To implement the early bailout, we need to track some things on a mutable
// object. Usually, we would put that in a useRef hook, but we can stash it in
// our useState hook instead.
//
// To force a re-render, we call forceUpdate({inst}). That works because the
// new object always fails an equality check.
const [{
inst
}, forceUpdate] = useState({
inst: {
value,
getSnapshot
}
}); // Track the latest getSnapshot function with a ref. This needs to be updated
// in the layout phase so we can access it during the tearing check that
// happens on subscribe.
useLayoutEffect(() => {
inst.value = value;
inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
// commit phase if there was an interleaved mutation. In concurrent mode
// this can happen all the time, but even in synchronous mode, an earlier
// effect may have mutated the store.
if (checkIfSnapshotChanged(inst)) {
// Force a re-render.
forceUpdate({
inst
});
} // eslint-disable-next-line react-hooks/exhaustive-deps
}, [subscribe, value, getSnapshot]);
useEffect(() => {
// Check for changes right before subscribing. Subsequent changes will be
// detected in the subscription handler.
if (checkIfSnapshotChanged(inst)) {
// Force a re-render.
forceUpdate({
inst
});
}
const handleStoreChange = () => {
// TODO: Because there is no cross-renderer API for batching updates, it's
// up to the consumer of this library to wrap their subscription event
// with unstable_batchedUpdates. Should we try to detect when this isn't
// the case and print a warning in development?
// The store changed. Check if the snapshot changed since the last time we
// read from the store.
if (checkIfSnapshotChanged(inst)) {
// Force a re-render.
forceUpdate({
inst
});
}
}; // Subscribe to the store and return a clean-up function.
return subscribe(handleStoreChange); // eslint-disable-next-line react-hooks/exhaustive-deps
}, [subscribe]);
useDebugValue(value);
return value;
}
function checkIfSnapshotChanged(inst) {
const latestGetSnapshot = inst.getSnapshot;
const prevValue = inst.value;
try {
const nextValue = latestGetSnapshot();
return !is(prevValue, nextValue);
} catch (error) {
return true;
}
}
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
// Note: The shim does not use getServerSnapshot, because pre-18 versions of
// React do not expose a way to check if we're hydrating. So users of the shim
// will need to track that themselves and return the correct value
// from `getSnapshot`.
return getSnapshot();
}
/**
* Inlined into the react-router repo since use-sync-external-store does not
* provide a UMD-compatible package, so we need this to be able to distribute
* UMD react-router bundles
*/
const canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
const isServerEnvironment = !canUseDOM;
const shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore$2;
const useSyncExternalStore = "useSyncExternalStore" in React ? (module => module.useSyncExternalStore)(React) : shim;
// Contexts for data routers
const DataStaticRouterContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== "production") {
DataStaticRouterContext.displayName = "DataStaticRouterContext";
}
const DataRouterContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== "production") {
DataRouterContext.displayName = "DataRouter";
}
const DataRouterStateContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== "production") {
DataRouterStateContext.displayName = "DataRouterState";
}
const AwaitContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== "production") {
AwaitContext.displayName = "Await";
}
const NavigationContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== "production") {
NavigationContext.displayName = "Navigation";
}
const LocationContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== "production") {
LocationContext.displayName = "Location";
}
const RouteContext = /*#__PURE__*/React.createContext({
outlet: null,
matches: []
});
if (process.env.NODE_ENV !== "production") {
RouteContext.displayName = "Route";
}
const RouteErrorContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== "production") {
RouteErrorContext.displayName = "RouteError";
}
/**
* Returns the full href for the given "to" value. This is useful for building
* custom links that are also accessible and preserve right-click behavior.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-href
*/
function useHref(to, _temp) {
let {
relative
} = _temp === void 0 ? {} : _temp;
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useHref() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
let {
basename,
navigator
} = React.useContext(NavigationContext);
let {
hash,
pathname,
search
} = useResolvedPath(to, {
relative
});
let joinedPathname = pathname; // If we're operating within a basename, prepend it to the pathname prior
// to creating the href. If this is a root navigation, then just use the raw
// basename which allows the basename to have full control over the presence
// of a trailing slash on root links
if (basename !== "/") {
joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
}
return navigator.createHref({
pathname: joinedPathname,
search,
hash
});
}
/**
* Returns true if this component is a descendant of a <Router>.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-in-router-context
*/
function useInRouterContext() {
return React.useContext(LocationContext) != null;
}
/**
* Returns the current location object, which represents the current URL in web
* browsers.
*
* Note: If you're using this it may mean you're doing some of your own
* "routing" in your app, and we'd like to know what your use case is. We may
* be able to provide something higher-level to better suit your needs.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-location
*/
function useLocation() {
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useLocation() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
return React.useContext(LocationContext).location;
}
/**
* Returns the current navigation action which describes how the router came to
* the current location, either by a pop, push, or replace on the history stack.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-navigation-type
*/
function useNavigationType() {
return React.useContext(LocationContext).navigationType;
}
/**
* Returns true if the URL for the given "to" value matches the current URL.
* This is useful for components that need to know "active" state, e.g.
* <NavLink>.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-match
*/
function useMatch(pattern) {
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useMatch() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
let {
pathname
} = useLocation();
return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]);
}
/**
* The interface for the navigate() function returned from useNavigate().
*/
/**
* When processing relative navigation we want to ignore ancestor routes that
* do not contribute to the path, such that index/pathless layout routes don't
* interfere.
*
* For example, when moving a route element into an index route and/or a
* pathless layout route, relative link behavior contained within should stay
* the same. Both of the following examples should link back to the root:
*
* <Route path="/">
* <Route path="accounts" element={<Link to=".."}>
* </Route>
*
* <Route path="/">
* <Route path="accounts">
* <Route element={<AccountsLayout />}> // <-- Does not contribute
* <Route index element={<Link to=".."} /> // <-- Does not contribute
* </Route
* </Route>
* </Route>
*/
function getPathContributingMatches(matches) {
return matches.filter((match, index) => index === 0 || !match.route.index && match.pathnameBase !== matches[index - 1].pathnameBase);
}
/**
* Returns an imperative method for changing the location. Used by <Link>s, but
* may also be used by other elements to change the location.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-navigate
*/
function useNavigate() {
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useNavigate() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
let {
basename,
navigator
} = React.useContext(NavigationContext);
let {
matches
} = React.useContext(RouteContext);
let {
pathname: locationPathname
} = useLocation();
let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map(match => match.pathnameBase));
let activeRef = React.useRef(false);
React.useEffect(() => {
activeRef.current = true;
});
let navigate = React.useCallback(function (to, options) {
if (options === void 0) {
options = {};
}
process.env.NODE_ENV !== "production" ? warning(activeRef.current, "You should call navigate() in a React.useEffect(), not when " + "your component is first rendered.") : void 0;
if (!activeRef.current) return;
if (typeof to === "number") {
navigator.go(to);
return;
}
let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path"); // If we're operating within a basename, prepend it to the pathname prior
// to handing off to history. If this is a root navigation, then we
// navigate to the raw basename which allows the basename to have full
// control over the presence of a trailing slash on root links
if (basename !== "/") {
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
}
(!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);
}, [basename, navigator, routePathnamesJson, locationPathname]);
return navigate;
}
const OutletContext = /*#__PURE__*/React.createContext(null);
/**
* Returns the context (if provided) for the child route at this level of the route
* hierarchy.
* @see https://reactrouter.com/docs/en/v6/hooks/use-outlet-context
*/
function useOutletContext() {
return React.useContext(OutletContext);
}
/**
* Returns the element for the child route at this level of the route
* hierarchy. Used internally by <Outlet> to render child routes.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-outlet
*/
function useOutlet(context) {
let outlet = React.useContext(RouteContext).outlet;
if (outlet) {
return /*#__PURE__*/React.createElement(OutletContext.Provider, {
value: context
}, outlet);
}
return outlet;
}
/**
* Returns an object of key/value pairs of the dynamic params from the current
* URL that were matched by the route path.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-params
*/
function useParams() {
let {
matches
} = React.useContext(RouteContext);
let routeMatch = matches[matches.length - 1];
return routeMatch ? routeMatch.params : {};
}
/**
* Resolves the pathname of the given `to` value against the current location.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-resolved-path
*/
function useResolvedPath(to, _temp2) {
let {
relative
} = _temp2 === void 0 ? {} : _temp2;
let {
matches
} = React.useContext(RouteContext);
let {
pathname: locationPathname
} = useLocation();
let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map(match => match.pathnameBase));
return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
}
/**
* Returns the element of the route that matched the current location, prepared
* with the correct context to render the remainder of the route tree. Route
* elements in the tree must render an <Outlet> to render their child route's
* element.
*
* @see https://reactrouter.com/docs/en/v6/hooks/use-routes
*/
function useRoutes(routes, locationArg) {
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
// router loaded. We can help them understand how to avoid that.
"useRoutes() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
let dataRouterStateContext = React.useContext(DataRouterStateContext);
let {
matches: parentMatches
} = React.useContext(RouteContext);
let routeMatch = parentMatches[parentMatches.length - 1];
let parentParams = routeMatch ? routeMatch.params : {};
let parentPathname = routeMatch ? routeMatch.pathname : "/";
let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
let parentRoute = routeMatch && routeMatch.route;
if (process.env.NODE_ENV !== "production") {
// You won't get a warning about 2 different <Routes> under a <Route>
// without a trailing *, but this is a best-effort warning anyway since we
// cannot even give the warning unless they land at the parent route.
//
// Example:
//
// <Routes>
// {/* This route path MUST end with /* because otherwise
// it will never match /blog/post/123 */}
// <Route path="blog" element={<Blog />} />
// <Route path="blog/feed" element={<BlogFeed />} />
// </Routes>
//
// function Blog() {
// return (
// <Routes>
// <Route path="post/:id" element={<Post />} />
// </Routes>
// );
// }
let parentPath = parentRoute && parentRoute.path || "";
warningOnce(parentPathname, !parentRoute || parentPath.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ("\"" + parentPathname + "\" (under <Route path=\"" + parentPath + "\">) but the ") + "parent route path has no trailing \"*\". This means if you navigate " + "deeper, the parent won't match anymore and therefore the child " + "routes will never render.\n\n" + ("Please change the parent <Route path=\"" + parentPath + "\"> to <Route ") + ("path=\"" + (parentPath === "/" ? "*" : parentPath + "/*") + "\">."));
}
let locationFromContext = useLocation();
let location;
if (locationArg) {
var _parsedLocationArg$pa;
let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
!(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? process.env.NODE_ENV !== "production" ? invariant(false, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, " + "the location pathname must begin with the portion of the URL pathname that was " + ("matched by all parent routes. The current pathname base is \"" + parentPathnameBase + "\" ") + ("but pathname \"" + parsedLocationArg.pathname + "\" was given in the `location` prop.")) : invariant(false) : void 0;
location = parsedLocationArg;
} else {
location = locationFromContext;
}
let pathname = location.pathname || "/";
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
let matches = matchRoutes(routes, {
pathname: remainingPathname
});
if (process.env.NODE_ENV !== "production") {
process.env.NODE_ENV !== "production" ? warning(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") : void 0;
process.env.NODE_ENV !== "production" ? warning(matches == null || matches[matches.length - 1].route.element !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" does not have an element. " + "This means it will render an <Outlet /> with a null value by default resulting in an \"empty\" page.") : void 0;
}
let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {
params: Object.assign({}, parentParams, match.params),
pathname: joinPaths([parentPathnameBase, match.pathname]),
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([parentPathnameBase, match.pathnameBase])
})), parentMatches, dataRouterStateContext || undefined); // When a user passes in a `locationArg`, the associated routes need to
// be wrapped in a new `LocationContext.Provider` in order for `useLocation`
// to use the scoped location instead of the global location.
if (locationArg) {
return /*#__PURE__*/React.createElement(LocationContext.Provider, {
value: {
location: _extends({
pathname: "/",
search: "",
hash: "",
state: null,
key: "default"
}, location),
navigationType: Action.Pop
}
}, renderedMatches);
}
return renderedMatches;
}
function DefaultErrorElement() {
let error = useRouteError();
let message = isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);
let stack = error instanceof Error ? error.stack : null;
let lightgrey = "rgba(200,200,200, 0.5)";
let preStyles = {
padding: "0.5rem",
backgroundColor: lightgrey
};
let codeStyles = {
padding: "2px 4px",
backgroundColor: lightgrey
};
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h2", null, "Unhandled Thrown Error!"), /*#__PURE__*/React.createElement("h3", {
style: {
fontStyle: "italic"
}
}, message), stack ? /*#__PURE__*/React.createElement("pre", {
style: preStyles
}, stack) : null, /*#__PURE__*/React.createElement("p", null, "\uD83D\uDCBF Hey developer \uD83D\uDC4B"), /*#__PURE__*/React.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own\xA0", /*#__PURE__*/React.createElement("code", {
style: codeStyles
}, "errorElement"), " props on\xA0", /*#__PURE__*/React.createElement("code", {
style: codeStyles
}, "<Route>")));
}
class RenderErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = {
location: props.location,
error: props.error
};
}
static getDerivedStateFromError(error) {
return {
error: error
};
}
static getDerivedStateFromProps(props, state) {
// When we get into an error state, the user will likely click "back" to the
// previous page that didn't have an error. Because this wraps the entire
// application, that will have no effect--the error page continues to display.
// This gives us a mechanism to recover from the error when the location changes.
//
// Whether we're in an error state or not, we update the location in state
// so that when we are in an error state, it gets reset when a new location
// comes in and the user recovers from the error.
if (state.location !== props.location) {
return {
error: props.error,
location: props.location
};
} // If we're not changing locations, preserve the location but still surface
// any new errors that may come through. We retain the existing error, we do
// this because the error provided from the app state may be cleared without
// the location changing.
return {
error: props.error || state.error,
location: state.location
};
}
componentDidCatch(error, errorInfo) {
console.error("React Router caught the following error during render", error, errorInfo);
}
render() {
return this.state.error ? /*#__PURE__*/React.createElement(RouteErrorContext.Provider, {
value: this.state.error,
children: this.props.component
}) : this.props.children;
}
}
function RenderedRoute(_ref) {
let {
routeContext,
match,
children
} = _ref;
let dataStaticRouterContext = React.useContext(DataStaticRouterContext); // Track how deep we got in our render pass to emulate SSR componentDidCatch
// in a DataStaticRouter
if (dataStaticRouterContext && match.route.errorElement) {
dataStaticRouterContext._deepestRenderedBoundaryId = match.route.id;
}
return /*#__PURE__*/React.createElement(RouteContext.Provider, {
value: routeContext
}, children);
}
function _renderMatches(matches, parentMatches, dataRouterState) {
if (parentMatches === void 0) {
parentMatches = [];
}
if (matches == null) {
if (dataRouterState != null && dataRouterState.errors) {
// Don't bail if we have data router errors so we can render them in the
// boundary. Use the pre-matched (or shimmed) matches
matches = dataRouterState.matches;
} else {
return null;
}
}
let renderedMatches = matches; // If we have data errors, trim matches to the highest error boundary
let errors = dataRouterState == null ? void 0 : dataRouterState.errors;
if (errors != null) {
let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]));
!(errorIndex >= 0) ? process.env.NODE_ENV !== "production" ? invariant(false, "Could not find a matching route for the current errors: " + errors) : invariant(false) : void 0;
renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));
}
return renderedMatches.reduceRight((outlet, match, index) => {
let error = match.route.id ? errors == null ? void 0 : errors[match.route.id] : null; // Only data routers handle errors
let errorElement = dataRouterState ? match.route.errorElement || /*#__PURE__*/React.createElement(DefaultErrorElement, null) : null;
let getChildren = () => /*#__PURE__*/React.createElement(RenderedRoute, {
match: match,
routeContext: {
outlet,
matches: parentMatches.concat(renderedMatches.slice(0, index + 1))
}
}, error ? errorElement : match.route.element !== undefined ? match.route.element : outlet); // Only wrap in an error boundary within data router usages when we have an
// errorElement on this route. Otherwise let it bubble up to an ancestor
// errorElement
return dataRouterState && (match.route.errorElement || index === 0) ? /*#__PURE__*/React.createElement(RenderErrorBoundary, {
location: dataRouterState.location,
component: errorElement,
error: error,
children: getChildren()
}) : getChildren();
}, null);
}
var DataRouterHook;
(function (DataRouterHook) {
DataRouterHook["UseRevalidator"] = "useRevalidator";
})(DataRouterHook || (DataRouterHook = {}));
var DataRouterStateHook;
(function (DataRouterStateHook) {
DataRouterStateHook["UseLoaderData"] = "useLoaderData";
DataRouterStateHook["UseActionData"] = "useActionData";
DataRouterStateHook["UseRouteError"] = "useRouteError";
DataRouterStateHook["UseNavigation"] = "useNavigation";
DataRouterStateHook["UseRouteLoaderData"] = "useRouteLoaderData";
DataRouterStateHook["UseMatches"] = "useMatches";
DataRouterStateHook["UseRevalidator"] = "useRevalidator";
})(DataRouterStateHook || (DataRouterStateHook = {}));
function getDataRouterConsoleError(hookName) {
return hookName + " must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.";
}
function useDataRouterContext(hookName) {
let ctx = React.useContext(DataRouterContext);
!ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
return ctx;
}
function useDataRouterState(hookName) {
let state = React.useContext(DataRouterStateContext);
!state ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
return state;
}
/**
* Returns the current navigation, defaulting to an "idle" navigation when
* no navigation is in progress
*/
function useNavigation() {
let state = useDataRouterState(DataRouterStateHook.UseNavigation);
return state.navigation;
}
/**
* Returns a revalidate function for manually triggering revalidation, as well
* as the current state of any manual revalidations
*/
function useRevalidator() {
let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);
let state = useDataRouterState(DataRouterStateHook.UseRevalidator);
return {
revalidate: dataRouterContext.router.revalidate,
state: state.revalidation
};
}
/**
* Returns the active route matches, useful for accessing loaderData for
* parent/child routes or the route "handle" property
*/
function useMatches() {
let {
matches,
loaderData
} = useDataRouterState(DataRouterStateHook.UseMatches);
return React.useMemo(() => matches.map(match => {
let {
pathname,
params
} = match; // Note: This structure matches that created by createUseMatchesMatch
// in the @remix-run/router , so if you change this please also change
// that :) Eventually we'll DRY this up
return {
id: match.route.id,
pathname,
params,
data: loaderData[match.route.id],
handle: match.route.handle
};
}), [matches, loaderData]);
}
/**
* Returns the loader data for the nearest ancestor Route loader
*/
function useLoaderData() {
let state = useDataRouterState(DataRouterStateHook.UseLoaderData);
let route = React.useContext(RouteContext);
!route ? process.env.NODE_ENV !== "production" ? invariant(false, "useLoaderData must be used inside a RouteContext") : invariant(false) : void 0;
let thisRoute = route.matches[route.matches.length - 1];
!thisRoute.route.id ? process.env.NODE_ENV !== "production" ? invariant(false, "useLoaderData can only be used on routes that contain a unique \"id\"") : invariant(false) : void 0;
return state.loaderData[thisRoute.route.id];
}
/**
* Returns the loaderData for the given routeId
*/
function useRouteLoaderData(routeId) {
let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);
return state.loaderData[routeId];
}
/**
* Returns the action data for the nearest ancestor Route action
*/
function useActionData() {
let state = useDataRouterState(DataRouterStateHook.UseActionData);
let route = React.useContext(RouteContext);
!route ? process.env.NODE_ENV !== "production" ? invariant(false, "useActionData must be used inside a RouteContext") : invariant(false) : void 0;
return Object.values((state == null ? void 0 : state.actionData) || {})[0];
}
/**
* Returns the nearest ancestor Route error, which could be a loader/action
* error or a render error. This is intended to be called from your
* errorElement to display a proper error message.
*/
function useRouteError() {
var _state$errors;
let error = React.useContext(RouteErrorContext);
let state = useDataRouterState(DataRouterStateHook.UseRouteError);
let route = React.useContext(RouteContext);
let thisRoute = route.matches[route.matches.length - 1]; // If this was a render error, we put it in a RouteError context inside
// of RenderErrorBoundary
if (error) {
return error;
}
!route ? process.env.NODE_ENV !== "production" ? invariant(false, "useRouteError must be used inside a RouteContext") : invariant(false) : void 0;
!thisRoute.route.id ? process.env.NODE_ENV !== "production" ? invariant(false, "useRouteError can only be used on routes that contain a unique \"id\"") : invariant(false) : void 0; // Otherwise look for errors from our data router state
return (_state$errors = state.errors) == null ? void 0 : _state$errors[thisRoute.route.id];
}
/**
* Returns the happy-path data from the nearest ancestor <Await /> value
*/
function useAsyncValue() {
let value = React.useContext(AwaitContext);
return value == null ? void 0 : value._data;
}
/**
* Returns the error from the nearest ancestor <Await /> value
*/
function useAsyncError() {
let value = React.useContext(AwaitContext);
return value == null ? void 0 : value._error;
}
const alreadyWarned = {};
function warningOnce(key, cond, message) {
if (!cond && !alreadyWarned[key]) {
alreadyWarned[key] = true;
process.env.NODE_ENV !== "production" ? warning(false, message) : void 0;
}
}
/**
* Given a Remix Router instance, render the appropriate UI
*/
function RouterProvider(_ref) {
let {
fallbackElement,
router
} = _ref;
// Sync router state to our component state to force re-renders
let state = useSyncExternalStore(router.subscribe, () => router.state, // We have to provide this so React@18 doesn't complain during hydration,
// but we pass our serialized hydration data into the router so state here
// is already synced with what the server saw
() => router.state);
let navigator = React.useMemo(() => {
return {
createHref: router.createHref,
go: n => router.navigate(n),
push: (to, state, opts) => router.navigate(to, {
state,
preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
}),
replace: (to, state, opts) => router.navigate(to, {
replace: true,
state,
preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
})
};
}, [router]);
let basename = router.basename || "/";
return /*#__PURE__*/React.createElement(DataRouterContext.Provider, {
value: {
router,
navigator,
static: false,
// Do we need this?
basename
}
}, /*#__PURE__*/React.createElement(DataRouterStateContext.Provider, {
value: state
}, /*#__PURE__*/React.createElement(Router, {
basename: router.basename,
location: router.state.location,
navigationType: router.state.historyAction,
navigator: navigator
}, router.state.initialized ? /*#__PURE__*/React.createElement(Routes, null) : fallbackElement)));
}
/**
* A <Router> that stores all entries in memory.
*
* @see https://reactrouter.com/docs/en/v6/routers/memory-router
*/
function MemoryRouter(_ref2) {
let {
basename,
children,
initialEntries,
initialIndex
} = _ref2;
let historyRef = React.useRef();
if (historyRef.current == null) {
historyRef.current = createMemoryHistory({
initialEntries,
initialIndex,
v5Compat: true
});
}
let history = historyRef.current;
let [state, setState] = React.useState({
action: history.action,
location: history.location
});
React.useLayoutEffect(() => history.listen(setState), [history]);
return /*#__PURE__*/React.createElement(Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
/**
* Changes the current location.
*
* Note: This API is mostly useful in React.Component subclasses that are not
* able to use hooks. In functional components, we recommend you use the
* `useNavigate` hook instead.
*
* @see https://reactrouter.com/docs/en/v6/components/navigate
*/
function Navigate(_ref3) {
let {
to,
replace,
state,
relative
} = _ref3;
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of
// the router loaded. We can help them understand how to avoid that.
"<Navigate> may be used only in the context of a <Router> component.") : invariant(false) : void 0;
process.env.NODE_ENV !== "production" ? warning(!React.useContext(NavigationContext).static, "<Navigate> must not be used on the initial render in a <StaticRouter>. " + "This is a no-op, but you should modify your code so the <Navigate> is " + "only ever rendered in response to some user interaction or state change.") : void 0;
let dataRouterState = React.useContext(DataRouterStateContext);
let navigate = useNavigate();
React.useEffect(() => {
// Avoid kicking off multiple navigations if we're in the middle of a
// data-router navigation, since components get re-rendered when we enter
// a submitting/loading state
if (dataRouterState && dataRouterState.navigation.state !== "idle") {
return;
}
navigate(to, {
replace,
state,
relative
});
});
return null;
}
/**
* Renders the child route's element, if there is one.
*
* @see https://reactrouter.com/docs/en/v6/components/outlet
*/
function Outlet(props) {
return useOutlet(props.context);
}
/**
* Declares an element that should be rendered at a certain URL path.
*
* @see https://reactrouter.com/docs/en/v6/components/route
*/
function Route(_props) {
process.env.NODE_ENV !== "production" ? invariant(false, "A <Route> is only ever to be used as the child of <Routes> element, " + "never rendered directly. Please wrap your <Route> in a <Routes>.") : invariant(false) ;
}
/**
* Provides location context for the rest of the app.
*
* Note: You usually won't render a <Router> directly. Instead, you'll render a
* router that is more specific to your environment such as a <BrowserRouter>
* in web browsers or a <StaticRouter> for server rendering.
*
* @see https://reactrouter.com/docs/en/v6/routers/router
*/
function Router(_ref4) {
let {
basename: basenameProp = "/",
children = null,
location: locationProp,
navigationType = Action.Pop,
navigator,
static: staticProp = false
} = _ref4;
!!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, "You cannot render a <Router> inside another <Router>." + " You should never have more than one in your app.") : invariant(false) : void 0; // Preserve trailing slashes on basename, so we can let the user control
// the enforcement of trailing slashes throughout the app
let basename = basenameProp.replace(/^\/*/, "/");
let navigationContext = React.useMemo(() => ({
basename,
navigator,
static: staticProp
}), [basename, navigator, staticProp]);
if (typeof locationProp === "string") {
locationProp = parsePath(locationProp);
}
let {
pathname = "/",
search = "",
hash = "",
state = null,
key = "default"
} = locationProp;
let location = React.useMemo(() => {
let trailingPathname = stripBasename(pathname, basename);
if (trailingPathname == null) {
return null;
}
return {
pathname: trailingPathname,
search,
hash,
state,
key
};
}, [basename, pathname, search, hash, state, key]);
process.env.NODE_ENV !== "production" ? warning(location != null, "<Router basename=\"" + basename + "\"> is not able to match the URL " + ("\"" + pathname + search + hash + "\" because it does not start with the ") + "basename, so the <Router> won't render anything.") : void 0;
if (location == null) {
return null;
}
return /*#__PURE__*/React.createElement(NavigationContext.Provider, {
value: navigationContext
}, /*#__PURE__*/React.createElement(LocationContext.Provider, {
children: children,
value: {
location,
navigationType
}
}));
}
/**
* A container for a nested tree of <Route> elements that renders the branch
* that best matches the current location.
*
* @see https://reactrouter.com/docs/en/v6/components/routes
*/
function Routes(_ref5) {
let {
children,
location
} = _ref5;
let dataRouterContext = React.useContext(DataRouterContext); // When in a DataRouterContext _without_ children, we use the router routes
// directly. If we have children, then we're in a descendant tree and we
// need to use child routes.
let routes = dataRouterContext && !children ? dataRouterContext.router.routes : createRoutesFromChildren(children);
return useRoutes(routes, location);
}
/**
* Component to use for rendering lazily loaded data from returning defer()
* in a loader function
*/
function Await(_ref6) {
let {
children,
errorElement,
resolve
} = _ref6;
return /*#__PURE__*/React.createElement(AwaitErrorBoundary, {
resolve: resolve,
errorElement: errorElement
}, /*#__PURE__*/React.createElement(ResolveAwait, null, children));
}
var AwaitRenderStatus;
(function (AwaitRenderStatus) {
AwaitRenderStatus[AwaitRenderStatus["pending"] = 0] = "pending";
AwaitRenderStatus[AwaitRenderStatus["success"] = 1] = "success";
AwaitRenderStatus[AwaitRenderStatus["error"] = 2] = "error";
})(AwaitRenderStatus || (AwaitRenderStatus = {}));
const neverSettledPromise = new Promise(() => {});
class AwaitErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = {
error: null
};
}
static getDerivedStateFromError(error) {
return {
error
};
}
componentDidCatch(error, errorInfo) {
console.error("<Await> caught the following error during render", error, errorInfo);
}
render() {
let {
children,
errorElement,
resolve
} = this.props;
let promise = null;
let status = AwaitRenderStatus.pending;
if (!(resolve instanceof Promise)) {
// Didn't get a promise - provide as a resolved promise
status = AwaitRenderStatus.success;
promise = Promise.resolve();
Object.defineProperty(promise, "_tracked", {
get: () => true
});
Object.defineProperty(promise, "_data", {
get: () => resolve
});
} else if (this.state.error) {
// Caught a render error, provide it as a rejected promise
status = AwaitRenderStatus.error;
let renderError = this.state.error;
promise = Promise.reject().catch(() => {}); // Avoid unhandled rejection warnings
Object.defineProperty(promise, "_tracked", {
get: () => true
});
Object.defineProperty(promise, "_error", {
get: () => renderError
});
} else if (resolve._tracked) {
// Already tracked promise - check contents
promise = resolve;
status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
} else {
// Raw (untracked) promise - track it
status = AwaitRenderStatus.pending;
Object.defineProperty(resolve, "_tracked", {
get: () => true
});
promise = resolve.then(data => Object.defineProperty(resolve, "_data", {
get: () => data
}), error => Object.defineProperty(resolve, "_error", {
get: () => error
}));
}
if (status === AwaitRenderStatus.error && promise._error instanceof AbortedDeferredError) {
// Freeze the UI by throwing a never resolved promise
throw neverSettledPromise;
}
if (status === AwaitRenderStatus.error && !errorElement) {
// No errorElement, throw to the nearest route-level error boundary
throw promise._error;
}
if (status === AwaitRenderStatus.error) {
// Render via our errorElement
return /*#__PURE__*/React.createElement(AwaitContext.Provider, {
value: promise,
children: errorElement
});
}
if (status === AwaitRenderStatus.success) {
// Render children with resolved value
return /*#__PURE__*/React.createElement(AwaitContext.Provider, {
value: promise,
children: children
});
} // Throw to the suspense boundary
throw promise;
}
}
/**
* @private
* Indirection to leverage useAsyncValue for a render-prop API on <Await>
*/
function ResolveAwait(_ref7) {
let {
children
} = _ref7;
let data = useAsyncValue();
if (typeof children === "function") {
return children(data);
}
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
} ///////////////////////////////////////////////////////////////////////////////
// UTILS
///////////////////////////////////////////////////////////////////////////////
/**
* Creates a route config from a React "children" object, which is usually
* either a `<Route>` element or an array of them. Used internally by
* `<Routes>` to create a route config from its children.
*
* @see https://reactrouter.com/docs/en/v6/utils/create-routes-from-children
*/
function createRoutesFromChildren(children, parentPath) {
if (parentPath === void 0) {
parentPath = [];
}
let routes = [];
React.Children.forEach(children, (element, index) => {
if (! /*#__PURE__*/React.isValidElement(element)) {
// Ignore non-elements. This allows people to more easily inline
// conditionals in their route config.
return;
}
if (element.type === React.Fragment) {
// Transparently support React.Fragment and its children.
routes.push.apply(routes, createRoutesFromChildren(element.props.children, parentPath));
return;
}
!(element.type === Route) ? process.env.NODE_ENV !== "production" ? invariant(false, "[" + (typeof element.type === "string" ? element.type : element.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : invariant(false) : void 0;
!(!element.props.index || !element.props.children) ? process.env.NODE_ENV !== "production" ? invariant(false, "An index route cannot have child routes.") : invariant(false) : void 0;
let treePath = [...parentPath, index];
let route = {
id: element.props.id || treePath.join("-"),
caseSensitive: element.props.caseSensitive,
element: element.props.element,
index: element.props.index,
path: element.props.path,
loader: element.props.loader,
action: element.props.action,
errorElement: element.props.errorElement,
hasErrorBoundary: element.props.errorElement != null,
shouldRevalidate: element.props.shouldRevalidate,
handle: element.props.handle
};
if (element.props.children) {
route.children = createRoutesFromChildren(element.props.children, treePath);
}
routes.push(route);
});
return routes;
}
/**
* Renders the result of `matchRoutes()` into a React element.
*/
function renderMatches(matches) {
return _renderMatches(matches);
}
/**
* @private
* Walk the route tree and add hasErrorBoundary if it's not provided, so that
* users providing manual route arrays can just specify errorElement
*/
function enhanceManualRouteObjects(routes) {
return routes.map(route => {
let routeClone = _extends({}, route);
if (routeClone.hasErrorBoundary == null) {
routeClone.hasErrorBoundary = routeClone.errorElement != null;
}
if (routeClone.children) {
routeClone.children = enhanceManualRouteObjects(routeClone.children);
}
return routeClone;
});
}
function createMemoryRouter(routes, opts) {
return createRouter({
basename: opts == null ? void 0 : opts.basename,
history: createMemoryHistory({
initialEntries: opts == null ? void 0 : opts.initialEntries,
initialIndex: opts == null ? void 0 : opts.initialIndex
}),
hydrationData: opts == null ? void 0 : opts.hydrationData,
routes: enhanceManualRouteObjects(routes)
}).initialize();
} ///////////////////////////////////////////////////////////////////////////////
export { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, DataStaticRouterContext as UNSAFE_DataStaticRouterContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, enhanceManualRouteObjects as UNSAFE_enhanceManualRouteObjects, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/react-router-dom/dist/index.js
/**
* React Router DOM v6.4.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
import * as React from 'react';
import { UNSAFE_enhanceManualRouteObjects, Router, useHref, createPath, useResolvedPath, useMatch, UNSAFE_DataRouterStateContext, useNavigate, useLocation, UNSAFE_NavigationContext, UNSAFE_RouteContext, useMatches, useNavigation, UNSAFE_DataRouterContext } from 'react-router';
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_DataStaticRouterContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, UNSAFE_enhanceManualRouteObjects, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, renderMatches, resolvePath, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes } from 'react-router';
import { createRouter, createBrowserHistory, createHashHistory, matchPath, invariant, joinPaths } from '@remix-run/router';
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
const defaultMethod = "get";
const defaultEncType = "application/x-www-form-urlencoded";
function isHtmlElement(object) {
return object != null && typeof object.tagName === "string";
}
function isButtonElement(object) {
return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
}
function isFormElement(object) {
return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
}
function isInputElement(object) {
return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
function shouldProcessLinkClick(event, target) {
return event.button === 0 && ( // Ignore everything but left clicks
!target || target === "_self") && // Let browser handle "target=_blank" etc.
!isModifiedEvent(event) // Ignore clicks with modifier keys
;
}
/**
* Creates a URLSearchParams object using the given initializer.
*
* This is identical to `new URLSearchParams(init)` except it also
* supports arrays as values in the object form of the initializer
* instead of just strings. This is convenient when you need multiple
* values for a given key, but don't want to use an array initializer.
*
* For example, instead of:
*
* let searchParams = new URLSearchParams([
* ['sort', 'name'],
* ['sort', 'price']
* ]);
*
* you can do:
*
* let searchParams = createSearchParams({
* sort: ['name', 'price']
* });
*/
function createSearchParams(init) {
if (init === void 0) {
init = "";
}
return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {
let value = init[key];
return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);
}, []));
}
function getSearchParamsForLocation(locationSearch, defaultSearchParams) {
let searchParams = createSearchParams(locationSearch);
for (let key of defaultSearchParams.keys()) {
if (!searchParams.has(key)) {
defaultSearchParams.getAll(key).forEach(value => {
searchParams.append(key, value);
});
}
}
return searchParams;
}
function getFormSubmissionInfo(target, defaultAction, options) {
let method;
let action;
let encType;
let formData;
if (isFormElement(target)) {
let submissionTrigger = options.submissionTrigger;
method = options.method || target.getAttribute("method") || defaultMethod;
action = options.action || target.getAttribute("action") || defaultAction;
encType = options.encType || target.getAttribute("enctype") || defaultEncType;
formData = new FormData(target);
if (submissionTrigger && submissionTrigger.name) {
formData.append(submissionTrigger.name, submissionTrigger.value);
}
} else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
let form = target.form;
if (form == null) {
throw new Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>");
} // <button>/<input type="submit"> may override attributes of <form>
method = options.method || target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
action = options.action || target.getAttribute("formaction") || form.getAttribute("action") || defaultAction;
encType = options.encType || target.getAttribute("formenctype") || form.getAttribute("enctype") || defaultEncType;
formData = new FormData(form); // Include name + value from a <button>, appending in case the button name
// matches an existing input name
if (target.name) {
formData.append(target.name, target.value);
}
} else if (isHtmlElement(target)) {
throw new Error("Cannot submit element that is not <form>, <button>, or " + "<input type=\"submit|image\">");
} else {
method = options.method || defaultMethod;
action = options.action || defaultAction;
encType = options.encType || defaultEncType;
if (target instanceof FormData) {
formData = target;
} else {
formData = new FormData();
if (target instanceof URLSearchParams) {
for (let [name, value] of target) {
formData.append(name, value);
}
} else if (target != null) {
for (let name of Object.keys(target)) {
formData.append(name, target[name]);
}
}
}
}
let {
protocol,
host
} = window.location;
let url = new URL(action, protocol + "//" + host);
return {
url,
method,
encType,
formData
};
}
const _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"],
_excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"],
_excluded3 = ["reloadDocument", "replace", "method", "action", "onSubmit", "fetcherKey", "routeId", "relative"];
//#region Routers
////////////////////////////////////////////////////////////////////////////////
function createBrowserRouter(routes, opts) {
var _window;
return createRouter({
basename: opts == null ? void 0 : opts.basename,
history: createBrowserHistory({
window: opts == null ? void 0 : opts.window
}),
hydrationData: (opts == null ? void 0 : opts.hydrationData) || ((_window = window) == null ? void 0 : _window.__staticRouterHydrationData),
routes: UNSAFE_enhanceManualRouteObjects(routes)
}).initialize();
}
function createHashRouter(routes, opts) {
var _window2;
return createRouter({
basename: opts == null ? void 0 : opts.basename,
history: createHashHistory({
window: opts == null ? void 0 : opts.window
}),
hydrationData: (opts == null ? void 0 : opts.hydrationData) || ((_window2 = window) == null ? void 0 : _window2.__staticRouterHydrationData),
routes: UNSAFE_enhanceManualRouteObjects(routes)
}).initialize();
}
/**
* A `<Router>` for use in web browsers. Provides the cleanest URLs.
*/
function BrowserRouter(_ref) {
let {
basename,
children,
window
} = _ref;
let historyRef = React.useRef();
if (historyRef.current == null) {
historyRef.current = createBrowserHistory({
window,
v5Compat: true
});
}
let history = historyRef.current;
let [state, setState] = React.useState({
action: history.action,
location: history.location
});
React.useLayoutEffect(() => history.listen(setState), [history]);
return /*#__PURE__*/React.createElement(Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
/**
* A `<Router>` for use in web browsers. Stores the location in the hash
* portion of the URL so it is not sent to the server.
*/
function HashRouter(_ref2) {
let {
basename,
children,
window
} = _ref2;
let historyRef = React.useRef();
if (historyRef.current == null) {
historyRef.current = createHashHistory({
window,
v5Compat: true
});
}
let history = historyRef.current;
let [state, setState] = React.useState({
action: history.action,
location: history.location
});
React.useLayoutEffect(() => history.listen(setState), [history]);
return /*#__PURE__*/React.createElement(Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
/**
* A `<Router>` that accepts a pre-instantiated history object. It's important
* to note that using your own history object is highly discouraged and may add
* two versions of the history library to your bundles unless you use the same
* version of the history library that React Router uses internally.
*/
function HistoryRouter(_ref3) {
let {
basename,
children,
history
} = _ref3;
const [state, setState] = React.useState({
action: history.action,
location: history.location
});
React.useLayoutEffect(() => history.listen(setState), [history]);
return /*#__PURE__*/React.createElement(Router, {
basename: basename,
children: children,
location: state.location,
navigationType: state.action,
navigator: history
});
}
if (process.env.NODE_ENV !== "production") {
HistoryRouter.displayName = "unstable_HistoryRouter";
}
/**
* The public API for rendering a history-aware <a>.
*/
const Link = /*#__PURE__*/React.forwardRef(function LinkWithRef(_ref4, ref) {
let {
onClick,
relative,
reloadDocument,
replace,
state,
target,
to,
preventScrollReset
} = _ref4,
rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
let href = useHref(to, {
relative
});
let internalOnClick = useLinkClickHandler(to, {
replace,
state,
target,
preventScrollReset,
relative
});
function handleClick(event) {
if (onClick) onClick(event);
if (!event.defaultPrevented) {
internalOnClick(event);
}
}
return (
/*#__PURE__*/
// eslint-disable-next-line jsx-a11y/anchor-has-content
React.createElement("a", _extends({}, rest, {
href: href,
onClick: reloadDocument ? onClick : handleClick,
ref: ref,
target: target
}))
);
});
if (process.env.NODE_ENV !== "production") {
Link.displayName = "Link";
}
/**
* A <Link> wrapper that knows if it's "active" or not.
*/
const NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref5, ref) {
let {
"aria-current": ariaCurrentProp = "page",
caseSensitive = false,
className: classNameProp = "",
end = false,
style: styleProp,
to,
children
} = _ref5,
rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);
let path = useResolvedPath(to);
let match = useMatch({
path: path.pathname,
end,
caseSensitive
});
let routerState = React.useContext(UNSAFE_DataRouterStateContext);
let nextLocation = routerState == null ? void 0 : routerState.navigation.location;
let nextPath = useResolvedPath(nextLocation || "");
let nextMatch = React.useMemo(() => nextLocation ? matchPath({
path: path.pathname,
end,
caseSensitive
}, nextPath.pathname) : null, [nextLocation, path.pathname, caseSensitive, end, nextPath.pathname]);
let isPending = nextMatch != null;
let isActive = match != null;
let ariaCurrent = isActive ? ariaCurrentProp : undefined;
let className;
if (typeof classNameProp === "function") {
className = classNameProp({
isActive,
isPending
});
} else {
// If the className prop is not a function, we use a default `active`
// class for <NavLink />s that are active. In v5 `active` was the default
// value for `activeClassName`, but we are removing that API and can still
// use the old default behavior for a cleaner upgrade path and keep the
// simple styling rules working as they currently do.
className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null].filter(Boolean).join(" ");
}
let style = typeof styleProp === "function" ? styleProp({
isActive,
isPending
}) : styleProp;
return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {
"aria-current": ariaCurrent,
className: className,
ref: ref,
style: style,
to: to
}), typeof children === "function" ? children({
isActive,
isPending
}) : children);
});
if (process.env.NODE_ENV !== "production") {
NavLink.displayName = "NavLink";
}
/**
* A `@remix-run/router`-aware `<form>`. It behaves like a normal form except
* that the interaction with the server is with `fetch` instead of new document
* requests, allowing components to add nicer UX to the page as the form is
* submitted and returns with data.
*/
const Form = /*#__PURE__*/React.forwardRef((props, ref) => {
return /*#__PURE__*/React.createElement(FormImpl, _extends({}, props, {
ref: ref
}));
});
if (process.env.NODE_ENV !== "production") {
Form.displayName = "Form";
}
const FormImpl = /*#__PURE__*/React.forwardRef((_ref6, forwardedRef) => {
let {
reloadDocument,
replace,
method = defaultMethod,
action,
onSubmit,
fetcherKey,
routeId,
relative
} = _ref6,
props = _objectWithoutPropertiesLoose(_ref6, _excluded3);
let submit = useSubmitImpl(fetcherKey, routeId);
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
let formAction = useFormAction(action, {
relative
});
let submitHandler = event => {
onSubmit && onSubmit(event);
if (event.defaultPrevented) return;
event.preventDefault();
let submitter = event.nativeEvent.submitter;
submit(submitter || event.currentTarget, {
method,
replace,
relative
});
};
return /*#__PURE__*/React.createElement("form", _extends({
ref: forwardedRef,
method: formMethod,
action: formAction,
onSubmit: reloadDocument ? onSubmit : submitHandler
}, props));
});
if (process.env.NODE_ENV !== "production") {
Form.displayName = "Form";
}
/**
* This component will emulate the browser's scroll restoration on location
* changes.
*/
function ScrollRestoration(_ref7) {
let {
getKey,
storageKey
} = _ref7;
useScrollRestoration({
getKey,
storageKey
});
return null;
}
if (process.env.NODE_ENV !== "production") {
ScrollRestoration.displayName = "ScrollRestoration";
} //#endregion
////////////////////////////////////////////////////////////////////////////////
//#region Hooks
////////////////////////////////////////////////////////////////////////////////
var DataRouterHook;
(function (DataRouterHook) {
DataRouterHook["UseScrollRestoration"] = "useScrollRestoration";
DataRouterHook["UseSubmitImpl"] = "useSubmitImpl";
DataRouterHook["UseFetcher"] = "useFetcher";
})(DataRouterHook || (DataRouterHook = {}));
var DataRouterStateHook;
(function (DataRouterStateHook) {
DataRouterStateHook["UseFetchers"] = "useFetchers";
DataRouterStateHook["UseScrollRestoration"] = "useScrollRestoration";
})(DataRouterStateHook || (DataRouterStateHook = {}));
function getDataRouterConsoleError(hookName) {
return hookName + " must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.";
}
function useDataRouterContext(hookName) {
let ctx = React.useContext(UNSAFE_DataRouterContext);
!ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
return ctx;
}
function useDataRouterState(hookName) {
let state = React.useContext(UNSAFE_DataRouterStateContext);
!state ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
return state;
}
/**
* Handles the click behavior for router `<Link>` components. This is useful if
* you need to create custom `<Link>` components with the same click behavior we
* use in our exported `<Link>`.
*/
function useLinkClickHandler(to, _temp) {
let {
target,
replace: replaceProp,
state,
preventScrollReset,
relative
} = _temp === void 0 ? {} : _temp;
let navigate = useNavigate();
let location = useLocation();
let path = useResolvedPath(to, {
relative
});
return React.useCallback(event => {
if (shouldProcessLinkClick(event, target)) {
event.preventDefault(); // If the URL hasn't changed, a regular <a> will do a replace instead of
// a push, so do the same here unless the replace prop is explicitly set
let replace = replaceProp !== undefined ? replaceProp : createPath(location) === createPath(path);
navigate(to, {
replace,
state,
preventScrollReset,
relative
});
}
}, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative]);
}
/**
* A convenient wrapper for reading and writing search parameters via the
* URLSearchParams interface.
*/
function useSearchParams(defaultInit) {
process.env.NODE_ENV !== "production" ? warning(typeof URLSearchParams !== "undefined", "You cannot use the `useSearchParams` hook in a browser that does not " + "support the URLSearchParams API. If you need to support Internet " + "Explorer 11, we recommend you load a polyfill such as " + "https://github.com/ungap/url-search-params\n\n" + "If you're unsure how to load polyfills, we recommend you check out " + "https://polyfill.io/v3/ which provides some recommendations about how " + "to load polyfills only for users that need them, instead of for every " + "user.") : void 0;
let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
let location = useLocation();
let searchParams = React.useMemo(() => getSearchParamsForLocation(location.search, defaultSearchParamsRef.current), [location.search]);
let navigate = useNavigate();
let setSearchParams = React.useCallback((nextInit, navigateOptions) => {
const newSearchParams = createSearchParams(typeof nextInit === "function" ? nextInit(searchParams) : nextInit);
navigate("?" + newSearchParams, navigateOptions);
}, [navigate, searchParams]);
return [searchParams, setSearchParams];
}
/**
* Returns a function that may be used to programmatically submit a form (or
* some arbitrary data) to the server.
*/
function useSubmit() {
return useSubmitImpl();
}
function useSubmitImpl(fetcherKey, routeId) {
let {
router
} = useDataRouterContext(DataRouterHook.UseSubmitImpl);
let defaultAction = useFormAction();
return React.useCallback(function (target, options) {
if (options === void 0) {
options = {};
}
if (typeof document === "undefined") {
throw new Error("You are calling submit during the server render. " + "Try calling submit within a `useEffect` or callback instead.");
}
let {
method,
encType,
formData,
url
} = getFormSubmissionInfo(target, defaultAction, options);
let href = url.pathname + url.search;
let opts = {
replace: options.replace,
formData,
formMethod: method,
formEncType: encType
};
if (fetcherKey) {
!(routeId != null) ? process.env.NODE_ENV !== "production" ? invariant(false, "No routeId available for useFetcher()") : invariant(false) : void 0;
router.fetch(fetcherKey, routeId, href, opts);
} else {
router.navigate(href, opts);
}
}, [defaultAction, router, fetcherKey, routeId]);
}
function useFormAction(action, _temp2) {
let {
relative
} = _temp2 === void 0 ? {} : _temp2;
let {
basename
} = React.useContext(UNSAFE_NavigationContext);
let routeContext = React.useContext(UNSAFE_RouteContext);
!routeContext ? process.env.NODE_ENV !== "production" ? invariant(false, "useFormAction must be used inside a RouteContext") : invariant(false) : void 0;
let [match] = routeContext.matches.slice(-1);
let resolvedAction = action != null ? action : "."; // Shallow clone path so we can modify it below, otherwise we modify the
// object referenced by useMemo inside useResolvedPath
let path = _extends({}, useResolvedPath(resolvedAction, {
relative
})); // Previously we set the default action to ".". The problem with this is that
// `useResolvedPath(".")` excludes search params and the hash of the resolved
// URL. This is the intended behavior of when "." is specifically provided as
// the form action, but inconsistent w/ browsers when the action is omitted.
// https://github.com/remix-run/remix/issues/927
let location = useLocation();
if (action == null) {
// Safe to write to these directly here since if action was undefined, we
// would have called useResolvedPath(".") which will never include a search
// or hash
path.search = location.search;
path.hash = location.hash; // When grabbing search params from the URL, remove the automatically
// inserted ?index param so we match the useResolvedPath search behavior
// which would not include ?index
if (match.route.index) {
let params = new URLSearchParams(path.search);
params.delete("index");
path.search = params.toString() ? "?" + params.toString() : "";
}
}
if ((!action || action === ".") && match.route.index) {
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
} // If we're operating within a basename, prepend it to the pathname prior
// to creating the form action. If this is a root navigation, then just use
// the raw basename which allows the basename to have full control over the
// presence of a trailing slash on root actions
if (basename !== "/") {
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
}
return createPath(path);
}
function createFetcherForm(fetcherKey, routeId) {
let FetcherForm = /*#__PURE__*/React.forwardRef((props, ref) => {
return /*#__PURE__*/React.createElement(FormImpl, _extends({}, props, {
ref: ref,
fetcherKey: fetcherKey,
routeId: routeId
}));
});
if (process.env.NODE_ENV !== "production") {
FetcherForm.displayName = "fetcher.Form";
}
return FetcherForm;
}
let fetcherId = 0;
/**
* Interacts with route loaders and actions without causing a navigation. Great
* for any interaction that stays on the same page.
*/
function useFetcher() {
var _route$matches;
let {
router
} = useDataRouterContext(DataRouterHook.UseFetcher);
let route = React.useContext(UNSAFE_RouteContext);
!route ? process.env.NODE_ENV !== "production" ? invariant(false, "useFetcher must be used inside a RouteContext") : invariant(false) : void 0;
let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id;
!(routeId != null) ? process.env.NODE_ENV !== "production" ? invariant(false, "useFetcher can only be used on routes that contain a unique \"id\"") : invariant(false) : void 0;
let [fetcherKey] = React.useState(() => String(++fetcherId));
let [Form] = React.useState(() => {
!routeId ? process.env.NODE_ENV !== "production" ? invariant(false, "No routeId available for fetcher.Form()") : invariant(false) : void 0;
return createFetcherForm(fetcherKey, routeId);
});
let [load] = React.useState(() => href => {
!router ? process.env.NODE_ENV !== "production" ? invariant(false, "No router available for fetcher.load()") : invariant(false) : void 0;
!routeId ? process.env.NODE_ENV !== "production" ? invariant(false, "No routeId available for fetcher.load()") : invariant(false) : void 0;
router.fetch(fetcherKey, routeId, href);
});
let submit = useSubmitImpl(fetcherKey, routeId);
let fetcher = router.getFetcher(fetcherKey);
let fetcherWithComponents = React.useMemo(() => _extends({
Form,
submit,
load
}, fetcher), [fetcher, Form, submit, load]);
React.useEffect(() => {
// Is this busted when the React team gets real weird and calls effects
// twice on mount? We really just need to garbage collect here when this
// fetcher is no longer around.
return () => {
if (!router) {
console.warn("No fetcher available to clean up from useFetcher()");
return;
}
router.deleteFetcher(fetcherKey);
};
}, [router, fetcherKey]);
return fetcherWithComponents;
}
/**
* Provides all fetchers currently on the page. Useful for layouts and parent
* routes that need to provide pending/optimistic UI regarding the fetch.
*/
function useFetchers() {
let state = useDataRouterState(DataRouterStateHook.UseFetchers);
return [...state.fetchers.values()];
}
const SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
let savedScrollPositions = {};
/**
* When rendered inside a RouterProvider, will restore scroll positions on navigations
*/
function useScrollRestoration(_temp3) {
let {
getKey,
storageKey
} = _temp3 === void 0 ? {} : _temp3;
let {
router
} = useDataRouterContext(DataRouterHook.UseScrollRestoration);
let {
restoreScrollPosition,
preventScrollReset
} = useDataRouterState(DataRouterStateHook.UseScrollRestoration);
let location = useLocation();
let matches = useMatches();
let navigation = useNavigation(); // Trigger manual scroll restoration while we're active
React.useEffect(() => {
window.history.scrollRestoration = "manual";
return () => {
window.history.scrollRestoration = "auto";
};
}, []); // Save positions on unload
useBeforeUnload(React.useCallback(() => {
if (navigation.state === "idle") {
let key = (getKey ? getKey(location, matches) : null) || location.key;
savedScrollPositions[key] = window.scrollY;
}
sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));
window.history.scrollRestoration = "auto";
}, [storageKey, getKey, navigation.state, location, matches])); // Read in any saved scroll locations
React.useLayoutEffect(() => {
try {
let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);
if (sessionPositions) {
savedScrollPositions = JSON.parse(sessionPositions);
}
} catch (e) {// no-op, use default empty object
}
}, [storageKey]); // Enable scroll restoration in the router
React.useLayoutEffect(() => {
let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKey);
return () => disableScrollRestoration && disableScrollRestoration();
}, [router, getKey]); // Restore scrolling when state.restoreScrollPosition changes
React.useLayoutEffect(() => {
// Explicit false means don't do anything (used for submissions)
if (restoreScrollPosition === false) {
return;
} // been here before, scroll to it
if (typeof restoreScrollPosition === "number") {
window.scrollTo(0, restoreScrollPosition);
return;
} // try to scroll to the hash
if (location.hash) {
let el = document.getElementById(location.hash.slice(1));
if (el) {
el.scrollIntoView();
return;
}
} // Opt out of scroll reset if this link requested it
if (preventScrollReset === true) {
return;
} // otherwise go to the top on new locations
window.scrollTo(0, 0);
}, [location, restoreScrollPosition, preventScrollReset]);
}
function useBeforeUnload(callback) {
React.useEffect(() => {
window.addEventListener("beforeunload", callback);
return () => {
window.removeEventListener("beforeunload", callback);
};
}, [callback]);
} //#endregion
////////////////////////////////////////////////////////////////////////////////
//#region Utils
////////////////////////////////////////////////////////////////////////////////
function warning(cond, message) {
if (!cond) {
// eslint-disable-next-line no-console
if (typeof console !== "undefined") console.warn(message);
try {
// Welcome to debugging React Router!
//
// This error is thrown as a convenience so you can more easily
// find the source for a warning that appears in the console by
// enabling "pause on exceptions" in your JavaScript debugger.
throw new Error(message); // eslint-disable-next-line no-empty
} catch (e) {}
}
} //#endregion
export { BrowserRouter, Form, HashRouter, Link, NavLink, ScrollRestoration, createBrowserRouter, createHashRouter, createSearchParams, HistoryRouter as unstable_HistoryRouter, useFetcher, useFetchers, useFormAction, useLinkClickHandler, useSearchParams, useSubmit };
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
export default function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/createClass.js
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
export default function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
export default function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
export default function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/inherits.js
import setPrototypeOf from "./setPrototypeOf.js";
export default function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) setPrototypeOf(subClass, superClass);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
import _typeof from "@babel/runtime/helpers/typeof";
import assertThisInitialized from "./assertThisInitialized.js";
export default function _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === "object" || typeof call === "function")) {
return call;
}
return assertThisInitialized(self);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
export default function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/get.js
import superPropBase from "./superPropBase.js";
export default function _get(target, property, receiver) {
if (typeof Reflect !== "undefined" && Reflect.get) {
_get = Reflect.get;
} else {
_get = function _get(target, property, receiver) {
var base = superPropBase(target, property);
if (!base) return;
var desc = Object.getOwnPropertyDescriptor(base, property);
if (desc.get) {
return desc.get.call(receiver);
}
return desc.value;
};
}
return _get(target, property, receiver || target);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/superPropBase.js
import getPrototypeOf from "./getPrototypeOf.js";
export default function _superPropBase(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = getPrototypeOf(object);
if (object === null) break;
}
return object;
}
webpack://frontend-tpt/../../packages/tvg-lib-mediator/src/MediatorUtils.ts
import { get } from "lodash";
export const isBrowser = () =>
typeof window !== "undefined" &&
Object.prototype.toString.call(window) === "[object Window]";
export const isNativeApp = () =>
isBrowser() &&
["iosnative", "androidnative"].includes(
get(window, "__TVG_GLOBALS__.PRODUCT")
);
webpack://frontend-tpt/../../packages/tvg-lib-mediator/src/EventEmitters/Base.ts
/**
* BaseEventEmitter
*
* Pure JavaScript EventEmitter. This is used as base to keep track of dispatch
* events. Other event emitters can then extend this and just care about their
* implementation details
*/
import { get as lodashGet } from "lodash";
import { get, set } from "lodash/fp";
import tvgConf from "@tvg/conf";
import type {
EventEmitterInterface,
EventName,
EventListener,
FSA
} from "../Types";
import { isBrowser } from "../MediatorUtils";
const MEDIATOR_LOG_EVENTS_COOKIE = "useMediatorLogEvents";
type EventHandler = {
payload?: FSA;
subscribers: Array<EventListener>;
};
class BaseEventEmitter implements EventEmitterInterface {
events: {
[key in EventName]: EventHandler;
};
constructor() {
this.events = {};
}
dispatch(payload: FSA) {
if (
lodashGet(tvgConf(), "environment") === "qa" &&
typeof window !== "undefined" &&
document.cookie.includes(`${MEDIATOR_LOG_EVENTS_COOKIE}=true`)
) {
console.log("mediator.dispatch - payload:", payload);
}
const event = get(payload.type, this.events);
if (event) {
event.payload = payload;
if (
isBrowser() &&
lodashGet(window, "rnEvents", []).indexOf(payload.type) === -1
) {
event.subscribers.forEach((subscriber) => {
if (subscriber) {
subscriber(payload);
}
});
} else if (typeof window !== "undefined") {
// @ts-ignore
window.ReactNativeWebView.postMessage(
JSON.stringify({
type: payload.type,
body: payload.payload
})
);
}
return this;
}
this.events = set(
payload.type,
{
payload,
subscribers: []
},
this.events
);
return this;
}
subscribe(name: EventName, subscriber: EventListener) {
const event = get(name, this.events);
if (!event) {
this.events = set(
name,
{
payload: null,
subscribers: [subscriber]
},
this.events
);
} else {
event.subscribers = event.subscribers.concat(subscriber);
}
// Not proud of this but I need it
const self = this;
return {
replay() {
if (event?.payload) {
subscriber(event.payload);
}
return this;
},
unsubscribe() {
self.unsubscribe(name, subscriber);
return this;
}
};
}
unsubscribe(name: EventName, subscriber: EventListener) {
const event = get(name, this.events);
if (event) {
event.subscribers = event.subscribers.filter((fn) => fn !== subscriber);
}
return this;
}
}
export default BaseEventEmitter;
webpack://frontend-tpt/../../packages/tvg-lib-mediator/src/EventEmitters/APP.ts
import { get } from "lodash/fp";
import { attempt } from "@tvg/conf/src/utils";
import { PRODUCTS_ANDROID, PRODUCTS_FDR_X_SELL } from "@tvg/conf/src/product";
import BaseEventEmitter from "./Base";
import type { FSA, EventName, EventListener } from "../Types";
type WebkitEvent = {
[key in EventName]: {
postMessage: EventListener;
};
};
type Options = {
webkitEvents?: WebkitEvent;
};
const FD_BRIDGE_MESSAGE_EVT = "BRIDGE_MESSAGE";
const FD_BRIDGE_EVENT_PREFIX = "x-sell/bridge/to-react/";
export const isAndroid = (product: string) =>
PRODUCTS_ANDROID.includes(product);
export const isXSell = (product: string) =>
PRODUCTS_FDR_X_SELL.includes(product);
export const checkSBBridgeEvents = (eventName: String) =>
typeof eventName === "string" && eventName.startsWith(FD_BRIDGE_EVENT_PREFIX);
export default class APPEventEmitter extends BaseEventEmitter {
// @ts-ignore
webkit: WebkitEvent;
// @ts-ignore
androidAppPostMessage: null;
constructor(options: Options = {}) {
super();
// android app flow
if (isAndroid(get("__TVG_GLOBALS__.PRODUCT", window))) {
this.androidAppPostMessage = get("androidBridge.postMessage", window);
if (!this.androidAppPostMessage) {
throw new Error("EventEmitterAPP requires android bridge");
}
// ios app flow
} else {
this.webkit =
options.webkitEvents || get("webkit.messageHandlers", window);
if (!this.webkit) {
throw new Error("EventEmitterAPP requires webkit events to exist");
}
}
}
dispatch = (message: FSA) => {
const product = get("__TVG_GLOBALS__.PRODUCT", window);
const webkitEvent =
get(FD_BRIDGE_MESSAGE_EVT, this.webkit) || get(message.type, this.webkit);
// iOS doesn't show any error message if we simply pass an error instance,
// so we transform the error into a plain object with message and stack
const errorObj = message.payload instanceof Error && {
...message,
payload: APPEventEmitter.encodeError(message.payload)
};
// We need to avoid send invalid events to xsell
if (!isXSell(product) || checkSBBridgeEvents(message.type)) {
if (window && get("androidBridge", window)) {
attempt(() => {
get("androidBridge", window).postMessage(
JSON.stringify(errorObj || message)
);
});
} else if (webkitEvent) {
webkitEvent.postMessage(errorObj || message);
}
}
return super.dispatch(message);
};
static encodeError(error: Error) {
return {
message: error.message,
stack: error.stack
};
}
}
webpack://frontend-tpt/../../packages/tvg-lib-mediator/src/EventEmitters/DOM.ts
import { get, set } from "lodash/fp";
import BaseEventEmitter from "./Base";
import type { FSA, EventName, EventListener } from "../Types";
type Options = {
element?: HTMLElement;
};
type WrapperSubscriber = EventListener & {
originalHandler: EventListener;
};
export default class DOMEventEmitter extends BaseEventEmitter {
element: HTMLElement;
subscribers: WrapperSubscriber[];
constructor(options: Options = {}) {
super();
const element = options.element || document.body;
if (!element) {
throw new Error("DOMEventEmitter requires document.body to exist");
}
this.element = element;
this.subscribers = [];
}
dispatch(payload: FSA) {
const event = get(payload.type, this.events);
if (event) {
const customEvent = new CustomEvent(payload.type, {
detail: payload,
bubbles: false
});
this.element.dispatchEvent(customEvent);
event.payload = payload;
return this;
}
this.events = set(
payload.type,
{
payload,
subscribers: []
},
this.events
);
return this;
}
subscribe(name: string, subscriber: EventListener) {
// @ts-ignore
const handler: WrapperSubscriber = (evt) => subscriber(evt.detail);
handler.originalHandler = subscriber;
this.element.addEventListener(name, handler);
this.subscribers = this.subscribers.concat(handler);
return super.subscribe(name, subscriber);
}
unsubscribe(name: EventName, subscriber: EventListener) {
const event = get(name, this.events);
if (event) {
const handler = this.subscribers.filter(
(fn) => fn.originalHandler === subscriber
)[0];
event.subscribers = event.subscribers.filter((fn) => fn !== handler);
this.element.removeEventListener(name, handler);
return super.unsubscribe(name, handler.originalHandler);
}
return this;
}
}
webpack://frontend-tpt/../../packages/tvg-lib-mediator/src/EventEmitters/Node.ts
import BaseEventEmitter from "./Base";
class NodeEventEmitter extends BaseEventEmitter {}
export default NodeEventEmitter;
webpack://frontend-tpt/../../packages/tvg-lib-mediator/src/Mediator.ts
import { get } from "lodash/fp";
import APPEventEmitter, { isAndroid } from "./EventEmitters/APP";
import DOMEventEmitter from "./EventEmitters/DOM";
import NodeEventEmitter from "./EventEmitters/Node";
import BaseEventEmitter from "./EventEmitters/Base";
import type { EventEmitterInterface } from "./Types";
import { isBrowser } from "./MediatorUtils";
type Channels = {
ios: EventEmitterInterface;
browser: EventEmitterInterface;
node: EventEmitterInterface;
base: EventEmitterInterface;
};
export default class Mediator {
channels: Channels;
constructor() {
this.channels = {
ios:
(Mediator.isAPP() && new APPEventEmitter()) || new BaseEventEmitter(),
browser:
(Mediator.isBrowser() && new DOMEventEmitter()) ||
new BaseEventEmitter(),
node:
(Mediator.isNode() && new NodeEventEmitter()) || new BaseEventEmitter(),
base: new BaseEventEmitter()
};
}
static isNode() {
return (
typeof process !== "undefined" && get("release.name", process) === "node"
);
}
// This function is duplicated in ./EventEmitters/Base.js
static isBrowser() {
// Not perfect
return isBrowser();
}
static isAPP() {
return (
(Mediator.isBrowser() &&
isAndroid(get("__TVG_GLOBALS__.PRODUCT", window))) ||
(Mediator.isBrowser() &&
!!get("webkit.messageHandlers", window) &&
!window.navigator.userAgent.match("CriOS"))
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-mediator/src/index.ts
import Mediator from "./Mediator";
let mediator = new Mediator();
// Attach mediator channels to the window to allow cross app communication
if (Mediator.isBrowser()) {
// @ts-ignore
if (!window.mediatorChannels) {
// @ts-ignore
window.mediatorChannels = mediator.channels;
} else {
// @ts-ignore
mediator = { channels: window.mediatorChannels };
}
}
export default mediator.channels;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js
import defineProperty from "./defineProperty.js";
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) {
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
}
keys.push.apply(keys, symbols);
}
return keys;
}
export default function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
webpack://frontend-tpt/../../node_modules/redux/es/redux.js
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
/**
* Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
*
* Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
* during build.
* @param {number} code
*/
function formatProdErrorMessage(code) {
return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
}
// Inlined version of the `symbol-observable` polyfill
var $$observable = (function () {
return typeof Symbol === 'function' && Symbol.observable || '@@observable';
})();
/**
* These are private action types reserved by Redux.
* For any unknown actions, you must return the current state.
* If the current state is undefined, you must return the initial state.
* Do not reference these action types directly in your code.
*/
var randomString = function randomString() {
return Math.random().toString(36).substring(7).split('').join('.');
};
var ActionTypes = {
INIT: "@@redux/INIT" + randomString(),
REPLACE: "@@redux/REPLACE" + randomString(),
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
}
};
/**
* @param {any} obj The object to inspect.
* @returns {boolean} True if the argument appears to be a plain object.
*/
function isPlainObject(obj) {
if (typeof obj !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
function kindOf(val) {
var typeOfVal = typeof val;
if (process.env.NODE_ENV !== 'production') {
// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
function miniKindOf(val) {
if (val === void 0) return 'undefined';
if (val === null) return 'null';
var type = typeof val;
switch (type) {
case 'boolean':
case 'string':
case 'number':
case 'symbol':
case 'function':
{
return type;
}
}
if (Array.isArray(val)) return 'array';
if (isDate(val)) return 'date';
if (isError(val)) return 'error';
var constructorName = ctorName(val);
switch (constructorName) {
case 'Symbol':
case 'Promise':
case 'WeakMap':
case 'WeakSet':
case 'Map':
case 'Set':
return constructorName;
} // other
return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
}
function ctorName(val) {
return typeof val.constructor === 'function' ? val.constructor.name : null;
}
function isError(val) {
return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
}
function isDate(val) {
if (val instanceof Date) return true;
return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
}
typeOfVal = miniKindOf(val);
}
return typeOfVal;
}
/**
* Creates a Redux store that holds the state tree.
* The only way to change the data in the store is to call `dispatch()` on it.
*
* There should only be a single store in your app. To specify how different
* parts of the state tree respond to actions, you may combine several reducers
* into a single reducer function by using `combineReducers`.
*
* @param {Function} reducer A function that returns the next state tree, given
* the current state tree and the action to handle.
*
* @param {any} [preloadedState] The initial state. You may optionally specify it
* to hydrate the state from the server in universal apps, or to restore a
* previously serialized user session.
* If you use `combineReducers` to produce the root reducer function, this must be
* an object with the same shape as `combineReducers` keys.
*
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
* to enhance the store with third-party capabilities such as middleware,
* time travel, persistence, etc. The only store enhancer that ships with Redux
* is `applyMiddleware()`.
*
* @returns {Store} A Redux store that lets you read the state, dispatch actions
* and subscribe to changes.
*/
function createStore(reducer, preloadedState, enhancer) {
var _ref2;
if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');
}
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
enhancer = preloadedState;
preloadedState = undefined;
}
if (typeof enhancer !== 'undefined') {
if (typeof enhancer !== 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(1) : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
}
return enhancer(createStore)(reducer, preloadedState);
}
if (typeof reducer !== 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(2) : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
}
var currentReducer = reducer;
var currentState = preloadedState;
var currentListeners = [];
var nextListeners = currentListeners;
var isDispatching = false;
/**
* This makes a shallow copy of currentListeners so we can use
* nextListeners as a temporary list while dispatching.
*
* This prevents any bugs around consumers calling
* subscribe/unsubscribe in the middle of a dispatch.
*/
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
/**
* Reads the state tree managed by the store.
*
* @returns {any} The current state tree of your application.
*/
function getState() {
if (isDispatching) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
}
return currentState;
}
/**
* Adds a change listener. It will be called any time an action is dispatched,
* and some part of the state tree may potentially have changed. You may then
* call `getState()` to read the current state tree inside the callback.
*
* You may call `dispatch()` from a change listener, with the following
* caveats:
*
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
* If you subscribe or unsubscribe while the listeners are being invoked, this
* will not have any effect on the `dispatch()` that is currently in progress.
* However, the next `dispatch()` call, whether nested or not, will use a more
* recent snapshot of the subscription list.
*
* 2. The listener should not expect to see all state changes, as the state
* might have been updated multiple times during a nested `dispatch()` before
* the listener is called. It is, however, guaranteed that all subscribers
* registered before the `dispatch()` started will be called with the latest
* state by the time it exits.
*
* @param {Function} listener A callback to be invoked on every dispatch.
* @returns {Function} A function to remove this change listener.
*/
function subscribe(listener) {
if (typeof listener !== 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(4) : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
}
if (isDispatching) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener);
return function unsubscribe() {
if (!isSubscribed) {
return;
}
if (isDispatching) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index = nextListeners.indexOf(listener);
nextListeners.splice(index, 1);
currentListeners = null;
};
}
/**
* Dispatches an action. It is the only way to trigger a state change.
*
* The `reducer` function, used to create the store, will be called with the
* current state tree and the given `action`. Its return value will
* be considered the **next** state of the tree, and the change listeners
* will be notified.
*
* The base implementation only supports plain object actions. If you want to
* dispatch a Promise, an Observable, a thunk, or something else, you need to
* wrap your store creating function into the corresponding middleware. For
* example, see the documentation for the `redux-thunk` package. Even the
* middleware will eventually dispatch plain object actions using this method.
*
* @param {Object} action A plain object representing “what changed”. It is
* a good idea to keep actions serializable so you can record and replay user
* sessions, or use the time travelling `redux-devtools`. An action must have
* a `type` property which may not be `undefined`. It is a good idea to use
* string constants for action types.
*
* @returns {Object} For convenience, the same action object you dispatched.
*
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
* return something else (for example, a Promise you can await).
*/
function dispatch(action) {
if (!isPlainObject(action)) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(7) : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
}
if (typeof action.type === 'undefined') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
}
if (isDispatching) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');
}
try {
isDispatching = true;
currentState = currentReducer(currentState, action);
} finally {
isDispatching = false;
}
var listeners = currentListeners = nextListeners;
for (var i = 0; i < listeners.length; i++) {
var listener = listeners[i];
listener();
}
return action;
}
/**
* Replaces the reducer currently used by the store to calculate the state.
*
* You might need this if your app implements code splitting and you want to
* load some of the reducers dynamically. You might also need this if you
* implement a hot reloading mechanism for Redux.
*
* @param {Function} nextReducer The reducer for the store to use instead.
* @returns {void}
*/
function replaceReducer(nextReducer) {
if (typeof nextReducer !== 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(10) : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
}
currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
// Any reducers that existed in both the new and old rootReducer
// will receive the previous state. This effectively populates
// the new state tree with any relevant data from the old one.
dispatch({
type: ActionTypes.REPLACE
});
}
/**
* Interoperability point for observable/reactive libraries.
* @returns {observable} A minimal observable of state changes.
* For more information, see the observable proposal:
* https://github.com/tc39/proposal-observable
*/
function observable() {
var _ref;
var outerSubscribe = subscribe;
return _ref = {
/**
* The minimal observable subscription method.
* @param {Object} observer Any object that can be used as an observer.
* The observer object should have a `next` method.
* @returns {subscription} An object with an `unsubscribe` method that can
* be used to unsubscribe the observable from the store, and prevent further
* emission of values from the observable.
*/
subscribe: function subscribe(observer) {
if (typeof observer !== 'object' || observer === null) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(11) : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
}
function observeState() {
if (observer.next) {
observer.next(getState());
}
}
observeState();
var unsubscribe = outerSubscribe(observeState);
return {
unsubscribe: unsubscribe
};
}
}, _ref[$$observable] = function () {
return this;
}, _ref;
} // When a store is created, an "INIT" action is dispatched so that every
// reducer returns their initial state. This effectively populates
// the initial state tree.
dispatch({
type: ActionTypes.INIT
});
return _ref2 = {
dispatch: dispatch,
subscribe: subscribe,
getState: getState,
replaceReducer: replaceReducer
}, _ref2[$$observable] = observable, _ref2;
}
/**
* Prints a warning in the console if it exists.
*
* @param {String} message The warning message.
* @returns {void}
*/
function warning(message) {
/* eslint-disable no-console */
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error(message);
}
/* eslint-enable no-console */
try {
// This error was thrown as a convenience so that if you enable
// "break on all exceptions" in your console,
// it would pause the execution at this line.
throw new Error(message);
} catch (e) {} // eslint-disable-line no-empty
}
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
var reducerKeys = Object.keys(reducers);
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
if (reducerKeys.length === 0) {
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
}
if (!isPlainObject(inputState)) {
return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
}
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
});
unexpectedKeys.forEach(function (key) {
unexpectedKeyCache[key] = true;
});
if (action && action.type === ActionTypes.REPLACE) return;
if (unexpectedKeys.length > 0) {
return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
}
}
function assertReducerShape(reducers) {
Object.keys(reducers).forEach(function (key) {
var reducer = reducers[key];
var initialState = reducer(undefined, {
type: ActionTypes.INIT
});
if (typeof initialState === 'undefined') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : "The slice reducer for key \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
}
if (typeof reducer(undefined, {
type: ActionTypes.PROBE_UNKNOWN_ACTION()
}) === 'undefined') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : "The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
}
});
}
/**
* Turns an object whose values are different reducer functions, into a single
* reducer function. It will call every child reducer, and gather their results
* into a single state object, whose keys correspond to the keys of the passed
* reducer functions.
*
* @param {Object} reducers An object whose values correspond to different
* reducer functions that need to be combined into one. One handy way to obtain
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
* undefined for any action. Instead, they should return their initial state
* if the state passed to them was undefined, and the current state for any
* unrecognized action.
*
* @returns {Function} A reducer function that invokes every reducer inside the
* passed object, and builds a state object with the same shape.
*/
function combineReducers(reducers) {
var reducerKeys = Object.keys(reducers);
var finalReducers = {};
for (var i = 0; i < reducerKeys.length; i++) {
var key = reducerKeys[i];
if (process.env.NODE_ENV !== 'production') {
if (typeof reducers[key] === 'undefined') {
warning("No reducer provided for key \"" + key + "\"");
}
}
if (typeof reducers[key] === 'function') {
finalReducers[key] = reducers[key];
}
}
var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
// keys multiple times.
var unexpectedKeyCache;
if (process.env.NODE_ENV !== 'production') {
unexpectedKeyCache = {};
}
var shapeAssertionError;
try {
assertReducerShape(finalReducers);
} catch (e) {
shapeAssertionError = e;
}
return function combination(state, action) {
if (state === void 0) {
state = {};
}
if (shapeAssertionError) {
throw shapeAssertionError;
}
if (process.env.NODE_ENV !== 'production') {
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
if (warningMessage) {
warning(warningMessage);
}
}
var hasChanged = false;
var nextState = {};
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
var _key = finalReducerKeys[_i];
var reducer = finalReducers[_key];
var previousStateForKey = state[_key];
var nextStateForKey = reducer(previousStateForKey, action);
if (typeof nextStateForKey === 'undefined') {
var actionType = action && action.type;
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : "When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : '(unknown type)') + ", the slice reducer for key \"" + _key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.");
}
nextState[_key] = nextStateForKey;
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
}
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
return hasChanged ? nextState : state;
};
}
function bindActionCreator(actionCreator, dispatch) {
return function () {
return dispatch(actionCreator.apply(this, arguments));
};
}
/**
* Turns an object whose values are action creators, into an object with the
* same keys, but with every function wrapped into a `dispatch` call so they
* may be invoked directly. This is just a convenience method, as you can call
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
*
* For convenience, you can also pass an action creator as the first argument,
* and get a dispatch wrapped function in return.
*
* @param {Function|Object} actionCreators An object whose values are action
* creator functions. One handy way to obtain it is to use ES6 `import * as`
* syntax. You may also pass a single function.
*
* @param {Function} dispatch The `dispatch` function available on your Redux
* store.
*
* @returns {Function|Object} The object mimicking the original object, but with
* every action creator wrapped into the `dispatch` call. If you passed a
* function as `actionCreators`, the return value will also be a single
* function.
*/
function bindActionCreators(actionCreators, dispatch) {
if (typeof actionCreators === 'function') {
return bindActionCreator(actionCreators, dispatch);
}
if (typeof actionCreators !== 'object' || actionCreators === null) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(16) : "bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
}
var boundActionCreators = {};
for (var key in actionCreators) {
var actionCreator = actionCreators[key];
if (typeof actionCreator === 'function') {
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
}
}
return boundActionCreators;
}
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
*
* @param {...Function} funcs The functions to compose.
* @returns {Function} A function obtained by composing the argument functions
* from right to left. For example, compose(f, g, h) is identical to doing
* (...args) => f(g(h(...args))).
*/
function compose() {
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
if (funcs.length === 0) {
return function (arg) {
return arg;
};
}
if (funcs.length === 1) {
return funcs[0];
}
return funcs.reduce(function (a, b) {
return function () {
return a(b.apply(void 0, arguments));
};
});
}
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
function applyMiddleware() {
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
middlewares[_key] = arguments[_key];
}
return function (createStore) {
return function () {
var store = createStore.apply(void 0, arguments);
var _dispatch = function dispatch() {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
};
var middlewareAPI = {
getState: store.getState,
dispatch: function dispatch() {
return _dispatch.apply(void 0, arguments);
}
};
var chain = middlewares.map(function (middleware) {
return middleware(middlewareAPI);
});
_dispatch = compose.apply(void 0, chain)(store.dispatch);
return _objectSpread(_objectSpread({}, store), {}, {
dispatch: _dispatch
});
};
};
}
/*
* This is a dummy function to check if the function name has been altered by minification.
* If the function has been minified and NODE_ENV !== 'production', warn the user.
*/
function isCrushed() {}
if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
}
export { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore };
webpack://frontend-tpt/../../packages/tvg-lib-ts-types/User.ts
export enum WagerProfile {
PORT_GENERIC = "PORT-Generic",
FDR_GENERIC = "FDR-Generic",
PORT_FL = "PORT-FL",
PORT_NJ = "PORT-NJ",
PORT_PA = "PORT-PA",
PORT_IA = "PORT-IA"
}
export interface Address {
streetNumber: string;
address1: string;
address2: string;
city: string;
stateAbbr: string;
state: string;
zipCode: string;
country: string;
type: AddressSelection;
}
export type AddressSelection = "RESIDENTIAL" | "MAILING";
export enum AccountRolesEnum {
USER = "USER",
TALENT = "TALENT",
WAGEROPS = "WAGEROPS",
ADMIN = "ADMIN"
}
export enum RolesMap {
TALENT = "TALENT",
WAGEROPS = "WAGEROPS",
ADMIN = "ADMIN"
}
export interface UserInfo {
accountNumber: string;
emailAddress: string;
firstName: string;
homeAddress: Address;
lastName: string;
mailingAddress: Address;
primaryPhone: string;
profile: string;
signalProviderId: string;
status: string;
transportId: string;
userName: string;
wagerStatus: number;
accountRoles: Array<AccountRolesEnum>;
currentLocationByState?: string;
hasMadePreviousWager?: boolean | null;
}
export interface User {
logged: boolean;
user: UserInfo;
}
export interface UserPromo {
id: number;
optedIn: boolean;
path: string;
}
export type UserOptedInPromos = Record<string, boolean>;
export type FavoriteTrackWithId = Record<string, string>;
export interface BrazeCardNumber {
unviewed: number;
totalCards: number;
/* eslint-disable @typescript-eslint/no-explicit-any */
cards: Array<any>; // Array<BrazeContentCard>;
}
export interface SSNObject {
firstName: string;
lastName: string;
yearOfBirth: number;
monthOfBirth: number;
dayOfBirth: number;
address: string;
zipCode: string;
lastFourSSN: string;
}
export interface AddressParam {
streetNumber: string;
address1: string;
address2: string;
zipCode: string;
city: string;
state: string;
country: string;
}
export type UserDetailsSubscription = Record<"email", boolean>;
export interface UserDetailsSignalProvider {
name: string;
providerId: string;
}
export interface UserDetails {
username: string;
password: string;
email: string;
firstName: string;
lastName: string;
dateOfBirth: string;
homeAddress: AddressParam;
mailAddress: AddressParam;
sameMailingAddress: boolean;
socialSecurityNumber: string;
phone: string;
subscriptions: UserDetailsSubscription;
signalProvider: UserDetailsSignalProvider;
}
export interface SignupDetails {
promoCode: string;
campaignCode: string;
rfr: string;
}
webpack://frontend-tpt/../../packages/urp-lib-amplitude/src/modules/geolocation/types.ts
import { BaseEventProps } from "../../types";
export type EventProps = BaseEventProps;
export enum MediatorEventType {
SET_USER_STATE = "SET_USER_STATE",
GEOCOMPLY_STATUS = "GEOCOMPLY_STATUS",
REMOVE_GEO_TOKEN = "REMOVE_GEO_TOKEN"
}
export interface EventData {
type: MediatorEventType;
payload: {
region: string;
status: string;
removedBy: string;
};
}
webpack://frontend-tpt/../../packages/tvg-lib-login-service/services/static.js
export const errors = {
ACCOUNT_DISABLED: "loginFailureAccountDisabled",
ACCOUNT_LOCKED: "loginFailureAccountLocked",
ACCOUNT_UPDATE_REQUIRED: "loginFailureAccountUpdateRequired",
BLACK_LISTED_LOCATION: "blackListedLocation",
BLOCKED_SERVICE: "geoLocationBlockedService",
BLOCKED_SOFTWARE: "geoLocationBlockedSoftware",
GEO_SERVICE_FAILURE: "loginFailureGeneric",
INVALID_CREDENTIALS: "loginFailureInvalidCredentials",
INVALID_GEO: "geoLocationUnconfirmedOrInvalid",
INVALID_GEOPACKET: "geoLocationUnconfirmedOrInvalid",
INVALID_WAGERING_STATE: "loginFailureNonLegalState",
LOGIN_FAILED: "loginFailureGeneric",
LOGIN_REDIRECT: "loginSiteRedirect",
MISSING_TOKEN: "apiMissingUserSessionToken",
NON_LEGAL_STATE: "loginFailureNonLegalState",
OUT_OF_BOUNDARY: "geoLocationOutOfBoundary",
SESSION_NOT_FOUND: "apiUserSessionNotFound",
SESSION_TIMEOUT: "apiUserSessionTimedOut",
UNCONFIRMED_BOUNDARY: "geoLocationUnconfirmedOrInvalid",
USER_SESSION_LIMIT_REACHED: "loginFailureUserSessionLimitReached",
ACCOUNT_IN_TIMEOUT: "loginFailureRGTimeout",
ACCOUNT_SUSPENDED: "loginFailureRGSuspendedOrClose",
ACCOUNT_SELF_EXCLUDED: "loginFailureRGSuspendedOrClose",
InvalidPinException: "invalidPinException",
"com.tvg.pxp.exceptions.UserCompromisedCredentialsException":
"userCompromisedCredentials"
};
export const CONSTANTS = {
// REDUCERS CONSTANTS
SET_SESSION_SUCCESS: "SET_SESSION_SUCCESS",
SET_SESSION_ERROR: "SET_SESSION_ERROR",
CLEAR_SESSION: "CLEAR_SESSION",
SET_USER: "SET_USER",
CMS_LOGIN_MESSAGES: "CMS_LOGIN_MESSAGES",
// MEDIATOR CONSTANTS
"TVG_LOGIN:DO_LOGIN": "TVG_LOGIN:DO_LOGIN",
"TVG_LOGIN:DO_LOGIN_FORM": "TVG_LOGIN:DO_LOGIN_FORM",
"TVG_LOGIN:DO_LOGOUT": "TVG_LOGIN:DO_LOGOUT",
"TVG_LOGIN:USER_SESSION_UPDATE": "TVG_LOGIN:USER_SESSION_UPDATE",
"TVG_LOGIN:OPEN_LOGIN_MODAL": "TVG_LOGIN:OPEN_LOGIN_MODAL",
"TVG_LOGIN:CLOSE_LOGIN_MODAL": "TVG_LOGIN:CLOSE_LOGIN_MODAL",
"TVG_LOGIN:VALIDATE_SESSION": "TVG_LOGIN:VALIDATE_SESSION",
"TVG_LOGIN:TOUCH_ID_ERROR": "TVG_LOGIN:TOUCH_ID_ERROR",
// EXTERNAL REDUCERS
UPDATE_USER_DATA: "UPDATE_USER_DATA",
// METRICS
METRIC_USER_LOGIN: "user_login"
};
webpack://frontend-tpt/../../node_modules/jwt-decode/build/jwt-decode.esm.js
function e(e){this.message=e}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,a=0,i=0,c="";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return c};function t(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if("string"!=typeof e)throw new n("Invalid token specified");var o=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(".")[o]))}catch(e){throw new n("Invalid token specified: "+e.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";export default o;export{n as InvalidTokenError};
//# sourceMappingURL=jwt-decode.esm.js.map
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/requiredArgs/index.js
export default function requiredArgs(required, args) {
if (args.length < required) {
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
}
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/toDate/index.js
import requiredArgs from '../_lib/requiredArgs/index.js';
/**
* @name toDate
* @category Common Helpers
* @summary Convert the given argument to an instance of Date.
*
* @description
* Convert the given argument to an instance of Date.
*
* If the argument is an instance of Date, the function returns its clone.
*
* If the argument is a number, it is treated as a timestamp.
*
* If the argument is none of the above, the function returns Invalid Date.
*
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
*
* @param {Date|Number} argument - the value to convert
* @returns {Date} the parsed date in the local time zone
* @throws {TypeError} 1 argument required
*
* @example
* // Clone the date:
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
* //=> Tue Feb 11 2014 11:30:30
*
* @example
* // Convert the timestamp to date:
* const result = toDate(1392098430000)
* //=> Tue Feb 11 2014 11:30:30
*/
export default function toDate(argument) {
requiredArgs(1, arguments);
var argStr = Object.prototype.toString.call(argument); // Clone the date
if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
return new Date(argument.getTime());
} else if (typeof argument === 'number' || argStr === '[object Number]') {
return new Date(argument);
} else {
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
// eslint-disable-next-line no-console
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
console.warn(new Error().stack);
}
return new Date(NaN);
}
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/toInteger/index.js
export default function toInteger(dirtyNumber) {
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
return NaN;
}
var number = Number(dirtyNumber);
if (isNaN(number)) {
return number;
}
return number < 0 ? Math.ceil(number) : Math.floor(number);
}
webpack://frontend-tpt/../../packages/urp-lib-amplitude/src/modules/geolocation/utils.ts
import mediator from "@tvg/mediator";
import { MediatorEventType } from "./types";
export const amplitudeSetUserState = (region: string) => {
mediator.base.dispatch({
type: MediatorEventType.SET_USER_STATE,
payload: {
region
}
});
};
export const amplitudeSetGeoComplyStatus = (status: string) => {
mediator.base.dispatch({
type: MediatorEventType.GEOCOMPLY_STATUS,
payload: {
status
}
});
};
export const amplitudeRemovedGeoToken = (removedBy: string) => {
mediator.base.dispatch({
type: MediatorEventType.REMOVE_GEO_TOKEN,
payload: {
removedBy
}
});
};
webpack://frontend-tpt/../../node_modules/universal-cookie/es6/utils.js
import * as cookie from 'cookie';
export function hasDocumentCookie() {
// Can we get/set cookies on document.cookie?
return typeof document === 'object' && typeof document.cookie === 'string';
}
export function cleanCookies() {
document.cookie.split(';').forEach(function (c) {
document.cookie = c
.replace(/^ +/, '')
.replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/');
});
}
export function parseCookies(cookies, options) {
if (typeof cookies === 'string') {
return cookie.parse(cookies, options);
}
else if (typeof cookies === 'object' && cookies !== null) {
return cookies;
}
else {
return {};
}
}
export function isParsingCookie(value, doNotParse) {
if (typeof doNotParse === 'undefined') {
// We guess if the cookie start with { or [, it has been serialized
doNotParse =
!value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '"');
}
return !doNotParse;
}
export function readCookie(value, options = {}) {
const cleanValue = cleanupCookieValue(value);
if (isParsingCookie(cleanValue, options.doNotParse)) {
try {
return JSON.parse(cleanValue);
}
catch (e) {
// At least we tried
}
}
// Ignore clean value if we failed the deserialization
// It is not relevant anymore to trim those values
return value;
}
function cleanupCookieValue(value) {
// express prepend j: before serializing a cookie
if (value && value[0] === 'j' && value[1] === ':') {
return value.substr(2);
}
return value;
}
webpack://frontend-tpt/../../packages/sh-lib-utils/cookieUtils.ts
import tvgConf from "@tvg/conf";
import Cookies from "universal-cookie";
export const cookies = new Cookies();
export const getDomainForCookie = () => {
let cookieDomain: string | undefined;
if (typeof window !== "undefined") {
const domain = window.location.hostname;
const environment = tvgConf().environment as string;
cookieDomain = ["local", environment].some((env) => domain.startsWith(env))
? domain.substring(domain.indexOf("."))
: `.${domain}`;
}
return cookieDomain;
};
const getDomainWithoutSubdomain = () => {
if (typeof window === "undefined") return undefined;
const hostnameParts = window.location.hostname.split(".");
const domainWithoutSubdomain = hostnameParts.slice(-2).join(".");
return `.${domainWithoutSubdomain}`;
};
export const getCookieOptions = (removeSubdomain = false) => ({
domain: !removeSubdomain ? getDomainForCookie() : getDomainWithoutSubdomain(),
path: "/",
doNotParse: false
});
export const addCookie = (
cookieName: string,
cookieValue: string,
maxAge?: number,
removeSubdomain = false
): void => {
if (getCookieValue(cookieName)) {
removeCookie(cookieName);
}
cookies.set(cookieName, cookieValue, {
...getCookieOptions(removeSubdomain),
maxAge
});
};
export const getCookieValue = <T = string>(
cookieName: string,
defaultValue?: T,
forceParse = true
): T =>
cookies.get(cookieName, {
...getCookieOptions(),
doNotParse: !forceParse
}) || defaultValue;
export const removeCookie = (cookieName: string): void => {
cookies.remove(cookieName, getCookieOptions());
};
webpack://frontend-tpt/../../packages/sh-lib-geolocation/src/solus/types/solus.ts
import { BinaryFn, NullaryFn, UnaryFn } from "@tvg/ts-types/Functional";
import type { Troubleshooter } from "@fdr/types/ts/GeoLocation";
import { GeoClientErrorCodes, GeoClientErrorMessages } from "./gcHtml5";
// @ts-ignore -> Added this type because FDR doesnt exist anymore
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type GeoLocationResponseRejected = any;
// @ts-ignore -> Added this type because FDR doesnt exist anymore
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type GeoLocationResponseSuccess = any;
export interface GeolocationSession {
userId: string;
sessionId: string;
userAuthToken?: string;
}
export interface GeoPacket {
geopacket: string;
state: string;
product: string;
}
export type GeolocationCallbackSuccess = BinaryFn<
GeoLocationResponseSuccess,
string,
void
>;
export type GeolocationCallbackFailure = UnaryFn<
GeolocationFailureResponse,
void
>;
export interface GeolocationFailureResponse {
code: GeoClientErrorCodes;
message: GeoClientErrorMessages;
}
export type GeolocationRejectionCallback = BinaryFn<
GeoLocationResponseRejected,
string,
void
>;
export interface GeolocationCallbacks {
onSuccess: GeolocationCallbackSuccess;
onFailed: GeolocationCallbackFailure;
onReject: GeolocationRejectionCallback;
onProcess: (isProcessing?: boolean) => void;
onRetry: (attemptsCounter?: number) => void;
onRefresh: GeolocationCallbackSuccess;
}
export enum GeolocationReason {
LOGIN = "Login",
PERIODIC = "PERIODIC"
}
export interface GeolocationRejection {
message: string;
troubleshooter: Array<Troubleshooter>;
state?: string;
}
export enum GeoLocationLicenseType {
SOLUS = "SOLUS",
GEOLOCATION = "GEO"
}
export interface GeoLocationConfig {
state: string;
product: "RACING";
licenseType: GeoLocationLicenseType;
}
export enum GeoStorageKey {
LICENSE = "X-Geo-License",
GEO_PACKET = "X-Geo-Packet",
RELOCATE_ID = "GEO_RELOCATE_PROCESS_ID"
}
export enum GeoClientFields {
SESSION_ID = "session_id",
PREVIOUS_TOKEN_STATUS = "previousTokenStatus"
}
export enum GeoClientTokenStatus {
NO_TOKEN = "NO_TOKEN",
SUCCESSFUL_TOKEN = "successful_token",
FAILED_TOKEN = "failed_token"
}
export enum GeolocationCustomErrorCodes {
USER_UNAUTHORIZED = 1401,
INVALID_LICENSE = 1606,
UNAUTHORIZED_LOCATION_PERMISSION = 1801
}
export enum GeolocationCustomErrorMessages {
USER_UNAUTHORIZED = "User Unauthorized",
INVALID_LICENSE = "Error trying to get license",
UNAUTHORIZED_LOCATION_PERMISSION = "Browser location unauthorized"
}
export interface GeoComplyCache {
saveCache: UnaryFn<string, void>;
removeCache: NullaryFn<void>;
getCache: NullaryFn<string>;
}
export type GeoComplyCacheEntries = Record<GeoStorageKey, GeoComplyCache>;
export type GeolocationRelocateUserCallback = UnaryFn<
GeoClientTokenStatus,
void
>;
webpack://frontend-tpt/../../node_modules/universal-cookie/es6/Cookies.js
import * as cookie from 'cookie';
import { hasDocumentCookie, parseCookies, readCookie } from './utils';
export default class Cookies {
constructor(cookies, options) {
this.changeListeners = [];
this.HAS_DOCUMENT_COOKIE = false;
this.cookies = parseCookies(cookies, options);
new Promise(() => {
this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
}).catch(() => { });
}
_updateBrowserValues(parseOptions) {
if (!this.HAS_DOCUMENT_COOKIE) {
return;
}
this.cookies = cookie.parse(document.cookie, parseOptions);
}
_emitChange(params) {
for (let i = 0; i < this.changeListeners.length; ++i) {
this.changeListeners[i](params);
}
}
get(name, options = {}, parseOptions) {
this._updateBrowserValues(parseOptions);
return readCookie(this.cookies[name], options);
}
getAll(options = {}, parseOptions) {
this._updateBrowserValues(parseOptions);
const result = {};
for (let name in this.cookies) {
result[name] = readCookie(this.cookies[name], options);
}
return result;
}
set(name, value, options) {
if (typeof value === 'object') {
value = JSON.stringify(value);
}
this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: value });
if (this.HAS_DOCUMENT_COOKIE) {
document.cookie = cookie.serialize(name, value, options);
}
this._emitChange({ name, value, options });
}
remove(name, options) {
const finalOptions = (options = Object.assign(Object.assign({}, options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));
this.cookies = Object.assign({}, this.cookies);
delete this.cookies[name];
if (this.HAS_DOCUMENT_COOKIE) {
document.cookie = cookie.serialize(name, '', finalOptions);
}
this._emitChange({ name, value: undefined, options });
}
addChangeListener(callback) {
this.changeListeners.push(callback);
}
removeChangeListener(callback) {
const idx = this.changeListeners.indexOf(callback);
if (idx >= 0) {
this.changeListeners.splice(idx, 1);
}
}
}
webpack://frontend-tpt/../../packages/sh-lib-utils/sessionUtils.ts
import { Store } from "redux";
import jwt_decode from "jwt-decode";
import { get } from "lodash";
import { fromUnixTime, isAfter } from "date-fns";
import { PRODUCTS_FDR } from "@tvg/conf/src/product";
import tvgConf from "@tvg/conf";
import { amplitudeRemovedGeoToken } from "@urp/amplitude/src/modules/geolocation/utils";
import { addCookie, getCookieValue, removeCookie } from "./cookieUtils";
interface AuthToken {
ses: number;
sub: number;
usn: string;
prd: string;
crt: number;
eml: string;
src: number;
mfa: boolean;
typ: number;
exp: number;
}
// como divido este? um com as coisas genericas, outro AUTH_TOKEN_COOKIE, LOGIN_TOKEN_COOKIE e WRAPPER_CONFIG_COOKIE,e outro com o resto
export const AUTH_TOKEN_COOKIE = "X-Auth-Token";
export const LOGIN_TOKEN_COOKIE = "X-Login-Token";
export const GEO_TOKEN_COOKIE = "X-Geo-Token";
export const GEO_LICENSE_COOKIE = "X-Geo-License";
export const SPORTSBOOK_REGION_COOKIE = "X-Sportsbook-Region";
export const WRAPPER_CONFIG_COOKIE = "wrapperAppConfig";
export const GEO_RELOCATE_PROCESS_ID = "geoRelocateProcessId";
export const KEEP_LOGOUT_PATH_SESSION_STORAGE = "lkp";
export const isTvg5 = () => tvgConf().product === "tvg5";
const isFdrProduct = () =>
PRODUCTS_FDR.some((product) => product === tvgConf().product);
export const decodeToken = (token?: string): AuthToken | {} => {
try {
if (token) {
return jwt_decode(token);
}
return {};
} catch (erro) {
console.warn("Error trying decode jwt:", erro);
return {};
}
};
export const getUserSessionData = (authToken: string) => {
const tokenDecoded = decodeToken(authToken);
return {
authToken,
sessionId: get(tokenDecoded, "ses", ""),
sessionExpireDate: get(tokenDecoded, "exp", ""),
fdUserId: get(tokenDecoded, "sub", ""),
userName: get(tokenDecoded, "usn", ""),
userEmail: get(tokenDecoded, "eml", "")
};
};
export const getUserSessionStartDate = (
authToken?: string
): Date | undefined => {
const tokenDecoded: AuthToken | {} = decodeToken(authToken);
return authToken || authToken === "undefined"
? fromUnixTime(get(tokenDecoded, "crt", new Date()))
: undefined;
};
export const createAuthTokenCookie = (token: string) => {
addCookie(AUTH_TOKEN_COOKIE, token);
};
export const getAuthTokenCookie = () => getCookieValue(AUTH_TOKEN_COOKIE, "");
export const clearAuthTokenCookie = () => removeCookie(AUTH_TOKEN_COOKIE);
export const clearLoginTokenCookie = () => removeCookie(LOGIN_TOKEN_COOKIE);
export const getGeoTokenCookie = () => {
let geoToken = "";
if (typeof window !== "undefined") {
geoToken = localStorage.getItem(GEO_TOKEN_COOKIE) || "";
}
return geoToken;
};
export const createGeoTokenCookie = (token: string) => {
if (typeof window !== "undefined") {
localStorage.setItem(GEO_TOKEN_COOKIE, token);
}
};
export const setLogoutKeepPage = (keepCurrentPage: boolean) => {
if (typeof window !== "undefined") {
if (keepCurrentPage) {
sessionStorage.setItem(
KEEP_LOGOUT_PATH_SESSION_STORAGE,
`${+keepCurrentPage}`
);
} else {
sessionStorage.removeItem(KEEP_LOGOUT_PATH_SESSION_STORAGE);
}
}
};
export const getLogoutKeepPage = (): boolean => {
if (typeof window !== "undefined") {
return Boolean(sessionStorage.getItem(KEEP_LOGOUT_PATH_SESSION_STORAGE));
}
return false;
};
export const clearGeoTokenCookie = (removedBy?: string) => {
if (typeof window !== "undefined") {
if (removedBy) {
amplitudeRemovedGeoToken(removedBy);
}
localStorage.removeItem(GEO_TOKEN_COOKIE);
}
};
export const getLicenseCached = () => {
let license = "";
if (typeof window !== "undefined") {
license = localStorage.getItem(GEO_LICENSE_COOKIE) || "";
}
return license;
};
export const createLicenseCached = (token: string) => {
if (typeof window !== "undefined") {
localStorage.setItem(GEO_LICENSE_COOKIE, token);
}
};
export const clearLicenseCached = () => {
if (typeof window !== "undefined") {
localStorage.removeItem(GEO_LICENSE_COOKIE);
}
};
export const getTemporaryRelocateUserProcessId = () => {
let processId = "";
if (typeof window !== "undefined") {
processId = sessionStorage.getItem(GEO_RELOCATE_PROCESS_ID) || "";
}
return processId;
};
export const createTemporaryRelocateUserProcessId = (processId: string) => {
if (typeof window !== "undefined") {
sessionStorage.setItem(GEO_RELOCATE_PROCESS_ID, processId);
}
};
export const clearTemporaryRelocateUserProcessId = () => {
if (typeof window !== "undefined") {
sessionStorage.removeItem(GEO_RELOCATE_PROCESS_ID);
}
};
export const createSportsbookRegionCookie = (region: string) => {
addCookie(SPORTSBOOK_REGION_COOKIE, region);
};
export const getSportsbookRegionCookie = () =>
getCookieValue(SPORTSBOOK_REGION_COOKIE);
export const clearSportsbookRegionCookie = () => {
removeCookie(SPORTSBOOK_REGION_COOKIE);
};
export const getLoginAuthToken = () => getCookieValue(LOGIN_TOKEN_COOKIE);
export const isSessionExpired = (authToken: string) => {
const { sessionExpireDate } = getUserSessionData(authToken);
return isAfter(new Date(), fromUnixTime(sessionExpireDate));
};
export const isAccountCompliantSelector = (store: Store): boolean => {
const enableAWFlows = get(store, "capi.featureToggles.enableAWFlows", false);
const logged = get(store, "userData.logged");
const isVerified = get(store, "userData.isVerified");
const requiresVerification = (enableAWFlows && isTvg5()) || isFdrProduct();
if (logged && requiresVerification) {
return !!isVerified;
}
return !!logged;
};
export const checkValidWageringState = (
selectedState: string,
allowedStates: Array<string>
): boolean =>
!!selectedState && allowedStates && allowedStates.includes(selectedState);
export const createWrapperAppConfigCookie = (token: string) => {
addCookie(WRAPPER_CONFIG_COOKIE, token);
};
export const removeWrapperAppConfigCookie = () => {
removeCookie(WRAPPER_CONFIG_COOKIE);
};
export const getWrapperAppConfigCookie = () =>
getCookieValue<string | undefined>(WRAPPER_CONFIG_COOKIE, undefined, false);
webpack://frontend-tpt/../../packages/sh-lib-geolocation/src/solus/utils.ts
import { get } from "lodash";
import {
createGeoTokenCookie,
createLicenseCached,
getGeoTokenCookie,
getLicenseCached,
clearGeoTokenCookie,
clearLicenseCached,
getTemporaryRelocateUserProcessId,
createTemporaryRelocateUserProcessId,
clearTemporaryRelocateUserProcessId
} from "@tvg/sh-utils/sessionUtils";
import { amplitudeRemovedGeoToken } from "@urp/amplitude/src/modules/geolocation/utils";
import {
GeoClientTokenStatus,
GeoComplyCacheEntries,
GeoStorageKey
} from "./types/solus";
export const geoDataMapped: GeoComplyCacheEntries = {
[GeoStorageKey.GEO_PACKET]: {
saveCache: createGeoTokenCookie,
removeCache: clearGeoTokenCookie,
getCache: getGeoTokenCookie
},
[GeoStorageKey.LICENSE]: {
saveCache: createLicenseCached,
removeCache: clearLicenseCached,
getCache: getLicenseCached
},
[GeoStorageKey.RELOCATE_ID]: {
saveCache: createTemporaryRelocateUserProcessId,
removeCache: clearTemporaryRelocateUserProcessId,
getCache: getTemporaryRelocateUserProcessId
}
};
export const setCacheGeoData = (
storageKey: GeoStorageKey,
storageValue: string
) => {
const saveCache = get(geoDataMapped, `${storageKey}.saveCache`);
if (typeof window !== "undefined" && typeof saveCache === "function") {
saveCache(storageValue);
}
};
export const cleanCacheGeoData = (removedBy?: string) => {
if (typeof window !== "undefined") {
if (removedBy) {
amplitudeRemovedGeoToken(removedBy);
}
Object.values(GeoStorageKey).forEach((geoStorageKey) => {
const removeCache = get(geoDataMapped, `${geoStorageKey}.removeCache`);
if (typeof removeCache === "function") {
removeCache();
}
});
}
};
export const getCacheGeoData = (storageKey: GeoStorageKey) => {
const getCache = get(geoDataMapped, `${storageKey}.getCache`);
let geoData = null;
if (typeof window !== "undefined" && typeof getCache === "function") {
geoData = getCache();
}
return geoData;
};
export const getPreviousTokenStatus = (tokenStatus?: boolean) => {
if (typeof tokenStatus === "undefined") {
return GeoClientTokenStatus.NO_TOKEN;
}
return tokenStatus
? GeoClientTokenStatus.SUCCESSFUL_TOKEN
: GeoClientTokenStatus.FAILED_TOKEN;
};
export const getCacheGeoClientLicense = () =>
getCacheGeoData(GeoStorageKey.LICENSE);
export const getCacheGeoPacket = () =>
getCacheGeoData(GeoStorageKey.GEO_PACKET);
// @deprecated
export const getGeoExpiryTime = (geolocateIn: number) => {
const MAX_GEOLOCATE_TIME = 300;
const MAX_GEOLOCATE_DIFF = geolocateIn - 30; // reduce by 30 seconds // 3570
const MIN_GEOLOCATE_DIFF = geolocateIn * 0.7; // reduce by 30% // 2499
const buffer =
geolocateIn >= MAX_GEOLOCATE_TIME ? MAX_GEOLOCATE_DIFF : MIN_GEOLOCATE_DIFF;
const bufferInMilliseconds = buffer * 1000;
return bufferInMilliseconds;
};
export const getGeoExpiryTimeByNow = (geolocateIn: number, expires: Date) => {
const now = Date.now();
const maxGeoLocateTime = getGeoExpiryTime(geolocateIn);
const expirationDiff = +expires - now;
if (expirationDiff > maxGeoLocateTime) {
return maxGeoLocateTime;
}
return Math.max(0, expirationDiff);
};
webpack://frontend-tpt/../../packages/sh-lib-utils/xSellBridge.ts
import mediator from "@tvg/mediator";
import { BinaryFn } from "@tvg/ts-types/Functional";
import { noop } from "lodash";
import { createAuthTokenCookie } from "./sessionUtils";
import { UpdatedToken, LaunchInRegionDataXSell } from "./types/generalTypes";
import { isValidSessionByTokenXSell } from "./isValidSessionByToken";
export const geolocationTokenUpdatedActionType =
"x-sell/bridge/to-native/geolocationTokenUpdated";
const isXSellLink = (url: string) => url.includes("/sportsbook");
const openExternalLink = (uri: string) => {
const isDeepLink = uri && isXSellLink(uri);
const event = isDeepLink
? {
type: "x-sell/bridge/to-react/onHandleUrl",
payload: { url: uri }
}
: {
type: "x-sell/bridge/to-react/onLoadExternalUrl",
payload: { webViewUrl: uri }
};
mediator.ios.dispatch(event);
};
const askLocation = (reason: string) => {
mediator.ios.dispatch({
type: "x-sell/bridge/to-react/onTriggerGeolocationRefresh",
payload: {
reason
}
});
};
const onTriggerGeolocation = (reason: string) => {
mediator.ios.dispatch({
type: "x-sell/bridge/to-react/onTriggerGeolocationRefresh",
payload: {
reason
}
});
};
const onTriggerSBMyBets = () =>
mediator.ios.dispatch({
type: "x-sell/bridge/to-react/onTriggerSBMyBets"
});
// XSell don't have way to understand if GeoComply is in progress
const subscribeGeolocationRequest = noop;
const subscribeGeolocationUpdate = (callback: Function) => {
const subscribeCallback = (data: { payload: UpdatedToken }) =>
callback(data.payload.geolocationData.geoToken);
mediator.ios.subscribe(geolocationTokenUpdatedActionType, subscribeCallback);
// trigged in subscribeLoginComplete
mediator.base.subscribe(geolocationTokenUpdatedActionType, subscribeCallback);
};
const subscribeLaunchInRegion = (
callback: BinaryFn<string | undefined, string, void>
) => {
mediator.ios.subscribe(
"x-sell/bridge/to-native/launchInRegion",
(data: { payload: LaunchInRegionDataXSell }) => {
const { authToken, sportsbookRegion } = data.payload;
if (authToken) {
createAuthTokenCookie(authToken);
}
callback(authToken, sportsbookRegion);
}
);
};
const subscribeWebViewForeground = () => {
document.addEventListener("visibilitychange", () => {
if (
document.visibilityState === "visible" &&
!isValidSessionByTokenXSell()
) {
mediator.base.dispatch({ type: "TRIGGER_LOGOUT" });
}
});
};
export default {
isXSellLink,
openExternalLink,
askLocation,
onTriggerGeolocation,
onTriggerSBMyBets,
subscribeGeolocationRequest,
subscribeGeolocationUpdate,
subscribeLaunchInRegion,
subscribeWebViewForeground
};
webpack://frontend-tpt/../../packages/sh-lib-utils/mobileUtils.ts
import TvgConfig from "@tvg/conf";
import mediator from "@tvg/mediator";
import { BinaryFn } from "@tvg/ts-types/Functional";
import { PRODUCTS_FDR_X_SELL, PRODUCTS_FDR } from "@tvg/conf/src/product";
import {
GeolocationFailureError,
GeolocationRejectedError
} from "@tvg/sh-geolocation/src/types";
import { cleanCacheGeoData } from "@tvg/sh-geolocation/src/solus/utils";
import xSellBridge from "./xSellBridge";
import hybridBridge from "./hybridBridge";
import { GeolocationVerified, UpdatedToken } from "./types/generalTypes";
export const isXSell = (product?: string) =>
PRODUCTS_FDR_X_SELL.includes(product || TvgConfig().product);
export const isMobile = (product?: string) =>
["fdrios", "fdrandroid", "fdrandroidgps", "androidwrapper"].includes(
product || TvgConfig().product
) || isXSell(product);
export const isIos = (product?: string) =>
["fdrios", "fdriosxsell"].includes(product || TvgConfig().product);
export const isAndroid = (product?: string) =>
["fdrandroid", "androidwrapper", "fdrandroidxsell", "fdrandroidgps"].includes(
product || TvgConfig().product
);
export const isMobileServerSide = () => {
if (typeof window === "undefined") {
return PRODUCTS_FDR.some((product) => product === TvgConfig().product);
}
return false;
};
export const isFdrProduct = () =>
PRODUCTS_FDR.some((product) => product === TvgConfig().product);
export const getAppBridge = () => {
if (!isMobile()) return null;
return isXSell() ? xSellBridge : hybridBridge;
};
export const buildUrl = (url: string) => {
const fullUrlPattern = /^https?:\/\//;
const relativeUrlPattern = /^\/.+/;
const emailOrTelPattern = /^(mailto|tel|sms):.+/;
let fullUrl = (url ?? "").trim();
if (relativeUrlPattern.test(fullUrl) && typeof window !== "undefined") {
fullUrl = `${window.location.protocol}//${window.location.host}${fullUrl}`;
} else if (
!fullUrlPattern.test(fullUrl) &&
!emailOrTelPattern.test(fullUrl)
) {
fullUrl = `http://${fullUrl}`;
}
return fullUrl;
};
export const openExternalLink = (link: string) => {
const appBridge = getAppBridge();
if (appBridge) {
appBridge.openExternalLink(buildUrl(link));
} else if (window) {
// eslint-disable-next-line security/detect-non-literal-fs-filename
const tab = window.open(link, "_blank");
tab?.focus();
}
};
export const askLocation = (reason: string = "") => {
const appBridge = getAppBridge();
if (!appBridge) {
console.error("[askLocation]: App bridge not in use!");
} else {
appBridge.askLocation(reason);
}
};
export const onTriggerGeolocation = (reason: string) => {
const appBridge = getAppBridge();
if (!appBridge) {
const type =
reason === "login" || "Normal" ? "GEOCOMPLY_REQUEST" : "GEOCOMPLY_RETRY";
if (type === "GEOCOMPLY_RETRY") {
cleanCacheGeoData();
}
mediator.base.dispatch({
type
});
} else {
appBridge.onTriggerGeolocation(reason);
}
};
export const subscribeGeolocationUpdate = (callback: Function) => {
const appBridge = getAppBridge();
if (!appBridge) {
mediator.base.subscribe(
"GEOCOMPLY_UPDATE",
(data: { payload: UpdatedToken }) => {
const token = data.payload.geolocationData?.geoToken;
return callback(token);
}
);
} else {
appBridge.subscribeGeolocationUpdate(callback);
}
};
export const subscribeGeolocationRequest = (callback: Function) => {
const appBridge = getAppBridge();
if (appBridge) {
appBridge.subscribeGeolocationRequest(callback);
} else {
mediator.base.subscribe("GEOCOMPLY_REQUEST", () => {
callback();
});
}
};
export const subscribeGeolocationVerified = (callback: Function) => {
if (isXSell()) {
return;
}
if (isMobile()) {
hybridBridge.subscribeGeolocationVerified(callback);
} else {
mediator.base.subscribe(
"GEOCOMPLY_VERIFIED",
(data: { payload: GeolocationVerified }) => {
const region = data.payload?.region;
const token = data.payload?.geoToken;
callback(token, region);
}
);
}
};
export const subscribeLocationFailure = (callback: Function) => {
if (isXSell()) {
return;
}
if (isMobile()) {
hybridBridge.subscribeLocationFailure(callback);
} else {
mediator.base.subscribe(
"GEOCOMPLY_FAILURE",
(data: { payload: GeolocationFailureError }) => {
callback(data.payload?.geoErrorName);
}
);
}
};
export const subscribeLocationRejected = (callback: Function) => {
if (isXSell()) {
return;
}
if (isMobile()) {
hybridBridge.subscribeLocationRejected(callback);
} else {
mediator.base.subscribe(
"GEOCOMPLY_REJECT",
(data: { payload: GeolocationRejectedError }) => {
const troubleshooters = data.payload?.troubleshooters;
const region = data.payload?.region;
callback(troubleshooters, region);
}
);
}
};
export const subscribeGeolocationRetry = (callback: Function) => {
if (!isMobile()) {
mediator.base.subscribe("GEOCOMPLY_RETRY", () => {
callback();
});
}
};
export const subscribeLaunchInRegion = (
callback: BinaryFn<string | undefined, string, void>
) => {
const appBridge = getAppBridge();
if (appBridge) {
appBridge.subscribeLaunchInRegion(callback);
}
};
export const subscribeWebViewForeground = () => {
const appBridge = getAppBridge();
if (appBridge) {
appBridge.subscribeWebViewForeground();
}
};
webpack://frontend-tpt/../../packages/tvg-lib-utils/generalUtils.ts
import axios from "axios";
import { isUndefined } from "lodash";
import tvgConf from "@tvg/conf";
import mediator from "@tvg/mediator";
import type { UnaryFn } from "@tvg/ts-types/Functional";
import type { TabItem } from "@tvg/ts-types/Common";
import type { Entry } from "@tvg/ts-types/ListItem";
import { WagerProfile } from "@tvg/ts-types/User";
import { isMobile, isXSell } from "@tvg/sh-utils/mobileUtils";
export const pluralize = (
count: number,
word: string,
showCount: boolean = true,
suffix: string = "s",
countPrefix: string = ""
) => {
const hasOnlyOne = count === 1;
const wordPluralized = !hasOnlyOne ? `${word}${suffix}` : word;
return showCount
? `${countPrefix}${count} ${wordPluralized}`
: wordPluralized;
};
export const buildTabs = (
options: Array<Entry>,
selected: string,
onSwitch: UnaryFn<string, void>,
isLoading: boolean,
className: string = ""
): TabItem[] =>
options.map((option) => ({
title: option.value,
isTitleUppercase: false,
isActive: selected === option.key,
isDisabled: isLoading,
onClick: () => onSwitch(option.key),
className,
qaLabel: `tab-item-${option.key}`
}));
export const downloadBlob = (blob: Blob, fileName: string) => {
const blobURL =
window.URL && window.URL.createObjectURL
? window.URL.createObjectURL(blob)
: window.webkitURL.createObjectURL(blob);
const tempLink = document.createElement("a");
tempLink.style.display = "none";
tempLink.href = blobURL;
tempLink.setAttribute("download", fileName);
// Safari thinks _blank anchor are pop ups. We only want to set _blank
// target if the browser does not support the HTML5 download attribute.
// This allows you to download files in desktop safari if pop up blocking
// is enabled.
if (typeof tempLink.download === "undefined") {
tempLink.setAttribute("target", "_blank");
}
if (document.body) document.body.appendChild(tempLink);
tempLink.click();
// Fixes "webkit blob resource error 1"
setTimeout(() => {
if (document.body) document.body.removeChild(tempLink);
if (window.URL) {
window.URL.revokeObjectURL(blobURL);
} else {
window.webkitURL.revokeObjectURL(blobURL);
}
}, 200);
};
export const downloadUrl = (url: string, filename: string, fileType: string) =>
isMobile(tvgConf().product)
? mediator.ios.dispatch({
type: "DOWNLOAD_FILE",
payload: {
url,
fileType,
filename
}
})
: axios(url, {
responseType: "blob",
withCredentials: true
}).then((response) => {
downloadBlob(response.data, filename);
});
export const replaceAll = (str: string, find: string, replace: string) => {
const escapedFind = find.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
return str.replace(new RegExp(escapedFind, "g"), replace);
};
export const capitalizeFirstLetter = (string: string = ""): string =>
string.charAt(0).toUpperCase() + string.slice(1);
export const validateRcnLoad = () => {
if (typeof window !== "undefined") {
// @ts-ignore
window.hasLoadedRobertStream = !!document.getElementById("rcnScript");
}
};
// TODO: Update this later when we have tvg5 context from BE
export const isTvg5 = () => tvgConf().product === "tvg5";
const SHOULD_REFETCH_LIMIT = 15 * 60 * 1000; // 15 minutes
let lastRefetch = 0;
export const recoverQueriesFromBackground = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
clients: any[]
) => {
let hidden;
let visibilityChange = "";
if (!isUndefined(document.hidden)) {
hidden = "hidden";
visibilityChange = "visibilitychange";
// @ts-ignore
} else if (!isUndefined(document.msHidden)) {
hidden = "msHidden";
visibilityChange = "msvisibilitychange";
// @ts-ignore
} else if (!isUndefined(document.webkitHidden)) {
hidden = "webkitHidden";
visibilityChange = "webkitvisibilitychange";
}
if (!isUndefined(document.addEventListener) && !isUndefined(hidden)) {
document.addEventListener(
visibilityChange,
() => {
if (document.visibilityState === "visible") {
(clients || []).forEach((client) => {
if (client && client.reFetchObservableQueries) {
const now = Date.now();
const shouldRefetch = now - lastRefetch > SHOULD_REFETCH_LIMIT;
if (shouldRefetch) {
client.reFetchObservableQueries(false);
lastRefetch = now;
}
}
});
}
},
false
);
}
};
export const getNumberSuffix = (number: number) => {
const suffix =
{
"1": "st",
"2": "nd",
"3": "rd"
}[number.toString()] || "th";
return suffix;
};
// URP is now enabled by default except for Xsell
// Cookie changed because we still need ATs to be able to perform tasks within non-URP
export const isURP = !(
isXSell() ||
(typeof document !== "undefined" &&
document.cookie.includes("disableURP=true"))
);
export const isFDR = () => tvgConf().brand === "fdr";
export const isFdrDesk =
tvgConf().product === "tvg5" && tvgConf().brand === "fdr";
export const getPortByBrand = (): WagerProfile =>
isFDR() ? WagerProfile.FDR_GENERIC : WagerProfile.PORT_GENERIC;
/**
* Checks if a string represents a zero value (e.g., "0", "0.00", "$0.00").
* Strips all non-numeric and non-decimal characters, then parses as float.
* Returns true if the parsed value is zero or the string is empty/undefined.
*/
export function isZeroLike(value: string): boolean {
if (!value) return true;
const normalized = value.replace(/[^\d.]/g, "");
return parseFloat(normalized) === 0;
}
export default pluralize;
webpack://frontend-tpt/../../node_modules/date-fns/esm/parseISO/index.js
import toInteger from '../_lib/toInteger/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
var MILLISECONDS_IN_HOUR = 3600000;
var MILLISECONDS_IN_MINUTE = 60000;
var DEFAULT_ADDITIONAL_DIGITS = 2;
var patterns = {
dateTimeDelimiter: /[T ]/,
timeZoneDelimiter: /[Z ]/i,
timezone: /([Z+-].*)$/
};
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
/**
* @name parseISO
* @category Common Helpers
* @summary Parse ISO string
*
* @description
* Parse the given string in ISO 8601 format and return an instance of Date.
*
* Function accepts complete ISO 8601 formats as well as partial implementations.
* ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
*
* If the argument isn't a string, the function cannot parse the string or
* the values are invalid, it returns Invalid Date.
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* - The previous `parse` implementation was renamed to `parseISO`.
*
* ```javascript
* // Before v2.0.0
* parse('2016-01-01')
*
* // v2.0.0 onward
* parseISO('2016-01-01')
* ```
*
* - `parseISO` now validates separate date and time values in ISO-8601 strings
* and returns `Invalid Date` if the date is invalid.
*
* ```javascript
* parseISO('2018-13-32')
* //=> Invalid Date
* ```
*
* - `parseISO` now doesn't fall back to `new Date` constructor
* if it fails to parse a string argument. Instead, it returns `Invalid Date`.
*
* @param {String} argument - the value to convert
* @param {Object} [options] - an object with options.
* @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format
* @returns {Date} the parsed date in the local time zone
* @throws {TypeError} 1 argument required
* @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
*
* @example
* // Convert string '2014-02-11T11:30:30' to date:
* var result = parseISO('2014-02-11T11:30:30')
* //=> Tue Feb 11 2014 11:30:30
*
* @example
* // Convert string '+02014101' to date,
* // if the additional number of digits in the extended year format is 1:
* var result = parseISO('+02014101', { additionalDigits: 1 })
* //=> Fri Apr 11 2014 00:00:00
*/
export default function parseISO(argument, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : toInteger(options.additionalDigits);
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
throw new RangeError('additionalDigits must be 0, 1 or 2');
}
if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {
return new Date(NaN);
}
var dateStrings = splitDateString(argument);
var date;
if (dateStrings.date) {
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
}
if (isNaN(date) || !date) {
return new Date(NaN);
}
var timestamp = date.getTime();
var time = 0;
var offset;
if (dateStrings.time) {
time = parseTime(dateStrings.time);
if (isNaN(time) || time === null) {
return new Date(NaN);
}
}
if (dateStrings.timezone) {
offset = parseTimezone(dateStrings.timezone);
if (isNaN(offset)) {
return new Date(NaN);
}
} else {
var dirtyDate = new Date(timestamp + time); // js parsed string assuming it's in UTC timezone
// but we need it to be parsed in our timezone
// so we use utc values to build date in our timezone.
// Year values from 0 to 99 map to the years 1900 to 1999
// so set year explicitly with setFullYear.
var result = new Date(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate(), dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
result.setFullYear(dirtyDate.getUTCFullYear());
return result;
}
return new Date(timestamp + time + offset);
}
function splitDateString(dateString) {
var dateStrings = {};
var array = dateString.split(patterns.dateTimeDelimiter);
var timeString; // The regex match should only return at maximum two array elements.
// [date], [time], or [date, time].
if (array.length > 2) {
return dateStrings;
}
if (/:/.test(array[0])) {
dateStrings.date = null;
timeString = array[0];
} else {
dateStrings.date = array[0];
timeString = array[1];
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
timeString = dateString.substr(dateStrings.date.length, dateString.length);
}
}
if (timeString) {
var token = patterns.timezone.exec(timeString);
if (token) {
dateStrings.time = timeString.replace(token[1], '');
dateStrings.timezone = token[1];
} else {
dateStrings.time = timeString;
}
}
return dateStrings;
}
function parseYear(dateString, additionalDigits) {
var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)');
var captures = dateString.match(regex); // Invalid ISO-formatted year
if (!captures) return {
year: null
};
var year = captures[1] && parseInt(captures[1]);
var century = captures[2] && parseInt(captures[2]);
return {
year: century == null ? year : century * 100,
restDateString: dateString.slice((captures[1] || captures[2]).length)
};
}
function parseDate(dateString, year) {
// Invalid ISO-formatted year
if (year === null) return null;
var captures = dateString.match(dateRegex); // Invalid ISO-formatted string
if (!captures) return null;
var isWeekDate = !!captures[4];
var dayOfYear = parseDateUnit(captures[1]);
var month = parseDateUnit(captures[2]) - 1;
var day = parseDateUnit(captures[3]);
var week = parseDateUnit(captures[4]);
var dayOfWeek = parseDateUnit(captures[5]) - 1;
if (isWeekDate) {
if (!validateWeekDate(year, week, dayOfWeek)) {
return new Date(NaN);
}
return dayOfISOWeekYear(year, week, dayOfWeek);
} else {
var date = new Date(0);
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
return new Date(NaN);
}
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
return date;
}
}
function parseDateUnit(value) {
return value ? parseInt(value) : 1;
}
function parseTime(timeString) {
var captures = timeString.match(timeRegex);
if (!captures) return null; // Invalid ISO-formatted time
var hours = parseTimeUnit(captures[1]);
var minutes = parseTimeUnit(captures[2]);
var seconds = parseTimeUnit(captures[3]);
if (!validateTime(hours, minutes, seconds)) {
return NaN;
}
return hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000;
}
function parseTimeUnit(value) {
return value && parseFloat(value.replace(',', '.')) || 0;
}
function parseTimezone(timezoneString) {
if (timezoneString === 'Z') return 0;
var captures = timezoneString.match(timezoneRegex);
if (!captures) return 0;
var sign = captures[1] === '+' ? -1 : 1;
var hours = parseInt(captures[2]);
var minutes = captures[3] && parseInt(captures[3]) || 0;
if (!validateTimezone(hours, minutes)) {
return NaN;
}
return sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE);
}
function dayOfISOWeekYear(isoWeekYear, week, day) {
var date = new Date(0);
date.setUTCFullYear(isoWeekYear, 0, 4);
var fourthOfJanuaryDay = date.getUTCDay() || 7;
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
date.setUTCDate(date.getUTCDate() + diff);
return date;
} // Validation functions
// February is null to handle the leap year (using ||)
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function isLeapYearIndex(year) {
return year % 400 === 0 || year % 4 === 0 && year % 100;
}
function validateDate(year, month, date) {
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
}
function validateDayOfYearDate(year, dayOfYear) {
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
}
function validateWeekDate(_year, week, day) {
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
}
function validateTime(hours, minutes, seconds) {
if (hours === 24) {
return minutes === 0 && seconds === 0;
}
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
}
function validateTimezone(_hours, minutes) {
return minutes >= 0 && minutes <= 59;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js
var formatDistanceLocale = {
lessThanXSeconds: {
one: 'less than a second',
other: 'less than {{count}} seconds'
},
xSeconds: {
one: '1 second',
other: '{{count}} seconds'
},
halfAMinute: 'half a minute',
lessThanXMinutes: {
one: 'less than a minute',
other: 'less than {{count}} minutes'
},
xMinutes: {
one: '1 minute',
other: '{{count}} minutes'
},
aboutXHours: {
one: 'about 1 hour',
other: 'about {{count}} hours'
},
xHours: {
one: '1 hour',
other: '{{count}} hours'
},
xDays: {
one: '1 day',
other: '{{count}} days'
},
aboutXWeeks: {
one: 'about 1 week',
other: 'about {{count}} weeks'
},
xWeeks: {
one: '1 week',
other: '{{count}} weeks'
},
aboutXMonths: {
one: 'about 1 month',
other: 'about {{count}} months'
},
xMonths: {
one: '1 month',
other: '{{count}} months'
},
aboutXYears: {
one: 'about 1 year',
other: 'about {{count}} years'
},
xYears: {
one: '1 year',
other: '{{count}} years'
},
overXYears: {
one: 'over 1 year',
other: 'over {{count}} years'
},
almostXYears: {
one: 'almost 1 year',
other: 'almost {{count}} years'
}
};
export default function formatDistance(token, count, options) {
options = options || {};
var result;
if (typeof formatDistanceLocale[token] === 'string') {
result = formatDistanceLocale[token];
} else if (count === 1) {
result = formatDistanceLocale[token].one;
} else {
result = formatDistanceLocale[token].other.replace('{{count}}', count);
}
if (options.addSuffix) {
if (options.comparison > 0) {
return 'in ' + result;
} else {
return result + ' ago';
}
}
return result;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js
export default function buildFormatLongFn(args) {
return function (dirtyOptions) {
var options = dirtyOptions || {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index.js';
var dateFormats = {
full: 'EEEE, MMMM do, y',
long: 'MMMM do, y',
medium: 'MMM d, y',
short: 'MM/dd/yyyy'
};
var timeFormats = {
full: 'h:mm:ss a zzzz',
long: 'h:mm:ss a z',
medium: 'h:mm:ss a',
short: 'h:mm a'
};
var dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: '{{date}}, {{time}}',
short: '{{date}}, {{time}}'
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: 'full'
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: 'full'
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: 'full'
})
};
export default formatLong;
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js
export default function buildMatchPatternFn(args) {
return function (dirtyString, dirtyOptions) {
var string = String(dirtyString);
var options = dirtyOptions || {};
var matchResult = string.match(args.matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult) {
return null;
}
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
return {
value: value,
rest: string.slice(matchedString.length)
};
};
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js
var formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: 'P'
};
export default function formatRelative(token, _date, _baseDate, _options) {
return formatRelativeLocale[token];
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js
export default function buildLocalizeFn(args) {
return function (dirtyIndex, dirtyOptions) {
var options = dirtyOptions || {};
var context = options.context ? String(options.context) : 'standalone';
var valuesArray;
if (context === 'formatting' && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
return valuesArray[index];
};
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js
export default function buildMatchFn(args) {
return function (dirtyString, dirtyOptions) {
var string = String(dirtyString);
var options = dirtyOptions || {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var value;
if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {
value = findIndex(parsePatterns, function (pattern) {
return pattern.test(matchedString);
});
} else {
value = findKey(parsePatterns, function (pattern) {
return pattern.test(matchedString);
});
}
value = args.valueCallback ? args.valueCallback(value) : value;
value = options.valueCallback ? options.valueCallback(value) : value;
return {
value: value,
rest: string.slice(matchedString.length)
};
};
}
function findKey(object, predicate) {
for (var key in object) {
if (object.hasOwnProperty(key) && predicate(object[key])) {
return key;
}
}
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/en-US/index.js
import formatDistance from './_lib/formatDistance/index.js';
import formatLong from './_lib/formatLong/index.js';
import formatRelative from './_lib/formatRelative/index.js';
import localize from './_lib/localize/index.js';
import match from './_lib/match/index.js';
/**
* @type {Locale}
* @category Locales
* @summary English locale (United States).
* @language English
* @iso-639-2 eng
* @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
* @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
*/
var locale = {
code: 'en-US',
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0
/* Sunday */
,
firstWeekContainsDate: 1
}
};
export default locale;
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js
import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index.js';
var eraValues = {
narrow: ['B', 'A'],
abbreviated: ['BC', 'AD'],
wide: ['Before Christ', 'Anno Domini']
};
var quarterValues = {
narrow: ['1', '2', '3', '4'],
abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
};
var monthValues = {
narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
};
var dayValues = {
narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
};
var dayPeriodValues = {
narrow: {
am: 'a',
pm: 'p',
midnight: 'mi',
noon: 'n',
morning: 'morning',
afternoon: 'afternoon',
evening: 'evening',
night: 'night'
},
abbreviated: {
am: 'AM',
pm: 'PM',
midnight: 'midnight',
noon: 'noon',
morning: 'morning',
afternoon: 'afternoon',
evening: 'evening',
night: 'night'
},
wide: {
am: 'a.m.',
pm: 'p.m.',
midnight: 'midnight',
noon: 'noon',
morning: 'morning',
afternoon: 'afternoon',
evening: 'evening',
night: 'night'
}
};
var formattingDayPeriodValues = {
narrow: {
am: 'a',
pm: 'p',
midnight: 'mi',
noon: 'n',
morning: 'in the morning',
afternoon: 'in the afternoon',
evening: 'in the evening',
night: 'at night'
},
abbreviated: {
am: 'AM',
pm: 'PM',
midnight: 'midnight',
noon: 'noon',
morning: 'in the morning',
afternoon: 'in the afternoon',
evening: 'in the evening',
night: 'at night'
},
wide: {
am: 'a.m.',
pm: 'p.m.',
midnight: 'midnight',
noon: 'noon',
morning: 'in the morning',
afternoon: 'in the afternoon',
evening: 'in the evening',
night: 'at night'
}
};
function ordinalNumber(dirtyNumber, _dirtyOptions) {
var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
// if they are different for different grammatical genders,
// use `options.unit`:
//
// var options = dirtyOptions || {}
// var unit = String(options.unit)
//
// where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
// 'day', 'hour', 'minute', 'second'
var rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + 'st';
case 2:
return number + 'nd';
case 3:
return number + 'rd';
}
}
return number + 'th';
}
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: 'wide'
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: 'wide',
argumentCallback: function (quarter) {
return Number(quarter) - 1;
}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: 'wide'
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: 'wide'
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: 'wide',
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: 'wide'
})
};
export default localize;
webpack://frontend-tpt/../../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js
import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index.js';
import buildMatchFn from '../../../_lib/buildMatchFn/index.js';
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
};
var parseEraPatterns = {
any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
var parseMonthPatterns = {
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
};
var matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
var parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function (value) {
return parseInt(value, 10);
}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: 'wide',
parsePatterns: parseEraPatterns,
defaultParseWidth: 'any'
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: 'wide',
parsePatterns: parseQuarterPatterns,
defaultParseWidth: 'any',
valueCallback: function (index) {
return index + 1;
}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: 'wide',
parsePatterns: parseMonthPatterns,
defaultParseWidth: 'any'
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: 'wide',
parsePatterns: parseDayPatterns,
defaultParseWidth: 'any'
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: 'any',
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: 'any'
})
};
export default match;
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js
export default function addLeadingZeros(number, targetLength) {
var sign = number < 0 ? '-' : '';
var output = Math.abs(number).toString();
while (output.length < targetLength) {
output = '0' + output;
}
return sign + output;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/format/lightFormatters/index.js
import addLeadingZeros from '../../addLeadingZeros/index.js';
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | |
* | d | Day of month | D | |
* | h | Hour [1-12] | H | Hour [0-23] |
* | m | Minute | M | Month |
* | s | Second | S | Fraction of second |
* | y | Year (abs) | Y | |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*/
var formatters = {
// Year
y: function (date, token) {
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
// | Year | y | yy | yyy | yyyy | yyyyy |
// |----------|-------|----|-------|-------|-------|
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
var year = signedYear > 0 ? signedYear : 1 - signedYear;
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
},
// Month
M: function (date, token) {
var month = date.getUTCMonth();
return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
},
// Day of the month
d: function (date, token) {
return addLeadingZeros(date.getUTCDate(), token.length);
},
// AM or PM
a: function (date, token) {
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
switch (token) {
case 'a':
case 'aa':
case 'aaa':
return dayPeriodEnumValue.toUpperCase();
case 'aaaaa':
return dayPeriodEnumValue[0];
case 'aaaa':
default:
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
}
},
// Hour [1-12]
h: function (date, token) {
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
},
// Hour [0-23]
H: function (date, token) {
return addLeadingZeros(date.getUTCHours(), token.length);
},
// Minute
m: function (date, token) {
return addLeadingZeros(date.getUTCMinutes(), token.length);
},
// Second
s: function (date, token) {
return addLeadingZeros(date.getUTCSeconds(), token.length);
},
// Fraction of second
S: function (date, token) {
var numberOfDigits = token.length;
var milliseconds = date.getUTCMilliseconds();
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
return addLeadingZeros(fractionalSeconds, token.length);
}
};
export default formatters;
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js
import toDate from '../../toDate/index.js';
import requiredArgs from '../requiredArgs/index.js'; // This function will be a part of public API when UTC function will be implemented.
// See issue: https://github.com/date-fns/date-fns/issues/376
export default function startOfUTCISOWeek(dirtyDate) {
requiredArgs(1, arguments);
var weekStartsOn = 1;
var date = toDate(dirtyDate);
var day = date.getUTCDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
date.setUTCDate(date.getUTCDate() - diff);
date.setUTCHours(0, 0, 0, 0);
return date;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js
import toDate from '../../toDate/index.js';
import startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';
import requiredArgs from '../requiredArgs/index.js'; // This function will be a part of public API when UTC function will be implemented.
// See issue: https://github.com/date-fns/date-fns/issues/376
export default function getUTCISOWeekYear(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var year = date.getUTCFullYear();
var fourthOfJanuaryOfNextYear = new Date(0);
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
var fourthOfJanuaryOfThisYear = new Date(0);
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
if (date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js
import toInteger from '../toInteger/index.js';
import toDate from '../../toDate/index.js';
import requiredArgs from '../requiredArgs/index.js'; // This function will be a part of public API when UTC function will be implemented.
// See issue: https://github.com/date-fns/date-fns/issues/376
export default function startOfUTCWeek(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale = options.locale;
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
}
var date = toDate(dirtyDate);
var day = date.getUTCDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
date.setUTCDate(date.getUTCDate() - diff);
date.setUTCHours(0, 0, 0, 0);
return date;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js
import toInteger from '../toInteger/index.js';
import toDate from '../../toDate/index.js';
import startOfUTCWeek from '../startOfUTCWeek/index.js';
import requiredArgs from '../requiredArgs/index.js'; // This function will be a part of public API when UTC function will be implemented.
// See issue: https://github.com/date-fns/date-fns/issues/376
export default function getUTCWeekYear(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate, dirtyOptions);
var year = date.getUTCFullYear();
var options = dirtyOptions || {};
var locale = options.locale;
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
}
var firstWeekOfNextYear = new Date(0);
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
var firstWeekOfThisYear = new Date(0);
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
if (date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/format/formatters/index.js
import lightFormatters from '../lightFormatters/index.js';
import getUTCDayOfYear from '../../../_lib/getUTCDayOfYear/index.js';
import getUTCISOWeek from '../../../_lib/getUTCISOWeek/index.js';
import getUTCISOWeekYear from '../../../_lib/getUTCISOWeekYear/index.js';
import getUTCWeek from '../../../_lib/getUTCWeek/index.js';
import getUTCWeekYear from '../../../_lib/getUTCWeekYear/index.js';
import addLeadingZeros from '../../addLeadingZeros/index.js';
var dayPeriodEnum = {
am: 'am',
pm: 'pm',
midnight: 'midnight',
noon: 'noon',
morning: 'morning',
afternoon: 'afternoon',
evening: 'evening',
night: 'night'
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | Milliseconds in day |
* | b | AM, PM, noon, midnight | B | Flexible day period |
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
* | d | Day of month | D | Day of year |
* | e | Local day of week | E | Day of week |
* | f | | F* | Day of week in month |
* | g* | Modified Julian day | G | Era |
* | h | Hour [1-12] | H | Hour [0-23] |
* | i! | ISO day of week | I! | ISO week of year |
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
* | k | Hour [1-24] | K | Hour [0-11] |
* | l* | (deprecated) | L | Stand-alone month |
* | m | Minute | M | Month |
* | n | | N | |
* | o! | Ordinal number modifier | O | Timezone (GMT) |
* | p! | Long localized time | P! | Long localized date |
* | q | Stand-alone quarter | Q | Quarter |
* | r* | Related Gregorian year | R! | ISO week-numbering year |
* | s | Second | S | Fraction of second |
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
* | u | Extended year | U* | Cyclic year |
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
* | w | Local week of year | W* | Week of month |
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
* | y | Year (abs) | Y | Local week-numbering year |
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*
* Letters marked by ! are non-standard, but implemented by date-fns:
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
* i.e. 7 for Sunday, 1 for Monday, etc.
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
* `R` is supposed to be used in conjunction with `I` and `i`
* for universal ISO week-numbering date, whereas
* `Y` is supposed to be used in conjunction with `w` and `e`
* for week-numbering date specific to the locale.
* - `P` is long localized date format
* - `p` is long localized time format
*/
};
var formatters = {
// Era
G: function (date, token, localize) {
var era = date.getUTCFullYear() > 0 ? 1 : 0;
switch (token) {
// AD, BC
case 'G':
case 'GG':
case 'GGG':
return localize.era(era, {
width: 'abbreviated'
});
// A, B
case 'GGGGG':
return localize.era(era, {
width: 'narrow'
});
// Anno Domini, Before Christ
case 'GGGG':
default:
return localize.era(era, {
width: 'wide'
});
}
},
// Year
y: function (date, token, localize) {
// Ordinal number
if (token === 'yo') {
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
var year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize.ordinalNumber(year, {
unit: 'year'
});
}
return lightFormatters.y(date, token);
},
// Local week-numbering year
Y: function (date, token, localize, options) {
var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
if (token === 'YY') {
var twoDigitYear = weekYear % 100;
return addLeadingZeros(twoDigitYear, 2);
} // Ordinal number
if (token === 'Yo') {
return localize.ordinalNumber(weekYear, {
unit: 'year'
});
} // Padding
return addLeadingZeros(weekYear, token.length);
},
// ISO week-numbering year
R: function (date, token) {
var isoWeekYear = getUTCISOWeekYear(date); // Padding
return addLeadingZeros(isoWeekYear, token.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function (date, token) {
var year = date.getUTCFullYear();
return addLeadingZeros(year, token.length);
},
// Quarter
Q: function (date, token, localize) {
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case 'Q':
return String(quarter);
// 01, 02, 03, 04
case 'QQ':
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case 'Qo':
return localize.ordinalNumber(quarter, {
unit: 'quarter'
});
// Q1, Q2, Q3, Q4
case 'QQQ':
return localize.quarter(quarter, {
width: 'abbreviated',
context: 'formatting'
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case 'QQQQQ':
return localize.quarter(quarter, {
width: 'narrow',
context: 'formatting'
});
// 1st quarter, 2nd quarter, ...
case 'QQQQ':
default:
return localize.quarter(quarter, {
width: 'wide',
context: 'formatting'
});
}
},
// Stand-alone quarter
q: function (date, token, localize) {
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case 'q':
return String(quarter);
// 01, 02, 03, 04
case 'qq':
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case 'qo':
return localize.ordinalNumber(quarter, {
unit: 'quarter'
});
// Q1, Q2, Q3, Q4
case 'qqq':
return localize.quarter(quarter, {
width: 'abbreviated',
context: 'standalone'
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case 'qqqqq':
return localize.quarter(quarter, {
width: 'narrow',
context: 'standalone'
});
// 1st quarter, 2nd quarter, ...
case 'qqqq':
default:
return localize.quarter(quarter, {
width: 'wide',
context: 'standalone'
});
}
},
// Month
M: function (date, token, localize) {
var month = date.getUTCMonth();
switch (token) {
case 'M':
case 'MM':
return lightFormatters.M(date, token);
// 1st, 2nd, ..., 12th
case 'Mo':
return localize.ordinalNumber(month + 1, {
unit: 'month'
});
// Jan, Feb, ..., Dec
case 'MMM':
return localize.month(month, {
width: 'abbreviated',
context: 'formatting'
});
// J, F, ..., D
case 'MMMMM':
return localize.month(month, {
width: 'narrow',
context: 'formatting'
});
// January, February, ..., December
case 'MMMM':
default:
return localize.month(month, {
width: 'wide',
context: 'formatting'
});
}
},
// Stand-alone month
L: function (date, token, localize) {
var month = date.getUTCMonth();
switch (token) {
// 1, 2, ..., 12
case 'L':
return String(month + 1);
// 01, 02, ..., 12
case 'LL':
return addLeadingZeros(month + 1, 2);
// 1st, 2nd, ..., 12th
case 'Lo':
return localize.ordinalNumber(month + 1, {
unit: 'month'
});
// Jan, Feb, ..., Dec
case 'LLL':
return localize.month(month, {
width: 'abbreviated',
context: 'standalone'
});
// J, F, ..., D
case 'LLLLL':
return localize.month(month, {
width: 'narrow',
context: 'standalone'
});
// January, February, ..., December
case 'LLLL':
default:
return localize.month(month, {
width: 'wide',
context: 'standalone'
});
}
},
// Local week of year
w: function (date, token, localize, options) {
var week = getUTCWeek(date, options);
if (token === 'wo') {
return localize.ordinalNumber(week, {
unit: 'week'
});
}
return addLeadingZeros(week, token.length);
},
// ISO week of year
I: function (date, token, localize) {
var isoWeek = getUTCISOWeek(date);
if (token === 'Io') {
return localize.ordinalNumber(isoWeek, {
unit: 'week'
});
}
return addLeadingZeros(isoWeek, token.length);
},
// Day of the month
d: function (date, token, localize) {
if (token === 'do') {
return localize.ordinalNumber(date.getUTCDate(), {
unit: 'date'
});
}
return lightFormatters.d(date, token);
},
// Day of year
D: function (date, token, localize) {
var dayOfYear = getUTCDayOfYear(date);
if (token === 'Do') {
return localize.ordinalNumber(dayOfYear, {
unit: 'dayOfYear'
});
}
return addLeadingZeros(dayOfYear, token.length);
},
// Day of week
E: function (date, token, localize) {
var dayOfWeek = date.getUTCDay();
switch (token) {
// Tue
case 'E':
case 'EE':
case 'EEE':
return localize.day(dayOfWeek, {
width: 'abbreviated',
context: 'formatting'
});
// T
case 'EEEEE':
return localize.day(dayOfWeek, {
width: 'narrow',
context: 'formatting'
});
// Tu
case 'EEEEEE':
return localize.day(dayOfWeek, {
width: 'short',
context: 'formatting'
});
// Tuesday
case 'EEEE':
default:
return localize.day(dayOfWeek, {
width: 'wide',
context: 'formatting'
});
}
},
// Local day of week
e: function (date, token, localize, options) {
var dayOfWeek = date.getUTCDay();
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (Nth day of week with current locale or weekStartsOn)
case 'e':
return String(localDayOfWeek);
// Padded numerical value
case 'ee':
return addLeadingZeros(localDayOfWeek, 2);
// 1st, 2nd, ..., 7th
case 'eo':
return localize.ordinalNumber(localDayOfWeek, {
unit: 'day'
});
case 'eee':
return localize.day(dayOfWeek, {
width: 'abbreviated',
context: 'formatting'
});
// T
case 'eeeee':
return localize.day(dayOfWeek, {
width: 'narrow',
context: 'formatting'
});
// Tu
case 'eeeeee':
return localize.day(dayOfWeek, {
width: 'short',
context: 'formatting'
});
// Tuesday
case 'eeee':
default:
return localize.day(dayOfWeek, {
width: 'wide',
context: 'formatting'
});
}
},
// Stand-alone local day of week
c: function (date, token, localize, options) {
var dayOfWeek = date.getUTCDay();
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (same as in `e`)
case 'c':
return String(localDayOfWeek);
// Padded numerical value
case 'cc':
return addLeadingZeros(localDayOfWeek, token.length);
// 1st, 2nd, ..., 7th
case 'co':
return localize.ordinalNumber(localDayOfWeek, {
unit: 'day'
});
case 'ccc':
return localize.day(dayOfWeek, {
width: 'abbreviated',
context: 'standalone'
});
// T
case 'ccccc':
return localize.day(dayOfWeek, {
width: 'narrow',
context: 'standalone'
});
// Tu
case 'cccccc':
return localize.day(dayOfWeek, {
width: 'short',
context: 'standalone'
});
// Tuesday
case 'cccc':
default:
return localize.day(dayOfWeek, {
width: 'wide',
context: 'standalone'
});
}
},
// ISO day of week
i: function (date, token, localize) {
var dayOfWeek = date.getUTCDay();
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
switch (token) {
// 2
case 'i':
return String(isoDayOfWeek);
// 02
case 'ii':
return addLeadingZeros(isoDayOfWeek, token.length);
// 2nd
case 'io':
return localize.ordinalNumber(isoDayOfWeek, {
unit: 'day'
});
// Tue
case 'iii':
return localize.day(dayOfWeek, {
width: 'abbreviated',
context: 'formatting'
});
// T
case 'iiiii':
return localize.day(dayOfWeek, {
width: 'narrow',
context: 'formatting'
});
// Tu
case 'iiiiii':
return localize.day(dayOfWeek, {
width: 'short',
context: 'formatting'
});
// Tuesday
case 'iiii':
default:
return localize.day(dayOfWeek, {
width: 'wide',
context: 'formatting'
});
}
},
// AM or PM
a: function (date, token, localize) {
var hours = date.getUTCHours();
var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
switch (token) {
case 'a':
case 'aa':
case 'aaa':
return localize.dayPeriod(dayPeriodEnumValue, {
width: 'abbreviated',
context: 'formatting'
});
case 'aaaaa':
return localize.dayPeriod(dayPeriodEnumValue, {
width: 'narrow',
context: 'formatting'
});
case 'aaaa':
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: 'wide',
context: 'formatting'
});
}
},
// AM, PM, midnight, noon
b: function (date, token, localize) {
var hours = date.getUTCHours();
var dayPeriodEnumValue;
if (hours === 12) {
dayPeriodEnumValue = dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = dayPeriodEnum.midnight;
} else {
dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
}
switch (token) {
case 'b':
case 'bb':
case 'bbb':
return localize.dayPeriod(dayPeriodEnumValue, {
width: 'abbreviated',
context: 'formatting'
});
case 'bbbbb':
return localize.dayPeriod(dayPeriodEnumValue, {
width: 'narrow',
context: 'formatting'
});
case 'bbbb':
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: 'wide',
context: 'formatting'
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function (date, token, localize) {
var hours = date.getUTCHours();
var dayPeriodEnumValue;
if (hours >= 17) {
dayPeriodEnumValue = dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = dayPeriodEnum.afternoon;
} else if (hours >= 4) {
dayPeriodEnumValue = dayPeriodEnum.morning;
} else {
dayPeriodEnumValue = dayPeriodEnum.night;
}
switch (token) {
case 'B':
case 'BB':
case 'BBB':
return localize.dayPeriod(dayPeriodEnumValue, {
width: 'abbreviated',
context: 'formatting'
});
case 'BBBBB':
return localize.dayPeriod(dayPeriodEnumValue, {
width: 'narrow',
context: 'formatting'
});
case 'BBBB':
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: 'wide',
context: 'formatting'
});
}
},
// Hour [1-12]
h: function (date, token, localize) {
if (token === 'ho') {
var hours = date.getUTCHours() % 12;
if (hours === 0) hours = 12;
return localize.ordinalNumber(hours, {
unit: 'hour'
});
}
return lightFormatters.h(date, token);
},
// Hour [0-23]
H: function (date, token, localize) {
if (token === 'Ho') {
return localize.ordinalNumber(date.getUTCHours(), {
unit: 'hour'
});
}
return lightFormatters.H(date, token);
},
// Hour [0-11]
K: function (date, token, localize) {
var hours = date.getUTCHours() % 12;
if (token === 'Ko') {
return localize.ordinalNumber(hours, {
unit: 'hour'
});
}
return addLeadingZeros(hours, token.length);
},
// Hour [1-24]
k: function (date, token, localize) {
var hours = date.getUTCHours();
if (hours === 0) hours = 24;
if (token === 'ko') {
return localize.ordinalNumber(hours, {
unit: 'hour'
});
}
return addLeadingZeros(hours, token.length);
},
// Minute
m: function (date, token, localize) {
if (token === 'mo') {
return localize.ordinalNumber(date.getUTCMinutes(), {
unit: 'minute'
});
}
return lightFormatters.m(date, token);
},
// Second
s: function (date, token, localize) {
if (token === 'so') {
return localize.ordinalNumber(date.getUTCSeconds(), {
unit: 'second'
});
}
return lightFormatters.s(date, token);
},
// Fraction of second
S: function (date, token) {
return lightFormatters.S(date, token);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function (date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
if (timezoneOffset === 0) {
return 'Z';
}
switch (token) {
// Hours and optional minutes
case 'X':
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case 'XXXX':
case 'XX':
// Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case 'XXXXX':
case 'XXX': // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ':');
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function (date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
switch (token) {
// Hours and optional minutes
case 'x':
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case 'xxxx':
case 'xx':
// Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case 'xxxxx':
case 'xxx': // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ':');
}
},
// Timezone (GMT)
O: function (date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
switch (token) {
// Short
case 'O':
case 'OO':
case 'OOO':
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
// Long
case 'OOOO':
default:
return 'GMT' + formatTimezone(timezoneOffset, ':');
}
},
// Timezone (specific non-location)
z: function (date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
switch (token) {
// Short
case 'z':
case 'zz':
case 'zzz':
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
// Long
case 'zzzz':
default:
return 'GMT' + formatTimezone(timezoneOffset, ':');
}
},
// Seconds timestamp
t: function (date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timestamp = Math.floor(originalDate.getTime() / 1000);
return addLeadingZeros(timestamp, token.length);
},
// Milliseconds timestamp
T: function (date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timestamp = originalDate.getTime();
return addLeadingZeros(timestamp, token.length);
}
};
function formatTimezoneShort(offset, dirtyDelimiter) {
var sign = offset > 0 ? '-' : '+';
var absOffset = Math.abs(offset);
var hours = Math.floor(absOffset / 60);
var minutes = absOffset % 60;
if (minutes === 0) {
return sign + String(hours);
}
var delimiter = dirtyDelimiter || '';
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
if (offset % 60 === 0) {
var sign = offset > 0 ? '-' : '+';
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
}
return formatTimezone(offset, dirtyDelimiter);
}
function formatTimezone(offset, dirtyDelimiter) {
var delimiter = dirtyDelimiter || '';
var sign = offset > 0 ? '-' : '+';
var absOffset = Math.abs(offset);
var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
var minutes = addLeadingZeros(absOffset % 60, 2);
return sign + hours + delimiter + minutes;
}
export default formatters;
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/getUTCWeek/index.js
import toDate from '../../toDate/index.js';
import startOfUTCWeek from '../startOfUTCWeek/index.js';
import startOfUTCWeekYear from '../startOfUTCWeekYear/index.js';
import requiredArgs from '../requiredArgs/index.js';
var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
// See issue: https://github.com/date-fns/date-fns/issues/376
export default function getUTCWeek(dirtyDate, options) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
// because the number of milliseconds in a week is not constant
// (e.g. it's different in the week of the daylight saving time clock shift)
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js
import toInteger from '../toInteger/index.js';
import getUTCWeekYear from '../getUTCWeekYear/index.js';
import startOfUTCWeek from '../startOfUTCWeek/index.js';
import requiredArgs from '../requiredArgs/index.js'; // This function will be a part of public API when UTC function will be implemented.
// See issue: https://github.com/date-fns/date-fns/issues/376
export default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale = options.locale;
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
var year = getUTCWeekYear(dirtyDate, dirtyOptions);
var firstWeek = new Date(0);
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
firstWeek.setUTCHours(0, 0, 0, 0);
var date = startOfUTCWeek(firstWeek, dirtyOptions);
return date;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js
import toDate from '../../toDate/index.js';
import startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';
import startOfUTCISOWeekYear from '../startOfUTCISOWeekYear/index.js';
import requiredArgs from '../requiredArgs/index.js';
var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
// See issue: https://github.com/date-fns/date-fns/issues/376
export default function getUTCISOWeek(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
// because the number of milliseconds in a week is not constant
// (e.g. it's different in the week of the daylight saving time clock shift)
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js
import getUTCISOWeekYear from '../getUTCISOWeekYear/index.js';
import startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';
import requiredArgs from '../requiredArgs/index.js'; // This function will be a part of public API when UTC function will be implemented.
// See issue: https://github.com/date-fns/date-fns/issues/376
export default function startOfUTCISOWeekYear(dirtyDate) {
requiredArgs(1, arguments);
var year = getUTCISOWeekYear(dirtyDate);
var fourthOfJanuary = new Date(0);
fourthOfJanuary.setUTCFullYear(year, 0, 4);
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
var date = startOfUTCISOWeek(fourthOfJanuary);
return date;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js
import toDate from '../../toDate/index.js';
import requiredArgs from '../requiredArgs/index.js';
var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
// See issue: https://github.com/date-fns/date-fns/issues/376
export default function getUTCDayOfYear(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var timestamp = date.getTime();
date.setUTCMonth(0, 1);
date.setUTCHours(0, 0, 0, 0);
var startOfYearTimestamp = date.getTime();
var difference = timestamp - startOfYearTimestamp;
return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/format/longFormatters/index.js
function dateLongFormatter(pattern, formatLong) {
switch (pattern) {
case 'P':
return formatLong.date({
width: 'short'
});
case 'PP':
return formatLong.date({
width: 'medium'
});
case 'PPP':
return formatLong.date({
width: 'long'
});
case 'PPPP':
default:
return formatLong.date({
width: 'full'
});
}
}
function timeLongFormatter(pattern, formatLong) {
switch (pattern) {
case 'p':
return formatLong.time({
width: 'short'
});
case 'pp':
return formatLong.time({
width: 'medium'
});
case 'ppp':
return formatLong.time({
width: 'long'
});
case 'pppp':
default:
return formatLong.time({
width: 'full'
});
}
}
function dateTimeLongFormatter(pattern, formatLong) {
var matchResult = pattern.match(/(P+)(p+)?/);
var datePattern = matchResult[1];
var timePattern = matchResult[2];
if (!timePattern) {
return dateLongFormatter(pattern, formatLong);
}
var dateTimeFormat;
switch (datePattern) {
case 'P':
dateTimeFormat = formatLong.dateTime({
width: 'short'
});
break;
case 'PP':
dateTimeFormat = formatLong.dateTime({
width: 'medium'
});
break;
case 'PPP':
dateTimeFormat = formatLong.dateTime({
width: 'long'
});
break;
case 'PPPP':
default:
dateTimeFormat = formatLong.dateTime({
width: 'full'
});
break;
}
return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
}
var longFormatters = {
p: timeLongFormatter,
P: dateTimeLongFormatter
};
export default longFormatters;
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js
var MILLISECONDS_IN_MINUTE = 60000;
function getDateMillisecondsPart(date) {
return date.getTime() % MILLISECONDS_IN_MINUTE;
}
/**
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
* They usually appear for dates that denote time before the timezones were introduced
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
* and GMT+01:00:00 after that date)
*
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
* which would lead to incorrect calculations.
*
* This function returns the timezone offset in milliseconds that takes seconds in account.
*/
export default function getTimezoneOffsetInMilliseconds(dirtyDate) {
var date = new Date(dirtyDate.getTime());
var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());
date.setSeconds(0, 0);
var hasNegativeUTCOffset = baseTimezoneOffset > 0;
var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);
return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/_lib/protectedTokens/index.js
var protectedDayOfYearTokens = ['D', 'DD'];
var protectedWeekYearTokens = ['YY', 'YYYY'];
export function isProtectedDayOfYearToken(token) {
return protectedDayOfYearTokens.indexOf(token) !== -1;
}
export function isProtectedWeekYearToken(token) {
return protectedWeekYearTokens.indexOf(token) !== -1;
}
export function throwProtectedError(token, format, input) {
if (token === 'YYYY') {
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
} else if (token === 'YY') {
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
} else if (token === 'D') {
throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
} else if (token === 'DD') {
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
}
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/format/index.js
import isValid from '../isValid/index.js';
import defaultLocale from '../locale/en-US/index.js';
import subMilliseconds from '../subMilliseconds/index.js';
import toDate from '../toDate/index.js';
import formatters from '../_lib/format/formatters/index.js';
import longFormatters from '../_lib/format/longFormatters/index.js';
import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';
import { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from '../_lib/protectedTokens/index.js';
import toInteger from '../_lib/toInteger/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js'; // This RegExp consists of three parts separated by `|`:
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
// (one of the certain letters followed by `o`)
// - (\w)\1* matches any sequences of the same letter
// - '' matches two quote characters in a row
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
// except a single quote symbol, which ends the sequence.
// Two quote characters do not end the sequence.
// If there is no matching single quote
// then the sequence will continue until the end of the string.
// - . matches any single character unmatched by previous parts of the RegExps
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
var escapedStringRegExp = /^'([^]*?)'?$/;
var doubleQuoteRegExp = /''/g;
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
/**
* @name format
* @category Common Helpers
* @summary Format the date.
*
* @description
* Return the formatted date string in the given format. The result may vary by locale.
*
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
* > See: https://git.io/fxCyr
*
* The characters wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
* (see the last example)
*
* Format of the string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
* with a few additions (see note 7 below the table).
*
* Accepted patterns:
* | Unit | Pattern | Result examples | Notes |
* |---------------------------------|---------|-----------------------------------|-------|
* | Era | G..GGG | AD, BC | |
* | | GGGG | Anno Domini, Before Christ | 2 |
* | | GGGGG | A, B | |
* | Calendar year | y | 44, 1, 1900, 2017 | 5 |
* | | yo | 44th, 1st, 0th, 17th | 5,7 |
* | | yy | 44, 01, 00, 17 | 5 |
* | | yyy | 044, 001, 1900, 2017 | 5 |
* | | yyyy | 0044, 0001, 1900, 2017 | 5 |
* | | yyyyy | ... | 3,5 |
* | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
* | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
* | | YY | 44, 01, 00, 17 | 5,8 |
* | | YYY | 044, 001, 1900, 2017 | 5 |
* | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
* | | YYYYY | ... | 3,5 |
* | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
* | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
* | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
* | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
* | | RRRRR | ... | 3,5,7 |
* | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
* | | uu | -43, 01, 1900, 2017 | 5 |
* | | uuu | -043, 001, 1900, 2017 | 5 |
* | | uuuu | -0043, 0001, 1900, 2017 | 5 |
* | | uuuuu | ... | 3,5 |
* | Quarter (formatting) | Q | 1, 2, 3, 4 | |
* | | Qo | 1st, 2nd, 3rd, 4th | 7 |
* | | QQ | 01, 02, 03, 04 | |
* | | QQQ | Q1, Q2, Q3, Q4 | |
* | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
* | | QQQQQ | 1, 2, 3, 4 | 4 |
* | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
* | | qo | 1st, 2nd, 3rd, 4th | 7 |
* | | qq | 01, 02, 03, 04 | |
* | | qqq | Q1, Q2, Q3, Q4 | |
* | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
* | | qqqqq | 1, 2, 3, 4 | 4 |
* | Month (formatting) | M | 1, 2, ..., 12 | |
* | | Mo | 1st, 2nd, ..., 12th | 7 |
* | | MM | 01, 02, ..., 12 | |
* | | MMM | Jan, Feb, ..., Dec | |
* | | MMMM | January, February, ..., December | 2 |
* | | MMMMM | J, F, ..., D | |
* | Month (stand-alone) | L | 1, 2, ..., 12 | |
* | | Lo | 1st, 2nd, ..., 12th | 7 |
* | | LL | 01, 02, ..., 12 | |
* | | LLL | Jan, Feb, ..., Dec | |
* | | LLLL | January, February, ..., December | 2 |
* | | LLLLL | J, F, ..., D | |
* | Local week of year | w | 1, 2, ..., 53 | |
* | | wo | 1st, 2nd, ..., 53th | 7 |
* | | ww | 01, 02, ..., 53 | |
* | ISO week of year | I | 1, 2, ..., 53 | 7 |
* | | Io | 1st, 2nd, ..., 53th | 7 |
* | | II | 01, 02, ..., 53 | 7 |
* | Day of month | d | 1, 2, ..., 31 | |
* | | do | 1st, 2nd, ..., 31st | 7 |
* | | dd | 01, 02, ..., 31 | |
* | Day of year | D | 1, 2, ..., 365, 366 | 9 |
* | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
* | | DD | 01, 02, ..., 365, 366 | 9 |
* | | DDD | 001, 002, ..., 365, 366 | |
* | | DDDD | ... | 3 |
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
* | | EEEEE | M, T, W, T, F, S, S | |
* | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
* | | io | 1st, 2nd, ..., 7th | 7 |
* | | ii | 01, 02, ..., 07 | 7 |
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
* | | iiiii | M, T, W, T, F, S, S | 7 |
* | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
* | | eo | 2nd, 3rd, ..., 1st | 7 |
* | | ee | 02, 03, ..., 01 | |
* | | eee | Mon, Tue, Wed, ..., Sun | |
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
* | | eeeee | M, T, W, T, F, S, S | |
* | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
* | | co | 2nd, 3rd, ..., 1st | 7 |
* | | cc | 02, 03, ..., 01 | |
* | | ccc | Mon, Tue, Wed, ..., Sun | |
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
* | | ccccc | M, T, W, T, F, S, S | |
* | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
* | AM, PM | a..aaa | AM, PM | |
* | | aaaa | a.m., p.m. | 2 |
* | | aaaaa | a, p | |
* | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |
* | | bbbb | a.m., p.m., noon, midnight | 2 |
* | | bbbbb | a, p, n, mi | |
* | Flexible day period | B..BBB | at night, in the morning, ... | |
* | | BBBB | at night, in the morning, ... | 2 |
* | | BBBBB | at night, in the morning, ... | |
* | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
* | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
* | | hh | 01, 02, ..., 11, 12 | |
* | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
* | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
* | | HH | 00, 01, 02, ..., 23 | |
* | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
* | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
* | | KK | 01, 02, ..., 11, 00 | |
* | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
* | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
* | | kk | 24, 01, 02, ..., 23 | |
* | Minute | m | 0, 1, ..., 59 | |
* | | mo | 0th, 1st, ..., 59th | 7 |
* | | mm | 00, 01, ..., 59 | |
* | Second | s | 0, 1, ..., 59 | |
* | | so | 0th, 1st, ..., 59th | 7 |
* | | ss | 00, 01, ..., 59 | |
* | Fraction of second | S | 0, 1, ..., 9 | |
* | | SS | 00, 01, ..., 99 | |
* | | SSS | 000, 0001, ..., 999 | |
* | | SSSS | ... | 3 |
* | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
* | | XX | -0800, +0530, Z | |
* | | XXX | -08:00, +05:30, Z | |
* | | XXXX | -0800, +0530, Z, +123456 | 2 |
* | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
* | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
* | | xx | -0800, +0530, +0000 | |
* | | xxx | -08:00, +05:30, +00:00 | 2 |
* | | xxxx | -0800, +0530, +0000, +123456 | |
* | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
* | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
* | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
* | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
* | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
* | Seconds timestamp | t | 512969520 | 7 |
* | | tt | ... | 3,7 |
* | Milliseconds timestamp | T | 512969520900 | 7 |
* | | TT | ... | 3,7 |
* | Long localized date | P | 05/29/1453 | 7 |
* | | PP | May 29, 1453 | 7 |
* | | PPP | May 29th, 1453 | 7 |
* | | PPPP | Sunday, May 29th, 1453 | 2,7 |
* | Long localized time | p | 12:00 AM | 7 |
* | | pp | 12:00:00 AM | 7 |
* | | ppp | 12:00:00 AM GMT+2 | 7 |
* | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
* | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |
* | | PPpp | May 29, 1453, 12:00:00 AM | 7 |
* | | PPPppp | May 29th, 1453 at ... | 7 |
* | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |
* Notes:
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
* are the same as "stand-alone" units, but are different in some languages.
* "Formatting" units are declined according to the rules of the language
* in the context of a date. "Stand-alone" units are always nominative singular:
*
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
*
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
*
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
* the single quote characters (see below).
* If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
* the output will be the same as default pattern for this unit, usually
* the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
* are marked with "2" in the last column of the table.
*
* `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
*
* `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
*
* `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
*
* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
* The output will be padded with zeros to match the length of the pattern.
*
* `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
*
* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
* These tokens represent the shortest form of the quarter.
*
* 5. The main difference between `y` and `u` patterns are B.C. years:
*
* | Year | `y` | `u` |
* |------|-----|-----|
* | AC 1 | 1 | 1 |
* | BC 1 | 1 | 0 |
* | BC 2 | 2 | -1 |
*
* Also `yy` always returns the last two digits of a year,
* while `uu` pads single digit years to 2 characters and returns other years unchanged:
*
* | Year | `yy` | `uu` |
* |------|------|------|
* | 1 | 01 | 01 |
* | 14 | 14 | 14 |
* | 376 | 76 | 376 |
* | 1453 | 53 | 1453 |
*
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
* except local week-numbering years are dependent on `options.weekStartsOn`
* and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
* and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
*
* 6. Specific non-location timezones are currently unavailable in `date-fns`,
* so right now these tokens fall back to GMT timezones.
*
* 7. These patterns are not in the Unicode Technical Standard #35:
* - `i`: ISO day of week
* - `I`: ISO week of year
* - `R`: ISO week-numbering year
* - `t`: seconds timestamp
* - `T`: milliseconds timestamp
* - `o`: ordinal number modifier
* - `P`: long localized date
* - `p`: long localized time
*
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
*
* 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* - The second argument is now required for the sake of explicitness.
*
* ```javascript
* // Before v2.0.0
* format(new Date(2016, 0, 1))
*
* // v2.0.0 onward
* format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
* ```
*
* - New format string API for `format` function
* which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
* See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
*
* - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
*
* @param {Date|Number} date - the original date
* @param {String} format - the string of tokens
* @param {Object} [options] - an object with options.
* @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
* @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
* @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
* @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
* see: https://git.io/fxCyr
* @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
* see: https://git.io/fxCyr
* @returns {String} the formatted date string
* @throws {TypeError} 2 arguments required
* @throws {RangeError} `date` must not be Invalid Date
* @throws {RangeError} `options.locale` must contain `localize` property
* @throws {RangeError} `options.locale` must contain `formatLong` property
* @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
* @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
* @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
* @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
* @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
* @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
* @throws {RangeError} format string contains an unescaped latin alphabet character
*
* @example
* // Represent 11 February 2014 in middle-endian format:
* var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
* //=> '02/11/2014'
*
* @example
* // Represent 2 July 2014 in Esperanto:
* import { eoLocale } from 'date-fns/locale/eo'
* var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
* locale: eoLocale
* })
* //=> '2-a de julio 2014'
*
* @example
* // Escape string by single quote characters:
* var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
* //=> "3 o'clock"
*/
export default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
requiredArgs(2, arguments);
var formatStr = String(dirtyFormatStr);
var options = dirtyOptions || {};
var locale = options.locale || defaultLocale;
var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
}
var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
}
if (!locale.localize) {
throw new RangeError('locale must contain localize property');
}
if (!locale.formatLong) {
throw new RangeError('locale must contain formatLong property');
}
var originalDate = toDate(dirtyDate);
if (!isValid(originalDate)) {
throw new RangeError('Invalid time value');
} // Convert the date in system timezone to the same date in UTC+00:00 timezone.
// This ensures that when UTC functions will be implemented, locales will be compatible with them.
// See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
var utcDate = subMilliseconds(originalDate, timezoneOffset);
var formatterOptions = {
firstWeekContainsDate: firstWeekContainsDate,
weekStartsOn: weekStartsOn,
locale: locale,
_originalDate: originalDate
};
var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
var firstCharacter = substring[0];
if (firstCharacter === 'p' || firstCharacter === 'P') {
var longFormatter = longFormatters[firstCharacter];
return longFormatter(substring, locale.formatLong, formatterOptions);
}
return substring;
}).join('').match(formattingTokensRegExp).map(function (substring) {
// Replace two single quote characters with one single quote character
if (substring === "''") {
return "'";
}
var firstCharacter = substring[0];
if (firstCharacter === "'") {
return cleanEscapedString(substring);
}
var formatter = formatters[firstCharacter];
if (formatter) {
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
}
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
}
return formatter(utcDate, substring, locale.localize, formatterOptions);
}
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
}
return substring;
}).join('');
return result;
}
function cleanEscapedString(input) {
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/isValid/index.js
import toDate from '../toDate/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
/**
* @name isValid
* @category Common Helpers
* @summary Is the given date valid?
*
* @description
* Returns false if argument is Invalid Date and true otherwise.
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
* Invalid Date is a Date, whose time value is NaN.
*
* Time value of Date: http://es5.github.io/#x15.9.1.1
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* - Now `isValid` doesn't throw an exception
* if the first argument is not an instance of Date.
* Instead, argument is converted beforehand using `toDate`.
*
* Examples:
*
* | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
* |---------------------------|---------------|---------------|
* | `new Date()` | `true` | `true` |
* | `new Date('2016-01-01')` | `true` | `true` |
* | `new Date('')` | `false` | `false` |
* | `new Date(1488370835081)` | `true` | `true` |
* | `new Date(NaN)` | `false` | `false` |
* | `'2016-01-01'` | `TypeError` | `false` |
* | `''` | `TypeError` | `false` |
* | `1488370835081` | `TypeError` | `true` |
* | `NaN` | `TypeError` | `false` |
*
* We introduce this change to make *date-fns* consistent with ECMAScript behavior
* that try to coerce arguments to the expected type
* (which is also the case with other *date-fns* functions).
*
* @param {*} date - the date to check
* @returns {Boolean} the date is valid
* @throws {TypeError} 1 argument required
*
* @example
* // For the valid date:
* var result = isValid(new Date(2014, 1, 31))
* //=> true
*
* @example
* // For the value, convertable into a date:
* var result = isValid(1393804800000)
* //=> true
*
* @example
* // For the invalid date:
* var result = isValid(new Date(''))
* //=> false
*/
export default function isValid(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
return !isNaN(date);
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/subMilliseconds/index.js
import toInteger from '../_lib/toInteger/index.js';
import addMilliseconds from '../addMilliseconds/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
/**
* @name subMilliseconds
* @category Millisecond Helpers
* @summary Subtract the specified number of milliseconds from the given date.
*
* @description
* Subtract the specified number of milliseconds from the given date.
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* @param {Date|Number} date - the date to be changed
* @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
* @returns {Date} the new date with the milliseconds subtracted
* @throws {TypeError} 2 arguments required
*
* @example
* // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
* var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
* //=> Thu Jul 10 2014 12:45:29.250
*/
export default function subMilliseconds(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMilliseconds(dirtyDate, -amount);
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/addMilliseconds/index.js
import toInteger from '../_lib/toInteger/index.js';
import toDate from '../toDate/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
/**
* @name addMilliseconds
* @category Millisecond Helpers
* @summary Add the specified number of milliseconds to the given date.
*
* @description
* Add the specified number of milliseconds to the given date.
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* @param {Date|Number} date - the date to be changed
* @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
* @returns {Date} the new date with the milliseconds added
* @throws {TypeError} 2 arguments required
*
* @example
* // Add 750 milliseconds to 10 July 2014 12:45:30.000:
* var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
* //=> Thu Jul 10 2014 12:45:30.750
*/
export default function addMilliseconds(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var timestamp = toDate(dirtyDate).getTime();
var amount = toInteger(dirtyAmount);
return new Date(timestamp + amount);
}
webpack://frontend-tpt/../../packages/tvg-lib-formatter/dates/index.ts
import { format, addMilliseconds, parseISO } from "date-fns";
const generateNewDate = (value: string) =>
parseISO(value).toString() === "Invalid Date"
? new Date(value)
: parseISO(value);
export const parseDate = (value: string | Date) =>
typeof value === "string" ? generateNewDate(value) : value;
export const formatPostTime = (
postTime: string | Date,
showDate: boolean = false
): string =>
postTime
? format(parseDate(postTime), showDate ? "MMM d h:mma" : "hh:mm")
: postTime;
export const formatPeriod = (postTime: string | Date): string =>
postTime ? format(parseDate(postTime), "a") : postTime;
export const formatRaceDate = (raceDate: string | Date): string =>
raceDate ? format(parseDate(raceDate), "dd MMM yyyy") : raceDate;
export const formatDateWithText = (postTime: string | Date): string =>
postTime ? format(parseDate(postTime), "MMM d ''yy") : postTime;
export const formatDateWithTextDayFirst = (postTime: string | Date): string =>
postTime ? format(parseDate(postTime), "d MMM ''yy") : postTime;
export const formatPastRaceDate = (raceDate: string | Date): string =>
raceDate ? format(parseDate(raceDate), "yyyy-MM-dd") : raceDate;
export const formatMonthDayDate = (postTime: string | Date): string =>
postTime ? format(parseDate(postTime), "MMMM d") : postTime;
export const formatThreeLetterMonthDayDate = (
postTime: string | Date
): string =>
postTime ? format(parseDate(postTime), "MMMM").substr(0, 3) : postTime;
export const formatDayDate = (postTime: string | Date): string =>
postTime ? format(parseDate(postTime), "d") : postTime;
export const formatSecondsToDuration = (seconds: number): string =>
format(addMilliseconds(new Date(0), seconds * 1000), "mm:ss.SSS");
export const formatDateToMMDDYYYYhhmm = (date: string | Date): string =>
date ? format(parseDate(date), "MM/dd/yyyy hh:mm a").toUpperCase() : date;
export const formatDateToMMDDYYYYSlashhhmm = (date: string | Date): string =>
date ? format(parseDate(date), "MM/dd/yyyy - hh:mm a").toUpperCase() : date;
export const formatDateToMMDDYYYY = (date: string | Date): string =>
date ? format(parseDate(date), "MM/dd/yyyy") : date;
export const formatDateTohhmm = (date: string | Date): string =>
date ? format(parseDate(date), "hh:mm a").toUpperCase() : date;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/extends.js
export default function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
import arrayWithHoles from "./arrayWithHoles.js";
import iterableToArrayLimit from "./iterableToArrayLimit.js";
import unsupportedIterableToArray from "./unsupportedIterableToArray.js";
import nonIterableRest from "./nonIterableRest.js";
export default function _slicedToArray(arr, i) {
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
export default function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
export default function _iterableToArrayLimit(arr, i) {
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
if (_i == null) return;
var _arr = [];
var _n = true;
var _d = false;
var _s, _e;
try {
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
export default function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js
export default function _taggedTemplateLiteral(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
return Object.freeze(Object.defineProperties(strings, {
raw: {
value: Object.freeze(raw)
}
}));
}
webpack://frontend-tpt/../../node_modules/@emotion/stylis/dist/stylis.browser.esm.js
function stylis_min (W) {
function M(d, c, e, h, a) {
for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
g = e.charCodeAt(l);
l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);
if (0 === b + n + v + m) {
if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
switch (g) {
case 32:
case 9:
case 59:
case 13:
case 10:
break;
default:
f += e.charAt(l);
}
g = 59;
}
switch (g) {
case 123:
f = f.trim();
q = f.charCodeAt(0);
k = 1;
for (t = ++l; l < B;) {
switch (g = e.charCodeAt(l)) {
case 123:
k++;
break;
case 125:
k--;
break;
case 47:
switch (g = e.charCodeAt(l + 1)) {
case 42:
case 47:
a: {
for (u = l + 1; u < J; ++u) {
switch (e.charCodeAt(u)) {
case 47:
if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
l = u + 1;
break a;
}
break;
case 10:
if (47 === g) {
l = u + 1;
break a;
}
}
}
l = u;
}
}
break;
case 91:
g++;
case 40:
g++;
case 34:
case 39:
for (; l++ < J && e.charCodeAt(l) !== g;) {
}
}
if (0 === k) break;
l++;
}
k = e.substring(t, l);
0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));
switch (q) {
case 64:
0 < r && (f = f.replace(N, ''));
g = f.charCodeAt(1);
switch (g) {
case 100:
case 109:
case 115:
case 45:
r = c;
break;
default:
r = O;
}
k = M(c, r, k, g, a + 1);
t = k.length;
0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));
if (0 < t) switch (g) {
case 115:
f = f.replace(da, ea);
case 100:
case 109:
case 45:
k = f + '{' + k + '}';
break;
case 107:
f = f.replace(fa, '$1 $2');
k = f + '{' + k + '}';
k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;
break;
default:
k = f + k, 112 === h && (k = (p += k, ''));
} else k = '';
break;
default:
k = M(c, X(c, f, I), k, h, a + 1);
}
F += k;
k = I = r = u = q = 0;
f = '';
g = e.charCodeAt(++l);
break;
case 125:
case 59:
f = (0 < r ? f.replace(N, '') : f).trim();
if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
case 0:
break;
case 64:
if (105 === g || 99 === g) {
G += f + e.charAt(l);
break;
}
default:
58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
}
I = r = u = q = 0;
f = '';
g = e.charCodeAt(++l);
}
}
switch (g) {
case 13:
case 10:
47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00');
0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
z = 1;
D++;
break;
case 59:
case 125:
if (0 === b + n + v + m) {
z++;
break;
}
default:
z++;
y = e.charAt(l);
switch (g) {
case 9:
case 32:
if (0 === n + m + b) switch (x) {
case 44:
case 58:
case 9:
case 32:
y = '';
break;
default:
32 !== g && (y = ' ');
}
break;
case 0:
y = '\\0';
break;
case 12:
y = '\\f';
break;
case 11:
y = '\\v';
break;
case 38:
0 === n + b + m && (r = I = 1, y = '\f' + y);
break;
case 108:
if (0 === n + b + m + E && 0 < u) switch (l - u) {
case 2:
112 === x && 58 === e.charCodeAt(l - 3) && (E = x);
case 8:
111 === K && (E = K);
}
break;
case 58:
0 === n + b + m && (u = l);
break;
case 44:
0 === b + v + n + m && (r = 1, y += '\r');
break;
case 34:
case 39:
0 === b && (n = n === g ? 0 : 0 === n ? g : n);
break;
case 91:
0 === n + b + v && m++;
break;
case 93:
0 === n + b + v && m--;
break;
case 41:
0 === n + b + m && v--;
break;
case 40:
if (0 === n + b + m) {
if (0 === q) switch (2 * x + 3 * K) {
case 533:
break;
default:
q = 1;
}
v++;
}
break;
case 64:
0 === b + v + n + m + u + k && (k = 1);
break;
case 42:
case 47:
if (!(0 < n + m + v)) switch (b) {
case 0:
switch (2 * g + 3 * e.charCodeAt(l + 1)) {
case 235:
b = 47;
break;
case 220:
t = l, b = 42;
}
break;
case 42:
47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);
}
}
0 === b && (f += y);
}
K = x;
x = g;
l++;
}
t = p.length;
if (0 < t) {
r = c;
if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
p = r.join(',') + '{' + p + '}';
if (0 !== w * E) {
2 !== w || L(p, 2) || (E = 0);
switch (E) {
case 111:
p = p.replace(ha, ':-moz-$1') + p;
break;
case 112:
p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;
}
E = 0;
}
}
return G + p + F;
}
function X(d, c, e) {
var h = c.trim().split(ia);
c = h;
var a = h.length,
m = d.length;
switch (m) {
case 0:
case 1:
var b = 0;
for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {
c[b] = Z(d, c[b], e).trim();
}
break;
default:
var v = b = 0;
for (c = []; b < a; ++b) {
for (var n = 0; n < m; ++n) {
c[v++] = Z(d[n] + ' ', h[b], e).trim();
}
}
}
return c;
}
function Z(d, c, e) {
var h = c.charCodeAt(0);
33 > h && (h = (c = c.trim()).charCodeAt(0));
switch (h) {
case 38:
return c.replace(F, '$1' + d.trim());
case 58:
return d.trim() + c.replace(F, '$1' + d.trim());
default:
if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());
}
return d + c;
}
function P(d, c, e, h) {
var a = d + ';',
m = 2 * c + 3 * e + 4 * h;
if (944 === m) {
d = a.indexOf(':', 9) + 1;
var b = a.substring(d, a.length - 1).trim();
b = a.substring(0, d).trim() + b + ';';
return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;
}
if (0 === w || 2 === w && !L(a, 1)) return a;
switch (m) {
case 1015:
return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;
case 951:
return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;
case 963:
return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;
case 1009:
if (100 !== a.charCodeAt(4)) break;
case 969:
case 942:
return '-webkit-' + a + a;
case 978:
return '-webkit-' + a + '-moz-' + a + a;
case 1019:
case 983:
return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;
case 883:
if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;
if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;
break;
case 932:
if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
case 103:
return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;
case 115:
return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;
case 98:
return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;
}
return '-webkit-' + a + '-ms-' + a + a;
case 964:
return '-webkit-' + a + '-ms-flex-' + a + a;
case 1023:
if (99 !== a.charCodeAt(8)) break;
b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');
return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;
case 1005:
return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;
case 1e3:
b = a.substring(13).trim();
c = b.indexOf('-') + 1;
switch (b.charCodeAt(0) + b.charCodeAt(c)) {
case 226:
b = a.replace(G, 'tb');
break;
case 232:
b = a.replace(G, 'tb-rl');
break;
case 220:
b = a.replace(G, 'lr');
break;
default:
return a;
}
return '-webkit-' + a + '-ms-' + b + a;
case 1017:
if (-1 === a.indexOf('sticky', 9)) break;
case 975:
c = (a = d).length - 10;
b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();
switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
case 203:
if (111 > b.charCodeAt(8)) break;
case 115:
a = a.replace(b, '-webkit-' + b) + ';' + a;
break;
case 207:
case 102:
a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;
}
return a + ';';
case 938:
if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
case 105:
return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;
case 115:
return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;
default:
return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;
}
break;
case 973:
case 989:
if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;
case 931:
case 953:
if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;
break;
case 962:
if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;
}
return a;
}
function L(d, c) {
var e = d.indexOf(1 === c ? ':' : '{'),
h = d.substring(0, 3 !== c ? e : 10);
e = d.substring(e + 1, d.length - 1);
return R(2 !== c ? h : h.replace(na, '$1'), e, c);
}
function ea(d, c) {
var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';
}
function H(d, c, e, h, a, m, b, v, n, q) {
for (var g = 0, x = c, w; g < A; ++g) {
switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
case void 0:
case !1:
case !0:
case null:
break;
default:
x = w;
}
}
if (x !== c) return x;
}
function T(d) {
switch (d) {
case void 0:
case null:
A = S.length = 0;
break;
default:
if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
T(d[c]);
} else Y = !!d | 0;
}
return T;
}
function U(d) {
d = d.prefix;
void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
return U;
}
function B(d, c) {
var e = d;
33 > e.charCodeAt(0) && (e = e.trim());
V = e;
e = [V];
if (0 < A) {
var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
void 0 !== h && 'string' === typeof h && (c = h);
}
var a = M(O, e, c, 0, 0);
0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
V = '';
E = 0;
z = D = 1;
return a;
}
var ca = /^\0+/g,
N = /[\0\r\f]/g,
aa = /: */g,
ka = /zoo|gra/,
ma = /([,: ])(transform)/g,
ia = /,\r+?/g,
F = /([\t\r\n ])*\f?&/g,
fa = /@(k\w+)\s*(\S*)\s*/,
Q = /::(place)/g,
ha = /:(read-only)/g,
G = /[svh]\w+-[tblr]{2}/,
da = /\(\s*(.*)\s*\)/g,
oa = /([\s\S]*?);/g,
ba = /-self|flex-/g,
na = /[^]*?(:[rp][el]a[\w-]+)[^]*/,
la = /stretch|:\s*\w+\-(?:conte|avail)/,
ja = /([^-])(image-set\()/,
z = 1,
D = 1,
E = 0,
w = 1,
O = [],
S = [],
A = 0,
R = null,
Y = 0,
V = '';
B.use = T;
B.set = U;
void 0 !== W && U(W);
return B;
}
export default stylis_min;
webpack://frontend-tpt/../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
var unitlessKeys = {
animationIterationCount: 1,
aspectRatio: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
scale: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
export { unitlessKeys as default };
webpack://frontend-tpt/../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
function memoize(fn) {
var cache = Object.create(null);
return function (arg) {
if (cache[arg] === undefined) cache[arg] = fn(arg);
return cache[arg];
};
}
export { memoize as default };
webpack://frontend-tpt/../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
import memoize from '@emotion/memoize';
// eslint-disable-next-line no-undef
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
var isPropValid = /* #__PURE__ */memoize(function (prop) {
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
/* o */
&& prop.charCodeAt(1) === 110
/* n */
&& prop.charCodeAt(2) < 91;
}
/* Z+1 */
);
export { isPropValid as default };
webpack://frontend-tpt/../../node_modules/styled-components/dist/styled-components.browser.esm.js
import{typeOf as e,isElement as t,isValidElementType as n}from"react-is";import r,{useState as o,useContext as s,useMemo as i,useEffect as a,useRef as c,createElement as u,useDebugValue as l,useLayoutEffect as d}from"react";import h from"shallowequal";import p from"@emotion/stylis";import f from"@emotion/unitless";import m from"@emotion/is-prop-valid";import y from"hoist-non-react-statics";function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var g=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},S=function(t){return null!==t&&"object"==typeof t&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!e(t)},w=Object.freeze([]),E=Object.freeze({});function b(e){return"function"==typeof e}function _(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function N(e){return e&&"string"==typeof e.styledComponentId}var A="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",C="5.3.1",I="undefined"!=typeof window&&"HTMLElement"in window,P=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),O={},R="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"}:{};function D(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],n=1,r=arguments.length;n<r;n+=1)t.push(n<0||arguments.length<=n?void 0:arguments[n]);return t.forEach((function(t){e=e.replace(/%[a-z]/,t)})),e}function j(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw"production"===process.env.NODE_ENV?new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):"")):new Error(D.apply(void 0,[R[e]].concat(n)).trim())}var T=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&j(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var i=this.indexOfGroup(e+1),a=0,c=t.length;a<c;a++)this.tag.insertRule(i,t[a])&&(this.groupSizes[e]++,i++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+=this.tag.getRule(s)+"/*!sc*/\n";return t},e}(),k=new Map,x=new Map,V=1,B=function(e){if(k.has(e))return k.get(e);for(;x.has(V);)V++;var t=V++;return"production"!==process.env.NODE_ENV&&((0|t)<0||t>1<<30)&&j(16,""+t),k.set(e,t),x.set(t,e),t},M=function(e){return x.get(e)},z=function(e,t){t>=V&&(V=t+1),k.set(e,t),x.set(t,e)},L="style["+A+'][data-styled-version="5.3.1"]',G=new RegExp("^"+A+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),F=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r)},Y=function(e,t){for(var n=(t.innerHTML||"").split("/*!sc*/\n"),r=[],o=0,s=n.length;o<s;o++){var i=n[o].trim();if(i){var a=i.match(G);if(a){var c=0|parseInt(a[1],10),u=a[2];0!==c&&(z(u,c),F(e,u,a[3]),e.getTag().insertRules(c,r)),r.length=0}else r.push(i)}}},q=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},H=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(A))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(A,"active"),r.setAttribute("data-styled-version","5.3.1");var i=q();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},$=function(){function e(e){var t=this.element=H(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}j(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),W=function(){function e(e){var t=this.element=H(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),U=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),J=I,X={isServer:!I,useCSSOMInjection:!P},Z=function(){function e(e,t,n){void 0===e&&(e=E),void 0===t&&(t={}),this.options=v({},X,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&I&&J&&(J=!1,function(e){for(var t=document.querySelectorAll(L),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(A)&&(Y(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return B(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(v({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new U(o):r?new $(o):new W(o),new T(e)));var e,t,n,r,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(B(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(B(e),n)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(B(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var s=M(o);if(void 0!==s){var i=e.names.get(s),a=t.getGroup(o);if(i&&a&&i.size){var c=A+".g"+o+'[id="'+s+'"]',u="";void 0!==i&&i.forEach((function(e){e.length>0&&(u+=e+",")})),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),K=/(a)(d)/gi,Q=function(e){return String.fromCharCode(e+(e>25?39:97))};function ee(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Q(t%52)+n;return(Q(t%52)+n).replace(K,"$1-$2")}var te=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ne=function(e){return te(5381,e)};function re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(b(n)&&!N(n))return!1}return!0}var oe=ne("5.3.1"),se=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&re(e),this.componentId=t,this.baseHash=te(oe,t),this.baseStyle=n,Z.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else{var s=Ne(this.rules,e,t,n).join(""),i=ee(te(this.baseHash,s)>>>0);if(!t.hasNameForId(r,i)){var a=n(s,"."+i,void 0,r);t.insertRules(r,i,a)}o.push(i),this.staticRulesId=i}else{for(var c=this.rules.length,u=te(this.baseHash,n.hash),l="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)l+=h,"production"!==process.env.NODE_ENV&&(u=te(u,h+d));else if(h){var p=Ne(h,e,t,n),f=Array.isArray(p)?p.join(""):p;u=te(u,f+d),l+=f}}if(l){var m=ee(u>>>0);if(!t.hasNameForId(r,m)){var y=n(l,"."+m,void 0,r);t.insertRules(r,m,y)}o.push(m)}}return o.join(" ")},e}(),ie=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ce(e){var t,n,r,o,s=void 0===e?E:e,i=s.options,a=void 0===i?E:i,c=s.plugins,u=void 0===c?w:c,l=new p(a),d=[],h=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),f=function(e,r,s){return 0===r&&-1!==ae.indexOf(s[n.length])||s.match(o)?e:"."+t};function m(e,s,i,a){void 0===a&&(a="&");var c=e.replace(ie,""),u=s&&i?i+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(i||!s?"":s,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f))},h,function(e){if(-2===e){var t=d;return d=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||j(15),te(e,t.name)}),5381).toString():"",m}var ue=r.createContext(),le=ue.Consumer,de=r.createContext(),he=(de.Consumer,new Z),pe=ce();function fe(){return s(ue)||he}function me(){return s(de)||pe}function ye(e){var t=o(e.stylisPlugins),n=t[0],s=t[1],c=fe(),u=i((function(){var t=c;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),l=i((function(){return ce({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return a((function(){h(n,e.stylisPlugins)||s(e.stylisPlugins)}),[e.stylisPlugins]),r.createElement(ue.Provider,{value:u},r.createElement(de.Provider,{value:l},"production"!==process.env.NODE_ENV?r.Children.only(e.children):e.children))}var ve=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=pe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return j(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=pe),this.name+e.hash},e}(),ge=/([A-Z])/,Se=/([A-Z])/g,we=/^ms-/,Ee=function(e){return"-"+e.toLowerCase()};function be(e){return ge.test(e)?e.replace(Se,Ee).replace(we,"-ms-"):e}var _e=function(e){return null==e||!1===e||""===e};function Ne(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a<c;a+=1)""!==(s=Ne(e[a],n,r,o))&&(Array.isArray(s)?i.push.apply(i,s):i.push(s));return i}if(_e(e))return"";if(N(e))return"."+e.styledComponentId;if(b(e)){if("function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!n)return e;var u=e(n);return"production"!==process.env.NODE_ENV&&t(u)&&console.warn(_(e)+" is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details."),Ne(u,n,r,o)}var l;return e instanceof ve?r?(e.inject(r,o),e.getName(o)):e:S(e)?function e(t,n){var r,o,s=[];for(var i in t)t.hasOwnProperty(i)&&!_e(t[i])&&(Array.isArray(t[i])&&t[i].isCss||b(t[i])?s.push(be(i)+":",t[i],";"):S(t[i])?s.push.apply(s,e(t[i],i)):s.push(be(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in f?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(s,["}"]):s}(e):e.toString()}var Ae=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return b(e)||S(e)?Ae(Ne(g(w,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:Ae(Ne(g(e,n)))}var Ie=/invalid hook call/i,Pe=new Set,Oe=function(e,t){if("production"!==process.env.NODE_ENV){var n="The component "+e+(t?' with the id of "'+t+'"':"")+" has been created dynamically.\nYou may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",r=console.error;try{var o=!0;console.error=function(e){if(Ie.test(e))o=!1,Pe.delete(n);else{for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];r.apply(void 0,[e].concat(s))}},c(),o&&!Pe.has(n)&&(console.warn(n),Pe.add(n))}catch(e){Ie.test(e.message)&&Pe.delete(n)}finally{console.error=r}}},Re=function(e,t,n){return void 0===n&&(n=E),e.theme!==n.theme&&e.theme||t||n.theme},De=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function Te(e){return e.replace(De,"-").replace(je,"")}var ke=function(e){return ee(ne(e)>>>0)};function xe(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Ve=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Be=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Me(e,t,n){var r=e[n];Ve(t)&&Ve(r)?ze(r,t):e[n]=t}function ze(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,s=n;o<s.length;o++){var i=s[o];if(Ve(i))for(var a in i)Be(a)&&Me(e,i[a],a)}return e}var Le=r.createContext(),Ge=Le.Consumer;function Fe(e){var t=s(Le),n=i((function(){return function(e,t){if(!e)return j(14);if(b(e)){var n=e(t);return"production"===process.env.NODE_ENV||null!==n&&!Array.isArray(n)&&"object"==typeof n?n:j(7)}return Array.isArray(e)||"object"!=typeof e?j(8):t?v({},t,{},e):e}(e.theme,t)}),[e.theme,t]);return e.children?r.createElement(Le.Provider,{value:n},e.children):null}var Ye={};function qe(e,t,n){var o=N(e),i=!xe(e),a=t.attrs,c=void 0===a?w:a,d=t.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":Te(e);Ye[n]=(Ye[n]||0)+1;var r=n+"-"+ke("5.3.1"+n+Ye[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):d,p=t.displayName,f=void 0===p?function(e){return xe(e)?"styled."+e:"Styled("+_(e)+")"}(e):p,g=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||h,S=o&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,A=t.shouldForwardProp;o&&e.shouldForwardProp&&(A=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var C,I=new se(n,g,o?e.componentStyle:void 0),P=I.isStatic&&0===c.length,O=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,d=e.shouldForwardProp,h=e.styledComponentId,p=e.target;"production"!==process.env.NODE_ENV&&l(h);var f=function(e,t,n){void 0===e&&(e=E);var r=v({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,s,i=e;for(t in b(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],s=i[t],n&&s?n+" "+s:n||s):i[t]})),[r,o]}(Re(t,s(Le),a)||E,t,o),y=f[0],g=f[1],S=function(e,t,n,r){var o=fe(),s=me(),i=t?e.generateAndInjectStyles(E,o,s):e.generateAndInjectStyles(n,o,s);return"production"!==process.env.NODE_ENV&&l(i),"production"!==process.env.NODE_ENV&&!t&&r&&r(i),i}(i,r,y,"production"!==process.env.NODE_ENV?e.warnTooManyClasses:void 0),w=n,_=g.$as||t.$as||g.as||t.as||p,N=xe(_),A=g!==t?v({},t,{},g):t,C={};for(var I in A)"$"!==I[0]&&"as"!==I&&("forwardedAs"===I?C.as=A[I]:(d?d(I,m,_):!N||m(I))&&(C[I]=A[I]));return t.style&&g.style!==t.style&&(C.style=v({},t.style,{},g.style)),C.className=Array.prototype.concat(c,h,S!==h?S:null,t.className,g.className).filter(Boolean).join(" "),C.ref=w,u(_,C)}(C,e,t,P)};return O.displayName=f,(C=r.forwardRef(O)).attrs=S,C.componentStyle=I,C.displayName=f,C.shouldForwardProp=A,C.foldedComponentIds=o?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):w,C.styledComponentId=g,C.target=o?e.target:e,C.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["componentId"]),s=r&&r+"-"+(xe(e)?e:Te(_(e)));return qe(e,v({},o,{attrs:S,componentId:s}),n)},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?ze({},e.defaultProps,t):t}}),"production"!==process.env.NODE_ENV&&(Oe(f,g),C.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'+t+'"':"";console.warn("Over 200 classes were generated for component "+e+s+".\nConsider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(f,g)),C.toString=function(){return"."+C.styledComponentId},i&&y(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C}var He=function(e){return function e(t,r,o){if(void 0===o&&(o=E),!n(r))return j(1,String(r));var s=function(){return t(r,o,Ce.apply(void 0,arguments))};return s.withConfig=function(n){return e(t,r,v({},o,{},n))},s.attrs=function(n){return e(t,r,v({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},s}(qe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){He[e]=He(e)}));var $e=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=re(e),Z.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var o=r(Ne(this.rules,t,n,r).join(""),""),s=this.componentId+e;n.insertRules(s,s,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&Z.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function We(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=Ce.apply(void 0,[e].concat(n)),a="sc-global-"+ke(JSON.stringify(i)),u=new $e(i,a);function l(e){var t=fe(),n=me(),o=s(Le),l=c(t.allocateGSInstance(a)).current;return"production"!==process.env.NODE_ENV&&r.Children.count(e.children)&&console.warn("The global style component "+a+" was given child JSX. createGlobalStyle does not render children."),"production"!==process.env.NODE_ENV&&i.some((function(e){return"string"==typeof e&&-1!==e.indexOf("@import")}))&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),t.server&&h(l,e,t,o,n),d((function(){if(!t.server)return h(l,e,t,o,n),function(){return u.removeStyles(l,t)}}),[l,e,t,o,n]),null}function h(e,t,n,r,o){if(u.isStatic)u.renderStyles(e,O,n,o);else{var s=v({},t,{theme:Re(t,r,l.defaultProps)});u.renderStyles(e,s,n,o)}}return"production"!==process.env.NODE_ENV&&Oe(a),r.memo(l)}function Ue(e){"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Ce.apply(void 0,[e].concat(n)).join(""),s=ke(o);return new ve(s,o)}var Je=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=q();return"<style "+[n&&'nonce="'+n+'"',A+'="true"','data-styled-version="5.3.1"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?j(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return j(2);var n=((t={})[A]="",t["data-styled-version"]="5.3.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=q();return o&&(n.nonce=o),[r.createElement("style",v({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Z({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?j(2):r.createElement(ye,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return j(3)},e}(),Xe=function(e){var t=r.forwardRef((function(t,n){var o=s(Le),i=e.defaultProps,a=Re(t,o,i);return"production"!==process.env.NODE_ENV&&void 0===a&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'+_(e)+'"'),r.createElement(e,v({},t,{theme:a,ref:n}))}));return y(t,e),t.displayName="WithTheme("+_(e)+")",t},Ze=function(){return s(Le)},Ke={StyleSheet:Z,masterSheet:he};"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native"),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window["__styled-components-init__"]=window["__styled-components-init__"]||0,1===window["__styled-components-init__"]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window["__styled-components-init__"]+=1);export default He;export{Je as ServerStyleSheet,le as StyleSheetConsumer,ue as StyleSheetContext,ye as StyleSheetManager,Ge as ThemeConsumer,Le as ThemeContext,Fe as ThemeProvider,Ke as __PRIVATE__,We as createGlobalStyle,Ce as css,N as isStyledComponent,Ue as keyframes,Ze as useTheme,C as version,Xe as withTheme};
//# sourceMappingURL=styled-components.browser.esm.js.map
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Buttons/default-styled.js
// Default Button
import styled from "styled-components";
export default styled.button`
outline: none;
opacity: ${(props) => (props.isDisabled ? 0.3 : 1)};
cursor: ${(props) => (props.isDisabled ? "default" : "pointer")};
background-color: transparent;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Buttons/default.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import DefaultButton from "./default-styled";
export default class ButtonDefault extends PureComponent {
static defaultProps = {
children: null,
onClick: noop,
className: "",
isDisabled: false,
qaLabel: "",
optionalData: null
};
render() {
const componentProps = {
...(this.props.qaLabel !== ""
? {
"data-qa-label": this.props.qaLabel
}
: {}),
...(this.props.optionalData
? {
"data-optional": this.props.optionalData
}
: {}),
onClick: !this.props.isDisabled ? this.props.onClick : noop,
className: this.props.className,
isDisabled: this.props.isDisabled
};
return (
<DefaultButton {...componentProps} disabled={this.props.isDisabled}>
{this.props.children}
</DefaultButton>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/ColorPalette/index.jsx
import ColorPalette from "./palette.json"; export default (color, variation) => ColorPalette[color][variation].value;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Buttons/styles.js
import buildColor from "../../_static/ColorPalette";
const SIZES = {
default: { height: "32px", fontSize: "11px", padding: "0 8px" },
small: { height: "24px", fontSize: "10px", padding: "0 8px" },
micro: { height: "16px", fontSize: "10px", padding: "2px" },
big: { height: "40px", fontSize: "12px", padding: "0 16px" },
bigger: { height: "44px", fontSize: "14px", padding: "0 16px" },
huge: { height: "48px", fontSize: "14px", padding: "0 24px" },
autoSized: { height: "auto", fontSize: "auto", padding: "0" }
};
const TYPES = {
primary: {
background: buildColor("blue_accent", "500"),
hover: buildColor("blue_accent", "600"),
active: buildColor("blue_accent", "700"),
selected: buildColor("blue_accent", "600"),
text: buildColor("white", "100"),
loadingBackground: buildColor("blue_accent", "200"),
border: "none"
},
secondary: {
background: buildColor("white", "100"),
hover: buildColor("blue", "000"),
active: buildColor("blue", "100"),
selected: buildColor("blue", "100"),
text: buildColor("grey", "900"),
border: `1px solid ${buildColor("blue", "100")}`
},
secondary_alt: {
background: buildColor("white", "20"),
hover: buildColor("white", "50"),
active: buildColor("white", "10"),
selected: buildColor("black", "50"),
text: buildColor("white", "100"),
border: "none"
},
tertiary: {
background: "transparent",
hover: buildColor("blue_accent", "100"),
active: buildColor("blue", "200"),
selected: buildColor("blue", "100"),
text: buildColor("blue_accent", "500"),
loadingBackground: buildColor("blue", "100"),
border: "none"
},
tertiary_alt: {
background: "transparent",
hover: buildColor("white", "10"),
active: buildColor("white", "20"),
selected: buildColor("white", "20"),
text: buildColor("white", "100"),
border: "none"
},
bet: {
background: buildColor("green", "500"),
hover: buildColor("green", "600"),
active: buildColor("green", "700"),
selected: buildColor("green", "600"),
text: buildColor("white", "100"),
loadingBackground: buildColor("green", "100"),
border: "none"
},
marketing: {
background: buildColor("yellow", "500"),
hover: buildColor("yellow", "600"),
active: buildColor("yellow", "700"),
selected: buildColor("yellow", "600"),
text: buildColor("grey", "900"),
loadingBackground: buildColor("yellow", "100"),
border: "none"
},
delete: {
background: buildColor("red", "500"),
hover: buildColor("red", "400"),
active: buildColor("red", "600"),
selected: buildColor("red", "600"),
text: buildColor("white", "100"),
loadingBackground: buildColor("red", "100"),
border: "none"
},
shadow: {
background: buildColor("black", "50"),
hover: buildColor("grey", "900"),
active: buildColor("black", "70"),
selected: buildColor("black", "70"),
text: buildColor("white", "100"),
border: "none"
},
non_styled: {}
};
export const getType = (type) => TYPES[type];
export const getSize = (size) => SIZES[size];
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Buttons/styled-components.js
import { Link } from "react-router-dom";
import styled, { css } from "styled-components";
import ButtonDefault from "./default";
import { getSize, getType } from "./styles";
import buildColor from "../../_static/ColorPalette";
// Button
export const ButtonComp = styled(ButtonDefault)`
height: ${(props) => props.$sizeSpecs.height};
width: ${(props) => props.$isStretched && "100%"};
padding: ${(props) => props.$sizeSpecs.padding};
font-size: ${(props) => props.$sizeSpecs.fontSize};
font-family: ${(props) => (props.fontFamily ? props.fontFamily : "inherit")};
&& {
background-color: ${(props) =>
props.isSelected && !props.$isDisabled
? props.$typeSpecs.selected
: props.$typeSpecs.background};
background-color: ${(props) =>
props.isLoading && props.$typeSpecs.loadingBackground};
}
color: ${(props) => props.$typeSpecs.text};
border: ${(props) => props.$typeSpecs.border};
font-weight: ${(props) => (props.isBold ? "bold" : "normal")};
text-transform: ${(props) =>
props.isUppercase ? "uppercase" : props.textTransform};
border-radius: ${(props) => (props.$hasRoundedCorners ? "2px" : 0)};
${(props) =>
props.$hasShadow && `box-shadow: 0px 2px 2px rgba(17, 43, 68, 0.15);`}
${({ customMarginBottom }) =>
customMarginBottom > 0 ? `margin-bottom: ${customMarginBottom}px;` : ""}
/* only add hover state for fine pointers, meaning that only on desktops using a mouse the hover state will work */
@media (pointer: fine) {
&:hover {
background-color: ${(props) =>
!props.$isDisabled && props.$typeSpecs.hover};
}
}
&:active {
background-color: ${(props) =>
!props.$isDisabled && props.$typeSpecs.active};
/* on touch devices (coarse), the active color should be the hover spec according to the style guide on zeplin */
@media (pointer: coarse) {
background-color: ${(props) =>
!props.$isDisabled && props.$typeSpecs.hover};
}
}
& > span {
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
line-height: 1;
}
`;
export const StyledLink = styled(Link)`
display: inline-flex;
align-items: center;
justify-content: center;
width: ${(props) => props.$isStretched && "100%"};
height: ${(props) => props.$sizeSpecs.height};
padding: ${(props) => props.$sizeSpecs.padding};
font-size: ${(props) => props.$sizeSpecs.fontSize};
background-color: ${(props) => props.$typeSpecs.background};
color: ${(props) => props.$typeSpecs.text};
opacity: ${(props) => (props.$isDisabled ? 0.3 : 1)};
border: ${(props) => props.$typeSpecs.border};
font-weight: ${(props) => (props.isBold ? "bold" : "normal")};
text-decoration: none;
text-transform: ${(props) => (props.isUppercase ? "uppercase" : "normal")};
border-radius: ${(props) => (props.$hasRoundedCorners ? "2px" : 0)};
line-height: 1;
${(props) =>
props.$hasShadow && `box-shadow: 0px 2px 2px rgba(17, 43, 68, 0.15);`}
/* only add hover state for fine pointers, meaning that only on desktops using a mouse the hover state will work */
@media (pointer: fine) {
&:hover {
background-color: ${(props) =>
!props.$isDisabled && props.$typeSpecs.hover};
}
}
&:active {
background-color: ${(props) =>
!props.$isDisabled && props.$typeSpecs.active};
/* on touch devices (coarse), the active color should be the hover spec according to the style guide on zeplin */
@media (pointer: coarse) {
background-color: ${(props) =>
!props.$isDisabled && props.$typeSpecs.hover};
}
}
`;
export const StyledRef = styled.a`
display: inline-flex;
align-items: center;
justify-content: center;
width: ${(props) => props.$isStretched && "100%"};
height: ${(props) => props.$sizeSpecs.height};
padding: ${(props) => props.$sizeSpecs.padding};
font-size: ${(props) => props.$sizeSpecs.fontSize};
background-color: ${(props) => props.$typeSpecs.background};
color: ${(props) => props.$typeSpecs.text};
opacity: ${(props) => (props.$isDisabled ? 0.3 : 1)};
border: ${(props) => props.$typeSpecs.border};
font-weight: ${(props) => (props.isBold ? "bold" : "normal")};
text-decoration: none;
text-transform: ${(props) => (props.isUppercase ? "uppercase" : "normal")};
border-radius: ${(props) => (props.$hasRoundedCorners ? "2px" : 0)};
line-height: 1;
${(props) =>
props.$hasShadow && `box-shadow: 0px 2px 2px rgba(17, 43, 68, 0.15);`}
/* only add hover state for fine pointers, meaning that only on desktops using a mouse the hover state will work */
@media (pointer: fine) {
&:hover {
background-color: ${(props) =>
!props.$isDisabled && props.$typeSpecs.hover};
}
}
&:active {
background-color: ${(props) =>
!props.$isDisabled && props.$typeSpecs.active};
/* on touch devices (coarse), the active color should be the hover spec according to the style guide on zeplin */
@media (pointer: coarse) {
background-color: ${(props) =>
!props.$isDisabled && props.$typeSpecs.hover};
}
}
`;
const appendHref = ({ component, isExternal }) =>
isExternal ? styled.a.attrs((props) => ({ href: props.to })) : component;
// Link
export const buildLink = (
tag,
type,
size,
isStretched,
isDisabled,
hasRoundedCorners,
isExternal
) => {
const sizeSpecs = getSize(size);
const typeSpecs = getType(type);
const StyledComp = appendHref({ component: styled(Link), isExternal })`
display: inline-flex;
align-items: center;
justify-content: center;
width: ${isStretched && "100%"};
height: ${sizeSpecs.height};
padding: ${sizeSpecs.padding};
font-size: ${sizeSpecs.fontSize};
background-color: ${typeSpecs.background};
color: ${typeSpecs.text};
opacity: ${isDisabled ? 0.3 : 1};
border: ${typeSpecs.border};
font-weight: ${(props) => (props.isBold ? "bold" : "normal")};
text-decoration: none;
text-transform: ${(props) => (props.isUppercase ? "uppercase" : "normal")};
border-radius: ${hasRoundedCorners ? "2px" : 0};
line-height: 1;
/* only add hover state for fine pointers, meaning that only on desktops using a mouse the hover state will work */
@media (pointer: fine) {
&:hover {
background-color: ${!isDisabled && typeSpecs.hover};
}
}
&:active {
background-color: ${!isDisabled && typeSpecs.active};
/* on touch devices (coarse), the active color should be the hover spec according to the style guide on zeplin */
@media (pointer: coarse) {
background-color: ${!isDisabled && typeSpecs.hover};
}
}
`;
return tag === "link" ? StyledComp : StyledComp.withComponent(tag);
};
// Promos
const OverwriteStyles = css`
width: 56px;
padding: 0;
font-size: 10px;
display: flex;
flex-direction: column;
`;
export const Promos = styled(
buildLink("link", "marketing", "big", false, false, true)
)`
${OverwriteStyles};
`;
export const PromosExternal = styled(
buildLink("a", "marketing", "big", false, false, true, true)
)`
${OverwriteStyles};
`;
export const OptedInAlt = styled(
buildLink("link", "secondary_alt", "big", false, false, true)
)`
${OverwriteStyles};
`;
export const OptedIn = styled(
buildLink("link", "secondary", "big", false, false, true)
)`
${OverwriteStyles};
`;
// MyBets
export const RoundBtnComp = styled.button`
display: inline-flex;
justify-content: center;
align-items: center;
outline: none;
height: 44px;
width: 44px;
background-color: ${buildColor("white", "100")};
border-radius: 50%;
border: 1px solid ${buildColor("blue", "100")};
z-index: 20;
text-align: center;
pointer-events: all;
&:active {
background-color: ${buildColor("blue_accent", "100")};
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/CircularLoader/styled-components.js
import styled from "styled-components";
import buildColor from "../ColorPalette";
export const CircularBackground = styled.div`
position: absolute;
display: block;
height: ${({ size }) => (size === "small" ? `24px` : "38px")};
width: ${({ size }) => (size === "small" ? `24px` : "38px")};
`;
export const Bar = styled.span`
display: block;
position: absolute;
inset: 0;
margin: auto;
&::before,
&::after {
content: "";
display: block;
position: absolute;
inset: 0;
margin: auto;
height: ${({ size }) => (size === "small" ? `18px` : "32px")};
width: ${({ size }) => (size === "small" ? `18px` : "32px")};
border-radius: 50%;
}
&::before {
border: 3px solid
${({ backgroundColor }) => backgroundColor || buildColor("green", "800")};
border-top: 3px solid
${({ borderColor }) => borderColor || buildColor("white", "100")};
-webkit-animation: loader-2-3 1.5s cubic-bezier(0.77, 0, 0.175, 1) infinite;
animation: loader-2-3 1.5s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}
@keyframes loader-2-3 {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes loader-2-3 {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/CircularLoader/index.jsx
import React from "react";
import { CircularBackground, Bar } from "./styled-components";
const CircularLoader = ({ size, borderColor, backgroundColor }) => (
<CircularBackground size={size}>
<Bar
size={size}
borderColor={borderColor}
backgroundColor={backgroundColor}
/>
</CircularBackground>
);
export default CircularLoader;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Buttons/button.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import { ButtonComp } from "./styled-components";
import { getSize, getType } from "./styles";
import CircularLoader from "../../_static/CircularLoader";
export default class Button extends PureComponent {
static defaultProps = {
children: null,
className: "",
onClick: noop,
size: "default",
type: "primary",
isDisabled: false,
isSelected: false,
hasRoundedCorners: true,
isStretched: false,
isUppercase: true,
textTransform: "normal",
isBold: true,
hasShadow: false,
qaLabel: "",
fontFamily: "inherit",
isLoading: false,
loadingBorderColor: "",
loadingBackgroundColor: "",
optionalData: null,
customMarginBottom: 0
};
render() {
const sizeSpecs = getSize(this.props.size);
const typeSpecs = getType(this.props.type);
const compProps = {
$sizeSpecs: sizeSpecs,
$typeSpecs: typeSpecs,
isSelected: this.props.isSelected,
$isStretched: this.props.isStretched,
isUppercase: this.props.isUppercase,
textTransform: this.props.textTransform,
isBold: this.props.isBold,
$hasShadow: this.props.hasShadow,
$isDisabled: this.props.isDisabled,
$hasRoundedCorners: this.props.hasRoundedCorners,
...(this.props.qaLabel !== ""
? {
qaLabel: this.props.qaLabel
}
: {}),
fontFamily: this.props.fontFamily,
isLoading: this.props.isLoading,
optionalData: this.props.optionalData
};
return (
<ButtonComp
{...compProps}
className={this.props.className}
isDisabled={this.props.isDisabled}
customMarginBottom={this.props.customMarginBottom}
onClick={this.props.onClick}
>
{this.props.isLoading ? (
<span>
<CircularLoader
borderColor={this.props.loadingBorderColor}
backgroundColor={this.props.loadingBackgroundColor}
/>
</span>
) : (
<span
{...(compProps.optionalData
? { "data-optional": compProps.optionalData }
: {})}
>
{this.props.children}
</span>
)}
</ButtonComp>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Typography/index.js
export const defaultSize = "14px"; export const titleFont = "'Roboto Condensed', sans-serif"; export const titleFontSecondary = "'Roboto', sans-serif"; export const titleMedium = "'Roboto-Medium', sans-serif"; export const defaultTextFont = "'Roboto', Arial, sans-serif"; // New fonts export const fontCondensedNormal = "'RobotoCondensed-Regular', sans-serif"; export const fontNormal = "'Roboto-Regular', sans-serif"; export const fontMono = "'Roboto Mono', monospace"; export const fontMedium = "'Roboto-Medium', sans-serif"; export const fontBold = "'Roboto-Bold', sans-serif"; export const fontBlack = "'Roboto-Black', sans-serif"; export const fontSansSerif = "sans-serif";
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/LoginForm/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import { fontNormal, fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
// The login form story container is only meant to be used by ./story.jsx
export const LoginFormStoryContainer = styled.section`
background-color: ${buildColor("white", "100")};
padding: 24px;
`;
export const LoginFormComponent = styled.form`
overflow: auto;
flex: 1;
${({ device }) =>
device === "mobile"
? css`
padding: 16px 12px 12px;
`
: css`
padding: 20px;
`};
`;
export const MessageBoxContainer = styled.div`
${({ device }) =>
device === "mobile"
? css`
margin: 0 0 8px;
`
: css`
margin: 20px 20px 0;
`}
`;
export const AsideLabelLink = styled(Link)`
text-decoration: none;
color: ${buildColor("blue_accent", "500")};
font-size: 12px;
font-family: ${fontMedium};
&:active {
color: ${buildColor("blue_accent", "700")};
}
`;
export const TextLink = styled(Link)`
color: ${buildColor("red", "600")} !important;
font-size: 14px;
font-family: ${fontMedium};
font-weight: 500;
line-height: 16px;
vertical-align: inherit;
`;
export const SelectWarnText = styled.p`
color: ${buildColor("grey", "700")};
font-weight: normal;
line-height: 18px;
margin-top: 8px;
font-family: ${fontNormal};
`;
export const GoogleText = styled.p`
color: ${buildColor("grey", "700")};
font-weight: normal;
line-height: 18px;
margin-top: 16px;
font-family: ${fontNormal};
`;
export const GoogleTextLink = styled.a`
text-decoration: none;
color: ${buildColor("blue_accent", "500")};
font-family: ${fontMedium};
line-height: 18px;
margin-left: 2px;
vertical-align: baseline;
&:active {
color: ${buildColor("blue_accent", "700")};
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Icons/icons.js
import color from "../ColorPalette";
export const account = {
id: "account",
shapes: [
{
path: "M506.24 416c70.692 0 128-57.308 128-128s-57.308-128-128-128v0c-70.692 0-128 57.308-128 128s57.308 128 128 128v0zM506.24 512c-123.712 0-224-100.288-224-224s100.288-224 224-224v0c123.712 0 224 100.288 224 224s-100.288 224-224 224v0zM840.96 864l-13.44-80.192c-10.911-63.833-65.826-111.808-131.946-111.808-0.008 0-0.015 0-0.023 0l-378.687-0c-0.006-0-0.014-0-0.022-0-66.12 0-121.035 47.975-131.834 111.015l-0.112 0.793-13.376 80.192h669.44zM316.8 576h378.688c0.015-0 0.034-0 0.052-0 113.556 0 207.871 82.38 226.443 190.638l0.193 1.362 25.792 154.752c0.276 1.578 0.433 3.394 0.433 5.248 0 17.668-14.318 31.992-31.984 32l-820.417 0c-17.667-0.008-31.985-14.332-31.985-32 0-1.854 0.158-3.67 0.46-5.438l-0.027 0.19 25.792-154.752c18.76-109.594 113.035-191.961 226.556-192l0.004-0z",
fill: null
}
]
};
export const accountTransactions = {
id: "accountTransactions",
shapes: [
{
path: "M143.768 64C64.242 64-.195 128.488-.195 208v608c0 79.512 64.437 144 143.963 144h267.019v-96H143.768c-26.472 0-47.963-21.473-47.963-48V208c0-26.527 21.491-48 47.963-48h473.144c30.561 0 54.395 25.386 54.395 48v66.501h96V208c0-83.425-74.957-144-150.395-144H143.768zM512.02 656c0-114.892 93.098-208 207.902-208 114.804 0 207.902 93.108 207.902 208s-93.098 208-207.902 208c-114.804 0-207.902-93.108-207.902-208zm207.902-304C552.064 352 416.02 488.123 416.02 656s136.044 304 303.902 304c167.858 0 303.898-136.123 303.898-304S887.78 352 719.922 352zm39.12 224c0-26.51-21.49-48-48-48-26.509 0-48 21.49-48 48v117.383a48.002 48.002 0 0028.519 43.869l95.963 42.617c24.228 10.759 52.591-.159 63.351-24.387 10.759-24.228-.159-52.591-24.387-63.351l-67.446-29.952V576zm-439.351 31.826h-128v-96h128v96zm-128-191.797h255.903v-96H191.691v96z",
fill: null,
fillRule: "evenodd",
clipRule: "evenodd"
}
]
};
export const chat = {
id: "chat",
shapes: [
{
path: "M873.412 120.471h-722.824c-49.815 0-90.353 40.538-90.353 90.353v481.882c0 49.815 40.538 90.353 90.353 90.353h164.563l111.556 167.273c5.602 8.373 14.999 13.432 25.058 13.432s19.456-5 25.058-13.432l111.556-167.273h285.033c49.815 0 90.353-40.538 90.353-90.353v-481.882c0-49.815-40.538-90.353-90.353-90.353zM903.529 692.706c0 16.625-13.553 30.118-30.118 30.118h-301.176c-10.059 0-19.456 5-25.058 13.432l-95.413 143.119-95.413-143.119c-5.602-8.433-14.999-13.432-25.058-13.432h-180.706c-16.565 0-30.118-13.493-30.118-30.118v-481.882c0-16.625 13.553-30.118 30.118-30.118h722.824c16.565 0 30.118 13.493 30.118 30.118v481.882z",
fill: null
}
]
};
export const account20 = {
id: "account20",
shapes: [
{
path: "M151.706 883.2h720.589l-15.923-119.296c-8.635-63.047-62.142-111.101-126.873-111.104l-434.995-0c-64.732 0.003-118.239 48.057-126.799 110.438l-0.075 0.666-15.872 119.296zM294.554 576h434.944c0.002-0 0.004-0 0.007-0 103.557 0 189.162 76.861 202.881 176.648l0.12 1.067 23.654 177.306c0.143 1.015 0.224 2.188 0.224 3.379 0 14.138-11.462 25.6-25.6 25.6-0.007 0-0.014-0-0.020-0l-837.58 0c-0.006 0-0.012 0-0.019 0-14.138 0-25.6-11.462-25.6-25.6 0-1.192 0.081-2.364 0.239-3.512l-0.015 0.133 23.654-177.306c13.839-100.854 99.444-177.715 203.001-177.715 0.002 0 0.005 0 0.007 0l-0-0zM512 512c-123.712 0-224-100.288-224-224s100.288-224 224-224v0c123.712 0 224 100.288 224 224s-100.288 224-224 224v0zM512 435.2c81.296 0 147.2-65.904 147.2-147.2s-65.904-147.2-147.2-147.2v0c-81.296 0-147.2 65.904-147.2 147.2s65.904 147.2 147.2 147.2v0z",
fill: null
}
]
};
export const calendar = {
id: "calendar",
shapes: [
{
path: "M672 67.2a48 48 0 0148 48V128h128a112 112 0 01112 112v608a112 112 0 01-112 112H176A112 112 0 0164 848V240a112 112 0 01112-112h128v-12.8a48 48 0 1196 0V128h224v-12.8a48 48 0 0148-48zM624 224H400v44.8a48 48 0 11-96 0V224H176a16 16 0 00-16 16v608a16 16 0 0016 16h672a16 16 0 0016-16V240a16 16 0 00-16-16H720v44.8a48 48 0 11-96 0V224zM352 704v64h-96v-64h96zm192 0v64h-96v-64h96zM352 576v64h-96v-64h96zm192 0v64h-96v-64h96zm192 0v64h-96v-64h96zm-576-96v-96h704v96H160z",
fill: null
}
]
};
export const add = {
id: "add",
shapes: [
{
path: "M576 448h224c17.673 0 32 14.327 32 32v0 64c0 17.673-14.327 32-32 32v0h-224v224c0 17.673-14.327 32-32 32v0h-64c-17.673 0-32-14.327-32-32v0-224h-224c-17.673 0-32-14.327-32-32v0-64c0-17.673 14.327-32 32-32v0h224v-224c0-17.673 14.327-32 32-32v0h64c17.673 0 32 14.327 32 32v0 224z",
fill: null
}
]
};
export const minus = {
id: "minus",
shapes: [
{
path: "M224 448h576c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32h-576c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32z",
fill: null
}
]
};
export const plus = {
id: "plus",
shapes: [
{
path: "M560 560h176c17.673 0 32-14.327 32-32v0-32c0-17.673-14.327-32-32-32v0h-176v-176c0-17.673-14.327-32-32-32v0h-32c-17.673 0-32 14.327-32 32v0 176h-176c-17.673 0-32 14.327-32 32v0 32c0 17.673 14.327 32 32 32v0h176v176c0 17.673 14.327 32 32 32v0h32c17.673 0 32-14.327 32-32v0-176zM512 0c-282.77 0-512 229.23-512 512s229.23 512 512 512v0c282.77 0 512-229.23 512-512s-229.23-512-512-512v0zM512 96c229.75 0 416 186.25 416 416s-186.25 416-416 416v0c-229.75 0-416-186.25-416-416s186.25-416 416-416v0z",
fill: null
}
]
};
export const tick = {
id: "tick",
shapes: [
{
path: "M373.312 651.648l429.888-429.888c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l45.248 45.248c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-497.792 497.792c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-226.24-226.24c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l45.248-45.248c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l158.4 158.336z",
fill: null
}
]
};
export const doubleArrowRight = {
id: "doubleArrowRight",
shapes: [
{
path: "M728.034 511.984l-248.902-248.902c-12.497-12.497-12.497-32.758 0-45.255l45.255-45.255c12.497-12.497 32.758-12.497 45.255 0l316.784 316.784c12.497 12.497 12.497 32.758 0 45.255l-316.784 316.784c-12.497 12.497-32.758 12.497-45.255 0l-45.255-45.255c-12.497-12.497-12.497-32.758 0-45.255l248.902-248.902zM386.274 512l-248.902-248.902c-12.497-12.497-12.497-32.758 0-45.255l45.255-45.255c12.497-12.497 32.758-12.497 45.255 0l316.784 316.784c12.497 12.497 12.497 32.758 0 45.255l-316.784 316.784c-12.497 12.497-32.758 12.497-45.255 0l-45.255-45.255c-12.497-12.497-12.497-32.758 0-45.255l248.902-248.902z",
fill: null
}
]
};
export const doubleArrowLeft = {
id: "doubleArrowLeft",
shapes: [
{
path: "M295.765 512l248.902 248.902c12.497 12.497 12.497 32.758 0 45.255l-45.255 45.255c-12.497 12.497-32.758 12.497-45.255 0l-316.784-316.784c-12.497-12.497-12.497-32.758 0-45.255l316.784-316.784c12.497-12.497 32.758-12.497 45.255 0l45.255 45.255c12.497 12.497 12.497 32.758 0 45.255l-248.902 248.902zM637.525 511.984l248.902 248.902c12.497 12.497 12.497 32.758 0 45.255l-45.255 45.255c-12.497 12.497-32.758 12.497-45.255 0l-316.784-316.784c-12.497-12.497-12.497-32.758 0-45.255l316.784-316.784c12.497-12.497 32.758-12.497 45.255 0l45.255 45.255c12.497 12.497 12.497 32.758 0 45.255l-248.902 248.902z",
fill: null
}
]
};
export const alert = {
id: "alert",
shapes: [
{
path: "M502.656 160c-123.712 0-224 100.288-224 224v0 128c-0.001 15.629-3.737 30.386-10.364 43.426l0.252-0.546-42.176 84.352c-1.502 2.947-2.382 6.427-2.382 10.112 0 12.513 10.143 22.656 22.656 22.656 0.005 0 0.010-0 0.015-0l511.999 0c0.004 0 0.009 0 0.014 0 12.513 0 22.656-10.143 22.656-22.656 0-3.685-0.88-7.165-2.441-10.241l0.059 0.129-42.176-84.288c-6.376-12.496-10.112-27.255-10.112-42.887 0-0.020 0-0.040 0-0.061l-0 0.003v-128c0-123.712-100.288-224-224-224v0zM502.656 64c176.731 0 320 143.269 320 320v0 128l42.112 84.288c7.896 15.458 12.523 33.717 12.523 53.056 0 65.524-53.112 118.644-118.634 118.656l-512.001 0c-65.523-0.012-118.635-53.132-118.635-118.656 0-19.34 4.627-37.598 12.834-53.73l-0.311 0.674 42.112-84.288v-128c0-176.731 143.269-320 320-320v0zM502.656 864c53.019 0 96-42.981 96-96v0h-192c0 53.019 42.981 96 96 96v0zM310.656 672h384v96c0 106.039-85.961 192-192 192s-192-85.961-192-192v0-96z",
fill: null
}
]
};
export const alertSuspended = {
id: "alert-suspended",
shapes: [
{
path: "M182.7 386.3l96 96V512a96 96 0 01-10.2 43l-42.1 84.2a22.7 22.7 0 0020.3 32.8h221.7l96 96H406.7A96 96 0 00594 797.6l71.7 71.8a191.9 191.9 0 01-355-101.4h-64a118.7 118.7 0 01-106.2-171.7l42.2-84.3V386.3zM109.3 86.6a32 32 0 0145.2 0L923.8 856a32 32 0 010 45.2l-22.6 22.6a32 32 0 01-45.2 0L86.6 154.5a32 32 0 010-45.2zM502.7 64a320 320 0 01320 320v128l42.1 84.3a118.1 118.1 0 0110.4 75.3L727.4 523.7a96 96 0 01-.7-11.7V384a224 224 0 00-334.2-195.1L323 119.2A318.5 318.5 0 01502.7 64z",
fill: null
}
]
};
export const trash = {
id: "trash",
shapes: [
{
path: "M320 256v-64c0-70.692 57.308-128 128-128v0h128c70.692 0 128 57.308 128 128v0 64h160c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-704c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h160zM832 448v480c0 17.673-14.327 32-32 32v0h-576c-17.673 0-32-14.327-32-32v0-480c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 416h448v-416c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0zM416 416h32c17.673 0 32 14.327 32 32v0 288c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-288c0-17.673 14.327-32 32-32v0zM576 416h32c17.673 0 32 14.327 32 32v0 288c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-288c0-17.673 14.327-32 32-32v0zM416 256h192v-64c0-17.673-14.327-32-32-32v0h-128c-17.673 0-32 14.327-32 32v0 64z",
fill: null
}
]
};
export const trash20 = {
id: "trash20",
shapes: [
{
path: "M281.6 883.2h460.8v-448c0-14.138 11.462-25.6 25.6-25.6h25.6c14.138 0 25.6 11.462 25.6 25.6v499.2c0 14.138-11.462 25.6-25.6 25.6h-563.2c-14.138 0-25.6-11.462-25.6-25.6v-499.2c0-14.138 11.462-25.6 25.6-25.6h25.6c14.138 0 25.6 11.462 25.6 25.6v448zM307.2 256v-89.6c0-56.554 45.846-102.4 102.4-102.4h204.8c56.554 0 102.4 45.846 102.4 102.4v89.6h128c14.138 0 25.6 11.462 25.6 25.6v25.6c0 14.138-11.462 25.6-25.6 25.6h-665.6c-14.138 0-25.6-11.462-25.6-25.6v-25.6c0-14.138 11.462-25.6 25.6-25.6h128zM435.2 140.8c-28.277 0-51.2 22.923-51.2 51.2v64h256v-64c0-28.277-22.923-51.2-51.2-51.2h-153.6zM422.153 409.6h25.6c14.138 0 25.6 11.462 25.6 25.6v345.6c0 14.138-11.462 25.6-25.6 25.6h-25.6c-14.138 0-25.6-11.462-25.6-25.6v-345.6c0-14.138 11.462-25.6 25.6-25.6zM575.753 409.6h25.6c14.138 0 25.6 11.462 25.6 25.6v345.6c0 14.138-11.462 25.6-25.6 25.6h-25.6c-14.138 0-25.6-11.462-25.6-25.6v-345.6c0-14.138 11.462-25.6 25.6-25.6z",
fill: null
}
]
};
export const lock = {
id: "lock",
shapes: [
{
path: "M224 448v416h576v-416h-576zM256 352v-96c0-106.039 85.961-192 192-192v0h128c106.039 0 192 85.961 192 192v0 96h96c17.673 0 32 14.327 32 32v0 544c0 17.673-14.327 32-32 32v0h-704c-17.673 0-32-14.327-32-32v0-544c0-17.673 14.327-32 32-32v0h96zM352 352h320v-96c0-53.019-42.981-96-96-96v0h-128c-53.019 0-96 42.981-96 96v0 96zM480 560h64c17.673 0 32 14.327 32 32v0 96c0 17.673-14.327 32-32 32v0h-64c-17.673 0-32-14.327-32-32v0-96c0-17.673 14.327-32 32-32v0z",
fill: null
}
]
};
export const warningOutline = {
id: "warningOutline",
shapes: [
{
path: "M612.16 70.592c-41.216-82.56-159.040-82.56-200.32 0l-392.448 784.896c-7.463 14.599-11.836 31.845-11.836 50.112 0 61.855 50.142 111.998 111.996 112l784.896 0c61.854-0.002 111.996-50.145 111.996-112 0-18.267-4.373-35.513-12.13-50.748l0.294 0.636-392.448-784.896zM497.728 113.536c2.688-5.278 8.081-8.831 14.304-8.831s11.616 3.553 14.262 8.74l0.042 0.091 392.448 784.896c1.069 2.088 1.695 4.555 1.695 7.168 0 8.837-7.163 16-16 16-0.011 0-0.022-0-0.033-0l0.002 0h-784.896c-8.823-0.019-15.967-7.175-15.967-16 0-2.613 0.626-5.080 1.737-7.259l-0.042 0.091 392.448-784.896zM464 384c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 224c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-224zM464 768c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-32z",
fill: null
}
]
};
export const warning = {
id: "warning",
shapes: [
{
path: "M612.16 70.592c-41.216-82.56-159.040-82.56-200.32 0l-392.448 784.896c-7.463 14.599-11.836 31.845-11.836 50.112 0 61.855 50.142 111.998 111.996 112l784.896 0c61.854-0.002 111.996-50.145 111.996-112 0-18.267-4.373-35.513-12.13-50.748l0.294 0.636-392.448-784.896zM464 384c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 224c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-224zM464 768c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-32z",
fill: null
}
]
};
export const close = {
id: "close",
shapes: [
{
path: "M602.496 512l226.304 226.304c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-45.248 45.248c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-226.304-226.304-226.304 226.304c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-45.248-45.248c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l226.304-226.304-226.304-226.304c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l45.248-45.248c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l226.304 226.304 226.304-226.304c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l45.248 45.248c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-226.304 226.304z",
fill: null
}
]
};
export const arrowBack = {
id: "arrowBack",
shapes: [
{
path: "M321.28 575.744l184.96 185.024c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-45.248 45.248c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-316.8-316.8c-5.77-5.787-9.337-13.773-9.337-22.592s3.567-16.805 9.338-22.593l-0.001 0.001 316.8-316.8c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l45.248 45.248c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-184.768 184.768h590.464c17.673 0 32 14.327 32 32v0 64c0 17.673-14.327 32-32 32v0h-590.656z",
fill: null
}
]
};
export const arrowForward = {
id: "arrowForward",
shapes: [
{
path: "M712.32 448l-185.024-184.96c-5.808-5.794-9.401-13.805-9.401-22.656s3.593-16.862 9.401-22.655l0.001-0.001 45.248-45.248c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l316.8 316.8c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-316.8 316.8c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l0 0-45.248-45.312c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l184.768-184.768h-590.464c-17.673 0-32-14.327-32-32v0-64c0-17.673 14.327-32 32-32v0h590.72z",
fill: null
}
]
};
export const arrowUpward = {
id: "arrowUpward",
shapes: [
{
path: "M452.864 316.352l-184.96 185.024c-5.794 5.808-13.805 9.401-22.656 9.401s-16.862-3.593-22.655-9.401l-0.001-0.001-45.248-45.248c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l316.8-316.8c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l316.8 316.8c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-45.248 45.248c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-184.832-184.768v590.464c0 17.673-14.327 32-32 32v0h-64c-17.673 0-32-14.327-32-32v0-590.72z",
fill: null
}
]
};
export const arrowDownward = {
id: "arrowDownward",
shapes: [
{
path: "M580.672 707.392l184.96-184.96c5.794-5.808 13.805-9.401 22.656-9.401s16.862 3.593 22.655 9.401l0.001 0.001 45.248 45.184c5.808 5.794 9.401 13.805 9.401 22.656s-3.593 16.862-9.401 22.655l-0.001 0.001-316.8 316.8c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-316.8-316.8c-5.808-5.794-9.401-13.805-9.401-22.656s3.593-16.862 9.401-22.655l0.001-0.001 45.248-45.248c5.794-5.808 13.805-9.401 22.656-9.401s16.862 3.593 22.655 9.401l0.001 0.001 184.768 184.832v-590.464c0-17.673 14.327-32 32-32v0h64c17.673 0 32 14.327 32 32v0 590.72z",
fill: null
}
]
};
export const arrowLeft = {
id: "arrowLeft",
shapes: [
{
path: "M427.008 512l248.896 248.96c5.77 5.787 9.337 13.773 9.337 22.592s-3.567 16.805-9.338 22.593l0.001-0.001-45.248 45.248c-5.794 5.808-13.805 9.401-22.656 9.401s-16.862-3.593-22.655-9.401l-0.001-0.001-316.8-316.8c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l316.8-316.8c5.794-5.808 13.805-9.401 22.656-9.401s16.862 3.593 22.655 9.401l0.001 0.001 45.248 45.312c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-249.024 248.896z",
fill: null
}
]
};
export const arrowRight = {
id: "arrowRight",
shapes: [
{
path: "M596.992 512l-248.832-248.96c-5.77-5.787-9.337-13.773-9.337-22.592s3.567-16.805 9.338-22.593l-0.001 0.001 45.248-45.248c5.794-5.808 13.805-9.401 22.656-9.401s16.862 3.593 22.655 9.401l0.001 0.001 316.8 316.8c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-316.8 316.8c-5.794 5.808-13.805 9.401-22.656 9.401s-16.862-3.593-22.655-9.401l-0.001-0.001-45.248-45.312c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l248.96-248.896z",
fill: null
}
]
};
export const arrowUp = {
id: "arrowUp",
shapes: [
{
path: "M512 427.008l-248.96 248.832c-5.787 5.77-13.773 9.337-22.592 9.337s-16.805-3.567-22.593-9.338l0.001 0.001-45.248-45.248c-5.808-5.794-9.401-13.805-9.401-22.656s3.593-16.862 9.401-22.655l0.001-0.001 316.8-316.8c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l316.8 316.8c5.808 5.794 9.401 13.805 9.401 22.656s-3.593 16.862-9.401 22.655l-0.001 0.001-45.312 45.248c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-248.896-248.96z",
fill: null
}
]
};
export const arrowDown = {
id: "arrowDown",
shapes: [
{
path: "M512 596.992l248.96-248.896c5.787-5.77 13.773-9.337 22.592-9.337s16.805 3.567 22.593 9.338l-0.001-0.001 45.248 45.248c5.808 5.794 9.401 13.805 9.401 22.656s-3.593 16.862-9.401 22.655l-0.001 0.001-316.8 316.8c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-316.8-316.8c-5.808-5.794-9.401-13.805-9.401-22.656s3.593-16.862 9.401-22.655l0.001-0.001 45.312-45.248c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l248.896 249.024z",
fill: null
}
]
};
export const home = {
id: "home",
shapes: [
{
path: "M160 404.416v459.584h192v-192c0-70.692 57.308-128 128-128v0h64c70.692 0 128 57.308 128 128v0 192h192v-459.584l-352-226.304-352 226.368zM78.72 342.528l416-267.392c4.885-3.177 10.862-5.067 17.28-5.067s12.395 1.889 17.404 5.142l-0.124-0.076 416 267.392c8.909 5.78 14.72 15.678 14.72 26.933 0 0.004-0 0.008-0 0.011l0-0.001v558.528c0 17.673-14.327 32-32 32v0h-320c-17.673 0-32-14.327-32-32v0-256c0-17.673-14.327-32-32-32v0h-64c-17.673 0-32 14.327-32 32v0 256c0 17.673-14.327 32-32 32v0h-320c-17.673 0-32-14.327-32-32v0-558.528c0.019-11.235 5.825-21.109 14.596-26.804l0.124-0.076z",
fill: null
}
]
};
export const home20 = {
id: "home20",
shapes: [
{
path: "M512 158.362l-371.2 265.165v459.674h217.6v-243.2c0-56.554 45.846-102.4 102.4-102.4v0h102.4c56.554 0 102.4 45.846 102.4 102.4v0 243.2h217.6v-459.674l-371.2-265.165zM526.848 74.65l422.4 301.67c6.537 4.696 10.747 12.275 10.752 20.838l0 0.001v537.242c0 14.138-11.462 25.6-25.6 25.6v0h-320c-14.138 0-25.6-11.462-25.6-25.6v0-294.4c0-14.138-11.462-25.6-25.6-25.6v0h-102.4c-14.138 0-25.6 11.462-25.6 25.6v0 294.4c0 14.138-11.462 25.6-25.6 25.6v0h-320c-14.138 0-25.6-11.462-25.6-25.6v0-537.242c0.005-8.563 4.215-16.143 10.676-20.786l0.076-0.052 422.4-301.67c4.125-2.968 9.279-4.746 14.848-4.746s10.723 1.778 14.924 4.798l-0.076-0.052z",
fill: null
}
]
};
export const tracks = {
id: "tracks",
shapes: [
{
path: "M448 128c-0.016-0-0.035-0-0.054-0-212.077 0-384 171.923-384 384 0 70.692 19.103 136.923 52.427 193.812l-0.981-1.812h117.952c-45.51-50.716-73.337-118.108-73.337-192 0-159.056 128.938-287.996 287.993-288l480-0c17.673 0 32-14.327 32-32v0-32c0-17.673-14.327-32-32-32v0h-480zM790.656 320c45.51 50.716 73.337 118.108 73.337 192 0 159.056-128.938 287.996-287.993 288l-480 0c-17.673 0-32 14.327-32 32v0 32c0 17.673 14.327 32 32 32v0h480c0.016 0 0.035 0 0.054 0 212.077 0 384-171.923 384-384 0-70.692-19.103-136.923-52.427-193.812l0.981 1.812h-117.952zM576 320c106.039 0 192 85.961 192 192s-85.961 192-192 192v0h-128c-106.039 0-192-85.961-192-192s85.961-192 192-192v0h128zM448 416c-53.019 0-96 42.981-96 96s42.981 96 96 96v0h128c53.019 0 96-42.981 96-96s-42.981-96-96-96v0h-128z",
fill: null
}
]
};
export const results = {
id: "results",
shapes: [
{
path: "M512 64c159.058 0 288 128.942 288 288 0 142.684-103.761 261.134-239.944 284.009l-0.056 291.991c0 17.673-14.327 32-32 32h-32c-17.673 0-32-14.327-32-32l0.008-291.981c-136.214-22.848-240.008-141.313-240.008-284.019 0-159.058 128.942-288 288-288zM512 172c-99.411 0-180 80.589-180 180s80.589 180 180 180c99.411 0 180-80.589 180-180s-80.589-180-180-180z",
fill: null
}
]
};
export const tracks20 = {
id: "tracks20",
shapes: [
{
path: "M64 512c0-226.216 183.384-409.6 409.6-409.6v0h460.8c14.138 0 25.6 11.462 25.6 25.6v0 25.6c0 14.138-11.462 25.6-25.6 25.6v0h-460.8c-0.010-0-0.023-0-0.035-0-183.8 0-332.8 149-332.8 332.8 0 102.693 46.513 194.522 119.621 255.57l0.53 0.43h-107.059c-55.974-69.243-89.856-158.359-89.856-255.389 0-0.215 0-0.43 0-0.645l-0 0.034zM537.6 256h-64c-141.385 0-256 114.615-256 256s114.615 256 256 256v0h76.8c141.385 0 256-114.615 256-256s-114.615-256-256-256v0h-12.8zM763.085 256c73.637 61.477 120.15 153.307 120.15 256 0 183.8-149 332.8-332.8 332.8-0.012 0-0.025-0-0.037-0l-460.798 0c-14.138 0-25.6 11.462-25.6 25.6v0 25.6c0 14.138 11.462 25.6 25.6 25.6v0h460.8c226.216 0 409.6-183.384 409.6-409.6 0-97.228-33.877-186.544-90.47-256.788l0.614 0.788h-107.059zM294.4 512c0-98.969 80.231-179.2 179.2-179.2v0h76.8c98.969 0 179.2 80.231 179.2 179.2s-80.231 179.2-179.2 179.2v0h-76.8c-98.969 0-179.2-80.231-179.2-179.2v0z",
fill: null
}
]
};
export const cup = {
id: "cup",
shapes: [
{
path: "M232.064 576h-40.064c-70.692 0-128-57.308-128-128v0-224c0-17.673 14.327-32 32-32v0h128v-96c0-17.673 14.327-32 32-32v0h512c17.673 0 32 14.327 32 32v0 96h128c17.673 0 32 14.327 32 32v0 224c0 70.692-57.308 128-128 128v0h-40.064c-28.108 106.091-119.976 184.254-231.18 191.449l-0.756 0.039v96.512h112c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-320c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h112v-96.512c-111.96-7.234-203.829-85.398-231.532-189.7l-0.404-1.788zM800 288v192h32c17.673 0 32-14.327 32-32v0-160h-64zM160 288v160c0 17.673 14.327 32 32 32v0h32v-192h-64zM320 160v352c0 88.366 71.634 160 160 160v0h64c88.366 0 160-71.634 160-160v0-352h-384z",
fill: null
}
]
};
export const more = {
id: "more",
shapes: [
{
path: "M96 256h832c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-832c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0zM96 496h832c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-832c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0zM96 736h832c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-832c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0z",
fill: null
}
]
};
export const more20 = {
id: "more20",
shapes: [
{
path: "M85.35 192h853.299c11.776 0 21.35 9.574 21.35 21.35v34.099c0 11.776-9.574 21.35-21.35 21.35h-853.299c-11.792 0-21.35-9.559-21.35-21.35h0v-34.099c0-11.776 9.574-21.35 21.35-21.35zM85.35 473.6h853.299c11.776 0 21.35 9.574 21.35 21.35v34.099c0 11.776-9.574 21.35-21.35 21.35h-853.299c-11.792 0-21.35-9.559-21.35-21.35l0 0v-34.099c0-11.776 9.574-21.35 21.35-21.35zM85.35 755.2h853.299c11.776 0 21.35 9.574 21.35 21.35v34.099c0 11.776-9.574 21.35-21.35 21.35h-853.299c-11.792 0-21.35-9.559-21.35-21.35l0 0v-34.099c0-11.776 9.574-21.35 21.35-21.35z",
fill: null
}
]
};
export const exclamationOutline = {
id: "exclamationOutline",
shapes: [
{
path: "M512 1024c-282.77 0-512-229.23-512-512s229.23-512 512-512v0c282.77 0 512 229.23 512 512s-229.23 512-512 512v0zM512 928c229.75 0 416-186.25 416-416s-186.25-416-416-416v0c-229.75 0-416 186.25-416 416s186.25 416 416 416v0zM496 256h32c17.673 0 32 14.327 32 32v0 272c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-272c0-17.673 14.327-32 32-32v0zM496 672h32c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0z",
fill: null
}
]
};
export const exclamation = {
id: "exclamation",
shapes: [
{
path: "M512 1024c-282.77 0-512-229.23-512-512s229.23-512 512-512v0c282.77 0 512 229.23 512 512s-229.23 512-512 512v0zM496 256c-17.673 0-32 14.327-32 32v0 272c0 17.673 14.327 32 32 32v0h32c17.673 0 32-14.327 32-32v0-272c0-17.673-14.327-32-32-32v0h-32zM496 672c-17.673 0-32 14.327-32 32v0 32c0 17.673 14.327 32 32 32v0h32c17.673 0 32-14.327 32-32v0-32c0-17.673-14.327-32-32-32v0h-32z",
fill: null
}
]
};
export const changes = {
id: "changes",
shapes: [
{
path: "M432.804 43.536c43.739-43.739 114.653-43.739 158.392 0l389.27 389.27c43.734 43.738 43.734 114.653 0 158.392l-389.27 389.27c-43.739 43.742-114.653 43.742-158.392 0l-389.27-389.27c-43.739-43.739-43.739-114.654 0-158.392l389.27-389.27zm90.51 67.882c-6.249-6.248-16.379-6.248-22.628 0l-389.27 389.27c-6.248 6.248-6.248 16.379 0 22.627l389.27 389.27c6.249 6.249 16.379 6.249 22.628 0l389.27-389.27c6.248-6.248 6.248-16.379 0-22.627l-389.27-389.27zM560 288.001v288h-96v-288h96zm0 352v96h-96v-96h96z",
fill: null
}
]
};
export const infoOutline = {
id: "infoOutline",
shapes: [
{
path: "M512 0c282.77 0 512 229.23 512 512s-229.23 512-512 512v0c-282.77 0-512-229.23-512-512s229.23-512 512-512v0zM512 96c-229.75 0-416 186.25-416 416s186.25 416 416 416v0c229.75 0 416-186.25 416-416s-186.25-416-416-416v0zM528 768h-32c-17.673 0-32-14.327-32-32v0-272c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 272c0 17.673-14.327 32-32 32v0zM528 352h-32c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0z",
fill: null
}
]
};
export const info = {
id: "info",
shapes: [
{
path: "M512 0c282.77 0 512 229.23 512 512s-229.23 512-512 512v0c-282.77 0-512-229.23-512-512s229.23-512 512-512v0zM528 768c17.673 0 32-14.327 32-32v0-272c0-17.673-14.327-32-32-32v0h-32c-17.673 0-32 14.327-32 32v0 272c0 17.673 14.327 32 32 32v0h32zM528 352c17.673 0 32-14.327 32-32v0-32c0-17.673-14.327-32-32-32v0h-32c-17.673 0-32 14.327-32 32v0 32c0 17.673 14.327 32 32 32v0h32z",
fill: null
}
]
};
export const bets = {
id: "bets",
shapes: [
{
path: "M224 160v684.622l24.998-16.665c42.996-28.664 99.008-28.664 142.004 0L416 844.622l24.998-16.665c42.996-28.664 99.009-28.664 142.004 0L608 844.622l24.998-16.665c42.995-28.664 99.009-28.664 142.004 0L800 844.622V160H224zm288-96h352c17.673 0 32 14.327 32 32v782.874a32 32 0 01-14.25 26.626l-64 42.666a31.998 31.998 0 01-35.5 0l-60.5-40.332a31.998 31.998 0 00-35.5 0l-60.5 40.332a31.998 31.998 0 01-35.5 0l-60.5-40.332a31.998 31.998 0 00-35.5 0l-60.5 40.332a31.998 31.998 0 01-35.5 0l-60.5-40.332a31.998 31.998 0 00-35.5 0l-60.5 40.332a31.998 31.998 0 01-35.5 0l-64-42.666A32 32 0 01128 878.874V96c0-17.673 14.327-32 32-32h352zM352 480h320c17.673 0 32 14.327 32 32v32c0 17.673-14.327 32-32 32H352c-17.673 0-32-14.327-32-32v-32c0-17.673 14.327-32 32-32zm0-192h128c17.673 0 32 14.327 32 32v32c0 17.673-14.327 32-32 32H352c-17.673 0-32-14.327-32-32v-32c0-17.673 14.327-32 32-32z",
fill: null
}
]
};
export const betsSuccess = {
id: "betsSuccess",
shapes: [
{
path: "M128 176c0-61.856 50.144-112 112-112h544c61.856 0 112 50.144 112 112v336h-96V176c0-8.837-7.163-16-16-16H240c-8.837 0-16 7.163-16 16v678.139l76.505-34.002a48.001 48.001 0 0146.121 3.925L416 870.311l69.374-46.249 53.252 79.876-96 64a48 48 0 01-53.252 0l-74.019-49.346-119.86 53.271A48.001 48.001 0 01128 928V176zm384 240H320v-96h192v96zm64 192H320v-96h256v96zm449.94 65.941l-255.999 256c-18.745 18.745-49.137 18.745-67.882 0l-128-128 67.882-67.882L736 828.118l222.059-222.059 67.881 67.882z",
fill: null
}
]
};
export const betsRefund = {
id: "betsRefund",
shapes: [
{
path: "M128 176c0-61.856 50.144-112 112-112h544c61.856 0 112 50.144 112 112v334.23h-96V176c0-8.837-7.163-16-16-16H240c-8.837 0-16 7.163-16 16v678.139l76.505-34.002a48.001 48.001 0 0146.121 3.925L416 870.311l69.374-46.249 53.252 79.876-96 64a48 48 0 01-53.252 0l-74.019-49.346-119.86 53.271A48.001 48.001 0 01128 928V176zm384 240H320v-96h192v96zm64 192H320v-96h256v96zm163.882 208l78.059 78.059-67.882 67.882-160-160c-18.745-18.745-18.745-49.137 0-67.882l160-160 67.882 67.882L739.882 720H976v96H739.882z",
fill: null
}
]
};
export const betsCancel = {
id: "betsCancel",
shapes: [
{
path: "M128 176c0-61.856 50.144-112 112-112h544c61.856 0 112 50.144 112 112v336h-96V176c0-8.837-7.163-16-16-16H240c-8.837 0-16 7.163-16 16v678.139l76.505-34.002a48.001 48.001 0 0146.121 3.925L416 870.311l69.374-46.249 53.252 79.876-96 64a48 48 0 01-53.252 0l-74.019-49.346-119.86 53.271A48.001 48.001 0 01128 928V176zm384 240H320v-96h192v96zm64 192H320v-96h256v96zm188.118 160L638.059 641.941l67.882-67.882L832 700.118l126.059-126.059 67.881 67.882L899.882 768l126.058 126.059-67.881 67.882L832 835.882 705.941 961.941l-67.882-67.882L764.118 768z",
fill: null
}
]
};
export const bets20 = {
id: "bets20",
shapes: [
{
path: "M204.8 140.8v714.086l19.2 12.8 39.219-26.112c15.957-10.765 35.619-17.184 56.781-17.184s40.824 6.419 57.146 17.416l-0.365-0.232 39.219 26.112 39.219-26.112c15.957-10.765 35.619-17.184 56.781-17.184s40.824 6.419 57.146 17.416l-0.365-0.232 39.219 26.112 39.219-26.112c15.957-10.765 35.619-17.184 56.781-17.184s40.824 6.419 57.146 17.416l-0.365-0.232 39.219 26.112 19.2-12.8v-714.086h-614.4zM204.8 881.766v0zM819.2 881.766v0zM512 64h358.4c14.138 0 25.6 11.462 25.6 25.6v0 792.678c-0.005 8.849-4.498 16.647-11.326 21.241l-0.092 0.058-70.4 46.95c-3.987 2.686-8.897 4.288-14.182 4.288s-10.196-1.601-14.274-4.346l0.091 0.058-67.584-45.056c-3.992-2.697-8.912-4.305-14.208-4.305s-10.216 1.608-14.299 4.362l0.091-0.058-67.584 45.056c-3.992 2.697-8.912 4.305-14.208 4.305s-10.216-1.608-14.299-4.362l0.091 0.058-67.584-45.056c-3.992-2.697-8.912-4.305-14.208-4.305s-10.216 1.608-14.299 4.362l0.091-0.058-67.584 45.056c-3.992 2.697-8.912 4.305-14.208 4.305s-10.216-1.608-14.299-4.362l0.091 0.058-67.584-45.056c-3.992-2.697-8.912-4.305-14.208-4.305s-10.216 1.608-14.299 4.362l0.091-0.058-67.584 45.056c-3.992 2.697-8.912 4.305-14.208 4.305s-10.216-1.608-14.299-4.362l0.091 0.058-70.4-46.95c-6.92-4.653-11.413-12.451-11.418-21.298l-0-0.001v-792.678c0-14.138 11.462-25.6 25.6-25.6v0h358.4zM345.6 489.626c-14.138 0-25.6 11.462-25.6 25.6v0 25.6c0 14.138 11.462 25.6 25.6 25.6v0h332.8c14.138 0 25.6-11.462 25.6-25.6v0-25.6c0-14.138-11.462-25.6-25.6-25.6v0h-332.8zM345.6 297.626c-14.138 0-25.6 11.462-25.6 25.6v0 25.6c0 14.138 11.462 25.6 25.6 25.6v0h140.8c14.138 0 25.6-11.462 25.6-25.6v0-25.6c0-14.138-11.462-25.6-25.6-25.6v0h-140.8z",
fill: null
}
]
};
export const starOutline = {
id: " ",
shapes: [
{
path: "M335.62 812.62L512 715.53l176.37 97.09-33.82-206.45 147.99-151.03-204.05-31.05-86.5-183.49-86.48 183.5-204.05 31.04 147.98 151.03-33.82 206.45zM512 825.12L266.62 960.18a32 32 0 0 1-43.47-12.6 32 32 0 0 1-3.54-20.6l47.23-288.35L65.42 433.06a32 32 0 0 1 .46-45.25 32 32 0 0 1 17.59-8.78l277.01-42.15L483.05 76.85a32 32 0 0 1 42.6-15.3 32 32 0 0 1 15.3 15.3L663.5 336.88l277.02 42.15a32 32 0 0 1 26.82 36.45 32 32 0 0 1-8.78 17.58L757.15 638.63l47.24 288.35a32 32 0 0 1-26.41 36.75 32 32 0 0 1-20.6-3.54L512 825.12z",
fill: null
}
]
};
export const starOutlineFill = {
id: "starOutlineFill",
shapes: [
{
path: "M511.994 853.936l-189.611 104.372c-41.055 22.598-92.657 7.637-115.255-33.418-9.163-16.646-12.474-35.885-9.402-54.636l37.12-226.602-157.985-161.239c-32.799-33.473-32.251-87.198 1.223-119.995 12.715-12.458 29.025-20.603 46.624-23.28l215.049-32.718 95.483-202.567c19.982-42.39 70.545-60.557 112.935-40.575 17.826 8.403 32.172 22.749 40.575 40.575l95.483 202.567 215.051 32.718c46.33 7.049 78.175 50.321 71.126 96.651-2.678 17.599-10.822 33.909-23.281 46.624l-157.985 161.239 37.12 226.602c7.576 46.247-23.774 89.879-70.021 97.456-18.751 3.071-37.99-0.24-54.636-9.402l-189.611-104.372z",
fill: null,
strokeWidth: 102,
strokeColor: "#333333"
}
]
};
export const star = {
id: "star",
shapes: [
{
path: "M512 825.12L266.62 960.18a32 32 0 0 1-43.47-12.6 32 32 0 0 1-3.54-20.6l47.23-288.35L65.42 433.06a32 32 0 0 1 .46-45.25 32 32 0 0 1 17.59-8.78l277.01-42.15L483.05 76.85a32 32 0 0 1 42.6-15.3 32 32 0 0 1 15.3 15.3L663.5 336.88l277.02 42.15a32 32 0 0 1 26.82 36.45 32 32 0 0 1-8.78 17.58L757.15 638.63l47.24 288.35a32 32 0 0 1-26.41 36.75 32 32 0 0 1-20.6-3.54L512 825.12z",
fill: null
}
]
};
export const key = {
id: "key",
shapes: [
{
path: "M461.76 471.424l300.736-300.672c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l45.248 45.248c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-36.224 36.224 68.736 68.672c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-45.312 45.312c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l0 0-68.672-68.736-174.016 174.016c16.763 30.651 26.622 67.148 26.622 105.947 0 123.782-100.346 224.128-224.128 224.128-61.627 0-117.444-24.873-157.962-65.127l0.012 0.012c-40.669-40.558-65.831-96.648-65.831-158.615 0-123.712 100.288-224 224-224 39.139 0 75.933 10.038 107.948 27.679l-1.157-0.584zM423.040 736.384c18.822-17.574 30.555-42.534 30.555-70.235 0-53.019-42.981-96-96-96-27.701 0-52.661 11.732-70.183 30.499l-0.052 0.056c-15.964 17.097-25.765 40.127-25.765 65.445 0 53.019 42.981 96 96 96 25.319 0 48.348-9.801 65.501-25.817l-0.056 0.052z",
fill: null
}
]
};
export const successOutline = {
id: "successOutline",
shapes: [
{
path: "M512 1024c-282.77 0-512-229.23-512-512s229.23-512 512-512v0c282.77 0 512 229.23 512 512s-229.23 512-512 512v0zM512 928c229.75 0 416-186.25 416-416s-186.25-416-416-416v0c-229.75 0-416 186.25-416 416s186.25 416 416 416v0zM417.152 599.296l271.552-271.552c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l22.656 22.656c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-316.8 316.8c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-135.744-135.808c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l22.592-22.592c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l90.496 90.496z",
fill: null
}
]
};
export const success = {
id: "success",
shapes: [
{
path: "M512 1024c-282.77 0-512-229.23-512-512s229.23-512 512-512v0c282.77 0 512 229.23 512 512s-229.23 512-512 512v0zM417.152 599.296l-90.496-90.496c-5.791-5.789-13.789-9.369-22.624-9.369s-16.833 3.58-22.624 9.369l-22.592 22.592c-5.789 5.791-9.369 13.789-9.369 22.624s3.58 16.833 9.369 22.624l135.68 135.808c5.794 5.808 13.805 9.401 22.656 9.401s16.862-3.593 22.655-9.401l0.001-0.001 316.8-316.8c5.789-5.791 9.369-13.789 9.369-22.624s-3.58-16.833-9.369-22.624l-22.656-22.656c-5.791-5.789-13.789-9.369-22.624-9.369s-16.833 3.58-22.624 9.369l-271.552 271.552z",
fill: null
}
]
};
export const errorOutline = {
id: "errorOutline",
shapes: [
{
path: "M512 1024c-282.77 0-512-229.23-512-512s229.23-512 512-512v0c282.77 0 512 229.23 512 512s-229.23 512-512 512v0zM512 928c229.75 0 416-186.25 416-416s-186.25-416-416-416v0c-229.75 0-416 186.25-416 416s186.25 416 416 416v0zM579.84 512l147.136 147.072c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-22.656 22.656c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-147.072-147.136-147.072 147.072c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-22.656-22.656c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l-0 0 147.136-147.008-147.136-147.072c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l22.656-22.656c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l147.072 147.136 147.072-147.072c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l22.656 22.656c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l0-0-147.136 147.008z",
fill: null
}
]
};
export const error = {
id: "error",
shapes: [
{
path: "M512 1024c-282.77 0-512-229.23-512-512s229.23-512 512-512v0c282.77 0 512 229.23 512 512s-229.23 512-512 512v0zM579.84 512l147.136-147.072c5.789-5.791 9.369-13.789 9.369-22.624s-3.58-16.833-9.369-22.624l-22.656-22.656c-5.791-5.789-13.789-9.369-22.624-9.369s-16.833 3.58-22.624 9.369l-147.072 147.136-147.072-147.136c-5.791-5.789-13.789-9.369-22.624-9.369s-16.833 3.58-22.624 9.369l-22.656 22.656c-5.789 5.791-9.369 13.789-9.369 22.624s3.58 16.833 9.369 22.624l147.136 147.072-147.072 147.072c-5.789 5.791-9.369 13.789-9.369 22.624s3.58 16.833 9.369 22.624l22.656 22.656c5.791 5.789 13.789 9.369 22.624 9.369s16.833-3.58 22.624-9.369l-0 0 147.008-147.136 147.072 147.072c5.791 5.789 13.789 9.369 22.624 9.369s16.833-3.58 22.624-9.369l22.656-22.656c5.789-5.791 9.369-13.789 9.369-22.624s-3.58-16.833-9.369-22.624l0 0-147.136-147.008z",
fill: null
}
]
};
export const selectFavorite = {
id: "selectFavorite",
shapes: [
{
path: "M435.2 422.4l-135.424 71.194 25.856-150.784-109.568-106.803 151.424-22.016L435.2 76.8l67.712 137.19 151.424 22.016-109.568 106.803 25.856 150.784z",
fill: "#CFDAE2",
fillRule: "evenodd"
},
{
path: "M600.269 460.8a44.8 44.8 0 0 0-45.005 44.8v268.8l-30.003-59.725c-24.576-45.414-48.768-40.704-67.533-29.875-21.709 14.413-29.798 29.286-15.002 67.2 34.048 83.226 86.349 182.4 142.541 246.4h202.573c71.168-52.48 128.461-302.131 30.003-313.6-9.037 0-23.501 1.434-30.003 7.475 0-29.875-26.189-37.53-37.53-37.35-12.979.23-22.502 7.475-30.003 22.4 0-29.85-24.474-37.325-37.504-37.325-14.336 0-30.976 8.909-37.53 22.4V505.6c0-24.832-20.07-44.8-45.005-44.8z",
fill: "#93AFCD",
fillRule: "nonzero"
}
]
};
export const locationPin = {
id: "locationPin",
shapes: [
{
path: "M788.058 262.144l-436.525 180.706 139.324 46.441c36.058 12.271 63.926 40.139 75.946 75.349l0.252 0.848 45.116 135.349 175.887-438.694zM578.379 885.218l-97.039-291.177c-3.069-9.005-10.029-15.966-18.822-18.971l-0.212-0.063-292.503-97.461c-12.094-4.096-20.644-15.344-20.644-28.589 0-12.5 7.615-23.221 18.458-27.778l0.198-0.074 717.884-297.201c3.417-1.46 7.392-2.31 11.566-2.31 16.634 0 30.118 13.484 30.118 30.118 0 4.044-0.797 7.902-2.243 11.425l0.073-0.201-290.334 723.968c-4.578 11.158-15.358 18.873-27.94 18.873-13.214 0-24.44-8.51-28.498-20.348l-0.063-0.212z",
fill: null
}
]
};
export const wifi = {
id: "wifi",
shapes: [
{
path: "M391.872 188.16l-78.976-78.848c63.68-19.264 130.624-29.312 199.104-29.312 170.624 0 331.712 62.4 456.704 173.44 9.92 8.835 16.138 21.644 16.138 35.904 0 26.515-21.495 48.010-48.010 48.010-12.254 0-23.437-4.591-31.92-12.148l0.048 0.042c-103.665-92.632-241.225-149.249-392.009-149.249-0.335 0-0.669 0-1.004 0.001l0.053-0c-40.896 0-81.088 4.16-120.128 12.16zM120.32 324.096c-8.694 8.678-20.696 14.045-33.952 14.045-26.543 0-48.061-21.517-48.061-48.061 0-13.288 5.392-25.316 14.108-34.015l0.001-0.001 67.904 67.968zM672.192 468.672l-131.648-131.776c120.567 7.52 227.56 60.148 305.394 141.036l0.142 0.148c8.909 8.722 14.433 20.871 14.433 34.311 0 26.51-21.49 48-48 48-14.076 0-26.738-6.059-35.518-15.712l-0.035-0.039c-29.534-30.644-64.181-56.108-102.61-75.070l-2.158-0.962zM297.28 501.056c-17.997 13.056-33.846 26.773-48.441 41.719l-0.071 0.073c-8.726 8.92-20.885 14.45-34.336 14.45-26.52 0-48.018-21.499-48.018-48.018 0-13.069 5.221-24.919 13.691-33.577l-0.009 0.009c15.296-15.616 31.552-30.080 48.64-43.2l68.544 68.544zM486.144 689.92c-43.776 6.4-83.2 29.12-111.168 63.552-8.863 11.411-22.586 18.684-38.008 18.684-26.51 0-48-21.49-48-48 0-11.866 4.306-22.726 11.44-31.104l-0.056 0.068c28.474-35.043 64.853-62.567 106.494-80.036l1.794-0.668 77.504 77.504zM512 944c-26.51 0-48-21.49-48-48s21.49-48 48-48v0c26.51 0 48 21.49 48 48s-21.49 48-48 48v0zM855.936 923.84l-769.28-769.28c-5.808-5.794-9.401-13.805-9.401-22.656s3.593-16.862 9.401-22.655l0.001-0.001 22.592-22.592c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l769.344 769.28c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-22.656 22.656c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l0 0z",
fill: null
}
]
};
export const quickDeposit = {
id: "deposit",
shapes: [
{
path: "M816 0c-17.673 0-32 14.327-32 32v0 112h-112c-17.673 0-32 14.327-32 32v0 32c0 17.673 14.327 32 32 32v0h112v112c0 17.673 14.327 32 32 32v0h32c17.673 0 32-14.327 32-32v0-112h112c17.673 0 32-14.327 32-32v0-32c0-17.673-14.327-32-32-32v0h-112v-112c0-17.673-14.327-32-32-32v0h-32zM512 64c-0.415 17.756-14.361 32.125-31.903 33.211l-0.097 0.005c-215.554 17.141-383.982 196.284-383.982 414.766 0 229.75 186.25 416 416 416 218.482 0 397.626-168.428 414.673-382.525l0.093-1.457c1.091-17.639 15.46-31.585 33.176-31.999l0.040-0.001h32c17.664 0 32.128 14.336 31.040 32-17.36 268.64-239.5 479.956-510.996 479.956-282.77 0-512-229.23-512-512 0-271.496 211.316-493.637 478.445-510.918l1.511-0.078c17.664-1.088 32 13.376 32 31.040v32zM496 224c-17.673 0-32 14.327-32 32v0 19.328c-64.64 13.76-114.304 57.088-120.192 124.16-3.2 35.968 4.352 75.776 34.944 107.52 29.44 30.656 73.472 46.592 127.68 51.392 41.92 3.712 59.712 14.784 66.944 22.272 6.144 6.4 9.984 15.808 8.512 32.64-1.472 16.448-19.52 46.4-83.904 40.704-26.88-2.368-47.424-12.608-60.16-24.192-6.592-5.952-16.448-8.448-24-3.84l-54.592 33.344c-7.552 4.608-9.984 14.528-4.608 21.568 25.6 32.96 65.216 55.68 109.376 64.96v22.144c0 17.673 14.327 32 32 32v0h32c17.673 0 32-14.327 32-32v0-22.72c63.36-14.464 111.68-57.472 117.504-123.52 3.2-36.096-4.416-75.84-34.944-107.584-29.44-30.72-73.472-46.592-127.68-51.392-41.92-3.712-59.776-14.848-66.944-22.336-6.144-6.4-9.984-15.744-8.512-32.576 1.472-16.448 19.52-46.464 83.904-40.704 26.88 2.368 47.424 12.608 60.16 24.192 6.592 5.952 16.448 8.448 24 3.84l54.592-33.408c7.552-4.608 9.984-14.528 4.544-21.504-24.96-32.32-63.552-54.784-106.624-64.384v-19.904c0-17.673-14.327-32-32-32v0h-32z",
fill: null
}
]
};
export const deposit = {
id: "deposit",
shapes: [
{
path: "M720 464V320h96v144h144v96H816v144h-96V560H576v-96h144z",
fill: null
},
{
path: "M272.002 159.91c-82.273 11.174-132.442 51.032-160.704 96.251-15.75 25.201-23.46 50.077-27.287 68.45-1.93 9.264-2.926 17.129-3.444 22.921-.259 2.904-.4 5.313-.476 7.145-.038.917-.06 1.692-.073 2.315l-.013.821-.002.323V358.34c0 .03 0 .06 47.999.06h-48v1.854c-.023 26.076-.059 68.265 36.982 107.775 33.78 36.031 93.22 64.369 190.65 90.35 94.57 25.219 131.13 48.081 145.35 63.25 10.014 10.681 11.008 18.583 11.018 43.565l-.005.132a57.112 57.112 0 01-.18 2.605c-.233 2.608-.736 6.743-1.806 11.879-2.172 10.427-6.464 23.951-14.713 37.149-14.611 23.379-46.647 54.24-127.296 54.24-80.648 0-112.684-30.861-127.296-54.24-8.249-13.198-12.54-26.722-14.713-37.149-1.07-5.136-1.573-9.271-1.806-11.879a57.112 57.112 0 01-.18-2.605l-.009-.253.003.162.001.156v.152c0 .028 0 .057-48 .057s-48 .03-48 .06V665.864l.003.323.013.821c.012.623.034 1.398.073 2.315.076 1.832.217 4.241.476 7.145.518 5.792 1.514 13.657 3.444 22.921 3.828 18.373 11.536 43.249 27.287 68.45 28.262 45.219 78.431 85.077 160.704 96.25V960h96v-95.911c82.273-11.173 132.442-51.031 160.704-96.25 15.751-25.201 23.46-50.077 27.287-68.45 1.93-9.264 2.927-17.129 3.444-22.921.259-2.904.4-5.313.477-7.145.038-.917.06-1.692.073-2.315l.012-.821.002-.323.001-.14v-.064c0-.03 0-.06-48-.06h48l.001-1.854c.022-26.076.058-68.265-36.983-107.775-33.779-36.031-93.22-64.369-190.65-90.35-94.57-25.219-131.129-48.081-145.35-63.25-10.014-10.681-11.007-18.583-11.018-43.565l.005-.132c.018-.418.064-1.309.18-2.605.233-2.608.736-6.743 1.806-11.879 2.173-10.427 6.464-23.951 14.713-37.149 14.612-23.379 46.648-54.24 127.296-54.24 80.649 0 112.685 30.861 127.296 54.24 8.249 13.198 12.541 26.722 14.713 37.149 1.07 5.136 1.573 9.271 1.806 11.879.116 1.296.162 2.187.18 2.605.007.174.009.264.009.264v-.011l-.002-.162-.001-.156-.001-.098v-.054c0-.028 0-.057 48-.057s48-.03 48-.06v-.064l-.001-.14-.002-.323-.012-.821a112.71 112.71 0 00-.073-2.315 153.154 153.154 0 00-.477-7.145c-.517-5.792-1.514-13.657-3.444-22.921-3.827-18.373-11.536-43.249-27.287-68.45-28.262-45.219-78.431-85.077-160.704-96.251V64h-96v95.91zm192.004 505.163l-.001.042zM720.002 464V320h96v144h144v96h-144v144h-96V560h-144v-96h144z",
fill: null
}
]
};
export const depositCancel = {
id: "depositCancel",
shapes: [
{
path: "M272.002 159.91c-82.273 11.174-132.442 51.032-160.704 96.251-15.75 25.201-23.46 50.077-27.287 68.45-1.93 9.264-2.926 17.129-3.444 22.921-.259 2.904-.4 5.313-.476 7.145-.038.917-.06 1.692-.073 2.315l-.013.821-.002.323V358.34c0 .03 0 .06 47.999.06h-48v1.854c-.023 26.076-.059 68.265 36.982 107.775 33.78 36.031 93.22 64.369 190.65 90.35 94.57 25.219 131.13 48.081 145.35 63.25 10.014 10.681 11.008 18.583 11.018 43.565l-.005.132a57.112 57.112 0 01-.18 2.605c-.233 2.608-.736 6.743-1.806 11.879-2.172 10.427-6.464 23.951-14.713 37.149-14.611 23.379-46.647 54.24-127.296 54.24-80.648 0-112.684-30.861-127.296-54.24-8.249-13.198-12.54-26.722-14.713-37.149-1.07-5.136-1.573-9.271-1.806-11.879a57.112 57.112 0 01-.18-2.605l-.009-.253.003.162.001.156v.152c0 .028 0 .057-48 .057s-48 .03-48 .06V665.864l.003.323.013.821c.012.623.034 1.398.073 2.315.076 1.832.217 4.241.476 7.145.518 5.792 1.514 13.657 3.444 22.921 3.828 18.373 11.536 43.249 27.287 68.45 28.262 45.219 78.431 85.077 160.704 96.25V960h96v-95.911c82.273-11.173 132.442-51.031 160.704-96.25 15.751-25.201 23.46-50.077 27.287-68.45 1.93-9.264 2.927-17.129 3.444-22.921.259-2.904.4-5.313.477-7.145.038-.917.06-1.692.072-2.315l.013-.821.002-.323.001-.14v-.064c0-.03 0-.06-48-.06h48l.001-1.854c.022-26.076.058-68.265-36.983-107.775-33.779-36.031-93.22-64.369-190.65-90.35-94.57-25.219-131.129-48.081-145.35-63.25-10.014-10.681-11.007-18.583-11.018-43.565l.005-.132c.018-.418.064-1.309.18-2.605.233-2.608.736-6.743 1.806-11.879 2.173-10.427 6.464-23.951 14.713-37.149 14.612-23.379 46.648-54.24 127.296-54.24 80.649 0 112.685 30.861 127.296 54.24 8.249 13.198 12.541 26.722 14.713 37.149 1.07 5.136 1.573 9.271 1.806 11.879.116 1.296.162 2.187.18 2.605.007.174.009.264.009.264v-.011l-.002-.162-.001-.156-.001-.098v-.054c0-.028 0-.057 48-.057s48-.03 48-.06v-.064l-.001-.14-.002-.323-.013-.821a105.17 105.17 0 00-.072-2.315 153.154 153.154 0 00-.477-7.145c-.517-5.792-1.514-13.657-3.444-22.921-3.827-18.373-11.536-43.249-27.287-68.45-28.262-45.219-78.431-85.077-160.704-96.251V64h-96v95.91zm192.004 505.163l-.001.042zM732.121 544L606.062 417.941l67.883-67.882 126.059 126.058 126.058-126.058 67.883 67.882L867.886 544l126.059 126.059-67.883 67.882-126.058-126.059-126.059 126.059-67.883-67.882L732.121 544z",
fill: null
}
]
};
export const settings = {
id: "settings",
shapes: [
{
path: "M473.408 177.92c-11.213 50.947-55.974 88.506-109.508 88.506-22.622 0-43.677-6.707-61.286-18.241l0.427 0.262-29.12-18.816-44.288 44.288 18.816 29.12c11.271 17.182 17.978 38.238 17.978 60.86 0 53.534-37.559 98.295-87.763 109.371l-0.743 0.138-33.92 7.296v62.592l33.92 7.296c50.947 11.213 88.506 55.974 88.506 109.508 0 22.622-6.707 43.677-18.241 61.286l0.262-0.427-18.816 29.12 44.288 44.288 29.12-18.816c17.182-11.271 38.238-17.978 60.86-17.978 53.534 0 98.295 37.559 109.371 87.763l0.138 0.743 7.296 33.92h62.592l7.296-33.92c11.213-50.947 55.974-88.506 109.508-88.506 22.622 0 43.677 6.707 61.286 18.241l-0.427-0.262 29.12 18.816 44.288-44.288-18.816-29.12c-11.271-17.182-17.978-38.238-17.978-60.86 0-53.534 37.559-98.295 87.763-109.371l0.743-0.138 33.92-7.296v-62.592l-33.92-7.296c-50.947-11.213-88.506-55.974-88.506-109.508 0-22.622 6.707-43.677 18.241-61.286l-0.262 0.427 18.816-29.12-44.288-44.288-29.12 18.816c-17.182 11.271-38.238 17.978-60.86 17.978-53.534 0-98.295-37.559-109.371-87.763l-0.138-0.743-7.296-33.92h-62.592l-7.296 33.92zM405.184 114.56c6.41-29.090 31.961-50.538 62.526-50.56l88.578-0c30.567 0.022 56.118 21.47 62.449 50.135l0.079 0.425 9.984 46.592c3.209 14.55 15.995 25.275 31.285 25.275 6.449 0 12.453-1.908 17.477-5.19l-0.123 0.075 40-25.856c9.817-6.439 21.847-10.27 34.772-10.27 17.66 0 33.649 7.153 45.228 18.719l62.655 62.591c11.566 11.579 18.718 27.568 18.718 45.228 0 12.925-3.831 24.955-10.42 35.016l0.15-0.244-25.856 40c-3.207 4.902-5.115 10.905-5.115 17.355 0 15.291 10.725 28.077 25.062 31.246l0.212 0.039 46.592 10.048c29.090 6.41 50.538 31.961 50.56 62.526l0 0.002v88.576c-0.022 30.567-21.47 56.118-50.135 62.449l-0.425 0.079-46.592 9.984c-14.55 3.209-25.275 15.995-25.275 31.285 0 6.449 1.908 12.453 5.19 17.477l-0.075-0.123 25.856 40c6.439 9.817 10.27 21.847 10.27 34.772 0 17.66-7.153 33.649-18.719 45.228l-62.591 62.655c-11.579 11.566-27.568 18.718-45.228 18.718-12.925 0-24.955-3.831-35.016-10.42l0.244 0.15-40-25.856c-4.902-3.207-10.905-5.115-17.355-5.115-15.291 0-28.077 10.725-31.246 25.062l-0.039 0.212-10.048 46.592c-6.41 29.090-31.961 50.538-62.526 50.56l-88.578 0c-30.567-0.022-56.118-21.47-62.449-50.135l-0.079-0.425-9.984-46.592c-3.209-14.55-15.995-25.275-31.285-25.275-6.449 0-12.453 1.908-17.477 5.19l0.123-0.075-40 25.856c-9.817 6.439-21.847 10.27-34.772 10.27-17.66 0-33.649-7.153-45.228-18.719l-62.655-62.591c-11.566-11.579-18.718-27.568-18.718-45.228 0-12.925 3.831-24.955 10.42-35.016l-0.15 0.244 25.856-40c3.207-4.902 5.115-10.905 5.115-17.355 0-15.291-10.725-28.077-25.062-31.246l-0.212-0.039-46.592-10.048c-29.090-6.41-50.538-31.961-50.56-62.526l-0-0.002v-88.576c0.022-30.567 21.47-56.118 50.135-62.449l0.425-0.079 46.592-9.984c14.55-3.209 25.275-15.995 25.275-31.285 0-6.449-1.908-12.453-5.19-17.477l0.075 0.123-25.856-40c-6.439-9.817-10.27-21.847-10.27-34.772 0-17.66 7.153-33.649 18.719-45.228l62.591-62.655c11.579-11.566 27.568-18.718 45.228-18.718 12.925 0 24.955 3.831 35.016 10.42l-0.244-0.15 40 25.856c4.902 3.207 10.905 5.115 17.355 5.115 15.291 0 28.077-10.725 31.246-25.062l0.039-0.212 10.048-46.592zM512 624c-61.856 0-112-50.144-112-112s50.144-112 112-112v0c61.856 0 112 50.144 112 112s-50.144 112-112 112v0zM512 704c106.039 0 192-85.961 192-192s-85.961-192-192-192v0c-106.039 0-192 85.961-192 192s85.961 192 192 192v0z",
fill: null
}
]
};
export const refresh = {
id: "refresh",
shapes: [
{
path: "M96 96c0-17.673 14.327-32 32-32v0h256c17.673 0 32 14.327 32 32v0 256c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-135.040c-96.959 63.749-160.086 172.043-160.086 295.082 0 183.168 139.905 333.66 318.684 350.444l1.403 0.106c17.6 1.536 32 15.744 32 33.408v32c0.003 0.166 0.005 0.362 0.005 0.558 0 16.754-13.582 30.336-30.336 30.336-0.587 0-1.17-0.017-1.749-0.050l0.080 0.004c-233.258-17.218-415.984-210.697-415.984-446.855 0-142.366 66.406-269.222 169.934-351.282l0.93-0.711h-106.88c-17.673 0-32-14.327-32-32v0-32zM864 512c0-0.015 0-0.032 0-0.050 0-183.138-139.858-333.61-318.595-350.436l-1.405-0.107c-17.636-1.249-31.531-15.633-31.999-33.363l-0.001-0.045v-32c0-17.664 14.4-32.128 32-30.848 233.258 17.218 415.984 210.697 415.984 446.855 0 142.366-66.406 269.222-169.934 351.282l-0.93 0.711h106.88c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-256c-17.673 0-32-14.327-32-32v0-256c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 135.040c96.907-63.714 160-171.95 160-294.921 0-0.042-0-0.084-0-0.126l0 0.007z",
fill: null
}
]
};
export const timer = {
id: "timer",
shapes: [
{
path: "M160 576c0 194.404 157.596 352 352 352s352-157.596 352-352v0c0-194.404-157.596-352-352-352s-352 157.596-352 352v0zM417.6 137.984c-1.014-2.98-1.599-6.414-1.6-9.984l-0-0v-32c0-17.673 14.327-32 32-32v0h128c17.673 0 32 14.327 32 32v0 32c-0.001 3.57-0.586 7.004-1.666 10.21l0.066-0.226c203.751 44.882 353.948 223.909 353.948 438.016 0 247.424-200.576 448-448 448-0.122 0-0.245-0-0.367-0l0.019 0c-0.103 0-0.225 0-0.348 0-247.424 0-448-200.576-448-448 0-214.107 150.197-393.134 350.975-437.465l2.972-0.551zM736.576 38.4l110.848 64c9.632 5.636 15.999 15.931 15.999 27.712 0 5.891-1.592 11.41-4.369 16.151l0.082-0.151-16 27.776c-5.636 9.632-15.931 15.999-27.712 15.999-5.891 0-11.41-1.592-16.151-4.369l0.151 0.082-110.848-64c-9.632-5.636-15.999-15.931-15.999-27.712 0-5.891 1.592-11.41 4.369-16.151l-0.082 0.151 16-27.776c5.636-9.632 15.931-15.999 27.712-15.999 5.891 0 11.41 1.592 16.151 4.369l-0.151-0.082zM176.576 102.4l110.848-64c4.59-2.695 10.109-4.287 16-4.287 11.782 0 22.076 6.367 27.631 15.848l0.082 0.151 16 27.776c2.695 4.59 4.287 10.109 4.287 16 0 11.782-6.367 22.076-15.848 27.631l-0.151 0.082-110.848 64c-4.59 2.695-10.109 4.287-16 4.287-11.782 0-22.076-6.367-27.631-15.848l-0.082-0.151-16-27.776c-2.695-4.59-4.287-10.109-4.287-16 0-11.782 6.367-22.076 15.848-27.631l0.151-0.082zM496 320h32c17.673 0 32 14.327 32 32v0 256c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-256c0-17.673 14.327-32 32-32v0z",
fill: null
}
]
};
export const overload = {
id: "overload",
shapes: [
{
path: "M496 704h32c17.673 0 32 14.327 32 32v0 192c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-192c0-17.673 14.327-32 32-32v0zM496 64h32c17.673 0 32 14.327 32 32v0 192c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-192c0-17.673 14.327-32 32-32v0zM364.928 636.48l22.592 22.592c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-135.68 135.808c-5.794 5.808-13.805 9.401-22.656 9.401s-16.862-3.593-22.655-9.401l-0.001-0.001-22.656-22.656c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l135.808-135.744c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l-0-0zM817.472 183.872l22.656 22.656c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-135.808 135.744c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-22.592-22.592c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l135.68-135.808c5.794-5.808 13.805-9.401 22.656-9.401s16.862 3.593 22.655 9.401l0.001 0.001zM320 496v32c0 17.673-14.327 32-32 32v0h-192c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h192c17.673 0 32 14.327 32 32v0zM960 496v32c0 17.673-14.327 32-32 32v0h-192c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h192c17.673 0 32 14.327 32 32v0zM387.52 364.928l-22.592 22.592c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-135.808-135.68c-5.808-5.794-9.401-13.805-9.401-22.656s3.593-16.862 9.401-22.655l0.001-0.001 22.656-22.656c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l135.744 135.808c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l0-0zM840.128 817.472l-22.656 22.656c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-135.744-135.808c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l22.592-22.592c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l135.808 135.68c5.808 5.794 9.401 13.805 9.401 22.656s-3.593 16.862-9.401 22.655l-0.001 0.001z",
fill: null
}
]
};
export const filters = {
id: "filters",
shapes: [
{
path: "M336 848c70.692 0 128-57.308 128-128 0-70.692-57.308-128-128-128-70.692 0-127.952 57.308-127.952 128 0 70.692 57.26 128 127.952 128zM624 432c70.692 0 128-57.308 128-128 0-70.692-57.308-128-128-128-70.692 0-128 57.308-128 128 0 70.692 57.308 128 128 128z",
fill: null,
fillOpacity: 0.1
},
{
path: "M624 224c-44.183 0-80 35.817-80 80s35.817 80 80 80 80-35.817 80-80-35.817-80-80-80zm-169.375 32C475.519 182.128 543.438 128 624 128s148.481 54.128 169.375 128H960v96H793.375C772.481 425.872 704.562 480 624 480s-148.481-54.128-169.375-128H64v-96h390.625zM336 640c-44.159 0-79.952 35.794-79.952 80s35.793 80 79.952 80c44.183 0 80-35.817 80-80s-35.817-80-80-80zm-169.33 32c20.88-73.86 88.752-128 169.33-128 80.562 0 148.481 54.128 169.375 128H960v96H505.375C484.481 841.872 416.562 896 336 896c-80.578 0-148.45-54.14-169.33-128H64v-96h102.67z",
fill: null,
fillRule: "evenodd"
}
]
};
export const funnel = {
id: "funnel",
shapes: [
{
path: "M864 800v128c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-128h-64c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h224c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-64zM560 288h64c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-224c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h64v-192c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 192zM256 608v320c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-320h-64c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h224c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-64zM192 64h32c17.673 0 32 14.327 32 32v0 288c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-288c0-17.673 14.327-32 32-32v0zM496 480h32c17.673 0 32 14.327 32 32v0 416c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-416c0-17.673 14.327-32 32-32v0zM800 64h32c17.673 0 32 14.327 32 32v0 480c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-480c0-17.673 14.327-32 32-32v0z",
fill: null
}
]
};
export const edit = {
id: "edit",
shapes: [
{
path: "M868.864 312.704l-135.68-135.808-90.368 90.624 136.064 135.68 89.984-90.496zM574.912 335.552l-314.24 314.048-11.328 147.072 147.008-11.328 314.496-314.048-135.936-135.68zM439.104 878.336l-256.832 19.84c-0.739 0.061-1.599 0.095-2.468 0.095-17.673 0-32-14.327-32-32 0-0.89 0.036-1.771 0.107-2.642l-0.008 0.114 19.84-256.896 542.72-543.104c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l226.24 226.304c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-542.912 543.040z",
fill: null
}
]
};
export const liveVideo = {
id: "liveVideo",
shapes: [
{
path: "M160 224v576h704v-576h-704zM96 128h832c17.673 0 32 14.327 32 32v0 704c0 17.673-14.327 32-32 32v0h-832c-17.673 0-32-14.327-32-32v0-704c0-17.673 14.327-32 32-32v0zM426.88 680.768c-2.37 1.465-5.244 2.333-8.32 2.333-8.837 0-16-7.163-16-16 0-0.010 0-0.021 0-0.031l-0 0.002v-309.76c-0-0.009-0-0.019-0-0.029 0-8.837 7.163-16 16-16 3.076 0 5.95 0.868 8.389 2.373l-0.069-0.040 256.448 154.88c4.663 2.852 7.728 7.916 7.728 13.696s-3.065 10.844-7.658 13.656l-0.070 0.040-256.512 154.88z",
fill: null
}
]
};
export const liveVideo20 = {
id: "liveVideo20",
shapes: [
{
path: "M550.4 806.4v76.8h320c14.138 0 25.6 11.462 25.6 25.6v0 25.6c0 14.138-11.462 25.6-25.6 25.6v0h-716.8c-14.138 0-25.6-11.462-25.6-25.6v0-25.6c0-14.138 11.462-25.6 25.6-25.6v0h320v-76.8h-384c-14.138 0-25.6-11.462-25.6-25.6v0-691.2c0-14.138 11.462-25.6 25.6-25.6v0h844.8c14.138 0 25.6 11.462 25.6 25.6v0 691.2c0 14.138-11.462 25.6-25.6 25.6v0h-384zM140.8 140.8v588.8h742.4v-588.8h-742.4zM667.392 457.165l-244.634 146.79c-3.757 2.287-8.299 3.641-13.158 3.641-14.138 0-25.6-11.462-25.6-25.6 0-0.020 0-0.040 0-0.060l-0 0.003v-293.478c-0-0.002-0-0.003-0-0.005 0-14.138 11.462-25.6 25.6-25.6 4.859 0 9.402 1.354 13.272 3.705l-0.114-0.064 244.634 146.79c7.509 4.553 12.451 12.682 12.451 21.965s-4.941 17.412-12.337 21.901l-0.114 0.064z",
fill: null
}
]
};
export const withdraw = {
id: "withdraw",
shapes: [
{
path: "M272.002 159.91c-82.273 11.174-132.442 51.032-160.704 96.251-15.75 25.201-23.46 50.077-27.287 68.45-1.93 9.264-2.926 17.129-3.444 22.921-.259 2.904-.4 5.313-.476 7.145-.038.917-.06 1.692-.073 2.315l-.013.821-.002.323V358.34c0 .03 0 .06 47.999.06h-48v1.854c-.023 26.076-.059 68.265 36.982 107.775 33.78 36.031 93.22 64.369 190.65 90.35 94.57 25.219 131.13 48.081 145.35 63.25 10.014 10.681 11.008 18.583 11.018 43.565l-.005.132a57.112 57.112 0 01-.18 2.605c-.232 2.608-.736 6.743-1.806 11.879-2.172 10.427-6.464 23.951-14.713 37.149-14.611 23.379-46.647 54.24-127.296 54.24-80.648 0-112.684-30.861-127.296-54.24-8.249-13.198-12.54-26.722-14.713-37.149-1.07-5.136-1.573-9.271-1.806-11.879a57.112 57.112 0 01-.18-2.605l-.009-.253.003.162.001.156v.152c0 .028 0 .057-48 .057s-48 .03-48 .06V665.864l.003.323.013.821c.012.623.034 1.398.073 2.315.076 1.832.217 4.241.476 7.145.518 5.792 1.514 13.657 3.444 22.921 3.828 18.373 11.536 43.249 27.287 68.45 28.262 45.219 78.431 85.077 160.704 96.25V960h96v-95.911c82.273-11.173 132.442-51.031 160.704-96.25 15.751-25.201 23.46-50.077 27.287-68.45 1.93-9.264 2.927-17.129 3.444-22.921.259-2.904.4-5.313.477-7.145.038-.917.06-1.692.073-2.315l.012-.821.002-.323.001-.14v-.064c0-.03 0-.06-48-.06h48l.001-1.854c.022-26.076.058-68.265-36.983-107.775-33.779-36.031-93.22-64.369-190.65-90.35-94.57-25.219-131.129-48.081-145.35-63.25-10.014-10.681-11.007-18.583-11.018-43.565l.005-.132c.018-.418.064-1.309.18-2.605.233-2.608.736-6.743 1.806-11.879 2.173-10.427 6.464-23.951 14.713-37.149 14.612-23.379 46.648-54.24 127.296-54.24 80.649 0 112.685 30.861 127.296 54.24 8.249 13.198 12.541 26.722 14.713 37.149 1.07 5.136 1.574 9.271 1.806 11.879.116 1.296.162 2.187.18 2.605.007.174.009.264.009.264v-.011l-.002-.162-.001-.156-.001-.098v-.054c0-.028 0-.057 48-.057s48-.03 48-.06v-.064l-.001-.14-.002-.323-.012-.821a112.71 112.71 0 00-.073-2.315 153.154 153.154 0 00-.477-7.145c-.517-5.792-1.514-13.657-3.444-22.921-3.827-18.373-11.536-43.249-27.287-68.45-28.262-45.219-78.431-85.077-160.704-96.251V64h-96v95.91zm192.004 505.163l-.001.042zm255.996-124.955V320h96v220.118l78.059-78.059 67.882 67.882-160 160c-18.745 18.745-49.137 18.745-67.882 0l-160-160 67.882-67.882 78.059 78.059z",
fill: null
}
]
};
export const circleWithdraw = {
id: "circleWithdraw",
shapes: [
{
path: "M462.985 592.481L352.593 482.089C340.096 469.592 319.835 469.592 307.338 482.089L284.711 504.716C272.214 517.213 272.214 537.474 284.711 549.971L488.357 753.618C494.606 759.866 502.795 762.991 510.985 762.991C519.174 762.991 527.364 759.866 533.612 753.618L737.259 549.971C749.756 537.474 749.756 517.213 737.259 504.716L714.631 482.089C702.135 469.592 681.873 469.592 669.377 482.089L558.985 592.481V288C558.985 270.327 544.658 256 526.985 256H494.985C477.312 256 462.985 270.327 462.985 288L462.985 592.481ZM512 1024C794.77 1024 1024 794.77 1024 512C1024 229.23 794.77 0 512 0C229.23 0 0 229.23 0 512C0 794.77 229.23 1024 512 1024ZM512 928C282.25 928 96 741.75 96 512C96 282.25 282.25 96 512 96C741.75 96 928 282.25 928 512C928 741.75 741.75 928 512 928Z",
fill: null
}
]
};
export const phone = {
id: "phone",
shapes: [
{
path: "M835.52 721.216l-136.64-45.568-32.32 32.32c-14.475 14.464-34.466 23.409-56.546 23.409-17.444 0-33.584-5.583-46.73-15.060l0.237 0.162-62.464-44.608c-60.692-43.708-112.281-95.318-154.607-154.048l-1.361-1.984-44.608-62.4c-9.314-12.91-14.897-29.050-14.897-46.494 0-22.080 8.945-42.072 23.41-56.547l32.319-32.319-45.568-136.64-116.544 58.24c6.144 167.424 65.472 306.496 178.56 419.52 113.024 113.088 252.096 172.416 419.456 178.56l58.24-116.544zM637.952 600.768c14.479-14.486 34.485-23.446 56.583-23.446 9.064 0 17.777 1.508 25.9 4.285l-0.563-0.167 163.456 54.528c32.064 10.914 54.719 40.761 54.719 75.9 0 13.042-3.121 25.356-8.657 36.234l0.21-0.454-71.040 142.208c-13.434 26.408-40.409 44.185-71.535 44.185-0.704 0-1.405-0.009-2.104-0.027l0.103 0.002c-196.224-4.672-362.176-73.856-495.104-206.912-133.056-132.992-202.24-298.88-206.976-495.168-0.014-0.567-0.023-1.236-0.023-1.906 0-31.151 17.804-58.143 43.792-71.356l0.455-0.21 142.208-71.104c10.429-5.332 22.748-8.456 35.798-8.456 35.119 0 64.952 22.629 75.715 54.101l0.167 0.563 54.528 163.52c9.6 28.8 2.048 60.48-19.328 81.92l-29.696 29.632 36.672 51.456c37.47 52.002 81.712 96.204 132.056 132.465l1.704 1.167 51.392 36.736 29.632-29.696z",
fill: null
}
]
};
export const phone24 = {
id: "phone24",
shapes: [
{
path: "M857.844 711.859l-163.508-54.503-39.272 39.272c-22.122 22.122-56.996 25.009-82.454 6.824l-62.437-44.598c-58.818-42.013-110.276-93.471-152.289-152.289l-44.598-62.437c-18.184-25.458-15.298-60.332 6.824-82.454l39.272-39.272-54.503-163.508-142.208 71.104c4.209 175.967 65.229 322.246 183.525 440.543s264.575 179.316 440.542 183.526l71.104-142.208zM300.943 715.796c-130.081-130.081-197.655-292.072-202.253-484.269-0.592-24.786 13.185-47.684 35.36-58.772l142.208-71.104c31.615-15.807 70.058-2.993 85.865 28.622 1.354 2.709 2.515 5.51 3.472 8.383l54.503 163.508c7.666 22.997 1.68 48.352-15.461 65.493l-39.272 39.272 44.598 62.437c37.908 53.071 84.338 99.501 137.409 137.409l62.437 44.598 39.272-39.272c17.141-17.141 42.496-23.127 65.493-15.461l163.508 54.503c33.532 11.177 51.655 47.422 40.477 80.954-0.958 2.873-2.118 5.674-3.472 8.383l-71.104 142.208c-11.088 22.176-33.987 35.953-58.774 35.36-192.195-4.598-354.186-72.172-484.267-202.253z",
fill: null
}
]
};
export const email = {
id: "email",
shapes: [
{
path: "M96 192h832c17.673 0 32 14.327 32 32v0 576c0 17.673-14.327 32-32 32v0h-832c-17.673 0-32-14.327-32-32v0-576c0-17.673 14.327-32 32-32v0zM864 477.44l-320.448 137.28c-9.285 4.082-20.109 6.457-31.488 6.457s-22.203-2.376-32.003-6.658l0.515 0.201-320.768-137.28v258.56h704.192v-258.56zM159.872 288v84.864l352.128 150.912 352-150.848v-84.928h-704.128z",
fill: null
}
]
};
export const emptyFile = {
id: "emptyFile",
shapes: [
{
path: "M620.337 251.89l-226.331-226.331c-16.365-16.365-38.165-25.386-61.353-25.386h-236.277c-47.822 0-86.739 38.917-86.739 86.739v809.562c0 47.822 38.917 86.739 86.739 86.739h462.607c47.822 0 86.739-38.917 86.739-86.739v-583.232c0-23.188-9.021-44.989-25.386-61.353zM575.927 289.303h-190.421c-15.96 0-28.913-12.953-28.913-28.913v-190.421l219.334 219.334zM558.984 925.388h-462.607c-15.96 0-28.913-12.953-28.913-28.913v-809.562c0-15.96 12.953-28.913 28.913-28.913h202.391v202.391c0 47.822 38.917 86.739 86.739 86.739h202.391v549.346c0 15.96-12.953 28.913-28.913 28.913z",
fill: null
}
]
};
export const crossedFile = {
id: "crossedFile",
shapes: [
{
path: "M3.5 2H10.5V5H13.5V13H3.5V2Z",
fill: "#ffffff",
fillOpacity: 0.1
},
{
path: "M0.969727 1.53033L14.9697 15.5303L16.0304 14.4697L14.5 12.9393V5.5C14.5 5.30109 14.421 5.11032 14.2803 4.96967L10.7803 1.46967C10.6397 1.32902 10.4489 1.25 10.25 1.25H2.81072L2.03039 0.469666L0.969727 1.53033ZM4.31072 2.75H9.5V5.5C9.5 5.91421 9.83579 6.25 10.25 6.25H13V11.4393L4.31072 2.75ZM11 4.75V3.81066L11.9393 4.75H11ZM4 12.5V5.25H2.5V12.5C2.5 13.4665 3.2835 14.25 4.25 14.25H11.5V12.75H4.25C4.11193 12.75 4 12.6381 4 12.5Z",
fill: null
}
]
};
export const email24 = {
id: "email24",
shapes: [
{
path: "M896 400.424v-144.424h-768v144.424l384 141.474 384-141.474zM896 468.629l-361.875 133.322c-14.281 5.261-29.969 5.261-44.25 0l-361.875-133.322v299.371h768v-299.371zM96 192h832c17.673 0 32 14.327 32 32v576c0 17.673-14.327 32-32 32h-832c-17.673 0-32-14.327-32-32v-576c0-17.673 14.327-32 32-32z",
fill: null
}
]
};
export const facebook = {
id: "facebook",
shapes: [
{
path: "M383.030 411.733v-70.4c0-112.905 102.002-202.667 225.939-202.667h116.364c17.673 0 32 14.327 32 32v136.533c0 17.673-14.327 32-32 32h-116.364c-4.595 0-6.788 1.93-6.788 2.133v70.4h123.152c21.24 0 36.586 20.313 30.782 40.745l-38.788 136.533c-3.909 13.761-16.477 23.255-30.782 23.255h-84.364v241.067c0 17.673-14.327 32-32 32h-155.152c-17.673 0-32-14.327-32-32v-241.067h-84.364c-17.673 0-32-14.327-32-32v-136.533c0-17.673 14.327-32 32-32h84.364zM693.333 202.667h-84.364c-90.282 0-161.939 63.058-161.939 138.667v102.4c0 17.673-14.327 32-32 32h-84.364v72.533h84.364c17.673 0 32 14.327 32 32v241.067h91.152v-241.067c0-17.673 14.327-32 32-32h92.188l20.606-72.533h-112.794c-17.673 0-32-14.327-32-32v-102.4c0-37.499 32.538-66.133 70.788-66.133h84.364v-72.533z",
fill: null
}
]
};
export const twitter = {
id: "twitter",
shapes: [
{
path: "M878.14 187.123c24.389-16.405 56.138 5.991 48.865 34.47-11.97 46.87-35.958 90-69.635 125.55 0.522 5.409 0.793 10.855 0.812 16.332 0 394.048-396.999 595.547-745.162 411.1-30.060-15.925-17.8-61.543 16.193-60.254 60.255 2.285 119.876-9.295 173.925-33.377-77.324-45.053-126.807-104.937-151.062-176.017-24.959-73.144-21.314-150.050-0.492-223.051 6.295-22.070 12.69-38.691 17.23-48.43 10.264-22.023 40.363-25.022 54.771-5.458 59.391 80.645 153.949 130.805 256.418 137.199-1.074-76.647 47.731-145.204 121.663-172.113 66.69-24.273 141.355-10.14 193.352 35.279 29.516-10.118 57.479-23.983 83.121-41.23zM795.217 295.364c-11.693 3.357-24.278-0.205-32.475-9.194-34.266-37.571-89.983-50.865-139.187-32.956-48.689 17.721-80.244 62.047-79.555 111.26v33.289c0 17.365-13.849 31.561-31.209 31.99-114.783 2.838-224.461-41.146-302.608-119.433-14.889 58.208-16.475 118.441 2.463 173.939 23.726 69.53 78.227 126.169 172.204 165.999 23.632 10.016 26.448 42.38 4.902 56.326-40.036 25.915-84.002 45.143-130.036 57.182 271.699 70.821 534.466-100.186 534.466-400.179-0.025-7.197-0.751-14.377-2.169-21.451-2.172-10.837 1.402-22.029 9.454-29.601 9.062-8.522 17.345-17.685 24.791-27.388-10.189 3.794-20.544 7.204-31.040 10.218z",
fill: null
}
]
};
export const pause = {
id: "pause",
shapes: [
{
path: "M304 192h128c17.673 0 32 14.327 32 32v0 576c0 17.673-14.327 32-32 32v0h-128c-17.673 0-32-14.327-32-32v0-576c0-17.673 14.327-32 32-32v0zM592 192h128c17.673 0 32 14.327 32 32v0 576c0 17.673-14.327 32-32 32v0h-128c-17.673 0-32-14.327-32-32v0-576c0-17.673 14.327-32 32-32v0z",
fill: null
}
]
};
export const play = {
id: "play",
shapes: [
{
path: "M315.84 849.152c-4.711 2.882-10.412 4.589-16.512 4.589-17.666 0-31.989-14.316-32-31.98l-0-0.001v-619.52c0.011-17.665 14.334-31.981 32-31.981 6.1 0 11.801 1.707 16.653 4.669l-0.141-0.080 512.96 309.76c9.297 5.709 15.404 15.821 15.404 27.36s-6.107 21.651-15.265 27.281l-0.139 0.079-512.96 309.824z",
fill: null
}
]
};
export const fullscreenExit = {
id: "fullscreenExit",
shapes: [
{
path: "M659.392 271.552l198.208-198.208c5.794-5.808 13.805-9.401 22.656-9.401s16.862 3.593 22.655 9.401l22.593 22.657c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-197.504 197.504h123.52c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-256c-17.673 0-32-14.327-32-32v0-256c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 124.8zM339.392 725.952l-198.144 198.208c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l0 0-22.656-22.592c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l197.504-197.504h-123.456c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h256c17.673 0 32 14.327 32 32v0 256c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-124.8z",
fill: null
}
]
};
export const fullscreen = {
id: "fullscreen",
shapes: [
{
path: "M64 928v-256c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 123.456l167.040-167.104c5.794-5.808 13.805-9.401 22.656-9.401s16.862 3.593 22.655 9.401l0.001 0.001 22.656 22.656c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-167.808 167.744h124.8c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-256c-17.673 0-32-14.327-32-32v0zM960 96v256c0 17.673-14.327 32-32 32v0h-32c-17.673 0-32-14.327-32-32v0-123.456l-167.040 167.104c-5.794 5.808-13.805 9.401-22.656 9.401s-16.862-3.593-22.655-9.401l-0.001-0.001-22.656-22.656c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l167.808-167.744h-124.8c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h256c17.673 0 32 14.327 32 32v0z",
fill: null
}
]
};
export const replay = {
id: "replay",
shapes: [
{
path: "M512 928c229.75 0 416-186.25 416-416v0c0-17.28 13.504-32 30.848-32h34.112c16.896 0 30.976 13.184 31.040 30.080 0 284.672-229.248 513.92-512 513.92-282.744-0.034-511.94-229.251-511.94-512 0-282.77 229.23-512 512-512 170.696 0 321.883 83.532 414.912 211.95l1.028 1.49v-117.44c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 256c0 17.673-14.327 32-32 32v0h-256c-17.673 0-32-14.327-32-32v0-32c0-17.673 14.327-32 32-32v0h126.592c-75.083-116.186-203.959-192-350.542-192-229.75 0-416 186.25-416 416 0 229.733 186.221 415.972 415.948 416l0.003 0zM426.88 680.768c-2.37 1.465-5.244 2.333-8.32 2.333-8.837 0-16-7.163-16-16 0-0.010 0-0.021 0-0.031l-0 0.002v-309.76c-0-0.009-0-0.019-0-0.029 0-8.837 7.163-16 16-16 3.076 0 5.95 0.868 8.389 2.373l-0.069-0.040 256.448 154.88c4.663 2.852 7.728 7.916 7.728 13.696s-3.065 10.844-7.658 13.656l-0.070 0.040-256.512 154.88z",
fill: null
}
]
};
export const soundMute = {
id: "soundMute",
shapes: [
{
path: "M330.88 380.928c-17.567 17.57-40.217 30.057-65.555 35.066l-0.813 0.134-104.512 20.096v157.312l98.816 13.888c28.614 4.152 53.613 17.236 72.639 36.287l0.001 0.001 84.544 84.48v-432.384l-85.12 85.12zM851.392 527.488l79.232 79.232c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-22.656 22.656c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l0 0-79.168-79.232-79.232 79.232c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l0 0-22.592-22.656c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l79.168-79.168-79.168-79.232c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l22.592-22.592c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l79.232 79.168 79.168-79.168c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l-0-0 22.656 22.592c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-79.232 79.232zM89.984 352l156.352-30.080c6.553-1.267 12.233-4.38 16.641-8.769l-0.001 0.001 194.368-194.432c5.794-5.808 13.805-9.401 22.656-9.401 17.648 0 31.96 14.287 32 31.925l0 0.004v741.504c-0.004 17.67-14.329 31.993-32 31.993-8.851 0-16.862-3.593-22.655-9.401l-0.001-0.001-193.792-193.792c-4.766-4.748-11.021-8.003-18.005-9.004l-0.171-0.020-153.856-21.76c-15.618-2.27-27.484-15.552-27.52-31.612l-0-0.004v-265.792c0.035-15.517 11.108-28.437 25.781-31.327l0.203-0.033z",
fill: null
}
]
};
export const soundPlay = {
id: "soundPlay",
shapes: [
{
path: "M416 295.744l-85.12 85.184c-17.567 17.57-40.217 30.057-65.555 35.066l-0.813 0.134-104.512 20.096v157.312l98.816 13.888c28.614 4.152 53.613 17.236 72.639 36.287l0.001 0.001 84.544 84.48v-432.384zM89.984 352l156.352-30.080c6.553-1.267 12.233-4.38 16.641-8.769l-0.001 0.001 194.368-194.432c5.794-5.808 13.805-9.401 22.656-9.401 17.648 0 31.96 14.287 32 31.925l0 0.004v741.504c-0.004 17.67-14.329 31.993-32 31.993-8.851 0-16.862-3.593-22.655-9.401l-0.001-0.001-193.792-193.792c-4.766-4.748-11.021-8.003-18.005-9.004l-0.171-0.020-153.856-21.76c-15.618-2.27-27.484-15.552-27.52-31.612l-0-0.004v-265.792c0.035-15.517 11.108-28.437 25.781-31.327l0.203-0.033zM702.4 696.704c-8.561 13.959-23.737 23.13-41.055 23.13-26.51 0-48-21.49-48-48 0-8.563 2.242-16.602 6.171-23.562l-0.124 0.24c23.012-38.952 36.609-85.835 36.609-135.894 0-0.217-0-0.435-0.001-0.652l0 0.034c0-49.152-12.992-96.256-37.376-137.6-4.169-6.969-6.634-15.372-6.634-24.352 0-26.515 21.495-48.010 48.010-48.010 17.536 0 32.876 9.401 41.255 23.439l0.121 0.22c32.96 56 50.624 119.936 50.624 186.304 0 65.728-17.28 129.024-49.6 184.64zM854.208 816.32c-8.689 13.261-23.48 21.898-40.288 21.898-26.515 0-48.010-21.495-48.010-48.010 0-9.707 2.881-18.741 7.834-26.294l-0.112 0.182c46.622-70.905 74.369-157.833 74.369-251.241 0-0.301-0-0.602-0.001-0.902l0 0.047c0-91.008-26.24-177.984-74.688-252.544-5.183-7.551-8.278-16.888-8.278-26.947 0-26.51 21.49-48 48-48 17.097 0 32.106 8.939 40.609 22.398l0.116 0.197c56.568 85.783 90.241 191.008 90.241 304.098 0 0.281-0 0.561-0.001 0.841l0-0.043c0 109.44-31.488 214.4-89.792 304.256z",
fill: null
}
]
};
export const video = {
id: "video",
shapes: [
{
path: "M96 512c0 229.75 186.25 416 416 416v0c229.75 0 416-186.25 416-416s-186.25-416-416-416v0c-229.75 0-416 186.25-416 416v0zM0 512c0-282.77 229.23-512 512-512s512 229.23 512 512v0c0 282.77-229.23 512-512 512s-512-229.23-512-512v0zM426.88 680.768c-2.37 1.465-5.244 2.333-8.32 2.333-8.837 0-16-7.163-16-16 0-0.010 0-0.021 0-0.031l-0 0.002v-309.76c-0-0.009-0-0.019-0-0.029 0-8.837 7.163-16 16-16 3.076 0 5.95 0.868 8.389 2.373l-0.069-0.040 256.448 154.88c4.663 2.852 7.728 7.916 7.728 13.696s-3.065 10.844-7.658 13.656l-0.070 0.040-256.512 154.88z",
fill: null
}
]
};
export const noVideo = {
id: "noVideo",
shapes: [
{
path: "M612.736 680.64l84.672-51.136 140.8 140.8c56.008-70.237 89.869-160.291 89.869-258.253 0-229.75-186.25-416-416-416-97.962 0-188.015 33.861-259.095 90.517l0.841-0.648 88.96 88.96c-22.291 20.529-36.211 49.854-36.224 82.43l-0 0.002v17.152l-120.704-120.704c-56.008 70.237-89.869 160.291-89.869 258.253 0 229.75 186.25 416 416 416 97.962 0 188.015-33.861 259.095-90.517l-0.841 0.648-157.44-157.504zM117.632 185.472l-30.976-30.976c-5.789-5.791-9.369-13.789-9.369-22.624s3.58-16.833 9.369-22.624l22.592-22.592c5.791-5.789 13.789-9.369 22.624-9.369s16.833 3.58 22.624 9.369l30.976 30.976c87.919-73.212 202.044-117.652 326.548-117.652 282.77 0 512 229.23 512 512 0 124.504-44.44 238.628-118.322 327.376l0.671-0.829 17.472 17.408c5.789 5.791 9.369 13.789 9.369 22.624s-3.58 16.833-9.369 22.624l-22.656 22.656c-5.791 5.789-13.789 9.369-22.624 9.369s-16.833-3.58-22.624-9.369l-17.408-17.408c-87.919 73.212-202.044 117.652-326.548 117.652-282.77 0-512-229.23-512-512 0-124.504 44.44-238.628 118.322-327.376l-0.671 0.829zM426.816 680.832c-2.355 1.441-5.206 2.295-8.256 2.295-8.837 0-16-7.163-16-16 0-0.019 0-0.038 0-0.058l-0 0.003v-309.76c-0-0.009-0-0.019-0-0.029 0-8.837 7.163-16 16-16 3.076 0 5.95 0.868 8.389 2.373l-0.069-0.040 256.448 154.88c4.663 2.852 7.728 7.916 7.728 13.696s-3.065 10.844-7.658 13.656l-0.070 0.040-256.512 154.88z",
fill: null
}
]
};
export const promo = {
id: "promo",
shapes: [
{
path: "M848.477 80c61.856 0 112 50.144 112 112v264.321a176.004 176.004 0 01-56.007 128.755L526.649 937.183c-44.129 41.125-112.901 39.914-155.555-2.739L106.429 669.779c-42.623-42.624-43.867-111.337-2.813-155.475l351.743-378.17A175.996 175.996 0 01584.231 80h264.246zm0 96H584.231a79.998 79.998 0 00-58.578 25.515L173.909 579.686c-5.864 6.305-5.687 16.121.402 22.21l264.666 264.666c6.093 6.093 15.918 6.266 22.222.391l377.82-352.107a80 80 0 0025.458-58.525V192c0-8.837-7.163-16-16-16zm-134.852 80c44.183 0 80 35.817 80 80s-35.817 80-80 80-80-35.817-80-80 35.817-80 80-80z",
fill: null
}
]
};
export const promosolid = {
id: "promosolid",
shapes: [
{
path: "M864.45 192a16 16 0 0 0-16-16H584.21a80 80 0 0 0-58.58 25.52L173.88 579.67a16 16 0 0 0 .4 22.22l264.67 264.66a16 16 0 0 0 22.22.4L839 514.84a80 80 0 0 0 25.46-58.53V192z",
fill: color("yellow", "500")
},
{
path: "M864.45 192a16 16 0 0 0-16-16H584.21a80 80 0 0 0-58.58 25.52L173.88 579.67a16 16 0 0 0 .4 22.22l264.67 264.66a16 16 0 0 0 22.22.4L839 514.84a80 80 0 0 0 25.46-58.53V192zm96 0v264.32a176 176 0 0 1-56 128.76l-377.83 352.1c-44.12 41.13-112.9 39.92-155.55-2.74L106.4 669.78c-42.62-42.62-43.86-111.34-2.81-155.47l351.74-378.18A176 176 0 0 1 584.21 80h264.24c61.86 0 112 50.14 112 112zM713.6 416a80 80 0 1 1 0-160 80 80 0 0 1 0 160z",
fill: "#333333"
}
]
};
export const tvgChannel1 = {
id: "tvgChannel1",
shapes: [
{
path: "M205.89 538.614c208.401-281.889 514.177-332.53 517.236-333.001l5.14-0.813 6.861 31.387-5.288 1.136c-314.754 67.555-494.055 318.753-495.83 321.285l-3.23 4.592-28.005-20.367 3.117-4.22zM650.663 356.751l-0.685 5.427c-0.045 0.373-4.559 38.417 16.388 60.759 10.703 11.411 26.419 16.829 46.956 16.412l5.496-0.13 0.617 28.645-4.996 0.507c-0.378 0.045-2.707 0.256-6.424 0.256-12.352 0-39.902-2.46-61.033-22.306-20.059-18.836-28.735-48.046-25.798-86.818l0.405-5.382 29.073 2.631zM818.133 510.882l-23.712-18.544 36.64-50.134-151.143-161.839 21.19-21.624 169.292 181.011-52.267 71.129zM451.417 266.996v29.812h-263.861l8.324-29.812h255.537zM275.817 402.479v30.274h-126.156l8.428-30.274h117.728zM354.076 334.92v29.861h-185.472l8.324-29.861h177.148zM762.375 672.779c-36.468 0-63.425 14.602-73.157 51.828-8.876 34.029 8.629 51.976 53.032 51.976 29.217 0 46.244-9.234 56.219-23.087h-36.873l10.915-41.783h127.471l-27.47 105.2h-38.471l-5.716-17.055c-27.596 16.822-58.537 23.28-109.971 23.28-62.813 0-145.129-12.669-122.912-97.751 3.727-14.27 9.488-26.576 16.762-37.204l-104.592 128.73h-94.069l-40.024-137.883h-78.139l-35.991 137.883h-89.626l36.004-137.883h-87.614l12.153-46.568 328.225-0.018 18.999 118.335h0.626l80.799-118.335 146.678-0.009c21.277-4.525 43.265-6.22 63.826-6.22 99.749 0 141.312 22.253 135.925 69.641h-101.086c-0.050-9.539-5.167-15.472-12.59-18.719-7.71-3.332-17.608-4.359-29.334-4.359z",
fill: null
}
]
};
export const tvgChannel2 = {
id: "tvgChannel2",
shapes: [
{
path: "M205.89 538.614c208.401-281.889 514.177-332.53 517.236-333.001l5.14-0.813 6.861 31.387-5.288 1.136c-314.754 67.555-494.055 318.753-495.83 321.285l-3.23 4.592-28.005-20.367 3.117-4.22zM650.663 356.751l-0.685 5.427c-0.045 0.373-4.559 38.417 16.388 60.759 10.703 11.411 26.419 16.829 46.956 16.412l5.496-0.13 0.617 28.645-4.996 0.507c-0.378 0.045-2.707 0.256-6.424 0.256-12.352 0-39.902-2.46-61.033-22.306-20.059-18.836-28.735-48.046-25.798-86.818l0.405-5.382 29.073 2.631zM818.133 510.882l-23.712-18.544 36.64-50.134-151.143-161.839 21.19-21.624 169.292 181.011-52.267 71.129zM451.417 266.996v29.812h-263.861l8.324-29.812h255.537zM275.817 402.479v30.274h-126.156l8.428-30.274h117.728zM354.076 334.92v29.861h-185.472l8.324-29.861h177.148zM682.746 676.672c-7.719-3.332-17.631-4.358-29.382-4.358-36.544 0-63.556 14.598-73.308 51.835-8.886 34.028 8.647 51.975 53.14 51.975 29.267 0 46.341-9.232 56.332-23.086h-36.95l10.937-41.787h127.713l-27.516 105.204h-38.542l-5.73-17.053c-27.649 16.817-58.649 23.278-110.188 23.278-62.937 0-145.414-12.669-123.15-97.752 3.731-14.274 9.505-26.584 16.791-37.21l-104.786 128.737h-94.264l-40.089-137.891h-78.295l-36.066 137.891h-89.799l36.066-137.891h-87.783l12.184-46.566 328.858-0.018 19.673 118.33 80.957-118.33 146.962-0.018c21.318-4.515 43.352-6.216 63.945-6.216 99.949 0 141.586 22.253 136.192 69.651h-101.284c-0.044-9.548-5.181-15.475-12.617-18.728zM983.054 817.668h-210.363l0.899-5.543c3.288-20.227 16.361-36.922 42.401-54.095 18.566-12.253 40.052-21.73 59.014-30.096 29.521-13.019 55.030-24.276 58.859-40.291 0.551-2.317 0.155-4.212-1.247-5.954-3.017-3.781-10.25-6.213-18.43-6.213-25.924 0-34.946 16.609-37.944 30.546l-0.822 3.791h-73.431l1.489-5.945c12.928-51.53 54.392-77.653 123.24-77.653 38.098 0 66.44 9.171 79.794 25.827 8.297 10.348 10.724 23.147 7.223 38.042-7.591 32.135-41.434 46.236-74.176 59.886l-5.869 2.451c-8.355 3.523-16.767 6.806-24.783 9.936-2.156 0.842-4.284 1.666-6.382 2.489h92.935l-12.406 52.822z",
fill: null
}
]
};
export const security = {
id: "security",
shapes: [
{
path: "M860.16 643.072c0 112.64-207.258 237.568-348.16 295.526-255.181-103.424-348.16-232.858-348.16-295.526v-442.982c199.68-6.554 299.008-55.91 347.75-96.256 47.514 39.936 147.046 89.702 348.57 96.256v442.368zM905.216 139.264c-323.174 0-377.856-109.158-378.266-110.182-2.458-5.325-8.192-8.806-14.95-9.011-6.554 0-12.288 3.686-15.155 8.806-0.41 1.229-56.32 110.592-378.266 110.592-9.216 0-16.384 6.144-16.384 14.336v488.653c0 200.090 386.662 352.87 403.046 359.219 2.048 1.024 4.096 1.229 6.554 1.229 2.048 0 4.506 0 6.554-1.229 16.384-6.144 403.046-159.13 403.046-359.424v-488.653c0-7.782-7.168-14.336-16.384-14.336z",
fill: null
},
{
path: "M690.995 445.235c6.758-6.758 10.24-15.77 10.24-25.395s-3.482-18.432-10.24-25.395c-13.926-13.926-36.454-13.926-50.381 0l-154.010 163.84-72.704-77.005c-6.144-6.758-15.36-10.24-24.986-10.24-9.421 0-18.432 3.482-25.19 10.24s-10.24 15.77-10.24 25.395 3.482 18.432 10.24 25.395l97.69 107.725c6.758 6.758 15.77 10.24 25.19 10.24 9.626 0 18.432-3.482 25.19-10.24l179.405-194.56z",
fill: "#38ab50"
}
]
};
export const devices = {
id: "devices",
shapes: [
{
path: "M441.049 711.86h-357.359c-8.317 0-15.071-6.496-15.071-15.071v-586.591c0-8.317 6.762-15.588 15.071-15.588h856.626c8.317 0 15.071 7.279 15.071 15.588v128.394c25.211 2.599 48.596 11.175 68.613 24.69v-153.344c0-46.782-37.687-84.47-83.687-84.47h-856.626c-46.262 0.26-83.687 38.206-83.687 84.728v586.591c0 46.782 37.421 84.47 83.687 84.47h287.187v113.316h-45.228c-28.595 0-51.462 23.395-51.462 51.98s22.87 51.98 51.462 51.98h144.243c-18.188-25.995-28.595-57.179-28.595-90.964v-195.445z",
fill: null
},
{
path: "M729.006 945.77v-74.591h-150.744v-477.693c0-10.397 7.797-18.188 18.188-18.188h340.467c10.397 0 18.188 7.797 18.188 18.188v148.144h25.995c15.588 0 30.148 4.413 42.879 11.694v-159.838c0-48.079-38.985-87.328-86.811-87.328h-340.992c-47.82 0-86.545 38.985-86.545 87.062v514.598c0 48.079 38.985 87.328 86.811 87.328h148.144c-9.362-13.515-15.588-32.488-15.588-49.381z",
fill: "#38ab50"
},
{
path: "M897.938 968.381c-4.679 0-9.095-2.080-12.22-5.198-3.637-3.119-5.977-7.797-5.977-12.996 0-10.397 7.797-18.188 18.188-18.188 9.879 0 18.188 7.797 18.188 18.188 0 5.198-2.599 9.879-5.977 12.996s-7.797 5.198-12.22 5.198zM823.347 911.467v-274.969h149.181v274.718h-149.181zM981.112 584.77h-166.335c-23.395 0-42.879 19.492-42.879 43.405v317.596c0 24.171 19.232 43.663 42.879 43.663h166.335c23.395 0 42.879-19.492 42.879-43.405v-317.855c0-23.912-19.232-43.145-42.879-43.145z",
fill: null
}
]
};
export const tickets = {
id: "tickets",
shapes: [
{
path: "M237.158 241.664h57.344v29.082c0 13.926 0 28.262 28.672 28.262 28.262 0 28.262-14.336 28.262-28.262v-28.672h114.278v28.672c0 13.926 0 28.262 28.672 28.262s28.672-14.336 28.672-28.262v-28.672h114.278v28.672c0 13.926 0 28.262 28.672 28.262s28.672-14.336 28.672-28.262v-28.672h114.074v28.672c0 13.926 0 28.262 28.262 28.262 28.672 0 28.672-14.336 28.672-28.262v-28.672h57.344v685.67h-57.344v-28.672s0-28.672-28.672-28.672-27.853 28.672-27.853 28.672l-0.614 28.672h-114.688v-28.672s0-28.672-28.672-28.672c-28.262 0-27.648 28.672-27.648 28.672v28.672h-115.098l-0.614-28.672s0.614-28.672-28.262-28.672c-28.672 0-28.262 28.672-28.262 28.672v28.672h-114.278v-28.672s0-28.672-28.672-28.672-28.672 28.672-28.672 28.672v28.672h-56.115v-686.080zM494.387 356.352c-27.853 0-57.344 0-86.016-28.672-28.262 28.672-56.934 28.672-85.402 28.672h-28.672v457.114h28.672c28.672 0 57.344 0 85.606 28.672 28.672-28.672 57.344-28.672 85.402-28.672 28.262 0 57.344 0 86.016 28.672 28.672-28.672 57.958-28.672 86.016-28.672 27.648 0 56.934 0 85.606 28.672 28.672-28.672 57.754-28.672 85.606-28.672h28.672v-457.114h-28.672c-28.672 0-57.344 0-85.606-28.672-28.672 28.672-57.344 28.672-85.402 28.672-28.262 0-57.344 0-86.016-28.672-28.672 28.672-57.958 28.672-86.016 28.672z",
fill: null
},
{
path: "M493.978 756.326l314.778 0.819v-57.958l-315.187-0.819zM351.437 584.909h457.523v-57.344h-457.728zM351.437 470.63h457.523v-57.344h-457.728z",
fill: "#38ab50"
},
{
path: "M788.48 222.003v-140.083h-57.344v28.672c0 14.336 0 28.672-28.672 28.672s-28.672-14.336-28.672-28.672v-28.672h-114.074v28.672c0 14.336 0 28.672-28.672 28.672s-28.672-14.336-28.672-28.672v-28.672h-114.278v28.672c0 14.336 0 28.672-28.672 28.672s-28.672-14.336-28.672-28.672v-28.672h-113.664v28.672c0 14.336 0 28.672-28.672 28.672s-28.672-14.336-28.672-28.672v-28.672h-57.344v686.080h57.344v-28.672s0-28.672 28.672-28.672c2.867 0 5.734 0.41 8.192 1.024v-58.368h-36.864v-456.704h28.672c28.262 0 56.934 0 85.402-28.672 28.672 28.672 57.958 28.672 86.016 28.672 27.648 0 56.934 0 85.402-28.672 28.672 28.672 57.958 28.672 86.016 28.672 28.672 0 56.934 0 85.606-28.672 28.672 28.672 57.344 28.672 85.606 28.672h28.672v25.805h57.344z",
fill: null
}
]
};
export const replays = {
id: "replays",
shapes: [
{
path: "M512 869.581c197.427 0 357.581-160.154 357.581-357.581s-160.154-357.581-357.581-357.581-357.581 160.154-357.581 357.581 160.154 357.581 357.581 357.581zM512 921.6c-226.304 0-409.6-183.296-409.6-409.6s183.296-409.6 409.6-409.6 409.6 183.296 409.6 409.6-183.296 409.6-409.6 409.6z",
fill: null
},
{
path: "M414.106 658.637l242.688-146.637-242.688-146.637z",
fill: "#38ab50"
}
]
};
export const talentShape = {
id: "talentShape",
shapes: [
{
path: "M850.455 758.809c4.907-1.397 9.988-2.811 15.242-4.243 5.6-1.526 11.050-2.977 16.348-4.354l0 0c16.916-4.394 34.229 5.598 38.887 22.444l38.216 138.268c4.708 17.028-5.274 34.651-22.3 39.367-5.568 1.558-11.139 3.101-16.71 4.644-5.163 1.43-9.883 2.734-14.161 3.912l-0.001-0.002c-17.025 4.687-34.627-5.304-39.333-22.323l-38.27-138.408c-4.685-16.942 5.174-34.492 22.081-39.304zM512.147 479.825c-114.875 0-208-93.086-208-207.913s93.125-207.913 208-207.913c114.875 0 208 93.086 208 207.913s-93.125 207.913-208 207.913zM512.147 383.866c61.856 0 112-50.123 112-111.953s-50.144-111.953-112-111.953c-61.856 0-112 50.123-112 111.953s50 .144 111.953 112 111.953zM268.739 623.648c0.306-0.105 0.611-0.22 0.914-0.344-0.099 0.041-0.197 0.081-0.295 0.122l-0.618 0.222zM233.038 679.146c-2.891 10.4-27.655 96.308-74.293 257.725-4.535 15.697-20.168 25.456-36.262 22.638-7.854-1.375-15.4-2.878-22.64-4.508-3.452-0.777-6.842-1.502-10.172-2.175-17.323-3.501-28.528-20.382-25.027-37.705 0.081-0.399 0.169-0.797 0.265-1.193 37.957-156.723 59.287-243.547 63.991-260.471 15.75-56.661 32.557-97.728 85.478-119.51 9.645-3.955 38.753-5.993 49.182-5.993h316.781c17.673 0 32 14.327 32 32 0 5.327 0 10.653 0 15.98s0 10.653 0 15.98c0 17.673-14.327 32-32 32l-298.971-0.006c-9.727 0-18.927 4.424-25 12.022-11.569 14.472-19.346 28.878-23.332 43.218zM497.629 834.366l322.069-321.933c9.362-9.358 24.54-9.358 33.902 0l33.902 33.888c9.362 9.358 9.362 24.53 0 33.888l-372.921 372.765c-9.362 9.358-24.54 9.358-33.902 0l-169.51-169.439c-9.362-9.358-9.362-24.53 0-33.888l33.902-33.888c9.362-9.358 24.54-9.358 33.902 0l118.657 118.607z",
fill: null
}
]
};
export const talent = {
id: "talent",
shapes: [
{
path: "M850.455 758.809c4.907-1.397 9.988-2.811 15.242-4.243 5.6-1.526 11.050-2.977 16.348-4.354l0 0c16.916-4.394 34.229 5.598 38.887 22.444l38.216 138.268c4.708 17.028-5.274 34.651-22.3 39.367-5.568 1.558-11.139 3.101-16.71 4.644-5.163 1.43-9.883 2.734-14.161 3.912l-0.001-0.002c-17.025 4.687-34.627-5.304-39.333-22.323l-38.27-138.408c-4.685-16.942 5.174-34.492 22.081-39.304zM512.147 479.825c-114.875 0-208-93.086-208-207.913s93.125-207.913 208-207.913c114.875 0 208 93.086 208 207.913s-93.125 207.913-208 207.913zM512.147 383.866c61.856 0 112-50.123 112-111.953s-50.144-111.953-112-111.953c-61.856 0-112 50.123-112 111.953s50.144 111.953 112 111.953zM268.739 623.648c0.306-0.105 0.611-0.22 0.914-0.344-0.099 0.041-0.197 0.081-0.295 0.122l-0.618 0.222zM233.038 679.146c-2.891 10.4-27.655 96.308-74.293 257.725-4.535 15.697-20.168 25.456-36.262 22.638-7.854-1.375-15.4-2.878-22.64-4.508-3.452-0.777-6.842-1.502-10.172-2.175-17.323-3.501-28.528-20.382-25.027-37.705 0.081-0.399 0.169-0.797 0.265-1.193 37.957-156.723 59.287-243.547 63.991-260.471 15.75-56.661 32.557-97.728 85.478-119.51 9.645-3.955 38.753-5.993 49.182-5.993h316.781c17.673 0 32 14.327 32 32 0 5.327 0 10.653 0 15.98s0 10.653 0 15.98c0 17.673-14.327 32-32 32l-298.971-0.006c-9.727 0-18.927 4.424-25 12.022-11.569 14.472-19.346 28.878-23.332 43.218zM497.629 834.366l322.069-321.933c9.362-9.358 24.54-9.358 33.902 0l33.902 33.888c9.362 9.358 9.362 24.53 0 33.888l-372.921 372.765c-9.362 9.358-24.54 9.358-33.902 0l-169.51-169.439c-9.362-9.358-9.362-24.53 0-33.888l33.902-33.888c9.362-9.358 24.54-9.358 33.902 0l118.657 118.607z",
fill: null
}
]
};
export const talent20 = {
id: "talent20",
shapes: [
{
path: "M852.567 724.24l9.44-2.388 14.055-3.652c13.457-3.497 27.245 4.387 31.057 17.758l51.687 181.296c3.864 13.553-3.953 27.68-17.489 31.606l-15.558 4.512-11.665 2.629c-13.36 3.011-26.724-5.026-30.327-18.239l-49.62-181.969c-3.72-13.64 4.323-27.714 17.963-31.433 0.152-0.041 0.304-0.081 0.456-0.12zM512 479.825c-114.875 0-208-93.086-208-207.913s93.125-207.913 208-207.913c114.875 0 208 93.086 208 207.913s-93.125 207.913-208 207.913zM512 403.178c72.526 0 131.32-58.769 131.32-131.265s-58.794-131.265-131.32-131.265c-72.526 0-131.32 58.769-131.32 131.265s58.794 131.265 131.32 131.265zM268.592 623.648c0.306-0.105 0.611-0.22 0.914-0.344-0.099 0.041-0.197 0.081-0.295 0.122l-0.618 0.222zM205.249 676.322c-2.915 10.488-25.779 98.040-68.59 262.657l-0.005-0.001c-3.427 13.178-16.573 21.366-29.912 18.631-4.271-0.876-8.838-1.861-13.702-2.956-3.177-0.715-6.184-1.39-9.020-2.023l0.001-0.003c-13.797-3.083-22.482-16.766-19.399-30.563 0.033-0.147 0.067-0.295 0.103-0.441 39.211-161.949 61.21-251.534 65.997-268.754 15.75-56.661 21.606-97.728 74.527-119.51 9.645-3.955 49.704-5.993 60.133-5.993h384.644c14.138 0 25.6 11.462 25.6 25.6 0 3.293 0 6.586 0 9.879 0 5.168 0 10.335 0 15.503 0 14.125-11.441 25.581-25.566 25.6l-399.515 0.526c-9.985 0.013-19.052 5.83-23.225 14.901-10.508 22.837-17.864 41.82-22.070 56.95zM497.994 859.491l340.634-340.956c7.489-7.486 19.632-7.486 27.122 0l27.122 27.11c7.489 7.486 7.489 19.624 0 27.11l-381.317 381.621c-7.489 7.486-19.632 7.486-27.122 0l-176.393-176.517c-7.489-7.486-7.489-19.624 0-27.11l27.122-27.11c7.489-7.486 19.632-7.486 27.122 0l135.711 135.852z",
fill: null
}
]
};
export const videoReplay = {
id: "talentShape",
shapes: [
{
path: "M160 160v704h704v-704h-704zM96 64h832c17.673 0 32 14.327 32 32v832c0 17.673-14.327 32-32 32h-832c-17.673 0-32-14.327-32-32v-832c0-17.673 14.327-32 32-32zM64 560v-96h896v96h-896zM254.773 70.639h96v882.723h-96v-882.723zM673.605 70.639h96v882.723h-96v-882.723zM79.693 359.926v-96h240.307v96h-240.307zM79.693 760.22v-96h240.307v96h-240.307zM704 359.926v-96h240.307v96h-240.307zM704 760.22v-96h240.307v96h-240.307z",
fill: null
}
]
};
export const noVideoReplay = {
id: "talent",
shapes: [
{
path: "M259.545 758.278h-99.585v105.768h99.585v-105.768zM259.545 662.278v-103.941h-99.585v103.941h99.585zM260.231 463.040l93.16 95.439v305.568h309.531l96.882 96-663.843-0.232c-17.673 0-32-14.327-32-32l-0-658.968 96 95.823v97.668l100.27-0v0.702zM767.077 262.938h96.883v-102.892h-95.669l-1.214 102.892zM765.944 358.938l-1.22 103.399 99.237-0v-103.399h-98.016zM763.598 557.699l-0.008 0.639-90.166-89.43v-308.861h-311.686l-96.882-96 663.104-0c17.673 0 32 14.327 32 32l0 660.892-96-97.012v-101.589h-100.362v-0.639zM987.064 963.195l-23.903 23.891c-12.496 12.494-32.755 12.494-45.251 0l-871.544-871.38c-12.498-12.496-12.5-32.757-0.004-45.255 0.001-0.001 0.003-0.003 0.004-0.004l23.907-23.888c12.496-12.494 32.755-12.494 45.251 0l871.544 871.38c12.498 12.496 12.5 32.757 0.004 45.255-0.001 0.001-0.003 0.003-0.004 0.004l-0.004-0.004z",
fill: null
}
]
};
export const trackMasterPick = {
id: "talent",
shapes: [
{
path: "M461.972 391.25h-87.25l-52.5 302.75h-72l52.5-302.75h-86l10.75-61.25h245.25l-10.75 61.25zM579.778 330l21.25 261.75 111.75-261.75h94.5l-63.25 364h-72l17.5-100.75 31.5-143.75-111.5 244.5h-48.75l-27.5-252.75-20.75 156.75-16.5 96h-71.75l63-364h92.5zM544.366 893.805c250.524 0 448.341-175.105 448.341-383.414s-197.816-383.414-448.341-383.414c-250.524 0-448.341 175.105-448.341 383.414s197.816 383.414 448.341 383.414zM512.137 958.543c-282.845 0-512.137-199.924-512.137-446.543s229.291-446.543 512.137-446.543c282.845 0 512.137 199.924 512.137 446.543s-229.291 446.543-512.137 446.543z",
fill: null
}
]
};
export const medal = {
id: "medal",
shapes: [
{
path: "M512 864.226c106.039 0 192-85.961 192-192s-85.961-192-192-192c-106.039 0-192 85.961-192 192s85.961 192 192 192zM593.321 329.666c-26.104-6.173-53.331-9.44-81.321-9.44-8.141 0-16.218 0.276-24.222 0.82l137.024-240.864c8.739-15.361 28.276-20.73 43.637-11.991l27.814 15.823c15.361 8.739 20.73 28.276 11.991 43.637l-114.923 202.015zM369.185 350.403c-29.585 13.148-57.020 30.256-81.633 50.651l-155.534-273.403c-8.739-15.361-3.37-34.898 11.991-43.637l27.814-15.823c15.361-8.739 34.898-3.37 43.637 11.991l153.724 270.221zM736.325 400.953c-24.621-20.383-52.064-37.479-81.654-50.613l153.688-270.157c8.739-15.361 28.276-20.73 43.637-11.991l27.814 15.823c15.361 8.739 20.73 28.276 11.991 43.637l-155.477 273.301zM512 960.226c-159.058 0-288-128.942-288-288s128.942-288 288-288c159.058 0 288 128.942 288 288s-128.942 288-288 288zM496 544.226c-17.673 0-32 14.327-32 32v192c0 17.673 14.327 32 32 32h32c17.673 0 32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-32zM355.845 68.684c0.031-0.017 0.061-0.035 0.092-0.052 15.39-8.688 34.909-3.255 43.597 12.135l76.096 134.797-55.17 94.214-104.176-181.645c-0.019-0.032-0.037-0.065-0.055-0.097-8.739-15.361-3.37-34.898 11.991-43.637l27.625-15.715z",
fill: null
}
]
};
export const fileDownload = {
id: "fileDownload",
shapes: [
{
path: "M800 590a32 32 0 0132 32v188.2l55.4-55.5a32 32 0 0145.3 0l22.6 22.7a32 32 0 010 45.2L818 960a48 48 0 01-67.8 0L612.7 822.6a32 32 0 010-45.2l22.6-22.7a32 32 0 0145.3 0l55.4 55.5V622a32 32 0 0132-32zM560 64c12.7 0 25 5 34 14l224 224c9 9 14 21.3 14 34v144a32 32 0 01-32 32h-32a32 32 0 01-32-32v-96H560a48 48 0 01-48-48V160H176a16 16 0 00-16 16v672a16 16 0 0016 16h240a32 32 0 0132 32v32a32 32 0 01-32 32H176A112 112 0 0164 848V176A112 112 0 01176 64zm48 163.9V288h60.1L608 227.9z",
fill: null
}
]
};
export const pdf = {
id: "pdf",
shapes: [
{
path: "M176 112v799.897l671.839-1.437v-632.293l-153.294-166.167h-518.544zM128 80c0-8.837 7.163-16 16-16h564.561c4.467 0 8.731 1.868 11.76 5.151l171.278 185.661c2.726 2.955 4.24 6.828 4.24 10.849v676.731c0 8.823-7.143 15.981-15.966 16l-735.839 1.573c-8.871 0-16.034-7.163-16.034-16v-863.966zM77.962 439.79h672c8.837 0 16 7.163 16 16v288c0 8.837-7.163 16-16 16h-672c-8.837 0-16-7.163-16-16v-288c0-8.837 7.163-16 16-16zM176.587 695.79h37v-69.125h24.125c16.75 0 29.542-0.875 38.375-2.625 6.5-1.417 12.896-4.312 19.188-8.687s11.479-10.396 15.562-18.063c4.083-7.667 6.125-17.125 6.125-28.375 0-14.583-3.542-26.479-10.625-35.688s-15.875-15.187-26.375-17.938c-6.833-1.833-21.5-2.75-44-2.75h-59.375v183.25zM213.587 543.54h17.875c13.333 0 22.208 0.417 26.625 1.25 6 1.083 10.958 3.792 14.875 8.125s5.875 9.833 5.875 16.5c0 5.417-1.396 10.167-4.188 14.25s-6.646 7.083-11.562 9c-4.917 1.917-14.667 2.875-29.25 2.875h-20.25v-52zM347.212 512.54v183.25h69.625c13.667 0 24.583-1.292 32.75-3.875 10.917-3.5 19.583-8.375 26-14.625 8.5-8.25 15.042-19.042 19.625-32.375 3.75-10.917 5.625-23.917 5.625-39 0-17.167-2-31.604-6-43.312s-9.833-21.604-17.5-29.688c-7.667-8.083-16.875-13.708-27.625-16.875-8-2.333-19.625-3.5-34.875-3.5h-67.625zM384.212 543.54h16.625c15.083 0 25.208 0.583 30.375 1.75 6.917 1.5 12.625 4.375 17.125 8.625s8 10.167 10.5 17.75c2.5 7.583 3.75 18.458 3.75 32.625s-1.25 25.354-3.75 33.563c-2.5 8.208-5.729 14.104-9.688 17.688s-8.937 6.125-14.937 7.625c-4.583 1.167-12.042 1.75-22.375 1.75h-27.625v-121.375zM532.462 695.79h37v-77.875h76.5v-31h-76.5v-43.375h88.625v-31h-125.625v183.25z",
fill: null
}
]
};
export const curvedArrow = {
id: "curvedArrow",
shapes: [
{
path: "M736.339 999.331c-81.488-65.987-214.7-181.888-401.414-347.536l-187.34-170.972c-25.261-23.667-45.344-41.536-59.674-56.351-6.956-5.633-12.134-11.431-17.311-17.229l-7.95-6.438c-1.988-1.609-3.19-4.189-6.38-8.377-6.428-16.444-8.465-26.121-6.943-36.128 0.736-9.037 4.037-19.209 10.319-26.966 2.356-2.909 4.711-5.818 7.276-6.953s4.92-4.044 7.276-6.953c5.914-3.239 11.827-6.478 21.299-10.047l63.897-30.14 200.425-84.952c237.318-100.032 369.086-157.093 399.648-172.483 13.606-6.643 28.832-7.158 42.904-2.184 15.066 5.778 25.997 14.63 34.781 28.165s11.238 26.761 6.575 40.646c-3.877 12.916-10.736 23.417-22.563 29.895-52.855 24.632-187.972 83.797-408.126 176.856l-119.941 50.583c272.709 93.997 556.987 171.675 849.069 231.589 293.861 59.749 590.188 102.229 890.761 127.274s596.030 21.866 889.353-7.125c292.329-29.796 557.987-87.612 795.98-174.253 12.821-5.673 26.476-4.249 41.751 3.304 14.281 6.748 25.421 17.374 33.211 30.105 7.005 13.7 7.68 27.091 2.023 40.171-4.662 13.885-14.294 23.747-27.323 27.646-245.685 90.045-520.029 150.461-822.247 180.276s-607.564 33.016-917.24 7.020c-309.676-25.995-614.322-70.394-913.937-133.197s-589.439-141.76-866.908-238.007c45.344 41.536 97.645 88.705 154.129 140.867 183.942 165.009 315.952 278.33 396.446 343.513 12.919 10.461 19.715 22.387 22.377 37.387s-1.215 27.916-9.853 38.582c-8.637 10.666-20.465 17.144-35.69 17.659-11.668 0.185-25.74-4.788-38.659-15.25z",
fill: null
}
]
};
export const handicapping = {
id: "handicapping",
shapes: [
{
path: "M160.192 864.384h767.808c17.673 0 32 14.327 32 32v0 32c0 17.673-14.327 32-32 32v0h-832c-17.673 0-32-14.327-32-32v0-32c-0.003-0.176-0.005-0.383-0.005-0.59 0-1.258 0.072-2.499 0.211-3.719l-0.014 0.149v-795.392c0-17.673 14.327-32 32-32v0h32c17.673 0 32 14.327 32 32v0 767.552zM256.32 738.816v-245.312c0-8.448 3.904-16.384 10.624-21.504l2.112-1.6c5.297-4.035 12.008-6.464 19.285-6.464 0.015 0 0.030 0 0.045 0l-0.002-0h31.808c0.013-0 0.028-0 0.043-0 7.277 0 13.988 2.429 19.364 6.521l-0.078-0.057 2.112 1.6c6.72 5.12 10.688 13.056 10.688 21.504v245.312c0 0.005 0 0.011 0 0.016 0 8.745-4.166 16.517-10.622 21.44l-0.066 0.048-2.112 1.6c-5.297 4.035-12.008 6.464-19.285 6.464-0.015 0-0.030-0-0.045-0l0.002 0h-31.808c-0.013 0-0.028 0-0.043 0-7.277 0-13.988-2.429-19.364-6.521l0.078 0.057-2.112-1.6c-6.485-4.972-10.624-12.722-10.624-21.439 0-0.023 0-0.046 0-0.068l-0 0.004zM448.32 738.816v-388.736c0-8.384 3.904-16.384 10.624-21.44l2.112-1.6c5.302-4.065 12.028-6.518 19.326-6.528l0.002-0h31.808c7.3 0.010 14.026 2.463 19.405 6.584l-0.077-0.056 2.112 1.6c6.72 5.12 10.688 13.056 10.688 21.44v388.8c0 0.005 0 0.011 0 0.016 0 8.745-4.166 16.517-10.622 21.44l-0.066 0.048-2.112 1.6c-5.297 4.035-12.008 6.464-19.285 6.464-0.015 0-0.030-0-0.045-0l0.002 0h-31.808c-0.013 0-0.028 0-0.043 0-7.277 0-13.988-2.429-19.364-6.521l0.078 0.057-2.112-1.6c-6.485-4.972-10.624-12.722-10.624-21.439 0-0.023 0-0.046 0-0.068l-0 0.004zM640.32 738.816v-291.904c0-8.448 3.904-16.384 10.624-21.504l2.112-1.6c5.302-4.065 12.028-6.518 19.326-6.528l0.002-0h31.808c7.3 0.010 14.026 2.463 19.405 6.584l-0.077-0.056 2.112 1.6c6.72 5.12 10.688 13.056 10.688 21.504v291.904c0 0.005 0 0.011 0 0.016 0 8.745-4.166 16.517-10.622 21.44l-0.066 0.048-2.112 1.6c-5.297 4.035-12.008 6.464-19.285 6.464-0.015 0-0.030-0-0.045-0l0.002 0h-31.808c-0.013 0-0.028 0-0.043 0-7.277 0-13.988-2.429-19.364-6.521l0.078 0.057-2.112-1.6c-6.485-4.972-10.624-12.722-10.624-21.439 0-0.023 0-0.046 0-0.068l-0 0.004zM832.512 732.416v-440.768c0.022-8.27 3.178-15.799 8.343-21.465l-0.023 0.025 3.52-3.968c5.877-6.493 14.336-10.556 23.743-10.56l24.897-0c9.408 0.004 17.867 4.067 23.72 10.533l0.024 0.027 3.584 3.968c5.083 5.642 8.192 13.149 8.192 21.382 0 0.020-0 0.041-0 0.061l0-0.003v440.896c0 0.017 0 0.038 0 0.058 0 8.233-3.109 15.74-8.218 21.411l0.025-0.029-3.584 3.904c-5.877 6.493-14.336 10.556-23.743 10.56l-24.897 0c-9.408-0.004-17.867-4.067-23.72-10.533l-0.024-0.027-3.584-3.904c-5.119-5.648-8.253-13.178-8.256-21.439l-0-0.001z",
fill: null,
grid: 0
}
]
};
export const sorting = {
id: "sorting",
shapes: [
{
path: "M85.312 192h853.376c11.776 0 21.312 9.6 21.312 21.312v53.376c0 11.776-9.6 21.312-21.312 21.312h-853.376c-11.77 0-21.312-9.542-21.312-21.312v0-53.376c0-11.712 9.6-21.312 21.312-21.312zM85.312 464h597.376c11.776 0 21.312 9.6 21.312 21.312v53.376c0 11.776-9.6 21.312-21.312 21.312h-597.376c-11.77 0-21.312-9.542-21.312-21.312v0-53.376c0-11.712 9.6-21.312 21.312-21.312zM85.312 736h469.376c11.776 0 21.312 9.6 21.312 21.312v53.376c0 11.776-9.6 21.312-21.312 21.312h-469.376c-11.77 0-21.312-9.542-21.312-21.312v-53.376c0-11.712 9.6-21.312 21.312-21.312z",
fill: null,
grid: 0
}
]
};
export const contests = {
id: "contests",
shapes: [
{
path: "M512 1024C229.23 1024 0 794.77 0 512S229.23 0 512 0s512 229.23 512 512-229.23 512-512 512zm0-96c229.75 0 416-186.25 416-416S741.75 96 512 96 96 282.25 96 512s186.25 416 416 416zm-16-704h32a32 32 0 0 1 32 32v19.88c43.07 9.6 81.64 32.1 106.64 64.4 5.4 7 2.97 16.9-4.57 21.52l-54.6 33.38c-7.54 4.6-17.42 2.13-23.96-3.82-12.75-11.6-33.33-21.85-60.17-24.22-64.43-5.7-82.46 24.26-83.92 40.76-1.49 16.8 2.38 26.2 8.5 32.57 7.2 7.48 25.03 18.58 66.96 22.3 54.2 4.79 98.23 20.73 127.7 51.38 30.52 31.75 38.11 71.54 34.92 107.56-5.85 66.1-54.18 109.13-117.5 123.54V768a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-22.14c-44.16-9.26-83.83-32.01-109.35-65-5.4-6.98-2.97-16.9 4.57-21.5l54.6-33.39c7.54-4.6 17.42-2.12 23.96 3.82 12.75 11.61 33.34 21.85 60.18 24.23 64.42 5.7 82.46-24.27 83.92-40.77 1.48-16.79-2.38-26.2-8.51-32.57-7.2-7.48-25.03-18.58-66.95-22.29-54.21-4.8-98.24-20.74-127.7-51.38-30.53-31.76-38.12-71.55-34.93-107.57C349.72 332.4 399.36 289.09 464 275.3V256a32 32 0 0 1 32-32z",
fill: null,
grid: 0
}
]
};
export const store = {
id: "store",
shapes: [
{
path: "M189.135 620.549c17.673 0 32 14.327 32 32l-.015 211.771h580.864l.002-211.771c0-17.673 14.327-32 32-32h31.885c17.673 0 32 14.327 32 32V928c0 17.673-14.327 32-32 32h-63.885l-.002-.256H221.12l.015.256H157.25c-17.673 0-32-14.327-32-32V652.549c0-17.673 14.327-32 32-32h31.885zM859.294 64c14.52 0 27.219 9.775 30.935 23.81l5.707 21.694 58.769 214.592c21.439 101.238-22.869 180.801-121.21 199.486l-11.586 1.884c-74.231 10.1-143.177-6.348-175.826-42.193l.509.503-1.069.057c-33.832 33.667-79.313 40.602-121.921 43.57l-11.602.732c-45.798-2.656-96.599-7.557-133.523-44.302l-1.133-.057-6.431 6.405c-34.861 31.012-99.54 44.712-168.822 35.285-106.421-14.481-155.06-96.238-132.796-201.37l44.932-164.163 19.823-72.385C137.858 73.642 150.496 64 164.914 64h694.38zm-48.99 95.872H213.632l-51.069 186.354c-10.704 50.684-1.118 76.793 60.53 85.636 61.649 8.843 106.041 0 106.041-64.174v-4.6c0-17.674 14.327-32 32-32h31.885c17.673 0 32 14.326 32 32v4.6c0 60.796 57.355 63.996 83.013 64.164h7.931c25.609-.168 82.494-3.368 82.494-64.164l-.377 6.008.009-10.608c0-17.674 14.327-32 32-32h31.885a31.878 31.878 0 0121.159 7.993c3.97 2.609 6.833 6.691 8.602 12.243 1.531 4.074 2.239 7.836 2.239 11.764l-.042 8.221c1.691 60.884 46.505 69.227 106.975 60.553 61.648-8.843 71.234-34.952 60.53-85.636l-51.133-186.354z",
fill: null,
grid: 0
}
]
};
export const question = {
id: "question",
shapes: [
{
path: "M512 1024C229.23 1024 0 794.77 0 512S229.23 0 512 0s512 229.23 512 512-229.23 512-512 512zm0-96c229.75 0 416-186.25 416-416S741.75 96 512 96 96 282.25 96 512s186.25 416 416 416zm-56.85-316.75c0-34.07 3.85-60.96 11.55-80.67s20.18-36.81 37.45-51.28 30.4-27.7 39.38-39.72S557 414.32 557 399.85c0-35.23-15.17-52.85-45.5-52.85-14 0-25.32 5.13-33.95 15.4s-13.18 24.15-13.65 41.65H345.6c.47-46.67 15.17-83 44.1-109.03S459.23 256 511.5 256c52.03 0 92.34 12.02 120.93 36.05s42.87 58.22 42.87 102.55c0 19.37-3.85 36.98-11.55 52.85s-20.07 32.08-37.1 48.65l-40.25 37.45c-11.43 10.97-19.37 22.23-23.8 33.77s-6.88 26.2-7.35 43.93zm-14.35 106.4c0-17.27 6.24-31.44 18.72-42.52s28.06-16.63 46.73-16.63 34.24 5.54 46.73 16.63 18.72 25.25 18.72 42.52-6.24 31.44-18.73 42.52-28.05 16.63-46.72 16.63-34.24-5.54-46.73-16.63-18.72-25.25-18.72-42.52z",
fill: null,
grid: 0
}
]
};
export const greyhounds = {
id: "greyhounds",
shapes: [
{
path: "M313.86 760.6a16 16 0 0 0 6.72 21.26l52.14 28.07a16.02 16.02 0 0 0 12.41 1.16 15.99 15.99 0 0 0 9.48-8.1c30.75-61.5 77-111.72 131.34-150.53 23.67-16.91 50.7-20.57 78.8-13.6 55.72 15.92 111.93 31.97 164.25 44.08 28.84 9.31 65.64 4.36 93.39-14.15 5.47-3.64 8.13-4.79 9.21-5.15.42-.14.6-.15.6-.15s.17-.02.45-.03c34.64 4 65.53-8.1 88.3-32.08h7.47l4.68-4.69c6.58-6.58 10.6-15.35 13-23.15a84.73 84.73 0 0 0 3.72-24.26c0-22.13-11.35-38.76-26.95-49.25l-28.9-20.64-1.12-.56c-7.22-3.61-14.59-8.2-22.74-13.3l-.31-.2c-7.75-4.83-16.24-10.14-24.88-14.47-58.87-31.42-111.73-69.63-145.61-129.66-19.19-38-57.2-56.6-94.33-56.6-35.8 0-67.32-14.28-88.11-38.53l-.4-.47-.44-.43c-25.64-25.64-59.47-46.8-93.34-59.6-32.8-15.17-60.06-15.98-81.7-8.34-20.77 7.33-34.25 21.7-41.81 33.83-14.82 17.95-27.82 38.35-39.57 56.8-4.44 6.98-8.71 13.67-12.83 19.85l-15.3 22.96c-6.26 6.97-11.45 18.27-11.45 30.03v.9c-2.34 6.88-1.9 13.48-.52 19.02.55 2.22 1.3 4.38 2.1 6.4-39.38 22.7-75.73 48.57-111.87 77.48-20.1 16.08-39.64 31.7-63.05 47.3L58.2 522.15a16 16 0 0 0-5.77 18.4l20.05 56.15a16 16 0 0 0 22.23 8.93c2.3-1.16 3.86-1.75 5.79-2.5.76-.28 1.58-.6 2.52-.97a34.54 34.54 0 0 0 10.05-5.85l26.54-15.16.54-.32.66-.45c23.86-15.9 48.48-32.32 73.16-52.87 39.96-31.96 75-59.16 117.6-82.43 13.31-6.68 26.86-16.05 37.34-23.3 2.9-2 5.56-3.85 7.92-5.43l19.73-11.81.64-.43c17.87-11.92 23.8-34.25 19.08-51.95-.62-11.36-5.44-21.18-13.95-28a41.8 41.8 0 0 0-14.46-7.38l3.37-5.58 4.73-7.82c6.8-11.16 13.22-21.23 20.35-30.23l.91-.93c.29.05.63.11 1.03.2 2.2.51 5.73 1.72 11.02 4.37l.25.12c24.29 12.14 45.9 23.12 63.77 40.99 42.98 42.98 94.76 64.52 150.45 68.8l.61.05h.62c9.33 0 14 2.3 15.88 3.62l.2.14v1l2.57 3.97c45.53 70.37 107.77 128.55 182.72 166.03a213.84 213.84 0 0 1 22.74 13.1c-20.55 1.6-41.18 9.44-55.91 22.55-3.27.9-5.67 1.21-7.8 1.21-2.74 0-5.98-.52-10.97-2.19l-.36-.1c-30.08-9.26-60.88-17.38-92.1-25.61-22.64-5.97-45.5-12-68.47-18.56-57.25-17.56-114.28-4.27-157.85 26.13-70.6 45.74-124.52 108.07-161.77 182.57z",
fill: null,
grid: 0
}
]
};
export const horse = {
id: "horse",
shapes: [
{
path: "M544 256c-160 32-384 192-384 480l384 192-32-384c25.6 128 170.667 138.667 224 128l96 64c51.2-25.6 42.667-96 32-128-32-10.667-64-96-96-192-20.239-60.716-85.333-138.667-128-192v-96l-96 128z",
fill: null
},
{
path: "M655.179 82.466C674.779 89 688 107.342 688 128.003v79.117c19.201 23.881 42.372 52.72 63.451 82.189 24.652 34.464 49.575 73.983 62.086 111.515 16.014 48.041 31.283 91.079 46.045 123.064 7.408 16.05 13.884 27.522 19.237 34.883 1.998 2.746 3.422 4.343 4.229 5.173a48.001 48.001 0 0126.489 28.88c6.956 20.869 13.293 53.715 9.331 87.217-4.05 34.24-20.263 76.325-65.402 98.895a48.003 48.003 0 01-48.092-2.994l-80.861-53.908c-34.829 3.199-82.507-.082-127.795-17.098a242.269 242.269 0 01-24.017-10.522l19.133 229.603a47.998 47.998 0 01-20.924 43.733 47.999 47.999 0 01-48.376 3.186l-384-192A48 48 0 01112 736.003c0-305.787 229.723-479.631 404.209-522.945L601.6 99.203c12.396-16.528 33.979-23.27 53.579-16.737zM604.063 255.92l-32.666 43.555-17.983 3.597c-138.258 27.652-330.086 162.684-344.545 403.701l280.204 140.102-24.907-298.885c-2.113-25.357 15.928-47.957 41.123-51.514 25.195-3.558 48.789 13.164 53.779 38.115 8.743 43.713 36.523 67.371 71.414 80.48 37.047 13.919 77.475 13.591 96.104 9.865a48.003 48.003 0 0136.04 7.13l60.398 40.266c.191-1.129.36-2.316.508-3.566 1.188-10.039.366-20.955-1.321-30.45-8.842-7.414-15.777-15.856-21.03-23.08-10.647-14.639-20.171-32.5-28.763-51.117-17.238-37.348-33.969-84.977-49.955-132.936-7.728-23.183-25.471-52.998-49.093-86.022-19.492-27.25-40.853-53.827-60.163-77.852-3.106-3.865-6.16-7.664-9.144-11.389z",
fill: null
}
]
};
export const referFriend = {
id: "referFriend",
shapes: [
{
path: "M511.993 159.703c-61.905 0-112.089 50.184-112.089 112.089 0 61.906 50.184 112.09 112.089 112.09s112.089-50.184 112.089-112.09c0-61.905-50.184-112.089-112.089-112.089zM303.904 271.792c0-114.924 93.165-208.089 208.089-208.089 114.925 0 208.089 93.165 208.089 208.089 0 114.925-93.164 208.09-208.089 208.09-114.924 0-208.089-93.165-208.089-208.09zm6.29 352.09c-21.647 0-40.615 14.489-46.309 35.374l-50.383 184.801c-2.775 10.178 4.887 20.208 15.436 20.208H543.99v96H228.938c-73.845 0-127.48-70.214-108.056-141.459l50.383-184.801c17.082-62.655 73.988-106.123 138.929-106.123H543.99v96H310.194zm539.735-49.826l160.001 160c18.74 18.746 18.74 49.138 0 67.883l-160.001 160-67.882-67.883 78.059-78.058H623.988v-96h236.118l-78.059-78.059 67.882-67.883z",
fill: null,
grid: 0
},
{
path: "M7.49991 14.2542H2.57723C1.91789 14.2542 1.43901 13.6273 1.61244 12.9912L2.39967 10.1037C2.57761 9.45101 3.17038 8.99821 3.84685 8.99821H7.49991M8.74988 12H14.203M11.7499 9.50002L14.2499 12L11.7499 14.5M9.50135 4.24682C9.50135 5.6283 8.38144 6.74821 6.99996 6.74821C5.61847 6.74821 4.49856 5.6283 4.49856 4.24682C4.49856 2.86533 5.61847 1.74542 6.99996 1.74542C8.38144 1.74542 9.50135 2.86533 9.50135 4.24682Z",
fill: null
}
]
};
export const rewards = {
id: "rewards",
shapes: [
{
path: "M511.985 864.226c106.039 0 192-85.961 192-192s-85.961-192-192-192c-106.038 0-192 85.961-192 192s85.962 192 192 192zm0-480c159.058 0 288 128.942 288 288 0 154.514-121.679 280.607-274.442 287.687l-13.558.313c-159.058 0-288-128.942-288-288s128.942-288 288-288zm16 160h-32c-17.673 0-32 14.327-32 32v192c0 17.673 14.327 32 32 32h32c17.674 0 32-14.327 32-32v-192c0-17.673-14.326-32-32-32zM171.809 68.191c15.362-8.739 34.899-3.37 43.637 11.992l153.71 270.227c-29.591 13.152-57.031 30.267-81.648 50.669L132.004 127.652c-8.739-15.362-3.37-34.899 11.991-43.638l27.814-15.823zm680.172 0l27.815 15.823c15.361 8.74 20.73 28.276 11.991 43.638L736.275 400.923a352.107 352.107 0 00-81.606-50.578L808.344 80.182c8.739-15.36 28.276-20.73 43.637-11.99zm-183.557 0l27.815 15.823c15.361 8.74 20.73 28.276 11.991 43.638L593.258 329.655c-26.089-6.166-53.3-9.429-81.273-9.429-8.14 0-16.217.276-24.219.82L624.787 80.183c8.739-15.362 28.276-20.73 43.637-11.992zm-312.502.441c15.39-8.688 34.91-3.255 43.598 12.136l76.095 134.797-55.17 94.214L316.27 128.134l-.056-.097c-8.739-15.361-3.37-34.898 11.991-43.637l27.625-15.716.092-.052z",
fill: null
}
]
};
export const optedin = {
id: "optedin",
shapes: [
{
path: "M169.6 192v264.321c0 22.195 9.221 43.393 25.458 58.525l377.82 352.107c6.304 5.875 16.129 5.702 22.222-0.391l264.665-264.665c6.089-6.089 6.267-15.905 0.402-22.211l-351.743-378.17c-15.135-16.272-36.356-25.515-58.578-25.515h-264.246c-8.837 0-16 7.163-16 16zM73.6 192c0-61.856 50.144-112 112-112h264.246c48.889 0 95.576 20.335 128.872 56.134l351.743 378.17c41.053 44.138 39.81 112.851-2.814 155.475l-264.665 264.665c-42.654 42.654-111.426 43.865-155.555 2.739l-377.82-352.107c-35.722-33.291-56.008-79.926-56.008-128.755v-264.321zM320.452 416c-44.183 0-80-35.817-80-80s35.817-80 80-80c44.183 0 80 35.817 80 80s-35.817 80-80 80z",
fill: null
},
{
path: "M1024 256c0 141.385-114.615 256-256 256s-256-114.615-256-256c0-141.385 114.615-256 256-256s256 114.615 256 256z",
fill: color("green", "500")
},
{
path: "M720.59 299.647l135.764-135.765c6.248-6.248 16.379-6.248 22.627 0l11.314 11.314c6.248 6.248 6.248 16.379 0 22.627l-158.392 158.392c-6.248 6.248-16.379 6.248-22.627 0l-67.882-67.882c-6.248-6.248-6.248-16.379 0-22.627l11.314-11.314c6.248-6.248 16.379-6.248 22.627 0l45.255 45.255z",
fill: color("white", "100")
}
]
};
export const timeformPick = {
id: "talent",
shapes: [
{
path: "M858.913 64h-693.826c-55.904 0-101.087 52.864-101.087 118.272v659.456c0 65.408 45.183 118.272 101.087 118.272h693.826c55.904 0 101.087-52.864 101.087-118.272v-659.456c0-65.408-45.183-118.272-101.087-118.272zM523.648 290.688c0 10.752-8.96 19.712-19.712 19.712h-77.952c-10.752 0-19.712 8.96-19.712 19.712v405.888c0 39.424-31.36 70.784-70.784 70.784h-26.88c-10.752 0-19.712-8.96-19.712-19.712v-456.96c0-10.752-8.96-19.712-19.712-19.712h-77.952c-10.752 0-19.712-8.96-19.712-19.712v-54.656c0-10.752 8.96-19.712 19.712-19.712h314.496c10.752 0 19.712 8.96 19.712 19.712v54.656h-1.792zM855.168 290.688c0 10.752-8.96 19.712-19.712 19.712h-137.984c-10.752 0-19.712 8.96-19.712 19.712v113.792c0 10.752 8.96 19.712 19.712 19.712h78.848c10.752 0 19.712 8.96 19.712 19.712v55.552c0 10.752-8.96 19.712-19.712 19.712h-77.952c-10.752 0-19.712 8.96-19.712 19.712v157.696c0 39.424-31.36 70.784-70.784 70.784h-26.88c-10.752 0-19.712-8.96-19.712-19.712v-551.040c0-10.752 8.96-19.712 19.712-19.712h255.36c10.752 0 19.712 8.96 19.712 19.712v54.656h-0.896z",
fill: null,
grid: 0
}
]
};
export const srwPick = {
id: "talent",
shapes: [
{
path: "M512 864.23c106.04 0 192-85.97 192-192 0-106.04-85.96-192-192-192s-192 85.96-192 192c0 106.03 85.96 192 192 192zm0-480c159.06 0 288 128.94 288 288 0 157.46-126.38 285.41-283.24 287.96l-4.76.04c-159.06 0-288-128.95-288-288 0-159.06 128.94-288 288-288zm16 160h-32a32 32 0 00-32 32v192a32 32 0 0032 32h32a32 32 0 0032-32v-192a32 32 0 00-32-32zM171.82 68.19a32 32 0 0143.64 12L369.2 350.4a352.09 352.09 0 00-81.64 50.65l-155.53-273.4A32 32 0 01144 84.01zm680.18 0l27.81 15.82a32 32 0 0112 43.64l-155.48 273.3a352.08 352.08 0 00-81.66-50.61L808.36 80.18A32 32 0 01852 68.2zm-183.56 0l27.81 15.82a32 32 0 0112 43.64L593.31 329.67a352.99 352.99 0 00-81.32-9.44c-8.14 0-16.22.27-24.23.82L624.8 80.18a32 32 0 0143.64-11.99zm-312.5.44a32 32 0 0143.6 12.14l76.09 134.8-55.17 94.2-104.18-181.64a32 32 0 0111.94-43.73l27.62-15.72z",
fill: null,
grid: 0
}
]
};
export const numberFirePick = {
id: "numberFirePick",
shapes: [
{
path: "M326.367 371.2c97.644 0 154.533 64.141 154.533 167.947V832H351.839V579.657c0-60.765-28.869-91.991-78.115-91.991-49.247 0-80.663 31.226-80.663 91.991V832H64V379.64h129.061v64.14c29.718-37.978 67.926-72.58 133.306-72.58zM960 192v126.877H733.046v140.309h200.48v119.183h-200.48V832H574.575V192H960z",
fill: null
}
]
};
export const transactionAdjust = {
id: "transactionAdjust",
shapes: [
{
path: "M791.928 490.692c11.746-11.746 30.84-11.746 42.586 0v0l180.646 180.646c2.831 2.771 5.060 6.084 6.566 9.818 3.072 7.349 3.072 15.661 0 23.010-1.566 3.674-3.795 7.048-6.566 9.879v0l-180.646 180.646c-5.903 5.843-13.613 8.794-21.323 8.794s-15.42-2.952-21.263-8.855c-11.746-11.746-11.746-30.84 0-42.586v0l129.265-129.265h-650.12c-16.625 0-30.118-13.493-30.118-30.118s13.493-30.118 30.118-30.118v0h650.12l-129.265-129.265c-11.746-11.746-11.746-30.84 0-42.586zM189.515 129.28c11.746-11.746 30.84-11.746 42.586 0s11.746 30.84 0 42.586v0l-129.265 129.265h650.12c16.625 0 30.118 13.493 30.118 30.118s-13.493 30.118-30.118 30.118v0h-650.12l129.325 129.265c11.746 11.806 11.746 30.84 0 42.647-5.903 5.843-13.613 8.794-21.323 8.794s-15.42-2.952-21.323-8.855v0l-180.646-180.646c-2.831-2.771-5.060-6.084-6.566-9.818-3.072-7.349-3.072-15.661 0-23.010 1.566-3.674 3.795-7.048 6.566-9.818v0z",
fill: null
}
]
};
export const transactionDeposit = {
id: "transactionDeposit",
shapes: [
{
path: "M993.882 963.765h-187.934c24.395-46.743 37.346-97.882 37.346-150.588 0-182.694-148.6-331.294-331.294-331.294s-331.294 148.6-331.294 331.294c0 52.706 12.89 103.846 37.346 150.588h-187.934c-16.625 0-30.118 13.493-30.118 30.118s13.493 30.118 30.118 30.118h963.765c16.625 0 30.118-13.493 30.118-30.118s-13.493-30.118-30.118-30.118zM240.941 813.176c0-149.444 121.615-271.059 271.059-271.059s271.059 121.615 271.059 271.059c0 53.67-16.926 105.231-47.827 150.588h-446.464c-30.901-45.357-47.827-96.919-47.827-150.588zM512 662.588c16.634 0 30.118-13.484 30.118-30.118s-13.484-30.118-30.118-30.118c-16.634 0-30.118 13.484-30.118 30.118s13.484 30.118 30.118 30.118zM632.471 722.824c16.634 0 30.118-13.484 30.118-30.118s-13.484-30.118-30.118-30.118c-16.634 0-30.118 13.484-30.118 30.118s13.484 30.118 30.118 30.118zM692.706 843.294c16.634 0 30.118-13.484 30.118-30.118s-13.484-30.118-30.118-30.118c-16.634 0-30.118 13.484-30.118 30.118s13.484 30.118 30.118 30.118zM391.529 722.824c16.634 0 30.118-13.484 30.118-30.118s-13.484-30.118-30.118-30.118c-16.634 0-30.118 13.484-30.118 30.118s13.484 30.118 30.118 30.118zM331.294 843.294c16.634 0 30.118-13.484 30.118-30.118s-13.484-30.118-30.118-30.118c-16.634 0-30.118 13.484-30.118 30.118s13.484 30.118 30.118 30.118zM632.471 963.765c16.634 0 30.118-13.484 30.118-30.118s-13.484-30.118-30.118-30.118c-16.634 0-30.118 13.484-30.118 30.118s13.484 30.118 30.118 30.118zM391.529 963.765c16.634 0 30.118-13.484 30.118-30.118s-13.484-30.118-30.118-30.118c-16.634 0-30.118 13.484-30.118 30.118s13.484 30.118 30.118 30.118zM490.677 412.792c2.771 2.771 6.144 5 9.818 6.566 3.674 1.506 7.59 2.289 11.505 2.289s7.831-0.783 11.505-2.289c3.735-1.506 7.048-3.735 9.818-6.566l180.646-180.646c11.746-11.746 11.746-30.84 0-42.586s-30.84-11.746-42.586 0l-129.265 129.265v-288.708c0-16.625-13.493-30.118-30.118-30.118s-30.118 13.493-30.118 30.118v288.708l-129.265-129.265c-11.746-11.746-30.84-11.746-42.586 0s-11.746 30.84 0 42.586l180.646 180.646z",
fill: null
}
]
};
export const transactionBets = {
id: "transactionBets",
shapes: [
{
path: "M512.018 722.83c16.625 0 30.118 13.493 30.118 30.118s-13.493 30.118-30.118 30.118h-240.941c-16.625 0-30.118-13.493-30.118-30.118s13.493-30.118 30.118-30.118h240.941zM752.959 722.83c16.625 0 30.118 13.493 30.118 30.118s-13.493 30.118-30.118 30.118h-60.235c-16.625 0-30.118-13.493-30.118-30.118s13.493-30.118 30.118-30.118h60.235zM512.018 542.124c16.625 0 30.118 13.493 30.118 30.118s-13.493 30.118-30.118 30.118h-240.941c-16.625 0-30.118-13.493-30.118-30.118s13.493-30.118 30.118-30.118h240.941zM752.959 542.124c16.625 0 30.118 13.493 30.118 30.118s-13.493 30.118-30.118 30.118h-60.235c-16.625 0-30.118-13.493-30.118-30.118s13.493-30.118 30.118-30.118h60.235zM752.959 301.182c16.625 0 30.118 13.493 30.118 30.118s-13.493 30.118-30.118 30.118h-481.882c-16.625 0-30.118-13.493-30.118-30.118s13.493-30.118 30.118-30.118h481.882zM146.372 60.536c-14.637 1.988-25.901 14.276-25.901 29.033v844.92c0 16.143 13.493 29.274 30.118 29.274h722.824c16.625 0 30.118-13.131 30.118-29.274v-844.92c0-14.878-11.384-27.166-26.082-29.094l-175.285 57.645c-6.144 1.988-12.83 1.988-18.974 0l-168.659-56.26-174.743 59.211c-6.325 2.168-13.192 2.108-19.516-0.060l-173.899-60.476zM873.412 1024h-722.824c-49.815 0-90.353-40.177-90.353-89.51v-844.92c0-49.393 40.538-89.57 90.353-89.57 3.373 0 6.746 0.602 9.879 1.626l169.803 59.091 174.502-59.151c6.204-2.108 12.951-2.048 19.215 0l168.779 56.26 171.249-56.26c3.012-1.024 6.204-1.566 9.397-1.566 49.815 0 90.353 40.177 90.353 89.57v844.92c0 49.333-40.538 89.51-90.353 89.51v0z",
fill: null
}
]
};
export const transactionWithdraw = {
id: "transactionWithdraw",
shapes: [
{
path: "M993.882 0.181h-963.765c-16.625 0-30.118 13.493-30.118 30.118s13.493 30.118 30.118 30.118h210.824v391.529c0 49.815 40.538 90.353 90.353 90.353h361.412c49.815 0 90.353-40.538 90.353-90.353v-391.529h210.824c16.625 0 30.118-13.493 30.118-30.118s-13.493-30.118-30.118-30.118zM596.811 60.416c-12.469 34.997-45.598 60.235-84.811 60.235s-72.343-25.239-84.811-60.235h169.623zM512 602.534c16.625 0 30.118 13.493 30.118 30.118v0 288.708l129.265-129.325c11.806-11.746 30.84-11.686 42.586 0.060s11.746 30.84 0 42.586v0l-180.646 180.646c-2.771 2.831-6.084 5.060-9.818 6.566-3.674 1.506-7.59 2.289-11.505 2.289s-7.831-0.783-11.505-2.289c-3.674-1.566-7.048-3.795-9.818-6.566v0l-180.646-180.646c-11.746-11.746-11.746-30.84 0-42.586s30.84-11.746 42.586 0v0l129.265 129.265v-288.708c0-16.625 13.493-30.118 30.118-30.118zM364.484 60.416c13.975 68.668 74.812 120.471 147.516 120.471s133.542-51.802 147.516-120.471h63.307v391.529c0 16.625-13.493 30.118-30.118 30.118h-361.412c-16.625 0-30.118-13.493-30.118-30.118v-391.529h63.307z",
fill: null
}
]
};
export const transactionPromo = {
id: "transactionPromo",
shapes: [
{
path: "M582.415 60.296l-513.385 510.554c-5.662 5.602-8.794 13.131-8.794 21.143 0 7.951 3.132 15.48 8.855 21.203l342.377 341.775c5.722 5.662 13.252 8.794 21.263 8.794s15.541-3.132 21.263-8.794l509.771-510.916v-382.072l-381.35-1.687zM432.73 1024h-0.060c-24.154 0-46.803-9.397-63.789-26.443l-342.377-341.775c-17.107-16.986-26.504-39.695-26.504-63.789s9.397-46.803 26.504-63.789l522.3-519.409c5.662-5.602 13.312-8.794 21.263-8.794h0.12l423.816 1.867c16.565 0.060 29.997 13.553 29.997 30.118v424.538c0 8.011-3.192 15.661-8.794 21.323l-518.626 519.71c-17.047 17.047-39.755 26.443-63.849 26.443v0zM843.3 240.941c0 33.31-26.925 60.235-60.235 60.235s-60.235-26.925-60.235-60.235c0-33.31 26.925-60.235 60.235-60.235s60.235 26.925 60.235 60.235z",
fill: null
}
]
};
export const checkPromo = {
id: "checkPromo",
shapes: [
{
path: "M8.43423 1.75195H13.2482C13.8005 1.75195 14.2482 2.19967 14.2482 2.75195V7.56592C14.2482 7.84424 14.1322 8.10997 13.9281 8.29921L7.79672 13.9844C7.4025 14.3499 6.78983 14.3384 6.40969 13.9582L2.04192 9.59046C1.66178 9.21032 1.65021 8.59765 2.01574 8.20343L7.70095 2.07203C7.89018 1.86794 8.15591 1.75195 8.43423 1.75195Z",
fill: null
},
{
path: "M5.99968 7L7.99968 9L11.9997 5M13.2482 1.75195H8.43423C8.15591 1.75195 7.89018 1.86794 7.70095 2.07203L2.01574 8.20343C1.65021 8.59765 1.66178 9.21032 2.04192 9.59046L6.40969 13.9582C6.78983 14.3384 7.4025 14.3499 7.79672 13.9844L13.9281 8.29921C14.1322 8.10997 14.2482 7.84424 14.2482 7.56592V2.75195C14.2482 2.19967 13.8005 1.75195 13.2482 1.75195Z",
fill: null,
strokeColor: "#329A47",
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const caretUp = {
id: "caretUp",
shapes: [{ path: "M768 640h-512l256-320z", fill: null }]
};
export const caretDown = {
id: "caretDown",
shapes: [{ path: "M256 320h512l-256 320z", fill: null }]
};
export const hasReplay = {
id: "hasReplay",
shapes: [
{
path: "M219.152 218.266c-.008.008.008-.008 0 0l-54.746 54.746H257v96H48.75c-26.51 0-48-21.491-48-48v-208.25h96v92.141l54.622-54.622C243.966 57.967 371.854.812 513 .812c282.879 0 512.2 229.32 512.2 512.199 0 282.88-229.321 512.199-512.2 512.199C230.12 1025.21.8 795.891.8 513.011h96C96.8 742.872 283.14 929.21 513 929.21c229.86 0 416.199-186.338 416.199-416.199 0-229.86-186.339-416.198-416.199-416.198-114.704 0-218.517 46.362-293.848 121.453zm142.228 60.975a48 48 0 0148.347.613l319.936 192a48.001 48.001 0 01.008 82.311l-319.937 192.08a47.998 47.998 0 01-48.35.619 47.999 47.999 0 01-24.357-41.772v-384.08a48 48 0 0124.353-41.771zm71.647 126.557v214.49l178.67-107.268-178.67-107.222z",
fill: null
}
]
};
export const noReplay = {
id: "noReplay",
shapes: [
{
path: "M186.71 254.592c-56.294 70.986-89.913 160.769-89.913 258.404 0 229.86 186.339 416.199 416.199 416.199 97.635 0 187.418-33.619 258.404-89.913L647.055 714.937l67.882-67.882L839.282 771.4c56.294-70.986 89.913-160.769 89.913-258.404 0-229.86-186.339-416.2-416.199-416.2-97.635 0-187.418 33.62-258.404 89.914l68.345 68.345-67.882 67.882-68.345-68.345zm-68.25-68.25C44.971 275.003.797 388.841.797 512.996c0 282.88 229.319 512.204 512.199 512.204 124.155 0 237.993-44.179 326.654-117.668l87.405 87.405 67.882-67.882-87.405-87.405c73.489-88.661 117.668-202.499 117.668-326.654 0-282.88-229.324-512.2-512.204-512.2-124.155 0-237.993 44.175-326.654 117.664L98.937 31.055 31.055 98.937l87.405 87.405zm242.916 92.883a48 48 0 0148.347.614l319.937 192a47.999 47.999 0 01.008 82.31L409.73 746.227a48 48 0 01-72.707-41.153V320.996a48 48 0 0124.353-41.771zm71.647 126.557v214.489l178.67-107.267-178.67-107.222z",
fill: null,
fillRule: "evenodd"
}
]
};
export const ippChanges = {
id: "ippChanges",
shapes: [
{
path: "M466.745 77.477c24.994-24.993 65.516-24.993 90.51 0l389.27 389.27c24.993 24.994 24.993 65.517 0 90.51l-389.27 389.27c-24.994 24.994-65.516 24.994-90.51 0l-389.27-389.27c-24.993-24.994-24.993-65.516 0-90.51l389.27-389.27z",
fill: color("orange", "400")
},
{
path: "M432.804 43.536c43.739-43.739 114.653-43.739 158.392 0l389.27 389.27c43.734 43.738 43.734 114.653 0 158.392l-389.27 389.27c-43.739 43.742-114.653 43.742-158.392 0l-389.27-389.27c-43.739-43.739-43.739-114.654 0-158.392l389.27-389.27zm90.51 67.882c-6.249-6.248-16.379-6.248-22.628 0l-389.27 389.27c-6.248 6.248-6.248 16.379 0 22.627l389.27 389.27c6.249 6.249 16.379 6.249 22.628 0l389.27-389.27c6.248-6.248 6.248-16.379 0-22.627l-389.27-389.27zM560 288.001v288h-96v-288h96zm0 352v96h-96v-96h96z",
fill: color("grey", "900"),
fillRule: "evenodd"
}
]
};
export const spinningWheel = {
id: "spinningWheel",
shapes: [
{
path: "M512 1024C229.23 1024 0 794.77 0 512S229.23 0 512 0v118.154c-217.515 0-393.846 176.331-393.846 393.846 0 217.515 176.331 393.846 393.846 393.846V1024z",
fill: null
}
]
};
export const eyeShow = {
id: "eyeShow",
shapes: [
{
path: "M512 176C213.333 176 48 512 48 512C48 512 213.333 848 512 848C810.667 848 976 512 976 512C976 512 810.667 176 512 176ZM512 656.242C591.662 656.242 656.238 591.662 656.238 512C656.238 432.338 591.662 367.76 512 367.76C432.338 367.76 367.758 432.338 367.758 512C367.758 591.662 432.338 656.242 512 656.242Z",
fill: null,
fillRule: "evenodd",
clipRule: "evenodd",
strokeWidth: 85.3333
}
]
};
export const eyeLineShow = {
id: "eyeLineShow",
shapes: [
{
path: "M1.52341 7.99984C1.59239 8.11771 1.68012 8.26215 1.78612 8.42628C2.09152 8.89915 2.54367 9.52778 3.13032 10.1535C4.31731 11.4197 5.96613 12.5832 7.99984 12.5832C10.0335 12.5832 11.6824 11.4197 12.8694 10.1535C13.456 9.52778 13.9082 8.89915 14.2136 8.42628C14.3196 8.26215 14.4073 8.11771 14.4763 7.99983C14.4073 7.88196 14.3196 7.73752 14.2136 7.5734C13.9082 7.10052 13.456 6.47189 12.8694 5.84613C11.6824 4.58001 10.0335 3.4165 7.99984 3.4165C5.96613 3.4165 4.31731 4.58001 3.13032 5.84613C2.54367 6.47189 2.09152 7.10052 1.78612 7.5734C1.68012 7.73752 1.59239 7.88196 1.52341 7.99984ZM15.3332 7.99984C16.004 7.66443 16.0037 7.66391 16.0037 7.66391L16.0026 7.66161L16.0002 7.65685L15.9924 7.64162C15.9859 7.62897 15.9767 7.61137 15.965 7.58915C15.9415 7.54473 15.9075 7.48179 15.8632 7.40297C15.7745 7.24544 15.6443 7.02389 15.4736 6.75961C15.1332 6.23249 14.627 5.52778 13.9637 4.82021C12.6506 3.41967 10.6328 1.9165 7.99984 1.9165C5.36687 1.9165 3.34903 3.41967 2.03602 4.82021C1.37267 5.52778 0.86649 6.23249 0.526058 6.75961C0.355376 7.02389 0.225132 7.24544 0.13652 7.40297C0.0921861 7.48179 0.0581893 7.54473 0.034683 7.58915C0.0229274 7.61137 0.0137877 7.62897 0.00728332 7.64162L-0.000497416 7.65685L-0.00290294 7.66161L-0.00373377 7.66326C-0.00373377 7.66326 -0.00431651 7.66443 0.666504 7.99984L-0.00431652 7.66443C-0.109889 7.87557 -0.109889 8.1241 -0.00431652 8.33525L0.666504 7.99984C-0.00431651 8.33525 -0.00431652 8.33525 -0.00431652 8.33525L-0.00373377 8.33641L-0.00290294 8.33806L-0.000497416 8.34282L0.00728332 8.35806C0.0137877 8.37071 0.0229274 8.38831 0.034683 8.41052C0.0581893 8.45494 0.0921861 8.51788 0.13652 8.5967C0.225132 8.75423 0.355376 8.97578 0.526058 9.24006C0.86649 9.76719 1.37267 10.4719 2.03602 11.1795C3.34903 12.58 5.36687 14.0832 7.99984 14.0832C10.6328 14.0832 12.6506 12.58 13.9637 11.1795C14.627 10.4719 15.1332 9.76719 15.4736 9.24006C15.6443 8.97578 15.7745 8.75423 15.8632 8.5967C15.9075 8.51788 15.9415 8.45494 15.965 8.41052C15.9767 8.38831 15.9859 8.37071 15.9924 8.35806L16.0002 8.34282L16.0026 8.33806L16.0034 8.33641C16.0034 8.33641 16.004 8.33525 15.3332 7.99984ZM15.3332 7.99984L16.004 8.33525C16.1096 8.1241 16.1093 7.87505 16.0037 7.66391L15.3332 7.99984Z",
fill: null,
fillRule: "evenodd",
clipRule: "evenodd"
},
{
path: "M8 6.75C7.30964 6.75 6.75 7.30964 6.75 8C6.75 8.69036 7.30964 9.25 8 9.25C8.69036 9.25 9.25 8.69036 9.25 8C9.25 7.30964 8.69036 6.75 8 6.75ZM5.25 8C5.25 6.48122 6.48122 5.25 8 5.25C9.51878 5.25 10.75 6.48122 10.75 8C10.75 9.51878 9.51878 10.75 8 10.75C6.48122 10.75 5.25 9.51878 5.25 8Z",
fill: null,
fillRule: "evenodd",
clipRule: "evenodd"
}
]
};
export const eyeHide = {
id: "eyeHide",
shapes: [
{
path: "M164.699 666.96C97.5661 587.524 48 511.999 48 511.999C48 511.999 213.332 176 511.999 176C556.475 176 597.64 183.451 635.493 196.134M262.842 760.688C329.257 810.566 412.309 848 511.999 848C810.665 848 976 511.999 976 511.999C976 511.999 893.48 362.33 760.44 262.775M960 64L613.993 410.007M64 960L613.993 410.007M367.758 512.001C367.758 432.338 432.337 367.76 511.999 367.76M409.917 613.906C436.027 640.06 472.123 656.241 511.999 656.241C591.661 656.241 656.239 591.663 656.239 512.001C656.239 472.17 640.095 436.11 613.993 410.007",
fill: null,
fillRule: "evenodd",
clipRule: "evenodd",
strokeWidth: 85.3333
}
]
};
export const eyeLineHide = {
id: "eyeLineHide",
shapes: [
{
path: "M2.91416 3.97482C3.28381 3.65539 3.69042 3.34784 4.13289 3.07223L5.228 4.16734C4.77834 4.41713 4.36108 4.71499 3.97783 5.03849L2.91416 3.97482ZM1.84576 5.02774C1.27517 5.66404 0.833169 6.28408 0.526058 6.75961C0.355376 7.02389 0.225132 7.24544 0.13652 7.40297C0.0921861 7.48179 0.0581893 7.54473 0.034683 7.58915C0.0229274 7.61137 0.0137877 7.62897 0.00728332 7.64162L-0.000497416 7.65685L-0.00290294 7.66161L-0.00373377 7.66326C-0.00373377 7.66326 -0.00431651 7.66443 0.666504 7.99984L-0.00431652 7.66443C-0.109889 7.87557 -0.109889 8.1241 -0.00431652 8.33525L-0.00373377 8.33641L-0.00290294 8.33806L-0.000497416 8.34282L0.00728332 8.35806C0.0137877 8.37071 0.0229274 8.38831 0.034683 8.41052C0.0581893 8.45494 0.0921861 8.51788 0.13652 8.5967C0.225132 8.75423 0.355376 8.97578 0.526058 9.24006C0.86649 9.76719 1.37267 10.4719 2.03602 11.1795C3.34903 12.58 5.36687 14.0832 7.99984 14.0832C8.88765 14.0832 9.70553 13.9123 10.45 13.632L9.25175 12.4337C8.85257 12.5299 8.43502 12.5832 7.99984 12.5832C5.96613 12.5832 4.31731 11.4197 3.13032 10.1535C2.54367 9.52778 2.09152 8.89915 1.78612 8.42628C1.68012 8.26215 1.59239 8.11771 1.52341 7.99984C1.59239 7.88196 1.68012 7.73752 1.78612 7.5734C2.05178 7.16205 2.42849 6.63284 2.90819 6.09018L1.84576 5.02774ZM10.7717 11.8323L11.8668 12.9274C12.3092 12.6518 12.7159 12.3443 13.0855 12.0249L12.0218 10.9612C11.6386 11.2847 11.2213 11.5826 10.7717 11.8323ZM13.0915 9.9095L14.1539 10.9719C14.7245 10.3356 15.1665 9.71559 15.4736 9.24006C15.6443 8.97578 15.7745 8.75423 15.8632 8.5967C15.9075 8.51788 15.9415 8.45494 15.965 8.41052C15.9767 8.38831 15.9859 8.37071 15.9924 8.35806L16.0002 8.34282L16.0026 8.33806L16.0034 8.33641C16.0034 8.33641 16.004 8.33525 15.3332 7.99984L16.004 8.33525C16.1096 8.1241 16.1093 7.87505 16.0037 7.66391L16.0026 7.66161L16.0002 7.65685L15.9924 7.64162C15.9859 7.62897 15.9767 7.61137 15.965 7.58915C15.9415 7.54473 15.9075 7.48179 15.8632 7.40297C15.7745 7.24544 15.6443 7.02389 15.4736 6.75961C15.1332 6.23249 14.627 5.52778 13.9637 4.82021C12.6506 3.41967 10.6328 1.9165 7.99984 1.9165C7.11202 1.9165 6.29414 2.08741 5.54964 2.36767L6.74791 3.56594C7.1471 3.46978 7.56465 3.4165 7.99984 3.4165C10.0335 3.4165 11.6824 4.58001 12.8694 5.84613C13.456 6.47189 13.9082 7.10052 14.2136 7.5734C14.3196 7.73752 14.4073 7.88196 14.4763 7.99983C14.4073 8.11771 14.3196 8.26215 14.2136 8.42628C13.9479 8.83763 13.5712 9.36684 13.0915 9.9095ZM15.3332 7.99984C16.004 7.66443 16.0037 7.66391 16.0037 7.66391L15.3332 7.99984Z",
fill: null,
fillRule: "evenodd",
clipRule: "evenodd"
},
{
path: "M5.05197 6.11263C5.32486 5.68728 5.68728 5.32486 6.11263 5.05197L7.21893 6.15827C6.74244 6.3606 6.3606 6.74244 6.15827 7.21893L5.05197 6.11263ZM4.5131 7.69508C4.50443 7.79557 4.5 7.89727 4.5 8C4.5 9.933 6.067 11.5 8 11.5C8.10273 11.5 8.20443 11.4956 8.30492 11.4869L4.5131 7.69508ZM10.948 9.88737C10.6751 10.3127 10.3127 10.6751 9.88737 10.948L8.78107 9.84173C9.25756 9.6394 9.6394 9.25756 9.84173 8.78108L10.948 9.88737ZM11.4869 8.30492L7.69508 4.5131C7.79557 4.50443 7.89727 4.5 8 4.5C9.933 4.5 11.5 6.067 11.5 8C11.5 8.10273 11.4956 8.20443 11.4869 8.30492Z",
fill: null,
fillRule: "evenodd",
clipRule: "evenodd"
},
{
path: "M2.41414 1.35348C2.21888 1.15822 1.90229 1.15822 1.70703 1.35348L1.35348 1.70703C1.15822 1.90229 1.15822 2.21888 1.35348 2.41414L13.3743 14.435C13.5696 14.6302 13.8861 14.6302 14.0814 14.435L14.435 14.0814C14.6302 13.8861 14.6302 13.5696 14.435 13.3743L2.41414 1.35348Z",
fill: null
}
]
};
export const glassyError = {
id: "glassyError",
shapes: [
{
path: "M321.008 320.029L513.008 512.029M513.008 512.029L705.008 704.029M513.008 512.029L321.008 704.029M513.008 512.029L705.008 320.029M977.025 512.208C977.025 768.479 769.276 976.228 513.005 976.228C256.733 976.228 48.9844 768.479 48.9844 512.208C48.9844 255.936 256.733 48.1875 513.005 48.1875C769.276 48.1875 977.025 255.936 977.025 512.208Z",
fill: "transparent",
strokeColor: "#C92C2C",
strokeWidth: 96
}
]
};
export const questionMark = {
id: "questionMark",
shapes: [
{
path: "M 512.0001,896.00019 V 764.34318 M 336.45743,369.37215 c 0,0 0,-175.54265 175.54267,-175.54265 175.54269,0 175.54269,175.54265 175.54269,175.54265 0,175.54269 -175.54269,131.65702 -175.54269,307.19968",
fill: "transparent",
strokeWidth: 131
}
]
};
export const exclamationMark = {
id: "exclamationMark",
shapes: [
{
path: "m 519.02327,84.666671 v 522.657139 0 0 0 0 m -0.012,115.97226 v 174.17064",
fill: "transparent",
strokeWidth: 175
}
]
};
export const exclamationMarkYellow = {
id: "exclamationMarkYellow",
shapes: [
{
path: "M976.022 512.179c0 256.271-207.749 464.02-464.02 464.02-256.271 0-464.02-207.749-464.02-464.02 0-256.271 207.749-464.02 464.02-464.02 256.271 0 464.02 207.749 464.02 464.02z",
fill: "#FFE099"
},
{
path: "M512.002 85.622c-235.581 0-426.557 190.976-426.557 426.557 0 235.581 190.976 426.557 426.557 426.557 235.581 0 426.557-190.976 426.557-426.557 0-235.581-190.976-426.557-426.557-426.557zM10.518 512.179c0-276.962 224.522-501.484 501.484-501.484S1013.49 235.217 1013.49 512.18 788.964 1013.66 512.002 1013.66 10.518 789.141 10.518 512.179zM549.464 256v320h-74.926V256h74.926zm0 416v96h-74.926v-96h74.926z",
fill: "#CA9008",
fillRule: "evenodd"
}
]
};
export const personRightArrow = {
id: "personRightArrow",
shapes: [
{
path: "M4.84636 8.99805H11.1525C11.829 8.99805 12.4218 9.45084 12.5997 10.1035L13.3869 12.991C13.5604 13.6271 13.0815 14.254 12.4222 14.254H3.57674C2.9174 14.254 2.43852 13.6271 2.61195 12.991L3.39918 10.1035C3.57712 9.45084 4.16989 8.99805 4.84636 8.99805Z",
fill: "white",
fillOpacity: 0.1
},
{
path: "M10.5018 4.247C10.5018 5.62848 9.38193 6.74839 8.00044 6.74839C6.61896 6.74839 5.49905 5.62848 5.49905 4.247C5.49905 2.86552 6.61896 1.74561 8.00044 1.74561C9.38193 1.74561 10.5018 2.86552 10.5018 4.247Z",
fill: "white",
fillOpacity: 0.1
},
{
path: "M8.50039 14.2544H3.57771C2.91838 14.2544 2.4395 13.6275 2.61293 12.9914L3.40016 10.1038C3.5781 9.45119 4.17087 8.9984 4.84734 8.9984H8.50039M9.75037 12.0002H15.2035M12.7504 9.50021L15.2504 12.0002L12.7504 14.5002M10.5018 4.247C10.5018 5.62848 9.38193 6.74839 8.00044 6.74839C6.61896 6.74839 5.49905 5.62848 5.49905 4.247C5.49905 2.86552 6.61896 1.74561 8.00044 1.74561C9.38193 1.74561 10.5018 2.86552 10.5018 4.247Z",
fill: null,
strokeColor: "",
strokeWidth: 1.5
}
]
};
export const deleteIcon = {
id: "deleteIcon",
shapes: [
{
path: "M6.4269 1.70483C6.33003 1.79937 6.22599 1.90299 6.08705 2.04278C6.08705 2.04278 3.7982 4.33387 3.79055 4.34049C3.71954 4.40787 3.66045 4.46549 3.59919 4.5264C3.57104 4.55455 3.546 4.57931 3.49261 4.63185C3.4467 4.67702 3.42545 4.698 3.39899 4.72432L1.32949 6.79678C1.28508 6.84287 1.24697 6.88168 1.19796 6.93092L1.14217 6.98703C1.07898 7.05035 1.02899 7.10188 0.95834 7.17559C0.796275 7.33556 0.631939 7.51646 0.477196 7.70618C0.333415 7.85954 0.217338 8.03681 0.134231 8.2301L0.112272 8.28858C-0.0374241 8.75215 -0.0374241 9.25109 0.112272 9.71466L0.135197 9.77538C0.218934 9.96819 0.335628 10.1448 0.479954 10.2974C0.634044 10.4868 0.79826 10.6677 0.971886 10.8394C1.00841 10.8788 1.06223 10.9338 1.13412 11.0057C1.18377 11.0554 1.20513 11.0768 1.23175 11.1036C1.26613 11.1383 1.29585 11.1687 1.32344 11.1973L3.39839 13.2767C3.5012 13.3795 3.54722 13.4252 3.62955 13.5055C3.69723 13.5725 3.73729 13.6114 3.81146 13.6799L6.0891 15.9615C6.25981 16.1323 6.3364 16.2085 6.43293 16.3034C6.55841 16.429 6.64112 16.5101 6.77032 16.6364C6.819 16.6878 6.83724 16.7066 6.86219 16.7299C7.15378 17.023 7.50944 17.282 7.89889 17.4808C8.28873 17.6772 8.70205 17.8137 9.12862 17.8874C9.52828 17.9532 9.9271 17.9884 10.3269 17.9934C10.4964 17.9972 10.6665 17.9995 10.8346 18.0001L11.2348 18.0001H18.6805C18.835 18.0001 18.9882 17.9979 19.2006 17.9933C19.598 17.9884 20.0008 17.9531 20.3992 17.8876C20.8343 17.8125 21.2505 17.6747 21.6397 17.4781C22.0341 17.2785 22.394 17.0176 22.706 16.7049C23.0167 16.3929 23.2765 16.035 23.4767 15.6436C23.6748 15.2491 23.812 14.832 23.8858 14.4016C23.9518 13.9981 23.9869 13.5955 23.9917 13.1919C23.9947 13.0928 23.9961 13.0055 23.9984 12.8111L24 12.6867L24.0001 12.0735V5.284L23.9989 5.1766C23.9976 5.05681 23.997 5.0045 23.9958 4.93737C23.9947 4.87442 23.9934 4.81668 23.9918 4.76104C23.9873 4.37304 23.9525 3.97396 23.888 3.57918C23.8138 3.14702 23.6778 2.73345 23.4836 2.34646C23.2825 1.95326 23.0244 1.59806 22.7163 1.28897C22.4081 0.978475 22.051 0.718677 21.6595 0.520425C21.2732 0.324986 20.8603 0.188142 20.434 0.114261C20.0325 0.0489346 19.6336 0.0140846 19.2338 0.00884734C19.0528 0.00446197 18.8857 0.0021224 18.7251 0.0021224C18.563 0.000459011 18.4289 0.00012207 18.1279 0.00012207H11.4324C11.1336 0.00012207 10.9986 0.000461062 10.8292 0.00215574C10.6756 0.0021224 10.5091 0.00444704 10.3181 0.00897761C9.92594 0.0141291 9.5277 0.0489854 9.13367 0.113131C8.7003 0.188264 8.28703 0.32496 7.90046 0.519926C7.5081 0.719875 7.15225 0.979229 6.84371 1.28956C6.82941 1.30363 6.81895 1.31464 6.73159 1.40792C6.62322 1.51071 6.52357 1.60779 6.4269 1.70483ZM3.83526 4.3024L3.83773 4.30047C3.83474 4.30272 3.83266 4.30429 3.83008 4.30643L3.83526 4.3024ZM7.03198 15.0185L4.72997 12.7124C4.72997 12.7124 4.68405 12.6706 4.67927 12.6666C4.64375 12.6326 4.6132 12.6028 4.53688 12.5273C4.48179 12.4738 4.43893 12.4313 4.34135 12.3337L2.27471 10.2628C2.25047 10.2375 2.21671 10.203 2.17842 10.1644C2.14997 10.1357 2.12699 10.1127 2.07666 10.0623C2.01337 9.999 1.96793 9.95259 1.92557 9.9076C1.76375 9.74699 1.62675 9.59538 1.4986 9.43642L1.45468 9.38716C1.42077 9.35271 1.39238 9.31332 1.37044 9.27037C1.3204 9.09396 1.32053 8.90704 1.37083 8.73068C1.39279 8.68696 1.42134 8.64681 1.45552 8.61166L1.4959 8.56616C1.62476 8.40688 1.76234 8.25485 1.90801 8.11078C1.98605 8.0297 2.03116 7.9832 2.06527 7.94861L2.11069 7.90335L2.1426 7.87136C2.19682 7.81688 2.24019 7.77271 2.28181 7.72934L4.34061 5.66778C4.36321 5.6453 4.38235 5.62641 4.43646 5.57317C4.48323 5.52714 4.51031 5.50037 4.54032 5.47035C4.58676 5.42418 4.63243 5.37952 4.67729 5.3365C4.68714 5.32827 4.69862 5.31762 4.73129 5.28732L7.03128 2.98362C7.16705 2.84701 7.2669 2.74758 7.36464 2.65211C7.45862 2.55785 7.54933 2.46948 7.64526 2.37847C7.66653 2.35862 7.67923 2.34533 7.73795 2.28301L7.78437 2.23396C7.99784 2.01928 8.2389 1.84359 8.50301 1.709C8.76969 1.5745 9.05746 1.47932 9.35449 1.4278C9.67671 1.37538 10.0093 1.34627 10.3426 1.34186C10.5308 1.33744 10.6871 1.33525 10.8357 1.33525C11.0059 1.33358 11.1379 1.33325 11.4323 1.33325H18.1277C18.4243 1.33325 18.5554 1.33358 18.7183 1.33522C18.8739 1.33525 19.0306 1.33745 19.2089 1.34173C19.5502 1.34624 19.8834 1.37535 20.2131 1.42897C20.5024 1.47914 20.7892 1.5742 21.0574 1.70988C21.3214 1.84358 21.5625 2.01894 21.7712 2.22916C21.9824 2.44113 22.1586 2.68364 22.2944 2.94891C22.4273 3.21385 22.522 3.50197 22.5731 3.79928C22.6259 4.12274 22.6549 4.45517 22.6588 4.78838C22.6605 4.84998 22.6617 4.90222 22.6627 4.95987C22.6638 5.02318 22.6644 5.07361 22.6657 5.19052L22.6668 5.29158L22.6668 5.88134V12.6716L22.6652 12.7949C22.663 12.9814 22.6617 13.0635 22.6587 13.1638C22.6545 13.5124 22.6252 13.8484 22.5708 14.1808C22.5201 14.4763 22.4243 14.7677 22.2874 15.0403C22.1525 15.3042 21.9744 15.5494 21.7619 15.7628C21.5504 15.9747 21.3059 16.152 21.0381 16.2875C20.7671 16.4245 20.477 16.5204 20.1776 16.5722C19.8506 16.6259 19.5146 16.6554 19.1777 16.6595C18.9679 16.6641 18.8233 16.6661 18.6803 16.6661H10.8371C10.6799 16.6655 10.5178 16.6633 10.3498 16.6596C10.0107 16.6553 9.67865 16.6261 9.35022 16.572C9.05844 16.5215 8.7707 16.4266 8.50154 16.291C8.24018 16.1575 7.99858 15.9816 7.78884 15.7712C7.77629 15.7589 7.75888 15.7409 7.73686 15.7177L7.73412 15.7148C7.68164 15.6594 7.6698 15.6469 7.65739 15.635L7.64241 15.621C7.5662 15.5494 7.49173 15.4764 7.37126 15.3559C7.27429 15.2605 7.19956 15.1861 7.03198 15.0185ZM11.8121 12.5287C11.7581 12.5822 11.6934 12.6259 11.6204 12.6561C11.3969 12.7487 11.1397 12.6975 10.9687 12.5265C10.8562 12.4143 10.793 12.2619 10.793 12.1029C10.793 11.944 10.8562 11.7916 10.9687 11.6793V11.6807C11.0014 11.648 11.0372 11.6197 11.0753 11.5959L13.6685 8.99876L10.9688 6.30118L10.9778 6.29212C10.9242 6.23802 10.8805 6.17322 10.8502 6.10009C10.7577 5.87659 10.8088 5.61933 10.9798 5.44828C11.0921 5.33531 11.2447 5.27178 11.404 5.27178C11.5632 5.27178 11.7158 5.33531 11.8281 5.44828H11.8254C11.8551 5.47799 11.8812 5.5103 11.9035 5.54457L14.5129 8.15308L17.1326 5.52935C17.1527 5.50039 17.1757 5.4728 17.2015 5.44699C17.3725 5.27593 17.6297 5.22475 17.8531 5.31732C18.0765 5.40989 18.2222 5.62798 18.2222 5.8699C18.2222 6.03077 18.1578 6.1811 18.0489 6.291L18.0556 6.29765L15.3587 8.99862L17.9672 11.6062C18 11.628 18.0309 11.6532 18.0592 11.6815L18.0578 11.6828C18.2288 11.8539 18.28 12.1111 18.1875 12.3346C18.0949 12.5581 17.8769 12.7038 17.635 12.7038C17.474 12.7038 17.3236 12.6392 17.2137 12.5301L17.2082 12.5356L14.5146 9.84409L11.8231 12.5397L11.8121 12.5287Z",
fillRule: "evenodd",
clipRule: "evenodd",
fill: null
}
]
};
// icons being used in PAWS
export const userOutline = {
id: "userNew",
shapes: [
{
path: "M11.1269 4.30838C11.1269 6.03524 9.72702 7.43513 8.00017 7.43513C6.27331 7.43513 4.87342 6.03524 4.87342 4.30838C4.87342 2.58153 6.27331 1.18164 8.00017 1.18164C9.72702 1.18164 11.1269 2.58153 11.1269 4.30838Z",
fill: "transparent",
fillOpacity: 0.1,
strokeWidth: 2
},
{
path: "M13.7499 11.6319C13.5274 10.8162 12.7865 10.2502 11.941 10.2502H4.05856C3.21303 10.2502 2.4721 10.8162 2.24963 11.6319L1.26594 15.2387C1.04908 16.0339 1.64768 16.8176 2.4719 16.8176H13.5276C14.3518 16.8176 14.9504 16.0339 14.7336 15.2387L13.7499 11.6319",
fill: "transparent",
fillOpacity: 0.1,
strokeWidth: 2
},
{
path: "M11.1269 4.30838C11.1269 6.03524 9.72702 7.43513 8.00017 7.43513C6.27331 7.43513 4.87342 6.03524 4.87342 4.30838C4.87342 2.58153 6.27331 1.18164 8.00017 1.18164C9.72702 1.18164 11.1269 2.58153 11.1269 4.30838Z",
strokeColor: color("blue", "000"),
strokeWidth: 2,
strokeLinejoin: "round",
fill: null
},
{
path: "M13.7499 11.6319C13.5274 10.8162 12.7865 10.2502 11.941 10.2502H4.05856C3.21303 10.2502 2.4721 10.8162 2.24963 11.6319L1.26594 15.2387C1.04908 16.0339 1.64768 16.8176 2.4719 16.8176H13.5276C14.3518 16.8176 14.9504 16.0339 14.7336 15.2387L13.7499 11.6319",
strokeColor: color("blue", "000"),
strokeWidth: 2,
strokeLinejoin: "round",
fill: null
}
]
};
export const depositNewExp = {
id: "depositNewExp",
shapes: [
{
path: "M12 5V8M12 8V11M12 8H15M12 8H9",
strokeColor: "#fff",
strokeWidth: 1.5,
fill: null
},
{
path: "M8 5.60001C8 5.60001 8 3.20001 5 3.20001M5 3.20001C2 3.20001 2 5.60001 2 5.60001C2 6.40001 2 7.2 5 8C8 8.8 8 9.59999 8 10.4C8 10.4 8 12.8 5 12.8M5 3.20001V1M5 12.8C2 12.8 2 10.4 2 10.4M5 12.8V15M12 5V8M12 8V11M12 8H15M12 8H9",
strokeColor: "#fff",
strokeWidth: 1.5,
fill: null
}
]
};
export const envelope = {
id: "envelope",
shapes: [
{
path: "M1.24998 1.74998L9 8.25L16.75 1.74998M1.1875 1.6875H16.8125V12.3125H1.1875V1.6875Z",
strokeColor: color("blue", "100"),
fill: null,
strokeWidth: 2,
strokeLinejoin: "round"
}
]
};
export const betTicket = {
id: "betTicket",
shapes: [
{
path: "M10.25 0.75H1.75C1.19772 0.75 0.75 1.19772 0.75 1.75V13.5L3 12.5L4.5 13.5L6 12.5L7.5 13.5L9 12.5L11.25 13.5V1.75C11.25 1.19772 10.8023 0.75 10.25 0.75Z",
fillOpacity: 0.1,
fill: "white"
},
{
path: "M3 4.75H6M3 7.75H9M1.75 0.75H10.25C10.8023 0.75 11.25 1.19772 11.25 1.75V13.5L9 12.5L7.5 13.5L6 12.5L4.5 13.5L3 12.5L0.75 13.5V1.75C0.75 1.19772 1.19772 0.75 1.75 0.75Z",
strokeColor: color("grey", "900"),
strokeWidth: 1.5,
strokeLinejoin: "round",
fill: null
}
]
};
export const watchLive = {
id: "watchLive",
shapes: [
{
path: "M10 14.5625H5.46875H2.8125C1.77697 14.5625 0.9375 13.723 0.9375 12.6875V3.3125C0.9375 2.27697 1.77697 1.4375 2.8125 1.4375H17.1875C18.223 1.4375 19.0625 2.27697 19.0625 3.3125V12.6875C19.0625 13.723 18.223 14.5625 17.1875 14.5625H14.5312H10ZM7.5 11.75V4.25L13.75 8L7.5 11.75Z",
fillRule: "evenodd",
clipRule: "evenodd",
fill: "white",
fillOpacity: 0.1
},
{
path: "M5.46875 14.5625H10H14.5312M5.46875 14.5625L2.5 17.375M5.46875 14.5625H2.8125C1.77697 14.5625 0.9375 13.723 0.9375 12.6875V3.3125C0.9375 2.27697 1.77697 1.4375 2.8125 1.4375H17.1875C18.223 1.4375 19.0625 2.27697 19.0625 3.3125V12.6875C19.0625 13.723 18.223 14.5625 17.1875 14.5625H14.5312M14.5312 14.5625L17.5 17.375M7.5 4.25V11.75L13.75 8L7.5 4.25Z",
strokeColor: color("blue", "000"),
strokeWidth: 1.5,
fill: null
}
]
};
export const stable = {
id: "stable",
shapes: [
{
path: "M14.25 14.25V7.98791L12.94 4.18214L8 2L3.0444 4.18214L1.75 7.98791V14.25H4.25V9H11.75V14.25H14.25Z",
fill: "white",
fillOpacity: 0.1
},
{
path: "M4.25 14.25H1.75V7.98791L3.0444 4.18214L8 2L12.94 4.18214L14.25 7.98791V14.25H11.75M4.25 14.25V9H11.75V14.25M4.25 14.25H11.75M11.75 14.25L4.26953 9.01953",
strokeWidth: 1.5,
strokeLinejoin: "round",
strokeColor: color("blue_accent", "500"),
fill: null
}
]
};
export const customerSupport = {
id: "customerSupport",
shapes: [
{
path: "M2 7.5513L2.5 12L5.5 11.5V8L2 7.5513Z",
fill: "none",
fillOpacity: 0.1
},
{
path: "M13.5027 11.9764L13.9977 7.57138L10.5 8V11.5L13.5027 11.9764Z",
fill: "white",
fillOpacity: 0.1
},
{
path: "M2 7.5513C2 4.34733 4.68629 1.75 8 1.75C11.3137 1.75 14 4.34733 14 7.5513L13.5 12L12.5 14L7.75 14.25M2 7.5513L2.5 12L5.5 11.5V8L2 7.5513ZM10.5 11.5V8L13.9977 7.57138L13.5027 11.9764L10.5 11.5Z",
strokeWidth: 1.5,
strokeColor: color("blue_accent", "500"),
strokeLinejoin: "round",
fill: null
}
]
};
export const wallet = {
id: "wallet",
shapes: [
{
path: "M3.8156 3C2.81287 3 2 3.82974 2 4.85328V16.0734C2 16.5851 2.40644 17 2.9078 17H17.0922C17.5936 17 18 16.5851 18 16.0734V7.2278C18 6.71603 17.5936 6.30116 17.0922 6.30116H3.8156V4.85328H17.0922V3H3.8156ZM3.8156 15.1467V8.15444H16.1844V15.1467H3.8156ZM13.6312 13.0772C14.1326 13.0772 14.539 12.6624 14.539 12.1506C14.539 11.6388 14.1326 11.2239 13.6312 11.2239C13.1298 11.2239 12.7234 11.6388 12.7234 12.1506C12.7234 12.6624 13.1298 13.0772 13.6312 13.0772Z",
fillRule: "evenodd",
clipRule: "evenodd",
fill: null
}
]
};
export const questionNewExp = {
id: "questionNewExp",
shapes: [
{
path: "M10.9999 16.0001V14.1251M8.49989 8.50008C8.49989 8.50008 8.49989 6.00008 10.9999 6.00008C13.4999 6.00008 13.4999 8.50008 13.4999 8.50008C13.4999 11.0001 10.9999 10.3751 10.9999 12.8751M20.0628 11.0036C20.0628 16.0089 16.0052 20.0665 10.9999 20.0665C5.99461 20.0665 1.93701 16.0089 1.93701 11.0036C1.93701 5.99827 5.99461 1.94067 10.9999 1.94067C16.0052 1.94067 20.0628 5.99827 20.0628 11.0036Z",
fill: "none",
strokeWidth: 2,
strokeColor: "#fff"
}
]
};
export const closeThin = {
id: "closeThin",
shapes: [
{
path: "M4.375 4.375L15.625 15.625M15.625 4.375L4.375 15.625",
strokeWidth: 1.5,
strokeLinejoin: "round",
fill: null
}
]
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Text/index.jsx
import React, { PureComponent } from "react";
import { buildTextFn } from "./styled-components";
export const buildText = (textDataInit) => buildTextFn(textDataInit);
export default class Text extends PureComponent {
static defaultProps = {
tag: "span",
children: null,
fontSize: -1,
bold: false,
color: "inherit",
align: "inherit",
uppercase: false,
capitalize: false,
ellipsis: false,
className: "",
qaLabel: "",
lineHeight: ""
};
render() {
const Txt = buildText({
tag: this.props.tag,
fontSize: this.props.fontSize,
color: this.props.color,
bold: this.props.bold,
align: this.props.align,
uppercase: this.props.uppercase,
capitalize: this.props.capitalize,
ellipsis: this.props.ellipsis,
qaLabel: this.props.qaLabel,
lineHeight: this.props.lineHeight
});
return <Txt className={this.props.className}>{this.props.children}</Txt>;
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Text/styled-components.js
import styled from "styled-components";
import { fontNormal } from "../../_static/Typography";
// eslint-disable-next-line import/prefer-default-export
export const buildTextFn = (props) => {
const defaultProp = {
tag: "span",
fontSize: -1,
color: "inherit",
bold: false,
align: "inherit",
uppercase: false,
capitalize: false,
ellipsis: false,
qaLabel: "",
lineHeight: ""
};
const textData = { ...defaultProp, ...props };
const TextAtom = styled[textData.tag].attrs({
...(textData.qaLabel !== ""
? {
"data-qa-label": textData.qaLabel
}
: {})
})`
font-family: ${fontNormal};
font-size: ${textData.fontSize >= 0 && `${textData.fontSize}px`};
font-weight: ${textData.bold && "bold"};
color: ${textData.color !== "inherit" && textData.color};
text-transform: ${(textData.uppercase && "uppercase") ||
(textData.capitalize && "capitalize")};
text-align: ${textData.align !== "inherit" && textData.align};
line-height: ${textData.lineHeight || "normal"};
`;
return !textData.ellipsis
? TextAtom
: styled(TextAtom)`
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
`;
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Icons/index.jsx
import React from "react";
import styled from "styled-components";
export const generatePaths = (icon, qaLabel) =>
icon.map((shape, index) => {
if (shape.path) {
return (
<path
key={`path-${index.toString()}`}
fill={shape.fill}
fillRule={shape.fillRule}
clipRule={shape.clipRule}
stroke={shape.strokeColor}
strokeWidth={shape.strokeWidth}
fillOpacity={shape.fillOpacity}
d={shape.path}
{...(qaLabel ? { "data-qa-label": `${qaLabel}-path` } : {})}
/>
);
}
return (
<rect
key={`rect-${index.toString()}`}
x={shape.xRect}
y={shape.yRect}
width={shape.widthRect}
height={shape.heightRect}
rx={shape.rxRect}
fill={shape.fill}
stroke={shape.strokeColor}
strokeWidth={shape.strokeWidth}
{...(qaLabel ? { "data-qa-label": `${qaLabel}-rect` } : {})}
/>
);
});
const colorize = (
colorList = [],
strokeColorList = [],
strokeWidthList = [],
icon
) => {
const localIcon = icon.map((shape) => ({ ...shape }));
if (colorList.length) {
colorList.forEach((color, index) => {
if (color && localIcon[index]) {
localIcon[index].fill = color;
}
});
}
if (strokeColorList.length) {
strokeColorList.forEach((color, index) => {
if (color && localIcon[index]) {
localIcon[index].strokeColor = color;
}
});
}
if (strokeWidthList.length) {
strokeWidthList.forEach((width, index) => {
if (width && localIcon[index]) {
localIcon[index].strokeWidth = width;
}
});
}
return localIcon;
};
const IconSVG = styled.svg.attrs(({ size, qaLabel, viewBoxSize, filter }) => ({
width: size,
height: size,
viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`,
"data-qa-label": qaLabel,
filter
}))`
display: inline-block;
width: ${({ size }) => size}px;
height: ${({ size }) => size}px;
fill: ${({ color, colorList }) =>
color !== "inherit" && colorList.length === 0 && color};
stroke: ${({ stroke }) => stroke !== "inherit" && stroke};
${({ filter }) => (filter ? `filter: ${filter};` : "")};
`;
const Icon = ({
icon,
size,
qaLabel,
className,
colorList,
stroke,
strokeColorList,
strokeWidthList,
filter,
color,
viewBoxSize
}) => (
<IconSVG
size={size}
qaLabel={qaLabel}
className={className}
colorList={colorList}
filter={filter}
color={color}
stroke={stroke}
viewBoxSize={viewBoxSize}
>
{generatePaths(
colorList.length || strokeColorList.length || strokeWidthList.length
? colorize(colorList, strokeColorList, strokeWidthList, icon.shapes)
: icon?.shapes || [],
qaLabel
)}
</IconSVG>
);
Icon.defaultProps = {
size: 16,
icon: null,
color: "inherit",
stroke: "inherit",
className: "",
qaLabel: null,
filter: "",
colorList: [],
strokeColorList: [],
strokeWidthList: [],
viewBoxSize: 1024
};
export default Icon;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/LoginInput/styled-components.js
import styled, { css } from "styled-components";
import buildInput from "../../_atom/Input";
import { buildText } from "../../_atom/Text";
import Button from "../../_atom/Buttons/button";
import { fontNormal, fontMedium } from "../../_static/Typography";
import Icon from "../../_static/Icons";
import buildColor from "../../_static/ColorPalette";
const buildLoginInput = (isPasswordType) => styled(
buildInput({
type: isPasswordType ? "password" : "text"
})
)`
border-bottom: ${(props) =>
props.isError && `2px solid ${buildColor("red", "500")}`};
padding-right: ${(props) => props.isPassword && "64px"};
padding-left: 0;
appearance: none;
box-shadow: 0 2px 2px rgb(17 43 68 / 15%);
${({ isError }) => css`
border: ${(isError && `2px solid ${buildColor("orange", "600")}`) ||
`1px solid ${buildColor("blue", "100")}`};
`}
height: 42px;
padding: 12px 12px 12px 5px;
color: ${buildColor("grey", "900")} !important;
&::placeholder {
color: ${(props) =>
props.opacityPlaceholder
? buildColor("blue", "100")
: buildColor("grey", "700")};
font-size: 14px;
}
&:active,
&:focus {
outline: none;
}
&:focus {
border: solid 2px ${buildColor("blue_accent", "500")};
}
&:-webkit-autofill {
&:hover,
&:focus,
&:active,
&:not(:focus) {
box-shadow: 0 0 0 30px ${buildColor("white", "100")} inset !important;
}
}
`;
export const TextInput = buildLoginInput(false);
export const PasswordInput = buildLoginInput(true);
export const InputWrapper = styled.div`
position: relative;
`;
export const WarningMessage = styled.p`
color: ${buildColor("orange", "600")};
font-size: 14px;
font-weight: normal;
margin-top: 4px;
font-family: ${fontNormal};
`;
export const InputContainer = styled.fieldset`
position: relative;
margin-bottom: 20px;
&:first-of-type {
margin-top: 4px;
}
`;
export const ButtonShowHide = styled(Button)`
display: block;
width: 32px;
height: 32px;
background: none;
border-radius: 50%;
cursor: pointer;
font-size: 11px;
font-weight: 700;
color: ${buildColor("blue_accent", "500")};
text-transform: uppercase;
border: none;
outline: none;
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
`;
export const StatusIcon = styled(Icon)`
vertical-align: bottom;
margin-left: 3px;
`;
export const InputLabel = styled(
buildText({
tag: "label",
bold: false,
color: buildColor("grey", "900")
})
)`
font-size: 14px;
position: relative;
font-weight: 500;
margin-bottom: 8px;
font-family: ${fontMedium};
display: flex;
justify-content: space-between;
align-items: baseline;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Input/index.jsx
import { InputElement } from "./styled-components";
export default (inputDataInit) => InputElement(inputDataInit);
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Input/styled-components.js
/* eslint-disable no-unused-expressions */
import styled from "styled-components";
import { fontNormal } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
// eslint-disable-next-line import/prefer-default-export
export const InputElement = (props) => {
const defaultProp = {
type: "text",
qaLabel: ""
};
const inputData = { ...defaultProp, ...props };
return styled.input.attrs({
...(inputData.qaLabel !== ""
? {
"data-qa-label": inputData.qaLabel
}
: {}),
type: inputData.type
})`
font-family: ${fontNormal};
height: 40px;
width: 100%;
font-size: 14px;
border-radius: 2px;
border: 1px solid ${buildColor("grey", "300")};
text-indent: 8px;
box-sizing: border-box;
background-color: transparent;
`;
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/LoginInput/index.jsx
import React, { PureComponent } from "react";
import { noop, bindAll, get } from "lodash";
import { success, warning, eyeShow, eyeHide } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import {
InputWrapper,
ButtonShowHide,
InputLabel,
InputContainer,
StatusIcon,
WarningMessage,
TextInput,
PasswordInput
} from "./styled-components";
import Icon from "../../_static/Icons";
const getIcon = (status, qaLabel) => {
const iconProps =
status === "success"
? { icon: success, color: buildColor("green", "600") }
: {
icon: warning,
color: buildColor("orange", "600")
};
return (
<StatusIcon
icon={iconProps.icon}
color={iconProps.color}
size={16}
qaLabel={`${qaLabel}${status}`}
/>
);
};
export default class InputMolecule extends PureComponent {
static defaultProps = {
type: "text",
status: null,
onChangeHandler: noop,
onBlurHandler: noop,
enterKeyHandler: noop,
value: "",
placeholder: "",
opacityPlaceholder: false,
qaLabel: "",
label: "",
isButtonShown: false
};
constructor(props) {
super(props);
this.state = {
isPasswordType: this.props.type === "password"
};
bindAll(this, [
"changeInputType",
"renderLabel",
"renderInput",
"renderWarningMsg"
]);
}
changeInputType(e) {
e.preventDefault();
this.setState({
isPasswordType: !this.state.isPasswordType
});
}
renderLabel() {
const { type, qaLabel, label } = this.props;
return (
<InputLabel htmlFor={`${type}Login`} data-qa-label={`${qaLabel}Label`}>
{label}
</InputLabel>
);
}
renderInput() {
const Element = !this.state.isPasswordType ? TextInput : PasswordInput;
const field = this.props.isButtonShown ? "password" : "username";
const [show, hide] = [
<Icon
icon={eyeShow}
color={buildColor("white", "100")}
stroke={buildColor("blue_accent", "500")}
/>,
<Icon
icon={eyeHide}
color={buildColor("white", "100")}
stroke={buildColor("blue_accent", "500")}
/>
];
return (
<InputWrapper>
<Element
type={this.state.isPasswordType ? "password" : "text"}
placeholder={this.props.placeholder}
opacityPlaceholder={this.props.opacityPlaceholder}
value={this.props.value}
onChange={(e) => this.props.onChangeHandler(field, e.target.value)}
onBlur={this.props.onBlurHandler}
id={`${this.props.type}Login`}
isError={this.props.status === "error"}
isPassword={this.props.type === "password"}
data-qa-label={`${this.props.qaLabel}Input`}
key={this.props.qaLabel}
onKeyPress={(e) => {
this.props.enterKeyHandler(e);
}}
maxLength={this.props.maxLength && this.props.maxLength}
/>
{this.props.isButtonShown && (
<ButtonShowHide
onClick={this.changeInputType}
type="tertiary"
qaLabel="passwordBtn"
>
{this.state.isPasswordType ? show : hide}
</ButtonShowHide>
)}
</InputWrapper>
);
}
renderWarningMsg() {
const { qaLabel, label, status } = this.props;
return (
status === "error" && (
<WarningMessage data-qa-label={`${qaLabel}ErrMsg`}>
{status && getIcon(status, qaLabel)} Please insert a valid
{React.isValidElement(label) ? get(label, "props.text", "") : label}
</WarningMessage>
)
);
}
render() {
return (
<InputContainer data-qa-label={`${this.props.qaLabel}Section`}>
{this.renderLabel()}
{this.renderInput()}
{this.renderWarningMsg()}
</InputContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/LoginSelect/styled-components.js
import styled, { css } from "styled-components";
import Icon from "../../_static/Icons";
import { fontNormal, fontMedium, defaultSize } from "../../_static/Typography";
import { buildText } from "../../_atom/Text";
import buildColor from "../../_static/ColorPalette";
export const SelectWrapper = styled.div`
position: relative;
`;
export const WarningMessage = styled.p`
color: ${buildColor("orange", "600")};
font-size: ${defaultSize};
font-weight: normal;
margin-top: 4px;
font-family: ${fontNormal};
`;
export const SelectContainer = styled.fieldset`
position: relative;
height: auto;
font-family: ${fontNormal};
`;
export const StatusIcon = styled(Icon)`
margin-left: 3px;
vertical-align: bottom;
margin-right: 3px;
`;
export const SelectLabel = styled(
buildText({
tag: "label",
bold: false,
color: buildColor("grey", "900")
})
)`
font-size: 14px;
display: block;
position: relative;
font-weight: 500;
margin-bottom: 8px;
font-family: ${fontMedium};
`;
export const IconWrapper = styled.span`
position: absolute;
z-index: 1;
right: 5px;
top: 48%;
transform: translateY(-50%);
height: 32px;
width: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
&:hover {
background-color: ${buildColor("blue_accent", "100")};
}
&:active {
background-color: ${buildColor("blue_accent", "200")};
}
`;
export const Select = styled.select`
width: 100%;
height: 42px;
background-color: transparent;
border: 1px solid ${buildColor("grey", "100")};
appearance: none;
position: relative;
z-index: 2;
padding: 12px;
border-radius: 2px;
font-size: 14px;
box-shadow: 0 2px 2px rgb(17 43 68 / 15%);
line-height: 18px;
${({ isError }) =>
isError &&
css`
border: 2px solid ${buildColor("orange", "600")};
`}
margin-bottom: 2px;
font-family: ${fontNormal};
color: ${buildColor("grey", "700")};
&:active,
&:focus {
outline: none;
}
&:active + .chevron-icon-wrapper {
background-color: ${buildColor("blue_accent", "200")};
}
&:focus {
border: solid 2px ${buildColor("blue_accent", "500")};
}
&::-ms-expand {
display: none;
}
&.state-selected {
color: ${buildColor("grey", "900")};
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/LoginSelect/index.jsx
import React, { PureComponent } from "react";
import { noop, bindAll, get } from "lodash";
import { success, warning, arrowDown } from "../../_static/Icons/icons";
import Icon from "../../_static/Icons";
import buildColor from "../../_static/ColorPalette";
import {
SelectWrapper,
Select,
SelectContainer,
SelectLabel,
StatusIcon,
WarningMessage,
IconWrapper
} from "./styled-components";
const getIcon = (status, qaLabel) => {
const iconProps =
status === "success"
? { icon: success, color: buildColor("green", "600") }
: {
icon: warning,
color: buildColor("orange", "600")
};
return (
<StatusIcon
icon={iconProps.icon}
color={iconProps.color}
size={16}
qaLabel={`${qaLabel}${status}`}
/>
);
};
export default class SelectMolecule extends PureComponent {
static defaultProps = {
options: [],
qaLabel: "",
callback: noop,
onBlurHandler: noop,
enterKeyHandler: noop,
status: null,
label: "",
placeholder: ""
};
constructor(props) {
super(props);
bindAll(this, ["renderLabel", "renderSelect", "renderWarningMsg"]);
this.state = {
isStateSelected: false
};
}
renderLabel() {
const { qaLabel, label } = this.props;
return (
<SelectLabel htmlFor="stateSelector" data-qa-label={`${qaLabel}Label`}>
{label}
</SelectLabel>
);
}
renderSelect() {
return (
<SelectWrapper>
<Select
onChange={(e) => {
this.setState({
isStateSelected: e.target.value !== "select-state"
});
this.props.callback("state", e.target.value);
}}
onBlur={(e) => this.props.onBlurHandler(e)}
isError={this.props.status === "error"}
id="stateSelector"
data-qa-label={this.props.qaLabel}
onKeyPress={this.props.enterKeyHandler}
defaultValue="select-state"
className={this.state.isStateSelected && "state-selected"}
>
<option value="select-state" disabled>
Select a State
</option>
{this.props.options.map((opt) => (
<option key={opt.name} value={opt.abbreviation}>
{opt.name}
</option>
))}
</Select>
<IconWrapper className="chevron-icon-wrapper">
<Icon icon={arrowDown} color={buildColor("blue_accent", "500")} />
</IconWrapper>
</SelectWrapper>
);
}
renderWarningMsg() {
const { qaLabel, label, status } = this.props;
const txtLabel = React.isValidElement(label)
? get(label, "props.text", "")
: label;
return (
status === "error" && (
<WarningMessage data-qa-label={`${qaLabel}ErrMsg`}>
{status && getIcon(status, qaLabel)}
Please select a {txtLabel}
</WarningMessage>
)
);
}
render() {
return (
<SelectContainer data-qa-label={`${this.props.qaLabel}Section`}>
{this.renderLabel()}
{this.renderSelect()}
{this.renderWarningMsg()}
</SelectContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MessageBoxV2/styles.js
import buildColor from "../../_static/ColorPalette";
import {
info,
infoOutline,
warningOutline,
successOutline,
glassyError,
promo
} from "../../_static/Icons/icons";
export const styleMapByType = {
default: {
icon: info,
fill: buildColor("blue_accent", "500"),
background: buildColor("white", "0")
},
info: {
icon: infoOutline,
fill: buildColor("blue_accent", "600"),
color: buildColor("blue_accent", "600"),
iconBackground: buildColor("blue_accent", "200"),
borderColor: buildColor("blue_accent", "200"),
background: buildColor("blue_accent", "000")
},
warning: {
icon: warningOutline,
fill: buildColor("orange", "700"),
color: buildColor("orange", "700"),
borderColor: buildColor("orange", "100"),
background: buildColor("orange", "000")
},
success: {
icon: successOutline,
fill: buildColor("green", "600"),
color: buildColor("green", "600"),
iconBackground: buildColor("green", "100"),
borderColor: buildColor("green", "200"),
background: buildColor("green", "000")
},
error: {
icon: glassyError,
fill: buildColor("red", "600"),
color: buildColor("red", "600"),
iconBackground: buildColor("red", "100"),
borderColor: buildColor("red", "200"),
background: buildColor("red", "000")
},
promos: {
icon: promo,
fill: buildColor("yellow", "800"),
color: buildColor("yellow", "900"),
borderColor: buildColor("yellow", "200"),
background: buildColor("yellow", "000")
}
};
export const styleMapBySubtype = {
contextual: {
inlineText: true
},
fullWith: {
hasBorderTop: true,
hasBorderBottom: true
},
floating: {
hasBorderLeft: true,
hasBorderRight: true,
hasBorderTop: true,
hasBorderBottom: true,
hasRoundCorners: true
},
scratchcard: {
hasBorderLeft: true,
hasBorderRight: true,
hasBorderTop: true,
hasBorderBottom: true,
hasRoundCorners: true,
hasDropShadow: true,
hasCloseButton: true,
hasCallToAction: true
}
};
export default styleMapByType;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MessageBoxV2/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import Icon from "../../_static/Icons";
import { fontNormal, fontMedium, defaultSize } from "../../_static/Typography";
export const HorizontalMessageBox = styled.div`
display: flex;
flex-direction: column;
padding: 12px;
text-decoration: none;
font-family: ${fontNormal};
${(props) => css`
background-color: ${props.customStyle.background};
color: ${props.customStyle.color || props.customStyle.fill || "none"};
border: ${props.customStyle.borderColor
? `1px solid ${props.customStyle.borderColor}`
: "none"};
${!props.hasBorderLeft && "border-left: none;"};
${!props.hasBorderRight && "border-right: none;"};
${!props.hasBorderTop && "border-top: none;"};
${!props.hasBorderBottom && "border-bottom: none;"};
border-radius: ${props.hasRoundCorners ? "4px" : "0"};
${props.hasDropShadow &&
css`
box-shadow:
0 4px 4px rgb(0 0 0 / 10%),
0 4px 6px rgb(0 0 0 / 5%);
`};
${props.customStyle.iconBackground &&
css`
svg {
border-radius: 50%;
background-color: ${props.customStyle.iconBackground || "transparent"};
}
`};
`};
`;
export const IconTextWrapper = styled.div`
display: flex;
`;
export const MessageIcon = styled(Icon).attrs({
"data-qa-label": "messageBox-icon"
})`
flex-shrink: 0;
`;
export const TextWrapper = styled.div`
${(props) =>
props.inlineText
? css`
display: inline;
`
: css`
display: flex;
flex-direction: column;
`};
justify-content: center;
flex-grow: 1;
margin-left: ${(props) => props.hasIcon && "12px"};
min-height: ${(props) => props.hasIcon && "16px"};
`;
export const MessageTitle = styled.div`
${(props) => props.inlineText && "display: inline;"};
font-family: ${fontMedium};
font-size: ${defaultSize};
font-weight: 500;
line-height: 19px;
vertical-align: top;
margin-bottom: ${(props) => (props.inlineText ? "0" : "4px")};
${({ color }) => color && `color: ${color};`};
`;
export const MessageContent = styled.p`
${(props) => props.inlineText && "display: inline;"};
font-family: ${fontNormal};
font-size: ${defaultSize};
line-height: 18px;
vertical-align: top;
${({ color }) => color && `color: ${color};`};
`;
export const CloseBtn = styled.button`
cursor: pointer;
width: 16px;
height: 16px;
margin-left: 12px;
background: none;
`;
export const ActionLink = styled(Link)`
margin-top: 8px;
font-family: ${fontMedium};
font-size: ${defaultSize};
font-weight: 500;
line-height: 18px;
text-decoration-line: underline;
${({ color }) => color && `color: ${color};`};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MessageBoxV2/index.jsx
import React from "react";
import Icon from "../../_static/Icons";
import { close } from "../../_static/Icons/icons";
import messageBoxStylesDefault, { styleMapBySubtype } from "./styles";
import {
HorizontalMessageBox,
IconTextWrapper,
MessageIcon,
TextWrapper,
MessageTitle,
MessageContent,
CloseBtn,
ActionLink
} from "./styled-components";
const MessageBoxV2 = (props) => {
const renderMessage = (color, inlineText) => {
const { message: PropsMessage, qaLabel = "" } = props;
const Message = React.isValidElement(PropsMessage) ? (
<MessageContent
data-qa-label={`${qaLabel}message-box`}
color={color}
inlineText={inlineText}
>
{PropsMessage}
</MessageContent>
) : (
// eslint-disable-next-line react/no-danger
<MessageContent
color={color}
inlineText={inlineText}
dangerouslySetInnerHTML={{ __html: PropsMessage }}
/>
);
return Message;
};
const getMsgSubtypeProps = () =>
(props.subtype && styleMapBySubtype[props.subtype]) || {};
const { type, hasIcon, title, children, callToAction, className, onClose } =
props;
const style = messageBoxStylesDefault[type];
const messageProps = getMsgSubtypeProps();
const hasTitle = !!title;
return (
<HorizontalMessageBox
customStyle={style}
hasIcon={hasIcon}
hasTitle={hasTitle}
type={type}
className={className}
data-qa-label={`${props.qaLabel || ""}-${type}`}
{...messageProps}
>
<IconTextWrapper>
{hasIcon && (
<MessageIcon
icon={style.icon}
strokeColorList={style.strokeColorList || []}
size={16}
color={style.fill}
qaLabel={`${props.qaLabel || ""}-icon`}
viewBoxSize={style.viewBoxSize || 1024}
/>
)}
<TextWrapper
hasIcon={hasIcon}
data-qa-label={`${props.qaLabel || ""}-text`}
inlineText={messageProps.inlineText}
>
{title && (
<MessageTitle
data-qa-label={`${props.qaLabel || ""}-title`}
color={style.color}
inlineText={messageProps.inlineText}
>
{messageProps.inlineText ? `${title} - ` : title}
</MessageTitle>
)}
{renderMessage(style.color, messageProps.inlineText)}
{messageProps.hasCallToAction && callToAction && (
<ActionLink
to={callToAction.url}
onClick={callToAction.onClick}
color={style.color}
>
{callToAction.textLink}
</ActionLink>
)}
</TextWrapper>
{messageProps.hasCloseButton && onClose && (
<CloseBtn
onClick={onClose}
data-qa-label={`${props.qaLabel || ""}-closeBtn`}
>
<Icon icon={close} size={16} color={style.color} />
</CloseBtn>
)}
</IconTextWrapper>
{children}
</HorizontalMessageBox>
);
};
MessageBoxV2.defaultProps = {
type: "default",
subtype: "floating",
hasIcon: true,
children: null,
className: "",
qaLabel: "messageBox"
};
export default MessageBoxV2;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/LoginForm/index.jsx
import React, { PureComponent, Fragment } from "react";
import noop from "lodash";
import {
GoogleText,
MessageBoxContainer,
LoginFormComponent,
AsideLabelLink,
SelectWarnText,
GoogleTextLink
} from "./styled-components";
import Input from "../../_molecule/LoginInput";
import Select from "../../_molecule/LoginSelect";
import MessageBox from "../../_molecule/MessageBoxV2";
const CustomLabel = React.memo(({ text, children }) => (
<Fragment>
<span>{text}</span>
{children}
</Fragment>
));
export default class LoginForm extends PureComponent {
static defaultProps = {
redirectToPRF: noop,
isLoginError: false,
errorTitle: "",
errorMessage: null,
usernameStatus: null,
usernameCallback: noop,
username: "",
passwordStatus: null,
passwordCallback: noop,
password: "",
selectCallback: noop,
stateSelectorStatus: null,
signUpCallback: noop,
onBlurHandler: () => {},
onEnterKeyHandler: noop,
states: [],
isProcessing: false,
noStateSelector: false,
closeModal: noop,
recoverLink: "",
awareMessage:
"AWARE - Always Wager Responsible - National Program Gamblers Helpline: 1-800-522-4700. Age restrictions apply and you must live in a location where TVG offers wagering services. Void where prohibited. Other restrictions apply.",
mobile: false,
device: "mobile"
};
usernameBlurHandler = () => this.props.onBlurHandler("username");
passwordBlurHandler = () => this.props.onBlurHandler("password");
selBlurHandler = () => this.props.onBlurHandler("state");
render() {
return (
<Fragment>
{this.props.isLoginError && (
<MessageBoxContainer device={this.props.device}>
<MessageBox
type="error"
subtype={this.props.device === "mobile" ? "fullWith" : "floating"}
title={this.props.errorTitle || "Login Failed"}
message={this.props.errorMessage}
/>
</MessageBoxContainer>
)}
<LoginFormComponent
name="loginForm"
action=""
device={this.props.device}
>
<Input
status={this.props.usernameStatus}
onChangeHandler={this.props.usernameCallback}
onBlurHandler={this.usernameBlurHandler}
value={this.props.username}
placeholder="Username/Email or Account Number"
qaLabel="username"
label="Username/Email or Account Number"
enterKeyHandler={(e) => this.props.onEnterKeyHandler(e)}
/>
<Input
status={this.props.passwordStatus}
onChangeHandler={this.props.passwordCallback}
onBlurHandler={this.passwordBlurHandler}
value={this.props.password}
type="password"
placeholder={this.props.passwordPlaceholder}
qaLabel="password"
label={
<CustomLabel
text={this.props.passwordPlaceholder || "Password or PIN"}
>
<AsideLabelLink
data-qa-label="forgotCredentialsBtn"
to={this.props.recoverLink}
onClick={this.props.redirectToPRF}
>
Forgot Credentials?
</AsideLabelLink>
</CustomLabel>
}
isButtonShown
enterKeyHandler={(e) => this.props.onEnterKeyHandler(e)}
/>
{!this.props.noStateSelector && (
<Select
options={this.props.states}
callback={this.props.selectCallback}
status={this.props.stateSelectorStatus}
qaLabel="stateSelector"
label={
<CustomLabel text="State">
<SelectWarnText qaLabel="select-state-warn">
By entering this site, I certify that I am currently located
in the state selected below.
</SelectWarnText>
</CustomLabel>
}
onBlurHandler={this.selBlurHandler}
enterKeyHandler={(e) => this.props.onEnterKeyHandler(e)}
/>
)}
{typeof window !== "undefined" && window.grecaptcha && (
<GoogleText>
This site is protected by reCAPTCHA and the Google
<GoogleTextLink
href="https://policies.google.com/privacy"
target="_blank"
>
Privacy Policy
</GoogleTextLink>{" "}
and
<GoogleTextLink
href="https://policies.google.com/terms"
target="_blank"
>
Terms of Service
</GoogleTextLink>{" "}
apply.
</GoogleText>
)}
</LoginFormComponent>
</Fragment>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Spinners/index.jsx
import React, { PureComponent } from "react";
import styled, { keyframes } from "styled-components";
import buildColor from "../ColorPalette";
const spinerwingfade = keyframes`
0% {
opacity: 0.85;
}
50% {
opacity: 0.25;
}
100% {
opacity: 0.25;
}
`;
const Spinnerwing = styled.div`
position: absolute;
left: 44.5%;
top: 37%;
width: 10%;
height: 25%;
border-radius: 50%/20%;
background-color: ${(props) => props.color};
animation: ${spinerwingfade} 1s linear infinite;
animation-play-state: running;
&:nth-child(1) {
animation-delay: -1.6666666667s;
transform: rotate(30deg) translate(0, -150%);
}
&:nth-child(2) {
animation-delay: -1.5833333333s;
transform: rotate(60deg) translate(0, -150%);
}
&:nth-child(3) {
animation-delay: -1.5s;
transform: rotate(90deg) translate(0, -150%);
}
&:nth-child(4) {
animation-delay: -1.4166666667s;
transform: rotate(120deg) translate(0, -150%);
}
&:nth-child(5) {
animation-delay: -1.3333333333s;
transform: rotate(150deg) translate(0, -150%);
}
&:nth-child(6) {
animation-delay: -1.25s;
transform: rotate(180deg) translate(0, -150%);
}
&:nth-child(7) {
animation-delay: -1.1666666667s;
transform: rotate(210deg) translate(0, -150%);
}
&:nth-child(8) {
animation-delay: -1.0833333333s;
transform: rotate(240deg) translate(0, -150%);
}
&:nth-child(9) {
animation-delay: -1s;
transform: rotate(270deg) translate(0, -150%);
}
&:nth-child(10) {
animation-delay: -0.9166666667s;
transform: rotate(300deg) translate(0, -150%);
}
&:nth-child(11) {
animation-delay: -0.8333333333s;
transform: rotate(330deg) translate(0, -150%);
}
&:nth-child(12) {
animation-delay: -0.75s;
transform: rotate(360deg) translate(0, -150%);
}
`;
const SpinnerElement = styled.div`
position: relative;
width: ${(props) => `${props.width}px`};
height: ${(props) => `${props.height}px`};
`;
export default class Spinner extends PureComponent {
static defaultProps = {
width: 24,
height: 24,
color: buildColor("black", "100")
};
render() {
return (
<SpinnerElement
width={this.props.width}
height={this.props.height}
data-qa-label={this.props.qaLabel}
>
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
<Spinnerwing color={this.props.color} />
</SpinnerElement>
);
}
}
webpack://frontend-tpt/../../node_modules/polished/dist/polished.es.js
import _extends from '@babel/runtime/helpers/esm/extends';
import _taggedTemplateLiteralLoose from '@babel/runtime/helpers/esm/taggedTemplateLiteralLoose';
// @private
function capitalizeString(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
var positionMap = ['Top', 'Right', 'Bottom', 'Left'];
function generateProperty(property, position) {
if (!property) return position.toLowerCase();
var splitProperty = property.split('-');
if (splitProperty.length > 1) {
splitProperty.splice(1, 0, position);
return splitProperty.reduce(function (acc, val) {
return "" + acc + capitalizeString(val);
});
}
var joinedProperty = property.replace(/([a-z])([A-Z])/g, "$1" + position + "$2");
return property === joinedProperty ? "" + property + position : joinedProperty;
}
function generateStyles(property, valuesWithDefaults) {
var styles = {};
for (var i = 0; i < valuesWithDefaults.length; i += 1) {
if (valuesWithDefaults[i] || valuesWithDefaults[i] === 0) {
styles[generateProperty(property, positionMap[i])] = valuesWithDefaults[i];
}
}
return styles;
}
/**
* Enables shorthand for direction-based properties. It accepts a property (hyphenated or camelCased) and up to four values that map to top, right, bottom, and left, respectively. You can optionally pass an empty string to get only the directional values as properties. You can also optionally pass a null argument for a directional value to ignore it.
* @example
* // Styles as object usage
* const styles = {
* ...directionalProperty('padding', '12px', '24px', '36px', '48px')
* }
*
* // styled-components usage
* const div = styled.div`
* ${directionalProperty('padding', '12px', '24px', '36px', '48px')}
* `
*
* // CSS as JS Output
*
* div {
* 'paddingTop': '12px',
* 'paddingRight': '24px',
* 'paddingBottom': '36px',
* 'paddingLeft': '48px'
* }
*/
function directionalProperty(property) {
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
values[_key - 1] = arguments[_key];
}
// prettier-ignore
var firstValue = values[0],
_values$ = values[1],
secondValue = _values$ === void 0 ? firstValue : _values$,
_values$2 = values[2],
thirdValue = _values$2 === void 0 ? firstValue : _values$2,
_values$3 = values[3],
fourthValue = _values$3 === void 0 ? secondValue : _values$3;
var valuesWithDefaults = [firstValue, secondValue, thirdValue, fourthValue];
return generateStyles(property, valuesWithDefaults);
}
function endsWith (string, suffix) {
return string.substr(-suffix.length) === suffix;
}
/**
* Returns a given CSS value minus its unit (or the original value if an invalid string is passed).
*
* @example
* // Styles as object usage
* const styles = {
* '--dimension': stripUnit('100px')
* }
*
* // styled-components usage
* const div = styled.div`
* --dimension: ${stripUnit('100px')}
* `
*
* // CSS in JS Output
*
* element {
* '--dimension': 100
* }
*/
function stripUnit(value) {
var unitlessValue = parseFloat(value);
if (isNaN(unitlessValue)) return value;
return unitlessValue;
}
/**
* Factory function that creates pixel-to-x converters
* @private
*/
var pxtoFactory = function pxtoFactory(to) {
return function (pxval, base) {
if (base === void 0) {
base = '16px';
}
var newPxval = pxval;
var newBase = base;
if (typeof pxval === 'string') {
if (!endsWith(pxval, 'px')) {
throw new Error("Expected a string ending in \"px\" or a number passed as the first argument to " + to + "(), got \"" + pxval + "\" instead.");
}
newPxval = stripUnit(pxval);
}
if (typeof base === 'string') {
if (!endsWith(base, 'px')) {
throw new Error("Expected a string ending in \"px\" or a number passed as the second argument to " + to + "(), got \"" + base + "\" instead.");
}
newBase = stripUnit(base);
}
if (typeof newPxval === 'string') {
throw new Error("Passed invalid pixel value (\"" + pxval + "\") to " + to + "(), please pass a value like \"12px\" or 12.");
}
if (typeof newBase === 'string') {
throw new Error("Passed invalid base value (\"" + base + "\") to " + to + "(), please pass a value like \"12px\" or 12.");
}
return "" + newPxval / newBase + to;
};
};
/**
* Convert pixel value to ems. The default base value is 16px, but can be changed by passing a
* second argument to the function.
* @function
* @param {string|number} pxval
* @param {string|number} [base='16px']
* @example
* // Styles as object usage
* const styles = {
* 'height': em('16px')
* }
*
* // styled-components usage
* const div = styled.div`
* height: ${em('16px')}
* `
*
* // CSS in JS Output
*
* element {
* 'height': '1em'
* }
*/
var em =
/*#__PURE__*/
pxtoFactory('em');
var cssRegex = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
/**
* Returns a given CSS value and its unit as elements of an array.
*
* @example
* // Styles as object usage
* const styles = {
* '--dimension': getValueAndUnit('100px')[0]
* '--unit': getValueAndUnit('100px')[1]
* }
*
* // styled-components usage
* const div = styled.div`
* --dimension: ${getValueAndUnit('100px')[0]}
* --unit: ${getValueAndUnit('100px')[1]}
* `
*
* // CSS in JS Output
*
* element {
* '--dimension': 100
* '--unit': 'px'
* }
*/
function getValueAndUnit(value) {
if (typeof value !== 'string') return [value, ''];
var matchedValue = value.match(cssRegex);
if (matchedValue) return [parseFloat(value), matchedValue[2]];
return [value, undefined];
}
var ratioNames = {
minorSecond: 1.067,
majorSecond: 1.125,
minorThird: 1.2,
majorThird: 1.25,
perfectFourth: 1.333,
augFourth: 1.414,
perfectFifth: 1.5,
minorSixth: 1.6,
goldenSection: 1.618,
majorSixth: 1.667,
minorSeventh: 1.778,
majorSeventh: 1.875,
octave: 2,
majorTenth: 2.5,
majorEleventh: 2.667,
majorTwelfth: 3,
doubleOctave: 4
};
function getRatio(ratioName) {
return ratioNames[ratioName];
}
/**
* Establish consistent measurements and spacial relationships throughout your projects by incrementing up or down a defined scale. We provide a list of commonly used scales as pre-defined variables.
* @example
* // Styles as object usage
* const styles = {
* // Increment two steps up the default scale
* 'fontSize': modularScale(2)
* }
*
* // styled-components usage
* const div = styled.div`
* // Increment two steps up the default scale
* fontSize: ${modularScale(2)}
* `
*
* // CSS in JS Output
*
* element {
* 'fontSize': '1.77689em'
* }
*/
function modularScale(steps, base, ratio) {
if (base === void 0) {
base = '1em';
}
if (ratio === void 0) {
ratio = 'perfectFourth';
}
if (typeof steps !== 'number') {
throw new Error('Please provide a number of steps to the modularScale helper.');
}
if (typeof ratio === 'string' && !ratioNames[ratio]) {
throw new Error('Please pass a number or one of the predefined scales to the modularScale helper as the ratio.');
}
var realBase = typeof base === 'string' ? stripUnit(base) : base;
var realRatio = typeof ratio === 'string' ? getRatio(ratio) : ratio;
if (typeof realBase === 'string') {
throw new Error("Invalid value passed as base to modularScale, expected number or em string but got \"" + base + "\"");
}
return realBase * Math.pow(realRatio, steps) + "em";
}
/**
* Convert pixel value to rems. The default base value is 16px, but can be changed by passing a
* second argument to the function.
* @function
* @param {string|number} pxval
* @param {string|number} [base='16px']
* @example
* // Styles as object usage
* const styles = {
* 'height': rem('16px')
* }
*
* // styled-components usage
* const div = styled.div`
* height: ${rem('16px')}
* `
*
* // CSS in JS Output
*
* element {
* 'height': '1rem'
* }
*/
var rem =
/*#__PURE__*/
pxtoFactory('rem');
/**
* Returns a CSS calc formula for linear interpolation of a property between two values. Accepts optional minScreen (defaults to '320px') and maxScreen (defaults to '1200px').
*
* @example
* // Styles as object usage
* const styles = {
* fontSize: between('20px', '100px', '400px', '1000px'),
* fontSize: between('20px', '100px')
* }
*
* // styled-components usage
* const div = styled.div`
* fontSize: ${between('20px', '100px', '400px', '1000px')};
* fontSize: ${between('20px', '100px')}
* `
*
* // CSS as JS Output
*
* h1: {
* 'fontSize': 'calc(-33.33333333333334px + 13.333333333333334vw)',
* 'fontSize': 'calc(-9.090909090909093px + 9.090909090909092vw)'
* }
*/
function between(fromSize, toSize, minScreen, maxScreen) {
if (minScreen === void 0) {
minScreen = '320px';
}
if (maxScreen === void 0) {
maxScreen = '1200px';
}
var _getValueAndUnit = getValueAndUnit(fromSize),
unitlessFromSize = _getValueAndUnit[0],
fromSizeUnit = _getValueAndUnit[1];
var _getValueAndUnit2 = getValueAndUnit(toSize),
unitlessToSize = _getValueAndUnit2[0],
toSizeUnit = _getValueAndUnit2[1];
var _getValueAndUnit3 = getValueAndUnit(minScreen),
unitlessMinScreen = _getValueAndUnit3[0],
minScreenUnit = _getValueAndUnit3[1];
var _getValueAndUnit4 = getValueAndUnit(maxScreen),
unitlessMaxScreen = _getValueAndUnit4[0],
maxScreenUnit = _getValueAndUnit4[1];
if (typeof unitlessMinScreen !== 'number' || typeof unitlessMaxScreen !== 'number' || !minScreenUnit || !maxScreenUnit || minScreenUnit !== maxScreenUnit) {
throw new Error('minScreen and maxScreen must be provided as stringified numbers with the same units.');
}
if (typeof unitlessFromSize !== 'number' || typeof unitlessToSize !== 'number' || !fromSizeUnit || !toSizeUnit || fromSizeUnit !== toSizeUnit) {
throw new Error('fromSize and toSize must be provided as stringified numbers with the same units.');
}
var slope = (unitlessFromSize - unitlessToSize) / (unitlessMinScreen - unitlessMaxScreen);
var base = unitlessToSize - slope * unitlessMaxScreen;
return "calc(" + base.toFixed(2) + fromSizeUnit + " + " + (100 * slope).toFixed(2) + "vw)";
}
/**
* CSS to contain a float (credit to CSSMojo).
*
* @example
* // Styles as object usage
* const styles = {
* ...clearFix(),
* }
*
* // styled-components usage
* const div = styled.div`
* ${clearFix()}
* `
*
* // CSS as JS Output
*
* '&::after': {
* 'clear': 'both',
* 'content': '""',
* 'display': 'table'
* }
*/
function clearFix(parent) {
var _ref;
if (parent === void 0) {
parent = '&';
}
var pseudoSelector = parent + "::after";
return _ref = {}, _ref[pseudoSelector] = {
clear: 'both',
content: '""',
display: 'table'
}, _ref;
}
/**
* CSS to fully cover an area. Can optionally be passed an offset to act as a "padding".
*
* @example
* // Styles as object usage
* const styles = {
* ...cover()
* }
*
* // styled-components usage
* const div = styled.div`
* ${cover()}
* `
*
* // CSS as JS Output
*
* div: {
* 'position': 'absolute',
* 'top': '0',
* 'right: '0',
* 'bottom': '0',
* 'left: '0'
* }
*/
function cover(offset) {
if (offset === void 0) {
offset = 0;
}
return {
position: 'absolute',
top: offset,
right: offset,
bottom: offset,
left: offset
};
}
/**
* CSS to represent truncated text with an ellipsis.
*
* @example
* // Styles as object usage
* const styles = {
* ...ellipsis('250px')
* }
*
* // styled-components usage
* const div = styled.div`
* ${ellipsis('250px')}
* `
*
* // CSS as JS Output
*
* div: {
* 'display': 'inline-block',
* 'maxWidth': '250px',
* 'overflow': 'hidden',
* 'textOverflow': 'ellipsis',
* 'whiteSpace': 'nowrap',
* 'wordWrap': 'normal'
* }
*/
function ellipsis(width) {
if (width === void 0) {
width = '100%';
}
return {
display: 'inline-block',
maxWidth: width,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
wordWrap: 'normal'
};
}
/**
* Returns a set of media queries that resizes a property (or set of properties) between a provided fromSize and toSize. Accepts optional minScreen (defaults to '320px') and maxScreen (defaults to '1200px') to constrain the interpolation.
*
* @example
* // Styles as object usage
* const styles = {
* ...fluidRange(
* {
* prop: 'padding',
* fromSize: '20px',
* toSize: '100px',
* },
* '400px',
* '1000px',
* )
* }
*
* // styled-components usage
* const div = styled.div`
* ${fluidRange(
* {
* prop: 'padding',
* fromSize: '20px',
* toSize: '100px',
* },
* '400px',
* '1000px',
* )}
* `
*
* // CSS as JS Output
*
* div: {
* "@media (min-width: 1000px)": Object {
* "padding": "100px",
* },
* "@media (min-width: 400px)": Object {
* "padding": "calc(-33.33333333333334px + 13.333333333333334vw)",
* },
* "padding": "20px",
* }
*/
function fluidRange(cssProp, minScreen, maxScreen) {
if (minScreen === void 0) {
minScreen = '320px';
}
if (maxScreen === void 0) {
maxScreen = '1200px';
}
if (!Array.isArray(cssProp) && typeof cssProp !== 'object' || cssProp === null) {
throw new Error('expects either an array of objects or a single object with the properties prop, fromSize, and toSize.');
}
if (Array.isArray(cssProp)) {
var mediaQueries = {};
var fallbacks = {};
for (var _iterator = cssProp, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _extends2, _extends3;
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var obj = _ref;
if (!obj.prop || !obj.fromSize || !obj.toSize) {
throw new Error('expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.');
}
fallbacks[obj.prop] = obj.fromSize;
mediaQueries["@media (min-width: " + minScreen + ")"] = _extends({}, mediaQueries["@media (min-width: " + minScreen + ")"], (_extends2 = {}, _extends2[obj.prop] = between(obj.fromSize, obj.toSize, minScreen, maxScreen), _extends2));
mediaQueries["@media (min-width: " + maxScreen + ")"] = _extends({}, mediaQueries["@media (min-width: " + maxScreen + ")"], (_extends3 = {}, _extends3[obj.prop] = obj.toSize, _extends3));
}
return _extends({}, fallbacks, mediaQueries);
} else {
var _ref2, _ref3, _ref4;
if (!cssProp.prop || !cssProp.fromSize || !cssProp.toSize) {
throw new Error('expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.');
}
return _ref4 = {}, _ref4[cssProp.prop] = cssProp.fromSize, _ref4["@media (min-width: " + minScreen + ")"] = (_ref2 = {}, _ref2[cssProp.prop] = between(cssProp.fromSize, cssProp.toSize, minScreen, maxScreen), _ref2), _ref4["@media (min-width: " + maxScreen + ")"] = (_ref3 = {}, _ref3[cssProp.prop] = cssProp.toSize, _ref3), _ref4;
}
}
function generateFileReferences(fontFilePath, fileFormats) {
var fileFontReferences = fileFormats.map(function (format) {
return "url(\"" + fontFilePath + "." + format + "\")";
});
return fileFontReferences.join(', ');
}
function generateLocalReferences(localFonts) {
var localFontReferences = localFonts.map(function (font) {
return "local(\"" + font + "\")";
});
return localFontReferences.join(', ');
}
function generateSources(fontFilePath, localFonts, fileFormats) {
var fontReferences = [];
if (localFonts) fontReferences.push(generateLocalReferences(localFonts));
if (fontFilePath) {
fontReferences.push(generateFileReferences(fontFilePath, fileFormats));
}
return fontReferences.join(', ');
}
/**
* CSS for a @font-face declaration.
*
* @example
* // Styles as object basic usage
* const styles = {
* ...fontFace({
* 'fontFamily': 'Sans-Pro',
* 'fontFilePath': 'path/to/file'
* })
* }
*
* // styled-components basic usage
* const GlobalStyle = createGlobalStyle`${
* fontFace({
* 'fontFamily': 'Sans-Pro',
* 'fontFilePath': 'path/to/file'
* }
* )}`
*
* // CSS as JS Output
*
* '@font-face': {
* 'fontFamily': 'Sans-Pro',
* 'src': 'url("path/to/file.eot"), url("path/to/file.woff2"), url("path/to/file.woff"), url("path/to/file.ttf"), url("path/to/file.svg")',
* }
*/
function fontFace(_ref) {
var fontFamily = _ref.fontFamily,
fontFilePath = _ref.fontFilePath,
fontStretch = _ref.fontStretch,
fontStyle = _ref.fontStyle,
fontVariant = _ref.fontVariant,
fontWeight = _ref.fontWeight,
_ref$fileFormats = _ref.fileFormats,
fileFormats = _ref$fileFormats === void 0 ? ['eot', 'woff2', 'woff', 'ttf', 'svg'] : _ref$fileFormats,
localFonts = _ref.localFonts,
unicodeRange = _ref.unicodeRange,
fontDisplay = _ref.fontDisplay,
fontVariationSettings = _ref.fontVariationSettings,
fontFeatureSettings = _ref.fontFeatureSettings;
// Error Handling
if (!fontFamily) throw new Error('fontFace expects a name of a font-family.');
if (!fontFilePath && !localFonts) {
throw new Error('fontFace expects either the path to the font file(s) or a name of a local copy.');
}
if (localFonts && !Array.isArray(localFonts)) {
throw new Error('fontFace expects localFonts to be an array.');
}
if (!Array.isArray(fileFormats)) {
throw new Error('fontFace expects fileFormats to be an array.');
}
var fontFaceDeclaration = {
'@font-face': {
fontFamily: fontFamily,
src: generateSources(fontFilePath, localFonts, fileFormats),
unicodeRange: unicodeRange,
fontStretch: fontStretch,
fontStyle: fontStyle,
fontVariant: fontVariant,
fontWeight: fontWeight,
fontDisplay: fontDisplay,
fontVariationSettings: fontVariationSettings,
fontFeatureSettings: fontFeatureSettings
} // Removes undefined fields for cleaner css object.
};
return JSON.parse(JSON.stringify(fontFaceDeclaration));
}
/**
* CSS to hide text to show a background image in a SEO-friendly way.
*
* @example
* // Styles as object usage
* const styles = {
* 'backgroundImage': 'url(logo.png)',
* ...hideText(),
* }
*
* // styled-components usage
* const div = styled.div`
* backgroundImage: url(logo.png);
* ${hideText()};
* `
*
* // CSS as JS Output
*
* 'div': {
* 'backgroundImage': 'url(logo.png)',
* 'textIndent': '101%',
* 'overflow': 'hidden',
* 'whiteSpace': 'nowrap',
* }
*/
function hideText() {
return {
textIndent: '101%',
overflow: 'hidden',
whiteSpace: 'nowrap'
};
}
/**
* CSS to hide content visually but remain accessible to screen readers.
* from [HTML5 Boilerplate](https://github.com/h5bp/html5-boilerplate/blob/9a176f57af1cfe8ec70300da4621fb9b07e5fa31/src/css/main.css#L121)
*
* @example
* // Styles as object usage
* const styles = {
* ...hideVisually(),
* }
*
* // styled-components usage
* const div = styled.div`
* ${hideVisually()};
* `
*
* // CSS as JS Output
*
* 'div': {
* 'border': '0',
* 'clip': 'rect(0 0 0 0)',
* 'clipPath': 'inset(50%)',
* 'height': '1px',
* 'margin': '-1px',
* 'overflow': 'hidden',
* 'padding': '0',
* 'position': 'absolute',
* 'whiteSpace': 'nowrap',
* 'width': '1px',
* }
*/
function hideVisually() {
return {
border: '0',
clip: 'rect(0 0 0 0)',
clipPath: 'inset(50%)',
height: '1px',
margin: '-1px',
overflow: 'hidden',
padding: '0',
position: 'absolute',
whiteSpace: 'nowrap',
width: '1px'
};
}
/**
* Generates a media query to target HiDPI devices.
*
* @example
* // Styles as object usage
* const styles = {
* [hiDPI(1.5)]: {
* width: 200px;
* }
* }
*
* // styled-components usage
* const div = styled.div`
* ${hiDPI(1.5)} {
* width: 200px;
* }
* `
*
* // CSS as JS Output
*
* '@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
* only screen and (min--moz-device-pixel-ratio: 1.5),
* only screen and (-o-min-device-pixel-ratio: 1.5/1),
* only screen and (min-resolution: 144dpi),
* only screen and (min-resolution: 1.5dppx)': {
* 'width': '200px',
* }
*/
function hiDPI(ratio) {
if (ratio === void 0) {
ratio = 1.3;
}
return "\n @media only screen and (-webkit-min-device-pixel-ratio: " + ratio + "),\n only screen and (min--moz-device-pixel-ratio: " + ratio + "),\n only screen and (-o-min-device-pixel-ratio: " + ratio + "/1),\n only screen and (min-resolution: " + Math.round(ratio * 96) + "dpi),\n only screen and (min-resolution: " + ratio + "dppx)\n ";
}
/**
* CSS to normalize abnormalities across browsers (normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css)
*
* @example
* // Styles as object usage
* const styles = {
* ...normalize(),
* }
*
* // styled-components usage
* const GlobalStyle = createGlobalStyle`${normalize()}`
*
* // CSS as JS Output
*
* html {
* lineHeight: 1.15,
* textSizeAdjust: 100%,
* } ...
*/
function normalize() {
var _ref;
return [(_ref = {
html: {
lineHeight: '1.15',
textSizeAdjust: '100%'
},
body: {
margin: '0'
},
h1: {
fontSize: '2em',
margin: '0.67em 0'
},
hr: {
boxSizing: 'content-box',
height: '0',
overflow: 'visible'
},
pre: {
fontFamily: 'monospace, monospace',
fontSize: '1em'
},
a: {
backgroundColor: 'transparent'
},
'abbr[title]': {
borderBottom: 'none',
textDecoration: 'underline'
}
}, _ref["b,\n strong"] = {
fontWeight: 'bolder'
}, _ref["code,\n kbd,\n samp"] = {
fontFamily: 'monospace, monospace',
fontSize: '1em'
}, _ref.small = {
fontSize: '80%'
}, _ref["sub,\n sup"] = {
fontSize: '75%',
lineHeight: '0',
position: 'relative',
verticalAlign: 'baseline'
}, _ref.sub = {
bottom: '-0.25em'
}, _ref.sup = {
top: '-0.5em'
}, _ref.img = {
borderStyle: 'none'
}, _ref["button,\n input,\n optgroup,\n select,\n textarea"] = {
fontFamily: 'inherit',
fontSize: '100%',
lineHeight: '1.15',
margin: '0'
}, _ref["button,\n input"] = {
overflow: 'visible'
}, _ref["button,\n select"] = {
textTransform: 'none'
}, _ref["button,\n html [type=\"button\"],\n [type=\"reset\"],\n [type=\"submit\"]"] = {
WebkitAppearance: 'button'
}, _ref["button::-moz-focus-inner,\n [type=\"button\"]::-moz-focus-inner,\n [type=\"reset\"]::-moz-focus-inner,\n [type=\"submit\"]::-moz-focus-inner"] = {
borderStyle: 'none',
padding: '0'
}, _ref["button:-moz-focusring,\n [type=\"button\"]:-moz-focusring,\n [type=\"reset\"]:-moz-focusring,\n [type=\"submit\"]:-moz-focusring"] = {
outline: '1px dotted ButtonText'
}, _ref.fieldset = {
padding: '0.35em 0.625em 0.75em'
}, _ref.legend = {
boxSizing: 'border-box',
color: 'inherit',
display: 'table',
maxWidth: '100%',
padding: '0',
whiteSpace: 'normal'
}, _ref.progress = {
verticalAlign: 'baseline'
}, _ref.textarea = {
overflow: 'auto'
}, _ref["[type=\"checkbox\"],\n [type=\"radio\"]"] = {
boxSizing: 'border-box',
padding: '0'
}, _ref["[type=\"number\"]::-webkit-inner-spin-button,\n [type=\"number\"]::-webkit-outer-spin-button"] = {
height: 'auto'
}, _ref['[type="search"]'] = {
WebkitAppearance: 'textfield',
outlineOffset: '-2px'
}, _ref['[type="search"]::-webkit-search-decoration'] = {
WebkitAppearance: 'none'
}, _ref['::-webkit-file-upload-button'] = {
WebkitAppearance: 'button',
font: 'inherit'
}, _ref.details = {
display: 'block'
}, _ref.summary = {
display: 'list-item'
}, _ref.template = {
display: 'none'
}, _ref['[hidden]'] = {
display: 'none'
}, _ref), {
'abbr[title]': {
textDecoration: 'underline dotted'
}
}];
}
/**
* CSS to style the placeholder pseudo-element.
*
* @deprecated - placeholder has been marked for deprecation in polished 2.0 and will be fully deprecated in 3.0. It is no longer needed and can safely be replaced with the non-prefixed placeholder pseudo-element.
*
* @example
* // Styles as object usage
* const styles = {
* ...placeholder({'color': 'blue'})
* }
*
* // styled-components usage
* const div = styled.input`
* ${placeholder({'color': 'blue'})}
* `
*
* // CSS as JS Output
*
* 'input': {
* '&:-moz-placeholder': {
* 'color': 'blue',
* },
* '&:-ms-input-placeholder': {
* 'color': 'blue',
* },
* '&::-moz-placeholder': {
* 'color': 'blue',
* },
* '&::-webkit-input-placeholder': {
* 'color': 'blue',
* },
* },
*/
function placeholder(styles, parent) {
var _ref;
if (parent === void 0) {
parent = '&';
}
return _ref = {}, _ref[parent + "::-webkit-input-placeholder"] = _extends({}, styles), _ref[parent + ":-moz-placeholder"] = _extends({}, styles), _ref[parent + "::-moz-placeholder"] = _extends({}, styles), _ref[parent + ":-ms-input-placeholder"] = _extends({}, styles), _ref;
}
function _templateObject() {
var data = _taggedTemplateLiteralLoose(["radial-gradient(", "", "", "", ")"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
function parseFallback(colorStops) {
return colorStops[0].split(' ')[0];
}
function constructGradientValue(literals) {
var template = '';
for (var i = 0; i < literals.length; i += 1) {
template += literals[i]; // Adds leading coma if properties preceed color-stops
if (i === 3 && (i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]) && ((arguments.length <= 1 ? undefined : arguments[1]) || (arguments.length <= 2 ? undefined : arguments[2]) || (arguments.length <= 3 ? undefined : arguments[3]))) {
template = template.slice(0, -1);
template += ", " + (i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]); // No trailing space if color-stops is the only param provided
} else if (i === 3 && (i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]) && !(arguments.length <= 1 ? undefined : arguments[1]) && !(arguments.length <= 2 ? undefined : arguments[2]) && !(arguments.length <= 3 ? undefined : arguments[3])) {
template += "" + (i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]); // Only adds substitution if it is defined
} else if (i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]) {
template += (i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]) + " ";
}
}
return template.trim();
}
/**
* CSS for declaring a radial gradient, including a fallback background-color. The fallback is either the first color-stop or an explicitly passed fallback color.
*
* @example
* // Styles as object usage
* const styles = {
* ...radialGradient({
* colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'],
* extent: 'farthest-corner at 45px 45px',
* position: 'center',
* shape: 'ellipse',
* })
* }
*
* // styled-components usage
* const div = styled.div`
* ${radialGradient({
* colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'],
* extent: 'farthest-corner at 45px 45px',
* position: 'center',
* shape: 'ellipse',
* })}
*`
*
* // CSS as JS Output
*
* div: {
* 'backgroundColor': '#00FFFF',
* 'backgroundImage': 'radial-gradient(center ellipse farthest-corner at 45px 45px, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)',
* }
*/
function radialGradient(_ref) {
var colorStops = _ref.colorStops,
extent = _ref.extent,
fallback = _ref.fallback,
position = _ref.position,
shape = _ref.shape;
if (!colorStops || colorStops.length < 2) {
throw new Error('radialGradient requries at least 2 color-stops to properly render.');
}
return {
backgroundColor: fallback || parseFallback(colorStops),
backgroundImage: constructGradientValue(_templateObject(), position, shape, extent, colorStops.join(', '))
};
}
/**
* A helper to generate a retina background image and non-retina
* background image. The retina background image will output to a HiDPI media query. The mixin uses
* a _2x.png filename suffix by default.
*
* @example
* // Styles as object usage
* const styles = {
* ...retinaImage('my-img')
* }
*
* // styled-components usage
* const div = styled.div`
* ${retinaImage('my-img')}
* `
*
* // CSS as JS Output
* div {
* backgroundImage: 'url(my-img.png)',
* '@media only screen and (-webkit-min-device-pixel-ratio: 1.3),
* only screen and (min--moz-device-pixel-ratio: 1.3),
* only screen and (-o-min-device-pixel-ratio: 1.3/1),
* only screen and (min-resolution: 144dpi),
* only screen and (min-resolution: 1.5dppx)': {
* backgroundImage: 'url(my-img_2x.png)',
* }
* }
*/
function retinaImage(filename, backgroundSize, extension, retinaFilename, retinaSuffix) {
var _ref;
if (extension === void 0) {
extension = 'png';
}
if (retinaSuffix === void 0) {
retinaSuffix = '_2x';
}
if (!filename) {
throw new Error('Please supply a filename to retinaImage() as the first argument.');
} // Replace the dot at the beginning of the passed extension if one exists
var ext = extension.replace(/^\./, '');
var rFilename = retinaFilename ? retinaFilename + "." + ext : "" + filename + retinaSuffix + "." + ext;
return _ref = {
backgroundImage: "url(" + filename + "." + ext + ")"
}, _ref[hiDPI()] = _extends({
backgroundImage: "url(" + rFilename + ")"
}, backgroundSize ? {
backgroundSize: backgroundSize
} : {}), _ref;
}
/**
* CSS to style the selection pseudo-element.
*
* @deprecated - selection has been marked for deprecation in polished 2.0 and will be fully deprecated in 3.0. It is no longer needed and can safely be replaced with the non-prefixed selection pseudo-element.
*
* @example
* // Styles as object usage
* const styles = {
* ...selection({
* 'backgroundColor': 'blue'
* }, 'section')
* }
*
* // styled-components usage
* const div = styled.div`
* ${selection({'backgroundColor': 'blue'}, 'section')}
* `
*
* // CSS as JS Output
*
* 'div': {
* 'section::-moz-selection': {
* 'backgroundColor':'blue',
* },
* 'section::selection': {
* 'backgroundColor': 'blue',
* }
* }
*/
function selection(styles, parent) {
var _ref;
if (parent === void 0) {
parent = '';
}
return _ref = {}, _ref[parent + "::-moz-selection"] = _extends({}, styles), _ref[parent + "::selection"] = _extends({}, styles), _ref;
}
/* eslint-disable key-spacing */
var functionsMap = {
easeInBack: 'cubic-bezier(0.600, -0.280, 0.735, 0.045)',
easeInCirc: 'cubic-bezier(0.600, 0.040, 0.980, 0.335)',
easeInCubic: 'cubic-bezier(0.550, 0.055, 0.675, 0.190)',
easeInExpo: 'cubic-bezier(0.950, 0.050, 0.795, 0.035)',
easeInQuad: 'cubic-bezier(0.550, 0.085, 0.680, 0.530)',
easeInQuart: 'cubic-bezier(0.895, 0.030, 0.685, 0.220)',
easeInQuint: 'cubic-bezier(0.755, 0.050, 0.855, 0.060)',
easeInSine: 'cubic-bezier(0.470, 0.000, 0.745, 0.715)',
easeOutBack: 'cubic-bezier(0.175, 0.885, 0.320, 1.275)',
easeOutCubic: 'cubic-bezier(0.215, 0.610, 0.355, 1.000)',
easeOutCirc: 'cubic-bezier(0.075, 0.820, 0.165, 1.000)',
easeOutExpo: 'cubic-bezier(0.190, 1.000, 0.220, 1.000)',
easeOutQuad: 'cubic-bezier(0.250, 0.460, 0.450, 0.940)',
easeOutQuart: 'cubic-bezier(0.165, 0.840, 0.440, 1.000)',
easeOutQuint: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)',
easeOutSine: 'cubic-bezier(0.390, 0.575, 0.565, 1.000)',
easeInOutBack: 'cubic-bezier(0.680, -0.550, 0.265, 1.550)',
easeInOutCirc: 'cubic-bezier(0.785, 0.135, 0.150, 0.860)',
easeInOutCubic: 'cubic-bezier(0.645, 0.045, 0.355, 1.000)',
easeInOutExpo: 'cubic-bezier(1.000, 0.000, 0.000, 1.000)',
easeInOutQuad: 'cubic-bezier(0.455, 0.030, 0.515, 0.955)',
easeInOutQuart: 'cubic-bezier(0.770, 0.000, 0.175, 1.000)',
easeInOutQuint: 'cubic-bezier(0.860, 0.000, 0.070, 1.000)',
easeInOutSine: 'cubic-bezier(0.445, 0.050, 0.550, 0.950)'
/* eslint-enable key-spacing */
};
function getTimingFunction(functionName) {
return functionsMap[functionName];
}
/**
* String to represent common easing functions as demonstrated here: (github.com/jaukia/easie).
*
* @example
* // Styles as object usage
* const styles = {
* 'transitionTimingFunction': timingFunctions('easeInQuad')
* }
*
* // styled-components usage
* const div = styled.div`
* transitionTimingFunction: ${timingFunctions('easeInQuad')};
* `
*
* // CSS as JS Output
*
* 'div': {
* 'transitionTimingFunction': 'cubic-bezier(0.550, 0.085, 0.680, 0.530)',
* }
*/
function timingFunctions(timingFunction) {
return getTimingFunction(timingFunction);
}
/**
* Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions.
* @example
* // Styles as object usage
* const styles = {
* ...borderColor('red', 'green', 'blue', 'yellow')
* }
*
* // styled-components usage
* const div = styled.div`
* ${borderColor('red', 'green', 'blue', 'yellow')}
* `
*
* // CSS as JS Output
*
* div {
* 'borderTopColor': 'red',
* 'borderRightColor': 'green',
* 'borderBottomColor': 'blue',
* 'borderLeftColor': 'yellow'
* }
*/
function borderColor() {
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
values[_key] = arguments[_key];
}
return directionalProperty.apply(void 0, ['borderColor'].concat(values));
}
var getBorderWidth = function getBorderWidth(pointingDirection, height, width) {
switch (pointingDirection) {
case 'top':
return "0 " + width[0] / 2 + width[1] + " " + height[0] + height[1] + " " + width[0] / 2 + width[1];
case 'left':
return "" + height[0] / 2 + height[1] + " " + width[0] + width[1] + " " + height[0] / 2 + height[1] + " 0";
case 'bottom':
return "" + height[0] + height[1] + " " + width[0] / 2 + width[1] + " 0 " + width[0] / 2 + width[1];
case 'right':
return "" + height[0] / 2 + height[1] + " 0 " + height[0] / 2 + height[1] + " " + width[0] + width[1];
default:
throw new Error("Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.");
}
}; // needed for border-color
var reverseDirection = ['bottom', 'left', 'top', 'right'];
var NUMBER_AND_FLOAT = /(\d*\.?\d*)/;
/**
* CSS to represent triangle with any pointing direction with an optional background color. Accepts number or px values for height and width.
*
* @example
* // Styles as object usage
*
* const styles = {
* ...triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' })
* }
*
*
* // styled-components usage
* const div = styled.div`
* ${triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' })}
*
*
* // CSS as JS Output
*
* div: {
* 'borderColor': 'transparent',
* 'borderLeftColor': 'red !important',
* 'borderStyle': 'solid',
* 'borderWidth': '50px 0 50px 100px',
* 'height': '0',
* 'width': '0',
* }
*/
function triangle(_ref) {
var pointingDirection = _ref.pointingDirection,
height = _ref.height,
width = _ref.width,
foregroundColor = _ref.foregroundColor,
_ref$backgroundColor = _ref.backgroundColor,
backgroundColor = _ref$backgroundColor === void 0 ? 'transparent' : _ref$backgroundColor;
var widthAndUnit = [parseFloat(width), String(width).replace(NUMBER_AND_FLOAT, '') || 'px'];
var heightAndUnit = [parseFloat(height), String(height).replace(NUMBER_AND_FLOAT, '') || 'px'];
if (isNaN(heightAndUnit[0]) || isNaN(widthAndUnit[0])) {
throw new Error('Passed an invalid value to `height` or `width`. Please provide a pixel based unit');
}
var reverseDirectionIndex = reverseDirection.indexOf(pointingDirection);
return _extends({
width: '0',
height: '0',
borderWidth: getBorderWidth(pointingDirection, heightAndUnit, widthAndUnit),
borderStyle: 'solid'
}, borderColor.apply(void 0, Array.from({
length: 4
}).map(function (_, index) {
return index === reverseDirectionIndex ? foregroundColor : backgroundColor;
})));
}
/**
* Provides an easy way to change the `wordWrap` property.
*
* @example
* // Styles as object usage
* const styles = {
* ...wordWrap('break-word')
* }
*
* // styled-components usage
* const div = styled.div`
* ${wordWrap('break-word')}
* `
*
* // CSS as JS Output
*
* const styles = {
* overflowWrap: 'break-word',
* wordWrap: 'break-word',
* wordBreak: 'break-all',
* }
*/
function wordWrap(wrap) {
if (wrap === void 0) {
wrap = 'break-word';
}
var wordBreak = wrap === 'break-word' ? 'break-all' : wrap;
return {
overflowWrap: wrap,
wordWrap: wrap,
wordBreak: wordBreak
};
}
function colorToInt(color) {
return Math.round(color * 255);
}
function convertToInt(red, green, blue) {
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
}
function hslToRgb(hue, saturation, lightness, convert) {
if (convert === void 0) {
convert = convertToInt;
}
if (saturation === 0) {
// achromatic
return convert(lightness, lightness, lightness);
} // formular from https://en.wikipedia.org/wiki/HSL_and_HSV
var huePrime = hue % 360 / 60;
var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
var red = 0;
var green = 0;
var blue = 0;
if (huePrime >= 0 && huePrime < 1) {
red = chroma;
green = secondComponent;
} else if (huePrime >= 1 && huePrime < 2) {
red = secondComponent;
green = chroma;
} else if (huePrime >= 2 && huePrime < 3) {
green = chroma;
blue = secondComponent;
} else if (huePrime >= 3 && huePrime < 4) {
green = secondComponent;
blue = chroma;
} else if (huePrime >= 4 && huePrime < 5) {
red = secondComponent;
blue = chroma;
} else if (huePrime >= 5 && huePrime < 6) {
red = chroma;
blue = secondComponent;
}
var lightnessModification = lightness - chroma / 2;
var finalRed = red + lightnessModification;
var finalGreen = green + lightnessModification;
var finalBlue = blue + lightnessModification;
return convert(finalRed, finalGreen, finalBlue);
}
var namedColorMap = {
aliceblue: 'f0f8ff',
antiquewhite: 'faebd7',
aqua: '00ffff',
aquamarine: '7fffd4',
azure: 'f0ffff',
beige: 'f5f5dc',
bisque: 'ffe4c4',
black: '000',
blanchedalmond: 'ffebcd',
blue: '0000ff',
blueviolet: '8a2be2',
brown: 'a52a2a',
burlywood: 'deb887',
cadetblue: '5f9ea0',
chartreuse: '7fff00',
chocolate: 'd2691e',
coral: 'ff7f50',
cornflowerblue: '6495ed',
cornsilk: 'fff8dc',
crimson: 'dc143c',
cyan: '00ffff',
darkblue: '00008b',
darkcyan: '008b8b',
darkgoldenrod: 'b8860b',
darkgray: 'a9a9a9',
darkgreen: '006400',
darkgrey: 'a9a9a9',
darkkhaki: 'bdb76b',
darkmagenta: '8b008b',
darkolivegreen: '556b2f',
darkorange: 'ff8c00',
darkorchid: '9932cc',
darkred: '8b0000',
darksalmon: 'e9967a',
darkseagreen: '8fbc8f',
darkslateblue: '483d8b',
darkslategray: '2f4f4f',
darkslategrey: '2f4f4f',
darkturquoise: '00ced1',
darkviolet: '9400d3',
deeppink: 'ff1493',
deepskyblue: '00bfff',
dimgray: '696969',
dimgrey: '696969',
dodgerblue: '1e90ff',
firebrick: 'b22222',
floralwhite: 'fffaf0',
forestgreen: '228b22',
fuchsia: 'ff00ff',
gainsboro: 'dcdcdc',
ghostwhite: 'f8f8ff',
gold: 'ffd700',
goldenrod: 'daa520',
gray: '808080',
green: '008000',
greenyellow: 'adff2f',
grey: '808080',
honeydew: 'f0fff0',
hotpink: 'ff69b4',
indianred: 'cd5c5c',
indigo: '4b0082',
ivory: 'fffff0',
khaki: 'f0e68c',
lavender: 'e6e6fa',
lavenderblush: 'fff0f5',
lawngreen: '7cfc00',
lemonchiffon: 'fffacd',
lightblue: 'add8e6',
lightcoral: 'f08080',
lightcyan: 'e0ffff',
lightgoldenrodyellow: 'fafad2',
lightgray: 'd3d3d3',
lightgreen: '90ee90',
lightgrey: 'd3d3d3',
lightpink: 'ffb6c1',
lightsalmon: 'ffa07a',
lightseagreen: '20b2aa',
lightskyblue: '87cefa',
lightslategray: '789',
lightslategrey: '789',
lightsteelblue: 'b0c4de',
lightyellow: 'ffffe0',
lime: '0f0',
limegreen: '32cd32',
linen: 'faf0e6',
magenta: 'f0f',
maroon: '800000',
mediumaquamarine: '66cdaa',
mediumblue: '0000cd',
mediumorchid: 'ba55d3',
mediumpurple: '9370db',
mediumseagreen: '3cb371',
mediumslateblue: '7b68ee',
mediumspringgreen: '00fa9a',
mediumturquoise: '48d1cc',
mediumvioletred: 'c71585',
midnightblue: '191970',
mintcream: 'f5fffa',
mistyrose: 'ffe4e1',
moccasin: 'ffe4b5',
navajowhite: 'ffdead',
navy: '000080',
oldlace: 'fdf5e6',
olive: '808000',
olivedrab: '6b8e23',
orange: 'ffa500',
orangered: 'ff4500',
orchid: 'da70d6',
palegoldenrod: 'eee8aa',
palegreen: '98fb98',
paleturquoise: 'afeeee',
palevioletred: 'db7093',
papayawhip: 'ffefd5',
peachpuff: 'ffdab9',
peru: 'cd853f',
pink: 'ffc0cb',
plum: 'dda0dd',
powderblue: 'b0e0e6',
purple: '800080',
rebeccapurple: '639',
red: 'f00',
rosybrown: 'bc8f8f',
royalblue: '4169e1',
saddlebrown: '8b4513',
salmon: 'fa8072',
sandybrown: 'f4a460',
seagreen: '2e8b57',
seashell: 'fff5ee',
sienna: 'a0522d',
silver: 'c0c0c0',
skyblue: '87ceeb',
slateblue: '6a5acd',
slategray: '708090',
slategrey: '708090',
snow: 'fffafa',
springgreen: '00ff7f',
steelblue: '4682b4',
tan: 'd2b48c',
teal: '008080',
thistle: 'd8bfd8',
tomato: 'ff6347',
turquoise: '40e0d0',
violet: 'ee82ee',
wheat: 'f5deb3',
white: 'fff',
whitesmoke: 'f5f5f5',
yellow: 'ff0',
yellowgreen: '9acd32'
/**
* Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
* @private
*/
};
function nameToHex(color) {
if (typeof color !== 'string') return color;
var normalizedColorName = color.toLowerCase();
return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color;
}
var hexRegex = /^#[a-fA-F0-9]{6}$/;
var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
var rgbRegex = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
var rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/;
var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/;
var hslaRegex = /^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/;
/**
* Returns an RgbColor or RgbaColor object. This utility function is only useful
* if want to extract a color component. With the color util `toColorString` you
* can convert a RgbColor or RgbaColor object back to a string.
*
* @example
* // Assigns `{ red: 255, green: 0, blue: 0 }` to color1
* const color1 = parseToRgb('rgb(255, 0, 0)');
* // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
* const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
*/
function parseToRgb(color) {
if (typeof color !== 'string') {
throw new Error('Passed an incorrect argument to a color function, please pass a string representation of a color.');
}
var normalizedColor = nameToHex(color);
if (normalizedColor.match(hexRegex)) {
return {
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
};
}
if (normalizedColor.match(hexRgbaRegex)) {
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
return {
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
alpha: alpha
};
}
if (normalizedColor.match(reducedHexRegex)) {
return {
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
};
}
if (normalizedColor.match(reducedRgbaHexRegex)) {
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
return {
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
alpha: _alpha
};
}
var rgbMatched = rgbRegex.exec(normalizedColor);
if (rgbMatched) {
return {
red: parseInt("" + rgbMatched[1], 10),
green: parseInt("" + rgbMatched[2], 10),
blue: parseInt("" + rgbMatched[3], 10)
};
}
var rgbaMatched = rgbaRegex.exec(normalizedColor);
if (rgbaMatched) {
return {
red: parseInt("" + rgbaMatched[1], 10),
green: parseInt("" + rgbaMatched[2], 10),
blue: parseInt("" + rgbaMatched[3], 10),
alpha: parseFloat("" + rgbaMatched[4])
};
}
var hslMatched = hslRegex.exec(normalizedColor);
if (hslMatched) {
var hue = parseInt("" + hslMatched[1], 10);
var saturation = parseInt("" + hslMatched[2], 10) / 100;
var lightness = parseInt("" + hslMatched[3], 10) / 100;
var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
var hslRgbMatched = rgbRegex.exec(rgbColorString);
if (!hslRgbMatched) {
throw new Error("Couldn't generate valid rgb string from " + normalizedColor + ", it returned " + rgbColorString + ".");
}
return {
red: parseInt("" + hslRgbMatched[1], 10),
green: parseInt("" + hslRgbMatched[2], 10),
blue: parseInt("" + hslRgbMatched[3], 10)
};
}
var hslaMatched = hslaRegex.exec(normalizedColor);
if (hslaMatched) {
var _hue = parseInt("" + hslaMatched[1], 10);
var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
if (!_hslRgbMatched) {
throw new Error("Couldn't generate valid rgb string from " + normalizedColor + ", it returned " + _rgbColorString + ".");
}
return {
red: parseInt("" + _hslRgbMatched[1], 10),
green: parseInt("" + _hslRgbMatched[2], 10),
blue: parseInt("" + _hslRgbMatched[3], 10),
alpha: parseFloat("" + hslaMatched[4])
};
}
throw new Error("Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.");
}
function rgbToHsl(color) {
// make sure rgb are contained in a set of [0, 255]
var red = color.red / 255;
var green = color.green / 255;
var blue = color.blue / 255;
var max = Math.max(red, green, blue);
var min = Math.min(red, green, blue);
var lightness = (max + min) / 2;
if (max === min) {
// achromatic
if (color.alpha !== undefined) {
return {
hue: 0,
saturation: 0,
lightness: lightness,
alpha: color.alpha
};
} else {
return {
hue: 0,
saturation: 0,
lightness: lightness
};
}
}
var hue;
var delta = max - min;
var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
switch (max) {
case red:
hue = (green - blue) / delta + (green < blue ? 6 : 0);
break;
case green:
hue = (blue - red) / delta + 2;
break;
default:
// blue case
hue = (red - green) / delta + 4;
break;
}
hue *= 60;
if (color.alpha !== undefined) {
return {
hue: hue,
saturation: saturation,
lightness: lightness,
alpha: color.alpha
};
}
return {
hue: hue,
saturation: saturation,
lightness: lightness
};
}
/**
* Returns an HslColor or HslaColor object. This utility function is only useful
* if want to extract a color component. With the color util `toColorString` you
* can convert a HslColor or HslaColor object back to a string.
*
* @example
* // Assigns `{ hue: 0, saturation: 1, lightness: 0.5 }` to color1
* const color1 = parseToHsl('rgb(255, 0, 0)');
* // Assigns `{ hue: 128, saturation: 1, lightness: 0.5, alpha: 0.75 }` to color2
* const color2 = parseToHsl('hsla(128, 100%, 50%, 0.75)');
*/
function parseToHsl(color) {
// Note: At a later stage we can optimize this function as right now a hsl
// color would be parsed converted to rgb values and converted back to hsl.
return rgbToHsl(parseToRgb(color));
}
/**
* Reduces hex values if possible e.g. #ff8866 to #f86
* @private
*/
var reduceHexValue = function reduceHexValue(value) {
if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
return "#" + value[1] + value[3] + value[5];
}
return value;
};
function numberToHex(value) {
var hex = value.toString(16);
return hex.length === 1 ? "0" + hex : hex;
}
function colorToHex(color) {
return numberToHex(Math.round(color * 255));
}
function convertToHex(red, green, blue) {
return reduceHexValue("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
}
function hslToHex(hue, saturation, lightness) {
return hslToRgb(hue, saturation, lightness, convertToHex);
}
/**
* Returns a string value for the color. The returned result is the smallest possible hex notation.
*
* @example
* // Styles as object usage
* const styles = {
* background: hsl(359, 0.75, 0.4),
* background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${hsl(359, 0.75, 0.4)};
* background: ${hsl({ hue: 360, saturation: 0.75, lightness: 0.4 })};
* `
*
* // CSS in JS Output
*
* element {
* background: "#b3191c";
* background: "#b3191c";
* }
*/
function hsl(value, saturation, lightness) {
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
return hslToHex(value, saturation, lightness);
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
return hslToHex(value.hue, value.saturation, value.lightness);
}
throw new Error('Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).');
}
/**
* Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
*
* @example
* // Styles as object usage
* const styles = {
* background: hsla(359, 0.75, 0.4, 0.7),
* background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 }),
* background: hsla(359, 0.75, 0.4, 1),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${hsla(359, 0.75, 0.4, 0.7)};
* background: ${hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 })};
* background: ${hsla(359, 0.75, 0.4, 1)};
* `
*
* // CSS in JS Output
*
* element {
* background: "rgba(179,25,28,0.7)";
* background: "rgba(179,25,28,0.7)";
* background: "#b3191c";
* }
*/
function hsla(value, saturation, lightness, alpha) {
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
}
throw new Error('Passed invalid arguments to hsla, please pass multiple numbers e.g. hsl(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).');
}
/**
* Returns a string value for the color. The returned result is the smallest possible hex notation.
*
* @example
* // Styles as object usage
* const styles = {
* background: rgb(255, 205, 100),
* background: rgb({ red: 255, green: 205, blue: 100 }),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${rgb(255, 205, 100)};
* background: ${rgb({ red: 255, green: 205, blue: 100 })};
* `
*
* // CSS in JS Output
*
* element {
* background: "#ffcd64";
* background: "#ffcd64";
* }
*/
function rgb(value, green, blue) {
if (typeof value === 'number' && typeof green === 'number' && typeof blue === 'number') {
return reduceHexValue("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
} else if (typeof value === 'object' && green === undefined && blue === undefined) {
return reduceHexValue("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
}
throw new Error('Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).');
}
/**
* Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
*
* Can also be used to fade a color by passing a hex value or named CSS color along with an alpha value.
*
* @example
* // Styles as object usage
* const styles = {
* background: rgba(255, 205, 100, 0.7),
* background: rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 }),
* background: rgba(255, 205, 100, 1),
* background: rgba('#ffffff', 0.4),
* background: rgba('black', 0.7),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${rgba(255, 205, 100, 0.7)};
* background: ${rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 })};
* background: ${rgba(255, 205, 100, 1)};
* background: ${rgba('#ffffff', 0.4)};
* background: ${rgba('black', 0.7)};
* `
*
* // CSS in JS Output
*
* element {
* background: "rgba(255,205,100,0.7)";
* background: "rgba(255,205,100,0.7)";
* background: "#ffcd64";
* background: "rgba(255,255,255,0.4)";
* background: "rgba(0,0,0,0.7)";
* }
*/
function rgba(firstValue, secondValue, thirdValue, fourthValue) {
if (typeof firstValue === 'string' && typeof secondValue === 'number') {
var rgbValue = parseToRgb(firstValue);
return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
} else if (typeof firstValue === 'number' && typeof secondValue === 'number' && typeof thirdValue === 'number' && typeof fourthValue === 'number') {
return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
} else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
}
throw new Error('Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).');
}
var isRgb = function isRgb(color) {
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
};
var isRgba = function isRgba(color) {
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number';
};
var isHsl = function isHsl(color) {
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
};
var isHsla = function isHsla(color) {
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number';
};
var errMsg = 'Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.';
/**
* Converts a RgbColor, RgbaColor, HslColor or HslaColor object to a color string.
* This util is useful in case you only know on runtime which color object is
* used. Otherwise we recommend to rely on `rgb`, `rgba`, `hsl` or `hsla`.
*
* @example
* // Styles as object usage
* const styles = {
* background: toColorString({ red: 255, green: 205, blue: 100 }),
* background: toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }),
* background: toColorString({ hue: 240, saturation: 1, lightness: 0.5 }),
* background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${toColorString({ red: 255, green: 205, blue: 100 })};
* background: ${toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })};
* background: ${toColorString({ hue: 240, saturation: 1, lightness: 0.5 })};
* background: ${toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })};
* `
*
* // CSS in JS Output
* element {
* background: "#ffcd64";
* background: "rgba(255,205,100,0.72)";
* background: "#00f";
* background: "rgba(179,25,25,0.72)";
* }
*/
function toColorString(color) {
if (typeof color !== 'object') throw new Error(errMsg);
if (isRgba(color)) return rgba(color);
if (isRgb(color)) return rgb(color);
if (isHsla(color)) return hsla(color);
if (isHsl(color)) return hsl(color);
throw new Error(errMsg);
}
// Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-redeclare
function curried(f, length, acc) {
return function fn() {
// eslint-disable-next-line prefer-rest-params
var combined = acc.concat(Array.prototype.slice.call(arguments));
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
};
} // eslint-disable-next-line no-redeclare
function curry(f) {
// eslint-disable-line no-redeclare
return curried(f, f.length, []);
}
/**
* Changes the hue of the color. Hue is a number between 0 to 360. The first
* argument for adjustHue is the amount of degrees the color is rotated along
* the color wheel.
*
* @example
* // Styles as object usage
* const styles = {
* background: adjustHue(180, '#448'),
* background: adjustHue('180', 'rgba(101,100,205,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${adjustHue(180, '#448')};
* background: ${adjustHue('180', 'rgba(101,100,205,0.7)')};
* `
*
* // CSS in JS Output
* element {
* background: "#888844";
* background: "rgba(136,136,68,0.7)";
* }
*/
function adjustHue(degree, color) {
var hslColor = parseToHsl(color);
return toColorString(_extends({}, hslColor, {
hue: (hslColor.hue + parseFloat(degree)) % 360
}));
} // prettier-ignore
var curriedAdjustHue =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(adjustHue);
/**
* Returns the complement of the provided color. This is identical to adjustHue(180, <color>).
*
* @example
* // Styles as object usage
* const styles = {
* background: complement('#448'),
* background: complement('rgba(204,205,100,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${complement('#448')};
* background: ${complement('rgba(204,205,100,0.7)')};
* `
*
* // CSS in JS Output
* element {
* background: "#884";
* background: "rgba(153,153,153,0.7)";
* }
*/
function complement(color) {
var hslColor = parseToHsl(color);
return toColorString(_extends({}, hslColor, {
hue: (hslColor.hue + 180) % 360
}));
}
function guard(lowerBoundary, upperBoundary, value) {
return Math.max(lowerBoundary, Math.min(upperBoundary, value));
}
/**
* Returns a string value for the darkened color.
*
* @example
* // Styles as object usage
* const styles = {
* background: darken(0.2, '#FFCD64'),
* background: darken('0.2', 'rgba(255,205,100,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${darken(0.2, '#FFCD64')};
* background: ${darken('0.2', 'rgba(255,205,100,0.7)')};
* `
*
* // CSS in JS Output
*
* element {
* background: "#ffbd31";
* background: "rgba(255,189,49,0.7)";
* }
*/
function darken(amount, color) {
var hslColor = parseToHsl(color);
return toColorString(_extends({}, hslColor, {
lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
}));
} // prettier-ignore
var curriedDarken =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(darken);
/**
* Decreases the intensity of a color. Its range is between 0 to 1. The first
* argument of the desaturate function is the amount by how much the color
* intensity should be decreased.
*
* @example
* // Styles as object usage
* const styles = {
* background: desaturate(0.2, '#CCCD64'),
* background: desaturate('0.2', 'rgba(204,205,100,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${desaturate(0.2, '#CCCD64')};
* background: ${desaturate('0.2', 'rgba(204,205,100,0.7)')};
* `
*
* // CSS in JS Output
* element {
* background: "#b8b979";
* background: "rgba(184,185,121,0.7)";
* }
*/
function desaturate(amount, color) {
var hslColor = parseToHsl(color);
return toColorString(_extends({}, hslColor, {
saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
}));
} // prettier-ignore
var curriedDesaturate =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(desaturate);
/**
* Returns a number (float) representing the luminance of a color.
*
* @example
* // Styles as object usage
* const styles = {
* background: getLuminance('#CCCD64') >= getLuminance('#0000ff') ? '#CCCD64' : '#0000ff',
* background: getLuminance('rgba(58, 133, 255, 1)') >= getLuminance('rgba(255, 57, 149, 1)') ?
* 'rgba(58, 133, 255, 1)' :
* 'rgba(255, 57, 149, 1)',
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${getLuminance('#CCCD64') >= getLuminance('#0000ff') ? '#CCCD64' : '#0000ff'};
* background: ${getLuminance('rgba(58, 133, 255, 1)') >= getLuminance('rgba(255, 57, 149, 1)') ?
* 'rgba(58, 133, 255, 1)' :
* 'rgba(255, 57, 149, 1)'};
*
* // CSS in JS Output
*
* div {
* background: "#CCCD64";
* background: "rgba(58, 133, 255, 1)";
* }
*/
function getLuminance(color) {
var rgbColor = parseToRgb(color);
var _Object$keys$map = Object.keys(rgbColor).map(function (key) {
var channel = rgbColor[key] / 255;
return channel <= 0.03928 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4);
}),
r = _Object$keys$map[0],
g = _Object$keys$map[1],
b = _Object$keys$map[2];
return parseFloat((0.2126 * r + 0.7152 * g + 0.0722 * b).toFixed(3));
}
/**
* Converts the color to a grayscale, by reducing its saturation to 0.
*
* @example
* // Styles as object usage
* const styles = {
* background: grayscale('#CCCD64'),
* background: grayscale('rgba(204,205,100,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${grayscale('#CCCD64')};
* background: ${grayscale('rgba(204,205,100,0.7)')};
* `
*
* // CSS in JS Output
* element {
* background: "#999";
* background: "rgba(153,153,153,0.7)";
* }
*/
function grayscale(color) {
return toColorString(_extends({}, parseToHsl(color), {
saturation: 0
}));
}
/**
* Inverts the red, green and blue values of a color.
*
* @example
* // Styles as object usage
* const styles = {
* background: invert('#CCCD64'),
* background: invert('rgba(101,100,205,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${invert('#CCCD64')};
* background: ${invert('rgba(101,100,205,0.7)')};
* `
*
* // CSS in JS Output
*
* element {
* background: "#33329b";
* background: "rgba(154,155,50,0.7)";
* }
*/
function invert(color) {
// parse color string to rgb
var value = parseToRgb(color);
return toColorString(_extends({}, value, {
red: 255 - value.red,
green: 255 - value.green,
blue: 255 - value.blue
}));
}
/**
* Returns a string value for the lightened color.
*
* @example
* // Styles as object usage
* const styles = {
* background: lighten(0.2, '#CCCD64'),
* background: lighten('0.2', 'rgba(204,205,100,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${lighten(0.2, '#FFCD64')};
* background: ${lighten('0.2', 'rgba(204,205,100,0.7)')};
* `
*
* // CSS in JS Output
*
* element {
* background: "#e5e6b1";
* background: "rgba(229,230,177,0.7)";
* }
*/
function lighten(amount, color) {
var hslColor = parseToHsl(color);
return toColorString(_extends({}, hslColor, {
lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
}));
} // prettier-ignore
var curriedLighten =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(lighten);
/**
* Mixes the two provided colors together by calculating the average of each of the RGB components weighted to the first color by the provided weight.
*
* @example
* // Styles as object usage
* const styles = {
* background: mix(0.5, '#f00', '#00f')
* background: mix(0.25, '#f00', '#00f')
* background: mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${mix(0.5, '#f00', '#00f')};
* background: ${mix(0.25, '#f00', '#00f')};
* background: ${mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')};
* `
*
* // CSS in JS Output
*
* element {
* background: "#7f007f";
* background: "#3f00bf";
* background: "rgba(63, 0, 191, 0.75)";
* }
*/
function mix(weight, color, otherColor) {
var parsedColor1 = parseToRgb(color);
var color1 = _extends({}, parsedColor1, {
alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1
});
var parsedColor2 = parseToRgb(otherColor);
var color2 = _extends({}, parsedColor2, {
alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1 // The formular is copied from the original Sass implementation:
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
});
var alphaDelta = color1.alpha - color2.alpha;
var x = parseFloat(weight) * 2 - 1;
var y = x * alphaDelta === -1 ? x : x + alphaDelta;
var z = 1 + x * alphaDelta;
var weight1 = (y / z + 1) / 2.0;
var weight2 = 1 - weight1;
var mixedColor = {
red: Math.floor(color1.red * weight1 + color2.red * weight2),
green: Math.floor(color1.green * weight1 + color2.green * weight2),
blue: Math.floor(color1.blue * weight1 + color2.blue * weight2),
alpha: color1.alpha + (color2.alpha - color1.alpha) * (parseFloat(weight) / 1.0)
};
return rgba(mixedColor);
} // prettier-ignore
var curriedMix =
/*#__PURE__*/
curry
/* ::<number | string, string, string, string> */
(mix);
/**
* Increases the opacity of a color. Its range for the amount is between 0 to 1.
*
*
* @example
* // Styles as object usage
* const styles = {
* background: opacify(0.1, 'rgba(255, 255, 255, 0.9)');
* background: opacify(0.2, 'hsla(0, 0%, 100%, 0.5)'),
* background: opacify('0.5', 'rgba(255, 0, 0, 0.2)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${opacify(0.1, 'rgba(255, 255, 255, 0.9)')};
* background: ${opacify(0.2, 'hsla(0, 0%, 100%, 0.5)')},
* background: ${opacify('0.5', 'rgba(255, 0, 0, 0.2)')},
* `
*
* // CSS in JS Output
*
* element {
* background: "#fff";
* background: "rgba(255,255,255,0.7)";
* background: "rgba(255,0,0,0.7)";
* }
*/
function opacify(amount, color) {
var parsedColor = parseToRgb(color);
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
var colorWithAlpha = _extends({}, parsedColor, {
alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
});
return rgba(colorWithAlpha);
} // prettier-ignore
var curriedOpacify =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(opacify);
/**
* Returns black or white for best contrast depending on the luminosity of the given color.
* Follows W3C specs for readability at https://www.w3.org/TR/WCAG20-TECHS/G18.html
*
* @example
* // Styles as object usage
* const styles = {
* color: readableColor('#000'),
* color: readableColor('papayawhip'),
* color: readableColor('rgb(255,0,0)'),
* }
*
* // styled-components usage
* const div = styled.div`
* color: ${readableColor('#000')};
* color: ${readableColor('papayawhip')};
* color: ${readableColor('rgb(255,0,0)')};
* `
*
* // CSS in JS Output
*
* element {
* color: "#fff";
* color: "#fff";
* color: "#000";
* }
*/
function readableColor(color) {
return getLuminance(color) > 0.179 ? '#000' : '#fff';
}
/**
* Increases the intensity of a color. Its range is between 0 to 1. The first
* argument of the saturate function is the amount by how much the color
* intensity should be increased.
*
* @example
* // Styles as object usage
* const styles = {
* background: saturate(0.2, '#CCCD64'),
* background: saturate('0.2', 'rgba(204,205,100,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${saturate(0.2, '#FFCD64')};
* background: ${saturate('0.2', 'rgba(204,205,100,0.7)')};
* `
*
* // CSS in JS Output
*
* element {
* background: "#e0e250";
* background: "rgba(224,226,80,0.7)";
* }
*/
function saturate(amount, color) {
var hslColor = parseToHsl(color);
return toColorString(_extends({}, hslColor, {
saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
}));
} // prettier-ignore
var curriedSaturate =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(saturate);
/**
* Sets the hue of a color to the provided value. The hue range can be
* from 0 and 359.
*
* @example
* // Styles as object usage
* const styles = {
* background: setHue(42, '#CCCD64'),
* background: setHue('244', 'rgba(204,205,100,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${setHue(42, '#CCCD64')};
* background: ${setHue('244', 'rgba(204,205,100,0.7)')};
* `
*
* // CSS in JS Output
* element {
* background: "#cdae64";
* background: "rgba(107,100,205,0.7)";
* }
*/
function setHue(hue, color) {
return toColorString(_extends({}, parseToHsl(color), {
hue: parseFloat(hue)
}));
} // prettier-ignore
var curriedSetHue =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(setHue);
/**
* Sets the lightness of a color to the provided value. The lightness range can be
* from 0 and 1.
*
* @example
* // Styles as object usage
* const styles = {
* background: setLightness(0.2, '#CCCD64'),
* background: setLightness('0.75', 'rgba(204,205,100,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${setLightness(0.2, '#CCCD64')};
* background: ${setLightness('0.75', 'rgba(204,205,100,0.7)')};
* `
*
* // CSS in JS Output
* element {
* background: "#4d4d19";
* background: "rgba(223,224,159,0.7)";
* }
*/
function setLightness(lightness, color) {
return toColorString(_extends({}, parseToHsl(color), {
lightness: parseFloat(lightness)
}));
} // prettier-ignore
var curriedSetLightness =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(setLightness);
/**
* Sets the saturation of a color to the provided value. The lightness range can be
* from 0 and 1.
*
* @example
* // Styles as object usage
* const styles = {
* background: setSaturation(0.2, '#CCCD64'),
* background: setSaturation('0.75', 'rgba(204,205,100,0.7)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${setSaturation(0.2, '#CCCD64')};
* background: ${setSaturation('0.75', 'rgba(204,205,100,0.7)')};
* `
*
* // CSS in JS Output
* element {
* background: "#adad84";
* background: "rgba(228,229,76,0.7)";
* }
*/
function setSaturation(saturation, color) {
return toColorString(_extends({}, parseToHsl(color), {
saturation: parseFloat(saturation)
}));
} // prettier-ignore
var curriedSetSaturation =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(setSaturation);
/**
* Shades a color by mixing it with black. `shade` can produce
* hue shifts, where as `darken` manipulates the luminance channel and therefore
* doesn't produce hue shifts.
*
* @example
* // Styles as object usage
* const styles = {
* background: shade(0.25, '#00f')
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${shade(0.25, '#00f')};
* `
*
* // CSS in JS Output
*
* element {
* background: "#00003f";
* }
*/
function shade(percentage, color) {
return curriedMix(parseFloat(percentage), 'rgb(0, 0, 0)', color);
} // prettier-ignore
var curriedShade =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(shade);
/**
* Tints a color by mixing it with white. `tint` can produce
* hue shifts, where as `lighten` manipulates the luminance channel and therefore
* doesn't produce hue shifts.
*
* @example
* // Styles as object usage
* const styles = {
* background: tint(0.25, '#00f')
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${tint(0.25, '#00f')};
* `
*
* // CSS in JS Output
*
* element {
* background: "#bfbfff";
* }
*/
function tint(percentage, color) {
return curriedMix(parseFloat(percentage), 'rgb(255, 255, 255)', color);
} // prettier-ignore
var curriedTint =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(tint);
/**
* Decreases the opacity of a color. Its range for the amount is between 0 to 1.
*
*
* @example
* // Styles as object usage
* const styles = {
* background: transparentize(0.1, '#fff');
* background: transparentize(0.2, 'hsl(0, 0%, 100%)'),
* background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'),
* }
*
* // styled-components usage
* const div = styled.div`
* background: ${transparentize(0.1, '#fff')};
* background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')},
* background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')},
* `
*
* // CSS in JS Output
*
* element {
* background: "rgba(255,255,255,0.9)";
* background: "rgba(255,255,255,0.8)";
* background: "rgba(255,0,0,0.3)";
* }
*/
function transparentize(amount, color) {
var parsedColor = parseToRgb(color);
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
var colorWithAlpha = _extends({}, parsedColor, {
alpha: guard(0, 1, (alpha * 100 - parseFloat(amount) * 100) / 100)
});
return rgba(colorWithAlpha);
} // prettier-ignore
var curriedTransparentize =
/*#__PURE__*/
curry
/* ::<number | string, string, string> */
(transparentize);
/**
* Shorthand for easily setting the animation property. Allows either multiple arrays with animations
* or a single animation spread over the arguments.
* @example
* // Styles as object usage
* const styles = {
* ...animation(['rotate', '1s', 'ease-in-out'], ['colorchange', '2s'])
* }
*
* // styled-components usage
* const div = styled.div`
* ${animation(['rotate', '1s', 'ease-in-out'], ['colorchange', '2s'])}
* `
*
* // CSS as JS Output
*
* div {
* 'animation': 'rotate 1s ease-in-out, colorchange 2s'
* }
* @example
* // Styles as object usage
* const styles = {
* ...animation('rotate', '1s', 'ease-in-out')
* }
*
* // styled-components usage
* const div = styled.div`
* ${animation('rotate', '1s', 'ease-in-out')}
* `
*
* // CSS as JS Output
*
* div {
* 'animation': 'rotate 1s ease-in-out'
* }
*/
function animation() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
// Allow single or multiple animations passed
var multiMode = Array.isArray(args[0]);
if (!multiMode && args.length > 8) {
throw new Error('The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation');
}
var code = args.map(function (arg) {
if (multiMode && !Array.isArray(arg) || !multiMode && Array.isArray(arg)) {
throw new Error("To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')");
}
if (Array.isArray(arg) && arg.length > 8) {
throw new Error('The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation');
}
return Array.isArray(arg) ? arg.join(' ') : arg;
}).join(', ');
return {
animation: code
};
}
/**
* Shorthand that accepts any number of backgroundImage values as parameters for creating a single background statement.
* @example
* // Styles as object usage
* const styles = {
* ...backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)')
* }
*
* // styled-components usage
* const div = styled.div`
* ${backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)')}
* `
*
* // CSS as JS Output
*
* div {
* 'backgroundImage': 'url("/image/background.jpg"), linear-gradient(red, green)'
* }
*/
function backgroundImages() {
for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) {
properties[_key] = arguments[_key];
}
return {
backgroundImage: properties.join(', ')
};
}
/**
* Shorthand that accepts any number of background values as parameters for creating a single background statement.
* @example
* // Styles as object usage
* const styles = {
* ...backgrounds('url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat')
* }
*
* // styled-components usage
* const div = styled.div`
* ${backgrounds('url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat')}
* `
*
* // CSS as JS Output
*
* div {
* 'background': 'url("/image/background.jpg"), linear-gradient(red, green), center no-repeat'
* }
*/
function backgrounds() {
for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) {
properties[_key] = arguments[_key];
}
return {
background: properties.join(', ')
};
}
var sideMap = ['top', 'right', 'bottom', 'left'];
/**
* Shorthand for the border property that splits out individual properties for use with tools like Fela and Styletron. A side keyword can optionally be passed to target only one side's border properties.
*
* @example
* // Styles as object usage
* const styles = {
* ...border('1px', 'solid', 'red')
* }
*
* // styled-components usage
* const div = styled.div`
* ${border('1px', 'solid', 'red')}
* `
*
* // CSS as JS Output
*
* div {
* 'borderColor': 'red',
* 'borderStyle': 'solid',
* 'borderWidth': `1px`,
* }
*
* // Styles as object usage
* const styles = {
* ...border('top', '1px', 'solid', 'red')
* }
*
* // styled-components usage
* const div = styled.div`
* ${border('top', '1px', 'solid', 'red')}
* `
*
* // CSS as JS Output
*
* div {
* 'borderTopColor': 'red',
* 'borderTopStyle': 'solid',
* 'borderTopWidth': `1px`,
* }
*/
function border(sideKeyword) {
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
values[_key - 1] = arguments[_key];
}
if (typeof sideKeyword === 'string' && sideMap.indexOf(sideKeyword) >= 0) {
var _ref;
return _ref = {}, _ref["border" + capitalizeString(sideKeyword) + "Width"] = values[0], _ref["border" + capitalizeString(sideKeyword) + "Style"] = values[1], _ref["border" + capitalizeString(sideKeyword) + "Color"] = values[2], _ref;
} else {
values.unshift(sideKeyword);
return {
borderWidth: values[0],
borderStyle: values[1],
borderColor: values[2]
};
}
}
/**
* Shorthand that accepts a value for side and a value for radius and applies the radius value to both corners of the side.
* @example
* // Styles as object usage
* const styles = {
* ...borderRadius('top', '5px')
* }
*
* // styled-components usage
* const div = styled.div`
* ${borderRadius('top', '5px')}
* `
*
* // CSS as JS Output
*
* div {
* 'borderTopRightRadius': '5px',
* 'borderTopLeftRadius': '5px',
* }
*/
function borderRadius(side, radius) {
var uppercaseSide = capitalizeString(side);
if (!radius && radius !== 0) {
throw new Error('borderRadius expects a radius value as a string or number as the second argument.');
}
if (uppercaseSide === 'Top' || uppercaseSide === 'Bottom') {
var _ref;
return _ref = {}, _ref["border" + uppercaseSide + "RightRadius"] = radius, _ref["border" + uppercaseSide + "LeftRadius"] = radius, _ref;
}
if (uppercaseSide === 'Left' || uppercaseSide === 'Right') {
var _ref2;
return _ref2 = {}, _ref2["borderTop" + uppercaseSide + "Radius"] = radius, _ref2["borderBottom" + uppercaseSide + "Radius"] = radius, _ref2;
}
throw new Error('borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.');
}
/**
* Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions.
* @example
* // Styles as object usage
* const styles = {
* ...borderStyle('solid', 'dashed', 'dotted', 'double')
* }
*
* // styled-components usage
* const div = styled.div`
* ${borderStyle('solid', 'dashed', 'dotted', 'double')}
* `
*
* // CSS as JS Output
*
* div {
* 'borderTopStyle': 'solid',
* 'borderRightStyle': 'dashed',
* 'borderBottomStyle': 'dotted',
* 'borderLeftStyle': 'double'
* }
*/
function borderStyle() {
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
values[_key] = arguments[_key];
}
return directionalProperty.apply(void 0, ['borderStyle'].concat(values));
}
/**
* Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions.
* @example
* // Styles as object usage
* const styles = {
* ...borderWidth('12px', '24px', '36px', '48px')
* }
*
* // styled-components usage
* const div = styled.div`
* ${borderWidth('12px', '24px', '36px', '48px')}
* `
*
* // CSS as JS Output
*
* div {
* 'borderTopWidth': '12px',
* 'borderRightWidth': '24px',
* 'borderBottomWidth': '36px',
* 'borderLeftWidth': '48px'
* }
*/
function borderWidth() {
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
values[_key] = arguments[_key];
}
return directionalProperty.apply(void 0, ['borderWidth'].concat(values));
}
function generateSelectors(template, state) {
var stateSuffix = state ? ":" + state : '';
return template(stateSuffix);
}
/**
* Function helper that adds an array of states to a template of selectors. Used in textInputs and buttons.
* @private
*/
function statefulSelectors(states, template, stateMap) {
if (!template) throw new Error('You must provide a template to this method.');
if (states.length === 0) return generateSelectors(template, null);
var selectors = [];
for (var i = 0; i < states.length; i += 1) {
if (stateMap && stateMap.indexOf(states[i]) < 0) {
throw new Error('You passed an unsupported selector state to this method.');
}
selectors.push(generateSelectors(template, states[i]));
}
selectors = selectors.join(',');
return selectors;
}
var stateMap = [undefined, null, 'active', 'focus', 'hover'];
function template(state) {
return "button" + state + ",\n input[type=\"button\"]" + state + ",\n input[type=\"reset\"]" + state + ",\n input[type=\"submit\"]" + state;
}
/**
* Populates selectors that target all buttons. You can pass optional states to append to the selectors.
* @example
* // Styles as object usage
* const styles = {
* [buttons('active')]: {
* 'border': 'none'
* }
* }
*
* // styled-components usage
* const div = styled.div`
* > ${buttons('active')} {
* border: none;
* }
* `
*
* // CSS in JS Output
*
* 'button:active,
* 'input[type="button"]:active,
* 'input[type=\"reset\"]:active,
* 'input[type=\"submit\"]:active: {
* 'border': 'none'
* }
*/
function buttons() {
for (var _len = arguments.length, states = new Array(_len), _key = 0; _key < _len; _key++) {
states[_key] = arguments[_key];
}
return statefulSelectors(states, template, stateMap);
}
/**
* Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions.
* @example
* // Styles as object usage
* const styles = {
* ...margin('12px', '24px', '36px', '48px')
* }
*
* // styled-components usage
* const div = styled.div`
* ${margin('12px', '24px', '36px', '48px')}
* `
*
* // CSS as JS Output
*
* div {
* 'marginTop': '12px',
* 'marginRight': '24px',
* 'marginBottom': '36px',
* 'marginLeft': '48px'
* }
*/
function margin() {
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
values[_key] = arguments[_key];
}
return directionalProperty.apply(void 0, ['margin'].concat(values));
}
/**
* Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions.
* @example
* // Styles as object usage
* const styles = {
* ...padding('12px', '24px', '36px', '48px')
* }
*
* // styled-components usage
* const div = styled.div`
* ${padding('12px', '24px', '36px', '48px')}
* `
*
* // CSS as JS Output
*
* div {
* 'paddingTop': '12px',
* 'paddingRight': '24px',
* 'paddingBottom': '36px',
* 'paddingLeft': '48px'
* }
*/
function padding() {
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
values[_key] = arguments[_key];
}
return directionalProperty.apply(void 0, ['padding'].concat(values));
}
var positionMap$1 = ['absolute', 'fixed', 'relative', 'static', 'sticky'];
/**
* Shorthand accepts up to five values, including null to skip a value, and maps them to their respective directions. The first value can optionally be a position keyword.
* @example
* // Styles as object usage
* const styles = {
* ...position('12px', '24px', '36px', '48px')
* }
*
* // styled-components usage
* const div = styled.div`
* ${position('12px', '24px', '36px', '48px')}
* `
*
* // CSS as JS Output
*
* div {
* 'top': '12px',
* 'right': '24px',
* 'bottom': '36px',
* 'left': '48px'
* }
*
* // Styles as object usage
* const styles = {
* ...position('absolute', '12px', '24px', '36px', '48px')
* }
*
* // styled-components usage
* const div = styled.div`
* ${position('absolute', '12px', '24px', '36px', '48px')}
* `
*
* // CSS as JS Output
*
* div {
* 'position': 'absolute',
* 'top': '12px',
* 'right': '24px',
* 'bottom': '36px',
* 'left': '48px'
* }
*/
function position(positionKeyword) {
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
values[_key - 1] = arguments[_key];
}
if (positionMap$1.indexOf(positionKeyword) >= 0) {
return _extends({
position: positionKeyword
}, directionalProperty.apply(void 0, [''].concat(values)));
} else {
var firstValue = positionKeyword; // in this case position is actually the first value
return directionalProperty.apply(void 0, ['', firstValue].concat(values));
}
}
/**
* Shorthand to set the height and width properties in a single statement.
* @example
* // Styles as object usage
* const styles = {
* ...size('300px', '250px')
* }
*
* // styled-components usage
* const div = styled.div`
* ${size('300px', '250px')}
* `
*
* // CSS as JS Output
*
* div {
* 'height': '300px',
* 'width': '250px',
* }
*/
function size(height, width) {
if (width === void 0) {
width = height;
}
return {
height: height,
width: width
};
}
var stateMap$1 = [undefined, null, 'active', 'focus', 'hover'];
function template$1(state) {
return "input[type=\"color\"]" + state + ",\n input[type=\"date\"]" + state + ",\n input[type=\"datetime\"]" + state + ",\n input[type=\"datetime-local\"]" + state + ",\n input[type=\"email\"]" + state + ",\n input[type=\"month\"]" + state + ",\n input[type=\"number\"]" + state + ",\n input[type=\"password\"]" + state + ",\n input[type=\"search\"]" + state + ",\n input[type=\"tel\"]" + state + ",\n input[type=\"text\"]" + state + ",\n input[type=\"time\"]" + state + ",\n input[type=\"url\"]" + state + ",\n input[type=\"week\"]" + state + ",\n input:not([type])" + state + ",\n textarea" + state;
}
/**
* Populates selectors that target all text inputs. You can pass optional states to append to the selectors.
* @example
* // Styles as object usage
* const styles = {
* [textInputs('active')]: {
* 'border': 'none'
* }
* }
*
* // styled-components usage
* const div = styled.div`
* > ${textInputs('active')} {
* border: none;
* }
* `
*
* // CSS in JS Output
*
* 'input[type="color"]:active,
* input[type="date"]:active,
* input[type="datetime"]:active,
* input[type="datetime-local"]:active,
* input[type="email"]:active,
* input[type="month"]:active,
* input[type="number"]:active,
* input[type="password"]:active,
* input[type="search"]:active,
* input[type="tel"]:active,
* input[type="text"]:active,
* input[type="time"]:active,
* input[type="url"]:active,
* input[type="week"]:active,
* input:not([type]):active,
* textarea:active': {
* 'border': 'none'
* }
*/
function textInputs() {
for (var _len = arguments.length, states = new Array(_len), _key = 0; _key < _len; _key++) {
states[_key] = arguments[_key];
}
return statefulSelectors(states, template$1, stateMap$1);
}
/**
* Accepts any number of transition values as parameters for creating a single transition statement. You may also pass an array of properties as the first parameter that you would like to apply the same tranisition values to (second parameter).
* @example
* // Styles as object usage
* const styles = {
* ...transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s'),
* ...transitions(['color', 'background-color'], '2.0s ease-in 2s')
* }
*
* // styled-components usage
* const div = styled.div`
* ${transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s')};
* ${transitions(['color', 'background-color'], '2.0s ease-in 2s'),};
* `
*
* // CSS as JS Output
*
* div {
* 'transition': 'opacity 1.0s ease-in 0s, width 2.0s ease-in 2s'
* 'transition': 'color 2.0s ease-in 2s, background-color 2.0s ease-in 2s',
* }
*/
function transitions() {
for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) {
properties[_key] = arguments[_key];
}
if (Array.isArray(properties[0]) && properties.length === 2) {
var value = properties[1];
if (typeof value !== 'string') {
throw new Error('Property must be a string value.');
}
var transitionsString = properties[0].map(function (property) {
return property + " " + value;
}).join(', ');
return {
transition: transitionsString
};
} else {
return {
transition: properties.join(', ')
};
}
}
// Helpers
export { curriedAdjustHue as adjustHue, animation, backgroundImages, backgrounds, between, border, borderColor, borderRadius, borderStyle, borderWidth, buttons, clearFix, complement, cover, curriedDarken as darken, curriedDesaturate as desaturate, directionalProperty, ellipsis, em, fluidRange, fontFace, getLuminance, getValueAndUnit, grayscale, invert, hideText, hideVisually, hiDPI, hsl, hsla, curriedLighten as lighten, margin, curriedMix as mix, modularScale, normalize, curriedOpacify as opacify, padding, parseToHsl, parseToRgb, placeholder, position, radialGradient, readableColor, rem, retinaImage, rgb, rgba, curriedSaturate as saturate, selection, curriedSetHue as setHue, curriedSetLightness as setLightness, curriedSetSaturation as setSaturation, curriedShade as shade, size, stripUnit, textInputs, timingFunctions, curriedTint as tint, toColorString, transitions, curriedTransparentize as transparentize, triangle, wordWrap };
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/ProcessingOverlay/styled-components.js
import styled from "styled-components";
import { transparentize } from "polished";
import { buildText } from "../../_atom/Text";
import buildColor from "../ColorPalette";
export const Overlay = styled.div`
position: absolute;
inset: ${(props) => `${props.top}px`} 0 0 0;
background-color: ${(props) =>
props.isTransparent
? transparentize(0.05, buildColor("white", "100"))
: buildColor("white", "100")};
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 3;
${(props) => props.rounded && "border-radius: 2px;"};
`;
export const Title = styled(
buildText({
tag: "span",
fontSize: 12,
color: buildColor("grey", "900")
})
)`
margin-top: 9px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/ProcessingOverlay/index.jsx
import React from "react";
import Spinner from "../Spinners";
import { Overlay, Title } from "./styled-components";
const ProcessingOverlay = (props) => (
<Overlay
data-qa-label={props.qaLabel}
rounded={props.isRounded}
isTransparent={props.isTransparent}
top={props.customTop}
>
<Spinner qaLabel={`${props.qaLabel}Spinner`} />
<Title qaLabel={`${props.qaLabel}Text`}>Processing</Title>
</Overlay>
);
ProcessingOverlay.defaultProps = {
isRounded: false,
isTransparent: false,
customTop: 0,
qaLabel: "processingRequest"
};
export default ProcessingOverlay;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Title/styled-components.js
/* eslint-disable import/prefer-default-export */
import styled from "styled-components";
import { titleFont, titleFontSecondary } from "../../_static/Typography";
export const buildTitle = (titleDataInit) => {
const defaultProp = {
tag: "h1",
fontSize: -1,
color: "inherit",
uppercase: false,
ellipsis: false
};
const titleData = { ...defaultProp, ...titleDataInit };
const TitleAtom = styled[titleData.tag].attrs({
"data-qa-label": titleData.qaLabel
})`
font-family: ${titleData.fontFamilySecondary
? titleFontSecondary
: titleFont};
${titleData.fontSize >= 0 && `font-size: ${titleData.fontSize}px;`};
text-transform: ${titleData.uppercase && "uppercase"};
color: ${titleData.color !== "inherit" && titleData.color};
margin: 0;
`;
return !titleData.ellipsis
? TitleAtom
: styled(TitleAtom)`
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
`;
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Title/index.jsx
import React, { PureComponent } from "react";
import { buildTitle } from "./styled-components";
export default class Title extends PureComponent {
static defaultProps = {
children: null,
tag: "h1",
ellipsis: false,
uppercase: true,
fontSize: -1,
color: "inherit",
fontFamilySecondary: false,
className: "",
qaLabel: ""
};
render() {
let Tlt = buildTitle({
tag: this.props.tag,
fontSize: this.props.fontSize,
color: this.props.color,
uppercase: this.props.uppercase,
ellipsis: this.props.ellipsis,
fontFamilySecondary: this.props.fontFamilySecondary,
qaLabel: this.props.qaLabel
});
if (this.props.tag !== "h1") {
Tlt = Tlt.withComponent(this.props.tag);
}
return <Tlt className={this.props.className}>{this.props.children}</Tlt>;
}
}
export { buildTitle };
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/Login/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import buildColor from "../../_static/ColorPalette";
import { buildText } from "../../_atom/Text";
import { buildTitle } from "../../_atom/Title";
import { fontNormal, fontMedium } from "../../_static/Typography";
export const LoginResponsibly = styled(
buildText({
tag: "p",
color: buildColor("grey", "700"),
fontSize: 12
})
)`
text-align: center;
line-height: 17px;
padding: 0 4px;
${({ hasMarginTop }) =>
hasMarginTop &&
css`
margin-top: auto;
`}
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
`;
export const LoginMessageWrapper = styled.div`
display: ${({ isLoginError }) => isLoginError && "none"};
padding: 12px;
background-color: ${buildColor("green", "000")};
${({ device }) =>
device === "mobile"
? css`
border-top: 1px solid ${buildColor("green", "200")};
border-bottom: 1px solid ${buildColor("green", "200")};
`
: css`
margin: 24px 24px 0;
border-radius: 4px;
border: 1px solid ${buildColor("green", "200")};
`};
`;
export const LoginMessageTitle = styled(
buildText({
tag: "p",
color: buildColor("green", "600"),
fontSize: 14
})
)`
display: flex;
align-items: center;
font-weight: 500;
line-height: 19px;
font-family: ${fontMedium};
svg {
margin-right: 12px;
background-color: ${buildColor("green", "100")};
border-radius: 50%;
}
`;
export const LoginMessage = styled(
buildText({
tag: "p",
color: buildColor("green", "600"),
fontSize: 14
})
)`
font-weight: 400;
line-height: 19px;
font-family: ${fontNormal};
margin-left: 28px;
`;
export const LoginFooterContainer = styled.div`
z-index: 2;
display: flex;
flex: 1 0 auto;
align-items: center;
flex-direction: column;
${({ device }) =>
device === "mobile"
? css`
padding: 12px;
`
: css`
padding: 0 20px 20px;
`};
& > button {
background: ${buildColor("blue_accent", "500")};
}
& > div#pxElement:empty + button[data-qa-label="loginBtn"] {
margin-top: -4px;
}
`;
export const LoginContainer = styled.section`
display: flex;
flex-grow: 1;
flex-direction: column;
background: ${buildColor("white", "100")};
`;
export const LoginForm = styled.form`
padding: 8px;
overflow-y: scroll;
flex: 1;
`;
export const Content = styled.div`
flex: 0 0 auto;
`;
export const Title = buildTitle({
tag: "h3",
fontSize: 20,
bold: true,
color: buildColor("green", "600"),
uppercase: true
});
export const Text = buildText({
fontSize: 12,
bold: true,
color: buildColor("white", "100"),
uppercase: true
});
export const TitleContainer = styled.div`
padding: 16px 16px 0;
`;
export const ResetCreateLinksContainer = styled.div`
padding: 24px 0 16px;
text-align: center;
display: flex;
`;
export const ResetCredButton = styled(Link)`
height: 16px;
font-size: 12px;
color: ${buildColor("blue_accent", "600")};
text-decoration: none;
display: flex;
align-items: center;
font-family: ${fontMedium};
`;
export const CreateAccountButton = styled.a`
font-size: 14px;
color: ${buildColor("blue_accent", "500")};
text-decoration: none;
height: 16px;
display: flex;
align-items: center;
background-color: transparent;
text-transform: none;
font-weight: normal;
font-family: ${fontMedium};
&:active {
color: ${buildColor("blue_accent", "700")};
}
`;
export const PerimeterxContainer = styled.div`
width: 100%;
margin-top: 4px;
`;
export const RobotMessage = styled.span`
width: 100%;
color: ${buildColor("grey", "900")};
font-family: ${fontNormal};
line-height: 18px;
`;
export const FooterText = styled.span`
color: ${buildColor("grey", "900")};
font-size: 14px;
font-weight: 500;
font-family: ${fontMedium};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/Login/index.jsx
import React, { Component, Fragment } from "react";
import { bindAll, noop } from "lodash";
import Button from "../../_atom/Buttons/button";
import LoginForm from "../../_organism/LoginForm";
import ProcessingOverlay from "../../_static/ProcessingOverlay";
import { fontMedium } from "../../_static/Typography";
import { successOutline } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import {
LoginResponsibly,
LoginFooterContainer,
LoginContainer,
Content,
ResetCreateLinksContainer,
CreateAccountButton,
PerimeterxContainer,
RobotMessage,
FooterText,
LoginMessageWrapper,
LoginMessageTitle,
LoginMessage
} from "./styled-components";
export const renderLoginResponsibly = (
isMobile,
noStateSelector,
message,
hasMarginTop
) => (
<LoginResponsibly
isMobile={isMobile}
data-qa-label="loginResponsible"
hasMarginTop={hasMarginTop}
>
{message}
</LoginResponsibly>
);
export const renderSuccessMessage = (message, device, isLoginError) => {
return (
<LoginMessageWrapper device={device} isLoginError={isLoginError}>
<LoginMessageTitle>
<Icon icon={successOutline} color={buildColor("green", "600")} />
{message.title}
</LoginMessageTitle>
<LoginMessage>{message.message}</LoginMessage>
</LoginMessageWrapper>
);
};
const queryParams = typeof window !== "undefined" ? window.location.search : "";
export default class Login extends Component {
static defaultProps = {
redirectToPRF: noop,
mobile: false,
isLoginError: false,
errorTitle: "",
errorMessage: null,
usernameStatus: null,
usernameCallback: noop,
username: "",
passwordStatus: null,
passwordCallback: noop,
password: "",
selectCallback: noop,
stateSelectorStatus: null,
onLoginCallback: noop,
signUpCallback: noop,
onBlurHandler: noop,
enterKeyHandler: noop,
closeModal: noop,
states: [],
isProcessing: false,
noStateSelector: false,
awareMessage:
"AWARE - Always Wager Responsible - National Program Gamblers Helpline: 1-800-522-4700. Age restrictions apply and you must live in a location where TVG offers wagering services. Void where prohibited. Other restrictions apply.",
hasAwareMessageMarginTop: true,
isHumanChallengeEnabled: false,
robotMessage: "",
recoverLink: `${queryParams}#forgot-credentials`,
hasSuccessMessage: false,
device: "mobile",
isWagerpad: false
};
constructor(props) {
super(props);
bindAll(this, ["renderForm", "renderLoginFooter"]);
}
renderForm() {
return (
<Fragment>
<LoginForm
passwordPlaceholder={this.props.passwordPlaceholder}
mobile={this.props.mobile}
username={this.props.username}
usernameCallback={this.props.usernameCallback}
errorTitle={this.props.errorTitle}
errorMessage={this.props.errorMessage}
password={this.props.password}
passwordCallback={this.props.passwordCallback}
states={this.props.states}
selectCallback={this.props.selectCallback}
noStateSelector={this.props.noStateSelector}
isLoginError={this.props.isLoginError}
usernameStatus={this.props.usernameStatus}
passwordStatus={this.props.passwordStatus}
stateSelectorStatus={this.props.stateSelectorStatus}
onBlurHandler={this.props.onBlurHandler}
onEnterKeyHandler={(e) => this.props.enterKeyHandler(e)}
redirectToPRF={this.props.redirectToPRF}
recoverLink={this.props.recoverLink}
closeModal={this.props.closeModal}
device={this.props.device}
/>
</Fragment>
);
}
renderLoginFooter() {
const { device } = this.props;
return (
<LoginFooterContainer data-qa-label="loginFooter" device={device}>
{this.props.isHumanChallengeEnabled && (
<RobotMessage>{this.props.robotMessage}</RobotMessage>
)}
<PerimeterxContainer id="pxElement" />
{!this.props.isHumanChallengeEnabled && (
<Button
isStretched
onClick={this.props.onLoginCallback}
size="bigger"
isUppercase={false}
textTransform="capitalize"
fontFamily={fontMedium}
qaLabel="loginBtn"
isBold={false}
>
log in
</Button>
)}
<Fragment>
<ResetCreateLinksContainer>
<FooterText data-qa-label="signup-description">
Don’t have an account?
</FooterText>
<CreateAccountButton
qaLabel="createAccountBtn"
onClick={(e) => {
if (!this.props.isWagerpad) {
e.preventDefault();
e.stopPropagation();
this.props.signUpCallback();
}
}}
target="_blank"
href="/registration"
>
Sign up now
</CreateAccountButton>
</ResetCreateLinksContainer>
{device !== "desktop" &&
renderLoginResponsibly(
true,
this.props.noStateSelector,
this.props.awareMessage,
this.props.hasAwareMessageMarginTop
)}
</Fragment>
</LoginFooterContainer>
);
}
render() {
return (
<Fragment>
{this.props.isProcessing && <ProcessingOverlay />}
<LoginContainer
data-qa-label="loginSignUpBlock"
isMobile={this.props.mobile}
>
{this.props.hasSuccessMessage &&
this.props.successMessage &&
renderSuccessMessage(
this.props.successMessage,
this.props.device,
this.props.isLoginError
)}
<Content data-qa-label="loginBlock">{this.renderForm()}</Content>
{this.renderLoginFooter()}
</LoginContainer>
</Fragment>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-custom-hooks/hooks/usePrevious.ts
import { useEffect, useRef } from "react";
// custom hook for getting previous value
export const usePrevious = <T = string>(value: T) => {
const ref = useRef<T>();
useEffect(() => {
ref.current = value;
});
return ref.current;
};
export default usePrevious;
webpack://frontend-tpt/../../packages/tvg-lib-custom-hooks/hooks/useIsomorphicLayoutEffect.ts
import { useLayoutEffect, useEffect } from "react";
const useIsomorphicLayoutEffect =
typeof window !== "undefined" ? useLayoutEffect : useEffect;
export default useIsomorphicLayoutEffect;
webpack://frontend-tpt/../../packages/tvg-lib-custom-hooks/hooks/useForceUpdate.ts
import { useState } from "react";
const useForceUpdate = () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [value, setValue] = useState(0);
return () => setValue((val) => val + 1);
};
export default useForceUpdate;
webpack://frontend-tpt/../../packages/tvg-lib-utils/useFakeInput.js
const useFakeInput = () => {
setTimeout(() => {
const fakeInput = document.createElement("input");
fakeInput.type = "text";
document.body.insertBefore(fakeInput, document.body.firstChild);
fakeInput.focus();
setTimeout(() => {
document.body.removeChild(fakeInput);
window.focus();
}, 10);
});
};
export default useFakeInput;
webpack://frontend-tpt/../../packages/tvg-lib-utils/modalV2.js
import { noop } from "lodash";
import useFakeInput from "./useFakeInput";
export const toggleBodyClass = (
show,
bodyPositionY,
setBodyPositionY,
device
) => {
const isNotDesktop = /mobile|tablet/.test(device);
if (typeof window !== "undefined" && document.body) {
if (show) {
setBodyPositionY(window.pageYOffset);
document.body.style.top = `-${window.pageYOffset}px`;
} else {
window.scrollTo(0, bodyPositionY);
document.body.style.top = "";
}
return isNotDesktop && document.body.classList.toggle("modal", show);
}
return undefined;
};
export const closeModalWrapper = (
callback = noop,
{
useFakeInput: propsUseFakeInput,
device,
isLastModal,
setIsOpen,
bodyPositionY,
setBodyPositionY
}
) => {
if (propsUseFakeInput) {
useFakeInput();
}
window.focus();
setIsOpen(false);
callback();
if (isLastModal) {
toggleBodyClass(false, bodyPositionY, setBodyPositionY, device);
}
};
webpack://frontend-tpt/../../packages/tvg-lib-custom-hooks/hooks/useModalV2Core.ts
import { useEffect, useState } from "react";
import type { NullaryFn } from "@tvg/ts-types/Functional";
import type { Device } from "@tvg/ts-types/Device";
import { closeModalWrapper, toggleBodyClass } from "@tvg/utils/modalV2";
import usePrevious from "./usePrevious";
// Custom hook for core logic of ModalV2 in MEP and FDR
export const useModalV2Core = (
isOpenProp: boolean,
useFakeInput: boolean,
isLastModal: boolean,
device: Device,
onOpen: NullaryFn<unknown>,
forceModalTop: boolean = false,
modalWrapperElementId: string = "modals"
) => {
const previousPropsIsOpen = usePrevious(isOpenProp);
const [isOpenState, setIsOpen] = useState(isOpenProp);
const [bodyPositionY, setBodyPositionY] = useState(0);
const [element, setElement] = useState<HTMLDivElement | null>(null);
const [root, setRoot] = useState<HTMLElement | null>(null);
const [readyToRender, setReadyToRender] = useState(false);
const openModal = () => {
setIsOpen(true);
onOpen();
if (isLastModal) {
toggleBodyClass(true, bodyPositionY, setBodyPositionY, device);
}
};
useEffect(() => {
if (isOpenProp) {
toggleBodyClass(true, bodyPositionY, setBodyPositionY, device);
}
if (
previousPropsIsOpen !== undefined &&
isOpenProp !== previousPropsIsOpen
) {
if (!isOpenProp) {
closeModalWrapper(() => {}, {
useFakeInput,
device,
isLastModal,
setIsOpen,
bodyPositionY,
setBodyPositionY
});
}
if (isOpenProp) {
openModal();
}
}
}, [isOpenProp, previousPropsIsOpen]);
useEffect(() => {
if (typeof window !== "undefined") {
const div = document.createElement("div");
if (forceModalTop) {
div.classList.add("forceModalTop");
}
setElement(div);
const modalWrapper =
document.getElementById(modalWrapperElementId) || document.body;
setRoot(modalWrapper);
}
}, []);
useEffect(() => {
if (element && root) {
root.appendChild(element);
setReadyToRender(true);
}
return () => {
if (root && element) {
root.removeChild(element);
}
};
}, [root, element]);
return {
isOpen: isOpenState,
setIsOpen,
bodyPositionY,
setBodyPositionY,
readyToRender,
element
};
};
export default useModalV2Core;
webpack://frontend-tpt/../../packages/tvg-lib-custom-hooks/hooks/useModalV2Resize.ts
import { useEffect } from "react";
import usePrevious from "./usePrevious";
import useForceUpdate from "./useForceUpdate";
// Custom hook to handle Modal js file on each ModalV2 from MEP and FDR
export const useModalV2Resize = (isOpen: boolean) => {
const forceUpdate = useForceUpdate();
const previousIsOpen = usePrevious(isOpen);
const onResize = () => {
setTimeout(() => {
forceUpdate();
}, 100);
};
useEffect(() => {
if (!previousIsOpen && isOpen && typeof window !== "undefined") {
window.addEventListener("resize", onResize);
// major hack for for resize on ios
setTimeout(() => {
forceUpdate();
}, 200);
} else if (previousIsOpen && !isOpen && typeof window !== "undefined") {
window.removeEventListener("resize", onResize);
}
return () => {
if (typeof window !== "undefined") {
window.removeEventListener("resize", onResize);
}
};
}, [isOpen]);
};
export default useModalV2Resize;
webpack://frontend-tpt/../../packages/tvg-lib-ts-types/Preferences.ts
export enum CONFIRM_MODAL_PREFERENCE {
ALWAYS = "1",
NEVER = "0"
}
webpack://frontend-tpt/../../packages/sh-lib-preferences/utils/types.ts
import { AlertInlineVariants } from "@tvg/design-system/src/components/alertInline/types";
export type NullaryFn<R> = () => R;
export type UnaryFn<A, R> = (a: A) => R;
export type BinaryFn<A, B, R> = (a: A, b: B) => R;
export type TernaryFn<A, B, C, R> = (a: A, b: B, c: C) => R;
export type QuadFn<A, B, C, D, R> = (a: A, b: B, c: C, d: D) => R;
export type QuinFn<A, B, C, D, F, R> = (a: A, b: B, c: C, d: D, f: F) => R;
export type ConfirmationModalType = "BETTING" | "NOTIFICATIONS" | "";
export enum PreferencesTabEnum {
ACCOUNT = "ACCOUNT",
NOTIFICATIONS = "NOTIFICATIONS",
BETTING = "BETTING",
HOMEPAGE_CONFIG = "HOMEPAGE_LAYOUTS"
}
export type GraphWagerType = {
type: {
id: number;
name: string;
};
};
export type GraphResponse = {
wagerTypes: GraphWagerType[];
};
enum WagerGroupsEnum {
WIN = "10",
PLACE = "20",
SHOW = "30",
EXACTA = "110",
TRIFECTA = "160",
SUPERFECTA = "210",
SUPERHIGHFIVE = "260",
PICK = "P"
}
type WagerGroupTypes =
| WagerGroupsEnum.WIN
| WagerGroupsEnum.PLACE
| WagerGroupsEnum.SHOW
| WagerGroupsEnum.EXACTA
| WagerGroupsEnum.TRIFECTA
| WagerGroupsEnum.SUPERFECTA
| WagerGroupsEnum.SUPERHIGHFIVE
| WagerGroupsEnum.PICK;
export type WagerGroups = {
[key in WagerGroupTypes]: WagerGroupsItem;
};
export type PreferencesBetAmount = {
"10": string;
"20": string;
"30": string;
"110": string;
"160": string;
"210": string;
"260": string;
P: string;
};
export type WagerGroupsItem = {
errorMessage?: string;
group: string;
title: string;
value: string;
};
export type DefaultBetPrefs = {
defaultBetType: string;
useMinimumBetAmount: boolean;
useCustomBetAmount: boolean;
default_bet_amount: PreferencesBetAmount;
};
export type AlertTypePref =
| AlertInlineVariants
| "error-single"
| "success.mute"
| "success.unmute"
| "error.mute"
| "error.unmute";
export type AlertPrefs = {
show: boolean;
type: AlertTypePref;
isToggling: boolean;
shouldShowButton?: boolean;
};
export type BettingCapi = {
betConfirmation: {
title: string;
titlePick?: string;
description: string;
label: string;
labelPick?: string;
};
betType: {
title: string;
};
betAmount: {
title: string;
label: Array<string>;
message: string;
placeholder: string;
};
resetButton: string;
};
export type NotificationsCapi = {
raceAlerts: {
title: string;
description: string;
label: [string, string, string];
footer: Array<string>;
};
offersNews: {
title: string;
description: string;
label: Array<string>;
};
promotionActivity: {
title: string;
description: string;
label: Array<string>;
};
talentPicks: {
title: string;
description: string;
label: Array<string>;
btnText: string;
};
other: {
title: string;
description: string;
label: Array<string>;
};
muteBtn: {
mute: string;
unmute: string;
};
alerts: {
error: {
title: string;
message: string;
};
};
};
export type AlertsCapi = {
error: {
title: string;
message: string;
hasButton: boolean;
};
"error-single": {
title: string;
message: string;
hasButton: boolean;
};
success: {
title: string;
message: string;
hasButton: boolean;
};
};
export interface ConfirmationModal {
isOpen: boolean;
type: ConfirmationModalType;
}
export interface ConfirmModalMessage {
BETTING: {
title: string;
firstParagraph: string;
btnText: string;
};
}
export enum ToggleStateEnum {
OFF = "0",
ON = "1"
}
export interface AccountPrefsMessage {
account: {
auth: {
title: string;
toggleTitle: string;
};
};
}
export interface HomepageConfigPrefsMessage {
title: string;
description: string;
}
export type RaceMtpAlertBlock = {
name: string;
onClick: () => void;
enable: boolean;
};
export type MtpOptions = "0" | "2" | "5";
export enum RaceMtpOptions {
zero = "0",
two = "2",
five = "5"
}
export type TalentAlertsCapi = {
headerMessage: string;
};
export type TalentType = {
isActive: boolean;
name: string;
phrases: Array<string>;
pictureUrl: string;
popularity: number;
talentId: string;
tvgAccountId: string;
};
export type SubscribedType = {
favoriteId: number;
entityDob: number;
entityName: string;
entityType: string;
subscriptions: Array<SubscriptionsType>;
};
export type SubscriptionsType = {
channels: Array<SubscriptionsChannelsType>;
eventType: string;
};
export type SubscriptionsChannelsType = {
type: string;
};
export enum NotificationSwitch {
push_offers_and_news = "offersPush",
email_offers_news = "offersEmail",
push_promotion_activity = "promoPush",
email_promotion_activity = "promoEmail",
talent_picks = "talentPicksPush",
push_fanduel_comms = "otherFanduelPush",
email_fanduel_comms = "otherFanduelEmail"
}
export type NotificationsSwitchState = {
[NotificationSwitch.push_offers_and_news]: boolean;
[NotificationSwitch.email_offers_news]: boolean;
[NotificationSwitch.push_promotion_activity]: boolean;
[NotificationSwitch.email_promotion_activity]: boolean;
[NotificationSwitch.talent_picks]: boolean;
[NotificationSwitch.push_fanduel_comms]: boolean;
[NotificationSwitch.email_fanduel_comms]: boolean;
};
export enum PushStringTypes {
push_offers_and_news = "push_offers_and_news",
push_promotion_activity = "push_promotion_activity",
talent_picks = "talent_picks",
push_fanduel_comms = "push_fanduel_comms"
}
export type PushTypes = {
[PushStringTypes.push_offers_and_news]?: boolean;
[PushStringTypes.push_promotion_activity]?: boolean;
[PushStringTypes.talent_picks]?: boolean;
[PushStringTypes.push_fanduel_comms]?: boolean;
};
export enum SubscriptionGroupEnum {
email_offers_news = "email_offers_news",
email_promotion_activity = "email_promotion_activity",
email_fanduel_comms = "email_fanduel_comms"
}
export type SubscriptionGroupType = {
name: SubscriptionGroupEnum;
isSubscribed: boolean;
};
export type EmailParams = {
accountId: string;
email: string;
category: SubscriptionGroupEnum;
};
type UnsubscribeBodyContent = {
description: string;
};
export interface MessageBlock {
name: string;
title: string;
bodyContent: UnsubscribeBodyContent[];
label?: string;
buttonTextPrimary?: string;
buttonTextSecondary: string;
secondaryUrl?: string;
}
export interface EmailUnsubscribeMessage {
unsubscribe: MessageBlock;
confirmation: MessageBlock;
error: MessageBlock;
fallback: MessageBlock;
subscriptionGroups: { [key: string]: string };
}
export type Address = {
streetNumber: string;
address1: string;
address2: string;
city: string;
stateAbbr: string;
zip: string;
};
export type User = {
accountNumber: string;
firstName: string;
lastName: string;
primaryPhone: string;
wagerStatus: number;
emailAddress: string;
homeAddress: Address;
signalProviderId: string;
userName: string;
profile: string;
pin: string;
};
export type LoginServerResponse = {
userDetails: User;
};
export type LoginSuccess = {
status: string;
data?: LoginServerResponse;
fromLogin?: boolean;
};
export type LoginError = {
status?: string;
message?: string;
redirectUrl?: string;
};
webpack://frontend-tpt/../../packages/tvg-lib-utils/capiUtils.js
import { attempt, get, isError, replace, toPairs, escapeRegExp } from "lodash";
export const TOKEN_DELIMITER = "(?:~|#)";
export const replaceCAPIVariables = (message, variables) => {
let modifiedMessage = message;
toPairs(variables).forEach(([key, value]) => {
// eslint-disable-next-line security/detect-non-literal-regexp
modifiedMessage = replace(
modifiedMessage,
new RegExp(TOKEN_DELIMITER + escapeRegExp(key) + TOKEN_DELIMITER, "g"),
value || value === 0 ? value : ""
);
});
return modifiedMessage;
};
/*
* Use this method to parse from CAPI a stringified JSON
*/
export const parseCAPIMessage = (store, capi, defaultValue = {}) => {
const messagesJSON = get(store, `${capi}`, "");
const messages = attempt(JSON.parse, [messagesJSON]);
return isError(messages) ? defaultValue : messages;
};
export default parseCAPIMessage;
webpack://frontend-tpt/../../packages/urp-lib-selectors/users/index.ts
import { get } from "lodash";
import { Store } from "redux";
import { WagerProfile, UserOptedInPromos } from "@tvg/ts-types/User";
import { SeoTrack } from "@tvg/ts-types/Track";
import { CONFIRM_MODAL_PREFERENCE } from "@tvg/ts-types/Preferences";
import { getPortByBrand } from "@tvg/utils/generalUtils";
import { ToggleStateEnum } from "@tvg/sh-lib-preferences/utils/types";
import {
OptInPromotion,
Promo,
UserEligiblePromotion
} from "@tvg/ts-types/Promos";
import parseJSONCapiMessage from "@tvg/utils/capiUtils";
export const getIsLogged = (store: Store): boolean =>
get(store, "userData.logged", undefined);
export const getAccountNumber = (store: Store): string =>
get(store, "userData.user.accountNumber", "");
export const getFdUserId = (store: Store): string =>
get(store, "userData.user.fdUserId", "");
export const getWagerProfile = (store: Store): WagerProfile =>
get(store, "userData.user.profile") || getPortByBrand();
export const getTracksData = (store: Store): Array<SeoTrack> =>
get(store, "app.seoTrackList", []);
export const getOptedInPromos = (store: Store): UserOptedInPromos =>
get(store, "userData.optedInPromos", {});
export const getCPPPromos = (store: Store) =>
get(store, "cppPromos.promotions", []);
export const getBalance = (store: Store): number =>
get(store, "userData.balance", 0);
export const getBonus = (store: Store): number =>
get(store, "userData.bonus", 0);
export const getBalancePreference = (store: Store): ToggleStateEnum =>
get(store, "userData.preferences.balance_is_shown", ToggleStateEnum.OFF);
export const getShowBetConfirmPref = (store: Store): string =>
get(
store,
"userData.preferences.show_bet_confirm",
CONFIRM_MODAL_PREFERENCE.ALWAYS
);
export const getResidenceState = (store: Store): string =>
get(store, "userData.user.homeAddress.state", "");
export const getFirstName = (store: Store): string =>
get(store, "userData.user.firstName", "");
export const getLastName = (store: Store): string =>
get(store, "userData.user.lastName", "");
export const getIsVerified = (store: Store): boolean =>
get(store, "userData.isVerified", false);
export const getIsTermsAccepted = (store: Store): boolean =>
get(store, "userData.isTermsAccepted", false);
export const getEmail = (store: Store): string =>
get(store, "userData.user.emailAddress");
export const getUserPromotions = (store: Store): Promo[] =>
get(store, "userPromos.promotions", []);
export const getUserEligiblePromotions = (
store: Store
): UserEligiblePromotion[] => get(store, "userPromos.eligiblePromotions", []);
export const getUserOptedInPromotions = (store: Store): OptInPromotion[] =>
get(store, "userPromos.optedInPromotions", []);
export const getFavoriteTracks = (store: Store): string[] =>
get(store, "userFavorites.tracks");
export const getHasRequestedLogin = (store: Store) =>
get(store, "userData.hasRequested", false);
export const getBonusFundsWagerMessages = (store: Store) =>
parseJSONCapiMessage(store, "capi.messages.bonusFundsWagerMessages", {});
export const getHasPreviousWagered = (store: Store): boolean | null =>
get(store, "userData.user.hasMadePreviousWager", null);
export const getRedirectTVGSignup = (
store: Store
): { url_redirects: string; enabled: boolean } =>
parseJSONCapiMessage(store, "capi.messages.redirectTVGSignup", {
url_redirect: "",
enabled: false
});
export const getEnableSpecialFuture = (store: Store): boolean =>
get(store, "capi.featureToggles.enableSpecialFuture", false);
export const getGotPreferences = (store: Store): boolean =>
get(store, "userData.gotPreferences");
export const getUserPreferences = (
store: Store
): Record<string, string | Record<string, string>> =>
get(store, "userData.preferences");
webpack://frontend-tpt/../../packages/tvg-lib-formatter/url/index.ts
import { without } from "lodash";
import type {
TalentPickDataRunners,
TalentPickData
} from "@tvg/ts-types/TalentPicks";
type FromByToBetSlip = "rebetBet" | "repeatBet" | "runnerClick";
/*
This method aims to check if an url in internal, relative or external
according to a whitelist
If an element of a white list is not included in an url, this url is tested
to find if it's either relative or external
*/
export const inspectURL = (url: string, whiteList: string[]): string => {
let returnValue = "isInternal";
const localProcessUrl = (localUrl: string) =>
localUrl.replace("www.", "").replace("www-", "");
const processedUrl = localProcessUrl(url);
if (
!whiteList.some((element) =>
processedUrl.includes(localProcessUrl(element))
) ||
whiteList.some((element) =>
processedUrl
.split(".")
.slice(1)
.join(".")
.includes(localProcessUrl(element))
)
) {
returnValue = processedUrl.indexOf("/") === 0 ? "isRelative" : "isExternal";
}
return url.includes("www") && url.includes("/promos")
? "isExternal"
: returnValue;
};
const getBetSlipFromUrl = (type: FromByToBetSlip) => {
switch (type) {
case "rebetBet":
return "&fromRebetBetClick=true";
case "repeatBet":
return "&fromRepeatBetClick=true";
default:
return "&fromRunnerClick=true";
}
};
export const buildBetSlipUrl = (
trackCode: string,
raceNumber: string,
selectedRunner: number,
isGreyhound: boolean = false,
betType: number = 10,
betAmount?: number,
fromOf: FromByToBetSlip = "runnerClick"
): string => {
const betamountSearch = betAmount ? `&betamount=${betAmount}` : "";
const greyhoundsSearch = isGreyhound ? "&greyhounds" : "";
const fromBy = getBetSlipFromUrl(fromOf);
return `/betslip/${trackCode}/Day/${raceNumber}?betselections=${selectedRunner}${fromBy}${betamountSearch}&bettype=${betType}${greyhoundsSearch}`;
};
export const buildPoolBetSlipUrl = (
trackCode: string,
raceNumber: string,
isGreyhound: boolean = false,
betId: number | string = "10"
) =>
`/betslip/${trackCode}/Day/${raceNumber}?bettype=${betId}${
isGreyhound ? "&greyhounds" : ""
}`;
export const buildBetSlipTalentPick = (pick: TalentPickData) => {
const { track, race, amount } = pick;
const betSelections = pick.selections.reduce(
(accumulator: string, currentValue: Array<string>) => {
const raceSelections = currentValue.reduce(
(selections, value) =>
selections !== "" ? `${selections},${value}` : value,
""
);
return accumulator !== ""
? `${accumulator};${raceSelections}`
: raceSelections;
},
""
);
return `/betslip/${track}/Day/${race}?bettype=${pick.wagerType.id}&betamount=${amount}&betselections=${betSelections}&talentPickId=${track}_${race}&talentPickName=${pick.talent.name}`;
};
export const formatTrackName = (trackName: string = ""): string =>
trackName
? trackName
.trim()
.replace(/[/]/g, "")
.replace(/\s/g, "-")
.replace(/-+/g, "-")
.toLowerCase()
: "";
export const addParamToURL = (
currentUrl: string,
paramName: string,
paramValue: string
) =>
currentUrl.includes("?")
? `${currentUrl}&${paramName}=${paramValue}`
: `${currentUrl || "/"}?${paramName}=${paramValue}`;
export const buildTalentPicksTVG5Url = (pick: TalentPickData) => {
const { track, trackName, race, amount, wagerType } = pick;
const betSelections = pick.selections.reduce(
(accumulator, currentValue, index) => {
const raceSelections = currentValue.reduce(
(selections, value) =>
selections !== "" ? `${selections},${value}` : `s${index}=${value}`,
""
);
return accumulator !== ""
? `${accumulator}&${raceSelections}`
: raceSelections;
},
""
);
return `/racetracks/${track}/${formatTrackName(
trackName
)}?race=${race}&${betSelections}&bet=${amount}&wt=${
wagerType.abbreviation || wagerType.id
}`;
};
// TODO: remove greyhounds variation since its only used sometimes.
// and inconsistencies might create navigation issues like Program Page duplication
const buildRaceUrl = (
trackAbbr: string,
trackName: string,
raceNumber: number | string,
isGreyhound: boolean = false
): string =>
`/${isGreyhound ? "greyhounds" : "racetracks"}/${trackAbbr}/${formatTrackName(
trackName
)}?race=${raceNumber}`;
export const buildTalentPickRaceUrl = (
trackAbbr: string,
trackName: string,
raceNumber: number | string
): string =>
`/talent-picks/program/${trackAbbr}/${formatTrackName(
trackName
)}/race-${raceNumber}`;
export const parseSelectionsToString = (
selections: TalentPickDataRunners[][]
): string =>
selections
.map((selection: TalentPickDataRunners[]): string =>
selection
.map((sel: TalentPickDataRunners): string => `${sel.order}`)
.join(",")
)
.join("-");
export const parseSelectionsToObject = (selections: string): number[][] => {
const multiLeg = selections.indexOf("-") > -1;
const legs = multiLeg ? selections.split("-") : [selections];
return legs.map((legSelections) => {
const selectionsSplit = legSelections.split(",");
return selectionsSplit.map((selection: string): number => +selection);
});
};
export const buildLiveUrl = (
trackAbbr: string,
trackName: string,
raceNumber: number | string,
channel: string = "TVG"
): string =>
`/live/${channel}/${trackAbbr}/${formatTrackName(
trackName
)}?race=${raceNumber}`;
export const isFullURL = (url: string): boolean => {
const pattern = /^https?:\/\//;
const isFullUrl = pattern.test(url);
return isFullUrl;
};
export const buildPromoBadgeURL = (
promoPath: string,
raceNumber: string | null = null,
hasStoryblok: boolean = false
): string => {
const promosSlug = without(
promoPath.replace(/^(\/promos|promos)/, "").split("/"),
""
).join("/");
return promoPath
? `?${raceNumber ? `race=${raceNumber}&` : ""}promo=${
hasStoryblok
? `promos/${
promosSlug.charAt(0) === "/" ? promosSlug.substr(1) : promosSlug
}`
: promosSlug
}/#promos`
: `${raceNumber ? `race=${raceNumber}&` : ""}?promo=/#promos`;
};
export const processURL = (url: string): string => {
const pattern = /^https?:\/\//;
const isRelativePath = /^\/.+/.test(url);
const isFullUrl = pattern.test(url);
return !isFullUrl && !isRelativePath ? `http://${url}` : url;
};
export default buildRaceUrl;
webpack://frontend-tpt/../../packages/tvg-lib-ts-types/Race.ts
import { NullaryFn } from "./Functional";
import { WagerType, WagerTypeCodesEnum } from "./Wager";
import { Talent } from "./Talent";
import { TalentPickData } from "./TalentPicks";
import { TopPool } from "./Pool";
import { SpecialCardSourceRace } from "./SpecialWager";
export type RaceStatusTypeCode = "SK" | "RO" | "O" | "IC";
export interface RaceStatusType {
code: RaceStatusTypeCode;
}
export enum RaceStatusEnum {
OPEN = "O",
UP_NEXT = "IC",
RACE_OFFICIAL = "RO",
RACE_OFF = "SK",
MANUALLY_OPENED = "MO",
MANUALLY_CLOSED = "MC"
}
export type RaceLegStatus =
| "open"
| "raceOff"
| "win"
| "lost"
| "pending"
| "attention"
| "unknown";
export type RaceSurfaceEnum = "Dirt";
export type RaceTypeEnum = "Thoroughbred" | "Harness";
export enum RaceTypeCodeEnum {
ALL = "ALL",
THOROUGHBRED = "T",
HARNESS = "H",
GREYHOUNDS = "G",
TB_LARC = "L",
QTR_HORSE = "Q"
}
export enum HighlightedStyle {
Highlighted = "Highlighted",
Normal = "Normal"
}
export enum RaceDistanceCodeEnum {
FURLONG = "F",
METERS = "Mtr",
MILE = "M",
YARD = "Y"
}
export type RaceClassEnum = "Maiden";
export interface RaceOdds {
denominator?: number | null;
numerator?: number;
}
export interface RaceStatus {
code: RaceStatusEnum;
}
export interface TalentPickDataRunners {
order: number;
}
export interface RaceSurface {
name: RaceSurfaceEnum;
shortName?: string;
defaultCondition?: string;
}
export interface RaceType {
name: RaceTypeEnum;
code: RaceTypeCodeEnum;
shortName?: string;
}
export interface RaceTypeCode {
code: RaceTypeCodeEnum;
}
export interface RaceClass {
name: RaceClassEnum;
shortName?: string;
}
export interface RacePool {
amount: number;
wagerType: WagerType;
}
export interface PoolRunnerData {
amount: number;
}
export interface BettingInterestPool {
wagerType: WagerType;
poolRunnersData: Array<PoolRunnerData>;
}
export interface BettingInterestPoolsRunners {
runnerId: string;
scratched: boolean;
}
export interface BettingInterestsPools {
biNumber: number;
runners: Array<BettingInterestPoolsRunners>;
biPools: Array<BettingInterestPool> | null;
}
export interface WillpayLegResult {
legNumber: number;
winningBi: number;
}
export interface WillpayPayout {
bettingInterestNumber: number;
payoutAmount: number;
}
export interface Willpay {
type: WagerType;
wagerAmount: number;
legResults: Array<WillpayLegResult>;
payouts: Array<WillpayPayout>;
}
export interface ProbableBetCombo {
runner1: string;
runner2: string | null;
payout: number;
}
export interface Probable {
amount: number;
minWagerAmount: number;
wagerType: WagerType;
betCombos: Array<ProbableBetCombo>;
}
export interface DistanceValues {
value: string;
code: string;
name: string;
shortName: string;
}
export interface Distance {
date: string;
newValue: DistanceValues;
oldValue: DistanceValues;
}
export interface Change {
date: string;
newValue: string;
oldValue: string;
}
export interface HorseChange {
runnerId: string;
horseName: string;
date: string;
scratched: boolean;
reason: string;
}
export interface JockeyChange {
runnerId: string;
horseName: string;
date: string;
oldValue: string;
newValue: string;
}
export interface SurfaceChanges {
course?: Array<Change>;
tempRailDistance?: Array<Change>;
condition?: Array<Change>;
distance?: Array<Distance>;
}
export interface HorseChanges {
scratched: Array<HorseChange>;
jockey: Array<JockeyChange>;
}
export interface Changes {
surface: SurfaceChanges;
horse: HorseChanges | null;
}
export interface HandicappingSpeedAndClass {
avgClassRating: number;
highSpeed: number;
avgSpeed: number;
lastClassRating: number;
avgDistance: number;
}
export interface HandicappingAveragePace {
finish: number;
numRaces: number;
middle: number;
early: number;
}
export interface HandicappingJockeyTrainer {
places: number;
jockeyName: string;
trainerName: string;
shows: number;
wins: number;
starts: number;
}
export interface HandicappingSnapshot {
powerRating?: number;
daysOff?: number;
horseWins?: number;
horseStarts?: number;
}
export interface HandicappingFreePick {
number?: number;
info?: string;
}
export interface TimeFormFreePick {
number?: number;
info?: string;
}
export interface HandicappingPastResults {
numberOfFirstPlace: number;
numberOfSecondPlace: number;
numberOfThirdPlace: number;
totalNumberOfStarts: number;
top3Percentage: number;
winPercentage: number;
}
export interface Handicapping {
speedAndClass: HandicappingSpeedAndClass;
averagePace: HandicappingAveragePace;
jockeyTrainer: HandicappingJockeyTrainer;
snapshot: HandicappingSnapshot;
freePick: HandicappingFreePick;
pastResults: HandicappingPastResults;
}
export interface HandicapOptions {
key?: string;
value: string | number;
sorting?: string;
}
export interface RaceTimeform {
analystVerdict?: string;
}
export interface Timeform {
silkUrl?: string;
silkUrlSvg?: string;
freePick?: TimeFormFreePick;
analystsComments?: string;
postRaceReport?: string | null;
accBeatenDistance?: string | null;
accBeatenDistanceStatus?: string | null;
winningDistance?: string | null;
winningDistanceStatus?: string | null;
flags?: RunnerFlags;
}
export interface Runner {
age?: number;
horseName: string;
jockey: string;
med?: string;
runnerId: string;
scratched: boolean;
sex?: string;
trainer: string;
weight?: number;
ownerName?: string;
sire?: string;
damSire?: string;
dam?: string;
handicapping?: Handicapping;
dob?: number;
hasJockeyChanges?: boolean;
timeform?: Timeform;
finishPosition?: number;
finishStatus?: string;
runnerName?: string;
runnerNumber?: number;
biNumber?: number;
entityRunnerId?: string;
}
export interface ResultRunner {
betAmount: number;
biNumber: number;
finishPosition: number;
finishStatus?: string;
placePayoff: number;
runnerNumber: string;
runnerName: string;
showPayoff: number;
winPayoff: number;
timeform?: Timeform | null;
favorite?: boolean;
}
export interface RunnerFlags {
horseInFocus: boolean;
warningHorse: boolean;
jockeyUplift: boolean;
trainerUplift: boolean;
horsesForCoursePos: boolean;
horsesForCourseNeg: boolean;
hotTrainer: boolean;
coldTrainer: boolean;
highestLastSpeedRating: boolean;
sectionalFlag: boolean;
significantImprover: boolean;
jockeyInForm: boolean;
clearTopRated: boolean;
interestingJockeyBooking: boolean;
firstTimeBlinkers: boolean;
}
export interface FullResultRunner {
runnerId: string;
runnerName: string;
trainer: string;
jockey: string;
scratched: boolean;
finishPosition: number;
accBeatenDistance?: string;
accBeatenDistanceStatus?: string;
postRaceReport?: string;
odds?: RaceOdds;
}
export interface PayoffsSelection {
payoutAmount: number;
selection: string;
}
export interface PayoffsWagerType {
code: string;
name: string;
}
export interface Payoffs {
selections: Array<PayoffsSelection>;
wagerAmount: number;
wagerType: PayoffsWagerType;
}
export interface Results {
payoffs: Array<Payoffs>;
runners: Array<ResultRunner> | undefined | null;
allRunners?: Array<ResultRunner> | undefined | null;
winningTime?: number | string;
}
export interface RaceProgramRaceVideo {
liveStreaming: boolean;
onTvg: boolean;
onTvg2: boolean;
streams: string[];
hasReplay: boolean;
replayFileName: string;
mobileAvailable: boolean;
isStreamHighDefinition?: boolean;
}
export interface RecentOdds {
odd: string;
trending?: boolean;
}
export interface BettingInterest {
biNumber: number;
currentOdds: RaceOdds;
morningLineOdds: RaceOdds;
recentOdds?: RecentOdds[];
numberColor: string;
runners: Runner[];
saddleColor: string;
isFavorite: boolean;
favorite?: boolean;
biPools?: Array<BettingInterestPool> | null;
}
export interface PickBetFavorite {
runnerNumber: string;
runnerName: string;
isWinner: boolean;
isFavorite: boolean;
}
export interface FavoriteRunners {
[key: number]: PickBetFavorite;
}
export interface RaceCardRunner {
age?: number;
horseName: string;
jockey?: string;
med?: string;
runnerId: string;
scratched: boolean;
sex?: string;
trainer?: string;
weight?: number;
ownerName?: string;
sire?: string;
damSire?: string;
dam?: string;
handicapping?: Array<HandicapOptions | string>;
masterPickNumber?: number;
masterPickInfo?: string;
dob?: number;
hasJockeyChanges?: boolean;
timeform?: Timeform;
}
export interface RaceCardBettingInterest {
biNumber: number;
currentOdds: RaceOdds;
recentOdds?: RecentOdds[];
morningLineOdds: RaceOdds;
isFavorite: boolean;
runners: RaceCardRunner[];
numberColor?: string;
saddleColor?: string;
}
export type RunnerTagsModalProps = {
isOpen: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
runnerTags?: { [key: string]: any }[];
linkedRunner: {
raceTypeCode?: string;
runnerId?: string;
horseName?: string;
};
currentRunnerTags?: string[];
trackName?: string;
raceNumber?: string;
concatRunnerTags?: string;
raceMtp: string;
raceStatus: string;
fdtvType: string;
};
export enum HandicapOptionsType {
BASIC = "basic",
ADVANCED = "advanced",
SNAPSHOT = "snapshot",
SPEED = "speed",
PACE = "pace",
STATUS = "stats"
}
export enum HandicapSortOptionsType {
SADDLECLOTH = "saddlecloth",
ODDS = "odds",
AGE = "age",
MED = "med",
WEIGHT = "weight",
POWER = "power",
WIN_STARTS = "winStarts",
DAYS_OFF = "daysOff",
AVG_SPEED = "avgSpeed",
AVG_DISTANCE = "avgDistance",
HIGH_SPEED = "highSpeed",
AVG_CLASS_RATING = "avgClassRating",
LAST_CLASS_RATING = "lastClassRating",
NUM_RACES = "numRaces",
EARLY = "early",
MIDDLE = "middle",
FINISH = "finish",
STARTS = "starts",
WINS = "wins",
PLACES = "places",
SHOWS = "shows"
}
export interface Stat {
value: string | number;
isPercent?: boolean;
everBold?: boolean;
description: string;
}
export interface HandicappingSortModesInfo {
basic: HandicapSortOptionsType;
advanced: HandicapSortOptionsType;
snapshot: HandicapSortOptionsType;
speed: HandicapSortOptionsType;
pace: HandicapSortOptionsType;
stats: HandicapSortOptionsType;
}
export interface RaceWagerTypeGroup {
id: number;
name: string;
code: WagerTypeCodesEnum;
description?: string;
descriptionInternational?: string;
}
export interface RaceWagerType {
columnCount: number;
isBox: boolean;
isKey: boolean;
isWheel: boolean;
allowAlternateSelection?: boolean;
legCount: number;
minWagerAmount: number;
positionCount: number;
group: RaceWagerTypeGroup;
type: WagerType;
specialGroup?: boolean;
types?: RaceWagerType[];
wagerAmounts: number[];
unitedWagerTypeCode: string;
}
export interface TrackLocation {
country: string;
state?: string;
}
export interface RaceProgramRaceTrack {
featured: boolean;
numberOfRaces: number;
trackCode: string;
code?: string;
shortName?: string;
trackLocation: TrackLocation;
trackName: string;
trackDataSource?: string;
perfAbbr?: string;
specialCardTypes?: SpecialCardTypes[];
}
export interface SpecialCardTypes {
specialCardTypeAbbreviation: string;
specialCardTypeName: string;
}
export interface RaceHighlighted {
description: string;
style: string;
}
export interface Promo {
rootParentPromoID: number;
isAboveTheLine: boolean;
promoPath: string;
isOptedIn?: boolean;
isPromoTagShown?: boolean;
}
export interface RaceListItem {
value: string | number;
changed: boolean;
changes: Change[];
changeKeyword: string;
}
export interface RaceProgram {
id?: string;
tvgRaceId?: number;
bettingInterests?: BettingInterest[];
mtp?: number;
postTime?: string;
status?: RaceStatus;
racePools?: RacePool[];
track?: RaceProgramRaceTrack;
raceNumber?: string;
highlighted?: RaceHighlighted;
description?: string;
distance?: string;
purse?: number;
numRunners?: string;
numWagerableRunners?: string;
surface?: RaceSurface;
type?: RaceType;
raceClass?: RaceClass;
wagerTypes?: RaceWagerType[];
video?: RaceProgramRaceVideo;
isLoading?: boolean;
results?: Results;
wagerable?: boolean;
promo?: Promo;
promos?: Promo[];
changes?: Changes;
raceDate?: string;
number?: string;
willPays?: Willpay[];
probables?: Probable[];
runnersPools?: BettingInterestsPools[];
claimingPrice?: number;
timeform?: RaceTimeform;
talentPicks?: TalentPickData[];
value?: string;
specialCardTypes?: SpecialCardTypes[];
specialCardSourceRace?: SpecialCardSourceRace;
}
export interface RaceInfo {
country: string;
isGreyhound: boolean;
mtp: number;
postTime: string;
raceId: string;
raceNumber: string;
raceStatus: RaceStatus;
trackAbbr: string;
trackName: string;
trackShortName: string;
typeCode: RaceTypeCode;
onTvg: boolean;
onTvg2: boolean;
promo: Promo;
}
export interface UserPromotions {
optedIn: boolean;
isAboveTheLine?: boolean;
}
export interface RaceTrack {
code: string;
name: string;
shortName?: string;
perfAbbr?: string;
location?: TrackLocation;
hasAboveTheLinePromo?: boolean;
}
export interface RaceVideo {
onTvg: boolean;
onTvg2: boolean;
hasReplay?: boolean;
liveStreaming?: boolean;
streams?: string[];
}
export interface RaceDistance {
code?: RaceDistanceCodeEnum;
name?: string;
shortName?: string;
value?: number;
}
export interface Race {
id: string;
raceNumber: string;
number: string;
track: RaceTrack;
mtp: number;
postTime: string;
isGreyhound: boolean;
status: RaceStatus;
type: RaceTypeCode;
video: RaceVideo;
highlighted?: RaceHighlighted;
bettingInterests?: BettingInterest[];
numRunners?: number;
promos?: Promo[];
tvgRaceId?: number;
raceDistance?: RaceDistance;
pools?: Pick<TopPool, "amount">[];
racePools?: RacePool[];
trackCode?: string;
trackName?: string;
probables?: Probable[];
wagerTypes?: RaceWagerType[];
specialCardSourceRace?: SpecialCardSourceRace;
}
export interface TalentPickGraphData {
id: string;
talent: Talent;
race: Race;
wagerType: WagerType;
track?: string;
amount: string;
price: string;
selections: TalentPickDataRunners[][];
favorites: TalentPickDataRunners[][];
}
export interface RacePanelLinkBets {
count: number;
}
export interface RacePanelLink {
country: string;
runnerNumber: string;
raceNumber?: string;
isGreyhound: boolean;
mtp: number;
raceId: string;
trackName: string;
trackCode: string;
postTime: string;
promos?: Promo[];
userPromotions?: UserPromotions[];
bets?: RacePanelLinkBets;
talentPicks: TalentPickGraphData[];
bettingInterests?: RaceCardBettingInterest[];
highlighted?: RaceHighlighted;
}
export interface UpcomingGraphRaceRaceStatus {
code: RaceStatusEnum;
}
export interface UpcomingGraphRaceLocation {
country: string;
}
export interface UpcomingGraphRaceHighlighted {
description: string;
style: string;
}
export interface UpcomingGraphRacePromo {
isAboveTheLine: boolean;
rootParentPromoID: number;
}
export interface UpcomingGraphRaceTalentPicks {
id: string;
}
export type UpcomingGraphRace = {
raceId: string;
mtp: number;
postTime: string;
raceNumber: string;
trackName: string;
trackCode: string;
raceStatus: UpcomingGraphRaceRaceStatus;
location: UpcomingGraphRaceLocation;
isGreyhound: boolean;
highlighted: UpcomingGraphRaceHighlighted;
promos: UpcomingGraphRacePromo;
talentPicks: UpcomingGraphRaceTalentPicks;
};
export type UpcomingGraphRaces =
| Array<UpcomingGraphRace>
| Array<{ currentRace: UpcomingGraphRace }>;
export interface UpcomingGraphRacesResponseData {
upcomingRaces: UpcomingGraphRaces;
extraRaces: UpcomingGraphRaces;
loading: boolean;
}
export interface UpcomingGraphRacesResponse {
data: UpcomingGraphRacesResponseData;
}
export enum ImportanceType {
NO_LEVEL = "",
LEVEL_0 = "0",
LEVEL_1 = "1",
LEVEL_2 = "2",
LEVEL_3 = "3"
}
export interface RaceInfoNav extends RaceInfo {
importanceLevel?: ImportanceType;
description?: string;
action?: string;
pinnedOrder?: string;
}
export interface RaceAbbr {
trackCode: string;
trackName: string;
raceStatus: RaceStatusEnum;
mtp: number;
postTime: string;
number: string;
hasBets: boolean;
isGreyhound: boolean;
hasResults?: boolean;
showTrackCode: boolean;
promo: Promo;
}
export interface RaceNavigationType {
mtp: number;
postTime: string;
status: RaceStatusEnum;
isGreyhound: boolean;
trackName: string;
trackAbbr: string;
raceNumber: string;
isSmall?: boolean;
onClickCallback: NullaryFn<void>;
}
export interface PastPerformanceRaceTrack {
name: string;
code: string;
}
export interface PastPerformanceRaceSurface {
shortName: string;
defaultCondition: string;
}
export interface PastPerformanceRaceClass {
shortName: string;
}
export interface PastPerformanceRace {
id: string;
raceDate: string;
date: string;
raceNumber: string;
number: string;
track: PastPerformanceRaceTrack;
raceTypeCode: RaceTypeCodeEnum;
hasReplays: boolean;
replayFileName?: string;
distance: string;
surface: PastPerformanceRaceSurface;
raceClass: PastPerformanceRaceClass;
purse: number;
numRunners: number;
handicappingData?: string[];
finishPosition?: number;
finishStatus?: string;
scratched?: boolean;
odds?: RaceOdds;
postRaceReport?: string;
accBeatenDistance?: string;
accBeatenDistanceStatus?: string;
favorite?: boolean;
}
export interface PastRaceBettingInterests {
biNumber: number;
favorite: boolean;
currentOdds?: RaceOdds;
morningLineOdds?: RaceOdds;
runners: Runner[];
numberColor?: string;
saddleColor?: string;
}
export interface PastRace {
id?: string;
raceId?: string;
bettingInterests: PastRaceBettingInterests[];
results?: Results;
}
export interface VideoSRC {
sd?: string;
hd?: string;
replay?: string;
}
export interface Video {
show: boolean;
error: boolean;
src: VideoSRC;
}
export enum RaceVideoFeedback {
NOT_AVAILABLE_REPLAY = "NOT_AVAILABLE_REPLAY",
STARTING_SOON_REPLAY = "STARTING_SOON_REPLAY",
FINISHED_REPLAY = "FINISHED_REPLAY",
AVAILABLE_REPLAY = "AVAILABLE_REPLAY",
NOT_AVAILABLE_NO_REPLAY = "NOT_AVAILABLE_NO_REPLAY",
STARTING_SOON_NO_REPLAY = "STARTING_SOON_NO_REPLAY",
FINISHED_NO_REPLAY = "FINISHED_NO_REPLAY",
AVAILABLE_NO_REPLAY = "AVAILABLE_NO_REPLAY",
SHOWN_ON_NBC = "SHOWN_ON_NBC"
}
export interface ExpandLineArgs {
runnerId: string;
selection: string;
column: number;
fromIcon: boolean;
direction: string;
isScratched: boolean;
}
export interface RaceTemplate {
trackName: string;
trackCode: string;
number: string;
raceStatus: RaceStatusEnum;
hasBets: boolean;
hasResults?: boolean;
postTime: string;
mtp: number;
showTrackCode: boolean;
isGreyhound: boolean;
promo: Promo;
}
export interface CustomRaceAbbr extends RaceAbbr {
id?: string;
idPrefix?: string;
}
export interface RaceInfoMyBetsRunner {
runnerNumber?: string;
biNumber: number;
finishPosition: number;
betAmount: number;
}
export interface RaceInfoMyBetsResults {
runners?: RaceInfoMyBetsRunner[];
payoffs?: Array<Payoffs>;
winningTime?: number | string;
}
export interface RaceInfoMyBetsStatus {
code: RaceStatusEnum;
}
export interface RaceInfoMyBetsVideo {
liveStreaming: boolean;
hasReplay: boolean;
}
export interface RaceInfoMyBets {
id: string;
raceId?: string;
tvgRaceId: number;
postTime: string;
raceDate: string;
probables?: Probable[];
bettingInterests: BettingInterest[];
trackName: string;
trackCode: string;
isGreyhound: boolean;
mtp: number;
number: number;
results?: RaceInfoMyBetsResults;
willPays?: Willpay[];
status: RaceInfoMyBetsStatus;
video: RaceInfoMyBetsVideo;
wagerTypes: RaceWagerType[];
type?: RaceType;
numRunners: string;
track?: {
specialCardTypes?: SpecialCardTypes[];
};
}
export interface MTPNotificationConfigType {
mtpBelowThresholdText: string;
raceOffText: string;
mtpThreshold: number;
hideNotificationDelay: number;
showNotificationDelay: number;
}
export interface RaceBet {
id: string; // this is a string because WRO uses a serial number string to identify bets
raceTypeCode: RaceTypeCodeEnum;
betTotal: number;
wagerAmount: number;
wagerType: WagerType;
isKey: boolean;
isLeg: boolean;
selections: Array<Array<string>>;
onDelete?: NullaryFn<unknown>;
isCancelable?: boolean;
isLost?: boolean;
isRepeatable?: boolean;
isPromoQualifying?: boolean;
hasRepeatButton?: boolean;
hasRepeaterEnabled?: boolean;
repetitionsNr?: number;
isCancelled?: boolean;
isRefunded?: boolean;
totalWinAmount?: number;
onRepeatClick?: NullaryFn<void>;
}
export interface RaceBetGroup {
postTime: string;
mtp: number;
raceNumber: string;
trackName: string;
status: RaceStatus;
isGreyhound: boolean;
showRaceDate?: boolean;
bets: RaceBet[];
raceDate: string;
trackCode: string;
}
export interface PastRaceResults {
id: string;
number: string;
description: string;
purse: number;
date: string;
postTime: string;
track: {
code: string;
name: string;
};
surface: {
code: string;
name: string;
};
distance: {
value: number;
code: string;
name: string;
};
type: {
id: number;
code: string;
name: string;
};
raceClass: {
code: string;
name: string;
};
video: {
replayFileName: string;
};
results: Results;
}
webpack://frontend-tpt/../../packages/tvg-lib-utils/handicapping-conf/handicappingOptions.ts
export default [
{
title: "Handicapping Info",
description: "Basic Summary",
handicapData: ["Jockey Name", "Trainer Name"],
key: "basic",
qaLabel: "basicSummary"
},
{
title: "ADVANCED SUMMARY",
description: "Advanced Summary",
handicapData: [
{ key: "age", value: "Age", sorting: "asc" },
{ key: "gender", value: "Gender" },
{ key: "jockey", value: "Jockey" },
{ key: "trainer", value: "Trainer" },
{ key: "med", value: "Med", sorting: "desc" },
{ key: "weight", value: "Wgt", sorting: "desc" },
{ key: "sire", value: "Sire" },
{ key: "dam", value: "Dam" },
{ key: "damsire", value: "DamSire" },
{ key: "owner", value: "Owner" }
],
key: "advanced",
qaLabel: "advancedSummary"
},
{
title: "SNAPSHOT",
description: "Snapshot",
handicapData: [
{ key: "power", value: "Power Rating", sorting: "desc" },
{ key: "winStarts", value: "Wins/Starts", sorting: "desc" },
{ key: "daysOff", value: "Days Rest", sorting: "asc" }
],
key: "snapshot",
qaLabel: "snapshot"
},
{
title: "SPEED & CLASS",
description: "Speed & Class",
handicapData: [
{
key: "avgSpeed",
value: "Avg. Speed",
sorting: "desc"
},
{
key: "avgDistance",
value: "Avg. Distance",
sorting: "desc"
},
{
key: "highSpeed",
value: "High Speed",
sorting: "desc"
},
{
key: "avgClassRating",
value: "Avg. Class",
sorting: "desc"
},
{
key: "lastClassRating",
value: "Last Class",
sorting: "desc"
}
],
key: "speed",
qaLabel: "speedClass"
},
{
title: "PACE",
description: "Pace",
handicapData: [
{
key: "numRaces",
value: "Number of Races",
sorting: "desc"
},
{
key: "early",
value: "Early",
sorting: "desc"
},
{
key: "middle",
value: "Middle",
sorting: "desc"
},
{
key: "finish",
value: "Finish",
sorting: "desc"
}
],
key: "pace",
qaLabel: "pace"
},
{
title: "JOCKEY/TRAINER STATS",
description: "Jockey/Trainer Stats",
handicapData: [
{ key: "jockey", value: "Jockey" },
{ key: "trainer", value: "Trainer" },
{
key: "starts",
value: "Runs",
sorting: "desc"
},
{
key: "wins",
value: "1st",
sorting: "desc"
},
{
key: "places",
value: "2nd",
sorting: "desc"
},
{
key: "shows",
value: "3rd",
sorting: "desc"
}
],
key: "stats",
qaLabel: "jockeyTrainerStats"
}
];
export const handicappingGreyhoundOptions = [
{
title: "Handicapping Info",
description: "basic summary",
handicapData: [
{ key: "kennel", value: "Kennel" },
{ key: "trainer", value: "Trainer" }
],
key: "basic",
qaLabel: "basicSummary"
},
{
title: "ADVANCED SUMMARY",
description: "advanced summary",
handicapData: [
"Kennel",
"Trainer",
"Weight",
"Whelped",
"Gender",
"Sire",
"Dam"
],
key: "advanced",
qaLabel: "advancedSummary"
}
];
export const handicappingHarnessOptions = [
{
title: "Handicapping Info",
description: "Basic Summary",
handicapData: ["Driver Name", "Trainer Name"],
key: "basic",
qaLabel: "basicSummary"
},
{
title: "ADVANCED SUMMARY",
description: "Advanced Summary",
handicapData: [
{ key: "age", value: "Age", sorting: "asc" },
{ key: "gender", value: "Gender" },
{ key: "jockey", value: "Driver" },
{ key: "trainer", value: "Trainer" },
{ key: "med", value: "Med", sorting: "desc" },
{ key: "weight", value: "Wgt", sorting: "desc" },
{ key: "sire", value: "Sire" },
{ key: "dam", value: "Dam" },
{ key: "damsire", value: "DamSire" },
{ key: "owner", value: "Owner" }
],
key: "advanced",
qaLabel: "advancedSummary"
},
{
title: "SNAPSHOT",
description: "Snapshot",
handicapData: [
{ key: "power", value: "Power Rating", sorting: "desc" },
{ key: "winStarts", value: "Wins/Starts", sorting: "desc" },
{ key: "daysOff", value: "Days Rest", sorting: "asc" }
],
key: "snapshot",
qaLabel: "snapshot"
},
{
title: "SPEED & CLASS",
description: "Speed & Class",
handicapData: [
{
key: "avgSpeed",
value: "Avg. Speed",
sorting: "desc"
},
{
key: "avgDistance",
value: "Avg. Distance",
sorting: "desc"
},
{
key: "highSpeed",
value: "High Speed",
sorting: "desc"
},
{
key: "avgClassRating",
value: "Avg. Class",
sorting: "desc"
},
{
key: "lastClassRating",
value: "Last Class",
sorting: "desc"
}
],
key: "speed",
qaLabel: "speedClass"
},
{
title: "PACE",
description: "Pace",
handicapData: [
{
key: "numRaces",
value: "Number of Races",
sorting: "desc"
},
{
key: "early",
value: "Early",
sorting: "desc"
},
{
key: "middle",
value: "Middle",
sorting: "desc"
},
{
key: "finish",
value: "Finish",
sorting: "desc"
}
],
key: "pace",
qaLabel: "pace"
},
{
title: "DRIVER/TRAINER STATS",
description: "Driver/Trainer Stats",
handicapData: [
{ key: "jockey", value: "Driver" },
{ key: "trainer", value: "Trainer" },
{
key: "starts",
value: "Runs",
sorting: "desc"
},
{
key: "wins",
value: "1st",
sorting: "desc"
},
{
key: "places",
value: "2nd",
sorting: "desc"
},
{
key: "shows",
value: "3rd",
sorting: "desc"
}
],
key: "stats",
qaLabel: "jockeyTrainerStats"
}
];
webpack://frontend-tpt/../../packages/tvg-lib-formatter/numeric/index.ts
import numeral from "numeral";
const formatSequencial = (value: number): string => numeral(value).format("0o");
export const formatPoints = (value: number): string =>
numeral(value).format("0,0");
export default formatSequencial;
webpack://frontend-tpt/../../packages/tvg-lib-ts-types/Wager.ts
export enum WagerTypeCodesEnum {
WIN = "WN",
WIN_PLACE = "WP",
WIN_SHOW = "WS",
WIN_PLACE_SHOW = "WPS",
TRIFECTA = "TR",
TRIFECTA_BOX = "TRB",
TRIFECTA_WHEEL = "TRW",
TRIFECTA_KEY = "TRK",
TRIFECTA_KEY_BOX = "TKB",
DAILY_DOUBLE = "DB",
EXACTA = "EX",
EXACTA_BOX = "EXB",
EXACTA_WHEEL = "EXW",
EXACTA_KEY = "EXK",
EXACTA_KEY_BOX = "EKB",
GRAND_SLAM = "GS",
EXACT_12 = "E12",
SURVIVOR = "SV",
V_4 = "V4",
V_5 = "V5",
V_64 = "V64",
V_65 = "V65",
V_75 = "V75",
V_86 = "V86",
GS_75 = "GS75",
PICK_3 = "P3",
PICK_4 = "P4",
PICK_5 = "P5",
PICK_6 = "P6",
PICK_7 = "P7",
PICK_8 = "P8",
PICK_9 = "P9",
PICK_10 = "P10",
PICK_11 = "P11",
PICK_12 = "P12",
PICK_ALL_3 = "A3",
PICK_ALL_4 = "A4",
PICK_ALL_5 = "A5",
PICK_ALL_6 = "A6",
PICK_ALL_7 = "A7",
PICK_ALL_8 = "A8",
PICK_ALL_9 = "A9",
PICK_ALL_10 = "A10",
PICK_ALL_11 = "A11",
PICK_ALL_12 = "A12",
PLACE = "PL",
PLACE_PICK_ALL_3 = "L3",
PLACE_PICK_ALL_4 = "L4",
PLACE_PICK_ALL_5 = "L5",
PLACE_PICK_ALL_6 = "L6",
PLACE_PICK_ALL_7 = "L7",
PLACE_PICK_ALL_8 = "L8",
PLACE_PICK_ALL_9 = "L9",
PLACE_PICK_ALL_10 = "L10",
PLACE_SHOW = "PS",
QUINELLA = "QN",
QUINELLA_BOX = "QNB",
QUINELLA_WHEEL = "QNW",
SHOW = "SH",
SUPERFECTA = "SU",
SUPERFECTA_BOX = "SUB",
SUPERFECTA_WHEEL = "SUW",
SUPERFECTA_KEY = "SUK",
SUPERFECTA_KEY_BOX = "SKB",
SUPERHIGHFIVE = "SH5",
SUPERHIGHFIVE_BOX = "H5B",
SUPERHIGHFIVE_WHEEL = "H5W",
SUPERHIGHFIVE_KEY = "S5K",
SUPERHIGHFIVE_KEY_BOX = "5KB",
OMNI = "OM",
OMNI_BOX = "OMB",
OMNI_WHEEL = "OMW",
TRIO = "TI",
TRIO_BOX = "TIB",
TRIO_WHEEL = "TIW",
UNKNOWN = ""
}
export enum WagerTypeWpsCodesEnum {
WIN = "WN",
WIN_PLACE = "WP",
WIN_SHOW = "WS",
WIN_PLACE_SHOW = "WPS",
PLACE = "PL",
PLACE_SHOW = "PS",
SHOW = "SH"
}
export enum WagerTypeCodesInvertedEnum {
WN = "WIN",
WP = "WIN_PLACE",
WS = "WIN_SHOW",
WPS = "WIN_PLACE_SHOW",
TR = "TRIFECTA",
TRB = "TRIFECTA_BOX",
TRW = "TRIFECTA_WHEEL",
TRK = "TRIFECTA_KEY",
TKB = "TRIFECTA_KEY_BOX",
DB = "DAILY_DOUBLE",
EX = "EXACTA",
EXB = "EXACTA_BOX",
EXW = "EXACTA_WHEEL",
EXK = "EXACTA_KEY",
EKB = "EXACTA_KEY_BOX",
GS = "GRAND_SLAM",
E12 = "EXACT_12",
SV = "SURVIVOR",
V4 = "V_4",
V5 = "V_5",
V64 = "V_64",
V65 = "V_65",
V75 = "V_75",
V86 = "V_86",
GS75 = "GS_75",
P3 = "PICK_3",
P4 = "PICK_4",
P5 = "PICK_5",
P6 = "PICK_6",
P7 = "PICK_7",
P8 = "PICK_8",
P9 = "PICK_9",
P10 = "PICK_10",
P11 = "PICK_11",
P12 = "PICK_12",
A3 = "PICK_ALL_3",
A4 = "PICK_ALL_4",
A5 = "PICK_ALL_5",
A6 = "PICK_ALL_6",
A7 = "PICK_ALL_7",
A8 = "PICK_ALL_8",
A9 = "PICK_ALL_9",
A10 = "PICK_ALL_10",
A11 = "PICK_ALL_11",
A12 = "PICK_ALL_12",
PL = "PLACE",
L3 = "PLACE_PICK_ALL_3",
L4 = "PLACE_PICK_ALL_4",
L5 = "PLACE_PICK_ALL_5",
L6 = "PLACE_PICK_ALL_6",
L7 = "PLACE_PICK_ALL_7",
L8 = "PLACE_PICK_ALL_8",
L9 = "PLACE_PICK_ALL_9",
L10 = "PLACE_PICK_ALL_10",
PS = "PLACE_SHOW",
QN = "QUINELLA",
QNB = "QUINELLA_BOX",
QNW = "QUINELLA_WHEEL",
SH = "SHOW",
SU = "SUPERFECTA",
SUB = "SUPERFECTA_BOX",
SUW = "SUPERFECTA_WHEEL",
SUK = "SUPERFECTA_KEY",
SKB = "SUPERFECTA_KEY_BOX",
SH5 = "SUPERHIGHFIVE",
H5B = "SUPERHIGHFIVE_BOX",
H5W = "SUPERHIGHFIVE_WHEEL",
S5K = "SUPERHIGHFIVE_KEY",
"5KB" = "SUPERHIGHFIVE_KEY_BOX",
OM = "OMNI",
OMB = "OMNI_BOX",
OMW = "OMNI_WHEEL",
TI = "TRIO",
TIB = "TRIO_BOX",
TIW = "TRIO_WHEEL"
}
export interface WagerType {
id: number;
code: WagerTypeCodesEnum;
name: string;
description?: string;
descriptionInternational?: string;
abbreviation?: string;
unitedWagerTypeCode?: string;
}
export enum WagerTypesPos {
Win,
Place,
Show
}
export enum WagerTypes {
WIN = 10,
PLACE = 20,
SHOW = 30,
WIN_PLACE = 40,
WIN_SHOW = 50,
PLACE_SHOW = 60,
WIN_PLACE_SHOW = 70,
QUINELLA = 80,
EXACTA = 110,
DAILY_DOUBLE = 310
}
export const WagerTypesGroup = {
WIN_PLACE_SHOW: [
WagerTypes.WIN,
WagerTypes.PLACE_SHOW,
WagerTypes.WIN_PLACE,
WagerTypes.WIN_SHOW,
WagerTypes.WIN_PLACE_SHOW,
WagerTypes.SHOW,
WagerTypes.PLACE
],
WIN: [
WagerTypes.WIN,
WagerTypes.WIN_PLACE,
WagerTypes.WIN_SHOW,
WagerTypes.WIN_PLACE_SHOW
]
};
export interface WagerGroupsItem {
errorMessage: string;
group: string;
title: string;
value: string;
}
export interface WagerTypeDetails {
group: WagerType;
isBox: boolean;
isKey: boolean;
isWheel: boolean;
legCount: number;
type: WagerType;
}
webpack://frontend-tpt/../../packages/tvg-lib-utils/betSelection.ts
import { get, find, has } from "lodash";
import {
RaceProgram,
RaceWagerType,
BettingInterest,
RaceInfoMyBets
} from "@tvg/ts-types/Race";
import {
BIRunner,
BettingInterests,
VisualSelections
} from "@tvg/ts-types/Selections";
import { BetRunnerDetails, BetSelection } from "@tvg/ts-types/Bet";
import formatSequential from "@tvg/formatter/numeric";
import {
WagerTypeCodesEnum,
WagerTypes,
WagerTypesGroup
} from "@tvg/ts-types/Wager";
export const simpleBetTypes = [
WagerTypeCodesEnum.WIN,
WagerTypeCodesEnum.PLACE,
WagerTypeCodesEnum.SHOW,
WagerTypeCodesEnum.WIN_PLACE,
WagerTypeCodesEnum.WIN_SHOW,
WagerTypeCodesEnum.PLACE_SHOW,
WagerTypeCodesEnum.WIN_PLACE_SHOW
];
const setMatrixSizeByColumnCount = (columnCount: number): string[][] =>
columnCount >= 1 ? Array(columnCount).fill([]) : [[]];
const hasBetType = (
betTypeID: number | null | undefined,
currentRace: RaceProgram
): boolean => {
const wagerTypes = get(currentRace, "wagerTypes", []);
return !!find(
wagerTypes,
(wagerType) => `${wagerType.type.id}` === `${betTypeID}`
);
};
const getDefaultBetType = (
currentRace: RaceProgram,
defaultBetTypeID: string = "",
logged: boolean = false
): RaceWagerType | null => {
const wagerTypes = get(currentRace, "wagerTypes", []);
const defaultType = get(wagerTypes, "[0]");
if (logged) {
const findWagerType = find(
wagerTypes,
(wagerType) => `${wagerType.type.id}` === `${defaultBetTypeID}`
);
const isSpecialGroup = WagerTypesGroup.WIN_PLACE_SHOW.includes(
Number(defaultBetTypeID)
);
const isSpecialGroupAvailableOnRace = wagerTypes.some(
(wagerType) => wagerType.type.id === WagerTypes.WIN_PLACE_SHOW
);
const WPSDefaultBetType = wagerTypes.find(
(wagerType) => wagerType.type.id === WagerTypes.WIN_PLACE_SHOW
);
const handleDefaultBetType =
isSpecialGroup && isSpecialGroupAvailableOnRace
? WPSDefaultBetType
: defaultType;
return findWagerType || (handleDefaultBetType as RaceWagerType);
}
return defaultType;
};
const isValidBetType = (
currentRace: RaceProgram,
betType: number | null | undefined
) => hasBetType(betType, currentRace);
const isValidBetAmount = (
wager: RaceWagerType | null | undefined,
betAmount = 0
) => betAmount >= get(wager, "minWagerAmount", 100000);
const isValidBetSelection = (
wager: RaceWagerType | null | undefined,
betSelections: string[][]
) => betSelections.length === get(wager, "columnCount", 1);
export const getVisualSelections = ({
selections,
bettingInterests,
isLegSelections,
shouldShowAlternates
}: {
selections: Array<Array<string>>;
bettingInterests?: BettingInterest[];
isLegSelections?: boolean;
shouldShowAlternates?: boolean;
}): VisualSelections[] =>
(selections || []).map((selection, selectionIndex) =>
(selection || []).flatMap((singleSelection) => {
const isCurrentRaceSelections = selectionIndex === 0 || !isLegSelections;
const biRunners: VisualSelections = [];
// Remove 'B' from alternate selection for matching purposes
const cleanedSelection = singleSelection.replace("B", "");
const isAlternate = singleSelection.includes("B");
if (
typeof shouldShowAlternates !== "undefined" &&
!shouldShowAlternates &&
isAlternate
) {
return [];
}
const selectedBI = (bettingInterests || []).find(
(bi) => +bi.biNumber === +cleanedSelection
);
if (selectedBI && isCurrentRaceSelections) {
(selectedBI.runners || []).forEach((runner) => {
biRunners.push({
number: runner.runnerId,
numberColor: selectedBI.numberColor,
saddleColor: selectedBI.saddleColor,
isAlternate,
...(isCurrentRaceSelections
? { scratched: !!runner.scratched }
: {})
});
});
} else {
biRunners.push({
number: cleanedSelection,
numberColor: "",
saddleColor: "",
isAlternate
});
}
return biRunners;
})
);
export const getVisualSelectionsWithRaces = (
selections: Array<Array<string>>,
races: Array<RaceProgram>,
isPick: boolean = false
): VisualSelections[] =>
(selections || []).map((raceSelections, index) => {
const currentRace = get(races, isPick ? index : 0, []);
const biRunners: VisualSelections = [];
(raceSelections || []).forEach((runnerSelection) => {
const bettingInterests: Array<BettingInterest> = get(
currentRace,
"bettingInterests",
[]
);
const selectedBI = bettingInterests.find(
(bi) => +bi.biNumber === +runnerSelection
);
const runners = get(selectedBI, "runners", []);
if (!runners.length) {
biRunners.push({
number: runnerSelection,
numberColor: "",
saddleColor: "",
scratched: false
});
} else {
runners.forEach((runner) => {
biRunners.push({
number: runner.runnerId,
numberColor: selectedBI?.numberColor || "",
saddleColor: selectedBI?.saddleColor || "",
scratched: !!runner.scratched
});
});
}
});
return biRunners;
});
export const getSelectionsRunnerNbrScratched = (
selections: Array<VisualSelections>
): Array<Array<string>> =>
selections.map((fullSelection) =>
fullSelection
.filter((selection) => selection.scratched)
.map((scratched) => scratched.number)
);
export const getValidRunnerId = (
selection: Array<BetSelection | BettingInterests>
) =>
selection.reduce((accSelection: string[], selectionRunner) => {
const validSelection = (
selectionRunner.runners as Array<BetRunnerDetails | BIRunner>
).reduce((accRunner: string[], runner) => {
const isScrached = has(runner, "isScratched")
? get(runner, "isScratched", false)
: get(runner, "scratched", false);
if (!isScrached) {
accRunner.push(runner?.runnerId?.toString());
}
return accRunner;
}, [] as string[]);
const isAlternate = get(selectionRunner, "isAlternate", false);
if (validSelection.length && !isAlternate) {
accSelection.push(...validSelection);
}
return accSelection;
}, []);
const getBetAmount = (
wager: RaceWagerType | null,
userAccountNumber: string,
MinimalValues: boolean,
BetAmountPreference: Record<string, number>
) => {
const picksDefault = [310, 330, 340, 350, 360, 370, 380, 390, 400];
if (!!userAccountNumber && !MinimalValues) {
const betTypeId = +get(wager, "type.id", "");
let defaultValue = 0;
// Identify picks and daily doubles
if (picksDefault.includes(betTypeId)) {
defaultValue = +get(BetAmountPreference, "P", 0);
} else {
defaultValue = +get(BetAmountPreference, betTypeId, 0);
}
return defaultValue >= get(wager, "minWagerAmount", 100000)
? defaultValue
: get(wager, "wagerAmounts[0]", 0);
}
return get(wager, "wagerAmounts[0]", 0);
};
const getBetAmountWPSBetSelections = (
wager: RaceWagerType | undefined,
BetAmountPreference: Record<string, number>
) => {
const betTypeId = +get(wager, "type.id", "");
const defaultValue = +get(BetAmountPreference, betTypeId, 0);
return defaultValue >= get(wager, "minWagerAmount", 100000)
? defaultValue
: get(wager, "wagerAmounts[0]", 0);
};
const filterBetTypeFromRaceCallback =
(betTypeID: number | null | undefined) => (wagerType: RaceWagerType) =>
`${wagerType.type.id}` === `${betTypeID}`;
const getBetTypeFromRace = (
currentRace: RaceProgram,
betTypeID: number | null | undefined,
useSubTypes: boolean = false
): RaceWagerType => {
const wagerTypes: Array<RaceWagerType> = get(currentRace, "wagerTypes", []);
const findWagerType = find(
wagerTypes,
filterBetTypeFromRaceCallback(betTypeID)
);
if (useSubTypes) {
const subWagerTypes = wagerTypes.reduce((acc, wagerType) => {
if (wagerType?.types?.length) {
acc.push(...wagerType.types);
}
return acc;
}, [] as RaceWagerType[]);
const findSubWagerType = find(
subWagerTypes,
filterBetTypeFromRaceCallback(betTypeID)
);
return findSubWagerType || findWagerType || wagerTypes[0];
}
return findWagerType || wagerTypes[0];
};
const getOriginalBetTypeFromRace = (
currentRace: RaceProgram | RaceInfoMyBets,
betTypeID?: WagerTypeCodesEnum
): RaceWagerType | undefined => {
let originalWagerType: RaceWagerType | undefined;
const searchWagerType = get(currentRace, "wagerTypes", []).find(
(wt: RaceWagerType) => {
if (
wt.type.code !== betTypeID &&
wt.type.id !== parseInt(`${betTypeID}`, 10)
) {
// original bet type from url ( not grouped)
originalWagerType = wt.types?.find(
(wtIn: RaceWagerType) =>
wtIn.type.code === betTypeID ||
wtIn.type.id === parseInt(`${betTypeID}`, 10)
);
return !!originalWagerType;
}
return true;
}
);
return originalWagerType || searchWagerType;
};
export const getWagerTypesNames = (
wagerType?: RaceWagerType,
enableAlternateSelection?: boolean
) => {
if (!wagerType) {
return [];
}
const {
isBox,
columnCount,
isKey,
isWheel,
legCount,
type: { code }
} = wagerType;
if (enableAlternateSelection) {
return ["Select", "Alternate"];
}
if (isKey && isBox) {
return ["Key", "Box"];
}
if (isKey) {
return ["Key", "Select"];
}
if (isBox) {
return ["Box"];
}
if (isWheel) {
return ["Primary", "Others"];
}
if (simpleBetTypes.includes(code) && legCount === 1) {
return wagerType?.type.name.split("/") || [];
}
if ((columnCount === 1 && !isBox) || legCount > 1) {
return ["Select"];
}
return Array.from({ length: columnCount }, (_, i) => formatSequential(i + 1));
};
const betSelections = {
getDefaultBetType,
setMatrixSizeByColumnCount,
hasBetType,
getBetTypeFromRace,
getBetAmount,
getBetAmountWPSBetSelections,
isValidBetType,
isValidBetAmount,
isValidBetSelection,
getVisualSelections,
getVisualSelectionsWithRaces,
getSelectionsRunnerNbrScratched,
getWagerTypesNames,
getOriginalBetTypeFromRace
};
export default betSelections;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
export default function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
import setPrototypeOf from "./setPrototypeOf.js";
export default function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
setPrototypeOf(subClass, superClass);
}
webpack://frontend-tpt/../../node_modules/dom-helpers/esm/removeClass.js
function replaceClassName(origClass, classToRemove) {
return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
}
/**
* Removes a CSS class from a given element.
*
* @param element the element
* @param className the CSS class name
*/
export default function removeClass(element, className) {
if (element.classList) {
element.classList.remove(className);
} else if (typeof element.className === 'string') {
element.className = replaceClassName(element.className, className);
} else {
element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
}
}
webpack://frontend-tpt/../../node_modules/react-transition-group/esm/config.js
export default {
disabled: false
};
webpack://frontend-tpt/../../node_modules/react-transition-group/esm/TransitionGroupContext.js
import React from 'react'; export default React.createContext(null);
webpack://frontend-tpt/../../node_modules/react-transition-group/esm/Transition.js
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
import PropTypes from 'prop-types';
import React from 'react';
import ReactDOM from 'react-dom';
import config from './config';
import { timeoutsShape } from './utils/PropTypes';
import TransitionGroupContext from './TransitionGroupContext';
export var UNMOUNTED = 'unmounted';
export var EXITED = 'exited';
export var ENTERING = 'entering';
export var ENTERED = 'entered';
export var EXITING = 'exiting';
/**
* The Transition component lets you describe a transition from one component
* state to another _over time_ with a simple declarative API. Most commonly
* it's used to animate the mounting and unmounting of a component, but can also
* be used to describe in-place transition states as well.
*
* ---
*
* **Note**: `Transition` is a platform-agnostic base component. If you're using
* transitions in CSS, you'll probably want to use
* [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
* instead. It inherits all the features of `Transition`, but contains
* additional features necessary to play nice with CSS transitions (hence the
* name of the component).
*
* ---
*
* By default the `Transition` component does not alter the behavior of the
* component it renders, it only tracks "enter" and "exit" states for the
* components. It's up to you to give meaning and effect to those states. For
* example we can add styles to a component when it enters or exits:
*
* ```jsx
* import { Transition } from 'react-transition-group';
*
* const duration = 300;
*
* const defaultStyle = {
* transition: `opacity ${duration}ms ease-in-out`,
* opacity: 0,
* }
*
* const transitionStyles = {
* entering: { opacity: 1 },
* entered: { opacity: 1 },
* exiting: { opacity: 0 },
* exited: { opacity: 0 },
* };
*
* const Fade = ({ in: inProp }) => (
* <Transition in={inProp} timeout={duration}>
* {state => (
* <div style={{
* ...defaultStyle,
* ...transitionStyles[state]
* }}>
* I'm a fade Transition!
* </div>
* )}
* </Transition>
* );
* ```
*
* There are 4 main states a Transition can be in:
* - `'entering'`
* - `'entered'`
* - `'exiting'`
* - `'exited'`
*
* Transition state is toggled via the `in` prop. When `true` the component
* begins the "Enter" stage. During this stage, the component will shift from
* its current transition state, to `'entering'` for the duration of the
* transition and then to the `'entered'` stage once it's complete. Let's take
* the following example (we'll use the
* [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
*
* ```jsx
* function App() {
* const [inProp, setInProp] = useState(false);
* return (
* <div>
* <Transition in={inProp} timeout={500}>
* {state => (
* // ...
* )}
* </Transition>
* <button onClick={() => setInProp(true)}>
* Click to Enter
* </button>
* </div>
* );
* }
* ```
*
* When the button is clicked the component will shift to the `'entering'` state
* and stay there for 500ms (the value of `timeout`) before it finally switches
* to `'entered'`.
*
* When `in` is `false` the same thing happens except the state moves from
* `'exiting'` to `'exited'`.
*/
var Transition = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(Transition, _React$Component);
function Transition(props, context) {
var _this;
_this = _React$Component.call(this, props, context) || this;
var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
var initialStatus;
_this.appearStatus = null;
if (props.in) {
if (appear) {
initialStatus = EXITED;
_this.appearStatus = ENTERING;
} else {
initialStatus = ENTERED;
}
} else {
if (props.unmountOnExit || props.mountOnEnter) {
initialStatus = UNMOUNTED;
} else {
initialStatus = EXITED;
}
}
_this.state = {
status: initialStatus
};
_this.nextCallback = null;
return _this;
}
Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
var nextIn = _ref.in;
if (nextIn && prevState.status === UNMOUNTED) {
return {
status: EXITED
};
}
return null;
} // getSnapshotBeforeUpdate(prevProps) {
// let nextStatus = null
// if (prevProps !== this.props) {
// const { status } = this.state
// if (this.props.in) {
// if (status !== ENTERING && status !== ENTERED) {
// nextStatus = ENTERING
// }
// } else {
// if (status === ENTERING || status === ENTERED) {
// nextStatus = EXITING
// }
// }
// }
// return { nextStatus }
// }
;
var _proto = Transition.prototype;
_proto.componentDidMount = function componentDidMount() {
this.updateStatus(true, this.appearStatus);
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
var nextStatus = null;
if (prevProps !== this.props) {
var status = this.state.status;
if (this.props.in) {
if (status !== ENTERING && status !== ENTERED) {
nextStatus = ENTERING;
}
} else {
if (status === ENTERING || status === ENTERED) {
nextStatus = EXITING;
}
}
}
this.updateStatus(false, nextStatus);
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.cancelNextCallback();
};
_proto.getTimeouts = function getTimeouts() {
var timeout = this.props.timeout;
var exit, enter, appear;
exit = enter = appear = timeout;
if (timeout != null && typeof timeout !== 'number') {
exit = timeout.exit;
enter = timeout.enter; // TODO: remove fallback for next major
appear = timeout.appear !== undefined ? timeout.appear : enter;
}
return {
exit: exit,
enter: enter,
appear: appear
};
};
_proto.updateStatus = function updateStatus(mounting, nextStatus) {
if (mounting === void 0) {
mounting = false;
}
if (nextStatus !== null) {
// nextStatus will always be ENTERING or EXITING.
this.cancelNextCallback();
if (nextStatus === ENTERING) {
this.performEnter(mounting);
} else {
this.performExit();
}
} else if (this.props.unmountOnExit && this.state.status === EXITED) {
this.setState({
status: UNMOUNTED
});
}
};
_proto.performEnter = function performEnter(mounting) {
var _this2 = this;
var enter = this.props.enter;
var appearing = this.context ? this.context.isMounting : mounting;
var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],
maybeNode = _ref2[0],
maybeAppearing = _ref2[1];
var timeouts = this.getTimeouts();
var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
// if we are mounting and running this it means appear _must_ be set
if (!mounting && !enter || config.disabled) {
this.safeSetState({
status: ENTERED
}, function () {
_this2.props.onEntered(maybeNode);
});
return;
}
this.props.onEnter(maybeNode, maybeAppearing);
this.safeSetState({
status: ENTERING
}, function () {
_this2.props.onEntering(maybeNode, maybeAppearing);
_this2.onTransitionEnd(enterTimeout, function () {
_this2.safeSetState({
status: ENTERED
}, function () {
_this2.props.onEntered(maybeNode, maybeAppearing);
});
});
});
};
_proto.performExit = function performExit() {
var _this3 = this;
var exit = this.props.exit;
var timeouts = this.getTimeouts();
var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED
if (!exit || config.disabled) {
this.safeSetState({
status: EXITED
}, function () {
_this3.props.onExited(maybeNode);
});
return;
}
this.props.onExit(maybeNode);
this.safeSetState({
status: EXITING
}, function () {
_this3.props.onExiting(maybeNode);
_this3.onTransitionEnd(timeouts.exit, function () {
_this3.safeSetState({
status: EXITED
}, function () {
_this3.props.onExited(maybeNode);
});
});
});
};
_proto.cancelNextCallback = function cancelNextCallback() {
if (this.nextCallback !== null) {
this.nextCallback.cancel();
this.nextCallback = null;
}
};
_proto.safeSetState = function safeSetState(nextState, callback) {
// This shouldn't be necessary, but there are weird race conditions with
// setState callbacks and unmounting in testing, so always make sure that
// we can cancel any pending setState callbacks after we unmount.
callback = this.setNextCallback(callback);
this.setState(nextState, callback);
};
_proto.setNextCallback = function setNextCallback(callback) {
var _this4 = this;
var active = true;
this.nextCallback = function (event) {
if (active) {
active = false;
_this4.nextCallback = null;
callback(event);
}
};
this.nextCallback.cancel = function () {
active = false;
};
return this.nextCallback;
};
_proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
this.setNextCallback(handler);
var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
if (!node || doesNotHaveTimeoutOrListener) {
setTimeout(this.nextCallback, 0);
return;
}
if (this.props.addEndListener) {
var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
maybeNode = _ref3[0],
maybeNextCallback = _ref3[1];
this.props.addEndListener(maybeNode, maybeNextCallback);
}
if (timeout != null) {
setTimeout(this.nextCallback, timeout);
}
};
_proto.render = function render() {
var status = this.state.status;
if (status === UNMOUNTED) {
return null;
}
var _this$props = this.props,
children = _this$props.children,
_in = _this$props.in,
_mountOnEnter = _this$props.mountOnEnter,
_unmountOnExit = _this$props.unmountOnExit,
_appear = _this$props.appear,
_enter = _this$props.enter,
_exit = _this$props.exit,
_timeout = _this$props.timeout,
_addEndListener = _this$props.addEndListener,
_onEnter = _this$props.onEnter,
_onEntering = _this$props.onEntering,
_onEntered = _this$props.onEntered,
_onExit = _this$props.onExit,
_onExiting = _this$props.onExiting,
_onExited = _this$props.onExited,
_nodeRef = _this$props.nodeRef,
childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
return (
/*#__PURE__*/
// allows for nested Transitions
React.createElement(TransitionGroupContext.Provider, {
value: null
}, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))
);
};
return Transition;
}(React.Component);
Transition.contextType = TransitionGroupContext;
Transition.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* A React reference to DOM element that need to transition:
* https://stackoverflow.com/a/51127130/4671932
*
* - When `nodeRef` prop is used, `node` is not passed to callback functions
* (e.g. `onEnter`) because user already has direct access to the node.
* - When changing `key` prop of `Transition` in a `TransitionGroup` a new
* `nodeRef` need to be provided to `Transition` with changed `key` prop
* (see
* [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
*/
nodeRef: PropTypes.shape({
current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {
var value = propValue[key];
return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
}
}),
/**
* A `function` child can be used instead of a React element. This function is
* called with the current transition status (`'entering'`, `'entered'`,
* `'exiting'`, `'exited'`), which can be used to apply context
* specific props to a component.
*
* ```jsx
* <Transition in={this.state.in} timeout={150}>
* {state => (
* <MyComponent className={`fade fade-${state}`} />
* )}
* </Transition>
* ```
*/
children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
/**
* Show the component; triggers the enter or exit states
*/
in: PropTypes.bool,
/**
* By default the child component is mounted immediately along with
* the parent `Transition` component. If you want to "lazy mount" the component on the
* first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
* mounted, even on "exited", unless you also specify `unmountOnExit`.
*/
mountOnEnter: PropTypes.bool,
/**
* By default the child component stays mounted after it reaches the `'exited'` state.
* Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
*/
unmountOnExit: PropTypes.bool,
/**
* By default the child component does not perform the enter transition when
* it first mounts, regardless of the value of `in`. If you want this
* behavior, set both `appear` and `in` to `true`.
*
* > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
* > only adds an additional enter transition. However, in the
* > `<CSSTransition>` component that first enter transition does result in
* > additional `.appear-*` classes, that way you can choose to style it
* > differently.
*/
appear: PropTypes.bool,
/**
* Enable or disable enter transitions.
*/
enter: PropTypes.bool,
/**
* Enable or disable exit transitions.
*/
exit: PropTypes.bool,
/**
* The duration of the transition, in milliseconds.
* Required unless `addEndListener` is provided.
*
* You may specify a single timeout for all transitions:
*
* ```jsx
* timeout={500}
* ```
*
* or individually:
*
* ```jsx
* timeout={{
* appear: 500,
* enter: 300,
* exit: 500,
* }}
* ```
*
* - `appear` defaults to the value of `enter`
* - `enter` defaults to `0`
* - `exit` defaults to `0`
*
* @type {number | { enter?: number, exit?: number, appear?: number }}
*/
timeout: function timeout(props) {
var pt = timeoutsShape;
if (!props.addEndListener) pt = pt.isRequired;
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return pt.apply(void 0, [props].concat(args));
},
/**
* Add a custom transition end trigger. Called with the transitioning
* DOM node and a `done` callback. Allows for more fine grained transition end
* logic. Timeouts are still used as a fallback if provided.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* ```jsx
* addEndListener={(node, done) => {
* // use the css transitionend event to mark the finish of a transition
* node.addEventListener('transitionend', done, false);
* }}
* ```
*/
addEndListener: PropTypes.func,
/**
* Callback fired before the "entering" status is applied. An extra parameter
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool) -> void
*/
onEnter: PropTypes.func,
/**
* Callback fired after the "entering" status is applied. An extra parameter
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEntering: PropTypes.func,
/**
* Callback fired after the "entered" status is applied. An extra parameter
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool) -> void
*/
onEntered: PropTypes.func,
/**
* Callback fired before the "exiting" status is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement) -> void
*/
onExit: PropTypes.func,
/**
* Callback fired after the "exiting" status is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement) -> void
*/
onExiting: PropTypes.func,
/**
* Callback fired after the "exited" status is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement) -> void
*/
onExited: PropTypes.func
} : {}; // Name the function so it is clearer in the documentation
function noop() {}
Transition.defaultProps = {
in: false,
mountOnEnter: false,
unmountOnExit: false,
appear: false,
enter: true,
exit: true,
onEnter: noop,
onEntering: noop,
onEntered: noop,
onExit: noop,
onExiting: noop,
onExited: noop
};
Transition.UNMOUNTED = UNMOUNTED;
Transition.EXITED = EXITED;
Transition.ENTERING = ENTERING;
Transition.ENTERED = ENTERED;
Transition.EXITING = EXITING;
export default Transition;
webpack://frontend-tpt/../../node_modules/react-transition-group/esm/CSSTransition.js
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
import PropTypes from 'prop-types';
import addOneClass from 'dom-helpers/addClass';
import removeOneClass from 'dom-helpers/removeClass';
import React from 'react';
import Transition from './Transition';
import { classNamesShape } from './utils/PropTypes';
var _addClass = function addClass(node, classes) {
return node && classes && classes.split(' ').forEach(function (c) {
return addOneClass(node, c);
});
};
var removeClass = function removeClass(node, classes) {
return node && classes && classes.split(' ').forEach(function (c) {
return removeOneClass(node, c);
});
};
/**
* A transition component inspired by the excellent
* [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
* use it if you're using CSS transitions or animations. It's built upon the
* [`Transition`](https://reactcommunity.org/react-transition-group/transition)
* component, so it inherits all of its props.
*
* `CSSTransition` applies a pair of class names during the `appear`, `enter`,
* and `exit` states of the transition. The first class is applied and then a
* second `*-active` class in order to activate the CSS transition. After the
* transition, matching `*-done` class names are applied to persist the
* transition state.
*
* ```jsx
* function App() {
* const [inProp, setInProp] = useState(false);
* return (
* <div>
* <CSSTransition in={inProp} timeout={200} classNames="my-node">
* <div>
* {"I'll receive my-node-* classes"}
* </div>
* </CSSTransition>
* <button type="button" onClick={() => setInProp(true)}>
* Click to Enter
* </button>
* </div>
* );
* }
* ```
*
* When the `in` prop is set to `true`, the child component will first receive
* the class `example-enter`, then the `example-enter-active` will be added in
* the next tick. `CSSTransition` [forces a
* reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
* between before adding the `example-enter-active`. This is an important trick
* because it allows us to transition between `example-enter` and
* `example-enter-active` even though they were added immediately one after
* another. Most notably, this is what makes it possible for us to animate
* _appearance_.
*
* ```css
* .my-node-enter {
* opacity: 0;
* }
* .my-node-enter-active {
* opacity: 1;
* transition: opacity 200ms;
* }
* .my-node-exit {
* opacity: 1;
* }
* .my-node-exit-active {
* opacity: 0;
* transition: opacity 200ms;
* }
* ```
*
* `*-active` classes represent which styles you want to animate **to**, so it's
* important to add `transition` declaration only to them, otherwise transitions
* might not behave as intended! This might not be obvious when the transitions
* are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
* the example above (minus `transition`), but it becomes apparent in more
* complex transitions.
*
* **Note**: If you're using the
* [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
* prop, make sure to define styles for `.appear-*` classes as well.
*/
var CSSTransition = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(CSSTransition, _React$Component);
function CSSTransition() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.appliedClasses = {
appear: {},
enter: {},
exit: {}
};
_this.onEnter = function (maybeNode, maybeAppearing) {
var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
node = _this$resolveArgument[0],
appearing = _this$resolveArgument[1];
_this.removeClasses(node, 'exit');
_this.addClass(node, appearing ? 'appear' : 'enter', 'base');
if (_this.props.onEnter) {
_this.props.onEnter(maybeNode, maybeAppearing);
}
};
_this.onEntering = function (maybeNode, maybeAppearing) {
var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
node = _this$resolveArgument2[0],
appearing = _this$resolveArgument2[1];
var type = appearing ? 'appear' : 'enter';
_this.addClass(node, type, 'active');
if (_this.props.onEntering) {
_this.props.onEntering(maybeNode, maybeAppearing);
}
};
_this.onEntered = function (maybeNode, maybeAppearing) {
var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
node = _this$resolveArgument3[0],
appearing = _this$resolveArgument3[1];
var type = appearing ? 'appear' : 'enter';
_this.removeClasses(node, type);
_this.addClass(node, type, 'done');
if (_this.props.onEntered) {
_this.props.onEntered(maybeNode, maybeAppearing);
}
};
_this.onExit = function (maybeNode) {
var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
node = _this$resolveArgument4[0];
_this.removeClasses(node, 'appear');
_this.removeClasses(node, 'enter');
_this.addClass(node, 'exit', 'base');
if (_this.props.onExit) {
_this.props.onExit(maybeNode);
}
};
_this.onExiting = function (maybeNode) {
var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
node = _this$resolveArgument5[0];
_this.addClass(node, 'exit', 'active');
if (_this.props.onExiting) {
_this.props.onExiting(maybeNode);
}
};
_this.onExited = function (maybeNode) {
var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
node = _this$resolveArgument6[0];
_this.removeClasses(node, 'exit');
_this.addClass(node, 'exit', 'done');
if (_this.props.onExited) {
_this.props.onExited(maybeNode);
}
};
_this.resolveArguments = function (maybeNode, maybeAppearing) {
return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
: [maybeNode, maybeAppearing];
};
_this.getClassNames = function (type) {
var classNames = _this.props.classNames;
var isStringClassNames = typeof classNames === 'string';
var prefix = isStringClassNames && classNames ? classNames + "-" : '';
var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
return {
baseClassName: baseClassName,
activeClassName: activeClassName,
doneClassName: doneClassName
};
};
return _this;
}
var _proto = CSSTransition.prototype;
_proto.addClass = function addClass(node, type, phase) {
var className = this.getClassNames(type)[phase + "ClassName"];
var _this$getClassNames = this.getClassNames('enter'),
doneClassName = _this$getClassNames.doneClassName;
if (type === 'appear' && phase === 'done' && doneClassName) {
className += " " + doneClassName;
} // This is to force a repaint,
// which is necessary in order to transition styles when adding a class name.
if (phase === 'active') {
/* eslint-disable no-unused-expressions */
node && node.scrollTop;
}
if (className) {
this.appliedClasses[type][phase] = className;
_addClass(node, className);
}
};
_proto.removeClasses = function removeClasses(node, type) {
var _this$appliedClasses$ = this.appliedClasses[type],
baseClassName = _this$appliedClasses$.base,
activeClassName = _this$appliedClasses$.active,
doneClassName = _this$appliedClasses$.done;
this.appliedClasses[type] = {};
if (baseClassName) {
removeClass(node, baseClassName);
}
if (activeClassName) {
removeClass(node, activeClassName);
}
if (doneClassName) {
removeClass(node, doneClassName);
}
};
_proto.render = function render() {
var _this$props = this.props,
_ = _this$props.classNames,
props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {
onEnter: this.onEnter,
onEntered: this.onEntered,
onEntering: this.onEntering,
onExit: this.onExit,
onExiting: this.onExiting,
onExited: this.onExited
}));
};
return CSSTransition;
}(React.Component);
CSSTransition.defaultProps = {
classNames: ''
};
CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, Transition.propTypes, {
/**
* The animation classNames applied to the component as it appears, enters,
* exits or has finished the transition. A single name can be provided, which
* will be suffixed for each stage, e.g. `classNames="fade"` applies:
*
* - `fade-appear`, `fade-appear-active`, `fade-appear-done`
* - `fade-enter`, `fade-enter-active`, `fade-enter-done`
* - `fade-exit`, `fade-exit-active`, `fade-exit-done`
*
* A few details to note about how these classes are applied:
*
* 1. They are _joined_ with the ones that are already defined on the child
* component, so if you want to add some base styles, you can use
* `className` without worrying that it will be overridden.
*
* 2. If the transition component mounts with `in={false}`, no classes are
* applied yet. You might be expecting `*-exit-done`, but if you think
* about it, a component cannot finish exiting if it hasn't entered yet.
*
* 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
* allows you to define different behavior for when appearing is done and
* when regular entering is done, using selectors like
* `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
* an epic entrance animation when element first appears in the DOM using
* [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
* simply use `fade-enter-done` for defining both cases.
*
* Each individual classNames can also be specified independently like:
*
* ```js
* classNames={{
* appear: 'my-appear',
* appearActive: 'my-active-appear',
* appearDone: 'my-done-appear',
* enter: 'my-enter',
* enterActive: 'my-active-enter',
* enterDone: 'my-done-enter',
* exit: 'my-exit',
* exitActive: 'my-active-exit',
* exitDone: 'my-done-exit',
* }}
* ```
*
* If you want to set these classes using CSS Modules:
*
* ```js
* import styles from './styles.css';
* ```
*
* you might want to use camelCase in your CSS file, that way could simply
* spread them instead of listing them one by one:
*
* ```js
* classNames={{ ...styles }}
* ```
*
* @type {string | {
* appear?: string,
* appearActive?: string,
* appearDone?: string,
* enter?: string,
* enterActive?: string,
* enterDone?: string,
* exit?: string,
* exitActive?: string,
* exitDone?: string,
* }}
*/
classNames: classNamesShape,
/**
* A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
* applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEnter: PropTypes.func,
/**
* A `<Transition>` callback fired immediately after the 'enter-active' or
* 'appear-active' class is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEntering: PropTypes.func,
/**
* A `<Transition>` callback fired immediately after the 'enter' or
* 'appear' classes are **removed** and the `done` class is added to the DOM node.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEntered: PropTypes.func,
/**
* A `<Transition>` callback fired immediately after the 'exit' class is
* applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement)
*/
onExit: PropTypes.func,
/**
* A `<Transition>` callback fired immediately after the 'exit-active' is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement)
*/
onExiting: PropTypes.func,
/**
* A `<Transition>` callback fired immediately after the 'exit' classes
* are **removed** and the `exit-done` class is added to the DOM node.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement)
*/
onExited: PropTypes.func
}) : {};
export default CSSTransition;
webpack://frontend-tpt/../../node_modules/dom-helpers/esm/addClass.js
import hasClass from './hasClass';
/**
* Adds a CSS class to a given element.
*
* @param element the element
* @param className the CSS class name
*/
export default function addClass(element, className) {
if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
}
webpack://frontend-tpt/../../node_modules/dom-helpers/esm/hasClass.js
/**
* Checks if a given element has a CSS class.
*
* @param element the element
* @param className the CSS class name
*/
export default function hasClass(element, className) {
if (element.classList) return !!className && element.classList.contains(className);
return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Transitions/index.js
import { keyframes, css } from "styled-components";
export const delayTime = "150ms";
export const easeInOut = {
function: "ease-in-out",
value: 200,
time: "ms"
};
export const delayAction = {
function: "linear",
value: 0,
time: "s"
};
export const linear = {
function: "linear",
value: 300,
time: "ms"
};
export const cubic = {
function: "cubic-bezier(0.03, 0.59, 0.1, 0.97)",
value: 250,
time: "ms"
};
export const spring = {
function: "cubic-bezier(.19,1.32,.48,1)",
value: 450,
time: "ms"
};
export const pageSwitch = {
function: "cubic-bezier(0,1.02,.58,1)",
value: 400,
time: "ms"
};
export const generateTransition = (transition, cssProp = "all", delay) =>
`${cssProp} ${transition.value}${transition.time} ${transition.function}${
delay ? ` ${delay}` : ""
}`;
export const opacityIn = () => keyframes`
from {
opacity: 0;
}
to {
opacity: 1;
}
`;
export const opacityOut = () => keyframes`
from {
opacity: 1;
}
to {
opacity: 0;
}
`;
const TransitionBaseFloating = `
backface-visibility: hidden;
transform: translateZ(0);
will-change: transform;
transform: translate3d(0, -50%, 0);
transition: ${generateTransition(cubic, "transform")};
`;
const TransitionBase = `
backface-visibility: hidden;
transform: translateZ(0);
will-change: transform;
transform: translate3d(0, 0, 0);
transition: ${generateTransition(cubic, "transform")};
`;
export const SlideFloatingBottomTransition = css`
${TransitionBaseFloating}
&.bottomFloating-appear {
transition-delay: ${delayTime};
transform: translate3d(0, 50%, 0);
}
&.bottomFloating-appear-active {
transform: translate3d(0, -50%, 0);
}
&.bottomFloating-enter {
transition-delay: ${delayTime};
transform: translate3d(0, 50vh, 0);
}
&.bottomFloating-enter-active {
transform: translate3d(0, -50%, 0);
}
&.bottomFloating-exit {
transform: translate3d(0, 50vh, 0);
}
`;
export const SlideBottomTransition = css`
${TransitionBase}
&.bottom-appear {
transition-delay: ${delayTime};
transform: translate3d(0, 100%, 0);
}
&.bottom-appear-active {
transform: translate3d(0, 0, 0);
}
&.bottom-enter {
transition-delay: ${delayTime};
transform: translate3d(0, 100%, 0);
}
&.bottom-enter-active {
transform: translate3d(0, 0, 0);
}
&.bottom-exit {
transform: translate3d(0, 100%, 0);
}
`;
export const SlideTopTransition = css`
${TransitionBase}
&.top-appear {
transition-delay: ${delayTime};
transform: translate3d(0, -100%, 0);
}
&.top-appear-active {
transform: translate3d(0, 0, 0);
}
&.top-enter {
transition-delay: ${delayTime};
transform: translate3d(0, -100%, 0);
}
&.top-enter-active {
transform: translate3d(0, 0, 0);
}
&.top-exit {
transform: translate3d(0, -100%, 0);
}
`;
export const SlideRightTransition = css`
${TransitionBase}
&.right-appear {
transform: translate3d(99.9%, 0, 0);
}
&.right-appear-active {
transform: translate3d(0, 0, 0);
}
&.right-enter {
transform: translate3d(99.9%, 0, 0);
}
&.right-enter-active {
transform: translate3d(0, 0, 0);
}
&.right-exit {
transform: translate3d(99.9%, 0, 0);
}
`;
export const SlideLeftTransition = css`
${TransitionBase}
&.left-appear {
transform: translate3d(-99.9%, 0, 0);
}
&.left-appear-active {
transform: translate3d(0, 0, 0);
}
&.left-enter {
transform: translate3d(-99.9%, 0, 0);
}
&.left-enter-active {
transform: translate3d(0, 0, 0);
}
&.left-exit {
transform: translate3d(-99.9%, 0, 0);
}
`;
export const FadeTransition = css`
backface-visibility: hidden;
will-change: opacity;
transition: ${generateTransition(easeInOut, "opacity")};
&.fade-appear {
opacity: 0;
}
&.fade-appear-active {
opacity: 1;
}
&.fade-enter {
opacity: 0;
}
&.fade-enter-active {
opacity: 1;
}
&.fade-exit {
opacity: 0;
}
`;
export const grow = () => keyframes`
0% {
transform: scale(0);
}
50% {
transform: scale(1.5);
}
100%{
transform: scale(1);
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/ModalHeaderV3/styled-components.js
import styled, { css } from "styled-components";
import { transparentize } from "polished";
import { buildTitle } from "../../_atom/Title";
import Button from "../../_atom/Buttons/default";
import { fontBold } from "../../_static/Typography";
import { easeInOut, generateTransition } from "../../_static/Transitions";
import buildColor from "../../_static/ColorPalette";
export const TitleContainer = styled.div`
position: relative;
display: flex;
align-items: flex-start;
padding: 8px;
transition: ${generateTransition(easeInOut, "box-shadow")};
background-color: ${buildColor("white", "100")};
${({ showBottomShadow }) =>
showBottomShadow &&
css`
box-shadow: inset 0 -1px 0 ${buildColor("blue", "100")};
`};
color: ${buildColor("grey", "900")};
flex: 0 0 auto;
z-index: 2;
${(props) =>
props.roundedCorners &&
css`
border-radius: 4px 4px 0 0;
`};
${(props) =>
props.showShadow &&
css`
box-shadow:
0 2px 4px ${transparentize(0.94, buildColor("blue", "900"))},
0 1px 2px ${transparentize(0.92, buildColor("blue", "900"))};
`};
${(props) =>
props.device === "tablet" &&
css`
padding: 16px;
`};
`;
export const TitleHolder = styled.div`
display: inline-flex;
flex: 1 0 auto;
flex-direction: column;
${({ isTitleCenter }) =>
isTitleCenter &&
css`
text-align: center;
`}
`;
export const Title = styled(
buildTitle({
color: buildColor("grey", "900"),
fontSize: 16,
ellipsis: true,
uppercase: false,
qaLabel: "modal-title"
})
)`
flex: 1 1 auto;
margin: 4px 0 0 4px;
line-height: 24px;
font-family: ${fontBold};
${({ isTitleCapitalized }) =>
isTitleCapitalized &&
css`
text-transform: capitalize;
`}
`;
export const Subtitle = styled.p`
${({ isTitleCenter }) =>
!isTitleCenter &&
css`
margin: 0 0 4px 4px;
`};
line-height: 18px;
font-family: ${({ subtitleFontFamily }) => subtitleFontFamily};
font-size: 14px;
font-style: normal;
text-transform: capitalize;
color: ${({ subtitleColor }) => subtitleColor};
`;
const buttonStyle = css`
display: flex;
justify-content: center;
align-items: center;
width: 32px;
height: 32px;
border: 0;
background: none;
border-radius: 50%;
&:hover {
background-color: ${buildColor("grey", "100")};
}
&:active {
background-color: ${buildColor("grey", "200")};
}
@media (pointer: fine) {
&:hover {
background-color: ${buildColor("grey", "100")};
}
}
@media (pointer: coarse) {
&:active {
background-color: ${buildColor("grey", "200")};
}
}
`;
export const BackButton = styled(Button)`
${({ isAbsolute }) =>
isAbsolute &&
css`
position: absolute;
left: 6px;
top: 8px;
`};
${buttonStyle}
`;
export const CloseButton = styled(Button)`
position: absolute;
right: 6px;
top: 8px;
${buttonStyle}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/ModalHeaderV3/index.jsx
import React, { PureComponent } from "react";
import { noop, isFunction, get } from "lodash";
import {
BackButton,
CloseButton,
Subtitle,
Title,
TitleContainer,
TitleHolder
} from "./styled-components";
import { arrowBack, close } from "../../_static/Icons/icons";
import { fontNormal } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
export default class ModalHeader extends PureComponent {
static defaultProps = {
title: null,
subtitle: null,
onClose: noop,
onBack: null,
hasRoundedCorners: true,
hasCloseButton: true,
scrollableRef: {
current: null
},
className: "",
device: "mobile",
isTitleCenter: false,
subtitleColor: buildColor("grey", "800"),
subtitleFontFamily: fontNormal,
isTitleCapitalized: true,
showBottomShadow: true
};
constructor(props) {
super(props);
this.state = {
isAtTop: true
};
}
componentDidMount() {
this.addEventListener(this.props.scrollableRef.current);
}
componentDidUpdate(prevProps) {
this.removeEventListener(prevProps.scrollableRef.current);
this.addEventListener(this.props.scrollableRef.current);
}
componentWillUnmount() {
this.removeEventListener(this.props.scrollableRef.current);
}
setIsAtTop = () => {
if (get(this.props, "scrollableRef.current.scrollTop") === 0) {
this.setState({
isAtTop: true
});
} else {
this.setState({
isAtTop: false
});
}
};
addEventListener = (element) => {
if (element) {
element.addEventListener("scroll", this.setIsAtTop, {
capture: true
});
}
};
removeEventListener = (element) => {
if (element) {
element.removeEventListener("scroll", this.setIsAtTop);
}
};
render() {
const hasBack = this.props.onBack && isFunction(this.props.onBack);
const hasClose = this.props.hasCloseButton;
return (
<TitleContainer
className={this.props.className}
data-qa-label="modal-header"
roundedCorners={this.props.hasRoundedCorners}
showShadow={!this.state.isAtTop && this.props.showBottomShadow}
hasBack={hasBack}
device={this.props.device}
showBottomShadow={this.props.showBottomShadow}
>
{hasBack && (
<BackButton
qaLabel="modal-backBtn"
onClick={this.props.onBack}
isAbsolute={this.props.isTitleCenter}
>
<Icon
icon={arrowBack}
color={buildColor("grey", "900")}
size={16}
/>
</BackButton>
)}
{this.props.subtitle ? (
<TitleHolder isTitleCenter={this.props.isTitleCenter}>
<Title isTitleCapitalized={this.props.isTitleCapitalized}>
{this.props.title}
</Title>
<Subtitle
isUsingMargin={!this.props.isTitleCenter}
subtitleColor={this.props.subtitleColor}
subtitleFontFamily={this.props.subtitleFontFamily}
data-qa-label="modal-subtitle"
>
{this.props.subtitle}
</Subtitle>
</TitleHolder>
) : (
<TitleHolder isTitleCenter={this.props.isTitleCenter}>
<Title isTitleCapitalized={this.props.isTitleCapitalized}>
{this.props.title}
</Title>
</TitleHolder>
)}
{hasClose && (
<CloseButton qaLabel="modal-closeBtn" onClick={this.props.onClose}>
<Icon icon={close} color={buildColor("grey", "900")} size={16} />
</CloseButton>
)}
</TitleContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-formatter/currency/index.ts
import currencyFormatter from "currency-formatter";
import numeral from "numeral";
const formatCurrency = (
value: number,
code: string = "USD",
precision: number = 2
): string => currencyFormatter.format(value, { code, precision });
export const formatCurrencyShortened = (
value: number,
code: string = "USD",
precision: number = 0
): string => currencyFormatter.format(value, { code, precision });
export const formatNumber = (value: number | string): string =>
numeral(value).format("0.00");
export const formatPurse = (value: number): string =>
numeral(value).format(value >= 1000 ? "$0.0a" : "$0");
export const formatPurseWithoutCurrency = (value: number): string =>
numeral(value).format(value >= 1000 ? "0.0a" : "0.00a");
export const formatCurrencyToNumber = (value: string): number =>
+value.replace(/\$|,/g, "");
export default formatCurrency;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/ModalHeader/styled-components.js
import styled, { css } from "styled-components";
import { transparentize } from "polished";
import { buildTitle } from "../../_atom/Title";
import Button from "../../_atom/Buttons/default";
import Icon from "../../_static/Icons";
import { fontMedium, fontBold, fontNormal } from "../../_static/Typography";
import { easeInOut, generateTransition } from "../../_static/Transitions";
import buildColor from "../../_static/ColorPalette";
export const TitleContainer = styled.div`
display: flex;
align-items: stretch;
padding: 8px;
transition: ${generateTransition(easeInOut, "box-shadow")};
${({ isTitleCenter }) => isTitleCenter && `position: relative`};
${(props) =>
props.isNavigation
? css`
justify-content: flex-start;
background-color: ${buildColor("blue", "700")};
`
: css`
justify-content: ${({ isTitleCenter }) =>
isTitleCenter ? `center` : `space-between`};
background-color: ${props.titleType === "defaultBold"
? buildColor("blue", "700")
: buildColor("white", "100")};
${props.titleType !== "defaultBold" &&
props.hasHeaderBorder &&
css`
border-bottom: 1px solid ${buildColor("blue", "100")};
`};
`};
color: ${(props) =>
props.titleType === "defaultBold"
? buildColor("white", "100")
: buildColor("grey", "900")};
${(props) =>
props.roundedCorners &&
css`
border-radius: 4px 4px 0 0;
`};
flex: 0 0 auto;
${(props) =>
props.isSticky &&
css`
position: sticky;
top: 0;
z-index: 20;
`};
${(props) =>
props.myBetsStandaloneToggle &&
css`
color: ${buildColor("blue", "900")};
`};
${({ titleType, myBetsStandaloneToggle }) =>
titleType === "ipp" &&
!myBetsStandaloneToggle &&
css`
border-bottom: 1px solid ${buildColor("blue", "100")};
z-index: 20;
`}
${(props) =>
props.showShadow &&
css`
box-shadow:
0 2px 4px ${transparentize(0.94, buildColor("blue", "900"))},
0 1px 2px ${transparentize(0.92, buildColor("blue", "900"))};
`};
`;
export const NavigationTitleContainer = styled.div`
display: flex;
`;
export const HeaderButton = styled(Button)`
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border: 0;
background: none;
flex: 0 0 32px;
border-radius: 50%;
${({ isTitleCenter }) =>
isTitleCenter &&
css`
position: absolute;
top: 0;
right: 8px;
transform: translate(0, 25%);
`}
${({ hasBiggerHeader }) =>
hasBiggerHeader &&
css`
align-self: start;
`}
${({ hasMarginRight }) =>
hasMarginRight &&
css`
margin-right: 10px;
`}
${({ shouldRenderWhiteTitle }) =>
!shouldRenderWhiteTitle &&
`
&:hover {
background-color: ${buildColor("grey", "100")};
}
&:active {
background-color: ${buildColor("grey", "200")};
}
@media (pointer: fine) {
&:hover {
background-color: ${buildColor("grey", "100")};
}
}
@media (pointer: coarse) {
&:active {
background-color: ${buildColor("grey", "200")};
}
}
`}
`;
export const CloseButton = styled(Button)`
margin: 0 12px 0 auto;
color: ${buildColor("white", "100")};
font-weight: 500;
font-size: 14px;
font-family: ${fontMedium};
background: none;
display: flex;
${({ translateHeader }) =>
translateHeader &&
css`
transform: translateX(-338px);
`}
& > svg {
margin-left: 4px;
}
`;
export const StatusIcon = styled(Icon)`
margin-right: 8px;
`;
export const Title = styled(
buildTitle({
color: buildColor("grey", "900"),
fontSize: 16,
ellipsis: true,
uppercase: false,
qaLabel: "modal-title"
})
)`
display: flex;
align-items: center;
${({ isTitleCenter }) => !isTitleCenter && `flex: 1 1 auto`};
margin: 4px 0 0 4px;
line-height: 24px;
font-family: ${fontBold};
text-transform: capitalize;
${(props) =>
!props.hasSubtitle &&
css`
margin-bottom: 4px;
`};
${(props) =>
props.success &&
css`
color: ${buildColor("green", "600")};
`};
${(props) =>
props.error &&
css`
color: ${buildColor("red", "500")};
`};
${(props) =>
props.warning &&
css`
color: ${buildColor("orange", "500")};
`};
${(props) =>
props.isNavigation &&
css`
color: ${buildColor("white", "100")};
`};
${(props) =>
props.subtitle &&
css`
color: ${buildColor("grey", "800")};
`};
${(props) =>
props.myBetsStandaloneToggle &&
css`
display: inline-block;
font-family: ${fontBold};
text-transform: capitalize;
font-size: 18px;
`};
${({ info }) =>
info &&
css`
font-size: 18px;
font-weight: 700;
text-transform: none;
`}
${({ shouldRenderWhiteTitle }) =>
shouldRenderWhiteTitle && `color: ${buildColor("white", "100")};`}
`;
export const TitleHolder = styled.div`
flex: 1 0 auto;
display: inline-flex;
flex-direction: column;
`;
export const WidgetContainer = styled.div`
display: flex;
justify-content: space-between;
width: 100%;
align-items: center;
padding-right: 8px;
`;
export const Subtitle = styled.p`
margin: 0 0 4px 4px;
font-family: ${fontNormal};
font-size: 14px;
font-style: normal;
text-transform: capitalize;
line-height: 18px;
color: ${buildColor("grey", "800")};
`;
export const HeaderChildrenContainer = styled.div`
display: block;
width: 100%;
`;
export const HeaderContainer = styled.div`
display: block;
${(props) =>
props.showShadow &&
css`
z-index: 20;
box-shadow:
0 2px 4px ${transparentize(0.94, buildColor("blue", "900"))},
0 1px 2px ${transparentize(0.92, buildColor("blue", "900"))};
`};
`;
export const CounterContainer = styled.div`
margin: auto;
display: flex;
align-items: center;
padding-right: 12px;
`;
export const NormalCounter = styled.span`
padding-right: 4px;
font-weight: 700;
`;
export const DollarCounter = styled.span`
padding-right: 4px;
padding-left: 16px;
font-weight: 700;
`;
export const CounterDescription = styled.span`
font-size: 11px;
font-family: ${fontNormal};
color: ${buildColor("grey", "700")};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/ModalHeader/index.jsx
import React, { PureComponent } from "react";
import { noop, isFunction, get } from "lodash";
import { formatCurrency } from "@tvg/formatter";
import {
HeaderButton,
NavigationTitleContainer,
StatusIcon,
Subtitle,
Title,
TitleContainer,
TitleHolder,
WidgetContainer,
HeaderContainer,
HeaderChildrenContainer,
CounterContainer,
NormalCounter,
DollarCounter,
CounterDescription
} from "./styled-components";
import { arrowBack, close, success } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
export default class ModalHeader extends PureComponent {
static defaultProps = {
title: null,
subtitle: null,
titleType: "default",
onClose: noop,
onBack: null,
hasRoundedCorners: true,
widget: null,
isSticky: false,
hasCloseWithoutHeader: false,
hasIcon: true,
hasCloseButton: true,
hasHeaderBorder: true,
myBetsStandaloneToggle: false,
scrollableRef: {
current: null
},
hasBiggerHeader: false,
device: "mobile",
shouldRenderWhiteTitle: false,
headerTitleChildren: null,
isTitleCenter: false
};
constructor(props) {
super(props);
this.state = {
isAtTop: true
};
}
// ipp modal header needs to have a drop shadow when scrolled down
componentDidMount() {
this.addEventListener(
this.props.titleType,
this.props.scrollableRef.current
);
}
componentDidUpdate(prevProps) {
this.removeEventListener(
prevProps.titleType,
prevProps.scrollableRef.current
);
this.addEventListener(
this.props.titleType,
this.props.scrollableRef.current
);
}
componentWillUnmount() {
this.removeEventListener(
this.props.titleType,
this.props.scrollableRef.current
);
}
getArrowColor = (titleType) => {
if (titleType === "ipp") {
return buildColor("grey", "900");
}
return titleType === "defaultBold"
? buildColor("white", "100")
: buildColor("blue", "500");
};
setIsAtTop = () => {
if (get(this.props, "scrollableRef.current.scrollTop") === 0) {
this.setState({
isAtTop: true
});
} else {
this.setState({
isAtTop: false
});
}
};
addEventListener = (titleType, element) => {
if (titleType === "ipp" && element) {
element.addEventListener("scroll", this.setIsAtTop, {
capture: true
});
}
};
removeEventListener = (titleType, element) => {
if (titleType === "ipp" && element) {
element.removeEventListener("scroll", this.setIsAtTop);
}
};
render() {
let ModalTitle;
switch (this.props.titleType) {
case "success":
ModalTitle = (
<Title
success
myBetsStandaloneToggle={this.props.myBetsStandaloneToggle}
hasSubtitle={!!this.props.subtitle}
>
{this.props.hasIcon && (
<StatusIcon
icon={success}
color={buildColor("green", "600")}
size={16}
/>
)}
{this.props.title}
</Title>
);
break;
case "error":
ModalTitle = (
<Title
error
myBetsStandaloneToggle={this.props.myBetsStandaloneToggle}
hasSubtitle={!!this.props.subtitle}
>
{this.props.title}
</Title>
);
break;
case "warning":
ModalTitle = (
<Title
warning
myBetsStandaloneToggle={this.props.myBetsStandaloneToggle}
hasSubtitle={!!this.props.subtitle}
>
{this.props.title}
</Title>
);
break;
case "navigation":
ModalTitle = (
<Title
isNavigation
myBetsStandaloneToggle={this.props.myBetsStandaloneToggle}
hasSubtitle={!!this.props.subtitle}
>
{this.props.title}
</Title>
);
break;
case "subtitle":
ModalTitle = (
<Title
subtitle
myBetsStandaloneToggle={this.props.myBetsStandaloneToggle}
hasSubtitle={!!this.props.subtitle}
>
{this.props.title}
</Title>
);
break;
case "ipp":
ModalTitle = (
<Title
ipp
myBetsStandaloneToggle={this.props.myBetsStandaloneToggle}
hasBiggerHeader={this.props.hasBiggerHeader}
hasSubtitle={!!this.props.subtitle}
isTitleCenter={this.props.isTitleCenter}
>
{this.props.title}
</Title>
);
break;
case "info":
ModalTitle = (
<Title
info
hasSubtitle={!!this.props.subtitle}
isTitleCenter={this.props.isTitleCenter}
>
{this.props.title}
</Title>
);
break;
default:
ModalTitle = (
<Title
myBetsStandaloneToggle={this.props.myBetsStandaloneToggle}
hasSubtitle={!!this.props.subtitle}
shouldRenderWhiteTitle={this.props.shouldRenderWhiteTitle}
>
{typeof this.props.title === "string" &&
this.props.title.includes("RACE SCHEDULE")
? this.props.title.replace("RACE SCHEDULE", "Race Schedule")
: this.props.title}
</Title>
);
}
if (this.props.subtitle) {
ModalTitle = (
<TitleHolder>
{ModalTitle}
<Subtitle>{this.props.subtitle}</Subtitle>
</TitleHolder>
);
}
const hasBack =
/default|defaultBold|ipp/.test(this.props.titleType) &&
isFunction(this.props.onBack);
return this.props.titleType === "navigation" ? (
<TitleContainer
data-qa-label="modal-header"
titleType={this.props.titleType}
isNavigation={this.props.titleType === "navigation"}
roundedCorners={this.props.hasRoundedCorners}
isSticky={this.props.isSticky}
hasHeaderBorder={this.props.hasHeaderBorder}
myBetsStandaloneToggle={this.props.myBetsStandaloneToggle}
hasBiggerHeader={this.props.hasBiggerHeader}
device={this.props.device}
isTitleCenter={this.props.isTitleCenter}
>
<NavigationTitleContainer>
<HeaderButton qaLabel="modal-closeBtn" onClick={this.props.onClose}>
<Icon
icon={arrowBack}
color={buildColor("white", "100")}
size={16}
/>
</HeaderButton>
</NavigationTitleContainer>
<WidgetContainer>
{ModalTitle}
{this.props.widget}
</WidgetContainer>
</TitleContainer>
) : (
<HeaderContainer
showShadow={this.props.titleType === "ipp" && !this.state.isAtTop}
>
<TitleContainer
data-qa-label="modal-header"
titleType={this.props.titleType}
roundedCorners={this.props.hasRoundedCorners}
hasBack={hasBack}
hasHeaderBorder={this.props.hasHeaderBorder}
myBetsStandaloneToggle={this.props.myBetsStandaloneToggle}
hasBiggerHeader={this.props.hasBiggerHeader}
device={this.props.device}
isTitleCenter={this.props.isTitleCenter}
>
{hasBack && (
<HeaderButton qaLabel="modal-backBtn" onClick={this.props.onBack}>
<Icon
icon={arrowBack}
color={this.getArrowColor(this.props.titleType)}
size={16}
/>
</HeaderButton>
)}
{ModalTitle}
{this.props.headerTitleChildren && this.props.headerTitleChildren}
{this.props.hasCloseButton && (
<HeaderButton
qaLabel="modal-closeBtn"
onClick={this.props.onClose}
hasBiggerHeader={this.props.hasBiggerHeader}
hasMarginRight={this.props.device !== "mobile"}
shouldRenderWhiteTitle={this.props.shouldRenderWhiteTitle}
isTitleCenter={this.props.isTitleCenter}
>
<Icon
icon={close}
color={
this.props.titleType === "defaultBold"
? buildColor("white", "100")
: buildColor("grey", "900")
}
size={18}
qaLabel="modal-closeBtn-Icon"
/>
</HeaderButton>
)}
</TitleContainer>
{this.props.headerChildren && (
<HeaderChildrenContainer>
{this.props.headerChildren}
</HeaderChildrenContainer>
)}
</HeaderContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/Video/OverlayControls/styled-components.js
import styled from "styled-components";
import Button from "../../../_atom/Buttons/button";
import buildColor from "../../../_static/ColorPalette";
export const Container = styled.div`
position: absolute;
top: 0;
left: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
padding: 8px;
z-index: 2000;
background-color: ${(props) => props.isVisible && buildColor("black", "30")};
`;
export const ExpandButton = styled(Button)`
justify-self: stretch;
`;
export const VolumeButton = styled(Button)`
justify-self: stretch;
margin-right: 8px;
`;
export const PlayButton = styled.button`
display: flex;
height: 40px;
padding: 0 8px;
background-color: ${buildColor("black", "30")};
border-radius: 2px;
outline: none;
cursor: pointer;
/* only add hover state for fine pointers, meaning that only on desktops using a mouse the hover state will work */
@media (pointer: fine) {
&:hover {
background-color: ${buildColor("black", "30")};
}
}
&:active {
background-color: ${buildColor("black", "50")};
/* on touch devices (coarse), the active color should be the hover spec according to the style guide on zeplin */
@media (pointer: coarse) {
background-color: ${buildColor("black", "30")};
}
}
& > span {
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
}
`;
export const LeftCornerOverlay = styled.div`
position: absolute;
top: 0;
right: 0;
display: flex;
padding: 8px;
`;
// TODO: TO BE REMOVED ON THE FUTURE
export const FeedBackContainer = styled.div`
position: relative;
place-self: stretch stretch;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
& span {
padding-top: 4px;
}
`;
export const SkipButton = styled.button`
background-color: ${buildColor("black", "60")};
color: ${buildColor("white", "100")};
width: 57px;
height: 24px;
top: calc(50% - 12px);
border-radius: 2px;
padding: 0 8px;
font-weight: bold;
font-size: 12px;
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
&.rewButton {
position: absolute;
left: 8px;
}
&.fwdButton {
position: absolute;
right: 8px;
}
`;
export const PlayButtonLabel = styled.span`
text-transform: uppercase;
color: ${buildColor("white", "100")};
font-size: 12px;
user-select: none;
`;
export const InnerPlayButtonWrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
`;
export const WatchButton = styled.button`
color: ${buildColor("white", "100")};
font-size: 12px;
text-transform: uppercase;
padding: 7px 8px;
background-color: ${buildColor("black", "30")};
position: absolute;
top: 8px;
left: calc(50% - 52px);
cursor: pointer;
border-radius: 2px;
&.replay {
left: calc(50% - 45px);
}
/* only add hover state for fine pointers, meaning that only on desktops using a mouse the hover state will work */
@media (pointer: fine) {
&:hover {
background-color: ${buildColor("black", "30")};
}
}
&:active {
background-color: ${buildColor("black", "50")};
/* on touch devices (coarse), the active color should be the hover spec according to the style guide on zeplin */
@media (pointer: coarse) {
background-color: ${buildColor("black", "30")};
}
}
`;
export const FullUnmuteButton = styled(Button)`
margin-right: 8px;
& svg {
margin-right: 6px;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/FeedbackOverlay/styled-components.js
import styled, { keyframes } from "styled-components";
import buildColor from "../../_static/ColorPalette";
const ScaleAnimation = keyframes`
0% {
transform: scale(0);
opacity: 0;
}
100% {
transform: scale(1);
opacity: 1;
}
`;
const FadeAnimation = keyframes`
0% {
opacity: 0;
}
100% {
opacity: 1;
}
`;
export const Overlay = styled.div`
position: absolute;
inset: 0;
background-color: ${(props) => props.overlayBgColor};
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-transform: uppercase;
color: ${buildColor("white", "100")};
font-weight: bold;
font-size: 16px;
animation: ${FadeAnimation} 0.5s ease-in-out;
z-index: 9999;
`;
export const Circle = styled.div`
display: flex;
align-items: center;
justify-content: center;
width: 80px;
height: 80px;
border-radius: 100%;
margin-bottom: 16px;
`;
export const Success = styled(Circle)`
background-color: ${buildColor("green", "500")};
animation: ${ScaleAnimation} 0.5s;
`;
export const Error = styled(Circle)`
background-color: ${buildColor("red", "500")};
animation: ${ScaleAnimation} 0.5s;
`;
export const Warning = styled(Circle)`
background-color: ${buildColor("yellow", "500")};
animation: ${ScaleAnimation} 0.5s;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/FeedbackOverlay/index.jsx
import React, { PureComponent } from "react";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import { tick, warning, close } from "../../_static/Icons/icons";
import Spinner from "../../_static/Spinners";
import { Overlay, Success, Error, Warning } from "./styled-components";
export default class FeedbackOverlay extends PureComponent {
static defaultProps = {
type: "loading",
message: "",
loadingIconColor: buildColor("white", "100"),
overlayBgColor: buildColor("black", "70")
};
renderIcon() {
switch (this.props.type) {
case "success":
return (
<Success data-qa-label="feedback-successIcon">
<Icon icon={tick} color={buildColor("white", "100")} size={50} />
</Success>
);
case "error":
return (
<Error data-qa-label="feedback-errorIcon">
<Icon icon={close} color={buildColor("white", "100")} size={50} />
</Error>
);
case "warning":
return (
<Warning data-qa-label="feedback-warningIcon">
<Icon icon={warning} color={buildColor("white", "100")} size={50} />
</Warning>
);
case "loading":
default:
return (
<Spinner
width={32}
height={32}
color={this.props.loadingIconColor}
data-qa-label="feedback-loadingIcon"
/>
);
}
}
render() {
return (
<Overlay
overlayBgColor={this.props.overlayBgColor}
data-qa-label="feedback"
>
{this.renderIcon()}
<span data-qa-label={`feedback-${this.props.type}`}>
{this.props.message}
</span>
</Overlay>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/Video/OverlayControls/index.jsx
import React, { Fragment } from "react";
import { noop } from "lodash";
import {
Container,
ExpandButton,
VolumeButton,
FullUnmuteButton,
PlayButton,
FeedBackContainer,
LeftCornerOverlay,
PlayButtonLabel,
InnerPlayButtonWrapper,
SkipButton,
WatchButton
} from "./styled-components";
import Icon from "../../../_static/Icons";
import buildColor from "../../../_static/ColorPalette";
import {
fullscreen,
fullscreenExit,
soundMute,
soundPlay,
info,
play,
videoReplay,
refresh,
pause,
doubleArrowLeft,
doubleArrowRight
} from "../../../_static/Icons/icons";
import Text from "../../../_atom/Text";
import FeedbackOverlay from "../../../_atom/FeedbackOverlay";
class OverlayControls extends React.Component {
static defaultProps = {
renderOnOverlay: noop,
skipToggleHandler: noop,
liveButtonCallback: noop,
showControls: true,
loading: false,
isReplay: false,
hasLiveStream: false,
hasReplayStream: false,
isFullUnmute: false,
fwdButtonIsVisible: false,
rewButtonIsVisible: false,
hasNewStreamVideo: false,
disableFullscreen: false
};
playIcon = () => {
let returnIcon = play;
if (!this.props.playing && this.props.isReplay && this.props.ended) {
returnIcon = refresh;
} else if (!this.props.playing && this.props.isReplay) {
returnIcon = videoReplay;
} else if (this.props.playing) {
returnIcon = pause;
}
return returnIcon;
};
playButtonLabel = () => (this.props.ended ? "RESTART" : "REPLAY");
renderPlayButton = () => {
const isEndOfReplay = this.props.ended && this.props.isReplay;
const hasntEnded = !this.props.ended;
const hasNoErrorsLoading = !this.props.loading && !this.props.error;
const showPlayButton =
(isEndOfReplay || hasntEnded) &&
(hasNoErrorsLoading ||
(!this.props.isReplay && this.props.hasNewStreamVideo));
return (
showPlayButton && (
<PlayButton type="shadow" onClick={this.props.playHandler}>
<InnerPlayButtonWrapper>
<Icon
size={this.props.isReplay && !this.props.playing ? 16 : 24}
icon={this.playIcon()}
color={buildColor("white", "100")}
/>
{this.props.isReplay && !this.props.playing && (
<PlayButtonLabel>{this.playButtonLabel()}</PlayButtonLabel>
)}
</InnerPlayButtonWrapper>
</PlayButton>
)
);
};
renderWatchButton = () => {
const buttonLabel = this.props.isReplay ? "WATCH LIVE" : "WATCH REPLAY";
return (
<WatchButton
className={this.props.isReplay ? "replay" : ""}
onClick={this.props.liveButtonCallback}
>
{buttonLabel}
</WatchButton>
);
};
renderSkipButtonLabel = (actionType) =>
actionType === "fwd" ? (
<Fragment>
<span>15s</span>
<Icon
size={16}
icon={doubleArrowRight}
color={buildColor("white", "100")}
/>
</Fragment>
) : (
<Fragment>
<Icon
size={16}
icon={doubleArrowLeft}
color={buildColor("white", "100")}
/>
<span>15s</span>
</Fragment>
);
renderVideoOptions = () => (
<Fragment>
<LeftCornerOverlay>
{this.props.isFullUnmute &&
!this.props.loading &&
this.props.playing ? (
<FullUnmuteButton
type="secondary"
qaLabel="full-unMute-btn"
onClick={this.props.muteHandler}
>
<Icon size={16} icon={soundMute} />
<span>tap to unmute</span>
</FullUnmuteButton>
) : (
<VolumeButton type="shadow" onClick={this.props.muteHandler}>
<Icon
size={16}
icon={this.props.muted ? soundMute : soundPlay}
color={buildColor("white", "100")}
/>
</VolumeButton>
)}
{!this.props.disableFullscreen && (
<ExpandButton type="shadow" onClick={this.props.fullscreenHandler}>
<Icon
size={16}
icon={this.props.fullscreen ? fullscreenExit : fullscreen}
color={buildColor("white", "100")}
/>
</ExpandButton>
)}
</LeftCornerOverlay>
{/* this need to be replaced by feedback component */}
{((!this.props.isReplay && this.props.ended) ||
(this.props.error &&
(this.props.isReplay || !this.props.hasNewStreamVideo))) && (
<FeedBackContainer>
<Icon icon={info} color={buildColor("white", "100")} size={16} />
<Text fontSize={12} color={buildColor("white", "100")}>
The streaming is not available
</Text>
</FeedBackContainer>
)}
{this.props.hasLiveStream &&
this.props.hasReplayStream &&
this.renderWatchButton()}
{this.renderPlayButton()}
{this.props.isReplay && (
<Fragment>
{this.props.rewButtonIsVisible && (
<SkipButton
className="rewButton"
qaLabel="videoRewButton"
onClick={this.props.skipToggleHandler("rew")}
>
{this.renderSkipButtonLabel("rew")}
</SkipButton>
)}
{this.props.fwdButtonIsVisible && (
<SkipButton
className="fwdButton"
qaLabel="videoFwdButton"
onClick={this.props.skipToggleHandler("fwd")}
>
{this.renderSkipButtonLabel("fwd")}
</SkipButton>
)}
</Fragment>
)}
</Fragment>
);
render() {
const showOverLay =
(this.props.buffering && !this.props.error) || this.props.loading;
return (
<Container
onClick={() => this.props.clickHandler(true)}
isVisible={this.props.showControls}
>
{this.props.showControls && this.renderVideoOptions()}
{showOverLay &&
(this.props.isReplay || !this.props.hasNewStreamVideo) && (
<FeedbackOverlay />
)}
{this.props.renderOnOverlay(this.props.showControls)}
</Container>
);
}
}
export default OverlayControls;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/Video/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
export const Container = styled.div`
position: relative;
display: flex;
${(props) =>
props.containerHeight
? css`
height: ${props.containerHeight}px;
max-height: ${props.containerHeight}px;
`
: css`
width: 100%;
height: 100%;
`};
flex-shrink: 0;
align-items: center;
justify-content: center;
${(props) =>
props.background
? css`
background-image: url("${props.background}");
background-size: 100% 100%;
`
: css`
background-color: ${buildColor("black", "100")};
`};
& canvas {
${(props) => props.hideCanvas && "display: none;"}
}
`;
export const StyledVideo = styled.video`
height: 100%;
width: 100%;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/Video/Stream/styled-components.js
import styled from "styled-components"; const StyledStream = styled.ins` height: 100%; width: 100%; `; export default StyledStream;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/Video/Stream/index.jsx
import React, { useEffect, useCallback } from "react";
import { noop, get } from "lodash";
import StyledStream from "./styled-components";
const StreamVideo = (props) => {
const bindVideoRef = () => {
const videoElem = document.querySelector("video");
if (videoElem) {
props.setVideoElement(videoElem);
const playerId = videoElem.id
.replace("h5live-player_", "")
.replace("_html5_api", "")
.replace("player_", "");
const player = window.RCN.players[playerId];
if (player) {
props.setupPlayer(player);
}
}
};
useEffect(() => {
if (window.RCN) {
window.RCN.addRCNEventHandler("h2livePlay", props.onPlay);
window.RCN.addRCNEventHandler("h2liveReady", bindVideoRef);
}
return () => {
if (window.RCN) {
window.RCN.removeRCNEventHandler("h2livePlay", props.onPlay);
window.RCN.removeRCNEventHandler("h2liveReady", bindVideoRef);
}
};
}, []);
const refCallback = useCallback((node) => {
if (node) {
bindVideoRef();
}
});
const isIosTablet =
get(window, "__TVG_GLOBALS__.PRODUCT") === "ios2" &&
get(window, "__TVG_GLOBALS__.DEVICE") === "tablet";
return (
<StyledStream
data-referer="TVG"
data-hash={props.dataHash}
data-timestamp={props.dataTimestamp}
data-stream={props.dataStream}
data-autoplay="1"
data-muted="1"
data-hd={props.dataQuality}
data-speed={props.dataQuality === "1" ? "771" : "400"}
data-hidecontrols="1"
data-poster="none"
data-forcetech={isIosTablet ? "iosh2live" : undefined}
ref={refCallback}
/>
);
};
StreamVideo.defaultProps = {
dataHash: "",
dataTimestamp: "",
dataStream: "",
dataQuality: "",
onPlay: noop,
setVideoElement: noop,
setupPlayer: noop
};
export default StreamVideo;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/Video/index.jsx
import React from "react";
import {
debounce,
get,
isNumber,
noop,
isFunction,
isEqual,
isUndefined,
attempt,
isError,
negate
} from "lodash";
import OverlayControls from "./OverlayControls";
import { Container, StyledVideo } from "./styled-components";
import StreamVideo from "./Stream";
export const calcVideoContainerHeight = () => {
const width = get(window, "innerWidth");
return isNumber(width) ? Math.min(Math.round((width / 16) * 9), 284) : 180;
};
class Video extends React.Component {
static defaultProps = {
src: {
sd: null,
hd: null,
replay: null
},
mtp: 0,
feedSwitchLoading: false,
raceStatus: "IC",
error: false,
isReplay: false,
backGroundImage: null,
inlineVideo: false,
onVideoMute: noop,
onVideoFullScreen: noop,
onVideoPlay: noop,
onVideoPause: noop,
onVideoSuccess: noop,
onVideoError: noop,
renderOnOverlay: noop,
startCallback: noop,
errorCallback: noop,
videoFullscreenTilt: false,
deviceLockRotationToggle: noop,
reloadStreams: () => new Promise(noop),
onSwitchVideoType: noop,
onNavigateVideo: noop,
isAutoPlay: false,
hasNewStreamVideo: false,
disableFullscreen: false
};
constructor(props) {
super(props);
this.state = {
controlsVisible: true,
quality: "hd",
playing: this.props.isAutoPlay,
fullscreen: false,
muted: this.props.isAutoPlay,
isFullUnmute: true,
ended: false,
buffering: false,
loading: true,
loadingTimeout: setTimeout(() => {
this.setState({
loading: false,
feedSwitchLoading: false,
error: true
});
}, 10000),
error: false,
skipping: false,
live: !props.isReplay,
raceId: props.raceId,
feedSwitchLoading: false,
videoSRC: !this.props.isReplay
? this.props.src.hd
: this.props.src.replay,
src: {
sd: get(this.props, "sd", null),
hd: get(this.props, "hd", null),
replay: get(this.props, "replay", null)
},
retry: 0,
updateIndex: 0,
autoPlay: this.props.isAutoPlay
};
// big hack to play videos on chrome
if (typeof window !== "undefined" && !!window.chrome) {
attempt(() => {
const element = document.getElementById("videoHack");
element.classList.add("videoHack");
});
}
}
componentDidMount() {
this.props.reloadStreams();
document.addEventListener(
"webkitfullscreenchange",
this.exitFullScreenMobile,
true
);
document.addEventListener(
"mozfullscreenchange",
this.exitFullScreenMobile,
true
);
window.addEventListener("resize", this.updateVideoSize);
window.addEventListener("online", this.restartVideo, false);
if (this.props.videoFullscreenTilt) {
window.addEventListener("orientationchange", this.orientationChange);
this.addBackgroundRunDetect();
}
let hidden;
let visibilityChange;
if (typeof document.hidden !== "undefined") {
visibilityChange = "visibilitychange";
} else if (typeof document.msHidden !== "undefined") {
visibilityChange = "msvisibilitychange";
} else if (typeof document.webkitHidden !== "undefined") {
visibilityChange = "webkitvisibilitychange";
}
if (
typeof document.addEventListener !== "undefined" &&
hidden !== undefined
) {
document.addEventListener(
visibilityChange,
this.handleVisibilityChange,
false
);
}
}
shouldComponentUpdate(nextProps, nextState) {
return (
!isEqual(nextProps.src, this.props.src) ||
!isEqual(nextState, this.state) ||
!isEqual(nextProps, this.props)
);
}
getSnapshotBeforeUpdate(prevProps, prevState) {
if (prevState.videoSRC !== this.state.videoSRC) {
attempt(() => {
const { id } = this.player;
this.player.cleanupConvivaSession();
this.streamPlayer.destroy();
setTimeout(() => {
delete window.RCN.players[id];
}, 1000);
});
}
return null;
}
componentDidUpdate(nextProps) {
if (!isEqual(this.props.raceId, nextProps.raceId)) {
this.closeControlsDebounce.cancel();
}
}
static getDerivedStateFromProps(props, state) {
// When an error occurs
if (props.error) {
props.onVideoError("The streaming is not available");
return {
...state,
playing: false,
controlsVisible: true,
error: true,
loading: false,
feedSwitchLoading: false,
skipping: false
};
}
const srcAndRaceHasChanged = !isEqual(state.src, props.src);
if (srcAndRaceHasChanged) {
if (state.feedSwitchLoading && state.loadingTimeout) {
clearTimeout(state.loadingTimeout);
}
if (state.raceId !== props.raceId) {
const shouldGoToLive =
(!state.live && state.src.replay && !props.src.replay) ||
(state.live && !props.src.replay);
const hasReplay = !!props.src.replay;
const live = state.playing ? shouldGoToLive : !hasReplay;
const newSrc = live ? props.src[state.quality] : props.src.replay;
return {
...state,
raceId: props.raceId,
controlsVisible: true,
live,
ended: false,
feedSwitchLoading:
newSrc !== state.videoSRC ? true : state.feedSwitchLoading,
src: props.src,
retry: 0,
error: false,
videoSRC: newSrc
};
}
const newSrc = state.live ? props.src[state.quality] : props.src.replay;
return {
...state,
src: props.src,
ended: false,
feedSwitchLoading:
newSrc !== state.videoSRC ? true : state.feedSwitchLoading,
videoSRC: newSrc,
retry: 0,
error: false
};
}
return null;
}
componentDidCatch() {
this.setState(
{
controlsVisible: true,
playing: false,
fullscreen: false,
skipping: false
},
() => {
this.fullscreenOff();
}
);
}
componentWillUnmount() {
// This is an hack. browser continue to download data if we don't change the src and load.
if (this.video || (this.streamPlayer && this.props.hasNewStreamVideo)) {
if (this.streamPlayer && this.props.hasNewStreamVideo) {
attempt(() => {
this.player.destroy();
this.player = null;
this.streamPlayer = null;
this.closeControlsDebounce.cancel();
});
} else {
this.video.pause();
this.video.src = "";
this.video.load();
this.closeControlsDebounce.cancel();
}
this.clearLoadingTimeout();
document.removeEventListener(
"webkitfullscreenchange",
this.exitFullScreenMobile,
true
);
document.removeEventListener(
"mozfullscreenchange",
this.exitFullScreenMobile,
true
);
window.removeEventListener("resize", this.updateVideoSize);
window.removeEventListener("online", this.restartVideo, false);
if (this.props.videoFullscreenTilt) {
window.removeEventListener("orientationchange", this.orientationChange);
this.props.deviceLockRotationToggle(true);
}
let hidden;
let visibilityChange;
if (typeof document.hidden !== "undefined") {
visibilityChange = "visibilitychange";
} else if (typeof document.msHidden !== "undefined") {
visibilityChange = "msvisibilitychange";
} else if (typeof document.webkitHidden !== "undefined") {
visibilityChange = "webkitvisibilitychange";
}
if (
typeof document.addEventListener !== "undefined" &&
hidden !== undefined
) {
document.removeEventListener(
visibilityChange,
this.handleVisibilityChange,
false
);
}
}
attempt(() => {
const element = document.getElementById("videoHack");
element.classList.remove("videoHack");
});
}
onPlay = () => {
const muted = get(this.video, "muted");
this.setState(
{
playing: true,
autoPlay: true,
controlsVisible: true,
ended: false,
skipping: false,
muted
},
this.restartControlsDebounce
);
};
onBufferOn = () => {
this.clearLoadingTimeout();
this.setState({
controlsVisible: true,
buffering: true,
loading: false
});
};
onBufferStop = () => {
this.clearLoadingTimeout();
if (this.state.skipping || this.state.playing) {
this.setState(
{
controlsVisible: true,
buffering: false,
loading: false,
autoPlay: true,
feedSwitchLoading: false
},
this.restartControlsDebounce
);
} else {
this.setState({
controlsVisible: get(this, "video.paused", true),
buffering: false,
loading: false,
playing: !get(this, "video.paused", true),
feedSwitchLoading: false
});
}
this.props.startCallback();
};
onVideoEnded = () => {
this.setState({
playing: false,
controlsVisible: this.props.isReplay,
ended: true,
loading: false,
skipping: false
});
};
onError = () => {
this.props.onVideoError("The streaming is not available");
this.setState(
{
playing: false,
feedSwitchLoading: false,
controlsVisible: true,
error: !(this.state.retry < 2),
loading: false,
skipping: false
},
() => {
if (this.state.retry < 2) {
this.clearLoadingTimeout();
this.props.reloadStreams();
this.setState({
retry: this.state.retry + 1,
feedSwitchLoading: true,
loadingTimeout: setTimeout(() => {
this.setState({ feedSwitchLoading: false, error: true });
}, 10000)
});
}
}
);
const error = {
message: get(this.video, "error.message", ""),
code: get(this.video, "error.code", -1)
};
this.props.errorCallback(error);
};
onLoadedMeta = () => {
if (!this.state.autoPlay) {
this.clearLoadingTimeout();
}
this.setState({
controlsVisible: true,
loading: this.state.autoPlay ? this.state.loading : false,
feedSwitchLoading: this.state.autoPlay
? this.state.feedSwitchLoading
: false
});
};
onPause = () => {
// setTimeout need for exiting fullScreen playing work
setTimeout(() => {
this.setState({
playing: false,
autoPlay: false
});
}, 0);
};
onMute = () => {
const muted = !!(this.video && this.video.muted);
if (this.state.muted !== muted)
this.setState({
muted
});
};
setVideoElement = (video) => {
this.video = video;
};
setupPlayer = (player) => {
this.player = player;
this.streamPlayer = player.playerObj;
};
playToggle = (e) => {
if (e && e.stopPropagation) {
e.stopPropagation();
}
// big hack for rcn v2, only allow start video if its ready
const bigButton = document.getElementsByClassName("vjs-big-play-button");
if (
this.props.hasNewStreamVideo &&
!this.props.isReplay &&
!this.streamPlayer &&
!bigButton.length
) {
return;
}
this.setState(
(prevState) => ({
playing: !prevState.playing,
autoPlay: !prevState.playing,
controlsVisible: true,
ended: false,
skipping: false
}),
() => {
this.props.deviceLockRotationToggle(!this.state.playing);
if (this.state.playing) {
this.closeControlsDebounce.flush();
if (e) {
this.props.onVideoPlay();
}
return this.playVideo();
}
this.closeControlsDebounce.cancel();
if (e) {
this.props.onVideoPause();
}
return this.pauseVideo();
}
);
};
playVideo = () => {
if (
!this.props.isReplay &&
this.streamPlayer &&
this.props.hasNewStreamVideo
) {
this.streamPlayer.play();
} else if (this.video) {
this.video.play().catch(() => {
this.setState({
playing: false,
controlsVisible: true,
buffering: false,
skipping: false
});
});
}
};
pauseVideo = () => {
if (
!this.props.isReplay &&
this.streamPlayer &&
this.props.hasNewStreamVideo
) {
this.streamPlayer.pause();
} else if (this.video) {
this.video.pause();
}
};
addBackgroundRunDetect = () => {
let hidden;
let visibilityChange;
if (!isUndefined(document.hidden)) {
hidden = "hidden";
visibilityChange = "visibilitychange";
} else if (!isUndefined(document.msHidden)) {
hidden = "msHidden";
visibilityChange = "msvisibilitychange";
} else if (!isUndefined(document.webkitHidden)) {
hidden = "webkitHidden";
visibilityChange = "webkitvisibilitychange";
}
if (!isUndefined(document.addEventListener) && !isUndefined(hidden)) {
document.addEventListener(
visibilityChange,
this.handleVisibilityChange,
false
);
}
};
handleVisibilityChange = (hiddenKey) => {
if (document[hiddenKey]) {
if (this.video && !this.state.fullscreen) {
this.setState({
playing: false,
fullscreen: false
});
this.video.pause();
this.exitFullScreenCrossDevice();
}
}
if (this.streamPlayer && this.props.hasNewStreamVideo) {
if (document.visibilityState === "visible") {
window.hl2functions.reloadPlayer(this.player.id);
} else {
this.streamPlayer.pause();
}
}
};
orientationChange = () => {
if (
(window.orientation === 90 || window.orientation === -90) &&
this.state.playing
) {
this.fullscreenOn(true);
} else if (this.state.playing) {
this.exitFullScreenCrossDevice(true);
}
};
exitFullScreenCrossDevice = (tilt = false) => {
const webkitExitFullscreen = get(this.video, "webkitExitFullscreen", null);
if (isFunction(webkitExitFullscreen)) {
this.video.webkitExitFullscreen();
this.exitFullScreenSafariMobile(tilt);
// hack to prevent video resizing in safari when coming out of full screen
this.hackToTriggerCssRepaint(
this.video,
"vjs-tech",
"object-fit: cover",
100
);
} else {
this.fullscreenOff();
this.exitFullScreenMobile(tilt);
}
};
updateVideoSize = () => {
setTimeout(() => {
window.scroll();
this.setState(
{
updateIndex: this.state.updateIndex + 1
},
() => {
window.scroll();
}
);
}, 300);
};
hackToTriggerCssRepaint(element, className, style, timeoutDelay) {
const { classList } = element;
if (classList.contains(className)) {
this.video.style = style;
setTimeout(() => {
this.video.style = "";
}, timeoutDelay);
}
}
exitFullScreenSafariMobile = (tilt = false) => {
// hack to prevent video resizing in safari when coming out of full screen
this.hackToTriggerCssRepaint(
this.video,
"vjs-tech",
"object-fit: cover",
500
);
this.setState(
{
fullscreen: false,
buffering: false
},
() => {
if (this.state.playing && get(this, "video.play")) {
setTimeout(() => {
if (this.streamPlayer) {
this.streamPlayer.play();
} else {
this.video.play().catch(console.log);
}
this.setState({
playing: true,
autoPlay: true
});
}, 1000);
}
}
);
this.video.removeEventListener(
"webkitendfullscreen",
this.exitFullScreenSafariMobile,
true
);
this.props.onVideoFullScreen(false, tilt);
};
muteVideo = () => {
this.props.onVideoMute(true);
this.video.muted = true;
};
unmuteVideo = () => {
this.props.onVideoMute(false);
this.video.muted = false;
};
skipToggleHandler = (skipType) => (e) => {
this.props.onNavigateVideo(skipType === "fwd");
const videoDuration = this.video.duration;
const bufferedVideo = this.video.buffered.length;
const incrementValue =
this.state.buffering && bufferedVideo < videoDuration
? bufferedVideo
: 15;
const increment = skipType === "fwd" ? incrementValue : -15;
const timeIsOverDuration =
skipType === "fwd" && this.video.currentTime + increment >= videoDuration;
const timeIsBellowZero =
skipType === "rew" && this.video.currentTime + increment <= 0;
if (e && e.stopPropagation) {
e.stopPropagation();
}
this.setState({ controlsVisible: true, skipping: true }, () => {
if (isFunction(this.closeControlsDebounce.cancel)) {
this.closeControlsDebounce.cancel();
}
this.closeControlsDebounce = debounce(() => this.closeControls(), 3000);
});
if (timeIsOverDuration) {
this.video.currentTime = videoDuration - 0.01;
} else if (timeIsBellowZero) {
this.video.currentTime = 0;
} else {
this.video.currentTime += increment;
}
};
exitFullScreenMobile = (tilt = false) => {
const isInFullScreen =
document.fullscreenElement ||
document.webkitFullscreenElement ||
document.mozFullScreenElement ||
document.msFullscreenElement;
if (!isInFullScreen) {
this.setState(
{
fullscreen: false
},
() => {
if (this.state.playing && get(this, "video.play")) {
setTimeout(() => {
if (this.streamPlayer) {
this.streamPlayer.play();
} else {
this.video.play().catch(console.log);
}
this.setState({
playing: true,
autoPlay: true
});
}, 1000);
}
}
);
this.props.onVideoFullScreen(false, tilt);
}
};
fullscreenOn = (tilt = false) => {
let fullScreenState = this.state.fullscreen;
if (get(this.video, "webkitSupportsFullscreen")) {
this.video.webkitEnterFullscreen();
this.video.addEventListener(
"webkitendfullscreen",
this.exitFullScreenSafariMobile,
true
);
fullScreenState = true;
} else if (this.container.requestFullscreen) {
this.container.requestFullscreen();
fullScreenState = true;
} else if (this.container.webkitRequestFullscreen) {
this.container.webkitRequestFullscreen();
fullScreenState = true;
} else if (this.container.mozRequestFullScreen) {
this.container.mozRequestFullScreen();
fullScreenState = true;
} else if (this.container.msRequestFullscreen) {
this.container.msRequestFullscreen();
fullScreenState = true;
}
if (get(window, "screen.orientation.lock")) {
setTimeout(() => {
window.screen.orientation.lock("landscape-primary");
}, 100);
}
this.setState({
fullscreen: fullScreenState
});
this.props.onVideoFullScreen(true, tilt);
// This can be added on future to lock landscape on fullscreenMode. Remember safari do not have this
// screen.orientation.lock('landscape');
};
fullscreenOff = () => {
let fullScreenState = this.state.fullscreen;
attempt(() => {
if (document.exitFullscreen) {
document.exitFullscreen();
fullScreenState = false;
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
fullScreenState = false;
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
fullScreenState = false;
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
fullScreenState = false;
}
this.setState({
fullscreen: fullScreenState
});
});
};
muteToggle = (e) => {
if (e && e.stopPropagation) {
e.stopPropagation();
}
if (this.video) {
this.setState(
(prevState) => ({
muted: !prevState.muted,
isFullUnmute: false
}),
() => {
if (this.state.muted) {
return this.muteVideo();
}
return this.unmuteVideo();
}
);
}
};
fullscreenToggle = (e) => {
if (e && e.stopPropagation) {
e.stopPropagation();
}
return this.fullscreenOn();
};
closeControls = () => {
this.setState({
controlsVisible: false,
skipping: false,
isFullUnmute: false
});
};
closeControlsDebounce = debounce(() => this.closeControls(), 3000);
restartControlsDebounce = () => {
if (isFunction(this.closeControlsDebounce.cancel)) {
this.closeControlsDebounce.cancel();
}
this.closeControlsDebounce();
};
showControls = (overrideSkipping = false) => {
// Controls are visible and skipping is not active, get controls to hide
if (
this.state.controlsVisible &&
(!this.state.skipping || overrideSkipping)
) {
this.setState(
{
controlsVisible: false
},
() => {
this.closeControlsDebounce.flush();
}
);
return;
}
// Otherwise, controls are not visible, get them to show
this.setState(
{
controlsVisible: true
},
() => {
if (!this.state.playing) {
this.closeControlsDebounce.cancel();
return;
}
this.closeControlsDebounce();
}
);
};
liveButtonCallback = (e) => {
if (e && e.stopPropagation) {
e.stopPropagation();
}
const live = !this.state.live;
this.props.onSwitchVideoType(live);
this.props.reloadStreams().then(() => {
this.setState({
playing: false,
autoPlay: this.state.playing,
retry: 0,
controlsVisible: true,
ended: false,
error: false,
feedSwitchLoading: true,
loadingTimeout: setTimeout(() => {
this.setState({ feedSwitchLoading: false, error: true });
}, 10000),
live,
videoSRC: live
? this.props.src[this.state.quality]
: this.props.src.replay
});
});
this.clearLoadingTimeout();
};
rewButtonIsVisible = () =>
this.video && this.state.playing ? this.video.currentTime >= 0 : false;
fwdButtonIsVisible = () =>
this.video && this.state.playing
? this.video.currentTime <= this.video.duration
: false;
restartVideo = () => {
if (
(this.state.playing && this.state.buffering) ||
this.state.error ||
this.state.feedSwitchLoading
) {
this.props.reloadStreams();
this.clearLoadingTimeout();
this.setState({
loading: false,
error: false,
buffering: false,
feedSwitchLoading: true,
loadingTimeout: setTimeout(() => {
this.setState({ feedSwitchLoading: false });
}, 10000),
controlsVisible: true,
playing: false,
autoPlay: false
});
}
};
clearLoadingTimeout = () => {
if (this.state.loadingTimeout) {
clearTimeout(this.state.loadingTimeout);
}
};
player;
streamPlayer;
video;
container;
isVideoReplay = (hasReplaySrc) => !this.state.live && hasReplaySrc;
hasVideoReplaySrc = () => !!this.props.src.replay;
renderLiveVideo = () => {
let streamHash = "";
let streamTimestamp = "";
let dataStream = "";
let hd = "";
const url = get(this, `props.src[${get(this, "state.quality", "")}]`, "");
if (url) {
const streamUrl = attempt((urlArg) => new URL(urlArg), url);
if (negate(isError)(streamUrl)) {
streamHash = streamUrl.searchParams.get("h");
streamTimestamp = streamUrl.searchParams.get("t");
dataStream = streamUrl.searchParams.get("stream");
hd = streamUrl.searchParams.get("hd");
} else {
console.log("ERROR IN URL:", streamUrl);
}
}
return (
<StreamVideo
dataHash={streamHash}
dataTimestamp={streamTimestamp}
dataStream={dataStream}
dataQuality={hd}
onPlay={this.onPlay}
setVideoElement={this.setVideoElement}
setupPlayer={this.setupPlayer}
/>
);
};
render() {
const hasLiveSrc = !!this.props.src[this.state.quality];
const hasReplaySrc = this.hasVideoReplaySrc();
const isReplay = this.isVideoReplay(hasReplaySrc);
return (
<Container
background={this.state.error && this.props.backGroundImage}
fullscreen={this.state.fullscreen}
hideCanvas={this.state.controlsVisible && !this.state.playing}
containerHeight={!this.props.inlineVideo && calcVideoContainerHeight()}
ref={(c) => {
if (c) {
this.container = c;
}
}}
>
{!!this.state.videoSRC &&
(!this.props.hasNewStreamVideo || isReplay ? (
<StyledVideo
fullscreen={this.state.fullscreen}
ref={(c) => {
if (c) {
this.video = c;
}
}}
src={this.state.videoSRC}
onEnded={this.onVideoEnded}
onWaiting={this.onBufferOn}
onError={this.onError}
onPause={this.onPause}
onLoadedData={this.props.onVideoSuccess}
onLoadedMetadata={this.onLoadedMeta}
onVolumeChange={this.onMute}
onPlaying={this.onBufferStop}
onCanPlay={this.onBufferStop}
playsInline
autoPlay={this.state.autoPlay}
muted={this.state.muted}
preload="metadata"
/>
) : (
this.renderLiveVideo()
))}
<OverlayControls
showControls={this.state.controlsVisible}
loading={this.state.feedSwitchLoading || this.state.loading}
clickHandler={this.showControls}
playing={this.state.playing}
playHandler={this.playToggle}
muted={this.state.muted}
isFullUnmute={this.props.isAutoPlay && this.state.isFullUnmute}
muteHandler={this.muteToggle}
fullscreen={this.state.fullscreen}
fullscreenHandler={this.fullscreenToggle}
skipToggleHandler={this.skipToggleHandler}
ended={this.state.ended}
buffering={this.state.buffering}
renderOnOverlay={this.props.renderOnOverlay}
error={
this.state.error || (!this.state.videoSRC && !this.state.loading)
}
isReplay={isReplay}
hasReplayStream={hasReplaySrc}
hasLiveStream={hasLiveSrc}
liveButtonCallback={this.liveButtonCallback}
rewButtonIsVisible={this.rewButtonIsVisible()}
fwdButtonIsVisible={this.fwdButtonIsVisible()}
hasNewStreamVideo={this.props.hasNewStreamVideo}
disableFullscreen={this.props.disableFullscreen}
/>
</Container>
);
}
}
export default Video;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ModalV2/transitions.styled-components.js
import styled, { css } from "styled-components";
import {
SlideFloatingBottomTransition,
SlideBottomTransition,
SlideTopTransition,
SlideLeftTransition,
SlideRightTransition,
FadeTransition
} from "../../_static/Transitions";
const modalWidthByDevice = (device) =>
device === "desktop"
? css`
width: 1000px;
`
: css`
@media (max-width: 320px) {
width: 100%;
}
@media (min-width: 320px) {
width: 345px;
}
@media (min-width: 1200px) {
width: 378px;
}
@media (min-width: 1365px) {
width: 414px;
}
`;
const BaseTransition = css`
position: fixed;
z-index: 1051;
display: flex;
flex-direction: column;
`;
const FullWidthMedia = css`
${(props) =>
props.isFullWidth
? css`
width: 100%;
`
: modalWidthByDevice(props.device)};
`;
const BottomFloating = css`
right: ${(props) => `${props.offset.right}px`};
left: ${(props) => `${props.offset.left}px`};
top: ${(props) => (props.fixIosKeyboard ? "70%" : "50%")};
width: auto;
${({ hasContentMaxHeight }) =>
hasContentMaxHeight &&
css`
max-height: 80vh;
`};
${({ hasContentMaxHeight, contentMaxHeight }) =>
hasContentMaxHeight &&
contentMaxHeight &&
css`
max-height: ${contentMaxHeight};
`};
${({ hasContentMaxHeight, contentMaxHeight, paddings }) =>
hasContentMaxHeight &&
contentMaxHeight &&
paddings &&
css`
padding-top: ${paddings};
padding-bottom: ${paddings};
`};
`;
const BottomPositioning = css`
right: ${(props) => `${props.offset.right}px`};
bottom: ${(props) => `${props.offset.bottom}px`};
${(props) =>
!props.isFullHeight &&
css`
max-height: calc(100% - ${`${props.offset.top + props.offset.bottom}px`});
`};
${(props) =>
props.isFullHeight &&
css`
top: ${`${props.offset.top}px`};
`};
`;
const LeftPositioning = css`
${(props) =>
props.isFullHeight &&
css`
top: ${`${props.offset.top}px`};
`};
left: ${(props) => `${props.offset.left}px`};
bottom: ${(props) => `${props.offset.bottom}px`};
`;
const RightPositioning = css`
right: ${(props) => `${props.offset.right}px`};
bottom: ${(props) => `${props.offset.bottom}px`};
${(props) =>
props.isFullHeight &&
css`
top: ${`${props.offset.top}px`};
`};
`;
const TopPositioning = css`
right: ${(props) => `${props.offset.right}px`};
top: ${(props) => `${props.offset.top}px`};
${(props) =>
props.isFullHeight &&
css`
bottom: ${`${props.offset.bottom}px`};
`};
`;
const FadePositioning = css`
${(props) =>
!props.isFullWidth &&
!props.isFluidWidth &&
!props.hasContainerFixedWidth &&
modalWidthByDevice(props.device)};
${(props) =>
!props.isFullHeight &&
!props.isFullWidth &&
css`
top: ${({ fixIosKeyboard }) => (fixIosKeyboard ? "70%" : "50%")};
left: 50%;
transform: translate3d(-50%, -50%, 0);
max-height: calc(
100vh - ${`${props.offset.top + props.offset.bottom}px`}
);
`};
${(props) =>
props.isFullHeight &&
props.isFullWidth &&
css`
top: ${`${props.offset.top}px`};
left: ${`${props.offset.left}px`};
right: ${`${props.offset.right}px`};
bottom: ${`${props.offset.bottom}px`};
transform: translate3d(0, 0, 0);
`};
${(props) =>
props.isFullWidth &&
!props.isFullHeight &&
css`
top: 50%;
left: ${`${props.offset.left}px`};
right: ${`${props.offset.right}px`};
transform: translate3d(0, -50%, 0);
`};
${(props) =>
!props.isFullWidth &&
props.isFullHeight &&
css`
top: ${`${props.offset.top}px`};
bottom: ${`${props.offset.bottom}px`};
left: 50%;
transform: translate3d(-50%, 0, 0);
`};
`;
export const FromBottomFloating = styled.div`
${BaseTransition};
${BottomFloating};
${SlideFloatingBottomTransition};
`;
export const FromBottom = styled.div`
${BaseTransition};
${BottomPositioning};
${FullWidthMedia};
${SlideBottomTransition};
`;
export const FromLeft = styled.div`
${BaseTransition};
${LeftPositioning};
${FullWidthMedia};
${SlideLeftTransition};
`;
export const FromRight = styled.div`
${BaseTransition};
${RightPositioning};
${FullWidthMedia};
${SlideRightTransition};
`;
export const FromTop = styled.div`
${BaseTransition};
${TopPositioning};
${FullWidthMedia};
${SlideTopTransition};
`;
export const FromFade = styled.div`
${BaseTransition};
${FadePositioning};
${FadeTransition};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ModalV2/styled-components.js
import styled, { css } from "styled-components";
import { opacityIn, opacityOut } from "../../_static/Transitions";
import buildColor from "../../_static/ColorPalette";
import {
FromBottomFloating,
FromBottom,
FromLeft,
FromRight,
FromTop,
FromFade
} from "./transitions.styled-components";
// Old value: 1050
// Reason to change this is to amtch teh z-index of design system modal to garantee the modals hierarchy
const defaultLayerOffset = 9999;
export const Overlay = styled.div.attrs((props) =>
props.qaLabel
? {
"data-qa-label": props.qaLabel
}
: {}
)`
position: fixed;
top: 0;
bottom: 0;
left: 0;
/* stylelint-disable-next-line */
right: 0;
width: 100%;
height: 100%;
z-index: ${({ layerOffset }) =>
layerOffset ? defaultLayerOffset + layerOffset : defaultLayerOffset};
overflow: hidden;
perspective: 1000px;
transform-style: preserve-3d;
background-color: ${(props) =>
props.isTransparent ? "transparent" : buildColor("black", "70")};
transition: opacity 0.3s ease-out;
opacity: ${(props) => +props.opening};
& ~ div {
z-index: ${({ layerOffset }) =>
layerOffset ? defaultLayerOffset + layerOffset : defaultLayerOffset};
}
`;
export const Transitions = {
bottomFloating: FromBottomFloating,
bottom: FromBottom,
left: FromLeft,
right: FromRight,
top: FromTop,
fade: FromFade
};
export const Container = styled.div.attrs((props) => ({
"data-qa-label": props.qaLabel
}))`
position: relative;
display: flex;
flex-direction: column;
flex: 1 1 auto;
width: ${({ fixedWidth }) => fixedWidth};
margin: auto;
min-height: 0;
${({ minWidth }) =>
minWidth &&
css`
min-width: ${minWidth};
`}
/* stylelint-disable-next-line */
& .iframeOnModal {
top: 48px;
position: fixed;
height: auto;
}
`;
export const Content = styled.div`
display: flex;
flex-direction: column;
flex: 1 1 auto;
overflow-y: auto;
overflow-scrolling: touch; /* stylelint-disable-line */
-webkit-overflow-scrolling: touch; /* stylelint-disable-line */
background-color: ${(props) =>
props.isContentTransparent
? buildColor("white", "0")
: buildColor("blue", "100")};
${(props) =>
props.roundedCorners &&
css`
border-radius: 0 0 4px 4px;
`};
${(props) =>
props.contentRoundedCorners &&
css`
border-radius: 4px 4px ${props.roundedCorners ? "4px 4px" : "0 0"};
`};
& > :first-child {
flex: 1 0 auto;
display: flex;
flex-direction: column;
}
`;
export const ContentScroll = styled.div`
display: flex;
flex: 1 1 auto;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ModalV2/defaultProps.js
import { noop } from "lodash";
export const ModalV2DefaultProps = {
title: null,
subtitle: null,
titleType: "default",
isOpen: false,
onOpen: noop,
onOpenAnimationEnd: noop,
onClose: noop,
onCloseAnimationEnd: noop,
shouldRenderWhite: false,
onBack: null,
onOverlayClick: null,
hasOverlay: true,
isFullWidth: true,
isFullHeight: true,
isFluidWidth: false,
hasRoundedCorners: true,
animation: "right",
offsetTop: 16,
offsetBottom: 0,
offsetLeft: 0,
offsetRight: 0,
hasVideoOffset: false,
children: noop,
qaLabel: null,
modalTopChildren: noop,
isLastModal: true,
fixIosKeyboard: false,
useFakeInput: false,
hasHeader: true,
device: "mobile",
hasHeaderIcon: true,
hasCloseButton: true,
fixedWidth: "100%",
myBetsStandaloneToggle: false,
layerOffset: 0,
hasContentMaxHeight: false,
hasBiggerHeader: false,
scrollableRef: { current: null },
setScrollableRef: null,
headerChildren: null,
headerTitleChildren: null,
onScrollFn: noop,
isTitleCenter: false,
isTitleCapitalized: true,
useModalHeaderV3: false,
showBottomShadow: true
};
export const ModalDefaultProps = {
title: null,
subtitle: null,
titleType: "default",
isOpen: false,
onOpen: noop,
onOpenAnimationEnd: noop,
onClose: noop,
onCloseAnimationEnd: noop,
onBack: null,
onOverlayClick: null,
hasOverlay: true,
isFullWidth: true,
isFullHeight: true,
isFluidWidth: false,
hasRoundedCorners: true,
animation: "right",
offsetTop: 16,
offsetBottom: 0,
offsetLeft: 0,
offsetRight: 0,
hasVideoOffset: false,
children: noop,
modalTopChildren: noop,
qaLabel: null,
fixIosKeyboard: false,
hasHeader: true,
device: "mobile",
isContentTransparent: false,
hasCloseWithoutHeader: false,
hasHeaderIcon: true,
hasHeaderBorder: true,
hasCloseButton: true,
fixedWidth: "100%",
myBetsStandaloneToggle: false,
layerOffset: 0,
hasContentMaxHeight: false,
contentMaxHeight: 0,
hasBiggerHeader: false,
scrollableRef: { current: null },
setScrollableRef: null,
useModalHeaderV3: false,
className: "",
shouldRenderWhiteTitle: false,
headerTitleChildren: null,
onScrollFn: noop,
isTitleCenter: false,
isTitleCapitalized: true
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ModalV2/utils.js
export const stopTouchEvent = (e) => e && e.stopPropagation();
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ModalV2/Modal.jsx
import React, { useRef, useState, Fragment } from "react";
import { CSSTransition } from "react-transition-group";
import { useModalV2Resize } from "@tvg/custom-hooks";
import { noop } from "lodash";
import ModalHeaderV3 from "../../_organism/ModalHeaderV3";
import ModalHeader from "../../_organism/ModalHeader";
import { calcVideoContainerHeight } from "../../_organism/Video";
import {
Container,
Content,
ContentScroll,
Overlay,
Transitions
} from "./styled-components";
import { ModalDefaultProps } from "./defaultProps";
import { stopTouchEvent } from "./utils";
const Modal = (props) => {
const [transition, setTransition] = useState("exited");
const contentRef = useRef(null);
useModalV2Resize(props.isOpen);
const renderOverlay = () =>
transition !== "exited" ? (
<Overlay
qaLabel={props.qaLabel && `${props.qaLabel}-overlay`}
onTouchStart={stopTouchEvent}
onTouchCancel={stopTouchEvent}
onTouchEnd={stopTouchEvent}
onTouchMove={stopTouchEvent}
layerOffset={props.layerOffset}
{...(typeof props.onOverlayClick === "function"
? {
onClick: props.onOverlayClick
}
: {
onClick: props.onClose
})}
opening={transition === "enter"}
exiting={transition === "exiting"}
exited={transition === "exited"}
/>
) : null;
const renderTransparentOverlay = () =>
transition !== "exited" ? (
<Overlay
qaLabel={props.qaLabel && `${props.qaLabel}-overlay`}
onTouchStart={stopTouchEvent}
onTouchCancel={stopTouchEvent}
onTouchEnd={stopTouchEvent}
onTouchMove={stopTouchEvent}
{...(typeof props.onOverlayClick === "function"
? {
onClick: props.onOverlayClick
}
: {
onClick: props.onClose
})}
opening={transition === "enter"}
exiting={transition === "exiting"}
exited={transition === "exited"}
isTransparent
/>
) : null;
const renderTopChildren = () => {
if (props.modalTopChildren !== noop) {
return props.modalTopChildren();
}
return null;
};
const renderTitle = () => {
if (props.useModalHeaderV3 && props.hasHeader) {
return (
<ModalHeaderV3
title={props.title}
isTitleCapitalized={props.isTitleCapitalized}
subtitle={props.subtitle}
isTitleCenter={props.isTitleCenter}
subtitleColor={props.subtitleColor}
subtitleFontFamily={props.subtitleFontFamily}
onClose={props.onClose}
onBack={props.onBack}
hasRoundedCorners={!(props.isFullHeight && props.offsetTop === 0)}
hasCloseButton={props.hasCloseButton}
scrollableRef={contentRef}
device={props.device}
className={props.className ? `${props.className}-modal-header` : ""}
/>
);
}
if (props.hasCloseWithoutHeader || (props.hasHeader && props.title)) {
return (
<ModalHeader
title={props.title}
subtitle={props.subtitle}
titleType={props.titleType}
onClose={props.onClose}
onBack={props.onBack}
hasRoundedCorners={props.hasRoundedCorners}
hasCloseWithoutHeader={props.hasCloseWithoutHeader}
hasIcon={props.hasHeaderIcon}
hasCloseButton={props.hasCloseButton}
hasHeaderBorder={props.hasHeaderBorder}
myBetsStandaloneToggle={props.myBetsStandaloneToggle}
scrollableRef={props.scrollableRef || contentRef}
hasBiggerHeader={props.hasBiggerHeader}
device={props.device}
shouldRenderWhiteTitle={props.shouldRenderWhiteTitle}
headerChildren={props.headerChildren}
headerTitleChildren={props.headerTitleChildren}
isTitleCenter={props.isTitleCenter}
/>
);
}
return null;
};
const renderContainer = (transitionState) => {
const modalProps = props.useModalHeaderV3
? {
ref: contentRef,
roundedCorners: props.hasRoundedCorners,
contentRoundedCorners: props.offsetTop > 0 && !props.hasHeader
}
: {
ref: props.setScrollableRef || contentRef,
onScroll: props.onScrollFn,
isContentTransparent: props.isContentTransparent,
isNavigation: props.titleType === "navigation",
roundedCorners:
(props.animation === "fade" ||
props.animation === "bottomFloating") &&
props.hasRoundedCorners
};
const renderChildren =
typeof props.children === "function" && props.children(transitionState);
return (
<Container
onTouchStart={stopTouchEvent}
onTouchCancel={stopTouchEvent}
onTouchEnd={stopTouchEvent}
onTouchMove={stopTouchEvent}
role="presentation"
isFullWidth={props.isFullWidth}
fixedWidth={props.fixedWidth}
minWidth={props.minWidth}
offset={{ top: props.offsetTop, bottom: props.offsetBottom }}
{...(props.allowClickPropagation
? {}
: {
onClick: (e) => {
e.stopPropagation();
}
})}
{...(props.qaLabel ? { qaLabel: props.qaLabel } : {})}
>
{renderTopChildren()}
{renderTitle()}
<Content {...modalProps} data-qa-label="modal-content">
{props.useModalHeaderV3 ? (
<ContentScroll data-qa-label="modal-content-v3">
{renderChildren}
</ContentScroll>
) : (
renderChildren
)}
</Content>
</Container>
);
};
const transitionProps = {
appear: true,
mountOnEnter: true,
unmountOnExit: true,
timeout: 300,
in: props.isOpen
};
const transitionStates = {
onEnter: () => setTransition("enter"),
onEntered: () => props.onOpenAnimationEnd(),
onExiting: () => setTransition("exiting"),
onExited: () => {
setTransition("exited");
props.onCloseAnimationEnd();
}
};
const Transition = Transitions[props.animation];
return (
<Fragment>
{props.hasOverlay && renderOverlay()}
{!props.hasOverlay && renderTransparentOverlay()}
<CSSTransition
{...transitionProps}
{...transitionStates}
classNames={props.animation}
>
{(state) => (
<Transition
type={props.animation}
isFullWidth={props.isFullWidth && !props.isFluidWidth}
isFluidWidth={props.isFluidWidth && !props.isFullWidth}
isFullHeight={props.isFullHeight}
offset={{
top: props.hasVideoOffset
? calcVideoContainerHeight()
: props.offsetTop,
bottom: props.offsetBottom,
left: props.offsetLeft,
right: props.offsetRight
}}
fixIosKeyboard={props.fixIosKeyboard}
device={props.device}
hasContentMaxHeight={props.hasContentMaxHeight}
contentMaxHeight={props.contentMaxHeight}
paddings={props.marginsForMaxHeight}
hasContainerFixedWidth={props.fixedWidth !== "100%"}
>
{renderContainer(state)}
</Transition>
)}
</CSSTransition>
</Fragment>
);
};
Modal.defaultProps = ModalDefaultProps;
export default Modal;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ModalV2/index.jsx
import React from "react";
import { createPortal } from "react-dom";
import { useModalV2Core } from "@tvg/custom-hooks";
import { closeModalWrapper } from "@tvg/utils/modalV2";
import Modal from "./Modal";
import { ModalV2DefaultProps } from "./defaultProps";
const ModalV2 = (props) => {
const {
isOpen,
setIsOpen,
bodyPositionY,
setBodyPositionY,
readyToRender,
element
} = useModalV2Core(
props.isOpen,
props.useFakeInput,
props.isLastModal,
props.device,
props.onOpen
);
if (typeof window === "undefined" || !readyToRender) {
return null;
}
const mixedProps = {
...props,
onClose: () => {
closeModalWrapper(props.onClose, {
useFakeInput: props.useFakeInput,
device: props.device,
isLastModal: props.isLastModal,
setIsOpen,
bodyPositionY,
setBodyPositionY
});
},
isOpen,
bodyPositionY
};
const component = <Modal {...mixedProps} />;
return createPortal(component, element);
};
ModalV2.defaultProps = ModalV2DefaultProps;
export default ModalV2;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/LoginNotifications/styled-components.js
import styled from "styled-components";
import { buildText } from "../Text/index";
import buildColor from "../../_static/ColorPalette";
export const Text = styled(buildText())`
line-height: 1.33;
padding: 24px 30px 40px;
border-bottom: 1px solid ${buildColor("grey", "100")};
display: block;
`;
export const Container = styled.div`
background-color: ${buildColor("white", "100")};
font-size: 12px;
text-align: center;
padding: 16px;
height: auto;
`;
export const RedirectLink = styled.a`
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 40px;
padding: 0 16px;
font-size: 12px;
background-color: ${buildColor("blue_accent", "500")};
color: ${buildColor("white", "100")};
border: none;
font-weight: bold;
text-decoration: none;
text-transform: uppercase;
border-radius: 2px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/LoginNotifications/index.jsx
import React, { PureComponent, Fragment } from "react";
import { bindAll, noop } from "lodash";
import Button from "../Buttons/button";
import { Text, Container, RedirectLink } from "./styled-components";
export default class LoginNotification extends PureComponent {
static defaultProps = {
type: "expired",
targetDomain: "",
redirectMessage: "",
callback: noop
};
constructor(props) {
super(props);
bindAll(this, ["expiredContent", "redirectContent", "getContent"]);
}
getContent() {
const expiredSessionMessage =
"Your session has expired and you were automatically logged out. Please login again.";
const appStoreMessage = `Sorry you are on the wrong app. From your log in details we see you are a ${this.props.targetDomain} account holder. We have an app dedicated just for ${this.props.targetDomain} players. Download it now from the App Store`;
switch (this.props.type) {
case "expired":
return this.expiredContent(expiredSessionMessage, "ok");
case "appStore":
return this.expiredContent(appStoreMessage, "App Store");
case "redirect":
default:
return this.redirectContent(this.props.redirectMessage);
}
}
expiredContent(message, text) {
return (
<Fragment>
<Text data-qa-label="loginNotifications-expiredContentText">
{message}
</Text>
<Button
onClick={this.props.callback}
size="big"
type="primary"
isStretched
data-qa-label="loginNotifications-expiredContentButton"
>
{text}
</Button>
</Fragment>
);
}
redirectContent(message) {
return (
<Fragment>
<Text data-qa-label="loginNotifications-redirectText">{message}</Text>
<RedirectLink
href={`${window.location.protocol}//${this.props.targetDomain}`}
data-qa-label="loginNotifications-redirectButton"
>
Ok
</RedirectLink>
</Fragment>
);
}
render() {
return <Container>{this.getContent()}</Container>;
}
}
webpack://frontend-tpt/../../packages/tvg-lib-utils/mobileUtils.js
import { includes } from "lodash";
import mediator from "@tvg/mediator";
import TvgConfig from "@tvg/conf";
export const isMobile = (product) =>
includes(
[
"ios2",
"androidwrapper",
"iosnative",
"androidnative",
"tvgandroid",
"fdrios",
"fdrandroid",
"fdrandroidgps"
],
product
);
export const isAndroid = (product) =>
includes(
["androidwrapper", "fdrandroid", "tvgandroid", "fdrandroidgps"],
product
);
/* eslint-disable consistent-return */
export const openExternalLink = (link, callback) => {
if (isMobile(TvgConfig().product)) {
mediator.ios.dispatch({
type: "OPEN_EXTERNAL_APP",
payload: { openExternalApp: link }
});
} else if (window) {
// eslint-disable-next-line security/detect-non-literal-fs-filename
const tab = window.open(link, "_blank");
if (tab) {
tab.focus();
}
if (callback) {
callback(tab);
}
}
};
export const isSafari = (allBrowsers = false) => {
if (
typeof window !== "undefined" &&
window.navigator &&
window.navigator.userAgent
) {
const ua = window.navigator.userAgent;
const iOS =
(!!ua.match(/iPad/i) || !ua.match(/iPhone/i)) && !!ua.match(/WebKit/i);
return (
iOS &&
!!ua.match(/Safari/i) &&
(allBrowsers || !ua.match(/CriOS/i)) &&
(allBrowsers || !ua.match(/Chrome/i))
);
}
return false;
};
export const isSafariBrowser = () => {
if (
typeof window !== "undefined" &&
window.navigator &&
window.navigator.userAgent
) {
const ua = window.navigator.userAgent;
// TODO: revisit this!!!
return (
ua.match(/WebKit/i) ||
(ua.match(/Safari/i) && !ua.match(/CriOS/i) && !ua.match(/Chrome/i))
);
}
return false;
};
export default isMobile;
webpack://frontend-tpt/../../packages/tvg-lib-utils/appsflyerUtils.js
import mediator from "@tvg/mediator";
export const AppsFlyerEvents = {
AfPlaceWager: "rac_product_bet_successful",
AfPlaceFirstWager: "rac_product_first_bet_successful",
AfAppLunch: "af_app_launch",
AfLogin: "af_login",
AfBetCost: "af_bet_cost",
AfCompleteRegistration: "af_complete_registration"
};
const APPS_FLYER_TYPE = "APPSFLYER_EVENT";
const APP_FLYER_EMPTY_VALUES = { values: { "": "" } };
const sendToAppsFlyer = (payload) => {
const appsFlyerPayload = {
type: APPS_FLYER_TYPE,
payload: {
appsflyer: {
...APP_FLYER_EMPTY_VALUES,
...payload
}
}
};
if (
window &&
window.webkit &&
window.webkit.messageHandlers &&
window.webkit.messageHandlers.APPSFLYER_EVENT
) {
window.webkit.messageHandlers.APPSFLYER_EVENT.postMessage(appsFlyerPayload);
} else {
mediator.ios.dispatch(appsFlyerPayload);
}
};
export default sendToAppsFlyer;
webpack://frontend-tpt/../../packages/sh-lib-account-actions/src/reducers/modalReducer.js
import { noop } from "lodash";
export const LOGIN_ACTIVE_FLOWS = {
"forgot-credentials": "forgot-credentials",
"recover-email": "recover-email"
};
export const LOGIN_ACTIVE_FLOWS_STATUS = {
failure: "failure",
success: "success"
};
export const initialState = {
loginOpen: false,
loginComponent: null,
loginActiveFlow: null,
loginActiveFlowStatus: null,
contentCardsOpen: false,
callback: noop,
isModalOpen: false,
isErrorModalOpen: false
};
const modalReducer = (state = initialState, action) => {
switch (action.type) {
case "OPEN_LOGIN_MODAL": {
return {
...state,
loginOpen: true,
callback: action.payload.callback,
loginComponent: action.payload.loginComponent,
loginActiveFlow: action.payload.loginActiveFlow || null,
loginActiveFlowStatus:
// this allows us to manually overwrite to null
action.payload.loginActiveFlowStatus === null
? null
: action.payload.loginActiveFlowStatus ||
state.loginActiveFlowStatus,
isModalOpen: true
};
}
case "CLOSE_LOGIN_MODAL": {
return {
...state,
loginOpen: false,
isModalOpen: false
};
}
case "RESET_LOGIN_FLOW": {
return {
...state,
loginActiveFlow: null,
loginActiveFlowStatus: null
};
}
case "RESET_LOGIN_FLOW_STATUS": {
return {
...state,
loginActiveFlowStatus: null
};
}
case "OPEN_SIGNUP": {
return { ...state, isModalOpen: true };
}
case "OPEN_CONTENT_CARDS_MODAL": {
return { ...state, contentCardsOpen: true, isModalOpen: true };
}
case "CLOSE_CONTENT_CARDS_MODAL": {
return { ...state, contentCardsOpen: false, isModalOpen: false };
}
case "OPEN_ERROR_MODAL": {
return {
...state,
isErrorModalOpen: !state.isErrorModalOpen,
isModalOpen: !state.isModalOpen
};
}
default: {
return state;
}
}
};
export default modalReducer;
webpack://frontend-tpt/../../packages/tvg-lib-api/aw/index.ts
import { get } from "lodash";
import tvgConf from "@tvg/conf";
import requester from "@tvg/api/requester";
import {
WalletData,
UserJurisdictionsData,
UsersFanduel,
WalletDataRow
} from "./types";
const { config, getClientId } = tvgConf();
const baseURL = config("externalServices.fanduel");
const clientId = getClientId();
export const getWalletBalances = (authToken: string) =>
requester()({
baseURL,
url: "/account/wallet",
method: "get",
withCredentials: true,
headers: {
"X-Auth-Token": authToken,
Authorization: `Basic ${clientId}`
}
}).then(
(result: { data: { wallet_balances: WalletData } }) =>
get(result, "data.wallet_balances", []) as WalletDataRow[]
);
export const getUserJurisdictions = (
authToken: string,
userId: string,
jurisdiction: string
): Promise<UserJurisdictionsData> =>
requester()({
baseURL,
url: `/users/${userId}/jurisdictions/${jurisdiction}/product/RACING`,
method: "get",
withCredentials: true,
headers: {
"X-Auth-Token": authToken,
Authorization: `Basic ${clientId}`
}
}).then((result: { data: { user_jurisdictions: UserJurisdictionsData } }) =>
get(result, "data.user_jurisdictions")
);
export const getFanduelUserProfile = (
authToken: string
): Promise<UsersFanduel> =>
requester()({
baseURL,
url: `/users/current`,
method: "get",
withCredentials: true,
headers: {
"X-Auth-Token": authToken,
Authorization: `Basic ${clientId}`
}
}) as unknown as Promise<UsersFanduel>;
webpack://frontend-tpt/../../packages/tvg-lib-api/uwt/index.ts
import tvgConf from "@tvg/conf";
import { Limits, PaymentOptionsEnum } from "@tvg/ts-types/ResponsibleGaming";
import { PaymentTypeItem } from "@tvg/wallet/src/types";
import { isFDR } from "@tvg/utils/generalUtils";
import { getAuthTokenCookie } from "@tvg/sh-utils/sessionUtils";
import getProtocol from "../protocolSetter";
import requester from "../requester";
import { serviceResponse } from "../types";
import { getWalletBalances } from "../aw";
const uwtService: string = "service.uwt";
const balanceHeaders = () => ({
"content-type": "application/json",
"x-clientapp": tvgConf().brand,
"x-tvg-context": tvgConf().context(),
"x-requested-with": "XMLHttpRequest"
});
const getPaymentOptions = (accountNumber: string): Promise<serviceResponse> =>
requester()({
url: `${getProtocol()}${tvgConf().config(
uwtService
)}/users/${accountNumber}/payment-options`,
method: "get",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const getAvailablePaymentMethods = (
accountNumber: string
): Promise<
serviceResponse<{
firstDepositDone: boolean;
paymentTypes: PaymentTypeItem[];
}>
> =>
requester()({
url: `${getProtocol()}${tvgConf().config(
uwtService
)}/users/${accountNumber}/available-payment-methods`,
method: "get",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const blockPaymentMethod = (
accountNumber: string,
paymentType: PaymentOptionsEnum
): Promise<serviceResponse> =>
requester()({
url: `${getProtocol()}${tvgConf().config(
uwtService
)}/users/${accountNumber}/payment-options`,
method: "put",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() },
data: {
enablePaymentType: false,
isCustomerRequest: true,
paymentType
}
});
const getPendingWithdrawals = (
accountNumber: string
): Promise<serviceResponse> =>
requester()({
url: `${getProtocol()}${tvgConf().config(
uwtService
)}/users/${accountNumber}/withdrawals/pending`,
method: "get",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const getWithdrawalLimit = (accountNumber: string): Promise<serviceResponse> =>
requester()({
url: `${getProtocol()}${tvgConf().config(
uwtService
)}/users/${accountNumber}/withdrawal/balance`,
method: "get",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const cancelWithdrawal = (
accountNumber: string,
withdrawalId: string
): Promise<serviceResponse> =>
requester()({
url: `${getProtocol()}${tvgConf().config(
uwtService
)}/users/${accountNumber}/withdrawals/${withdrawalId}`,
method: "delete",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const getDepositLimits = (accountNumber: string) =>
requester()({
url: `${getProtocol()}${tvgConf().config(
uwtService
)}/users/${accountNumber}/limits/responsible-gaming`,
method: "get",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const updateDepositLimits = (
accountNumber: string,
limits: Limits
): Promise<serviceResponse> =>
requester()({
url: `${getProtocol()}${tvgConf().config(
uwtService
)}/users/${accountNumber}/limits/responsible-gaming`,
method: "put",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() },
data: limits
});
const getBalance = (
accountId: string,
isPoller: boolean = false,
showPromoFunds: boolean = false
): Promise<serviceResponse<{ balance: { toFixed: Function } }>> => {
const queryString = new URLSearchParams({
isPoller: isPoller.toString(),
showPromoFunds: showPromoFunds.toString()
}).toString();
if (isFDR()) {
// This is wrong, we can't use two struct in the same function.
// @ts-ignore -> We need to refactor this.
return getWalletBalances(getAuthTokenCookie());
}
return requester()({
method: "get",
url: `${getProtocol()}${
tvgConf().config().service.uwt
}/users/${accountId}/balance?${queryString}`,
headers: balanceHeaders(),
withCredentials: true
});
};
const UWT_SERVICE = {
getPendingWithdrawals,
cancelWithdrawal,
getPaymentOptions,
blockPaymentMethod,
getDepositLimits,
updateDepositLimits,
getBalance,
getAvailablePaymentMethods,
getWithdrawalLimit,
balanceHeaders
};
export default UWT_SERVICE;
webpack://frontend-tpt/../../packages/tvg-comp-mobile-login/src/gtmService.js
import mediator from "@tvg/mediator";
export default (data) => {
switch (data.type) {
case "attempt":
mediator.base.dispatch({
type: "LOGIN_MODAL_LOGIN_ATTEMPT"
});
break;
case "success":
mediator.base.dispatch({
type: "LOGIN_MODAL_SUCCESS",
payload: {
accountId: data.accountId,
balance: data.balance
}
});
break;
case "error":
mediator.base.dispatch({
type: "LOGIN_MODAL_LOGIN_ERROR",
payload: {
error: data.error
}
});
break;
case "input-complete":
mediator.base.dispatch({
type: "LOGIN_MODAL_FIELD_COMPLETE",
payload: {
field: data.field
}
});
break;
case "state-selected":
mediator.base.dispatch({
type: "LOGIN_MODAL_SELECT_STATE",
payload: {
state: data.state
}
});
break;
case "login-start":
default:
mediator.base.dispatch({
type: "LOGIN_MODAL_START"
});
break;
}
};
webpack://frontend-tpt/../../packages/tvg-comp-mobile-login/src/components/LoginComponent/index.jsx
import React, { Component, Fragment } from "react";
import { connect } from "react-redux";
import mediator from "@tvg/mediator";
import { noop, bindAll, get, attempt } from "lodash";
import tvgConf from "@tvg/conf";
import { buildRedirectMessage } from "@tvg/login-service/services/helper";
import LoginTemplate from "@tvg/atomic-ui/_templates/Login";
import { TextLink } from "@tvg/atomic-ui/_organism/LoginForm/styled-components";
import Modal from "@tvg/atomic-ui/_templates/ModalV2";
import LoginNotification from "@tvg/atomic-ui/_atom/LoginNotifications";
import { errors } from "@tvg/login-service/services/static";
import { replaceCAPIVariables } from "@tvg/utils/capiUtils";
import { isTvg5 } from "@tvg/utils/generalUtils";
import isMobile from "@tvg/utils/mobileUtils";
import { formatDateToMMDDYYYYhhmm } from "@tvg/formatter/dates";
import sendToAppsFlyer, { AppsFlyerEvents } from "@tvg/utils/appsflyerUtils";
import useFakeInput from "@tvg/utils/useFakeInput";
import queryString from "query-string";
import { LOGIN_ACTIVE_FLOWS } from "@tvg/sh-lib-account-actions/src/reducers/modalReducer";
import uwt from "@tvg/api/uwt";
import { getBalance } from "@urp/store-selectors";
import gtmService from "../../gtmService";
export const redirectIOSApp = (target) => {
mediator.ios.dispatch({
type: "OPEN_EXTERNAL_APP",
payload: { openExternalApp: target }
});
};
export const getCustomerBrand = (targetDomain = "") =>
targetDomain.split("-")[0] === "www" ? "tvg" : targetDomain.split("-")[0];
export const createRedirectAppLink = (redirectUrl) => {
if (redirectUrl.includes("pabets")) {
return "pa://";
}
if (redirectUrl.includes("4njbets")) {
return "nj://";
}
return "tvg://";
};
// adds user query string to be used in credentials recovery
const createPathWithUser = (username) => {
const forgotCredentialsHash = "#forgot-credentials";
const queryParams =
typeof window !== "undefined" ? window.location.search : "";
if (!username) return `${queryParams}${forgotCredentialsHash}`;
const params = queryString.parse(queryParams);
const paramsWithUser = {
user: username,
...params
};
const newQueryParams = queryString.stringify(paramsWithUser);
return `?${newQueryParams}${forgotCredentialsHash}`;
};
const isAccountNumber = (username) => /^\d+$/.test(username);
export class LoginSignup extends Component {
constructor(props) {
super(props);
this.state = {
cmsMsgs: {},
isRedirectModalopen: false,
isLoginError: false,
isProcessing: false,
errorTitle: "",
errorMessage: null,
targetDomain: "",
usernameStatus: null,
username: this.props.initialUsername || "",
passwordStatus: null,
password: "",
stateStatus: null,
state:
this.props.stateAbbr !== "" && this.props.stateAbbr
? this.props.stateAbbr
: "",
isHumanChallengeEnabled: false,
passwordPlaceholder: "Password or PIN",
geopacketUsage: false
};
bindAll(this, [
"updateState",
"updateLoadingHandler",
"tryToLogin",
"getCMSMsgs",
"onBlurHandler",
"validateForm",
"renderRedirectModal",
"enterKeyHandler",
"closeRedirectModal",
"doLogin",
"updatePasswordPlaceholder"
]);
this.getCMSMsgs();
const unsubscribe = () => {
mediator.base.unsubscribe(
"TVG_LOGIN:DO_LOGIN_FORM",
subscriber // eslint-disable-line
);
mediator.base.unsubscribe(
"TVG_LOGIN:TOUCH_ID_ERROR",
errorSubscriber // eslint-disable-line
);
};
const subscriber = (data) => {
this.doLogin(data.payload);
unsubscribe();
};
const errorSubscriber = () => {
unsubscribe();
};
mediator.base.subscribe("TVG_LOGIN:DO_LOGIN_FORM", subscriber);
mediator.base.subscribe("TVG_LOGIN:TOUCH_ID_ERROR", errorSubscriber);
}
componentDidMount() {
if (typeof window !== "undefined") {
window.addEventListener("passedHC", () => {
this.tryToLogin();
this.setState({ isHumanChallengeEnabled: false });
});
window.addEventListener("enableHC", () => {
this.setState({ isHumanChallengeEnabled: true });
});
}
}
componentWillUnmount() {
if (typeof window !== "undefined") {
window.removeEventListener("passedHC", () => {
this.setState({ isHumanChallengeEnabled: false });
});
window.removeEventListener("enableHC", () => {
this.setState({ isHumanChallengeEnabled: true });
});
}
}
onBlurHandler(field) {
if (field !== "state") {
gtmService({
type: "input-complete",
field
});
}
this.updateState(
`${field}Status`,
this.validateInput(field, this.state) ? null : "error"
);
}
// Get the cms messages in this.cmsMsgs
getCMSMsgs() {
tvgConf()
.getMessages(["Login"])
.then((response) =>
this.setState({
cmsMsgs: response
})
)
.catch(() => {
this.setState({
cmsMsgs: {}
});
});
}
changeLink = () => {
if (tvgConf().device !== "desktop" || isTvg5()) {
this.props.closeModal();
this.props.history.push("/registration");
} else {
window.location.assign("/registration");
}
};
validateInput = (field, state) => {
switch (field) {
case "username":
return /^([A-Za-z0-9]+){1,20}/.test(state[field]);
case "password":
if (state[field].length && state[field].length < 21) {
return /^[\\S]*/.test(state[field]);
}
return false;
case "state":
return state[field] !== "";
default:
return false;
}
};
redirectToPRF = (e) => {
mediator.base.dispatch({ type: "LOGIN_MODAL_FORGOT_CREDENTIALS" });
if (tvgConf().device === "desktop") {
e.preventDefault();
e.stopPropagation();
mediator.base.dispatch({
type: "OPEN_LOGIN_FLOW",
payload: {
loginActiveFlow: LOGIN_ACTIVE_FLOWS["forgot-credentials"]
}
});
} else if (tvgConf().device === "tablet") {
this.props.closeModal();
}
};
getMessageNode = (errorMessage) => {
const hyperLinkRegex = /<a href="\/forgot-credentials"[^>]*>([^<]+)<\/a>/;
const matches = errorMessage.match(hyperLinkRegex);
if (matches) {
const [hyperLink, content] = matches;
const matchesIndex = matches.index;
return (
<div>
<span
dangerouslySetInnerHTML={{
__html: errorMessage.substring(0, matchesIndex)
}}
/>
<TextLink
data-qa-label="forgotCredentialsLink"
to={createPathWithUser(this.state.username)}
onClick={this.redirectToPRF}
>
{content}
</TextLink>
<span
dangerouslySetInnerHTML={{
__html: errorMessage.substring(matchesIndex + hyperLink.length)
}}
/>
</div>
);
}
return (
<div
dangerouslySetInnerHTML={{
__html: errorMessage
}}
data-qa-label="messageBox-message"
/>
);
};
doLogin(loginData) {
this.updateLoadingHandler(true);
this.props.triggerLogin(loginData).then((response) => {
this.updateLoadingHandler(false);
if (response.error) {
gtmService({
type: "error",
error: get(response.error, "message")
});
if (get(response, "error.redirectUrl")) {
this.updateLoadingHandler(false);
this.setState({
isRedirectModalopen: true,
targetDomain: get(response, "error.redirectUrl")
});
return;
}
const errorMessage = get(response, "error.message");
const capiTitles = attempt(() => JSON.parse(this.props.errorTitleCapi));
let errorTitle = get(capiTitles, errorMessage, "Login Failed");
let htmlError = get(
// next line has a linting bug saying that we are doing a setState
// eslint-disable-next-line
this.state.cmsMsgs,
errorMessage,
"An error occurred and we could not log you in at this time. Please <a target='_blank' href='https://support.tvg.com/s/'>contact our customer service</a> for assistance."
);
if (errors.ACCOUNT_IN_TIMEOUT === errorMessage) {
const endDate = get(
response,
"error.responsibleGamingExclusion.endDate"
);
htmlError = replaceCAPIVariables(htmlError, {
exclusionTime: formatDateToMMDDYYYYhhmm(endDate)
});
} else if (
errors.ACCOUNT_SUSPENDED === errorMessage ||
errorMessage.ACCOUNT_SELF_EXCLUDE === errorMessage
) {
const motive = get(
response,
"error.responsibleGamingExclusion.type",
""
);
htmlError = replaceCAPIVariables(htmlError, {
motive: motive.toLowerCase()
});
}
if (errors.INVALID_CREDENTIALS === errorMessage) {
const remainingTries = get(response, "error.remainingTries");
if (remainingTries > 0) {
const triesMessageParsed = attempt(() =>
JSON.parse(get(this.state.cmsMsgs, "loginTriesMessage", ""))
);
htmlError = triesMessageParsed[remainingTries];
} else if (remainingTries === 0) {
errorTitle = get(
capiTitles,
"loginAttemptsAccountLocked",
"Login Failed"
);
htmlError = get(
this.state.cmsMsgs,
"loginAttemptsAccountLocked",
""
);
}
}
this.setState({
isLoginError: true,
errorTitle,
errorMessage: this.getMessageNode(htmlError)
});
}
if (response.success) {
const accountId = get(
response.success,
"data.userDetails.accountNumber"
);
uwt
.getBalance(accountId, false)
.then((res) => {
const balance = get(res, "data.balance", undefined);
gtmService({
type: "success",
accountId,
balance:
typeof balance === "number" ? balance.toFixed(2) : balance
});
})
.catch(() => {
gtmService({
type: "success",
accountId,
balance: undefined
});
});
this.props.closeModal();
if (isMobile(tvgConf().product)) {
// Send AppsFlyer login event for iOS app
sendToAppsFlyer({
key: AppsFlyerEvents.AfLogin,
values: {
accountId: get(
response.success,
"data.userDetails.accountNumber",
0
).toString()
}
});
mediator.ios.dispatch({
type: "PUSHWOOSH_EVENTS",
payload: {
pushwooshTags: {
HasLoggedInOnce:
attempt(() => localStorage.getItem("userLoginOnce")) || false,
StateOfRegistration: get(
response.success,
"data.userDetails.homeAddress.state",
""
),
FirstName: get(
response.success,
"data.userDetails.firstName",
""
),
AccountNumber: get(
response.success,
"data.userDetails.accountNumber",
0
)
}
}
});
}
}
});
}
tryToLogin() {
// Hack for iOSApp in tablet when closing amount modal to fix the layout issues with the keyboard
if (tvgConf().product === "ios2" && tvgConf().device === "tablet") {
setTimeout(() => {
useFakeInput();
}, 10);
}
if (this.validateForm()) {
const loginData = {
account: this.state.username,
pin: this.state.password,
stateAbbr: this.state.state,
callback: this.props.callback,
geopacketUsage: this.props.geopacketUsage
};
this.doLogin(loginData);
}
}
closeRedirectModal() {
this.setState({
isRedirectModalopen: false
});
}
enterKeyHandler(e) {
if (e.charCode === 13) {
e.preventDefault();
e.stopPropagation();
const password = document.getElementById("passwordLogin");
const stateSelector = document.getElementById("stateSelector");
switch (get(e, "target.id")) {
case "textLogin":
if (password) {
password.focus();
}
break;
case "passwordLogin":
if (stateSelector) {
stateSelector.focus();
} else {
this.tryToLogin();
}
break;
case "stateSelector":
default:
if (stateSelector) {
stateSelector.blur();
}
this.tryToLogin();
break;
}
}
}
updateLoadingHandler(value) {
this.setState({
isProcessing: value
});
}
updateState(field, value) {
const isFirstTouch = attempt(() => localStorage.getItem("isFirstTouch"));
if (!isFirstTouch) {
attempt(() => localStorage.setItem("isFirstTouch", "true"));
gtmService({
type: "login-start"
});
}
if (field === "state" && value !== null) {
gtmService({
type: "state-selected",
state: value
});
}
const dataToUpdate = {};
dataToUpdate[field] = value;
const newState = { ...this.state, ...dataToUpdate };
this.setState({
...newState
});
this.updatePasswordPlaceholder();
}
updatePasswordPlaceholder() {
if (isAccountNumber(this.state.username)) {
this.setState({
passwordPlaceholder: "Password or PIN"
});
} else {
this.setState({
passwordPlaceholder: "Password"
});
}
}
validateForm() {
const valuesToCheck = ["username", "password", "state"];
const wrongValues = [];
valuesToCheck.forEach(
(item) => this.state[item] === "" && wrongValues.push(item)
);
if (wrongValues.length) {
const newState = {};
wrongValues.forEach((item) => {
newState[`${item}Status`] = "error";
});
this.setState(newState);
return false;
}
return true;
}
isWagerpad =
window !== undefined && window.location.pathname.includes("wagerpad");
renderRedirectModal() {
const { redirectMessage, redirectTitle } = buildRedirectMessage(
this.state.targetDomain,
get(this.state, "cmsMsgs.loginRedirectionMessage", "{}")
);
const isApp = isMobile(tvgConf().product);
const isDeviceMobile = tvgConf().device === "mobile";
const redirectProps = isApp
? {
type: "appStore",
callback: () =>
redirectIOSApp(createRedirectAppLink(this.state.targetDomain)),
targetDomain: redirectTitle
}
: {
type: "redirect",
targetDomain: this.state.targetDomain
};
return (
<Modal
title={redirectTitle}
isOpen={this.state.isRedirectModalopen}
animation="fade"
shouldBeClosable={false}
onClose={this.closeRedirectModal}
isFullWidth={isDeviceMobile}
isFluidWidth={!isDeviceMobile}
isFullHeight={false}
offsetLeft={12}
offsetRight={12}
qaLabel="login-redirectModal"
layerOffset={10000}
>
{() => (
<LoginNotification
redirectMessage={redirectMessage}
targetDomain={this.state.targetDomain}
{...redirectProps}
/>
)}
</Modal>
);
}
render() {
return (
<Fragment>
<LoginTemplate
passwordPlaceholder={this.state.passwordPlaceholder}
mobile={this.props.mobile}
onBlurHandler={this.onBlurHandler}
isProcessing={this.state.isProcessing}
isLoginError={
this.state.isLoginError && !this.state.isHumanChallengeEnabled
}
redirectToPRF={this.redirectToPRF}
errorTitle={this.state.errorTitle}
errorMessage={this.state.errorMessage}
robotMessage={this.props.robotMessage}
usernameStatus={this.state.usernameStatus}
usernameCallback={this.updateState}
username={this.state.username}
passwordStatus={this.state.passwordStatus}
passwordCallback={this.updateState}
password={this.state.password}
selectCallback={this.updateState}
stateSelectorStatus={this.state.stateStatus}
signUpCallback={this.changeLink}
onLoginCallback={this.tryToLogin}
states={tvgConf().getStates()}
noStateSelector={isMobile(tvgConf().product)}
closeModal={this.props.closeModal}
enterKeyHandler={(e) => this.enterKeyHandler(e)}
awareMessage={get(this.state, "cmsMsgs.LoginAware")}
// hasAwareMessageMarginTop={!this.props.initialUsername} FIX FR-1379
isHumanChallengeEnabled={this.state.isHumanChallengeEnabled}
recoverLink={createPathWithUser(this.state.username)}
hasSuccessMessage={this.props.hasSuccessMessage}
successMessage={this.props.successMessage}
device={tvgConf().device}
isWagerpad={this.isWagerpad}
/>
{this.renderRedirectModal()}
</Fragment>
);
}
}
LoginSignup.defaultProps = {
closeDropdownCallback: noop,
hasSuccessMessage: false,
successMessage: {
title: "",
message: ""
},
device: "mobile"
};
export default connect((store) => ({
errorTitleCapi: get(
store,
"capi.messages.loginErrorTitles",
get(store, "header.loginErrorTitles", false)
),
robotMessage: get(
store,
"capi.messages.robotMessage",
get(store, "header.robotMessage", "")
),
userBalance: getBalance(store)
}))(LoginSignup);
webpack://frontend-tpt/../../packages/tvg-lib-login-service/services/helper.js
import TVGConf from "@tvg/conf";
import cookie from "react-cookie";
import { errors } from "./static";
export const tvgHeaders = () => ({
"content-type": "application/json",
"x-tvg-context": TVGConf().context(),
"x-requested-with": "XMLHttpRequest" // we need this some the request works on old request
});
const timeDiff = [];
export const TimeDiffService = {
markStart: (mark) => {
timeDiff[mark] = Date.now();
},
markEnd: (mark) => Date.now() - timeDiff[mark],
getMark: (mark) => timeDiff[mark]
};
export const errorParser = (error) =>
error in errors ? errors[error] : "Fail to login.";
/**
* Builds a redirect title and a redirect message to show on the redirect popup box when a customer is trying to login on a different brand
* @param redirectUrl - the redirect url the user needs to go
* @param capiRedirectMessage - the capi message that has both redirect title and redirect message
* @returns {{redirectTitle: string, redirectMessage: string}}
*/
export const buildRedirectMessage = (redirectUrl, capiRedirectMessage) => {
const capiMessage = JSON.parse(capiRedirectMessage);
const {
loginRedirectionTitle = "<brand> CUSTOMER",
loginRedirectionMessage = "Looks like you’re from <state>! Due to state regulation, we need to redirect you to <brand>"
} = capiMessage;
let brand = "tvg";
if (redirectUrl.indexOf("4njbets") > -1) {
brand = "4njbets";
} else if (
redirectUrl.indexOf("ia-") > -1 ||
redirectUrl.indexOf("ia.tvg") > -1
) {
brand = "iowa";
} else if (redirectUrl.indexOf("pabets") > -1) {
brand = "pabets";
}
const stateMap = {
"4njbets": {
brand: "4NJBets",
state: "New Jersey"
},
iowa: {
brand: "TVG - IA",
state: "Iowa"
},
pabets: {
brand: "PABets",
state: "Pennsylvania"
},
tvg: {
brand: "TVG",
state: "TVG"
}
};
return {
redirectMessage: loginRedirectionMessage
.replace(/<state>/g, stateMap[brand].state)
.replace(/<brand>/g, stateMap[brand].brand),
redirectTitle: loginRedirectionTitle.replace(
/<brand>/g,
stateMap[brand].brand
)
};
};
webpack://frontend-tpt/../../packages/tvg-comp-mobile-login/src/reducers/index.js
import mediator from "@tvg/mediator";
import { isEqual, get } from "lodash";
import { CONSTANTS } from "@tvg/login-service/services/static";
export const initialState = {
hasRequest: false,
forceSessionUpdate: false,
hasRequested: false,
logging: false,
logged: false,
error: null,
wasLogin: false,
userLogin: false,
userLogout: false,
loginPin: false,
geolocateIn: 0,
user: null
};
export const mediatorSessionUpdateMiddleware = (
oldState,
newState,
tvg3token
) => {
if (
!oldState.hasRequest ||
!isEqual(oldState.logged, newState.logged) ||
!isEqual(oldState.user, newState.user) ||
!!newState.forceSessionUpdate
) {
mediator.base.dispatch({
type: CONSTANTS["TVG_LOGIN:USER_SESSION_UPDATE"],
payload: tvg3token ? { ...newState, tvg3token } : newState
});
}
return newState;
};
const reducers = {
[CONSTANTS.SET_SESSION_SUCCESS]: (state, payload) =>
mediatorSessionUpdateMiddleware(
state,
{
...state,
...{
user: payload.data ? payload.data.userDetails : null,
hasRequested: true,
logged: true,
logging: false,
wasLogin: payload.fromLogin,
userLogin: payload.userLogin,
loginPin: payload.loginPin,
geolocateIn: get(payload.data, "geoDetails.geolocateIn", 0),
error: null
}
},
get(payload, "data.session.tvg3token")
),
[CONSTANTS.SET_SESSION_ERROR]: (state, payload) =>
mediatorSessionUpdateMiddleware(state, {
...state,
...{
user: null,
hasRequested: true,
logged: false,
logging: false,
wasLogin: payload.fromLogin,
userLogin: payload.userLogin,
loginPin: payload.loginPin,
error: payload.message
}
}),
[CONSTANTS.SET_USER]: (state, payload) =>
mediatorSessionUpdateMiddleware(state, {
...state,
...{
user: payload.user,
hasRequested: true,
forceSessionUpdate: payload.forceSessionUpdate || false,
logged: true,
logging: false,
wasLogin: payload.fromLogin,
userLogin: payload.userLogin,
geolocateIn: get(payload.data, "geoDetails.geolocateIn", 1),
error: null
}
}),
[CONSTANTS.CLEAR_SESSION]: (state, payload) =>
mediatorSessionUpdateMiddleware(state, {
...initialState,
hasRequested: true,
userLogout: payload.userLogout
})
};
export default (state = initialState, action) => {
const validAction = action || { type: "" };
return validAction.type && reducers[validAction.type]
? reducers[validAction.type](state, validAction.payload)
: state;
};
webpack://frontend-tpt/../../packages/tvg-comp-mobile-login/src/index.jsx
import mediator from "@tvg/mediator";
import { createStore, applyMiddleware } from "redux";
import React from "react";
import { bindAll, get, noop } from "lodash";
import LoginService from "@tvg/login-service";
import { CONSTANTS } from "@tvg/login-service/services/static";
import { isFDR } from "@tvg/utils/generalUtils";
import tvgConf from "@tvg/conf";
import { formatDateToMMDDYYYYhhmm } from "@tvg/formatter/dates";
import Login from "./components/LoginComponent";
import reducers from "./reducers";
export class TVGLogin {
store;
tvgConf;
constructor() {
this.tvgConf = tvgConf();
this.store = createStore(reducers, applyMiddleware());
bindAll(this, [
"triggerLogin",
"triggerLogout",
"validateSession",
"watchSession",
"getLoginModal"
]);
// can keep it to validate session from TP tool
mediator.base.subscribe(CONSTANTS["TVG_LOGIN:DO_LOGIN"], (data) =>
this.triggerLogin(data.payload || {})
);
mediator.base.subscribe(CONSTANTS["TVG_LOGIN:DO_LOGOUT"], (data) =>
this.triggerLogout(data.payload || {})
);
mediator.base.subscribe(CONSTANTS["TVG_LOGIN:VALIDATE_SESSION"], () =>
this.validateSession()
);
this.watchSession();
return this;
}
showRGException = (type, endDate) => {
mediator.base.dispatch({
type: "TVG_LOGIN:RG_EXCEPTION",
payload: {
type,
endDate
}
});
};
triggerLogin(payload) {
return LoginService.doLogin(payload).then((response) => {
const type = response.error
? CONSTANTS.SET_SESSION_ERROR
: CONSTANTS.SET_SESSION_SUCCESS;
if (
type === CONSTANTS.SET_SESSION_SUCCESS &&
typeof window !== "undefined"
) {
window._pxParam5 = get(
response,
"success.data.userDetails.accountNumber"
);
mediator.base.dispatch({
type: "TVG_LOGIN:LOGIN_SUCCESS",
userData: {
...get(response, "success.data.userDetails"),
currentLocationByState: payload.stateAbbr
}
});
}
const loginCheck = {
userLogin: !payload.notFromLogin,
loginPin: !!Number(payload.pin)
};
const RGException = get(response, "error.responsibleGamingExclusion", {});
this.store.dispatch({
type,
payload: {
...loginCheck,
...(response.error || response.success)
}
});
if (RGException.type) {
this.showRGException(
RGException.type,
formatDateToMMDDYYYYhhmm(RGException.endDate)
);
}
return response;
});
}
triggerLogout(payload) {
return LoginService.doLogout(payload).then((response) => {
const type = response.success ? CONSTANTS.CLEAR_SESSION : null;
if (type) {
this.store.dispatch({
type,
payload: {
userLogout: true,
...(response.error || response.success)
}
});
}
return response;
});
}
watchSession() {
if (typeof window !== "undefined" && !isFDR()) {
this.validateSession();
return setInterval(() => this.validateSession(), 60000);
}
return true;
}
validateSession(logged = this.store.getState().logged) {
return (
!logged &&
LoginService.validateSession().then((response) => {
if (response.success) {
this.store.dispatch({
type: CONSTANTS.SET_USER,
payload: get(response, "success.data", {})
});
} else {
this.store.dispatch({
type: CONSTANTS.CLEAR_SESSION,
payload: { userLogout: false }
});
}
})
);
}
getLoginModal(payload, closeModal = noop, history) {
return (
<Login
mobile={payload.mobile}
callback={payload.callback}
geopacketUsage={payload.geopacketUsage}
triggerLogin={this.triggerLogin}
stateAbbr={payload.stateAbbr}
closeModal={closeModal}
history={history}
hasSuccessMessage={payload.hasSuccessMessage}
successMessage={payload.successMessage}
initialUsername={
!payload.user && payload.successMessage
? payload.successMessage.user
: payload.user
}
/>
);
}
}
const instance = new TVGLogin();
export default instance;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/BaseComponents/Containers/index.js
import styled, { css } from "styled-components";
import { isTvg5 } from "@tvg/utils/generalUtils";
import { generateTransition, cubic, easeInOut } from "../../Transitions";
import buildColor from "../../ColorPalette";
const checkifExpandedMargin = (quickLinksExpanded) =>
quickLinksExpanded ? "144px" : "48px";
const getFooterSize = (props) => {
const { isFooterVisible, device, hasJoinBar, hasBettingError } = props;
let defaultSize = "48px";
if (isFooterVisible || device === "tablet") {
defaultSize = hasJoinBar ? "114px" : "48px";
} else if (!isFooterVisible && device === "mobile") {
defaultSize = hasBettingError ? "172px" : "86px";
}
return defaultSize;
};
const MainSection = styled.section`
z-index: 10;
display: flex;
align-items: stretch;
${(props) => {
const footerSize = getFooterSize(props);
return props.device === "mobile" || props.device === "tablet"
? css`
position: relative;
will-change: padding;
transition: ${generateTransition(easeInOut, "padding", "200ms")};
${(props.isFooterVisible || props.device === "tablet") &&
css`
padding-bottom: ${footerSize};
padding-bottom: calc(
${footerSize} + constant(safe-area-inset-bottom)
);
padding-bottom: calc(${footerSize} + env(safe-area-inset-bottom));
min-height: calc(
100vh - ${props.device === "mobile" ? footerSize : "56px"}
);
top: ${props.device === "tablet"
? (!props.isHeaderVisible && "0") || "56px"
: "0"};
`};
${!props.isFooterVisible &&
!props.isHeaderVisible &&
props.device === "tablet" &&
"padding-bottom: 0; min-height: 100vh;"};
${!props.isFooterVisible &&
props.device === "mobile" &&
css`
padding-bottom: ${props.isFullScreen ? 0 : footerSize};
padding-bottom: calc(
${props.isFullScreen ? 0 : footerSize} +
constant(safe-area-inset-bottom)
);
padding-bottom: calc(
${props.isFullScreen ? 0 : footerSize} +
env(safe-area-inset-bottom)
);
min-height: calc(
${props.product && props.product.includes("fdrios")
? "100vh"
: "100%"} - ${props.isHeaderVisible ? "48px" : "0"}
);
`};
`
: css`
position: absolute;
top: 56px;
left: 56px;
right: 0;
bottom: 0;
`;
}};
& > div {
width: 100%;
display: flex;
align-items: stretch;
justify-content: center;
}
`;
const Header = styled.header`
z-index: 20;
top: 0;
left: 0;
right: 0;
width: 100%;
${(props) =>
props.device === "mobile"
? css`
position: sticky;
${!props.hasDescription &&
css`
height: ${props.headerHeight};
`};
${!props.isVisible &&
css`
display: none;
`};
`
: css`
position: fixed;
height: ${props.headerHeight};
${!props.isVisible &&
css`
display: none;
`};
`};
&.logo-highlighted {
padding-top: 0;
background-color: ${buildColor("white", "100")};
${(props) =>
props.device === "mobile"
? css`
position: fixed;
`
: css`
position: fixed;
background-color: ${buildColor("blue", "100")};
top: 120px;
@media screen and (orientation: landscape) {
top: 60px;
}
`};
}
`;
const Footer = styled.footer`
position: fixed;
z-index: 20;
${(props) =>
props.device === "mobile" || props.device === "tablet"
? css`
left: 0;
bottom: 0;
right: 0;
width: 100%;
min-height: 48px;
will-change: transform, opacity;
transition: ${generateTransition(cubic, "transform")},
${generateTransition(easeInOut, "opacity")};
${!props.isVisible && props.device === "mobile"
? css`
transform: translate3d(0, 48px, 0);
display: none;
`
: css`
transform: translate3d(0);
opacity: 1;
${!props.isVisible &&
css`
display: none;
`};
`};
`
: css`
width: 56px;
top: 56px;
bottom: 0;
left: 0;
display: flex;
align-items: stretch;
&::before {
content: "";
position: absolute;
z-index: 0;
top: 0;
left: 0;
right: 0;
width: 56px;
height: 48px;
background-image: linear-gradient(
to top,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.12)
);
}
`};
`;
export const Page = styled.div`
display: flex;
flex-direction: column;
width: 100%;
position: relative;
background-color: ${({ noBackground, rgBackground }) => {
if (noBackground) {
return "transparent";
}
if (rgBackground) {
return buildColor("blue", "000");
}
return buildColor("blue", "000");
}};
${(props) =>
props.hasMarginTop &&
css`
margin-top: 56px;
`}
${(props) =>
props.expandedMarginTop &&
css`
margin-top: 152px;
`}
${(props) =>
props.centerItems &&
css`
align-items: center;
`};
${(props) =>
props.alignment === "center" &&
css`
@media (min-width: 486px) {
max-width: 414px;
padding-top: ${props.topGap && "8px"};
}
@media (min-width: 1200px) {
max-width: 485px;
}
@media (min-width: 1366px) {
max-width: 552px;
}
`};
${(props) =>
props.isFixed &&
css`
position: fixed;
bottom: 48px;
bottom: calc(48px + constant(safe-area-inset-bottom));
bottom: calc(48px + env(safe-area-inset-bottom));
top: ${props.device === "tablet" ? "56px" : "48px"};
left: 0;
`};
${(props) =>
props.isFullHeight &&
css`
height: 100vh;
`};
`;
const Tracks = styled.div`
${(props) =>
props.loading === "true" &&
css`
height: 0;
overflow: hidden;
`};
${(props) =>
props.device === "tablet" &&
css`
padding-top: 56px;
`};
& > section:not(:first-of-type) {
margin-top: 8px;
}
`;
const Banner = styled.img`
width: 100%;
height: auto;
${(props) =>
props.device !== "mobile" &&
css`
margin-bottom: 8px;
border-radius: 2px;
`};
`;
const LoadingAppContainer = styled.div.attrs({
"data-qa-label": "loading-app-container"
})`
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
`;
const MainTool = styled.section`
display: flex;
flex-direction: column;
width: 100%;
max-width: 600px;
margin: 0 auto;
z-index: 0;
/* stylelint-disable */
${(props) =>
props.isBetting
? css`
min-height: calc(100vh - 85px);
padding-bottom: 85px;
`
: css`
min-height: calc(100vh - 48px);
padding-bottom: 0;
`} /* stylelint-enable */
&::before {
content: "";
position: fixed;
z-index: 0;
top: 48px;
left: 0;
right: 0;
height: 48px;
background-image: linear-gradient(
to top,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.12)
);
}
`;
const WagerRewardsContainer = styled.div`
width: 100%;
display: flex;
flex-grow: 1;
flex-direction: column;
padding: ${(props) =>
props.isTablet
? `16px 16px ${props.isFixed ? "120px" : "16px"} 16px`
: "0"};
${(props) =>
props.isMobile &&
css`
padding-top: 48px;
`}
${(props) =>
props.isTablet &&
css`
margin-top: 48px;
`}
position: ${(props) => (props.isFixed ? "fixed" : "inherit")};
`;
export const FullScreenPage = styled.div`
position: absolute;
display: flex;
flex-direction: column;
width: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 20;
${({ allowOverflowY }) =>
allowOverflowY &&
css`
overflow-y: auto;
`}
`;
const GridContainer = styled.div`
width: 100%;
min-height: calc(100vh - 239px);
display: flex;
`;
const HomeGridContainer = styled.div`
display: flex;
flex-flow: row wrap;
align-content: flex-start;
width: 100%;
${({ device }) =>
device === "desktop" &&
css`
background-color: ${buildColor("blue", "000")};
`}
${({ useStoryblokStyle }) =>
useStoryblokStyle &&
css`
&
> .section-wrapper-visible:nth-last-child(
1 of .section-wrapper-visible
) {
margin-bottom: 0;
}
`}
`;
const HomeFullRow = styled.div`
width: 100%;
flex-grow: 1;
margin-bottom: ${(props) =>
props.hasMarginBottom
? `${props.device === "desktop" ? "12px" : "8px"}`
: 0};
&:empty {
display: none;
}
&:first-of-type {
margin-top: ${({ hasMarginTopFixed, quickLinksExpanded }) =>
hasMarginTopFixed ? checkifExpandedMargin(quickLinksExpanded) : 0};
}
`;
const HomeLeftColumn = styled.div`
width: ${isTvg5() ? "70%" : "686px"};
padding: 12px 12px 0;
&:empty {
display: none;
}
`;
const HomeRightColumn = styled.div`
width: ${isTvg5() ? "30%" : "337px"};
padding: 12px 12px 0 0;
&:empty {
display: none;
}
& > section,
& > div {
margin-bottom: 12px;
}
`;
const SeoFooterRow = styled.div`
width: 100%;
flex-grow: 1;
margin-top: 8px;
&:empty {
display: none;
}
`;
const GridWrapper = styled.div`
display: flex;
flex-direction: row;
`;
export default {
MainSection,
Header,
Footer,
Page,
Tracks,
Banner,
LoadingAppContainer,
MainTool,
WagerRewardsContainer,
FullScreenPage,
GridContainer,
HomeGridContainer,
HomeFullRow,
HomeLeftColumn,
HomeRightColumn,
SeoFooterRow,
GridWrapper
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/BaseComponents/ProgramPage/index.js
import styled, { css } from "styled-components";
const Grid = styled.div`
display: flex;
align-items: stretch;
flex-wrap: nowrap;
position: absolute;
overflow: hidden;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
padding: 8px 8px 0;
${(props) =>
props.isFixed
? css`
position: fixed;
padding-bottom: 48px;
padding-top: 64px;
`
: ""}
`;
const Column = styled.div`
flex-grow: 1;
position: relative;
${(props) =>
props.side === "left"
? css`
@media (min-width: 720px) {
min-width: 320px;
}
max-width: 60%;
overflow: hidden;
border-right: 8px solid transparent;
display: flex;
flex-direction: column;
& > section {
margin-top: 8px;
}
`
: css`
flex-shrink: 0;
min-width: 320px;
max-width: 40%;
border-left: 8px solid transparent;
display: flex;
flex-direction: column;
overflow: auto;
`};
`;
const ColumnContentContainer = styled.div`
width: 100%;
height: auto;
overflow: scroll;
margin-top: 8px;
`;
export default {
Grid,
Column,
ColumnContentContainer
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/SpinningWheel/styled-components.js
import styled, { keyframes } from "styled-components";
import Icon from "../../_static/Icons";
const rotate = keyframes`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`;
const SpinningWheelIcon = styled(Icon)`
animation: ${rotate} 2s linear infinite;
`;
export default SpinningWheelIcon;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/SpinningWheel/index.jsx
import React from "react";
import SpinningWheelIcon from "./styled-components";
import { spinningWheel } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
const SpinningWheel = (props) => (
<SpinningWheelIcon
qaLabel={props.qaLabel}
icon={spinningWheel}
size={props.size}
color={props.color}
/>
);
SpinningWheel.defaultProps = {
qaLabel: "spinningWheel",
size: 25,
color: buildColor("white", "100")
};
export default SpinningWheel;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/SvgImages/CountryIcon.jsx
import React from "react";
const CountryIcon = () => (
<svg
width="124"
height="82"
viewBox="0 0 124 82"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g filter="url(#filter0_d)">
<path
d="M86.3223 18.7519C86.5134 19.094 86.2076 19.8352 85.9401 20.5194C85.6917 21.1846 86.2458 21.8878 86.9529 21.8117C87.7364 21.7167 88.5199 22.0588 88.9594 22.705L90.5073 24.9476C90.641 25.1377 90.6793 25.3847 90.6219 25.5938L90.2015 27.2282C90.0678 27.7034 90.4691 28.1595 90.9659 28.1025C91.5774 28.0264 92.1698 27.7794 92.6476 27.3993L95.9917 24.8146C96.0108 24.8146 96.0108 24.7956 96.0299 24.7956L100.463 20.7094C100.502 20.6714 100.521 20.6334 100.559 20.5954L102.393 17.2125C102.508 17.0224 102.68 16.8704 102.909 16.8134L108.489 15.369C108.642 15.331 108.757 15.236 108.795 15.0839L111.184 8.37508C111.318 8.03298 111.662 7.80492 112.025 7.84293L115.044 8.14702C115.312 8.16602 115.56 8.33707 115.675 8.56513L118.407 13.7726C118.579 14.0956 118.503 14.4757 118.254 14.7228L113.936 18.7899C113.84 18.8849 113.783 19.018 113.802 19.151L114.184 23.5792C114.203 23.8453 114.088 24.1114 113.878 24.2824L109.407 27.7034C109.311 27.7794 109.235 27.8934 109.235 28.0264L108.967 31.4284C108.948 31.6944 108.795 31.9225 108.585 32.0555L106.846 33.1198C106.731 33.1769 106.674 33.2909 106.636 33.4049L105.814 37.415C105.795 37.51 105.814 37.6241 105.852 37.7001L108.088 41.9953C108.241 42.2803 108.203 42.6224 107.993 42.8695L104.113 47.5638L104.094 47.5828L97.96 55.9071C97.8645 56.0401 97.8454 56.1921 97.9027 56.3442L100.635 62.7679C100.654 62.8059 100.674 62.863 100.674 62.901L102.451 70.9592C102.508 71.2633 102.413 71.5673 102.164 71.7574C102.011 71.8714 101.82 71.9284 101.629 71.9284H98.1893C97.9218 71.9284 97.6543 71.7954 97.5205 71.5673L93.947 66.0748C93.8897 65.9988 93.8706 65.9228 93.8323 65.8278L93.2208 63.3761C93.1826 63.205 93.0489 63.091 92.8769 63.053L88.4626 62.1027C88.4434 62.1027 88.4434 62.1027 88.4243 62.1027L82.5195 61.3805C82.4239 61.3615 82.3284 61.3806 82.2328 61.4376L78.8313 63.4521C78.7931 63.4711 78.7549 63.4901 78.7167 63.5091L75.1241 64.8585C75.0094 64.8965 74.8948 64.9155 74.7801 64.9155L66.9834 64.3074C66.8687 64.3074 66.7732 64.3264 66.6776 64.3834L61.3461 68.2414C61.2314 68.3174 61.155 68.4505 61.155 68.6025L61.1741 73.1828C61.1741 73.4488 61.0403 73.6959 60.8301 73.848C60.6964 73.943 60.5244 74 60.3715 74C60.2759 74 60.1804 73.981 60.0848 73.943L55.3457 72.1755C55.1546 72.0995 55.0017 71.9664 54.9062 71.7764L51.7531 65.3716C51.7149 65.2766 51.6384 65.2006 51.5429 65.1626L48.2178 63.6992C48.0649 63.6232 47.8738 63.6612 47.7401 63.7752L46.3642 64.9535C46.1922 65.1056 45.9629 65.1626 45.7336 65.1436C45.5042 65.1056 45.3132 64.9915 45.1794 64.8015L42.0836 60.4113C42.0454 60.3543 41.9881 60.3163 41.9308 60.2782L35.7966 56.9333C35.7393 56.8953 35.6628 56.8763 35.5864 56.8763H29.0891C28.9362 56.8763 28.8025 56.8383 28.6687 56.7623L20.9484 52.011C20.9102 51.992 20.8529 51.954 20.7956 51.954L15.6169 50.9467C15.4449 50.9087 15.2729 50.8137 15.1582 50.6806L9.73113 44.4279C9.65469 44.3519 9.61647 44.2569 9.57825 44.1618L7.41887 37.8521C7.39976 37.8141 7.39976 37.7761 7.38065 37.7381L6.34874 31.8845C6.34874 31.8655 6.34874 31.8655 6.34874 31.8465L5.50792 25.8789C5.48881 25.7648 5.50792 25.6508 5.52702 25.5368L7.03668 20.5194C7.05579 20.4814 7.05579 20.4624 7.0749 20.4244L11.0497 10.3136C11.0688 10.2566 11.0879 10.1806 11.0879 10.1236L10.763 5.10618C10.7439 4.82111 10.8777 4.53603 11.1261 4.38399C11.3746 4.23195 11.6803 4.21294 11.9478 4.34598L14.4703 5.67634C14.6996 5.79037 14.9863 5.69535 15.1009 5.44828L15.5022 4.49802C15.6551 4.13692 16.0564 3.92786 16.4386 4.02289L26.2227 6.49356C26.2418 6.49356 26.2418 6.49356 26.2609 6.49356L37.5738 8.43209H37.5929L50.7212 9.95251C50.7403 9.95251 50.7403 9.95251 50.7594 9.95251L64.4609 10.3896C64.5565 10.3896 64.652 10.4086 64.7476 10.4466L67.1172 11.4349C67.1745 11.4539 67.2318 11.4729 67.2892 11.4729L69.3721 11.5109C69.4676 11.5109 69.5632 11.5299 69.6396 11.5679L72.0283 12.4612C72.0665 12.4802 72.1239 12.4802 72.1621 12.4802L74.8374 12.5752C75.1241 12.5942 75.3725 12.7463 75.5063 12.9743C75.64 13.2214 75.64 13.5065 75.5063 13.7535L75.3343 14.0766C75.1432 14.4377 75.5063 14.8558 75.8885 14.7038L77.9714 13.8866C78.2963 13.7726 78.6402 13.8486 78.8696 14.1146L80.1308 15.559C80.2454 15.6921 80.4174 15.7491 80.5894 15.6921L83.5514 14.8749C83.7807 14.8178 84.0291 14.8558 84.2202 14.9889L86.3223 18.7519Z"
fill="#D6E3F0"
/>
<path
d="M86.3223 18.7519C86.5134 19.094 86.2076 19.8352 85.9401 20.5194C85.6917 21.1846 86.2458 21.8878 86.9529 21.8117C87.7364 21.7167 88.5199 22.0588 88.9594 22.705L90.5073 24.9476C90.641 25.1377 90.6793 25.3847 90.6219 25.5938L90.2015 27.2282C90.0678 27.7034 90.4691 28.1595 90.9659 28.1025C91.5774 28.0264 92.1698 27.7794 92.6476 27.3993L95.9917 24.8146C96.0108 24.8146 96.0108 24.7956 96.0299 24.7956L100.463 20.7094C100.502 20.6714 100.521 20.6334 100.559 20.5954L102.393 17.2125C102.508 17.0224 102.68 16.8704 102.909 16.8134L108.489 15.369C108.642 15.331 108.757 15.236 108.795 15.0839L111.184 8.37508C111.318 8.03298 111.662 7.80492 112.025 7.84293L115.044 8.14702C115.312 8.16602 115.56 8.33707 115.675 8.56513L118.407 13.7726C118.579 14.0956 118.503 14.4757 118.254 14.7228L113.936 18.7899C113.84 18.8849 113.783 19.018 113.802 19.151L114.184 23.5792C114.203 23.8453 114.088 24.1114 113.878 24.2824L109.407 27.7034C109.311 27.7794 109.235 27.8934 109.235 28.0264L108.967 31.4284C108.948 31.6944 108.795 31.9225 108.585 32.0555L106.846 33.1198C106.731 33.1769 106.674 33.2909 106.636 33.4049L105.814 37.415C105.795 37.51 105.814 37.6241 105.852 37.7001L108.088 41.9953C108.241 42.2803 108.203 42.6224 107.993 42.8695L104.113 47.5638L104.094 47.5828L97.96 55.9071C97.8645 56.0401 97.8454 56.1921 97.9027 56.3442L100.635 62.7679C100.654 62.8059 100.674 62.863 100.674 62.901L102.451 70.9592C102.508 71.2633 102.413 71.5673 102.164 71.7574C102.011 71.8714 101.82 71.9284 101.629 71.9284H98.1893C97.9218 71.9284 97.6543 71.7954 97.5205 71.5673L93.947 66.0748C93.8897 65.9988 93.8706 65.9228 93.8323 65.8278L93.2208 63.3761C93.1826 63.205 93.0489 63.091 92.8769 63.053L88.4626 62.1027C88.4434 62.1027 88.4434 62.1027 88.4243 62.1027L82.5195 61.3805C82.4239 61.3615 82.3284 61.3806 82.2328 61.4376L78.8313 63.4521C78.7931 63.4711 78.7549 63.4901 78.7167 63.5091L75.1241 64.8585C75.0094 64.8965 74.8948 64.9155 74.7801 64.9155L66.9834 64.3074C66.8687 64.3074 66.7732 64.3264 66.6776 64.3834L61.3461 68.2414C61.2314 68.3174 61.155 68.4505 61.155 68.6025L61.1741 73.1828C61.1741 73.4488 61.0403 73.6959 60.8301 73.848C60.6964 73.943 60.5244 74 60.3715 74C60.2759 74 60.1804 73.981 60.0848 73.943L55.3457 72.1755C55.1546 72.0995 55.0017 71.9664 54.9062 71.7764L51.7531 65.3716C51.7149 65.2766 51.6384 65.2006 51.5429 65.1626L48.2178 63.6992C48.0649 63.6232 47.8738 63.6612 47.7401 63.7752L46.3642 64.9535C46.1922 65.1056 45.9629 65.1626 45.7336 65.1436C45.5042 65.1056 45.3132 64.9915 45.1794 64.8015L42.0836 60.4113C42.0454 60.3543 41.9881 60.3163 41.9308 60.2782L35.7966 56.9333C35.7393 56.8953 35.6628 56.8763 35.5864 56.8763H29.0891C28.9362 56.8763 28.8025 56.8383 28.6687 56.7623L20.9484 52.011C20.9102 51.992 20.8529 51.954 20.7956 51.954L15.6169 50.9467C15.4449 50.9087 15.2729 50.8137 15.1582 50.6806L9.73113 44.4279C9.65469 44.3519 9.61647 44.2569 9.57825 44.1618L7.41887 37.8521C7.39976 37.8141 7.39976 37.7761 7.38065 37.7381L6.34874 31.8845C6.34874 31.8655 6.34874 31.8655 6.34874 31.8465L5.50792 25.8789C5.48881 25.7648 5.50792 25.6508 5.52702 25.5368L7.03668 20.5194C7.05579 20.4814 7.05579 20.4624 7.0749 20.4244L11.0497 10.3136C11.0688 10.2566 11.0879 10.1806 11.0879 10.1236L10.763 5.10618C10.7439 4.82111 10.8777 4.53603 11.1261 4.38399C11.3746 4.23195 11.6803 4.21294 11.9478 4.34598L14.4703 5.67634C14.6996 5.79037 14.9863 5.69535 15.1009 5.44828L15.5022 4.49802C15.6551 4.13692 16.0564 3.92786 16.4386 4.02289L26.2227 6.49356C26.2418 6.49356 26.2418 6.49356 26.2609 6.49356L37.5738 8.43209H37.5929L50.7212 9.95251C50.7403 9.95251 50.7403 9.95251 50.7594 9.95251L64.4609 10.3896C64.5565 10.3896 64.652 10.4086 64.7476 10.4466L67.1172 11.4349C67.1745 11.4539 67.2318 11.4729 67.2892 11.4729L69.3721 11.5109C69.4676 11.5109 69.5632 11.5299 69.6396 11.5679L72.0283 12.4612C72.0665 12.4802 72.1239 12.4802 72.1621 12.4802L74.8374 12.5752C75.1241 12.5942 75.3725 12.7463 75.5063 12.9743C75.64 13.2214 75.64 13.5065 75.5063 13.7535L75.3343 14.0766C75.1432 14.4377 75.5063 14.8558 75.8885 14.7038L77.9714 13.8866C78.2963 13.7726 78.6402 13.8486 78.8696 14.1146L80.1308 15.559C80.2454 15.6921 80.4174 15.7491 80.5894 15.6921L83.5514 14.8749C83.7807 14.8178 84.0291 14.8558 84.2202 14.9889L86.3223 18.7519Z"
stroke="#92B0CE"
strokeWidth="2.5"
strokeLinejoin="round"
/>
</g>
<defs>
<filter
id="filter0_d"
x="0.250488"
y="0.749451"
width="123.5"
height="80.5006"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
/>
<feOffset dy="2" />
<feGaussianBlur stdDeviation="2" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0.0666667 0 0 0 0 0.168627 0 0 0 0 0.266667 0 0 0 0.18 0"
/>
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow"
/>
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow"
result="shape"
/>
</filter>
</defs>
</svg>
);
export default CountryIcon;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/SvgImages/emailTvg.jsx
import React from "react";
const EmailSVG = () => (
<svg
width="127"
height="96"
viewBox="0 0 127 96"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0)">
<g filter="url(#filter0_d)">
<path
d="M107.234 21.6406H1.76562V93.3594H107.234V21.6406Z"
fill="#D6E3F0"
/>
<path
d="M2.1874 22.0624L54.5 65.9375L106.812 22.0624M1.76562 21.6406H107.234V93.3594H1.76562V21.6406Z"
stroke="#92B0CE"
strokeWidth="3.5"
strokeLinejoin="round"
/>
</g>
<g filter="url(#filter1_d)">
<path
d="M125.079 20.5072C125.079 30.768 116.761 39.0861 106.5 39.0861C96.239 39.0861 87.9209 30.768 87.9209 20.5072C87.9209 10.2463 96.239 1.92822 106.5 1.92822C116.761 1.92822 125.079 10.2463 125.079 20.5072Z"
fill="#FFE099"
/>
<path
d="M106.5 23.0625V10.25M106.5 30.75V26.9063M125.079 20.5072C125.079 30.768 116.761 39.0861 106.5 39.0861C96.239 39.0861 87.9209 30.768 87.9209 20.5072C87.9209 10.2463 96.239 1.92822 106.5 1.92822C116.761 1.92822 125.079 10.2463 125.079 20.5072Z"
stroke="#CA9008"
strokeWidth="3"
/>
</g>
</g>
<defs>
<filter
id="filter0_d"
x="-3.98438"
y="17.8906"
width="116.969"
height="83.2187"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
/>
<feOffset dy="2" />
<feGaussianBlur stdDeviation="2" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0.0666667 0 0 0 0 0.168627 0 0 0 0 0.266667 0 0 0 0.18 0"
/>
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow"
/>
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow"
result="shape"
/>
</filter>
<filter
id="filter1_d"
x="82"
y="-2"
width="49"
height="49"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
/>
<feOffset dy="2" />
<feGaussianBlur stdDeviation="2" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0.0666667 0 0 0 0 0.168627 0 0 0 0 0.266667 0 0 0 0.18 0"
/>
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow"
/>
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow"
result="shape"
/>
</filter>
<clipPath id="clip0">
<rect width="127" height="96" fill="white" />
</clipPath>
</defs>
</svg>
);
export default EmailSVG;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Logos/index.jsx
import React from "react";
import styled from "styled-components";
const SVG = styled.svg.attrs(({ height, viewBox }) => ({
height,
viewBox
}))`
display: inline-block;
width: auto;
height: ${(props) => props.height}px;
`;
export const LogoTVGPoweredFanduel = (height, className) => (
<svg
data-qa-label="logo"
fill="none"
className={className}
viewBox="0 0 112 34"
height={height}
>
<g clipPath="url(#clip0_210_29690)">
<path
fillRule="evenodd"
clipRule="evenodd"
d="M4.82326 0L0 17.9984L29.5005 18L34.3246 0.002389L4.82326 0Z"
fill="#38AB4F"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M24.3221 1.99219L24.5486 3.06642L24.4334 3.0919C12.3709 5.78506 5.49857 15.8028 5.43151 15.9039L5.36128 16.0074L4.43814 15.3082L4.5052 15.2135C12.4474 4.03634 24.0941 2.02961 24.2109 2.0105L24.3221 1.99219ZM21.9591 10.622C22.3867 11.0974 23.018 11.3235 23.8235 11.306L23.9427 11.3028L23.9624 12.2656L23.8543 12.2767C23.8401 12.2783 23.7533 12.2871 23.6152 12.2871C23.156 12.2871 22.1327 12.1923 21.3492 11.4255C20.6028 10.6968 20.2801 9.5597 20.3905 8.04669L20.4 7.92485L21.3255 8.01325L21.3105 8.13508L21.3104 8.13632C21.3048 8.18823 21.1406 9.7133 21.9591 10.622ZM23.3545 4.16799L22.6705 4.89503L28.4382 11.3205L27.0455 13.3042L27.8101 13.9261L29.7085 11.2377L23.3545 4.16799ZM2.27727 9.62843H7.22204V10.6485H2.00427L2.27727 9.62843ZM13.9323 4.23919H3.72477L3.45256 5.24335H13.9323V4.23919ZM2.99747 6.94271H10.2122V7.94687H2.72841L2.99747 6.94271Z"
fill="white"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M96.1738 4.25618C97.2215 4.25618 98.106 4.34994 98.7948 4.65527C99.4592 4.95178 99.9168 5.49352 99.9215 6.36623H108.959C109.44 2.03393 105.725 0 96.8065 0C94.9689 0 93.0019 0.155469 91.0997 0.568185H81.3925L81.3933 0.569788H77.9856L70.7622 11.3853H70.7054L69.0067 0.569788H60.1983V0.57139H39.6604L38.574 4.82757H46.4072L43.1889 17.431H51.2012L54.4204 4.82757H61.407L64.9844 17.431H73.3952L82.7457 5.66422C82.0955 6.6355 81.5811 7.76065 81.2473 9.06531C79.2606 16.842 86.6213 18 92.2374 18C96.8357 18 99.6028 17.4102 102.07 15.8723L102.58 17.431H106.02L108.476 7.81515H97.0787L96.1035 11.6346H99.4C98.5084 12.9008 96.9848 13.7446 94.374 13.7446C90.4038 13.7446 88.8384 12.1042 89.6321 8.99399C90.5024 5.59129 92.912 4.25618 96.1738 4.25618Z"
fill="white"
/>
</g>
<path
d="M2.93945 28.8682L1.41113 28.8633L1.58691 27.8721L2.98828 27.8818C3.23893 27.8786 3.45215 27.8216 3.62793 27.7109C3.80697 27.6003 3.94857 27.4521 4.05273 27.2666C4.1569 27.0778 4.22363 26.8646 4.25293 26.627C4.27572 26.4447 4.27083 26.2607 4.23828 26.0752C4.20898 25.8896 4.139 25.7334 4.02832 25.6064C3.9209 25.4795 3.75814 25.4095 3.54004 25.3965L2.34863 25.3867L1.28906 31.5H0.131836L1.3623 24.3906L3.58398 24.3955C4.00391 24.4085 4.3571 24.5143 4.64355 24.7129C4.93001 24.9115 5.13835 25.1768 5.26855 25.5088C5.40202 25.8408 5.45085 26.2103 5.41504 26.6172C5.37272 27.0794 5.24251 27.4798 5.02441 27.8184C4.80957 28.1536 4.52311 28.4141 4.16504 28.5996C3.81022 28.7819 3.40169 28.8714 2.93945 28.8682ZM10.9814 27.3643L10.7959 28.5654C10.7373 28.9593 10.638 29.3402 10.498 29.708C10.3613 30.0726 10.1774 30.3997 9.94629 30.6895C9.71842 30.9759 9.43848 31.2021 9.10645 31.3682C8.77441 31.5309 8.38704 31.6074 7.94434 31.5977C7.52441 31.5879 7.17611 31.4951 6.89941 31.3193C6.62598 31.1403 6.41439 30.9059 6.26465 30.6162C6.11491 30.3232 6.01888 30.001 5.97656 29.6494C5.93424 29.2946 5.93587 28.9365 5.98145 28.5752L6.16699 27.3643C6.22559 26.9736 6.32324 26.5944 6.45996 26.2266C6.59993 25.8587 6.78548 25.5267 7.0166 25.2305C7.25098 24.9342 7.53418 24.7015 7.86621 24.5322C8.2015 24.3597 8.59212 24.2799 9.03809 24.293C9.46452 24.3027 9.81445 24.3988 10.0879 24.5811C10.3613 24.7633 10.5713 25.0026 10.7178 25.2988C10.8643 25.5951 10.957 25.9238 10.9961 26.2852C11.0352 26.6432 11.0303 27.0029 10.9814 27.3643ZM9.65332 28.5752L9.83398 27.3447C9.86003 27.1527 9.8763 26.9427 9.88281 26.7148C9.89258 26.4837 9.87305 26.2624 9.82422 26.0508C9.77865 25.8392 9.6875 25.6634 9.55078 25.5234C9.41732 25.3835 9.21875 25.3086 8.95508 25.2988C8.67188 25.2891 8.43262 25.346 8.2373 25.4697C8.04199 25.5934 7.88249 25.7594 7.75879 25.9678C7.63509 26.1761 7.53906 26.4023 7.4707 26.6465C7.40234 26.8874 7.35026 27.1234 7.31445 27.3545L7.13867 28.5801C7.11263 28.7689 7.09635 28.9772 7.08984 29.2051C7.08659 29.4329 7.10938 29.651 7.1582 29.8594C7.20703 30.0645 7.29818 30.2354 7.43164 30.3721C7.56836 30.5088 7.76693 30.5837 8.02734 30.5967C8.31055 30.6064 8.54818 30.5511 8.74023 30.4307C8.93229 30.3102 9.09017 30.1491 9.21387 29.9473C9.33757 29.7454 9.43359 29.5241 9.50195 29.2832C9.57031 29.0391 9.62077 28.8031 9.65332 28.5752ZM13.2129 29.8887L15.166 24.3906H15.8594L15.6104 25.8359L13.54 31.5H12.8076L13.2129 29.8887ZM13.3691 24.3906L13.3838 29.957L13.1836 31.5H12.4316L12.2412 24.3906H13.3691ZM16.2012 29.8301L17.9102 24.3906H19.0771L16.6699 31.5H15.8984L16.2012 29.8301ZM16.1279 24.3906L16.3525 30.001L16.2598 31.5H15.5566L15.2783 25.7236L15.4541 24.3906H16.1279ZM22.7881 30.5088L22.6123 31.5H19.6143L19.7852 30.5088H22.7881ZM21.1572 24.3906L19.9219 31.5H18.7646L19.9951 24.3906H21.1572ZM22.9346 27.3496L22.7637 28.3262H20.166L20.332 27.3496H22.9346ZM23.8232 24.3906L23.6475 25.3867H20.6689L20.8447 24.3906H23.8232ZM24.7852 24.3906L26.8066 24.3955C27.2298 24.4085 27.5814 24.5029 27.8613 24.6787C28.1445 24.8512 28.3512 25.0921 28.4814 25.4014C28.6149 25.7106 28.6637 26.0752 28.6279 26.4951C28.5986 26.8402 28.5189 27.1462 28.3887 27.4131C28.2585 27.6768 28.0811 27.9062 27.8564 28.1016C27.6318 28.2936 27.3633 28.4548 27.0508 28.585L26.6748 28.7705H24.8535L25.0195 27.7744L26.2061 27.7842C26.4502 27.7809 26.6602 27.7256 26.8359 27.6182C27.015 27.5107 27.1582 27.3643 27.2656 27.1787C27.373 26.9932 27.4398 26.7848 27.4658 26.5537C27.4919 26.3649 27.4902 26.1842 27.4609 26.0117C27.4349 25.8359 27.3665 25.6911 27.2559 25.5771C27.1484 25.4632 26.984 25.4014 26.7627 25.3916L25.7764 25.3867L24.7119 31.5H23.5547L24.7852 24.3906ZM26.7969 31.5L26.0352 28.3066L27.1924 28.3018L28.0322 31.4316V31.5H26.7969ZM32.8369 30.5088L32.6611 31.5H29.6631L29.834 30.5088H32.8369ZM31.2061 24.3906L29.9707 31.5H28.8135L30.0439 24.3906H31.2061ZM32.9834 27.3496L32.8125 28.3262H30.2148L30.3809 27.3496H32.9834ZM33.8721 24.3906L33.6963 25.3867H30.7178L30.8936 24.3906H33.8721ZM35.3613 31.5H34.0918L34.2773 30.5088L35.4102 30.5137C35.8268 30.5169 36.1654 30.4323 36.4258 30.2598C36.6895 30.084 36.8913 29.8464 37.0312 29.5469C37.1745 29.2441 37.2738 28.9023 37.3291 28.5215L37.5 27.3594C37.5293 27.1283 37.5439 26.8988 37.5439 26.6709C37.5472 26.443 37.5179 26.2347 37.4561 26.0459C37.3942 25.8538 37.2852 25.6992 37.1289 25.582C36.9727 25.4648 36.7513 25.4014 36.4648 25.3916L35.127 25.3867L35.3027 24.3906L36.5088 24.3955C36.932 24.4053 37.2917 24.4932 37.5879 24.6592C37.8841 24.8252 38.1185 25.0465 38.291 25.3232C38.4635 25.5999 38.5791 25.9141 38.6377 26.2656C38.6963 26.6172 38.7012 26.9867 38.6523 27.374L38.4766 28.5215C38.4115 28.9479 38.2975 29.3434 38.1348 29.708C37.9753 30.0693 37.7653 30.3851 37.5049 30.6553C37.2445 30.9222 36.9352 31.1305 36.5771 31.2803C36.2223 31.43 35.8171 31.5033 35.3613 31.5ZM35.9912 24.3906L34.7559 31.5H33.5986L34.8291 24.3906H35.9912ZM44.2236 28.2969H42.7539L42.9102 27.3887L44.1064 27.3984C44.3148 27.3952 44.4987 27.3496 44.6582 27.2617C44.821 27.1738 44.9512 27.0518 45.0488 26.8955C45.1465 26.7393 45.2083 26.557 45.2344 26.3486C45.2604 26.1696 45.2588 26.0101 45.2295 25.8701C45.2002 25.7269 45.1318 25.613 45.0244 25.5283C44.9202 25.4437 44.7705 25.3981 44.5752 25.3916L43.6133 25.3867L42.5488 31.5H41.3916L42.6221 24.3906L44.6143 24.3955C44.9072 24.402 45.1693 24.4476 45.4004 24.5322C45.6348 24.6136 45.8301 24.734 45.9863 24.8936C46.1458 25.0531 46.263 25.2484 46.3379 25.4795C46.4128 25.7074 46.4388 25.9727 46.416 26.2754C46.39 26.6172 46.2939 26.9102 46.1279 27.1543C45.9619 27.3952 45.7454 27.5872 45.4785 27.7305C45.2116 27.8704 44.9154 27.9567 44.5898 27.9893L44.2236 28.2969ZM43.6377 31.5H41.7969L42.5 30.5088L43.6865 30.5186C43.9111 30.512 44.1032 30.46 44.2627 30.3623C44.4255 30.2614 44.554 30.1263 44.6484 29.957C44.7461 29.7878 44.8079 29.5957 44.834 29.3809C44.8568 29.2148 44.8584 29.0521 44.8389 28.8926C44.8193 28.7298 44.7624 28.5947 44.668 28.4873C44.5768 28.3766 44.4303 28.3148 44.2285 28.3018L43.0029 28.2969L43.1787 27.3887L44.6094 27.3936L44.8096 27.7402C45.1058 27.7695 45.3418 27.8639 45.5176 28.0234C45.6966 28.1797 45.8219 28.3783 45.8936 28.6191C45.9684 28.8568 45.9945 29.1123 45.9717 29.3857C45.9424 29.8317 45.8252 30.2142 45.6201 30.5332C45.4183 30.849 45.1465 31.0915 44.8047 31.2607C44.4661 31.4268 44.0771 31.5065 43.6377 31.5ZM48.4521 24.3906L49.0771 27.75L50.8691 24.3906H52.1973L49.4727 28.9463L49.0283 31.5H47.8662L48.335 28.8193L47.2217 24.3906H48.4521Z"
fill="#D6E3F0"
/>
<path
d="M58.6096 26.6101C59.4148 26.2402 60.2654 26.0142 61.0995 25.9155C61.1904 25.9032 61.2275 25.9648 61.2193 26.0347C61.1119 26.6718 61.0417 27.3212 61.0128 27.9705C61.0046 28.0445 60.9674 28.0938 60.8807 28.1103C60.4182 28.2007 59.9681 28.3405 59.4685 28.5665C59.9145 29.3392 60.4595 30.0502 61.0541 30.6421C61.1243 30.712 61.1615 30.7859 61.1821 30.9092C61.339 31.9039 61.6074 32.9067 61.9708 33.8561C61.9914 33.9096 61.9914 33.9466 61.9625 33.9753C61.9295 34.0082 61.8758 34.0082 61.8263 33.9753C58.2132 31.797 56.0372 27.876 56 23.7618C56 23.6632 56.033 23.5892 56.1197 23.544C58.0357 22.4713 60.1911 21.9575 62.3548 22.0027C62.4498 22.0027 62.4869 22.0891 62.4498 22.1671C62.1525 22.7837 61.9006 23.4125 61.7065 24.0413C61.6859 24.1153 61.6363 24.1523 61.5579 24.1564C60.4017 24.214 59.2744 24.477 58.2421 24.9044C58.3165 25.4881 58.4445 26.0635 58.6138 26.6142L58.6096 26.6101ZM62.6067 24.1646C62.5365 24.1564 62.4869 24.0948 62.5076 24.0208C62.7347 23.3632 62.9948 22.7467 63.2921 22.1713C63.3252 22.1014 63.3871 22.0767 63.4656 22.0849C65.0966 22.2658 66.6368 22.7795 68.0118 23.544C68.0944 23.5892 68.1315 23.6632 68.1315 23.7618C68.1026 27.6582 66.1454 31.3819 62.8462 33.6383C62.7843 33.6835 62.7017 33.6589 62.6769 33.5849C62.4374 32.9437 62.2433 32.2943 62.1029 31.6655C62.0823 31.5833 62.1029 31.5175 62.169 31.4682C64.1675 29.9023 65.5632 27.5637 65.9018 24.9044C64.886 24.4852 63.7835 24.2263 62.615 24.1646H62.6067ZM71.0591 25.0113C71.0591 24.9497 71.1004 24.9086 71.1624 24.9086H75.9068C75.9646 24.9086 76.01 24.9702 75.9894 25.0236L75.5641 26.195C75.5393 26.2608 75.4939 26.2895 75.4237 26.2895H72.5209V27.5554H74.9406C74.9984 27.5554 75.0438 27.6171 75.0232 27.6705L74.6061 28.8172C74.5813 28.8871 74.5359 28.9159 74.4657 28.9159H72.5209V31.0408C72.5209 31.1024 72.4796 31.1435 72.4176 31.1435H71.1624C71.1004 31.1435 71.0591 31.1024 71.0591 31.0408V25.0072V25.0113ZM77.4305 25.0031C77.4552 24.9373 77.5007 24.9086 77.5709 24.9086H79.2514C79.3216 24.9086 79.3671 24.9373 79.3918 25.0031L81.5927 31.0325C81.6133 31.086 81.5679 31.1476 81.5101 31.1476H80.1805C80.1103 31.1476 80.069 31.1147 80.0442 31.049L79.6231 29.8324H77.191L76.7698 31.049C76.7492 31.1147 76.7037 31.1476 76.6335 31.1476H75.3205C75.2626 31.1476 75.2172 31.086 75.2379 31.0325L77.4387 25.0031H77.4305ZM79.1523 28.472L78.405 26.3142L77.6576 28.472H79.1565H79.1523ZM82.2079 25.0113C82.2079 24.9497 82.2492 24.9086 82.3112 24.9086H83.7688C83.8431 24.9086 83.8885 24.9332 83.9257 24.999L86.11 28.6939V25.0072C86.11 24.9455 86.1513 24.9044 86.2132 24.9044H87.4437C87.5057 24.9044 87.547 24.9455 87.547 25.0072V31.0408C87.547 31.1024 87.5057 31.1435 87.4437 31.1435H86.0027C85.9283 31.1435 85.8829 31.1188 85.8457 31.0531L83.6449 27.3294V31.0408C83.6449 31.1024 83.6036 31.1435 83.5417 31.1435H82.3112C82.2492 31.1435 82.2079 31.1024 82.2079 31.0408V25.0072V25.0113ZM91.1228 29.7666C92.118 29.7666 92.8695 29.0186 92.8695 28.0281C92.8695 27.0376 92.118 26.2895 91.1228 26.2895H88.8931C88.8312 26.2895 88.7899 26.2484 88.7899 26.1868V25.0113C88.7899 24.9497 88.8312 24.9086 88.8931 24.9086H91.1228C92.9603 24.9086 94.3354 26.2484 94.3354 28.0281C94.3354 29.8077 92.9603 31.1476 91.1228 31.1476H88.8931C88.8312 31.1476 88.7899 31.1065 88.7899 31.0449V28.1267C88.7899 27.7363 88.9137 27.4321 89.1367 27.2102C89.339 27.0088 89.6529 26.8773 89.9295 26.8773H90.1484C90.2103 26.8773 90.2516 26.9184 90.2516 26.98V29.7625H91.1228V29.7666ZM95.2355 28.6857V25.0072C95.2355 24.9455 95.2768 24.9044 95.3387 24.9044H96.594C96.6559 24.9044 96.6972 24.9455 96.6972 25.0072V28.6816C96.6972 29.3885 97.1927 29.8817 97.903 29.8817C98.6132 29.8817 99.1087 29.3926 99.1087 28.6816V25.0072C99.1087 24.9455 99.15 24.9044 99.2119 24.9044H100.467C100.529 24.9044 100.57 24.9455 100.57 25.0072V28.6816C100.57 30.2146 99.4844 31.2627 97.903 31.2627C96.3215 31.2627 95.2355 30.2146 95.2355 28.6816V28.6857ZM106.046 27.3212C106.108 27.3212 106.149 27.3623 106.149 27.4239V28.5788C106.149 28.6405 106.108 28.6816 106.046 28.6816H103.275V29.7625H106.215C106.277 29.7625 106.318 29.8036 106.318 29.8653V31.0408C106.318 31.1024 106.277 31.1435 106.215 31.1435H101.917C101.855 31.1435 101.813 31.1024 101.813 31.0408V25.0072C101.813 24.9455 101.855 24.9044 101.917 24.9044H106.215C106.277 24.9044 106.318 24.9455 106.318 25.0072V26.1827C106.318 26.2443 106.277 26.2854 106.215 26.2854H103.275V27.317H106.046V27.3212ZM109.006 29.7666H111.897C111.959 29.7666 112 29.8077 112 29.8694V31.0449C112 31.1065 111.959 31.1476 111.897 31.1476H107.648C107.586 31.1476 107.545 31.1065 107.545 31.0449V25.0072C107.545 24.9455 107.586 24.9044 107.648 24.9044H108.903C108.965 24.9044 109.006 24.9455 109.006 25.0072V29.7625V29.7666Z"
fill="white"
/>
<defs>
<clipPath id="clip0_210_29690">
<rect width="109" height="18" fill="white" />
</clipPath>
</defs>
</svg>
);
export const LogoTVGBlackPoweredFanduel = (height, className) => (
<svg
data-qa-label="logo"
fill="none"
className={className}
viewBox="0 0 112 34"
height={height}
>
<g clipPath="url(#clip0_348_10831)">
<path
fillRule="evenodd"
clipRule="evenodd"
d="M4.82326 0L0 17.9984L29.5005 18L34.3246 0.002389L4.82326 0Z"
fill="#38AB4F"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M24.3221 1.99219L24.5486 3.06642L24.4334 3.0919C12.3709 5.78506 5.49857 15.8028 5.43151 15.9039L5.36128 16.0074L4.43814 15.3082L4.5052 15.2135C12.4474 4.03634 24.0941 2.02961 24.2109 2.0105L24.3221 1.99219ZM21.9591 10.622C22.3867 11.0974 23.018 11.3235 23.8235 11.306L23.9427 11.3028L23.9624 12.2656L23.8543 12.2767C23.8401 12.2783 23.7533 12.2871 23.6152 12.2871C23.156 12.2871 22.1327 12.1923 21.3492 11.4255C20.6028 10.6968 20.2801 9.5597 20.3905 8.04669L20.4 7.92485L21.3255 8.01325L21.3105 8.13508L21.3104 8.13632C21.3048 8.18823 21.1406 9.7133 21.9591 10.622ZM23.3545 4.16799L22.6705 4.89503L28.4382 11.3205L27.0455 13.3042L27.8101 13.9261L29.7085 11.2377L23.3545 4.16799ZM2.27727 9.62843H7.22204V10.6485H2.00427L2.27727 9.62843ZM13.9323 4.23919H3.72477L3.45256 5.24335H13.9323V4.23919ZM2.99747 6.94271H10.2122V7.94687H2.72841L2.99747 6.94271Z"
fill="white"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M96.1738 4.25618C97.2215 4.25618 98.106 4.34994 98.7948 4.65527C99.4592 4.95178 99.9168 5.49352 99.9215 6.36623H108.959C109.44 2.03393 105.725 0 96.8065 0C94.9689 0 93.0019 0.155469 91.0997 0.568185H81.3925L81.3933 0.569788H77.9856L70.7622 11.3853H70.7054L69.0067 0.569788H60.1983V0.57139H39.6604L38.574 4.82757H46.4072L43.1889 17.431H51.2012L54.4204 4.82757H61.407L64.9844 17.431H73.3952L82.7457 5.66422C82.0955 6.6355 81.5811 7.76065 81.2473 9.06531C79.2606 16.842 86.6213 18 92.2374 18C96.8357 18 99.6028 17.4102 102.07 15.8723L102.58 17.431H106.02L108.476 7.81515H97.0787L96.1035 11.6346H99.4C98.5084 12.9008 96.9848 13.7446 94.374 13.7446C90.4038 13.7446 88.8384 12.1042 89.6321 8.99399C90.5024 5.59129 92.912 4.25618 96.1738 4.25618Z"
fill="#384048"
/>
</g>
<path
d="M2.93945 28.8682L1.41113 28.8633L1.58691 27.8721L2.98828 27.8818C3.23893 27.8786 3.45215 27.8216 3.62793 27.7109C3.80697 27.6003 3.94857 27.4521 4.05273 27.2666C4.1569 27.0778 4.22363 26.8646 4.25293 26.627C4.27572 26.4447 4.27083 26.2607 4.23828 26.0752C4.20898 25.8896 4.139 25.7334 4.02832 25.6064C3.9209 25.4795 3.75814 25.4095 3.54004 25.3965L2.34863 25.3867L1.28906 31.5H0.131836L1.3623 24.3906L3.58398 24.3955C4.00391 24.4085 4.3571 24.5143 4.64355 24.7129C4.93001 24.9115 5.13835 25.1768 5.26855 25.5088C5.40202 25.8408 5.45085 26.2103 5.41504 26.6172C5.37272 27.0794 5.24251 27.4798 5.02441 27.8184C4.80957 28.1536 4.52311 28.4141 4.16504 28.5996C3.81022 28.7819 3.40169 28.8714 2.93945 28.8682ZM10.9814 27.3643L10.7959 28.5654C10.7373 28.9593 10.638 29.3402 10.498 29.708C10.3613 30.0726 10.1774 30.3997 9.94629 30.6895C9.71842 30.9759 9.43848 31.2021 9.10645 31.3682C8.77441 31.5309 8.38704 31.6074 7.94434 31.5977C7.52441 31.5879 7.17611 31.4951 6.89941 31.3193C6.62598 31.1403 6.41439 30.9059 6.26465 30.6162C6.11491 30.3232 6.01888 30.001 5.97656 29.6494C5.93424 29.2946 5.93587 28.9365 5.98145 28.5752L6.16699 27.3643C6.22559 26.9736 6.32324 26.5944 6.45996 26.2266C6.59993 25.8587 6.78548 25.5267 7.0166 25.2305C7.25098 24.9342 7.53418 24.7015 7.86621 24.5322C8.2015 24.3597 8.59212 24.2799 9.03809 24.293C9.46452 24.3027 9.81445 24.3988 10.0879 24.5811C10.3613 24.7633 10.5713 25.0026 10.7178 25.2988C10.8643 25.5951 10.957 25.9238 10.9961 26.2852C11.0352 26.6432 11.0303 27.0029 10.9814 27.3643ZM9.65332 28.5752L9.83398 27.3447C9.86003 27.1527 9.8763 26.9427 9.88281 26.7148C9.89258 26.4837 9.87305 26.2624 9.82422 26.0508C9.77865 25.8392 9.6875 25.6634 9.55078 25.5234C9.41732 25.3835 9.21875 25.3086 8.95508 25.2988C8.67188 25.2891 8.43262 25.346 8.2373 25.4697C8.04199 25.5934 7.88249 25.7594 7.75879 25.9678C7.63509 26.1761 7.53906 26.4023 7.4707 26.6465C7.40234 26.8874 7.35026 27.1234 7.31445 27.3545L7.13867 28.5801C7.11263 28.7689 7.09635 28.9772 7.08984 29.2051C7.08659 29.4329 7.10938 29.651 7.1582 29.8594C7.20703 30.0645 7.29818 30.2354 7.43164 30.3721C7.56836 30.5088 7.76693 30.5837 8.02734 30.5967C8.31055 30.6064 8.54818 30.5511 8.74023 30.4307C8.93229 30.3102 9.09017 30.1491 9.21387 29.9473C9.33757 29.7454 9.43359 29.5241 9.50195 29.2832C9.57031 29.0391 9.62077 28.8031 9.65332 28.5752ZM13.2129 29.8887L15.166 24.3906H15.8594L15.6104 25.8359L13.54 31.5H12.8076L13.2129 29.8887ZM13.3691 24.3906L13.3838 29.957L13.1836 31.5H12.4316L12.2412 24.3906H13.3691ZM16.2012 29.8301L17.9102 24.3906H19.0771L16.6699 31.5H15.8984L16.2012 29.8301ZM16.1279 24.3906L16.3525 30.001L16.2598 31.5H15.5566L15.2783 25.7236L15.4541 24.3906H16.1279ZM22.7881 30.5088L22.6123 31.5H19.6143L19.7852 30.5088H22.7881ZM21.1572 24.3906L19.9219 31.5H18.7646L19.9951 24.3906H21.1572ZM22.9346 27.3496L22.7637 28.3262H20.166L20.332 27.3496H22.9346ZM23.8232 24.3906L23.6475 25.3867H20.6689L20.8447 24.3906H23.8232ZM24.7852 24.3906L26.8066 24.3955C27.2298 24.4085 27.5814 24.5029 27.8613 24.6787C28.1445 24.8512 28.3512 25.0921 28.4814 25.4014C28.6149 25.7106 28.6637 26.0752 28.6279 26.4951C28.5986 26.8402 28.5189 27.1462 28.3887 27.4131C28.2585 27.6768 28.0811 27.9062 27.8564 28.1016C27.6318 28.2936 27.3633 28.4548 27.0508 28.585L26.6748 28.7705H24.8535L25.0195 27.7744L26.2061 27.7842C26.4502 27.7809 26.6602 27.7256 26.8359 27.6182C27.015 27.5107 27.1582 27.3643 27.2656 27.1787C27.373 26.9932 27.4398 26.7848 27.4658 26.5537C27.4919 26.3649 27.4902 26.1842 27.4609 26.0117C27.4349 25.8359 27.3665 25.6911 27.2559 25.5771C27.1484 25.4632 26.984 25.4014 26.7627 25.3916L25.7764 25.3867L24.7119 31.5H23.5547L24.7852 24.3906ZM26.7969 31.5L26.0352 28.3066L27.1924 28.3018L28.0322 31.4316V31.5H26.7969ZM32.8369 30.5088L32.6611 31.5H29.6631L29.834 30.5088H32.8369ZM31.2061 24.3906L29.9707 31.5H28.8135L30.0439 24.3906H31.2061ZM32.9834 27.3496L32.8125 28.3262H30.2148L30.3809 27.3496H32.9834ZM33.8721 24.3906L33.6963 25.3867H30.7178L30.8936 24.3906H33.8721ZM35.3613 31.5H34.0918L34.2773 30.5088L35.4102 30.5137C35.8268 30.5169 36.1654 30.4323 36.4258 30.2598C36.6895 30.084 36.8913 29.8464 37.0312 29.5469C37.1745 29.2441 37.2738 28.9023 37.3291 28.5215L37.5 27.3594C37.5293 27.1283 37.5439 26.8988 37.5439 26.6709C37.5472 26.443 37.5179 26.2347 37.4561 26.0459C37.3942 25.8538 37.2852 25.6992 37.1289 25.582C36.9727 25.4648 36.7513 25.4014 36.4648 25.3916L35.127 25.3867L35.3027 24.3906L36.5088 24.3955C36.932 24.4053 37.2917 24.4932 37.5879 24.6592C37.8841 24.8252 38.1185 25.0465 38.291 25.3232C38.4635 25.5999 38.5791 25.9141 38.6377 26.2656C38.6963 26.6172 38.7012 26.9867 38.6523 27.374L38.4766 28.5215C38.4115 28.9479 38.2975 29.3434 38.1348 29.708C37.9753 30.0693 37.7653 30.3851 37.5049 30.6553C37.2445 30.9222 36.9352 31.1305 36.5771 31.2803C36.2223 31.43 35.8171 31.5033 35.3613 31.5ZM35.9912 24.3906L34.7559 31.5H33.5986L34.8291 24.3906H35.9912ZM44.2236 28.2969H42.7539L42.9102 27.3887L44.1064 27.3984C44.3148 27.3952 44.4987 27.3496 44.6582 27.2617C44.821 27.1738 44.9512 27.0518 45.0488 26.8955C45.1465 26.7393 45.2083 26.557 45.2344 26.3486C45.2604 26.1696 45.2588 26.0101 45.2295 25.8701C45.2002 25.7269 45.1318 25.613 45.0244 25.5283C44.9202 25.4437 44.7705 25.3981 44.5752 25.3916L43.6133 25.3867L42.5488 31.5H41.3916L42.6221 24.3906L44.6143 24.3955C44.9072 24.402 45.1693 24.4476 45.4004 24.5322C45.6348 24.6136 45.8301 24.734 45.9863 24.8936C46.1458 25.0531 46.263 25.2484 46.3379 25.4795C46.4128 25.7074 46.4388 25.9727 46.416 26.2754C46.39 26.6172 46.2939 26.9102 46.1279 27.1543C45.9619 27.3952 45.7454 27.5872 45.4785 27.7305C45.2116 27.8704 44.9154 27.9567 44.5898 27.9893L44.2236 28.2969ZM43.6377 31.5H41.7969L42.5 30.5088L43.6865 30.5186C43.9111 30.512 44.1032 30.46 44.2627 30.3623C44.4255 30.2614 44.554 30.1263 44.6484 29.957C44.7461 29.7878 44.8079 29.5957 44.834 29.3809C44.8568 29.2148 44.8584 29.0521 44.8389 28.8926C44.8193 28.7298 44.7624 28.5947 44.668 28.4873C44.5768 28.3766 44.4303 28.3148 44.2285 28.3018L43.0029 28.2969L43.1787 27.3887L44.6094 27.3936L44.8096 27.7402C45.1058 27.7695 45.3418 27.8639 45.5176 28.0234C45.6966 28.1797 45.8219 28.3783 45.8936 28.6191C45.9684 28.8568 45.9945 29.1123 45.9717 29.3857C45.9424 29.8317 45.8252 30.2142 45.6201 30.5332C45.4183 30.849 45.1465 31.0915 44.8047 31.2607C44.4661 31.4268 44.0771 31.5065 43.6377 31.5ZM48.4521 24.3906L49.0771 27.75L50.8691 24.3906H52.1973L49.4727 28.9463L49.0283 31.5H47.8662L48.335 28.8193L47.2217 24.3906H48.4521Z"
fill="#626D78"
/>
<path
d="M58.6096 26.6101C59.4148 26.2402 60.2654 26.0142 61.0995 25.9155C61.1904 25.9032 61.2275 25.9648 61.2193 26.0347C61.1119 26.6718 61.0417 27.3212 61.0128 27.9705C61.0046 28.0445 60.9674 28.0938 60.8807 28.1103C60.4182 28.2007 59.9681 28.3405 59.4685 28.5665C59.9145 29.3392 60.4595 30.0502 61.0541 30.6421C61.1243 30.712 61.1615 30.7859 61.1821 30.9092C61.339 31.9039 61.6074 32.9067 61.9708 33.8561C61.9914 33.9096 61.9914 33.9466 61.9625 33.9753C61.9295 34.0082 61.8758 34.0082 61.8263 33.9753C58.2132 31.797 56.0372 27.876 56 23.7618C56 23.6632 56.033 23.5892 56.1197 23.544C58.0357 22.4713 60.1911 21.9575 62.3548 22.0027C62.4498 22.0027 62.4869 22.0891 62.4498 22.1671C62.1525 22.7837 61.9006 23.4125 61.7065 24.0413C61.6859 24.1153 61.6363 24.1523 61.5579 24.1564C60.4017 24.214 59.2744 24.477 58.2421 24.9044C58.3165 25.4881 58.4445 26.0635 58.6138 26.6142L58.6096 26.6101ZM62.6067 24.1646C62.5365 24.1564 62.4869 24.0948 62.5076 24.0208C62.7347 23.3632 62.9948 22.7467 63.2921 22.1713C63.3252 22.1014 63.3871 22.0767 63.4656 22.0849C65.0966 22.2658 66.6368 22.7795 68.0118 23.544C68.0944 23.5892 68.1315 23.6632 68.1315 23.7618C68.1026 27.6582 66.1454 31.3819 62.8462 33.6383C62.7843 33.6835 62.7017 33.6589 62.6769 33.5849C62.4374 32.9437 62.2433 32.2943 62.1029 31.6655C62.0823 31.5833 62.1029 31.5175 62.169 31.4682C64.1675 29.9023 65.5632 27.5637 65.9018 24.9044C64.886 24.4852 63.7835 24.2263 62.615 24.1646H62.6067ZM71.0591 25.0113C71.0591 24.9497 71.1004 24.9086 71.1624 24.9086H75.9068C75.9646 24.9086 76.01 24.9702 75.9894 25.0236L75.5641 26.195C75.5393 26.2608 75.4939 26.2895 75.4237 26.2895H72.5209V27.5554H74.9406C74.9984 27.5554 75.0438 27.6171 75.0232 27.6705L74.6061 28.8172C74.5813 28.8871 74.5359 28.9159 74.4657 28.9159H72.5209V31.0408C72.5209 31.1024 72.4796 31.1435 72.4176 31.1435H71.1624C71.1004 31.1435 71.0591 31.1024 71.0591 31.0408V25.0072V25.0113ZM77.4305 25.0031C77.4552 24.9373 77.5007 24.9086 77.5709 24.9086H79.2514C79.3216 24.9086 79.3671 24.9373 79.3918 25.0031L81.5927 31.0325C81.6133 31.086 81.5679 31.1476 81.5101 31.1476H80.1805C80.1103 31.1476 80.069 31.1147 80.0442 31.049L79.6231 29.8324H77.191L76.7698 31.049C76.7492 31.1147 76.7037 31.1476 76.6335 31.1476H75.3205C75.2626 31.1476 75.2172 31.086 75.2379 31.0325L77.4387 25.0031H77.4305ZM79.1523 28.472L78.405 26.3142L77.6576 28.472H79.1565H79.1523ZM82.2079 25.0113C82.2079 24.9497 82.2492 24.9086 82.3112 24.9086H83.7688C83.8431 24.9086 83.8885 24.9332 83.9257 24.999L86.11 28.6939V25.0072C86.11 24.9455 86.1513 24.9044 86.2132 24.9044H87.4437C87.5057 24.9044 87.547 24.9455 87.547 25.0072V31.0408C87.547 31.1024 87.5057 31.1435 87.4437 31.1435H86.0027C85.9283 31.1435 85.8829 31.1188 85.8457 31.0531L83.6449 27.3294V31.0408C83.6449 31.1024 83.6036 31.1435 83.5417 31.1435H82.3112C82.2492 31.1435 82.2079 31.1024 82.2079 31.0408V25.0072V25.0113ZM91.1228 29.7666C92.118 29.7666 92.8695 29.0186 92.8695 28.0281C92.8695 27.0376 92.118 26.2895 91.1228 26.2895H88.8931C88.8312 26.2895 88.7899 26.2484 88.7899 26.1868V25.0113C88.7899 24.9497 88.8312 24.9086 88.8931 24.9086H91.1228C92.9603 24.9086 94.3354 26.2484 94.3354 28.0281C94.3354 29.8077 92.9603 31.1476 91.1228 31.1476H88.8931C88.8312 31.1476 88.7899 31.1065 88.7899 31.0449V28.1267C88.7899 27.7363 88.9137 27.4321 89.1367 27.2102C89.339 27.0088 89.6529 26.8773 89.9295 26.8773H90.1484C90.2103 26.8773 90.2516 26.9184 90.2516 26.98V29.7625H91.1228V29.7666ZM95.2355 28.6857V25.0072C95.2355 24.9455 95.2768 24.9044 95.3387 24.9044H96.594C96.6559 24.9044 96.6972 24.9455 96.6972 25.0072V28.6816C96.6972 29.3885 97.1927 29.8817 97.903 29.8817C98.6132 29.8817 99.1087 29.3926 99.1087 28.6816V25.0072C99.1087 24.9455 99.15 24.9044 99.2119 24.9044H100.467C100.529 24.9044 100.57 24.9455 100.57 25.0072V28.6816C100.57 30.2146 99.4844 31.2627 97.903 31.2627C96.3215 31.2627 95.2355 30.2146 95.2355 28.6816V28.6857ZM106.046 27.3212C106.108 27.3212 106.149 27.3623 106.149 27.4239V28.5788C106.149 28.6405 106.108 28.6816 106.046 28.6816H103.275V29.7625H106.215C106.277 29.7625 106.318 29.8036 106.318 29.8653V31.0408C106.318 31.1024 106.277 31.1435 106.215 31.1435H101.917C101.855 31.1435 101.813 31.1024 101.813 31.0408V25.0072C101.813 24.9455 101.855 24.9044 101.917 24.9044H106.215C106.277 24.9044 106.318 24.9455 106.318 25.0072V26.1827C106.318 26.2443 106.277 26.2854 106.215 26.2854H103.275V27.317H106.046V27.3212ZM109.006 29.7666H111.897C111.959 29.7666 112 29.8077 112 29.8694V31.0449C112 31.1065 111.959 31.1476 111.897 31.1476H107.648C107.586 31.1476 107.545 31.1065 107.545 31.0449V25.0072C107.545 24.9455 107.586 24.9044 107.648 24.9044H108.903C108.965 24.9044 109.006 24.9455 109.006 25.0072V29.7625V29.7666Z"
fill="#0070EB"
/>
<defs>
<clipPath id="clip0_348_10831">
<rect width="109" height="18" fill="white" />
</clipPath>
</defs>
</svg>
);
export const LogoTVG = (height, className) => (
<SVG
data-qa-label="logo"
className={className}
viewBox="0 0 298 50"
height={height}
>
<path d="M14.3.5L1.1 49.7l77.4-.1L91.8.4z" fill="#FFFFFF" />
<path
d="M14.1.4L11 12h26.7v3.2H10.1L9 19.4h18.5v3.2H8.1l-1.1 4h12.3v3.3H6.2L.8 49.6h80.7L94.8.4z"
fill="#38AB50"
/>
<path
d="M14.5 43.2l-2-1.5C34.4 11.1 66.2 6 66.2 6l.5 2.3c-33.5 7.4-52.2 34.9-52.2 34.9M56 22.1l1.9.2s-1.1 9.2 7.2 9v2c0-.1-10 .9-9.1-11.2m19.9 15.4l-1.6-1.3 3.8-5.3-15.7-17.4 1.4-1.5 16.9 18.7z"
fill="#FFFFFF"
stroke="#FFFFFF"
strokeMiterlimit="10"
/>
<path
d="M262 11.9c2.9 0 5.3.3 7.2 1.1 1.8.8 3.1 2.3 3.1 4.6h24.9C298.5 5.8 288.3.3 263.7.3c-5.1 0-10.5.4-15.7 1.5h-36.2l-19.9 29.4h-.2L187 1.8h-80.9l-3 11.6h21.6l-8.9 34.2H138l8.9-34.2h19.3l9.9 34.2h23.2l25.8-32c-1.8 2.6-3.2 5.7-4.1 9.2-5.5 21.1 14.8 24.3 30.3 24.3 12.7 0 20.3-1.6 27.1-5.8l1.4 4.2h9.5l6.8-26.1h-31.4L261.8 32h9.1c-2.5 3.4-6.7 5.7-13.9 5.7-10.9 0-15.3-4.5-13.1-12.9 2.4-9.2 9.1-12.9 18.1-12.9"
fill="#FFFFFF"
/>
</SVG>
);
export const LogoTVGBlack = (height, className) => (
<SVG
data-qa-label="logo"
className={className}
viewBox="0 0 298 50"
height={height}
>
<path d="M14.3.5L1.1 49.7l77.4-.1L91.8.4z" fill="#FFFFFF" />
<path
d="M14.1.4L11 12h26.7v3.2H10.1L9 19.4h18.5v3.2H8.1l-1.1 4h12.3v3.3H6.2L.8 49.6h80.7L94.8.4z"
fill="#38AB50"
/>
<path
d="M14.5 43.2l-2-1.5C34.4 11.1 66.2 6 66.2 6l.5 2.3c-33.5 7.4-52.2 34.9-52.2 34.9M56 22.1l1.9.2s-1.1 9.2 7.2 9v2c0-.1-10 .9-9.1-11.2m19.9 15.4l-1.6-1.3 3.8-5.3-15.7-17.4 1.4-1.5 16.9 18.7z"
fill="#FFF"
stroke="#FFF"
strokeMiterlimit="10"
/>
<path
d="M262 11.9c2.9 0 5.3.3 7.2 1.1 1.8.8 3.1 2.3 3.1 4.6h24.9C298.5 5.8 288.3.3 263.7.3c-5.1 0-10.5.4-15.7 1.5h-36.2l-19.9 29.4h-.2L187 1.8h-80.9l-3 11.6h21.6l-8.9 34.2H138l8.9-34.2h19.3l9.9 34.2h23.2l25.8-32c-1.8 2.6-3.2 5.7-4.1 9.2-5.5 21.1 14.8 24.3 30.3 24.3 12.7 0 20.3-1.6 27.1-5.8l1.4 4.2h9.5l6.8-26.1h-31.4L261.8 32h9.1c-2.5 3.4-6.7 5.7-13.9 5.7-10.9 0-15.3-4.5-13.1-12.9 2.4-9.2 9.1-12.9 18.1-12.9"
fill="#333"
/>
</SVG>
);
export const LogoNj = (height, className) => (
<SVG
data-qa-label="logo"
className={className}
viewBox="0 0 298 63"
height={height}
>
<path d="M283.3 63l4.7-17.5H5.8L1.1 63z" fill="#38AB50" />
<path
d="M83.7 1.1L72.9 40.5H7.1l4.5-16.7.5-1.7 1.2-4.2.4-1.7 1.2-4.2.5-1.7L17.9.9l65.8.2zM60.9 7.4"
fill="#FFFFFF"
/>
<path
d="M83.7 1.1L72.9 40.5H7.1l4.5-16.7h11v-1.7H12.1l1.2-4.2h16v-1.7H13.7l1.2-4.2h22.6v-1.7H15.3L17.8.9l65.9.2zM57.4 11.6l12.7 14-3.1 4.3 1.3 1 3.9-5.5-13.7-15-1.1 1.2zm-5.1 6.9c-.7 9.8 7.4 8.9 7.4 8.9v-1.6c-6.7.2-5.8-7.2-5.8-7.2l-1.6-.1m8.6-11.1l-.4-1.8S34.8 9.7 17.1 34.2l1.6 1.2s15.1-22 42.2-28"
fill="#38AB50"
/>
<path
d="M50.5 60.1V48.7h3.9c1.9 0 3.2.3 4.1.8.8.5 1.3 1.4 1.3 2.7 0 1.2-.4 2-1.2 2.6-.8.6-1.9.9-3.4.9h-2v4.4h-2.7zm2.7-6.3h1.3c.9 0 1.5-.1 1.9-.4.4-.2.6-.7.6-1.2 0-.6-.2-1-.6-1.2-.4-.2-1-.4-1.9-.4h-1.3v3.2zm10.1.5c0-1.8.6-3.2 1.7-4.3 1.1-1 2.7-1.6 4.6-1.6 1.9 0 3.5.5 4.6 1.6 1.1 1 1.7 2.5 1.7 4.3 0 1.9-.6 3.3-1.7 4.4-1.1 1.1-2.6 1.6-4.6 1.6-2 0-3.5-.5-4.6-1.6-1.1-1.1-1.7-2.5-1.7-4.4zm3 0c0 1.4.3 2.4.8 3.2.6.7 1.4 1.1 2.5 1.1s1.9-.4 2.5-1.1c.6-.7.8-1.8.8-3.2 0-1.4-.3-2.4-.9-3.1-.6-.7-1.4-1.1-2.5-1.1s-1.9.4-2.5 1.1c-.5.7-.7 1.8-.7 3.1zM79 48.7h3.1l1.9 8.9 2.6-8.9h3.2l2.3 8.9 2.1-8.9h2.7l-3.2 11.4h-3.2l-2.4-8.8-2.6 8.8h-3.1L79 48.7zm21.5 11.4V48.7h8.7v1.9h-5.9v2.7h5.5v1.9h-5.5v3.1h6.1v1.9h-8.9zm13.1 0V48.7h5.5c1.5 0 2.7.2 3.4.7.7.5 1.1 1.2 1.1 2.2 0 .8-.2 1.4-.6 1.9-.4.4-1.1.8-1.9.9.7.1 1.2.3 1.6.6.3.3.5.8.7 1.6l.2 1.6c.1.5.2.8.3 1.2.1.3.2.6.4.8h-3.1c-.1-.2-.2-.3-.2-.5-.1-.2-.1-.5-.1-.8l-.2-1.7c-.1-.7-.2-1.1-.4-1.3-.2-.1-.6-.2-1.3-.2h-2.4v4.6h-3zm2.8-6.5h1.7c1 0 1.8-.1 2.1-.3.4-.2.6-.6.6-1.2s-.2-1-.5-1.3c-.4-.2-1.1-.4-2.2-.4h-1.7v3.2zm11.5 6.5V48.7h8.7v1.9h-5.9v2.7h5.5v1.9h-5.5v3.1h6.1v1.9h-8.9zm13.1 0V48.7h4.1c1.1 0 2 .1 2.6.2.7.1 1.3.4 1.8.7.8.5 1.4 1.1 1.8 1.9.4.8.6 1.8.6 2.8 0 1.9-.6 3.3-1.8 4.2-1.2 1-2.9 1.4-5.2 1.4H141zm2.8-1.9h1.4c1.4 0 2.4-.3 3-.9.6-.6.9-1.6.9-2.9 0-1.3-.3-2.3-.9-2.9-.6-.6-1.6-.9-3-.9h-1.4v7.6zm19.8 1.9V48.7h4.5c1.7 0 3 .2 3.8.7.8.5 1.2 1.2 1.2 2.2 0 .6-.2 1.2-.5 1.6-.4.4-.9.7-1.6.9.9.2 1.6.5 2 1 .5.5.7 1.1.7 1.8 0 .5-.1.9-.2 1.2-.2.4-.4.7-.7 1-.4.4-.9.6-1.6.8-.6.1-1.6.2-3 .2h-4.6zm2.7-6.8h1.8c.9 0 1.5-.1 1.8-.3.3-.2.5-.6.5-1.1 0-.5-.2-.9-.5-1.2-.3-.2-.9-.3-1.8-.3h-1.8v2.9zm0 5h1.8c1.1 0 1.9-.1 2.3-.3.4-.2.5-.7.5-1.3 0-.6-.2-1-.6-1.3-.4-.2-1.1-.4-2.2-.4h-1.8v3.3zm15 1.8v-4.2l-4.4-7.2h3l3 4.9 2.7-4.9h2.9l-4.4 7.2v4.2h-2.8zm20.3 0v-9.6h-3.9v-1.9h10.6v1.9h-3.9v9.6h-2.8zm17.2 0h-3.1l-4.8-11.4h3.1l3.5 8.9 3.4-8.9h2.9l-5 11.4zm20-6.1v5.3c-.7.3-1.5.5-2.3.7-.8.2-1.8.2-2.8.2-2.2 0-3.9-.5-5.2-1.5-1.2-1-1.8-2.4-1.8-4.2 0-1.9.6-3.4 1.8-4.4 1.2-1.1 2.9-1.6 5.1-1.6 1.6 0 2.9.3 3.8 1 .9.6 1.4 1.5 1.4 2.5v.2h-2.6c0-.7-.3-1.2-.7-1.6-.5-.4-1.1-.5-2-.5-1.2 0-2.1.4-2.8 1.2-.7.8-1 1.9-1 3.2 0 1.3.4 2.4 1.1 3.1.7.7 1.8 1 3.2 1 .4 0 .7 0 1.1-.1.4 0 .7-.1 1.1-.2v-2.5h-2.5V54h5.1z"
fill="#FFFFFF"
/>
<path
d="M268.4 40.5l2.2-9.3h5.4c.6 3.1 2.7 4.6 6.4 4.6 3.5 0 5.3-1 5.3-2.9 0-.7-.3-1.2-.8-1.7s-2.4-1.1-5.5-1.8-5.3-1.8-6.4-3.3c-1.1-1.5-1.7-3-1.7-4.4 0-2.4 1-4.5 3.1-6.1 2.1-1.6 4.8-2.4 8-2.4 2.5 0 4.6.6 6.3 1.7l.3-1.4h5.9l-1.8 7.9h-5.6c-.6-2.1-2.3-3.2-5-3.2-1.3 0-2.3.2-3.1.7-.8.5-1.2 1.1-1.2 1.9 0 .5.2 1 .7 1.4.5.4 2.2.9 5.2 1.6 3 .7 5.1 1.7 6.3 3.2 1.2 1.4 1.8 3 1.8 4.9 0 2.6-1.1 4.7-3.4 6.4-2.2 1.7-5.1 2.5-8.7 2.5-3.1 0-5.7-.6-7.6-1.8l-.4 1.5h-5.7zm-3.3-7l-1.5 6.2c-2.4 1.1-4.7 1.7-7 1.7-1.8 0-3.2-.5-4.3-1.5-1.1-1-1.6-2.4-1.6-4 0-1.2.2-2.5.5-3.8l3-12.8H251l1.3-5.8h3.2l.9-3.9 9.9-6.9-2.5 10.8h3.7l-1.3 5.8h-3.7l-2.9 12.5c-.2.6-.2 1.1-.2 1.5 0 .9.6 1.4 1.7 1.4 1.1.1 2.4-.4 4-1.2zm-36.7-9.2h10.8c.1-.4.1-.8.1-1.2 0-1.5-.4-2.6-1.3-3.5-.9-.9-1.9-1.3-3.2-1.3-3-.1-5.1 2-6.4 6zm9.4 8.2l6.2 2.8c-2.7 4.1-6.8 6.1-12.3 6.1-3.8 0-6.8-1.1-9.1-3.2-2.2-2.1-3.4-5-3.4-8.5 0-4.6 1.5-8.5 4.5-11.8 3-3.3 6.7-5 11.2-5 3.4 0 6.3 1.1 8.6 3.3 2.3 2.2 3.5 5.1 3.5 8.8 0 1.2-.1 2.5-.4 3.9h-19.3c-.1.6-.2 1.2-.2 1.8 0 1.7.5 3.1 1.4 4 .9 1 2.2 1.5 3.7 1.5 2.4-.2 4.2-1.4 5.6-3.7zm-42.7 2.3h4.7c2.1 0 3.7-.7 4.8-2.1 1.1-1.4 1.7-3.1 1.7-5 0-1.4-.4-2.5-1.3-3.3-.9-.9-2.1-1.3-3.7-1.3H198l-2.9 11.7zm4-17.3h3.6c4.2 0 6.3-2 6.3-6.1 0-2.5-1.4-3.8-4.2-3.8h-3.5l-2.2 9.9zm-17.8 17h3.9l6.2-26.7h-3.9l1.4-6.1h17.7c3.9 0 6.9.9 9 2.6 2 1.7 3.1 4 3.1 6.9 0 5-3 8.1-8.9 9.3 4 2.3 6 5.3 6 8.9 0 3.4-1.4 6.1-4.1 8.1-2.7 2-5.8 3-9.2 3h-22.6l1.4-6zm-68.9 6l1.4-6h3.7l6.2-26.7H120l1.4-6.1H136l8.9 26.9 4.8-20.8H146l1.4-6.1h14.1l-1.4 6.1h-3.7l-7.6 32.7h-8.7L130 9.6l-5.7 24.9h4.1l-1.5 6h-14.5zm-22.2 0l1.2-5.2h3.7l1.3-5.4H84.8l-.5-6.4 19-22.4h7.5l-5.5 23.8h5.9l-1.2 5h-5.9l-1.3 5.4h3.7l-1.2 5.2H90.2zm7.3-15.6l3.1-14.2-11.7 14.2h8.6zm68.4-23.2l-1.5 6.1h5.1L166 23.3c-1 4.4-2.4 7.1-3.6 8.6-1.5 1.9-3.2 2.5-5.5 2.5-.8 0-1.7-.1-2.7-.3l-1.9 6.4c2.1.6 4.1.9 6.1.9 4 0 7.4-1.2 10.3-3.5 2-1.7 3.7-4.2 5-7.6.5-1.5 1-3.1 1.4-4.9l.9-3.4 3.3-14.4h4.3l1.4-6.1h-19.1z"
fillRule="evenodd"
clipRule="evenodd"
fill="#FFFFFF"
/>
</SVG>
);
export const LogoNjBlack = (height, className) => (
<SVG
data-qa-label="logo"
className={className}
viewBox="0 0 298 63"
height={height}
>
<path d="M283.3 63l4.7-17.5H5.8L1.1 63z" fill="#38AB50" />
<path
d="M83.7 1.1L72.9 40.5H7.1l4.5-16.7.5-1.7 1.2-4.2.4-1.7 1.2-4.2.5-1.7L17.9.9l65.8.2zM60.9 7.4"
fill="#FFFFFF"
/>
<path
d="M83.7 1.1L72.9 40.5H7.1l4.5-16.7h11v-1.7H12.1l1.2-4.2h16v-1.7H13.7l1.2-4.2h22.6v-1.7H15.3L17.8.9l65.9.2zM57.4 11.6l12.7 14-3.1 4.3 1.3 1 3.9-5.5-13.7-15-1.1 1.2zm-5.1 6.9c-.7 9.8 7.4 8.9 7.4 8.9v-1.6c-6.7.2-5.8-7.2-5.8-7.2l-1.6-.1m8.6-11.1l-.4-1.8S34.8 9.7 17.1 34.2l1.6 1.2s15.1-22 42.2-28"
fill="#38AB50"
/>
<path
d="M50.5 60.1V48.7h3.9c1.9 0 3.2.3 4.1.8.8.5 1.3 1.4 1.3 2.7 0 1.2-.4 2-1.2 2.6-.8.6-1.9.9-3.4.9h-2v4.4h-2.7zm2.7-6.3h1.3c.9 0 1.5-.1 1.9-.4.4-.2.6-.7.6-1.2 0-.6-.2-1-.6-1.2-.4-.2-1-.4-1.9-.4h-1.3v3.2zm10.1.5c0-1.8.6-3.2 1.7-4.3 1.1-1 2.7-1.6 4.6-1.6 1.9 0 3.5.5 4.6 1.6 1.1 1 1.7 2.5 1.7 4.3 0 1.9-.6 3.3-1.7 4.4-1.1 1.1-2.6 1.6-4.6 1.6-2 0-3.5-.5-4.6-1.6-1.1-1.1-1.7-2.5-1.7-4.4zm3 0c0 1.4.3 2.4.8 3.2.6.7 1.4 1.1 2.5 1.1s1.9-.4 2.5-1.1c.6-.7.8-1.8.8-3.2 0-1.4-.3-2.4-.9-3.1-.6-.7-1.4-1.1-2.5-1.1s-1.9.4-2.5 1.1c-.5.7-.7 1.8-.7 3.1zM79 48.7h3.1l1.9 8.9 2.6-8.9h3.2l2.3 8.9 2.1-8.9h2.7l-3.2 11.4h-3.2l-2.4-8.8-2.6 8.8h-3.1L79 48.7zm21.5 11.4V48.7h8.7v1.9h-5.9v2.7h5.5v1.9h-5.5v3.1h6.1v1.9h-8.9zm13.1 0V48.7h5.5c1.5 0 2.7.2 3.4.7.7.5 1.1 1.2 1.1 2.2 0 .8-.2 1.4-.6 1.9-.4.4-1.1.8-1.9.9.7.1 1.2.3 1.6.6.3.3.5.8.7 1.6l.2 1.6c.1.5.2.8.3 1.2.1.3.2.6.4.8h-3.1c-.1-.2-.2-.3-.2-.5-.1-.2-.1-.5-.1-.8l-.2-1.7c-.1-.7-.2-1.1-.4-1.3-.2-.1-.6-.2-1.3-.2h-2.4v4.6h-3zm2.8-6.5h1.7c1 0 1.8-.1 2.1-.3.4-.2.6-.6.6-1.2s-.2-1-.5-1.3c-.4-.2-1.1-.4-2.2-.4h-1.7v3.2zm11.5 6.5V48.7h8.7v1.9h-5.9v2.7h5.5v1.9h-5.5v3.1h6.1v1.9h-8.9zm13.1 0V48.7h4.1c1.1 0 2 .1 2.6.2.7.1 1.3.4 1.8.7.8.5 1.4 1.1 1.8 1.9.4.8.6 1.8.6 2.8 0 1.9-.6 3.3-1.8 4.2-1.2 1-2.9 1.4-5.2 1.4H141zm2.8-1.9h1.4c1.4 0 2.4-.3 3-.9.6-.6.9-1.6.9-2.9 0-1.3-.3-2.3-.9-2.9-.6-.6-1.6-.9-3-.9h-1.4v7.6zm19.8 1.9V48.7h4.5c1.7 0 3 .2 3.8.7.8.5 1.2 1.2 1.2 2.2 0 .6-.2 1.2-.5 1.6-.4.4-.9.7-1.6.9.9.2 1.6.5 2 1 .5.5.7 1.1.7 1.8 0 .5-.1.9-.2 1.2-.2.4-.4.7-.7 1-.4.4-.9.6-1.6.8-.6.1-1.6.2-3 .2h-4.6zm2.7-6.8h1.8c.9 0 1.5-.1 1.8-.3.3-.2.5-.6.5-1.1 0-.5-.2-.9-.5-1.2-.3-.2-.9-.3-1.8-.3h-1.8v2.9zm0 5h1.8c1.1 0 1.9-.1 2.3-.3.4-.2.5-.7.5-1.3 0-.6-.2-1-.6-1.3-.4-.2-1.1-.4-2.2-.4h-1.8v3.3zm15 1.8v-4.2l-4.4-7.2h3l3 4.9 2.7-4.9h2.9l-4.4 7.2v4.2h-2.8zm20.3 0v-9.6h-3.9v-1.9h10.6v1.9h-3.9v9.6h-2.8zm17.2 0h-3.1l-4.8-11.4h3.1l3.5 8.9 3.4-8.9h2.9l-5 11.4zm20-6.1v5.3c-.7.3-1.5.5-2.3.7-.8.2-1.8.2-2.8.2-2.2 0-3.9-.5-5.2-1.5-1.2-1-1.8-2.4-1.8-4.2 0-1.9.6-3.4 1.8-4.4 1.2-1.1 2.9-1.6 5.1-1.6 1.6 0 2.9.3 3.8 1 .9.6 1.4 1.5 1.4 2.5v.2h-2.6c0-.7-.3-1.2-.7-1.6-.5-.4-1.1-.5-2-.5-1.2 0-2.1.4-2.8 1.2-.7.8-1 1.9-1 3.2 0 1.3.4 2.4 1.1 3.1.7.7 1.8 1 3.2 1 .4 0 .7 0 1.1-.1.4 0 .7-.1 1.1-.2v-2.5h-2.5V54h5.1z"
fill="#FFFFFF"
/>
<path
d="M268.4 40.5l2.2-9.3h5.4c.6 3.1 2.7 4.6 6.4 4.6 3.5 0 5.3-1 5.3-2.9 0-.7-.3-1.2-.8-1.7s-2.4-1.1-5.5-1.8-5.3-1.8-6.4-3.3c-1.1-1.5-1.7-3-1.7-4.4 0-2.4 1-4.5 3.1-6.1 2.1-1.6 4.8-2.4 8-2.4 2.5 0 4.6.6 6.3 1.7l.3-1.4h5.9l-1.8 7.9h-5.6c-.6-2.1-2.3-3.2-5-3.2-1.3 0-2.3.2-3.1.7-.8.5-1.2 1.1-1.2 1.9 0 .5.2 1 .7 1.4.5.4 2.2.9 5.2 1.6 3 .7 5.1 1.7 6.3 3.2 1.2 1.4 1.8 3 1.8 4.9 0 2.6-1.1 4.7-3.4 6.4-2.2 1.7-5.1 2.5-8.7 2.5-3.1 0-5.7-.6-7.6-1.8l-.4 1.5h-5.7zm-3.3-7l-1.5 6.2c-2.4 1.1-4.7 1.7-7 1.7-1.8 0-3.2-.5-4.3-1.5-1.1-1-1.6-2.4-1.6-4 0-1.2.2-2.5.5-3.8l3-12.8H251l1.3-5.8h3.2l.9-3.9 9.9-6.9-2.5 10.8h3.7l-1.3 5.8h-3.7l-2.9 12.5c-.2.6-.2 1.1-.2 1.5 0 .9.6 1.4 1.7 1.4 1.1.1 2.4-.4 4-1.2zm-36.7-9.2h10.8c.1-.4.1-.8.1-1.2 0-1.5-.4-2.6-1.3-3.5-.9-.9-1.9-1.3-3.2-1.3-3-.1-5.1 2-6.4 6zm9.4 8.2l6.2 2.8c-2.7 4.1-6.8 6.1-12.3 6.1-3.8 0-6.8-1.1-9.1-3.2-2.2-2.1-3.4-5-3.4-8.5 0-4.6 1.5-8.5 4.5-11.8 3-3.3 6.7-5 11.2-5 3.4 0 6.3 1.1 8.6 3.3 2.3 2.2 3.5 5.1 3.5 8.8 0 1.2-.1 2.5-.4 3.9h-19.3c-.1.6-.2 1.2-.2 1.8 0 1.7.5 3.1 1.4 4 .9 1 2.2 1.5 3.7 1.5 2.4-.2 4.2-1.4 5.6-3.7zm-42.7 2.3h4.7c2.1 0 3.7-.7 4.8-2.1 1.1-1.4 1.7-3.1 1.7-5 0-1.4-.4-2.5-1.3-3.3-.9-.9-2.1-1.3-3.7-1.3H198l-2.9 11.7zm4-17.3h3.6c4.2 0 6.3-2 6.3-6.1 0-2.5-1.4-3.8-4.2-3.8h-3.5l-2.2 9.9zm-17.8 17h3.9l6.2-26.7h-3.9l1.4-6.1h17.7c3.9 0 6.9.9 9 2.6 2 1.7 3.1 4 3.1 6.9 0 5-3 8.1-8.9 9.3 4 2.3 6 5.3 6 8.9 0 3.4-1.4 6.1-4.1 8.1-2.7 2-5.8 3-9.2 3h-22.6l1.4-6zm-68.9 6l1.4-6h3.7l6.2-26.7H120l1.4-6.1H136l8.9 26.9 4.8-20.8H146l1.4-6.1h14.1l-1.4 6.1h-3.7l-7.6 32.7h-8.7L130 9.6l-5.7 24.9h4.1l-1.5 6h-14.5zm-22.2 0l1.2-5.2h3.7l1.3-5.4H84.8l-.5-6.4 19-22.4h7.5l-5.5 23.8h5.9l-1.2 5h-5.9l-1.3 5.4h3.7l-1.2 5.2H90.2zm7.3-15.6l3.1-14.2-11.7 14.2h8.6zm68.4-23.2l-1.5 6.1h5.1L166 23.3c-1 4.4-2.4 7.1-3.6 8.6-1.5 1.9-3.2 2.5-5.5 2.5-.8 0-1.7-.1-2.7-.3l-1.9 6.4c2.1.6 4.1.9 6.1.9 4 0 7.4-1.2 10.3-3.5 2-1.7 3.7-4.2 5-7.6.5-1.5 1-3.1 1.4-4.9l.9-3.4 3.3-14.4h4.3l1.4-6.1h-19.1z"
fillRule="evenodd"
clipRule="evenodd"
fill="#030303"
/>
</SVG>
);
export const LogoPa = (height, className) => (
<SVG
data-qa-label="logo"
className={className}
viewBox="0 0 298 71.2"
height={height}
>
<path d="M281 70.9l5.4-20H6.7l-5.4 20z" fill="#38AB50" />
<path
d="M37.3 67.5v-13h4.4c2.1 0 3.7.3 4.6.9 1 .6 1.4 1.6 1.4 3 0 1.3-.4 2.3-1.3 3-.9.7-2.2 1-3.9 1h-2.2v5h-3zm3-7.2h1.5c1 0 1.7-.1 2.1-.4.4-.3.6-.8.6-1.4 0-.6-.2-1.1-.6-1.4-.4-.3-1.1-.4-2.1-.4h-1.5v3.6zm11.5.6c0-2.1.6-3.7 1.9-4.9 1.3-1.2 3-1.8 5.2-1.8s3.9.6 5.2 1.8c1.3 1.2 1.9 2.8 1.9 4.9 0 2.1-.6 3.8-1.9 5-1.3 1.2-3 1.8-5.2 1.8s-4-.6-5.3-1.8c-1.1-1.2-1.8-2.8-1.8-5zm3.4.1c0 1.6.3 2.8 1 3.6.6.8 1.6 1.2 2.8 1.2 1.2 0 2.2-.4 2.8-1.2.6-.8 1-2 1-3.6s-.3-2.7-1-3.6c-.6-.8-1.6-1.2-2.8-1.2-1.2 0-2.2.4-2.8 1.2-.7.8-1 2-1 3.6zm14.5-6.5h3.5l2.2 10.2 3-10.2H82l2.6 10.2L87 54.5h3l-3.7 13.1h-3.6l-2.7-10-2.9 10h-3.6l-3.8-13.1zm24.4 13v-13h9.9v2.2h-6.7v3.1h6.3v2.1h-6.3v3.5h6.9v2.2H94.1zm14.9 0v-13h6.2c1.7 0 3 .3 3.8.8.8.5 1.2 1.4 1.2 2.5 0 .9-.2 1.6-.7 2.2-.5.5-1.2.9-2.2 1.1.8.1 1.4.3 1.8.7.4.4.6 1 .7 1.8l.3 1.9c.1.5.2 1 .3 1.3.1.4.3.6.5.9h-3.5l-.3-.6c-.1-.2-.1-.6-.2-1l-.2-2c-.1-.8-.2-1.3-.4-1.4-.2-.2-.7-.2-1.5-.2H112v5.3h-3zm3.2-7.4h1.9c1.2 0 2-.1 2.4-.4.4-.3.7-.7.7-1.4s-.2-1.2-.6-1.5c-.4-.3-1.2-.4-2.5-.4h-1.9v3.7zm13 7.4v-13h9.9v2.2h-6.7v3.1h6.3v2.1h-6.3v3.5h6.9v2.2h-10.1zm14.9 0v-13h4.7c1.2 0 2.3.1 3 .3.8.2 1.5.4 2.1.8.9.6 1.6 1.3 2.1 2.2.5.9.7 2 .7 3.2 0 2.1-.7 3.8-2 4.9-1.3 1.1-3.3 1.7-5.9 1.7h-4.7zm3.2-2.1h1.6c1.5 0 2.7-.3 3.4-1 .7-.7 1.1-1.8 1.1-3.3 0-1.5-.4-2.7-1.1-3.4-.7-.7-1.8-1.1-3.4-1.1h-1.6v8.8zm22.5 2.1v-13h5.1c2 0 3.4.3 4.3.8.9.5 1.4 1.4 1.4 2.5 0 .7-.2 1.3-.6 1.8-.4.5-1 .8-1.8 1 1 .2 1.8.6 2.3 1.2.5.5.8 1.2.8 2.1 0 .5-.1 1-.3 1.4-.2.4-.4.8-.8 1.1-.5.4-1.1.7-1.8.9-.7.2-1.9.3-3.5.3h-5.1zm3.1-7.7h2.1c1 0 1.7-.1 2-.4.4-.2.6-.7.6-1.2 0-.6-.2-1.1-.6-1.3-.4-.3-1.1-.4-2.1-.4h-2.1v3.3zm0 5.6h2.1c1.3 0 2.2-.1 2.6-.4.4-.3.6-.7.6-1.4s-.2-1.2-.6-1.4c-.4-.3-1.3-.4-2.5-.4H169v3.6zm16.5 2.1v-4.8l-5-8.2h3.4l3.4 5.6 3.1-5.6h3.3l-5 8.2v4.8h-3.2zm23.1 0V56.6h-4.4v-2.1h12v2.1h-4.4v10.9h-3.2zm19.5 0h-3.6l-5.4-13h3.5l3.9 10.2 3.8-10.2h3.3l-5.5 13zm22.8-6.9v6.1c-.8.4-1.7.6-2.7.8-.9.2-2 .3-3.1.3-2.5 0-4.5-.6-5.9-1.7-1.4-1.1-2.1-2.8-2.1-4.9 0-2.2.7-3.9 2.1-5.1 1.4-1.2 3.3-1.8 5.8-1.8 1.8 0 3.3.4 4.3 1.1 1.1.7 1.6 1.7 1.6 2.9v.2h-3c0-.8-.3-1.4-.9-1.8-.5-.4-1.3-.6-2.2-.6-1.4 0-2.4.5-3.2 1.4-.8.9-1.2 2.1-1.2 3.7 0 1.5.4 2.7 1.2 3.5.8.8 2 1.2 3.7 1.2.4 0 .8 0 1.2-.1.4 0 .8-.1 1.2-.2v-2.9h-2.8v-2.1h6zM95.2 0L82.9 45.2H8.2L20.4 0z"
fill="#FFFFFF"
/>
<path
d="M95.2 0L82.9 45.2H8.2l5.1-19.1h12.5v-1.9H13.9l1.3-4.8h18.1v-1.9H15.6l1.3-4.8h25.7v-1.9H17.5L20.4 0h74.8zM65.3 12l14.5 16-3.5 4.9 1.5 1.2 4.5-6.2-15.7-17.2-1.3 1.3zm-5.8 7.9c-.8 11.2 8.4 10.2 8.4 10.2v-1.8c-7.7.2-6.6-8.2-6.6-8.2l-1.8-.2m9.8-12.6l-.5-2.1S39.6 9.9 19.5 38l1.8 1.4c0-.1 17.2-25.3 48-32.1"
fill="#38AB50"
/>
<path
d="M90.6 45.2l2-7.1h4.3l9-31h-5.1l2.1-7.1h19.4c5.4 0 9.5 1.2 12.1 3.5 2.7 2.3 3.9 5.6 3.6 9.9-.3 4.4-2 8.1-5.2 11-3.2 2.9-8.3 4.3-15.1 4.3h-6.6l-2.7 9.4h5.5l-2 7.1H90.6zm22.5-23.6h3.9c2.8 0 5.1-.8 6.7-2.5 1.6-1.7 2.5-3.8 2.7-6.4.2-3.7-1.8-5.6-6-5.6h-3.1l-4.2 14.5z"
fill="#FFFFFF"
/>
<path
d="M121.9 45.2l2.1-7.1h4.4l18.9-31h-4.4l2-7.1h26.2l-2 7.1h-3.9l-.5 31h4.7l-2.1 7.1h-18.9l2.1-7.1h4.2l.4-7.6h-13.7l-4.2 7.6h4.2l-2.1 7.1h-17.4zm33.4-21.1l.5-17.4h-.5l-10.1 17.4h10.1zm16 14h4.5l9-31.1h-4.5l2-7.1h20.5c4.6 0 8 1 10.2 3 2.2 2 3.3 4.7 3.1 8-.3 5.8-4 9.4-10.9 10.8 4.5 2.7 6.6 6.2 6.3 10.4-.2 3.9-2 7.1-5.3 9.4-3.3 2.3-6.9 3.5-10.9 3.5h-26.2l2.2-6.9zm15.9.4h5.4c2.4 0 4.3-.8 5.7-2.5 1.4-1.7 2.2-3.6 2.3-5.8.1-1.6-.4-2.9-1.3-3.9-1-1-2.4-1.5-4.2-1.5h-3.9l-4 13.7zm5.8-20.1h4.2c4.9 0 7.4-2.4 7.7-7.1.2-2.9-1.4-4.4-4.6-4.4h-4L193 18.4zm41.9 17.4l6.9 3.2c-3.4 4.7-8.3 7.1-14.6 7.1-4.4 0-7.8-1.2-10.3-3.7-2.5-2.5-3.6-5.8-3.3-9.9.3-5.3 2.3-9.9 6-13.8 3.7-3.9 8.1-5.8 13.3-5.8 4 0 7.2 1.3 9.8 3.8 2.5 2.5 3.7 5.9 3.4 10.2-.1 1.4-.3 2.9-.7 4.5H223c-.2.7-.3 1.4-.3 2.1-.1 2 .3 3.6 1.3 4.7s2.4 1.7 4.1 1.7c2.8 0 5.1-1.4 6.8-4.1zm-10.4-9.5H237c.1-.5.2-1 .2-1.4.1-1.7-.3-3-1.3-4.1-.9-1-2.2-1.5-3.6-1.5-3.4-.1-6 2.3-7.8 7zm38.7 10.6l-2.1 7.2c-2.8 1.3-5.6 1.9-8.2 1.9-2 0-3.6-.6-4.8-1.8-1.2-1.2-1.7-2.7-1.6-4.6.1-1.4.3-2.9.8-4.4l4.3-14.9h-3.7l1.9-6.7h3.7l1.3-4.6 12-8-3.7 12.6h4.2l-1.9 6.7h-4.2L256.9 35c-.2.7-.3 1.3-.4 1.8-.1 1.1.6 1.7 1.9 1.7 1.3 0 2.9-.5 4.8-1.6zm-.1 8.3l3.2-10.9h6.2c.5 3.6 2.9 5.3 7.1 5.3 4.1 0 6.2-1.1 6.3-3.4 0-.8-.2-1.4-.8-2-.6-.6-2.7-1.3-6.2-2.1-3.6-.8-6-2.1-7.1-3.9-1.2-1.7-1.7-3.4-1.6-5.1.2-2.8 1.5-5.2 4-7 2.5-1.9 5.7-2.8 9.5-2.8 2.9 0 5.3.7 7.2 2l.5-1.7h6.8l-2.6 9.2h-6.5c-.6-2.4-2.4-3.7-5.6-3.7-1.5 0-2.7.3-3.6.8-.9.6-1.4 1.3-1.5 2.2 0 .6.2 1.1.8 1.6.5.4 2.5 1.1 6 1.9 3.4.8 5.8 2 7.1 3.7 1.3 1.6 1.9 3.5 1.7 5.7-.2 3-1.6 5.5-4.3 7.5-2.7 2-6.1 3-10.2 3-3.6 0-6.6-.7-8.7-2.1l-.5 1.8h-7.2z"
fill="#FFFFFF"
/>
</SVG>
);
export const LogoPaBlack = (height, className) => (
<SVG
data-qa-label="logo"
className={className}
viewBox="0 0 298 71.2"
height={height}
>
<path d="M281 70.9l5.4-20H6.7l-5.4 20z" fill="#38AB50" />
<path
d="M37.3 67.5v-13h4.4c2.1 0 3.7.3 4.6.9 1 .6 1.4 1.6 1.4 3 0 1.3-.4 2.3-1.3 3-.9.7-2.2 1-3.9 1h-2.2v5h-3zm3-7.2h1.5c1 0 1.7-.1 2.1-.4.4-.3.6-.8.6-1.4 0-.6-.2-1.1-.6-1.4-.4-.3-1.1-.4-2.1-.4h-1.5v3.6zm11.5.6c0-2.1.6-3.7 1.9-4.9 1.3-1.2 3-1.8 5.2-1.8s3.9.6 5.2 1.8c1.3 1.2 1.9 2.8 1.9 4.9 0 2.1-.6 3.8-1.9 5-1.3 1.2-3 1.8-5.2 1.8s-4-.6-5.3-1.8c-1.1-1.2-1.8-2.8-1.8-5zm3.4.1c0 1.6.3 2.8 1 3.6.6.8 1.6 1.2 2.8 1.2 1.2 0 2.2-.4 2.8-1.2.6-.8 1-2 1-3.6s-.3-2.7-1-3.6c-.6-.8-1.6-1.2-2.8-1.2-1.2 0-2.2.4-2.8 1.2-.7.8-1 2-1 3.6zm14.5-6.5h3.5l2.2 10.2 3-10.2H82l2.6 10.2L87 54.5h3l-3.7 13.1h-3.6l-2.7-10-2.9 10h-3.6l-3.8-13.1zm24.4 13v-13h9.9v2.2h-6.7v3.1h6.3v2.1h-6.3v3.5h6.9v2.2H94.1zm14.9 0v-13h6.2c1.7 0 3 .3 3.8.8.8.5 1.2 1.4 1.2 2.5 0 .9-.2 1.6-.7 2.2-.5.5-1.2.9-2.2 1.1.8.1 1.4.3 1.8.7.4.4.6 1 .7 1.8l.3 1.9c.1.5.2 1 .3 1.3.1.4.3.6.5.9h-3.5l-.3-.6c-.1-.2-.1-.6-.2-1l-.2-2c-.1-.8-.2-1.3-.4-1.4-.2-.2-.7-.2-1.5-.2H112v5.3h-3zm3.2-7.4h1.9c1.2 0 2-.1 2.4-.4.4-.3.7-.7.7-1.4s-.2-1.2-.6-1.5c-.4-.3-1.2-.4-2.5-.4h-1.9v3.7zm13 7.4v-13h9.9v2.2h-6.7v3.1h6.3v2.1h-6.3v3.5h6.9v2.2h-10.1zm14.9 0v-13h4.7c1.2 0 2.3.1 3 .3.8.2 1.5.4 2.1.8.9.6 1.6 1.3 2.1 2.2.5.9.7 2 .7 3.2 0 2.1-.7 3.8-2 4.9-1.3 1.1-3.3 1.7-5.9 1.7h-4.7zm3.2-2.1h1.6c1.5 0 2.7-.3 3.4-1 .7-.7 1.1-1.8 1.1-3.3 0-1.5-.4-2.7-1.1-3.4-.7-.7-1.8-1.1-3.4-1.1h-1.6v8.8zm22.5 2.1v-13h5.1c2 0 3.4.3 4.3.8.9.5 1.4 1.4 1.4 2.5 0 .7-.2 1.3-.6 1.8-.4.5-1 .8-1.8 1 1 .2 1.8.6 2.3 1.2.5.5.8 1.2.8 2.1 0 .5-.1 1-.3 1.4-.2.4-.4.8-.8 1.1-.5.4-1.1.7-1.8.9-.7.2-1.9.3-3.5.3h-5.1zm3.1-7.7h2.1c1 0 1.7-.1 2-.4.4-.2.6-.7.6-1.2 0-.6-.2-1.1-.6-1.3-.4-.3-1.1-.4-2.1-.4h-2.1v3.3zm0 5.6h2.1c1.3 0 2.2-.1 2.6-.4.4-.3.6-.7.6-1.4s-.2-1.2-.6-1.4c-.4-.3-1.3-.4-2.5-.4H169v3.6zm16.5 2.1v-4.8l-5-8.2h3.4l3.4 5.6 3.1-5.6h3.3l-5 8.2v4.8h-3.2zm23.1 0V56.6h-4.4v-2.1h12v2.1h-4.4v10.9h-3.2zm19.5 0h-3.6l-5.4-13h3.5l3.9 10.2 3.8-10.2h3.3l-5.5 13zm22.8-6.9v6.1c-.8.4-1.7.6-2.7.8-.9.2-2 .3-3.1.3-2.5 0-4.5-.6-5.9-1.7-1.4-1.1-2.1-2.8-2.1-4.9 0-2.2.7-3.9 2.1-5.1 1.4-1.2 3.3-1.8 5.8-1.8 1.8 0 3.3.4 4.3 1.1 1.1.7 1.6 1.7 1.6 2.9v.2h-3c0-.8-.3-1.4-.9-1.8-.5-.4-1.3-.6-2.2-.6-1.4 0-2.4.5-3.2 1.4-.8.9-1.2 2.1-1.2 3.7 0 1.5.4 2.7 1.2 3.5.8.8 2 1.2 3.7 1.2.4 0 .8 0 1.2-.1.4 0 .8-.1 1.2-.2v-2.9h-2.8v-2.1h6zM95.2 0L82.9 45.2H8.2L20.4 0z"
fill="#FFFFFF"
/>
<path
d="M95.2 0L82.9 45.2H8.2l5.1-19.1h12.5v-1.9H13.9l1.3-4.8h18.1v-1.9H15.6l1.3-4.8h25.7v-1.9H17.5L20.4 0h74.8zM65.3 12l14.5 16-3.5 4.9 1.5 1.2 4.5-6.2-15.7-17.2-1.3 1.3zm-5.8 7.9c-.8 11.2 8.4 10.2 8.4 10.2v-1.8c-7.7.2-6.6-8.2-6.6-8.2l-1.8-.2m9.8-12.6l-.5-2.1S39.6 9.9 19.5 38l1.8 1.4c0-.1 17.2-25.3 48-32.1"
fill="#38AB50"
/>
<path
d="M90.6 45.2l2-7.1h4.3l9-31h-5.1l2.1-7.1h19.4c5.4 0 9.5 1.2 12.1 3.5 2.7 2.3 3.9 5.6 3.6 9.9-.3 4.4-2 8.1-5.2 11-3.2 2.9-8.3 4.3-15.1 4.3h-6.6l-2.7 9.4h5.5l-2 7.1H90.6zm22.5-23.6h3.9c2.8 0 5.1-.8 6.7-2.5 1.6-1.7 2.5-3.8 2.7-6.4.2-3.7-1.8-5.6-6-5.6h-3.1l-4.2 14.5z"
fill="#030303"
/>
<path
d="M121.9 45.2l2.1-7.1h4.4l18.9-31h-4.4l2-7.1h26.2l-2 7.1h-3.9l-.5 31h4.7l-2.1 7.1h-18.9l2.1-7.1h4.2l.4-7.6h-13.7l-4.2 7.6h4.2l-2.1 7.1h-17.4zm33.4-21.1l.5-17.4h-.5l-10.1 17.4h10.1zm16 14h4.5l9-31.1h-4.5l2-7.1h20.5c4.6 0 8 1 10.2 3 2.2 2 3.3 4.7 3.1 8-.3 5.8-4 9.4-10.9 10.8 4.5 2.7 6.6 6.2 6.3 10.4-.2 3.9-2 7.1-5.3 9.4-3.3 2.3-6.9 3.5-10.9 3.5h-26.2l2.2-6.9zm15.9.4h5.4c2.4 0 4.3-.8 5.7-2.5 1.4-1.7 2.2-3.6 2.3-5.8.1-1.6-.4-2.9-1.3-3.9-1-1-2.4-1.5-4.2-1.5h-3.9l-4 13.7zm5.8-20.1h4.2c4.9 0 7.4-2.4 7.7-7.1.2-2.9-1.4-4.4-4.6-4.4h-4L193 18.4zm41.9 17.4l6.9 3.2c-3.4 4.7-8.3 7.1-14.6 7.1-4.4 0-7.8-1.2-10.3-3.7-2.5-2.5-3.6-5.8-3.3-9.9.3-5.3 2.3-9.9 6-13.8 3.7-3.9 8.1-5.8 13.3-5.8 4 0 7.2 1.3 9.8 3.8 2.5 2.5 3.7 5.9 3.4 10.2-.1 1.4-.3 2.9-.7 4.5H223c-.2.7-.3 1.4-.3 2.1-.1 2 .3 3.6 1.3 4.7s2.4 1.7 4.1 1.7c2.8 0 5.1-1.4 6.8-4.1zm-10.4-9.5H237c.1-.5.2-1 .2-1.4.1-1.7-.3-3-1.3-4.1-.9-1-2.2-1.5-3.6-1.5-3.4-.1-6 2.3-7.8 7zm38.7 10.6l-2.1 7.2c-2.8 1.3-5.6 1.9-8.2 1.9-2 0-3.6-.6-4.8-1.8-1.2-1.2-1.7-2.7-1.6-4.6.1-1.4.3-2.9.8-4.4l4.3-14.9h-3.7l1.9-6.7h3.7l1.3-4.6 12-8-3.7 12.6h4.2l-1.9 6.7h-4.2L256.9 35c-.2.7-.3 1.3-.4 1.8-.1 1.1.6 1.7 1.9 1.7 1.3 0 2.9-.5 4.8-1.6zm-.1 8.3l3.2-10.9h6.2c.5 3.6 2.9 5.3 7.1 5.3 4.1 0 6.2-1.1 6.3-3.4 0-.8-.2-1.4-.8-2-.6-.6-2.7-1.3-6.2-2.1-3.6-.8-6-2.1-7.1-3.9-1.2-1.7-1.7-3.4-1.6-5.1.2-2.8 1.5-5.2 4-7 2.5-1.9 5.7-2.8 9.5-2.8 2.9 0 5.3.7 7.2 2l.5-1.7h6.8l-2.6 9.2h-6.5c-.6-2.4-2.4-3.7-5.6-3.7-1.5 0-2.7.3-3.6.8-.9.6-1.4 1.3-1.5 2.2 0 .6.2 1.1.8 1.6.5.4 2.5 1.1 6 1.9 3.4.8 5.8 2 7.1 3.7 1.3 1.6 1.9 3.5 1.7 5.7-.2 3-1.6 5.5-4.3 7.5-2.7 2-6.1 3-10.2 3-3.6 0-6.6-.7-8.7-2.1l-.5 1.8h-7.2z"
fill="#030303"
/>
</SVG>
);
export const LogoIa = (height, className) => (
<SVG
data-qa-label="logo"
className={className}
viewBox="0 0 298 91.5"
height={height}
>
<g fill="none" fillRule="evenodd">
<polygon
fill="#FFF"
fillRule="nonzero"
points="15 .2 1.8 49.4 79.2 49.3 92.5 .1"
/>
<polygon
fill="#38AB50"
fillRule="nonzero"
points="14.8 .1 11.7 11.7 38.4 11.7 38.4 14.9 10.8 14.9 9.7 19.1 28.2 19.1 28.2 22.3 8.8 22.3 7.7 26.3 20 26.3 20 29.6 6.9 29.6 1.5 49.3 82.2 49.3 95.5 .1"
/>
<path
fill="#FFF"
fillRule="nonzero"
d="M15.2 42.9L13.2 41.4C35.1 10.8 66.9 5.7 66.9 5.7L67.4 8C33.9 15.4 15.2 42.9 15.2 42.9L15.2 42.9zM56.7 21.8L58.6 22C58.6 22 57.5 31.2 65.8 31L65.8 33C65.8 32.9 55.8 33.9 56.7 21.8L56.7 21.8zM76.6 37.2L75 35.9 78.8 30.6 63.1 13.2 64.5 11.7 81.4 30.4 76.6 37.2zM262.7 11.6C265.6 11.6 268 11.9 269.9 12.7 271.7 13.5 273 15 273 17.3L297.9 17.3C299.2 5.5 289 0 264.4 0 259.3 0 253.9.4 248.7 1.5L212.5 1.5 192.6 30.9 192.4 30.9 187.7 1.5 106.8 1.5 103.8 13.1 125.4 13.1 116.5 47.3 138.7 47.3 147.6 13.1 166.9 13.1 176.8 47.3 200 47.3 225.8 15.3C224 17.9 222.6 21 221.7 24.5 216.2 45.6 236.5 48.8 252 48.8 264.7 48.8 272.3 47.2 279.1 43L280.5 47.2 290 47.2 296.8 21.1 265.4 21.1 262.5 31.7 271.6 31.7C269.1 35.1 264.9 37.4 257.7 37.4 246.8 37.4 242.4 32.9 244.6 24.5 247 15.3 253.7 11.6 262.7 11.6"
/>
<path
fill="#FFF"
d="M136.437512 67.1271021L140.721029 67.1271021 147.063639 85.7942166 153.36116 67.1271021 157.599587 67.1271021 157.599587 89.206 154.758939 89.206 154.758939 76.1750916C154.758939 75.7241929 154.768959 74.9777161 154.788999 73.9356391 154.809039 72.893562 154.819059 71.7763519 154.819059 70.5839752L148.521538 89.206 145.560651 89.206 139.218041 70.5839752 139.218041 71.2603199C139.218041 71.8013984 139.230565 72.6255287 139.255615 73.7327356 139.280665 74.8399425 139.29319 75.6540531 139.29319 76.1750916L139.29319 89.206 136.437512 89.206 136.437512 67.1271021zM162.43921 67.1271021L178.536214 67.1271021 178.536214 69.8324811 165.355007 69.8324811 165.355007 76.5358088 177.544242 76.5358088 177.544242 79.0908889 165.355007 79.0908889 165.355007 86.5757705 178.761662 86.5757705 178.761662 89.206 162.43921 89.206 162.43921 67.1271021zM194.016993 80.1580105L190.665329 70.4036166 187.103247 80.1580105 194.016993 80.1580105zM189.102222 67.1271021L192.483945 67.1271021 200.494873 89.206 197.218358 89.206 194.978906 82.5928516 186.246544 82.5928516 183.856793 89.206 180.790696 89.206 189.102222 67.1271021zM211.692136 86.6509199C212.704153 86.6509199 213.535798 86.5457118 214.187096 86.3352924 215.349413 85.9445135 216.301296 85.1930269 217.042774 84.08081 217.633952 83.1890325 218.059795 82.0467728 218.320314 80.6539967 218.470613 79.822339 218.545762 79.0508127 218.545762 78.3393947 218.545762 75.6039424 218.002187 73.4797402 216.91502 71.9667244 215.827853 70.4537086 214.076889 69.6972121 211.662076 69.6972121L206.356527 69.6972121 206.356527 86.6509199 211.692136 86.6509199zM203.350551 67.1271021L212.293331 67.1271021C215.329382 67.1271021 217.68404 68.204233 219.357376 70.358527 220.850352 72.3024015 221.596828 74.7923272 221.596828 77.8283787 221.596828 80.1730522 221.155956 82.2922444 220.274199 84.1860191 218.721103 87.5326898 216.050821 89.206 212.263271 89.206L203.350551 89.206 203.350551 67.1271021zM243.630637 70.2833775C245.093552 72.2372721 245.824999 74.7372176 245.824999 77.7832891 245.824999 81.0798598 244.988344 83.8202811 243.315009 86.004635 241.351094 88.5697478 238.550554 89.852285 234.913304 89.852285 231.516534 89.852285 228.846252 88.7300649 226.902377 86.4855912 225.168922 84.3212773 224.302207 81.5858659 224.302207 78.2792752 224.302207 75.2933235 225.043674 72.738269 226.52663 70.614035 228.430425 67.8886026 231.245994 66.5259068 234.973424 66.5259068 238.871193 66.5259068 241.756902 67.7783845 243.630637 70.2833775zM240.992892 84.3438329C242.170239 82.4550682 242.758903 80.2832718 242.758903 77.8283787 242.758903 75.233206 242.08006 73.1440732 240.722354 71.5609176 239.364648 69.977762 237.508476 69.1861961 235.153783 69.1861961 232.869229 69.1861961 231.005542 69.9702471 229.562666 71.5383728 228.11979 73.1064984 227.398363 75.4185722 227.398363 78.4746637 227.398363 80.9195368 228.017087 82.9811151 229.254554 84.6594604 230.49202 86.3378058 232.498489 87.1769658 235.274022 87.1769658 237.909274 87.1769658 239.815545 86.2325976 240.992892 84.3438329zM250.84498 67.1271021L255.008258 85.0878121 259.998179 67.1271021 263.244634 67.1271021 268.234555 85.0878121 272.397832 67.1271021 275.674347 67.1271021 269.872812 89.206 266.731566 89.206 261.636436 70.8996027 256.511246 89.206 253.370001 89.206 247.598526 67.1271021 250.84498 67.1271021zM280.39373 82.0818355C280.46387 83.334332 280.759454 84.3513439 281.280493 85.1329018 282.27247 86.5958177 284.020929 87.3272646 286.525922 87.3272646 287.648159 87.3272646 288.670181 87.1669475 289.592018 86.8463084 291.375573 86.2250701 292.267337 85.1128699 292.267337 83.5096744 292.267337 82.3072778 291.891594 81.450583 291.140096 80.9395645 290.378578 80.4385659 289.186219 80.0027036 287.562984 79.6319646L284.572037 78.9556199C282.618143 78.5147412 281.235407 78.0287798 280.42379 77.4977213 279.020994 76.5758839 278.319606 75.1981584 278.319606 73.3645035 278.319606 71.3805491 279.005964 69.752328 280.3787 68.4797916 281.751436 67.2072552 283.695282 66.5709965 286.210295 66.5709965 288.524908 66.5709965 290.491298 67.1296015 292.109524 68.2468284 293.727749 69.3640553 294.53685 71.1500885 294.53685 73.6049816L291.726262 73.6049816C291.575962 72.4226249 291.255328 71.5158311 290.764349 70.8845729 289.852532 69.7322761 288.304469 69.1561363 286.120115 69.1561363 284.3566 69.1561363 283.089093 69.5268697 282.317555 70.2683477 281.546017 71.0098256 281.160254 71.8715302 281.160254 72.8534875 281.160254 73.9356445 281.611146 74.7272104 282.512943 75.228209 283.104122 75.5488481 284.441768 75.949641 286.525922 76.4305996L289.622078 77.1370041C291.115054 77.4776831 292.267333 77.9436049 293.078951 78.5347832 294.481747 79.5668403 295.183135 81.0648037 295.183135 83.0287182 295.183135 85.4735913 294.293875 87.2220502 292.51533 88.2741473 290.736785 89.3262443 288.670197 89.852285 286.315504 89.852285 283.570031 89.852285 281.42078 89.1508974 279.867684 87.7481014 278.314588 86.3553253 277.553082 84.4665889 277.583142 82.0818355L280.39373 82.0818355zM1.02022949 67.1271021L10.954982 67.1271021C12.9188965 67.1271021 14.5020284 67.6806973 15.704425 68.7879042 16.9068216 69.8951111 17.5080109 71.4506884 17.5080109 73.4546828 17.5080109 75.178118 16.9719505 76.6785863 15.8998135 77.9561327 14.8276765 79.2336791 13.1794158 79.8724428 10.954982 79.8724428L4.01117617 79.8724428 4.01117617 89.206 1.02022949 89.206 1.02022949 67.1271021zM12.6834186 70.1631385C12.0221004 69.8525193 11.1153065 69.6972121 9.96300977 69.6972121L4.01117617 69.6972121 4.01117617 77.3474225 9.96300977 77.3474225C11.305686 77.3474225 12.3953416 77.0618575 13.2320093 76.4907191 14.0686769 75.9195807 14.4870045 74.9125887 14.4870045 73.4697127 14.4870045 71.8464772 13.8858152 70.7442969 12.6834186 70.1631385zM31.5308916 77.2422133C32.9336877 77.2422133 34.0433829 76.9616583 34.8600106 76.4005398 35.6766384 75.8394214 36.0849461 74.8274194 36.0849461 73.3645035 36.0849461 71.7913679 35.5138163 70.719247 34.3715395 70.1481086 33.7603212 69.8475094 32.9437057 69.6972121 31.9216686 69.6972121L24.6171455 69.6972121 24.6171455 77.2422133 31.5308916 77.2422133zM21.6261988 67.1271021L31.8465191 67.1271021C33.5298744 67.1271021 34.9176197 67.3725878 36.0097967 67.8635664 38.0839309 68.8054438 39.1209824 70.5438828 39.1209824 73.0789357 39.1209824 74.401572 38.8479423 75.4837128 38.3018538 76.3253904 37.7557653 77.1670681 36.9917539 77.843406 36.0097967 78.3544246 36.8715143 78.7051236 37.5202977 79.1660354 37.9561665 79.7371738 38.3920353 80.3083122 38.635016 81.2351457 38.6851158 82.5177021L38.790325 85.4785891C38.8203849 86.3202667 38.8905237 86.9465056 39.0007434 87.3573244 39.1811029 88.0587225 39.5017371 88.5096144 39.9626559 88.7100139L39.9626559 89.206 36.2953645 89.206C36.1951647 89.0156205 36.1150062 88.7701349 36.0548863 88.4695357 35.9947665 88.1689366 35.9446674 87.5877869 35.9045875 86.7260693L35.7242289 83.043748C35.6540891 81.6008721 35.1180286 80.6339593 34.1160314 80.1429807 33.544893 79.8724414 32.648119 79.7371738 31.4256824 79.7371738L24.6171455 79.7371738 24.6171455 89.206 21.6261988 89.206 21.6261988 67.1271021zM54.82721 80.1580105L51.4755461 70.4036166 47.9134639 80.1580105 54.82721 80.1580105zM49.9124383 67.1271021L53.2941619 67.1271021 61.3050895 89.206 58.028575 89.206 55.7891225 82.5928516 47.0567605 82.5928516 44.6670092 89.206 41.6009131 89.206 49.9124383 67.1271021zM64.701843 67.1271021L67.7228494 67.1271021 67.7228494 89.206 64.701843 89.206 64.701843 67.1271021zM82.8429115 77.2422133C84.2457076 77.2422133 85.3554029 76.9616583 86.1720306 76.4005398 86.9886583 75.8394214 87.396966 74.8274194 87.396966 73.3645035 87.396966 71.7913679 86.8258362 70.719247 85.6835594 70.1481086 85.0723411 69.8475094 84.2557256 69.6972121 83.2336885 69.6972121L75.9291654 69.6972121 75.9291654 77.2422133 82.8429115 77.2422133zM72.9382187 67.1271021L83.1585391 67.1271021C84.8418944 67.1271021 86.2296397 67.3725878 87.3218166 67.8635664 89.3959508 68.8054438 90.4330023 70.5438828 90.4330023 73.0789357 90.4330023 74.401572 90.1599622 75.4837128 89.6138737 76.3253904 89.0677853 77.1670681 88.3037739 77.843406 87.3218166 78.3544246 88.1835342 78.7051236 88.8323176 79.1660354 89.2681864 79.7371738 89.7040552 80.3083122 89.9470359 81.2351457 89.9971357 82.5177021L90.1023449 85.4785891C90.1324048 86.3202667 90.2025436 86.9465056 90.3127633 87.3573244 90.4931228 88.0587225 90.8137571 88.5096144 91.2746758 88.7100139L91.2746758 89.206 87.6073844 89.206C87.5071847 89.0156205 87.4270261 88.7701349 87.3669062 88.4695357 87.3067864 88.1689366 87.2566873 87.5877869 87.2166074 86.7260693L87.0362488 83.043748C86.966109 81.6008721 86.4300486 80.6339593 85.4280514 80.1429807 84.856913 79.8724414 83.9601389 79.7371738 82.7377023 79.7371738L75.9291654 79.7371738 75.9291654 89.206 72.9382187 89.206 72.9382187 67.1271021zM95.483043 67.1271021L98.5040494 67.1271021 98.5040494 89.206 95.483043 89.206 95.483043 67.1271021zM103.644269 67.1271021L119.741274 67.1271021 119.741274 69.8324811 106.560067 69.8324811 106.560067 76.5358088 118.749302 76.5358088 118.749302 79.0908889 106.560067 79.0908889 106.560067 86.5757705 119.966722 86.5757705 119.966722 89.206 103.644269 89.206 103.644269 67.1271021z"
/>
</g>
</SVG>
);
export const LogoOnTVG = (height, className) => (
<SVG
data-qa-label="logo-onTVG"
className={className}
viewBox="0 0 36 9"
height={height}
>
<path
d="M29.4 2.1c-1.6 0-2.9.7-3.3 2.4-.4 1.6.4 2.4 2.4 2.4 1.4 0 2.1-.5 2.6-1h-1.7l.5-2h5.8l-1.2 4.8h-1.8l-.2-.8a9 9 0 0 1-5 1.1c-3 0-6.7-.6-5.7-4.5a5.4 5.4 0 0 1 .8-1.7l-4.8 6h-4.3l-1.8-6.4H8L6.5 8.7H2.4L4 2.4H0L.6.3h15l.8 5.4L20.2.3h6.7a14.2 14.2 0 0 1 3-.3c4.5 0 6.4 1 6.2 3.2h-4.6c0-.5-.3-.7-.6-.9l-1.4-.2z"
fill="#BFC4C8"
fillRule="evenodd"
/>
</SVG>
);
export const LogoOnTVG2 = (height, className) => (
<SVG
data-qa-label="logo-onTVG2"
className={className}
viewBox="0 0 47 9"
height={height}
>
<path
d="M29.4 2.1c-1.6 0-2.9.7-3.3 2.4-.4 1.6.4 2.4 2.4 2.4 1.4 0 2.1-.5 2.6-1h-1.7l.5-2h5.8l-1.2 4.8h-1.8l-.2-.8a9 9 0 0 1-5 1.1c-3 0-6.7-.6-5.7-4.5a5.4 5.4 0 0 1 .8-1.7l-4.8 6h-4.3l-1.8-6.4H8L6.5 8.7H2.4L4 2.4H0L.6.3h15l.8 5.4L20.2.3h6.7a14.2 14.2 0 0 1 3-.3c4.5 0 6.4 1 6.2 3.2h-4.6c0-.5-.3-.7-.6-.9l-1.4-.2zm16.1 6.6H36v-.3c.2-1 .8-1.4 2-2.2.8-.6 1.8-1 2.6-1.4 1.4-.6 2.5-1.2 2.7-2a.3.3 0 0 0 0-.2c-.2-.2-.5-.3-.9-.3-1.2 0-1.6.8-1.7 1.5v.1h-3.4l.1-.2C38 1.2 39.9 0 43 0c1.7 0 3 .4 3.6 1.2.4.5.5 1.1.3 1.8-.3 1.5-1.8 2.2-3.3 2.8l-.3.1-1.1.5-.3.1H46l-.6 2.2z"
fill="#BFC4C8"
fillRule="evenodd"
/>
</SVG>
);
export const LogoFDTV = (height = 14, className = "") => (
<SVG
data-qa-label="logo-FDTV"
className={className}
viewBox="0 0 44 14"
height={height}
>
<path
d="M22.1138 6.47165H19.2872V4.99605H22.6751C22.7582 4.99605 22.8117 4.96198 22.8412 4.88451L23.3392 3.52044C23.3636 3.45744 23.3101 3.38464 23.2415 3.38464H17.701C17.6278 3.38464 17.579 3.43318 17.579 3.50598V10.5447C17.579 10.6175 17.6278 10.6661 17.701 10.6661H19.1652C19.2384 10.6661 19.2872 10.6175 19.2872 10.5447V8.06438H21.5572C21.6403 8.06438 21.6938 8.03032 21.7234 7.94772L22.2114 6.60791C22.2358 6.54491 22.1823 6.47165 22.1138 6.47165Z"
fill="#99A0A7"
/>
<path
d="M6.04926 10.3946C6.02767 10.2537 5.98027 10.1674 5.90049 10.0843C5.20311 9.39131 4.57144 8.56438 4.04864 7.66138C4.62963 7.39771 5.15618 7.23158 5.69728 7.12704C5.79537 7.10884 5.8423 7.05097 5.84981 6.96464C5.88266 6.20304 5.96619 5.44844 6.08962 4.70457C6.10041 4.6215 6.05677 4.54917 5.95164 4.56364C4.97832 4.67937 3.98716 4.94257 3.04669 5.37611C2.85052 4.7335 2.70175 4.0657 2.61446 3.38297C3.82009 2.88457 5.13413 2.58123 6.48524 2.51263C6.57957 2.5089 6.634 2.4655 6.65935 2.37917C6.8879 1.64603 7.17839 0.913365 7.52708 0.194698C7.57072 0.104631 7.53083 0.00709781 7.4182 0.00336447C4.89103 -0.0507689 2.37465 0.548432 0.137974 1.79443C0.0398905 1.84857 0 1.93537 0 2.05063C0.0436448 6.84937 2.58537 11.4236 6.79732 13.9731C6.85551 14.009 6.91699 14.009 6.95688 13.9731C6.99302 13.9371 6.99302 13.8937 6.96768 13.8321C6.54672 12.7233 6.23088 11.5534 6.04926 10.3946Z"
fill="#99A0A7"
/>
<path
d="M14.0231 1.79409C12.4181 0.902291 10.6174 0.306357 8.7144 0.0935562C8.62007 0.0828229 8.55108 0.115023 8.51119 0.194823C8.16626 0.866357 7.86122 1.58876 7.59606 2.35409C7.57072 2.43716 7.62891 2.51276 7.71245 2.52023C9.07764 2.59256 10.363 2.89589 11.5504 3.38309C11.158 6.48457 9.52441 9.21084 7.1934 11.0378C7.11738 11.0957 7.09532 11.1713 7.11738 11.2688C7.28069 12.002 7.50971 12.7598 7.78894 13.5074C7.82179 13.5905 7.91612 13.6194 7.98886 13.569C11.8413 10.9403 14.1287 6.5933 14.1615 2.05123C14.1644 1.93503 14.1207 1.84823 14.0231 1.79409Z"
fill="#99A0A7"
/>
<path
d="M26.6774 3.38464H24.0756C24.0024 3.38464 23.9536 3.43318 23.9536 3.50598V4.87471C23.9536 4.94751 24.0024 4.99605 24.0756 4.99605H26.6774C27.8394 4.99605 28.7179 5.86965 28.7179 7.02512C28.7179 8.18058 27.8394 9.05418 26.6774 9.05418H25.6619V5.80665C25.6619 5.73385 25.6131 5.68531 25.5398 5.68531H25.286C24.9589 5.68531 24.5928 5.84071 24.3586 6.07358C24.1 6.33071 23.9536 6.68538 23.9536 7.14132V10.5443C23.9536 10.6171 24.0024 10.6656 24.0756 10.6656H26.6774C28.8202 10.6656 30.4267 9.10272 30.4267 7.02512C30.4267 4.94751 28.8207 3.38464 26.6774 3.38464Z"
fill="#99A0A7"
/>
<path
d="M37.0173 3.38555H38.5131C38.5131 3.38555 38.6143 3.3816 38.6554 3.50398L40.0404 8.51632L41.4253 3.50398C41.4613 3.38124 41.5676 3.38519 41.5676 3.38519H43.0607C43.0607 3.38519 43.1985 3.37299 43.1597 3.50398L41.0975 10.5398C41.0975 10.5398 41.0588 10.6658 40.9545 10.6658H39.1099C38.9986 10.6658 38.9655 10.5394 38.9655 10.5394L36.9213 3.50291C36.8833 3.3694 37.0173 3.38555 37.0173 3.38555Z"
fill="#99A0A7"
/>
<path
d="M34.2819 10.6658H32.8416C32.704 10.6658 32.7183 10.5398 32.7183 10.5398V4.99568H30.9562C30.824 4.99568 30.8358 4.86899 30.8358 4.86899V3.50333C30.8358 3.38345 30.9562 3.38489 30.9562 3.38489H35.7524C35.7818 3.38489 35.8807 3.38274 35.9169 3.50333L36.3189 4.86899C36.3332 4.91672 36.3343 5.00107 36.1981 4.99568H34.4034V10.5398C34.4027 10.5398 34.4224 10.6658 34.2819 10.6658Z"
fill="#99A0A7"
/>
</SVG>
);
export const LogoFanduelTV = () => (
<svg data-qa-label="logo-FanduelTV" viewBox="0 0 111 94" height="55px">
<path
d="M48.9269 93.8292H45.5491C45.227 93.8292 45.2607 93.535 45.2607 93.535V80.5689H41.1266C40.8168 80.5689 40.8444 80.2717 40.8444 80.2717V77.0777C40.8444 76.7973 41.1266 76.8004 41.1266 76.8004H52.7711C52.8401 76.8004 53.0717 76.7958 53.1561 77.0777L54.0995 80.2717C54.1333 80.3835 54.1363 80.5812 53.8157 80.5689H49.2122V93.535C49.2107 93.535 49.2567 93.8292 48.9269 93.8292Z"
fill="white"
/>
<path
d="M55.6443 76.8004H59.2491C59.2491 76.8004 59.493 76.7912 59.5912 77.0777L62.9292 88.7999L66.2671 77.0777C66.353 76.7912 66.6092 76.8004 66.6092 76.8004H70.2064C70.2064 76.8004 70.5377 76.7728 70.4441 77.0777L65.474 93.5335C65.474 93.5335 65.3805 93.8276 65.1289 93.8276H60.6834C60.415 93.8276 60.3352 93.5319 60.3352 93.5319L55.4096 77.0761C55.3221 76.7636 55.6443 76.8004 55.6443 76.8004Z"
fill="white"
/>
<path
d="M11.2262 61.227H4.71293V57.8123H12.5194C12.7111 57.8123 12.8338 57.7342 12.9013 57.5534L14.0487 54.3977C14.1055 54.2522 13.9812 54.0836 13.8232 54.0836H1.05745C0.888714 54.0836 0.776733 54.1955 0.776733 54.364V70.6513C0.776733 70.8198 0.888714 70.9317 1.05745 70.9317H4.43221C4.60095 70.9317 4.71293 70.8198 4.71293 70.6513V64.9112H9.9438C10.1356 64.9112 10.2583 64.8331 10.3258 64.6416L11.4502 61.541C11.5069 61.3955 11.3842 61.227 11.2262 61.227Z"
fill="white"
/>
<path
d="M23.205 54.341C23.1375 54.1618 23.0133 54.0821 22.8231 54.0821H18.3009C18.1092 54.0821 17.9864 54.1603 17.9189 54.341L12.0024 70.6176C11.9456 70.7631 12.0699 70.9317 12.2279 70.9317H15.7591C15.9508 70.9317 16.0736 70.8413 16.1303 70.662L17.267 67.3822H23.8125L24.9492 70.662C25.0167 70.8413 25.1287 70.9317 25.3204 70.9317H28.8976C29.0556 70.9317 29.1784 70.7631 29.1231 70.6176L23.205 54.341ZM18.5249 63.7102L20.5374 57.892L22.5516 63.7102H18.5249Z"
fill="white"
/>
<path
d="M44.8664 70.9317C45.0351 70.9317 45.1471 70.8198 45.1471 70.6513V54.364C45.1471 54.1955 45.0351 54.0836 44.8664 54.0836H41.5591C41.3904 54.0836 41.2784 54.1955 41.2784 54.364V64.3046L35.4078 54.3303C35.3066 54.1511 35.1823 54.0836 34.9799 54.0836H31.0544C30.8857 54.0836 30.7737 54.1955 30.7737 54.364V70.6513C30.7737 70.8198 30.8857 70.9317 31.0544 70.9317H34.3617C34.5304 70.9317 34.6424 70.8198 34.6424 70.6513V60.631L40.5589 70.685C40.6602 70.8642 40.7844 70.9317 40.9869 70.9317H44.8664Z"
fill="white"
/>
<path
d="M110.642 67.203H102.869V54.364C102.869 54.1955 102.757 54.0836 102.589 54.0836H99.2138C99.0451 54.0836 98.9331 54.1955 98.9331 54.364V70.6513C98.9331 70.8198 99.0451 70.9317 99.2138 70.9317H110.642C110.811 70.9317 110.923 70.8198 110.923 70.6513V67.4833C110.923 67.3148 110.811 67.203 110.642 67.203Z"
fill="white"
/>
<path
d="M79.8918 54.0836H76.517C76.3483 54.0836 76.2363 54.1955 76.2363 54.364V64.2831C76.2363 66.1919 74.8756 67.5185 72.9965 67.5185C71.0959 67.5185 69.7567 66.1934 69.7567 64.2831V54.364C69.7567 54.1955 69.6448 54.0836 69.476 54.0836H66.1013C65.9325 54.0836 65.8206 54.1955 65.8206 54.364V64.2831C65.8206 68.4162 68.7443 71.2472 72.9965 71.2472C77.2487 71.2472 80.1725 68.4162 80.1725 64.2831V54.364C80.1725 54.1955 80.0605 54.0836 79.8918 54.0836Z"
fill="white"
/>
<path
d="M95.3559 54.0836H83.7927C83.624 54.0836 83.5105 54.1955 83.5105 54.364V70.6513C83.5105 70.8198 83.624 70.9317 83.7927 70.9317H95.3559C95.5246 70.9317 95.6366 70.8198 95.6366 70.6513V67.4833C95.6366 67.3148 95.5231 67.203 95.3559 67.203H87.4498V64.2831H94.908C95.0767 64.2831 95.1887 64.1713 95.1887 64.0028V60.8808C95.1887 60.7122 95.0767 60.6004 94.908 60.6004H87.4498V57.8154H95.3574C95.5262 57.8154 95.6381 57.7036 95.6381 57.5351V54.364C95.6381 54.1955 95.5246 54.0836 95.3559 54.0836Z"
fill="white"
/>
<path
d="M63.3923 62.5077C63.3923 57.699 59.6908 54.0821 54.7529 54.0821H48.7581C48.5894 54.0821 48.4774 54.194 48.4774 54.3625V57.5305C48.4774 57.699 48.5894 57.8108 48.7581 57.8108H54.7529C57.4297 57.8108 59.4546 59.8329 59.4546 62.5061C59.4546 65.1793 57.4297 67.2014 54.7529 67.2014H52.4136V59.6874C52.4136 59.5189 52.3016 59.4071 52.1329 59.4071H51.5469C50.7937 59.4071 49.95 59.7671 49.4101 60.3063C48.8149 60.9007 48.4774 61.7218 48.4774 62.7773V70.6513C48.4774 70.8198 48.5894 70.9317 48.7581 70.9317H54.7529C59.6908 70.9317 63.3923 67.3148 63.3923 62.5077Z"
fill="white"
/>
<path
d="M57.4374 8.05378C61.6313 8.27744 65.5797 9.21191 69.2275 10.7163C68.0234 20.2846 63.0026 28.6963 55.842 34.3323C55.6073 34.51 55.5414 34.7443 55.6073 35.0446C56.1089 37.3057 56.8115 39.6449 57.6705 41.952C57.7718 42.2078 58.0617 42.2967 58.2841 42.142C70.1188 34.032 77.1475 20.6201 77.2472 6.60612C77.2579 6.24919 77.1245 5.98263 76.8238 5.81566C71.8936 3.06434 66.3605 1.22604 60.5145 0.568847C60.2246 0.535145 60.0129 0.636253 59.8902 0.881359C58.8302 2.95404 57.8929 5.18144 57.0784 7.54366C57.0032 7.79795 57.1812 8.0308 57.4374 8.05378Z"
fill="white"
/>
<path
d="M54.6271 43.3889C54.8051 43.5008 54.9953 43.5008 55.118 43.3889C55.23 43.2771 55.23 43.1438 55.1517 42.9539C53.8571 39.5346 52.8876 35.9254 52.3292 32.3484C52.2617 31.9134 52.1175 31.6468 51.8721 31.391C49.7307 29.2524 47.7886 26.7018 46.1826 23.9152C47.9666 23.1018 49.5849 22.5901 51.2462 22.2669C51.5469 22.2117 51.6926 22.0325 51.7156 21.7659C51.8153 19.416 52.073 17.0875 52.4519 14.7927C52.4857 14.5368 52.3507 14.3132 52.027 14.3576C49.0373 14.7145 45.9923 15.528 43.1039 16.8638C42.501 14.8815 42.0439 12.8196 41.777 10.7147C45.48 9.17667 49.519 8.2422 53.6684 8.02927C53.9583 8.01854 54.1255 7.88374 54.2037 7.61718C54.9063 5.35608 55.7991 3.09497 56.8698 0.876758C57.0033 0.59795 56.8805 0.297694 56.5354 0.28697C48.7719 0.119992 41.0407 1.96901 34.17 5.81259C33.8693 5.97957 33.7466 6.24765 33.7466 6.60305C33.8785 21.4105 41.6865 35.5241 54.6271 43.3889Z"
fill="white"
/>
</svg>
);
export const LogoFanduelRacing = () => (
<svg data-qa-label="logo-FanduelRacing" viewBox="36 25 118 94" height="55px">
<path
d="M48.6346 89.3243L47.4594 92.5653C47.3882 92.7648 47.2597 92.8467 47.06 92.8467H41.5912V98.8478C41.5912 99.024 41.4735 99.1416 41.297 99.1416H37.7699C37.5934 99.1416 37.4757 99.024 37.4757 98.8478V81.8203C37.4757 81.6441 37.5934 81.5265 37.7699 81.5265H51.1166C51.2808 81.5265 51.4108 81.7028 51.352 81.8559L50.152 85.1556C50.0808 85.3427 49.9523 85.4262 49.7525 85.4262H41.5928V88.9965H48.4008C48.5634 88.995 48.6935 89.1713 48.6346 89.3243ZM93.7705 70.3486C93.9579 70.4646 94.156 70.4646 94.283 70.3486C94.3991 70.2326 94.3991 70.0919 94.3186 69.894C92.9654 66.3191 91.9512 62.5446 91.369 58.8073C91.2993 58.3527 91.1476 58.0728 90.8906 57.8053C88.6517 55.5694 86.6218 52.9021 84.9434 49.9905C86.8091 49.1401 88.4999 48.6051 90.2372 48.2665C90.5515 48.2077 90.7032 48.0221 90.7264 47.7423C90.8317 45.2853 91.0996 42.8514 91.496 40.4516C91.5316 40.1841 91.3907 39.9507 91.0531 39.997C87.9286 40.3697 84.7436 41.2201 81.7244 42.618C81.0942 40.5444 80.6157 38.3905 80.337 36.1886C84.2095 34.582 88.4302 33.6033 92.7687 33.3821C93.0722 33.3698 93.2472 33.2306 93.3292 32.9507C94.0631 30.5865 94.9968 28.2223 96.1162 25.9044C96.2556 25.6137 96.1286 25.2983 95.7663 25.2875C87.6499 25.1127 79.5675 27.0456 72.3847 31.0643C72.0704 31.239 71.9419 31.5189 71.9419 31.8915C72.0797 47.3712 80.2426 62.1271 93.7705 70.3486ZM72.8787 98.8478V88.3734L79.0643 98.8833C79.1696 99.0704 79.2996 99.1416 79.5118 99.1416H83.5684C83.745 99.1416 83.8626 99.024 83.8626 98.8478V81.8203C83.8626 81.6441 83.745 81.5265 83.5684 81.5265H80.111C79.9345 81.5265 79.8168 81.6441 79.8168 81.8203V92.2128L73.6791 81.7848C73.5739 81.5977 73.4438 81.5265 73.2317 81.5265H69.1286C68.952 81.5265 68.8344 81.6441 68.8344 81.8203V98.8478C68.8344 99.024 68.952 99.1416 69.1286 99.1416H72.586C72.761 99.1416 72.8787 99.024 72.8787 98.8478ZM61.5571 95.4305H54.7135L53.5259 98.8601C53.467 99.0472 53.337 99.1416 53.1372 99.1416H49.4444C49.2803 99.1416 49.1502 98.9653 49.2091 98.8122L55.3947 81.7971C55.4659 81.61 55.5945 81.5265 55.7942 81.5265H60.5213C60.721 81.5265 60.8511 81.6085 60.9208 81.7971L67.1064 98.8122C67.1653 98.9653 67.0352 99.1416 66.8711 99.1416H63.1318C62.9321 99.1416 62.8144 99.0472 62.7432 98.8601L61.5571 95.4305ZM60.2395 91.5912L58.1353 85.5082L56.0311 91.5912H60.2395ZM136.35 81.5265H124.262C124.086 81.5265 123.968 81.6441 123.968 81.8203V98.8478C123.968 99.024 124.086 99.1416 124.262 99.1416H136.35C136.527 99.1416 136.644 99.024 136.644 98.8478V95.5357C136.644 95.3594 136.527 95.2419 136.35 95.2419H128.083V92.188H135.879C136.056 92.188 136.174 92.0705 136.174 91.8942V88.6301C136.174 88.4538 136.056 88.3363 135.879 88.3363H128.083V85.4262H136.35C136.527 85.4262 136.644 85.3087 136.644 85.1324V81.8203C136.643 81.6441 136.525 81.5265 136.35 81.5265ZM152.329 95.2419H144.203V81.8203C144.203 81.6441 144.086 81.5265 143.909 81.5265H140.382C140.205 81.5265 140.088 81.6441 140.088 81.8203V98.8478C140.088 99.024 140.205 99.1416 140.382 99.1416H152.329C152.505 99.1416 152.623 99.024 152.623 98.8478V95.5357C152.622 95.3594 152.505 95.2419 152.329 95.2419ZM120.476 81.8203C120.476 81.6441 120.359 81.5265 120.182 81.5265H116.655C116.479 81.5265 116.361 81.6441 116.361 81.8203V92.1896C116.361 94.1858 114.938 95.5712 112.975 95.5712C110.988 95.5712 109.588 94.1858 109.588 92.1896V81.8203C109.588 81.6441 109.471 81.5265 109.294 81.5265H105.767C105.591 81.5265 105.473 81.6441 105.473 81.8203V92.1896C105.473 96.5114 108.531 99.4694 112.975 99.4694C117.42 99.4694 120.476 96.5098 120.476 92.1896V81.8203V81.8203ZM116.977 31.0674C111.823 28.1913 106.038 26.2693 99.9283 25.5828C99.6248 25.5472 99.4034 25.6524 99.2749 25.9091C98.1663 28.0754 97.1877 30.404 96.3361 32.8734C96.254 33.1409 96.4414 33.3852 96.7093 33.4084C101.094 33.6419 105.222 34.6191 109.036 36.1917C107.777 46.196 102.528 54.9881 95.0417 60.8809C94.797 61.068 94.7274 61.3123 94.797 61.6261C95.3219 63.9904 96.0559 66.4366 96.9539 68.8472C97.0592 69.1147 97.3627 69.2075 97.5949 69.0451C109.968 60.567 117.315 46.5455 117.42 31.8946C117.432 31.5204 117.293 31.2421 116.977 31.0674ZM93.9021 81.5265H87.6344C87.4579 81.5265 87.3402 81.6441 87.3402 81.8203V85.1324C87.3402 85.3087 87.4579 85.4262 87.6344 85.4262H93.9021C96.7015 85.4262 98.8166 87.5399 98.8166 90.334C98.8166 93.1281 96.7 95.2419 93.9021 95.2419H91.4557V87.3853C91.4557 87.209 91.338 87.0915 91.1615 87.0915H90.5499C89.7618 87.0915 88.8808 87.4673 88.3157 88.0317C87.6932 88.6533 87.3402 89.5114 87.3402 90.6155V98.8478C87.3402 99.024 87.4579 99.1416 87.6344 99.1416H93.9021C99.0643 99.1416 102.932 95.3609 102.932 90.334C102.934 85.3087 99.0643 81.5265 93.9021 81.5265ZM63.491 113.466L67.4424 118.504H64.8149L61.0323 113.571H58.9946V118.504H56.8517V105.293H62.3189C65.1849 105.293 66.8169 106.992 66.8169 109.477C66.8153 111.651 65.5906 113.069 63.491 113.466ZM62.0882 111.686C63.8425 111.686 64.6538 110.779 64.6538 109.501C64.6538 108.215 63.8255 107.326 62.0882 107.326H58.9931V111.686H62.0882ZM88.9489 107.099C90.8193 107.099 92.3089 108.102 93.0056 109.653H95.2987C94.4611 106.915 92.0271 105.064 88.966 105.064C85.0332 105.064 82.1393 107.988 82.1393 111.898C82.1393 115.799 85.0316 118.723 88.966 118.723C92.0255 118.723 94.4595 116.874 95.2987 114.143H93.0056C92.3089 115.685 90.8178 116.689 88.9489 116.689C86.2409 116.689 84.3008 114.654 84.3008 111.897C84.3008 109.141 86.2424 107.099 88.9489 107.099ZM76.4956 105.293L81.6113 118.504H79.3445L78.0037 114.955H72.2531L70.9123 118.504H68.6455L73.769 105.293H76.4956ZM77.2264 112.937L75.1269 107.406L73.0273 112.937H77.2264ZM97.855 118.504H99.9887V105.293H97.855V118.504ZM112.142 115.244L105.687 105.293H103.164V118.504H105.264V108.552L111.719 118.504H114.241V105.293H112.142V115.244ZM123.009 113.29H127.978C127.637 115.441 125.882 116.743 123.671 116.743C120.817 116.743 119.041 114.629 119.041 111.951C119.041 109.121 120.987 107.102 123.689 107.102C125.56 107.102 127.034 108.045 127.751 109.554H130.036C129.204 106.874 126.786 105.064 123.706 105.064C119.795 105.064 116.886 107.969 116.886 111.912C116.886 115.855 119.777 118.723 123.517 118.723C125.879 118.723 127.673 117.553 128.297 115.855V118.496H130.149V111.478H123.008V113.29H123.009Z"
fill="white"
/>
</svg>
);
const Logo = (props) => {
switch (props.brand) {
case "pabets":
return props.isDark
? LogoPaBlack(props.height, props.className)
: LogoPa(props.height, props.className);
case "4njbets":
return props.isDark
? LogoNjBlack(props.height, props.className)
: LogoNj(props.height, props.className);
case "iowa":
return props.isDark
? LogoTVGBlack(props.height, props.className)
: LogoIa(props.height, props.className);
case "tvgPoweredByFanduel":
return props.isDark
? LogoTVGBlackPoweredFanduel(props.height, props.className)
: LogoTVGPoweredFanduel(props.height, props.className);
case "tvg":
default:
return props.isDark
? LogoTVGBlack(props.height, props.className)
: LogoTVG(props.height, props.className);
}
};
export default Logo;
Logo.defaultProps = {
brand: "tvg",
height: 18,
className: "",
isDark: false
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Icons/iconsDuotone.js
export const america = {
id: "america",
shapes: [
{
path: "M86.3223 18.7519C86.5134 19.094 86.2076 19.8352 85.9401 20.5194C85.6917 21.1846 86.2458 21.8878 86.9529 21.8117C87.7364 21.7167 88.5199 22.0588 88.9594 22.705L90.5073 24.9476C90.641 25.1377 90.6793 25.3847 90.6219 25.5938L90.2015 27.2282C90.0678 27.7034 90.4691 28.1595 90.9659 28.1025C91.5774 28.0264 92.1698 27.7794 92.6476 27.3993L95.9917 24.8146C96.0108 24.8146 96.0108 24.7956 96.0299 24.7956L100.463 20.7094C100.502 20.6714 100.521 20.6334 100.559 20.5954L102.393 17.2125C102.508 17.0224 102.68 16.8704 102.909 16.8134L108.489 15.369C108.642 15.331 108.757 15.236 108.795 15.0839L111.184 8.37508C111.318 8.03298 111.662 7.80492 112.025 7.84293L115.044 8.14702C115.312 8.16602 115.56 8.33707 115.675 8.56513L118.407 13.7726C118.579 14.0956 118.503 14.4757 118.254 14.7228L113.936 18.7899C113.84 18.8849 113.783 19.018 113.802 19.151L114.184 23.5792C114.203 23.8453 114.088 24.1114 113.878 24.2824L109.407 27.7034C109.311 27.7794 109.235 27.8934 109.235 28.0264L108.967 31.4284C108.948 31.6944 108.795 31.9225 108.585 32.0555L106.846 33.1198C106.731 33.1769 106.674 33.2909 106.636 33.4049L105.814 37.415C105.795 37.51 105.814 37.6241 105.852 37.7001L108.088 41.9953C108.241 42.2803 108.203 42.6224 107.993 42.8695L104.113 47.5638L104.094 47.5828L97.96 55.9071C97.8645 56.0401 97.8454 56.1921 97.9027 56.3442L100.635 62.7679C100.654 62.8059 100.674 62.863 100.674 62.901L102.451 70.9592C102.508 71.2633 102.413 71.5673 102.164 71.7574C102.011 71.8714 101.82 71.9284 101.629 71.9284H98.1893C97.9218 71.9284 97.6543 71.7954 97.5205 71.5673L93.947 66.0748C93.8897 65.9988 93.8706 65.9228 93.8323 65.8278L93.2208 63.3761C93.1826 63.205 93.0489 63.091 92.8769 63.053L88.4626 62.1027C88.4434 62.1027 88.4434 62.1027 88.4243 62.1027L82.5195 61.3805C82.4239 61.3615 82.3284 61.3806 82.2328 61.4376L78.8313 63.4521C78.7931 63.4711 78.7549 63.4901 78.7167 63.5091L75.1241 64.8585C75.0094 64.8965 74.8948 64.9155 74.7801 64.9155L66.9834 64.3074C66.8687 64.3074 66.7732 64.3264 66.6776 64.3834L61.3461 68.2414C61.2314 68.3174 61.155 68.4505 61.155 68.6025L61.1741 73.1828C61.1741 73.4488 61.0403 73.6959 60.8301 73.848C60.6964 73.943 60.5244 74 60.3715 74C60.2759 74 60.1804 73.981 60.0848 73.943L55.3457 72.1755C55.1546 72.0995 55.0017 71.9664 54.9062 71.7764L51.7531 65.3716C51.7149 65.2766 51.6384 65.2006 51.5429 65.1626L48.2178 63.6992C48.0649 63.6232 47.8738 63.6612 47.7401 63.7752L46.3642 64.9535C46.1922 65.1056 45.9629 65.1626 45.7336 65.1436C45.5042 65.1056 45.3132 64.9915 45.1794 64.8015L42.0836 60.4113C42.0454 60.3543 41.9881 60.3163 41.9308 60.2782L35.7966 56.9333C35.7393 56.8953 35.6628 56.8763 35.5864 56.8763H29.0891C28.9362 56.8763 28.8025 56.8383 28.6687 56.7623L20.9484 52.011C20.9102 51.992 20.8529 51.954 20.7956 51.954L15.6169 50.9467C15.4449 50.9087 15.2729 50.8137 15.1582 50.6806L9.73113 44.4279C9.65469 44.3519 9.61647 44.2569 9.57825 44.1618L7.41887 37.8521C7.39976 37.8141 7.39976 37.7761 7.38065 37.7381L6.34874 31.8845C6.34874 31.8655 6.34874 31.8655 6.34874 31.8465L5.50792 25.8789C5.48881 25.7648 5.50792 25.6508 5.52702 25.5368L7.03668 20.5194C7.05579 20.4814 7.05579 20.4624 7.0749 20.4244L11.0497 10.3136C11.0688 10.2566 11.0879 10.1806 11.0879 10.1236L10.763 5.10618C10.7439 4.82111 10.8777 4.53603 11.1261 4.38399C11.3746 4.23195 11.6803 4.21294 11.9478 4.34598L14.4703 5.67634C14.6996 5.79037 14.9863 5.69535 15.1009 5.44828L15.5022 4.49802C15.6551 4.13692 16.0564 3.92786 16.4386 4.02289L26.2227 6.49356C26.2418 6.49356 26.2418 6.49356 26.2609 6.49356L37.5738 8.43209H37.5929L50.7212 9.95251C50.7403 9.95251 50.7403 9.95251 50.7594 9.95251L64.4609 10.3896C64.5565 10.3896 64.652 10.4086 64.7476 10.4466L67.1172 11.4349C67.1745 11.4539 67.2318 11.4729 67.2892 11.4729L69.3721 11.5109C69.4676 11.5109 69.5632 11.5299 69.6396 11.5679L72.0283 12.4612C72.0665 12.4802 72.1239 12.4802 72.1621 12.4802L74.8374 12.5752C75.1241 12.5942 75.3725 12.7463 75.5063 12.9743C75.64 13.2214 75.64 13.5065 75.5063 13.7535L75.3343 14.0766C75.1432 14.4377 75.5063 14.8558 75.8885 14.7038L77.9714 13.8866C78.2963 13.7726 78.6402 13.8486 78.8696 14.1146L80.1308 15.559C80.2454 15.6921 80.4174 15.7491 80.5894 15.6921L83.5514 14.8749C83.7807 14.8178 84.0291 14.8558 84.2202 14.9889L86.3223 18.7519Z",
fill: "#D6E3F0",
strokeLinejoin: "round"
}
]
};
// eslint-disable-next-line
export const play = {
id: "play",
shapes: [
{
path: "M9.99998 19.0664C15.0072 19.0664 19.0664 15.0072 19.0664 9.99998C19.0664 4.99275 15.0072 0.933594 9.99998 0.933594C4.99275 0.933594 0.933594 4.99275 0.933594 9.99998C0.933594 15.0072 4.99275 19.0664 9.99998 19.0664ZM7.18748 14.3598V5.62914L14.075 10.0064L7.18748 14.3598Z",
fillRule: "evenodd",
fill: null,
strokeWidth: 1.5
}
]
};
export const trash = {
id: "trash",
shapes: [
{
path: "M2.99995 4.25L3.90785 13.352C3.96017 13.8621 4.38985 14.25 4.90263 14.25H11.0973C11.61 14.25 12.0397 13.8621 12.0921 13.352L13 4.25H10.5H5.49995H2.99995Z",
fill: null,
strokeWidth: 0,
fillRule: "evenodd",
clipRule: "evenodd"
},
{
path: "M6.49995 6V12.25M9.49995 6V12.25M2.99995 4.25H5.49995M2.99995 4.25H1M2.99995 4.25L3.90785 13.352C3.96017 13.8621 4.38985 14.25 4.90263 14.25H11.0973C11.61 14.25 12.0397 13.8621 12.0921 13.352L13 4.25M13 4.25H10.5M13 4.25H15M10.5 4.25H5.49995M10.5 4.25V2.75C10.5 2.19772 10.0522 1.75 9.49995 1.75H6.49995C5.94767 1.75 5.49995 2.19772 5.49995 2.75V4.25",
fill: null,
strokeWidth: 1.5
}
]
};
export const repeat = {
id: "repeat",
shapes: [
{
path: "M9.16068 2.74744C11.4249 2.74744 14.25 4.4967 14.25 7.99998C14.25 11.5033 11.4249 13.2525 9.16068 13.2525H6.83944C4.65301 13.2525 1.75 11.5033 1.75 7.99998C1.75 4.4967 4.57526 2.74744 6.83944 2.74744H9.16068Z",
fill: null,
strokeWidth: 0,
fillRule: "evenodd",
clipRule: "evenodd"
},
{
path: "M4 2.74746L6.21161 0.535828M4 2.74746L6.21161 4.95907M4 2.74746H9.16056C11.4247 2.74746 14.25 4.49672 14.25 8.00001C14.25 8.74763 14.1178 9.41537 13.8886 10.0033M12 13.2526L9.78839 11.0409M12 13.2526L9.78839 15.4642M12 13.2526H6.83932C4.57513 13.2526 1.75 11.5033 1.75 8.00001C1.75 7.2561 1.87739 6.59129 2.09974 6.00552",
fill: null,
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const question = {
id: "question",
shapes: [
{
path: "M15.2501 8.00276C15.2501 12.007 12.0041 15.2531 7.99983 15.2531C3.99559 15.2531 0.749512 12.007 0.749512 8.00276C0.749512 3.99852 3.99559 0.752441 7.99983 0.752441C12.0041 0.752441 15.2501 3.99852 15.2501 8.00276Z",
fill: null,
strokeWidth: 0
},
{
path: "M7.99982 12V10.5M5.99982 5.99997C5.99982 5.99997 5.99982 3.99997 7.99982 3.99997C9.99982 3.99997 9.99982 5.99997 9.99982 5.99997C9.99982 7.99997 7.99982 7.49997 7.99982 9.49997M15.2501 8.00276C15.2501 12.007 12.0041 15.2531 7.99983 15.2531C3.99559 15.2531 0.749512 12.007 0.749512 8.00276C0.749512 3.99852 3.99559 0.752441 7.99983 0.752441C12.0041 0.752441 15.2501 3.99852 15.2501 8.00276Z",
fill: null,
strokeWidth: 1.5
}
]
};
export const info = {
id: "info",
shapes: [
{
path: "M15.2504 8.00276C15.2504 12.007 12.0043 15.2531 8.0001 15.2531C3.99586 15.2531 0.749786 12.007 0.749786 8.00276C0.749786 3.99852 3.99586 0.752441 8.0001 0.752441C12.0043 0.752441 15.2504 3.99852 15.2504 8.00276Z",
fill: null,
strokeWidth: 0
},
{
path: "M8.00009 12V6.99997M8.00009 5.49997V3.99997M15.2504 8.00276C15.2504 12.007 12.0043 15.2531 8.0001 15.2531C3.99586 15.2531 0.749786 12.007 0.749786 8.00276C0.749786 3.99852 3.99586 0.752441 8.0001 0.752441C12.0043 0.752441 15.2504 3.99852 15.2504 8.00276Z",
fill: null,
strokeWidth: 1.5
}
]
};
export const infoOutline = {
id: "infoOutline",
shapes: [
{
path: "M977.017 512.177c0 256.271-207.749 464.02-464.02 464.02-256.271 0-464.02-207.749-464.02-464.02 0-256.272 207.749-464.02 464.02-464.02 256.271 0 464.02 207.748 464.02 464.02z",
fill: null
},
{
path: "M512.997 96.156c-229.762 0-416.02 186.259-416.02 416.021 0 229.761 186.258 416.02 416.02 416.02 229.762 0 416.02-186.259 416.02-416.02 0-229.762-186.258-416.02-416.02-416.02zM.977 512.177C.977 229.396 230.216.157 512.997.157c282.781 0 512.023 229.239 512.023 512.02 0 282.781-229.242 512.023-512.023 512.023C230.216 1024.2.977 794.958.977 512.177zm560.019-256.179v96h-96v-96h96zm0 192v320h-96v-320h96z",
fill: null,
fillRule: "evenodd",
clipRule: "evenodd"
}
]
};
export const betCanceled = {
id: "betCanceled",
shapes: [
{
path: "M12.25 1.75H3.75C3.19772 1.75 2.75 2.19772 2.75 2.75V14.5L5 13.5L6.5 14.5L8 13.5L9.5 14.5L11 13.5L13.25 14.5V2.75C13.25 2.19772 12.8023 1.75 12.25 1.75Z",
fill: null,
strokeWidth: 0
},
{
path: "M8 13.5L6.5 14.5L5 13.5L2.75 14.5V2.75C2.75 2.19772 3.19772 1.75 3.75 1.75H12.25C12.8023 1.75 13.25 2.19772 13.25 2.75V8M5 5.75H8M5 8.75H9M10.5 9.5L13 12M13 12L15.5 14.5M13 12L10.5 14.5M13 12L15.5 9.5",
fill: null,
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const key = {
id: "key",
shapes: [
{
path: "M2.86982 14.1147C4.43099 15.6759 6.95866 15.6759 8.51983 14.1147C9.64129 12.9932 9.95956 11.3781 9.46983 9.97469L14.2498 5.19469L14.2498 2.73468L11.7956 2.73468L7.00983 7.51469C5.60873 7.02998 3.9886 7.34592 2.86983 8.46469C1.30866 10.0259 1.30865 12.5535 2.86982 14.1147ZM5.68982 12.0447C6.10352 12.0447 6.43982 11.7084 6.43982 11.2947C6.43982 10.881 6.10352 10.5447 5.68982 10.5447C5.27611 10.5447 4.93982 10.881 4.93982 11.2947C4.93982 11.7084 5.27612 12.0447 5.68982 12.0447Z",
fill: null,
fillRule: "evenodd",
clipRule: "evenodd",
strokeWidth: 0
},
{
path: "M10.6805 6.97898L10.6805 8.57088M12.3339 5.44859L12.3339 6.97898M2.86983 8.46469C1.30866 10.0259 1.30865 12.5535 2.86982 14.1147C4.43099 15.6759 6.95866 15.6759 8.51983 14.1147C9.64129 12.9932 9.95956 11.3781 9.46983 9.97469L14.2498 5.19469L14.2498 2.73468L11.7956 2.73468L7.00983 7.51469C5.60873 7.02998 3.9886 7.34592 2.86983 8.46469ZM6.43982 11.2947C6.43982 11.7084 6.10352 12.0447 5.68982 12.0447C5.27612 12.0447 4.93982 11.7084 4.93982 11.2947C4.93982 10.881 5.27612 10.5447 5.68982 10.5447C6.10352 10.5447 6.43982 10.881 6.43982 11.2947Z",
fill: null,
strokeWidth: 1.5
}
]
};
export const optedIn = {
id: "optedIn",
shapes: [
{
path: "M8.43448 2.25195H13.2484C13.8007 2.25195 14.2484 2.69967 14.2484 3.25195V8.06592C14.2484 8.34424 14.1325 8.60997 13.9284 8.79921L7.79696 14.4844C7.40275 14.8499 6.79008 14.8384 6.40993 14.4582L2.04216 10.0905C1.66202 9.71032 1.65046 9.09765 2.01598 8.70343L7.70119 2.57203C7.89043 2.36794 8.15616 2.25195 8.43448 2.25195Z",
fill: null,
strokeWidth: 0
},
{
path: "M5.99992 7.5L7.99992 9.5L11.9999 5.5M13.2484 2.25195H8.43448C8.15616 2.25195 7.89043 2.36794 7.70119 2.57203L2.01598 8.70343C1.65046 9.09765 1.66202 9.71032 2.04216 10.0905L6.40993 14.4582C6.79008 14.8384 7.40275 14.8499 7.79696 14.4844L13.9284 8.79921C14.1325 8.60997 14.2484 8.34424 14.2484 8.06592V3.25195C14.2484 2.69967 13.8007 2.25195 13.2484 2.25195Z",
fill: null,
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const referFriend = {
id: "referFriend",
shapes: [
{
path: "M4.84685 8.99805H11.153C11.8295 8.99805 12.4223 9.45084 12.6002 10.1035L13.3874 12.991C13.5609 13.6271 13.082 14.254 12.4226 14.254H3.57723C2.91789 14.254 2.43901 13.6271 2.61244 12.991L3.39967 10.1035C3.57761 9.45084 4.17038 8.99805 4.84685 8.99805Z",
fill: null,
strokeWidth: 0
},
{
path: "M10.5015 4.247C10.5015 5.62848 9.38156 6.74839 8.00008 6.74839C6.6186 6.74839 5.49868 5.62848 5.49868 4.247C5.49868 2.86552 6.6186 1.74561 8.00008 1.74561C9.38156 1.74561 10.5015 2.86552 10.5015 4.247Z",
fill: null
},
{
path: "M8.50003 14.2544H3.57735C2.91801 14.2544 2.43913 13.6275 2.61256 12.9914L3.39979 10.1038C3.57773 9.45119 4.1705 8.9984 4.84698 8.9984H8.50003M9.75 12.0002H15.2031M12.75 9.50021L15.25 12.0002L12.75 14.5002M10.5015 4.247C10.5015 5.62848 9.38156 6.74839 8.00008 6.74839C6.6186 6.74839 5.49868 5.62848 5.49868 4.247C5.49868 2.86552 6.6186 1.74561 8.00008 1.74561C9.38156 1.74561 10.5015 2.86552 10.5015 4.247Z",
fill: null,
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const doubleArrowRight = {
id: "doubleArrowRight",
shapes: [
{
path: "M10 4.27466L16.25 10.5247L10 16.7747M3.75 4.27466L10 10.5247L3.75 16.7747",
fill: null,
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const successDouble = {
id: "success",
shapes: [
{
path: "M15.2501 8.00276C15.2501 12.007 12.0041 15.2531 7.99983 15.2531C3.99559 15.2531 0.749512 12.007 0.749512 8.00276C0.749512 3.99852 3.99559 0.752441 7.99983 0.752441C12.0041 0.752441 15.2501 3.99852 15.2501 8.00276Z",
fill: null
},
{
path: "M4.49988 7.99997L6.99988 10.5L11.9999 5.49997M15.2501 8.00276C15.2501 12.007 12.0041 15.2531 7.99983 15.2531C3.99559 15.2531 0.749512 12.007 0.749512 8.00276C0.749512 3.99852 3.99559 0.752441 7.99983 0.752441C12.0041 0.752441 15.2501 3.99852 15.2501 8.00276Z",
fill: null,
strokeColor: "#329A47",
strokeWidth: 1.5
}
]
};
export const lock = {
id: "lock",
shapes: [
{
path: "M11.25 7.73621V4.7431C11.25 4.7431 11.25 1.75 8 1.75C4.75 1.75 4.75 4.7431 4.75 4.7431V7.73621",
fill: "#ffffff",
strokeColor: "#384048",
strokeWidth: 1.5
},
{
xRect: 2.75,
yRect: 7.73633,
widthRect: 10.5,
heightRect: 6.51379,
rxRect: 1,
fill: "#DEE1E3",
strokeColor: "#384048",
strokeWidth: 1.5
},
{
path: "M8 10V12",
fill: null,
strokeColor: "#384048",
strokeWidth: 1.5
}
]
};
export const file = {
id: "file",
shapes: [
{
path: "M3 2H10V5H13V13H3V2Z",
fill: "#DEE1E3"
},
{
path: "M11 13.5H3.75C3.19772 13.5 2.75 13.0523 2.75 12.5V5.25M13.25 13V10.75V5.5L9.75 2H2M9.75 2.05339V5.5H13.198",
fill: null,
strokeColor: "#384048",
strokeWidth: 1.5,
strokeLinejoin: "round"
},
{
path: "M1 1L15 15",
fill: null,
strokeColor: "#384048",
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const chevronUp = {
id: "chevronUp",
shapes: [
{
path: "M3 10.0493L8 5.04932L13 10.0493",
fill: null,
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const chevronDown = {
id: "chevronDown",
shapes: [
{
path: "M13 6L8 11L3 6",
fill: null,
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const chevronRight = {
id: "chevronRight",
shapes: [
{
path: "M5 3L10 8L5 13",
fill: null,
strokeColor: "#626D78",
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const arrowForward = {
id: "arrowForward",
shapes: [
{
path: "M12.1895 8.74999H2.00012C1.72398 8.74999 1.50012 8.52613 1.50012 8.24999V7.74999C1.50012 7.47384 1.72398 7.24999 2.00012 7.24999H12.1895L8.82334 3.88386C8.62808 3.6886 8.62808 3.37202 8.82334 3.17676L9.17689 2.8232C9.37216 2.62794 9.68874 2.62794 9.884 2.8232L14.5304 7.46965C14.8233 7.76254 14.8233 8.23742 14.5304 8.53031L9.884 13.1768C9.68874 13.372 9.37216 13.372 9.17689 13.1768L8.82334 12.8232C8.62808 12.6279 8.62808 12.3114 8.82334 12.1161L12.1895 8.74999Z",
fill: null
}
]
};
export const close = {
id: "close",
shapes: [
{
path: "M3.50012 3.5L12.5001 12.5M12.5001 3.5L3.50012 12.5",
fill: null,
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
export const successRound = {
id: "successRound",
shapes: [
{
path: "M15.2505 8.00276C15.2505 12.007 12.0044 15.2531 8.00013 15.2531C3.99589 15.2531 0.749817 12.007 0.749817 8.00276C0.749817 3.99852 3.99589 0.752441 8.00013 0.752441C12.0044 0.752441 15.2505 3.99852 15.2505 8.00276Z",
fill: null,
strokeWidth: 0
},
{
path: "M4.50018 7.99997L7.00018 10.5L12.0002 5.49997M15.2505 8.00276C15.2505 12.007 12.0044 15.2531 8.00013 15.2531C3.99589 15.2531 0.749817 12.007 0.749817 8.00276C0.749817 3.99852 3.99589 0.752441 8.00013 0.752441C12.0044 0.752441 15.2505 3.99852 15.2505 8.00276Z",
fill: null,
strokeWidth: 1.5
}
]
};
export const errorRound = {
id: "errorRound",
shapes: [
{
path: "M15.2505 8.00276C15.2505 12.007 12.0044 15.2531 8.00013 15.2531C3.99589 15.2531 0.749817 12.007 0.749817 8.00276C0.749817 3.99852 3.99589 0.752441 8.00013 0.752441C12.0044 0.752441 15.2505 3.99852 15.2505 8.00276Z",
fill: null,
strokeWidth: 0
},
{
path: "M5.00018 4.99997L8.00018 7.99997M8.00018 7.99997L11.0002 11M8.00018 7.99997L5.00018 11M8.00018 7.99997L11.0002 4.99997M15.2505 8.00276C15.2505 12.007 12.0044 15.2531 8.00013 15.2531C3.99589 15.2531 0.749817 12.007 0.749817 8.00276C0.749817 3.99852 3.99589 0.752441 8.00013 0.752441C12.0044 0.752441 15.2505 3.99852 15.2505 8.00276Z",
fill: null,
strokeWidth: 1.5
}
]
};
export const exclamationMarkRound = {
id: "exclamationMarkRound",
shapes: [
{
path: "M7.29302 1.21052C7.68354 0.819999 8.3167 0.82 8.70723 1.21052L14.7896 7.29287C15.1801 7.68339 15.1801 8.31656 14.7896 8.70708L8.70723 14.7894C8.3167 15.1799 7.68354 15.1799 7.29302 14.7894L1.21067 8.70708C0.820149 8.31656 0.82015 7.68339 1.21067 7.29287L7.29302 1.21052Z",
fill: null,
strokeWidth: 0
},
{
path: "M8.00012 8.99997L8.00012 4.49997M8.00012 11.5L8.00012 9.99997M1.21067 8.70708L7.29302 14.7894C7.68354 15.1799 8.3167 15.1799 8.70723 14.7894L14.7896 8.70708C15.1801 8.31656 15.1801 7.68339 14.7896 7.29287L8.70723 1.21052C8.3167 0.82 7.68354 0.819999 7.29302 1.21052L1.21067 7.29287C0.820149 7.68339 0.820149 8.31656 1.21067 8.70708Z",
fill: null,
strokeWidth: 1.5
}
]
};
export const exclamationMark = {
id: "exclamationMark",
shapes: [
{
path: "M15.2503 8.00279C15.2503 12.007 12.0043 15.2531 8.00001 15.2531C3.99577 15.2531 0.749695 12.007 0.749695 8.00279C0.749695 3.99855 3.99577 0.752472 8.00001 0.752472C12.0043 0.752472 15.2503 3.99855 15.2503 8.00279Z",
fill: null
},
{
path: "M8 9V4M8 12V10.5M15.2503 8.00279C15.2503 12.007 12.0043 15.2531 8.00001 15.2531C3.99577 15.2531 0.749695 12.007 0.749695 8.00279C0.749695 3.99855 3.99577 0.752472 8.00001 0.752472C12.0043 0.752472 15.2503 3.99855 15.2503 8.00279Z",
fill: null,
strokeWidth: 1.5
}
]
};
export const questionMarkRound = {
id: "questionMarkRound",
shapes: [
{
path: "M15.2501 8.00276C15.2501 12.007 12.0041 15.2531 7.99983 15.2531C3.99559 15.2531 0.749512 12.007 0.749512 8.00276C0.749512 3.99852 3.99559 0.752441 7.99983 0.752441C12.0041 0.752441 15.2501 3.99852 15.2501 8.00276Z",
fill: null,
strokeWidth: 0
},
{
path: "M7.99982 12V10.5M5.99982 5.99997C5.99982 5.99997 5.99982 3.99997 7.99982 3.99997C9.99982 3.99997 9.99982 5.99997 9.99982 5.99997C9.99982 7.99997 7.99982 7.49997 7.99982 9.49997M15.2501 8.00276C15.2501 12.007 12.0041 15.2531 7.99983 15.2531C3.99559 15.2531 0.749512 12.007 0.749512 8.00276C0.749512 3.99852 3.99559 0.752441 7.99983 0.752441C12.0041 0.752441 15.2501 3.99852 15.2501 8.00276Z",
fill: null,
strokeWidth: 1.5
}
]
};
export const scratchedBox = {
id: "scratchedBox",
shapes: [
{
path: "M0 1a1 1 0 011-1h18a1 1 0 011 1v18a1 1 0 01-1 1H1a1 1 0 01-1-1V1z",
strokeWidth: 0,
fill: "transparent"
},
{
path: "M.972 20H19a1 1 0 001-1V1a1 1 0 00-1-1H1a1 1 0 00-1 1v18.027A1 1 0 00.972 20zM17.38 1.5H1.5v15.879L17.379 1.5zM2.5 18.5h16v-16l-16 16z",
strokeWidth: 0,
fill: null,
fillRule: "evenodd",
clipRule: "evenodd"
}
]
};
export const userTick = {
id: "userTick",
shapes: [
{
path: "M4.84685 8.99829H11.153C11.8295 8.99829 12.4223 9.45109 12.6002 10.1037L13.3874 12.9912C13.5609 13.6274 13.082 14.2543 12.4226 14.2543H3.57723C2.91789 14.2543 2.43901 13.6274 2.61244 12.9912L3.39967 10.1037C3.57761 9.45109 4.17038 8.99829 4.84685 8.99829Z",
strokeWidth: 0,
fill: "#DEE1E3"
},
{
path: "M10.5014 4.24676C10.5014 5.62824 9.38144 6.74815 7.99996 6.74815C6.61847 6.74815 5.49856 5.62824 5.49856 4.24676C5.49856 2.86527 6.61847 1.74536 7.99996 1.74536C9.38144 1.74536 10.5014 2.86527 10.5014 4.24676Z",
strokeWidth: 0,
fill: "#DEE1E3"
},
{
path: "M8.49991 14.2541H3.57723C2.91789 14.2541 2.43901 13.6272 2.61244 12.9911L3.39967 10.1036C3.57761 9.45095 4.17038 8.99815 4.84685 8.99815H8.49991M9.49988 12L11.4999 14L15.4999 9.99996M10.5014 4.24676C10.5014 5.62824 9.38144 6.74815 7.99996 6.74815C6.61847 6.74815 5.49856 5.62824 5.49856 4.24676C5.49856 2.86527 6.61847 1.74536 7.99996 1.74536C9.38144 1.74536 10.5014 2.86527 10.5014 4.24676Z",
fill: null,
strokeColor: "#384048",
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
// viewBoxSize 32
export const cup = {
id: "cup",
shapes: [
{
path: "M8.50001 3.5H23.5001L23.5 7C23.5 7 23.5 7.17955 23.4907 7.5C23.4519 8.82849 23.2524 12.5786 22.226 15.9965C21.1996 19.4143 19.3463 22.5 16 22.5C12.6537 22.5 10.8004 19.4143 9.77399 15.9965C8.74756 12.5786 8.54808 8.82849 8.50931 7.5C8.49995 7.17955 8.49995 7 8.49995 7L8.50001 3.5Z",
clipRule: "evenodd",
fillRule: "evenodd",
fill: "#ECEDEE"
},
{
path: "M16 22.5L16 28.5M16 22.5C12.6537 22.5 10.8004 19.4143 9.77399 15.9965M16 22.5C19.3463 22.5 21.1996 19.4143 22.226 15.9965M8.49995 7L8.50001 3.5H23.5001L23.5 7C23.5 7 23.5 7.17955 23.4907 7.5M8.49995 7C8.49995 7 8.49997 11.7541 9.77399 15.9965M8.49995 7C8.49995 7 8.49995 7.17955 8.50931 7.5M16 28.5H9.99995M16 28.5H22M8.50931 7.5H3.49995C3.49995 7.5 3.49995 15.8018 9.77399 15.9965M8.50931 7.5C8.54808 8.82849 8.74756 12.5786 9.77399 15.9965M22.226 15.9965C28.5 15.8018 28.5 7.5 28.5 7.5H23.4907M22.226 15.9965C23.2524 12.5786 23.4519 8.82849 23.4907 7.5",
strokeColor: "#818A92",
strokeWidth: 2,
strokeLinejoin: "round",
fill: null
}
]
};
export const warning = {
id: "warning",
shapes: [
{
path: "M1.82179 14.25H14.1775C14.5524 14.25 14.794 13.8527 14.6214 13.5198L8.44387 1.606C8.25732 1.24622 7.74269 1.24621 7.55612 1.60598L1.37792 13.5198C1.20532 13.8527 1.44687 14.25 1.82179 14.25Z",
fill: null
},
{
path: "M8.00002 6V10M8.00002 11V12.5M7.55612 1.60598L1.37792 13.5198C1.20532 13.8527 1.44687 14.25 1.82179 14.25H14.1775C14.5524 14.25 14.794 13.8527 14.6214 13.5198L8.44387 1.606C8.25732 1.24622 7.74269 1.24621 7.55612 1.60598Z",
fill: null,
strokeColor: "",
strokeWidth: 1.5
}
]
};
export const announcements = {
id: "announcements",
shapes: [
{
path: "M21.375 6.15001V17.85M21.375 6.15001V3M21.375 6.15001L4.55169 8.59275C3.44554 8.75337 2.625 9.70165 2.625 10.8194V13.1806C2.625 14.2984 3.44554 15.2467 4.55169 15.4073M21.375 17.85V21M21.375 17.85L13.875 16.761M21.375 17.85L4.55169 15.4073M5.625 15.5631V19.875H13.875V16.761M5.625 15.5631L4.55169 15.4073M5.625 15.5631L13.875 16.761",
fill: null,
strokeColor: "#5390ED",
strokeWidth: 2
}
]
};
export const bell = {
id: "bell",
shapes: [
{
path: "M8.04184 9.5H4.04184H1L1.54977 8.18073C1.87307 7.40492 1.99063 6.56185 2.0538 5.72376C2.18661 3.96205 2.88002 1 6.04181 1C9.25134 1 9.9174 4.05217 10.0355 5.80272C10.0886 6.59026 10.1885 7.38276 10.471 8.1198L11 9.5H8.04184Z",
fillRule: "evenodd",
clipRule: "evenodd",
fill: "white",
fillOpacity: 0.1
},
{
path: "M8.04184 9.5H11L10.471 8.1198C10.1885 7.38276 10.0886 6.59026 10.0355 5.80272C9.9174 4.05217 9.25134 1 6.04181 1C2.88002 1 2.18661 3.96205 2.0538 5.72376C1.99063 6.56185 1.87307 7.40492 1.54977 8.18073L1 9.5H4.04184M8.04184 9.5V10C8.04184 11.1046 7.14641 12 6.04184 12C4.93727 12 4.04184 11.1046 4.04184 10V9.5M8.04184 9.5H4.04184",
fill: null,
strokeWidth: 1.5,
strokeLinejoin: "round",
strokeColor: "#818A92"
}
]
};
export const crossedBell = {
id: "crossedBell",
shapes: [
{
path: "M1 1L15 15M12.4791 9.25L12.4292 9.1198C12.1467 8.38276 12.0468 7.59026 11.9937 6.80272C11.8756 5.05217 11.2095 2 8 2C7.17748 2 6.52201 2.20046 6 2.52809M4.48091 4.5C4.18574 5.26496 4.06104 6.07454 4.01211 6.72219C3.9488 7.56028 3.83126 8.40492 3.50796 9.18073L2.95819 10.5H6M6 10.5V11C6 12.1046 6.89543 13 8 13C9.10457 13 10 12.1046 10 11L10 10.5H6Z",
fill: null,
strokeColor: "#5390ED",
strokeWidth: 1.5,
strokeLinejoin: "round"
}
]
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MessageBox/styles.js
import tvgConf from "@tvg/conf";
import buildColor from "../../_static/ColorPalette";
import {
info,
infoOutline,
exclamation,
warningOutline,
success,
successOutline,
error,
glassyError,
checkPromo,
personRightArrow
} from "../../_static/Icons/icons";
import { infoOutline as infoOutlineDuotone } from "../../_static/Icons/iconsDuotone";
const styleMap = {
default: {
icon: info,
fill: buildColor("blue_accent", "500"),
background: buildColor("white", "0")
},
infoWhiteBackground: {
icon: info,
fill: buildColor("blue_accent", "500"),
background: buildColor("white", "100")
},
info: {
icon: info,
fill: buildColor("blue_accent", "500"),
background: buildColor("blue_accent", "100")
},
infoNoBackground: {
icon: info,
fill: buildColor("blue_accent", "500"),
background: buildColor("white", "0")
},
warning: {
icon: exclamation,
fill: buildColor("yellow", "500"),
background: buildColor("yellow", "100")
},
success: {
icon: success,
fill: buildColor("green", "600"),
background: buildColor("green", "100")
},
error: {
icon: error,
fill: buildColor("red", "500"),
background: buildColor("red", "100")
},
promos: {
icon: checkPromo,
fill: buildColor("green", "100"),
background: buildColor("green", "000"),
borderColor: buildColor("green", "200"),
onlyBorderBottom: tvgConf().device === "desktop",
borderRadius: tvgConf().device === "desktop" ? "4px 4px 0 0" : "4px",
viewBoxSize: 16
},
referral: {
icon: personRightArrow,
strokeColorList: [null, null, buildColor("green", "600")],
fill: buildColor("green", "100"),
background: buildColor("green", "000"),
viewBoxSize: 16,
onlyBorderBottom: tvgConf().device === "desktop",
borderColor: buildColor("green", "200"),
borderRadius: tvgConf().device === "desktop" ? "4px 4px 0 0" : "4px"
},
promosInvalid: {
icon: infoOutlineDuotone,
background: buildColor("blue_accent", "000"),
onlyBorderBottom: tvgConf().device === "desktop",
borderColor: buildColor("blue_accent", "200"),
borderRadius: tvgConf().device === "desktop" ? "4px 4px 0 0" : "0",
colorList: [
buildColor("blue_accent", "200"),
buildColor("blue_accent", "600")
]
},
preferencesInfo: {
icon: infoOutlineDuotone,
background: buildColor("blue_accent", "000"),
borderColor: buildColor("blue_accent", "200"),
borderRadius: "4px",
colorList: [
buildColor("blue_accent", "200"),
buildColor("blue_accent", "600")
],
color: buildColor("blue_accent", "600")
}
};
// todo: for now only info, warning and success have the alt style props
export const styleMapAlt = {
default: {
icon: info,
fill: buildColor("blue_accent", "500"),
background: buildColor("white", "0")
},
infoWhiteBackground: {
icon: info,
fill: buildColor("blue_accent", "500"),
background: buildColor("white", "100")
},
info: {
icon: infoOutline,
fill: buildColor("blue_accent", "600"),
iconBackground: buildColor("blue_accent", "200"),
borderColor: buildColor("blue_accent", "200"),
background: buildColor("blue_accent", "000")
},
infoNoBackground: {
icon: info,
fill: buildColor("blue_accent", "500"),
background: buildColor("white", "0")
},
warning: {
icon: warningOutline,
fill: buildColor("orange", "700"),
borderColor: buildColor("orange", "200"),
background: buildColor("orange", "000")
},
success: {
icon: successOutline,
fill: buildColor("green", "600"),
iconBackground: buildColor("green", "100"),
borderColor: buildColor("green", "200"),
background: buildColor("green", "000")
},
error: {
icon: glassyError,
fill: buildColor("red", "600"),
borderColor: buildColor("red", "200"),
background: buildColor("red", "000")
},
promos: {
icon: checkPromo,
fill: buildColor("green", "100"),
background: buildColor("green", "100"),
viewBoxSize: 16
},
referral: {
icon: personRightArrow,
strokeColorList: [null, null, buildColor("green", "600")],
fill: buildColor("green", "100"),
background: buildColor("green", "100"),
viewBoxSize: 16
},
promosInvalid: {
icon: infoOutlineDuotone,
background: buildColor("blue_accent", "000"),
colorList: [
buildColor("blue_accent", "200"),
buildColor("blue_accent", "600")
]
},
preferencesInfo: {
icon: infoOutlineDuotone,
background: buildColor("blue_accent", "000"),
borderColor: buildColor("blue_accent", "200"),
borderRadius: "4px",
colorList: [
buildColor("blue_accent", "200"),
buildColor("blue_accent", "600")
],
color: buildColor("blue_accent", "600")
}
};
export default styleMap;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MessageBox/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import Button from "../../_atom/Buttons/button";
import Icon from "../../_static/Icons";
import { fontNormal, fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const HorizontalMessageBox = styled(Link)`
${({ customStyle }) =>
customStyle.addonStyle
? `
background-color: ${customStyle.addonStyle.backgroundColor};
color: ${customStyle.addonStyle.color};
`
: `
background-color: ${customStyle.background};
color: ${buildColor("grey", "900")};
`}
padding: ${(props) => {
if (props.isAlt) return "12px";
if (
props.type === "promos" ||
props.type === "referral" ||
props.type === "promosInvalid"
)
return "12px";
return props.hasIcon && !props.hasTitle ? "12px" : "8px";
}};
border-radius: ${({ customStyle }) =>
customStyle.borderRadius ? `${customStyle.borderRadius}` : "2px"};
display: flex;
text-decoration: none;
flex-direction: column;
${(props) =>
props.hasBorderTop &&
css`
border-top: 1px solid
${props.isAlt && props.customStyle.borderColor
? props.customStyle.borderColor
: buildColor("grey", "300")};
`};
${(props) =>
props.hasBorderBottom &&
css`
border-bottom: 1px solid
${props.isAlt && props.customStyle.borderColor
? props.customStyle.borderColor
: buildColor("grey", "300")};
`};
${(props) =>
props.hasMarginTop &&
css`
margin-top: ${(props.hasMarginsLarge && "20") || "8"}px;
`};
${(props) =>
props.hasMarginBottom &&
css`
margin-bottom: ${(props.hasMarginsLarge && "20") || "8"}px;
`};
${(props) => css`
border: ${props.customStyle.borderColor
? `1px solid ${props.customStyle.borderColor}`
: "none"};
`}
${(props) =>
props.customStyle.onlyBorderBottom
? css`
border: none;
border-bottom: ${props.customStyle.borderColor
? `1px solid ${props.customStyle.borderColor}`
: "none"};
`
: ""}
${(props) =>
props.isAlt &&
css`
border: ${props.customStyle.borderColor
? `1px solid ${props.customStyle.borderColor}`
: "none"};
${!props.hasBorderLeft && "border-left: none;"};
${!props.hasBorderRight && "border-right: none;"};
${!props.hasBorderTop && "border-top: none;"};
${!props.hasBorderBottom && "border-bottom: none;"};
border-radius: ${props.hasRoundCorners ? "4px" : "0"};
${props.hasDropShadow &&
css`
box-shadow:
0 4px 4px rgb(0 0 0 / 10%),
0 4px 6px rgb(0 0 0 / 5%);
`};
color: ${props.customStyle.fill || "none"};
font-family: ${fontNormal};
span {
font-family: ${fontNormal};
}
`};
${(props) =>
props.customStyle &&
props.customStyle.iconBackground &&
css`
svg {
border-radius: 50%;
background-color: ${({ customStyle }) =>
customStyle && customStyle.iconBackground
? customStyle.iconBackground
: "transparent"};
}
`};
`;
export const IconTextWrapper = styled.div`
display: flex;
${({ horizontalPadding }) =>
horizontalPadding ? `padding: 0 ${horizontalPadding}px;` : ""}
${({ alignCenter }) => alignCenter && `align-items: center;`}
`;
export const MessageIcon = styled(Icon).attrs({
"data-qa-label": "messageBox-icon"
})`
flex-shrink: 0;
`;
export const VerticalMessageBox = styled(Link)`
display: flex;
flex-direction: column;
align-items: center;
flex: 1 0 0;
justify-content: center;
text-decoration: none;
`;
export const TextWrapper = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
flex-grow: 1;
font-size: 14px;
color: ${(props) => (props.isAlt ? "inherit" : buildColor("grey", "900"))};
text-align: left;
margin-left: ${(props) => props.hasIcon && "12px"};
line-height: 17px;
min-height: ${(props) => props.hasIcon && "16"};
font-family: ${fontNormal};
a {
text-decoration: underline;
color: initial;
}
b {
vertical-align: bottom;
}
`;
export const VerticalTextWrapper = styled.div`
font-size: 12px;
line-height: 16px;
color: ${buildColor("grey", "900")};
text-align: center;
margin-top: 8px;
`;
export const MessageTitle = styled.div`
${({ isAlt }) =>
isAlt
? css`
font-weight: 500;
font-weight: normal;
text-transform: none;
font-family: ${fontMedium};
margin-bottom: 4px;
`
: css`
text-transform: uppercase;
font-weight: bold;
`};
${({ isPromo }) =>
isPromo &&
css`
font-family: ${fontNormal};
font-weight: 400;
font-size: 14px;
text-transform: none;
color: ${buildColor("green", "600")};
`};
${({ promosInvalid }) =>
promosInvalid &&
css`
font-family: ${fontNormal};
font-weight: 400;
font-size: 14px;
text-transform: none;
color: ${buildColor("blue_accent", "600")};
`};
${({ color }) =>
color &&
css`
color: ${color};
`};
`;
export const MessageContent = styled.span`
${({ color }) =>
color &&
css`
color: ${color};
`};
`;
export const CloseBtn = styled.button`
cursor: pointer;
width: 16px;
height: 16px;
margin-left: 12px;
background: none;
`;
export const EditBtn = styled.button`
cursor: pointer;
background: none;
outline: none;
${({ typeButton }) =>
(typeButton === "promos" && `color: ${buildColor("green", "900")}`) ||
(typeButton === "referral" && `color: ${buildColor("green", "900")}`) ||
typeButton === "promosInvalid"
? css`
color: ${buildColor("blue_accent", "500")};
font-family: ${fontMedium};
font-weight: 500;
font-size: 14px;
`
: ""}
`;
export const ArrowIconContainer = styled.div`
width: 16px;
height: 100%;
display: flex;
align-items: center;
`;
export const LogSignupButtonWrapper = styled.div`
margin-top: 12px;
display: flex;
justify-content: flex-start;
padding-left: 16px;
`;
export const LogSignupButton = styled(Button)`
margin-left: 8px;
font-size: 14px;
text-transform: capitalize;
font-family: ${fontMedium};
`;
export const LogSignupButtonInner = styled.span`
line-height: 14px;
height: 12px;
`;
export const LockIcon = styled(Icon)`
margin-right: 4px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MessageBox/index.jsx
import React, { PureComponent } from "react";
import { has, noop } from "lodash";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import { arrowRight, close, lock } from "../../_static/Icons/icons";
import messageBoxStylesDefault, {
styleMapAlt as messageBoxStylesAlt
} from "./styles";
import {
HorizontalMessageBox,
VerticalMessageBox,
IconTextWrapper,
MessageIcon,
TextWrapper,
MessageTitle,
MessageContent,
CloseBtn,
EditBtn,
VerticalTextWrapper,
LogSignupButtonWrapper,
LogSignupButton,
LogSignupButtonInner,
LockIcon,
ArrowIconContainer
} from "./styled-components";
export default class MessageBox extends PureComponent {
renderLoginSignupButton() {
const { onLoginCallback, onSignupCallback } = this.props;
const LoginBtn = has(this.props, "onLoginCallback") &&
typeof onLoginCallback === "function" && (
<LogSignupButton
qaLabel="messageBox-loginBtn"
type="secondary"
onClick={onLoginCallback}
isBold={false}
>
<LockIcon size={16} icon={lock} color={buildColor("grey", "900")} />
<LogSignupButtonInner>log in</LogSignupButtonInner>
</LogSignupButton>
);
const SignupBtn = has(this.props, "onSignupCallback") &&
typeof onSignupCallback === "function" && (
<LogSignupButton
qaLabel="messageBox-signUpBtn"
onClick={onSignupCallback}
isBold={false}
>
sign up
</LogSignupButton>
);
return (
(LoginBtn || SignupBtn) && (
<LogSignupButtonWrapper>
{LoginBtn}
{SignupBtn}
</LogSignupButtonWrapper>
)
);
}
renderMessage(style) {
const { message: PropsMessage } = this.props;
const message = React.isValidElement(PropsMessage) ? (
<MessageContent color={style.color}>{PropsMessage}</MessageContent>
) : (
// eslint-disable-next-line react/no-danger
<MessageContent
color={style.color}
dangerouslySetInnerHTML={{ __html: PropsMessage }}
/>
);
return message;
}
getMsgSubtypeProps() {
const msgSubtypePropsDefault = {
hasBorderLeft: false,
hasBorderRight: false,
hasBorderBottom: false,
hasBorderTop: false,
hasRoundCorners: false,
hasDropShadow: false
};
const msgSubtypeProps = {
contextual: msgSubtypePropsDefault,
fullWith: {
hasBorderTop: true,
hasBorderBottom: true
},
floating: {
hasBorderLeft: true,
hasBorderRight: true,
hasBorderTop: true,
hasBorderBottom: true,
hasRoundCorners: true
},
scratchcard: {
hasBorderLeft: true,
hasBorderRight: true,
hasBorderTop: true,
hasBorderBottom: true,
hasRoundCorners: true,
hasDropShadow: true
}
};
return this.props.subtype &&
this.props.subtype !== "custom" &&
msgSubtypeProps[this.props.subtype]
? { ...msgSubtypePropsDefault, ...msgSubtypeProps[this.props.subtype] }
: {};
}
renderHorizontalMessage(style, hasIcon, hasTitle) {
const {
children,
title,
url,
className,
type,
subtype,
onClick,
hasBorderBottom,
hasBorderTop,
hasMarginBottom,
hasMarginTop,
hasMarginsLarge,
horizontalPadding,
isAlt,
onClose,
hasEdit,
editHandleClick,
alignCenter,
fullBoxOnClick
} = this.props;
const Message = url
? HorizontalMessageBox
: HorizontalMessageBox.withComponent("div");
const messageProps = url
? { ...this.getMsgSubtypeProps(), to: url, onClick }
: { ...this.getMsgSubtypeProps() };
return (
<Message
customStyle={style}
hasIcon={hasIcon}
hasTitle={hasTitle}
type={type}
className={className}
data-qa-label={`messageBox-${type}`}
hasBorderBottom={hasBorderBottom}
hasBorderTop={hasBorderTop}
hasMarginTop={hasMarginTop}
hasMarginBottom={hasMarginBottom}
hasMarginsLarge={hasMarginsLarge}
onClick={fullBoxOnClick}
isAlt={isAlt}
{...messageProps}
>
<IconTextWrapper
alignCenter={alignCenter}
horizontalPadding={horizontalPadding}
>
{hasIcon && (
<MessageIcon
icon={style.icon}
strokeColorList={style.strokeColorList || []}
size={16}
color={style.fill}
colorList={style.colorList || []}
qaLabel="messageBox-icon"
viewBoxSize={style.viewBoxSize || 1024}
/>
)}
<TextWrapper
hasIcon={hasIcon}
data-qa-label="messageBox-text"
isAlt={isAlt}
>
{title && (
<MessageTitle
data-qa-label="messageBox-title"
isAlt={isAlt}
isPromo={type === "promos" || type === "referral"}
promosInvalid={type === "promosInvalid"}
color={style.color}
>
{title}
</MessageTitle>
)}
{this.renderMessage(style)}
</TextWrapper>
{onClose && (
<CloseBtn onClick={onClose} data-qa-label="messageBox-closeBtn">
<Icon icon={close} size={16} color={buildColor("blue", "800")} />
</CloseBtn>
)}
{hasEdit && (
<EditBtn
type="button"
onClick={editHandleClick}
data-qa-label="messageBox-editBtn"
typeButton={type}
>
{type === "promosInvalid" ? "Change" : "Edit"}
</EditBtn>
)}
{url && (
<ArrowIconContainer>
<Icon
icon={arrowRight}
size={16}
color={buildColor("blue", "800")}
/>
</ArrowIconContainer>
)}
</IconTextWrapper>
{this.renderLoginSignupButton()}
{children}
</Message>
);
}
renderVerticalMessage(style) {
const { children, title, url, className, type, hasIcon } = this.props;
const Message = url
? VerticalMessageBox
: VerticalMessageBox.withComponent("div");
const messageProps = url ? { to: url } : {};
return (
<Message
className={className}
data-qa-label={`messageBox-${type}`}
{...messageProps}
>
{hasIcon && (
<MessageIcon
icon={style.icon}
size={16}
color={style.fill}
qaLabel="messageBox-icon"
/>
)}
<VerticalTextWrapper data-qa-label="messageBox-text">
{title && (
<MessageTitle
isVertical
data-qa-label="messageBox-title"
color={style.color}
>
{title}
</MessageTitle>
)}
{this.renderMessage(style)}
</VerticalTextWrapper>
{this.renderLoginSignupButton()}
{children}
</Message>
);
}
render() {
const { isAlt, addonStyle, type, isVertical, hasIcon, title } = this.props;
const messageBoxStyles = isAlt
? messageBoxStylesAlt
: messageBoxStylesDefault;
const style = addonStyle
? {
...messageBoxStyles[type],
addonStyle
}
: messageBoxStyles[type];
if (isVertical) {
return this.renderVerticalMessage(style);
}
return this.renderHorizontalMessage(style, hasIcon, !!title);
}
}
MessageBox.defaultProps = {
type: "default",
subtype: "custom",
message: "",
className: "",
hasIcon: true,
hasBorderBottom: false,
hasBorderTop: false,
isVertical: false,
title: null,
children: null,
onClick: noop,
onClose: null,
onLoginCallback: null,
onSignupCallback: null,
url: null,
hasMarginTop: false,
hasMarginBottom: false,
hasEdit: false,
addonStyle: null,
isAlt: false
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ErrorPage/styled-components.js
import styled, { css, keyframes } from "styled-components";
import { rgba } from "polished";
import Logo from "../../_static/Logos";
import Button from "../../_atom/Buttons/button";
import DefaultButton from "../../_atom/Buttons/default";
import Icon from "../../_static/Icons";
import MessageBox from "../../_molecule/MessageBox";
import buildColor from "../../_static/ColorPalette";
import {
defaultSize,
fontBold,
fontNormal,
fontMedium
} from "../../_static/Typography";
export const Page = styled.div`
position: relative;
padding: 24px 8px 0;
background-color: ${buildColor("blue", "700")};
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
overflow: auto;
`;
export const CloseBtn = styled(DefaultButton)`
position: absolute;
top: 12px;
right: 12px;
width: 16px;
height: 16px;
background: none;
`;
export const LogoUnshrink = styled(Logo)`
flex-shrink: 0;
`;
export const IconTextContainer = styled.div`
display: flex;
flex-direction: column;
align-items: center;
justify-content: ${(props) =>
props.verticalAlign ? "center" : "flex-start"};
flex-grow: 1;
margin: 24px 0 16px;
flex-shrink: 0;
max-width: 414px;
`;
export const CircleContainer = styled.div`
min-height: 104px;
max-height: 112px;
flex-shrink: 1;
flex-grow: 1;
`;
export const IconCircle = styled.div`
display: flex;
align-items: center;
justify-content: center;
width: 96px;
height: 96px;
border-radius: 50%;
background-color: ${rgba(buildColor("black", "100"), 0.15)};
&:not(:last-child) {
margin-bottom: 8px;
}
`;
const RotateAnimation = keyframes`
0% {
transform: rotate(0deg);
}
75%, 100% {
transform: rotate(360deg);
}
`;
export const MainIcon = styled(Icon)`
${(props) =>
props.loading
? css`
animation: ${RotateAnimation} 750ms infinite ease-in-out running;
`
: css`
margin-bottom: ${props.hasBottomMargin && "8px"};
`};
`;
export const PreTitle = styled.h2`
font-size: 18px;
color: ${buildColor("white", "100")};
font-weight: bold;
text-align: center;
text-transform: uppercase;
`;
export const Title = styled.h1`
font-size: 18px;
color: ${buildColor("white", "100")};
font-weight: bold;
text-align: center;
text-transform: uppercase;
&:not(:last-child) {
margin-bottom: 4px;
}
`;
export const Description = styled.p`
font-size: ${defaultSize};
color: ${buildColor("blue", "300")};
text-align: center;
line-height: 18px;
white-space: pre-line;
& > * > em {
font-style: normal;
color: ${buildColor("white", "100")};
}
& > * > a {
text-decoration: none;
color: ${buildColor("blue_accent", "500")};
}
&:not(:last-child) {
margin-bottom: 8px;
}
`;
export const MsgAndInfoBoxContainer = styled.div`
width: 100%;
max-width: 414px;
`;
export const InfoBox = styled.div`
width: 100%;
padding: 8px;
margin-bottom: 8px;
border-radius: 2px;
background-color: ${buildColor("white", "100")};
& > *:not(:last-child) {
margin-bottom: 8px;
}
`;
export const InfoMessage = styled(MessageBox)`
border-radius: 2px;
`;
export const InstructionsTitle = styled.h3`
font-size: 12px;
font-weight: bold;
text-align: left;
margin-bottom: 4px;
& :not(:first-child) {
margin-top: 8px;
}
`;
export const Instructions = styled.ol`
font-size: 12px;
text-align: left;
color: ${buildColor("grey", "900")};
counter-reset: item;
`;
export const SingleInstruction = styled.p`
font-size: 12px;
text-align: left;
color: ${buildColor("grey", "900")};
`;
export const Instruction = styled.li`
list-style-type: none;
counter-increment: item;
& ::before {
content: counter(item) " - ";
font-weight: bold;
}
& :not(:last-child) {
margin-bottom: 6px;
}
`;
export const BtnsContainer = styled.div`
display: flex;
width: 100%;
`;
export const Btn = styled(Button)`
flex-grow: 1;
flex-basis: ${(props) => props.flexBasis};
&:not(:last-child) {
margin-right: 8px;
}
`;
export const BtnIcon = styled(Icon)`
margin-right: 8px;
`;
export const CustomerServicesInfoContainer = styled.div`
display: flex;
justify-content: center;
align-items: center;
&:not(:first-child) {
margin-top: 16px;
}
`;
export const CustomerServicesIcon = styled(Icon)`
margin: 0 4px 0 16px;
`;
export const CustomerServicesText = styled.p`
font-size: 12px;
line-height: 18px;
font-weight: bold;
color: ${buildColor("grey", "900")};
text-transform: uppercase;
`;
export const CustomerServicesUrl = styled.a`
display: flex;
align-items: center;
text-decoration: none;
font-size: ${defaultSize};
line-height: 24px;
font-weight: bold;
color: ${buildColor("blue_accent", "500")};
`;
export const BlockedIconTextContainer = styled.div`
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
flex-grow: 1;
flex-shrink: 0;
`;
export const IconsContainer = styled.div`
position: relative;
`;
export const SecundaryIcon = styled(Icon)``;
export const BlockedTitle = styled.h1`
font-family: ${fontBold};
text-align: center;
color: ${buildColor("white", "100")};
font-size: 16px;
line-height: 22px;
margin-top: 38px;
`;
export const BlockedDescription = styled.p`
color: ${buildColor("blue", "100")};
margin-top: 10px;
font-family: ${fontNormal};
font-size: 14px;
line-height: 18px;
text-align: center;
`;
export const IconWrapper = styled.div`
border-radius: 50%;
width: 37px;
height: 37px;
position: absolute;
top: -10px;
right: -10px;
`;
export const BlockedCountryBtn = styled(Button)`
width: 100%;
height: 44px;
background-color: ${buildColor("white", "10")};
margin-bottom: 12px;
text-transform: none;
font-size: 14px;
font-family: ${fontMedium};
color: ${buildColor("blue", "000")};
&:hover {
background-color: ${buildColor("white", "20")};
color: ${buildColor("white", "100")};
}
&:focus {
background-color: ${buildColor("white", "30")};
color: ${buildColor("white", "100")};
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ErrorPage/index.jsx
import React, { Component, Fragment } from "react";
import { get, isEqual } from "lodash";
import Icon from "../../_static/Icons";
import SpinningWheel from "../../_atom/SpinningWheel";
import * as allIcons from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import CountryIcon from "../../_static/SvgImages/CountryIcon";
import EmailIcon from "../../_static/SvgImages/emailTvg";
import {
Page,
CloseBtn,
LogoUnshrink,
IconTextContainer,
CircleContainer,
IconCircle,
MainIcon,
PreTitle,
Title,
Description,
MsgAndInfoBoxContainer,
InfoBox,
InfoMessage,
InstructionsTitle,
Instructions,
SingleInstruction,
Instruction,
BtnsContainer,
Btn,
BtnIcon,
CustomerServicesInfoContainer,
CustomerServicesIcon,
CustomerServicesText,
CustomerServicesUrl,
BlockedIconTextContainer,
IconsContainer,
SecundaryIcon,
BlockedTitle,
BlockedDescription,
BlockedCountryBtn,
IconWrapper
} from "./styled-components";
const ICON_FALLBACK = allIcons.exclamation;
const iconMap = {
error: allIcons.errorOutline,
location: allIcons.locationPin,
warning: allIcons.warningOutline,
loading: allIcons.refresh,
overload: allIcons.overload,
settings: allIcons.settings,
refresh: allIcons.refresh,
wifi: allIcons.wifi,
timer: allIcons.timer,
calendar: allIcons.calendar,
lock: allIcons.lock,
exclamationMarkYellow: allIcons.exclamationMarkYellow
};
const genQALabel = (value = "") => value.replace(/_/g, "-").toLowerCase();
export default class ErrorPage extends Component {
static defaultProps = {
brand: "tvg",
icon: "warning",
title: "",
showCustomerServicesUrl: false,
isApp: false,
infoType: "info",
isAndroidBlocked: false,
isLoading: false,
androidBlockType: "country"
};
shouldComponentUpdate(nextProps) {
return !isEqual(this.props, nextProps);
}
getAndroidSVGicon = () => {
switch (this.props.androidBlockType) {
case "country":
return (
<React.Fragment>
<CountryIcon />
<IconWrapper>
<SecundaryIcon
size={37}
icon={iconMap.exclamationMarkYellow || ICON_FALLBACK}
/>
</IconWrapper>
</React.Fragment>
);
case "state":
return <EmailIcon />;
default:
return <CountryIcon />;
}
};
renderButtons() {
return (
this.props.buttons &&
this.props.buttons.map((buttonLine, index) => (
// eslint-disable-next-line react/no-array-index-key
<BtnsContainer key={index} data-qa-label="btns-container">
{buttonLine.map((button) => (
<Btn
key={button.text}
onClick={button.onClick}
flexBasis={button.flexBasis}
type={button.type}
size="big"
isDisabled={button.isDisabled}
qaLabel={`btn-${genQALabel(button.text)}`}
>
{button.icon && (
<BtnIcon
icon={iconMap[button.icon] || ICON_FALLBACK}
size={16}
color={buildColor("white", "100")}
qaLabel={`btn-${genQALabel(button.text)}-icon`}
/>
)}
{button.text}
</Btn>
))}
</BtnsContainer>
))
);
}
renderInstructions() {
if (this.props.instructions) {
return (
<div>
{this.props.instructions.map((instructionsObj) => (
<Fragment key={`instructions-${instructionsObj.title || ""}`}>
{instructionsObj.title && (
<InstructionsTitle>{instructionsObj.title}</InstructionsTitle>
)}
{instructionsObj.instructions.length === 1 ? (
<SingleInstruction>
{instructionsObj.instructions[0]}
</SingleInstruction>
) : (
<Instructions>
{instructionsObj.instructions.map((instruction) => (
<Instruction key={instruction}>{instruction}</Instruction>
))}
</Instructions>
)}
</Fragment>
))}
</div>
);
}
return null;
}
renderCustomerServicesIcon = () => (
<CustomerServicesIcon
icon={allIcons.chat}
size={16}
color={buildColor("blue_accent", "500")}
/>
);
renderInfoBox() {
if (
this.props.infoText ||
this.props.instructions ||
this.props.buttons ||
(this.props.showCustomerServicesUrl && this.props.customerServicesUrl)
) {
return (
<InfoBox>
{this.props.infoText && (
<InfoMessage
message={this.props.infoText}
type={this.props.infoType}
/>
)}
{this.renderInstructions()}
{this.props.buttons && this.renderButtons()}
{this.props.showCustomerServicesUrl &&
this.props.customerServicesUrl && (
<CustomerServicesInfoContainer>
<CustomerServicesText>Need help?</CustomerServicesText>
{this.props.isApp ? (
<CustomerServicesUrl
to={this.props.customerServicesUrl}
onClick={this.props.iOSMessageUsCallback}
>
{this.renderCustomerServicesIcon()}
Message us
</CustomerServicesUrl>
) : (
<CustomerServicesUrl
target="_blank"
href={this.props.customerServicesUrl}
>
{this.renderCustomerServicesIcon()}
Message us
</CustomerServicesUrl>
)}
</CustomerServicesInfoContainer>
)}
</InfoBox>
);
}
return null;
}
renderIconTextContainer = () => (
<IconTextContainer verticalAlign={this.props.icon === "loading"}>
<CircleContainer data-qa-label="circle-container">
<IconCircle data-qa-label="icon-circle">
<MainIcon
hasBottomMargin={this.props.icon === "warning"}
icon={iconMap[this.props.icon] || ICON_FALLBACK}
size={40}
color={buildColor("white", "100")}
loading={this.props.icon === "loading"}
qaLabel="icon-circle-main"
/>
</IconCircle>
</CircleContainer>
{this.props.preTitle && (
<PreTitle
data-qa-label={`pre-title-${genQALabel(this.props.preTitle)}`}
>
{this.props.preTitle}
</PreTitle>
)}
<Title data-qa-label={`title-${genQALabel(this.props.title)}`}>
{this.props.title}
</Title>
{this.props.description && (
<Description
data-qa-label={`description-${genQALabel(this.props.title)}`}
>
{this.props.description}
</Description>
)}
</IconTextContainer>
);
renderInfoAndroidBlocked = () => {
return (
<BlockedIconTextContainer>
<IconsContainer data-qa-label="icon-circle">
{this.getAndroidSVGicon()}
</IconsContainer>
<BlockedTitle data-qa-label={`title-${genQALabel(this.props.title)}`}>
{this.props.title}
</BlockedTitle>
{this.props.description && (
<BlockedDescription
dangerouslySetInnerHTML={{ __html: this.props.description }}
data-qa-label={`description-${genQALabel(this.props.title)}`}
/>
)}
</BlockedIconTextContainer>
);
};
renderAndroidBlockedButton = () => {
const button = get(this.props, "buttons[0][0]");
return (
button && (
<BlockedCountryBtn
key={button.text}
onClick={button.onClick}
isDisabled={button.isDisabled}
qaLabel={`btn-${genQALabel(button.text)}`}
>
{this.props.isLoading ? (
<SpinningWheel />
) : (
<Fragment>
{button.icon && (
<BtnIcon
icon={iconMap[button.icon] || ICON_FALLBACK}
size={16}
color={buildColor("blue", "000")}
qaLabel={`btn-${genQALabel(button.text)}-icon`}
/>
)}
{button.text}
</Fragment>
)}
</BlockedCountryBtn>
)
);
};
render() {
return (
<Page className={this.props.className}>
{this.props.onClose && (
<CloseBtn onClick={this.props.onClose}>
<Icon
icon={allIcons.close}
size={16}
color={buildColor("white", "100")}
/>
</CloseBtn>
)}
<LogoUnshrink brand={this.props.brand} height={24} />
{this.props.isAndroidBlocked
? this.renderInfoAndroidBlocked()
: this.renderIconTextContainer()}
<MsgAndInfoBoxContainer
data-qa-label={`mg-and-info-box-container-${genQALabel(
this.props.preInfoText
)}`}
>
{this.props.preInfoText && (
<Description
data-qa-label={`mg-and-info-box-description-${genQALabel(
this.props.preInfoText
)}`}
>
{this.props.preInfoText}
</Description>
)}
{this.props.isAndroidBlocked
? this.renderAndroidBlockedButton()
: this.renderInfoBox()}
</MsgAndInfoBoxContainer>
</Page>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-utils/withCustomRouter.jsx
import React from "react";
import { useLocation, useNavigate, useParams } from "react-router-dom";
export const withRouter = (Component) => {
return (props) => {
const location = useLocation();
const history = useNavigate();
const match = { params: useParams() };
const customProps = {
history: {
back: () => history(-1),
goBack: () => history(-1),
location,
push: (url, state) => history(url, { state }),
replace: (url, state) =>
history(url, {
replace: true,
state
})
},
location,
match
};
return <Component {...customProps} {...props} />;
};
};
export default withRouter;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/NotificationBubble/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import { fontNormal } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
const NotificationBubbleContainer = styled(Link)`
display: flex;
position: relative;
width: ${({ size }) => `${size}px`};
height: ${({ size }) => `${size}px`};
justify-content: center;
align-items: center;
background-color: ${({ $isDesktop }) =>
$isDesktop ? "transparent" : buildColor("white", "10")};
border-radius: 50%;
${({ $tvgHeaderV2FeatureToggle }) =>
$tvgHeaderV2FeatureToggle &&
css`
svg > path {
transform: translate(1px, 3px);
}
`};
${({ $isDesktop }) =>
!$isDesktop &&
css`
svg {
margin-top: 10px;
margin-left: 6.5px;
}
`}
&::after {
${(props) =>
props.$isCounterShown &&
css`
content: "${props.counter}";
position: absolute;
top: 0;
left: calc(50% + 3px);
border-radius: 17px;
height: 17px;
line-height: 17px;
text-align: center;
font-family: ${fontNormal};
font-weight: bold;
font-size: 12px;
color: ${buildColor("white", "100")};
background-color: ${buildColor("red", "500")};
padding: 0 5px;
`};
}
`;
export default NotificationBubbleContainer;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/NotificationBubble/index.jsx
import React from "react";
import { noop, isNaN } from "lodash";
import tvgConf from "@tvg/conf";
import Icon from "../../_static/Icons";
import { envelope } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import NotificationBubbleContainer from "./styled-components";
const COUNTER_LIMIT_DEFAULT = 99;
const LOGO_SIZE = 32;
// const ICON_SIZE_M = 16;
const ICON_SIZE_L = 20;
const getCounterValue = (counter, counterLimit) => {
if (counter && !isNaN(counter)) {
return counter < (counterLimit || COUNTER_LIMIT_DEFAULT)
? `${counter}`
: `+${counterLimit || COUNTER_LIMIT_DEFAULT}`;
}
return null;
};
const NotificationBubble = ({
counter,
counterLimit,
icon,
to,
clickHandler,
qaLabel,
className,
device,
as,
tvgHeaderV2FeatureToggle,
viewBoxSize,
iconSize
}) => {
const isDesktop = tvgConf().device === "desktop";
return (
<NotificationBubbleContainer
data-qa-label={qaLabel}
className={className}
size={LOGO_SIZE}
to={to}
onClick={clickHandler}
$isDesktop={isDesktop}
$tvgHeaderV2FeatureToggle={tvgHeaderV2FeatureToggle}
$isCounterShown={counter > 0}
counter={getCounterValue(counter, counterLimit)}
as={as}
>
{tvgHeaderV2FeatureToggle ? (
<Icon
icon={icon}
size={isDesktop ? iconSize : 24}
viewBoxSize={isDesktop ? viewBoxSize : 24}
qaLabel={`${qaLabel}-icon`}
color="transparent"
/>
) : (
<Icon
icon={icon}
size={24}
viewBoxSize={isDesktop ? viewBoxSize : 24}
qaLabel={`${qaLabel}-icon`}
color={isDesktop ? buildColor("blue", "100") : "transparent"}
/>
)}
</NotificationBubbleContainer>
);
};
NotificationBubble.defaultProps = {
counterLimit: COUNTER_LIMIT_DEFAULT,
icon: envelope,
to: "#content-cards",
clickHandler: noop,
className: "",
device: "mobile",
as: "",
viewBoxSize: 1024
};
export default NotificationBubble;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/VideoButton/styled-components.js
import styled from "styled-components";
import { fontMedium } from "../../_static/Typography";
import Button from "../../_atom/Buttons/button";
const VideoButtonContainer = styled(Button)`
font-family: ${fontMedium};
font-size: 14px;
`;
export default VideoButtonContainer;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/VideoButton/VideoButtonInfo/styled-components.js
import styled, { css } from "styled-components";
import { buildText } from "../../../_atom/Text";
import { fontMedium } from "../../../_static/Typography";
const Text = styled(
buildText({
fontSize: 14,
uppercase: false
})
)`
text-transform: capitalize;
font-family: ${fontMedium};
${(props) =>
props.vertical
? css`
display: block;
`
: css`
margin-left: 4px;
`};
`;
export default Text;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/VideoButton/VideoButtonInfo/index.jsx
import React, { Fragment } from "react";
import buildColor from "../../../_static/ColorPalette";
import Icon from "../../../_static/Icons";
import {
video,
noVideo,
videoReplay,
noVideoReplay
} from "../../../_static/Icons/icons";
import Text from "./styled-components";
const iconType = {
NOT_AVAILABLE_REPLAY: videoReplay,
STARTING_SOON_REPLAY: videoReplay,
FINISHED_REPLAY: videoReplay,
AVAILABLE_REPLAY: videoReplay,
NOT_AVAILABLE_NO_REPLAY: noVideo,
STARTING_SOON_NO_REPLAY: video,
FINISHED_NO_REPLAY: noVideoReplay,
AVAILABLE_NO_REPLAY: video
};
export const videoMessages = {
NOT_AVAILABLE_REPLAY: "Video Replay",
STARTING_SOON_REPLAY: "Video Replay",
FINISHED_REPLAY: "Video Replay",
AVAILABLE_REPLAY: "Video Replay",
NOT_AVAILABLE_NO_REPLAY: "Not Available",
STARTING_SOON_NO_REPLAY: "Starting Soon",
FINISHED_NO_REPLAY: "No Replay",
AVAILABLE_NO_REPLAY: "Watch Live"
};
export default (optionsData) => {
const options = {
small: false,
vertical: false,
iconSize: 16,
...optionsData
};
return (
<Fragment>
<Icon
color={buildColor("white", "100")}
icon={iconType[options.feedback]}
size={options.iconSize}
/>
{!options.small && (
<Text vertical={options.vertical}>
{videoMessages[options.feedback]}
</Text>
)}
</Fragment>
);
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/VideoButton/index.jsx
import React, { PureComponent } from "react";
import { noop, get } from "lodash";
import VideoButtonContainer from "./styled-components";
import buildButtonInfo, { videoMessages } from "./VideoButtonInfo";
export default class VideoButton extends PureComponent {
static defaultProps = {
small: false,
onClick: noop
};
render() {
const { feedback, small, onClick } = this.props;
return (
<VideoButtonContainer
isBold={false}
isDisabled={
feedback.indexOf("AVAILABLE") !== 0 &&
feedback.indexOf("NO_REPLAY") > -1
}
type={
feedback.indexOf("NO_REPLAY") === -1 ? "secondary_alt" : "primary"
}
onClick={onClick}
isStretched={!small}
qaLabel={`raceCardHeader-${get(
videoMessages,
`[${feedback}]`,
""
).replace(" ", "")}`}
>
{buildButtonInfo({ feedback, small })}
</VideoButtonContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Buttons/promos.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import Icon from "../../_static/Icons";
import { optedin, promosolid } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import {
OptedInAlt,
OptedIn,
Promos,
PromosExternal
} from "./styled-components";
export default class PromosButton extends PureComponent {
static defaultProps = {
promoPath: "",
qaLabel: "",
isOptedIn: false,
useAltLink: false,
onClick: noop,
isExternal: false
};
render() {
const OptedInComp = this.props.useAltLink ? OptedInAlt : OptedIn;
const LinkOrRef = this.props.isExternal ? PromosExternal : Promos;
const Button = this.props.isOptedIn ? OptedInComp : LinkOrRef;
return (
<Button
to={this.props.promoPath}
onClick={this.props.onClick}
{...(this.props.qaLabel !== ""
? {
"data-qa-label": this.props.qaLabel
}
: {})}
>
<Icon
icon={this.props.isOptedIn ? optedin : promosolid}
color={buildColor("white", "100")}
/>
{this.props.isOptedIn ? "Opted-In" : "Promo"}
</Button>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RaceInfoInline/styled-components.js
import styled, { css } from "styled-components";
import { buildText } from "../../_atom/Text";
import buildColor from "../../_static/ColorPalette";
import { fontMedium, fontNormal } from "../../_static/Typography";
const getDescriptionColor = (importanceLevel, isDark) => {
switch (importanceLevel) {
case "0":
return isDark ? buildColor("white", "100") : buildColor("grey", "800");
case "1":
return isDark ? buildColor("blue", "300") : buildColor("blue", "500");
default:
return buildColor("grey", "900");
}
};
export const RaceDataWrapper = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
padding-right: 5px;
flex: 1;
padding-top: 1px;
color: white;
`;
export const RacePromoWrapper = styled.div`
width: 100%;
flex-flow: row;
justify-content: space-between;
margin-bottom: 7px;
display: flex;
align-items: center;
`;
export const Wrapper = styled.div`
display: flex;
justify-content: space-between;
${(props) =>
props.hasRaceEvent &&
css`
align-items: end;
`}
`;
export const EventWrapper = styled.div`
display: flex;
flex-flow: column;
align-items: end;
`;
export const RaceDataList = styled.ul`
display: flex;
flex-wrap: wrap;
list-style-type: none;
> li {
color: ${(props) => props.textColor};
}
`;
export const RaceDataListItem = styled.li`
font-size: 12px;
color: ${(props) => props.color};
display: flex;
align-items: center;
font-family: ${fontNormal};
&:not(:last-child) {
border-right: 1px solid
${(props) =>
props.isDark ? buildColor("white", "20") : buildColor("grey", "600")};
padding-right: 4px;
margin-right: 4px;
}
`;
export const TitleContainer = styled.div`
align-items: center;
justify-content: flex-start;
flex-wrap: nowrap;
display: flex;
overflow: hidden;
flex-grow: 1;
margin-bottom: 4px;
`;
export const DescriptionContainer = styled.div`
display: flex;
width: 100%;
flex-wrap: wrap;
align-items: center;
`;
export const Description = styled(
buildText({
tag: "span",
fontSize: 14,
bold: false
})
)`
display: flex;
align-items: center;
line-height: 1;
text-transform: uppercase;
font-family: ${fontMedium};
color: ${(props) => getDescriptionColor(props.importanceLevel, props.isDark)};
`;
export const Title = styled(
buildText({
tag: "span",
fontSize: 14,
color: buildColor("grey", "900"),
bold: false,
uppercase: true
})
)`
font-family: ${fontMedium};
padding-right: 8px;
`;
export const SubTitle = styled(
buildText({
tag: "strong",
fontSize: 14,
color: buildColor("grey", "900"),
bold: false,
uppercase: true,
ellipsis: true
})
)`
padding-right: 8px;
`;
export const PromoBadge = styled.div`
display: flex;
color: ${buildColor("grey", "800")};
text-transform: uppercase;
font-size: 10px;
font-weight: bold;
align-items: center;
justify-content: space-between;
`;
export const PromoBadgeText = styled.span`
margin-left: 3px;
`;
export const ChangesIcon = styled.span`
padding-right: 2px;
display: inherit;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RaceInfoInline/index.jsx
import React, { Component, Fragment } from "react";
import { noop, get, isEqual } from "lodash";
import { buildPromoBadgeURL } from "@tvg/formatter/url";
import ButtonPromos from "../../_atom/Buttons/promos";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import { promosolid, ippChanges, optedin } from "../../_static/Icons/icons";
import {
RaceDataWrapper,
Description,
RaceDataList,
RaceDataListItem,
TitleContainer,
DescriptionContainer,
Title,
SubTitle,
RacePromoWrapper,
Wrapper,
EventWrapper,
PromoBadge,
PromoBadgeText,
ChangesIcon
} from "./styled-components";
const getColor = (isDark, isGrey) => {
let color;
if (isDark && !isGrey) {
color = buildColor("white", "100");
} else if (!isDark && isGrey) {
color = buildColor("grey", "900");
} else {
color = buildColor("grey", "800");
}
return color;
};
export default class RaceInfoInline extends Component {
static defaultProps = {
importanceLevel: "0",
isDark: false,
description: "",
raceData: [],
raceNumber: "1",
isGreyDarkText: false,
title: null,
subTitle: null,
promo: null,
showPromoBadge: false,
onPromoClick: noop,
useAltLink: false,
isRaceDataChangesShown: false,
enablePromosStoryblok: false,
isExternalPromo: false,
useIsPromoTagShownFlag: false
};
constructor(props) {
super(props);
this.state = {
hasRaceEvent: false,
hasPromo: false,
isOptedIn: false
};
}
shouldComponentUpdate(nextProps) {
return !isEqual(nextProps, this.props);
}
static getDerivedStateFromProps(props) {
const isPromoTagShown = get(props, "promo.isPromoTagShown", false);
const hasPromo = props.useIsPromoTagShownFlag
? isPromoTagShown && !!props.promo
: !!props.promo;
const isOptedIn = get(props.promo, "isOptedIn", false);
return {
hasRaceEvent: props.description || props.title,
hasPromo: isOptedIn || hasPromo,
isOptedIn
};
}
renderListItems() {
return this.props.raceData.map((listItem, index) => (
<RaceDataListItem
data-qa-label="raceInfoInline-item"
isDark={this.props.isDark}
color={getColor(this.props.isDark, this.props.isGreyDarkText)}
// eslint-disable-next-line react/no-array-index-key
key={`${listItem.value}-${index}`}
>
{this.props.isRaceDataChangesShown && listItem.changed && (
<ChangesIcon>
<Icon
icon={ippChanges}
size={15}
color={buildColor("yellow", "500")}
/>
</ChangesIcon>
)}
{listItem.value}
</RaceDataListItem>
));
}
renderDescription() {
if (this.props.title && this.props.subTitle) {
return (
<DescriptionContainer>
<TitleContainer>
<SubTitle>{this.props.subTitle}</SubTitle>
<Title>{this.props.title}</Title>
</TitleContainer>
<Description
isDark={this.props.isDark}
importanceLevel={this.props.importanceLevel}
>
{this.props.description}
</Description>
</DescriptionContainer>
);
}
return (
<Description
isDark={this.props.isDark}
importanceLevel={this.props.importanceLevel}
>
{this.props.title && <Title>{this.props.title}</Title>}
{this.props.description}
</Description>
);
}
renderPromoBtn = (isExternal) => {
const promoPath = get(this.props, "promo.promoPath", "");
return (
<ButtonPromos
isExternal={isExternal}
promoPath={
isExternal
? promoPath
: buildPromoBadgeURL(
promoPath,
get(this.props, "raceNumber", "1"),
this.props.enablePromosStoryblok
)
}
isOptedIn={this.state.isOptedIn}
qaLabel="promoBtn"
onClick={this.props.onPromoClick}
useAltLink={this.props.useAltLink}
/>
);
};
renderPromoBadge = () => (
<PromoBadge>
<Icon
icon={this.state.isOptedIn ? optedin : promosolid}
color={this.state.isOptedIn ? null : buildColor("white", "100")}
/>
<PromoBadgeText>
{this.state.isOptedIn ? "Opted-In" : "Promo"}
</PromoBadgeText>
</PromoBadge>
);
renderWithEvent = () => (
<EventWrapper>
<RacePromoWrapper>
{this.renderDescription()}
{this.state.hasPromo && this.renderPromoBadge()}
</RacePromoWrapper>
<RaceDataList>{this.renderListItems()}</RaceDataList>
</EventWrapper>
);
renderWithoutEvent = () => (
<Wrapper hasRaceEvent>
<RaceDataWrapper>
<RaceDataList>{this.renderListItems()}</RaceDataList>
</RaceDataWrapper>
{this.state.hasPromo && this.renderPromoBadge()}
</Wrapper>
);
renderWithBadge = () =>
this.state.hasRaceEvent
? this.renderWithEvent()
: this.renderWithoutEvent();
render() {
return (
<Fragment>
{this.props.showPromoBadge ? (
this.renderWithBadge()
) : (
<Wrapper>
<RaceDataWrapper>
{this.state.hasRaceEvent && this.renderDescription()}
<RaceDataList>{this.renderListItems()}</RaceDataList>
</RaceDataWrapper>
{this.state.hasPromo &&
this.renderPromoBtn(this.props.isExternalPromo)}
</Wrapper>
)}
</Fragment>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/MTP/styled-components.js
import styled, { css } from "styled-components";
import { formatPeriod } from "@tvg/formatter/dates";
import { fontNormal, fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
const MTPTime = styled.time.attrs((props) => ({
dateTime: props.postTime.toString()
}))`
display: inline-flex;
flex-direction: ${(props) => (props.multipleLine ? "column" : "row")};
align-items: center;
justify-content: center;
min-height: ${(props) =>
!props.paddingless && (props.multipleLine ? "40px" : "32px")};
padding: ${(props) => !props.multipleLine && !props.paddingless && "0 16px"};
min-width: ${(props) => props.multipleLine && "56px"};
height: 100%;
border-radius: ${(props) => props.darken && "2px"};
font-size: 12px;
line-height: ${(props) => (props.bigger ? "16px" : "14px")};
background-color: ${(props) => props.darken && buildColor("black", "30")};
color: ${(props) => props.darken && buildColor("white", "100")};
${(props) =>
props.showRaceDate && "text-align: center; text-transform: uppercase;"};
&::before {
${(props) =>
props.mtp <= props.mtpCloseThreshold &&
!props.isRaceOff &&
"content: '';"};
display: block;
width: 8px;
height: 8px;
margin-right: ${(props) => !props.multipleLine && "4px"};
margin-bottom: ${(props) => props.multipleLine && "4px"};
border-radius: 50%;
background-color: ${buildColor("red", "500")};
}
&::after {
display: inline-block;
content: ${(props) =>
!props.isRaceOff &&
!props.showRaceDate &&
props.mtp > props.mtpThreshold &&
`"${formatPeriod(props.postTime).toString()}"`};
margin-left: ${(props) => !props.multipleLine && "3px"};
}
@media (pointer: coarse) {
line-height: ${(props) => (props.bigger ? "15px" : "13px")};
}
`;
export const RaceClosedStatus = styled.span`
width: 32px;
height: 16px;
display: flex;
font-size: 12px;
align-items: center;
justify-content: center;
border-radius: 1px;
background-color: ${(props) =>
props.status === "RO"
? buildColor("grey", "200")
: buildColor("green", "600")};
color: ${(props) =>
props.status === "RO"
? buildColor("black", "100")
: buildColor("white", "100")};
padding-top: 1px;
font-family: ${fontMedium};
`;
const getMTPStyle = (mtp, isOnBiggestWinner) => {
let mtpStyle = `color: ${
!isOnBiggestWinner ? buildColor("grey", "700") : buildColor("blue", "300")
};
font-family: ${fontNormal}`;
if (mtp <= 5)
mtpStyle = `color: ${buildColor("orange", "600")};
font-family: ${fontMedium};`;
else if (mtp < 60)
mtpStyle = `color: ${
!isOnBiggestWinner ? buildColor("grey", "900") : buildColor("blue", "200")
};
font-family: ${fontMedium}`;
return mtpStyle;
};
const getLegacyMTPStyle = (mtp, isOnBiggestWinner) => {
let mtpStyle = `color: ${
!isOnBiggestWinner ? buildColor("grey", "800") : buildColor("blue", "300")
};
font-family: ${fontNormal};`;
if (mtp <= 10) {
mtpStyle = `color: ${buildColor("red", "600")};
font-family: ${fontMedium};`;
} else if (mtp < 60) {
mtpStyle = `color: ${
!isOnBiggestWinner ? buildColor("grey", "900") : buildColor("blue", "200")
};
font-family: ${fontMedium};`;
}
return mtpStyle;
};
export const PlainMTP = styled.time.attrs((props) => ({
dateTime: props.postTime
}))`
display: ${(props) => (props.isMyBets ? "flex" : "inline")};
height: ${(props) => (props.isMyBets ? "auto" : "16px")};
font-size: 14px;
${({ mtp, isOnBiggestWinner, isMTPNewRules }) => {
const returnCSS = isMTPNewRules
? getMTPStyle(mtp, isOnBiggestWinner)
: getLegacyMTPStyle(mtp, isOnBiggestWinner);
return returnCSS;
}}
`;
export const PlainMTPText = styled.span`
display: block;
font-family: ${({ isRaceOff, isMyBets }) =>
isRaceOff || isMyBets ? fontMedium : fontNormal};
font-size: 14px;
font-weight: 400;
letter-spacing: 0;
${(props) => {
if (props.isRaceOff) {
return css`
color: ${buildColor("green", "600")};
`;
}
if (props.isResulted) {
return css`
color: ${buildColor("grey", "700")};
`;
}
return css`
color: ${buildColor("grey", "800")};
`;
}}
white-space: pre;
`;
export default MTPTime;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/MTP/index.jsx
import React, { PureComponent } from "react";
import {
formatPostTime,
formatPeriod,
formatRaceDate
} from "@tvg/formatter/dates";
import MTPTime, {
RaceClosedStatus,
PlainMTP,
PlainMTPText
} from "./styled-components";
/*
* Be careful with this flag!!!
* TODO: This shall be refactored later
* */
export const isRaceOff = (status) => status === "SK" || status === "RO";
export default class MTP extends PureComponent {
static defaultProps = {
mtp: 0,
postTime: new Date().toISOString(),
status: "O",
multipleLine: false,
darken: false,
bigger: false,
paddingless: false,
showRaceDate: false,
isHighlightedBellowThreshold: false,
className: "",
isPlainMTP: false,
isOnBiggestWinner: false,
isMyBets: false,
dateDiff: 0,
isMTPNewRules: false
};
mtpThreshold = 60;
mtpCloseThreshold = 10;
renderMTP() {
if (!isRaceOff(this.props.status)) {
if (this.props.mtp > this.mtpThreshold) {
return formatPostTime(this.props.postTime, this.props.showRaceDate);
}
return `${this.props.mtp.toString()}m`;
}
return (
<RaceClosedStatus status={this.props.status}>
{this.props.status === "RO" ? "RES" : "OFF"}
</RaceClosedStatus>
);
}
renderPlainMtp = () => {
switch (this.props.status) {
case "SK":
return (
<PlainMTPText data-qa-label="mtpRaceOff" isRaceOff>
Race off
</PlainMTPText>
);
case "RO":
return (
<PlainMTPText
data-qa-label="mtpResult"
isMyBets={this.props.isMyBets}
isResulted
>
{this.props.isMyBets ? "Resulted" : "Result"}
</PlainMTPText>
);
default: {
const mtpSuffix = this.props.isMyBets ? " MTP" : "m";
return this.props.mtp > 60
? `${formatPostTime(this.props.postTime, false)} ${formatPeriod(
this.props.postTime
)}`
: `${this.props.mtp}${mtpSuffix}`;
}
}
};
renderRaceDate = () => (
<PlainMTPText>{` - ${formatRaceDate(this.props.postTime)}`}</PlainMTPText>
);
render() {
return this.props.isPlainMTP ? (
<PlainMTP
className={this.props.className}
data-qa-label="mtp"
postTime={this.props.postTime}
mtp={this.props.mtp}
isOnBiggestWinner={this.props.isOnBiggestWinner}
isMyBets={this.props.isMyBets}
isMTPNewRules={this.props.isMTPNewRules}
>
{this.renderPlainMtp()}
{this.props.dateDiff < 0 && this.renderRaceDate()}
</PlainMTP>
) : (
<MTPTime
data-qa-label="mtp"
className={this.props.className}
postTime={this.props.postTime}
mtp={this.props.mtp}
mtpCloseThreshold={this.mtpCloseThreshold}
mtpThreshold={this.mtpThreshold}
isRaceOff={isRaceOff(this.props.status)}
multipleLine={this.props.multipleLine}
darken={this.props.darken}
bigger={this.props.bigger}
paddingless={this.props.paddingless}
showRaceDate={this.props.showRaceDate}
>
{this.renderMTP()}
</MTPTime>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/RaceNavigation/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import Button from "../../_atom/Buttons/default";
import MTP from "../../_atom/MTP";
import { buildText } from "../../_atom/Text";
import { buildTitle } from "../../_atom/Title";
import { fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const ArrowContainer = styled.span`
display: flex;
padding-left: 8px;
align-self: center;
`;
export const MTPContainer = styled.span`
display: flex;
align-items: center;
justify-content: center;
`;
export const RaceMTP = styled(MTP)`
padding: 0;
width: 56px;
font-family: ${fontMedium};
${(props) =>
props.isMicro &&
!props.isLink &&
css`
width: auto;
padding-right: 3px;
font-size: 12px;
line-height: 11px;
flex-direction: row;
&::before {
width: 4px;
height: 4px;
}
&::after {
padding-left: 4px;
}
& span {
width: auto;
height: 11px;
padding: 2px;
font-size: 10px;
}
`};
${(props) =>
props.isSmall &&
!props.isLink &&
css`
min-height: 32px;
width: 48px;
font-size: 12px;
`};
color: ${(props) => props.isLink && buildColor("grey", "900")};
`;
export const RaceInfoContainer = styled.dl`
display: flex;
flex-direction: column;
min-width: 0;
align-self: center;
align-items: flex-start;
justify-content: center;
margin: 0;
flex: 1;
overflow: hidden;
padding-left: ${(props) => (props.isMicro ? "2px" : "8px")};
border-left: 1px solid
${(props) =>
props.isLink ? buildColor("blue", "100") : "rgba(255, 255, 255, 0.2)"};
`;
export const RaceTitle = styled.dt`
display: flex;
align-items: center;
width: 100%;
margin: 0;
`;
export const RaceDescription = styled.dd`
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
width: 100%;
padding: 0;
margin: 1px 0 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
`;
export const GreyhoundText = styled(
buildText({
fontSize: 10,
uppercase: true,
color: buildColor("blue", "300"),
bold: true,
qaLabel: "raceNavigation-greyhound"
})
)`
margin-top: 2px;
`;
export const RaceNumber = styled(
buildTitle({
tag: "h4",
fontSize: 16,
bold: true,
qaLabel: "raceNavigation-raceNumber"
})
)`
white-space: nowrap;
`;
export const RaceMicroNumber = styled(
buildTitle({
tag: "h4",
fontSize: 12,
bold: true,
qaLabel: "raceNavigation-raceNumber"
})
)`
white-space: nowrap;
height: 11px;
line-height: 11px;
`;
export const buildTitleWrapper = (isSmall) => styled(
buildTitle({
tag: "h3",
fontSize: 16,
color: buildColor("white", "100"),
bold: true,
ellipsis: !isSmall,
uppercase: true,
qaLabel: "raceLink-trackName"
})
)`
padding-right: ${isSmall ? "4px" : "8px"};
`;
export const TitleMicro = styled(
buildTitle({
tag: "h3",
fontSize: 12,
color: buildColor("white", "100"),
bold: true,
ellipsis: false,
uppercase: true,
qaLabel: "raceLink-trackName"
})
)`
padding-right: 2px;
`;
export const Title = buildTitle({
tag: "h3",
fontSize: 16,
color: buildColor("white", "100"),
bold: true,
ellipsis: true,
uppercase: true,
qaLabel: "raceLink-trackName"
});
export const buildRaceContainer = (isLink, isSmall, isMicro, isRaceResult) => {
const Container = isLink
? styled(Link).attrs({
"data-qa-label": "raceSelectorItem"
})
: styled(Button);
return Container`
display: flex;
flex-grow: 1;
position: relative;
align-items: center;
justify-content: center;
padding-right: 8px;
text-decoration: none;
border-radius: 2px;
outline: none;
height: 48px;
background-color: ${buildColor("black", "30")};
color: ${buildColor("white", "100")};
min-width: 0;
&:active {
background-color: rgba(0, 0, 0, 0.2);
}
${
(isSmall || isMicro) &&
!isLink &&
css`
/* only add hover state for fine pointers, meaning that only on desktops using a mouse the hover state will work */
@media (pointer: fine) {
&:hover {
background-color: ${buildColor("black", "30")};
}
}
`
};
${
isSmall &&
!isLink &&
css`
height: 32px;
width: auto;
`
}
${
isMicro &&
!isLink &&
css`
height: 16px;
width: auto;
padding: 0 2px;
align-self: flex-end;
`
}
${
isLink &&
css`
min-height: 64px;
height: auto;
background-color: ${buildColor("white", "0")};
border-bottom: 1px solid ${buildColor("blue", "100")};
&:active {
background-color: ${buildColor("blue", "000")};
}
`
};
${
isRaceResult &&
isLink &&
css`
background-color: ${buildColor("grey", "000")};
`
};
`;
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/RaceNavigation/index.jsx
import React, { PureComponent, Fragment } from "react";
import { noop, bindAll } from "lodash";
import buildRaceUrl, { buildLiveUrl } from "@tvg/formatter/url";
import RaceInfoInline from "../../_molecule/RaceInfoInline";
import buildColor from "../../_static/ColorPalette";
import {
arrowDown,
arrowLeft,
arrowRight,
arrowUp
} from "../../_static/Icons/icons";
import Icon from "../../_static/Icons";
import {
ArrowContainer,
RaceMTP,
RaceTitle,
TitleMicro,
RaceDescription,
RaceNumber,
RaceMicroNumber,
GreyhoundText,
RaceInfoContainer,
buildTitleWrapper,
buildRaceContainer,
MTPContainer
} from "./styled-components";
export const getIsRaceResult = (status) => status === "RO";
export default class RaceNavigation extends PureComponent {
static defaultProps = {
mtp: 0,
postTime: "",
status: "O",
isGreyhound: false,
trackAbbr: "",
trackName: "",
raceNumber: "1",
isSmall: false,
isMicro: false,
onClickCallback: noop,
isLink: false,
isRaceResult: false,
channel: "",
importanceLevel: "0",
description: "",
raceInfo: [],
arrowType: "arrowDown"
};
constructor(props) {
super(props);
bindAll(this, "getArrowType");
}
getArrowType() {
switch (this.props.arrowType) {
case "arrowUp":
return arrowUp;
case "arrowLeft":
return arrowLeft;
case "arrowRight":
return arrowRight;
default:
return arrowDown;
}
}
renderContent = () => {
if (this.props.isLink) {
return (
<Fragment>
<RaceInfoContainer isLink>
<RaceInfoInline
title={`R${this.props.raceNumber}`}
subTitle={this.props.channel !== "" ? this.props.trackName : ""}
importanceLevel={this.props.importanceLevel}
description={this.props.description}
raceData={this.props.raceInfo}
raceNumber={this.props.raceNumber}
isRaceDataChangesShown
/>
</RaceInfoContainer>
</Fragment>
);
}
if (this.props.isMicro) {
return (
<Fragment>
<RaceInfoContainer isMicro>
<RaceTitle>
<TitleMicro> {this.props.trackAbbr}</TitleMicro>
<RaceMicroNumber>{`- R${this.props.raceNumber}`}</RaceMicroNumber>
</RaceTitle>
</RaceInfoContainer>
</Fragment>
);
}
const Title = buildTitleWrapper(this.props.isSmall);
return (
<Fragment>
<RaceInfoContainer>
<RaceTitle>
<Title>
{this.props.isSmall ? this.props.trackAbbr : this.props.trackName}
</Title>
<RaceNumber>
{this.props.isSmall && "-"} R{this.props.raceNumber}
</RaceNumber>
</RaceTitle>
{this.props.isGreyhound && !this.props.isSmall && (
<RaceDescription>
<GreyhoundText>Greyhounds</GreyhoundText>
</RaceDescription>
)}
</RaceInfoContainer>
<ArrowContainer>
<Icon
size={16}
icon={this.getArrowType()}
color={buildColor("white", "100")}
/>
</ArrowContainer>
</Fragment>
);
};
render() {
const RaceContainer = buildRaceContainer(
this.props.isLink,
this.props.isSmall,
this.props.isMicro,
getIsRaceResult(this.props.status)
);
const raceContainerProps = this.props.isLink
? {
to:
this.props.channel !== ""
? buildLiveUrl(
this.props.trackAbbr,
this.props.trackName,
this.props.raceNumber,
this.props.channel
)
: buildRaceUrl(
this.props.trackAbbr,
this.props.trackName,
this.props.raceNumber
)
}
: {
qaLabel: "raceCardHeader-raceSelector"
};
return (
<RaceContainer
{...raceContainerProps}
onTouchStart={noop}
onClick={() => this.props.onClickCallback()}
>
<MTPContainer>
<RaceMTP
paddingless
mtp={this.props.mtp}
postTime={this.props.postTime}
status={this.props.status}
isSmall={this.props.isSmall}
isMicro={this.props.isMicro}
isLink={this.props.isLink}
multipleLine={this.props.mtp > 60 && !this.props.isMicro}
isHighlightedBellowThreshold={
!this.props.isSmall && !this.props.isMicro
}
/>
</MTPContainer>
{this.renderContent()}
</RaceContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Buttons/buttonLink.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import { StyledLink, StyledRef } from "./styled-components";
import { getSize, getType } from "./styles";
export default class ButtonLink extends PureComponent {
static defaultProps = {
className: "",
children: null,
url: "",
size: "default",
type: "primary",
tag: "link",
isDisabled: false,
hasRoundedCorners: true,
isStretched: false,
qaLabel: "",
onClick: noop,
hasShadow: false
};
render() {
const sizeSpecs = getSize(this.props.size);
const typeSpecs = getType(this.props.type);
const componentProps = {
...(this.props.qaLabel !== ""
? {
"data-qa-label": this.props.qaLabel
}
: {}),
...{
size: this.props.size,
type: this.props.type,
className: this.props.className
},
...(this.props.tag === "link"
? {
to: this.props.url,
state:
typeof this.props.url !== "string"
? this.props.url.state
: undefined
}
: { href: this.props.url, as: this.props.tag }),
onClick: this.props.onClick,
$sizeSpecs: sizeSpecs,
$typeSpecs: typeSpecs,
tag: this.props.tag,
$isStretched: this.props.isStretched,
$isDisabled: this.props.isDisabled,
$hasRoundedCorners: this.props.hasRoundedCorners,
$hasShadow: this.props.hasShadow
};
return this.props.tag === "link" ? (
<StyledLink {...componentProps}>{this.props.children}</StyledLink>
) : (
<StyledRef {...componentProps}>{this.props.children}</StyledRef>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/BalanceButton/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import { fontNormal, fontMedium, defaultSize } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import ButtonLink from "../Buttons/buttonLink";
export const AmountContainer = styled.div`
width: 100%;
height: ${({ isDesktop, tvgHeaderV2FeatureToggle }) =>
isDesktop && tvgHeaderV2FeatureToggle ? "44px" : "auto"};
display: flex;
align-items: center;
justify-content: center;
padding: ${({ isDesktop, tvgHeaderV2FeatureToggle, isBalanceShown }) =>
isDesktop && !tvgHeaderV2FeatureToggle
? "0.4em 0.8em"
: `0px ${isBalanceShown ? "16px" : "8px"} 0 8px`};
padding: ${({ isDesktop }) => !isDesktop && "0"};
${({ isDesktop, tvgHeaderV2FeatureToggle, isLowBalance }) =>
isDesktop && tvgHeaderV2FeatureToggle
? css`
height: 44px;
flex-direction: row-reverse;
background-color: ${isLowBalance
? buildColor("green", "500")
: buildColor("white", "10")};
border-radius: 2px;
&:hover {
cursor: pointer;
background-color: ${isLowBalance
? buildColor("green", "600")
: `hsla(0, 0%, 100%, 0.2)`};
}
`
: css`
height: auto;
flex-direction: row;
background-color: transparent;
border-radius: 0.5em;
`}
`;
export const BalanceWrapperLink = styled(Link)`
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-end;
text-decoration: none;
`;
export const BalanceAmount = styled.span`
font-family: ${fontMedium};
color: ${buildColor("white", "100")};
${({ isDesktop }) =>
isDesktop
? css`
font-size: 16px;
`
: css`
font-size: ${defaultSize};
`}
font-size: ${({ tvgHeaderV2FeatureToggle }) =>
tvgHeaderV2FeatureToggle && "14px"}
${({ newQuickDepositButton }) =>
newQuickDepositButton &&
css`
margin-left: 9px;
font-size: 14px;
font-family: ${fontNormal};
line-height: 19px;
font-weight: 500;
`}
`;
export const ButtonLinkContainer = styled.div`
position: relative;
justify-content: center;
align-items: center;
display: flex;
&:hover {
& span {
visibility: visible;
}
}
`;
export const BalanceDescription = styled.span`
text-transform: uppercase;
font-family: ${fontMedium};
font-size: ${({ isDesktop }) => (isDesktop ? defaultSize : "12px")};
color: ${({ isLowBalance }) =>
isLowBalance ? buildColor("green", "400") : buildColor("blue", "100")};
`;
export const AmountButton = styled(ButtonLink)`
background-color: ${({ isDesktop }) =>
isDesktop ? "transparent" : buildColor("white", "10")};
outline: none;
border-radius: 50%;
position: relative;
${({ isDesktop }) =>
!isDesktop &&
css`
border-radius: 50%;
`}
${({ tvgHeaderV2FeatureToggle }) =>
!tvgHeaderV2FeatureToggle &&
css`
margin-left: 10px;
& svg:first-of-type {
fill: ${buildColor("white", "100")};
}
`}
${({ isDesktop }) =>
isDesktop
? css`
width: 38px;
height: 38px;
`
: css`
width: 32px;
height: 32px;
`};
&:hover,
&:focus {
background-color: ${buildColor("white", "100")};
& svg:first-of-type {
fill: ${buildColor("white", "100")};
}
}
&:active {
background-color: ${buildColor("white", "200")};
}
${({ tvgHeaderV2FeatureToggle }) =>
!tvgHeaderV2FeatureToggle
? css`
&:hover,
&:focus {
background-color: ${buildColor("white", "10")};
& svg:first-of-type {
fill: ${buildColor("white", "100")};
}
}
&:active {
background-color: ${buildColor("white", "200")};
}
`
: css`
&:hover,
&:focus {
background-color: transparent;
& svg:first-of-type {
fill: ${buildColor("white", "100")};
}
}
&:active {
background-color: transparent;
}
`}
&:hover {
& span {
visibility: visible;
}
}
`;
export const NewAmountButton = styled.div`
display: flex;
justify-content: center;
align-items: center;
`;
export const ExclamationIcon = styled(Icon)`
position: absolute;
right: 0;
top: 0;
`;
export const IconMask = styled.div`
position: absolute;
right: 5px;
top: 2px;
background-color: ${buildColor("white", "100")};
height: 12px;
width: 12px;
border-radius: 50%;
`;
export const AmountButtonTooltip = styled.span`
visibility: hidden;
position: absolute;
top: 44px;
right: ${({ align }) => (align === "left" ? `0` : `-25px`)};
z-index: 99;
height: 30px;
padding: 8px;
color: ${buildColor("black", "100")};
background: ${buildColor("white", "100")};
box-shadow:
0 4px 4px rgba(0, 0, 0, 0.1),
0 4px 6px rgba(0, 0, 0, 0.05);
border-radius: 4px;
text-align: center;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 17px;
overflow: hidden;
white-space: nowrap;
${({ newQuickDepositButton }) =>
newQuickDepositButton &&
css`
right: initial;
top: 48px;
`};
`;
export const IconWrapper = styled.div`
display: flex;
justify-items: center;
align-items: center;
position: relative;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/BalanceButton/index.jsx
import React, { Fragment } from "react";
import { noop } from "lodash";
import formatCurrency, { formatNumber } from "@tvg/formatter/currency";
import ButtonLink from "@tvg/atomic-ui/_atom/Buttons/buttonLink";
import { deposit, exclamation } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import {
AmountContainer,
AmountButton,
BalanceWrapperLink,
BalanceAmount,
BalanceDescription,
AmountButtonTooltip,
ExclamationIcon,
IconMask,
NewAmountButton,
IconWrapper,
ButtonLinkContainer
} from "./styled-components";
const formatBalanceAmount = (balance, headerV2) => {
if (balance === null) {
return "-.--";
}
return headerV2 ? formatNumber(balance) : formatCurrency(balance);
};
const BalanceButton = (props) => {
const {
balanceLabel,
balanceLowLabel,
balanceButtonTooltip,
balanceAmount,
balanceLowThreshold,
onBalanceClick,
isBalanceShown,
qaLabel,
device,
url,
newQuickDepositButton,
tvgHeaderV2FeatureToggle,
amountButtonTooltipAlignment = "center"
} = props;
const isLowBalance = balanceAmount < balanceLowThreshold;
const isDesktop = device === "desktop";
return newQuickDepositButton && isDesktop ? (
<ButtonLinkContainer>
<ButtonLink
type={isLowBalance ? "bet" : "secondary_alt"}
size="bigger"
url={url}
qaLabel="quickDepositButton"
onClick={onBalanceClick}
>
<NewAmountButton>
<IconWrapper>
<Icon icon={deposit} color={buildColor("white", "100")} size={17} />
</IconWrapper>
{balanceButtonTooltip && (
<AmountButtonTooltip newQuickDepositButton>
{balanceButtonTooltip}
</AmountButtonTooltip>
)}
{isBalanceShown && (
<BalanceAmount newQuickDepositButton isDesktop={isDesktop}>
{formatCurrency(balanceAmount)}
</BalanceAmount>
)}
</NewAmountButton>
</ButtonLink>
</ButtonLinkContainer>
) : (
<AmountContainer
tvgHeaderV2FeatureToggle={tvgHeaderV2FeatureToggle}
isDesktop={isDesktop}
isLowBalance={isLowBalance}
isBalanceShown={isBalanceShown}
tag={!isDesktop && "div"}
size="micro"
url={url}
qaLabel="quickDepositButton"
>
{isBalanceShown && (
<BalanceWrapperLink
to={url}
onClick={(e) => {
// @TODO This is a 🔨 fixing a bug without changing too much stuff look at this later
e.preventDefault();
}}
>
<BalanceAmount
isDesktop={isDesktop}
tvgHeaderV2FeatureToggle={tvgHeaderV2FeatureToggle}
data-qa-label="balance-amount"
>
{formatBalanceAmount(balanceAmount, tvgHeaderV2FeatureToggle)}
</BalanceAmount>
{!tvgHeaderV2FeatureToggle && (
<BalanceDescription
isDesktop={isDesktop}
isLowBalance={isLowBalance}
>
{isLowBalance ? balanceLowLabel : balanceLabel}
</BalanceDescription>
)}
</BalanceWrapperLink>
)}
<AmountButton
tag={isDesktop && tvgHeaderV2FeatureToggle && "div"}
tvgHeaderV2FeatureToggle={tvgHeaderV2FeatureToggle}
isDesktop={isDesktop}
isLowAmount={isLowBalance}
size="micro"
url={url}
qaLabel="quickDepositButton"
onClick={onBalanceClick}
>
{tvgHeaderV2FeatureToggle ? (
<Icon color={buildColor("white", "100")} icon={deposit} size={16} />
) : (
<Icon
icon={deposit}
color={buildColor("blue", "100")}
size={isDesktop ? 24 : 16}
/>
)}
{isLowBalance && !tvgHeaderV2FeatureToggle && (
<Fragment>
<IconMask />
<ExclamationIcon
icon={exclamation}
// size={isDesktop ? 18 : 10}
size={18}
qaLabel={`${qaLabel}-overlay-icon`}
color={buildColor("green", "500")}
/>
</Fragment>
)}
{balanceButtonTooltip && (
<AmountButtonTooltip
align={amountButtonTooltipAlignment}
className="balance-tooltip"
>
{balanceButtonTooltip}
</AmountButtonTooltip>
)}
</AmountButton>
</AmountContainer>
);
};
BalanceButton.defaultProps = {
qaLabel: "balance-button",
balanceLabel: "Balance",
balanceLowLabel: "Deposit Now",
balanceButtonTooltip: "Quick Deposit",
balanceAmount: 0,
balanceLowThreshold: 10,
onBalanceClick: noop,
isBalanceShown: true,
// TODO: default should be 'mobile' (changes in tvg-hdr needed accordingly)
device: "desktop",
url: "",
newQuickDepositButton: false,
tvgHeaderV2FeatureToggle: false
};
export default BalanceButton;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/Header/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import Icon from "../../_static/Icons";
import ButtonLink from "../../_atom/Buttons/buttonLink";
import buildColor from "../../_static/ColorPalette";
import { fontBold, fontMedium, fontNormal } from "../../_static/Typography";
import { generateTransition, cubic, linear } from "../../_static/Transitions";
export const Container = styled.div`
display: flex;
flex-direction: column;
width: 100%;
`;
export const HeaderContent = styled.div`
width: 100%;
min-width: 320px;
height: 56px;
${({ hasDescription }) =>
hasDescription
? css`
padding: 12px 12px 0;
`
: css`
padding: 12px;
`}
display: flex;
justify-content: space-between;
align-items: center;
overflow: hidden;
position: relative;
background-color: ${buildColor("blue", "700")};
&.monochromatic {
background-color: ${buildColor("white", "100")};
}
&.lowercaseMonochromatic {
background-color: ${buildColor("white", "100")};
}
&.logo-login {
background-color: ${buildColor("white", "100")};
}
&.logo-highlighted {
box-shadow: inset 0 -1px 0 ${buildColor("blue", "100")};
${({ isMobile }) =>
isMobile
? css`
background-color: ${buildColor("white", "100")};
`
: css`
background-color: transparent;
`}
}
`;
export const LoginSignup = styled.div`
display: flex;
& > a:not(:last-child) {
margin-right: 8px;
}
`;
export const LoginSignupInner = styled.span`
height: 12px;
line-height: 14px;
`;
export const LockIcon = styled(Icon)`
margin-right: 4px;
`;
export const LogoNavigationContainer = styled.div`
align-self: stretch;
svg {
margin-bottom: -1.5px;
}
${({ isTitleCenter }) => isTitleCenter && "width: 100%"};
& > a {
height: 100%;
display: flex;
align-items: center;
line-height: 0;
position: relative;
text-decoration: none;
z-index: 1;
will-change: transform, opacity;
transition: ${generateTransition(cubic, "transform")},
${generateTransition(linear, "opacity")};
${(props) =>
props.isNavigationShown &&
css`
pointer-events: none;
transform: translate3d(0, -56px, 0);
opacity: 0;
`};
}
&.logo-highlighted {
width: 100%;
display: flex;
justify-content: center;
}
`;
export const AnimationContainer = styled.div`
position: absolute;
left: 8px;
top: 0;
bottom: 0;
display: flex;
align-items: center;
z-index: 0;
`;
export const RaceNavigationContainer = styled.div`
will-change: transform, opacity;
transition: ${generateTransition(cubic, "transform")},
${generateTransition(linear, "opacity")};
${(props) =>
props.isNavigationShown
? css`
opacity: 1;
transform: translateY(0);
`
: css`
opacity: 0;
transform: translateY(50px);
`};
`;
export const VideoButtonContainer = styled.div`
margin-left: 8px;
will-change: transform, opacity;
transition: ${generateTransition(cubic, "transform")},
${generateTransition(linear, "opacity")};
${(props) =>
props.isVideoButtonShown
? css`
opacity: 1;
transform: translateY(0);
`
: css`
opacity: 0;
transform: translateY(50px);
`};
`;
export const User = styled.div`
display: flex;
align-items: center;
color: ${buildColor("white", "100")};
`;
export const UserImageContainer = styled.div`
display: flex;
align-items: center;
justify-content: center;
flex-basis: 32px;
flex-shrink: 0;
width: 32px;
height: 32px;
background-color: ${buildColor("white", "20")};
border-radius: 50%;
margin-right: 8px;
overflow: hidden;
`;
export const UserImage = styled.img`
width: 32px;
height: auto;
max-height: 32px;
align-self: flex-end;
`;
export const HeaderLabelContainer = styled(Link)`
display: flex;
flex-direction: row;
align-items: center;
${({ center }) =>
center === "true" &&
css`
justify-content: center;
& svg {
position: absolute;
left: 0;
}
`};
`;
export const HeaderLabel = styled.span`
font-family: ${fontBold};
${({ headerClass }) =>
headerClass === "lowercaseMonochromatic"
? css`
text-transform: capitalize;
font-size: 18px;
font-weight: bold;
`
: css`
text-transform: uppercase;
font-size: 16px;
`}
color: ${({ headerClass }) =>
headerClass === "monochromatic" || headerClass === "lowercaseMonochromatic"
? buildColor("grey", "900")
: buildColor("white", "100")};
padding-left: 12px;
`;
export const ActionToolsContainer = styled.div`
display: flex;
justify-content: flex-end;
align-items: center;
`;
export const ContentCardsInboxContainer = styled.div`
margin: 0 4px 0 16px;
`;
const customButtonSharedStyles = css`
height: 32px;
padding: 8px;
font-size: 14px;
text-transform: capitalize;
box-shadow:
0 2px 4px rgb(17 43 68 / 6%),
0 1px 2px rgb(17 43 68 / 8%);
border-radius: 2px;
font-family: ${fontMedium};
`;
export const ButtonLinkStyled = styled(ButtonLink)`
${customButtonSharedStyles};
`;
export const ButtonTransparent = styled(ButtonLink)`
${customButtonSharedStyles};
display: flex;
align-items: center;
background-color: ${(props) =>
props.isSelected && !props.isDisabled
? buildColor("white", "20")
: buildColor("white", "10")};
color: ${({ isGrey }) =>
isGrey ? buildColor("grey", "900") : buildColor("white", "100")};
/* only add hover state for fine pointers, meaning that only on desktops using a mouse the hover state will work */
@media (pointer: fine) {
&:hover {
background-color: ${(props) =>
!props.isDisabled && buildColor("white", "20")};
}
}
&:active {
background-color: ${(props) =>
!props.isDisabled && buildColor("white", "20")};
/* on touch devices (coarse), the active color should be the hover spec according to the style guide on zeplin */
@media (pointer: coarse) {
background-color: ${(props) =>
!props.isDisabled && buildColor("white", "20")};
}
}
`;
export const ChildContainer = styled.div`
margin-left: auto;
`;
export const HeaderDescriptionContainer = styled.div`
width: 100%;
text-align: center;
padding: 0 50px 12px;
background-color: ${buildColor("white", "100")};
box-shadow: inset 0 -1px 0 ${buildColor("blue", "100")};
`;
export const HeaderDescription = styled.p`
color: ${buildColor("grey", "800")};
font-family: ${fontNormal};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/Header/index.tvg.jsx
import React, { Component } from "react";
import { get, isEqual, noop } from "lodash";
import { Link } from "react-router-dom";
import tvgConf from "@tvg/conf";
import NotificationBubble from "../../_atom/NotificationBubble";
import VideoButton from "../../_molecule/VideoButton";
import RaceNavigation from "../../_organism/RaceNavigation";
import BalanceButton from "../../_atom/BalanceButton";
import buildColor from "../../_static/ColorPalette";
import Logo from "../../_static/Logos";
import { arrowBack, lock, envelope, email } from "../../_static/Icons/icons";
import {
Container,
HeaderContent,
LoginSignup,
LoginSignupInner,
LockIcon,
LogoNavigationContainer,
RaceNavigationContainer,
VideoButtonContainer,
AnimationContainer,
HeaderLabelContainer,
HeaderLabel,
ActionToolsContainer,
ContentCardsInboxContainer,
ButtonTransparent,
ButtonLinkStyled,
ChildContainer,
HeaderDescriptionContainer,
HeaderDescription
} from "./styled-components";
import Icon from "../../_static/Icons";
export class Header extends Component {
static defaultProps = {
logoMod: "",
isLogged: false,
isNavigationShown: false,
isVideoButtonShown: false,
isActionToolsShown: false,
isLogActionsShown: true,
isTitleCenter: false,
onLogoClick: noop,
openRaceNavigation: noop,
quickDeposit: {
balance: 0,
isBalanceShown: true,
url: "/"
},
brand: "tvg",
loginSignup: {
signUpUrl: "/",
loginUrl: "/"
},
raceData: {
trackAbbr: "",
trackName: "",
raceNumber: "",
mtp: 0,
postTime: "",
status: "O"
},
layout: "normal",
videoFeedBack: "NOT_AVAILABLE_NO_REPLAY",
onVideoButton: noop,
onBackClick: noop,
prevPath: "/",
label: "",
unviewedContentCardsCount: 0,
isContentCardsInboxShown: false,
headerClass: "",
openInbox: noop,
description: ""
};
shouldComponentUpdate(nextProps) {
return !isEqual(nextProps, this.props);
}
openCloseInbox = () => {
this.props.openInbox(true, this.props.unviewedContentCardsCount);
};
renderLogo = () => {
const isBrandTVG = this.props.brand === "tvg";
let logoHeight = 18;
if (
this.props.headerClass === "logo-highlighted" &&
tvgConf().device !== "mobile"
) {
logoHeight = 28;
} else if (isBrandTVG) {
logoHeight = 32;
}
return (
<Link to="/" onClick={this.props.onLogoClick}>
<Logo
brand={isBrandTVG ? "tvgPoweredByFanduel" : this.props.brand}
data-qa-label="tvgLogo"
height={logoHeight}
isDark={
this.props.headerClass === "logo-highlighted" ||
this.props.headerClass === "logo-login"
}
/>
</Link>
);
};
renderBackButton = () => (
<HeaderLabelContainer
to={this.props.prevPath}
onClick={this.props.onBackClick}
data-qa-label="headerLabel-back"
center={
this.props.isTitleCenter ? this.props.isTitleCenter.toString() : "false"
}
>
<Icon
icon={arrowBack}
color={
this.props.headerClass === "monochromatic" ||
this.props.headerClass === "lowercaseMonochromatic"
? buildColor("grey", "900")
: buildColor("white", "100")
}
size={16}
qaLabel="headerLabel-back-icon"
/>
<HeaderLabel
headerClass={this.props.headerClass}
data-qa-label="headerLabel-back-label"
>
{this.props.label}
</HeaderLabel>
</HeaderLabelContainer>
);
renderVideoActionTools = () => (
<LogoNavigationContainer
isNavigationShown={this.props.isNavigationShown}
className={this.props.headerClass}
isMobile={tvgConf().device === "mobile"}
isTitleCenter={this.props.isTitleCenter}
>
{!this.props.label && this.props.logoMod !== "navigation"
? this.renderLogo()
: this.renderBackButton()}
{typeof window !== "undefined" && (
<AnimationContainer>
<RaceNavigationContainer
isNavigationShown={this.props.isNavigationShown}
>
<RaceNavigation
{...this.props.raceData}
onClickCallback={this.props.openRaceNavigation}
isSmall
/>
</RaceNavigationContainer>
<VideoButtonContainer
isVideoButtonShown={this.props.isVideoButtonShown}
>
<VideoButton
small
feedback={this.props.videoFeedBack}
onClick={this.props.onVideoButton}
/>
</VideoButtonContainer>
</AnimationContainer>
)}
</LogoNavigationContainer>
);
renderLoggedOutActionTools = () => (
<LoginSignup data-qa-label="header-sessionButtons">
<ButtonTransparent
type={
this.props.headerClass === "logo-login"
? "secondary"
: "secondary_alt"
}
url={this.props.loginSignup.loginUrl}
isGrey={this.props.headerClass === "logo-login"}
qaLabel="openLoginButton"
>
<LockIcon
icon={lock}
size={16}
color={
this.props.headerClass === "monochromatic" ||
this.props.headerClass === "lowercaseMonochromatic" ||
this.props.headerClass === "logo-login"
? buildColor("grey", "900")
: buildColor("white", "100")
}
/>
<LoginSignupInner>
{this.props.headerClass === "logo-login" ? "Login" : "Log in"}
</LoginSignupInner>
</ButtonTransparent>
{this.props.headerClass !== "logo-login" && (
<ButtonLinkStyled
tag="link"
url={this.props.loginSignup.signUpUrl}
qaLabel="signUpButton"
>
Sign up
</ButtonLinkStyled>
)}
</LoginSignup>
);
renderLoggedInActionTools = () => (
<ActionToolsContainer>
<BalanceButton
url={this.props.quickDeposit.url}
balanceAmount={this.props.quickDeposit.balance}
onBalanceClick={this.props.quickDeposit.onClick}
isBalanceShown={this.props.quickDeposit.isBalanceShown}
device="mobile"
/>
{this.props.isContentCardsInboxShown && (
<ContentCardsInboxContainer onClick={this.openCloseInbox}>
<NotificationBubble
iconSize={20}
icon={tvgConf().device === "desktop" ? email : envelope}
counter={this.props.unviewedContentCardsCount}
qaLabel="content-cards-inbox"
/>
</ContentCardsInboxContainer>
)}
</ActionToolsContainer>
);
renderHeaderDescription = () => (
<HeaderDescriptionContainer>
<HeaderDescription>{this.props.description}</HeaderDescription>
</HeaderDescriptionContainer>
);
render() {
let isRg = false;
if (typeof window !== "undefined") {
isRg = location.pathname.includes("responsible-gaming");
}
return (
<Container>
<HeaderContent
data-qa-label="header"
layout={this.props.layout}
className={this.props.headerClass}
hasDescription={!!this.props.description}
>
{this.renderVideoActionTools()}
{this.props.children && (
<ChildContainer>{this.props.children}</ChildContainer>
)}
{get(this.props, "isLogged", false)
? get(this.props, "isActionToolsShown", true) &&
this.renderLoggedInActionTools()
: get(this.props, "isLogActionsShown") &&
!isRg &&
this.renderLoggedOutActionTools()}
</HeaderContent>
{this.props.description && this.renderHeaderDescription()}
</Container>
);
}
}
export default Header;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/Header/index.tool.jsx
import React, { Component } from "react";
import { isEqual } from "lodash";
import { Link } from "react-router-dom";
import buildColor from "../../_static/ColorPalette";
import Logo from "../../_static/Logos";
import Icon from "../../_static/Icons";
import { account, arrowLeft } from "../../_static/Icons/icons";
import {
HeaderContent,
LogoNavigationContainer,
User,
UserImageContainer,
UserImage
} from "./styled-components";
const isProgramPage = (pathname) => pathname.includes("/program");
export default class HeaderTool extends Component {
static defaultProps = {
layout: "normal",
user: "Admin",
userRole: "",
userImage: null,
homeUrl: "/",
currentUrl: "/"
};
shouldComponentUpdate(nextProps) {
return !isEqual(nextProps, this.props);
}
render() {
return (
<HeaderContent data-qa-label="header" layout={this.props.layout}>
<LogoNavigationContainer data-qa-label="tvg-logo-nav-container">
<Link to={this.props.homeUrl}>
{isProgramPage(this.props.currentUrl) ? (
<Icon
icon={arrowLeft}
color={buildColor("white", "100")}
size={24}
/>
) : (
<Logo brand="tvg" data-qa-label="tvgLogo" />
)}
</Link>
</LogoNavigationContainer>
<User data-qa-label="tvg-user">
<UserImageContainer data-qa-label="tvg-user-container">
{this.props.userImage ? (
<UserImage
src={this.props.userImage}
alt={this.props.user}
data-qa-label="tvg-user-image"
/>
) : (
<Icon
icon={account}
color={buildColor("white", "100")}
qaLabel="tvg-user-icon"
/>
)}
</UserImageContainer>
{`${this.props.user}${
this.props.userRole.length ? ` (${this.props.userRole})` : ""
}`}
</User>
</HeaderContent>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/Header/index.jsx
import TVG from "./index.tvg";
import Tool from "./index.tool";
export default { TVG, Tool };
webpack://frontend-tpt/./src/pages/components/Header.tsx
import React from "react";
import Header from "@tvg/atomic-ui/_templates/Header";
import { Containers } from "@tvg/atomic-ui/_static/BaseComponents";
export default ({
userName,
userRole,
currentUrl
}: {
userName: string;
userRole: string;
currentUrl: string;
}) => (
<Containers.Header device="mobile" isVisible>
<Header.Tool
user={userName}
userRole={userRole}
homeUrl="/talent-picks/home"
currentUrl={currentUrl}
/>
</Containers.Header>
);
webpack://frontend-tpt/./src/services/talentsFetchingService/actions.ts
import { Talent } from "@tvg/ts-types/Talent";
type TalentsPageLoading = {
type: "TPM_LOADING";
payload: boolean;
};
type SuccessRequestAction = {
type: "TPM_REQUEST_SUCCESS";
payload: Talent[];
};
type SuccessNoResultsAction = {
type: "TPM_REQUEST_SUCCESS_NO_RESULTS";
};
type FailRequestAction = {
type: "TPM_REQUEST_FAIL";
payload: Error;
error: true;
};
export type Actions =
| TalentsPageLoading
| SuccessRequestAction
| SuccessNoResultsAction
| FailRequestAction;
export const talentsPageLoading = (isLoading: boolean): TalentsPageLoading => ({
type: "TPM_LOADING",
payload: isLoading
});
export const successRequest = (tpmData: Talent[]): SuccessRequestAction => ({
type: "TPM_REQUEST_SUCCESS",
payload: tpmData
});
export const successNoResults = (): SuccessNoResultsAction => ({
type: "TPM_REQUEST_SUCCESS_NO_RESULTS"
});
export const failRequest = (err: Error): FailRequestAction => ({
type: "TPM_REQUEST_FAIL",
payload: err,
error: true
});
webpack://frontend-tpt/./src/actions/user.ts
import { UserInfo } from "@tvg/ts-types/User";
export interface UserData {
error: boolean | null;
hasRequested: boolean;
logged: boolean;
logging: boolean;
user: UserInfo;
wasLogin: boolean;
userLogin: boolean;
userLogout: boolean;
loginPin: number;
tvg3token: string;
isAdmin: boolean;
}
export type UserSessionSuccessAction = {
type: "USER_DATA_UPDATE";
payload: UserData;
};
export type SetUserAdminUpdate = {
type: "USER_ADMIN_UPDATE";
payload: boolean;
};
export type SetUserLoggedState = {
type: "USER_LOGGED_STATE";
payload: {
isLogged: boolean;
};
};
export type SetUserAccountNumber = {
type: "USER_ACCOUNT_NUMBER";
payload: {
accountNumber: string;
};
};
export type UserActions =
| UserSessionSuccessAction
| SetUserLoggedState
| SetUserAccountNumber
| SetUserAdminUpdate;
export const getUserData = (userData: UserData): UserSessionSuccessAction => {
const user = userData;
user.user = Object.assign(user.user, { profile: "PORT-AllTracks" });
return {
type: "USER_DATA_UPDATE",
payload: user
};
};
export const setUserLoggedState = (isLogged: boolean): SetUserLoggedState => ({
type: "USER_LOGGED_STATE",
payload: {
isLogged
}
});
export const setUserAdminUpdate = (isAdmin: boolean): SetUserAdminUpdate => ({
type: "USER_ADMIN_UPDATE",
payload: isAdmin
});
export const setUserAccountNumber = (
accountNumber: string
): SetUserAccountNumber => ({
type: "USER_ACCOUNT_NUMBER",
payload: {
accountNumber
}
});
webpack://frontend-tpt/../../packages/tvg-lib-ts-types/Account.ts
export interface Entry {
key: string;
value: string;
}
export interface Transaction {
amount: number;
date: string;
originalDate: string;
description: string;
details?: string | null;
info: string;
runningBalance: number;
type: string;
releaseDate?: string | null;
isDepositOnHold: boolean;
}
export enum TimeFrameEnum {
TODAY = "TODAY",
YESTERDAY = "YESTERDAY",
WEEK = "WEEK",
MONTH = "MONTH",
YTD = "YTD",
CUSTOM = "CUSTOM"
}
export enum TransactionTypeEnum {
PROMOTION = "PROMOTION",
DEPOSIT = "DEPOSIT",
WITHDRAWAL = "WITHDRAWAL",
WITHDRAWAL_CANCELLED = "WITHDRAWAL_CANCELLED",
WAGER_REWARDS = "WAGER_REWARDS",
HANDICAPPING_STORE = "HANDICAPPING_STORE",
BET_PLACED = "BET_PLACED",
BET_WON = "BET_WON",
BET_CANCELLED = "BET_CANCELLED",
BET_REFUNDED = "BET_REFUNDED",
ADJUSTMENT = "ADJUSTMENT"
}
export interface ProcessingTimeMessage {
processingLabel: string;
processedLabel: string;
officiallyProcessedLabel: string;
paymentTypes: Array<Entry>;
processingTimeHelp: string;
}
export enum AccountRolesEnum {
USER = "USER",
TALENT = "TALENT",
WAGEROPS = "WAGEROPS",
ADMIN = "ADMIN"
}
webpack://frontend-tpt/./src/reducers/App/appReducer.ts
export interface State {
isAppReady: boolean;
prevPath: string;
trackCode: string;
raceNumber: string;
isRaceDataShown: boolean;
isAdmin: boolean;
}
export const initialState = {
isAppReady: false,
prevPath: "",
trackCode: "",
raceNumber: "",
isRaceDataShown: false,
isAdmin: false
};
type Action = {
type: string;
};
export default function appReducer(
// eslint-disable-next-line @typescript-eslint/default-param-last
state: State = initialState,
action: Action
) {
switch (action.type) {
default: {
return state;
}
}
}
webpack://frontend-tpt/../../packages/urp-lib-amplitude/src/constants.ts
import { RaceStatusEnum } from "@tvg/ts-types/Race";
export const COMMON_EVENT_NAMES = {
SITE_CLICK: "Site Click",
PAGE_VIEWED: "PAGE VIEWED",
NAVIGATED: "Navigation Link Clicked",
OPEN: "Opened",
CLOSE: "Closed",
DELETED: "Deleted"
};
export const PAGE_NAME_KEYS = {
HOME: "home",
TRACK_INFORMATION: "track_information",
ALL_INFO_TRACK: "all_info_track",
PROGRAM_PAGE: "program_page",
PROMOS: "promos",
PROMOTIONS: "promotions",
PROMO_OFFER: "promo_offer"
};
export const MEP_PAGE_CONFIG = [
{
page: PAGE_NAME_KEYS.TRACK_INFORMATION,
urlReg: /^\/racetracks((?!race=).)*$/
},
{ page: PAGE_NAME_KEYS.PROGRAM_PAGE, urlReg: /\/racetracks\/.*\?race=.+/ },
{
page: PAGE_NAME_KEYS.PROMO_OFFER,
urlReg: /(\?promo=[^&\s]*|\/promos\/.*)/
},
{ page: PAGE_NAME_KEYS.PROMOTIONS, urlReg: /(\/\w+)?#promos/ },
{ page: PAGE_NAME_KEYS.PROGRAM_PAGE, urlReg: /\/live\/TVG\d?\/.*\?race=.+/ }
];
export const PAGE_NAMES = {
[PAGE_NAME_KEYS.HOME]: "Home",
[PAGE_NAME_KEYS.TRACK_INFORMATION]: "Track Information",
[PAGE_NAME_KEYS.ALL_INFO_TRACK]: "All Info Track",
[PAGE_NAME_KEYS.PROGRAM_PAGE]: "Program",
[PAGE_NAME_KEYS.PROMOS]: "Promotions",
[PAGE_NAME_KEYS.PROMOTIONS]: "Promotions",
[PAGE_NAME_KEYS.PROMO_OFFER]: "Promo Offer"
};
export const ALL_INFO_TRACK_DETAILS_REGEX = /\/all-info\/.*/;
export const URP_PAGE_CONFIG = [
{
page: PAGE_NAME_KEYS.TRACK_INFORMATION,
urlReg: /^\/racetracks((?!race=).)*$/
},
{ page: PAGE_NAME_KEYS.ALL_INFO_TRACK, urlReg: ALL_INFO_TRACK_DETAILS_REGEX },
{ page: PAGE_NAME_KEYS.PROGRAM_PAGE, urlReg: /\/racetracks/ },
{ page: PAGE_NAME_KEYS.PROGRAM_PAGE, urlReg: /\/live\/TVG\d?\/.*\?race=.+/ },
{ page: PAGE_NAME_KEYS.PROMO_OFFER, urlReg: /\/?promo=(?!s\b)/ }, // Mobile
{ page: PAGE_NAME_KEYS.PROMO_OFFER, urlReg: /\/promos\/[^?].+/ }, // Desktop
{ page: PAGE_NAME_KEYS.PROMOTIONS, urlReg: /(\/\w+)?#promos/ }, // Mobile
{ page: PAGE_NAME_KEYS.PROMOTIONS, urlReg: /^\/promos/ } // Desktop
];
export const RACE_STATUS_MAPPER = {
[RaceStatusEnum.OPEN]: "mtp",
[RaceStatusEnum.UP_NEXT]: "mtp",
[RaceStatusEnum.RACE_OFFICIAL]: "resulted",
[RaceStatusEnum.RACE_OFF]: "race_off"
};
export const DEVICE_ID_COOKIE = "amp_device_id";
export const DEVICE_ID_COOKIE_MAX_AGE = 31622400;
export const SESSION_ID_COOKIE = "amp_session_id";
export const SESSION_ID_COOKIE_MAX_AGE = 1800;
export const JURISDICTION_LOCAL_STORAGE_ITEM = "userAuthenticationState";
export const TRACKS_TABS_PATHS: Record<string, string> = {
"/tracks": "Today",
"/tracks/results": "Results",
"/tracks/all-info": "All Tracks"
};
export const XSELL_PREFIX = "FDR XS";
webpack://frontend-tpt/../../packages/urp-lib-amplitude/src/modules/talentPicks/constants.ts
import { COMMON_EVENT_NAMES } from "../../constants";
export const EVENTS = {
SELECT: "Select",
ALERTS: "Alerts",
NAVIGATED_TO: COMMON_EVENT_NAMES.NAVIGATED,
NEXT: "Next",
BACK: "Back",
CARD_CLICKED: "Talent Picks Card Clicked",
ADD_TO_BETSLIP: "Add To Betslip",
FILTERS_APPLIED: "Talent Picks Filter Applied",
EMPTY_STATE_VIEWED: "Talent Picks Empty State Viewed",
CTA_CLICKED: "Talent Picks CTA Clicked"
};
export const PAGES = {
TP: "Talent Pick Page",
HOMEPAGE: "Talent Pick Homepage",
PP_TRACKMASTER: "PP Trackmaster Picks"
};
export const LINK_TEXT = {
TALENT_NAME: "talent_name",
ADD_TO_BETSLIP: "add_to_betslip",
VIEW_RACE: "view_race"
} as const;
export const MODULE = {
PICKS_PAGE: "fdtv_picks_page",
HOME: "fdtv_home_placement",
RACE_CARD: "fdtv_race_card"
} as const;
export const FILTER = {
TRACK: "track_name",
TALENT: "talent_name"
} as const;
webpack://frontend-tpt/../../node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
var isDevelopment = false;
/*
Based off glamor's StyleSheet, thanks Sunil ❤️
high performance StyleSheet for css-in-js systems
- uses multiple style tags behind the scenes for millions of rules
- uses `insertRule` for appending in production for *much* faster performance
// usage
import { StyleSheet } from '@emotion/sheet'
let styleSheet = new StyleSheet({ key: '', container: document.head })
styleSheet.insert('#box { border: 1px solid red; }')
- appends a css rule into the stylesheet
styleSheet.flush()
- empties the stylesheet of all its contents
*/
function sheetForTag(tag) {
if (tag.sheet) {
return tag.sheet;
} // this weirdness brought to you by firefox
/* istanbul ignore next */
for (var i = 0; i < document.styleSheets.length; i++) {
if (document.styleSheets[i].ownerNode === tag) {
return document.styleSheets[i];
}
} // this function should always return with a value
// TS can't understand it though so we make it stop complaining here
return undefined;
}
function createStyleElement(options) {
var tag = document.createElement('style');
tag.setAttribute('data-emotion', options.key);
if (options.nonce !== undefined) {
tag.setAttribute('nonce', options.nonce);
}
tag.appendChild(document.createTextNode(''));
tag.setAttribute('data-s', '');
return tag;
}
var StyleSheet = /*#__PURE__*/function () {
// Using Node instead of HTMLElement since container may be a ShadowRoot
function StyleSheet(options) {
var _this = this;
this._insertTag = function (tag) {
var before;
if (_this.tags.length === 0) {
if (_this.insertionPoint) {
before = _this.insertionPoint.nextSibling;
} else if (_this.prepend) {
before = _this.container.firstChild;
} else {
before = _this.before;
}
} else {
before = _this.tags[_this.tags.length - 1].nextSibling;
}
_this.container.insertBefore(tag, before);
_this.tags.push(tag);
};
this.isSpeedy = options.speedy === undefined ? !isDevelopment : options.speedy;
this.tags = [];
this.ctr = 0;
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
this.key = options.key;
this.container = options.container;
this.prepend = options.prepend;
this.insertionPoint = options.insertionPoint;
this.before = null;
}
var _proto = StyleSheet.prototype;
_proto.hydrate = function hydrate(nodes) {
nodes.forEach(this._insertTag);
};
_proto.insert = function insert(rule) {
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
// it's 1 in dev because we insert source maps that map a single rule to a location
// and you can only have one source map per style tag
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
this._insertTag(createStyleElement(this));
}
var tag = this.tags[this.tags.length - 1];
if (this.isSpeedy) {
var sheet = sheetForTag(tag);
try {
// this is the ultrafast version, works across browsers
// the big drawback is that the css won't be editable in devtools
sheet.insertRule(rule, sheet.cssRules.length);
} catch (e) {
}
} else {
tag.appendChild(document.createTextNode(rule));
}
this.ctr++;
};
_proto.flush = function flush() {
this.tags.forEach(function (tag) {
var _tag$parentNode;
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
});
this.tags = [];
this.ctr = 0;
};
return StyleSheet;
}();
export { StyleSheet };
webpack://frontend-tpt/../../node_modules/stylis/src/Utility.js
/**
* @param {number}
* @return {number}
*/
export var abs = Math.abs
/**
* @param {number}
* @return {string}
*/
export var from = String.fromCharCode
/**
* @param {object}
* @return {object}
*/
export var assign = Object.assign
/**
* @param {string} value
* @param {number} length
* @return {number}
*/
export function hash (value, length) {
return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
}
/**
* @param {string} value
* @return {string}
*/
export function trim (value) {
return value.trim()
}
/**
* @param {string} value
* @param {RegExp} pattern
* @return {string?}
*/
export function match (value, pattern) {
return (value = pattern.exec(value)) ? value[0] : value
}
/**
* @param {string} value
* @param {(string|RegExp)} pattern
* @param {string} replacement
* @return {string}
*/
export function replace (value, pattern, replacement) {
return value.replace(pattern, replacement)
}
/**
* @param {string} value
* @param {string} search
* @return {number}
*/
export function indexof (value, search) {
return value.indexOf(search)
}
/**
* @param {string} value
* @param {number} index
* @return {number}
*/
export function charat (value, index) {
return value.charCodeAt(index) | 0
}
/**
* @param {string} value
* @param {number} begin
* @param {number} end
* @return {string}
*/
export function substr (value, begin, end) {
return value.slice(begin, end)
}
/**
* @param {string} value
* @return {number}
*/
export function strlen (value) {
return value.length
}
/**
* @param {any[]} value
* @return {number}
*/
export function sizeof (value) {
return value.length
}
/**
* @param {any} value
* @param {any[]} array
* @return {any}
*/
export function append (value, array) {
return array.push(value), value
}
/**
* @param {string[]} array
* @param {function} callback
* @return {string}
*/
export function combine (array, callback) {
return array.map(callback).join('')
}
webpack://frontend-tpt/../../node_modules/stylis/src/Tokenizer.js
import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'
export var line = 1
export var column = 1
export var length = 0
export var position = 0
export var character = 0
export var characters = ''
/**
* @param {string} value
* @param {object | null} root
* @param {object | null} parent
* @param {string} type
* @param {string[] | string} props
* @param {object[] | string} children
* @param {number} length
*/
export function node (value, root, parent, type, props, children, length) {
return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
}
/**
* @param {object} root
* @param {object} props
* @return {object}
*/
export function copy (root, props) {
return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
}
/**
* @return {number}
*/
export function char () {
return character
}
/**
* @return {number}
*/
export function prev () {
character = position > 0 ? charat(characters, --position) : 0
if (column--, character === 10)
column = 1, line--
return character
}
/**
* @return {number}
*/
export function next () {
character = position < length ? charat(characters, position++) : 0
if (column++, character === 10)
column = 1, line++
return character
}
/**
* @return {number}
*/
export function peek () {
return charat(characters, position)
}
/**
* @return {number}
*/
export function caret () {
return position
}
/**
* @param {number} begin
* @param {number} end
* @return {string}
*/
export function slice (begin, end) {
return substr(characters, begin, end)
}
/**
* @param {number} type
* @return {number}
*/
export function token (type) {
switch (type) {
// \0 \t \n \r \s whitespace token
case 0: case 9: case 10: case 13: case 32:
return 5
// ! + , / > @ ~ isolate token
case 33: case 43: case 44: case 47: case 62: case 64: case 126:
// ; { } breakpoint token
case 59: case 123: case 125:
return 4
// : accompanied token
case 58:
return 3
// " ' ( [ opening delimit token
case 34: case 39: case 40: case 91:
return 2
// ) ] closing delimit token
case 41: case 93:
return 1
}
return 0
}
/**
* @param {string} value
* @return {any[]}
*/
export function alloc (value) {
return line = column = 1, length = strlen(characters = value), position = 0, []
}
/**
* @param {any} value
* @return {any}
*/
export function dealloc (value) {
return characters = '', value
}
/**
* @param {number} type
* @return {string}
*/
export function delimit (type) {
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
}
/**
* @param {string} value
* @return {string[]}
*/
export function tokenize (value) {
return dealloc(tokenizer(alloc(value)))
}
/**
* @param {number} type
* @return {string}
*/
export function whitespace (type) {
while (character = peek())
if (character < 33)
next()
else
break
return token(type) > 2 || token(character) > 3 ? '' : ' '
}
/**
* @param {string[]} children
* @return {string[]}
*/
export function tokenizer (children) {
while (next())
switch (token(character)) {
case 0: append(identifier(position - 1), children)
break
case 2: append(delimit(character), children)
break
default: append(from(character), children)
}
return children
}
/**
* @param {number} index
* @param {number} count
* @return {string}
*/
export function escaping (index, count) {
while (--count && next())
// not 0-9 A-F a-f
if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
break
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
}
/**
* @param {number} type
* @return {number}
*/
export function delimiter (type) {
while (next())
switch (character) {
// ] ) " '
case type:
return position
// " '
case 34: case 39:
if (type !== 34 && type !== 39)
delimiter(character)
break
// (
case 40:
if (type === 41)
delimiter(type)
break
// \
case 92:
next()
break
}
return position
}
/**
* @param {number} type
* @param {number} index
* @return {number}
*/
export function commenter (type, index) {
while (next())
// //
if (type + character === 47 + 10)
break
// /*
else if (type + character === 42 + 42 && peek() === 47)
break
return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())
}
/**
* @param {number} index
* @return {string}
*/
export function identifier (index) {
while (!token(peek()))
next()
return slice(index, position)
}
webpack://frontend-tpt/../../node_modules/stylis/src/Enum.js
export var MS = '-ms-' export var MOZ = '-moz-' export var WEBKIT = '-webkit-' export var COMMENT = 'comm' export var RULESET = 'rule' export var DECLARATION = 'decl' export var PAGE = '@page' export var MEDIA = '@media' export var IMPORT = '@import' export var CHARSET = '@charset' export var VIEWPORT = '@viewport' export var SUPPORTS = '@supports' export var DOCUMENT = '@document' export var NAMESPACE = '@namespace' export var KEYFRAMES = '@keyframes' export var FONT_FACE = '@font-face' export var COUNTER_STYLE = '@counter-style' export var FONT_FEATURE_VALUES = '@font-feature-values' export var LAYER = '@layer'
webpack://frontend-tpt/../../node_modules/stylis/src/Serializer.js
import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'
import {strlen, sizeof} from './Utility.js'
/**
* @param {object[]} children
* @param {function} callback
* @return {string}
*/
export function serialize (children, callback) {
var output = ''
var length = sizeof(children)
for (var i = 0; i < length; i++)
output += callback(children[i], i, children, callback) || ''
return output
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
* @return {string}
*/
export function stringify (element, index, children, callback) {
switch (element.type) {
case LAYER: if (element.children.length) break
case IMPORT: case DECLARATION: return element.return = element.return || element.value
case COMMENT: return ''
case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
case RULESET: element.value = element.props.join(',')
}
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
}
webpack://frontend-tpt/../../node_modules/stylis/src/Parser.js
import {COMMENT, RULESET, DECLARATION} from './Enum.js'
import {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'
import {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'
/**
* @param {string} value
* @return {object[]}
*/
export function compile (value) {
return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {string[]} rule
* @param {string[]} rules
* @param {string[]} rulesets
* @param {number[]} pseudo
* @param {number[]} points
* @param {string[]} declarations
* @return {object}
*/
export function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
var index = 0
var offset = 0
var length = pseudo
var atrule = 0
var property = 0
var previous = 0
var variable = 1
var scanning = 1
var ampersand = 1
var character = 0
var type = ''
var props = rules
var children = rulesets
var reference = rule
var characters = type
while (scanning)
switch (previous = character, character = next()) {
// (
case 40:
if (previous != 108 && charat(characters, length - 1) == 58) {
if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
ampersand = -1
break
}
// " ' [
case 34: case 39: case 91:
characters += delimit(character)
break
// \t \n \r \s
case 9: case 10: case 13: case 32:
characters += whitespace(previous)
break
// \
case 92:
characters += escaping(caret() - 1, 7)
continue
// /
case 47:
switch (peek()) {
case 42: case 47:
append(comment(commenter(next(), caret()), root, parent), declarations)
break
default:
characters += '/'
}
break
// {
case 123 * variable:
points[index++] = strlen(characters) * ampersand
// } ; \0
case 125 * variable: case 59: case 0:
switch (character) {
// \0 }
case 0: case 125: scanning = 0
// ;
case 59 + offset: if (ampersand == -1) characters = replace(characters, /\f/g, '')
if (property > 0 && (strlen(characters) - length))
append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)
break
// @ ;
case 59: characters += ';'
// { rule/at-rule
default:
append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)
if (character === 123)
if (offset === 0)
parse(characters, root, reference, reference, props, rulesets, length, points, children)
else
switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
// d l m s
case 100: case 108: case 109: case 115:
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)
break
default:
parse(characters, reference, reference, reference, [''], children, 0, points, children)
}
}
index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo
break
// :
case 58:
length = 1 + strlen(characters), property = previous
default:
if (variable < 1)
if (character == 123)
--variable
else if (character == 125 && variable++ == 0 && prev() == 125)
continue
switch (characters += from(character), character * variable) {
// &
case 38:
ampersand = offset > 0 ? 1 : (characters += '\f', -1)
break
// ,
case 44:
points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1
break
// @
case 64:
// -
if (peek() === 45)
characters += delimit(next())
atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++
break
// -
case 45:
if (previous === 45 && strlen(characters) == 2)
variable = 0
}
}
return rulesets
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {number} index
* @param {number} offset
* @param {string[]} rules
* @param {number[]} points
* @param {string} type
* @param {string[]} props
* @param {string[]} children
* @param {number} length
* @return {object}
*/
export function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
var post = offset - 1
var rule = offset === 0 ? rules : ['']
var size = sizeof(rule)
for (var i = 0, j = 0, k = 0; i < index; ++i)
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
props[k++] = z
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
}
/**
* @param {number} value
* @param {object} root
* @param {object?} parent
* @return {object}
*/
export function comment (value, root, parent) {
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {number} length
* @return {object}
*/
export function declaration (value, root, parent, length) {
return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)
}
webpack://frontend-tpt/../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
import { StyleSheet } from '@emotion/sheet';
import { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, rulesheet, middleware, compile } from 'stylis';
import '@emotion/weak-memoize';
import '@emotion/memoize';
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
var previous = 0;
var character = 0;
while (true) {
previous = character;
character = peek(); // &\f
if (previous === 38 && character === 12) {
points[index] = 1;
}
if (token(character)) {
break;
}
next();
}
return slice(begin, position);
};
var toRules = function toRules(parsed, points) {
// pretend we've started with a comma
var index = -1;
var character = 44;
do {
switch (token(character)) {
case 0:
// &\f
if (character === 38 && peek() === 12) {
// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
// and when it should just concatenate the outer and inner selectors
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
points[index] = 1;
}
parsed[index] += identifierWithPointTracking(position - 1, points, index);
break;
case 2:
parsed[index] += delimit(character);
break;
case 4:
// comma
if (character === 44) {
// colon
parsed[++index] = peek() === 58 ? '&\f' : '';
points[index] = parsed[index].length;
break;
}
// fallthrough
default:
parsed[index] += from(character);
}
} while (character = next());
return parsed;
};
var getRules = function getRules(value, points) {
return dealloc(toRules(alloc(value), points));
}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
var fixedElements = /* #__PURE__ */new WeakMap();
var compat = function compat(element) {
if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
// negative .length indicates that this rule has been already prefixed
element.length < 1) {
return;
}
var value = element.value;
var parent = element.parent;
var isImplicitRule = element.column === parent.column && element.line === parent.line;
while (parent.type !== 'rule') {
parent = parent.parent;
if (!parent) return;
} // short-circuit for the simplest case
if (element.props.length === 1 && value.charCodeAt(0) !== 58
/* colon */
&& !fixedElements.get(parent)) {
return;
} // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
if (isImplicitRule) {
return;
}
fixedElements.set(element, true);
var points = [];
var rules = getRules(value, points);
var parentRules = parent.props;
for (var i = 0, k = 0; i < rules.length; i++) {
for (var j = 0; j < parentRules.length; j++, k++) {
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
}
}
};
var removeLabel = function removeLabel(element) {
if (element.type === 'decl') {
var value = element.value;
if ( // charcode for l
value.charCodeAt(0) === 108 && // charcode for b
value.charCodeAt(2) === 98) {
// this ignores label
element["return"] = '';
element.value = '';
}
}
};
/* eslint-disable no-fallthrough */
function prefix(value, length) {
switch (hash(value, length)) {
// color-adjust
case 5103:
return WEBKIT + 'print-' + value + value;
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
case 5737:
case 4201:
case 3177:
case 3433:
case 1641:
case 4457:
case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
case 5572:
case 6356:
case 5844:
case 3191:
case 6645:
case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
case 6391:
case 5879:
case 5623:
case 6135:
case 4599:
case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
case 4215:
case 6389:
case 5109:
case 5365:
case 5621:
case 3829:
return WEBKIT + value + value;
// appearance, user-select, transform, hyphens, text-size-adjust
case 5349:
case 4246:
case 4810:
case 6968:
case 2756:
return WEBKIT + value + MOZ + value + MS + value + value;
// flex, flex-direction
case 6828:
case 4268:
return WEBKIT + value + MS + value + value;
// order
case 6165:
return WEBKIT + value + MS + 'flex-' + value + value;
// align-items
case 5187:
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
// align-self
case 5443:
return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
// align-content
case 4675:
return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
// flex-shrink
case 5548:
return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
// flex-basis
case 5292:
return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
// flex-grow
case 6060:
return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
// transition
case 4554:
return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
// cursor
case 6187:
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
// background, background-image
case 5495:
case 3959:
return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
// justify-content
case 4968:
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
// (margin|padding)-inline-(start|end)
case 4095:
case 3583:
case 4068:
case 2532:
return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
// (min|max)?(width|height|inline-size|block-size)
case 8116:
case 7059:
case 5753:
case 5535:
case 5445:
case 5701:
case 4933:
case 4677:
case 5533:
case 5789:
case 5021:
case 4765:
// stretch, max-content, min-content, fill-available
if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
// (m)ax-content, (m)in-content
case 109:
// -
if (charat(value, length + 4) !== 45) break;
// (f)ill-available, (f)it-content
case 102:
return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
// (s)tretch
case 115:
return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
}
break;
// position: sticky
case 4949:
// (s)ticky?
if (charat(value, length + 1) !== 115) break;
// display: (flex|inline-flex)
case 6444:
switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
// stic(k)y
case 107:
return replace(value, ':', ':' + WEBKIT) + value;
// (inline-)?fl(e)x
case 101:
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
}
break;
// writing-mode
case 5936:
switch (charat(value, length + 11)) {
// vertical-l(r)
case 114:
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
// vertical-r(l)
case 108:
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
// horizontal(-)tb
case 45:
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
}
return WEBKIT + value + MS + value + value;
}
return value;
}
var prefixer = function prefixer(element, index, children, callback) {
if (element.length > -1) if (!element["return"]) switch (element.type) {
case DECLARATION:
element["return"] = prefix(element.value, element.length);
break;
case KEYFRAMES:
return serialize([copy(element, {
value: replace(element.value, '@', '@' + WEBKIT)
})], callback);
case RULESET:
if (element.length) return combine(element.props, function (value) {
switch (match(value, /(::plac\w+|:read-\w+)/)) {
// :read-(only|write)
case ':read-only':
case ':read-write':
return serialize([copy(element, {
props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
})], callback);
// :placeholder
case '::placeholder':
return serialize([copy(element, {
props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
}), copy(element, {
props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
}), copy(element, {
props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
})], callback);
}
return '';
});
}
};
var defaultStylisPlugins = [prefixer];
var createCache = function createCache(options) {
var key = options.key;
if (key === 'css') {
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
// note this very very intentionally targets all style elements regardless of the key to ensure
// that creating a cache works inside of render of a React component
Array.prototype.forEach.call(ssrStyles, function (node) {
// we want to only move elements which have a space in the data-emotion attribute value
// because that indicates that it is an Emotion 11 server-side rendered style elements
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
// will not result in the Emotion 10 styles being destroyed
var dataEmotionAttribute = node.getAttribute('data-emotion');
if (dataEmotionAttribute.indexOf(' ') === -1) {
return;
}
document.head.appendChild(node);
node.setAttribute('data-s', '');
});
}
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
var inserted = {};
var container;
var nodesToHydrate = [];
{
container = options.container || document.head;
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
var attrib = node.getAttribute("data-emotion").split(' ');
for (var i = 1; i < attrib.length; i++) {
inserted[attrib[i]] = true;
}
nodesToHydrate.push(node);
});
}
var _insert;
var omnipresentPlugins = [compat, removeLabel];
{
var currentSheet;
var finalizingPlugins = [stringify, rulesheet(function (rule) {
currentSheet.insert(rule);
})];
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
var stylis = function stylis(styles) {
return serialize(compile(styles), serializer);
};
_insert = function insert(selector, serialized, sheet, shouldCache) {
currentSheet = sheet;
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
if (shouldCache) {
cache.inserted[serialized.name] = true;
}
};
}
var cache = {
key: key,
sheet: new StyleSheet({
key: key,
container: container,
nonce: options.nonce,
speedy: options.speedy,
prepend: options.prepend,
insertionPoint: options.insertionPoint
}),
nonce: options.nonce,
inserted: inserted,
registered: {},
insert: _insert
};
cache.sheet.hydrate(nodesToHydrate);
return cache;
};
export { createCache as default };
webpack://frontend-tpt/../../node_modules/stylis/src/Middleware.js
import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'
import {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'
import {copy, tokenize} from './Tokenizer.js'
import {serialize} from './Serializer.js'
import {prefix} from './Prefixer.js'
/**
* @param {function[]} collection
* @return {function}
*/
export function middleware (collection) {
var length = sizeof(collection)
return function (element, index, children, callback) {
var output = ''
for (var i = 0; i < length; i++)
output += collection[i](element, index, children, callback) || ''
return output
}
}
/**
* @param {function} callback
* @return {function}
*/
export function rulesheet (callback) {
return function (element) {
if (!element.root)
if (element = element.return)
callback(element)
}
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
*/
export function prefixer (element, index, children, callback) {
if (element.length > -1)
if (!element.return)
switch (element.type) {
case DECLARATION: element.return = prefix(element.value, element.length, children)
return
case KEYFRAMES:
return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)
case RULESET:
if (element.length)
return combine(element.props, function (value) {
switch (match(value, /(::plac\w+|:read-\w+)/)) {
// :read-(only|write)
case ':read-only': case ':read-write':
return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback)
// :placeholder
case '::placeholder':
return serialize([
copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}),
copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}),
copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]})
], callback)
}
return ''
})
}
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
*/
export function namespace (element) {
switch (element.type) {
case RULESET:
element.props = element.props.map(function (value) {
return combine(tokenize(value), function (value, index, children) {
switch (charat(value, 0)) {
// \f
case 12:
return substr(value, 1, strlen(value))
// \0 ( + > ~
case 0: case 40: case 43: case 62: case 126:
return value
// :
case 58:
if (children[++index] === 'global')
children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1)
// \s
case 32:
return index === 1 ? '' : value
default:
switch (index) {
case 0: element = value
return sizeof(children) > 1 ? '' : value
case index = sizeof(children) - 1: case 2:
return index === 2 ? value + element + element : value + element
default:
return value
}
}
})
})
}
}
webpack://frontend-tpt/../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
var isBrowser = true;
function getRegisteredStyles(registered, registeredStyles, classNames) {
var rawClassName = '';
classNames.split(' ').forEach(function (className) {
if (registered[className] !== undefined) {
registeredStyles.push(registered[className] + ";");
} else if (className) {
rawClassName += className + " ";
}
});
return rawClassName;
}
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
var className = cache.key + "-" + serialized.name;
if ( // we only need to add the styles to the registered cache if the
// class name could be used further down
// the tree but if it's a string tag, we know it won't
// so we don't have to add it to registered cache.
// this improves memory usage since we can avoid storing the whole style string
(isStringTag === false || // we need to always store it if we're in compat mode and
// in node since emotion-server relies on whether a style is in
// the registered cache to know whether a style is global or not
// also, note that this check will be dead code eliminated in the browser
isBrowser === false ) && cache.registered[className] === undefined) {
cache.registered[className] = serialized.styles;
}
};
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
registerStyles(cache, serialized, isStringTag);
var className = cache.key + "-" + serialized.name;
if (cache.inserted[serialized.name] === undefined) {
var current = serialized;
do {
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
current = current.next;
} while (current !== undefined);
}
};
export { getRegisteredStyles, insertStyles, registerStyles };
webpack://frontend-tpt/../../node_modules/@emotion/serialize/dist/emotion-serialize.esm.js
import hashString from '@emotion/hash';
import unitless from '@emotion/unitless';
import memoize from '@emotion/memoize';
var isDevelopment = false;
var hyphenateRegex = /[A-Z]|^ms/g;
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
var isCustomProperty = function isCustomProperty(property) {
return property.charCodeAt(1) === 45;
};
var isProcessableValue = function isProcessableValue(value) {
return value != null && typeof value !== 'boolean';
};
var processStyleName = /* #__PURE__ */memoize(function (styleName) {
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
});
var processStyleValue = function processStyleValue(key, value) {
switch (key) {
case 'animation':
case 'animationName':
{
if (typeof value === 'string') {
return value.replace(animationRegex, function (match, p1, p2) {
cursor = {
name: p1,
styles: p2,
next: cursor
};
return p1;
});
}
}
}
if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
return value + 'px';
}
return value;
};
var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
function handleInterpolation(mergedProps, registered, interpolation) {
if (interpolation == null) {
return '';
}
var componentSelector = interpolation;
if (componentSelector.__emotion_styles !== undefined) {
return componentSelector;
}
switch (typeof interpolation) {
case 'boolean':
{
return '';
}
case 'object':
{
var keyframes = interpolation;
if (keyframes.anim === 1) {
cursor = {
name: keyframes.name,
styles: keyframes.styles,
next: cursor
};
return keyframes.name;
}
var serializedStyles = interpolation;
if (serializedStyles.styles !== undefined) {
var next = serializedStyles.next;
if (next !== undefined) {
// not the most efficient thing ever but this is a pretty rare case
// and there will be very few iterations of this generally
while (next !== undefined) {
cursor = {
name: next.name,
styles: next.styles,
next: cursor
};
next = next.next;
}
}
var styles = serializedStyles.styles + ";";
return styles;
}
return createStringFromObject(mergedProps, registered, interpolation);
}
case 'function':
{
if (mergedProps !== undefined) {
var previousCursor = cursor;
var result = interpolation(mergedProps);
cursor = previousCursor;
return handleInterpolation(mergedProps, registered, result);
}
break;
}
} // finalize string values (regular strings and functions interpolated into css calls)
var asString = interpolation;
if (registered == null) {
return asString;
}
var cached = registered[asString];
return cached !== undefined ? cached : asString;
}
function createStringFromObject(mergedProps, registered, obj) {
var string = '';
if (Array.isArray(obj)) {
for (var i = 0; i < obj.length; i++) {
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
}
} else {
for (var key in obj) {
var value = obj[key];
if (typeof value !== 'object') {
var asString = value;
if (registered != null && registered[asString] !== undefined) {
string += key + "{" + registered[asString] + "}";
} else if (isProcessableValue(asString)) {
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
}
} else {
if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {
throw new Error(noComponentSelectorMessage);
}
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
for (var _i = 0; _i < value.length; _i++) {
if (isProcessableValue(value[_i])) {
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
}
}
} else {
var interpolated = handleInterpolation(mergedProps, registered, value);
switch (key) {
case 'animation':
case 'animationName':
{
string += processStyleName(key) + ":" + interpolated + ";";
break;
}
default:
{
string += key + "{" + interpolated + "}";
}
}
}
}
}
}
return string;
}
var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g; // this is the cursor for keyframes
// keyframes are stored on the SerializedStyles object as a linked list
var cursor;
function serializeStyles(args, registered, mergedProps) {
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
return args[0];
}
var stringMode = true;
var styles = '';
cursor = undefined;
var strings = args[0];
if (strings == null || strings.raw === undefined) {
stringMode = false;
styles += handleInterpolation(mergedProps, registered, strings);
} else {
var asTemplateStringsArr = strings;
styles += asTemplateStringsArr[0];
} // we start at 1 since we've already handled the first arg
for (var i = 1; i < args.length; i++) {
styles += handleInterpolation(mergedProps, registered, args[i]);
if (stringMode) {
var templateStringsArr = strings;
styles += templateStringsArr[i];
}
} // using a global regex with .exec is stateful so lastIndex has to be reset each time
labelPattern.lastIndex = 0;
var identifierName = '';
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
while ((match = labelPattern.exec(styles)) !== null) {
identifierName += '-' + match[1];
}
var name = hashString(styles) + identifierName;
return {
name: name,
styles: styles,
next: cursor
};
}
export { serializeStyles };
webpack://frontend-tpt/../../node_modules/@emotion/hash/dist/emotion-hash.esm.js
/* eslint-disable */
// Inspired by https://github.com/garycourt/murmurhash-js
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
function murmur2(str) {
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
// const m = 0x5bd1e995;
// const r = 24;
// Initialize the hash
var h = 0; // Mix 4 bytes at a time into the hash
var k,
i = 0,
len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
k =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
k ^=
/* k >>> r: */
k >>> 24;
h =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Handle the last few bytes of the input array
switch (len) {
case 3:
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
case 1:
h ^= str.charCodeAt(i) & 0xff;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.
h ^= h >>> 13;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
export { murmur2 as default };
webpack://frontend-tpt/../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
import * as React from 'react';
var syncFallback = function syncFallback(create) {
return create();
};
var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
var useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;
export { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };
webpack://frontend-tpt/../../node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js
import * as React from 'react';
import { useContext, forwardRef } from 'react';
import createCache from '@emotion/cache';
import _extends from '@babel/runtime/helpers/esm/extends';
import weakMemoize from '@emotion/weak-memoize';
import hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';
import { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';
import { serializeStyles } from '@emotion/serialize';
import { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';
var isBrowser = "object" !== 'undefined';
var hasOwnProperty = {}.hasOwnProperty;
var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
// because this module is primarily intended for the browser and node
// but it's also required in react native and similar environments sometimes
// and we could have a special build just for that
// but this is much easier and the native packages
// might use a different theme context in the future anyway
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
key: 'css'
}) : null);
if (process.env.NODE_ENV !== 'production') {
EmotionCacheContext.displayName = 'EmotionCacheContext';
}
var CacheProvider = EmotionCacheContext.Provider;
var __unsafe_useEmotionCache = function useEmotionCache() {
return useContext(EmotionCacheContext);
};
var withEmotionCache = function withEmotionCache(func) {
// $FlowFixMe
return /*#__PURE__*/forwardRef(function (props, ref) {
// the cache will never be null in the browser
var cache = useContext(EmotionCacheContext);
return func(props, cache, ref);
});
};
if (!isBrowser) {
withEmotionCache = function withEmotionCache(func) {
return function (props) {
var cache = useContext(EmotionCacheContext);
if (cache === null) {
// yes, we're potentially creating this on every render
// it doesn't actually matter though since it's only on the server
// so there will only every be a single render
// that could change in the future because of suspense and etc. but for now,
// this works and i don't want to optimise for a future thing that we aren't sure about
cache = createCache({
key: 'css'
});
return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {
value: cache
}, func(props, cache));
} else {
return func(props, cache);
}
};
};
}
var ThemeContext = /* #__PURE__ */React.createContext({});
if (process.env.NODE_ENV !== 'production') {
ThemeContext.displayName = 'EmotionThemeContext';
}
var useTheme = function useTheme() {
return React.useContext(ThemeContext);
};
var getTheme = function getTheme(outerTheme, theme) {
if (typeof theme === 'function') {
var mergedTheme = theme(outerTheme);
if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {
throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
}
return mergedTheme;
}
if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {
throw new Error('[ThemeProvider] Please make your theme prop a plain object');
}
return _extends({}, outerTheme, theme);
};
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
return weakMemoize(function (theme) {
return getTheme(outerTheme, theme);
});
});
var ThemeProvider = function ThemeProvider(props) {
var theme = React.useContext(ThemeContext);
if (props.theme !== theme) {
theme = createCacheWithTheme(theme)(props.theme);
}
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
value: theme
}, props.children);
};
function withTheme(Component) {
var componentName = Component.displayName || Component.name || 'Component';
var render = function render(props, ref) {
var theme = React.useContext(ThemeContext);
return /*#__PURE__*/React.createElement(Component, _extends({
theme: theme,
ref: ref
}, props));
}; // $FlowFixMe
var WithTheme = /*#__PURE__*/React.forwardRef(render);
WithTheme.displayName = "WithTheme(" + componentName + ")";
return hoistNonReactStatics(WithTheme, Component);
}
var getLastPart = function getLastPart(functionName) {
// The match may be something like 'Object.createEmotionProps' or
// 'Loader.prototype.render'
var parts = functionName.split('.');
return parts[parts.length - 1];
};
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
// V8
var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
if (match) return getLastPart(match[1]); // Safari / Firefox
match = /^([A-Za-z0-9$.]+)@/.exec(line);
if (match) return getLastPart(match[1]);
return undefined;
};
var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
// identifiers, thus we only need to replace what is a valid character for JS,
// but not for CSS.
var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
return identifier.replace(/\$/g, '-');
};
var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
if (!stackTrace) return undefined;
var lines = stackTrace.split('\n');
for (var i = 0; i < lines.length; i++) {
var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
// uppercase letter
if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
}
return undefined;
};
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
var createEmotionProps = function createEmotionProps(type, props) {
if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration
props.css.indexOf(':') !== -1) {
throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`");
}
var newProps = {};
for (var key in props) {
if (hasOwnProperty.call(props, key)) {
newProps[key] = props[key];
}
}
newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when
// the label hasn't already been computed
if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {
var label = getLabelFromStackTrace(new Error().stack);
if (label) newProps[labelPropName] = label;
}
return newProps;
};
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
registerStyles(cache, serialized, isStringTag);
useInsertionEffectAlwaysWithSyncFallback(function () {
return insertStyles(cache, serialized, isStringTag);
});
return null;
};
var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
// not passing the registered cache to serializeStyles because it would
// make certain babel optimisations not possible
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
cssProp = cache.registered[cssProp];
}
var WrappedComponent = props[typePropName];
var registeredStyles = [cssProp];
var className = '';
if (typeof props.className === 'string') {
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));
if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
var labelFromStack = props[labelPropName];
if (labelFromStack) {
serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
}
}
className += cache.key + "-" + serialized.name;
var newProps = {};
for (var key in props) {
if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
newProps[key] = props[key];
}
}
newProps.ref = ref;
newProps.className = className;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof WrappedComponent === 'string'
}), /*#__PURE__*/React.createElement(WrappedComponent, newProps));
});
if (process.env.NODE_ENV !== 'production') {
Emotion.displayName = 'EmotionCssPropInternal';
}
var Emotion$1 = Emotion;
export { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwnProperty as h, isBrowser as i, useTheme as u, withEmotionCache as w };
webpack://frontend-tpt/../../node_modules/@emotion/styled/node_modules/@babel/runtime/helpers/esm/extends.js
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends.apply(null, arguments);
}
export { _extends as default };
webpack://frontend-tpt/../../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js
import _extends from '@babel/runtime/helpers/esm/extends';
import * as React from 'react';
import isPropValid from '@emotion/is-prop-valid';
import { withEmotionCache, ThemeContext } from '@emotion/react';
import { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';
import { serializeStyles } from '@emotion/serialize';
import { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';
var testOmitPropsOnStringTag = isPropValid;
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
return key !== 'theme';
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
return typeof tag === 'string' && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
var shouldForwardProp;
if (options) {
var optionsShouldForwardProp = options.shouldForwardProp;
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
} : optionsShouldForwardProp;
}
if (typeof shouldForwardProp !== 'function' && isReal) {
shouldForwardProp = tag.__emotion_forwardProp;
}
return shouldForwardProp;
};
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
registerStyles(cache, serialized, isStringTag);
useInsertionEffectAlwaysWithSyncFallback(function () {
return insertStyles(cache, serialized, isStringTag);
});
return null;
};
var createStyled = function createStyled(tag, options) {
if (process.env.NODE_ENV !== 'production') {
if (tag === undefined) {
throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
}
}
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
var identifierName;
var targetClassName;
if (options !== undefined) {
identifierName = options.label;
targetClassName = options.target;
}
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp('as');
return function () {
var args = arguments;
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== undefined) {
styles.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === undefined) {
styles.push.apply(styles, args);
} else {
if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[0][0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[i], args[0][i]);
}
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
var Styled = withEmotionCache(function (props, cache, ref) {
var FinalTag = shouldUseAs && props.as || baseTag;
var className = '';
var classInterpolations = [];
var mergedProps = props;
if (props.theme == null) {
mergedProps = {};
for (var key in props) {
mergedProps[key] = props[key];
}
mergedProps.theme = React.useContext(ThemeContext);
}
if (typeof props.className === 'string') {
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
className += cache.key + "-" + serialized.name;
if (targetClassName !== undefined) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props) {
if (shouldUseAs && _key === 'as') continue;
if ( // $FlowFixMe
finalShouldForwardProp(_key)) {
newProps[_key] = props[_key];
}
}
newProps.className = className;
newProps.ref = ref;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof FinalTag === 'string'
}), /*#__PURE__*/React.createElement(FinalTag, newProps));
});
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles;
Styled.__emotion_forwardProp = shouldForwardProp;
Object.defineProperty(Styled, 'toString', {
value: function value() {
if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {
return 'NO_COMPONENT_SELECTOR';
} // $FlowFixMe: coerce undefined to string
return "." + targetClassName;
}
});
Styled.withComponent = function (nextTag, nextOptions) {
return createStyled(nextTag, _extends({}, options, nextOptions, {
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
})).apply(void 0, styles);
};
return Styled;
};
};
export { createStyled as default };
webpack://frontend-tpt/../../node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js
import createStyled from '../base/dist/emotion-styled-base.browser.esm.js';
import '@babel/runtime/helpers/extends';
import 'react';
import '@emotion/is-prop-valid';
import '@emotion/react';
import '@emotion/utils';
import '@emotion/serialize';
import '@emotion/use-insertion-effect-with-fallbacks';
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
var newStyled = createStyled.bind();
tags.forEach(function (tagName) {
// $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
newStyled[tagName] = newStyled(tagName);
});
export { newStyled as default };
webpack://frontend-tpt/../../node_modules/@styled-system/core/dist/index.esm.js
import assign from 'object-assign';
export var merge = function merge(a, b) {
var result = assign({}, a, b);
for (var key in a) {
var _assign;
if (!a[key] || typeof b[key] !== 'object') continue;
assign(result, (_assign = {}, _assign[key] = assign(a[key], b[key]), _assign));
}
return result;
}; // sort object-value responsive styles
var sort = function sort(obj) {
var next = {};
Object.keys(obj).sort(function (a, b) {
return a.localeCompare(b, undefined, {
numeric: true,
sensitivity: 'base'
});
}).forEach(function (key) {
next[key] = obj[key];
});
return next;
};
var defaults = {
breakpoints: [40, 52, 64].map(function (n) {
return n + 'em';
})
};
var createMediaQuery = function createMediaQuery(n) {
return "@media screen and (min-width: " + n + ")";
};
var getValue = function getValue(n, scale) {
return get(scale, n, n);
};
export var get = function get(obj, key, def, p, undef) {
key = key && key.split ? key.split('.') : [key];
for (p = 0; p < key.length; p++) {
obj = obj ? obj[key[p]] : undef;
}
return obj === undef ? def : obj;
};
export var createParser = function createParser(config) {
var cache = {};
var parse = function parse(props) {
var styles = {};
var shouldSort = false;
var isCacheDisabled = props.theme && props.theme.disableStyledSystemCache;
for (var key in props) {
if (!config[key]) continue;
var sx = config[key];
var raw = props[key];
var scale = get(props.theme, sx.scale, sx.defaults);
if (typeof raw === 'object') {
cache.breakpoints = !isCacheDisabled && cache.breakpoints || get(props.theme, 'breakpoints', defaults.breakpoints);
if (Array.isArray(raw)) {
cache.media = !isCacheDisabled && cache.media || [null].concat(cache.breakpoints.map(createMediaQuery));
styles = merge(styles, parseResponsiveStyle(cache.media, sx, scale, raw, props));
continue;
}
if (raw !== null) {
styles = merge(styles, parseResponsiveObject(cache.breakpoints, sx, scale, raw, props));
shouldSort = true;
}
continue;
}
assign(styles, sx(raw, scale, props));
} // sort object-based responsive styles
if (shouldSort) {
styles = sort(styles);
}
return styles;
};
parse.config = config;
parse.propNames = Object.keys(config);
parse.cache = cache;
var keys = Object.keys(config).filter(function (k) {
return k !== 'config';
});
if (keys.length > 1) {
keys.forEach(function (key) {
var _createParser;
parse[key] = createParser((_createParser = {}, _createParser[key] = config[key], _createParser));
});
}
return parse;
};
var parseResponsiveStyle = function parseResponsiveStyle(mediaQueries, sx, scale, raw, _props) {
var styles = {};
raw.slice(0, mediaQueries.length).forEach(function (value, i) {
var media = mediaQueries[i];
var style = sx(value, scale, _props);
if (!media) {
assign(styles, style);
} else {
var _assign2;
assign(styles, (_assign2 = {}, _assign2[media] = assign({}, styles[media], style), _assign2));
}
});
return styles;
};
var parseResponsiveObject = function parseResponsiveObject(breakpoints, sx, scale, raw, _props) {
var styles = {};
for (var key in raw) {
var breakpoint = breakpoints[key];
var value = raw[key];
var style = sx(value, scale, _props);
if (!breakpoint) {
assign(styles, style);
} else {
var _assign3;
var media = createMediaQuery(breakpoint);
assign(styles, (_assign3 = {}, _assign3[media] = assign({}, styles[media], style), _assign3));
}
}
return styles;
};
export var createStyleFunction = function createStyleFunction(_ref) {
var properties = _ref.properties,
property = _ref.property,
scale = _ref.scale,
_ref$transform = _ref.transform,
transform = _ref$transform === void 0 ? getValue : _ref$transform,
defaultScale = _ref.defaultScale;
properties = properties || [property];
var sx = function sx(value, scale, _props) {
var result = {};
var n = transform(value, scale, _props);
if (n === null) return;
properties.forEach(function (prop) {
result[prop] = n;
});
return result;
};
sx.scale = scale;
sx.defaults = defaultScale;
return sx;
}; // new v5 API
export var system = function system(args) {
if (args === void 0) {
args = {};
}
var config = {};
Object.keys(args).forEach(function (key) {
var conf = args[key];
if (conf === true) {
// shortcut definition
config[key] = createStyleFunction({
property: key,
scale: key
});
return;
}
if (typeof conf === 'function') {
config[key] = conf;
return;
}
config[key] = createStyleFunction(conf);
});
var parser = createParser(config);
return parser;
};
export var compose = function compose() {
var config = {};
for (var _len = arguments.length, parsers = new Array(_len), _key = 0; _key < _len; _key++) {
parsers[_key] = arguments[_key];
}
parsers.forEach(function (parser) {
if (!parser || !parser.config) return;
assign(config, parser.config);
});
var parser = createParser(config);
return parser;
};
webpack://frontend-tpt/../../node_modules/@styled-system/layout/dist/index.esm.js
import { system, get } from '@styled-system/core';
var isNumber = function isNumber(n) {
return typeof n === 'number' && !isNaN(n);
};
var getWidth = function getWidth(n, scale) {
return get(scale, n, !isNumber(n) || n > 1 ? n : n * 100 + '%');
};
var config = {
width: {
property: 'width',
scale: 'sizes',
transform: getWidth
},
height: {
property: 'height',
scale: 'sizes'
},
minWidth: {
property: 'minWidth',
scale: 'sizes'
},
minHeight: {
property: 'minHeight',
scale: 'sizes'
},
maxWidth: {
property: 'maxWidth',
scale: 'sizes'
},
maxHeight: {
property: 'maxHeight',
scale: 'sizes'
},
size: {
properties: ['width', 'height'],
scale: 'sizes'
},
overflow: true,
overflowX: true,
overflowY: true,
display: true,
verticalAlign: true
};
export var layout = system(config);
export default layout;
webpack://frontend-tpt/../../node_modules/@styled-system/color/dist/index.esm.js
import { system } from '@styled-system/core';
var config = {
color: {
property: 'color',
scale: 'colors'
},
backgroundColor: {
property: 'backgroundColor',
scale: 'colors'
},
opacity: true
};
config.bg = config.backgroundColor;
export var color = system(config);
export default color;
webpack://frontend-tpt/../../node_modules/@styled-system/typography/dist/index.esm.js
import { system } from '@styled-system/core';
var defaults = {
fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72]
};
var config = {
fontFamily: {
property: 'fontFamily',
scale: 'fonts'
},
fontSize: {
property: 'fontSize',
scale: 'fontSizes',
defaultScale: defaults.fontSizes
},
fontWeight: {
property: 'fontWeight',
scale: 'fontWeights'
},
lineHeight: {
property: 'lineHeight',
scale: 'lineHeights'
},
letterSpacing: {
property: 'letterSpacing',
scale: 'letterSpacings'
},
textAlign: true,
fontStyle: true
};
export var typography = system(config);
export default typography;
webpack://frontend-tpt/../../node_modules/@styled-system/flexbox/dist/index.esm.js
import { system } from '@styled-system/core';
var config = {
alignItems: true,
alignContent: true,
justifyItems: true,
justifyContent: true,
flexWrap: true,
flexDirection: true,
// item
flex: true,
flexGrow: true,
flexShrink: true,
flexBasis: true,
justifySelf: true,
alignSelf: true,
order: true
};
export var flexbox = system(config);
export default flexbox;
webpack://frontend-tpt/../../node_modules/@styled-system/grid/dist/index.esm.js
import { system } from '@styled-system/core';
var defaults = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512]
};
var config = {
gridGap: {
property: 'gridGap',
scale: 'space',
defaultScale: defaults.space
},
gridColumnGap: {
property: 'gridColumnGap',
scale: 'space',
defaultScale: defaults.space
},
gridRowGap: {
property: 'gridRowGap',
scale: 'space',
defaultScale: defaults.space
},
gridColumn: true,
gridRow: true,
gridAutoFlow: true,
gridAutoColumns: true,
gridAutoRows: true,
gridTemplateColumns: true,
gridTemplateRows: true,
gridTemplateAreas: true,
gridArea: true
};
export var grid = system(config);
export default grid;
webpack://frontend-tpt/../../node_modules/@styled-system/border/dist/index.esm.js
import { system } from '@styled-system/core';
var config = {
border: {
property: 'border',
scale: 'borders'
},
borderWidth: {
property: 'borderWidth',
scale: 'borderWidths'
},
borderStyle: {
property: 'borderStyle',
scale: 'borderStyles'
},
borderColor: {
property: 'borderColor',
scale: 'colors'
},
borderRadius: {
property: 'borderRadius',
scale: 'radii'
},
borderTop: {
property: 'borderTop',
scale: 'borders'
},
borderTopLeftRadius: {
property: 'borderTopLeftRadius',
scale: 'radii'
},
borderTopRightRadius: {
property: 'borderTopRightRadius',
scale: 'radii'
},
borderRight: {
property: 'borderRight',
scale: 'borders'
},
borderBottom: {
property: 'borderBottom',
scale: 'borders'
},
borderBottomLeftRadius: {
property: 'borderBottomLeftRadius',
scale: 'radii'
},
borderBottomRightRadius: {
property: 'borderBottomRightRadius',
scale: 'radii'
},
borderLeft: {
property: 'borderLeft',
scale: 'borders'
},
borderX: {
properties: ['borderLeft', 'borderRight'],
scale: 'borders'
},
borderY: {
properties: ['borderTop', 'borderBottom'],
scale: 'borders'
}
};
config.borderTopWidth = {
property: 'borderTopWidth',
scale: 'borderWidths'
};
config.borderTopColor = {
property: 'borderTopColor',
scale: 'colors'
};
config.borderTopStyle = {
property: 'borderTopStyle',
scale: 'borderStyles'
};
config.borderTopLeftRadius = {
property: 'borderTopLeftRadius',
scale: 'radii'
};
config.borderTopRightRadius = {
property: 'borderTopRightRadius',
scale: 'radii'
};
config.borderBottomWidth = {
property: 'borderBottomWidth',
scale: 'borderWidths'
};
config.borderBottomColor = {
property: 'borderBottomColor',
scale: 'colors'
};
config.borderBottomStyle = {
property: 'borderBottomStyle',
scale: 'borderStyles'
};
config.borderBottomLeftRadius = {
property: 'borderBottomLeftRadius',
scale: 'radii'
};
config.borderBottomRightRadius = {
property: 'borderBottomRightRadius',
scale: 'radii'
};
config.borderLeftWidth = {
property: 'borderLeftWidth',
scale: 'borderWidths'
};
config.borderLeftColor = {
property: 'borderLeftColor',
scale: 'colors'
};
config.borderLeftStyle = {
property: 'borderLeftStyle',
scale: 'borderStyles'
};
config.borderRightWidth = {
property: 'borderRightWidth',
scale: 'borderWidths'
};
config.borderRightColor = {
property: 'borderRightColor',
scale: 'colors'
};
config.borderRightStyle = {
property: 'borderRightStyle',
scale: 'borderStyles'
};
export var border = system(config);
export default border;
webpack://frontend-tpt/../../node_modules/@styled-system/background/dist/index.esm.js
import { system } from '@styled-system/core';
var config = {
background: true,
backgroundImage: true,
backgroundSize: true,
backgroundPosition: true,
backgroundRepeat: true
};
config.bgImage = config.backgroundImage;
config.bgSize = config.backgroundSize;
config.bgPosition = config.backgroundPosition;
config.bgRepeat = config.backgroundRepeat;
export var background = system(config);
export default background;
webpack://frontend-tpt/../../node_modules/@styled-system/position/dist/index.esm.js
import { system } from '@styled-system/core';
var defaults = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512]
};
var config = {
position: true,
zIndex: {
property: 'zIndex',
scale: 'zIndices'
},
top: {
property: 'top',
scale: 'space',
defaultScale: defaults.space
},
right: {
property: 'right',
scale: 'space',
defaultScale: defaults.space
},
bottom: {
property: 'bottom',
scale: 'space',
defaultScale: defaults.space
},
left: {
property: 'left',
scale: 'space',
defaultScale: defaults.space
}
};
export var position = system(config);
export default position;
webpack://frontend-tpt/../../node_modules/@styled-system/space/dist/index.esm.js
import { get, system, compose } from '@styled-system/core';
var defaults = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512]
};
var isNumber = function isNumber(n) {
return typeof n === 'number' && !isNaN(n);
};
var getMargin = function getMargin(n, scale) {
if (!isNumber(n)) {
return get(scale, n, n);
}
var isNegative = n < 0;
var absolute = Math.abs(n);
var value = get(scale, absolute, absolute);
if (!isNumber(value)) {
return isNegative ? '-' + value : value;
}
return value * (isNegative ? -1 : 1);
};
var configs = {};
configs.margin = {
margin: {
property: 'margin',
scale: 'space',
transform: getMargin,
defaultScale: defaults.space
},
marginTop: {
property: 'marginTop',
scale: 'space',
transform: getMargin,
defaultScale: defaults.space
},
marginRight: {
property: 'marginRight',
scale: 'space',
transform: getMargin,
defaultScale: defaults.space
},
marginBottom: {
property: 'marginBottom',
scale: 'space',
transform: getMargin,
defaultScale: defaults.space
},
marginLeft: {
property: 'marginLeft',
scale: 'space',
transform: getMargin,
defaultScale: defaults.space
},
marginX: {
properties: ['marginLeft', 'marginRight'],
scale: 'space',
transform: getMargin,
defaultScale: defaults.space
},
marginY: {
properties: ['marginTop', 'marginBottom'],
scale: 'space',
transform: getMargin,
defaultScale: defaults.space
}
};
configs.margin.m = configs.margin.margin;
configs.margin.mt = configs.margin.marginTop;
configs.margin.mr = configs.margin.marginRight;
configs.margin.mb = configs.margin.marginBottom;
configs.margin.ml = configs.margin.marginLeft;
configs.margin.mx = configs.margin.marginX;
configs.margin.my = configs.margin.marginY;
configs.padding = {
padding: {
property: 'padding',
scale: 'space',
defaultScale: defaults.space
},
paddingTop: {
property: 'paddingTop',
scale: 'space',
defaultScale: defaults.space
},
paddingRight: {
property: 'paddingRight',
scale: 'space',
defaultScale: defaults.space
},
paddingBottom: {
property: 'paddingBottom',
scale: 'space',
defaultScale: defaults.space
},
paddingLeft: {
property: 'paddingLeft',
scale: 'space',
defaultScale: defaults.space
},
paddingX: {
properties: ['paddingLeft', 'paddingRight'],
scale: 'space',
defaultScale: defaults.space
},
paddingY: {
properties: ['paddingTop', 'paddingBottom'],
scale: 'space',
defaultScale: defaults.space
}
};
configs.padding.p = configs.padding.padding;
configs.padding.pt = configs.padding.paddingTop;
configs.padding.pr = configs.padding.paddingRight;
configs.padding.pb = configs.padding.paddingBottom;
configs.padding.pl = configs.padding.paddingLeft;
configs.padding.px = configs.padding.paddingX;
configs.padding.py = configs.padding.paddingY;
export var margin = system(configs.margin);
export var padding = system(configs.padding);
export var space = compose(margin, padding);
export default space;
webpack://frontend-tpt/../../node_modules/@styled-system/shadow/dist/index.esm.js
import { system } from '@styled-system/core';
export var shadow = system({
boxShadow: {
property: 'boxShadow',
scale: 'shadows'
},
textShadow: {
property: 'textShadow',
scale: 'shadows'
}
});
export default shadow;
webpack://frontend-tpt/../../node_modules/@styled-system/css/dist/index.esm.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
// based on https://github.com/developit/dlv
export var get = function get(obj, key, def, p, undef) {
key = key && key.split ? key.split('.') : [key];
for (p = 0; p < key.length; p++) {
obj = obj ? obj[key[p]] : undef;
}
return obj === undef ? def : obj;
};
var defaultBreakpoints = [40, 52, 64].map(function (n) {
return n + 'em';
});
var defaultTheme = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72]
};
var aliases = {
bg: 'backgroundColor',
m: 'margin',
mt: 'marginTop',
mr: 'marginRight',
mb: 'marginBottom',
ml: 'marginLeft',
mx: 'marginX',
my: 'marginY',
p: 'padding',
pt: 'paddingTop',
pr: 'paddingRight',
pb: 'paddingBottom',
pl: 'paddingLeft',
px: 'paddingX',
py: 'paddingY'
};
var multiples = {
marginX: ['marginLeft', 'marginRight'],
marginY: ['marginTop', 'marginBottom'],
paddingX: ['paddingLeft', 'paddingRight'],
paddingY: ['paddingTop', 'paddingBottom'],
size: ['width', 'height']
};
var scales = {
color: 'colors',
backgroundColor: 'colors',
borderColor: 'colors',
margin: 'space',
marginTop: 'space',
marginRight: 'space',
marginBottom: 'space',
marginLeft: 'space',
marginX: 'space',
marginY: 'space',
padding: 'space',
paddingTop: 'space',
paddingRight: 'space',
paddingBottom: 'space',
paddingLeft: 'space',
paddingX: 'space',
paddingY: 'space',
top: 'space',
right: 'space',
bottom: 'space',
left: 'space',
gridGap: 'space',
gridColumnGap: 'space',
gridRowGap: 'space',
gap: 'space',
columnGap: 'space',
rowGap: 'space',
fontFamily: 'fonts',
fontSize: 'fontSizes',
fontWeight: 'fontWeights',
lineHeight: 'lineHeights',
letterSpacing: 'letterSpacings',
border: 'borders',
borderTop: 'borders',
borderRight: 'borders',
borderBottom: 'borders',
borderLeft: 'borders',
borderWidth: 'borderWidths',
borderStyle: 'borderStyles',
borderRadius: 'radii',
borderTopRightRadius: 'radii',
borderTopLeftRadius: 'radii',
borderBottomRightRadius: 'radii',
borderBottomLeftRadius: 'radii',
borderTopWidth: 'borderWidths',
borderTopColor: 'colors',
borderTopStyle: 'borderStyles',
borderBottomWidth: 'borderWidths',
borderBottomColor: 'colors',
borderBottomStyle: 'borderStyles',
borderLeftWidth: 'borderWidths',
borderLeftColor: 'colors',
borderLeftStyle: 'borderStyles',
borderRightWidth: 'borderWidths',
borderRightColor: 'colors',
borderRightStyle: 'borderStyles',
outlineColor: 'colors',
boxShadow: 'shadows',
textShadow: 'shadows',
zIndex: 'zIndices',
width: 'sizes',
minWidth: 'sizes',
maxWidth: 'sizes',
height: 'sizes',
minHeight: 'sizes',
maxHeight: 'sizes',
flexBasis: 'sizes',
size: 'sizes',
// svg
fill: 'colors',
stroke: 'colors'
};
var positiveOrNegative = function positiveOrNegative(scale, value) {
if (typeof value !== 'number' || value >= 0) {
return get(scale, value, value);
}
var absolute = Math.abs(value);
var n = get(scale, absolute, absolute);
if (typeof n === 'string') return '-' + n;
return n * -1;
};
var transforms = ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'top', 'bottom', 'left', 'right'].reduce(function (acc, curr) {
var _extends2;
return _extends({}, acc, (_extends2 = {}, _extends2[curr] = positiveOrNegative, _extends2));
}, {});
export var responsive = function responsive(styles) {
return function (theme) {
var next = {};
var breakpoints = get(theme, 'breakpoints', defaultBreakpoints);
var mediaQueries = [null].concat(breakpoints.map(function (n) {
return "@media screen and (min-width: " + n + ")";
}));
for (var key in styles) {
var value = typeof styles[key] === 'function' ? styles[key](theme) : styles[key];
if (value == null) continue;
if (!Array.isArray(value)) {
next[key] = value;
continue;
}
for (var i = 0; i < value.slice(0, mediaQueries.length).length; i++) {
var media = mediaQueries[i];
if (!media) {
next[key] = value[i];
continue;
}
next[media] = next[media] || {};
if (value[i] == null) continue;
next[media][key] = value[i];
}
}
return next;
};
};
export var css = function css(args) {
return function (props) {
if (props === void 0) {
props = {};
}
var theme = _extends({}, defaultTheme, {}, props.theme || props);
var result = {};
var obj = typeof args === 'function' ? args(theme) : args;
var styles = responsive(obj)(theme);
for (var key in styles) {
var x = styles[key];
var val = typeof x === 'function' ? x(theme) : x;
if (key === 'variant') {
var variant = css(get(theme, val))(theme);
result = _extends({}, result, {}, variant);
continue;
}
if (val && typeof val === 'object') {
result[key] = css(val)(theme);
continue;
}
var prop = get(aliases, key, key);
var scaleName = get(scales, prop);
var scale = get(theme, scaleName, get(theme, prop, {}));
var transform = get(transforms, prop, get);
var value = transform(scale, val, val);
if (multiples[prop]) {
var dirs = multiples[prop];
for (var i = 0; i < dirs.length; i++) {
result[dirs[i]] = value;
}
} else {
result[prop] = value;
}
}
return result;
};
};
export default css;
webpack://frontend-tpt/../../node_modules/@styled-system/variant/dist/index.esm.js
import { get, createParser } from '@styled-system/core';
import css from '@styled-system/css';
export var variant = function variant(_ref) {
var _config;
var scale = _ref.scale,
_ref$prop = _ref.prop,
prop = _ref$prop === void 0 ? 'variant' : _ref$prop,
_ref$variants = _ref.variants,
variants = _ref$variants === void 0 ? {} : _ref$variants,
key = _ref.key;
var sx;
if (Object.keys(variants).length) {
sx = function sx(value, scale, props) {
return css(get(scale, value, null))(props.theme);
};
} else {
sx = function sx(value, scale) {
return get(scale, value, null);
};
}
sx.scale = scale || key;
sx.defaults = variants;
var config = (_config = {}, _config[prop] = sx, _config);
var parser = createParser(config);
return parser;
};
export default variant;
export var buttonStyle = variant({
key: 'buttons'
});
export var textStyle = variant({
key: 'textStyles',
prop: 'textStyle'
});
export var colorStyle = variant({
key: 'colorStyles',
prop: 'colors'
});
webpack://frontend-tpt/../../node_modules/styled-system/dist/index.esm.js
import { createStyleFunction, createParser } from '@styled-system/core'; // v4 api shims
import layout from '@styled-system/layout';
import color from '@styled-system/color';
import typography from '@styled-system/typography';
import flexbox from '@styled-system/flexbox';
import grid from '@styled-system/grid';
import border from '@styled-system/border';
import background from '@styled-system/background';
import position from '@styled-system/position';
export { get, createParser, createStyleFunction, compose, system } from '@styled-system/core';
export { margin, padding, space } from '@styled-system/space';
export { color } from '@styled-system/color';
export { layout } from '@styled-system/layout';
export { typography } from '@styled-system/typography';
export { flexbox } from '@styled-system/flexbox';
export { border } from '@styled-system/border';
export { background } from '@styled-system/background';
export { position } from '@styled-system/position';
export { grid } from '@styled-system/grid';
export { shadow } from '@styled-system/shadow';
export { default as boxShadow, default as textShadow } from '@styled-system/shadow';
export { variant, buttonStyle, textStyle, colorStyle } from '@styled-system/variant';
var width = layout.width,
height = layout.height,
minWidth = layout.minWidth,
minHeight = layout.minHeight,
maxWidth = layout.maxWidth,
maxHeight = layout.maxHeight,
size = layout.size,
verticalAlign = layout.verticalAlign,
display = layout.display,
overflow = layout.overflow,
overflowX = layout.overflowX,
overflowY = layout.overflowY;
var opacity = color.opacity;
var fontSize = typography.fontSize,
fontFamily = typography.fontFamily,
fontWeight = typography.fontWeight,
lineHeight = typography.lineHeight,
textAlign = typography.textAlign,
fontStyle = typography.fontStyle,
letterSpacing = typography.letterSpacing;
var alignItems = flexbox.alignItems,
alignContent = flexbox.alignContent,
justifyItems = flexbox.justifyItems,
justifyContent = flexbox.justifyContent,
flexWrap = flexbox.flexWrap,
flexDirection = flexbox.flexDirection,
flex = flexbox.flex,
flexGrow = flexbox.flexGrow,
flexShrink = flexbox.flexShrink,
flexBasis = flexbox.flexBasis,
justifySelf = flexbox.justifySelf,
alignSelf = flexbox.alignSelf,
order = flexbox.order;
var gridGap = grid.gridGap,
gridColumnGap = grid.gridColumnGap,
gridRowGap = grid.gridRowGap,
gridColumn = grid.gridColumn,
gridRow = grid.gridRow,
gridAutoFlow = grid.gridAutoFlow,
gridAutoColumns = grid.gridAutoColumns,
gridAutoRows = grid.gridAutoRows,
gridTemplateColumns = grid.gridTemplateColumns,
gridTemplateRows = grid.gridTemplateRows,
gridTemplateAreas = grid.gridTemplateAreas,
gridArea = grid.gridArea;
var borderWidth = border.borderWidth,
borderStyle = border.borderStyle,
borderColor = border.borderColor,
borderTop = border.borderTop,
borderRight = border.borderRight,
borderBottom = border.borderBottom,
borderLeft = border.borderLeft,
borderRadius = border.borderRadius;
var backgroundImage = background.backgroundImage,
backgroundSize = background.backgroundSize,
backgroundPosition = background.backgroundPosition,
backgroundRepeat = background.backgroundRepeat;
var zIndex = position.zIndex,
top = position.top,
right = position.right,
bottom = position.bottom,
left = position.left;
export { default as borders } from '@styled-system/border';
export { width, height, minWidth, minHeight, maxWidth, maxHeight, size, verticalAlign, display, overflow, overflowX, overflowY // color
, opacity // typography
, fontSize, fontFamily, fontWeight, lineHeight, textAlign, fontStyle, letterSpacing // flexbox
, alignItems, alignContent, justifyItems, justifyContent, flexWrap, flexDirection, flex, flexGrow, flexShrink, flexBasis, justifySelf, alignSelf, order // grid
, gridGap, gridColumnGap, gridRowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea // border
, borderWidth, borderStyle, borderColor, borderTop, borderRight, borderBottom, borderLeft, borderRadius // background
, backgroundImage, backgroundSize, backgroundPosition, backgroundRepeat // position
, zIndex, top, right, bottom, left }; // v4 style API shim
export var style = function style(_ref) {
var prop = _ref.prop,
cssProperty = _ref.cssProperty,
alias = _ref.alias,
key = _ref.key,
transformValue = _ref.transformValue,
scale = _ref.scale,
properties = _ref.properties;
var config = {};
config[prop] = createStyleFunction({
properties: properties,
property: cssProperty || prop,
scale: key,
defaultScale: scale,
transform: transformValue
});
if (alias) config[alias] = config[prop];
var parse = createParser(config);
return parse;
};
webpack://frontend-tpt/../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
import * as ReactJSXRuntime from 'react/jsx-runtime';
import { h as hasOwnProperty, E as Emotion, c as createEmotionProps } from '../../dist/emotion-element-c39617d8.browser.esm.js';
import 'react';
import '@emotion/cache';
import '@babel/runtime/helpers/extends';
import '@emotion/weak-memoize';
import '../../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';
import 'hoist-non-react-statics';
import '@emotion/utils';
import '@emotion/serialize';
import '@emotion/use-insertion-effect-with-fallbacks';
var Fragment = ReactJSXRuntime.Fragment;
function jsx(type, props, key) {
if (!hasOwnProperty.call(props, 'css')) {
return ReactJSXRuntime.jsx(type, props, key);
}
return ReactJSXRuntime.jsx(Emotion, createEmotionProps(type, props), key);
}
function jsxs(type, props, key) {
if (!hasOwnProperty.call(props, 'css')) {
return ReactJSXRuntime.jsxs(type, props, key);
}
return ReactJSXRuntime.jsxs(Emotion, createEmotionProps(type, props), key);
}
export { Fragment, jsx, jsxs };
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/casino-dark-extensions.js
export const colors = {
contentOnDarkSubtle: "#ffffffb3",
componentDailyJackpotDefaultBackground: "rgba(28,29,29,0.85)",
componentDailyJackpotDefaultContent: "#ffffff",
componentDailyJackpotUrgentContent: "#ffffff",
componentDailyJackpotUrgentBackground: "rgba(97,1,155,0.85)",
componentDailyJackpotUrgentPulseContent: "#ffffff",
componentDailyJackpotUrgentPulseBackground: "rgba(0,78,163,0.85)",
componentDailyJackpotJustWonContent: "#ffffff",
componentDailyJackpotJustWonBackground: "rgba(28,29,29,0.85)",
componentGameLabelNewContent: "#ffffff",
componentGameLabelNewBackground: "#D22839",
componentGameLabelNewBorder: "#EA6875",
componentGameLabelExclusiveContent: "#ffffff",
componentGameLabelExclusiveBackground: "#7401B7",
componentGameLabelExclusiveBorder: "#A530F3",
componentGameLabelJackpotContent: "#ffffff",
componentGameLabelJackpotBackground: "#0070EB",
componentGameLabelJackpotBorder: "#64AEFF",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/casino-dark.js
export const colors = {
brandGradientDefault: "linear-gradient(125deg, #61019B 0%, #005FC8 100%)",
brandGradientColorStopsStart: "#61019B",
brandGradientColorStopsEnd: "#005FC8",
};
export const text = {
themeName: "Casino Dark",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/casino.js
export const colors = {
brandGradientDefault: "linear-gradient(125deg, #61019B 0%, #005FC8 100%)",
brandGradientColorStopsStart: "#61019B",
brandGradientColorStopsEnd: "#005FC8",
backgroundBase: "#ffffff",
backgroundSecondary: "#0a0a0a",
};
export const text = {
themeName: "Casino Light",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/faceoff-dark.js
export const colors = {
brandSecondaryDefault: "#75EBD2",
brandSecondaryTint: "#D4FAF2",
brandSecondaryShade: "#004435",
brandGradientDefault: "linear-gradient(125deg, #00E5B4 0%, #0070EB 100%)",
brandGradientColorStopsStart: "#00E5B4",
brandGradientColorStopsEnd: "#0070EB",
contentBrandSecondary: "#D4FAF2",
};
export const text = {
themeName: "FaceOff Dark",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/faceoff.js
export const colors = {
brandSecondaryDefault: "#75EBD2",
brandSecondaryTint: "#D4FAF2",
brandSecondaryShade: "#004435",
brandGradientDefault: "linear-gradient(125deg, #00E5B4 0%, #0070EB 100%)",
brandGradientColorStopsStart: "#00E5B4",
brandGradientColorStopsEnd: "#0070EB",
contentBrandSecondary: "#75EBD2",
};
export const text = {
themeName: "FaceOff Light",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/fanduel-dark.js
export const colors = {
brandPrimaryDefault: "#2B90FF",
brandPrimaryTint: "#99CAFF",
brandPrimaryShade: "#003D81",
contentStrong: "#ffffff",
contentDefault: "#CED4DB",
contentSubtle: "#969DA3",
contentDisabled: "#ffffff33",
contentOnLight: "#011638",
contentBrandPrimary: "#2B90FF",
contentBrandSecondary: "#C6D3E1",
contentLoadingDefault: "#ffffff0d",
contentLoadingInverse: "#0a0a0a0d",
contentLink: "#64AEFF",
contentLinkActive: "#0070EB",
backgroundBase: "#0a0a0a",
backgroundSurface: "#1C1D1D",
backgroundLayer: "#2B2D2E",
backgroundAccent: "#ffffff0d",
backgroundHover: "#3C3E40",
backgroundDisabled: "#3C3E40",
backgroundTransparent: "#0a0a0a00",
backgroundSecondary: "#0a0a0a",
backgroundBrand: "#2B90FF",
backgroundGradientSurfaceFadeEnd: "linear-gradient(90deg, #0a0a0a00 0%, #1C1D1D 100%)",
backgroundGradientSurfaceFadeBottom: "linear-gradient(180deg, #0a0a0a00 0%, #1C1D1D 100%)",
backgroundGradientColorStopsStart: "#0a0a0a00",
backgroundGradientColorStopsEnd: "#1C1D1D",
borderDefault: "#6A6F73",
borderSubtle: "#4D5153",
borderActive: "#64AEFF",
borderDisabled: "#ffffff1a",
borderInverse: "#EAF0F6",
borderBrand: "#2B90FF",
linkDefaultBase: "#64AEFF",
linkDefaultHover: "#0070EB",
linkDestructiveBase: "#EA6875",
linkDestructiveHover: "#D22839",
systemInfoBackgroundDefault: "#004EA3",
systemInfoBackgroundSubtle: "#002650",
systemInfoBorderDefault: "#004EA3",
systemInfoContentOnSubtle: "#ffffff",
systemInfoContentAccent: "#99CAFF",
systemInfoLinkOnSubtle: "#ffffff",
systemPositiveBackgroundDefault: "#005D23",
systemPositiveBackgroundSubtle: "#002E11",
systemPositiveBorderDefault: "#005D23",
systemPositiveContentOnSubtle: "#ffffff",
systemPositiveContentAccent: "#7FD9A1",
systemPositiveLinkOnSubtle: "#ffffff",
systemAlertBackgroundDefault: "#756100",
systemAlertBackgroundSubtle: "#4B3F00",
systemAlertBorderDefault: "#756100",
systemAlertContentOnDefault: "#ffffff",
systemAlertContentOnSubtle: "#ffffff",
systemAlertContentAccent: "#FFDC2E",
systemAlertLinkOnDefault: "#ffffff",
systemAlertLinkOnSubtle: "#ffffff",
systemWarningBackgroundDefault: "#A44800",
systemWarningBackgroundSubtle: "#692E00",
systemWarningBorderDefault: "#A44800",
systemWarningContentOnDefault: "#ffffff",
systemWarningContentOnSubtle: "#ffffff",
systemWarningContentAccent: "#FFB77E",
systemWarningLinkOnDefault: "#ffffff",
systemWarningLinkOnSubtle: "#ffffff",
systemImportantBackgroundDefault: "#A40023",
systemImportantBackgroundSubtle: "#40020D",
systemImportantBorderDefault: "#A40023",
systemImportantContentOnSubtle: "#ffffff",
systemImportantContentAccent: "#F198A1",
systemImportantLinkOnSubtle: "#ffffff",
systemNeutralBackgroundDefault: "#6A6F73",
systemNeutralBackgroundSubtle: "#2B2D2E",
systemNeutralBorderDefault: "#6A6F73",
systemNeutralContentOnDefault: "#ffffff",
systemNeutralContentOnSubtle: "#ffffff",
systemNeutralContentAccent: "#CED4DB",
systemNeutralLinkOnDefault: "#ffffff",
systemNeutralLinkOnSubtle: "#ffffff",
systemVerificationBackgroundDefault: "#61019B",
systemVerificationBackgroundSubtle: "#36005B",
systemVerificationBorderDefault: "#61019B",
systemVerificationContentOnSubtle: "#ffffff",
systemVerificationContentAccent: "#D4B6FE",
systemVerificationLinkOnSubtle: "#ffffff",
componentButtonPrimaryContentDisabled: "#ffffff33",
componentButtonPrimaryBackgroundDisabled: "#3C3E40",
componentButtonPrimaryBorderDisabled: "#ffffff1a",
componentButtonSecondaryContentDisabled: "#ffffff33",
componentButtonSecondaryBackgroundDisabled: "#3C3E40",
componentButtonSecondaryBorderDisabled: "#ffffff1a",
componentButtonTertiaryContentBase: "#64AEFF",
componentButtonTertiaryContentHover: "#2B90FF",
componentButtonTertiaryContentDisabled: "#ffffff33",
componentButtonTertiaryBackgroundBase: "#0a0a0a00",
componentButtonTertiaryBackgroundHover: "#002650",
componentButtonTertiaryBackgroundActive: "#005FC8",
componentButtonTertiaryBackgroundDisabled: "#0a0a0a00",
componentButtonTertiaryBorderBase: "#64AEFF",
componentButtonTertiaryBorderHover: "#2B90FF",
componentButtonTertiaryBorderActive: "#005FC8",
componentButtonTertiaryBorderDisabled: "#ffffff1a",
componentButtonTransparentContentDisabled: "#ffffff33",
componentButtonTransparentBackgroundBase: "#0a0a0a00",
componentButtonTransparentBackgroundActive: "#005FC8",
componentButtonTransparentBackgroundDisabled: "#0a0a0a00",
componentButtonTransparentBorderActive: "#0a0a0a00",
componentButtonTransparentBorderDisabled: "#ffffff1a",
componentButtonDestructiveContentDisabled: "#ffffff33",
componentButtonDestructiveBackgroundHover: "#A40023",
componentButtonDestructiveBackgroundActive: "#83001C",
componentButtonDestructiveBackgroundDisabled: "#3C3E40",
componentButtonDestructiveBorderHover: "#A40023",
componentButtonDestructiveBorderActive: "#83001C",
componentButtonDestructiveBorderDisabled: "#ffffff1a",
componentButtonButtonLinkContentBase: "#64AEFF",
componentButtonButtonLinkContentHover: "#0070EB",
componentButtonButtonLinkContentDisabled: "#3C3E40",
componentButtonButtonLinkBackgroundBase: "#0a0a0a00",
componentButtonButtonLinkBackgroundHover: "#002650",
componentButtonButtonLinkBackgroundDisabled: "#0a0a0a00",
componentButtonButtonLinkBorderBase: "#0a0a0a00",
componentButtonButtonLinkBorderHover: "#0a0a0a00",
componentButtonButtonLinkBorderActive: "#0a0a0a00",
componentButtonButtonLinkBorderDisabled: "#ffffff1a",
componentSelectionControlBackgroundBase: "#1C1D1D",
componentSelectionControlBackgroundHover: "#002650",
componentSelectionControlBackgroundActive: "#2B90FF",
componentSelectionControlBackgroundSelected: "#64AEFF",
componentSelectionControlBackgroundSelectedHover: "#99CAFF",
componentSelectionControlBackgroundSelectedActive: "#99CAFF",
componentSelectionControlBackgroundUnselected: "#4D5153",
componentSelectionControlBackgroundDisabled: "#3C3E40",
componentSelectionControlBackgroundSuccess: "#31C268",
componentSelectionControlBackgroundError: "#EA6875",
componentSelectionControlBorderBase: "#6A6F73",
componentSelectionControlBorderHover: "#64AEFF",
componentSelectionControlBorderActive: "#64AEFF",
componentSelectionControlBorderSelected: "#64AEFF",
componentSelectionControlBorderSelectedHover: "#99CAFF",
componentSelectionControlBorderSelectedActive: "#99CAFF",
componentSelectionControlBorderUnselected: "#4D5153",
componentSelectionControlBorderDisabled: "#ffffff1a",
componentSelectionControlBorderSuccess: "#1BB152",
componentSelectionControlBorderError: "#EB4758",
componentSelectionControlForegroundBase: "#0a0a0a00",
componentSelectionControlForegroundHover: "#0a0a0a00",
componentSelectionControlForegroundActive: "#0a0a0a00",
componentSelectionControlForegroundSelected: "#011638",
componentSelectionControlForegroundSelectedHover: "#011638",
componentSelectionControlForegroundSelectedActive: "#011638",
componentSelectionControlForegroundUnselected: "#0a0a0a00",
componentSelectionControlForegroundDisabled: "#ffffff33",
componentSelectionControlForegroundSuccess: "#011638",
componentSelectionControlForegroundError: "#011638",
componentDataInputBackgroundBase: "#1C1D1D",
componentDataInputBackgroundLayer: "#2B2D2E",
componentDataInputBackgroundHover: "#3C3E40",
componentDataInputBackgroundError: "#40020D",
componentDataInputBackgroundDisabled: "#3C3E40",
componentDataInputBorderBase: "#6A6F73",
componentDataInputBorderActive: "#004EA3",
componentDataInputBorderError: "#A40023",
componentDataInputBorderDisabled: "#ffffff1a",
componentDataInputContentBase: "#CED4DB",
componentDataInputContentSubtle: "#969DA3",
componentDataInputContentHover: "#99CAFF",
componentDataInputContentError: "#F198A1",
componentDataInputContentDisabled: "#ffffff33",
componentDataInputLabelBase: "#ffffff",
componentDataInputLabelActive: "#99CAFF",
componentDataInputLabelError: "#F198A1",
componentDataInputLabelDisabled: "#ffffff33",
componentDataInputPasswordMeterEmpty: "#6A6F73",
componentDataInputPasswordMeterWeak: "#A40023",
componentDataInputPasswordMeterFair: "#A44800",
componentDataInputPasswordMeterGood: "#004EA3",
componentDataInputPasswordMeterGreat: "#005D23",
componentDataInputIconBase: "#969DA3",
componentDataInputIconActive: "#99CAFF",
componentDataInputIconError: "#F198A1",
componentDataInputIconDisabled: "#ffffff33",
componentPillPrimaryContentBase: "#ffffff",
componentPillPrimaryContentHover: "#ffffff",
componentPillPrimaryContentSelected: "#011638",
componentPillPrimaryContentActive: "#011638",
componentPillPrimaryContentDisabled: "#0a0a0a",
componentPillPrimaryBackgroundBase: "#ffffff1a",
componentPillPrimaryBackgroundHover: "#ffffff4d",
componentPillPrimaryBackgroundSelected: "#64AEFF",
componentPillPrimaryBackgroundActive: "#2B90FF",
componentPillPrimaryBackgroundDisabled: "#2B2D2E",
componentPillInverseContentHover: "#ffffff",
componentPillInverseContentSelected: "#011638",
componentPillInverseContentActive: "#011638",
componentPillInverseContentDisabled: "#0a0a0a",
componentPillInverseBackgroundBase: "#0a0a0a00",
componentPillInverseBackgroundHover: "#ffffff4d",
componentPillInverseBackgroundSelected: "#64AEFF",
componentPillInverseBackgroundActive: "#2B90FF",
componentPillInverseBackgroundDisabled: "#2B2D2E",
};
export const text = {
themeName: "Fanduel Dark",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/fanduel.js
export const breakpoints = {
mobile: 375,
tabletPortrait: 640,
tabletLandscape: 960,
desktop: 1024,
};
export const transitions = {
standard: "all 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
deceleration: "all 250ms cubic-bezier(0, 0, 0.2, 1) 0ms",
acceleration: "all 250ms cubic-bezier(0.4, 0, 1, 1) 0ms",
};
export const zIndices = {
none: 0,
low: 1,
mid: 2,
high: 3,
};
export const colors = {
coreGreenL5: "#E9F8EF",
coreGreenL4: "#BCEBCE",
coreGreenL3: "#7FD9A1",
coreGreenL2: "#31C268",
coreGreenL1: "#1BB152",
coreGreen: "#128000",
coreGreenD1: "#00732C",
coreGreenD2: "#005D23",
coreGreenD3: "#00491C",
coreGreenD4: "#002E11",
coreBlueL5: "#EAF4FF",
coreBlueL4: "#C8E2FF",
coreBlueL3: "#99CAFF",
coreBlueL2: "#64AEFF",
coreBlueL1: "#2B90FF",
coreBlue: "#0070EB",
coreBlueD1: "#005FC8",
coreBlueD2: "#004EA3",
coreBlueD3: "#003D81",
coreBlueD4: "#002650",
coreNavyL5: "#EBF2FA",
coreNavyL4: "#C6D3E1",
coreNavyL3: "#9CB1CB",
coreNavyL2: "#819CBB",
coreNavyL1: "#6682A2",
coreNavy: "#184C8B",
coreNavyD1: "#14417A",
coreNavyD2: "#103469",
coreNavyD3: "#05285A",
coreNavyD4: "#011638",
coreRedL5: "#FDECED",
coreRedL4: "#F9C9CE",
coreRedL3: "#F198A1",
coreRedL2: "#EA6875",
coreRedL1: "#EB4758",
coreRed: "#D22839",
coreRedD1: "#C8002B",
coreRedD2: "#A40023",
coreRedD3: "#83001C",
coreRedD4: "#40020D",
coreOrangeL5: "#FFF1E6",
coreOrangeL4: "#FFD8B9",
coreOrangeL3: "#FFB77E",
coreOrangeL2: "#FF8C31",
coreOrangeL1: "#F87A1E",
coreOrange: "#C15400",
coreOrangeD1: "#A44800",
coreOrangeD2: "#843B00",
coreOrangeD3: "#692E00",
coreOrangeD4: "#401D00",
coreYellowL5: "#FFF6BD",
coreYellowL4: "#FFDC2E",
coreYellowL3: "#EAC300",
coreYellowL2: "#C9A800",
coreYellowL1: "#A98E00",
coreYellow: "#8A7000",
coreYellowD1: "#756100",
coreYellowD2: "#5F4F00",
coreYellowD3: "#4B3F00",
coreYellowD4: "#2E2600",
corePurpleL5: "#F6F1FE",
corePurpleL4: "#E6D6FE",
corePurpleL3: "#D4B6FE",
corePurpleL2: "#C18FFE",
corePurpleL1: "#B265FE",
corePurple: "#A530F3",
corePurpleD1: "#8F02E1",
corePurpleD2: "#7401B7",
corePurpleD3: "#61019B",
corePurpleD4: "#36005B",
coreTealL5: "#D4FAF2",
coreTealL4: "#9CF7E4",
coreTealL3: "#75EBD2",
coreTealL2: "#00E5B4",
coreTealL1: "#00C898",
coreTeal: "#008568",
coreTealD1: "#00735A",
coreTealD2: "#005F48",
coreTealD3: "#004435",
coreTealD4: "#003328",
coreWhite: "#ffffff",
coreGreyL5: "#F7FBFF",
coreGreyL4: "#EAF0F6",
coreGreyL3: "#CED4DB",
coreGreyL2: "#B0B7BF",
coreGreyL1: "#969DA3",
coreGrey: "#6A6F73",
coreGreyD1: "#4D5153",
coreGreyD2: "#3C3E40",
coreGreyD3: "#2B2D2E",
coreGreyD4: "#1C1D1D",
coreBlack: "#0a0a0a",
coreBlackTint005: "#0a0a0a0d",
coreBlackTint010: "#0a0a0a1a",
coreBlackTint020: "#0a0a0a33",
coreBlackTint030: "#0a0a0a4d",
coreBlackTint040: "#0a0a0a66",
coreBlackTint050: "#0a0a0a80",
coreBlackTint060: "#0a0a0a99",
coreBlackTint070: "#0a0a0ab3",
coreBlackTint080: "#0a0a0acc",
coreBlackTint090: "#0a0a0ae6",
coreWhiteTint005: "#ffffff0d",
coreWhiteTint010: "#ffffff1a",
coreWhiteTint020: "#ffffff33",
coreWhiteTint030: "#ffffff4d",
coreWhiteTint040: "#ffffff66",
coreWhiteTint050: "#ffffff80",
coreWhiteTint060: "#ffffff99",
coreWhiteTint070: "#ffffffb3",
coreWhiteTint080: "#ffffffcc",
coreWhiteTint090: "#ffffffe6",
coreTransparentWhite: "#ffffff00",
coreTransparentBlack: "#0a0a0a00",
productGradientsSports: "linear-gradient(125deg, #005FC8 0%, #003D81 100%)",
productGradientsCasino: "linear-gradient(125deg, #61019B 0%, #005FC8 100%)",
productGradientsFaceoff: "linear-gradient(125deg, #00E5B4 0%, #0070EB 100%)",
brandPrimaryDefault: "#0070EB",
brandPrimaryTint: "#C8E2FF",
brandPrimaryShade: "#004EA3",
brandSecondaryDefault: "#184C8B",
brandSecondaryTint: "#C6D3E1",
brandSecondaryShade: "#011638",
brandTertiaryDefault: "#FFDC2E",
brandTertiaryTint: "#FFF8D9",
brandTertiaryShade: "#D78027",
brandGradientDefault: "linear-gradient(125deg, #005FC8 0%, #003D81 100%)",
brandGradientColorStopsStart: "#005FC8",
brandGradientColorStopsEnd: "#003D81",
productColorsPrimaryL5: "#EAF4FF",
productColorsPrimaryL4: "#C8E2FF",
productColorsPrimaryL3: "#99CAFF",
productColorsPrimaryL2: "#64AEFF",
productColorsPrimaryL1: "#2B90FF",
productColorsPrimary: "#0070EB",
productColorsPrimaryD1: "#005FC8",
productColorsPrimaryD2: "#004EA3",
productColorsPrimaryD3: "#003D81",
productColorsPrimaryD4: "#002650",
productColorsSecondaryL5: "#EBF2FA",
productColorsSecondaryL4: "#C6D3E1",
productColorsSecondaryL3: "#9CB1CB",
productColorsSecondaryL2: "#819CBB",
productColorsSecondaryL1: "#6682A2",
productColorsSecondary: "#184C8B",
productColorsSecondaryD1: "#14417A",
productColorsSecondaryD2: "#103469",
productColorsSecondaryD3: "#05285A",
productColorsSecondaryD4: "#011638",
productColorsTertiaryL5: "#FFFBEC",
productColorsTertiaryL4: "#FFF8D9",
productColorsTertiaryL3: "#FFF4C6",
productColorsTertiaryL2: "#FFF1B3",
productColorsTertiaryL1: "#FFEDA0",
productColorsTertiary: "#FFDC2E",
productColorsTertiaryD1: "#F8C429",
productColorsTertiaryD2: "#EFAC27",
productColorsTertiaryD3: "#E49627",
productColorsTertiaryD4: "#D78027",
contentStrong: "#05285A",
contentDefault: "#1C1D1D",
contentSubtle: "#6A6F73",
contentDisabled: "#0a0a0a33",
contentOnLight: "#05285A",
contentOnDark: "#ffffff",
contentBrandPrimary: "#0070EB",
contentBrandSecondary: "#184C8B",
contentLoadingDefault: "#0a0a0a0d",
contentLoadingInverse: "#ffffff1a",
contentLink: "#0070EB",
contentLinkActive: "#004EA3",
backgroundBase: "#EAF0F6",
backgroundSurface: "#ffffff",
backgroundLayer: "#F7FBFF",
backgroundAccent: "#0a0a0a0d",
backgroundHover: "#EAF4FF",
backgroundActive: "#0070EB",
backgroundDisabled: "#EAF0F6",
backgroundTransparent: "#ffffff00",
backgroundPrimary: "#0070EB",
backgroundSecondary: "#184C8B",
backgroundPromotional: "#011638",
backgroundBrand: "#0070EB",
backgroundGradientSurfaceFadeEnd: "linear-gradient(90deg, #ffffff00 0%, #ffffff 100%)",
backgroundGradientSurfaceFadeBottom: "linear-gradient(180deg, #ffffff00 0%, #ffffff 100%)",
backgroundGradientColorStopsStart: "#ffffff00",
backgroundGradientColorStopsEnd: "#ffffff",
borderDefault: "#B0B7BF",
borderSubtle: "#C6D3E1",
borderActive: "#0070EB",
borderDisabled: "#0a0a0a1a",
borderInverse: "#ffffff",
borderBrand: "#0070EB",
linkDefaultBase: "#0070EB",
linkDefaultHover: "#004EA3",
linkDestructiveBase: "#D22839",
linkDestructiveHover: "#A40023",
linkInverseDefaultBase: "#ffffff",
linkInverseDefaultHover: "#C8E2FF",
linkInverseDestructiveBase: "#EA6875",
linkInverseDestructiveHover: "#D22839",
systemInfoBackgroundDefault: "#005FC8",
systemInfoBackgroundSubtle: "#EAF4FF",
systemInfoBorderDefault: "#005FC8",
systemInfoContentOnDefault: "#ffffff",
systemInfoContentOnSubtle: "#05285A",
systemInfoContentAccent: "#004EA3",
systemInfoLinkOnDefault: "#ffffff",
systemInfoLinkOnSubtle: "#0070EB",
systemPositiveBackgroundDefault: "#128000",
systemPositiveBackgroundSubtle: "#E9F8EF",
systemPositiveBorderDefault: "#128000",
systemPositiveContentOnDefault: "#ffffff",
systemPositiveContentOnSubtle: "#05285A",
systemPositiveContentAccent: "#00732C",
systemPositiveLinkOnDefault: "#ffffff",
systemPositiveLinkOnSubtle: "#0070EB",
systemAlertBackgroundDefault: "#FFDC2E",
systemAlertBackgroundSubtle: "#FFF6BD",
systemAlertBorderDefault: "#FFDC2E",
systemAlertContentOnDefault: "#05285A",
systemAlertContentOnSubtle: "#05285A",
systemAlertContentAccent: "#756100",
systemAlertLinkOnDefault: "#05285A",
systemAlertLinkOnSubtle: "#0070EB",
systemWarningBackgroundDefault: "#FF8C31",
systemWarningBackgroundSubtle: "#FFF1E6",
systemWarningBorderDefault: "#FF8C31",
systemWarningContentOnDefault: "#05285A",
systemWarningContentOnSubtle: "#05285A",
systemWarningContentAccent: "#A44800",
systemWarningLinkOnDefault: "#05285A",
systemWarningLinkOnSubtle: "#0070EB",
systemImportantBackgroundDefault: "#D22839",
systemImportantBackgroundSubtle: "#FDECED",
systemImportantBorderDefault: "#D22839",
systemImportantContentOnDefault: "#ffffff",
systemImportantContentOnSubtle: "#05285A",
systemImportantContentAccent: "#C8002B",
systemImportantLinkOnDefault: "#ffffff",
systemImportantLinkOnSubtle: "#0070EB",
systemNeutralBackgroundDefault: "#B0B7BF",
systemNeutralBackgroundSubtle: "#EAF0F6",
systemNeutralBorderDefault: "#B0B7BF",
systemNeutralContentOnDefault: "#05285A",
systemNeutralContentOnSubtle: "#05285A",
systemNeutralContentAccent: "#6A6F73",
systemNeutralLinkOnDefault: "#05285A",
systemNeutralLinkOnSubtle: "#0070EB",
systemVerificationBackgroundDefault: "#8F02E1",
systemVerificationBackgroundSubtle: "#F6F1FE",
systemVerificationBorderDefault: "#8F02E1",
systemVerificationContentOnDefault: "#ffffff",
systemVerificationContentOnSubtle: "#05285A",
systemVerificationContentAccent: "#7401B7",
systemVerificationLinkOnDefault: "#ffffff",
systemVerificationLinkOnSubtle: "#0070EB",
componentButtonPrimaryContentBase: "#ffffff",
componentButtonPrimaryContentHover: "#ffffff",
componentButtonPrimaryContentActive: "#ffffff",
componentButtonPrimaryContentDisabled: "#0a0a0a33",
componentButtonPrimaryBackgroundBase: "#128000",
componentButtonPrimaryBackgroundHover: "#00732C",
componentButtonPrimaryBackgroundActive: "#005D23",
componentButtonPrimaryBackgroundDisabled: "#EAF0F6",
componentButtonPrimaryBorderBase: "#128000",
componentButtonPrimaryBorderHover: "#00732C",
componentButtonPrimaryBorderActive: "#005D23",
componentButtonPrimaryBorderDisabled: "#0a0a0a1a",
componentButtonSecondaryContentBase: "#ffffff",
componentButtonSecondaryContentHover: "#ffffff",
componentButtonSecondaryContentActive: "#ffffff",
componentButtonSecondaryContentDisabled: "#0a0a0a33",
componentButtonSecondaryBackgroundBase: "#0070EB",
componentButtonSecondaryBackgroundHover: "#005FC8",
componentButtonSecondaryBackgroundActive: "#004EA3",
componentButtonSecondaryBackgroundDisabled: "#EAF0F6",
componentButtonSecondaryBorderBase: "#0070EB",
componentButtonSecondaryBorderHover: "#005FC8",
componentButtonSecondaryBorderActive: "#004EA3",
componentButtonSecondaryBorderDisabled: "#0a0a0a1a",
componentButtonTertiaryContentBase: "#0070EB",
componentButtonTertiaryContentHover: "#0070EB",
componentButtonTertiaryContentActive: "#ffffff",
componentButtonTertiaryContentDisabled: "#0a0a0a33",
componentButtonTertiaryBackgroundBase: "#ffffff00",
componentButtonTertiaryBackgroundHover: "#EAF4FF",
componentButtonTertiaryBackgroundActive: "#0070EB",
componentButtonTertiaryBackgroundDisabled: "#ffffff00",
componentButtonTertiaryBorderBase: "#0070EB",
componentButtonTertiaryBorderHover: "#0070EB",
componentButtonTertiaryBorderActive: "#0070EB",
componentButtonTertiaryBorderDisabled: "#0a0a0a1a",
componentButtonTransparentContentBase: "#ffffff",
componentButtonTransparentContentHover: "#ffffff",
componentButtonTransparentContentActive: "#ffffff",
componentButtonTransparentContentDisabled: "#ffffff33",
componentButtonTransparentBackgroundBase: "#ffffff00",
componentButtonTransparentBackgroundHover: "#ffffff1a",
componentButtonTransparentBackgroundActive: "#0070EB",
componentButtonTransparentBackgroundDisabled: "#ffffff00",
componentButtonTransparentBorderBase: "#ffffff",
componentButtonTransparentBorderHover: "#ffffff",
componentButtonTransparentBorderActive: "#ffffff00",
componentButtonTransparentBorderDisabled: "#ffffff33",
componentButtonDestructiveContentBase: "#ffffff",
componentButtonDestructiveContentHover: "#ffffff",
componentButtonDestructiveContentActive: "#ffffff",
componentButtonDestructiveContentDisabled: "#0a0a0a33",
componentButtonDestructiveBackgroundBase: "#D22839",
componentButtonDestructiveBackgroundHover: "#C8002B",
componentButtonDestructiveBackgroundActive: "#A40023",
componentButtonDestructiveBackgroundDisabled: "#EAF0F6",
componentButtonDestructiveBorderBase: "#D22839",
componentButtonDestructiveBorderHover: "#C8002B",
componentButtonDestructiveBorderActive: "#A40023",
componentButtonDestructiveBorderDisabled: "#0a0a0a1a",
componentButtonButtonLinkContentBase: "#0070EB",
componentButtonButtonLinkContentHover: "#004EA3",
componentButtonButtonLinkContentActive: "#ffffff",
componentButtonButtonLinkContentDisabled: "#0a0a0a33",
componentButtonButtonLinkBackgroundBase: "#ffffff00",
componentButtonButtonLinkBackgroundHover: "#EAF4FF",
componentButtonButtonLinkBackgroundActive: "#005FC8",
componentButtonButtonLinkBackgroundDisabled: "#ffffff00",
componentButtonButtonLinkBorderBase: "#ffffff00",
componentButtonButtonLinkBorderHover: "#ffffff00",
componentButtonButtonLinkBorderActive: "#ffffff00",
componentButtonButtonLinkBorderDisabled: "#0a0a0a1a",
componentSelectionControlBackgroundBase: "#ffffff",
componentSelectionControlBackgroundHover: "#EAF4FF",
componentSelectionControlBackgroundActive: "#0070EB",
componentSelectionControlBackgroundSelected: "#005FC8",
componentSelectionControlBackgroundSelectedHover: "#004EA3",
componentSelectionControlBackgroundSelectedActive: "#004EA3",
componentSelectionControlBackgroundUnselected: "#CED4DB",
componentSelectionControlBackgroundDisabled: "#EAF0F6",
componentSelectionControlBackgroundSuccess: "#128000",
componentSelectionControlBackgroundError: "#D22839",
componentSelectionControlBorderBase: "#B0B7BF",
componentSelectionControlBorderHover: "#0070EB",
componentSelectionControlBorderActive: "#0070EB",
componentSelectionControlBorderSelected: "#005FC8",
componentSelectionControlBorderSelectedHover: "#004EA3",
componentSelectionControlBorderSelectedActive: "#004EA3",
componentSelectionControlBorderUnselected: "#CED4DB",
componentSelectionControlBorderDisabled: "#0a0a0a1a",
componentSelectionControlBorderSuccess: "#128000",
componentSelectionControlBorderError: "#D22839",
componentSelectionControlForegroundBase: "#ffffff00",
componentSelectionControlForegroundHover: "#ffffff00",
componentSelectionControlForegroundActive: "#0070EB",
componentSelectionControlForegroundSelected: "#ffffff",
componentSelectionControlForegroundSelectedHover: "#ffffff",
componentSelectionControlForegroundSelectedActive: "#ffffff",
componentSelectionControlForegroundUnselected: "#ffffff00",
componentSelectionControlForegroundDisabled: "#0a0a0a33",
componentSelectionControlForegroundSuccess: "#ffffff",
componentSelectionControlForegroundError: "#ffffff",
componentDataInputBackgroundBase: "#ffffff",
componentDataInputBackgroundLayer: "#F7FBFF",
componentDataInputBackgroundHover: "#EAF4FF",
componentDataInputBackgroundError: "#FDECED",
componentDataInputBackgroundDisabled: "#EAF0F6",
componentDataInputBorderBase: "#B0B7BF",
componentDataInputBorderActive: "#005FC8",
componentDataInputBorderError: "#D22839",
componentDataInputBorderDisabled: "#0a0a0a1a",
componentDataInputContentBase: "#1C1D1D",
componentDataInputContentSubtle: "#6A6F73",
componentDataInputContentHover: "#004EA3",
componentDataInputContentError: "#C8002B",
componentDataInputContentDisabled: "#0a0a0a33",
componentDataInputLabelBase: "#05285A",
componentDataInputLabelActive: "#004EA3",
componentDataInputLabelError: "#C8002B",
componentDataInputLabelDisabled: "#0a0a0a33",
componentDataInputPasswordMeterEmpty: "#B0B7BF",
componentDataInputPasswordMeterWeak: "#D22839",
componentDataInputPasswordMeterFair: "#FF8C31",
componentDataInputPasswordMeterGood: "#005FC8",
componentDataInputPasswordMeterGreat: "#128000",
componentDataInputIconBase: "#6A6F73",
componentDataInputIconActive: "#004EA3",
componentDataInputIconError: "#C8002B",
componentDataInputIconDisabled: "#0a0a0a33",
componentPillPrimaryContentBase: "#011638",
componentPillPrimaryContentHover: "#011638",
componentPillPrimaryContentSelected: "#ffffff",
componentPillPrimaryContentActive: "#ffffff",
componentPillPrimaryContentDisabled: "#B0B7BF",
componentPillPrimaryBackgroundBase: "#EAF0F6",
componentPillPrimaryBackgroundHover: "#CED4DB",
componentPillPrimaryBackgroundSelected: "#0070EB",
componentPillPrimaryBackgroundActive: "#005FC8",
componentPillPrimaryBackgroundDisabled: "#EAF0F6",
componentPillInverseContentBase: "#ffffff",
componentPillInverseContentHover: "#011638",
componentPillInverseContentSelected: "#ffffff",
componentPillInverseContentActive: "#ffffff",
componentPillInverseContentDisabled: "#B0B7BF",
componentPillInverseBackgroundBase: "#ffffff00",
componentPillInverseBackgroundHover: "#CED4DB",
componentPillInverseBackgroundSelected: "#0070EB",
componentPillInverseBackgroundActive: "#005FC8",
componentPillInverseBackgroundDisabled: "#EAF0F6",
};
export const fonts = {
fontFamily010: "Proxima Nova",
fontFamily020: "Shentox",
fontFamily030: "Proxima Nova Condensed",
fontFamily040: "Inter",
fontFamily050: "Roboto Condensed",
jumboXxLarge: "Proxima Nova",
jumboXLarge: "Proxima Nova",
jumboLarge: "Proxima Nova",
jumboMedium: "Proxima Nova",
jumboSmall: "Proxima Nova",
headingXxLarge: "Proxima Nova",
headingXLarge: "Proxima Nova",
headingLarge: "Proxima Nova",
headingMedium: "Proxima Nova",
headingSmall: "Proxima Nova",
headingXSmall: "Proxima Nova",
bodyXLargeRegular: "Proxima Nova",
bodyXLargeStrong: "Proxima Nova",
bodyXLargeRegularStrikethrough: "Proxima Nova",
bodyXLargeStrongStrikethrough: "Proxima Nova",
bodyLargeRegular: "Proxima Nova",
bodyLargeStrong: "Proxima Nova",
bodyLargeRegularStrikethrough: "Proxima Nova",
bodyLargeStrongStrikethrough: "Proxima Nova",
bodyMediumRegular: "Proxima Nova",
bodyMediumStrong: "Proxima Nova",
bodyMediumRegularStrikethrough: "Proxima Nova",
bodyMediumStrongStrikethrough: "Proxima Nova",
bodySmallRegular: "Proxima Nova",
bodySmallStrong: "Proxima Nova",
bodySmallRegularStrikethrough: "Proxima Nova",
bodySmallStrongStrikethrough: "Proxima Nova",
bodyXSmallRegular: "Proxima Nova",
bodyXSmallStrong: "Proxima Nova",
bodyXSmallRegularStrikethrough: "Proxima Nova",
bodyXSmallStrongStrikethrough: "Proxima Nova",
buttonLargeRegular: "Proxima Nova",
buttonLargeStrong: "Proxima Nova",
buttonMediumRegular: "Proxima Nova",
buttonMediumStrong: "Proxima Nova",
buttonSmallRegular: "Proxima Nova",
buttonSmallStrong: "Proxima Nova",
buttonXSmallRegular: "Proxima Nova",
buttonXSmallStrong: "Proxima Nova",
metadataMedium: "Proxima Nova Condensed",
metadataSmall: "Proxima Nova Condensed",
labelXLarge: "Proxima Nova Condensed",
labelLarge: "Proxima Nova Condensed",
labelMedium: "Proxima Nova Condensed",
labelSmall: "Proxima Nova Condensed",
labelXSmall: "Proxima Nova Condensed",
};
export const fontWeights = {
fontWeight010: "300",
fontWeight020: "400",
fontWeight030: "500",
fontWeight040: "600",
fontWeight050: "700",
fontWeight060: "700",
fontWeight070: "800",
fontWeight080: "800",
fontWeight090: "900",
jumboXxLarge: "700",
jumboXLarge: "700",
jumboLarge: "700",
jumboMedium: "700",
jumboSmall: "700",
headingXxLarge: "700",
headingXLarge: "700",
headingLarge: "700",
headingMedium: "700",
headingSmall: "700",
headingXSmall: "700",
bodyXLargeRegular: "400",
bodyXLargeStrong: "700",
bodyXLargeRegularStrikethrough: "400",
bodyXLargeStrongStrikethrough: "700",
bodyLargeRegular: "400",
bodyLargeStrong: "700",
bodyLargeRegularStrikethrough: "400",
bodyLargeStrongStrikethrough: "700",
bodyMediumRegular: "400",
bodyMediumStrong: "700",
bodyMediumRegularStrikethrough: "400",
bodyMediumStrongStrikethrough: "700",
bodySmallRegular: "400",
bodySmallStrong: "700",
bodySmallRegularStrikethrough: "400",
bodySmallStrongStrikethrough: "700",
bodyXSmallRegular: "400",
bodyXSmallStrong: "700",
bodyXSmallRegularStrikethrough: "400",
bodyXSmallStrongStrikethrough: "700",
buttonLargeRegular: "400",
buttonLargeStrong: "700",
buttonMediumRegular: "400",
buttonMediumStrong: "700",
buttonSmallRegular: "400",
buttonSmallStrong: "700",
buttonXSmallRegular: "400",
buttonXSmallStrong: "700",
metadataMedium: "400",
metadataSmall: "400",
labelXLarge: "400",
labelLarge: "400",
labelMedium: "400",
labelSmall: "400",
labelXSmall: "400",
};
export const lineHeights = {
lineHeight010: 1,
lineHeight020: 1.1,
lineHeight030: 1.25,
lineHeight040: 1.5,
jumboXxLarge: 1.1,
jumboXLarge: 1.1,
jumboLarge: 1.25,
jumboMedium: 1.25,
jumboSmall: 1.25,
headingXxLarge: 1.25,
headingXLarge: 1.25,
headingLarge: 1.25,
headingMedium: 1.25,
headingSmall: 1.25,
headingXSmall: 1.25,
bodyXLargeRegular: 1.25,
bodyXLargeStrong: 1.25,
bodyXLargeRegularStrikethrough: 1.25,
bodyXLargeStrongStrikethrough: 1.25,
bodyLargeRegular: 1.25,
bodyLargeStrong: 1.25,
bodyLargeRegularStrikethrough: 1.25,
bodyLargeStrongStrikethrough: 1.25,
bodyMediumRegular: 1.25,
bodyMediumStrong: 1.25,
bodyMediumRegularStrikethrough: 1.25,
bodyMediumStrongStrikethrough: 1.25,
bodySmallRegular: 1.25,
bodySmallStrong: 1.25,
bodySmallRegularStrikethrough: 1.25,
bodySmallStrongStrikethrough: 1.25,
bodyXSmallRegular: 1.25,
bodyXSmallStrong: 1.25,
bodyXSmallRegularStrikethrough: 1.25,
bodyXSmallStrongStrikethrough: 1.25,
buttonLargeRegular: 1.25,
buttonLargeStrong: 1.25,
buttonMediumRegular: 1.25,
buttonMediumStrong: 1.25,
buttonSmallRegular: 1.25,
buttonSmallStrong: 1.25,
buttonXSmallRegular: 1.25,
buttonXSmallStrong: 1.25,
metadataMedium: 1.25,
metadataSmall: 1.25,
labelXLarge: 1.25,
labelLarge: 1.25,
labelMedium: 1.25,
labelSmall: 1.25,
labelXSmall: 1.25,
};
export const fontSizes = {
fontSize010: 8,
fontSize020: 10,
fontSize030: 12,
fontSize040: 14,
fontSize050: 16,
fontSize060: 18,
fontSize070: 20,
fontSize080: 22,
fontSize090: 24,
fontSize100: 28,
fontSize110: 32,
fontSize120: 36,
fontSize130: 40,
fontSize140: 48,
fontSize150: 60,
jumboXxLarge: 48,
jumboXLarge: 40,
jumboLarge: 32,
jumboMedium: 28,
jumboSmall: 24,
headingXxLarge: 22,
headingXLarge: 20,
headingLarge: 18,
headingMedium: 16,
headingSmall: 14,
headingXSmall: 12,
bodyXLargeRegular: 18,
bodyXLargeStrong: 18,
bodyXLargeRegularStrikethrough: 18,
bodyXLargeStrongStrikethrough: 18,
bodyLargeRegular: 16,
bodyLargeStrong: 16,
bodyLargeRegularStrikethrough: 16,
bodyLargeStrongStrikethrough: 16,
bodyMediumRegular: 14,
bodyMediumStrong: 14,
bodyMediumRegularStrikethrough: 14,
bodyMediumStrongStrikethrough: 14,
bodySmallRegular: 12,
bodySmallStrong: 12,
bodySmallRegularStrikethrough: 12,
bodySmallStrongStrikethrough: 12,
bodyXSmallRegular: 10,
bodyXSmallStrong: 10,
bodyXSmallRegularStrikethrough: 10,
bodyXSmallStrongStrikethrough: 10,
buttonLargeRegular: 16,
buttonLargeStrong: 16,
buttonMediumRegular: 14,
buttonMediumStrong: 14,
buttonSmallRegular: 12,
buttonSmallStrong: 12,
buttonXSmallRegular: 10,
buttonXSmallStrong: 10,
metadataMedium: 12,
metadataSmall: 10,
labelXLarge: 16,
labelLarge: 14,
labelMedium: 12,
labelSmall: 10,
labelXSmall: 8,
};
export const letterSpacings = {
letterSpacing010: 0,
letterSpacing020: 0.5,
letterSpacing030: 1,
jumboXxLarge: 0,
jumboXLarge: 0,
jumboLarge: 0,
jumboMedium: 0,
jumboSmall: 0,
headingXxLarge: 0,
headingXLarge: 0,
headingLarge: 0,
headingMedium: 0,
headingSmall: 0,
headingXSmall: 0,
bodyXLargeRegular: 0,
bodyXLargeStrong: 0,
bodyXLargeRegularStrikethrough: 0,
bodyXLargeStrongStrikethrough: 0,
bodyLargeRegular: 0,
bodyLargeStrong: 0,
bodyLargeRegularStrikethrough: 0,
bodyLargeStrongStrikethrough: 0,
bodyMediumRegular: 0,
bodyMediumStrong: 0,
bodyMediumRegularStrikethrough: 0,
bodyMediumStrongStrikethrough: 0,
bodySmallRegular: 0,
bodySmallStrong: 0,
bodySmallRegularStrikethrough: 0,
bodySmallStrongStrikethrough: 0,
bodyXSmallRegular: 0,
bodyXSmallStrong: 0,
bodyXSmallRegularStrikethrough: 0,
bodyXSmallStrongStrikethrough: 0,
buttonLargeRegular: 0,
buttonLargeStrong: 0,
buttonMediumRegular: 0,
buttonMediumStrong: 0,
buttonSmallRegular: 0,
buttonSmallStrong: 0,
buttonXSmallRegular: 0,
buttonXSmallStrong: 0,
metadataMedium: 1,
metadataSmall: 1,
labelXLarge: 1,
labelLarge: 1,
labelMedium: 1,
labelSmall: 1,
labelXSmall: 1,
};
export const textCase = {
textCaseUppercase: "uppercase",
textCaseCapitalize: "capitalize",
textCaseLowercase: "lowercase",
textCaseNone: "none",
jumboXxLarge: "none",
jumboXLarge: "none",
jumboLarge: "none",
jumboMedium: "none",
jumboSmall: "none",
headingXxLarge: "none",
headingXLarge: "none",
headingLarge: "none",
headingMedium: "none",
headingSmall: "none",
headingXSmall: "none",
bodyXLargeRegular: "none",
bodyXLargeStrong: "none",
bodyXLargeRegularStrikethrough: "none",
bodyXLargeStrongStrikethrough: "none",
bodyLargeRegular: "none",
bodyLargeStrong: "none",
bodyLargeRegularStrikethrough: "none",
bodyLargeStrongStrikethrough: "none",
bodyMediumRegular: "none",
bodyMediumStrong: "none",
bodyMediumRegularStrikethrough: "none",
bodyMediumStrongStrikethrough: "none",
bodySmallRegular: "none",
bodySmallStrong: "none",
bodySmallRegularStrikethrough: "none",
bodySmallStrongStrikethrough: "none",
bodyXSmallRegular: "none",
bodyXSmallStrong: "none",
bodyXSmallRegularStrikethrough: "none",
bodyXSmallStrongStrikethrough: "none",
buttonLargeRegular: "none",
buttonLargeStrong: "none",
buttonMediumRegular: "none",
buttonMediumStrong: "none",
buttonSmallRegular: "none",
buttonSmallStrong: "none",
buttonXSmallRegular: "none",
buttonXSmallStrong: "none",
metadataMedium: "uppercase",
metadataSmall: "uppercase",
labelXLarge: "uppercase",
labelLarge: "uppercase",
labelMedium: "uppercase",
labelSmall: "uppercase",
labelXSmall: "uppercase",
};
export const textDecoration = {
textDecorationNone: "none",
textDecorationUnderline: "underline",
textDecorationLineThrough: "line-through",
jumboXxLarge: "none",
jumboXLarge: "none",
jumboLarge: "none",
jumboMedium: "none",
jumboSmall: "none",
headingXxLarge: "none",
headingXLarge: "none",
headingLarge: "none",
headingMedium: "none",
headingSmall: "none",
headingXSmall: "none",
bodyXLargeRegular: "none",
bodyXLargeStrong: "none",
bodyXLargeRegularStrikethrough: "line-through",
bodyXLargeStrongStrikethrough: "line-through",
bodyLargeRegular: "none",
bodyLargeStrong: "none",
bodyLargeRegularStrikethrough: "line-through",
bodyLargeStrongStrikethrough: "line-through",
bodyMediumRegular: "none",
bodyMediumStrong: "none",
bodyMediumRegularStrikethrough: "line-through",
bodyMediumStrongStrikethrough: "line-through",
bodySmallRegular: "none",
bodySmallStrong: "none",
bodySmallRegularStrikethrough: "line-through",
bodySmallStrongStrikethrough: "line-through",
bodyXSmallRegular: "none",
bodyXSmallStrong: "none",
bodyXSmallRegularStrikethrough: "line-through",
bodyXSmallStrongStrikethrough: "line-through",
buttonLargeRegular: "none",
buttonLargeStrong: "none",
buttonMediumRegular: "none",
buttonMediumStrong: "none",
buttonSmallRegular: "none",
buttonSmallStrong: "none",
buttonXSmallRegular: "none",
buttonXSmallStrong: "none",
metadataMedium: "none",
metadataSmall: "none",
labelXLarge: "none",
labelLarge: "none",
labelMedium: "none",
labelSmall: "none",
labelXSmall: "none",
};
export const sizes = {
maxContentWidth: 1400,
};
export const space = {
spaceBase: 4,
space0: 0,
space025: 1,
space05: 2,
space1: 4,
space2: 8,
space3: 12,
space4: 16,
space5: 20,
space6: 24,
space8: 32,
space10: 40,
space12: 48,
space16: 64,
space20: 80,
space30: 120,
space40: 160,
};
export const shadows = {
elevationsTopLow: "0px -2px 4px 0px rgba(10, 10, 10, 0.1)",
elevationsTopMid: "0px -4px 8px 0px rgba(10, 10, 10, 0.2)",
elevationsTopHigh: "0px -8px 16px 0px rgba(10, 10, 10, 0.3)",
elevationsBottomLow: "0px 2px 4px 0px rgba(10, 10, 10, 0.1)",
elevationsBottomMid: "0px 4px 8px 0px rgba(10, 10, 10, 0.2)",
elevationsBottomHigh: "0px 8px 16px 0px rgba(10, 10, 10, 0.3)",
elevationsAllAroundLow: "0px 0px 4px 2px rgba(10, 10, 10, 0.1)",
elevationsAllAroundMid: "0px 0px 8px 2px rgba(10, 10, 10, 0.2)",
elevationsAllAroundHigh: "0px 0px 16px 2px rgba(10, 10, 10, 0.3)",
};
export const borderWidths = {
borderWidthDefault: 1,
borderWidth000: 0,
borderWidth010: 1,
borderWidth020: 2,
borderWidth030: 4,
borderWidth040: 8,
};
export const radii = {
borderRadiusDefault: 4,
borderRadiusSharp: 0,
borderRadiusCircle: 9999,
borderRadius010: 2,
borderRadius020: 4,
borderRadius030: 8,
borderRadius040: 12,
borderRadius050: 24,
};
export const borderStyles = {
borderStyleSolidStyle: "solid",
borderStyleDashedStyle: "dashed",
};
export const paragraphSpacing = {
jumboXxLarge: "",
jumboXLarge: "",
jumboLarge: "",
jumboMedium: "",
jumboSmall: "",
headingXxLarge: "",
headingXLarge: "",
headingLarge: "",
headingMedium: "",
headingSmall: "",
headingXSmall: "",
bodyXLargeRegular: "",
bodyXLargeStrong: "",
bodyXLargeRegularStrikethrough: "",
bodyXLargeStrongStrikethrough: "",
bodyLargeRegular: "",
bodyLargeStrong: "",
bodyLargeRegularStrikethrough: "",
bodyLargeStrongStrikethrough: "",
bodyMediumRegular: "",
bodyMediumStrong: "",
bodyMediumRegularStrikethrough: "",
bodyMediumStrongStrikethrough: "",
bodySmallRegular: "",
bodySmallStrong: "",
bodySmallRegularStrikethrough: "",
bodySmallStrongStrikethrough: "",
bodyXSmallRegular: "",
bodyXSmallStrong: "",
bodyXSmallRegularStrikethrough: "",
bodyXSmallStrongStrikethrough: "",
buttonLargeRegular: "",
buttonLargeStrong: "",
buttonMediumRegular: "",
buttonMediumStrong: "",
buttonSmallRegular: "",
buttonSmallStrong: "",
buttonXSmallRegular: "",
buttonXSmallStrong: "",
metadataMedium: "",
metadataSmall: "",
labelXLarge: "",
labelLarge: "",
labelMedium: "",
labelSmall: "",
labelXSmall: "",
};
export const text = {
themeName: "Fanduel Light",
};
export const nativeShadows = {
elevationsTopLow: [
{
type: "dropShadow",
color: "#0a0a0a",
opacity: 0.1,
offset: {
height: -2,
width: 0,
},
radius: 4,
spread: 0,
css: "0px -2px 4px 0px rgba(10, 10, 10, 0.1)",
},
],
elevationsTopMid: [
{
type: "dropShadow",
color: "#0a0a0a",
opacity: 0.2,
offset: {
height: -4,
width: 0,
},
radius: 8,
spread: 0,
css: "0px -4px 8px 0px rgba(10, 10, 10, 0.2)",
},
],
elevationsTopHigh: [
{
type: "dropShadow",
color: "#0a0a0a",
opacity: 0.3,
offset: {
height: -8,
width: 0,
},
radius: 16,
spread: 0,
css: "0px -8px 16px 0px rgba(10, 10, 10, 0.3)",
},
],
elevationsBottomLow: [
{
type: "dropShadow",
color: "#0a0a0a",
opacity: 0.1,
offset: {
height: 2,
width: 0,
},
radius: 4,
spread: 0,
css: "0px 2px 4px 0px rgba(10, 10, 10, 0.1)",
},
],
elevationsBottomMid: [
{
type: "dropShadow",
color: "#0a0a0a",
opacity: 0.2,
offset: {
height: 4,
width: 0,
},
radius: 8,
spread: 0,
css: "0px 4px 8px 0px rgba(10, 10, 10, 0.2)",
},
],
elevationsBottomHigh: [
{
type: "dropShadow",
color: "#0a0a0a",
opacity: 0.3,
offset: {
height: 8,
width: 0,
},
radius: 16,
spread: 0,
css: "0px 8px 16px 0px rgba(10, 10, 10, 0.3)",
},
],
elevationsAllAroundLow: [
{
type: "dropShadow",
color: "#0a0a0a",
opacity: 0.1,
offset: {
height: 0,
width: 0,
},
radius: 4,
spread: 2,
css: "0px 0px 4px 2px rgba(10, 10, 10, 0.1)",
},
],
elevationsAllAroundMid: [
{
type: "dropShadow",
color: "#0a0a0a",
opacity: 0.2,
offset: {
height: 0,
width: 0,
},
radius: 8,
spread: 2,
css: "0px 0px 8px 2px rgba(10, 10, 10, 0.2)",
},
],
elevationsAllAroundHigh: [
{
type: "dropShadow",
color: "#0a0a0a",
opacity: 0.3,
offset: {
height: 0,
width: 0,
},
radius: 16,
spread: 2,
css: "0px 0px 16px 2px rgba(10, 10, 10, 0.3)",
},
],
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/fantasy-dark.js
export const colors = {
brandPrimaryDefault: "#0070EB",
brandPrimaryTint: "#C8E2FF",
brandPrimaryShade: "#004EA3",
contentBrandPrimary: "#0070EB",
contentLink: "#2B90FF",
contentLinkActive: "#005FC8",
backgroundBrand: "#0070EB",
borderDefault: "#B0B7BF",
borderSubtle: "#2B2D2E",
borderDisabled: "#2B2D2E",
borderBrand: "#0070EB",
linkDefaultBase: "#2B90FF",
linkDefaultHover: "#005FC8",
systemNeutralBackgroundDefault: "#4D5153",
systemNeutralBorderDefault: "#4D5153",
componentButtonPrimaryBorderDisabled: "#2B2D2E",
componentButtonSecondaryBorderDisabled: "#2B2D2E",
componentButtonTertiaryContentBase: "#2B90FF",
componentButtonTertiaryBorderBase: "#005FC8",
componentButtonTertiaryBorderHover: "#005FC8",
componentButtonTertiaryBorderDisabled: "#2B2D2E",
componentButtonTransparentBorderDisabled: "#2B2D2E",
componentButtonDestructiveBorderDisabled: "#2B2D2E",
componentButtonButtonLinkContentBase: "#2B90FF",
componentButtonButtonLinkBorderDisabled: "#2B2D2E",
componentSelectionControlBackgroundHover: "#004EA3",
componentSelectionControlBackgroundSelected: "#0070EB",
componentSelectionControlBackgroundSelectedHover: "#0070EB",
componentSelectionControlBackgroundSelectedActive: "#0070EB",
componentSelectionControlBackgroundDisabled: "#2B2D2E",
componentSelectionControlBackgroundSuccess: "#005D23",
componentSelectionControlBackgroundError: "#A40023",
componentSelectionControlBorderBase: "#B0B7BF",
componentSelectionControlBorderHover: "#0070EB",
componentSelectionControlBorderActive: "#0070EB",
componentSelectionControlBorderSelected: "#005FC8",
componentSelectionControlBorderSelectedHover: "#005FC8",
componentSelectionControlBorderSelectedActive: "#005FC8",
componentSelectionControlBorderDisabled: "#2B2D2E",
componentSelectionControlBorderSuccess: "#005D23",
componentSelectionControlBorderError: "#A40023",
componentDataInputBorderBase: "#B0B7BF",
componentDataInputBorderDisabled: "#2B2D2E",
componentDataInputPasswordMeterEmpty: "#4D5153",
};
export const text = {
themeName: "Fantasy Dark",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/fantasy.js
export const text = {
themeName: "Fantasy Light",
};
export const colors = {
contentSubtle: "#4D5153",
contentLink: "#005FC8",
contentLinkActive: "#003D81",
borderSubtle: "#EAF0F6",
borderDisabled: "#F7FBFF",
linkDefaultBase: "#005FC8",
linkDefaultHover: "#003D81",
systemInfoLinkOnSubtle: "#005FC8",
systemPositiveLinkOnSubtle: "#005FC8",
systemAlertLinkOnSubtle: "#005FC8",
systemWarningLinkOnSubtle: "#005FC8",
systemImportantLinkOnSubtle: "#005FC8",
systemNeutralLinkOnSubtle: "#005FC8",
systemVerificationLinkOnSubtle: "#005FC8",
componentButtonPrimaryBorderDisabled: "#F7FBFF",
componentButtonSecondaryBorderDisabled: "#F7FBFF",
componentButtonTertiaryBorderDisabled: "#F7FBFF",
componentButtonDestructiveBorderDisabled: "#F7FBFF",
componentButtonButtonLinkContentHover: "#005FC8",
componentButtonButtonLinkBorderDisabled: "#F7FBFF",
componentSelectionControlBorderDisabled: "#F7FBFF",
componentDataInputBorderDisabled: "#F7FBFF",
componentDataInputContentSubtle: "#4D5153",
componentDataInputIconBase: "#4D5153",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/lottery.js
export const fonts = {
jumboXxLarge: "Inter",
jumboXLarge: "Inter",
jumboLarge: "Inter",
jumboMedium: "Inter",
jumboSmall: "Inter",
headingXxLarge: "Inter",
headingXLarge: "Inter",
headingLarge: "Inter",
headingMedium: "Inter",
headingSmall: "Inter",
headingXSmall: "Inter",
bodyXLargeRegular: "Inter",
bodyXLargeStrong: "Inter",
bodyXLargeRegularStrikethrough: "Inter",
bodyXLargeStrongStrikethrough: "Inter",
bodyLargeRegular: "Inter",
bodyLargeStrong: "Inter",
bodyLargeRegularStrikethrough: "Inter",
bodyLargeStrongStrikethrough: "Inter",
bodyMediumRegular: "Inter",
bodyMediumStrong: "Inter",
bodyMediumRegularStrikethrough: "Inter",
bodyMediumStrongStrikethrough: "Inter",
bodySmallRegular: "Inter",
bodySmallStrong: "Inter",
bodySmallRegularStrikethrough: "Inter",
bodySmallStrongStrikethrough: "Inter",
bodyXSmallRegular: "Inter",
bodyXSmallStrong: "Inter",
bodyXSmallRegularStrikethrough: "Inter",
bodyXSmallStrongStrikethrough: "Inter",
buttonLargeRegular: "Inter",
buttonLargeStrong: "Inter",
buttonMediumRegular: "Inter",
buttonMediumStrong: "Inter",
buttonSmallRegular: "Inter",
buttonSmallStrong: "Inter",
buttonXSmallRegular: "Inter",
buttonXSmallStrong: "Inter",
metadataMedium: "Roboto Condensed",
metadataSmall: "Roboto Condensed",
labelXLarge: "Roboto Condensed",
labelLarge: "Roboto Condensed",
labelMedium: "Roboto Condensed",
labelSmall: "Roboto Condensed",
labelXSmall: "Roboto Condensed",
};
export const colors = {
brandGradientDefault: "linear-gradient(125deg, #6E15EB 0%, #11001C 100%)",
brandGradientColorStopsStart: "#6E15EB",
brandGradientColorStopsEnd: "#11001C",
};
export const text = {
themeName: "Lottery",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/mohegan-sun.js
export const colors = {
brandPrimaryDefault: "#ef6000",
brandPrimaryTint: "#FFE5D1",
brandPrimaryShade: "#8E4918",
brandSecondaryDefault: "#054A71",
brandSecondaryTint: "#B3D4DF",
brandSecondaryShade: "#051725",
brandGradientDefault: "linear-gradient(125deg, #052855 0%, #052855 100%)",
brandGradientColorStopsStart: "#052855",
brandGradientColorStopsEnd: "#052855",
productColorsPrimaryL5: "#FFF2E8",
productColorsPrimaryL4: "#FFE5D1",
productColorsPrimaryL3: "#FFCBA5",
productColorsPrimaryL2: "#FFB07A",
productColorsPrimaryL1: "#FF954E",
productColorsPrimary: "#ef6000",
productColorsPrimaryD1: "#C94e08",
productColorsPrimaryD2: "#8E4918",
productColorsPrimaryD3: "#5E3214",
productColorsPrimaryD4: "#311D0E",
productColorsSecondaryL5: "#e6f1f4",
productColorsSecondaryL4: "#B3D4DF",
productColorsSecondaryL3: "#80B7CA",
productColorsSecondaryL2: "#4D9AB5",
productColorsSecondaryL1: "#006E95",
productColorsSecondary: "#054A71",
productColorsSecondaryD1: "#04315D",
productColorsSecondaryD2: "#162740",
productColorsSecondaryD3: "#081F30",
productColorsSecondaryD4: "#051725",
contentStrong: "#ffffff",
contentDefault: "#CED4DB",
contentSubtle: "#969DA3",
contentDisabled: "#ffffff33",
contentOnLight: "#011638",
contentBrandPrimary: "#ef6000",
contentBrandSecondary: "#B3D4DF",
contentLoadingDefault: "#ffffff0d",
contentLoadingInverse: "#0a0a0a0d",
contentLink: "#64AEFF",
contentLinkActive: "#0070EB",
backgroundBase: "#162740",
backgroundSurface: "#051725",
backgroundLayer: "#081F30",
backgroundAccent: "#ffffff0d",
backgroundHover: "#04315D",
backgroundDisabled: "#04315D",
backgroundTransparent: "#0a0a0a00",
backgroundSecondary: "#0a0a0a",
backgroundBrand: "#ef6000",
backgroundGradientSurfaceFadeEnd: "linear-gradient(90deg, #0a0a0a00 0%, #051725 100%)",
backgroundGradientSurfaceFadeBottom: "linear-gradient(180deg, #0a0a0a00 0%, #051725 100%)",
backgroundGradientColorStopsStart: "#0a0a0a00",
backgroundGradientColorStopsEnd: "#051725",
borderDefault: "#6A6F73",
borderSubtle: "#4D5153",
borderActive: "#64AEFF",
borderDisabled: "#ffffff1a",
borderInverse: "#EAF0F6",
borderBrand: "#ef6000",
linkDefaultBase: "#64AEFF",
linkDefaultHover: "#0070EB",
linkDestructiveBase: "#EA6875",
linkDestructiveHover: "#D22839",
systemInfoBackgroundDefault: "#004EA3",
systemInfoBackgroundSubtle: "#002650",
systemInfoBorderDefault: "#004EA3",
systemInfoContentOnSubtle: "#ffffff",
systemInfoContentAccent: "#99CAFF",
systemInfoLinkOnSubtle: "#ffffff",
systemPositiveBackgroundDefault: "#005D23",
systemPositiveBackgroundSubtle: "#002E11",
systemPositiveBorderDefault: "#005D23",
systemPositiveContentOnSubtle: "#ffffff",
systemPositiveContentAccent: "#7FD9A1",
systemPositiveLinkOnSubtle: "#ffffff",
systemAlertBackgroundDefault: "#756100",
systemAlertBackgroundSubtle: "#4B3F00",
systemAlertBorderDefault: "#756100",
systemAlertContentOnDefault: "#ffffff",
systemAlertContentOnSubtle: "#ffffff",
systemAlertContentAccent: "#FFDC2E",
systemAlertLinkOnDefault: "#ffffff",
systemAlertLinkOnSubtle: "#ffffff",
systemWarningBackgroundDefault: "#A44800",
systemWarningBackgroundSubtle: "#692E00",
systemWarningBorderDefault: "#A44800",
systemWarningContentOnDefault: "#ffffff",
systemWarningContentOnSubtle: "#ffffff",
systemWarningContentAccent: "#FFB77E",
systemWarningLinkOnDefault: "#ffffff",
systemWarningLinkOnSubtle: "#ffffff",
systemImportantBackgroundDefault: "#A40023",
systemImportantBackgroundSubtle: "#40020D",
systemImportantBorderDefault: "#A40023",
systemImportantContentOnSubtle: "#ffffff",
systemImportantContentAccent: "#F198A1",
systemImportantLinkOnSubtle: "#ffffff",
systemNeutralBackgroundDefault: "#6A6F73",
systemNeutralBackgroundSubtle: "#2B2D2E",
systemNeutralBorderDefault: "#6A6F73",
systemNeutralContentOnDefault: "#ffffff",
systemNeutralContentOnSubtle: "#ffffff",
systemNeutralContentAccent: "#CED4DB",
systemNeutralLinkOnDefault: "#ffffff",
systemNeutralLinkOnSubtle: "#ffffff",
systemVerificationBackgroundDefault: "#61019B",
systemVerificationBackgroundSubtle: "#36005B",
systemVerificationBorderDefault: "#61019B",
systemVerificationContentOnSubtle: "#ffffff",
systemVerificationContentAccent: "#D4B6FE",
systemVerificationLinkOnSubtle: "#ffffff",
componentButtonPrimaryContentBase: "#0a0a0a",
componentButtonPrimaryContentHover: "#0a0a0a",
componentButtonPrimaryContentActive: "#0a0a0a",
componentButtonPrimaryContentDisabled: "#ffffff33",
componentButtonPrimaryBackgroundBase: "#ef6000",
componentButtonPrimaryBackgroundHover: "#C94e08",
componentButtonPrimaryBackgroundActive: "#8E4918",
componentButtonPrimaryBackgroundDisabled: "#04315D",
componentButtonPrimaryBorderBase: "#ef6000",
componentButtonPrimaryBorderHover: "#C94e08",
componentButtonPrimaryBorderActive: "#8E4918",
componentButtonPrimaryBorderDisabled: "#ffffff1a",
componentButtonSecondaryContentDisabled: "#ffffff33",
componentButtonSecondaryBackgroundDisabled: "#04315D",
componentButtonSecondaryBorderDisabled: "#ffffff1a",
componentButtonTertiaryContentBase: "#ef6000",
componentButtonTertiaryContentHover: "#C94e08",
componentButtonTertiaryContentDisabled: "#ffffff33",
componentButtonTertiaryBackgroundBase: "#0a0a0a00",
componentButtonTertiaryBackgroundHover: "#311D0E",
componentButtonTertiaryBackgroundActive: "#C94e08",
componentButtonTertiaryBackgroundDisabled: "#0a0a0a00",
componentButtonTertiaryBorderBase: "#ef6000",
componentButtonTertiaryBorderHover: "#FF954E",
componentButtonTertiaryBorderActive: "#C94e08",
componentButtonTertiaryBorderDisabled: "#ffffff1a",
componentButtonTransparentContentDisabled: "#ffffff33",
componentButtonTransparentBackgroundBase: "#0a0a0a00",
componentButtonTransparentBackgroundActive: "#005FC8",
componentButtonTransparentBackgroundDisabled: "#0a0a0a00",
componentButtonTransparentBorderActive: "#0a0a0a00",
componentButtonTransparentBorderDisabled: "#ffffff1a",
componentButtonDestructiveContentDisabled: "#ffffff33",
componentButtonDestructiveBackgroundHover: "#A40023",
componentButtonDestructiveBackgroundActive: "#83001C",
componentButtonDestructiveBackgroundDisabled: "#04315D",
componentButtonDestructiveBorderHover: "#A40023",
componentButtonDestructiveBorderActive: "#83001C",
componentButtonDestructiveBorderDisabled: "#ffffff1a",
componentButtonButtonLinkContentBase: "#64AEFF",
componentButtonButtonLinkContentHover: "#0070EB",
componentButtonButtonLinkContentDisabled: "#3C3E40",
componentButtonButtonLinkBackgroundBase: "#0a0a0a00",
componentButtonButtonLinkBackgroundHover: "#002650",
componentButtonButtonLinkBackgroundDisabled: "#0a0a0a00",
componentButtonButtonLinkBorderBase: "#0a0a0a00",
componentButtonButtonLinkBorderHover: "#0a0a0a00",
componentButtonButtonLinkBorderActive: "#0a0a0a00",
componentButtonButtonLinkBorderDisabled: "#ffffff1a",
componentSelectionControlBackgroundBase: "#051725",
componentSelectionControlBackgroundHover: "#04315D",
componentSelectionControlBackgroundActive: "#FF954E",
componentSelectionControlBackgroundSelected: "#ef6000",
componentSelectionControlBackgroundSelectedHover: "#99CAFF",
componentSelectionControlBackgroundSelectedActive: "#99CAFF",
componentSelectionControlBackgroundUnselected: "#4D5153",
componentSelectionControlBackgroundDisabled: "#04315D",
componentSelectionControlBackgroundSuccess: "#31C268",
componentSelectionControlBackgroundError: "#EA6875",
componentSelectionControlBorderBase: "#6A6F73",
componentSelectionControlBorderHover: "#FF954E",
componentSelectionControlBorderActive: "#FF954E",
componentSelectionControlBorderSelected: "#ef6000",
componentSelectionControlBorderSelectedHover: "#99CAFF",
componentSelectionControlBorderSelectedActive: "#99CAFF",
componentSelectionControlBorderUnselected: "#4D5153",
componentSelectionControlBorderDisabled: "#ffffff1a",
componentSelectionControlBorderSuccess: "#1BB152",
componentSelectionControlBorderError: "#EB4758",
componentSelectionControlForegroundBase: "#0a0a0a00",
componentSelectionControlForegroundHover: "#0a0a0a00",
componentSelectionControlForegroundActive: "#ef6000",
componentSelectionControlForegroundSelected: "#011638",
componentSelectionControlForegroundSelectedHover: "#011638",
componentSelectionControlForegroundSelectedActive: "#011638",
componentSelectionControlForegroundUnselected: "#0a0a0a00",
componentSelectionControlForegroundDisabled: "#ffffff33",
componentSelectionControlForegroundSuccess: "#011638",
componentSelectionControlForegroundError: "#011638",
componentDataInputBackgroundBase: "#051725",
componentDataInputBackgroundLayer: "#081F30",
componentDataInputBackgroundHover: "#04315D",
componentDataInputBackgroundError: "#40020D",
componentDataInputBackgroundDisabled: "#04315D",
componentDataInputBorderBase: "#6A6F73",
componentDataInputBorderActive: "#004EA3",
componentDataInputBorderError: "#A40023",
componentDataInputBorderDisabled: "#ffffff1a",
componentDataInputContentBase: "#CED4DB",
componentDataInputContentSubtle: "#969DA3",
componentDataInputContentHover: "#99CAFF",
componentDataInputContentError: "#F198A1",
componentDataInputContentDisabled: "#ffffff33",
componentDataInputLabelBase: "#ffffff",
componentDataInputLabelActive: "#99CAFF",
componentDataInputLabelError: "#F198A1",
componentDataInputLabelDisabled: "#ffffff33",
componentDataInputPasswordMeterEmpty: "#6A6F73",
componentDataInputPasswordMeterWeak: "#A40023",
componentDataInputPasswordMeterFair: "#A44800",
componentDataInputPasswordMeterGood: "#004EA3",
componentDataInputPasswordMeterGreat: "#005D23",
componentDataInputIconBase: "#969DA3",
componentDataInputIconActive: "#99CAFF",
componentDataInputIconError: "#F198A1",
componentDataInputIconDisabled: "#ffffff33",
componentPillPrimaryContentBase: "#ffffff",
componentPillPrimaryContentHover: "#ffffff",
componentPillPrimaryContentSelected: "#011638",
componentPillPrimaryContentActive: "#011638",
componentPillPrimaryContentDisabled: "#0a0a0a",
componentPillPrimaryBackgroundBase: "#ffffff1a",
componentPillPrimaryBackgroundHover: "#ffffff4d",
componentPillPrimaryBackgroundSelected: "#64AEFF",
componentPillPrimaryBackgroundActive: "#2B90FF",
componentPillPrimaryBackgroundDisabled: "#2B2D2E",
componentPillInverseContentHover: "#ffffff",
componentPillInverseContentSelected: "#011638",
componentPillInverseContentActive: "#011638",
componentPillInverseContentDisabled: "#0a0a0a",
componentPillInverseBackgroundBase: "#0a0a0a00",
componentPillInverseBackgroundHover: "#ffffff4d",
componentPillInverseBackgroundSelected: "#64AEFF",
componentPillInverseBackgroundActive: "#2B90FF",
componentPillInverseBackgroundDisabled: "#2B2D2E",
};
export const text = {
themeName: "Mohegan Sun",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/picks.js
export const fonts = {
jumboXxLarge: "Inter",
jumboXLarge: "Inter",
jumboLarge: "Inter",
jumboMedium: "Inter",
jumboSmall: "Inter",
headingXxLarge: "Inter",
headingXLarge: "Inter",
headingLarge: "Inter",
headingMedium: "Inter",
headingSmall: "Inter",
headingXSmall: "Inter",
bodyXLargeRegular: "Inter",
bodyXLargeStrong: "Inter",
bodyXLargeRegularStrikethrough: "Inter",
bodyXLargeStrongStrikethrough: "Inter",
bodyLargeRegular: "Inter",
bodyLargeStrong: "Inter",
bodyLargeRegularStrikethrough: "Inter",
bodyLargeStrongStrikethrough: "Inter",
bodyMediumRegular: "Inter",
bodyMediumStrong: "Inter",
bodyMediumRegularStrikethrough: "Inter",
bodyMediumStrongStrikethrough: "Inter",
bodySmallRegular: "Inter",
bodySmallStrong: "Inter",
bodySmallRegularStrikethrough: "Inter",
bodySmallStrongStrikethrough: "Inter",
bodyXSmallRegular: "Inter",
bodyXSmallStrong: "Inter",
bodyXSmallRegularStrikethrough: "Inter",
bodyXSmallStrongStrikethrough: "Inter",
buttonLargeRegular: "Inter",
buttonLargeStrong: "Inter",
buttonMediumRegular: "Inter",
buttonMediumStrong: "Inter",
buttonSmallRegular: "Inter",
buttonSmallStrong: "Inter",
buttonXSmallRegular: "Inter",
buttonXSmallStrong: "Inter",
metadataMedium: "Roboto Condensed",
metadataSmall: "Roboto Condensed",
labelXLarge: "Roboto Condensed",
labelLarge: "Roboto Condensed",
labelMedium: "Roboto Condensed",
labelSmall: "Roboto Condensed",
labelXSmall: "Roboto Condensed",
};
export const colors = {
brandPrimaryDefault: "#2B90FF",
brandPrimaryTint: "#99CAFF",
brandPrimaryShade: "#003D81",
brandSecondaryDefault: "#2B2F51",
brandSecondaryTint: "#808297",
brandSecondaryShade: "#111320",
brandGradientDefault: "linear-gradient(125deg, #1F1AFE 0%, #183495 100%)",
brandGradientColorStopsStart: "#1F1AFE",
brandGradientColorStopsEnd: "#183495",
productColorsSecondaryL5: "#bfc1cb",
productColorsSecondaryL4: "#808297",
productColorsSecondaryL3: "#6b6d85",
productColorsSecondaryL2: "#555974",
productColorsSecondaryL1: "#404462",
productColorsSecondary: "#2B2F51",
productColorsSecondaryD1: "#272a49",
productColorsSecondaryD2: "#222641",
productColorsSecondaryD3: "#1e2139",
productColorsSecondaryD4: "#111320",
contentStrong: "#ffffff",
contentDefault: "#CED4DB",
contentSubtle: "#969DA3",
contentDisabled: "#ffffff33",
contentOnLight: "#011638",
contentBrandPrimary: "#2B90FF",
contentBrandSecondary: "#808297",
contentLoadingDefault: "#ffffff0d",
contentLoadingInverse: "#0a0a0a0d",
contentLink: "#64AEFF",
contentLinkActive: "#0070EB",
backgroundBase: "#111320",
backgroundSurface: "#1e2139",
backgroundLayer: "#2B2F51",
backgroundAccent: "#ffffff0d",
backgroundHover: "#3C3E40",
backgroundActive: "#183495",
backgroundDisabled: "#3C3E40",
backgroundTransparent: "#0a0a0a00",
backgroundSecondary: "#0a0a0a",
backgroundBrand: "#2B90FF",
backgroundGradientSurfaceFadeEnd: "linear-gradient(90deg, #0a0a0a00 0%, #1e2139 100%)",
backgroundGradientSurfaceFadeBottom: "linear-gradient(180deg, #0a0a0a00 0%, #1e2139 100%)",
backgroundGradientColorStopsStart: "#0a0a0a00",
backgroundGradientColorStopsEnd: "#1e2139",
borderDefault: "#272a49",
borderSubtle: "#222641",
borderActive: "#1F1AFE",
borderDisabled: "#ffffff1a",
borderInverse: "#EAF0F6",
borderBrand: "#2B90FF",
linkDefaultBase: "#64AEFF",
linkDefaultHover: "#0070EB",
linkDestructiveBase: "#EA6875",
linkDestructiveHover: "#D22839",
systemInfoBackgroundDefault: "#004EA3",
systemInfoBackgroundSubtle: "#002650",
systemInfoBorderDefault: "#004EA3",
systemInfoContentOnSubtle: "#ffffff",
systemInfoContentAccent: "#99CAFF",
systemInfoLinkOnSubtle: "#ffffff",
systemPositiveBackgroundDefault: "#005D23",
systemPositiveBackgroundSubtle: "#002E11",
systemPositiveBorderDefault: "#005D23",
systemPositiveContentOnSubtle: "#ffffff",
systemPositiveContentAccent: "#7FD9A1",
systemPositiveLinkOnSubtle: "#ffffff",
systemAlertBackgroundDefault: "#756100",
systemAlertBackgroundSubtle: "#4B3F00",
systemAlertBorderDefault: "#756100",
systemAlertContentOnDefault: "#ffffff",
systemAlertContentOnSubtle: "#ffffff",
systemAlertContentAccent: "#FFDC2E",
systemAlertLinkOnDefault: "#ffffff",
systemAlertLinkOnSubtle: "#ffffff",
systemWarningBackgroundDefault: "#A44800",
systemWarningBackgroundSubtle: "#692E00",
systemWarningBorderDefault: "#A44800",
systemWarningContentOnDefault: "#ffffff",
systemWarningContentOnSubtle: "#ffffff",
systemWarningContentAccent: "#FFB77E",
systemWarningLinkOnDefault: "#ffffff",
systemWarningLinkOnSubtle: "#ffffff",
systemImportantBackgroundDefault: "#A40023",
systemImportantBackgroundSubtle: "#40020D",
systemImportantBorderDefault: "#A40023",
systemImportantContentOnSubtle: "#ffffff",
systemImportantContentAccent: "#F198A1",
systemImportantLinkOnSubtle: "#ffffff",
systemNeutralBackgroundDefault: "#6A6F73",
systemNeutralBackgroundSubtle: "#2B2D2E",
systemNeutralBorderDefault: "#6A6F73",
systemNeutralContentOnDefault: "#ffffff",
systemNeutralContentOnSubtle: "#ffffff",
systemNeutralContentAccent: "#CED4DB",
systemNeutralLinkOnDefault: "#ffffff",
systemNeutralLinkOnSubtle: "#ffffff",
systemVerificationBackgroundDefault: "#61019B",
systemVerificationBackgroundSubtle: "#36005B",
systemVerificationBorderDefault: "#61019B",
systemVerificationContentOnSubtle: "#ffffff",
systemVerificationContentAccent: "#D4B6FE",
systemVerificationLinkOnSubtle: "#ffffff",
componentButtonPrimaryContentDisabled: "#ffffff33",
componentButtonPrimaryBackgroundDisabled: "#3C3E40",
componentButtonPrimaryBorderDisabled: "#ffffff1a",
componentButtonSecondaryContentDisabled: "#ffffff33",
componentButtonSecondaryBackgroundDisabled: "#3C3E40",
componentButtonSecondaryBorderDisabled: "#ffffff1a",
componentButtonTertiaryContentBase: "#64AEFF",
componentButtonTertiaryContentHover: "#2B90FF",
componentButtonTertiaryContentDisabled: "#ffffff33",
componentButtonTertiaryBackgroundBase: "#0a0a0a00",
componentButtonTertiaryBackgroundHover: "#002650",
componentButtonTertiaryBackgroundActive: "#005FC8",
componentButtonTertiaryBackgroundDisabled: "#0a0a0a00",
componentButtonTertiaryBorderBase: "#64AEFF",
componentButtonTertiaryBorderHover: "#2B90FF",
componentButtonTertiaryBorderActive: "#005FC8",
componentButtonTertiaryBorderDisabled: "#ffffff1a",
componentButtonTransparentContentActive: "#011638",
componentButtonTransparentContentDisabled: "#969DA3",
componentButtonTransparentBackgroundBase: "#ffffff1a",
componentButtonTransparentBackgroundHover: "#ffffff33",
componentButtonTransparentBackgroundActive: "#FFDC2E",
componentButtonTransparentBackgroundDisabled: "#ffffff0d",
componentButtonTransparentBorderBase: "#0a0a0a00",
componentButtonTransparentBorderHover: "#0a0a0a00",
componentButtonTransparentBorderActive: "#0a0a0a00",
componentButtonTransparentBorderDisabled: "#0a0a0a00",
componentButtonDestructiveContentDisabled: "#ffffff33",
componentButtonDestructiveBackgroundHover: "#A40023",
componentButtonDestructiveBackgroundActive: "#83001C",
componentButtonDestructiveBackgroundDisabled: "#3C3E40",
componentButtonDestructiveBorderHover: "#A40023",
componentButtonDestructiveBorderActive: "#83001C",
componentButtonDestructiveBorderDisabled: "#ffffff1a",
componentButtonButtonLinkContentBase: "#64AEFF",
componentButtonButtonLinkContentHover: "#0070EB",
componentButtonButtonLinkContentDisabled: "#3C3E40",
componentButtonButtonLinkBackgroundBase: "#0a0a0a00",
componentButtonButtonLinkBackgroundHover: "#002650",
componentButtonButtonLinkBackgroundDisabled: "#0a0a0a00",
componentButtonButtonLinkBorderBase: "#0a0a0a00",
componentButtonButtonLinkBorderHover: "#0a0a0a00",
componentButtonButtonLinkBorderActive: "#0a0a0a00",
componentButtonButtonLinkBorderDisabled: "#ffffff1a",
componentSelectionControlBackgroundBase: "#2B2F51",
componentSelectionControlBackgroundHover: "#002650",
componentSelectionControlBackgroundActive: "#2B90FF",
componentSelectionControlBackgroundSelected: "#183495",
componentSelectionControlBackgroundSelectedHover: "#183495",
componentSelectionControlBackgroundSelectedActive: "#183495",
componentSelectionControlBackgroundUnselected: "#4D5153",
componentSelectionControlBackgroundDisabled: "#3C3E40",
componentSelectionControlBackgroundSuccess: "#31C268",
componentSelectionControlBackgroundError: "#EA6875",
componentSelectionControlBorderBase: "#272a49",
componentSelectionControlBorderHover: "#64AEFF",
componentSelectionControlBorderActive: "#64AEFF",
componentSelectionControlBorderSelected: "#1F1AFE",
componentSelectionControlBorderSelectedHover: "#1F1AFE",
componentSelectionControlBorderSelectedActive: "#1F1AFE",
componentSelectionControlBorderUnselected: "#4D5153",
componentSelectionControlBorderDisabled: "#ffffff1a",
componentSelectionControlBorderSuccess: "#1BB152",
componentSelectionControlBorderError: "#EB4758",
componentSelectionControlForegroundBase: "#0a0a0a00",
componentSelectionControlForegroundHover: "#0a0a0a00",
componentSelectionControlForegroundActive: "#0a0a0a00",
componentSelectionControlForegroundSelected: "#011638",
componentSelectionControlForegroundSelectedHover: "#011638",
componentSelectionControlForegroundSelectedActive: "#011638",
componentSelectionControlForegroundUnselected: "#0a0a0a00",
componentSelectionControlForegroundDisabled: "#ffffff33",
componentSelectionControlForegroundSuccess: "#011638",
componentSelectionControlForegroundError: "#011638",
componentDataInputBackgroundBase: "#1e2139",
componentDataInputBackgroundLayer: "#2B2F51",
componentDataInputBackgroundHover: "#3C3E40",
componentDataInputBackgroundError: "#40020D",
componentDataInputBackgroundDisabled: "#3C3E40",
componentDataInputBorderBase: "#272a49",
componentDataInputBorderActive: "#004EA3",
componentDataInputBorderError: "#A40023",
componentDataInputBorderDisabled: "#ffffff1a",
componentDataInputContentBase: "#CED4DB",
componentDataInputContentSubtle: "#969DA3",
componentDataInputContentHover: "#99CAFF",
componentDataInputContentError: "#F198A1",
componentDataInputContentDisabled: "#ffffff33",
componentDataInputLabelBase: "#ffffff",
componentDataInputLabelActive: "#99CAFF",
componentDataInputLabelError: "#F198A1",
componentDataInputLabelDisabled: "#ffffff33",
componentDataInputPasswordMeterEmpty: "#6A6F73",
componentDataInputPasswordMeterWeak: "#A40023",
componentDataInputPasswordMeterFair: "#A44800",
componentDataInputPasswordMeterGood: "#004EA3",
componentDataInputPasswordMeterGreat: "#005D23",
componentDataInputIconBase: "#969DA3",
componentDataInputIconActive: "#99CAFF",
componentDataInputIconError: "#F198A1",
componentDataInputIconDisabled: "#ffffff33",
componentPillPrimaryContentBase: "#ffffff",
componentPillPrimaryContentHover: "#ffffff",
componentPillPrimaryContentSelected: "#ffffff",
componentPillPrimaryContentActive: "#ffffff",
componentPillPrimaryContentDisabled: "#0a0a0a",
componentPillPrimaryBackgroundBase: "#ffffff1a",
componentPillPrimaryBackgroundHover: "#ffffff4d",
componentPillPrimaryBackgroundSelected: "#183495",
componentPillPrimaryBackgroundActive: "#183495",
componentPillPrimaryBackgroundDisabled: "#2B2D2E",
componentPillInverseContentHover: "#ffffff",
componentPillInverseContentSelected: "#011638",
componentPillInverseContentActive: "#011638",
componentPillInverseContentDisabled: "#0a0a0a",
componentPillInverseBackgroundBase: "#0a0a0a00",
componentPillInverseBackgroundHover: "#ffffff4d",
componentPillInverseBackgroundSelected: "#64AEFF",
componentPillInverseBackgroundActive: "#2B90FF",
componentPillInverseBackgroundDisabled: "#2B2D2E",
};
export const text = {
themeName: "Picks",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/poker-dark.js
export const text = {
themeName: "Poker Dark",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/poker.js
export const text = {
themeName: "Poker Light",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/racing-dark.js
export const colors = {
brandPrimaryDefault: "#0070EB",
brandPrimaryTint: "#C8E2FF",
brandPrimaryShade: "#004EA3",
contentBrandPrimary: "#0070EB",
backgroundBrand: "#0070EB",
borderBrand: "#0070EB",
};
export const text = {
themeName: "Racing Dark",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/racing.js
export const text = {
themeName: "Racing Light",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/sportsbook-dark.js
export const colors = {
brandPrimaryDefault: "#0070EB",
brandPrimaryTint: "#C8E2FF",
brandPrimaryShade: "#004EA3",
brandGradientDefault: "linear-gradient(125deg, #2B2D2E 0%, #0a0a0a 100%)",
brandGradientColorStopsStart: "#2B2D2E",
brandGradientColorStopsEnd: "#0a0a0a",
contentBrandPrimary: "#0070EB",
backgroundBrand: "#0070EB",
borderBrand: "#0070EB",
};
export const text = {
themeName: "Sportsbook Dark",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/node_modules/@fanduel/formation-tokens/build/js/esm/sportsbook.js
export const text = {
themeName: "Sportsbook Light",
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-theming/build/esm/index.mjs
import{fanduel as w}from"@fanduel/formation-tokens";var e=(i,...t)=>{let r={...i},n=(m,T,f)=>{T[f]!==void 0&&(m[f]={...m[f],...T[f]})};return t.forEach(m=>{Object.keys(m).forEach(T=>{n(r,m,T)})}),r};var o=({borderWidths:i,borderStyles:t,breakpoints:r,colors:n,fonts:m,fontSizes:T,fontWeights:f,letterSpacings:C,lineHeights:N,nativeShadows:_,radii:A,shadows:z,sizes:H,space:j,text:G,textCase:W,textDecoration:P,transitions:L,zIndices:M})=>({borderWidths:i,borderStyles:t,breakpoints:Object.values(r).map(B=>`${B}px`),breakpointNames:Object.keys(r),colors:n,fonts:m,fontSizes:T,fontWeights:f,letterSpacings:C,lineHeights:N,nativeShadows:_,radii:A,shadows:z,sizes:H,space:j,text:G,textCase:W,textDecoration:P,transitions:L,zIndices:M});var K=e(w),k=o(K);import{fanduel as Z,fanduelDark as X}from"@fanduel/formation-tokens";var v=e(Z,X),c=o(v);import{fanduel as Y,sportsbook as $}from"@fanduel/formation-tokens";var q=e(Y,$),h=o(q);import{fanduel as J,fanduelDark as Q,sportsbookDark as U}from"@fanduel/formation-tokens";var V=e(J,Q,U),g=o(V);import{fanduel as ee,casino as oe}from"@fanduel/formation-tokens";var re=e(ee,oe),S=o(re);import{fanduel as ne,fanduelDark as te,casinoDark as me}from"@fanduel/formation-tokens";var se=e(ne,te,me),d=o(se);import{fanduel as ae,moheganSun as ie}from"@fanduel/formation-tokens";var Te=e(ae,ie),x=o(Te);import{fanduel as fe,lottery as pe}from"@fanduel/formation-tokens";var ke=e(fe,pe),F=o(ke);import{fanduel as ce,fantasy as he}from"@fanduel/formation-tokens";var ge=e(ce,he),D=o(ge);import{fanduel as Se,fanduelDark as de,fantasyDark as xe}from"@fanduel/formation-tokens";var Fe=e(Se,de,xe),u=o(Fe);import{fanduel as De,picks as ue}from"@fanduel/formation-tokens";var le=e(De,ue),l=o(le);import{fanduel as Ee,poker as Oe}from"@fanduel/formation-tokens";var be=e(Ee,Oe),E=o(be);import{fanduel as ye,fanduelDark as Ie,pokerDark as Re}from"@fanduel/formation-tokens";var Ce=e(ye,Ie,Re),O=o(Ce);import{fanduel as Ne,racing as _e}from"@fanduel/formation-tokens";var Ae=e(Ne,_e),b=o(Ae);import{fanduel as ze,fanduelDark as He,racingDark as je}from"@fanduel/formation-tokens";var Ge=e(ze,He,je),y=o(Ge);import{fanduel as We,faceoff as Pe}from"@fanduel/formation-tokens";var Le=e(We,Pe),I=o(Le);import{fanduel as Me,fanduelDark as Be,faceoffDark as we}from"@fanduel/formation-tokens";var Ke=e(Me,Be,we),R=o(Ke);var p={fanduel:k,fanduelDark:c,sportsbook:h,sportsbookDark:g,casino:S,casinoDark:d,moheganSun:x,lottery:F,fantasy:D,fantasyDark:u,picks:l,poker:E,pokerDark:O,racing:b,racingDark:y,faceoff:I,faceoffDark:R};var s=p.fanduel,a=(i,t)=>Object.keys(i).reduce((r,n)=>((!t||!t.test(n))&&(r[n]=n),r),{}),Ze=a(s.borderWidths),Xe=a(s.borderStyles),ve=a(s.colors),Ye=a(s.fonts),$e=a(s.fontSizes),qe=a(s.fontWeights),Je=a(s.letterSpacings),Qe=a(s.lineHeights),Ue=a(s.radii),Ve=a(s.shadows),eo=a(s.sizes),oo=a(s.space),ro=a(s.textCase),no=a(s.textDecoration),to=a(s.transitions),mo=a(s.zIndices);var so=(i,t)=>{let r={...i};if(typeof t.baseFontSize=="number"){let n=t.baseFontSize;r.fontSizes=Object.fromEntries(Object.entries(r.fontSizes).map(([m,T])=>[m,typeof T=="number"?`${T/n}rem`:T]))}if(t.fontMap){let n=t.fontMap;r.fonts=Object.fromEntries(Object.entries(r.fonts).map(([m,T])=>[m,n[T]||T]))}return r},ao=(i,t={})=>{let r={...i};return Object.keys(i).forEach(n=>{let m=i[n];r[n]=so(m,t)}),r};var io=(i,t)=>{let r={...i};return Object.keys(t).forEach(n=>{if(Object.prototype.hasOwnProperty.call(i,n)){let m=n;r[m]={...i[m],...t[n]}}else r[n]=t[n]}),r};export{Xe as BORDER_STYLES,Ze as BORDER_WIDTHS,ve as COLORS,Ye as FONTS,$e as FONT_SIZES,qe as FONT_WEIGHTS,Je as LETTER_SPACINGS,Qe as LINE_HEIGHTS,Ue as RADII,Ve as SHADOWS,eo as SIZING,oo as SPACING,ro as TEXT_CASE,no as TEXT_DECORATION,p as THEMES,to as TRANSITIONS,mo as Z_INDICES,ao as configureThemes,io as extendTheme};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-shared-utils/build/esm/index.mjs
var $=Object.defineProperty;var oo=(t,e)=>{for(var n in e)$(t,n,{get:e[n],enumerable:!0})};var to=(t="")=>{let e=new Date().getTime(),n=Math.floor(Math.random()*1e6);return[t,e,n].filter(Boolean).join("_")};var eo=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: hover)").matches;var H={};oo(H,{convertFlexValue:()=>no,getFallbackValue:()=>c,getIconSize:()=>ro});var no=t=>{switch(t){case"start":return"flex-start";case"end":return"flex-end";default:return t}},ro=t=>({xs:8,sm:16,md:20,lg:24,xl:32,xxl:48})[t],c=(t,e)=>{for(let n of t)if(n!=null)return n;return e};import{BORDER_STYLES as ao,BORDER_WIDTHS as co,COLORS as p,RADII as io,SPACING as lo}from"@fanduel/formation-theming";var P={base:{background:p.systemImportantBackgroundDefault,border:p.systemImportantBorderDefault,content:p.systemImportantContentOnDefault},disabled:{background:p.systemImportantBackgroundSubtle,border:p.systemImportantBackgroundSubtle,content:p.contentDisabled}},L=(t,e)=>{let n=t.disabled?"disabled":"base";return{borderColor:c([e?.border?.[n]],P[n].border),colour:c([e?.background?.[n]],P[n].background),contentColour:c([e?.content?.[n]],P[n].content),borderStyle:ao.borderStyleSolidStyle,borderWidth:co.borderWidthDefault,cornerRadius:io.borderRadiusCircle,size:16,spacing:lo.space1}};import{BORDER_STYLES as so,BORDER_WIDTHS as uo,COLORS as o,RADII as po,SPACING as d}from"@fanduel/formation-theming";var mo={primary:{base:{color:o.componentButtonPrimaryContentBase,background:o.componentButtonPrimaryBackgroundBase,borderColor:o.componentButtonPrimaryBorderBase},hover:{color:o.componentButtonPrimaryContentHover,background:o.componentButtonPrimaryBackgroundHover,borderColor:o.componentButtonPrimaryBorderHover},focus:{color:o.componentButtonPrimaryContentHover,background:o.componentButtonPrimaryBackgroundHover,borderColor:o.componentButtonPrimaryBorderHover},hoverFocus:{color:o.componentButtonPrimaryContentHover,background:o.componentButtonPrimaryBackgroundHover,borderColor:o.componentButtonPrimaryBorderHover},active:{color:o.componentButtonPrimaryContentActive,background:o.componentButtonPrimaryBackgroundActive,borderColor:o.componentButtonPrimaryBorderActive},disabled:{color:o.componentButtonPrimaryContentDisabled,background:o.componentButtonPrimaryBackgroundDisabled,borderColor:o.componentButtonPrimaryBorderDisabled},loading:{color:o.componentButtonPrimaryContentDisabled,background:o.componentButtonPrimaryBackgroundDisabled,borderColor:o.componentButtonPrimaryBorderDisabled}},secondary:{base:{color:o.componentButtonSecondaryContentBase,background:o.componentButtonSecondaryBackgroundBase,borderColor:o.componentButtonSecondaryBorderBase},hover:{color:o.componentButtonSecondaryContentHover,background:o.componentButtonSecondaryBackgroundHover,borderColor:o.componentButtonSecondaryBorderHover},focus:{color:o.componentButtonSecondaryContentHover,background:o.componentButtonSecondaryBackgroundHover,borderColor:o.componentButtonSecondaryBorderHover},hoverFocus:{color:o.componentButtonSecondaryContentHover,background:o.componentButtonSecondaryBackgroundHover,borderColor:o.componentButtonSecondaryBorderHover},active:{color:o.componentButtonSecondaryContentActive,background:o.componentButtonSecondaryBackgroundActive,borderColor:o.componentButtonSecondaryBorderActive},disabled:{color:o.componentButtonSecondaryContentDisabled,background:o.componentButtonSecondaryBackgroundDisabled,borderColor:o.componentButtonSecondaryBorderDisabled},loading:{color:o.componentButtonSecondaryContentDisabled,background:o.componentButtonSecondaryBackgroundDisabled,borderColor:o.componentButtonSecondaryBorderDisabled}},tertiary:{base:{color:o.componentButtonTertiaryContentBase,background:o.componentButtonTertiaryBackgroundBase,borderColor:o.componentButtonTertiaryBorderBase},hover:{color:o.componentButtonTertiaryContentHover,background:o.componentButtonTertiaryBackgroundHover,borderColor:o.componentButtonTertiaryBorderHover},focus:{color:o.componentButtonTertiaryContentHover,background:o.componentButtonTertiaryBackgroundHover,borderColor:o.componentButtonTertiaryBorderHover},hoverFocus:{color:o.componentButtonTertiaryContentHover,background:o.componentButtonTertiaryBackgroundHover,borderColor:o.componentButtonTertiaryBorderHover},active:{color:o.componentButtonTertiaryContentActive,background:o.componentButtonTertiaryBackgroundActive,borderColor:o.componentButtonTertiaryBorderActive},disabled:{color:o.componentButtonTertiaryContentDisabled,background:o.componentButtonTertiaryBackgroundDisabled,borderColor:o.componentButtonTertiaryBorderDisabled},loading:{color:o.componentButtonTertiaryContentDisabled,background:o.componentButtonTertiaryBackgroundDisabled,borderColor:o.componentButtonTertiaryBorderDisabled}},transparent:{base:{color:o.componentButtonTransparentContentBase,background:o.componentButtonTransparentBackgroundBase,borderColor:o.componentButtonTransparentBorderBase},hover:{color:o.componentButtonTransparentContentHover,background:o.componentButtonTransparentBackgroundHover,borderColor:o.componentButtonTransparentBorderHover},focus:{color:o.componentButtonTransparentContentHover,background:o.componentButtonTransparentBackgroundHover,borderColor:o.componentButtonTransparentBorderHover},hoverFocus:{color:o.componentButtonTransparentContentHover,background:o.componentButtonTransparentBackgroundHover,borderColor:o.componentButtonTransparentBorderHover},active:{color:o.componentButtonTransparentContentActive,background:o.componentButtonTransparentBackgroundActive,borderColor:o.componentButtonTransparentBorderActive},disabled:{color:o.componentButtonTransparentContentDisabled,background:o.componentButtonTransparentBackgroundDisabled,borderColor:o.componentButtonTransparentBorderDisabled},loading:{color:o.componentButtonTransparentContentDisabled,background:o.componentButtonTransparentBackgroundDisabled,borderColor:o.componentButtonTransparentBorderDisabled}},link:{base:{color:o.componentButtonButtonLinkContentBase,background:o.componentButtonButtonLinkBackgroundBase,borderColor:o.componentButtonButtonLinkBorderBase},hover:{color:o.componentButtonButtonLinkContentHover,background:o.componentButtonButtonLinkBackgroundHover,borderColor:o.componentButtonButtonLinkBorderHover},focus:{color:o.componentButtonButtonLinkContentHover,background:o.componentButtonButtonLinkBackgroundHover,borderColor:o.componentButtonButtonLinkBorderHover},hoverFocus:{color:o.componentButtonButtonLinkContentHover,background:o.componentButtonButtonLinkBackgroundHover,borderColor:o.componentButtonButtonLinkBorderHover},active:{color:o.componentButtonButtonLinkContentActive,background:o.componentButtonButtonLinkBackgroundActive,borderColor:o.componentButtonButtonLinkBorderActive},disabled:{color:o.componentButtonButtonLinkContentDisabled,background:o.componentButtonButtonLinkBackgroundDisabled,borderColor:o.componentButtonButtonLinkBorderDisabled},loading:{color:o.componentButtonButtonLinkContentDisabled,background:o.componentButtonButtonLinkBackgroundDisabled,borderColor:o.componentButtonButtonLinkBorderDisabled}},destructive:{base:{color:o.componentButtonDestructiveContentBase,background:o.componentButtonDestructiveBackgroundBase,borderColor:o.componentButtonDestructiveBorderBase},hover:{color:o.componentButtonDestructiveContentHover,background:o.componentButtonDestructiveBackgroundHover,borderColor:o.componentButtonDestructiveBorderHover},focus:{color:o.componentButtonDestructiveContentHover,background:o.componentButtonDestructiveBackgroundHover,borderColor:o.componentButtonDestructiveBorderHover},hoverFocus:{color:o.componentButtonDestructiveContentHover,background:o.componentButtonDestructiveBackgroundHover,borderColor:o.componentButtonDestructiveBorderHover},active:{color:o.componentButtonDestructiveContentActive,background:o.componentButtonDestructiveBackgroundActive,borderColor:o.componentButtonDestructiveBorderActive},disabled:{color:o.componentButtonDestructiveContentDisabled,background:o.componentButtonDestructiveBackgroundDisabled,borderColor:o.componentButtonDestructiveBorderDisabled},loading:{color:o.componentButtonDestructiveContentDisabled,background:o.componentButtonDestructiveBackgroundDisabled,borderColor:o.componentButtonDestructiveBorderDisabled}}},go=t=>t.disabled?"disabled":t.loading?"loading":t.active?"active":t.hover&&t.focus?"hoverFocus":t.hover?"hover":t.focus?"focus":"base",A=(t,e)=>{let n=go(t),l=mo[t.variant][n];return{borderColor:c([e?.border?.[n]],l.borderColor),borderStyle:so.borderStyleSolidStyle,borderWidth:uo.borderWidthDefault,colour:c([e?.background?.[n]],l.background),contentColour:c([e?.content?.[n]],l.color),contentSpacing:{x:t.size==="small"?d.space1:d.space2,y:d.space0},cornerRadius:c([e?.cornerRadius],po.borderRadiusDefault),spacing:{x:t.size==="small"?d.space3:d.space4,y:t.description?d.space1:t.size==="small"?d.space2:d.space3}}};var b={default:{borderColor:"componentSelectionControlBorderBase",background:"componentSelectionControlBackgroundBase",iconColor:"componentSelectionControlBackgroundBase"},checked:{borderColor:"componentSelectionControlBorderSelected",background:"componentSelectionControlBackgroundSelected",iconColor:"componentSelectionControlForegroundSelected"},hover:{borderColor:"componentSelectionControlBorderHover",background:"componentSelectionControlBackgroundHover",iconColor:"componentSelectionControlForegroundHover"},disabled:{borderColor:"componentSelectionControlBorderDisabled",background:"componentSelectionControlBackgroundDisabled",iconColor:"componentSelectionControlForegroundDisabled"},hoverChecked:{borderColor:"componentSelectionControlBorderSelectedHover",background:"componentSelectionControlBackgroundSelectedHover",iconColor:"componentSelectionControlForegroundSelectedHover"}},k={lg:{width:22,height:22,...b},md:{width:18,height:18,...b},sm:{width:14,height:14,...b},xs:{width:10,height:10,...b}},R=t=>k[t]||k.md;var B={xl:{labelFontSize:"md",valueFontSize:"xl"},lg:{labelFontSize:"md",valueFontSize:"lg"},md:{labelFontSize:"md",valueFontSize:"md"},sm:{labelFontSize:"sm",valueFontSize:"md"},xs:{labelFontSize:"sm",valueFontSize:"sm"}};function W(t){return B[t]||B.md}var y={base:{backgroundColor:"componentDataInputBackgroundBase",borderColor:"componentDataInputBorderBase",borderWidth:"borderWidth010",borderRadius:"borderRadius020",label:"componentDataInputLabelBase",optional:"componentDataInputContentSubtle",typography:"bodyLargeRegular",content:"componentDataInputContentBase",placeholder:"componentDataInputContentSubtle",helperText:{backgroundColor:"componentDataInputBackgroundLayer",content:"componentDataInputContentBase"}},active:{backgroundColor:"componentDataInputBackgroundBase",borderColor:"componentDataInputBorderActive",borderWidth:"borderWidth010",borderRadius:"borderRadius020",label:"componentDataInputLabelActive",optional:"componentDataInputContentSubtle",typography:"bodyLargeRegular",content:"componentDataInputContentBase",placeholder:"componentDataInputContentSubtle",helperText:{backgroundColor:"componentDataInputBackgroundLayer",content:"componentDataInputContentBase"}},disabled:{backgroundColor:"componentDataInputBackgroundDisabled",borderColor:"componentDataInputBorderDisabled",borderWidth:"borderWidth010",borderRadius:"borderRadius020",label:"componentDataInputLabelDisabled",optional:"componentDataInputContentDisabled",typography:"bodyLargeRegular",content:"componentDataInputContentDisabled",placeholder:"componentDataInputContentDisabled",helperText:{backgroundColor:"componentInputBackgroundDisabled",content:"componentDataInputContentDisabled"}},error:{backgroundColor:"componentDataInputBackgroundBase",borderColor:"componentDataInputBorderError",borderWidth:"borderWidth010",borderRadius:"borderRadius020",label:"componentDataInputLabelError",optional:"componentDataInputContentSubtle",typography:"bodyLargeRegular",content:"componentDataInputContentBase",placeholder:"componentDataInputContentSubtle",helperText:{backgroundColor:"componentDataInputBackgroundLayer",content:"componentDataInputContentBase"}}},N=t=>y[t]||y.base;var C={positive:{background:"systemPositiveBackgroundDefault",content:"systemPositiveContentOnDefault",link:"systemPositiveLinkOnDefault"},important:{background:"systemImportantBackgroundDefault",content:"systemImportantContentOnDefault",link:"systemImportantLinkOnDefault"},info:{background:"systemInfoBackgroundDefault",content:"systemInfoContentOnDefault",link:"systemInfoLinkOnDefault"},alert:{background:"systemAlertBackgroundDefault",content:"systemAlertContentOnDefault",link:"systemAlertLinkOnDefault"},neutral:{background:"systemNeutralBackgroundDefault",content:"systemNeutralContentOnDefault",link:"systemNeutralLinkOnDefault"},insight:{background:"systemWarningBackgroundDefault",content:"systemWarningContentOnDefault",link:"systemWarningLinkOnDefault"},verification:{background:"systemVerificationBackgroundDefault",content:"systemVerificationContentOnDefault",link:"systemVerificationLinkOnDefault"}};function F(t){return C[t]??C.neutral}var f={positive:{background:"systemPositiveBackgroundSubtle",border:"systemPositiveBorderDefault",content:"systemPositiveContentOnSubtle",icon:"systemPositiveContentAccent",link:"systemPositiveLinkOnSubtle"},important:{background:"systemImportantBackgroundSubtle",border:"systemImportantBorderDefault",content:"systemImportantContentOnSubtle",icon:"systemImportantContentAccent",link:"systemImportantLinkOnSubtle"},info:{background:"systemInfoBackgroundSubtle",border:"systemInfoBorderDefault",content:"systemInfoContentOnSubtle",icon:"systemInfoContentAccent",link:"systemInfoLinkOnSubtle"},alert:{background:"systemAlertBackgroundSubtle",border:"systemAlertBorderDefault",content:"systemAlertContentOnSubtle",icon:"systemAlertContentAccent",link:"systemAlertLinkOnSubtle"},neutral:{background:"systemNeutralBackgroundSubtle",border:"systemNeutralBorderDefault",content:"systemNeutralContentOnSubtle",icon:"systemNeutralContentAccent",link:"systemNeutralLinkOnSubtle"},insight:{background:"systemWarningBackgroundSubtle",border:"systemWarningBorderDefault",content:"systemWarningContentOnSubtle",icon:"systemWarningContentAccent",link:"systemWarningLinkOnSubtle"},verification:{background:"systemVerificationBackgroundSubtle",border:"systemVerificationBorderDefault",content:"systemVerificationContentOnSubtle",icon:"systemVerificationContentAccent",link:"systemVerificationLinkOnSubtle"}};function z(t){return f[t]??f.neutral}var S={positive:{background:"systemPositiveBackgroundSubtle",content:"systemPositiveContentOnSubtle",icon:"systemPositiveContentAccent"},important:{background:"systemImportantBackgroundSubtle",content:"systemImportantContentOnSubtle",icon:"systemImportantContentAccent"},info:{background:"systemInfoBackgroundSubtle",content:"systemInfoContentOnSubtle",icon:"systemInfoContentAccent"},alert:{background:"systemAlertBackgroundSubtle",content:"systemAlertContentOnSubtle",icon:"systemAlertContentAccent"},neutral:{background:"systemNeutralBackgroundSubtle",content:"systemNeutralContentOnSubtle",icon:"systemNeutralContentAccent"},insight:{background:"systemWarningBackgroundSubtle",content:"systemWarningContentOnSubtle",icon:"systemWarningContentAccent"},verification:{background:"systemVerificationBackgroundSubtle",content:"systemVerificationContentOnSubtle",icon:"systemVerificationContentAccent"}};function V(t){return S[t]??S.neutral}var v={positive:{background:"systemPositiveBackgroundDefault",content:"systemPositiveContentOnDefault",action:"systemPositiveLinkOnDefault",icon:"systemPositiveContentOnDefault"},important:{background:"systemImportantBackgroundDefault",content:"systemImportantContentOnDefault",action:"systemImportantLinkOnDefault",icon:"systemImportantContentOnDefault"},info:{background:"systemInfoBackgroundDefault",content:"systemInfoContentOnDefault",action:"systemInfoLinkOnDefault",icon:"systemInfoContentOnDefault"},alert:{background:"systemAlertBackgroundDefault",content:"systemAlertContentOnDefault",action:"systemAlertLinkOnDefault",icon:"systemAlertContentOnDefault"},neutral:{background:"systemNeutralBackgroundDefault",content:"systemNeutralContentOnDefault",action:"systemNeutralLinkOnDefault",icon:"systemNeutralContentOnDefault"},insight:{background:"systemWarningBackgroundDefault",content:"systemWarningContentOnDefault",action:"systemWarningLinkOnDefault",icon:"systemWarningContentOnDefault"},verification:{background:"systemVerificationBackgroundDefault",content:"systemVerificationContentOnDefault",action:"systemVerificationLinkOnDefault",icon:"systemVerificationContentOnDefault"}};function w(t){return v[t]??v.neutral}import{COLORS as a,RADII as bo,SPACING as D}from"@fanduel/formation-theming";var s={regular:{base:{colour:a.componentPillPrimaryBackgroundBase,contentColour:a.componentPillPrimaryContentBase},selected:{colour:a.componentPillPrimaryBackgroundSelected,contentColour:a.componentPillPrimaryContentSelected},disabled:{colour:a.componentPillPrimaryBackgroundDisabled,contentColour:a.componentPillPrimaryContentDisabled},hovered:{colour:a.componentPillPrimaryBackgroundHover,contentColour:a.componentPillPrimaryContentHover},selectedHovered:{colour:a.componentPillPrimaryBackgroundActive,contentColour:a.componentPillPrimaryContentActive}},inverse:{base:{colour:a.componentPillInverseBackgroundBase,contentColour:a.componentPillInverseContentBase},selected:{colour:a.componentPillInverseBackgroundSelected,contentColour:a.componentPillInverseContentSelected},disabled:{colour:a.componentPillInverseBackgroundDisabled,contentColour:a.componentPillInverseContentDisabled},hovered:{colour:a.componentPillInverseBackgroundHover,contentColour:a.componentPillInverseContentHover},selectedHovered:{colour:a.componentPillInverseBackgroundActive,contentColour:a.componentPillInverseContentActive}}},G=t=>{let e=t.inverse?"inverse":"regular",n={colour:s[e].base.colour,contentColour:s[e].base.contentColour};return t.selected&&(n.colour=s[e].selected.colour,n.contentColour=s[e].selected.contentColour),t.hovered&&(n.colour=s[e].hovered.colour,n.contentColour=s[e].hovered.contentColour),t.hovered&&t.selected&&(n.colour=s[e].selectedHovered.colour,n.contentColour=s[e].selectedHovered.contentColour),t.disabled&&(n.colour=s[e].disabled.colour,n.contentColour=s[e].disabled.contentColour),{...n,contentSpacing:t.large?D.space2:D.space1,cornerRadius:bo.borderRadiusCircle,countSpacingOffset:-4,height:t.large?36:32,iconSize:t.large?"md":"sm",labelSize:t.large?"lg":"md",spacing:t.large?D.space4:D.space3}};var T={info:{fill:"systemInfoBackgroundDefault"},positive:{fill:"systemPositiveBackgroundDefault"},warning:{fill:"systemWarningBackgroundDefault"},important:{fill:"systemImportantBackgroundDefault"}};function E(t){return T[t]||T.positive}import{COLORS as i,SPACING as m}from"@fanduel/formation-theming";var u={default:{base:{activeIndicatorColour:"transparent",descriptionColour:i.contentSubtle,labelColour:i.contentStrong},active:{activeIndicatorColour:i.linkDefaultBase,descriptionColour:i.contentSubtle,labelColour:i.linkDefaultBase},hover:{activeIndicatorColour:i.linkDefaultHover,descriptionColour:i.contentSubtle,labelColour:i.linkDefaultHover}},inverse:{base:{activeIndicatorColour:"transparent",descriptionColour:i.contentOnDark,labelColour:i.contentOnDark},active:{activeIndicatorColour:i.contentOnDark,descriptionColour:i.contentOnDark,labelColour:i.contentOnDark},hover:{activeIndicatorColour:i.contentOnDark,descriptionColour:i.contentOnDark,labelColour:i.contentOnDark}}};function X(t){let e=t.inverse?"inverse":"default",n={activeIndicatorColour:u[e].base.activeIndicatorColour,backgroundColour:"transparent",borderColour:i.borderDefault,descriptionColour:u[e].base.descriptionColour,labelColour:u[e].base.labelColour};return t.active&&(n.activeIndicatorColour=u[e].active.activeIndicatorColour,n.descriptionColour=u[e].active.descriptionColour,n.labelColour=u[e].active.labelColour),t.hovered&&(n.activeIndicatorColour=u[e].hover.activeIndicatorColour,n.descriptionColour=u[e].hover.descriptionColour,n.labelColour=u[e].hover.labelColour),{...n,borderHeight:1,containerPad:t.fixedWidth?m.space0:m.space4,gap:t.fixedWidth?m.space0:m.space6,labelPad:t.fixedWidth?m.space3:m.space0}}import{BORDER_STYLES as ko,BORDER_WIDTHS as Bo,COLORS as r,RADII as yo,SPACING as x}from"@fanduel/formation-theming";var M={neutral:{fill:{colour:r.systemNeutralBackgroundDefault,contentColor:r.systemNeutralContentOnDefault,borderColor:r.systemNeutralBackgroundDefault},outline:{colour:r.systemNeutralBackgroundSubtle,contentColor:r.systemNeutralContentOnSubtle,borderColor:r.systemNeutralBackgroundDefault},subtle:{colour:r.systemNeutralBackgroundSubtle,contentColor:r.systemNeutralContentOnSubtle,borderColor:r.systemNeutralBackgroundSubtle}},positive:{fill:{colour:r.systemPositiveBackgroundDefault,contentColor:r.systemPositiveContentOnDefault,borderColor:r.systemPositiveBackgroundDefault},outline:{colour:r.systemPositiveBackgroundSubtle,contentColor:r.systemPositiveContentOnSubtle,borderColor:r.systemPositiveBackgroundDefault},subtle:{colour:r.systemPositiveBackgroundSubtle,contentColor:r.systemPositiveContentOnSubtle,borderColor:r.systemPositiveBackgroundSubtle}},important:{fill:{colour:r.systemImportantBackgroundDefault,contentColor:r.systemImportantContentOnDefault,borderColor:r.systemImportantBackgroundDefault},outline:{colour:r.systemImportantBackgroundSubtle,contentColor:r.systemImportantContentOnSubtle,borderColor:r.systemImportantBackgroundDefault},subtle:{colour:r.systemImportantBackgroundSubtle,contentColor:r.systemImportantContentOnSubtle,borderColor:r.systemImportantBackgroundSubtle}},info:{fill:{colour:r.systemInfoBackgroundDefault,contentColor:r.systemInfoContentOnDefault,borderColor:r.systemInfoBackgroundDefault},outline:{colour:r.systemInfoBackgroundSubtle,contentColor:r.systemInfoContentOnSubtle,borderColor:r.systemInfoBackgroundDefault},subtle:{colour:r.systemInfoBackgroundSubtle,contentColor:r.systemInfoContentOnSubtle,borderColor:r.systemInfoBackgroundSubtle}},alert:{fill:{colour:r.systemAlertBackgroundDefault,contentColor:r.systemAlertContentOnDefault,borderColor:r.systemAlertBackgroundDefault},outline:{colour:r.systemAlertBackgroundSubtle,contentColor:r.systemAlertContentOnSubtle,borderColor:r.systemAlertBackgroundDefault},subtle:{colour:r.systemAlertBackgroundSubtle,contentColor:r.systemAlertContentOnSubtle,borderColor:r.systemAlertBackgroundSubtle}},insight:{fill:{colour:r.systemWarningBackgroundDefault,contentColor:r.systemWarningContentOnDefault,borderColor:r.systemWarningBackgroundDefault},outline:{colour:r.systemWarningBackgroundSubtle,contentColor:r.systemWarningContentOnSubtle,borderColor:r.systemWarningBackgroundDefault},subtle:{colour:r.systemWarningBackgroundSubtle,contentColor:r.systemWarningContentOnSubtle,borderColor:r.systemWarningBackgroundSubtle}}},_=(t,e)=>({borderColor:c([e?.borderColor],M[t.intent][t.variant].borderColor),borderStyle:c([e?.borderStyle],ko.borderStyleSolidStyle),borderWidth:c([e?.borderWidth],Bo.borderWidthDefault),colour:c([e?.colour],M[t.intent][t.variant].colour),contentColour:c([e?.contentColour],M[t.intent][t.variant].contentColor),contentSpacing:x.space1,cornerRadius:c([e?.cornerRadius],yo.borderRadius010),height:t.size==="lg"?24:20,spacing:t.size==="lg"?x.space2:x.space1});var h={default:{borderColor:"componentSelectionControlBorderBase",background:"componentSelectionControlBackgroundBase"},selected:{borderColor:"componentSelectionControlBorderSelected",background:"componentSelectionControlForegroundSelected"},disabled:{borderColor:"componentSelectionControlBorderDisabled",background:"componentSelectionControlBackgroundDisabled"},selectedDisabled:{borderColor:"componentSelectionControlBorderDisabled",background:"componentSelectionControlForegroundDisabled"},focus:{borderColor:"componentSelectionControlBorderHover",background:"componentSelectionControlBackgroundHover"},selectedFocus:{borderColor:"componentSelectionControlBorderSelectedHover",background:"componentSelectionControlForegroundSelectedHover"}},I={lg:{width:22,height:22,...h},md:{width:18,height:18,...h},sm:{width:14,height:14,...h},xs:{width:10,height:10,...h}},U=t=>I[t]||I.md;var O={default:{background:"componentSelectionControlBackgroundUnselected",iconColor:"contentOnLight"},checked:{background:"componentSelectionControlBackgroundSuccess",iconColor:"contentOnDark"},disabled:{background:"componentSelectionControlBackgroundDisabled",iconColor:"contentOnLight"},hover:{background:"componentSelectionControlBackgroundUnselected",iconColor:"contentOnLight"},focus:{background:"componentSelectionControlBackgroundUnselected",iconColor:"contentOnLight"}},j=()=>O;var q=({size:t="md",strikethrough:e,strong:n})=>{let l={xs:"XSmall",sm:"Small",md:"Medium",lg:"Large",xl:"XLarge"},g="body";return g+=l[t],g+=n?"Strong":"Regular",g+=e?"Strikethrough":"",g},J=({size:t="md",strong:e})=>{let n={xs:"XSmall",sm:"Small",md:"Medium",lg:"Large",xl:"XLarge"},l="button";return l+=n[t],l+=e?"Strong":"Regular",l},K=({size:t="md"})=>{let e={xs:"XSmall",sm:"Small",md:"Medium",lg:"Large",xl:"XLarge",xxl:"XxLarge"},n="heading";return n+=e[t],n},Y=({size:t="md"})=>{let e={sm:"Small",md:"Medium",lg:"Large",xl:"XLarge",xxl:"XxLarge"},n="jumbo";return n+=e[t],n},Z=({size:t="md"})=>{let e={xs:"XSmall",sm:"Small",md:"Medium",lg:"Large",xl:"XLarge"},n="label";return n+=e[t],n},Q=({size:t="md"})=>{let e={sm:"Small",md:"Medium"},n="metadata";return n+=e[t],n};var Co={dataChunk:B,fixedBanner:C,floatingBanner:f,radioButton:I,switch:O,checkbox:k,inlineMessage:S,input:y,progressBar:T,toast:v},fo={checkbox:R,dataChunk:W,fixedBanner:F,floatingBanner:z,inlineMessage:V,input:N,progressBar:E,radioButton:U,switch:j,toast:w,typographyBody:q,typographyButton:J,typographyHeader:K,typographyJumbo:Y,typographyLabel:Z,typographyMeta:Q},So={badge:L,button:A,pill:G,tabs:X,tag:_};export{to as generateUniqueId,eo as isHoverableDevice,So as styleResolvers,H as styleUtils,fo as tokenMappers,Co as tokenMaps};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-react-icons/build/esm/index.mjs
import{jsx as M5,jsxs as k6}from"react/jsx-runtime";var B6=C=>k6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[M5("title",{children:"101"}),M5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5V11H9V5H7ZM6 3H10C10.5523 3 11 3.44772 11 4V12C11 12.5523 10.5523 13 10 13H6C5.44772 13 5 12.5523 5 12V4C5 3.44772 5.44772 3 6 3Z",fill:"#41E878"}),M5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 5H12V3H15V13H13V5Z",fill:"#41E878"}),M5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5H1V3H4V13H2V5Z",fill:"#41E878"})]});import{jsx as R,jsxs as F6}from"react/jsx-runtime";var E6=C=>F6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[R("title",{children:"Baseball"}),R("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#EED1B3"}),R("path",{d:"M13.4723 2.16437C13.4558 2.21184 13.4318 2.25761 13.4 2.29997C10.8667 5.67775 10.8667 10.3222 13.4 13.7C13.4318 13.7423 13.4558 13.7881 13.4723 13.8355C13.2448 14.049 13.0048 14.2492 12.7536 14.4352C12.6953 14.4022 12.6427 14.3569 12.6 14.3C9.80001 10.5666 9.80001 5.4333 12.6 1.69997C12.6427 1.64298 12.6953 1.59771 12.7536 1.56476C13.0049 1.75067 13.2448 1.95094 13.4723 2.16437Z",fill:"#2D120B"}),R("path",{d:"M3.24641 1.56476C3.30469 1.59771 3.35726 1.64298 3.40001 1.69997C6.20001 5.4333 6.20001 10.5666 3.40001 14.3C3.35728 14.3569 3.30472 14.4022 3.24646 14.4352C2.99519 14.2492 2.75519 14.049 2.52768 13.8355C2.54422 13.7881 2.56824 13.7423 2.60001 13.7C5.13334 10.3222 5.13334 5.67775 2.60001 2.29997C2.56823 2.25761 2.5442 2.21184 2.52766 2.16437C2.75517 1.95094 2.99515 1.75067 3.24641 1.56476Z",fill:"#2D120B"}),R("path",{d:"M5.62126 4.98507C5.88916 4.91809 6.05204 4.64663 5.98507 4.37873C5.91809 4.11083 5.64663 3.94795 5.37873 4.01493L3.37873 4.51493C3.11083 4.5819 2.94795 4.85337 3.01493 5.12126C3.0819 5.38916 3.35337 5.55204 3.62126 5.48507L5.62126 4.98507Z",fill:"#9F2424"}),R("path",{d:"M10.3787 4.98507C10.1108 4.91809 9.94796 4.64663 10.0149 4.37873C10.0819 4.11083 10.3534 3.94795 10.6213 4.01493L12.6213 4.51493C12.8892 4.5819 13.052 4.85337 12.9851 5.12126C12.9181 5.38916 12.6466 5.55204 12.3787 5.48507L10.3787 4.98507Z",fill:"#9F2424"}),R("path",{d:"M3.5 8C3.5 7.72386 3.72386 7.5 4 7.5H6C6.27614 7.5 6.5 7.72386 6.5 8C6.5 8.27614 6.27614 8.5 6 8.5H4C3.72386 8.5 3.5 8.27614 3.5 8Z",fill:"#9F2424"}),R("path",{d:"M10 7.5C9.72386 7.5 9.5 7.72386 9.5 8C9.5 8.27614 9.72386 8.5 10 8.5H12C12.2761 8.5 12.5 8.27614 12.5 8C12.5 7.72386 12.2761 7.5 12 7.5H10Z",fill:"#9F2424"}),R("path",{d:"M3.01493 10.8787C3.0819 10.6108 3.35337 10.448 3.62126 10.5149L5.62126 11.0149C5.88916 11.0819 6.05204 11.3534 5.98507 11.6213C5.91809 11.8892 5.64663 12.052 5.37873 11.9851L3.37873 11.4851C3.11083 11.4181 2.94795 11.1466 3.01493 10.8787Z",fill:"#9F2424"}),R("path",{d:"M12.3787 10.5149C12.6466 10.448 12.9181 10.6108 12.9851 10.8787C13.052 11.1466 12.8892 11.4181 12.6213 11.4851L10.6213 11.9851C10.3534 12.052 10.0819 11.8892 10.0149 11.6213C9.94796 11.3534 10.1108 11.0819 10.3787 11.0149L12.3787 10.5149Z",fill:"#9F2424"})]});import{jsx as M2,jsxs as D6}from"react/jsx-runtime";var A6=C=>D6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[M2("title",{children:"Basketball"}),M2("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#D97D3B"}),M2("path",{d:"M3.24644 1.56479C3.29751 1.5937 3.34432 1.63216 3.38411 1.67991C4.79627 3.3745 5.55479 5.42407 5.65968 7.5H7.5V0.015371C7.66536 0.0051739 7.83207 0 8 0C8.16792 0 8.33464 0.0051739 8.5 0.015371V7.5H10.3403C10.4452 5.42407 11.2037 3.3745 12.6159 1.67991C12.6557 1.63216 12.7025 1.5937 12.7536 1.56479C13.0048 1.75071 13.2448 1.95099 13.4723 2.16442C13.4531 2.21969 13.4238 2.27249 13.3841 2.32009C12.1265 3.82925 11.4457 5.65168 11.3417 7.5H15.9846C15.9948 7.66536 16 7.83207 16 8C16 8.16792 15.9948 8.33464 15.9846 8.5H11.3417C11.4457 10.3483 12.1265 12.1707 13.3841 13.6799C13.4238 13.7275 13.4531 13.7803 13.4723 13.8356C13.2448 14.049 13.0048 14.2493 12.7536 14.4352C12.7025 14.4063 12.6557 14.3678 12.6159 14.3201C11.2037 12.6255 10.4452 10.5759 10.3403 8.5H8.5V15.9846C8.33464 15.9948 8.16792 16 8 16C7.83207 16 7.66536 15.9948 7.5 15.9846V8.5H5.65968C5.55479 10.5759 4.79627 12.6255 3.38411 14.3201C3.34432 14.3678 3.29751 14.4063 3.24644 14.4352C2.99517 14.2493 2.75517 14.049 2.52766 13.8356C2.54689 13.7803 2.57622 13.7275 2.61589 13.6799C3.87352 12.1707 4.55431 10.3483 4.65825 8.5H0.015371C0.0051739 8.33464 0 8.16792 0 8C0 7.83207 0.0051739 7.66536 0.015371 7.5H4.65825C4.55431 5.65168 3.87352 3.82925 2.61589 2.32009C2.57622 2.27249 2.54689 2.21969 2.52766 2.16442C2.75517 1.95099 2.99517 1.75071 3.24644 1.56479Z",fill:"#1C1D1D"})]});import{jsx as q1,jsxs as _6}from"react/jsx-runtime";var T6=C=>_6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[q1("title",{children:"Boxing"}),q1("path",{d:"M11 0H7C5.34315 0 4 1.34315 4 3V4H3.5C2.67157 4 2 4.67157 2 5.5V7.09677C2 8.70018 3.29982 10 4.90323 10C4.95667 10 5 10.0433 5 10.0968V15C5 15.5523 5.44772 16 6 16H11C11.5523 16 12 15.5523 12 15V10.0952C12 10.0426 12.0426 10 12.0952 10C13.1472 10 14 9.14721 14 8.09524V3C14 1.34315 12.6569 0 11 0Z",fill:"#E44242"}),q1("path",{d:"M11.0773 0H7C5.34315 0 4 1.34315 4 3V5.5C4 6.32843 4.67157 7 5.5 7H10.5C10.7761 7 11 6.77614 11 6.5C11 6.22386 10.7761 6 10.5 6H5.5C5.22386 6 5 5.77614 5 5.5V3C5 1.89543 5.89543 1 7 1H13.237C12.7036 0.403544 11.9352 0.0216987 11.0773 0Z",fill:"#8A2020"}),q1("path",{d:"M12 10.499H10C9.17157 10.499 8.5 11.1706 8.5 11.999C8.5 12.8274 9.17157 13.499 10 13.499H12V12.499H10C9.72386 12.499 9.5 12.2752 9.5 11.999C9.5 11.7229 9.72386 11.499 10 11.499H12V10.499Z",fill:"#8A2020"}),q1("path",{d:"M5 13.499H6C6.82843 13.499 7.5 12.8275 7.5 11.999C7.5 11.1706 6.82843 10.499 6 10.499H5V11.499H6C6.27614 11.499 6.5 11.7229 6.5 11.999C6.5 12.2752 6.27614 12.499 6 12.499H5V13.499Z",fill:"#8A2020"})]});import{jsx as h1,jsxs as O6}from"react/jsx-runtime";var W6=C=>O6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[h1("title",{children:"Casino"}),h1("path",{d:"M4 1C4 0.447716 4.44772 0 5 0H13C13.5523 0 14 0.447715 14 1V13C14 13.5523 13.5523 14 13 14H5C4.44772 14 4 13.5523 4 13V1Z",fill:"#E4E8EE"}),h1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 1H5V13H13V1ZM5 0C4.44772 0 4 0.447716 4 1V13C4 13.5523 4.44772 14 5 14H13C13.5523 14 14 13.5523 14 13V1C14 0.447715 13.5523 0 13 0H5Z",fill:"#99A8B1"}),h1("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H11C11.5523 2 12 2.44772 12 3V15C12 15.5523 11.5523 16 11 16H3C2.44772 16 2 15.5523 2 15V3Z",fill:"#fff"}),h1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 3H3V15H11V3ZM3 2C2.44772 2 2 2.44772 2 3V15C2 15.5523 2.44772 16 3 16H11C11.5523 16 12 15.5523 12 15V3C12 2.44772 11.5523 2 11 2H3Z",fill:"#99A8B1"}),h1("path",{d:"M6.99905 6C7.14184 6 7.27422 6.07578 7.35176 6.20207L8.93089 8.75518C9.02304 8.90467 9.02304 9.09533 8.93089 9.24482L7.35176 11.7979C7.27564 11.9229 7.14255 11.9992 6.99905 12C6.85556 11.9992 6.72247 11.9229 6.64635 11.7979L5.06722 9.24482L5.06911 9.24385C4.97696 9.09436 4.97696 8.90369 5.06911 8.75421L6.64635 6.2011C6.7227 6.07649 6.85574 6.00063 6.99905 6Z",fill:"#F14747"})]});import{jsx as R2,jsxs as U6}from"react/jsx-runtime";var N6=C=>U6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[R2("title",{children:"Flame"}),R2("path",{d:"M3.61207 6.68347C2.91407 7.60551 2.5 8.75441 2.5 10C2.5 12.6243 4.33795 14.8193 6.79684 15.368C7.36456 14.9121 8.1 13.5002 7.7 11.9001C8.35418 12.2039 9.91628 13.3704 9.73127 15.2058C11.8168 14.4609 13.2014 12.389 13.5 10C13.9 6.80002 12.1667 4.86678 11.5 4.20011C11.5 5.56317 11.2973 6.60011 10.4864 7.00011C9.6756 7.40011 8.84242 6.82513 9 6.00011C9.4775 3.50011 8.14668 1.88818 6.5 0.900015C6.5 3.60021 4.74138 5.28898 3.61207 6.68347Z",fill:"#F87A1E"}),R2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 0.0168457L6.75728 0.471287C7.6287 0.994222 8.44684 1.6997 8.98082 2.63528C9.52063 3.5811 9.75149 4.73073 9.49112 6.09392C9.45039 6.30719 9.53324 6.45914 9.66093 6.54584C9.79343 6.6358 10.0117 6.67676 10.2652 6.55171C10.5129 6.42954 10.6959 6.20369 10.8207 5.81017C10.9491 5.40486 11 4.86652 11 4.20011V2.99301L11.8536 3.84656C12.5593 4.55228 14.4249 6.63202 13.9961 10.062C13.6802 12.5895 12.2047 14.8533 9.89944 15.6767L9.15445 15.9428L9.23379 15.1557C9.30979 14.4017 9.03116 13.7779 8.64056 13.2918C8.53586 13.1615 8.42463 13.0431 8.31276 12.9373C8.30075 13.404 8.21413 13.8387 8.08531 14.2223C7.85878 14.8969 7.48728 15.4548 7.10993 15.7579L6.92253 15.9084L6.68794 15.856C4.00542 15.2574 2 12.8635 2 10C2 8.64174 2.45194 7.38758 3.21342 6.38168L3.21836 6.37515L3.22351 6.36879C3.37579 6.18076 3.53493 5.99156 3.69663 5.79932C4.7898 4.49966 6 3.06086 6 0.900015V0.0168457ZM6.9368 1.80515C6.64426 3.87344 5.39532 5.34611 4.43993 6.47264C4.28586 6.65431 4.13942 6.82698 4.00586 6.99169C3.37428 7.82879 3 8.86998 3 10C3 12.2921 4.54275 14.225 6.64691 14.8149C6.81303 14.6186 7.00175 14.3077 7.13733 13.904C7.31624 13.3711 7.38858 12.716 7.21493 12.0214L6.961 11.0056L7.9106 11.4466C8.30118 11.628 8.91866 12.0414 9.4201 12.6654C9.79354 13.1302 10.1141 13.7276 10.2141 14.4414C11.727 13.6084 12.7566 11.9164 13.0039 9.938C13.2605 7.88518 12.5748 6.39765 11.9196 5.46744C11.8853 5.69437 11.8379 5.91051 11.7739 6.11234C11.5946 6.67807 11.2709 7.17068 10.7077 7.44852C10.1503 7.72347 9.54661 7.67694 9.0992 7.37315C8.64698 7.06611 8.39204 6.51805 8.50888 5.90631C8.72601 4.76949 8.5302 3.86316 8.11231 3.13097C7.82146 2.62136 7.41429 2.18142 6.9368 1.80515Z",fill:"#FF8C31"})]});import{jsx as R5,jsxs as K6}from"react/jsx-runtime";var J6=C=>K6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[R5("title",{children:"Football"}),R5("path",{d:"M1.01096 14.5055C1.99083 15.4854 3.64042 15.5057 5.01097 15.5055C8.03637 15.5052 11.511 14.5055 13.011 12.5055C14.511 10.5055 15.011 8.00553 15.011 8.00553C15.011 8.00553 16.011 4.50549 15.011 1.50552C14.6311 0.365947 12.511 0.505525 10.511 0.505525C8.01894 0.556374 5.51097 1.00551 3.51097 3.00552C1.51096 5.00553 0.375025 8.91048 0.510956 11.5055C0.581548 12.8533 0.497778 13.9924 1.01096 14.5055Z",fill:"#D97D3B"}),R5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5161 1.00552C8.0724 1.05593 5.72675 1.49685 3.86452 3.35908C2.93819 4.28541 2.18684 5.68331 1.68432 7.19053C1.18267 8.69512 0.946238 10.2569 1.01027 11.4794C1.02536 11.7674 1.03338 12.0301 1.04083 12.2741C1.05201 12.6404 1.0619 12.9644 1.09248 13.2685C1.14351 13.7759 1.24147 14.0289 1.36451 14.152C1.75431 14.5418 2.29953 14.7629 2.95332 14.881C3.60903 14.9994 4.32085 15.0056 5.01091 15.0055C6.47296 15.0054 8.04182 14.7631 9.41842 14.2832C10.8027 13.8007 11.9434 13.0956 12.611 12.2055C13.3201 11.26 13.7996 10.1857 14.1026 9.33734C14.2534 8.9152 14.3587 8.55387 14.4261 8.29945C14.4597 8.17235 14.4838 8.07224 14.4992 8.00491C14.507 7.97125 14.5126 7.94582 14.5161 7.92933L14.5199 7.91141L14.5206 7.90766L14.5246 7.88763L14.5301 7.86847L14.5304 7.86749L14.532 7.8618L14.5391 7.83583C14.5454 7.81213 14.5549 7.77587 14.5669 7.72801C14.5908 7.63227 14.6245 7.49028 14.6621 7.3098C14.7374 6.94846 14.828 6.43492 14.8884 5.83076C15.0101 4.61419 15.005 3.06888 14.5366 1.66364C14.4505 1.40523 14.1318 1.18159 13.3041 1.07401C12.6771 0.992531 11.9278 0.997503 11.1266 1.00282C10.926 1.00415 10.7221 1.0055 10.5161 1.00552ZM15.4971 8.12345L15.4939 8.13886C15.4894 8.15997 15.4827 8.1902 15.4739 8.22881C15.4561 8.30601 15.4294 8.41683 15.3928 8.55535C15.3195 8.83217 15.2061 9.22083 15.0443 9.67368C14.7223 10.5753 14.2019 11.7509 13.411 12.8055C12.5786 13.9154 11.232 14.7101 9.74757 15.2275C8.25552 15.7476 6.57438 16.0054 5.01102 16.0055C4.33054 16.0056 3.53229 16.0017 2.7756 15.8651C2.01698 15.7281 1.24747 15.4492 0.657404 14.8591C0.267267 14.4689 0.150521 13.8958 0.0974956 13.3685C0.0642397 13.0378 0.0518509 12.6471 0.0391712 12.2471C0.0315996 12.0083 0.0239243 11.7662 0.0116403 11.5317C-0.0602576 10.1591 0.203314 8.47089 0.735655 6.87424C1.26712 5.28022 2.08374 3.72565 3.15741 2.65197C5.29392 0.515465 7.96225 0.0574265 10.5008 0.00562871L10.511 0.00542057C10.6984 0.00542057 10.89 0.00417051 11.0836 0.00280306C11.8911 -0.00290187 12.7313 -0.00883838 13.433 0.0823534C14.2603 0.189885 15.1916 0.466242 15.4853 1.34741C16.0169 2.94213 16.0118 4.64683 15.8835 5.93027C15.8189 6.57611 15.7221 7.12509 15.6411 7.51375C15.6006 7.70828 15.5639 7.86317 15.5371 7.97055C15.5236 8.02425 15.5126 8.06612 15.5048 8.09516L15.4971 8.12345Z",fill:"#D97D3B"}),R5("path",{d:"M15.4565 1.26789L10.7184 6.006L12.3643 7.65194C12.5596 7.8472 12.5596 8.16378 12.3643 8.35905C12.169 8.55431 11.8525 8.55431 11.6572 8.35905L10.0112 6.7131L8.71835 8.006L10.3643 9.65194C10.5596 9.8472 10.5596 10.1638 10.3643 10.359C10.169 10.5543 9.85245 10.5543 9.65719 10.359L8.01124 8.7131L6.71835 10.006L8.3643 11.6519C8.55956 11.8472 8.55956 12.1638 8.3643 12.359C8.16903 12.5543 7.85245 12.5543 7.65719 12.359L6.01124 10.7131L1.34627 15.3781C1.09967 15.2393 0.867196 15.0689 0.657404 14.8591C0.62265 14.8243 0.590066 14.7881 0.559503 14.7506L5.30414 10.006L3.65719 8.35905C3.46193 8.16378 3.46193 7.8472 3.65719 7.65194C3.85245 7.45668 4.16903 7.45668 4.3643 7.65194L6.01124 9.29889L7.30414 8.006L5.65719 6.35905C5.46193 6.16378 5.46193 5.8472 5.65719 5.65194C5.85245 5.45668 6.16903 5.45668 6.3643 5.65194L8.01124 7.29889L9.30414 6.006L7.65719 4.35905C7.46193 4.16378 7.46193 3.8472 7.65719 3.65194C7.85245 3.45668 8.16903 3.45668 8.3643 3.65194L10.0112 5.29889L14.8036 0.506497C15.0888 0.683239 15.3225 0.92752 15.4565 1.26789Z",fill:"#fff"})]});import{jsx as k,jsxs as z6}from"react/jsx-runtime";var q6=C=>z6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[k("title",{children:"FreePlay"}),k("path",{d:"M3.57036 4.23683L3.37357 5.19652H1.46188L1.0683 7.14544H0L1.04019 2H4.21696L4.02017 2.9597H1.91169L1.65867 4.23683H3.57036Z",fill:"#1BB152"}),k("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.28122 7.14544H6.13561L5.95991 5.21129H5.27114L4.87756 7.14544H3.80926L4.84945 2H7.09146C7.87863 2 8.20895 2.45032 8.04028 3.26975L7.85051 4.19992C7.74509 4.72406 7.47099 5.05625 7.04929 5.16699L7.28122 7.14544ZM7.00713 3.14425C7.03524 3.01137 6.98604 2.95231 6.85953 2.95231H5.72095L5.4609 4.25897H6.59948C6.71897 4.25897 6.78925 4.19253 6.81736 4.06703L7.00713 3.14425Z",fill:"#1BB152"}),k("path",{d:"M8.00288 7.14544H11.1586L11.3483 6.18575H9.26796L9.50695 4.96767H11.3554L11.5451 4.03012H9.70375L9.91461 2.9597H11.9528L12.1496 2H9.04303L8.00288 7.14544Z",fill:"#1BB152"}),k("path",{d:"M15.009 7.14544H11.8533L12.8935 2H16L15.8032 2.9597H13.7651L13.5542 4.03012H15.3955L15.2058 4.96767H13.3574L13.1184 6.18575H15.1987L15.009 7.14544Z",fill:"#1BB152"}),k("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.10417 11.9661C3.72969 11.9661 4.13029 11.6117 4.26383 10.9547L4.47468 9.9138C4.64335 9.09443 4.31303 8.64407 3.5329 8.64407H1.28385L0.243665 13.7895H1.31196L1.67743 11.9661H3.10417ZM3.29393 9.61115C3.42044 9.61115 3.46261 9.67018 3.4345 9.80306L3.23068 10.8071C3.20256 10.94 3.13228 10.999 3.0128 10.999H1.87423L2.15535 9.61115H3.29393Z",fill:"#1BB152"}),k("path",{d:"M7.28604 13.7895H4.3412L5.38138 8.64407H6.44968L5.60628 12.815H7.48283L7.28604 13.7895Z",fill:"#1BB152"}),k("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.01011 12.7486V12.7264H10.5704V12.7486L10.3666 13.7895H11.3786L11.6176 12.6084C11.6504 12.4359 11.6342 12.3021 11.6204 12.1889L11.6176 12.1654L11.1889 8.64407H10.0643L8.1889 12.1766C8.14908 12.2515 8.05246 12.4332 8.01911 12.6084L7.78718 13.7895H8.80624L9.01011 12.7486ZM10.3736 9.8695L10.5563 11.8037H9.43175L10.3736 9.8695Z",fill:"#1BB152"}),k("path",{d:"M13.9372 12.0621L13.5928 13.7895H12.5315L12.8899 12.0104L12.145 10.1205C12.1169 10.0467 12.0747 9.90647 12.1239 9.67759L12.3347 8.64407H13.3679L13.1852 9.53729C13.1571 9.67759 13.15 9.77359 13.1852 9.86218L13.6209 10.999L14.4783 9.93595C14.5557 9.84736 14.6049 9.75144 14.633 9.61115L14.8297 8.64407H15.8629L15.652 9.67759C15.5959 9.94336 15.5186 10.0984 15.4413 10.1944L13.9372 12.0621Z",fill:"#1BB152"})]});import{jsx as f,jsxs as Y6}from"react/jsx-runtime";var X6=C=>Y6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[f("title",{children:"Golf"}),f("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#fff"}),f("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"#99A8B1"}),f("path",{d:"M7 2.5C7 2.22386 7.22386 2 7.5 2C7.77614 2 8 2.22386 8 2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5Z",fill:"#99A8B1"}),f("path",{d:"M4 3.5C4 3.22386 4.22386 3 4.5 3C4.77614 3 5 3.22386 5 3.5C5 3.77614 4.77614 4 4.5 4C4.22386 4 4 3.77614 4 3.5Z",fill:"#99A8B1"}),f("path",{d:"M3 5.5C3 5.22386 3.22386 5 3.5 5C3.77614 5 4 5.22386 4 5.5C4 5.77614 3.77614 6 3.5 6C3.22386 6 3 5.77614 3 5.5Z",fill:"#99A8B1"}),f("path",{d:"M2 7.5C2 7.22386 2.22386 7 2.5 7C2.77614 7 3 7.22386 3 7.5C3 7.77614 2.77614 8 2.5 8C2.22386 8 2 7.77614 2 7.5Z",fill:"#99A8B1"}),f("path",{d:"M5 8C5 7.72386 5.22386 7.5 5.5 7.5C5.77614 7.5 6 7.72386 6 8C6 8.27614 5.77614 8.5 5.5 8.5C5.22386 8.5 5 8.27614 5 8Z",fill:"#99A8B1"}),f("path",{d:"M6 5.5C6 5.22386 6.22386 5 6.5 5C6.77614 5 7 5.22386 7 5.5C7 5.77614 6.77614 6 6.5 6C6.22386 6 6 5.77614 6 5.5Z",fill:"#99A8B1"}),f("path",{d:"M9 3.5C9 3.22386 9.22386 3 9.5 3C9.77614 3 10 3.22386 10 3.5C10 3.77614 9.77614 4 9.5 4C9.22386 4 9 3.77614 9 3.5Z",fill:"#99A8B1"}),f("path",{d:"M9 6.5C9 6.22386 9.22386 6 9.5 6C9.77614 6 10 6.22386 10 6.5C10 6.77614 9.77614 7 9.5 7C9.22386 7 9 6.77614 9 6.5Z",fill:"#99A8B1"}),f("path",{d:"M6.5 12C6.5 11.7239 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.7239 5.5 12C5.5 12.2761 5.72386 12.5 6 12.5C6.27614 12.5 6.5 12.2761 6.5 12Z",fill:"#99A8B1"}),f("path",{d:"M8.5 9C8.5 8.72386 8.27614 8.5 8 8.5C7.72386 8.5 7.5 8.72386 7.5 9C7.5 9.27614 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.27614 8.5 9Z",fill:"#99A8B1"}),f("path",{d:"M4.5 10C4.5 9.72386 4.27614 9.5 4 9.5C3.72386 9.5 3.5 9.72386 3.5 10C3.5 10.2761 3.72386 10.5 4 10.5C4.27614 10.5 4.5 10.2761 4.5 10Z",fill:"#99A8B1"})]});import{jsx as D4,jsxs as $6}from"react/jsx-runtime";var Q6=C=>$6("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[D4("title",{children:"MMA"}),D4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.21421 0H10.7858C11.051 0 11.3054 0.105357 11.4929 0.292893L15.7071 4.50711C15.8946 4.69464 16 4.949 16 5.21421V10.7858C16 11.051 15.8946 11.3054 15.7071 11.4929L11.4929 15.7071C11.3054 15.8946 11.051 16 10.7858 16H5.21421C4.949 16 4.69464 15.8946 4.50711 15.7071L0.292894 11.4929C0.105357 11.3054 0 11.051 0 10.7858V5.21421C0 4.949 0.105357 4.69464 0.292893 4.50711L4.50711 0.292894C4.69464 0.105357 4.949 0 5.21421 0ZM6.53931 3.5C6.38772 3.5 6.24176 3.55737 6.13075 3.66059L3.69145 5.92857C3.56936 6.04209 3.5 6.20128 3.5 6.36799V9.74682C3.5 9.89539 3.55512 10.0387 3.6547 10.1489L5.59914 12.3021C5.7129 12.4281 5.8747 12.5 6.04444 12.5H9.95556C10.1253 12.5 10.2871 12.4281 10.4009 12.3021L12.3453 10.1489C12.4449 10.0387 12.5 9.89539 12.5 9.74682V6.36799C12.5 6.20128 12.4306 6.04209 12.3086 5.92857L9.86925 3.66059C9.75824 3.55737 9.61227 3.5 9.46069 3.5H6.53931ZM4.5 6.54226L6.69653 4.5H9.30347L11.5 6.54226V9.59294L9.77782 11.5H6.22218L4.5 9.59294V6.54226Z",fill:"#2C9EFF"})]});import{jsx as Z2,jsxs as C7}from"react/jsx-runtime";var j6=C=>C7("svg",{width:17,height:16,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[Z2("title",{children:"NASCAR"}),Z2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.47063 3.70592C2.55491 2.21504 4.32405 1 7 1C10.0751 1 12.291 2.77844 13.75 5H7.93931C6.59211 5 5.5 6.09211 5.5 7.43931C5.5 8.58458 6.29703 9.57928 7.42324 9.81484C8.49947 10.0399 9.92776 10.3292 10.9183 10.4933C11.8077 10.6406 12.9464 10.7669 13.8554 10.856C14.3114 10.9007 14.7126 10.9363 14.9998 10.9607C15.1434 10.9729 15.2587 10.9824 15.3381 10.9888L15.4295 10.996L15.4618 10.9985L15.9341 11.0122C15.9976 11.5392 16.0219 12.0358 16.0076 12.4848C15.987 13.1263 15.8862 13.7121 15.6752 14.1561C15.4616 14.6056 15.0808 15 14.5 15H4C3.05303 15 2.03436 14.4648 1.27226 13.3286C0.512417 12.1957 0 10.4633 0 8.00003C0 6.90348 0.403313 5.17349 1.47063 3.70592Z",fill:"#4CADFF"}),Z2("path",{d:"M14.1121 6H7.93931C7.1444 6 6.5 6.6444 6.5 7.43931C6.5 8.11652 6.97029 8.69846 7.62797 8.83602C8.70457 9.0612 10.1142 9.34644 11.0817 9.50672C11.9367 9.64837 13.048 9.77208 13.9529 9.86076C14.2729 9.89211 15.2555 9.97842 15.5 10C15.5 10 15.26 8.76196 15 8C14.7241 7.19123 14.1121 6 14.1121 6Z",fill:"#F5F8FC"})]});import{jsx as r,jsxs as a1}from"react/jsx-runtime";var e7=C=>a1("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[r("title",{children:"ParlayHub"}),r("path",{d:"M3.11848 11.4898L3.29214 10.7639L3.43409 10.1708L3.83653 8.49173L3.97848 7.89856L4.41994 6.05514L4.56189 5.46197L4.71311 4.83124C4.72786 4.76991 4.76283 4.71533 4.81239 4.6763C4.86194 4.63727 4.9232 4.61607 4.98628 4.61612H12.6175L12.7473 4.02295H4.7658C4.49165 4.02295 4.25263 4.21124 4.18872 4.47807L4.05311 4.97905C4.0408 5.03046 4.01153 5.07622 3.97002 5.10896C3.92852 5.14171 3.8772 5.15952 3.82433 5.15953H3.06092C3.05897 5.15953 3.05702 5.16002 3.05506 5.16002C2.93019 4.83173 2.60433 4.60295 2.22775 4.62392C1.81116 4.64685 1.4697 4.98539 1.44385 5.40197C1.41311 5.88685 1.7975 6.29027 2.27604 6.29027C2.63214 6.29027 2.93604 6.06685 3.05555 5.75271C3.05702 5.75271 3.05945 5.75319 3.06141 5.75319H3.57019C3.72238 5.75319 3.83458 5.89514 3.79897 6.04344L3.41311 7.71953C3.4008 7.77094 3.37153 7.81671 3.33002 7.84945C3.28852 7.8822 3.2372 7.90001 3.18433 7.90002H2.33653C2.32482 7.90002 2.31311 7.901 2.30189 7.90246C2.17799 7.57368 1.85214 7.34392 1.47555 7.36441C1.05799 7.38685 0.716528 7.72539 0.690187 8.14246C0.659455 8.62783 1.04385 9.03075 1.52189 9.03075C1.87897 9.03075 2.18287 8.80685 2.30189 8.49173C2.31311 8.49319 2.32482 8.49417 2.33653 8.49417H2.92824C3.08043 8.49417 3.19263 8.63612 3.15702 8.78441L2.79945 10.2673C2.78714 10.3187 2.75787 10.3645 2.71636 10.3973C2.67486 10.43 2.62354 10.4478 2.57067 10.4478H1.65311C1.64336 10.4478 1.63409 10.4483 1.62433 10.4493C1.4975 10.1142 1.16092 9.88197 0.775065 9.91368C0.36726 9.94685 0.0399427 10.2795 0.0131134 10.6878C-0.0190817 11.1737 0.365796 11.5781 0.844821 11.5781C1.20092 11.5781 1.50531 11.3542 1.62433 11.0395C1.63409 11.0405 1.64336 11.041 1.65311 11.041H2.31604C2.46824 11.041 2.58043 11.1829 2.54482 11.3312L2.45848 11.7005C2.43764 11.7877 2.43684 11.8785 2.45612 11.966C2.4754 12.0536 2.51426 12.1356 2.5698 12.206C2.62534 12.2763 2.69609 12.3332 2.77676 12.3723C2.85743 12.4114 2.94591 12.4317 3.03555 12.4317H10.8121L10.956 11.8386H3.39165C3.21019 11.8361 3.07604 11.6664 3.11848 11.4898ZM2.76775 5.501C2.74385 5.75173 2.53214 5.94929 2.27555 5.94929C2.00238 5.94929 1.78092 5.72734 1.78092 5.45466C1.78092 5.18197 2.00287 4.96002 2.27555 4.96002C2.53263 4.96002 2.74385 5.1571 2.76775 5.40832C2.76531 5.42344 2.76385 5.43905 2.76385 5.45514C2.76385 5.47027 2.76531 5.48588 2.76775 5.501ZM1.52141 8.68929C1.24872 8.68929 1.02677 8.46734 1.02677 8.19466C1.02677 7.92197 1.24872 7.70002 1.52141 7.70002C1.79458 7.70002 2.01604 7.92197 2.01604 8.19466C2.01604 8.46734 1.79458 8.68929 1.52141 8.68929ZM0.844821 11.2366C0.572138 11.2366 0.350187 11.0147 0.350187 10.742C0.350187 10.4688 0.572138 10.2473 0.844821 10.2473C1.1175 10.2473 1.33945 10.4693 1.33945 10.742C1.33897 11.0147 1.1175 11.2366 0.844821 11.2366Z",fill:"#007BFF"}),r("path",{d:"M5.29557 5.37268H7.53703C9.03654 5.37268 9.64142 6.09024 9.64142 7.08975C9.64142 8.37171 8.6741 9.27463 6.96483 9.27463H6.13459L5.75557 10.9595C5.74727 10.9917 5.71508 11.0161 5.68288 11.0161H4.00581C3.96532 11.0161 3.94142 10.9839 3.94922 10.9434L4.6024 8.26683L5.22337 5.42878C5.23069 5.39707 5.26337 5.37268 5.29557 5.37268ZM6.41605 8.04146H6.98825C7.64142 8.04146 7.92337 7.67073 7.92337 7.20292C7.92337 6.86439 7.76191 6.59805 7.2541 6.59805H6.7541L6.41605 8.04146Z",fill:"url(#paint0_linear_4542_182)",stroke:"url(#paint1_linear_4542_182)",strokeWidth:.0427744,strokeMiterlimit:10}),r("path",{d:"M15.9282 5.40881H14.254C14.2218 5.40881 14.1896 5.4332 14.1818 5.4654L13.7389 7.4293H11.9443L12.4033 5.4815C12.4111 5.4415 12.3872 5.40881 12.3467 5.40881H10.6731H10.6726L9.98281 8.29418L9.38086 11.043H9.54037C9.54379 11.043 9.5472 11.0425 9.5511 11.0425H11.0594C11.0916 11.0425 11.1238 11.0181 11.1321 10.9859L11.435 9.62784L11.5628 9.05418L11.6472 8.67613H13.4579L12.9106 10.9698C12.9028 11.0103 12.9267 11.0425 12.9672 11.0425H14.6413C14.6735 11.0425 14.7057 11.0181 14.714 10.9859L15.3257 8.1932L15.9857 5.48101C15.9926 5.44101 15.9682 5.40881 15.9282 5.40881Z",fill:"url(#paint2_linear_4542_182)",stroke:"url(#paint3_linear_4542_182)",strokeWidth:.0286799,strokeMiterlimit:10}),a1("defs",{children:[a1("linearGradient",{id:"paint0_linear_4542_182",x1:7.84947,y1:-13.2258,x2:5.81508,y2:29.7231,gradientUnits:"userSpaceOnUse",children:[r("stop",{offset:.417,stopColor:"#fff"}),r("stop",{offset:.444,stopColor:"#F9F9F9"}),r("stop",{offset:.479,stopColor:"#E9E9E9"}),r("stop",{offset:.519,stopColor:"#CFCFCF"}),r("stop",{offset:.562,stopColor:"#AAA"}),r("stop",{offset:.607,stopColor:"#7A7A7A"}),r("stop",{offset:.654,stopColor:"#414141"}),r("stop",{offset:.701})]}),a1("linearGradient",{id:"paint1_linear_4542_182",x1:4.93542,y1:5.55268,x2:7.50015,y2:9.99492,gradientUnits:"userSpaceOnUse",children:[r("stop",{stopColor:"#0D0D0D"}),r("stop",{offset:1,stopColor:"#fff"})]}),a1("linearGradient",{id:"paint2_linear_4542_182",x1:12.952,y1:-.406992,x2:12.3463,y2:19.1259,gradientUnits:"userSpaceOnUse",children:[r("stop",{offset:.417,stopColor:"#fff"}),r("stop",{offset:.444,stopColor:"#F9F9F9"}),r("stop",{offset:.479,stopColor:"#E9E9E9"}),r("stop",{offset:.519,stopColor:"#CFCFCF"}),r("stop",{offset:.562,stopColor:"#AAA"}),r("stop",{offset:.607,stopColor:"#7A7A7A"}),r("stop",{offset:.654,stopColor:"#414141"}),r("stop",{offset:.701})]}),a1("linearGradient",{id:"paint3_linear_4542_182",x1:9.36852,y1:8.22559,x2:15.9959,y2:8.22559,gradientUnits:"userSpaceOnUse",children:[r("stop",{stopColor:"#0D0D0D"}),r("stop",{offset:1,stopColor:"#fff"})]})]})]});import{jsx as E,jsxs as l7}from"react/jsx-runtime";var o7=C=>l7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[E("title",{children:"Playbook"}),E("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.146447 0.146447C0.341709 -0.0488155 0.658291 -0.0488155 0.853554 0.146447L4.85355 4.14645C5.04882 4.34171 5.04882 4.65829 4.85355 4.85355C4.65829 5.04882 4.34171 5.04882 4.14645 4.85355L0.146447 0.853553C-0.0488154 0.658291 -0.0488154 0.341709 0.146447 0.146447Z",fill:"#0070EB"}),E("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.85355 0.146447C4.65829 -0.0488155 4.34171 -0.0488155 4.14645 0.146447L0.146447 4.14645C-0.0488156 4.34171 -0.0488156 4.65829 0.146447 4.85355C0.341709 5.04882 0.658291 5.04882 0.853553 4.85355L4.85355 0.853553C5.04882 0.658291 5.04882 0.341709 4.85355 0.146447Z",fill:"#0070EB"}),E("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8536 11.1464C15.6583 10.9512 15.3417 10.9512 15.1464 11.1464L11.1464 15.1464C10.9512 15.3417 10.9512 15.6583 11.1464 15.8536C11.3417 16.0488 11.6583 16.0488 11.8536 15.8536L15.8536 11.8536C16.0488 11.6583 16.0488 11.3417 15.8536 11.1464Z",fill:"#0070EB"}),E("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1464 11.1464C11.3417 10.9512 11.6583 10.9512 11.8536 11.1464L15.8536 15.1464C16.0488 15.3417 16.0488 15.6583 15.8536 15.8536C15.6583 16.0488 15.3417 16.0488 15.1464 15.8536L11.1464 11.8536C10.9512 11.6583 10.9512 11.3417 11.1464 11.1464Z",fill:"#0070EB"}),E("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 15C3.32843 15 4 14.3284 4 13.5C4 12.6716 3.32843 12 2.5 12C1.67157 12 1 12.6716 1 13.5C1 14.3284 1.67157 15 2.5 15ZM2.5 16C3.88071 16 5 14.8807 5 13.5C5 12.1193 3.88071 11 2.5 11C1.11929 11 1.19209e-07 12.1193 1.19209e-07 13.5C1.19209e-07 14.8807 1.11929 16 2.5 16Z",fill:"#0070EB"}),E("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 2C13.7761 2 14 2.22386 14 2.5V6.5C14 7.32843 13.3284 8 12.5 8H3.5C3.22386 8 3 8.22386 3 8.5V11.5C3 11.7761 2.77614 12 2.5 12C2.22386 12 2 11.7761 2 11.5V8.5C2 7.67157 2.67157 7 3.5 7H12.5C12.7761 7 13 6.77614 13 6.5V2.5C13 2.22386 13.2239 2 13.5 2Z",fill:"#0070EB"}),E("path",{d:"M11.5 2.5L13.5 0.5L15.5 2.5H11.5Z",fill:"#0070EB"}),E("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1464 0.146447C13.3417 -0.0488155 13.6583 -0.0488155 13.8536 0.146447L15.8536 2.14645C15.9966 2.28945 16.0393 2.5045 15.9619 2.69134C15.8846 2.87818 15.7022 3 15.5 3H11.5C11.2978 3 11.1155 2.87818 11.0381 2.69134C10.9607 2.5045 11.0034 2.28945 11.1464 2.14645L13.1464 0.146447ZM12.7071 2H14.2929L13.5 1.20711L12.7071 2Z",fill:"#0070EB"})]});import{jsx as C1,jsxs as r7}from"react/jsx-runtime";var t7=C=>r7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[C1("title",{children:"PlayerProps"}),C1("path",{d:"M14.4513 8.57923L13.6357 3.32121C13.5289 3.00155 13.2279 2.30434 12.8784 2.07176C12.5641 1.86254 11.0412 0.987975 10.0933 0.456439C10.0784 0.446176 10.0634 0.436086 10.0482 0.426171C9.97757 0.381036 9.90429 0.352362 9.83366 0.306695C9.71897 0.232355 9.6048 0.15589 9.48532 0.088983L9.44815 0.0688048C9.44866 0.0705825 9.44919 0.0723527 9.44975 0.0741148C9.2623 -0.00447401 8.46154 0.0141112 7.99692 0.0141112C7.53653 0.0141112 6.74852 -0.00447398 6.54992 0.0709288L6.55046 0.0682738C6.54453 0.0719747 6.53851 0.075516 6.5324 0.0788939L6.52603 0.0820799C6.48887 0.102409 6.45222 0.123656 6.41611 0.145801L6.39646 0.158014C6.24884 0.249878 6.02688 0.382629 5.93077 0.440509C4.98664 0.970452 3.43876 1.85882 3.12069 2.0707C2.77076 2.30328 2.47021 2.99996 2.36295 3.32015L1.54785 8.57923C2.31728 8.9743 3.52319 9.16387 3.75206 8.94456C3.98145 8.72526 4.34466 7.24269 4.34466 7.24269L3.87844 15.0294C3.97561 15.0878 4.36749 15.2906 5.16028 15.6395C5.94617 15.9852 7.37351 15.9889 8.0001 15.9889C8.62881 15.9889 10.0535 15.9852 10.8399 15.6395C11.6327 15.2906 12.0246 15.0872 12.1218 15.0294L11.6555 7.24269C11.6555 7.24269 12.0055 8.9281 12.2481 8.94456C12.4908 8.96102 13.6824 8.9743 14.4513 8.57923Z",fill:"#EDEFF2"}),C1("path",{d:"M14.4513 8.57923L13.6357 3.32121C13.5289 3.00155 13.2279 2.30434 12.8784 2.07176C12.5641 1.86254 11.0412 0.987975 10.0933 0.456439C10.0784 0.446176 10.0634 0.436086 10.0482 0.426171C9.97757 0.381036 9.90429 0.352362 9.83366 0.306695C9.71897 0.232355 9.6048 0.15589 9.48532 0.088983L9.44815 0.0688048C9.44866 0.0705825 9.44919 0.0723527 9.44975 0.0741148C9.2623 -0.00447401 8.46154 0.0141112 7.99692 0.0141112C7.53653 0.0141112 6.74852 -0.00447398 6.54992 0.0709288L6.55046 0.0682738C6.53844 0.0759875 6.52641 0.0830769 6.51367 0.089514C6.48085 0.107721 6.44807 0.126134 6.41611 0.145801L6.39646 0.158014C6.24884 0.249878 5.93077 0.440509 5.93077 0.440509C5.93077 0.440509 10.1241 4.69652 8.0001 15.9889C8.62881 15.9889 10.0535 15.9852 10.8399 15.6395C11.6327 15.2906 12.0246 15.0872 12.1218 15.0294L11.6555 7.24269C11.6555 7.24269 12.0055 8.9281 12.2481 8.94456C12.4908 8.96102 13.6824 8.9743 14.4513 8.57923Z",fill:"#C1D7E9"}),C1("path",{d:"M6.7451 7.4831C7.0306 7.34915 7.33572 7.26185 7.64887 7.2245C7.68179 7.21972 7.6956 7.24256 7.69135 7.26964C7.65311 7.50594 7.6271 7.74648 7.61701 7.98862C7.61488 8.01623 7.60002 8.03482 7.57028 8.04066C7.39304 8.07628 7.22079 8.13334 7.05733 8.21058C7.21493 8.49164 7.40842 8.751 7.63294 8.98213C7.65907 9.00915 7.6755 9.04407 7.67967 9.08143C7.73595 9.45101 7.83366 9.82325 7.96535 10.1753C7.97331 10.1955 7.97331 10.2093 7.96163 10.2204C7.94889 10.2321 7.92977 10.2321 7.91225 10.2204C6.60172 9.408 5.81053 7.95145 5.79725 6.42481C5.79725 6.38817 5.81 6.36109 5.83973 6.34303C6.52918 5.9511 7.31215 5.7538 8.105 5.7722C8.14005 5.7738 8.15226 5.80406 8.13845 5.83327C8.03013 6.06213 7.93986 6.29577 7.8687 6.52889C7.86021 6.55597 7.84375 6.56977 7.81454 6.57137C7.40011 6.59313 6.9926 6.68674 6.61022 6.84802C6.63677 7.06573 6.68403 7.27813 6.7451 7.4831ZM8.19633 6.57349C8.19019 6.57313 8.18421 6.57138 8.17885 6.56836C8.17349 6.56533 8.16889 6.56112 8.1654 6.55605C8.16192 6.55098 8.15964 6.54517 8.15874 6.53909C8.15785 6.533 8.15835 6.52678 8.16023 6.52092C8.24306 6.27772 8.33758 6.04726 8.44538 5.83327C8.45812 5.80831 8.47936 5.79769 8.50857 5.80141C9.08985 5.86876 9.65156 6.0528 10.16 6.3425C10.1903 6.36003 10.2041 6.38764 10.2025 6.42375C10.1919 7.86968 9.48031 9.25401 8.28183 10.0903C8.25952 10.1063 8.23032 10.0972 8.2197 10.0702C8.1341 9.83757 8.06421 9.5995 8.01048 9.35755C8.00358 9.32622 8.01048 9.30286 8.03438 9.28427C8.78563 8.67917 9.27185 7.8054 9.39003 6.84802C9.01089 6.68854 8.60706 6.59566 8.19633 6.57349ZM3.7635 3.28603C3.66898 3.09275 3.22612 2.45129 3.01903 2.15393C2.77477 2.37324 2.518 2.86667 2.36295 3.32015C2.50101 3.45609 2.89424 3.89563 3.02434 4.10113C3.18683 4.3576 3.7635 5.23217 3.89625 5.47431C4.00245 5.66706 4.32477 5.83645 4.47239 5.89646C4.4331 5.74565 4.35132 5.41643 4.33964 5.3081C4.3253 5.17217 3.88138 3.52764 3.7635 3.28603Z",fill:"#005FC8"}),C1("path",{d:"M7.70649 2.16877C7.82065 2.16877 7.89446 2.23568 7.98845 2.23568C8.08297 2.23568 8.15625 2.16877 8.27095 2.16877C8.80461 1.90964 9.78751 1.00746 9.52094 0.407959H6.45596C6.27171 1.0218 7.2238 1.78486 7.70649 2.16877Z",fill:"#96BDDD"}),C1("path",{d:"M6.56271 0.291787C6.54311 0.466794 6.57119 0.643843 6.64395 0.804207C7.06876 0.829165 7.57268 0.872176 7.99695 0.867928C8.42335 0.872176 8.9294 0.828634 9.35526 0.804207C9.44129 0.602425 9.45616 0.427194 9.43492 0.282229C9.42602 0.219996 9.41036 0.158921 9.38819 0.100094L9.36589 0.0390285C9.08923 -0.0124791 8.41061 0.00185808 7.99642 0.00185808C7.58542 0.00185808 6.91317 -0.012479 6.6328 0.0384975L6.61103 0.0974391C6.58765 0.160195 6.57144 0.225391 6.56271 0.291787Z",fill:"#005FC8"}),C1("path",{d:"M10.0889 0.464239L10.0846 0.453088L10.0751 0.446185C10.0607 0.436096 10.0453 0.426538 10.0305 0.41698C9.99754 0.39574 9.96409 0.374499 9.92957 0.354321C9.89293 0.331488 9.85629 0.309186 9.82018 0.285821L9.76867 0.252368C9.67307 0.188677 9.57531 0.128283 9.47556 0.0712951C9.45697 0.055365 9.41952 0.0491176 9.36589 0.0390285L9.38819 0.100094C9.41261 0.167532 9.42724 0.223163 9.43574 0.281573C9.45538 0.426538 9.44076 0.602956 9.35526 0.804207C9.20287 1.16211 8.82455 1.60006 7.9999 2.09124C7.17471 1.60006 6.79582 1.16157 6.64395 0.804207C6.57119 0.643843 6.54311 0.466794 6.56271 0.291787C6.57067 0.228066 6.5866 0.164346 6.61103 0.0974391L6.6328 0.0384975C6.5915 0.0427432 6.55191 0.055318 6.51627 0.0766052L6.44936 0.113776L6.40741 0.140326C6.33466 0.185461 6.24811 0.241217 6.16846 0.292724C6.08509 0.346887 6.00916 0.396271 5.96296 0.423883L5.95075 0.430786L5.94013 0.436627L5.92526 0.445654L5.91464 0.452026L5.91039 0.463708C5.88479 0.537078 5.8703 0.613858 5.86738 0.69151C5.84136 1.33084 6.56406 2.15071 7.95688 3.06298L7.9999 3.09112L8.04238 3.06298C9.44423 2.14487 10.1664 1.32128 10.1319 0.680358C10.1277 0.606662 10.1132 0.533914 10.0889 0.464239ZM11.6596 5.30807C11.6479 5.41693 11.5661 5.74615 11.5268 5.89696C11.6745 5.83642 11.9968 5.66756 12.103 5.47428C12.2357 5.2332 12.8124 4.35757 12.9749 4.1011C13.105 3.89613 13.4981 3.45768 13.6357 3.32121C13.4806 2.86774 13.225 2.37374 12.9802 2.15443C12.7731 2.45179 12.3302 3.09325 12.2357 3.286C12.1178 3.52761 11.6745 5.17267 11.6596 5.30807Z",fill:"#005FC8"})]});import{jsx as S2,jsxs as n7}from"react/jsx-runtime";var i7=C=>n7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[S2("title",{children:"Racing"}),S2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0C6.74815 0 5.25254 0.490325 3.90601 1.08072C2.54543 1.67729 1.27479 2.40428 0.451996 2.93383C0.163413 3.11956 0 3.43643 0 3.76759V15.0764C0 15.3989 0.234532 15.6053 0.460495 15.6605C0.684948 15.7154 0.983306 15.6423 1.13515 15.3645C2.13716 13.5318 3.67233 11.9171 5.09281 10.6934C6.42772 9.54343 7.62847 8.76663 8.13292 8.49439C8.49381 8.93562 8.94276 9.26219 9.30918 9.48228C9.80958 9.78285 10.1741 10.1722 10.2873 10.6222C10.3628 10.9222 10.4423 11.2611 10.5097 11.5981C10.8089 13.0944 12.1473 14.0415 13.4266 14.0693C14.0812 14.0836 14.7418 13.8575 15.2346 13.3234C15.7249 12.792 15.9999 12.0097 15.9999 11C15.9999 9.93478 15.7361 8.75919 15.4268 7.52091C15.3734 7.30715 15.3183 7.09022 15.2627 6.87138C14.9921 5.80571 14.7055 4.67741 14.5007 3.46294C14.5088 3.25084 14.5792 2.84887 14.7584 2.51479C14.9325 2.19034 15.1606 2.00379 15.4895 1.99994C15.5238 2.00063 15.558 1.99778 15.5914 1.99154C15.7336 1.965 15.8628 1.87725 15.9375 1.74209C15.951 1.71761 15.9626 1.69187 15.972 1.6651C16.0017 1.58067 16.0072 1.49232 15.9916 1.40851C15.9677 1.2807 15.8944 1.16345 15.7817 1.0868C15.7598 1.07177 15.7365 1.05846 15.7122 1.04704C15.1366 0.762033 14.399 0.607354 13.704 0.76179C13.2082 0.871971 12.7543 1.13644 12.4179 1.58137C12.1739 1.31602 11.8587 1.03862 11.4424 0.791927C10.6637 0.330538 9.57182 0 8 0ZM12.5 7C12.7761 7 13 6.77614 13 6.5C13 6.22386 12.7761 6 12.5 6C12.2239 6 12 6.22386 12 6.5C12 6.77614 12.2239 7 12.5 7Z",fill:"#AD886B"}),S2("path",{d:"M9.99651 10.0593C9.82228 9.84286 9.58661 9.64892 9.30918 9.48228C8.94276 9.26219 8.49381 8.93562 8.13292 8.49439C8.06581 8.53061 7.98638 8.57576 7.89595 8.62952C7.47492 7.75481 7.36085 6.89014 7.54364 6.15328C7.69747 5.53314 8.06462 5.0114 8.62182 4.70341C9.17628 4.39693 9.86556 4.33096 10.6183 4.51422C10.8866 4.57954 11.0511 4.85 10.9858 5.1183C10.9205 5.38661 10.65 5.55116 10.3817 5.48584C9.8173 5.34842 9.39526 5.41849 9.10558 5.57861C8.81865 5.73721 8.60883 6.01263 8.51422 6.39404C8.32166 7.1703 8.62025 8.40983 9.85404 9.64695C9.96645 9.75966 10.0139 9.9126 9.99651 10.0593Z",fill:"#654D38"})]});import{jsx as z1,jsxs as p7}from"react/jsx-runtime";var d7=C=>p7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[z1("title",{children:"Refer"}),z1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1C6.34315 1 5 2.34315 5 4C5 5.65685 6.34315 7 8 7C9.65685 7 11 5.65685 11 4C11 2.34315 9.65685 1 8 1ZM4 4C4 1.79086 5.79086 0 8 0C10.2091 0 12 1.79086 12 4C12 6.20914 10.2091 8 8 8C5.79086 8 4 6.20914 4 4Z",fill:"#99A8B1"}),z1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.49993 7.49166C8.50454 7.76776 8.28445 7.99532 8.00834 7.99993C5.22889 8.04632 3 10.3127 3 13.0926V13.6515C3 14.3962 3.60374 15 4.3485 15L8 15C8.27614 15 8.5 15.2239 8.5 15.5C8.5 15.7761 8.27614 16 8 16L4.3485 16C3.05146 16 2 14.9485 2 13.6515V13.0926C2 9.76694 4.6665 7.05557 7.99166 7.00007C8.26776 6.99546 8.49532 7.21555 8.49993 7.49166Z",fill:"#99A8B1"}),z1("path",{d:"M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z",fill:"#1BB152"}),z1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4 10.4C12.4 10.1791 12.2209 10 12 10C11.7791 10 11.6 10.1791 11.6 10.4V11.6H10.4C10.1791 11.6 10 11.7791 10 12C10 12.2209 10.1791 12.4 10.4 12.4H11.6V13.6C11.6 13.8209 11.7791 14 12 14C12.2209 14 12.4 13.8209 12.4 13.6V12.4H13.6C13.8209 12.4 14 12.2209 14 12C14 11.7791 13.8209 11.6 13.6 11.6H12.4V10.4Z",fill:"#fff"})]});import{jsx as Z5,jsxs as c7}from"react/jsx-runtime";var s7=C=>c7("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[Z5("title",{children:"Rugby"}),Z5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 13C9.937 16.063 5.059 16.444 2.5 16.5C2.63398 16.4822 2.108 16.032 2 16C2.838 14.583 7.59819 6.777 16.0002 2C16.0392 2.115 16.503 2.36 16.5 2.5C16.443 5.06 16.061 9.938 13 13Z",fill:"#EAF0F6"}),Z5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0198 2.36964C16.0205 2.14597 15.854 1.97944 15.6303 1.9801C14.6067 1.98316 12.7842 2.06921 10.836 2.5398C8.88279 3.01159 6.8478 3.85923 5.35343 5.35357C3.85906 6.84792 3.01142 8.8829 2.53964 10.8361C2.06906 12.7843 1.98302 14.6068 1.97998 15.6304C1.97932 15.8541 2.14585 16.0206 2.36952 16.0199C3.39307 16.0169 5.21564 15.9308 7.16384 15.4602C9.11702 14.9884 11.152 14.1408 12.6464 12.6464C14.1407 11.1521 14.9884 9.1171 15.4601 7.16394C15.9307 5.21575 16.0168 3.39319 16.0198 2.36964ZM15.6273 0.980109C16.4056 0.977788 17.0221 1.59434 17.0198 2.37262C17.0166 3.44084 16.9276 5.34786 16.4322 7.39874C15.938 9.44464 15.0288 11.6782 13.3535 13.3535C11.6781 15.0289 9.44456 15.9381 7.39864 16.4323C5.34776 16.9277 3.44072 17.0167 2.37251 17.0199C1.59423 17.0222 0.977674 16.4057 0.979987 15.6274C0.983161 14.5592 1.07221 12.6522 1.56759 10.6013C2.06178 8.55536 2.97097 6.32178 4.64633 4.64646C6.32167 2.97114 8.55525 2.06194 10.6012 1.56775C12.6521 1.07236 14.5591 0.983295 15.6273 0.980109Z",fill:"#99A8B1"}),Z5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.2237 2.44723C16.2237 2.44725 16.2238 2.44721 16.2237 2.44723L16.2222 2.44799L16.2149 2.45167L16.1835 2.46777C16.1552 2.48239 16.1123 2.50478 16.0557 2.53495C15.9426 2.59528 15.775 2.68668 15.5607 2.80914C15.132 3.0541 14.5169 3.4231 13.7775 3.91604C12.2978 4.90249 10.3251 6.38218 8.35366 8.35357C6.38227 10.325 4.90258 12.2977 3.91613 13.7774C3.42319 14.5168 3.05419 15.1319 2.80923 15.5606C2.68677 15.7749 2.59537 15.9425 2.53504 16.0556C2.50487 16.1122 2.48248 16.1551 2.46786 16.1834L2.45176 16.2149L2.44808 16.2221L2.44734 16.2236C2.3238 16.4705 2.02345 16.5707 1.7765 16.4472C1.52951 16.3237 1.4294 16.0234 1.5529 15.7764L2.00011 16C1.5529 15.7764 1.55284 15.7765 1.5529 15.7764L1.55361 15.775L1.55507 15.7721L1.56018 15.762L1.57924 15.7248C1.59587 15.6926 1.62035 15.6457 1.65268 15.585C1.71735 15.4638 1.81345 15.2876 1.94099 15.0644C2.19603 14.6181 2.57703 13.9833 3.08408 13.2227C4.09764 11.7023 5.61795 9.67507 7.64656 7.64647C9.67516 5.61786 11.7024 4.09755 13.2228 3.08399C13.9833 2.57694 14.6182 2.19594 15.0645 1.9409C15.2877 1.81336 15.4639 1.71726 15.5851 1.65259C15.6458 1.62026 15.6927 1.59578 15.7249 1.57915L15.7621 1.56009L15.7722 1.55498L15.7751 1.55352L15.776 1.55307C15.7761 1.55301 15.7765 1.55281 16.0001 2.00002L15.776 1.55307C16.023 1.42958 16.3238 1.52942 16.4473 1.77641C16.5708 2.02336 16.4706 2.3237 16.2237 2.44723Z",fill:"#99A8B1"})]});import{jsx as h,jsxs as h7}from"react/jsx-runtime";var f7=C=>h7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[h("title",{children:"Soccer"}),h("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#fff"}),h("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"#99A8B1"}),h("path",{d:"M4.50001 3.14642L6.85356 5.49998L6.50001 5.85353L4.14645 3.49998L4.50001 3.14642Z",fill:"#99A8B1"}),h("path",{d:"M11.8536 3.49998L9.50001 5.85353L9.14645 5.49998L11.5 3.14642L11.8536 3.49998Z",fill:"#99A8B1"}),h("path",{d:"M2.36074 9.82497L5.32498 8.63929L5.13929 8.17505L2.17505 9.36073L2.36074 9.82497Z",fill:"#99A8B1"}),h("path",{d:"M11.0929 8.26788L13.825 9.36072L13.6393 9.82495L10.9072 8.73212L11.0929 8.26788Z",fill:"#99A8B1"}),h("path",{d:"M8.25 13.8733V11.25H7.75V13.8733H8.25Z",fill:"#99A8B1"}),h("path",{d:"M1.41728 3.45256C2.3865 2.0522 3.79107 0.976112 5.43528 0.419983C5.81277 0.681552 5.96854 1.17495 5.79337 1.61287L5.08996 3.3714C4.93809 3.75106 4.57039 4.00001 4.16148 4.00001H2.30902C1.93224 4.00001 1.58762 3.78826 1.41728 3.45256Z",fill:"#445058"}),h("path",{d:"M10.5647 0.419983C12.2089 0.976112 13.6135 2.0522 14.5827 3.45256C14.4124 3.78826 14.0678 4.00001 13.691 4.00001H11.8385C11.4296 4.00001 11.0619 3.75106 10.91 3.3714L10.2066 1.61287C10.0315 1.17495 10.1872 0.681552 10.5647 0.419983Z",fill:"#445058"}),h("path",{d:"M15.9976 8.19702C15.9546 9.97684 15.3303 11.6126 14.3073 12.9217L13.7209 12.5308C13.5005 12.3839 13.3475 12.1556 13.2952 11.896L12.9085 9.97485C12.8194 9.53227 13.0379 9.08489 13.4417 8.88304L14.917 8.1456C15.1541 8.02709 15.4286 8.00756 15.6801 8.09129L15.9976 8.19702Z",fill:"#445058"}),h("path",{d:"M10.5 15.6016V15.25C10.5 14.9353 10.3518 14.6389 10.1 14.45L8.6 13.325C8.24444 13.0583 7.75555 13.0583 7.4 13.325L5.9 14.45C5.64819 14.6389 5.5 14.9353 5.5 15.25V15.6016C6.28655 15.8602 7.12694 16 8 16C8.87306 16 9.71345 15.8602 10.5 15.6016Z",fill:"#445058"}),h("path",{d:"M1.6336 12.8452C0.634856 11.5349 0.0314149 9.90704 0.00119019 8.13954L0.14611 8.09129C0.397593 8.00756 0.672032 8.02709 0.909121 8.1456L2.38443 8.88304C2.78825 9.08489 3.00674 9.53227 2.91766 9.97485L2.53095 11.896C2.4787 12.1556 2.32563 12.3839 2.10531 12.5308L1.6336 12.8452Z",fill:"#445058"}),h("path",{d:"M7.4 11.55C7.75556 11.8167 8.24445 11.8167 8.6 11.55L11.3323 9.50075C11.719 9.21077 11.8429 8.6858 11.6268 8.25353L10.2764 5.55279C10.107 5.214 9.76074 5 9.38197 5H6.61803C6.23926 5 5.893 5.214 5.72361 5.55279L4.37323 8.25353C4.1571 8.6858 4.28103 9.21077 4.66766 9.50075L7.4 11.55Z",fill:"#445058"})]});import{jsx as S5,jsxs as L7}from"react/jsx-runtime";var a7=C=>L7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[S5("title",{children:"Squares"}),S5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H16V16H0V0ZM1 1V15H15V1H1Z",fill:"#fff"}),S5("path",{d:"M7.32177 10.2902C7.32177 10.661 7.2598 11.0107 7.13619 11.3388C7.01258 11.6669 6.83646 11.95 6.60816 12.1878C6.37985 12.4255 6.10393 12.6137 5.78072 12.7513C5.45718 12.889 5.09091 12.9581 4.68225 12.9581C3.84502 12.9581 3.18881 12.7419 2.71329 12.3091C2.23744 11.8763 2 11.27 2 10.4898V9.80491H3.91189V10.4898C3.91189 10.6992 3.96896 10.8704 4.08311 11.0035C4.19727 11.1369 4.3636 11.2031 4.58245 11.2031C5.0009 11.2031 5.21028 10.9653 5.21028 10.4898C5.21028 10.1568 5.08667 9.85253 4.83945 9.5766C4.59191 9.30068 4.28761 8.99639 3.92624 8.66339C3.70739 8.4827 3.48854 8.28766 3.27002 8.07828C3.05118 7.86921 2.85125 7.64319 2.67089 7.40054C2.4902 7.15788 2.34278 6.89664 2.22863 6.61582C2.11448 6.33534 2.0574 6.03332 2.0574 5.70978C2.0574 5.36733 2.11448 5.03465 2.22863 4.71111C2.34278 4.3879 2.5114 4.10252 2.73514 3.85497C2.95855 3.60775 3.23904 3.41043 3.57693 3.26301C3.91449 3.11559 4.30685 3.04188 4.754 3.04188C5.11538 3.04188 5.44837 3.10385 5.75267 3.22746C6.05697 3.35107 6.31626 3.5223 6.53021 3.74115C6.74416 3.95999 6.9105 4.21928 7.02954 4.51869C7.14826 4.81842 7.20795 5.14424 7.20795 5.49615V6.10964H5.29606V5.42473C5.29606 5.23458 5.24616 5.08488 5.14636 4.97529C5.04656 4.86603 4.91577 4.81124 4.754 4.81124C4.60169 4.81124 4.46634 4.86375 4.34729 4.96812C4.22825 5.07281 4.16889 5.22969 4.16889 5.43908C4.16889 5.62955 4.20216 5.79817 4.26869 5.94559C4.33523 6.09333 4.42785 6.23586 4.5469 6.3735C4.66562 6.51146 4.80358 6.6517 4.96078 6.79423C5.11798 6.93675 5.2866 7.09396 5.46729 7.26519C5.68614 7.46479 5.90726 7.67189 6.13068 7.88585C6.35409 8.0998 6.55369 8.32811 6.72981 8.57076C6.90561 8.81342 7.04846 9.07727 7.15772 9.36265C7.26698 9.64803 7.32177 9.95722 7.32177 10.2902Z",fill:"#fff"}),S5("path",{d:"M13.9989 12.7442C13.9037 12.8202 13.7895 12.8749 13.6565 12.9082C13.5231 12.9415 13.3473 12.9581 13.1284 12.9581C12.9096 12.9581 12.6979 12.9082 12.4934 12.8084C12.2889 12.7086 12.1343 12.5967 12.0296 12.4731C11.8679 12.6065 11.6679 12.7207 11.4305 12.8156C11.1927 12.9105 10.893 12.9581 10.5316 12.9581C10.1892 12.9581 9.86106 12.8984 9.5473 12.7797C9.23355 12.661 8.95991 12.4921 8.72704 12.2732C8.49384 12.0544 8.30826 11.7931 8.17063 11.4885C8.03266 11.1842 7.96385 10.8463 7.96385 10.4755V5.51018C7.96385 5.13935 8.03527 4.80407 8.1778 4.50433C8.32065 4.2046 8.51536 3.94564 8.76291 3.7268C9.01013 3.50795 9.30008 3.33933 9.6334 3.22029C9.9664 3.10157 10.3278 3.04188 10.7178 3.04188C11.1079 3.04188 11.4572 3.10124 11.7951 3.22029C12.1327 3.33933 12.423 3.50795 12.6656 3.7268C12.9083 3.94564 13.1007 4.2046 13.2435 4.50433C13.3864 4.80407 13.4575 5.13935 13.4575 5.51018V10.3183C13.4575 10.6513 13.4099 10.9128 13.315 11.103C13.3815 11.1695 13.4575 11.2171 13.5433 11.2455C13.6287 11.2742 13.781 11.2882 13.9999 11.2882V12.7435L13.9989 12.7442ZM11.2165 5.38233C11.2165 5.23034 11.1666 5.11358 11.0668 5.0327C10.967 4.95214 10.8503 4.91137 10.7172 4.91137C10.5841 4.91137 10.4651 4.95181 10.3604 5.0327C10.2557 5.11358 10.2035 5.23034 10.2035 5.38233V10.6043C10.2035 10.7566 10.2557 10.873 10.3604 10.9539C10.4651 11.0348 10.5838 11.0753 10.7172 11.0753C10.8219 11.0753 10.9168 11.0466 11.0026 10.9898L10.6317 10.633L11.2169 9.87666L11.2165 5.38233Z",fill:"#fff"})]});import{jsx as G5,jsxs as u7}from"react/jsx-runtime";var g7=C=>u7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[G5("title",{children:"Tennis"}),G5("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#C0EC3E"}),G5("path",{d:"M8.74948 0.0346455C8.50273 0.0117198 8.25274 0 8 0C7.74667 0 7.49609 0.0117752 7.24877 0.034808C7.24825 0.0467403 7.24752 0.0613789 7.24647 0.0786238C7.24256 0.143409 7.23434 0.244782 7.21715 0.377473C7.18273 0.64305 7.11255 1.03264 6.96966 1.50467C6.6843 2.44733 6.10914 3.71898 4.94582 4.99461C3.92626 6.11262 2.68895 6.67966 1.68834 6.96653C1.1896 7.10951 0.757024 7.18065 0.45253 7.2159C0.300611 7.23348 0.181556 7.24201 0.103273 7.24614C0.0749122 7.24764 0.0519533 7.24856 0.0347758 7.24912C0.0117642 7.49632 0 7.74679 0 8C0 8.25276 0.0117216 8.50277 0.0346509 8.74954L0.0556652 8.74913C0.0863788 8.74836 0.12895 8.74688 0.182341 8.74406C0.289064 8.73843 0.439394 8.72743 0.624985 8.70595C0.99551 8.66306 1.51046 8.57795 2.10173 8.40844C3.28115 8.07031 4.79385 7.38735 6.05416 6.00536C7.39084 4.53961 8.06568 3.06125 8.40532 1.93926C8.57493 1.37897 8.661 0.907564 8.70471 0.570232C8.72658 0.401468 8.73789 0.265907 8.74374 0.169121C8.74667 0.120715 8.74823 0.0819614 8.74906 0.0535542L8.74948 0.0346455Z",fill:"#fff"}),G5("path",{d:"M7.97977 16C7.73389 15.9994 7.49062 15.9877 7.25043 15.9653L7.25083 15.9443C7.25161 15.9136 7.25309 15.871 7.25591 15.8176C7.26154 15.7109 7.27254 15.5606 7.29402 15.375C7.3369 15.0045 7.42201 14.4895 7.59153 13.8982C7.92966 12.7188 8.61262 11.2061 9.99461 9.94581C11.4604 8.60913 12.9387 7.93429 14.0607 7.59464C14.621 7.42503 15.0924 7.33897 15.4297 7.29526C15.5985 7.27339 15.7341 7.26208 15.8308 7.25623C15.8793 7.2533 15.918 7.25174 15.9464 7.25091L15.9654 7.25048C15.9878 7.49178 15.9995 7.73619 16 7.98322C16 7.98876 16 7.99437 16 8C16 8.00563 16 8.01118 16 8.01673C15.9995 8.26435 15.9877 8.50933 15.9652 8.75119C15.9533 8.75171 15.9386 8.75245 15.9213 8.75349C15.8566 8.75741 15.7552 8.76563 15.6225 8.78282C15.3569 8.81723 14.9673 8.88742 14.4953 9.03031C13.5526 9.31567 12.281 9.89083 11.0054 11.0541C9.88735 12.0737 9.32031 13.311 9.03344 14.3116C8.89045 14.8104 8.81931 15.2429 8.78407 15.5474C8.76649 15.6994 8.75795 15.8184 8.75382 15.8967C8.75232 15.9251 8.75141 15.948 8.75085 15.9652C8.5107 15.9876 8.26748 15.9993 8.02165 16C8.0145 16 8.00729 16 8 16C7.9932 16 7.98645 16 7.97977 16Z",fill:"#fff"})]});import{jsx as P5,jsxs as v7}from"react/jsx-runtime";var V7=C=>v7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[P5("title",{children:"Trending"}),P5("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#0070EB"}),P5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.8345 4.62836C13.0397 4.81309 13.0564 5.12923 12.8716 5.33449L8.37165 10.3345C8.27989 10.4364 8.15027 10.4962 8.01314 10.4998C7.87602 10.5034 7.74344 10.4506 7.64645 10.3536L5.99999 8.7071L3.85354 10.8534C3.65827 11.0486 3.34169 11.0486 3.14643 10.8534C2.95118 10.6581 2.95119 10.3415 3.14646 10.1463L5.64646 7.64644C5.84172 7.45119 6.1583 7.45119 6.35355 7.64645L7.9809 9.2738L12.1284 4.66552C12.3131 4.46027 12.6292 4.44363 12.8345 4.62836Z",fill:"#fff"}),P5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 5C9 4.72386 9.22386 4.5 9.5 4.5H12.5C12.7761 4.5 13 4.72386 13 5V8C13 8.27615 12.7761 8.5 12.5 8.5C12.2239 8.5 12 8.27615 12 8V5.5H9.5C9.22386 5.5 9 5.27615 9 5Z",fill:"#fff"})]});import{jsx as X1,jsxs as w7}from"react/jsx-runtime";var m7=C=>w7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[X1("title",{children:"Womens"}),X1("path",{d:"M4.5 12C6.98528 12 9 9.98528 9 7.5C9 5.01472 6.98528 3 4.5 3C2.01472 3 0 5.01472 0 7.5C0 9.98528 2.01472 12 4.5 12Z",fill:"#C8E2FF"}),X1("path",{d:"M9.06117 7.46197C9.06117 4.99771 6.99142 3 4.43796 3C2.15552 3 0.416238 4.69954 0 5.5C0.173813 5.95283 0.353063 6.92481 5.5 7.5L6 6C5.87421 6.83934 5.98571 9.70698 7 11.5C7.64723 11.1181 9.06117 9.42081 9.06117 7.46197Z",fill:"#0070EB"}),X1("path",{d:"M12 4.99994C10.9594 2.42705 9.01315 4.22471 8 4.76559C9.71298 4.53461 8.45512 6.18096 10 8.5C11.0932 10.1398 15 11 15.9999 9.91133C13.0725 9.36816 13.211 7.99365 12 4.99994Z",fill:"#0070EB"}),X1("path",{d:"M7.92006 4.74272L8.12979 5.1246C8.22099 5.29067 8.43075 5.35415 8.59831 5.26638C8.76586 5.17862 8.82775 4.97285 8.73655 4.80678L8.52683 4.4249C8.43563 4.25883 8.22587 4.19535 8.05831 4.28312C7.89076 4.37088 7.82886 4.57665 7.92006 4.74272Z",fill:"#FFDC2E"})]});import{jsx as Y1,jsxs as M7}from"react/jsx-runtime";var H7=C=>M7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[Y1("title",{children:"ActionToken"}),Y1("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#FFDC2E"}),Y1("path",{d:"M8 2C4.68629 2 2 4.6863 2 8.00001C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8.00001C14 7.72387 14.2239 7.50001 14.5 7.50001C14.7761 7.50001 15 7.72387 15 8.00001C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8.00001C1 4.13402 4.13401 1 8 1C8.27614 1 8.5 1.22386 8.5 1.5C8.5 1.77614 8.27614 2 8 2Z",fill:"#05285A"}),Y1("path",{d:"M7.48422 3.87537C7.55305 4.1428 7.39206 4.41539 7.12463 4.48422C5.63272 4.86821 4.5 6.35128 4.5 8.00002C4.5 9.93302 6.067 11.5 8 11.5C9.64873 11.5 11.1318 10.3673 11.5158 8.87537C11.5846 8.60794 11.8572 8.44695 12.1246 8.51578C12.3921 8.58461 12.553 8.8572 12.4842 9.12463C11.9801 11.0832 10.079 12.5 8 12.5C5.51472 12.5 3.5 10.4853 3.5 8.00002C3.5 5.92107 4.91682 4.01988 6.87537 3.51578C7.1428 3.44695 7.41539 3.60794 7.48422 3.87537Z",fill:"#05285A"}),Y1("path",{d:"M11.5269 2.08514C11.433 1.61523 10.8532 1.43968 10.5143 1.77854L9.17574 3.11713C9.06321 3.22965 9 3.38226 9 3.54139V6.29289L7.64645 7.64645C7.45118 7.84171 7.45118 8.15829 7.64645 8.35355C7.84171 8.54882 8.15829 8.54881 8.35355 8.35355L9.70715 6.99995H12.4586C12.6177 6.99995 12.7703 6.93673 12.8828 6.82422L14.2214 5.48565C14.5603 5.1468 14.3847 4.56702 13.9148 4.47304L11.9249 4.07506L11.5269 2.08514Z",fill:"#05285A"})]});import{jsx as x5,jsxs as Z7}from"react/jsx-runtime";var R7=C=>Z7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[x5("title",{children:"BetBackToken"}),x5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C6.44823 0 4.99964 0.441818 3.77318 1.20652C3.50821 0.782256 3.03707 0.5 2.5 0.5C1.67157 0.5 1 1.17157 1 2L1 4.12399C0.362837 5.27224 0 6.59375 0 8C0 12.4183 3.58172 16 8 16Z",fill:"#FFDC2E"}),x5("path",{d:"M3.52774 4C4.62689 2.77187 6.22337 2 8 2C11.3137 2 14 4.68629 14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 7.68557 2.02414 7.37711 2.07059 7.0763C2.11273 6.80339 1.92566 6.548 1.65275 6.50586C1.37984 6.46372 1.12444 6.65079 1.0823 6.9237C1.02809 7.27483 1 7.6343 1 8C1 11.866 4.13401 15 8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C6.04098 1 4.2701 1.80502 3 3.10108L3 2C3 1.72386 2.77614 1.5 2.5 1.5C2.22386 1.5 2 1.72386 2 2L2 4.5C2 4.63261 2.05268 4.75978 2.14645 4.85355C2.24021 4.94732 2.36739 5 2.5 5H5C5.27614 5 5.5 4.77614 5.5 4.5C5.5 4.22386 5.27614 4 5 4L3.52774 4Z",fill:"#05285A"}),x5("path",{d:"M7.5 5L7.5 4.5C7.5 4.22386 7.72386 4 8 4C8.27614 4 8.5 4.22386 8.5 4.5L8.5 5C9.32843 5 10 5.67157 10 6.5C10 6.77614 9.77614 7 9.5 7C9.22386 7 9 6.77614 9 6.5C9 6.22386 8.77614 6 8.5 6H7.5C7.22386 6 7 6.22386 7 6.5V6.77924C7 6.99446 7.13772 7.18553 7.34189 7.25358L8.97434 7.79773C9.58685 8.00191 10 8.57511 10 9.22076V9.5C10 10.3284 9.32843 11 8.5 11L8.5 11.5C8.5 11.7761 8.27614 12 8 12C7.72386 12 7.5 11.7761 7.5 11.5L7.5 11C6.67157 11 6 10.3284 6 9.5C6 9.22386 6.22386 9 6.5 9C6.77614 9 7 9.22386 7 9.5C7 9.77614 7.22386 10 7.5 10H8.5C8.77614 10 9 9.77614 9 9.5V9.22076C9 9.00554 8.86228 8.81448 8.65811 8.74642L7.02566 8.20227C6.41315 7.99809 6 7.42489 6 6.77924V6.5C6 5.67157 6.67157 5 7.5 5Z",fill:"#05285A"})]});import{jsx as b5,jsxs as G7}from"react/jsx-runtime";var S7=C=>G7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[b5("title",{children:"BonusBet"}),b5("path",{d:"M0.485523 9.31828C-0.16184 8.55864 -0.161841 7.44136 0.485522 6.68172L1.18894 5.85629C1.46635 5.53077 1.634 5.12603 1.66803 4.69969L1.7543 3.61863C1.83369 2.62373 2.62372 1.83369 3.61863 1.7543L4.69969 1.66803C5.12603 1.634 5.53077 1.46635 5.85629 1.18894L6.68172 0.485523C7.44136 -0.16184 8.55864 -0.161841 9.31828 0.485522L10.1437 1.18894C10.4692 1.46635 10.874 1.634 11.3003 1.66803L12.3814 1.7543C13.3763 1.83369 14.1663 2.62372 14.2457 3.61863L14.332 4.69969C14.366 5.12603 14.5336 5.53077 14.8111 5.85629L15.5145 6.68172C16.1618 7.44136 16.1618 8.55864 15.5145 9.31828L14.8111 10.1437C14.5336 10.4692 14.366 10.874 14.332 11.3003L14.2457 12.3814C14.1663 13.3763 13.3763 14.1663 12.3814 14.2457L11.3003 14.332C10.874 14.366 10.4692 14.5336 10.1437 14.8111L9.31828 15.5145C8.55864 16.1618 7.44136 16.1618 6.68172 15.5145L5.85629 14.8111C5.53077 14.5336 5.12603 14.366 4.69969 14.332L3.61863 14.2457C2.62373 14.1663 1.83369 13.3763 1.7543 12.3814L1.66803 11.3003C1.634 10.874 1.46635 10.4692 1.18894 10.1437L0.485523 9.31828Z",fill:"#FFDC2E"}),b5("path",{d:"M7.5 4.5L7.5 5C6.67157 5 6 5.67157 6 6.5V6.77924C6 7.42489 6.41315 7.99809 7.02566 8.20227L8.65811 8.74642C8.86228 8.81448 9 9.00554 9 9.22076V9.5C9 9.77614 8.77614 10 8.5 10H7.5C7.22386 10 7 9.77614 7 9.5C7 9.22386 6.77614 9 6.5 9C6.22386 9 6 9.22386 6 9.5C6 10.3284 6.67157 11 7.5 11L7.5 11.5C7.5 11.7761 7.72386 12 8 12C8.27614 12 8.5 11.7761 8.5 11.5L8.5 11C9.32843 11 10 10.3284 10 9.5V9.22076C10 8.57511 9.58685 8.00191 8.97434 7.79773L7.34189 7.25358C7.13772 7.18553 7 6.99446 7 6.77924V6.5C7 6.22386 7.22386 6 7.5 6H8.5C8.77614 6 9 6.22386 9 6.5C9 6.77614 9.22386 7 9.5 7C9.77614 7 10 6.77614 10 6.5C10 5.67157 9.32843 5 8.5 5L8.5 4.5C8.5 4.22386 8.27614 4 8 4C7.72386 4 7.5 4.22386 7.5 4.5Z",fill:"#05285A"}),b5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.36981 9.16318C0.798606 8.4929 0.798605 7.50707 1.36981 6.8368L1.99047 6.10848C2.23525 5.82125 2.38317 5.46413 2.41319 5.08795L2.48931 4.13407C2.55937 3.25621 3.25646 2.55912 4.13431 2.48907L5.08819 2.41295C5.46437 2.38293 5.8215 2.235 6.10872 1.99023L6.83704 1.36956C7.50731 0.798362 8.49315 0.798361 9.16342 1.36956L9.89174 1.99023C10.179 2.235 10.5361 2.38293 10.9123 2.41295L11.8661 2.48907C12.744 2.55912 13.4411 3.25621 13.5111 4.13407L13.5873 5.08794C13.6173 5.46413 13.7652 5.82125 14.01 6.10848L14.6307 6.83679C15.2019 7.50707 15.2019 8.4929 14.6307 9.16318L14.01 9.89149C13.7652 10.1787 13.6173 10.5358 13.5873 10.912L13.5111 11.8659C13.4411 12.7438 12.744 13.4408 11.8661 13.5109L10.9123 13.587C10.5361 13.617 10.179 13.765 9.89174 14.0097L9.16342 14.6304C8.49315 15.2016 7.50731 15.2016 6.83704 14.6304L6.10872 14.0097C5.8215 13.765 5.46437 13.617 5.08819 13.587L4.13431 13.5109C3.25646 13.4408 2.55937 12.7438 2.48931 11.8659L2.41319 10.912C2.38317 10.5358 2.23525 10.1787 1.99048 9.89149L1.36981 9.16318ZM2.13092 7.48541L2.75159 6.7571C3.13285 6.30971 3.36327 5.75344 3.41003 5.16749L3.48614 4.21362C3.51714 3.82527 3.82552 3.51689 4.21386 3.4859L5.16774 3.40978C5.75368 3.36302 6.30995 3.13261 6.75734 2.75135L7.48566 2.13068C7.78217 1.87799 8.21829 1.87799 8.5148 2.13068L9.24312 2.75135C9.69051 3.13261 10.2468 3.36302 10.8327 3.40978L11.7866 3.4859C12.1749 3.51689 12.4833 3.82527 12.5143 4.21362L12.5904 5.16749C12.6372 5.75344 12.8676 6.3097 13.2489 6.7571L13.8695 7.48541C14.1222 7.78193 14.1222 8.21804 13.8695 8.51456L13.2489 9.24288C12.8676 9.69027 12.6372 10.2465 12.5904 10.8325L12.5143 11.7864C12.4833 12.1747 12.1749 12.4831 11.7866 12.5141L10.8327 12.5902C10.2468 12.6369 9.69051 12.8674 9.24312 13.2486L8.5148 13.8693C8.21829 14.122 7.78217 14.122 7.48566 13.8693L6.75734 13.2486C6.30995 12.8674 5.75368 12.6369 5.16774 12.5902L4.21386 12.5141C3.82551 12.4831 3.51714 12.1747 3.48615 11.7864L3.41003 10.8325C3.36327 10.2465 3.13285 9.69027 2.75159 9.24288L2.13092 8.51456C1.87823 8.21804 1.87823 7.78193 2.13092 7.48541Z",fill:"#05285A"})]});import{jsx as Q1,jsxs as x7}from"react/jsx-runtime";var P7=C=>x7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[Q1("title",{children:"BoostBuilder"}),Q1("path",{d:"M15.5217 10.7311C15.8312 9.87886 16 8.95914 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C8.95975 16 9.88003 15.831 10.7327 15.5211C11.2516 15.8255 11.8559 16 12.501 16C14.434 16 16.001 14.433 16.001 12.5C16.001 11.8547 15.8263 11.2501 15.5217 10.7311Z",fill:"#FFDC2E"}),Q1("path",{d:"M12.001 13V14.5C12.001 14.7761 12.2248 15 12.501 15C12.7771 15 13.001 14.7761 13.001 14.5V13H14.501C14.7771 13 15.001 12.7761 15.001 12.5C15.001 12.2239 14.7771 12 14.501 12H13.001V10.5C13.001 10.2239 12.7771 10 12.501 10C12.2248 10 12.001 10.2239 12.001 10.5V12H10.501C10.2248 12 10.001 12.2239 10.001 12.5C10.001 12.7761 10.2248 13 10.501 13H12.001Z",fill:"#05285A"}),Q1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8585 2.72416C9.72265 2.10896 8.4186 1.87676 7.14022 2.06207C5.86184 2.24739 4.67739 2.84032 3.76299 3.75272C2.84859 4.66512 2.25306 5.84825 2.06495 7.12622C1.87683 8.4042 2.10618 9.70876 2.71888 10.8459C3.33158 11.9831 4.29493 12.8922 5.46569 13.438C6.63645 13.9839 7.9521 14.1373 9.21703 13.8755C9.48744 13.8195 9.75202 13.9933 9.80799 14.2638C9.86396 14.5342 9.69012 14.7987 9.4197 14.8547C7.94395 15.1602 6.40902 14.9812 5.04314 14.3444C3.67725 13.7076 2.55335 12.647 1.83853 11.3203C1.12371 9.99355 0.856142 8.47156 1.07561 6.9806C1.29508 5.48963 1.98986 4.1093 3.05666 3.04484C4.12346 1.98037 5.50531 1.28862 6.99676 1.07242C8.4882 0.856217 10.0096 1.12712 11.3347 1.84485C12.6599 2.56258 13.718 3.6888 14.3518 5.05608C14.9856 6.42335 15.1612 7.95867 14.8526 9.43375C14.796 9.70404 14.531 9.8773 14.2608 9.82074C13.9905 9.76418 13.8172 9.49922 13.8738 9.22893C14.1383 7.96457 13.9878 6.64859 13.4446 5.47664C12.9013 4.30469 11.9943 3.33935 10.8585 2.72416Z",fill:"#05285A"}),Q1("path",{d:"M9.48895 4.32353C9.52314 4.2124 9.47621 4.09236 9.3757 4.0339C9.27519 3.97544 9.14764 3.994 9.06796 4.07867L5.06796 8.32869C4.9996 8.40132 4.98095 8.50763 5.02051 8.59919C5.06007 8.69075 5.15027 8.75003 5.25001 8.75003H7.41152L6.51106 11.6765C6.47687 11.7876 6.5238 11.9077 6.62431 11.9661C6.72482 12.0246 6.85237 12.006 6.93206 11.9213L10.9321 7.67137C11.0004 7.59874 11.0191 7.49243 10.9795 7.40087C10.9399 7.30932 10.8497 7.25003 10.75 7.25003H8.5885L9.48895 4.32353Z",fill:"#05285A"})]});import{jsx as $1,jsxs as y7}from"react/jsx-runtime";var b7=C=>y7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[$1("title",{children:"DepositBoost"}),$1("path",{d:"M15.5217 10.7311C15.8312 9.87886 16 8.95914 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C8.95975 16 9.88003 15.831 10.7327 15.5211C11.2516 15.8255 11.8559 16 12.501 16C14.434 16 16.001 14.433 16.001 12.5C16.001 11.8547 15.8263 11.2501 15.5217 10.7311Z",fill:"#FFDC2E"}),$1("path",{d:"M10.8585 2.72416C9.72265 2.10896 8.4186 1.87676 7.14022 2.06207C5.86184 2.24739 4.67739 2.84032 3.76299 3.75272C2.84859 4.66512 2.25307 5.84825 2.06495 7.12622C1.87683 8.4042 2.10618 9.70876 2.71888 10.8459C3.33158 11.9831 4.29493 12.8922 5.46569 13.438C6.63645 13.9839 7.9521 14.1373 9.21703 13.8755C9.48744 13.8195 9.75202 13.9933 9.80799 14.2638C9.86396 14.5342 9.69012 14.7987 9.4197 14.8547C7.94395 15.1602 6.40902 14.9812 5.04314 14.3444C3.67726 13.7076 2.55335 12.647 1.83853 11.3203C1.12371 9.99355 0.856142 8.47156 1.07561 6.9806C1.29508 5.48963 1.98986 4.1093 3.05666 3.04484C4.12346 1.98037 5.50531 1.28862 6.99676 1.07242C8.4882 0.856217 10.0096 1.12712 11.3347 1.84485C12.6599 2.56258 13.718 3.6888 14.3518 5.05608C14.9856 6.42335 15.1612 7.95867 14.8526 9.43375C14.796 9.70404 14.531 9.8773 14.2608 9.82074C13.9905 9.76418 13.8172 9.49922 13.8738 9.22893C14.1383 7.96457 13.9878 6.64859 13.4446 5.47664C12.9013 4.30469 11.9943 3.33935 10.8585 2.72416Z",fill:"#05285A"}),$1("path",{d:"M12.001 13V14.5C12.001 14.7761 12.2248 15 12.501 15C12.7771 15 13.001 14.7761 13.001 14.5V13H14.501C14.7771 13 15.001 12.7761 15.001 12.5C15.001 12.2239 14.7771 12 14.501 12H13.001V10.5C13.001 10.2239 12.7771 10 12.501 10C12.2248 10 12.001 10.2239 12.001 10.5V12H10.501C10.2248 12 10.001 12.2239 10.001 12.5C10.001 12.7761 10.2248 13 10.501 13H12.001Z",fill:"#05285A"}),$1("path",{d:"M7.5 4.5L7.5 5C6.67157 5 6 5.67157 6 6.5V6.77924C6 7.42489 6.41315 7.99809 7.02566 8.20227L8.65811 8.74642C8.86228 8.81448 9 9.00554 9 9.22076V9.5C9 9.77614 8.77614 10 8.5 10H7.5C7.22386 10 7 9.77614 7 9.5C7 9.22386 6.77614 9 6.5 9C6.22386 9 6 9.22386 6 9.5C6 10.3284 6.67157 11 7.5 11L7.5 11.5C7.5 11.7761 7.72386 12 8 12C8.27614 12 8.5 11.7761 8.5 11.5L8.5 11C9.32843 11 10 10.3284 10 9.5V9.22076C10 8.57511 9.58685 8.00191 8.97434 7.79773L7.34189 7.25358C7.13772 7.18553 7 6.99446 7 6.77924V6.5C7 6.22386 7.22386 6 7.5 6H8.5C8.77614 6 9 6.22386 9 6.5C9 6.77614 9.22386 7 9.5 7C9.77614 7 10 6.77614 10 6.5C10 5.67157 9.32843 5 8.5 5L8.5 4.5C8.5 4.22386 8.27614 4 8 4C7.72386 4 7.5 4.22386 7.5 4.5Z",fill:"#05285A"})]});import{jsx as e1,jsxs as B7}from"react/jsx-runtime";var I7=C=>B7("svg",{width:16,height:17,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[e1("title",{children:"EarlyWin"}),e1("path",{d:"M4.5 1.5C4.5 0.671573 5.17157 0 6 0H10C10.8284 0 11.5 0.671573 11.5 1.5C11.5 1.97211 11.2819 2.39328 10.9409 2.66824C11.5907 2.96947 12.1864 3.36741 12.7097 3.84359L13.7109 3.2243C14.4155 2.78852 15.3399 3.0064 15.7757 3.71095C16.2114 4.4155 15.9936 5.33992 15.289 5.7757L14.4489 6.29532C14.8038 7.1334 15 8.05494 15 9.02232C15 12.8883 11.866 16.0223 7.99999 16.0223C5.81245 16.0223 3.8585 15.0171 2.57727 13.4491C2.23123 13.0256 2.15508 12.4699 2.32785 11.9902C1.5805 11.9048 1 11.2702 1 10.5C1 10.4716 1.00079 10.4434 1.00234 10.4155C0.418522 10.2102 0 9.65399 0 9C0 8.34602 0.418522 7.78978 1.00234 7.58453C1.00079 7.55655 1 7.52837 1 7.5C1 6.71762 1.59899 6.07514 2.3634 6.00614C2.19047 5.52215 2.27097 4.96188 2.62415 4.53878C3.28294 3.74955 4.11385 3.10681 5.05936 2.66848C4.71824 2.39352 4.5 1.97225 4.5 1.5Z",fill:"#FFDC2E"}),e1("path",{d:"M6 1C5.72386 1 5.5 1.22386 5.5 1.5C5.5 1.77614 5.72386 2 6 2H7.5V3.04287C5.85142 3.17894 4.39166 3.98178 3.39181 5.17959C3.21485 5.39159 3.24326 5.70689 3.45525 5.88385C3.66724 6.0608 3.98255 6.0324 4.1595 5.82041C5.07747 4.72068 6.45693 4.02232 7.99996 4.02232C10.7614 4.02232 13 6.2609 13 9.02232C13 11.7837 10.7614 14.0223 7.99996 14.0223C6.43805 14.0223 5.04367 13.3067 4.12597 12.1836C3.95124 11.9698 3.63625 11.9381 3.42242 12.1128C3.20858 12.2875 3.17688 12.6025 3.3516 12.8164C4.45107 14.1619 6.12524 15.0223 7.99996 15.0223C11.3137 15.0223 14 12.336 14 9.02232C14 7.89034 13.6865 6.83158 13.1416 5.92811L14.763 4.92523C14.9979 4.77997 15.0705 4.47183 14.9252 4.23698C14.78 4.00213 14.4718 3.92951 14.237 4.07477L12.554 5.11571C11.5554 3.9526 10.1188 3.17642 8.5 3.04286V2H10C10.2761 2 10.5 1.77614 10.5 1.5C10.5 1.22386 10.2761 1 10 1H6Z",fill:"#05285A"}),e1("path",{d:"M2.5 7C2.22386 7 2 7.22386 2 7.5C2 7.77614 2.22386 8 2.5 8H4.5C4.77614 8 5 7.77614 5 7.5C5 7.22386 4.77614 7 4.5 7H2.5Z",fill:"#05285A"}),e1("path",{d:"M2.5 10C2.22386 10 2 10.2239 2 10.5C2 10.7761 2.22386 11 2.5 11H4.5C4.77614 11 5 10.7761 5 10.5C5 10.2239 4.77614 10 4.5 10H2.5Z",fill:"#05285A"}),e1("path",{d:"M1 9C1 8.72386 1.22386 8.5 1.5 8.5H3.5C3.77614 8.5 4 8.72386 4 9C4 9.27614 3.77614 9.5 3.5 9.5H1.5C1.22386 9.5 1 9.27614 1 9Z",fill:"#05285A"}),e1("path",{d:"M7.5 5.5L7.5 6C6.67157 6 6 6.67157 6 7.5V7.77924C6 8.42489 6.41315 8.99809 7.02566 9.20227L8.65811 9.74642C8.86228 9.81447 9 10.0055 9 10.2208V10.5C9 10.7761 8.77614 11 8.5 11H7.5C7.22386 11 7 10.7761 7 10.5C7 10.2239 6.77614 10 6.5 10C6.22386 10 6 10.2239 6 10.5C6 11.3284 6.67157 12 7.5 12L7.5 12.5C7.5 12.7761 7.72386 13 8 13C8.27614 13 8.5 12.7761 8.5 12.5L8.5 12C9.32843 12 10 11.3284 10 10.5V10.2208C10 9.57511 9.58685 9.00191 8.97434 8.79773L7.34189 8.25358C7.13771 8.18552 7 7.99446 7 7.77924V7.5C7 7.22386 7.22386 7 7.5 7H8.5C8.77614 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8C9.77614 8 10 7.77614 10 7.5C10 6.67157 9.32843 6 8.5 6L8.5 5.5C8.5 5.22386 8.27614 5 8 5C7.72386 5 7.5 5.22386 7.5 5.5Z",fill:"#05285A"})]});import{jsx as L1,jsxs as E7}from"react/jsx-runtime";var k7=C=>E7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[L1("title",{children:"LiveProfitBoost"}),L1("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#FFDC2E"}),L1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8585 2.72416C9.72266 2.10896 8.4186 1.87676 7.14022 2.06207C5.86184 2.24739 4.6774 2.84032 3.763 3.75272C2.8486 4.66512 2.25307 5.84826 2.06495 7.12623C1.87683 8.4042 2.10618 9.70876 2.71888 10.846C3.33159 11.9831 4.29493 12.8922 5.46569 13.438C6.2638 13.8101 7.12925 13.9999 8.00008 14C8.27622 14.0001 8.50004 14.224 8.5 14.5001C8.49996 14.7762 8.27606 15.0001 7.99992 15C6.98398 14.9998 5.97428 14.7785 5.04314 14.3444C3.67726 13.7076 2.55335 12.647 1.83853 11.3203C1.12371 9.99356 0.856142 8.47157 1.07561 6.9806C1.29508 5.48963 1.98986 4.1093 3.05667 3.04484C4.12347 1.98037 5.50532 1.28862 6.99676 1.07242C8.48821 0.856216 10.0096 1.12712 11.3348 1.84485C12.6599 2.56258 13.718 3.6888 14.3518 5.05608C14.7819 5.98381 15.001 6.98889 15.001 8.00001C15.001 8.27615 14.7771 8.50001 14.501 8.50002C14.2249 8.50002 14.001 8.27616 14.001 8.00002C14.001 7.13332 13.8132 6.27182 13.4446 5.47664C12.9013 4.30469 11.9943 3.33935 10.8585 2.72416Z",fill:"#05285A"}),L1("path",{d:"M10.979 7.43271C10.9385 7.348 10.8495 7.29388 10.751 7.29388H8.58238L9.49142 4.29984C9.52343 4.19395 9.47342 4.08148 9.37142 4.02877C9.26941 3.97653 9.14141 3.99677 9.06441 4.07865L5.06421 8.31416C4.99871 8.38334 4.98271 8.48217 5.02271 8.56688C5.06271 8.65159 5.15222 8.70571 5.25072 8.70571H7.41933L6.51028 11.6997C6.47828 11.8056 6.52828 11.9181 6.63029 11.9708C6.66829 11.9901 6.70979 12 6.75079 12C6.8203 12 6.8888 11.9727 6.9378 11.9209L10.938 7.68543C11.003 7.61625 11.0195 7.51742 10.979 7.43271Z",fill:"#05285A"}),L1("path",{d:"M9 12.4976C9 10.5646 10.567 8.99756 12.5 8.99756C14.433 8.99756 16 10.5646 16 12.4976C16 14.4306 14.433 15.9976 12.5 15.9976C10.567 15.9976 9 14.4306 9 12.4976Z",fill:"#D22839"}),L1("path",{d:"M11.5 13.9394V11.0606C11.5 10.8209 11.767 10.678 11.9664 10.8109L14.1256 12.2504C14.3037 12.3691 14.3037 12.6309 14.1256 12.7496L11.9664 14.1891C11.767 14.322 11.5 14.1791 11.5 13.9394Z",fill:"#fff"})]});import{jsx as j1,jsxs as A7}from"react/jsx-runtime";var F7=C=>A7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[j1("title",{children:"NoSweat"}),j1("path",{d:"M13.6859 1.48894L8.4592 0.0621176C8.15867 -0.0207059 7.84227 -0.0207059 7.54173 0.0621176L2.31507 1.48894C1.5404 1.69976 1 2.41788 1 3.23482V10.2325C1 13.5426 4.2872 14.9685 7.5044 15.9275C7.6668 15.9765 7.83293 16 8 16C8.16707 16 8.3332 15.9765 8.4956 15.9275C9.17727 15.7243 9.86208 15.5002 10.5181 15.2416C11.1088 15.7136 11.8824 16.0017 12.7043 16.0017C14.4619 16.0017 15.9984 14.6844 15.9984 13.0674C15.9984 12.4406 15.7805 11.8492 15.523 11.3585C15.3664 11.0601 15.1827 10.7754 14.992 10.5126C14.9973 10.4208 15 10.3274 15 10.2325V3.23482C15 2.41788 14.4596 1.69976 13.6859 1.48894Z",fill:"#FFDC2E"}),j1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.47165 1.05863C7.81781 0.96125 8.18272 0.96125 8.52887 1.05863L8.53309 1.05982L12.1368 2.10785L12.1459 2.11037C12.1557 2.1131 12.1657 2.11588 12.1758 2.11869C12.4873 2.20515 12.9314 2.32839 13.2927 2.58404C13.706 2.87648 14 3.33052 14 3.99994V8.19994C14 8.47608 13.7761 8.69994 13.5 8.69994C13.2239 8.69994 13 8.47608 13 8.19994V3.99994C13 3.67534 12.8805 3.5174 12.7152 3.40039C12.5095 3.25491 12.2267 3.1708 11.878 3.07381L11.8604 3.06892L8.25617 2.02074C8.08832 1.97388 7.91221 1.97388 7.74436 2.02074L4.13384 3.07057L4.12294 3.07355C3.77366 3.17057 3.49064 3.25466 3.28493 3.40014C3.11952 3.51712 3 3.67506 3 3.99998V9.89994C3 10.9641 3.48089 11.7529 4.30994 12.3959C5.1595 13.0549 6.35605 13.5429 7.72077 13.9582L7.72222 13.9586C7.80665 13.9846 7.89335 13.9982 7.98193 13.9998L8.00209 13.9981C8.02766 13.9958 8.06288 13.9923 8.10149 13.9878C8.14055 13.9831 8.18013 13.9777 8.21515 13.9717C8.23251 13.9687 8.24713 13.9659 8.25888 13.9633L8.27261 13.96L8.27647 13.959L8.27778 13.9586L8.27923 13.9582C8.46815 13.9007 8.65678 13.8414 8.84427 13.78C8.88852 13.7655 8.9327 13.7509 8.97679 13.7361C9.23867 13.6485 9.52197 13.7898 9.60955 14.0517C9.69714 14.3136 9.55583 14.5969 9.29395 14.6845C9.24789 14.6999 9.20181 14.7151 9.15573 14.7302C8.96046 14.7942 8.76498 14.8556 8.57037 14.9149C8.45293 14.9508 8.30659 14.9705 8.21891 14.9808C8.16872 14.9868 8.12384 14.9911 8.09151 14.9941L8.05242 14.9974L8.04106 14.9983L8.03768 14.9985L8.03661 14.9986L8.018 14.9999L8 15C7.80864 15 7.61677 14.9724 7.4287 14.9146C6.03615 14.4908 4.69548 13.9605 3.69706 13.1861C2.67791 12.3956 2 11.3357 2 9.89994V3.99998C2 3.33035 2.29393 2.87617 2.70753 2.58368C3.06906 2.32801 3.51337 2.20483 3.82528 2.11836C3.83543 2.11555 3.84543 2.11278 3.85529 2.11004L3.86328 2.10782L7.47165 1.05863Z",fill:"#05285A"}),j1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3535 5.64645C11.5488 5.84171 11.5488 6.15829 11.3535 6.35355L7.49498 10.2121C7.22161 10.4855 6.77839 10.4855 6.50503 10.2121L4.64645 8.35355C4.45118 8.15829 4.45118 7.84171 4.64645 7.64645C4.84171 7.45118 5.15829 7.45118 5.35355 7.64645L7 9.29289L10.6464 5.64645C10.8417 5.45118 11.1583 5.45118 11.3535 5.64645Z",fill:"#05285A"}),j1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.1201 13.154C14.1201 13.4913 13.6728 14.1471 12.7672 14.1471C11.8615 14.1471 11.4142 13.4913 11.4142 13.154C11.4142 12.8363 11.6088 12.3612 12.0101 11.7957C12.2503 11.4572 12.5236 11.143 12.7672 10.8864C13.0108 11.143 13.284 11.4572 13.5243 11.7957C13.9256 12.3612 14.1201 12.8363 14.1201 13.154ZM12.7672 15.1471C14.1117 15.1471 15.1201 14.1505 15.1201 13.154C15.1201 11.8725 13.7194 10.3932 13.0794 9.7843C12.9024 9.61582 12.632 9.61582 12.4549 9.7843C11.815 10.3932 10.4142 11.8725 10.4142 13.154C10.4142 14.1505 11.4226 15.1471 12.7672 15.1471Z",fill:"#05285A"})]});import{jsx as y5,jsxs as T7}from"react/jsx-runtime";var D7=C=>T7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[y5("title",{children:"OddsBoostToken"}),y5("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#FFDC2E"}),y5("path",{d:"M10.979 7.43271C10.9385 7.348 10.8495 7.29388 10.751 7.29388H8.58238L9.49143 4.29984C9.52343 4.19395 9.47342 4.08148 9.37142 4.02877C9.26941 3.97653 9.14141 3.99677 9.06441 4.07865L5.06421 8.31416C4.99871 8.38334 4.98271 8.48217 5.02271 8.56688C5.06271 8.65159 5.15222 8.70571 5.25072 8.70571H7.41933L6.51028 11.6997C6.47828 11.8056 6.52828 11.9181 6.63029 11.9708C6.66829 11.9901 6.70979 12 6.75079 12C6.8203 12 6.8888 11.9727 6.9378 11.9209L10.938 7.68543C11.003 7.61625 11.0195 7.51742 10.979 7.43271Z",fill:"#05285A"}),y5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15Z",fill:"#05285A"})]});import{jsx as o1,jsxs as W7}from"react/jsx-runtime";var _7=C=>W7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[o1("title",{children:"ProfitBoost"}),o1("path",{d:"M16.001 12.5C16.001 14.433 14.434 16 12.501 16C10.568 16 9.00098 14.433 9.00098 12.5C9.00098 10.567 10.568 9 12.501 9C14.434 9 16.001 10.567 16.001 12.5Z",fill:"#FFDC2E"}),o1("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z",fill:"#FFDC2E"}),o1("path",{d:"M5.25 8.5L9.25 4.24998L8.25 7.5H10.75L6.75 11.75L7.75 8.5H5.25Z",fill:"#05285A"}),o1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 11.5C10.5 11.2239 10.7239 11 11 11H13.5C13.6326 11 13.7598 11.0527 13.8536 11.1464C13.9473 11.2402 14 11.3674 14 11.5V14C14 14.2761 13.7761 14.5 13.5 14.5C13.2239 14.5 13 14.2761 13 14V12H11C10.7239 12 10.5 11.7761 10.5 11.5Z",fill:"#05285A"}),o1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8585 2.72416C9.72265 2.10896 8.4186 1.87676 7.14022 2.06207C5.86184 2.24739 4.67739 2.84032 3.76299 3.75272C2.84859 4.66512 2.25306 5.84825 2.06495 7.12622C1.87683 8.4042 2.10618 9.70876 2.71888 10.8459C3.33158 11.9831 4.29493 12.8922 5.46569 13.438C6.63645 13.9839 7.9521 14.1373 9.21703 13.8755C9.48744 13.8195 9.75202 13.9933 9.80799 14.2638C9.86396 14.5342 9.69012 14.7987 9.4197 14.8547C7.94395 15.1602 6.40902 14.9812 5.04314 14.3444C3.67725 13.7076 2.55335 12.647 1.83853 11.3203C1.12371 9.99355 0.856142 8.47156 1.07561 6.9806C1.29508 5.48963 1.98986 4.1093 3.05666 3.04484C4.12346 1.98037 5.50531 1.28862 6.99676 1.07242C8.4882 0.856217 10.0096 1.12712 11.3347 1.84485C12.6599 2.56258 13.718 3.6888 14.3518 5.05608C14.9856 6.42335 15.1612 7.95867 14.8526 9.43375C14.796 9.70404 14.531 9.8773 14.2608 9.82074C13.9905 9.76418 13.8172 9.49922 13.8738 9.22893C14.1383 7.96457 13.9878 6.64859 13.4446 5.47664C12.9013 4.30469 11.9943 3.33935 10.8585 2.72416Z",fill:"#05285A"}),o1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.37569 4.03387C9.4762 4.09233 9.52314 4.21237 9.48895 4.3235L8.58849 7.25H10.75C10.8497 7.25 10.9399 7.30928 10.9795 7.40084C11.0191 7.4924 11.0004 7.59871 10.932 7.67134L6.93205 11.9213C6.85236 12.006 6.72482 12.0245 6.62431 11.9661C6.5238 11.9076 6.47686 11.7876 6.51106 11.6765L7.41151 8.75H5.25C5.15026 8.75 5.06007 8.69072 5.02051 8.59916C4.98095 8.5076 4.99959 8.40129 5.06795 8.32866L9.06795 4.07864C9.14764 3.99396 9.27518 3.97541 9.37569 4.03387ZM5.8286 8.25H7.75C7.82934 8.25 7.90396 8.28766 7.9511 8.35147C7.99823 8.41529 8.01228 8.49769 7.98894 8.57352L7.30537 10.7951L10.1714 7.75H8.25C8.17066 7.75 8.09604 7.71234 8.0489 7.64853C8.00177 7.58471 7.98772 7.50231 8.01105 7.42648L8.69464 5.20482L5.8286 8.25Z",fill:"#05285A"})]});import{jsx as C5,jsxs as N7}from"react/jsx-runtime";var O7=C=>N7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[C5("title",{children:"Promotions"}),C5("path",{d:"M14.5321 1.05071C15.3749 1.28949 15.9916 2.06721 15.9858 2.9877L15.957 7.6023C15.9537 8.12839 15.7433 8.63201 15.3713 9.00403L9.04779 15.3275C8.18864 16.1867 6.79568 16.1867 5.93652 15.3275L1.49216 10.8831C0.896686 10.2877 0.755202 9.41011 1.06771 8.6806L0.203514 7.19445C-0.206468 6.48941 0.0220043 5.58599 0.717865 5.16061L8.79969 0.220189C9.12877 0.0190169 9.52271 -0.0476543 9.89966 0.03402L14.3358 0.995191C14.4041 1.00998 14.4695 1.02859 14.5321 1.05071Z",fill:"#FFDC2E"}),C5("path",{d:"M12.9922 4.46887C12.9922 4.74501 12.7683 4.96887 12.4922 4.96887C12.216 4.96887 11.9922 4.74501 11.9922 4.46887C11.9922 4.19273 12.216 3.96887 12.4922 3.96887C12.7683 3.96887 12.9922 4.19273 12.9922 4.46887Z",fill:"#05285A"}),C5("path",{d:"M11.1954 6.47599C11.3907 6.28073 11.3907 5.96415 11.1954 5.76888C11.0002 5.57362 10.6836 5.57362 10.4883 5.76888L10.1347 6.12248C9.54893 5.5367 8.59918 5.53669 8.01339 6.12247L7.90529 6.23057C7.3868 6.74906 7.31915 7.56641 7.74535 8.16309L8.52835 9.25929C8.67042 9.45818 8.64787 9.73063 8.47504 9.90346L8.36694 10.0116C8.17168 10.2068 7.8551 10.2068 7.65984 10.0116L6.95273 9.30445C6.75747 9.10919 6.75747 8.79261 6.95273 8.59735C7.14799 8.40209 7.14799 8.0855 6.95273 7.89024C6.75747 7.69498 6.44089 7.69498 6.24562 7.89024C5.65984 8.47603 5.65984 9.42578 6.24562 10.0116L5.89205 10.3652C5.69679 10.5604 5.69679 10.877 5.89205 11.0723C6.08731 11.2675 6.4039 11.2675 6.59916 11.0723L6.95274 10.7187C7.53853 11.3045 8.48827 11.3045 9.07405 10.7187L9.18215 10.6106C9.70064 10.0921 9.76829 9.27473 9.34209 8.67805L8.55909 7.58185C8.41702 7.38296 8.43957 7.11051 8.6124 6.93768L8.7205 6.82958C8.91576 6.63432 9.23234 6.63432 9.4276 6.82958L10.1347 7.53669C10.33 7.73195 10.33 8.04853 10.1347 8.24379C9.93945 8.43906 9.93945 8.75564 10.1347 8.9509C10.33 9.14616 10.6466 9.14616 10.8418 8.9509C11.4276 8.36512 11.4276 7.41538 10.8418 6.82959L11.1954 6.47599Z",fill:"#05285A"}),C5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.80056 1.02516C9.5444 0.968236 9.27614 1.01428 9.05363 1.15335L1.6436 5.78462C1.18127 6.07357 1.0356 6.67961 1.3161 7.14711L2.2528 8.70827L2.19926 8.76181C1.80874 9.15234 1.80874 9.7855 2.19927 10.176L6.78505 14.7618C7.17558 15.1523 7.80874 15.1523 8.19927 14.7618L14.6642 8.29692C14.8502 8.11091 14.9554 7.8591 14.957 7.59605L14.9858 2.98146C14.989 2.46829 14.6054 2.04386 14.1094 1.98277L14.1007 1.98075L9.80056 1.02516ZM9.58947 2.00264L9.58363 2.00135L9.58147 2.00269L9.58947 2.00264ZM7.91991 3.04117L2.1736 6.63261L2.98167 7.97941L7.91991 3.04117ZM7.49216 14.0547L2.90637 9.46892L9.37127 3.00403L13.9859 2.97522L13.9571 7.58981L7.49216 14.0547Z",fill:"#05285A"})]});import{jsx as G2,jsxs as J7}from"react/jsx-runtime";var U7=C=>J7("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[G2("title",{children:"Rewards"}),G2("path",{d:"M1.26224 4.15206C1.31065 4.25735 1.3633 4.35639 1.41956 4.44957C0.567407 4.97876 0 5.92311 0 7C0 7.8885 0.386251 8.68679 1 9.23611V13.5C1 14.8807 2.11929 16 3.5 16H12.5C13.8807 16 15 14.8807 15 13.5V9.23611C15.6137 8.68679 16 7.8885 16 7C16 5.92347 15.433 4.97938 14.5813 4.4501C14.6376 4.35679 14.6904 4.25759 14.7389 4.15214C15.2688 2.99965 14.9535 1.70667 14.1422 0.894035C13.3046 0.0550607 12.0733 -0.195967 10.7944 0.1518C9.5891 0.479566 8.62803 1.32467 7.99581 2.01479C7.36055 1.32541 6.39528 0.479559 5.18974 0.151708C3.91238 -0.195672 2.68057 0.0534735 1.84483 0.899614C1.03526 1.71926 0.737422 3.01059 1.26224 4.15206Z",fill:"#FFDC2E"}),G2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.60542 4.39531C3.01039 4.77655 3.58742 5 4.29256 5H3C1.89543 5 1 5.89543 1 7C1 7.74028 1.4022 8.38663 2 8.73244V13.5C2 14.3284 2.67157 15 3.5 15H7.99507L8 15L8.00493 15H12.5C13.3284 15 14 14.3284 14 13.5V8.73244C14.5978 8.38663 15 7.74028 15 7C15 5.89543 14.1046 5 13 5H11.7075C12.4126 5 12.9896 4.77655 13.3946 4.39531C13.7969 4.01661 14 3.50846 14 3C14 2.49154 13.7969 1.98339 13.3946 1.60469C12.9896 1.22345 12.4126 1 11.7075 1C10.2919 1 9.23791 1.88638 8.57414 2.67897C8.34458 2.95309 8.15296 3.22605 8.00002 3.46673C7.84708 3.22605 7.65545 2.95309 7.42589 2.67897C6.76212 1.88638 5.70811 1 4.29256 1C3.58742 1 3.01039 1.22345 2.60542 1.60469C2.20314 1.98339 2 2.49154 2 3C2 3.50846 2.20314 4.01661 2.60542 4.39531ZM7.15406 4H4.29256C3.80266 4 3.48342 3.84845 3.29086 3.66719C3.09562 3.48339 3 3.24154 3 3C3 2.75846 3.09562 2.51661 3.29086 2.33281C3.48342 2.15155 3.80266 2 4.29256 2C5.26709 2 6.0668 2.61362 6.65923 3.32103C6.85542 3.55529 7.02091 3.7907 7.15406 4ZM8.84597 4H11.7075C12.1974 4 12.5166 3.84845 12.7092 3.66719C12.9044 3.48339 13 3.24154 13 3C13 2.75846 12.9044 2.51661 12.7092 2.33281C12.5166 2.15155 12.1974 2 11.7075 2C10.7329 2 9.93324 2.61362 9.34081 3.32103C9.14461 3.55529 8.97913 3.7907 8.84597 4ZM3 6H7.5V8H3C2.44772 8 2 7.55228 2 7C2 6.44772 2.44772 6 3 6ZM13 8H8.5V6H13C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8ZM3 9H7.5V14H3.5C3.22386 14 3 13.7761 3 13.5V9ZM8.5 9V14H12.5C12.7761 14 13 13.7761 13 13.5V9H8.5Z",fill:"#05285A"})]});import{jsx as l1,jsxs as q7}from"react/jsx-runtime";var K7=C=>q7("svg",{width:125,height:125,viewBox:"0 0 125 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[l1("title",{children:"MLB"}),l1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M114.598 28.334H10.4222C7.66145 28.3254 5.00625 29.4056 3.03541 31.3396C1.06805 33.3104 -0.0260466 35.991 0.00103678 38.7754V85.2622C-0.0295188 88.0368 1.0618 90.7087 3.02604 92.6688C4.9868 94.6288 7.64999 95.7288 10.4222 95.7229H114.598C120.316 95.6958 125.005 90.9813 125 85.2622V38.6875C125 33.0379 120.375 28.3774 114.725 28.3347H114.598V28.334Z",fill:"#fff"}),l1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M121.341 38.7654C121.384 35.0932 118.398 32.0366 114.726 31.9939L114.598 31.9932H85.4802L102.186 59.9112L103.728 60.1064L104.704 61.3841V62.5751L105.758 62.789L106.734 64.1161V65.2678L107.826 65.463L108.929 66.663V69.3175C110.242 70.5029 111.722 71.4893 113.32 72.2449C114.794 72.8105 114.959 75.1723 115.848 76.4314C116.96 78.2654 118.482 78.9977 118.161 80.022C117.419 82.764 114.609 87.389 111.993 87.6039H101.65V92.0341H114.609C118.324 92.0182 121.367 88.948 121.352 85.2327L121.351 85.2036V38.7654",fill:"#BF0D3E"}),l1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.1073 87.6721H45.1021C45.1021 75.162 49.3271 68.244 54.3913 66.8679C55.0844 66.7412 54.7524 63.3259 53.8743 62.2818H50.9469C50.4788 62.2818 50.7517 61.403 50.7517 61.403L53.1229 56.3388L52.8003 54.9533H44.0382L51.2392 49.9183C51.5712 36.6377 65.1931 35.6033 73.3997 41.1367C78.2785 44.3662 78.6497 50.7672 78.2785 55.1881C78.2201 55.4707 77.0101 55.2856 77.0101 55.2856C77.0101 55.2856 76.1809 60.1645 78.3469 60.1645H87.9194C91.8226 60.0085 95.5896 62.653 95.5896 62.653L96.5069 59.3061L75.5368 31.9933H10.4219C8.62153 31.9832 6.88785 32.6849 5.60139 33.945C4.33472 35.227 3.63194 36.9634 3.64965 38.7655V85.2617C3.62708 87.0592 4.33125 88.7912 5.60139 90.0624C6.87986 91.3408 8.61423 92.061 10.4219 92.0631H52.6934C51.6587 90.2874 50.4788 88.2669 50.1177 87.6721",fill:"#003D6D"}),l1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.0372 77.8063C13.0372 75.2691 15.1253 73.1816 17.6625 73.1816C20.1997 73.1816 22.2878 75.2698 22.2878 77.807C22.2878 80.3441 20.1997 82.4323 17.6625 82.4323L17.6233 82.4316H17.6139C15.1066 82.4316 13.0424 80.3719 13.0375 77.8653V77.8063",fill:"#fff"}),l1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M117.374 97C119.239 97 120.753 98.5109 120.753 100.376C120.753 102.242 119.239 103.751 117.374 103.751C115.508 103.751 114 102.242 114 100.376C114 98.5109 115.508 97 117.374 97ZM117.374 97.7236C115.91 97.7236 114.722 98.9115 114.722 100.376C114.722 101.842 115.91 103.027 117.374 103.027C118.84 103.027 120.028 101.842 120.028 100.376C120.028 98.9115 118.84 97.7236 117.374 97.7236Z",fill:"#BF0D3E"}),l1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M118 100.671L118.762 102.305H117.964L117.23 100.736H116.714V102.305H115.987V98.4492H117.616C118.251 98.4492 118.762 98.9589 118.762 99.5933C118.762 100.091 118.446 100.514 118 100.671ZM116.714 100.014H117.616C117.849 100.014 118.038 99.825 118.038 99.5933C118.038 99.3591 117.849 99.1712 117.616 99.1712H116.714V100.014Z",fill:"#BF0D3E"})]});import{jsx as g1,jsxs as X7}from"react/jsx-runtime";var z7=C=>X7("svg",{width:125,height:125,viewBox:"0 0 125 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[g1("title",{children:"NASCAR"}),g1("path",{d:"M94.3898 25L73.6604 99.6143H102.338L123 25H94.3898Z",fill:"#007AC2"}),g1("path",{d:"M53.2598 25.0234L32.5039 99.7023H46.3451L67.0246 25.0234H53.2598Z",fill:"#EF3E42"}),g1("path",{d:"M72.6828 25.0234L51.9269 99.7023H65.7681L86.4476 25.0234H72.6828Z",fill:"#EF3E42"}),g1("path",{d:"M22.7559 25.0234L2 99.7023H10.603L31.2767 25.0234H22.7559Z",fill:"#FFD65A"}),g1("path",{d:"M36.882 25.0234L16.1261 99.7023H24.7291L45.4028 25.0234H36.882Z",fill:"#FFD65A"})]});import{jsx as u1,jsxs as Q7}from"react/jsx-runtime";var Y7=C=>Q7("svg",{width:125,height:125,viewBox:"0 0 125 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[u1("title",{children:"NBA"}),u1("path",{d:"M77.6064 0.739258H48.1038C40.9057 0.739258 35.0612 6.48881 35.0612 13.5475V111.665C35.0612 118.736 40.9057 124.492 48.1038 124.492H77.5858C84.7811 124.492 90.6558 118.736 90.6558 111.665V13.5475C90.6558 6.48881 84.799 0.739258 77.6064 0.739258Z",fill:"#fff"}),u1("path",{d:"M70.2875 23.426L70.3191 23.8444C71.2178 24.3586 71.674 24.7784 72.581 25.352C74.9872 26.8393 77.9514 29.4833 77.5776 38.5935C78.2509 40.5802 78.5491 44.4861 79.173 45.7373C80.4263 48.1774 81.2618 49.7646 81.6287 52.0685C81.6287 52.0685 81.9901 55.6546 82.4601 55.9137C84.9488 56.4657 84.2301 56.7059 84.5929 57.1243C84.979 57.6156 86.4151 57.5927 86.4151 58.9072C86.9139 59.5618 87.2822 60.2434 87.5639 60.9506V13.5479C87.5639 8.14518 83.0895 3.75879 77.6064 3.75879H68.0736C69.6059 4.29325 70.4688 4.9249 70.9732 5.92634C72.2045 6.03027 73.668 8.73903 71.3882 12.7421C72.3982 13.4021 71.6108 14.3887 70.8852 15.5346C70.6736 15.9017 70.4414 16.5536 69.7666 16.5104C68.9023 18.2987 67.8551 20.0316 67.0663 20.1423C66.8272 20.4325 66.6527 21.2018 67.0127 21.5635C68.1739 22.0737 69.5866 22.7741 70.2875 23.426Z",fill:"#DC1931"}),u1("path",{d:"M87.5639 67.3729C86.2708 70.5959 83.051 72.8728 79.2898 72.8728C74.3675 72.8728 70.4001 68.9655 70.4001 64.1459C70.4001 60.0294 73.2818 56.577 77.1928 55.6552C76.169 53.1367 74.006 49.054 73.3629 47.7138C72.7541 46.3844 71.2892 38.0826 70.9732 36.4414C70.9017 36.0824 67.1392 38.586 67.1309 38.7399C66.911 38.9504 64.3083 45.6272 64.1984 45.9876C64.1462 46.2157 64.1393 47.1078 64.1393 47.1078C64.1393 47.1078 65.42 47.263 66.1566 49.4562C66.8849 51.6467 69.1084 59.6448 69.1084 59.6448C69.1084 59.6448 68.5079 60.2562 68.4818 60.2184C71.2892 69.4501 70.3081 73.4235 71.5682 76.1309C73.1513 79.9464 73.5787 79.447 74.9377 82.6538C75.9121 84.9887 76.999 94.1812 77.3618 94.5888C78.8776 96.4757 79.6939 97.9508 79.6939 99.0157C79.6939 100.087 78.4103 103.252 78.8776 105.096C79.162 106.181 79.3091 108.613 79.8244 109.075C79.8244 109.075 80.2957 109.987 80.0649 110.393C79.9975 110.534 79.8629 110.746 79.9233 110.912C80.7602 113.811 83.4578 118.754 79.0878 121.343H79.1813C83.9511 120.618 87.5639 116.599 87.5639 111.665V67.3729Z",fill:"#DC1931"}),u1("path",{d:"M76.3381 109.784C74.7357 108.381 75.8062 107.787 75.7416 107.232C74.6849 102.946 71.2192 100.354 73.0125 98.9385C72.57 97.5241 71.6699 95.7466 71.7029 95.7493C66.3009 92.7031 61.7001 87.7539 60.9195 87.0291C59.9713 86.0169 58.358 85.0019 58.0543 84.18C56.7571 83.0098 50.389 74.1385 48.9063 70.8724L46.3228 70.5133C45.1465 65.7963 41.2218 61.8445 41.1256 57.1153C41.0885 55.327 41.9501 51.498 42.2717 50.7341C42.585 49.9594 44.0883 48.6866 44.0883 48.6866V47.422C38.4514 47.5799 40.0729 47.0144 39.1014 44.8617C38.4184 43.3717 38.9076 43.0437 39.1536 42.0099C39.9094 38.9583 42.4228 34.2534 43.4617 32.1155C43.7792 31.0358 44.8661 28.435 44.8661 28.435C49.0684 20.032 50.6364 20.6502 55.6261 20.1764L55.8721 19.8282C60.8728 19.6163 60.0538 19.2452 60.7601 14.5146C60.0304 14.8223 59.8147 13.034 59.8147 13.034C59.4162 10.3415 60.5719 10.8516 61.1215 10.7976C61.2383 6.37075 61.7001 4.97791 64.9514 3.75781H48.1093C42.5987 3.75781 38.1353 8.14556 38.1353 13.5536V111.664C38.1353 117.078 42.5987 121.464 48.1093 121.464H77.6064C74.23 119.673 76.2226 116.261 76.3381 109.784Z",fill:"#02428C"}),u1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.4127 115.298H46.5193V109.701C46.5193 106.964 46.4451 104.351 46.2692 101.066L48.9503 115.298H52.0092V97.5352H49.9026V100.819C49.9026 104.038 50.1466 107.758 50.3596 111.006L50.3596 111.006L50.3596 111.006L50.3596 111.006L50.3596 111.006L50.3596 111.006C50.3837 111.373 50.4074 111.735 50.4303 112.089L47.7492 97.5352H44.4127V115.298ZM64.9418 99.5264H65.0669C65.1148 100.043 65.1712 100.647 65.2307 101.285L65.232 101.298L65.2324 101.303C65.4219 103.332 65.6421 105.691 65.7182 106.616L65.9945 109.676H64.1159L64.3894 106.616C64.4911 105.422 64.792 101.666 64.9418 99.5264ZM66.1456 111.69H63.9648L63.6624 115.298H61.2315L63.4123 97.5352H66.8712L68.9765 115.298H66.4452L66.1456 111.69ZM56.0947 105.645V99.7742H57.0209C57.8221 99.7742 58.0749 100.147 58.0749 100.969V104.377C58.0749 105.346 57.8482 105.645 56.9962 105.645H56.0947ZM56.0947 107.585V113.059H57.0209C57.8482 113.059 58.0749 112.635 58.0749 111.79V108.779C58.0749 107.909 57.7987 107.585 56.9962 107.585H56.0947ZM53.6885 97.5352V115.298H57.1968C59.1509 115.298 60.4812 114.203 60.4812 111.766V109.179C60.4812 107.836 59.9796 107.039 59.276 106.566C59.9796 106.168 60.4812 105.346 60.4812 103.73V101.093C60.4812 98.6054 59.2265 97.5352 57.1968 97.5352H53.6885Z",fill:"#fff"})]});import{jsx as V1,jsxs as j7}from"react/jsx-runtime";var $7=C=>j7("svg",{width:128,height:125,viewBox:"0 0 128 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[V1("title",{children:"NBAAlt"}),V1("path",{d:"M23.298 28H7.14216C3.20046 28 0 31.2057 0 35.1414V89.8481C0 93.7905 3.20046 97 7.14216 97H23.2867C27.2269 97 30.4439 93.7905 30.4439 89.8481V35.1414C30.4439 31.2057 27.2367 28 23.298 28Z",fill:"#fff"}),V1("path",{d:"M19.2901 40.6488L19.3074 40.8821C19.7995 41.1688 20.0494 41.4028 20.546 41.7227C21.8637 42.5519 23.4869 44.0261 23.2822 49.1056C23.6509 50.2133 23.8142 52.3911 24.1559 53.0887C24.8422 54.4493 25.2997 55.3342 25.5006 56.6188C25.5006 56.6188 25.6985 58.6182 25.9559 58.7627C27.3187 59.0705 26.9251 59.2044 27.1238 59.4377C27.3353 59.7116 28.1216 59.6988 28.1216 60.4318C28.3948 60.7968 28.5965 61.1768 28.7507 61.5711V35.1411C28.7507 32.1288 26.3005 29.6831 23.298 29.6831H18.0778C18.9168 29.9811 19.3894 30.3333 19.6656 30.8917C20.3398 30.9496 21.1413 32.4599 19.8928 34.6919C20.4459 35.0599 20.0148 35.6099 19.6174 36.2488C19.5015 36.4535 19.3744 36.817 19.0049 36.7929C18.5315 37.79 17.9581 38.7562 17.5262 38.8179C17.3952 38.9797 17.2997 39.4087 17.4968 39.6103C18.1327 39.8948 18.9063 40.2853 19.2901 40.6488Z",fill:"#DC1931"}),V1("path",{d:"M28.7508 65.1526C28.0426 66.9496 26.2795 68.2191 24.2198 68.2191C21.5243 68.2191 19.3518 66.0405 19.3518 63.3533C19.3518 61.0581 20.9298 59.1332 23.0715 58.6192C22.5109 57.215 21.3264 54.9386 20.9742 54.1914C20.6409 53.4501 19.8387 48.8214 19.6656 47.9063C19.6265 47.7062 17.5661 49.1021 17.5615 49.1879C17.4411 49.3053 16.0159 53.028 15.9557 53.2289C15.9271 53.3561 15.9233 53.8535 15.9233 53.8535C15.9233 53.8535 16.6247 53.94 17.028 55.1629C17.4268 56.3842 18.6444 60.8436 18.6444 60.8436C18.6444 60.8436 18.3156 61.1845 18.3013 61.1635C19.8387 66.3107 19.3014 68.5261 19.9914 70.0357C20.8583 72.163 21.0924 71.8846 21.8366 73.6726C22.3701 74.9745 22.9654 80.0999 23.164 80.3271C23.9941 81.3791 24.4411 82.2016 24.4411 82.7954C24.4411 83.3929 23.7382 85.1575 23.9941 86.1855C24.1498 86.7905 24.2304 88.1465 24.5126 88.4039C24.5126 88.4039 24.7707 88.9126 24.6443 89.1391C24.6074 89.2174 24.5336 89.3355 24.5667 89.4281C25.025 91.0445 26.5022 93.801 24.1092 95.2443H24.1604C26.7724 94.8402 28.7508 92.5992 28.7508 89.848V65.1526Z",fill:"#DC1931"}),V1("path",{d:"M22.6034 88.799C21.726 88.0164 22.3122 87.6853 22.2768 87.376C21.6982 84.986 19.8003 83.5412 20.7823 82.7518C20.54 81.9631 20.0471 80.9721 20.0652 80.9736C17.107 79.2751 14.5876 76.5157 14.1602 76.1116C13.6409 75.5472 12.7575 74.9813 12.5912 74.523C11.8808 73.8706 8.39361 68.9242 7.58164 67.1031L6.1669 66.903C5.52275 64.2729 3.37355 62.0695 3.32088 59.4327C3.30056 58.4356 3.77239 56.3007 3.94848 55.8748C4.12005 55.4429 4.94331 54.7332 4.94331 54.7332V54.0281C1.85647 54.1162 2.74445 53.8009 2.21242 52.6006C1.83841 51.7698 2.10631 51.587 2.24101 51.0105C2.6549 49.3091 4.03126 46.6858 4.60016 45.4938C4.77399 44.8918 5.36923 43.4417 5.36923 43.4417C7.67044 38.7565 8.52906 39.1011 11.2615 38.837L11.3962 38.6429C14.1346 38.5247 13.6861 38.3178 14.0729 35.6802C13.6733 35.8518 13.5551 34.8547 13.5551 34.8547C13.3369 33.3534 13.9698 33.6379 14.2708 33.6078C14.3348 31.1395 14.5876 30.3629 16.3681 29.6826H7.14518C4.12758 29.6826 1.6834 32.1291 1.6834 35.1444V89.8473C1.6834 92.8656 4.12758 95.3113 7.14518 95.3113H23.298C21.4491 94.3127 22.5402 92.4104 22.6034 88.799Z",fill:"#02428C"}),V1("path",{d:"M46.0891 95.0526H38.4383V29.2603H50.5558L60.2928 83.1649C59.4743 70.2674 58.3764 54.6954 58.3764 41.4229V29.2603H66.0272V95.0526H54.9178L45.1808 42.3377C45.8196 54.5054 46.0891 64.1835 46.0891 74.3216V95.0526ZM113.449 36.6338H112.995C112.451 44.5573 111.358 58.4696 110.989 62.8938L109.996 74.2266H116.818L115.815 62.8938C115.451 58.3796 114.178 44.6473 113.449 36.6338ZM117.367 81.6902H109.447L108.349 95.0526H99.5203L107.441 29.2603H120.002L127.648 95.0526H118.455L117.367 81.6902ZM80.8648 37.5537V59.2995H84.1387C87.233 59.2995 88.0565 58.1897 88.0565 54.6004V41.9778C88.0565 38.9334 87.1382 37.5537 84.2285 37.5537H80.8648ZM80.8648 66.4831V86.7592H84.2285C87.233 86.7592 88.0565 85.1895 88.0565 82.0601V70.9072C88.0565 67.6829 87.0533 66.4831 84.1387 66.4831H80.8648ZM72.1259 95.0526V29.2603H84.8674C92.2387 29.2603 96.7953 33.2245 96.7953 42.4377V52.2058C96.7953 58.1897 94.9737 61.2341 92.4184 62.7088C94.9737 64.4635 96.7953 67.4129 96.7953 72.387V81.9701C96.7953 90.9984 91.9642 95.0526 84.8674 95.0526H72.1259Z",fill:"#02428C"})]});import{jsx as d,jsxs as e0}from"react/jsx-runtime";var C0=C=>e0("svg",{width:125,height:125,viewBox:"0 0 125 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[d("title",{children:"NFL"}),d("path",{d:"M104.342 14.4055C100.571 17.2332 93.0314 21.0034 83.6058 18.6473C66.9537 14.5625 62.2409 0.267578 62.2409 0.267578C62.2409 0.267578 57.4966 14.5473 40.876 18.6473C31.3091 21.0034 23.9098 17.2022 19.9821 14.4212H16.9979V91.3973C16.9979 93.44 17.4689 97.2102 20.6269 101.137C24.5384 105.85 31.1363 108.882 40.2637 110.202C47.6472 111.255 52.988 113.548 56.7583 117.208C59.5859 119.895 62.2566 124.545 62.2566 124.545C62.2566 124.545 65.0061 119.801 67.6925 117.208C71.4943 113.548 76.8829 111.269 84.1876 110.202C93.3302 108.88 99.8966 105.804 103.824 101.074C106.982 97.2412 107.453 93.3932 107.453 91.4608V14.4842H104.452",fill:"#fff"}),d("path",{d:"M104.656 17.3903C104.656 17.3903 95.5918 24.444 82.8208 21.2545C67.9435 17.5315 62.0844 6.39355 62.0844 6.39355C62.0844 6.39355 56.303 17.5473 41.3475 21.2545C28.7802 24.3968 19.6686 17.3278 19.6686 17.3278V91.3181C19.6696 93.8318 20.7209 104.515 40.719 107.342C48.5892 108.481 54.4646 111.003 58.6276 115.071C60.1483 116.529 61.2983 118.01 62.1784 119.375C63.0627 118.013 64.2205 116.533 65.7281 115.071C69.9547 111.003 75.8295 108.474 83.6373 107.342C103.588 104.468 104.53 93.7856 104.688 91.3181V17.3278",fill:"#013369"}),d("path",{d:"M62.2409 112.008C62.2409 112.008 68.0223 104.876 82.9772 102.568C100.257 99.9121 99.6293 91.8375 99.6293 91.4295V52.627H24.6954V91.4295C24.6954 91.8375 24.1866 99.9121 41.347 102.568C56.365 104.893 62.0839 112.008 62.0839 112.008",fill:"#fff"}),d("path",{d:"M44.6462 81.0138L44.6436 62.6336L42.3347 61.3376V56.5618H52.8751V61.3376L50.676 62.6336V100.18L45.0521 98.4987L36.9146 74.4637L36.913 90.3292L39.5054 92.3088V97.1954L28.2104 94.32V90.1569L30.8024 89.1451V62.5958L28.1474 61.2846V56.5088H36.693L44.6735 81.0154",fill:"#D50A0A"}),d("path",{d:"M64.126 97.823L66.3881 100.525V105.301L55.1877 101.122V97.069L57.6536 96.0566V62.5954L55.2029 61.3535V56.5146H74.6822V66.2391H70.4094L69.115 62.2488H64.1664V73.4965H67.8742L69.3345 71.3604H72.3197V81.3678H69.3345L67.9283 79.3409H64.158V97.8787",fill:"#D50A0A"}),d("path",{d:"M76.5368 99.5508V94.7749L79.3173 92.4965V62.6485L76.9443 61.4067V56.5684H88.1458V61.4067L85.9467 62.6485V90.7694L90.7693 89.4667L91.6934 82.1152H96.2965V94.3995L76.5027 99.6784",fill:"#D50A0A"}),d("path",{d:"M26.6593 44.7244L23.2661 42.1792H27.4133L28.7818 38.252L30.1497 42.1792H34.2969L30.9037 44.7396L32.1508 48.7304L28.7734 46.358L25.3959 48.7304L26.6435 44.7396",fill:"#fff"}),d("path",{d:"M41.3475 44.7244L37.9543 42.1792H42.1016L43.47 38.252L44.8379 42.1792H48.9851L45.5919 44.7396L46.839 48.7304L43.4616 46.358L40.0841 48.7304L41.3312 44.7396",fill:"#fff"}),d("path",{d:"M26.6593 31.5291L23.2661 28.9839H27.4133L28.7818 25.0566L30.1497 28.9839H34.2969L30.9037 31.5443L32.1508 35.5346L28.7734 33.1627L25.3959 35.5346L26.6435 31.5443",fill:"#fff"}),d("path",{d:"M41.3475 31.5291L37.9543 28.9839H42.1016L43.47 25.0566L44.8379 28.9839H48.9851L45.5919 31.5443L46.839 35.5346L43.4616 33.1627L40.0841 35.5346L41.3312 31.5443",fill:"#fff"}),d("path",{d:"M99.0008 48.6518L95.6228 46.2799L92.2453 48.6518L93.4925 44.6615L90.0998 42.1011H94.2465L95.6144 38.1738L96.9828 42.1011H101.13L97.7363 44.6615L98.985 48.6518",fill:"#fff"}),d("path",{d:"M84.2338 48.6518L80.8563 46.2799L77.4783 48.6518L78.726 44.6615L75.3328 42.1011H79.4795L80.8474 38.1738L82.2174 42.1011H86.3647L82.9709 44.6615L84.2202 48.6518",fill:"#fff"}),d("path",{d:"M99.0008 35.4555L95.6228 33.0836L92.2453 35.4555L93.4925 31.4652L90.0998 28.9048H94.2465L95.6144 24.9775L96.9828 28.9048H101.13L97.7363 31.4652L98.985 35.4555",fill:"#fff"}),d("path",{d:"M84.2338 35.4555L80.8563 33.0836L77.4783 35.4555L78.726 31.4652L75.3328 28.9048H79.4795L80.8474 24.9775L82.2174 28.9048H86.3647L82.9709 31.4652L84.2202 35.4555",fill:"#fff"}),d("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.2835 24.114C69.7336 21.6996 71.4937 20.7838 71.4937 20.7838L71.4717 20.777C71.8193 20.746 72.0236 21.176 72.1286 21.4354C73.6246 25.1269 73.9901 29.6512 72.8737 33.9712C71.1451 40.5534 65.6315 46.6441 53.7079 48.1879C53.4533 48.221 53.1377 48.1417 53.1077 47.9868C53.6575 45.4894 54.9929 40.6978 57.8993 35.6238C58.4712 35.9409 58.9894 36.288 59.5014 36.6918C59.6154 36.4934 59.7611 36.2596 59.9524 35.9527C60.043 35.8073 60.1439 35.6454 60.2565 35.4631C58.7962 34.2979 57.1148 33.4981 55.1987 33.1384C55.1987 33.1384 54.8322 33.8436 54.5686 34.3966C54.5686 34.3966 55.3058 34.5284 56.2027 34.8503C53.6234 40.3486 52.7528 45.47 52.5107 47.7794C51.7819 46.6011 51.2084 43.9136 51.0057 42.438C49.1206 28.5511 59.1275 20.4288 70.014 20.2886C70.7533 20.2786 71.0316 20.4146 71.0316 20.4146C71.0316 20.4146 68.6282 21.3257 65.863 23.4308C65.863 23.4308 65.1935 23.1588 64.503 22.9829C64.0551 23.2754 63.6009 23.5773 63.1735 23.8835C64.4621 24.197 66.1109 24.8623 67.714 26.1766C68.0653 25.8437 68.4439 25.4887 68.8147 25.16C68.4581 24.8633 67.8364 24.4264 67.2835 24.114ZM60.3873 26.1089C62.1784 26.5011 63.8734 27.2998 65.3831 28.5438L65.3894 28.5406C65.727 28.1646 66.0836 27.7976 66.4512 27.4206C65.4141 26.5641 63.906 25.557 61.6596 25.0166C61.5744 25.0879 61.4865 25.1604 61.3967 25.2345C61.0748 25.5004 60.7276 25.787 60.3873 26.1089ZM58.0306 28.6531C60.0097 29.0616 61.7599 29.9585 63.1992 31.1667L63.2086 31.1615C63.5143 30.7608 63.8372 30.3402 64.1827 29.9254C62.4861 28.526 60.5443 27.7278 59.0299 27.459C58.6891 27.8455 58.3341 28.2619 58.0306 28.6531ZM61.2353 33.9171L61.2348 33.9167V33.9155C61.5036 33.517 61.804 33.0827 62.1212 32.6306C60.8798 31.5935 59.1202 30.5785 56.9525 30.1484C56.6433 30.6084 56.0982 31.4974 56.0982 31.4974C57.8734 31.8277 59.6827 32.6241 61.2348 33.9167V33.9171H61.2353Z",fill:"#fff"})]});import{jsx as a,jsxs as l0}from"react/jsx-runtime";var o0=C=>l0("svg",{width:125,height:125,viewBox:"0 0 125 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[a("title",{children:"NHL"}),a("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M112.21 30.6483C110.471 34.5896 109.154 39.4414 109.154 44.9207C109.154 51.5234 110.754 55.5137 112.374 59.5526C114.034 63.6911 115.714 67.8807 115.714 74.9841C115.714 93.7786 101.72 107.276 86.2331 111.26C82.4679 112.213 79.6914 112.743 77.1633 113.225C74.5488 113.724 72.2 114.172 69.2982 114.985C68.555 115.765 63.2801 121.463 63.2801 121.463C63.2801 121.463 58.0051 115.765 57.2635 114.985C54.3621 114.172 52.0139 113.724 49.4004 113.225C46.8727 112.743 44.0967 112.213 40.3319 111.26C24.8401 107.276 10.8476 93.7786 10.8476 74.9841C10.8476 67.8807 12.5279 63.6911 14.1877 59.5526C15.8076 55.5137 17.4079 51.5234 17.4079 44.9207C17.4079 39.4414 16.0888 34.5896 14.3546 30.6483L10.9039 22.8187L19.015 20.4249C22.5493 19.3825 25.1184 16.7137 26.6628 12.4956L30.2389 2.70508L38.2117 9.30559C40.8322 11.4773 43.8309 12.8962 47.0161 12.8962C51.284 12.8962 55.5068 10.7679 58.1483 8.15697L63.2801 3.0783L68.4151 8.15697C71.055 10.7679 75.2794 12.8962 79.5457 12.8962C82.7277 12.8962 85.7279 11.4773 88.3517 9.30559L96.3212 2.70508L99.9022 12.4956C101.442 16.7137 104.014 19.3825 107.545 20.4249L115.658 22.8187L112.21 30.6483ZM75.6322 109.74C78.4023 109.201 81.5966 108.58 85.3129 107.641C102.571 103.273 112.029 88.7836 112.029 74.9841C112.029 68.8582 110.464 64.8021 108.864 60.6559C107.192 56.3212 105.481 51.8881 105.481 44.8885C105.481 34.2196 110.576 25.2076 110.576 25.2076C110.576 25.2076 98.0554 24.1169 94.6611 8.89859C94.6611 8.89859 87.1532 16.63 79.5457 16.63C69.7358 16.63 63.2801 8.29371 63.2801 8.29371C63.2801 8.29371 56.8276 16.63 47.0161 16.63C39.4085 16.63 31.8991 8.89859 31.8991 8.89859C28.5064 24.1169 15.989 25.2076 15.989 25.2076C15.989 25.2076 21.0822 34.2196 21.0822 44.8885C21.0822 51.8881 19.3714 56.3212 17.6986 60.6559C16.0985 64.8021 14.5332 68.8582 14.5332 74.9841C14.5332 88.7836 23.9875 103.273 41.2505 107.641C44.9667 108.58 48.1614 109.202 50.932 109.741C54.2747 110.392 57.0002 110.922 59.2792 111.745C59.8133 112.245 63.2801 116.004 63.2801 116.004C63.2801 116.004 66.7485 112.245 67.2825 111.745C69.5623 110.922 72.2881 110.391 75.6322 109.74Z",fill:"#E4E5E6"}),a("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M105.489 27.5968C105.489 27.5968 101.797 35.1223 101.797 44.8888C101.797 52.5676 103.636 57.3543 105.365 61.8554C106.9 65.8496 108.348 69.6188 108.348 74.9844C108.348 90.9347 95.9174 101.09 84.3927 104.018C80.5786 104.986 77.3157 105.596 74.5173 106.118C70.6198 106.846 67.6232 107.406 65.2926 108.532C65.2926 108.532 63.8351 109.864 63.2801 110.479C62.7283 109.864 61.2724 108.532 61.2724 108.532C58.9391 107.406 55.9425 106.846 52.0454 106.118C49.247 105.596 45.9841 104.987 42.1691 104.018C30.6443 101.09 18.2139 90.9347 18.2139 74.9844C18.2139 69.6188 19.6619 65.8496 21.1964 61.8554C22.9256 57.3543 24.7645 52.5676 24.7645 44.8888C24.7645 35.1223 21.0725 27.5968 21.0725 27.5968C21.0725 27.5968 29.5922 25.8787 33.5593 15.0972C33.5593 15.0972 39.2139 20.3705 47.0161 20.3705C56.7906 20.3705 63.2801 13.5078 63.2801 13.5078C63.2801 13.5078 69.7728 20.3705 79.5457 20.3705C87.3495 20.3705 93.0025 15.0972 93.0025 15.0972C96.9712 25.8787 105.489 27.5968 105.489 27.5968ZM28.9471 44.8888C28.9471 38.6953 27.6023 33.3463 26.4488 29.8844C29.137 28.4076 32.5152 25.7983 35.2066 21.3068C38.099 22.9236 42.1964 24.5548 47.0161 24.5548C54.3164 24.5548 60.0192 21.3679 63.2801 18.9726C66.5409 21.3679 72.247 24.5548 79.5457 24.5548C80.7104 24.5548 81.8316 24.4583 82.9079 24.2893L23.151 69.1689C23.6696 67.1337 24.4019 65.2039 25.172 63.1745C26.9578 58.4681 28.9471 53.2256 28.9471 44.8888ZM22.4126 75.8004C22.7472 86.1588 29.4394 93.7069 37.0872 97.6337L98.1182 51.8034C97.8045 49.741 97.6162 47.4663 97.6162 44.8891C97.6162 38.6956 98.9595 33.3467 100.115 29.8848C97.8093 28.6219 95.0037 26.5226 92.5553 23.125L22.4126 75.8004ZM74.2317 101.868C77.191 101.315 80.411 100.713 83.3615 99.9627C93.3821 97.4162 104.165 88.52 104.165 74.9844C104.165 70.4835 102.847 67.009 101.394 63.1806L101.394 63.1805L101.394 63.1803C100.669 61.2713 99.9112 59.2744 99.2668 57.0184L42.3798 99.7407C42.6533 99.818 42.9235 99.8936 43.1986 99.9627C46.1498 100.714 49.3706 101.315 52.3306 101.868L52.3307 101.868L52.3308 101.868L52.3308 101.868C56.6203 102.669 60.3622 103.368 61.9432 104.271C62.5433 104.712 63.2801 105.495 63.2801 105.495C63.2801 105.495 64.0169 104.712 64.6201 104.271C66.1995 103.368 69.9416 102.669 74.2315 101.868L74.2317 101.868Z",fill:"#E4E5E6"}),a("path",{d:"M48.4623 75.8434L41.9101 65.8083L34.6307 71.2763C34.6307 71.2763 37.1805 71.3455 37.1805 74.0175V92.9118L42.3171 89.0573V75.6954L48.1695 84.6607L53.5989 80.5859V57.0312L48.4623 60.8873V75.8434Z",fill:"#E4E5E6"}),a("path",{d:"M69.2822 53.9588L63.4908 58.3056V49.5992L55.6661 55.4742C55.6661 55.4742 58.2159 55.5466 58.2159 58.2203V77.1161L63.4908 73.1555V64.5393L69.2822 60.1942V68.8056L74.3045 65.0348V41.4785L69.2822 45.2541V53.9588Z",fill:"#E4E5E6"}),a("path",{d:"M83.9632 51.7708V34.2295L76.1401 40.1029C76.1401 40.1029 78.6898 40.1737 78.6898 42.8441V61.7431L93.2502 50.804C92.9381 47.0348 93.2502 44.7971 93.2502 44.7971L83.9632 51.7708Z",fill:"#E4E5E6"}),a("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M79.5457 16.6302C87.1532 16.6302 94.6611 8.89882 94.6611 8.89882C98.0554 24.1172 110.576 25.2079 110.576 25.2079C110.576 25.2079 105.481 34.2198 105.481 44.8887C105.481 51.8883 107.192 56.3214 108.864 60.6561C110.464 64.8023 112.029 68.8584 112.029 74.9843C112.029 88.7838 102.571 103.273 85.3129 107.641C81.5965 108.58 78.4023 109.201 75.6322 109.741C72.2881 110.392 69.5623 110.922 67.2825 111.745C66.7484 112.245 63.2801 116.005 63.2801 116.005C63.2801 116.005 59.8133 112.245 59.2792 111.745C57.0001 110.922 54.2747 110.392 50.932 109.741C48.1614 109.202 44.9667 108.58 41.2505 107.641C23.9875 103.273 14.5332 88.7838 14.5332 74.9843C14.5332 68.8584 16.0985 64.8023 17.6986 60.6561C19.3714 56.3214 21.0822 51.8883 21.0822 44.8887C21.0822 34.2198 15.989 25.2079 15.989 25.2079C15.989 25.2079 28.5064 24.1172 31.8991 8.89882C31.8991 8.89882 39.4085 16.6302 47.0161 16.6302C56.8276 16.6302 63.2801 8.29395 63.2801 8.29395C63.2801 8.29395 69.7358 16.6302 79.5457 16.6302ZM105.365 61.8554C103.636 57.3543 101.797 52.5675 101.797 44.8887C101.797 35.1223 105.489 27.5968 105.489 27.5968C105.489 27.5968 96.9712 25.8787 93.0025 15.0972C93.0025 15.0972 87.3495 20.3705 79.5457 20.3705C69.7728 20.3705 63.2801 13.5078 63.2801 13.5078C63.2801 13.5078 56.7906 20.3705 47.0161 20.3705C39.2139 20.3705 33.5593 15.0972 33.5593 15.0972C29.5922 25.8787 21.0725 27.5968 21.0725 27.5968C21.0725 27.5968 24.7645 35.1223 24.7645 44.8887C24.7645 52.5675 22.9256 57.3543 21.1964 61.8554C19.6619 65.8495 18.2139 69.6188 18.2139 74.9843C18.2139 90.9346 30.6443 101.09 42.1691 104.018C45.9841 104.986 49.247 105.596 52.0454 106.118C55.9425 106.846 58.9391 107.406 61.2724 108.532C61.2724 108.532 62.7283 109.864 63.2801 110.479C63.8351 109.864 65.2926 108.532 65.2926 108.532C67.6232 107.406 70.6199 106.846 74.5173 106.118C77.3157 105.596 80.5786 104.986 84.3927 104.018C95.9174 101.09 108.348 90.9346 108.348 74.9843C108.348 69.6188 106.9 65.8495 105.365 61.8554Z",fill:"#231F20"}),a("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M97.0548 0.000976562L101.419 11.9424C102.775 15.6521 104.987 17.9879 108.004 18.8775L117.878 21.7876L113.686 31.3015C111.749 35.6917 110.769 40.2716 110.769 44.9208C110.769 51.1804 112.324 55.0861 113.921 59.0942C115.603 63.3185 117.331 67.6566 117.331 74.9842C117.331 95.558 101.418 109.023 86.6352 112.827C82.8605 113.747 80.4169 114.232 78.0525 114.702C75.7375 115.162 73.4985 115.607 70.1605 116.429L63.2801 123.836C63.2801 123.836 56.9498 117.02 56.3981 116.429C53.06 115.607 50.8211 115.162 48.5056 114.702C46.1421 114.232 43.6987 113.746 39.9249 112.827C25.1426 109.023 9.23087 95.558 9.23087 74.9842C9.23087 67.6566 10.9582 63.3185 12.6401 59.0942C14.2361 55.0861 15.7912 51.1804 15.7912 44.9208C15.7912 40.2716 14.8082 35.6917 12.873 31.3015L8.68391 21.7876L18.5597 18.8775C21.5712 17.9879 23.7864 15.6521 25.1426 11.9424L29.5054 0.000976562L39.2428 8.05897C41.8232 10.1953 44.4373 11.2812 47.0161 11.2812C50.4635 11.2812 54.3856 9.60493 57.0094 7.00849L63.2801 0.803719L69.5524 7.00849C72.1762 9.60493 76.0982 11.2812 79.5457 11.2812C82.1228 11.2812 84.7402 10.1953 87.3189 8.05897L97.0548 0.000976562ZM109.154 44.9208C109.154 39.4416 110.471 34.5897 112.21 30.6484L115.658 22.8188L107.545 20.4251C104.014 19.3826 101.442 16.7138 99.9022 12.4958L96.3212 2.70521L88.3517 9.30572C85.7279 11.4775 82.7277 12.8963 79.5457 12.8963C75.2794 12.8963 71.0549 10.768 68.4151 8.1571L63.2801 3.07843L58.1483 8.1571C55.5068 10.768 51.284 12.8963 47.0161 12.8963C43.8309 12.8963 40.8322 11.4775 38.2117 9.30572L30.2389 2.70521L26.6628 12.4958C25.1184 16.7138 22.5493 19.3826 19.015 20.4251L10.9039 22.8188L14.3546 30.6484C16.0888 34.5897 17.4079 39.4416 17.4079 44.9208C17.4079 51.5235 15.8076 55.5138 14.1877 59.5527C12.5279 63.6912 10.8476 67.8808 10.8476 74.9842C10.8476 93.7787 24.8401 107.276 40.3319 111.26C44.0967 112.213 46.8726 112.743 49.4003 113.225C52.0139 113.724 54.362 114.173 57.2635 114.985C58.0051 115.765 63.2801 121.463 63.2801 121.463C63.2801 121.463 68.555 115.765 69.2982 114.985C72.2 114.173 74.5488 113.724 77.1633 113.225C79.6914 112.743 82.4679 112.213 86.2331 111.26C101.72 107.276 115.714 93.7787 115.714 74.9842C115.714 67.8808 114.034 63.6912 112.374 59.5527C110.754 55.5138 109.154 51.5235 109.154 44.9208Z",fill:"#231F20"}),a("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.4126 75.7994L92.5553 23.124C95.0037 26.5216 97.8093 28.621 100.115 29.8838C98.9595 33.3457 97.6162 38.6947 97.6162 44.8882C97.6162 47.4653 97.8045 49.74 98.1182 51.8024L37.0872 97.6327C29.4394 93.7059 22.7472 86.1578 22.4126 75.7994ZM78.6898 61.7422L93.2502 50.803C92.9381 47.0338 93.2502 44.7961 93.2502 44.7961L83.9632 51.7698V34.2285L76.1401 40.1019C76.1401 40.1019 78.6898 40.1727 78.6898 42.8431V61.7422ZM69.2822 68.8048L74.3045 65.034V41.4777L69.2822 45.2533V53.958L63.4908 58.3048V49.5985L55.6661 55.4734C55.6661 55.4734 58.2159 55.5458 58.2159 58.2195V77.1153L63.4908 73.1547V64.5385L69.2822 60.1934V68.8048ZM53.5989 80.5849L48.1695 84.6598L42.3171 75.6945V89.0563L37.1805 92.9108V74.0166C37.1805 71.3445 34.6307 71.2753 34.6307 71.2753L41.9101 65.8074L48.4623 75.8424V60.8863L53.5989 57.0303V80.5849Z",fill:"#231F20"}),a("path",{d:"M79.5457 24.5549C72.247 24.5549 66.5409 21.368 63.2801 18.9727C60.0192 21.368 54.3164 24.5549 47.0161 24.5549C42.1964 24.5549 38.0991 22.9236 35.2066 21.3069C32.5152 25.7984 29.137 28.4077 26.4488 29.8845C27.6023 33.3464 28.9471 38.6954 28.9471 44.8889C28.9471 56.8206 24.8723 62.4141 23.151 69.169L82.9079 24.2894C81.8317 24.4583 80.7104 24.5549 79.5457 24.5549Z",fill:"#231F20"}),a("path",{d:"M42.3798 99.7409C42.6533 99.8181 42.9235 99.8937 43.1986 99.9629C50.4265 101.802 59.2712 102.746 61.9432 104.271C62.5433 104.712 63.2801 105.495 63.2801 105.495C63.2801 105.495 64.0169 104.712 64.6201 104.271C67.289 102.746 76.1336 101.802 83.3615 99.9629C93.3821 97.4163 104.165 88.5202 104.165 74.9846C104.165 68.2393 101.204 63.7992 99.2668 57.0186L42.3798 99.7409Z",fill:"#231F20"}),a("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M106.977 107.595C109.308 107.595 111.2 109.483 111.2 111.814C111.2 114.147 109.308 116.034 106.977 116.034C104.645 116.034 102.759 114.147 102.759 111.814C102.759 109.483 104.645 107.595 106.977 107.595ZM106.977 108.499C105.147 108.499 103.662 109.984 103.662 111.814C103.662 113.647 105.147 115.128 106.977 115.128C108.81 115.128 110.294 113.647 110.294 111.814C110.294 109.984 108.81 108.499 106.977 108.499Z",fill:"#231F20"}),a("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M107.759 112.183L108.711 114.226H107.714L106.797 112.265H106.152V114.226H105.243V109.406H107.28C108.073 109.406 108.711 110.043 108.711 110.836C108.711 111.459 108.317 111.987 107.759 112.183ZM106.152 111.362H107.28C107.571 111.362 107.807 111.126 107.807 110.836C107.807 110.544 107.571 110.309 107.28 110.309H106.152V111.362Z",fill:"#231F20"})]});import{jsx as e5,jsxs as r0}from"react/jsx-runtime";var t0=C=>r0("svg",{width:125,height:125,viewBox:"0 0 125 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[e5("title",{children:"PLL"}),e5("path",{d:"M73.0442 36.5797L71.878 40.5418H79.2887L78.3364 37.2642V34.5834H89.2244C93.2872 34.5834 96.5944 31.2783 96.5944 27.2144V24.1833C96.5944 20.1205 93.2883 16.8144 89.2244 16.8144H70.6741L73.0442 20.9169V36.5797ZM87.7098 22.845C89.2844 22.845 90.5647 24.1253 90.5647 25.6999C90.5647 27.2745 89.2845 28.5548 87.7108 28.5548H79.0748V25.4239L77.9585 22.846H87.7098V22.845Z",fill:"#FFCB06"}),e5("path",{d:"M79.0748 82.9396V67.0976H70.7637L73.0442 71.8133V88.9703H91.8644L93.6661 81.7001L89.4515 82.9396H79.0748Z",fill:"#FFCB06"}),e5("path",{d:"M79.0748 58.9668V43.1247H70.7637L73.0442 47.8405V64.9974H93.1436L94.9454 57.7272L90.7307 58.9668H79.0748Z",fill:"#FFCB06"}),e5("path",{d:"M16 7.5L17.7885 90.9493L62.6207 117.5L107.453 90.9493L109.241 7.5H16ZM21.281 12.669H35.9864L44.601 17.6964C41.0932 19.2313 38.1436 21.4425 35.5199 24.4237L21.3554 16.1584L21.281 12.669ZM21.4857 22.2186L32.3177 28.5395C29.748 32.3325 28.6571 35.5469 28.4697 38.3214L21.7465 34.3981L21.4857 22.2186ZM21.8769 40.4593L29.862 45.119C30.7339 46.9116 31.8746 48.4709 32.9105 49.8846C33.3006 50.4163 33.6876 50.9439 34.0492 51.4705C37.4307 56.3909 40.1083 60.8011 41.7604 64.0909L22.1376 52.6397L21.8769 40.4603V40.4593ZM22.268 58.6999L43.6182 71.1594L43.6864 83.2258L22.5297 70.8794L22.269 58.6999H22.268ZM22.8954 87.966L22.6591 76.9406L44.8006 89.8625C44.9748 90.3493 45.1673 90.8219 45.3843 91.2731C46.2337 93.0382 47.2553 94.4448 48.506 95.5743C51.257 98.0585 54.5845 99.0668 57.0259 99.4743L57.8927 108.693L22.8954 87.966ZM60.0367 27.4487C58.2084 27.6208 56.3843 27.9814 54.6355 28.5945C52.4324 29.3605 50.373 30.5165 48.5824 31.9394C45.6929 34.2351 43.5275 37.1002 41.7359 40.0885L43.278 42.7387C45.3568 39.621 47.7605 36.7641 50.6918 34.7983C53.4815 32.8876 56.7122 31.9495 60.0367 31.8569V37.4169C58.9886 37.6492 57.9711 37.9792 57.0168 38.412C55.268 39.1994 53.7107 40.2657 52.3346 41.4676C49.9961 43.524 48.1628 45.9521 46.6442 48.5259L48.1455 51.1069C49.9024 48.4241 52.0281 45.9766 54.5041 44.1616C56.2152 42.8976 58.1107 42.0013 60.0367 41.6092V94.783H59.9847C58.8277 94.7636 54.8351 94.5029 52.0097 91.9331C51.5616 91.5247 51.1847 91.0358 50.8761 90.6121C49.8647 89.2249 49.2302 87.4425 48.9919 85.3168L48.9644 85.0765C48.9032 84.5479 48.8452 84.0488 48.8421 83.5059L48.7617 69.1621C48.7413 65.634 45.2386 58.76 38.3483 48.7317C37.9593 48.1633 37.5437 47.597 37.122 47.0216C33.5939 42.2101 30.5485 38.0535 39.1754 27.9396C43.9451 22.349 49.9411 20.0135 59.9745 19.8801H60.0377V27.4487H60.0367ZM60.0367 14.9189L59.2667 14.9158L58.6179 14.923V14.9423C55.9952 15.0258 53.5986 15.2662 51.3874 15.6716L46.2429 12.669H60.0367V14.9189ZM102.347 87.966L65.2057 109.963V12.669H103.96L102.347 87.966Z",fill:"#FFCB06"})]});import{jsx as T4,jsxs as n0}from"react/jsx-runtime";var i0=C=>n0("svg",{width:125,height:125,viewBox:"0 0 125 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[T4("title",{children:"WNBA"}),T4("path",{d:"M90.7652 9.76336C90.4177 11.1101 89.3533 12.8479 89.0492 14.0643C88.7668 15.2808 88.4627 16.8013 88.0934 17.7571C87.7242 18.7129 86.8553 19.3645 86.7249 19.9727C86.5946 20.581 86.2905 22.1667 84.2921 25.034C82.5543 27.5537 80.23 30.0083 80.23 30.0083C79.9911 31.3551 76.9717 35.1348 76.9066 36.0905C76.6242 38.0238 73.8438 40.739 73.67 42.6289C73.6483 44.6273 72.497 48.5155 71.8888 50.0578C66.3496 63.8948 77.1021 63.5689 70.0207 79.274C74.2999 82.2065 74.9516 93.3499 75.1471 95.6959C76.4938 95.4135 76.2115 98.0636 77.2758 99.6276C78.0144 100.801 80.8817 102.69 81.0338 103.842C80.1649 109.989 79.6218 109.62 82.2067 115.224C82.6195 116.571 84.6613 117.461 85.2261 119.438C87.0725 126.433 80.5776 126.845 79.1439 120.589C77.2107 114.203 74.7778 115.42 74.061 113.095C75.2557 110.945 70.5854 105.493 62.2007 92.9372C59.2682 88.81 57.7911 83.4664 57.7911 83.4664L56.8788 83.4446C56.8788 83.4446 56.6399 82.0762 55.5538 80.2081C53.3381 76.385 51.4266 71.1065 52.3606 66.4145C52.8602 63.8731 54.4242 63.3083 54.4894 60.8971C53.7074 60.3106 54.2722 59.029 54.4459 57.9647C54.9455 54.7281 54.2939 51.0353 53.5119 50.2316C53.0774 50.1013 52.7951 50.9919 52.4041 51.5566C51.8827 52.2517 49.6671 55.5535 47.4949 57.0958C42.955 59.9848 43.1939 52.078 43.6501 49.6668C43.9324 47.9725 43.6283 44.258 43.6718 42.8678C43.8021 40.8694 43.7587 39.2837 42.4988 37.85C42.4771 37.5676 42.8463 37.5242 43.0201 37.6545C42.564 36.6336 41.5647 35.8299 41.1737 34.8524C41.5213 34.4179 42.1078 34.8958 42.3902 35.1782C42.0644 34.331 41.2606 33.6794 41 32.8322C41.7602 31.985 42.8029 33.9618 43.2156 34.5265C43.2156 33.9835 41.8037 32.2023 42.8246 32.2457C44.0193 32.8974 44.6493 36.0036 44.9534 36.4381C45.3227 37.5242 46.3653 38.241 46.5174 36.5901C46.5608 35.895 47.5166 34.5265 48.1248 35.4606C47.7773 36.6553 47.3645 37.8717 47.408 39.1751C47.6035 40.5218 46.4305 41.4776 46.5608 42.8026C46.5391 44.4101 47.2559 46.452 47.8207 48.2332C49.3412 46.8212 50.0364 46.4302 50.3622 44.7142C50.8183 41.9555 53.7508 39.6964 55.8361 39.7616C55.8579 39.3271 60.224 39.0664 61.1363 39.023C61.5491 38.7841 61.4404 38.2193 61.3753 37.7631C61.2667 37.1115 60.3978 37.1332 59.9199 36.8725C58.7035 36.2643 59.3768 35.4606 58.9424 33.94C58.3776 31.4203 59.5506 30.66 59.6592 30.3342C59.5072 29.2263 60.2675 27.0976 61.6794 26.7283C62.7655 25.2729 65.85 25.7508 67.0882 26.2721C70.3465 23.9044 73.67 29.1395 70.1727 31.0944C70.2596 35.3737 68.3263 34.6786 68.2177 36.9594C69.2821 35.4171 70.6723 34.3745 71.715 33.788C72.1277 32.7019 74.5823 27.9882 76.3852 27.4017C76.9066 25.1209 79.5132 23.3614 81.1641 21.3847C82.815 19.4731 84.3138 17.7788 84.5527 17.1923C85.0306 14.8898 83.7056 14.6074 81.8375 14.5422C77.8189 13.8254 75.1254 10.0023 75.8422 5.98372C77.4062 -2.98749 90.9825 -1.40178 90.5046 7.61288C90.8956 7.87354 91.0476 8.65554 90.7652 9.76336Z",fill:"#FA4D00"})]});import{jsx as I5,jsxs as p0}from"react/jsx-runtime";var d0=C=>p0("svg",{width:125,height:125,viewBox:"0 0 125 125",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[I5("title",{children:"WNBAAlt"}),I5("path",{d:"M77.2075 0H47.9366C40.7971 0 35 5.80698 35 12.9366V112.044C35 119.188 40.7971 125 47.9366 125H77.1829C84.3224 125 90.1491 119.183 90.1491 112.044V12.9366C90.1491 5.80698 84.3372 0 77.2026 0",fill:"#fff"}),I5("path",{d:"M85.2273 6.90938C85.7534 7.96162 86.0189 9.14662 85.955 10.3808C86.368 10.5725 86.4959 11.3248 86.2254 12.382C85.896 13.6604 84.8732 15.3125 84.6028 16.4631C84.3275 17.6186 84.0423 19.0691 83.6833 19.9739C83.3244 20.8786 82.5131 21.503 82.3754 22.0832C82.2426 22.6536 81.9575 24.1631 80.0693 26.9019C78.4172 29.2965 76.1997 31.637 76.1997 31.637C76.1997 31.637 75.9735 32.522 75.3343 33.4809C74.1247 35.2903 73.3675 36.3475 73.0479 37.4292C72.7233 38.511 72.089 39.7697 71.2433 40.999C70.4468 42.1544 69.9797 42.7642 69.9698 43.6443C69.9403 45.5423 68.8487 49.2546 68.2735 50.7051C66.8033 54.447 66.3116 58.1986 66.8918 60.7309C67.5949 63.8237 69.9059 66.4297 68.5488 72.0301C67.4179 76.6816 66.4935 78.5157 66.4935 78.5157C66.4935 78.5157 68.6521 80.571 69.5322 82.9311C70.7418 86.196 71.3613 94.1419 71.3613 94.1419C71.3613 94.1419 71.7301 94.1419 72.0104 94.2501C72.2906 94.3681 72.684 96.7577 73.3871 97.8837C74.0903 99.0097 76.8241 100.804 76.9667 101.896C77.0945 102.968 76.3914 104.748 76.2832 106.12C76.2488 106.587 76.2341 106.892 76.2488 107.226C76.3816 109.591 77.7485 111.627 78.0829 112.733C78.4664 114.011 80.4283 114.862 80.9593 116.74C81.4117 118.343 81.5444 120.782 80.0988 121.707C84.1849 120.477 87.1646 116.691 87.1646 112.202V12.7999C87.1646 10.5922 86.4418 8.55658 85.2273 6.90938ZM78.4861 122.046C78.0779 122.095 77.6649 122.125 77.2421 122.125H47.9122C42.4297 122.125 37.9896 117.68 37.9896 112.202V12.7999C37.9847 7.32241 42.4297 2.87744 47.9122 2.87744H77.247C77.7977 2.87744 78.3336 2.92169 78.8598 3.0102C75.5408 3.0397 72.6102 5.42936 72.0104 8.81718C71.3367 12.6426 73.8887 16.291 77.7141 16.9646C78.25 17.063 78.786 17.0876 79.3072 17.0581C79.5727 17.1712 79.8186 17.3088 79.9907 17.4859C80.325 17.8202 80.5364 18.9167 80.3054 19.4772C80.0693 20.0378 78.6532 21.6358 77.0749 23.46C75.4818 25.299 74.8917 25.4858 73.456 27.3002C72.7676 28.1705 72.5217 29.1834 72.5217 29.1834C72.5217 29.1834 71.1351 29.9505 70.2255 31.2977C69.3257 32.6401 68.0768 35.2559 68.0768 35.2559C68.0768 35.2559 67.0049 35.8754 66.464 36.3475C65.8985 36.8441 65.5642 37.1735 64.743 38.2602C64.7332 37.3555 65.0577 36.9129 65.5986 36.4753C66.0116 36.141 66.6459 34.5233 66.6066 32.6843C67.4769 32.2074 68.0522 31.2731 68.0227 30.2111C67.9834 28.7015 66.7246 27.5116 65.2151 27.551C64.63 27.5657 64.094 27.7673 63.6613 28.0869C62.5845 27.6296 61.2372 27.4526 59.7031 27.7968C59.1672 27.9148 58.641 28.1459 58.5181 28.5245C58.2133 28.6376 57.6773 28.8589 57.0922 29.7833C56.4038 30.8896 56.7185 31.5534 56.6005 31.9566C56.5071 32.2664 55.3909 32.9842 55.9219 35.3788C56.1383 36.3475 56.099 37.0653 56.1776 37.4194C56.2711 37.8275 56.453 38.0094 56.8562 38.1815C57.1168 38.2848 57.343 38.3585 57.6134 38.447C57.992 38.565 58.1739 38.6781 58.2477 39.0223C58.2674 39.1059 58.2821 39.1944 58.287 39.2829C58.3067 39.5238 58.287 39.7599 58.2723 39.8631C58.2477 40.0106 58.1543 40.1483 58.0166 40.227L55.3663 40.3991C53.7683 40.3843 52.9767 40.9203 52.9767 40.9203C52.9767 40.9203 51.4278 41.0629 50.3707 41.7414C49.3479 42.4052 48.0154 44.1262 47.7646 45.6357C47.5827 46.2257 47.4696 46.6879 47.1598 47.2632C46.9632 47.632 46.0388 48.2024 45.3406 48.9792C44.8538 47.4451 44.1998 45.498 44.1457 44.1606C44.1457 44.1065 44.1457 43.8705 44.1457 43.8066C44.1457 43.3935 44.1654 42.9264 44.3375 42.5527C44.7751 41.9086 44.9964 41.1415 44.9472 40.3499C44.9029 39.7894 45.021 39.2387 45.1537 38.7027C45.257 38.2897 45.1488 38.0094 45.3553 37.6308C45.4684 37.3653 45.6552 37.1096 45.6356 36.8146C45.5618 36.4851 45.139 36.4851 44.8931 36.6081C44.4063 36.8343 44.2392 37.4145 44.1162 37.8914C44.0031 38.2454 44.0376 38.6388 43.836 38.747C43.6393 38.8551 43.3049 38.8502 43.1181 38.6142C42.887 38.3438 42.7837 38.093 42.6165 37.7488C42.4543 37.4046 41.8544 35.3985 41.2103 34.3462C41.0431 34.1152 40.8858 33.83 40.5957 33.7513C40.4039 33.6825 40.1236 33.8693 40.2269 34.0856C40.4776 34.6954 40.7628 35.2952 40.9644 35.9197C40.7382 35.5116 40.4432 35.1428 40.1531 34.7789C39.9269 34.5233 39.6909 34.2627 39.3713 34.125C39.1943 34.0414 38.9288 34.1152 38.8649 34.3167C38.8206 34.4741 38.9534 34.6068 39.0271 34.7298C39.4697 35.2952 39.863 35.9 40.1875 36.5392C39.9761 36.3475 39.7352 36.1508 39.45 36.0869C39.2976 36.0574 39.1058 36.0869 39.0222 36.2344C38.9829 36.3721 39.0763 36.5048 39.155 36.6179C39.4942 37.026 39.8679 37.4145 40.1433 37.8717C40.3596 38.211 40.5662 38.565 40.7825 38.8994C40.6055 38.7814 40.2662 38.8158 40.281 39.0862C40.4481 39.5681 40.989 39.8287 41.1119 40.3401C41.5151 41.4218 41.4463 42.5331 41.407 43.8557C41.3676 45.1833 41.643 48.7137 41.3824 50.3216C40.9693 52.8293 41.0579 53.8225 41.7413 56.6448C42.1396 58.2822 43.8114 58.2675 45.0505 57.3824C47.1205 55.9073 49.2397 52.7703 49.7265 52.1114C50.115 51.5853 50.3805 50.7444 50.7886 50.8575C51.5212 51.6344 52.1457 55.1402 51.6737 58.2232C51.5753 58.8919 51.2459 60.013 51.3098 60.3818C51.3737 60.7505 51.7179 60.9128 51.713 61.0161C51.6589 63.3025 50.1592 63.8433 49.6921 66.2576C49.2152 68.7456 49.4708 70.3584 50.0166 72.7775C50.5624 75.1918 51.6982 77.606 52.7357 79.3761C53.7683 81.1463 54.0043 82.4493 54.0043 82.4493L54.8697 82.4788C54.8697 82.4788 56.276 87.563 59.059 91.4966C67.0983 102.855 69.8813 107.914 70.5058 109.065C71.0614 110.073 70.3435 110.127 70.3484 110.678C70.3484 111.224 70.7565 111.701 72.1136 112.556C73.4756 113.412 74.6705 116.239 75.1769 117.817C75.6342 119.214 76.6176 121.766 78.4861 122.031",fill:"#FA4D00"}),I5("path",{d:"M45.3846 112.447L44.4553 115.658H42.6311L41.1707 111.095H42.6606L43.5555 114.306L44.4553 111.095H46.3139L47.2137 114.306L48.1086 111.095H49.5985L48.143 115.658H46.2844L45.3895 112.447H45.3846ZM54.6286 114.183V111.1H55.9906V115.663H54.0631L51.4915 112.58V115.663H50.1344V111.1H52.0471L54.6236 114.183H54.6286ZM63.017 114.389C63.017 115.294 62.2647 115.653 61.1239 115.653H57.1166V111.09H60.7404C61.9795 111.09 62.6728 111.424 62.6728 112.29C62.6728 112.811 62.3778 113.111 62.0188 113.253C61.9991 113.258 61.9942 113.273 61.9942 113.288C61.9942 113.308 62.009 113.312 62.0188 113.312C62.5892 113.391 63.0219 113.75 63.0219 114.384M61.296 112.575C61.296 112.359 61.1338 112.245 60.7502 112.245H58.4786V112.88H60.7502C61.1338 112.88 61.296 112.762 61.296 112.57M58.4737 113.853V114.488H61.1338C61.5074 114.488 61.6353 114.355 61.6353 114.148C61.6353 113.966 61.5074 113.853 61.1338 113.853H58.4737ZM67.8307 114.655H65.2739L64.7674 115.638H63.1546L65.6082 111.075H67.457L69.9647 115.638H68.3519L67.8307 114.655ZM65.8344 113.563H67.2554L66.5375 112.201L65.8393 113.563H65.8344Z",fill:"#fff"})]});import{jsx as P2,jsxs as c0}from"react/jsx-runtime";var s0=C=>c0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[P2("title",{children:"LoadingSpinner"}),P2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.0448 3.90066C12.8882 3.70818 12.8242 3.64062 12.8242 3.64062L13.9297 2.63281C13.9297 2.63281 14.0157 2.7173 14.2083 2.95394C15.3282 4.33026 16.0001 6.08763 16.0001 7.99991C16.0001 10.0439 15.2325 11.9104 13.9711 13.3242L12.8519 12.3255C13.8776 11.176 14.5001 9.66154 14.5001 7.99991C14.5001 6.44492 13.955 5.01927 13.0448 3.90066Z",fill:"#EAF4FF"}),P2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 11.5899 4.41015 14.5 8 14.5C9.94127 14.5 11.6831 13.6499 12.8752 12.2993C13.1493 11.9887 13.6232 11.9592 13.9338 12.2333C14.2444 12.5074 14.2739 12.9813 13.9998 13.2919C12.535 14.9515 10.3895 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C10.3895 0 12.535 1.04855 13.9998 2.70814C14.2739 3.0187 14.2444 3.49265 13.9338 3.76675C13.6232 4.04085 13.1493 4.0113 12.8752 3.70074C11.6831 2.35007 9.94127 1.5 8 1.5Z",fill:"#004EA3"})]});import{jsx as e,jsxs as v}from"react/jsx-runtime";var f0=C=>v("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[e("title",{children:"NumberFire"}),e("path",{d:"M3.17273 13.819C2.24575 12.7841 1.67432 11.4571 1.67432 9.99682C1.67432 7.66667 3.0013 5.33651 4.67114 4.66984C5.0013 5.67301 5.50924 7.0127 7.66162 7C5.33146 2.33968 8.99495 0.00952148 9.66162 0.00952148C9.66162 2.1873 11.0457 3.66666 12.3029 5.26666L8.74733 11.6413L6.01717 8.72063L3.17273 13.819ZM8.99495 13.6603L6.26479 10.7397L4.08067 14.6571C5.2073 15.5147 6.58225 15.9827 7.99813 15.9905C11.3251 15.9905 14.3219 13.3238 14.3219 9.99682C14.3219 8.53651 13.7886 7.3746 13.0838 6.32698L8.99495 13.6603Z",fill:"url(#paint0_linear_5774_90)"}),e("path",{d:"M3.17273 13.819C2.24575 12.7841 1.67432 11.4571 1.67432 9.99682C1.67432 7.66667 3.0013 5.33651 4.67114 4.66984C5.0013 5.67301 5.50924 7.0127 7.66162 7C5.33146 2.33968 8.99495 0.00952148 9.66162 0.00952148C9.66162 2.1873 11.0457 3.66666 12.3029 5.26666L8.74733 11.6413L6.01717 8.72063L3.17273 13.819ZM8.99495 13.6603L6.26479 10.7397L4.08067 14.6571C5.2073 15.5147 6.58225 15.9827 7.99813 15.9905C11.3251 15.9905 14.3219 13.3238 14.3219 9.99682C14.3219 8.53651 13.7886 7.3746 13.0838 6.32698L8.99495 13.6603Z",fill:"url(#paint1_linear_5774_90)"}),e("path",{d:"M5.43305 9.76186L3.17273 13.819C2.24575 12.7841 1.67432 11.4571 1.67432 9.99678C1.67432 7.66663 3.0013 5.33647 4.67114 4.6698C3.80765 6.10472 3.94098 7.78091 5.43305 9.76186ZM6.26479 10.7396L4.08067 14.6571L4.23305 14.7714C7.07114 16.7587 8.94416 13.6095 6.26479 10.7396Z",fill:"url(#paint2_linear_5774_90)"}),e("path",{d:"M13.0839 6.32698C13.7887 7.3746 14.322 8.53651 14.322 9.99682C14.322 13.3238 11.3252 15.9905 7.9982 15.9905C7.08681 15.987 6.18654 15.7901 5.35693 15.4127C7.64265 16.4159 8.72201 15.4063 9.00138 13.6476L13.0839 6.32698ZM12.303 5.26666C11.0458 3.66666 9.6617 2.1873 9.6617 0.00952148C8.99503 0.00952148 5.33154 2.33968 7.6617 7C8.32128 8.33314 8.7649 9.76259 8.97598 11.2349L12.303 5.26666Z",fill:"url(#paint3_linear_5774_90)"}),e("path",{d:"M13.0837 6.32698C13.7884 7.3746 14.3218 8.53651 14.3218 9.99682C14.3218 12.6698 12.3852 14.9175 9.90271 15.6984C12.1884 14.9365 13.7376 11.8952 11.6868 8.82857L13.0837 6.32698ZM10.8995 7.78095L12.3027 5.26666C11.0456 3.66666 9.66144 2.1873 9.66144 0.00952148C8.70271 1.28571 7.83922 3.66666 10.8995 7.78095Z",fill:"url(#paint4_linear_5774_90)"}),e("path",{d:"M5.43305 9.76186L3.17273 13.819C2.24575 12.7841 1.67432 11.4571 1.67432 9.99678C1.67432 7.66663 3.0013 5.33647 4.67114 4.6698C3.80765 6.10472 3.94098 7.78091 5.43305 9.76186ZM6.26479 10.7396L4.08067 14.6571L4.23305 14.7714C7.07114 16.7587 8.94416 13.6095 6.26479 10.7396Z",fill:"url(#paint5_linear_5774_90)"}),e("path",{d:"M13.0839 6.32698C13.7887 7.3746 14.322 8.53651 14.322 9.99682C14.322 13.3238 11.3252 15.9905 7.9982 15.9905C7.08681 15.987 6.18654 15.7901 5.35693 15.4127C7.64265 16.4159 8.72201 15.4063 9.00138 13.6476L13.0839 6.32698ZM12.303 5.26666C11.0458 3.66666 9.6617 2.1873 9.6617 0.00952148C8.99503 0.00952148 5.33154 2.33968 7.6617 7C8.32128 8.33314 8.7649 9.76259 8.97598 11.2349L12.303 5.26666Z",fill:"url(#paint6_linear_5774_90)"}),e("path",{d:"M13.0837 6.32698C13.7884 7.3746 14.3218 8.53651 14.3218 9.99682C14.3218 12.6698 12.3852 14.9175 9.90271 15.6984C12.1884 14.9365 13.7376 11.8952 11.6868 8.82857L13.0837 6.32698ZM10.8995 7.78095L12.3027 5.26666C11.0456 3.66666 9.66144 2.1873 9.66144 0.00952148C8.70271 1.28571 7.83922 3.66666 10.8995 7.78095Z",fill:"url(#paint7_linear_5774_90)"}),e("path",{d:"M14.3217 4.3206C14.3217 4.56813 14.2234 4.80553 14.0484 4.98056C13.8733 5.1556 13.6359 5.25393 13.3884 5.25393C13.1409 5.25393 12.9035 5.1556 12.7284 4.98056C12.5534 4.80553 12.4551 4.56813 12.4551 4.3206C12.4551 3.65393 13.0583 3.65393 12.7217 2.6571C14.0551 2.99361 14.3217 3.82536 14.3217 4.3206Z",fill:"url(#paint8_linear_5774_90)"}),v("defs",{children:[v("linearGradient",{id:"paint0_linear_5774_90",x1:9.59622,y1:7.98603,x2:3.27686,y2:11.5594,gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:.18,stopColor:"#FFE187"}),e("stop",{offset:.24,stopColor:"#FFD986"}),e("stop",{offset:.33,stopColor:"#FFC384"}),e("stop",{offset:.44,stopColor:"#FFA081"}),e("stop",{offset:.55,stopColor:"#FF737D"})]}),v("linearGradient",{id:"paint1_linear_5774_90",x1:13.5092,y1:8.87365,x2:6.36702,y2:7.6146,gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:.24,stopColor:"#FFE187"}),e("stop",{offset:.28,stopColor:"#FFE187",stopOpacity:.95}),e("stop",{offset:.36,stopColor:"#FFE187",stopOpacity:.83}),e("stop",{offset:.46,stopColor:"#FFE187",stopOpacity:.62}),e("stop",{offset:.58,stopColor:"#FFE187",stopOpacity:.34}),e("stop",{offset:.72,stopColor:"#FFE187",stopOpacity:0})]}),v("linearGradient",{id:"paint2_linear_5774_90",x1:4.6159,y1:4.67107,x2:4.6159,y2:15.3942,gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:.14,stopColor:"#FFE187"}),e("stop",{offset:.35,stopColor:"#FFC084"}),e("stop",{offset:.78,stopColor:"#FF737D"})]}),v("linearGradient",{id:"paint3_linear_5774_90",x1:8.74805,y1:.0888865,x2:10.1252,y2:15.8279,gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:.25,stopColor:"#FFE187"}),e("stop",{offset:.33,stopColor:"#FFD286"}),e("stop",{offset:.67,stopColor:"#FF8E7F"}),e("stop",{offset:.83,stopColor:"#FF737D"})]}),v("linearGradient",{id:"paint4_linear_5774_90",x1:13.6246,y1:6.75238,x2:7.58017,y2:8.48571,gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:.04,stopColor:"#FFE187"}),e("stop",{offset:.13,stopColor:"#FFD686"}),e("stop",{offset:.29,stopColor:"#FFBA83"}),e("stop",{offset:.49,stopColor:"#FF8B7F"}),e("stop",{offset:.59,stopColor:"#FF737D"})]}),v("linearGradient",{id:"paint5_linear_5774_90",x1:6.93717,y1:9.32313,x2:1.91495,y2:11.7727,gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FFE187"}),e("stop",{offset:.03,stopColor:"#FFE187",stopOpacity:.92}),e("stop",{offset:.12,stopColor:"#FFE187",stopOpacity:.71}),e("stop",{offset:.21,stopColor:"#FFE187",stopOpacity:.52}),e("stop",{offset:.31,stopColor:"#FFE187",stopOpacity:.36}),e("stop",{offset:.4,stopColor:"#FFE187",stopOpacity:.23}),e("stop",{offset:.5,stopColor:"#FFE187",stopOpacity:.13}),e("stop",{offset:.6,stopColor:"#FFE187",stopOpacity:.06}),e("stop",{offset:.71,stopColor:"#FFE187",stopOpacity:.01}),e("stop",{offset:.83,stopColor:"#FFE187",stopOpacity:0})]}),v("linearGradient",{id:"paint6_linear_5774_90",x1:13.9106,y1:7.14984,x2:4.20265,y2:8.86159,gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:.11,stopColor:"#FFE187"}),e("stop",{offset:.15,stopColor:"#FFE187",stopOpacity:.8}),e("stop",{offset:.19,stopColor:"#FFE187",stopOpacity:.62}),e("stop",{offset:.23,stopColor:"#FFE187",stopOpacity:.45}),e("stop",{offset:.27,stopColor:"#FFE187",stopOpacity:.31}),e("stop",{offset:.32,stopColor:"#FFE187",stopOpacity:.2}),e("stop",{offset:.37,stopColor:"#FFE187",stopOpacity:.11}),e("stop",{offset:.42,stopColor:"#FFE187",stopOpacity:.05}),e("stop",{offset:.48,stopColor:"#FFE187",stopOpacity:.01}),e("stop",{offset:.57,stopColor:"#FFE187",stopOpacity:0})]}),v("linearGradient",{id:"paint7_linear_5774_90",x1:13.0525,y1:14.4102,x2:9.71414,y2:6.7327,gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:.41,stopColor:"#FF737D"}),e("stop",{offset:.46,stopColor:"#FF737D",stopOpacity:.95}),e("stop",{offset:.54,stopColor:"#FF737D",stopOpacity:.83}),e("stop",{offset:.65,stopColor:"#FF737D",stopOpacity:.62}),e("stop",{offset:.79,stopColor:"#FF737D",stopOpacity:.34}),e("stop",{offset:.93,stopColor:"#FF737D",stopOpacity:0})]}),v("linearGradient",{id:"paint8_linear_5774_90",x1:12.2862,y1:3.09647,x2:14.6259,y2:5.43615,gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:.11,stopColor:"#FFE187"}),e("stop",{offset:.35,stopColor:"#FFC084"}),e("stop",{offset:.84,stopColor:"#FF737D"})]})]})]});import{jsx as F,jsxs as _4}from"react/jsx-runtime";var h0=C=>_4("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[F("title",{children:"RS"}),_4("g",{clipPath:"url(#clip0_5774_84)",children:[F("path",{d:"M13.93 7.03243C13.9144 6.92355 13.8833 6.84578 13.8211 6.76801C13.7744 6.70579 13.7122 6.64357 13.6345 6.61246C13.4945 6.53469 13.3234 6.50358 13.1212 6.50358C12.9034 6.50358 12.7323 6.53469 12.639 6.59691C12.5456 6.65912 12.4834 6.7369 12.4834 6.86133C12.4834 6.97022 12.5301 7.06354 12.639 7.14132C12.7478 7.21909 12.8723 7.28131 13.0434 7.34353C13.2145 7.40574 13.4011 7.45241 13.6033 7.49907C13.8056 7.54574 14.0233 7.60795 14.2411 7.67017C14.4589 7.73239 14.6766 7.81016 14.8788 7.88794C15.081 7.98126 15.2677 8.09015 15.4388 8.23014C15.6099 8.37013 15.7343 8.54123 15.8432 8.72788C15.9521 8.93009 15.9988 9.16341 15.9988 9.44339C15.9988 9.80115 15.921 10.1122 15.781 10.3767C15.641 10.6411 15.4388 10.8589 15.1899 11.03C14.941 11.2011 14.63 11.3255 14.2878 11.4188C13.93 11.5122 13.5567 11.5433 13.1367 11.5433C12.7167 11.5433 12.3745 11.481 12.0479 11.3722C11.7212 11.2633 11.4413 11.1077 11.2079 10.9211C10.9746 10.7344 10.788 10.5167 10.6635 10.2678C10.5235 10.0189 10.4613 9.75449 10.4458 9.49006H12.3583C12.4049 9.70782 12.5138 9.86337 12.6849 9.97225C12.7627 10.0189 12.856 10.0656 12.9493 10.0811C13.0582 10.1122 13.1516 10.1122 13.2449 10.1122C13.4938 10.1122 13.696 10.0811 13.8515 10.0034C14.0071 9.92559 14.0693 9.8167 14.0693 9.66116C14.0693 9.50561 13.976 9.39673 13.8049 9.3034C13.6338 9.22563 13.416 9.14786 13.1516 9.08564C12.8871 9.02342 12.6072 8.94565 12.2961 8.86787C11.985 8.7901 11.705 8.68122 11.4406 8.54123C11.1761 8.40124 10.9584 8.21458 10.7873 7.96571C10.6162 7.73239 10.5228 7.4213 10.5228 7.01688C10.5228 6.69023 10.5851 6.41025 10.725 6.16138C10.865 5.91251 11.0361 5.7103 11.2695 5.55475C11.5028 5.3992 11.7828 5.27477 12.1094 5.197C12.436 5.11922 12.7782 5.07256 13.1671 5.07256C13.5871 5.07256 13.9604 5.11922 14.2715 5.2281C14.5826 5.33699 14.847 5.46142 15.0492 5.64808C15.267 5.81918 15.4225 6.02139 15.547 6.27026C15.6714 6.50358 15.7492 6.75245 15.7803 7.01688H13.93V7.03243Z",fill:"#B1B235"}),F("path",{d:"M6.85125 7.21909V7.98056H7.97118L6.85125 8.88272V9.69156H9.30817V8.88272H8.20379L9.30817 7.99611V7.21909H6.85125Z",fill:"#B1B235"}),F("path",{d:"M6.85125 10.0804V11.3707C6.85125 11.3707 6.91347 12.4751 8.08006 12.4751C9.24665 12.4751 9.30887 11.3707 9.30887 11.3707V10.0804H6.85125ZM8.60821 11.2159C8.60821 11.2159 8.56155 11.6981 8.07936 11.6981C7.59716 11.6981 7.5505 11.2159 7.5505 11.2159V10.8893H8.60821V11.2159Z",fill:"#B1B235"}),F("path",{d:"M6.85125 4V4.93327L7.13123 5.05771V5.99099L6.85125 6.13098V7.00203L9.30817 5.97543V5.10437L6.85125 4ZM7.75342 5.72585V5.25921L8.45337 5.49253L7.75342 5.72585Z",fill:"#B1B235"}),F("path",{d:"M5.87626 7.17243C5.90737 5.85099 4.53928 5.46213 3.91709 5.46213H0.96243L-0.00195312 11.5107H1.66168L2.03499 9.3027H2.56384L3.49712 11.5107H5.34741L4.24303 9.19381C4.24303 9.19381 5.84515 8.60274 5.87626 7.17243ZM3.87043 7.90349C3.71488 8.04348 3.59045 8.1057 3.38824 8.1057H2.22164L2.43941 6.76871H3.24825C3.45046 6.76871 3.68377 6.72205 3.87043 6.84649C4.04153 6.95537 4.1193 7.17313 4.1193 7.35979C4.1193 7.59311 4.02597 7.77905 3.87043 7.90349Z",fill:"#004693"})]}),F("defs",{children:F("clipPath",{id:"clip0_5774_84",children:F("rect",{width:16,height:16,fill:"#fff",transform:"translate(-0.00195312)"})})})]});import{jsx as x2,jsxs as L0}from"react/jsx-runtime";var a0=C=>L0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[x2("title",{children:"FacebookColor"}),x2("path",{d:"M16 8C16 3.58175 12.4183 0 8 0C3.58175 0 0 3.58175 0 8C0 11.993 2.9255 15.3027 6.75 15.9028V10.3125H4.71875V8H6.75V6.2375C6.75 4.2325 7.94438 3.125 9.77175 3.125C10.647 3.125 11.5625 3.28125 11.5625 3.28125V5.25H10.5538C9.55994 5.25 9.25 5.86669 9.25 6.49937V8H11.4688L11.1141 10.3125H9.25V15.9028C13.0745 15.3027 16 11.9931 16 8Z",fill:"#0866FF"}),x2("path",{d:"M11.1141 10.3125L11.4688 8H9.25V6.49937C9.25 5.86669 9.55994 5.25 10.5538 5.25H11.5625V3.28125C11.5625 3.28125 10.647 3.125 9.77175 3.125C7.94438 3.125 6.75 4.2325 6.75 6.2375V8H4.71875V10.3125H6.75V15.9028C7.16351 15.9676 7.58144 16.0001 8 16C8.41856 16.0001 8.83649 15.9676 9.25 15.9028V10.3125H11.1141Z",fill:"#fff"})]});import{jsx as b2,jsxs as u0}from"react/jsx-runtime";var g0=C=>u0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[b2("title",{children:"Messenger"}),b2("path",{d:"M16 7.76012C16 12.219 12.5066 15.5201 8 15.5201C7.19072 15.5201 6.41408 15.4132 5.68416 15.2126C5.5424 15.1732 5.39168 15.1844 5.25696 15.2436L3.66912 15.9448C3.25376 16.1281 2.78496 15.8328 2.7712 15.379L2.72768 13.9556C2.72224 13.7803 2.64352 13.6164 2.51264 13.4996C0.95584 12.1076 0 10.0926 0 7.76012C0 3.30124 3.49344 0.00012207 8 0.00012207C12.5066 0.00012207 16 3.30124 16 7.76012Z",fill:"#0866FF"}),b2("path",{d:"M10.172 9.99402L12.9572 5.68938C13.2372 5.25674 12.7185 4.75306 12.2942 5.04586L9.38669 7.0513C9.28877 7.11882 9.15949 7.12074 9.05965 7.0561L6.47885 5.38634C6.26029 5.2449 5.96877 5.30762 5.82765 5.52586L3.04205 9.8305C2.76205 10.2631 3.28077 10.7668 3.70509 10.474L6.61325 8.46826C6.71117 8.40074 6.84045 8.39882 6.94029 8.46346L9.52045 10.1329C9.73901 10.2743 10.0305 10.2123 10.172 9.99402Z",fill:"#fff"})]});import{jsx as y2,jsxs as v0}from"react/jsx-runtime";var V0=C=>v0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[y2("title",{children:"YouTubeColor"}),y2("path",{d:"M15.6654 4.14888C15.4811 3.46004 14.9397 2.91871 14.2509 2.73432C13.0036 2.39978 7.99997 2.39978 7.99997 2.39978C7.99997 2.39978 2.99637 2.39978 1.74909 2.73432C1.06026 2.91871 0.518933 3.46004 0.334541 4.14888C1.19209e-07 5.39615 0 8.00004 0 8.00004C0 8.00004 1.19209e-07 10.6039 0.334541 11.8512C0.518933 12.5401 1.06026 13.0814 1.74909 13.2657C2.99637 13.6003 7.99997 13.6003 7.99997 13.6003C7.99997 13.6003 13.0036 13.6003 14.2509 13.2657C14.9397 13.0814 15.4811 12.5401 15.6654 11.8512C16 10.6039 16 8.00004 16 8.00004C16 8.00004 15.9987 5.39615 15.6654 4.14888Z",fill:"red"}),y2("path",{d:"M6.39848 10.3998L10.5552 8.00011L6.39848 5.60036V10.3998Z",fill:"#fff"})]});import{jsx as o,jsxs as w0}from"react/jsx-runtime";var m0=C=>w0("svg",{width:32,height:31,viewBox:"0 0 32 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[o("title",{children:"BonusFunds"}),o("path",{d:"M13.8239 2.2831V2.44281L13.9165 2.57294L16.9553 6.84451C15.2093 8.99495 12.4224 12.7421 10.4927 16.4012C9.48402 18.314 8.69009 20.2386 8.41852 21.9172C8.14798 23.5893 8.38057 25.1503 9.61239 26.1359C13.4151 29.1783 17.963 29.1783 20.1671 29.1782H20.1899C21.5617 29.1782 23.7247 29.0293 25.777 28.5801C26.8036 28.3554 27.817 28.0526 28.6953 27.6476C29.5684 27.245 30.3446 26.7247 30.854 26.0454C31.2046 25.578 31.3869 24.953 31.4594 24.2648C31.5326 23.5701 31.4985 22.7669 31.3785 21.9019C31.1385 20.1713 30.5465 18.1359 29.7046 16.1134C28.8621 14.0895 27.7615 12.0594 26.4926 10.3431C25.3679 8.82209 24.0914 7.5209 22.7215 6.70113L25.2221 3.26874C25.4385 2.97168 25.5406 2.58768 25.4607 2.23115C25.3729 1.83915 25.0656 1.51811 24.5922 1.47101C24.119 1.42394 23.5456 1.5123 22.8985 1.83589C22.2126 2.17881 22.0664 2.07887 22.0275 2.05231C22.0265 2.05161 22.0256 2.05096 22.0247 2.05038C21.9627 2.00908 21.8929 1.93408 21.7624 1.76798C21.7481 1.7497 21.7331 1.73051 21.7175 1.71053C21.6049 1.56617 21.4601 1.38037 21.276 1.19635C20.7944 0.714759 20.1052 0.5 19.4561 0.5C18.8069 0.5 18.1177 0.714759 17.6361 1.19635C17.4601 1.37233 17.1464 1.42181 16.6055 1.33165C16.4057 1.29836 16.2089 1.25265 16.0055 1.2054C15.9483 1.19212 15.8906 1.17872 15.8322 1.16544C15.587 1.10972 15.3048 1.0499 15.0569 1.0499C14.6006 1.0499 14.2672 1.25123 14.0646 1.53281C13.8804 1.78887 13.8239 2.08105 13.8239 2.2831Z",fill:"#3E8ED6",stroke:"#3279A5"}),o("path",{d:"M9.92502 25.7454C5.82848 22.4679 13.8354 11.5703 17.257 7.41549L14.3242 2.2831C14.3242 2.0387 14.4706 1.5499 15.0572 1.5499C15.7904 1.5499 17.2567 2.2831 17.9899 1.5499C18.7231 0.8167 20.1895 0.8167 20.9227 1.5499C21.6559 2.2831 21.6559 3.0163 23.1223 2.2831C23.7426 1.97297 24.2535 1.92247 24.6334 1.97987C25.0793 2.04723 25.1666 2.55472 24.9429 2.94625L22.3891 7.41549C28.2547 10.3483 32.6539 22.8127 30.4543 25.7454C28.6946 28.0917 22.8783 28.6782 20.1901 28.6782C17.9899 28.6782 13.5906 28.6782 9.92502 25.7454Z",fill:"#3E8ED6"}),o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.5701 14.1976V15.3121H20.6587C21.567 15.3121 22.1001 15.783 22.1716 16.6485L22.1799 16.8553V17.5792H20.5717V16.9172C20.5717 16.7749 20.517 16.6926 20.4027 16.6654L20.3058 16.6552H19.7144V16.652H19.2245C19.0801 16.652 18.9966 16.7059 18.969 16.8185L18.9586 16.914V17.8047C18.9586 17.9431 18.9927 18.0186 19.0995 18.0708L19.1939 18.1063L20.4718 18.4556L21.2227 18.654C21.7985 18.8022 22.1158 19.1172 22.1781 19.5913L22.1895 19.7765V21.2244C22.1895 22.1473 21.7116 22.6841 20.8343 22.7561L20.5684 22.7644V23.8758H18.957V22.7644H18.8732C17.965 22.7644 17.4305 22.2935 17.3587 21.4305L17.3504 21.2244V20.5624H18.9586V21.1609C18.9586 21.3032 19.0133 21.3855 19.1276 21.4127L19.2245 21.4229H20.3074C20.4518 21.4229 20.5353 21.369 20.563 21.2564L20.5733 21.1609V20.175C20.5733 20.0569 20.5248 19.9936 20.413 19.9462L20.3171 19.913L18.7379 19.4939L18.1706 19.3383C17.8255 19.2426 17.4372 18.9437 17.363 18.3559L17.3504 18.1492V16.8521C17.3504 15.9263 17.8284 15.3879 18.7069 15.3157L18.9586 15.3073V14.1976H20.5701Z",fill:"#CFE9F9"}),o("path",{d:"M22.7162 6.86559C28.5818 9.79838 32.6532 22.8127 30.4536 25.7454C28.6939 28.0917 22.8776 28.6782 20.1894 28.6782C22.6334 28.4338 27.0815 26.4786 25.3218 20.6131C23.5621 14.7475 21.167 9.37068 20.1894 7.41549L20.922 1.5499C21.6549 2.28301 21.6554 3.01621 23.1216 2.28311C23.7428 1.97251 24.2543 1.92232 24.6344 1.98013C25.0794 2.04782 25.167 2.55425 24.9445 2.94557L22.7162 6.86559Z",fill:"#3279A5"}),o("path",{d:"M19.0503 6.86559L17.2566 2.2831C17.2566 2.5275 17.2566 1.5499 16.5234 1.5499H15.0571C14.4705 1.5499 14.3239 2.0387 14.3239 2.2831L16.8507 6.86559L16.5234 11.8147L19.0503 6.86559Z",fill:"#3279A5"}),o("rect",{x:14.6511,y:5.39919,width:10.2648,height:1.4664,rx:.733198,fill:"#FFCB4D"}),o("path",{d:"M19.7734 10.8041C19.6202 11.0339 19.6823 11.3443 19.9121 11.4975C20.1418 11.6507 20.4523 11.5886 20.6054 11.3588L19.7734 10.8041ZM20.0423 6.29051C20.1537 6.62473 20.3528 7.37411 20.3849 8.24051C20.4172 9.11087 20.2791 10.0455 19.7734 10.8041L20.6054 11.3588C21.2728 10.3578 21.4206 9.18447 21.3842 8.2035C21.3478 7.21858 21.124 6.37326 20.991 5.97428L20.0423 6.29051Z",fill:"#FFCB4D"}),o("path",{d:"M23.3623 12.6301C23.4077 12.9025 23.6653 13.0865 23.9377 13.0411C24.21 12.9957 24.3941 12.7381 24.3487 12.4657L23.3623 12.6301ZM20.6453 7.09831C21.2394 7.49435 22.7932 9.21551 23.3623 12.6301L24.3487 12.4657C23.7446 8.84152 22.0723 6.84781 21.2 6.26626L20.6453 7.09831Z",fill:"#FFCB4D"}),o("path",{d:"M12.1243 22.0794C12.1243 22.8126 12.5642 24.1324 14.3239 23.5458",stroke:"#3279A5",strokeLinecap:"round"}),o("rect",{y:19.2142,width:13.5835,height:3.70458,rx:1,fill:"#E8B436"}),o("path",{d:"M1.85217 20.4491V21.6839",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M4.32143 20.4491V21.6839",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M6.79092 20.4491V21.6839",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M9.26115 20.4491V21.6839",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M11.7307 20.4491V21.6839",stroke:"#FFCB4D",strokeLinecap:"round"}),o("rect",{x:1.23511,y:22.9188,width:13.5835,height:3.70458,rx:1,fill:"#E8B436"}),o("path",{d:"M3.08765 24.1537V25.3885",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M5.55791 24.1537V25.3885",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M8.02745 24.1537V25.3885",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M10.4969 24.1537V25.3885",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M12.9665 24.1537V25.3885",stroke:"#FFCB4D",strokeLinecap:"round"}),o("rect",{x:3.70465,y:26.6234,width:13.5835,height:3.70458,rx:1,fill:"#E8B436"}),o("path",{d:"M5.55716 27.8582V29.0931",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M8.02663 27.8582V29.093",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M10.4961 27.8582V29.093",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M12.9657 27.8582V29.093",stroke:"#FFCB4D",strokeLinecap:"round"}),o("path",{d:"M15.4359 27.8582V29.093",stroke:"#FFCB4D",strokeLinecap:"round"}),o("circle",{cx:9.02977,cy:13.0399,r:6.1743,fill:"#E8B436"}),o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.64259 9.33531V10.1885H9.71044C10.4058 10.1885 10.8139 10.549 10.8687 11.2117L10.875 11.3699V11.9241H9.64383V11.4173C9.64383 11.3084 9.60198 11.2454 9.5145 11.2246L9.44028 11.2168H8.98754V11.2143H8.61252C8.50198 11.2143 8.43803 11.2556 8.41687 11.3418L8.40897 11.4149V12.0967C8.40897 12.2027 8.43502 12.2605 8.51682 12.3005L8.58908 12.3277L9.56734 12.595L10.1422 12.747C10.583 12.8604 10.826 13.1016 10.8737 13.4645L10.8824 13.6063V14.7147C10.8824 15.4212 10.5165 15.8322 9.84491 15.8873L9.64136 15.8937V16.7445H8.40773V15.8937H8.34359C7.64826 15.8937 7.23907 15.5332 7.18416 14.8725L7.17781 14.7147V14.2079H8.40897V14.6661C8.40897 14.775 8.45081 14.838 8.53829 14.8589L8.61252 14.8667H9.44151C9.55204 14.8667 9.616 14.8254 9.63715 14.7392L9.64506 14.6661V13.9113C9.64506 13.8209 9.60795 13.7725 9.52237 13.7362L9.44891 13.7108L8.23996 13.3899L7.80573 13.2708C7.54148 13.1975 7.24427 12.9687 7.18747 12.5187L7.17781 12.3605V11.3675C7.17781 10.6587 7.54372 10.2465 8.21627 10.1913L8.40897 10.1849V9.33531H9.64259Z",fill:"#FFCB4D"}),o("circle",{cx:9.02977,cy:13.0399,r:5.6743,stroke:"#FFCB4D"})]});import{jsx as L,jsxs as M0}from"react/jsx-runtime";var H0=C=>M0("svg",{width:30,height:23,viewBox:"0 0 30 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[L("title",{children:"FreeBets"}),L("path",{d:"M28.3758 22.2143V20.7432C27.5451 20.6177 26.9047 19.8951 26.9047 19.0297C26.9047 18.1643 27.5451 17.4461 28.3758 17.3206V15.7023C27.5451 15.5768 26.9047 14.8542 26.9047 13.9889C26.9047 13.1235 27.5451 12.4009 28.3758 12.2754V10.6571C27.5451 10.5317 26.9047 9.80905 26.9047 8.94367C26.9047 8.07829 27.5451 7.3557 28.3758 7.23022V5.61195C27.5451 5.48647 26.9047 4.76388 26.9047 3.89849C26.9047 3.03311 27.5451 2.31051 28.3758 2.18503V0.713882H4.65136C4.59078 2.60042 3.10233 4.13214 1.2331 4.26628V18.6706C3.10233 18.8047 4.59078 20.3321 4.65136 22.2186H28.3758V22.2143Z",fill:"#3E8ED6"}),L("path",{d:"M5.28729 1.41922C4.95845 3.12835 3.63441 4.48701 1.94259 4.8721V18.0562C3.63441 18.437 4.95412 19.8 5.28729 21.5048H27.6661V21.2711C26.8007 20.8947 26.1949 20.0336 26.1949 19.0298C26.1949 18.0303 26.8007 17.1692 27.6661 16.7927V16.2303C26.8007 15.8538 26.1949 14.9928 26.1949 13.9889C26.1949 12.9851 26.8007 12.124 27.6661 11.7476V11.1851C26.8007 10.8086 26.1949 9.94757 26.1949 8.94372C26.1949 7.93988 26.8007 7.07883 27.6661 6.70239V6.13989C26.8007 5.76344 26.1949 4.90239 26.1949 3.89855C26.1949 2.8947 26.8007 2.03364 27.6661 1.6572V1.42355H5.28729V1.41922ZM4.38729 -7.62939e-06H28.6397C28.8863 -7.62939e-06 29.0853 0.19903 29.0853 0.445664V2.42307C29.0853 2.6697 28.8863 2.86874 28.6397 2.86874C28.0728 2.86874 27.6142 3.33172 27.6142 3.89422C27.6142 4.46104 28.0728 4.9197 28.6397 4.9197C28.8863 4.9197 29.0853 5.11874 29.0853 5.36537V7.46825C29.0853 7.71489 28.8863 7.91392 28.6397 7.91392C28.0728 7.91392 27.6142 8.3769 27.6142 8.9394C27.6142 9.50623 28.0728 9.96488 28.6397 9.96488C28.8863 9.96488 29.0853 10.1639 29.0853 10.4105V12.5134C29.0853 12.7644 28.8863 12.9591 28.6397 12.9591C28.0728 12.9591 27.6142 13.4221 27.6142 13.9846C27.6142 14.5514 28.0728 15.0101 28.6397 15.0101C28.8863 15.0101 29.0853 15.2091 29.0853 15.4557V17.5586C29.0853 17.8052 28.8863 18.0043 28.6397 18.0043C28.0728 18.0043 27.6142 18.4629 27.6142 19.0254C27.6142 19.5923 28.0728 20.0509 28.6397 20.0509C28.8863 20.0509 29.0853 20.25 29.0853 20.4966V22.474C29.0853 22.725 28.8863 22.9197 28.6397 22.9197C28.6397 22.9197 4.47816 22.9197 4.39163 22.9197C4.24884 22.9197 4.14499 22.8591 4.07143 22.7682C3.98057 22.6514 3.94595 22.487 3.94595 22.3312C3.94595 20.6956 2.60893 19.3586 0.97336 19.3586C0.726725 19.3586 0.527687 19.1596 0.527687 18.9129V4.00239C0.527687 3.75575 0.726725 3.55672 0.97336 3.55672C2.61326 3.55672 3.94595 2.22403 3.94595 0.584128C3.94595 0.302879 4.0498 -7.62939e-06 4.38729 -7.62939e-06Z",fill:"#3279A5"}),L("path",{d:"M15.9401 17.3508C16.0612 17.3508 16.1867 17.3119 16.2862 17.2384C16.468 17.1042 16.5588 16.8835 16.5199 16.6585L15.9617 13.396L18.3329 11.0855C18.493 10.9297 18.5535 10.6917 18.4843 10.4797C18.4151 10.2677 18.229 10.1119 18.0083 10.0773L14.7329 9.60134L13.266 6.63308C13.1665 6.42972 12.9588 6.30424 12.7338 6.30424C12.5088 6.30424 12.3011 6.43404 12.2016 6.63308L10.7348 9.60134L7.45932 10.0773C7.23432 10.1119 7.05259 10.2677 6.98336 10.4797C6.91413 10.6917 6.97038 10.9297 7.1348 11.0855L9.50595 13.396L8.94778 16.6585C8.90884 16.8792 8.9997 17.1042 9.18143 17.2384C9.28528 17.3119 9.40643 17.3508 9.52759 17.3508C9.62278 17.3508 9.71797 17.3292 9.80451 17.2816L12.7338 15.7412L15.6632 17.2816C15.7497 17.3292 15.8449 17.3508 15.9401 17.3508Z",fill:"#CFE9F9"}),L("path",{d:"M24.1351 20.7908V19.073C24.1351 18.8437 23.9491 18.6533 23.7154 18.6533C23.4861 18.6533 23.2957 18.8394 23.2957 19.073V20.7908C23.2957 21.0201 23.4818 21.2105 23.7154 21.2105C23.9491 21.2105 24.1351 21.0244 24.1351 20.7908ZM24.1351 17.3552V15.6374C24.1351 15.4081 23.9491 15.2177 23.7154 15.2177C23.4861 15.2177 23.2957 15.4038 23.2957 15.6374V17.3552C23.2957 17.5845 23.4818 17.7749 23.7154 17.7749C23.9491 17.7706 24.1351 17.5845 24.1351 17.3552ZM24.1351 13.9153V12.1975C24.1351 11.9682 23.9491 11.7778 23.7154 11.7778C23.4861 11.7778 23.2957 11.9639 23.2957 12.1975V13.9153C23.2957 14.1447 23.4818 14.335 23.7154 14.335C23.9491 14.335 24.1351 14.149 24.1351 13.9153ZM24.1351 10.4798V8.76197C24.1351 8.53264 23.9491 8.34226 23.7154 8.34226C23.4861 8.34226 23.2957 8.52831 23.2957 8.76197V10.4798C23.2957 10.7091 23.4818 10.8995 23.7154 10.8995C23.9491 10.8951 24.1351 10.7091 24.1351 10.4798ZM24.1351 7.03986V5.32207C24.1351 5.09275 23.9491 4.90236 23.7154 4.90236C23.4861 4.90236 23.2957 5.08842 23.2957 5.32207V7.03986C23.2957 7.26918 23.4818 7.45957 23.7154 7.45957C23.9491 7.45957 24.1351 7.26918 24.1351 7.03986ZM24.1351 3.82063V2.10285C24.1351 1.87352 23.9491 1.68314 23.7154 1.68314C23.4861 1.68314 23.2957 1.86919 23.2957 2.10285V3.82063C23.2957 4.04996 23.4818 4.24034 23.7154 4.24034C23.9491 4.23602 24.1351 4.04996 24.1351 3.82063Z",fill:"#3279A5"}),L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.21769 5.9531C7.06833 6.10106 7.06719 6.3421 7.21515 6.49146L8.58246 7.87175C8.73042 8.02112 8.97145 8.02225 9.12082 7.87429C9.27018 7.72633 9.27132 7.4853 9.12336 7.33593L7.75605 5.95565C7.60809 5.80628 7.36706 5.80514 7.21769 5.9531Z",fill:"#3279A5"}),L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.1209 15.3733C18.0075 15.5503 18.0592 15.7858 18.2363 15.8991L19.4262 16.6606C19.6033 16.774 19.8387 16.7223 19.9521 16.5452C20.0654 16.3681 20.0137 16.1327 19.8366 16.0194L18.6467 15.2578C18.4696 15.1445 18.2342 15.1962 18.1209 15.3733Z",fill:"#3279A5"}),L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.6404 6.13536C18.4912 5.98716 18.2502 5.98792 18.102 6.13705L16.7304 7.51734C16.5822 7.66647 16.5829 7.9075 16.7321 8.0557C16.8812 8.2039 17.1222 8.20314 17.2704 8.05401L18.642 6.67372C18.7902 6.52459 18.7895 6.28356 18.6404 6.13536Z",fill:"#3279A5"}),L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.20358 14.9387C7.08209 14.7671 6.8445 14.7265 6.67292 14.848L5.48734 15.6874C5.31575 15.8089 5.27514 16.0465 5.39663 16.2181C5.51812 16.3897 5.75571 16.4303 5.92729 16.3088L7.11287 15.4694C7.28446 15.3479 7.32507 15.1103 7.20358 14.9387Z",fill:"#3279A5"}),L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.7556 2.58035C12.5453 2.58035 12.3749 2.75079 12.3749 2.96103V4.36728C12.3749 4.57753 12.5453 4.74796 12.7556 4.74796C12.9658 4.74796 13.1363 4.57753 13.1363 4.36728V2.96103C13.1363 2.75079 12.9658 2.58035 12.7556 2.58035Z",fill:"#3279A5"}),L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.7556 17.8675C12.5453 17.8675 12.3749 18.0379 12.3749 18.2481V19.6587C12.3749 19.869 12.5453 20.0394 12.7556 20.0394C12.9658 20.0394 13.1363 19.869 13.1363 19.6587V18.2481C13.1363 18.0379 12.9658 17.8675 12.7556 17.8675Z",fill:"#3279A5"}),L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.55258 11.0513C3.54483 11.2614 3.70886 11.4381 3.91896 11.4458L5.32521 11.4977C5.53531 11.5055 5.71192 11.3415 5.71968 11.1314C5.72743 10.9213 5.5634 10.7446 5.3533 10.7369L3.94705 10.685C3.73695 10.6772 3.56034 10.8412 3.55258 11.0513Z",fill:"#3279A5"}),L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.9546 10.9573C21.9546 10.7471 21.7841 10.5766 21.5739 10.5766H20.1633C19.9531 10.5766 19.7826 10.7471 19.7826 10.9573C19.7826 11.1676 19.9531 11.338 20.1633 11.338H21.5739C21.7841 11.338 21.9546 11.1676 21.9546 10.9573Z",fill:"#3279A5"})]});import{jsx as O,jsxs as Z0}from"react/jsx-runtime";var R0=C=>Z0("svg",{width:17,height:17,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[O("title",{children:"Rewards"}),O("path",{d:"M3.00001 12C3.00001 11.4477 3.44772 11 4.00001 11H13C13.5523 11 14 11.4477 14 12V16C14 16.5523 13.5523 17 13 17H4.00001C3.44772 17 3.00001 16.5523 3.00001 16V12Z",fill:"#0070EB"}),O("path",{d:"M3.00001 11H8.00001V17H4.00001C3.44772 17 3.00001 16.5523 3.00001 16V11Z",fill:"#FFDC2E"}),O("path",{d:"M9.00001 11H14V16C14 16.5523 13.5523 17 13 17H9.00001V11Z",fill:"#FFDC2E"}),O("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.60523 1.44171C5.53615 1.52813 5.49414 1.6419 5.50967 1.80132C5.51441 1.84993 5.54356 1.93297 5.63278 2.0492C5.71957 2.16227 5.83999 2.27643 5.97337 2.38251C6.10484 2.48707 6.23665 2.57415 6.33659 2.63543C6.38611 2.66579 6.4267 2.68914 6.45407 2.70446C6.45841 2.70689 6.46241 2.70912 6.46606 2.71113L8.94301 3.61267C8.91005 3.52129 8.87368 3.42607 8.83372 3.32852C8.55904 2.6579 8.14653 1.95542 7.57733 1.5709C6.98433 1.17031 6.39302 1.10286 6.00244 1.20777C5.80848 1.25986 5.67943 1.34889 5.60523 1.44171ZM10.7891 4.28457L13.2661 5.18605C13.2702 5.18685 13.2747 5.18772 13.2796 5.18865C13.3104 5.19451 13.3565 5.20271 13.4139 5.21128C13.5299 5.22859 13.6868 5.24661 13.8547 5.25103C14.0251 5.25551 14.1907 5.24547 14.3299 5.21465C14.4729 5.18296 14.5486 5.1381 14.5835 5.10391C14.6979 4.99178 14.7388 4.87764 14.7414 4.76705C14.7443 4.64827 14.7026 4.49713 14.5875 4.33256C14.3558 4.00115 13.8594 3.67273 13.1476 3.59842C12.4644 3.52709 11.6969 3.80004 11.0554 4.13719C10.9621 4.18622 10.8731 4.23576 10.7891 4.28457ZM13.1294 5.6684L13.0207 6.15645L12.989 6.14938L6.05909 3.62718L6.03021 3.61219L6.26067 3.16846C6.03021 3.61219 6.03032 3.61224 6.03021 3.61219L6.02922 3.61167L6.02779 3.61092L6.02364 3.60874L6.01042 3.60168C5.99948 3.59579 5.98435 3.58754 5.96561 3.57705C5.92819 3.5561 5.87606 3.52606 5.81389 3.48794C5.69046 3.41226 5.523 3.30203 5.35091 3.16516C5.18073 3.02981 4.99329 2.85842 4.83951 2.65807C4.68815 2.46088 4.54404 2.20262 4.51438 1.8983C4.47446 1.48861 4.58694 1.11401 4.82414 0.817291C5.05623 0.52697 5.38526 0.338093 5.74304 0.241998C6.45592 0.0505277 7.34266 0.205581 8.13711 0.742262C8.95535 1.29502 9.46174 2.22348 9.7591 2.94949C9.85499 3.18358 9.93242 3.40486 9.99355 3.59828C10.1647 3.48942 10.3663 3.36969 10.5902 3.252C11.2846 2.88701 12.2693 2.50129 13.2515 2.60382C14.205 2.70338 14.984 3.15457 15.407 3.75945C15.6193 4.06303 15.75 4.41921 15.7412 4.79079C15.7321 5.17056 15.5775 5.52982 15.2836 5.81799C15.0652 6.03204 14.7888 6.13723 14.5461 6.19098C14.2996 6.2456 14.0458 6.2564 13.8284 6.25068C13.6086 6.2449 13.4095 6.2217 13.2663 6.20033C13.1942 6.18957 13.1349 6.17907 13.0928 6.17106C13.0717 6.16705 13.0548 6.16364 13.0427 6.16112L13.028 6.15803L13.0234 6.15704L13.0218 6.15669C13.0217 6.15666 13.0207 6.15645 13.1294 5.6684Z",fill:"#0070EB"}),O("path",{d:"M2.40535 3.93505C2.59424 3.41607 3.16808 3.14849 3.68706 3.33738L9.04204 5.28643L8.01598 8.10551L2.661 6.15646C2.14202 5.96756 1.87443 5.39372 2.06333 4.87474L2.40535 3.93505Z",fill:"#FFDC2E"}),O("path",{d:"M9.04204 5.28643L10.0105 5.63892L8.98439 8.45799L8.01598 8.10551L9.04204 5.28643Z",fill:"#0070EB"}),O("path",{d:"M10.0105 5.63892L15.3654 7.58796C15.8844 7.77685 16.152 8.35069 15.9631 8.86967L15.6211 9.80937C15.4322 10.3283 14.8584 10.5959 14.3394 10.407L8.98439 8.45799L10.0105 5.63892Z",fill:"#FFDC2E"})]});import{jsx as s,jsxs as G0}from"react/jsx-runtime";var S0=C=>G0("svg",{width:25,height:25,viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[s("title",{children:"RewardsAvailable"}),s("path",{d:"M18.7441 24.5385V23.5756C18.185 23.4935 17.7539 23.0206 17.7539 22.4543C17.7539 21.8879 18.185 21.4178 18.7441 21.3357V20.2766C18.185 20.1945 17.7539 19.7216 17.7539 19.1552C17.7539 18.5889 18.185 18.116 18.7441 18.0338V16.9747C18.185 16.8926 17.7539 16.4197 17.7539 15.8533C17.7539 15.287 18.185 14.8141 18.7441 14.732V13.6729C18.185 13.5907 17.7539 13.1178 17.7539 12.5515C17.7539 11.9851 18.185 11.5122 18.7441 11.4301V10.4673H2.77574C2.73497 11.7019 1.73312 12.7044 0.474991 12.7922V22.2192C1.73312 22.307 2.73497 23.3066 2.77574 24.5413H18.7441V24.5385Z",fill:"#3E8ED6"}),s("path",{d:"M3.20377 10.9288C2.98243 12.0474 2.09126 12.9366 0.95253 13.1886V21.8171C2.09126 22.0663 2.97952 22.9583 3.20377 24.074H18.2664V23.9211C17.684 23.6747 17.2762 23.1112 17.2762 22.4542C17.2762 21.8001 17.684 21.2365 18.2664 20.9902V20.6221C17.684 20.3757 17.2762 19.8122 17.2762 19.1552C17.2762 18.4982 17.684 17.9347 18.2664 17.6883V17.3202C17.684 17.0738 17.2762 16.5103 17.2762 15.8533C17.2762 15.1963 17.684 14.6328 18.2664 14.3864V14.0183C17.684 13.7719 17.2762 13.2084 17.2762 12.5514C17.2762 11.8945 17.684 11.3309 18.2664 11.0846V10.9317H3.20377V10.9288ZM2.598 10H18.9217C19.0877 10 19.2217 10.1303 19.2217 10.2917V11.5858C19.2217 11.7472 19.0877 11.8775 18.9217 11.8775C18.5402 11.8775 18.2315 12.1805 18.2315 12.5486C18.2315 12.9196 18.5402 13.2198 18.9217 13.2198C19.0877 13.2198 19.2217 13.35 19.2217 13.5114V14.8877C19.2217 15.0491 19.0877 15.1793 18.9217 15.1793C18.5402 15.1793 18.2315 15.4823 18.2315 15.8505C18.2315 16.2214 18.5402 16.5216 18.9217 16.5216C19.0877 16.5216 19.2217 16.6519 19.2217 16.8133V18.1895C19.2217 18.3538 19.0877 18.4812 18.9217 18.4812C18.5402 18.4812 18.2315 18.7842 18.2315 19.1524C18.2315 19.5233 18.5402 19.8235 18.9217 19.8235C19.0877 19.8235 19.2217 19.9537 19.2217 20.1152V21.4914C19.2217 21.6528 19.0877 21.7831 18.9217 21.7831C18.5402 21.7831 18.2315 22.0833 18.2315 22.4514C18.2315 22.8224 18.5402 23.1225 18.9217 23.1225C19.0877 23.1225 19.2217 23.2528 19.2217 23.4142V24.7083C19.2217 24.8726 19.0877 25 18.9217 25C18.9217 25 2.65917 25 2.60092 25C2.50481 25 2.43491 24.9604 2.3854 24.9009C2.32424 24.8244 2.30095 24.7168 2.30095 24.6149C2.30095 23.5445 1.40103 22.6694 0.300162 22.6694C0.134159 22.6694 0.000191076 22.5392 0.000191076 22.3778V12.6194C0.000191076 12.458 0.134159 12.3277 0.300162 12.3277C1.40394 12.3277 2.30095 11.4555 2.30095 10.3823C2.30095 10.1982 2.37084 10 2.598 10Z",fill:"#3279A5"}),s("path",{d:"M10.374 21.3553C10.4555 21.3553 10.54 21.3298 10.607 21.2817C10.7293 21.1939 10.7904 21.0495 10.7642 20.9022L10.3885 18.767L11.9845 17.2549C12.0922 17.1529 12.133 16.9972 12.0864 16.8584C12.0398 16.7197 11.9146 16.6177 11.7661 16.5951L9.56142 16.2836L8.57413 14.3409C8.50715 14.2079 8.36736 14.1257 8.21591 14.1257C8.06447 14.1257 7.92468 14.2107 7.8577 14.3409L6.87041 16.2836L4.66576 16.5951C4.51432 16.6177 4.392 16.7197 4.3454 16.8584C4.29881 16.9972 4.33667 17.1529 4.44734 17.2549L6.0433 18.767L5.66761 20.9022C5.6414 21.0466 5.70256 21.1939 5.82488 21.2817C5.89477 21.3298 5.97632 21.3553 6.05786 21.3553C6.12194 21.3553 6.18601 21.3411 6.24425 21.31L8.21591 20.3019L10.1876 21.31C10.2458 21.3411 10.3099 21.3553 10.374 21.3553Z",fill:"#CFE9F9"}),s("path",{d:"M15.8896 23.6068V22.4825C15.8896 22.3324 15.7644 22.2078 15.6071 22.2078C15.4528 22.2078 15.3246 22.3296 15.3246 22.4825V23.6068C15.3246 23.7568 15.4499 23.8814 15.6071 23.8814C15.7644 23.8814 15.8896 23.7597 15.8896 23.6068ZM15.8896 21.3583V20.2341C15.8896 20.084 15.7644 19.9594 15.6071 19.9594C15.4528 19.9594 15.3246 20.0812 15.3246 20.2341V21.3583C15.3246 21.5084 15.4499 21.633 15.6071 21.633C15.7644 21.6302 15.8896 21.5084 15.8896 21.3583ZM15.8896 19.107V17.9828C15.8896 17.8327 15.7644 17.7081 15.6071 17.7081C15.4528 17.7081 15.3246 17.8299 15.3246 17.9828V19.107C15.3246 19.2571 15.4499 19.3817 15.6071 19.3817C15.7644 19.3817 15.8896 19.26 15.8896 19.107ZM15.8896 16.8586V15.7344C15.8896 15.5843 15.7644 15.4597 15.6071 15.4597C15.4528 15.4597 15.3246 15.5815 15.3246 15.7344V16.8586C15.3246 17.0087 15.4499 17.1333 15.6071 17.1333C15.7644 17.1304 15.8896 17.0087 15.8896 16.8586ZM15.8896 14.6073V13.4831C15.8896 13.333 15.7644 13.2084 15.6071 13.2084C15.4528 13.2084 15.3246 13.3302 15.3246 13.4831V14.6073C15.3246 14.7574 15.4499 14.882 15.6071 14.882C15.7644 14.882 15.8896 14.7574 15.8896 14.6073ZM15.8896 12.5005V11.3762C15.8896 11.2262 15.7644 11.1016 15.6071 11.1016C15.4528 11.1016 15.3246 11.2233 15.3246 11.3762V12.5005C15.3246 12.6506 15.4499 12.7752 15.6071 12.7752C15.7644 12.7723 15.8896 12.6506 15.8896 12.5005Z",fill:"#3279A5"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.50301 13.8959C4.40248 13.9927 4.40171 14.1505 4.5013 14.2482L5.4216 15.1515C5.52119 15.2493 5.68342 15.25 5.78396 15.1532C5.88449 15.0564 5.88526 14.8986 5.78567 14.8009L4.86537 13.8975C4.76578 13.7998 4.60355 13.799 4.50301 13.8959Z",fill:"#3279A5"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.8418 20.0609C11.7655 20.1768 11.8003 20.3309 11.9195 20.4051L12.7204 20.9035C12.8396 20.9776 12.998 20.9438 13.0743 20.8279C13.1506 20.712 13.1158 20.5579 12.9966 20.4838L12.1957 19.9854C12.0765 19.9112 11.9181 19.945 11.8418 20.0609Z",fill:"#3279A5"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.1915 14.0155C12.0911 13.9185 11.9289 13.919 11.8291 14.0166L10.9059 14.92C10.8061 15.0176 10.8067 15.1753 10.907 15.2723C11.0074 15.3693 11.1696 15.3688 11.2694 15.2712L12.1926 14.3679C12.2924 14.2703 12.2918 14.1125 12.1915 14.0155Z",fill:"#3279A5"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.49389 19.7768C4.41211 19.6645 4.2522 19.6379 4.13671 19.7175L3.33872 20.2668C3.22323 20.3463 3.19589 20.5018 3.27766 20.6141C3.35944 20.7264 3.51935 20.753 3.63485 20.6735L4.43283 20.1241C4.54832 20.0446 4.57566 19.8891 4.49389 19.7768Z",fill:"#3279A5"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.23059 11.6887C8.08908 11.6887 7.97436 11.8003 7.97436 11.9379V12.8582C7.97436 12.9958 8.08908 13.1073 8.23059 13.1073C8.3721 13.1073 8.48682 12.9958 8.48682 12.8582V11.9379C8.48682 11.8003 8.3721 11.6887 8.23059 11.6887Z",fill:"#3279A5"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.23059 21.6936C8.08908 21.6936 7.97436 21.8051 7.97436 21.9427V22.8659C7.97436 23.0035 8.08908 23.1151 8.23059 23.1151C8.3721 23.1151 8.48682 23.0035 8.48682 22.8659V21.9427C8.48682 21.8051 8.3721 21.6936 8.23059 21.6936Z",fill:"#3279A5"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.03632 17.2324C2.0311 17.3699 2.1415 17.4855 2.28292 17.4905L3.22943 17.5245C3.37085 17.5296 3.48972 17.4223 3.49494 17.2847C3.50016 17.1472 3.38975 17.0317 3.24834 17.0266L2.30183 16.9926C2.16041 16.9875 2.04154 17.0949 2.03632 17.2324Z",fill:"#3279A5"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.4219 17.1708C14.4219 17.0332 14.3072 16.9216 14.1656 16.9216H13.2162C13.0747 16.9216 12.96 17.0332 12.96 17.1708C12.96 17.3084 13.0747 17.4199 13.2162 17.4199H14.1656C14.3072 17.4199 14.4219 17.3084 14.4219 17.1708Z",fill:"#3279A5"}),s("circle",{cx:16.5,cy:8.5,r:6.5,fill:"#1F375B"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 17C21.1944 17 25 13.1944 25 8.5C25 3.80558 21.1944 0 16.5 0C11.8056 0 8 3.80558 8 8.5C8 13.1944 11.8056 17 16.5 17ZM19.6762 7.70542C19.7805 7.70542 19.8747 7.7663 19.9176 7.8616C19.9605 7.95689 19.943 8.06807 19.8742 8.14589L15.6389 12.9106C15.587 12.9688 15.5145 12.9995 15.4409 12.9995C15.3975 12.9995 15.3535 12.9884 15.3133 12.9667C15.2053 12.9074 15.1524 12.7809 15.1862 12.6618L16.1487 9.29366H13.8527C13.7484 9.29366 13.6536 9.23277 13.6112 9.13748C13.5689 9.04218 13.5858 8.93101 13.6552 8.85318L17.8905 4.08848C17.972 3.99636 18.1075 3.9736 18.2155 4.03236C18.3235 4.09166 18.3765 4.21818 18.3426 4.3373L17.3801 7.70542H19.6762Z",fill:"#FFCB4D"})]});import{jsx as o5,jsxs as x0}from"react/jsx-runtime";var P0=C=>x0("svg",{width:34,height:17,viewBox:"0 0 34 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[o5("title",{children:"SGP"}),o5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.6849 1H30.5565C31.6611 1 32.5565 1.89543 32.5565 3C32.5565 3.13274 32.5433 3.26514 32.5171 3.39526L30.2994 14.3953C30.1112 15.3287 29.2911 16 28.3389 16H3.44771C2.34314 16 1.44771 15.1046 1.44771 14C1.44771 13.8661 1.46115 13.7326 1.48783 13.6014L3.72503 2.6014C3.91455 1.66955 4.73398 1 5.6849 1Z",fill:"#05285A"}),o5("path",{d:"M30.5565 0H5.6849C4.25852 0 3.02937 1.00433 2.74509 2.4021L0.507893 13.4021C0.467871 13.5989 0.447708 13.7992 0.447708 14C0.447708 15.6569 1.79085 17 3.44771 17H28.3389C29.7672 17 30.9974 15.993 31.2797 14.5929L33.4974 3.59289C33.5367 3.39772 33.5565 3.19911 33.5565 3C33.5565 1.34315 32.2134 0 30.5565 0ZM5.6849 2H30.5565C31.1088 2 31.5565 2.44772 31.5565 3C31.5565 3.06637 31.5499 3.13257 31.5368 3.19763L29.3191 14.1976C29.225 14.6643 28.815 15 28.3389 15H3.44771C2.89542 15 2.44771 14.5523 2.44771 14C2.44771 13.9331 2.45443 13.8663 2.46777 13.8007L4.70497 2.8007C4.79973 2.33478 5.20944 2 5.6849 2Z",fill:"#05285A"}),o5("path",{d:"M30.5565 1C31.6611 1 32.5565 1.89543 32.5565 3C32.5565 3.13274 32.5433 3.26514 32.5171 3.39526L30.2994 14.3953C30.1112 15.3287 29.2911 16 28.3389 16H3.44771C2.34314 16 1.44771 15.1046 1.44771 14C1.44771 13.8661 1.46115 13.7326 1.48783 13.6014L3.72503 2.6014C3.91455 1.66955 4.73398 1 5.6849 1H30.5565ZM30.5565 2H5.6849C5.24907 2 4.86847 2.28131 4.73507 2.68707L4.70497 2.8007L2.46777 13.8007C2.45443 13.8663 2.44771 13.9331 2.44771 14C2.44771 14.5128 2.83375 14.9355 3.33109 14.9933L3.44771 15H28.3389C28.7753 15 29.1562 14.718 29.2892 14.3115L29.3191 14.1976L31.5368 3.19763C31.5499 3.13257 31.5565 3.06637 31.5565 3C31.5565 2.48716 31.1705 2.06449 30.6732 2.00673L30.5565 2Z",fill:"#fff"}),o5("path",{d:"M11.39 12.04C12.28 12.04 12.85 11.56 13.04 10.67L13.3 9.44C13.45 8.72 13.15 8.25 12.34 8.03L10.51 7.53C10.34 7.48 10.31 7.41 10.35 7.24L10.5 6.51C10.54 6.34 10.63 6.26 10.81 6.26H12.14C12.32 6.26 12.39 6.34 12.35 6.52L12.22 7.15H13.72L13.83 6.61C14.05 5.55 13.6 4.99 12.5 4.99H10.7C9.81 4.99 9.22 5.47 9.03 6.36L8.82 7.35C8.63 8.26 9.18 8.69 9.68 8.83L11.58 9.35C11.74 9.39 11.8 9.47 11.76 9.64L11.57 10.51C11.53 10.69 11.43 10.77 11.26 10.77H9.8C9.62 10.77 9.55 10.69 9.59 10.51L9.71 9.94H8.21L8.11 10.42C7.89 11.47 8.35 12.04 9.45 12.04H11.39ZM17.61 12.04C18.5 12.04 19.09 11.56 19.27 10.67L19.74 8.38H17.33L17.09 9.58H18L17.81 10.48C17.77 10.66 17.67 10.74 17.5 10.74H16.16C15.98 10.74 15.91 10.66 15.95 10.48L16.78 6.55C16.82 6.37 16.93 6.29 17.1 6.29H18.44C18.62 6.29 18.68 6.37 18.64 6.55L18.5 7.23H20L20.11 6.71C20.34 5.6 19.88 4.99 18.76 4.99H16.97C16.07 4.99 15.49 5.47 15.3 6.36L14.46 10.32C14.22 11.43 14.71 12.04 15.82 12.04H17.61ZM22.01 12L22.53 9.53H24.56C25.45 9.53 26.02 9.05 26.21 8.16L26.51 6.75C26.75 5.64 26.28 5.03 25.17 5.03H21.97L20.49 12H22.01ZM24.43 8.22H22.81L23.21 6.34H24.83C25.01 6.34 25.07 6.42 25.03 6.6L24.74 7.96C24.7 8.14 24.6 8.22 24.43 8.22Z",fill:"#FFDC2E"})]});import{jsx as A,jsxs as y0}from"react/jsx-runtime";var b0=C=>y0("svg",{width:47,height:17,viewBox:"0 0 47 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[A("title",{children:"SGP_Plus"}),A("path",{d:"M44.007 0H42.0017H32.024H31.17H28.0334H21.1924H17.2017H5.22477C3.8021 0 2.57497 1.004 2.29164 2.402L0.0598599 13.402C0.0199533 13.599 0 13.799 0 14C0 15.657 1.33986 17 2.993 17H13.7658H17.7564H24.5974H27.7351H28.5891H38.5667H41.7952C43.2198 17 44.448 15.993 44.7293 14.593L46.9421 3.593C46.98 3.398 47 3.199 47 3C47 1.343 45.6601 0 44.007 0ZM45.9634 3.395L43.7506 14.395C43.563 15.329 42.745 16 41.7952 16H39.5295H38.7693H28.7906H27.9366H24.8H17.959H13.9683H9.9966H2.993C1.89058 16 0.997665 15.105 0.997665 14C0.997665 13.866 1.01063 13.733 1.03757 13.601L3.26935 2.601C3.4589 1.67 4.27599 1 5.22477 1H15.3511H16.9982H20.9889H27.8299H30.9665H31.8205H41.7982H42.8138H44.006C45.1084 1 46.0013 1.895 46.0013 3C46.0023 3.133 45.9894 3.265 45.9634 3.395Z",fill:"#05285A"}),A("path",{d:"M44.007 1H42.8148H41.7992H31.8215H30.9675H27.8308H20.9899H16.9992H15.3521H5.22476C4.27598 1 3.45889 1.67 3.26933 2.601L1.03756 13.601C1.01062 13.733 0.99765 13.866 0.99765 14C0.99765 15.105 1.89056 16 2.99298 16H9.99659H13.9683H17.959H24.7999H27.9366H28.7906H38.7682H39.5285H41.7942C42.7439 16 43.562 15.329 43.7506 14.395L45.9634 3.395C45.9893 3.265 46.0023 3.133 46.0023 3C46.0023 1.895 45.1094 1 44.007 1ZM44.9857 3.198L42.7729 14.198L42.7429 14.312C42.729 14.355 42.702 14.39 42.6821 14.43C42.6621 14.471 42.6452 14.513 42.6202 14.551C42.5833 14.606 42.5384 14.652 42.4925 14.698C42.4626 14.728 42.4367 14.761 42.4037 14.787C42.3469 14.831 42.282 14.863 42.2162 14.894C42.1843 14.909 42.1553 14.931 42.1214 14.943C42.0186 14.979 41.9089 15 41.7952 15H40.0802H38.9708H28.9931H28.1391H25.0025H18.1615H14.1708H10.5483H2.99298L2.87625 14.993C2.38041 14.936 1.99532 14.513 1.99532 14C1.99532 13.933 2.0023 13.866 2.01527 13.801L4.24705 2.801L4.27698 2.687C4.41066 2.281 4.78977 2 5.22476 2H14.8393H16.7967H20.7873H27.6283H30.765H31.619H41.5966H42.302H44.007L44.1237 2.007C44.1796 2.014 44.2275 2.04 44.2803 2.055C44.3302 2.07 44.3831 2.079 44.429 2.101C44.4968 2.133 44.5557 2.18 44.6136 2.226C44.6515 2.256 44.6934 2.28 44.7273 2.315C44.7832 2.375 44.8241 2.447 44.864 2.519C44.8839 2.555 44.9129 2.586 44.9288 2.624C44.9767 2.74 45.0047 2.867 45.0047 3C45.0047 3.066 44.9987 3.133 44.9857 3.198Z",fill:"#fff"}),A("path",{d:"M44.1562 2.007L44.0392 2H36.4672H32.8362H31.6172L28.9902 15L29.0902 14.999V15H30.2032H32.1652H41.8022C42.2382 15 42.6182 14.719 42.7522 14.312L42.7822 14.199L45.0192 3.199L45.0392 3C45.0392 2.487 44.6532 2.064 44.1562 2.007Z",fill:"#FFDC2E"}),A("path",{d:"M30.837 2H27.693H20.836H16.836H14.874H5.237C4.801 2 4.421 2.281 4.287 2.688L4.257 2.801L2.02 13.801L2 14C2 14.513 2.386 14.936 2.883 14.993L3 15H10.572H14.203H18.203H25.06H28.205H29.061L31.694 2H30.837Z",fill:"#05285A"}),A("path",{d:"M12.0249 4.99H10.2291C9.34113 4.99 8.75251 5.47 8.56295 6.36L8.35344 7.35C8.16389 8.26 8.7126 8.69 9.21144 8.83L11.107 9.35C11.2666 9.39 11.3265 9.47 11.2866 9.64L11.097 10.51C11.0571 10.69 10.9574 10.77 10.7877 10.77H9.33116C9.15158 10.77 9.08174 10.69 9.12165 10.51L9.24137 9.94H7.74487L7.6451 10.42C7.42562 11.47 7.88454 12.04 8.98197 12.04H10.9174C11.8054 12.04 12.374 11.56 12.5636 10.67L12.823 9.44C12.9726 8.72 12.6733 8.25 11.8652 8.03L10.0395 7.53C9.8699 7.48 9.83997 7.41 9.87987 7.24L10.0295 6.51C10.0694 6.34 10.1592 6.26 10.3388 6.26H11.6657C11.8453 6.26 11.9151 6.34 11.8752 6.52L11.7455 7.15H13.242L13.3517 6.61C13.5712 5.55 13.1223 4.99 12.0249 4.99Z",fill:"#FFDC2E"}),A("path",{d:"M18.2702 4.99H16.4844C15.5865 4.99 15.0079 5.47 14.8183 6.36L13.9803 10.32C13.7408 11.43 14.2297 12.04 15.3371 12.04H17.1229C18.0108 12.04 18.5995 11.56 18.779 10.67L19.2479 8.38H16.8436L16.6041 9.58H17.512L17.3225 10.48C17.2825 10.66 17.1828 10.74 17.0132 10.74H15.6763C15.4967 10.74 15.4269 10.66 15.4668 10.48L16.2949 6.55C16.3348 6.37 16.4445 6.29 16.6141 6.29H17.951C18.1306 6.29 18.1904 6.37 18.1505 6.55L18.0108 7.23H19.5073L19.6171 6.71C19.8465 5.6 19.3876 4.99 18.2702 4.99Z",fill:"#FFDC2E"}),A("path",{d:"M24.6653 5.03H21.4727L19.9962 12H21.5126L22.0314 9.53H24.0567C24.9446 9.53 25.5133 9.05 25.7028 8.16L26.0021 6.75C26.2416 5.64 25.7727 5.03 24.6653 5.03ZM24.2363 7.96C24.1964 8.14 24.0966 8.22 23.927 8.22H22.3108L22.7098 6.34H24.3261C24.5056 6.34 24.5655 6.42 24.5256 6.6L24.2363 7.96Z",fill:"#FFDC2E"}),A("path",{d:"M38.5657 5.723H37.0403L36.6113 7.837H34.5032L34.193 9.366H36.301L35.872 11.479H37.3975L37.8265 9.366H39.9355L40.2458 7.837H38.1367L38.5657 5.723Z",fill:"#05285A"})]});import{jsx as W4,jsxs as B0}from"react/jsx-runtime";var I0=C=>B0("svg",{width:17,height:17,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",display:"block",...C,children:[W4("title",{children:"Trending"}),W4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 17C13.1944 17 17 13.1944 17 8.5C17 3.80558 13.1944 0 8.5 0C3.80558 0 0 3.80558 0 8.5C0 13.1944 3.80558 17 8.5 17ZM9.99997 5.49985C9.99997 5.22371 10.2238 4.99985 10.5 4.99985H13.5C13.7761 4.99985 14 5.22371 14 5.49985V8.49985C14 8.77599 13.7761 8.99985 13.5 8.99985C13.2238 8.99985 13 8.77599 13 8.49985V6.70695L8.85354 10.8536C8.75978 10.9474 8.6326 11.0001 8.49999 11.0001C8.36738 11.0001 8.2402 10.9474 8.14643 10.8536L6.49997 9.20715L3.85352 11.8534C3.65825 12.0486 3.34167 12.0486 3.14641 11.8534C2.95116 11.6581 2.95117 11.3415 3.14644 11.1462L6.14644 8.14649C6.34171 7.95124 6.65828 7.95125 6.85353 8.1465L8.49997 9.79294L12.2929 5.99985H10.5C10.2238 5.99985 9.99997 5.77599 9.99997 5.49985Z",fill:"#0070EB"})]});import{jsx as O4,jsxs as E0}from"react/jsx-runtime";var k0=C=>E0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[O4("title",{children:"ArrowDown"}),O4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 1C8.27613 1 8.49999 1.22386 8.49999 1.5V13.2146L13.1313 8.16214C13.3179 7.95858 13.6342 7.94483 13.8378 8.13142C14.0413 8.31802 14.0551 8.6343 13.8685 8.83786L8.36857 14.8379C8.27386 14.9412 8.14014 15 7.99999 15C7.85983 15 7.72611 14.9412 7.63141 14.8379L2.13143 8.83786C1.94483 8.6343 1.95858 8.31802 2.16214 8.13142C2.3657 7.94483 2.68198 7.95858 2.86858 8.16214L7.49999 13.2146V1.5C7.49999 1.22386 7.72384 1 7.99999 1Z",fill:"currentColor"})]});import{jsx as N4,jsxs as A0}from"react/jsx-runtime";var F0=C=>A0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[N4("title",{children:"ArrowLeft"}),N4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 7.99999C15 8.27613 14.7761 8.49999 14.5 8.49999L2.78541 8.49999L7.83786 13.1313C8.04142 13.3179 8.05517 13.6342 7.86858 13.8378C7.68198 14.0413 7.3657 14.0551 7.16214 13.8685L1.16214 8.36857C1.05882 8.27386 1 8.14014 1 7.99999C1 7.85983 1.05882 7.72611 1.16214 7.63141L7.16214 2.13143C7.3657 1.94483 7.68198 1.95858 7.86858 2.16214C8.05517 2.3657 8.04142 2.68198 7.83786 2.86858L2.7854 7.49999L14.5 7.49999C14.7761 7.49999 15 7.72385 15 7.99999Z",fill:"currentColor"})]});import{jsx as U4,jsxs as T0}from"react/jsx-runtime";var D0=C=>T0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[U4("title",{children:"ArrowRight"}),U4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 7.99994C1 7.7238 1.22386 7.49994 1.5 7.49994H13.2146L8.16214 2.86858C7.95858 2.68199 7.94483 2.3657 8.13142 2.16214C8.31802 1.95858 8.6343 1.94483 8.83786 2.13142L14.8379 7.63136C14.9412 7.72607 15 7.85978 15 7.99994C15 8.14009 14.9412 8.27381 14.8379 8.36852L8.83786 13.8685C8.6343 14.0551 8.31802 14.0413 8.13142 13.8378C7.94483 13.6342 7.95858 13.3179 8.16214 13.1313L13.2146 8.49994H1.5C1.22386 8.49994 1 8.27608 1 7.99994Z",fill:"currentColor"})]});import{jsx as J4,jsxs as W0}from"react/jsx-runtime";var _0=C=>W0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[J4("title",{children:"ArrowUp"}),J4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99994 15C7.7238 15 7.49994 14.7761 7.49994 14.5L7.49994 2.78541L2.86858 7.83786C2.68199 8.04142 2.3657 8.05517 2.16214 7.86858C1.95858 7.68198 1.94483 7.3657 2.13142 7.16214L7.63136 1.16214C7.72607 1.05882 7.85979 1 7.99994 1C8.14009 1 8.27381 1.05882 8.36852 1.16214L13.8685 7.16214C14.0551 7.3657 14.0413 7.68198 13.8378 7.86858C13.6342 8.05517 13.3179 8.04142 13.1313 7.83786L8.49994 2.7854L8.49994 14.5C8.49994 14.7761 8.27608 15 7.99994 15Z",fill:"currentColor"})]});import{jsx as K4,jsxs as N0}from"react/jsx-runtime";var O0=C=>N0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[K4("title",{children:"ChevronDown"}),K4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.16214 4.63143C2.3657 4.44483 2.68198 4.45858 2.86858 4.66214L8 10.2601L13.1314 4.66214C13.318 4.45858 13.6343 4.44483 13.8379 4.63143C14.0414 4.81802 14.0552 5.13431 13.8686 5.33787L8.36858 11.3379C8.27387 11.4412 8.14016 11.5 8 11.5C7.85985 11.5 7.72613 11.4412 7.63143 11.3379L2.13143 5.33787C1.94483 5.13431 1.95858 4.81802 2.16214 4.63143Z",fill:"currentColor"})]});import{jsx as I2,jsxs as J0}from"react/jsx-runtime";var U0=C=>J0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[I2("title",{children:"ChevronDownCircle"}),I2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),I2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.1473 6.09725C4.34256 5.90199 4.65914 5.90199 4.85441 6.09725L8.00003 9.24285L11.1456 6.09725C11.3409 5.90199 11.6575 5.90199 11.8527 6.09725C12.048 6.29251 12.048 6.6091 11.8527 6.80436L8.35359 10.3035C8.15833 10.4988 7.84174 10.4988 7.64648 10.3035L4.1473 6.80436C3.95204 6.6091 3.95204 6.29252 4.1473 6.09725Z",fill:"currentColor"})]});import{jsx as q4,jsxs as q0}from"react/jsx-runtime";var K0=C=>q0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[q4("title",{children:"ChevronLeft"}),q4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3686 2.16214C11.5552 2.3657 11.5414 2.68198 11.3379 2.86858L5.73994 8L11.3379 13.1314C11.5414 13.318 11.5552 13.6343 11.3686 13.8379C11.182 14.0414 10.8657 14.0552 10.6621 13.8686L4.66213 8.36858C4.55882 8.27387 4.5 8.14016 4.5 8C4.5 7.85985 4.55882 7.72613 4.66213 7.63143L10.6621 2.13143C10.8657 1.94483 11.182 1.95858 11.3686 2.16214Z",fill:"currentColor"})]});import{jsx as B2,jsxs as X0}from"react/jsx-runtime";var z0=C=>X0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[B2("title",{children:"ChevronLeftCircle"}),B2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),B2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.8527 4.09724C10.048 4.2925 10.048 4.60908 9.8527 4.80434L6.70711 7.94997L9.8527 11.0956C10.048 11.2908 10.048 11.6074 9.8527 11.8027C9.65744 11.9979 9.34085 11.9979 9.14559 11.8027L5.64645 8.30352C5.45119 8.10826 5.45118 7.79168 5.64644 7.59642L9.14559 4.09724C9.34085 3.90198 9.65743 3.90197 9.8527 4.09724Z",fill:"currentColor"})]});import{jsx as z4,jsxs as Q0}from"react/jsx-runtime";var Y0=C=>Q0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[z4("title",{children:"ChevronRight"}),z4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.63143 2.16214C4.44483 2.3657 4.45858 2.68198 4.66214 2.86858L10.2601 8L4.66214 13.1314C4.45858 13.318 4.44483 13.6343 4.63143 13.8379C4.81802 14.0414 5.13431 14.0552 5.33786 13.8686L11.3379 8.36858C11.4412 8.27388 11.5 8.14016 11.5 8C11.5 7.85985 11.4412 7.72613 11.3379 7.63143L5.33787 2.13143C5.13431 1.94483 4.81802 1.95858 4.63143 2.16214Z",fill:"currentColor"})]});import{jsx as k2,jsxs as j0}from"react/jsx-runtime";var $0=C=>j0("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[k2("title",{children:"ChevronRightCircle"}),k2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),k2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.1473 11.8527C5.95204 11.6575 5.95204 11.3409 6.1473 11.1456L9.2929 7.99999L6.1473 4.85439C5.95204 4.65913 5.95204 4.34255 6.1473 4.14729C6.34256 3.95202 6.65915 3.95202 6.85441 4.14729L10.3536 7.64643C10.5488 7.84169 10.5488 8.15827 10.3536 8.35354L6.85441 11.8527C6.65915 12.048 6.34257 12.048 6.1473 11.8527Z",fill:"currentColor"})]});import{jsx as X4,jsxs as e8}from"react/jsx-runtime";var C8=C=>e8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[X4("title",{children:"ChevronUp"}),X4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.16214 11.3686C2.3657 11.5552 2.68198 11.5414 2.86858 11.3379L8 5.73994L13.1314 11.3379C13.318 11.5414 13.6343 11.5552 13.8379 11.3686C14.0414 11.182 14.0552 10.8657 13.8686 10.6621L8.36858 4.66214C8.27388 4.55882 8.14016 4.5 8 4.5C7.85985 4.5 7.72613 4.55882 7.63143 4.66214L2.13143 10.6621C1.94483 10.8657 1.95858 11.182 2.16214 11.3686Z",fill:"currentColor"})]});import{jsx as E2,jsxs as l8}from"react/jsx-runtime";var o8=C=>l8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[E2("title",{children:"ChevronUpCircle"}),E2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),E2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.8528 9.8527C11.6576 10.048 11.341 10.048 11.1457 9.8527L8.00009 6.70711L4.8545 9.8527C4.65923 10.048 4.34265 10.048 4.14739 9.8527C3.95213 9.65744 3.95213 9.34085 4.14739 9.14559L7.64654 5.64645C7.8418 5.45119 8.15838 5.45118 8.35364 5.64645L11.8528 9.14559C12.0481 9.34085 12.0481 9.65744 11.8528 9.8527Z",fill:"currentColor"})]});import{jsx as t1,jsxs as r8}from"react/jsx-runtime";var t8=C=>r8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[t1("title",{children:"Betslip"}),t1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2.36849C14 1.96914 13.5549 1.73095 13.2227 1.95246L12.1621 2.65948C11.796 2.90358 11.3411 2.97458 10.918 2.85369L8.13736 2.05923C8.04758 2.03358 7.95242 2.03358 7.86264 2.05923L5.08201 2.85369C4.65889 2.97458 4.20402 2.90358 3.83788 2.65948L2.77735 1.95246C2.44507 1.73095 2 1.96914 2 2.36849V14.5C2 14.7761 2.22386 15 2.5 15H13.5C13.7761 15 14 14.7761 14 14.5V2.36849ZM12.668 1.12041C13.6648 0.455858 15 1.17045 15 2.36849V14.5C15 15.3284 14.3284 16 13.5 16H2.5C1.67157 16 1 15.3284 1 14.5V2.36849C1 1.17045 2.33522 0.455859 3.33205 1.12041L4.39258 1.82743C4.51463 1.9088 4.66625 1.93247 4.80729 1.89217L7.58792 1.0977C7.85725 1.02075 8.14275 1.02075 8.41208 1.0977L11.1927 1.89217C11.3338 1.93247 11.4854 1.9088 11.6074 1.82743L12.668 1.12041Z",fill:"currentColor"}),t1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5.49997C4 5.22383 4.22386 4.99997 4.5 4.99997H11.5C11.7761 4.99997 12 5.22383 12 5.49997C12 5.77611 11.7761 5.99997 11.5 5.99997H4.5C4.22386 5.99997 4 5.77611 4 5.49997Z",fill:"currentColor"}),t1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 8.49997C4 8.22383 4.22386 7.99997 4.5 7.99997H7.5C7.77614 7.99997 8 8.22383 8 8.49997C8 8.77611 7.77614 8.99997 7.5 8.99997H4.5C4.22386 8.99997 4 8.77611 4 8.49997Z",fill:"currentColor"}),t1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 8.49997C10 8.22383 10.2239 7.99997 10.5 7.99997H11.5C11.7761 7.99997 12 8.22383 12 8.49997C12 8.77611 11.7761 8.99997 11.5 8.99997H10.5C10.2239 8.99997 10 8.77611 10 8.49997Z",fill:"currentColor"}),t1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 11.5C4 11.2238 4.22386 11 4.5 11H7.5C7.77614 11 8 11.2238 8 11.5C8 11.7761 7.77614 12 7.5 12H4.5C4.22386 12 4 11.7761 4 11.5Z",fill:"currentColor"}),t1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 11.5C10 11.2238 10.2239 11 10.5 11H11.5C11.7761 11 12 11.2238 12 11.5C12 11.7761 11.7761 12 11.5 12H10.5C10.2239 12 10 11.7761 10 11.5Z",fill:"currentColor"})]});import{jsx as r1,jsxs as n8}from"react/jsx-runtime";var i8=C=>n8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[r1("title",{children:"BetslipActive"}),r1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2.36849C14 1.96914 13.5549 1.73095 13.2227 1.95246L12.1621 2.65948C11.796 2.90358 11.3411 2.97458 10.918 2.85369L8.13736 2.05923C8.04758 2.03358 7.95242 2.03358 7.86264 2.05923L5.08201 2.85369C4.65889 2.97458 4.20402 2.90358 3.83788 2.65948L2.77735 1.95246C2.44507 1.73095 2 1.96914 2 2.36849V14.5C2 14.7761 2.22386 15 2.5 15H6.5C6.77614 15 7 15.2238 7 15.5C7 15.7761 6.77614 16 6.5 16H2.5C1.67157 16 1 15.3284 1 14.5V2.36849C1 1.17045 2.33522 0.455859 3.33205 1.12041L4.39258 1.82743C4.51463 1.9088 4.66625 1.93247 4.80729 1.89217L7.58792 1.0977C7.85725 1.02075 8.14275 1.02075 8.41208 1.0977L11.1927 1.89217C11.3338 1.93247 11.4854 1.9088 11.6074 1.82743L12.668 1.12041C13.6648 0.455858 15 1.17045 15 2.36849V5.49997C15 5.77611 14.7761 5.99997 14.5 5.99997C14.2239 5.99997 14 5.77611 14 5.49997V2.36849Z",fill:"currentColor"}),r1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5.49997C4 5.22383 4.22386 4.99997 4.5 4.99997H11.5C11.7761 4.99997 12 5.22383 12 5.49997C12 5.77611 11.7761 5.99997 11.5 5.99997H4.5C4.22386 5.99997 4 5.77611 4 5.49997Z",fill:"currentColor"}),r1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 8.49997C4 8.22383 4.22386 7.99997 4.5 7.99997H5.5C5.77614 7.99997 6 8.22383 6 8.49997C6 8.77611 5.77614 8.99997 5.5 8.99997H4.5C4.22386 8.99997 4 8.77611 4 8.49997Z",fill:"currentColor"}),r1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 11.5C4 11.2238 4.22386 11 4.5 11H5.5C5.77614 11 6 11.2238 6 11.5C6 11.7761 5.77614 12 5.5 12H4.5C4.22386 12 4 11.7761 4 11.5Z",fill:"currentColor"}),r1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 15C13.433 15 15 13.433 15 11.5C15 9.56698 13.433 7.99997 11.5 7.99997C9.567 7.99997 8 9.56698 8 11.5C8 13.433 9.567 15 11.5 15ZM11.5 16C13.9853 16 16 13.9853 16 11.5C16 9.01469 13.9853 6.99997 11.5 6.99997C9.01472 6.99997 7 9.01469 7 11.5C7 13.9853 9.01472 16 11.5 16Z",fill:"currentColor"}),r1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8071 9.60538C14.025 9.77497 14.0642 10.0891 13.8946 10.3071L11.5599 13.3071C11.4046 13.5066 11.1248 13.5588 10.9079 13.4286L9.2426 12.4286C9.00586 12.2865 8.92919 11.9793 9.07134 11.7426C9.2135 11.5058 9.52066 11.4292 9.7574 11.5713L11.0429 12.3432L13.1054 9.69289C13.275 9.47497 13.5892 9.43579 13.8071 9.60538Z",fill:"currentColor"})]});import{jsx as N,jsxs as p8}from"react/jsx-runtime";var d8=C=>p8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[N("title",{children:"BetslipCancelled"}),N("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2.36849C14 1.96914 13.5549 1.73095 13.2227 1.95246L12.1621 2.65948C11.796 2.90358 11.3411 2.97458 10.918 2.85369L8.13736 2.05923C8.04758 2.03358 7.95242 2.03358 7.86264 2.05923L5.08201 2.85369C4.65889 2.97458 4.20402 2.90358 3.83788 2.65948L2.77735 1.95246C2.44507 1.73095 2 1.96914 2 2.36849V14.5C2 14.7761 2.22386 15 2.5 15H6.5C6.77614 15 7 15.2238 7 15.5C7 15.7761 6.77614 16 6.5 16H2.5C1.67157 16 1 15.3284 1 14.5V2.36849C1 1.17045 2.33522 0.455859 3.33205 1.12041L4.39258 1.82743C4.51463 1.9088 4.66625 1.93247 4.80729 1.89217L7.58792 1.0977C7.85725 1.02075 8.14275 1.02075 8.41208 1.0977L11.1927 1.89217C11.3338 1.93247 11.4854 1.9088 11.6074 1.82743L12.668 1.12041C13.6648 0.455858 15 1.17045 15 2.36849V5.49997C15 5.77611 14.7761 5.99997 14.5 5.99997C14.2239 5.99997 14 5.77611 14 5.49997V2.36849Z",fill:"currentColor"}),N("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5.5C4 5.22386 4.22386 5 4.5 5H11.5C11.7761 5 12 5.22386 12 5.5C12 5.77614 11.7761 6 11.5 6H4.5C4.22386 6 4 5.77614 4 5.5Z",fill:"currentColor"}),N("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 8.5C4 8.22386 4.22386 8 4.5 8H5.5C5.77614 8 6 8.22386 6 8.5C6 8.77614 5.77614 9 5.5 9H4.5C4.22386 9 4 8.77614 4 8.5Z",fill:"currentColor"}),N("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 11.5C4 11.2239 4.22386 11 4.5 11H5.5C5.77614 11 6 11.2239 6 11.5C6 11.7761 5.77614 12 5.5 12H4.5C4.22386 12 4 11.7761 4 11.5Z",fill:"currentColor"}),N("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 15C13.433 15 15 13.433 15 11.5C15 9.567 13.433 8 11.5 8C9.567 8 8 9.567 8 11.5C8 13.433 9.567 15 11.5 15ZM11.5 16C13.9853 16 16 13.9853 16 11.5C16 9.01472 13.9853 7 11.5 7C9.01472 7 7 9.01472 7 11.5C7 13.9853 9.01472 16 11.5 16Z",fill:"currentColor"}),N("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.8536 10.1464C13.0488 10.3417 13.0488 10.6583 12.8536 10.8536L10.8536 12.8536C10.6583 13.0488 10.3417 13.0488 10.1464 12.8536C9.95118 12.6583 9.95118 12.3417 10.1464 12.1464L12.1464 10.1464C12.3417 9.95118 12.6583 9.95118 12.8536 10.1464Z",fill:"currentColor"}),N("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.1464 10.1464C10.3417 9.95118 10.6583 9.95118 10.8536 10.1464L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L10.1464 10.8536C9.95118 10.6583 9.95118 10.3417 10.1464 10.1464Z",fill:"currentColor"})]});import{jsx as i1,jsxs as c8}from"react/jsx-runtime";var s8=C=>c8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[i1("title",{children:"BetslipRetailLocation"}),i1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2.36852C14 1.96917 13.5549 1.73097 13.2227 1.95249L12.2602 2.59412C11.8123 2.89271 11.2388 2.92841 10.7573 2.68769L10.2764 2.44721C10.0294 2.32372 9.92929 2.02338 10.0528 1.77639C10.1763 1.5294 10.4766 1.42929 10.7236 1.55279L11.2046 1.79326C11.365 1.8735 11.5562 1.8616 11.7055 1.76207L12.668 1.12044C13.6648 0.455886 15 1.17047 15 2.36852V14.5C15 15.3284 14.3284 16 13.5 16H2.5C1.67157 16 1 15.3284 1 14.5V10.5C1 10.2239 1.22386 10 1.5 10C1.77614 10 2 10.2239 2 10.5V14.5C2 14.7761 2.22386 15 2.5 15H13.5C13.7761 15 14 14.7761 14 14.5V2.36852Z",fill:"currentColor"}),i1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 5.5C10.5 5.22386 10.7239 5 11 5H11.5C11.7761 5 12 5.22386 12 5.5C12 5.77614 11.7761 6 11.5 6H11C10.7239 6 10.5 5.77614 10.5 5.5Z",fill:"currentColor"}),i1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 8.5C10 8.22386 10.2239 8 10.5 8H11.5C11.7761 8 12 8.22386 12 8.5C12 8.77614 11.7761 9 11.5 9H10.5C10.2239 9 10 8.77614 10 8.5Z",fill:"currentColor"}),i1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 11.5C7 11.2239 7.22386 11 7.5 11H11.5C11.7761 11 12 11.2239 12 11.5C12 11.7761 11.7761 12 11.5 12H7.5C7.22386 12 7 11.7761 7 11.5Z",fill:"currentColor"}),i1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.30891 1.95566C1.52873 2.56867 1 3.43355 1 4.50005C1 5.60843 1.44131 6.65763 2.21936 7.74691C2.92835 8.73952 3.89283 9.7328 4.99997 10.8055C6.10712 9.7328 7.07162 8.73951 7.78062 7.74691C8.55868 6.65763 9 5.60842 9 4.50005C9 3.43355 8.47127 2.56867 7.69108 1.95566C6.90287 1.33635 5.88631 1 4.99997 1C4.11366 1 3.09712 1.33635 2.30891 1.95566ZM1.69108 1.16935C2.65287 0.413649 3.88631 0 4.99997 0C6.11366 0 7.34711 0.413648 8.30891 1.16935C9.27873 1.93135 10 3.0665 10 4.50005C10 5.89162 9.44131 7.14242 8.59435 8.32815C7.75132 9.50839 6.59407 10.6628 5.34624 11.8607C5.15276 12.0465 4.84719 12.0465 4.65371 11.8607C3.40588 10.6628 2.24864 9.50839 1.40562 8.32815C0.558677 7.14241 0 5.89162 0 4.50005C0 3.0665 0.721271 1.93135 1.69108 1.16935Z",fill:"currentColor"}),i1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 6C5.55228 6 6 5.55228 6 5C6 4.44772 5.55228 4 5 4C4.44772 4 4 4.44772 4 5C4 5.55228 4.44772 6 5 6ZM5 7C6.10457 7 7 6.10457 7 5C7 3.89543 6.10457 3 5 3C3.89543 3 3 3.89543 3 5C3 6.10457 3.89543 7 5 7Z",fill:"currentColor"})]});import{jsx as U,jsxs as h8}from"react/jsx-runtime";var f8=C=>h8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[U("title",{children:"BetslipVoided"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2.36849C14 1.96914 13.5549 1.73095 13.2227 1.95246L12.1621 2.65948C11.796 2.90358 11.3411 2.97458 10.918 2.85369L8.13736 2.05923C8.04758 2.03358 7.95242 2.03358 7.86264 2.05923L5.08201 2.85369C4.65889 2.97458 4.20402 2.90358 3.83788 2.65948L2.77735 1.95246C2.44507 1.73095 2 1.96914 2 2.36849V14.5C2 14.7761 2.22386 15 2.5 15H6.5C6.77614 15 7 15.2238 7 15.5C7 15.7761 6.77614 16 6.5 16H2.5C1.67157 16 1 15.3284 1 14.5V2.36849C1 1.17045 2.33522 0.455859 3.33205 1.12041L4.39258 1.82743C4.51463 1.9088 4.66625 1.93247 4.80729 1.89217L7.58792 1.0977C7.85725 1.02075 8.14275 1.02075 8.41208 1.0977L11.1927 1.89217C11.3338 1.93247 11.4854 1.9088 11.6074 1.82743L12.668 1.12041C13.6648 0.455858 15 1.17045 15 2.36849V5.49997C15 5.77611 14.7761 5.99997 14.5 5.99997C14.2239 5.99997 14 5.77611 14 5.49997V2.36849Z",fill:"currentColor"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5.49997C4 5.22383 4.22386 4.99997 4.5 4.99997H11.5C11.7761 4.99997 12 5.22383 12 5.49997C12 5.77611 11.7761 5.99997 11.5 5.99997H4.5C4.22386 5.99997 4 5.77611 4 5.49997Z",fill:"currentColor"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 8.49997C4 8.22383 4.22386 7.99997 4.5 7.99997H5.5C5.77614 7.99997 6 8.22383 6 8.49997C6 8.77611 5.77614 8.99997 5.5 8.99997H4.5C4.22386 8.99997 4 8.77611 4 8.49997Z",fill:"currentColor"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 11.5C4 11.2238 4.22386 11 4.5 11H5.5C5.77614 11 6 11.2238 6 11.5C6 11.7761 5.77614 12 5.5 12H4.5C4.22386 12 4 11.7761 4 11.5Z",fill:"currentColor"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 15C13.433 15 15 13.433 15 11.5C15 9.56698 13.433 7.99997 11.5 7.99997C9.567 7.99997 8 9.56698 8 11.5C8 13.433 9.567 15 11.5 15ZM11.5 16C13.9853 16 16 13.9853 16 11.5C16 9.01469 13.9853 6.99997 11.5 6.99997C9.01472 6.99997 7 9.01469 7 11.5C7 13.9853 9.01472 16 11.5 16Z",fill:"currentColor"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 8.99997C11.7761 8.99997 12 9.22383 12 9.49997V11.5C12 11.7761 11.7761 12 11.5 12C11.2239 12 11 11.7761 11 11.5V9.49997C11 9.22383 11.2239 8.99997 11.5 8.99997Z",fill:"currentColor"}),U("path",{d:"M12 13.5C12 13.7761 11.7761 14 11.5 14C11.2239 14 11 13.7761 11 13.5C11 13.2238 11.2239 13 11.5 13C11.7761 13 12 13.2238 12 13.5Z",fill:"currentColor"})]});import{jsx as B5,jsxs as L8}from"react/jsx-runtime";var a8=C=>L8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[B5("title",{children:"BettingRewards"}),B5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 10.9919C10.7614 10.9919 13 8.755 13 5.9956C13 3.2362 10.7614 0.999267 8 0.999267C5.23858 0.999267 3 3.2362 3 5.9956C3 8.755 5.23858 10.9919 8 10.9919ZM8 11.9912C11.3137 11.9912 14 9.30688 14 5.9956C14 2.68432 11.3137 0 8 0C4.68629 0 2 2.68432 2 5.9956C2 9.30688 4.68629 11.9912 8 11.9912Z",fill:"currentColor"}),B5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 15.3999V10.4923H5.5V14.8362L7.8014 14.0295C7.92996 13.9844 8.07004 13.9844 8.1986 14.0295L10.5 14.8362V10.4923H11.5V15.3999C11.5 15.8131 11.0916 16.1025 10.7014 15.9657L8 15.0188L5.2986 15.9657C4.90842 16.1025 4.5 15.8131 4.5 15.3999Z",fill:"currentColor"}),B5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 11.4916C8.27614 11.4916 8.5 11.7153 8.5 11.9912V14.4894C8.5 14.7653 8.27614 14.989 8 14.989C7.72386 14.989 7.5 14.7653 7.5 14.4894V11.9912C7.5 11.7153 7.72386 11.4916 8 11.4916Z",fill:"currentColor"})]});import{jsx as F2,jsxs as u8}from"react/jsx-runtime";var g8=C=>u8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[F2("title",{children:"Commissioner"}),F2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.177073 3.11594C1.75808 1.54846 4.37002 0 7.99999 0C11.63 0 14.2419 1.54846 15.8229 3.11594C15.9357 3.22772 16.0009 3.38084 15.9998 3.54409C15.9875 5.40873 15.1955 7.72883 13.8672 9.9432C12.5338 12.166 10.6304 14.3325 8.33453 15.8777C8.13225 16.0139 7.86773 16.0139 7.66545 15.8777C5.3696 14.3325 3.46619 12.166 2.13281 9.9432C0.804472 7.72883 0.0124584 5.40873 0.000135239 3.54409C-0.000943665 3.38084 0.0643235 3.22773 0.177073 3.11594ZM1.00368 3.70684C1.05999 5.30768 1.75904 7.37617 2.99035 9.42878C4.2163 11.4725 5.94268 13.4542 7.99999 14.8945C10.0573 13.4542 11.7837 11.4725 13.0096 9.42878C14.2409 7.37617 14.94 5.30768 14.9963 3.70683C13.5595 2.33462 11.2314 1 7.99999 1C4.76861 1 2.44045 2.33462 1.00368 3.70684Z",fill:"currentColor"}),F2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.49999 6C5.49999 4.61929 6.61928 3.5 7.99999 3.5H8.99999C9.82842 3.5 10.5 4.17157 10.5 5V5.5C10.5 5.77614 10.2761 6 9.99999 6C9.72385 6 9.49999 5.77614 9.49999 5.5V5C9.49999 4.72386 9.27613 4.5 8.99999 4.5H7.99999C7.17156 4.5 6.49999 5.17157 6.49999 6V8C6.49999 8.82843 7.17156 9.5 7.99999 9.5H8.99999C9.27613 9.5 9.49999 9.27614 9.49999 9V8.5C9.49999 8.22386 9.72385 8 9.99999 8C10.2761 8 10.5 8.22386 10.5 8.5V9C10.5 9.82843 9.82842 10.5 8.99999 10.5H7.99999C6.61928 10.5 5.49999 9.38071 5.49999 8V6Z",fill:"currentColor"})]});import{jsx as D,jsxs as v8}from"react/jsx-runtime";var V8=C=>v8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[D("title",{children:"DragHandle"}),D("path",{d:"M3 1.5C3 0.947715 3.44772 0.5 4 0.5H5C5.55228 0.5 6 0.947715 6 1.5V2.5C6 3.05228 5.55228 3.5 5 3.5H4C3.44772 3.5 3 3.05228 3 2.5V1.5Z",fill:"currentColor"}),D("path",{d:"M10 1.5C10 0.947715 10.4477 0.5 11 0.5H12C12.5523 0.5 13 0.947715 13 1.5V2.5C13 3.05228 12.5523 3.5 12 3.5H11C10.4477 3.5 10 3.05228 10 2.5V1.5Z",fill:"currentColor"}),D("path",{d:"M3 5.5C3 4.94772 3.44772 4.5 4 4.5H5C5.55228 4.5 6 4.94772 6 5.5V6.5C6 7.05228 5.55228 7.5 5 7.5H4C3.44772 7.5 3 7.05228 3 6.5V5.5Z",fill:"currentColor"}),D("path",{d:"M10 5.5C10 4.94772 10.4477 4.5 11 4.5H12C12.5523 4.5 13 4.94772 13 5.5V6.5C13 7.05228 12.5523 7.5 12 7.5H11C10.4477 7.5 10 7.05228 10 6.5V5.5Z",fill:"currentColor"}),D("path",{d:"M3 9.5C3 8.94772 3.44772 8.5 4 8.5H5C5.55228 8.5 6 8.94772 6 9.5V10.5C6 11.0523 5.55228 11.5 5 11.5H4C3.44772 11.5 3 11.0523 3 10.5V9.5Z",fill:"currentColor"}),D("path",{d:"M10 9.5C10 8.94772 10.4477 8.5 11 8.5H12C12.5523 8.5 13 8.94772 13 9.5V10.5C13 11.0523 12.5523 11.5 12 11.5H11C10.4477 11.5 10 11.0523 10 10.5V9.5Z",fill:"currentColor"}),D("path",{d:"M3 13.5C3 12.9477 3.44772 12.5 4 12.5H5C5.55228 12.5 6 12.9477 6 13.5V14.5C6 15.0523 5.55228 15.5 5 15.5H4C3.44772 15.5 3 15.0523 3 14.5V13.5Z",fill:"currentColor"}),D("path",{d:"M10 13.5C10 12.9477 10.4477 12.5 11 12.5H12C12.5523 12.5 13 12.9477 13 13.5V14.5C13 15.0523 12.5523 15.5 12 15.5H11C10.4477 15.5 10 15.0523 10 14.5V13.5Z",fill:"currentColor"})]});import{jsx as Y4,jsxs as w8}from"react/jsx-runtime";var m8=C=>w8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Y4("title",{children:"HotBetFilled"}),Y4("path",{d:"M14.2059 7.25453C13.6506 6.2207 10.501 0.25518 10.501 0.25518C10.4606 0.177865 10.4015 0.11342 10.3297 0.0685442C10.2579 0.0236682 10.176 0 10.0927 0C10.0093 0 9.9275 0.0236682 9.85569 0.0685442C9.78389 0.11342 9.72474 0.177865 9.68439 0.25518L6.88471 5.51829L5.48487 2.90652C5.44452 2.82921 5.38536 2.76476 5.31356 2.71989C5.24176 2.67501 5.15993 2.65134 5.07658 2.65134C4.99323 2.65134 4.9114 2.67501 4.8396 2.71989C4.7678 2.76476 4.70865 2.82921 4.66829 2.90652C4.66829 2.90652 2.12058 7.80359 1.6633 8.6544C1.21569 9.41092 0.98546 10.2892 1.00071 11.1821C1.00071 13.7098 2.81117 15.9555 5.04625 16H10.0903C12.7967 16 14.9991 13.3388 14.9991 10.2818C15.0177 9.21245 14.7421 8.16052 14.2059 7.25453ZM9.62373 15.0107H6.38543C5.82485 14.993 5.29218 14.7474 4.89779 14.3247C4.50341 13.902 4.27754 13.3347 4.26701 12.7402C4.26329 12.3246 4.38601 11.9187 4.61697 11.5827L6.18012 9.0056C6.20127 8.97089 6.23029 8.94235 6.26452 8.92259C6.29876 8.90282 6.33712 8.89247 6.3761 8.89247C6.41508 8.89247 6.45344 8.90282 6.48767 8.92259C6.52191 8.94235 6.55093 8.97089 6.57208 9.0056L7.40265 10.3758V10.3362C7.69662 9.78715 9.37643 6.63621 9.37643 6.63621C9.39677 6.59815 9.42628 6.56649 9.46194 6.54446C9.4976 6.52243 9.53813 6.51083 9.5794 6.51083C9.62067 6.51083 9.6612 6.52243 9.69686 6.54446C9.73252 6.56649 9.76203 6.59815 9.78238 6.63621C9.78238 6.63621 11.4622 9.7921 11.7562 10.3362C12.0472 10.8082 12.2013 11.3602 12.1994 11.9241C12.1994 15.0107 9.91303 15.0107 9.62373 15.0107Z",fill:"currentColor"})]});import{jsx as Q4,jsxs as M8}from"react/jsx-runtime";var H8=C=>M8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Q4("title",{children:"HotBetOutline"}),Q4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.37209 0.108208C7.5312 0.0576919 7.75349 0.0611167 7.94025 0.211893C8.41964 0.598935 10.1596 2.03589 11.784 3.78863C12.5958 4.66452 13.3902 5.63143 13.9844 6.59547C14.5717 7.54818 15 8.55579 15 9.50003C15 11.335 14.2391 12.945 13.2831 14.0932C12.8043 14.6683 12.2681 15.138 11.7371 15.4678C11.2148 15.7923 10.658 16.0053 10.1452 16.0074C9.65895 16.0094 9.43922 15.5035 9.61681 15.1483L11.0316 12.3187C11.6935 9.94024 10.6081 8.66348 9.75222 7.66147C9.2568 9.40575 8.40794 10.4455 7.86678 10.8525C7.61385 11.0427 7.2841 10.9912 7.0886 10.7958L6.426 10.1332C5.85088 10.5189 5.52418 10.9193 5.34383 11.3006C5.1376 11.7365 5.10073 12.1941 5.16111 12.6611C5.22227 13.1341 5.38072 13.5991 5.55075 14.0386C5.58522 14.1278 5.6233 14.2236 5.66102 14.3186C5.70909 14.4396 5.75656 14.5591 5.79519 14.6612C5.86734 14.8518 5.93666 15.052 5.97264 15.2375C6.02199 15.4919 5.90063 15.7264 5.70332 15.8449C5.51894 15.9556 5.28899 15.9564 5.10166 15.8496C2.8579 14.5696 1.80806 13.2266 1.33685 12.1039C1.10255 11.5457 1.01761 11.0564 0.992507 10.6784C0.970417 10.3458 0.999993 9.98524 0.999993 10C0.999993 9.38452 1.22758 8.7386 1.54732 8.11551C1.87054 7.48562 2.31129 6.83492 2.78745 6.20003C3.2645 5.56396 3.78753 4.93014 4.27905 4.33719C4.30547 4.30532 4.33179 4.27358 4.35799 4.24197C4.82043 3.68424 5.24838 3.16811 5.59378 2.70822C6.57152 1.28544 6.88847 0.671977 6.98435 0.454442C7.06372 0.274377 7.21584 0.157818 7.37209 0.108208ZM7.67969 1.29211C7.46035 1.68949 7.07883 2.31329 6.41195 3.28329L6.40611 3.29178L6.39993 3.30003C6.03822 3.7823 5.59315 4.31905 5.13404 4.87273C5.10572 4.90688 5.07735 4.9411 5.04894 4.97537C4.5561 5.56991 4.0479 6.1861 3.58746 6.80002C3.12614 7.41513 2.72316 8.01444 2.43702 8.57205C2.1474 9.13645 1.99999 9.61554 1.99999 10C1.99999 10.0345 1.99741 10.0778 1.99432 10.1294C1.97708 10.4177 1.94421 10.9671 2.25892 11.7169C2.56285 12.4411 3.2101 13.3763 4.5996 14.3514C4.4283 13.9047 4.24388 13.3657 4.16936 12.7893C4.09137 12.186 4.13139 11.5251 4.43987 10.873C4.7487 10.2201 5.30464 9.62249 6.17837 9.10849C6.40542 8.97492 6.70785 9.00088 6.90744 9.20047L7.52349 9.81646C7.96608 9.34655 8.62815 8.34618 8.95423 6.70572C9.01333 6.40838 9.25562 6.26243 9.44332 6.22575C9.62995 6.18927 9.89736 6.23243 10.0669 6.46599C10.1635 6.59899 10.2973 6.75255 10.4515 6.92948C11.3181 7.92382 12.8281 9.65646 11.9835 12.6276C11.9739 12.6616 11.9607 12.6967 11.9431 12.7317L10.9181 14.7819C11.0113 14.7353 11.1087 14.681 11.2095 14.6184C11.6397 14.3512 12.0965 13.9554 12.5146 13.4534C13.3521 12.4475 14 11.0569 14 9.50003C14 8.83366 13.6871 8.01891 13.1332 7.12021C12.5862 6.23284 11.8392 5.31929 11.0506 4.46838C9.76075 3.07668 8.39016 1.88506 7.67969 1.29211Z",fill:"currentColor"})]});import{jsx as l5,jsxs as Z8}from"react/jsx-runtime";var R8=C=>Z8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[l5("title",{children:"LateSwap"}),l5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-0.000488281 7.5C-0.000488281 6.67157 0.671085 6 1.49951 6H10.5002C11.3286 6 12.0002 6.67157 12.0002 7.5V14.5C12.0002 15.3284 11.3286 16 10.5002 16H1.49951C0.671084 16 -0.000488281 15.3284 -0.000488281 14.5V7.5ZM1.49951 7C1.22337 7 0.999512 7.22386 0.999512 7.5V14.5C0.999512 14.7761 1.22337 15 1.49951 15H10.5002C10.7763 15 11.0002 14.7761 11.0002 14.5V7.5C11.0002 7.22386 10.7763 7 10.5002 7H1.49951Z",fill:"currentColor"}),l5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99988 10C5.72374 10 5.49988 10.2239 5.49988 10.5C5.49988 10.7761 5.72374 11 5.99988 11C6.27602 11 6.49988 10.7761 6.49988 10.5C6.49988 10.2239 6.27602 10 5.99988 10ZM7.49988 10.5C7.49988 11.3284 6.82831 12 5.99988 12C5.17145 12 4.49988 11.3284 4.49988 10.5C4.49988 9.67157 5.17145 9 5.99988 9C6.82831 9 7.49988 9.67157 7.49988 10.5Z",fill:"currentColor"}),l5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99988 11C6.27602 11 6.49988 11.2239 6.49988 11.5V12.5C6.49988 12.7761 6.27602 13 5.99988 13C5.72374 13 5.49988 12.7761 5.49988 12.5V11.5C5.49988 11.2239 5.72374 11 5.99988 11Z",fill:"currentColor"}),l5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3.5C9 1.567 10.567 0 12.5 0C14.433 0 16 1.567 16 3.5C16 3.77614 15.7761 4 15.5 4C15.2239 4 15 3.77614 15 3.5C15 2.11929 13.8807 1 12.5 1C11.1193 1 10 2.11929 10 3.5V6.5H9V3.5Z",fill:"currentColor"})]});import{jsx as t5,jsxs as G8}from"react/jsx-runtime";var S8=C=>G8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[t5("title",{children:"Laurel"}),t5("path",{d:"M2.5 3C3.32843 3 4 2.32843 4 1.5C4 0.671573 3.32843 0 2.5 0C1.67157 0 1 0.671573 1 1.5C1 2.32843 1.67157 3 2.5 3Z",fill:"currentColor"}),t5("path",{d:"M14 5C14 5.55228 13.5523 6 13 6C12.4477 6 12 5.55228 12 5C12 4.44772 12.4477 4 13 4C13.5523 4 14 4.44772 14 5Z",fill:"currentColor"}),t5("path",{d:"M7 14.5C7 14.7761 6.77614 15 6.5 15C6.22386 15 6 14.7761 6 14.5C6 14.2239 6.22386 14 6.5 14C6.77614 14 7 14.2239 7 14.5Z",fill:"currentColor"}),t5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.50568 2C5.3421 2.86472 7.2262 5.55936 7.2262 5.55936C7.2262 5.55936 9.46444 4.8546 8.50568 2ZM8.18392 9.04897C8.2762 9.00999 10.4875 8.09266 9.73146 5.83961C9.73146 5.83961 7.44868 5.98658 7.88695 8.20409C7.50357 7.3838 6.67771 6.22719 5.00769 5.97769C4.81636 10.3574 8.18392 9.04897 8.18392 9.04897ZM10.7553 8.7229C12.2762 10.9336 10.2521 12.3766 10.2124 12.4053C10.1637 12.4422 7.34909 14.5777 6.08429 10.3662C7.6405 10.1679 8.78512 10.894 9.46972 11.533C8.50084 9.42492 10.7553 8.7229 10.7553 8.7229ZM12.6223 14.128C12.624 14.1293 12.6258 14.1314 12.6275 14.1327C12.5052 14.0931 12.3744 14.0555 12.2366 14.0207C11.2737 13.7786 9.96391 13.7 8.75365 14.4711C8.75095 14.4731 8.74825 14.4745 8.74555 14.4766C12.1674 17.8452 13.6649 14.575 13.6649 14.575C13.7035 14.4991 13.7462 14.4075 13.7879 14.303C14.0796 13.5695 14.3204 12.1852 12.7162 11.0594C12.7162 11.0594 10.8484 12.4402 12.6223 14.128Z",fill:"currentColor"})]});import{jsx as $4,jsxs as x8}from"react/jsx-runtime";var P8=C=>x8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[$4("title",{children:"Lineup"}),$4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0.5C0 0.223858 0.223858 0 0.5 0C2.15685 0 3.5 1.34315 3.5 3C3.5 3.90899 3.09573 4.72356 2.45717 5.27371C3.32824 5.61461 4.05059 6.25211 4.5 7.062C4.89288 6.35398 5.49436 5.7777 6.22144 5.41618C5.48059 4.86992 5 3.99108 5 3C5 1.34315 6.34315 0 8 0C9.65685 0 11 1.34315 11 3C11 3.99108 10.5194 4.86992 9.77856 5.41618C10.5056 5.7777 11.1071 6.35398 11.5 7.062C11.9494 6.25211 12.6718 5.61461 13.5428 5.27371C12.9043 4.72356 12.5 3.90899 12.5 3C12.5 1.34315 13.8431 0 15.5 0C15.7761 0 16 0.223858 16 0.5C16 0.776142 15.7761 1 15.5 1C14.3954 1 13.5 1.89543 13.5 3C13.5 4.10457 14.3954 5 15.5 5C15.7761 5 16 5.22386 16 5.5C16 5.77614 15.7761 6 15.5 6H15C13.3431 6 12 7.34315 12 9V15H15.5C15.7761 15 16 15.2239 16 15.5C16 15.7761 15.7761 16 15.5 16H0.5C0.223858 16 0 15.7761 0 15.5C0 15.2239 0.223858 15 0.5 15H4V9C4 7.34315 2.65685 6 1 6H0.5C0.223858 6 0 5.77614 0 5.5C0 5.22386 0.223858 5 0.5 5C1.60457 5 2.5 4.10457 2.5 3C2.5 1.89543 1.60457 1 0.5 1C0.223858 1 0 0.776142 0 0.5ZM11 15V9C11 7.34315 9.65685 6 8 6C6.34315 6 5 7.34315 5 9V15H11ZM6 3C6 1.89543 6.89543 1 8 1C9.10457 1 10 1.89543 10 3C10 4.10457 9.10457 5 8 5C6.89543 5 6 4.10457 6 3Z",fill:"currentColor"})]});import{jsx as J,jsxs as y8}from"react/jsx-runtime";var b8=C=>y8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[J("title",{children:"LineupSelected"}),J("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3536 7.14645C12.5488 7.34171 12.5488 7.65829 12.3536 7.85355L8.42426 11.7828C8.18995 12.0172 7.81005 12.0172 7.57574 11.7828L6.14645 10.3536C5.95118 10.1583 5.95118 9.84171 6.14645 9.64645C6.34171 9.45118 6.65829 9.45118 6.85355 9.64645L8 10.7929L11.6464 7.14645C11.8417 6.95118 12.1583 6.95118 12.3536 7.14645Z",fill:"currentColor"}),J("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5C9.10457 5 10 4.10457 10 3C10 1.89543 9.10457 1 8 1C6.89543 1 6 1.89543 6 3C6 4.10457 6.89543 5 8 5ZM8 6C9.65685 6 11 4.65685 11 3C11 1.34315 9.65685 0 8 0C6.34315 0 5 1.34315 5 3C5 4.65685 6.34315 6 8 6Z",fill:"currentColor"}),J("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 5.5C0 5.22386 0.223858 5 0.5 5H1C3.20914 5 5 6.79086 5 9V15C5 15.5523 4.55228 16 4 16H0.5C0.223858 16 0 15.7761 0 15.5C0 15.2239 0.223858 15 0.5 15H4V9C4 7.34315 2.65685 6 1 6H0.5C0.223858 6 0 5.77614 0 5.5Z",fill:"currentColor"}),J("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0.5C0 0.223858 0.223858 0 0.5 0V0.5C0.5 0 0.5 0 0.5 0L0.502187 3.8743e-06L0.505481 2.04742e-05L0.515326 0.000121444L0.547575 0.000803143C0.574463 0.00155005 0.611978 0.00299022 0.658616 0.00576624C0.751736 0.0113091 0.882112 0.02223 1.03753 0.0438164C1.34579 0.0866296 1.76556 0.17315 2.19231 0.350962C2.61859 0.528579 3.07269 0.806098 3.42168 1.24234C3.77695 1.68642 4 2.26651 4 3C4 3.73349 3.77695 4.31358 3.42168 4.75766C3.07269 5.1939 2.61859 5.47142 2.19231 5.64904C1.76556 5.82685 1.34579 5.91337 1.03753 5.95618C0.882112 5.97777 0.751736 5.98869 0.658616 5.99423C0.611978 5.99701 0.574463 5.99845 0.547575 5.9992L0.515326 5.99988L0.505481 5.99998L0.502187 6L0.5 6C0.5 6 0.5 6 0.5 5.5V6C0.223858 6 0 5.77614 0 5.5C0 5.22423 0.223257 5.0006 0.498888 5L0.501886 4.99997L0.519808 4.99958C0.536865 4.99911 0.563803 4.99811 0.599197 4.996C0.670139 4.99178 0.774138 4.98317 0.899966 4.96569C1.15421 4.93038 1.48444 4.86065 1.80769 4.72596C2.13141 4.59108 2.42731 4.39985 2.64082 4.13297C2.84805 3.87392 3 3.51651 3 3C3 2.48349 2.84805 2.12608 2.64082 1.86704C2.42731 1.60015 2.13141 1.40892 1.80769 1.27404C1.48444 1.13935 1.15421 1.06962 0.899966 1.03431C0.774138 1.01683 0.670139 1.00822 0.599197 1.004C0.563803 1.00189 0.536865 1.00089 0.519808 1.00042L0.501886 1.00003L0.5 1M0 0.5C0 0.776018 0.224029 0.999798 0.5 1L0 0.5Z",fill:"currentColor"}),J("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 0.5C16 0.77577 15.7767 0.999397 15.5011 0.999999L15.5 1V0.5C15.5 1 15.5011 0.999999 15.5011 0.999999L15.4981 1.00003L15.4802 1.00042C15.4631 1.00089 15.4362 1.00189 15.4008 1.004C15.3299 1.00822 15.2259 1.01683 15.1 1.03431C14.8458 1.06962 14.5156 1.13935 14.1923 1.27404C13.8686 1.40892 13.5727 1.60015 13.3592 1.86704C13.1519 2.12608 13 2.48349 13 3C13 3.51651 13.1519 3.87392 13.3592 4.13297C13.5727 4.39985 13.8686 4.59108 14.1923 4.72596C14.5156 4.86065 14.8458 4.93038 15.1 4.96569C15.2259 4.98317 15.3299 4.99178 15.4008 4.996C15.4362 4.99811 15.4631 4.99911 15.4802 4.99958L15.4981 4.99997L15.5 5V5.5C15.5 6 15.4996 6 15.4996 6L15.4978 6L15.4945 5.99998L15.4847 5.99988L15.4524 5.9992C15.4255 5.99845 15.388 5.99701 15.3414 5.99423C15.2483 5.98869 15.1179 5.97777 14.9625 5.95618C14.6542 5.91337 14.2344 5.82685 13.8077 5.64904C13.3814 5.47142 12.9273 5.1939 12.5783 4.75766C12.2231 4.31358 12 3.73349 12 3C12 2.26651 12.2231 1.68642 12.5783 1.24234C12.9273 0.806098 13.3814 0.528579 13.8077 0.350962C14.2344 0.17315 14.6542 0.0866296 14.9625 0.0438164C15.1179 0.02223 15.2483 0.0113091 15.3414 0.00576624C15.388 0.00299022 15.4255 0.00155005 15.4524 0.000803143L15.4847 0.000121444L15.4945 2.04742e-05L15.4978 3.8743e-06L15.499 8.04663e-07C15.499 8.04663e-07 15.5 0 15.5 0.5L15.499 8.04663e-07C15.7752 8.04663e-07 16 0.223858 16 0.5ZM15.5 5C15.776 5.0002 16 5.22398 16 5.5C16 5.77614 15.7757 6 15.4996 6L15.5 5.5",fill:"currentColor"}),J("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5 5.5C15.5 5 15.5 5 15.5 5L15.4981 4.99997L15.4922 5.00002L15.4733 5.00014C15.4571 5.00027 15.4338 5.00054 15.4043 5.00105C15.3454 5.00209 15.2616 5.00414 15.1597 5.00821C14.9567 5.01633 14.6787 5.03262 14.3823 5.06556C14.0884 5.09822 13.763 5.14865 13.47 5.22856C13.1975 5.30288 12.8691 5.42377 12.6464 5.64645C12.4512 5.84171 12.4512 6.15829 12.6464 6.35355C12.8417 6.54882 13.1583 6.54882 13.3536 6.35355C13.3809 6.32623 13.49 6.25962 13.7331 6.19332C13.9558 6.1326 14.2241 6.08928 14.4927 6.05944C14.7588 6.02988 15.0121 6.01492 15.1997 6.00741C15.2931 6.00367 15.3694 6.00182 15.4219 6.0009C15.4481 6.00044 15.4682 6.00022 15.4815 6.00011L15.4963 6.00001L15.4996 6M15.4996 6C15.7757 6 16 5.77614 16 5.5L15.4996 6ZM16 5.5C16 5.22398 15.776 5.0002 15.5 5L16 5.5ZM15.5 5V5.5V5ZM11.5 10C11.7761 10 12 10.2239 12 10.5V15H15.5C15.7761 15 16 15.2239 16 15.5C16 15.7761 15.7761 16 15.5 16H12C11.4477 16 11 15.5523 11 15V10.5C11 10.2239 11.2239 10 11.5 10Z",fill:"currentColor"}),J("path",{d:"M5 9C5 7.34315 6.34315 6 8 6C8.29489 6 8.7692 6.04556 9.2041 6.17824C9.66225 6.31801 9.94824 6.51451 10.0528 6.72361C10.1763 6.9706 10.4766 7.07071 10.7236 6.94721C10.9706 6.82372 11.0707 6.52338 10.9472 6.27639C10.6518 5.68549 10.0211 5.38199 9.4959 5.22176C8.94747 5.05444 8.37178 5 8 5C5.79086 5 4 6.79086 4 9V15C4 15.5523 4.44772 16 5 16H11C11.5523 16 12 15.5523 12 15V10.5C12 10.2239 11.7761 10 11.5 10C11.2239 10 11 10.2239 11 10.5V15L5 15V9Z",fill:"currentColor"})]});import{jsx as r5,jsxs as B8}from"react/jsx-runtime";var I8=C=>B8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[r5("title",{children:"Medal"}),r5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C10.2091 15 12 13.2091 12 11C12 8.79086 10.2091 7 8 7C5.79086 7 4 8.79086 4 11C4 13.2091 5.79086 15 8 15ZM8 16C10.7614 16 13 13.7614 13 11C13 8.23858 10.7614 6 8 6C5.23858 6 3 8.23858 3 11C3 13.7614 5.23858 16 8 16Z",fill:"currentColor"}),r5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 1C2 0.447715 2.44772 0 3 0H5C5.55228 0 6 0.447715 6 1V7L5.14645 7.35355L2.29289 4.5C2.10536 4.31246 2 4.05811 2 3.79289V1ZM5 1H3V3.79289L5 5.79289V1Z",fill:"currentColor"}),r5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 1C10 0.447715 10.4477 0 11 0H13C13.5523 0 14 0.447715 14 1V3.31504C14 3.55375 13.9146 3.78459 13.7593 3.96583L10.8796 7.3254L10 7V1ZM13 1H11V5.64837L13 3.31504V1Z",fill:"currentColor"}),r5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 0.5C3.5 0.223858 3.72386 0 4 0H12C12.2761 0 12.5 0.223858 12.5 0.5C12.5 0.776142 12.2761 1 12 1H4C3.72386 1 3.5 0.776142 3.5 0.5Z",fill:"currentColor"})]});import{jsx as i5,jsxs as E8}from"react/jsx-runtime";var k8=C=>E8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[i5("title",{children:"MultipleEntry"}),i5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0.5C8 0.223858 8.22386 1.49012e-08 8.5 1.49012e-08H14.5C15.3284 1.49012e-08 16 0.671573 16 1.5V14.5C16 15.3284 15.3284 16 14.5 16H8.5C8.22386 16 8 15.7761 8 15.5C8 15.2239 8.22386 15 8.5 15H14.5C14.7761 15 15 14.7761 15 14.5V1.5C15 1.22386 14.7761 1 14.5 1H8.5C8.22386 1 8 0.776142 8 0.5Z",fill:"currentColor"}),i5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.14157 4.64646C8.33683 4.45119 8.65341 4.45118 8.84868 4.64644L11.8489 7.64644C11.9426 7.74021 11.9953 7.86739 11.9953 8C11.9953 8.13261 11.9426 8.2598 11.8489 8.35356L8.84868 11.3536C8.65341 11.5488 8.33683 11.5488 8.14157 11.3535C7.94631 11.1583 7.94632 10.8417 8.14159 10.6464L10.2882 8.5H0.5C0.223858 8.5 0 8.27614 0 8C0 7.72386 0.223858 7.5 0.5 7.5H10.2882L8.14159 5.35356C7.94632 5.15831 7.94631 4.84173 8.14157 4.64646Z",fill:"currentColor"}),i5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.64645 0.146447C4.84171 -0.0488155 5.15829 -0.0488155 5.35355 0.146447L6.85355 1.64645C7.04882 1.84171 7.04882 2.15829 6.85355 2.35355L5.35355 3.85355C5.15829 4.04882 4.84171 4.04882 4.64645 3.85355C4.45118 3.65829 4.45118 3.34171 4.64645 3.14645L5.29289 2.5H0.5C0.223858 2.5 0 2.27614 0 2C0 1.72386 0.223858 1.5 0.5 1.5H5.29289L4.64645 0.853553C4.45118 0.658291 4.45118 0.341709 4.64645 0.146447Z",fill:"currentColor"}),i5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.64645 12.1464C4.84171 11.9512 5.15829 11.9512 5.35355 12.1464L6.85355 13.6464C7.04882 13.8417 7.04882 14.1583 6.85355 14.3536L5.35355 15.8536C5.15829 16.0488 4.84171 16.0488 4.64645 15.8536C4.45118 15.6583 4.45118 15.3417 4.64645 15.1464L5.29289 14.5H0.5C0.223858 14.5 0 14.2761 0 14C0 13.7239 0.223858 13.5 0.5 13.5H5.29289L4.64645 12.8536C4.45118 12.6583 4.45118 12.3417 4.64645 12.1464Z",fill:"currentColor"})]});import{jsx as Z,jsxs as A8}from"react/jsx-runtime";var F8=C=>A8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Z("title",{children:"ParlayConflict"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 1H7V4H15V1ZM7 0C6.44772 0 6 0.447715 6 1V4C6 4.55228 6.44772 5 7 5H15C15.5523 5 16 4.55228 16 4V1C16 0.447715 15.5523 0 15 0H7Z",fill:"currentColor"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 5.5C11.2761 5.5 11.5 5.72386 11.5 6V10C11.5 10.2761 11.2761 10.5 11 10.5C10.7239 10.5 10.5 10.2761 10.5 10V6C10.5 5.72386 10.7239 5.5 11 5.5Z",fill:"currentColor"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.146447 6.14645C0.341709 5.95118 0.658291 5.95118 0.853553 6.14645L2.85355 8.14645C3.04882 8.34171 3.04882 8.65829 2.85355 8.85355C2.65829 9.04882 2.34171 9.04882 2.14645 8.85355L0.146447 6.85355C-0.0488155 6.65829 -0.0488155 6.34171 0.146447 6.14645Z",fill:"currentColor"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 12H7V15H15V12ZM7 11C6.44772 11 6 11.4477 6 12V15C6 15.5523 6.44772 16 7 16H15C15.5523 16 16 15.5523 16 15V12C16 11.4477 15.5523 11 15 11H7Z",fill:"currentColor"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 2.5C8 2.22386 8.22386 2 8.5 2H13.5C13.7761 2 14 2.22386 14 2.5C14 2.77614 13.7761 3 13.5 3H8.5C8.22386 3 8 2.77614 8 2.5Z",fill:"currentColor"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 13.5C8 13.2239 8.22386 13 8.5 13H13.5C13.7761 13 14 13.2239 14 13.5C14 13.7761 13.7761 14 13.5 14H8.5C8.22386 14 8 13.7761 8 13.5Z",fill:"currentColor"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.85355 6.14645C3.04882 6.34171 3.04882 6.65829 2.85355 6.85355L0.853553 8.85355C0.658291 9.04882 0.341709 9.04882 0.146447 8.85355C-0.0488155 8.65829 -0.0488155 8.34171 0.146447 8.14645L2.14645 6.14645C2.34171 5.95118 2.65829 5.95118 2.85355 6.14645Z",fill:"currentColor"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 2.6C1 2.26863 1.26863 2 1.6 2H6.5C6.77614 2 7 2.22386 7 2.5C7 2.77614 6.77614 3 6.5 3H2V4.5C2 4.77614 1.77614 5 1.5 5C1.22386 5 1 4.77614 1 4.5V2.6Z",fill:"currentColor"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 10C1.77614 10 2 10.2239 2 10.5V13H6.5C6.77614 13 7 13.2239 7 13.5C7 13.7761 6.77614 14 6.5 14H1.6C1.26863 14 1 13.7314 1 13.4V10.5C1 10.2239 1.22386 10 1.5 10Z",fill:"currentColor"})]});import{jsx as j4,jsxs as T8}from"react/jsx-runtime";var D8=C=>T8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[j4("title",{children:"Player"}),j4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.1273 7.38804C11.2523 6.68015 12 5.42739 12 4C12 1.79086 10.2091 0 8 0C5.79086 0 4 1.79086 4 4C4 5.42739 4.74765 6.68015 5.87271 7.38804C3.60905 8.24657 2 10.4354 2 13V13.6538C2 14.9496 3.05041 16 4.34615 16H11.6538C12.9496 16 14 14.9496 14 13.6538V13C14 10.4354 12.3909 8.24658 10.1273 7.38804ZM5 4C5 2.34315 6.34315 1 8 1C9.65685 1 11 2.34315 11 4C11 5.65685 9.65685 7 8 7C6.34315 7 5 5.65685 5 4ZM8 8C5.23858 8 3 10.2386 3 13V13.6538C3 14.3973 3.60269 15 4.34615 15H11.6538C12.3973 15 13 14.3973 13 13.6538V13C13 10.2386 10.7614 8 8 8Z",fill:"currentColor"})]});import{jsx as k5,jsxs as W8}from"react/jsx-runtime";var _8=C=>W8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[k5("title",{children:"PlayerAdd"}),k5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 8C10.2091 8 12 6.20914 12 4C12 1.79086 10.2091 0 8 0C5.79086 0 4 1.79086 4 4C4 5.42739 4.74765 6.68015 5.87271 7.38804C3.60905 8.24657 2 10.4354 2 13V13.6538C2 14.9496 3.05041 16 4.34615 16L8 16C8.27614 16 8.5 15.7761 8.5 15.5C8.5 15.2239 8.27614 15 8 15L4.34615 15C3.60269 15 3 14.3973 3 13.6538V13C3 10.2386 5.23858 8 8 8ZM5 4C5 2.34315 6.34315 1 8 1C9.65685 1 11 2.34315 11 4C11 5.65685 9.65685 7 8 7C6.34315 7 5 5.65685 5 4Z",fill:"currentColor"}),k5("path",{d:"M12 10C12.2209 10 12.4 10.1791 12.4 10.4V11.6H13.6C13.8209 11.6 14 11.7791 14 12C14 12.2209 13.8209 12.4 13.6 12.4H12.4V13.6C12.4 13.8209 12.2209 14 12 14C11.7791 14 11.6 13.8209 11.6 13.6V12.4H10.4C10.1791 12.4 10 12.2209 10 12C10 11.7791 10.1791 11.6 10.4 11.6H11.6V10.4C11.6 10.1791 11.7791 10 12 10Z",fill:"currentColor"}),k5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",fill:"currentColor"})]});import{jsx as n1,jsxs as N8}from"react/jsx-runtime";var O8=C=>N8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[n1("title",{children:"RacingBetslip"}),n1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 13.6315C2 14.0308 2.44507 14.269 2.77735 14.0475L3.83788 13.3405C4.20402 13.0964 4.65889 13.0254 5.08201 13.1463L7.86264 13.9407C7.95242 13.9664 8.04758 13.9664 8.13736 13.9407L10.918 13.1463C11.3411 13.0254 11.796 13.0964 12.1621 13.3405L13.2227 14.0475C13.5549 14.269 14 14.0308 14 13.6315L14 1.5C14 1.22386 13.7761 1 13.5 1L2.5 1C2.22386 1 2 1.22386 2 1.5L2 13.6315ZM3.33205 14.8796C2.33522 15.5441 1 14.8295 1 13.6315L1 1.5C1 0.671573 1.67157 -7.24234e-08 2.5 0L13.5 9.61651e-07C14.3284 1.03407e-06 15 0.671574 15 1.5L15 13.6315C15 14.8295 13.6648 15.5441 12.6679 14.8796L11.6074 14.1725C11.4854 14.0912 11.3338 14.0675 11.1927 14.1078L8.41208 14.9023C8.14275 14.9792 7.85725 14.9792 7.58792 14.9023L4.80729 14.1078C4.66625 14.0675 4.51462 14.0912 4.39258 14.1725L3.33205 14.8796Z",fill:"currentColor"}),n1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 10.5C12 10.7761 11.7761 11 11.5 11L4.5 11C4.22386 11 4 10.7761 4 10.5C4 10.2239 4.22386 10 4.5 10L11.5 10C11.7761 10 12 10.2239 12 10.5Z",fill:"currentColor"}),n1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 7.5C12 7.77614 11.7761 8 11.5 8H8.5C8.22386 8 8 7.77614 8 7.5C8 7.22386 8.22386 7 8.5 7H11.5C11.7761 7 12 7.22386 12 7.5Z",fill:"currentColor"}),n1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7.5C6 7.77614 5.77614 8 5.5 8H4.5C4.22386 8 4 7.77614 4 7.5C4 7.22386 4.22386 7 4.5 7H5.5C5.77614 7 6 7.22386 6 7.5Z",fill:"currentColor"}),n1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5C12 4.77614 11.7761 5 11.5 5H8.5C8.22386 5 8 4.77614 8 4.5C8 4.22386 8.22386 4 8.5 4H11.5C11.7761 4 12 4.22386 12 4.5Z",fill:"currentColor"}),n1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4.5C6 4.77614 5.77614 5 5.5 5H4.5C4.22386 5 4 4.77614 4 4.5C4 4.22386 4.22386 4 4.5 4H5.5C5.77614 4 6 4.22386 6 4.5Z",fill:"currentColor"})]});import{jsx as v1,jsxs as J8}from"react/jsx-runtime";var U8=C=>J8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[v1("title",{children:"RacingBetslipAccountHistory"}),v1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 13.6315C2 14.0308 2.44507 14.269 2.77735 14.0475L3.83788 13.3405C4.20402 13.0964 4.65889 13.0254 5.08201 13.1463L6.38736 13.5192C6.65288 13.5951 6.80662 13.8718 6.73076 14.1374C6.6549 14.4029 6.37816 14.5566 6.11264 14.4808L4.80729 14.1078C4.66625 14.0675 4.51462 14.0912 4.39258 14.1725L3.33205 14.8796C2.33522 15.5441 1 14.8295 1 13.6315L1 1.5C1 0.671573 1.67157 -7.24234e-08 2.5 0L13.5 9.61651e-07C14.3284 1.03407e-06 15 0.671571 15 1.5L15 5.5C15 5.77614 14.7762 6 14.5 6C14.2239 6 14 5.77614 14 5.5L14 1.5C14 1.22386 13.7761 1 13.5 1L2.5 1C2.22386 1 2 1.22386 2 1.5L2 13.6315Z",fill:"currentColor"}),v1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7.5C6 7.77614 5.77614 8 5.5 8H4.5C4.22386 8 4 7.77614 4 7.5C4 7.22386 4.22386 7 4.5 7H5.5C5.77614 7 6 7.22386 6 7.5Z",fill:"currentColor"}),v1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5C12 4.77614 11.7761 5 11.5 5H8.5C8.22386 5 8 4.77614 8 4.5C8 4.22386 8.22386 4 8.5 4H11.5C11.7761 4 12 4.22386 12 4.5Z",fill:"currentColor"}),v1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4.5C6 4.77614 5.77614 5 5.5 5H4.5C4.22386 5 4 4.77614 4 4.5C4 4.22386 4.22386 4 4.5 4H5.5C5.77614 4 6 4.22386 6 4.5Z",fill:"currentColor"}),v1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5015 7C8.56955 7 7.00305 8.56682 7.00305 10.5C7.00305 12.4332 8.56955 14 10.5015 14C12.4335 14 14 12.4332 14 10.5C14 8.56682 12.4335 7 10.5015 7ZM6.00305 10.5C6.00305 8.0149 8.01691 6 10.5015 6C12.9861 6 15 8.0149 15 10.5C15 12.9851 12.9861 15 10.5015 15C8.01691 15 6.00305 12.9851 6.00305 10.5ZM10.3628 8.75C10.6389 8.75 10.8628 8.97386 10.8628 9.25V10.7591L12.0652 11.293C12.3175 11.4051 12.4313 11.7006 12.3192 11.9529C12.2071 12.2053 11.9117 12.319 11.6593 12.207L10.1598 11.5411C9.97921 11.4609 9.86279 11.2818 9.86279 11.0841V9.25C9.86279 8.97386 10.0866 8.75 10.3628 8.75Z",fill:"currentColor"})]});import{jsx as K,jsxs as q8}from"react/jsx-runtime";var K8=C=>q8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[K("title",{children:"RacingBetslipCancel"}),K("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 13.6315C2 14.0308 2.44507 14.269 2.77735 14.0475L3.83788 13.3405C4.20402 13.0964 4.65889 13.0254 5.08201 13.1463L6.38736 13.5192C6.65288 13.5951 6.80662 13.8718 6.73076 14.1374C6.6549 14.4029 6.37816 14.5566 6.11264 14.4808L4.80729 14.1078C4.66625 14.0675 4.51462 14.0912 4.39258 14.1725L3.33205 14.8796C2.33522 15.5441 1 14.8295 1 13.6315L1 1.5C1 0.671573 1.67157 -7.24234e-08 2.5 0L13.5 9.61651e-07C14.3284 1.03407e-06 15 0.671574 15 1.5L15 7.5C15 7.77614 14.7761 8 14.5 8C14.2239 8 14 7.77614 14 7.5L14 1.5C14 1.22386 13.7761 1 13.5 1L2.5 1C2.22386 1 2 1.22386 2 1.5L2 13.6315Z",fill:"currentColor"}),K("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 10.5C8 10.7761 7.77614 11 7.5 11H4.5C4.22386 11 4 10.7761 4 10.5C4 10.2239 4.22386 10 4.5 10H7.5C7.77614 10 8 10.2239 8 10.5Z",fill:"currentColor"}),K("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 7.5C12 7.77614 11.7761 8 11.5 8H8.5C8.22386 8 8 7.77614 8 7.5C8 7.22386 8.22386 7 8.5 7H11.5C11.7761 7 12 7.22386 12 7.5Z",fill:"currentColor"}),K("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7.5C6 7.77614 5.77614 8 5.5 8H4.5C4.22386 8 4 7.77614 4 7.5C4 7.22386 4.22386 7 4.5 7H5.5C5.77614 7 6 7.22386 6 7.5Z",fill:"currentColor"}),K("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5C12 4.77614 11.7761 5 11.5 5H8.5C8.22386 5 8 4.77614 8 4.5C8 4.22386 8.22386 4 8.5 4H11.5C11.7761 4 12 4.22386 12 4.5Z",fill:"currentColor"}),K("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4.5C6 4.77614 5.77614 5 5.5 5H4.5C4.22386 5 4 4.77614 4 4.5C4 4.22386 4.22386 4 4.5 4H5.5C5.77614 4 6 4.22386 6 4.5Z",fill:"currentColor"}),K("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.14647 9.14644C9.34174 8.95117 9.65832 8.95117 9.85358 9.14644L12 11.2929L14.1465 9.14644C14.3417 8.95117 14.6583 8.95117 14.8536 9.14644C15.0488 9.3417 15.0488 9.65828 14.8536 9.85354L12.7071 12L14.8536 14.1464C15.0488 14.3417 15.0488 14.6583 14.8536 14.8535C14.6583 15.0488 14.3417 15.0488 14.1465 14.8535L12 12.7071L9.85358 14.8535C9.65832 15.0488 9.34174 15.0488 9.14647 14.8535C8.95121 14.6583 8.95121 14.3417 9.14647 14.1464L11.2929 12L9.14647 9.85354C8.95121 9.65828 8.95121 9.3417 9.14647 9.14644Z",fill:"currentColor"})]});import{jsx as q,jsxs as X8}from"react/jsx-runtime";var z8=C=>X8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[q("title",{children:"RacingBetslipRefund"}),q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 13.6315C2 14.0308 2.44507 14.269 2.77735 14.0475L3.83788 13.3405C4.20402 13.0964 4.65889 13.0254 5.08201 13.1463L6.38736 13.5192C6.65288 13.5951 6.80662 13.8718 6.73076 14.1374C6.6549 14.4029 6.37816 14.5566 6.11264 14.4808L4.80729 14.1078C4.66625 14.0675 4.51462 14.0912 4.39258 14.1725L3.33205 14.8796C2.33522 15.5441 1 14.8295 1 13.6315L1 1.5C1 0.671573 1.67157 -7.24234e-08 2.5 0L13.5 9.61651e-07C14.3284 1.03407e-06 15 0.671574 15 1.5L15 7.5C15 7.77614 14.7761 8 14.5 8C14.2239 8 14 7.77614 14 7.5L14 1.5C14 1.22386 13.7761 1 13.5 1L2.5 1C2.22386 1 2 1.22386 2 1.5L2 13.6315Z",fill:"currentColor"}),q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 10.5C8 10.7761 7.77614 11 7.5 11H4.5C4.22386 11 4 10.7761 4 10.5C4 10.2239 4.22386 10 4.5 10H7.5C7.77614 10 8 10.2239 8 10.5Z",fill:"currentColor"}),q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 7.5C12 7.77614 11.7761 8 11.5 8H8.5C8.22386 8 8 7.77614 8 7.5C8 7.22386 8.22386 7 8.5 7H11.5C11.7761 7 12 7.22386 12 7.5Z",fill:"currentColor"}),q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7.5C6 7.77614 5.77614 8 5.5 8H4.5C4.22386 8 4 7.77614 4 7.5C4 7.22386 4.22386 7 4.5 7H5.5C5.77614 7 6 7.22386 6 7.5Z",fill:"currentColor"}),q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5C12 4.77614 11.7761 5 11.5 5H8.5C8.22386 5 8 4.77614 8 4.5C8 4.22386 8.22386 4 8.5 4H11.5C11.7761 4 12 4.22386 12 4.5Z",fill:"currentColor"}),q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4.5C6 4.77614 5.77614 5 5.5 5H4.5C4.22386 5 4 4.77614 4 4.5C4 4.22386 4.22386 4 4.5 4H5.5C5.77614 4 6 4.22386 6 4.5Z",fill:"currentColor"}),q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.8536 9.14639C12.0488 9.34165 12.0488 9.65824 11.8536 9.8535L10.2071 11.4999H14.5C14.7761 11.4999 15 11.7238 15 11.9999C15 12.2761 14.7761 12.4999 14.5 12.4999H10.2071L11.8536 14.1464C12.0488 14.3417 12.0488 14.6582 11.8536 14.8535C11.6583 15.0488 11.3417 15.0488 11.1464 14.8535L8.64645 12.3535C8.45119 12.1582 8.45119 11.8417 8.64645 11.6464L11.1464 9.14639C11.3417 8.95113 11.6583 8.95113 11.8536 9.14639Z",fill:"currentColor"})]});import{jsx as z,jsxs as Q8}from"react/jsx-runtime";var Y8=C=>Q8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[z("title",{children:"RacingBetslipSuccess"}),z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 13.6315C2 14.0308 2.44507 14.269 2.77735 14.0475L3.83788 13.3405C4.20402 13.0964 4.65889 13.0254 5.08201 13.1463L6.38736 13.5192C6.65288 13.5951 6.80662 13.8718 6.73076 14.1374C6.6549 14.4029 6.37816 14.5566 6.11264 14.4808L4.80729 14.1078C4.66625 14.0675 4.51462 14.0912 4.39258 14.1725L3.33205 14.8796C2.33522 15.5441 1 14.8295 1 13.6315L1 1.5C1 0.671573 1.67157 -7.24234e-08 2.5 0L13.5 9.61651e-07C14.3284 1.03407e-06 15 0.671574 15 1.5L15 7.5C15 7.77614 14.7761 8 14.5 8C14.2239 8 14 7.77614 14 7.5L14 1.5C14 1.22386 13.7761 1 13.5 1L2.5 1C2.22386 1 2 1.22386 2 1.5L2 13.6315Z",fill:"currentColor"}),z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 10.5C8 10.7761 7.77614 11 7.5 11H4.5C4.22386 11 4 10.7761 4 10.5C4 10.2239 4.22386 10 4.5 10H7.5C7.77614 10 8 10.2239 8 10.5Z",fill:"currentColor"}),z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 7.5C12 7.77614 11.7761 8 11.5 8H8.5C8.22386 8 8 7.77614 8 7.5C8 7.22386 8.22386 7 8.5 7H11.5C11.7761 7 12 7.22386 12 7.5Z",fill:"currentColor"}),z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7.5C6 7.77614 5.77614 8 5.5 8H4.5C4.22386 8 4 7.77614 4 7.5C4 7.22386 4.22386 7 4.5 7H5.5C5.77614 7 6 7.22386 6 7.5Z",fill:"currentColor"}),z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5C12 4.77614 11.7761 5 11.5 5H8.5C8.22386 5 8 4.77614 8 4.5C8 4.22386 8.22386 4 8.5 4H11.5C11.7761 4 12 4.22386 12 4.5Z",fill:"currentColor"}),z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4.5C6 4.77614 5.77614 5 5.5 5H4.5C4.22386 5 4 4.77614 4 4.5C4 4.22386 4.22386 4 4.5 4H5.5C5.77614 4 6 4.22386 6 4.5Z",fill:"currentColor"}),z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8536 10.1464C15.0488 10.3417 15.0488 10.6583 14.8536 10.8536L10.8536 14.8536C10.6583 15.0488 10.3417 15.0488 10.1464 14.8536L8.14645 12.8536C7.95119 12.6583 7.95119 12.3417 8.14645 12.1464C8.34171 11.9512 8.65829 11.9512 8.85355 12.1464L10.5 13.7929L14.1464 10.1464C14.3417 9.95119 14.6583 9.95119 14.8536 10.1464Z",fill:"currentColor"})]});import{jsx as E5,jsxs as j8}from"react/jsx-runtime";var $8=C=>j8("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[E5("title",{children:"ResponsibleGambling"}),E5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),E5("path",{d:"M10.6 5C11.0678 5 11.4523 5.29744 11.4959 5.67777L11.5 5.75V6.25C11.5 6.38807 11.3657 6.5 11.2 6.5C11.0527 6.5 10.9302 6.41156 10.9048 6.29494L10.9 6.25V5.75C10.9 5.62727 10.7939 5.5252 10.6539 5.50403L10.6 5.5H9.4C9.25272 5.5 9.13023 5.58844 9.10483 5.70506L9.1 5.75V10.25C9.1 10.3727 9.20613 10.4748 9.34608 10.496L9.4 10.5H10.6C10.7473 10.5 10.8698 10.4116 10.8952 10.2949L10.9 10.25V8.25H10.3C10.1527 8.25 10.0302 8.16156 10.0048 8.04494L10 8C10 7.87727 10.1061 7.7752 10.2461 7.75403L10.3 7.75H11.14C11.3189 7.75 11.4674 7.8588 11.4953 8.00134L11.5 8.05V10.25C11.5 10.6398 11.1431 10.9602 10.6867 10.9966L10.6 11H9.4C8.93218 11 8.54773 10.7026 8.50412 10.3222L8.5 10.25V5.75C8.5 5.36015 8.85693 5.03978 9.31332 5.00343L9.4 5H10.6Z",fill:"currentColor"}),E5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.49586 5.67777C7.45225 5.29744 7.0678 5 6.59999 5H4.86L4.8016 5.00393C4.63055 5.02718 4.5 5.15088 4.5 5.3V10.75L4.50483 10.7949C4.53023 10.9115 4.65272 11 4.8 11C4.96568 11 5.1 10.8881 5.1 10.75V8.76899L6.95736 10.897L6.99299 10.931C7.09584 11.0129 7.25733 11.0244 7.37643 10.9522C7.51043 10.871 7.54005 10.7146 7.4426 10.6029L5.38919 8.24999H6.59999L6.68666 8.24656C7.14305 8.21022 7.5 7.88984 7.5 7.49999V5.75L7.49586 5.67777ZM5.09961 5.50003H6.5996L6.65352 5.50406C6.79347 5.52523 6.8996 5.6273 6.8996 5.75003V7.50002L6.89476 7.54496C6.86936 7.66159 6.74687 7.75002 6.5996 7.75002H5.09961V5.50003Z",fill:"currentColor"})]});import{jsx as F5,jsxs as e9}from"react/jsx-runtime";var C9=C=>e9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[F5("title",{children:"ResponsiblePlay"}),F5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),F5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.49586 5.67777C7.45225 5.29744 7.0678 5 6.59999 5H4.86L4.8016 5.00393C4.63055 5.02718 4.5 5.15088 4.5 5.3V10.75L4.50483 10.7949C4.53023 10.9115 4.65272 11 4.8 11C4.96568 11 5.1 10.8881 5.1 10.75V8.76899L6.95736 10.897L6.99299 10.931C7.09584 11.0129 7.25733 11.0244 7.37643 10.9522C7.51043 10.871 7.54005 10.7146 7.4426 10.6029L5.38919 8.24999H6.59999L6.68666 8.24656C7.14305 8.21022 7.5 7.88984 7.5 7.49999V5.75L7.49586 5.67777ZM5.09961 5.50003H6.5996L6.65352 5.50406C6.79347 5.52523 6.8996 5.6273 6.8996 5.75003V7.50002L6.89476 7.54496C6.86936 7.66159 6.74687 7.75002 6.5996 7.75002H5.09961V5.50003Z",fill:"currentColor"}),F5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4959 5.67777C11.4523 5.29744 11.0678 5 10.6 5H8.86L8.80161 5.00393C8.63055 5.02718 8.5 5.15088 8.5 5.3V10.75L8.50483 10.7949C8.53023 10.9116 8.65272 11 8.8 11C8.96569 11 9.1 10.8881 9.1 10.75V8.25H10.6L10.6867 8.24657C11.1431 8.21022 11.5 7.88985 11.5 7.5V5.75L11.4959 5.67777ZM9.09961 5.50002H10.5996L10.6535 5.50405C10.7935 5.52522 10.8996 5.62729 10.8996 5.75002V7.50002L10.8948 7.54496C10.8694 7.66159 10.7469 7.75002 10.5996 7.75002H9.09961V5.50002Z",fill:"currentColor"})]});import{jsx as S,jsxs as l9}from"react/jsx-runtime";var o9=C=>l9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[S("title",{children:"Rules"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 1H5V2H11V1ZM5 0C4.44772 0 4 0.447715 4 1V2C4 2.55228 4.44772 3 5 3H11C11.5523 3 12 2.55228 12 2V1C12 0.447715 11.5523 0 11 0H5Z",fill:"currentColor"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 13C5.77614 13 6 12.7761 6 12.5C6 12.2239 5.77614 12 5.5 12C5.22386 12 5 12.2239 5 12.5C5 12.7761 5.22386 13 5.5 13ZM5.5 14C6.32843 14 7 13.3284 7 12.5C7 11.6716 6.32843 11 5.5 11C4.67157 11 4 11.6716 4 12.5C4 13.3284 4.67157 14 5.5 14Z",fill:"currentColor"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.14645 4.14645C4.34171 3.95118 4.65829 3.95118 4.85355 4.14645L6.85355 6.14645C7.04882 6.34171 7.04882 6.65829 6.85355 6.85355C6.65829 7.04882 6.34171 7.04882 6.14645 6.85355L4.14645 4.85355C3.95118 4.65829 3.95118 4.34171 4.14645 4.14645Z",fill:"currentColor"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.85355 4.14645C7.04882 4.34171 7.04882 4.65829 6.85355 4.85355L4.85355 6.85355C4.65829 7.04882 4.34171 7.04882 4.14645 6.85355C3.95118 6.65829 3.95118 6.34171 4.14645 6.14645L6.14645 4.14645C6.34171 3.95118 6.65829 3.95118 6.85355 4.14645Z",fill:"currentColor"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 2.5C2 1.67157 2.67157 1 3.5 1H4.5C4.77614 1 5 1.22386 5 1.5C5 1.77614 4.77614 2 4.5 2H3.5C3.22386 2 3 2.22386 3 2.5V14.5C3 14.7761 3.22386 15 3.5 15H12.5C12.7761 15 13 14.7761 13 14.5V2.5C13 2.22386 12.7761 2 12.5 2H11.5C11.2239 2 11 1.77614 11 1.5C11 1.22386 11.2239 1 11.5 1H12.5C13.3284 1 14 1.67157 14 2.5V14.5C14 15.3284 13.3284 16 12.5 16H3.5C2.67157 16 2 15.3284 2 14.5V2.5Z",fill:"currentColor"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0757 4.21716C10.3101 3.98284 10.6899 3.98284 10.9243 4.21716L11.8536 5.14645C12.0488 5.34171 12.0488 5.65829 11.8536 5.85355C11.6583 6.04882 11.3417 6.04882 11.1464 5.85355L10.5 5.20711L9.85355 5.85355C9.65829 6.04882 9.34171 6.04882 9.14645 5.85355C8.95118 5.65829 8.95118 5.34171 9.14645 5.14645L10.0757 4.21716Z",fill:"currentColor"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 4C10.7761 4 11 4.22386 11 4.5V6.5C11 7.88071 9.88071 9 8.5 9H7.5C6.67157 9 6 9.67157 6 10.5V11.5C6 11.7761 5.77614 12 5.5 12C5.22386 12 5 11.7761 5 11.5V10.5C5 9.11929 6.11929 8 7.5 8H8.5C9.32843 8 10 7.32843 10 6.5V4.5C10 4.22386 10.2239 4 10.5 4Z",fill:"currentColor"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.14645 11.1464C9.34171 10.9512 9.65829 10.9512 9.85355 11.1464L11.8536 13.1464C12.0488 13.3417 12.0488 13.6583 11.8536 13.8536C11.6583 14.0488 11.3417 14.0488 11.1464 13.8536L9.14645 11.8536C8.95118 11.6583 8.95118 11.3417 9.14645 11.1464Z",fill:"currentColor"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.8536 11.1464C12.0488 11.3417 12.0488 11.6583 11.8536 11.8536L9.85355 13.8536C9.65829 14.0488 9.34171 14.0488 9.14645 13.8536C8.95118 13.6583 8.95118 13.3417 9.14645 13.1464L11.1464 11.1464C11.3417 10.9512 11.6583 10.9512 11.8536 11.1464Z",fill:"currentColor"})]});import{jsx as A2,jsxs as r9}from"react/jsx-runtime";var t9=C=>r9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[A2("title",{children:"Scores"}),A2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 3H1V6H15V3ZM1 2C0.447715 2 0 2.44772 0 3V6C0 6.55228 0.447715 7 1 7H15C15.5523 7 16 6.55228 16 6V3C16 2.44772 15.5523 2 15 2H1Z",fill:"currentColor"}),A2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 10H1V13H15V10ZM1 9C0.447715 9 0 9.44772 0 10V13C0 13.5523 0.447715 14 1 14H15C15.5523 14 16 13.5523 16 13V10C16 9.44772 15.5523 9 15 9H1Z",fill:"currentColor"})]});import{jsx as D2,jsxs as n9}from"react/jsx-runtime";var i9=C=>n9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[D2("title",{children:"SingleEntry"}),D2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0.5C8 0.223858 8.22386 0 8.5 0H14.5C15.3284 0 16 0.671573 16 1.5V14.5C16 15.3284 15.3284 16 14.5 16H8.5C8.22386 16 8 15.7761 8 15.5C8 15.2239 8.22386 15 8.5 15H14.5C14.7761 15 15 14.7761 15 14.5V1.5C15 1.22386 14.7761 1 14.5 1H8.5C8.22386 1 8 0.776142 8 0.5Z",fill:"currentColor"}),D2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.14157 4.64646C8.33683 4.45119 8.65341 4.45118 8.84868 4.64644L11.8489 7.64644C11.9426 7.7402 11.9953 7.86739 11.9953 8C11.9953 8.13261 11.9426 8.2598 11.8489 8.35356L8.84868 11.3536C8.65341 11.5488 8.33683 11.5488 8.14157 11.3535C7.94631 11.1583 7.94632 10.8417 8.14159 10.6464L10.2882 8.5H0.5C0.223858 8.5 0 8.27614 0 8C0 7.72386 0.223858 7.5 0.5 7.5H10.2882L8.14159 5.35356C7.94632 5.15831 7.94631 4.84173 8.14157 4.64646Z",fill:"currentColor"})]});import{jsx as m,jsxs as p9}from"react/jsx-runtime";var d9=C=>p9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[m("title",{children:"StatsSwitcher"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.5 2C0.776142 2 1 2.22386 1 2.5V13.5C1 13.7761 0.776142 14 0.5 14C0.223858 14 0 13.7761 0 13.5V2.5C0 2.22386 0.223858 2 0.5 2Z",fill:"currentColor"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 1C2.77614 1 3 1.22386 3 1.5V14.5C3 14.7761 2.77614 15 2.5 15C2.22386 15 2 14.7761 2 14.5V1.5C2 1.22386 2.22386 1 2.5 1Z",fill:"currentColor"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 1.5C4 0.671573 4.67157 0 5.5 0H14.5C15.3284 0 16 0.671573 16 1.5V14.5C16 15.3284 15.3284 16 14.5 16H5.5C4.67157 16 4 15.3284 4 14.5V1.5ZM5.5 1C5.22386 1 5 1.22386 5 1.5V14.5C5 14.7761 5.22386 15 5.5 15H14.5C14.7761 15 15 14.7761 15 14.5V1.5C15 1.22386 14.7761 1 14.5 1H5.5Z",fill:"currentColor"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1464 2.14645C11.3417 1.95118 11.6583 1.95118 11.8536 2.14645L13.8536 4.14645C14.0488 4.34171 14.0488 4.65829 13.8536 4.85355C13.6583 5.04882 13.3417 5.04882 13.1464 4.85355L11.1464 2.85355C10.9512 2.65829 10.9512 2.34171 11.1464 2.14645Z",fill:"currentColor"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.85355 11.1464C9.04882 11.3417 9.04882 11.6583 8.85355 11.8536L6.85355 13.8536C6.65829 14.0488 6.34171 14.0488 6.14645 13.8536C5.95118 13.6583 5.95118 13.3417 6.14645 13.1464L8.14645 11.1464C8.34171 10.9512 8.65829 10.9512 8.85355 11.1464Z",fill:"currentColor"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.14645 11.1464C6.34171 10.9512 6.65829 10.9512 6.85355 11.1464L8.85355 13.1464C9.04882 13.3417 9.04882 13.6583 8.85355 13.8536C8.65829 14.0488 8.34171 14.0488 8.14645 13.8536L6.14645 11.8536C5.95118 11.6583 5.95118 11.3417 6.14645 11.1464Z",fill:"currentColor"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 4C7.77614 4 8 3.77614 8 3.5C8 3.22386 7.77614 3 7.5 3C7.22386 3 7 3.22386 7 3.5C7 3.77614 7.22386 4 7.5 4ZM7.5 5C8.32843 5 9 4.32843 9 3.5C9 2.67157 8.32843 2 7.5 2C6.67157 2 6 2.67157 6 3.5C6 4.32843 6.67157 5 7.5 5Z",fill:"currentColor"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.2098 11.0928C10.4347 10.9326 10.7469 10.9849 10.9072 11.2098L12 12.7433L13.0928 11.2098C13.2531 10.9849 13.5653 10.9326 13.7902 11.0928C14.0151 11.2531 14.0674 11.5653 13.9072 11.7902L12.4886 13.7808C12.2494 14.1165 11.7506 14.1165 11.5114 13.7808L10.0928 11.7902C9.93256 11.5653 9.98495 11.2531 10.2098 11.0928Z",fill:"currentColor"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 4C7.77614 4 8 4.22386 8 4.5V7.5H11.9C12.2314 7.5 12.5 7.76863 12.5 8.1V12.7667C12.5 13.0429 12.2761 13.2667 12 13.2667C11.7239 13.2667 11.5 13.0429 11.5 12.7667V8.5H7.6C7.26863 8.5 7 8.23137 7 7.9V4.5C7 4.22386 7.22386 4 7.5 4Z",fill:"currentColor"}),m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8536 2.14645C14.0488 2.34171 14.0488 2.65829 13.8536 2.85355L11.8536 4.85355C11.6583 5.04882 11.3417 5.04882 11.1464 4.85355C10.9512 4.65829 10.9512 4.34171 11.1464 4.14645L13.1464 2.14645C13.3417 1.95118 13.6583 1.95118 13.8536 2.14645Z",fill:"currentColor"})]});import{jsx as m1,jsxs as c9}from"react/jsx-runtime";var s9=C=>c9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[m1("title",{children:"Ticket"}),m1("path",{d:"M5 5C5 5.27614 4.77614 5.5 4.5 5.5C4.22386 5.5 4 5.27614 4 5C4 4.72386 4.22386 4.5 4.5 4.5C4.77614 4.5 5 4.72386 5 5Z",fill:"currentColor"}),m1("path",{d:"M4.5 7.5C4.77614 7.5 5 7.27614 5 7C5 6.72386 4.77614 6.5 4.5 6.5C4.22386 6.5 4 6.72386 4 7C4 7.27614 4.22386 7.5 4.5 7.5Z",fill:"currentColor"}),m1("path",{d:"M5 9C5 9.27614 4.77614 9.5 4.5 9.5C4.22386 9.5 4 9.27614 4 9C4 8.72386 4.22386 8.5 4.5 8.5C4.77614 8.5 5 8.72386 5 9Z",fill:"currentColor"}),m1("path",{d:"M4.5 11.5C4.77614 11.5 5 11.2761 5 11C5 10.7239 4.77614 10.5 4.5 10.5C4.22386 10.5 4 10.7239 4 11C4 11.2761 4.22386 11.5 4.5 11.5Z",fill:"currentColor"}),m1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 2.5C0.671573 2.5 0 3.17157 0 4V5.56712C0 5.81442 0.18415 6.02302 0.429542 6.05369C2.72043 6.34005 2.72043 9.65995 0.429541 9.94631C0.184149 9.97698 0 10.1856 0 10.4329V12C0 12.8284 0.671573 13.5 1.5 13.5H14.5C15.3284 13.5 16 12.8284 16 12V10.4329C16 10.1856 15.8159 9.97698 15.5705 9.94631C13.2796 9.65995 13.2796 6.34005 15.5705 6.05369C15.8159 6.02302 16 5.81442 16 5.56712V4C16 3.17157 15.3284 2.5 14.5 2.5H1.5ZM14.5 3.5H1.5C1.22386 3.5 1 3.72386 1 4V5.1469C3.86361 5.89888 3.86361 10.1011 1 10.8531V12C1 12.2761 1.22386 12.5 1.5 12.5H14.5C14.7761 12.5 15 12.2761 15 12V10.8531C12.1364 10.1011 12.1364 5.89888 15 5.1469V4C15 3.72386 14.7761 3.5 14.5 3.5Z",fill:"currentColor"})]});import{jsx as T2,jsxs as h9}from"react/jsx-runtime";var f9=C=>h9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[T2("title",{children:"Trending"}),T2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 3.5C11 3.22386 11.2239 3 11.5 3H15.4C15.7314 3 16 3.26863 16 3.6V7.5C16 7.77614 15.7761 8 15.5 8C15.2239 8 15 7.77614 15 7.5V4H11.5C11.2239 4 11 3.77614 11 3.5Z",fill:"currentColor"}),T2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8536 3.14645C16.0488 3.34171 16.0488 3.65829 15.8536 3.85355L9.92426 9.78284C9.68995 10.0172 9.31005 10.0172 9.07574 9.78284L6.5 7.20711L0.853553 12.8536C0.658291 13.0488 0.341709 13.0488 0.146447 12.8536C-0.0488155 12.6583 -0.0488155 12.3417 0.146447 12.1464L6.07574 6.21716C6.31005 5.98284 6.68995 5.98284 6.92426 6.21716L9.5 8.79289L15.1464 3.14645C15.3417 2.95118 15.6583 2.95118 15.8536 3.14645Z",fill:"currentColor"})]});import{jsx as C3,jsxs as L9}from"react/jsx-runtime";var a9=C=>L9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[C3("title",{children:"Trophy"}),C3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 3V1.83333C13 0.820811 12.1792 0 11.1667 0H4.83333C3.82081 0 3 0.820811 3 1.83333V3H1.5C0.671573 3 0 3.67157 0 4.5V5C0 7.20902 1.79066 8.9998 3.99963 9C4.62041 9.82646 5.49134 10.4543 6.5 10.7711V13L6.50005 13.007C6.38577 13.0206 6.27439 13.0538 6.17092 13.1056L3.41315 14.4845C2.6581 14.862 2.92674 16 3.77092 16H12.2293C13.0735 16 13.3421 14.862 12.5871 14.4845L9.82928 13.1056C9.72577 13.0538 9.61434 13.0206 9.5 13.007V10.7711C10.5087 10.4543 11.3796 9.82646 12.0004 9C14.2093 8.9998 16 7.20902 16 5V4.5C16 3.67157 15.3284 3 14.5 3H13ZM4.83333 1H11.1667C11.6269 1 12 1.3731 12 1.83333V6C12 8.20914 10.2091 10 8 10C5.79086 10 4 8.20914 4 6V1.83333C4 1.3731 4.3731 1 4.83333 1ZM8.5 10.9753C8.33555 10.9916 8.16875 11 8 11C7.83125 11 7.66445 10.9916 7.5 10.9753V13H8.5V10.9753ZM13 6C13 6.68712 12.8614 7.34187 12.6106 7.93781C13.9747 7.65576 15 6.44762 15 5V4.5C15 4.22386 14.7761 4 14.5 4H13V6ZM1 5C1 6.44762 2.02533 7.65576 3.38938 7.93781C3.1386 7.34187 3 6.68712 3 6V4H1.5C1.22386 4 1 4.22386 1 4.5V5ZM6.61814 14H9.38207L11.3821 15H4.61814L6.61814 14Z",fill:"currentColor"})]});import{jsx as w1,jsxs as u9}from"react/jsx-runtime";var g9=C=>u9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[w1("title",{children:"Withdraw"}),w1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0.5C0 0.223858 0.223858 0 0.5 0H15.5C15.7761 0 16 0.223858 16 0.5C16 0.776142 15.7761 1 15.5 1H0.5C0.223858 1 0 0.776142 0 0.5Z",fill:"currentColor"}),w1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 0C4.77614 0 5 0.223858 5 0.5V6.5C5 6.77614 5.22386 7 5.5 7H10.5C10.7761 7 11 6.77614 11 6.5V0.5C11 0.223858 11.2239 0 11.5 0C11.7761 0 12 0.223858 12 0.5V6.5C12 7.32843 11.3284 8 10.5 8H5.5C4.67157 8 4 7.32843 4 6.5V0.5C4 0.223858 4.22386 0 4.5 0Z",fill:"currentColor"}),w1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 9.5C8.27614 9.5 8.5 9.72386 8.5 10V15.5C8.5 15.7761 8.27614 16 8 16C7.72386 16 7.5 15.7761 7.5 15.5V10C7.5 9.72386 7.72386 9.5 8 9.5Z",fill:"currentColor"}),w1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.14645 12.6464C5.34171 12.4512 5.65829 12.4512 5.85355 12.6464L8 14.7929L10.1464 12.6464C10.3417 12.4512 10.6583 12.4512 10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536L8.42426 15.7828C8.18995 16.0172 7.81005 16.0172 7.57574 15.7828L5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464Z",fill:"currentColor"}),w1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 0.5V1C7 1.55228 7.44772 2 8 2C8.55229 2 9 1.55228 9 1V0.5H10V1C10 2.10457 9.10457 3 8 3C6.89543 3 6 2.10457 6 1V0.5H7Z",fill:"currentColor"})]});import{jsx as p,jsxs as v9}from"react/jsx-runtime";var V9=C=>v9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[p("title",{children:"CasinoChip"}),p("path",{d:"M8.30771 9.67984H8.43297C8.9288 9.67984 9.2002 9.42466 9.2002 8.95846V8.28125C9.2002 8.01135 9.04362 7.83469 8.72525 7.75617L7.63443 7.48136C7.54571 7.45683 7.51961 7.42248 7.51961 7.34396V6.971C7.51961 6.88758 7.56136 6.84832 7.65009 6.84832H8.23986C8.32859 6.84832 8.37034 6.88758 8.37034 6.971V7.28016H9.15844V6.94156C9.15844 6.47537 8.89226 6.22019 8.4121 6.22019H8.30771V5.70001H7.61356V6.22019H7.49873C7.00291 6.22019 6.73151 6.47537 6.73151 6.94156V7.51572C6.73151 7.8445 6.9455 8.00645 7.13339 8.05552L8.28161 8.34505C8.37034 8.36959 8.40688 8.39903 8.40688 8.46773V8.92902C8.40688 9.01244 8.36512 9.0517 8.2764 9.0517H7.61878C7.53005 9.0517 7.4883 9.01244 7.4883 8.92902V8.6493H6.7002V8.95846C6.7002 9.42466 6.96637 9.67984 7.44654 9.67984H7.61356V10.2H8.30771V9.67984Z",fill:"currentColor"}),p("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 12C10.2091 12 12 10.2091 12 8C12 5.79086 10.2091 4 8 4C5.79086 4 4 5.79086 4 8C4 10.2091 5.79086 12 8 12ZM8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z",fill:"currentColor"}),p("path",{d:"M8 3C8.27614 3 8.5 2.77614 8.5 2.5C8.5 2.22386 8.27614 2 8 2C7.72386 2 7.5 2.22386 7.5 2.5C7.5 2.77614 7.72386 3 8 3Z",fill:"currentColor"}),p("path",{d:"M8.5 13.5C8.5 13.7761 8.27614 14 8 14C7.72386 14 7.5 13.7761 7.5 13.5C7.5 13.2239 7.72386 13 8 13C8.27614 13 8.5 13.2239 8.5 13.5Z",fill:"currentColor"}),p("path",{d:"M2.5 8.5C2.77614 8.5 3 8.27614 3 8C3 7.72386 2.77614 7.5 2.5 7.5C2.22386 7.5 2 7.72386 2 8C2 8.27614 2.22386 8.5 2.5 8.5Z",fill:"currentColor"}),p("path",{d:"M14 8C14 8.27614 13.7761 8.5 13.5 8.5C13.2239 8.5 13 8.27614 13 8C13 7.72386 13.2239 7.5 13.5 7.5C13.7761 7.5 14 7.72386 14 8Z",fill:"currentColor"}),p("path",{d:"M10.4848 3.66106C10.7245 3.79828 11.03 3.71526 11.1672 3.47562C11.3044 3.23599 11.2214 2.93048 10.9817 2.79326C10.7421 2.65604 10.4366 2.73906 10.2994 2.9787C10.1622 3.21833 10.2452 3.52383 10.4848 3.66106Z",fill:"currentColor"}),p("path",{d:"M5.70136 13.0214C5.56414 13.261 5.25864 13.3441 5.01901 13.2068C4.77937 13.0696 4.69635 12.7641 4.83357 12.5245C4.97079 12.2848 5.27629 12.2018 5.51593 12.339C5.75556 12.4763 5.83859 12.7818 5.70136 13.0214Z",fill:"currentColor"}),p("path",{d:"M2.97848 5.70085C3.21811 5.83807 3.52362 5.75505 3.66084 5.51541C3.79806 5.27578 3.71504 4.97028 3.4754 4.83306C3.23577 4.69583 2.93026 4.77886 2.79304 5.01849C2.65582 5.25813 2.73884 5.56363 2.97848 5.70085Z",fill:"currentColor"}),p("path",{d:"M13.2067 10.9815C13.0695 11.2212 12.764 11.3042 12.5244 11.167C12.2847 11.0298 12.2017 10.7243 12.3389 10.4846C12.4762 10.245 12.7817 10.162 13.0213 10.2992C13.2609 10.4364 13.344 10.7419 13.2067 10.9815Z",fill:"currentColor"}),p("path",{d:"M12.3413 5.51934C12.4783 5.75909 12.7837 5.84238 13.0235 5.70536C13.2632 5.56835 13.3465 5.26291 13.2095 5.02316C13.0725 4.78341 12.7671 4.70012 12.5273 4.83714C12.2876 4.97415 12.2043 5.27958 12.3413 5.51934Z",fill:"currentColor"}),p("path",{d:"M3.4732 11.1635C3.23344 11.3005 2.92801 11.2172 2.791 10.9775C2.65398 10.7377 2.73727 10.4323 2.97702 10.2953C3.21677 10.1583 3.52221 10.2415 3.65922 10.4813C3.79624 10.721 3.71295 11.0265 3.4732 11.1635Z",fill:"currentColor"}),p("path",{d:"M4.8369 3.47283C4.97391 3.71258 5.27934 3.79587 5.5191 3.65885C5.75885 3.52184 5.84213 3.21641 5.70512 2.97665C5.5681 2.7369 5.26267 2.65361 5.02292 2.79063C4.78317 2.92764 4.69988 3.23308 4.8369 3.47283Z",fill:"currentColor"}),p("path",{d:"M10.9771 13.2094C10.7374 13.3464 10.4319 13.2631 10.2949 13.0234C10.1579 12.7836 10.2412 12.4782 10.4809 12.3412C10.7207 12.2042 11.0261 12.2874 11.1631 12.5272C11.3001 12.7669 11.2169 13.0724 10.9771 13.2094Z",fill:"currentColor"}),p("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16ZM8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15Z",fill:"currentColor"})]});import{jsx as T,jsxs as w9}from"react/jsx-runtime";var m9=C=>w9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[T("title",{children:"Dice"}),T("path",{d:"M4 3C4 3.55228 3.55228 4 3 4C2.44772 4 2 3.55228 2 3C2 2.44772 2.44772 2 3 2C3.55228 2 4 2.44772 4 3Z",fill:"currentColor"}),T("path",{d:"M7 4C7.55228 4 8 3.55228 8 3C8 2.44772 7.55228 2 7 2C6.44772 2 6 2.44772 6 3C6 3.55228 6.44772 4 7 4Z",fill:"currentColor"}),T("path",{d:"M8 7C8 7.55228 7.55228 8 7 8C6.44772 8 6 7.55228 6 7C6 6.44772 6.44772 6 7 6C7.55228 6 8 6.44772 8 7Z",fill:"currentColor"}),T("path",{d:"M3 8C3.55228 8 4 7.55228 4 7C4 6.44772 3.55228 6 3 6C2.44772 6 2 6.44772 2 7C2 7.55228 2.44772 8 3 8Z",fill:"currentColor"}),T("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1C0 0.447716 0.447715 0 1 0H9C9.55228 0 10 0.447715 10 1V9C10 9.55228 9.55229 10 9 10H1C0.447716 10 0 9.55229 0 9V1ZM1 1H9V9H1V1Z",fill:"currentColor"}),T("path",{d:"M11.5 7C11.2239 7 11 7.22386 11 7.5C11 7.77614 11.2239 8 11.5 8H15V15H8V11.5C8 11.2239 7.77614 11 7.5 11C7.22386 11 7 11.2239 7 11.5V15C7 15.5523 7.44772 16 8 16H15C15.5523 16 16 15.5523 16 15V8C16 7.44772 15.5523 7 15 7H11.5Z",fill:"currentColor"}),T("path",{d:"M13 11C13.5523 11 14 10.5523 14 10C14 9.44771 13.5523 9 13 9C12.4477 9 12 9.44771 12 10C12 10.5523 12.4477 11 13 11Z",fill:"currentColor"}),T("path",{d:"M11 13C11 13.5523 10.5523 14 10 14C9.44771 14 9 13.5523 9 13C9 12.4477 9.44771 12 10 12C10.5523 12 11 12.4477 11 13Z",fill:"currentColor"})]});import{jsx as e3,jsxs as M9}from"react/jsx-runtime";var H9=C=>M9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[e3("title",{children:"Favourite"}),e3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.95566 2.30902C1.33635 3.09723 1 4.11379 1 5.00013C1 5.74555 1.00279 6.41115 1.33921 7.25248C1.67967 8.10391 2.3795 9.17343 3.85309 10.6466C4.85333 11.6466 5.97835 12.7716 6.8533 13.6467L7.9996 14.7931L12.146 10.6467C13.6201 9.17275 14.3202 8.10321 14.6607 7.25191C14.9972 6.41077 15 5.74553 15 5.0001C15 4.11378 14.6636 3.09722 14.0443 2.30902C13.4313 1.52884 12.5665 1.00012 11.5 1.00012C10.1239 1.00012 9.37882 1.45356 8.97866 1.85369C8.77294 2.05939 8.64632 2.26314 8.57224 2.41128C8.53524 2.48524 8.51169 2.54466 8.49821 2.58241C8.49148 2.60125 8.4873 2.61455 8.48524 2.6214L8.48382 2.6263C8.42647 2.8463 8.22768 3.00016 7.99991 3.00012C7.77214 3.00008 7.57342 2.84615 7.51614 2.62614L7.51472 2.62124C7.51266 2.6144 7.50849 2.6011 7.50177 2.58227C7.4883 2.54453 7.46478 2.48512 7.42782 2.41116C7.35379 2.26306 7.22724 2.05933 7.02159 1.85366C6.62156 1.45359 5.87656 1.00012 4.5 1.00012C3.43353 1.00012 2.56866 1.52884 1.95566 2.30902ZM8.00011 1.45416C7.92198 1.35345 7.83203 1.2499 7.72873 1.14659C7.12887 0.546657 6.12387 0.00012207 4.5 0.00012207C3.06647 0.00012207 1.93134 0.721388 1.16934 1.6912C0.413648 2.65299 4.85345e-07 3.88644 4.85345e-07 5.00013L2.46926e-07 5.01519C-1.81709e-05 5.76578 -3.85642e-05 6.5966 0.410688 7.62376C0.820122 8.64769 1.62008 9.82824 3.14607 11.3538C4.14625 12.3538 5.27123 13.4787 6.14617 14.3537L7.64553 15.8533C7.7393 15.9471 7.86694 16.0002 7.99957 16.0002C8.13219 16.0002 8.25938 15.9476 8.35315 15.8538L12.8531 11.3538C14.3795 9.82761 15.1796 8.64708 15.5892 7.62334C16 6.59631 16 5.76578 16 5.01516V5.0001C16 3.88642 15.5864 2.65298 14.8307 1.6912C14.0687 0.721388 12.9335 0.0001221 11.5 0.0001221C9.87646 0.0001221 8.8715 0.546681 8.27158 1.14655C8.16825 1.24988 8.07828 1.35344 8.00011 1.45416Z",fill:"currentColor"})]});import{jsx as _2,jsxs as Z9}from"react/jsx-runtime";var R9=C=>Z9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[_2("title",{children:"FavouriteFilled"}),_2("path",{d:"M12.4996 11.0001C15.5 8.00002 15.5 6.49998 15.5 4.99998C15.5 2.99996 14 0.499974 11.5 0.499974C8.50032 0.499974 8 2.49999 8 2.49999C8 2.49999 7.50043 0.499974 4.5 0.499974C2 0.499974 0.5 2.99996 0.5 5.00001C0.5 6.49998 0.5 8.00133 3.49958 11.0001C5.5 13.0001 7.99958 15.5002 7.99958 15.5002C7.99958 15.5002 10.4995 13 12.4996 11.0001Z",fill:"currentColor"}),_2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.95566 2.30902C1.33635 3.09723 1 4.11379 1 5.00013C1 5.74555 1.00279 6.41115 1.33921 7.25248C1.67967 8.10391 2.3795 9.17343 3.85309 10.6466C4.85333 11.6466 5.97835 12.7716 6.8533 13.6467L7.9996 14.7931L12.146 10.6467C13.6201 9.17275 14.3202 8.10321 14.6607 7.25191C14.9972 6.41077 15 5.74553 15 5.0001C15 4.11378 14.6636 3.09722 14.0443 2.30902C13.4313 1.52884 12.5665 1.00012 11.5 1.00012C10.1239 1.00012 9.37882 1.45356 8.97866 1.85369C8.77294 2.05939 8.64632 2.26314 8.57224 2.41128C8.53524 2.48524 8.51169 2.54466 8.49821 2.58241C8.49148 2.60125 8.4873 2.61455 8.48524 2.6214L8.48382 2.6263C8.42647 2.8463 8.22768 3.00016 7.99991 3.00012C7.77214 3.00008 7.57342 2.84615 7.51614 2.62614L7.51472 2.62124C7.51266 2.6144 7.50849 2.6011 7.50177 2.58227C7.4883 2.54453 7.46478 2.48512 7.42782 2.41116C7.35379 2.26306 7.22724 2.05933 7.02159 1.85366C6.62156 1.45359 5.87656 1.00012 4.5 1.00012C3.43353 1.00012 2.56866 1.52884 1.95566 2.30902ZM8.00011 1.45416C7.92198 1.35345 7.83203 1.2499 7.72873 1.14659C7.12887 0.546657 6.12387 0.00012207 4.5 0.00012207C3.06647 0.00012207 1.93134 0.721388 1.16934 1.6912C0.413648 2.65299 4.85345e-07 3.88644 4.85345e-07 5.00013L2.46926e-07 5.01519C-1.81709e-05 5.76578 -3.85642e-05 6.5966 0.410688 7.62376C0.820122 8.64769 1.62008 9.82824 3.14607 11.3538C4.14625 12.3538 5.27123 13.4787 6.14617 14.3537L7.64553 15.8533C7.7393 15.9471 7.86694 16.0002 7.99957 16.0002C8.13219 16.0002 8.25938 15.9476 8.35315 15.8538L12.8531 11.3538C14.3795 9.82761 15.1796 8.64708 15.5892 7.62334C16 6.59631 16 5.76578 16 5.01516V5.0001C16 3.88642 15.5864 2.65298 14.8307 1.6912C14.0687 0.721388 12.9335 0.0001221 11.5 0.0001221C9.87646 0.0001221 8.8715 0.546681 8.27158 1.14655C8.16825 1.24988 8.07828 1.35344 8.00011 1.45416Z",fill:"currentColor"})]});import{jsx as G,jsxs as G9}from"react/jsx-runtime";var S9=C=>G9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[G("title",{children:"Jackpots"}),G("path",{d:"M5.31444 0.0357726C5.57083 -0.0667841 5.86181 0.0579238 5.96437 0.314316L6.96437 2.81432C7.06693 3.07071 6.94222 3.36169 6.68583 3.46425C6.42944 3.56681 6.13845 3.4421 6.03589 3.18571L5.03589 0.685706C4.93334 0.429314 5.05805 0.138329 5.31444 0.0357726Z",fill:"currentColor"}),G("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.27804 4.05197C4.31665 4.03284 4.35764 4.01875 4.40002 4.0101C4.43722 4.00245 4.4745 3.99918 4.51126 4H11.489C11.5428 3.99881 11.5976 4.00633 11.6517 4.02355C11.7352 4.0501 11.8068 4.09651 11.863 4.15591L14.8536 7.14645C14.8872 7.18013 14.9152 7.21754 14.9373 7.25739C14.9752 7.3255 14.9976 7.40337 14.9998 7.48628C15.0001 7.49724 15.0001 7.50822 14.9996 7.51919C14.9993 7.5281 14.9987 7.53701 14.9979 7.54591C14.9886 7.64877 14.948 7.74263 14.8859 7.81798L8.39798 15.8031C8.3845 15.8208 8.36992 15.8375 8.35437 15.853C8.30673 15.9009 8.24874 15.9397 8.1824 15.9656C8.12492 15.9882 8.06308 16.0002 7.9999 16.0001C7.94469 16.0001 7.89051 15.9909 7.83939 15.9735C7.82573 15.9689 7.81228 15.9636 7.7991 15.9579C7.74092 15.9324 7.68964 15.8968 7.64672 15.8538C7.63302 15.8402 7.62006 15.8257 7.60794 15.8104L1.11447 7.81841C1.04621 7.73584 1.00395 7.63098 1.00026 7.51638L1 7.5L4.27804 4.05197ZM8.00001 5.28104L6.56754 7H9.43248L8.00001 5.28104ZM10.3331 6.51872L9.06752 5H10.8163L10.3331 6.51872ZM5.18392 5H6.9325L5.66708 6.5185L5.18392 5ZM2.55049 8L6.72309 13.1355L5.08907 8H2.55049ZM6.13847 8L8.00013 13.851L9.8618 8H6.13847ZM10.9112 8L9.27734 13.135L13.4495 8H10.9112ZM13.2929 7H11.2294L11.7275 5.43458L13.2929 7ZM4.77089 7H2.70711L4.27273 5.43438L4.77089 7Z",fill:"currentColor"}),G("path",{d:"M1.14753 7.14537L4.14562 4.14728C4.18353 4.10911 4.22801 4.07669 4.27804 4.05197L1.14753 7.14537Z",fill:"currentColor"}),G("path",{d:"M1.14753 7.14537L1 7.49835C1.0003 7.4078 1.02466 7.32292 1.06703 7.24976C1.08603 7.21691 1.10904 7.18581 1.13602 7.15719L1.14753 7.14537Z",fill:"currentColor"}),G("path",{d:"M9.53563 0.314316C9.63819 0.0579238 9.92917 -0.0667841 10.1856 0.0357726C10.442 0.138329 10.5667 0.429314 10.4641 0.685706L9.46411 3.18571C9.36155 3.4421 9.07056 3.56681 8.81417 3.46425C8.55778 3.36169 8.43307 3.07071 8.53563 2.81432L9.53563 0.314316Z",fill:"currentColor"}),G("path",{d:"M1.18767 0.109584C1.4033 -0.0629208 1.71795 -0.0279601 1.89045 0.187671L3.89045 2.68767C4.06296 2.9033 4.028 3.21795 3.81237 3.39045C3.59674 3.56296 3.28209 3.528 3.10958 3.31237L1.10958 0.812366C0.937079 0.596735 0.97204 0.282089 1.18767 0.109584Z",fill:"currentColor"}),G("path",{d:"M13.6095 0.187671C13.7821 -0.0279601 14.0967 -0.0629208 14.3123 0.109584C14.528 0.282089 14.5629 0.596735 14.3904 0.812366L12.3904 3.31237C12.2179 3.528 11.9033 3.56296 11.6876 3.39045C11.472 3.21795 11.437 2.9033 11.6095 2.68767L13.6095 0.187671Z",fill:"currentColor"}),G("path",{d:"M0.146447 3.14645C0.341709 2.95118 0.658291 2.95118 0.853553 3.14645L1.85355 4.14645C2.04882 4.34171 2.04882 4.65829 1.85355 4.85355C1.65829 5.04882 1.34171 5.04882 1.14645 4.85355L0.146447 3.85355C-0.0488155 3.65829 -0.0488155 3.34171 0.146447 3.14645Z",fill:"currentColor"}),G("path",{d:"M14.6464 3.14645C14.8417 2.95118 15.1583 2.95118 15.3536 3.14645C15.5488 3.34171 15.5488 3.65829 15.3536 3.85355L14.3536 4.85355C14.1583 5.04882 13.8417 5.04882 13.6464 4.85355C13.4512 4.65829 13.4512 4.34171 13.6464 4.14645L14.6464 3.14645Z",fill:"currentColor"})]});import{jsx as n5,jsxs as x9}from"react/jsx-runtime";var P9=C=>x9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[n5("title",{children:"LiveDealer"}),n5("path",{d:"M8.5 13.5C8.5 13.7761 8.27614 14 8 14C7.72386 14 7.5 13.7761 7.5 13.5C7.5 13.2239 7.72386 13 8 13C8.27614 13 8.5 13.2239 8.5 13.5Z",fill:"currentColor"}),n5("path",{d:"M8.5 10.5C8.5 10.7761 8.27614 11 8 11C7.72386 11 7.5 10.7761 7.5 10.5C7.5 10.2239 7.72386 10 8 10C8.27614 10 8.5 10.2239 8.5 10.5Z",fill:"currentColor"}),n5("path",{d:"M6 8C6 7.44772 6.44772 7 7 7H9C9.55228 7 10 7.44772 10 8C10 8.55228 9.55228 9 9 9H7C6.44772 9 6 8.55228 6 8Z",fill:"currentColor"}),n5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1C6.34315 1 5 2.34315 5 4C5 5.65685 6.34315 7 8 7C9.65685 7 11 5.65685 11 4C11 2.34315 9.65685 1 8 1ZM10.1273 7.38804C11.2523 6.68015 12 5.42739 12 4C12 1.79086 10.2091 0 8 0C5.79086 0 4 1.79086 4 4C4 5.42739 4.74765 6.68015 5.87271 7.38804C3.60905 8.24657 2 10.4354 2 13V13.6538C2 14.9496 3.05041 16 4.34615 16H6.48809C6.49596 16.0002 6.50386 16.0002 6.51177 16H9.48823C9.49614 16.0002 9.50404 16.0002 9.51191 16H11.6538C12.9496 16 14 14.9496 14 13.6538V13C14 10.4354 12.3909 8.24658 10.1273 7.38804ZM10.1937 15H11.6538C12.3973 15 13 14.3973 13 13.6538V13C13 11.817 12.5892 10.73 11.9024 9.87385L10.1937 15ZM11.1111 9.08555C10.2573 8.40603 9.17604 8 8 8C6.82396 8 5.74274 8.40602 4.88889 9.08554L6.86038 15H9.13962L11.1111 9.08555ZM5.80629 15L4.09757 9.87385C3.41082 10.73 3 11.817 3 13V13.6538C3 14.3973 3.60269 15 4.34615 15H5.80629Z",fill:"currentColor"})]});import{jsx as A5,jsxs as y9}from"react/jsx-runtime";var b9=C=>y9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[A5("title",{children:"Poker"}),A5("path",{d:"M4 1.5C4 0.947715 4.44772 0.5 5 0.5H14C14.5523 0.5 15 0.947715 15 1.5V14C15 14.5523 14.5523 15 14 15C13.7239 15 13.5 14.7761 13.5 14.5C13.5 14.2239 13.7239 14 14 14V1.5H5V2C5 2.27614 4.77614 2.5 4.5 2.5C4.22386 2.5 4 2.27614 4 2V1.5Z",fill:"currentColor"}),A5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.83333 6.5C7.35356 6.5 7.73301 6.64073 8.00005 6.83679C8.26709 6.64075 8.6465 6.5 9.16667 6.5C9.76686 6.5 10.2353 6.8046 10.539 7.19108C10.8364 7.56953 11 8.05297 11 8.49998L11 8.51257C11 8.76555 11.0001 9.09602 10.8392 9.4982C10.6797 9.89692 10.3796 10.3274 9.85341 10.8536L8.35341 12.3536C8.25964 12.4473 8.13245 12.5 7.99983 12.5C7.86722 12.5 7.74004 12.4473 7.64627 12.3535L6.14635 10.8536C5.62022 10.3276 5.32019 9.89709 5.16072 9.49829C4.99989 9.09609 4.99995 8.76555 5 8.51258L5 8.49999C5 8.05298 5.16365 7.56954 5.46101 7.19108C5.76468 6.8046 6.23314 6.5 6.83333 6.5ZM6 8.49999C6 8.28033 6.08635 8.01378 6.24732 7.80891C6.40199 7.61206 6.60019 7.5 6.83333 7.5C7.21945 7.5 7.38488 7.61645 7.44973 7.67725C7.48721 7.71239 7.50756 7.7446 7.51714 7.76257C7.51985 7.76764 7.52163 7.77147 7.52263 7.77374C7.5874 7.98185 7.78034 8.12496 7.99991 8.125C8.21948 8.12504 8.41248 7.98199 8.47732 7.77389C8.47832 7.77162 8.48011 7.76778 8.48283 7.76269C8.49244 7.74468 8.51281 7.71245 8.55033 7.67728C8.61525 7.61642 8.78071 7.5 9.16667 7.5C9.39981 7.5 9.59801 7.61206 9.75268 7.80891C9.91365 8.01378 10 8.28033 10 8.49998C10 8.74541 9.99721 8.91065 9.91075 9.12677C9.82023 9.35305 9.62025 9.67256 9.14633 10.1464L7.99988 11.2929L6.85337 10.1464C6.37964 9.67281 6.17974 9.35332 6.08924 9.12701C6.00279 8.9108 6 8.74543 6 8.49999Z",fill:"currentColor"}),A5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3C3.44772 3 3 3.44772 3 4V15C3 15.5523 3.44772 16 4 16H12C12.5523 16 13 15.5523 13 15V4C13 3.44772 12.5523 3 12 3H4ZM12 4H4V15H12V4Z",fill:"currentColor"})]});import{jsx as W2,jsxs as B9}from"react/jsx-runtime";var I9=C=>B9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[W2("title",{children:"Roulette"}),W2("path",{d:"M7 6C7 6.08956 6.98823 6.17637 6.96614 6.25897L8.00004 7.29287L9.03387 6.25903C9.01178 6.17642 9 6.08958 9 6C9 5.44772 9.44772 5 10 5C10.5523 5 11 5.44772 11 6C11 6.55228 10.5523 7 10 7C9.91042 7 9.8236 6.98822 9.74099 6.96613L8.70714 7.99998L9.74103 9.03386C9.82363 9.01177 9.91044 9 10 9C10.5523 9 11 9.44772 11 10C11 10.5523 10.5523 11 10 11C9.44772 11 9 10.5523 9 10C9 9.9104 9.01178 9.82356 9.03389 9.74093L8.00004 8.70708L6.96613 9.74099C6.98822 9.8236 7 9.91042 7 10C7 10.5523 6.55228 11 6 11C5.44772 11 5 10.5523 5 10C5 9.44772 5.44772 9 6 9C6.08958 9 6.17642 9.01178 6.25903 9.03387L7.29293 7.99998L6.25907 6.96612C6.17644 6.98822 6.0896 7 6 7C5.44772 7 5 6.55228 5 6C5 5.44772 5.44772 5 6 5C6.55228 5 7 5.44772 7 6Z",fill:"currentColor"}),W2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM7.5 14.9824V13.9795C6.2188 13.8738 5.05175 13.3655 4.12559 12.5815L3.41638 13.2907C4.52667 14.2535 5.94304 14.8725 7.5 14.9824ZM2.70927 12.5836L3.41848 11.8744C2.63447 10.9483 2.12623 9.7812 2.02054 8.5H1.01758C1.12746 10.057 1.74653 11.4733 2.70927 12.5836ZM7.5 2.02054C6.21882 2.12623 5.05177 2.63445 4.12561 3.41844L3.4164 2.70924C4.52669 1.74652 5.94306 1.12746 7.5 1.01758V2.02054ZM2.70929 3.41634L3.4185 4.12555C2.63448 5.05171 2.12624 6.21879 2.02054 7.5H1.01758C1.12747 5.94302 1.74654 4.52663 2.70929 3.41634ZM12.5837 13.2907C11.4734 14.2535 10.057 14.8725 8.5 14.9824V13.9795C9.78121 13.8738 10.9483 13.3655 11.8745 12.5815L12.5837 13.2907ZM13.2908 12.5836C14.2535 11.4733 14.8725 10.0569 14.9824 8.5H13.9795C13.8738 9.78118 13.3655 10.9482 12.5816 11.8744L13.2908 12.5836ZM14.9824 7.5C14.8725 5.94304 14.2535 4.52667 13.2907 3.41638L12.5815 4.12559C13.3655 5.05175 13.8738 6.2188 13.9795 7.5H14.9824ZM8.5 1.01758C10.057 1.12746 11.4733 1.74653 12.5836 2.70927L11.8744 3.41848C10.9483 2.63447 9.7812 2.12623 8.5 2.02054V1.01758ZM13 8C13 10.7614 10.7614 13 8 13C5.23858 13 3 10.7614 3 8C3 5.23858 5.23858 3 8 3C10.7614 3 13 5.23858 13 8Z",fill:"currentColor"})]});import{jsx as d5,jsxs as E9}from"react/jsx-runtime";var k9=C=>E9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[d5("title",{children:"Slots"}),d5("path",{d:"M2.50006 4C2.22392 4 2.00006 4.22386 2.00006 4.5C2.00006 4.77614 2.22392 5 2.50006 5H2.92356L2.00509 11.4293C1.96604 11.7027 2.15599 11.9559 2.42935 11.995C2.70272 12.034 2.95599 11.8441 2.99504 11.5707L3.97873 4.68485C4.03037 4.32339 3.74989 4 3.38476 4H2.50006Z",fill:"currentColor"}),d5("path",{d:"M5.00006 4.5C5.00006 4.22386 5.22392 4 5.50006 4H6.38476C6.74989 4 7.03037 4.32339 6.97873 4.68485L5.99504 11.5707C5.95599 11.8441 5.70272 12.034 5.42935 11.995C5.15599 11.9559 4.96604 11.7027 5.00509 11.4293L5.92356 5H5.50006C5.22392 5 5.00006 4.77614 5.00006 4.5Z",fill:"currentColor"}),d5("path",{d:"M8.50006 4C8.22392 4 8.00006 4.22386 8.00006 4.5C8.00006 4.77614 8.22392 5 8.50006 5H8.92356L8.00509 11.4293C7.96604 11.7027 8.15599 11.9559 8.42935 11.995C8.70272 12.034 8.95599 11.8441 8.99504 11.5707L9.97873 4.68485C10.0304 4.32339 9.74989 4 9.38476 4H8.50006Z",fill:"currentColor"}),d5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 7V7.5H14.5V3.86622C14.2011 3.69331 14 3.37014 14 3C14 2.44772 14.4477 2 15 2C15.5523 2 16 2.44772 16 3C16 3.37014 15.7989 3.69331 15.5 3.86622V7.5C15.5 8.05228 15.0523 8.5 14.5 8.5H13V9C13 9.55228 12.5523 10 12 10V13C12 13.5523 11.5523 14 11 14H1C0.447715 14 0 13.5523 0 13V3C0 2.44772 0.447715 2 1 2H11C11.5523 2 12 2.44772 12 3V6C12.5523 6 13 6.44772 13 7ZM1 3H11V13H1L1 3Z",fill:"currentColor"})]});import{jsx as X,jsxs as A9}from"react/jsx-runtime";var F9=C=>A9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[X("title",{children:"Studio"}),X("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5V1H1V13H3.5C3.77614 13 4 13.2239 4 13.5C4 13.7761 3.77614 14 3.5 14H1C0.447715 14 0 13.5523 0 13V1ZM1.5 2C1.5 1.72386 1.72386 1.5 2 1.5H6C6.27614 1.5 6.5 1.72386 6.5 2V8.5C6.5 8.77614 6.27614 9 6 9C5.72386 9 5.5 8.77614 5.5 8.5V2.5H2.5V10H5C5.27614 10 5.5 10.2239 5.5 10.5C5.5 10.7761 5.27614 11 5 11H2C1.72386 11 1.5 10.7761 1.5 10.5V2ZM3 12C3 11.7239 3.22386 11.5 3.5 11.5H4.5C4.77614 11.5 5 11.7239 5 12C5 12.2761 4.77614 12.5 4.5 12.5H3.5C3.22386 12.5 3 12.2761 3 12Z",fill:"currentColor"}),X("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.75 10.4519C8.95711 10.4519 9.125 10.6198 9.125 10.8269V11.2019H9.5C9.70711 11.2019 9.875 11.3698 9.875 11.5769C9.875 11.784 9.70711 11.9519 9.5 11.9519H9.125V12.3269C9.125 12.534 8.95711 12.7019 8.75 12.7019C8.54289 12.7019 8.375 12.534 8.375 12.3269V11.9519H8C7.79289 11.9519 7.625 11.784 7.625 11.5769C7.625 11.3698 7.79289 11.2019 8 11.2019H8.375V10.8269C8.375 10.6198 8.54289 10.4519 8.75 10.4519Z",fill:"currentColor"}),X("path",{d:"M11.625 11.5035C11.625 11.7106 11.4571 11.8785 11.25 11.8785C11.0429 11.8785 10.875 11.7106 10.875 11.5035C10.875 11.2964 11.0429 11.1285 11.25 11.1285C11.4571 11.1285 11.625 11.2964 11.625 11.5035Z",fill:"currentColor"}),X("path",{d:"M12.375 10.8269C12.375 11.034 12.2071 11.2019 12 11.2019C11.7929 11.2019 11.625 11.034 11.625 10.8269C11.625 10.6198 11.7929 10.4519 12 10.4519C12.2071 10.4519 12.375 10.6198 12.375 10.8269Z",fill:"currentColor"}),X("path",{d:"M13.125 11.5035C13.125 11.7106 12.9571 11.8785 12.75 11.8785C12.5429 11.8785 12.375 11.7106 12.375 11.5035C12.375 11.2964 12.5429 11.1285 12.75 11.1285C12.9571 11.1285 13.125 11.2964 13.125 11.5035Z",fill:"currentColor"}),X("path",{d:"M12.375 12.2535C12.375 12.4606 12.2071 12.6285 12 12.6285C11.7929 12.6285 11.625 12.4606 11.625 12.2535C11.625 12.0464 11.7929 11.8785 12 11.8785C12.2071 11.8785 12.375 12.0464 12.375 12.2535Z",fill:"currentColor"}),X("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.90241 8.95105C8.07926 8.80849 8.30077 8.73218 8.52434 8.73218H12.554C12.7776 8.73218 12.9991 8.80849 13.176 8.95105C15.3883 10.7345 16.2078 12.9125 15.852 14.346C15.6663 15.0943 15.1325 15.6719 14.3105 15.7207C13.5502 15.7659 12.6891 15.3442 11.8085 14.5112C11.8038 14.5068 11.7981 14.5031 11.7931 14.5011L11.7902 14.5H9.28818L9.28531 14.5011C9.28032 14.5031 9.27459 14.5068 9.26989 14.5112C8.38926 15.3442 7.52814 15.7659 6.76789 15.7207C5.94591 15.6719 5.41212 15.0943 5.22638 14.346C4.87058 12.9125 5.6901 10.7345 7.90241 8.95105ZM8.5268 9.73218C6.47778 11.3854 5.97219 13.1996 6.19693 14.1051C6.30151 14.5265 6.53465 14.7051 6.82722 14.7225C7.18151 14.7435 7.78255 14.5416 8.58271 13.7847C8.76256 13.6146 9.01277 13.5 9.28548 13.5H11.7929C12.0656 13.5 12.3158 13.6146 12.4957 13.7847C13.2958 14.5416 13.8969 14.7435 14.2512 14.7225C14.5437 14.7051 14.7769 14.5265 14.8814 14.1051C15.1062 13.1996 14.6006 11.3854 12.5516 9.73218H8.5268Z",fill:"currentColor"})]});import{jsx as w,jsxs as T9}from"react/jsx-runtime";var D9=C=>T9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[w("title",{children:"Theme"}),w("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.35355 1C1.25979 1 1.16986 1.03725 1.10355 1.10355C1.03725 1.16986 1 1.25979 1 1.35355V10.4411C1.00712 10.4375 1.01426 10.4339 1.02142 10.4303C1.63745 10.1223 2.36255 10.1223 2.97858 10.4303C2.98574 10.4339 2.99288 10.4375 3 10.4411V1.35355C3 1.25979 2.96275 1.16986 2.89645 1.10355C2.83014 1.03725 2.74021 1 2.64645 1H1.35355ZM3 11.7071L2.84016 11.5473C2.74986 11.457 2.64559 11.3818 2.53136 11.3247C2.19686 11.1574 1.80314 11.1574 1.46864 11.3247C1.35441 11.3818 1.25014 11.457 1.15984 11.5473L1 11.7071V12.7929C1 13.113 1.12718 13.4201 1.35355 13.6464C1.57993 13.8728 1.88696 14 2.20711 14H13.7929C14.113 14 14.4201 13.8728 14.6464 13.6464C14.8728 13.4201 15 13.113 15 12.7929V5.20711C15 4.88696 14.8728 4.57993 14.6464 4.35355C14.4201 4.12718 14.113 4 13.7929 4H4V12.5C4 12.7761 3.77614 13 3.5 13C3.22386 13 3 12.7761 3 12.5V11.7071ZM4 3V1.35355C4 0.994569 3.85739 0.650287 3.60355 0.396447C3.34971 0.142606 3.00543 0 2.64645 0H1.35355C0.994569 0 0.650287 0.142606 0.396447 0.396447C0.142606 0.650287 0 0.994569 0 1.35355V12.7929C0 13.3783 0.232534 13.9396 0.646447 14.3536C1.06036 14.7675 1.62175 15 2.20711 15H13.7929C14.3783 15 14.9396 14.7675 15.3536 14.3536C15.7675 13.9396 16 13.3783 16 12.7929V5.20711C16 4.62175 15.7675 4.06036 15.3536 3.64645C14.9396 3.23253 14.3783 3 13.7929 3H4Z",fill:"currentColor"}),w("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1464 5.14645C11.3417 4.95118 11.6583 4.95118 11.8536 5.14645L12.5 5.79289L13.1464 5.14645C13.3417 4.95118 13.6583 4.95118 13.8536 5.14645C14.0488 5.34171 14.0488 5.65829 13.8536 5.85355L13.2071 6.5L13.8536 7.14645C14.0488 7.34171 14.0488 7.65829 13.8536 7.85355C13.6583 8.04882 13.3417 8.04882 13.1464 7.85355L12.5 7.20711L11.8536 7.85355C11.6583 8.04882 11.3417 8.04882 11.1464 7.85355C10.9512 7.65829 10.9512 7.34171 11.1464 7.14645L11.7929 6.5L11.1464 5.85355C10.9512 5.65829 10.9512 5.34171 11.1464 5.14645Z",fill:"currentColor"}),w("path",{d:"M13 9.5C13 9.77614 12.7761 10 12.5 10C12.2239 10 12 9.77614 12 9.5C12 9.22386 12.2239 9 12.5 9C12.7761 9 13 9.22386 13 9.5Z",fill:"currentColor"}),w("path",{d:"M10.5111 10.5C10.5111 10.7761 10.2872 11 10.0111 11C9.73495 11 9.5111 10.7761 9.5111 10.5C9.5111 10.2239 9.73495 10 10.0111 10C10.2872 10 10.5111 10.2239 10.5111 10.5Z",fill:"currentColor"}),w("path",{d:"M9.54346 9.5C9.54346 9.77614 9.3196 10 9.04346 10C8.76731 10 8.54346 9.77614 8.54346 9.5C8.54346 9.22386 8.76731 9 9.04346 9C9.3196 9 9.54346 9.22386 9.54346 9.5Z",fill:"currentColor"}),w("path",{d:"M8 8.5C8 8.77614 7.77614 9 7.5 9C7.22386 9 7 8.77614 7 8.5C7 8.22386 7.22386 8 7.5 8C7.77614 8 8 8.22386 8 8.5Z",fill:"currentColor"}),w("path",{d:"M6.5 9C6.5 9.27614 6.27614 9.5 6 9.5C5.72386 9.5 5.5 9.27614 5.5 9C5.5 8.72386 5.72386 8.5 6 8.5C6.27614 8.5 6.5 8.72386 6.5 9Z",fill:"currentColor"}),w("path",{d:"M6 10.5C6 10.7761 5.77614 11 5.5 11C5.22386 11 5 10.7761 5 10.5C5 10.2239 5.22386 10 5.5 10C5.77614 10 6 10.2239 6 10.5Z",fill:"currentColor"}),w("path",{d:"M6.5 12C6.5 12.2761 6.27614 12.5 6 12.5C5.72386 12.5 5.5 12.2761 5.5 12C5.5 11.7239 5.72386 11.5 6 11.5C6.27614 11.5 6.5 11.7239 6.5 12Z",fill:"currentColor"}),w("path",{d:"M12 10.5C12 10.7761 11.7761 11 11.5 11C11.2239 11 11 10.7761 11 10.5C11 10.2239 11.2239 10 11.5 10C11.7761 10 12 10.2239 12 10.5Z",fill:"currentColor"})]});import{jsx as o3,jsxs as W9}from"react/jsx-runtime";var _9=C=>W9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[o3("title",{children:"VIP"}),o3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.57342 3.81937C8.83136 3.63851 9 3.33895 9 3C9 2.44772 8.55228 2 8 2C7.44772 2 7 2.44772 7 3C7 3.33886 7.16855 3.63836 7.42638 3.81923L4.81613 7.54816C4.6467 7.79021 4.30544 7.83334 4.08111 7.64105L1.75926 5.65081C1.90933 5.4759 2 5.24854 2 5C2 4.44772 1.55228 4 1 4C0.447715 4 0 4.44772 0 5C0 5.55228 0.447715 6 1 6C1.03731 6 1.07415 5.99796 1.1104 5.99397L1.95022 13.5552C1.97835 13.8084 2.19238 14 2.44717 14H13.5521C13.8069 14 14.0209 13.8084 14.0491 13.5552L14.8895 5.99397C14.9258 5.99795 14.9627 6 15 6C15.5523 6 16 5.55228 16 5C16 4.44772 15.5523 4 15 4C14.4477 4 14 4.44772 14 5C14 5.24852 14.0907 5.47587 14.2407 5.65078L11.9186 7.64108C11.6943 7.83336 11.353 7.79022 11.1836 7.54818L8.57342 3.81937ZM13.7261 7.40893L13.1046 13H2.89471L2.2737 7.40888L3.43031 8.40029C4.10329 8.97716 5.12705 8.84778 5.63536 8.12162L7.99985 4.74378L10.3644 8.12164C10.8727 8.84778 11.8964 8.97718 12.5694 8.40035L13.7261 7.40893Z",fill:"currentColor"})]});import{jsx as l3,jsxs as N9}from"react/jsx-runtime";var O9=C=>N9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[l3("title",{children:"Chat"}),l3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 4.5C0 3.67157 0.671573 3 1.5 3H14.5C15.3284 3 16 3.67157 16 4.5V12.5C16 13.3284 15.3284 14 14.5 14H6.70711L4.85355 15.8536C4.65829 16.0488 4.34171 16.0488 4.14645 15.8536L2.29289 14H1.5C0.671573 14 0 13.3284 0 12.5V4.5ZM1.5 4C1.22386 4 1 4.22386 1 4.5V12.5C1 12.7761 1.22386 13 1.5 13H2.5C2.63261 13 2.75979 13.0527 2.85355 13.1464L4.5 14.7929L6.14645 13.1464C6.24021 13.0527 6.36739 13 6.5 13H14.5C14.7761 13 15 12.7761 15 12.5V4.5C15 4.22386 14.7761 4 14.5 4H1.5Z",fill:"currentColor"})]});import{jsx as t3,jsxs as J9}from"react/jsx-runtime";var U9=C=>J9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[t3("title",{children:"CustomerService"}),t3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.0161 7.02215L4.05876 7.39662C4.81066 7.48916 5.37553 8.12782 5.37553 8.88539V11.3487C5.37553 12.0857 4.84021 12.7134 4.11252 12.8299L1.20407 13.2952C1.06952 13.3167 0.932016 13.2824 0.82336 13.2002C0.714704 13.118 0.644313 12.995 0.628468 12.8596L0.00339183 7.52055C0.00113252 7.50125 0 7.48184 0 7.46241C0 3.30661 3.61786 0 8.00092 0C12.384 0 16.0018 3.30661 16.0018 7.46241C16.0018 7.48184 16.0007 7.50125 15.9984 7.52055L15.3767 12.8313C15.3697 12.8911 15.352 12.9491 15.3244 13.0025L14.3347 14.9201C14.0897 15.3947 13.6109 15.7032 13.0774 15.7302L7.71361 16.0012C7.43782 16.0151 7.20295 15.8029 7.18901 15.5271C7.17508 15.2513 7.38736 15.0164 7.66315 15.0025L13.027 14.7315C13.2048 14.7225 13.3644 14.6196 13.4461 14.4614L14.1164 13.1626L11.9004 12.8251C11.1677 12.7135 10.6263 12.0834 10.6263 11.3422V8.89017C10.6263 8.12954 11.1956 7.48931 11.951 7.40044L14.9872 7.04326C14.7538 3.69926 11.7478 1 8.00092 1C4.26193 1 1.26067 3.68791 1.0161 7.02215ZM14.9288 8.05703L12.0679 8.39359C11.8161 8.42322 11.6263 8.63663 11.6263 8.89017V11.3422C11.6263 11.5893 11.8068 11.7993 12.051 11.8365L14.4436 12.201L14.9288 8.05703ZM1.07062 8.03641L1.56104 12.2254L3.95453 11.8424C4.19709 11.8036 4.37553 11.5944 4.37553 11.3487V8.88539C4.37553 8.63286 4.18724 8.41998 3.93661 8.38913L1.07062 8.03641Z",fill:"currentColor"})]});import{jsx as r3,jsxs as q9}from"react/jsx-runtime";var K9=C=>q9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[r3("title",{children:"Email"}),r3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 2C1.11929 2 0 3.11929 0 4.5V11.5C0 12.8807 1.11929 14 2.5 14H13.5C14.8807 14 16 12.8807 16 11.5V4.5C16 3.11929 14.8807 2 13.5 2H2.5ZM1.98656 3.09018C2.14673 3.03183 2.31965 3 2.5 3H13.5C13.6804 3 13.8534 3.03184 14.0136 3.09022L8.00009 7.38555L1.98656 3.09018ZM1.19752 3.75548C1.07184 3.97487 1 4.22904 1 4.5V11.5C1 12.3284 1.67157 13 2.5 13H13.5C14.3284 13 15 12.3284 15 11.5V4.5C15 4.22908 14.9282 3.97494 14.8025 3.75557L8.29071 8.40687C8.11686 8.53105 7.88332 8.53105 7.70947 8.40687L1.19752 3.75548Z",fill:"currentColor"})]});import{jsx as H1,jsxs as X9}from"react/jsx-runtime";var z9=C=>X9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[H1("title",{children:"Feedback"}),H1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5.20004H3.2V4.20004H1.5C0.671575 4.20004 0 4.87162 0 5.70004V11.5295C0 12.2442 0.579396 12.8236 1.29412 12.8236C1.45655 12.8236 1.58823 12.9553 1.58823 13.1177V15.5C1.58823 15.7023 1.71006 15.8846 1.89689 15.962C2.08373 16.0394 2.29879 15.9966 2.44179 15.8536L5.32537 12.97C5.41913 12.8763 5.54631 12.8236 5.67892 12.8236H10.3C11.1284 12.8236 11.8 12.152 11.8 11.3236V10.22H10.8V11.3236C10.8 11.5997 10.5761 11.8236 10.3 11.8236H5.67892C5.28109 11.8236 4.89956 11.9816 4.61826 12.2629L2.58823 14.2929V13.1177C2.58823 12.403 2.00884 11.8236 1.29412 11.8236C1.13168 11.8236 1 11.6919 1 11.5295V5.70004C1 5.4239 1.22386 5.20004 1.5 5.20004Z",fill:"currentColor"}),H1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.99997 1.5C2.99997 0.671574 3.67154 0 4.49997 0H14.5C15.3284 0 16 0.671573 16 1.5V8.08823C16 8.85169 15.3811 9.47059 14.6176 9.47059C14.4065 9.47059 14.2353 9.64177 14.2353 9.85294V12.5C14.2353 12.7022 14.1134 12.8846 13.9266 12.9619C13.7398 13.0393 13.5247 12.9966 13.3817 12.8536L10.1452 9.61703C10.0514 9.52327 9.92425 9.47059 9.79164 9.47059H4.49997C3.67154 9.47059 2.99997 8.79902 2.99997 7.97059V1.5ZM4.49997 1C4.22383 1 3.99997 1.22386 3.99997 1.5V7.97059C3.99997 8.24673 4.22383 8.47059 4.49997 8.47059H9.79164C10.1895 8.47059 10.571 8.62862 10.8523 8.90993L13.2353 11.2929V9.85294C13.2353 9.08949 13.8542 8.47059 14.6176 8.47059C14.8288 8.47059 15 8.2994 15 8.08823V1.5C15 1.22386 14.7761 1 14.5 1H4.49997Z",fill:"currentColor"}),H1("path",{d:"M6.28183 3.95034C6.32494 3.81767 6.51263 3.81767 6.55574 3.95034L6.66974 4.30119C6.68901 4.36052 6.7443 4.40069 6.80669 4.40069H7.1756C7.31509 4.40069 7.37309 4.5792 7.26024 4.66119L6.96178 4.87803C6.91131 4.9147 6.8902 4.9797 6.90947 5.03903L7.02347 5.38988C7.06658 5.52255 6.91473 5.63287 6.80188 5.55088L6.50343 5.33404C6.45296 5.29737 6.38461 5.29737 6.33414 5.33404L6.03569 5.55088C5.92283 5.63287 5.77099 5.52255 5.8141 5.38988L5.9281 5.03903C5.94737 4.9797 5.92625 4.9147 5.87578 4.87803L5.57733 4.66119C5.46448 4.5792 5.52247 4.40069 5.66197 4.40069H6.03088C6.09327 4.40069 6.14855 4.36052 6.16783 4.30119L6.28183 3.95034Z",fill:"currentColor"}),H1("path",{d:"M9.36255 3.95034C9.40565 3.81767 9.59334 3.81767 9.63645 3.95034L9.75045 4.30119C9.76973 4.36052 9.82502 4.40069 9.8874 4.40069H10.2563C10.3958 4.40069 10.4538 4.5792 10.341 4.66119L10.0425 4.87803C9.99203 4.9147 9.97091 4.9797 9.99019 5.03903L10.1042 5.38988C10.1473 5.52255 9.99545 5.63287 9.88259 5.55088L9.58414 5.33404C9.53367 5.29737 9.46533 5.29737 9.41486 5.33404L9.1164 5.55088C9.00355 5.63287 8.8517 5.52255 8.89481 5.38988L9.00881 5.03903C9.02809 4.9797 9.00697 4.9147 8.9565 4.87803L8.65804 4.66119C8.54519 4.5792 8.60319 4.40069 8.74268 4.40069H9.11159C9.17398 4.40069 9.22927 4.36052 9.24855 4.30119L9.36255 3.95034Z",fill:"currentColor"}),H1("path",{d:"M12.4432 3.95034C12.4863 3.81767 12.674 3.81767 12.7171 3.95034L12.8311 4.30119C12.8504 4.36052 12.9057 4.40069 12.9681 4.40069H13.337C13.4765 4.40069 13.5345 4.5792 13.4216 4.66119L13.1232 4.87803C13.0727 4.9147 13.0516 4.9797 13.0709 5.03903L13.1849 5.38988C13.228 5.52255 13.0761 5.63287 12.9633 5.55088L12.6648 5.33404C12.6143 5.29737 12.546 5.29737 12.4955 5.33404L12.1971 5.55088C12.0842 5.63287 11.9324 5.52255 11.9755 5.38988L12.0895 5.03903C12.1088 4.9797 12.0876 4.9147 12.0372 4.87803L11.7387 4.66119C11.6259 4.5792 11.6839 4.40069 11.8234 4.40069H12.1923C12.2547 4.40069 12.3099 4.36052 12.3292 4.30119L12.4432 3.95034Z",fill:"currentColor"})]});import{jsx as M1,jsxs as Q9}from"react/jsx-runtime";var Y9=C=>Q9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[M1("title",{children:"Message"}),M1("path",{d:"M2 6C2 5.72386 2.22386 5.5 2.5 5.5H9.5C9.77614 5.5 10 5.72386 10 6C10 6.27614 9.77614 6.5 9.5 6.5H2.5C2.22386 6.5 2 6.27614 2 6Z",fill:"currentColor"}),M1("path",{d:"M2 8C2 7.72386 2.22386 7.5 2.5 7.5H6.5C6.77614 7.5 7 7.72386 7 8C7 8.27614 6.77614 8.5 6.5 8.5H2.5C2.22386 8.5 2 8.27614 2 8Z",fill:"currentColor"}),M1("path",{d:"M8 8C8 7.72386 8.22386 7.5 8.5 7.5H12.5C12.7761 7.5 13 7.72386 13 8C13 8.27614 12.7761 8.5 12.5 8.5H8.5C8.22386 8.5 8 8.27614 8 8Z",fill:"currentColor"}),M1("path",{d:"M2 10C2 9.72386 2.22386 9.5 2.5 9.5H11.5C11.7761 9.5 12 9.72386 12 10C12 10.2761 11.7761 10.5 11.5 10.5H2.5C2.22386 10.5 2 10.2761 2 10Z",fill:"currentColor"}),M1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 2C0.671573 2 0 2.67157 0 3.5V12.5C0 13.3284 0.671573 14 1.5 14H2.08579C2.21839 14 2.34557 14.0527 2.43934 14.1464L4.07574 15.7828C4.31005 16.0172 4.68995 16.0172 4.92426 15.7828L6.56066 14.1464C6.65443 14.0527 6.78161 14 6.91421 14H13.5C14.3284 14 15 13.3284 15 12.5V3.5C15 2.67157 14.3284 2 13.5 2H1.5ZM1 3.5C1 3.22386 1.22386 3 1.5 3H13.5C13.7761 3 14 3.22386 14 3.5V12.5C14 12.7761 13.7761 13 13.5 13H6.91421C6.51639 13 6.13486 13.158 5.85355 13.4393L4.5 14.7929L3.14645 13.4393C2.86514 13.158 2.48361 13 2.08579 13H1.5C1.22386 13 1 12.7761 1 12.5V3.5Z",fill:"currentColor"})]});import{jsx as d1,jsxs as j9}from"react/jsx-runtime";var $9=C=>j9("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[d1("title",{children:"MessageNew"}),d1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 3C16 4.10457 15.1046 5 14 5C12.8954 5 12 4.10457 12 3C12 1.89543 12.8954 1 14 1C15.1046 1 16 1.89543 16 3ZM15 3C15 3.55228 14.5523 4 14 4C13.4477 4 13 3.55228 13 3C13 2.44772 13.4477 2 14 2C14.5523 2 15 2.44772 15 3Z",fill:"currentColor"}),d1("path",{d:"M1.5 3C1.22386 3 1 3.22386 1 3.5V12.5C1 12.7761 1.22386 13 1.5 13H2.08579C2.48361 13 2.86514 13.158 3.14645 13.4393L4.5 14.7929L5.85355 13.4393C6.13486 13.158 6.51639 13 6.91421 13H13.5C13.7761 13 14 12.7761 14 12.5V6.5C14 6.22386 14.2239 6 14.5 6C14.7761 6 15 6.22386 15 6.5V12.5C15 13.3284 14.3284 14 13.5 14H6.91421C6.78161 14 6.65443 14.0527 6.56066 14.1464L4.92426 15.7828C4.68995 16.0172 4.31005 16.0172 4.07574 15.7828L2.43934 14.1464C2.34557 14.0527 2.21839 14 2.08579 14H1.5C0.671573 14 0 13.3284 0 12.5V3.5C0 2.67157 0.671573 2 1.5 2H10.5C10.7761 2 11 2.22386 11 2.5C11 2.77614 10.7761 3 10.5 3H1.5Z",fill:"currentColor"}),d1("path",{d:"M2.5 5.5C2.22386 5.5 2 5.72386 2 6C2 6.27614 2.22386 6.5 2.5 6.5H9.5C9.77614 6.5 10 6.27614 10 6C10 5.72386 9.77614 5.5 9.5 5.5H2.5Z",fill:"currentColor"}),d1("path",{d:"M2.5 7.5C2.22386 7.5 2 7.72386 2 8C2 8.27614 2.22386 8.5 2.5 8.5H6.5C6.77614 8.5 7 8.27614 7 8C7 7.72386 6.77614 7.5 6.5 7.5H2.5Z",fill:"currentColor"}),d1("path",{d:"M8.5 7.5C8.22386 7.5 8 7.72386 8 8C8 8.27614 8.22386 8.5 8.5 8.5H12.5C12.7761 8.5 13 8.27614 13 8C13 7.72386 12.7761 7.5 12.5 7.5H8.5Z",fill:"currentColor"}),d1("path",{d:"M2.5 9.5C2.22386 9.5 2 9.72386 2 10C2 10.2761 2.22386 10.5 2.5 10.5H11.5C11.7761 10.5 12 10.2761 12 10C12 9.72386 11.7761 9.5 11.5 9.5H2.5Z",fill:"currentColor"})]});import{jsx as i3,jsxs as eC}from"react/jsx-runtime";var CC=C=>eC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[i3("title",{children:"Notification"}),i3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 3.00051C16 2.05394 15.134 1.344 14.2058 1.52964L1.20583 4.12964C0.50469 4.26987 0 4.88549 0 5.60051V8.90519C0 9.65699 0.556545 10.2927 1.30175 10.392L2 10.4851V12.9999C2 13.6882 2.46845 14.2882 3.1362 14.4551L5.1362 14.9551C6.08292 15.1918 7 14.4758 7 13.4999V11.1518L14.3018 12.1254C15.201 12.2453 16 11.5457 16 10.6385V3.00051ZM14.4019 2.51022C14.7113 2.44834 15 2.68499 15 3.00051V10.6385C15 10.9409 14.7337 11.1741 14.4339 11.1341L13 10.9429V2.79061L14.4019 2.51022ZM12 2.99061L1.40194 5.11022C1.16823 5.15696 1 5.36217 1 5.60051V8.90519C1 9.15579 1.18552 9.36768 1.43392 9.4008L12 10.8096V2.99061ZM3 12.9999V10.6185L6 11.0185V13.4999C6 13.8252 5.69431 14.0639 5.37873 13.985L3.37873 13.485C3.15615 13.4294 3 13.2294 3 12.9999Z",fill:"currentColor"})]});import{jsx as n3,jsxs as lC}from"react/jsx-runtime";var oC=C=>lC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[n3("title",{children:"Alert"}),n3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.14369 3.08591C3.39433 4.29754 3.11695 5.81608 3.02724 6.9881C2.93868 8.14503 2.77161 9.35789 2.29422 10.4905L1.72356 12H14.2941L13.7296 10.3951C13.3123 9.31905 13.1703 8.17887 13.0959 7.09191C13.0161 5.92669 12.7523 4.38079 12.0052 3.14052C11.278 1.93316 10.0885 1 8.0578 1C6.05618 1 4.87316 1.90643 4.14369 3.08591ZM3.2932 2.55991C4.18634 1.1158 5.67581 0 8.0578 0C10.4769 0 11.974 1.1506 12.8618 2.62455C13.7299 4.0656 14.0097 5.79857 14.0936 7.02359C14.1662 8.08465 14.3009 9.10578 14.6645 10.0402L14.6702 10.0557L15.4717 12.3341C15.5255 12.4871 15.5018 12.6567 15.408 12.789C15.3143 12.9213 15.1622 13 15 13H11C11 13.8627 10.7209 14.6229 10.1792 15.1691C9.63687 15.716 8.87621 16.0029 7.99983 16.0029C7.12344 16.0029 6.36284 15.7159 5.82059 15.1691C5.27897 14.6229 5 13.8626 5 13H1C0.835778 13 0.682023 12.9194 0.588661 12.7843C0.495299 12.6491 0.474235 12.4768 0.532307 12.3232L1.3622 10.1279C1.36449 10.1219 1.3669 10.1159 1.36942 10.1099C1.78554 9.12649 1.94376 8.04045 2.03016 6.91178C2.12457 5.67831 2.41994 3.97188 3.2932 2.55991ZM6 13C6 13.6456 6.20525 14.1368 6.53068 14.465C6.85549 14.7925 7.34481 15.0029 7.99983 15.0029C8.65486 15.0029 9.14428 14.7925 9.46919 14.4649C9.7947 14.1367 10 13.6455 10 13H6Z",fill:"currentColor"})]});import{jsx as O2,jsxs as rC}from"react/jsx-runtime";var tC=C=>rC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[O2("title",{children:"AlertOff"}),O2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.05797 1C6.85949 1 5.96834 1.32465 5.29516 1.81653C5.0722 1.97945 4.75938 1.93077 4.59646 1.70781C4.43355 1.48484 4.48222 1.17202 4.70519 1.00911C5.56389 0.381662 6.66577 1.49012e-08 8.05797 1.49012e-08C10.477 1.49012e-08 11.9742 1.1506 12.862 2.62455C13.73 4.0656 14.0098 5.79857 14.0937 7.02359C14.1664 8.08465 14.301 9.10578 14.6647 10.0402C14.7649 10.2976 14.6374 10.5874 14.3801 10.6875C14.1227 10.7877 13.8329 10.6602 13.7328 10.4029C13.3131 9.32458 13.1707 8.1815 13.0961 7.09191C13.0163 5.92669 12.7525 4.38079 12.0054 3.14052C11.2782 1.93316 10.0887 1 8.05797 1ZM3.5658 3.0464C3.81631 3.16258 3.92522 3.45984 3.80904 3.71035C3.30611 4.79486 3.10185 6.01565 3.02741 6.9881C2.93886 8.14503 2.77178 9.35789 2.29439 10.4905L1.72373 12H12.5002C12.7763 12 13.0002 12.2239 13.0002 12.5C13.0002 12.7761 12.7763 13 12.5002 13H11.0002C11.0002 13.8627 10.7211 14.6229 10.1794 15.1691C9.63704 15.716 8.87638 16.0029 8 16.0029C7.12361 16.0029 6.36302 15.7159 5.82077 15.1691C5.27914 14.6229 5.00017 13.8626 5.00017 13H1.00017C0.83595 13 0.682195 12.9194 0.588833 12.7843C0.495471 12.6491 0.474407 12.4768 0.532479 12.3232L1.36237 10.1279C1.36466 10.1219 1.36707 10.1159 1.36959 10.1099C1.78571 9.12649 1.94394 8.04045 2.03033 6.91178C2.10936 5.87932 2.32853 4.52593 2.90184 3.28965C3.01802 3.03913 3.31528 2.93023 3.5658 3.0464ZM6.00017 13C6.00017 13.6456 6.20542 14.1368 6.53085 14.465C6.85566 14.7925 7.34498 15.0029 8 15.0029C8.65503 15.0029 9.14445 14.7925 9.46936 14.4649C9.79488 14.1367 10.0002 13.6455 10.0002 13H6.00017Z",fill:"currentColor"}),O2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.146447 0.146447C0.341709 -0.0488155 0.658291 -0.0488155 0.853553 0.146447L15.8536 15.1464C16.0488 15.3417 16.0488 15.6583 15.8536 15.8536C15.6583 16.0488 15.3417 16.0488 15.1464 15.8536L0.146447 0.853553C-0.0488155 0.658291 -0.0488155 0.341709 0.146447 0.146447Z",fill:"currentColor"})]});import{jsx as d3,jsxs as nC}from"react/jsx-runtime";var iC=C=>nC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[d3("title",{children:"ErrorHexagon"}),d3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.57322 0.21967C4.71388 0.0790174 4.90464 0 5.10355 0H10.8964C11.0954 0 11.2861 0.0790178 11.4268 0.21967L15.7803 4.57322C15.921 4.71388 16 4.90464 16 5.10355V10.8964C16 11.0954 15.921 11.2861 15.7803 11.4268L11.4268 15.7803C11.2861 15.921 11.0954 16 10.8964 16H5.10355C4.90464 16 4.71388 15.921 4.57322 15.7803L0.21967 11.4268C0.0790174 11.2861 0 11.0954 0 10.8964V5.10355C0 4.90464 0.0790178 4.71388 0.21967 4.57322L4.57322 0.21967ZM5.20711 1L1 5.20711V10.7929L5.20711 15H10.7929L15 10.7929V5.20711L10.7929 1H5.20711ZM4.14645 4.14645C4.34171 3.95118 4.65829 3.95118 4.85355 4.14645L11.8536 11.1464C12.0488 11.3417 12.0488 11.6583 11.8536 11.8536C11.6583 12.0488 11.3417 12.0488 11.1464 11.8536L4.14645 4.85355C3.95118 4.65829 3.95118 4.34171 4.14645 4.14645Z",fill:"currentColor"})]});import{jsx as N2,jsxs as pC}from"react/jsx-runtime";var dC=C=>pC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[N2("title",{children:"Information"}),N2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 13.9994C7.72386 13.9994 7.5 13.7756 7.5 13.4994L7.5 5.49944C7.5 5.2233 7.72386 4.99944 8 4.99944C8.27614 4.99944 8.5 5.2233 8.5 5.49944L8.5 13.4994C8.5 13.7756 8.27614 13.9994 8 13.9994Z",fill:"currentColor"}),N2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 4.00402C7.72386 4.00402 7.5 3.78016 7.5 3.50402L7.5 2.5C7.5 2.22386 7.72386 2 8 2C8.27614 2 8.5 2.22386 8.5 2.5L8.5 3.50402C8.5 3.78016 8.27614 4.00402 8 4.00402Z",fill:"currentColor"})]});import{jsx as D5,jsxs as cC}from"react/jsx-runtime";var sC=C=>cC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[D5("title",{children:"InformationCircle"}),D5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),D5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 13C7.72386 13 7.5 12.7761 7.5 12.5L7.5 6.49999C7.5 6.22385 7.72386 5.99999 8 5.99999C8.27614 5.99999 8.5 6.22385 8.5 6.49999L8.5 12.5C8.5 12.7761 8.27614 13 8 13Z",fill:"currentColor"}),D5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 4.99999C7.72386 4.99999 7.5 4.77613 7.5 4.49999V3.5C7.5 3.22386 7.72386 3 8 3C8.27614 3 8.5 3.22386 8.5 3.5V4.49999C8.5 4.77613 8.27614 4.99999 8 4.99999Z",fill:"currentColor"})]});import{jsx as U2,jsxs as hC}from"react/jsx-runtime";var fC=C=>hC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[U2("title",{children:"TagTick"}),U2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5 2.30438e-05C15.7762 2.42028e-05 16 0.223882 16 0.500023L16 6.50002C16 6.63262 15.9473 6.7598 15.8536 6.85357L6.85356 15.8536C6.65829 16.0488 6.34171 16.0488 6.14645 15.8536L0.146447 9.85357C0.0526787 9.7598 7.3757e-07 9.63262 0 9.50002C6.11129e-07 9.36741 0.0526785 9.24023 0.146447 9.14646L9.14646 0.146447C9.24023 0.052678 9.36741 -4.63612e-07 9.50002 0L15.5 2.30438e-05ZM9.70712 1L1.20711 9.50002L6.5 14.7929L15 6.29291L15 1.00002L9.70712 1Z",fill:"currentColor"}),U2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.8536 5.14647C12.0488 5.34173 12.0488 5.65832 11.8535 5.85357L7.85341 9.8536C7.75964 9.94737 7.63246 10 7.49985 10C7.36724 10 7.24006 9.94735 7.1463 9.85358L5.14644 7.85358C4.95118 7.65831 4.95119 7.34173 5.14646 7.14647C5.34173 6.95122 5.65831 6.95123 5.85357 7.1465L7.49988 8.79293L11.1465 5.14646C11.3417 4.9512 11.6583 4.9512 11.8536 5.14647Z",fill:"currentColor"})]});import{jsx as J2,jsxs as LC}from"react/jsx-runtime";var aC=C=>LC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[J2("title",{children:"Warning"}),J2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 2C8.27614 2 8.5 2.22386 8.5 2.5V10.5C8.5 10.7761 8.27614 11 8 11C7.72386 11 7.5 10.7761 7.5 10.5V2.5C7.5 2.22386 7.72386 2 8 2Z",fill:"currentColor"}),J2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 11.9954C8.27614 11.9954 8.5 12.2193 8.5 12.4954V13.4994C8.5 13.7756 8.27614 13.9994 8 13.9994C7.72386 13.9994 7.5 13.7756 7.5 13.4994V12.4954C7.5 12.2193 7.72386 11.9954 8 11.9954Z",fill:"currentColor"})]});import{jsx as T5,jsxs as uC}from"react/jsx-runtime";var gC=C=>uC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[T5("title",{children:"WarningCircle"}),T5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),T5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 3C8.27614 3 8.5 3.22386 8.5 3.5V9.5C8.5 9.77614 8.27614 10 8 10C7.72386 10 7.5 9.77614 7.5 9.5V3.5C7.5 3.22386 7.72386 3 8 3Z",fill:"currentColor"}),T5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 11C8.27614 11 8.5 11.2239 8.5 11.5V12.5C8.5 12.7761 8.27614 13 8 13C7.72386 13 7.5 12.7761 7.5 12.5V11.5C7.5 11.2239 7.72386 11 8 11Z",fill:"currentColor"})]});import{jsx as _5,jsxs as vC}from"react/jsx-runtime";var VC=C=>vC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[_5("title",{children:"WarningDiamond"}),_5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 3C8.27614 3 8.5 3.22386 8.5 3.5V9.5C8.5 9.77614 8.27614 10 8 10C7.72386 10 7.5 9.77614 7.5 9.5V3.5C7.5 3.22386 7.72386 3 8 3Z",fill:"currentColor"}),_5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 11C8.27614 11 8.5 11.2239 8.5 11.5V12.5C8.5 12.7761 8.27614 13 8 13C7.72386 13 7.5 12.7761 7.5 12.5V11.5C7.5 11.2239 7.72386 11 8 11Z",fill:"currentColor"}),_5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0C8.13433 0 8.26302 0.0540541 8.35705 0.149983L15.8571 7.80079C15.9499 7.89549 16.0013 8.02321 16 8.15583C15.9986 8.28845 15.9447 8.4151 15.8499 8.50793L8.34995 15.8572C8.15554 16.0477 7.84446 16.0477 7.65005 15.8572L0.150054 8.50793C0.0553267 8.4151 0.00135876 8.28845 2.52817e-05 8.15583C-0.00130751 8.02321 0.0501033 7.89549 0.142946 7.80079L7.64295 0.149983C7.73698 0.0540541 7.86567 0 8 0ZM8 1.21425L1.20714 8.14369L8 14.8L14.7929 8.14369L8 1.21425Z",fill:"currentColor"})]});import{jsx as W5,jsxs as wC}from"react/jsx-runtime";var mC=C=>wC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[W5("title",{children:"WarningTriangle"}),W5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.12567 1.5439C7.50667 0.858088 8.49298 0.858089 8.87398 1.5439L15.5242 13.5143C15.8945 14.1809 15.4126 15 14.6501 15H1.34958C0.587098 15 0.105131 14.1809 0.475426 13.5143L7.12567 1.5439ZM7.99983 2.02954L1.34958 14H14.6501L7.99983 2.02954Z",fill:"currentColor"}),W5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99983 5.49998C8.27597 5.49998 8.49983 5.72384 8.49983 5.99998V9.49998C8.49983 9.77612 8.27597 9.99998 7.99983 9.99998C7.72368 9.99998 7.49983 9.77612 7.49983 9.49998V5.99998C7.49983 5.72384 7.72368 5.49998 7.99983 5.49998Z",fill:"currentColor"}),W5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99983 11C8.27597 11 8.49983 11.2238 8.49983 11.5V12.5C8.49983 12.7761 8.27597 13 7.99983 13C7.72368 13 7.49983 12.7761 7.49983 12.5V11.5C7.49983 11.2238 7.72368 11 7.99983 11Z",fill:"currentColor"})]});import{jsx as p3,jsxs as MC}from"react/jsx-runtime";var HC=C=>MC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[p3("title",{children:"Bank"}),p3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.79025 0.0468906C7.92428 -0.0156427 8.07911 -0.0156296 8.21313 0.0469263L15.7115 3.54693C15.8875 3.62909 16 3.80575 16 4V5.5C16 5.77614 15.7761 6 15.5 6H0.5C0.223858 6 0 5.77614 0 5.5V4C0 3.80572 0.112538 3.62903 0.288596 3.54689L7.79025 0.0468906ZM1 4.31846V5H15V4.3184L8.00161 1.05176L1 4.31846ZM3.5 8C3.77614 8 4 8.22386 4 8.5V15H7.49718L7.5 8.49978C7.50012 8.22364 7.72407 7.99988 8.00022 8C8.27636 8.00012 8.50012 8.22407 8.5 8.50022L8.49718 15H12V8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5V15H15.497C15.7731 15 15.997 15.2239 15.997 15.5C15.997 15.7761 15.7731 16 15.497 16H7.99719H0.5C0.223858 16 0 15.7761 0 15.5C0 15.2239 0.223858 15 0.5 15H3V8.5C3 8.22386 3.22386 8 3.5 8Z",fill:"currentColor"})]});import{jsx as s3,jsxs as ZC}from"react/jsx-runtime";var RC=C=>ZC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[s3("title",{children:"Card"}),s3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3.5C0 3.22386 0.223858 3 0.5 3H15.5C15.6326 3 15.7598 3.05268 15.8536 3.14645C15.9473 3.24021 16 3.36739 16 3.5V12.5C16 12.7761 15.7761 13 15.5 13H0.5C0.223858 13 0 12.7761 0 12.5V3.5ZM1 7V12H15L15 7H1ZM15 6H1V4H15V6ZM3 9.5C3 9.22386 3.22386 9 3.5 9H8.5C8.77614 9 9 9.22386 9 9.5C9 9.77614 8.77614 10 8.5 10H3.5C3.22386 10 3 9.77614 3 9.5Z",fill:"currentColor"})]});import{jsx as c3,jsxs as GC}from"react/jsx-runtime";var SC=C=>GC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[c3("title",{children:"CardPlus"}),c3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3.5C0 3.22386 0.223858 3 0.5 3H7.5C7.77614 3 8 3.22386 8 3.5C8 3.77614 7.77614 4 7.5 4H1V6H7.5C7.77614 6 8 6.22386 8 6.5C8 6.77614 7.77614 7 7.5 7H1V12H15V8.5C15 8.22386 15.2239 8 15.5 8C15.7761 8 16 8.22386 16 8.5V12.5C16 12.7761 15.7761 13 15.5 13H0.5C0.223858 13 0 12.7761 0 12.5V3.5ZM12.5 3C12.7761 3 13 3.22386 13 3.5V6H15.5C15.7761 6 16 6.22386 16 6.5C16 6.77614 15.7761 7 15.5 7H13V9.5C13 9.77614 12.7761 10 12.5 10C12.2239 10 12 9.77614 12 9.5V7H9.5C9.22386 7 9 6.77614 9 6.5C9 6.22386 9.22386 6 9.5 6H12V3.5C12 3.22386 12.2239 3 12.5 3ZM2 9.5C2 9.22386 2.22386 9 2.5 9H7.5C7.77614 9 8 9.22386 8 9.5C8 9.77614 7.77614 10 7.5 10H2.5C2.22386 10 2 9.77614 2 9.5Z",fill:"currentColor"})]});import{jsx as R1,jsxs as xC}from"react/jsx-runtime";var PC=C=>xC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[R1("title",{children:"Cashout"}),R1("path",{d:"M7.5 7V1.56751L5.3201 3.38409C5.10797 3.56087 4.79268 3.53221 4.6159 3.32007C4.43912 3.10793 4.46778 2.79265 4.67992 2.61587L7.6159 0.169219C7.62718 0.15982 7.63872 0.150898 7.65049 0.142453C7.74063 0.0543204 7.86397 0 8 0C8.13599 0 8.25931 0.0542928 8.34945 0.142385C8.36125 0.150851 8.37282 0.159795 8.38412 0.169219L11.3201 2.61587C11.5322 2.79265 11.5609 3.10793 11.3841 3.32007C11.2073 3.53221 10.8921 3.56087 10.6799 3.38409L8.5 1.56749V7C8.5 7.27614 8.27614 7.5 8 7.5C7.72386 7.5 7.5 7.27614 7.5 7Z",fill:"currentColor"}),R1("path",{d:"M0 5.5C0 5.22386 0.223858 5 0.5 5H5.5C5.77614 5 6 5.22386 6 5.5C6 5.77614 5.77614 6 5.5 6H0.5C0.223858 6 0 5.77614 0 5.5Z",fill:"currentColor"}),R1("path",{d:"M10 5.5C10 5.22386 10.2239 5 10.5 5H15.5C15.7761 5 16 5.22386 16 5.5C16 5.77614 15.7761 6 15.5 6H10.5C10.2239 6 10 5.77614 10 5.5Z",fill:"currentColor"}),R1("path",{d:"M0 8C0 7.44772 0.447716 7 1 7H5.5C5.77614 7 6 7.22386 6 7.5C6 7.77614 5.77614 8 5.5 8H1V15H15V8H11C10.7239 8 10.5 7.77614 10.5 7.5C10.5 7.22386 10.7239 7 11 7H15C15.5523 7 16 7.44772 16 8V15C16 15.5523 15.5523 16 15 16H1C0.447715 16 0 15.5523 0 15V8Z",fill:"currentColor"}),R1("path",{d:"M8.61802 14.16V13.524H8.76202C9.33202 13.524 9.64402 13.212 9.64402 12.642V11.814C9.64402 11.484 9.46402 11.268 9.09802 11.172L7.84402 10.836C7.74202 10.806 7.71202 10.764 7.71202 10.668V10.212C7.71202 10.11 7.76002 10.062 7.86202 10.062H8.54002C8.64202 10.062 8.69002 10.11 8.69002 10.212V10.59H9.59602V10.176C9.59602 9.60602 9.29002 9.29402 8.73802 9.29402H8.61802V8.65802H7.82002V9.29402H7.68802C7.11802 9.29402 6.80602 9.60602 6.80602 10.176V10.878C6.80602 11.28 7.05202 11.478 7.26802 11.538L8.58802 11.892C8.69002 11.922 8.73202 11.958 8.73202 12.042V12.606C8.73202 12.708 8.68402 12.756 8.58202 12.756H7.82602C7.72402 12.756 7.67602 12.708 7.67602 12.606V12.264H6.77002V12.642C6.77002 13.212 7.07602 13.524 7.62802 13.524H7.82002V14.16H8.61802Z",fill:"currentColor"})]});import{jsx as K2,jsxs as yC}from"react/jsx-runtime";var bC=C=>yC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[K2("title",{children:"CreditCard"}),K2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 3C0.671573 3 0 3.67157 0 4.5V11.5C0 12.3284 0.671573 13 1.5 13H14.5C15.3284 13 16 12.3284 16 11.5V4.5C16 3.67157 15.3284 3 14.5 3H1.5ZM15 6V4.5C15 4.22386 14.7761 4 14.5 4H1.5C1.22386 4 1 4.22386 1 4.5V6H15ZM1 8V11.5C1 11.7761 1.22386 12 1.5 12H14.5C14.7761 12 15 11.7761 15 11.5V8H1Z",fill:"currentColor"}),K2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 10.5C9 10.2239 9.22386 10 9.5 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H9.5C9.22386 11 9 10.7761 9 10.5Z",fill:"currentColor"})]});import{jsx as p5,jsxs as BC}from"react/jsx-runtime";var IC=C=>BC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[p5("title",{children:"CVV"}),p5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3.5C0 3.22386 0.223858 3 0.5 3H14.5C14.7761 3 15 3.22386 15 3.5V6.91369C15.6286 7.76779 16 8.82255 16 9.96413C16 12.8118 13.6889 15.1193 10.8393 15.1193C9.12723 15.1193 7.52581 14.2925 6.53186 12.999C6.52132 12.9997 6.5107 13 6.5 13H0.5C0.223858 13 0 12.7761 0 12.5V3.5ZM5.93164 12C5.72062 11.5334 5.58025 11.0298 5.52563 10.5H3.5C3.22386 10.5 3 10.2761 3 10C3 9.72386 3.22386 9.5 3.5 9.5H5.52561C5.59964 8.78035 5.83127 8.10357 6.18324 7.5H1V12H5.93164ZM1 6.5H6.93792C7.9317 5.46086 9.34053 4.80896 10.8393 4.80896C12.03 4.80896 13.1267 5.21182 14 5.88863V4H1V6.5ZM10.8393 5.80896C8.52137 5.80896 6.5 7.72484 6.5 10C6.5 12.2654 8.51109 14.1193 10.8393 14.1193C13.1378 14.1193 15 12.2584 15 9.96413C15 7.66985 13.1378 5.80896 10.8393 5.80896Z",fill:"currentColor"}),p5("path",{d:"M8.98977 11.3299H8.3554V9.31276L7.73229 9.4946V9.0147L8.93159 8.6004H8.98977V11.3299Z",fill:"currentColor"}),p5("path",{d:"M11.7206 11.3299H9.8137V10.9174L10.6921 9.99513C10.9085 9.74893 11.0168 9.55334 11.0168 9.40837C11.0168 9.29089 10.9911 9.20153 10.9398 9.1403C10.8885 9.07906 10.8141 9.04844 10.7165 9.04844C10.6201 9.04844 10.5419 9.08968 10.4819 9.17216C10.4218 9.2534 10.3918 9.35525 10.3918 9.47773H9.7574C9.7574 9.31026 9.79932 9.15592 9.88315 9.0147C9.96698 8.87222 10.0833 8.761 10.2322 8.68101C10.3811 8.60103 10.5475 8.56104 10.7315 8.56104C11.0268 8.56104 11.2539 8.62915 11.4128 8.76537C11.5729 8.90159 11.653 9.09718 11.653 9.35213C11.653 9.45961 11.633 9.56459 11.5929 9.66707C11.5529 9.7683 11.4903 9.87515 11.4053 9.98763C11.3214 10.0989 11.1857 10.2482 10.998 10.4357L10.6451 10.8425H11.7206V11.3299Z",fill:"currentColor"}),p5("path",{d:"M12.6177 9.70081H12.9161C13.1526 9.70081 13.2708 9.58521 13.2708 9.354C13.2708 9.26402 13.2427 9.19091 13.1864 9.13467C13.1301 9.07718 13.0506 9.04844 12.948 9.04844C12.8642 9.04844 12.791 9.07281 12.7284 9.12155C12.6671 9.17029 12.6365 9.2309 12.6365 9.30339H12.004C12.004 9.15967 12.044 9.03157 12.1241 8.91909C12.2042 8.80661 12.3149 8.71913 12.4563 8.65664C12.5989 8.5929 12.7553 8.56104 12.9255 8.56104C13.2296 8.56104 13.4685 8.6304 13.6425 8.76912C13.8164 8.90784 13.9033 9.09843 13.9033 9.34088C13.9033 9.45836 13.8671 9.56959 13.7945 9.67456C13.7232 9.77829 13.6187 9.86265 13.4811 9.92764C13.6262 9.98013 13.7401 10.0601 13.8226 10.1676C13.9052 10.2738 13.9465 10.4057 13.9465 10.5631C13.9465 10.8068 13.8527 11.0018 13.665 11.148C13.4773 11.2942 13.2308 11.3674 12.9255 11.3674C12.7466 11.3674 12.5802 11.3336 12.4263 11.2661C12.2736 11.1974 12.1579 11.103 12.0791 10.9831C12.0002 10.8618 11.9608 10.7244 11.9608 10.5706H12.5971C12.5971 10.6544 12.6308 10.7269 12.6984 10.7881C12.766 10.8493 12.8492 10.88 12.948 10.88C13.0594 10.88 13.1482 10.8493 13.2145 10.7881C13.2809 10.7256 13.314 10.6462 13.314 10.55C13.314 10.4125 13.2796 10.3151 13.2108 10.2576C13.142 10.2001 13.0469 10.1713 12.9255 10.1713H12.6177V9.70081Z",fill:"currentColor"})]});import{jsx as Y,jsxs as EC}from"react/jsx-runtime";var kC=C=>EC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Y("title",{children:"Deposit"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0C8.27614 0 8.5 0.223858 8.5 0.5V5.79288L10.6464 3.64644C10.8417 3.45117 11.1583 3.45117 11.3536 3.64644C11.5488 3.8417 11.5488 4.15828 11.3536 4.35354L8.35355 7.35354C8.15829 7.5488 7.84171 7.5488 7.64645 7.35354L4.64645 4.35354C4.45118 4.15828 4.45118 3.8417 4.64645 3.64644C4.84171 3.45117 5.15829 3.45117 5.35355 3.64644L7.5 5.79288V0.5C7.5 0.223858 7.72386 0 8 0Z",fill:"currentColor"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.41604 15C3.14845 14.3875 3 13.7111 3 13C3 10.2386 5.23858 7.99999 8 7.99999C10.7614 7.99999 13 10.2386 13 13C13 13.7111 12.8516 14.3875 12.584 15H15.5C15.7761 15 16 15.2238 16 15.5C16 15.7761 15.7761 16 15.5 16H0.5C0.223858 16 0 15.7761 0 15.5C0 15.2238 0.223858 15 0.5 15H3.41604ZM4 13C4 10.7909 5.79086 8.99999 8 8.99999C10.2091 8.99999 12 10.7909 12 13C12 13.7297 11.8054 14.412 11.4651 15H4.53492C4.19459 14.412 4 13.7297 4 13Z",fill:"currentColor"}),Y("path",{d:"M8.5 9.99999C8.5 10.2761 8.27614 10.5 8 10.5C7.72386 10.5 7.5 10.2761 7.5 9.99999C7.5 9.72385 7.72386 9.49999 8 9.49999C8.27614 9.49999 8.5 9.72385 8.5 9.99999Z",fill:"currentColor"}),Y("path",{d:"M11 12C11 12.2761 10.7761 12.5 10.5 12.5C10.2239 12.5 10 12.2761 10 12C10 11.7238 10.2239 11.5 10.5 11.5C10.7761 11.5 11 11.7238 11 12Z",fill:"currentColor"}),Y("path",{d:"M10.5 14.5C10.5 14.7761 10.2761 15 10 15C9.72386 15 9.5 14.7761 9.5 14.5C9.5 14.2238 9.72386 14 10 14C10.2761 14 10.5 14.2238 10.5 14.5Z",fill:"currentColor"}),Y("path",{d:"M6.5 14.5C6.5 14.7761 6.27614 15 6 15C5.72386 15 5.5 14.7761 5.5 14.5C5.5 14.2238 5.72386 14 6 14C6.27614 14 6.5 14.2238 6.5 14.5Z",fill:"currentColor"}),Y("path",{d:"M6 12C6 12.2761 5.77614 12.5 5.5 12.5C5.22386 12.5 5 12.2761 5 12C5 11.7238 5.22386 11.5 5.5 11.5C5.77614 11.5 6 11.7238 6 12Z",fill:"currentColor"})]});import{jsx as q2,jsxs as AC}from"react/jsx-runtime";var FC=C=>AC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[q2("title",{children:"Deposit1"}),q2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5 4.5C12.7762 4.5 13 4.72386 13 5V7.5H15.5C15.7762 7.5 16 7.72386 16 8C16 8.27614 15.7762 8.5 15.5 8.5H13V11C13 11.2761 12.7762 11.5 12.5 11.5C12.2239 11.5 12 11.2761 12 11V8.5H9.50001C9.22387 8.5 9.00001 8.27614 9.00001 8C9.00001 7.72386 9.22387 7.5 9.50001 7.5H12V5C12 4.72386 12.2239 4.5 12.5 4.5Z",fill:"currentColor"}),q2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.00001 0.5C4.27616 0.5 4.50001 0.723858 4.50001 1V2.72188C5.84799 2.84378 6.626 3.4582 7.04901 4.13501C7.27559 4.49753 7.38713 4.85665 7.44263 5.12303C7.47055 5.25703 7.48483 5.37021 7.49217 5.45242C7.49585 5.49361 7.49781 5.52729 7.49885 5.55224C7.49937 5.56472 7.49966 5.57504 7.49982 5.58304L7.49998 5.59331L7.50001 5.59711L7.50001 5.59867C7.50001 5.599 7.50001 5.60001 7.00001 5.60001H7.50001C7.50001 5.87615 7.27616 6.10001 7.00001 6.10001C6.72494 6.10001 6.50174 5.87787 6.50002 5.6032L6.49971 5.59387C6.49929 5.58366 6.49832 5.56578 6.49614 5.54135C6.49176 5.4923 6.48261 5.41798 6.46365 5.32698C6.42539 5.14337 6.34944 4.90249 6.20101 4.66501C5.92381 4.22148 5.3401 3.70001 4.00001 3.70001C2.65993 3.70001 2.07622 4.22148 1.79901 4.66501C1.65059 4.90249 1.57463 5.14337 1.53638 5.32698C1.51742 5.41798 1.50827 5.4923 1.50389 5.54135C1.50171 5.56578 1.50074 5.58366 1.50031 5.59387L1.50001 5.60289C1.50006 5.99795 1.51047 6.21343 1.73978 6.45803C2.01291 6.74937 2.64374 7.12086 4.12884 7.51688C5.64374 7.92086 6.51291 8.34937 6.98978 8.85803C7.50045 9.40274 7.5002 9.97566 7.50002 10.3778C7.50002 10.3853 7.50001 10.3927 7.50001 10.4H7.00001C7.50001 10.4 7.50001 10.3997 7.50001 10.4L7.50001 10.4013L7.50001 10.4029L7.49998 10.4067L7.49982 10.417C7.49966 10.425 7.49937 10.4353 7.49885 10.4478C7.49781 10.4727 7.49585 10.5064 7.49217 10.5476C7.48483 10.6298 7.47055 10.743 7.44263 10.877C7.38713 11.1434 7.27559 11.5025 7.04901 11.865C6.626 12.5418 5.84799 13.1562 4.50001 13.2781V15C4.50001 15.2761 4.27616 15.5 4.00001 15.5C3.72387 15.5 3.50001 15.2761 3.50001 15V13.2781C2.15204 13.1562 1.37402 12.5418 0.951014 11.865C0.72444 11.5025 0.612894 11.1434 0.557398 10.877C0.529481 10.743 0.515194 10.6298 0.507854 10.5476C0.504176 10.5064 0.502219 10.4727 0.501179 10.4478C0.500659 10.4353 0.500368 10.425 0.500206 10.417L0.500049 10.4067L0.500021 10.4029L0.500015 10.4013C0.500015 10.401 0.500013 10.4 1.00001 10.4H0.500013C0.500013 10.1239 0.723871 9.89999 1.00001 9.89999C1.27509 9.89999 1.49829 10.1221 1.5 10.3968L1.50031 10.4061C1.50074 10.4163 1.50171 10.4342 1.50389 10.4587C1.50827 10.5077 1.51742 10.582 1.53638 10.673C1.57463 10.8566 1.65059 11.0975 1.79901 11.335C2.07622 11.7785 2.65993 12.3 4.00001 12.3C5.3401 12.3 5.92381 11.7785 6.20101 11.335C6.34944 11.0975 6.42539 10.8566 6.46365 10.673C6.48261 10.582 6.49176 10.5077 6.49614 10.4587C6.49832 10.4342 6.49929 10.4163 6.49971 10.4061L6.50001 10.3971C6.49996 10.002 6.48956 9.78657 6.26025 9.54197C5.98711 9.25063 5.35628 8.87914 3.87118 8.48312C2.35628 8.07914 1.48711 7.65063 1.01025 7.14197C0.499575 6.59726 0.499829 6.02434 0.500007 5.62218C0.50001 5.61473 0.500013 5.60734 0.500013 5.60001H1.00001C0.500013 5.60001 0.500013 5.60033 0.500013 5.60001L0.500015 5.59867L0.500021 5.59711L0.500049 5.59331L0.500206 5.58304C0.500368 5.57504 0.500659 5.56472 0.501179 5.55224C0.502219 5.52729 0.504176 5.49361 0.507854 5.45242C0.515194 5.37021 0.529481 5.25703 0.557398 5.12303C0.612894 4.85665 0.72444 4.49753 0.951014 4.13501C1.37402 3.4582 2.15204 2.84378 3.50001 2.72188V1C3.50001 0.723858 3.72387 0.5 4.00001 0.5ZM6.50001 10.3971C6.50002 10.3966 6.50002 10.3966 6.50001 10.3971V10.3971Z",fill:"currentColor"})]});import{jsx as f3,jsxs as TC}from"react/jsx-runtime";var DC=C=>TC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[f3("title",{children:"ECheck"}),f3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2.5C0 2.22386 0.223858 2 0.5 2H15.5C15.7761 2 16 2.22386 16 2.5V13.5C16 13.7761 15.7761 14 15.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5ZM1 3V13H15V3H1ZM3.5 6.5C3.5 6.22386 3.72386 6 4 6H10C10.2761 6 10.5 6.22386 10.5 6.5C10.5 6.77614 10.2761 7 10 7H4C3.72386 7 3.5 6.77614 3.5 6.5ZM3.5 9.5C3.5 9.22386 3.72386 9 4 9H8C8.27614 9 8.5 9.22386 8.5 9.5C8.5 9.77614 8.27614 10 8 10H4C3.72386 10 3.5 9.77614 3.5 9.5Z",fill:"currentColor"})]});import{jsx as h3,jsxs as WC}from"react/jsx-runtime";var _C=C=>WC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[h3("title",{children:"Store"}),h3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.12554 0.393439C1.17564 0.16376 1.37897 0 1.61405 0H14.3922C14.6273 0 14.8306 0.16376 14.8807 0.393438L15.9217 5.16547L15.9246 5.18001C16.2503 6.91944 15.5516 8.20647 14.4114 8.53607C13.7757 8.71984 12.7697 8.7944 11.8927 8.46115C11.4445 8.29086 11.0156 8.00795 10.7007 7.56519C10.6593 7.50706 10.6204 7.44679 10.5839 7.38437C10.539 7.47893 10.4876 7.57251 10.4289 7.66395C10.0002 8.33208 9.23908 8.80046 8.02686 8.80046H7.9794C6.76732 8.80046 6.00446 8.3323 5.57326 7.66542C5.51503 7.57537 5.46388 7.48322 5.41896 7.3901C5.38347 7.45048 5.34565 7.50884 5.30556 7.56519C4.99064 8.00795 4.56175 8.29086 4.11358 8.46115C3.23653 8.7944 2.23057 8.71984 1.59485 8.53607C0.454682 8.20647 -0.244061 6.91944 0.0816477 5.18001L0.0845933 5.16547L1.12554 0.393439ZM2.01674 1L1.06324 5.37115C0.799655 6.79154 1.3956 7.43752 1.87256 7.5754C2.35822 7.7158 3.13402 7.7636 3.75839 7.52636C4.06092 7.41141 4.31265 7.23587 4.49067 6.98558C4.66738 6.73715 4.79722 6.37899 4.79722 5.85324C4.79722 5.5771 5.02108 5.35324 5.29722 5.35324H5.60499C5.88113 5.35324 6.10499 5.5771 6.10499 5.85324C6.10499 6.24395 6.1645 6.7381 6.41301 7.12244C6.63631 7.46779 7.06065 7.80046 7.9794 7.80046H8.02686C8.94546 7.80046 9.36649 7.46801 9.58727 7.12392C9.83363 6.73996 9.89121 6.24598 9.89121 5.85324C9.89121 5.5771 10.1151 5.35324 10.3912 5.35324H10.709C10.9852 5.35324 11.209 5.5771 11.209 5.85324C11.209 6.37899 11.3389 6.73715 11.5156 6.98558C11.6936 7.23587 11.9453 7.41141 12.2479 7.52636C12.8722 7.7636 13.648 7.7158 14.1337 7.5754C14.6107 7.43752 15.2066 6.79153 14.943 5.37115L13.9895 1H2.01674ZM1.70276 10.7998C1.9789 10.7998 2.20276 11.0236 2.20276 11.2998V15H13.8035V11.2998C13.8035 11.0236 14.0274 10.7998 14.3035 10.7998C14.5796 10.7998 14.8035 11.0236 14.8035 11.2998V15.5C14.8035 15.7761 14.5796 16 14.3035 16H1.70276C1.42662 16 1.20276 15.7761 1.20276 15.5V11.2998C1.20276 11.0236 1.42662 10.7998 1.70276 10.7998Z",fill:"currentColor"})]});import{jsx as z2,jsxs as NC}from"react/jsx-runtime";var OC=C=>NC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[z2("title",{children:"Wallet"}),z2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.146446 1.14645C0.240214 1.05268 0.367392 1 0.5 1H14.5C14.7761 1 15 1.22386 15 1.5C15 1.77614 14.7761 2 14.5 2H1L1.00001 5H15.4999C15.776 5 15.9999 5.22385 15.9999 5.49999L16 14.5C16 14.6326 15.9473 14.7598 15.8536 14.8536C15.7598 14.9473 15.6326 15 15.5 15H0.5C0.367392 15 0.240215 14.9473 0.146446 14.8536C0.0526782 14.7598 -1.78812e-07 14.6326 0 14.5V1.5C-3.57626e-07 1.36739 0.0526779 1.24022 0.146446 1.14645ZM1.00001 6L1 14H15L14.9999 6H1.00001Z",fill:"currentColor"}),z2("path",{d:"M13 10C13 10.5523 12.5523 11 12 11C11.4477 11 11 10.5523 11 10C11 9.44771 11.4477 9 12 9C12.5523 9 13 9.44771 13 10Z",fill:"currentColor"})]});import{jsx as X2,jsxs as JC}from"react/jsx-runtime";var UC=C=>JC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[X2("title",{children:"Withdraw"}),X2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5 4C12.7762 4 13 4.22386 13 4.5V9.29289L14.6465 7.64645C14.8417 7.45118 15.1583 7.45118 15.3536 7.64645C15.5488 7.84171 15.5488 8.15829 15.3536 8.35355L12.8536 10.8536C12.6583 11.0488 12.3417 11.0488 12.1465 10.8536L9.64646 8.35355C9.4512 8.15829 9.4512 7.84171 9.64646 7.64645C9.84172 7.45118 10.1583 7.45118 10.3536 7.64645L12 9.29289V4.5C12 4.22386 12.2239 4 12.5 4Z",fill:"currentColor"}),X2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.00001 0.5C4.27616 0.5 4.50001 0.723858 4.50001 1V2.72188C5.84799 2.84378 6.626 3.4582 7.04901 4.13501C7.27559 4.49753 7.38713 4.85665 7.44263 5.12303C7.47055 5.25703 7.48483 5.37021 7.49217 5.45242C7.49585 5.49361 7.49781 5.52729 7.49885 5.55224C7.49937 5.56472 7.49966 5.57504 7.49982 5.58304L7.49998 5.59331L7.50001 5.59711L7.50001 5.59867C7.50001 5.599 7.50001 5.60001 7.00001 5.60001H7.50001C7.50001 5.87615 7.27616 6.10001 7.00001 6.10001C6.72494 6.10001 6.50174 5.87787 6.50002 5.6032L6.49971 5.59387C6.49929 5.58366 6.49832 5.56578 6.49614 5.54135C6.49176 5.4923 6.48261 5.41798 6.46365 5.32698C6.42539 5.14337 6.34944 4.90249 6.20101 4.66501C5.92381 4.22148 5.3401 3.70001 4.00001 3.70001C2.65993 3.70001 2.07622 4.22148 1.79901 4.66501C1.65059 4.90249 1.57463 5.14337 1.53638 5.32698C1.51742 5.41798 1.50827 5.4923 1.50389 5.54135C1.50171 5.56578 1.50074 5.58366 1.50031 5.59387L1.50001 5.60289C1.50006 5.99795 1.51047 6.21343 1.73978 6.45803C2.01291 6.74937 2.64374 7.12086 4.12884 7.51688C5.64374 7.92086 6.51291 8.34937 6.98978 8.85803C7.50045 9.40274 7.5002 9.97566 7.50002 10.3778C7.50002 10.3853 7.50001 10.3927 7.50001 10.4H7.00001C7.50001 10.4 7.50001 10.3997 7.50001 10.4L7.50001 10.4013L7.50001 10.4029L7.49998 10.4067L7.49982 10.417C7.49966 10.425 7.49937 10.4353 7.49885 10.4478C7.49781 10.4727 7.49585 10.5064 7.49217 10.5476C7.48483 10.6298 7.47055 10.743 7.44263 10.877C7.38713 11.1434 7.27559 11.5025 7.04901 11.865C6.626 12.5418 5.84799 13.1562 4.50001 13.2781V15C4.50001 15.2761 4.27616 15.5 4.00001 15.5C3.72387 15.5 3.50001 15.2761 3.50001 15V13.2781C2.15204 13.1562 1.37402 12.5418 0.951014 11.865C0.72444 11.5025 0.612894 11.1434 0.557398 10.877C0.529481 10.743 0.515194 10.6298 0.507854 10.5476C0.504176 10.5064 0.502219 10.4727 0.501179 10.4478C0.500659 10.4353 0.500368 10.425 0.500206 10.417L0.500049 10.4067L0.500021 10.4029L0.500015 10.4013C0.500015 10.401 0.500013 10.4 1.00001 10.4H0.500013C0.500013 10.1239 0.723871 9.89999 1.00001 9.89999C1.27509 9.89999 1.49829 10.1221 1.5 10.3968L1.50031 10.4061C1.50074 10.4163 1.50171 10.4342 1.50389 10.4587C1.50827 10.5077 1.51742 10.582 1.53638 10.673C1.57463 10.8566 1.65059 11.0975 1.79901 11.335C2.07622 11.7785 2.65993 12.3 4.00001 12.3C5.3401 12.3 5.92381 11.7785 6.20101 11.335C6.34944 11.0975 6.42539 10.8566 6.46365 10.673C6.48261 10.582 6.49176 10.5077 6.49614 10.4587C6.49832 10.4342 6.49929 10.4163 6.49971 10.4061L6.50001 10.3971C6.49996 10.002 6.48956 9.78657 6.26025 9.54197C5.98711 9.25063 5.35628 8.87914 3.87118 8.48312C2.35628 8.07914 1.48711 7.65063 1.01025 7.14197C0.499575 6.59726 0.499829 6.02434 0.500007 5.62218C0.50001 5.61473 0.500013 5.60734 0.500013 5.60001H1.00001C0.500013 5.60001 0.500013 5.60033 0.500013 5.60001L0.500015 5.59867L0.500021 5.59711L0.500049 5.59331L0.500206 5.58304C0.500368 5.57504 0.500659 5.56472 0.501179 5.55224C0.502219 5.52729 0.504176 5.49361 0.507854 5.45242C0.515194 5.37021 0.529481 5.25703 0.557398 5.12303C0.612894 4.85665 0.72444 4.49753 0.951014 4.13501C1.37402 3.4582 2.15204 2.84378 3.50001 2.72188V1C3.50001 0.723858 3.72387 0.5 4.00001 0.5ZM6.50001 10.3971C6.50002 10.3966 6.50002 10.3966 6.50001 10.3971V10.3971Z",fill:"currentColor"})]});import{jsx as Y2,jsxs as qC}from"react/jsx-runtime";var KC=C=>qC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Y2("title",{children:"Add"}),Y2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 8C2.5 7.72386 2.72386 7.5 3 7.5H13C13.2761 7.5 13.5 7.72386 13.5 8C13.5 8.27614 13.2761 8.5 13 8.5H3C2.72386 8.5 2.5 8.27614 2.5 8Z",fill:"currentColor"}),Y2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 2.5C8.27614 2.5 8.5 2.72386 8.5 3L8.5 13C8.5 13.2761 8.27614 13.5 8 13.5C7.72386 13.5 7.5 13.2761 7.5 13L7.5 3C7.5 2.72386 7.72386 2.5 8 2.5Z",fill:"currentColor"})]});import{jsx as O5,jsxs as XC}from"react/jsx-runtime";var zC=C=>XC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[O5("title",{children:"AddCircle"}),O5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 7.94995C4 7.67381 4.22386 7.44995 4.5 7.44995H11.5C11.7761 7.44995 12 7.67381 12 7.94995C12 8.22609 11.7761 8.44995 11.5 8.44995H4.5C4.22386 8.44995 4 8.22609 4 7.94995Z",fill:"currentColor"}),O5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 4C8.27614 4 8.5 4.22386 8.5 4.5V11.5C8.5 11.7761 8.27614 12 8 12C7.72386 12 7.5 11.7761 7.5 11.5L7.5 4.5C7.5 4.22386 7.72386 4 8 4Z",fill:"currentColor"}),O5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"})]});import{jsx as Z1,jsxs as QC}from"react/jsx-runtime";var YC=C=>QC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Z1("title",{children:"AddGroup"}),Z1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.0218 8C9.0218 7.72386 9.24566 7.5 9.5218 7.5H13.5218C13.7979 7.5 14.0218 7.72386 14.0218 8C14.0218 8.27614 13.7979 8.5 13.5218 8.5H9.5218C9.24566 8.5 9.0218 8.27614 9.0218 8Z",fill:"currentColor"}),Z1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5218 5.5C11.7979 5.5 12.0218 5.72386 12.0218 6V10C12.0218 10.2761 11.7979 10.5 11.5218 10.5C11.2457 10.5 11.0218 10.2761 11.0218 10V6C11.0218 5.72386 11.2457 5.5 11.5218 5.5Z",fill:"currentColor"}),Z1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 4.5C9.567 4.5 8 6.067 8 8C8 9.933 9.567 11.5 11.5 11.5C13.433 11.5 15 9.933 15 8C15 6.067 13.433 4.5 11.5 4.5ZM7 8C7 5.51472 9.01472 3.5 11.5 3.5C13.9853 3.5 16 5.51472 16 8C16 10.4853 13.9853 12.5 11.5 12.5C9.01472 12.5 7 10.4853 7 8Z",fill:"currentColor"}),Z1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.97752 4.35175C7.05939 4.61547 6.91198 4.89564 6.64825 4.97751C5.41725 5.35971 4.5 6.55916 4.5 8C4.5 9.44084 5.41725 10.6403 6.64825 11.0225C6.91198 11.1044 7.05939 11.3845 6.97752 11.6483C6.89564 11.912 6.61547 12.0594 6.35175 11.9775C4.69126 11.462 3.5 9.86717 3.5 8C3.5 6.13283 4.69126 4.53802 6.35175 4.02249C6.61547 3.94061 6.89564 4.08802 6.97752 4.35175Z",fill:"currentColor"}),Z1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.47751 4.35175C3.55939 4.61547 3.41198 4.89564 3.14825 4.97751C1.91725 5.35971 1 6.55916 1 8C1 9.44084 1.91725 10.6403 3.14825 11.0225C3.41198 11.1044 3.55939 11.3845 3.47751 11.6483C3.39564 11.912 3.11547 12.0594 2.85175 11.9775C1.19126 11.462 0 9.86717 0 8C0 6.13283 1.19126 4.53802 2.85175 4.02249C3.11547 3.94061 3.39564 4.08802 3.47751 4.35175Z",fill:"currentColor"})]});import{jsx as S1,jsxs as jC}from"react/jsx-runtime";var $C=C=>jC("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[S1("title",{children:"AddIndicatorCircle"}),S1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 8C4 7.72386 4.22386 7.5 4.5 7.5H11.5C11.7761 7.5 12 7.72386 12 8C12 8.27614 11.7761 8.5 11.5 8.5H4.5C4.22386 8.5 4 8.27614 4 8Z",fill:"currentColor"}),S1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 4.05005C8.27614 4.05005 8.5 4.27391 8.5 4.55005V11.55C8.5 11.8262 8.27614 12.05 8 12.05C7.72386 12.05 7.5 11.8262 7.5 11.55L7.5 4.55005C7.5 4.27391 7.72386 4.05005 8 4.05005Z",fill:"currentColor"}),S1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15C11.866 15 15 11.866 15 8C15 7.68309 14.979 7.37134 14.9383 7.06603C14.9018 6.79231 15.0942 6.54085 15.3679 6.50438C15.6416 6.46791 15.8931 6.66024 15.9295 6.93397C15.976 7.28293 16 7.6388 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C8.3612 0 8.71707 0.0239701 9.06603 0.0704654C9.33976 0.106935 9.53209 0.358397 9.49562 0.63212C9.45915 0.905844 9.20769 1.09818 8.93397 1.06171C8.62866 1.02103 8.31692 1 8 1Z",fill:"currentColor"}),S1("path",{d:"M16 2.5C16 3.88071 14.8807 5 13.5 5C12.1193 5 11 3.88071 11 2.5C11 1.11929 12.1193 0 13.5 0C14.8807 0 16 1.11929 16 2.5Z",fill:"currentColor"}),S1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 4C14.3284 4 15 3.32843 15 2.5C15 1.67157 14.3284 1 13.5 1C12.6716 1 12 1.67157 12 2.5C12 3.32843 12.6716 4 13.5 4ZM13.5 5C14.8807 5 16 3.88071 16 2.5C16 1.11929 14.8807 0 13.5 0C12.1193 0 11 1.11929 11 2.5C11 3.88071 12.1193 5 13.5 5Z",fill:"currentColor"})]});import{jsx as P,jsxs as ee}from"react/jsx-runtime";var Ce=C=>ee("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[P("title",{children:"Barcode"}),P("path",{d:"M0.5 1.96701e-07C0.223858 1.96701e-07 0 0.223858 0 0.5V4.5C0 4.77614 0.223858 5 0.5 5C0.776142 5 1 4.77614 1 4.5L1 1H4.5C4.77614 1 5 0.776143 5 0.5C5 0.223858 4.77614 1.96701e-07 4.5 1.96701e-07H0.5Z",fill:"currentColor"}),P("path",{d:"M15.5 16C15.7761 16 16 15.7761 16 15.5V11.5C16 11.2239 15.7761 11 15.5 11C15.2239 11 15 11.2239 15 11.5L15 15H11.5C11.2239 15 11 15.2239 11 15.5C11 15.7761 11.2239 16 11.5 16H15.5Z",fill:"currentColor"}),P("path",{d:"M16 0.5C16 0.223858 15.7761 1.86915e-07 15.5 1.74844e-07L11.5 0C11.2239 -1.20706e-08 11 0.223858 11 0.5C11 0.776142 11.2239 1 11.5 1L15 1V4.5C15 4.77614 15.2239 5 15.5 5C15.7761 5 16 4.77614 16 4.5V0.5Z",fill:"currentColor"}),P("path",{d:"M6.55673e-08 15.5C2.93556e-08 15.7761 0.223858 16 0.5 16H4.5C4.77614 16 5 15.7761 5 15.5C5 15.2239 4.77614 15 4.5 15L1 15L1 11.5C1 11.2239 0.776143 11 0.500001 11C0.223858 11 6.2631e-07 11.2239 5.90098e-07 11.5L6.55673e-08 15.5Z",fill:"currentColor"}),P("path",{d:"M2 2H3V14H2V2Z",fill:"currentColor"}),P("path",{d:"M10 2H11V14H10V2Z",fill:"currentColor"}),P("path",{d:"M4 2H6V14H4V2Z",fill:"currentColor"}),P("path",{d:"M12 2H14V14H12V2Z",fill:"currentColor"}),P("path",{d:"M7 2H9V14H7V2Z",fill:"currentColor"})]});import{jsx as Q2,jsxs as le}from"react/jsx-runtime";var oe=C=>le("svg",{width:17,height:17,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Q2("title",{children:"BetaProgram"}),Q2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 15C16.5 15.8284 15.8284 16.5 15 16.5L5.00293 16.5C3.59172 16.5 2.96142 14.7285 4.05546 13.8371L14.0525 5.69176C15.0324 4.89334 16.5 5.59063 16.5 6.85463V15ZM15 15.5C15.2761 15.5 15.5 15.2761 15.5 15L15.5 6.85463C15.5 6.4333 15.0108 6.20087 14.6842 6.46701L4.68711 14.6123C4.32243 14.9095 4.53253 15.5 5.00293 15.5L15 15.5Z",fill:"currentColor"}),Q2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.5 2C0.5 1.17157 1.17157 0.5 2 0.5H11.9971C13.4083 0.5 14.0386 2.27148 12.9445 3.16288L2.94748 11.3082C1.96756 12.1066 0.5 11.4093 0.5 10.1453V2ZM2 1.5C1.72386 1.5 1.5 1.72386 1.5 2V10.1453C1.5 10.5667 1.98919 10.7991 2.31583 10.533L12.3129 2.38763C12.6776 2.09049 12.4675 1.5 11.9971 1.5H2Z",fill:"currentColor"})]});import{jsx as a3,jsxs as re}from"react/jsx-runtime";var te=C=>re("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[a3("title",{children:"Bolt"}),a3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.7515 0.0721949C10.9525 0.189154 11.0463 0.429237 10.9779 0.651482L9.17712 6.50001H13.5C13.7022 6.50001 13.8846 6.62183 13.962 6.80867C14.0393 6.99551 13.9966 7.21056 13.8536 7.35356L5.35356 15.8536C5.18659 16.0205 4.92556 16.0479 4.72755 15.9193C4.52955 15.7906 4.44857 15.5409 4.53334 15.3205L6.772 9.50001H2.50001C2.30051 9.50001 2.1201 9.38141 2.041 9.19827C1.96189 9.01512 1.99923 8.80247 2.136 8.65723L10.136 0.161574C10.2954 -0.00772153 10.5505 -0.0447643 10.7515 0.0721949ZM3.65763 8.50001H7.50001C7.66474 8.50001 7.81891 8.58115 7.91217 8.71694C8.00543 8.85273 8.02582 9.02575 7.96668 9.1795L6.31248 13.4804L12.2929 7.50001H8.50001C8.34132 7.50001 8.19205 7.42468 8.09779 7.29702C8.00352 7.16937 7.97545 7.00454 8.02215 6.85288L9.38902 2.41352L3.65763 8.50001Z",fill:"currentColor"})]});import{jsx as $2,jsxs as ne}from"react/jsx-runtime";var ie=C=>ne("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[$2("title",{children:"Cross"}),$2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.14652 3.14645C3.34179 2.95118 3.65837 2.95118 3.85363 3.14645L12.8692 12.1621C13.0645 12.3573 13.0645 12.6739 12.8692 12.8692C12.674 13.0644 12.3574 13.0644 12.1621 12.8692L3.14652 3.85355C2.95126 3.65829 2.95126 3.34171 3.14652 3.14645Z",fill:"currentColor"}),$2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.8579 3.15075C13.0532 3.34601 13.0532 3.66259 12.8579 3.85785L3.84232 12.8735C3.64706 13.0687 3.33048 13.0687 3.13522 12.8735C2.93995 12.6782 2.93995 12.3616 3.13522 12.1664L12.1508 3.15075C12.3461 2.95548 12.6627 2.95548 12.8579 3.15075Z",fill:"currentColor"})]});import{jsx as N5,jsxs as pe}from"react/jsx-runtime";var de=C=>pe("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[N5("title",{children:"CrossCircle"}),N5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.14645 5.0964C5.34171 4.90114 5.65829 4.90114 5.85355 5.0964L10.8536 10.0964C11.0488 10.2917 11.0488 10.6082 10.8536 10.8035C10.6583 10.9988 10.3417 10.9988 10.1464 10.8035L5.14645 5.8035C4.95118 5.60824 4.95118 5.29166 5.14645 5.0964Z",fill:"currentColor"}),N5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8536 5.09645C11.0488 5.29171 11.0488 5.6083 10.8536 5.80356L5.85356 10.8036C5.65829 10.9988 5.34171 10.9988 5.14645 10.8036C4.95119 10.6083 4.95119 10.2917 5.14645 10.0965L10.1464 5.09645C10.3417 4.90119 10.6583 4.90119 10.8536 5.09645Z",fill:"currentColor"}),N5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"})]});import{jsx as G1,jsxs as ce}from"react/jsx-runtime";var se=C=>ce("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[G1("title",{children:"Delete"}),G1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.4436C6.27614 5.4436 6.5 5.66746 6.5 5.9436V12.9436C6.5 13.2197 6.27614 13.4436 6 13.4436C5.72386 13.4436 5.5 13.2197 5.5 12.9436V5.9436C5.5 5.66746 5.72386 5.4436 6 5.4436Z",fill:"currentColor"}),G1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 5.4436C10.2761 5.4436 10.5 5.66746 10.5 5.9436V12.9436C10.5 13.2197 10.2761 13.4436 10 13.4436C9.72386 13.4436 9.5 13.2197 9.5 12.9436V5.9436C9.5 5.66746 9.72386 5.4436 10 5.4436Z",fill:"currentColor"}),G1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.0453 4.00205C14.3203 4.02705 14.5229 4.27026 14.4979 4.54527L13.4979 15.5453C13.4745 15.8028 13.2586 16 13 16H3C2.74147 16 2.52557 15.8029 2.50207 15.5454L1.50207 4.58851C1.47697 4.31351 1.67956 4.07023 1.95456 4.04513C2.22956 4.02004 2.47283 4.22262 2.49793 4.49762L3.45644 15H12.5434L13.5021 4.45473C13.5271 4.17972 13.7703 3.97705 14.0453 4.00205Z",fill:"currentColor"}),G1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2.50042C0 2.22428 0.223858 2.00042 0.5 2.00042H15.5C15.7761 2.00042 16 2.22428 16 2.50042C16 2.77656 15.7761 3.00042 15.5 3.00042H0.5C0.223858 3.00042 0 2.77656 0 2.50042Z",fill:"currentColor"}),G1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.64645 0.146447C5.74021 0.0526785 5.86739 0 6 0H10C10.2761 0 10.5 0.223858 10.5 0.5V2.03573C10.5 2.31187 10.2761 2.53573 10 2.53573C9.72386 2.53573 9.5 2.31187 9.5 2.03573V1H6.5L6.5 2.01916C6.5 2.2953 6.27614 2.51916 6 2.51916C5.72386 2.51916 5.5 2.29531 5.5 2.01916L5.5 0.5C5.5 0.367392 5.55268 0.240215 5.64645 0.146447Z",fill:"currentColor"})]});import{jsx as L3,jsxs as he}from"react/jsx-runtime";var fe=C=>he("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[L3("title",{children:"Duplicate"}),L3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 1C6.22386 1 6 1.22386 6 1.5C6 1.77614 5.77614 2 5.5 2C5.22386 2 5 1.77614 5 1.5C5 0.671573 5.67157 0 6.5 0H9.12426C9.4876 0 9.83858 0.131877 10.112 0.371135L13.4878 3.3249C13.8133 3.60974 14 4.02122 14 4.45377V11.5C14 12.3284 13.3284 13 12.5 13C12.2239 13 12 12.7761 12 12.5C12 12.2239 12.2239 12 12.5 12C12.7761 12 13 11.7761 13 11.5V5H10.5C9.67157 5 9 4.32843 9 3.5V1H6.5ZM10 1.60188V3.5C10 3.77614 10.2239 4 10.5 4H12.7407L10 1.60188ZM2 4.5C2 3.67157 2.67157 3 3.5 3H6.12426C6.4876 3 6.83858 3.13188 7.11202 3.37113L10.4878 6.3249C10.8133 6.60974 11 7.02122 11 7.45377V14.5C11 15.3284 10.3284 16 9.5 16H3.5C2.67157 16 2 15.3284 2 14.5V4.5ZM3.5 4C3.22386 4 3 4.22386 3 4.5V14.5C3 14.7761 3.22386 15 3.5 15H9.5C9.77614 15 10 14.7761 10 14.5V8H7.5C6.67157 8 6 7.32843 6 6.5V4H3.5ZM7 4.60188V6.5C7 6.77614 7.22386 7 7.5 7H9.7407L7 4.60188Z",fill:"currentColor"})]});import{jsx as U5,jsxs as Le}from"react/jsx-runtime";var ae=C=>Le("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[U5("title",{children:"Edit"}),U5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.1237 3.67351C14.1018 3.67351 14.0801 3.67785 14.0598 3.68629C14.0396 3.69473 14.0212 3.7071 14.0057 3.72268L14.004 3.72442L5.94536 11.7699L5.75329 12.9377L6.90073 12.7311L14.9491 4.66958L14.9509 4.66785C14.9665 4.65239 14.9788 4.63401 14.9873 4.61375C14.9957 4.59349 15.0001 4.57177 15.0001 4.54982C15.0001 4.52787 14.9957 4.50615 14.9873 4.48589C14.9788 4.46563 14.9665 4.44725 14.9509 4.43179L14.9494 4.43035L14.2432 3.72413L14.2418 3.72268C14.2263 3.7071 14.2079 3.69473 14.1877 3.68629C14.1674 3.67785 14.1457 3.67351 14.1237 3.67351ZM13.6752 2.7632C13.8174 2.70399 13.9698 2.67351 14.1237 2.67351C14.2777 2.67351 14.4301 2.70399 14.5723 2.7632C14.7139 2.82223 14.8426 2.90865 14.9508 3.01749L14.9518 3.01848L15.6551 3.72179L15.6559 3.72262C15.7648 3.83086 15.8513 3.95956 15.9104 4.10131C15.9696 4.24343 16.0001 4.39586 16.0001 4.54982C16.0001 4.70378 15.9696 4.85621 15.9104 4.99833C15.8513 5.14003 15.7649 5.26867 15.6561 5.37689L15.6551 5.37785L7.49756 13.5487C7.4254 13.621 7.33282 13.6694 7.2323 13.6875L5.23358 14.0473C5.07372 14.0761 4.90985 14.0254 4.79413 13.9114C4.67841 13.7974 4.62528 13.6343 4.65164 13.4741L4.98476 11.4487C5.00175 11.3454 5.05076 11.25 5.12486 11.176L13.2957 3.01848L13.2968 3.0174C13.405 2.9086 13.5336 2.82221 13.6752 2.7632Z",fill:"currentColor"}),U5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.00003 0.500008L5.99998 3.49999C5.99998 3.77614 6.22384 4 6.49998 4H9.5V5H6.49998C5.67155 5 4.99997 4.32841 4.99998 3.49998L5.00003 0.499992L6.00003 0.500008Z",fill:"currentColor"}),U5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.5C0 0.671573 0.671573 0 1.5 0H5.08579C5.48361 0 5.86514 0.158035 6.14645 0.43934L9.85355 4.14645C10.0488 4.34171 10.0488 4.65829 9.85355 4.85355C9.65829 5.04882 9.34171 5.04882 9.14645 4.85355L5.43934 1.14645C5.34557 1.05268 5.21839 1 5.08579 1H1.5C1.22386 1 1 1.22386 1 1.5V14.5C1 14.7761 1.22386 15 1.5 15H8.5C8.77614 15 9 14.7761 9 14.5V13.5C9 13.2239 9.22386 13 9.5 13C9.77614 13 10 13.2239 10 13.5V14.5C10 15.3284 9.32843 16 8.5 16H1.5C0.671573 16 0 15.3284 0 14.5V1.5Z",fill:"currentColor"})]});import{jsx as P1,jsxs as ue}from"react/jsx-runtime";var ge=C=>ue("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[P1("title",{children:"EditAlt"}),P1("g",{clipPath:"url(#clip0_5778_92)",children:P1("path",{d:"M10.0022 2.4345L0.5 11.9367V15.5H4.06332L13.5655 5.99782M10.0022 2.4345L13.5655 5.99782M10.0022 2.4345L11.4148 1.02184C12.1106 0.326054 13.2387 0.326055 13.9345 1.02184L14.9782 2.06551C15.6739 2.76129 15.6739 3.88937 14.9782 4.58515L13.5655 5.99782",stroke:"currentColor",strokeLinejoin:"round"})}),P1("defs",{children:P1("clipPath",{id:"clip0_5778_92",children:P1("rect",{width:16,height:16,fill:"currentColor"})})})]});import{jsx as g3,jsxs as ve}from"react/jsx-runtime";var Ve=C=>ve("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[g3("title",{children:"Enter"}),g3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2.49988C11 2.22374 11.2238 1.99988 11.5 1.99988L15.4985 1.99988C15.6311 1.99988 15.7583 2.05256 15.8521 2.14632C15.9458 2.24009 15.9985 2.36727 15.9985 2.49988L15.9985 10.5165C15.9985 10.7926 15.7747 11.0165 15.4985 11.0165H1.70814L3.8547 13.1629C4.04997 13.3582 4.04998 13.6748 3.85472 13.87C3.65947 14.0653 3.34288 14.0653 3.14762 13.87L0.147434 10.87C0.0536591 10.7763 0.000976562 10.6491 0.000976562 10.5165C0.000976562 10.3839 0.0536592 10.2567 0.147434 10.1629L3.14762 7.16291C3.34288 6.96766 3.65947 6.96767 3.85472 7.16294C4.04998 7.3582 4.04997 7.67479 3.8547 7.87004L1.70814 10.0165H14.9985L14.9985 2.99988L11.5 2.99988C11.2238 2.99988 11 2.77602 11 2.49988Z",fill:"currentColor"})]});import{jsx as J5,jsxs as we}from"react/jsx-runtime";var me=C=>we("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[J5("title",{children:"Export"}),J5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.1416 6.14646C12.3368 5.95119 12.6534 5.95118 12.8487 6.14644L15.8489 9.14644C15.9426 9.2402 15.9953 9.36739 15.9953 9.5C15.9953 9.63261 15.9426 9.7598 15.8489 9.85356L12.8487 12.8536C12.6534 13.0488 12.3368 13.0488 12.1416 12.8535C11.9463 12.6583 11.9463 12.3417 12.1416 12.1464L14.2882 10L4.5 10C4.22386 10 4 9.77614 4 9.5C4 9.22386 4.22386 9 4.5 9L14.2882 9L12.1416 6.85356C11.9463 6.65831 11.9463 6.34173 12.1416 6.14646Z",fill:"currentColor"}),J5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.5C0 0.671573 0.671573 0 1.5 0H5.08579C5.48361 0 5.86514 0.158035 6.14645 0.43934L9.56066 3.85355C9.84196 4.13486 10 4.51639 10 4.91421V7.5C10 7.77614 9.77614 8 9.5 8C9.22386 8 9 7.77614 9 7.5V4.91421C9 4.78161 8.94732 4.65443 8.85355 4.56066L5.43934 1.14645C5.34557 1.05268 5.21839 1 5.08579 1H1.5C1.22386 1 1 1.22386 1 1.5V14.5C1 14.7761 1.22386 15 1.5 15H8.5C8.77614 15 9 14.7761 9 14.5V11.5C9 11.2239 9.22386 11 9.5 11C9.77614 11 10 11.2239 10 11.5V14.5C10 15.3284 9.32843 16 8.5 16H1.5C0.671573 16 0 15.3284 0 14.5V1.5Z",fill:"currentColor"}),J5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.00003 0.500008L5.99998 3.49999C5.99998 3.77614 6.22384 4 6.49998 4H9.5V5H6.49998C5.67155 5 4.99997 4.32841 4.99998 3.49998L5.00003 0.499992L6.00003 0.500008Z",fill:"currentColor"})]});import{jsx as x1,jsxs as Me}from"react/jsx-runtime";var He=C=>Me("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[x1("title",{children:"FaceID"}),x1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 0.498454C5.50067 0.774409 5.27735 0.998654 5.00121 0.99932L2.99517 1.00416C1.89249 1.00682 1 1.90086 1 3.0028V4.99661C1 5.27256 0.776142 5.49627 0.5 5.49627C0.223858 5.49627 0 5.27256 0 4.99661V3.0028C0 1.34989 1.33873 0.00883188 2.99276 0.00484132L4.99879 1.48794e-06C5.27493 -0.000664767 5.49933 0.2225 5.5 0.498454Z",fill:"currentColor"}),x1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 15.5015C5.50067 15.2256 5.27735 15.0013 5.00121 15.0007L2.99517 14.9958C1.89249 14.9932 1 14.0991 1 12.9972V11.0034C1 10.7274 0.776142 10.5037 0.5 10.5037C0.223858 10.5037 0 10.7274 0 11.0034V12.9972C0 14.6501 1.33873 15.9912 2.99276 15.9952L4.99879 16C5.27493 16.0007 5.49933 15.7775 5.5 15.5015Z",fill:"currentColor"}),x1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 2.99796C16 1.34223 14.6569 2.86214e-08 13 2.86214e-08H11C10.7239 2.86214e-08 10.5 0.223706 10.5 0.499661C10.5 0.775616 10.7239 0.999321 11 0.999321H13C14.1046 0.999321 15 1.89414 15 2.99796V4.98575C15 5.26171 15.2239 5.48541 15.5 5.48541C15.7761 5.48541 16 5.26171 16 4.98575V2.99796Z",fill:"currentColor"}),x1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 12.9912C16 14.6469 14.6569 15.9891 13 15.9891H11C10.7239 15.9891 10.5 15.7654 10.5 15.4895C10.5 15.2135 10.7239 14.9898 11 14.9898H13C14.1046 14.9898 15 14.095 15 12.9912V10.9925C15 10.7166 15.2239 10.4929 15.5 10.4929C15.7761 10.4929 16 10.7166 16 10.9925V12.9912Z",fill:"currentColor"}),x1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 3.99722C4.77614 3.99722 5 4.22093 5 4.49689V5.99587C5 6.27182 4.77614 6.49553 4.5 6.49553C4.22386 6.49553 4 6.27182 4 5.99587V4.49689C4 4.22093 4.22386 3.99722 4.5 3.99722ZM8.5 3.99723C8.77614 3.99723 9 4.22093 9 4.49689V7.49485C9 7.90498 8.89706 8.30435 8.60355 8.59765C8.31005 8.89096 7.91041 8.99383 7.5 8.99383C7.22386 8.99383 7 8.77013 7 8.49417C7 8.21822 7.22386 7.99451 7.5 7.99451C7.75626 7.99451 7.85662 7.93083 7.89645 7.89103C7.93627 7.85123 8 7.75094 8 7.49485V4.49689C8 4.22093 8.22386 3.99723 8.5 3.99723ZM11.5 3.99723C11.7761 3.99723 12 4.22093 12 4.49689V5.99587C12 6.27182 11.7761 6.49553 11.5 6.49553C11.2239 6.49553 11 6.27182 11 5.99587V4.49689C11 4.22093 11.2239 3.99723 11.5 3.99723ZM4.64645 10.8461C4.45118 10.651 4.45118 10.3346 4.64645 10.1395C4.84171 9.94437 5.15829 9.94437 5.35355 10.1395C5.98857 10.7741 6.97424 11.1174 8 11.1174C9.02576 11.1174 10.0114 10.7741 10.6464 10.1395C10.8417 9.94437 11.1583 9.94437 11.3536 10.1395C11.5488 10.3346 11.5488 10.651 11.3536 10.8461C10.4886 11.7105 9.22424 12.1167 8 12.1167C6.77576 12.1167 5.51143 11.7105 4.64645 10.8461Z",fill:"currentColor"})]});import{jsx as u3,jsxs as Ze}from"react/jsx-runtime";var Re=C=>Ze("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[u3("title",{children:"FaceIDSquare"}),u3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.47812 8.60527e-08H11.5219C12.2034 -3.96706e-06 12.7454 -7.18608e-06 13.1827 0.0357212C13.6305 0.072308 14.0123 0.148838 14.362 0.326981C14.9265 0.614601 15.3854 1.07354 15.673 1.63803C15.8512 1.98765 15.9277 2.36949 15.9643 2.81729C16 3.25458 16 3.79659 16 4.47811V11.5219C16 12.2034 16 12.7454 15.9643 13.1827C15.9277 13.6305 15.8512 14.0123 15.673 14.362C15.3854 14.9265 14.9265 15.3854 14.362 15.673C14.0123 15.8512 13.6305 15.9277 13.1827 15.9643C12.7454 16 12.2034 16 11.5219 16H4.47811C3.79659 16 3.25458 16 2.81729 15.9643C2.36949 15.9277 1.98765 15.8512 1.63803 15.673C1.07354 15.3854 0.614601 14.9265 0.326981 14.362C0.148839 14.0123 0.072308 13.6305 0.0357212 13.1827C-7.18608e-06 12.7454 -3.96706e-06 12.2034 8.60527e-08 11.5219V4.47812C-3.96706e-06 3.7966 -7.18608e-06 3.25458 0.0357212 2.81729C0.072308 2.36949 0.148839 1.98765 0.326981 1.63803C0.614601 1.07354 1.07354 0.614601 1.63803 0.326981C1.98765 0.148839 2.36949 0.072308 2.81729 0.0357212C3.25458 -7.18608e-06 3.7966 -3.96706e-06 4.47812 8.60527e-08ZM2.89872 1.0324C2.51276 1.06393 2.27717 1.12365 2.09202 1.21799C1.71569 1.40973 1.40973 1.71569 1.21799 2.09202C1.12365 2.27717 1.06393 2.51276 1.0324 2.89872C1.00039 3.29052 1 3.79168 1 4.5V11.5C1 12.2083 1.00039 12.7095 1.0324 13.1013C1.06393 13.4872 1.12365 13.7228 1.21799 13.908C1.40973 14.2843 1.71569 14.5903 2.09202 14.782C2.27717 14.8764 2.51276 14.9361 2.89872 14.9676C3.29052 14.9996 3.79168 15 4.5 15H11.5C12.2083 15 12.7095 14.9996 13.1013 14.9676C13.4872 14.9361 13.7228 14.8764 13.908 14.782C14.2843 14.5903 14.5903 14.2843 14.782 13.908C14.8764 13.7228 14.9361 13.4872 14.9676 13.1013C14.9996 12.7095 15 12.2083 15 11.5V4.5C15 3.79168 14.9996 3.29052 14.9676 2.89872C14.9361 2.51276 14.8764 2.27717 14.782 2.09202C14.5903 1.71569 14.2843 1.40973 13.908 1.21799C13.7228 1.12365 13.4872 1.06393 13.1013 1.0324C12.7095 1.00039 12.2083 1 11.5 1H4.5C3.79168 1 3.29052 1.00039 2.89872 1.0324ZM4.5 3.99994C4.77614 3.99994 5 4.2238 5 4.49994V5.99994C5 6.27608 4.77614 6.49994 4.5 6.49994C4.22386 6.49994 4 6.27608 4 5.99994V4.49994C4 4.2238 4.22386 3.99994 4.5 3.99994ZM8.5 3.99994C8.77614 3.99994 9 4.2238 9 4.49994V7.49994C9 7.91034 8.89706 8.30999 8.60355 8.60349C8.31005 8.897 7.91041 8.99994 7.5 8.99994C7.22386 8.99994 7 8.77608 7 8.49994C7 8.22379 7.22386 7.99994 7.5 7.99994C7.75626 7.99994 7.85662 7.93621 7.89645 7.89639C7.93627 7.85656 8 7.7562 8 7.49994V4.49994C8 4.2238 8.22386 3.99994 8.5 3.99994ZM11.5 3.99994C11.7761 3.99994 12 4.2238 12 4.49994V5.99994C12 6.27608 11.7761 6.49994 11.5 6.49994C11.2239 6.49994 11 6.27608 11 5.99994V4.49994C11 4.2238 11.2239 3.99994 11.5 3.99994ZM4.64645 10.8535C4.45118 10.6582 4.45118 10.3416 4.64645 10.1464C4.84171 9.95112 5.15829 9.95112 5.35355 10.1464C5.98857 10.7814 6.97424 11.1249 8 11.1249C9.02576 11.1249 10.0114 10.7814 10.6464 10.1464C10.8417 9.95112 11.1583 9.95112 11.3536 10.1464C11.5488 10.3416 11.5488 10.6582 11.3536 10.8535C10.4886 11.7185 9.22424 12.1249 8 12.1249C6.77576 12.1249 5.51143 11.7185 4.64645 10.8535Z",fill:"currentColor"})]});import{jsx as V3,jsxs as Ge}from"react/jsx-runtime";var Se=C=>Ge("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[V3("title",{children:"Featured"}),V3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.50001 1.00002C4.13798 1.00002 3.69307 1.01407 3.35356 1.35358C3.01061 1.69653 3.00001 2.04583 3.00001 2.50002V14.5152L7.67717 11.0964C7.85219 10.9684 8.08972 10.9679 8.26535 11.095L13 14.521V2.50002C13 2.04493 12.989 1.69756 12.648 1.35957L12.6449 1.35646C12.3054 1.01401 11.8615 1.00002 11.5 1.00002H4.50001ZM4.47887 1.21713e-05C4.48611 1.78337e-05 4.49316 2.3377e-05 4.50001 2.3377e-05H11.5C11.5068 2.3377e-05 11.5137 1.80126e-05 11.5209 1.25289e-05C11.8786 -0.000262785 12.7062 -0.000899553 13.3536 0.6509C14.0005 1.29325 14.0002 2.01841 14 2.47787C14 2.48532 14 2.49271 14 2.50002V15.5C14 15.6879 13.8947 15.8599 13.7274 15.9453C13.5601 16.0308 13.3591 16.0152 13.2069 15.9051L7.97372 12.1183L2.79507 15.9037C2.64307 16.0148 2.44154 16.0311 2.27366 15.9459C2.10578 15.8606 2.00001 15.6883 2.00001 15.5V2.50002C2.00001 2.49291 2.00001 2.48573 2.00001 2.47848C1.99984 2.01787 1.99959 1.29334 2.64646 0.64647C3.29384 -0.000917733 4.12122 -0.000268507 4.47887 1.21713e-05Z",fill:"currentColor"})]});import{jsx as j2,jsxs as xe}from"react/jsx-runtime";var Pe=C=>xe("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[j2("title",{children:"FeaturedStar"}),j2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.50001 1.00002C4.13798 1.00002 3.69307 1.01407 3.35356 1.35358C3.01061 1.69653 3.00001 2.04583 3.00001 2.50002V14.5152L7.67717 11.0964C7.85219 10.9684 8.08972 10.9679 8.26535 11.095L13 14.521V2.50002C13 2.04493 12.989 1.69756 12.648 1.35957L12.6449 1.35646C12.3054 1.01401 11.8615 1.00002 11.5 1.00002H4.50001ZM4.47887 1.21713e-05C4.48611 1.78337e-05 4.49316 2.3377e-05 4.50001 2.3377e-05H11.5C11.5068 2.3377e-05 11.5137 1.80126e-05 11.5209 1.25289e-05C11.8786 -0.000262785 12.7062 -0.000899553 13.3536 0.6509C14.0005 1.29325 14.0002 2.01841 14 2.47787C14 2.48532 14 2.49271 14 2.50002V15.5C14 15.6879 13.8947 15.8599 13.7274 15.9453C13.5601 16.0308 13.3591 16.0152 13.2069 15.9051L7.97372 12.1183L2.79507 15.9037C2.64307 16.0148 2.44154 16.0311 2.27366 15.9459C2.10578 15.8606 2.00001 15.6883 2.00001 15.5V2.50002C2.00001 2.49291 2.00001 2.48573 2.00001 2.47848C1.99984 2.01787 1.99959 1.29334 2.64646 0.64647C3.29384 -0.000917733 4.12122 -0.000268507 4.47887 1.21713e-05Z",fill:"currentColor"}),j2("path",{d:"M7.76228 4.73179C7.83711 4.50146 8.16297 4.50146 8.2378 4.73179L8.61745 5.90023C8.65092 6.00323 8.74691 6.07297 8.85522 6.07297H10.0838C10.326 6.07297 10.4267 6.38288 10.2307 6.52523L9.2368 7.24736C9.14918 7.31102 9.11251 7.42387 9.14598 7.52687L9.52563 8.69531C9.60047 8.92564 9.33685 9.11717 9.14092 8.97482L8.14699 8.25268C8.05937 8.18902 7.94072 8.18902 7.85309 8.25268L6.85916 8.97482C6.66323 9.11717 6.39961 8.92564 6.47445 8.69531L6.8541 7.52687C6.88757 7.42387 6.8509 7.31102 6.76328 7.24736L5.76935 6.52523C5.57342 6.38288 5.67411 6.07297 5.91629 6.07297H7.14486C7.25317 6.07297 7.34916 6.00323 7.38263 5.90023L7.76228 4.73179Z",fill:"currentColor"})]});import{jsx as v3,jsxs as ye}from"react/jsx-runtime";var be=C=>ye("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[v3("title",{children:"FileDownload"}),v3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 1.5C3 0.671573 3.67157 0 4.5 0H7.58579C7.98361 0 8.36514 0.158035 8.64645 0.439339L12.5607 4.35355C12.842 4.63486 13 5.01639 13 5.41421V8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5V5.5H9C8.17157 5.5 7.5 4.82843 7.5 4V1H4.5C4.22386 1 4 1.22386 4 1.5V14.5C4 14.7761 4.22386 15 4.5 15H8.5C8.77614 15 9 15.2239 9 15.5C9 15.7761 8.77614 16 8.5 16H4.5C3.67157 16 3 15.3284 3 14.5V1.5ZM8.5 1.70711V4C8.5 4.27614 8.72386 4.5 9 4.5H11.2929L8.5 1.70711ZM12.4999 10C12.776 9.99999 12.9999 10.2238 12.9999 10.5L13 14.2929L14.1463 13.1465C14.3416 12.9512 14.6582 12.9512 14.8534 13.1464C15.0487 13.3417 15.0487 13.6583 14.8535 13.8535L12.8536 15.8535C12.7598 15.9473 12.6326 16 12.5 16C12.3674 16 12.2402 15.9473 12.1465 15.8536L10.1464 13.8536C9.95109 13.6583 9.95108 13.3417 10.1463 13.1465C10.3416 12.9512 10.6582 12.9512 10.8534 13.1464L12 14.2929L11.9999 10.5C11.9999 10.2239 12.2237 10 12.4999 10Z",fill:"currentColor"})]});import{jsx as x,jsxs as Be}from"react/jsx-runtime";var Ie=C=>Be("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[x("title",{children:"Filter"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 0C2.77614 -1.20705e-08 3 0.223858 3 0.5L3 3C3 3.27614 2.77614 3.5 2.5 3.5C2.22386 3.5 2 3.27614 2 3L2 0.5C2 0.223858 2.22386 1.20707e-08 2.5 0Z",fill:"currentColor"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.50001 8C2.77615 8 3.00001 8.22386 3.00001 8.5L3 15.4972C3 15.7734 2.77614 15.9972 2.5 15.9972C2.22386 15.9972 2 15.7734 2 15.4972L2.00001 8.5C2.00001 8.22386 2.22386 8 2.50001 8Z",fill:"currentColor"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 9.99994C13.7761 9.99994 14 10.2238 14 10.4999V15.4971C14 15.7733 13.7761 15.9971 13.5 15.9971C13.2239 15.9971 13 15.7733 13 15.4971V10.4999C13 10.2238 13.2239 9.99994 13.5 9.99994Z",fill:"currentColor"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 0C13.7761 -1.20705e-08 14 0.223858 14 0.5V5C14 5.27614 13.7761 5.5 13.5 5.5C13.2239 5.5 13 5.27614 13 5V0.5C13 0.223858 13.2239 1.20707e-08 13.5 0Z",fill:"currentColor"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0C8.27614 -1.3128e-07 8.5 0.223857 8.5 0.5L8.5 8.5C8.5 8.77614 8.27615 9 8 9C7.72386 9 7.5 8.77614 7.5 8.5L7.5 0.5C7.5 0.223858 7.72386 1.01478e-07 8 0Z",fill:"currentColor"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 13C8.27614 13 8.5 13.2239 8.5 13.5V15.5C8.5 15.7761 8.27614 16 8 16C7.72386 16 7.5 15.7761 7.5 15.5V13.5C7.5 13.2239 7.72386 13 8 13Z",fill:"currentColor"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 4.5C0 3.67157 0.671573 3 1.5 3H3.5C4.32843 3 5 3.67157 5 4.5V7C5 7.82843 4.32843 8.5 3.5 8.5H1.5C0.671573 8.5 0 7.82843 0 7V4.5ZM1.5 4C1.22386 4 1 4.22386 1 4.5V7C1 7.27614 1.22386 7.5 1.5 7.5H3.5C3.77614 7.5 4 7.27614 4 7V4.5C4 4.22386 3.77614 4 3.5 4H1.5Z",fill:"currentColor"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 10C5.5 9.17157 6.17157 8.5 7 8.5H9C9.82843 8.5 10.5 9.17157 10.5 10V12.5C10.5 13.3284 9.82843 14 9 14H7C6.17157 14 5.5 13.3284 5.5 12.5V10ZM7 9.5C6.72386 9.5 6.5 9.72386 6.5 10V12.5C6.5 12.7761 6.72386 13 7 13H9C9.27614 13 9.5 12.7761 9.5 12.5V10C9.5 9.72386 9.27614 9.5 9 9.5H7Z",fill:"currentColor"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6.5C11 5.67157 11.6716 5 12.5 5H14.5C15.3284 5 16 5.67157 16 6.5V9C16 9.82843 15.3284 10.5 14.5 10.5H12.5C11.6716 10.5 11 9.82843 11 9V6.5ZM12.5 6C12.2239 6 12 6.22386 12 6.5V9C12 9.27614 12.2239 9.5 12.5 9.5H14.5C14.7761 9.5 15 9.27614 15 9V6.5C15 6.22386 14.7761 6 14.5 6H12.5Z",fill:"currentColor"})]});import{jsx as m3,jsxs as Ee}from"react/jsx-runtime";var ke=C=>Ee("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[m3("title",{children:"FilterAlt"}),m3("path",{d:"M3.5 11.5H0.5M3.5 11.5C3.5 12.6046 4.39543 13.5 5.5 13.5C6.60457 13.5 7.5 12.6046 7.5 11.5M3.5 11.5C3.5 10.3954 4.39543 9.5 5.5 9.5C6.60457 9.5 7.5 10.3954 7.5 11.5M7.5 11.5H15.5M7.5 4.5H0.5M7.5 4.5C7.5 5.60457 8.39543 6.5 9.5 6.5C10.6046 6.5 11.5 5.60457 11.5 4.5M7.5 4.5C7.5 3.39543 8.39543 2.5 9.5 2.5C10.6046 2.5 11.5 3.39543 11.5 4.5M11.5 4.5H15.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as w3,jsxs as Ae}from"react/jsx-runtime";var Fe=C=>Ae("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[w3("title",{children:"Fingerprint"}),w3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.67054 0.961797C5.78165 0.34944 7.06997 0 8.44128 0C12.5928 0 16.0001 3.21224 16.0001 7.22509C16.0001 9.35326 15.6882 11.4127 15.1054 13.3636C15.0263 13.6282 14.7477 13.7786 14.4831 13.6996C14.2186 13.6205 14.0682 13.3419 14.1472 13.0774C14.7027 11.218 15.0001 9.25499 15.0001 7.22509C15.0001 3.80961 12.0867 1 8.44128 1C7.24116 1 6.11861 1.30555 5.15321 1.8376C4.91136 1.97088 4.60726 1.88288 4.47397 1.64103C4.34068 1.39919 4.42869 1.09508 4.67054 0.961797ZM2.5863 3.43516C2.82234 3.57848 2.89751 3.88601 2.75419 4.12205C2.19916 5.03616 1.88246 6.09531 1.88246 7.22509C1.88246 8.62184 1.54555 9.94418 0.94554 11.1209C0.820099 11.3669 0.518981 11.4646 0.272975 11.3392C0.0269687 11.2137 -0.0707687 10.9126 0.0546725 10.6666C0.58524 9.62609 0.882459 8.45894 0.882459 7.22509C0.882459 5.90501 1.25324 4.66727 1.89942 3.60305C2.04273 3.36701 2.35026 3.29184 2.5863 3.43516ZM4.41179 7.22509C4.41179 5.06932 6.23891 3.36255 8.4412 3.36255C10.6435 3.36255 12.4706 5.06932 12.4706 7.22509C12.4706 8.1039 12.4078 8.96955 12.2862 9.81796C12.247 10.0913 11.9936 10.2811 11.7203 10.2419C11.4469 10.2028 11.2571 9.9494 11.2963 9.67605C11.4112 8.87442 11.4706 8.0562 11.4706 7.22509C11.4706 5.6667 10.1374 4.36255 8.4412 4.36255C6.74501 4.36255 5.41179 5.6667 5.41179 7.22509C5.41179 9.63216 4.68874 11.8679 3.44204 13.7561C3.42805 13.7772 3.4144 13.7985 3.40108 13.8199C3.255 14.0542 2.9466 14.1258 2.71226 13.9797C2.47793 13.8336 2.40638 13.5252 2.55246 13.2909C2.57039 13.2621 2.58875 13.2335 2.60753 13.2051C3.75111 11.4731 4.41179 9.42768 4.41179 7.22509ZM8.44117 6.72509C8.71731 6.72509 8.94117 6.94895 8.94117 7.22509C8.94117 10.284 8.01987 13.1378 6.42948 15.5465C6.27732 15.7769 5.96717 15.8404 5.73673 15.6883C5.50628 15.5361 5.44282 15.2259 5.59498 14.9955C7.08226 12.743 7.94117 10.0795 7.94117 7.22509C7.94117 6.94895 8.16503 6.72509 8.44117 6.72509ZM11.3813 11.7896C11.646 11.8682 11.7969 12.1466 11.7183 12.4113C11.375 13.5669 10.9201 14.6779 10.3655 15.7327C10.237 15.9771 9.93464 16.0711 9.69023 15.9425C9.44582 15.814 9.35188 15.5117 9.4804 15.2673C10.0052 14.2692 10.4353 13.2186 10.7597 12.1265C10.8383 11.8618 11.1166 11.711 11.3813 11.7896Z",fill:"currentColor"})]});import{jsx as C4,jsxs as Te}from"react/jsx-runtime";var De=C=>Te("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[C4("title",{children:"Help"}),C4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.67117 1.07111C8.00458 0.921943 7.31286 0.997769 6.68046 1.29246C6.04695 1.58767 5.49584 2.09227 5.10401 2.75197C4.71199 3.41202 4.5 4.19335 4.5 4.99671C4.5 5.27285 4.27614 5.49671 4 5.49671C3.72386 5.49671 3.5 5.27285 3.5 4.99671C3.5 4.02004 3.75721 3.06131 4.24423 2.24132C4.73146 1.42098 5.42977 0.772024 6.25807 0.386044C7.08748 -0.000451475 8.00429 -0.102856 8.88955 0.0952446C9.77402 0.293169 10.5774 0.779751 11.2021 1.48255C11.8263 2.18476 12.2459 3.07275 12.4155 4.03175C12.5851 4.99072 12.4984 5.98523 12.1647 6.89154C11.831 7.79799 11.2625 8.5819 10.5227 9.138C9.9195 9.59143 9.22525 9.87585 8.5 9.96581V12.4967C8.5 12.7729 8.27614 12.9967 8 12.9967C7.72386 12.9967 7.5 12.7729 7.5 12.4967V9.49671C7.5 9.22057 7.72386 8.99671 8 8.99671C8.67818 8.99671 9.34694 8.7708 9.92184 8.33865C10.4977 7.90581 10.9546 7.28412 11.2263 6.54603C11.4981 5.8078 11.5699 4.99271 11.4308 4.20586C11.2917 3.41903 10.9494 2.70337 10.4547 2.14691C9.96061 1.59104 9.33855 1.22045 8.67117 1.07111Z",fill:"currentColor"}),C4("path",{d:"M8.75217 15.2479C8.75217 15.6633 8.41541 16 8 16C7.58459 16 7.24783 15.6633 7.24783 15.2479C7.24783 14.8324 7.58459 14.4957 8 14.4957C8.41541 14.4957 8.75217 14.8324 8.75217 15.2479Z",fill:"currentColor"})]});import{jsx as K5,jsxs as We}from"react/jsx-runtime";var _e=C=>We("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[K5("title",{children:"HelpCircle"}),K5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 12.0272C7.5 11.7511 7.72386 11.5272 8 11.5272C8.27614 11.5272 8.5 11.7511 8.5 12.0272C8.5 12.3034 8.27614 12.5272 8 12.5272C7.72386 12.5272 7.5 12.3034 7.5 12.0272Z",fill:"currentColor"}),K5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.34141 4.53363C8.00194 4.4661 7.65007 4.50076 7.3303 4.63321C7.01053 4.76567 6.73722 4.98997 6.54493 5.27775C6.35264 5.56554 6.25 5.90388 6.25 6.25C6.25 6.52614 6.02614 6.75 5.75 6.75C5.47386 6.75 5.25 6.52614 5.25 6.25C5.25 5.7061 5.41128 5.17442 5.71346 4.72218C6.01563 4.26995 6.44512 3.91747 6.94762 3.70933C7.45012 3.50119 8.00305 3.44673 8.5365 3.55284C9.06994 3.65895 9.55995 3.92086 9.94454 4.30546C10.3291 4.69005 10.591 5.18005 10.6972 5.7135C10.8033 6.24695 10.7488 6.79988 10.5407 7.30238C10.3325 7.80488 9.98005 8.23437 9.52782 8.53654C9.21569 8.7451 8.86572 8.88654 8.5 8.95416V10C8.5 10.2761 8.27614 10.5 8 10.5C7.72386 10.5 7.5 10.2761 7.5 10V8.5C7.5 8.22386 7.72386 8 8 8C8.34612 8 8.68446 7.89736 8.97225 7.70507C9.26003 7.51278 9.48434 7.23947 9.61679 6.9197C9.74924 6.59993 9.7839 6.24806 9.71637 5.90859C9.64885 5.56913 9.48218 5.25731 9.23744 5.01256C8.99269 4.76782 8.68087 4.60115 8.34141 4.53363Z",fill:"currentColor"}),K5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15Z",fill:"currentColor"})]});import{jsx as q5,jsxs as Ne}from"react/jsx-runtime";var Oe=C=>Ne("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[q5("title",{children:"HideEyeOff"}),q5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.15712 2.13003C3.36173 1.94428 3.6784 1.95933 3.86441 2.16366L13.8784 13.1637C14.0644 13.368 14.0493 13.6842 13.8447 13.87C13.6401 14.0557 13.3234 14.0407 13.1374 13.8363L3.12344 2.83634C2.93743 2.63201 2.95251 2.31578 3.15712 2.13003Z",fill:"currentColor"}),q5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.99883 3.5C6.99883 3.22386 7.223 3 7.49953 3H8.00023C13.4921 3 15.697 7.23328 15.9412 7.7392C16.0316 7.92638 16.0132 8.13426 15.9172 8.29691C15.7842 8.5222 15.2144 9.43899 14.2034 10.4036C14.0788 10.5226 13.9473 10.6423 13.809 10.7617C13.6017 10.9407 13.2887 10.9199 13.1069 10.7151C12.9251 10.5103 12.942 10.1976 13.1448 10.0135L13.516 9.67641C14.2458 8.97925 14.7203 8.31164 14.9373 7.9773C14.4508 7.09182 12.4337 4 8.00023 4H7.49953C7.223 4 6.99883 3.77614 6.99883 3.5ZM5.13424 3.94121C5.23958 4.19653 5.11771 4.48879 4.86204 4.59399C2.57382 5.53545 1.41527 7.338 1.06325 7.97744C1.32013 8.37318 1.93675 9.2343 2.90914 10.059C4.09506 11.0647 5.78944 12 8.00023 12C9.26677 12 10.3607 11.6936 11.2865 11.2448C11.5352 11.1242 11.8348 11.2278 11.9556 11.4762C12.0763 11.7246 11.9726 12.0238 11.7238 12.1444C10.6771 12.6518 9.43449 13 8.00023 13C5.48629 13 3.57054 11.9318 2.26091 10.8212C0.954742 9.71345 0.230901 8.54731 0.0821257 8.29497C-0.0190499 8.12336 -0.0267609 7.91733 0.059096 7.73945C0.245743 7.35274 1.52679 4.88468 4.48056 3.66939C4.73623 3.56419 5.0289 3.68589 5.13424 3.94121Z",fill:"currentColor"}),q5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.24954 6.70037C6.79925 6.96048 6.49813 7.44542 6.49813 8C6.49813 8.82843 7.17064 9.5 8.00023 9.5C8.48182 9.5 8.91035 9.27423 9.18605 8.92087L9.97599 9.53548C9.51871 10.1216 8.8036 10.5 8.00023 10.5C6.61758 10.5 5.49673 9.38071 5.49673 8C5.49673 7.07402 6.00112 6.26627 6.74811 5.83476L7.24954 6.70037Z",fill:"currentColor"})]});import{jsx as e4,jsxs as Je}from"react/jsx-runtime";var Ue=C=>Je("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[e4("title",{children:"History"}),e4("path",{d:"M8.75924 2C5.34385 2 3 4.65395 3 8V11.2929L4.14645 10.1464C4.34171 9.95118 4.65829 9.95118 4.85355 10.1464C5.04882 10.3417 5.04882 10.6583 4.85355 10.8536L2.85355 12.8536C2.65829 13.0488 2.34171 13.0488 2.14645 12.8536L0.146447 10.8536C-0.0488156 10.6583 -0.0488156 10.3417 0.146447 10.1464C0.341709 9.95118 0.658291 9.95118 0.853553 10.1464L2 11.2929V8C2 4.16635 4.72903 1 8.75924 1C12.7409 1 16 4.11702 16 8C16 11.9066 12.4565 15 8.49997 15C8.22383 15 7.99997 14.7761 7.99997 14.5C7.99997 14.2239 8.22383 14 8.49997 14C11.989 14 15 11.2731 15 8C15 4.70327 12.2232 2 8.75924 2Z",fill:"currentColor"}),e4("path",{d:"M9 4C9.27614 4 9.5 4.22386 9.5 4.5V8.2169L11.7572 9.57125C11.994 9.71333 12.0708 10.0205 11.9287 10.2572C11.7867 10.494 11.4795 10.5708 11.2428 10.4287L8.74275 8.92875C8.59215 8.83838 8.5 8.67563 8.5 8.5V4.5C8.5 4.22386 8.72386 4 9 4Z",fill:"currentColor"})]});import{jsx as o4,jsxs as qe}from"react/jsx-runtime";var Ke=C=>qe("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[o4("title",{children:"Home"}),o4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.01409 0.000199785C8.15745 0.00425049 8.29217 0.0696688 8.38401 0.179828L10.001 2.11943V0.984409C10.001 0.708266 10.2249 0.484409 10.501 0.484409H12.5449C12.821 0.484409 13.0449 0.708266 13.0449 0.984409V5.29495L15.8602 8.15014C16.0541 8.34677 16.0518 8.66334 15.8552 8.85723C15.6586 9.05111 15.342 9.04888 15.1481 8.85225L12.1889 5.85106C12.0966 5.7575 12.0449 5.63139 12.0449 5.5V1.48441H11.001V3.5C11.001 3.71049 10.8692 3.89844 10.6713 3.97012C10.4734 4.0418 10.2518 3.98185 10.117 3.82017L7.97863 1.25523L0.866819 8.8672C0.678299 9.06898 0.361899 9.07973 0.16012 8.89121C-0.0416586 8.70269 -0.0524065 8.38629 0.136114 8.18451L7.63462 0.158654C7.73253 0.053856 7.87073 -0.00385092 8.01409 0.000199785Z",fill:"currentColor"}),o4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.99997 6.23385V14.5C2.99997 14.7761 3.22383 15 3.49997 15H12.5C12.7761 15 13 14.7761 13 14.5V6.29693H14V14.5C14 15.3284 13.3284 16 12.5 16H3.49997C2.67154 16 1.99997 15.3284 1.99997 14.5V6.23385H2.99997Z",fill:"currentColor"})]});import{jsx as H3,jsxs as Xe}from"react/jsx-runtime";var ze=C=>Xe("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[H3("title",{children:"HomepageLayouts"}),H3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.47485 1.37903C5.53039 1.1563 5.73045 1 5.96 1H8.04C8.26955 1 8.46961 1.1563 8.52515 1.37903L8.89527 2.86342L9.29182 3.02777L10.6033 2.23982C10.8 2.1216 11.052 2.15255 11.2143 2.31486L12.6851 3.78564C12.8804 3.9809 12.8804 4.29749 12.6851 4.49275C12.4898 4.68801 12.1733 4.68801 11.978 4.49275L10.7834 3.29819L9.59076 4.01478C9.45485 4.09643 9.28828 4.10879 9.14181 4.04808L8.27964 3.69075C8.13325 3.63007 8.02428 3.50359 7.98594 3.34982L7.64936 2H6.35064L6.01406 3.34985C5.97572 3.50361 5.86676 3.6301 5.72036 3.69077L4.85819 4.04813C4.71173 4.10884 4.54514 4.09648 4.40924 4.01482L3.21653 3.29822L2.29819 4.21656L3.0148 5.40926C3.09646 5.54517 3.10882 5.71175 3.04811 5.85822L2.69077 6.72037C2.63009 6.86677 2.5036 6.97573 2.34984 7.01407L1 7.35064V8.64936L2.34982 8.98594C2.50359 9.02428 2.63007 9.13324 2.69075 9.27964L3.04808 10.1418C3.10879 10.2883 3.09643 10.4549 3.01477 10.5908L2.29816 11.7835L3.2165 12.7018L4.40921 11.9852C4.54511 11.9036 4.71169 11.8912 4.85816 11.9519L5.72035 12.3093C5.97545 12.415 6.09653 12.7075 5.9908 12.9626C5.88506 13.2177 5.59255 13.3388 5.33745 13.2331L4.70813 12.9722L3.39667 13.7602C3.19991 13.8784 2.94792 13.8474 2.78561 13.6851L1.31483 12.2144C1.15252 12.052 1.12157 11.8001 1.23979 11.6033L2.02777 10.2918L1.86342 9.89527L0.379031 9.52514C0.156302 9.46961 0 9.26955 0 9.04V6.96C0 6.73045 0.156303 6.53039 0.379034 6.47485L1.86344 6.10473L2.0278 5.7082L1.23982 4.39674C1.1216 4.19998 1.15254 3.94799 1.31486 3.78568L2.78564 2.31489C2.94796 2.15258 3.19994 2.12164 3.3967 2.23986L4.70817 3.02782L5.10472 2.86345L5.47485 1.37903ZM7 6.42C6.12739 6.42 5.42 7.12739 5.42 8C5.42 8.25087 5.4781 8.48674 5.58113 8.69619C5.64338 8.82274 5.7222 8.93997 5.81487 9.04496C5.9976 9.252 5.9779 9.56797 5.77087 9.7507C5.56383 9.93343 5.24786 9.91373 5.06513 9.7067C4.91431 9.53582 4.78566 9.34462 4.68381 9.13757C4.51473 8.79383 4.42 8.40727 4.42 8C4.42 6.57511 5.57511 5.42 7 5.42C7.51009 5.42 7.98702 5.56854 8.38807 5.82492C8.62074 5.97365 8.68878 6.28283 8.54005 6.5155C8.39132 6.74816 8.08214 6.81621 7.84947 6.66748C7.60445 6.51085 7.3136 6.42 7 6.42ZM11.2 5.6C11.3778 5.46667 11.6222 5.46667 11.8 5.6L15.8 8.6C15.9259 8.69443 16 8.84262 16 9V14.5C16 14.7761 15.7761 15 15.5 15H7.5C7.22386 15 7 14.7761 7 14.5V9C7 8.84262 7.0741 8.69443 7.2 8.6L11.2 5.6ZM8 9.25V14H9.5V11C9.5 10.7239 9.72386 10.5 10 10.5H13C13.2761 10.5 13.5 10.7239 13.5 11V14H15V9.25L11.5 6.625L8 9.25ZM12.5 14V11.5H10.5V14H12.5Z",fill:"currentColor"})]});import{jsx as z5,jsxs as Qe}from"react/jsx-runtime";var Ye=C=>Qe("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[z5("title",{children:"Import"}),z5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.85354 12.8535C7.65829 13.0488 7.3417 13.0488 7.14643 12.8536L4.14625 9.85356C4.05248 9.7598 3.99979 9.63261 3.99979 9.5C3.99979 9.36739 4.05248 9.2402 4.14625 9.14644L7.14643 6.14644C7.3417 5.95118 7.65829 5.95119 7.85354 6.14646C8.0488 6.34173 8.04879 6.65831 7.85352 6.85356L5.70695 9L15.4951 9C15.7713 9 15.9951 9.22386 15.9951 9.5C15.9951 9.77614 15.7713 10 15.4951 10L5.70695 10L7.85352 12.1464C8.04879 12.3417 8.0488 12.6583 7.85354 12.8535Z",fill:"currentColor"}),z5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.5C0 0.671573 0.671573 0 1.5 0H5.08579C5.48361 0 5.86514 0.158035 6.14645 0.43934L9.56066 3.85355C9.84196 4.13486 10 4.51639 10 4.91421V7.5C10 7.77614 9.77614 8 9.5 8C9.22386 8 9 7.77614 9 7.5V4.91421C9 4.78161 8.94732 4.65443 8.85355 4.56066L5.43934 1.14645C5.34557 1.05268 5.21839 1 5.08579 1H1.5C1.22386 1 1 1.22386 1 1.5V14.5C1 14.7761 1.22386 15 1.5 15H8.5C8.77614 15 9 14.7761 9 14.5V11.5C9 11.2239 9.22386 11 9.5 11C9.77614 11 10 11.2239 10 11.5V14.5C10 15.3284 9.32843 16 8.5 16H1.5C0.671573 16 0 15.3284 0 14.5V1.5Z",fill:"currentColor"}),z5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.00003 0.500008L5.99998 3.49999C5.99998 3.77614 6.22384 4 6.49998 4H9.5V5H6.49998C5.67155 5 4.99997 4.32841 4.99998 3.49998L5.00003 0.499992L6.00003 0.500008Z",fill:"currentColor"})]});import{jsx as l4,jsxs as je}from"react/jsx-runtime";var $e=C=>je("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[l4("title",{children:"Key"}),l4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.2584 13.5469C3.91923 15.2078 6.65717 15.3066 8.28099 13.6827C9.41881 12.5449 9.97072 10.8274 9.6136 9.43171C9.52821 9.098 9.59909 8.70854 9.8758 8.43183L11.0074 7.30022L11.0074 5.50733C11.0074 5.23118 11.2313 5.00732 11.5074 5.00732C11.7836 5.00732 12.0074 5.23118 12.0074 5.50732V6.30022L13.0074 5.30022L13.0074 3.50733C13.0074 3.23118 13.2313 3.00732 13.5074 3.00732C13.7836 3.00732 14.0074 3.23118 14.0074 3.50732V4.30022L15.0074 3.30022L15.0074 1.00732L12.7145 1.00732L7.58225 6.1396C7.30668 6.41516 6.91752 6.48814 6.58174 6.40054C5.15351 6.0279 3.37204 6.49095 2.25841 7.60458C0.616343 9.24665 0.616334 11.9049 2.2584 13.5469ZM13.8612 5.86068L15.7145 4.00733C15.9021 3.81979 16.0074 3.56543 16.0074 3.30022V1.00732C16.0074 0.45504 15.5597 0.00732451 15.0074 0.00732422L12.7145 0.00732441C12.4493 0.0073241 12.195 0.112681 12.0074 0.300218L6.87546 5.43218C6.87473 5.4326 6.87294 5.43345 6.86949 5.43428C6.86194 5.43611 6.84937 5.43689 6.8342 5.43293C5.06032 4.97011 2.91426 5.53452 1.55131 6.89747C-0.481285 8.93006 -0.481301 12.2214 1.55129 14.254C3.56513 16.2679 6.93727 16.4407 8.9881 14.3898C10.3321 13.0458 11.0413 10.9775 10.5824 9.18382C10.5781 9.16716 10.579 9.15336 10.581 9.14509C10.5819 9.14132 10.5828 9.13936 10.5833 9.13857L11.8607 7.86111C11.8606 7.86126 11.8609 7.86096 11.8607 7.86111L13.8612 5.86068C13.8613 5.86055 13.861 5.86081 13.8612 5.86068ZM4.84102 10.5816C4.84102 10.7924 5.01295 10.9643 5.22369 10.9643C5.43443 10.9643 5.60636 10.7924 5.60636 10.5816C5.60636 10.3709 5.43443 10.199 5.22369 10.199C5.01295 10.199 4.84102 10.3709 4.84102 10.5816ZM5.22369 11.9643C4.46066 11.9643 3.84102 11.3446 3.84102 10.5816C3.84102 9.8186 4.46066 9.19895 5.22369 9.19895C5.98672 9.19895 6.60636 9.8186 6.60636 10.5816C6.60636 11.3446 5.98672 11.9643 5.22369 11.9643Z",fill:"currentColor"}),l4("path",{d:"M5.17432 11.4796C5.7266 11.4796 6.17432 11.0319 6.17432 10.4796C6.17432 9.92733 5.7266 9.47961 5.17432 9.47961C4.62203 9.47961 4.17432 9.92733 4.17432 10.4796C4.17432 11.0319 4.62203 11.4796 5.17432 11.4796Z",fill:"currentColor"})]});import{jsx as p1,jsxs as eo}from"react/jsx-runtime";var Co=C=>eo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[p1("title",{children:"Lightbulb"}),p1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 7.5C8.27614 7.5 8.5 7.72386 8.5 8V11C8.5 11.2761 8.27614 11.5 8 11.5C7.72386 11.5 7.5 11.2761 7.5 11V8C7.5 7.72386 7.72386 7.5 8 7.5Z",fill:"currentColor"}),p1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.49998 5C5.77612 5 5.99998 5.22386 5.99998 5.5C5.99998 6.60457 6.89543 7.5 8 7.5C9.10457 7.5 9.99998 6.60457 9.99998 5.5C9.99998 5.22386 10.2238 5 10.5 5C10.7761 5 11 5.22386 11 5.5C11 7.15685 9.65684 8.5 7.99998 8.5C6.34313 8.5 4.99998 7.15685 4.99998 5.5C4.99998 5.22386 5.22384 5 5.49998 5Z",fill:"currentColor"}),p1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.36091 2.36091C3.50733 3.21449 3 4.45546 3 6C3 6.8775 3.33099 7.78452 3.8581 8.6045C4.38437 9.4232 5.08612 10.1232 5.77735 10.584L5.22265 11.416C4.41388 10.8768 3.61563 10.0766 3.0169 9.14524C2.41901 8.21514 2 7.12215 2 6C2 4.23084 2.58581 2.7218 3.65381 1.65381C4.7218 0.585812 6.23084 0 8 0C9.76916 0 11.2782 0.585812 12.3462 1.65381C13.4142 2.7218 14 4.23084 14 6C14 7.11893 13.5809 8.21188 12.9832 9.14251C12.3847 10.0745 11.5865 10.8766 10.7774 11.416L10.2227 10.584C10.9135 10.1234 11.6153 9.42191 12.1418 8.60214C12.6691 7.78098 13 6.87394 13 6C13 4.45546 12.4927 3.21449 11.6391 2.36091C10.7855 1.50733 9.54454 1 8 1C6.45546 1 5.21449 1.50733 4.36091 2.36091Z",fill:"currentColor"}),p1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 10.5H10C10.8284 10.5 11.5 11.1716 11.5 12C11.5 12.8284 10.8284 13.5 10 13.5H6C5.17157 13.5 4.5 12.8284 4.5 12C4.5 11.1716 5.17157 10.5 6 10.5ZM10 12.5H6C5.72386 12.5 5.5 12.2761 5.5 12C5.5 11.7239 5.72386 11.5 6 11.5H10C10.2761 11.5 10.5 11.7239 10.5 12C10.5 12.2761 10.2761 12.5 10 12.5Z",fill:"currentColor"}),p1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 12.5H9C9.82843 12.5 10.5 13.1716 10.5 14C10.5 14.8284 9.82843 15.5 9 15.5H7C6.17157 15.5 5.5 14.8284 5.5 14C5.5 13.1716 6.17157 12.5 7 12.5ZM7 13.5C6.72386 13.5 6.5 13.7239 6.5 14C6.5 14.2761 6.72386 14.5 7 14.5H9C9.27614 14.5 9.5 14.2761 9.5 14C9.5 13.7239 9.27614 13.5 9 13.5H7Z",fill:"currentColor"}),p1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 15.5C7 15.2239 7.22386 15 7.5 15H8.5C8.77614 15 9 15.2239 9 15.5C9 15.7761 8.77614 16 8.5 16H7.5C7.22386 16 7 15.7761 7 15.5Z",fill:"currentColor"})]});import{jsx as M3,jsxs as lo}from"react/jsx-runtime";var oo=C=>lo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[M3("title",{children:"Link"}),M3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2481 0.444686C11.8411 -0.148229 12.8024 -0.148228 13.3953 0.444686L15.5553 2.60473C16.1482 3.19764 16.1482 4.15895 15.5553 4.75186L11.9067 8.40044C11.5385 8.76863 10.9416 8.76863 10.5734 8.40044L10.2603 8.08733C10.065 7.89207 10.065 7.57549 10.2603 7.38023C10.4556 7.18496 10.7721 7.18496 10.9674 7.38023L11.2401 7.65289L14.8482 4.04475C15.0506 3.84236 15.0506 3.51422 14.8482 3.31183L12.6882 1.15179C12.4858 0.949402 12.1576 0.949403 11.9552 1.15179L8.34711 4.75993L8.61296 5.02577C8.80822 5.22103 8.80822 5.53761 8.61295 5.73288C8.41769 5.92814 8.10111 5.92814 7.90585 5.73287L7.59615 5.42318C7.22985 5.05687 7.22985 4.46298 7.59615 4.09668L11.2481 0.444686ZM11.4083 4.59166C11.6036 4.78692 11.6036 5.1035 11.4083 5.29876L5.2988 11.4083C5.10353 11.6036 4.78695 11.6036 4.59169 11.4083C4.39643 11.213 4.39643 10.8965 4.59169 10.7012L10.7012 4.59166C10.8965 4.3964 11.213 4.39639 11.4083 4.59166ZM4.75993 8.34711L5.03259 8.61977C5.22785 8.81504 5.54443 8.81504 5.73969 8.61977C5.93496 8.42451 5.93496 8.10793 5.73969 7.91267L5.42659 7.59956C5.0584 7.23137 4.46145 7.23137 4.09327 7.59956L0.444686 11.2481C-0.148229 11.8411 -0.148229 12.8024 0.444686 13.3953L2.60473 15.5553C3.19764 16.1482 4.15895 16.1482 4.75186 15.5553L8.40385 11.9033C8.77015 11.537 8.77015 10.9431 8.40385 10.5768L8.09415 10.2671C7.89889 10.0719 7.58231 10.0719 7.38704 10.2671C7.19178 10.4624 7.19178 10.779 7.38704 10.9742L7.65289 11.2401L4.04475 14.8482C3.84236 15.0506 3.51422 15.0506 3.31183 14.8482L1.15179 12.6882C0.949403 12.4858 0.949402 12.1576 1.15179 11.9552L4.75993 8.34711Z",fill:"currentColor"})]});import{jsx as b1,jsxs as ro}from"react/jsx-runtime";var to=C=>ro("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[b1("title",{children:"LiveNow"}),b1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.4478 4.27637C6.32431 4.02938 6.02397 3.92926 5.77698 4.05276L5.77602 4.05324L5.77486 4.05382L5.77201 4.05527L5.76412 4.0593L5.73999 4.07217C5.72031 4.08282 5.69358 4.09774 5.66081 4.11705C5.59532 4.15565 5.50534 4.21201 5.39908 4.28727C5.18711 4.43742 4.90697 4.6652 4.62689 4.98029C4.06298 5.61469 3.50059 6.60358 3.50059 7.99997C3.50059 9.39637 4.06298 10.3853 4.62689 11.0197C4.90697 11.3347 5.18711 11.5625 5.39908 11.7127C5.50534 11.7879 5.59532 11.8443 5.66081 11.8829C5.69358 11.9022 5.72031 11.9171 5.73999 11.9278L5.76412 11.9406L5.77201 11.9447L5.77486 11.9461L5.77602 11.9467C5.77602 11.9467 5.77201 11.9447 5.73999 11.9278L5.77698 11.9472C6.02397 12.0707 6.32431 11.9706 6.4478 11.7236C6.57097 11.4772 6.47171 11.1778 6.22615 11.0537L6.22503 11.0532L6.21627 11.0485C6.20665 11.0433 6.19041 11.0343 6.1685 11.0214C6.12461 10.9955 6.05834 10.9542 5.9771 10.8966C5.81407 10.7812 5.59421 10.6027 5.37429 10.3553C4.9382 9.86469 4.50059 9.10358 4.50059 7.99997C4.50059 6.89637 4.9382 6.13526 5.37429 5.64465C5.59421 5.39725 5.81407 5.21877 5.9771 5.1033C6.05834 5.04575 6.12461 5.00445 6.1685 4.97859C6.19041 4.96568 6.20665 4.95667 6.21627 4.95146L6.22559 4.9465L6.22461 4.94698C6.4713 4.82335 6.57123 4.52322 6.4478 4.27637Z",fill:"currentColor"}),b1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00021 8.99998C8.5525 8.99998 9.00021 8.55227 9.00021 7.99998C9.00021 7.4477 8.5525 6.99998 8.00021 6.99998C7.44793 6.99998 7.00021 7.4477 7.00021 7.99998C7.00021 8.55227 7.44793 8.99998 8.00021 8.99998ZM8.00021 9.99998C9.10478 9.99998 10.0002 9.10455 10.0002 7.99998C10.0002 6.89542 9.10478 5.99998 8.00021 5.99998C6.89564 5.99998 6.00021 6.89542 6.00021 7.99998C6.00021 9.10455 6.89564 9.99998 8.00021 9.99998Z",fill:"currentColor"}),b1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.55262 4.27637C9.67611 4.02938 9.97645 3.92926 10.2234 4.05276L10.2363 4.05934C10.2234 4.05275 10.2234 4.05276 10.2234 4.05276L10.2244 4.05324L10.2256 4.05382L10.2284 4.05527L10.2363 4.05934L10.2604 4.07217C10.2801 4.08282 10.3068 4.09774 10.3396 4.11705C10.4051 4.15565 10.4951 4.21201 10.6013 4.28727C10.8133 4.43742 11.0935 4.6652 11.3735 4.98029C11.9374 5.61469 12.4998 6.60358 12.4998 7.99997C12.4998 9.39637 11.9374 10.3853 11.3735 11.0197C11.0935 11.3347 10.8133 11.5625 10.6013 11.7127C10.4951 11.7879 10.4051 11.8443 10.3396 11.8829C10.3068 11.9022 10.2801 11.9171 10.2604 11.9278L10.2363 11.9406L10.2284 11.9447L10.2256 11.9461L10.2244 11.9467L10.2234 11.9472C9.97645 12.0707 9.67611 11.9706 9.55262 11.7236C9.42945 11.4772 9.52871 11.1778 9.77427 11.0537L9.77539 11.0532L9.78415 11.0485C9.79377 11.0433 9.81001 11.0343 9.83192 11.0214C9.87581 10.9955 9.94208 10.9542 10.0233 10.8966C10.1864 10.7812 10.4062 10.6027 10.6261 10.3553C11.0622 9.86469 11.4998 9.10358 11.4998 7.99997C11.4998 6.89637 11.0622 6.13526 10.6261 5.64465C10.4062 5.39725 10.1864 5.21877 10.0233 5.1033C9.94208 5.04575 9.87581 5.00445 9.83192 4.97859C9.81001 4.96568 9.79377 4.95667 9.78415 4.95146L9.77484 4.9465L9.77581 4.94698C9.52912 4.82336 9.42919 4.52322 9.55262 4.27637Z",fill:"currentColor"}),b1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.0844 1.72269C12.2376 1.49292 12.548 1.43084 12.7778 1.58401L12.7787 1.58461L12.7798 1.58539L12.783 1.58751L12.7925 1.59411C12.8002 1.59944 12.8108 1.60666 12.8239 1.616C12.8501 1.63466 12.8868 1.66135 12.9324 1.69607C13.0235 1.76549 13.1505 1.86721 13.3014 2.00133C13.6027 2.26923 14.0018 2.6685 14.4004 3.20004C15.1989 4.26462 16.0004 5.86729 16.0004 8.00004C16.0004 10.1328 15.1989 11.7355 14.4004 12.8C14.0018 13.3316 13.6027 13.7308 13.3014 13.9987C13.1505 14.1329 13.0235 14.2346 12.9324 14.304C12.8868 14.3387 12.8501 14.3654 12.8239 14.3841C12.8108 14.3934 12.8002 14.4007 12.7925 14.4061L12.783 14.4126L12.7798 14.4147L12.7787 14.4155C12.7787 14.4155 12.7778 14.4161 12.7925 14.4061L12.7778 14.4161C12.548 14.5692 12.2376 14.5072 12.0844 14.2774C11.9314 14.0479 11.9931 13.738 12.2222 13.5846L12.2231 13.584L12.2256 13.5823L12.2444 13.5691C12.2621 13.5565 12.2899 13.5363 12.3263 13.5086C12.3993 13.453 12.5066 13.3672 12.637 13.2513C12.8981 13.0192 13.2491 12.6685 13.6004 12.2C14.302 11.2646 15.0004 9.86729 15.0004 8.00004C15.0004 6.13279 14.302 4.73545 13.6004 3.80004C13.2491 3.33158 12.8981 2.98085 12.637 2.74874C12.5066 2.63286 12.3993 2.54709 12.3263 2.4915C12.2899 2.46373 12.2621 2.44354 12.2444 2.43095L12.2256 2.41779L12.2222 2.41549C11.9927 2.26224 11.9313 1.95234 12.0844 1.72269Z",fill:"currentColor"}),b1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.91602 14.2773C3.76285 14.507 3.45241 14.5691 3.22265 14.416L3.20794 14.406C3.21745 14.4125 3.22265 14.416 3.22265 14.416L3.22176 14.4154L3.2206 14.4146L3.21745 14.4125L3.20794 14.406C3.2002 14.4006 3.18967 14.3933 3.17655 14.384C3.1503 14.3653 3.11365 14.3386 3.06807 14.3039C2.97696 14.2345 2.84995 14.1328 2.69907 13.9986C2.39769 13.7307 1.99866 13.3315 1.6 12.7999C0.801561 11.7353 -1.86451e-07 10.1327 0 7.99993C1.86451e-07 5.86718 0.801561 4.26452 1.6 3.19993C1.99866 2.66839 2.39769 2.26912 2.69907 2.00123C2.84995 1.86711 2.97696 1.76538 3.06807 1.69597C3.11365 1.66124 3.1503 1.63455 3.17655 1.61589C3.18967 1.60656 3.2002 1.59923 3.20794 1.5939L3.21745 1.5874L3.2206 1.58528L3.22176 1.5845L3.20794 1.5939L3.22265 1.58391C3.45241 1.43073 3.76285 1.49282 3.91603 1.72258C4.069 1.95204 4.00728 2.26196 3.77825 2.41535L3.77735 2.41596L3.77485 2.41768L3.75607 2.43085C3.73837 2.44343 3.71057 2.46362 3.67412 2.4914C3.60116 2.54698 3.4938 2.63276 3.36343 2.74864C3.10231 2.98074 2.75134 3.33147 2.4 3.79993C1.69844 4.73535 1 6.13268 1 7.99993C1 9.86718 1.69844 11.2645 2.4 12.1999C2.75134 12.6684 3.10231 13.0191 3.36343 13.2512C3.4938 13.3671 3.60116 13.4529 3.67411 13.5085C3.71057 13.5362 3.73837 13.5564 3.75607 13.569L3.77485 13.5822L3.7782 13.5845C4.00769 13.7377 4.06912 14.0476 3.91602 14.2773Z",fill:"currentColor"})]});import{jsx as R3,jsxs as no}from"react/jsx-runtime";var io=C=>no("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[R3("title",{children:"Location"}),R3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8536 0.146461C15.995 0.287892 16.0385 0.500001 15.9642 0.68571L9.96424 15.6857C9.88484 15.8842 9.68799 16.0103 9.47446 15.9994C9.26094 15.9884 9.07798 15.843 9.01924 15.6374L7.09555 8.90446L0.362644 6.98078C0.157063 6.92204 0.0115788 6.73908 0.00065724 6.52556C-0.0102643 6.31203 0.115794 6.11518 0.314309 6.03578L15.3143 0.0357762C15.5 -0.0385071 15.7121 0.00502989 15.8536 0.146461ZM2.04369 6.42106L7.63736 8.01925C7.80347 8.06671 7.93331 8.19655 7.98077 8.36265L9.57896 13.9563L14.6025 1.39754L2.04369 6.42106Z",fill:"currentColor"})]});import{jsx as t4,jsxs as so}from"react/jsx-runtime";var po=C=>so("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[t4("title",{children:"LocationPin"}),t4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.29536 2.35655C3.46818 3.20428 3 4.44331 3 6C3 7.52948 3.57718 9.06154 4.54793 10.6009C5.44132 12.0177 6.65144 13.4145 8 14.7895C9.34856 13.4145 10.5587 12.0177 11.4521 10.6009C12.4228 9.06154 13 7.52948 13 6C13 4.44331 12.5318 3.20428 11.7046 2.35655C10.8794 1.51082 9.64373 1 8 1C6.35627 1 5.12059 1.51082 4.29536 2.35655ZM3.57964 1.65817C4.62941 0.582323 6.14373 0 8 0C9.85627 0 11.3706 0.582323 12.4204 1.65817C13.4682 2.73201 14 4.24299 14 6C14 7.78423 13.3272 9.50217 12.2979 11.1343C11.2687 12.7664 9.86352 14.3436 8.35355 15.8536C8.15829 16.0488 7.84171 16.0488 7.64645 15.8536C6.13648 14.3436 4.73126 12.7664 3.70207 11.1343C2.67282 9.50217 2 7.78423 2 6C2 4.24299 2.53182 2.73201 3.57964 1.65817Z",fill:"currentColor"}),t4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 8C9.10457 8 10 7.10457 10 6C10 4.89543 9.10457 4 8 4C6.89543 4 6 4.89543 6 6C6 7.10457 6.89543 8 8 8ZM8 9C9.65685 9 11 7.65685 11 6C11 4.34315 9.65685 3 8 3C6.34315 3 5 4.34315 5 6C5 7.65685 6.34315 9 8 9Z",fill:"currentColor"})]});import{jsx as r4,jsxs as fo}from"react/jsx-runtime";var co=C=>fo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[r4("title",{children:"Lock"}),r4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99988 10C7.72374 10 7.49988 10.2239 7.49988 10.5C7.49988 10.7761 7.72374 11 7.99988 11C8.27602 11 8.49988 10.7761 8.49988 10.5C8.49988 10.2239 8.27602 10 7.99988 10ZM9.49988 10.5C9.49988 11.3284 8.82831 12 7.99988 12C7.17145 12 6.49988 11.3284 6.49988 10.5C6.49988 9.67157 7.17145 9 7.99988 9C8.82831 9 9.49988 9.67157 9.49988 10.5Z",fill:"currentColor"}),r4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.49988 3.5C4.49988 1.567 6.06688 0 7.99988 0C9.93287 0 11.4999 1.567 11.4999 3.5V6H13.0002C13.5525 6 14.0002 6.44772 14.0002 7V15C14.0002 15.5523 13.5525 16 13.0002 16H2.99951C2.44723 16 1.99951 15.5523 1.99951 15V7C1.99951 6.44772 2.44723 6 2.99951 6H4.49988V3.5ZM2.99951 7V15H13.0002V7H2.99951ZM10.4999 6H5.49988V3.5C5.49988 2.11929 6.61917 1 7.99988 1C9.38059 1 10.4999 2.11929 10.4999 3.5V6ZM7.99988 11C8.27602 11 8.49988 11.2239 8.49988 11.5V12.5C8.49988 12.7761 8.27602 13 7.99988 13C7.72374 13 7.49988 12.7761 7.49988 12.5V11.5C7.49988 11.2239 7.72374 11 7.99988 11Z",fill:"currentColor"})]});import{jsx as i4,jsxs as ao}from"react/jsx-runtime";var ho=C=>ao("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[i4("title",{children:"Logout"}),i4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15.5C8 15.7761 7.77614 16 7.5 16H1.5C0.671573 16 -7.24234e-08 15.3284 0 14.5L1.1365e-06 1.5C1.20892e-06 0.671573 0.671574 -7.24229e-08 1.5 0L7.5 5.24537e-07C7.77614 5.48679e-07 8 0.223858 8 0.500001C8 0.776143 7.77614 1 7.5 1L1.5 1C1.22386 1 1 1.22386 1 1.5L1 14.5C1 14.7761 1.22386 15 1.5 15L7.5 15C7.77614 15 8 15.2239 8 15.5Z",fill:"currentColor"}),i4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.1416 4.64646C12.3368 4.45119 12.6534 4.45118 12.8487 4.64644L15.8489 7.64644C15.9426 7.74021 15.9953 7.86739 15.9953 8C15.9953 8.13261 15.9426 8.2598 15.8489 8.35356L12.8487 11.3536C12.6534 11.5488 12.3368 11.5488 12.1416 11.3535C11.9463 11.1583 11.9463 10.8417 12.1416 10.6464L14.2882 8.5H4.5C4.22386 8.5 4 8.27614 4 8C4 7.72386 4.22386 7.5 4.5 7.5H14.2882L12.1416 5.35356C11.9463 5.15831 11.9463 4.84173 12.1416 4.64646Z",fill:"currentColor"})]});import{jsx as X5,jsxs as go}from"react/jsx-runtime";var Lo=C=>go("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[X5("title",{children:"Menu"}),X5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.17097e-05 2.5C3.17097e-05 2.22386 0.223889 2 0.500032 2H15.5C15.7762 2 16 2.22386 16 2.5C16 2.77614 15.7762 3 15.5 3H0.500032C0.223889 3 3.17097e-05 2.77614 3.17097e-05 2.5Z",fill:"currentColor"}),X5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 8C0 7.72386 0.223858 7.5 0.5 7.5H11.5C11.7762 7.5 12 7.72386 12 8C12 8.27614 11.7762 8.5 11.5 8.5H0.5C0.223858 8.5 0 8.27614 0 8Z",fill:"currentColor"}),X5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.76566e-05 13.5C2.76566e-05 13.2239 0.223885 13 0.500028 13H15.5C15.7762 13 16 13.2239 16 13.5C16 13.7761 15.7762 14 15.5 14H0.500028C0.223885 14 2.76566e-05 13.7761 2.76566e-05 13.5Z",fill:"currentColor"})]});import{jsx as Z3,jsxs as Vo}from"react/jsx-runtime";var uo=C=>Vo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Z3("title",{children:"New"}),Z3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 1.5C3 0.671573 3.67157 0 4.5 0H7.58579C7.98361 0 8.36514 0.158035 8.64645 0.439339L12.5607 4.35355C12.842 4.63486 13 5.01639 13 5.41421V14.5C13 15.3284 12.3284 16 11.5 16H4.5C3.67157 16 3 15.3284 3 14.5V1.5ZM4.5 1C4.22386 1 4 1.22386 4 1.5V14.5C4 14.7761 4.22386 15 4.5 15H11.5C11.7761 15 12 14.7761 12 14.5V5.5H9C8.17157 5.5 7.5 4.82843 7.5 4V1H4.5ZM8.5 1.70711V4C8.5 4.27614 8.72386 4.5 9 4.5H11.2929L8.5 1.70711Z",fill:"currentColor"})]});import{jsx as n4,jsxs as mo}from"react/jsx-runtime";var vo=C=>mo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[n4("title",{children:"NewWindow"}),n4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 1C1.22386 1 1 1.22386 1 1.5V14.5C1 14.7761 1.22386 15 1.5 15H14.5C14.7761 15 15 14.7761 15 14.5V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V14.5C16 15.3284 15.3284 16 14.5 16H1.5C0.671573 16 0 15.3284 0 14.5V1.5C0 0.671574 0.671573 1.55371e-06 1.5 1.55371e-06H6.5C6.77614 1.55371e-06 7 0.223859 7 0.500002C7 0.776144 6.77614 1 6.5 1H1.5Z",fill:"currentColor"}),n4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.14645 7.85355C7.95118 7.65829 7.95118 7.34171 8.14645 7.14645L14.2929 1L10.5 1C10.2239 1 10 0.776143 10 0.5C10 0.223858 10.2239 -2.41412e-08 10.5 0L14.5 3.49691e-07C15.3284 4.22114e-07 16 0.671573 16 1.5V5.5C16 5.77614 15.7761 6 15.5 6C15.2239 6 15 5.77614 15 5.5L15 1.70711L8.85355 7.85355C8.65829 8.04882 8.34171 8.04882 8.14645 7.85355Z",fill:"currentColor"})]});import{jsx as s5,jsxs as Ho}from"react/jsx-runtime";var wo=C=>Ho("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[s5("title",{children:"OverflowMobile"}),s5("path",{d:"M8 2.5C7.72386 2.5 7.5 2.27614 7.5 2C7.5 1.72386 7.72386 1.5 8 1.5C8.27614 1.5 8.5 1.72386 8.5 2C8.5 2.27614 8.27614 2.5 8 2.5Z",fill:"currentColor"}),s5("path",{d:"M8 8.50001C7.72386 8.50001 7.5 8.27615 7.5 8.00001C7.5 7.72386 7.72386 7.50001 8 7.50001C8.27614 7.50001 8.5 7.72386 8.5 8.00001C8.5 8.27615 8.27614 8.50001 8 8.50001Z",fill:"currentColor"}),s5("path",{d:"M8.00001 14.5C7.72387 14.5 7.50001 14.2762 7.50001 14C7.50001 13.7239 7.72387 13.5 8.00001 13.5C8.27615 13.5 8.50001 13.7239 8.50001 14C8.50001 14.2762 8.27615 14.5 8.00001 14.5Z",fill:"currentColor"}),s5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 3C7.44772 3 7 2.55228 7 2C7 1.44772 7.44772 1 8 1C8.55229 1 9 1.44772 9 2C9 2.55228 8.55229 3 8 3ZM8 9.00001C7.44772 9.00001 7 8.55229 7 8.00001C7 7.44772 7.44772 7.00001 8 7.00001C8.55228 7.00001 9 7.44772 9 8.00001C9 8.55229 8.55228 9.00001 8 9.00001ZM8.00001 15C7.44773 15 7.00001 14.5523 7.00001 14C7.00001 13.4477 7.44773 13 8.00001 13C8.5523 13 9.00001 13.4477 9.00001 14C9.00001 14.5523 8.5523 15 8.00001 15ZM7.50001 14C7.50001 14.2762 7.72387 14.5 8.00001 14.5C8.27615 14.5 8.50001 14.2762 8.50001 14C8.50001 13.7239 8.27615 13.5 8.00001 13.5C7.72387 13.5 7.50001 13.7239 7.50001 14ZM8 2.5C7.72386 2.5 7.5 2.27614 7.5 2C7.5 1.72386 7.72386 1.5 8 1.5C8.27614 1.5 8.5 1.72386 8.5 2C8.5 2.27614 8.27614 2.5 8 2.5ZM8 8.50001C7.72386 8.50001 7.5 8.27615 7.5 8.00001C7.5 7.72386 7.72386 7.50001 8 7.50001C8.27614 7.50001 8.5 7.72386 8.5 8.00001C8.5 8.27615 8.27614 8.50001 8 8.50001Z",fill:"currentColor"})]});import{jsx as c5,jsxs as Ro}from"react/jsx-runtime";var Mo=C=>Ro("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[c5("title",{children:"OverflowWeb"}),c5("path",{d:"M2.5 8C2.5 8.27614 2.27614 8.5 2 8.5C1.72386 8.5 1.5 8.27614 1.5 8C1.5 7.72386 1.72386 7.5 2 7.5C2.27614 7.5 2.5 7.72386 2.5 8Z",fill:"currentColor"}),c5("path",{d:"M8.49999 8C8.49999 8.27614 8.27613 8.5 7.99999 8.5C7.72385 8.5 7.49999 8.27614 7.49999 8C7.49999 7.72386 7.72385 7.5 7.99999 7.5C8.27613 7.5 8.49999 7.72386 8.49999 8Z",fill:"currentColor"}),c5("path",{d:"M14.5 8C14.5 8.27614 14.2761 8.5 14 8.5C13.7239 8.5 13.5 8.27614 13.5 8C13.5 7.72386 13.7239 7.5 14 7.5C14.2761 7.5 14.5 7.72386 14.5 8Z",fill:"currentColor"}),c5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 8C3 8.55228 2.55228 9 2 9C1.44772 9 1 8.55228 1 8C1 7.44772 1.44772 7 2 7C2.55228 7 3 7.44772 3 8ZM8.99999 8C8.99999 8.55228 8.55227 9 7.99999 9C7.4477 9 6.99999 8.55228 6.99999 8C6.99999 7.44772 7.4477 7 7.99999 7C8.55227 7 8.99999 7.44772 8.99999 8ZM15 8C15 8.55228 14.5523 9 14 9C13.4477 9 13 8.55228 13 8C13 7.44772 13.4477 7 14 7C14.5523 7 15 7.44772 15 8ZM2.5 8C2.5 8.27614 2.27614 8.5 2 8.5C1.72386 8.5 1.5 8.27614 1.5 8C1.5 7.72386 1.72386 7.5 2 7.5C2.27614 7.5 2.5 7.72386 2.5 8ZM8.49999 8C8.49999 8.27614 8.27613 8.5 7.99999 8.5C7.72385 8.5 7.49999 8.27614 7.49999 8C7.49999 7.72386 7.72385 7.5 7.99999 7.5C8.27613 7.5 8.49999 7.72386 8.49999 8ZM14 8.5C14.2761 8.5 14.5 8.27614 14.5 8C14.5 7.72386 14.2761 7.5 14 7.5C13.7239 7.5 13.5 7.72386 13.5 8C13.5 8.27614 13.7239 8.5 14 8.5Z",fill:"currentColor"})]});import{jsx as f5,jsxs as So}from"react/jsx-runtime";var Zo=C=>So("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[f5("title",{children:"Password"}),f5("path",{d:"M5 8C5 8.55228 4.55228 9 4 9C3.44772 9 3 8.55228 3 8C3 7.44772 3.44772 7 4 7C4.55228 7 5 7.44772 5 8Z",fill:"currentColor"}),f5("path",{d:"M9 8C9 8.55228 8.55229 9 8 9C7.44772 9 7 8.55228 7 8C7 7.44772 7.44772 7 8 7C8.55229 7 9 7.44772 9 8Z",fill:"currentColor"}),f5("path",{d:"M13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8Z",fill:"currentColor"}),f5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 5.5C0 4.67157 0.671573 4 1.5 4H14.5C15.3284 4 16 4.67157 16 5.5V10.5C16 11.3284 15.3284 12 14.5 12H1.5C0.671573 12 0 11.3284 0 10.5V5.5ZM1.5 5C1.22386 5 1 5.22386 1 5.5V10.5C1 10.7761 1.22386 11 1.5 11H14.5C14.7761 11 15 10.7761 15 10.5V5.5C15 5.22386 14.7761 5 14.5 5H1.5Z",fill:"currentColor"})]});import{jsx as y1,jsxs as Po}from"react/jsx-runtime";var Go=C=>Po("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[y1("title",{children:"PasswordLock"}),y1("path",{d:"M5 6C5 6.55228 4.55228 7 4 7C3.44772 7 3 6.55228 3 6C3 5.44772 3.44772 5 4 5C4.55228 5 5 5.44772 5 6Z",fill:"currentColor"}),y1("path",{d:"M9 6C9 6.55228 8.55229 7 8 7C7.44772 7 7 6.55228 7 6C7 5.44772 7.44772 5 8 5C8.55229 5 9 5.44772 9 6Z",fill:"currentColor"}),y1("path",{d:"M13 6C13 6.55228 12.5523 7 12 7C11.4477 7 11 6.55228 11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6Z",fill:"currentColor"}),y1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3.5C0 2.67157 0.671573 2 1.5 2H14.5C15.3284 2 16 2.67157 16 3.5V6.5C16 6.77614 15.7761 7 15.5 7C15.2239 7 15 6.77614 15 6.5V3.5C15 3.22386 14.7761 3 14.5 3H1.5C1.22386 3 1 3.22386 1 3.5V8.5C1 8.77614 1.22386 9 1.5 9H7.5C7.77614 9 8 9.22386 8 9.5C8 9.77614 7.77614 10 7.5 10H1.5C0.671573 10 0 9.32843 0 8.5V3.5Z",fill:"currentColor"}),y1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.4995 8.14804C10.8462 7.75365 11.359 7.5 12.0002 7.5C12.6413 7.5 13.1541 7.75366 13.5007 8.1481C13.8386 8.53259 14 9.02839 14 9.5V10.0328C14.1048 10.0514 14.2119 10.0824 14.3175 10.1362C14.5527 10.2561 14.7439 10.4473 14.8638 10.6825C14.9465 10.845 14.9754 11.0107 14.9881 11.1667C15 11.3123 15 11.4874 15 11.682V12.318C15 12.5126 15 12.6877 14.9881 12.8333C14.9754 12.9893 14.9465 13.155 14.8638 13.3175C14.7439 13.5527 14.5527 13.7439 14.3175 13.8638C14.155 13.9465 13.9893 13.9754 13.8333 13.9881C13.6876 14 13.5125 14 13.3179 14H10.6698C10.4752 14 10.3001 14 10.1545 13.9881C9.99849 13.9754 9.83276 13.9465 9.67031 13.8638C9.4351 13.7439 9.24388 13.5527 9.12403 13.3175C9.04126 13.155 9.01242 12.9893 8.99967 12.8333C8.98777 12.6877 8.98778 12.5126 8.98779 12.318V11.682C8.98778 11.4874 8.98777 11.3123 8.99967 11.1667C9.01242 11.0107 9.04126 10.845 9.12403 10.6825C9.24388 10.4473 9.4351 10.2561 9.67031 10.1362C9.75785 10.0916 9.85591 10.0438 10 10.0198V9.5C10 9.02831 10.1615 8.5325 10.4995 8.14804ZM11 10H13V9.5C13 9.24674 12.9115 8.99254 12.7496 8.80825C12.5963 8.6339 12.3592 8.5 12.0002 8.5C11.6411 8.5 11.4039 8.63391 11.2505 8.8083C11.0885 8.99263 11 9.24682 11 9.5V10ZM10.1633 11.0079C10.1546 11.012 10.143 11.0177 10.1243 11.0272C10.0773 11.0512 10.039 11.0895 10.015 11.1365C10.015 11.1365 10.0144 11.1378 10.0135 11.1404C10.0125 11.1431 10.0109 11.1481 10.009 11.1562C10.0049 11.1734 10.0002 11.2015 9.99635 11.2481C9.98818 11.3481 9.98779 11.4817 9.98779 11.7V12.3C9.98779 12.5183 9.98818 12.6519 9.99635 12.7519C10.0002 12.7985 10.0049 12.8266 10.009 12.8438C10.0109 12.8519 10.0125 12.8569 10.0135 12.8596C10.0144 12.8622 10.015 12.8635 10.015 12.8635C10.039 12.9105 10.0773 12.9488 10.1243 12.9728C10.1243 12.9728 10.1256 12.9734 10.1282 12.9743C10.1309 12.9753 10.1359 12.9769 10.144 12.9788C10.1612 12.9829 10.1893 12.9876 10.2359 12.9914C10.3359 12.9996 10.4695 13 10.6878 13H13.2999C13.5182 13 13.6519 12.9996 13.7519 12.9914C13.7985 12.9876 13.8266 12.9829 13.8438 12.9788C13.8519 12.9769 13.8569 12.9753 13.8596 12.9743C13.8622 12.9734 13.8635 12.9728 13.8635 12.9728C13.9105 12.9488 13.9488 12.9105 13.9728 12.8635C13.9728 12.8635 13.9734 12.8622 13.9743 12.8596C13.9753 12.8569 13.9769 12.8519 13.9788 12.8438C13.9829 12.8266 13.9876 12.7985 13.9914 12.7519C13.9996 12.6519 14 12.5183 14 12.3V11.7C14 11.4817 13.9996 11.3481 13.9914 11.2481C13.9876 11.2015 13.9829 11.1734 13.9788 11.1562C13.9769 11.1481 13.9753 11.1431 13.9743 11.1404C13.9734 11.1378 13.9728 11.1365 13.9728 11.1365C13.9488 11.0895 13.9105 11.0512 13.8635 11.0272C13.8635 11.0272 13.8622 11.0266 13.8596 11.0257C13.8569 11.0247 13.8519 11.0231 13.8438 11.0212C13.8266 11.0171 13.7985 11.0124 13.7519 11.0086C13.6519 11.0004 13.5182 11 13.2999 11H10.5C10.393 11 10.3187 11 10.2612 11.0012C10.206 11.0023 10.1804 11.0043 10.1681 11.0058C10.1681 11.0058 10.1652 11.0071 10.1633 11.0079Z",fill:"currentColor"})]});import{jsx as Y5,jsxs as bo}from"react/jsx-runtime";var xo=C=>bo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Y5("title",{children:"Promotions"}),Y5("path",{d:"M13 4.00003C13 4.55231 12.5523 5.00003 12 5.00003C11.4477 5.00003 11 4.55231 11 4.00003C11 3.44774 11.4477 3.00003 12 3.00003C12.5523 3.00003 13 3.44774 13 4.00003Z",fill:"currentColor"}),Y5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.00003C12.5523 5.00003 13 4.55231 13 4.00003C13 3.44774 12.5523 3.00003 12 3.00003C11.4477 3.00003 11 3.44774 11 4.00003C11 4.55231 11.4477 5.00003 12 5.00003Z",fill:"currentColor"}),Y5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5 2.30438e-05C15.7762 2.42028e-05 16 0.223882 16 0.500023L16 6.50002C16 6.63262 15.9473 6.7598 15.8536 6.85357L6.85356 15.8536C6.65829 16.0488 6.34171 16.0488 6.14645 15.8536L0.146447 9.85357C0.0526787 9.7598 7.3757e-07 9.63262 0 9.50002C6.11129e-07 9.36741 0.0526785 9.24023 0.146447 9.14646L9.14646 0.146447C9.24023 0.052678 9.36741 -4.63612e-07 9.50002 0L15.5 2.30438e-05ZM9.70712 1L1.20711 9.50002L6.5 14.7929L15 6.29291L15 1.00002L9.70712 1Z",fill:"currentColor"})]});import{jsx as Q5,jsxs as Io}from"react/jsx-runtime";var yo=C=>Io("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Q5("title",{children:"Publish"}),Q5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.64646 7.85379C4.45119 7.65854 4.45118 7.34195 4.64644 7.14668L7.64644 4.1465C7.74021 4.05273 7.86739 4.00005 8 4.00005C8.13262 4.00005 8.2598 4.05273 8.35357 4.1465L11.3536 7.14668C11.5488 7.34195 11.5488 7.65854 11.3535 7.85379C11.1583 8.04905 10.8417 8.04904 10.6464 7.85377L8.5 5.7072V15.4954C8.5 15.7715 8.27614 15.9954 8 15.9954C7.72386 15.9954 7.5 15.7715 7.5 15.4954V5.7072L5.35357 7.85377C5.15831 8.04904 4.84173 8.04905 4.64646 7.85379Z",fill:"currentColor"}),Q5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 1.9874L0 1.9873L6.25e-06 0.987305L16 0.987405L16 1.9874Z",fill:"currentColor"}),Q5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 1V10H2.5C2.77615 10 3 10.2239 3 10.5C3 10.7761 2.77615 11 2.5 11H0.750003C0.33579 11 3.125e-06 10.6642 3.125e-06 10.25V0.75C3.125e-06 0.335786 0.33579 0 0.750003 0H15.25C15.6642 0 16 0.335787 16 0.75V10.25C16 10.6642 15.6642 11 15.25 11H13.5C13.2239 11 13 10.7761 13 10.5C13 10.2239 13.2239 10 13.5 10H15V1H1Z",fill:"currentColor"})]});import{jsx as S3,jsxs as ko}from"react/jsx-runtime";var Bo=C=>ko("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[S3("title",{children:"ReferFriend"}),S3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 1C6.34313 1 4.99999 2.34315 4.99999 4C4.99999 5.65685 6.34313 7 7.99999 7C9.65684 7 11 5.65685 11 4C11 2.34315 9.65684 1 7.99999 1ZM10.0735 7.42128C11.2285 6.71981 12 5.45 12 4C12 1.79086 10.2091 0 7.99999 0C5.79085 0 3.99999 1.79086 3.99999 4C3.99999 5.44999 4.77151 6.71979 5.92643 7.42127C5.53077 7.59487 5.14917 7.82506 4.78591 8.11714C3.82444 8.89022 3.02097 10.0727 2.40878 11.7142C2.13348 12.4524 1.9954 13.366 2.00012 13.8886C2.00199 14.0958 2.02356 14.3201 2.06601 14.5291C2.10669 14.7294 2.17429 14.9553 2.28992 15.1391C2.48839 15.4547 2.9051 16 3.67438 16H11.5C11.7761 16 12 15.7761 12 15.5C12 15.2239 11.7761 15 11.5 15H3.67438C3.45208 15 3.2957 14.86 3.1364 14.6067C3.11382 14.5708 3.0765 14.4802 3.046 14.3301C3.01727 14.1886 3.00142 14.0283 3.00008 13.8796C2.99648 13.481 3.11259 12.6888 3.34574 12.0637C3.91472 10.538 4.62949 9.52608 5.41253 8.89647C6.18897 8.27216 7.0615 8 7.99999 8C9.12931 8 10.173 8.39391 11.0695 9.34328C11.2591 9.54405 11.5755 9.55313 11.7763 9.36354C11.9771 9.17395 11.9861 8.8575 11.7966 8.65672C11.268 8.097 10.6886 7.69116 10.0735 7.42128ZM13.1464 9.14645C13.3417 8.95118 13.6583 8.95118 13.8535 9.14645L15.8535 11.1464C16.0488 11.3417 16.0488 11.6583 15.8535 11.8536L13.8535 13.8536C13.6583 14.0488 13.3417 14.0488 13.1464 13.8536C12.9512 13.6583 12.9512 13.3417 13.1464 13.1464L14.2929 12H10.5C10.2238 12 9.99999 11.7761 9.99999 11.5C9.99999 11.2239 10.2238 11 10.5 11H14.2929L13.1464 9.85355C12.9512 9.65829 12.9512 9.34171 13.1464 9.14645Z",fill:"currentColor"})]});import{jsx as G3,jsxs as Fo}from"react/jsx-runtime";var Eo=C=>Fo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[G3("title",{children:"Refresh"}),G3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 2C3.68629 2 1 4.68629 1 8C1 11.3137 3.68629 14 7 14C7.27614 14 7.5 14.2239 7.5 14.5C7.5 14.7761 7.27614 15 7 15C3.13401 15 0 11.866 0 8C0 4.13401 3.13401 1 7 1C10.866 1 14 4.13401 14 8V9.32843L15.1411 8.1519C15.3333 7.95367 15.6499 7.94883 15.8481 8.14108C16.0463 8.33333 16.0512 8.64988 15.8589 8.8481L13.8589 10.9103C13.7648 11.0073 13.6353 11.0621 13.5 11.0621C13.3647 11.0621 13.2352 11.0073 13.1411 10.9103L11.1411 8.8481C10.9488 8.64988 10.9537 8.33333 11.1519 8.14108C11.3501 7.94883 11.6667 7.95367 11.8589 8.1519L13 9.32843V8C13 4.68629 10.3137 2 7 2Z",fill:"currentColor"})]});import{jsx as P3,jsxs as Do}from"react/jsx-runtime";var Ao=C=>Do("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[P3("title",{children:"RefreshAlt"}),P3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1C0 0.723858 0.223858 0.5 0.5 0.5H5.3477C5.62384 0.5 5.8477 0.723858 5.8477 1V5.44082C5.8477 5.71696 5.62384 5.94082 5.3477 5.94082C5.07155 5.94082 4.8477 5.71696 4.8477 5.44082V2.02325L3.32338 3.54756C2.22748 4.69887 1.55556 6.2554 1.55556 7.96993C1.55556 11.513 4.4278 14.3853 7.97089 14.3853C8.24703 14.3853 8.47089 14.6091 8.47089 14.8853C8.47089 15.1614 8.24703 15.3853 7.97089 15.3853C3.87551 15.3853 0.555556 12.0653 0.555556 7.96993C0.555556 5.9862 1.33517 4.18349 2.6037 2.85323L2.6119 2.84463L3.95673 1.5H0.5C0.223858 1.5 0 1.27614 0 1ZM7.52916 1.00071C7.52916 0.72457 7.75302 0.500712 8.02916 0.500712C12.1245 0.500712 15.4445 3.82067 15.4445 7.91604C15.4445 9.89694 14.6671 11.6973 13.4018 13.027L13.3932 13.036L12.0382 14.3908H15.5C15.7761 14.3908 16 14.6147 16 14.8908C16 15.1669 15.7761 15.3908 15.5 15.3908H10.6524C10.3762 15.3908 10.1524 15.1669 10.1524 14.8908V10.2816C10.1524 10.0055 10.3762 9.78161 10.6524 9.78161C10.9285 9.78161 11.1524 10.0055 11.1524 10.2816V13.8625L12.6815 12.3333C13.7746 11.1825 14.4445 9.62803 14.4445 7.91604C14.4445 4.37295 11.5722 1.50071 8.02916 1.50071C7.75302 1.50071 7.52916 1.27685 7.52916 1.00071Z",fill:"currentColor"})]});import{jsx as x3,jsxs as _o}from"react/jsx-runtime";var To=C=>_o("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[x3("title",{children:"Remove"}),x3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 8C2.5 7.72386 2.72386 7.5 3 7.5H13C13.2761 7.5 13.5 7.72386 13.5 8C13.5 8.27614 13.2761 8.5 13 8.5H3C2.72386 8.5 2.5 8.27614 2.5 8Z",fill:"currentColor"})]});import{jsx as d4,jsxs as Oo}from"react/jsx-runtime";var Wo=C=>Oo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[d4("title",{children:"RemoveCircle"}),d4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 7.94995C4 7.67381 4.22386 7.44995 4.5 7.44995H11.5C11.7761 7.44995 12 7.67381 12 7.94995C12 8.22609 11.7761 8.44995 11.5 8.44995H4.5C4.22386 8.44995 4 8.22609 4 7.94995Z",fill:"currentColor"}),d4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"})]});import{jsx as h5,jsxs as Uo}from"react/jsx-runtime";var No=C=>Uo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[h5("title",{children:"RemoveGroup"}),h5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.0218 8C9.0218 7.72386 9.24566 7.5 9.5218 7.5H13.5218C13.7979 7.5 14.0218 7.72386 14.0218 8C14.0218 8.27614 13.7979 8.5 13.5218 8.5H9.5218C9.24566 8.5 9.0218 8.27614 9.0218 8Z",fill:"currentColor"}),h5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 4.5C9.567 4.5 8 6.067 8 8C8 9.933 9.567 11.5 11.5 11.5C13.433 11.5 15 9.933 15 8C15 6.067 13.433 4.5 11.5 4.5ZM7 8C7 5.51472 9.01472 3.5 11.5 3.5C13.9853 3.5 16 5.51472 16 8C16 10.4853 13.9853 12.5 11.5 12.5C9.01472 12.5 7 10.4853 7 8Z",fill:"currentColor"}),h5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.97752 4.35175C7.05939 4.61547 6.91198 4.89564 6.64825 4.97751C5.41725 5.35971 4.5 6.55916 4.5 8C4.5 9.44084 5.41725 10.6403 6.64825 11.0225C6.91198 11.1044 7.05939 11.3845 6.97752 11.6483C6.89564 11.912 6.61547 12.0594 6.35175 11.9775C4.69126 11.462 3.5 9.86717 3.5 8C3.5 6.13283 4.69126 4.53802 6.35175 4.02249C6.61547 3.94061 6.89564 4.08802 6.97752 4.35175Z",fill:"currentColor"}),h5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.47751 4.35175C3.55939 4.61547 3.41198 4.89564 3.14825 4.97751C1.91725 5.35971 1 6.55916 1 8C1 9.44084 1.91725 10.6403 3.14825 11.0225C3.41198 11.1044 3.55939 11.3845 3.47751 11.6483C3.39564 11.912 3.11547 12.0594 2.85175 11.9775C1.19126 11.462 0 9.86717 0 8C0 6.13283 1.19126 4.53802 2.85175 4.02249C3.11547 3.94061 3.39564 4.08802 3.47751 4.35175Z",fill:"currentColor"})]});import{jsx as b3,jsxs as Ko}from"react/jsx-runtime";var Jo=C=>Ko("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[b3("title",{children:"Repeat"}),b3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.56516 0.182212C6.3699 -0.0130496 6.05332 -0.0130482 5.85806 0.182215L3.64645 2.39385C3.45118 2.58911 3.45119 2.90569 3.64645 3.10095L5.85806 5.31256C6.05332 5.50783 6.3699 5.50783 6.56517 5.31256C6.76043 5.1173 6.76043 4.80072 6.56517 4.60546L5.20711 3.2474H9.16056C11.208 3.2474 13.75 4.82863 13.75 7.99995C13.75 8.68757 13.6286 9.29353 13.4227 9.82157C13.3224 10.0788 13.4496 10.3687 13.7069 10.4691C13.9642 10.5694 14.2541 10.4421 14.3544 10.1849C14.607 9.53709 14.75 8.80756 14.75 7.99995C14.75 4.16469 11.6415 2.2474 9.16056 2.2474H5.2071L6.56517 0.889318C6.76043 0.694055 6.76043 0.377473 6.56516 0.182212ZM2.27717 5.53801C2.01901 5.44001 1.73028 5.56985 1.63228 5.82802C1.38749 6.4729 1.25 7.19806 1.25 7.99994C1.25 11.8352 4.35833 13.7525 6.83932 13.7525H10.7929L9.43483 15.1106C9.23957 15.3058 9.23957 15.6224 9.43483 15.8177C9.6301 16.0129 9.94668 16.0129 10.1419 15.8177L12.3536 13.6061C12.5488 13.4108 12.5488 13.0942 12.3536 12.8989L10.1419 10.6873C9.94668 10.4921 9.6301 10.4921 9.43484 10.6873C9.23957 10.8826 9.23957 11.1992 9.43483 11.3944L10.7929 12.7525H6.83932C4.79194 12.7525 2.25 11.1713 2.25 7.99994C2.25 7.31403 2.36728 6.70956 2.56719 6.1829C2.66519 5.92473 2.53534 5.636 2.27717 5.53801Z",fill:"currentColor"})]});import{jsx as p4,jsxs as zo}from"react/jsx-runtime";var qo=C=>zo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[p4("title",{children:"Replace"}),p4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.1415 7.14646C12.3368 6.95119 12.6534 6.95118 12.8486 7.14644L15.8488 10.1464C15.9426 10.2402 15.9953 10.3674 15.9953 10.5C15.9953 10.6326 15.9426 10.7598 15.8488 10.8536L12.8486 13.8536C12.6534 14.0488 12.3368 14.0488 12.1415 13.8535C11.9463 13.6583 11.9463 13.3417 12.1416 13.1464L14.2881 11H4.5C4.22386 11 4 10.7761 4 10.5C4 10.2239 4.22386 10 4.5 10H14.2881L12.1416 7.85356C11.9463 7.65831 11.9463 7.34173 12.1415 7.14646Z",fill:"currentColor"}),p4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.85472 8.85354C3.65947 9.04881 3.34288 9.04882 3.14762 8.85356L0.147434 5.85356C0.0536594 5.75979 0.000976551 5.63261 0.000976563 5.5C0.000976574 5.36739 0.0536595 5.24021 0.147434 5.14644L3.14762 2.14644C3.34288 1.95118 3.65947 1.95119 3.85472 2.14646C4.04998 2.34173 4.04997 2.65831 3.8547 2.85356L1.70813 5L11.5 5C11.7761 5 12 5.22386 12 5.5C12 5.77614 11.7761 6 11.5 6H1.70813L3.8547 8.14644C4.04997 8.34169 4.04998 8.65827 3.85472 8.85354Z",fill:"currentColor"})]});import{jsx as s4,jsxs as Yo}from"react/jsx-runtime";var Xo=C=>Yo("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[s4("title",{children:"Search"}),s4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 6C12 9.31371 9.31371 12 6 12C2.68629 12 0 9.31371 0 6C0 2.68629 2.68629 0 6 0C9.31371 0 12 2.68629 12 6ZM6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z",fill:"currentColor"}),s4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.64645 9.64645C9.84171 9.45118 10.1583 9.45118 10.3536 9.64645L15.8536 15.1464C16.0488 15.3417 16.0488 15.6583 15.8536 15.8536C15.6583 16.0488 15.3417 16.0488 15.1464 15.8536L9.64645 10.3536C9.45118 10.1583 9.45118 9.84171 9.64645 9.64645Z",fill:"currentColor"})]});import{jsx as y3,jsxs as $o}from"react/jsx-runtime";var Qo=C=>$o("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[y3("title",{children:"Settings"}),y3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.51169 4.83779e-07H8.48822C8.63932 -7.20522e-06 8.7763 -1.41193e-05 8.8915 0.00767932C9.01531 0.0159486 9.14685 0.0345743 9.28086 0.0875607C9.56214 0.198772 9.79355 0.408199 9.9322 0.677014C9.99826 0.805092 10.0299 0.93412 10.0504 1.0565C10.0695 1.17036 10.0832 1.30666 10.0982 1.45702L10.0996 1.47133C10.1312 1.78754 10.1524 1.99515 10.1796 2.14624C10.2018 2.26956 10.221 2.3087 10.2231 2.31308C10.277 2.38163 10.3627 2.41715 10.4493 2.40678C10.4538 2.40514 10.4951 2.39108 10.598 2.31957C10.7241 2.23196 10.8858 2.10011 11.1318 1.89887L11.1429 1.88976C11.2599 1.79407 11.3659 1.70733 11.4599 1.64034C11.561 1.56833 11.6746 1.49946 11.8118 1.4556C12.0999 1.36356 12.4117 1.3791 12.6892 1.49936C12.8214 1.55666 12.9276 1.6365 13.021 1.7182C13.1079 1.7942 13.2047 1.89105 13.3116 1.99788L13.9919 2.6782L14.0021 2.68838C14.1089 2.79522 14.2058 2.89207 14.2818 2.97896C14.3635 3.07236 14.4433 3.17854 14.5006 3.31077C14.6209 3.5883 14.6364 3.90002 14.5444 4.18814C14.5005 4.32542 14.4316 4.43901 14.3596 4.54008C14.2927 4.6341 14.2059 4.74009 14.1102 4.85702L14.1011 4.8682C13.8999 5.11416 13.768 5.2759 13.6804 5.40197C13.6089 5.50488 13.5948 5.54617 13.5932 5.5507C13.5828 5.63728 13.6183 5.72303 13.6869 5.77693C13.6913 5.77898 13.7304 5.79824 13.8537 5.82043C14.0048 5.84762 14.2124 5.86875 14.5287 5.90037L14.543 5.9018C14.6933 5.91683 14.8296 5.93046 14.9435 5.94957C15.0659 5.97012 15.1949 6.00175 15.323 6.06781C15.5918 6.20646 15.8012 6.43786 15.9124 6.71912C15.9654 6.85314 15.9841 6.98468 15.9923 7.1085C16 7.22371 16 7.36069 16 7.5118V8.48829C16 8.63936 16 8.77631 15.9923 8.89148C15.9841 9.01527 15.9654 9.14677 15.9125 9.28076C15.8013 9.56211 15.5918 9.79359 15.3229 9.93225C15.1948 9.99828 15.0658 10.0299 14.9435 10.0504C14.8296 10.0695 14.6934 10.0832 14.5431 10.0982L14.5287 10.0996C14.2126 10.1312 14.0051 10.1524 13.854 10.1795C13.7307 10.2017 13.6916 10.221 13.6872 10.223C13.6186 10.2769 13.5831 10.3627 13.5935 10.4493C13.5951 10.4539 13.6092 10.4951 13.6807 10.598C13.7682 10.724 13.9 10.8857 14.1012 11.1316L14.1103 11.1427C14.206 11.2596 14.2927 11.3656 14.3597 11.4596C14.4316 11.5606 14.5005 11.6741 14.5444 11.8114C14.6365 12.0996 14.6209 12.4114 14.5006 12.6891C14.4433 12.8212 14.3635 12.9274 14.2818 13.0207C14.2058 13.1076 14.109 13.2044 14.0022 13.3112L13.3116 14.0017C13.2048 14.1086 13.1079 14.2055 13.021 14.2815C12.9277 14.3632 12.8215 14.443 12.6892 14.5003C12.4117 14.6206 12.1 14.6361 11.8119 14.5441C11.6746 14.5002 11.561 14.4313 11.4599 14.3593C11.3659 14.2924 11.2599 14.2056 11.143 14.11L11.1318 14.1008C10.8859 13.8996 10.7241 13.7677 10.5981 13.6801C10.4951 13.6086 10.4539 13.5945 10.4493 13.5929C10.3628 13.5825 10.277 13.618 10.2231 13.6866C10.2211 13.691 10.2018 13.7301 10.1796 13.8535C10.1524 14.0046 10.1313 14.2122 10.0996 14.5285L10.0982 14.5428C10.0832 14.6933 10.0695 14.8296 10.0504 14.9435C10.0299 15.0659 9.99823 15.195 9.93213 15.3231C9.7935 15.5918 9.56217 15.8012 9.281 15.9124C9.14695 15.9654 9.01537 15.984 8.89152 15.9923C8.77628 16 8.63926 16 8.4881 16H7.5118C7.36069 16 7.22371 16 7.1085 15.9923C6.98468 15.9841 6.85314 15.9654 6.71913 15.9124C6.43786 15.8012 6.20645 15.5918 6.06781 15.323C6.00175 15.1949 5.97012 15.0659 5.94957 14.9435C5.93046 14.8296 5.91683 14.6933 5.9018 14.543L5.90037 14.5287C5.86875 14.2124 5.84762 14.0048 5.82043 13.8537C5.79824 13.7304 5.77898 13.6913 5.77693 13.6869C5.72303 13.6183 5.63728 13.5828 5.55071 13.5932C5.54618 13.5948 5.50488 13.6089 5.40197 13.6804C5.2759 13.768 5.11415 13.8999 4.86818 14.1011L4.85701 14.1103C4.74007 14.2059 4.63407 14.2927 4.54004 14.3597C4.43897 14.4317 4.32537 14.5006 4.18808 14.5444C3.89998 14.6364 3.58828 14.6209 3.31076 14.5007C3.17852 14.4434 3.07233 14.3635 2.97893 14.2818C2.89204 14.2058 2.79519 14.1089 2.68836 14.0021L1.99788 13.3116C1.89104 13.2048 1.79418 13.1079 1.71816 13.021C1.63646 12.9276 1.55662 12.8215 1.49932 12.6892C1.37907 12.4117 1.36352 12.1 1.45556 11.8119C1.49942 11.6746 1.5683 11.561 1.6403 11.4599C1.7073 11.3659 1.79405 11.2599 1.88975 11.1429L1.89885 11.1318C2.10009 10.8858 2.23195 10.7241 2.31957 10.598C2.39107 10.4951 2.40513 10.4538 2.40678 10.4493C2.41714 10.3627 2.38162 10.277 2.31307 10.2231C2.30868 10.221 2.26953 10.2018 2.14624 10.1796C1.99514 10.1524 1.78754 10.1312 1.47132 10.0996L1.45696 10.0982C1.30663 10.0832 1.17034 10.0695 1.0565 10.0504C0.93412 10.0299 0.805093 9.99826 0.677016 9.9322C0.408198 9.79355 0.19877 9.56214 0.0875599 9.28086C0.034574 9.14684 0.0159484 9.01531 0.00767926 8.89149C-1.41193e-05 8.7763 -7.20531e-06 8.63932 4.83694e-07 8.48822V7.51187C-7.20531e-06 7.36073 -1.41789e-05 7.22371 0.00768331 7.10849C0.0159569 6.98464 0.0345924 6.85307 0.0876061 6.71903C0.198813 6.43784 0.408177 6.20649 0.676905 6.06786C0.80501 6.00177 0.934071 5.97013 1.05648 5.94958C1.17036 5.93046 1.30669 5.91683 1.45707 5.9018L1.47142 5.90037C1.78772 5.86873 1.99538 5.8476 2.14651 5.8204C2.26986 5.7982 2.309 5.77893 2.31338 5.77688C2.38191 5.72299 2.41741 5.63727 2.40707 5.55071C2.40542 5.54616 2.39136 5.50485 2.31983 5.40193C2.23219 5.27582 2.10029 5.11403 1.89898 4.86798L1.88985 4.85683C1.79413 4.73984 1.70735 4.63379 1.64033 4.53972C1.5683 4.43861 1.4994 4.32496 1.45554 4.18763C1.36358 3.89961 1.37912 3.58803 1.49929 3.3106C1.55659 3.17831 1.63645 3.07208 1.71818 2.97865C1.79423 2.89172 1.89113 2.79482 1.99802 2.68794L2.68836 1.9976C2.79521 1.89074 2.89206 1.79388 2.97896 1.71786C3.07237 1.63615 3.17855 1.55631 3.31079 1.49901C3.58831 1.37877 3.90001 1.36322 4.18812 1.45525C4.32541 1.49911 4.43902 1.568 4.54009 1.64001C4.63414 1.70701 4.74018 1.79378 4.85715 1.8895L4.86827 1.89859C5.1142 2.09981 5.27593 2.23166 5.40198 2.31927C5.50486 2.39077 5.54615 2.40484 5.5507 2.40649C5.6373 2.41687 5.72309 2.38133 5.77699 2.31275C5.77903 2.30837 5.79828 2.26924 5.82047 2.14596C5.84765 1.9949 5.86877 1.78736 5.90038 1.47123L5.90182 1.45691C5.91684 1.3066 5.93046 1.17034 5.94957 1.05652C5.97011 0.934174 6.00172 0.80518 6.06774 0.677131C6.2064 0.408219 6.43789 0.198726 6.71926 0.0875124C6.85325 0.0345551 6.98474 0.0159397 7.10853 0.00767509C7.22369 -1.41193e-05 7.36063 -7.20522e-06 7.51169 4.83779e-07ZM7.09027 1.01641L7.08685 1.0175C7.03057 1.03975 6.98427 1.08165 6.95654 1.13543L6.95511 1.13872C6.95423 1.14098 6.95277 1.14499 6.9509 1.15136C6.94697 1.16469 6.94176 1.1864 6.93577 1.22209C6.92286 1.29898 6.91234 1.40154 6.89542 1.57073L6.89343 1.5907C6.86436 1.88139 6.83965 2.12858 6.80466 2.32305C6.76973 2.51717 6.71331 2.73409 6.57438 2.91627C6.30196 3.27348 5.85881 3.45704 5.4136 3.39708C5.18653 3.3665 4.99324 3.25299 4.83126 3.14041C4.669 3.02764 4.47671 2.8703 4.25058 2.68527L4.23503 2.67255C4.10337 2.56483 4.02337 2.49971 3.95983 2.45444C3.93035 2.43343 3.9113 2.42176 3.89909 2.41511C3.89325 2.41193 3.88939 2.41012 3.88717 2.40915L3.88383 2.40783C3.8262 2.38943 3.76386 2.39253 3.70836 2.41658L3.70516 2.41823C3.70305 2.41941 3.69938 2.4216 3.6939 2.42534C3.68241 2.43318 3.66462 2.44668 3.63738 2.47051C3.57868 2.52187 3.50556 2.59461 3.38529 2.71488L2.7153 3.38487C2.59499 3.50518 2.52222 3.57832 2.47086 3.63704C2.44701 3.6643 2.43351 3.68209 2.42567 3.69358C2.42192 3.69907 2.41974 3.70274 2.41856 3.70485L2.41691 3.70805C2.39288 3.76354 2.38977 3.82585 2.40816 3.88346L2.40948 3.8868C2.41045 3.88902 2.41226 3.89289 2.41544 3.89872C2.42209 3.91094 2.43377 3.92999 2.45478 3.95948C2.50005 4.02303 2.56519 4.10305 2.67294 4.23475L2.68567 4.25031C2.87078 4.47654 3.02818 4.66891 3.141 4.83125C3.25363 4.99331 3.36717 5.18672 3.3977 5.41391C3.45749 5.85888 3.27405 6.30173 2.91713 6.5741C2.7349 6.71316 2.51787 6.76963 2.32364 6.80459C2.12908 6.8396 1.88175 6.86433 1.5909 6.8934L1.57092 6.8954C1.40164 6.91233 1.29902 6.92285 1.22209 6.93577C1.18638 6.94177 1.16466 6.94698 1.15132 6.95091C1.14495 6.95279 1.14094 6.95425 1.13868 6.95513L1.13538 6.95656C1.08164 6.98429 1.03976 7.03056 1.01752 7.0868L1.01643 7.09022C1.01577 7.09255 1.01472 7.09669 1.01348 7.10322C1.0109 7.11688 1.00787 7.13902 1.00546 7.17514C1.00026 7.25298 1 7.35614 1 7.52626V8.47383C1 8.64391 1.00026 8.74704 1.00546 8.82486C1.00787 8.86097 1.0109 8.8831 1.01348 8.89676C1.01471 8.90329 1.01576 8.90742 1.01642 8.90975L1.01751 8.91318C1.03975 8.96943 1.08164 9.01572 1.1354 9.04345L1.1387 9.04488C1.14096 9.04576 1.14497 9.04722 1.15134 9.0491C1.16468 9.05302 1.18639 9.05824 1.22209 9.06423C1.299 9.07715 1.40159 9.08767 1.57083 9.10459L1.59085 9.10659C1.8816 9.13566 2.12884 9.16038 2.32335 9.19538C2.51752 9.23032 2.7345 9.28677 2.91671 9.42577C3.27377 9.69815 3.45726 10.1412 3.39739 10.5862C3.36684 10.8134 3.25333 11.0067 3.14073 11.1687C3.02794 11.331 2.87057 11.5233 2.68552 11.7495L2.67281 11.765C2.5651 11.8967 2.49999 11.9767 2.45474 12.0402C2.43373 12.0697 2.42207 12.0887 2.41541 12.1009C2.41223 12.1068 2.41043 12.1106 2.40946 12.1128L2.40814 12.1162C2.38973 12.1738 2.39284 12.2361 2.41689 12.2917L2.41854 12.2948C2.41972 12.297 2.4219 12.3006 2.42565 12.3061C2.43348 12.3176 2.44699 12.3354 2.47082 12.3626C2.52217 12.4213 2.59491 12.4944 2.71518 12.6147L3.38526 13.2848C3.50553 13.4051 3.57864 13.4778 3.63734 13.5292C3.66459 13.553 3.68238 13.5665 3.69386 13.5743C3.69935 13.5781 3.70302 13.5803 3.70513 13.5814L3.70833 13.5831C3.76383 13.6071 3.82617 13.6102 3.88379 13.5918L3.88714 13.5905C3.88936 13.5896 3.89322 13.5877 3.89905 13.5846C3.91126 13.5779 3.93031 13.5662 3.95979 13.5452C4.02331 13.5 4.1033 13.4349 4.23494 13.3272L4.25052 13.3144C4.47668 13.1294 4.66899 12.972 4.83128 12.8592C4.9933 12.7466 5.18665 12.6331 5.41378 12.6026C5.85885 12.5427 6.30183 12.7262 6.57421 13.0832C6.71322 13.2654 6.76967 13.4824 6.80462 13.6766C6.83962 13.8711 6.86434 14.1184 6.89341 14.4092L6.89541 14.4292C6.91233 14.5984 6.92285 14.701 6.93577 14.7779C6.94176 14.8136 6.94698 14.8353 6.95091 14.8487C6.95278 14.855 6.95424 14.859 6.95512 14.8613L6.95655 14.8646C6.98428 14.9184 7.03057 14.9602 7.08682 14.9825L7.09024 14.9836C7.09257 14.9842 7.09671 14.9853 7.10324 14.9865C7.1169 14.9891 7.13903 14.9921 7.17514 14.9945C7.25296 14.9997 7.3561 15 7.52618 15H8.47372C8.64386 15 8.74702 14.9997 8.82486 14.9945C8.86099 14.9921 8.88312 14.9891 8.89678 14.9865C8.90331 14.9853 8.90745 14.9842 8.90978 14.9836L8.91321 14.9825C8.96944 14.9602 9.01571 14.9184 9.04343 14.8646L9.04486 14.8613C9.04575 14.8591 9.04721 14.8551 9.04908 14.8487C9.05301 14.8353 9.05823 14.8136 9.06423 14.7779C9.07715 14.7009 9.08768 14.5983 9.10461 14.429L9.10661 14.409C9.13568 14.1182 9.1604 13.8709 9.19541 13.6764C9.23035 13.4822 9.28679 13.2652 9.42579 13.083C9.69818 12.7259 10.1412 12.5424 10.5863 12.6023C10.8134 12.6328 11.0067 12.7463 11.1688 12.8589C11.331 12.9717 11.5234 13.1291 11.7495 13.3141L11.7651 13.3268C11.8967 13.4345 11.9767 13.4996 12.0402 13.5449C12.0697 13.5659 12.0887 13.5776 12.1009 13.5842C12.1067 13.5874 12.1106 13.5892 12.1128 13.5902L12.1162 13.5915C12.1738 13.6099 12.2361 13.6068 12.2917 13.5827L12.2949 13.5811C12.297 13.5799 12.3006 13.5777 12.3061 13.574C12.3176 13.5662 12.3354 13.5526 12.3626 13.5288C12.4213 13.4775 12.4944 13.4047 12.6147 13.2845L13.2849 12.6143C13.4051 12.4941 13.4778 12.421 13.5292 12.3623C13.553 12.3351 13.5665 12.3173 13.5743 12.3058C13.5781 12.3003 13.5802 12.2967 13.5814 12.2945L13.5831 12.2913C13.6071 12.2358 13.6102 12.1735 13.5918 12.1158L13.5905 12.1125C13.5895 12.1102 13.5877 12.1064 13.5846 12.1005C13.5779 12.0883 13.5662 12.0693 13.5452 12.0398C13.5 11.9763 13.4349 11.8964 13.3273 11.7648L13.3145 11.7492C13.1295 11.5232 12.9723 11.3309 12.8595 11.1687C12.7469 11.0068 12.6335 10.8135 12.6029 10.5865C12.5429 10.1412 12.7265 9.69802 13.0837 9.42559C13.2659 9.28668 13.4828 9.23027 13.6769 9.19534C13.8714 9.16035 14.1186 9.13564 14.4092 9.10658L14.4292 9.10458C14.5984 9.08766 14.701 9.07715 14.7779 9.06424C14.8136 9.05824 14.8353 9.05303 14.8486 9.0491C14.855 9.04723 14.859 9.04577 14.8613 9.04489L14.8646 9.04346C14.9184 9.01573 14.9603 8.96943 14.9825 8.91316L14.9836 8.90974C14.9842 8.90741 14.9853 8.90327 14.9865 8.89674C14.9891 8.88309 14.9921 8.86096 14.9945 8.82485C14.9997 8.74706 15 8.64395 15 8.47391V7.52618C15 7.3561 14.9997 7.25296 14.9945 7.17514C14.9921 7.13903 14.9891 7.1169 14.9865 7.10324C14.9853 7.09671 14.9842 7.09257 14.9836 7.09024L14.9825 7.08682C14.9602 7.03056 14.9184 6.98428 14.8646 6.95656L14.8613 6.95512C14.8591 6.95424 14.855 6.95278 14.8487 6.95091C14.8353 6.94698 14.8136 6.94176 14.7779 6.93577C14.701 6.92285 14.5984 6.91233 14.4292 6.89541L14.4091 6.89341C14.1184 6.86434 13.8711 6.83962 13.6766 6.80462C13.4824 6.76967 13.2654 6.71323 13.0832 6.57422C12.7262 6.30184 12.5427 5.85885 12.6026 5.41376C12.6331 5.18664 12.7466 4.99329 12.8592 4.83128C12.972 4.66899 13.1294 4.47668 13.3144 4.25054L13.3271 4.23496C13.4348 4.10332 13.5 4.02334 13.5452 3.95982C13.5662 3.93034 13.5779 3.9113 13.5845 3.89909C13.5877 3.89326 13.5895 3.88939 13.5905 3.88717L13.5918 3.88383C13.6102 3.82621 13.6071 3.76386 13.5831 3.70836L13.5814 3.70516C13.5802 3.70305 13.578 3.69938 13.5743 3.69389C13.5665 3.68241 13.553 3.66462 13.5291 3.63738C13.4778 3.57868 13.405 3.50557 13.2848 3.3853L12.6147 2.7152C12.4944 2.59494 12.4213 2.5222 12.3626 2.47085C12.3354 2.44702 12.3176 2.43352 12.3061 2.42568C12.3006 2.42194 12.2969 2.41975 12.2948 2.41857L12.2916 2.41693C12.2361 2.39287 12.1738 2.38976 12.1161 2.40817L12.1128 2.40949C12.1106 2.41046 12.1067 2.41227 12.1009 2.41545C12.0887 2.4221 12.0696 2.43377 12.0402 2.45477C11.9766 2.50002 11.8967 2.56513 11.765 2.67283L11.7495 2.68556C11.5233 2.8706 11.331 3.02795 11.1687 3.14074C11.0067 3.25333 10.8134 3.36684 10.5863 3.3974C10.1412 3.45727 9.69815 3.27377 9.42576 2.9167C9.28677 2.7345 9.23032 2.51753 9.19538 2.32335C9.16038 2.12885 9.13566 1.8816 9.10659 1.59085L9.10459 1.57083C9.08767 1.4016 9.07715 1.299 9.06423 1.22209C9.05824 1.18639 9.05302 1.16468 9.0491 1.15134C9.04722 1.14497 9.04577 1.14096 9.04488 1.1387L9.04345 1.1354C9.01572 1.08164 8.96944 1.03975 8.91318 1.01751L8.90976 1.01642C8.90743 1.01576 8.90329 1.01471 8.89676 1.01348C8.8831 1.0109 8.86097 1.00787 8.82486 1.00546C8.74704 1.00026 8.64391 1 8.47383 1H7.52607C7.35604 1 7.25294 1.00026 7.17515 1.00545C7.13904 1.00786 7.11692 1.01089 7.10326 1.01347C7.09673 1.0147 7.0926 1.01575 7.09027 1.01641ZM8 5.5C6.61929 5.5 5.5 6.61929 5.5 8C5.5 9.38071 6.61929 10.5 8 10.5C9.38071 10.5 10.5 9.38071 10.5 8C10.5 6.61929 9.38071 5.5 8 5.5ZM4.5 8C4.5 6.067 6.067 4.5 8 4.5C9.933 4.5 11.5 6.067 11.5 8C11.5 9.933 9.933 11.5 8 11.5C6.067 11.5 4.5 9.933 4.5 8Z",fill:"currentColor"})]});import{jsx as I3,jsxs as Cl}from"react/jsx-runtime";var jo=C=>Cl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[I3("title",{children:"ShareAndroid"}),I3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 1C12.6716 1 12 1.67157 12 2.5C12 3.32843 12.6716 4 13.5 4C14.3284 4 15 3.32843 15 2.5C15 1.67157 14.3284 1 13.5 1ZM11 2.5C11 1.11929 12.1193 0 13.5 0C14.8807 0 16 1.11929 16 2.5C16 3.88071 14.8807 5 13.5 5C12.706 5 11.9985 4.62986 11.5405 4.05271L4.99171 7.79489C4.9972 7.86253 5 7.93094 5 8C5 8.06905 4.9972 8.13745 4.99171 8.20509L11.5405 11.9473C11.9985 11.3701 12.706 11 13.5 11C14.8807 11 16 12.1193 16 13.5C16 14.8807 14.8807 16 13.5 16C12.1193 16 11 14.8807 11 13.5C11 13.2717 11.0306 13.0505 11.0879 12.8404L4.69929 9.18975C4.27626 9.9701 3.45001 10.5 2.5 10.5C1.11929 10.5 0 9.38071 0 8C0 6.61929 1.11929 5.5 2.5 5.5C3.45 5.5 4.27625 6.02989 4.69929 6.81024L11.0879 3.15958C11.0306 2.94946 11 2.7283 11 2.5ZM2.5 6.5C1.67157 6.5 1 7.17157 1 8C1 8.82843 1.67157 9.5 2.5 9.5C3.32843 9.5 4 8.82843 4 8C4 7.17157 3.32843 6.5 2.5 6.5ZM13.5 12C12.6716 12 12 12.6716 12 13.5C12 14.3284 12.6716 15 13.5 15C14.3284 15 15 14.3284 15 13.5C15 12.6716 14.3284 12 13.5 12Z",fill:"currentColor"})]});import{jsx as c4,jsxs as ol}from"react/jsx-runtime";var el=C=>ol("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[c4("title",{children:"ShareIOS"}),c4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5.5C2 5.22386 2.22386 5 2.5 5H5.5C5.77614 5 6 5.22386 6 5.5C6 5.77614 5.77614 6 5.5 6H3V15H13V6H10.5C10.2239 6 10 5.77614 10 5.5C10 5.22386 10.2239 5 10.5 5H13.5C13.7761 5 14 5.22386 14 5.5V15.5C14 15.7761 13.7761 16 13.5 16H2.5C2.22386 16 2 15.7761 2 15.5V5.5Z",fill:"currentColor"}),c4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0C8.14839 0 8.28911 0.0659115 8.38411 0.179908L10.8841 3.17991C11.0609 3.39205 11.0322 3.70733 10.8201 3.88411C10.608 4.06089 10.2927 4.03223 10.1159 3.82009L8.5 1.88102V10.5C8.5 10.7761 8.27614 11 8 11C7.72386 11 7.5 10.7761 7.5 10.5V1.88102L5.88411 3.82009C5.70733 4.03223 5.39205 4.06089 5.17991 3.88411C4.96777 3.70733 4.93911 3.39205 5.11589 3.17991L7.61589 0.179908C7.71089 0.0659115 7.85161 0 8 0Z",fill:"currentColor"})]});import{jsx as B3,jsxs as tl}from"react/jsx-runtime";var ll=C=>tl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[B3("title",{children:"ShowEyeOn"}),B3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.90902 10.059C1.93653 9.2342 1.3199 8.37297 1.06308 7.9773C1.54959 7.09182 3.5666 4 8 4C12.4334 4 14.4504 7.09181 14.9369 7.9773C14.6801 8.37297 14.0635 9.2342 13.091 10.059C11.9051 11.0647 10.2107 12 8 12C5.78926 12 4.09491 11.0647 2.90902 10.059ZM8 3C2.5082 3 0.303383 7.23328 0.0591548 7.7392C-0.0261072 7.91582 -0.0198272 8.12214 0.0820649 8.29497C0.230837 8.54731 0.954663 9.71345 2.26081 10.8212C3.57041 11.9318 5.48612 13 8 13C10.5139 13 12.4296 11.9318 13.7392 10.8212C15.0453 9.71344 15.7692 8.54731 15.9179 8.29497C16.0198 8.12213 16.0261 7.91581 15.9408 7.7392C15.6966 7.23328 13.4918 3 8 3ZM6.49772 8C6.49772 7.17157 7.17022 6.5 7.99978 6.5C8.82935 6.5 9.50185 7.17157 9.50185 8C9.50185 8.82843 8.82935 9.5 7.99978 9.5C7.17022 9.5 6.49772 8.82843 6.49772 8ZM7.99978 5.5C6.61717 5.5 5.49634 6.61929 5.49634 8C5.49634 9.38071 6.61717 10.5 7.99978 10.5C9.3824 10.5 10.5032 9.38071 10.5032 8C10.5032 6.61929 9.3824 5.5 7.99978 5.5Z",fill:"currentColor"})]});import{jsx as a5,jsxs as il}from"react/jsx-runtime";var rl=C=>il("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[a5("title",{children:"Slider"}),a5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 8C-6.87913e-09 7.84262 0.0740971 7.69443 0.2 7.6L2.2 6.1C2.42091 5.93432 2.73431 5.97909 2.9 6.2C3.06569 6.42091 3.02091 6.73432 2.8 6.9L2 7.5H3.99608C4.27222 7.5 4.49608 7.72386 4.49608 8C4.49608 8.27614 4.27222 8.5 3.99608 8.5H2L2.8 9.1C3.02091 9.26569 3.06569 9.57909 2.9 9.8C2.73431 10.0209 2.42091 10.0657 2.2 9.9L0.2 8.4C0.0740971 8.30557 6.87935e-09 8.15738 0 8Z",fill:"currentColor"}),a5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9961 8C15.9961 8.15738 15.922 8.30557 15.7961 8.4L13.7961 9.9C13.5752 10.0657 13.2618 10.0209 13.0961 9.8C12.9304 9.57909 12.9752 9.26568 13.1961 9.1L13.9961 8.5L12 8.5C11.7239 8.5 11.5 8.27614 11.5 8C11.5 7.72386 11.7239 7.5 12 7.5H13.9961L13.1961 6.9C12.9752 6.73432 12.9304 6.42091 13.0961 6.2C13.2618 5.97909 13.5752 5.93432 13.7961 6.1L15.7961 7.6C15.922 7.69443 15.9961 7.84262 15.9961 8Z",fill:"currentColor"}),a5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 8C12 10.2091 10.2091 12 8 12C5.79086 12 4 10.2091 4 8C4 5.79086 5.79086 4 8 4C10.2091 4 12 5.79086 12 8ZM8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z",fill:"currentColor"}),a5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 8C7 7.44772 7.44772 7 8 7C8.55228 7 9 7.44772 9 8C9 8.55228 8.55228 9 8 9C7.44772 9 7 8.55228 7 8Z",fill:"currentColor"})]});import{jsx as k3,jsxs as dl}from"react/jsx-runtime";var nl=C=>dl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[k3("title",{children:"SortAscending"}),k3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.50001 15C3.77615 15 4.00001 14.7761 4.00001 14.5V3.35163L6.12038 5.8254C6.30009 6.03506 6.61574 6.05934 6.8254 5.87963C7.03507 5.69992 7.05935 5.38427 6.87964 5.1746L3.87964 1.6746C3.78465 1.56378 3.64597 1.5 3.50001 1.5C3.35405 1.5 3.21537 1.56378 3.12038 1.6746L0.120381 5.1746C-0.0593303 5.38427 -0.0350495 5.69992 0.174613 5.87963C0.384276 6.05934 0.699926 6.03506 0.879637 5.8254L3.00001 3.35163V14.5C3.00001 14.7761 3.22387 15 3.50001 15ZM9.00001 12.5C9.00001 12.7761 9.22387 13 9.50001 13H15.5C15.7762 13 16 12.7761 16 12.5C16 12.2239 15.7762 12 15.5 12H9.50001C9.22387 12 9.00001 12.2239 9.00001 12.5ZM9.00001 7.5C9.00001 7.77614 9.22387 8 9.50001 8H13.5C13.7762 8 14 7.77614 14 7.5C14 7.22386 13.7762 7 13.5 7H9.50001C9.22387 7 9.00001 7.22386 9.00001 7.5ZM9.00001 2.5C9.00001 2.77614 9.22387 3 9.50001 3H11.5C11.7762 3 12 2.77614 12 2.5C12 2.22386 11.7762 2 11.5 2H9.50001C9.22387 2 9.00001 2.22386 9.00001 2.5Z",fill:"currentColor"})]});import{jsx as E3,jsxs as sl}from"react/jsx-runtime";var pl=C=>sl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[E3("title",{children:"SortDescending"}),E3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.50001 1.5C3.77615 1.5 4.00001 1.72386 4.00001 2V13.1484L6.12038 10.6746C6.30009 10.4649 6.61574 10.4407 6.8254 10.6204C7.03507 10.8001 7.05935 11.1157 6.87964 11.3254L3.87964 14.8254C3.78465 14.9362 3.64597 15 3.50001 15C3.35405 15 3.21537 14.9362 3.12038 14.8254L0.120381 11.3254C-0.0593303 11.1157 -0.0350495 10.8001 0.174613 10.6204C0.384276 10.4407 0.699926 10.4649 0.879637 10.6746L3.00001 13.1484V2C3.00001 1.72386 3.22387 1.5 3.50001 1.5ZM9.00001 4C9.00001 3.72386 9.22387 3.5 9.50001 3.5H15.5C15.7762 3.5 16 3.72386 16 4C16 4.27614 15.7762 4.5 15.5 4.5H9.50001C9.22387 4.5 9.00001 4.27614 9.00001 4ZM9.00001 9C9.00001 8.72386 9.22387 8.5 9.50001 8.5H13.5C13.7762 8.5 14 8.72386 14 9C14 9.27614 13.7762 9.5 13.5 9.5H9.50001C9.22387 9.5 9.00001 9.27614 9.00001 9ZM9.00001 14C9.00001 13.7239 9.22387 13.5 9.50001 13.5H11.5C11.7762 13.5 12 13.7239 12 14C12 14.2761 11.7762 14.5 11.5 14.5H9.50001C9.22387 14.5 9.00001 14.2761 9.00001 14Z",fill:"currentColor"})]});import{jsx as $5,jsxs as fl}from"react/jsx-runtime";var cl=C=>fl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[$5("title",{children:"SportsAtoZ"}),$5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.50013 7C9.50013 6.72386 9.72399 6.5 10.0001 6.5H15.5001C15.6833 6.5 15.8518 6.60016 15.9393 6.76106C16.0269 6.92196 16.0194 7.11784 15.9199 7.27163L10.9192 15H15.5001C15.7763 15 16.0001 15.2239 16.0001 15.5C16.0001 15.7761 15.7763 16 15.5001 16H10.0001C9.81696 16 9.64845 15.8998 9.56092 15.7389C9.47339 15.578 9.48084 15.3822 9.58035 15.2284L14.5811 7.5H10.0001C9.72399 7.5 9.50013 7.27614 9.50013 7Z",fill:"currentColor"}),$5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.00013 0C4.20274 0 4.38533 0.122274 4.46247 0.309625L7.96247 8.80962C8.06761 9.06497 7.94585 9.3572 7.69051 9.46234C7.43516 9.56748 7.14293 9.44572 7.03779 9.19038L4.00013 1.8132L0.96247 9.19038C0.857329 9.44572 0.565099 9.56748 0.309756 9.46234C0.0544135 9.3572 -0.0673489 9.06497 0.0377922 8.80962L3.53779 0.309625C3.61494 0.122274 3.79752 0 4.00013 0Z",fill:"currentColor"}),$5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.50013 6C1.50013 5.72386 1.72399 5.5 2.00013 5.5H6.00013C6.27627 5.5 6.50013 5.72386 6.50013 6C6.50013 6.27614 6.27627 6.5 6.00013 6.5H2.00013C1.72399 6.5 1.50013 6.27614 1.50013 6Z",fill:"currentColor"})]});import{jsx as F3,jsxs as al}from"react/jsx-runtime";var hl=C=>al("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[F3("title",{children:"Star"}),F3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00617 -0.00144958C8.22278 -0.00144958 8.41476 0.138031 8.4817 0.344042L10.167 5.53094H15.5039C15.7194 5.53094 15.9107 5.66902 15.9785 5.87358C16.0464 6.07813 15.9755 6.30313 15.8027 6.43189L11.5169 9.62497L13.6961 15.3207C13.7758 15.5289 13.7079 15.7647 13.5298 15.8988C13.3516 16.0329 13.1063 16.0328 12.9282 15.8987L8.00616 12.1894L3.08506 15.8977C2.907 16.0319 2.66162 16.032 2.48348 15.8979C2.30534 15.7638 2.2375 15.528 2.31715 15.3198L4.49535 9.62516L0.205397 6.43203C0.0324871 6.30333 -0.0384804 6.0783 0.0293103 5.87369C0.0971009 5.66908 0.288389 5.53094 0.503939 5.53094H5.84531L7.53064 0.344042C7.59758 0.138031 7.78955 -0.00144958 8.00617 -0.00144958ZM8.00617 2.11658L6.68411 6.18545C6.61718 6.39146 6.4252 6.53094 6.20859 6.53094H2.01309L5.39616 9.04905C5.5758 9.18276 5.64463 9.41961 5.56462 9.62877L3.87272 14.0521L7.70526 11.164C7.88341 11.0298 8.12894 11.0298 8.30709 11.164L12.1403 14.0527L10.4477 9.62881C10.3677 9.41972 10.4365 9.18294 10.616 9.04919L13.996 6.53094H9.80375C9.58714 6.53094 9.39516 6.39146 9.32822 6.18545L8.00617 2.11658Z",fill:"currentColor"})]});import{jsx as f4,jsxs as gl}from"react/jsx-runtime";var Ll=C=>gl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[f4("title",{children:"StarFilled"}),f4("path",{d:"M8.00617 0.49855L9.80375 6.03094H15.5039L10.9147 9.45014L13.2291 15.4993L8.00617 11.5633L2.78415 15.4984L5.09762 9.45014L0.503939 6.03094H6.20859L8.00617 0.49855Z",fill:"currentColor"}),f4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00617 -0.00144958C8.22278 -0.00144958 8.41476 0.138031 8.4817 0.344042L10.167 5.53094H15.5039C15.7194 5.53094 15.9107 5.66902 15.9785 5.87358C16.0464 6.07813 15.9755 6.30313 15.8027 6.43189L11.5169 9.62497L13.6961 15.3207C13.7758 15.5289 13.7079 15.7647 13.5298 15.8988C13.3516 16.0329 13.1063 16.0328 12.9282 15.8987L8.00616 12.1894L3.08506 15.8977C2.907 16.0319 2.66162 16.032 2.48348 15.8979C2.30534 15.7638 2.2375 15.528 2.31715 15.3198L4.49535 9.62516L0.205397 6.43203C0.0324871 6.30333 -0.0384804 6.0783 0.0293103 5.87369C0.0971009 5.66908 0.288389 5.53094 0.503939 5.53094H5.84531L7.53064 0.344042C7.59758 0.138031 7.78955 -0.00144958 8.00617 -0.00144958ZM8.00617 2.11658L6.68411 6.18545C6.61718 6.39146 6.4252 6.53094 6.20859 6.53094H2.01309L5.39616 9.04905C5.5758 9.18276 5.64463 9.41961 5.56462 9.62877L3.87272 14.0521L7.70526 11.164C7.88341 11.0298 8.12894 11.0298 8.30709 11.164L12.1403 14.0527L10.4477 9.62881C10.3677 9.41972 10.4365 9.18294 10.616 9.04919L13.996 6.53094H9.80375C9.58714 6.53094 9.39516 6.39146 9.32822 6.18545L8.00617 2.11658Z",fill:"currentColor"})]});import{jsx as j5,jsxs as Vl}from"react/jsx-runtime";var ul=C=>Vl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[j5("title",{children:"Stats"}),j5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.00078 11.0025L1.00705 14.9994H3.5L3.5 11.0024L1.00078 11.0025ZM0.499994 10.0025L3.99999 10.0024C4.1326 10.0024 4.25978 10.0551 4.35355 10.1489C4.44732 10.2427 4.5 10.3698 4.5 10.5024L4.5 15.4994C4.5 15.632 4.44732 15.7592 4.35355 15.8529C4.25978 15.9467 4.13261 15.9994 4 15.9994H0.507828C0.231992 15.9994 0.00826113 15.776 0.007829 15.5002L6.14651e-07 10.5033C-0.000207376 10.3705 0.0523783 10.2431 0.146168 10.1492C0.239957 10.0553 0.367251 10.0025 0.499994 10.0025Z",fill:"currentColor"}),j5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5005 8.00079L12.5073 14.9994H15L15 8.00074L12.5005 8.00079ZM12 7.0008L15.5 7.00073C15.6326 7.00073 15.7598 7.05341 15.8535 7.14718C15.9473 7.24094 16 7.36812 16 7.50073L16 15.4994C16 15.632 15.9473 15.7592 15.8536 15.8529C15.7598 15.9467 15.6326 15.9994 15.5 15.9994H12.0078C11.7319 15.9994 11.5081 15.7758 11.5078 15.4999L11.5 7.50129C11.4999 7.3686 11.5525 7.2413 11.6463 7.14743C11.74 7.05355 11.8673 7.00081 12 7.0008Z",fill:"currentColor"}),j5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.7467 1.00012L6.75401 15H9.24644L9.24644 1.00002L6.7467 1.00012ZM6.24642 0.000134617L9.74642 3.73802e-10C9.87903 -5.12563e-06 10.0062 0.0526711 10.1 0.14644C10.1938 0.240209 10.2464 0.367388 10.2464 0.5L10.2464 15.5C10.2464 15.6326 10.1938 15.7598 10.1 15.8536C10.0062 15.9473 9.87905 16 9.74644 16H6.25427C5.97823 16 5.75441 15.7763 5.75427 15.5003L5.74644 0.500396C5.74637 0.367745 5.79901 0.240504 5.89279 0.14668C5.98656 0.0528562 6.11377 0.000139743 6.24642 0.000134617Z",fill:"currentColor"})]});import{jsx as A3,jsxs as ml}from"react/jsx-runtime";var vl=C=>ml("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[A3("title",{children:"Tick"}),A3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.831 3.12376C14.0388 3.30562 14.0598 3.62151 13.8779 3.8293L6.87962 11.8254C6.78855 11.9295 6.65847 11.9911 6.52028 11.9958C6.38209 12.0005 6.24813 11.9477 6.15024 11.8501L3.14688 8.85399C2.95138 8.65896 2.95099 8.34238 3.14602 8.14688C3.34104 7.95138 3.65763 7.951 3.85312 8.14603L6.47863 10.7652L13.1254 3.17071C13.3073 2.96291 13.6232 2.94189 13.831 3.12376Z",fill:"currentColor"})]});import{jsx as h4,jsxs as Hl}from"react/jsx-runtime";var wl=C=>Hl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[h4("title",{children:"TickCircle"}),h4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),h4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.8108 5.05832C12.0271 5.22999 12.0633 5.5445 11.8916 5.76079L7.92312 10.7608C7.83478 10.8721 7.70325 10.9406 7.5614 10.9491C7.41955 10.9576 7.28079 10.9053 7.17978 10.8053L4.1483 7.80535C3.95202 7.61111 3.95037 7.29453 4.14461 7.09825C4.33885 6.90197 4.65542 6.90032 4.8517 7.09456L7.48667 9.70215L11.1084 5.13911C11.28 4.92282 11.5945 4.88664 11.8108 5.05832Z",fill:"currentColor"})]});import{jsx as D3,jsxs as Rl}from"react/jsx-runtime";var Ml=C=>Rl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[D3("title",{children:"TickLock"}),D3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.49988 3.5C4.49988 1.567 6.06688 0 7.99988 0C9.93287 0 11.4999 1.567 11.4999 3.5V6H13.0002C13.5525 6 14.0002 6.44772 14.0002 7V15C14.0002 15.5523 13.5525 16 13.0002 16H2.99951C2.44723 16 1.99951 15.5523 1.99951 15V7C1.99951 6.44772 2.44723 6 2.99951 6H4.49988V3.5ZM2.99951 7V15H13.0002V7H2.99951ZM10.4999 6H5.49988V3.5C5.49988 2.11929 6.61917 1 7.99988 1C9.38059 1 10.4999 2.11929 10.4999 3.5V6ZM10.8534 9.14645C11.0487 9.34171 11.0487 9.65829 10.8534 9.85355L7.85343 12.8536C7.65817 13.0488 7.3416 13.0488 7.14634 12.8536L5.14634 10.8537C4.95107 10.6584 4.95106 10.3418 5.14631 10.1466C5.34157 9.95131 5.65815 9.9513 5.85342 10.1466L7.49987 11.7929L10.1463 9.14645C10.3416 8.95118 10.6582 8.95118 10.8534 9.14645Z",fill:"currentColor"})]});import{jsx as a4,jsxs as Sl}from"react/jsx-runtime";var Zl=C=>Sl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[a4("title",{children:"TickShield"}),a4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.8108 5.10837C12.0271 5.28004 12.0633 5.59455 11.8916 5.81084L7.92312 10.8108C7.83478 10.9221 7.70325 10.9906 7.5614 10.9991C7.41955 11.0076 7.28079 10.9553 7.17978 10.8554L4.1483 7.85539C3.95202 7.66115 3.95037 7.34458 4.14461 7.1483C4.33885 6.95202 4.65542 6.95037 4.8517 7.14461L7.48666 9.7522L11.1084 5.18916C11.28 4.97286 11.5945 4.93669 11.8108 5.10837Z",fill:"currentColor"}),a4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.57711 15.9062L8 15L8.42289 15.9062C8.15484 16.0313 7.84516 16.0313 7.57711 15.9062ZM2 3.1V8C2 12.2 8 15 8 15C7.57711 15.9062 7.57711 15.9062 7.57711 15.9062L7.57397 15.9047L7.56865 15.9022L7.55156 15.8941C7.53735 15.8873 7.51758 15.8778 7.4926 15.8655C7.44266 15.8411 7.37186 15.8057 7.28317 15.7599C7.10592 15.6683 6.85641 15.5344 6.55863 15.3607C5.9653 15.0145 5.16904 14.5042 4.36747 13.8495C2.81788 12.584 1 10.5757 1 8V3.1C1 2.67506 1.26856 2.29652 1.66965 2.15614L7.66965 0.0561416C7.88352 -0.0187139 8.11648 -0.0187139 8.33035 0.0561416L14.3304 2.15614C14.7314 2.29652 15 2.67506 15 3.1V8C15 10.5757 13.1821 12.584 11.6325 13.8495C10.831 14.5042 10.0347 15.0145 9.44137 15.3607C9.14359 15.5344 8.89408 15.6683 8.71683 15.7599C8.62814 15.8057 8.55734 15.8411 8.5074 15.8655C8.48242 15.8778 8.46265 15.8873 8.44844 15.8941L8.43135 15.9022L8.42603 15.9047L8.42418 15.9056C8.42418 15.9056 8.42289 15.9062 8 15C8 15 14 12.2 14 8V3.1L8 1L2 3.1Z",fill:"currentColor"})]});import{jsx as C2,jsxs as Pl}from"react/jsx-runtime";var Gl=C=>Pl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[C2("title",{children:"Unpublish"}),C2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3535 12.1416C11.5488 12.3368 11.5488 12.6534 11.3536 12.8487L8.35357 15.8489C8.2598 15.9426 8.13262 15.9953 8 15.9953C7.86739 15.9953 7.74021 15.9426 7.64644 15.8489L4.64644 12.8487C4.45118 12.6534 4.45119 12.3368 4.64646 12.1416C4.84173 11.9463 5.15831 11.9463 5.35357 12.1416L7.5 14.2882L7.5 4.5C7.5 4.22386 7.72386 4 8 4C8.27614 4 8.5 4.22386 8.5 4.5V14.2882L10.6464 12.1416C10.8417 11.9463 11.1583 11.9463 11.3535 12.1416Z",fill:"currentColor"}),C2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 1.9874L0 1.9873L6.25e-06 0.987305L16 0.987405L16 1.9874Z",fill:"currentColor"}),C2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 1V10H2.5C2.77615 10 3 10.2239 3 10.5C3 10.7761 2.77615 11 2.5 11H0.750003C0.33579 11 3.125e-06 10.6642 3.125e-06 10.25V0.75C3.125e-06 0.335786 0.33579 0 0.750003 0H15.25C15.6642 0 16 0.335787 16 0.75V10.25C16 10.6642 15.6642 11 15.25 11H13.5C13.2239 11 13 10.7761 13 10.5C13 10.2239 13.2239 10 13.5 10H15V1H1Z",fill:"currentColor"})]});import{jsx as L4,jsxs as bl}from"react/jsx-runtime";var xl=C=>bl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[L4("title",{children:"User"}),L4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 1C6.34313 1 4.99999 2.34315 4.99999 4C4.99999 5.65685 6.34313 7 7.99999 7C9.65684 7 11 5.65685 11 4C11 2.34315 9.65684 1 7.99999 1ZM3.99999 4C3.99999 1.79086 5.79085 0 7.99999 0C10.2091 0 12 1.79086 12 4C12 6.20914 10.2091 8 7.99999 8C5.79085 8 3.99999 6.20914 3.99999 4Z",fill:"currentColor"}),L4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.41252 8.89646C4.62948 9.52608 3.91472 10.538 3.34574 12.0637C3.11259 12.6888 2.99648 13.481 3.00008 13.8796C3.00142 14.0283 3.01727 14.1886 3.046 14.3301C3.0765 14.4802 3.11382 14.5708 3.1364 14.6067C3.2957 14.86 3.45208 15 3.67438 15H12.3256C12.5539 15 12.7244 14.851 12.878 14.6067C12.897 14.5765 12.9316 14.4916 12.9593 14.3398C12.9852 14.198 12.9985 14.0349 12.9999 13.8796C13.0035 13.481 12.8874 12.6888 12.6542 12.0637C12.0852 10.538 11.3705 9.52608 10.5874 8.89646C9.81099 8.27216 8.93848 8 7.99999 8C7.0615 8 6.18896 8.27216 5.41252 8.89646ZM4.7859 8.11714C5.75396 7.33876 6.85222 7 7.99999 7C9.14775 7 10.246 7.33876 11.214 8.11714C12.1755 8.89022 12.979 10.0727 13.5912 11.7142C13.8665 12.4524 14.0046 13.366 13.9999 13.8886C13.9981 14.0892 13.9812 14.3106 13.9431 14.5193C13.9068 14.718 13.8437 14.9496 13.7245 15.1391C13.5204 15.4637 13.0888 16 12.3256 16H3.67438C2.9051 16 2.48839 15.4547 2.28992 15.1391C2.17429 14.9553 2.10669 14.7294 2.06601 14.5291C2.02356 14.3201 2.00199 14.0958 2.00012 13.8886C1.9954 13.366 2.13348 12.4524 2.40878 11.7142C3.02097 10.0727 3.82444 8.89022 4.7859 8.11714Z",fill:"currentColor"})]});import{jsx as T3,jsxs as Il}from"react/jsx-runtime";var yl=C=>Il("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[T3("title",{children:"UserCross"}),T3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 1C6.34313 1 4.99999 2.34315 4.99999 4C4.99999 5.65685 6.34313 7 7.99999 7C9.65684 7 11 5.65685 11 4C11 2.34315 9.65684 1 7.99999 1ZM10.0735 7.42127C11.2285 6.7198 12 5.45 12 4C12 1.79086 10.2091 0 7.99999 0C5.79085 0 3.99999 1.79086 3.99999 4C3.99999 5.44999 4.77151 6.71979 5.92643 7.42127C5.53077 7.59487 5.14917 7.82506 4.78591 8.11714C3.82444 8.89022 3.02097 10.0727 2.40878 11.7142C2.13348 12.4524 1.9954 13.366 2.00012 13.8886C2.00199 14.0958 2.02356 14.3201 2.06601 14.5291C2.10669 14.7294 2.17429 14.9553 2.28992 15.1391C2.48839 15.4547 2.9051 16 3.67438 16H8.5C8.77614 16 9 15.7761 9 15.5C9 15.2239 8.77614 15 8.5 15H3.67438C3.45208 15 3.2957 14.86 3.1364 14.6067C3.11382 14.5708 3.0765 14.4802 3.046 14.3301C3.01727 14.1886 3.00142 14.0283 3.00008 13.8796C2.99648 13.481 3.11259 12.6888 3.34574 12.0637C3.91472 10.538 4.62949 9.52608 5.41253 8.89647C6.18897 8.27216 7.0615 8 7.99999 8C8.79962 8 9.54822 8.1977 10.2288 8.63715C10.4607 8.78695 10.7702 8.72033 10.92 8.48835C11.0698 8.25637 11.0032 7.94688 10.7712 7.79708C10.5442 7.65047 10.3113 7.52561 10.0735 7.42127ZM10.1464 10.1464C10.3417 9.95118 10.6583 9.95118 10.8535 10.1464L13 12.2929L15.1464 10.1464C15.3417 9.95118 15.6583 9.95118 15.8535 10.1464C16.0488 10.3417 16.0488 10.6583 15.8535 10.8536L13.7071 13L15.8535 15.1464C16.0488 15.3417 16.0488 15.6583 15.8535 15.8536C15.6583 16.0488 15.3417 16.0488 15.1464 15.8536L13 13.7071L10.8535 15.8536C10.6583 16.0488 10.3417 16.0488 10.1464 15.8536C9.95117 15.6583 9.95117 15.3417 10.1464 15.1464L12.2929 13L10.1464 10.8536C9.95117 10.6583 9.95117 10.3417 10.1464 10.1464Z",fill:"currentColor"})]});import{jsx as _3,jsxs as kl}from"react/jsx-runtime";var Bl=C=>kl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[_3("title",{children:"UserPlus"}),_3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 1C6.34313 1 4.99999 2.34315 4.99999 4C4.99999 5.65685 6.34313 7 7.99999 7C9.65684 7 11 5.65685 11 4C11 2.34315 9.65684 1 7.99999 1ZM10.0735 7.42127C11.2285 6.71979 12 5.45 12 4C12 1.79086 10.2091 0 7.99999 0C5.79085 0 3.99999 1.79086 3.99999 4C3.99999 5.44999 4.77151 6.71979 5.92643 7.42127C5.53077 7.59487 5.14917 7.82506 4.78591 8.11714C3.82444 8.89022 3.02097 10.0727 2.40878 11.7142C2.13348 12.4524 1.9954 13.366 2.00012 13.8886C2.00199 14.0958 2.02356 14.3201 2.06601 14.5291C2.10669 14.7294 2.17429 14.9553 2.28992 15.1391C2.48839 15.4547 2.9051 16 3.67438 16H10.5C10.7761 16 11 15.7761 11 15.5C11 15.2239 10.7761 15 10.5 15H3.67438C3.45208 15 3.2957 14.86 3.1364 14.6067C3.11382 14.5708 3.0765 14.4802 3.046 14.3301C3.01727 14.1886 3.00142 14.0283 3.00008 13.8796C2.99648 13.481 3.11259 12.6888 3.34574 12.0637C3.91472 10.538 4.62949 9.52608 5.41253 8.89647C6.18897 8.27216 7.0615 8 7.99999 8C8.97347 8 9.87724 8.29279 10.6768 8.97023C10.8875 9.14874 11.203 9.12265 11.3815 8.91197C11.56 8.70128 11.5339 8.38578 11.3232 8.20727C10.9276 7.8721 10.5092 7.61242 10.0735 7.42127ZM12.5001 9C12.7762 9 13.0001 9.22386 13.0001 9.5V12H15.5001C15.7762 12 16.0001 12.2239 16.0001 12.5C16.0001 12.7761 15.7762 13 15.5001 13H13.0001V15.5C13.0001 15.7761 12.7762 16 12.5001 16C12.2239 16 12.0001 15.7761 12.0001 15.5V13H9.50007C9.22392 13 9.00007 12.7761 9.00007 12.5C9.00007 12.2239 9.22392 12 9.50007 12H12.0001V9.5C12.0001 9.22386 12.2239 9 12.5001 9Z",fill:"currentColor"})]});import{jsx as W3,jsxs as Fl}from"react/jsx-runtime";var El=C=>Fl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[W3("title",{children:"UserTick"}),W3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1C6.34314 1 5 2.34315 5 4C5 5.65685 6.34314 7 8 7C9.65685 7 11 5.65685 11 4C11 2.34315 9.65685 1 8 1ZM10.0735 7.42127C11.2285 6.71979 12 5.45 12 4C12 1.79086 10.2091 0 8 0C5.79086 0 4 1.79086 4 4C4 5.44999 4.77152 6.71979 5.92644 7.42126C5.53078 7.59487 5.14918 7.82505 4.78591 8.11714C3.82444 8.89022 3.02097 10.0727 2.40878 11.7142C2.13348 12.4524 1.9954 13.366 2.00012 13.8886C2.00199 14.0958 2.02356 14.3201 2.06601 14.5291C2.10669 14.7294 2.17429 14.9553 2.28992 15.1391C2.48839 15.4547 2.9051 16 3.67438 16H8.5C8.77614 16 9 15.7761 9 15.5C9 15.2239 8.77614 15 8.5 15H3.67438C3.45208 15 3.2957 14.86 3.1364 14.6067C3.11382 14.5708 3.0765 14.4802 3.046 14.3301C3.01727 14.1886 3.00142 14.0283 3.00008 13.8796C2.99648 13.481 3.11259 12.6888 3.34574 12.0637C3.91472 10.538 4.62949 9.52608 5.41253 8.89647C6.18898 8.27216 7.06151 8 8 8C8.84664 8 9.63721 8.22158 10.3509 8.71915C11.0684 9.21931 11.7356 10.0177 12.2978 11.2128C12.4153 11.4627 12.7132 11.57 12.9631 11.4524C13.2129 11.3349 13.3202 11.037 13.2027 10.7872C12.5844 9.4729 11.8157 8.52131 10.9228 7.89882C10.6483 7.70744 10.3646 7.549 10.0735 7.42127ZM15.8002 11.1C16.0212 11.2657 16.0659 11.5791 15.9002 11.8L12.9 15.8C12.813 15.916 12.68 15.9885 12.5354 15.9987C12.3908 16.009 12.2489 15.956 12.1464 15.8535L10.1467 13.8535C9.95141 13.6583 9.95143 13.3417 10.1467 13.1464C10.342 12.9512 10.6586 12.9512 10.8538 13.1465L12.4459 14.7388L15.1002 11.2C15.2659 10.9791 15.5793 10.9343 15.8002 11.1Z",fill:"currentColor"})]});import{jsx as O3,jsxs as Dl}from"react/jsx-runtime";var Al=C=>Dl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[O3("title",{children:"WiFiDisabled"}),O3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.18338 2.11302C2.39711 1.93816 2.71212 1.96966 2.88698 2.18338L11.887 13.1834C12.0618 13.3971 12.0303 13.7121 11.8166 13.887C11.6029 14.0618 11.2879 14.0303 11.113 13.8166L8.79562 10.9842C8.76042 10.9854 8.72455 10.9829 8.68848 10.9763C8.46555 10.9356 8.23549 10.9142 8 10.9142C7.10176 10.9142 6.27749 11.225 5.62687 11.7453C5.41121 11.9178 5.09657 11.8828 4.9241 11.6671C4.75163 11.4515 4.78665 11.1368 5.00231 10.9643C5.80461 10.3227 6.81804 9.93274 7.92068 9.91486L5.9874 7.55197C4.916 7.87751 3.93872 8.44798 3.11823 9.17076C2.91102 9.35329 2.59507 9.33329 2.41254 9.12608C2.23 8.91887 2.25001 8.60292 2.45722 8.42038C3.2773 7.69796 4.24351 7.10572 5.30946 6.72337L3.65678 4.70343C2.63864 5.18328 1.70124 5.83265 0.837805 6.62387C0.634214 6.81044 0.317933 6.79663 0.13137 6.59304C-0.0551924 6.38945 -0.0413889 6.07317 0.162201 5.88661C1.02841 5.09285 1.97411 4.42254 3.00582 3.90781L2.11302 2.81662C1.93816 2.6029 1.96966 2.28788 2.18338 2.11302ZM8 3.75C7.43202 3.75 6.88496 3.79281 6.35788 3.87508C6.08504 3.91767 5.82934 3.73101 5.78676 3.45817C5.74417 3.18533 5.93083 2.92963 6.20367 2.88704C6.78291 2.79664 7.38155 2.75 8 2.75C11.1277 2.75 13.7157 3.93684 15.8378 5.88144C16.0414 6.068 16.0552 6.38428 15.8686 6.58787C15.6821 6.79147 15.3658 6.80527 15.1622 6.61871C13.201 4.8215 10.8473 3.75 8 3.75ZM8.62589 6.75989C8.6681 6.48699 8.92355 6.29999 9.19645 6.3422C10.8583 6.59927 12.3546 7.37359 13.5429 8.42038C13.7501 8.60292 13.7701 8.91887 13.5876 9.12608C13.4051 9.33329 13.0891 9.35329 12.8819 9.17076C11.8193 8.23472 10.495 7.55498 9.04358 7.33045C8.77068 7.28824 8.58367 7.03279 8.62589 6.75989ZM7.50008 14C7.50008 13.7239 7.72394 13.5 8.00008 13.5H8.00726C8.2834 13.5 8.50726 13.7239 8.50726 14C8.50726 14.2762 8.2834 14.5 8.00726 14.5H8.00008C7.72394 14.5 7.50008 14.2762 7.50008 14Z",fill:"currentColor"})]});import{jsx as N3,jsxs as _l}from"react/jsx-runtime";var Tl=C=>_l("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[N3("title",{children:"WiFiEnabled"}),N3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 3.75C5.15328 3.75 2.79953 4.82622 0.837805 6.62387C0.634214 6.81044 0.317933 6.79663 0.13137 6.59304C-0.0551924 6.38945 -0.0413889 6.07317 0.162201 5.88661C2.28379 3.94246 4.87173 2.75 8 2.75C11.1277 2.75 13.7157 3.93684 15.8378 5.88144C16.0414 6.068 16.0552 6.38428 15.8686 6.58787C15.6821 6.79146 15.3658 6.80527 15.1622 6.61871C13.201 4.8215 10.8473 3.75 8 3.75ZM8.00007 7.25C6.14156 7.25 4.43112 8.01422 3.11823 9.17076C2.91102 9.35329 2.59507 9.33329 2.41254 9.12608C2.23 8.91887 2.25001 8.60292 2.45722 8.42038C3.92422 7.12809 5.8627 6.25 8.00007 6.25C10.1374 6.25 12.0759 7.12809 13.5429 8.42038C13.7501 8.60292 13.7701 8.91887 13.5876 9.12608C13.4051 9.33329 13.0891 9.35329 12.8819 9.17076C11.569 8.01422 9.85858 7.25 8.00007 7.25ZM8 10.9142C7.10176 10.9142 6.27749 11.225 5.62687 11.7453C5.41121 11.9178 5.09657 11.8828 4.9241 11.6671C4.75163 11.4515 4.78665 11.1368 5.00231 10.9643C5.82381 10.3074 6.86668 9.91422 8 9.91422C9.1164 9.91422 10.1451 10.2957 10.9608 10.9352C11.1782 11.1055 11.2162 11.4198 11.0459 11.6371C10.8755 11.8545 10.5612 11.8925 10.3439 11.7222C9.69793 11.2158 8.88489 10.9142 8 10.9142ZM7.50008 14C7.50008 13.7239 7.72394 13.5 8.00008 13.5H8.00726C8.2834 13.5 8.50726 13.7239 8.50726 14C8.50726 14.2762 8.2834 14.5 8.00726 14.5H8.00008C7.72394 14.5 7.50008 14.2762 7.50008 14Z",fill:"currentColor"})]});import{jsx as L5,jsxs as Ol}from"react/jsx-runtime";var Wl=C=>Ol("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[L5("title",{children:"Grid"}),L5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 0C0.671573 0 0 0.671573 0 1.5V6C0 6.82843 0.671573 7.5 1.5 7.5H6C6.82843 7.5 7.5 6.82843 7.5 6V1.5C7.5 0.671573 6.82843 0 6 0H1.5ZM1 1.5C1 1.22386 1.22386 1 1.5 1H6C6.27614 1 6.5 1.22386 6.5 1.5V6C6.5 6.27614 6.27614 6.5 6 6.5H1.5C1.22386 6.5 1 6.27614 1 6V1.5Z",fill:"currentColor"}),L5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 8.5C0.671573 8.5 0 9.17157 0 10V14.5C0 15.3284 0.671573 16 1.5 16H6C6.82843 16 7.5 15.3284 7.5 14.5V10C7.5 9.17157 6.82843 8.5 6 8.5H1.5ZM1 10C1 9.72386 1.22386 9.5 1.5 9.5H6C6.27614 9.5 6.5 9.72386 6.5 10V14.5C6.5 14.7761 6.27614 15 6 15H1.5C1.22386 15 1 14.7761 1 14.5V10Z",fill:"currentColor"}),L5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 10C8.5 9.17157 9.17157 8.5 10 8.5H14.5C15.3284 8.5 16 9.17157 16 10V14.5C16 15.3284 15.3284 16 14.5 16H10C9.17157 16 8.5 15.3284 8.5 14.5V10ZM10 9.5C9.72386 9.5 9.5 9.72386 9.5 10V14.5C9.5 14.7761 9.72386 15 10 15H14.5C14.7761 15 15 14.7761 15 14.5V10C15 9.72386 14.7761 9.5 14.5 9.5H10Z",fill:"currentColor"}),L5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 0C9.17157 0 8.5 0.671573 8.5 1.5V6C8.5 6.82843 9.17157 7.5 10 7.5H14.5C15.3284 7.5 16 6.82843 16 6V1.5C16 0.671573 15.3284 0 14.5 0H10ZM9.5 1.5C9.5 1.22386 9.72386 1 10 1H14.5C14.7761 1 15 1.22386 15 1.5V6C15 6.27614 14.7761 6.5 14.5 6.5H10C9.72386 6.5 9.5 6.27614 9.5 6V1.5Z",fill:"currentColor"})]});import{jsx as e2,jsxs as Ul}from"react/jsx-runtime";var Nl=C=>Ul("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[e2("title",{children:"List"}),e2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 7.5C0 6.67157 0.671573 6 1.5 6H14.5C15.3284 6 16 6.67157 16 7.5V8.5C16 9.32843 15.3284 10 14.5 10H1.5C0.671573 10 0 9.32843 0 8.5V7.5ZM1.5 7C1.22386 7 1 7.22386 1 7.5V8.5C1 8.77614 1.22386 9 1.5 9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H1.5Z",fill:"currentColor"}),e2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.5C0 0.671573 0.671573 0 1.5 0H14.5C15.3284 0 16 0.671573 16 1.5V2.5C16 3.32843 15.3284 4 14.5 4H1.5C0.671573 4 0 3.32843 0 2.5V1.5ZM1.5 1C1.22386 1 1 1.22386 1 1.5V2.5C1 2.77614 1.22386 3 1.5 3H14.5C14.7761 3 15 2.77614 15 2.5V1.5C15 1.22386 14.7761 1 14.5 1H1.5Z",fill:"currentColor"}),e2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 13.5C0 12.6716 0.671573 12 1.5 12H14.5C15.3284 12 16 12.6716 16 13.5V14.5C16 15.3284 15.3284 16 14.5 16H1.5C0.671573 16 0 15.3284 0 14.5V13.5ZM1.5 13C1.22386 13 1 13.2239 1 13.5V14.5C1 14.7761 1.22386 15 1.5 15H14.5C14.7761 15 15 14.7761 15 14.5V13.5C15 13.2239 14.7761 13 14.5 13H1.5Z",fill:"currentColor"})]});import{jsx as o2,jsxs as Kl}from"react/jsx-runtime";var Jl=C=>Kl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[o2("title",{children:"Swipeable"}),o2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.5C0 0.671573 0.671573 0 1.5 0H14.5C15.3284 0 16 0.671573 16 1.5V6C16 6.82843 15.3284 7.5 14.5 7.5H1.5C0.671573 7.5 0 6.82843 0 6V1.5ZM1.5 1C1.22386 1 1 1.22386 1 1.5V6C1 6.27614 1.22386 6.5 1.5 6.5H14.5C14.7761 6.5 15 6.27614 15 6V1.5C15 1.22386 14.7761 1 14.5 1H1.5Z",fill:"currentColor"}),o2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 10C0 9.17157 0.671573 8.5 1.5 8.5H6C6.82843 8.5 7.5 9.17157 7.5 10V14.5003C7.5 15.3287 6.82843 16.0003 6 16.0003H1.5C0.671573 16.0003 0 15.3287 0 14.5003V10ZM1.5 9.5C1.22386 9.5 1 9.72386 1 10V14.5003C1 14.7764 1.22386 15.0003 1.5 15.0003H6C6.27614 15.0003 6.5 14.7764 6.5 14.5003V10C6.5 9.72386 6.27614 9.5 6 9.5H1.5Z",fill:"currentColor"}),o2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 8.5C9.17157 8.5 8.5 9.17157 8.5 10V14.5003C8.5 15.3287 9.17157 16.0003 10 16.0003H14.5C15.3284 16.0003 16 15.3287 16 14.5003V10C16 9.17157 15.3284 8.5 14.5 8.5H10ZM9.5 10C9.5 9.72386 9.72386 9.5 10 9.5H14.5C14.7761 9.5 15 9.72386 15 10V14.5003C15 14.7764 14.7761 15.0003 14.5 15.0003H10C9.72386 15.0003 9.5 14.7764 9.5 14.5003V10Z",fill:"currentColor"})]});import{jsx as U3,jsxs as zl}from"react/jsx-runtime";var ql=C=>zl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[U3("title",{children:"Backward"}),U3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.14645 4.35353C2.95118 4.15826 2.95118 3.84168 3.14645 3.64642L6.32843 0.46444C6.52369 0.269178 6.84027 0.269178 7.03553 0.46444C7.2308 0.659702 7.2308 0.976284 7.03553 1.17155L4.70711 3.49997H8C11.3137 3.49997 14 6.18626 14 9.49997C14 12.8137 11.3137 15.5 8 15.5C4.68629 15.5 2 12.8137 2 9.49997C2 9.22383 2.22386 8.99997 2.5 8.99997C2.77614 8.99997 3 9.22383 3 9.49997C3 12.2614 5.23858 14.5 8 14.5C10.7614 14.5 13 12.2614 13 9.49997C13 6.73855 10.7614 4.49997 8 4.49997H4.70711L7.03553 6.8284C7.2308 7.02366 7.2308 7.34025 7.03553 7.53551C6.84027 7.73077 6.52369 7.73077 6.32843 7.53551L3.14645 4.35353Z",fill:"currentColor"})]});import{jsx as I1,jsxs as Yl}from"react/jsx-runtime";var Xl=C=>Yl("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[I1("title",{children:"Backward15"}),I1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.05852 3.0427L1.7034 4.39789H3.86448C4.14062 4.39789 4.36448 4.62174 4.36448 4.89789C4.36448 5.17403 4.14062 5.39789 3.86448 5.39789H0.5C0.223858 5.39789 0 5.17403 0 4.89789V1.53322C0 1.25708 0.223858 1.03322 0.5 1.03322C0.776142 1.03322 1 1.25708 1 1.53322V3.68708L2.35193 2.33508C3.79834 0.892964 5.7959 0 8.00041 0C12.4185 0 16 3.58175 16 8C16 12.4183 12.4185 16 8.00041 16C3.58233 16 0.000820428 12.4183 0.000820428 8C0.000820428 7.72386 0.224678 7.5 0.50082 7.5C0.776963 7.5 1.00082 7.72386 1.00082 8C1.00082 11.866 4.13467 15 8.00041 15C11.8662 15 15 11.866 15 8C15 4.13398 11.8662 1 8.00041 1C6.07139 1 4.32511 1.78003 3.05852 3.0427Z",fill:"currentColor"}),I1("path",{d:"M9.7453 11.0992C9.42335 11.0992 9.13341 11.0329 8.87548 10.9003C8.61756 10.7677 8.41085 10.5858 8.25536 10.3546C8.09987 10.1235 8.01481 9.8601 8.00018 9.56454H8.65871C8.68432 9.8279 8.79957 10.0458 9.00445 10.2182C9.21115 10.3887 9.4581 10.474 9.7453 10.474C9.97579 10.474 10.1807 10.4181 10.3599 10.3063C10.541 10.1945 10.6828 10.041 10.7852 9.84589C10.8895 9.64885 10.9416 9.42622 10.9416 9.17802C10.9416 8.92414 10.8877 8.69773 10.7798 8.49879C10.6737 8.29795 10.5273 8.13974 10.3407 8.02417C10.1541 7.9086 9.94103 7.84986 9.7014 7.84797C9.52945 7.84607 9.35292 7.87354 9.17182 7.93038C8.99073 7.98533 8.84164 8.05638 8.72457 8.14353L8.08798 8.06396L8.42823 5.19922H11.3477V5.82446H8.99896L8.8014 7.54103H8.83432C8.94957 7.4463 9.09408 7.36767 9.26786 7.30514C9.44164 7.24262 9.62274 7.21136 9.81115 7.21136C10.1551 7.21136 10.4615 7.29662 10.7304 7.46714C11.0011 7.63576 11.2133 7.86691 11.3669 8.16059C11.5224 8.45426 11.6002 8.78962 11.6002 9.16666C11.6002 9.53801 11.5197 9.86958 11.3587 10.1614C11.1996 10.4512 10.9801 10.6805 10.7002 10.8491C10.4203 11.0159 10.102 11.0992 9.7453 11.0992Z",fill:"currentColor"}),I1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.8553 9.42666C7.89305 9.38699 7.94542 9.36454 8.00018 9.36454H8.65871C8.76167 9.36454 8.84781 9.4427 8.85778 9.54518C8.87823 9.7555 8.96753 9.92545 9.13247 10.0645C9.30052 10.2029 9.50133 10.274 9.7453 10.274C9.9419 10.274 10.1095 10.2268 10.2541 10.1366C10.4036 10.0443 10.5218 9.91754 10.6082 9.75294C10.6955 9.58786 10.7416 9.39737 10.7416 9.17802C10.7416 8.95333 10.6941 8.7604 10.604 8.59416L10.6029 8.59221C10.5128 8.42167 10.3907 8.29037 10.2354 8.19419C10.0828 8.09969 9.90626 8.04959 9.69982 8.04796C9.55098 8.04632 9.3948 8.07002 9.23172 8.12121L9.22989 8.12178C9.06467 8.17191 8.93798 8.23399 8.844 8.30396C8.80262 8.33476 8.75094 8.34839 8.69976 8.34199L8.06317 8.26241C7.95405 8.24877 7.87641 8.14958 7.88938 8.04037L8.22962 5.17563C8.24157 5.07501 8.32689 4.99922 8.42823 4.99922H11.3477C11.4582 4.99922 11.5477 5.08876 11.5477 5.19922V5.82446C11.5477 5.93492 11.4582 6.02446 11.3477 6.02446H9.17726L9.04425 7.18018C9.09417 7.15742 9.14618 7.13637 9.20015 7.11695C9.39609 7.04646 9.60013 7.01136 9.81115 7.01136C10.1895 7.01136 10.5335 7.10563 10.8368 7.29781C11.1385 7.48592 11.3746 7.74391 11.5439 8.06743C11.7165 8.39352 11.8002 8.76161 11.8002 9.16666C11.8002 9.56778 11.713 9.93319 11.5339 10.2578C11.358 10.5781 11.1138 10.8334 10.8034 11.0204C10.4897 11.2073 10.1345 11.2992 9.7453 11.2992C9.39509 11.2992 9.07324 11.2269 8.78402 11.0781C8.49736 10.9307 8.26453 10.7266 8.08941 10.4662C7.91233 10.203 7.81674 9.90399 7.80042 9.57443C7.79771 9.51973 7.81755 9.46632 7.8553 9.42666ZM11.3587 10.1614C11.5197 9.86958 11.6002 9.53801 11.6002 9.16666C11.6002 8.78962 11.5224 8.45426 11.3669 8.16059C11.2133 7.86691 11.0011 7.63576 10.7304 7.46714C10.4615 7.29662 10.1551 7.21136 9.81115 7.21136C9.62274 7.21136 9.44164 7.24262 9.26786 7.30514C9.17604 7.33818 9.09239 7.37571 9.01691 7.41774C8.94954 7.45526 8.88867 7.49635 8.83432 7.54103H8.8014L8.99896 5.82446H11.3477V5.19922H8.42823L8.08798 8.06396L8.72457 8.14353C8.84164 8.05638 8.99073 7.98533 9.17182 7.93038C9.35292 7.87354 9.52945 7.84607 9.7014 7.84797C9.94103 7.84986 10.1541 7.9086 10.3407 8.02417C10.5273 8.13974 10.6737 8.29795 10.7798 8.49879C10.8877 8.69773 10.9416 8.92414 10.9416 9.17802C10.9416 9.42622 10.8895 9.64885 10.7852 9.84589C10.6828 10.041 10.541 10.1945 10.3599 10.3063C10.1807 10.4181 9.97579 10.474 9.7453 10.474C9.4581 10.474 9.21115 10.3887 9.00445 10.2182C8.79957 10.0458 8.68432 9.8279 8.65871 9.56454H8.00018C8.00356 9.63293 8.01072 9.69959 8.02165 9.76454C8.05795 9.98026 8.13585 10.1769 8.25536 10.3546C8.41085 10.5858 8.61756 10.7677 8.87548 10.9003C9.13341 11.0329 9.42335 11.0992 9.7453 11.0992C10.102 11.0992 10.4203 11.0159 10.7002 10.8491C10.9801 10.6805 11.1996 10.4512 11.3587 10.1614Z",fill:"currentColor"}),I1("path",{d:"M6.86268 5.19922V10.7789H6.12054V5.90758H6.08463L4.58838 6.8121V6.12554L6.12054 5.19922H6.86268Z",fill:"currentColor"}),I1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.86268 4.99922C6.97314 4.99922 7.06268 5.08876 7.06268 5.19922V10.7789C7.06268 10.8894 6.97314 10.9789 6.86268 10.9789H6.12054C6.01008 10.9789 5.92054 10.8894 5.92054 10.7789V6.24048L4.69185 6.98326C4.63008 7.02059 4.55299 7.02176 4.49013 6.9863C4.42726 6.95085 4.38838 6.88427 4.38838 6.8121V6.12554C4.38838 6.05552 4.42499 5.99061 4.4849 5.95438L6.01707 5.02807C6.04828 5.00919 6.08406 4.99922 6.12054 4.99922H6.86268ZM6.08463 5.90758H6.12054V10.7789H6.86268V5.19922H6.12054L4.58838 6.12554V6.8121L6.08463 5.90758Z",fill:"currentColor"})]});import{jsx as g4,jsxs as $l}from"react/jsx-runtime";var Ql=C=>$l("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[g4("title",{children:"Condense"}),g4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 6.5C8 7.32843 7.32843 8 6.5 8L3 8C2.72386 8 2.5 7.77614 2.5 7.5C2.5 7.22386 2.72386 7 3 7L6.29289 7L2.64645 3.35355C2.45118 3.15829 2.45118 2.84171 2.64645 2.64645C2.84171 2.45118 3.15829 2.45118 3.35355 2.64645L7 6.29289L7 3C7 2.72386 7.22386 2.5 7.5 2.5C7.77614 2.5 8 2.72386 8 3L8 6.5Z",fill:"currentColor"}),g4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 9.5C8 8.67157 8.67157 8 9.5 8L13 8C13.2761 8 13.5 8.22386 13.5 8.5C13.5 8.77614 13.2761 9 13 9L9.70711 9L13.3536 12.6464C13.5488 12.8417 13.5488 13.1583 13.3536 13.3536C13.1583 13.5488 12.8417 13.5488 12.6464 13.3536L9 9.70711L9 13C9 13.2761 8.77614 13.5 8.5 13.5C8.22386 13.5 8 13.2761 8 13L8 9.5Z",fill:"currentColor"})]});import{jsx as u4,jsxs as Ct}from"react/jsx-runtime";var jl=C=>Ct("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[u4("title",{children:"Expand"}),u4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 3.5C2 2.67157 2.67157 2 3.5 2H7C7.27614 2 7.5 2.22386 7.5 2.5C7.5 2.77614 7.27614 3 7 3H3.70711L7.35355 6.64645C7.54882 6.84171 7.54882 7.15829 7.35355 7.35355C7.15829 7.54882 6.84171 7.54882 6.64645 7.35355L3 3.70711V7C3 7.27614 2.77614 7.5 2.5 7.5C2.22386 7.5 2 7.27614 2 7V3.5Z",fill:"currentColor"}),u4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 12.5C14 13.3284 13.3284 14 12.5 14H9C8.72386 14 8.5 13.7761 8.5 13.5C8.5 13.2239 8.72386 13 9 13H12.2929L8.64645 9.35355C8.45118 9.15829 8.45118 8.84171 8.64645 8.64645C8.84171 8.45118 9.15829 8.45118 9.35355 8.64645L13 12.2929V9C13 8.72386 13.2239 8.5 13.5 8.5C13.7761 8.5 14 8.72386 14 9V12.5Z",fill:"currentColor"})]});import{jsx as V4,jsxs as ot}from"react/jsx-runtime";var et=C=>ot("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[V4("title",{children:"FilmTV"}),V4("path",{d:"M9.5 7.49999C9.5 7.22385 9.27614 6.99999 9 6.99999C8.72386 6.99999 8.5 7.22385 8.5 7.49999V10.5C8.5 10.7761 8.72386 11 9 11C9.27614 11 9.5 10.7761 9.5 10.5V7.49999Z",fill:"currentColor"}),V4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.01008 8.69543e-06C10.6623 0.00544329 12 1.3465 12 2.99999C12 3.76834 11.7111 4.46923 11.2361 4.99999H11.5C11.7761 4.99999 12 5.22385 12 5.49999V6.59999L15.3143 5.27427C15.6427 5.14289 16 5.38477 16 5.7385V12.2615C16 12.6152 15.6427 12.8571 15.3143 12.7257L12 11.4V12.5C12 12.7761 11.7761 13 11.5 13H10V15.5C10 15.7761 9.77614 16 9.5 16H3.5C3.22386 16 3 15.7761 3 15.5V13H0.5C0.223858 13 0 12.7761 0 12.5V5.49999C0 5.22391 0.223758 5.00009 0.499818 4.99999C0.185973 4.58216 0 4.06279 0 3.49999C0 2.13271 1.09762 1.02179 2.45978 1.00031L8.13078 0.127845C8.40341 0.0454465 8.69244 0.000804184 8.99177 0L9.01008 8.69543e-06ZM4 15V13H9V15H4ZM11 12H1V11H6.5C6.77614 11 7 10.7761 7 10.5V7.49999C7 7.22385 6.77614 6.99999 6.5 6.99999H1V5.99999H11V12ZM12 10.323L15 11.523V6.47702L12 7.67702V10.323ZM1 9.99999V7.99999H6V9.99999H1ZM2.49223 2.00001L2.50695 2C3.33218 2.00375 4 2.67388 4 3.49999C4 4.32842 3.32843 4.99999 2.5 4.99999C1.67157 4.99999 1 4.32842 1 3.49999C1 2.67415 1.66738 2.00419 2.49223 2.00001ZM4.26924 1.73369L6.46436 1.39598C6.17028 1.8599 6 2.41006 6 2.99999C6 3.76834 6.28885 4.46923 6.76389 4.99999H4.50018C4.81403 4.58216 5 4.06279 5 3.49999C5 2.81038 4.72078 2.18599 4.26924 1.73369ZM8.36128 1.10415C7.56992 1.37066 7 2.11877 7 2.99999C7 4.10456 7.89543 4.99999 9 4.99999C10.1046 4.99999 11 4.10456 11 2.99999C11 1.90752 10.1241 1.01963 9.03623 1.00031L8.36128 1.10415Z",fill:"currentColor"})]});import{jsx as J3,jsxs as tt}from"react/jsx-runtime";var lt=C=>tt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[J3("title",{children:"Forward"}),J3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.8536 4.35353C13.0488 4.15826 13.0488 3.84168 12.8536 3.64642L9.67157 0.46444C9.47631 0.269178 9.15973 0.269178 8.96447 0.46444C8.7692 0.659702 8.7692 0.976284 8.96447 1.17155L11.2929 3.49997H8C4.68629 3.49997 2 6.18626 2 9.49997C2 12.8137 4.68629 15.5 8 15.5C11.3137 15.5 14 12.8137 14 9.49997C14 9.22383 13.7761 8.99997 13.5 8.99997C13.2239 8.99997 13 9.22383 13 9.49997C13 12.2614 10.7614 14.5 8 14.5C5.23858 14.5 3 12.2614 3 9.49997C3 6.73855 5.23858 4.49997 8 4.49997H11.2929L8.96447 6.8284C8.7692 7.02366 8.7692 7.34025 8.96447 7.53551C9.15973 7.73077 9.47631 7.73077 9.67157 7.53551L12.8536 4.35353Z",fill:"currentColor"})]});import{jsx as B1,jsxs as it}from"react/jsx-runtime";var rt=C=>it("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[B1("title",{children:"Forward15"}),B1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9415 3.0427C12.9414 3.04259 12.9416 3.04281 12.9415 3.0427L14.2966 4.39789H12.1355C11.8594 4.39789 11.6355 4.62174 11.6355 4.89789C11.6355 5.17403 11.8594 5.39789 12.1355 5.39789H15.5C15.7761 5.39789 16 5.17403 16 4.89789V1.53322C16 1.25708 15.7761 1.03322 15.5 1.03322C15.2239 1.03322 15 1.25708 15 1.53322V3.68708L13.6481 2.33508C12.2017 0.892964 10.2041 0 7.99959 0C3.58151 0 0 3.58175 0 8C0 12.4183 3.58151 16 7.99959 16C12.4177 16 15.9992 12.4183 15.9992 8C15.9992 7.72386 15.7753 7.5 15.4992 7.5C15.223 7.5 14.9992 7.72386 14.9992 8C14.9992 11.866 11.8653 15 7.99959 15C4.13385 15 1 11.866 1 8C1 4.13398 4.13385 1 7.99959 1C9.92861 1 11.6749 1.78003 12.9415 3.0427Z",fill:"currentColor"}),B1("path",{d:"M9.45697 11.0992C9.13502 11.0992 8.84508 11.0329 8.58715 10.9003C8.32922 10.7677 8.12252 10.5858 7.96703 10.3546C7.81154 10.1235 7.72648 9.8601 7.71185 9.56454H8.37038C8.39599 9.8279 8.51124 10.0458 8.71611 10.2182C8.92282 10.3887 9.16977 10.474 9.45697 10.474C9.68746 10.474 9.89233 10.4181 10.0716 10.3063C10.2527 10.1945 10.3945 10.041 10.4969 9.84589C10.6012 9.64885 10.6533 9.42622 10.6533 9.17802C10.6533 8.92414 10.5993 8.69773 10.4914 8.49879C10.3853 8.29795 10.239 8.13974 10.0524 8.02417C9.86581 7.9086 9.6527 7.84986 9.41307 7.84797C9.24111 7.84607 9.06459 7.87354 8.88349 7.93038C8.7024 7.98533 8.55331 8.05638 8.43624 8.14353L7.79965 8.06396L8.1399 5.19922H11.0594V5.82446H8.71063L8.51307 7.54103H8.54599C8.66124 7.4463 8.80575 7.36767 8.97953 7.30514C9.15331 7.24262 9.33441 7.21136 9.52282 7.21136C9.86672 7.21136 10.1731 7.29662 10.442 7.46714C10.7128 7.63576 10.925 7.86691 11.0786 8.16059C11.2341 8.45426 11.3118 8.78962 11.3118 9.16666C11.3118 9.53801 11.2314 9.86958 11.0704 10.1614C10.9112 10.4512 10.6917 10.6805 10.4118 10.8491C10.132 11.0159 9.81368 11.0992 9.45697 11.0992Z",fill:"currentColor"}),B1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.56697 9.42666C7.60472 9.38699 7.65709 9.36454 7.71185 9.36454H8.37038C8.47334 9.36454 8.55948 9.4427 8.56944 9.54518C8.5899 9.7555 8.6792 9.92545 8.84414 10.0645C9.01219 10.2029 9.21299 10.274 9.45697 10.274C9.65357 10.274 9.82113 10.2268 9.96578 10.1366C10.1153 10.0443 10.2334 9.91754 10.3198 9.75294C10.4072 9.58786 10.4533 9.39737 10.4533 9.17802C10.4533 8.95333 10.4058 8.7604 10.3156 8.59416L10.3146 8.59221C10.2245 8.42167 10.1024 8.29037 9.94708 8.19419C9.79451 8.09969 9.61793 8.04959 9.41148 8.04796C9.26265 8.04632 9.10646 8.07002 8.94339 8.12121L8.94156 8.12178C8.77634 8.17191 8.64965 8.23399 8.55567 8.30396C8.51429 8.33476 8.46261 8.34839 8.41143 8.34199L7.77484 8.26241C7.66572 8.24877 7.58808 8.14958 7.60105 8.04037L7.94129 5.17563C7.95324 5.07501 8.03856 4.99922 8.1399 4.99922H11.0594C11.1699 4.99922 11.2594 5.08876 11.2594 5.19922V5.82446C11.2594 5.93492 11.1699 6.02446 11.0594 6.02446H8.88893L8.75592 7.18018C8.80584 7.15742 8.85785 7.13637 8.91182 7.11695C9.10776 7.04646 9.3118 7.01136 9.52282 7.01136C9.90121 7.01136 10.2451 7.10563 10.5485 7.29781C10.8502 7.48592 11.0862 7.74391 11.2556 8.06743C11.4281 8.39352 11.5118 8.76161 11.5118 9.16666C11.5118 9.56778 11.4246 9.93319 11.2456 10.2578C11.0697 10.5781 10.8255 10.8334 10.5151 11.0204C10.2013 11.2073 9.84618 11.2992 9.45697 11.2992C9.10676 11.2992 8.78491 11.2269 8.49569 11.0781C8.20903 10.9307 7.9762 10.7266 7.80108 10.4662C7.624 10.203 7.52841 9.90399 7.51209 9.57443C7.50938 9.51973 7.52922 9.46632 7.56697 9.42666ZM11.0704 10.1614C11.2314 9.86958 11.3118 9.53801 11.3118 9.16666C11.3118 8.78962 11.2341 8.45426 11.0786 8.16059C10.925 7.86691 10.7128 7.63576 10.442 7.46714C10.1731 7.29662 9.86672 7.21136 9.52282 7.21136C9.33441 7.21136 9.15331 7.24262 8.97953 7.30514C8.88771 7.33818 8.80406 7.37571 8.72858 7.41774C8.66121 7.45526 8.60034 7.49635 8.54599 7.54103H8.51307L8.71063 5.82446H11.0594V5.19922H8.1399L7.79965 8.06396L8.43624 8.14353C8.55331 8.05638 8.7024 7.98533 8.88349 7.93038C9.06459 7.87354 9.24111 7.84607 9.41307 7.84797C9.6527 7.84986 9.86581 7.9086 10.0524 8.02417C10.239 8.13974 10.3853 8.29795 10.4914 8.49879C10.5993 8.69773 10.6533 8.92414 10.6533 9.17802C10.6533 9.42622 10.6012 9.64885 10.4969 9.84589C10.3945 10.041 10.2527 10.1945 10.0716 10.3063C9.89233 10.4181 9.68746 10.474 9.45697 10.474C9.16977 10.474 8.92282 10.3887 8.71611 10.2182C8.51124 10.0458 8.39599 9.8279 8.37038 9.56454H7.71185C7.71523 9.63293 7.72239 9.69959 7.73332 9.76454C7.76962 9.98026 7.84752 10.1769 7.96703 10.3546C8.12252 10.5858 8.32922 10.7677 8.58715 10.9003C8.84508 11.0329 9.13502 11.0992 9.45697 11.0992C9.81368 11.0992 10.132 11.0159 10.4118 10.8491C10.6917 10.6805 10.9112 10.4512 11.0704 10.1614Z",fill:"currentColor"}),B1("path",{d:"M6.57435 5.19922V10.7789H5.83221V5.90758H5.7963L4.30005 6.8121V6.12554L5.83221 5.19922H6.57435Z",fill:"currentColor"}),B1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.57435 4.99922C6.68481 4.99922 6.77435 5.08876 6.77435 5.19922V10.7789C6.77435 10.8894 6.68481 10.9789 6.57435 10.9789H5.83221C5.72175 10.9789 5.63221 10.8894 5.63221 10.7789V6.24048L4.40352 6.98326C4.34175 7.02059 4.26466 7.02176 4.2018 6.9863C4.13893 6.95085 4.10005 6.88427 4.10005 6.8121V6.12554C4.10005 6.05552 4.13666 5.99061 4.19657 5.95438L5.72873 5.02807C5.75995 5.00919 5.79573 4.99922 5.83221 4.99922H6.57435ZM5.7963 5.90758H5.83221V10.7789H6.57435V5.19922H5.83221L4.30005 6.12554V6.8121L5.7963 5.90758Z",fill:"currentColor"})]});import{jsx as K3,jsxs as dt}from"react/jsx-runtime";var nt=C=>dt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[K3("title",{children:"FullScreen"}),K3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 2C1.22386 2 1 2.22386 1 2.5V6C1 6.27614 0.776142 6.5 0.5 6.5C0.223858 6.5 0 6.27614 0 6V2.5C0 1.67157 0.671573 1 1.5 1H6C6.27614 1 6.5 1.22386 6.5 1.5C6.5 1.77614 6.27614 2 6 2H1.5ZM9.5 1.5C9.5 1.22386 9.72386 1 10 1H14.5C15.3284 1 16 1.67157 16 2.5V6C16 6.27614 15.7761 6.5 15.5 6.5C15.2239 6.5 15 6.27614 15 6V2.5C15 2.22386 14.7761 2 14.5 2H10C9.72386 2 9.5 1.77614 9.5 1.5ZM0.5 9.5C0.776142 9.5 1 9.72386 1 10V13.5C1 13.7761 1.22386 14 1.5 14H6C6.27614 14 6.5 14.2239 6.5 14.5C6.5 14.7761 6.27614 15 6 15H1.5C0.671573 15 0 14.3284 0 13.5V10C0 9.72386 0.223858 9.5 0.5 9.5ZM15.5 9.5C15.7761 9.5 16 9.72386 16 10V13.5C16 14.3284 15.3284 15 14.5 15H10C9.72386 15 9.5 14.7761 9.5 14.5C9.5 14.2239 9.72386 14 10 14H14.5C14.7761 14 15 13.7761 15 13.5V10C15 9.72386 15.2239 9.5 15.5 9.5Z",fill:"currentColor"})]});import{jsx as v4,jsxs as st}from"react/jsx-runtime";var pt=C=>st("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[v4("title",{children:"FullscreenExit"}),v4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 1C4.77614 1 5 1.22386 5 1.5V4C5 4.57707 4.85539 5.10171 4.47855 5.47855C4.10171 5.85539 3.57707 6 3 6H0.5C0.223858 6 0 5.77614 0 5.5C0 5.22386 0.223858 5 0.5 5H3C3.42293 5 3.64829 4.89461 3.77145 4.77145C3.89461 4.64829 4 4.42293 4 4V1.5C4 1.22386 4.22386 1 4.5 1ZM11.5 1C11.7761 1 12 1.22386 12 1.5V4C12 4.42293 12.1054 4.64829 12.2286 4.77145C12.3517 4.89461 12.5771 5 13 5H15.5C15.7761 5 16 5.22386 16 5.5C16 5.77614 15.7761 6 15.5 6H13C12.4229 6 11.8983 5.85539 11.5214 5.47855C11.1446 5.10171 11 4.57707 11 4V1.5C11 1.22386 11.2239 1 11.5 1Z",fill:"currentColor"}),v4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 15C4.77614 15 5 14.7761 5 14.5V12C5 11.4229 4.85539 10.8983 4.47855 10.5214C4.10171 10.1446 3.57707 10 3 10H0.5C0.223858 10 0 10.2239 0 10.5C0 10.7761 0.223858 11 0.5 11H3C3.42293 11 3.64829 11.1054 3.77145 11.2286C3.89461 11.3517 4 11.5771 4 12V14.5C4 14.7761 4.22386 15 4.5 15ZM11.5 15C11.7761 15 12 14.7761 12 14.5V12C12 11.5771 12.1054 11.3517 12.2286 11.2286C12.3517 11.1054 12.5771 11 13 11H15.5C15.7761 11 16 10.7761 16 10.5C16 10.2239 15.7761 10 15.5 10H13C12.4229 10 11.8983 10.1446 11.5214 10.5214C11.1446 10.8983 11 11.4229 11 12V14.5C11 14.7761 11.2239 15 11.5 15Z",fill:"currentColor"})]});import{jsx as m4,jsxs as ft}from"react/jsx-runtime";var ct=C=>ft("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[m4("title",{children:"LiveVideo"}),m4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 2C1.44772 2 1 2.44772 1 3V11C1 11.2213 1.12513 11.4657 1.37972 11.6727C1.63392 11.8793 1.96221 12 2.25 12H14C14.5523 12 15 11.5523 15 11V3C15 2.44772 14.5523 2 14 2H2ZM0 3C0 1.89543 0.895431 1 2 1H14C15.1046 1 16 1.89543 16 3V11C16 12.1046 15.1046 13 14 13H12.7897L14.3625 14.6556C14.5527 14.8558 14.5446 15.1723 14.3444 15.3625C14.1442 15.5527 13.8277 15.5446 13.6375 15.3444L11.4103 13H4.58966L2.3625 15.3444C2.17231 15.5446 1.85583 15.5527 1.65563 15.3625C1.45542 15.1723 1.44731 14.8558 1.6375 14.6556L3.21034 13H2.25C1.70936 13 1.16265 12.7849 0.748963 12.4487C0.335659 12.1127 0 11.6071 0 11V3Z",fill:"currentColor"}),m4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5.40719V8.60294L9.5566 7.00506L7 5.40719ZM10.0993 7.34426C10.0992 7.3442 10.0994 7.34433 10.0993 7.34426V7.34426ZM6 4.68549C6 4.21423 6.51837 3.92692 6.918 4.17669L10.6293 6.49626C11.0053 6.73126 11.0053 7.27886 10.6293 7.51386L6.918 9.83344C6.51837 10.0832 6 9.7959 6 9.32464V4.68549Z",fill:"currentColor"})]});import{jsx as l2,jsxs as at}from"react/jsx-runtime";var ht=C=>at("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[l2("title",{children:"Mobile"}),l2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 1H5C4.44772 1 4 1.44772 4 2V14C4 14.5523 4.44772 15 5 15H11C11.5523 15 12 14.5523 12 14V2C12 1.44772 11.5523 1 11 1ZM5 0C3.89543 0 3 0.895431 3 2V14C3 15.1046 3.89543 16 5 16H11C12.1046 16 13 15.1046 13 14V2C13 0.895431 12.1046 0 11 0H5Z",fill:"currentColor"}),l2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 3H6V11H10V3ZM6 2C5.44772 2 5 2.44772 5 3V11C5 11.5523 5.44772 12 6 12H10C10.5523 12 11 11.5523 11 11V3C11 2.44772 10.5523 2 10 2H6Z",fill:"currentColor"}),l2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 13.5C7 13.2239 7.22386 13 7.5 13H8.5C8.77614 13 9 13.2239 9 13.5C9 13.7761 8.77614 14 8.5 14H7.5C7.22386 14 7 13.7761 7 13.5Z",fill:"currentColor"})]});import{jsx as t2,jsxs as gt}from"react/jsx-runtime";var Lt=C=>gt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[t2("title",{children:"Mute"}),t2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.4 3.70003C7.05924 3.2056 8 3.67598 8 4.50003V11.5C8 12.3241 7.05924 12.7945 6.4 12.3L3.33333 10H2C1.44772 10 1 9.55231 1 9.00003V7.00003C1 6.44774 1.44772 6.00003 2 6.00003H3.33333L6.4 3.70003ZM7 4.50003L3.93333 6.80003C3.76024 6.92985 3.5497 7.00003 3.33333 7.00003H2V9.00003H3.33333C3.5497 9.00003 3.76024 9.07021 3.93333 9.20003L7 11.5V4.50003Z",fill:"currentColor"}),t2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.1 3.20003C12.2657 2.97912 12.5791 2.93434 12.8 3.10003L12.5 3.50003C12.8 3.10003 12.7998 3.09988 12.8 3.10003L12.8008 3.10066L12.8019 3.10144L12.8045 3.10341L12.8118 3.10906L12.8348 3.12717C12.8537 3.14227 12.8795 3.16345 12.9113 3.19071C12.9749 3.24521 13.0625 3.32419 13.1661 3.42773C13.3729 3.63455 13.6449 3.94098 13.916 4.34768C14.4596 5.163 15 6.38288 15 8.00003C15 9.61718 14.4596 10.8371 13.916 11.6524C13.6449 12.0591 13.3729 12.3655 13.1661 12.5723C13.0625 12.6759 12.9749 12.7548 12.9113 12.8093C12.8795 12.8366 12.8537 12.8578 12.8348 12.8729L12.8118 12.891L12.8045 12.8966L12.8019 12.8986L12.8008 12.8994C12.8006 12.8995 12.8 12.9 12.5 12.5L12.8 12.9C12.5791 13.0657 12.2657 13.0209 12.1 12.8C11.9345 12.5793 11.979 12.2663 12.1994 12.1005C12.1993 12.1006 12.1995 12.1004 12.1994 12.1005M12.1994 12.1005L12.1984 12.1012C12.1984 12.1013 12.1985 12.1012 12.1994 12.1005L12.2101 12.092C12.2205 12.0837 12.2377 12.0697 12.2605 12.0501C12.3063 12.0108 12.375 11.9492 12.4589 11.8652C12.6271 11.697 12.8551 11.441 13.084 11.0977C13.5404 10.413 14 9.38288 14 8.00003C14 6.61718 13.5404 5.58706 13.084 4.90238C12.8551 4.55907 12.6271 4.30301 12.4589 4.13483C12.375 4.05087 12.3063 3.98922 12.2605 3.94997C12.2377 3.93036 12.2205 3.91638 12.2101 3.90804L12.1997 3.89979C12.1988 3.89912 12.1984 3.8988 12.1984 3.89884L12.1997 3.89979C11.979 3.73403 11.9344 3.42083 12.1 3.20003",fill:"currentColor"}),t2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0528 5.27642C10.1763 5.02943 10.4766 4.92932 10.7236 5.05282L10.5 5.50003C10.7236 5.05282 10.7232 5.05264 10.7236 5.05282L10.7251 5.05354L10.7266 5.05432L10.73 5.05604L10.7378 5.06015C10.7435 5.06319 10.7502 5.06684 10.7577 5.07112C10.7729 5.07969 10.7916 5.09084 10.8133 5.10483C10.8569 5.13282 10.9127 5.17224 10.9763 5.22529C11.104 5.33166 11.2622 5.49199 11.416 5.72268C11.7267 6.18868 12 6.91254 12 8.00003C12 9.08752 11.7267 9.81138 11.416 10.2774C11.2622 10.5081 11.104 10.6684 10.9763 10.7748C10.9127 10.8278 10.8569 10.8672 10.8133 10.8952C10.7916 10.9092 10.7729 10.9204 10.7577 10.9289C10.7502 10.9332 10.7435 10.9369 10.7378 10.9399L10.73 10.944L10.7266 10.9457L10.7251 10.9465C10.7247 10.9467 10.7236 10.9472 10.5 10.5L10.7236 10.9472C10.4766 11.0707 10.1763 10.9706 10.0528 10.7236C9.93104 10.4801 10.0266 10.1848 10.266 10.0582C10.266 10.0582 10.266 10.0582 10.266 10.0582C10.2673 10.0574 10.2695 10.056 10.2726 10.054C10.2837 10.0469 10.3061 10.0316 10.3362 10.0065C10.396 9.95666 10.4878 9.86699 10.584 9.72268C10.7733 9.43868 11 8.91254 11 8.00003C11 7.08752 10.7733 6.56138 10.584 6.27738C10.4878 6.13307 10.396 6.0434 10.3362 5.99351C10.3061 5.96845 10.2837 5.95318 10.2726 5.94601C10.2695 5.94402 10.2673 5.94266 10.266 5.94189C10.0266 5.81524 9.93104 5.51991 10.0528 5.27642Z",fill:"currentColor"})]});import{jsx as q3,jsxs as Vt}from"react/jsx-runtime";var ut=C=>Vt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[q3("title",{children:"NoVideo"}),q3("path",{d:"M0.5 0.5L4.5 4.5M10.5 10.5L15.5 15.5M15.5 8C15.5 12.1421 12.1421 15.5 8 15.5C3.85787 15.5 0.5 12.1421 0.5 8C0.5 3.85787 3.85787 0.5 8 0.5C12.1421 0.5 15.5 3.85787 15.5 8ZM6.5 5.68042V10.3196C6.5 10.3981 6.5864 10.446 6.653 10.4044L10.3643 8.0848C10.427 8.04563 10.427 7.95437 10.3643 7.9152L6.653 5.59562C6.5864 5.554 6.5 5.60188 6.5 5.68042Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as w4,jsxs as mt}from"react/jsx-runtime";var vt=C=>mt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[w4("title",{children:"Pause"}),w4("path",{d:"M3 0C2.44772 0 2 0.447715 2 1V15C2 15.5523 2.44772 16 3 16H6C6.55228 16 7 15.5523 7 15V1C7 0.447715 6.55228 0 6 0H3Z",fill:"currentColor"}),w4("path",{d:"M10 0C9.44772 0 9 0.447715 9 1V15C9 15.5523 9.44772 16 10 16H13C13.5523 16 14 15.5523 14 15V1C14 0.447715 13.5523 0 13 0H10Z",fill:"currentColor"})]});import{jsx as H4,jsxs as Ht}from"react/jsx-runtime";var wt=C=>Ht("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[H4("title",{children:"PauseCircle"}),H4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4.5C6.27614 4.5 6.5 4.72386 6.5 5V11C6.5 11.2761 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.2761 5.5 11V5C5.5 4.72386 5.72386 4.5 6 4.5ZM10 4.5C10.2761 4.5 10.5 4.72386 10.5 5V11C10.5 11.2761 10.2761 11.5 10 11.5C9.72386 11.5 9.5 11.2761 9.5 11V5C9.5 4.72386 9.72386 4.5 10 4.5Z",fill:"currentColor"}),H4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"})]});import{jsx as z3,jsxs as Rt}from"react/jsx-runtime";var Mt=C=>Rt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[z3("title",{children:"Play"}),z3("path",{d:"M0 14.4909V1.50914C0 0.774179 0.754952 0.286322 1.41719 0.59334L15.418 7.0842C16.194 7.44398 16.194 8.55602 15.418 8.9158L1.41719 15.4067C0.754952 15.7137 0 15.2258 0 14.4909Z",fill:"currentColor"})]});import{jsx as M4,jsxs as St}from"react/jsx-runtime";var Zt=C=>St("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[M4("title",{children:"PlayCircle"}),M4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),M4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.67683C6 5.21018 6.50933 4.92215 6.90923 5.16266L10.7721 7.48582C11.1598 7.71899 11.1598 8.28101 10.7721 8.51418L6.90923 10.8373C6.50933 11.0778 6 10.7898 6 10.3232V5.67683ZM7 6.38416V9.61584L9.68677 8L7 6.38416Z",fill:"currentColor"})]});import{jsx as R4,jsxs as Pt}from"react/jsx-runtime";var Gt=C=>Pt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[R4("title",{children:"Popout"}),R4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 2C2.22386 2 2 2.22386 2 2.5V13.5C2 13.7761 2.22386 14 2.5 14H13.5C13.7761 14 14 13.7761 14 13.5V9.3C14 9.02386 14.2239 8.8 14.5 8.8C14.7761 8.8 15 9.02386 15 9.3V13.5C15 14.3284 14.3284 15 13.5 15H2.5C1.67157 15 1 14.3284 1 13.5V2.5C1 1.67157 1.67157 1 2.5 1H6.7C6.97614 1 7.2 1.22386 7.2 1.5C7.2 1.77614 6.97614 2 6.7 2H2.5Z",fill:"currentColor"}),R4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.14645 7.85355C7.95118 7.65829 7.95118 7.34171 8.14645 7.14645L14.2929 1L10.5 1C10.2239 1 10 0.776143 10 0.5C10 0.223858 10.2239 -2.41409e-08 10.5 0L14.5 3.49691e-07C15.3284 4.22115e-07 16 0.671573 16 1.5L16 5.5C16 5.77614 15.7761 6 15.5 6C15.2239 6 15 5.77614 15 5.5L15 1.70711L8.85355 7.85355C8.65829 8.04882 8.34171 8.04882 8.14645 7.85355Z",fill:"currentColor"})]});import{jsx as Z4,jsxs as bt}from"react/jsx-runtime";var xt=C=>bt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Z4("title",{children:"Replay"}),Z4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.05852 3.0427L1.7034 4.39789H3.86448C4.14062 4.39789 4.36448 4.62174 4.36448 4.89789C4.36448 5.17403 4.14062 5.39789 3.86448 5.39789H0.5C0.223858 5.39789 0 5.17403 0 4.89789V1.53322C0 1.25708 0.223858 1.03322 0.5 1.03322C0.776142 1.03322 1 1.25708 1 1.53322V3.68708L2.35193 2.33508C3.79834 0.892964 5.7959 0 8.00041 0C12.4185 0 16 3.58175 16 8C16 12.4183 12.4185 16 8.00041 16C3.58233 16 0.000820428 12.4183 0.000820428 8C0.000820428 7.72386 0.224678 7.5 0.50082 7.5C0.776963 7.5 1.00082 7.72386 1.00082 8C1.00082 11.866 4.13467 15 8.00041 15C11.8662 15 15 11.866 15 8C15 4.13398 11.8662 1 8.00041 1C6.07139 1 4.32511 1.78003 3.05852 3.0427Z",fill:"currentColor"}),Z4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00701 6.40834V9.60409L9.56361 8.00622L7.00701 6.40834ZM6.00701 5.68664C6.00701 5.21538 6.52538 4.92807 6.92501 5.17784L10.6363 7.49742C11.0123 7.73242 11.0123 8.28001 10.6363 8.51501L6.92501 10.8346C6.52538 11.0844 6.00701 10.7971 6.00701 10.3258V5.68664Z",fill:"currentColor"})]});import{jsx as S4,jsxs as It}from"react/jsx-runtime";var yt=C=>It("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[S4("title",{children:"SoundHalf"}),S4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.4 3.70005C7.05924 3.20562 8 3.676 8 4.50005V11.5C8 12.3241 7.05924 12.7945 6.4 12.3L3.33333 10H2C1.44772 10 1 9.55233 1 9.00005V7.00005C1 6.44776 1.44772 6.00005 2 6.00005H3.33333L6.4 3.70005ZM7 4.50005L3.93333 6.80005C3.76024 6.92987 3.5497 7.00005 3.33333 7.00005H2V9.00005H3.33333C3.5497 9.00005 3.76024 9.07022 3.93333 9.20005L7 11.5V4.50005Z",fill:"currentColor"}),S4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0528 5.27644C10.1763 5.02945 10.4766 4.92934 10.7236 5.05283L10.7378 5.06017C10.7577 5.07114 10.7236 5.05283 10.7236 5.05283L10.7251 5.05356L10.7266 5.05434L10.73 5.05606L10.7378 5.06017C10.7435 5.06321 10.7502 5.06685 10.7577 5.07114C10.7729 5.07971 10.7916 5.09085 10.8133 5.10485C10.8569 5.13283 10.9127 5.17225 10.9763 5.22531C11.104 5.33168 11.2622 5.492 11.416 5.7227C11.7267 6.18869 12 6.91255 12 8.00005C12 9.08754 11.7267 9.8114 11.416 10.2774C11.2622 10.5081 11.104 10.6684 10.9763 10.7748C10.9127 10.8278 10.8569 10.8673 10.8133 10.8952C10.7916 10.9092 10.7729 10.9204 10.7577 10.929C10.7502 10.9332 10.7435 10.9369 10.7378 10.9399L10.73 10.944L10.7266 10.9458L10.7251 10.9465C10.7251 10.9465 10.7236 10.9473 10.73 10.944L10.7236 10.9473C10.4766 11.0708 10.1763 10.9706 10.0528 10.7237C9.93104 10.4802 10.0266 10.1848 10.266 10.0582C10.266 10.0582 10.2695 10.0561 10.2726 10.0541C10.2837 10.0469 10.3061 10.0316 10.3362 10.0066C10.396 9.95668 10.4878 9.867 10.584 9.7227C10.7733 9.43869 11 8.91255 11 8.00005C11 7.08754 10.7733 6.5614 10.584 6.2774C10.4878 6.13309 10.396 6.04341 10.3362 5.99353C10.3061 5.96846 10.2837 5.9532 10.2726 5.94603C10.2695 5.94404 10.266 5.9419 10.266 5.9419C10.0266 5.81526 9.93104 5.51993 10.0528 5.27644Z",fill:"currentColor"})]});import{jsx as k1,jsxs as kt}from"react/jsx-runtime";var Bt=C=>kt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[k1("title",{children:"Unmute"}),k1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.3536 0.646447C15.5488 0.841709 15.5488 1.15829 15.3536 1.35355L1.35355 15.3536C1.15829 15.5488 0.841709 15.5488 0.646447 15.3536C0.451184 15.1583 0.451184 14.8417 0.646447 14.6464L14.6464 0.646447C14.8417 0.451184 15.1583 0.451184 15.3536 0.646447Z",fill:"currentColor"}),k1("path",{d:"M10.9922 7.71488L11.8766 6.83053C11.9533 7.16323 12 7.55058 12 8.00005C12 9.08754 11.7267 9.8114 11.416 10.2774C11.2622 10.5081 11.104 10.6684 10.9763 10.7748C10.9127 10.8278 10.8569 10.8673 10.8133 10.8952C10.7916 10.9092 10.7729 10.9204 10.7577 10.929L10.7458 10.9356L10.7378 10.9399L10.73 10.944L10.7266 10.9458L10.7251 10.9465C10.7251 10.9465 10.7236 10.9473 10.5 10.5L10.7236 10.9473C10.4766 11.0708 10.1763 10.9706 10.0528 10.7237C9.93104 10.4802 10.0266 10.1848 10.266 10.0582L10.2726 10.0541C10.2837 10.0469 10.3061 10.0316 10.3362 10.0066C10.396 9.95668 10.4878 9.867 10.584 9.7227C10.7733 9.43869 11 8.91255 11 8.00005C11 7.90045 10.9973 7.80546 10.9922 7.71488Z",fill:"currentColor"}),k1("path",{d:"M6.40405 12.3031L8 10.7071V11.5C8 12.3224 7.06308 12.7925 6.40405 12.3031Z",fill:"currentColor"}),k1("path",{d:"M13.3538 5.35334L14.0875 4.61959C14.5677 5.42516 15 6.55371 15 8.00005C15 9.6172 14.4596 10.8371 13.916 11.6524C13.6449 12.0591 13.3729 12.3655 13.1661 12.5723C13.0625 12.6759 12.9749 12.7549 12.9113 12.8094C12.8795 12.8366 12.8537 12.8578 12.8348 12.8729L12.8118 12.891L12.8045 12.8967L12.8019 12.8986L12.8008 12.8994C12.8008 12.8994 12.8 12.9 12.5 12.5L12.8 12.9C12.5791 13.0657 12.2657 13.021 12.1 12.8C11.9345 12.5793 11.979 12.2663 12.1994 12.1005L12.2101 12.092C12.2205 12.0837 12.2377 12.0697 12.2605 12.0501C12.3063 12.0109 12.375 11.9492 12.4589 11.8652C12.6271 11.6971 12.8551 11.441 13.084 11.0977C13.5404 10.413 14 9.38289 14 8.00005C14 6.893 13.7055 6.01201 13.3538 5.35334Z",fill:"currentColor"}),k1("path",{d:"M8 4.50005V5.29291L7 6.29291V4.50005L3.93333 6.80005C3.76024 6.92987 3.5497 7.00005 3.33333 7.00005H2V9.00005H3.33333C3.5497 9.00005 3.76024 9.07022 3.93333 9.20005L4.02449 9.26842L3.29286 10H2C1.44772 10 1 9.55233 1 9.00005V7.00005C1 6.44776 1.44772 6.00005 2 6.00005H3.33333L6.4 3.70005C7.05924 3.20562 8 3.676 8 4.50005Z",fill:"currentColor"})]});import{jsx as G4,jsxs as Ft}from"react/jsx-runtime";var Et=C=>Ft("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[G4("title",{children:"VideoStreaming"}),G4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2C0 1.44771 0.447716 1 1 1H15C15.5523 1 16 1.44772 16 2V14C16 14.5523 15.5523 15 15 15H1C0.447715 15 0 14.5523 0 14V2ZM1 12V14H15V12H1ZM15 11H1V2H15V11Z",fill:"currentColor"}),G4("path",{d:"M6.5 8.17639V4.82361C6.5 4.67493 6.65646 4.57823 6.78944 4.64472L10.1422 6.32111C10.2896 6.39482 10.2896 6.60518 10.1422 6.67889L6.78944 8.35528C6.65646 8.42177 6.5 8.32507 6.5 8.17639Z",fill:"currentColor"})]});import{jsx as P4,jsxs as Dt}from"react/jsx-runtime";var At=C=>Dt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[P4("title",{children:"Badge"}),P4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00008 15C10.2092 15 12.0001 13.2092 12.0001 11C12.0001 8.79087 10.2092 7.00001 8.00008 7.00001C5.79094 7.00001 4.00008 8.79087 4.00008 11C4.00008 13.2092 5.79094 15 8.00008 15ZM8.00008 16C10.7615 16 13.0001 13.7614 13.0001 11C13.0001 8.23859 10.7615 6.00001 8.00008 6.00001C5.23865 6.00001 3.00008 8.23859 3.00008 11C3.00008 13.7614 5.23865 16 8.00008 16Z",fill:"currentColor"}),P4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.34196 0.0256719C5.60393 -0.0616519 5.88709 0.079928 5.97442 0.3419L6.97442 3.3419C7.06174 3.60387 6.92016 3.88703 6.65819 3.97436C6.39622 4.06168 6.11306 3.9201 6.02573 3.65813L5.02573 0.658127C4.93841 0.396156 5.07999 0.112996 5.34196 0.0256719ZM10.0529 0.276407C10.1764 0.0294175 10.4767 -0.0706946 10.7237 0.0528C10.9707 0.176295 11.0708 0.476631 10.9473 0.72362L8.94729 4.72362C8.82379 4.97061 8.52346 5.07072 8.27647 4.94723C8.02948 4.82373 7.92937 4.5234 8.05286 4.27641L10.0529 0.276407ZM1.24283 0.0712671C1.47962 -0.070807 1.78675 0.00597557 1.92882 0.242766L4.92882 5.24277C5.0709 5.47956 4.99411 5.78669 4.75732 5.92876C4.52053 6.07083 4.2134 5.99405 4.07133 5.75726L1.07133 0.757261C0.929255 0.520471 1.00604 0.213341 1.24283 0.0712671ZM14.7573 0.0712671C14.9941 0.213341 15.0709 0.520471 14.9288 0.757261L11.9288 5.75726C11.7867 5.99405 11.4796 6.07083 11.2428 5.92876C11.006 5.78669 10.9293 5.47956 11.0713 5.24277L14.0713 0.242766C14.2134 0.00597557 14.5205 -0.070807 14.7573 0.0712671ZM8.00008 9.00001C8.27622 9.00001 8.50008 9.22387 8.50008 9.50001V12.5C8.50008 12.7762 8.27622 13 8.00008 13C7.72393 13 7.50008 12.7762 7.50008 12.5V9.50001C7.50008 9.22387 7.72393 9.00001 8.00008 9.00001Z",fill:"currentColor"})]});import{jsx as E1,jsxs as _t}from"react/jsx-runtime";var Tt=C=>_t("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[E1("title",{children:"FDTVPicks"}),E1("g",{clipPath:"url(#clip0_5774_91)",children:E1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.249023 3.24976C0.249023 2.14519 1.14445 1.24976 2.24902 1.24976H13.749C14.8536 1.24976 15.749 2.14519 15.749 3.24976V7.99976C15.749 8.2759 15.5252 8.49976 15.249 8.49976C14.9729 8.49976 14.749 8.2759 14.749 7.99976V3.24976C14.749 2.69747 14.3013 2.24976 13.749 2.24976H2.24902C1.69674 2.24976 1.24902 2.69747 1.24902 3.24976V12.7498C1.24902 13.2732 1.65127 13.7028 2.16354 13.7462C2.06325 13.462 2.04708 13.1429 2.14137 12.8242L2.70108 10.9324C2.95244 10.0827 3.73287 9.49976 4.6189 9.49976H7.99841C8.27455 9.49976 8.49841 9.72361 8.49841 9.99976C8.49841 10.2759 8.27455 10.4998 7.99841 10.4998H4.6189C4.17589 10.4998 3.78567 10.7912 3.65999 11.2161L3.10029 13.1079C3.00566 13.4278 3.24478 13.7487 3.57802 13.7498H6.99902L7.00073 13.7498H7.99835C8.27449 13.7498 8.49835 13.9736 8.49835 14.2498C8.49835 14.5259 8.27449 14.7498 7.99835 14.7498L2.24902 14.7498C1.14445 14.7498 0.249023 13.8543 0.249023 12.7498V3.24976ZM6.99806 4.74683C6.30599 4.74683 5.74495 5.30786 5.74495 5.99994C5.74495 6.69201 6.30599 7.25304 6.99806 7.25304C7.69014 7.25304 8.25117 6.69201 8.25117 5.99994C8.25117 5.30786 7.69014 4.74683 6.99806 4.74683ZM4.74495 5.99994C4.74495 4.75558 5.75371 3.74683 6.99806 3.74683C8.24242 3.74683 9.25117 4.75558 9.25117 5.99994C9.25117 7.24429 8.24242 8.25304 6.99806 8.25304C5.75371 8.25304 4.74495 7.24429 4.74495 5.99994ZM15.1453 9.6462C15.3406 9.45094 15.6572 9.45094 15.8524 9.6462C16.0477 9.84146 16.0477 10.158 15.8524 10.3533L11.8524 14.3533C11.6572 14.5486 11.3406 14.5486 11.1453 14.3533L9.14531 12.3533C8.95004 12.158 8.95004 11.8415 9.14531 11.6462C9.34057 11.4509 9.65715 11.4509 9.85241 11.6462L11.4989 13.2926L15.1453 9.6462Z",fill:"currentColor"})}),E1("defs",{children:E1("clipPath",{id:"clip0_5774_91",children:E1("rect",{width:16,height:16,fill:"currentColor",transform:"translate(-0.00195312)"})})})]});import{jsx as X3,jsxs as Ot}from"react/jsx-runtime";var Wt=C=>Ot("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[X3("title",{children:"Horse"}),X3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.4823 0.0256906C10.6865 0.0937476 10.8242 0.284817 10.8242 0.500032V2.12432C10.8515 2.15823 10.8792 2.19269 10.9073 2.22766C11.2688 2.67738 11.698 3.21125 12.0886 3.75723C12.5465 4.39743 12.9839 5.09797 13.1986 5.74192C13.4987 6.64235 13.7911 7.46843 14.0782 8.0905C14.222 8.40213 14.3562 8.64385 14.4786 8.8122C14.6048 8.98576 14.6769 9.02289 14.6821 9.02554C14.6821 9.02556 14.6823 9.02567 14.6821 9.02554C14.8314 9.0753 14.9488 9.19262 14.9986 9.34192C15.1155 9.69263 15.2215 10.2481 15.1558 10.8038C15.0891 11.3671 14.8314 12.0055 14.1478 12.3472C13.9873 12.4275 13.7962 12.4156 13.6469 12.3161L12.0099 11.2247C11.4093 11.3018 10.5054 11.2632 9.65336 10.9431C9.28614 10.8051 8.92269 10.6118 8.59679 10.3501L9.02249 15.4585C9.0375 15.6386 8.95417 15.8128 8.80453 15.9141C8.6549 16.0154 8.46224 16.0281 8.30061 15.9472L1.10061 12.3472C0.93122 12.2626 0.824219 12.0894 0.824219 11.9C0.824219 6.31439 5.08312 3.16964 8.23647 2.45036L9.92422 0.200032C10.0533 0.02786 10.2782 -0.0423665 10.4823 0.0256906ZM9.82422 2.00003L8.92422 3.20003C8.85041 3.29845 8.74291 3.3662 8.62228 3.39032C5.84875 3.94503 1.98415 6.68452 1.82904 11.5934L7.95206 14.6549L7.42595 8.34156C7.40393 8.07742 7.59187 7.842 7.85431 7.80494C8.11676 7.76789 8.36253 7.94207 8.41451 8.20197C8.61225 9.19066 9.25718 9.72598 10.0051 10.007C10.7754 10.2964 11.6099 10.293 12.0262 10.2097C12.1562 10.1837 12.2912 10.2105 12.4016 10.284L13.916 11.2936C14.0542 11.1463 14.1325 10.9418 14.1627 10.6863C14.1973 10.3934 14.1596 10.0821 14.1017 9.84103C13.9268 9.72128 13.7844 9.55788 13.6699 9.40037C13.4923 9.15621 13.3264 8.84793 13.1702 8.50956C12.8573 7.83163 12.5497 6.95772 12.2499 6.05815C12.0851 5.56367 11.7224 4.96422 11.2752 4.33902C10.9026 3.81808 10.4939 3.30962 10.132 2.85929C10.0641 2.77484 9.99783 2.69244 9.93378 2.61238C9.86286 2.52372 9.82422 2.41357 9.82422 2.30003V2.00003Z",fill:"currentColor"})]});import{jsx as Y3,jsxs as Ut}from"react/jsx-runtime";var Nt=C=>Ut("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Y3("title",{children:"Picks4"}),Y3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.6258 9.28434V12.1861C2.6258 12.6356 2.26142 13 1.81193 13C1.36243 13 0.998047 12.6356 0.998047 12.1861V5C0.998047 3.89543 1.89348 3 2.99805 3H4.58169C5.62826 3 6.45929 3.29075 7.07479 3.87225C7.6903 4.45376 7.99805 5.22298 7.99805 6.17994C7.99805 7.1598 7.69673 7.92216 7.09409 8.46703C6.49146 9.01191 5.64756 9.28434 4.56239 9.28434H2.6258ZM2.6258 7.89011H4.58169C5.16073 7.89011 5.60252 7.74474 5.90705 7.45398C6.21159 7.16323 6.36386 6.74313 6.36386 6.19368C6.36386 5.65339 6.20945 5.22184 5.90062 4.89904C5.5918 4.57623 5.16717 4.41026 4.62672 4.4011H3.6258C3.07352 4.4011 2.6258 4.84881 2.6258 5.4011V7.89011ZM13.8002 8.43713H14.3276C14.6979 8.43713 14.998 8.73729 14.998 9.10756C14.998 9.47783 14.6979 9.778 14.3276 9.778H13.8002V12.1959C13.8002 12.64 13.4403 13 12.9962 13C12.5521 13 12.1921 12.64 12.1921 12.1959V9.778H8.53896C8.25397 9.778 8.01939 9.55385 8.00643 9.26916L7.99911 9.10835C7.98885 8.88297 8.0551 8.66074 8.18711 8.47778L11.8398 3.41491C12.0278 3.15436 12.3295 3 12.6508 3H12.9697C13.4284 3 13.8002 3.37184 13.8002 3.83052V8.43713ZM10.0911 8.43713H11.9921C12.1026 8.43713 12.1921 8.34759 12.1921 8.23713V5.26228L12.073 5.48232L9.93595 8.11097C9.86627 8.19667 9.87927 8.32264 9.96497 8.39232C10.0006 8.42131 10.0452 8.43713 10.0911 8.43713Z",fill:"currentColor"})]});import{jsx as Q3,jsxs as Kt}from"react/jsx-runtime";var Jt=C=>Kt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Q3("title",{children:"Picks5"}),Q3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.32858 7.9729L8.80569 3.8841C8.86451 3.38007 9.29151 3 9.79895 3H13.9414C14.3343 3 14.6528 3.3185 14.6528 3.71138C14.6528 4.10427 14.3343 4.42276 13.9414 4.42276H10.3926L10.0988 6.78049C10.5934 6.51852 11.1516 6.38753 11.7735 6.38753C12.792 6.38753 13.5841 6.68789 14.1497 7.28862C14.7153 7.88934 14.998 8.69783 14.998 9.71409C14.998 10.7168 14.6847 11.5151 14.0579 12.1091C13.4311 12.703 12.5717 13 11.4797 13C10.5003 13 9.68868 12.7437 9.04474 12.231C8.40081 11.7184 7.99805 10.7371 7.99805 10.2019C7.99805 9.66667 9.65562 9.72312 9.72417 10.2019C9.79273 10.6807 9.97881 11.0477 10.2824 11.3028C10.586 11.558 10.9827 11.6856 11.4723 11.6856C12.0208 11.6856 12.448 11.505 12.7541 11.1436C13.0601 10.7823 13.2132 10.29 13.2132 9.66667C13.2132 9.06594 13.0442 8.59056 12.7063 8.24051C12.3685 7.89047 11.9033 7.71545 11.3107 7.71545C10.9876 7.71545 10.7133 7.75497 10.4881 7.83401C10.2628 7.91305 10.018 8.06775 9.75356 8.2981L8.32858 7.9729ZM2.6258 9.28434V12.1861C2.6258 12.6356 2.26142 13 1.81193 13C1.36243 13 0.998047 12.6356 0.998047 12.1861V5C0.998047 3.89543 1.89348 3 2.99805 3H4.58169C5.62826 3 6.45929 3.29075 7.07479 3.87225C7.6903 4.45376 7.99805 5.22298 7.99805 6.17994C7.99805 7.1598 7.69673 7.92216 7.09409 8.46703C6.49146 9.01191 5.64756 9.28434 4.56239 9.28434H2.6258ZM2.6258 7.89011H4.58169C5.16073 7.89011 5.60252 7.74474 5.90705 7.45398C6.21159 7.16323 6.36386 6.74313 6.36386 6.19368C6.36386 5.65339 6.20945 5.22184 5.90062 4.89904C5.5918 4.57623 5.16717 4.41026 4.62672 4.4011H3.6258C3.07352 4.4011 2.6258 4.84881 2.6258 5.4011V7.89011Z",fill:"currentColor"})]});import{jsx as $3,jsxs as zt}from"react/jsx-runtime";var qt=C=>zt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[$3("title",{children:"Picks6"}),$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.6258 9.28434V12.1861C2.6258 12.6356 2.26142 13 1.81193 13C1.36243 13 0.998047 12.6356 0.998047 12.1861V5C0.998047 3.89543 1.89348 3 2.99805 3H4.58169C5.62826 3 6.45929 3.29075 7.07479 3.87225C7.6903 4.45376 7.99805 5.22298 7.99805 6.17994C7.99805 7.1598 7.69673 7.92216 7.09409 8.46703C6.49146 9.01191 5.64756 9.28434 4.56239 9.28434H2.6258ZM2.6258 7.89011H4.58169C5.16073 7.89011 5.60252 7.74474 5.90705 7.45398C6.21159 7.16323 6.36386 6.74313 6.36386 6.19368C6.36386 5.65339 6.20945 5.22184 5.90062 4.89904C5.5918 4.57623 5.16717 4.41026 4.62672 4.4011H3.6258C3.07352 4.4011 2.6258 4.84881 2.6258 5.4011V7.89011ZM13.4409 3.67768C13.4409 4.06115 13.165 4.38903 12.7872 4.45461C11.8218 4.62217 11.1763 4.84083 10.8504 5.11059C10.2586 5.60059 9.90692 6.29512 9.79534 7.1942C10.3629 6.64126 11.0881 6.3648 11.971 6.3648C12.9073 6.3648 13.6458 6.67049 14.1867 7.28186C14.7276 7.89324 14.998 8.68217 14.998 9.64869C14.998 10.6467 14.6815 11.4547 14.0485 12.0728C13.4154 12.6909 12.5847 13 11.5563 13C10.4987 13 9.64133 12.6381 8.98401 11.9144C8.3267 11.1906 7.99805 10.2421 7.99805 9.06878V8.5091C7.99805 6.78736 8.4504 5.43876 9.35512 4.46325C9.89139 3.88502 11.0275 3.43531 12.7635 3.11415L12.7635 3.11413C13.0747 3.05655 13.3737 3.26218 13.4313 3.57342C13.4377 3.60781 13.4409 3.64271 13.4409 3.67768ZM11.5417 7.68645C11.1536 7.68645 10.261 8.05223 10.0011 8.46703C9.8278 8.74357 9.74952 9.02057 9.76624 9.29804C9.76624 10.0263 9.93117 10.6051 10.261 11.0344C10.5909 11.4637 11.0178 11.6784 11.5417 11.6784C12.0656 11.6784 12.4804 11.4963 12.786 11.1322C13.0916 10.768 13.2444 10.2893 13.2444 9.69589C13.2444 9.10249 13.0892 8.61924 12.7787 8.24612C12.4682 7.873 12.0559 7.68645 11.5417 7.68645Z",fill:"currentColor"})]});import{jsx as j3,jsxs as Yt}from"react/jsx-runtime";var Xt=C=>Yt("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[j3("title",{children:"Picks7"}),j3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.6258 9.28434V12.1861C2.6258 12.6356 2.26142 13 1.81193 13C1.36243 13 0.998047 12.6356 0.998047 12.1861V5C0.998047 3.89543 1.89348 3 2.99805 3H4.58169C5.62826 3 6.45929 3.29075 7.07479 3.87225C7.6903 4.45376 7.99805 5.22298 7.99805 6.17994C7.99805 7.1598 7.69673 7.92216 7.09409 8.46703C6.49146 9.01191 5.64756 9.28434 4.56239 9.28434H2.6258ZM2.6258 7.89011H4.58169C5.16073 7.89011 5.60252 7.74474 5.90705 7.45398C6.21159 7.16323 6.36386 6.74313 6.36386 6.19368C6.36386 5.65339 6.20945 5.22184 5.90062 4.89904C5.5918 4.57623 5.16717 4.41026 4.62672 4.4011H3.6258C3.07352 4.4011 2.6258 4.84881 2.6258 5.4011V7.89011ZM14.9117 4.12131L11.2245 12.4066C11.0639 12.7675 10.7059 13 10.3109 13H10.0758C9.76437 13 9.51187 12.7475 9.51187 12.436C9.51187 12.3538 9.52985 12.2726 9.56453 12.1981L13.222 4.33929H8.66769C8.29786 4.33929 7.99805 4.03948 7.99805 3.66964C7.99805 3.29981 8.29786 3 8.66769 3H14.5344C14.7905 3 14.998 3.20756 14.998 3.4636V3.71473C14.998 3.85481 14.9686 3.99333 14.9117 4.12131Z",fill:"currentColor"})]});import{jsx as C6,jsxs as $t}from"react/jsx-runtime";var Qt=C=>$t("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[C6("title",{children:"Picks8"}),C6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.6258 9.28434V12.1861C2.6258 12.6356 2.26142 13 1.81193 13C1.36243 13 0.998047 12.6356 0.998047 12.1861V5C0.998047 3.89543 1.89348 3 2.99805 3H4.58169C5.62826 3 6.45929 3.29075 7.07479 3.87225C7.6903 4.45376 7.99805 5.22298 7.99805 6.17994C7.99805 7.1598 7.69673 7.92216 7.09409 8.46703C6.49146 9.01191 5.64756 9.28434 4.56239 9.28434H2.6258ZM2.6258 7.89011H4.58169C5.16073 7.89011 5.60252 7.74474 5.90705 7.45398C6.21159 7.16323 6.36386 6.74313 6.36386 6.19368C6.36386 5.65339 6.20945 5.22184 5.90062 4.89904C5.5918 4.57623 5.16717 4.41026 4.62672 4.4011H3.6258C3.07352 4.4011 2.6258 4.84881 2.6258 5.4011V7.89011ZM14.7632 5.70053C14.7632 6.17736 14.6287 6.60183 14.3597 6.97393C14.0906 7.34604 13.7238 7.63904 13.2591 7.85294C13.8167 8.08913 14.2459 8.41221 14.5468 8.82219C14.8476 9.23218 14.998 9.69563 14.998 10.2126C14.998 11.0682 14.6801 11.7467 14.0442 12.248C13.4082 12.7493 12.562 13 11.5054 13C10.4439 13 9.59396 12.7482 8.95559 12.2447C8.31723 11.7411 7.99805 11.0637 7.99805 10.2126C7.99805 9.69117 8.14969 9.22326 8.45297 8.80882C8.75626 8.39438 9.18183 8.07576 9.7297 7.85294C9.26988 7.63904 8.90668 7.34604 8.64008 6.97393C8.37348 6.60183 8.24018 6.17736 8.24018 5.70053C8.24018 4.87165 8.53368 4.21435 9.12069 3.72861C9.70769 3.24287 10.5001 3 11.498 3C12.5008 3 13.2957 3.24287 13.8827 3.72861C14.4697 4.21435 14.7632 4.87165 14.7632 5.70053ZM13.215 10.1324C13.215 9.65107 13.0573 9.26226 12.7418 8.96591C12.4262 8.66956 12.0092 8.52139 11.4907 8.52139C10.9722 8.52139 10.5576 8.66845 10.247 8.96257C9.93638 9.25669 9.78107 9.64661 9.78107 10.1324C9.78107 10.6092 9.93393 10.9902 10.2397 11.2754C10.5454 11.5606 10.9673 11.7032 11.5054 11.7032C12.0435 11.7032 12.4629 11.5651 12.7638 11.2888C13.0646 11.0125 13.215 10.627 13.215 10.1324ZM12.9876 5.76069C12.9876 5.33734 12.853 4.98864 12.584 4.71457C12.315 4.44051 11.953 4.30348 11.498 4.30348C11.0431 4.30348 10.6836 4.43382 10.4194 4.69452C10.1553 4.95522 10.0232 5.3106 10.0232 5.76069C10.0232 6.20633 10.1565 6.5606 10.4231 6.82353C10.6897 7.08645 11.0505 7.21791 11.5054 7.21791C11.9603 7.21791 12.3211 7.08645 12.5877 6.82353C12.8543 6.5606 12.9876 6.20633 12.9876 5.76069Z",fill:"currentColor"})]});import{jsx as e6,jsxs as Cr}from"react/jsx-runtime";var jt=C=>Cr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[e6("title",{children:"Result"}),e6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00012 1C5.45868 1 3.39844 3.06024 3.39844 5.60169C3.39844 8.14313 5.45868 10.2034 8.00012 10.2034C10.5416 10.2034 12.6018 8.14313 12.6018 5.60169C12.6018 3.06024 10.5416 1 8.00012 1ZM2.39844 5.60169C2.39844 2.50796 4.9064 0 8.00012 0C11.0938 0 13.6018 2.50796 13.6018 5.60169C13.6018 7.99054 12.1065 10.0301 10.0008 10.8355V15.5C10.0008 15.7761 9.77691 16 9.50077 16H6.49944C6.2233 16 5.99944 15.7761 5.99944 15.5V10.8355C3.89375 10.0301 2.39844 7.99053 2.39844 5.60169ZM6.99944 11.1142V15H9.00077V11.1143C8.67608 11.1728 8.34167 11.2034 8.00012 11.2034C7.65856 11.2034 7.32414 11.1728 6.99944 11.1142ZM8.00128 4.50981C7.3976 4.50981 6.90822 4.9992 6.90822 5.60288C6.90822 6.20656 7.3976 6.69594 8.00128 6.69594C8.60496 6.69594 9.09434 6.20656 9.09434 5.60288C9.09434 4.9992 8.60496 4.50981 8.00128 4.50981ZM5.90822 5.60288C5.90822 4.44691 6.84531 3.50981 8.00128 3.50981C9.15725 3.50981 10.0943 4.44691 10.0943 5.60288C10.0943 6.75885 9.15725 7.69594 8.00128 7.69594C6.84531 7.69594 5.90822 6.75885 5.90822 5.60288Z",fill:"currentColor"})]});import{jsx as o6,jsxs as or}from"react/jsx-runtime";var er=C=>or("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[o6("title",{children:"Stable"}),o6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.7985 0.0423995C7.92707 -0.0142148 8.07353 -0.0141296 8.20203 0.0426344L14.13 2.6612C14.2574 2.71744 14.3555 2.82422 14.4008 2.95583L15.9728 7.52276C15.9908 7.57512 16 7.63012 16 7.6855V15.5C16 15.7761 15.7761 16 15.5 16H0.5C0.223858 16 0 15.7761 0 15.5V7.6855C0 7.63073 0.00899658 7.57634 0.0266303 7.5245L1.57992 2.95757C1.62501 2.82499 1.72363 2.7174 1.85179 2.66097L7.7985 0.0423995ZM2.4559 3.48761L1 7.7682V15H3L3 8.9C3 8.76739 3.05268 8.64021 3.14645 8.54645C3.24021 8.45268 3.36739 8.4 3.5 8.4H12.5C12.7761 8.4 13 8.62386 13 8.9L13 15H15V7.76914L13.5263 3.48772L7.99968 1.04647L2.4559 3.48761ZM12 14.5139L12 9.4H5.01994L12 14.5139ZM4 9.89242L4 15H10.9715L4 9.89242Z",fill:"currentColor"})]});import{jsx as l6,jsxs as tr}from"react/jsx-runtime";var lr=C=>tr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[l6("title",{children:"TimeForm"}),l6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.99805 0C0.893477 0 -0.00195312 0.895431 -0.00195312 2V14C-0.00195312 15.1046 0.893477 16 1.99805 16H13.998C15.1026 16 15.998 15.1046 15.998 14V2C15.998 0.895431 15.1026 0 13.998 0H1.99805ZM5.80664 6.07715H7.98438V4.89062H2.19336V6.07715H4.3418V12H5.80664V6.07715ZM10.2891 9.09473H13.1016V7.91309H10.2891V6.07715H13.4531V4.89062H8.82422V12H10.2891V9.09473Z",fill:"currentColor"})]});import{jsx as t6,jsxs as ir}from"react/jsx-runtime";var rr=C=>ir("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[t6("title",{children:"TrackMaster"}),t6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5067 7.97478C15.5067 11.2402 12.4158 13.9852 8.50133 13.9852C4.58689 13.9852 1.49601 11.2402 1.49601 7.97478C1.49601 4.70934 4.58689 1.96439 8.50133 1.96439C12.4158 1.96439 15.5067 4.70934 15.5067 7.97478ZM-0.00439453 8C-0.00439453 11.866 3.57828 15 7.99774 15C12.4172 15 15.9999 11.866 15.9999 8C15.9999 4.13401 12.4172 1 7.99774 1C3.57828 1 -0.00439453 4.13401 -0.00439453 8ZM5.77295 6.07666H7.30664L7.4956 5H3.18457L2.99561 6.07666H4.50732L3.58447 11.3984H4.8501L5.77295 6.07666ZM9.75098 9.60107L9.37744 5H7.75146L6.64404 11.3984H7.90527L8.19531 9.71094L8.56006 6.95557L9.04346 11.3984H9.90039L11.8604 7.10059L11.3066 9.62744L10.999 11.3984H12.2646L13.3765 5H11.7153L9.75098 9.60107Z",fill:"currentColor"})]});import{jsx as r6,jsxs as dr}from"react/jsx-runtime";var nr=C=>dr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[r6("title",{children:"Tracks"}),r6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.237 4.25956C2.23239 5.09104 1.5 6.32984 1.5 8C1.5 9.66575 2.24891 10.905 3.2658 11.739C4.29572 12.5837 5.58783 13 6.61454 13H9.04514C10.163 13 11.5436 12.5782 12.6367 11.7305C13.7172 10.8927 14.5 9.65519 14.5 8C14.5 6.34921 13.7003 5.11116 12.6069 4.27081C11.5008 3.42064 10.1189 3 9.04514 3H6.61454C5.54496 3 4.25419 3.41766 3.237 4.25956ZM12.5077 3H15.1596C15.4357 3 15.6596 2.77614 15.6596 2.5C15.6596 2.22386 15.4357 2 15.1596 2H6.61454C5.31328 2 3.79677 2.49817 2.5994 3.48919C1.38945 4.49063 0.5 6.00184 0.5 8C0.5 10.0026 1.41364 11.5133 2.63166 12.5122C2.84939 12.6908 3.07725 12.8534 3.31191 13H0.5C0.223858 13 0 13.2239 0 13.5C0 13.7761 0.223858 14 0.5 14H9.04514C10.3822 14 11.9789 13.506 13.2495 12.5207C14.5328 11.5256 15.5 10.0131 15.5 8C15.5 5.98246 14.5077 4.47051 13.2163 3.47795C12.989 3.3032 12.7516 3.14387 12.5077 3ZM6.78267 6.14507C5.9369 6.14507 4.92897 6.77476 4.92897 8C4.92897 9.22106 5.96796 9.85493 6.78267 9.85493H8.87689C9.72264 9.85493 10.7305 9.22525 10.7305 8C10.7305 6.77475 9.72264 6.14507 8.87689 6.14507H6.78267ZM3.92897 8C3.92897 6.0839 5.53421 5.14507 6.78267 5.14507H8.87689C10.1254 5.14507 11.7305 6.08392 11.7305 8C11.7305 9.91608 10.1254 10.8549 8.87689 10.8549H6.78267C5.57507 10.8549 3.92897 9.92027 3.92897 8Z",fill:"currentColor"})]});import{jsx as i6,jsxs as sr}from"react/jsx-runtime";var pr=C=>sr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[i6("title",{children:"X"}),i6("path",{d:"M9.48954 6.77491L15.3178 0H13.9367L8.87601 5.88256L4.83405 0H0.172119L6.28436 8.89547L0.172119 16H1.55331L6.89754 9.78782L11.1662 16H15.8281L9.48954 6.77491ZM2.05098 1.03974H4.17241L13.9374 15.0075H11.8159L2.05098 1.03974Z",fill:"currentColor"})]});import{jsx as Q,jsxs as fr}from"react/jsx-runtime";var cr=C=>fr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Q("title",{children:"Archery"}),Q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 13C11.3137 13 14 10.3137 14 7C14 3.68629 11.3137 1 8 1C4.68629 1 2 3.68629 2 7C2 10.3137 4.68629 13 8 13ZM8 14C11.866 14 15 10.866 15 7C15 3.13401 11.866 0 8 0C4.13401 0 1 3.13401 1 7C1 10.866 4.13401 14 8 14Z",fill:"currentColor"}),Q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 11C10.2091 11 12 9.20914 12 7C12 4.79086 10.2091 3 8 3C5.79086 3 4 4.79086 4 7C4 9.20914 5.79086 11 8 11ZM8 12C10.7614 12 13 9.76142 13 7C13 4.23858 10.7614 2 8 2C5.23858 2 3 4.23858 3 7C3 9.76142 5.23858 12 8 12Z",fill:"currentColor"}),Q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 9C9.10457 9 10 8.10457 10 7C10 5.89543 9.10457 5 8 5C6.89543 5 6 5.89543 6 7C6 8.10457 6.89543 9 8 9ZM8 10C9.65685 10 11 8.65685 11 7C11 5.34315 9.65685 4 8 4C6.34315 4 5 5.34315 5 7C5 8.65685 6.34315 10 8 10Z",fill:"currentColor"}),Q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 8C8.55228 8 9 7.55228 9 7C9 6.44772 8.55228 6 8 6C7.44772 6 7 6.44772 7 7C7 7.55228 7.44772 8 8 8Z",fill:"currentColor"}),Q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 13C8.27614 13 8.5 13.2239 8.5 13.5V15.5C8.5 15.7761 8.27614 16 8 16C7.72386 16 7.5 15.7761 7.5 15.5V13.5C7.5 13.2239 7.72386 13 8 13Z",fill:"currentColor"}),Q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.75725 12.5713C5.99404 12.7133 6.07082 13.0205 5.92875 13.2572L4.42875 15.7572C4.28667 15.994 3.97954 16.0708 3.74275 15.9287C3.50596 15.7867 3.42918 15.4795 3.57125 15.2428L5.07125 12.7428C5.21333 12.506 5.52046 12.4292 5.75725 12.5713Z",fill:"currentColor"}),Q("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.1877 12.6096C10.4033 12.4371 10.7179 12.472 10.8904 12.6877L12.8904 15.1877C13.0629 15.4033 13.028 15.7179 12.8123 15.8904C12.5967 16.0629 12.2821 16.028 12.1096 15.8123L10.1096 13.3123C9.93706 13.0967 9.97202 12.7821 10.1877 12.6096Z",fill:"currentColor"})]});import{jsx as g5,jsxs as ar}from"react/jsx-runtime";var hr=C=>ar("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[g5("title",{children:"Athletics"}),g5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 1H5V15H11V1ZM5 0C4.44772 0 4 0.447715 4 1V16H12V1C12 0.447715 11.5523 0 11 0H5Z",fill:"currentColor"}),g5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6H1V15H4V6ZM1 5C0.447715 5 0 5.44771 0 6V16H5V5H1Z",fill:"currentColor"}),g5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 9H12V15H15V9ZM11 8V16H16V9C16 8.44772 15.5523 8 15 8H11Z",fill:"currentColor"}),g5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 2H8.5V6H9.5V7H6.5V6H7.5V3H6.5V2Z",fill:"currentColor"})]});import{jsx as F1,jsxs as gr}from"react/jsx-runtime";var Lr=C=>gr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[F1("title",{children:"AustralianRulesPitch"}),F1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.0569 11.4426C14.3151 10.4989 15 9.27153 15 8C15 6.72847 14.3151 5.50108 13.0569 4.55736C11.7983 3.61341 10.0137 3 8 3C5.98631 3 4.20174 3.61341 2.94315 4.55736C1.68486 5.50108 1 6.72847 1 8C1 9.27153 1.68486 10.4989 2.94315 11.4426C4.20174 12.3866 5.98631 13 8 13C10.0137 13 11.7983 12.3866 13.0569 11.4426ZM8 14C12.4183 14 16 11.3137 16 8C16 4.68629 12.4183 2 8 2C3.58172 2 0 4.68629 0 8C0 11.3137 3.58172 14 8 14Z",fill:"currentColor"}),F1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 7H7V9H9V7ZM7 6C6.44772 6 6 6.44772 6 7V9C6 9.55228 6.44772 10 7 10H9C9.55228 10 10 9.55228 10 9V7C10 6.44772 9.55228 6 9 6H7Z",fill:"currentColor"}),F1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 8C0 7.72386 0.223858 7.5 0.5 7.5H2C2.27614 7.5 2.5 7.72386 2.5 8C2.5 8.27614 2.27614 8.5 2 8.5H0.5C0.223858 8.5 0 8.27614 0 8ZM13.5 8C13.5 7.72386 13.7239 7.5 14 7.5H15.5C15.7761 7.5 16 7.72386 16 8C16 8.27614 15.7761 8.5 15.5 8.5H14C13.7239 8.5 13.5 8.27614 13.5 8Z",fill:"currentColor"}),F1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.07817 4.23156C2.22642 3.99859 2.53547 3.92992 2.76844 4.07817C5.63893 5.90485 5.63893 10.0952 2.76844 11.9218C2.53547 12.0701 2.22642 12.0014 2.07817 11.7684C1.92992 11.5355 1.99859 11.2264 2.23156 11.0782C4.48456 9.64444 4.48456 6.35556 2.23156 4.92183C1.99859 4.77358 1.92992 4.46453 2.07817 4.23156Z",fill:"currentColor"}),F1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.9218 4.23156C14.0701 4.46453 14.0014 4.77358 13.7684 4.92183C11.5154 6.35556 11.5154 9.64444 13.7684 11.0782C14.0014 11.2264 14.0701 11.5355 13.9218 11.7684C13.7736 12.0014 13.4645 12.0701 13.2316 11.9218C10.3611 10.0952 10.3611 5.90485 13.2316 4.07817C13.4645 3.92992 13.7736 3.99859 13.9218 4.23156Z",fill:"currentColor"})]});import{jsx as n6,jsxs as Vr}from"react/jsx-runtime";var ur=C=>Vr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[n6("title",{children:"Badminton"}),n6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.9248 0C9.6483 8.87402e-05 11.0185 0.685672 11.5052 0.96446L15.1023 0.0651894C15.5895 -0.0566195 16.0018 0.438345 15.794 0.895557L10.9248 11.6078V13C10.9248 14.6569 9.58166 16 7.9248 16C6.26795 16 4.9248 14.6569 4.9248 13V11.6088L0.055133 0.895557C-0.152691 0.438343 0.259641 -0.0566188 0.746874 0.0651894L4.34396 0.96446C4.83071 0.685654 6.20116 0 7.9248 0ZM4.98533 1.75275C5.42154 1.52139 6.3159 1.12083 7.4248 1.02235V4.02049C6.90188 4.08373 6.37123 4.26272 5.94012 4.4396C5.80551 4.49483 5.67669 4.55153 5.55623 4.60722L4.98533 1.75275ZM4.57967 4.82345L3.99666 1.90841L1.30851 1.23637L2.57523 4.02317C2.58709 4.02692 2.5989 4.03114 2.61063 4.03583L4.57967 4.82345ZM3.17275 5.33771L4.69289 5.94577C4.73141 5.96117 4.77094 5.97239 4.81088 5.9795L5.81498 11H5.74652L3.17275 5.33771ZM5.75853 5.61874C5.92317 5.53753 6.11423 5.44906 6.31971 5.36475C6.69129 5.2123 7.07725 5.08741 7.4248 5.0302V11H6.83478L5.75853 5.61874ZM8.4248 5.10087V11H9.01502L10.0445 5.85245C9.88678 5.75695 9.57583 5.57668 9.208 5.40489C8.94792 5.28342 8.6782 5.17526 8.4248 5.10087ZM11.0726 5.81124L10.0348 11H10.1026L12.7091 5.26573L11.0726 5.81124ZM13.2738 4.02347C13.2714 4.02421 13.2691 4.02496 13.2668 4.02573L11.2985 4.68185L11.8532 1.90824L14.5406 1.23637L13.2738 4.02347ZM10.2517 4.81678C10.0789 4.72062 9.8658 4.60842 9.63116 4.49884C9.28138 4.33547 8.85315 4.16309 8.4248 4.0689V1.02239C9.534 1.121 10.4285 1.52179 10.8644 1.75307L10.2517 4.81678ZM6.41052 12H5.9248V13C5.9248 14.1046 6.82024 15 7.9248 15C9.02937 15 9.9248 14.1046 9.9248 13V12H9.43928C9.43009 12.0003 9.42085 12.0003 9.41158 12H6.43822C6.42895 12.0003 6.41972 12.0003 6.41052 12Z",fill:"currentColor"})]});import{jsx as d6,jsxs as mr}from"react/jsx-runtime";var vr=C=>mr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[d6("title",{children:"Baseball"}),d6("path",{d:"M0.000213623 8C0.000213623 7.26562 0.0939636 6.55729 0.281464 5.875C0.468964 5.19271 0.737193 4.55469 1.08615 3.96094C1.43511 3.36719 1.85178 2.82812 2.33615 2.34375C2.82053 1.85938 3.36219 1.44271 3.96115 1.09375C4.56011 0.744792 5.19813 0.476562 5.87521 0.289062C6.5523 0.101562 7.26063 0.00520802 8.00021 0C8.73459 0 9.44292 0.09375 10.1252 0.28125C10.8075 0.46875 11.4455 0.736979 12.0393 1.08594C12.633 1.4349 13.1721 1.85156 13.6565 2.33594C14.1408 2.82031 14.5575 3.36198 14.9065 3.96094C15.2554 4.5599 15.5237 5.19792 15.7112 5.875C15.8987 6.55208 15.995 7.26042 16.0002 8C16.0002 8.73438 15.9065 9.44271 15.719 10.125C15.5315 10.8073 15.2632 11.4453 14.9143 12.0391C14.5653 12.6328 14.1487 13.1719 13.6643 13.6563C13.1799 14.1406 12.6382 14.5573 12.0393 14.9063C11.4403 15.2552 10.8049 15.5234 10.133 15.7109C9.46115 15.8984 8.75021 15.9948 8.00021 16C7.26584 16 6.55751 15.9062 5.87521 15.7188C5.19292 15.5312 4.5549 15.263 3.96115 14.9141C3.3674 14.5651 2.82834 14.1484 2.34396 13.6641C1.85959 13.1797 1.44292 12.638 1.09396 12.0391C0.745005 11.4401 0.476776 10.8047 0.289276 10.1328C0.101776 9.46094 0.00542196 8.75 0.000213623 8ZM15.0002 8C15.0002 7.35938 14.9169 6.74219 14.7502 6.14844C14.5835 5.55469 14.3492 4.9974 14.0471 4.47656C13.745 3.95573 13.3778 3.48177 12.9455 3.05469C12.5132 2.6276 12.0419 2.26302 11.5315 1.96094C11.021 1.65885 10.4638 1.42188 9.85959 1.25C9.25542 1.07813 8.63563 0.994792 8.00021 1C7.35959 1 6.7424 1.08333 6.14865 1.25C5.5549 1.41667 4.99761 1.65104 4.47678 1.95312C3.95594 2.25521 3.48198 2.6224 3.0549 3.05469C2.62782 3.48698 2.26323 3.95833 1.96115 4.46875C1.65907 4.97917 1.42209 5.53646 1.25021 6.14062C1.07834 6.74479 0.995005 7.36458 1.00021 8C1.00021 8.64062 1.08355 9.25781 1.25021 9.85156C1.41688 10.4453 1.65126 11.0026 1.95334 11.5234C2.25542 12.0443 2.62261 12.5182 3.0549 12.9453C3.48719 13.3724 3.95855 13.737 4.46896 14.0391C4.97938 14.3411 5.53667 14.5781 6.14084 14.75C6.74501 14.9219 7.3648 15.0052 8.00021 15C8.64084 15 9.25803 14.9167 9.85178 14.75C10.4455 14.5833 11.0028 14.349 11.5237 14.0469C12.0445 13.7448 12.5184 13.3776 12.9455 12.9453C13.3726 12.513 13.7372 12.0417 14.0393 11.5313C14.3414 11.0208 14.5783 10.4635 14.7502 9.85938C14.9221 9.25521 15.0054 8.63542 15.0002 8ZM4.00021 13C4.00021 12.8646 4.04969 12.7474 4.14865 12.6484C4.24761 12.5495 4.3648 12.5 4.50021 12.5C4.63563 12.5 4.75282 12.5495 4.85178 12.6484C4.95073 12.7474 5.00021 12.8646 5.00021 13C5.00021 13.1354 4.95073 13.2526 4.85178 13.3516C4.75282 13.4505 4.63563 13.5 4.50021 13.5C4.3648 13.5 4.24761 13.4505 4.14865 13.3516C4.04969 13.2526 4.00021 13.1354 4.00021 13ZM4.50021 11C4.50021 10.8646 4.54969 10.7474 4.64865 10.6484C4.74761 10.5495 4.8648 10.5 5.00021 10.5C5.13563 10.5 5.25282 10.5495 5.35178 10.6484C5.45073 10.7474 5.50021 10.8646 5.50021 11C5.50021 11.1354 5.45073 11.2526 5.35178 11.3516C5.25282 11.4505 5.13563 11.5 5.00021 11.5C4.8648 11.5 4.74761 11.4505 4.64865 11.3516C4.54969 11.2526 4.50021 11.1354 4.50021 11ZM5.00021 9C5.00021 8.86458 5.04969 8.7474 5.14865 8.64844C5.24761 8.54948 5.3648 8.5 5.50021 8.5C5.63563 8.5 5.75282 8.54948 5.85178 8.64844C5.95073 8.7474 6.00021 8.86458 6.00021 9C6.00021 9.13542 5.95073 9.2526 5.85178 9.35156C5.75282 9.45052 5.63563 9.5 5.50021 9.5C5.3648 9.5 5.24761 9.45052 5.14865 9.35156C5.04969 9.2526 5.00021 9.13542 5.00021 9ZM5.00021 7C5.00021 6.86458 5.04969 6.7474 5.14865 6.64844C5.24761 6.54948 5.3648 6.5 5.50021 6.5C5.63563 6.5 5.75282 6.54948 5.85178 6.64844C5.95073 6.7474 6.00021 6.86458 6.00021 7C6.00021 7.13542 5.95073 7.2526 5.85178 7.35156C5.75282 7.45052 5.63563 7.5 5.50021 7.5C5.3648 7.5 5.24761 7.45052 5.14865 7.35156C5.04969 7.2526 5.00021 7.13542 5.00021 7ZM4.50021 5C4.50021 4.86458 4.54969 4.7474 4.64865 4.64844C4.74761 4.54948 4.8648 4.5 5.00021 4.5C5.13563 4.5 5.25282 4.54948 5.35178 4.64844C5.45073 4.7474 5.50021 4.86458 5.50021 5C5.50021 5.13542 5.45073 5.2526 5.35178 5.35156C5.25282 5.45052 5.13563 5.5 5.00021 5.5C4.8648 5.5 4.74761 5.45052 4.64865 5.35156C4.54969 5.2526 4.50021 5.13542 4.50021 5ZM4.50021 3.5C4.3648 3.5 4.24761 3.45052 4.14865 3.35156C4.04969 3.2526 4.00021 3.13542 4.00021 3C4.00021 2.86458 4.04969 2.7474 4.14865 2.64844C4.24761 2.54948 4.3648 2.5 4.50021 2.5C4.63563 2.5 4.75282 2.54948 4.85178 2.64844C4.95073 2.7474 5.00021 2.86458 5.00021 3C5.00021 3.13542 4.95073 3.2526 4.85178 3.35156C4.75282 3.45052 4.63563 3.5 4.50021 3.5ZM11.0002 3C11.0002 2.86458 11.0497 2.7474 11.1487 2.64844C11.2476 2.54948 11.3648 2.5 11.5002 2.5C11.6356 2.5 11.7528 2.54948 11.8518 2.64844C11.9507 2.7474 12.0002 2.86458 12.0002 3C12.0002 3.13542 11.9507 3.2526 11.8518 3.35156C11.7528 3.45052 11.6356 3.5 11.5002 3.5C11.3648 3.5 11.2476 3.45052 11.1487 3.35156C11.0497 3.2526 11.0002 3.13542 11.0002 3ZM10.5002 5C10.5002 4.86458 10.5497 4.7474 10.6487 4.64844C10.7476 4.54948 10.8648 4.5 11.0002 4.5C11.1356 4.5 11.2528 4.54948 11.3518 4.64844C11.4507 4.7474 11.5002 4.86458 11.5002 5C11.5002 5.13542 11.4507 5.2526 11.3518 5.35156C11.2528 5.45052 11.1356 5.5 11.0002 5.5C10.8648 5.5 10.7476 5.45052 10.6487 5.35156C10.5497 5.2526 10.5002 5.13542 10.5002 5ZM10.0002 7C10.0002 6.86458 10.0497 6.7474 10.1487 6.64844C10.2476 6.54948 10.3648 6.5 10.5002 6.5C10.6356 6.5 10.7528 6.54948 10.8518 6.64844C10.9507 6.7474 11.0002 6.86458 11.0002 7C11.0002 7.13542 10.9507 7.2526 10.8518 7.35156C10.7528 7.45052 10.6356 7.5 10.5002 7.5C10.3648 7.5 10.2476 7.45052 10.1487 7.35156C10.0497 7.2526 10.0002 7.13542 10.0002 7ZM10.0002 9C10.0002 8.86458 10.0497 8.7474 10.1487 8.64844C10.2476 8.54948 10.3648 8.5 10.5002 8.5C10.6356 8.5 10.7528 8.54948 10.8518 8.64844C10.9507 8.7474 11.0002 8.86458 11.0002 9C11.0002 9.13542 10.9507 9.2526 10.8518 9.35156C10.7528 9.45052 10.6356 9.5 10.5002 9.5C10.3648 9.5 10.2476 9.45052 10.1487 9.35156C10.0497 9.2526 10.0002 9.13542 10.0002 9ZM10.5002 11C10.5002 10.8646 10.5497 10.7474 10.6487 10.6484C10.7476 10.5495 10.8648 10.5 11.0002 10.5C11.1356 10.5 11.2528 10.5495 11.3518 10.6484C11.4507 10.7474 11.5002 10.8646 11.5002 11C11.5002 11.1354 11.4507 11.2526 11.3518 11.3516C11.2528 11.4505 11.1356 11.5 11.0002 11.5C10.8648 11.5 10.7476 11.4505 10.6487 11.3516C10.5497 11.2526 10.5002 11.1354 10.5002 11ZM11.0002 13C11.0002 12.8646 11.0497 12.7474 11.1487 12.6484C11.2476 12.5495 11.3648 12.5 11.5002 12.5C11.6356 12.5 11.7528 12.5495 11.8518 12.6484C11.9507 12.7474 12.0002 12.8646 12.0002 13C12.0002 13.1354 11.9507 13.2526 11.8518 13.3516C11.7528 13.4505 11.6356 13.5 11.5002 13.5C11.3648 13.5 11.2476 13.4505 11.1487 13.3516C11.0497 13.2526 11.0002 13.1354 11.0002 13Z",fill:"currentColor"})]});import{jsx as r2,jsxs as Hr}from"react/jsx-runtime";var wr=C=>Hr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[r2("title",{children:"BaseballField"}),r2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.11265 7.36932L7.99999 13.3384L14.8873 7.36932C14.8314 7.25901 14.7591 7.12401 14.6697 6.97069C14.4109 6.52715 14.0113 5.93523 13.45 5.34437C12.3314 4.1669 10.5799 3 7.99999 3C5.42012 3 3.66859 4.1669 2.54999 5.34437C1.98868 5.93523 1.58905 6.52715 1.33032 6.97069C1.24088 7.12401 1.16863 7.25901 1.11265 7.36932ZM15.5 7.5C15.9642 7.3143 15.9641 7.31407 15.964 7.31382L15.9632 7.31166L15.9614 7.3072L15.9555 7.29293C15.9505 7.28107 15.9435 7.26458 15.9344 7.24376C15.9162 7.20213 15.8897 7.14316 15.8543 7.06931C15.7837 6.92171 15.6778 6.71422 15.5334 6.46681C15.2453 5.97285 14.8012 5.31477 14.175 4.65563C12.9186 3.3331 10.9201 2 7.99999 2C5.07986 2 3.08139 3.3331 1.82499 4.65563C1.1988 5.31477 0.754688 5.97285 0.466541 6.46681C0.32222 6.71422 0.2163 6.92171 0.145661 7.06931C0.110322 7.14316 0.0837561 7.20213 0.0655784 7.24376C0.0564879 7.26458 0.0494898 7.28107 0.0445365 7.29293L0.0386321 7.3072L0.0368175 7.31166L0.0361926 7.31321C0.036091 7.31347 0.0357551 7.3143 0.499993 7.5L0.0357551 7.3143C-0.0433658 7.51211 0.0115366 7.73832 0.172528 7.87784L7.60704 14.3211C7.83255 14.5165 8.16744 14.5165 8.39295 14.3211L15.8275 7.87784C15.9885 7.73832 16.0432 7.51162 15.964 7.31382L15.5 7.5Z",fill:"currentColor"}),r2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.64644 10.6464C7.8417 10.4512 8.15828 10.4512 8.35354 10.6464L9.85354 12.1464C10.0488 12.3417 10.0488 12.6583 9.85355 12.8535C9.65829 13.0488 9.34171 13.0488 9.14644 12.8535L7.99999 11.7071L6.85354 12.8535C6.65828 13.0488 6.3417 13.0488 6.14644 12.8535C5.95118 12.6583 5.95118 12.3417 6.14644 12.1464L7.64644 10.6464Z",fill:"currentColor"}),r2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.46406 10.6862C4.36134 10.9423 4.07055 11.0668 3.8143 10.9643C3.55791 10.8617 3.4332 10.5708 3.53575 10.3144L3.99999 10.5001C3.53575 10.3144 3.53565 10.3146 3.53575 10.3144L3.53618 10.3133L3.5367 10.312L3.53802 10.3088L3.54185 10.2995C3.54493 10.2922 3.54907 10.2825 3.5543 10.2706C3.56475 10.2469 3.57958 10.2143 3.59907 10.1742C3.63799 10.094 3.6957 9.98329 3.77437 9.85218C3.93128 9.59065 4.17416 9.24376 4.52144 8.89648C5.22219 8.19571 6.34391 7.5 7.99999 7.5C9.65608 7.5 10.7778 8.19571 11.4786 8.89648C11.8258 9.24376 12.0687 9.59065 12.2256 9.85218C12.3043 9.98329 12.362 10.094 12.4009 10.1742C12.4204 10.2143 12.4352 10.2469 12.4457 10.2706C12.4509 10.2825 12.4551 10.2922 12.4581 10.2995L12.462 10.3088L12.4633 10.312L12.4638 10.3133C12.4639 10.3136 12.4642 10.3144 12 10.5001L12.4642 10.3144C12.5668 10.5708 12.4421 10.8617 12.1857 10.9643C11.9299 11.0666 11.6396 10.9427 11.5365 10.6875C11.5364 10.6875 11.5365 10.6876 11.5365 10.6875C11.5363 10.6872 11.5362 10.6868 11.536 10.6865L11.5304 10.6733C11.5247 10.6605 11.5151 10.6393 11.5014 10.6111C11.4739 10.5545 11.4301 10.4699 11.3681 10.3667C11.2438 10.1594 11.0492 9.88131 10.7714 9.60358C10.2222 9.05431 9.34391 8.5 7.99999 8.5C6.65608 8.5 5.7778 9.05431 5.22855 9.60358C4.95082 9.88131 4.7562 10.1594 4.63187 10.3667C4.56991 10.4699 4.52605 10.5545 4.49858 10.6111C4.48486 10.6393 4.47528 10.6605 4.46962 10.6733L4.46406 10.6862ZM4.46406 10.6862L4.46366 10.6872C4.46366 10.6872 4.46364 10.6872 4.46406 10.6862Z",fill:"currentColor"})]});import{jsx as A1,jsxs as Rr}from"react/jsx-runtime";var Mr=C=>Rr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[A1("title",{children:"Basketball"}),A1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),A1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0C8.27614 0 8.5 0.223858 8.5 0.5V15.5C8.5 15.7761 8.27614 16 8 16C7.72386 16 7.5 15.7761 7.5 15.5V0.5C7.5 0.223858 7.72386 0 8 0Z",fill:"currentColor"}),A1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 8C0 7.72386 0.223858 7.5 0.5 7.5H15.5C15.7761 7.5 16 7.72386 16 8C16 8.27614 15.7761 8.5 15.5 8.5H0.5C0.223858 8.5 0 8.27614 0 8Z",fill:"currentColor"}),A1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.64645 2.64645C2.84171 2.45118 3.15829 2.45118 3.35355 2.64645C6.31024 5.60313 6.31024 10.3969 3.35355 13.3536C3.15829 13.5488 2.84171 13.5488 2.64645 13.3536C2.45118 13.1583 2.45118 12.8417 2.64645 12.6464C5.21261 10.0803 5.21261 5.91972 2.64645 3.35355C2.45118 3.15829 2.45118 2.84171 2.64645 2.64645Z",fill:"currentColor"}),A1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.3536 2.64645C13.5488 2.84171 13.5488 3.15829 13.3536 3.35355C10.7874 5.91972 10.7874 10.0803 13.3536 12.6464C13.5488 12.8417 13.5488 13.1583 13.3536 13.3536C13.1583 13.5488 12.8417 13.5488 12.6464 13.3536C9.68976 10.3969 9.68976 5.60313 12.6464 2.64645C12.8417 2.45118 13.1583 2.45118 13.3536 2.64645Z",fill:"currentColor"})]});import{jsx as p6,jsxs as Sr}from"react/jsx-runtime";var Zr=C=>Sr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[p6("title",{children:"BasketballCourt"}),p6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3V13C0 13.5523 0.447715 14 1 14H15C15.5523 14 16 13.5523 16 13V3C16 2.44772 15.5523 2 15 2H1C0.447715 2 0 2.44772 0 3ZM7.5 3H1V4H2C4.20914 4 6 5.79086 6 8C6 10.2091 4.20914 12 2 12H1V13H7.5V9.41465C6.9174 9.20873 6.5 8.65311 6.5 8C6.5 7.34689 6.9174 6.79127 7.5 6.58535V3ZM15 4V3H8.5V6.58535C9.0826 6.79127 9.5 7.34689 9.5 8C9.5 8.65311 9.0826 9.20873 8.5 9.41465V13H15V12H14C11.7909 12 10 10.2091 10 8C10 5.79086 11.7909 4 14 4H15ZM15 11H14C12.3431 11 11 9.65685 11 8C11 6.34315 12.3431 5 14 5H15V6.5H13C12.4477 6.5 12 6.94771 12 7.5V8.5C12 9.05228 12.4477 9.5 13 9.5H15V11ZM1 9.5V11H2C3.65685 11 5 9.65685 5 8C5 6.34315 3.65685 5 2 5H1V6.5H3C3.55228 6.5 4 6.94772 4 7.5V8.5C4 9.05228 3.55228 9.5 3 9.5H1ZM1 8.5V7.5H3V8.5H1ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5ZM15 7.5H13V8.5H15V7.5Z",fill:"currentColor"})]});import{jsx as _,jsxs as Pr}from"react/jsx-runtime";var Gr=C=>Pr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[_("title",{children:"Bingo"}),_("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 1H2C1.44772 1 1 1.44772 1 2V14C1 14.5523 1.44772 15 2 15H14C14.5523 15 15 14.5523 15 14V2C15 1.44772 14.5523 1 14 1ZM2 0C0.895431 0 0 0.895431 0 2V14C0 15.1046 0.895431 16 2 16H14C15.1046 16 16 15.1046 16 14V2C16 0.895431 15.1046 0 14 0H2Z",fill:"currentColor"}),_("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 1H2C1.44772 1 1 1.44772 1 2V14C1 14.5523 1.44772 15 2 15H4V1ZM2 0C0.895431 0 0 0.895431 0 2V14C0 15.1046 0.895431 16 2 16H5V0H2Z",fill:"currentColor"}),_("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 4V2C15 1.44772 14.5523 1 14 1H2C1.44772 1 1 1.44772 1 2V4H15ZM16 2C16 0.895431 15.1046 0 14 0H2C0.895431 0 0 0.895431 0 2V5H16V2Z",fill:"currentColor"}),_("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 12V14C1 14.5523 1.44772 15 2 15H14C14.5523 15 15 14.5523 15 14V12H1ZM0 14C0 15.1046 0.895431 16 2 16H14C15.1046 16 16 15.1046 16 14V11H0V14Z",fill:"currentColor"}),_("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 1H12V15H14C14.5523 15 15 14.5523 15 14V2C15 1.44772 14.5523 1 14 1ZM11 0V16H14C15.1046 16 16 15.1046 16 14V2C16 0.895431 15.1046 0 14 0H11Z",fill:"currentColor"}),_("path",{d:"M5 5H11V11H5V5Z",fill:"currentColor"}),_("path",{d:"M3 2.5C3 2.77614 2.77614 3 2.5 3C2.22386 3 2 2.77614 2 2.5C2 2.22386 2.22386 2 2.5 2C2.77614 2 3 2.22386 3 2.5Z",fill:"currentColor"}),_("path",{d:"M14 13.5C14 13.7761 13.7761 14 13.5 14C13.2239 14 13 13.7761 13 13.5C13 13.2239 13.2239 13 13.5 13C13.7761 13 14 13.2239 14 13.5Z",fill:"currentColor"})]});import{jsx as i2,jsxs as br}from"react/jsx-runtime";var xr=C=>br("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[i2("title",{children:"Boxing"}),i2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 7C10.5 7.27614 10.2761 7.5 10 7.5H5.5C4.67157 7.5 4 6.82843 4 6V5H3.5C3.22386 5 3 5.22386 3 5.5V7.09677C3 8.1479 3.8521 9 4.90323 9C5.50896 9 6 9.49104 6 10.0968V15H11V10.0952C11 9.49035 11.4904 9 12.0952 9C12.5949 9 13 8.59492 13 8.09524V3C13 1.89543 12.1046 1 11 1H7C5.89543 1 5 1.89543 5 3V6C5 6.27614 5.22386 6.5 5.5 6.5H10C10.2761 6.5 10.5 6.72386 10.5 7ZM3.5 4C2.67157 4 2 4.67157 2 5.5V7.09677C2 8.70018 3.29982 10 4.90323 10C4.95667 10 5 10.0433 5 10.0968V15C5 15.5523 5.44772 16 6 16H11C11.5523 16 12 15.5523 12 15V10.0952C12 10.0426 12.0426 10 12.0952 10C13.1472 10 14 9.14721 14 8.09524V3C14 1.34315 12.6569 0 11 0H7C5.34315 0 4 1.34315 4 3V4H3.5Z",fill:"currentColor"}),i2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 11C5.5 10.7239 5.72386 10.5 6 10.5C6.82843 10.5 7.5 11.1716 7.5 12C7.5 12.8284 6.82843 13.5 6 13.5C5.72386 13.5 5.5 13.2761 5.5 13C5.5 12.7239 5.72386 12.5 6 12.5C6.27614 12.5 6.5 12.2761 6.5 12C6.5 11.7239 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.2761 5.5 11Z",fill:"currentColor"}),i2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 13C11.5 13.2761 11.2761 13.5 11 13.5H10C9.17157 13.5 8.5 12.8284 8.5 12C8.5 11.1716 9.17157 10.5 10 10.5H11C11.2761 10.5 11.5 10.7239 11.5 11C11.5 11.2761 11.2761 11.5 11 11.5H10C9.72386 11.5 9.5 11.7239 9.5 12C9.5 12.2761 9.72386 12.5 10 12.5H11C11.2761 12.5 11.5 12.7239 11.5 13Z",fill:"currentColor"})]});import{jsx as n2,jsxs as Ir}from"react/jsx-runtime";var yr=C=>Ir("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[n2("title",{children:"Canoe"}),n2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.63737 6.84427C9.78345 6.99766 10.0109 7.04294 10.2043 6.95633C10.398 6.86958 10.5159 6.6698 10.4982 6.45829L10.4981 6.4569L10.4978 6.45315L10.4966 6.43927L10.4919 6.38698C10.4877 6.34157 10.4815 6.27555 10.473 6.19185C10.4561 6.0245 10.4303 5.78619 10.3945 5.50048C10.3233 4.93027 10.2119 4.16588 10.052 3.39802C9.89339 2.63689 9.68125 1.84321 9.39981 1.22917C9.25966 0.923383 9.08933 0.632837 8.87756 0.41186C8.66328 0.188261 8.36957 0 7.99997 0C7.63037 0 7.33665 0.188261 7.12237 0.41186C6.9106 0.632837 6.74028 0.923383 6.60012 1.22917C6.31869 1.84321 6.10655 2.63689 5.94798 3.39802C5.78801 4.16588 5.67667 4.93027 5.60539 5.50048C5.56968 5.78619 5.54386 6.0245 5.52692 6.19185C5.51845 6.27555 5.5122 6.34157 5.50804 6.38698L5.50334 6.43927L5.50215 6.45315L5.50174 6.45796C5.48411 6.66947 5.6019 6.86958 5.79561 6.95633C5.98924 7.04304 6.2165 6.99812 6.36257 6.84427L6.36735 6.83938C6.37234 6.83431 6.38068 6.82592 6.39218 6.81468C6.41522 6.79218 6.4507 6.75846 6.49699 6.71727C6.59008 6.63442 6.72417 6.52378 6.88633 6.41379C7.22345 6.18511 7.62223 6 7.99997 6C8.3777 6 8.77648 6.18511 9.11361 6.41379C9.27577 6.52378 9.40985 6.63442 9.50295 6.71727C9.54924 6.75846 9.58472 6.79218 9.60775 6.81468C9.61925 6.82592 9.6276 6.83431 9.63258 6.83938L9.63737 6.84427ZM6.6267 5.39905C7.00143 5.18825 7.47901 5 7.99997 5C8.52092 5 8.9985 5.18825 9.37323 5.39905C9.30418 4.87825 9.20565 4.23881 9.07298 3.60198C8.91905 2.86311 8.72494 2.15679 8.49075 1.64583C8.37309 1.38912 8.25826 1.21091 8.15557 1.10377C8.05608 0.999949 8.00605 0.999995 8.00008 1C7.99412 0.999995 7.94385 0.999949 7.84436 1.10377C7.74168 1.21091 7.62685 1.38912 7.50919 1.64583C7.275 2.15679 7.08089 2.86311 6.92696 3.60198C6.79428 4.23881 6.69575 4.87825 6.6267 5.39905ZM9.99997 6.5C10.4982 6.45848 10.4982 6.45829 10.4982 6.45829L9.99997 6.5ZM5.50174 6.45796C5.50174 6.45796 5.50169 6.45848 5.99997 6.5L5.50174 6.45796ZM9.63737 6.84427L9.99997 6.5C9.63719 6.84409 9.63737 6.84427 9.63737 6.84427Z",fill:"currentColor"}),n2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.4983 9.54204C10.5159 9.33053 10.3981 9.13042 10.2044 9.04367C10.0108 8.95696 9.7835 9.00188 9.63743 9.15573L9.63265 9.16062L9.62075 9.17258L9.60782 9.18532C9.58478 9.20782 9.5493 9.24154 9.50301 9.28273C9.40992 9.36557 9.27584 9.47622 9.11368 9.58621C8.77655 9.81489 8.37777 10 8.00003 10C7.6223 10 7.22352 9.81489 6.88639 9.58621C6.72423 9.47622 6.59015 9.36557 6.49705 9.28273C6.45076 9.24154 6.41528 9.20782 6.39225 9.18532C6.38075 9.17408 6.37241 9.16569 6.36742 9.16062L6.36263 9.15573C6.21655 9.00234 5.98906 8.95706 5.79567 9.04367C5.60197 9.13042 5.48415 9.3302 5.50178 9.54171L5.50221 9.54685L5.50341 9.56073L5.5081 9.61302C5.51226 9.65843 5.51852 9.72445 5.52699 9.80815C5.54392 9.9755 5.56974 10.2138 5.60546 10.4995C5.67673 11.0697 5.78807 11.8341 5.94804 12.602C6.10661 13.3631 6.31875 14.1568 6.60019 14.7708C6.74034 15.0766 6.91067 15.3672 7.12244 15.5881C7.33672 15.8117 7.63043 16 8.00003 16C8.36963 16 8.66335 15.8117 8.87763 15.5881C9.0894 15.3672 9.25972 15.0766 9.39988 14.7708C9.68131 14.1568 9.89345 13.3631 10.052 12.602C10.212 11.8341 10.3233 11.0697 10.3946 10.4995C10.4303 10.2138 10.4561 9.9755 10.4731 9.80815C10.4815 9.72445 10.4878 9.65843 10.492 9.61302L10.4967 9.56073L10.4979 9.54685L10.4983 9.54204ZM9.3733 10.601C8.99857 10.8118 8.52099 11 8.00003 11C7.47908 11 7.0015 10.8118 6.62677 10.601C6.69582 11.1217 6.79435 11.7612 6.92702 12.398C7.08095 13.1369 7.27506 13.8432 7.50925 14.3542C7.62691 14.6109 7.74174 14.7891 7.84443 14.8962C7.94392 15.0001 7.99395 15 7.99992 15C8.00588 15 8.05615 15.0001 8.15564 14.8962C8.25832 14.7891 8.37315 14.6109 8.49081 14.3542C8.725 13.8432 8.91911 13.1369 9.07304 12.398C9.20572 11.7612 9.30425 11.1217 9.3733 10.601ZM6.00003 9.5C5.50176 9.54152 5.50178 9.54171 5.50178 9.54171L6.00003 9.5ZM10.4983 9.54204C10.4983 9.54204 10.4983 9.54152 10 9.5L10.4983 9.54204ZM6.00003 9.5C6.36281 9.15591 6.36263 9.15573 6.36263 9.15573L6.00003 9.5Z",fill:"currentColor"}),n2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 7.5C3.97174 7.5 3.94403 7.50234 3.91705 7.50685C3.71308 6.92068 3.15567 6.5 2.5 6.5L0.5 6.5C0.223858 6.5 0 6.72386 0 7V9C0 9.27614 0.223858 9.5 0.5 9.5H2.5C3.15567 9.5 3.71308 9.07932 3.91705 8.49315C3.94403 8.49766 3.97174 8.5 4 8.5H12C12.0283 8.5 12.056 8.49766 12.083 8.49315C12.2869 9.07932 12.8443 9.5 13.5 9.5H15.5C15.7761 9.5 16 9.27614 16 9V7C16 6.72386 15.7761 6.5 15.5 6.5H13.5C12.8443 6.5 12.2869 6.92068 12.083 7.50685C12.056 7.50234 12.0283 7.5 12 7.5H4ZM2.5 8.5C2.77614 8.5 3 8.27614 3 8C3 7.72386 2.77614 7.5 2.5 7.5L1 7.5V8.5H2.5ZM13 8C13 7.72386 13.2239 7.5 13.5 7.5H15V8.5H13.5C13.2239 8.5 13 8.27614 13 8Z",fill:"currentColor"})]});import{jsx as s6,jsxs as kr}from"react/jsx-runtime";var Br=C=>kr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[s6("title",{children:"Climbing"}),s6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.0509 1.93749C12.6527 1.14093 11.5234 0.73038 10.1525 1.18731C8.17722 1.84576 5.51355 3.17855 3.96026 3.99316C3.40699 4.28331 3.10597 4.89972 3.21071 5.52816L3.42997 6.84376L4.24998 6.63876L4.12665 5.99602C4.00788 5.377 4.29217 4.74083 4.88465 4.45256C6.11063 3.85605 8.7425 2.64792 10.3763 1.90176C11.3721 1.44694 12.4974 2.17755 12.4974 3.26776V12.2271C12.4974 13.0566 11.825 13.729 10.9955 13.729H6.99036C6.29173 13.729 5.70451 13.252 5.53662 12.6059L4.57334 12.8467L4.94911 13.7862C5.1772 14.3564 5.72947 14.7303 6.34361 14.7303L11.9968 14.7303C12.8263 14.7303 13.4987 14.0579 13.4987 13.2284V4.21721L13.4987 4.21515L13.4986 4.20516C13.4985 4.1958 13.4983 4.18116 13.4979 4.16171C13.497 4.12279 13.4952 4.06478 13.4915 3.99151C13.4842 3.84464 13.4694 3.63828 13.44 3.4028C13.3798 2.92083 13.2632 2.36194 13.0509 1.93749ZM14.5 4.21683V4.21442L14.5 4.20983L14.4998 4.19428C14.4997 4.18114 14.4994 4.16254 14.4989 4.13896C14.4978 4.09183 14.4957 4.02469 14.4916 3.94151C14.4833 3.77548 14.4667 3.54377 14.4336 3.27861C14.3686 2.75929 14.2349 2.06656 13.9465 1.48971C13.2388 0.0742808 11.4689 -0.306931 9.83591 0.237414C7.77484 0.924436 5.04612 2.29307 3.49522 3.10642C2.54809 3.60313 2.04926 4.65006 2.22305 5.69277L2.45548 7.08737L1.95516 7.21245C1.64405 7.29023 1.44887 7.59864 1.51177 7.9131L2.47373 12.7229C2.541 13.0593 2.87577 13.2711 3.20854 13.1879L3.59296 13.0918L4.01944 14.158C4.39959 15.1084 5.32004 15.7316 6.3436 15.7316L11.9968 15.7316C13.3793 15.7316 14.5 14.6109 14.5 13.2284L14.5 4.21683ZM6.50839 12.363C6.5676 12.5734 6.76096 12.7277 6.99036 12.7277H10.9955C11.272 12.7277 11.4962 12.5036 11.4962 12.2271V3.26776C11.4962 2.90196 11.1208 2.66248 10.7922 2.81255C9.15446 3.56054 6.53526 4.76295 5.32273 5.35292C5.16268 5.43079 5.07107 5.60448 5.11 5.80734L5.22286 6.39554L5.7658 6.25981C6.09857 6.17662 6.43334 6.38847 6.50061 6.72482L7.46257 11.5346C7.52546 11.8491 7.33029 12.1575 7.01918 12.2353L6.50839 12.363ZM5.60115 7.33307L2.5685 8.09122L2.87256 9.61149L5.9052 8.85333L5.60115 7.33307ZM6.10179 9.83628L3.06915 10.5944L3.37319 12.1147L6.40584 11.3565L6.10179 9.83628Z",fill:"currentColor"})]});import{jsx as c6,jsxs as Fr}from"react/jsx-runtime";var Er=C=>Fr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[c6("title",{children:"CollegeBasketball"}),c6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8V8.5H8.5V14.9751C9.18379 14.9108 9.90227 14.7316 10.2843 14.5489C10.5334 14.4298 10.8319 14.5352 10.9511 14.7843C11.0702 15.0334 10.9648 15.3319 10.7157 15.4511C10.079 15.7556 8.9234 16 8 16C3.73001 16 0 12.4244 0 8ZM7.5 14.9812V8.5H5.97765C5.82651 10.1625 4.93378 11.2683 4.05891 11.9557C3.62787 12.2943 3.19876 12.5343 2.85833 12.6958C4.04945 13.9908 5.70509 14.846 7.5 14.9812ZM2.21561 11.8882C2.25485 11.8717 2.29669 11.8535 2.34079 11.8335C2.64238 11.6971 3.04291 11.4822 3.44109 11.1693C4.14314 10.6177 4.82822 9.77289 4.97234 8.5H1.01837C1.1103 9.74736 1.5427 10.9055 2.21561 11.8882ZM1.01758 7.5H4.97234C4.82823 6.2271 4.14315 5.38227 3.44109 4.83066C3.04291 4.5178 2.64238 4.30292 2.34079 4.16649C2.28558 4.14151 2.23392 4.11927 2.18646 4.09963C1.52444 5.08443 1.10604 6.24667 1.01758 7.5ZM2.82351 3.28782C3.16923 3.44929 3.61304 3.69401 4.05891 4.04434C4.93378 4.73173 5.82652 5.8375 5.97765 7.5H7.5V1.01758C5.65022 1.14813 3.99888 1.99739 2.82351 3.28782ZM8.5 1.01758V7.5H10.0224C10.1735 5.8375 11.0662 4.73173 11.9411 4.04434C12.387 3.69401 12.8308 3.44929 13.1765 3.28782C12.0011 1.99739 10.3498 1.14813 8.5 1.01758ZM13.8135 4.09963C13.7661 4.11928 13.7144 4.14151 13.6592 4.16649C13.3576 4.30292 12.9571 4.5178 12.5589 4.83066C11.8569 5.38227 11.1718 6.2271 11.0277 7.5H14.9824C14.894 6.24667 14.4756 5.08444 13.8135 4.09963ZM1.86153 3.98044C1.86128 3.98037 1.86137 3.9804 1.86153 3.98044V3.98044ZM11.5 11.75C11.5 10.5074 12.5074 9.5 13.75 9.5H14.5C15.3284 9.5 16 10.1716 16 11V11.5C16 11.7761 15.7761 12 15.5 12C15.2239 12 15 11.7761 15 11.5V11C15 10.7239 14.7761 10.5 14.5 10.5H13.75C13.0596 10.5 12.5 11.0596 12.5 11.75V14C12.5 14.5523 12.9477 15 13.5 15H14.5C14.7761 15 15 14.7761 15 14.5C15 14.2239 15.2239 14 15.5 14C15.7761 14 16 14.2239 16 14.5C16 15.3284 15.3284 16 14.5 16H13.5C12.3954 16 11.5 15.1046 11.5 14V11.75Z",fill:"currentColor"})]});import{jsx as d2,jsxs as Dr}from"react/jsx-runtime";var Ar=C=>Dr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[d2("title",{children:"CollegeFootball"}),d2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5359 11.7515C11.5359 10.5093 12.5352 9.50226 13.768 9.50226H14.512C15.3338 9.50226 16 10.1736 16 11.0017V11.5016C16 11.7776 15.7779 12.0014 15.504 12.0014C15.2301 12.0014 15.008 11.7776 15.008 11.5016V11.0017C15.008 10.7257 14.7859 10.5019 14.512 10.5019H13.768C13.0831 10.5019 12.5279 11.0614 12.5279 11.7515V14.0007C12.5279 14.5528 12.9721 15.0003 13.5199 15.0003H14.512C14.7859 15.0003 15.008 14.7766 15.008 14.5005C15.008 14.2245 15.2301 14.0007 15.504 14.0007C15.7779 14.0007 16 14.2245 16 14.5005C16 15.3287 15.3338 16 14.512 16H13.5199C12.4242 16 11.5359 15.1049 11.5359 14.0007V11.7515Z",fill:"currentColor"}),d2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.447 1.00518C8.01894 1.05556 5.68818 1.4964 3.83787 3.35818C2.91753 4.28422 2.17109 5.68164 1.67185 7.18826C1.17349 8.69228 0.938613 10.2535 1.00222 11.4754C1.01721 11.7634 1.02518 12.026 1.03258 12.2699C1.04369 12.636 1.05352 12.9599 1.08389 13.2638C1.13458 13.771 1.23187 14.0238 1.35412 14.1468C1.7415 14.5366 2.28339 14.7578 2.93312 14.8758C3.58471 14.9942 4.29203 15.0004 4.9776 15.0003C6.28781 15.0002 7.48377 14.7603 8.35531 14.5184C8.78999 14.3977 9.1411 14.2773 9.38191 14.1877C9.50224 14.143 9.59482 14.1061 9.65629 14.0808L9.74376 14.0437M9.74376 14.0437C9.99406 13.9318 10.2872 14.0454 10.3984 14.2976C10.5096 14.5499 10.3969 14.8452 10.1465 14.9573L10.0314 15.0062C10.0314 15.0062 9.85696 15.0766 9.72528 15.1256C9.46204 15.2235 9.08413 15.3529 8.61882 15.4821C7.69041 15.7399 6.40263 15.9998 4.9777 16C4.30164 16.0001 3.5087 15.9962 2.75708 15.8596C2.00359 15.7227 1.23929 15.444 0.653174 14.8542C0.265583 14.4642 0.149556 13.8912 0.0968654 13.364C0.0638238 13.0334 0.0515136 12.6427 0.0389152 12.2429C0.0313929 12.0041 0.0237678 11.7621 0.0115657 11.5277C-0.0598708 10.1555 0.202009 8.4678 0.730904 6.87166C1.25894 5.27812 2.07027 3.72407 3.13693 2.65079C5.25936 0.515214 7.90999 0.0574015 10.4318 0.0056261L10.4419 0.00541866C10.6281 0.00541866 10.8186 0.00416867 11.0109 0.00280173C11.8131 -0.00290061 12.6477 -0.00883362 13.3447 0.0823124C13.7808 0.139339 14.2069 0.23867 14.5626 0.424481C14.929 0.615932 15.2385 0.910088 15.3831 1.34673C15.9113 2.94102 15.9063 4.64525 15.7787 5.92829C15.7146 6.57395 15.6183 7.12275 15.5379 7.5113C15.4976 7.70577 15.4612 7.86061 15.4345 7.96796L15.3907 8.13586L15.39 8.1387L15.3896 8.14C15.3142 8.40539 15.0396 8.55925 14.7762 8.48331C14.5129 8.40739 14.3605 8.1308 14.4357 7.86546L14.4375 7.85891L14.4446 7.83294C14.4509 7.80926 14.4603 7.77301 14.4722 7.72518C14.496 7.62947 14.5294 7.48754 14.5668 7.30713C14.6416 6.94593 14.7316 6.4326 14.7917 5.82868C14.9125 4.61257 14.9075 3.06792 14.4422 1.66328C14.3981 1.53033 14.3027 1.41473 14.106 1.31195C13.8985 1.20352 13.6031 1.12414 13.217 1.07365C12.5941 0.992184 11.8495 0.997155 11.0535 1.00247C10.8542 1.0038 10.6516 1.00515 10.447 1.00518",fill:"currentColor"}),d2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.89808 5.2966L14.3972 0.76282L15.0987 1.46968L10.5995 6.00346L12.2329 7.64935C12.4266 7.84454 12.4266 8.16101 12.2329 8.35621C12.0392 8.5514 11.7251 8.5514 11.5314 8.35621L9.89808 6.71033L8.6155 8.00277L10.2488 9.64865C10.4425 9.84385 10.4425 10.1603 10.2488 10.3555C10.0551 10.5507 9.74106 10.5507 9.54735 10.3555L7.91404 8.70963L6.63146 10.0021L8.26478 11.648C8.45848 11.8432 8.45848 12.1596 8.26478 12.3548C8.07107 12.55 7.75702 12.55 7.56331 12.3548L5.93 10.7089L1.53772 15.135L0.836253 14.4282L5.22854 10.0021L3.59523 8.35621C3.40153 8.16101 3.40153 7.84454 3.59523 7.64935C3.78894 7.45415 4.10299 7.45415 4.2967 7.64935L5.93 9.29522L7.21257 8.00277L5.57927 6.3569C5.38557 6.16171 5.38557 5.84523 5.57927 5.65004C5.77298 5.45484 6.08703 5.45484 6.28074 5.65004L7.91404 7.29591L9.19662 6.00346L7.56331 4.35759C7.36961 4.1624 7.36961 3.84593 7.56331 3.65073C7.75702 3.45554 8.07107 3.45554 8.26478 3.65073L9.89808 5.2966Z",fill:"currentColor"})]});import{jsx as g,jsxs as _r}from"react/jsx-runtime";var Tr=C=>_r("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[g("title",{children:"CoveredStadium"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.23714 1.07468C2.38455 0.983572 2.56861 0.97529 2.72361 1.05279L5.72361 2.55279C5.893 2.63748 6 2.81061 6 3C6 3.18939 5.893 3.36252 5.72361 3.44721L2.72361 4.94721C2.56861 5.02471 2.38455 5.01643 2.23714 4.92533C2.08973 4.83422 2 4.67329 2 4.5V1.5C2 1.32671 2.08973 1.16578 2.23714 1.07468ZM3 2.30902V3.69098L4.38197 3L3 2.30902Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.2371 1.07468C12.3845 0.983572 12.5686 0.97529 12.7236 1.05279L15.7236 2.55279C15.893 2.63748 16 2.81061 16 3C16 3.18939 15.893 3.36252 15.7236 3.44721L12.7236 4.94721C12.5686 5.02471 12.3845 5.01643 12.2371 4.92533C12.0897 4.83422 12 4.67329 12 4.5V1.5C12 1.32671 12.0897 1.16578 12.2371 1.07468ZM13 2.30902V3.69098L14.382 3L13 2.30902Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 4V6.5H2V4H3Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 4V6H12V4H13Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 16C1.44772 16 1 15.5523 1 15V10C1 9.44772 1.44772 9 2 9H14C14.5523 9 15 9.44772 15 10V15C15 15.5523 14.5523 16 14 16H2ZM2 10H14V15H2V10Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.2513 6.91782C2.36195 5.66833 4.38278 4.5 8 4.5C11.6172 4.5 13.6381 5.66833 14.7487 6.91782C15.2972 7.5349 15.6077 8.15418 15.7814 8.62322C15.8683 8.85779 15.9213 9.05559 15.9529 9.19818C15.9688 9.26953 15.9794 9.32724 15.9862 9.36904C15.9896 9.38995 15.992 9.4069 15.9938 9.41961L15.9958 9.43548L15.9965 9.44096L15.9968 9.44308C15.9968 9.44349 15.9969 9.44479 15.5 9.5L15.9969 9.44479C16.0126 9.58614 15.9674 9.72749 15.8726 9.83346C15.7777 9.93944 15.6422 10 15.5 10H0.500002C0.357781 10 0.222289 9.93944 0.127438 9.83346C0.0325878 9.72749 -0.0126452 9.58614 0.00306056 9.44479L0.500002 9.5C0.00306058 9.44479 0.00301479 9.44519 0.00306056 9.44479L0.00325237 9.44308L0.00349785 9.44096L0.0041589 9.43548L0.0062245 9.41961C0.0079558 9.4069 0.0104292 9.38995 0.0138365 9.36904C0.0206489 9.32724 0.0312096 9.26953 0.0470651 9.19818C0.0787511 9.05559 0.131751 8.85779 0.218628 8.62322C0.392347 8.15418 0.702781 7.5349 1.2513 6.91782ZM0.996624 9.558C0.99657 9.55847 0.996617 9.55806 0.996624 9.558V9.558ZM1.1456 9C1.14911 8.99027 1.1527 8.98045 1.15638 8.97053C1.29516 8.59582 1.54722 8.0901 1.99871 7.58218C2.88805 6.58167 4.61723 5.5 8 5.5C11.3828 5.5 13.112 6.58167 14.0013 7.58218C14.4528 8.0901 14.7048 8.59582 14.8436 8.97053C14.8473 8.98045 14.8509 8.99027 14.8544 9H1.1456Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 12.5C6 12.2239 6.22386 12 6.5 12H9.5C9.77614 12 10 12.2239 10 12.5V15.5H9V13H7V15.5H6V12.5Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.49148 9.40806C4.49143 9.40779 4.49137 9.40751 4 9.5C3.50863 9.59249 3.50858 9.59219 3.50852 9.59188L3.50811 9.58966L3.50741 9.58583L3.50558 9.57523C3.50417 9.56687 3.50242 9.55593 3.50045 9.54253C3.4965 9.51572 3.49167 9.479 3.48698 9.43324C3.47761 9.34178 3.46875 9.21373 3.46875 9.05615C3.46875 8.74145 3.50409 8.3055 3.64346 7.80683C3.92532 6.79829 4.62453 5.56576 6.2382 4.57402L6.7618 5.42598C5.37548 6.278 4.82469 7.29547 4.60655 8.07599C4.49592 8.47185 4.46875 8.81519 4.46875 9.05615C4.46875 9.17641 4.47552 9.27029 4.48177 9.33129C4.48489 9.36176 4.48788 9.3839 4.48979 9.39691L4.49174 9.40942L4.49148 9.40806Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5085 9.40806C11.5086 9.40779 11.5086 9.40751 12 9.5C12.4914 9.59249 12.4914 9.59219 12.4915 9.59188L12.4919 9.58966L12.4926 9.58583L12.4944 9.57523C12.4958 9.56687 12.4976 9.55593 12.4996 9.54253C12.5035 9.51572 12.5083 9.479 12.513 9.43324C12.5224 9.34178 12.5313 9.21373 12.5313 9.05615C12.5313 8.74145 12.4959 8.3055 12.3566 7.80683C12.0747 6.79829 11.3755 5.56576 9.7618 4.57402L9.2382 5.42598C10.6245 6.278 11.1753 7.29547 11.3935 8.07599C11.5041 8.47185 11.5313 8.81519 11.5313 9.05615C11.5313 9.17641 11.5245 9.27029 11.5182 9.33129C11.5151 9.36176 11.5121 9.3839 11.5102 9.39691L11.5083 9.40942L11.5085 9.40806Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 5V9.5H7.5V5H8.5Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 10V15.5H4V10H5Z",fill:"currentColor"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 10V15.5H11V10H12Z",fill:"currentColor"})]});import{jsx as c,jsxs as Or}from"react/jsx-runtime";var Wr=C=>Or("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[c("title",{children:"Cricket"}),c("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),c("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0.5C8.27614 0.5 8.5 0.723858 8.5 1V15C8.5 15.2761 8.27614 15.5 8 15.5C7.72386 15.5 7.5 15.2761 7.5 15V1C7.5 0.723858 7.72386 0.5 8 0.5Z",fill:"currentColor"}),c("path",{d:"M7 3C7 3.27614 6.77614 3.5 6.5 3.5C6.22386 3.5 6 3.27614 6 3C6 2.72386 6.22386 2.5 6.5 2.5C6.77614 2.5 7 2.72386 7 3Z",fill:"currentColor"}),c("path",{d:"M10 3C10 3.27614 9.77614 3.5 9.5 3.5C9.22386 3.5 9 3.27614 9 3C9 2.72386 9.22386 2.5 9.5 2.5C9.77614 2.5 10 2.72386 10 3Z",fill:"currentColor"}),c("path",{d:"M7 5C7 5.27614 6.77614 5.5 6.5 5.5C6.22386 5.5 6 5.27614 6 5C6 4.72386 6.22386 4.5 6.5 4.5C6.77614 4.5 7 4.72386 7 5Z",fill:"currentColor"}),c("path",{d:"M10 5C10 5.27614 9.77614 5.5 9.5 5.5C9.22386 5.5 9 5.27614 9 5C9 4.72386 9.22386 4.5 9.5 4.5C9.77614 4.5 10 4.72386 10 5Z",fill:"currentColor"}),c("path",{d:"M7 7C7 7.27614 6.77614 7.5 6.5 7.5C6.22386 7.5 6 7.27614 6 7C6 6.72386 6.22386 6.5 6.5 6.5C6.77614 6.5 7 6.72386 7 7Z",fill:"currentColor"}),c("path",{d:"M10 7C10 7.27614 9.77614 7.5 9.5 7.5C9.22386 7.5 9 7.27614 9 7C9 6.72386 9.22386 6.5 9.5 6.5C9.77614 6.5 10 6.72386 10 7Z",fill:"currentColor"}),c("path",{d:"M7 9C7 9.27614 6.77614 9.5 6.5 9.5C6.22386 9.5 6 9.27614 6 9C6 8.72386 6.22386 8.5 6.5 8.5C6.77614 8.5 7 8.72386 7 9Z",fill:"currentColor"}),c("path",{d:"M10 9C10 9.27614 9.77614 9.5 9.5 9.5C9.22386 9.5 9 9.27614 9 9C9 8.72386 9.22386 8.5 9.5 8.5C9.77614 8.5 10 8.72386 10 9Z",fill:"currentColor"}),c("path",{d:"M7 11C7 11.2761 6.77614 11.5 6.5 11.5C6.22386 11.5 6 11.2761 6 11C6 10.7239 6.22386 10.5 6.5 10.5C6.77614 10.5 7 10.7239 7 11Z",fill:"currentColor"}),c("path",{d:"M10 11C10 11.2761 9.77614 11.5 9.5 11.5C9.22386 11.5 9 11.2761 9 11C9 10.7239 9.22386 10.5 9.5 10.5C9.77614 10.5 10 10.7239 10 11Z",fill:"currentColor"}),c("path",{d:"M7 13C7 13.2761 6.77614 13.5 6.5 13.5C6.22386 13.5 6 13.2761 6 13C6 12.7239 6.22386 12.5 6.5 12.5C6.77614 12.5 7 12.7239 7 13Z",fill:"currentColor"}),c("path",{d:"M10 13C10 13.2761 9.77614 13.5 9.5 13.5C9.22386 13.5 9 13.2761 9 13C9 12.7239 9.22386 12.5 9.5 12.5C9.77614 12.5 10 12.7239 10 13Z",fill:"currentColor"})]});import{jsx as f6,jsxs as Ur}from"react/jsx-runtime";var Nr=C=>Ur("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[f6("title",{children:"CricketField"}),f6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 16C3.44772 16 3 15.5523 3 15V1C3 0.447715 3.44772 0 4 0H12C12.5523 0 13 0.447715 13 1V15C13 15.5523 12.5523 16 12 16H4ZM8.5 3H7.5V1H8.5V3ZM9.5 3V1H12V3H9.5ZM4 4L4 12H12V4H4ZM8.5 13H7.5V15H8.5V13ZM9.5 15V13H12V15H9.5ZM4 13H6.5V15H4V13ZM6.5 1V3H4V1H6.5Z",fill:"currentColor"})]});import{jsx as u5,jsxs as Kr}from"react/jsx-runtime";var Jr=C=>Kr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[u5("title",{children:"Crossfit"}),u5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.3137 15 14 12.3137 14 8.99998C14 5.78147 11.414 3.5 8 3.5C4.58602 3.5 2 5.78147 2 8.99998C2 12.3137 4.68629 15 8 15ZM8 16C11.866 16 15 12.866 15 8.99998C15 5.13399 11.866 2.5 8 2.5C4.13401 2.5 1 5.13399 1 8.99998C1 12.866 4.13401 16 8 16Z",fill:"currentColor"}),u5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.6344 1.34423C5.02942 1.56688 4.6427 1.87889 4.43535 2.24593C4.33799 2.41827 4.32935 2.53302 4.33687 2.60219C4.34486 2.67558 4.37663 2.7462 4.43194 2.81688C4.48876 2.8895 4.56135 2.95004 4.62549 2.99408C4.65636 3.01529 4.68231 3.03064 4.69889 3.03989C4.7071 3.04447 4.71276 3.04741 4.71528 3.04869L5.1651 3.25991L4.15313 3.8731C4.15313 3.8731 3.78317 3.6105 3.64437 3.43312C3.50407 3.2538 3.37554 3.01192 3.34274 2.71031C3.30947 2.40448 3.37957 2.08173 3.56468 1.75407C3.92226 1.12111 4.53539 0.683122 5.28902 0.405768C6.04117 0.128959 6.96293 0 7.99969 0C9.03596 0 9.97342 0.128851 10.7332 0.405097C11.4903 0.680386 12.1197 1.12143 12.4472 1.77639C12.6113 2.10465 12.666 2.42225 12.629 2.71827C12.5924 3.01056 12.471 3.24695 12.3375 3.425C12.2053 3.6013 12.0553 3.72859 11.9425 3.81062C11.8852 3.85234 11.2764 4.17082 11.2764 4.17082L10.8292 3.27639L11.2727 3.05462C11.2748 3.05349 11.2799 3.0507 11.2871 3.04642C11.302 3.03759 11.3258 3.02266 11.3544 3.00188C11.4134 2.95891 11.4822 2.8987 11.5375 2.825C11.5915 2.75305 11.6263 2.67694 11.6367 2.59423C11.6466 2.51525 11.6387 2.39535 11.5528 2.22361C11.3803 1.87857 11.0095 1.56961 10.3915 1.3449C9.77608 1.12115 8.96338 1 7.99969 1C7.03647 1 6.24086 1.12104 5.6344 1.34423Z",fill:"currentColor"}),u5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.94721 5.27639C6.07039 5.52275 5.97111 5.82217 5.72552 5.94625L5.71568 5.95149C5.70606 5.9567 5.68982 5.96571 5.66791 5.97862C5.62402 6.00448 5.55775 6.04578 5.47651 6.10332C5.31348 6.2188 5.09362 6.39728 4.8737 6.64468C4.43761 7.13529 4 7.8964 4 9C4 10.1036 4.43761 10.8647 4.8737 11.3553C5.09362 11.6027 5.31348 11.7812 5.47651 11.8967C5.55775 11.9542 5.62402 11.9955 5.66791 12.0214C5.68982 12.0343 5.70606 12.0433 5.71568 12.0485L5.725 12.0535L5.72402 12.053C5.97071 12.1766 6.07064 12.4768 5.94721 12.7236C5.82372 12.9706 5.52338 13.0707 5.27639 12.9472L5.5 12.5C5.27639 12.9472 5.27639 12.9472 5.27639 12.9472L5.27427 12.9461L5.27142 12.9447L5.26353 12.9406L5.2394 12.9278C5.21972 12.9171 5.19299 12.9022 5.16022 12.8829C5.09473 12.8443 5.00475 12.788 4.89849 12.7127C4.68652 12.5626 4.40638 12.3348 4.1263 12.0197C3.56239 11.3853 3 10.3964 3 9C3 7.6036 3.56239 6.61471 4.1263 5.98032C4.40638 5.66522 4.68652 5.43745 4.89849 5.2873C5.00475 5.21203 5.09473 5.15567 5.16022 5.11708C5.19299 5.09777 5.21972 5.08285 5.2394 5.0722L5.26353 5.05937L5.27142 5.0553L5.27427 5.05385L5.27543 5.05327L5.27639 5.05275C5.52338 4.92926 5.82372 5.0294 5.94721 5.27639Z",fill:"currentColor"}),u5("path",{d:"M8 13.5C8 13.7761 7.77614 14 7.5 14C7.22386 14 7 13.7761 7 13.5C7 13.2239 7.22386 13 7.5 13C7.77614 13 8 13.2239 8 13.5Z",fill:"currentColor"})]});import{jsx as h6,jsxs as zr}from"react/jsx-runtime";var qr=C=>zr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[h6("title",{children:"Cycling"}),h6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 3.5C11.2761 3.5 11.5 3.27614 11.5 3C11.5 2.72386 11.2761 2.5 11 2.5C10.7239 2.5 10.5 2.72386 10.5 3C10.5 3.27614 10.7239 3.5 11 3.5ZM11 4.5C11.8284 4.5 12.5 3.82843 12.5 3C12.5 2.17157 11.8284 1.5 11 1.5C10.1716 1.5 9.5 2.17157 9.5 3C9.5 3.82843 10.1716 4.5 11 4.5ZM5 12C5 13.1046 4.10457 14 3 14C1.89543 14 1 13.1046 1 12C1 10.8954 1.89543 10 3 10C4.10457 10 5 10.8954 5 12ZM6 12C6 13.6569 4.65685 15 3 15C1.34315 15 0 13.6569 0 12C0 10.3431 1.34315 9 3 9C4.65685 9 6 10.3431 6 12ZM15 12C15 13.1046 14.1046 14 13 14C11.8954 14 11 13.1046 11 12C11 10.8954 11.8954 10 13 10C14.1046 10 15 10.8954 15 12ZM16 12C16 13.6569 14.6569 15 13 15C11.3431 15 10 13.6569 10 12C10 10.3431 11.3431 9 13 9C14.6569 9 16 10.3431 16 12ZM10.4851 4.87874C10.4483 4.7316 10.3467 4.60912 10.2089 4.54574C10.0712 4.48237 9.91205 4.48496 9.7764 4.55279L4.7764 7.05289C4.59198 7.1451 4.48307 7.34107 4.50216 7.54637C4.52124 7.75168 4.66439 7.92421 4.86265 7.98086L7.95074 8.86317L7.50387 12.4381C7.46962 12.7121 7.66398 12.962 7.93799 12.9962C8.212 13.0305 8.4619 12.8361 8.49615 12.5621L8.99615 8.56211C9.02673 8.31748 8.87442 8.08706 8.63737 8.01933L6.37329 7.37245L9.66611 5.72598L10.0149 7.12136C10.0471 7.25001 10.129 7.36061 10.2428 7.42884C10.3565 7.49707 10.4926 7.51733 10.6213 7.48517L12.6213 6.98517C12.8892 6.91819 13.0521 6.64673 12.9851 6.37883C12.9181 6.11093 12.6466 5.94805 12.3787 6.01503L10.8638 6.39376L10.4851 4.87874Z",fill:"currentColor"})]});import{jsx as p2,jsxs as Yr}from"react/jsx-runtime";var Xr=C=>Yr("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[p2("title",{children:"DartBoard"}),p2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9ZM8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z",fill:"currentColor"}),p2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),p2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 12C10.2091 12 12 10.2091 12 8C12 5.79086 10.2091 4 8 4C5.79086 4 4 5.79086 4 8C4 10.2091 5.79086 12 8 12ZM8 13C10.7614 13 13 10.7614 13 8C13 5.23858 10.7614 3 8 3C5.23858 3 3 5.23858 3 8C3 10.7614 5.23858 13 8 13Z",fill:"currentColor"})]});import{jsx as a6,jsxs as $r}from"react/jsx-runtime";var Qr=C=>$r("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[a6("title",{children:"Darts"}),a6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.0481 0.175835C12.3377 -0.11375 12.8259 -0.0345277 13.009 0.331771L13.8724 2.0586L15.5993 2.92202C15.9656 3.10517 16.0448 3.59336 15.7552 3.88294L13.3912 6.24699C13.2493 6.38885 13.0459 6.45042 12.8492 6.41108L10.6644 5.97411L9.00005 7.63845V8.38997C9.00005 8.5491 8.93684 8.70172 8.82432 8.81424L5.8703 11.7683C5.80443 11.8341 5.72414 11.8837 5.63577 11.9132L4.3479 12.3425C4.32412 12.3504 4.30039 12.3568 4.2768 12.3617L0.853553 15.785C0.658291 15.9802 0.341709 15.9802 0.146447 15.785C-0.0488155 15.5897 -0.0488155 15.2731 0.146447 15.0778L3.56977 11.6545C3.57467 11.631 3.58104 11.6073 3.58896 11.5835L4.01825 10.2957C4.0477 10.2073 4.09733 10.127 4.16319 10.0612L7.11721 7.10713C7.22973 6.99461 7.38234 6.9314 7.54147 6.9314H8.29289L9.95705 5.26724L9.51996 3.08182C9.48062 2.8851 9.54219 2.68174 9.68405 2.53989L12.0481 0.175835ZM12.3628 1.27536L10.5425 3.09562L10.9247 5.00636L12.8354 5.38851L14.6557 3.56826L13.306 2.8934C13.1898 2.83534 13.0957 2.74119 13.0376 2.62507L12.3628 1.27536ZM4.93707 10.7015L7.70716 7.9314H8.00005V8.22429L5.22996 10.9944L4.79062 11.1408L4.93707 10.7015Z",fill:"currentColor"})]});import{jsx as D1,jsxs as Ci}from"react/jsx-runtime";var jr=C=>Ci("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[D1("title",{children:"Diving"}),D1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3H10.5C10.7761 3 11 3.22386 11 3.5C11 3.77614 10.7761 4 10.5 4H5V16H4V15H1V16H0V3ZM1 7V10H4V7H1ZM4 6H1V4H4V6ZM4 11H1V14H4V11Z",fill:"currentColor"}),D1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 3.00031C1 3.00016 1 3 0.5 3C0 3 -8.93314e-08 3.00017 0 3L2.20545e-06 2.99841L1.08183e-05 2.99627L5.94259e-05 2.99032L0.000367552 2.97205C0.000699103 2.95713 0.00132793 2.93678 0.00251904 2.91176C0.00489491 2.86187 0.00954303 2.79267 0.018683 2.71041C0.0366807 2.54843 0.0733886 2.32369 0.150657 2.09189C0.29743 1.65157 0.667866 1 1.49999 1C2.33212 1 2.70256 1.65156 2.84933 2.09188C2.9266 2.32369 2.96331 2.54842 2.98131 2.7104C2.99045 2.79266 2.9951 2.86187 2.99748 2.91176C2.99867 2.93677 2.9993 2.95712 2.99963 2.97204L2.99994 2.99032L2.99999 2.99626L3 2.99841L3 2.99965C3 2.99983 3 2.99999 2.5 3C2 3.00001 2 3.00016 2 3.00031L1.99988 2.99427C1.99972 2.98722 1.99937 2.97534 1.99861 2.95933C1.99708 2.9272 1.99392 2.87921 1.98743 2.82085C1.97418 2.70158 1.94838 2.55131 1.90065 2.40812C1.79742 2.09844 1.66786 2 1.49999 2C1.33213 2 1.20257 2.09843 1.09934 2.40811C1.05161 2.55131 1.02582 2.70157 1.01257 2.82084C1.00608 2.87921 1.00292 2.92719 1.00139 2.95933C1.00063 2.97533 1.00028 2.98721 1.00012 2.99426L1 3.00031ZM0.999998 3.00145C0.999996 3.00164 0.999997 3.00157 0.999998 3.00145V3.00145Z",fill:"currentColor"}),D1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.00001 3.00031C5.00001 3.00016 5.00001 3 4.50001 3C4.00001 3 4.00001 2.99983 4.00001 2.99966L4.00001 2.99841L4.00002 2.99627L4.00007 2.99032L4.00038 2.97205C4.00071 2.95713 4.00134 2.93678 4.00253 2.91176C4.0049 2.86187 4.00955 2.79267 4.01869 2.71041C4.03669 2.54843 4.0734 2.32369 4.15066 2.09189C4.29744 1.65157 4.66787 1 5.5 1C6.33212 1 6.70256 1.65156 6.84934 2.09188C6.92661 2.32369 6.96332 2.54842 6.98132 2.7104C6.99046 2.79266 6.99511 2.86187 6.99749 2.91176C6.99868 2.93677 6.99931 2.95712 6.99964 2.97204L6.99995 2.99032L7 2.99626L7.00001 2.99841L7.00001 2.99965C7.00001 2.99983 7.00001 2.99999 6.50001 3C6.00001 3.00001 6.00001 3.00016 6.00001 3.00031L5.99989 2.99427C5.99973 2.98722 5.99938 2.97534 5.99862 2.95933C5.99709 2.9272 5.99392 2.87921 5.98744 2.82085C5.97419 2.70158 5.94839 2.55131 5.90066 2.40812C5.79743 2.09844 5.66787 2 5.5 2C5.33213 2 5.20257 2.09843 5.09935 2.40811C5.05162 2.55131 5.02583 2.70157 5.01257 2.82084C5.00609 2.87921 5.00293 2.92719 5.0014 2.95933C5.00063 2.97533 5.00029 2.98721 5.00013 2.99426L5.00001 3.00031Z",fill:"currentColor"}),D1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.6682 14.1259C14.8748 13.9427 15.1907 13.9616 15.374 14.1681C15.5573 14.3746 15.5384 14.6907 15.3319 14.874L15.1193 15.0494C14.9243 15.2094 15.1374 15.0341 15.1193 15.0494C15.083 15.0798 15.1837 14.9987 15.1193 15.0494C14.9909 15.1503 14.8093 15.2853 14.5969 15.4212C14.1979 15.6764 13.5918 16 13 16C12.3713 16 11.9624 15.636 11.6961 15.3989C11.6866 15.3904 11.6773 15.3821 11.6681 15.374C11.3701 15.1095 11.2221 15 11 15C10.7779 15 10.6299 15.1095 10.3319 15.374C10.3227 15.3821 10.3134 15.3904 10.3039 15.3989C10.0376 15.636 9.62868 16 9 16C8.37132 16 7.96243 15.636 7.69613 15.3989C7.68661 15.3904 7.67727 15.3821 7.66811 15.374C7.37008 15.1095 7.22208 15 7 15C6.78996 15 6.67825 15.0932 6.39007 15.3642C6.11474 15.6232 5.70799 16 5 16C4.72386 16 4.5 15.7761 4.5 15.5C4.5 15.2239 4.72386 15 5 15C5.29201 15 5.44864 14.8768 5.705 14.6358C5.71885 14.6227 5.73316 14.6091 5.74796 14.5951C5.99354 14.3618 6.37451 14 7 14C7.62868 14 8.03757 14.364 8.30387 14.6011C8.31339 14.6096 8.32273 14.6179 8.33189 14.626C8.62992 14.8905 8.77792 15 9 15C9.22208 15 9.37008 14.8905 9.66811 14.626C9.67727 14.6179 9.68661 14.6096 9.69613 14.6011C9.96243 14.364 10.3713 14 11 14C11.6287 14 12.0376 14.364 12.3039 14.6011C12.3134 14.6096 12.3227 14.6179 12.3319 14.626C12.6299 14.8905 12.7779 15 13 15C13.2815 15 13.6754 14.8236 14.058 14.5788C14.2364 14.4647 14.3911 14.3497 14.5013 14.2631C14.5562 14.22 14.5993 14.1845 14.6281 14.1603C14.6424 14.1482 14.6532 14.139 14.66 14.1331L14.6672 14.1269L14.6682 14.1259Z",fill:"currentColor"}),D1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.6682 12.1259C14.8748 11.9427 15.1907 11.9616 15.374 12.1681C15.5573 12.3746 15.5384 12.6907 15.3319 12.874C15.3218 12.8827 15.35 12.8587 15.3319 12.874C15.2956 12.9044 15.1837 12.9987 15.1193 13.0494C14.9909 13.1503 14.8093 13.2853 14.5969 13.4212C14.1979 13.6764 13.5918 14 13 14C12.3713 14 11.9624 13.636 11.6961 13.3989C11.6866 13.3904 11.6773 13.3821 11.6681 13.374C11.3701 13.1095 11.2221 13 11 13C10.7779 13 10.6299 13.1095 10.3319 13.374C10.3227 13.3821 10.3134 13.3904 10.3039 13.3989C10.0376 13.636 9.62868 14 9 14C8.37132 14 7.96243 13.636 7.69613 13.3989C7.68661 13.3904 7.67727 13.3821 7.66811 13.374C7.37008 13.1095 7.22208 13 7 13C6.78996 13 6.67825 13.0932 6.39007 13.3642C6.11474 13.6232 5.70799 14 5 14C4.72386 14 4.5 13.7761 4.5 13.5C4.5 13.2239 4.72386 13 5 13C5.29201 13 5.44864 12.8768 5.705 12.6358C5.71885 12.6227 5.73316 12.6091 5.74796 12.5951C5.99354 12.3618 6.37451 12 7 12C7.62868 12 8.03757 12.364 8.30387 12.6011C8.31339 12.6096 8.32273 12.6179 8.33189 12.626C8.62992 12.8905 8.77792 13 9 13C9.22208 13 9.37008 12.8905 9.66811 12.626C9.67727 12.6179 9.68661 12.6096 9.69613 12.6011C9.96243 12.364 10.3713 12 11 12C11.6287 12 12.0376 12.364 12.3039 12.6011C12.3134 12.6096 12.3227 12.6179 12.3319 12.626C12.6299 12.8905 12.7779 13 13 13C13.2815 13 13.6754 12.8236 14.058 12.5788C14.2364 12.4647 14.3911 12.3497 14.5013 12.2631C14.5562 12.22 14.5993 12.1845 14.6281 12.1603C14.6424 12.1482 14.6532 12.139 14.66 12.1331L14.6672 12.1269L14.6682 12.1259Z",fill:"currentColor"})]});import{jsx as s1,jsxs as oi}from"react/jsx-runtime";var ei=C=>oi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[s1("title",{children:"ESports"}),s1("path",{d:"M4.5 4.5C4.77614 4.5 5 4.72386 5 5V6H6C6.27614 6 6.5 6.22386 6.5 6.5C6.5 6.77614 6.27614 7 6 7H5V8C5 8.27614 4.77614 8.5 4.5 8.5C4.22386 8.5 4 8.27614 4 8V7H3C2.72386 7 2.5 6.77614 2.5 6.5C2.5 6.22386 2.72386 6 3 6H4V5C4 4.72386 4.22386 4.5 4.5 4.5Z",fill:"currentColor"}),s1("path",{d:"M12 4.5C12 4.77614 11.7761 5 11.5 5C11.2239 5 11 4.77614 11 4.5C11 4.22386 11.2239 4 11.5 4C11.7761 4 12 4.22386 12 4.5Z",fill:"currentColor"}),s1("path",{d:"M11.5 9C11.7761 9 12 8.77614 12 8.5C12 8.22386 11.7761 8 11.5 8C11.2239 8 11 8.22386 11 8.5C11 8.77614 11.2239 9 11.5 9Z",fill:"currentColor"}),s1("path",{d:"M11 6.5C11 6.77614 10.7761 7 10.5 7C10.2239 7 10 6.77614 10 6.5C10 6.22386 10.2239 6 10.5 6C10.7761 6 11 6.22386 11 6.5Z",fill:"currentColor"}),s1("path",{d:"M12.5 7C12.7761 7 13 6.77614 13 6.5C13 6.22386 12.7761 6 12.5 6C12.2239 6 12 6.22386 12 6.5C12 6.77614 12.2239 7 12.5 7Z",fill:"currentColor"}),s1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.49998 11H6.5C6.29876 11 6.08816 11.1515 5.87387 11.562C5.71507 11.8662 5.61771 12.1874 5.53979 12.4445C5.51643 12.5216 5.49479 12.593 5.4738 12.6563L4.99887 12.5L5.47343 12.6575L5.4657 12.6811C5.34654 13.0458 5.16266 13.6084 4.81455 14.0788C4.43876 14.5866 3.86177 15 2.99999 15C2.17935 15 1.42614 14.5147 0.898945 13.8828C0.365958 13.244 0 12.3836 0 11.5C0.000566572 10.9667 0.140492 9.25993 0.349762 7.53715C0.455046 6.67042 0.579286 5.78763 0.714948 5.03324C0.847017 4.29883 0.998002 3.6369 1.16948 3.23852L1.16733 3.2438L1.63058 3.43194L1.17184 3.23306L1.16948 3.23852C1.78588 1.72818 3.37495 1 5 1H10.9989C12.6241 1 14.2093 1.71846 14.8301 3.23838C15.0008 3.63472 15.1515 4.29577 15.2833 5.02944C15.4189 5.78335 15.5433 6.66638 15.6488 7.53365C15.8586 9.25739 15.9994 10.9661 16 11.4995C16 12.3772 15.6517 13.2377 15.1235 13.8801C14.5989 14.518 13.8444 15 13 15C12.1385 15 11.5609 14.586 11.1846 14.0786C10.8339 13.6057 10.6493 13.0402 10.5302 12.6756L10.5243 12.6575C10.5036 12.5951 10.4822 12.5243 10.459 12.4474C10.3823 12.1935 10.2854 11.8724 10.1265 11.5668C9.91107 11.1526 9.69949 11 9.49998 11ZM5 2C3.62694 2 2.50511 2.6074 2.09383 3.62008L2.08945 3.63088C1.96913 3.9084 1.8332 4.46488 1.69916 5.21023C1.56811 5.93897 1.4465 6.80128 1.34246 7.65774C1.13313 9.38103 1.00054 11.0332 1 11.5003C1.00008 12.1166 1.26127 12.7561 1.6668 13.2422C2.07819 13.7353 2.57497 14 2.99999 14C3.48551 14 3.78526 13.7886 4.01073 13.4839C4.2556 13.153 4.39714 12.7313 4.52365 12.3445L4.52431 12.3425C4.53516 12.3098 4.54906 12.2635 4.56612 12.2067C4.64141 11.9559 4.77837 11.4996 4.9874 11.0992C5.2362 10.6226 5.70124 10 6.5 10H9.49964C10.3001 10 10.7659 10.6289 11.0137 11.1055C11.2227 11.5074 11.3594 11.9646 11.4331 12.211C11.4497 12.2666 11.4631 12.3114 11.4734 12.3425L11.4741 12.3447C11.5999 12.7297 11.7423 13.1518 11.9878 13.4829C12.2143 13.7883 12.515 14 13 14C13.455 14 13.9505 13.732 14.3511 13.2449C14.7479 12.7624 14.9998 12.1226 15 11.5005C14.9995 11.0339 14.866 9.37935 14.6561 7.65445C14.5518 6.79739 14.4301 5.93475 14.2991 5.20638C14.1652 4.46118 14.0298 3.90607 13.9104 3.63101L13.9057 3.62027C13.4906 2.59908 12.374 2 10.9989 2H5Z",fill:"currentColor"})]});import{jsx as s2,jsxs as ti}from"react/jsx-runtime";var li=C=>ti("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[s2("title",{children:"Fencing"}),s2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8536 0.146447C16.0488 0.341709 16.0488 0.658291 15.8536 0.853553L5.49257 11.2145C6.36406 12.2321 6.31818 13.7653 5.35493 14.7286C5.10208 14.9814 4.69211 14.9814 4.43926 14.7286L3.2089 13.4982L0.853553 15.8536C0.658291 16.0488 0.341709 16.0488 0.146447 15.8536C-0.0488155 15.6583 -0.0488155 15.3417 0.146447 15.1464L2.50179 12.7911L1.45772 11.747C1.20486 11.4942 1.20486 11.0842 1.45771 10.8313C2.35667 9.93239 3.75207 9.83243 4.76143 10.5315L15.1464 0.146447C15.3417 -0.0488155 15.6583 -0.0488155 15.8536 0.146447ZM4.64782 11.773L4.4133 11.5385C3.87807 11.0032 3.05616 10.9294 2.44182 11.3169L4.86936 13.7445C5.25691 13.1301 5.18306 12.3082 4.64782 11.773Z",fill:"currentColor"}),s2("path",{d:"M0.853553 0.146447C0.658291 -0.0488155 0.341709 -0.0488155 0.146447 0.146447C-0.0488155 0.341709 -0.0488155 0.658291 0.146447 0.853553L6.64645 7.35355C6.84171 7.54882 7.15829 7.54882 7.35355 7.35355C7.54882 7.15829 7.54882 6.84171 7.35355 6.64645L0.853553 0.146447Z",fill:"currentColor"}),s2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5913 12.8842L14.7286 11.747C14.9814 11.4942 14.9814 11.0842 14.7286 10.8313C13.7972 9.89999 12.333 9.82626 11.3173 10.6102L9.35355 8.64645C9.15829 8.45118 8.84171 8.45118 8.64645 8.64645C8.45118 8.84171 8.45118 9.15829 8.64645 9.35355L10.6102 11.3173C9.82626 12.333 9.89999 13.7972 10.8313 14.7286C11.0842 14.9814 11.4942 14.9814 11.747 14.7286L12.8842 13.5913L15.1464 15.8536C15.3417 16.0488 15.6583 16.0488 15.8536 15.8536C16.0488 15.6583 16.0488 15.3417 15.8536 15.1464L13.5913 12.8842ZM11.5385 11.773L11.773 11.5385C12.3082 11.0032 13.1301 10.9294 13.7445 11.3169L11.3169 13.7445C10.9294 13.1301 11.0032 12.3082 11.5385 11.773Z",fill:"currentColor"})]});import{jsx as x4,jsxs as ii}from"react/jsx-runtime";var ri=C=>ii("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[x4("title",{children:"FieldHockey"}),x4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5395 0.247133C13.7289 -0.0131517 14.0898 -0.0777118 14.3576 0.100817L15.6945 0.992096C15.9702 1.17591 16.0447 1.54843 15.8609 1.82415L10.9164 9.24094C10.7632 9.47071 10.4528 9.53279 10.223 9.37962C9.99326 9.22644 9.93117 8.91601 10.0844 8.68624L14.807 1.60227L14.1224 1.14587L6.40897 11.7513C6.39116 11.7758 6.37102 11.7997 6.34813 11.8226L6.3339 11.8368C6.12402 12.0468 5.75419 12.4169 5.29823 12.6141C5.05417 12.7197 4.76564 12.7855 4.45036 12.7425C4.13169 12.699 3.82898 12.55 3.55096 12.297C3.31955 12.0863 3.1957 11.8293 3.11639 11.6059C3.06758 11.4683 3.02294 11.2994 2.98676 11.1624C2.97067 11.1015 2.95625 11.047 2.94387 11.0043C2.88655 10.8065 2.79224 10.6887 2.6701 10.6114C2.53784 10.5276 2.32794 10.4636 2.00038 10.4636C1.72206 10.4636 1.46739 10.5551 1.29064 10.7122C1.12377 10.8606 0.995136 11.094 0.999946 11.457C1.00758 12.0333 1.42598 13.1824 2.35386 14.11C2.6857 14.4417 3.32487 14.9485 4.50637 14.9636C5.09903 14.9712 5.86053 14.8164 6.84188 14.4893C7.10385 14.4019 7.38701 14.5435 7.47433 14.8055C7.56166 15.0674 7.42007 15.3506 7.1581 15.4379C6.13752 15.7781 5.25158 15.9732 4.49361 15.9636C2.97773 15.9442 2.10347 15.2736 1.64689 14.8172C0.574013 13.7447 0.0117999 12.358 3.33292e-05 11.4702C-0.00841029 10.8331 0.230721 10.3166 0.626137 9.96495C1.01168 9.62212 1.51383 9.46359 2.00038 9.46359C2.44803 9.46359 2.86288 9.54981 3.20511 9.76653C3.55747 9.98967 3.78742 10.3226 3.90432 10.7258C3.93215 10.8218 3.9527 10.9008 3.97121 10.9721C3.99905 11.0791 4.02229 11.1686 4.05879 11.2714C4.11078 11.4179 4.16372 11.5025 4.22411 11.5574C4.37589 11.6956 4.49689 11.7396 4.58567 11.7517C4.67784 11.7643 4.7805 11.7485 4.90118 11.6963C5.15574 11.5862 5.39568 11.36 5.6188 11.1376L13.5395 0.247133Z",fill:"currentColor"}),x4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.9219 14.9646C12.0265 14.9646 12.9219 14.0692 12.9219 12.9646C12.9219 11.86 12.0265 10.9646 10.9219 10.9646C9.81733 10.9646 8.9219 11.86 8.9219 12.9646C8.9219 14.0692 9.81733 14.9646 10.9219 14.9646ZM10.9219 15.9646C12.5787 15.9646 13.9219 14.6214 13.9219 12.9646C13.9219 11.3077 12.5787 9.96459 10.9219 9.96459C9.26504 9.96459 7.9219 11.3077 7.9219 12.9646C7.9219 14.6214 9.26504 15.9646 10.9219 15.9646Z",fill:"currentColor"})]});import{jsx as V5,jsxs as di}from"react/jsx-runtime";var ni=C=>di("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[V5("title",{children:"FootballField"}),V5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 3H1V13H15V3ZM1 2C0.447715 2 0 2.44772 0 3V13C0 13.5523 0.447715 14 1 14H15C15.5523 14 16 13.5523 16 13V3C16 2.44772 15.5523 2 15 2H1Z",fill:"currentColor"}),V5("path",{d:"M9 8C9 8.55228 8.55229 9 8 9C7.44772 9 7 8.55228 7 8C7 7.44772 7.44772 7 8 7C8.55229 7 9 7.44772 9 8Z",fill:"currentColor"}),V5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 2C3.27614 2 3.5 2.22386 3.5 2.5V4C3.5 4.27614 3.27614 4.5 3 4.5C2.72386 4.5 2.5 4.27614 2.5 4V2.5C2.5 2.22386 2.72386 2 3 2ZM5.5 2C5.77614 2 6 2.22386 6 2.5V4C6 4.27614 5.77614 4.5 5.5 4.5C5.22386 4.5 5 4.27614 5 4V2.5C5 2.22386 5.22386 2 5.5 2ZM8 2C8.27614 2 8.5 2.22386 8.5 2.5V4C8.5 4.27614 8.27614 4.5 8 4.5C7.72386 4.5 7.5 4.27614 7.5 4V2.5C7.5 2.22386 7.72386 2 8 2ZM10.5 2C10.7761 2 11 2.22386 11 2.5V4C11 4.27614 10.7761 4.5 10.5 4.5C10.2239 4.5 10 4.27614 10 4V2.5C10 2.22386 10.2239 2 10.5 2ZM13 2C13.2761 2 13.5 2.22386 13.5 2.5V4C13.5 4.27614 13.2761 4.5 13 4.5C12.7239 4.5 12.5 4.27614 12.5 4V2.5C12.5 2.22386 12.7239 2 13 2Z",fill:"currentColor"}),V5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 11.5C3.27614 11.5 3.5 11.7239 3.5 12V13.5C3.5 13.7761 3.27614 14 3 14C2.72386 14 2.5 13.7761 2.5 13.5V12C2.5 11.7239 2.72386 11.5 3 11.5ZM5.5 11.5C5.77614 11.5 6 11.7239 6 12V13.5C6 13.7761 5.77614 14 5.5 14C5.22386 14 5 13.7761 5 13.5V12C5 11.7239 5.22386 11.5 5.5 11.5ZM8 11.5C8.27614 11.5 8.5 11.7239 8.5 12V13.5C8.5 13.7761 8.27614 14 8 14C7.72386 14 7.5 13.7761 7.5 13.5V12C7.5 11.7239 7.72386 11.5 8 11.5ZM10.5 11.5C10.7761 11.5 11 11.7239 11 12V13.5C11 13.7761 10.7761 14 10.5 14C10.2239 14 10 13.7761 10 13.5V12C10 11.7239 10.2239 11.5 10.5 11.5ZM13 11.5C13.2761 11.5 13.5 11.7239 13.5 12V13.5C13.5 13.7761 13.2761 14 13 14C12.7239 14 12.5 13.7761 12.5 13.5V12C12.5 11.7239 12.7239 11.5 13 11.5Z",fill:"currentColor"})]});import{jsx as L6,jsxs as si}from"react/jsx-runtime";var pi=C=>si("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[L6("title",{children:"FootballUS"}),L6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5161 1.00518C8.0724 1.05556 5.72675 1.49633 3.86452 3.35792C2.93819 4.28393 2.18684 5.68135 1.68432 7.18805C1.18267 8.69212 0.946238 10.2534 1.01027 11.4754C1.02536 11.7634 1.03338 12.026 1.04083 12.2699C1.05201 12.636 1.0619 12.9599 1.09248 13.2639C1.13068 13.6436 1.19518 13.8808 1.27681 14.0277L5.30386 10.002L3.65741 8.35616C3.46215 8.16097 3.46215 7.84449 3.65741 7.6493C3.85268 7.4541 4.16926 7.4541 4.36452 7.6493L6.01097 9.29518L7.30386 8.00273L5.65741 6.35685C5.46215 6.16166 5.46215 5.84518 5.65741 5.64999C5.85268 5.45479 6.16926 5.45479 6.36452 5.64999L8.01097 7.29587L9.30386 6.00342L7.65741 4.35754C7.46215 4.16235 7.46215 3.84587 7.65741 3.65068C7.85268 3.45548 8.16926 3.45548 8.36452 3.65068L10.011 5.29656L14.06 1.24892C13.8753 1.1759 13.6288 1.11584 13.3041 1.07364C12.6771 0.992188 11.9278 0.997158 11.1266 1.00247C10.926 1.0038 10.7221 1.00516 10.5161 1.00518ZM14.6575 2.06537L10.7181 6.00342L12.3645 7.6493C12.5598 7.84449 12.5598 8.16097 12.3645 8.35616C12.1693 8.55136 11.8527 8.55136 11.6574 8.35616L10.011 6.71028L8.71808 8.00273L10.3645 9.64861C10.5598 9.8438 10.5598 10.1603 10.3645 10.3555C10.1693 10.5507 9.85268 10.5507 9.65741 10.3555L8.01097 8.70959L6.71808 10.002L8.36452 11.6479C8.55978 11.8431 8.55978 12.1596 8.36452 12.3548C8.16926 12.55 7.85268 12.55 7.65741 12.3548L6.01097 10.7089L2.09139 14.6271C2.35018 14.7387 2.63922 14.8192 2.95332 14.8759C3.60903 14.9942 4.32085 15.0004 5.01091 15.0003C6.47296 15.0002 8.04182 14.758 9.41842 14.2783C10.8027 13.796 11.9434 13.0911 12.611 12.2013C13.3201 11.2562 13.7996 10.1822 14.1026 9.33412C14.2534 8.91212 14.3587 8.55092 14.4261 8.29659C14.4597 8.16953 14.4838 8.06945 14.4992 8.00215C14.507 7.9685 14.5126 7.94308 14.5161 7.92659L14.5199 7.90868L14.5206 7.90493L14.5246 7.88491L14.5301 7.86576L14.5304 7.86477L14.532 7.85909L14.5391 7.83312C14.5454 7.80944 14.5549 7.77319 14.5669 7.72535C14.5908 7.62963 14.6245 7.4877 14.6621 7.30728C14.7374 6.94606 14.828 6.4327 14.8884 5.82875C14.9986 4.72772 15.0049 3.35735 14.6575 2.06537ZM15.4971 8.12065L15.4939 8.13605C15.4894 8.15715 15.4827 8.18737 15.4739 8.22597C15.4561 8.30314 15.4294 8.41393 15.3928 8.5524C15.3195 8.82912 15.2061 9.21765 15.0443 9.67034C14.7223 10.5716 14.2019 11.7469 13.411 12.8011C12.5786 13.9106 11.232 14.705 9.74757 15.2223C8.25552 15.7422 6.57438 15.9998 5.01102 16C4.33054 16.0001 3.53229 15.9962 2.7756 15.8596C2.01698 15.7227 1.24747 15.4438 0.657404 14.854C0.267267 14.464 0.150521 13.891 0.0974956 13.3639C0.0642397 13.0333 0.0518509 12.6427 0.0391712 12.2429C0.0315996 12.0042 0.0239243 11.7621 0.0116403 11.5277C-0.0602576 10.1556 0.203314 8.46797 0.735655 6.87187C1.26712 5.2784 2.08374 3.72436 3.15741 2.65106C5.29392 0.515288 7.96225 0.0574067 10.5008 0.0056268L10.511 0.00541873C10.6984 0.00541873 10.89 0.00416907 11.0836 0.0028021C11.8911 -0.00290087 12.7313 -0.00883533 13.433 0.082325C14.2603 0.18982 15.1916 0.466081 15.4853 1.34694C16.0169 2.94112 16.0118 4.64523 15.8835 5.92822C15.8189 6.57385 15.7221 7.12263 15.6411 7.51116C15.6006 7.70562 15.5639 7.86045 15.5371 7.9678C15.5236 8.02148 15.5126 8.06333 15.5048 8.09236L15.4971 8.12065Z",fill:"currentColor"})]});import{jsx as $,jsxs as fi}from"react/jsx-runtime";var ci=C=>fi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[$("title",{children:"GaelicGamesPitch"}),$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3.5C0 2.67157 0.671573 2 1.5 2H14.5C15.3284 2 16 2.67157 16 3.5V12.5C16 13.3284 15.3284 14 14.5 14H1.5C0.671573 14 0 13.3284 0 12.5V3.5ZM1.5 3C1.22386 3 1 3.22386 1 3.5V12.5C1 12.7761 1.22386 13 1.5 13H14.5C14.7761 13 15 12.7761 15 12.5V3.5C15 3.22386 14.7761 3 14.5 3H1.5Z",fill:"currentColor"}),$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 2C2.77614 2 3 2.22386 3 2.5V13.5C3 13.7761 2.77614 14 2.5 14C2.22386 14 2 13.7761 2 13.5V2.5C2 2.22386 2.22386 2 2.5 2ZM13.5 2C13.7761 2 14 2.22386 14 2.5V13.5C14 13.7761 13.7761 14 13.5 14C13.2239 14 13 13.7761 13 13.5V2.5C13 2.22386 13.2239 2 13.5 2Z",fill:"currentColor"}),$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 8C3.5 7.72386 3.27614 7.5 3 7.5V6.5C3.82843 6.5 4.5 7.17157 4.5 8C4.5 8.82843 3.82843 9.5 3 9.5V8.5C3.27614 8.5 3.5 8.27614 3.5 8Z",fill:"currentColor"}),$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5 8C12.5 8.27614 12.7239 8.5 13 8.5V9.5C12.1716 9.5 11.5 8.82843 11.5 8C11.5 7.17157 12.1716 6.5 13 6.5V7.5C12.7239 7.5 12.5 7.72386 12.5 8Z",fill:"currentColor"}),$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 2C8.27614 2 8.5 2.22386 8.5 2.5V13.5C8.5 13.7761 8.27614 14 8 14C7.72386 14 7.5 13.7761 7.5 13.5V2.5C7.5 2.22386 7.72386 2 8 2Z",fill:"currentColor"}),$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2C6.27614 2 6.5 2.22386 6.5 2.5V13.5C6.5 13.7761 6.27614 14 6 14C5.72386 14 5.5 13.7761 5.5 13.5V2.5C5.5 2.22386 5.72386 2 6 2Z",fill:"currentColor"}),$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 2.13687C10.2761 2.13687 10.5 2.36073 10.5 2.63687V13.5C10.5 13.7761 10.2761 14 10 14C9.72386 14 9.5 13.7761 9.5 13.5V2.63687C9.5 2.36073 9.72386 2.13687 10 2.13687Z",fill:"currentColor"})]});import{jsx as i,jsxs as ai}from"react/jsx-runtime";var hi=C=>ai("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[i("title",{children:"Golf"}),i("path",{d:"M8 2.5C8.27614 2.5 8.5 2.27614 8.5 2C8.5 1.72386 8.27614 1.5 8 1.5C7.72386 1.5 7.5 1.72386 7.5 2C7.5 2.27614 7.72386 2.5 8 2.5Z",fill:"currentColor"}),i("path",{d:"M8.5 4C8.5 4.27614 8.27614 4.5 8 4.5C7.72386 4.5 7.5 4.27614 7.5 4C7.5 3.72386 7.72386 3.5 8 3.5C8.27614 3.5 8.5 3.72386 8.5 4Z",fill:"currentColor"}),i("path",{d:"M8 6.5C8.27614 6.5 8.5 6.27614 8.5 6C8.5 5.72386 8.27614 5.5 8 5.5C7.72386 5.5 7.5 5.72386 7.5 6C7.5 6.27614 7.72386 6.5 8 6.5Z",fill:"currentColor"}),i("path",{d:"M6 4.5C6.27614 4.5 6.5 4.27614 6.5 4C6.5 3.72386 6.27614 3.5 6 3.5C5.72386 3.5 5.5 3.72386 5.5 4C5.5 4.27614 5.72386 4.5 6 4.5Z",fill:"currentColor"}),i("path",{d:"M10.5 4C10.5 4.27614 10.2761 4.5 10 4.5C9.72386 4.5 9.5 4.27614 9.5 4C9.5 3.72386 9.72386 3.5 10 3.5C10.2761 3.5 10.5 3.72386 10.5 4Z",fill:"currentColor"}),i("path",{d:"M10 6.5C10.2761 6.5 10.5 6.27614 10.5 6C10.5 5.72386 10.2761 5.5 10 5.5C9.72386 5.5 9.5 5.72386 9.5 6C9.5 6.27614 9.72386 6.5 10 6.5Z",fill:"currentColor"}),i("path",{d:"M10.5 8C10.5 8.27614 10.2761 8.5 10 8.5C9.72386 8.5 9.5 8.27614 9.5 8C9.5 7.72386 9.72386 7.5 10 7.5C10.2761 7.5 10.5 7.72386 10.5 8Z",fill:"currentColor"}),i("path",{d:"M8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5Z",fill:"currentColor"}),i("path",{d:"M8.5 10C8.5 10.2761 8.27614 10.5 8 10.5C7.72386 10.5 7.5 10.2761 7.5 10C7.5 9.72386 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.72386 8.5 10Z",fill:"currentColor"}),i("path",{d:"M11.5 6C11.5 6.27614 11.7239 6.5 12 6.5C12.2761 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.2761 5.5 12 5.5C11.7239 5.5 11.5 5.72386 11.5 6Z",fill:"currentColor"}),i("path",{d:"M4 6.5C3.72386 6.5 3.5 6.27614 3.5 6C3.5 5.72386 3.72386 5.5 4 5.5C4.27614 5.5 4.5 5.72386 4.5 6C4.5 6.27614 4.27614 6.5 4 6.5Z",fill:"currentColor"}),i("path",{d:"M11.0309 7.75003C10.8929 7.98918 10.9748 8.29497 11.214 8.43304C11.4531 8.57111 11.7589 8.48918 11.897 8.25003C12.035 8.01088 11.9531 7.70509 11.714 7.56702C11.4748 7.42895 11.169 7.51088 11.0309 7.75003Z",fill:"currentColor"}),i("path",{d:"M4.28574 4.43304C4.04659 4.29497 3.96465 3.98918 4.10272 3.75003C4.2408 3.51088 4.54659 3.42895 4.78574 3.56702C5.02488 3.70509 5.10682 4.01088 4.96875 4.25003C4.83068 4.48918 4.52488 4.57111 4.28574 4.43304Z",fill:"currentColor"}),i("path",{d:"M9.75009 9.03107C9.51095 9.16914 9.42901 9.47494 9.56708 9.71408C9.70515 9.95323 10.0109 10.0352 10.2501 9.89709C10.4892 9.75902 10.5712 9.45323 10.4331 9.21408C10.295 8.97494 9.98924 8.893 9.75009 9.03107Z",fill:"currentColor"}),i("path",{d:"M5.56659 2.78592C5.42852 2.54677 5.51046 2.24098 5.7496 2.10291C5.98875 1.96484 6.29455 2.04677 6.43262 2.28592C6.57069 2.52507 6.48875 2.83086 6.2496 2.96893C6.01046 3.107 5.70466 3.02507 5.56659 2.78592Z",fill:"currentColor"}),i("path",{d:"M6.25009 9.03131C6.01095 8.89324 5.70515 8.97518 5.56708 9.21433C5.42901 9.45347 5.51095 9.75927 5.75009 9.89734C5.98924 10.0354 6.29503 9.95347 6.43311 9.71433C6.57118 9.47518 6.48924 9.16938 6.25009 9.03131Z",fill:"currentColor"}),i("path",{d:"M9.56659 2.28568C9.70466 2.04653 10.0105 1.96459 10.2496 2.10266C10.4888 2.24073 10.5707 2.54653 10.4326 2.78568C10.2945 3.02482 9.98875 3.10676 9.7496 2.96869C9.51046 2.83062 9.42852 2.52482 9.56659 2.28568Z",fill:"currentColor"}),i("path",{d:"M4.96905 7.75034C4.83098 7.51119 4.52519 7.42925 4.28604 7.56732C4.04689 7.7054 3.96496 8.01119 4.10303 8.25034C4.2411 8.48948 4.54689 8.57142 4.78604 8.43335C5.02519 8.29528 5.10712 7.98948 4.96905 7.75034Z",fill:"currentColor"}),i("path",{d:"M11.2138 3.56665C11.4529 3.42858 11.7587 3.51052 11.8968 3.74967C12.0349 3.98881 11.9529 4.29461 11.7138 4.43268C11.4746 4.57075 11.1688 4.48881 11.0308 4.24967C10.8927 4.01052 10.9746 3.70472 11.2138 3.56665Z",fill:"currentColor"}),i("path",{d:"M6 6.5C6.27614 6.5 6.5 6.27614 6.5 6C6.5 5.72386 6.27614 5.5 6 5.5C5.72386 5.5 5.5 5.72386 5.5 6C5.5 6.27614 5.72386 6.5 6 6.5Z",fill:"currentColor"}),i("path",{d:"M6.5 8C6.5 8.27614 6.27614 8.5 6 8.5C5.72386 8.5 5.5 8.27614 5.5 8C5.5 7.72386 5.72386 7.5 6 7.5C6.27614 7.5 6.5 7.72386 6.5 8Z",fill:"currentColor"}),i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 6C14 9.31371 11.3137 12 8 12C4.68629 12 2 9.31371 2 6C2 2.68629 4.68629 0 8 0C11.3137 0 14 2.68629 14 6ZM13 6C13 8.76142 10.7614 11 8 11C5.23858 11 3 8.76142 3 6C3 3.23858 5.23858 1 8 1C10.7614 1 13 3.23858 13 6Z",fill:"currentColor"}),i("path",{d:"M6.46336 13.0026L9.49728 12.9973C9.97777 12.9965 10.1827 13.6078 9.79887 13.8968L9.06837 14.4467C9.02311 14.4808 8.98396 14.5223 8.95261 14.5695L8.41738 15.3752C8.21996 15.6724 7.78373 15.6731 7.58533 15.3766L7.05048 14.5772C7.01709 14.5272 6.97498 14.4838 6.92616 14.4488L6.17298 13.909C5.77829 13.6262 5.97778 13.0035 6.46336 13.0026Z",fill:"currentColor"})]});import{jsx as g6,jsxs as gi}from"react/jsx-runtime";var Li=C=>gi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[g6("title",{children:"Gymnastics"}),g6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 0V7.02746C6.73443 7.10865 7.41559 7.36658 8 7.75777C8.58441 7.36658 9.26557 7.10865 10 7.02746V0H11V7.02746C13.25 7.27619 15 9.18372 15 11.5C15 13.9853 12.9853 16 10.5 16C9.57493 16 8.71505 15.7209 8 15.2422C7.28495 15.7209 6.42507 16 5.5 16C3.01472 16 1 13.9853 1 11.5C1 9.18372 2.75002 7.27619 5 7.02746V0H6ZM10.5 8C9.88285 8 9.30302 8.15973 8.79958 8.4401C9.54453 9.24303 10 10.3183 10 11.5C10 12.6817 9.54453 13.757 8.79958 14.5599C9.30302 14.8403 9.88285 15 10.5 15C12.433 15 14 13.433 14 11.5C14 9.567 12.433 8 10.5 8ZM2 11.5C2 9.567 3.567 8 5.5 8C6.11715 8 6.69698 8.15973 7.20043 8.4401C6.45548 9.24303 6 10.3183 6 11.5C6 12.6817 6.45548 13.757 7.20043 14.5599C6.69698 14.8403 6.11715 15 5.5 15C3.567 15 2 13.433 2 11.5ZM8 9.05051C8.61859 9.68178 9 10.5463 9 11.5C9 12.4537 8.61859 13.3182 8 13.9495C7.38141 13.3182 7 12.4537 7 11.5C7 10.5463 7.38141 9.68178 8 9.05051Z",fill:"currentColor"})]});import{jsx as u6,jsxs as Vi}from"react/jsx-runtime";var ui=C=>Vi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[u6("title",{children:"Handball"}),u6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.1159 9.12375C14.1159 9.11717 14.1178 9.11152 14.1178 9.10587V6.53364L14.8105 6.17505C14.9677 6.75764 15.0589 7.36752 15.0589 7.99999C15.0589 8.52328 14.9978 9.03152 14.8886 9.52376L14.1159 9.12375ZM11.4693 14.1393L10.3314 13.3807C10.3606 13.3308 10.3973 13.2875 10.4189 13.2329L11.0843 11.5812C11.2406 11.5511 11.393 11.5049 11.5351 11.4231L13.4166 10.3256C13.5587 10.2428 13.6744 10.1308 13.778 10.0085L14.6147 10.4414C14.0321 12.0122 12.9111 13.3223 11.4693 14.1393ZM7.99959 15.0589C7.12995 15.0589 6.29983 14.8932 5.52995 14.6033L6.25936 14.1177H9.73983L10.4692 14.6033C9.69936 14.8932 8.86924 15.0589 7.99959 15.0589ZM1.38477 10.4376L2.22053 10.0056C2.32406 10.1289 2.44077 10.2418 2.58288 10.3247L4.46524 11.423C4.58288 11.4927 4.709 11.5388 4.83794 11.5708L5.57771 13.2687C5.59653 13.3139 5.62947 13.3487 5.653 13.391L4.53018 14.1393C3.0883 13.3214 1.96641 12.0113 1.38477 10.4376ZM0.941406 8.00001C0.941406 7.36943 1.0327 6.76049 1.18799 6.1779L1.88258 6.53743V9.1059C1.88258 9.1106 1.88447 9.11531 1.88447 9.12002L1.11082 9.52001C1.00258 9.02966 0.941406 8.52143 0.941406 8.00001ZM4.52987 1.8597L5.6527 2.60794C5.62917 2.65029 5.59623 2.68511 5.5774 2.73029L4.87811 4.33405L2.58352 5.67335C2.53552 5.70064 2.49787 5.74017 2.45458 5.77311L1.48893 5.27429C2.09693 3.8277 3.17552 2.62864 4.52987 1.8597ZM7.99959 0.941162C8.86924 0.941162 9.69936 1.10587 10.4692 1.39575L9.73983 1.88234H6.25936L5.52995 1.39575C6.29983 1.10587 7.12995 0.941162 7.99959 0.941162ZM8.70411 9.51155C8.56011 9.42778 8.4707 9.27249 8.4707 9.1059V6.8932C8.4707 6.72661 8.56011 6.57131 8.70411 6.48661L10.5865 5.38825C10.6599 5.3459 10.7418 5.3252 10.8236 5.3252C10.9055 5.3252 10.9874 5.3459 11.0608 5.38825L12.9441 6.48755C13.0872 6.57037 13.1766 6.72661 13.1766 6.8932V9.1059C13.1766 9.27249 13.0872 9.42872 12.9432 9.51249L11.0608 10.6108C10.914 10.6955 10.7333 10.6955 10.5865 10.6108L8.70411 9.51155ZM5.88779 11.423L7.76921 10.3256C7.85485 10.2766 7.92826 10.2117 7.99979 10.1477C8.07132 10.2117 8.14474 10.2757 8.22944 10.3246L10.1118 11.423C10.1174 11.4268 10.125 11.4277 10.1306 11.4305L9.54615 12.8818C9.47368 13.0606 9.30238 13.1764 9.10944 13.1764H6.87132C6.68403 13.1764 6.51462 13.0644 6.44026 12.8941L5.8125 11.455C5.83697 11.4418 5.86332 11.4371 5.88779 11.423ZM5.81771 4.53454L6.44077 3.1049C6.51512 2.93455 6.68453 2.82349 6.87183 2.82349H9.10994C9.30288 2.82349 9.47418 2.93925 9.54665 3.11713L10.1311 4.56843C10.1255 4.57125 10.1179 4.57219 10.1123 4.57596L8.23088 5.67337C8.14524 5.72325 8.07183 5.78725 8.0003 5.85125C7.92877 5.78725 7.85536 5.72419 7.77065 5.67431L5.81771 4.53454ZM7.29604 6.48752C7.44004 6.57128 7.52945 6.72658 7.52945 6.89317V9.10587C7.52945 9.27246 7.44004 9.42775 7.29604 9.51246L5.41369 10.6108C5.26592 10.6946 5.08521 10.6946 4.93933 10.6108L3.05698 9.51152C2.91298 9.42775 2.82357 9.27246 2.82357 9.10587V6.89317C2.82357 6.72658 2.91298 6.57128 3.05698 6.48658L5.17651 5.25081L7.29604 6.48752ZM14.5093 5.27052L13.5427 5.77029C13.5003 5.73923 13.4636 5.70064 13.4175 5.67429L11.5351 4.57594C11.393 4.49405 11.2406 4.44794 11.0843 4.41876L10.4189 2.76605C10.3973 2.71241 10.3606 2.66911 10.3314 2.61829L11.4693 1.8597C12.8236 2.6277 13.9013 3.82582 14.5093 5.27052ZM8 0C3.58871 0 0 3.58871 0 8C0 12.4104 3.58871 16 8 16C12.4104 16 16 12.4104 16 8C16 3.58871 12.4104 0 8 0Z",fill:"currentColor"})]});import{jsx as c1,jsxs as mi}from"react/jsx-runtime";var vi=C=>mi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[c1("title",{children:"HandballPitch"}),c1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 4H1V12H15V4ZM1 3C0.447715 3 0 3.44772 0 4V12C0 12.5523 0.447715 13 1 13H15C15.5523 13 16 12.5523 16 12V4C16 3.44772 15.5523 3 15 3H1Z",fill:"currentColor"}),c1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 3C8.27614 3 8.5 3.22386 8.5 3.5V12.5C8.5 12.7761 8.27614 13 8 13C7.72386 13 7.5 12.7761 7.5 12.5V3.5C7.5 3.22386 7.72386 3 8 3Z",fill:"currentColor"}),c1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 13C3.76142 13 6 10.7614 6 8C6 5.23858 3.76142 3 1 3V4C3.20914 4 5 5.79086 5 8C5 10.2091 3.20914 12 1 12V13Z",fill:"currentColor"}),c1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 4V3C12.2386 3 10 5.23858 10 8C10 10.7614 12.2386 13 15 13V12C12.7909 12 11 10.2091 11 8C11 5.79086 12.7909 4 15 4Z",fill:"currentColor"}),c1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 10.8293C0.312779 10.9398 0.649365 11 1 11C2.65685 11 4 9.65685 4 8C4 6.34315 2.65685 5 1 5C0.649365 5 0.312779 5.06015 0 5.17071V6.26756C0.294173 6.09739 0.635713 6 1 6C2.10457 6 3 6.89543 3 8C3 9.10457 2.10457 10 1 10C0.635713 10 0.294173 9.90261 0 9.73244V10.8293Z",fill:"currentColor"}),c1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 5.17071C15.6872 5.06015 15.3506 5 15 5C13.3431 5 12 6.34315 12 8C12 9.65685 13.3431 11 15 11C15.3506 11 15.6872 10.9398 16 10.8293V9.73244C15.7058 9.90261 15.3643 10 15 10C13.8954 10 13 9.10457 13 8C13 6.89543 13.8954 6 15 6C15.3643 6 15.7058 6.09739 16 6.26756V5.17071Z",fill:"currentColor"})]});import{jsx as T1,jsxs as Hi}from"react/jsx-runtime";var wi=C=>Hi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[T1("title",{children:"Harness"}),T1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.87051 15.0061C12.0796 15.0061 13.8705 13.2262 13.8705 11.0306C13.8705 8.83497 12.0796 7.05506 9.87051 7.05506C7.66137 7.05506 5.87051 8.83497 5.87051 11.0306C5.87051 13.2262 7.66137 15.0061 9.87051 15.0061ZM9.87051 16C12.6319 16 14.8705 13.7751 14.8705 11.0306C14.8705 8.28606 12.6319 6.06118 9.87051 6.06118C7.10908 6.06118 4.87051 8.28606 4.87051 11.0306C4.87051 13.7751 7.10908 16 9.87051 16Z",fill:"currentColor"}),T1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.87051 13.0184C10.9751 13.0184 11.8705 12.1284 11.8705 11.0306C11.8705 9.93278 10.9751 9.04283 9.87051 9.04283C8.76594 9.04283 7.87051 9.93278 7.87051 11.0306C7.87051 12.1284 8.76594 13.0184 9.87051 13.0184ZM9.87051 14.0122C11.5274 14.0122 12.8705 12.6773 12.8705 11.0306C12.8705 9.38387 11.5274 8.04895 9.87051 8.04895C8.21365 8.04895 6.87051 9.38387 6.87051 11.0306C6.87051 12.6773 8.21365 14.0122 9.87051 14.0122Z",fill:"currentColor"}),T1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8572 3.46266C13.9205 3.72982 13.7538 3.99735 13.485 4.06021L5.85874 5.84365L7.22406 7.20061C7.41932 7.39468 7.41932 7.70933 7.22406 7.90339C7.0288 8.09746 6.71221 8.09746 6.51695 7.90339L5.15163 6.54643C4.59761 5.99579 4.86702 5.05454 5.6297 4.87619L13.256 3.09275C13.5248 3.02989 13.794 3.1955 13.8572 3.46266Z",fill:"currentColor"}),T1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.2945 2.31922C10.4409 2.55195 10.3697 2.85854 10.1355 3.004C8.07044 4.28677 6.76706 4.37223 5.80321 3.97307C5.39429 3.80373 5.07828 3.55607 4.84833 3.37585C4.82517 3.3577 4.80288 3.34023 4.78146 3.3236C4.50634 3.10997 4.42107 3.07954 4.3706 3.07954C3.10354 3.07954 2.49008 3.32781 2.22278 3.58911C1.99742 3.80943 1.9241 4.14222 2.08657 4.67458C2.25028 5.21098 2.62764 5.83809 3.12072 6.47141C3.60842 7.09782 4.18444 7.6988 4.70974 8.18073C4.91265 8.36689 4.9253 8.68128 4.738 8.88295C4.5507 9.08462 4.23437 9.0972 4.03146 8.91104C3.47343 8.39909 2.85778 7.75772 2.32985 7.07965C1.80731 6.4085 1.34509 5.66903 1.12963 4.96308C0.912938 4.25309 0.920867 3.46776 1.52154 2.88055C2.08029 2.33432 3.03766 2.08565 4.3706 2.08565C4.81189 2.08565 5.1594 2.35569 5.3847 2.53076C5.38888 2.53401 5.39303 2.53723 5.39713 2.54041C5.41785 2.5565 5.43832 2.57246 5.4586 2.58826C5.69851 2.77527 5.91131 2.94113 6.18783 3.05565C6.72395 3.27767 7.67057 3.36312 9.60551 2.16119C9.83967 2.01573 10.1481 2.08648 10.2945 2.31922Z",fill:"currentColor"}),T1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5229 1.25253C5.44828 1.38767 5.39193 1.54918 5.35833 1.69773C5.29776 1.9655 5.03026 2.13377 4.76084 2.07357C4.49142 2.01338 4.32211 1.74751 4.38268 1.47974C4.43241 1.25987 4.51773 1.00711 4.64623 0.77438C4.77174 0.547075 4.96114 0.297956 5.23899 0.143551C5.54101 -0.0242885 5.89734 -0.0514111 6.2635 0.0965437C6.60514 0.234588 6.9339 0.514947 7.25988 0.91714C7.43311 1.13087 7.39922 1.44371 7.18417 1.61588C6.96912 1.78805 6.65436 1.75436 6.48113 1.54063C6.20711 1.20256 6.0067 1.06566 5.88688 1.01724C5.79159 0.978739 5.75416 0.995954 5.72702 1.01104C5.6757 1.03956 5.60052 1.11195 5.5229 1.25253Z",fill:"currentColor"})]});import{jsx as c2,jsxs as Ri}from"react/jsx-runtime";var Mi=C=>Ri("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[c2("title",{children:"HorseRacing"}),c2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.90601 1.08085C5.25254 0.490447 6.74815 0.00012207 8 0.00012207C9.57182 0.00012207 10.6637 0.33066 11.4424 0.792049C11.8587 1.03874 12.1739 1.31614 12.4179 1.58149C12.7543 1.13656 13.2082 0.872093 13.704 0.761912C14.4036 0.606452 15.1464 0.764219 15.7236 1.05285C15.9706 1.17635 16.0707 1.4767 15.9472 1.72368C15.8237 1.97066 15.5234 2.07076 15.2764 1.94726C14.8536 1.73583 14.3464 1.64357 13.921 1.7381C13.5277 1.82549 13.1681 2.07687 12.9743 2.65811C12.9141 2.8388 12.7565 2.96958 12.5678 2.99539C12.3791 3.0212 12.1921 2.93756 12.0855 2.77969C11.8532 2.43534 11.5279 2.00508 10.9326 1.65237C10.3363 1.29906 9.42818 1.00012 8 1.00012C6.96348 1.00012 5.62523 1.41894 4.30757 1.99668C3.00772 2.56661 1.78713 3.26438 1 3.77047V13.684C2.01334 12.2139 3.27815 10.9369 4.44014 9.93586C5.90577 8.6733 7.24503 7.81847 7.77639 7.55279C8.02338 7.42929 8.32372 7.5294 8.44721 7.77639C8.57071 8.02338 8.4706 8.32372 8.22361 8.44721C7.7865 8.66577 6.51589 9.4676 5.09281 10.6935C3.67233 11.9172 2.13716 13.5319 1.13515 15.3647C0.983306 15.6424 0.684948 15.7155 0.460495 15.6606C0.234532 15.6054 0 15.399 0 15.0765V3.76771C0 3.43656 0.163413 3.11969 0.451996 2.93395C1.27479 2.4044 2.54543 1.67741 3.90601 1.08085Z",fill:"currentColor"}),c2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5008 3.46294C14.5088 3.25084 14.5793 2.84887 14.7585 2.51479C14.9343 2.18692 15.1654 1.99988 15.5 1.99988C15.7761 1.99988 16 1.77602 16 1.49988C16 1.22374 15.7761 0.999878 15.5 0.999878C14.6657 0.999878 14.1549 1.52439 13.8772 2.04209C13.6059 2.54791 13.5103 3.11753 13.5008 3.44447C13.4989 3.51147 13.5051 3.5721 13.5138 3.62401C13.7261 4.88461 14.025 6.06072 14.2963 7.12852C14.3512 7.34459 14.405 7.55623 14.4567 7.76324C14.7684 9.0113 15 10.0743 15 11C15 11.8329 14.775 12.3469 14.4997 12.6453C14.2268 12.9411 13.8562 13.0785 13.4484 13.0696C12.6026 13.0511 11.691 12.4056 11.4903 11.4019C11.4188 11.0444 11.3353 10.6889 11.2571 10.3783C11.0531 9.56728 10.4383 8.99396 9.82413 8.62504C9.08363 8.18025 8.38736 7.4995 8.49667 6.55764C8.56152 5.9989 8.85481 5.7198 9.15563 5.57625C9.31474 5.50032 9.47829 5.46249 9.61244 5.45143C9.73409 5.44141 9.7895 5.45413 9.7895 5.45413C9.7895 5.45413 9.78519 5.45161 9.77639 5.44721C10.0234 5.57071 10.3237 5.4706 10.4472 5.22361C10.5707 4.97662 10.4706 4.67628 10.2236 4.55279C10.018 4.45001 9.75211 4.43653 9.53028 4.45482C9.28537 4.47501 9.0024 4.54134 8.72495 4.67375C8.15262 4.94686 7.61258 5.5011 7.50334 6.44236C7.32052 8.01754 8.5108 9.00271 9.30923 9.48228C9.80963 9.78285 10.1742 10.1722 10.2873 10.6222C10.3628 10.9222 10.4423 11.2611 10.5097 11.5981C10.809 13.0944 12.1473 14.0415 13.4266 14.0693C14.0813 14.0836 14.7419 13.8575 15.2347 13.3234C15.725 12.792 16 12.0097 16 11C16 9.93478 15.7361 8.75919 15.4269 7.52091C15.3734 7.30692 15.3184 7.09048 15.2628 6.8714C14.9921 5.80573 14.7056 4.67742 14.5008 3.46294Z",fill:"currentColor"}),c2("path",{d:"M13 6.5C13 6.77614 12.7761 7 12.5 7C12.2239 7 12 6.77614 12 6.5C12 6.22386 12.2239 6 12.5 6C12.7761 6 13 6.22386 13 6.5Z",fill:"currentColor"})]});import{jsx as f2,jsxs as Si}from"react/jsx-runtime";var Zi=C=>Si("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[f2("title",{children:"IceHockey"}),f2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 2.5C4.96243 2.5 2.5 4.96243 2.5 8C2.5 8.31288 2.52608 8.61929 2.57607 8.91727C2.62176 9.18961 2.43802 9.44742 2.16569 9.49311C1.89335 9.5388 1.63554 9.35506 1.58985 9.08273C1.53072 8.73029 1.5 8.36854 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5C9.1831 1.5 10.2938 1.81654 11.2504 2.36989C11.4894 2.50816 11.5711 2.81403 11.4328 3.05306C11.2945 3.29209 10.9887 3.37377 10.7496 3.2355C9.94117 2.76782 9.00262 2.5 8 2.5ZM14 7.5C14.2761 7.5 14.5 7.72386 14.5 8C14.5 11.2212 12.1573 13.8943 9.08273 14.4102C8.81039 14.4558 8.55258 14.2721 8.50689 13.9998C8.4612 13.7274 8.64494 13.4696 8.91727 13.4239C11.5181 12.9876 13.5 10.7247 13.5 8C13.5 7.72386 13.7239 7.5 14 7.5Z",fill:"currentColor"}),f2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.69543 13.7192L6.71934 13.7C6.79452 13.6396 6.86291 13.5664 6.92139 13.4799L9.15653 10.1738C9.46585 9.71628 9.3457 9.09462 8.88817 8.7853C8.43063 8.47598 7.80897 8.59613 7.49965 9.05366L5.50773 12H3C2.44772 12 2 12.4477 2 13C2 13.5523 2.44772 14 3 14H6C6.25975 14 6.49436 13.9023 6.67274 13.7399L6.69543 13.7192ZM4.9767 11H3C1.89543 11 1 11.8954 1 13C1 14.1046 1.89543 15 3 15H6C6.51833 15 6.9906 14.8028 7.34591 14.4794C7.49807 14.3571 7.63476 14.2102 7.74983 14.04L9.98496 10.7339C10.6036 9.81883 10.3633 8.57551 9.44825 7.95686C8.53318 7.33822 7.28986 7.57851 6.67121 8.49358L4.9767 11Z",fill:"currentColor"}),f2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8 0.0999999C16.0209 0.265685 16.0657 0.579086 15.9 0.8L9.9 8.8C9.73431 9.02091 9.42091 9.06569 9.2 8.9C8.97909 8.73431 8.93431 8.42091 9.1 8.2L15.1 0.2C15.2657 -0.020914 15.5791 -0.0656856 15.8 0.0999999Z",fill:"currentColor"})]});import{jsx as V6,jsxs as Pi}from"react/jsx-runtime";var Gi=C=>Pi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[V6("title",{children:"IceHockeyRink"}),V6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 3H3C1.89543 3 1 3.89543 1 5V11C1 12.1046 1.89543 13 3 13H7.5V9.41465C6.9174 9.20873 6.5 8.65311 6.5 8C6.5 7.34689 6.9174 6.79127 7.5 6.58535V3ZM8 2H3C1.34315 2 0 3.34315 0 5V11C0 12.6569 1.34315 14 3 14H8H13C14.6569 14 16 12.6569 16 11V5C16 3.34315 14.6569 2 13 2H8ZM8.5 3V6.58535C9.0826 6.79127 9.5 7.34689 9.5 8C9.5 8.65311 9.0826 9.20873 8.5 9.41465V13H13C14.1046 13 15 12.1046 15 11V5C15 3.89543 14.1046 3 13 3H8.5ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5ZM4 5.5C4 5.77614 3.77614 6 3.5 6C3.22386 6 3 5.77614 3 5.5C3 5.22386 3.22386 5 3.5 5C3.77614 5 4 5.22386 4 5.5ZM5 5.5C5 6.32843 4.32843 7 3.5 7C2.67157 7 2 6.32843 2 5.5C2 4.67157 2.67157 4 3.5 4C4.32843 4 5 4.67157 5 5.5ZM12.5 6C12.7761 6 13 5.77614 13 5.5C13 5.22386 12.7761 5 12.5 5C12.2239 5 12 5.22386 12 5.5C12 5.77614 12.2239 6 12.5 6ZM12.5 7C13.3284 7 14 6.32843 14 5.5C14 4.67157 13.3284 4 12.5 4C11.6716 4 11 4.67157 11 5.5C11 6.32843 11.6716 7 12.5 7ZM4 10.5C4 10.7761 3.77614 11 3.5 11C3.22386 11 3 10.7761 3 10.5C3 10.2239 3.22386 10 3.5 10C3.77614 10 4 10.2239 4 10.5ZM5 10.5C5 11.3284 4.32843 12 3.5 12C2.67157 12 2 11.3284 2 10.5C2 9.67157 2.67157 9 3.5 9C4.32843 9 5 9.67157 5 10.5ZM12.5 11C12.7761 11 13 10.7761 13 10.5C13 10.2239 12.7761 10 12.5 10C12.2239 10 12 10.2239 12 10.5C12 10.7761 12.2239 11 12.5 11ZM12.5 12C13.3284 12 14 11.3284 14 10.5C14 9.67157 13.3284 9 12.5 9C11.6716 9 11 9.67157 11 10.5C11 11.3284 11.6716 12 12.5 12Z",fill:"currentColor"})]});import{jsx as v6,jsxs as bi}from"react/jsx-runtime";var xi=C=>bi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[v6("title",{children:"JaiAlai"}),v6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.41671 0.119784C5.53873 0.203471 5.81646 0.480535 5.66497 0.864313C5.35376 1.65269 5.04295 2.7392 5.0288 3.81629C5.01478 4.88397 5.29047 5.88853 6.08448 6.62004C6.30317 6.79322 6.81095 7.11527 7.5313 7.54104C8.25201 7.96703 9.15374 8.47854 10.1171 9.01432C12.0432 10.0856 14.206 11.2485 15.6384 12.0075C15.9659 12.1811 16.043 12.5869 15.8546 12.8695L13.9672 15.7007C13.7938 15.9608 13.4498 16.0442 13.1765 15.8924L8.76702 13.4424C8.34518 13.2333 8.09748 13.2328 7.94306 13.2688C7.77041 13.3091 7.62189 13.4134 7.40915 13.5926C7.39011 13.6087 7.36992 13.626 7.34862 13.6442L7.34851 13.6443L7.34846 13.6444C7.16722 13.7997 6.90549 14.0239 6.58635 14.132C6.17408 14.2717 5.73533 14.2102 5.25189 13.934C3.49612 12.9307 2.16985 12.0151 1.29214 10.8685C0.396721 9.69874 0.0010795 8.33473 0 6.50759C-1.65721e-05 6.4792 0.00199741 6.45036 0.00611728 6.42173C0.247383 4.74515 1.05488 3.50014 1.97462 2.51408C2.43249 2.0232 2.9208 1.59364 3.38081 1.20767C3.53674 1.07683 3.68705 0.952887 3.8317 0.833604C4.12293 0.593448 4.39125 0.372192 4.63639 0.151676C4.9397 -0.121168 5.29401 0.0356369 5.41671 0.119784ZM2.70589 3.19617C2.97677 2.90576 3.26267 2.63544 3.55304 2.37824C3.2172 3.0415 2.90636 3.77043 2.71057 4.49456C2.33522 5.88279 2.33542 7.47513 3.71922 8.41384C5.51739 9.63363 10.4849 12.5419 13.6494 14.3746L13.3398 14.839L9.23333 12.5575L9.22361 12.5527C8.65116 12.2664 8.15953 12.1915 7.71591 12.295C7.28938 12.3945 6.98137 12.6454 6.76476 12.8279L6.72828 12.8587C6.50462 13.0473 6.39255 13.1419 6.26553 13.1849C6.1873 13.2114 6.04723 13.2367 5.74804 13.0657C4.00625 12.0704 2.83357 11.237 2.0862 10.2607C1.36078 9.31298 1.00512 8.18762 1.00005 6.53594C1.20844 5.13594 1.88242 4.07901 2.70589 3.19617ZM14.7774 12.6826L14.2052 13.5409C11.0283 11.7014 6.05228 8.78811 4.2806 7.58628C3.45317 7.02499 3.33024 6.03401 3.6759 4.75557C3.76793 4.41521 3.88988 4.07008 4.03024 3.7297C4.02966 3.75417 4.02921 3.77866 4.02889 3.80316C4.01252 5.04948 4.33739 6.37999 5.42215 7.36948L5.43346 7.37979L5.44537 7.38939C5.72425 7.61413 6.30366 7.97705 7.02248 8.40192C7.75403 8.8343 8.66435 9.35062 9.63101 9.88824C11.3958 10.8698 13.3565 11.9268 14.7774 12.6826ZM9 4C9 4.55228 8.55228 5 8 5C7.44772 5 7 4.55228 7 4C7 3.44772 7.44772 3 8 3C8.55228 3 9 3.44772 9 4ZM10 4C10 5.10457 9.10457 6 8 6C6.89543 6 6 5.10457 6 4C6 2.89543 6.89543 2 8 2C9.10457 2 10 2.89543 10 4Z",fill:"currentColor"})]});import{jsx as b4,jsxs as Ii}from"react/jsx-runtime";var yi=C=>Ii("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[b4("title",{children:"Judo"}),b4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6492 0H3.80278C3.50664 0 3.21713 0.087657 2.97073 0.251925L0.66795 1.78711C0.250652 2.06531 0 2.53365 0 3.03518V12.5C0 13.3284 0.671573 14 1.5 14H2V14.5C2 15.3284 2.67157 16 3.5 16H12.5C13.3284 16 14 15.3284 14 14.5V14H14.5C15.3284 14 16 13.3284 16 12.5V2.98062C16 2.52495 15.7929 2.09398 15.437 1.80932L13.5863 0.328697C13.3203 0.115921 12.9898 0 12.6492 0ZM3.43629 1.1434L1.22265 2.61916C1.08355 2.71189 1 2.86801 1 3.03518V12.5C1 12.7761 1.22386 13 1.5 13H2V5.5C2 5.22386 2.22386 5 2.5 5C2.77614 5 3 5.22386 3 5.5V7.9188L6.89821 4.60532L3.43629 1.1434ZM7.66265 3.95554L11.1398 1H4.70711L7.66265 3.95554ZM3 9.23124L12.6825 1.00111C12.7842 1.00789 12.8816 1.0456 12.9616 1.10957L14.8123 2.59019C14.931 2.68508 15 2.82873 15 2.98062V12.5C15 12.7761 14.7761 13 14.5 13H14V5.5C14 5.22386 13.7761 5 13.5 5C13.2239 5 13 5.22386 13 5.5V11H3V9.23124ZM13 12H3V14.5C3 14.7761 3.22386 15 3.5 15H12.5C12.7761 15 13 14.7761 13 14.5V12Z",fill:"currentColor"}),b4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 12.2071L9.64645 13.8536C9.84171 14.0488 10.1583 14.0488 10.3536 13.8536C10.5488 13.6583 10.5488 13.3417 10.3536 13.1464L8.42426 11.2172C8.18995 10.9828 7.81005 10.9828 7.57574 11.2172L5.64645 13.1464C5.45118 13.3417 5.45118 13.6583 5.64645 13.8536C5.84171 14.0488 6.15829 14.0488 6.35355 13.8536L8 12.2071Z",fill:"currentColor"})]});import{jsx as m6,jsxs as ki}from"react/jsx-runtime";var Bi=C=>ki("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[m6("title",{children:"Karate"}),m6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6492 0C12.9898 0 13.3203 0.115921 13.5863 0.328697L15.437 1.80932C15.7929 2.09398 16 2.52495 16 2.98062V12.5C16 13.3284 15.3284 14 14.5 14H14V14.5C14 15.3284 13.3284 16 12.5 16H3.5C2.67157 16 2 15.3284 2 14.5V14H1.5C0.671573 14 0 13.3284 0 12.5V3.03518C0 2.53365 0.250652 2.06531 0.66795 1.78711L2.97073 0.251925C3.21713 0.087657 3.50664 0 3.80278 0H12.6492ZM1.22265 2.61916L3.43629 1.1434L6.89821 4.60532L3 7.9188V5.5C3 5.22386 2.77614 5 2.5 5C2.22386 5 2 5.22386 2 5.5V13H1.5C1.22386 13 1 12.7761 1 12.5V3.03518C1 2.86801 1.08355 2.71189 1.22265 2.61916ZM11.1398 1L7.66265 3.95554L4.70711 1H11.1398ZM12.6825 1.00111L3 9.23124V11H13V5.5C13 5.22386 13.2239 5 13.5 5C13.7761 5 14 5.22386 14 5.5V13H14.5C14.7761 13 15 12.7761 15 12.5V2.98062C15 2.82873 14.931 2.68508 14.8123 2.59019L12.9616 1.10957C12.8816 1.0456 12.7842 1.00789 12.6825 1.00111ZM13 12V14.5C13 14.7761 12.7761 15 12.5 15H3.5C3.22386 15 3 14.7761 3 14.5V12H6.79298L5.64645 13.1465C5.45118 13.3418 5.45118 13.6584 5.64645 13.8536C5.84171 14.0489 6.15829 14.0489 6.35355 13.8536L8 12.2072L9.64645 13.8536C9.84171 14.0489 10.1583 14.0489 10.3536 13.8536C10.5488 13.6584 10.5488 13.3418 10.3536 13.1465L9.20702 12H13Z",fill:"currentColor"})]});import{jsx as h2,jsxs as Fi}from"react/jsx-runtime";var Ei=C=>Fi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[h2("title",{children:"Kickboxing"}),h2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 7C10.5 7.27614 10.2761 7.5 10 7.5H5.5C4.67157 7.5 4 6.82843 4 6V5H3.5C3.22386 5 3 5.22386 3 5.5V7.09677C3 8.1479 3.8521 9 4.90323 9C5.50896 9 6 9.49104 6 10.0968V15H11V10.0952C11 9.49035 11.4904 9 12.0952 9C12.5949 9 13 8.59492 13 8.09524V3C13 1.89543 12.1046 1 11 1H7C5.89543 1 5 1.89543 5 3V6C5 6.27614 5.22386 6.5 5.5 6.5H10C10.2761 6.5 10.5 6.72386 10.5 7ZM3.5 4C2.67157 4 2 4.67157 2 5.5V7.09677C2 8.70018 3.29982 10 4.90323 10C4.95667 10 5 10.0433 5 10.0968V15C5 15.5523 5.44772 16 6 16H11C11.5523 16 12 15.5523 12 15V10.0952C12 10.0426 12.0426 10 12.0952 10C13.1472 10 14 9.14721 14 8.09524V3C14 1.34315 12.6569 0 11 0H7C5.34315 0 4 1.34315 4 3V4H3.5Z",fill:"currentColor"}),h2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 11C5.5 10.7239 5.72386 10.5 6 10.5C6.82843 10.5 7.5 11.1716 7.5 12C7.5 12.8284 6.82843 13.5 6 13.5C5.72386 13.5 5.5 13.2761 5.5 13C5.5 12.7239 5.72386 12.5 6 12.5C6.27614 12.5 6.5 12.2761 6.5 12C6.5 11.7239 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.2761 5.5 11Z",fill:"currentColor"}),h2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 13C11.5 13.2761 11.2761 13.5 11 13.5H10C9.17157 13.5 8.5 12.8284 8.5 12C8.5 11.1716 9.17157 10.5 10 10.5H11C11.2761 10.5 11.5 10.7239 11.5 11C11.5 11.2761 11.2761 11.5 11 11.5H10C9.72386 11.5 9.5 11.7239 9.5 12C9.5 12.2761 9.72386 12.5 10 12.5H11C11.2761 12.5 11.5 12.7239 11.5 13Z",fill:"currentColor"})]});import{jsx as b,jsxs as Di}from"react/jsx-runtime";var Ai=C=>Di("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[b("title",{children:"Lacrosse"}),b("path",{d:"M11 5.5C11 5.77614 10.7761 6 10.5 6C10.2239 6 10 5.77614 10 5.5C10 5.22386 10.2239 5 10.5 5C10.7761 5 11 5.22386 11 5.5Z",fill:"currentColor"}),b("path",{d:"M9 7.5C9 7.77614 8.77614 8 8.5 8C8.22386 8 8 7.77614 8 7.5C8 7.22386 8.22386 7 8.5 7C8.77614 7 9 7.22386 9 7.5Z",fill:"currentColor"}),b("path",{d:"M7 7.5C7 7.77614 6.77614 8 6.5 8C6.22386 8 6 7.77614 6 7.5C6 7.22386 6.22386 7 6.5 7C6.77614 7 7 7.22386 7 7.5Z",fill:"currentColor"}),b("path",{d:"M9 5.5C9 5.77614 8.77614 6 8.5 6C8.22386 6 8 5.77614 8 5.5C8 5.22386 8.22386 5 8.5 5C8.77614 5 9 5.22386 9 5.5Z",fill:"currentColor"}),b("path",{d:"M9 9.5C9 9.77614 8.77614 10 8.5 10C8.22386 10 8 9.77614 8 9.5C8 9.22386 8.22386 9 8.5 9C8.77614 9 9 9.22386 9 9.5Z",fill:"currentColor"}),b("path",{d:"M11 7.5C11 7.77614 10.7761 8 10.5 8C10.2239 8 10 7.77614 10 7.5C10 7.22386 10.2239 7 10.5 7C10.7761 7 11 7.22386 11 7.5Z",fill:"currentColor"}),b("path",{d:"M7 9.5C7 9.77614 6.77614 10 6.5 10C6.22386 10 6 9.77614 6 9.5C6 9.22386 6.22386 9 6.5 9C6.77614 9 7 9.22386 7 9.5Z",fill:"currentColor"}),b("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.75 0C11.1112 2.38419e-07 12.7456 0.538536 13.8536 1.64645C15.9086 3.70148 15.9333 5.78365 15.9298 6.00415C15.9315 6.10432 15.9364 6.78535 15.753 7.45631C15.6572 7.80668 15.4975 8.20319 15.2175 8.5098C14.9187 8.8369 14.4961 9.04402 13.9576 8.9982C13.539 8.96258 12.9979 8.82489 12.588 8.70729C12.4164 8.65806 12.2606 8.61023 12.1363 8.57083L9.56066 11.1465C9.00424 11.7029 8.21832 11.9648 7.43934 11.8536L5.17678 11.5303L0.853553 15.8536C0.658291 16.0488 0.341709 16.0488 0.146447 15.8536C-0.0488155 15.6583 -0.0488155 15.3417 0.146447 15.1465L4.46967 10.8232L4.14645 8.56067C4.03516 7.78168 4.29714 6.99576 4.85355 6.43935L7 4.2929V2C7 1.30127 7.36279 0.776191 7.8942 0.449172C8.40515 0.13474 9.06851 -1.19209e-07 9.75 0ZM7.8412 4.86591L5.56066 7.14645C5.22681 7.4803 5.06963 7.95185 5.1364 8.41924L5.44194 10.5581L7.58076 10.8636C8.04815 10.9304 8.5197 10.7732 8.85355 10.4393L11.6198 7.67312C11.629 7.66021 11.6418 7.64208 11.6574 7.61908C11.6952 7.56319 11.7493 7.47924 11.8099 7.37255C11.9322 7.15744 12.0759 6.85908 12.1706 6.51845C12.3575 5.8457 12.3479 5.05498 11.6464 4.35356C10.9229 3.62997 10.0469 3.6953 9.23951 4.01814C8.83881 4.17836 8.48413 4.39348 8.22692 4.57176C8.09929 4.66023 7.99805 4.73796 7.9298 4.79263C7.89573 4.81992 7.87003 4.84134 7.85354 4.85533L7.8412 4.86591ZM12.7615 7.71633C12.7948 7.72614 12.8289 7.73607 12.8637 7.74606C13.271 7.86291 13.7299 7.97521 14.0424 8.0018C14.2443 8.01898 14.3708 7.95396 14.4791 7.83537C14.6062 7.69628 14.7116 7.47353 14.7884 7.19266C14.941 6.63412 14.9304 6.03875 14.9299 6.01673L14.9298 6.01567C14.9298 6.01567 14.9296 6.00605 14.9297 5.99593L14.93 5.98642L14.9299 5.98905C14.9295 6.00431 14.9822 4.18931 13.1464 2.35356C12.2544 1.46147 10.8888 1 9.75 1C9.18149 1 8.71985 1.11526 8.4183 1.30083C8.13721 1.47381 8 1.69874 8 2V3.52721C8.2481 3.3765 8.54288 3.21971 8.86825 3.08962C9.84674 2.69838 11.2208 2.5137 12.3536 3.64645C13.3916 4.68451 13.382 5.89379 13.1341 6.78616C13.033 7.14971 12.8917 7.46829 12.7615 7.71633Z",fill:"currentColor"}),b("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 15C14.3284 15 15 14.3284 15 13.5C15 12.6716 14.3284 12 13.5 12C12.6716 12 12 12.6716 12 13.5C12 14.3284 12.6716 15 13.5 15ZM16 13.5C16 14.8807 14.8807 16 13.5 16C12.1193 16 11 14.8807 11 13.5C11 12.1193 12.1193 11 13.5 11C14.8807 11 16 12.1193 16 13.5Z",fill:"currentColor"})]});import{jsx as y4,jsxs as _i}from"react/jsx-runtime";var Ti=C=>_i("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[y4("title",{children:"MMA"}),y4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.81761 1.39942L1.39942 4.81761C1.19643 5.0206 1.08239 5.29591 1.08239 5.58297L1.08239 10.417C1.08239 10.7041 1.19643 10.9794 1.39942 11.1824L4.81761 14.6006C5.0206 14.8036 5.29591 14.9176 5.58297 14.9176H10.417C10.7041 14.9176 10.9794 14.8036 11.1824 14.6006L14.6006 11.1824C14.8036 10.9794 14.9176 10.7041 14.9176 10.417L14.9176 5.58297C14.9176 5.29591 14.8036 5.0206 14.6006 4.81761L11.1824 1.39942C10.9794 1.19643 10.7041 1.08239 10.417 1.08239L5.58297 1.08239C5.29591 1.08239 5.0206 1.19643 4.81761 1.39942ZM0.634051 4.05224C0.228075 4.45822 6.16413e-08 5.00884 0 5.58297L1.77115e-07 10.417C2.23579e-07 10.9912 0.228074 11.5418 0.63405 11.9478L4.05224 15.3659C4.45822 15.7719 5.00884 16 5.58297 16H10.417C10.9912 16 11.5418 15.7719 11.9478 15.3659L15.3659 11.9478C15.7719 11.5418 16 10.9912 16 10.417L16 5.58297C16 5.00884 15.7719 4.45822 15.3659 4.05224L11.9478 0.634051C11.5418 0.228075 10.9912 3.89467e-07 10.417 0L5.58297 8.08515e-07C5.00884 7.15317e-07 4.45822 0.228075 4.05224 0.63405L0.634051 4.05224Z",fill:"currentColor"}),y4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5008 4.3806L4.3806 6.5008L4.3806 9.4992L6.5008 11.6194L9.4992 11.6194L11.6194 9.4992V6.5008L9.4992 4.3806H6.5008ZM3.6735 5.79369C3.48596 5.98123 3.3806 6.23558 3.3806 6.5008L3.3806 9.4992C3.3806 9.76442 3.48596 10.0188 3.6735 10.2063L5.79369 12.3265C5.98123 12.514 6.23558 12.6194 6.5008 12.6194H9.4992C9.76442 12.6194 10.0188 12.514 10.2063 12.3265L12.3265 10.2063C12.514 10.0188 12.6194 9.76442 12.6194 9.4992L12.6194 6.5008C12.6194 6.23558 12.514 5.98123 12.3265 5.79369L10.2063 3.6735C10.0188 3.48596 9.76442 3.3806 9.4992 3.3806L6.5008 3.3806C6.23558 3.3806 5.98123 3.48596 5.79369 3.6735L3.6735 5.79369Z",fill:"currentColor"})]});import{jsx as w6,jsxs as Oi}from"react/jsx-runtime";var Wi=C=>Oi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[w6("title",{children:"Motorsport"}),w6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.27772 4.29409C1.34571 5.57653 0.999278 7.09655 0.999278 8.00003C0.999278 10.3367 1.48651 11.8544 2.10123 12.7715C2.71368 13.6853 3.44448 14 3.99711 14H14.4895C14.5337 14 14.6372 13.9882 14.7614 13.7268C14.8882 13.4598 14.9787 13.03 14.9972 12.4527C15.0111 12.0195 14.9838 11.5263 14.9131 10.995L14.8405 10.988C14.7748 10.9816 14.6792 10.9722 14.5592 10.9599C14.3191 10.9355 13.9809 10.8999 13.5879 10.8552C12.8034 10.766 11.7944 10.6398 10.9104 10.4933C9.92059 10.3292 8.49333 10.0399 7.41788 9.81484C6.29248 9.57928 5.49603 8.58458 5.49603 7.43931C5.49603 6.09212 6.58736 5 7.93357 5H12.5225C11.2097 3.25295 9.37535 2 6.99495 2C4.67258 2 3.19279 3.03496 2.27772 4.29409ZM13.8215 5.12567C12.365 2.84589 10.1256 1 6.99495 1C4.32092 1 2.55306 2.21504 1.46957 3.70592C0.403022 5.17349 0 6.90348 0 8.00003C0 10.4633 0.512047 12.1957 1.27134 13.3286C2.03289 14.4648 3.05083 15 3.99711 15H14.4895C15.0699 15 15.4504 14.6056 15.6639 14.1561C15.8747 13.7121 15.9755 13.1263 15.996 12.4848C16.0374 11.191 15.7572 9.50198 15.1462 7.82841C14.8441 7.001 14.4542 6.1616 13.9722 5.36765C13.9462 5.27273 13.893 5.1891 13.8215 5.12567ZM13.1886 6H7.93357C7.13924 6 6.49531 6.6444 6.49531 7.43931C6.49531 8.11652 6.96526 8.69846 7.62246 8.83602C8.69828 9.0612 10.1069 9.34644 11.0737 9.50672C11.9329 9.64916 12.9224 9.77304 13.7007 9.86157C14.0891 9.90575 14.4233 9.94094 14.6603 9.96508C14.6854 9.96764 14.7094 9.97007 14.7322 9.97237C14.6046 9.38997 14.4305 8.78194 14.2076 8.1716C13.935 7.42509 13.5958 6.68919 13.1886 6Z",fill:"currentColor"})]});import{jsx as H6,jsxs as Ui}from"react/jsx-runtime";var Ni=C=>Ui("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[H6("title",{children:"Netball"}),H6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.04162 6.20429C2.0141 6.46215 2 6.72755 2 7C2 7.27614 1.77614 7.5 1.5 7.5C1.22386 7.5 1 7.27614 1 7C1 4.9644 1.70076 3.2075 2.94614 1.95816C4.19176 0.708577 5.94908 0 8.00001 0C10.048 0 11.8051 0.693477 13.0518 1.9298C14.2989 3.16647 15 4.91135 15 6.94736C15 7.2235 14.7761 7.44736 14.5 7.44736C14.2239 7.44736 14 7.2235 14 6.94736C14 6.35759 13.934 5.80237 13.8087 5.28622C13.7807 5.32743 13.7518 5.36931 13.7221 5.41173C13.2702 6.05735 12.6029 6.86567 11.7774 7.41603C11.5476 7.5692 11.2372 7.50711 11.084 7.27735C10.9308 7.04759 10.9929 6.73715 11.2226 6.58397C11.8971 6.13433 12.4798 5.44265 12.9029 4.83827C13.1077 4.54567 13.2695 4.28164 13.3809 4.08928C13.1129 3.53886 12.7642 3.05294 12.3477 2.63986C12.3248 2.61716 12.3017 2.59467 12.2783 2.57238C12.1232 3.02975 11.8604 3.6108 11.416 4.27735C10.8482 5.12905 10.0123 5.67785 9.34861 6.00971C9.01284 6.1776 8.71087 6.29506 8.49168 6.37093C8.48809 6.37217 8.48452 6.37341 8.48097 6.37463C8.48032 6.45568 8.48131 6.54034 8.48337 6.62245C8.48581 6.7199 8.48953 6.80693 8.49265 6.86954C8.4942 6.90076 8.49559 6.92572 8.49658 6.94264L8.49772 6.96172L8.49801 6.96629L8.49808 6.96731C8.51611 7.24284 8.30738 7.48088 8.03184 7.49893C7.75629 7.51698 7.51827 7.30824 7.50022 7.03269L7.50005 7.03002L7.49965 7.02373L7.49828 7.00095C7.49714 6.98145 7.49559 6.9536 7.49388 6.9192C7.49047 6.85054 7.48638 6.75506 7.48368 6.6475C7.48094 6.53776 7.47937 6.40704 7.48238 6.27585C7.3255 6.19082 7.09809 6.07773 6.81436 5.96423C6.33791 5.77364 5.71198 5.58563 5.00001 5.52237C5.00089 5.99095 5.02928 6.33855 5.05656 6.56529C5.07041 6.68048 5.08398 6.76453 5.09354 6.81748C5.09831 6.84395 5.10208 6.86265 5.10438 6.87358L5.10667 6.88415C5.17112 7.15256 5.00562 7.42157 4.73721 7.48613C4.46873 7.55072 4.19872 7.38542 4.13414 7.11694L4.62003 7.00006C4.13414 7.11694 4.13417 7.11705 4.13414 7.11694L4.13364 7.11484L4.13297 7.11201L4.13117 7.10413L4.12582 7.07955C4.12155 7.05922 4.11592 7.03105 4.10942 6.99502C4.09642 6.92297 4.07993 6.81952 4.06371 6.68471C4.03177 6.41913 4.00094 6.03204 4.00001 5.52355C3.3362 5.58723 2.82823 5.76995 2.47366 5.94722C2.28853 6.03978 2.14449 6.13125 2.04162 6.20429ZM2.30527 4.92442C2.84889 4.69466 3.58145 4.5 4.50013 4.5C5.58161 4.5 6.52097 4.76983 7.18577 5.03577C7.51933 5.1692 7.78731 5.30306 7.97383 5.40481C8.00842 5.42368 8.04025 5.44146 8.06922 5.45796C8.09823 5.44853 8.13011 5.43787 8.16457 5.42594C8.35163 5.36119 8.61216 5.2599 8.90139 5.11529C9.29092 4.92052 9.7148 4.65599 10.0822 4.31024C10.0468 4.28425 10.0026 4.25256 9.95015 4.21634C9.79042 4.10598 9.55558 3.9544 9.26106 3.79418C8.66888 3.47202 7.85232 3.12415 6.9307 2.99516C6.04482 2.87118 5.00765 3.09267 4.15484 3.37042C3.73579 3.5069 3.37598 3.652 3.12142 3.7628C2.99437 3.8181 2.89412 3.8646 2.82649 3.89685C2.79269 3.91296 2.76708 3.92549 2.75038 3.93375L2.73214 3.94285L2.72822 3.94484C2.72824 3.94482 2.72775 3.94507 2.72053 3.93092C2.5551 4.24126 2.41589 4.57301 2.30527 4.92442ZM3.95651 2.38392C4.84114 2.10537 6.00063 1.85524 7.0693 2.00482C8.14768 2.15575 9.08112 2.55788 9.73894 2.91575C10.0694 3.09554 10.3346 3.26648 10.5186 3.39363C10.5968 3.44765 10.6605 3.49392 10.7086 3.52979C11.0963 2.91076 11.2936 2.40245 11.3942 2.05014C11.408 2.00195 11.42 1.95661 11.4304 1.91425C10.4973 1.33062 9.33651 1 8.00001 1C6.35421 1 4.97347 1.51218 3.95651 2.38392ZM5.10667 6.88415C5.10672 6.88433 5.10685 6.88494 5.10667 6.88415V6.88415ZM7.87793 5.51513C7.8778 5.51516 7.87783 5.51516 7.87793 5.51513V5.51513ZM14.0035 8.5C14.0013 8.49999 13.9992 8.49999 13.997 8.5H11.0005C11.0002 8.5 11.0008 8.5 11.0005 8.5H9.00049C9.00016 8.5 9.00082 8.5 9.00049 8.5H7.00049C7.00016 8.5 7.00082 8.5 7.00049 8.5H5.00049C5.00016 8.5 5.00082 8.5 5.00049 8.5H0.5C0.223858 8.5 0 8.72386 0 9C0 9.27614 0.223858 9.5 0.5 9.5H1.89362C1.48458 9.63551 1.16622 10.0387 1.25241 10.5558C1.41257 11.5168 1.42397 12.4967 1.28619 13.4611L1.00503 15.4293C0.965973 15.7027 1.15592 15.9559 1.42929 15.995C1.70266 16.034 1.95592 15.8441 1.99497 15.5707L2.07461 15.0133L2.58397 15.7774C2.73715 16.0071 3.04759 16.0692 3.27735 15.916C3.50711 15.7628 3.5692 15.4524 3.41603 15.2226L2.6434 14.0637L4.12558 12.5815L5.36675 13.9261L4.14645 15.1464C3.95118 15.3417 3.95118 15.6583 4.14645 15.8536C4.34171 16.0488 4.65829 16.0488 4.85355 15.8536L6.04558 14.6615L7.1326 15.8391C7.3199 16.042 7.63623 16.0547 7.83914 15.8674C7.94511 15.7696 7.99919 15.6366 7.99999 15.5029C8.00087 15.6438 8.06101 15.7835 8.17703 15.8817C8.38783 16.0601 8.70332 16.0338 8.88169 15.823L9.90569 14.6128L11.1464 15.8536C11.3417 16.0488 11.6583 16.0488 11.8536 15.8536C12.0488 15.6583 12.0488 15.3417 11.8536 15.1464L10.5539 13.8468L11.739 12.4461L13.5429 14.25L12.6464 15.1464C12.4512 15.3417 12.4512 15.6583 12.6464 15.8536C12.8417 16.0488 13.1583 16.0488 13.3536 15.8536L13.9589 15.2482L14.005 15.5707C14.0441 15.8441 14.2973 16.034 14.5707 15.995C14.8441 15.9559 15.034 15.7027 14.995 15.4293L14.7138 13.4611C14.576 12.4967 14.5874 11.5168 14.7476 10.5559L14.9236 9.5H15.5C15.7761 9.5 16 9.27614 16 9C16 8.72386 15.7761 8.5 15.5 8.5H14.5082C14.5023 8.4999 14.4964 8.4999 14.4906 8.5H14.0035ZM13.6509 12.9438C13.5837 12.0925 13.6205 11.2354 13.7612 10.3915L13.8308 9.97408L12.3872 11.6801L13.6509 12.9438ZM11.6776 10.9705L12.9219 9.5H11.2071L10.7071 10L11.6776 10.9705ZM8.79289 9.5L9.29289 10L8 11.2929L6.70711 10L7.20711 9.5H8.79289ZM4.79289 9.5H2.49138C2.63078 9.54802 2.76424 9.63243 2.88074 9.75864L4.15442 11.1385L5.29289 10L4.79289 9.5ZM6 10.7071L4.83325 11.8739L6.07442 13.2185L7.29289 12L6 10.7071ZM8 12.7071L6.75325 13.9539L7.8674 15.1609C7.9555 15.2563 7.99937 15.3768 8 15.4972C8.00056 15.384 8.03942 15.2703 8.11831 15.177L9.19613 13.9032L8 12.7071ZM9.84431 13.1372L11.0295 11.7366L10 10.7071L8.70711 12L9.84431 13.1372ZM3.44675 11.8461L2.26664 10.5677C2.38408 11.3546 2.41163 12.1517 2.34912 12.9438L3.44675 11.8461Z",fill:"currentColor"})]});import{jsx as _1,jsxs as Ki}from"react/jsx-runtime";var Ji=C=>Ki("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[_1("title",{children:"Olympics"}),_1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.85081 15C9.50767 15 10.8508 13.6569 10.8508 12C10.8508 10.3431 9.50767 9 7.85081 9C6.19396 9 4.85081 10.3431 4.85081 12C4.85081 13.6569 6.19396 15 7.85081 15ZM7.85081 16C10.06 16 11.8508 14.2091 11.8508 12C11.8508 9.79086 10.06 8 7.85081 8C5.64167 8 3.85081 9.79086 3.85081 12C3.85081 14.2091 5.64167 16 7.85081 16Z",fill:"currentColor"}),_1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.85081 0.292893C3.03835 0.105357 3.2927 0 3.55792 0H12.1437C12.4089 0 12.6633 0.105357 12.8508 0.292893L15.4025 2.84459C15.7502 3.19232 15.7935 3.74126 15.5046 4.13921L10.9617 10.3965L10.1524 9.80897L14.6954 3.55169L12.1437 1L3.55792 1L1.00001 3.5579L5.35554 9.82326L4.53445 10.3941L0.178926 4.12871C-0.0973512 3.73129 -0.0493431 3.19305 0.292908 2.8508L2.85081 0.292893Z",fill:"currentColor"}),_1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.8751 0.884631L6.96618 9.13513L6.15318 8.55287L12.0621 0.302368L12.8751 0.884631Z",fill:"currentColor"}),_1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.73347 0.306399L8.30369 7.13754L7.47255 7.6936L2.90233 0.862457L3.73347 0.306399Z",fill:"currentColor"}),_1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.35081 3.5H10.1384V4.5H5.35081V3.5Z",fill:"currentColor"})]});import{jsx as W1,jsxs as zi}from"react/jsx-runtime";var qi=C=>zi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[W1("title",{children:"Pageant"}),W1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.50875 1.91047L7.5076 1.91297L7.50572 1.92309L7.49769 1.9651C7.49045 2.00246 7.47944 2.05807 7.46465 2.12934C7.43507 2.27195 7.39046 2.47692 7.33088 2.72369C7.21137 3.21858 7.03311 3.8753 6.79709 4.53205C6.5591 5.19425 6.27181 5.82952 5.94298 6.2977C5.61181 6.76922 5.31084 6.97073 5.05967 6.99693C3.85803 6.65023 3.17596 6.37334 2.79711 6.17133C2.72446 6.13259 2.66529 6.09782 2.61733 6.06725C2.56903 5.98224 2.52815 5.91152 2.4971 5.85827C2.41408 5.7159 2.22332 5.54467 1.95106 5.57417C1.79757 5.5908 1.63121 5.6791 1.53989 5.85441C1.45689 6.01374 1.476 6.16746 1.50107 6.2567C1.54843 6.42533 1.65443 6.5668 1.78349 6.68651C1.80502 6.70647 1.82783 6.72644 1.85198 6.74643C2.01899 7.04659 2.23678 7.45317 2.43928 7.87763C2.59648 8.20714 2.74056 8.53934 2.84435 8.836C2.95237 9.1448 3 9.36926 3 9.5V12.0002C3 12.5527 3.44794 13 4 13H12C12.5521 13 13 12.5527 13 12.0002V9.5C13 9.36927 13.0476 9.14482 13.1557 8.83603C13.2595 8.53937 13.4036 8.20718 13.5608 7.87767C13.7634 7.45314 13.9812 7.04651 14.1483 6.74633C14.1723 6.7264 14.1951 6.70649 14.2165 6.68659C14.3456 6.5669 14.4516 6.42548 14.4991 6.25692C14.5241 6.16772 14.5433 6.01402 14.4604 5.85465C14.3692 5.67927 14.2028 5.59086 14.0492 5.57419C13.7769 5.54463 13.5861 5.71594 13.5031 5.85826C13.4721 5.91149 13.4312 5.98218 13.3829 6.06714C13.3349 6.09774 13.2757 6.13256 13.2029 6.17134C12.8235 6.37362 12.1402 6.65094 10.9358 6.99826C10.5372 6.97632 10.1774 6.74383 9.84306 6.29647C9.50276 5.84114 9.23339 5.21798 9.0271 4.56075C8.82268 3.90948 8.6898 3.25631 8.60802 2.76279C8.56727 2.51691 8.53955 2.31273 8.5221 2.17086C8.51338 2.09997 8.50724 2.04477 8.50333 2.00784L8.49909 1.96651L8.49815 1.95676L8.49796 1.95472L7.50875 1.91047ZM12.6317 7.50307C12.2458 7.64415 11.7771 7.79649 11.2076 7.9606C11.1222 7.98523 11.0184 8.00274 10.9078 7.99806C10.0928 7.96356 9.48149 7.4831 9.04205 6.89513C8.60459 6.30979 8.29413 5.56475 8.073 4.86022C8.01725 4.68261 7.96656 4.50553 7.92052 4.33165C7.864 4.50872 7.80322 4.68922 7.73816 4.87026C7.48789 5.56664 7.16486 6.29789 6.76131 6.87246C6.36967 7.43007 5.82399 7.94975 5.10294 7.99666C4.98294 8.00447 4.87464 7.98431 4.79237 7.9606C4.22294 7.79651 3.75425 7.64417 3.36844 7.5031C3.52448 7.83343 3.67445 8.18049 3.78825 8.50579C3.90427 8.83742 4 9.19356 4 9.5V12H12V9.5C12 9.19355 12.0958 8.8374 12.2118 8.50578C12.3256 8.18047 12.4756 7.83341 12.6317 7.50307ZM3 14.5C3 14.2239 3.22386 14 3.5 14H12.5C12.7761 14 13 14.2239 13 14.5C13 14.7761 12.7761 15 12.5 15H3.5C3.22386 15 3 14.7761 3 14.5Z",fill:"currentColor"}),W1("path",{d:"M9 2C9 2.55228 8.55228 3 8 3C7.44772 3 7 2.55228 7 2C7 1.44772 7.44772 1 8 1C8.55228 1 9 1.44772 9 2Z",fill:"currentColor"}),W1("path",{d:"M3 6C3 6.55228 2.55228 7 2 7C1.44772 7 1 6.55228 1 6C1 5.44772 1.44772 5 2 5C2.55228 5 3 5.44772 3 6Z",fill:"currentColor"}),W1("path",{d:"M15 6C15 6.55228 14.5523 7 14 7C13.4477 7 13 6.55228 13 6C13 5.44772 13.4477 5 14 5C14.5523 5 15 5.44772 15 6Z",fill:"currentColor"}),W1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 8.20711L7.60838 8.59873L8 9.38197L8.39162 8.59873L8 8.20711ZM7.57574 7.21716C7.81005 6.98284 8.18995 6.98284 8.42426 7.21716L9.09873 7.89162C9.40309 8.19598 9.47854 8.66095 9.28605 9.04594L8.53666 10.5447C8.31554 10.987 7.68446 10.987 7.46334 10.5447L6.71395 9.04594C6.52146 8.66095 6.59691 8.19598 6.90127 7.89162L7.57574 7.21716Z",fill:"currentColor"})]});import{jsx as v5,jsxs as Yi}from"react/jsx-runtime";var Xi=C=>Yi("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[v5("title",{children:"Pitch"}),v5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.995 4H0.999664V12H14.995V4ZM0.999664 3C0.447565 3 0 3.44772 0 4V12C0 12.5523 0.447565 13 0.999664 13H14.995C15.5471 13 15.9946 12.5523 15.9946 12V4C15.9946 3.44772 15.5471 3 14.995 3H0.999664Z",fill:"currentColor"}),v5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99732 3C8.27337 3 8.49715 3.22386 8.49715 3.5V12.5C8.49715 12.7761 8.27337 13 7.99732 13C7.72127 13 7.49748 12.7761 7.49748 12.5V3.5C7.49748 3.22386 7.72127 3 7.99732 3Z",fill:"currentColor"}),v5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.4995 10C2.16473 10 2.99899 9.28303 2.99899 8C2.99899 6.71697 2.16473 6 1.4995 6C1.45557 6 1.34201 5.99749 1.2027 5.99442C1.13901 5.99302 1.06993 5.99149 0.999664 5.99004V10.01C1.06993 10.0085 1.13901 10.007 1.2027 10.0056C1.34201 10.0025 1.45557 10 1.4995 10ZM0 11V5C0.124205 4.96974 0.843017 4.98602 1.24625 4.99516C1.36734 4.9979 1.45997 5 1.4995 5C2.87975 5 3.99866 6.34314 3.99866 8C3.99866 9.65685 2.87975 11 1.4995 11C1.45997 11 1.36733 11.0021 1.24625 11.0048C0.843011 11.014 0.124204 11.0303 0 11Z",fill:"currentColor"}),v5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5005 6.02087C13.8353 6.02087 13.001 6.73784 13.001 8.02087C13.001 9.3039 13.8353 10.0209 14.5005 10.0209C14.5444 10.0209 14.658 10.0234 14.7973 10.0264C14.861 10.0278 14.9301 10.0294 15.0003 10.0308V6.0109C14.9301 6.01236 14.861 6.01388 14.7973 6.01529C14.658 6.01836 14.5444 6.02087 14.5005 6.02087ZM16 5.02087V11.0209C15.8758 11.0511 15.157 11.0348 14.7537 11.0257C14.6327 11.023 14.54 11.0209 14.5005 11.0209C13.1203 11.0209 12.0013 9.67772 12.0013 8.02087C12.0013 6.36401 13.1203 5.02087 14.5005 5.02087C14.54 5.02087 14.6327 5.01877 14.7538 5.01602C15.157 5.00689 15.8758 4.9906 16 5.02087Z",fill:"currentColor"})]});import{jsx as a2,jsxs as $i}from"react/jsx-runtime";var Qi=C=>$i("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[a2("title",{children:"PlayingCard"}),a2("path",{d:"M4 1.5C4 0.947715 4.44772 0.5 5 0.5H14C14.5523 0.5 15 0.947715 15 1.5V14C15 14.5523 14.5523 15 14 15C13.7239 15 13.5 14.7761 13.5 14.5C13.5 14.2239 13.7239 14 14 14V1.5H5V2C5 2.27614 4.77614 2.5 4.5 2.5C4.22386 2.5 4 2.27614 4 2V1.5Z",fill:"currentColor"}),a2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99909 6.5C8.14188 6.5 8.27426 6.57578 8.3518 6.70208L9.93096 9.25521C10.0231 9.4047 10.0231 9.59537 9.93096 9.74486L8.3518 12.298C8.27568 12.423 8.14259 12.4992 7.99909 12.5001C7.85559 12.4992 7.7225 12.423 7.64638 12.298L6.06722 9.74486L6.06911 9.74388C5.97696 9.5944 5.97696 9.40373 6.06911 9.25424L7.64638 6.7011C7.72272 6.57649 7.85578 6.50063 7.99909 6.5ZM8.00037 8L6.99998 9.5L8.00037 11L8.99998 9.5L8.00037 8Z",fill:"currentColor"}),a2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3C3.44772 3 3 3.44772 3 4V15C3 15.5523 3.44772 16 4 16H12C12.5523 16 13 15.5523 13 15V4C13 3.44772 12.5523 3 12 3H4ZM12 4H4V15H12V4Z",fill:"currentColor"})]});import{jsx as L2,jsxs as Cn}from"react/jsx-runtime";var ji=C=>Cn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[L2("title",{children:"Rowing"}),L2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.353553 2.26777C0.158291 2.0725 0.158291 1.75592 0.353553 1.56066L1.76777 0.146447C1.96303 -0.0488155 2.27961 -0.0488155 2.47487 0.146447L4.59619 2.26777C5.08039 2.75197 5.16436 3.48484 4.8481 4.05529C4.84993 4.05706 4.85175 4.05885 4.85355 4.06066L6.79095 5.99806C6.98621 6.19332 6.98621 6.5099 6.79095 6.70517C6.59569 6.90043 6.27911 6.90043 6.08384 6.70517L4.14645 4.76777C4.13048 4.7518 4.11583 4.73503 4.10247 4.71758C3.56025 4.9386 2.91489 4.8291 2.47487 4.38909L0.353553 2.26777ZM3.18198 3.68198L1.41421 1.91421L2.12132 1.20711L3.88909 2.97487C4.08435 3.17014 4.08435 3.48672 3.88909 3.68198C3.69383 3.87724 3.37724 3.87724 3.18198 3.68198Z",fill:"currentColor"}),L2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.3536 0.267767C14.1583 0.0725047 13.8417 0.0725048 13.6464 0.267767L11.5251 2.38909C11.0863 2.82791 10.9762 3.47099 11.1948 4.01229L0.146447 15.0607C-0.0488155 15.256 -0.0488155 15.5725 0.146447 15.7678C0.341709 15.9631 0.658291 15.9631 0.853553 15.7678L11.859 4.76236C12.4294 5.07857 13.1623 4.99459 13.6464 4.51041L15.7678 2.38909C15.963 2.19383 15.963 1.87724 15.7678 1.68198L14.3536 0.267767ZM14 1.32843L12.2322 3.09619C12.037 3.29146 12.037 3.60804 12.2322 3.8033C12.4275 3.99856 12.7441 3.99856 12.9393 3.8033L14.7071 2.03553L14 1.32843Z",fill:"currentColor"}),L2("path",{d:"M15.1464 15.7678C15.3417 15.963 15.6583 15.963 15.8536 15.7678C16.0488 15.5725 16.0488 15.2559 15.8536 15.0607L9.85355 9.06066C9.65829 8.8654 9.34171 8.8654 9.14645 9.06066C8.95118 9.25592 8.95118 9.5725 9.14645 9.76777L15.1464 15.7678Z",fill:"currentColor"})]});import{jsx as M6,jsxs as on}from"react/jsx-runtime";var en=C=>on("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[M6("title",{children:"Rugby"}),M6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 1.38906C16.0023 0.612712 15.3873 -0.0023089 14.6109 6.51628e-06C13.5454 0.00318453 11.6431 0.092032 9.59729 0.586193C7.55646 1.07916 5.32842 1.9861 3.65724 3.65725C1.98605 5.32842 1.07911 7.55645 0.586154 9.59729C0.0920017 11.6431 0.00317295 13.5454 6.46908e-06 14.6109C-0.00230054 15.3873 0.61272 16.0023 1.38907 16C2.45463 15.9968 4.35693 15.908 6.40272 15.4138C8.44355 14.9208 10.6716 14.0139 12.3428 12.3427C14.0139 10.6715 14.9209 8.44353 15.4138 6.4027C15.908 4.35691 15.9968 2.45463 16 1.38906ZM13.9598 1.00995C12.9066 1.04625 11.4104 1.17444 9.8315 1.55582C7.88318 2.02644 5.85324 2.87197 4.36258 4.36261C2.87193 5.85325 2.02639 7.88318 1.55578 9.8315C1.17438 11.4105 1.04622 12.9068 1.00994 13.96C1.26308 13.5211 1.62603 12.9214 2.09888 12.2122C3.10991 10.6956 4.62645 8.67338 6.65002 6.64981C8.67358 4.62624 10.6958 3.1097 12.2124 2.09867C12.9214 1.62596 13.521 1.26308 13.9598 1.00995ZM1.57101 15.0011C2.6177 14.9882 4.33748 14.8865 6.1685 14.4442C8.11683 13.9736 10.1468 13.128 11.6374 11.6374C13.128 10.1467 13.9736 8.1168 14.4442 6.16848C14.8865 4.3374 14.9882 2.61758 15.0011 1.57091C14.8899 1.6306 14.7359 1.71513 14.5445 1.8245C14.1169 2.06885 13.5033 2.43693 12.7657 2.92865C11.2897 3.91265 9.32187 5.38866 7.35537 7.35516C5.38887 9.32166 3.91286 11.2895 2.92886 12.7655C2.43714 13.5031 2.06906 14.1167 1.82471 14.5443C1.71528 14.7358 1.63071 14.8899 1.57101 15.0011Z",fill:"currentColor"})]});import{jsx as g2,jsxs as tn}from"react/jsx-runtime";var ln=C=>tn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[g2("title",{children:"RugbyPitch"}),g2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 4H1V12H15V4ZM1 3C0.447715 3 0 3.44772 0 4V12C0 12.5523 0.447715 13 1 13H15C15.5523 13 16 12.5523 16 12V4C16 3.44772 15.5523 3 15 3H1Z",fill:"currentColor"}),g2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 3C2.77614 3 3 3.22386 3 3.5V12.5C3 12.7761 2.77614 13 2.5 13C2.22386 13 2 12.7761 2 12.5V3.5C2 3.22386 2.22386 3 2.5 3ZM5 3C5.27614 3 5.5 3.22386 5.5 3.5V12.5C5.5 12.7761 5.27614 13 5 13C4.72386 13 4.5 12.7761 4.5 12.5V3.5C4.5 3.22386 4.72386 3 5 3ZM8 3C8.27614 3 8.5 3.22386 8.5 3.5V4.5H9C9.27614 4.5 9.5 4.72386 9.5 5C9.5 5.27614 9.27614 5.5 9 5.5H8.5V10.5H9C9.27614 10.5 9.5 10.7239 9.5 11C9.5 11.2761 9.27614 11.5 9 11.5H8.5V12.5C8.5 12.7761 8.27614 13 8 13C7.72386 13 7.5 12.7761 7.5 12.5V11.5H7C6.72386 11.5 6.5 11.2761 6.5 11C6.5 10.7239 6.72386 10.5 7 10.5H7.5V5.5H7C6.72386 5.5 6.5 5.27614 6.5 5C6.5 4.72386 6.72386 4.5 7 4.5H7.5V3.5C7.5 3.22386 7.72386 3 8 3ZM11 3C11.2761 3 11.5 3.22386 11.5 3.5V12.5C11.5 12.7761 11.2761 13 11 13C10.7239 13 10.5 12.7761 10.5 12.5V3.5C10.5 3.22386 10.7239 3 11 3ZM13.5 3C13.7761 3 14 3.22386 14 3.5V12.5C14 12.7761 13.7761 13 13.5 13C13.2239 13 13 12.7761 13 12.5V3.5C13 3.22386 13.2239 3 13.5 3Z",fill:"currentColor"}),g2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5C2 4.72386 2.22386 4.5 2.5 4.5H3.5C3.77614 4.5 4 4.72386 4 5C4 5.27614 3.77614 5.5 3.5 5.5H2.5C2.22386 5.5 2 5.27614 2 5ZM12 5C12 4.72386 12.2239 4.5 12.5 4.5H13.5C13.7761 4.5 14 4.72386 14 5C14 5.27614 13.7761 5.5 13.5 5.5H12.5C12.2239 5.5 12 5.27614 12 5ZM2 11C2 10.7239 2.22386 10.5 2.5 10.5H3.5C3.77614 10.5 4 10.7239 4 11C4 11.2761 3.77614 11.5 3.5 11.5H2.5C2.22386 11.5 2 11.2761 2 11ZM11.8453 11C11.8453 10.7239 12.0692 10.5 12.3453 10.5H13.5C13.7761 10.5 14 10.7239 14 11C14 11.2761 13.7761 11.5 13.5 11.5H12.3453C12.0692 11.5 11.8453 11.2761 11.8453 11Z",fill:"currentColor"})]});import{jsx as u2,jsxs as nn}from"react/jsx-runtime";var rn=C=>nn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[u2("title",{children:"Run"}),u2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2C14 3.10457 13.1046 4 12 4C10.8954 4 10 3.10457 10 2C10 0.895431 10.8954 0 12 0C13.1046 0 14 0.895431 14 2ZM13 2C13 2.55228 12.5523 3 12 3C11.4477 3 11 2.55228 11 2C11 1.44772 11.4477 1 12 1C12.5523 1 13 1.44772 13 2Z",fill:"currentColor"}),u2("path",{d:"M9.20711 2.49992C8.81658 2.1094 8.18342 2.1094 7.79289 2.49992L5.14645 5.14637C4.95118 5.34163 4.95118 5.65822 5.14645 5.85348C5.34171 6.04874 5.65829 6.04874 5.85355 5.85348L8.5 3.20703L10.2929 4.99998L7.94598 7.34694C7.60032 7.6926 7.55522 8.2375 7.83935 8.63529L9.88043 11.4928L7.10003 15.2C6.93434 15.4209 6.97912 15.7343 7.20003 15.9C7.42094 16.0657 7.73434 16.0209 7.90003 15.8L10.6804 12.0928C10.9419 11.7441 10.9475 11.2662 10.6942 10.9116L8.65309 8.05405L11.0001 5.70708L13 7.70703C13.1875 7.89457 13.4419 7.99992 13.7071 7.99992H15.5C15.7761 7.99992 16 7.77607 16 7.49992C16 7.22378 15.7761 6.99992 15.5 6.99992L13.7071 6.99993L9.20711 2.49992Z",fill:"currentColor"}),u2("path",{d:"M7.85355 11.8536C8.04882 11.6583 8.04882 11.3417 7.85355 11.1464C7.65829 10.9512 7.34171 10.9512 7.14645 11.1464L6.29289 12H2.5C2.22386 12 2 12.2239 2 12.5C2 12.7761 2.22386 13 2.5 13H6.29289C6.55811 13 6.81246 12.8946 7 12.7071L7.85355 11.8536Z",fill:"currentColor"})]});import{jsx as I4,jsxs as pn}from"react/jsx-runtime";var dn=C=>pn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[I4("title",{children:"Sailing"}),I4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.9317 10.9214H1.06773L2.49027 14.9843L12.7979 14.9843L14.9317 10.9214ZM1.06773 9.90569C0.3395 9.90569 -0.174717 10.5849 0.0555682 11.2426L1.47811 15.3055C1.62333 15.7202 2.03104 16 2.49027 16H12.7979C13.202 16 13.5714 15.7826 13.7522 15.4385L15.886 11.3756C16.2407 10.7003 15.7248 9.90569 14.9317 9.90569H1.06773Z",fill:"currentColor"}),I4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.12274 0.610514C8.12274 -0.00177708 8.96486 -0.231703 9.30573 0.287516L14.3411 7.95754C14.6076 8.36345 14.301 8.88997 13.7982 8.88997H8.76289C8.40934 8.88997 8.12274 8.61711 8.12274 8.28054V0.610514ZM9.18965 2.02716V7.87425H13.0283L9.18965 2.02716ZM5.98892 3.18445L3.17398 7.87425H5.98892V3.18445ZM5.85988 1.35219C6.18558 0.809571 7.05583 1.02961 7.05583 1.65455V8.28054C7.05583 8.61712 6.76923 8.88997 6.41569 8.88997H2.43859C1.94707 8.88997 1.63893 8.38445 1.88279 7.97817L5.85988 1.35219Z",fill:"currentColor"})]});import{jsx as R6,jsxs as cn}from"react/jsx-runtime";var sn=C=>cn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[R6("title",{children:"Shooting"}),R6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 0.5C8.5 0.223858 8.27614 0 8 0C7.72386 0 7.5 0.223858 7.5 0.5V1.01758C4.03251 1.2623 1.2623 4.03251 1.01758 7.5H0.5C0.223858 7.5 0 7.72386 0 8C0 8.27614 0.223858 8.5 0.5 8.5H1.01758C1.2623 11.9675 4.03251 14.7377 7.5 14.9824V15.5C7.5 15.7761 7.72386 16 8 16C8.27614 16 8.5 15.7761 8.5 15.5V14.9824C11.9675 14.7377 14.7377 11.9675 14.9824 8.5H15.5C15.7761 8.5 16 8.27614 16 8C16 7.72386 15.7761 7.5 15.5 7.5H14.9824C14.7377 4.03251 11.9675 1.2623 8.5 1.01758V0.5ZM7.5 2.02054C4.5851 2.26101 2.26101 4.5851 2.02054 7.5H4.03095C4.25657 5.69064 5.69064 4.25657 7.5 4.03095V2.02054ZM8.5 4.03095V2.02054C11.4149 2.26101 13.739 4.5851 13.9795 7.5H11.9691C11.7434 5.69064 10.3094 4.25657 8.5 4.03095ZM7.5 5.04148C6.24375 5.25224 5.25224 6.24375 5.04148 7.5H7.13378C7.2216 7.34819 7.34819 7.2216 7.5 7.13378V5.04148ZM8.5 7.13378V5.04148C9.75625 5.25224 10.7478 6.24375 10.9585 7.5H8.86622C8.7784 7.34819 8.65181 7.2216 8.5 7.13378ZM8.5 8.86622C8.65181 8.7784 8.7784 8.65181 8.86622 8.5H10.9585C10.7478 9.75625 9.75625 10.7478 8.5 10.9585V8.86622ZM7.13378 8.5C7.2216 8.65181 7.34819 8.7784 7.5 8.86622V10.9585C6.24375 10.7478 5.25224 9.75625 5.04148 8.5H7.13378ZM4.03095 8.5H2.02054C2.26101 11.4149 4.5851 13.739 7.5 13.9795V11.9691C5.69064 11.7434 4.25657 10.3094 4.03095 8.5ZM8.5 11.9691V13.9795C11.4149 13.739 13.739 11.4149 13.9795 8.5H11.9691C11.7434 10.3094 10.3094 11.7434 8.5 11.9691Z",fill:"currentColor"})]});import{jsx as y,jsxs as hn}from"react/jsx-runtime";var fn=C=>hn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[y("title",{children:"Skateboarding"}),y("path",{d:"M7 3C7.27614 3 7.5 3.22386 7.5 3.5C7.5 3.77614 7.27614 4 7 4C6.72386 4 6.5 3.77614 6.5 3.5C6.5 3.22386 6.72386 3 7 3Z",fill:"currentColor"}),y("path",{d:"M8.5 3.5C8.5 3.22386 8.72386 3 9 3C9.27614 3 9.5 3.22386 9.5 3.5C9.5 3.77614 9.27614 4 9 4C8.72386 4 8.5 3.77614 8.5 3.5Z",fill:"currentColor"}),y("path",{d:"M8.5 10.5C8.5 10.2239 8.72386 10 9 10C9.27614 10 9.5 10.2239 9.5 10.5C9.5 10.7761 9.27614 11 9 11C8.72386 11 8.5 10.7761 8.5 10.5Z",fill:"currentColor"}),y("path",{d:"M9 5C8.72386 5 8.5 5.22386 8.5 5.5C8.5 5.77614 8.72386 6 9 6C9.27614 6 9.5 5.77614 9.5 5.5C9.5 5.22386 9.27614 5 9 5Z",fill:"currentColor"}),y("path",{d:"M8.5 12.5C8.5 12.2239 8.72386 12 9 12C9.27614 12 9.5 12.2239 9.5 12.5C9.5 12.7761 9.27614 13 9 13C8.72386 13 8.5 12.7761 8.5 12.5Z",fill:"currentColor"}),y("path",{d:"M7.5 5.5C7.5 5.22386 7.27614 5 7 5C6.72386 5 6.5 5.22386 6.5 5.5C6.5 5.77614 6.72386 6 7 6C7.27614 6 7.5 5.77614 7.5 5.5Z",fill:"currentColor"}),y("path",{d:"M7 10C7.27614 10 7.5 10.2239 7.5 10.5C7.5 10.7761 7.27614 11 7 11C6.72386 11 6.5 10.7761 6.5 10.5C6.5 10.2239 6.72386 10 7 10Z",fill:"currentColor"}),y("path",{d:"M7.5 12.5C7.5 12.2239 7.27614 12 7 12C6.72386 12 6.5 12.2239 6.5 12.5C6.5 12.7761 6.72386 13 7 13C7.27614 13 7.5 12.7761 7.5 12.5Z",fill:"currentColor"}),y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.02491 0C9.85184 0 11.3934 1.64546 11.8573 3H12.5C12.7761 3 13 3.22386 13 3.5V4.5C13 4.77614 12.7761 5 12.5 5H11.8883C11.753 5.72442 11.5169 6.29984 11.3048 6.81678C11.0661 7.39852 10.8577 7.90621 10.8577 8.46879C10.9877 9.32377 11.1583 10.1739 11.3689 11.0174C11.4107 11.006 11.4547 11 11.5 11H12.5C12.7761 11 13 11.2239 13 11.5V12.5C13 12.7761 12.7761 13 12.5 13H11.9422C11.9613 13.0579 11.9805 13.1158 12 13.1737C12 13.9224 11.639 14.6404 10.9963 15.1698C10.3537 15.6992 9.48204 15.9966 8.57319 15.9966H7.43093C6.97485 16.0155 6.51904 15.9554 6.0929 15.8202C5.66676 15.685 5.27975 15.4778 4.95685 15.2118C4.63395 14.9458 4.38233 14.627 4.21823 14.2759C4.05413 13.9249 3.98119 13.5494 4.00412 13.1737C4.01382 13.1177 4.02515 13.0598 4.03793 13H3.5C3.22386 13 3 12.7761 3 12.5V11.5C3 11.2239 3.22386 11 3.5 11H4.5C4.54174 11 4.58229 11.0051 4.62106 11.0148C4.89311 10.1344 5.14639 9.21255 5.14639 8.46879C5.14639 8.0195 4.96249 7.57475 4.74227 7.04215C4.51401 6.49011 4.24672 5.84369 4.10475 5H3.5C3.22386 5 3 4.77614 3 4.5V3.5C3 3.22386 3.22386 3 3.5 3H4.13653C4.58692 1.6093 6.13709 0 8.02491 0ZM8.57319 14.9966H7.41023L7.38955 14.9975C7.04737 15.0116 6.70803 14.9663 6.39527 14.867C6.0824 14.7678 5.81041 14.6193 5.59267 14.4399C5.37529 14.2609 5.22033 14.0582 5.12414 13.8524C5.03647 13.6649 4.99661 13.4732 5.00023 13.2853C5.0708 12.9164 5.21775 12.451 5.39761 11.8813C5.46416 11.6704 5.53523 11.4453 5.60859 11.2056C5.86504 10.3675 6.14639 9.35328 6.14639 8.46879C6.14639 8.02125 6.03219 7.61743 5.90926 7.27449C5.83861 7.07738 5.7412 6.84107 5.64969 6.61908C5.5978 6.4932 5.54774 6.37176 5.5056 6.26486C5.2464 5.6072 5.00412 4.84088 5.00412 3.76391C5.00412 3.36615 5.27993 2.66 5.89307 2.01942C6.48559 1.40038 7.24556 1 8.02491 1C8.75715 1 9.5049 1.40376 10.1057 2.04399C10.7282 2.70746 11 3.41546 11 3.76391C11 4.76962 10.7633 5.48171 10.5002 6.14072C10.4667 6.22449 10.4302 6.31245 10.392 6.40426C10.1555 6.97343 9.85773 7.69009 9.85773 8.46879V8.54437L9.86909 8.6191C10.1101 10.2046 10.4857 11.7732 10.9925 13.3132C10.9528 13.6863 10.7526 14.075 10.3605 14.398C9.91369 14.766 9.27278 14.9966 8.57319 14.9966Z",fill:"currentColor"})]});import{jsx as H,jsxs as Ln}from"react/jsx-runtime";var an=C=>Ln("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[H("title",{children:"Snooker"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 2.5C9.5 3.32843 8.82843 4 8 4C7.17157 4 6.5 3.32843 6.5 2.5C6.5 1.67157 7.17157 1 8 1C8.82843 1 9.5 1.67157 9.5 2.5ZM8.5 2.5C8.5 2.77614 8.27614 3 8 3C7.72386 3 7.5 2.77614 7.5 2.5C7.5 2.22386 7.72386 2 8 2C8.27614 2 8.5 2.22386 8.5 2.5Z",fill:"currentColor"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 6.5C7 7.32843 6.32843 8 5.5 8C4.67157 8 4 7.32843 4 6.5C4 5.67157 4.67157 5 5.5 5C6.32843 5 7 5.67157 7 6.5ZM6 6.5C6 6.77614 5.77614 7 5.5 7C5.22386 7 5 6.77614 5 6.5C5 6.22386 5.22386 6 5.5 6C5.77614 6 6 6.22386 6 6.5Z",fill:"currentColor"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 16C2.32843 16 3 15.3284 3 14.5C3 13.6716 2.32843 13 1.5 13C0.671573 13 0 13.6716 0 14.5C0 15.3284 0.671573 16 1.5 16ZM1.5 15C1.77614 15 2 14.7761 2 14.5C2 14.2239 1.77614 14 1.5 14C1.22386 14 1 14.2239 1 14.5C1 14.7761 1.22386 15 1.5 15Z",fill:"currentColor"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 14.5C7 15.3284 6.32843 16 5.5 16C4.67157 16 4 15.3284 4 14.5C4 13.6716 4.67157 13 5.5 13C6.32843 13 7 13.6716 7 14.5ZM6 14.5C6 14.7761 5.77614 15 5.5 15C5.22386 15 5 14.7761 5 14.5C5 14.2239 5.22386 14 5.5 14C5.77614 14 6 14.2239 6 14.5Z",fill:"currentColor"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 16C11.3284 16 12 15.3284 12 14.5C12 13.6716 11.3284 13 10.5 13C9.67157 13 9 13.6716 9 14.5C9 15.3284 9.67157 16 10.5 16ZM10.5 15C10.7761 15 11 14.7761 11 14.5C11 14.2239 10.7761 14 10.5 14C10.2239 14 10 14.2239 10 14.5C10 14.7761 10.2239 15 10.5 15Z",fill:"currentColor"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 14.5C16 15.3284 15.3284 16 14.5 16C13.6716 16 13 15.3284 13 14.5C13 13.6716 13.6716 13 14.5 13C15.3284 13 16 13.6716 16 14.5ZM15 14.5C15 14.7761 14.7761 15 14.5 15C14.2239 15 14 14.7761 14 14.5C14 14.2239 14.2239 14 14.5 14C14.7761 14 15 14.2239 15 14.5Z",fill:"currentColor"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 8C11.3284 8 12 7.32843 12 6.5C12 5.67157 11.3284 5 10.5 5C9.67157 5 9 5.67157 9 6.5C9 7.32843 9.67157 8 10.5 8ZM10.5 7C10.7761 7 11 6.77614 11 6.5C11 6.22386 10.7761 6 10.5 6C10.2239 6 10 6.22386 10 6.5C10 6.77614 10.2239 7 10.5 7Z",fill:"currentColor"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 10.5C9.5 11.3284 8.82843 12 8 12C7.17157 12 6.5 11.3284 6.5 10.5C6.5 9.67157 7.17157 9 8 9C8.82843 9 9.5 9.67157 9.5 10.5ZM8.5 10.5C8.5 10.7761 8.27614 11 8 11C7.72386 11 7.5 10.7761 7.5 10.5C7.5 10.2239 7.72386 10 8 10C8.27614 10 8.5 10.2239 8.5 10.5Z",fill:"currentColor"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5 12C4.32843 12 5 11.3284 5 10.5C5 9.67157 4.32843 9 3.5 9C2.67157 9 2 9.67157 2 10.5C2 11.3284 2.67157 12 3.5 12ZM3.5 11C3.77614 11 4 10.7761 4 10.5C4 10.2239 3.77614 10 3.5 10C3.22386 10 3 10.2239 3 10.5C3 10.7761 3.22386 11 3.5 11Z",fill:"currentColor"}),H("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 10.5C14 11.3284 13.3284 12 12.5 12C11.6716 12 11 11.3284 11 10.5C11 9.67157 11.6716 9 12.5 9C13.3284 9 14 9.67157 14 10.5ZM13 10.5C13 10.7761 12.7761 11 12.5 11C12.2239 11 12 10.7761 12 10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5Z",fill:"currentColor"})]});import{jsx as l,jsxs as un}from"react/jsx-runtime";var gn=C=>un("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[l("title",{children:"SnookerTable"}),l("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 1H4V15H12V1ZM4 0C3.44772 0 3 0.447715 3 1V15C3 15.5523 3.44772 16 4 16H12C12.5523 16 13 15.5523 13 15V1C13 0.447715 12.5523 0 12 0H4Z",fill:"currentColor"}),l("path",{d:"M8.5 3.5C8.5 3.77614 8.27614 4 8 4C7.72386 4 7.5 3.77614 7.5 3.5C7.5 3.22386 7.72386 3 8 3C8.27614 3 8.5 3.22386 8.5 3.5Z",fill:"currentColor"}),l("path",{d:"M8.5 8.5C8.5 8.77614 8.27614 9 8 9C7.72386 9 7.5 8.77614 7.5 8.5C7.5 8.22386 7.72386 8 8 8C8.27614 8 8.5 8.22386 8.5 8.5Z",fill:"currentColor"}),l("path",{d:"M8.5 10.5C8.5 10.7761 8.27614 11 8 11C7.72386 11 7.5 10.7761 7.5 10.5C7.5 10.2239 7.72386 10 8 10C8.27614 10 8.5 10.2239 8.5 10.5Z",fill:"currentColor"}),l("path",{d:"M9.5 10.5C9.5 10.7761 9.27614 11 9 11C8.72386 11 8.5 10.7761 8.5 10.5C8.5 10.2239 8.72386 10 9 10C9.27614 10 9.5 10.2239 9.5 10.5Z",fill:"currentColor"}),l("path",{d:"M7.5 10.5C7.5 10.7761 7.27614 11 7 11C6.72386 11 6.5 10.7761 6.5 10.5C6.5 10.2239 6.72386 10 7 10C7.27614 10 7.5 10.2239 7.5 10.5Z",fill:"currentColor"}),l("path",{d:"M8.5 12.5C8.5 12.7761 8.27614 13 8 13C7.72386 13 7.5 12.7761 7.5 12.5C7.5 12.2239 7.72386 12 8 12C8.27614 12 8.5 12.2239 8.5 12.5Z",fill:"currentColor"}),l("path",{d:"M9.5 12.5C9.5 12.7761 9.27614 13 9 13C8.72386 13 8.5 12.7761 8.5 12.5C8.5 12.2239 8.72386 12 9 12C9.27614 12 9.5 12.2239 9.5 12.5Z",fill:"currentColor"}),l("path",{d:"M10.5 12.5C10.5 12.7761 10.2761 13 10 13C9.72386 13 9.5 12.7761 9.5 12.5C9.5 12.2239 9.72386 12 10 12C10.2761 12 10.5 12.2239 10.5 12.5Z",fill:"currentColor"}),l("path",{d:"M7.5 12.5C7.5 12.7761 7.27614 13 7 13C6.72386 13 6.5 12.7761 6.5 12.5C6.5 12.2239 6.72386 12 7 12C7.27614 12 7.5 12.2239 7.5 12.5Z",fill:"currentColor"}),l("path",{d:"M6.5 12.5C6.5 12.7761 6.27614 13 6 13C5.72386 13 5.5 12.7761 5.5 12.5C5.5 12.2239 5.72386 12 6 12C6.27614 12 6.5 12.2239 6.5 12.5Z",fill:"currentColor"}),l("path",{d:"M8 9.5C8 9.77614 7.77614 10 7.5 10C7.22386 10 7 9.77614 7 9.5C7 9.22386 7.22386 9 7.5 9C7.77614 9 8 9.22386 8 9.5Z",fill:"currentColor"}),l("path",{d:"M9 9.5C9 9.77614 8.77614 10 8.5 10C8.22386 10 8 9.77614 8 9.5C8 9.22386 8.22386 9 8.5 9C8.77614 9 9 9.22386 9 9.5Z",fill:"currentColor"}),l("path",{d:"M7 11.5C7 11.7761 6.77614 12 6.5 12C6.22386 12 6 11.7761 6 11.5C6 11.2239 6.22386 11 6.5 11C6.77614 11 7 11.2239 7 11.5Z",fill:"currentColor"}),l("path",{d:"M9 11.5C9 11.7761 8.77614 12 8.5 12C8.22386 12 8 11.7761 8 11.5C8 11.2239 8.22386 11 8.5 11C8.77614 11 9 11.2239 9 11.5Z",fill:"currentColor"}),l("path",{d:"M8 11.5C8 11.7761 7.77614 12 7.5 12C7.22386 12 7 11.7761 7 11.5C7 11.2239 7.22386 11 7.5 11C7.77614 11 8 11.2239 8 11.5Z",fill:"currentColor"}),l("path",{d:"M10 11.5C10 11.7761 9.77614 12 9.5 12C9.22386 12 9 11.7761 9 11.5C9 11.2239 9.22386 11 9.5 11C9.77614 11 10 11.2239 10 11.5Z",fill:"currentColor"}),l("path",{d:"M5 15C5 15.5523 4.55228 16 4 16C3.44772 16 3 15.5523 3 15C3 14.4477 3.44772 14 4 14C4.55228 14 5 14.4477 5 15Z",fill:"currentColor"}),l("path",{d:"M5 15C5 15.5523 4.55228 16 4 16C3.44772 16 3 15.5523 3 15C3 14.4477 3.44772 14 4 14C4.55228 14 5 14.4477 5 15Z",fill:"currentColor"}),l("path",{d:"M13 15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15C11 14.4477 11.4477 14 12 14C12.5523 14 13 14.4477 13 15Z",fill:"currentColor"}),l("path",{d:"M13 1C13 1.55228 12.5523 2 12 2C11.4477 2 11 1.55228 11 1C11 0.447715 11.4477 0 12 0C12.5523 0 13 0.447715 13 1Z",fill:"currentColor"}),l("path",{d:"M5 1C5 1.55228 4.55228 2 4 2C3.44772 2 3 1.55228 3 1C3 0.447715 3.44772 0 4 0C4.55228 0 5 0.447715 5 1Z",fill:"currentColor"}),l("path",{d:"M5 8C5 8.55229 4.55228 9 4 9C3.44772 9 3 8.55229 3 8C3 7.44772 3.44772 7 4 7C4.55228 7 5 7.44772 5 8Z",fill:"currentColor"}),l("path",{d:"M13 8C13 8.55229 12.5523 9 12 9C11.4477 9 11 8.55229 11 8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8Z",fill:"currentColor"})]});import{jsx as V,jsxs as vn}from"react/jsx-runtime";var Vn=C=>vn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[V("title",{children:"Snowboarding"}),V("path",{d:"M6.4346 8.97062C6.4346 8.69447 6.21075 8.47062 5.9346 8.47062C5.65846 8.47062 5.4346 8.69447 5.4346 8.97062V10.9706C5.4346 11.2468 5.65846 11.4706 5.9346 11.4706C6.21075 11.4706 6.4346 11.2468 6.4346 10.9706V8.97062Z",fill:"currentColor"}),V("path",{d:"M9.9346 4.47062C10.2107 4.47062 10.4346 4.69447 10.4346 4.97062V6.97062C10.4346 7.24676 10.2107 7.47062 9.9346 7.47062C9.65846 7.47062 9.4346 7.24676 9.4346 6.97062V4.97062C9.4346 4.69447 9.65846 4.47062 9.9346 4.47062Z",fill:"currentColor"}),V("path",{d:"M11.4346 2.97062C11.1585 2.97062 10.9346 3.19447 10.9346 3.47062C10.9346 3.74676 11.1585 3.97062 11.4346 3.97062C11.7107 3.97062 11.9346 3.74676 11.9346 3.47062C11.9346 3.19447 11.7107 2.97062 11.4346 2.97062Z",fill:"currentColor"}),V("path",{d:"M11.9346 4.47062C11.9346 4.19447 12.1585 3.97062 12.4346 3.97062C12.7107 3.97062 12.9346 4.19447 12.9346 4.47062C12.9346 4.74676 12.7107 4.97062 12.4346 4.97062C12.1585 4.97062 11.9346 4.74676 11.9346 4.47062Z",fill:"currentColor"}),V("path",{d:"M3.4346 12.9706C3.15846 12.9706 2.9346 13.1945 2.9346 13.4706C2.9346 13.7468 3.15846 13.9706 3.4346 13.9706C3.71075 13.9706 3.9346 13.7468 3.9346 13.4706C3.9346 13.1945 3.71075 12.9706 3.4346 12.9706Z",fill:"currentColor"}),V("path",{d:"M11.9346 2.47062C11.9346 2.19447 12.1585 1.97062 12.4346 1.97062C12.7107 1.97062 12.9346 2.19447 12.9346 2.47062C12.9346 2.74676 12.7107 2.97062 12.4346 2.97062C12.1585 2.97062 11.9346 2.74676 11.9346 2.47062Z",fill:"currentColor"}),V("path",{d:"M3.4346 10.9706C3.15846 10.9706 2.9346 11.1945 2.9346 11.4706C2.9346 11.7468 3.15846 11.9706 3.4346 11.9706C3.71075 11.9706 3.9346 11.7468 3.9346 11.4706C3.9346 11.1945 3.71075 10.9706 3.4346 10.9706Z",fill:"currentColor"}),V("path",{d:"M12.9346 3.47062C12.9346 3.19447 13.1585 2.97062 13.4346 2.97062C13.7107 2.97062 13.9346 3.19447 13.9346 3.47062C13.9346 3.74676 13.7107 3.97062 13.4346 3.97062C13.1585 3.97062 12.9346 3.74676 12.9346 3.47062Z",fill:"currentColor"}),V("path",{d:"M4.4346 11.9706C4.15846 11.9706 3.9346 12.1945 3.9346 12.4706C3.9346 12.7468 4.15846 12.9706 4.4346 12.9706C4.71074 12.9706 4.9346 12.7468 4.9346 12.4706C4.9346 12.1945 4.71074 11.9706 4.4346 11.9706Z",fill:"currentColor"}),V("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.43271 15.9359C4.4321 15.8426 5.42763 15.3561 6.20031 14.5834C6.61988 14.0691 7.14421 13.3017 7.69701 12.4927C8.514 11.2969 9.39321 10.0101 10.0883 9.31507C10.6509 8.75239 11.7188 8.08515 12.7187 7.4604C13.4199 7.02232 14.0876 6.60512 14.5242 6.25951C16.3004 4.856 16.354 2.26254 15.0219 0.930458L14.9943 0.90285C13.6898 -0.401622 11.0963 -0.348083 9.69283 1.42814C9.34722 1.86478 8.93003 2.53249 8.49194 3.23362C7.86719 4.23352 7.19996 5.3014 6.63727 5.86409C5.94221 6.55915 4.65545 7.43833 3.45968 8.25534C2.65061 8.80813 1.88321 9.33246 1.36893 9.75204C0.387146 10.7338 0.10974 11.5202 0.0164076 12.5196C-0.0769249 13.519 0.230572 14.4404 0.871252 15.0811C1.51193 15.7218 2.43331 16.0293 3.43271 15.9359ZM10.4775 2.04812C11.5285 0.717911 13.4268 0.74955 14.2872 1.60996L14.3148 1.63756C15.208 2.5308 15.2285 4.42849 13.9042 5.4749C13.5156 5.78249 12.9099 6.1613 12.2098 6.59903C12.0558 6.69534 11.8972 6.79453 11.7352 6.89647C10.9027 7.42056 9.95451 8.03461 9.38115 8.60797C8.72146 9.26765 7.95728 10.3474 7.27332 11.3415C7.13151 11.5477 6.99264 11.7508 6.85735 11.9488C6.32206 12.732 5.8427 13.4334 5.45816 13.9109C4.84047 14.5135 4.07198 14.8719 3.33972 14.9403C2.60054 15.0093 1.98419 14.7798 1.57836 14.374C1.17253 13.9682 0.943044 13.3518 1.01207 12.6126C1.05218 12.1832 1.12643 11.8558 1.26847 11.5461C1.40729 11.2434 1.63418 10.9072 2.04054 10.4949C2.5181 10.1102 3.21982 9.63064 4.00349 9.09504C4.20144 8.95974 4.40468 8.82084 4.6108 8.67903C5.60491 7.99506 6.68469 7.23089 7.34438 6.5712C7.91774 5.99784 8.53178 5.04968 9.05587 4.21713C9.15773 4.05532 9.25684 3.89681 9.35307 3.7429C9.79081 3.0428 10.1699 2.43673 10.4775 2.04812Z",fill:"currentColor"}),V("path",{d:"M2.43457 11.9707C2.15843 11.9707 1.93457 12.1946 1.93457 12.4707C1.93457 12.7468 2.15843 12.9707 2.43457 12.9707C2.71071 12.9707 2.93457 12.7468 2.93457 12.4707C2.93457 12.1946 2.71071 11.9707 2.43457 11.9707Z",fill:"currentColor"})]});import{jsx as M,jsxs as wn}from"react/jsx-runtime";var mn=C=>wn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[M("title",{children:"Soccer"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 0.999999 4.13401 0.999999 8C0.999999 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 -1.07987e-06 3.58172 -1.07987e-06 8C-1.07987e-06 12.4183 3.58172 16 8 16Z",fill:"currentColor"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.26766 8.70075L8 10.75L10.7323 8.70075L9.38197 6L6.61803 6L5.26766 8.70075ZM7.4 11.55C7.75556 11.8167 8.24445 11.8167 8.6 11.55L11.3323 9.50075C11.719 9.21077 11.8429 8.6858 11.6268 8.25353L10.2764 5.55279C10.107 5.214 9.76074 5 9.38197 5H6.61803C6.23926 5 5.893 5.214 5.72361 5.55279L4.37323 8.25353C4.1571 8.6858 4.28103 9.21077 4.66766 9.50075L7.4 11.55Z",fill:"currentColor"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.4 13.325C7.75555 13.0583 8.24444 13.0583 8.6 13.325L10.3 14.6C10.5209 14.7657 10.5657 15.0791 10.4 15.3C10.2343 15.5209 9.92091 15.5657 9.7 15.4L8 14.125L6.3 15.4C6.07908 15.5657 5.76568 15.5209 5.6 15.3C5.43431 15.0791 5.47908 14.7657 5.7 14.6L7.4 13.325Z",fill:"currentColor"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.68569 0.535762C5.94209 0.638318 6.06679 0.929304 5.96424 1.1857L5.08996 3.37139C4.9381 3.75105 4.57039 4 4.16148 4H2C1.72386 4 1.5 3.77614 1.5 3.5C1.5 3.22386 1.72386 3 2 3H4.16148L5.03576 0.814305C5.13832 0.557913 5.4293 0.433205 5.68569 0.535762Z",fill:"currentColor"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.3143 0.535762C10.5707 0.433205 10.8617 0.557913 10.9642 0.814305L11.8385 3H13.5C13.7761 3 14 3.22386 14 3.5C14 3.77614 13.7761 4 13.5 4H11.8385C11.4296 4 11.0619 3.75105 10.91 3.37139L10.0358 1.1857C9.9332 0.929304 10.0579 0.638318 10.3143 0.535762ZM0.0999989 7.7C0.265684 7.47909 0.579085 7.43431 0.799999 7.6L2.55683 8.91762C2.85562 9.14171 3.00462 9.51362 2.94323 9.88202L2.4932 12.5822C2.4478 12.8546 2.19018 13.0386 1.9178 12.9932C1.64541 12.9478 1.4614 12.6902 1.5068 12.4178L1.95683 9.71762L0.199999 8.4C-0.020915 8.23431 -0.0656865 7.92091 0.0999989 7.7ZM15.9 7.7C16.0657 7.92091 16.0209 8.23431 15.8 8.4L14.0521 9.71093L14.4903 11.9019C14.5444 12.1727 14.3688 12.4361 14.0981 12.4903C13.8273 12.5444 13.5639 12.3688 13.5097 12.0981L13.0715 9.90705C12.996 9.52943 13.144 9.14199 13.4521 8.91093L15.2 7.6C15.4209 7.43431 15.7343 7.47909 15.9 7.7Z",fill:"currentColor"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.14645 3.14645C4.34171 2.95118 4.65829 2.95118 4.85355 3.14645L6.85355 5.14645C7.04881 5.34171 7.04881 5.65829 6.85355 5.85355C6.65829 6.04882 6.34171 6.04882 6.14645 5.85355L4.14645 3.85355C3.95118 3.65829 3.95118 3.34171 4.14645 3.14645Z",fill:"currentColor"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.18569 8.96424L2.68569 9.96423C2.4293 10.0668 2.13832 9.94208 2.03576 9.68568C1.9332 9.42929 2.05791 9.13831 2.31431 9.03575L4.81431 8.03576L5.18569 8.96424Z",fill:"currentColor"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1857 8.03576L13.6857 9.03575C13.9421 9.1383 14.0668 9.42929 13.9642 9.68568C13.8617 9.94207 13.5707 10.0668 13.3143 9.96423L10.8143 8.96424L11.1857 8.03576Z",fill:"currentColor"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.8536 3.14645C12.0488 3.34171 12.0488 3.65829 11.8536 3.85355L9.85355 5.85355C9.65829 6.04882 9.34171 6.04882 9.14645 5.85355C8.95118 5.65829 8.95118 5.34171 9.14645 5.14645L11.1464 3.14645C11.3417 2.95118 11.6583 2.95118 11.8536 3.14645Z",fill:"currentColor"}),M("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 11C8.27614 11 8.5 11.2239 8.5 11.5V13.6233C8.5 13.8994 8.27614 14.1233 8 14.1233C7.72386 14.1233 7.5 13.8994 7.5 13.6233V11.5C7.5 11.2239 7.72386 11 8 11Z",fill:"currentColor"})]});import{jsx as Z6,jsxs as Mn}from"react/jsx-runtime";var Hn=C=>Mn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[Z6("title",{children:"SoccerPitch"}),Z6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3V13C0 13.5523 0.447715 14 1 14H15C15.5523 14 16 13.5523 16 13V3C16 2.44772 15.5523 2 15 2H1C0.447715 2 0 2.44772 0 3ZM7.5 3H1V5H3C3.55228 5 4 5.44772 4 6V10C4 10.5523 3.55228 11 3 11H1V13H7.5V9.41465C6.9174 9.20873 6.5 8.65311 6.5 8C6.5 7.34689 6.9174 6.79127 7.5 6.58535V3ZM1 10V6H3V10H1ZM15 5V3H8.5V6.58535C9.0826 6.79127 9.5 7.34689 9.5 8C9.5 8.65311 9.0826 9.20873 8.5 9.41465V13H15V11H13C12.4477 11 12 10.5523 12 10V6C12 5.44772 12.4477 5 13 5H15ZM15 10V6H13V10H15ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5Z",fill:"currentColor"})]});import{jsx as u,jsxs as Zn}from"react/jsx-runtime";var Rn=C=>Zn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[u("title",{children:"Softball"}),u("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 8.27614 15.7761 8.5 15.5 8.5C15.2239 8.5 15 8.27614 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.8599 4.26999 15 8 15C8.80396 15 9.80688 14.7773 10.2843 14.5489C10.5334 14.4298 10.8319 14.5352 10.9511 14.7843C11.0702 15.0334 10.9648 15.3319 10.7157 15.4511C10.079 15.7556 8.9234 16 8 16C3.73001 16 0 12.4244 0 8Z",fill:"currentColor"}),u("path",{d:"M7.5 7C7.5 7.27614 7.27614 7.5 7 7.5C6.72386 7.5 6.5 7.27614 6.5 7C6.5 6.72386 6.72386 6.5 7 6.5C7.27614 6.5 7.5 6.72386 7.5 7Z",fill:"currentColor"}),u("path",{d:"M9.5 7C9.5 7.27614 9.27614 7.5 9 7.5C8.72386 7.5 8.5 7.27614 8.5 7C8.5 6.72386 8.72386 6.5 9 6.5C9.27614 6.5 9.5 6.72386 9.5 7Z",fill:"currentColor"}),u("path",{d:"M10.5 5C10.5 5.27614 10.2761 5.5 10 5.5C9.72386 5.5 9.5 5.27614 9.5 5C9.5 4.72386 9.72386 4.5 10 4.5C10.2761 4.5 10.5 4.72386 10.5 5Z",fill:"currentColor"}),u("path",{d:"M11.5 3C11.5 3.27614 11.2761 3.5 11 3.5C10.7239 3.5 10.5 3.27614 10.5 3C10.5 2.72386 10.7239 2.5 11 2.5C11.2761 2.5 11.5 2.72386 11.5 3Z",fill:"currentColor"}),u("path",{d:"M7.5 9C7.5 9.27614 7.27614 9.5 7 9.5C6.72386 9.5 6.5 9.27614 6.5 9C6.5 8.72386 6.72386 8.5 7 8.5C7.27614 8.5 7.5 8.72386 7.5 9Z",fill:"currentColor"}),u("path",{d:"M6.5 11C6.5 11.2761 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.2761 5.5 11C5.5 10.7239 5.72386 10.5 6 10.5C6.27614 10.5 6.5 10.7239 6.5 11Z",fill:"currentColor"}),u("path",{d:"M5.5 13C5.5 13.2761 5.27614 13.5 5 13.5C4.72386 13.5 4.5 13.2761 4.5 13C4.5 12.7239 4.72386 12.5 5 12.5C5.27614 12.5 5.5 12.7239 5.5 13Z",fill:"currentColor"}),u("path",{d:"M6.5 5C6.5 5.27614 6.27614 5.5 6 5.5C5.72386 5.5 5.5 5.27614 5.5 5C5.5 4.72386 5.72386 4.5 6 4.5C6.27614 4.5 6.5 4.72386 6.5 5Z",fill:"currentColor"}),u("path",{d:"M5.5 3C5.5 3.27614 5.27614 3.5 5 3.5C4.72386 3.5 4.5 3.27614 4.5 3C4.5 2.72386 4.72386 2.5 5 2.5C5.27614 2.5 5.5 2.72386 5.5 3Z",fill:"currentColor"}),u("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 11C11.5 10.1716 12.1716 9.5 13 9.5H14.5C15.3284 9.5 16 10.1716 16 11C16 11.2761 15.7761 11.5 15.5 11.5C15.2239 11.5 15 11.2761 15 11C15 10.7239 14.7761 10.5 14.5 10.5H13C12.7239 10.5 12.5 10.7239 12.5 11V12C12.5 12.2761 12.7239 12.5 13 12.5H14.5C15.3284 12.5 16 13.1716 16 14V14.5C16 15.3284 15.3284 16 14.5 16H13C12.1716 16 11.5 15.3284 11.5 14.5C11.5 14.2239 11.7239 14 12 14C12.2761 14 12.5 14.2239 12.5 14.5C12.5 14.7761 12.7239 15 13 15H14.5C14.7761 15 15 14.7761 15 14.5V14C15 13.7239 14.7761 13.5 14.5 13.5H13C12.1716 13.5 11.5 12.8284 11.5 12V11Z",fill:"currentColor"}),u("path",{d:"M8.5 9C8.5 8.72386 8.72386 8.5 9 8.5C9.27614 8.5 9.5 8.72386 9.5 9C9.5 9.27614 9.27614 9.5 9 9.5C8.72386 9.5 8.5 9.27614 8.5 9Z",fill:"currentColor"})]});import{jsx as S6,jsxs as Gn}from"react/jsx-runtime";var Sn=C=>Gn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[S6("title",{children:"Surfing"}),S6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.1491 12.6569L3.00484 13.0273C3.23231 13.0727 3.41321 13.2448 3.46947 13.4694L3.82418 14.8853C5.2809 14.3734 6.89008 13.4883 8.40846 12.3032L7.55186 8.4565L3.87148 7.64034C2.65945 9.39398 1.73936 11.2007 1.1491 12.6569ZM4.50976 6.75916L8.07964 7.55081C8.26924 7.59285 8.41731 7.74062 8.45945 7.92982L9.2736 11.5859C9.67562 11.232 10.0674 10.8568 10.444 10.462L9.55279 6.45975L5.48883 5.55857C5.14676 5.94836 4.82023 6.35035 4.50976 6.75916ZM6.27808 4.71086L10.0806 5.55406C10.2702 5.5961 10.4182 5.74386 10.4604 5.93307L11.2637 9.54072C13.2369 7.1597 14.5832 4.22712 14.4954 1.01232C11.2998 0.832745 8.52702 2.43858 6.27808 4.71086ZM5.15958 4.4327C7.65673 1.75519 10.9686 -0.335793 14.9375 0.0448716C15.2294 0.072873 15.4615 0.309406 15.479 0.605219C15.7087 4.47336 14.0249 7.92737 11.6805 10.5917C9.33905 13.2527 6.29951 15.1729 3.71604 15.9726C3.37447 16.0783 3.03857 15.8658 2.95833 15.5455L2.5603 13.9567L0.484452 13.5424C0.143343 13.4743 -0.0987748 13.1131 0.0396635 12.7469C0.908523 10.4485 2.6599 7.11293 5.15958 4.4327Z",fill:"currentColor"})]});import{jsx as O1,jsxs as xn}from"react/jsx-runtime";var Pn=C=>xn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[O1("title",{children:"Swimming"}),O1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.39365 12.454C5.84079 12.1346 6.00002 11.7836 6.00002 11.5C6.00002 11.2164 5.84079 10.8653 5.39365 10.546C4.94843 10.228 4.28212 10 3.50002 10C2.71791 10 2.0516 10.228 1.60638 10.546C1.15924 10.8653 1.00002 11.2164 1.00002 11.5C1.00002 11.7836 1.15924 12.1346 1.60638 12.454C2.0516 12.772 2.71791 13 3.50002 13C4.28212 13 4.94843 12.772 5.39365 12.454ZM3.50002 14C5.43301 14 7.00002 12.8807 7.00002 11.5C7.00002 10.1193 5.43301 9 3.50002 9C1.56702 9 1.52481e-05 10.1193 1.52481e-05 11.5C1.52481e-05 12.8807 1.56702 14 3.50002 14Z",fill:"currentColor"}),O1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.3937 12.454C14.8408 12.1346 15 11.7836 15 11.5C15 11.2164 14.8408 10.8653 14.3937 10.546C13.9484 10.228 13.2821 10 12.5 10C11.7179 10 11.0516 10.228 10.6064 10.546C10.1592 10.8653 10 11.2164 10 11.5C10 11.7836 10.1592 12.1346 10.6064 12.454C11.0516 12.772 11.7179 13 12.5 13C13.2821 13 13.9484 12.772 14.3937 12.454ZM12.5 14C14.433 14 16 12.8807 16 11.5C16 10.1193 14.433 9 12.5 9C10.567 9 9.00002 10.1193 9.00002 11.5C9.00002 12.8807 10.567 14 12.5 14Z",fill:"currentColor"}),O1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.00002 11C6.00002 10.7239 6.22387 10.5 6.50002 10.5H9.50002C9.77616 10.5 10 10.7239 10 11C10 11.2761 9.77616 11.5 9.50002 11.5H6.50002C6.22387 11.5 6.00002 11.2761 6.00002 11Z",fill:"currentColor"}),O1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.999134 11.0296L0.99934 11.0264L1.00037 11.0115C1.00136 10.9977 1.00301 10.9762 1.00549 10.9475C1.01045 10.89 1.01872 10.8039 1.03175 10.6932C1.05782 10.4715 1.10284 10.1523 1.17817 9.76805C1.32929 8.99733 1.60015 7.97706 2.07742 6.96285C3.02824 4.94236 4.76125 2.99994 8.00002 2.99994C11.2388 2.99994 12.9718 4.94236 13.9226 6.96285C14.3999 7.97706 14.6707 8.99733 14.8219 9.76805C14.8972 10.1523 14.9422 10.4715 14.9683 10.6932C14.9813 10.8039 14.9896 10.89 14.9945 10.9475C14.997 10.9762 14.9987 10.9977 14.9997 11.0115L15.0007 11.0264L15.0009 11.0293C15.0009 11.0293 15.0009 11.0293 15.0009 11.0293C15.0173 11.3048 15.2538 11.5153 15.5294 11.4991C15.805 11.4829 16.0154 11.2463 15.9992 10.9706L15.5 11C15.9992 10.9706 15.9992 10.9709 15.9992 10.9706L15.9991 10.9694L15.999 10.9675L15.9986 10.9612L15.9971 10.9396C15.9957 10.9213 15.9937 10.8951 15.9908 10.8615C15.9851 10.7945 15.9757 10.698 15.9614 10.5763C15.9328 10.3331 15.8841 9.9883 15.8032 9.57564C15.6418 8.7526 15.3502 7.64786 14.8274 6.53706C13.7782 4.30753 11.7613 1.99994 8.00002 1.99994C4.23878 1.99994 2.22179 4.30753 1.17261 6.53706C0.649879 7.64786 0.358237 8.7526 0.196858 9.57564C0.115943 9.9883 0.0672108 10.3331 0.0385962 10.5763C0.0242805 10.698 0.0149761 10.7945 0.00918995 10.8615C0.00629636 10.8951 0.004281 10.9213 0.00295796 10.9396L0.00146889 10.9612L0.00106992 10.9675L0.000949193 10.9694C0.000933428 10.9697 0.000878066 10.9706 0.500015 11L0.000878055 10.9706C-0.0153375 11.2463 0.194988 11.4829 0.470654 11.4991C0.746219 11.5153 0.982763 11.3052 0.999134 11.0296Z",fill:"currentColor"}),O1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.93866 9.74001C3.93793 9.74135 3.93719 9.74268 3.93645 9.744C3.93599 9.74482 3.93644 9.74401 3.93645 9.744L3.93778 9.7416L3.93866 9.74001ZM12.0636 9.74401L12.0609 9.73948C12.057 9.73309 12.0492 9.7206 12.0371 9.70285C12.0129 9.66733 11.9716 9.61089 11.9106 9.54025C11.7888 9.39914 11.5878 9.20094 11.2851 8.9991C10.6847 8.59872 9.6574 8.1662 8.00002 8.1662C6.34263 8.1662 5.31532 8.59872 4.71492 8.9991C4.41225 9.20094 4.21124 9.39914 4.08941 9.54025C4.02841 9.61089 3.98717 9.66733 3.96297 9.70285C3.95087 9.7206 3.94255 9.73363 3.93866 9.74001L3.93645 9.744C3.80293 9.98297 3.50154 10.0704 3.26064 9.939C3.0182 9.8068 2.92884 9.50309 3.06104 9.26065L3.50002 9.50003C3.06104 9.26065 3.06086 9.26098 3.06104 9.26065L3.06178 9.2593L3.06261 9.25779L3.06458 9.25424L3.06974 9.24518C3.07373 9.23826 3.07881 9.22962 3.08504 9.21939C3.09751 9.19891 3.11459 9.17201 3.13667 9.13961C3.18082 9.07484 3.24505 8.98801 3.3325 8.88673C3.50754 8.684 3.77528 8.42375 4.16011 8.16712C4.93471 7.65059 6.1574 7.1662 8.00002 7.1662C9.84263 7.1662 11.0653 7.65059 11.8399 8.16712C12.2247 8.42375 12.4925 8.684 12.6675 8.88673C12.755 8.98801 12.8192 9.07484 12.8634 9.13961C12.8854 9.17201 12.9025 9.19891 12.915 9.21939C12.9212 9.22962 12.9263 9.23826 12.9303 9.24518L12.9354 9.25424L12.9374 9.25779L12.9383 9.2593C12.9384 9.25963 12.939 9.26065 12.5 9.50003L12.939 9.26065C13.0712 9.50309 12.9818 9.8068 12.7394 9.939C12.4985 10.0704 12.1971 9.98297 12.0636 9.74401Z",fill:"currentColor"})]});import{jsx as V2,jsxs as yn}from"react/jsx-runtime";var bn=C=>yn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[V2("title",{children:"SynchronizedSwimming"}),V2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.00001 8.00004C6.55229 8.00004 7.00001 7.55232 7.00001 7.00004C7.00001 6.44775 6.55229 6.00004 6.00001 6.00004C5.44772 6.00004 5.00001 6.44775 5.00001 7.00004C5.00001 7.55232 5.44772 8.00004 6.00001 8.00004ZM6.00001 9.00004C7.10458 9.00004 8.00001 8.10461 8.00001 7.00004C8.00001 5.89547 7.10458 5.00004 6.00001 5.00004C4.89544 5.00004 4.00001 5.89547 4.00001 7.00004C4.00001 8.10461 4.89544 9.00004 6.00001 9.00004Z",fill:"currentColor"}),V2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 8.00004C13.5523 8.00004 14 7.55232 14 7.00004C14 6.44775 13.5523 6.00004 13 6.00004C12.4477 6.00004 12 6.44775 12 7.00004C12 7.55232 12.4477 8.00004 13 8.00004ZM13 9.00004C14.1046 9.00004 15 8.10461 15 7.00004C15 5.89547 14.1046 5.00004 13 5.00004C11.8954 5.00004 11 5.89547 11 7.00004C11 8.10461 11.8954 9.00004 13 9.00004Z",fill:"currentColor"}),V2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.2906 2.09317C12.5153 2.25368 12.5674 2.56595 12.4069 2.79066L10.0658 6.06819L10.9642 8.31434C11.0668 8.57073 10.9421 8.86172 10.6857 8.96428C10.4293 9.06683 10.1383 8.94213 10.0358 8.68573L9.1373 6.43958C9.01076 6.12322 9.05401 5.76421 9.25205 5.48695L11.5931 2.20942C11.7536 1.98471 12.0659 1.93267 12.2906 2.09317ZM5.3254 2.12041C5.53506 2.30012 5.55935 2.61577 5.37963 2.82543L2.61417 6.05181L3.92875 8.24279C4.07083 8.47958 3.99404 8.78671 3.75725 8.92879C3.52046 9.07086 3.21333 8.99408 3.07126 8.75729L1.75667 6.56631C1.53522 6.19722 1.57479 5.72783 1.85491 5.40102L4.62038 2.17464C4.80009 1.96498 5.11574 1.9407 5.3254 2.12041ZM1.9744 10.9496C1.88844 10.9172 1.81123 10.9107 1.69697 10.9597C1.48411 11.0509 1.34741 11.1423 1.24478 11.2449C1.14216 11.3475 1.0508 11.4842 0.95958 11.6971C0.850805 11.9509 0.556867 12.0685 0.303051 11.9597C0.0492349 11.8509 -0.0683436 11.557 0.0404318 11.3032C0.166762 11.0084 0.321591 10.7539 0.537671 10.5378C0.75375 10.3217 1.00827 10.1669 1.30305 10.0405C1.67203 9.88239 2.01751 9.89732 2.32661 10.0136C2.60816 10.1196 2.84788 10.3065 3.03274 10.4562C3.05064 10.4707 3.06819 10.4849 3.08541 10.4988C3.4798 10.8186 3.7037 11.0001 4.00001 11.0001C4.35135 11.0001 4.59458 10.845 4.96594 10.5886C4.97475 10.5826 4.98365 10.5764 4.99262 10.5702C5.34298 10.328 5.81732 10.0001 6.50001 10.0001C7.1827 10.0001 7.65703 10.328 8.00739 10.5702C8.01637 10.5764 8.02526 10.5826 8.03408 10.5886C8.40544 10.845 8.64867 11.0001 9.00001 11.0001C9.35135 11.0001 9.59457 10.845 9.96593 10.5886C9.97475 10.5826 9.98364 10.5764 9.99262 10.5702C10.343 10.328 10.8173 10.0001 11.5 10.0001C12.1729 10.0001 12.6568 10.3725 12.9867 10.6263C13.0123 10.646 13.037 10.6651 13.0608 10.6831C13.4307 10.964 13.625 11.0681 13.897 11.0108C14.1979 10.9475 14.4092 10.8621 14.5814 10.7472C14.7537 10.6324 14.9138 10.4702 15.088 10.2168C15.2444 9.98928 15.5557 9.93163 15.7833 10.0881C16.0108 10.2445 16.0685 10.5558 15.912 10.7834C15.6874 11.1102 15.4419 11.3754 15.1361 11.5793C14.8304 11.7832 14.4911 11.9077 14.103 11.9894C13.3461 12.1487 12.8161 11.7529 12.4561 11.4796L12.4497 11.4747C12.0536 11.174 11.8246 11.0001 11.5 11.0001C11.1487 11.0001 10.9054 11.1552 10.5341 11.4116C10.5253 11.4177 10.5164 11.4238 10.5074 11.43C10.157 11.6722 9.6827 12.0001 9.00001 12.0001C8.31732 12.0001 7.84298 11.6722 7.49262 11.43C7.48365 11.4238 7.47475 11.4177 7.46594 11.4116C7.09458 11.1552 6.85135 11.0001 6.50001 11.0001C6.14867 11.0001 5.90544 11.1552 5.53408 11.4116C5.52526 11.4177 5.51637 11.4238 5.50739 11.43C5.15703 11.6722 4.6827 12.0001 4.00001 12.0001C3.3275 12.0001 2.824 11.582 2.49891 11.312C2.46518 11.284 2.43338 11.2576 2.4035 11.2334C2.21562 11.0813 2.08791 10.9923 1.9744 10.9496ZM1.9744 12.9495C1.88844 12.9171 1.81123 12.9106 1.69697 12.9596C1.48411 13.0508 1.34741 13.1422 1.24478 13.2448C1.14216 13.3474 1.0508 13.4841 0.95958 13.697C0.850805 13.9508 0.556867 14.0684 0.303051 13.9596C0.0492349 13.8508 -0.0683436 13.5569 0.0404318 13.3031C0.166762 13.0083 0.321591 12.7538 0.537671 12.5377C0.75375 12.3216 1.00827 12.1668 1.30305 12.0405C1.67203 11.8823 2.01751 11.8973 2.32661 12.0136C2.60816 12.1195 2.84788 12.3064 3.03274 12.4561C3.05064 12.4706 3.06819 12.4848 3.08541 12.4988C3.4798 12.8185 3.7037 13 4.00001 13C4.35135 13 4.59458 12.8449 4.96594 12.5886C4.97475 12.5825 4.98365 12.5763 4.99262 12.5701C5.34298 12.3279 5.81732 12 6.50001 12C7.1827 12 7.65703 12.3279 8.00739 12.5701C8.01637 12.5763 8.02526 12.5825 8.03408 12.5886C8.40544 12.8449 8.64867 13 9.00001 13C9.35135 13 9.59457 12.8449 9.96593 12.5886C9.97475 12.5825 9.98364 12.5763 9.99262 12.5701C10.343 12.3279 10.8173 12 11.5 12C12.1729 12 12.6568 12.3724 12.9867 12.6262C13.0123 12.646 13.037 12.665 13.0608 12.683C13.4307 12.9639 13.625 13.068 13.897 13.0108C14.1979 12.9474 14.4092 12.862 14.5814 12.7472C14.7537 12.6323 14.9138 12.4701 15.088 12.2168C15.2444 11.9892 15.5557 11.9316 15.7833 12.088C16.0108 12.2444 16.0685 12.5557 15.912 12.7833C15.6874 13.1101 15.4419 13.3754 15.1361 13.5792C14.8304 13.7831 14.4911 13.9076 14.103 13.9893C13.3461 14.1487 12.8161 13.7528 12.4561 13.4795L12.4497 13.4746C12.0536 13.1739 11.8246 13 11.5 13C11.1487 13 10.9054 13.1551 10.5341 13.4115C10.5253 13.4176 10.5164 13.4237 10.5074 13.4299C10.157 13.6721 9.6827 14 9.00001 14C8.31732 14 7.84298 13.6721 7.49262 13.4299C7.48365 13.4237 7.47475 13.4176 7.46594 13.4115C7.09458 13.1551 6.85135 13 6.50001 13C6.14867 13 5.90544 13.1551 5.53408 13.4115C5.52526 13.4176 5.51637 13.4237 5.50739 13.4299C5.15703 13.6721 4.6827 14 4.00001 14C3.3275 14 2.824 13.5819 2.49891 13.3119C2.46518 13.2839 2.43338 13.2575 2.4035 13.2333C2.21562 13.0812 2.08791 12.9922 1.9744 12.9495Z",fill:"currentColor"})]});import{jsx as B4,jsxs as Bn}from"react/jsx-runtime";var In=C=>Bn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[B4("title",{children:"TableTennis"}),B4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.95309 0C9.35664 0 7.60297 0.279138 6.11658 1.69251C4.62679 3.10911 3.48644 5.58617 3.92865 9.80789C3.26056 10.4221 1.28764 12.1256 0.208979 13.0508C-0.0609536 13.2823 -0.0666563 13.6872 0.176037 13.9299L2.0241 15.778C2.26952 16.0234 2.67136 16.01 2.89991 15.7488L6.1814 11.9985C7.31074 11.9849 9.64411 11.8717 11.5513 11.4903C11.8221 11.4361 11.9977 11.1727 11.9435 10.9019C11.8894 10.6312 11.626 10.4556 11.3552 10.5097C10.9218 10.5964 10.4633 10.6687 10.0015 10.7288C9.98354 10.7011 9.96253 10.6746 9.93846 10.6501L5.07011 5.68105C5.41392 4.12899 6.08737 3.1002 6.80566 2.4172C8.06585 1.21892 9.5515 1 9.95309 1C12.2069 1 13.4622 1.85029 14.1549 2.84773C14.8681 3.87458 15.0306 5.12455 14.9551 5.95473C14.9301 6.22974 15.1328 6.47295 15.4078 6.49795C15.6828 6.52295 15.926 6.32028 15.951 6.04527C16.0422 5.04212 15.8547 3.54208 14.9763 2.27727C14.0774 0.983044 12.4993 0 9.95309 0ZM4.88109 6.91704C4.80578 7.74501 4.81322 8.69044 4.93028 9.77004L6.15897 10.9987C6.75672 10.9918 7.70887 10.9556 8.74825 10.8642L4.88109 6.91704ZM1.1883 13.528C2.20196 12.6567 3.71251 11.3504 4.44016 10.6941L5.26886 11.5228L2.42888 14.7685L1.1883 13.528Z",fill:"currentColor"}),B4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9531 9C15.9531 10.1046 15.0577 11 13.9531 11C12.8486 11 11.9531 10.1046 11.9531 9C11.9531 7.89543 12.8486 7 13.9531 7C15.0577 7 15.9531 7.89543 15.9531 9ZM14.9531 9C14.9531 9.55228 14.5054 10 13.9531 10C13.4008 10 12.9531 9.55228 12.9531 9C12.9531 8.44772 13.4008 8 13.9531 8C14.5054 8 14.9531 8.44772 14.9531 9Z",fill:"currentColor"})]});import{jsx as G6,jsxs as En}from"react/jsx-runtime";var kn=C=>En("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[G6("title",{children:"Taekwando"}),G6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6492 0C12.9898 0 13.3203 0.115921 13.5863 0.328697L15.437 1.80932C15.7929 2.09398 16 2.52495 16 2.98062V12.5C16 13.3284 15.3284 14 14.5 14H14V14.5C14 15.3284 13.3284 16 12.5 16H3.5C2.67157 16 2 15.3284 2 14.5V14H1.5C0.671573 14 0 13.3284 0 12.5V3.03518C0 2.53365 0.250652 2.06531 0.66795 1.78711L2.97073 0.251925C3.21713 0.087657 3.50664 0 3.80278 0H12.6492ZM1.22265 2.61916L3.43629 1.1434L6.89821 4.60532L3 7.9188V5.5C3 5.22386 2.77614 5 2.5 5C2.22386 5 2 5.22386 2 5.5V13H1.5C1.22386 13 1 12.7761 1 12.5V3.03518C1 2.86801 1.08355 2.71189 1.22265 2.61916ZM11.1398 1L7.66265 3.95554L4.70711 1H11.1398ZM12.6825 1.00111L3 9.23124V11H13V5.5C13 5.22386 13.2239 5 13.5 5C13.7761 5 14 5.22386 14 5.5V13H14.5C14.7761 13 15 12.7761 15 12.5V2.98062C15 2.82873 14.931 2.68508 14.8123 2.59019L12.9616 1.10957C12.8816 1.0456 12.7842 1.00789 12.6825 1.00111ZM13 12V14.5C13 14.7761 12.7761 15 12.5 15H3.5C3.22386 15 3 14.7761 3 14.5V12H6.79298L5.64645 13.1465C5.45118 13.3418 5.45118 13.6584 5.64645 13.8536C5.84171 14.0489 6.15829 14.0489 6.35355 13.8536L8 12.2072L9.64645 13.8536C9.84171 14.0489 10.1583 14.0489 10.3536 13.8536C10.5488 13.6584 10.5488 13.3418 10.3536 13.1465L9.20702 12H13Z",fill:"currentColor"})]});import{jsx as n,jsxs as An}from"react/jsx-runtime";var Fn=C=>An("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[n("title",{children:"Tennis"}),n("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4596 14.9515C13.8358 14.9515 14.9515 13.8358 14.9515 12.4596C14.9515 11.0833 13.8358 9.96766 12.4596 9.96766C11.0833 9.96766 9.96767 11.0833 9.96767 12.4596C9.96767 13.8358 11.0833 14.9515 12.4596 14.9515ZM12.4596 15.9483C14.3863 15.9483 15.9483 14.3863 15.9483 12.4596C15.9483 10.5328 14.3863 8.97089 12.4596 8.97089C10.5328 8.97089 8.9709 10.5328 8.9709 12.4596C8.9709 14.3863 10.5328 15.9483 12.4596 15.9483Z",fill:"currentColor"}),n("path",{d:"M9.46928 2.99029C9.46928 3.26554 9.24615 3.48868 8.9709 3.48868C8.69565 3.48868 8.47252 3.26554 8.47252 2.99029C8.47252 2.71504 8.69565 2.49191 8.9709 2.49191C9.24615 2.49191 9.46928 2.71504 9.46928 2.99029Z",fill:"currentColor"}),n("path",{d:"M9.46928 4.98383C9.46928 5.25908 9.24615 5.48221 8.9709 5.48221C8.69565 5.48221 8.47252 5.25908 8.47252 4.98383C8.47252 4.70858 8.69565 4.48544 8.9709 4.48544C9.24615 4.48544 9.46928 4.70858 9.46928 4.98383Z",fill:"currentColor"}),n("path",{d:"M9.46928 6.97736C9.46928 7.25261 9.24615 7.47574 8.9709 7.47574C8.69565 7.47574 8.47252 7.25261 8.47252 6.97736C8.47252 6.70211 8.69565 6.47898 8.9709 6.47898C9.24615 6.47898 9.46928 6.70211 9.46928 6.97736Z",fill:"currentColor"}),n("path",{d:"M9.46928 8.97089C9.46928 9.24614 9.24615 9.46928 8.9709 9.46928C8.69565 9.46928 8.47252 9.24614 8.47252 8.97089C8.47252 8.69564 8.69565 8.47251 8.9709 8.47251C9.24615 8.47251 9.46928 8.69564 9.46928 8.97089Z",fill:"currentColor"}),n("path",{d:"M7.47575 8.97089C7.47575 9.24614 7.25262 9.46928 6.97737 9.46928C6.70212 9.46928 6.47898 9.24614 6.47898 8.97089C6.47898 8.69564 6.70212 8.47251 6.97737 8.47251C7.25262 8.47251 7.47575 8.69564 7.47575 8.97089Z",fill:"currentColor"}),n("path",{d:"M7.47575 6.97736C7.47575 7.25261 7.25262 7.47574 6.97737 7.47574C6.70212 7.47574 6.47898 7.25261 6.47898 6.97736C6.47898 6.70211 6.70212 6.47898 6.97737 6.47898C7.25262 6.47898 7.47575 6.70211 7.47575 6.97736Z",fill:"currentColor"}),n("path",{d:"M7.47575 4.98383C7.47575 5.25908 7.25262 5.48221 6.97737 5.48221C6.70212 5.48221 6.47898 5.25908 6.47898 4.98383C6.47898 4.70858 6.70212 4.48544 6.97737 4.48544C7.25262 4.48544 7.47575 4.70858 7.47575 4.98383Z",fill:"currentColor"}),n("path",{d:"M11.4628 2.99029C11.4628 3.26554 11.2397 3.48868 10.9644 3.48868C10.6892 3.48868 10.466 3.26554 10.466 2.99029C10.466 2.71504 10.6892 2.49191 10.9644 2.49191C11.2397 2.49191 11.4628 2.71504 11.4628 2.99029Z",fill:"currentColor"}),n("path",{d:"M11.4628 4.98383C11.4628 5.25908 11.2397 5.48221 10.9644 5.48221C10.6892 5.48221 10.466 5.25908 10.466 4.98383C10.466 4.70858 10.6892 4.48544 10.9644 4.48544C11.2397 4.48544 11.4628 4.70858 11.4628 4.98383Z",fill:"currentColor"}),n("path",{d:"M11.4628 6.97736C11.4628 7.25261 11.2397 7.47574 10.9644 7.47574C10.6892 7.47574 10.466 7.25261 10.466 6.97736C10.466 6.70211 10.6892 6.47898 10.9644 6.47898C11.2397 6.47898 11.4628 6.70211 11.4628 6.97736Z",fill:"currentColor"}),n("path",{d:"M13.4563 2.99029C13.4563 3.26554 13.2332 3.48868 12.958 3.48868C12.6827 3.48868 12.4596 3.26554 12.4596 2.99029C12.4596 2.71504 12.6827 2.49191 12.958 2.49191C13.2332 2.49191 13.4563 2.71504 13.4563 2.99029Z",fill:"currentColor"}),n("path",{d:"M13.4563 4.98383C13.4563 5.25908 13.2332 5.48221 12.958 5.48221C12.6827 5.48221 12.4596 5.25908 12.4596 4.98383C12.4596 4.70858 12.6827 4.48544 12.958 4.48544C13.2332 4.48544 13.4563 4.70858 13.4563 4.98383Z",fill:"currentColor"}),n("path",{d:"M13.4563 6.97736C13.4563 7.25261 13.2332 7.47574 12.958 7.47574C12.6827 7.47574 12.4596 7.25261 12.4596 6.97736C12.4596 6.70211 12.6827 6.47898 12.958 6.47898C13.2332 6.47898 13.4563 6.70211 13.4563 6.97736Z",fill:"currentColor"}),n("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.1261 0.0777097C11.4979 -0.131143 13.0237 0.0471453 14.2661 1.04104C15.6765 2.16941 16.0371 3.72178 15.9473 5.13737C15.8582 6.53992 15.3286 7.858 14.8888 8.64961C14.7551 8.89022 14.4517 8.97691 14.2111 8.84324C13.9705 8.70956 13.8838 8.40614 14.0175 8.16553C14.4083 7.46199 14.8754 6.28817 14.9525 5.07421C15.0287 3.8733 14.7249 2.68456 13.6434 1.81938C12.6843 1.05208 11.469 0.881509 10.2762 1.06312C9.07877 1.24543 7.96666 1.77538 7.28871 2.31775C6.12534 3.24844 5.20421 4.65997 4.86291 6.10919C4.52409 7.54786 4.76199 8.97609 5.83462 10.0487C6.5283 10.7424 7.60708 11.0664 8.04937 11.1341C8.32145 11.1758 8.50825 11.4301 8.46659 11.7022C8.42494 11.9743 8.17061 12.161 7.89853 12.1194C7.34417 12.0345 6.03098 11.6547 5.12981 10.7535C3.75576 9.3795 3.49525 7.56824 3.89268 5.88069C4.28763 4.2037 5.33743 2.60228 6.66602 1.53942C7.48314 0.885705 8.75896 0.285866 10.1261 0.0777097Z",fill:"currentColor"}),n("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.56738 8.41438C4.83889 8.45963 5.0223 8.71641 4.97705 8.98791L4.59338 11.29L6.89543 10.9063C7.16694 10.861 7.42372 11.0445 7.46897 11.316C7.51422 11.5875 7.3308 11.8442 7.0593 11.8895L4.20665 12.3649C3.80187 12.4324 3.45094 12.0815 3.51841 11.6767L3.99385 8.82404C4.0391 8.55254 4.29588 8.36912 4.56738 8.41438Z",fill:"currentColor"}),n("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.98613 12.3133L1.14686 14.1526C0.952229 14.3472 0.952229 14.6628 1.14686 14.8574C1.34149 15.052 1.65705 15.052 1.85168 14.8574L3.69095 13.0181C3.88558 12.8235 3.88558 12.508 3.69095 12.3133C3.49631 12.1187 3.18076 12.1187 2.98613 12.3133ZM0.442039 13.4478C-0.141853 14.0317 -0.141853 14.9783 0.442039 15.5622C1.02593 16.1461 1.97261 16.1461 2.5565 15.5622L4.39577 13.723C4.97966 13.1391 4.97966 12.1924 4.39577 11.6085C3.81187 11.0246 2.8652 11.0246 2.28131 11.6085L0.442039 13.4478Z",fill:"currentColor"})]});import{jsx as P6,jsxs as Tn}from"react/jsx-runtime";var Dn=C=>Tn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[P6("title",{children:"TennisCourt"}),P6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3C0 2.44772 0.447715 2 1 2H15C15.5523 2 16 2.44772 16 3V13C16 13.5523 15.5523 14 15 14H1C0.447715 14 0 13.5523 0 13V3ZM4.5 3H11.5V7.5H4.5V3ZM3.5 3H1V7.5H2C2.27614 7.5 2.5 7.72386 2.5 8C2.5 8.27614 2.27614 8.5 2 8.5H1V13H3.5V3ZM15 7.5H14C13.7239 7.5 13.5 7.72386 13.5 8C13.5 8.27614 13.7239 8.5 14 8.5H15V13H12.5V3H15V7.5ZM11.5 8.5V13H4.5V8.5H11.5Z",fill:"currentColor"})]});import{jsx as N1,jsxs as Wn}from"react/jsx-runtime";var _n=C=>Wn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[N1("title",{children:"TenPinBowling"}),N1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.87245 7C4.9585 7.17411 5.04827 7.3436 5.13072 7.49447C5.24742 7.70803 5.35788 7.89924 5.43911 8.03699C5.47979 8.10597 5.51329 8.1618 5.53677 8.20063L5.56415 8.24571L5.57157 8.25782L5.57445 8.2625C5.71942 8.49753 6.02747 8.57053 6.2625 8.42555C6.49751 8.28058 6.57017 7.97199 6.42523 7.73697L6.42375 7.73456L6.41746 7.7243L6.3925 7.68321C6.3707 7.64716 6.3391 7.5945 6.3005 7.52904C6.22317 7.39791 6.11838 7.21648 6.00824 7.01493C5.77888 6.59523 5.55743 6.14357 5.48238 5.86842C5.41272 5.61307 5.38439 5.42554 5.3844 5.25002C5.3844 5.07449 5.41274 4.88693 5.48239 4.63155C5.53523 4.43775 5.59234 4.25333 5.65218 4.06006C5.69991 3.90592 5.74938 3.74616 5.79982 3.57153C5.90062 3.22256 6 2.82946 6 2.5C6 0.723908 4.77633 0 4.00013 0C3.22409 0 1.99987 0.723757 1.99987 2.5C1.99987 2.84193 2.13036 3.26831 2.23662 3.60805L2.27918 3.74358C2.38169 4.06927 2.47019 4.35045 2.50612 4.57799C2.56879 4.97489 2.55164 5.21883 2.52466 5.60254C2.51695 5.71216 2.50844 5.8332 2.50076 5.97247C2.44921 6.90717 2.15892 7.43731 1.82211 8.05239L1.76505 8.15675C1.38666 8.85069 1 9.63093 1 11C1 13.0104 1.36563 14.118 2.075 14.65C2.4332 14.9186 2.82417 14.9962 3.15977 15.0149C3.32605 15.0241 3.48692 15.0192 3.62688 15.0132L3.72694 15.0087C3.82902 15.004 3.91547 15 4 15H5.49999C5.77614 15 6 14.7761 6 14.5C6 14.2239 5.77587 14 5.49972 14H4C3.89001 14 3.77234 14.0055 3.66603 14.0104L3.58406 14.0141C3.45058 14.0199 3.3302 14.0228 3.21523 14.0164C2.98833 14.0038 2.8168 13.9564 2.675 13.85C2.38437 13.632 2 12.9896 2 11C2 9.86907 2.30204 9.2608 2.64301 8.63548L2.70585 8.52072C2.94202 8.09035 3.19721 7.62532 3.35497 7H4.87245ZM2.99987 2.5C2.99987 1.27624 3.77618 1 4.00013 1C4.22394 1 5 1.27609 5 2.5C5 2.67054 4.94199 2.93782 4.8391 3.29403C4.80163 3.42374 4.75529 3.5743 4.70744 3.72975C4.6799 3.8192 4.65184 3.91037 4.62472 4H3.40029C3.3491 3.81005 3.28809 3.61705 3.23207 3.43983L3.19102 3.30953C3.07129 2.92674 2.99987 2.65807 2.99987 2.5ZM4.3844 5.24999C4.3844 5.166 4.38844 5.083 4.3962 5H3.54721C3.55333 5.25118 3.53705 5.47731 3.51986 5.71589C3.51323 5.80799 3.50646 5.90203 3.5008 6H4.48351C4.42014 5.74125 4.38439 5.50003 4.3844 5.24999Z",fill:"currentColor"}),N1("path",{d:"M9 9.5C9 9.77614 8.77614 10 8.5 10C8.22386 10 8 9.77614 8 9.5C8 9.22386 8.22386 9 8.5 9C8.77614 9 9 9.22386 9 9.5Z",fill:"currentColor"}),N1("path",{d:"M10.5 10C10.7761 10 11 9.77614 11 9.5C11 9.22386 10.7761 9 10.5 9C10.2239 9 10 9.22386 10 9.5C10 9.77614 10.2239 10 10.5 10Z",fill:"currentColor"}),N1("path",{d:"M10 10.5C10 10.7761 9.77614 11 9.5 11C9.22386 11 9 10.7761 9 10.5C9 10.2239 9.22386 10 9.5 10C9.77614 10 10 10.2239 10 10.5Z",fill:"currentColor"}),N1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 16C12.9853 16 15 13.9853 15 11.5C15 9.01472 12.9853 7 10.5 7C8.01472 7 6 9.01472 6 11.5C6 13.9853 8.01472 16 10.5 16ZM10.5 15C12.433 15 14 13.433 14 11.5C14 9.567 12.433 8 10.5 8C8.567 8 7 9.567 7 11.5C7 13.433 8.567 15 10.5 15Z",fill:"currentColor"})]});import{jsx as k4,jsxs as Nn}from"react/jsx-runtime";var On=C=>Nn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[k4("title",{children:"Trampoline"}),k4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 6.5C13 7.88071 10.7614 9 8 9C5.23858 9 3 7.88071 3 6.5C3 5.11929 5.23858 4 8 4C10.7614 4 13 5.11929 13 6.5ZM12 6.5C12 6.60753 11.8868 6.97408 11.0883 7.37334C10.3496 7.74269 9.25913 8 8 8C6.74087 8 5.65038 7.74269 4.91168 7.37334C4.11316 6.97408 4 6.60753 4 6.5C4 6.39247 4.11316 6.02592 4.91168 5.62666C5.65038 5.25731 6.74087 5 8 5C9.25913 5 10.3496 5.25731 11.0883 5.62666C11.8868 6.02592 12 6.39247 12 6.5Z",fill:"currentColor"}),k4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.9008 12.5025L13.1841 9.92747C12.5368 10.2375 11.8006 10.4906 11 10.6729V13.4C11 13.7314 10.7314 14 10.4 14H5.6C5.26863 14 5 13.7314 5 13.4V10.6729C4.33939 10.5225 3.72264 10.3239 3.16351 10.0848L1.06093 12.6079C0.701674 13.039 0 12.785 0 12.2238V7C0 6.94697 0.00825638 6.89586 0.0235539 6.8479C0.00794692 6.73309 0 6.61707 0 6.5C0 4.01472 3.58172 2 8 2C12.4183 2 16 4.01472 16 6.5V12.1697C16 12.7634 15.2301 12.9965 14.9008 12.5025ZM13.1666 8.8104C14.47 8.07725 15 7.22091 15 6.5C15 5.77909 14.47 4.92275 13.1666 4.1896C11.8946 3.47407 10.0699 3 8 3C5.93008 3 4.10544 3.47407 2.83341 4.1896C1.53003 4.92275 1 5.77909 1 6.5C1 7.22091 1.53003 8.07725 2.83341 8.8104C4.10544 9.52592 5.93008 10 8 10C10.0699 10 11.8946 9.52592 13.1666 8.8104ZM14.0597 9.4381C14.417 9.20509 14.7327 8.95125 15 8.68025V10.8486L14.0597 9.4381ZM8 11C8.6906 11 9.36076 10.9508 10 10.8582V13H6V10.8582C6.63924 10.9508 7.3094 11 8 11ZM1 8.68025C1.34086 9.02578 1.76022 9.34341 2.24453 9.62553L1 11.119V8.68025Z",fill:"currentColor"})]});import{jsx as x6,jsxs as Jn}from"react/jsx-runtime";var Un=C=>Jn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[x6("title",{children:"Volleyball"}),x6("path",{d:"M8 0C6.41775 0 4.87103 0.469192 3.55544 1.34824C2.23985 2.22729 1.21447 3.47672 0.608967 4.93853C0.00346614 6.40034 -0.15496 8.00887 0.153721 9.56072C0.462403 11.1126 1.22433 12.538 2.34315 13.6569C3.46197 14.7757 4.88743 15.5376 6.43928 15.8463C7.99113 16.155 9.59966 15.9965 11.0615 15.391C12.5233 14.7855 13.7727 13.7602 14.6518 12.4446C15.5308 11.129 16 9.58225 16 8C15.9975 5.87903 15.1539 3.84565 13.6541 2.3459C12.1544 0.846145 10.121 0.00249086 8 0ZM14.5388 10.658C13.4201 11.4359 12.1002 11.8733 10.7385 11.9175C9.37665 11.9618 8.03114 11.611 6.86432 10.9074L8.27137 8.47059H15.0431C14.9935 9.22207 14.8232 9.96066 14.5388 10.658ZM4.88628 1.66588C5.5614 1.33294 6.28568 1.11075 7.03137 1.00784C8.26448 1.58761 9.30343 2.51189 10.0228 3.66912C10.7422 4.82634 11.1113 6.16705 11.0855 7.52941H8.27137L4.88628 1.66588ZM15.0431 7.52941H12.0267C12.0475 6.2638 11.768 5.01128 11.2113 3.87454C10.6545 2.73779 9.83621 1.7492 8.82353 0.989804C10.4598 1.1843 11.9768 1.9442 13.1124 3.13823C14.248 4.33226 14.9309 5.88542 15.0431 7.52941ZM4.07216 2.13804L5.57883 4.74745C4.4725 5.36243 3.52762 6.23076 2.82157 7.2813C2.11553 8.33185 1.66842 9.53472 1.51687 10.7914C0.864634 9.2777 0.763095 7.58341 1.22988 6.00267C1.69666 4.42194 2.70229 3.05459 4.07216 2.13804ZM2.43138 12.3286C2.3182 10.9718 2.59984 9.61123 3.24234 8.41084C3.88484 7.21045 4.86078 6.22149 6.05255 5.56314L7.45647 8L4.07216 13.862C3.44741 13.441 2.89357 12.9235 2.43138 12.3286ZM8 15.0588C6.92017 15.06 5.85463 14.812 4.88628 14.3341L6.39373 11.7231C7.4788 12.3735 8.70248 12.7576 9.96458 12.8441C11.2267 12.9305 12.4913 12.7168 13.6549 12.2204C12.9985 13.1013 12.1455 13.8166 11.1637 14.3094C10.1819 14.8022 9.09853 15.0589 8 15.0588Z",fill:"currentColor"})]});import{jsx as v2,jsxs as qn}from"react/jsx-runtime";var Kn=C=>qn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[v2("title",{children:"VolleyballCourt"}),v2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 4H1V12H15V4ZM1 3C0.447715 3 0 3.44772 0 4V12C0 12.5523 0.447715 13 1 13H15C15.5523 13 16 12.5523 16 12V4C16 3.44772 15.5523 3 15 3H1Z",fill:"currentColor"}),v2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 2C8.27614 2 8.5 2.22386 8.5 2.5V13.5C8.5 13.7761 8.27614 14 8 14C7.72386 14 7.5 13.7761 7.5 13.5V2.5C7.5 2.22386 7.72386 2 8 2Z",fill:"currentColor"}),v2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 3C4.77614 3 5 3.22386 5 3.5V12H10.5V3.5C10.5 3.22386 10.7239 3 11 3C11.2761 3 11.5 3.22386 11.5 3.5V12.5L11 13H4.5L4 12.5V3.5C4 3.22386 4.22386 3 4.5 3Z",fill:"currentColor"})]});import{jsx as W,jsxs as Xn}from"react/jsx-runtime";var zn=C=>Xn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[W("title",{children:"WaterPolo"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 1.5C4.40657 1.5 1.49999 4.39014 1.49999 7.94737C1.49999 9.35065 1.95139 10.6482 2.71855 11.7066C2.88061 11.9302 2.83073 12.2428 2.60715 12.4048C2.38356 12.5669 2.07093 12.517 1.90887 12.2934C1.02247 11.0705 0.499987 9.56894 0.499987 7.94737C0.499987 3.83075 3.86142 0.5 7.99999 0.5C12.1386 0.5 15.5 3.83075 15.5 7.94737C15.5 9.56893 14.9775 11.0705 14.0911 12.2934C13.929 12.517 13.6164 12.5669 13.3928 12.4048C13.1692 12.2428 13.1194 11.9302 13.2814 11.7066C14.0486 10.6482 14.5 9.35065 14.5 7.94737C14.5 4.39014 11.5934 1.5 7.99999 1.5Z",fill:"currentColor"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3557 3.32486C12.2167 3.81161 11.945 4.4839 11.416 5.27735C10.8482 6.12905 10.0123 6.67785 9.34859 7.00971C9.01283 7.1776 8.71086 7.29506 8.49167 7.37093C8.38183 7.40895 8.29211 7.43676 8.22851 7.4554C8.19669 7.46473 8.17136 7.47177 8.15325 7.47667L8.13157 7.48243L8.12496 7.48413L8.12274 7.4847L8.12156 7.485C8.1214 7.48503 8.12126 7.48507 7.99999 7C7.87872 6.51493 7.87859 6.51496 7.87846 6.51499L7.87994 6.51461L7.89214 6.51136C7.90381 6.50821 7.92242 6.50305 7.94724 6.49577C7.99692 6.48121 8.07127 6.45824 8.16456 6.42594C8.35161 6.36119 8.61215 6.2599 8.90138 6.11529C9.48766 5.82215 10.1518 5.37095 10.584 4.72265C11.055 4.0161 11.2833 3.43839 11.3942 3.05014C11.4498 2.85565 11.4762 2.70765 11.4887 2.61361C11.495 2.56656 11.4978 2.53295 11.4991 2.51371C11.4997 2.50409 11.4999 2.49805 11.5 2.49573C11.5 2.49503 11.5 2.49457 11.5 2.49573L11.5 2.49681L11.5 2.49823L11.5 2.49952C11.5 2.49976 11.5 2.5 12 2.5C12.5 2.5 12.5 2.50025 12.5 2.5005L12.5 2.50214L12.5 2.50465L12.4999 2.51079L12.4995 2.52746C12.4991 2.54052 12.4983 2.55744 12.497 2.57809C12.4943 2.6194 12.4893 2.67563 12.48 2.74577C12.4613 2.8861 12.4252 3.08185 12.3557 3.32486ZM7.87846 6.51499C7.87833 6.51503 7.87836 6.51502 7.87846 6.51499V6.51499Z",fill:"currentColor"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9642 14.3143C16.0668 14.5707 15.9421 14.8617 15.6857 14.9642L13.8111 15.7141C13.2807 15.9262 12.6849 15.9015 12.1739 15.646L11.3789 15.2485C11.1234 15.1207 10.8255 15.1083 10.5603 15.2144L9.3111 15.7141C8.78069 15.9262 8.18486 15.9015 7.6739 15.646L6.9472 15.2826C6.66567 15.1419 6.3343 15.1419 6.05277 15.2826L5.39441 15.6118C4.83136 15.8933 4.16862 15.8933 3.60556 15.6118L2.9472 15.2826C2.66567 15.1419 2.3343 15.1419 2.05277 15.2826L0.723594 15.9472C0.476605 16.0707 0.176268 15.9706 0.0527739 15.7236C-0.0707208 15.4766 0.0293914 15.1763 0.276381 15.0528L1.60556 14.3882C2.16862 14.1067 2.83136 14.1067 3.39441 14.3882L4.05277 14.7174C4.3343 14.8581 4.66567 14.8581 4.9472 14.7174L5.60556 14.3882C6.16862 14.1067 6.83136 14.1067 7.39441 14.3882L8.12111 14.7515C8.37659 14.8793 8.67451 14.8917 8.93971 14.7856L10.1889 14.2859C10.7193 14.0738 11.3151 14.0985 11.8261 14.354L12.6211 14.7515C12.8766 14.8793 13.1745 14.8917 13.4397 14.7856L15.3143 14.0358C15.5707 13.9332 15.8617 14.0579 15.9642 14.3143Z",fill:"currentColor"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.59021 6.0082C4.86182 6.05804 5.04159 6.31862 4.99176 6.59023C4.77616 7.7652 4.73013 8.59389 4.8658 9.3439C5.00076 10.09 5.3236 10.8022 5.92042 11.7294C6.06988 11.9616 6.00281 12.271 5.77061 12.4204C5.53841 12.5699 5.22901 12.5028 5.07955 12.2706C4.44661 11.2873 4.04939 10.4486 3.88177 9.5219C3.71485 8.59912 3.7837 7.6331 4.00818 6.40975C4.05802 6.13814 4.3186 5.95836 4.59021 6.0082Z",fill:"currentColor"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.05901 6.5035C8.33322 6.5361 8.52909 6.78482 8.49649 7.05903C8.38217 8.02068 8.39151 8.72829 8.53384 9.40322C8.67695 10.0819 8.96111 10.7595 9.44078 11.6553C9.57113 11.8988 9.47944 12.2018 9.23599 12.3322C8.99255 12.4625 8.68954 12.3708 8.55919 12.1274C8.06088 11.1967 7.72684 10.4228 7.55536 9.60955C7.38308 8.79257 7.38141 7.96779 7.50348 6.94097C7.53608 6.66676 7.7848 6.4709 8.05901 6.5035Z",fill:"currentColor"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.88621 6.0404C2.51578 5.77066 3.41682 5.5 4.50011 5.5C5.58159 5.5 6.52095 5.76983 7.18575 6.03576C7.51932 6.1692 7.7873 6.30306 7.97382 6.40481C8.06718 6.45574 8.14044 6.49879 8.19162 6.52994C8.21722 6.54552 8.23732 6.55815 8.25169 6.56732L8.26891 6.57842L8.27424 6.58192L8.27607 6.58314L8.27709 6.58381C8.27722 6.5839 8.27736 6.58399 7.99999 7C7.72262 7.41601 7.72274 7.41609 7.72285 7.41617L7.71362 7.41022C7.70504 7.40474 7.69096 7.39588 7.67164 7.38412C7.63299 7.36059 7.57344 7.32551 7.49494 7.28269C7.33774 7.19694 7.10575 7.0808 6.81434 6.96423C6.22921 6.73017 5.41863 6.5 4.50011 6.5C3.58341 6.5 2.81745 6.72933 2.28003 6.95958C2.01182 7.0745 1.80271 7.18873 1.66298 7.27253C1.59321 7.31438 1.54101 7.34847 1.50769 7.37104C1.49104 7.38231 1.47913 7.39069 1.47212 7.39569L1.46533 7.40059C1.46546 7.40049 1.46603 7.40006 1.16613 6.99999C0.866222 6.59992 0.866368 6.59981 0.866519 6.59969L0.867597 6.59889L0.869469 6.5975L0.874702 6.59365L0.891068 6.58183C0.904581 6.57218 0.923285 6.55907 0.947015 6.543C0.994459 6.51088 1.0621 6.46685 1.14864 6.41495C1.32154 6.31125 1.57092 6.17548 1.88621 6.0404ZM1.46533 7.40059C1.46496 7.40086 1.46537 7.40056 1.46533 7.40059V7.40059Z",fill:"currentColor"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.88067 2.76951C4.77667 2.54934 5.97512 2.35168 7.06929 2.50482C8.17163 2.65909 9.24205 3.20171 10.0135 3.68C10.4044 3.92236 10.7298 4.15537 10.9581 4.32821C11.0724 4.41476 11.1628 4.48657 11.2253 4.53737C11.2566 4.56278 11.281 4.58296 11.2979 4.59713L11.3177 4.6138L11.3233 4.61858L11.325 4.62004L11.3258 4.62074C11.3259 4.62081 11.326 4.62089 11 4.99997C10.674 5.37906 10.674 5.37912 10.6741 5.37917L10.6707 5.37626L10.6562 5.36404C10.6428 5.35288 10.6223 5.33583 10.595 5.31366C10.5403 5.2693 10.4589 5.20454 10.3544 5.12546C10.1452 4.96705 9.84562 4.75254 9.48651 4.5299C8.75793 4.07817 7.82835 3.62079 6.93069 3.49516C6.02486 3.36839 4.97331 3.53077 4.1193 3.74062C3.69813 3.84412 3.33676 3.95614 3.08132 4.0421C2.95377 4.08501 2.85312 4.12126 2.78515 4.14646C2.75119 4.15906 2.72542 4.16888 2.70859 4.17538L2.69015 4.18255L2.68614 4.18414C2.6862 4.18411 2.68568 4.18432 2.49999 3.72008C2.31429 3.25584 2.31439 3.2558 2.31449 3.25576L2.31543 3.25539L2.31748 3.25457L2.32429 3.25188L2.34851 3.24246C2.36928 3.23444 2.39918 3.22305 2.43748 3.20885C2.51405 3.18046 2.62433 3.14077 2.76241 3.09431C3.03821 3.00151 3.42685 2.88103 3.88067 2.76951ZM2.68614 4.18414C2.6861 4.18415 2.6861 4.18415 2.68614 4.18414V4.18414Z",fill:"currentColor"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.0713 5.24273L14.9287 5.75733L14.9239 5.76526L14.9106 5.78722L14.8602 5.8701C14.8165 5.94168 14.7531 6.04467 14.674 6.17125C14.5159 6.42422 14.2944 6.77226 14.041 7.15235C13.5423 7.90042 12.8928 8.81428 12.3535 9.35355C11.8079 9.8992 11.0135 10.425 10.3823 10.8037C10.0617 10.9961 9.77352 11.1562 9.56528 11.2684C9.46105 11.3245 9.37656 11.3687 9.31772 11.3992C9.2883 11.4144 9.26526 11.4262 9.24936 11.4343L9.23093 11.4436L9.22589 11.4461L9.22445 11.4468C9.22439 11.4469 9.22373 11.4472 9.00012 11L8.77643 10.5528L8.78084 10.5506L8.79628 10.5428L8.85828 10.511C8.91271 10.4828 8.99228 10.4411 9.09116 10.3879C9.28915 10.2813 9.56342 10.1289 9.86779 9.94626C10.4865 9.575 11.1921 9.1008 11.6464 8.64645C12.1072 8.18572 12.7077 7.34958 13.209 6.59765C13.4556 6.22774 13.6716 5.88828 13.826 5.64125C13.9031 5.51783 13.9647 5.4177 14.0069 5.34865L14.0551 5.26942L14.0674 5.24915L14.0713 5.24273Z",fill:"currentColor"})]});import{jsx as b6,jsxs as Qn}from"react/jsx-runtime";var Yn=C=>Qn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[b6("title",{children:"Weightlifting"}),b6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 9.5V12C5 12.5523 4.55228 13 4 13H3C2.44772 13 2 12.5523 2 12V11H1C0.447715 11 0 10.5523 0 10V6C0 5.44772 0.447715 5 1 5H2V4C2 3.44772 2.44772 3 3 3H4C4.55228 3 5 3.44772 5 4V6.5H11V4C11 3.44772 11.4477 3 12 3H13C13.5523 3 14 3.44772 14 4V5H15C15.5523 5 16 5.44772 16 6V10C16 10.5523 15.5523 11 15 11H14V12C14 12.5523 13.5523 13 13 13H12C11.4477 13 11 12.5523 11 12V9.5H5ZM4 4H3V12H4V4ZM11 8.5H5V7.5H11V8.5ZM12 12H13V4H12V12ZM1 6H2V10H1L1 6ZM14 6H15V10H14V6Z",fill:"currentColor"})]});import{jsx as m2,jsxs as jn}from"react/jsx-runtime";var $n=C=>jn("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[m2("title",{children:"Wrestling"}),m2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.9714 0.581641C3.98062 0.241668 4.26136 0 4.57133 0H5.88934C6.17668 0 6.42374 0.202795 6.4796 0.484782C6.52478 0.712806 6.6764 1.39435 6.96654 2.00759C7.11186 2.31473 7.2787 2.57589 7.46109 2.75415C7.63826 2.92732 7.80504 3 7.97369 3C8.14235 3 8.30913 2.92732 8.4863 2.75415C8.66869 2.57589 8.83553 2.31473 8.98085 2.00759C9.27098 1.39435 9.42261 0.712807 9.46778 0.484782C9.52365 0.202797 9.7707 0 10.058 0H11.3761C11.686 0 11.9668 0.241664 11.976 0.58164C11.9942 1.25525 12.116 5.28418 12.4693 7.93392C12.8181 10.5501 13.7511 14.5108 13.9305 15.2611C14.0222 15.6447 13.728 16 13.3465 16H10.0557C9.78771 16 9.52952 15.8188 9.46828 15.5244C9.4034 15.2124 9.14303 14.0017 8.78703 12.8748C8.60797 12.308 8.41208 11.7864 8.21456 11.415C8.1217 11.2404 8.03965 11.1206 7.97369 11.0478C7.90773 11.1206 7.82569 11.2404 7.73283 11.415C7.53531 11.7864 7.33942 12.308 7.16036 12.8748C6.80436 14.0017 6.54399 15.2124 6.47911 15.5244C6.41787 15.8188 6.15969 16 5.89171 16H2.60087C2.21943 16 1.92517 15.6447 2.01688 15.2611C2.19625 14.5109 3.12926 10.5501 3.47808 7.93392C3.83138 5.28418 3.95314 1.25525 3.9714 0.581641ZM4.95941 1C4.91932 2.25682 4.78629 5.68872 4.46931 8.06608C4.16274 10.3654 3.42104 13.6509 3.106 15H5.56896C5.68549 14.4721 5.91419 13.4998 6.20681 12.5735C6.39155 11.9888 6.60914 11.3982 6.84993 10.9455C6.96943 10.7208 7.1076 10.5049 7.26784 10.3386C7.42099 10.1797 7.65895 10 7.97369 10C8.28844 10 8.5264 10.1797 8.67955 10.3386C8.83979 10.5049 8.97796 10.7208 9.09746 10.9455C9.33825 11.3982 9.55584 11.9888 9.74058 12.5735C10.0332 13.4998 10.2619 14.4721 10.3784 15H12.8414C12.5263 13.6509 11.7847 10.3654 11.4781 8.06608C11.1611 5.68872 11.0281 2.25682 10.988 1H10.3777C10.2902 1.36111 10.1325 1.91172 9.88478 2.43526C9.71341 2.79748 9.48576 3.17561 9.18528 3.46929C8.8796 3.76807 8.47517 4 7.97369 4C7.47222 4 7.06779 3.76807 6.7621 3.46929C6.46163 3.17561 6.23398 2.79748 6.06261 2.43526C5.81491 1.91172 5.65715 1.36111 5.56967 1H4.95941Z",fill:"currentColor"}),m2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.96017 4.00018C10.2362 3.99272 10.466 4.21044 10.4735 4.48648L10.4738 4.49748L10.4748 4.53104L10.4789 4.66133C10.4826 4.77476 10.4884 4.9393 10.4965 5.14297C10.5128 5.55045 10.5385 6.11382 10.5763 6.73749C10.6526 7.99471 10.7762 9.46322 10.964 10.4019C11.1532 11.348 11.5205 12.5748 11.8458 13.578C12.0075 14.0768 12.1572 14.5152 12.2664 14.8289C12.321 14.9857 12.3655 15.1111 12.3962 15.1972L12.4315 15.2957L12.4406 15.3208L12.4434 15.3286C12.4434 15.3286 12.4434 15.3286 12.4434 15.3286C12.5378 15.588 12.4042 15.8754 12.1447 15.9698C11.8853 16.0643 11.5983 15.9305 11.5039 15.6711L11.5004 15.6616L11.4908 15.6349L11.4544 15.5333C11.4229 15.4451 11.3776 15.3172 11.322 15.1578C11.211 14.839 11.059 14.3936 10.8945 13.8865C10.5674 12.8778 10.1847 11.6046 9.9834 10.5981C9.78062 9.58416 9.65427 8.05267 9.57816 6.79804C9.53981 6.16579 9.51376 5.59528 9.4973 5.18286C9.48906 4.97657 9.48322 4.80965 9.47943 4.69412L9.47524 4.56082L9.47422 4.52586L9.4739 4.51442C9.46643 4.23838 9.68413 4.00765 9.96017 4.00018ZM5.97516 4C6.2513 4.00081 6.4745 4.22532 6.47369 4.50146L5.97369 4.5C6.47369 4.50146 6.47369 4.5014 6.47369 4.50146L6.47364 4.51409L6.47343 4.54935C6.47322 4.58015 6.47285 4.6253 6.4722 4.6833C6.47091 4.79929 6.46851 4.96672 6.4641 5.17357C6.45529 5.58706 6.43841 6.1591 6.4061 6.79321C6.3422 8.04761 6.21601 9.59227 5.95877 10.6213C5.711 11.6123 5.33238 12.8738 5.01793 13.8812C4.86028 14.3863 4.71797 14.83 4.61506 15.1475C4.5636 15.3063 4.52196 15.4336 4.49316 15.5213L4.45995 15.6221L4.44843 15.6569L3.97369 15.5L3.49917 15.3424L3.51041 15.3085L3.54309 15.2092C3.57153 15.1226 3.61276 14.9966 3.66378 14.8392C3.76585 14.5243 3.90701 14.0841 4.06335 13.5833C4.37685 12.5789 4.74823 11.3403 4.98862 10.3787C5.21953 9.45511 5.34334 7.99977 5.4074 6.74233C5.43908 6.12051 5.45567 5.55867 5.46433 5.15226C5.46866 4.94916 5.471 4.78513 5.47226 4.67215C5.47289 4.61566 5.47325 4.57195 5.47345 4.54251L5.47365 4.50925L5.47369 4.49904M3.97369 15.5L3.49917 15.3424C3.41215 15.6045 3.55406 15.8875 3.81613 15.9745C4.07821 16.0615 4.36142 15.919 4.44843 15.6569L3.97369 15.5Z",fill:"currentColor"}),m2("path",{d:"M8.47369 5.5C8.47369 5.77614 8.24984 6 7.97369 6C7.69755 6 7.47369 5.77614 7.47369 5.5C7.47369 5.22386 7.69755 5 7.97369 5C8.24984 5 8.47369 5.22386 8.47369 5.5Z",fill:"currentColor"})]});import{jsx as f1,jsxs as ed}from"react/jsx-runtime";var Cd=C=>ed("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[f1("title",{children:"WrestlingBelt"}),f1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89419 4C7.08618 4 6.29244 4.2393 5.62095 4.68696L5.27735 4.91603C4.21697 5.62294 2.96892 6 1.69491 6C1.31113 6 1 6.31127 1 6.69337V9.30662C1 9.68873 1.31113 10 1.69491 10C2.96892 10 4.21697 10.3771 5.27735 11.084L5.62095 11.313C6.29244 11.7607 7.08618 12 7.89419 12C8.81746 12 9.71759 11.6856 10.4377 11.1096C11.3355 10.3913 12.451 10 13.6008 10H14.2291C14.6548 10 15 9.65485 15 9.22908V6.77092C15 6.34515 14.6548 6 14.2291 6H13.6008C12.451 6 11.3355 5.60869 10.4377 4.89043C9.71759 4.31439 8.81746 4 7.89419 4ZM5.06625 3.85491C5.90282 3.29719 6.88973 3 7.89419 3C9.04338 3 10.1641 3.39095 11.0623 4.10957C11.7829 4.68597 12.6781 5 13.6008 5H14.2291C15.2071 5 16 5.79287 16 6.77092V9.22908C16 10.2071 15.2071 11 14.2291 11H13.6008C12.6781 11 11.7829 11.314 11.0623 11.8904C10.1641 12.609 9.04338 13 7.89419 13C6.88973 13 5.90282 12.7028 5.06625 12.1451L4.72265 11.916C3.82687 11.3188 2.7719 11 1.69491 11C0.760519 11 0 10.2427 0 9.30662V6.69337C0 5.75731 0.760519 5 1.69491 5C2.7719 5 3.82687 4.68116 4.72265 4.08397L5.06625 3.85491Z",fill:"currentColor"}),f1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75273 5.95202C7.83056 5.71248 8.16944 5.71248 8.24727 5.95202L8.63066 7.13197H9.87134C10.1232 7.13197 10.2279 7.45427 10.0242 7.60231L9.02044 8.33156L9.40382 9.51151C9.48165 9.75105 9.20749 9.95024 9.00373 9.8022L8 9.07295L6.99627 9.8022C6.79251 9.95024 6.51834 9.75105 6.59618 9.51151L6.97957 8.33156L5.97584 7.60231C5.77207 7.45427 5.8768 7.13197 6.12866 7.13197H7.36934L7.75273 5.95202ZM8 6.80902L7.79098 7.45231C7.75617 7.55944 7.65635 7.63197 7.54371 7.63197H6.86731L7.41453 8.02954C7.50565 8.09575 7.54378 8.21311 7.50898 8.32023L7.29996 8.96353L7.84718 8.56595C7.9383 8.49974 8.0617 8.49974 8.15282 8.56595L8.70004 8.96353L8.49102 8.32023C8.45622 8.21311 8.49435 8.09575 8.58547 8.02954L9.13269 7.63197H8.45629C8.34365 7.63197 8.24383 7.55944 8.20902 7.45231L8 6.80902Z",fill:"currentColor"}),f1("path",{d:"M3 7C3 6.72386 3.22386 6.5 3.5 6.5C3.77614 6.5 4 6.72386 4 7C4 7.27614 3.77614 7.5 3.5 7.5C3.22386 7.5 3 7.27614 3 7Z",fill:"currentColor"}),f1("path",{d:"M12 7C12 6.72386 12.2239 6.5 12.5 6.5C12.7761 6.5 13 6.72386 13 7C13 7.27614 12.7761 7.5 12.5 7.5C12.2239 7.5 12 7.27614 12 7Z",fill:"currentColor"}),f1("path",{d:"M3.5 8.5C3.22386 8.5 3 8.72386 3 9C3 9.27614 3.22386 9.5 3.5 9.5C3.77614 9.5 4 9.27614 4 9C4 8.72386 3.77614 8.5 3.5 8.5Z",fill:"currentColor"}),f1("path",{d:"M12.5 8.5C12.2239 8.5 12 8.72386 12 9C12 9.27614 12.2239 9.5 12.5 9.5C12.7761 9.5 13 9.27614 13 9C13 8.72386 12.7761 8.5 12.5 8.5Z",fill:"currentColor"})]});import{jsx as w2,jsxs as ld}from"react/jsx-runtime";var od=C=>ld("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[w2("title",{children:"Calendar"}),w2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 2.5C1 2.22386 1.22386 2 1.5 2H3C3.27614 2 3.5 2.22386 3.5 2.5C3.5 2.77614 3.27614 3 3 3H2V5H14V3H13C12.7239 3 12.5 2.77614 12.5 2.5C12.5 2.22386 12.7239 2 13 2H14.5C14.7761 2 15 2.22386 15 2.5V15.5C15 15.7761 14.7761 16 14.5 16H1.5C1.22386 16 1 15.7761 1 15.5V2.5ZM14 6H2V15H14V6Z",fill:"currentColor"}),w2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 0C5.77614 0 6 0.223858 6 0.5V2H10V0.5C10 0.223858 10.2239 0 10.5 0C10.7761 0 11 0.223858 11 0.5V3.5C11 3.77614 10.7761 4 10.5 4C10.2239 4 10 3.77614 10 3.5V3H6V3.5C6 3.77614 5.77614 4 5.5 4C5.22386 4 5 3.77614 5 3.5V0.5C5 0.223858 5.22386 0 5.5 0Z",fill:"currentColor"}),w2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 7.5C3 7.22386 3.22386 7 3.5 7H7C7.27614 7 7.5 7.22386 7.5 7.5C7.5 7.77614 7.27614 8 7 8H3.5C3.22386 8 3 7.77614 3 7.5ZM8.5 7.5C8.5 7.22386 8.72386 7 9 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H9C8.72386 8 8.5 7.77614 8.5 7.5ZM3 9.5C3 9.22386 3.22386 9 3.5 9H7C7.27614 9 7.5 9.22386 7.5 9.5C7.5 9.77614 7.27614 10 7 10H3.5C3.22386 10 3 9.77614 3 9.5ZM8.5 9.5C8.5 9.22386 8.72386 9 9 9H12.5C12.7761 9 13 9.22386 13 9.5C13 9.77614 12.7761 10 12.5 10H9C8.72386 10 8.5 9.77614 8.5 9.5ZM3 11.5C3 11.2239 3.22386 11 3.5 11H7C7.27614 11 7.5 11.2239 7.5 11.5C7.5 11.7761 7.27614 12 7 12H3.5C3.22386 12 3 11.7761 3 11.5ZM8.5 11.5C8.5 11.2239 8.72386 11 9 11H12.5C12.7761 11 13 11.2239 13 11.5C13 11.7761 12.7761 12 12.5 12H9C8.72386 12 8.5 11.7761 8.5 11.5ZM3 13.5C3 13.2239 3.22386 13 3.5 13H7C7.27614 13 7.5 13.2239 7.5 13.5C7.5 13.7761 7.27614 14 7 14H3.5C3.22386 14 3 13.7761 3 13.5ZM8.5 13.5C8.5 13.2239 8.72386 13 9 13H12.5C12.7761 13 13 13.2239 13 13.5C13 13.7761 12.7761 14 12.5 14H9C8.72386 14 8.5 13.7761 8.5 13.5Z",fill:"currentColor"})]});import{jsx as m5,jsxs as rd}from"react/jsx-runtime";var td=C=>rd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[m5("title",{children:"CalendarAdd"}),m5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 2.5C1 2.22386 1.22386 2 1.5 2H3C3.27614 2 3.5 2.22386 3.5 2.5C3.5 2.77614 3.27614 3 3 3H2V5H14V3H13C12.7239 3 12.5 2.77614 12.5 2.5C12.5 2.22386 12.7239 2 13 2H14.5C14.7761 2 15 2.22386 15 2.5V8.5C15 8.77614 14.7761 9 14.5 9C14.2239 9 14 8.77614 14 8.5V6H2V15H8.5C8.77614 15 9 15.2239 9 15.5C9 15.7761 8.77614 16 8.5 16H1.5C1.22386 16 1 15.7761 1 15.5V2.5Z",fill:"currentColor"}),m5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 0C5.77614 0 6 0.223858 6 0.5V2H10V0.5C10 0.223858 10.2239 0 10.5 0C10.7761 0 11 0.223858 11 0.5V3.5C11 3.77614 10.7761 4 10.5 4C10.2239 4 10 3.77614 10 3.5V3H6V3.5C6 3.77614 5.77614 4 5.5 4C5.22386 4 5 3.77614 5 3.5V0.5C5 0.223858 5.22386 0 5.5 0Z",fill:"currentColor"}),m5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 7.5C3 7.22386 3.22386 7 3.5 7H7C7.27614 7 7.5 7.22386 7.5 7.5C7.5 7.77614 7.27614 8 7 8H3.5C3.22386 8 3 7.77614 3 7.5ZM8.5 7.5C8.5 7.22386 8.72386 7 9 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H9C8.72386 8 8.5 7.77614 8.5 7.5ZM3 9.5C3 9.22386 3.22386 9 3.5 9H7C7.27614 9 7.5 9.22386 7.5 9.5C7.5 9.77614 7.27614 10 7 10H3.5C3.22386 10 3 9.77614 3 9.5ZM8.5 9.5C8.5 9.22386 8.72386 9 9 9H10.5C10.7761 9 11 9.22386 11 9.5C11 9.77614 10.7761 10 10.5 10H9C8.72386 10 8.5 9.77614 8.5 9.5ZM3 11.5C3 11.2239 3.22386 11 3.5 11H7C7.27614 11 7.5 11.2239 7.5 11.5C7.5 11.7761 7.27614 12 7 12H3.5C3.22386 12 3 11.7761 3 11.5ZM3 13.5C3 13.2239 3.22386 13 3.5 13H7C7.27614 13 7.5 13.2239 7.5 13.5C7.5 13.7761 7.27614 14 7 14H3.5C3.22386 14 3 13.7761 3 13.5Z",fill:"currentColor"}),m5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C11.3431 10 10 11.3431 10 13C10 14.6569 11.3431 16 13 16ZM13.5 11.5C13.5 11.2239 13.2761 11 13 11C12.7239 11 12.5 11.2239 12.5 11.5V12.5H11.5C11.2239 12.5 11 12.7239 11 13C11 13.2761 11.2239 13.5 11.5 13.5H12.5V14.5C12.5 14.7761 12.7239 15 13 15C13.2761 15 13.5 14.7761 13.5 14.5V13.5H14.5C14.7761 13.5 15 13.2761 15 13C15 12.7239 14.7761 12.5 14.5 12.5H13.5V11.5Z",fill:"currentColor"})]});import{jsx as E4,jsxs as nd}from"react/jsx-runtime";var id=C=>nd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[E4("title",{children:"CalendarTick"}),E4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 2.5C1 2.22386 1.22386 2 1.5 2H3C3.27614 2 3.5 2.22386 3.5 2.5C3.5 2.77614 3.27614 3 3 3H2V5H14V3H13C12.7239 3 12.5 2.77614 12.5 2.5C12.5 2.22386 12.7239 2 13 2H14.5C14.7761 2 15 2.22386 15 2.5V15.5C15 15.7761 14.7761 16 14.5 16H1.5C1.22386 16 1 15.7761 1 15.5V2.5ZM14 6H2V15H14V6Z",fill:"currentColor"}),E4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 0C5.77614 0 6 0.223858 6 0.5V2H10V0.5C10 0.223858 10.2239 0 10.5 0C10.7761 0 11 0.223858 11 0.5V3.5C11 3.77614 10.7761 4 10.5 4C10.2239 4 10 3.77614 10 3.5V3H6V3.5C6 3.77614 5.77614 4 5.5 4C5.22386 4 5 3.77614 5 3.5V0.5C5 0.223858 5.22386 0 5.5 0ZM11.8123 7.10957C12.028 7.28207 12.0629 7.59672 11.8904 7.81235L8.06492 12.5942C7.78568 12.9433 7.26502 12.9721 6.94894 12.656L4.14645 9.85355C3.95118 9.65829 3.95118 9.34171 4.14645 9.14645C4.34171 8.95118 4.65829 8.95118 4.85355 9.14645L7.45854 11.7514L11.1096 7.18765C11.2821 6.97202 11.5967 6.93706 11.8123 7.10957Z",fill:"currentColor"})]});import{jsx as F4,jsxs as pd}from"react/jsx-runtime";var dd=C=>pd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[F4("title",{children:"Clock"}),F4("path",{d:"M8.5 3.49957C8.5 3.22343 8.27614 2.99957 8 2.99957C7.72386 2.99957 7.5 3.22343 7.5 3.49957V7.89645C7.5 8.09536 7.57902 8.28613 7.71967 8.42678L10.1464 10.8536C10.3417 11.0488 10.6583 11.0488 10.8536 10.8536C11.0488 10.6583 11.0488 10.3417 10.8536 10.1464L8.5 7.79289V3.49957Z",fill:"currentColor"}),F4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8Z",fill:"currentColor"})]});import{jsx as w5,jsxs as cd}from"react/jsx-runtime";var sd=C=>cd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[w5("title",{children:"Live"}),w5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15C11.3137 15 14 12.3137 14 8.99998C14 5.68628 11.3137 2.99998 8 2.99998C4.68629 2.99998 2 5.68628 2 8.99998C2 12.3137 4.68629 15 8 15ZM8 16C11.866 16 15 12.866 15 8.99998C15 5.13399 11.866 1.99998 8 1.99998C4.13401 1.99998 1 5.13399 1 8.99998C1 12.866 4.13401 16 8 16Z",fill:"currentColor"}),w5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.64639 7.64645C7.84165 7.45118 8.15824 7.45118 8.3535 7.64645L11.8535 11.1464C12.0488 11.3417 12.0488 11.6583 11.8535 11.8536C11.6582 12.0488 11.3417 12.0488 11.1464 11.8536L7.64639 8.35355C7.45113 8.15829 7.45113 7.84171 7.64639 7.64645Z",fill:"currentColor"}),w5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99994 0.5C5.99994 0.223858 6.2238 0 6.49994 0H9.49994C9.77609 0 9.99994 0.223858 9.99994 0.5C9.99994 0.776142 9.77609 1 9.49994 1H8.49994V2.31366C8.49994 2.5898 8.27609 2.81366 7.99994 2.81366C7.7238 2.81366 7.49994 2.5898 7.49994 2.31366V1H6.49994C6.2238 1 5.99994 0.776142 5.99994 0.5Z",fill:"currentColor"}),w5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8536 2.14964C14.0489 2.34491 14.0489 2.66149 13.8536 2.85674L12.4848 4.22538C12.2896 4.42063 11.973 4.42062 11.7777 4.22535C11.5825 4.03008 11.5825 3.71349 11.7778 3.51824L13.1465 2.14961C13.3418 1.95435 13.6584 1.95437 13.8536 2.14964Z",fill:"currentColor"})]});import{jsx as A4,jsxs as hd}from"react/jsx-runtime";var fd=C=>hd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[A4("title",{children:"RecentClock"}),A4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00011 2C5.99317 2 4.21573 2.98526 3.12607 4.5H4.00011C4.27626 4.5 4.50011 4.72386 4.50011 5C4.50011 5.27614 4.27626 5.5 4.00011 5.5H2.23232C2.04122 5.5 1.86683 5.39107 1.783 5.21933L1.05079 3.71933C0.929654 3.47118 1.03262 3.17181 1.28078 3.05068C1.52893 2.92954 1.8283 3.03251 1.94944 3.28067L2.28185 3.96163C3.54908 2.17049 5.63759 1 8.00011 1C11.8661 1 15.0001 4.13401 15.0001 8C15.0001 11.866 11.8661 15 8.00011 15C4.13412 15 1.00011 11.866 1.00011 8C1.00011 7.72386 1.22397 7.5 1.50011 7.5C1.77626 7.5 2.00011 7.72386 2.00011 8C2.00011 11.3137 4.6864 14 8.00011 14C11.3138 14 14.0001 11.3137 14.0001 8C14.0001 4.68629 11.3138 2 8.00011 2Z",fill:"currentColor"}),A4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00011 2.99957C8.27626 2.99957 8.50011 3.22343 8.50011 3.49957V7.79289L10.3537 9.64645C10.5489 9.84171 10.5489 10.1583 10.3537 10.3536C10.1584 10.5488 9.84182 10.5488 9.64656 10.3536L7.71978 8.42678C7.57913 8.28612 7.50011 8.09536 7.50011 7.89645V3.49957C7.50011 3.22343 7.72397 2.99957 8.00011 2.99957Z",fill:"currentColor"})]});import{jsx as y6,jsxs as Ld}from"react/jsx-runtime";var ad=C=>Ld("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[y6("title",{children:"ScheduledRaces"}),y6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 0C5.77614 0 6 0.223858 6 0.5V2H10V0.5C10 0.223858 10.2239 0 10.5 0C10.7761 0 11 0.223858 11 0.5V3.5C11 3.77614 10.7761 4 10.5 4C10.2239 4 10 3.77614 10 3.5V3H6V3.5C6 3.77614 5.77614 4 5.5 4C5.22386 4 5 3.77614 5 3.5V0.5C5 0.223858 5.22386 0 5.5 0ZM1 2.5C1 2.22386 1.22386 2 1.5 2H3C3.27614 2 3.5 2.22386 3.5 2.5C3.5 2.77614 3.27614 3 3 3H2V5H14V3H13C12.7239 3 12.5 2.77614 12.5 2.5C12.5 2.22386 12.7239 2 13 2H14.5C14.7761 2 15 2.22386 15 2.5V6.5C15 6.77614 14.7761 7 14.5 7C14.2239 7 14 6.77614 14 6.5V6H2V15H6.5C6.77614 15 7 15.2239 7 15.5C7 15.7761 6.77614 16 6.5 16H1.5C1.22386 16 1 15.7761 1 15.5V2.5ZM3 7.5C3 7.22386 3.22386 7 3.5 7H7C7.27614 7 7.5 7.22386 7.5 7.5C7.5 7.77614 7.27614 8 7 8H3.5C3.22386 8 3 7.77614 3 7.5ZM11.4985 8C9.5665 8 8 9.56682 8 11.5C8 13.4332 9.5665 15 11.4985 15C13.4304 15 14.9969 13.4332 14.9969 11.5C14.9969 9.56682 13.4304 8 11.4985 8ZM7 11.5C7 9.0149 9.01385 7 11.4985 7C13.9831 7 15.9969 9.0149 15.9969 11.5C15.9969 13.9851 13.9831 16 11.4985 16C9.01385 16 7 13.9851 7 11.5ZM3 9.5C3 9.22386 3.22386 9 3.5 9H5.5C5.77614 9 6 9.22386 6 9.5C6 9.77614 5.77614 10 5.5 10H3.5C3.22386 10 3 9.77614 3 9.5ZM11.3597 9.75C11.6359 9.75 11.8597 9.97386 11.8597 10.25V11.7591L13.0621 12.293C13.3145 12.4051 13.4282 12.7006 13.3161 12.9529C13.204 13.2053 12.9086 13.319 12.6562 13.207L11.1568 12.5411C10.9762 12.4609 10.8597 12.2818 10.8597 12.0841V10.25C10.8597 9.97386 11.0836 9.75 11.3597 9.75ZM3 11.5C3 11.2239 3.22386 11 3.5 11H5.5C5.77614 11 6 11.2239 6 11.5C6 11.7761 5.77614 12 5.5 12H3.5C3.22386 12 3 11.7761 3 11.5ZM3 13.5C3 13.2239 3.22386 13 3.5 13H5.5C5.77614 13 6 13.2239 6 13.5C6 13.7761 5.77614 14 5.5 14H3.5C3.22386 14 3 13.7761 3 13.5Z",fill:"currentColor"})]});import{jsx as I6,jsxs as ud}from"react/jsx-runtime";var gd=C=>ud("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[I6("title",{children:"Cloudy"}),I6("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.54046 8.03482C3.61027 8.4912 3.35857 8.93604 2.93142 9.11123C2.38316 9.33609 2 9.87448 2 10.5C2 11.3201 2.65833 11.9867 3.47507 11.9998C3.47828 11.9999 3.48149 11.9999 3.48469 12H11C12.6569 12 14 10.6569 14 9C14 7.34315 12.6569 6 11 6C10.936 6 10.8725 6.002 10.8096 6.00591C10.4538 6.02808 10.113 5.85909 9.91529 5.56237C9.2863 4.61843 8.21516 4 7 4C5.067 4 3.5 5.567 3.5 7.5C3.5 7.68245 3.51388 7.861 3.54046 8.03482ZM3.45898 13C2.09719 12.9781 1 11.867 1 10.5C1 9.45485 1.64135 8.55949 2.55196 8.18602C2.51775 7.96234 2.5 7.73324 2.5 7.5C2.5 5.01472 4.51472 3 7 3C8.56359 3 9.94092 3.79746 10.7475 5.00785C10.831 5.00264 10.9152 5 11 5C13.2091 5 15 6.79086 15 9C15 11.2091 13.2091 13 11 13H3.45898Z",fill:"currentColor"})]});import{jsx as U1,jsxs as vd}from"react/jsx-runtime";var Vd=C=>vd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[U1("title",{children:"Fog"}),U1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 14.5C5 14.2239 5.22386 14 5.5 14H13.5C13.7761 14 14 14.2239 14 14.5C14 14.7761 13.7761 15 13.5 15H5.5C5.22386 15 5 14.7761 5 14.5Z",fill:"currentColor"}),U1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 12.5C1 12.2239 1.22386 12 1.5 12H9.5C9.77614 12 10 12.2239 10 12.5C10 12.7761 9.77614 13 9.5 13H1.5C1.22386 13 1 12.7761 1 12.5Z",fill:"currentColor"}),U1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 14.5C1 14.2239 1.22386 14 1.5 14H3.5C3.77614 14 4 14.2239 4 14.5C4 14.7761 3.77614 15 3.5 15H1.5C1.22386 15 1 14.7761 1 14.5Z",fill:"currentColor"}),U1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 12.5C11 12.2239 11.2239 12 11.5 12H13.5C13.7761 12 14 12.2239 14 12.5C14 12.7761 13.7761 13 13.5 13H11.5C11.2239 13 11 12.7761 11 12.5Z",fill:"currentColor"}),U1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.54046 6.15982C3.61027 6.6162 3.35857 7.06104 2.93142 7.23623C2.38316 7.46109 2 7.99948 2 8.625C2 9.44512 2.65833 10.1117 3.47507 10.1248C3.47828 10.1249 3.48149 10.1249 3.48469 10.125H11C12.6569 10.125 14 8.78185 14 7.125C14 5.46815 12.6569 4.125 11 4.125C10.936 4.125 10.8725 4.127 10.8096 4.13091C10.4538 4.15308 10.113 3.98409 9.91529 3.68737C9.2863 2.74343 8.21516 2.125 7 2.125C5.067 2.125 3.5 3.692 3.5 5.625C3.5 5.80745 3.51388 5.986 3.54046 6.15982ZM3.45898 11.125C2.09719 11.1031 1 9.99201 1 8.625C1 7.57985 1.64135 6.68449 2.55196 6.31102C2.51775 6.08734 2.5 5.85824 2.5 5.625C2.5 3.13972 4.51472 1.125 7 1.125C8.56359 1.125 9.94092 1.92246 10.7475 3.13285C10.831 3.12764 10.9152 3.125 11 3.125C13.2091 3.125 15 4.91586 15 7.125C15 9.33414 13.2091 11.125 11 11.125H3.45898Z",fill:"currentColor"})]});import{jsx as I,jsxs as wd}from"react/jsx-runtime";var md=C=>wd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[I("title",{children:"Night"}),I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.36247 12.4081C6.03748 11.8647 3.5 8.9787 3.5 5.50004C3.5 5.10428 3.53294 4.71574 3.59631 4.33717C2.61352 5.25082 2 6.55426 2 8.00004C2 10.7615 4.23858 13 7 13C7.8549 13 8.65899 12.786 9.36247 12.4081ZM10.7185 11.4961C11.1764 11.4797 11.5035 11.991 11.1744 12.3099C10.0944 13.3561 8.62239 14 7 14C3.68629 14 1 11.3137 1 8.00004C1 5.66613 2.33258 3.64346 4.27839 2.65138C4.68664 2.44323 5.06276 2.91844 4.89821 3.34611C4.64099 4.01466 4.5 4.74088 4.5 5.50004C4.5 8.81375 7.18629 11.5 10.5 11.5C10.5731 11.5 10.646 11.4987 10.7185 11.4961Z",fill:"currentColor"}),I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.65811 2.02571C8.92009 2.11303 9.06167 2.39619 8.97434 2.65816L8.5 2.50005C8.97434 2.65816 8.97441 2.65796 8.97434 2.65816L8.97375 2.65992L8.97297 2.66224L8.9708 2.66853L8.96407 2.68747C8.95849 2.70285 8.9507 2.72368 8.94057 2.74931C8.92032 2.80052 8.8906 2.87121 8.85031 2.95628C8.76997 3.12587 8.64615 3.35567 8.46937 3.60317C8.11718 4.09623 7.53881 4.68082 6.65811 4.97439C6.39614 5.06171 6.11298 4.92013 6.02566 4.65816C5.93833 4.39619 6.07992 4.11303 6.34189 4.02571C6.96119 3.81927 7.38282 3.40387 7.65563 3.02193C7.79135 2.83193 7.88628 2.65548 7.94657 2.52819C7.97659 2.46482 7.99765 2.41442 8.01061 2.38165C8.01707 2.36528 8.02149 2.35339 8.02397 2.34656L8.02624 2.3402C8.02633 2.33992 8.02638 2.3398 8.02624 2.3402L8.02588 2.34126C8.11335 2.07951 8.39626 1.93842 8.65811 2.02571Z",fill:"currentColor"}),I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.34189 2.02571C8.07991 2.11303 7.93833 2.39619 8.02566 2.65816L8.5 2.50005C8.02566 2.65816 8.02559 2.65796 8.02566 2.65816L8.02625 2.65992L8.02703 2.66224L8.0292 2.66853L8.03593 2.68747C8.04151 2.70285 8.0493 2.72368 8.05943 2.74931C8.07968 2.80052 8.1094 2.87121 8.14969 2.95628C8.23003 3.12587 8.35385 3.35567 8.53063 3.60317C8.88282 4.09623 9.46119 4.68082 10.3419 4.97439C10.6039 5.06171 10.887 4.92013 10.9743 4.65816C11.0617 4.39619 10.9201 4.11303 10.6581 4.02571C10.0388 3.81927 9.61718 3.40387 9.34437 3.02193C9.20865 2.83193 9.11372 2.65548 9.05343 2.52819C9.02341 2.46482 9.00235 2.41442 8.98939 2.38165C8.98293 2.36528 8.97851 2.35339 8.97603 2.34656L8.97376 2.3402C8.97362 2.3398 8.97367 2.33992 8.97376 2.3402L8.97412 2.34126C8.88666 2.07951 8.60374 1.93842 8.34189 2.02571Z",fill:"currentColor"}),I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.34189 6.97439C8.07991 6.88707 7.93833 6.60391 8.02566 6.34193L8.5 6.50005C8.02566 6.34193 8.02559 6.34213 8.02566 6.34193L8.02625 6.34017L8.02703 6.33785L8.0292 6.33157L8.03593 6.31262C8.04151 6.29724 8.0493 6.27642 8.05943 6.25079C8.07968 6.19958 8.1094 6.12888 8.14969 6.04382C8.23003 5.87423 8.35385 5.64443 8.53063 5.39693C8.88282 4.90387 9.46119 4.31927 10.3419 4.02571C10.6039 3.93838 10.887 4.07996 10.9743 4.34193C11.0617 4.60391 10.9201 4.88707 10.6581 4.97439C10.0388 5.18082 9.61718 5.59623 9.34437 5.97817C9.20865 6.16817 9.11372 6.34462 9.05343 6.4719C9.02341 6.53528 9.00235 6.58567 8.98939 6.61845C8.98293 6.63481 8.97851 6.6467 8.97603 6.65354L8.97376 6.65989C8.97362 6.66029 8.97367 6.66018 8.97376 6.65989L8.97412 6.65884C8.88666 6.92058 8.60374 7.06167 8.34189 6.97439Z",fill:"currentColor"}),I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.65811 6.97439C8.92009 6.88706 9.06167 6.6039 8.97434 6.34193L8.5 6.50005C8.97434 6.34193 8.97441 6.34213 8.97434 6.34193L8.97375 6.34017L8.97297 6.33785L8.9708 6.33157L8.96407 6.31262C8.95849 6.29724 8.9507 6.27642 8.94057 6.25079C8.92032 6.19958 8.8906 6.12888 8.85031 6.04382C8.76997 5.87423 8.64615 5.64443 8.46937 5.39693C8.11718 4.90387 7.53881 4.31927 6.65811 4.02571C6.39614 3.93838 6.11298 4.07996 6.02566 4.34193C5.93833 4.6039 6.07992 4.88706 6.34189 4.97439C6.96119 5.18082 7.38282 5.59623 7.65563 5.97817C7.79135 6.16817 7.88628 6.34462 7.94657 6.4719C7.97659 6.53528 7.99765 6.58567 8.01061 6.61845C8.01707 6.63481 8.02149 6.6467 8.02397 6.65354L8.02624 6.65989C8.02633 6.66018 8.02638 6.66029 8.02624 6.65989L8.02588 6.65884C8.11335 6.92058 8.39626 7.06167 8.65811 6.97439Z",fill:"currentColor"}),I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6581 5.02571C12.9201 5.11303 13.0617 5.39619 12.9743 5.65816L12.5 5.50005C12.9743 5.65816 12.9744 5.65796 12.9743 5.65816L12.9738 5.65992L12.973 5.66224L12.9708 5.66853L12.9641 5.68747C12.9585 5.70285 12.9507 5.72368 12.9406 5.74931C12.9203 5.80052 12.8906 5.87121 12.8503 5.95628C12.77 6.12587 12.6462 6.35567 12.4694 6.60317C12.1172 7.09623 11.5388 7.68082 10.6581 7.97439C10.3961 8.06171 10.113 7.92013 10.0257 7.65816C9.93833 7.39619 10.0799 7.11303 10.3419 7.02571C10.9612 6.81927 11.3828 6.40387 11.6556 6.02193C11.7913 5.83193 11.8863 5.65548 11.9466 5.52819C11.9766 5.46482 11.9976 5.41442 12.0106 5.38165C12.0171 5.36528 12.0215 5.35339 12.024 5.34656L12.0262 5.3402C12.0263 5.33992 12.0264 5.3398 12.0262 5.3402L12.0259 5.34126C12.1133 5.07951 12.3963 4.93842 12.6581 5.02571Z",fill:"currentColor"}),I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3419 5.02571C12.0799 5.11303 11.9383 5.39619 12.0257 5.65816L12.5 5.50005C12.0257 5.65816 12.0256 5.65796 12.0257 5.65816L12.0262 5.65992L12.027 5.66224L12.0292 5.66853L12.0359 5.68747C12.0415 5.70285 12.0493 5.72368 12.0594 5.74931C12.0797 5.80052 12.1094 5.87121 12.1497 5.95628C12.23 6.12587 12.3538 6.35567 12.5306 6.60317C12.8828 7.09623 13.4612 7.68082 14.3419 7.97439C14.6039 8.06171 14.887 7.92013 14.9743 7.65816C15.0617 7.39619 14.9201 7.11303 14.6581 7.02571C14.0388 6.81927 13.6172 6.40387 13.3444 6.02193C13.2087 5.83193 13.1137 5.65548 13.0534 5.52819C13.0234 5.46482 13.0024 5.41442 12.9894 5.38165C12.9829 5.36528 12.9785 5.35339 12.976 5.34656L12.9738 5.3402C12.9736 5.3398 12.9737 5.33992 12.9738 5.3402L12.9741 5.34126C12.8867 5.07951 12.6037 4.93842 12.3419 5.02571Z",fill:"currentColor"}),I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3419 9.97439C12.0799 9.88706 11.9383 9.6039 12.0257 9.34193L12.5 9.50005C12.0257 9.34193 12.0256 9.34213 12.0257 9.34193L12.0262 9.34017L12.027 9.33785L12.0292 9.33157L12.0359 9.31262C12.0415 9.29724 12.0493 9.27642 12.0594 9.25079C12.0797 9.19958 12.1094 9.12888 12.1497 9.04382C12.23 8.87423 12.3538 8.64443 12.5306 8.39693C12.8828 7.90387 13.4612 7.31927 14.3419 7.02571C14.6039 6.93838 14.887 7.07996 14.9743 7.34193C15.0617 7.6039 14.9201 7.88706 14.6581 7.97439C14.0388 8.18082 13.6172 8.59623 13.3444 8.97817C13.2087 9.16817 13.1137 9.34462 13.0534 9.4719C13.0234 9.53528 13.0024 9.58567 12.9894 9.61845C12.9829 9.63481 12.9785 9.6467 12.976 9.65354L12.9738 9.65989C12.9736 9.66029 12.9737 9.66018 12.9738 9.65989L12.9741 9.65884C12.8867 9.92058 12.6037 10.0617 12.3419 9.97439Z",fill:"currentColor"}),I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6581 9.97439C12.9201 9.88706 13.0617 9.6039 12.9743 9.34193L12.5 9.50005C12.9743 9.34193 12.9744 9.34213 12.9743 9.34193L12.9738 9.34017L12.973 9.33785L12.9708 9.33157L12.9641 9.31262C12.9585 9.29724 12.9507 9.27642 12.9406 9.25079C12.9203 9.19958 12.8906 9.12888 12.8503 9.04382C12.77 8.87423 12.6462 8.64443 12.4694 8.39693C12.1172 7.90387 11.5388 7.31927 10.6581 7.02571C10.3961 6.93838 10.113 7.07996 10.0257 7.34193C9.93833 7.6039 10.0799 7.88706 10.3419 7.97439C10.9612 8.18082 11.3828 8.59623 11.6556 8.97817C11.7913 9.16817 11.8863 9.34462 11.9466 9.4719C11.9766 9.53528 11.9976 9.58567 12.0106 9.61845C12.0171 9.63481 12.0215 9.6467 12.024 9.65354L12.0262 9.65989C12.0263 9.66018 12.0264 9.66029 12.0262 9.65989L12.0259 9.65883C12.1133 9.92058 12.3963 10.0617 12.6581 9.97439Z",fill:"currentColor"})]});import{jsx as J1,jsxs as Md}from"react/jsx-runtime";var Hd=C=>Md("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[J1("title",{children:"PartlyCloudy"}),J1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.58992 0C5.86607 0 6.08992 0.223858 6.08992 0.5V1.5909C6.08992 1.86704 5.86607 2.0909 5.58992 2.0909C5.31378 2.0909 5.08992 1.86704 5.08992 1.5909V0.5C5.08992 0.223858 5.31378 0 5.58992 0Z",fill:"currentColor"}),J1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.08992 5.59089C2.08992 5.86703 1.86607 6.09089 1.58992 6.09089H0.499023C0.222881 6.09089 -0.000976575 5.86703 -0.000976562 5.59089C-0.00097655 5.31474 0.222881 5.09089 0.499023 5.09089H1.58992C1.86607 5.09089 2.08992 5.31474 2.08992 5.59089Z",fill:"currentColor"}),J1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.17231 3.37321C7.97705 3.17795 7.97705 2.86137 8.17231 2.66611L8.94369 1.89472C9.13896 1.69946 9.45554 1.69946 9.6508 1.89472C9.84606 2.08999 9.84606 2.40657 9.6508 2.60183L8.87942 3.37321C8.68415 3.56848 8.36757 3.56848 8.17231 3.37321Z",fill:"currentColor"}),J1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.37264 3.00954C3.17738 3.20481 2.8608 3.20481 2.66554 3.00954L1.89415 2.23816C1.69889 2.0429 1.69889 1.72631 1.89415 1.53105C2.08942 1.33579 2.406 1.33579 2.60126 1.53105L3.37264 2.30244C3.56791 2.4977 3.56791 2.81428 3.37264 3.00954Z",fill:"currentColor"}),J1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.04599 7.47477C2.77547 7.0268 2.61963 6.50138 2.61963 5.9404C2.61963 4.2992 3.95008 2.96875 5.59127 2.96875C7.04266 2.96875 8.25101 4.00925 8.51111 5.385C9.4319 5.71319 10.2144 6.33282 10.7475 7.13285C10.831 7.12764 10.9152 7.125 11 7.125C13.2091 7.125 15 8.91586 15 11.125C15 13.3341 13.2091 15.125 11 15.125H3.45898C2.09719 15.1031 1 13.992 1 12.625C1 11.5798 1.64135 10.6845 2.55196 10.311C2.51775 10.0873 2.5 9.85824 2.5 9.625C2.5 8.84621 2.69783 8.11363 3.04599 7.47477ZM3.61963 5.9404C3.61963 4.85149 4.50237 3.96875 5.59127 3.96875C6.39603 3.96875 7.08817 4.45089 7.3946 5.14206C7.26457 5.13077 7.13296 5.125 7 5.125C5.70422 5.125 4.53636 5.67268 3.71527 6.54918C3.65316 6.35757 3.61963 6.15303 3.61963 5.9404ZM2.93142 11.2362C3.35857 11.061 3.61027 10.6162 3.54046 10.1598C3.51388 9.986 3.5 9.80745 3.5 9.625C3.5 7.692 5.067 6.125 7 6.125C8.21516 6.125 9.2863 6.74343 9.91529 7.68737C10.113 7.98409 10.4538 8.15308 10.8096 8.13091C10.8725 8.127 10.936 8.125 11 8.125C12.6569 8.125 14 9.46815 14 11.125C14 12.7819 12.6569 14.125 11 14.125H3.48469L3.47507 14.1248C2.65833 14.1117 2 13.4451 2 12.625C2 11.9995 2.38316 11.4611 2.93142 11.2362Z",fill:"currentColor"})]});import{jsx as K1,jsxs as Zd}from"react/jsx-runtime";var Rd=C=>Zd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[K1("title",{children:"PartlyCloudyNight"}),K1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6581 1.02572C12.9201 1.11304 13.0617 1.3962 12.9743 1.65817L12.5 1.50006C12.9743 1.65817 12.9744 1.65798 12.9743 1.65817L12.9738 1.65994L12.973 1.66226L12.9708 1.66854L12.9641 1.68749C12.9585 1.70287 12.9507 1.72369 12.9406 1.74932C12.9203 1.80053 12.8906 1.87123 12.8503 1.95629C12.77 2.12588 12.6462 2.35568 12.4694 2.60318C12.1172 3.09624 11.5388 3.68084 10.6581 3.9744C10.3961 4.06173 10.113 3.92015 10.0257 3.65817C9.93833 3.3962 10.0799 3.11304 10.3419 3.02572C10.9612 2.81928 11.3828 2.40388 11.6556 2.02194C11.7913 1.83194 11.8863 1.65549 11.9466 1.52821C11.9766 1.46483 11.9976 1.41443 12.0106 1.38166C12.0171 1.3653 12.0215 1.35341 12.024 1.34657L12.0262 1.34022C12.0263 1.33993 12.0264 1.33982 12.0262 1.34022L12.0259 1.34127C12.1133 1.07953 12.3963 0.938435 12.6581 1.02572Z",fill:"currentColor"}),K1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3419 1.02572C12.0799 1.11304 11.9383 1.3962 12.0257 1.65817L12.5 1.50006C12.0257 1.65817 12.0256 1.65798 12.0257 1.65817L12.0262 1.65994L12.027 1.66226L12.0292 1.66854L12.0359 1.68749C12.0415 1.70287 12.0493 1.72369 12.0594 1.74932C12.0797 1.80053 12.1094 1.87123 12.1497 1.95629C12.23 2.12588 12.3538 2.35568 12.5306 2.60318C12.8828 3.09624 13.4612 3.68084 14.3419 3.9744C14.6039 4.06173 14.887 3.92015 14.9743 3.65817C15.0617 3.3962 14.9201 3.11304 14.6581 3.02572C14.0388 2.81928 13.6172 2.40388 13.3444 2.02194C13.2087 1.83194 13.1137 1.65549 13.0534 1.52821C13.0234 1.46483 13.0024 1.41443 12.9894 1.38166C12.9829 1.3653 12.9785 1.35341 12.976 1.34657L12.9738 1.34022C12.9736 1.33982 12.9737 1.33993 12.9738 1.34022L12.9741 1.34127C12.8867 1.07953 12.6037 0.938435 12.3419 1.02572Z",fill:"currentColor"}),K1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3419 5.9744C12.0799 5.88708 11.9383 5.60392 12.0257 5.34195L12.5 5.50006C12.0257 5.34195 12.0256 5.34214 12.0257 5.34195L12.0262 5.34018L12.027 5.33786L12.0292 5.33158L12.0359 5.31264C12.0415 5.29725 12.0493 5.27643 12.0594 5.2508C12.0797 5.19959 12.1094 5.12889 12.1497 5.04383C12.23 4.87424 12.3538 4.64444 12.5306 4.39694C12.8828 3.90388 13.4612 3.31929 14.3419 3.02572C14.6039 2.9384 14.887 3.07998 14.9743 3.34195C15.0617 3.60392 14.9201 3.88708 14.6581 3.9744C14.0388 4.18084 13.6172 4.59624 13.3444 4.97818C13.2087 5.16818 13.1137 5.34463 13.0534 5.47192C13.0234 5.53529 13.0024 5.58569 12.9894 5.61846C12.9829 5.63482 12.9785 5.64672 12.976 5.65355L12.9738 5.65991C12.9736 5.6603 12.9737 5.66019 12.9738 5.65991L12.9741 5.65885C12.8867 5.9206 12.6037 6.06169 12.3419 5.9744Z",fill:"currentColor"}),K1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6581 5.9744C12.9201 5.88708 13.0617 5.60392 12.9743 5.34195L12.5 5.50006C12.9743 5.34195 12.9744 5.34214 12.9743 5.34195L12.9738 5.34018L12.973 5.33786L12.9708 5.33158L12.9641 5.31264C12.9585 5.29725 12.9507 5.27643 12.9406 5.2508C12.9203 5.19959 12.8906 5.12889 12.8503 5.04383C12.77 4.87424 12.6462 4.64444 12.4694 4.39694C12.1172 3.90388 11.5388 3.31928 10.6581 3.02572C10.3961 2.9384 10.113 3.07998 10.0257 3.34195C9.93833 3.60392 10.0799 3.88708 10.3419 3.9744C10.9612 4.18084 11.3828 4.59624 11.6556 4.97818C11.7913 5.16818 11.8863 5.34463 11.9466 5.47192C11.9766 5.53529 11.9976 5.58569 12.0106 5.61846C12.0171 5.63482 12.0215 5.64672 12.024 5.65355L12.0262 5.6599C12.0263 5.66019 12.0264 5.6603 12.0262 5.6599L12.0259 5.65885C12.1133 5.92059 12.3963 6.06169 12.6581 5.9744Z",fill:"currentColor"}),K1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.34727 2.01139C5.46807 1.61948 5.36052 1.21084 5.11834 0.941313C4.99432 0.803285 4.82192 0.687859 4.61024 0.645653C4.39172 0.602083 4.16838 0.644356 3.97047 0.762833C2.49174 1.64805 1.5 3.26693 1.5 5.11795C1.5 6.33953 1.93239 7.4612 2.65183 8.33666C2.55279 8.70777 2.5 9.09775 2.5 9.50006C2.5 9.7333 2.51775 9.9624 2.55196 10.1861C1.64135 10.5596 1 11.4549 1 12.5001C1 13.8671 2.09719 14.9782 3.45898 15.0001H11C13.2091 15.0001 15 13.2092 15 11.0001C15 8.79092 13.2091 7.00006 11 7.00006C10.9152 7.00006 10.831 7.00271 10.7475 7.00791C9.94092 5.79752 8.56359 5.00006 7 5.00006C6.54141 5.00006 6.09885 5.06866 5.68201 5.19615C5.35415 4.60946 5.16733 3.93341 5.16733 3.21272C5.16733 2.79378 5.23042 2.39051 5.34727 2.01139ZM4.76094 5.59578C4.38209 4.88506 4.16733 4.0735 4.16733 3.21272C4.16733 2.69282 4.24571 2.19031 4.39163 1.71684C4.39587 1.70311 4.39758 1.68884 4.39688 1.67456C3.25586 2.39715 2.5 3.66952 2.5 5.11795C2.5 5.90001 2.72007 6.62998 3.10198 7.25013C3.49928 6.56329 4.07289 5.99121 4.76094 5.59578ZM2.93142 11.1113C3.35857 10.9361 3.61027 10.4913 3.54046 10.0349C3.51388 9.86106 3.5 9.68251 3.5 9.50006C3.5 7.56706 5.067 6.00006 7 6.00006C8.21516 6.00006 9.2863 6.61849 9.91529 7.56243C10.113 7.85915 10.4538 8.02814 10.8096 8.00597C10.8725 8.00206 10.936 8.00006 11 8.00006C12.6569 8.00006 14 9.34321 14 11.0001C14 12.6569 12.6569 14.0001 11 14.0001H3.48469L3.47507 13.9999C2.65833 13.9867 2 13.3202 2 12.5001C2 11.8745 2.38316 11.3361 2.93142 11.1113Z",fill:"currentColor"})]});import{jsx as j,jsxs as Gd}from"react/jsx-runtime";var Sd=C=>Gd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[j("title",{children:"Rain"}),j("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.22361 12.0528C3.4706 12.1763 3.57071 12.4766 3.44721 12.7236L2.44721 14.7236C2.32372 14.9706 2.02338 15.0707 1.77639 14.9472C1.5294 14.8237 1.42929 14.5234 1.55279 14.2764L2.55279 12.2764C2.67628 12.0294 2.97662 11.9293 3.22361 12.0528Z",fill:"currentColor"}),j("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.22361 12.0528C7.4706 12.1763 7.57071 12.4766 7.44721 12.7236L6.44721 14.7236C6.32372 14.9706 6.02338 15.0707 5.77639 14.9472C5.5294 14.8237 5.42929 14.5234 5.55279 14.2764L6.55279 12.2764C6.67628 12.0294 6.97662 11.9293 7.22361 12.0528Z",fill:"currentColor"}),j("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2236 12.0528C11.4706 12.1763 11.5707 12.4766 11.4472 12.7236L10.4472 14.7236C10.3237 14.9706 10.0234 15.0707 9.77639 14.9472C9.5294 14.8237 9.42929 14.5234 9.55279 14.2764L10.5528 12.2764C10.6763 12.0294 10.9766 11.9293 11.2236 12.0528Z",fill:"currentColor"}),j("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.22361 12.0528C5.4706 12.1763 5.57071 12.4766 5.44721 12.7236L3.94721 15.7236C3.82372 15.9706 3.52338 16.0707 3.27639 15.9472C3.0294 15.8237 2.92929 15.5234 3.05279 15.2764L4.55279 12.2764C4.67628 12.0294 4.97662 11.9293 5.22361 12.0528Z",fill:"currentColor"}),j("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.22361 12.0528C9.4706 12.1763 9.57071 12.4766 9.44721 12.7236L7.94721 15.7236C7.82372 15.9706 7.52338 16.0707 7.27639 15.9472C7.0294 15.8237 6.92929 15.5234 7.05279 15.2764L8.55279 12.2764C8.67628 12.0294 8.97662 11.9293 9.22361 12.0528Z",fill:"currentColor"}),j("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.2236 12.0528C13.4706 12.1763 13.5707 12.4766 13.4472 12.7236L11.9472 15.7236C11.8237 15.9706 11.5234 16.0707 11.2764 15.9472C11.0294 15.8237 10.9293 15.5234 11.0528 15.2764L12.5528 12.2764C12.6763 12.0294 12.9766 11.9293 13.2236 12.0528Z",fill:"currentColor"}),j("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.54046 6.15982C3.61027 6.6162 3.35857 7.06104 2.93142 7.23623C2.38316 7.46109 2 7.99948 2 8.625C2 9.44512 2.65833 10.1117 3.47507 10.1248C3.47828 10.1249 3.48149 10.1249 3.48469 10.125H11C12.6569 10.125 14 8.78185 14 7.125C14 5.46815 12.6569 4.125 11 4.125C10.936 4.125 10.8725 4.127 10.8096 4.13091C10.4538 4.15308 10.113 3.98409 9.91529 3.68737C9.2863 2.74343 8.21516 2.125 7 2.125C5.067 2.125 3.5 3.692 3.5 5.625C3.5 5.80745 3.51388 5.986 3.54046 6.15982ZM3.45898 11.125C2.09719 11.1031 1 9.99201 1 8.625C1 7.57985 1.64135 6.68449 2.55196 6.31102C2.51775 6.08734 2.5 5.85824 2.5 5.625C2.5 3.13972 4.51472 1.125 7 1.125C8.56359 1.125 9.94092 1.92246 10.7475 3.13285C10.831 3.12764 10.9152 3.125 11 3.125C13.2091 3.125 15 4.91586 15 7.125C15 9.33414 13.2091 11.125 11 11.125H3.45898Z",fill:"currentColor"})]});import{jsx as H5,jsxs as xd}from"react/jsx-runtime";var Pd=C=>xd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[H5("title",{children:"Sleet"}),H5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.50005 15C3.32848 15 4.00005 14.3284 4.00005 13.5C4.00005 12.6716 3.32848 12 2.50005 12C1.67162 12 1.00005 12.6716 1.00005 13.5C1.00005 14.3284 1.67162 15 2.50005 15ZM2.50005 14C2.77619 14 3.00005 13.7761 3.00005 13.5C3.00005 13.2239 2.77619 13 2.50005 13C2.22391 13 2.00005 13.2239 2.00005 13.5C2.00005 13.7761 2.22391 14 2.50005 14Z",fill:"currentColor"}),H5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00005 15C8.82848 15 9.50005 14.3284 9.50005 13.5C9.50005 12.6716 8.82848 12 8.00005 12C7.17162 12 6.50005 12.6716 6.50005 13.5C6.50005 14.3284 7.17162 15 8.00005 15ZM8.00005 14C8.27619 14 8.50005 13.7761 8.50005 13.5C8.50005 13.2239 8.27619 13 8.00005 13C7.72391 13 7.50005 13.2239 7.50005 13.5C7.50005 13.7761 7.72391 14 8.00005 14Z",fill:"currentColor"}),H5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5001 15C14.3285 15 15.0001 14.3284 15.0001 13.5C15.0001 12.6716 14.3285 12 13.5001 12C12.6716 12 12.0001 12.6716 12.0001 13.5C12.0001 14.3284 12.6716 15 13.5001 15ZM13.5001 14C13.7762 14 14.0001 13.7761 14.0001 13.5C14.0001 13.2239 13.7762 13 13.5001 13C13.2239 13 13.0001 13.2239 13.0001 13.5C13.0001 13.7761 13.2239 14 13.5001 14Z",fill:"currentColor"}),H5("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.54046 6.15982C3.61027 6.6162 3.35857 7.06104 2.93142 7.23623C2.38316 7.46109 2 7.99948 2 8.625C2 9.44512 2.65833 10.1117 3.47507 10.1248C3.47828 10.1249 3.48149 10.1249 3.48469 10.125H11C12.6569 10.125 14 8.78185 14 7.125C14 5.46815 12.6569 4.125 11 4.125C10.936 4.125 10.8725 4.127 10.8096 4.13091C10.4538 4.15308 10.113 3.98409 9.91529 3.68737C9.2863 2.74343 8.21516 2.125 7 2.125C5.067 2.125 3.5 3.692 3.5 5.625C3.5 5.80745 3.51388 5.986 3.54046 6.15982ZM3.45898 11.125C2.09719 11.1031 1 9.99201 1 8.625C1 7.57985 1.64135 6.68449 2.55196 6.31102C2.51775 6.08734 2.5 5.85824 2.5 5.625C2.5 3.13972 4.51472 1.125 7 1.125C8.56359 1.125 9.94092 1.92246 10.7475 3.13285C10.831 3.12764 10.9152 3.125 11 3.125C13.2091 3.125 15 4.91586 15 7.125C15 9.33414 13.2091 11.125 11 11.125H3.45898Z",fill:"currentColor"})]});import{jsx as t,jsxs as yd}from"react/jsx-runtime";var bd=C=>yd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[t("title",{children:"Snow"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 0C8.27614 0 8.49999 0.223858 8.49999 0.5V8.5C8.49999 8.77614 8.27614 9 7.99999 9C7.72385 9 7.49999 8.77614 7.49999 8.5V0.5C7.49999 0.223858 7.72385 0 7.99999 0Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.64644 1.64645C5.8417 1.45118 6.15828 1.45118 6.35355 1.64645L8.35355 3.64645C8.54881 3.84171 8.54881 4.15829 8.35355 4.35355C8.15828 4.54882 7.8417 4.54882 7.64644 4.35355L5.64644 2.35355C5.45118 2.15829 5.45118 1.84171 5.64644 1.64645Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.3535 1.64645C10.1583 1.45118 9.8417 1.45118 9.64644 1.64645L7.64644 3.64645C7.45118 3.84171 7.45118 4.15829 7.64644 4.35355C7.8417 4.54882 8.15828 4.54882 8.35355 4.35355L10.3535 2.35355C10.5488 2.15829 10.5488 1.84171 10.3535 1.64645Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 16C7.72385 16 7.49999 15.7761 7.49999 15.5L7.49999 7.5C7.49999 7.22386 7.72385 7 7.99999 7C8.27614 7 8.49999 7.22386 8.49999 7.5L8.49999 15.5C8.49999 15.7761 8.27614 16 7.99999 16Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.3535 14.3536C10.1583 14.5488 9.8417 14.5488 9.64644 14.3536L7.64644 12.3536C7.45118 12.1583 7.45118 11.8417 7.64644 11.6464C7.8417 11.4512 8.15828 11.4512 8.35355 11.6464L10.3535 13.6464C10.5488 13.8417 10.5488 14.1583 10.3535 14.3536Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.64644 14.3536C5.8417 14.5488 6.15829 14.5488 6.35355 14.3536L8.35355 12.3536C8.54881 12.1583 8.54881 11.8417 8.35355 11.6464C8.15828 11.4512 7.8417 11.4512 7.64644 11.6464L5.64644 13.6464C5.45118 13.8417 5.45118 14.1583 5.64644 14.3536Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 0C8.27614 0 8.49999 0.223858 8.49999 0.5V8.5C8.49999 8.77614 8.27614 9 7.99999 9C7.72385 9 7.49999 8.77614 7.49999 8.5V0.5C7.49999 0.223858 7.72385 0 7.99999 0Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.64644 1.64645C5.8417 1.45118 6.15828 1.45118 6.35355 1.64645L8.35355 3.64645C8.54881 3.84171 8.54881 4.15829 8.35355 4.35355C8.15828 4.54882 7.8417 4.54882 7.64644 4.35355L5.64644 2.35355C5.45118 2.15829 5.45118 1.84171 5.64644 1.64645Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.3535 1.64645C10.1583 1.45118 9.8417 1.45118 9.64644 1.64645L7.64644 3.64645C7.45118 3.84171 7.45118 4.15829 7.64644 4.35355C7.8417 4.54882 8.15828 4.54882 8.35355 4.35355L10.3535 2.35355C10.5488 2.15829 10.5488 1.84171 10.3535 1.64645Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 16C7.72385 16 7.49999 15.7761 7.49999 15.5L7.49999 7.5C7.49999 7.22386 7.72385 7 7.99999 7C8.27614 7 8.49999 7.22386 8.49999 7.5L8.49999 15.5C8.49999 15.7761 8.27614 16 7.99999 16Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.3535 14.3536C10.1583 14.5488 9.8417 14.5488 9.64644 14.3536L7.64644 12.3536C7.45118 12.1583 7.45118 11.8417 7.64644 11.6464C7.8417 11.4512 8.15828 11.4512 8.35355 11.6464L10.3535 13.6464C10.5488 13.8417 10.5488 14.1583 10.3535 14.3536Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.64644 14.3536C5.8417 14.5488 6.15829 14.5488 6.35355 14.3536L8.35355 12.3536C8.54881 12.1583 8.54881 11.8417 8.35355 11.6464C8.15828 11.4512 7.8417 11.4512 7.64644 11.6464L5.64644 13.6464C5.45118 13.8417 5.45118 14.1583 5.64644 14.3536Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.9284 11.9998C14.7903 12.239 14.4845 12.3209 14.2453 12.1828L7.31714 8.18283C7.078 8.04475 6.99606 7.73896 7.13413 7.49981C7.2722 7.26067 7.578 7.17873 7.81714 7.3168L14.7453 11.3168C14.9845 11.4549 15.0664 11.7607 14.9284 11.9998Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.6793 9.13835C14.7507 9.40509 14.5925 9.67925 14.3257 9.75072L11.5937 10.4828C11.3269 10.5542 11.0528 10.396 10.9813 10.1292C10.9098 9.86249 11.0681 9.58832 11.3348 9.51685L14.0669 8.7848C14.3336 8.71333 14.6078 8.87162 14.6793 9.13835Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3257 13.2148C12.5925 13.1434 12.7507 12.8692 12.6793 12.6025L11.9472 9.8704C11.8757 9.60367 11.6016 9.44538 11.3348 9.51685C11.0681 9.58832 10.9098 9.86249 10.9813 10.1292L11.7133 12.8613C11.7848 13.128 12.059 13.2863 12.3257 13.2148Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.07195 3.99981C1.21002 3.76067 1.51582 3.67873 1.75497 3.8168L8.68317 7.8168C8.92232 7.95487 9.00425 8.26067 8.86618 8.49981C8.72811 8.73896 8.42232 8.8209 8.18317 8.68283L1.25497 4.68283C1.01582 4.54476 0.933882 4.23896 1.07195 3.99981Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.32104 6.86127C1.24957 6.59454 1.40786 6.32037 1.67459 6.2489L4.40665 5.51685C4.67338 5.44538 4.94755 5.60367 5.01902 5.8704C5.09049 6.13714 4.9322 6.41131 4.66546 6.48278L1.93341 7.21483C1.66668 7.2863 1.39251 7.12801 1.32104 6.86127Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.67459 2.7848C3.40786 2.85627 3.24957 3.13044 3.32104 3.39717L4.05309 6.12922C4.12456 6.39596 4.39873 6.55425 4.66546 6.48278C4.9322 6.41131 5.09049 6.13714 5.01902 5.8704L4.28697 3.13835C4.2155 2.87162 3.94133 2.71333 3.67459 2.7848Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.9284 3.99981C15.0664 4.23896 14.9845 4.54475 14.7453 4.68282L7.81714 8.68282C7.578 8.8209 7.2722 8.73896 7.13413 8.49981C6.99606 8.26066 7.078 7.95487 7.31714 7.8168L14.2453 3.8168C14.4845 3.67873 14.7903 3.76067 14.9284 3.99981Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3257 2.7848C12.5925 2.85627 12.7507 3.13044 12.6793 3.39717L11.9472 6.12922C11.8757 6.39595 11.6016 6.55425 11.3348 6.48277C11.0681 6.4113 10.9098 6.13714 10.9813 5.8704L11.7133 3.13835C11.7848 2.87162 12.059 2.71333 12.3257 2.7848Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.6793 6.86127C14.7507 6.59454 14.5925 6.32037 14.3257 6.2489L11.5937 5.51685C11.3269 5.44538 11.0528 5.60367 10.9813 5.8704C10.9098 6.13714 11.0681 6.4113 11.3348 6.48277L14.0669 7.21483C14.3336 7.2863 14.6078 7.12801 14.6793 6.86127Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.07195 11.9998C0.933882 11.7607 1.01582 11.4549 1.25497 11.3168L8.18317 7.3168C8.42232 7.17873 8.72811 7.26067 8.86618 7.49981C9.00425 7.73896 8.92232 8.04475 8.68317 8.18282L1.75497 12.1828C1.51582 12.3209 1.21002 12.239 1.07195 11.9998Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.67459 13.2148C3.40786 13.1434 3.24957 12.8692 3.32104 12.6025L4.05309 9.8704C4.12456 9.60367 4.39873 9.44538 4.66546 9.51685C4.9322 9.58832 5.09049 9.86249 5.01902 10.1292L4.28697 12.8613C4.2155 13.128 3.94133 13.2863 3.67459 13.2148Z",fill:"currentColor"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.32104 9.13835C1.24957 9.40508 1.40786 9.67925 1.6746 9.75072L4.40665 10.4828C4.67338 10.5542 4.94755 10.396 5.01902 10.1292C5.09049 9.86249 4.9322 9.58832 4.66546 9.51685L1.93341 8.7848C1.66668 8.71333 1.39251 8.87162 1.32104 9.13835Z",fill:"currentColor"})]});import{jsx as B,jsxs as Bd}from"react/jsx-runtime";var Id=C=>Bd("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[B("title",{children:"Sun"}),B("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11ZM8 12C10.2091 12 12 10.2091 12 8C12 5.79086 10.2091 4 8 4C5.79086 4 4 5.79086 4 8C4 10.2091 5.79086 12 8 12Z",fill:"currentColor"}),B("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0.5C8.27614 0.5 8.5 0.723858 8.5 1V2.5C8.5 2.77614 8.27614 3 8 3C7.72386 3 7.5 2.77614 7.5 2.5V1C7.5 0.723858 7.72386 0.5 8 0.5Z",fill:"currentColor"}),B("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5 8C15.5 8.27614 15.2761 8.5 15 8.5H13.5C13.2239 8.5 13 8.27614 13 8C13 7.72386 13.2239 7.5 13.5 7.5H15C15.2761 7.5 15.5 7.72386 15.5 8Z",fill:"currentColor"}),B("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.84322 13.1568C2.64796 12.9616 2.64796 12.645 2.84322 12.4497L3.90388 11.3891C4.09915 11.1938 4.41573 11.1938 4.61099 11.3891C4.80625 11.5843 4.80625 11.9009 4.61099 12.0962L3.55033 13.1568C3.35507 13.3521 3.03849 13.3521 2.84322 13.1568Z",fill:"currentColor"}),B("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1568 13.157C12.9615 13.3522 12.6449 13.3522 12.4497 13.157L11.389 12.0963C11.1937 11.901 11.1937 11.5845 11.389 11.3892C11.5843 11.1939 11.9009 11.1939 12.0961 11.3892L13.1568 12.4499C13.352 12.6451 13.352 12.9617 13.1568 13.157Z",fill:"currentColor"}),B("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 13C8.27614 13 8.5 13.2239 8.5 13.5V15C8.5 15.2761 8.27614 15.5 8 15.5C7.72386 15.5 7.5 15.2761 7.5 15V13.5C7.5 13.2239 7.72386 13 8 13Z",fill:"currentColor"}),B("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 8C3 8.27614 2.77614 8.5 2.5 8.5H1C0.723857 8.5 0.5 8.27614 0.5 8C0.5 7.72386 0.723857 7.5 1 7.5H2.5C2.77614 7.5 3 7.72386 3 8Z",fill:"currentColor"}),B("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.6821 4.81803C11.4868 4.62277 11.4868 4.30619 11.6821 4.11092L12.7428 3.05026C12.938 2.855 13.2546 2.855 13.4499 3.05026C13.6451 3.24553 13.6451 3.56211 13.4499 3.75737L12.3892 4.81803C12.1939 5.01329 11.8774 5.01329 11.6821 4.81803Z",fill:"currentColor"}),B("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.81791 4.31815C4.62265 4.51342 4.30606 4.51341 4.1108 4.31815L3.05014 3.25749C2.85488 3.06223 2.85488 2.74565 3.05014 2.55039C3.2454 2.35512 3.56199 2.35512 3.75725 2.55039L4.81791 3.61105C5.01317 3.80631 5.01317 4.12289 4.81791 4.31815Z",fill:"currentColor"})]});import{jsx as H2,jsxs as Ed}from"react/jsx-runtime";var kd=C=>Ed("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:C.color,display:"block",...C,children:[H2("title",{children:"Wind"}),H2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 5C1.67157 5 1 5.67157 1 6.5C1 7.32843 1.67157 8 2.5 8H15.5C15.7761 8 16 8.22386 16 8.5C16 8.77614 15.7761 9 15.5 9H2.5C1.11929 9 0 7.88071 0 6.5C0 5.11929 1.11929 4 2.5 4C3.88071 4 5 5.11929 5 6.5C5 6.77614 4.77614 7 4.5 7C4.22386 7 4 6.77614 4 6.5C4 5.67157 3.32843 5 2.5 5Z",fill:"currentColor"}),H2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 4C7.44772 4 7 4.44772 7 5C7 5.55228 7.44772 6 8 6H13.5C13.7761 6 14 6.22386 14 6.5C14 6.77614 13.7761 7 13.5 7H8C6.89543 7 6 6.10457 6 5C6 3.89543 6.89543 3 8 3C9.10457 3 10 3.89543 10 5C10 5.27614 9.77614 5.5 9.5 5.5C9.22386 5.5 9 5.27614 9 5C9 4.44772 8.55229 4 8 4Z",fill:"currentColor"}),H2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.83333 12.5C5.34221 12.5 5 12.1343 5 11.75C5 11.3657 5.34221 11 5.83333 11H11.5C11.7761 11 12 10.7761 12 10.5C12 10.2239 11.7761 10 11.5 10H5.83333C4.8517 10 4 10.7536 4 11.75C4 12.7464 4.8517 13.5 5.83333 13.5C6.81497 13.5 7.66667 12.7464 7.66667 11.75C7.66667 11.4739 7.44281 11.25 7.16667 11.25C6.89052 11.25 6.66667 11.4739 6.66667 11.75C6.66667 12.1343 6.32446 12.5 5.83333 12.5Z",fill:"currentColor"})]});export{k0 as ArrowsArrowDown,F0 as ArrowsArrowLeft,D0 as ArrowsArrowRight,_0 as ArrowsArrowUp,O0 as ArrowsChevronDown,U0 as ArrowsChevronDownCircle,K0 as ArrowsChevronLeft,z0 as ArrowsChevronLeftCircle,Y0 as ArrowsChevronRight,$0 as ArrowsChevronRightCircle,C8 as ArrowsChevronUp,o8 as ArrowsChevronUpCircle,t8 as BettingBetslip,i8 as BettingBetslipActive,d8 as BettingBetslipCancelled,s8 as BettingBetslipRetailLocation,f8 as BettingBetslipVoided,a8 as BettingBettingRewards,g8 as BettingCommissioner,V8 as BettingDragHandle,m8 as BettingHotBetFilled,H8 as BettingHotBetOutline,R8 as BettingLateSwap,S8 as BettingLaurel,P8 as BettingLineup,b8 as BettingLineupSelected,I8 as BettingMedal,k8 as BettingMultipleEntry,F8 as BettingParlayConflict,D8 as BettingPlayer,_8 as BettingPlayerAdd,O8 as BettingRacingBetslip,U8 as BettingRacingBetslipAccountHistory,K8 as BettingRacingBetslipCancel,z8 as BettingRacingBetslipRefund,Y8 as BettingRacingBetslipSuccess,$8 as BettingResponsibleGambling,C9 as BettingResponsiblePlay,o9 as BettingRules,t9 as BettingScores,i9 as BettingSingleEntry,d9 as BettingStatsSwitcher,s9 as BettingTicket,f9 as BettingTrending,a9 as BettingTrophy,g9 as BettingWithdraw,V9 as CasinoCasinoChip,m9 as CasinoDice,H9 as CasinoFavourite,R9 as CasinoFavouriteFilled,S9 as CasinoJackpots,P9 as CasinoLiveDealer,b9 as CasinoPoker,I9 as CasinoRoulette,k9 as CasinoSlots,F9 as CasinoStudio,D9 as CasinoTheme,_9 as CasinoVIP,B6 as ColouredIcons101,E6 as ColouredIconsBaseball,A6 as ColouredIconsBasketball,T6 as ColouredIconsBoxing,W6 as ColouredIconsCasino,N6 as ColouredIconsFlame,J6 as ColouredIconsFootball,q6 as ColouredIconsFreePlay,X6 as ColouredIconsGolf,Q6 as ColouredIconsMMA,j6 as ColouredIconsNASCAR,e7 as ColouredIconsParlayHub,o7 as ColouredIconsPlaybook,t7 as ColouredIconsPlayerProps,i7 as ColouredIconsRacing,d7 as ColouredIconsRefer,s7 as ColouredIconsRugby,f7 as ColouredIconsSoccer,a7 as ColouredIconsSquares,g7 as ColouredIconsTennis,V7 as ColouredIconsTrending,m7 as ColouredIconsWomens,O9 as CommunicationChat,U9 as CommunicationCustomerService,K9 as CommunicationEmail,z9 as CommunicationFeedback,Y9 as CommunicationMessage,$9 as CommunicationMessageNew,CC as CommunicationNotification,oC as FeedbackAlert,tC as FeedbackAlertOff,iC as FeedbackErrorHexagon,dC as FeedbackInformation,sC as FeedbackInformationCircle,fC as FeedbackTagTick,aC as FeedbackWarning,gC as FeedbackWarningCircle,VC as FeedbackWarningDiamond,mC as FeedbackWarningTriangle,HC as FinanceBank,IC as FinanceCVV,RC as FinanceCard,SC as FinanceCardPlus,PC as FinanceCashout,bC as FinanceCreditCard,kC as FinanceDeposit,FC as FinanceDeposit1,DC as FinanceECheck,_C as FinanceStore,OC as FinanceWallet,UC as FinanceWithdraw,KC as GeneralAdd,zC as GeneralAddCircle,YC as GeneralAddGroup,$C as GeneralAddIndicatorCircle,Ce as GeneralBarcode,oe as GeneralBetaProgram,te as GeneralBolt,ie as GeneralCross,de as GeneralCrossCircle,se as GeneralDelete,fe as GeneralDuplicate,ae as GeneralEdit,ge as GeneralEditAlt,Ve as GeneralEnter,me as GeneralExport,He as GeneralFaceID,Re as GeneralFaceIDSquare,Se as GeneralFeatured,Pe as GeneralFeaturedStar,be as GeneralFileDownload,Ie as GeneralFilter,ke as GeneralFilterAlt,Fe as GeneralFingerprint,De as GeneralHelp,_e as GeneralHelpCircle,Oe as GeneralHideEyeOff,Ue as GeneralHistory,Ke as GeneralHome,ze as GeneralHomepageLayouts,Ye as GeneralImport,$e as GeneralKey,Co as GeneralLightbulb,oo as GeneralLink,to as GeneralLiveNow,io as GeneralLocation,po as GeneralLocationPin,co as GeneralLock,ho as GeneralLogout,Lo as GeneralMenu,uo as GeneralNew,vo as GeneralNewWindow,wo as GeneralOverflowMobile,Mo as GeneralOverflowWeb,Zo as GeneralPassword,Go as GeneralPasswordLock,xo as GeneralPromotions,yo as GeneralPublish,Bo as GeneralReferFriend,Eo as GeneralRefresh,Ao as GeneralRefreshAlt,To as GeneralRemove,Wo as GeneralRemoveCircle,No as GeneralRemoveGroup,Jo as GeneralRepeat,qo as GeneralReplace,Xo as GeneralSearch,Qo as GeneralSettings,jo as GeneralShareAndroid,el as GeneralShareIOS,ll as GeneralShowEyeOn,rl as GeneralSlider,nl as GeneralSortAscending,pl as GeneralSortDescending,cl as GeneralSportsAtoZ,hl as GeneralStar,Ll as GeneralStarFilled,ul as GeneralStats,vl as GeneralTick,wl as GeneralTickCircle,Ml as GeneralTickLock,Zl as GeneralTickShield,Gl as GeneralUnpublish,xl as GeneralUser,yl as GeneralUserCross,Bl as GeneralUserPlus,El as GeneralUserTick,Al as GeneralWiFiDisabled,Tl as GeneralWiFiEnabled,H7 as GenerosityActionToken,R7 as GenerosityBetBackToken,S7 as GenerosityBonusBet,P7 as GenerosityBoostBuilder,b7 as GenerosityDepositBoost,I7 as GenerosityEarlyWin,k7 as GenerosityLiveProfitBoost,F7 as GenerosityNoSweat,D7 as GenerosityOddsBoostToken,_7 as GenerosityProfitBoost,O7 as GenerosityPromotions,U7 as GenerosityRewards,Wl as LayoutGrid,Nl as LayoutList,Jl as LayoutSwipeable,K7 as LeagueMLB,z7 as LeagueNASCAR,Y7 as LeagueNBA,$7 as LeagueNBAAlt,C0 as LeagueNFL,o0 as LeagueNHL,t0 as LeaguePLL,i0 as LeagueWNBA,d0 as LeagueWNBAAlt,ql as MediaBackward,Xl as MediaBackward15,Ql as MediaCondense,jl as MediaExpand,et as MediaFilmTV,lt as MediaForward,rt as MediaForward15,nt as MediaFullScreen,pt as MediaFullscreenExit,ct as MediaLiveVideo,ht as MediaMobile,Lt as MediaMute,ut as MediaNoVideo,vt as MediaPause,wt as MediaPauseCircle,Mt as MediaPlay,Zt as MediaPlayCircle,Gt as MediaPopout,xt as MediaReplay,yt as MediaSoundHalf,Bt as MediaUnmute,Et as MediaVideoStreaming,At as RacingBadge,Tt as RacingFDTVPicks,Wt as RacingHorse,s0 as RacingLoadingSpinner,f0 as RacingNumberFire,Nt as RacingPicks4,Jt as RacingPicks5,qt as RacingPicks6,Xt as RacingPicks7,Qt as RacingPicks8,h0 as RacingRS,jt as RacingResult,er as RacingStable,lr as RacingTimeForm,rr as RacingTrackMaster,nr as RacingTracks,a0 as SocialFacebookColor,g0 as SocialMessenger,pr as SocialX,V0 as SocialYouTubeColor,cr as SportArchery,hr as SportAthletics,Lr as SportAustralianRulesPitch,ur as SportBadminton,vr as SportBaseball,wr as SportBaseballField,Mr as SportBasketball,Zr as SportBasketballCourt,Gr as SportBingo,xr as SportBoxing,yr as SportCanoe,Br as SportClimbing,Er as SportCollegeBasketball,Ar as SportCollegeFootball,Tr as SportCoveredStadium,Wr as SportCricket,Nr as SportCricketField,Jr as SportCrossfit,qr as SportCycling,Xr as SportDartBoard,Qr as SportDarts,jr as SportDiving,ei as SportESports,li as SportFencing,ri as SportFieldHockey,ni as SportFootballField,pi as SportFootballUS,ci as SportGaelicGamesPitch,hi as SportGolf,Li as SportGymnastics,ui as SportHandball,vi as SportHandballPitch,wi as SportHarness,Mi as SportHorseRacing,Zi as SportIceHockey,Gi as SportIceHockeyRink,xi as SportJaiAlai,yi as SportJudo,Bi as SportKarate,Ei as SportKickboxing,Ai as SportLacrosse,Ti as SportMMA,Wi as SportMotorsport,Ni as SportNetball,Ji as SportOlympics,qi as SportPageant,Xi as SportPitch,Qi as SportPlayingCard,ji as SportRowing,en as SportRugby,ln as SportRugbyPitch,rn as SportRun,dn as SportSailing,sn as SportShooting,fn as SportSkateboarding,an as SportSnooker,gn as SportSnookerTable,Vn as SportSnowboarding,mn as SportSoccer,Hn as SportSoccerPitch,Rn as SportSoftball,Sn as SportSurfing,Pn as SportSwimming,bn as SportSynchronizedSwimming,In as SportTableTennis,kn as SportTaekwando,_n as SportTenPinBowling,Fn as SportTennis,Dn as SportTennisCourt,On as SportTrampoline,Un as SportVolleyball,Kn as SportVolleyballCourt,zn as SportWaterPolo,Yn as SportWeightlifting,$n as SportWrestling,Cd as SportWrestlingBelt,m0 as SportsbookBonusFunds,H0 as SportsbookFreeBets,R0 as SportsbookRewards,S0 as SportsbookRewardsAvailable,P0 as SportsbookSGP,b0 as SportsbookSGPPlus,I0 as SportsbookTrending,od as TimeCalendar,td as TimeCalendarAdd,id as TimeCalendarTick,dd as TimeClock,sd as TimeLive,fd as TimeRecentClock,ad as TimeScheduledRaces,gd as WeatherCloudy,Vd as WeatherFog,md as WeatherNight,Hd as WeatherPartlyCloudy,Rd as WeatherPartlyCloudyNight,Sd as WeatherRain,Pd as WeatherSleet,bd as WeatherSnow,Id as WeatherSun,kd as WeatherWind};
webpack://frontend-tpt/../../node_modules/react-collapsed/dist/index.mjs
/**
* react-collapsed v4.2.0
*
* Copyright (c) 2019-2024, Rogin Farrer
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
// src/index.ts
import {
useState as useState4,
useRef as useRef3,
useEffect as useEffect6,
useLayoutEffect as useReactLayoutEffect
} from "react";
// src/utils/index.ts
import { useEffect as useEffect5 } from "react";
// src/utils/CollapseError.ts
import warning from "tiny-warning";
var CollapseError = class extends Error {
constructor(message) {
super(`react-collapsed: ${message}`);
}
};
var collapseWarning = (...args) => {
return warning(args[0], `[react-collapsed] -- ${args[1]}`);
};
// src/utils/useEvent.ts
import { useRef, useEffect, useCallback } from "react";
function useEvent(callback) {
const ref = useRef(callback);
useEffect(() => {
ref.current = callback;
});
return useCallback((...args) => ref.current?.(...args), []);
}
// src/utils/useControlledState.ts
import { useState, useRef as useRef2, useCallback as useCallback2, useEffect as useEffect2 } from "react";
function useControlledState(value, defaultValue, callback) {
const [state, setState] = useState(defaultValue);
const initiallyControlled = useRef2(typeof value !== "undefined");
const effectiveValue = initiallyControlled.current ? value : state;
const cb = useEvent(callback);
const onChange = useCallback2(
(update) => {
const setter = update;
const newValue = typeof update === "function" ? setter(effectiveValue) : update;
if (!initiallyControlled.current) {
setState(newValue);
}
cb?.(newValue);
},
[cb, effectiveValue]
);
useEffect2(() => {
collapseWarning(
!(initiallyControlled.current && value == null),
"`isExpanded` state is changing from controlled to uncontrolled. useCollapse should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop."
);
collapseWarning(
!(!initiallyControlled.current && value != null),
"`isExpanded` state is changing from uncontrolled to controlled. useCollapse should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop."
);
}, [value]);
return [effectiveValue, onChange];
}
// src/utils/usePrefersReducedMotion.ts
import { useState as useState2, useEffect as useEffect3 } from "react";
var QUERY = "(prefers-reduced-motion: reduce)";
function usePrefersReducedMotion() {
const [prefersReducedMotion, setPrefersReducedMotion] = useState2(false);
useEffect3(() => {
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
return;
}
const mediaQueryList = window.matchMedia(QUERY);
setPrefersReducedMotion(mediaQueryList.matches);
const listener = (event) => {
setPrefersReducedMotion(event.matches);
};
if (mediaQueryList.addEventListener) {
mediaQueryList.addEventListener("change", listener);
return () => {
mediaQueryList.removeEventListener("change", listener);
};
} else if (mediaQueryList.addListener) {
mediaQueryList.addListener(listener);
return () => {
mediaQueryList.removeListener(listener);
};
}
return void 0;
}, []);
return prefersReducedMotion;
}
// src/utils/useId.ts
import * as React from "react";
var __useId = React["useId".toString()] || (() => void 0);
function useReactId() {
const id2 = __useId();
return id2 ?? "";
}
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
var serverHandoffComplete = false;
var id = 0;
var genId = () => ++id;
function useUniqueId(idFromProps) {
const initialId = idFromProps || (serverHandoffComplete ? genId() : null);
const [id2, setId] = React.useState(initialId);
useIsomorphicLayoutEffect(() => {
if (id2 === null) {
setId(genId());
}
}, []);
React.useEffect(() => {
if (serverHandoffComplete === false) {
serverHandoffComplete = true;
}
}, []);
return id2 != null ? String(id2) : void 0;
}
function useId(idOverride) {
const reactId = useReactId();
const uniqueId = useUniqueId(idOverride);
if (typeof idOverride === "string") {
return idOverride;
}
if (typeof reactId === "string") {
return reactId;
}
return uniqueId;
}
// src/utils/setAnimationTimeout.ts
function setAnimationTimeout(callback, timeout) {
const startTime = performance.now();
const frame = {};
function call() {
frame.id = requestAnimationFrame((now) => {
if (now - startTime > timeout) {
callback();
} else {
call();
}
});
}
call();
return frame;
}
function clearAnimationTimeout(frame) {
if (frame.id)
cancelAnimationFrame(frame.id);
}
// src/utils/index.ts
function getElementHeight(el) {
if (!el?.current) {
collapseWarning(
true,
`Was not able to find a ref to the collapse element via \`getCollapseProps\`. Ensure that the element exposes its \`ref\` prop. If it exposes the ref prop under a different name (like \`innerRef\`), use the \`refKey\` property to change it. Example:
const collapseProps = getCollapseProps({refKey: 'innerRef'})`
);
return 0;
}
return el.current.scrollHeight;
}
function getAutoHeightDuration(height) {
if (!height || typeof height === "string") {
return 0;
}
const constant = height / 36;
return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
}
function assignRef(ref, value) {
if (ref == null)
return;
if (typeof ref === "function") {
ref(value);
} else {
try {
ref.current = value;
} catch (error) {
throw new CollapseError(`Cannot assign value "${value}" to ref "${ref}"`);
}
}
}
function mergeRefs(...refs) {
if (refs.every((ref) => ref == null)) {
return null;
}
return (node) => {
refs.forEach((ref) => {
assignRef(ref, node);
});
};
}
function usePaddingWarning(element) {
let warn = (el) => {
};
if (true !== "production") {
warn = (el) => {
if (!el?.current) {
return;
}
const { paddingTop, paddingBottom } = window.getComputedStyle(el.current);
const hasPadding = paddingTop && paddingTop !== "0px" || paddingBottom && paddingBottom !== "0px";
collapseWarning(
!hasPadding,
`Padding applied to the collapse element will cause the animation to break and not perform as expected. To fix, apply equivalent padding to the direct descendent of the collapse element. Example:
Before: <div {...getCollapseProps({style: {padding: 10}})}>{children}</div>
After: <div {...getCollapseProps()}>
<div style={{padding: 10}}>
{children}
</div>
</div>`
);
};
}
useEffect5(() => {
warn(element);
}, [element]);
}
// src/index.ts
var useLayoutEffect2 = typeof window === "undefined" ? useEffect6 : useReactLayoutEffect;
function useCollapse({
duration,
easing = "cubic-bezier(0.4, 0, 0.2, 1)",
onTransitionStateChange: propOnTransitionStateChange = () => {
},
isExpanded: configIsExpanded,
defaultExpanded = false,
hasDisabledAnimation,
id: id2,
...initialConfig
} = {}) {
const onTransitionStateChange = useEvent(propOnTransitionStateChange);
const uniqueId = useId(id2 ? `${id2}` : void 0);
const [isExpanded, setExpanded] = useControlledState(
configIsExpanded,
defaultExpanded
);
const prevExpanded = useRef3(isExpanded);
const [isAnimating, setIsAnimating] = useState4(false);
const prefersReducedMotion = usePrefersReducedMotion();
const disableAnimation = hasDisabledAnimation ?? prefersReducedMotion;
const frameId = useRef3();
const endFrameId = useRef3();
const collapseElRef = useRef3(null);
const [toggleEl, setToggleEl] = useState4(null);
usePaddingWarning(collapseElRef);
const collapsedHeight = `${initialConfig.collapsedHeight || 0}px`;
function setStyles(newStyles) {
if (!collapseElRef.current)
return;
const target = collapseElRef.current;
for (const property in newStyles) {
const value = newStyles[property];
if (value) {
target.style[property] = value;
} else {
target.style.removeProperty(property);
}
}
}
useLayoutEffect2(() => {
const collapse = collapseElRef.current;
if (!collapse)
return;
if (isExpanded === prevExpanded.current)
return;
prevExpanded.current = isExpanded;
function getDuration(height) {
if (disableAnimation) {
return 0;
}
return duration ?? getAutoHeightDuration(height);
}
const getTransitionStyles = (height) => `height ${getDuration(height)}ms ${easing}`;
const setTransitionEndTimeout = (duration2) => {
function endTransition() {
if (isExpanded) {
setStyles({
height: "",
overflow: "",
transition: "",
display: ""
});
onTransitionStateChange("expandEnd");
} else {
setStyles({ transition: "" });
onTransitionStateChange("collapseEnd");
}
setIsAnimating(false);
}
if (endFrameId.current) {
clearAnimationTimeout(endFrameId.current);
}
endFrameId.current = setAnimationTimeout(endTransition, duration2);
};
setIsAnimating(true);
if (isExpanded) {
frameId.current = requestAnimationFrame(() => {
onTransitionStateChange("expandStart");
setStyles({
display: "block",
overflow: "hidden",
height: collapsedHeight
});
frameId.current = requestAnimationFrame(() => {
onTransitionStateChange("expanding");
const height = getElementHeight(collapseElRef);
setTransitionEndTimeout(getDuration(height));
if (collapseElRef.current) {
collapseElRef.current.style.transition = getTransitionStyles(height);
collapseElRef.current.style.height = `${height}px`;
}
});
});
} else {
frameId.current = requestAnimationFrame(() => {
onTransitionStateChange("collapseStart");
const height = getElementHeight(collapseElRef);
setTransitionEndTimeout(getDuration(height));
setStyles({
transition: getTransitionStyles(height),
height: `${height}px`
});
frameId.current = requestAnimationFrame(() => {
onTransitionStateChange("collapsing");
setStyles({
height: collapsedHeight,
overflow: "hidden"
});
});
});
}
return () => {
if (frameId.current)
cancelAnimationFrame(frameId.current);
if (endFrameId.current)
clearAnimationTimeout(endFrameId.current);
};
}, [
isExpanded,
collapsedHeight,
disableAnimation,
duration,
easing,
onTransitionStateChange
]);
return {
isExpanded,
setExpanded,
getToggleProps(args) {
const { disabled, onClick, refKey, ...rest } = {
refKey: "ref",
onClick() {
},
disabled: false,
...args
};
const isButton = toggleEl ? toggleEl.tagName === "BUTTON" : void 0;
const theirRef = args?.[refKey || "ref"];
const props = {
id: `react-collapsed-toggle-${uniqueId}`,
"aria-controls": `react-collapsed-panel-${uniqueId}`,
"aria-expanded": isExpanded,
onClick(evt) {
if (disabled)
return;
onClick?.(evt);
setExpanded((n) => !n);
},
[refKey || "ref"]: mergeRefs(theirRef, setToggleEl)
};
const buttonProps = {
type: "button",
disabled: disabled ? true : void 0
};
const fakeButtonProps = {
"aria-disabled": disabled ? true : void 0,
role: "button",
tabIndex: disabled ? -1 : 0
};
if (isButton === false) {
return { ...props, ...fakeButtonProps, ...rest };
} else if (isButton === true) {
return { ...props, ...buttonProps, ...rest };
} else {
return {
...props,
...buttonProps,
...fakeButtonProps,
...rest
};
}
},
getCollapseProps(args) {
const { style, refKey } = { refKey: "ref", style: {}, ...args };
const theirRef = args?.[refKey || "ref"];
return {
id: `react-collapsed-panel-${uniqueId}`,
"aria-hidden": !isExpanded,
"aria-labelledby": `react-collapsed-toggle-${uniqueId}`,
role: "region",
...args,
[refKey || "ref"]: mergeRefs(collapseElRef, theirRef),
style: {
boxSizing: "border-box",
...!isAnimating && !isExpanded ? {
// collapsed and not animating
display: collapsedHeight === "0px" ? "none" : "block",
height: collapsedHeight,
overflow: "hidden"
} : {},
// additional styles passed, e.g. getCollapseProps({style: {}})
...style
}
};
}
};
}
export {
useCollapse
};
webpack://frontend-tpt/../../node_modules/@fanduel/formation-react/build/esm/index.mjs
import A,{createContext as y,useContext as R,useMemo as D}from"react";import{jsx as S}from"react/jsx-runtime";var b=y(null),T=()=>{let e=R(b);if(!e)throw new Error("useAccordion() hook must be used within AccordionProvider");return e},{Provider:w}=b,I=({children:e,defaultOpen:u=null,multiple:n=!1,open:s,onOpenChange:t})=>{let[c,l]=A.useState(s??u),o=s!==void 0;A.useEffect(()=>{o&&l(s)},[s,o]);let a=r=>Array.isArray(c)?c.some(i=>i===r):c===r,p=A.useCallback(r=>{l(n?i=>{let d=Array.isArray(i)?i:[],P=d.includes(r)?d.filter(g=>g!==r):[...d,r];return t&&t(P),o?i:P}:i=>{let d=i===r?null:r;return t&&t(d),o?i:d})},[o,n,t,c]),f=D(()=>({isItemOpen:a,onItemToggle:p,open:c}),[c]);return S(w,{value:f,children:e})};import v,{createContext as k,useContext as U,useMemo as M}from"react";import{generateUniqueId as N}from"@fanduel/formation-shared-utils";import{useCallback as m,useEffect as h,useState as E}from"react";var x=({controlledOpen:e,defaultOpen:u=!1,disabled:n=!1,onClose:s=()=>{},onOpen:t=()=>{}}={})=>{let[c,l]=E(e??u),o=e!==void 0;h(()=>{o&&l(e)},[e,o]);let a=m(()=>{n||(o?e!==!0&&t():l(r=>(r||t(),!0)))},[n,o,t,s]),p=m(()=>{n||(o?e!==!1&&s():l(r=>(r&&s(),!1)))},[n,o,t,s]),f=m(()=>{n||(o?e!==!1?s():t():l(r=>{let i=!r;return i&&t(),i||s(),i}))},[n,o,e,t,s]);return{isOpen:c,open:a,close:p,toggle:f}};import{jsx as B}from"react/jsx-runtime";var C=k(null),O=()=>{let e=U(C);if(!e)throw new Error("useCollapsible() hook must be used within a CollapsibleProvider");return e},{Provider:q}=C,z=({children:e,disabled:u=!1,initialState:n=!1,open:s,onOpenChange:t})=>{let[c,l]=v.useState(null),{isOpen:o,open:a,close:p,toggle:f}=x({controlledOpen:s,defaultOpen:n,disabled:u,onOpen:()=>{t?.(!0)},onClose:()=>{t?.(!1)}}),r=M(()=>({isOpen:o,disabled:u,open:a,close:p,toggle:f,uid:c}),[o,u,a,p,f]);return v.useEffect(()=>l(N()),[]),B(q,{value:r,children:e})};export{I as AccordionProvider,z as CollapsibleProvider,T as useAccordion,O as useCollapsible,x as useDisclosure};
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/useObjectRef.mjs
import {useRef as $gbmns$useRef, useMemo as $gbmns$useMemo} from "react";
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $df56164dff5785e2$export$4338b53315abf666(forwardedRef) {
const objRef = (0, $gbmns$useRef)(null);
return (0, $gbmns$useMemo)(()=>({
get current () {
return objRef.current;
},
set current (value){
objRef.current = value;
if (typeof forwardedRef === 'function') forwardedRef(value);
else if (forwardedRef) forwardedRef.current = value;
}
}), [
forwardedRef
]);
}
export {$df56164dff5785e2$export$4338b53315abf666 as useObjectRef};
//# sourceMappingURL=useObjectRef.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/chain.mjs
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /**
* Calls all functions in the order they were chained with the same arguments.
*/ function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
return (...args)=>{
for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
};
}
export {$ff5963eb1fccf552$export$e08e3b67e392101e as chain};
//# sourceMappingURL=chain.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/useId.mjs
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useValueEffect as $1dbecbe27a04f9af$export$14d238f342723f25} from "./useValueEffect.mjs";
import {useState as $eKkEp$useState, useRef as $eKkEp$useRef, useEffect as $eKkEp$useEffect, useCallback as $eKkEp$useCallback} from "react";
import {useSSRSafeId as $eKkEp$useSSRSafeId} from "@react-aria/ssr";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
let $bdb11010cef70236$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
let $bdb11010cef70236$export$d41a04c74483c6ef = new Map();
// This allows us to clean up the idsUpdaterMap when the id is no longer used.
// Map is a strong reference, so unused ids wouldn't be cleaned up otherwise.
// This can happen in suspended components where mount/unmount is not called.
let $bdb11010cef70236$var$registry;
if (typeof FinalizationRegistry !== 'undefined') $bdb11010cef70236$var$registry = new FinalizationRegistry((heldValue)=>{
$bdb11010cef70236$export$d41a04c74483c6ef.delete(heldValue);
});
function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
let [value, setValue] = (0, $eKkEp$useState)(defaultId);
let nextId = (0, $eKkEp$useRef)(null);
let res = (0, $eKkEp$useSSRSafeId)(value);
let cleanupRef = (0, $eKkEp$useRef)(null);
if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.register(cleanupRef, res);
if ($bdb11010cef70236$var$canUseDOM) {
const cacheIdRef = $bdb11010cef70236$export$d41a04c74483c6ef.get(res);
if (cacheIdRef && !cacheIdRef.includes(nextId)) cacheIdRef.push(nextId);
else $bdb11010cef70236$export$d41a04c74483c6ef.set(res, [
nextId
]);
}
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
let r = res;
return ()=>{
// In Suspense, the cleanup function may be not called
// when it is though, also remove it from the finalization registry.
if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.unregister(cleanupRef);
$bdb11010cef70236$export$d41a04c74483c6ef.delete(r);
};
}, [
res
]);
// This cannot cause an infinite loop because the ref is always cleaned up.
// eslint-disable-next-line
(0, $eKkEp$useEffect)(()=>{
let newId = nextId.current;
if (newId) setValue(newId);
return ()=>{
if (newId) nextId.current = null;
};
});
return res;
}
function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
if (idA === idB) return idA;
let setIdsA = $bdb11010cef70236$export$d41a04c74483c6ef.get(idA);
if (setIdsA) {
setIdsA.forEach((ref)=>ref.current = idB);
return idB;
}
let setIdsB = $bdb11010cef70236$export$d41a04c74483c6ef.get(idB);
if (setIdsB) {
setIdsB.forEach((ref)=>ref.current = idA);
return idA;
}
return idB;
}
function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
let id = $bdb11010cef70236$export$f680877a34711e37();
let [resolvedId, setResolvedId] = (0, $1dbecbe27a04f9af$export$14d238f342723f25)(id);
let updateId = (0, $eKkEp$useCallback)(()=>{
setResolvedId(function*() {
yield id;
yield document.getElementById(id) ? id : undefined;
});
}, [
id,
setResolvedId
]);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(updateId, [
id,
updateId,
...depArray
]);
return resolvedId;
}
export {$bdb11010cef70236$export$d41a04c74483c6ef as idsUpdaterMap, $bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId};
//# sourceMappingURL=useId.module.js.map
webpack://frontend-tpt/../../node_modules/clsx/dist/clsx.mjs
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}export function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}export default clsx;
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/mergeProps.mjs
import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.mjs";
import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629} from "./useId.mjs";
import $7jXr9$clsx from "clsx";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
// Start with a base clone of the first argument. This is a lot faster than starting
// with an empty object and adding properties as we go.
let result = {
...args[0]
};
for(let i = 1; i < args.length; i++){
let props = args[i];
for(let key in props){
let a = result[key];
let b = props[key];
// Chain events
if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = (0, $ff5963eb1fccf552$export$e08e3b67e392101e)(a, b);
else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, $7jXr9$clsx)(a, b);
else if (key === 'id' && a && b) result.id = (0, $bdb11010cef70236$export$cd8c9cb68f842629)(a, b);
else result[key] = b !== undefined ? b : a;
}
}
return result;
}
export {$3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps};
//# sourceMappingURL=mergeProps.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/filterDOMProps.mjs
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ const $65484d02dcb7eb3e$var$DOMPropNames = new Set([
'id'
]);
const $65484d02dcb7eb3e$var$labelablePropNames = new Set([
'aria-label',
'aria-labelledby',
'aria-describedby',
'aria-details'
]);
// See LinkDOMProps in dom.d.ts.
const $65484d02dcb7eb3e$var$linkPropNames = new Set([
'href',
'hrefLang',
'target',
'rel',
'download',
'ping',
'referrerPolicy'
]);
const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
let { labelable: labelable, isLink: isLink, propNames: propNames } = opts;
let filteredProps = {};
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
return filteredProps;
}
export {$65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps};
//# sourceMappingURL=filterDOMProps.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/useLayoutEffect.mjs
import $HgANd$react from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? (0, $HgANd$react).useLayoutEffect : ()=>{};
export {$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect};
//# sourceMappingURL=useLayoutEffect.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/useEffectEvent.mjs
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useRef as $lmaYr$useRef, useCallback as $lmaYr$useCallback} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
const ref = (0, $lmaYr$useRef)(null);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
ref.current = fn;
}, [
fn
]);
// @ts-ignore
return (0, $lmaYr$useCallback)((...args)=>{
const f = ref.current;
return f === null || f === void 0 ? void 0 : f(...args);
}, []);
}
export {$8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent};
//# sourceMappingURL=useEffectEvent.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/isFocusable.mjs
const $b4b717babfbb907b$var$focusableElements = [
'input:not([disabled]):not([type=hidden])',
'select:not([disabled])',
'textarea:not([disabled])',
'button:not([disabled])',
'a[href]',
'area[href]',
'summary',
'iframe',
'object',
'embed',
'audio[controls]',
'video[controls]',
'[contenteditable]:not([contenteditable^="false"])'
];
const $b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
$b4b717babfbb907b$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
const $b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
function $b4b717babfbb907b$export$4c063cf1350e6fed(element) {
return element.matches($b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR);
}
function $b4b717babfbb907b$export$bebd5a1431fec25d(element) {
return element.matches($b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR);
}
export {$b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
//# sourceMappingURL=isFocusable.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/domHelpers.mjs
const $431fbd86ca7dc216$export$b204af158042fbac = (el)=>{
var _el_ownerDocument;
return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
};
const $431fbd86ca7dc216$export$f21a1ffae260145a = (el)=>{
if (el && 'window' in el && el.window === el) return el;
const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
return doc.defaultView || window;
};
/**
* Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
*/ function $431fbd86ca7dc216$var$isNode(value) {
return value !== null && typeof value === 'object' && 'nodeType' in value && typeof value.nodeType === 'number';
}
function $431fbd86ca7dc216$export$af51f0f06c0f328a(node) {
return $431fbd86ca7dc216$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && 'host' in node;
}
export {$431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot};
//# sourceMappingURL=domHelpers.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/focusWithoutScrolling.mjs
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
preventScroll: true
});
else {
let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
element.focus();
$7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
}
}
let $7215afc6de606d6b$var$supportsPreventScrollCached = null;
function $7215afc6de606d6b$var$supportsPreventScroll() {
if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
$7215afc6de606d6b$var$supportsPreventScrollCached = false;
try {
let focusElem = document.createElement('div');
focusElem.focus({
get preventScroll () {
$7215afc6de606d6b$var$supportsPreventScrollCached = true;
return true;
}
});
} catch {
// Ignore
}
}
return $7215afc6de606d6b$var$supportsPreventScrollCached;
}
function $7215afc6de606d6b$var$getScrollableElements(element) {
let parent = element.parentNode;
let scrollableElements = [];
let rootScrollingElement = document.scrollingElement || document.documentElement;
while(parent instanceof HTMLElement && parent !== rootScrollingElement){
if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
element: parent,
scrollTop: parent.scrollTop,
scrollLeft: parent.scrollLeft
});
parent = parent.parentNode;
}
if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
element: rootScrollingElement,
scrollTop: rootScrollingElement.scrollTop,
scrollLeft: rootScrollingElement.scrollLeft
});
return scrollableElements;
}
function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
for (let { element: element, scrollTop: scrollTop, scrollLeft: scrollLeft } of scrollableElements){
element.scrollTop = scrollTop;
element.scrollLeft = scrollLeft;
}
}
export {$7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling};
//# sourceMappingURL=focusWithoutScrolling.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/utils.mjs
import {useLayoutEffect as $6dfIe$useLayoutEffect, useEffectEvent as $6dfIe$useEffectEvent, isFocusable as $6dfIe$isFocusable, getOwnerWindow as $6dfIe$getOwnerWindow, focusWithoutScrolling as $6dfIe$focusWithoutScrolling} from "@react-aria/utils";
import {useRef as $6dfIe$useRef, useCallback as $6dfIe$useCallback} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $8a9cb279dc87e130$export$525bc4921d56d4a(nativeEvent) {
let event = nativeEvent;
event.nativeEvent = nativeEvent;
event.isDefaultPrevented = ()=>event.defaultPrevented;
// cancelBubble is technically deprecated in the spec, but still supported in all browsers.
event.isPropagationStopped = ()=>event.cancelBubble;
event.persist = ()=>{};
return event;
}
function $8a9cb279dc87e130$export$c2b7abe5d61ec696(event, target) {
Object.defineProperty(event, 'target', {
value: target
});
Object.defineProperty(event, 'currentTarget', {
value: target
});
}
function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
let stateRef = (0, $6dfIe$useRef)({
isFocused: false,
observer: null
});
// Clean up MutationObserver on unmount. See below.
(0, $6dfIe$useLayoutEffect)(()=>{
const state = stateRef.current;
return ()=>{
if (state.observer) {
state.observer.disconnect();
state.observer = null;
}
};
}, []);
let dispatchBlur = (0, $6dfIe$useEffectEvent)((e)=>{
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
});
// This function is called during a React onFocus event.
return (0, $6dfIe$useCallback)((e)=>{
// React does not fire onBlur when an element is disabled. https://github.com/facebook/react/issues/9142
// Most browsers fire a native focusout event in this case, except for Firefox. In that case, we use a
// MutationObserver to watch for the disabled attribute, and dispatch these events ourselves.
// For browsers that do, focusout fires before the MutationObserver, so onBlur should not fire twice.
if (e.target instanceof HTMLButtonElement || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLSelectElement) {
stateRef.current.isFocused = true;
let target = e.target;
let onBlurHandler = (e)=>{
stateRef.current.isFocused = false;
if (target.disabled) {
// For backward compatibility, dispatch a (fake) React synthetic event.
let event = $8a9cb279dc87e130$export$525bc4921d56d4a(e);
dispatchBlur(event);
}
// We no longer need the MutationObserver once the target is blurred.
if (stateRef.current.observer) {
stateRef.current.observer.disconnect();
stateRef.current.observer = null;
}
};
target.addEventListener('focusout', onBlurHandler, {
once: true
});
stateRef.current.observer = new MutationObserver(()=>{
if (stateRef.current.isFocused && target.disabled) {
var _stateRef_current_observer;
(_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer === void 0 ? void 0 : _stateRef_current_observer.disconnect();
let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
target.dispatchEvent(new FocusEvent('blur', {
relatedTarget: relatedTargetEl
}));
target.dispatchEvent(new FocusEvent('focusout', {
bubbles: true,
relatedTarget: relatedTargetEl
}));
}
});
stateRef.current.observer.observe(target, {
attributes: true,
attributeFilter: [
'disabled'
]
});
}
}, [
dispatchBlur
]);
}
let $8a9cb279dc87e130$export$fda7da73ab5d4c48 = false;
function $8a9cb279dc87e130$export$cabe61c495ee3649(target) {
// The browser will focus the nearest focusable ancestor of our target.
while(target && !(0, $6dfIe$isFocusable)(target))target = target.parentElement;
let window = (0, $6dfIe$getOwnerWindow)(target);
let activeElement = window.document.activeElement;
if (!activeElement || activeElement === target) return;
$8a9cb279dc87e130$export$fda7da73ab5d4c48 = true;
let isRefocusing = false;
let onBlur = (e)=>{
if (e.target === activeElement || isRefocusing) e.stopImmediatePropagation();
};
let onFocusOut = (e)=>{
if (e.target === activeElement || isRefocusing) {
e.stopImmediatePropagation();
// If there was no focusable ancestor, we don't expect a focus event.
// Re-focus the original active element here.
if (!target && !isRefocusing) {
isRefocusing = true;
(0, $6dfIe$focusWithoutScrolling)(activeElement);
cleanup();
}
}
};
let onFocus = (e)=>{
if (e.target === target || isRefocusing) e.stopImmediatePropagation();
};
let onFocusIn = (e)=>{
if (e.target === target || isRefocusing) {
e.stopImmediatePropagation();
if (!isRefocusing) {
isRefocusing = true;
(0, $6dfIe$focusWithoutScrolling)(activeElement);
cleanup();
}
}
};
window.addEventListener('blur', onBlur, true);
window.addEventListener('focusout', onFocusOut, true);
window.addEventListener('focusin', onFocusIn, true);
window.addEventListener('focus', onFocus, true);
let cleanup = ()=>{
cancelAnimationFrame(raf);
window.removeEventListener('blur', onBlur, true);
window.removeEventListener('focusout', onFocusOut, true);
window.removeEventListener('focusin', onFocusIn, true);
window.removeEventListener('focus', onFocus, true);
$8a9cb279dc87e130$export$fda7da73ab5d4c48 = false;
isRefocusing = false;
};
let raf = requestAnimationFrame(cleanup);
return cleanup;
}
export {$8a9cb279dc87e130$export$525bc4921d56d4a as createSyntheticEvent, $8a9cb279dc87e130$export$c2b7abe5d61ec696 as setEventTarget, $8a9cb279dc87e130$export$715c682d09d639cc as useSyntheticBlurEvent, $8a9cb279dc87e130$export$fda7da73ab5d4c48 as ignoreFocusEvent, $8a9cb279dc87e130$export$cabe61c495ee3649 as preventFocus};
//# sourceMappingURL=utils.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/platform.mjs
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $c87311424ea30a05$var$testUserAgent(re) {
var _window_navigator_userAgentData;
if (typeof window === 'undefined' || window.navigator == null) return false;
return ((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((brand)=>re.test(brand.brand))) || re.test(window.navigator.userAgent);
}
function $c87311424ea30a05$var$testPlatform(re) {
var _window_navigator_userAgentData;
return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
}
function $c87311424ea30a05$var$cached(fn) {
if (process.env.NODE_ENV === 'test') return fn;
let res = null;
return ()=>{
if (res == null) res = fn();
return res;
};
}
const $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
});
const $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
});
const $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
});
const $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
});
const $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
});
const $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
});
const $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
});
const $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Android/i);
});
const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
});
export {$c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox};
//# sourceMappingURL=platform.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/runAfterTransition.mjs
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // We store a global list of elements that are currently transitioning,
// mapped to a set of CSS properties that are transitioning for that element.
// This is necessary rather than a simple count of transitions because of browser
// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
// than one or the other. So we need to track what's actually transitioning so that
// we can ignore these duplicate events.
let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
// A list of callbacks to call once there are no transitioning elements.
let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
function $bbed8b41f857bcc0$var$setupGlobalEvents() {
if (typeof window === 'undefined') return;
function isTransitionEvent(event) {
return 'propertyName' in event;
}
let onTransitionStart = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Add the transitioning property to the list for this element.
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
if (!transitions) {
transitions = new Set();
$bbed8b41f857bcc0$var$transitionsByElement.set(e.target, transitions);
// The transitioncancel event must be registered on the element itself, rather than as a global
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
e.target.addEventListener('transitioncancel', onTransitionEnd, {
once: true
});
}
transitions.add(e.propertyName);
};
let onTransitionEnd = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Remove property from list of transitioning properties.
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
if (!properties) return;
properties.delete(e.propertyName);
// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
if (properties.size === 0) {
e.target.removeEventListener('transitioncancel', onTransitionEnd);
$bbed8b41f857bcc0$var$transitionsByElement.delete(e.target);
}
// If no transitioning elements, call all of the queued callbacks.
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)cb();
$bbed8b41f857bcc0$var$transitionCallbacks.clear();
}
};
document.body.addEventListener('transitionrun', onTransitionStart);
document.body.addEventListener('transitionend', onTransitionEnd);
}
if (typeof document !== 'undefined') {
if (document.readyState !== 'loading') $bbed8b41f857bcc0$var$setupGlobalEvents();
else document.addEventListener('DOMContentLoaded', $bbed8b41f857bcc0$var$setupGlobalEvents);
}
function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
// Wait one frame to see if an animation starts, e.g. a transition on mount.
requestAnimationFrame(()=>{
// If no transitions are running, call the function immediately.
// Otherwise, add it to a list of callbacks to run at the end of the animation.
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) fn();
else $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
});
}
export {$bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition};
//# sourceMappingURL=runAfterTransition.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/textSelection.mjs
import {isIOS as $7R18e$isIOS, getOwnerDocument as $7R18e$getOwnerDocument, runAfterTransition as $7R18e$runAfterTransition} from "@react-aria/utils";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// Note that state only matters here for iOS. Non-iOS gets user-select: none applied to the target element
// rather than at the document level so we just need to apply/remove user-select: none for each pressed element individually
let $14c0b72509d70225$var$state = 'default';
let $14c0b72509d70225$var$savedUserSelect = '';
let $14c0b72509d70225$var$modifiedElementMap = new WeakMap();
function $14c0b72509d70225$export$16a4697467175487(target) {
if ((0, $7R18e$isIOS)()) {
if ($14c0b72509d70225$var$state === 'default') {
const documentObject = (0, $7R18e$getOwnerDocument)(target);
$14c0b72509d70225$var$savedUserSelect = documentObject.documentElement.style.webkitUserSelect;
documentObject.documentElement.style.webkitUserSelect = 'none';
}
$14c0b72509d70225$var$state = 'disabled';
} else if (target instanceof HTMLElement || target instanceof SVGElement) {
// If not iOS, store the target's original user-select and change to user-select: none
// Ignore state since it doesn't apply for non iOS
let property = 'userSelect' in target.style ? 'userSelect' : 'webkitUserSelect';
$14c0b72509d70225$var$modifiedElementMap.set(target, target.style[property]);
target.style[property] = 'none';
}
}
function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
if ((0, $7R18e$isIOS)()) {
// If the state is already default, there's nothing to do.
// If it is restoring, then there's no need to queue a second restore.
if ($14c0b72509d70225$var$state !== 'disabled') return;
$14c0b72509d70225$var$state = 'restoring';
// There appears to be a delay on iOS where selection still might occur
// after pointer up, so wait a bit before removing user-select.
setTimeout(()=>{
// Wait for any CSS transitions to complete so we don't recompute style
// for the whole page in the middle of the animation and cause jank.
(0, $7R18e$runAfterTransition)(()=>{
// Avoid race conditions
if ($14c0b72509d70225$var$state === 'restoring') {
const documentObject = (0, $7R18e$getOwnerDocument)(target);
if (documentObject.documentElement.style.webkitUserSelect === 'none') documentObject.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || '';
$14c0b72509d70225$var$savedUserSelect = '';
$14c0b72509d70225$var$state = 'default';
}
});
}, 300);
} else if (target instanceof HTMLElement || target instanceof SVGElement) // If not iOS, restore the target's original user-select if any
// Ignore state since it doesn't apply for non iOS
{
if (target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target);
let property = 'userSelect' in target.style ? 'userSelect' : 'webkitUserSelect';
if (target.style[property] === 'none') target.style[property] = targetOldUserSelect;
if (target.getAttribute('style') === '') target.removeAttribute('style');
$14c0b72509d70225$var$modifiedElementMap.delete(target);
}
}
}
export {$14c0b72509d70225$export$16a4697467175487 as disableTextSelection, $14c0b72509d70225$export$b0d6fa1ab32e3295 as restoreTextSelection};
//# sourceMappingURL=textSelection.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/context.mjs
import $3aeG1$react from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = (0, $3aeG1$react).createContext({
register: ()=>{}
});
$ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = 'PressResponderContext';
export {$ae1eeba8b9eafd08$export$5165eccb35aaadb5 as PressResponderContext};
//# sourceMappingURL=context.module.js.map
webpack://frontend-tpt/../../node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js
function _class_extract_field_descriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
return privateMap.get(receiver);
}
export { _class_extract_field_descriptor as _ };
webpack://frontend-tpt/../../node_modules/@swc/helpers/esm/_class_private_field_set.js
import { _ as _class_apply_descriptor_set } from "./_class_apply_descriptor_set.js";
import { _ as _class_extract_field_descriptor } from "./_class_extract_field_descriptor.js";
function _class_private_field_set(receiver, privateMap, value) {
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
_class_apply_descriptor_set(receiver, descriptor, value);
return value;
}
export { _class_private_field_set as _ };
webpack://frontend-tpt/../../node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js
function _class_apply_descriptor_set(receiver, descriptor, value) {
if (descriptor.set) descriptor.set.call(receiver, value);
else {
if (!descriptor.writable) {
// This should only throw in strict mode, but class bodies are
// always strict and private fields can only be used inside
// class bodies.
throw new TypeError("attempted to set read only private field");
}
descriptor.value = value;
}
}
export { _class_apply_descriptor_set as _ };
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/useSyncRef.mjs
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (context && context.ref && ref) {
context.ref.current = ref.current;
return ()=>{
if (context.ref) context.ref.current = null;
};
}
});
}
export {$e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef};
//# sourceMappingURL=useSyncRef.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/useGlobalListeners.mjs
import {useRef as $lPAwt$useRef, useCallback as $lPAwt$useCallback, useEffect as $lPAwt$useEffect} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
let globalListeners = (0, $lPAwt$useRef)(new Map());
let addGlobalListener = (0, $lPAwt$useCallback)((eventTarget, type, listener, options)=>{
// Make sure we remove the listener after it is called with the `once` option.
let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args)=>{
globalListeners.current.delete(listener);
listener(...args);
} : listener;
globalListeners.current.set(listener, {
type: type,
eventTarget: eventTarget,
fn: fn,
options: options
});
eventTarget.addEventListener(type, fn, options);
}, []);
let removeGlobalListener = (0, $lPAwt$useCallback)((eventTarget, type, listener, options)=>{
var _globalListeners_current_get;
let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
eventTarget.removeEventListener(type, fn, options);
globalListeners.current.delete(listener);
}, []);
let removeAllGlobalListeners = (0, $lPAwt$useCallback)(()=>{
globalListeners.current.forEach((value, key)=>{
removeGlobalListener(value.eventTarget, value.type, key, value.options);
});
}, [
removeGlobalListener
]);
(0, $lPAwt$useEffect)(()=>{
return removeAllGlobalListeners;
}, [
removeAllGlobalListeners
]);
return {
addGlobalListener: addGlobalListener,
removeGlobalListener: removeGlobalListener,
removeAllGlobalListeners: removeAllGlobalListeners
};
}
export {$03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners};
//# sourceMappingURL=useGlobalListeners.module.js.map
webpack://frontend-tpt/../../node_modules/@react-stately/flags/dist/import.mjs
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ let $f4e2df6bd15f8569$var$_tableNestedRows = false;
let $f4e2df6bd15f8569$var$_shadowDOM = false;
function $f4e2df6bd15f8569$export$d9d8a0f82de49530() {
$f4e2df6bd15f8569$var$_tableNestedRows = true;
}
function $f4e2df6bd15f8569$export$1b00cb14a96194e6() {
return $f4e2df6bd15f8569$var$_tableNestedRows;
}
function $f4e2df6bd15f8569$export$12b151d9882e9985() {
$f4e2df6bd15f8569$var$_shadowDOM = true;
}
function $f4e2df6bd15f8569$export$98658e8c59125e6a() {
return $f4e2df6bd15f8569$var$_shadowDOM;
}
export {$f4e2df6bd15f8569$export$d9d8a0f82de49530 as enableTableNestedRows, $f4e2df6bd15f8569$export$1b00cb14a96194e6 as tableNestedRows, $f4e2df6bd15f8569$export$12b151d9882e9985 as enableShadowDOM, $f4e2df6bd15f8569$export$98658e8c59125e6a as shadowDOM};
//# sourceMappingURL=module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/DOMFunctions.mjs
import {isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.mjs";
import {shadowDOM as $lcSu5$shadowDOM} from "@react-stately/flags";
// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
if (!(0, $lcSu5$shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
if (!node || !otherNode) return false;
let currentNode = otherNode;
while(currentNode !== null){
if (currentNode === node) return true;
if (currentNode.tagName === 'SLOT' && currentNode.assignedSlot) // Element is slotted
currentNode = currentNode.assignedSlot.parentNode;
else if ((0, $431fbd86ca7dc216$export$af51f0f06c0f328a)(currentNode)) // Element is in shadow root
currentNode = currentNode.host;
else currentNode = currentNode.parentNode;
}
return false;
}
const $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document)=>{
var _activeElement_shadowRoot;
if (!(0, $lcSu5$shadowDOM)()) return doc.activeElement;
let activeElement = doc.activeElement;
while(activeElement && 'shadowRoot' in activeElement && ((_activeElement_shadowRoot = activeElement.shadowRoot) === null || _activeElement_shadowRoot === void 0 ? void 0 : _activeElement_shadowRoot.activeElement))activeElement = activeElement.shadowRoot.activeElement;
return activeElement;
};
function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
if ((0, $lcSu5$shadowDOM)() && event.target.shadowRoot) {
if (event.composedPath) return event.composedPath()[0];
}
return event.target;
}
export {$d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget};
//# sourceMappingURL=DOMFunctions.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/openLink.mjs
import {focusWithoutScrolling as $7215afc6de606d6b$export$de79e2c695e052f3} from "./focusWithoutScrolling.mjs";
import {isMac as $c87311424ea30a05$export$9ac100e40613ea10, isWebKit as $c87311424ea30a05$export$78551043582a6a98, isFirefox as $c87311424ea30a05$export$b7d78993b74f766d, isIPad as $c87311424ea30a05$export$7bef049ce92e4224} from "./platform.mjs";
import $g3jFn$react, {createContext as $g3jFn$createContext, useMemo as $g3jFn$useMemo, useContext as $g3jFn$useContext} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $ea8dcbcb9ea1b556$var$RouterContext = /*#__PURE__*/ (0, $g3jFn$createContext)({
isNative: true,
open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
useHref: (href)=>href
});
function $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb(props) {
let { children: children, navigate: navigate, useHref: useHref } = props;
let ctx = (0, $g3jFn$useMemo)(()=>({
isNative: false,
open: (target, modifiers, href, routerOptions)=>{
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>{
if ($ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers)) navigate(href, routerOptions);
else $ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers);
});
},
useHref: useHref || ((href)=>href)
}), [
navigate,
useHref
]);
return /*#__PURE__*/ (0, $g3jFn$react).createElement($ea8dcbcb9ea1b556$var$RouterContext.Provider, {
value: ctx
}, children);
}
function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
return (0, $g3jFn$useContext)($ea8dcbcb9ea1b556$var$RouterContext);
}
function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers) {
// Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
let target = link.getAttribute('target');
return (!target || target === '_self') && link.origin === location.origin && !link.hasAttribute('download') && !modifiers.metaKey && // open in new tab (mac)
!modifiers.ctrlKey && // open in new tab (windows)
!modifiers.altKey && // download
!modifiers.shiftKey;
}
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
var _window_event_type, _window_event;
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
// will prevent links with target="_blank" from opening. However, it does allow the event if the
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
if ((0, $c87311424ea30a05$export$b7d78993b74f766d)() && ((_window_event = window.event) === null || _window_event === void 0 ? void 0 : (_window_event_type = _window_event.type) === null || _window_event_type === void 0 ? void 0 : _window_event_type.startsWith('key')) && target.target === '_blank') {
if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
else ctrlKey = true;
}
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
let event = (0, $c87311424ea30a05$export$78551043582a6a98)() && (0, $c87311424ea30a05$export$9ac100e40613ea10)() && !(0, $c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
keyIdentifier: 'Enter',
metaKey: metaKey,
ctrlKey: ctrlKey,
altKey: altKey,
shiftKey: shiftKey
}) : new MouseEvent('click', {
metaKey: metaKey,
ctrlKey: ctrlKey,
altKey: altKey,
shiftKey: shiftKey,
bubbles: true,
cancelable: true
});
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
(0, $7215afc6de606d6b$export$de79e2c695e052f3)(target);
target.dispatchEvent(event);
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
}
// https://github.com/parcel-bundler/parcel/issues/8724
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
if (target instanceof HTMLAnchorElement) open(target);
else if (target.hasAttribute('data-href')) {
let link = document.createElement('a');
link.href = target.getAttribute('data-href');
if (target.hasAttribute('data-target')) link.target = target.getAttribute('data-target');
if (target.hasAttribute('data-rel')) link.rel = target.getAttribute('data-rel');
if (target.hasAttribute('data-download')) link.download = target.getAttribute('data-download');
if (target.hasAttribute('data-ping')) link.ping = target.getAttribute('data-ping');
if (target.hasAttribute('data-referrer-policy')) link.referrerPolicy = target.getAttribute('data-referrer-policy');
target.appendChild(link);
open(link);
target.removeChild(link);
}
}
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
}
function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
var _props_href;
const href = router.useHref((_props_href = props.href) !== null && _props_href !== void 0 ? _props_href : '');
return {
'data-href': props.href ? href : undefined,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
};
}
function $ea8dcbcb9ea1b556$export$51437d503373d223(props) {
return {
'data-href': props.href,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
};
}
function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
var _props_href;
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
return {
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
target: props === null || props === void 0 ? void 0 : props.target,
rel: props === null || props === void 0 ? void 0 : props.rel,
download: props === null || props === void 0 ? void 0 : props.download,
ping: props === null || props === void 0 ? void 0 : props.ping,
referrerPolicy: props === null || props === void 0 ? void 0 : props.referrerPolicy
};
}
export {$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps};
//# sourceMappingURL=openLink.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/utils/dist/isVirtualEvent.mjs
import {isAndroid as $c87311424ea30a05$export$a11b0059900ceec8} from "./platform.mjs";
/*
* Copyright 2022 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $6a7db85432448f7f$export$60278871457622de(event) {
// JAWS/NVDA with Firefox.
if (event.mozInputSource === 0 && event.isTrusted) return true;
// Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead
// If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check
// to detect TalkBack virtual clicks.
if ((0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.pointerType) return event.type === 'click' && event.buttons === 1;
return event.detail === 0 && !event.pointerType;
}
function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
// If the pointer size is zero, then we assume it's from a screen reader.
// Android TalkBack double tap will sometimes return a event with width and height of 1
// and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
// Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
// instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
// Talkback double tap from Windows Firefox touch screen press
return !(0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse';
}
export {$6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent};
//# sourceMappingURL=isVirtualEvent.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/usePress.mjs
import {createSyntheticEvent as $8a9cb279dc87e130$export$525bc4921d56d4a, preventFocus as $8a9cb279dc87e130$export$cabe61c495ee3649, setEventTarget as $8a9cb279dc87e130$export$c2b7abe5d61ec696} from "./utils.mjs";
import {disableTextSelection as $14c0b72509d70225$export$16a4697467175487, restoreTextSelection as $14c0b72509d70225$export$b0d6fa1ab32e3295} from "./textSelection.mjs";
import {PressResponderContext as $ae1eeba8b9eafd08$export$5165eccb35aaadb5} from "./context.mjs";
import {_ as $7mdmh$_} from "@swc/helpers/_/_class_private_field_get";
import {_ as $7mdmh$_1} from "@swc/helpers/_/_class_private_field_init";
import {_ as $7mdmh$_2} from "@swc/helpers/_/_class_private_field_set";
import {mergeProps as $7mdmh$mergeProps, useSyncRef as $7mdmh$useSyncRef, useGlobalListeners as $7mdmh$useGlobalListeners, useEffectEvent as $7mdmh$useEffectEvent, nodeContains as $7mdmh$nodeContains, getEventTarget as $7mdmh$getEventTarget, getOwnerDocument as $7mdmh$getOwnerDocument, chain as $7mdmh$chain, isMac as $7mdmh$isMac, openLink as $7mdmh$openLink, isVirtualClick as $7mdmh$isVirtualClick, isVirtualPointerEvent as $7mdmh$isVirtualPointerEvent, focusWithoutScrolling as $7mdmh$focusWithoutScrolling, getOwnerWindow as $7mdmh$getOwnerWindow} from "@react-aria/utils";
import {flushSync as $7mdmh$flushSync} from "react-dom";
import {useContext as $7mdmh$useContext, useState as $7mdmh$useState, useRef as $7mdmh$useRef, useMemo as $7mdmh$useMemo, useEffect as $7mdmh$useEffect} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
function $f6c31cce2adf654f$var$usePressResponderContext(props) {
// Consume context from <PressResponder> and merge with props.
let context = (0, $7mdmh$useContext)((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5));
if (context) {
let { register: register, ...contextProps } = context;
props = (0, $7mdmh$mergeProps)(contextProps, props);
register();
}
(0, $7mdmh$useSyncRef)(context, props.ref);
return props;
}
var $f6c31cce2adf654f$var$_shouldStopPropagation = /*#__PURE__*/ new WeakMap();
class $f6c31cce2adf654f$var$PressEvent {
continuePropagation() {
(0, $7mdmh$_2)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, false);
}
get shouldStopPropagation() {
return (0, $7mdmh$_)(this, $f6c31cce2adf654f$var$_shouldStopPropagation);
}
constructor(type, pointerType, originalEvent, state){
(0, $7mdmh$_1)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, {
writable: true,
value: void 0
});
(0, $7mdmh$_2)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, true);
var _state_target;
let currentTarget = (_state_target = state === null || state === void 0 ? void 0 : state.target) !== null && _state_target !== void 0 ? _state_target : originalEvent.currentTarget;
const rect = currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.getBoundingClientRect();
let x, y = 0;
let clientX, clientY = null;
if (originalEvent.clientX != null && originalEvent.clientY != null) {
clientX = originalEvent.clientX;
clientY = originalEvent.clientY;
}
if (rect) {
if (clientX != null && clientY != null) {
x = clientX - rect.left;
y = clientY - rect.top;
} else {
x = rect.width / 2;
y = rect.height / 2;
}
}
this.type = type;
this.pointerType = pointerType;
this.target = originalEvent.currentTarget;
this.shiftKey = originalEvent.shiftKey;
this.metaKey = originalEvent.metaKey;
this.ctrlKey = originalEvent.ctrlKey;
this.altKey = originalEvent.altKey;
this.x = x;
this.y = y;
}
}
const $f6c31cce2adf654f$var$LINK_CLICKED = Symbol('linkClicked');
function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
let { onPress: onPress, onPressChange: onPressChange, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onClick: onClick, isDisabled: isDisabled, isPressed: isPressedProp, preventFocusOnPress: preventFocusOnPress, shouldCancelOnPointerExit: shouldCancelOnPointerExit, allowTextSelectionOnPress: allowTextSelectionOnPress, ref: domRef, ...domProps } = $f6c31cce2adf654f$var$usePressResponderContext(props);
let [isPressed, setPressed] = (0, $7mdmh$useState)(false);
let ref = (0, $7mdmh$useRef)({
isPressed: false,
ignoreEmulatedMouseEvents: false,
didFirePressStart: false,
isTriggeringEvent: false,
activePointerId: null,
target: null,
isOverTarget: false,
pointerType: null,
disposables: []
});
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = (0, $7mdmh$useGlobalListeners)();
let triggerPressStart = (0, $7mdmh$useEffectEvent)((originalEvent, pointerType)=>{
let state = ref.current;
if (isDisabled || state.didFirePressStart) return false;
let shouldStopPropagation = true;
state.isTriggeringEvent = true;
if (onPressStart) {
let event = new $f6c31cce2adf654f$var$PressEvent('pressstart', pointerType, originalEvent);
onPressStart(event);
shouldStopPropagation = event.shouldStopPropagation;
}
if (onPressChange) onPressChange(true);
state.isTriggeringEvent = false;
state.didFirePressStart = true;
setPressed(true);
return shouldStopPropagation;
});
let triggerPressEnd = (0, $7mdmh$useEffectEvent)((originalEvent, pointerType, wasPressed = true)=>{
let state = ref.current;
if (!state.didFirePressStart) return false;
state.didFirePressStart = false;
state.isTriggeringEvent = true;
let shouldStopPropagation = true;
if (onPressEnd) {
let event = new $f6c31cce2adf654f$var$PressEvent('pressend', pointerType, originalEvent);
onPressEnd(event);
shouldStopPropagation = event.shouldStopPropagation;
}
if (onPressChange) onPressChange(false);
setPressed(false);
if (onPress && wasPressed && !isDisabled) {
let event = new $f6c31cce2adf654f$var$PressEvent('press', pointerType, originalEvent);
onPress(event);
shouldStopPropagation && (shouldStopPropagation = event.shouldStopPropagation);
}
state.isTriggeringEvent = false;
return shouldStopPropagation;
});
let triggerPressUp = (0, $7mdmh$useEffectEvent)((originalEvent, pointerType)=>{
let state = ref.current;
if (isDisabled) return false;
if (onPressUp) {
state.isTriggeringEvent = true;
let event = new $f6c31cce2adf654f$var$PressEvent('pressup', pointerType, originalEvent);
onPressUp(event);
state.isTriggeringEvent = false;
return event.shouldStopPropagation;
}
return true;
});
let cancel = (0, $7mdmh$useEffectEvent)((e)=>{
let state = ref.current;
if (state.isPressed && state.target) {
if (state.didFirePressStart && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
state.isPressed = false;
state.isOverTarget = false;
state.activePointerId = null;
state.pointerType = null;
removeAllGlobalListeners();
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
for (let dispose of state.disposables)dispose();
state.disposables = [];
}
});
let cancelOnPointerExit = (0, $7mdmh$useEffectEvent)((e)=>{
if (shouldCancelOnPointerExit) cancel(e);
});
let triggerClick = (0, $7mdmh$useEffectEvent)((e)=>{
onClick === null || onClick === void 0 ? void 0 : onClick(e);
});
let triggerSyntheticClick = (0, $7mdmh$useEffectEvent)((e, target)=>{
// Some third-party libraries pass in onClick instead of onPress.
// Create a fake mouse event and trigger onClick as well.
// This matches the browser's native activation behavior for certain elements (e.g. button).
// https://html.spec.whatwg.org/#activation
// https://html.spec.whatwg.org/#fire-a-synthetic-pointer-event
if (onClick) {
let event = new MouseEvent('click', e);
(0, $8a9cb279dc87e130$export$c2b7abe5d61ec696)(event, target);
onClick((0, $8a9cb279dc87e130$export$525bc4921d56d4a)(event));
}
});
let pressProps = (0, $7mdmh$useMemo)(()=>{
let state = ref.current;
let pressProps = {
onKeyDown (e) {
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && (0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) {
var _state_metaKeyEvents;
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard((0, $7mdmh$getEventTarget)(e.nativeEvent), e.key)) e.preventDefault();
// If the event is repeating, it may have started on a different element
// after which focus moved to the current element. Ignore these events and
// only handle the first key down event.
let shouldStopPropagation = true;
if (!state.isPressed && !e.repeat) {
state.target = e.currentTarget;
state.isPressed = true;
state.pointerType = 'keyboard';
shouldStopPropagation = triggerPressStart(e, 'keyboard');
// Focus may move before the key up event, so register the event on the document
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
let originalTarget = e.currentTarget;
let pressUp = (e)=>{
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && (0, $7mdmh$nodeContains)(originalTarget, (0, $7mdmh$getEventTarget)(e)) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
};
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'keyup', (0, $7mdmh$chain)(pressUp, onKeyUp), true);
}
if (shouldStopPropagation) e.stopPropagation();
// Keep track of the keydown events that occur while the Meta (e.g. Command) key is held.
// macOS has a bug where keyup events are not fired while the Meta key is down.
// When the Meta key itself is released we will get an event for that, and we'll act as if
// all of these other keys were released as well.
// https://bugs.chromium.org/p/chromium/issues/detail?id=1393524
// https://bugs.webkit.org/show_bug.cgi?id=55291
// https://bugzilla.mozilla.org/show_bug.cgi?id=1299553
if (e.metaKey && (0, $7mdmh$isMac)()) (_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.set(e.key, e.nativeEvent);
} else if (e.key === 'Meta') state.metaKeyEvents = new Map();
},
onClick (e) {
if (e && !(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (e && e.button === 0 && !state.isTriggeringEvent && !(0, $7mdmh$openLink).isOpening) {
let shouldStopPropagation = true;
if (isDisabled) e.preventDefault();
// If triggered from a screen reader or by using element.click(),
// trigger as if it were a keyboard click.
if (!state.ignoreEmulatedMouseEvents && !state.isPressed && (state.pointerType === 'virtual' || (0, $7mdmh$isVirtualClick)(e.nativeEvent))) {
let stopPressStart = triggerPressStart(e, 'virtual');
let stopPressUp = triggerPressUp(e, 'virtual');
let stopPressEnd = triggerPressEnd(e, 'virtual');
triggerClick(e);
shouldStopPropagation = stopPressStart && stopPressUp && stopPressEnd;
} else if (state.isPressed && state.pointerType !== 'keyboard') {
let pointerType = state.pointerType || e.nativeEvent.pointerType || 'virtual';
shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createEvent(e.currentTarget, e), pointerType, true);
state.isOverTarget = false;
triggerClick(e);
cancel(e);
}
state.ignoreEmulatedMouseEvents = false;
if (shouldStopPropagation) e.stopPropagation();
}
}
};
let onKeyUp = (e)=>{
var _state_metaKeyEvents;
if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
var _state_metaKeyEvents1;
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard((0, $7mdmh$getEventTarget)(e), e.key)) e.preventDefault();
let target = (0, $7mdmh$getEventTarget)(e);
let wasPressed = (0, $7mdmh$nodeContains)(state.target, (0, $7mdmh$getEventTarget)(e));
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
if (wasPressed) triggerSyntheticClick(e, state.target);
removeAllGlobalListeners();
// If a link was triggered with a key other than Enter, open the URL ourselves.
// This means the link has a role override, and the default browser behavior
// only applies when using the Enter key.
if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && (0, $7mdmh$nodeContains)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
// Store a hidden property on the event so we only trigger link click once,
// even if there are multiple usePress instances attached to the element.
e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
(0, $7mdmh$openLink)(state.target, e, false);
}
state.isPressed = false;
(_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
} else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
var _state_target;
// If we recorded keydown events that occurred while the Meta key was pressed,
// and those haven't received keyup events already, fire keyup events ourselves.
// See comment above for more info about the macOS bug causing this.
let events = state.metaKeyEvents;
state.metaKeyEvents = undefined;
for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
}
};
if (typeof PointerEvent !== 'undefined') {
pressProps.onPointerDown = (e)=>{
// Only handle left clicks, and ignore events that bubbled through portals.
if (e.button !== 0 || !(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
// iOS safari fires pointer events from VoiceOver with incorrect coordinates/target.
// Ignore and let the onClick handler take care of it instead.
// https://bugs.webkit.org/show_bug.cgi?id=222627
// https://bugs.webkit.org/show_bug.cgi?id=223202
if ((0, $7mdmh$isVirtualPointerEvent)(e.nativeEvent)) {
state.pointerType = 'virtual';
return;
}
state.pointerType = e.pointerType;
let shouldStopPropagation = true;
if (!state.isPressed) {
state.isPressed = true;
state.isOverTarget = true;
state.activePointerId = e.pointerId;
state.target = e.currentTarget;
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
shouldStopPropagation = triggerPressStart(e, state.pointerType);
// Release pointer capture so that touch interactions can leave the original target.
// This enables onPointerLeave and onPointerEnter to fire.
let target = (0, $7mdmh$getEventTarget)(e.nativeEvent);
if ('releasePointerCapture' in target) target.releasePointerCapture(e.pointerId);
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointerup', onPointerUp, false);
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointercancel', onPointerCancel, false);
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onMouseDown = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (e.button === 0) {
if (preventFocusOnPress) {
let dispose = (0, $8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
if (dispose) state.disposables.push(dispose);
}
e.stopPropagation();
}
};
pressProps.onPointerUp = (e)=>{
// iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent)) || state.pointerType === 'virtual') return;
// Only handle left clicks
if (e.button === 0) triggerPressUp(e, state.pointerType || e.pointerType);
};
pressProps.onPointerEnter = (e)=>{
if (e.pointerId === state.activePointerId && state.target && !state.isOverTarget && state.pointerType != null) {
state.isOverTarget = true;
triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
}
};
pressProps.onPointerLeave = (e)=>{
if (e.pointerId === state.activePointerId && state.target && state.isOverTarget && state.pointerType != null) {
state.isOverTarget = false;
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
cancelOnPointerExit(e);
}
};
let onPointerUp = (e)=>{
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
if ((0, $7mdmh$nodeContains)(state.target, (0, $7mdmh$getEventTarget)(e)) && state.pointerType != null) {
// Wait for onClick to fire onPress. This avoids browser issues when the DOM
// is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
// https://github.com/adobe/react-spectrum/issues/1513
// https://issues.chromium.org/issues/40732224
// However, iOS and Android do not focus or fire onClick after a long press.
// We work around this by triggering a click ourselves after a timeout.
// This timeout is canceled during the click event in case the real one fires first.
// The timeout must be at least 32ms, because Safari on iOS delays the click event on
// non-form elements without certain ARIA roles (for hover emulation).
// https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
let clicked = false;
let timeout = setTimeout(()=>{
if (state.isPressed && state.target instanceof HTMLElement) {
if (clicked) cancel(e);
else {
(0, $7mdmh$focusWithoutScrolling)(state.target);
state.target.click();
}
}
}, 80);
// Use a capturing listener to track if a click occurred.
// If stopPropagation is called it may never reach our handler.
addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
state.disposables.push(()=>clearTimeout(timeout));
} else cancel(e);
// Ignore subsequent onPointerLeave event before onClick on touch devices.
state.isOverTarget = false;
}
};
let onPointerCancel = (e)=>{
cancel(e);
};
pressProps.onDragStart = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
// Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.
cancel(e);
};
} else if (process.env.NODE_ENV === 'test') {
// NOTE: this fallback branch is entirely used by unit tests.
// All browsers now support pointer events, but JSDOM still does not.
pressProps.onMouseDown = (e)=>{
// Only handle left clicks
if (e.button !== 0 || !(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (state.ignoreEmulatedMouseEvents) {
e.stopPropagation();
return;
}
state.isPressed = true;
state.isOverTarget = true;
state.target = e.currentTarget;
state.pointerType = (0, $7mdmh$isVirtualClick)(e.nativeEvent) ? 'virtual' : 'mouse';
// Flush sync so that focus moved during react re-renders occurs before we yield back to the browser.
let shouldStopPropagation = (0, $7mdmh$flushSync)(()=>triggerPressStart(e, state.pointerType));
if (shouldStopPropagation) e.stopPropagation();
if (preventFocusOnPress) {
let dispose = (0, $8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
if (dispose) state.disposables.push(dispose);
}
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'mouseup', onMouseUp, false);
};
pressProps.onMouseEnter = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
let shouldStopPropagation = true;
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
state.isOverTarget = true;
shouldStopPropagation = triggerPressStart(e, state.pointerType);
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onMouseLeave = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
let shouldStopPropagation = true;
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
state.isOverTarget = false;
shouldStopPropagation = triggerPressEnd(e, state.pointerType, false);
cancelOnPointerExit(e);
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onMouseUp = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (!state.ignoreEmulatedMouseEvents && e.button === 0) triggerPressUp(e, state.pointerType || 'mouse');
};
let onMouseUp = (e)=>{
// Only handle left clicks
if (e.button !== 0) return;
if (state.ignoreEmulatedMouseEvents) {
state.ignoreEmulatedMouseEvents = false;
return;
}
if (state.target && state.target.contains(e.target) && state.pointerType != null) ;
else cancel(e);
state.isOverTarget = false;
};
pressProps.onTouchStart = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e.nativeEvent);
if (!touch) return;
state.activePointerId = touch.identifier;
state.ignoreEmulatedMouseEvents = true;
state.isOverTarget = true;
state.isPressed = true;
state.target = e.currentTarget;
state.pointerType = 'touch';
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
let shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
if (shouldStopPropagation) e.stopPropagation();
addGlobalListener((0, $7mdmh$getOwnerWindow)(e.currentTarget), 'scroll', onScroll, true);
};
pressProps.onTouchMove = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (!state.isPressed) {
e.stopPropagation();
return;
}
let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
let shouldStopPropagation = true;
if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget)) {
if (!state.isOverTarget && state.pointerType != null) {
state.isOverTarget = true;
shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
}
} else if (state.isOverTarget && state.pointerType != null) {
state.isOverTarget = false;
shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
cancelOnPointerExit($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onTouchEnd = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (!state.isPressed) {
e.stopPropagation();
return;
}
let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
let shouldStopPropagation = true;
if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget) && state.pointerType != null) {
triggerPressUp($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
triggerSyntheticClick(e.nativeEvent, state.target);
} else if (state.isOverTarget && state.pointerType != null) shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
if (shouldStopPropagation) e.stopPropagation();
state.isPressed = false;
state.activePointerId = null;
state.isOverTarget = false;
state.ignoreEmulatedMouseEvents = true;
if (state.target && !allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
removeAllGlobalListeners();
};
pressProps.onTouchCancel = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
e.stopPropagation();
if (state.isPressed) cancel($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
};
let onScroll = (e)=>{
if (state.isPressed && (0, $7mdmh$nodeContains)((0, $7mdmh$getEventTarget)(e), state.target)) cancel({
currentTarget: state.target,
shiftKey: false,
ctrlKey: false,
metaKey: false,
altKey: false
});
};
pressProps.onDragStart = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
cancel(e);
};
}
return pressProps;
}, [
addGlobalListener,
isDisabled,
preventFocusOnPress,
removeAllGlobalListeners,
allowTextSelectionOnPress,
cancel,
cancelOnPointerExit,
triggerPressEnd,
triggerPressStart,
triggerPressUp,
triggerClick,
triggerSyntheticClick
]);
// Avoid onClick delay for double tap to zoom by default.
(0, $7mdmh$useEffect)(()=>{
let element = domRef === null || domRef === void 0 ? void 0 : domRef.current;
if (element && element instanceof (0, $7mdmh$getOwnerWindow)(element).Element) {
// Only apply touch-action if not already set by another CSS rule.
let style = (0, $7mdmh$getOwnerWindow)(element).getComputedStyle(element);
if (style.touchAction === 'auto') // touchAction: 'manipulation' is supposed to be equivalent, but in
// Safari it causes onPointerCancel not to fire on scroll.
// https://bugs.webkit.org/show_bug.cgi?id=240917
element.style.touchAction = 'pan-x pan-y pinch-zoom';
}
}, [
domRef
]);
// Remove user-select: none in case component unmounts immediately after pressStart
(0, $7mdmh$useEffect)(()=>{
let state = ref.current;
return ()=>{
var _state_target;
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)((_state_target = state.target) !== null && _state_target !== void 0 ? _state_target : undefined);
for (let dispose of state.disposables)dispose();
state.disposables = [];
};
}, [
allowTextSelectionOnPress
]);
return {
isPressed: isPressedProp || isPressed,
pressProps: (0, $7mdmh$mergeProps)(domProps, pressProps)
};
}
function $f6c31cce2adf654f$var$isHTMLAnchorLink(target) {
return target.tagName === 'A' && target.hasAttribute('href');
}
function $f6c31cce2adf654f$var$isValidKeyboardEvent(event, currentTarget) {
const { key: key, code: code } = event;
const element = currentTarget;
const role = element.getAttribute('role');
// Accessibility for keyboards. Space and Enter only.
// "Spacebar" is for IE 11
return (key === 'Enter' || key === ' ' || key === 'Spacebar' || code === 'Space') && !(element instanceof (0, $7mdmh$getOwnerWindow)(element).HTMLInputElement && !$f6c31cce2adf654f$var$isValidInputKey(element, key) || element instanceof (0, $7mdmh$getOwnerWindow)(element).HTMLTextAreaElement || element.isContentEditable) && // Links should only trigger with Enter key
!((role === 'link' || !role && $f6c31cce2adf654f$var$isHTMLAnchorLink(element)) && key !== 'Enter');
}
function $f6c31cce2adf654f$var$getTouchFromEvent(event) {
const { targetTouches: targetTouches } = event;
if (targetTouches.length > 0) return targetTouches[0];
return null;
}
function $f6c31cce2adf654f$var$getTouchById(event, pointerId) {
const changedTouches = event.changedTouches;
for(let i = 0; i < changedTouches.length; i++){
const touch = changedTouches[i];
if (touch.identifier === pointerId) return touch;
}
return null;
}
function $f6c31cce2adf654f$var$createTouchEvent(target, e) {
let clientX = 0;
let clientY = 0;
if (e.targetTouches && e.targetTouches.length === 1) {
clientX = e.targetTouches[0].clientX;
clientY = e.targetTouches[0].clientY;
}
return {
currentTarget: target,
shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey,
metaKey: e.metaKey,
altKey: e.altKey,
clientX: clientX,
clientY: clientY
};
}
function $f6c31cce2adf654f$var$createEvent(target, e) {
let clientX = e.clientX;
let clientY = e.clientY;
return {
currentTarget: target,
shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey,
metaKey: e.metaKey,
altKey: e.altKey,
clientX: clientX,
clientY: clientY
};
}
function $f6c31cce2adf654f$var$getPointClientRect(point) {
let offsetX = 0;
let offsetY = 0;
if (point.width !== undefined) offsetX = point.width / 2;
else if (point.radiusX !== undefined) offsetX = point.radiusX;
if (point.height !== undefined) offsetY = point.height / 2;
else if (point.radiusY !== undefined) offsetY = point.radiusY;
return {
top: point.clientY - offsetY,
right: point.clientX + offsetX,
bottom: point.clientY + offsetY,
left: point.clientX - offsetX
};
}
function $f6c31cce2adf654f$var$areRectanglesOverlapping(a, b) {
// check if they cannot overlap on x axis
if (a.left > b.right || b.left > a.right) return false;
// check if they cannot overlap on y axis
if (a.top > b.bottom || b.top > a.bottom) return false;
return true;
}
function $f6c31cce2adf654f$var$isOverTarget(point, target) {
let rect = target.getBoundingClientRect();
let pointRect = $f6c31cce2adf654f$var$getPointClientRect(point);
return $f6c31cce2adf654f$var$areRectanglesOverlapping(rect, pointRect);
}
function $f6c31cce2adf654f$var$shouldPreventDefaultUp(target) {
if (target instanceof HTMLInputElement) return false;
if (target instanceof HTMLButtonElement) return target.type !== 'submit' && target.type !== 'reset';
if ($f6c31cce2adf654f$var$isHTMLAnchorLink(target)) return false;
return true;
}
function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target, key) {
if (target instanceof HTMLInputElement) return !$f6c31cce2adf654f$var$isValidInputKey(target, key);
return $f6c31cce2adf654f$var$shouldPreventDefaultUp(target);
}
const $f6c31cce2adf654f$var$nonTextInputTypes = new Set([
'checkbox',
'radio',
'range',
'color',
'file',
'image',
'button',
'submit',
'reset'
]);
function $f6c31cce2adf654f$var$isValidInputKey(target, key) {
// Only space should toggle checkboxes and radios, not enter.
return target.type === 'checkbox' || target.type === 'radio' ? key === ' ' : $f6c31cce2adf654f$var$nonTextInputTypes.has(target.type);
}
export {$f6c31cce2adf654f$export$45712eceda6fad21 as usePress};
//# sourceMappingURL=usePress.module.js.map
webpack://frontend-tpt/../../node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js
function _class_apply_descriptor_get(receiver, descriptor) {
if (descriptor.get) return descriptor.get.call(receiver);
return descriptor.value;
}
export { _class_apply_descriptor_get as _ };
webpack://frontend-tpt/../../node_modules/@swc/helpers/esm/_class_private_field_get.js
import { _ as _class_apply_descriptor_get } from "./_class_apply_descriptor_get.js";
import { _ as _class_extract_field_descriptor } from "./_class_extract_field_descriptor.js";
function _class_private_field_get(receiver, privateMap) {
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
return _class_apply_descriptor_get(receiver, descriptor);
}
export { _class_private_field_get as _ };
webpack://frontend-tpt/../../node_modules/@swc/helpers/esm/_class_private_field_init.js
import { _ as _check_private_redeclaration } from "./_check_private_redeclaration.js";
function _class_private_field_init(obj, privateMap, value) {
_check_private_redeclaration(obj, privateMap);
privateMap.set(obj, value);
}
export { _class_private_field_init as _ };
webpack://frontend-tpt/../../node_modules/@swc/helpers/esm/_check_private_redeclaration.js
function _check_private_redeclaration(obj, privateCollection) {
if (privateCollection.has(obj)) {
throw new TypeError("Cannot initialize the same private elements twice on an object");
}
}
export { _check_private_redeclaration as _ };
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/useFocusVisible.mjs
import {ignoreFocusEvent as $8a9cb279dc87e130$export$fda7da73ab5d4c48} from "./utils.mjs";
import {isMac as $28AnR$isMac, isVirtualClick as $28AnR$isVirtualClick, getOwnerWindow as $28AnR$getOwnerWindow, getOwnerDocument as $28AnR$getOwnerDocument} from "@react-aria/utils";
import {useState as $28AnR$useState, useEffect as $28AnR$useEffect} from "react";
import {useIsSSR as $28AnR$useIsSSR} from "@react-aria/ssr";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
let $507fabe10e71c6fb$var$currentModality = null;
let $507fabe10e71c6fb$var$changeHandlers = new Set();
let $507fabe10e71c6fb$export$d90243b58daecda7 = new Map(); // We use a map here to support setting event listeners across multiple document objects.
let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
// Only Tab or Esc keys will make focus visible on text input elements
const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
Tab: true,
Escape: true
};
function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
for (let handler of $507fabe10e71c6fb$var$changeHandlers)handler(modality, e);
}
/**
* Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus styles visible.
*/ function $507fabe10e71c6fb$var$isValidKey(e) {
// Control and Shift keys trigger when navigating back to the tab with keyboard.
return !(e.metaKey || !(0, $28AnR$isMac)() && e.altKey || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta');
}
function $507fabe10e71c6fb$var$handleKeyboardEvent(e) {
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
if ($507fabe10e71c6fb$var$isValidKey(e)) {
$507fabe10e71c6fb$var$currentModality = 'keyboard';
$507fabe10e71c6fb$var$triggerChangeHandlers('keyboard', e);
}
}
function $507fabe10e71c6fb$var$handlePointerEvent(e) {
$507fabe10e71c6fb$var$currentModality = 'pointer';
if (e.type === 'mousedown' || e.type === 'pointerdown') {
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
$507fabe10e71c6fb$var$triggerChangeHandlers('pointer', e);
}
}
function $507fabe10e71c6fb$var$handleClickEvent(e) {
if ((0, $28AnR$isVirtualClick)(e)) {
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
$507fabe10e71c6fb$var$currentModality = 'virtual';
}
}
function $507fabe10e71c6fb$var$handleFocusEvent(e) {
// Firefox fires two extra focus events when the user first clicks into an iframe:
// first on the window, then on the document. We ignore these events so they don't
// cause keyboard focus rings to appear.
if (e.target === window || e.target === document || (0, $8a9cb279dc87e130$export$fda7da73ab5d4c48) || !e.isTrusted) return;
// If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.
// This occurs, for example, when navigating a form with the next/previous buttons on iOS.
if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
$507fabe10e71c6fb$var$currentModality = 'virtual';
$507fabe10e71c6fb$var$triggerChangeHandlers('virtual', e);
}
$507fabe10e71c6fb$var$hasEventBeforeFocus = false;
$507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
}
function $507fabe10e71c6fb$var$handleWindowBlur() {
if (0, $8a9cb279dc87e130$export$fda7da73ab5d4c48) return;
// When the window is blurred, reset state. This is necessary when tabbing out of the window,
// for example, since a subsequent focus event won't be fired.
$507fabe10e71c6fb$var$hasEventBeforeFocus = false;
$507fabe10e71c6fb$var$hasBlurredWindowRecently = true;
}
/**
* Setup global event listeners to control when keyboard focus style should be visible.
*/ function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
if (typeof window === 'undefined' || $507fabe10e71c6fb$export$d90243b58daecda7.get((0, $28AnR$getOwnerWindow)(element))) return;
const windowObject = (0, $28AnR$getOwnerWindow)(element);
const documentObject = (0, $28AnR$getOwnerDocument)(element);
// Programmatic focus() calls shouldn't affect the current input modality.
// However, we need to detect other cases when a focus event occurs without
// a preceding user event (e.g. screen reader focus). Overriding the focus
// method on HTMLElement.prototype is a bit hacky, but works.
let focus = windowObject.HTMLElement.prototype.focus;
windowObject.HTMLElement.prototype.focus = function() {
$507fabe10e71c6fb$var$hasEventBeforeFocus = true;
focus.apply(this, arguments);
};
documentObject.addEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
documentObject.addEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
documentObject.addEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
// Register focus events on the window so they are sure to happen
// before React's event listeners (registered on the document).
windowObject.addEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
windowObject.addEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
if (typeof PointerEvent !== 'undefined') {
documentObject.addEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
} else if (process.env.NODE_ENV === 'test') {
documentObject.addEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.addEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
}
// Add unmount handler
windowObject.addEventListener('beforeunload', ()=>{
$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element);
}, {
once: true
});
$507fabe10e71c6fb$export$d90243b58daecda7.set(windowObject, {
focus: focus
});
}
const $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener)=>{
const windowObject = (0, $28AnR$getOwnerWindow)(element);
const documentObject = (0, $28AnR$getOwnerDocument)(element);
if (loadListener) documentObject.removeEventListener('DOMContentLoaded', loadListener);
if (!$507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject)) return;
windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus;
documentObject.removeEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
documentObject.removeEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
documentObject.removeEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
windowObject.removeEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
windowObject.removeEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
if (typeof PointerEvent !== 'undefined') {
documentObject.removeEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.removeEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.removeEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
} else if (process.env.NODE_ENV === 'test') {
documentObject.removeEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.removeEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
documentObject.removeEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
}
$507fabe10e71c6fb$export$d90243b58daecda7.delete(windowObject);
};
function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
const documentObject = (0, $28AnR$getOwnerDocument)(element);
let loadListener;
if (documentObject.readyState !== 'loading') $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
else {
loadListener = ()=>{
$507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
};
documentObject.addEventListener('DOMContentLoaded', loadListener);
}
return ()=>$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener);
}
// Server-side rendering does not have the document object defined
// eslint-disable-next-line no-restricted-globals
if (typeof document !== 'undefined') $507fabe10e71c6fb$export$2f1888112f558a7d();
function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
return $507fabe10e71c6fb$var$currentModality !== 'pointer';
}
function $507fabe10e71c6fb$export$630ff653c5ada6a9() {
return $507fabe10e71c6fb$var$currentModality;
}
function $507fabe10e71c6fb$export$8397ddfc504fdb9a(modality) {
$507fabe10e71c6fb$var$currentModality = modality;
$507fabe10e71c6fb$var$triggerChangeHandlers(modality, null);
}
function $507fabe10e71c6fb$export$98e20ec92f614cfe() {
$507fabe10e71c6fb$var$setupGlobalFocusEvents();
let [modality, setModality] = (0, $28AnR$useState)($507fabe10e71c6fb$var$currentModality);
(0, $28AnR$useEffect)(()=>{
let handler = ()=>{
setModality($507fabe10e71c6fb$var$currentModality);
};
$507fabe10e71c6fb$var$changeHandlers.add(handler);
return ()=>{
$507fabe10e71c6fb$var$changeHandlers.delete(handler);
};
}, []);
return (0, $28AnR$useIsSSR)() ? null : modality;
}
const $507fabe10e71c6fb$var$nonTextInputTypes = new Set([
'checkbox',
'radio',
'range',
'color',
'file',
'image',
'button',
'submit',
'reset'
]);
/**
* If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that
* focus visible style can be properly set.
*/ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
let document1 = (0, $28AnR$getOwnerDocument)(e === null || e === void 0 ? void 0 : e.target);
const IHTMLInputElement = typeof window !== 'undefined' ? (0, $28AnR$getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).HTMLInputElement : HTMLInputElement;
const IHTMLTextAreaElement = typeof window !== 'undefined' ? (0, $28AnR$getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).HTMLTextAreaElement : HTMLTextAreaElement;
const IHTMLElement = typeof window !== 'undefined' ? (0, $28AnR$getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).HTMLElement : HTMLElement;
const IKeyboardEvent = typeof window !== 'undefined' ? (0, $28AnR$getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).KeyboardEvent : KeyboardEvent;
// For keyboard events that occur on a non-input element that will move focus into input element (aka ArrowLeft going from Datepicker button to the main input group)
// we need to rely on the user passing isTextInput into here. This way we can skip toggling focus visiblity for said input element
isTextInput = isTextInput || document1.activeElement instanceof IHTMLInputElement && !$507fabe10e71c6fb$var$nonTextInputTypes.has(document1.activeElement.type) || document1.activeElement instanceof IHTMLTextAreaElement || document1.activeElement instanceof IHTMLElement && document1.activeElement.isContentEditable;
return !(isTextInput && modality === 'keyboard' && e instanceof IKeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
}
function $507fabe10e71c6fb$export$ffd9e5021c1fb2d6(props = {}) {
let { isTextInput: isTextInput, autoFocus: autoFocus } = props;
let [isFocusVisibleState, setFocusVisible] = (0, $28AnR$useState)(autoFocus || $507fabe10e71c6fb$export$b9b3dfddab17db27());
$507fabe10e71c6fb$export$ec71b4b83ac08ec3((isFocusVisible)=>{
setFocusVisible(isFocusVisible);
}, [
isTextInput
], {
isTextInput: isTextInput
});
return {
isFocusVisible: isFocusVisibleState
};
}
function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
$507fabe10e71c6fb$var$setupGlobalFocusEvents();
(0, $28AnR$useEffect)(()=>{
let handler = (modality, e)=>{
// We want to early return for any keyboard events that occur inside text inputs EXCEPT for Tab and Escape
if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e)) return;
fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
};
$507fabe10e71c6fb$var$changeHandlers.add(handler);
return ()=>{
$507fabe10e71c6fb$var$changeHandlers.delete(handler);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, deps);
}
export {$507fabe10e71c6fb$export$d90243b58daecda7 as hasSetupGlobalListeners, $507fabe10e71c6fb$export$2f1888112f558a7d as addWindowFocusTracking, $507fabe10e71c6fb$export$b9b3dfddab17db27 as isFocusVisible, $507fabe10e71c6fb$export$630ff653c5ada6a9 as getInteractionModality, $507fabe10e71c6fb$export$8397ddfc504fdb9a as setInteractionModality, $507fabe10e71c6fb$export$98e20ec92f614cfe as useInteractionModality, $507fabe10e71c6fb$export$ffd9e5021c1fb2d6 as useFocusVisible, $507fabe10e71c6fb$export$ec71b4b83ac08ec3 as useFocusVisibleListener};
//# sourceMappingURL=useFocusVisible.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/useFocus.mjs
import {useSyntheticBlurEvent as $8a9cb279dc87e130$export$715c682d09d639cc} from "./utils.mjs";
import {useCallback as $hf0lj$useCallback} from "react";
import {getOwnerDocument as $hf0lj$getOwnerDocument, getActiveElement as $hf0lj$getActiveElement, getEventTarget as $hf0lj$getEventTarget} from "@react-aria/utils";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
let { isDisabled: isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange: onFocusChange } = props;
const onBlur = (0, $hf0lj$useCallback)((e)=>{
if (e.target === e.currentTarget) {
if (onBlurProp) onBlurProp(e);
if (onFocusChange) onFocusChange(false);
return true;
}
}, [
onBlurProp,
onFocusChange
]);
const onSyntheticFocus = (0, $8a9cb279dc87e130$export$715c682d09d639cc)(onBlur);
const onFocus = (0, $hf0lj$useCallback)((e)=>{
// Double check that document.activeElement actually matches e.target in case a previously chained
// focus handler already moved focus somewhere else.
const ownerDocument = (0, $hf0lj$getOwnerDocument)(e.target);
const activeElement = ownerDocument ? (0, $hf0lj$getActiveElement)(ownerDocument) : (0, $hf0lj$getActiveElement)();
if (e.target === e.currentTarget && activeElement === (0, $hf0lj$getEventTarget)(e.nativeEvent)) {
if (onFocusProp) onFocusProp(e);
if (onFocusChange) onFocusChange(true);
onSyntheticFocus(e);
}
}, [
onFocusChange,
onFocusProp,
onSyntheticFocus
]);
return {
focusProps: {
onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : undefined,
onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : undefined
}
};
}
export {$a1ea59d68270f0dd$export$f8168d8dd8fd66e6 as useFocus};
//# sourceMappingURL=useFocus.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/createEventHandler.mjs
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $93925083ecbb358c$export$48d1ea6320830260(handler) {
if (!handler) return undefined;
let shouldStopPropagation = true;
return (e)=>{
let event = {
...e,
preventDefault () {
e.preventDefault();
},
isDefaultPrevented () {
return e.isDefaultPrevented();
},
stopPropagation () {
if (shouldStopPropagation && process.env.NODE_ENV !== 'production') console.error('stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.');
else shouldStopPropagation = true;
},
continuePropagation () {
shouldStopPropagation = false;
},
isPropagationStopped () {
return shouldStopPropagation;
}
};
handler(event);
if (shouldStopPropagation) e.stopPropagation();
};
}
export {$93925083ecbb358c$export$48d1ea6320830260 as createEventHandler};
//# sourceMappingURL=createEventHandler.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/useFocusable.mjs
import {focusSafely as $3ad3f6e1647bc98d$export$80f3e147d781571c} from "./focusSafely.mjs";
import {useFocus as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6} from "./useFocus.mjs";
import {useKeyboard as $46d819fcbaf35654$export$8f71654801c2f7cd} from "./useKeyboard.mjs";
import {useSyncRef as $fcPuG$useSyncRef, useObjectRef as $fcPuG$useObjectRef, mergeProps as $fcPuG$mergeProps, getOwnerWindow as $fcPuG$getOwnerWindow, isFocusable as $fcPuG$isFocusable, mergeRefs as $fcPuG$mergeRefs} from "@react-aria/utils";
import $fcPuG$react, {useContext as $fcPuG$useContext, useRef as $fcPuG$useRef, useEffect as $fcPuG$useEffect, forwardRef as $fcPuG$forwardRef} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let $f645667febf57a63$export$f9762fab77588ecb = /*#__PURE__*/ (0, $fcPuG$react).createContext(null);
function $f645667febf57a63$var$useFocusableContext(ref) {
let context = (0, $fcPuG$useContext)($f645667febf57a63$export$f9762fab77588ecb) || {};
(0, $fcPuG$useSyncRef)(context, ref);
// eslint-disable-next-line
let { ref: _, ...otherProps } = context;
return otherProps;
}
const $f645667febf57a63$export$13f3202a3e5ddd5 = /*#__PURE__*/ (0, $fcPuG$react).forwardRef(function FocusableProvider(props, ref) {
let { children: children, ...otherProps } = props;
let objRef = (0, $fcPuG$useObjectRef)(ref);
let context = {
...otherProps,
ref: objRef
};
return /*#__PURE__*/ (0, $fcPuG$react).createElement($f645667febf57a63$export$f9762fab77588ecb.Provider, {
value: context
}, children);
});
function $f645667febf57a63$export$4c014de7c8940b4c(props, domRef) {
let { focusProps: focusProps } = (0, $a1ea59d68270f0dd$export$f8168d8dd8fd66e6)(props);
let { keyboardProps: keyboardProps } = (0, $46d819fcbaf35654$export$8f71654801c2f7cd)(props);
let interactions = (0, $fcPuG$mergeProps)(focusProps, keyboardProps);
let domProps = $f645667febf57a63$var$useFocusableContext(domRef);
let interactionProps = props.isDisabled ? {} : domProps;
let autoFocusRef = (0, $fcPuG$useRef)(props.autoFocus);
(0, $fcPuG$useEffect)(()=>{
if (autoFocusRef.current && domRef.current) (0, $3ad3f6e1647bc98d$export$80f3e147d781571c)(domRef.current);
autoFocusRef.current = false;
}, [
domRef
]);
// Always set a tabIndex so that Safari allows focusing native buttons and inputs.
let tabIndex = props.excludeFromTabOrder ? -1 : 0;
if (props.isDisabled) tabIndex = undefined;
return {
focusableProps: (0, $fcPuG$mergeProps)({
...interactions,
tabIndex: tabIndex
}, interactionProps)
};
}
const $f645667febf57a63$export$35a3bebf7ef2d934 = /*#__PURE__*/ (0, $fcPuG$forwardRef)(({ children: children, ...props }, ref)=>{
ref = (0, $fcPuG$useObjectRef)(ref);
let { focusableProps: focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c(props, ref);
let child = (0, $fcPuG$react).Children.only(children);
(0, $fcPuG$useEffect)(()=>{
if (process.env.NODE_ENV === 'production') return;
let el = ref.current;
if (!el || !(el instanceof (0, $fcPuG$getOwnerWindow)(el).Element)) {
console.error('<Focusable> child must forward its ref to a DOM element.');
return;
}
if (!props.isDisabled && !(0, $fcPuG$isFocusable)(el)) {
console.warn('<Focusable> child must be focusable. Please ensure the tabIndex prop is passed through.');
return;
}
if (el.localName !== 'button' && el.localName !== 'input' && el.localName !== 'select' && el.localName !== 'textarea' && el.localName !== 'a' && el.localName !== 'area' && el.localName !== 'summary' && el.localName !== 'img' && el.localName !== 'svg') {
let role = el.getAttribute('role');
if (!role) console.warn('<Focusable> child must have an interactive ARIA role.');
else if (// https://w3c.github.io/aria/#widget_roles
role !== 'application' && role !== 'button' && role !== 'checkbox' && role !== 'combobox' && role !== 'gridcell' && role !== 'link' && role !== 'menuitem' && role !== 'menuitemcheckbox' && role !== 'menuitemradio' && role !== 'option' && role !== 'radio' && role !== 'searchbox' && role !== 'separator' && role !== 'slider' && role !== 'spinbutton' && role !== 'switch' && role !== 'tab' && role !== 'tabpanel' && role !== 'textbox' && role !== 'treeitem' && // aria-describedby is also announced on these roles
role !== 'img' && role !== 'meter' && role !== 'progressbar') console.warn(`<Focusable> child must have an interactive ARIA role. Got "${role}".`);
}
}, [
ref,
props.isDisabled
]);
// @ts-ignore
let childRef = parseInt((0, $fcPuG$react).version, 10) < 19 ? child.ref : child.props.ref;
return /*#__PURE__*/ (0, $fcPuG$react).cloneElement(child, {
...(0, $fcPuG$mergeProps)(focusableProps, child.props),
// @ts-ignore
ref: (0, $fcPuG$mergeRefs)(childRef, ref)
});
});
export {$f645667febf57a63$export$f9762fab77588ecb as FocusableContext, $f645667febf57a63$export$13f3202a3e5ddd5 as FocusableProvider, $f645667febf57a63$export$4c014de7c8940b4c as useFocusable, $f645667febf57a63$export$35a3bebf7ef2d934 as Focusable};
//# sourceMappingURL=useFocusable.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/useKeyboard.mjs
import {createEventHandler as $93925083ecbb358c$export$48d1ea6320830260} from "./createEventHandler.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $46d819fcbaf35654$export$8f71654801c2f7cd(props) {
return {
keyboardProps: props.isDisabled ? {} : {
onKeyDown: (0, $93925083ecbb358c$export$48d1ea6320830260)(props.onKeyDown),
onKeyUp: (0, $93925083ecbb358c$export$48d1ea6320830260)(props.onKeyUp)
}
};
}
export {$46d819fcbaf35654$export$8f71654801c2f7cd as useKeyboard};
//# sourceMappingURL=useKeyboard.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/focusSafely.mjs
import {getInteractionModality as $507fabe10e71c6fb$export$630ff653c5ada6a9} from "./useFocusVisible.mjs";
import {getOwnerDocument as $k50bp$getOwnerDocument, getActiveElement as $k50bp$getActiveElement, runAfterTransition as $k50bp$runAfterTransition, focusWithoutScrolling as $k50bp$focusWithoutScrolling} from "@react-aria/utils";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $3ad3f6e1647bc98d$export$80f3e147d781571c(element) {
// If the user is interacting with a virtual cursor, e.g. screen reader, then
// wait until after any animated transitions that are currently occurring on
// the page before shifting focus. This avoids issues with VoiceOver on iOS
// causing the page to scroll when moving focus if the element is transitioning
// from off the screen.
const ownerDocument = (0, $k50bp$getOwnerDocument)(element);
const activeElement = (0, $k50bp$getActiveElement)(ownerDocument);
if ((0, $507fabe10e71c6fb$export$630ff653c5ada6a9)() === 'virtual') {
let lastFocusedElement = activeElement;
(0, $k50bp$runAfterTransition)(()=>{
// If focus did not move and the element is still in the document, focus it.
if ((0, $k50bp$getActiveElement)(ownerDocument) === lastFocusedElement && element.isConnected) (0, $k50bp$focusWithoutScrolling)(element);
});
} else (0, $k50bp$focusWithoutScrolling)(element);
}
export {$3ad3f6e1647bc98d$export$80f3e147d781571c as focusSafely};
//# sourceMappingURL=focusSafely.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/button/dist/useButton.mjs
import {mergeProps as $bwqiF$mergeProps, filterDOMProps as $bwqiF$filterDOMProps} from "@react-aria/utils";
import {usePress as $bwqiF$usePress, useFocusable as $bwqiF$useFocusable} from "@react-aria/interactions";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented
allowFocusWhenDisabled, onClick: onClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
let additionalProps;
if (elementType === 'button') additionalProps = {
type: type,
disabled: isDisabled
};
else additionalProps = {
role: 'button',
href: elementType === 'a' && !isDisabled ? href : undefined,
target: elementType === 'a' ? target : undefined,
type: elementType === 'input' ? type : undefined,
disabled: elementType === 'input' ? isDisabled : undefined,
'aria-disabled': !isDisabled || elementType === 'input' ? undefined : isDisabled,
rel: elementType === 'a' ? rel : undefined
};
let { pressProps: pressProps, isPressed: isPressed } = (0, $bwqiF$usePress)({
onPressStart: onPressStart,
onPressEnd: onPressEnd,
onPressChange: onPressChange,
onPress: onPress,
onPressUp: onPressUp,
onClick: onClick,
isDisabled: isDisabled,
preventFocusOnPress: preventFocusOnPress,
ref: ref
});
let { focusableProps: focusableProps } = (0, $bwqiF$useFocusable)(props, ref);
if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;
let buttonProps = (0, $bwqiF$mergeProps)(focusableProps, pressProps, (0, $bwqiF$filterDOMProps)(props, {
labelable: true
}));
return {
isPressed: isPressed,
buttonProps: (0, $bwqiF$mergeProps)(additionalProps, buttonProps, {
'aria-haspopup': props['aria-haspopup'],
'aria-expanded': props['aria-expanded'],
'aria-controls': props['aria-controls'],
'aria-pressed': props['aria-pressed'],
'aria-current': props['aria-current']
})
};
}
export {$701a24aa0da5b062$export$ea18c227d4417cc3 as useButton};
//# sourceMappingURL=useButton.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/focus/dist/useFocusRing.mjs
import {isFocusVisible as $isWE5$isFocusVisible, useFocusVisibleListener as $isWE5$useFocusVisibleListener, useFocus as $isWE5$useFocus, useFocusWithin as $isWE5$useFocusWithin} from "@react-aria/interactions";
import {useRef as $isWE5$useRef, useState as $isWE5$useState, useCallback as $isWE5$useCallback} from "react";
function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
let { autoFocus: autoFocus = false, isTextInput: isTextInput, within: within } = props;
let state = (0, $isWE5$useRef)({
isFocused: false,
isFocusVisible: autoFocus || (0, $isWE5$isFocusVisible)()
});
let [isFocused, setFocused] = (0, $isWE5$useState)(false);
let [isFocusVisibleState, setFocusVisible] = (0, $isWE5$useState)(()=>state.current.isFocused && state.current.isFocusVisible);
let updateState = (0, $isWE5$useCallback)(()=>setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);
let onFocusChange = (0, $isWE5$useCallback)((isFocused)=>{
state.current.isFocused = isFocused;
setFocused(isFocused);
updateState();
}, [
updateState
]);
(0, $isWE5$useFocusVisibleListener)((isFocusVisible)=>{
state.current.isFocusVisible = isFocusVisible;
updateState();
}, [], {
isTextInput: isTextInput
});
let { focusProps: focusProps } = (0, $isWE5$useFocus)({
isDisabled: within,
onFocusChange: onFocusChange
});
let { focusWithinProps: focusWithinProps } = (0, $isWE5$useFocusWithin)({
isDisabled: !within,
onFocusWithinChange: onFocusChange
});
return {
isFocused: isFocused,
isFocusVisible: isFocusVisibleState,
focusProps: within ? focusWithinProps : focusProps
};
}
export {$f7dceffc5ad7768b$export$4e328f61c538687f as useFocusRing};
//# sourceMappingURL=useFocusRing.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/useFocusWithin.mjs
import {createSyntheticEvent as $8a9cb279dc87e130$export$525bc4921d56d4a, setEventTarget as $8a9cb279dc87e130$export$c2b7abe5d61ec696, useSyntheticBlurEvent as $8a9cb279dc87e130$export$715c682d09d639cc} from "./utils.mjs";
import {useRef as $3b9Q0$useRef, useCallback as $3b9Q0$useCallback} from "react";
import {useGlobalListeners as $3b9Q0$useGlobalListeners, getOwnerDocument as $3b9Q0$getOwnerDocument, getActiveElement as $3b9Q0$getActiveElement, getEventTarget as $3b9Q0$getEventTarget, nodeContains as $3b9Q0$nodeContains} from "@react-aria/utils";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
let { isDisabled: isDisabled, onBlurWithin: onBlurWithin, onFocusWithin: onFocusWithin, onFocusWithinChange: onFocusWithinChange } = props;
let state = (0, $3b9Q0$useRef)({
isFocusWithin: false
});
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = (0, $3b9Q0$useGlobalListeners)();
let onBlur = (0, $3b9Q0$useCallback)((e)=>{
// Ignore events bubbling through portals.
if (!e.currentTarget.contains(e.target)) return;
// We don't want to trigger onBlurWithin and then immediately onFocusWithin again
// when moving focus inside the element. Only trigger if the currentTarget doesn't
// include the relatedTarget (where focus is moving).
if (state.current.isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {
state.current.isFocusWithin = false;
removeAllGlobalListeners();
if (onBlurWithin) onBlurWithin(e);
if (onFocusWithinChange) onFocusWithinChange(false);
}
}, [
onBlurWithin,
onFocusWithinChange,
state,
removeAllGlobalListeners
]);
let onSyntheticFocus = (0, $8a9cb279dc87e130$export$715c682d09d639cc)(onBlur);
let onFocus = (0, $3b9Q0$useCallback)((e)=>{
// Ignore events bubbling through portals.
if (!e.currentTarget.contains(e.target)) return;
// Double check that document.activeElement actually matches e.target in case a previously chained
// focus handler already moved focus somewhere else.
const ownerDocument = (0, $3b9Q0$getOwnerDocument)(e.target);
const activeElement = (0, $3b9Q0$getActiveElement)(ownerDocument);
if (!state.current.isFocusWithin && activeElement === (0, $3b9Q0$getEventTarget)(e.nativeEvent)) {
if (onFocusWithin) onFocusWithin(e);
if (onFocusWithinChange) onFocusWithinChange(true);
state.current.isFocusWithin = true;
onSyntheticFocus(e);
// Browsers don't fire blur events when elements are removed from the DOM.
// However, if a focus event occurs outside the element we're tracking, we
// can manually fire onBlur.
let currentTarget = e.currentTarget;
addGlobalListener(ownerDocument, 'focus', (e)=>{
if (state.current.isFocusWithin && !(0, $3b9Q0$nodeContains)(currentTarget, e.target)) {
let nativeEvent = new ownerDocument.defaultView.FocusEvent('blur', {
relatedTarget: e.target
});
(0, $8a9cb279dc87e130$export$c2b7abe5d61ec696)(nativeEvent, currentTarget);
let event = (0, $8a9cb279dc87e130$export$525bc4921d56d4a)(nativeEvent);
onBlur(event);
}
}, {
capture: true
});
}
}, [
onFocusWithin,
onFocusWithinChange,
onSyntheticFocus,
addGlobalListener,
onBlur
]);
if (isDisabled) return {
focusWithinProps: {
// These cannot be null, that would conflict in mergeProps
onFocus: undefined,
onBlur: undefined
}
};
return {
focusWithinProps: {
onFocus: onFocus,
onBlur: onBlur
}
};
}
export {$9ab94262bd0047c7$export$420e68273165f4ec as useFocusWithin};
//# sourceMappingURL=useFocusWithin.module.js.map
webpack://frontend-tpt/../../node_modules/@react-aria/interactions/dist/useHover.mjs
import {useGlobalListeners as $AWxnT$useGlobalListeners, getOwnerDocument as $AWxnT$getOwnerDocument, nodeContains as $AWxnT$nodeContains} from "@react-aria/utils";
import {useState as $AWxnT$useState, useRef as $AWxnT$useRef, useEffect as $AWxnT$useEffect, useMemo as $AWxnT$useMemo} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
// iOS fires onPointerEnter twice: once with pointerType="touch" and again with pointerType="mouse".
// We want to ignore these emulated events so they do not trigger hover behavior.
// See https://bugs.webkit.org/show_bug.cgi?id=214609.
let $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
let $6179b936705e76d3$var$hoverCount = 0;
function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = true;
// Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter
// with pointerType="mouse" immediately after onPointerUp and before onFocus. On other
// devices that don't have this quirk, we don't want to ignore a mouse hover sometime in
// the distant future because a user previously touched the element.
setTimeout(()=>{
$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
}, 50);
}
function $6179b936705e76d3$var$handleGlobalPointerEvent(e) {
if (e.pointerType === 'touch') $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
}
function $6179b936705e76d3$var$setupGlobalTouchEvents() {
if (typeof document === 'undefined') return;
if (typeof PointerEvent !== 'undefined') document.addEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
else if (process.env.NODE_ENV === 'test') document.addEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
$6179b936705e76d3$var$hoverCount++;
return ()=>{
$6179b936705e76d3$var$hoverCount--;
if ($6179b936705e76d3$var$hoverCount > 0) return;
if (typeof PointerEvent !== 'undefined') document.removeEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
else if (process.env.NODE_ENV === 'test') document.removeEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
};
}
function $6179b936705e76d3$export$ae780daf29e6d456(props) {
let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, isDisabled: isDisabled } = props;
let [isHovered, setHovered] = (0, $AWxnT$useState)(false);
let state = (0, $AWxnT$useRef)({
isHovered: false,
ignoreEmulatedMouseEvents: false,
pointerType: '',
target: null
}).current;
(0, $AWxnT$useEffect)($6179b936705e76d3$var$setupGlobalTouchEvents, []);
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = (0, $AWxnT$useGlobalListeners)();
let { hoverProps: hoverProps, triggerHoverEnd: triggerHoverEnd } = (0, $AWxnT$useMemo)(()=>{
let triggerHoverStart = (event, pointerType)=>{
state.pointerType = pointerType;
if (isDisabled || pointerType === 'touch' || state.isHovered || !event.currentTarget.contains(event.target)) return;
state.isHovered = true;
let target = event.currentTarget;
state.target = target;
// When an element that is hovered over is removed, no pointerleave event is fired by the browser,
// even though the originally hovered target may have shrunk in size so it is no longer hovered.
// However, a pointerover event will be fired on the new target the mouse is over.
// In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.
addGlobalListener((0, $AWxnT$getOwnerDocument)(event.target), 'pointerover', (e)=>{
if (state.isHovered && state.target && !(0, $AWxnT$nodeContains)(state.target, e.target)) triggerHoverEnd(e, e.pointerType);
}, {
capture: true
});
if (onHoverStart) onHoverStart({
type: 'hoverstart',
target: target,
pointerType: pointerType
});
if (onHoverChange) onHoverChange(true);
setHovered(true);
};
let triggerHoverEnd = (event, pointerType)=>{
let target = state.target;
state.pointerType = '';
state.target = null;
if (pointerType === 'touch' || !state.isHovered || !target) return;
state.isHovered = false;
removeAllGlobalListeners();
if (onHoverEnd) onHoverEnd({
type: 'hoverend',
target: target,
pointerType: pointerType
});
if (onHoverChange) onHoverChange(false);
setHovered(false);
};
let hoverProps = {};
if (typeof PointerEvent !== 'undefined') {
hoverProps.onPointerEnter = (e)=>{
if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') return;
triggerHoverStart(e, e.pointerType);
};
hoverProps.onPointerLeave = (e)=>{
if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, e.pointerType);
};
} else if (process.env.NODE_ENV === 'test') {
hoverProps.onTouchStart = ()=>{
state.ignoreEmulatedMouseEvents = true;
};
hoverProps.onMouseEnter = (e)=>{
if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e, 'mouse');
state.ignoreEmulatedMouseEvents = false;
};
hoverProps.onMouseLeave = (e)=>{
if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, 'mouse');
};
}
return {
hoverProps: hoverProps,
triggerHoverEnd: triggerHoverEnd
};
}, [
onHoverStart,
onHoverChange,
onHoverEnd,
isDisabled,
state,
addGlobalListener,
removeAllGlobalListeners
]);
(0, $AWxnT$useEffect)(()=>{
// Call the triggerHoverEnd as soon as isDisabled changes to true
// Safe to call triggerHoverEnd, it will early return if we aren't currently hovering
if (isDisabled) triggerHoverEnd({
currentTarget: state.target
}, state.pointerType);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
isDisabled
]);
return {
hoverProps: hoverProps,
isHovered: isHovered
};
}
export {$6179b936705e76d3$export$ae780daf29e6d456 as useHover};
//# sourceMappingURL=useHover.module.js.map
webpack://frontend-tpt/../../node_modules/@fanduel/formation-react-components/build/esm/index.mjs
import{useTheme as D}from"@emotion/react";import{ThemeProvider as Tt}from"@emotion/react";import{jsx as St}from"react/jsx-runtime";var Pt=({children:e,theme:r})=>St(Tt,{theme:r,children:e});import Ct from"react";var H=({value:e,defaultValue:r,onChange:o=()=>{}}={})=>{let[t,a]=Ct.useState(r!==void 0?r:""),s=i=>{a(i),o(i)};return e!==void 0?[e,o,!0]:[t,s,!1]};import dr from"react";import Ut from"@emotion/styled";import{border as _t,color as Kt,compose as qt,display as Jt,flexbox as Xt,grid as Yt,layout as Zt,overflow as jt,position as Qt,shadow as er,space as or,system as de,typography as tr,verticalAlign as rr}from"styled-system";import Bt from"@emotion/memoize";import vt from"@emotion/memoize";var kt=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ze=vt(function(e){return kt.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});import{compose as Rt,space as wt,typography as Ft,color as Lt,layout as It,flexbox as Mt,border as Ht,background as Et,position as At,grid as Dt,shadow as Nt,buttonStyle as Gt,textStyle as Wt,colorStyle as Ot}from"styled-system";var $t=Rt(wt,Ft,Lt,It,Mt,Ht,Et,At,Dt,Nt,Gt,Wt,Ot),zt=$t.propNames,Vt=e=>{let r=new RegExp(`^(${e.join("|")})$`);return Bt(o=>Ze(o)&&!r.test(o))},ce=Vt(zt);var ar=de({gap:{property:"gap",scale:"space"}}),nr=de({outline:{property:"outline"}}),sr=de({transition:{property:"transition",scale:"transitions"}}),ir=de({gradient:{property:"backgroundImage",scale:"colors"}}),je=Ut("div",{shouldForwardProp:ce})({boxSizing:"border-box"},qt(_t,Kt,Jt,Xt,Yt,ar,ir,Zt,jt,nr,Qt,er,or,sr,tr,rr));var lr=e=>typeof e=="object"&&e!==null&&"colors"in e&&Array.isArray(e.colors)&&"direction"in e&&typeof e.direction=="string",pr=(e,r)=>!r||r.length!==e.length?e.map(o=>o):e.map((o,t)=>`${o} ${r[t]}`),cr=(e,r)=>{let{direction:o,colors:t,stops:a}=e;if(!t||t.length<2)return"none";let s=t.map(i=>r[i]||i),n=pr(s,a).join(", ");return`linear-gradient(${o}, ${n})`},Qe=e=>{let r=D();if(typeof e=="string")return r?.colors?.[e]||e;if(lr(e))return cr(e,r.colors)};import{jsx as mr}from"@emotion/react/jsx-runtime";var p=dr.forwardRef(({as:e="div",children:r,gradient:o,...t},a)=>mr(je,{as:e,ref:a,gradient:o&&Qe(o),...e==="button"&&{type:"button"},...t,children:r}));p.displayName="Box";import wr from"react";import fr from"@emotion/styled";import{border as ur,color as xr,compose as gr,display as br,layout as hr,overflow as yr,position as Tr,shadow as Pr,space as Sr,system as De,typography as Cr,verticalAlign as vr}from"styled-system";var kr=De({case:{property:"textTransform",scale:"textCase"}}),Br=De({decoration:{property:"textDecorationLine",scale:"textDecoration"}}),Rr=De({whiteSpace:{property:"whiteSpace"}}),eo=fr("span",{shouldForwardProp:ce})({boxSizing:"border-box",margin:0},gr(ur,xr,br,hr,yr,Tr,Pr,Sr,kr,Br,Cr,vr,Rr));import{jsx as Fr}from"@emotion/react/jsx-runtime";var I=wr.forwardRef(({as:e="span",children:r,css:o,...t},a)=>Fr(eo,{as:e,ref:a,css:o,...t,children:r}));I.displayName="Text";import Lr from"react";import{tokenMappers as Ir}from"@fanduel/formation-shared-utils";var oo=(e,r)=>o=>{let t=e(o),a=r?typeof r=="function"?r(o):r:{};return{...t,...a}};import{jsx as Mr}from"react/jsx-runtime";var to={default:{base:"linkDefaultBase",hover:"linkDefaultHover"},inverse:{base:"linkInverseDefaultBase",hover:"linkInverseDefaultHover"}},y=Lr.forwardRef(({as:e="p",children:r,css:o,linkColor:t="default",size:a="md",strikethrough:s=!1,strong:n=!1,...i},c)=>{let l=Ir.typographyBody({size:a,strikethrough:s,strong:n});return Mr(I,{as:e,ref:c,case:l,decoration:l,fontFamily:l,fontSize:l,fontWeight:l,letterSpacing:l,lineHeight:l,css:oo(d=>({"& a":{color:d?.colors?.[to[t]?.base],cursor:"pointer",textDecoration:d?.textDecoration?.textDecorationUnderline},"& a:hover":{color:d?.colors?.[to[t]?.hover]}}),o),...i,children:r})});y.displayName="BodyText";import Hr from"react";import{tokenMappers as Er}from"@fanduel/formation-shared-utils";import{jsx as Ar}from"react/jsx-runtime";var ro=Hr.forwardRef(({as:e="h1",children:r,css:o,size:t="md",...a},s)=>{let n=Er.typographyJumbo({size:t});return Ar(I,{as:e,ref:s,css:o,fontWeight:n,lineHeight:n,fontSize:n,letterSpacing:n,fontFamily:n,...a,children:r})});ro.displayName="JumboText";import Dr from"react";import{tokenMappers as Nr}from"@fanduel/formation-shared-utils";import{jsx as Gr}from"react/jsx-runtime";var z=Dr.forwardRef(({as:e="h1",children:r,css:o,size:t="md",...a},s)=>{let n=Nr.typographyHeader({size:t});return Gr(I,{as:e,ref:s,css:o,fontWeight:n,lineHeight:n,fontSize:n,letterSpacing:n,fontFamily:n,...a,children:r})});z.displayName="HeaderText";import Wr from"react";import{tokenMappers as Or}from"@fanduel/formation-shared-utils";import{jsx as $r}from"react/jsx-runtime";var B=Wr.forwardRef(({as:e="span",children:r,css:o,size:t="md",...a},s)=>{let n=Or.typographyLabel({size:t});return $r(I,{as:e,ref:s,css:o,fontWeight:n,lineHeight:n,fontSize:n,letterSpacing:n,fontFamily:n,whiteSpace:"nowrap",overflow:"hidden",case:n,...a,children:r})});B.displayName="LabelText";import zr from"react";import{tokenMappers as Vr}from"@fanduel/formation-shared-utils";import{jsx as Ur}from"react/jsx-runtime";var ao=zr.forwardRef(({as:e="span",children:r,css:o,size:t="md",...a},s)=>{let n=Vr.typographyMeta({size:t});return Ur(I,{as:e,ref:s,css:o,fontWeight:n,lineHeight:n,fontSize:n,letterSpacing:n,fontFamily:n,case:n,whiteSpace:"nowrap",overflow:"hidden",...a,children:r})});ao.displayName="MetaDataText";import _r from"react";import{tokenMappers as Kr}from"@fanduel/formation-shared-utils";import{jsx as qr}from"react/jsx-runtime";var me=_r.forwardRef(({as:e="span",children:r,css:o,size:t="md",strong:a=!1,...s},n)=>{let i=Kr.typographyButton({size:t,strong:a});return qr(I,{as:e,ref:n,css:o,fontWeight:i,lineHeight:i,fontSize:i,letterSpacing:i,fontFamily:i,whiteSpace:"nowrap",overflow:"hidden",...s,children:r})});me.displayName="ButtonText";import Jr from"react";import{styleUtils as no}from"@fanduel/formation-shared-utils";import{jsx as Xr}from"react/jsx-runtime";var L=Jr.forwardRef(({as:e="div",children:r,css:o,align:t="start",direction:a="row",gap:s,justify:n,wrap:i=!0,...c},l)=>Xr(p,{as:e,ref:l,css:o,display:"inline-flex",flexDirection:a,flexWrap:i?"wrap":"nowrap",gap:s,...t&&{alignItems:no.convertFlexValue(t)},...n&&{justifyContent:no.convertFlexValue(n)},...c,children:r}));L.displayName="Stack";import j from"react";import{styleResolvers as Zr}from"@fanduel/formation-shared-utils";import{styleUtils as so}from"@fanduel/formation-shared-utils";import{jsx as Yr}from"react/jsx-runtime";var V=({as:e,size:r="sm",color:o,...t})=>{let{colors:a}=D(),s=o?a?.[o]??o:void 0;return Yr(e,{height:so.getIconSize(r),width:so.getIconSize(r),color:s,...t})};V.displayName="Icon";import{jsx as io}from"react/jsx-runtime";var fe=j.forwardRef(({as:e="div",children:r,intent:o="neutral",size:t="condensed",variant:a="fill",overrides:s,css:n,...i},c)=>{let l=Zr.tag({intent:o,variant:a,size:t},s);return io(L,{as:e,ref:c,css:n,align:"center",bg:l.colour,color:l.contentColour,borderColor:l.borderColor,borderRadius:l.cornerRadius,borderStyle:l.borderStyle,borderWidth:l.borderWidth,gap:l.contentSpacing,height:l.height,maxWidth:"max-content",px:l.spacing,...i,children:j.Children.map(r,d=>j.isValidElement(d)&&d.type===V?j.cloneElement(d,{color:l.contentColour,width:12,height:12}):j.isValidElement(d)?null:io(B,{lineHeight:1,children:d}))})});fe.displayName="Tag";import ue from"react";import{jsx as jr}from"react/jsx-runtime";var lo=ue.forwardRef(({as:e="div",children:r,...o},t)=>{let a=ue.Children.toArray(r).length-1;return jr(L,{as:e,ref:t,alignItems:"stretch",maxWidth:"max-content",...o,children:r&&ue.Children.map(r,(s,n)=>s.type!==fe?null:ue.cloneElement(s,{...n===0&&{css:{borderTopRightRadius:"0px",borderBottomRightRadius:"0px"}},...n===a&&{css:{borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"}},...n!==0&&n!==a&&{css:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"}}}))})});lo.displayName="SplitTag";import po from"react";import{jsx as fo}from"react/jsx-runtime";var co=po.forwardRef(({as:e="article",children:r,css:o,...t},a)=>fo(p,{as:e,ref:a,css:o,...t,borderWidth:"borderWidthDefault",borderStyle:"solid",borderColor:"borderDefault",display:"flex",flexDirection:"column",borderRadius:"borderRadiusDefault",overflow:"hidden",children:r})),mo=po.forwardRef(({as:e="div",children:r,css:o,...t},a)=>fo(p,{as:e,ref:a,css:o,...t,bg:"backgroundSurface",flex:"1",paddingTop:"space6",paddingBottom:"space6",paddingRight:"space4",paddingLeft:"space4",alignSelf:"stretch",children:r}));co.displayName="Card";mo.displayName="CardContent";import oa from"react";import{styleResolvers as ta}from"@fanduel/formation-shared-utils";import Qr from"react";import{styleUtils as uo}from"@fanduel/formation-shared-utils";import{jsx as ea}from"react/jsx-runtime";var u=Qr.forwardRef(({as:e="div",children:r,css:o,align:t,direction:a,justify:s,wrap:n=!0,gap:i,...c},l)=>ea(p,{as:e,ref:l,css:o,display:"flex",...t&&{alignItems:uo.convertFlexValue(t)},...s&&{justifyContent:uo.convertFlexValue(s)},flexDirection:a,flexWrap:n?"wrap":"nowrap",gap:i,...c,children:r}));u.displayName="Flex";import{jsx as xo}from"react/jsx-runtime";var xe=oa.forwardRef(({as:e="div",css:r,overrides:o,disabled:t=!1,value:a,...s},n)=>{let i=typeof a=="number"&&a>999?"999+":a,c=ta.badge({disabled:t},o);return xo(u,{align:"center",as:e,ref:n,bg:c.colour,borderColor:c.borderColor,borderRadius:c.cornerRadius,borderStyle:c.borderStyle,borderWidth:c.borderWidth,height:c.size,justify:"center",maxWidth:"max-content",minWidth:c.size,px:c.spacing,role:"status",textAlign:"center",width:"fit-content",css:r,...s,children:xo(y,{as:"span",color:c.contentColour,lineHeight:1,size:"xs",strong:!0,children:i})})});xe.displayName="Badge";import ra from"react";import{styleResolvers as aa}from"@fanduel/formation-shared-utils";import{jsx as Q,jsxs as Ne}from"react/jsx-runtime";var go=ra.forwardRef(({as:e="button",css:r,description:o,disabled:t=!1,fill:a,href:s,iconLeft:n,iconRight:i,label:c,loading:l=!1,onClick:d,overrides:f,size:m="regular",variant:g="primary",...S},x)=>Q(be,{ref:x,as:e,disabled:t,loading:l,onPress:d?()=>d({}):void 0,href:s,role:e==="a"&&s?"link":"button",children:({isDisabled:P,isFocused:T,isHovered:C,isPressed:b,isLoading:R},M)=>{let h=aa.button({variant:g,size:m,description:!!o,disabled:t,loading:l,active:b,hover:C,focus:T},f);return Ne(p,{...M,display:"flex",justifyContent:"center",position:"relative",py:h.spacing.y,px:h.spacing.x,borderStyle:h.borderStyle,borderWidth:h.borderWidth,borderRadius:h.cornerRadius,bg:h.colour,color:h.contentColour,borderColor:h.borderColor,...a&&{width:"100%"},textAlign:"center",css:{appearance:"none",cursor:P||R?"not-allowed":"pointer",textDecoration:"none",...r},...S,children:[l&&Q(u,{align:"center",justify:"center",position:"absolute",css:{inset:0},children:Q(ge,{size:"sm"})}),Ne(u,{align:"center",gap:h.contentSpacing.x,css:{visibility:R?"hidden":"visible"},children:[n,Ne(u,{align:"center",direction:"column",gap:h.contentSpacing.y,textAlign:"center",children:[Q(me,{size:m==="small"?"md":"lg",children:c}),o&&Q(B,{size:m==="small"?"sm":"md",children:o})]}),i]})]})}}));go.displayName="Button";import na from"react";import{jsx as sa}from"react/jsx-runtime";var bo=(e,r)=>e.space?.[r]?`${e.space?.[r]}px`:r,ho=na.forwardRef(({as:e="div",children:r,colGap:o,columns:t,css:a,gap:s,maxItemWidth:n,minItemWidth:i,rowGap:c,...l},d)=>{let f=t?`repeat(${t}, 1fr)`:n?`repeat(auto-fit, minmax(${i}, ${n}))`:`repeat(auto-fit, minmax(${i}, 1fr))`;return sa(p,{as:e,ref:d,display:"grid",gridTemplateColumns:f,gap:s,css:m=>({columnGap:bo(m,o),rowGap:bo(m,c),...a}),...l,children:r})});ho.displayName="Grid";import ia from"react";import{jsx as la}from"react/jsx-runtime";var yo=ia.forwardRef(({height:e,src:r,width:o,css:t,...a},s)=>la(p,{as:"img",display:"block",maxWidth:"100%",role:"img",src:r,height:e,width:o,ref:s,css:t,...a}));yo.displayName="Image";import Ge from"react";import{tokenMappers as ee}from"@fanduel/formation-shared-utils";import{TimeCalendar as pa}from"@fanduel/formation-react-icons";import{jsx as G,jsxs as he}from"react/jsx-runtime";var To=Ge.forwardRef(({label:e,helperText:r,errorMessage:o,css:t,isCondensed:a,isOptional:s,isInvalid:n,isDisabled:i=!1,value:c,id:l,onValueChange:d,...f},m)=>{let[g,S]=H({value:c,defaultValue:new Date().toISOString(),onChange:d}),[x,P]=Ge.useState(!1),T=()=>{P(!0)},C=()=>{P(!1)},b=Ge.useMemo(()=>x?ee.input("active"):n||o?ee.input("error"):i?ee.input("disabled"):ee.input("base"),[x,n,o,i,ee]);return he(p,{css:t,borderWidth:b.borderWidth,borderStyle:"solid",borderRadius:b.borderRadius,borderColor:b.borderColor,bg:b.backgroundColor,minWidth:0,children:[he(u,{direction:"column",py:a?"space2":"space3",px:a?"space3":"space4",gap:"space1",children:[he(u,{align:"baseline",justify:"space-between",mb:"space1",children:[G(B,{as:"label",htmlFor:l,size:"md",color:b.label,children:e}),s&&G(y,{size:"sm",color:b.optional,css:{pointerEvents:"none"},children:"Optional"})]}),he(u,{align:"center",justifyContent:"space-between",gap:"space2",position:"relative",children:[G(p,{ref:m,color:b.content,"aria-disabled":i,disabled:i,value:g,as:"input",id:l,type:"date",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:b.typography,fontSize:b.typography,fontWeight:b.typography,letterSpacing:b.typography,lineHeight:b.typography,flex:"1",height:20,maxWidth:"100%",p:0,onChange:R=>{i||S(R.target.value)},onFocus:T,...!i&&{onFocus:T,onBlur:C},css:{textTransform:"uppercase","::-webkit-calendar-picker-indicator":{opacity:0},"::-webkit-date-and-time-value":{height:20,padding:0,textAlign:"left"}},...i&&{cursor:"not-allowed"},...f}),G(p,{color:i?"contentDisabled":"contentSubtle",position:"absolute",right:0,top:0,css:R=>({cursor:"pointer",pointerEvents:"none","&:hover":{color:R?.colors?.contentLinkActive},...t}),children:G(pa,{})})]}),o&&G(p,{children:G(y,{color:"componentDataInputContentError",marginTop:"space1",children:o})})]}),r&&G(p,{borderTopWidth:b.borderWidth,borderBottomLeftRadius:b.borderRadius,borderBottomRightRadius:b.borderRadius,borderTopColor:b.borderColor,bg:b.helperText.backgroundColor,borderTopStyle:"solid",px:"space4",py:"space1",...a&&{px:"space3"},children:G(y,{size:"sm",color:b.helperText.content,children:r})})]})});To.displayName="DatePicker";import ye from"react";import{tokenMappers as oe}from"@fanduel/formation-shared-utils";import{jsx as W,jsxs as te}from"react/jsx-runtime";var Po=ye.forwardRef(({label:e,helperText:r,errorMessage:o,placeholder:t,css:a,isCondensed:s,isRequired:n,isOptional:i,isInvalid:c,isDisabled:l,defaultValue:d="",value:f,id:m,type:g="text",onBlur:S,onFocus:x,onValueChange:P,...T},C)=>{let[b,R]=H({value:f,defaultValue:d,onChange:P}),[M,h]=ye.useState(!1),[k,w]=ye.useState(g!=="password"),v=A=>{x?.(A),h(!0)},E=A=>{S?.(A),h(!1)},yt=()=>{w(!k)},F=ye.useMemo(()=>M?oe.input("active"):c||o?oe.input("error"):l?oe.input("disabled"):oe.input("base"),[M,c,o,l,oe]);return te(p,{css:a,borderWidth:F.borderWidth,borderStyle:"solid",borderRadius:F.borderRadius,borderColor:F.borderColor,bg:F.backgroundColor,minWidth:0,"data-testid":"input-container",children:[te(u,{direction:"column",py:"space3",px:"space4",gap:"space1",...s&&{py:"space2",px:"space3"},children:[te(u,{align:"baseline",justify:"space-between",mb:"space1",children:[te(B,{as:"label",htmlFor:m,size:"md",color:F.label,children:[e,n&&W(B,{as:"span",color:"systemImportantContentAccent",ml:"space1",children:"* Required"})]}),i&&W(y,{size:"sm",color:F.optional,children:"Optional"})]}),te(u,{align:"center",justifyContent:"space-between",gap:"space2",children:[W(p,{as:"input","aria-disabled":l,"aria-required":n,ref:C,color:F.content,disabled:l,placeholder:t,value:b,id:m,type:k?"text":"password",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:F.typography,fontSize:F.typography,fontWeight:F.typography,letterSpacing:F.typography,lineHeight:F.typography,flex:"1",maxWidth:"100%",p:0,onChange:A=>R(A.target.value),...!l&&{onFocus:v,onBlur:E},css:A=>({"::placeholder":{color:l?A?.colors?.componentDataInputContentDisabled:A?.colors?.componentDataInputContentSubtle}}),...l&&{cursor:"not-allowed"},...T}),g==="password"&&W(p,{color:"contentLink",onClick:yt,css:A=>({cursor:"pointer","&:hover":{color:A?.colors?.contentLinkActive},...a}),children:W(y,{children:k?"Hide":"Show"})})]}),o&&W(p,{children:W(y,{color:"componentDataInputContentError",marginTop:"space1",children:o})})]}),r&&W(p,{borderTopWidth:F.borderWidth,borderBottomLeftRadius:F.borderRadius,borderBottomRightRadius:F.borderRadius,borderTopColor:F.borderColor,bg:F.helperText.backgroundColor,borderTopStyle:"solid",px:"space4",py:"space1",...s&&{px:"space3"},children:W(y,{size:"sm",color:F.helperText.content,children:r})})]})});Po.displayName="TextField";import We from"react";import{tokenMappers as ca}from"@fanduel/formation-shared-utils";import{GeneralTick as da,GeneralRemove as ma}from"@fanduel/formation-react-icons";var Te=e=>e==="xs"?"sm":e==="lg"?"md":e,re=e=>{switch(e){case"lg":case"md":return"space2";default:return"space1"}};import{jsx as U,jsxs as Pe}from"react/jsx-runtime";var So=We.forwardRef(({children:e,checked:r,css:o,defaultChecked:t=!1,disabled:a=!1,id:s,indeterminate:n=!1,label:i,name:c,onChange:l,size:d="md",subtext:f,value:m="on",...g},S)=>{let[x,P]=H({value:r,defaultValue:t,onChange:l}),[T,C]=We.useState(!1),b=We.useMemo(()=>s??`checkbox-${Math.random().toString(36).slice(2,8)}`,[s]),R=()=>{a||C(!0)},M=()=>{a||C(!1)},h=ca.checkbox(d);return Pe(p,{position:"relative",children:[U(p,{"aria-hidden":!0,as:"input",type:"checkbox",checked:x,disabled:a,height:1,name:c,opacity:"0",position:"absolute",readOnly:!0,tabIndex:-1,value:m,width:1,css:{pointerEvents:"none"}}),Pe(u,{direction:"row",onMouseEnter:R,onMouseLeave:M,ref:S,wrap:!1,children:[U(p,{"aria-checked":x,"aria-disabled":a,...!e&&{"aria-label":i},"aria-labelledby":`${b}-label`,as:"button",bg:h.default.background,borderColor:h.default.borderColor,borderRadius:d==="xs"?"borderRadius010":"borderRadiusDefault",borderStyle:"solid",borderWidth:"borderWidth010",color:h.default.iconColor,css:o,disabled:a,flexGrow:0,flexShrink:0,height:h.height,id:b,m:0,mt:d==="xs"?2:0,onClick:()=>P(!x),overflow:"hidden",p:0,position:"relative",role:"checkbox",tabIndex:a?-1:0,width:h.width,...(x||n)&&{borderColor:h.checked.borderColor,bg:h.checked.background,color:h.checked.iconColor},...T&&{borderColor:h.hover.borderColor,bg:h.hover.background,color:h.hover.iconColor},...(x||n)&&T&&{borderColor:h.hoverChecked.borderColor,bg:h.hoverChecked.background,color:h.hoverChecked.iconColor},...a&&{borderColor:h.disabled.borderColor,bg:h.disabled.background,color:h.disabled.iconColor},...g,children:Pe(p,{as:"span",position:"absolute",css:{inset:-1,pointerEvents:"none"},children:[n&&U(ma,{width:h.width,height:h.height}),!n&&x&&U(da,{width:h.width,height:h.height})]})}),Pe(u,{direction:"column",css:k=>({a:{color:a?"inherit":k?.colors?.contentLink,textDecoration:"none"}}),id:`${b}-label`,children:[e&&U(y,{as:"label",color:"contentDefault",...a&&{color:"contentDisabled"},htmlFor:b,mt:["md","lg"].includes(d)?1:0,pl:re(d),size:d==="xs"?"sm":d,children:e}),f&&U(B,{as:"label",color:"contentSubtle",...a&&{color:"contentDisabled"},htmlFor:b,pl:re(d),size:Te(d),children:f})]})]})]})});So.displayName="Checkbox";import fa from"react";import{tokenMappers as ua}from"@fanduel/formation-shared-utils";import{jsx as Co}from"react/jsx-runtime";var vo=fa.forwardRef(({as:e="div",css:r,disabled:o=!1,intent:t,label:a,max:s=100,min:n=0,size:i="md",value:c=0,...l},d)=>{let f=c-Math.max(n,0),m=s-Math.max(n,0),g=Math.min(Math.max(f,0),m),S=Math.round(g/m*100),x=ua.progressBar(t);return Co(p,{"aria-label":a,"aria-valuemin":n,"aria-valuemax":s,"aria-valuenow":c,as:e,ref:d,bg:o?"componentDataInputBackgroundDisabled":"systemNeutralBackgroundDefault",borderRadius:"borderRadiusCircle",height:i==="lg"?8:4,position:"relative",role:"progressbar",width:"100%",css:r,...l,children:!o&&Co(p,{bg:x.fill,borderRadius:"borderRadiusCircle",height:"100%",position:"absolute",width:`${S}%`})})});vo.displayName="ProgressBar";import Se from"react";import{tokenMappers as xa}from"@fanduel/formation-shared-utils";import{jsx as Ce,jsxs as Oe}from"react/jsx-runtime";var ko=Se.forwardRef(({css:e,defaultSelected:r=!1,disabled:o=!1,size:t="md",label:a,name:s,subtext:n,selected:i,id:c,value:l,onChange:d,...f},m)=>{let[g,S]=H({value:i,defaultValue:r,onChange:d}),[x,P]=Se.useState(!1),[T,C]=Se.useState(!1),b=Se.useMemo(()=>c??`radio-${Math.random().toString(36).slice(2,8)}`,[c]),R=()=>{P(!0)},M=()=>{o||C(!0)},h=()=>{o||C(!1)},k=()=>{P(!1)},w=xa.radioButton(t);return Oe(p,{position:"relative",children:[Ce(p,{"aria-hidden":!0,as:"input",type:"radio",ref:m,checked:g,disabled:o,size:"0",border:"none",overflow:"hidden",padding:"0",margin:"0",position:"absolute",opacity:"0",readOnly:!0,tabIndex:-1,name:s,value:l,width:1,height:1,css:{pointerEvents:"none"},...f}),Oe(u,{direction:"row",onMouseEnter:M,onMouseLeave:h,ref:m,wrap:!1,children:[Ce(p,{"aria-checked":g,"aria-disabled":o,"aria-labelledby":`${b}-label`,as:"button",role:"radio",disabled:o,tabIndex:o?-1:0,id:b,onBlur:k,onClick:()=>S(!0),onFocus:R,css:e,width:w.width,height:w.height,flexShrink:0,borderRadius:"borderRadiusCircle",borderStyle:"solid",borderWidth:"borderWidthDefault",p:"space0",mr:re(t),mt:t==="xs"?"space05":"space0",borderColor:w.default.borderColor,bg:w.default.background,...(x||T)&&{borderColor:w.focus.borderColor,bg:w.focus.background},...g&&{borderColor:w.selected.borderColor,bg:w.selected.background,borderWidth:3},...g&&(x||T)&&{borderColor:w.selectedFocus.borderColor,bg:w.selectedFocus.background},...o&&{borderColor:w.disabled.borderColor,bg:w.disabled.background},...o&&g&&{borderColor:w.selectedDisabled.borderColor,bg:w.selectedDisabled.background}}),Oe(u,{direction:"column",flexShrink:1,id:`${b}-label`,children:[Ce(y,{as:"label",htmlFor:b,size:t==="xs"?"sm":t,color:o?"contentDisabled":"contentDefault",mt:t==="lg"||t==="md"?"space025":"space0",children:a}),n&&Ce(B,{as:"label",htmlFor:b,size:Te(t),color:"contentSubtle",...o&&{color:"contentDisabled"},children:n})]})]})]})});ko.displayName="RadioButton";import $e from"react";import{tokenMappers as ga,isHoverableDevice as Bo}from"@fanduel/formation-shared-utils";import{GeneralTick as ba,GeneralCross as ha}from"@fanduel/formation-react-icons";import{jsx as ne,jsxs as ve}from"react/jsx-runtime";var Ro=24,ze=44,se=20,ae=(Ro-se)/2,wo=$e.forwardRef(({id:e,defaultOn:r=!1,disabled:o=!1,hideIcons:t=!1,label:a,labelPosition:s="right",on:n,onChange:i,name:c,value:l="on",...d},f)=>{let[m,g]=H({value:n,defaultValue:r,onChange:i}),[S,x]=$e.useState(!1),[P,T]=$e.useState(!1),C=()=>{g(!m)},b=()=>{x(!0)},R=()=>{!o&&Bo()&&T(!0)},M=()=>{!o&&Bo()&&T(!1)},h=()=>{x(!1)},k=ga.switch();return ve(L,{direction:s==="right"?"row-reverse":"row",gap:"space2",maxWidth:"max-content",ref:f,wrap:!1,children:[s!=="hidden"&&a&&ne(y,{as:"label",htmlFor:e,color:"contentDefault",mt:4,style:{cursor:o?"not-allowed":"pointer"},children:a}),ve(p,{flexGrow:0,flexShrink:0,width:ze,height:Ro,position:"relative",children:[ve(p,{"aria-label":a,"aria-checked":m,"aria-disabled":o,as:"button",bg:k.default.background,border:"none",borderRadius:"borderRadiusCircle",color:k.default.iconColor,disabled:o,id:e,onBlur:h,onClick:C,onFocus:b,onPointerEnter:R,onPointerLeave:M,py:"space0",px:"space1",position:"absolute",role:"switch",transition:"standard",zIndex:1,css:{cursor:o?"not-allowed":"pointer",inset:0},...P&&{bg:k.hover.background,color:k.hover.iconColor},...S&&{bg:k.focus.background,color:k.focus.iconColor},...m&&{bg:k.checked.background,color:k.checked.iconColor},...o&&{bg:k.disabled.background,color:k.disabled.iconColor},...d,children:[ne(p,{zIndex:2,width:se,height:se,borderRadius:"borderRadiusCircle",bg:"coreWhite",position:"absolute",left:ae,top:ae,transition:"standard",...m&&{left:ze-se-ae},...P&&{left:ae*2},...P&&m&&{left:ze-se-ae*2}}),!t&&ve(p,{zIndex:1,display:"flex",justifyContent:"space-between",alignItems:"center",children:[ne(ba,{style:{display:"block"}}),ne(ha,{style:{display:"block"}})]})]}),ne(p,{"aria-hidden":!0,"aria-disabled":o,as:"input",type:"checkbox",checked:m,disabled:o,name:c,overflow:"hidden",opacity:"0",readOnly:!0,tabIndex:-1,value:l})]})]})});wo.displayName="Switch";import ya from"react";import{jsx as Be}from"react/jsx-runtime";var ke=32,Fo=ya.forwardRef(({alt:e="User Avatar",css:r,src:o,...t},a)=>Be(p,{ref:a,bg:"#F7FBFF",borderRadius:"borderRadiusCircle",height:ke,overflow:"hidden",width:ke,css:r,...t,children:o?Be(p,{as:"img",src:o,alt:e,height:"100%",width:"100%",css:{objectFit:"cover",objectPosition:"center center"}}):Be("svg",{"aria-label":"Placeholder User Avatar",xmlns:"http://www.w3.org/2000/svg",width:ke,height:ke,viewBox:"0 0 32 32",fill:"none",style:{display:"block"},children:Be("path",{d:"M8.75862 13.2284V14.7501C8.75862 19.7929 11.6552 24.6415 16.0001 24.6415C20.3325 24.6415 23.2414 19.7929 23.2414 14.7501V13.2284C23.2414 8.1857 20.2548 6 16.0001 6C11.6552 6 8.75862 8.1857 8.75862 13.2284ZM30 32H2C2 27.6917 6.61903 24.553 10.3838 24.1867C11.8977 25.6926 13.8196 26.6038 16.0001 26.6038C18.1763 26.6038 20.097 25.6921 21.6111 24.1862C25.3768 24.5502 30 27.69 30 32Z",fill:"#6A6F73"})})}));Fo.displayName="Avatar";import Ta from"react";import{tokenMappers as Pa}from"@fanduel/formation-shared-utils";import{jsx as Lo,jsxs as Sa}from"react/jsx-runtime";var Io=Ta.forwardRef(({as:e="div",children:r,css:o,label:t,justification:a="left",size:s="md",...n},i)=>{let c=Pa.dataChunk(s);return Sa(p,{as:e,ref:i,css:o,...n,textAlign:a,children:[Lo(y,{color:"contentDefault",size:c.valueFontSize,children:r}),Lo(B,{color:"contentSubtle",size:c.labelFontSize,children:t})]})});Io.displayName="DataChunk";import Ve from"react";import{jsx as Ho}from"react/jsx-runtime";var Mo={sm:8,md:16,lg:24},ge=Ve.forwardRef(({as:e="div",css:r,inverse:o=!1,label:t="Loading",size:a="md",...s},n)=>{let[i,c]=Ve.useState(0);Ve.useEffect(()=>{let d=setInterval(()=>{c(f=>(f+1)%3)},200);return()=>clearInterval(d)},[]);let l=d=>[1,.5,.25][d];return Ho(L,{as:e,ref:n,css:{pointerEvents:"none",...r},gap:a==="sm"?"space2":"space3","aria-label":t,"aria-live":"polite",role:"status",...s,children:[...Array(3)].map((d,f)=>Ho(p,{as:"span",bg:o?"contentOnDark":"contentBrandPrimary",borderRadius:"borderRadiusCircle",height:Mo[a],opacity:l((3-i+f)%3),width:Mo[a],css:{pointerEvents:"none",transition:"opacity 0.5s cubic-bezier(0.40,0.00,0.20,1.00)"}},f))})});ge.displayName="Loader";import Ra from"react";import{tokenMappers as wa}from"@fanduel/formation-shared-utils";import{GeneralCross as Fa}from"@fanduel/formation-react-icons";import{FeedbackErrorHexagon as Ca,FeedbackInformationCircle as va,GeneralTickCircle as ka,FeedbackWarningDiamond as Ba}from"@fanduel/formation-react-icons";import{jsx as Re}from"react/jsx-runtime";function $(e){switch(e){case"positive":return Re(ka,{});case"important":return Re(Ca,{});case"info":case"neutral":case"verification":return Re(va,{});case"alert":case"insight":return Re(Ba,{});default:return null}}import{jsx as _,jsxs as Eo}from"react/jsx-runtime";var Ao=Ra.forwardRef(({as:e="div",children:r,css:o,dismissable:t=!1,icon:a,intent:s="neutral",hideIcon:n=!1,onDismiss:i,title:c,...l},d)=>{let f=wa.floatingBanner(s);return _(p,{as:e,ref:d,css:o,bg:f.background,border:"1px solid",borderColor:f.border,borderRadius:"borderRadiusDefault",display:"flex",py:"space2",pl:"space4",pr:"space3",width:"100%",...l,children:Eo(u,{align:"start",gap:"space3",width:"100%",wrap:!1,children:[!n&&_(p,{color:f.icon,children:a??$(s)}),_(p,{flex:1,children:Eo(y,{color:f.content,children:[c&&_(y,{as:"span",strong:!0,mr:"space1",children:c}),r]})}),t&&_(p,{"aria-label":"Dismiss",as:"button",bg:"transparent",border:"none",color:f.link,onClick:i,p:0,css:{appearance:"none",cursor:"pointer"},children:_(Fa,{})})]})})});Ao.displayName="FloatingBanner";import La from"react";import{tokenMappers as Ia}from"@fanduel/formation-shared-utils";import{jsx as Do,jsxs as No}from"react/jsx-runtime";var Go=La.forwardRef(({as:e="div",children:r,icon:o,intent:t="neutral",hideIcon:a=!1,title:s,css:n,...i},c)=>{let l=Ia.inlineMessage(t);return No(p,{as:e,ref:c,css:n,bg:l.background,borderRadius:"borderRadius020",display:"flex",gap:"space3",py:"space2",paddingRight:"space3",paddingLeft:"space4",width:"100%",...i,children:[!a&&Do(p,{color:l.icon,children:o??$(t)}),No(y,{color:l.content,children:[s&&Do(y,{as:"span",strong:!0,mr:"space1",children:s}),r]})]})});Go.displayName="InlineMessage";import Ma from"react";import{tokenMappers as Ha}from"@fanduel/formation-shared-utils";import{jsx as K,jsxs as Wo}from"react/jsx-runtime";var Oo=Ma.forwardRef(({action:e,actionLabel:r="Toast Action",as:o="div",children:t,css:a,icon:s,intent:n="neutral",hideIcon:i=!1,onClick:c,title:l,...d},f)=>{let m=Ha.toast(n);return K(p,{as:o,ref:f,css:{...c?{cursor:"pointer",...a}:a},bg:m.background,borderRadius:"borderRadiusCircle",boxShadow:"elevationsAllAroundHigh",py:"space2",px:"space6",width:320,onClick:c,...c?{"aria-label":r,role:"button"}:{},...d,children:Wo(u,{align:"center",gap:"space3",width:"100%",children:[!i&&K(p,{color:m.content,children:s??$(n)}),Wo(L,{direction:"column",flex:1,children:[l&&K(z,{color:m.content,size:"sm",children:l}),K(y,{color:m.content,children:t})]}),e&&K(p,{color:m.action,children:typeof e=="string"?K(z,{as:"div",color:m.action,size:"sm",children:e}):e})]})})});Oo.displayName="Toast";import Ea from"react";import{tokenMappers as Aa}from"@fanduel/formation-shared-utils";import{jsx as q,jsxs as $o}from"react/jsx-runtime";var zo=Ea.forwardRef(({action:e,actionLabel:r="Banner Action",as:o="div",children:t,css:a,icon:s,intent:n="neutral",hideIcon:i=!1,onClick:c,title:l,...d},f)=>{let m=Aa.fixedBanner(n);return q(u,{as:o,ref:f,css:a,justify:"center",bg:m.background,display:"flex",py:"space2",pl:"space4",pr:"space3",width:"100%",...d,children:$o(u,{align:"start",gap:"space3",width:"100%",wrap:!1,maxWidth:"maxContentWidth",children:[!i&&q(p,{color:m.content,children:s??$(n)}),q(p,{flex:1,children:$o(y,{color:m.content,children:[l&&q(y,{as:"span",strong:!0,mr:"space1",children:l}),t]})}),e&&q(p,{"aria-label":r,as:"button",bg:"transparent",border:"none",color:m.link,onClick:c,p:0,css:{appearance:"none",cursor:"pointer"},children:typeof e=="string"?q(z,{size:"sm",children:e}):e})]})})});zo.displayName="FixedBanner";import we from"react";import{styleResolvers as Da}from"@fanduel/formation-shared-utils";import{jsx as Vo,jsxs as Na}from"react/jsx-runtime";var Uo=we.forwardRef(({as:e="div",children:r,css:o,equalTabs:t=!1,onTabSelect:a,selectedTab:s,inverse:n=!1,...i},c)=>{let l=f=>{a?.(f)},d=Da.tabs({inverse:n,fixedWidth:t,active:!1,hovered:!1});return Na(p,{as:e,ref:c,css:o,bg:d.backgroundColour,position:"relative",width:"100%",...i,children:[Vo(u,{gap:d.gap,position:"relative",px:d.containerPad,wrap:!1,children:we.Children.map(r,f=>{if(we.isValidElement(f)){let m=typeof f.props.id<"u"&&f.props.id===s;return we.cloneElement(f,{active:m,expand:t,onTabSelect:l,inverse:n})}return null})}),Vo(p,{bg:d.borderColour,height:d.borderHeight,width:"100%"})]})});Uo.displayName="Tabs";import Ga,{useState as Wa}from"react";import{styleResolvers as Oa}from"@fanduel/formation-shared-utils";import{jsx as J,jsxs as _o}from"react/jsx-runtime";var Ko=Ga.forwardRef(({active:e=!1,children:r,css:o,description:t,expand:a=!1,id:s,onTabSelect:n,inverse:i=!1,...c},l)=>{let[d,f]=Wa(!1),m=P=>{["Enter","Space"].includes(P.key)&&s&&n?.(s)},g=()=>f(!0),S=()=>f(!1),x=Oa.tabs({inverse:i,fixedWidth:a,active:e,hovered:d});return _o(u,{direction:"column",ref:l,position:"relative",...a?{flex:1}:{},children:[J(p,{as:"button",px:x.labelPad,bg:x.backgroundColour,border:"none",css:{appearance:"none",cursor:"pointer",...o},m:0,p:0,onClick:()=>s&&n?.(s),onKeyDown:m,onMouseEnter:g,onMouseLeave:S,textAlign:a?"center":"left",...c,children:_o(L,{direction:"column",py:"space3",flex:1,children:[J(L,{gap:"space1",wrap:!1,children:J(y,{as:"div",size:"lg",strong:!0,children:J(L,{as:"span",color:x.labelColour,gap:"space1",css:{whiteSpace:"nowrap"},children:r})})}),t&&J(y,{as:"span",color:x.descriptionColour,size:"sm",maxWidth:200,children:t})]})}),(e||d)&&J(p,{"aria-hidden":!0,bg:x.activeIndicatorColour,bottom:-1,height:4,position:"absolute",width:"100%"})]})});Ko.displayName="Tab";import ie from"react";import{styleResolvers as $a}from"@fanduel/formation-shared-utils";import{jsx as qo,jsxs as za}from"react/jsx-runtime";var Fe=ie.forwardRef(({children:e,count:r,disabled:o=!1,id:t,inverse:a=!1,label:s,large:n=!1,onClick:i,selected:c=!1,css:l,...d},f)=>{let[m,g]=ie.useState(!1),S=()=>{!o&&i&&i(t)},x=()=>{o||g(!0)},P=()=>{o||g(!1)},T=$a.pill({inverse:a,selected:c,disabled:o,hovered:m,large:n});return za(u,{align:"center",as:"button","aria-disabled":o,"aria-label":s,"aria-selected":c,bg:T.colour,border:"none",borderRadius:T.cornerRadius,gap:T.contentSpacing,height:T.height,id:t,onClick:S,onMouseEnter:x,onMouseLeave:P,px:T.spacing,py:0,ref:f,css:{appearance:"none",cursor:o?"not-allowed":"pointer",textDecoration:"none",...l},...d,children:[ie.Children.map(e,C=>ie.isValidElement(C)&&C.type===V&&!C.props.customIcon?ie.cloneElement(C,{color:T.contentColour,size:T.iconSize}):qo(y,{as:"span",color:T.contentColour,lineHeight:1,size:T.labelSize,strong:!0,children:C})),r&&qo(xe,{disabled:o,value:r,mr:T.countSpacingOffset})]})});Fe.displayName="Pill";import Le from"react";import{jsx as Va}from"react/jsx-runtime";var Jo=Le.forwardRef(({children:e,css:r,inverse:o=!1,large:t=!1,...a},s)=>Va(u,{ref:s,role:"group",gap:"space2",css:r,...a,children:Le.Children.map(e,n=>Le.isValidElement(n)&&n.type===Fe?Le.cloneElement(n,{inverse:o,large:t}):null)}));Jo.displayName="PillGroup";import Ue from"react";import{tokenMappers as le}from"@fanduel/formation-shared-utils";import{ArrowsArrowDown as Ua}from"@fanduel/formation-react-icons";import{jsx as N,jsxs as X}from"react/jsx-runtime";var Xo=Ue.forwardRef(({defaultValue:e="",label:r,helperText:o,errorMessage:t,css:a,isCondensed:s,isRequired:n,isOptional:i,isInvalid:c,isDisabled:l,value:d,id:f,onBlur:m,onFocus:g,onValueChange:S,options:x=[],placeholder:P,...T},C)=>{let[b,R]=H({value:d,defaultValue:e,onChange:S}),[M,h]=Ue.useState(!1),k=E=>{g?.(E),h(!0)},w=E=>{m?.(E),h(!1)},v=Ue.useMemo(()=>M?le.input("active"):c||t?le.input("error"):l?le.input("disabled"):le.input("base"),[M,c,t,l,le]);return X(p,{css:a,borderWidth:v.borderWidth,borderStyle:"solid",borderRadius:v.borderRadius,borderColor:v.borderColor,bg:v.backgroundColor,minWidth:0,children:[X(u,{direction:"column",py:"space3",px:"space4",gap:"space1",...s&&{py:"space2",px:"space3"},children:[X(u,{align:"baseline",justify:"space-between",mb:"space1",children:[X(B,{as:"label",htmlFor:f,size:"md",color:v.label,children:[r,n&&N(B,{as:"span",color:"systemImportantContentAccent",ml:"space1",children:"* Required"})]}),i&&N(y,{size:"sm",color:v.optional,children:"Optional"})]}),X(u,{align:"center",justifyContent:"space-between",gap:"space2",position:"relative",children:[X(p,{ref:C,"aria-required":n,color:P&&b===""?v.placeholder:v.content,disabled:l,value:b,as:"select",id:f,backgroundColor:"transparent",border:"none",outline:"none",fontFamily:v.typography,fontSize:v.typography,fontWeight:v.typography,letterSpacing:v.typography,lineHeight:v.typography,flex:"1",maxWidth:"100%",p:0,onChange:E=>R(E.target.value),...!l&&{onFocus:k,onBlur:w},css:{appearance:"none"},...l&&{cursor:"not-allowed"},...T,children:[P&&N("option",{value:"",disabled:!0,children:P}),x.map(E=>N("option",{value:E.value,children:E.label},E.value))]}),N(p,{color:l?"contentDisabled":"contentSubtle",position:"absolute",right:0,top:0,css:()=>({cursor:"pointer",pointerEvents:"none",...a}),children:N(Ua,{})})]}),t&&N(p,{children:N(y,{color:"componentDataInputContentError",marginTop:"space1",children:t})})]}),o&&N(p,{borderTopWidth:v.borderWidth,borderBottomLeftRadius:v.borderRadius,borderBottomRightRadius:v.borderRadius,borderTopColor:v.borderColor,bg:v.helperText.backgroundColor,borderTopStyle:"solid",px:"space4",py:"space1",...s&&{px:"space3"},children:N(y,{size:"sm",color:v.helperText.content,children:o})})]})});Xo.displayName="SelectField";import{useCollapse as _a}from"react-collapsed";import{jsx as Ka}from"react/jsx-runtime";var Ie=({as:e="div",children:r,css:o,expanded:t=!1,...a})=>{let{getCollapseProps:s}=_a({isExpanded:t});return Ka(p,{...s(),"aria-labelledby":void 0,as:e,id:void 0,css:o,...a,children:r})};Ie.displayName="Collapse";import Yo from"react";import{CollapsibleProvider as qa,useCollapsible as _e}from"@fanduel/formation-react";import{jsx as Me}from"react/jsx-runtime";var He=Yo.forwardRef(({as:e="div",children:r,css:o,defaultOpen:t=!1,disabled:a=!1,onOpenChange:s,open:n,...i},c)=>Me(qa,{disabled:a,initialState:t,open:n,onOpenChange:s,children:Me(p,{as:e,ref:c,css:o,...i,children:r})}));He.displayName="Collapsible";var Ee=Yo.forwardRef(({children:e,css:r,...o},t)=>{let{disabled:a,isOpen:s,toggle:n,uid:i}=_e();return Me(p,{"aria-controls":`${i}-panel`,"aria-disabled":a,"aria-expanded":s,as:"button",ref:t,bg:"transparent",color:"inherit",border:0,disabled:a,display:"block",fontFamily:"initial",fontSize:"initial",id:`${i}-trigger`,p:0,role:"button",onClick:n,textAlign:"initial",width:"100%",css:{...r,appearance:"none",cursor:a?"not-allowed":"pointer"},...o,children:e})});Ee.displayName="CollapsibleTrigger";var Ae=({as:e,children:r,...o})=>{let{isOpen:t,uid:a}=_e();return Me(Ie,{"aria-labelledby":`${a}-trigger`,as:e,expanded:t,id:`${a}-panel`,...o,children:r})};Ae.displayName="CollapsiblePanel";import Ke from"react";import{AccordionProvider as Ja,useAccordion as Xa}from"@fanduel/formation-react";import{jsx as pe}from"react/jsx-runtime";var Zo=Ke.forwardRef(({as:e="div",children:r,css:o,defaultOpen:t,multiple:a=!1,onOpenChange:s,open:n,...i},c)=>pe(Ja,{defaultOpen:t,multiple:a,open:n,onOpenChange:s,children:pe(u,{as:e,ref:c,align:"stretch",direction:"column",css:o,...i,children:r})}));Zo.displayName="Accordion";var jo=Ke.forwardRef(({as:e="div",children:r,css:o,id:t,...a},s)=>{let{isItemOpen:n,onItemToggle:i}=Xa();return pe(He,{as:e,ref:s,css:o,id:t,open:t?n(t):!1,onOpenChange:()=>i(t),...a,children:r})});jo.displayName="AccordionItem";var Qo=Ke.forwardRef(({children:e,css:r,...o},t)=>pe(Ee,{ref:t,css:r,...o,children:e}));Qo.displayName="AccordionItemControl";var et=({children:e,...r})=>pe(Ae,{...r,children:e});et.displayName="AccordionItemContent";import at from"react";import{createContext as Ya,useContext as Za,useMemo as ja}from"react";import{jsx as en}from"react/jsx-runtime";var ot=Ya(null),tt=()=>{let e=Za(ot);if(!e)throw new Error("useGrid() hook must be used within a GridProvider. Check your <LayoutGrid.Item> exists within a <LayoutGrid>!");return e},{Provider:Qa}=ot,rt=({children:e,columns:r,grow:o,gutter:t})=>{let a=ja(()=>({columns:r,grow:o,gutter:t}),[r,o,t]);return en(Qa,{value:a,children:e})};var Y=(e,r,o)=>{if(e===null||typeof e!="object")return o?[e].map(o):[e];if(!("base"in e))return[];let t=e.base,a=[t];r.forEach(i=>{let c=e[i];typeof c<"u"&&(t=c),a.push(t)});let s=a.length-1;for(;s>0&&a[s]===a[s-1];)s--;let n=a.slice(0,s+1);return o?n.map(o):n},qe=(e,r)=>(t=>t<=0?"0%":t>=r?"100%":Math.round(100/r*t*1e6)/1e6+"%")(e);import{jsx as Je}from"react/jsx-runtime";var nt=at.forwardRef(({as:e="div",children:r,css:o,align:t,columns:a=12,grow:s=!1,gutter:n="space0",justify:i,...c},l)=>{let{breakpointNames:d,space:f}=D(),m=Y(n,d,g=>-((f?.[g]??0)/2));return Je(rt,{columns:a,grow:s,gutter:n,children:Je(u,{as:e,ref:l,css:o,align:t,justify:i,m,...c,children:r})})});nt.displayName="LayoutGrid";var st=at.forwardRef(({as:e="div",children:r,css:o,offset:t=0,order:a,span:s,...n},i)=>{let{breakpointNames:c=[],space:l}=D(),{columns:d,grow:f,gutter:m}=tt(),g=Y(s??d,c,T=>qe(T,d)),S=Y(m,c,T=>(l?.[T]??0)/2),x=Y(t,c,T=>qe(T,d)),P=Y(a??0,c);return Je(p,{as:e,ref:i,css:o,flex:f?1:0,flexBasis:g,p:S,ml:x,order:P,...n,children:r})});st.displayName="LayoutGrid.Item";var on=Object.assign(nt,{Item:st});import O from"react";import{createContext as tn,useContext as rn,useMemo as an}from"react";import{jsx as sn}from"react/jsx-runtime";var it=tn(null),lt=()=>{let e=rn(it);if(!e)throw new Error("useScrollable() hook must be used within a ScrollableProvider. Check your <Scrollable.Item> exists within a <Scrollable>!");return e},{Provider:nn}=it,pt=({children:e,count:r,offset:o,snapping:t})=>{let a=an(()=>({count:r,offset:o,snapping:t}),[r,o,t]);return sn(nn,{value:a,children:e})};import{useEffect as pn,useState as mt}from"react";var ct=(e,r,o={width:32})=>{if(e&&r)return{};let t=o.width;return{maskImage:(()=>{let s="";return!r&&e?s=`linear-gradient(to left, transparent, rgba(0,0,0,1) ${t}px)`:!r&&!e?s=`linear-gradient(
to right,
transparent 0%,
black ${t}px,
black ${t}px,
black calc(100% - ${t}px),
black calc(100% - ${t}px),
transparent 100%
)`:s=`linear-gradient(to right, transparent, rgba(0,0,0,1) ${t}px)`,s})(),maskPosition:"0 0",maskSize:"100% 100%",maskRepeat:"no-repeat"}},ln=(e,r=0)=>{if(!e)return{atStart:!0,atEnd:!1};let{scrollLeft:o,scrollWidth:t,clientWidth:a}=e;return{atStart:o<=0+r,atEnd:o>=t-a-r}},dt=(e,r,o)=>()=>{let t=ln(e,r);o(t)};var ft=(e,r)=>{let[o,t]=mt(!0),[a,s]=mt(!1);return pn(()=>{let n=e.current,i=dt(n,r,c=>{t(c.atStart),s(c.atEnd)});return i(),n?.addEventListener("scroll",i),()=>{n?.removeEventListener("scroll",i)}},[]),{atStart:o,atEnd:a}};import{jsx as Z}from"react/jsx-runtime";var ut=O.forwardRef(({children:e,atStart:r,atEnd:o,disableFade:t,fadeWidth:a,...s},n)=>Z(p,{ref:n,position:"relative",maxWidth:"100%",css:{...!t&&ct(r,o,{width:a})},...s,children:e}));ut.displayName="Scrollable.Viewport";var xt=O.forwardRef(({children:e,scrollbar:r,spacing:o,...t},a)=>Z(u,{ref:a,gap:o,overflowX:"auto",css:()=>({...!r&&{scrollbarWidth:"none",msOverflowStyle:"none","::-webkit-scrollbar":{display:"none"}},scrollBehavior:"smooth",scrollSnapType:"x mandatory"}),tabIndex:0,wrap:!1,...t,children:e}));xt.displayName="Scrollable.Track";var gt=O.forwardRef(({children:e,disableFade:r=!1,fadeWidth:o=16,offset:t="space0",scrollbar:a=!1,spacing:s="space0",snapping:n="start",...i},c)=>{let l=O.useRef(null),d=O.useRef(null),m=D()?.space?.[t]??0,{atStart:g,atEnd:S}=ft(d,m),x=O.Children.toArray(e);return Z(pt,{count:x.length,offset:t,snapping:n,children:Z(ut,{ref:l,atStart:g,atEnd:S,disableFade:r,fadeWidth:o,...i,children:Z(xt,{ref:d,scrollbar:a,spacing:s,children:x.map((P,T)=>O.isValidElement(P)?O.cloneElement(P,{idx:T}):P)})})})});gt.displayName="Scrollable";var bt=O.forwardRef(({children:e,idx:r,...o},t)=>{let{space:a}=D(),{count:s,offset:n,snapping:i}=lt();return Z(p,{ref:t,flexShrink:0,pl:r===0?n:0,pr:r===s-1?n:0,css:{scrollSnapAlign:i,scrollSnapMargin:a?.[n]??void 0},...o,children:e})});bt.displayName="Scrollable.Item";var cn=Object.assign(gt,{Item:bt});import dn from"react";import{mergeProps as mn,useButton as fn,useFocusRing as un,useHover as xn,useObjectRef as gn}from"react-aria";var be=dn.forwardRef(({as:e="button",children:r,disabled:o=!1,loading:t=!1,onPress:a,...s},n)=>{let i=gn(n),c=o||t,{buttonProps:l,isPressed:d}=fn({...s,elementType:e,isDisabled:c,onPress:a},i),{focusProps:f,isFocused:m,isFocusVisible:g}=un({...s}),{hoverProps:S,isHovered:x}=xn({...s,isDisabled:c}),P=mn(l,S,f,{...s,...x&&{"data-hovered":!0},...m&&{"data-focused":!0},...g&&{"data-focus-visible":!0},...d&&{"data-pressed":!0},...o&&{"data-disabled":!0},...t&&{"data-loading":!0,"aria-busy":"true"},ref:i});return r({isDisabled:o,isHovered:x,isFocused:m,isFocusVisible:g,isPressed:d,isLoading:t},{...P,as:e})});be.displayName="Button";import Pn from"react";import{mergeProps as Sn,useFocusRing as Cn,useHover as vn,useObjectRef as kn,useToggleButton as Bn}from"react-aria";import{useState as bn,useRef as hn,useEffect as yn,useCallback as Tn}from"react";function Xe(e,r,o){let[t,a]=bn(e||r),s=hn(e!==void 0),n=e!==void 0;yn(()=>{let l=s.current;l!==n&&console.warn(`WARN: A component changed from ${l?"controlled":"uncontrolled"} to ${n?"controlled":"uncontrolled"}.`),s.current=n},[n]);let i=n?e:t,c=Tn((l,...d)=>{let f=(m,...g)=>{o&&(Object.is(i,m)||o(m,...g)),n||(i=m)};typeof l=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),a((g,...S)=>{let x=l(n?i:g,...S);return f(x,...d),n?g:x})):(n||a(l),f(l,...d))},[n,i,o]);return[i,c]}function Ye(e={}){let{isReadOnly:r}=e,[o,t]=Xe(e.isSelected,e.defaultSelected||!1,e.onChange);function a(n){r||t(n)}function s(){r||t(!o)}return{isSelected:o,setSelected:a,toggle:s}}var ht=Pn.forwardRef(({as:e="button",children:r,defaultSelected:o=!1,disabled:t=!1,loading:a=!1,onPress:s,selected:n,...i},c)=>{let l=kn(c),d=t||a,f=Ye({...i,isDisabled:d,isSelected:n,defaultSelected:o}),{buttonProps:m,isPressed:g,isSelected:S}=Bn({...i,elementType:e,isDisabled:d,defaultSelected:o,isSelected:n,...s},f,l),{focusProps:x,isFocused:P,isFocusVisible:T}=Cn({...i}),{hoverProps:C,isHovered:b}=vn({...i,isDisabled:d}),R=Sn(m,C,x,{...i,...b&&{"data-hovered":!0},...P&&{"data-focused":!0},...T&&{"data-focus-visible":!0},...g&&{"data-pressed":!0},...t&&{"data-disabled":!0},...a&&{"data-loading":!0,"aria-busy":"true"},...S&&{"data-selected":!0},ref:l});return r({isDisabled:t,isHovered:b,isFocused:P,isFocusVisible:T,isPressed:g,isLoading:a,isSelected:S},{...R,as:e})});ht.displayName="ToggleButton";export{Zo as Accordion,jo as AccordionItem,et as AccordionItemContent,Qo as AccordionItemControl,Fo as Avatar,xe as Badge,y as BodyText,p as Box,go as Button,be as ButtonPrimitive,me as ButtonText,co as Card,mo as CardContent,So as Checkbox,Ie as Collapse,He as Collapsible,Ae as CollapsiblePanel,Ee as CollapsibleTrigger,Io as DataChunk,To as DatePicker,zo as FixedBanner,u as Flex,Ao as FloatingBanner,Pt as FormationProvider,ho as Grid,z as HeaderText,V as Icon,yo as Image,Go as InlineMessage,ro as JumboText,B as LabelText,on as LayoutGrid,ge as Loader,ao as MetaDataText,Fe as Pill,Jo as PillGroup,vo as ProgressBar,ko as RadioButton,cn as Scrollable,Xo as SelectField,lo as SplitTag,L as Stack,wo as Switch,Ko as Tab,Uo as Tabs,fe as Tag,I as Text,Po as TextField,Oo as Toast,ht as ToggleButtonPrimitive,_e as useCollapsible,D as useTheme,H as useUncontrolled};
webpack://frontend-tpt/../../node_modules/@react-aria/button/dist/useToggleButton.mjs
import {useButton as $701a24aa0da5b062$export$ea18c227d4417cc3} from "./useButton.mjs";
import {chain as $h7Tql$chain, mergeProps as $h7Tql$mergeProps} from "@react-aria/utils";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $55f54f7887471b58$export$51e84d46ca0bc451(props, state, ref) {
const { isSelected: isSelected } = state;
const { isPressed: isPressed, buttonProps: buttonProps } = (0, $701a24aa0da5b062$export$ea18c227d4417cc3)({
...props,
onPress: (0, $h7Tql$chain)(state.toggle, props.onPress)
}, ref);
return {
isPressed: isPressed,
isSelected: isSelected,
isDisabled: props.isDisabled || false,
buttonProps: (0, $h7Tql$mergeProps)(buttonProps, {
'aria-pressed': isSelected
})
};
}
export {$55f54f7887471b58$export$51e84d46ca0bc451 as useToggleButton};
//# sourceMappingURL=useToggleButton.module.js.map
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
import objectWithoutPropertiesLoose from "./objectWithoutPropertiesLoose.js";
export default function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
webpack://frontend-tpt/../../node_modules/styled-components/native/dist/styled-components.native.esm.js
import transformDeclPairs from 'css-to-react-native';
import { typeOf, isElement, isValidElementType } from 'react-is';
import React, { useContext, useMemo, createElement, Component } from 'react';
import 'shallowequal';
import Stylis from '@emotion/stylis';
import unitless from '@emotion/unitless';
import supportsColor from 'supports-color';
import hoist from 'hoist-non-react-statics';
//
/* eslint-disable no-bitwise */
var AD_REPLACER_R = /(a)(d)/gi;
/* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised
* counterparts */
var charsLength = 52;
/* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */
var getAlphabeticChar = function getAlphabeticChar(code) {
return String.fromCharCode(code + (code > 25 ? 39 : 97));
};
/* input a number, usually a hash and convert it to base-52 */
function generateAlphabeticName(code) {
var name = '';
var x;
/* get a char and divide by alphabet-length */
for (x = Math.abs(code); x > charsLength; x = x / charsLength | 0) {
name = getAlphabeticChar(x % charsLength) + name;
}
return (getAlphabeticChar(x % charsLength) + name).replace(AD_REPLACER_R, '$1-$2');
}
//
/* eslint-disable */
var SEED = 5381; // When we have separate strings it's useful to run a progressive
// version of djb2 where we pretend that we're still looping over
// the same string
var phash = function phash(h, x) {
var i = x.length;
while (i) {
h = h * 33 ^ x.charCodeAt(--i);
}
return h;
}; // This is a djb2 hashing function
var hash = function hash(x) {
return phash(SEED, x);
};
//
var generateComponentId = (function (str) {
return generateAlphabeticName(hash(str) >>> 0);
});
//
function getComponentName(target) {
return (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) || // $FlowFixMe
target.displayName || // $FlowFixMe
target.name || 'Component';
}
//
function isFunction(test) {
return typeof test === 'function';
}
//
function isStatelessFunction(test) {
return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);
}
//
var isPlainObject = (function (x) {
return x !== null && typeof x === 'object' && (x.toString ? x.toString() : Object.prototype.toString.call(x)) === '[object Object]' && !typeOf(x);
});
//
function isStyledComponent(target) {
return target && typeof target.styledComponentId === 'string';
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
//
var SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
var SC_ATTR_ACTIVE = 'active';
var SC_ATTR_VERSION = 'data-styled-version';
var SC_VERSION = "5.3.1";
var SPLITTER = '/*!sc*/\n';
var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean' ? SC_DISABLE_SPEEDY : typeof process !== 'undefined' && typeof process.env.REACT_APP_SC_DISABLE_SPEEDY !== 'undefined' && process.env.REACT_APP_SC_DISABLE_SPEEDY !== '' ? process.env.REACT_APP_SC_DISABLE_SPEEDY === 'false' ? false : process.env.REACT_APP_SC_DISABLE_SPEEDY : typeof process !== 'undefined' && typeof process.env.SC_DISABLE_SPEEDY !== 'undefined' && process.env.SC_DISABLE_SPEEDY !== '' ? process.env.SC_DISABLE_SPEEDY === 'false' ? false : process.env.SC_DISABLE_SPEEDY : process.env.NODE_ENV !== 'production'); // Shared empty execution context when generating static styles
//
var EMPTY_ARRAY = Object.freeze([]);
var EMPTY_OBJECT = Object.freeze({});
var errorMap = {
"1": "Cannot create styled-component for component: %s.\n\n",
"2": "Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",
"3": "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",
"4": "The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",
"5": "The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",
"6": "Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",
"7": "ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n",
"8": "ThemeProvider: Please make your \"theme\" prop an object.\n\n",
"9": "Missing document `<head>`\n\n",
"10": "Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",
"11": "_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",
"12": "It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",
"13": "%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",
"14": "ThemeProvider: \"theme\" prop is required.\n\n",
"15": "A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",
"16": "Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",
"17": "CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"
};
//
var ERRORS = process.env.NODE_ENV !== 'production' ? errorMap : {};
/**
* super basic version of sprintf
*/
function format() {
var a = arguments.length <= 0 ? undefined : arguments[0];
var b = [];
for (var c = 1, len = arguments.length; c < len; c += 1) {
b.push(c < 0 || arguments.length <= c ? undefined : arguments[c]);
}
b.forEach(function (d) {
a = a.replace(/%[a-z]/, d);
});
return a;
}
/**
* Create an error file out of errors.md for development and a simple web link to the full errors
* in production mode.
*/
function throwStyledComponentsError(code) {
for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
if (process.env.NODE_ENV === 'production') {
throw new Error("An error occurred. See https://git.io/JUIaE#" + code + " for more information." + (interpolations.length > 0 ? " Args: " + interpolations.join(', ') : ''));
} else {
throw new Error(format.apply(void 0, [ERRORS[code]].concat(interpolations)).trim());
}
}
//
/** Create a GroupedTag with an underlying Tag implementation */
var makeGroupedTag = function makeGroupedTag(tag) {
return new DefaultGroupedTag(tag);
};
var BASE_SIZE = 1 << 9;
var DefaultGroupedTag = /*#__PURE__*/function () {
function DefaultGroupedTag(tag) {
this.groupSizes = new Uint32Array(BASE_SIZE);
this.length = BASE_SIZE;
this.tag = tag;
}
var _proto = DefaultGroupedTag.prototype;
_proto.indexOfGroup = function indexOfGroup(group) {
var index = 0;
for (var i = 0; i < group; i++) {
index += this.groupSizes[i];
}
return index;
};
_proto.insertRules = function insertRules(group, rules) {
if (group >= this.groupSizes.length) {
var oldBuffer = this.groupSizes;
var oldSize = oldBuffer.length;
var newSize = oldSize;
while (group >= newSize) {
newSize <<= 1;
if (newSize < 0) {
throwStyledComponentsError(16, "" + group);
}
}
this.groupSizes = new Uint32Array(newSize);
this.groupSizes.set(oldBuffer);
this.length = newSize;
for (var i = oldSize; i < newSize; i++) {
this.groupSizes[i] = 0;
}
}
var ruleIndex = this.indexOfGroup(group + 1);
for (var _i = 0, l = rules.length; _i < l; _i++) {
if (this.tag.insertRule(ruleIndex, rules[_i])) {
this.groupSizes[group]++;
ruleIndex++;
}
}
};
_proto.clearGroup = function clearGroup(group) {
if (group < this.length) {
var length = this.groupSizes[group];
var startIndex = this.indexOfGroup(group);
var endIndex = startIndex + length;
this.groupSizes[group] = 0;
for (var i = startIndex; i < endIndex; i++) {
this.tag.deleteRule(startIndex);
}
}
};
_proto.getGroup = function getGroup(group) {
var css = '';
if (group >= this.length || this.groupSizes[group] === 0) {
return css;
}
var length = this.groupSizes[group];
var startIndex = this.indexOfGroup(group);
var endIndex = startIndex + length;
for (var i = startIndex; i < endIndex; i++) {
css += "" + this.tag.getRule(i) + SPLITTER;
}
return css;
};
return DefaultGroupedTag;
}();
//
var MAX_SMI = 1 << 31 - 1;
var groupIDRegister = new Map();
var reverseRegister = new Map();
var nextFreeGroup = 1;
var getGroupForId = function getGroupForId(id) {
if (groupIDRegister.has(id)) {
return groupIDRegister.get(id);
}
while (reverseRegister.has(nextFreeGroup)) {
nextFreeGroup++;
}
var group = nextFreeGroup++;
if (process.env.NODE_ENV !== 'production' && ((group | 0) < 0 || group > MAX_SMI)) {
throwStyledComponentsError(16, "" + group);
}
groupIDRegister.set(id, group);
reverseRegister.set(group, id);
return group;
};
var getIdForGroup = function getIdForGroup(group) {
return reverseRegister.get(group);
};
var setGroupForId = function setGroupForId(id, group) {
if (group >= nextFreeGroup) {
nextFreeGroup = group + 1;
}
groupIDRegister.set(id, group);
reverseRegister.set(group, id);
};
//
var SELECTOR = "style[" + SC_ATTR + "][" + SC_ATTR_VERSION + "=\"" + SC_VERSION + "\"]";
var MARKER_RE = new RegExp("^" + SC_ATTR + "\\.g(\\d+)\\[id=\"([\\w\\d-]+)\"\\].*?\"([^\"]*)");
var outputSheet = function outputSheet(sheet) {
var tag = sheet.getTag();
var length = tag.length;
var css = '';
for (var group = 0; group < length; group++) {
var id = getIdForGroup(group);
if (id === undefined) continue;
var names = sheet.names.get(id);
var rules = tag.getGroup(group);
if (!names || !rules || !names.size) continue;
var selector = SC_ATTR + ".g" + group + "[id=\"" + id + "\"]";
var content = '';
if (names !== undefined) {
names.forEach(function (name) {
if (name.length > 0) {
content += name + ",";
}
});
} // NOTE: It's easier to collect rules and have the marker
// after the actual rules to simplify the rehydration
css += "" + rules + selector + "{content:\"" + content + "\"}" + SPLITTER;
}
return css;
};
var rehydrateNamesFromContent = function rehydrateNamesFromContent(sheet, id, content) {
var names = content.split(',');
var name;
for (var i = 0, l = names.length; i < l; i++) {
// eslint-disable-next-line
if (name = names[i]) {
sheet.registerName(id, name);
}
}
};
var rehydrateSheetFromTag = function rehydrateSheetFromTag(sheet, style) {
var parts = (style.innerHTML || '').split(SPLITTER);
var rules = [];
for (var i = 0, l = parts.length; i < l; i++) {
var part = parts[i].trim();
if (!part) continue;
var marker = part.match(MARKER_RE);
if (marker) {
var group = parseInt(marker[1], 10) | 0;
var id = marker[2];
if (group !== 0) {
// Rehydrate componentId to group index mapping
setGroupForId(id, group); // Rehydrate names and rules
// looks like: data-styled.g11[id="idA"]{content:"nameA,"}
rehydrateNamesFromContent(sheet, id, marker[3]);
sheet.getTag().insertRules(group, rules);
}
rules.length = 0;
} else {
rules.push(part);
}
}
};
var rehydrateSheet = function rehydrateSheet(sheet) {
var nodes = document.querySelectorAll(SELECTOR);
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (node && node.getAttribute(SC_ATTR) !== SC_ATTR_ACTIVE) {
rehydrateSheetFromTag(sheet, node);
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
}
};
//
/* eslint-disable camelcase, no-undef */
var getNonce = function getNonce() {
return typeof window !== 'undefined' ? typeof window.__webpack_nonce__ !== 'undefined' ? window.__webpack_nonce__ : null : null;
};
//
var ELEMENT_TYPE = 1;
/* Node.ELEMENT_TYPE */
/** Find last style element if any inside target */
var findLastStyleTag = function findLastStyleTag(target) {
var childNodes = target.childNodes;
for (var i = childNodes.length; i >= 0; i--) {
var child = childNodes[i];
if (child && child.nodeType === ELEMENT_TYPE && child.hasAttribute(SC_ATTR)) {
return child;
}
}
return undefined;
};
/** Create a style element inside `target` or <head> after the last */
var makeStyleTag = function makeStyleTag(target) {
var head = document.head;
var parent = target || head;
var style = document.createElement('style');
var prevStyle = findLastStyleTag(parent);
var nextSibling = prevStyle !== undefined ? prevStyle.nextSibling : null;
style.setAttribute(SC_ATTR, SC_ATTR_ACTIVE);
style.setAttribute(SC_ATTR_VERSION, SC_VERSION);
var nonce = getNonce();
if (nonce) style.setAttribute('nonce', nonce);
parent.insertBefore(style, nextSibling);
return style;
};
/** Get the CSSStyleSheet instance for a given style element */
var getSheet = function getSheet(tag) {
if (tag.sheet) {
return tag.sheet;
} // Avoid Firefox quirk where the style element might not have a sheet property
var _document = document,
styleSheets = _document.styleSheets;
for (var i = 0, l = styleSheets.length; i < l; i++) {
var sheet = styleSheets[i];
if (sheet.ownerNode === tag) {
return sheet;
}
}
throwStyledComponentsError(17);
return undefined;
};
//
/** Create a CSSStyleSheet-like tag depending on the environment */
var makeTag = function makeTag(_ref) {
var isServer = _ref.isServer,
useCSSOMInjection = _ref.useCSSOMInjection,
target = _ref.target;
if (isServer) {
return new VirtualTag(target);
} else if (useCSSOMInjection) {
return new CSSOMTag(target);
} else {
return new TextTag(target);
}
};
var CSSOMTag = /*#__PURE__*/function () {
function CSSOMTag(target) {
var element = this.element = makeStyleTag(target); // Avoid Edge bug where empty style elements don't create sheets
element.appendChild(document.createTextNode(''));
this.sheet = getSheet(element);
this.length = 0;
}
var _proto = CSSOMTag.prototype;
_proto.insertRule = function insertRule(index, rule) {
try {
this.sheet.insertRule(rule, index);
this.length++;
return true;
} catch (_error) {
return false;
}
};
_proto.deleteRule = function deleteRule(index) {
this.sheet.deleteRule(index);
this.length--;
};
_proto.getRule = function getRule(index) {
var rule = this.sheet.cssRules[index]; // Avoid IE11 quirk where cssText is inaccessible on some invalid rules
if (rule !== undefined && typeof rule.cssText === 'string') {
return rule.cssText;
} else {
return '';
}
};
return CSSOMTag;
}();
/** A Tag that emulates the CSSStyleSheet API but uses text nodes */
var TextTag = /*#__PURE__*/function () {
function TextTag(target) {
var element = this.element = makeStyleTag(target);
this.nodes = element.childNodes;
this.length = 0;
}
var _proto2 = TextTag.prototype;
_proto2.insertRule = function insertRule(index, rule) {
if (index <= this.length && index >= 0) {
var node = document.createTextNode(rule);
var refNode = this.nodes[index];
this.element.insertBefore(node, refNode || null);
this.length++;
return true;
} else {
return false;
}
};
_proto2.deleteRule = function deleteRule(index) {
this.element.removeChild(this.nodes[index]);
this.length--;
};
_proto2.getRule = function getRule(index) {
if (index < this.length) {
return this.nodes[index].textContent;
} else {
return '';
}
};
return TextTag;
}();
/** A completely virtual (server-side) Tag that doesn't manipulate the DOM */
var VirtualTag = /*#__PURE__*/function () {
function VirtualTag(_target) {
this.rules = [];
this.length = 0;
}
var _proto3 = VirtualTag.prototype;
_proto3.insertRule = function insertRule(index, rule) {
if (index <= this.length) {
this.rules.splice(index, 0, rule);
this.length++;
return true;
} else {
return false;
}
};
_proto3.deleteRule = function deleteRule(index) {
this.rules.splice(index, 1);
this.length--;
};
_proto3.getRule = function getRule(index) {
if (index < this.length) {
return this.rules[index];
} else {
return '';
}
};
return VirtualTag;
}();
var SHOULD_REHYDRATE = IS_BROWSER;
var defaultOptions = {
isServer: !IS_BROWSER,
useCSSOMInjection: !DISABLE_SPEEDY
};
/** Contains the main stylesheet logic for stringification and caching */
var StyleSheet = /*#__PURE__*/function () {
/** Register a group ID to give it an index */
StyleSheet.registerId = function registerId(id) {
return getGroupForId(id);
};
function StyleSheet(options, globalStyles, names) {
if (options === void 0) {
options = EMPTY_OBJECT;
}
if (globalStyles === void 0) {
globalStyles = {};
}
this.options = _extends({}, defaultOptions, {}, options);
this.gs = globalStyles;
this.names = new Map(names);
this.server = !!options.isServer; // We rehydrate only once and use the sheet that is created first
if (!this.server && IS_BROWSER && SHOULD_REHYDRATE) {
SHOULD_REHYDRATE = false;
rehydrateSheet(this);
}
}
var _proto = StyleSheet.prototype;
_proto.reconstructWithOptions = function reconstructWithOptions(options, withNames) {
if (withNames === void 0) {
withNames = true;
}
return new StyleSheet(_extends({}, this.options, {}, options), this.gs, withNames && this.names || undefined);
};
_proto.allocateGSInstance = function allocateGSInstance(id) {
return this.gs[id] = (this.gs[id] || 0) + 1;
}
/** Lazily initialises a GroupedTag for when it's actually needed */
;
_proto.getTag = function getTag() {
return this.tag || (this.tag = makeGroupedTag(makeTag(this.options)));
}
/** Check whether a name is known for caching */
;
_proto.hasNameForId = function hasNameForId(id, name) {
return this.names.has(id) && this.names.get(id).has(name);
}
/** Mark a group's name as known for caching */
;
_proto.registerName = function registerName(id, name) {
getGroupForId(id);
if (!this.names.has(id)) {
var groupNames = new Set();
groupNames.add(name);
this.names.set(id, groupNames);
} else {
this.names.get(id).add(name);
}
}
/** Insert new rules which also marks the name as known */
;
_proto.insertRules = function insertRules(id, name, rules) {
this.registerName(id, name);
this.getTag().insertRules(getGroupForId(id), rules);
}
/** Clears all cached names for a given group ID */
;
_proto.clearNames = function clearNames(id) {
if (this.names.has(id)) {
this.names.get(id).clear();
}
}
/** Clears all rules for a given group ID */
;
_proto.clearRules = function clearRules(id) {
this.getTag().clearGroup(getGroupForId(id));
this.clearNames(id);
}
/** Clears the entire tag which deletes all rules but not its names */
;
_proto.clearTag = function clearTag() {
// NOTE: This does not clear the names, since it's only used during SSR
// so that we can continuously output only new rules
this.tag = undefined;
}
/** Outputs the current sheet as a CSS string with markers for SSR */
;
_proto.toString = function toString() {
return outputSheet(this);
};
return StyleSheet;
}();
/**
* MIT License
*
* Copyright (c) 2016 Sultan Tarimo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* eslint-disable */
function insertRulePlugin (insertRule) {
var delimiter = '/*|*/';
var needle = delimiter + "}";
function toSheet(block) {
if (block) {
try {
insertRule(block + "}");
} catch (e) {}
}
}
return function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {
switch (context) {
// property
case 1:
// @import
if (depth === 0 && content.charCodeAt(0) === 64) return insertRule(content + ";"), '';
break;
// selector
case 2:
if (ns === 0) return content + delimiter;
break;
// at-rule
case 3:
switch (ns) {
// @font-face, @page
case 102:
case 112:
return insertRule(selectors[0] + content), '';
default:
return content + (at === 0 ? delimiter : '');
}
case -2:
content.split(needle).forEach(toSheet);
}
};
}
var COMMENT_REGEX = /^\s*\/\/.*$/gm;
var COMPLEX_SELECTOR_PREFIX = [':', '[', '.', '#'];
function createStylisInstance(_temp) {
var _ref = _temp === void 0 ? EMPTY_OBJECT : _temp,
_ref$options = _ref.options,
options = _ref$options === void 0 ? EMPTY_OBJECT : _ref$options,
_ref$plugins = _ref.plugins,
plugins = _ref$plugins === void 0 ? EMPTY_ARRAY : _ref$plugins;
var stylis = new Stylis(options); // Wrap `insertRulePlugin to build a list of rules,
// and then make our own plugin to return the rules. This
// makes it easier to hook into the existing SSR architecture
var parsingRules = []; // eslint-disable-next-line consistent-return
var returnRulesPlugin = function returnRulesPlugin(context) {
if (context === -2) {
var parsedRules = parsingRules;
parsingRules = [];
return parsedRules;
}
};
var parseRulesPlugin = insertRulePlugin(function (rule) {
parsingRules.push(rule);
});
var _componentId;
var _selector;
var _selectorRegexp;
var _consecutiveSelfRefRegExp;
var selfReferenceReplacer = function selfReferenceReplacer(match, offset, string) {
if ( // do not replace the first occurrence if it is complex (has a modifier)
(offset === 0 ? COMPLEX_SELECTOR_PREFIX.indexOf(string[_selector.length]) === -1 : true) && // no consecutive self refs (.b.b); that is a precedence boost and treated differently
!string.match(_consecutiveSelfRefRegExp)) {
return "." + _componentId;
}
return match;
};
/**
* When writing a style like
*
* & + & {
* color: red;
* }
*
* The second ampersand should be a reference to the static component class. stylis
* has no knowledge of static class so we have to intelligently replace the base selector.
*
* https://github.com/thysultan/stylis.js/tree/v3.5.4#plugins <- more info about the context phase values
* "2" means this plugin is taking effect at the very end after all other processing is complete
*/
var selfReferenceReplacementPlugin = function selfReferenceReplacementPlugin(context, _, selectors) {
if (context === 2 && selectors.length && selectors[0].lastIndexOf(_selector) > 0) {
// eslint-disable-next-line no-param-reassign
selectors[0] = selectors[0].replace(_selectorRegexp, selfReferenceReplacer);
}
};
stylis.use([].concat(plugins, [selfReferenceReplacementPlugin, parseRulesPlugin, returnRulesPlugin]));
function stringifyRules(css, selector, prefix, componentId) {
if (componentId === void 0) {
componentId = '&';
}
var flatCSS = css.replace(COMMENT_REGEX, '');
var cssStr = selector && prefix ? prefix + " " + selector + " { " + flatCSS + " }" : flatCSS; // stylis has no concept of state to be passed to plugins
// but since JS is single-threaded, we can rely on that to ensure
// these properties stay in sync with the current stylis run
_componentId = componentId;
_selector = selector;
_selectorRegexp = new RegExp("\\" + _selector + "\\b", 'g');
_consecutiveSelfRefRegExp = new RegExp("(\\" + _selector + "\\b){2,}");
return stylis(prefix || !selector ? '' : selector, cssStr);
}
stringifyRules.hash = plugins.length ? plugins.reduce(function (acc, plugin) {
if (!plugin.name) {
throwStyledComponentsError(15);
}
return phash(acc, plugin.name);
}, SEED).toString() : '';
return stringifyRules;
}
//
var StyleSheetContext = React.createContext();
var StyleSheetConsumer = StyleSheetContext.Consumer;
var StylisContext = React.createContext();
var StylisConsumer = StylisContext.Consumer;
var masterSheet = new StyleSheet();
var masterStylis = createStylisInstance();
//
var Keyframes = /*#__PURE__*/function () {
function Keyframes(name, rules) {
var _this = this;
this.inject = function (styleSheet, stylisInstance) {
if (stylisInstance === void 0) {
stylisInstance = masterStylis;
}
var resolvedName = _this.name + stylisInstance.hash;
if (!styleSheet.hasNameForId(_this.id, resolvedName)) {
styleSheet.insertRules(_this.id, resolvedName, stylisInstance(_this.rules, resolvedName, '@keyframes'));
}
};
this.toString = function () {
return throwStyledComponentsError(12, String(_this.name));
};
this.name = name;
this.id = "sc-keyframes-" + name;
this.rules = rules;
}
var _proto = Keyframes.prototype;
_proto.getName = function getName(stylisInstance) {
if (stylisInstance === void 0) {
stylisInstance = masterStylis;
}
return this.name + stylisInstance.hash;
};
return Keyframes;
}();
//
/**
* inlined version of
* https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js
*/
var uppercaseCheck = /([A-Z])/;
var uppercasePattern = /([A-Z])/g;
var msPattern = /^ms-/;
var prefixAndLowerCase = function prefixAndLowerCase(_char) {
return "-" + _char.toLowerCase();
};
/**
* Hyphenates a camelcased CSS property name, for example:
*
* > hyphenateStyleName('backgroundColor')
* < "background-color"
* > hyphenateStyleName('MozTransition')
* < "-moz-transition"
* > hyphenateStyleName('msTransition')
* < "-ms-transition"
*
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
* is converted to `-ms-`.
*
* @param {string} string
* @return {string}
*/
function hyphenateStyleName(string) {
return uppercaseCheck.test(string) ? string.replace(uppercasePattern, prefixAndLowerCase).replace(msPattern, '-ms-') : string;
}
//
function addUnitIfNeeded(name, value) {
// https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
// $FlowFixMe
if (value == null || typeof value === 'boolean' || value === '') {
return '';
}
if (typeof value === 'number' && value !== 0 && !(name in unitless)) {
return value + "px"; // Presumes implicit 'px' suffix for unitless numbers
}
return String(value).trim();
}
//
/**
* It's falsish not falsy because 0 is allowed.
*/
var isFalsish = function isFalsish(chunk) {
return chunk === undefined || chunk === null || chunk === false || chunk === '';
};
var objToCssArray = function objToCssArray(obj, prevKey) {
var rules = [];
for (var key in obj) {
if (!obj.hasOwnProperty(key) || isFalsish(obj[key])) continue;
if (Array.isArray(obj[key]) && obj[key].isCss || isFunction(obj[key])) {
rules.push(hyphenateStyleName(key) + ":", obj[key], ';');
} else if (isPlainObject(obj[key])) {
rules.push.apply(rules, objToCssArray(obj[key], key));
} else {
rules.push(hyphenateStyleName(key) + ": " + addUnitIfNeeded(key, obj[key]) + ";");
}
}
return prevKey ? [prevKey + " {"].concat(rules, ['}']) : rules;
};
function flatten(chunk, executionContext, styleSheet, stylisInstance) {
if (Array.isArray(chunk)) {
var ruleSet = [];
for (var i = 0, len = chunk.length, result; i < len; i += 1) {
result = flatten(chunk[i], executionContext, styleSheet, stylisInstance);
if (result === '') continue;else if (Array.isArray(result)) ruleSet.push.apply(ruleSet, result);else ruleSet.push(result);
}
return ruleSet;
}
if (isFalsish(chunk)) {
return '';
}
/* Handle other components */
if (isStyledComponent(chunk)) {
return "." + chunk.styledComponentId;
}
/* Either execute or defer the function */
if (isFunction(chunk)) {
if (isStatelessFunction(chunk) && executionContext) {
var _result = chunk(executionContext);
if (process.env.NODE_ENV !== 'production' && isElement(_result)) {
// eslint-disable-next-line no-console
console.warn(getComponentName(chunk) + " is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.");
}
return flatten(_result, executionContext, styleSheet, stylisInstance);
} else return chunk;
}
if (chunk instanceof Keyframes) {
if (styleSheet) {
chunk.inject(styleSheet, stylisInstance);
return chunk.getName(stylisInstance);
} else return chunk;
}
/* Handle objects */
return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();
}
//
var printed = {};
function warnOnce(message) {
if (printed[message]) return;
printed[message] = true;
if (typeof console !== 'undefined' && console.warn) console.warn(message);
}
//
var SINGLE_QUOTE = "'".charCodeAt(0);
var DOUBLE_QUOTE = '"'.charCodeAt(0);
var BACKSLASH = '\\'.charCodeAt(0);
var SLASH = '/'.charCodeAt(0);
var NEWLINE = '\n'.charCodeAt(0);
var SPACE = ' '.charCodeAt(0);
var FEED = '\f'.charCodeAt(0);
var TAB = '\t'.charCodeAt(0);
var CR = '\r'.charCodeAt(0);
var OPEN_SQUARE = '['.charCodeAt(0);
var CLOSE_SQUARE = ']'.charCodeAt(0);
var OPEN_PARENTHESES = '('.charCodeAt(0);
var CLOSE_PARENTHESES = ')'.charCodeAt(0);
var OPEN_CURLY = '{'.charCodeAt(0);
var CLOSE_CURLY = '}'.charCodeAt(0);
var SEMICOLON = ';'.charCodeAt(0);
var ASTERISK = '*'.charCodeAt(0);
var COLON = ':'.charCodeAt(0);
var AT = '@'.charCodeAt(0);
var RE_AT_END = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
var RE_WORD_END = /[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g;
var RE_BAD_BRACKET = /.[\\\/\("'\n]/;
function tokenize(input, options) {
if (options === void 0) {
options = {};
}
var tokens = [];
var css = input.css.valueOf();
var ignore = options.ignoreErrors;
var code, next, quote, lines, last, content, escape, nextLine, nextOffset, escaped, escapePos, prev, n;
var length = css.length;
var offset = -1;
var line = 1;
var pos = 0;
function unclosed(what) {
throw input.error("Unclosed " + what, line, pos - offset);
}
while (pos < length) {
code = css.charCodeAt(pos);
if (code === NEWLINE || code === FEED || code === CR && css.charCodeAt(pos + 1) !== NEWLINE) {
offset = pos;
line += 1;
}
switch (code) {
case NEWLINE:
case SPACE:
case TAB:
case CR:
case FEED:
next = pos;
do {
next += 1;
code = css.charCodeAt(next);
if (code === NEWLINE) {
offset = next;
line += 1;
}
} while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
tokens.push(['space', css.slice(pos, next)]);
pos = next - 1;
break;
case OPEN_SQUARE:
tokens.push(['[', '[', line, pos - offset]);
break;
case CLOSE_SQUARE:
tokens.push([']', ']', line, pos - offset]);
break;
case OPEN_CURLY:
tokens.push(['{', '{', line, pos - offset]);
break;
case CLOSE_CURLY:
tokens.push(['}', '}', line, pos - offset]);
break;
case COLON:
tokens.push([':', ':', line, pos - offset]);
break;
case SEMICOLON:
tokens.push([';', ';', line, pos - offset]);
break;
case OPEN_PARENTHESES:
prev = tokens.length ? tokens[tokens.length - 1][1] : '';
n = css.charCodeAt(pos + 1);
if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
next = pos;
do {
escaped = false;
next = css.indexOf(')', next + 1);
if (next === -1) {
if (ignore) {
next = pos;
break;
} else {
unclosed('bracket');
}
}
escapePos = next;
while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
escapePos -= 1;
escaped = !escaped;
}
} while (escaped);
tokens.push(['brackets', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
pos = next;
} else {
next = css.indexOf(')', pos + 1);
content = css.slice(pos, next + 1);
if (next === -1 || RE_BAD_BRACKET.test(content)) {
tokens.push(['(', '(', line, pos - offset]);
} else {
tokens.push(['brackets', content, line, pos - offset, line, next - offset]);
pos = next;
}
}
break;
case CLOSE_PARENTHESES:
tokens.push([')', ')', line, pos - offset]);
break;
case SINGLE_QUOTE:
case DOUBLE_QUOTE:
quote = code === SINGLE_QUOTE ? "'" : '"';
next = pos;
do {
escaped = false;
next = css.indexOf(quote, next + 1);
if (next === -1) {
if (ignore) {
next = pos + 1;
break;
} else {
unclosed('quote');
}
}
escapePos = next;
while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
escapePos -= 1;
escaped = !escaped;
}
} while (escaped);
content = css.slice(pos, next + 1);
lines = content.split('\n');
last = lines.length - 1;
if (last > 0) {
nextLine = line + last;
nextOffset = next - lines[last].length;
} else {
nextLine = line;
nextOffset = offset;
}
tokens.push(['string', css.slice(pos, next + 1), line, pos - offset, nextLine, next - nextOffset]);
offset = nextOffset;
line = nextLine;
pos = next;
break;
case AT:
RE_AT_END.lastIndex = pos + 1;
RE_AT_END.test(css);
if (RE_AT_END.lastIndex === 0) {
next = css.length - 1;
} else {
next = RE_AT_END.lastIndex - 2;
}
tokens.push(['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
pos = next;
break;
case BACKSLASH:
next = pos;
escape = true;
while (css.charCodeAt(next + 1) === BACKSLASH) {
next += 1;
escape = !escape;
}
code = css.charCodeAt(next + 1);
if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
next += 1;
}
tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
pos = next;
break;
default:
if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
next = css.indexOf('*/', pos + 2) + 1;
if (next === 0) {
if (ignore) {
next = css.length;
} else {
unclosed('comment');
}
}
content = css.slice(pos, next + 1);
lines = content.split('\n');
last = lines.length - 1;
if (last > 0) {
nextLine = line + last;
nextOffset = next - lines[last].length;
} else {
nextLine = line;
nextOffset = offset;
}
tokens.push(['comment', content, line, pos - offset, nextLine, next - nextOffset]);
offset = nextOffset;
line = nextLine;
pos = next;
} else {
RE_WORD_END.lastIndex = pos + 1;
RE_WORD_END.test(css);
if (RE_WORD_END.lastIndex === 0) {
next = css.length - 1;
} else {
next = RE_WORD_END.lastIndex - 2;
}
tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
pos = next;
}
break;
}
pos++;
}
return tokens;
}
//
var HIGHLIGHT_THEME = {
brackets: [36, 39],
// cyan
string: [31, 39],
// red
'at-word': [31, 39],
// red
comment: [90, 39],
// gray
'{': [32, 39],
// green
'}': [32, 39],
// green
':': [1, 22],
// bold
';': [1, 22],
// bold
'(': [1, 22],
// bold
')': [1, 22] // bold
};
function code(color) {
return "\x1B[" + color + "m";
}
function terminalHighlight(css) {
var tokens = tokenize(new Input(css), {
ignoreErrors: true
});
var result = [];
tokens.forEach(function (token) {
var color = HIGHLIGHT_THEME[token[0]];
if (color) {
result.push(token[1].split(/\r?\n/).map(function (i) {
return code(color[0]) + i + code(color[1]);
}).join('\n'));
} else {
result.push(token[1]);
}
});
return result.join('');
}
/**
* The CSS parser throws this error for broken CSS.
*
* Custom parsers can throw this error for broken custom syntax using
* the {@link Node#error} method.
*
* PostCSS will use the input source map to detect the original error location.
* If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS,
* PostCSS will show the original position in the Sass file.
*
* If you need the position in the PostCSS input
* (e.g., to debug the previous compiler), use `error.input.file`.
*
* @example
* // Catching and checking syntax error
* try {
* postcss.parse('a{')
* } catch (error) {
* if ( error.name === 'CssSyntaxError' ) {
* error //=> CssSyntaxError
* }
* }
*
* @example
* // Raising error from plugin
* throw node.error('Unknown variable', { plugin: 'postcss-vars' });
*/
var CssSyntaxError = /*#__PURE__*/function () {
/**
* @param {string} message - error message
* @param {number} [line] - source line of the error
* @param {number} [column] - source column of the error
* @param {string} [source] - source code of the broken file
* @param {string} [file] - absolute path to the broken file
* @param {string} [plugin] - PostCSS plugin name, if error came from plugin
*/
function CssSyntaxError(message, line, column, source, file, plugin) {
/**
* @member {string} - Always equal to `'CssSyntaxError'`. You should
* always check error type
* by `error.name === 'CssSyntaxError'` instead of
* `error instanceof CssSyntaxError`, because
* npm could have several PostCSS versions.
*
* @example
* if ( error.name === 'CssSyntaxError' ) {
* error //=> CssSyntaxError
* }
*/
this.name = 'CssSyntaxError';
/**
* @member {string} - Error message.
*
* @example
* error.message //=> 'Unclosed block'
*/
this.reason = message;
if (file) {
/**
* @member {string} - Absolute path to the broken file.
*
* @example
* error.file //=> 'a.sass'
* error.input.file //=> 'a.css'
*/
this.file = file;
}
if (source) {
/**
* @member {string} - Source code of the broken file.
*
* @example
* error.source //=> 'a { b {} }'
* error.input.column //=> 'a b { }'
*/
this.source = source;
}
if (plugin) {
/**
* @member {string} - Plugin name, if error came from plugin.
*
* @example
* error.plugin //=> 'postcss-vars'
*/
this.plugin = plugin;
}
if (typeof line !== 'undefined' && typeof column !== 'undefined') {
/**
* @member {number} - Source line of the error.
*
* @example
* error.line //=> 2
* error.input.line //=> 4
*/
this.line = line;
/**
* @member {number} - Source column of the error.
*
* @example
* error.column //=> 1
* error.input.column //=> 4
*/
this.column = column;
}
this.setMessage();
if (Error.captureStackTrace) {
Error.captureStackTrace(this, CssSyntaxError);
}
}
var _proto = CssSyntaxError.prototype;
_proto.setMessage = function setMessage() {
/**
* @member {string} - Full error text in the GNU error format
* with plugin, file, line and column.
*
* @example
* error.message //=> 'a.css:1:1: Unclosed block'
*/
this.message = this.plugin ? this.plugin + ": " : '';
this.message += this.file ? this.file : '<css input>';
if (typeof this.line !== 'undefined') {
this.message += ":" + this.line + ":" + this.column;
}
this.message += ": " + this.reason;
}
/**
* Returns a few lines of CSS source that caused the error.
*
* If the CSS has an input source map without `sourceContent`,
* this method will return an empty string.
*
* @param {boolean} [color] whether arrow will be colored red by terminal
* color codes. By default, PostCSS will detect
* color support by `process.stdout.isTTY`
* and `process.env.NODE_DISABLE_COLORS`.
*
* @example
* error.showSourceCode() //=> " 4 | }
* // 5 | a {
* // > 6 | bad
* // | ^
* // 7 | }
* // 8 | b {"
*
* @return {string} few lines of CSS source that caused the error
*/
;
_proto.showSourceCode = function showSourceCode(color) {
var _this = this;
if (!this.source) return '';
var css = this.source;
if (typeof color === 'undefined') color = supportsColor;
if (color) css = terminalHighlight(css);
var lines = css.split(/\r?\n/);
var start = Math.max(this.line - 3, 0);
var end = Math.min(this.line + 2, lines.length);
var maxWidth = String(end).length;
return lines.slice(start, end).map(function (line, index) {
var number = start + 1 + index;
var padded = (" " + number).slice(-maxWidth);
var gutter = " " + padded + " | ";
if (number === _this.line) {
var spacing = gutter.replace(/\d/g, ' ') + line.slice(0, _this.column - 1).replace(/[^\t]/g, ' ');
return ">" + gutter + line + "\n " + spacing + "^";
} else {
return " " + gutter + line;
}
}).join('\n');
}
/**
* Returns error position, message and source code of the broken part.
*
* @example
* error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
* // > 1 | a {
* // | ^"
*
* @return {string} error position, message and source code
*/
;
_proto.toString = function toString() {
var code = this.showSourceCode();
if (code) {
code = "\n\n" + code + "\n";
}
return this.name + ": " + this.message + code;
};
_createClass(CssSyntaxError, [{
key: "generated",
get: function get() {
warnOnce('CssSyntaxError#generated is deprecated. Use input instead.');
return this.input;
}
/**
* @memberof CssSyntaxError#
* @member {Input} input - Input object with PostCSS internal information
* about input file. If input has source map
* from previous tool, PostCSS will use origin
* (for example, Sass) source. You can use this
* object to get PostCSS input source.
*
* @example
* error.input.file //=> 'a.css'
* error.file //=> 'a.sass'
*/
}]);
return CssSyntaxError;
}();
//
/* eslint-disable valid-jsdoc */
var defaultRaw = {
colon: ': ',
indent: ' ',
beforeDecl: '\n',
beforeRule: '\n',
beforeOpen: ' ',
beforeClose: '\n',
beforeComment: '\n',
after: '\n',
emptyBody: '',
commentLeft: ' ',
commentRight: ' '
};
function capitalize(str) {
return str[0].toUpperCase() + str.slice(1);
}
var Stringifier = /*#__PURE__*/function () {
function Stringifier(builder) {
this.builder = builder;
}
var _proto = Stringifier.prototype;
_proto.stringify = function stringify(node, semicolon) {
this[node.type](node, semicolon);
};
_proto.root = function root(node) {
this.body(node);
if (node.raws.after) this.builder(node.raws.after);
};
_proto.comment = function comment(node) {
var left = this.raw(node, 'left', 'commentLeft');
var right = this.raw(node, 'right', 'commentRight');
this.builder("/*" + left + node.text + right + "*/", node);
};
_proto.decl = function decl(node, semicolon) {
var between = this.raw(node, 'between', 'colon');
var string = node.prop + between + this.rawValue(node, 'value');
if (node.important) {
string += node.raws.important || ' !important';
}
if (semicolon) string += ';';
this.builder(string, node);
};
_proto.rule = function rule(node) {
this.block(node, this.rawValue(node, 'selector'));
};
_proto.atrule = function atrule(node, semicolon) {
var name = "@" + node.name;
var params = node.params ? this.rawValue(node, 'params') : '';
if (typeof node.raws.afterName !== 'undefined') {
name += node.raws.afterName;
} else if (params) {
name += ' ';
}
if (node.nodes) {
this.block(node, name + params);
} else {
var end = (node.raws.between || '') + (semicolon ? ';' : '');
this.builder(name + params + end, node);
}
};
_proto.body = function body(node) {
var last = node.nodes.length - 1;
while (last > 0) {
if (node.nodes[last].type !== 'comment') break;
last -= 1;
}
var semicolon = this.raw(node, 'semicolon');
for (var i = 0; i < node.nodes.length; i++) {
var child = node.nodes[i];
var before = this.raw(child, 'before');
if (before) this.builder(before);
this.stringify(child, last !== i || semicolon);
}
};
_proto.block = function block(node, start) {
var between = this.raw(node, 'between', 'beforeOpen');
this.builder(start + between + "{", node, 'start');
var after;
if (node.nodes && node.nodes.length) {
this.body(node);
after = this.raw(node, 'after');
} else {
after = this.raw(node, 'after', 'emptyBody');
}
if (after) this.builder(after);
this.builder('}', node, 'end');
};
_proto.raw = function raw(node, own, detect) {
var value;
if (!detect) detect = own; // Already had
if (own) {
value = node.raws[own];
if (typeof value !== 'undefined') return value;
}
var parent = node.parent; // Hack for first rule in CSS
if (detect === 'before') {
if (!parent || parent.type === 'root' && parent.first === node) {
return '';
}
} // Floating child without parent
if (!parent) return defaultRaw[detect]; // Detect style by other nodes
var root = node.root();
if (!root.rawCache) root.rawCache = {};
if (typeof root.rawCache[detect] !== 'undefined') {
return root.rawCache[detect];
}
if (detect === 'before' || detect === 'after') {
return this.beforeAfter(node, detect);
} else {
var method = "raw" + capitalize(detect);
if (this[method]) {
value = this[method](root, node);
} else {
root.walk(function (i) {
value = i.raws[own];
if (typeof value !== 'undefined') return false;
});
}
}
if (typeof value === 'undefined') value = defaultRaw[detect];
root.rawCache[detect] = value;
return value;
};
_proto.rawSemicolon = function rawSemicolon(root) {
var value;
root.walk(function (i) {
if (i.nodes && i.nodes.length && i.last.type === 'decl') {
value = i.raws.semicolon;
if (typeof value !== 'undefined') return false;
}
});
return value;
};
_proto.rawEmptyBody = function rawEmptyBody(root) {
var value;
root.walk(function (i) {
if (i.nodes && i.nodes.length === 0) {
value = i.raws.after;
if (typeof value !== 'undefined') return false;
}
});
return value;
};
_proto.rawIndent = function rawIndent(root) {
if (root.raws.indent) return root.raws.indent;
var value;
root.walk(function (i) {
var p = i.parent;
if (p && p !== root && p.parent && p.parent === root) {
if (typeof i.raws.before !== 'undefined') {
var parts = i.raws.before.split('\n');
value = parts[parts.length - 1];
value = value.replace(/[^\s]/g, '');
return false;
}
}
});
return value;
};
_proto.rawBeforeComment = function rawBeforeComment(root, node) {
var value;
root.walkComments(function (i) {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before;
if (value.indexOf('\n') !== -1) {
value = value.replace(/[^\n]+$/, '');
}
return false;
}
});
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeDecl');
}
return value;
};
_proto.rawBeforeDecl = function rawBeforeDecl(root, node) {
var value;
root.walkDecls(function (i) {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before;
if (value.indexOf('\n') !== -1) {
value = value.replace(/[^\n]+$/, '');
}
return false;
}
});
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeRule');
}
return value;
};
_proto.rawBeforeRule = function rawBeforeRule(root) {
var value;
root.walk(function (i) {
if (i.nodes && (i.parent !== root || root.first !== i)) {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before;
if (value.indexOf('\n') !== -1) {
value = value.replace(/[^\n]+$/, '');
}
return false;
}
}
});
return value;
};
_proto.rawBeforeClose = function rawBeforeClose(root) {
var value;
root.walk(function (i) {
if (i.nodes && i.nodes.length > 0) {
if (typeof i.raws.after !== 'undefined') {
value = i.raws.after;
if (value.indexOf('\n') !== -1) {
value = value.replace(/[^\n]+$/, '');
}
return false;
}
}
});
return value;
};
_proto.rawBeforeOpen = function rawBeforeOpen(root) {
var value;
root.walk(function (i) {
if (i.type !== 'decl') {
value = i.raws.between;
if (typeof value !== 'undefined') return false;
}
});
return value;
};
_proto.rawColon = function rawColon(root) {
var value;
root.walkDecls(function (i) {
if (typeof i.raws.between !== 'undefined') {
value = i.raws.between.replace(/[^\s:]/g, '');
return false;
}
});
return value;
};
_proto.beforeAfter = function beforeAfter(node, detect) {
var value;
if (node.type === 'decl') {
value = this.raw(node, null, 'beforeDecl');
} else if (node.type === 'comment') {
value = this.raw(node, null, 'beforeComment');
} else if (detect === 'before') {
value = this.raw(node, null, 'beforeRule');
} else {
value = this.raw(node, null, 'beforeClose');
}
var buf = node.parent;
var depth = 0;
while (buf && buf.type !== 'root') {
depth += 1;
buf = buf.parent;
}
if (value.indexOf('\n') !== -1) {
var indent = this.raw(node, null, 'indent');
if (indent.length) {
for (var step = 0; step < depth; step++) {
value += indent;
}
}
}
return value;
};
_proto.rawValue = function rawValue(node, prop) {
var value = node[prop];
var raw = node.raws[prop];
if (raw && raw.value === value) {
return raw.raw;
} else {
return value;
}
};
return Stringifier;
}();
//
function stringify(node, builder) {
var str = new Stringifier(builder);
str.stringify(node);
}
/**
* @typedef {object} position
* @property {number} line - source line in file
* @property {number} column - source column in file
*/
/**
* @typedef {object} source
* @property {Input} input - {@link Input} with input file
* @property {position} start - The starting position of the node’s source
* @property {position} end - The ending position of the node’s source
*/
var cloneNode = function cloneNode(obj, parent) {
var cloned = new obj.constructor();
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
var value = obj[i];
var type = typeof value;
if (i === 'parent' && type === 'object') {
if (parent) cloned[i] = parent;
} else if (i === 'source') {
cloned[i] = value;
} else if (value instanceof Array) {
cloned[i] = value.map(function (j) {
return cloneNode(j, cloned);
});
} else if (i !== 'before' && i !== 'after' && i !== 'between' && i !== 'semicolon') {
if (type === 'object' && value !== null) value = cloneNode(value);
cloned[i] = value;
}
}
return cloned;
};
/**
* All node classes inherit the following common methods.
*
* @abstract
*/
var Node = /*#__PURE__*/function () {
/**
* @param {object} [defaults] - value for node properties
*/
function Node(defaults) {
if (defaults === void 0) {
defaults = {};
}
this.raws = {};
for (var name in defaults) {
this[name] = defaults[name];
}
}
/**
* Returns a CssSyntaxError instance containing the original position
* of the node in the source, showing line and column numbers and also
* a small excerpt to facilitate debugging.
*
* If present, an input source map will be used to get the original position
* of the source, even from a previous compilation step
* (e.g., from Sass compilation).
*
* This method produces very useful error messages.
*
* @param {string} message - error description
* @param {object} [opts] - options
* @param {string} opts.plugin - plugin name that created this error.
* PostCSS will set it automatically.
* @param {string} opts.word - a word inside a node’s string that should
* be highlighted as the source of the error
* @param {number} opts.index - an index inside a node’s string that should
* be highlighted as the source of the error
*
* @return {CssSyntaxError} error object to throw it
*
* @example
* if ( !variables[name] ) {
* throw decl.error('Unknown variable ' + name, { word: name });
* // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
* // color: $black
* // a
* // ^
* // background: white
* }
*/
var _proto = Node.prototype;
_proto.error = function error(message, opts) {
if (opts === void 0) {
opts = {};
}
if (this.source) {
var pos = this.positionBy(opts);
return this.source.input.error(message, pos.line, pos.column, opts);
} else {
return new CssSyntaxError(message);
}
}
/**
* This method is provided as a convenience wrapper for {@link Result#warn}.
*
* @param {Result} result - the {@link Result} instance
* that will receive the warning
* @param {string} text - warning message
* @param {object} [opts] - options
* @param {string} opts.plugin - plugin name that created this warning.
* PostCSS will set it automatically.
* @param {string} opts.word - a word inside a node’s string that should
* be highlighted as the source of the warning
* @param {number} opts.index - an index inside a node’s string that should
* be highlighted as the source of the warning
*
* @return {Warning} created warning object
*
* @example
* const plugin = postcss.plugin('postcss-deprecated', () => {
* return (root, result) => {
* root.walkDecls('bad', decl => {
* decl.warn(result, 'Deprecated property bad');
* });
* };
* });
*/
;
_proto.warn = function warn(result, text, opts) {
var data = {
node: this
};
for (var i in opts) {
data[i] = opts[i];
}
return result.warn(text, data);
}
/**
* Removes the node from its parent and cleans the parent properties
* from the node and its children.
*
* @example
* if ( decl.prop.match(/^-webkit-/) ) {
* decl.remove();
* }
*
* @return {Node} node to make calls chain
*/
;
_proto.remove = function remove() {
if (this.parent) {
this.parent.removeChild(this);
}
this.parent = undefined;
return this;
}
/**
* Returns a CSS string representing the node.
*
* @param {stringifier|syntax} [stringifier] - a syntax to use
* in string generation
*
* @return {string} CSS string of this node
*
* @example
* postcss.rule({ selector: 'a' }).toString() //=> "a {}"
*/
;
_proto.toString = function toString(stringifier) {
if (stringifier === void 0) {
stringifier = stringify;
}
if (stringifier.stringify) stringifier = stringifier.stringify;
var result = '';
stringifier(this, function (i) {
result += i;
});
return result;
}
/**
* Returns a clone of the node.
*
* The resulting cloned node and its (cloned) children will have
* a clean parent and code style properties.
*
* @param {object} [overrides] - new properties to override in the clone.
*
* @example
* const cloned = decl.clone({ prop: '-moz-' + decl.prop });
* cloned.raws.before //=> undefined
* cloned.parent //=> undefined
* cloned.toString() //=> -moz-transform: scale(0)
*
* @return {Node} clone of the node
*/
;
_proto.clone = function clone(overrides) {
if (overrides === void 0) {
overrides = {};
}
var cloned = cloneNode(this);
for (var name in overrides) {
cloned[name] = overrides[name];
}
return cloned;
}
/**
* Shortcut to clone the node and insert the resulting cloned node
* before the current node.
*
* @param {object} [overrides] - new properties to override in the clone.
*
* @example
* decl.cloneBefore({ prop: '-moz-' + decl.prop });
*
* @return {Node} - new node
*/
;
_proto.cloneBefore = function cloneBefore(overrides) {
if (overrides === void 0) {
overrides = {};
}
var cloned = this.clone(overrides);
this.parent.insertBefore(this, cloned);
return cloned;
}
/**
* Shortcut to clone the node and insert the resulting cloned node
* after the current node.
*
* @param {object} [overrides] - new properties to override in the clone.
*
* @return {Node} - new node
*/
;
_proto.cloneAfter = function cloneAfter(overrides) {
if (overrides === void 0) {
overrides = {};
}
var cloned = this.clone(overrides);
this.parent.insertAfter(this, cloned);
return cloned;
}
/**
* Inserts node(s) before the current node and removes the current node.
*
* @param {...Node} nodes - node(s) to replace current one
*
* @example
* if ( atrule.name == 'mixin' ) {
* atrule.replaceWith(mixinRules[atrule.params]);
* }
*
* @return {Node} current node to methods chain
*/
;
_proto.replaceWith = function replaceWith() {
var _this = this;
if (this.parent) {
for (var _len = arguments.length, nodes = new Array(_len), _key = 0; _key < _len; _key++) {
nodes[_key] = arguments[_key];
}
nodes.forEach(function (node) {
_this.parent.insertBefore(_this, node);
});
this.remove();
}
return this;
}
/**
* Removes the node from its current parent and inserts it
* at the end of `newParent`.
*
* This will clean the `before` and `after` code {@link Node#raws} data
* from the node and replace them with the indentation style of `newParent`.
* It will also clean the `between` property
* if `newParent` is in another {@link Root}.
*
* @param {Container} newParent - container node where the current node
* will be moved
*
* @example
* atrule.moveTo(atrule.root());
*
* @return {Node} current node to methods chain
*/
;
_proto.moveTo = function moveTo(newParent) {
this.cleanRaws(this.root() === newParent.root());
this.remove();
newParent.append(this);
return this;
}
/**
* Removes the node from its current parent and inserts it into
* a new parent before `otherNode`.
*
* This will also clean the node’s code style properties just as it would
* in {@link Node#moveTo}.
*
* @param {Node} otherNode - node that will be before current node
*
* @return {Node} current node to methods chain
*/
;
_proto.moveBefore = function moveBefore(otherNode) {
this.cleanRaws(this.root() === otherNode.root());
this.remove();
otherNode.parent.insertBefore(otherNode, this);
return this;
}
/**
* Removes the node from its current parent and inserts it into
* a new parent after `otherNode`.
*
* This will also clean the node’s code style properties just as it would
* in {@link Node#moveTo}.
*
* @param {Node} otherNode - node that will be after current node
*
* @return {Node} current node to methods chain
*/
;
_proto.moveAfter = function moveAfter(otherNode) {
this.cleanRaws(this.root() === otherNode.root());
this.remove();
otherNode.parent.insertAfter(otherNode, this);
return this;
}
/**
* Returns the next child of the node’s parent.
* Returns `undefined` if the current node is the last child.
*
* @return {Node|undefined} next node
*
* @example
* if ( comment.text === 'delete next' ) {
* const next = comment.next();
* if ( next ) {
* next.remove();
* }
* }
*/
;
_proto.next = function next() {
var index = this.parent.index(this);
return this.parent.nodes[index + 1];
}
/**
* Returns the previous child of the node’s parent.
* Returns `undefined` if the current node is the first child.
*
* @return {Node|undefined} previous node
*
* @example
* const annotation = decl.prev();
* if ( annotation.type == 'comment' ) {
* readAnnotation(annotation.text);
* }
*/
;
_proto.prev = function prev() {
var index = this.parent.index(this);
return this.parent.nodes[index - 1];
};
_proto.toJSON = function toJSON() {
var fixed = {};
for (var name in this) {
if (!this.hasOwnProperty(name)) continue;
if (name === 'parent') continue;
var value = this[name];
if (value instanceof Array) {
fixed[name] = value.map(function (i) {
if (typeof i === 'object' && i.toJSON) {
return i.toJSON();
} else {
return i;
}
});
} else if (typeof value === 'object' && value.toJSON) {
fixed[name] = value.toJSON();
} else {
fixed[name] = value;
}
}
return fixed;
}
/**
* Returns a {@link Node#raws} value. If the node is missing
* the code style property (because the node was manually built or cloned),
* PostCSS will try to autodetect the code style property by looking
* at other nodes in the tree.
*
* @param {string} prop - name of code style property
* @param {string} [defaultType] - name of default value, it can be missed
* if the value is the same as prop
*
* @example
* const root = postcss.parse('a { background: white }');
* root.nodes[0].append({ prop: 'color', value: 'black' });
* root.nodes[0].nodes[1].raws.before //=> undefined
* root.nodes[0].nodes[1].raw('before') //=> ' '
*
* @return {string} code style value
*/
;
_proto.raw = function raw(prop, defaultType) {
var str = new Stringifier();
return str.raw(this, prop, defaultType);
}
/**
* Finds the Root instance of the node’s tree.
*
* @example
* root.nodes[0].nodes[0].root() === root
*
* @return {Root} root parent
*/
;
_proto.root = function root() {
var result = this;
while (result.parent) {
result = result.parent;
}
return result;
};
_proto.cleanRaws = function cleanRaws(keepBetween) {
delete this.raws.before;
delete this.raws.after;
if (!keepBetween) delete this.raws.between;
};
_proto.positionInside = function positionInside(index) {
var string = this.toString();
var column = this.source.start.column;
var line = this.source.start.line;
for (var i = 0; i < index; i++) {
if (string[i] === '\n') {
column = 1;
line += 1;
} else {
column += 1;
}
}
return {
line: line,
column: column
};
};
_proto.positionBy = function positionBy(opts) {
var pos = this.source.start;
if (opts.index) {
pos = this.positionInside(opts.index);
} else if (opts.word) {
var index = this.toString().indexOf(opts.word);
if (index !== -1) pos = this.positionInside(index);
}
return pos;
};
_proto.removeSelf = function removeSelf() {
warnOnce('Node#removeSelf is deprecated. Use Node#remove.');
return this.remove();
};
_proto.replace = function replace(nodes) {
warnOnce('Node#replace is deprecated. Use Node#replaceWith');
return this.replaceWith(nodes);
};
_proto.style = function style(own, detect) {
warnOnce('Node#style() is deprecated. Use Node#raw()');
return this.raw(own, detect);
};
_proto.cleanStyles = function cleanStyles(keepBetween) {
warnOnce('Node#cleanStyles() is deprecated. Use Node#cleanRaws()');
return this.cleanRaws(keepBetween);
};
_createClass(Node, [{
key: "before",
get: function get() {
warnOnce('Node#before is deprecated. Use Node#raws.before');
return this.raws.before;
},
set: function set(val) {
warnOnce('Node#before is deprecated. Use Node#raws.before');
this.raws.before = val;
}
}, {
key: "between",
get: function get() {
warnOnce('Node#between is deprecated. Use Node#raws.between');
return this.raws.between;
},
set: function set(val) {
warnOnce('Node#between is deprecated. Use Node#raws.between');
this.raws.between = val;
}
/**
* @memberof Node#
* @member {string} type - String representing the node’s type.
* Possible values are `root`, `atrule`, `rule`,
* `decl`, or `comment`.
*
* @example
* postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
*/
/**
* @memberof Node#
* @member {Container} parent - the node’s parent node.
*
* @example
* root.nodes[0].parent == root;
*/
/**
* @memberof Node#
* @member {source} source - the input source of the node
*
* The property is used in source map generation.
*
* If you create a node manually (e.g., with `postcss.decl()`),
* that node will not have a `source` property and will be absent
* from the source map. For this reason, the plugin developer should
* consider cloning nodes to create new ones (in which case the new node’s
* source will reference the original, cloned node) or setting
* the `source` property manually.
*
* ```js
* // Bad
* const prefixed = postcss.decl({
* prop: '-moz-' + decl.prop,
* value: decl.value
* });
*
* // Good
* const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
* ```
*
* ```js
* if ( atrule.name == 'add-link' ) {
* const rule = postcss.rule({ selector: 'a', source: atrule.source });
* atrule.parent.insertBefore(atrule, rule);
* }
* ```
*
* @example
* decl.source.input.from //=> '/home/ai/a.sass'
* decl.source.start //=> { line: 10, column: 2 }
* decl.source.end //=> { line: 10, column: 12 }
*/
/**
* @memberof Node#
* @member {object} raws - Information to generate byte-to-byte equal
* node string as it was in the origin input.
*
* Every parser saves its own properties,
* but the default CSS parser uses:
*
* * `before`: the space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
* * `after`: the space symbols after the last child of the node
* to the end of the node.
* * `between`: the symbols between the property and value
* for declarations, selector and `{` for rules, or last parameter
* and `{` for at-rules.
* * `semicolon`: contains true if the last child has
* an (optional) semicolon.
* * `afterName`: the space between the at-rule name and its parameters.
* * `left`: the space symbols between `/*` and the comment’s text.
* * `right`: the space symbols between the comment’s text
* and <code>*/</code>.
* * `important`: the content of the important statement,
* if it is not just `!important`.
*
* PostCSS cleans selectors, declaration values and at-rule parameters
* from comments and extra spaces, but it stores origin content in raws
* properties. As such, if you don’t change a declaration’s value,
* PostCSS will use the raw value with comments.
*
* @example
* const root = postcss.parse('a {\n color:black\n}')
* root.first.first.raws //=> { before: '\n ', between: ':' }
*/
}]);
return Node;
}();
/**
* Represents a CSS declaration.
*
* @extends Node
*
* @example
* const root = postcss.parse('a { color: black }');
* const decl = root.first.first;
* decl.type //=> 'decl'
* decl.toString() //=> ' color: black'
*/
var Declaration = /*#__PURE__*/function (_Node) {
_inheritsLoose(Declaration, _Node);
function Declaration(defaults) {
var _this;
_this = _Node.call(this, defaults) || this;
_this.type = 'decl';
return _this;
}
_createClass(Declaration, [{
key: "_value",
get: function get() {
warnOnce('Node#_value was deprecated. Use Node#raws.value');
return this.raws.value;
},
set: function set(val) {
warnOnce('Node#_value was deprecated. Use Node#raws.value');
this.raws.value = val;
}
}, {
key: "_important",
get: function get() {
warnOnce('Node#_important was deprecated. Use Node#raws.important');
return this.raws.important;
},
set: function set(val) {
warnOnce('Node#_important was deprecated. Use Node#raws.important');
this.raws.important = val;
}
/**
* @memberof Declaration#
* @member {string} prop - the declaration’s property name
*
* @example
* const root = postcss.parse('a { color: black }');
* const decl = root.first.first;
* decl.prop //=> 'color'
*/
/**
* @memberof Declaration#
* @member {string} value - the declaration’s value
*
* @example
* const root = postcss.parse('a { color: black }');
* const decl = root.first.first;
* decl.value //=> 'black'
*/
/**
* @memberof Declaration#
* @member {boolean} important - `true` if the declaration
* has an !important annotation.
*
* @example
* const root = postcss.parse('a { color: black !important; color: red }');
* root.first.first.important //=> true
* root.first.last.important //=> undefined
*/
/**
* @memberof Declaration#
* @member {object} raws - Information to generate byte-to-byte equal
* node string as it was in the origin input.
*
* Every parser saves its own properties,
* but the default CSS parser uses:
*
* * `before`: the space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
* * `between`: the symbols between the property and value
* for declarations, selector and `{` for rules, or last parameter
* and `{` for at-rules.
* * `important`: the content of the important statement,
* if it is not just `!important`.
*
* PostCSS cleans declaration from comments and extra spaces,
* but it stores origin content in raws properties.
* As such, if you don’t change a declaration’s value,
* PostCSS will use the raw value with comments.
*
* @example
* const root = postcss.parse('a {\n color:black\n}')
* root.first.first.raws //=> { before: '\n ', between: ':' }
*/
}]);
return Declaration;
}(Node);
/**
* Represents a comment between declarations or statements (rule and at-rules).
*
* Comments inside selectors, at-rule parameters, or declaration values
* will be stored in the `raws` properties explained above.
*
* @extends Node
*/
var Comment = /*#__PURE__*/function (_Node) {
_inheritsLoose(Comment, _Node);
function Comment(defaults) {
var _this;
_this = _Node.call(this, defaults) || this;
_this.type = 'comment';
return _this;
}
_createClass(Comment, [{
key: "left",
get: function get() {
warnOnce('Comment#left was deprecated. Use Comment#raws.left');
return this.raws.left;
},
set: function set(val) {
warnOnce('Comment#left was deprecated. Use Comment#raws.left');
this.raws.left = val;
}
}, {
key: "right",
get: function get() {
warnOnce('Comment#right was deprecated. Use Comment#raws.right');
return this.raws.right;
},
set: function set(val) {
warnOnce('Comment#right was deprecated. Use Comment#raws.right');
this.raws.right = val;
}
/**
* @memberof Comment#
* @member {string} text - the comment’s text
*/
/**
* @memberof Comment#
* @member {object} raws - Information to generate byte-to-byte equal
* node string as it was in the origin input.
*
* Every parser saves its own properties,
* but the default CSS parser uses:
*
* * `before`: the space symbols before the node.
* * `left`: the space symbols between `/*` and the comment’s text.
* * `right`: the space symbols between the comment’s text.
*/
}]);
return Comment;
}(Node);
//
var Parser = /*#__PURE__*/function () {
function Parser(input) {
this.input = input;
this.pos = 0;
this.root = new Root();
this.current = this.root;
this.spaces = '';
this.semicolon = false;
this.root.source = {
input: input,
start: {
line: 1,
column: 1
}
};
}
var _proto = Parser.prototype;
_proto.tokenize = function tokenize$1() {
this.tokens = tokenize(this.input);
};
_proto.loop = function loop() {
var token;
while (this.pos < this.tokens.length) {
token = this.tokens[this.pos];
switch (token[0]) {
case 'space':
case ';':
this.spaces += token[1];
break;
case '}':
this.end(token);
break;
case 'comment':
this.comment(token);
break;
case 'at-word':
this.atrule(token);
break;
case '{':
this.emptyRule(token);
break;
default:
this.other();
break;
}
this.pos += 1;
}
this.endFile();
};
_proto.comment = function comment(token) {
var node = new Comment();
this.init(node, token[2], token[3]);
node.source.end = {
line: token[4],
column: token[5]
};
var text = token[1].slice(2, -2);
if (/^\s*$/.test(text)) {
node.text = '';
node.raws.left = text;
node.raws.right = '';
} else {
var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
node.text = match[2];
node.raws.left = match[1];
node.raws.right = match[3];
}
};
_proto.emptyRule = function emptyRule(token) {
var node = new Rule();
this.init(node, token[2], token[3]);
node.selector = '';
node.raws.between = '';
this.current = node;
};
_proto.other = function other() {
var token;
var end = false;
var type = null;
var colon = false;
var bracket = null;
var brackets = [];
var start = this.pos;
while (this.pos < this.tokens.length) {
token = this.tokens[this.pos];
type = token[0];
if (type === '(' || type === '[') {
if (!bracket) bracket = token;
brackets.push(type === '(' ? ')' : ']');
} else if (brackets.length === 0) {
if (type === ';') {
if (colon) {
this.decl(this.tokens.slice(start, this.pos + 1));
return;
} else {
break;
}
} else if (type === '{') {
this.rule(this.tokens.slice(start, this.pos + 1));
return;
} else if (type === '}') {
this.pos -= 1;
end = true;
break;
} else if (type === ':') {
colon = true;
}
} else if (type === brackets[brackets.length - 1]) {
brackets.pop();
if (brackets.length === 0) bracket = null;
}
this.pos += 1;
}
if (this.pos === this.tokens.length) {
this.pos -= 1;
end = true;
}
if (brackets.length > 0) this.unclosedBracket(bracket);
if (end && colon) {
while (this.pos > start) {
token = this.tokens[this.pos][0];
if (token !== 'space' && token !== 'comment') break;
this.pos -= 1;
}
this.decl(this.tokens.slice(start, this.pos + 1));
return;
}
this.unknownWord(start);
};
_proto.rule = function rule(tokens) {
tokens.pop();
var node = new Rule();
this.init(node, tokens[0][2], tokens[0][3]);
node.raws.between = this.spacesFromEnd(tokens);
this.raw(node, 'selector', tokens);
this.current = node;
};
_proto.decl = function decl(tokens) {
var node = new Declaration();
this.init(node);
var last = tokens[tokens.length - 1];
if (last[0] === ';') {
this.semicolon = true;
tokens.pop();
}
if (last[4]) {
node.source.end = {
line: last[4],
column: last[5]
};
} else {
node.source.end = {
line: last[2],
column: last[3]
};
}
while (tokens[0][0] !== 'word') {
node.raws.before += tokens.shift()[1];
}
node.source.start = {
line: tokens[0][2],
column: tokens[0][3]
};
node.prop = '';
while (tokens.length) {
var type = tokens[0][0];
if (type === ':' || type === 'space' || type === 'comment') {
break;
}
node.prop += tokens.shift()[1];
}
node.raws.between = '';
var token;
while (tokens.length) {
token = tokens.shift();
if (token[0] === ':') {
node.raws.between += token[1];
break;
} else {
node.raws.between += token[1];
}
}
if (node.prop[0] === '_' || node.prop[0] === '*') {
node.raws.before += node.prop[0];
node.prop = node.prop.slice(1);
}
node.raws.between += this.spacesFromStart(tokens);
this.precheckMissedSemicolon(tokens);
for (var i = tokens.length - 1; i > 0; i--) {
token = tokens[i];
if (token[1] === '!important') {
node.important = true;
var string = this.stringFrom(tokens, i);
string = this.spacesFromEnd(tokens) + string;
if (string !== ' !important') node.raws.important = string;
break;
} else if (token[1] === 'important') {
var cache = tokens.slice(0);
var str = '';
for (var j = i; j > 0; j--) {
var _type = cache[j][0];
if (str.trim().indexOf('!') === 0 && _type !== 'space') {
break;
}
str = cache.pop()[1] + str;
}
if (str.trim().indexOf('!') === 0) {
node.important = true;
node.raws.important = str;
tokens = cache;
}
}
if (token[0] !== 'space' && token[0] !== 'comment') {
break;
}
}
this.raw(node, 'value', tokens);
if (node.value.indexOf(':') !== -1) this.checkMissedSemicolon(tokens);
};
_proto.atrule = function atrule(token) {
var node = new AtRule();
node.name = token[1].slice(1);
if (node.name === '') {
this.unnamedAtrule(node, token);
}
this.init(node, token[2], token[3]);
var last = false;
var open = false;
var params = [];
this.pos += 1;
while (this.pos < this.tokens.length) {
token = this.tokens[this.pos];
if (token[0] === ';') {
node.source.end = {
line: token[2],
column: token[3]
};
this.semicolon = true;
break;
} else if (token[0] === '{') {
open = true;
break;
} else if (token[0] === '}') {
this.end(token);
break;
} else {
params.push(token);
}
this.pos += 1;
}
if (this.pos === this.tokens.length) {
last = true;
}
node.raws.between = this.spacesFromEnd(params);
if (params.length) {
node.raws.afterName = this.spacesFromStart(params);
this.raw(node, 'params', params);
if (last) {
token = params[params.length - 1];
node.source.end = {
line: token[4],
column: token[5]
};
this.spaces = node.raws.between;
node.raws.between = '';
}
} else {
node.raws.afterName = '';
node.params = '';
}
if (open) {
node.nodes = [];
this.current = node;
}
};
_proto.end = function end(token) {
if (this.current.nodes && this.current.nodes.length) {
this.current.raws.semicolon = this.semicolon;
}
this.semicolon = false;
this.current.raws.after = (this.current.raws.after || '') + this.spaces;
this.spaces = '';
if (this.current.parent) {
this.current.source.end = {
line: token[2],
column: token[3]
};
this.current = this.current.parent;
} else {
this.unexpectedClose(token);
}
};
_proto.endFile = function endFile() {
if (this.current.parent) this.unclosedBlock();
if (this.current.nodes && this.current.nodes.length) {
this.current.raws.semicolon = this.semicolon;
}
this.current.raws.after = (this.current.raws.after || '') + this.spaces;
} // Helpers
;
_proto.init = function init(node, line, column) {
this.current.push(node);
node.source = {
start: {
line: line,
column: column
},
input: this.input
};
node.raws.before = this.spaces;
this.spaces = '';
if (node.type !== 'comment') this.semicolon = false;
};
_proto.raw = function raw(node, prop, tokens) {
var token, type;
var length = tokens.length;
var value = '';
var clean = true;
for (var i = 0; i < length; i += 1) {
token = tokens[i];
type = token[0];
if (type === 'comment' || type === 'space' && i === length - 1) {
clean = false;
} else {
value += token[1];
}
}
if (!clean) {
var raw = tokens.reduce(function (all, i) {
return all + i[1];
}, '');
node.raws[prop] = {
value: value,
raw: raw
};
}
node[prop] = value;
};
_proto.spacesFromEnd = function spacesFromEnd(tokens) {
var lastTokenType;
var spaces = '';
while (tokens.length) {
lastTokenType = tokens[tokens.length - 1][0];
if (lastTokenType !== 'space' && lastTokenType !== 'comment') break;
spaces = tokens.pop()[1] + spaces;
}
return spaces;
};
_proto.spacesFromStart = function spacesFromStart(tokens) {
var next;
var spaces = '';
while (tokens.length) {
next = tokens[0][0];
if (next !== 'space' && next !== 'comment') break;
spaces += tokens.shift()[1];
}
return spaces;
};
_proto.stringFrom = function stringFrom(tokens, from) {
var result = '';
for (var i = from; i < tokens.length; i++) {
result += tokens[i][1];
}
tokens.splice(from, tokens.length - from);
return result;
};
_proto.colon = function colon(tokens) {
var brackets = 0;
var token, type, prev;
for (var i = 0; i < tokens.length; i++) {
token = tokens[i];
type = token[0];
if (type === '(') {
brackets += 1;
} else if (type === ')') {
brackets -= 1;
} else if (brackets === 0 && type === ':') {
if (!prev) {
this.doubleColon(token);
} else if (prev[0] === 'word' && prev[1] === 'progid') {
continue;
} else {
return i;
}
}
prev = token;
}
return false;
} // Errors
;
_proto.unclosedBracket = function unclosedBracket(bracket) {
throw this.input.error('Unclosed bracket', bracket[2], bracket[3]);
};
_proto.unknownWord = function unknownWord(start) {
var token = this.tokens[start];
throw this.input.error('Unknown word', token[2], token[3]);
};
_proto.unexpectedClose = function unexpectedClose(token) {
throw this.input.error('Unexpected }', token[2], token[3]);
};
_proto.unclosedBlock = function unclosedBlock() {
var pos = this.current.source.start;
throw this.input.error('Unclosed block', pos.line, pos.column);
};
_proto.doubleColon = function doubleColon(token) {
throw this.input.error('Double colon', token[2], token[3]);
};
_proto.unnamedAtrule = function unnamedAtrule(node, token) {
throw this.input.error('At-rule without name', token[2], token[3]);
};
_proto.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) {
};
_proto.checkMissedSemicolon = function checkMissedSemicolon(tokens) {
var colon = this.colon(tokens);
if (colon === false) return;
var founded = 0;
var token;
for (var j = colon - 1; j >= 0; j--) {
token = tokens[j];
if (token[0] !== 'space') {
founded += 1;
if (founded === 2) break;
}
}
throw this.input.error('Missed semicolon', token[2], token[3]);
};
return Parser;
}();
//
function parse(css, opts) {
if (opts && opts.safe) {
throw new Error('Option safe was removed. ' + 'Use parser: require("postcss-safe-parser")');
}
var input = new Input(css, opts);
var parser = new Parser(input);
try {
parser.tokenize();
parser.loop();
} catch (e) {
if (e.name === 'CssSyntaxError' && opts && opts.from) {
if (/\.scss$/i.test(opts.from)) {
e.message += '\nYou tried to parse SCSS with ' + 'the standard CSS parser; ' + 'try again with the postcss-scss parser';
} else if (/\.less$/i.test(opts.from)) {
e.message += '\nYou tried to parse Less with ' + 'the standard CSS parser; ' + 'try again with the postcss-less parser';
}
}
throw e;
}
return parser.root;
}
function cleanSource(nodes) {
return nodes.map(function (i) {
if (i.nodes) i.nodes = cleanSource(i.nodes);
delete i.source;
return i;
});
}
/**
* @callback childCondition
* @param {Node} node - container child
* @param {number} index - child index
* @param {Node[]} nodes - all container children
* @return {boolean}
*/
/**
* @callback childIterator
* @param {Node} node - container child
* @param {number} index - child index
* @return {false|undefined} returning `false` will break iteration
*/
/**
* The {@link Root}, {@link AtRule}, and {@link Rule} container nodes
* inherit some common methods to help work with their children.
*
* Note that all containers can store any content. If you write a rule inside
* a rule, PostCSS will parse it.
*
* @extends Node
* @abstract
*/
var Container = /*#__PURE__*/function (_Node) {
_inheritsLoose(Container, _Node);
function Container() {
return _Node.apply(this, arguments) || this;
}
var _proto = Container.prototype;
_proto.push = function push(child) {
child.parent = this;
this.nodes.push(child);
return this;
}
/**
* Iterates through the container’s immediate children,
* calling `callback` for each child.
*
* Returning `false` in the callback will break iteration.
*
* This method only iterates through the container’s immediate children.
* If you need to recursively iterate through all the container’s descendant
* nodes, use {@link Container#walk}.
*
* Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe
* if you are mutating the array of child nodes during iteration.
* PostCSS will adjust the current index to match the mutations.
*
* @param {childIterator} callback - iterator receives each node and index
*
* @return {false|undefined} returns `false` if iteration was broke
*
* @example
* const root = postcss.parse('a { color: black; z-index: 1 }');
* const rule = root.first;
*
* for ( let decl of rule.nodes ) {
* decl.cloneBefore({ prop: '-webkit-' + decl.prop });
* // Cycle will be infinite, because cloneBefore moves the current node
* // to the next index
* }
*
* rule.each(decl => {
* decl.cloneBefore({ prop: '-webkit-' + decl.prop });
* // Will be executed only for color and z-index
* });
*/
;
_proto.each = function each(callback) {
if (!this.lastEach) this.lastEach = 0;
if (!this.indexes) this.indexes = {};
this.lastEach += 1;
var id = this.lastEach;
this.indexes[id] = 0;
if (!this.nodes) return undefined;
var index, result;
while (this.indexes[id] < this.nodes.length) {
index = this.indexes[id];
result = callback(this.nodes[index], index);
if (result === false) break;
this.indexes[id] += 1;
}
delete this.indexes[id];
return result;
}
/**
* Traverses the container’s descendant nodes, calling callback
* for each node.
*
* Like container.each(), this method is safe to use
* if you are mutating arrays during iteration.
*
* If you only need to iterate through the container’s immediate children,
* use {@link Container#each}.
*
* @param {childIterator} callback - iterator receives each node and index
*
* @return {false|undefined} returns `false` if iteration was broke
*
* @example
* root.walk(node => {
* // Traverses all descendant nodes.
* });
*/
;
_proto.walk = function walk(callback) {
return this.each(function (child, i) {
var result = callback(child, i);
if (result !== false && child.walk) {
result = child.walk(callback);
}
return result;
});
}
/**
* Traverses the container’s descendant nodes, calling callback
* for each declaration node.
*
* If you pass a filter, iteration will only happen over declarations
* with matching properties.
*
* Like {@link Container#each}, this method is safe
* to use if you are mutating arrays during iteration.
*
* @param {string|RegExp} [prop] - string or regular expression
* to filter declarations by property name
* @param {childIterator} callback - iterator receives each node and index
*
* @return {false|undefined} returns `false` if iteration was broke
*
* @example
* root.walkDecls(decl => {
* checkPropertySupport(decl.prop);
* });
*
* root.walkDecls('border-radius', decl => {
* decl.remove();
* });
*
* root.walkDecls(/^background/, decl => {
* decl.value = takeFirstColorFromGradient(decl.value);
* });
*/
;
_proto.walkDecls = function walkDecls(prop, callback) {
if (!callback) {
callback = prop;
return this.walk(function (child, i) {
if (child.type === 'decl') {
return callback(child, i);
}
});
} else if (prop instanceof RegExp) {
return this.walk(function (child, i) {
if (child.type === 'decl' && prop.test(child.prop)) {
return callback(child, i);
}
});
} else {
return this.walk(function (child, i) {
if (child.type === 'decl' && child.prop === prop) {
return callback(child, i);
}
});
}
}
/**
* Traverses the container’s descendant nodes, calling callback
* for each rule node.
*
* If you pass a filter, iteration will only happen over rules
* with matching selectors.
*
* Like {@link Container#each}, this method is safe
* to use if you are mutating arrays during iteration.
*
* @param {string|RegExp} [selector] - string or regular expression
* to filter rules by selector
* @param {childIterator} callback - iterator receives each node and index
*
* @return {false|undefined} returns `false` if iteration was broke
*
* @example
* const selectors = [];
* root.walkRules(rule => {
* selectors.push(rule.selector);
* });
* console.log(`Your CSS uses ${selectors.length} selectors`);
*/
;
_proto.walkRules = function walkRules(selector, callback) {
if (!callback) {
callback = selector;
return this.walk(function (child, i) {
if (child.type === 'rule') {
return callback(child, i);
}
});
} else if (selector instanceof RegExp) {
return this.walk(function (child, i) {
if (child.type === 'rule' && selector.test(child.selector)) {
return callback(child, i);
}
});
} else {
return this.walk(function (child, i) {
if (child.type === 'rule' && child.selector === selector) {
return callback(child, i);
}
});
}
}
/**
* Traverses the container’s descendant nodes, calling callback
* for each at-rule node.
*
* If you pass a filter, iteration will only happen over at-rules
* that have matching names.
*
* Like {@link Container#each}, this method is safe
* to use if you are mutating arrays during iteration.
*
* @param {string|RegExp} [name] - string or regular expression
* to filter at-rules by name
* @param {childIterator} callback - iterator receives each node and index
*
* @return {false|undefined} returns `false` if iteration was broke
*
* @example
* root.walkAtRules(rule => {
* if ( isOld(rule.name) ) rule.remove();
* });
*
* let first = false;
* root.walkAtRules('charset', rule => {
* if ( !first ) {
* first = true;
* } else {
* rule.remove();
* }
* });
*/
;
_proto.walkAtRules = function walkAtRules(name, callback) {
if (!callback) {
callback = name;
return this.walk(function (child, i) {
if (child.type === 'atrule') {
return callback(child, i);
}
});
} else if (name instanceof RegExp) {
return this.walk(function (child, i) {
if (child.type === 'atrule' && name.test(child.name)) {
return callback(child, i);
}
});
} else {
return this.walk(function (child, i) {
if (child.type === 'atrule' && child.name === name) {
return callback(child, i);
}
});
}
}
/**
* Traverses the container’s descendant nodes, calling callback
* for each comment node.
*
* Like {@link Container#each}, this method is safe
* to use if you are mutating arrays during iteration.
*
* @param {childIterator} callback - iterator receives each node and index
*
* @return {false|undefined} returns `false` if iteration was broke
*
* @example
* root.walkComments(comment => {
* comment.remove();
* });
*/
;
_proto.walkComments = function walkComments(callback) {
return this.walk(function (child, i) {
if (child.type === 'comment') {
return callback(child, i);
}
});
}
/**
* Inserts new nodes to the start of the container.
*
* @param {...(Node|object|string|Node[])} children - new nodes
*
* @return {Node} this node for methods chain
*
* @example
* const decl1 = postcss.decl({ prop: 'color', value: 'black' });
* const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
* rule.append(decl1, decl2);
*
* root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
* root.append({ selector: 'a' }); // rule
* rule.append({ prop: 'color', value: 'black' }); // declaration
* rule.append({ text: 'Comment' }) // comment
*
* root.append('a {}');
* root.first.append('color: black; z-index: 1');
*/
;
_proto.append = function append() {
var _this = this;
for (var _len = arguments.length, children = new Array(_len), _key = 0; _key < _len; _key++) {
children[_key] = arguments[_key];
}
children.forEach(function (child) {
var nodes = _this.normalize(child, _this.last);
nodes.forEach(function (node) {
return _this.nodes.push(node);
});
});
return this;
}
/**
* Inserts new nodes to the end of the container.
*
* @param {...(Node|object|string|Node[])} children - new nodes
*
* @return {Node} this node for methods chain
*
* @example
* const decl1 = postcss.decl({ prop: 'color', value: 'black' });
* const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
* rule.prepend(decl1, decl2);
*
* root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
* root.append({ selector: 'a' }); // rule
* rule.append({ prop: 'color', value: 'black' }); // declaration
* rule.append({ text: 'Comment' }) // comment
*
* root.append('a {}');
* root.first.append('color: black; z-index: 1');
*/
;
_proto.prepend = function prepend() {
var _this2 = this;
for (var _len2 = arguments.length, children = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
children[_key2] = arguments[_key2];
}
children = children.reverse();
children.forEach(function (child) {
var nodes = _this2.normalize(child, _this2.first, 'prepend').reverse();
nodes.forEach(function (node) {
return _this2.nodes.unshift(node);
});
for (var id in _this2.indexes) {
_this2.indexes[id] = _this2.indexes[id] + nodes.length;
}
});
return this;
};
_proto.cleanRaws = function cleanRaws(keepBetween) {
_Node.prototype.cleanRaws.call(this, keepBetween);
if (this.nodes) {
this.nodes.forEach(function (node) {
return node.cleanRaws(keepBetween);
});
}
}
/**
* Insert new node before old node within the container.
*
* @param {Node|number} exist - child or child’s index.
* @param {Node|object|string|Node[]} add - new node
*
* @return {Node} this node for methods chain
*
* @example
* rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
*/
;
_proto.insertBefore = function insertBefore(exist, add) {
var _this3 = this;
exist = this.index(exist);
var type = exist === 0 ? 'prepend' : false;
var nodes = this.normalize(add, this.nodes[exist], type).reverse();
nodes.forEach(function (node) {
return _this3.nodes.splice(exist, 0, node);
});
var index;
for (var id in this.indexes) {
index = this.indexes[id];
if (exist <= index) {
this.indexes[id] = index + nodes.length;
}
}
return this;
}
/**
* Insert new node after old node within the container.
*
* @param {Node|number} exist - child or child’s index
* @param {Node|object|string|Node[]} add - new node
*
* @return {Node} this node for methods chain
*/
;
_proto.insertAfter = function insertAfter(exist, add) {
var _this4 = this;
exist = this.index(exist);
var nodes = this.normalize(add, this.nodes[exist]).reverse();
nodes.forEach(function (node) {
return _this4.nodes.splice(exist + 1, 0, node);
});
var index;
for (var id in this.indexes) {
index = this.indexes[id];
if (exist < index) {
this.indexes[id] = index + nodes.length;
}
}
return this;
};
_proto.remove = function remove(child) {
if (typeof child !== 'undefined') {
warnOnce('Container#remove is deprecated. ' + 'Use Container#removeChild');
this.removeChild(child);
} else {
_Node.prototype.remove.call(this);
}
return this;
}
/**
* Removes node from the container and cleans the parent properties
* from the node and its children.
*
* @param {Node|number} child - child or child’s index
*
* @return {Node} this node for methods chain
*
* @example
* rule.nodes.length //=> 5
* rule.removeChild(decl);
* rule.nodes.length //=> 4
* decl.parent //=> undefined
*/
;
_proto.removeChild = function removeChild(child) {
child = this.index(child);
this.nodes[child].parent = undefined;
this.nodes.splice(child, 1);
var index;
for (var id in this.indexes) {
index = this.indexes[id];
if (index >= child) {
this.indexes[id] = index - 1;
}
}
return this;
}
/**
* Removes all children from the container
* and cleans their parent properties.
*
* @return {Node} this node for methods chain
*
* @example
* rule.removeAll();
* rule.nodes.length //=> 0
*/
;
_proto.removeAll = function removeAll() {
this.nodes.forEach(function (node) {
return node.parent = undefined;
});
this.nodes = [];
return this;
}
/**
* Passes all declaration values within the container that match pattern
* through callback, replacing those values with the returned result
* of callback.
*
* This method is useful if you are using a custom unit or function
* and need to iterate through all values.
*
* @param {string|RegExp} pattern - replace pattern
* @param {object} opts - options to speed up the search
* @param {string|string[]} opts.props - an array of property names
* @param {string} opts.fast - string that’s used
* to narrow down values and speed up
the regexp search
* @param {function|string} callback - string to replace pattern
* or callback that returns a new
* value.
* The callback will receive
* the same arguments as those
* passed to a function parameter
* of `String#replace`.
*
* @return {Node} this node for methods chain
*
* @example
* root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
* return 15 * parseInt(string) + 'px';
* });
*/
;
_proto.replaceValues = function replaceValues(pattern, opts, callback) {
if (!callback) {
callback = opts;
opts = {};
}
this.walkDecls(function (decl) {
if (opts.props && opts.props.indexOf(decl.prop) === -1) return;
if (opts.fast && decl.value.indexOf(opts.fast) === -1) return;
decl.value = decl.value.replace(pattern, callback);
});
return this;
}
/**
* Returns `true` if callback returns `true`
* for all of the container’s children.
*
* @param {childCondition} condition - iterator returns true or false.
*
* @return {boolean} is every child pass condition
*
* @example
* const noPrefixes = rule.every(i => i.prop[0] !== '-');
*/
;
_proto.every = function every(condition) {
return this.nodes.every(condition);
}
/**
* Returns `true` if callback returns `true` for (at least) one
* of the container’s children.
*
* @param {childCondition} condition - iterator returns true or false.
*
* @return {boolean} is some child pass condition
*
* @example
* const hasPrefix = rule.some(i => i.prop[0] === '-');
*/
;
_proto.some = function some(condition) {
return this.nodes.some(condition);
}
/**
* Returns a `child`’s index within the {@link Container#nodes} array.
*
* @param {Node} child - child of the current container.
*
* @return {number} child index
*
* @example
* rule.index( rule.nodes[2] ) //=> 2
*/
;
_proto.index = function index(child) {
if (typeof child === 'number') {
return child;
} else {
return this.nodes.indexOf(child);
}
}
/**
* The container’s first child.
*
* @type {Node}
*
* @example
* rule.first == rules.nodes[0];
*/
;
_proto.normalize = function normalize(nodes, sample) {
var _this5 = this;
if (typeof nodes === 'string') {
nodes = cleanSource(parse(nodes).nodes);
} else if (!Array.isArray(nodes)) {
if (nodes.type === 'root') {
nodes = nodes.nodes;
} else if (nodes.type) {
nodes = [nodes];
} else if (nodes.prop) {
if (typeof nodes.value === 'undefined') {
throw new Error('Value field is missed in node creation');
} else if (typeof nodes.value !== 'string') {
nodes.value = String(nodes.value);
}
nodes = [new Declaration(nodes)];
} else if (nodes.selector) {
nodes = [new Rule(nodes)];
} else if (nodes.name) {
nodes = [new AtRule(nodes)];
} else if (nodes.text) {
nodes = [new Comment(nodes)];
} else {
throw new Error('Unknown node type in node creation');
}
}
var processed = nodes.map(function (i) {
if (typeof i.raws === 'undefined') i = _this5.rebuild(i);
if (i.parent) i = i.clone();
if (typeof i.raws.before === 'undefined') {
if (sample && typeof sample.raws.before !== 'undefined') {
i.raws.before = sample.raws.before.replace(/[^\s]/g, '');
}
}
i.parent = _this5;
return i;
});
return processed;
};
_proto.rebuild = function rebuild(node, parent) {
var _this6 = this;
var fix;
if (node.type === 'root') {
fix = new Root();
} else if (node.type === 'atrule') {
fix = new AtRule();
} else if (node.type === 'rule') {
fix = new Rule();
} else if (node.type === 'decl') {
fix = new Declaration();
} else if (node.type === 'comment') {
fix = new Comment();
}
for (var i in node) {
if (i === 'nodes') {
fix.nodes = node.nodes.map(function (j) {
return _this6.rebuild(j, fix);
});
} else if (i === 'parent' && parent) {
fix.parent = parent;
} else if (node.hasOwnProperty(i)) {
fix[i] = node[i];
}
}
return fix;
};
_proto.eachInside = function eachInside(callback) {
warnOnce('Container#eachInside is deprecated. ' + 'Use Container#walk instead.');
return this.walk(callback);
};
_proto.eachDecl = function eachDecl(prop, callback) {
warnOnce('Container#eachDecl is deprecated. ' + 'Use Container#walkDecls instead.');
return this.walkDecls(prop, callback);
};
_proto.eachRule = function eachRule(selector, callback) {
warnOnce('Container#eachRule is deprecated. ' + 'Use Container#walkRules instead.');
return this.walkRules(selector, callback);
};
_proto.eachAtRule = function eachAtRule(name, callback) {
warnOnce('Container#eachAtRule is deprecated. ' + 'Use Container#walkAtRules instead.');
return this.walkAtRules(name, callback);
};
_proto.eachComment = function eachComment(callback) {
warnOnce('Container#eachComment is deprecated. ' + 'Use Container#walkComments instead.');
return this.walkComments(callback);
};
_createClass(Container, [{
key: "first",
get: function get() {
if (!this.nodes) return undefined;
return this.nodes[0];
}
/**
* The container’s last child.
*
* @type {Node}
*
* @example
* rule.last == rule.nodes[rule.nodes.length - 1];
*/
}, {
key: "last",
get: function get() {
if (!this.nodes) return undefined;
return this.nodes[this.nodes.length - 1];
}
}, {
key: "semicolon",
get: function get() {
warnOnce('Node#semicolon is deprecated. Use Node#raws.semicolon');
return this.raws.semicolon;
},
set: function set(val) {
warnOnce('Node#semicolon is deprecated. Use Node#raws.semicolon');
this.raws.semicolon = val;
}
}, {
key: "after",
get: function get() {
warnOnce('Node#after is deprecated. Use Node#raws.after');
return this.raws.after;
},
set: function set(val) {
warnOnce('Node#after is deprecated. Use Node#raws.after');
this.raws.after = val;
}
/**
* @memberof Container#
* @member {Node[]} nodes - an array containing the container’s children
*
* @example
* const root = postcss.parse('a { color: black }');
* root.nodes.length //=> 1
* root.nodes[0].selector //=> 'a'
* root.nodes[0].nodes[0].prop //=> 'color'
*/
}]);
return Container;
}(Node);
/**
* Represents an at-rule.
*
* If it’s followed in the CSS by a {} block, this node will have
* a nodes property representing its children.
*
* @extends Container
*
* @example
* const root = postcss.parse('@charset "UTF-8"; @media print {}');
*
* const charset = root.first;
* charset.type //=> 'atrule'
* charset.nodes //=> undefined
*
* const media = root.last;
* media.nodes //=> []
*/
var AtRule = /*#__PURE__*/function (_Container) {
_inheritsLoose(AtRule, _Container);
function AtRule(defaults) {
var _this;
_this = _Container.call(this, defaults) || this;
_this.type = 'atrule';
return _this;
}
var _proto = AtRule.prototype;
_proto.append = function append() {
var _Container$prototype$;
if (!this.nodes) this.nodes = [];
for (var _len = arguments.length, children = new Array(_len), _key = 0; _key < _len; _key++) {
children[_key] = arguments[_key];
}
return (_Container$prototype$ = _Container.prototype.append).call.apply(_Container$prototype$, [this].concat(children));
};
_proto.prepend = function prepend() {
var _Container$prototype$2;
if (!this.nodes) this.nodes = [];
for (var _len2 = arguments.length, children = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
children[_key2] = arguments[_key2];
}
return (_Container$prototype$2 = _Container.prototype.prepend).call.apply(_Container$prototype$2, [this].concat(children));
};
_createClass(AtRule, [{
key: "afterName",
get: function get() {
warnOnce('AtRule#afterName was deprecated. Use AtRule#raws.afterName');
return this.raws.afterName;
},
set: function set(val) {
warnOnce('AtRule#afterName was deprecated. Use AtRule#raws.afterName');
this.raws.afterName = val;
}
}, {
key: "_params",
get: function get() {
warnOnce('AtRule#_params was deprecated. Use AtRule#raws.params');
return this.raws.params;
},
set: function set(val) {
warnOnce('AtRule#_params was deprecated. Use AtRule#raws.params');
this.raws.params = val;
}
/**
* @memberof AtRule#
* @member {string} name - the at-rule’s name immediately follows the `@`
*
* @example
* const root = postcss.parse('@media print {}');
* media.name //=> 'media'
* const media = root.first;
*/
/**
* @memberof AtRule#
* @member {string} params - the at-rule’s parameters, the values
* that follow the at-rule’s name but precede
* any {} block
*
* @example
* const root = postcss.parse('@media print, screen {}');
* const media = root.first;
* media.params //=> 'print, screen'
*/
/**
* @memberof AtRule#
* @member {object} raws - Information to generate byte-to-byte equal
* node string as it was in the origin input.
*
* Every parser saves its own properties,
* but the default CSS parser uses:
*
* * `before`: the space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
* * `after`: the space symbols after the last child of the node
* to the end of the node.
* * `between`: the symbols between the property and value
* for declarations, selector and `{` for rules, or last parameter
* and `{` for at-rules.
* * `semicolon`: contains true if the last child has
* an (optional) semicolon.
* * `afterName`: the space between the at-rule name and its parameters.
*
* PostCSS cleans at-rule parameters from comments and extra spaces,
* but it stores origin content in raws properties.
* As such, if you don’t change a declaration’s value,
* PostCSS will use the raw value with comments.
*
* @example
* const root = postcss.parse(' @media\nprint {\n}')
* root.first.first.raws //=> { before: ' ',
* // between: ' ',
* // afterName: '\n',
* // after: '\n' }
*/
}]);
return AtRule;
}(Container);
//
/**
* Contains helpers for safely splitting lists of CSS values,
* preserving parentheses and quotes.
*
* @example
* const list = postcss.list;
*
* @namespace list
*/
var list = {
split: function split(string, separators, last) {
var array = [];
var current = '';
var split = false;
var func = 0;
var quote = false;
var escape = false;
for (var i = 0; i < string.length; i++) {
var letter = string[i];
if (quote) {
if (escape) {
escape = false;
} else if (letter === '\\') {
escape = true;
} else if (letter === quote) {
quote = false;
}
} else if (letter === '"' || letter === "'") {
quote = letter;
} else if (letter === '(') {
func += 1;
} else if (letter === ')') {
if (func > 0) func -= 1;
} else if (func === 0) {
if (separators.indexOf(letter) !== -1) split = true;
}
if (split) {
if (current !== '') array.push(current.trim());
current = '';
split = false;
} else {
current += letter;
}
}
if (last || current !== '') array.push(current.trim());
return array;
},
/**
* Safely splits space-separated values (such as those for `background`,
* `border-radius`, and other shorthand properties).
*
* @param {string} string - space-separated values
*
* @return {string[]} splitted values
*
* @example
* postcss.list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
*/
space: function space(string) {
var spaces = [' ', '\n', '\t'];
return list.split(string, spaces);
},
/**
* Safely splits comma-separated values (such as those for `transition-*`
* and `background` properties).
*
* @param {string} string - comma-separated values
*
* @return {string[]} splitted values
*
* @example
* postcss.list.comma('black, linear-gradient(white, black)')
* //=> ['black', 'linear-gradient(white, black)']
*/
comma: function comma(string) {
var comma = ',';
return list.split(string, [comma], true);
}
};
/**
* Represents a CSS rule: a selector followed by a declaration block.
*
* @extends Container
*
* @example
* const root = postcss.parse('a{}');
* const rule = root.first;
* rule.type //=> 'rule'
* rule.toString() //=> 'a{}'
*/
var Rule = /*#__PURE__*/function (_Container) {
_inheritsLoose(Rule, _Container);
function Rule(defaults) {
var _this;
_this = _Container.call(this, defaults) || this;
_this.type = 'rule';
if (!_this.nodes) _this.nodes = [];
return _this;
}
/**
* An array containing the rule’s individual selectors.
* Groups of selectors are split at commas.
*
* @type {string[]}
*
* @example
* const root = postcss.parse('a, b { }');
* const rule = root.first;
*
* rule.selector //=> 'a, b'
* rule.selectors //=> ['a', 'b']
*
* rule.selectors = ['a', 'strong'];
* rule.selector //=> 'a, strong'
*/
_createClass(Rule, [{
key: "selectors",
get: function get() {
return list.comma(this.selector);
},
set: function set(values) {
var match = this.selector ? this.selector.match(/,\s*/) : null;
var sep = match ? match[0] : "," + this.raw('between', 'beforeOpen');
this.selector = values.join(sep);
}
}, {
key: "_selector",
get: function get() {
warnOnce('Rule#_selector is deprecated. Use Rule#raws.selector');
return this.raws.selector;
},
set: function set(val) {
warnOnce('Rule#_selector is deprecated. Use Rule#raws.selector');
this.raws.selector = val;
}
/**
* @memberof Rule#
* @member {string} selector - the rule’s full selector represented
* as a string
*
* @example
* const root = postcss.parse('a, b { }');
* const rule = root.first;
* rule.selector //=> 'a, b'
*/
/**
* @memberof Rule#
* @member {object} raws - Information to generate byte-to-byte equal
* node string as it was in the origin input.
*
* Every parser saves its own properties,
* but the default CSS parser uses:
*
* * `before`: the space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
* * `after`: the space symbols after the last child of the node
* to the end of the node.
* * `between`: the symbols between the property and value
* for declarations, selector and `{` for rules, or last parameter
* and `{` for at-rules.
* * `semicolon`: contains true if the last child has
* an (optional) semicolon.
*
* PostCSS cleans selectors from comments and extra spaces,
* but it stores origin content in raws properties.
* As such, if you don’t change a declaration’s value,
* PostCSS will use the raw value with comments.
*
* @example
* const root = postcss.parse('a {\n color:black\n}')
* root.first.first.raws //=> { before: '', between: ' ', after: '\n' }
*/
}]);
return Rule;
}(Container);
//
/**
* Represents a plugin’s warning. It can be created using {@link Node#warn}.
*
* @example
* if ( decl.important ) {
* decl.warn(result, 'Avoid !important', { word: '!important' });
* }
*/
var Warning = /*#__PURE__*/function () {
/**
* @param {string} text - warning message
* @param {Object} [opts] - warning options
* @param {Node} opts.node - CSS node that caused the warning
* @param {string} opts.word - word in CSS source that caused the warning
* @param {number} opts.index - index in CSS node string that caused
* the warning
* @param {string} opts.plugin - name of the plugin that created
* this warning. {@link Result#warn} fills
* this property automatically.
*/
function Warning(text, opts) {
if (opts === void 0) {
opts = {};
}
/**
* @member {string} - Type to filter warnings from
* {@link Result#messages}. Always equal
* to `"warning"`.
*
* @example
* const nonWarning = result.messages.filter(i => i.type !== 'warning')
*/
this.type = 'warning';
/**
* @member {string} - The warning message.
*
* @example
* warning.text //=> 'Try to avoid !important'
*/
this.text = text;
if (opts.node && opts.node.source) {
var pos = opts.node.positionBy(opts);
/**
* @member {number} - Line in the input file
* with this warning’s source
*
* @example
* warning.line //=> 5
*/
this.line = pos.line;
/**
* @member {number} - Column in the input file
* with this warning’s source.
*
* @example
* warning.column //=> 6
*/
this.column = pos.column;
}
for (var opt in opts) {
this[opt] = opts[opt];
}
}
/**
* Returns a warning position and message.
*
* @example
* warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important'
*
* @return {string} warning position and message
*/
var _proto = Warning.prototype;
_proto.toString = function toString() {
if (this.node) {
return this.node.error(this.text, {
plugin: this.plugin,
index: this.index,
word: this.word
}).message;
} else if (this.plugin) {
return this.plugin + ": " + this.text;
} else {
return this.text;
}
}
/**
* @memberof Warning#
* @member {string} plugin - The name of the plugin that created
* it will fill this property automatically.
* this warning. When you call {@link Node#warn}
*
* @example
* warning.plugin //=> 'postcss-important'
*/
/**
* @memberof Warning#
* @member {Node} node - Contains the CSS node that caused the warning.
*
* @example
* warning.node.toString() //=> 'color: white !important'
*/
;
return Warning;
}();
/**
* @typedef {object} Message
* @property {string} type - message type
* @property {string} plugin - source PostCSS plugin name
*/
/**
* Provides the result of the PostCSS transformations.
*
* A Result instance is returned by {@link LazyResult#then}
* or {@link Root#toResult} methods.
*
* @example
* postcss([cssnext]).process(css).then(function (result) {
* console.log(result.css);
* });
*
* @example
* var result2 = postcss.parse(css).toResult();
*/
var Result = /*#__PURE__*/function () {
/**
* @param {Processor} processor - processor used for this transformation.
* @param {Root} root - Root node after all transformations.
* @param {processOptions} opts - options from the {@link Processor#process}
* or {@link Root#toResult}
*/
function Result(processor, root, opts) {
/**
* @member {Processor} - The Processor instance used
* for this transformation.
*
* @example
* for ( let plugin of result.processor.plugins) {
* if ( plugin.postcssPlugin === 'postcss-bad' ) {
* throw 'postcss-good is incompatible with postcss-bad';
* }
* });
*/
this.processor = processor;
/**
* @member {Message[]} - Contains messages from plugins
* (e.g., warnings or custom messages).
* Each message should have type
* and plugin properties.
*
* @example
* postcss.plugin('postcss-min-browser', () => {
* return (root, result) => {
* var browsers = detectMinBrowsersByCanIUse(root);
* result.messages.push({
* type: 'min-browser',
* plugin: 'postcss-min-browser',
* browsers: browsers
* });
* };
* });
*/
this.messages = [];
/**
* @member {Root} - Root node after all transformations.
*
* @example
* root.toResult().root == root;
*/
this.root = root;
/**
* @member {processOptions} - Options from the {@link Processor#process}
* or {@link Root#toResult} call
* that produced this Result instance.
*
* @example
* root.toResult(opts).opts == opts;
*/
this.opts = opts;
/**
* @member {string} - A CSS string representing of {@link Result#root}.
*
* @example
* postcss.parse('a{}').toResult().css //=> "a{}"
*/
this.css = undefined;
/**
* @member {SourceMapGenerator} - An instance of `SourceMapGenerator`
* class from the `source-map` library,
* representing changes
* to the {@link Result#root} instance.
*
* @example
* result.map.toJSON() //=> { version: 3, file: 'a.css', … }
*
* @example
* if ( result.map ) {
* fs.writeFileSync(result.opts.to + '.map', result.map.toString());
* }
*/
this.map = undefined;
}
/**
* Returns for @{link Result#css} content.
*
* @example
* result + '' === result.css
*
* @return {string} string representing of {@link Result#root}
*/
var _proto = Result.prototype;
_proto.toString = function toString() {
return this.css;
}
/**
* Creates an instance of {@link Warning} and adds it
* to {@link Result#messages}.
*
* @param {string} text - warning message
* @param {Object} [opts] - warning options
* @param {Node} opts.node - CSS node that caused the warning
* @param {string} opts.word - word in CSS source that caused the warning
* @param {number} opts.index - index in CSS node string that caused
* the warning
* @param {string} opts.plugin - name of the plugin that created
* this warning. {@link Result#warn} fills
* this property automatically.
*
* @return {Warning} created warning
*/
;
_proto.warn = function warn(text, opts) {
if (opts === void 0) {
opts = {};
}
if (!opts.plugin) {
if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
opts.plugin = this.lastPlugin.postcssPlugin;
}
}
var warning = new Warning(text, opts);
this.messages.push(warning);
return warning;
}
/**
* Returns warnings from plugins. Filters {@link Warning} instances
* from {@link Result#messages}.
*
* @example
* result.warnings().forEach(warn => {
* console.warn(warn.toString());
* });
*
* @return {Warning[]} warnings from plugins
*/
;
_proto.warnings = function warnings() {
return this.messages.filter(function (i) {
return i.type === 'warning';
});
}
/**
* An alias for the {@link Result#css} property.
* Use it with syntaxes that generate non-CSS output.
* @type {string}
*
* @example
* result.css === result.content;
*/
;
_createClass(Result, [{
key: "content",
get: function get() {
return this.css;
}
}]);
return Result;
}();
function isPromise(obj) {
return typeof obj === 'object' && typeof obj.then === 'function';
}
/**
* @callback onFulfilled
* @param {Result} result
*/
/**
* @callback onRejected
* @param {Error} error
*/
/**
* A Promise proxy for the result of PostCSS transformations.
*
* A `LazyResult` instance is returned by {@link Processor#process}.
*
* @example
* const lazy = postcss([cssnext]).process(css);
*/
var LazyResult = /*#__PURE__*/function () {
function LazyResult(processor, css, opts) {
this.stringified = false;
this.processed = false;
var root;
if (typeof css === 'object' && css.type === 'root') {
root = css;
} else if (css instanceof LazyResult || css instanceof Result) {
root = css.root;
if (css.map) {
if (typeof opts.map === 'undefined') opts.map = {};
if (!opts.map.inline) opts.map.inline = false;
opts.map.prev = css.map;
}
} else {
var parser = parse;
if (opts.syntax) parser = opts.syntax.parse;
if (opts.parser) parser = opts.parser;
if (parser.parse) parser = parser.parse;
try {
root = parser(css, opts);
} catch (error) {
this.error = error;
}
}
this.result = new Result(processor, root, opts);
}
/**
* Returns a {@link Processor} instance, which will be used
* for CSS transformations.
* @type {Processor}
*/
var _proto = LazyResult.prototype;
/**
* Processes input CSS through synchronous plugins
* and calls {@link Result#warnings()}.
*
* @return {Warning[]} warnings from plugins
*/
_proto.warnings = function warnings() {
return this.sync().warnings();
}
/**
* Alias for the {@link LazyResult#css} property.
*
* @example
* lazy + '' === lazy.css;
*
* @return {string} output CSS
*/
;
_proto.toString = function toString() {
return this.css;
}
/**
* Processes input CSS through synchronous and asynchronous plugins
* and calls `onFulfilled` with a Result instance. If a plugin throws
* an error, the `onRejected` callback will be executed.
*
* It implements standard Promise API.
*
* @param {onFulfilled} onFulfilled - callback will be executed
* when all plugins will finish work
* @param {onRejected} onRejected - callback will be execited on any error
*
* @return {Promise} Promise API to make queue
*
* @example
* postcss([cssnext]).process(css).then(result => {
* console.log(result.css);
* });
*/
;
_proto.then = function then(onFulfilled, onRejected) {
return this.async().then(onFulfilled, onRejected);
}
/**
* Processes input CSS through synchronous and asynchronous plugins
* and calls onRejected for each error thrown in any plugin.
*
* It implements standard Promise API.
*
* @param {onRejected} onRejected - callback will be execited on any error
*
* @return {Promise} Promise API to make queue
*
* @example
* postcss([cssnext]).process(css).then(result => {
* console.log(result.css);
* }).catch(error => {
* console.error(error);
* });
*/
;
_proto["catch"] = function _catch(onRejected) {
return this.async()["catch"](onRejected);
};
_proto.handleError = function handleError(error, plugin) {
try {
this.error = error;
if (error.name === 'CssSyntaxError' && !error.plugin) {
error.plugin = plugin.postcssPlugin;
error.setMessage();
} else if (plugin.postcssVersion) {
var pluginName = plugin.postcssPlugin;
var pluginVer = plugin.postcssVersion;
var runtimeVer = this.result.processor.version;
var a = pluginVer.split('.');
var b = runtimeVer.split('.');
if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) {
warnOnce("" + ('Your current PostCSS version ' + 'is ') + runtimeVer + ", but " + pluginName + " " + ("uses " + pluginVer + ". Perhaps this is ") + "the source of the error below.");
}
}
} catch (err) {
if (console && console.error) console.error(err);
}
};
_proto.asyncTick = function asyncTick(resolve, reject) {
var _this = this;
if (this.plugin >= this.processor.plugins.length) {
this.processed = true;
return resolve();
}
try {
var plugin = this.processor.plugins[this.plugin];
var promise = this.run(plugin);
this.plugin += 1;
if (isPromise(promise)) {
promise.then(function () {
_this.asyncTick(resolve, reject);
})["catch"](function (error) {
_this.handleError(error, plugin);
_this.processed = true;
reject(error);
});
} else {
this.asyncTick(resolve, reject);
}
} catch (error) {
this.processed = true;
reject(error);
}
};
_proto.async = function async() {
var _this2 = this;
if (this.processed) {
return new Promise(function (resolve, reject) {
if (_this2.error) {
reject(_this2.error);
} else {
resolve(_this2.stringify());
}
});
}
if (this.processing) {
return this.processing;
}
this.processing = new Promise(function (resolve, reject) {
if (_this2.error) return reject(_this2.error);
_this2.plugin = 0;
_this2.asyncTick(resolve, reject);
}).then(function () {
_this2.processed = true;
return _this2.stringify();
});
return this.processing;
};
_proto.sync = function sync() {
var _this3 = this;
if (this.processed) return this.result;
this.processed = true;
if (this.processing) {
throw new Error('Use process(css).then(cb) to work with async plugins');
}
if (this.error) throw this.error;
this.result.processor.plugins.forEach(function (plugin) {
var promise = _this3.run(plugin);
if (isPromise(promise)) {
throw new Error('Use process(css).then(cb) to work with async plugins');
}
});
return this.result;
};
_proto.run = function run(plugin) {
this.result.lastPlugin = plugin;
try {
return plugin(this.result.root, this.result);
} catch (error) {
this.handleError(error, plugin);
throw error;
}
};
_proto.stringify = function stringify$1() {
if (this.stringified) return this.result;
this.stringified = true;
this.sync();
var opts = this.result.opts;
var str = stringify;
if (opts.syntax) str = opts.syntax.stringify;
if (opts.stringifier) str = opts.stringifier;
if (str.stringify) str = str.stringify;
var result = '';
str(this.root, function (i) {
result += i;
});
this.result.css = result;
return this.result;
};
_createClass(LazyResult, [{
key: "processor",
get: function get() {
return this.result.processor;
}
/**
* Options from the {@link Processor#process} call.
* @type {processOptions}
*/
}, {
key: "opts",
get: function get() {
return this.result.opts;
}
/**
* Processes input CSS through synchronous plugins, converts `Root`
* to a CSS string and returns {@link Result#css}.
*
* This property will only work with synchronous plugins.
* If the processor contains any asynchronous plugins
* it will throw an error. This is why this method is only
* for debug purpose, you should always use {@link LazyResult#then}.
*
* @type {string}
* @see Result#css
*/
}, {
key: "css",
get: function get() {
return this.stringify().css;
}
/**
* An alias for the `css` property. Use it with syntaxes
* that generate non-CSS output.
*
* This property will only work with synchronous plugins.
* If the processor contains any asynchronous plugins
* it will throw an error. This is why this method is only
* for debug purpose, you should always use {@link LazyResult#then}.
*
* @type {string}
* @see Result#content
*/
}, {
key: "content",
get: function get() {
return this.stringify().content;
}
/**
* Processes input CSS through synchronous plugins
* and returns {@link Result#map}.
*
* This property will only work with synchronous plugins.
* If the processor contains any asynchronous plugins
* it will throw an error. This is why this method is only
* for debug purpose, you should always use {@link LazyResult#then}.
*
* @type {SourceMapGenerator}
* @see Result#map
*/
}, {
key: "map",
get: function get() {
return this.stringify().map;
}
/**
* Processes input CSS through synchronous plugins
* and returns {@link Result#root}.
*
* This property will only work with synchronous plugins. If the processor
* contains any asynchronous plugins it will throw an error.
*
* This is why this method is only for debug purpose,
* you should always use {@link LazyResult#then}.
*
* @type {Root}
* @see Result#root
*/
}, {
key: "root",
get: function get() {
return this.sync().root;
}
/**
* Processes input CSS through synchronous plugins
* and returns {@link Result#messages}.
*
* This property will only work with synchronous plugins. If the processor
* contains any asynchronous plugins it will throw an error.
*
* This is why this method is only for debug purpose,
* you should always use {@link LazyResult#then}.
*
* @type {Message[]}
* @see Result#messages
*/
}, {
key: "messages",
get: function get() {
return this.sync().messages;
}
}]);
return LazyResult;
}();
//
/**
* @callback builder
* @param {string} part - part of generated CSS connected to this node
* @param {Node} node - AST node
* @param {"start"|"end"} [type] - node’s part type
*/
/**
* @callback parser
*
* @param {string|toString} css - string with input CSS or any object
* with toString() method, like a Buffer
* @param {processOptions} [opts] - options with only `from` and `map` keys
*
* @return {Root} PostCSS AST
*/
/**
* @callback stringifier
*
* @param {Node} node - start node for stringifing. Usually {@link Root}.
* @param {builder} builder - function to concatenate CSS from node’s parts
* or generate string and source map
*
* @return {void}
*/
/**
* @typedef {object} syntax
* @property {parser} parse - function to generate AST by string
* @property {stringifier} stringify - function to generate string by AST
*/
/**
* @typedef {object} toString
* @property {function} toString
*/
/**
* @callback pluginFunction
* @param {Root} root - parsed input CSS
* @param {Result} result - result to set warnings or check other plugins
*/
/**
* @typedef {object} Plugin
* @property {function} postcss - PostCSS plugin function
*/
/**
* @typedef {object} processOptions
* @property {string} from - the path of the CSS source file.
* You should always set `from`,
* because it is used in source map
* generation and syntax error messages.
* @property {string} to - the path where you’ll put the output
* CSS file. You should always set `to`
* to generate correct source maps.
* @property {parser} parser - function to generate AST by string
* @property {stringifier} stringifier - class to generate string by AST
* @property {syntax} syntax - object with `parse` and `stringify`
* @property {object} map - source map options
* @property {boolean} map.inline - does source map should
* be embedded in the output
* CSS as a base64-encoded
* comment
* @property {string|object|false|function} map.prev - source map content
* from a previous
* processing step
* (for example, Sass).
* PostCSS will try to find
* previous map
* automatically, so you
* could disable it by
* `false` value.
* @property {boolean} map.sourcesContent - does PostCSS should set
* the origin content to map
* @property {string|false} map.annotation - does PostCSS should set
* annotation comment to map
* @property {string} map.from - override `from` in map’s
* `sources`
*/
/**
* Contains plugins to process CSS. Create one `Processor` instance,
* initialize its plugins, and then use that instance on numerous CSS files.
*
* @example
* const processor = postcss([autoprefixer, precss]);
* processor.process(css1).then(result => console.log(result.css));
* processor.process(css2).then(result => console.log(result.css));
*/
var Processor = /*#__PURE__*/function () {
/**
* @param {Array.<Plugin|pluginFunction>|Processor} plugins - PostCSS
* plugins. See {@link Processor#use} for plugin format.
*/
function Processor(plugins) {
if (plugins === void 0) {
plugins = [];
}
/**
* @member {string} - Current PostCSS version.
*
* @example
* if ( result.processor.version.split('.')[0] !== '5' ) {
* throw new Error('This plugin works only with PostCSS 5');
* }
*/
this.version = '5.2.0';
/**
* @member {pluginFunction[]} - Plugins added to this processor.
*
* @example
* const processor = postcss([autoprefixer, precss]);
* processor.plugins.length //=> 2
*/
this.plugins = this.normalize(plugins);
}
/**
* Adds a plugin to be used as a CSS processor.
*
* PostCSS plugin can be in 4 formats:
* * A plugin created by {@link postcss.plugin} method.
* * A function. PostCSS will pass the function a @{link Root}
* as the first argument and current {@link Result} instance
* as the second.
* * An object with a `postcss` method. PostCSS will use that method
* as described in #2.
* * Another {@link Processor} instance. PostCSS will copy plugins
* from that instance into this one.
*
* Plugins can also be added by passing them as arguments when creating
* a `postcss` instance (see [`postcss(plugins)`]).
*
* Asynchronous plugins should return a `Promise` instance.
*
* @param {Plugin|pluginFunction|Processor} plugin - PostCSS plugin
* or {@link Processor}
* with plugins
*
* @example
* const processor = postcss()
* .use(autoprefixer)
* .use(precss);
*
* @return {Processes} current processor to make methods chain
*/
var _proto = Processor.prototype;
_proto.use = function use(plugin) {
this.plugins = this.plugins.concat(this.normalize([plugin]));
return this;
}
/**
* Parses source CSS and returns a {@link LazyResult} Promise proxy.
* Because some plugins can be asynchronous it doesn’t make
* any transformations. Transformations will be applied
* in the {@link LazyResult} methods.
*
* @param {string|toString|Result} css - String with input CSS or
* any object with a `toString()`
* method, like a Buffer.
* Optionally, send a {@link Result}
* instance and the processor will
* take the {@link Root} from it.
* @param {processOptions} [opts] - options
*
* @return {LazyResult} Promise proxy
*
* @example
* processor.process(css, { from: 'a.css', to: 'a.out.css' })
* .then(result => {
* console.log(result.css);
* });
*/
;
_proto.process = function process(css, opts) {
if (opts === void 0) {
opts = {};
}
return new LazyResult(this, css, opts);
};
_proto.normalize = function normalize(plugins) {
var normalized = [];
plugins.forEach(function (i) {
if (i.postcss) i = i.postcss;
if (typeof i === 'object' && Array.isArray(i.plugins)) {
normalized = normalized.concat(i.plugins);
} else if (typeof i === 'function') {
normalized.push(i);
} else {
throw new Error(i + " is not a PostCSS plugin");
}
});
return normalized;
};
return Processor;
}();
/**
* Represents a CSS file and contains all its parsed nodes.
*
* @extends Container
*
* @example
* const root = postcss.parse('a{color:black} b{z-index:2}');
* root.type //=> 'root'
* root.nodes.length //=> 2
*/
var Root = /*#__PURE__*/function (_Container) {
_inheritsLoose(Root, _Container);
function Root(defaults) {
var _this;
_this = _Container.call(this, defaults) || this;
_this.type = 'root';
if (!_this.nodes) _this.nodes = [];
return _this;
}
var _proto = Root.prototype;
_proto.removeChild = function removeChild(child) {
child = this.index(child);
if (child === 0 && this.nodes.length > 1) {
this.nodes[1].raws.before = this.nodes[child].raws.before;
}
return _Container.prototype.removeChild.call(this, child);
};
_proto.normalize = function normalize(child, sample, type) {
var nodes = _Container.prototype.normalize.call(this, child);
if (sample) {
if (type === 'prepend') {
if (this.nodes.length > 1) {
sample.raws.before = this.nodes[1].raws.before;
} else {
delete sample.raws.before;
}
} else if (this.first !== sample) {
nodes.forEach(function (node) {
node.raws.before = sample.raws.before;
});
}
}
return nodes;
}
/**
* Returns a {@link Result} instance representing the root’s CSS.
*
* @param {processOptions} [opts] - options with only `to` and `map` keys
*
* @return {Result} result with current root’s CSS
*
* @example
* const root1 = postcss.parse(css1, { from: 'a.css' });
* const root2 = postcss.parse(css2, { from: 'b.css' });
* root1.append(root2);
* const result = root1.toResult({ to: 'all.css', map: true });
*/
;
_proto.toResult = function toResult(opts) {
if (opts === void 0) {
opts = {};
}
var lazy = new LazyResult(new Processor(), this, opts);
return lazy.stringify();
};
_proto.remove = function remove(child) {
warnOnce('Root#remove is deprecated. Use Root#removeChild');
this.removeChild(child);
};
_proto.prevMap = function prevMap() {
warnOnce('Root#prevMap is deprecated. Use Root#source.input.map');
return this.source.input.map;
}
/**
* @memberof Root#
* @member {object} raws - Information to generate byte-to-byte equal
* node string as it was in the origin input.
*
* Every parser saves its own properties,
* but the default CSS parser uses:
*
* * `after`: the space symbols after the last child to the end of file.
* * `semicolon`: is the last child has an (optional) semicolon.
*
* @example
* postcss.parse('a {}\n').raws //=> { after: '\n' }
* postcss.parse('a {}').raws //=> { after: '' }
*/
;
return Root;
}(Container);
var sequence = 0;
/**
* @typedef {object} filePosition
* @property {string} file - path to file
* @property {number} line - source line in file
* @property {number} column - source column in file
*/
/**
* Represents the source CSS.
*
* @example
* const root = postcss.parse(css, { from: file });
* const input = root.source.input;
*/
var Input = /*#__PURE__*/function () {
/**
* @param {string} css - input CSS source
* @param {object} [opts] - {@link Processor#process} options
*/
function Input(css, opts) {
if (opts === void 0) {
opts = {};
}
/**
* @member {string} - input CSS source
*
* @example
* const input = postcss.parse('a{}', { from: file }).input;
* input.css //=> "a{}";
*/
this.css = css.toString();
if (this.css[0] === "\uFEFF" || this.css[0] === "\uFFFE") {
this.css = this.css.slice(1);
}
if (opts.from) {
if (/^\w+:\/\//.test(opts.from)) {
/**
* @member {string} - The absolute path to the CSS source file
* defined with the `from` option.
*
* @example
* const root = postcss.parse(css, { from: 'a.css' });
* root.source.input.file //=> '/home/ai/a.css'
*/
this.file = opts.from;
} else {
this.file = path.resolve(opts.from);
}
}
/*
let map = new PreviousMap(this.css, opts);
if ( map.text ) {
/!**
* @member {PreviousMap} - The input source map passed from
* a compilation step before PostCSS
* (for example, from Sass compiler).
*
* @example
* root.source.input.map.consumer().sources //=> ['a.sass']
*!/
this.map = map;
let file = map.consumer().file;
if ( !this.file && file ) this.file = this.mapResolve(file);
}
*/
if (!this.file) {
sequence += 1;
/**
* @member {string} - The unique ID of the CSS source. It will be
* created if `from` option is not provided
* (because PostCSS does not know the file path).
*
* @example
* const root = postcss.parse(css);
* root.source.input.file //=> undefined
* root.source.input.id //=> "<input css 1>"
*/
this.id = "<input css " + sequence + ">";
}
if (this.map) this.map.file = this.from;
}
var _proto = Input.prototype;
_proto.error = function error(message, line, column, opts) {
if (opts === void 0) {
opts = {};
}
var result;
var origin = this.origin(line, column);
if (origin) {
result = new CssSyntaxError(message, origin.line, origin.column, origin.source, origin.file, opts.plugin);
} else {
result = new CssSyntaxError(message, line, column, this.css, this.file, opts.plugin);
}
result.input = {
line: line,
column: column,
source: this.css
};
if (this.file) result.input.file = this.file;
return result;
}
/**
* Reads the input source map and returns a symbol position
* in the input source (e.g., in a Sass file that was compiled
* to CSS before being passed to PostCSS).
*
* @param {number} line - line in input CSS
* @param {number} column - column in input CSS
*
* @return {filePosition} position in input source
*
* @example
* root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
*/
;
_proto.origin = function origin(line, column) {
if (!this.map) return false;
var consumer = this.map.consumer();
var from = consumer.originalPositionFor({
line: line,
column: column
});
if (!from.source) return false;
var result = {
file: this.mapResolve(from.source),
line: from.line,
column: from.column
};
var source = consumer.sourceContentFor(from.source);
if (source) result.source = source;
return result;
};
_proto.mapResolve = function mapResolve(file) {
if (/^\w+:\/\//.test(file)) {
return file;
} else {
return path.resolve(this.map.consumer().sourceRoot || '.', file);
}
}
/**
* The CSS source identifier. Contains {@link Input#file} if the user
* set the `from` option, or {@link Input#id} if they did not.
* @type {string}
*
* @example
* const root = postcss.parse(css, { from: 'a.css' });
* root.source.input.from //=> "/home/ai/a.css"
*
* const root = postcss.parse(css);
* root.source.input.from //=> "<input css 1>"
*/
;
_createClass(Input, [{
key: "from",
get: function get() {
return this.file || this.id;
}
}]);
return Input;
}();
var SafeParser = /*#__PURE__*/function (_Parser) {
_inheritsLoose(SafeParser, _Parser);
function SafeParser() {
return _Parser.apply(this, arguments) || this;
}
var _proto = SafeParser.prototype;
_proto.tokenize = function tokenize$1() {
this.tokens = tokenize(this.input, {
ignoreErrors: true
});
};
_proto.comment = function comment(token) {
var node = new Comment();
this.init(node, token[2], token[3]);
node.source.end = {
line: token[4],
column: token[5]
};
var text = token[1].slice(2);
if (text.slice(-2) === '*/') text = text.slice(0, -2);
if (/^\s*$/.test(text)) {
node.text = '';
node.raws.left = text;
node.raws.right = '';
} else {
var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
node.text = match[2];
node.raws.left = match[1];
node.raws.right = match[3];
}
};
_proto.unclosedBracket = function unclosedBracket() {};
_proto.unknownWord = function unknownWord(start) {
var buffer = this.tokens.slice(start, this.pos + 1);
this.spaces += buffer.map(function (i) {
return i[1];
}).join('');
};
_proto.unexpectedClose = function unexpectedClose() {
this.current.raws.after += '}';
};
_proto.doubleColon = function doubleColon() {};
_proto.unnamedAtrule = function unnamedAtrule(node) {
node.name = '';
};
_proto.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) {
var colon = this.colon(tokens);
if (colon === false) return;
var split;
for (split = colon - 1; split >= 0; split--) {
if (tokens[split][0] === 'word') break;
}
for (split -= 1; split >= 0; split--) {
if (tokens[split][0] !== 'space') {
split += 1;
break;
}
}
var other = tokens.splice(split, tokens.length - split);
this.decl(other);
};
_proto.checkMissedSemicolon = function checkMissedSemicolon() {};
_proto.endFile = function endFile() {
if (this.current.nodes && this.current.nodes.length) {
this.current.raws.semicolon = this.semicolon;
}
this.current.raws.after = (this.current.raws.after || '') + this.spaces;
while (this.current.parent) {
this.current = this.current.parent;
this.current.raws.after = '';
}
};
return SafeParser;
}(Parser);
//
function safeParse(css, opts) {
var input = new Input(css, opts);
var parser = new SafeParser(input);
parser.tokenize();
parser.loop();
return parser.root;
}
//
var generated = {};
/*
InlineStyle takes arbitrary CSS and generates a flat object
*/
var _InlineStyle = (function (styleSheet) {
var InlineStyle = /*#__PURE__*/function () {
function InlineStyle(rules) {
this.rules = rules;
}
var _proto = InlineStyle.prototype;
_proto.generateStyleObject = function generateStyleObject(executionContext) {
var flatCSS = flatten(this.rules, executionContext).join('');
var hash = generateComponentId(flatCSS);
if (!generated[hash]) {
var root = safeParse(flatCSS);
var declPairs = [];
root.each(function (node) {
if (node.type === 'decl') {
declPairs.push([node.prop, node.value]);
} else if (process.env.NODE_ENV !== 'production' && node.type !== 'comment') {
/* eslint-disable no-console */
console.warn("Node of type " + node.type + " not supported as an inline style");
}
}); // RN currently does not support differing values for the corner radii of Image
// components (but does for View). It is almost impossible to tell whether we'll have
// support, so we'll just disable multiple values here.
// https://github.com/styled-components/css-to-react-native/issues/11
var styleObject = transformDeclPairs(declPairs, ['borderRadius', 'borderWidth', 'borderColor', 'borderStyle']);
var styles = styleSheet.create({
generated: styleObject
});
generated[hash] = styles.generated;
}
return generated[hash];
};
return InlineStyle;
}();
return InlineStyle;
});
/* eslint-disable */
/**
mixin-deep; https://github.com/jonschlinkert/mixin-deep
Inlined such that it will be consistently transpiled to an IE-compatible syntax.
The MIT License (MIT)
Copyright (c) 2014-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
var isObject = function isObject(val) {
return typeof val === 'function' || typeof val === 'object' && val !== null && !Array.isArray(val);
};
var isValidKey = function isValidKey(key) {
return key !== '__proto__' && key !== 'constructor' && key !== 'prototype';
};
function mixin(target, val, key) {
var obj = target[key];
if (isObject(val) && isObject(obj)) {
mixinDeep(obj, val);
} else {
target[key] = val;
}
}
function mixinDeep(target) {
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
rest[_key - 1] = arguments[_key];
}
for (var _i = 0, _rest = rest; _i < _rest.length; _i++) {
var obj = _rest[_i];
if (isObject(obj)) {
for (var key in obj) {
if (isValidKey(key)) {
mixin(target, obj[key], key);
}
}
}
}
return target;
}
//
var determineTheme = (function (props, providedTheme, defaultProps) {
if (defaultProps === void 0) {
defaultProps = EMPTY_OBJECT;
}
return props.theme !== defaultProps.theme && props.theme || providedTheme || defaultProps.theme;
});
//
function isTag(target) {
return typeof target === 'string' && (process.env.NODE_ENV !== 'production' ? target.charAt(0) === target.charAt(0).toLowerCase() : true);
}
//
function generateDisplayName(target) {
return isTag(target) ? "styled." + target : "Styled(" + getComponentName(target) + ")";
}
var ThemeContext = React.createContext();
var ThemeConsumer = ThemeContext.Consumer;
function mergeTheme(theme, outerTheme) {
if (!theme) {
return throwStyledComponentsError(14);
}
if (isFunction(theme)) {
var mergedTheme = theme(outerTheme);
if (process.env.NODE_ENV !== 'production' && (mergedTheme === null || Array.isArray(mergedTheme) || typeof mergedTheme !== 'object')) {
return throwStyledComponentsError(7);
}
return mergedTheme;
}
if (Array.isArray(theme) || typeof theme !== 'object') {
return throwStyledComponentsError(8);
}
return outerTheme ? _extends({}, outerTheme, {}, theme) : theme;
}
/**
* Provide a theme to an entire react component tree via context
*/
function ThemeProvider(props) {
var outerTheme = useContext(ThemeContext);
var themeContext = useMemo(function () {
return mergeTheme(props.theme, outerTheme);
}, [props.theme, outerTheme]);
if (!props.children) {
return null;
}
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
value: themeContext
}, props.children);
}
// if the user makes use of ThemeProvider or StyleSheetManager things will break.
// Validator defaults to true if not in HTML/DOM env
var validAttr = function validAttr() {
return true;
};
var StyledNativeComponent = /*#__PURE__*/function (_Component) {
_inheritsLoose(StyledNativeComponent, _Component);
function StyledNativeComponent() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
_this.attrs = {};
return _this;
}
var _proto = StyledNativeComponent.prototype;
_proto.render = function render() {
var _this2 = this;
return /*#__PURE__*/React.createElement(ThemeConsumer, null, function (theme) {
var _this2$props = _this2.props,
transientAsProp = _this2$props.$as,
renderAs = _this2$props.as,
forwardedComponent = _this2$props.forwardedComponent,
forwardedAs = _this2$props.forwardedAs,
forwardedRef = _this2$props.forwardedRef,
testID = _this2$props.testID,
_this2$props$style = _this2$props.style,
style = _this2$props$style === void 0 ? [] : _this2$props$style,
props = _objectWithoutPropertiesLoose(_this2$props, ["$as", "as", "forwardedComponent", "forwardedAs", "forwardedRef", "testID", "style"]);
var defaultProps = forwardedComponent.defaultProps,
target = forwardedComponent.target,
shouldForwardProp = forwardedComponent.shouldForwardProp;
var elementToBeRendered = _this2.attrs.$as || _this2.attrs.as || transientAsProp || renderAs || target;
var generatedStyles = _this2.generateAndInjectStyles(determineTheme(_this2.props, theme, defaultProps) || EMPTY_OBJECT, _this2.props);
var isTargetTag = isTag(elementToBeRendered);
var computedProps = _this2.attrs !== props ? _extends({}, props, {}, _this2.attrs) : props;
var propFilterFn = shouldForwardProp || isTargetTag && validAttr;
var propsForElement = {};
var key;
for (key in computedProps) {
if (key[0] === '$' || key === 'as') continue;else if (key === 'forwardedAs') {
propsForElement.as = props[key];
} else if (!propFilterFn || propFilterFn(key, validAttr)) {
// Don't pass through filtered tags through to native elements
propsForElement[key] = computedProps[key];
}
}
propsForElement.style = typeof style === 'function' ? function (state) {
return [generatedStyles].concat(style(state));
} : [generatedStyles].concat(style);
propsForElement.testID = testID;
if (forwardedRef) propsForElement.ref = forwardedRef;
if (forwardedAs) propsForElement.as = forwardedAs;
return createElement(elementToBeRendered, propsForElement);
});
};
_proto.buildExecutionContext = function buildExecutionContext(theme, props, attrs) {
var _this3 = this;
var context = _extends({}, props, {
theme: theme
});
if (!attrs.length) return context;
this.attrs = {};
attrs.forEach(function (attrDef) {
var resolvedAttrDef = attrDef;
var attr;
var key;
if (isFunction(resolvedAttrDef)) {
resolvedAttrDef = resolvedAttrDef(context);
}
/* eslint-disable guard-for-in */
for (key in resolvedAttrDef) {
attr = resolvedAttrDef[key];
_this3.attrs[key] = attr;
context[key] = attr;
}
/* eslint-enable */
});
return context;
};
_proto.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
var inlineStyle = props.forwardedComponent.inlineStyle;
var executionContext = this.buildExecutionContext(theme, props, props.forwardedComponent.attrs);
return inlineStyle.generateStyleObject(executionContext);
};
_proto.setNativeProps = function setNativeProps(nativeProps) {
if (this.root !== undefined) {
// $FlowFixMe
this.root.setNativeProps(nativeProps);
} else if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line no-console
console.warn('setNativeProps was called on a Styled Component wrapping a stateless functional component.');
}
};
return StyledNativeComponent;
}(Component);
var _StyledNativeComponent = (function (InlineStyle) {
var createStyledNativeComponent = function createStyledNativeComponent(target, options, rules) {
var _options$attrs = options.attrs,
attrs = _options$attrs === void 0 ? EMPTY_ARRAY : _options$attrs,
_options$displayName = options.displayName,
displayName = _options$displayName === void 0 ? generateDisplayName(target) : _options$displayName,
_options$ParentCompon = options.ParentComponent,
ParentComponent = _options$ParentCompon === void 0 ? StyledNativeComponent : _options$ParentCompon;
var isClass = !isTag(target);
var isTargetStyledComp = isStyledComponent(target); // $FlowFixMe
var WrappedStyledNativeComponent = React.forwardRef(function (props, ref) {
return /*#__PURE__*/React.createElement(ParentComponent, _extends({}, props, {
forwardedComponent: WrappedStyledNativeComponent,
forwardedRef: ref
}));
});
var finalAttrs = // $FlowFixMe
isTargetStyledComp && target.attrs ? Array.prototype.concat(target.attrs, attrs).filter(Boolean) : attrs; // eslint-disable-next-line prefer-destructuring
var shouldForwardProp = options.shouldForwardProp; // $FlowFixMe
if (isTargetStyledComp && target.shouldForwardProp) {
if (shouldForwardProp) {
// compose nested shouldForwardProp calls
shouldForwardProp = function shouldForwardProp(prop, filterFn, elementToBeCreated) {
return (// $FlowFixMe
target.shouldForwardProp(prop, filterFn, elementToBeCreated) && options.shouldForwardProp(prop, filterFn, elementToBeCreated)
);
};
} else {
// eslint-disable-next-line prefer-destructuring
shouldForwardProp = target.shouldForwardProp;
}
}
/**
* forwardRef creates a new interim component, which we'll take advantage of
* instead of extending ParentComponent to create _another_ interim class
*/
// $FlowFixMe
WrappedStyledNativeComponent.attrs = finalAttrs;
WrappedStyledNativeComponent.displayName = displayName; // $FlowFixMe
WrappedStyledNativeComponent.shouldForwardProp = shouldForwardProp; // $FlowFixMe
WrappedStyledNativeComponent.inlineStyle = new InlineStyle( // $FlowFixMe
isTargetStyledComp ? target.inlineStyle.rules.concat(rules) : rules); // $FlowFixMe
WrappedStyledNativeComponent.styledComponentId = 'StyledNativeComponent'; // $FlowFixMe
WrappedStyledNativeComponent.target = isTargetStyledComp ? // $FlowFixMe
target.target : target; // $FlowFixMe
WrappedStyledNativeComponent.withComponent = function withComponent(tag) {
var _ = options.displayName,
__ = options.componentId,
optionsToCopy = _objectWithoutPropertiesLoose(options, ["displayName", "componentId"]);
var newOptions = _extends({}, optionsToCopy, {
attrs: finalAttrs,
ParentComponent: ParentComponent
});
return createStyledNativeComponent(tag, newOptions, rules);
}; // $FlowFixMe
Object.defineProperty(WrappedStyledNativeComponent, 'defaultProps', {
get: function get() {
return this._foldedDefaultProps;
},
set: function set(obj) {
// $FlowFixMe
this._foldedDefaultProps = isTargetStyledComp ? mixinDeep({}, target.defaultProps, obj) : obj;
}
});
if (isClass) {
hoist(WrappedStyledNativeComponent, target, {
// all SC-specific things should not be hoisted
attrs: true,
displayName: true,
shouldForwardProp: true,
inlineStyle: true,
styledComponentId: true,
target: true,
withComponent: true
});
}
return WrappedStyledNativeComponent;
};
return createStyledNativeComponent;
});
//
var interleave = (function (strings, interpolations) {
var result = [strings[0]];
for (var i = 0, len = interpolations.length; i < len; i += 1) {
result.push(interpolations[i], strings[i + 1]);
}
return result;
});
//
/**
* Used when flattening object styles to determine if we should
* expand an array of styles.
*/
var addTag = function addTag(arg) {
if (Array.isArray(arg)) {
// eslint-disable-next-line no-param-reassign
arg.isCss = true;
}
return arg;
};
function css(styles) {
for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
if (isFunction(styles) || isPlainObject(styles)) {
// $FlowFixMe
return addTag(flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations))));
}
if (interpolations.length === 0 && styles.length === 1 && typeof styles[0] === 'string') {
// $FlowFixMe
return styles;
} // $FlowFixMe
return addTag(flatten(interleave(styles, interpolations)));
}
function constructWithOptions(componentConstructor, tag, options) {
if (options === void 0) {
options = EMPTY_OBJECT;
}
if (!isValidElementType(tag)) {
return throwStyledComponentsError(1, String(tag));
}
/* This is callable directly as a template function */
// $FlowFixMe: Not typed to avoid destructuring arguments
var templateFunction = function templateFunction() {
return componentConstructor(tag, options, css.apply(void 0, arguments));
};
/* If config methods are called, wrap up a new template function and merge options */
templateFunction.withConfig = function (config) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, {}, config));
};
/* Modify/inject new props at runtime */
templateFunction.attrs = function (attrs) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, {
attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean)
}));
};
return templateFunction;
}
// export default <Config: { theme?: any }, Instance>(
// Component: AbstractComponent<Config, Instance>
// ): AbstractComponent<$Diff<Config, { theme?: any }> & { theme?: any }, Instance>
//
// but the old build system tooling doesn't support the syntax
var withTheme = (function (Component) {
// $FlowFixMe This should be React.forwardRef<Config, Instance>
var WithTheme = React.forwardRef(function (props, ref) {
var theme = useContext(ThemeContext); // $FlowFixMe defaultProps isn't declared so it can be inferrable
var defaultProps = Component.defaultProps;
var themeProp = determineTheme(props, theme, defaultProps);
if (process.env.NODE_ENV !== 'production' && themeProp === undefined) {
// eslint-disable-next-line no-console
console.warn("[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"" + getComponentName(Component) + "\"");
}
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
theme: themeProp,
ref: ref
}));
});
hoist(WithTheme, Component);
WithTheme.displayName = "WithTheme(" + getComponentName(Component) + ")";
return WithTheme;
});
//
var useTheme = function useTheme() {
return useContext(ThemeContext);
};
//
var reactNative = require('react-native');
var InlineStyle = _InlineStyle(reactNative.StyleSheet);
var StyledNativeComponent$1 = _StyledNativeComponent(InlineStyle);
var styled = function styled(tag) {
return constructWithOptions(StyledNativeComponent$1, tag);
};
/* React native lazy-requires each of these modules for some reason, so let's
* assume it's for a good reason and not eagerly load them all */
var aliases = "ActivityIndicator ActivityIndicatorIOS ART Button DatePickerIOS DrawerLayoutAndroid\n Image ImageBackground ImageEditor ImageStore KeyboardAvoidingView ListView MapView Modal NavigatorIOS\n Picker PickerIOS ProgressBarAndroid ProgressViewIOS ScrollView SegmentedControlIOS Slider\n SliderIOS SnapshotViewIOS Switch RecyclerViewBackedScrollView RefreshControl SafeAreaView StatusBar\n SwipeableListView SwitchAndroid SwitchIOS TabBarIOS Text TextInput ToastAndroid ToolbarAndroid\n Touchable TouchableHighlight TouchableNativeFeedback TouchableOpacity TouchableWithoutFeedback\n View ViewPagerAndroid WebView FlatList SectionList VirtualizedList Pressable";
/* Define a getter for each alias which simply gets the reactNative component
* and passes it to styled */
aliases.split(/\s+/m).forEach(function (alias) {
return Object.defineProperty(styled, alias, {
enumerable: true,
configurable: false,
get: function get() {
return styled(reactNative[alias]);
}
});
});
export default styled;
export { ThemeConsumer, ThemeContext, ThemeProvider, css, isStyledComponent, useTheme, withTheme };
//# sourceMappingURL=styled-components.native.esm.js.map
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/hooks/useQaLabel.ts
import { Platform } from "react-native";
type QaLabelWeb = { dataSet: { "qa-label": string } };
type QaLabelNative = { "data-qa-label": string };
/**
* Web and Native require different implementations of the data-qa-label this hook encapsulates that logic
*
* Usage:
* const elementTestProps = useQaLabel('element-label-goes-here')
* <Element {...elementTestProps} />
*/
export const useQaLabel = (label: string): QaLabelWeb | QaLabelNative =>
Platform.OS === "web"
? { dataSet: { "qa-label": label } }
: { "data-qa-label": label };
export default useQaLabel;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/utils/themeGet.ts
import React from "react";
import { get } from "styled-system";
import { Theme } from "../types";
interface IProps extends React.HTMLProps<HTMLElement> {
theme: Theme;
}
const themeGet =
(path: string, fallback?: string | number) =>
({ theme }: IProps) =>
get(theme, path, fallback!);
export default themeGet;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/alertInline/styled-components.ts
import styled, { css } from "styled-components/native";
import { View, Text } from "react-native";
import { useQaLabel } from "../../hooks/useQaLabel";
import {
AlertInlineStyleProps,
AlertInlineContainerProps,
AlertInlineHasLinkProp,
AlertInlineHasTitleAndMessageProp,
AlertInlineTypes,
AlertInlineRoundedStyleProp
} from "./types";
import { variant, space, compose } from "../../theming/styledSystem";
export const alertInlinePressableVariants = {
success: {
base: "green.800",
hover: "green.600",
active: "green.700"
},
informational: {
base: "blue_accent.700",
hover: "blue_accent.600",
active: "blue_accent.700"
},
error: {
base: "red.700",
hover: "red.600",
active: "red.700"
},
warning: {
base: "orange.900",
hover: "orange.600",
active: "orange.700"
},
promo: {
base: "yellow.900",
hover: "yellow.600",
active: "yellow.700"
}
};
export const alertToastPressableVariants = {
success: {
base: "white.900",
hover: "white.700",
active: "white.800"
},
informational: {
base: "white.900",
hover: "white.700",
active: "white.800"
},
error: {
base: "white.900",
hover: "white.700",
active: "white.800"
},
warning: {
base: "white.900",
hover: "white.700",
active: "white.800"
},
promo: {
base: "grey.900",
hover: "black.900",
active: "black.900"
}
};
const alertInlineTextVariants = {
prop: "variant",
variants: {
success: {
color: "green.800"
},
informational: {
color: "blue_accent.700"
},
error: {
color: "red.700"
},
warning: {
color: "orange.900"
},
promo: {
color: "yellow.900"
}
}
};
const alertToastTextVariants = {
prop: "variant",
variants: {
success: {
color: "white.900"
},
informational: {
color: "white.900"
},
error: {
color: "white.900"
},
warning: {
color: "white.900"
},
promo: {
color: "grey.900"
}
}
};
export const alertInlineVariants = {
prop: "variant",
variants: {
success: {
backgroundColor: "green.100",
border: `1px solid`,
borderColor: "green.300"
},
informational: {
backgroundColor: "blue_accent.000",
border: `1px solid`,
borderColor: "blue_accent.200"
},
error: {
backgroundColor: "red.000",
border: `1px solid`,
borderColor: "red.200"
},
warning: {
backgroundColor: "orange.000",
border: `1px solid`,
borderColor: "orange.200"
},
promo: {
backgroundColor: "yellow.000",
border: `1px solid`,
borderColor: "yellow.200"
}
}
};
export const alertToastVariants = {
prop: "variant",
variants: {
success: {
backgroundColor: "green.600",
boxShadow: "0px 1px 16px rgba(17, 43, 68, 0.25)"
},
informational: {
backgroundColor: "blue_accent.600",
boxShadow: "0px 1px 16px rgba(17, 43, 68, 0.25)"
},
error: {
backgroundColor: "red.500",
boxShadow: "0px 1px 16px rgba(17, 43, 68, 0.25)"
},
warning: {
backgroundColor: "orange.500",
boxShadow: "0px 1px 16px rgba(17, 43, 68, 0.25)"
},
promo: {
backgroundColor: "yellow.500",
boxShadow: "0px 1px 16px rgba(17, 43, 68, 0.25)"
}
}
};
const styledSystemStyles = (type: AlertInlineTypes) =>
compose(
space,
type === "toast"
? variant(alertToastVariants)
: variant(alertInlineVariants)
);
export const AlertInlineContainer = styled(View).attrs<{
qaLabel: string;
}>((props) => ({
...useQaLabel(props.qaLabel)
}))<AlertInlineContainerProps & AlertInlineRoundedStyleProp>`
width: ${({ isFullWidth }) => (isFullWidth ? "100%" : "fit-content")};
flex-direction: row;
align-items: stretch;
column-gap: ${({ theme }) => theme.space["space-4"]};
border-radius: ${({ theme, hasRoundedStyle }) =>
hasRoundedStyle ? theme.radii["2xl"] : theme.radii.s};
padding: ${({ theme, hasRoundedStyle }) =>
hasRoundedStyle
? `0 ${theme.space["space-1"]} 0 ${theme.space["space-5"]}`
: `0 0 0 ${theme.space["space-4"]}`};
${({ theme, hasRoundedStyle, hasOnDismissPress }) =>
!hasOnDismissPress &&
css`
padding-right: ${hasRoundedStyle
? theme.space["space-5"]
: theme.space["space-4"]};
`}
${({ type }) => styledSystemStyles(type || "floating")};
${(props) =>
props.type === "fixed" &&
css`
border-left-width: 0;
border-right-width: 0;
border-radius: 0;
`}
${({ isFullWidth }) =>
!isFullWidth &&
css`
margin: auto;
`}
`;
export const AlertInlineIconWrapper = styled(View)<AlertInlineRoundedStyleProp>`
justify-content: ${({ hasRoundedStyle }) =>
hasRoundedStyle ? "center" : "flex-start"};
${({ hasRoundedStyle }) =>
!hasRoundedStyle &&
css`
padding-top: ${({ theme }) => theme.space["space-4"]};
`}
`;
export const AlertInlineInfo = styled(View)<
AlertInlineHasLinkProp &
AlertInlineRoundedStyleProp &
AlertInlineHasTitleAndMessageProp
>`
flex: 1;
justify-content: center;
gap: ${({ theme }) => theme.space["space-1"]}
${({ theme }) => theme.space["space-4"]};
padding: ${({ theme }) => `${theme.space["space-4"]} 0`};
${({ hasRoundedStyle, hasLink, hasTitleAndMessage }) =>
hasLink &&
(!hasTitleAndMessage || (hasTitleAndMessage && hasRoundedStyle)) &&
css`
flex-flow: row;
flex-wrap: wrap;
`}
`;
export const AlertInlineActions = styled(View)<AlertInlineRoundedStyleProp>`
flex-direction: row;
column-gap: ${({ theme }) => theme.space["space-3"]};
align-items: ${({ hasRoundedStyle }) =>
hasRoundedStyle ? "center" : "flex-start"};
`;
export const AlertInlineMessage = styled(Text).attrs<{
qaLabel: string;
}>((props) => ({
...useQaLabel(props.qaLabel)
}))<
AlertInlineStyleProps &
AlertInlineHasLinkProp &
AlertInlineRoundedStyleProp &
AlertInlineHasTitleAndMessageProp & { qaLabel?: string }
>`
${({ type }) =>
type === "toast"
? variant(alertToastTextVariants)
: variant(alertInlineTextVariants)};
font-size: ${({ theme }) => theme.fontSizes.s};
font-family: ${({ theme, type, hasTitleAndMessage }) => {
if (type === "toast") {
return hasTitleAndMessage ? theme.fonts.regular : theme.fonts.bold;
}
return theme.fonts.regular;
}};
${({ hasLink, hasTitleAndMessage }) =>
!hasTitleAndMessage &&
hasLink &&
css`
flex: 1;
`}
${({ hasRoundedStyle, hasLink, hasTitleAndMessage }) =>
hasRoundedStyle &&
hasLink &&
hasTitleAndMessage &&
css`
order: 1;
flex-basis: 100%;
`}
`;
export const AlertInlineTitle = styled(Text)<
AlertInlineStyleProps & AlertInlineHasLinkProp & AlertInlineRoundedStyleProp
>`
${({ type }) =>
type === "toast"
? variant(alertToastTextVariants)
: variant(alertInlineTextVariants)}
font-size: ${({ theme }) => theme.fontSizes.s};
font-family: ${({ theme, type }) =>
type === "toast" ? theme.fonts.bold : theme.fonts.medium};
${({ hasRoundedStyle, hasLink }) =>
hasRoundedStyle &&
hasLink &&
css`
flex: 1;
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/hooks/useEvents.ts
import { useState } from "react";
import { GestureResponderEvent, NativeSyntheticEvent } from "react-native";
export interface EventsState {
isHovered?: boolean;
isPressed?: boolean;
isFocused?: boolean;
isSelected?: boolean;
}
export const useEvents = <T>(
{
isHovered = false,
isPressed = false,
isFocused = false,
isSelected = false
}: EventsState,
enable = true
) => {
const [events, setEvents] = useState<Required<EventsState>>({
isHovered,
isPressed,
isFocused,
isSelected
});
const mouseEnterHandler = (event: GestureResponderEvent) => {
event.persist();
if (enable) setEvents({ ...events, isHovered: true });
};
const mouseLeaveHandler = (event: GestureResponderEvent) => {
event.persist();
if (enable) setEvents({ ...events, isHovered: false, isPressed: false });
};
const pressInHandler = (event: GestureResponderEvent) => {
event.persist();
if (enable) setEvents({ ...events, isPressed: true });
};
const pressOutHandler = () => {
if (enable) setEvents({ ...events, isPressed: false });
};
const focusHandler = (
event: GestureResponderEvent | NativeSyntheticEvent<T>
) => {
event.persist();
if (enable) setEvents({ ...events, isFocused: true });
};
const blurHandler = (event: NativeSyntheticEvent<T>) => {
event.persist();
if (enable) setEvents({ ...events, isFocused: false });
};
const hoverHandlers = {
onMouseEnter: mouseEnterHandler,
onMouseLeave: mouseLeaveHandler
};
const pressHandlers = {
onMouseDown: pressInHandler,
onMouseUp: pressOutHandler,
onPressIn: pressInHandler,
onPressOut: pressOutHandler,
onTouchStart: pressInHandler,
onTouchEnd: pressOutHandler
};
const focusHandlers = {
onFocus: focusHandler,
onBlur: blurHandler
};
const eventsHandlers = {
...hoverHandlers,
...pressHandlers,
...focusHandlers
};
return {
events,
setEvents,
eventsHandlers,
hoverHandlers,
pressHandlers,
focusHandlers
};
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/utils/accessibility.tsx
import {
Platform,
AccessibilityRole as NativeAccessibilityRole
} from "react-native";
export type WebOnlyAccessibilityRole =
| "paragraph"
| "span"
| "list"
| "listitem"
| "dialog";
export type AccessibilityRole =
| NativeAccessibilityRole
| WebOnlyAccessibilityRole;
const accessibilityRoleToNativeRole: {
[key in WebOnlyAccessibilityRole]: NativeAccessibilityRole;
} = {
paragraph: "text",
span: "text",
list: "menu",
listitem: "menuitem",
dialog: "alert"
};
export const getAccessibilityRole = (accessibilityRole: AccessibilityRole) =>
// @ts-ignore
(Platform.OS !== "web" && accessibilityRoleToNativeRole[accessibilityRole]) ||
accessibilityRole;
export default getAccessibilityRole;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/typography/paragraph/styled-components.ts
import styled from "styled-components/native";
import { Text } from "react-native";
import {
space,
color,
system,
compose,
fontFamily,
fontSize,
flex,
layout,
typography
} from "../../../theming/styledSystem";
import { useQaLabel } from "../../../hooks/useQaLabel";
import { getAccessibilityRole } from "../../../utils/accessibility";
import { ParagraphProps } from "./types";
const lineHeightNormal = system({
fontSize: {
property: "lineHeight",
scale: "lineHeights"
}
});
const lineHeightTaller = system({
fontSize: {
property: "lineHeight",
scale: "lineHeightsTaller"
}
});
const transformText = system({
textTransform: {
property: "textTransform"
},
whiteSpace: {
property: "whiteSpace"
},
textOverflow: {
property: "textOverflow"
}
});
const styles = compose(
space,
color,
fontFamily,
fontSize,
transformText,
typography,
layout
);
export const Paragraph = styled(Text).attrs<ParagraphProps>((props) => ({
ref: props.ref,
accessibilityRole: getAccessibilityRole("paragraph"),
overflow: props.textOverflow === "ellipsis" ? "hidden" : "visible",
width: props.textOverflow === "ellipsis" ? "100%" : "auto",
...useQaLabel(props.qaLabel)
}))<ParagraphProps>`
${(props) => (props.isLineHigher ? lineHeightTaller : lineHeightNormal)}
${styles};
${flex}
`;
Paragraph.defaultProps = {
fontFamily: "regular",
fontSize: "s",
isLineHigher: false,
color: "grey.900"
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/typography/paragraph/index.tsx
import { ParagraphProps } from "./types";
import { Paragraph } from "./styled-components";
export { Paragraph };
export type { ParagraphProps };
export default Paragraph;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/link/styled-components.ts
import styled from "styled-components/native";
import { View, Pressable } from "react-native";
import { space } from "styled-system";
export const StyledView = styled(View)(space);
export const StyledPressable = styled(Pressable)`
align-self: flex-start;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/link/utils/getColor.ts
export const getColor = (
isHovered: boolean,
isPressed: boolean,
isActive: boolean,
isLight: boolean
): string => {
const baseColor = "blue_accent";
const baseVariation = isLight ? 400 : 500;
if (isActive || isPressed) return `${baseColor}.${baseVariation + 200}`;
if (isHovered) return `${baseColor}.${baseVariation + 100}`;
return `${baseColor}.${baseVariation}`;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/hooks/webEvents/createPseudoHook.ts
// Code from https://github.com/EvanBacon/react-native-web-hooks
// MIT License
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable consistent-return */
import * as React from "react";
import { Platform } from "react-native";
export function createPseudoHook<T>({
events
}: {
events: string[];
}): (ref: React.MutableRefObject<T> & any) => any {
return function inner(ref) {
if (
// Pseudo classes only work in the browser
Platform.OS !== "web"
) {
return false;
}
const [isActive, setActive] = React.useState(false);
React.useEffect(() => {
const [eventIn, eventOut] = events;
const node = ref && (ref.current || ref);
if (!node) {
return;
}
const resolve = (value: any) => {
setActive(value);
};
// @ts-ignore
const onStart = resolve.bind(this, true);
// @ts-ignore
const onEnd = resolve.bind(this, false);
node.addEventListener(eventIn, onStart);
node.addEventListener(eventOut, onEnd);
// Special case for useActive to respond when the user drags out of the view and releases.
if (eventOut === "mouseup") {
document.addEventListener(eventOut, onEnd, false);
}
return () => {
document.removeEventListener(eventOut, onEnd, false);
node.removeEventListener(eventIn, onStart);
node.removeEventListener(eventOut, onEnd);
};
}, [ref && ref.current]);
return isActive;
};
}
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/hooks/webEvents/index.ts
// Code from https://github.com/EvanBacon/react-native-web-hooks
// MIT License
import { MutableRefObject } from "react";
import { createPseudoHook } from "./createPseudoHook";
export const useActive = createPseudoHook({
events: ["mousedown", "mouseup"]
}) as <T>(ref: MutableRefObject<T>) => boolean;
export const useFocus = createPseudoHook({
events: ["focus", "blur"]
}) as <T>(ref: MutableRefObject<T>) => boolean;
export const useHover = createPseudoHook({
events: ["mouseenter", "mouseleave"]
}) as <T>(ref: MutableRefObject<T>) => boolean;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/link/index.tsx
import React, { forwardRef, useRef } from "react";
import { GestureResponderEvent, Linking, Platform, View } from "react-native";
import { useQaLabel } from "../../hooks/useQaLabel";
import Paragraph from "../typography/paragraph";
import { StyledPressable, StyledView } from "./styled-components";
import { LinkProps } from "./types";
import { getColor } from "./utils/getColor";
import { useEvents } from "../../hooks/useEvents";
import { useActive } from "../../hooks/webEvents";
const isWeb = Platform.OS === "web";
export const Link = forwardRef<View, LinkProps>(
(
{
qaLabel,
href,
children,
isDarkMode = false,
onPress,
style,
target = "_self",
...props
},
ref
) => {
const viewTestProps = useQaLabel(qaLabel);
const refLink = useRef(null);
const { events, eventsHandlers } = useEvents({});
const isActive = useActive(refLink);
const pressHandler = (e: GestureResponderEvent): void => {
// Allow always to have a onPress call if function is passed
if (typeof onPress === "function") {
onPress();
}
if (!isWeb || target === "_blank") {
Linking.openURL(href!);
e.preventDefault();
}
};
return (
<StyledView ref={ref} {...props}>
<StyledPressable
accessibilityRole="link"
// @ts-ignore
href={isWeb && target !== "_blank" && href}
onPress={pressHandler}
ref={refLink}
{...viewTestProps}
{...eventsHandlers}
>
<Paragraph
fontFamily="medium"
color={getColor(
events.isHovered,
events.isPressed,
isActive,
isDarkMode
)}
qaLabel={`${qaLabel}-text`}
style={style}
>
{children}
</Paragraph>
</StyledPressable>
</StyledView>
);
}
);
export type { LinkProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/alertInline/utils/getPressableColor.ts
import { EventsState } from "../../../hooks/useEvents";
import {
alertInlinePressableVariants,
alertToastPressableVariants
} from "../styled-components";
import { AlertInlineVariants, AlertInlineTypes } from "../types";
export const getPressableColor = (
type: AlertInlineTypes,
variant: AlertInlineVariants,
events?: EventsState
): string => {
const variantStyle =
type === "toast"
? alertToastPressableVariants[variant]
: alertInlinePressableVariants[variant];
if (events?.isPressed || events?.isFocused) return variantStyle.active;
if (events?.isHovered) return variantStyle.hover;
return variantStyle.base;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/alertInline/components/link/styled-components.ts
import styled from "styled-components/native";
import { get } from "lodash";
import { Link } from "../../../link";
import { StyledLinkProps } from "./types";
import { AlertInlineVariants } from "../../types";
import { getPressableColor } from "../../utils/getPressableColor";
export const StyledLink = styled(Link)<StyledLinkProps>`
color: ${({ type = "floating", variant = "success", events, theme }) =>
get(
theme.colors,
getPressableColor(type, variant as AlertInlineVariants, events)
)};
text-decoration: underline;
text-decoration-color: ${({ type = "floating", variant, events, theme }) =>
get(
theme.colors,
getPressableColor(type, variant as AlertInlineVariants, events)
)};
line-height: 16px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/utils/tvgConfProvider.tsx
import React, { createContext, useContext } from "react";
import tvgConf from "@tvg/conf";
import { Devices } from "../theming/types";
export interface TvgConfProps {
device: Devices;
brand: string;
product: string;
}
export interface TvgConfProviderProps extends Partial<TvgConfProps> {
children: JSX.Element;
}
const initialState: TvgConfProps = {
device: "mobile",
brand: "tvg",
product: "touch3"
};
export const TvgConfContext = createContext<TvgConfProps>(initialState);
export const TvgConfProvider = ({
children,
...overrides
}: TvgConfProviderProps) => (
<TvgConfContext.Provider
value={{
device: tvgConf().device,
brand: tvgConf().brand,
product: tvgConf().product,
...overrides
}}
>
{children}
</TvgConfContext.Provider>
);
export const useTvgConfContext = () => useContext(TvgConfContext);
export default TvgConfProvider;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/common/iconSizes.ts
import { IconSizes } from "../../types";
export const iconSizes: IconSizes = {
xs: {
iconSize: "8",
strokeWidth: "2.4"
},
s: {
iconSize: "16",
strokeWidth: "2.3"
},
m: {
iconSize: "20",
strokeWidth: "2.2"
},
l: {
iconSize: "24",
strokeWidth: "2"
},
xl: {
iconSize: "32",
strokeWidth: "1.6"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/common/space.ts
import { Space } from "../../types";
export const space: Space = {
"space-1": "4px",
"space-2": "6px",
"space-3": "8px",
"space-4": "12px",
"space-5": "16px",
"space-6": "20px",
"space-7": "24px",
"space-8": "32px"
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/common/fonts.ts
import { FontWeights, Fonts, FontSizes, LineHeights } from "../../types";
export const fonts: Fonts = {
condensedRegular: "RobotoCondensed-Regular",
regular: "Roboto-Regular",
medium: "Roboto-Medium",
bold: "Roboto-Bold"
};
export const fontSizes: FontSizes = {
xs: "12px",
s: "14px",
m: "16px",
l: "18px",
xl: "20px",
"2xl": "24px",
"3xl": "28px",
"4xl": "32px"
};
export const lineHeights: LineHeights = {
xs: "15px",
s: "18px",
m: "20px",
l: "22px",
xl: "25px",
"2xl": "30px",
"3xl": "35px",
"4xl": "40px"
};
export const lineHeightsShorter = {
xs: "13px",
s: "15px"
};
export const lineHeightsTaller = {
xs: "18px",
s: "21px"
};
export const fontWeights: FontWeights = {
normal: 400,
medium: 500,
bold: 700
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/common/colors.ts
import { Colors } from "../../types";
export const colors: Colors = {
blue_accent: {
"000": "#FAFCFF",
"100": "#EBF5FF",
"200": "#CDDFFA",
"300": "#AFCCFA",
"400": "#87B2F5",
"500": "#5390ED",
"600": "#3574D4",
"700": "#2F67BD",
"800": "#2959A3",
"900": "#1C3D70"
},
green: {
"000": "#F5FFF7",
"100": "#CEEBD4",
"200": "#B1DEBA",
"300": "#90D19D",
"400": "#69BF7A",
"500": "#38AB4F",
"600": "#329A47",
"700": "#2D873F",
"800": "#246F33",
"900": "#195024"
},
yellow: {
"000": "#FFF6E0",
"100": "#FFECBF",
"200": "#FFE099",
"300": "#FFD470",
"400": "#FFC642",
"500": "#FFB80C",
"600": "#E6A40A",
"700": "#CA9008",
"800": "#A87707",
"900": "#795605"
},
blue: {
"000": "#E9EFF5",
"100": "#D6E3F0",
"200": "#B7CCE1",
"300": "#92B0CE",
"400": "#668FB8",
"500": "#27619B",
"600": "#23568A",
"700": "#1E4B79",
"800": "#193D62",
"900": "#112B44"
},
orange: {
"000": "#FFF3E6",
"100": "#FFE6CC",
"200": "#FAD5AF",
"300": "#F5C089",
"400": "#F0A556",
"500": "#ED850C",
"600": "#D67A11",
"700": "#BD6909",
"800": "#AD6008",
"900": "#854A06"
},
red: {
"000": "#FCEBEB",
"100": "#F7D5D5",
"200": "#F5BCBC",
"300": "#F09E9E",
"400": "#E87676",
"500": "#DE3131",
"600": "#C92C2C",
"700": "#B02727",
"800": "#912020",
"900": "#661616"
},
grey: {
"000": "#F8F8F9",
"100": "#ECEDEE",
"200": "#DEE1E3",
"300": "#CFD2D6",
"400": "#BFC4C8",
"500": "#ADB3B9",
"600": "#99A0A7",
"700": "#818A92",
"800": "#626D78",
"900": "#384048"
},
black: {
"000": "rgba(0, 0, 0, 0.1)",
"100": "rgba(0, 0, 0, 0.2)",
"200": "rgba(0, 0, 0, 0.3)",
"300": "rgba(0, 0, 0, 0.4)",
"400": "rgba(0, 0, 0, 0.5)",
"500": "rgba(0, 0, 0, 0.6)",
"600": "rgba(0, 0, 0, 0.7)",
"700": "rgba(0, 0, 0, 0.8)",
"800": "rgba(0, 0, 0, 0.9)",
"900": "#000000"
},
white: {
"000": "rgba(255, 255, 255, 0.1)",
"100": "rgba(255, 255, 255, 0.2)",
"200": "rgba(255, 255, 255, 0.3)",
"300": "rgba(255, 255, 255, 0.4)",
"400": "rgba(255, 255, 255, 0.5)",
"500": "rgba(255, 255, 255, 0.6)",
"600": "rgba(255, 255, 255, 0.7)",
"700": "rgba(255, 255, 255, 0.8)",
"800": "rgba(255, 255, 255, 0.9)",
"900": "#FFFFFF"
},
tint: {
blue_tint: "#1A4066",
green_tint: "#194546",
yellow_tint: "#414739"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/common/elevations.ts
import { rgba } from "polished";
import { colors } from "./colors";
import { Elevations } from "../../types";
export const elevations: Elevations = {
low: `0px 1px 3px ${rgba(colors.blue["900"], 0.12)}`,
medium: `0px 2px 4px ${rgba(colors.blue["900"], 0.14)}`,
high: `0px 1px 16px ${rgba(colors.blue["900"], 0.25)}`
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/common/buttons.ts
import { Buttons, IconButtons } from "../../types";
import { colors } from "./colors";
import { elevations } from "./elevations";
export const buttons: Buttons = {
primary: {
default: {
background: colors.blue_accent["500"],
border: "none",
boxShadow: elevations.medium,
color: colors.white["900"]
},
hovered: {
background: colors.blue_accent["600"],
boxShadow: elevations.high
},
focused: { background: colors.blue_accent["700"], boxShadow: "0 0 0" },
pressed: { background: colors.blue_accent["700"], boxShadow: "0 0 0" },
loading: { background: colors.white["200"] }
},
secondary: {
default: {
background: colors.white["900"],
border: `1px solid ${colors.blue["100"]}`,
boxShadow: elevations.low,
color: colors.grey["900"]
},
hovered: {
background: colors.blue_accent["000"],
boxShadow: elevations.medium
},
focused: { background: colors.blue_accent["100"], boxShadow: "0 0 0" },
pressed: { background: colors.blue_accent["100"], boxShadow: "0 0 0" },
loading: { background: colors.grey["200"] }
},
secondary_dark: {
default: {
background: colors.white["000"],
border: "none",
color: colors.white["900"]
},
hovered: { background: colors.white["100"] },
focused: { background: colors.white["200"] },
pressed: { background: colors.white["200"] },
loading: { background: colors.white["200"] }
},
tertiary: {
default: {
background: "transparent",
border: "none",
color: colors.blue_accent["500"]
},
hovered: {
background: colors.blue_accent["100"]
},
focused: { background: colors.blue_accent["200"] },
pressed: { background: colors.blue_accent["200"] },
loading: { background: colors.blue_accent["200"] }
},
tertiary_dark: {
default: {
background: "transparent",
border: "none",
color: colors.white["900"]
},
hovered: {
background: colors.white["000"]
},
focused: { background: colors.white["200"] },
pressed: { background: colors.white["200"] },
loading: { background: colors.white["200"] }
},
betting: {
default: {
background: colors.green["500"],
border: "none",
boxShadow: elevations.medium,
color: colors.white["900"]
},
hovered: {
background: colors.green["600"],
boxShadow: elevations.high
},
focused: { background: colors.green["700"], boxShadow: "0 0 0" },
pressed: { background: colors.green["700"], boxShadow: "0 0 0" },
loading: { background: colors.white["200"] }
},
marketing: {
default: {
background: colors.yellow["500"],
border: "none",
boxShadow: elevations.medium,
color: colors.grey["900"]
},
hovered: {
background: colors.yellow["600"],
boxShadow: elevations.high
},
focused: { background: colors.yellow["700"], boxShadow: "0 0 0" },
pressed: { background: colors.yellow["700"], boxShadow: "0 0 0" },
loading: { background: colors.grey["200"] }
},
danger: {
default: {
background: colors.red["500"],
border: "none",
boxShadow: elevations.medium,
color: colors.white["900"]
},
hovered: {
background: colors.red["600"],
boxShadow: elevations.high
},
focused: { background: colors.red["700"], boxShadow: "0 0 0" },
pressed: { background: colors.red["700"], boxShadow: "0 0 0" },
loading: { background: colors.white["200"] }
}
};
export const iconButtons: IconButtons = {
primary: {
...buttons.primary
},
secondary: {
...buttons.secondary
},
secondary_dark: {
...buttons.secondary_dark
},
tertiary: {
default: {
background: "transparent",
border: "none",
color: colors.grey["900"]
},
hovered: {
background: colors.grey["100"]
},
focused: { background: colors.grey["200"] },
pressed: { background: colors.grey["200"] }
},
tertiary_dark: {
...buttons.tertiary_dark
},
betting: {
...buttons.betting
},
danger: {
...buttons.danger
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/common/tvgColorPalette.ts
export const tvgColorPalette = {
blue_accent: {
"000": "#FAFCFF",
"100": "#EBF5FF",
"200": "#CDDFFA",
"300": "#AFCCFA",
"400": "#87B2F5",
"500": "#5390ED",
"600": "#3574D4",
"700": "#2F67BD",
"800": "#2959A3",
"900": "#1C3D70"
},
green: {
"000": "#F5FFF7",
"100": "#CEEBD4",
"200": "#B1DEBA",
"300": "#90D19D",
"400": "#69BF7A",
"500": "#38AB4F",
"600": "#329A47",
"700": "#2D873F",
"800": "#246F33",
"900": "#195024"
},
yellow: {
"000": "#FFF6E0",
"100": "#FFECBF",
"200": "#FFE099",
"300": "#FFD470",
"400": "#FFC642",
"500": "#FFB80C",
"600": "#E6A40A",
"700": "#CA9008",
"800": "#A87707",
"900": "#795605"
},
blue: {
"000": "#E9EFF5",
"100": "#D6E3F0",
"200": "#B7CCE1",
"300": "#92B0CE",
"400": "#668FB8",
"500": "#27619B",
"600": "#23568A",
"700": "#1E4B79",
"800": "#193D62",
"900": "#112B44"
},
orange: {
"000": "#FFF3E6",
"100": "#FFE6CC",
"200": "#FAD5AF",
"300": "#F5C089",
"400": "#F0A556",
"500": "#ED850C",
"600": "#D67A11",
"700": "#BD6909",
"800": "#AD6008",
"900": "#854A06"
},
red: {
"000": "#FCEBEB",
"100": "#F7D5D5",
"200": "#F5BCBC",
"300": "#F09E9E",
"400": "#E87676",
"500": "#DE3131",
"600": "#C92C2C",
"700": "#B02727",
"800": "#912020",
"900": "#661616"
},
grey: {
"000": "#F8F8F9",
"100": "#ECEDEE",
"200": "#DEE1E3",
"300": "#CFD2D6",
"400": "#BFC4C8",
"500": "#ADB3B9",
"600": "#99A0A7",
"700": "#818A92",
"800": "#626D78",
"900": "#384048"
},
black: {
"005": "rgba(0, 0, 0, 0.05)",
"000": "rgba(0, 0, 0, 0.1)",
"100": "rgba(0, 0, 0, 0.2)",
"200": "rgba(0, 0, 0, 0.3)",
"300": "rgba(0, 0, 0, 0.4)",
"400": "rgba(0, 0, 0, 0.5)",
"500": "rgba(0, 0, 0, 0.6)",
"600": "rgba(0, 0, 0, 0.7)",
"700": "rgba(0, 0, 0, 0.8)",
"800": "rgba(0, 0, 0, 0.9)",
"900": "#000000"
},
white: {
"005": "rgba(255, 255, 255, 0.05)",
"000": "rgba(255, 255, 255, 0.1)",
"100": "rgba(255, 255, 255, 0.2)",
"200": "rgba(255, 255, 255, 0.3)",
"300": "rgba(255, 255, 255, 0.4)",
"400": "rgba(255, 255, 255, 0.5)",
"500": "rgba(255, 255, 255, 0.6)",
"600": "rgba(255, 255, 255, 0.7)",
"700": "rgba(255, 255, 255, 0.8)",
"800": "rgba(255, 255, 255, 0.9)",
"900": "#FFFFFF"
},
tint: {
transparentBlack: "rgba(0, 0, 0, 0)",
transparentWhite: "rgba(255, 255, 255, 0)",
blue_tint: "#1A4066",
green_tint: "#194546",
yellow_tint: "#414739"
}
} as const;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/common/fanduelColorPalette.ts
const core = {
greenL5: "#E9F8EF",
greenL4: "#BCEBCE",
greenL3: "#7FD9A1",
greenL2: "#31C268",
greenL1: "#1BB152",
green: "#128000",
greenD1: "#00732C",
greenD2: "#005D23",
greenD3: "#00491C",
greenD4: "#002E11",
blueL5: "#EAF4FF",
blueL4: "#C8E2FF",
blueL3: "#99CAFF",
blueL2: "#64AEFF",
blueL1: "#2B90FF",
blue: "#0070EB",
blueD1: "#005FC8",
blueD2: "#004EA3",
blueD3: "#003D81",
blueD4: "#002650",
navyL5: "#EDEFF2",
navyL4: "#C6D3E1",
navyL3: "#9CB1CB",
navyL2: "#819CBB",
navyL1: "#6682A2",
navy: "#184C8B",
navyD1: "#14417A",
navyD2: "#103469",
navyD3: "#05285A",
navyD4: "#011638",
redL5: "#FDECED",
redL4: "#F9C9CE",
redL3: "#F198A1",
redL2: "#EA6875",
redL1: "#EB4758",
red: "#D22839",
redD1: "#C8002B",
redD2: "#A40023",
redD3: "#83001C",
redD4: "#40020D",
orangeL5: "#FFF1E6",
orangeL4: "#FFD8B9",
orangeL3: "#FFB77E",
orangeL2: "#FF8C31",
orangeL1: "#F87A1E",
orange: "#C15400",
orangeD1: "#A44800",
orangeD2: "#843B00",
orangeD3: "#692E00",
orangeD4: "#401D00",
yellowL5: "#FFF6BD",
yellowL4: "#FFDC2E",
yellowL3: "#EAC300",
yellowL2: "#C9A800",
yellowL1: "#A98E00",
yellow: "#8A7000",
yellowD1: "#756100",
yellowD2: "#5F4F00",
yellowD3: "#4B3F00",
yellowD4: "#2E2600",
purpleL5: "#F6F1FE",
purpleL4: "#E6D6FE",
purpleL3: "#D4B6FE",
purpleL2: "#C18FFE",
purpleL1: "#B265FE",
purple: "#A530F3",
purpleD1: "#8F02E1",
purpleD2: "#7401B7",
purpleD3: "#61019B",
purpleD4: "#36005B",
tealL5: "#CAFDFF",
tealL4: "#2AF8FF",
tealL3: "#00DCE3",
tealL2: "#00BDC3",
tealL1: "#00A0A5",
teal: "#008085",
tealD1: "#006E72",
tealD2: "#005A5C",
tealD3: "#004649",
tealD4: "#002C2E",
white: "#FFFFFF",
greyL5: "#F7FBFF",
greyL4: "#EAF0F6",
greyL3: "#C9D1DB",
greyL2: "#B0B7BF",
greyL1: "#969DA3",
grey: "#7F848A",
greyD1: "#6A6F73",
greyD2: "#2D2F30",
greyD3: "#1D1E1F",
greyD4: "#131314",
black: "#0A0A0A",
transparentBlack: "rgba(10, 10, 10, 0)",
blackTint005: "rgba(10, 10, 10, 0.05)",
blackTint010: "rgba(10, 10, 10, 0.10)",
blackTint020: "rgba(10, 10, 10, 0.20)",
blackTint030: "rgba(10, 10, 10, 0.30)",
blackTint040: "rgba(10, 10, 10, 0.40)",
blackTint050: "rgba(10, 10, 10, 0.50)",
blackTint060: "rgba(10, 10, 10, 0.60)",
blackTint070: "rgba(10, 10, 10, 0.70)",
blackTint080: "rgba(10, 10, 10, 0.80)",
blackTint090: "rgba(10, 10, 10, 0.90)",
transparentWhite: "rgba(255, 255, 255, 0)",
whiteTint005: "rgba(255, 255, 255, 0.05)",
whiteTint010: "rgba(255, 255, 255, 0.10)",
whiteTint020: "rgba(255, 255, 255, 0.20)",
whiteTint030: "rgba(255, 255, 255, 0.30)",
whiteTint040: "rgba(255, 255, 255, 0.40)",
whiteTint050: "rgba(255, 255, 255, 0.50)",
whiteTint060: "rgba(255, 255, 255, 0.60)",
whiteTint070: "rgba(255, 255, 255, 0.70)",
whiteTint080: "rgba(255, 255, 255, 0.80)",
whiteTint090: "rgba(255, 255, 255, 0.90)"
} as const;
const brand = {
primary: {
default: core.blue,
tint: core.blueL4,
shade: core.blueD2
},
secondary: {
default: core.navyD3,
tint: core.navyL4,
shade: core.navyD4
},
tertiary: {
default: core.yellowL4,
tint: core.yellowL5,
shade: core.yellow
},
decorative: {
sgp: core.yellowL4,
bonus: core.navyD3
},
gradient: {
sports: "linear-gradient(125deg, #005FC8 0%, #003D81 100%)",
gaming: "linear-gradient(125deg, #61019B 0%, #005FC8 100%)"
}
};
export const fanduelColorPalette = {
core,
brand
} as const;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/common/index.ts
import { Radii } from "../../types";
export const breakpoints: Array<string> = [];
export const radii: Radii = {
xs: "2px",
s: "4px",
m: "10px",
l: "12px",
xl: "24px",
"2xl": "48px"
};
export * from "./iconSizes";
export * from "./space";
export * from "./fonts";
export * from "./buttons";
export * from "./elevations";
export * from "./tvgColorPalette";
export * from "./fanduelColorPalette";
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/tokens/tvgColorTokens.ts
import { tvgColorPalette } from "../common";
import { ColorTokens } from "./types";
const core = {
transparentBlack: tvgColorPalette.tint.transparentBlack,
blackTint005: tvgColorPalette.black["005"],
blackTint010: tvgColorPalette.black["000"],
blackTint020: tvgColorPalette.black["100"],
blackTint030: tvgColorPalette.black["200"],
blackTint040: tvgColorPalette.black["300"],
blackTint050: tvgColorPalette.black["400"],
blackTint060: tvgColorPalette.black["500"],
blackTint070: tvgColorPalette.black["600"],
blackTint080: tvgColorPalette.black["700"],
blackTint090: tvgColorPalette.black["800"],
transparentWhite: tvgColorPalette.tint.transparentWhite,
whiteTint005: tvgColorPalette.white["005"],
whiteTint010: tvgColorPalette.white["000"],
whiteTint020: tvgColorPalette.white["100"],
whiteTint030: tvgColorPalette.white["200"],
whiteTint040: tvgColorPalette.white["300"],
whiteTint050: tvgColorPalette.white["400"],
whiteTint060: tvgColorPalette.white["500"],
whiteTint070: tvgColorPalette.white["600"],
whiteTint080: tvgColorPalette.white["700"],
whiteTint090: tvgColorPalette.white["800"]
};
const content = {
strong: tvgColorPalette.grey["900"],
default: tvgColorPalette.grey["900"],
subtle: tvgColorPalette.grey["800"],
subtle2: tvgColorPalette.grey["700"],
subtle3: tvgColorPalette.grey["500"],
disabled: tvgColorPalette.black["100"],
onLight: tvgColorPalette.grey["900"],
onDark: tvgColorPalette.white["900"],
link: tvgColorPalette.blue_accent["500"],
linkActive: tvgColorPalette.blue_accent["700"],
brandPrimary: tvgColorPalette.blue_accent["500"],
brandSecondary: tvgColorPalette.grey["900"],
info: tvgColorPalette.blue_accent["700"],
positive: tvgColorPalette.green["800"],
negative: tvgColorPalette.red["700"],
warning: tvgColorPalette.orange["900"],
alert: tvgColorPalette.yellow["900"],
neutral: tvgColorPalette.grey["800"],
mtp: tvgColorPalette.blue["400"],
loadingDefault: tvgColorPalette.blue["000"],
loadingInverse: tvgColorPalette.white["000"]
};
const component = {
// TODO: REVISION TAGS
tag: {
offer: {
background: tvgColorPalette.yellow["500"],
content: tvgColorPalette.black["800"]
},
offer_subtle: {
background: tvgColorPalette.yellow["100"],
content: tvgColorPalette.black["900"]
},
"1stpick": {
background: tvgColorPalette.green["100"],
content: tvgColorPalette.green["800"]
},
"2ndpick": {
background: tvgColorPalette.blue["000"],
content: tvgColorPalette.grey["800"]
},
"3rdpick": {
background: tvgColorPalette.orange["100"],
content: tvgColorPalette.orange["900"]
},
regular_subtle: {
background: tvgColorPalette.blue["000"],
content: tvgColorPalette.grey["800"]
}
},
button: {
primary: {
content: {
base: tvgColorPalette.white["900"],
hover: tvgColorPalette.white["900"],
active: tvgColorPalette.white["900"],
disabled: tvgColorPalette.black["200"]
},
background: {
base: tvgColorPalette.green["500"],
hover: tvgColorPalette.green["600"],
active: tvgColorPalette.green["700"],
disabled: tvgColorPalette.blue["000"]
}
},
secondary: {
content: {
base: tvgColorPalette.white["900"],
hover: tvgColorPalette.white["900"],
active: tvgColorPalette.white["900"],
disabled: tvgColorPalette.black["200"]
},
background: {
base: tvgColorPalette.blue_accent["500"],
hover: tvgColorPalette.blue_accent["600"],
active: tvgColorPalette.blue_accent["700"],
disabled: tvgColorPalette.blue["000"]
}
},
tertiary: {
content: {
base: tvgColorPalette.grey["900"],
hover: tvgColorPalette.grey["900"],
active: tvgColorPalette.grey["900"],
disabled: tvgColorPalette.black["200"]
},
background: {
base: tvgColorPalette.white["900"],
hover: tvgColorPalette.blue_accent["000"],
active: tvgColorPalette.blue_accent["100"],
disabled: tvgColorPalette.blue["000"]
},
border: {
base: tvgColorPalette.blue["100"],
hover: tvgColorPalette.blue["100"],
active: tvgColorPalette.blue["100"],
disabled: tvgColorPalette.black["100"]
}
},
destructive: {
content: {
base: tvgColorPalette.white["900"],
hover: tvgColorPalette.white["900"],
active: tvgColorPalette.white["900"],
disabled: tvgColorPalette.black["200"]
},
background: {
base: tvgColorPalette.red["500"],
hover: tvgColorPalette.red["600"],
active: tvgColorPalette.red["700"],
disabled: tvgColorPalette.blue["000"]
}
},
buttonLink: {
content: {
base: tvgColorPalette.blue_accent["500"],
hover: tvgColorPalette.blue_accent["500"],
active: tvgColorPalette.blue_accent["500"],
disabled: tvgColorPalette.black["200"]
},
background: {
base: "transparent",
hover: tvgColorPalette.blue_accent["100"],
active: tvgColorPalette.blue_accent["200"],
disabled: tvgColorPalette.blue["000"]
},
border: {
disabled: "transparent"
}
},
betting: {
content: {
base: tvgColorPalette.white["900"],
hover: tvgColorPalette.white["900"],
active: tvgColorPalette.white["900"],
disabled: tvgColorPalette.black["200"]
},
background: {
base: tvgColorPalette.green["500"],
hover: tvgColorPalette.green["600"],
active: tvgColorPalette.green["700"],
disabled: tvgColorPalette.blue["000"]
}
},
promo: {
content: {
base: tvgColorPalette.grey["900"],
hover: tvgColorPalette.grey["900"],
active: tvgColorPalette.grey["900"],
disabled: tvgColorPalette.black["200"]
},
background: {
base: tvgColorPalette.yellow["500"],
hover: tvgColorPalette.yellow["600"],
active: tvgColorPalette.yellow["700"],
disabled: tvgColorPalette.blue["000"]
}
},
secondaryDark: {
content: {
base: tvgColorPalette.white["900"],
hover: tvgColorPalette.white["900"],
active: tvgColorPalette.white["900"],
disabled: tvgColorPalette.white["200"]
},
background: {
base: tvgColorPalette.white["000"],
hover: tvgColorPalette.white["100"],
active: tvgColorPalette.white["200"],
disabled: tvgColorPalette.white["000"]
}
},
transparent: {
content: {
base: tvgColorPalette.white["900"],
hover: tvgColorPalette.white["900"],
active: tvgColorPalette.white["900"],
disabled: tvgColorPalette.white["200"]
},
background: {
base: tvgColorPalette.white["000"],
hover: tvgColorPalette.white["100"],
active: tvgColorPalette.white["200"],
disabled: tvgColorPalette.white["000"]
},
border: {
base: "transparent",
hover: "transparent",
active: "transparent",
disabled: "transparent"
}
}
},
notification: {
info: {
background: tvgColorPalette.blue_accent["600"],
backgroundSubtle: tvgColorPalette.blue_accent["000"],
border: tvgColorPalette.blue_accent["200"],
content: tvgColorPalette.blue_accent["700"]
},
positive: {
background: tvgColorPalette.green["600"],
backgroundSubtle: tvgColorPalette.green["100"],
border: tvgColorPalette.green["300"],
content: tvgColorPalette.green["800"]
},
negative: {
background: tvgColorPalette.red["500"],
backgroundSubtle: tvgColorPalette.red["000"],
border: tvgColorPalette.red["200"],
content: tvgColorPalette.red["700"]
},
warning: {
background: tvgColorPalette.orange["500"],
backgroundSubtle: tvgColorPalette.orange["000"],
border: tvgColorPalette.orange["200"],
content: tvgColorPalette.orange["900"]
},
promo: {
background: tvgColorPalette.yellow["500"],
backgroundSubtle: tvgColorPalette.yellow["000"],
border: tvgColorPalette.yellow["200"],
content: tvgColorPalette.yellow["900"]
},
geocomply: {
backgroundVerification: tvgColorPalette.blue_accent["600"],
backgroundSuccess: tvgColorPalette.green["600"]
}
},
betslip: {
background: tvgColorPalette.blue["800"],
backgroundExpanded: tvgColorPalette.blue["900"]
},
activeGroupedFilterCell: {
content: tvgColorPalette.blue_accent["700"],
background: tvgColorPalette.blue_accent["100"],
border: tvgColorPalette.blue_accent["500"]
},
input: {
base: tvgColorPalette.grey["300"],
surface: tvgColorPalette.white["900"],
hover: tvgColorPalette.blue_accent["100"],
pressed: tvgColorPalette.blue_accent["200"],
active: tvgColorPalette.blue_accent["500"],
selected: tvgColorPalette.blue_accent["700"],
disabled: tvgColorPalette.blue["000"],
border: tvgColorPalette.blue["100"]
}
};
const background = {
base: tvgColorPalette.blue["000"],
surface: tvgColorPalette.white["900"],
layer: tvgColorPalette.blue_accent["000"],
accent: tvgColorPalette.grey["000"],
hover: tvgColorPalette.blue_accent["100"],
fadeEnd: "linear-gradient(90deg, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)",
fadeBottom:
"linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)",
primary: tvgColorPalette.blue_accent["500"],
secondary: tvgColorPalette.blue["900"],
promotional: tvgColorPalette.blue["900"],
info: tvgColorPalette.blue_accent["600"],
infoSubtle: tvgColorPalette.blue_accent["100"],
positive: tvgColorPalette.green["600"],
positiveSubtle: tvgColorPalette.green["100"],
negative: tvgColorPalette.red["500"],
negativeSubtle: tvgColorPalette.red["000"],
warning: tvgColorPalette.orange["500"],
warningSubtle: tvgColorPalette.orange["000"],
alert: tvgColorPalette.yellow["500"],
alertSubtle: tvgColorPalette.yellow["000"],
neutral: tvgColorPalette.grey["600"],
neutralSubtle: tvgColorPalette.grey["000"]
};
const lhnHeader = {
content: {
strong: tvgColorPalette.blue["000"],
default: tvgColorPalette.blue["200"],
subtle: tvgColorPalette.white["500"],
brandSecondary: tvgColorPalette.blue["300"],
positive: tvgColorPalette.green["400"],
negative: tvgColorPalette.red["400"]
},
border: {
default: tvgColorPalette.blue["800"],
inverse: tvgColorPalette.blue["600"]
},
selectedcell: {
border: tvgColorPalette.blue["600"],
background: tvgColorPalette.blue["800"]
}
};
const border = {
default: tvgColorPalette.blue["100"],
subtle: tvgColorPalette.blue["000"],
inverse: tvgColorPalette.white["900"],
brand: tvgColorPalette.blue["100"],
info: tvgColorPalette.blue_accent["200"],
positive: tvgColorPalette.green["300"],
negative: tvgColorPalette.red["200"],
warning: tvgColorPalette.orange["200"],
alert: tvgColorPalette.yellow["200"]
};
export const myBets = {
open: {
border: "transparent",
background: "transparent",
dotColor: tvgColorPalette.grey["600"],
textColor: tvgColorPalette.grey["800"],
iconColor: tvgColorPalette.grey["600"],
trackingColor: tvgColorPalette.grey["300"]
},
raceOff: {
border: tvgColorPalette.grey["800"],
background: tvgColorPalette.white["100"],
textColor: tvgColorPalette.grey["900"],
iconColor: tvgColorPalette.grey["800"],
dotColor: tvgColorPalette.grey["800"],
trackingColor: tvgColorPalette.grey["300"]
},
unknown: {
border: tvgColorPalette.grey["800"],
background: tvgColorPalette.white["100"],
textColor: tvgColorPalette.grey["900"],
iconColor: tvgColorPalette.grey["800"],
dotColor: tvgColorPalette.grey["800"],
trackingColor: tvgColorPalette.grey["300"]
},
win: {
border: tvgColorPalette.green["700"],
background: tvgColorPalette.green["100"],
textColor: tvgColorPalette.green["700"],
iconColor: tvgColorPalette.green["700"],
dotColor: tvgColorPalette.green["000"],
trackingColor: tvgColorPalette.green["300"]
},
lost: {
border: tvgColorPalette.red["700"],
background: tvgColorPalette.red["100"],
textColor: tvgColorPalette.red["700"],
iconColor: tvgColorPalette.red["700"],
trackingColor: tvgColorPalette.red["300"]
},
attention: {
border: tvgColorPalette.grey["900"],
background: tvgColorPalette.orange["400"],
textColor: tvgColorPalette.orange["700"],
iconColor: tvgColorPalette.orange["700"],
trackingColor: tvgColorPalette.orange["300"]
}
};
export const tvgColorTokens: ColorTokens = {
core,
component,
content,
background,
lhnHeader,
border,
myBets,
groupedfiltercell: {
background: {
default: "transparent",
hover: tvgColorPalette.blue_accent["000"],
pressed: tvgColorPalette.blue_accent["100"],
active: tvgColorPalette.blue_accent["100"]
},
border: {
default: "transparent",
hover: tvgColorPalette.blue["100"],
pressed: tvgColorPalette.blue["100"],
active: tvgColorPalette.blue_accent["500"]
},
content: {
default: tvgColorPalette.grey["900"],
hover: tvgColorPalette.grey["900"],
pressed: tvgColorPalette.grey["900"],
active: tvgColorPalette.blue_accent["700"]
}
},
notification: {
info: {
background: tvgColorPalette.blue_accent["600"],
backgroundSubtle: tvgColorPalette.blue_accent["000"],
subtle: tvgColorPalette.blue_accent["700"],
content: tvgColorPalette.white["900"],
border: tvgColorPalette.blue_accent["200"]
},
positive: {
background: tvgColorPalette.green["600"],
backgroundSubtle: tvgColorPalette.green["100"],
subtle: tvgColorPalette.green["800"],
content: tvgColorPalette.white["900"],
border: tvgColorPalette.green["300"]
},
negative: {
background: tvgColorPalette.red["500"],
backgroundSubtle: tvgColorPalette.red["000"],
subtle: tvgColorPalette.red["700"],
content: tvgColorPalette.white["900"],
border: tvgColorPalette.red["200"]
},
warning: {
background: tvgColorPalette.orange["500"],
backgroundSubtle: tvgColorPalette.orange["000"],
subtle: tvgColorPalette.orange["900"],
content: tvgColorPalette.white["900"],
border: tvgColorPalette.orange["200"]
},
promo: {
background: tvgColorPalette.yellow["500"],
backgroundSubtle: tvgColorPalette.yellow["000"],
subtle: tvgColorPalette.yellow["900"],
content: tvgColorPalette.grey["900"],
border: tvgColorPalette.yellow["200"]
}
}
} as const;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/tokens/fanduelColorTokens.ts
import { fanduelColorPalette } from "../common";
import { ColorTokens } from "./types";
const core = {
transparentBlack: fanduelColorPalette.core.transparentBlack,
blackTint005: fanduelColorPalette.core.blackTint005,
blackTint010: fanduelColorPalette.core.blackTint010,
blackTint020: fanduelColorPalette.core.blackTint020,
blackTint030: fanduelColorPalette.core.blackTint030,
blackTint040: fanduelColorPalette.core.blackTint040,
blackTint050: fanduelColorPalette.core.blackTint050,
blackTint060: fanduelColorPalette.core.blackTint060,
blackTint070: fanduelColorPalette.core.blackTint070,
blackTint080: fanduelColorPalette.core.blackTint080,
blackTint090: fanduelColorPalette.core.blackTint090,
transparentWhite: fanduelColorPalette.core.transparentWhite,
whiteTint005: fanduelColorPalette.core.whiteTint005,
whiteTint010: fanduelColorPalette.core.whiteTint010,
whiteTint020: fanduelColorPalette.core.whiteTint020,
whiteTint030: fanduelColorPalette.core.whiteTint030,
whiteTint040: fanduelColorPalette.core.whiteTint040,
whiteTint050: fanduelColorPalette.core.whiteTint050,
whiteTint060: fanduelColorPalette.core.whiteTint060,
whiteTint070: fanduelColorPalette.core.whiteTint070,
whiteTint080: fanduelColorPalette.core.whiteTint080,
whiteTint090: fanduelColorPalette.core.whiteTint090
};
const content = {
strong: fanduelColorPalette.core.navyD3,
default: fanduelColorPalette.core.greyD4,
subtle: fanduelColorPalette.core.greyD1,
subtle2: fanduelColorPalette.core.grey,
subtle3: fanduelColorPalette.core.greyL2,
disabled: fanduelColorPalette.core.greyL3,
onLight: fanduelColorPalette.core.navyD3,
onDark: fanduelColorPalette.core.white,
link: fanduelColorPalette.core.blueD1,
linkActive: fanduelColorPalette.core.blueD3,
brandPrimary: fanduelColorPalette.brand.primary.default,
brandSecondary: fanduelColorPalette.brand.secondary.default,
info: fanduelColorPalette.core.blueD1,
positive: fanduelColorPalette.core.green,
negative: fanduelColorPalette.core.redD1,
warning: fanduelColorPalette.core.orangeD1,
alert: fanduelColorPalette.core.yellowD1,
neutral: fanduelColorPalette.core.greyD1,
mtp: fanduelColorPalette.core.navyL1,
loadingDefault: fanduelColorPalette.core.blackTint005,
loadingInverse: fanduelColorPalette.core.whiteTint010
};
const component = {
// TODO: REVISION TAGS
tag: {
offer: {
background: fanduelColorPalette.core.yellowL4,
content: fanduelColorPalette.core.navyD3
},
offer_subtle: {
background: fanduelColorPalette.core.yellowL4,
content: fanduelColorPalette.core.navyD3
},
"1stpick": {
background: fanduelColorPalette.core.greenL4,
content: fanduelColorPalette.core.greenD3
},
"2ndpick": {
background: fanduelColorPalette.core.blueL4,
content: fanduelColorPalette.core.blueD3
},
"3rdpick": {
background: fanduelColorPalette.core.orangeL4,
content: fanduelColorPalette.core.orangeD3
},
regular_subtle: {
background: fanduelColorPalette.core.greyL4,
content: fanduelColorPalette.core.greyD1
}
},
button: {
primary: {
content: {
base: fanduelColorPalette.core.white,
hover: fanduelColorPalette.core.white,
active: fanduelColorPalette.core.white,
disabled: fanduelColorPalette.core.greyL2
},
background: {
base: fanduelColorPalette.core.green,
hover: fanduelColorPalette.core.greenD1,
active: fanduelColorPalette.core.greenD2,
disabled: fanduelColorPalette.core.greyL4
}
},
secondary: {
content: {
base: fanduelColorPalette.core.white,
hover: fanduelColorPalette.core.white,
active: fanduelColorPalette.core.white,
disabled: fanduelColorPalette.core.greyL2
},
background: {
base: fanduelColorPalette.core.blue,
hover: fanduelColorPalette.core.blueD1,
active: fanduelColorPalette.core.blueD2,
disabled: fanduelColorPalette.core.greyL4
}
},
tertiary: {
content: {
base: fanduelColorPalette.core.blue,
hover: fanduelColorPalette.core.blue,
active: fanduelColorPalette.core.white,
disabled: fanduelColorPalette.core.greyL2
},
background: {
base: fanduelColorPalette.core.transparentWhite,
hover: fanduelColorPalette.core.blueL5,
active: fanduelColorPalette.core.blue,
disabled: fanduelColorPalette.core.transparentWhite
},
border: {
base: fanduelColorPalette.core.blue,
hover: fanduelColorPalette.core.blue,
active: fanduelColorPalette.core.blue,
disabled: fanduelColorPalette.core.greyL2
}
},
destructive: {
content: {
base: fanduelColorPalette.core.white,
hover: fanduelColorPalette.core.white,
active: fanduelColorPalette.core.white,
disabled: fanduelColorPalette.core.greyL2
},
background: {
base: fanduelColorPalette.core.red,
hover: fanduelColorPalette.core.redD1,
active: fanduelColorPalette.core.redD2,
disabled: fanduelColorPalette.core.greyL4
}
},
buttonLink: {
content: {
base: fanduelColorPalette.core.blue,
hover: fanduelColorPalette.core.blueD1,
active: fanduelColorPalette.core.white,
disabled: fanduelColorPalette.core.greyL2
},
background: {
base: fanduelColorPalette.core.transparentWhite,
hover: fanduelColorPalette.core.blueL5,
active: fanduelColorPalette.core.blueD1,
disabled: "transparent"
},
border: {
disabled: fanduelColorPalette.core.greyL2
}
},
betting: {
content: {
base: fanduelColorPalette.core.white,
hover: fanduelColorPalette.core.white,
active: fanduelColorPalette.core.white,
disabled: fanduelColorPalette.core.greyL2
},
background: {
base: fanduelColorPalette.core.greenL1,
hover: fanduelColorPalette.core.green,
active: fanduelColorPalette.core.greenD1,
disabled: fanduelColorPalette.core.greyL4
}
},
promo: {
content: {
base: fanduelColorPalette.core.navyD3,
hover: fanduelColorPalette.core.navyD3,
active: fanduelColorPalette.core.navyD3,
disabled: fanduelColorPalette.core.greyL2
},
background: {
base: fanduelColorPalette.core.yellowL4,
hover: fanduelColorPalette.core.yellowL3,
active: fanduelColorPalette.core.yellowL2,
disabled: fanduelColorPalette.core.greyL4
}
},
secondaryDark: {
content: {
base: fanduelColorPalette.core.white,
hover: fanduelColorPalette.core.white,
active: fanduelColorPalette.core.white,
disabled: fanduelColorPalette.core.whiteTint030
},
background: {
base: fanduelColorPalette.core.whiteTint010,
hover: fanduelColorPalette.core.whiteTint020,
active: fanduelColorPalette.core.whiteTint030,
disabled: fanduelColorPalette.core.whiteTint010
}
},
transparent: {
content: {
base: fanduelColorPalette.core.white,
hover: fanduelColorPalette.core.white,
active: fanduelColorPalette.core.white,
disabled: fanduelColorPalette.core.navy
},
background: {
base: fanduelColorPalette.core.transparentWhite,
hover: fanduelColorPalette.core.whiteTint010,
active: fanduelColorPalette.core.blue,
disabled: fanduelColorPalette.core.transparentWhite
},
border: {
base: fanduelColorPalette.core.white,
hover: fanduelColorPalette.core.white,
active: fanduelColorPalette.core.transparentWhite,
disabled: fanduelColorPalette.core.navy
}
}
},
notification: {
info: {
background: fanduelColorPalette.core.blueD1,
backgroundSubtle: fanduelColorPalette.core.blueL5,
border: fanduelColorPalette.core.blueD1,
content: fanduelColorPalette.core.navyD3
},
positive: {
background: fanduelColorPalette.core.green,
backgroundSubtle: fanduelColorPalette.core.greenL5,
border: fanduelColorPalette.core.green,
content: fanduelColorPalette.core.navyD3
},
negative: {
background: fanduelColorPalette.core.red,
backgroundSubtle: fanduelColorPalette.core.redL5,
border: fanduelColorPalette.core.red,
content: fanduelColorPalette.core.navyD3
},
warning: {
background: fanduelColorPalette.core.orangeL2,
backgroundSubtle: fanduelColorPalette.core.orangeL5,
border: fanduelColorPalette.core.orangeL1,
content: fanduelColorPalette.core.navyD3
},
promo: {
background: fanduelColorPalette.core.yellowL4,
backgroundSubtle: fanduelColorPalette.core.yellowL5,
border: fanduelColorPalette.core.orangeL3,
content: fanduelColorPalette.core.navyD3
},
geocomply: {
backgroundVerification: fanduelColorPalette.core.purpleD2,
backgroundSuccess: fanduelColorPalette.core.green
}
},
betslip: {
background: fanduelColorPalette.core.navyD2,
backgroundExpanded: fanduelColorPalette.core.navyD4
},
activeGroupedFilterCell: {
content: fanduelColorPalette.core.white,
background: fanduelColorPalette.core.blueD1,
border: fanduelColorPalette.core.blueD1
},
input: {
base: fanduelColorPalette.core.greyL3,
surface: fanduelColorPalette.core.white,
hover: fanduelColorPalette.core.blueL5,
pressed: fanduelColorPalette.core.blueL4,
active: fanduelColorPalette.core.blue,
selected: fanduelColorPalette.core.blueD1,
disabled: fanduelColorPalette.core.greyL4,
border: fanduelColorPalette.core.greyL1
}
};
const background = {
base: fanduelColorPalette.core.greyL4,
surface: fanduelColorPalette.core.white,
layer: fanduelColorPalette.core.greyL5,
accent: fanduelColorPalette.core.blackTint005,
hover: fanduelColorPalette.core.blueL5,
fadeEnd: "linear-gradient(90deg, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)",
fadeBottom:
"linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)",
primary: fanduelColorPalette.brand.primary.default,
secondary: fanduelColorPalette.brand.secondary.default,
promotional: fanduelColorPalette.core.navyD3,
info: fanduelColorPalette.core.blueD1,
infoSubtle: fanduelColorPalette.core.blueL5,
positive: fanduelColorPalette.core.green,
positiveSubtle: fanduelColorPalette.core.greenL5,
negative: fanduelColorPalette.core.red,
negativeSubtle: fanduelColorPalette.core.redL5,
warning: fanduelColorPalette.core.orangeL1,
warningSubtle: fanduelColorPalette.core.orangeL5,
alert: fanduelColorPalette.core.yellowL4,
alertSubtle: fanduelColorPalette.core.yellowL5,
neutral: fanduelColorPalette.core.greyL2,
neutralSubtle: fanduelColorPalette.core.greyL5
};
const lhnHeader = {
content: {
strong: fanduelColorPalette.core.white,
default: fanduelColorPalette.core.greyL3,
subtle: fanduelColorPalette.core.greyL1,
brandSecondary: fanduelColorPalette.brand.secondary.tint,
positive: fanduelColorPalette.core.greenL2,
negative: fanduelColorPalette.core.redL1
},
border: {
default: fanduelColorPalette.core.whiteTint020,
inverse: fanduelColorPalette.core.greyL4
},
selectedcell: {
border: fanduelColorPalette.core.blue,
background: fanduelColorPalette.core.blueD2
}
};
const border = {
default: fanduelColorPalette.core.greyL3,
subtle: fanduelColorPalette.core.greyL4,
inverse: fanduelColorPalette.core.white,
brand: fanduelColorPalette.brand.primary.default,
info: fanduelColorPalette.core.blueD1,
positive: fanduelColorPalette.core.greenL1,
negative: fanduelColorPalette.core.red,
warning: fanduelColorPalette.core.orangeL1,
alert: fanduelColorPalette.core.yellowL3
};
export const fanduelColorTokens: ColorTokens = {
core,
component,
content,
background,
lhnHeader,
border,
groupedfiltercell: {
background: {
default: fanduelColorPalette.core.transparentWhite,
hover: fanduelColorPalette.core.transparentWhite,
pressed: fanduelColorPalette.core.transparentWhite,
active: fanduelColorPalette.core.blueD1
},
border: {
default: fanduelColorPalette.core.transparentWhite,
hover: fanduelColorPalette.core.greyL3,
pressed: fanduelColorPalette.core.greyL3,
active: fanduelColorPalette.core.greyL3
},
content: {
default: fanduelColorPalette.core.greyD4,
hover: fanduelColorPalette.core.greyD4,
pressed: fanduelColorPalette.core.greyD4,
active: fanduelColorPalette.core.white
}
},
notification: {
info: {
background: fanduelColorPalette.core.blueD1,
backgroundSubtle: fanduelColorPalette.core.blueL5,
border: fanduelColorPalette.core.blueD1
},
positive: {
background: fanduelColorPalette.core.green,
backgroundSubtle: fanduelColorPalette.core.greenL5,
border: fanduelColorPalette.core.green
},
negative: {
background: fanduelColorPalette.core.red,
backgroundSubtle: fanduelColorPalette.core.redL5,
border: fanduelColorPalette.core.red
},
warning: {
background: fanduelColorPalette.core.orangeL2,
backgroundSubtle: fanduelColorPalette.core.orangeL5,
border: fanduelColorPalette.core.orangeL1
}
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/mobile.ts
import {
fonts,
fontSizes,
fontWeights,
lineHeights,
lineHeightsShorter,
lineHeightsTaller,
tvgColorPalette as colors,
space,
breakpoints,
radii,
buttons,
iconButtons,
elevations,
iconSizes
} from "./common";
import { tvgColorTokens as colorTokens } from "./tokens";
import { Theme, HeadingSizes } from "../types";
const name = "Mobile/Tablet";
const headingSizes: HeadingSizes = {
h1: { fontSize: fontSizes.l, lineHeight: lineHeights.l },
h2: { fontSize: fontSizes.m, lineHeight: lineHeights.m },
h3: { fontSize: fontSizes.m, lineHeight: lineHeights.m }
};
export default {
name,
breakpoints,
colors,
colorTokens,
space,
fonts,
fontSizes,
fontWeights,
lineHeights,
lineHeightsShorter,
lineHeightsTaller,
headingSizes,
radii,
buttons,
iconButtons,
elevations,
iconSizes
} as Theme;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/components/constants.ts
import { DESKTOP_THEME, MOBILE_THEME } from "../themes";
import { DeviceTheme } from "./types";
export const DEFAULT_THEME_KEY: "mobile" = "mobile";
export const THEME_MAP: DeviceTheme = {
desktop: DESKTOP_THEME,
mobile: MOBILE_THEME,
tablet: MOBILE_THEME
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/themes/desktop.ts
import {
fonts,
fontSizes,
fontWeights,
lineHeights,
lineHeightsShorter,
lineHeightsTaller,
tvgColorPalette as colors,
space,
breakpoints,
radii,
buttons,
iconButtons,
elevations,
iconSizes
} from "./common";
import { tvgColorTokens as colorTokens } from "./tokens";
import { Theme, HeadingSizes } from "../types";
const name = "Desktop";
const headingSizes: HeadingSizes = {
h1: { fontSize: fontSizes["3xl"], lineHeight: lineHeights["3xl"] },
h2: { fontSize: fontSizes.l, lineHeight: lineHeights.l },
h3: { fontSize: fontSizes.m, lineHeight: lineHeights.m }
};
export default {
name,
breakpoints,
colors,
colorTokens,
space,
fonts,
fontSizes,
lineHeights,
lineHeightsShorter,
lineHeightsTaller,
fontWeights,
headingSizes,
radii,
buttons,
iconButtons,
elevations,
iconSizes
} as Theme;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/components/themeProvider.tsx
import React, { useContext } from "react";
import { ThemeProvider } from "styled-components/native";
import { TvgConfContext } from "../../utils/tvgConfProvider";
import { Theme } from "../types";
import { DEFAULT_THEME_KEY, THEME_MAP } from "./constants";
import { TVGThemeProviderProps } from "./types";
export const TVGThemeProvider: React.FC<TVGThemeProviderProps> = ({
children,
device
}) => {
const { device: deviceInContext } = useContext(TvgConfContext);
const theme =
(device && THEME_MAP[device]) ||
(deviceInContext && THEME_MAP[deviceInContext]) ||
THEME_MAP[DEFAULT_THEME_KEY];
return <ThemeProvider theme={theme as Theme}>{children}</ThemeProvider>;
};
export default TVGThemeProvider;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/hooks/useTheme.ts
import { useContext } from "react";
import { ThemeContext } from "styled-components/native";
import { Theme } from "../types";
const useTheme = (): Theme => useContext(ThemeContext);
export default useTheme;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/hooks/useColor.ts
import useTheme from "./useTheme";
import { Colors } from "../types";
/**
* Get hexadecimal color from theme based on the token
* @param token - e.g., "green.500"
* @returns hexadecimal color - e.g., "#38AB4F"
*/
export const useColor = (token: string): string => {
const { colors } = useTheme();
const [color, variation] = token.split(".");
const [, codeColor] = Object.entries(colors[color as keyof Colors]).filter(
(val) => val[0] === variation
)[0];
return codeColor;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/theming/hooks/useColorTokens.ts
import { useContext } from "react";
import { get } from "lodash";
import { ThemeContext } from "styled-components/native";
export const useColorTokens = (value?: string) => {
const useTheme = () => useContext(ThemeContext);
const { colorTokens } = useTheme();
if (value) {
const tokenValue = get(colorTokens, value);
if (!tokenValue && process.env.NODE_ENV !== "production") {
throw new Error(`Invalid color token: ${value}`);
}
return tokenValue;
}
return colorTokens;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/hooks/useDebounce.ts
import { MutableRefObject, useCallback, useEffect, useRef } from "react";
const useDebounce = () => {
const timeoutRef: MutableRefObject<number> = useRef(0);
const debounce = useCallback(
(fn: () => void, delay: number = 100) =>
() => {
clearTimeout(timeoutRef.current);
// @ts-ignore
timeoutRef.current = setTimeout(() => {
fn();
}, delay);
},
[]
);
useEffect(
() => () => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
},
[]
);
return debounce;
};
export default useDebounce;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/hooks/useIconSize.ts
import { iconSizes } from "../theming/themes/common/iconSizes";
import { IconSizeVariants, IconSizeProps } from "../theming/types";
const useIconSize = (size: IconSizeVariants): IconSizeProps =>
iconSizes[size as IconSizeVariants];
export default useIconSize;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/AccountHistory.tsx
import React, { FC } from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const AccountHistory: FC<IconPathWithBackgroundProps> = ({
backgroundColor,
lineColor,
strokeWidth
}) => (
<>
<path
d="M14.4589 2.625H3.36956C2.1274 2.625 1.12042 3.63236 1.12042
4.875V11.25V19.125C1.12042 20.3676 2.1274 21.375 3.36956
21.375H8.8718L8.67757 21.375H16.8588C13.8867 21.375 10.8809 18.9785
10.8809 15.3721C10.8809 12.1055 13.541 9.36914 16.8588
9.36914V4.875C16.8588 3.63236 15.7011 2.625 14.4589 2.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M5.36488 21.375H8.67757H9.62781M16.8588 6.43361V4.875C16.8588 3.63236
15.7011 2.625 14.4589 2.625H3.36956C2.1274 2.625 1.12042 3.63236 1.12042
4.875V11.25V19.125C1.12042 20.3676 2.1274 21.375 3.36956 21.375H8.8718"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
<path
d="M4.49277 13.121L7.49277 13.121"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
<path
d="M4.49277 8.62573L10.4905 8.62573"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
<circle
cx="16.8588"
cy="15.375"
r="6"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
<path
d="M16.6661 13.5043V16.2445L18.9205 17.2551"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
strokeLinecap="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Add.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const Add = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M12 4.5V19.5M4.5 12H19.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Alert.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Alert = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M15 15.75H9.00004H4.43728L5.26194 13.7711C5.74689 12.6074 5.92322
11.3428 6.01799 10.0856C6.21719 7.44307 7.25731 3 12 3C16.8143 3 17.8134
7.57825 17.9905 10.2041C18.0701 11.3854 18.2201 12.5741 18.6438
13.6797L19.4373 15.75H15Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M15 15.75H19.4373L18.6438 13.6797C18.2201 12.5741 18.0701 11.3854
17.9905 10.2041C17.8134 7.57825 16.8143 3 12 3C7.25731 3 6.21719 7.44307
6.01799 10.0856C5.92322 11.3428 5.74689 12.6074 5.26194 13.7711L4.43728
15.75H9.00004M15 15.75V16.5C15 18.1569 13.6569 19.5 12 19.5C10.3432 19.5
9.00004 18.1569 9.00004 16.5V15.75M15 15.75H9.00004"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/AlertOff.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const AlertOff = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M4.56276 15.75H19.5628L18.7381 13.7711C18.2532 12.6074 18.0768 11.3428
17.9821 10.0856C17.7829 7.44307 16.7427 3 12 3C7.18575 3 6.18667 7.57825
6.00957 10.2041C5.9299 11.3854 5.77999 12.5741 5.35625 13.6797L4.56276
15.75Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M1.5 1.5L22.5 22.5M18.7186 13.875L18.6438 13.6797C18.2201 12.5741
18.0702 11.3854 17.9905 10.2041C17.8134 7.57826 16.8143 3 12 3C10.7662 3
9.78302 3.30068 9 3.79213M6.72136 6.75C6.27862 7.89743 6.09156 9.11181
6.01817 10.0833C5.9232 11.3404 5.74689 12.6074 5.26195 13.7711L4.43729
15.75H9M9 15.75V16.5C9 18.1569 10.3431 19.5 12 19.5C13.6569 19.5 15
18.1569 15 16.5L15 15.75H9Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Announcements.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Announcements = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M2.625 10.8194V13.1806C2.625 14.2984 3.44554 15.2467 4.55169
15.4073L5.625 15.5631L13.875 16.761L21.375 17.85V6.15001L4.55169
8.59275C3.44554 8.75337 2.625 9.70165 2.625 10.8194Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M21.375 6.15001V17.85M21.375 6.15001V3M21.375 6.15001L4.55169
8.59275C3.44554 8.75337 2.625 9.70165 2.625 10.8194V13.1806C2.625
14.2984 3.44554 15.2467 4.55169 15.4073M21.375 17.85V21M21.375
17.85L13.875 16.761M21.375 17.85L4.55169 15.4073M5.625
15.5631V19.875H13.875V16.761M5.625 15.5631L4.55169 15.4073M5.625
15.5631L13.875 16.761"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ArrowBottom.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ArrowBottom = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M12 2.25V20.1797M4.5 12.75L12 20.25L19.5 12.75"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ArrowCollapseLeft.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ArrowCollapseLeft = ({
lineColor,
strokeWidth
}: IconPathProps) => (
<path
d="M2.625 1.5L2.63081 11.9976L2.625 22.5M13.8903 4.5L6.39034 12L13.8903
19.5M6.46651 12H24"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ArrowCollapseRight.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ArrowCollapseRight = ({
lineColor,
strokeWidth
}: IconPathProps) => (
<path
d="M21.375 22.5L21.3692 12.0024L21.375 1.5M10.1097 19.5L17.6097 12L10.1097
4.5M17.5335 12L9.17939e-07 12"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ArrowLeft.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ArrowLeft = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M12 4.5L4.5 12L12 19.5M21.75 12H4.57617"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ArrowRight.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ArrowRight = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M2.25 12H20.9177M13.5 4.5L21 12L13.5 19.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ArrowUp.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ArrowUp = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M12 21.75V3.82723M4.5 11.25L12 3.75L19.5 11.25"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Badge.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const Badge = ({ lineColor }: IconPathProps) => (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M4.92624 1.66197C4.78969 1.42195 4.48443 1.33806 4.2444 1.47461L3.15791
2.0927C2.91789 2.22924 2.834 2.53451 2.97055 2.77453L6.7395 9.3997C7.31637
8.9217 7.95938 8.52073 8.65277 8.21257L4.92624 1.66197ZM13.906
7.72655C13.2941 7.58186 12.656 7.50529 12 7.50529C11.8092 7.50529 11.6199
7.51177 11.4323 7.52451L14.7674 1.66197C14.9039 1.42195 15.2092 1.33806
15.4492 1.47461L16.5357 2.0927C16.7757 2.22924 16.8596 2.53451 16.7231
2.77453L13.906 7.72655ZM17.2576 9.39732C16.6805 8.91959 16.0374 8.51892
15.3438 8.21107L19.0695 1.66197C19.2061 1.42195 19.5113 1.33806 19.7513
1.47461L20.8378 2.0927C21.0779 2.22924 21.1617 2.53451 21.0252
2.77453L17.2576 9.39732ZM5.24999 15.7553C5.24999 19.4832 8.27206 22.5053 12
22.5053C12.233 22.5053 12.4632 22.4935 12.6901 22.4704C16.0939 22.1248 18.75
19.2502 18.75 15.7553C18.75 12.0274 15.7279 9.00529 12 9.00529C8.27206
9.00529 5.24999 12.0274 5.24999 15.7553ZM16.5 15.7553C16.5 18.2406 14.4853
20.2553 12 20.2553C9.5147 20.2553 7.49999 18.2406 7.49999 15.7553C7.49999
13.27 9.5147 11.2553 12 11.2553C14.4853 11.2553 16.5 13.27 16.5
15.7553ZM10.875 13.2553C10.875 12.9791 11.0988 12.7553 11.375
12.7553H12.625C12.9011 12.7553 13.125 12.9791 13.125 13.2553V18.2553C13.125
18.5314 12.9011 18.7553 12.625 18.7553H11.375C11.0988 18.7553 10.875 18.5314
10.875 18.2553V13.2553ZM9.24076 1.67456C9.1047 1.43352 8.7987 1.34889
8.55812 1.48576L7.47458 2.10216C7.23397 2.23904 7.15037 2.54538 7.28809
2.78551L9.85452 7.26043L11.1476 5.0523L9.24076 1.67456Z"
fill={lineColor}
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Bank.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Bank = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M2.625 21.375H21.375"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="round"
/>
<path
d="M6 12.3939V21.3676"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="round"
/>
<path
d="M11.9972 12.4056V21.3793"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="round"
/>
<path
d="M18 12.3939V21.3676"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="round"
/>
<path
d="M2.62768 8.62402L2.625 7.41016L11.998 2.625L21.375 7.41016L21.3711 8.625L2.62768 8.62402Z"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/BetaProgram.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const BetaProgram = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M7.02039 21L20.37 21C20.9223 21 21.37 20.5523 21.37 20L21.37
9.55244C21.37 8.7189 20.4102 8.25122 19.7537 8.76494L6.40408
19.2125C5.65545 19.7984 6.06975 21 7.02039 21Z"
fill={backgroundColor}
stroke={lineColor}
strokeWidth={strokeWidth}
/>
<path
d="M16.9796 3H3.62998C3.0777 3 2.62998 3.44772 2.62998 4V14.4476C2.62998
15.2811 3.58988 15.7488 4.24629 15.2351L17.5959 4.78751C18.3446 4.20161
17.9303 3 16.9796 3Z"
fill={backgroundColor}
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Bets.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Bets = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M18.375 2.625H5.625C4.79657 2.625 4.125 3.29657 4.125 4.125V21.75L7.5
20.25L9.75 21.75L12 20.25L14.25 21.75L16.5 20.25L19.875 21.75V4.125C19.875
3.29657 19.2034 2.625 18.375 2.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M7.5 8.625H12M7.5 13.125H16.5M5.625 2.625H18.375C19.2034 2.625 19.875
3.29657 19.875 4.125V21.75L16.5 20.25L14.25 21.75L12 20.25L9.75 21.75L7.5
20.25L4.125 21.75V4.125C4.125 3.29657 4.79657 2.625 5.625 2.625Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/BetsCancel.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const BetsCancel = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M18.375 2.625H5.625C4.79657 2.625 4.125 3.29657 4.125 4.125V21.75L7.5
20.25L9.75 21.75L12 20.25L14.25 21.75L16.5 20.25L19.875 21.75V4.125C19.875
3.29657 19.2034 2.625 18.375 2.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12 20.25L9.75 21.75L7.5 20.25L4.125 21.75V4.125C4.125 3.29657 4.79657
2.625 5.625 2.625H18.375C19.2034 2.625 19.875 3.29657 19.875 4.125V12M7.5
8.625H12M7.5 13.125H13.5M15.75 14.25L19.5 18M19.5 18L23.25 21.75M19.5
18L15.75 21.75M19.5 18L23.25 14.25"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/BetsRefund.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const BetsRefund = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M18.375 2.625H5.625C4.79657 2.625 4.125 3.29657 4.125 4.125V21.75L7.5
20.25L9.75 21.75L12 20.25L14.25 21.75L16.5 20.25L19.875 21.75V4.125C19.875
3.29657 19.2034 2.625 18.375 2.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12 20.25L9.75 21.75L7.5 20.25L4.125 21.75V4.125C4.125 3.29657 4.79657
2.625 5.625 2.625H18.375C19.2034 2.625 19.875 3.29657 19.875
4.125V11.9585M7.5 8.625H12M7.5 13.125H13.5M18.375 14.25L14.625 18L18.375
21.75M22.875 18H14.6953"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/BetsSuccess.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const BetsSuccess = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M18.375 2.625H5.625C4.79657 2.625 4.125 3.29657 4.125 4.125V21.75L7.5
20.25L9.75 21.75L12 20.25L14.25 21.75L16.5 20.25L19.875 21.75V4.125C19.875
3.29657 19.2034 2.625 18.375 2.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12 20.25L9.75 21.75L7.5 20.25L4.125 21.75V4.125C4.125 3.29657 4.79657
2.625 5.625 2.625H18.375C19.2034 2.625 19.875 3.29657 19.875 4.125V12M7.5
8.625H12M7.5 13.125H13.5M14.25 18L17.25 21L23.25 15"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Calendar.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Calendar = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M2.625 4.875V8.625H21.375V4.875C21.375 3.63236 20.3676 2.625 19.125
2.625H15.375H8.625H4.875C3.63236 2.625 2.625 3.63236 2.625 4.875Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M6 13.125H9M10.5 13.125H13.5M15 13.125H18M6 16.875H9M10.5
16.875H13.5M8.625 0V2.625M8.625 6L8.625 2.625M15.375
3.57628e-07V2.625M15.375 6V2.625M2.625 8.625V19.875C2.625 20.7034 3.29657
21.375 4.125 21.375H19.875C20.7034 21.375 21.375 20.7034 21.375
19.875V8.625M2.625 8.625V4.875C2.625 3.63236 3.63236 2.625 4.875
2.625H8.625M2.625 8.625H21.375M21.375 8.625V4.875C21.375 3.63236 20.3676
2.625 19.125 2.625H15.375M8.625 2.625H15.375"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Card.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Card = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M22.875 5.625H1.125V10.1693L22.875 10.1693V5.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M4.15997 14.2534H13.5867M1.125 10.1693L22.875 10.1693M1.125
5.625H22.875V18.375H1.125V5.625Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/CardPlus.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const CardPlus = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M11.625 5.625H1.125V10.1693L11.625 10.1693V5.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M1.125 10.1708V18.3765H22.875V12.0015M1.125
10.1708V5.62647H11.625M1.125 10.1708H11.625M4.15997 14.2549H11.625M18
4.5V9M18 9V13.5M18 9H22.5M18 9H13.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Changes.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Changes = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M10.9393 1.81583C11.5251 1.23004 12.4749 1.23005 13.0607
1.81583L22.1842 10.9393C22.77 11.5251 22.77 12.4749 22.1842
13.0607L13.0607 22.1842C12.4749 22.77 11.5251 22.77 10.9393
22.1842L1.81583 13.0607C1.23004 12.4749 1.23004 11.5251 1.81583
10.9393L10.9393 1.81583Z"
fill={backgroundColor}
/>
<path
d="M12 13.5L12 6.75M12 17.25L12 15M1.81583 13.0607L10.9393
22.1842C11.5251 22.77 12.4749 22.77 13.0607 22.1842L22.1842 13.0607C22.77
12.4749 22.77 11.5251 22.1842 10.9393L13.0607 1.81583C12.4749 1.23005
11.5251 1.23004 10.9393 1.81583L1.81583 10.9393C1.23004 11.5251 1.23004
12.4749 1.81583 13.0607Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ChevronDown.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ChevronDown = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M19.5 9L12 16.5L4.5 9"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ChevronLeft.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ChevronLeft = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M15 4.5L7.5 12L15 19.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ChevronRight.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ChevronRight = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M7.5 4.5L15 12L7.5 19.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ChevronUp.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const ChevronUp = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M4.5 15L12 7.5L19.5 15"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Close.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const Close = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M5.25 5.25L18.75 18.75M18.75 5.25L5.25 18.75"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Cup.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Cup = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M6.37499 2.625H17.625L17.625 5.25C17.625 5.25 17.625 5.38466 17.618
5.625C17.5889 6.62136 17.4393 9.43394 16.6695 11.9974C15.8997 14.5608
14.5097 16.875 12 16.875C9.49024 16.875 8.10028 14.5608 7.33048
11.9974C6.56066 9.43394 6.41105 6.62136 6.38197 5.625C6.37495 5.38466
6.37495 5.25 6.37495 5.25L6.37499 2.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12 16.875L12 21.375M12 16.875C9.49024 16.875 8.10028 14.5608 7.33048
11.9974M12 16.875C14.5097 16.875 15.8997 14.5608 16.6695 11.9974M6.37495
5.25L6.37499 2.625H17.625L17.625 5.25C17.625 5.25 17.625 5.38466 17.618
5.625M6.37495 5.25C6.37495 5.25 6.37497 8.8156 7.33048 11.9974M6.37495
5.25C6.37495 5.25 6.37495 5.38466 6.38197 5.625M12 21.375H7.49995M12
21.375H16.5M6.38197 5.625H2.62495C2.62495 5.625 2.62495 11.8514 7.33048
11.9974M6.38197 5.625C6.41105 6.62136 6.56066 9.43394 7.33048
11.9974M16.6695 11.9974C21.375 11.8513 21.375 5.625 21.375
5.625H17.618M16.6695 11.9974C17.4393 9.43394 17.5889 6.62136 17.618 5.625"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/CustomerSupport.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const CustomerSupport = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M3 11.3269L3.75 18L8.25 17.25V12L3 11.3269Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M20.254 17.9646L20.9966 11.3571L15.75 12V17.25L20.254 17.9646Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M3 11.3269C3 6.52099 7.02944 2.625 12 2.625C16.9706 2.625 21 6.52099
21 11.3269L20.25 18L18.75 21L11.625 21.375M3 11.3269L3.75 18L8.25
17.25V12L3 11.3269ZM15.75 17.25V12L20.9966 11.3571L20.254 17.9646L15.75
17.25Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Cvv.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Cvv = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M21.375 5.625H1.125V10.8806H10.7656C10.7656 10.8806 12.5078 8.25
16.1914 8.25C19.875 8.25 21.375 10.7674 21.375 10.7674V10.7617V5.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M13.4351 16.9782H12.5152V14.0534L11.6117 14.3171V13.6212L13.3507
13.0205H13.4351V16.9782Z"
fill={lineColor}
/>
<path
d="M17.3947 16.9782H14.6298V16.3802L15.9034 15.0428C16.2173 14.6859
16.3742 14.4022 16.3742 14.192C16.3742 14.0217 16.337 13.8921 16.2626
13.8033C16.1882 13.7145 16.0803 13.6701 15.9388 13.6701C15.7991 13.6701
15.6857 13.7299 15.5986 13.8495C15.5115 13.9673 15.468 14.115 15.468
14.2926H14.5481C14.5481 14.0498 14.6089 13.826 14.7305 13.6212C14.852
13.4146 15.0208 13.2534 15.2367 13.1374C15.4526 13.0214 15.6939 12.9634
15.9606 12.9634C16.3887 12.9634 16.718 13.0622 16.9484 13.2597C17.1807
13.4572 17.2968 13.7408 17.2968 14.1105C17.2968 14.2663 17.2677 14.4186
17.2097 14.5672C17.1516 14.7139 17.0609 14.8689 16.9375 15.032C16.816
15.1932 16.6191 15.4098 16.347 15.6816L15.8354 16.2715H17.3947V16.9782Z"
fill={lineColor}
/>
<path
d="M18.6956 14.6161H19.1283C19.4712 14.6161 19.6426 14.4485 19.6426
14.1132C19.6426 13.9827 19.6018 13.8767 19.5202 13.7952C19.4385 13.7118
19.3233 13.6701 19.1745 13.6701C19.053 13.6701 18.9469 13.7055 18.8561
13.7762C18.7672 13.8468 18.7228 13.9347 18.7228 14.0398H17.8057C17.8057
13.8314 17.8637 13.6457 17.9798 13.4826C18.096 13.3195 18.2565 13.1926
18.4615 13.102C18.6684 13.0096 18.8952 12.9634 19.1419 12.9634C19.5828
12.9634 19.9293 13.064 20.1815 13.2651C20.4337 13.4663 20.5598 13.7426
20.5598 14.0942C20.5598 14.2645 20.5071 14.4258 20.4019 14.578C20.2985
14.7284 20.147 14.8508 19.9474 14.945C20.1579 15.0211 20.323 15.1371
20.4427 15.2929C20.5625 15.4469 20.6223 15.6381 20.6223 15.8665C20.6223
16.2198 20.4863 16.5025 20.2141 16.7145C19.942 16.9266 19.5846 17.0326
19.1419 17.0326C18.8825 17.0326 18.6412 16.9836 18.418 16.8858C18.1967
16.7861 18.0288 16.6493 17.9145 16.4753C17.8002 16.2996 17.7431 16.1002
17.7431 15.8773H18.6656C18.6656 15.9987 18.7146 16.1039 18.8126
16.1926C18.9106 16.2814 19.0312 16.3258 19.1745 16.3258C19.336 16.3258
19.4648 16.2814 19.561 16.1926C19.6571 16.102 19.7052 15.987 19.7052
15.8474C19.7052 15.6481 19.6553 15.5068 19.5555 15.4234C19.4558 15.34
19.3179 15.2984 19.1419 15.2984H18.6956V14.6161Z"
fill={lineColor}
/>
<circle
cx="16.125"
cy="14.9999"
r="6.75"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
<path
d="M10.244 18.3739H1.125V5.62392H21.375V10.7078"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M1.13259 10.8836L10.7547 10.8836"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M4.88782 14.6246L9.37891 14.6246"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Deposit.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const Deposit = ({ lineColor, strokeWidth }: IconPathProps) => (
<>
<path
d="M18 7.5V12M18 12V16.5M18 12H22.5M18 12H13.5"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
<path
d="M12 8.40001C12 8.40001 12 4.80002 7.5 4.80002M7.5 4.80002C3 4.80002 3
8.40001 3 8.40001C3 9.60001 3 10.8 7.5 12C12 13.2 12 14.4 12 15.6C12 15.6
12 19.2 7.5 19.2M7.5 4.80002V1.5M7.5 19.2C3 19.2 3 15.6 3 15.6M7.5
19.2V22.5M18 7.5V12M18 12V16.5M18 12H22.5M18 12H13.5"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/DoubleChevronDown.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const DoubleChevronDown = ({
lineColor,
strokeWidth
}: IconPathProps) => (
<path
d="M19.5 12L12 19.5L4.5 12M19.5 4.5L12 12L4.5 4.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/DoubleChevronLeft.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const DoubleChevronLeft = ({
lineColor,
strokeWidth
}: IconPathProps) => (
<path
d="M12 4.5L4.5 12L12 19.5M19.5 4.5L12 12L19.5 19.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/DoubleChevronRight.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const DoubleChevronRight = ({
lineColor,
strokeWidth
}: IconPathProps) => (
<path
d="M12 4.5L19.5 12L12 19.5M4.5 4.5L12 12L4.5 19.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/DoubleChevronUp.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const DoubleChevronUp = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M4.5 12L12 4.5L19.5 12M4.5 19.5L12 12L19.5 19.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ECheck.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const ECheck = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M1.125 4.125H22.875V19.875H1.125V4.125Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M5.2826 14.2631H12.4064M5.2826 9.72643L15.3517 9.72643M1.125
4.125H22.875V19.875H1.125V4.125Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="square"
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Edit.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Edit = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M2.625 16.875V21.375H7.125L19.125 9.375L14.625 4.875L2.625 16.875Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M14.625 4.875L2.625 16.875V21.375H7.125L19.125 9.375M14.625
4.875L19.125 9.375M14.625 4.875L16.409 3.09099C17.2877 2.21231 18.7123
2.21231 19.591 3.09099L20.909 4.40901C21.7877 5.28769 21.7877 6.71231
20.909 7.59099L19.125 9.375"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Email.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Email = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M21.375 5.625H2.625V18.375H21.375V5.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M2.69998 5.69998L12 13.5L21.3 5.69998M2.625
5.625H21.375V18.375H2.625V5.625Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Error.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Error = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M22.8755 12.0042C22.8755 18.0105 18.0063 22.8797 12 22.8797C5.99362
22.8797 1.1245 18.0105 1.1245 12.0042C1.1245 5.99782 5.99362 1.12871 12
1.12871C18.0063 1.12871 22.8755 5.99782 22.8755 12.0042Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M7.50005 7.5L12.0001 12M12.0001 12L16.5001 16.5M12.0001 12L7.50005
16.5M12.0001 12L16.5001 7.5M22.8755 12.0042C22.8755 18.0105 18.0063
22.8797 12 22.8797C5.99362 22.8797 1.1245 18.0105 1.1245 12.0042C1.1245
5.99782 5.99362 1.12871 12 1.12871C18.0063 1.12871 22.8755 5.99782
22.8755 12.0042Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Exclamation.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Exclamation = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M22.8755 12.0042C22.8755 18.0105 18.0064 22.8797 12 22.8797C5.99363
22.8797 1.12451 18.0105 1.12451 12.0042C1.12451 5.99782 5.99363 1.12871
12 1.12871C18.0064 1.12871 22.8755 5.99782 22.8755 12.0042Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12 13.5V6M12 18V15.75M22.8755 12.0042C22.8755 18.0105 18.0064 22.8797
12 22.8797C5.99363 22.8797 1.12451 18.0105 1.12451 12.0042C1.12451 5.99782
5.99363 1.12871 12 1.12871C18.0064 1.12871 22.8755 5.99782 22.8755
12.0042Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/EyeHide.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const EyeHide = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M12 4.125C5 4.125 1.5 12 1.5 12C1.5 12 5 19.875 12 19.875C19 19.875
22.5 12 22.5 12C22.5 12 19 4.125 12 4.125ZM12 15.3807C13.8671 15.3807
15.3806 13.8671 15.3806 12C15.3806 10.1329 13.8671 8.61937 12
8.61937C10.1329 8.61937 8.61932 10.1329 8.61932 12C8.61932 13.8671
10.1329 15.3807 12 15.3807Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M3.86012 15.6319C2.28671 13.7701 1.125 12 1.125 12C1.125 12 4.99997
4.125 12 4.125C13.0424 4.125 14.0072 4.29964 14.8944 4.5969M6.16037
17.8286C7.71696 18.9976 9.66349 19.875 12 19.875C19 19.875 22.875 12
22.875 12C22.875 12 20.9409 8.49212 17.8228 6.1588M22.5 1.5L14.3905
9.60954M1.5 22.5L14.3905 9.60954M8.61932 12C8.61932 10.1329 10.1329
8.61937 12 8.61937M9.60744 14.3884C10.2194 15.0014 11.0654 15.3807 12
15.3807C13.867 15.3807 15.3806 13.8671 15.3806 12C15.3806 11.0665 15.0022
10.2213 14.3905 9.60954"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/EyeShow.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const EyeShow = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M12 4.125C5 4.125 1.125 12 1.125 12C1.125 12 5 19.875 12 19.875C19
19.875 22.875 12 22.875 12C22.875 12 19 4.125 12 4.125ZM12 15.3807C13.8671
15.3807 15.3806 13.8671 15.3806 12C15.3806 10.1329 13.8671 8.61937 12
8.61937C10.1329 8.61937 8.61932 10.1329 8.61932 12C8.61932 13.8671 10.1329
15.3807 12 15.3807Z"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Featured.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const Featured = ({ lineColor, strokeWidth }: IconPathProps) => (
<>
<path
d="M18.1216 2.62585H5.87842C5.74035 2.62585 5.62842 2.73778 5.62842
2.87585V20.9922C5.62842 21.1729 5.81412 21.2939 5.97937 21.2209L11.899
18.6079C11.9634 18.5795 12.0366 18.5795 12.101 18.6079L18.0206
21.2209C18.1859 21.2939 18.3716 21.1729 18.3716 20.9922V2.87585C18.3716
2.73778 18.2596 2.62585 18.1216 2.62585Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="round"
/>
<path
d="M11.7622 8.23173C11.8371 8.0014 12.1629 8.0014 12.2378 8.23173L12.9542
10.4366C12.9877 10.5397 13.0836 10.6094 13.1919 10.6094H15.5103C15.7525
10.6094 15.8532 10.9193 15.6573 11.0616L13.7817 12.4244C13.694 12.488
13.6574 12.6009 13.6908 12.7039L14.4073 14.9088C14.4821 15.1391 14.2185
15.3306 14.0226 15.1883L12.1469 13.8256C12.0593 13.7619 11.9407 13.7619
11.8531 13.8256L9.97744 15.1883C9.78151 15.3306 9.51789 15.1391 9.59273
14.9088L10.3092 12.7039C10.3426 12.6009 10.306 12.488 10.2183
12.4244L8.34272 11.0616C8.14679 10.9193 8.24749 10.6094 8.48967
10.6094H10.8081C10.9164 10.6094 11.0123 10.5397 11.0458 10.4366L11.7622
8.23173Z"
fill={lineColor}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Feedback.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Feedback = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M6 7.875H3.625C3.07272 7.875 2.625 8.32272 2.625 8.875L2.625
16.4118C2.625 16.96 3.06942 17.4044 3.61765 17.4044V17.4044C4.16587
17.4044 4.61029 17.8488 4.61029 18.3971V21.375L8.28799 17.6973C8.47553
17.5098 8.72988 17.4044 8.9951 17.4044H15.125C15.6773 17.4044 16.125
16.9567 16.125 16.4044V14.775"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
<path
d="M6.375 3.625C6.375 3.07272 6.82272 2.625 7.375 2.625L20.375
2.625C20.9273 2.625 21.375 3.07272 21.375 3.625V12.2132C21.375 12.7655
20.9273 13.2132 20.375 13.2132H20.1691C19.6168 13.2132 19.1691 13.661
19.1691 14.2132V17.625L15.0502 13.5061C14.8627 13.3186 14.6084 13.2132
14.3431 13.2132L7.375 13.2132C6.82272 13.2132 6.375 12.7655 6.375
12.2132L6.375 3.625Z"
fill={backgroundColor}
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
<path
d="M9.85217 6.93798C9.90606 6.77214 10.1407 6.77214 10.1946
6.93798L10.3371 7.37654C10.3612 7.45071 10.4303 7.50092 10.5082
7.50092H10.9694C11.1438 7.50092 11.2163 7.72405 11.0752 7.82654L10.7021
8.09759C10.639 8.14343 10.6126 8.22467 10.6367 8.29884L10.7792
8.73741C10.8331 8.90324 10.6433 9.04114 10.5022 8.93865L10.1292
8.6676C10.0661 8.62177 9.98065 8.62177 9.91756 8.6676L9.5445
8.93865C9.40343 9.04114 9.21362 8.90324 9.2675 8.73741L9.41 8.29884C9.4341
8.22467 9.4077 8.14343 9.34461 8.09759L8.97155 7.82654C8.83048 7.72405
8.90298 7.50092 9.07735 7.50092H9.53849C9.61647 7.50092 9.68558 7.45071
9.70968 7.37654L9.85217 6.93798Z"
fill="#5390ED"
/>
<path
d="M13.7031 6.93798C13.7569 6.77214 13.9916 6.77214 14.0454
6.93798L14.1879 7.37654C14.212 7.45071 14.2812 7.50092 14.3591
7.50092H14.8203C14.9946 7.50092 15.0671 7.72405 14.9261 7.82654L14.553
8.09759C14.4899 8.14343 14.4635 8.22467 14.4876 8.29884L14.6301
8.73741C14.684 8.90324 14.4942 9.04114 14.3531 8.93865L13.9801
8.6676C13.917 8.62177 13.8315 8.62177 13.7685 8.6676L13.3954
8.93865C13.2543 9.04114 13.0645 8.90324 13.1184 8.73741L13.2609
8.29884C13.285 8.22467 13.2586 8.14343 13.1955 8.09759L12.8224
7.82654C12.6814 7.72405 12.7539 7.50092 12.9282 7.50092H13.3894C13.4674
7.50092 13.5365 7.45071 13.5606 7.37654L13.7031 6.93798Z"
fill="#5390ED"
/>
<path
d="M17.5539 6.93798C17.6078 6.77214 17.8424 6.77214 17.8963
6.93798L18.0388 7.37654C18.0629 7.45071 18.132 7.50092 18.21
7.50092H18.6711C18.8455 7.50092 18.918 7.72405 18.7769 7.82654L18.4039
8.09759C18.3408 8.14343 18.3144 8.22467 18.3385 8.29884L18.481
8.73741C18.5348 8.90324 18.345 9.04114 18.204 8.93865L17.8309
8.6676C17.7678 8.62177 17.6824 8.62177 17.6193 8.6676L17.2462
8.93865C17.1052 9.04114 16.9154 8.90324 16.9692 8.73741L17.1117
8.29884C17.1358 8.22467 17.1094 8.14343 17.0464 8.09759L16.6733
7.82654C16.5322 7.72405 16.6047 7.50092 16.7791 7.50092H17.2402C17.3182
7.50092 17.3873 7.45071 17.4114 7.37654L17.5539 6.93798Z"
fill="#5390ED"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/File.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const File = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M4.125 4.125V19.875C4.125 20.7034 4.79657 21.375 5.625
21.375H18.375C19.2034 21.375 19.875 20.7034 19.875
19.875V7.875H14.625V2.625H5.625C4.79657 2.625 4.125 3.29657 4.125 4.125Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M14.625 2.70509V7.875H19.7969M14.625 2.625H5.625C4.79657 2.625 4.125
3.29657 4.125 4.125L4.125 19.875C4.125 20.7034 4.79657 21.375 5.625
21.375H18.375C19.2034 21.375 19.875 20.7034 19.875 19.875V7.875L14.625
2.625Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/FileDownload.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const FileDownload = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M4.125 4.125V19.875C4.125 20.7034 4.79657 21.375 5.625
21.375H18.375C19.2034 21.375 19.875 20.7034 19.875
19.875V7.875H14.625V2.625H5.625C4.79657 2.625 4.125 3.29657 4.125 4.125Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M19.5 14.25V22.0538M23.2031 18.4219L19.5 22.125L15.7969 18.4219M19.875
12V7.875L14.625 2.625H5.625C4.79657 2.625 4.125 3.29657 4.125
4.125V19.875C4.125 20.7034 4.79657 21.375 5.625 21.375H12M14.625
2.70509V7.875H19.8018"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Filters.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Filters = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M7.875 19.875C9.53185 19.875 10.875 18.5319 10.875 16.875C10.875
15.2181 9.53185 13.875 7.875 13.875C6.21815 13.875 4.87613 15.2181
4.87613 16.875C4.87613 18.5319 6.21815 19.875 7.875 19.875Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M14.625 10.125C16.2819 10.125 17.625 8.78185 17.625 7.125C17.625
5.46815 16.2819 4.125 14.625 4.125C12.9681 4.125 11.625 5.46815 11.625
7.125C11.625 8.78185 12.9681 10.125 14.625 10.125Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M4.87613 16.875H1.5M4.87613 16.875C4.87613 18.5319 6.21815 19.875 7.875
19.875C9.53185 19.875 10.875 18.5319 10.875 16.875M4.87613 16.875C4.87613
15.2181 6.21815 13.875 7.875 13.875C9.53185 13.875 10.875 15.2181 10.875
16.875M10.875 16.875H22.5M11.625 7.125H1.5M11.625 7.125C11.625 8.78185
12.9681 10.125 14.625 10.125C16.2819 10.125 17.625 8.78185 17.625
7.125M11.625 7.125C11.625 5.46815 12.9681 4.125 14.625 4.125C16.2819
4.125 17.625 5.46815 17.625 7.125M17.625 7.125H22.5"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Greyhounds.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Greyhounds = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<path
d="M8.875 9.22224C6.09722 10.6111 2.625 14.0833 2.625 14.0833L8.18056
18.25L11.6528 14.0833C11.6528 14.0833 15.8757 14.4587 17.9028
15.4722C19.0139 14.9167 21.375 15.4722 21.375 13.3889C17.2083 12
15.9321 8.52779 13.7361 8.52779C12.3472 8.52779 10.9583 5.75002 9.56944
5.75002L6.79167 9.22224H8.875Z"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Hamburger.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const Hamburger = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M1.5 12H22.5M22.5 4.875H1.5M22.5 19.125H1.5"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Home.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Home = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M21.375 9L12 3L2.625 9V21.375H9.375V13.5H14.625V21.375H21.375V9Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M9.375 21.375H2.625V9L12 3L21.375 9V21.375H14.625M9.375
21.375V13.5H14.625V21.375M9.375 21.375H14.625"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/HomeCustomize.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const HomeCustomize = ({ lineColor, strokeWidth }: IconPathProps) => (
<>
<path
d="M18.18972 6.431532L16.06848 4.310208 13.86528 5.633916 12.62172 5.11854 12 2.625H9L8.378244 5.118576 7.134732 5.633988 4.931532 4.310256 2.810208 6.43158 4.133964 8.634768 3.618564 9.878256 1.125 10.5V13.5L3.61854 14.12172 4.133916 15.36528 2.810172 17.56848 4.931484 19.68984 7.134672 18.36612 8.37822 18.88152M12.11364 9.470472C11.647692 9.172632 11.094 9 10.5 9 8.843148 9 7.5 10.343148 7.5 12 7.5 12.4746 7.61022 12.92352 7.806444 13.3224 7.924788 13.563 8.074404 13.78548 8.25 13.98432"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
<path
d="M15.195 21.375H10.875V13.29336L16.875 9.375 22.875 13.29336V21.375H18.555M15.195 21.375V16.23216H18.555V21.375M15.195 21.375H18.555"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Horse.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Horse = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<path
d="M12.75 6C9 6.75 3.75 10.5 3.75 17.25L12.75 21.75L12 12.75C12.6 15.75 16
16 17.25 15.75L19.5 17.25C20.7 16.65 20.5 15 20.25 14.25C19.5 14 18.75 12
18 9.75C17.5257 8.32697 16 6.5 15 5.25V3L12.75 6Z"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Info.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Info = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M22.8755 12.0042C22.8755 18.0105 18.0064 22.8797 12 22.8797C5.99363
22.8797 1.12451 18.0105 1.12451 12.0042C1.12451 5.99782 5.99363 1.12871
12 1.12871C18.0064 1.12871 22.8755 5.99782 22.8755 12.0042Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12 18V10.5M12 8.25V6M22.8755 12.0042C22.8755 18.0105 18.0064 22.8797
12 22.8797C5.99363 22.8797 1.12451 18.0105 1.12451 12.0042C1.12451 5.99782
5.99363 1.12871 12 1.12871C18.0064 1.12871 22.8755 5.99782 22.8755
12.0042Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Key.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Key = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M4.30499 19.695C6.64674 22.0368 10.4383 22.0368 12.78 19.695C14.4622
18.0128 14.9396 15.5901 14.205 13.485L21.375 6.31501L21.375
2.62499L17.6937 2.62499L10.515 9.79501C8.41336 9.06793 5.98317 9.54184
4.305 11.22C1.96325 13.5618 1.96324 17.3533 4.30499 19.695ZM8.53498
16.59C9.15554 16.59 9.65998 16.0855 9.65998 15.465C9.65998 14.8444
9.15554 14.34 8.53498 14.34C7.91443 14.34 7.40999 14.8444 7.40999
15.465C7.40999 16.0855 7.91443 16.59 8.53498 16.59Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M16.021 8.99144L16.021 11.3793M18.5011 6.69585L18.5011 8.99144M4.305
11.22C1.96325 13.5618 1.96324 17.3533 4.30499 19.695C6.64674 22.0368
10.4383 22.0368 12.78 19.695C14.4622 18.0128 14.9396 15.5901 14.205
13.485L21.375 6.31501L21.375 2.62499L17.6937 2.62499L10.515
9.79501C8.41336 9.06793 5.98317 9.54184 4.305 11.22ZM9.65998
15.465C9.65998 16.0855 9.15554 16.59 8.53498 16.59C7.91443 16.59
7.40999 16.0855 7.40999 15.465C7.40999 14.8444 7.91443 14.34 8.53498
14.34C9.15554 14.34 9.65998 14.8444 9.65998 15.465Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/LiveVideo.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const LiveVideo = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M12 19.875H6.5625H3.375C2.13236 19.875 1.125 18.8676 1.125
17.625V6.375C1.125 5.13236 2.13236 4.125 3.375 4.125H20.625C21.8676 4.125
22.875 5.13236 22.875 6.375V17.625C22.875 18.8676 21.8676 19.875 20.625
19.875H17.4375H12ZM9 16.5V7.5L16.5 12L9 16.5Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M6.5625 19.875H12H17.4375M6.5625 19.875L3 23.25M6.5625
19.875H3.375C2.13236 19.875 1.125 18.8676 1.125 17.625V6.375C1.125
5.13236 2.13236 4.125 3.375 4.125H20.625C21.8676 4.125 22.875 5.13236
22.875 6.375V17.625C22.875 18.8676 21.8676 19.875 20.625
19.875H17.4375M17.4375 19.875L21 23.25M9 7.5V16.5L16.5 12L9 7.5Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Location.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Location = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<path
d="M21.375 2.625L2.625 8.875L10.9583 13.0417L15.125 21.375L21.375 2.625Z"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Lock.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Lock = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<rect
x="4.125"
y="11.6043"
width="15.75"
height="9.77069"
rx="1"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
<path d="M12 15V18" stroke={lineColor} strokeWidth={strokeWidth} />
<path
d="M16.875 11.6043V7.11465C16.875 7.11465 16.875 2.625 12 2.625C7.125
2.625 7.125 7.11465 7.125 7.11465V11.6043"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/NoVideo.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const NoVideo = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M22.8797 12C22.8797 18.0087 18.0087 22.8797 12 22.8797C5.99133 22.8797
1.12033 18.0087 1.12033 12C1.12033 5.99133 5.99133 1.12033 12
1.12033C18.0087 1.12033 22.8797 5.99133 22.8797 12ZM9.00064
16.5018V7.5L16.4992 12L9.00064 16.5018Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M1.5 1.5L6.75 6.75M15.9375 15.9375L22.5 22.5M22.8797 12C22.8797 18.0087
18.0087 22.8797 12 22.8797C5.99133 22.8797 1.12033 18.0087 1.12033
12C1.12033 5.99133 5.99133 1.12033 12 1.12033C18.0087 1.12033 22.8797
5.99133 22.8797 12ZM9.00064 7.5V16.5018L16.4992 12L9.00064 7.5Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/NumberFire.tsx
import React from "react";
export const NumberFire = () => (
<>
<g clipPath="url(#clip0_20346_7102)">
<path
d="M4.7619 20.7286C3.37143 19.1762 2.51428 17.1857 2.51428
14.9952C2.51428 11.5 4.50476 8.00476 7.00952 7.00476C7.50476
8.50952 8.26667 10.519 11.4952 10.5C8 3.50952 13.4952 0.0142822
14.4952 0.0142822C14.4952 3.28095 16.5714 5.5 18.4571 7.9L13.1238
17.4619L9.02857 13.0809L4.7619 20.7286ZM13.4952 20.4905L9.4
16.1095L6.12381 21.9857C7.81376 23.2721 9.87619 23.9741 12
23.9857C16.9905 23.9857 21.4857 19.9857 21.4857 14.9952C21.4857
12.8048 20.6857 11.0619 19.6286 9.49047L13.4952 20.4905Z"
fill="url(#paint0_linear_20346_7102)"
/>
<path
d="M4.7619 20.7286C3.37143 19.1762 2.51428 17.1857 2.51428
14.9952C2.51428 11.5 4.50476 8.00476 7.00952 7.00476C7.50476
8.50952 8.26667 10.519 11.4952 10.5C8 3.50952 13.4952 0.0142822
14.4952 0.0142822C14.4952 3.28095 16.5714 5.5 18.4571 7.9L13.1238
17.4619L9.02857 13.0809L4.7619 20.7286ZM13.4952 20.4905L9.4
16.1095L6.12381 21.9857C7.81376 23.2721 9.87619 23.9741 12
23.9857C16.9905 23.9857 21.4857 19.9857 21.4857 14.9952C21.4857
12.8048 20.6857 11.0619 19.6286 9.49047L13.4952 20.4905Z"
fill="url(#paint1_linear_20346_7102)"
/>
<path
d="M8.15238 14.6429L4.7619 20.7286C3.37143 19.1762 2.51428
17.1857 2.51428 14.9952C2.51428 11.5 4.50476 8.00476 7.00952
7.00476C5.71428 9.15714 5.91428 11.6714 8.15238 14.6429ZM9.4
16.1095L6.12381 21.9857L6.35238 22.1571C10.6095 25.1381 13.419
20.4143 9.4 16.1095V16.1095Z"
fill="url(#paint2_linear_20346_7102)"
/>
<path
d="M19.6286 9.49047C20.6857 11.0619 21.4857 12.8048 21.4857
14.9952C21.4857 19.9857 16.9905 23.9857 12 23.9857C10.6329 23.9805
9.28249 23.6851 8.03809 23.119C11.4667 24.6238 13.0857 23.1095
13.5048 20.4714L19.6286 9.49047ZM18.4571 7.9C16.5714 5.5 14.4952
3.28095 14.4952 0.0142822C13.4952 0.0142822 7.99999 3.50952 11.4952
10.5C12.4846 12.4997 13.15 14.6439 13.4667 16.8524L18.4571 7.9Z"
fill="url(#paint3_linear_20346_7102)"
/>
<path
d="M19.6286 9.49047C20.6857 11.0619 21.4857 12.8048 21.4857
14.9952C21.4857 19.0048 18.581 22.3762 14.8571 23.5476C18.2857 22.4048
20.6095 17.8429 17.5333 13.2429L19.6286 9.49047ZM16.3524 11.6714L18.4571
7.9C16.5714 5.5 14.4952 3.28095 14.4952 0.0142822C13.0571 1.92857 11.7619
5.5 16.3524 11.6714V11.6714Z"
fill="url(#paint4_linear_20346_7102)"
/>
<path
d="M8.15238 14.6429L4.7619 20.7286C3.37143 19.1762 2.51428 17.1857
2.51428 14.9952C2.51428 11.5 4.50476 8.00476 7.00952 7.00476C5.71428
9.15714 5.91428 11.6714 8.15238 14.6429ZM9.4 16.1095L6.12381 21.9857L6.35238
22.1571C10.6095 25.1381 13.419 20.4143 9.4 16.1095V16.1095Z"
fill="url(#paint5_linear_20346_7102)"
/>
<path
d="M19.6286 9.49047C20.6857 11.0619 21.4857 12.8048 21.4857
14.9952C21.4857 19.9857 16.9905 23.9857 12 23.9857C10.6329 23.9805 9.28249
23.6851 8.03809 23.119C11.4667 24.6238 13.0857 23.1095 13.5048 20.4714L19.6286
9.49047ZM18.4571 7.9C16.5714 5.5 14.4952 3.28095 14.4952 0.0142822C13.4952
0.0142822 7.99999 3.50952 11.4952 10.5C12.4846 12.4997 13.15 14.6439
13.4667 16.8524L18.4571 7.9Z"
fill="url(#paint6_linear_20346_7102)"
/>
<path
d="M19.6286 9.49047C20.6857 11.0619 21.4857 12.8048 21.4857 14.9952C21.4857
19.0048 18.581 22.3762 14.8571 23.5476C18.2857 22.4048 20.6095 17.8429 17.5333
13.2429L19.6286 9.49047ZM16.3524 11.6714L18.4571 7.9C16.5714 5.5 14.4952
3.28095 14.4952 0.0142822C13.0571 1.92857 11.7619 5.5 16.3524 11.6714V11.6714Z"
fill="url(#paint7_linear_20346_7102)"
/>
<path
d="M21.4857 6.48096C21.4857 6.85226 21.3382 7.20835 21.0757 7.4709C20.8131
7.73346 20.457 7.88096 20.0857 7.88096C19.7144 7.88096 19.3583 7.73346 19.0958
7.4709C18.8332 7.20835 18.6857 6.85226 18.6857 6.48096C18.6857 5.48096 19.5905
5.48096 19.0857 3.98572C21.0857 4.49048 21.4857 5.7381 21.4857 6.48096Z"
fill="url(#paint8_linear_20346_7102)"
/>
</g>
<defs>
<linearGradient
id="paint0_linear_20346_7102"
x1="14.3971"
y1="11.979"
x2="4.91809"
y2="17.339"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.18" stopColor="#FFE187" />
<stop offset="0.24" stopColor="#FFD986" />
<stop offset="0.33" stopColor="#FFC384" />
<stop offset="0.44" stopColor="#FFA081" />
<stop offset="0.55" stopColor="#FF737D" />
</linearGradient>
<linearGradient
id="paint1_linear_20346_7102"
x1="20.2667"
y1="13.3105"
x2="9.55333"
y2="11.4219"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.24" stopColor="#FFE187" />
<stop offset="0.28" stopColor="#FFE187" stopOpacity="0.95" />
<stop offset="0.36" stopColor="#FFE187" stopOpacity="0.83" />
<stop offset="0.46" stopColor="#FFE187" stopOpacity="0.62" />
<stop offset="0.58" stopColor="#FFE187" stopOpacity="0.34" />
<stop offset="0.72" stopColor="#FFE187" stopOpacity="0" />
</linearGradient>
<linearGradient
id="paint2_linear_20346_7102"
x1="6.92666"
y1="7.00667"
x2="6.92666"
y2="23.0914"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.14" stopColor="#FFE187" />
<stop offset="0.35" stopColor="#FFC084" />
<stop offset="0.78" stopColor="#FF737D" />
</linearGradient>
<linearGradient
id="paint3_linear_20346_7102"
x1="13.1248"
y1="0.13333"
x2="15.1905"
y2="23.7419"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.25" stopColor="#FFE187" />
<stop offset="0.33" stopColor="#FFD286" />
<stop offset="0.67" stopColor="#FF8E7F" />
<stop offset="0.83" stopColor="#FF737D" />
</linearGradient>
<linearGradient
id="paint4_linear_20346_7102"
x1="20.44"
y1="10.1286"
x2="11.3733"
y2="12.7286"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.04" stopColor="#FFE187" />
<stop offset="13%" stopColor="#FFD686" />
<stop offset="0.29" stopColor="#FFBA83" />
<stop offset="0.49" stopColor="#FF8B7F" />
<stop offset="0.59" stopColor="#FF737D" />
</linearGradient>
<linearGradient
id="paint5_linear_20346_7102"
x1="10.4086"
y1="13.9848"
x2="2.87524"
y2="17.659"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#FFE187" />
<stop offset="0.03" stopColor="#FFE187" stopOpacity="0.92" />
<stop offset="0.12" stopColor="#FFE187" stopOpacity="0.71" />
<stop offset="0.21" stopColor="#FFE187" stopOpacity="0.52" />
<stop offset="0.31" stopColor="#FFE187" stopOpacity="0.36" />
<stop offset="0.4" stopColor="#FFE187" stopOpacity="0.23" />
<stop offset="0.5" stopColor="#FFE187" stopOpacity="0.13" />
<stop offset="0.6" stopColor="#FFE187" stopOpacity="0.06" />
<stop offset="0.71" stopColor="#FFE187" stopOpacity="0.01" />
<stop offset="0.83" stopColor="#FFE187" stopOpacity="0" />
</linearGradient>
<linearGradient
id="paint6_linear_20346_7102"
x1="20.8686"
y1="10.7248"
x2="6.30666"
y2="13.2924"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.11" stopColor="#FFE187" />
<stop offset="0.15" stopColor="#FFE187" stopOpacity="0.8" />
<stop offset="0.19" stopColor="#FFE187" stopOpacity="0.62" />
<stop offset="0.23" stopColor="#FFE187" stopOpacity="0.45" />
<stop offset="0.27" stopColor="#FFE187" stopOpacity="0.31" />
<stop offset="0.32" stopColor="#FFE187" stopOpacity="0.2" />
<stop offset="0.37" stopColor="#FFE187" stopOpacity="0.11" />
<stop offset="0.42" stopColor="#FFE187" stopOpacity="0.05" />
<stop offset="0.48" stopColor="#FFE187" stopOpacity="0.01" />
<stop offset="0.57" stopColor="#FFE187" stopOpacity="0" />
</linearGradient>
<linearGradient
id="paint7_linear_20346_7102"
x1="19.5819"
y1="21.6152"
x2="14.5743"
y2="10.099"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.41" stopColor="#FF737D" />
<stop offset="0.46" stopColor="#FF737D" stopOpacity="0.95" />
<stop offset="0.54" stopColor="#FF737D" stopOpacity="0.83" />
<stop offset="0.65" stopColor="#FF737D" stopOpacity="0.62" />
<stop offset="0.79" stopColor="#FF737D" stopOpacity="0.34" />
<stop offset="0.93" stopColor="#FF737D" stopOpacity="0" />
</linearGradient>
<linearGradient
id="paint8_linear_20346_7102"
x1="18.4324"
y1="4.64477"
x2="21.9419"
y2="8.15429"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.11" stopColor="#FFE187" />
<stop offset="0.35" stopColor="#FFC084" />
<stop offset="0.84" stopColor="#FF737D" />
</linearGradient>
<clipPath id="clip0_20346_7102">
<rect
width="18.9714"
height="23.9714"
fill="white"
transform="translate(2.51428 0.0142822)"
/>
</clipPath>
</defs>
</>
);
export default NumberFire;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/OptedIn.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const OptedIn = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M12.6518 2.62793H19.8728C20.7012 2.62793 21.3728 3.2995 21.3728
4.12793V11.3489C21.3728 11.7664 21.1988 12.165 20.8927 12.4488L11.6956
20.9766C11.1042 21.5249 10.1852 21.5076 9.61501 20.9374L3.06336
14.3857C2.49314 13.8155 2.4758 12.8965 3.02409 12.3051L11.5519
3.10805C11.8358 2.80192 12.2343 2.62793 12.6518 2.62793Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M9 10.5L12 13.5L18 7.5M19.8728 2.62793H12.6518C12.2343 2.62793 11.8358
2.80192 11.5519 3.10805L3.02409 12.3051C2.4758 12.8965 2.49314 13.8155
3.06336 14.3857L9.61501 20.9374C10.1852 21.5076 11.1042 21.5249 11.6956
20.9766L20.8927 12.4488C21.1988 12.165 21.3728 11.7664 21.3728
11.3489V4.12793C21.3728 3.2995 20.7012 2.62793 19.8728 2.62793Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Plus.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Plus = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M22.8755 12.0042C22.8755 18.0105 18.0064 22.8797 12 22.8797C5.99363
22.8797 1.12451 18.0105 1.12451 12.0042C1.12451 5.99782 5.99363 1.12871
12 1.12871C18.0064 1.12871 22.8755 5.99782 22.8755 12.0042Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12.0001 6V12M12.0001 12V18M12.0001 12H18.0001M12.0001
12H6.00006M22.8755 12.0042C22.8755 18.0105 18.0064 22.8797 12
22.8797C5.99363 22.8797 1.12451 18.0105 1.12451 12.0042C1.12451
5.99782 5.99363 1.12871 12 1.12871C18.0064 1.12871 22.8755 5.99782
22.8755 12.0042Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Popout.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Popout = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M4.125 17.625V6.375C4.125 5.13236 5.13236 4.125 6.375
4.125H17.625C18.8676 4.125 19.875 5.13236 19.875 6.375V17.625C19.875
18.8676 18.8676 19.875 17.625 19.875H6.375C5.13236 19.875 4.125 18.8676
4.125 17.625Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M14.25 4.125H6.375C5.13236 4.125 4.125 5.13236 4.125 6.375V17.625C4.125
18.8676 5.13236 19.875 6.375 19.875H17.625C18.8676 19.875 19.875 18.8676
19.875 17.625V9.75M13.5 10.5L22.4971 1.50293M16.5 1.125L22.8751
1.12491L22.875 7.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Promo.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Promo = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M19.8728 2.62793H12.6518C12.2343 2.62793 11.8358 2.80192 11.5519
3.10805L3.02409 12.3051C2.4758 12.8965 2.49314 13.8155 3.06336
14.3857L9.61501 20.9374C10.1852 21.5076 11.1042 21.5249 11.6956
20.9766L20.8927 12.4488C21.1988 12.165 21.3728 11.7664 21.3728
11.3489V4.12793C21.3728 3.2995 20.7012 2.62793 19.8728 2.62793ZM15.749
9.37308C16.3698 9.37308 16.8731 8.86983 16.8731 8.24904C16.8731 7.62825
16.3698 7.125 15.749 7.125C15.1282 7.125 14.625 7.62825 14.625
8.24904C14.625 8.86983 15.1282 9.37308 15.749 9.37308Z"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ReferFriend.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const ReferFriend = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M7.27024 13.4973H16.7295C17.7442 13.4973 18.6334 14.1765 18.9003
15.1555L20.0811 19.4867C20.3413 20.4409 19.6229 21.3813 18.6339
21.3813H5.3658C4.37679 21.3813 3.65848 20.4409 3.91862 19.4867L5.09947
15.1555C5.36637 14.1765 6.25552 13.4973 7.27024 13.4973Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M15.7522 6.37019C15.7522 8.44241 14.0723 10.1223 12.0001 10.1223C9.9279
10.1223 8.24803 8.44241 8.24803 6.37019C8.24803 4.29797 9.9279 2.6181
12.0001 2.6181C14.0723 2.6181 15.7522 4.29797 15.7522 6.37019Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12.75 21.3813H5.36602C4.37702 21.3813 3.6587 20.4409 3.91884
19.4867L5.09969 15.1555C5.36659 14.1765 6.25575 13.4973 7.27046
13.4973H12.75M14.625 18H22.8047M19.125 14.25L22.875 18L19.125
21.75M15.7522 6.37019C15.7522 8.44241 14.0723 10.1223 12.0001
10.1223C9.9279 10.1223 8.24803 8.44241 8.24803 6.37019C8.24803 4.29797
9.9279 2.6181 12.0001 2.6181C14.0723 2.6181 15.7522 4.29797 15.7522
6.37019Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Refresh.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Refresh = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<circle
cx="11.9999"
cy="12.0042"
r="9.37333"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M11.9606 21.375C6.80467 21.375 2.62494 17.1953 2.62494 12.0393C2.62494
9.54156 3.60584 7.27292 5.20343 5.59758L8.09741 2.70361M12.0393
2.63086C17.1953 2.63086 21.375 6.81059 21.375 11.9666C21.375 14.4607
20.3969 16.7265 18.8033 18.4011L15.9022 21.3022M22.1249
21.3825H15.5806V15.1601M1.87494 2.6299H8.41933V8.625"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Repeat.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Repeat = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M13.741 4.1212C17.1373 4.1212 21.375 6.74509 21.375 12C21.375 17.2549
17.1373 19.8788 13.741 19.8788H10.2592C6.97951 19.8788 2.625 17.2549 2.625
12C2.625 6.74509 6.86288 4.1212 10.2592 4.1212H13.741Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M6 4.12119L9.31742 0.803741M6 4.12119L9.31742 7.43861M6
4.12119H13.7408C17.1371 4.12119 21.375 6.74508 21.375 12C21.375 13.1214
21.1767 14.1231 20.8328 15.0049M18 19.8788L14.6826 16.5614M18
19.8788L14.6826 23.1963M18 19.8788H10.259C6.8627 19.8788 2.625 17.2549
2.625 12C2.625 10.8842 2.81608 9.88694 3.1496 9.00828"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Replay.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Replay = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M22.8755 12.0042C22.8755 18.0105 18.0064 22.8797 12 22.8797C5.99366
22.8797 1.12454 18.0105 1.12454 12.0042C1.12454 5.99782 5.99366 1.12871
12 1.12871C18.0064 1.12871 22.8755 5.99782 22.8755 12.0042ZM16.5 12L9
16.5V7.5L16.5 12Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M1.12033 12C1.12033 18.0087 5.99132 22.8797 12 22.8797C18.0087 22.8797
22.8797 18.0087 22.8797 12C22.8797 5.99132 18.0087 1.12033 12
1.12033C9.00162 1.12033 6.28654 2.33325 4.31864 4.29519L1.16629
7.44754M1.11914 2.61914V7.5H6M9.00064 7.5V16.5019L16.4992 12L9.00064 7.5Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Result.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Result = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M18.3743 8.99929C18.3743 12.5197 15.5204 15.3736 12 15.3736C8.47958
15.3736 5.62571 12.5197 5.62571 8.99929C5.62571 5.47887 8.47958 2.625 12
2.625C15.5204 2.625 18.3743 5.47887 18.3743 8.99929ZM12.0014
10.9912C13.1007 10.9912 13.9919 10.1001 13.9919 9.00078C13.9919 7.90149
13.1007 7.01033 12.0014 7.01033C10.9021 7.01033 10.011 7.90149 10.011
9.00078C10.011 10.1001 10.9021 10.9912 12.0014 10.9912Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M10.125 15.0933V21.3667H13.875V15.0934M18.3743 8.99929C18.3743 12.5197
15.5204 15.3736 12 15.3736C8.47958 15.3736 5.62571 12.5197 5.62571
8.99929C5.62571 5.47887 8.47958 2.625 12 2.625C15.5204 2.625 18.3743
5.47887 18.3743 8.99929ZM13.9919 9.00078C13.9919 10.1001 13.1007 10.9912
12.0014 10.9912C10.9021 10.9912 10.011 10.1001 10.011 9.00078C10.011
7.90149 10.9021 7.01033 12.0014 7.01033C13.1007 7.01033 13.9919 7.90149
13.9919 9.00078Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Rs.tsx
import React from "react";
export const Rs = () => (
<>
<path
d="M20.8979 10.5487C20.8746 10.3853 20.8279 10.2687 20.7346 10.152C20.6646
10.0587 20.5713 9.96536 20.4546 9.91869C20.2446 9.80203 19.988 9.75537
19.6847 9.75537C19.358 9.75537 19.1014 9.80203 18.9614 9.89536C18.8214
9.98869 18.7281 10.1053 18.7281 10.292C18.7281 10.4553 18.7981 10.5953
18.9614 10.712C19.1247 10.8286 19.3114 10.922 19.568 11.0153C19.8247
11.1086 20.1046 11.1786 20.408 11.2486C20.7113 11.3186 21.0379 11.4119
21.3646 11.5053C21.6912 11.5986 22.0179 11.7152 22.3212 11.8319C22.6245
11.9719 22.9045 12.1352 23.1611 12.3452C23.4178 12.5552 23.6044 12.8118
23.7677 13.0918C23.9311 13.3951 24.0011 13.7451 24.0011 14.1651C24.0011
14.7017 23.8844 15.1684 23.6744 15.565C23.4644 15.9616 23.1611 16.2883
22.7878 16.5449C22.4145 16.8016 21.9479 16.9882 21.4346 17.1282C20.8979
17.2682 20.338 17.3149 19.708 17.3149C19.078 17.3149 18.5647 17.2216
18.0748 17.0582C17.5848 16.8949 17.1648 16.6616 16.8148 16.3816C16.4649
16.1016 16.1849 15.775 15.9982 15.4017C15.7882 15.0284 15.6949 14.6317
15.6716 14.2351H18.5403C18.6103 14.5617 18.7737 14.7951 19.0303
14.9584C19.147 15.0284 19.287 15.0984 19.427 15.1217C19.5903 15.1684
19.7303 15.1684 19.8703 15.1684C20.2436 15.1684 20.5469 15.1217 20.7802
15.005C21.0135 14.8884 21.1068 14.7251 21.1068 14.4917C21.1068 14.2584
20.9669 14.0951 20.7102 13.9551C20.4536 13.8384 20.1269 13.7218 19.7303
13.6285C19.3336 13.5351 18.9137 13.4185 18.447 13.3018C17.9804 13.1852
17.5604 13.0218 17.1638 12.8118C16.7671 12.6019 16.4405 12.3219 16.1838
11.9486C15.9272 11.5986 15.7872 11.1319 15.7872 10.5253C15.7872 10.0354
15.8805 9.61538 16.0905 9.24207C16.3005 8.86876 16.5571 8.56544 16.9071
8.33213C17.2571 8.09881 17.6771 7.91215 18.167 7.79549C18.657 7.67883
19.1703 7.60884 19.7536 7.60884C20.3836 7.60884 20.9435 7.67883 21.4102
7.84216C21.8768 8.00548 22.2734 8.19213 22.5768 8.47212C22.9034 8.72877
23.1367 9.03208 23.3234 9.40539C23.51 9.75537 23.6267 10.1287 23.6734
10.5253H20.8979V10.5487Z"
fill="#B1B235"
/>
<path
d="M10.2798 10.8286V11.9708H11.9597L10.2798
13.3241V14.5373H13.9652V13.3241H12.3086L13.9652 11.9942V10.8286H10.2798Z"
fill="#B1B235"
/>
<path
d="M10.2798 15.1206V17.0561C10.2798 17.0561 10.3731 18.7127 12.123
18.7127C13.8729 18.7127 13.9662 17.0561 13.9662
17.0561V15.1206H10.2798ZM12.9152 16.8239C12.9152 16.8239 12.8453 17.5471
12.122 17.5471C11.3987 17.5471 11.3287 16.8239 11.3287
16.8239V16.3339H12.9152V16.8239Z"
fill="#B1B235"
/>
<path
d="M10.2798 6V7.39991L10.6998 7.58657V8.98648L10.2798
9.19646V10.503L13.9652 8.96315V7.65656L10.2798 6ZM11.6331
8.58878V7.88882L12.683 8.2388L11.6331 8.58878Z"
fill="#B1B235"
/>
<path
d="M8.81732 10.7586C8.86399 8.77649 6.81184 8.19319 5.87857
8.19319H1.44658L0 17.2661H2.49545L3.05541 13.954H3.8487L5.24861
17.2661H8.02404L6.36748 13.7907C6.36748 13.7907 8.77066 12.9041 8.81732
10.7586ZM5.80857 11.8552C5.57525 12.0652 5.3886 12.1586 5.08528
12.1586H3.3354L3.66204 10.1531H4.8753C5.17861 10.1531 5.52859 10.0831
5.80857 10.2697C6.06522 10.4331 6.18188 10.7597 6.18188 11.0397C6.18188
11.3897 6.04189 11.6686 5.80857 11.8552Z"
fill="#004693"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/ScheduledRaces.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const ScheduledRaces = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M16.8732 21.375C20.1856 21.375 22.8709 18.6887 22.8709 15.375C22.8709
12.0613 20.1856 9.375 16.8732 9.375C13.5607 9.375 10.8755 12.0613 10.8755
15.375C10.8755 18.6887 13.5607 21.375 16.8732 21.375Z"
fill={backgroundColor}
/>
<path d="M16.6651 13.5V16.2512L18.9142 17.25" fill={backgroundColor} />
<path
d="M17.6651 13.5C17.6651 12.9477 17.2173 12.5 16.6651 12.5C16.1128 12.5
15.6651 12.9477 15.6651 13.5H17.6651ZM16.6651 16.2512H15.6651C15.6651
16.6465 15.8979 17.0047 16.2592 17.1651L16.6651 16.2512ZM18.5083
18.1639C19.0131 18.3881 19.604 18.1606 19.8281 17.6559C20.0523 17.1511
19.8248 16.5602 19.3201 16.3361L18.5083 18.1639ZM3.625
19.875V8.625H1.625V19.875H3.625ZM3.625
8.625V4.875H1.625V8.625H3.625ZM20.375
4.875V7.50586H22.375V4.875H20.375ZM4.125 20.375C3.84886 20.375
3.625 20.1511 3.625 19.875H1.625C1.625 21.2557 2.74429 22.375 4.125
22.375V20.375ZM19.125 3.625C19.8154 3.625 20.375 4.18464 20.375
4.875H22.375C22.375 3.08007 20.9199 1.625 19.125 1.625V3.625ZM4.875
1.625C3.08007 1.625 1.625 3.08007 1.625 4.875H3.625C3.625 4.18464
4.18464 3.625 4.875 3.625V1.625ZM4.875
3.625H8.625V1.625H4.875V3.625ZM8.625
3.625H15.375V1.625H8.625V3.625ZM15.375
3.625H19.125V1.625H15.375V3.625ZM14.375 0V2.625H16.375V0H14.375ZM14.375
2.625V6H16.375V2.625H14.375ZM7.625 0V2.625H9.625V0H7.625ZM7.625
2.625L7.625 6L9.625 6L9.625 2.625L7.625 2.625ZM2.625
9.625H9.75V7.625H2.625V9.625ZM9.75
20.375H4.125V22.375H9.75V20.375ZM21.8709 15.375C21.8709 18.1368 19.633
20.375 16.8732 20.375V22.375C20.7383 22.375 23.8709 19.2406 23.8709
15.375H21.8709ZM16.8732 20.375C14.1134 20.375 11.8755 18.1368 11.8755
15.375H9.87546C9.87546 19.2406 13.0081 22.375 16.8732
22.375V20.375ZM11.8755 15.375C11.8755 12.6132 14.1134 10.375 16.8732
10.375V8.375C13.0081 8.375 9.87546 11.5094 9.87546 15.375H11.8755ZM16.8732
10.375C19.633 10.375 21.8709 12.6132 21.8709 15.375H23.8709C23.8709
11.5094 20.7383 8.375 16.8732 8.375V10.375ZM15.6651
13.5V16.2512H17.6651V13.5H15.6651ZM16.2592 17.1651L18.5083
18.1639L19.3201 16.3361L17.0709 15.3372L16.2592 17.1651Z"
fill={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Search.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Search = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M17.625 10.125C17.625 14.2671 14.2671 17.625 10.125 17.625C5.98286
17.625 2.625 14.2671 2.625 10.125C2.625 5.98286 5.98286 2.625 10.125
2.625C14.2671 2.625 17.625 5.98286 17.625 10.125Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M15.4283 15.4283L21 21M17.625 10.125C17.625 14.2671 14.2671 17.625
10.125 17.625C5.98286 17.625 2.625 14.2671 2.625 10.125C2.625 5.98286
5.98286 2.625 10.125 2.625C14.2671 2.625 17.625 5.98286 17.625 10.125Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Settings.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Settings = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M10.5 2.625H13.5L14.1218 5.11853L15.3653 5.63392L17.5684 4.31021L19.6897
6.43153L18.3661 8.63467L18.8815 9.87823L21.375 10.5V13.5L18.8816
14.1218L18.3661 15.3654L19.6898 17.5685L17.5685 19.6898L15.3653
18.3662L14.1218 18.8816L13.5 21.375H10.5L9.87822 18.8815L8.63467
18.3661L6.43149 19.6898L4.31017 17.5685L5.63392 15.3653L5.11853
14.1218L2.625 13.5V10.5L5.11857 9.87826L5.63396 8.63477L4.31021
6.43158L6.43153 4.31026L8.63473 5.63399L9.87824 5.11857L10.5 2.625ZM12
15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431
9 12C9 13.6569 10.3431 15 12 15Z"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Share.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const Share = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M7.50414 7.87555H6.38028C5.13764 7.87555 4.13028 8.88348 4.13028
10.1268V17.6311C4.13028 18.8745 5.13764 19.8824 6.38028
19.8824H17.625C18.8676 19.8824 19.875 18.8745 19.875 17.6311V10.1268C19.875
8.88348 18.8676 7.87555 17.625 7.87555H16.5011M8.33356 4.80098L12
1.13242L15.6665 4.80098M12 13.5747L12 1.66733"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/SortAscending.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const SortAscending = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M6 21V4.57031M1.5 9L6 4.5L10.5 9M13.5 18.375H22.5M13.5 12H19.5M13.5
5.625H16.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/SortDescending.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const SortDescending = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M6 3V19.4297M1.5 15L6 19.5L10.5 15M13.5 5.625H22.5M13.5 12H19.5M13.5
18.375H16.5"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Stable.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Stable = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M21.375 21.375V11.9819L19.41 6.27321L12 3L4.56661 6.27321L2.625
11.9819V21.375H6.375V13.5H17.625V21.375H21.375Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M6.375 21.375H2.625V11.9819L4.56661 6.27321L12 3L19.41 6.27321L21.375
11.9819V21.375H17.625M6.375 21.375V13.5H17.625V21.375M6.375
21.375H17.625M17.625 21.375L6.4043 13.5293"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Star.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Star = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<path
d="M12 2.92539L14.9438 8.8901L21.5262 9.84659L16.7631 14.4895L17.8875
21.0453L12 17.9501L6.11248 21.0453L7.23689 14.4895L2.47379 9.84659L9.05624
8.8901L12 2.92539Z"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Store.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Store = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M2.71301 8.59024L4.01412 2.62555H19.9859L21.287 8.59024C21.6573 10.5681
20.8475 11.7774 19.8363 12.0697C18.4347 12.4748 15.3822 12.3755 15.3822
9.31671H14.9849C14.9849 10.3736 14.693 12.3755 12.0297
12.3755H11.9703C9.30696 12.3755 9.0025 10.3736 9.0025
9.31671H8.61782C8.61782 12.3755 5.56532 12.4748 4.16368 12.0697C3.15253
11.7774 2.34266 10.5681 2.71301 8.59024Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M4.125 16.1245V21.3745H19.875V16.1245M4.01412 2.62555L2.71301
8.59024C2.34266 10.5681 3.15253 11.7774 4.16368 12.0697C5.56532 12.4748
8.61782 12.3755 8.61782 9.31671H9.0025C9.0025 10.3736 9.30696 12.3755
11.9703 12.3755H12.0297C14.693 12.3755 14.9849 10.3736 14.9849
9.31671H15.3822C15.3822 12.3755 18.4347 12.4748 19.8363 12.0697C20.8475
11.7774 21.6573 10.5681 21.287 8.59024L19.9859 2.62555H4.01412Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Success.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Success = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M22.8755 12.0042C22.8755 18.0105 18.0063 22.8797 12 22.8797C5.99363
22.8797 1.12451 18.0105 1.12451 12.0042C1.12451 5.99782 5.99363 1.12871
12 1.12871C18.0063 1.12871 22.8755 5.99782 22.8755 12.0042Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M6.75006 12L10.5001 15.75L18.0001 8.25M22.8755 12.0042C22.8755 18.0105
18.0063 22.8797 12 22.8797C5.99363 22.8797 1.12451 18.0105 1.12451
12.0042C1.12451 5.99782 5.99363 1.12871 12 1.12871C18.0063 1.12871 22.8755
5.99782 22.8755 12.0042Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Support.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Support = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M22.8755 12.0042C22.8755 18.0105 18.0064 22.8797 12 22.8797C5.99363
22.8797 1.12451 18.0105 1.12451 12.0042C1.12451 5.99782 5.99363 1.12871
12 1.12871C18.0064 1.12871 22.8755 5.99782 22.8755 12.0042Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12 18V15.75M8.99997 9C8.99997 9 8.99997 6 12 6C15 6 15 9 15 9C15 12
12 11.25 12 14.25M22.8755 12.0042C22.8755 18.0105 18.0064 22.8797 12
22.8797C5.99363 22.8797 1.12451 18.0105 1.12451 12.0042C1.12451 5.99782
5.99363 1.12871 12 1.12871C18.0064 1.12871 22.8755 5.99782 22.8755
12.0042Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Tick.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const Tick = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M3.75 12L9 17.25L20.25 6"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/TimeForm.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const TimeForm = ({ lineColor }: IconPathProps) => (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M2 0C0.895431 0 0 0.89543 0 2V22C0 23.1046 0.89543 24 2
24H22C23.1046 24 24 23.1046 24 22V2C24 0.895431 23.1046 0 22 0H2ZM8.71289
9.11572H11.9795V7.33594H3.29297V9.11572H6.51562V18H8.71289V9.11572ZM15.4365
13.6421H19.6553V11.8696H15.4365V9.11572H20.1826V7.33594H13.2393V18H15.4365V13.6421Z"
fill={lineColor}
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/TrackMaster.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const TrackMaster = ({ lineColor }: IconPathProps) => (
<>
<path
d="M12.7552 20.9722C18.6253 20.9722 23.2604 16.8559 23.2604 11.959C23.2604
7.06213 18.6253 2.9458 12.7552 2.9458C6.88509 2.9458 2.25 7.06213 2.25
11.959C2.25 16.8559 6.88509 20.9722 12.7552 20.9722ZM12 22.494C5.37258
22.494 0 17.7942 0 11.9968C0 6.19936 5.37258 1.4996 12 1.4996C18.6274
1.4996 24 6.19936 24 11.9968C24 17.7942 18.6274 22.494 12 22.494Z"
fill={lineColor}
/>
<path
d="M10.9636 9.11258H8.66371L7.27981 17.0931H5.38188L6.76578
9.11258H4.49881L4.78218 7.49802H11.247L10.9636 9.11258ZM14.069 7.49802L14.6292
14.3978L17.5749 7.49802H20.0659L18.3987 17.0931H16.5007L16.962 14.4373L17.7924
10.6481L14.8532 17.0931H13.5682L12.8433 10.4306L12.2963 14.5625L11.8613
17.0931H9.97001L11.6307 7.49802H14.069Z"
fill={lineColor}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Tracks.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Tracks = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M13.741 4.12118C17.1373 4.12118 21.375 6.74507 21.375 12C21.375 17.2549
17.1373 19.8788 13.741 19.8788H10.2592C6.97951 19.8788 2.625 17.2549 2.625
12C2.625 6.74507 6.86288 4.12118 10.2592 4.12118H13.741ZM13.5
8.62653H10.5C9 8.62653 7.1283 9.75 7.1283 12C7.1283 14.25 9.05151 15.3735
10.5 15.3735H13.5C15 15.3735 16.8716 14.25 16.8716 12C16.8716 9.75 15
8.62653 13.5 8.62653Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M13.741 4.12118C17.1373 4.12118 21.375 6.74507 21.375 12C21.375 17.2549
17.1373 19.8788 13.741 19.8788H10.2592M13.741 4.12118H10.2592C6.86288
4.12118 2.625 6.74507 2.625 12C2.625 17.2549 6.97951 19.8788 10.2592
19.8788M13.741 4.12118H22.5M10.2592 19.8788H1.5M10.5 8.62653H13.5C15
8.62653 16.8716 9.75 16.8716 12C16.8716 14.25 15 15.3735 13.5
15.3735H10.5C9.05151 15.3735 7.1283 14.25 7.1283 12C7.1283 9.75 9
8.62653 10.5 8.62653Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Trash.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Trash = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M4.5 6.375L5.86185 20.028C5.94033 20.7932 6.58486 21.375 7.35403
21.375H16.646C17.4152 21.375 18.0597 20.7932 18.1382 20.028L19.5
6.375H15.75H8.25H4.5Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M9.75 9V18.375M14.25 9V18.375M4.5 6.375H8.25M4.5 6.375H1.50008M4.5
6.375L5.86185 20.028C5.94033 20.7932 6.58486 21.375 7.35403
21.375H16.646C17.4152 21.375 18.0597 20.7932 18.1382 20.028L19.5
6.375M19.5 6.375H15.75M19.5 6.375H22.5001M15.75 6.375H8.25M15.75
6.375V4.125C15.75 3.29657 15.0784 2.625 14.25 2.625H9.75C8.92158 2.625
8.25 3.29657 8.25 4.125V6.375"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/TvgPicks.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const TvgPicks = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M3.93367 19.4495L4.77323 16.6117C5.05601 15.6558 5.93399 15 6.93078
15H14.0664C15.0646 15 15.9434 15.6576 16.225 16.6151L17.0593
19.4518C17.3419 20.4125 16.6217 21.375 15.6203 21.375H5.37204C4.36963
21.375 3.64929 20.4107 3.93367 19.4495Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M13.1297 9C13.1297 10.4523 11.9523 11.6297 10.5 11.6297C9.04768 11.6297
7.87034 10.4523 7.87034 9C7.87034 7.54768 9.04768 6.37034 10.5
6.37034C11.9523 6.37034 13.1297 7.54768 13.1297 9Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12.0004 21.3747H5.37252C4.37011 21.3747 3.64977 20.4104 3.93415
19.4492L4.77371 16.6114C5.05649 15.6556 5.93447 14.9997 6.93126
14.9997H12.0005M14.2512 17.9997L17.2512 20.9997L23.2512 14.9997M22.8764
11.9997V4.87473C22.8764 3.63209 21.8691 2.62473 20.6264
2.62473H3.37644C2.1338 2.62473 1.12644 3.63209 1.12644
4.87473V11.2497V19.1247C1.12644 20.3674 2.1338 21.3747 3.37644
21.3747H10.5014M13.1297 9C13.1297 10.4523 11.9523 11.6297 10.5
11.6297C9.04768 11.6297 7.87034 10.4523 7.87034 9C7.87034 7.54768
9.04768 6.37034 10.5 6.37034C11.9523 6.37034 13.1297 7.54768 13.1297 9Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/User.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const User = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M15.7521 6.37018C15.7521 8.4424 14.0723 10.1223 12 10.1223C9.92781
10.1223 8.24794 8.4424 8.24794 6.37018C8.24794 4.29796 9.92781 2.61809 12
2.61809C14.0723 2.61809 15.7521 4.29796 15.7521 6.37018Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M18.8997 15.1584C18.6327 14.1795 17.7436 13.5004 16.729
13.5004H7.27011C6.25547 13.5004 5.36636 14.1795 5.09939 15.1584L3.91897
19.4866C3.65873 20.4408 4.37706 21.3813 5.36612 21.3813H18.633C19.622
21.3813 20.3404 20.4408 20.0801 19.4866L18.8997 15.1584Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M15.7521 6.37018C15.7521 8.4424 14.0723 10.1223 12 10.1223C9.92781
10.1223 8.24794 8.4424 8.24794 6.37018C8.24794 4.29796 9.92781 2.61809 12
2.61809C14.0723 2.61809 15.7521 4.29796 15.7521 6.37018Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
<path
d="M18.8997 15.1584C18.6327 14.1795 17.7436 13.5004 16.729
13.5004H7.27011C6.25547 13.5004 5.36636 14.1795 5.09939 15.1584L3.91897
19.4866C3.65873 20.4408 4.37706 21.3813 5.36612 21.3813H18.633C19.622
21.3813 20.3404 20.4408 20.0801 19.4866L18.8997 15.1584Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/UserCross.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const UserCross = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M7.27023 13.4973H16.7295C17.7442 13.4973 18.6334 14.1765 18.9003
15.1555L20.0811 19.4867C20.3412 20.4409 19.6229 21.3813 18.6339
21.3813H5.36579C4.37679 21.3813 3.65847 20.4409 3.91861 19.4867L5.09946
15.1555C5.36636 14.1765 6.25552 13.4973 7.27023 13.4973Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M15.7522 6.37019C15.7522 8.44241 14.0723 10.1223 12.0001 10.1223C9.9279
10.1223 8.24803 8.44241 8.24803 6.37019C8.24803 4.29797 9.9279 2.6181
12.0001 2.6181C14.0723 2.6181 15.7522 4.29797 15.7522 6.37019Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12.75 21.3813H5.36602C4.37702 21.3813 3.6587 20.4409 3.91884
19.4867L5.09969 15.1555C5.36659 14.1765 6.25575 13.4973 7.27046
13.4973H12.75M15.75 14.25L19.5 18M19.5 18L23.25 21.75M19.5 18L15.75
21.75M19.5 18L23.25 14.25M15.7522 6.37019C15.7522 8.44241 14.0723 10.1223
12.0001 10.1223C9.9279 10.1223 8.24803 8.44241 8.24803 6.37019C8.24803
4.29797 9.9279 2.6181 12.0001 2.6181C14.0723 2.6181 15.7522 4.29797
15.7522 6.37019Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/UserPlus.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const UserPlus = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M7.27033 13.4973H16.7296C17.7443 13.4973 18.6334 14.1765 18.9004
15.1555L20.0812 19.4867C20.3413 20.4409 19.623 21.3813 18.634
21.3813H5.36589C4.37688 21.3813 3.65857 20.4409 3.91871 19.4867L5.09956
15.1555C5.36646 14.1765 6.25561 13.4973 7.27033 13.4973Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M15.7521 6.37019C15.7521 8.44241 14.0723 10.1223 12 10.1223C9.92781
10.1223 8.24794 8.44241 8.24794 6.37019C8.24794 4.29797 9.92781 2.6181 12
2.6181C14.0723 2.6181 15.7521 4.29797 15.7521 6.37019Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12.75 21.3813H5.36594C4.37693 21.3813 3.65862 20.4409 3.91876
19.4867L5.09961 15.1555C5.36651 14.1765 6.25567 13.4973 7.27038
13.4973H12.75M19.4999 13.5V18M19.4999 18V22.5M19.4999 18H23.9999M19.4999
18H14.9999M15.7521 6.37019C15.7521 8.44241 14.0723 10.1223 12
10.1223C9.92781 10.1223 8.24794 8.44241 8.24794 6.37019C8.24794 4.29797
9.92781 2.6181 12 2.6181C14.0723 2.6181 15.7521 4.29797 15.7521 6.37019Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/UserTick.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const UserTick = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M7.27024 13.4973H16.7295C17.7442 13.4973 18.6334 14.1765 18.9003
15.1555L20.0811 19.4867C20.3413 20.4409 19.6229 21.3813 18.6339
21.3813H5.3658C4.37679 21.3813 3.65848 20.4409 3.91862 19.4867L5.09947
15.1555C5.36637 14.1765 6.25552 13.4973 7.27024 13.4973Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M15.7522 6.37019C15.7522 8.44241 14.0723 10.1223 12.0001 10.1223C9.9279
10.1223 8.24803 8.44241 8.24803 6.37019C8.24803 4.29797 9.9279 2.6181
12.0001 2.6181C14.0723 2.6181 15.7522 4.29797 15.7522 6.37019Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12.75 21.3813H5.36602C4.37702 21.3813 3.6587 20.4409 3.91884
19.4867L5.09969 15.1555C5.36659 14.1765 6.25575 13.4973 7.27046
13.4973H12.75M14.25 18L17.25 21L23.25 15M15.7522 6.37019C15.7522 8.44241
14.0723 10.1223 12.0001 10.1223C9.9279 10.1223 8.24803 8.44241 8.24803
6.37019C8.24803 4.29797 9.9279 2.6181 12.0001 2.6181C14.0723 2.6181
15.7522 4.29797 15.7522 6.37019Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Video.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Video = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M12 22.8797C18.0087 22.8797 22.8797 18.0087 22.8797 12C22.8797 5.99133
18.0087 1.12034 12 1.12034C5.99133 1.12034 1.12034 5.99133 1.12034
12C1.12034 18.0087 5.99133 22.8797 12 22.8797ZM8.62501 17.2318V6.755L16.89
12.0078L8.62501 17.2318Z"
fill={backgroundColor}
fillOpacity="1"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Wallet.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Wallet = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M21.375 8.62683H2.625V19.875H21.375V8.62683Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M21 4.125H2.625V8.85142M2.625 8.62683H21.375V19.875H2.625V8.62683Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
<path
d="M18.0002 15.3694C18.0002 15.9907 17.4965 16.4944 16.8752
16.4944C16.2539 16.4944 15.7502 15.9907 15.7502 15.3694C15.7502 14.7481
16.2539 14.2444 16.8752 14.2444C17.4965 14.2444 18.0002 14.7481 18.0002
15.3694Z"
fill={lineColor}
fillOpacity="1"
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Warning.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Warning = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<>
<path
d="M2.32142 21.375H21.6775C22.0524 21.375 22.294 20.9777 22.1214
20.6448L12.4439 1.981C12.2573 1.62122 11.7427 1.62121 11.5561
1.98099L1.87755 20.6448C1.70496 20.9777 1.9465 21.375 2.32142 21.375Z"
fill={backgroundColor}
fillOpacity="1"
/>
<path
d="M12 9V15M12 16.5V18.75M11.5561 1.98099L1.87755 20.6448C1.70496 20.9777
1.9465 21.375 2.32142 21.375H21.6775C22.0524 21.375 22.294 20.9777 22.1214
20.6448L12.4439 1.981C12.2573 1.62122 11.7427 1.62121 11.5561 1.98099Z"
stroke={lineColor}
strokeWidth={strokeWidth}
/>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Withdraw.tsx
import React from "react";
import { IconPathProps } from "../../types";
export const Withdraw = ({ lineColor, strokeWidth }: IconPathProps) => (
<path
d="M12 8.40001C12 8.40001 12 4.80002 7.5 4.80002M7.5 4.80002C3 4.80002 3
8.40001 3 8.40001C3 9.60001 3 10.8 7.5 12C12 13.2 12 14.4 12 15.6C12 15.6 12
19.2 7.5 19.2M7.5 4.80002V1.5M7.5 19.2C3 19.2 3 15.6 3 15.6M7.5
19.2V22.5M21.75 11.625L18 15.375L14.25 11.625M18 7.5V15.293"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/Pin.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const Pin = ({
backgroundColor,
lineColor,
strokeWidth
}: IconPathWithBackgroundProps) => (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M9 0C12.3137 0 15 2.66867 15 5.96065C15 7.1848 14.6285 8.32277 13.9915
9.26937L9.39371 16.7796C9.26127 16.996 8.97736 17.0648 8.75956
16.9332C8.6965 16.8951 8.64355 16.8425 8.60516 16.7799L3.94032
9.17023C3.34643 8.24464 3 7.14284 3 5.96065C3 2.66867 5.68629 0 9 0ZM9
0.917023C6.19609 0.917023 3.92308 3.17513 3.92308 5.96065C3.92308 6.84849
4.15368 7.70185 4.59125 8.46656L8.99908 15.6591L13.2241 8.75969C13.7313
8.00606 14.0252 7.13229 14.0707 6.21257L14.0769 5.96065C14.0769 3.17513
11.8039 0.917023 9 0.917023ZM9 2.75107C10.7843 2.75107 12.2308 4.18805
12.2308 5.96065C12.2308 7.73325 10.7843 9.17023 9 9.17023C7.2157 9.17023
5.76923 7.73325 5.76923 5.96065C5.76923 4.18805 7.2157 2.75107 9 2.75107ZM9
3.66809C7.7255 3.66809 6.69231 4.69451 6.69231 5.96065C6.69231 7.22679
7.7255 8.25321 9 8.25321C10.2745 8.25321 11.3077 7.22679 11.3077
5.96065C11.3077 4.69451 10.2745 3.66809 9 3.66809Z"
stroke={lineColor}
strokeWidth={strokeWidth}
strokeLinejoin="round"
fill={backgroundColor}
/>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/components/IconPaths/DoubleChevronLeftRight.tsx
import React from "react";
import { IconPathWithBackgroundProps } from "../../types";
export const DoubleChevronLeftRight = ({
backgroundColor = "#fff",
lineColor
}: IconPathWithBackgroundProps) => (
<>
<g id="Alternate" clipPath="url(#clip0_34418_4688)">
<path
d="M8.25 8.24985C8.25 8.66406 8.58579 8.99985 9 8.99985L17.5 8.99985L15.6281 10.9654C15.3424 11.2653 15.354 11.7401 15.654 12.0257L16.7401 13.0602C16.8842 13.1974 17.0768 13.2717 17.2757 13.2669C17.4746 13.262 17.6632 13.1784 17.8005 13.0343L22.0862 8.5343C22.638 7.95502 22.638 7.04478 22.0862 6.4655L17.8005 1.9655C17.6632 1.82141 17.4746 1.73781 17.2757 1.73294C17.0768 1.72807 16.8842 1.80235 16.7401 1.93957L15.654 2.97406C15.354 3.25972 15.3424 3.7345 15.6281 4.03446L17.5 5.99985L9 5.99985C8.80109 5.99985 8.61032 6.07887 8.46968 6.21951C8.32904 6.36015 8.25 6.55092 8.25 6.74985L8.25 8.24985Z"
fill={backgroundColor}
stroke={lineColor}
strokeLinejoin="round"
/>
<path
d="M15.75 15.7501C15.75 15.5512 15.671 15.3604 15.5303 15.2198C15.3897 15.0792 15.1989 15.0001 15 15.0001L6.5 15.0001L8.37193 13.0346C8.51596 12.8974 8.59024 12.7048 8.58537 12.5059C8.58049 12.307 8.49689 12.1184 8.3528 11.9829L7.2601 10.9397C6.96013 10.6541 6.48535 10.6657 6.1997 10.9657L1.91399 15.4657C1.36223 16.045 1.36223 16.9553 1.91399 17.5346L6.1997 22.0346C6.33702 22.1787 6.5256 22.2623 6.72446 22.2671C6.92333 22.2719 7.11595 22.1976 7.2601 22.0604L8.3528 21.0171C8.65277 20.7314 8.66438 20.2567 8.37193 19.9657L6.5 18.0001L15 18.0001C15.4142 18.0001 15.75 17.6643 15.75 17.2501L15.75 15.7501Z"
fill={backgroundColor}
stroke={lineColor}
strokeLinejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_34418_4688">
<rect width="24" height="24" fill={backgroundColor} />
</clipPath>
</defs>
</>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/icon/iconContent.tsx
import React from "react";
import * as IconPaths from "../../../web/components/Icon/components/IconPaths";
import { IconContentProps, IconNames } from "./types";
const IconContent = ({
iconName,
lineColor,
backgroundColor,
strokeWidth
}: IconContentProps) =>
React.createElement(IconPaths[iconName as IconNames], {
lineColor,
backgroundColor,
strokeWidth
});
export default React.memo(IconContent);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/icon/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { space } from "../../theming/styledSystem";
export const Container = styled(View)(space);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/icon/constraints.ts
import { DefaultIconsColor } from "../../../web/components/Icon/types";
export const defaultIconColor: Partial<DefaultIconsColor> = {
info: {
background: "blue_accent.200",
line: "blue_accent.600"
},
exclamation: {
background: "yellow.200",
line: "yellow.700"
},
support: {
background: "blue_accent.200",
line: "blue_accent.600"
},
error: {
background: "red.100",
line: "red.600"
},
success: {
background: "green.100",
line: "green.600"
},
warning: {
background: "orange.200",
line: "orange.700"
},
changes: {
background: "orange.400",
line: "grey.900"
},
optedIn: {
background: "green.100",
line: "green.600"
},
promo: {
background: "yellow.200",
line: "yellow.800"
},
trash: {
background: "red.100",
line: "red.600"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/icon/index.tsx
import React from "react";
import Svg from "react-native-svg";
import { useColorTokens, useTheme } from "../../theming";
import { useIconSize, useQaLabel } from "../../hooks";
import IconContent from "./iconContent";
import { IconProps, IconNames } from "./types";
import { Container } from "./styled-components";
import { getDefaultColor } from "./utils";
import { useIconList, useIsValidIcon } from "./hooks/index";
export const Icon = React.memo(
({
name,
size,
lineColor,
backgroundColor,
qaLabel,
ariaLabel,
shouldUseColorTokens,
overrideSize,
...props
}: IconProps) => {
const { colors } = useTheme();
const { iconSize, strokeWidth } = useIconSize(size);
const viewTestProps = useQaLabel(qaLabel || name);
const iconColor = getDefaultColor(name, colors, {
line: lineColor,
background: backgroundColor
});
const lineColorValue =
lineColor && lineColor?.indexOf("#") > -1 ? lineColor : iconColor.line;
const backgroundColorValue =
backgroundColor &&
backgroundColor?.includes("#") &&
backgroundColor?.includes("transparent")
? backgroundColor
: iconColor.background;
return (
<Container {...props}>
<Svg
width={overrideSize ?? iconSize}
height={overrideSize ?? iconSize}
viewBox="0 0 24 24"
fill="none"
accessibilityLabel={ariaLabel || name}
// @ts-ignore
tabIndex="0"
{...viewTestProps}
{...props}
>
<IconContent
iconName={name}
lineColor={
shouldUseColorTokens ? useColorTokens(lineColor) : lineColorValue
}
backgroundColor={backgroundColorValue}
strokeWidth={strokeWidth}
/>
</Svg>
</Container>
);
}
);
export { IconNames, useIconList, useIsValidIcon };
export default Icon;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/icon/utils.ts
import { get } from "lodash";
import { DefaultColor, IconNames } from "./types";
import { defaultIconColor } from "./constraints";
import { Colors } from "../../theming";
export const getDefaultColor = (
name: IconNames,
themeColor: Colors,
colors: Partial<DefaultColor>
): DefaultColor => {
const defaultColor = get(defaultIconColor, name, {
line: "grey.800",
background: "white.000"
});
const line = get(themeColor, colors.line || defaultColor.line, colors.line);
const background = get(
themeColor,
colors.background || defaultColor.background,
colors.background
);
return {
line,
background
};
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/alertInline/components/icon/styled-components.ts
import { AlertInlineIconVariants } from "./types";
export const alertInlineIconVariants: AlertInlineIconVariants = {
success: {
backgroundColor: "green.100",
lineColor: "green.700",
name: "success"
},
informational: {
backgroundColor: "blue_accent.200",
lineColor: "blue_accent.600",
name: "info"
},
error: {
backgroundColor: "red.100",
lineColor: "red.600",
name: "exclamation"
},
warning: {
backgroundColor: "orange.200",
lineColor: "orange.700",
name: "warning"
},
promo: {
backgroundColor: "yellow.200",
lineColor: "yellow.800",
name: "promo"
}
};
export const alertToastIconVariants: AlertInlineIconVariants = {
success: {
lineColor: "white.900",
name: "success"
},
informational: {
lineColor: "white.900",
name: "info"
},
error: {
lineColor: "white.900",
name: "exclamation"
},
warning: {
lineColor: "white.900",
name: "warning"
},
promo: {
lineColor: "grey.900",
name: "promo"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/alertInline/components/icon/index.tsx
import React, { memo } from "react";
import { EventsState } from "../../../../hooks/useEvents";
import { Icon } from "../../../icon";
import { SpaceProps } from "../../../../theming/styledSystem";
import { AlertInlineStyleProps, AlertInlineVariants } from "../../types";
import {
alertInlineIconVariants,
alertToastIconVariants
} from "./styled-components";
import { getPressableColor } from "../../utils/getPressableColor";
export const AlertInlineIcon = memo(
({
type = "floating",
variant,
isClose = false,
events,
icon,
...rest
}: AlertInlineStyleProps &
SpaceProps & { isClose?: boolean; events?: EventsState }) => {
const { backgroundColor, lineColor, name } =
type === "toast"
? alertToastIconVariants[variant as AlertInlineVariants]
: alertInlineIconVariants[variant as AlertInlineVariants];
return (
<Icon
size="s"
name={isClose ? "close" : icon || name}
backgroundColor={backgroundColor || "none"}
lineColor={
isClose ? getPressableColor(type, variant, events) : lineColor
}
qaLabel={`alert-inline-icon-${isClose ? "close" : name}`}
{...rest}
/>
);
}
);
export default AlertInlineIcon;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/alertInline/index.tsx
import React, {
useState,
useEffect,
useRef,
memo,
isValidElement,
cloneElement,
forwardRef
} from "react";
import { View, Animated, Platform, Pressable } from "react-native";
import { AlertInlineProps, AlertInlineCompoundComponent } from "./types";
import {
AlertInlineContainer,
AlertInlineMessage,
AlertInlineTitle,
AlertInlineIconWrapper,
AlertInlineInfo,
AlertInlineActions
} from "./styled-components";
import { Icon as AlertInlineIcon, Link as AlertInlineLink } from "./components";
import { useEvents } from "../../hooks/useEvents";
import { useQaLabel } from "../../hooks/useQaLabel";
const isWeb = Platform.OS === "web";
export const AlertInline = memo(
forwardRef<View, AlertInlineProps>(
(
{
message,
title,
qaLabel,
variant = "informational",
type = "floating",
hasDismissButton = false,
hasDismissAnimation = true,
onDismissPress,
actionLink,
icon,
hasRoundedStyle,
isFullWidth = true,
children,
...styledSystemProps
}: AlertInlineProps,
ref
) => {
const [isVisible, setVisibility] = useState(true);
const [hasAnimationEnded, setAnimationEnded] = useState(false);
const opacity = useRef(new Animated.Value(1)).current;
const hasTitleAndMessage = !!(title && message);
const hasOnDismissPress = !!(
hasDismissButton ||
(onDismissPress && typeof onDismissPress === "function")
);
const hasLink = !!(actionLink && isValidElement(actionLink));
const { events, eventsHandlers } = useEvents({});
const dismissTestProps = useQaLabel("alert-inline-dismiss");
useEffect(() => {
if (hasDismissAnimation && !isVisible) {
Animated.timing(opacity, {
toValue: 0,
duration: 400,
useNativeDriver: !isWeb
}).start(() => setAnimationEnded(true));
}
}, [isVisible, hasDismissAnimation]);
const display = hasAnimationEnded ? "none" : "flex";
return (
<Animated.View style={{ opacity, display }}>
<AlertInlineContainer
variant={variant}
type={type}
hasOnDismissPress={hasOnDismissPress}
hasRoundedStyle={hasRoundedStyle}
isFullWidth={isFullWidth}
ref={ref}
qaLabel={qaLabel}
{...styledSystemProps}
>
<AlertInlineIconWrapper hasRoundedStyle={hasRoundedStyle}>
<AlertInlineIcon variant={variant} type={type} icon={icon} />
</AlertInlineIconWrapper>
<AlertInlineInfo
hasRoundedStyle={hasRoundedStyle}
hasLink={hasLink}
hasTitleAndMessage={hasTitleAndMessage}
>
{typeof title === "string" && title !== "" && (
<AlertInlineTitle
variant={variant}
type={type}
hasRoundedStyle={hasRoundedStyle}
hasLink={hasLink}
>
{isWeb ? (
<span
dangerouslySetInnerHTML={{
__html: title
}}
/>
) : (
title
)}
</AlertInlineTitle>
)}
<AlertInlineMessage
variant={variant}
type={type}
hasLink={hasLink}
hasRoundedStyle={hasRoundedStyle}
hasTitleAndMessage={hasTitleAndMessage}
qaLabel="alert-inline-message"
>
{children}
{isWeb ? (
<span
dangerouslySetInnerHTML={{
__html: message
}}
/>
) : (
message
)}
</AlertInlineMessage>
{hasLink &&
cloneElement(actionLink, { variant, type } as Partial<unknown>)}
</AlertInlineInfo>
{hasOnDismissPress && (
<AlertInlineActions hasRoundedStyle={hasRoundedStyle}>
<Pressable
onPress={(e) => {
if (typeof onDismissPress === "function") onDismissPress(e);
setVisibility(false);
}}
accessibilityRole="button"
{...eventsHandlers}
{...dismissTestProps}
>
<AlertInlineIcon
p="space-4"
type={type}
variant={variant}
events={events}
isClose
/>
</Pressable>
</AlertInlineActions>
)}
</AlertInlineContainer>
</Animated.View>
);
}
)
) as AlertInlineCompoundComponent<typeof AlertInlineLink>;
export type { AlertInlineProps };
AlertInline.Link = AlertInlineLink;
export default AlertInline;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/alertInline/components/link/index.tsx
import React from "react";
import { View } from "react-native";
import { useEvents } from "../../../../hooks/useEvents";
import { AlertInlineLinkProps } from "../../types";
import { StyledLink } from "./styled-components";
export const AlertInlineLink = ({
type,
variant,
...props
}: AlertInlineLinkProps) => {
const { events, eventsHandlers } = useEvents({});
return (
<View {...eventsHandlers}>
<StyledLink {...props} variant={variant} type={type} events={events} />
</View>
);
};
export type { AlertInlineLinkProps };
export default AlertInlineLink;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/badge/utils/calculate-badge-width/index.ts
const CHAR_WIDTH_PX = 7;
const BADGE_PADDING_X = 12;
const BADGE_WIDTH_DEFAULT = 16;
export const calculateBadgeWidth = (counter: number, counterLimit?: number) => {
const valueOfNotifications =
counterLimit && counter > counterLimit ? `${counterLimit}+` : counter;
const counterLength = String(valueOfNotifications).length;
const width = CHAR_WIDTH_PX * counterLength;
return counterLength === 1 ? BADGE_WIDTH_DEFAULT : width + BADGE_PADDING_X;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/types/bets.ts
export enum BetTypeCodesEnum {
EXACTA = "EX",
EXACTA_KEY_BOX = "EKB",
PLACE = "PL",
SHOW = "SH",
SUPERFECTA = "SU",
SUPERHIGHFIVE = "SH5",
TRIFECTA = "TR",
WIN = "WN",
WIN_PLACE = "WP",
PLACE_SHOW = "PS",
WIN_SHOW = "WS",
WIN_PLACE_SHOW = "WPS"
}
export enum BetTypeCodesReversedEnum {
EX = "Exacta",
EKB = "Exacta/Key/Box",
PL = "Place",
SH = "Show",
SU = "Superfecta",
SH5 = "Super high five",
TR = "Trifecta",
WN = "Win",
WP = "Win/Place",
WPS = "Win/Place/Show"
}
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/badge/components/badge-counter/styled-components.ts
import styled from "styled-components/native";
import { BadgeContainerProps } from "../../types";
import { space } from "../../../../theming/styledSystem";
import { themeGet } from "../../../../theming";
export const BadgeContainer = styled.View<BadgeContainerProps>`
background-color: ${(props) =>
props.variant === "primary"
? props.theme.colors.red[500]
: props.theme.colors.blue_accent[500]};
border-radius: 12px;
height: 16px;
justify-content: center;
max-width: ${(props) => props.badgeWidth}px;
min-width: 16px;
padding: ${(props) =>
props.isCircle ? "0" : `1px ${props.theme.space["space-2"]}`};
${space};
`;
export const BadgeText = styled.Text`
color: ${themeGet("colors.white.900")};
font-family: ${themeGet("fonts.condensedRegular")};
font-size: ${themeGet("fontSizes.xs")};
text-align: center;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/badge/components/badge-counter/index.tsx
import React, { forwardRef, memo } from "react";
import { View } from "react-native";
import { BadgeCounterProps } from "../../types";
import { useQaLabel } from "../../../../hooks";
import { calculateBadgeWidth } from "../../utils";
import { BadgeContainer, BadgeText } from "./styled-components";
export const BadgeCounter = memo(
forwardRef<View, BadgeCounterProps>(
(
{
qaLabel = "badge",
counter,
counterLimit = 99,
variant = "primary",
accessibilityLabel,
...rest
}: BadgeCounterProps,
ref
) => {
const viewTestProps = useQaLabel(qaLabel);
const valueOfNotifications =
counterLimit && counter > counterLimit ? `${counterLimit}+` : counter;
return (
<BadgeContainer
{...viewTestProps}
variant={variant}
accessibilityLabel={
accessibilityLabel || `${valueOfNotifications} notifications`
}
badgeWidth={calculateBadgeWidth(counter, counterLimit)}
// @ts-ignore
ref={ref}
isCircle={String(valueOfNotifications).length === 1}
{...rest}
>
<BadgeText selectable={false}>{valueOfNotifications}</BadgeText>
</BadgeContainer>
);
}
)
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/badge/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { themeGet } from "../../theming";
import { space } from "../../theming/styledSystem";
import { BadgeWidthProps } from "./types";
export const WrapperContainer = styled(View)`
margin: ${themeGet("space.space-3")};
flex-direction: row;
position: relative;
${space}
`;
export const ChildrenContainer = styled(View)`
position: relative;
width: auto;
`;
export const Positioner = styled(View)<BadgeWidthProps>`
position: absolute;
flex-wrap: wrap;
top: -20%;
right: -${(props) => props.badgeWidth * 0.5}px;
min-width: ${(props) => props.badgeWidth}px;
elevation: 1;
z-index: 1;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/badge/index.tsx
import React, { memo, forwardRef } from "react";
import { View } from "react-native";
import { useQaLabel } from "../../hooks/useQaLabel";
import { calculateBadgeWidth } from "./utils";
import { BadgeProps, BadgeCounterProps, BadgeCompoundComponent } from "./types";
import { BadgeCounter } from "./components";
import {
WrapperContainer,
Positioner,
ChildrenContainer
} from "./styled-components";
export const Badge = memo(
forwardRef<View, BadgeProps>(
({ children, ...badgeInnerProps }: BadgeProps, ref) => {
const containerQaProps = useQaLabel("badge-container");
return (
<WrapperContainer {...containerQaProps}>
<ChildrenContainer>
<Positioner
badgeWidth={calculateBadgeWidth(
badgeInnerProps.counter,
badgeInnerProps.counterLimit
)}
pointerEvents="none"
>
<BadgeCounter {...badgeInnerProps} ref={ref} />
</Positioner>
{children}
</ChildrenContainer>
</WrapperContainer>
);
}
)
) as BadgeCompoundComponent<typeof BadgeCounter>;
Badge.Counter = BadgeCounter;
export type { BadgeProps, BadgeCounterProps };
export default Badge;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betButtons/styled-components.ts
import styled, { css } from "styled-components/native";
import { View } from "react-native";
export const Container = styled(View)`
flex-direction: row;
`;
export const ButtonGroup = styled(View)<{
hasMaxWidth?: boolean;
isSimpleBetButtons?: boolean;
}>`
flex-direction: row;
border-radius: ${({ theme }) => theme.radii.xs};
box-shadow: ${({ theme }) => theme.elevations.low};
overflow: hidden;
${({ hasMaxWidth, isSimpleBetButtons }) =>
hasMaxWidth &&
css`
width: ${isSimpleBetButtons ? "151px" : "220px"};
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betButtons/components/button/styled-components.ts
import styled, { css } from "styled-components/native";
import { useQaLabel, useQaLabelActive } from "../../../../hooks";
import { space } from "../../../../theming/styledSystem";
import { StyledButtonProps, ButtonContainerProps } from "./types";
import { Theme } from "../../../../theming/types";
export const ButtonContainer = styled.View<ButtonContainerProps>`
${space};
position: relative;
z-index: ${({ isActive, isHovering }) =>
isActive || isHovering ? "1" : "0"};
flex-direction: row;
${({ isFullWidth }) =>
isFullWidth &&
css`
flex-grow: 1;
flex-basis: 0;
flex-shrink: 0;
`}
`;
export const StyledButton = styled.TouchableHighlight.attrs<{
qaLabel: string;
isActive: boolean;
theme: Theme;
}>((props) => ({
accessibilityRole: "button",
underlayColor:
props.theme.colorTokens.component.button.secondary.background.hover,
...useQaLabelActive(props.qaLabel, props.isActive ? "selected" : "")
}))<StyledButtonProps>`
${space};
align-self: flex-start;
flex-grow: 0;
align-items: center;
justify-content: center;
height: 42px;
padding: 0 ${({ theme }) => theme.space["space-5"]};
${({ hasBorderRadius }) =>
hasBorderRadius &&
css`
border-radius: ${({ theme }) => theme.radii.xs};
`}
${({ hasShadow }) =>
hasShadow &&
css`
box-shadow: ${({ theme }) => theme.elevations.low};
`}
${({ isFullWidth }) =>
isFullWidth &&
css`
flex-grow: 1;
flex-basis: 0;
flex-shrink: 0;
padding: 0;
`}
${({ isHovering }) =>
isHovering &&
css`
background-color: ${({ theme }) =>
theme.colorTokens.component.button.buttonLink.background.hover};
`}
${({ isActive }) =>
isActive &&
css`
background-color: ${({ theme }) =>
theme.colorTokens.component.button.secondary.background.hover};
`}
${({ isActive, isHovering }) =>
isActive &&
isHovering &&
css`
background-color: ${({ theme }) =>
theme.colorTokens.component.button.secondary.background.base};
`}
`;
export const ButtonText = styled.Text.attrs<{ qaLabel: string }>((props) => ({
...useQaLabel(props.qaLabel)
}))<{
isActive: boolean;
isHovering: boolean;
qaLabel: string;
color: string;
theme: Theme;
children?: React.ReactNode;
}>`
font-family: ${({ theme }) => theme.fonts.medium};
font-size: ${({ theme }) => theme.fontSizes.s};
font-weight: ${({ theme }) => theme.fontWeights.medium};
color: ${({ theme, color }) =>
color || theme.colorTokens.component.button.tertiary.content.base};
`;
export const ButtonRing = styled.View<{
isLastChild?: boolean;
isFirstChild?: boolean;
isActive: boolean;
isHovering: boolean;
theme: Theme;
}>`
position: absolute;
top: 0;
right: ${({ isLastChild }) => (isLastChild ? "0" : "-1px")};
bottom: 0;
left: 0;
border: 1px solid
${({ theme }) => theme.colorTokens.component.button.tertiary.border.base};
${({ isFirstChild }) =>
isFirstChild &&
css`
border-bottom-left-radius: ${({ theme }) => theme.radii.xs};
border-top-left-radius: ${({ theme }) => theme.radii.xs};
`}
${({ isLastChild }) =>
isLastChild &&
css`
border-bottom-right-radius: ${({ theme }) => theme.radii.xs};
border-top-right-radius: ${({ theme }) => theme.radii.xs};
`}
${({ isHovering }) =>
isHovering &&
css`
border: 1px solid
${({ theme }) =>
theme.colorTokens.component.button.tertiary.border.hover};
`}
${({ isActive }) =>
isActive &&
css`
border: 1px solid
${({ theme }) =>
theme.colorTokens.component.button.tertiary.border.active};
`}
`;
export const TextContainer = styled.View<{ children?: React.ReactNode }>`
flex-direction: row;
align-items: center;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/hooks/useQaLabelActive.ts
import { Platform } from "react-native";
type QaLabelActiveWeb = {
dataSet: { "qa-label": string; "qa-active": string };
};
type QaLabelActiveNative = {
"data-qa-label": string;
"data-qa-active": string;
};
/**
* Web and Native require different implementations of the data-qal-label and data-qa-active, this hook encapsulates that logic
*
* Usage:
* const elementTestProps = useQaLabelActive('qa-label-goes-here', 'active-label-goes-here')
* <Element {...elementTestProps} />
*/
export const useQaLabelActive = (
qaLabel: string,
activeLabel: string
): QaLabelActiveWeb | QaLabelActiveNative =>
Platform.OS === "web"
? { dataSet: { "qa-label": qaLabel, "qa-active": activeLabel } }
: { "data-qa-label": qaLabel, "data-qa-active": activeLabel };
export default useQaLabelActive;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betButtons/index.tsx
import React, { memo, useState } from "react";
import BetUtils from "@tvg/utils/betSelection";
import { ButtonGroup, Container } from "./styled-components";
import {
BetButtonsProps,
BetTypeCodesEnum,
BetTypeCodesReversedEnum
} from "./types";
import { Button } from "./components";
const getIcon = (
columnCount: number,
isActive: boolean,
isKey: boolean,
position: number
) => {
if (isKey) {
const keyVariantsIcon = position === 0 ? "key" : "plus";
return isActive ? "tick" : keyVariantsIcon;
}
if (columnCount > 1) {
return undefined;
}
return isActive ? "tick" : "plus";
};
export const BetButtons = memo(
({ wagerType, onPress, activeButtons }: BetButtonsProps) => {
if (!wagerType) {
return null;
}
const [isHoveringAll, setIsHoveringAll] = useState(false);
const { isKey = false, specialGroup = false } = wagerType || {};
const buttonNames = BetUtils.getWagerTypesNames(wagerType);
const columnCount = wagerType?.columnCount || 1;
const buttonLabel = columnCount > 1 && !specialGroup ? "exotic" : "simple";
return (
<Container>
<ButtonGroup
hasMaxWidth={columnCount !== 1}
isSimpleBetButtons={specialGroup}
>
{Array(columnCount)
.fill(null)
.map((_, i) => (
<Button
key={i.toString()}
text={buttonNames[i]}
icon={getIcon(columnCount, activeButtons[i], isKey, i)}
onPress={() => onPress(buttonNames[i], activeButtons[i], i)}
qaLabel={`bet-button-${buttonLabel}-${buttonNames[
i
]?.toLowerCase()}`}
isSelected={activeButtons[i]}
isFullWidth={columnCount !== 1}
isFirstChild={i === 0}
isLastChild={i === columnCount - 1}
isHoveringAll={isHoveringAll}
/>
))}
</ButtonGroup>
{columnCount > 1 && specialGroup && (
<Button
ml="space-4"
text="Across the board"
onPress={() =>
onPress(
"Across the board",
activeButtons.every((isActive) => isActive)
)
}
qaLabel="bet-button-across-the-board"
isSelected={activeButtons.every((isActive) => isActive)}
isLastChild
isFirstChild
hasShadow
onMouseEnter={() => setIsHoveringAll(true)}
onMouseLeave={() => setIsHoveringAll(false)}
/>
)}
</Container>
);
}
);
export { BetTypeCodesEnum, BetTypeCodesReversedEnum };
export type { BetButtonsProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/typography/header/styled-components.ts
import styled from "styled-components/native";
import { Text } from "react-native";
import {
color,
space,
variant,
compose,
layout,
system,
typography
} from "styled-system";
import { HeaderProps } from "./types";
const systemProps = system({
textTransform: {
property: "textTransform"
},
whiteSpace: {
property: "whiteSpace"
},
textOverflow: {
property: "textOverflow"
}
});
const styles = compose(
color,
space,
systemProps,
typography,
layout,
variant({
prop: "tag",
scale: "headingSizes"
})
);
export const StyledHeader = styled(Text).attrs<HeaderProps>(
({ tag, textOverflow }) => ({
accessibilityLevel: tag && tag.replace("h", ""),
overflow: textOverflow === "ellipsis" ? "hidden" : "visible"
})
)<HeaderProps>`
${styles}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/typography/header/index.tsx
import React, { FC, memo } from "react";
import { useQaLabel } from "../../../hooks";
import { StyledHeader } from "./styled-components";
import { HeaderProps } from "./types";
const Header: FC<HeaderProps> = memo(
({
children,
fontFamily = "medium",
textOverflow = "clip",
whiteSpace = "normal",
color = "grey.900",
tag = "h1",
qaLabel = "header",
...rest
}) => (
<StyledHeader
accessibilityRole="header"
fontFamily={fontFamily}
color={color}
tag={tag}
textOverflow={textOverflow}
whiteSpace={whiteSpace}
{...useQaLabel(qaLabel)}
{...rest}
>
{children}
</StyledHeader>
)
);
export { Header };
export type { HeaderProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/saddleSelections/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { css } from "styled-components";
import { useQaLabel } from "../../hooks";
import { Paragraph } from "../typography";
export const Selections = styled(View)`
flex-flow: row wrap;
row-gap: ${({ theme }) => theme.space["space-1"]};
`;
export const IconContainer = styled(View)`
align-items: center;
flex-direction: row;
height: ${({ theme }) => theme.space["space-6"]};
margin-right: ${({ theme }) => theme.space["space-1"]};
width: ${({ theme }) => theme.space["space-6"]};
`;
export const SaddleSelectionContainer = styled(View)<{
isDetailView: boolean;
hasThirdColumn: boolean;
}>`
${({ isDetailView }) =>
isDetailView ? "flex-direction: column" : "flex-direction: row"};
flex-wrap: wrap;
row-gap: 6px;
width: 100%;
`;
export const RowContainer = styled(View)<{
isDetailView: boolean;
showReplacedRunners?: boolean;
}>`
${({ isDetailView, theme }) =>
isDetailView
? `display: grid;
column-gap: ${theme.space["space-3"]};
row-gap: ${theme.space["space-4"]};
grid-template-columns: min-content 1fr min-content;`
: "display: flex; flex-direction: row;"}
${({ isDetailView, showReplacedRunners }) =>
isDetailView &&
showReplacedRunners &&
css`
display: flex;
flex-direction: row;
column-gap: 0;
`}
`;
export const SaddleDetailsParagraph = styled(Paragraph)<{ scratched: boolean }>`
${({ scratched }) => scratched && "text-decoration: line-through;"}
font-size: 14px;
color: ${({ theme }) => theme.colorTokens.content.default};
`;
export const WillPaysContainer = styled(View)`
font-size: 14px;
`;
export const AlternateContainer = styled(View)`
display: flex;
align-items: center;
flex-direction: row;
`;
export const AlternateDivider = styled(View)<{ isDark: boolean }>`
height: 12px;
width: 1px;
background-color: ${({ theme, isDark }) =>
isDark
? theme.colorTokens.content.onLight
: theme.colorTokens.content.onDark};
margin-right: 4px;
`;
export const IconContainerAlternate = styled.View.attrs<{ qaLabel: string }>(
(props) => ({
...useQaLabel(props.qaLabel)
})
)<{
qaLabel: string;
}>`
align-items: center;
flex-direction: row;
height: 20px;
margin-right: 4px;
width: 20px;
position: relative;
`;
export const IconWrapper = styled(View)`
position: absolute;
top: -8px;
right: -8px;
z-index: 99;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/hooks/useColorTokens/index.ts
import { useContext } from "react";
import { get } from "lodash";
import { ThemeContext } from "styled-components";
export const useColorTokens = (value?: string) => {
const useTheme = () => useContext(ThemeContext);
const { colorTokens } = useTheme();
if (value) {
const tokenValue = get(colorTokens, value);
if (!tokenValue && process.env.NODE_ENV !== "production") {
throw new Error(`Invalid color token: ${value}`);
}
return tokenValue;
}
return colorTokens;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/saddle/styled-components.ts
import styled, { css } from "styled-components/native";
import { space } from "styled-system";
import { View } from "react-native";
import { Paragraph } from "../typography";
import { SaddleProps } from "./types";
import Icon from "../icon";
export const StyledSaddle = styled(View)<
Pick<
SaddleProps,
| "all"
| "saddleColor"
| "fullHeight"
| "isScratched"
| "size"
| "raceFinished"
| "enableMyBetsBehavior"
>
>`
align-items: center;
background-color: ${({ saddleColor }) => saddleColor};
border-radius: 2px;
display: flex;
position: relative;
justify-content: center;
opacity: ${({ isScratched }) => (isScratched ? 0.4 : 1)};
${({ size, fullHeight, all }) => {
if (fullHeight && size !== "s") {
return css`
flex-grow: 1;
height: 100%;
width: 32px;
`;
}
if (all === true && size === "s") {
return css`
width: 44px;
height: 20px;
`;
}
return css`
height: ${size === "s" ? "20px" : "44px"};
width: ${size === "s" ? "20px" : "32px"};
`;
}}
${space};
${({ enableMyBetsBehavior, raceFinished }) =>
enableMyBetsBehavior && `opacity: ${raceFinished ? 0.2 : 1}`}
`;
export const Scratcher = styled(View)<{ size: string }>`
position: absolute;
height: 20px;
width: 20px;
border: 2px solid ${({ theme }) => theme.colorTokens.content.default};
overflow: hidden;
z-index: 2;
`;
export const DiagonalLine = styled(View)`
position: absolute;
width: 141.42%;
height: 2px;
background-color: ${({ theme }) => theme.colorTokens.content.default};
top: 50%;
left: -22.85%;
transform: rotate(135deg);
opacity: 1;
`;
export const StyledParagraph = styled(Paragraph)<Pick<SaddleProps, "size">>`
font-family: ${({ size, theme }) =>
size === "s" ? theme.fonts.medium : theme.fonts.bold};
font-size: ${({ size }) => (size === "s" ? "12px" : "18px")};
text-align: center;
line-height: ${({ size }) => (size === "s" ? "15px" : "22px")};
`;
export const WinnerIconWrapper = styled(View)`
position: absolute;
bottom: -4px;
right: -4px;
width: 12px;
height: 12px;
background: ${({ theme }) => theme.colors.green["500"]};
border-radius: 50%;
border: 1px solid ${({ theme }) => theme.colors.green["000"]};
z-index: 2;
`;
export const WinnerIcon = styled(Icon)`
position: absolute;
top: 0.5px;
left: 0.5px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/saddle/consts.ts
import { SaddleColors } from "./types";
export const SADDLE_COLORS: SaddleColors = {
thoroughbred: {
"1": { numberColor: "#FFFFFF", saddleColor: "#C20E0E" },
"2": { numberColor: "#000000", saddleColor: "#BCC8C8" },
"3": { numberColor: "#FFFFFF", saddleColor: "#3B4E8C" },
"4": { numberColor: "#000000", saddleColor: "#D3B13C" },
"5": { numberColor: "#FFFFFF", saddleColor: "#116410" },
"6": { numberColor: "#FFFFFF", saddleColor: "#303030" },
"7": { numberColor: "#000000", saddleColor: "#D65A2F" },
"8": { numberColor: "#000000", saddleColor: "#E095AA" },
"9": { numberColor: "#000000", saddleColor: "#2AAAA5" },
"10": { numberColor: "#FFFFFF", saddleColor: "#713A98" },
"11": { numberColor: "#FFFFFF", saddleColor: "#6B6B6B" },
"12": { numberColor: "#000000", saddleColor: "#4EA958" },
"13": { numberColor: "#FFFFFF", saddleColor: "#58514D" },
"14": { numberColor: "#FFFFFF", saddleColor: "#94335A" },
"15": { numberColor: "#FFFFFF", saddleColor: "#69522F" },
"16": { numberColor: "#FFFFFF", saddleColor: "#4C6E9F" },
"17": { numberColor: "#FFFFFF", saddleColor: "#373786" },
"18": { numberColor: "#FFFFFF", saddleColor: "#285F23" },
"19": { numberColor: "#FFFFFF", saddleColor: "#32496D" },
"20": { numberColor: "#FFFFFF", saddleColor: "#671334" }
},
harness: {
"1": { numberColor: "#FFFFFF", saddleColor: "#AF0000" },
"2": { numberColor: "#FFFFFF", saddleColor: "#253C85" },
"3": { numberColor: "#000000", saddleColor: "#B2B4B1" },
"4": { numberColor: "#FFFFFF", saddleColor: "#1C5B1B" },
"5": { numberColor: "#FFFFFF", saddleColor: "#252525" },
"6": { numberColor: "#000000", saddleColor: "#B69E00" },
"7": { numberColor: "#000000", saddleColor: "#B27492" },
"8": { numberColor: "#FFFFFF", saddleColor: "#6B6B6B" },
"9": { numberColor: "#FFFFFF", saddleColor: "#610F9A" },
"10": { numberColor: "#FFFFFF", saddleColor: "#263D88" },
"11": { numberColor: "#FFFFFF", saddleColor: "#3B5E90" },
"12": { numberColor: "#FFFFFF", saddleColor: "#A90000" },
"13": { numberColor: "#FFFFFF", saddleColor: "#1D5E1C" },
"14": { numberColor: "#FFFFFF", saddleColor: "#725933" },
"15": { numberColor: "#FFFFFF", saddleColor: "#C0C0C0" }
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/saddle/index.tsx
import React, { FC, memo } from "react";
import { get } from "lodash";
import { useColorTokens } from "@tvg/design-system/web/hooks";
import { useQaLabel } from "../../hooks";
import {
StyledSaddle,
StyledParagraph,
WinnerIconWrapper,
WinnerIcon,
Scratcher,
DiagonalLine
} from "./styled-components";
import {
SaddleProps,
Breed,
HarnessVariation,
ThoroughbredVariation,
SaddleColor
} from "./types";
import { SADDLE_COLORS } from "./consts";
const getRunnerColors = (
runnerNumber: number | string,
breed: Breed = "thoroughbred"
): SaddleColor => {
const runnerNumberInt =
typeof runnerNumber === "string"
? parseInt(runnerNumber, 10)
: runnerNumber;
const breedFilter = get(SADDLE_COLORS, `[${breed}]`) ? breed : "thoroughbred";
const { numberColor, saddleColor } = get(
SADDLE_COLORS,
`[${breedFilter}][${runnerNumberInt}]`,
get(
SADDLE_COLORS,
breedFilter === "harness"
? `[${breedFilter}][15]`
: `[${breedFilter}][20]`
)
);
return {
numberColor,
saddleColor
};
};
export const Saddle: FC<SaddleProps> = memo(
({
all,
number,
qaLabel,
numberColor,
saddleColor,
fullHeight,
size,
isWinner = false,
breed = "thoroughbred",
isScratched = false,
raceFinished = false,
enableMyBetsBehavior = false,
...rest
}) => {
const colorTokens = useColorTokens();
const viewTestProps = useQaLabel(qaLabel || `saddle-container-${number}`);
const saddleNumber =
typeof number === "number" ? number.toString() : number;
const defaultColors = getRunnerColors(number, breed);
const runnerColors: SaddleColor = {
numberColor: numberColor || defaultColors.numberColor,
saddleColor: saddleColor || defaultColors.saddleColor
};
return (
<StyledSaddle
{...viewTestProps}
all={all}
saddleColor={
all ? colorTokens.component.input.base : runnerColors.saddleColor
}
fullHeight={fullHeight}
size={size}
isScratched={isScratched}
raceFinished={raceFinished}
enableMyBetsBehavior={enableMyBetsBehavior}
{...rest}
>
{isScratched && size === "s" && enableMyBetsBehavior && (
<Scratcher size={size}>
<DiagonalLine />
</Scratcher>
)}
{isWinner && (
<WinnerIconWrapper>
<WinnerIcon
size="xs"
name="tick"
lineColor="myBets.win.dotColor"
backgroundColor="myBets.win.dotColor"
shouldUseColorTokens
/>
</WinnerIconWrapper>
)}
<StyledParagraph
fontFamily="bold"
fontSize="s"
color={all ? colorTokens.content.default : runnerColors.numberColor}
textTransform={all ? "capitalize" : "none"}
qaLabel="saddle-number"
size={size}
>
{all ? saddleNumber.toLowerCase() : saddleNumber}
</StyledParagraph>
</StyledSaddle>
);
}
);
export default Saddle;
export { SADDLE_COLORS, getRunnerColors };
export type { SaddleProps, Breed, HarnessVariation, ThoroughbredVariation };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tag/styled-components.ts
import styled, { css } from "styled-components/native";
import { Platform, View, Text } from "react-native";
import { compose, variant, margin } from "../../theming/styledSystem";
import { Paragraph } from "../typography";
import { TagVariant } from "./types";
const isWeb = Platform.OS === "web";
export const tagVariants = {
info: {
backgroundColor: "background.base",
color: "content.neutral"
},
optedin: {
backgroundColor: "background.positiveSubtle",
color: "content.positive"
},
promo: {
backgroundColor: "background.alertSubtle",
color: "content.alert"
},
warning: {
backgroundColor: "background.warningSubtle",
color: "content.warning"
},
highlight: {
backgroundColor: "background.infoSubtle",
color: "content.info"
},
fav: {
backgroundColor: "component.notification.promo.background",
color: "content.strong"
}
};
export const tagSizes = {
prop: "size",
variants: {
s: {
paddingX: "space-2",
height: "16px"
},
m: {
paddingX: "space-2",
height: "20px"
},
l: {
paddingX: "space-2",
height: "24px"
}
}
};
const stylesTagSizes = compose(variant(tagSizes));
export const styleFitContent =
isWeb &&
css`
width: fit-content;
`;
export const TagContainer = styled(View)<{
backgroundColor: string;
variant: TagVariant;
}>`
${margin}
${stylesTagSizes}
align-items: center;
align-self: flex-start;
background-color: ${({ backgroundColor }) => backgroundColor};
border-radius: 99px;
flex-direction: row;
justify-content: center;
`;
export const StyledParagraph = styled(Paragraph)`
text-transform: uppercase;
`;
export const StyledText = styled(Text)<{ color: string }>`
text-transform: uppercase;
font-family: ${({ theme }) => theme.fonts.condensedRegular};
color: ${({ color }) => color};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tag/tagIcon/styled-components.ts
import styled from "styled-components/native";
import { margin } from "styled-system";
import { View } from "react-native";
import { styleFitContent } from "../styled-components";
export const TagCircleContainer = styled(View)<{
backgroundColor: string;
}>`
${margin}
${styleFitContent}
border-radius: 99px;
padding: ${({ theme }) => theme.space["space-1"]};
align-self: flex-start;
background-color: ${({ backgroundColor }) => backgroundColor};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tag/index.tsx
import React from "react";
import { useColorTokens } from "../../theming/hooks/useColorTokens";
import { useQaLabel } from "../../hooks/useQaLabel";
import { Icon } from "../icon";
import { StyledText, TagContainer, tagVariants } from "./styled-components";
import { TagIcon } from "./tagIcon";
import { TagProps, TagVariant } from "./types";
export const Tag = ({
qaLabel = "tag",
label,
icon,
variant,
...props
}: TagProps) => {
const viewTestProps = useQaLabel(qaLabel);
const bgColor = useColorTokens(
tagVariants[variant as TagVariant].backgroundColor
);
const color = useColorTokens(
tagVariants[variant as TagVariant].color
) as string;
return (
<TagContainer
backgroundColor={bgColor}
variant={variant}
{...props}
{...viewTestProps}
>
{icon && (
<Icon
name={icon}
size="s"
backgroundColor="transparent"
lineColor={color}
mr="space-1"
/>
)}
<StyledText color={color}>{label}</StyledText>
</TagContainer>
);
};
Tag.Icon = TagIcon;
export type { TagProps, TagVariant };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tag/tagIcon/index.tsx
import React from "react";
import { useQaLabel } from "../../../hooks";
import { Icon } from "../../icon";
import { TagIconProps } from "./types";
import { TagVariant } from "../types";
import { tagVariants } from "../styled-components";
import { TagCircleContainer } from "./styled-components";
import { useColorTokens } from "../../../theming/hooks/useColorTokens";
export const TagIcon = ({
qaLabel = "tag-icon",
label,
icon,
variant,
...props
}: TagIconProps) => {
const viewTestProps = useQaLabel(qaLabel);
const bgColor = useColorTokens(
tagVariants[variant as TagVariant].backgroundColor
);
const color = useColorTokens(
tagVariants[variant as TagVariant].color
) as string;
return (
<>
<TagCircleContainer
accessibilityLabel={label}
backgroundColor={bgColor}
{...props}
{...viewTestProps}
>
<Icon
size="s"
name={icon}
backgroundColor="transparent"
lineColor={color}
/>
</TagCircleContainer>
</>
);
};
export type { TagIconProps };
export default TagIcon;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/saddleSelections/saddleNumbers.tsx
import React, { useCallback, useMemo } from "react";
import formatCurrency from "@tvg/formatter/currency";
import { useColorTokens } from "@tvg/design-system/web/hooks";
import { get } from "lodash";
import { Saddle } from "../saddle";
import {
IconContainer,
SaddleDetailsParagraph,
SaddleSelectionContainer,
RowContainer,
WillPaysContainer,
AlternateContainer,
AlternateDivider,
IconContainerAlternate,
IconWrapper
} from "./styled-components";
import { rangeSelections } from "./utils";
import { ShowSelectionsProps } from "./types";
import { Paragraph } from "../typography";
import { Tag } from "../tag";
import { ParagraphFonts } from "../typography/paragraph/types";
import Icon from "../icon";
const SaddleNumbers = ({
numWagerableRunners,
selections,
isDark,
showBetType,
scratches,
wagerDetails = false,
shouldShowRefundTag,
breed = "thoroughbred",
onHandicaping,
hideWillPaysTag = false,
enableMyBetsBehavior = false,
showOdds,
favoriteRunner,
showReplacedRunners,
raceStatus,
isAlternateView,
showAlternatePlaceholder = true
}: ShowSelectionsProps) => {
const colorTokens = useColorTokens();
const saddleSelections =
selections?.length > 0
? selections
.filter((selection) => wagerDetails || !selection.isAlternate)
.sort(
(a, b) =>
parseInt(a.number.toString(), 10) -
parseInt(b.number.toString(), 10)
)
: [];
const hasScratch = scratches ? scratches?.length > 0 : false;
const hasWinner = saddleSelections.some((selection) => selection.winner);
const hasWillPays = saddleSelections.some((selection) => selection.willPay);
const checkSaddleSelection = useCallback(
(runnerNumber: string) =>
saddleSelections.filter(
(saddleSelection) => saddleSelection.number === runnerNumber
),
[saddleSelections, hasWinner, hasScratch, hasWillPays]
);
const alternateSelections = useMemo(
() =>
selections.filter((selection) => selection.isAlternate && !wagerDetails),
[selections]
);
const isAllSelections =
numWagerableRunners &&
Number(numWagerableRunners) === saddleSelections.length &&
!wagerDetails;
const isSaddleNumber = !isAllSelections && saddleSelections.length > 0;
const rangedSelections: string[] = useMemo(
() =>
rangeSelections(
saddleSelections,
scratches,
wagerDetails,
enableMyBetsBehavior
)
.join()
.split(/(-)/)
.join()
.split(","),
[wagerDetails, saddleSelections, scratches]
);
const renderAllSelections = () =>
isAllSelections ? (
<Saddle all={isAllSelections} number="All" size="s" breed={breed} />
) : (
// empty Selections
<Saddle
number="?"
size="s"
saddleColor={colorTokens.content.default}
numberColor={colorTokens.component.input.base}
mr="space-1"
enableMyBetsBehavior={enableMyBetsBehavior}
/>
);
return (
<>
{!isSaddleNumber &&
!hasScratch &&
!onHandicaping &&
!wagerDetails &&
!hasWinner ? (
renderAllSelections()
) : (
<SaddleSelectionContainer
isDetailView={wagerDetails}
hasThirdColumn={!!shouldShowRefundTag || hasWillPays}
>
{rangedSelections.map((item, index) => {
const currentSaddleSelection = checkSaddleSelection(item)[0];
const runnerDetailsStyle = {
fontFamily: (currentSaddleSelection?.winner &&
!currentSaddleSelection?.scratched
? "bold"
: "medium") as ParagraphFonts,
opacity: currentSaddleSelection?.isSettled ? "0.3" : "1"
};
return (
<RowContainer
isDetailView={wagerDetails}
showReplacedRunners={
showReplacedRunners && scratches?.includes(item)
}
key={`sanddle-arrow-${index.toString()}`}
>
{item.includes("-") ? (
<IconContainer>
<Icon
size="m"
name="arrowRight"
lineColor={
isDark && showBetType
? "content.onDark"
: "content.subtle"
}
qaLabel="runner-number-range-arrow"
mr="space-1"
shouldUseColorTokens
/>
</IconContainer>
) : (
currentSaddleSelection && (
<>
<Saddle
isScratched={
scratches?.includes(item) ||
(!enableMyBetsBehavior &&
hasWinner &&
currentSaddleSelection.winner === false)
}
raceFinished={
saddleSelections.length === scratches?.length ||
(hasWinner &&
currentSaddleSelection.winner === false) ||
(enableMyBetsBehavior &&
["lost", "won", "attention"].includes(
raceStatus ?? ""
))
}
key={`Saddle-num-${currentSaddleSelection.number}`}
number={currentSaddleSelection.number}
numberColor={currentSaddleSelection.numberColor}
saddleColor={currentSaddleSelection.saddleColor}
all={currentSaddleSelection.number === "ALL"}
isWinner={currentSaddleSelection.winner}
breed={breed}
enableMyBetsBehavior={enableMyBetsBehavior}
size="s"
mr={
!showBetType && index === rangedSelections.length
? 0
: "space-1"
}
/>
{showReplacedRunners &&
scratches?.includes(item) &&
enableMyBetsBehavior && (
<>
<IconContainer
key={`sanddle-arrow-${index.toString()}`}
>
<Icon
size="m"
name="arrowRight"
lineColor="background.warning"
qaLabel="runner-number-range-arrow"
mr="space-1"
shouldUseColorTokens
/>
</IconContainer>
<Saddle
isScratched={
scratches?.includes(item) ||
(!enableMyBetsBehavior &&
hasWinner &&
currentSaddleSelection.winner === false)
}
breed={breed}
raceFinished={
saddleSelections.length === scratches?.length ||
(hasWinner &&
currentSaddleSelection.winner === false) ||
(enableMyBetsBehavior &&
["lost", "won", "attention"].includes(
raceStatus ?? ""
))
}
key={`Saddle-num-${currentSaddleSelection.number}`}
number={
(
favoriteRunner as unknown as Record<
string,
string
>
)?.runnerNumber
}
size="s"
mr={
!showBetType &&
index === rangedSelections.length
? 0
: "space-1"
}
/>
</>
)}
{wagerDetails && (
<SaddleDetailsParagraph
qaLabel="details-runner-name"
scratched={
!!currentSaddleSelection.scratched &&
!showReplacedRunners &&
!scratches?.includes(item)
}
{...runnerDetailsStyle}
>
{showReplacedRunners && scratches?.includes(item)
? (
favoriteRunner as unknown as Record<
string,
string
>
)?.runnerName
: (currentSaddleSelection.runnerName as string)}
</SaddleDetailsParagraph>
)}
{wagerDetails &&
!!currentSaddleSelection.willPay &&
!hideWillPaysTag && (
<WillPaysContainer>
<Paragraph
qaLabel="details-will-pay-amount"
textAlign="center"
{...runnerDetailsStyle}
>
{formatCurrency(currentSaddleSelection.willPay)}
</Paragraph>
</WillPaysContainer>
)}
{wagerDetails &&
!!shouldShowRefundTag &&
!!currentSaddleSelection.scratched && (
<Tag label="REFUND" size="s" variant="warning" />
)}
{wagerDetails &&
currentSaddleSelection.winner &&
currentSaddleSelection.currentOdds &&
showOdds && (
<WillPaysContainer>
<Paragraph
qaLabel="details-will-pay-amount"
textAlign="center"
fontWeight={
currentSaddleSelection.winner
? "bold"
: undefined
}
>
<>
{get(
currentSaddleSelection,
"currentOdds.numerator"
)}
{get(
currentSaddleSelection,
"currentOdds.denominator"
)
? `/${get(
currentSaddleSelection,
"currentOdds.denominator"
)}`
: ""}
</>
</Paragraph>
</WillPaysContainer>
)}
</>
)
)}
</RowContainer>
);
})}
{(showAlternatePlaceholder || alternateSelections?.length > 0) &&
isAlternateView &&
!wagerDetails && (
<AlternateContainer>
<AlternateDivider isDark={isDark} />
{alternateSelections?.length > 0 ? (
alternateSelections.map((item) => (
// @ts-ignore
<IconContainerAlternate
qaLabel="alternate-saddle-row"
key={`alternate-container-${item.number}`}
>
<IconWrapper>
<Icon
name="doubleChevronLeftRight"
backgroundColor="#fff"
size="s"
lineColor="#05285A"
/>
</IconWrapper>
<Saddle
isScratched={scratches?.includes(
item.number.replace("B", "")
)}
raceFinished={false}
number={item.number}
breed={breed}
numberColor={item.numberColor}
saddleColor={item.saddleColor}
size="s"
/>
</IconContainerAlternate>
))
) : (
<>
{showAlternatePlaceholder && (
// @ts-ignore
<IconContainerAlternate qaLabel="alternate-saddle-row">
<IconWrapper>
<Icon
name="doubleChevronLeftRight"
backgroundColor="#fff"
size="s"
lineColor="#05285A"
/>
</IconWrapper>
<Saddle
number="?"
size="s"
numberColor="var(--fd-colors-core-white)"
saddleColor="#fff3"
qaLabel="saddle-question-mark"
/>
</IconContainerAlternate>
)}
</>
)}
</AlternateContainer>
)}
</SaddleSelectionContainer>
)}
</>
);
};
export default SaddleNumbers;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/saddleSelections/utils/rangeSelections/index.ts
import { SaddleSelectionsProps } from "../../types";
export const rangeSelections = (
selections: SaddleSelectionsProps[],
scratches?: string[] | undefined,
wagerDetails?: boolean,
enableMyBetsBehavior?: boolean
) =>
selections
.reduce((ranges: string[][], curr: SaddleSelectionsProps) => {
const lastSubArray: string[] = ranges[ranges.length - 1];
const prevCurr = (+curr.number - 1).toString();
const nextCurr = +curr.number + 1;
const lastSubArrayChar = lastSubArray?.[lastSubArray?.length - 1]; // 4A or 4
const prevArr = lastSubArrayChar?.match(/[a-zA-Z]+|[0-9]+/g); // ["4","A"] or ["4"]
const isPrevCoupledRunner = prevArr && prevArr?.length > 1;
if (
(curr.winner && enableMyBetsBehavior) ||
!lastSubArray ||
scratches?.includes(curr.number) ||
scratches?.includes(prevCurr) ||
(isPrevCoupledRunner &&
(+curr.number - 1).toString() !== prevArr?.[0]) ||
(!isPrevCoupledRunner &&
lastSubArray[lastSubArray.length - 1] !== prevCurr &&
!Number.isNaN(+curr.number)) ||
Number.isNaN(nextCurr)
) {
ranges.push([]);
}
ranges[ranges.length - 1].push(curr.number);
return ranges;
}, [])
.map((range: string[]) => {
if (range.length > 2 && !wagerDetails) {
return [range[0], range[range.length - 1]].join("-");
}
return range;
});
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/saddleSelections/index.tsx
import React from "react";
import { Selections } from "./styled-components";
import { ShowSelectionsProps, SaddleSelectionsProps } from "./types";
import SaddleNumbers from "./saddleNumbers";
import { useQaLabel } from "../../hooks";
export const SaddleSelections = ({
numWagerableRunners,
selections,
isDark,
showBetType,
scratches,
wagerDetails,
shouldShowRefundTag,
breed = "thoroughbred",
qaLabel = "saddle-selections-container",
onHandicaping,
hideWillPaysTag,
enableMyBetsBehavior,
showOdds,
favoriteRunner,
showReplacedRunners,
raceStatus,
isAlternateView,
showAlternatePlaceholder
}: ShowSelectionsProps) => {
const viewTestProps = useQaLabel(qaLabel || "saddle-selections-container");
return (
<Selections {...viewTestProps}>
<SaddleNumbers
scratches={scratches}
numWagerableRunners={numWagerableRunners}
selections={selections}
isDark={isDark}
showBetType={showBetType}
breed={breed}
wagerDetails={wagerDetails}
onHandicaping={onHandicaping}
shouldShowRefundTag={shouldShowRefundTag}
hideWillPaysTag={hideWillPaysTag}
enableMyBetsBehavior={enableMyBetsBehavior}
showOdds={showOdds}
favoriteRunner={favoriteRunner}
showReplacedRunners={showReplacedRunners}
raceStatus={raceStatus}
isAlternateView={isAlternateView}
showAlternatePlaceholder={showAlternatePlaceholder}
/>
</Selections>
);
};
export default SaddleSelections;
export type { SaddleSelectionsProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betSelections/styled-components.ts
import styled from "styled-components/native";
import { View, Text } from "react-native";
import { BetSelectionProps } from "./types";
export const BetSelectionContainer = styled(View)<
Pick<BetSelectionProps, "isDark">
>`
align-items: center;
background-color: ${({ theme, isDark }) =>
isDark
? theme.colorTokens.component.betslip.backgroundExpanded
: "transparent"};
border: 1px solid
${({ theme, isDark }) =>
isDark
? theme.colorTokens.component.betslip.backgroundExpanded
: theme.colors.blue[100]};
border-radius: 4px;
flex-direction: row;
height: 42px;
padding: 0 11px;
`;
export const BetText = styled(Text)<Pick<BetSelectionProps, "isDark">>`
color: ${({ theme, isDark }) =>
isDark ? theme.colorTokens.content.onDark : theme.colors.black[900]};
font-family: ${({ theme }) => theme.fonts.regular};
font-size: ${({ theme }) => theme.fontSizes.s};
font-weight: ${({ theme }) => theme.fontWeights.medium};
padding-right: 6px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betSelections/index.tsx
import React from "react";
import { useQaLabel } from "@tvg/design-system/src/hooks";
import SaddleSelections from "../saddleSelections";
import { BetSelectionContainer, BetText } from "./styled-components";
import { BetSelectionProps } from "./types";
export const BetSelections = ({
numWagerableRunners,
type,
breed = "thoroughbred",
selections,
isDark = true,
qaLabel = "bet-selection",
showBetType = true,
scratches,
wagerDetails,
shouldShowRefundTag,
onHandicaping,
hideWillPaysTag,
enableMyBetsBehavior = false,
showOdds,
favoriteRunner,
showReplacedRunners,
raceStatus,
isAlternateView,
showAlternatePlaceholder
}: BetSelectionProps) => {
const betSelectionQaLabel = useQaLabel(qaLabel);
return showBetType ? (
<BetSelectionContainer {...betSelectionQaLabel} isDark={isDark}>
<BetText isDark={isDark}>{type}</BetText>
<SaddleSelections
selections={selections}
isDark={isDark}
showBetType={showBetType}
scratches={scratches}
breed={breed}
hideWillPaysTag={hideWillPaysTag}
enableMyBetsBehavior={enableMyBetsBehavior}
showOdds={showOdds}
favoriteRunner={favoriteRunner}
showReplacedRunners={showReplacedRunners}
raceStatus={raceStatus}
isAlternateView={isAlternateView}
showAlternatePlaceholder={showAlternatePlaceholder}
/>
</BetSelectionContainer>
) : (
<SaddleSelections
numWagerableRunners={numWagerableRunners}
selections={selections}
isDark={isDark}
showBetType={showBetType}
scratches={scratches}
breed={breed}
wagerDetails={wagerDetails}
shouldShowRefundTag={shouldShowRefundTag}
onHandicaping={onHandicaping}
hideWillPaysTag={hideWillPaysTag}
enableMyBetsBehavior={enableMyBetsBehavior}
favoriteRunner={favoriteRunner}
showReplacedRunners={showReplacedRunners}
raceStatus={raceStatus}
{...betSelectionQaLabel}
showOdds={showOdds}
isAlternateView={isAlternateView}
showAlternatePlaceholder={showAlternatePlaceholder}
/>
);
};
export default BetSelections;
webpack://frontend-tpt/../../node_modules/d3-ease/src/math.js
// tpmt is two power minus ten times t scaled to [0,1]
export function tpmt(x) {
return (Math.pow(2, -10 * x) - 0.0009765625) * 1.0009775171065494;
}
webpack://frontend-tpt/../../node_modules/d3-ease/src/exp.js
import {tpmt} from "./math.js";
export function expIn(t) {
return tpmt(1 - +t);
}
export function expOut(t) {
return 1 - tpmt(t);
}
export function expInOut(t) {
return ((t *= 2) <= 1 ? tpmt(1 - t) : 2 - tpmt(t - 1)) / 2;
}
webpack://frontend-tpt/../../node_modules/@react-spring/rafz/dist/react-spring-rafz.esm.js
let updateQueue = makeQueue();
const raf = fn => schedule(fn, updateQueue);
let writeQueue = makeQueue();
raf.write = fn => schedule(fn, writeQueue);
let onStartQueue = makeQueue();
raf.onStart = fn => schedule(fn, onStartQueue);
let onFrameQueue = makeQueue();
raf.onFrame = fn => schedule(fn, onFrameQueue);
let onFinishQueue = makeQueue();
raf.onFinish = fn => schedule(fn, onFinishQueue);
let timeouts = [];
raf.setTimeout = (handler, ms) => {
let time = raf.now() + ms;
let cancel = () => {
let i = timeouts.findIndex(t => t.cancel == cancel);
if (~i) timeouts.splice(i, 1);
pendingCount -= ~i ? 1 : 0;
};
let timeout = {
time,
handler,
cancel
};
timeouts.splice(findTimeout(time), 0, timeout);
pendingCount += 1;
start();
return timeout;
};
let findTimeout = time => ~(~timeouts.findIndex(t => t.time > time) || ~timeouts.length);
raf.cancel = fn => {
onStartQueue.delete(fn);
onFrameQueue.delete(fn);
updateQueue.delete(fn);
writeQueue.delete(fn);
onFinishQueue.delete(fn);
};
raf.sync = fn => {
sync = true;
raf.batchedUpdates(fn);
sync = false;
};
raf.throttle = fn => {
let lastArgs;
function queuedFn() {
try {
fn(...lastArgs);
} finally {
lastArgs = null;
}
}
function throttled(...args) {
lastArgs = args;
raf.onStart(queuedFn);
}
throttled.handler = fn;
throttled.cancel = () => {
onStartQueue.delete(queuedFn);
lastArgs = null;
};
return throttled;
};
let nativeRaf = typeof window != 'undefined' ? window.requestAnimationFrame : () => {};
raf.use = impl => nativeRaf = impl;
raf.now = typeof performance != 'undefined' ? () => performance.now() : Date.now;
raf.batchedUpdates = fn => fn();
raf.catch = console.error;
raf.frameLoop = 'always';
raf.advance = () => {
if (raf.frameLoop !== 'demand') {
console.warn('Cannot call the manual advancement of rafz whilst frameLoop is not set as demand');
} else {
update();
}
};
let ts = -1;
let pendingCount = 0;
let sync = false;
function schedule(fn, queue) {
if (sync) {
queue.delete(fn);
fn(0);
} else {
queue.add(fn);
start();
}
}
function start() {
if (ts < 0) {
ts = 0;
if (raf.frameLoop !== 'demand') {
nativeRaf(loop);
}
}
}
function stop() {
ts = -1;
}
function loop() {
if (~ts) {
nativeRaf(loop);
raf.batchedUpdates(update);
}
}
function update() {
let prevTs = ts;
ts = raf.now();
let count = findTimeout(ts);
if (count) {
eachSafely(timeouts.splice(0, count), t => t.handler());
pendingCount -= count;
}
onStartQueue.flush();
updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667);
onFrameQueue.flush();
writeQueue.flush();
onFinishQueue.flush();
if (!pendingCount) {
stop();
}
}
function makeQueue() {
let next = new Set();
let current = next;
return {
add(fn) {
pendingCount += current == next && !next.has(fn) ? 1 : 0;
next.add(fn);
},
delete(fn) {
pendingCount -= current == next && next.has(fn) ? 1 : 0;
return next.delete(fn);
},
flush(arg) {
if (current.size) {
next = new Set();
pendingCount -= current.size;
eachSafely(current, fn => fn(arg) && next.add(fn));
pendingCount += next.size;
current = next;
}
}
};
}
function eachSafely(values, each) {
values.forEach(value => {
try {
each(value);
} catch (e) {
raf.catch(e);
}
});
}
const __raf = {
count() {
return pendingCount;
},
isRunning() {
return ts >= 0;
},
clear() {
ts = -1;
timeouts = [];
onStartQueue = makeQueue();
updateQueue = makeQueue();
onFrameQueue = makeQueue();
writeQueue = makeQueue();
onFinishQueue = makeQueue();
pendingCount = 0;
}
};
export { __raf, raf };
webpack://frontend-tpt/../../node_modules/@react-spring/shared/dist/react-spring-shared.esm.js
import { raf } from '@react-spring/rafz';
export { raf } from '@react-spring/rafz';
import * as React from 'react';
import { useRef, useState, useEffect } from 'react';
function noop() {}
const defineHidden = (obj, key, value) => Object.defineProperty(obj, key, {
value,
writable: true,
configurable: true
});
const is = {
arr: Array.isArray,
obj: a => !!a && a.constructor.name === 'Object',
fun: a => typeof a === 'function',
str: a => typeof a === 'string',
num: a => typeof a === 'number',
und: a => a === undefined
};
function isEqual(a, b) {
if (is.arr(a)) {
if (!is.arr(b) || a.length !== b.length) return false;
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i]) return false;
}
return true;
}
return a === b;
}
const each = (obj, fn) => obj.forEach(fn);
function eachProp(obj, fn, ctx) {
if (is.arr(obj)) {
for (let i = 0; i < obj.length; i++) {
fn.call(ctx, obj[i], `${i}`);
}
return;
}
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
fn.call(ctx, obj[key], key);
}
}
}
const toArray = a => is.und(a) ? [] : is.arr(a) ? a : [a];
function flush(queue, iterator) {
if (queue.size) {
const items = Array.from(queue);
queue.clear();
each(items, iterator);
}
}
const flushCalls = (queue, ...args) => flush(queue, fn => fn(...args));
const isSSR = () => typeof window === 'undefined' || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
let createStringInterpolator$1;
let to;
let colors$1 = null;
let skipAnimation = false;
let willAdvance = noop;
const assign = globals => {
if (globals.to) to = globals.to;
if (globals.now) raf.now = globals.now;
if (globals.colors !== undefined) colors$1 = globals.colors;
if (globals.skipAnimation != null) skipAnimation = globals.skipAnimation;
if (globals.createStringInterpolator) createStringInterpolator$1 = globals.createStringInterpolator;
if (globals.requestAnimationFrame) raf.use(globals.requestAnimationFrame);
if (globals.batchedUpdates) raf.batchedUpdates = globals.batchedUpdates;
if (globals.willAdvance) willAdvance = globals.willAdvance;
if (globals.frameLoop) raf.frameLoop = globals.frameLoop;
};
var globals = /*#__PURE__*/Object.freeze({
__proto__: null,
get createStringInterpolator () { return createStringInterpolator$1; },
get to () { return to; },
get colors () { return colors$1; },
get skipAnimation () { return skipAnimation; },
get willAdvance () { return willAdvance; },
assign: assign
});
const startQueue = new Set();
let currentFrame = [];
let prevFrame = [];
let priority = 0;
const frameLoop = {
get idle() {
return !startQueue.size && !currentFrame.length;
},
start(animation) {
if (priority > animation.priority) {
startQueue.add(animation);
raf.onStart(flushStartQueue);
} else {
startSafely(animation);
raf(advance);
}
},
advance,
sort(animation) {
if (priority) {
raf.onFrame(() => frameLoop.sort(animation));
} else {
const prevIndex = currentFrame.indexOf(animation);
if (~prevIndex) {
currentFrame.splice(prevIndex, 1);
startUnsafely(animation);
}
}
},
clear() {
currentFrame = [];
startQueue.clear();
}
};
function flushStartQueue() {
startQueue.forEach(startSafely);
startQueue.clear();
raf(advance);
}
function startSafely(animation) {
if (!currentFrame.includes(animation)) startUnsafely(animation);
}
function startUnsafely(animation) {
currentFrame.splice(findIndex(currentFrame, other => other.priority > animation.priority), 0, animation);
}
function advance(dt) {
const nextFrame = prevFrame;
for (let i = 0; i < currentFrame.length; i++) {
const animation = currentFrame[i];
priority = animation.priority;
if (!animation.idle) {
willAdvance(animation);
animation.advance(dt);
if (!animation.idle) {
nextFrame.push(animation);
}
}
}
priority = 0;
prevFrame = currentFrame;
prevFrame.length = 0;
currentFrame = nextFrame;
return currentFrame.length > 0;
}
function findIndex(arr, test) {
const index = arr.findIndex(test);
return index < 0 ? arr.length : index;
}
const colors = {
transparent: 0x00000000,
aliceblue: 0xf0f8ffff,
antiquewhite: 0xfaebd7ff,
aqua: 0x00ffffff,
aquamarine: 0x7fffd4ff,
azure: 0xf0ffffff,
beige: 0xf5f5dcff,
bisque: 0xffe4c4ff,
black: 0x000000ff,
blanchedalmond: 0xffebcdff,
blue: 0x0000ffff,
blueviolet: 0x8a2be2ff,
brown: 0xa52a2aff,
burlywood: 0xdeb887ff,
burntsienna: 0xea7e5dff,
cadetblue: 0x5f9ea0ff,
chartreuse: 0x7fff00ff,
chocolate: 0xd2691eff,
coral: 0xff7f50ff,
cornflowerblue: 0x6495edff,
cornsilk: 0xfff8dcff,
crimson: 0xdc143cff,
cyan: 0x00ffffff,
darkblue: 0x00008bff,
darkcyan: 0x008b8bff,
darkgoldenrod: 0xb8860bff,
darkgray: 0xa9a9a9ff,
darkgreen: 0x006400ff,
darkgrey: 0xa9a9a9ff,
darkkhaki: 0xbdb76bff,
darkmagenta: 0x8b008bff,
darkolivegreen: 0x556b2fff,
darkorange: 0xff8c00ff,
darkorchid: 0x9932ccff,
darkred: 0x8b0000ff,
darksalmon: 0xe9967aff,
darkseagreen: 0x8fbc8fff,
darkslateblue: 0x483d8bff,
darkslategray: 0x2f4f4fff,
darkslategrey: 0x2f4f4fff,
darkturquoise: 0x00ced1ff,
darkviolet: 0x9400d3ff,
deeppink: 0xff1493ff,
deepskyblue: 0x00bfffff,
dimgray: 0x696969ff,
dimgrey: 0x696969ff,
dodgerblue: 0x1e90ffff,
firebrick: 0xb22222ff,
floralwhite: 0xfffaf0ff,
forestgreen: 0x228b22ff,
fuchsia: 0xff00ffff,
gainsboro: 0xdcdcdcff,
ghostwhite: 0xf8f8ffff,
gold: 0xffd700ff,
goldenrod: 0xdaa520ff,
gray: 0x808080ff,
green: 0x008000ff,
greenyellow: 0xadff2fff,
grey: 0x808080ff,
honeydew: 0xf0fff0ff,
hotpink: 0xff69b4ff,
indianred: 0xcd5c5cff,
indigo: 0x4b0082ff,
ivory: 0xfffff0ff,
khaki: 0xf0e68cff,
lavender: 0xe6e6faff,
lavenderblush: 0xfff0f5ff,
lawngreen: 0x7cfc00ff,
lemonchiffon: 0xfffacdff,
lightblue: 0xadd8e6ff,
lightcoral: 0xf08080ff,
lightcyan: 0xe0ffffff,
lightgoldenrodyellow: 0xfafad2ff,
lightgray: 0xd3d3d3ff,
lightgreen: 0x90ee90ff,
lightgrey: 0xd3d3d3ff,
lightpink: 0xffb6c1ff,
lightsalmon: 0xffa07aff,
lightseagreen: 0x20b2aaff,
lightskyblue: 0x87cefaff,
lightslategray: 0x778899ff,
lightslategrey: 0x778899ff,
lightsteelblue: 0xb0c4deff,
lightyellow: 0xffffe0ff,
lime: 0x00ff00ff,
limegreen: 0x32cd32ff,
linen: 0xfaf0e6ff,
magenta: 0xff00ffff,
maroon: 0x800000ff,
mediumaquamarine: 0x66cdaaff,
mediumblue: 0x0000cdff,
mediumorchid: 0xba55d3ff,
mediumpurple: 0x9370dbff,
mediumseagreen: 0x3cb371ff,
mediumslateblue: 0x7b68eeff,
mediumspringgreen: 0x00fa9aff,
mediumturquoise: 0x48d1ccff,
mediumvioletred: 0xc71585ff,
midnightblue: 0x191970ff,
mintcream: 0xf5fffaff,
mistyrose: 0xffe4e1ff,
moccasin: 0xffe4b5ff,
navajowhite: 0xffdeadff,
navy: 0x000080ff,
oldlace: 0xfdf5e6ff,
olive: 0x808000ff,
olivedrab: 0x6b8e23ff,
orange: 0xffa500ff,
orangered: 0xff4500ff,
orchid: 0xda70d6ff,
palegoldenrod: 0xeee8aaff,
palegreen: 0x98fb98ff,
paleturquoise: 0xafeeeeff,
palevioletred: 0xdb7093ff,
papayawhip: 0xffefd5ff,
peachpuff: 0xffdab9ff,
peru: 0xcd853fff,
pink: 0xffc0cbff,
plum: 0xdda0ddff,
powderblue: 0xb0e0e6ff,
purple: 0x800080ff,
rebeccapurple: 0x663399ff,
red: 0xff0000ff,
rosybrown: 0xbc8f8fff,
royalblue: 0x4169e1ff,
saddlebrown: 0x8b4513ff,
salmon: 0xfa8072ff,
sandybrown: 0xf4a460ff,
seagreen: 0x2e8b57ff,
seashell: 0xfff5eeff,
sienna: 0xa0522dff,
silver: 0xc0c0c0ff,
skyblue: 0x87ceebff,
slateblue: 0x6a5acdff,
slategray: 0x708090ff,
slategrey: 0x708090ff,
snow: 0xfffafaff,
springgreen: 0x00ff7fff,
steelblue: 0x4682b4ff,
tan: 0xd2b48cff,
teal: 0x008080ff,
thistle: 0xd8bfd8ff,
tomato: 0xff6347ff,
turquoise: 0x40e0d0ff,
violet: 0xee82eeff,
wheat: 0xf5deb3ff,
white: 0xffffffff,
whitesmoke: 0xf5f5f5ff,
yellow: 0xffff00ff,
yellowgreen: 0x9acd32ff
};
const NUMBER = '[-+]?\\d*\\.?\\d+';
const PERCENTAGE = NUMBER + '%';
function call(...parts) {
return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)';
}
const rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER));
const rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER));
const hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
const hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
const hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
const hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
const hex6 = /^#([0-9a-fA-F]{6})$/;
const hex8 = /^#([0-9a-fA-F]{8})$/;
function normalizeColor(color) {
let match;
if (typeof color === 'number') {
return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null;
}
if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0;
if (colors$1 && colors$1[color] !== undefined) {
return colors$1[color];
}
if (match = rgb.exec(color)) {
return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | 0x000000ff) >>> 0;
}
if (match = rgba.exec(color)) {
return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | parse1(match[4])) >>> 0;
}
if (match = hex3.exec(color)) {
return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + 'ff', 16) >>> 0;
}
if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0;
if (match = hex4.exec(color)) {
return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + match[4] + match[4], 16) >>> 0;
}
if (match = hsl.exec(color)) {
return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | 0x000000ff) >>> 0;
}
if (match = hsla.exec(color)) {
return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | parse1(match[4])) >>> 0;
}
return null;
}
function hue2rgb(p, q, t) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1 / 6) return p + (q - p) * 6 * t;
if (t < 1 / 2) return q;
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
return p;
}
function hslToRgb(h, s, l) {
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
const p = 2 * l - q;
const r = hue2rgb(p, q, h + 1 / 3);
const g = hue2rgb(p, q, h);
const b = hue2rgb(p, q, h - 1 / 3);
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
}
function parse255(str) {
const int = parseInt(str, 10);
if (int < 0) return 0;
if (int > 255) return 255;
return int;
}
function parse360(str) {
const int = parseFloat(str);
return (int % 360 + 360) % 360 / 360;
}
function parse1(str) {
const num = parseFloat(str);
if (num < 0) return 0;
if (num > 1) return 255;
return Math.round(num * 255);
}
function parsePercentage(str) {
const int = parseFloat(str);
if (int < 0) return 0;
if (int > 100) return 1;
return int / 100;
}
function colorToRgba(input) {
let int32Color = normalizeColor(input);
if (int32Color === null) return input;
int32Color = int32Color || 0;
let r = (int32Color & 0xff000000) >>> 24;
let g = (int32Color & 0x00ff0000) >>> 16;
let b = (int32Color & 0x0000ff00) >>> 8;
let a = (int32Color & 0x000000ff) / 255;
return `rgba(${r}, ${g}, ${b}, ${a})`;
}
const createInterpolator = (range, output, extrapolate) => {
if (is.fun(range)) {
return range;
}
if (is.arr(range)) {
return createInterpolator({
range,
output: output,
extrapolate
});
}
if (is.str(range.output[0])) {
return createStringInterpolator$1(range);
}
const config = range;
const outputRange = config.output;
const inputRange = config.range || [0, 1];
const extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
const extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
const easing = config.easing || (t => t);
return input => {
const range = findRange(input, inputRange);
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
};
};
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
let result = map ? map(input) : input;
if (result < inputMin) {
if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin;
}
if (result > inputMax) {
if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax;
}
if (outputMin === outputMax) return outputMin;
if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax;
if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin);
result = easing(result);
if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin;
return result;
}
function findRange(input, inputRange) {
for (var i = 1; i < inputRange.length - 1; ++i) if (inputRange[i] >= input) break;
return i - 1;
}
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
const $get = Symbol.for('FluidValue.get');
const $observers = Symbol.for('FluidValue.observers');
const hasFluidValue = arg => Boolean(arg && arg[$get]);
const getFluidValue = arg => arg && arg[$get] ? arg[$get]() : arg;
const getFluidObservers = target => target[$observers] || null;
function callFluidObserver(observer, event) {
if (observer.eventObserved) {
observer.eventObserved(event);
} else {
observer(event);
}
}
function callFluidObservers(target, event) {
let observers = target[$observers];
if (observers) {
observers.forEach(observer => {
callFluidObserver(observer, event);
});
}
}
class FluidValue {
constructor(get) {
this[$get] = void 0;
this[$observers] = void 0;
if (!get && !(get = this.get)) {
throw Error('Unknown getter');
}
setFluidGetter(this, get);
}
}
const setFluidGetter = (target, get) => setHidden(target, $get, get);
function addFluidObserver(target, observer) {
if (target[$get]) {
let observers = target[$observers];
if (!observers) {
setHidden(target, $observers, observers = new Set());
}
if (!observers.has(observer)) {
observers.add(observer);
if (target.observerAdded) {
target.observerAdded(observers.size, observer);
}
}
}
return observer;
}
function removeFluidObserver(target, observer) {
let observers = target[$observers];
if (observers && observers.has(observer)) {
const count = observers.size - 1;
if (count) {
observers.delete(observer);
} else {
target[$observers] = null;
}
if (target.observerRemoved) {
target.observerRemoved(count, observer);
}
}
}
const setHidden = (target, key, value) => Object.defineProperty(target, key, {
value,
writable: true,
configurable: true
});
const numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;
const unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, 'i');
const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;
const cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
const variableToRgba = input => {
const [token, fallback] = parseCSSVariable(input);
if (!token || isSSR()) {
return input;
}
const value = window.getComputedStyle(document.documentElement).getPropertyValue(token);
if (value) {
return value.trim();
} else if (fallback && fallback.startsWith('--')) {
const _value = window.getComputedStyle(document.documentElement).getPropertyValue(fallback);
if (_value) {
return _value;
} else {
return input;
}
} else if (fallback && cssVariableRegex.test(fallback)) {
return variableToRgba(fallback);
} else if (fallback) {
return fallback;
}
return input;
};
const parseCSSVariable = current => {
const match = cssVariableRegex.exec(current);
if (!match) return [,];
const [, token, fallback] = match;
return [token, fallback];
};
let namedColorRegex;
const rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`;
const createStringInterpolator = config => {
if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join('|')})(?!\\w)`, 'g') : /^\b$/;
const output = config.output.map(value => {
return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba);
});
const keyframes = output.map(value => value.match(numberRegex).map(Number));
const outputRanges = keyframes[0].map((_, i) => keyframes.map(values => {
if (!(i in values)) {
throw Error('The arity of each "output" value must be equal');
}
return values[i];
}));
const interpolators = outputRanges.map(output => createInterpolator(_extends({}, config, {
output
})));
return input => {
var _output$find;
const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find(value => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, ''));
let i = 0;
return output[0].replace(numberRegex, () => `${interpolators[i++](input)}${missingUnit || ''}`).replace(rgbaRegex, rgbaRound);
};
};
const prefix = 'react-spring: ';
const once = fn => {
const func = fn;
let called = false;
if (typeof func != 'function') {
throw new TypeError(`${prefix}once requires a function parameter`);
}
return (...args) => {
if (!called) {
func(...args);
called = true;
}
};
};
const warnInterpolate = once(console.warn);
function deprecateInterpolate() {
warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`);
}
const warnDirectCall = once(console.warn);
function deprecateDirectCall() {
warnDirectCall(`${prefix}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);
}
function isAnimatedString(value) {
return is.str(value) && (value[0] == '#' || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
}
const useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? React.useLayoutEffect : React.useEffect;
const useIsMounted = () => {
const isMounted = useRef(false);
useLayoutEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
return isMounted;
};
function useForceUpdate() {
const update = useState()[1];
const isMounted = useIsMounted();
return () => {
if (isMounted.current) {
update(Math.random());
}
};
}
function useMemoOne(getResult, inputs) {
const [initial] = useState(() => ({
inputs,
result: getResult()
}));
const committed = useRef();
const prevCache = committed.current;
let cache = prevCache;
if (cache) {
const useCache = Boolean(inputs && cache.inputs && areInputsEqual(inputs, cache.inputs));
if (!useCache) {
cache = {
inputs,
result: getResult()
};
}
} else {
cache = initial;
}
useEffect(() => {
committed.current = cache;
if (prevCache == initial) {
initial.inputs = initial.result = undefined;
}
}, [cache]);
return cache.result;
}
function areInputsEqual(next, prev) {
if (next.length !== prev.length) {
return false;
}
for (let i = 0; i < next.length; i++) {
if (next[i] !== prev[i]) {
return false;
}
}
return true;
}
const useOnce = effect => useEffect(effect, emptyDeps);
const emptyDeps = [];
function usePrev(value) {
const prevRef = useRef();
useEffect(() => {
prevRef.current = value;
});
return prevRef.current;
}
export { FluidValue, globals as Globals, addFluidObserver, callFluidObserver, callFluidObservers, colorToRgba, colors, createInterpolator, createStringInterpolator, defineHidden, deprecateDirectCall, deprecateInterpolate, each, eachProp, flush, flushCalls, frameLoop, getFluidObservers, getFluidValue, hasFluidValue, hex3, hex4, hex6, hex8, hsl, hsla, is, isAnimatedString, isEqual, isSSR, noop, removeFluidObserver, rgb, rgba, setFluidGetter, toArray, useForceUpdate, useLayoutEffect, useMemoOne, useOnce, usePrev };
webpack://frontend-tpt/../../node_modules/@react-spring/animated/dist/react-spring-animated.esm.js
import { defineHidden, is, createInterpolator, eachProp, hasFluidValue, getFluidValue, each, isAnimatedString, useForceUpdate, useLayoutEffect, addFluidObserver, removeFluidObserver, raf, useOnce } from '@react-spring/shared';
import * as React from 'react';
import { forwardRef, useRef, useCallback, useEffect } from 'react';
const $node = Symbol.for('Animated:node');
const isAnimated = value => !!value && value[$node] === value;
const getAnimated = owner => owner && owner[$node];
const setAnimated = (owner, node) => defineHidden(owner, $node, node);
const getPayload = owner => owner && owner[$node] && owner[$node].getPayload();
class Animated {
constructor() {
this.payload = void 0;
setAnimated(this, this);
}
getPayload() {
return this.payload || [];
}
}
class AnimatedValue extends Animated {
constructor(_value) {
super();
this.done = true;
this.elapsedTime = void 0;
this.lastPosition = void 0;
this.lastVelocity = void 0;
this.v0 = void 0;
this.durationProgress = 0;
this._value = _value;
if (is.num(this._value)) {
this.lastPosition = this._value;
}
}
static create(value) {
return new AnimatedValue(value);
}
getPayload() {
return [this];
}
getValue() {
return this._value;
}
setValue(value, step) {
if (is.num(value)) {
this.lastPosition = value;
if (step) {
value = Math.round(value / step) * step;
if (this.done) {
this.lastPosition = value;
}
}
}
if (this._value === value) {
return false;
}
this._value = value;
return true;
}
reset() {
const {
done
} = this;
this.done = false;
if (is.num(this._value)) {
this.elapsedTime = 0;
this.durationProgress = 0;
this.lastPosition = this._value;
if (done) this.lastVelocity = null;
this.v0 = null;
}
}
}
class AnimatedString extends AnimatedValue {
constructor(value) {
super(0);
this._string = null;
this._toString = void 0;
this._toString = createInterpolator({
output: [value, value]
});
}
static create(value) {
return new AnimatedString(value);
}
getValue() {
let value = this._string;
return value == null ? this._string = this._toString(this._value) : value;
}
setValue(value) {
if (is.str(value)) {
if (value == this._string) {
return false;
}
this._string = value;
this._value = 1;
} else if (super.setValue(value)) {
this._string = null;
} else {
return false;
}
return true;
}
reset(goal) {
if (goal) {
this._toString = createInterpolator({
output: [this.getValue(), goal]
});
}
this._value = 0;
super.reset();
}
}
const TreeContext = {
dependencies: null
};
class AnimatedObject extends Animated {
constructor(source) {
super();
this.source = source;
this.setValue(source);
}
getValue(animated) {
const values = {};
eachProp(this.source, (source, key) => {
if (isAnimated(source)) {
values[key] = source.getValue(animated);
} else if (hasFluidValue(source)) {
values[key] = getFluidValue(source);
} else if (!animated) {
values[key] = source;
}
});
return values;
}
setValue(source) {
this.source = source;
this.payload = this._makePayload(source);
}
reset() {
if (this.payload) {
each(this.payload, node => node.reset());
}
}
_makePayload(source) {
if (source) {
const payload = new Set();
eachProp(source, this._addToPayload, payload);
return Array.from(payload);
}
}
_addToPayload(source) {
if (TreeContext.dependencies && hasFluidValue(source)) {
TreeContext.dependencies.add(source);
}
const payload = getPayload(source);
if (payload) {
each(payload, node => this.add(node));
}
}
}
class AnimatedArray extends AnimatedObject {
constructor(source) {
super(source);
}
static create(source) {
return new AnimatedArray(source);
}
getValue() {
return this.source.map(node => node.getValue());
}
setValue(source) {
const payload = this.getPayload();
if (source.length == payload.length) {
return payload.map((node, i) => node.setValue(source[i])).some(Boolean);
}
super.setValue(source.map(makeAnimated));
return true;
}
}
function makeAnimated(value) {
const nodeType = isAnimatedString(value) ? AnimatedString : AnimatedValue;
return nodeType.create(value);
}
function getAnimatedType(value) {
const parentNode = getAnimated(value);
return parentNode ? parentNode.constructor : is.arr(value) ? AnimatedArray : isAnimatedString(value) ? AnimatedString : AnimatedValue;
}
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
const withAnimated = (Component, host) => {
const hasInstance = !is.fun(Component) || Component.prototype && Component.prototype.isReactComponent;
return forwardRef((givenProps, givenRef) => {
const instanceRef = useRef(null);
const ref = hasInstance && useCallback(value => {
instanceRef.current = updateRef(givenRef, value);
}, [givenRef]);
const [props, deps] = getAnimatedState(givenProps, host);
const forceUpdate = useForceUpdate();
const callback = () => {
const instance = instanceRef.current;
if (hasInstance && !instance) {
return;
}
const didUpdate = instance ? host.applyAnimatedValues(instance, props.getValue(true)) : false;
if (didUpdate === false) {
forceUpdate();
}
};
const observer = new PropsObserver(callback, deps);
const observerRef = useRef();
useLayoutEffect(() => {
observerRef.current = observer;
each(deps, dep => addFluidObserver(dep, observer));
return () => {
if (observerRef.current) {
each(observerRef.current.deps, dep => removeFluidObserver(dep, observerRef.current));
raf.cancel(observerRef.current.update);
}
};
});
useEffect(callback, []);
useOnce(() => () => {
const observer = observerRef.current;
each(observer.deps, dep => removeFluidObserver(dep, observer));
});
const usedProps = host.getComponentProps(props.getValue());
return React.createElement(Component, _extends({}, usedProps, {
ref: ref
}));
});
};
class PropsObserver {
constructor(update, deps) {
this.update = update;
this.deps = deps;
}
eventObserved(event) {
if (event.type == 'change') {
raf.write(this.update);
}
}
}
function getAnimatedState(props, host) {
const dependencies = new Set();
TreeContext.dependencies = dependencies;
if (props.style) props = _extends({}, props, {
style: host.createAnimatedStyle(props.style)
});
props = new AnimatedObject(props);
TreeContext.dependencies = null;
return [props, dependencies];
}
function updateRef(ref, value) {
if (ref) {
if (is.fun(ref)) ref(value);else ref.current = value;
}
return value;
}
const cacheKey = Symbol.for('AnimatedComponent');
const createHost = (components, {
applyAnimatedValues: _applyAnimatedValues = () => false,
createAnimatedStyle: _createAnimatedStyle = style => new AnimatedObject(style),
getComponentProps: _getComponentProps = props => props
} = {}) => {
const hostConfig = {
applyAnimatedValues: _applyAnimatedValues,
createAnimatedStyle: _createAnimatedStyle,
getComponentProps: _getComponentProps
};
const animated = Component => {
const displayName = getDisplayName(Component) || 'Anonymous';
if (is.str(Component)) {
Component = animated[Component] || (animated[Component] = withAnimated(Component, hostConfig));
} else {
Component = Component[cacheKey] || (Component[cacheKey] = withAnimated(Component, hostConfig));
}
Component.displayName = `Animated(${displayName})`;
return Component;
};
eachProp(components, (Component, key) => {
if (is.arr(components)) {
key = getDisplayName(Component);
}
animated[key] = animated(Component);
});
return {
animated
};
};
const getDisplayName = arg => is.str(arg) ? arg : arg && is.str(arg.displayName) ? arg.displayName : is.fun(arg) && arg.name || null;
export { Animated, AnimatedArray, AnimatedObject, AnimatedString, AnimatedValue, createHost, getAnimated, getAnimatedType, getPayload, isAnimated, setAnimated };
webpack://frontend-tpt/../../node_modules/@react-spring/native/node_modules/@react-spring/core/dist/react-spring-core.esm.js
import { eachProp, is, toArray, isAnimatedString, Globals, getFluidValue, useLayoutEffect, each, raf, flush, FluidValue, deprecateInterpolate, callFluidObservers, frameLoop, hasFluidValue, flushCalls, isEqual, getFluidObservers, addFluidObserver, removeFluidObserver, noop, useMemoOne, deprecateDirectCall, useForceUpdate, usePrev, useOnce, createInterpolator, createStringInterpolator } from '@react-spring/shared';
export { Globals, createInterpolator } from '@react-spring/shared';
import * as React from 'react';
import { useContext, useMemo, useRef, useState } from 'react';
import { getAnimated, AnimatedValue, getPayload, AnimatedString, getAnimatedType, setAnimated } from '@react-spring/animated';
export * from '@react-spring/types/animated';
export * from '@react-spring/types/interpolation';
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function callProp(value, ...args) {
return is.fun(value) ? value(...args) : value;
}
const matchProp = (value, key) => value === true || !!(key && value && (is.fun(value) ? value(key) : toArray(value).includes(key)));
const resolveProp = (prop, key) => is.obj(prop) ? key && prop[key] : prop;
const getDefaultProp = (props, key) => props.default === true ? props[key] : props.default ? props.default[key] : undefined;
const noopTransform = value => value;
const getDefaultProps = (props, transform = noopTransform) => {
let keys = DEFAULT_PROPS;
if (props.default && props.default !== true) {
props = props.default;
keys = Object.keys(props);
}
const defaults = {};
for (const key of keys) {
const value = transform(props[key], key);
if (!is.und(value)) {
defaults[key] = value;
}
}
return defaults;
};
const DEFAULT_PROPS = ['config', 'onProps', 'onStart', 'onChange', 'onPause', 'onResume', 'onRest'];
const RESERVED_PROPS = {
config: 1,
from: 1,
to: 1,
ref: 1,
loop: 1,
reset: 1,
pause: 1,
cancel: 1,
reverse: 1,
immediate: 1,
default: 1,
delay: 1,
onProps: 1,
onStart: 1,
onChange: 1,
onPause: 1,
onResume: 1,
onRest: 1,
onResolve: 1,
items: 1,
trail: 1,
sort: 1,
expires: 1,
initial: 1,
enter: 1,
update: 1,
leave: 1,
children: 1,
onDestroyed: 1,
keys: 1,
callId: 1,
parentId: 1
};
function getForwardProps(props) {
const forward = {};
let count = 0;
eachProp(props, (value, prop) => {
if (!RESERVED_PROPS[prop]) {
forward[prop] = value;
count++;
}
});
if (count) {
return forward;
}
}
function inferTo(props) {
const to = getForwardProps(props);
if (to) {
const out = {
to
};
eachProp(props, (val, key) => key in to || (out[key] = val));
return out;
}
return _extends({}, props);
}
function computeGoal(value) {
value = getFluidValue(value);
return is.arr(value) ? value.map(computeGoal) : isAnimatedString(value) ? Globals.createStringInterpolator({
range: [0, 1],
output: [value, value]
})(1) : value;
}
function hasProps(props) {
for (const _ in props) return true;
return false;
}
function isAsyncTo(to) {
return is.fun(to) || is.arr(to) && is.obj(to[0]);
}
function detachRefs(ctrl, ref) {
var _ctrl$ref;
(_ctrl$ref = ctrl.ref) == null ? void 0 : _ctrl$ref.delete(ctrl);
ref == null ? void 0 : ref.delete(ctrl);
}
function replaceRef(ctrl, ref) {
if (ref && ctrl.ref !== ref) {
var _ctrl$ref2;
(_ctrl$ref2 = ctrl.ref) == null ? void 0 : _ctrl$ref2.delete(ctrl);
ref.add(ctrl);
ctrl.ref = ref;
}
}
function useChain(refs, timeSteps, timeFrame = 1000) {
useLayoutEffect(() => {
if (timeSteps) {
let prevDelay = 0;
each(refs, (ref, i) => {
const controllers = ref.current;
if (controllers.length) {
let delay = timeFrame * timeSteps[i];
if (isNaN(delay)) delay = prevDelay;else prevDelay = delay;
each(controllers, ctrl => {
each(ctrl.queue, props => {
const memoizedDelayProp = props.delay;
props.delay = key => delay + callProp(memoizedDelayProp || 0, key);
});
});
ref.start();
}
});
} else {
let p = Promise.resolve();
each(refs, ref => {
const controllers = ref.current;
if (controllers.length) {
const queues = controllers.map(ctrl => {
const q = ctrl.queue;
ctrl.queue = [];
return q;
});
p = p.then(() => {
each(controllers, (ctrl, i) => each(queues[i] || [], update => ctrl.queue.push(update)));
return Promise.all(ref.start());
});
}
});
}
});
}
const config = {
default: {
tension: 170,
friction: 26
},
gentle: {
tension: 120,
friction: 14
},
wobbly: {
tension: 180,
friction: 12
},
stiff: {
tension: 210,
friction: 20
},
slow: {
tension: 280,
friction: 60
},
molasses: {
tension: 280,
friction: 120
}
};
const c1 = 1.70158;
const c2 = c1 * 1.525;
const c3 = c1 + 1;
const c4 = 2 * Math.PI / 3;
const c5 = 2 * Math.PI / 4.5;
const bounceOut = x => {
const n1 = 7.5625;
const d1 = 2.75;
if (x < 1 / d1) {
return n1 * x * x;
} else if (x < 2 / d1) {
return n1 * (x -= 1.5 / d1) * x + 0.75;
} else if (x < 2.5 / d1) {
return n1 * (x -= 2.25 / d1) * x + 0.9375;
} else {
return n1 * (x -= 2.625 / d1) * x + 0.984375;
}
};
const easings = {
linear: x => x,
easeInQuad: x => x * x,
easeOutQuad: x => 1 - (1 - x) * (1 - x),
easeInOutQuad: x => x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2,
easeInCubic: x => x * x * x,
easeOutCubic: x => 1 - Math.pow(1 - x, 3),
easeInOutCubic: x => x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2,
easeInQuart: x => x * x * x * x,
easeOutQuart: x => 1 - Math.pow(1 - x, 4),
easeInOutQuart: x => x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2,
easeInQuint: x => x * x * x * x * x,
easeOutQuint: x => 1 - Math.pow(1 - x, 5),
easeInOutQuint: x => x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2,
easeInSine: x => 1 - Math.cos(x * Math.PI / 2),
easeOutSine: x => Math.sin(x * Math.PI / 2),
easeInOutSine: x => -(Math.cos(Math.PI * x) - 1) / 2,
easeInExpo: x => x === 0 ? 0 : Math.pow(2, 10 * x - 10),
easeOutExpo: x => x === 1 ? 1 : 1 - Math.pow(2, -10 * x),
easeInOutExpo: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2,
easeInCirc: x => 1 - Math.sqrt(1 - Math.pow(x, 2)),
easeOutCirc: x => Math.sqrt(1 - Math.pow(x - 1, 2)),
easeInOutCirc: x => x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2,
easeInBack: x => c3 * x * x * x - c1 * x * x,
easeOutBack: x => 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2),
easeInOutBack: x => x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2,
easeInElastic: x => x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4),
easeOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1,
easeInOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1,
easeInBounce: x => 1 - bounceOut(1 - x),
easeOutBounce: bounceOut,
easeInOutBounce: x => x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2
};
const defaults = _extends({}, config.default, {
mass: 1,
damping: 1,
easing: easings.linear,
clamp: false
});
class AnimationConfig {
constructor() {
this.tension = void 0;
this.friction = void 0;
this.frequency = void 0;
this.damping = void 0;
this.mass = void 0;
this.velocity = 0;
this.restVelocity = void 0;
this.precision = void 0;
this.progress = void 0;
this.duration = void 0;
this.easing = void 0;
this.clamp = void 0;
this.bounce = void 0;
this.decay = void 0;
this.round = void 0;
Object.assign(this, defaults);
}
}
function mergeConfig(config, newConfig, defaultConfig) {
if (defaultConfig) {
defaultConfig = _extends({}, defaultConfig);
sanitizeConfig(defaultConfig, newConfig);
newConfig = _extends({}, defaultConfig, newConfig);
}
sanitizeConfig(config, newConfig);
Object.assign(config, newConfig);
for (const key in defaults) {
if (config[key] == null) {
config[key] = defaults[key];
}
}
let {
mass,
frequency,
damping
} = config;
if (!is.und(frequency)) {
if (frequency < 0.01) frequency = 0.01;
if (damping < 0) damping = 0;
config.tension = Math.pow(2 * Math.PI / frequency, 2) * mass;
config.friction = 4 * Math.PI * damping * mass / frequency;
}
return config;
}
function sanitizeConfig(config, props) {
if (!is.und(props.decay)) {
config.duration = undefined;
} else {
const isTensionConfig = !is.und(props.tension) || !is.und(props.friction);
if (isTensionConfig || !is.und(props.frequency) || !is.und(props.damping) || !is.und(props.mass)) {
config.duration = undefined;
config.decay = undefined;
}
if (isTensionConfig) {
config.frequency = undefined;
}
}
}
const emptyArray = [];
class Animation {
constructor() {
this.changed = false;
this.values = emptyArray;
this.toValues = null;
this.fromValues = emptyArray;
this.to = void 0;
this.from = void 0;
this.config = new AnimationConfig();
this.immediate = false;
}
}
function scheduleProps(callId, {
key,
props,
defaultProps,
state,
actions
}) {
return new Promise((resolve, reject) => {
var _props$cancel;
let delay;
let timeout;
let cancel = matchProp((_props$cancel = props.cancel) != null ? _props$cancel : defaultProps == null ? void 0 : defaultProps.cancel, key);
if (cancel) {
onStart();
} else {
if (!is.und(props.pause)) {
state.paused = matchProp(props.pause, key);
}
let pause = defaultProps == null ? void 0 : defaultProps.pause;
if (pause !== true) {
pause = state.paused || matchProp(pause, key);
}
delay = callProp(props.delay || 0, key);
if (pause) {
state.resumeQueue.add(onResume);
actions.pause();
} else {
actions.resume();
onResume();
}
}
function onPause() {
state.resumeQueue.add(onResume);
state.timeouts.delete(timeout);
timeout.cancel();
delay = timeout.time - raf.now();
}
function onResume() {
if (delay > 0 && !Globals.skipAnimation) {
state.delayed = true;
timeout = raf.setTimeout(onStart, delay);
state.pauseQueue.add(onPause);
state.timeouts.add(timeout);
} else {
onStart();
}
}
function onStart() {
if (state.delayed) {
state.delayed = false;
}
state.pauseQueue.delete(onPause);
state.timeouts.delete(timeout);
if (callId <= (state.cancelId || 0)) {
cancel = true;
}
try {
actions.start(_extends({}, props, {
callId,
cancel
}), resolve);
} catch (err) {
reject(err);
}
}
});
}
const getCombinedResult = (target, results) => results.length == 1 ? results[0] : results.some(result => result.cancelled) ? getCancelledResult(target.get()) : results.every(result => result.noop) ? getNoopResult(target.get()) : getFinishedResult(target.get(), results.every(result => result.finished));
const getNoopResult = value => ({
value,
noop: true,
finished: true,
cancelled: false
});
const getFinishedResult = (value, finished, cancelled = false) => ({
value,
finished,
cancelled
});
const getCancelledResult = value => ({
value,
cancelled: true,
finished: false
});
function runAsync(to, props, state, target) {
const {
callId,
parentId,
onRest
} = props;
const {
asyncTo: prevTo,
promise: prevPromise
} = state;
if (!parentId && to === prevTo && !props.reset) {
return prevPromise;
}
return state.promise = (async () => {
state.asyncId = callId;
state.asyncTo = to;
const defaultProps = getDefaultProps(props, (value, key) => key === 'onRest' ? undefined : value);
let preventBail;
let bail;
const bailPromise = new Promise((resolve, reject) => (preventBail = resolve, bail = reject));
const bailIfEnded = bailSignal => {
const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false);
if (bailResult) {
bailSignal.result = bailResult;
bail(bailSignal);
throw bailSignal;
}
};
const animate = (arg1, arg2) => {
const bailSignal = new BailSignal();
const skipAnimationSignal = new SkipAniamtionSignal();
return (async () => {
if (Globals.skipAnimation) {
stopAsync(state);
skipAnimationSignal.result = getFinishedResult(target, false);
bail(skipAnimationSignal);
throw skipAnimationSignal;
}
bailIfEnded(bailSignal);
const props = is.obj(arg1) ? _extends({}, arg1) : _extends({}, arg2, {
to: arg1
});
props.parentId = callId;
eachProp(defaultProps, (value, key) => {
if (is.und(props[key])) {
props[key] = value;
}
});
const result = await target.start(props);
bailIfEnded(bailSignal);
if (state.paused) {
await new Promise(resume => {
state.resumeQueue.add(resume);
});
}
return result;
})();
};
let result;
if (Globals.skipAnimation) {
stopAsync(state);
return getFinishedResult(target, false);
}
try {
let animating;
if (is.arr(to)) {
animating = (async queue => {
for (const props of queue) {
await animate(props);
}
})(to);
} else {
animating = Promise.resolve(to(animate, target.stop.bind(target)));
}
await Promise.all([animating.then(preventBail), bailPromise]);
result = getFinishedResult(target.get(), true, false);
} catch (err) {
if (err instanceof BailSignal) {
result = err.result;
} else if (err instanceof SkipAniamtionSignal) {
result = err.result;
} else {
throw err;
}
} finally {
if (callId == state.asyncId) {
state.asyncId = parentId;
state.asyncTo = parentId ? prevTo : undefined;
state.promise = parentId ? prevPromise : undefined;
}
}
if (is.fun(onRest)) {
raf.batchedUpdates(() => {
onRest(result, target, target.item);
});
}
return result;
})();
}
function stopAsync(state, cancelId) {
flush(state.timeouts, t => t.cancel());
state.pauseQueue.clear();
state.resumeQueue.clear();
state.asyncId = state.asyncTo = state.promise = undefined;
if (cancelId) state.cancelId = cancelId;
}
class BailSignal extends Error {
constructor() {
super('An async animation has been interrupted. You see this error because you ' + 'forgot to use `await` or `.catch(...)` on its returned promise.');
this.result = void 0;
}
}
class SkipAniamtionSignal extends Error {
constructor() {
super('SkipAnimationSignal');
this.result = void 0;
}
}
const isFrameValue = value => value instanceof FrameValue;
let nextId$1 = 1;
class FrameValue extends FluidValue {
constructor(...args) {
super(...args);
this.id = nextId$1++;
this.key = void 0;
this._priority = 0;
}
get priority() {
return this._priority;
}
set priority(priority) {
if (this._priority != priority) {
this._priority = priority;
this._onPriorityChange(priority);
}
}
get() {
const node = getAnimated(this);
return node && node.getValue();
}
to(...args) {
return Globals.to(this, args);
}
interpolate(...args) {
deprecateInterpolate();
return Globals.to(this, args);
}
toJSON() {
return this.get();
}
observerAdded(count) {
if (count == 1) this._attach();
}
observerRemoved(count) {
if (count == 0) this._detach();
}
_attach() {}
_detach() {}
_onChange(value, idle = false) {
callFluidObservers(this, {
type: 'change',
parent: this,
value,
idle
});
}
_onPriorityChange(priority) {
if (!this.idle) {
frameLoop.sort(this);
}
callFluidObservers(this, {
type: 'priority',
parent: this,
priority
});
}
}
const $P = Symbol.for('SpringPhase');
const HAS_ANIMATED = 1;
const IS_ANIMATING = 2;
const IS_PAUSED = 4;
const hasAnimated = target => (target[$P] & HAS_ANIMATED) > 0;
const isAnimating = target => (target[$P] & IS_ANIMATING) > 0;
const isPaused = target => (target[$P] & IS_PAUSED) > 0;
const setActiveBit = (target, active) => active ? target[$P] |= IS_ANIMATING | HAS_ANIMATED : target[$P] &= ~IS_ANIMATING;
const setPausedBit = (target, paused) => paused ? target[$P] |= IS_PAUSED : target[$P] &= ~IS_PAUSED;
class SpringValue extends FrameValue {
constructor(arg1, arg2) {
super();
this.key = void 0;
this.animation = new Animation();
this.queue = void 0;
this.defaultProps = {};
this._state = {
paused: false,
delayed: false,
pauseQueue: new Set(),
resumeQueue: new Set(),
timeouts: new Set()
};
this._pendingCalls = new Set();
this._lastCallId = 0;
this._lastToId = 0;
this._memoizedDuration = 0;
if (!is.und(arg1) || !is.und(arg2)) {
const props = is.obj(arg1) ? _extends({}, arg1) : _extends({}, arg2, {
from: arg1
});
if (is.und(props.default)) {
props.default = true;
}
this.start(props);
}
}
get idle() {
return !(isAnimating(this) || this._state.asyncTo) || isPaused(this);
}
get goal() {
return getFluidValue(this.animation.to);
}
get velocity() {
const node = getAnimated(this);
return node instanceof AnimatedValue ? node.lastVelocity || 0 : node.getPayload().map(node => node.lastVelocity || 0);
}
get hasAnimated() {
return hasAnimated(this);
}
get isAnimating() {
return isAnimating(this);
}
get isPaused() {
return isPaused(this);
}
get isDelayed() {
return this._state.delayed;
}
advance(dt) {
let idle = true;
let changed = false;
const anim = this.animation;
let {
config,
toValues
} = anim;
const payload = getPayload(anim.to);
if (!payload && hasFluidValue(anim.to)) {
toValues = toArray(getFluidValue(anim.to));
}
anim.values.forEach((node, i) => {
if (node.done) return;
const to = node.constructor == AnimatedString ? 1 : payload ? payload[i].lastPosition : toValues[i];
let finished = anim.immediate;
let position = to;
if (!finished) {
position = node.lastPosition;
if (config.tension <= 0) {
node.done = true;
return;
}
let elapsed = node.elapsedTime += dt;
const from = anim.fromValues[i];
const v0 = node.v0 != null ? node.v0 : node.v0 = is.arr(config.velocity) ? config.velocity[i] : config.velocity;
let velocity;
if (!is.und(config.duration)) {
let p = 1;
if (config.duration > 0) {
if (this._memoizedDuration !== config.duration) {
this._memoizedDuration = config.duration;
if (node.durationProgress > 0) {
node.elapsedTime = config.duration * node.durationProgress;
elapsed = node.elapsedTime += dt;
}
}
p = (config.progress || 0) + elapsed / this._memoizedDuration;
p = p > 1 ? 1 : p < 0 ? 0 : p;
node.durationProgress = p;
}
position = from + config.easing(p) * (to - from);
velocity = (position - node.lastPosition) / dt;
finished = p == 1;
} else if (config.decay) {
const decay = config.decay === true ? 0.998 : config.decay;
const e = Math.exp(-(1 - decay) * elapsed);
position = from + v0 / (1 - decay) * (1 - e);
finished = Math.abs(node.lastPosition - position) < 0.1;
velocity = v0 * e;
} else {
velocity = node.lastVelocity == null ? v0 : node.lastVelocity;
const precision = config.precision || (from == to ? 0.005 : Math.min(1, Math.abs(to - from) * 0.001));
const restVelocity = config.restVelocity || precision / 10;
const bounceFactor = config.clamp ? 0 : config.bounce;
const canBounce = !is.und(bounceFactor);
const isGrowing = from == to ? node.v0 > 0 : from < to;
let isMoving;
let isBouncing = false;
const step = 1;
const numSteps = Math.ceil(dt / step);
for (let n = 0; n < numSteps; ++n) {
isMoving = Math.abs(velocity) > restVelocity;
if (!isMoving) {
finished = Math.abs(to - position) <= precision;
if (finished) {
break;
}
}
if (canBounce) {
isBouncing = position == to || position > to == isGrowing;
if (isBouncing) {
velocity = -velocity * bounceFactor;
position = to;
}
}
const springForce = -config.tension * 0.000001 * (position - to);
const dampingForce = -config.friction * 0.001 * velocity;
const acceleration = (springForce + dampingForce) / config.mass;
velocity = velocity + acceleration * step;
position = position + velocity * step;
}
}
node.lastVelocity = velocity;
if (Number.isNaN(position)) {
console.warn(`Got NaN while animating:`, this);
finished = true;
}
}
if (payload && !payload[i].done) {
finished = false;
}
if (finished) {
node.done = true;
} else {
idle = false;
}
if (node.setValue(position, config.round)) {
changed = true;
}
});
const node = getAnimated(this);
const currVal = node.getValue();
if (idle) {
const finalVal = getFluidValue(anim.to);
if ((currVal !== finalVal || changed) && !config.decay) {
node.setValue(finalVal);
this._onChange(finalVal);
} else if (changed && config.decay) {
this._onChange(currVal);
}
this._stop();
} else if (changed) {
this._onChange(currVal);
}
}
set(value) {
raf.batchedUpdates(() => {
this._stop();
this._focus(value);
this._set(value);
});
return this;
}
pause() {
this._update({
pause: true
});
}
resume() {
this._update({
pause: false
});
}
finish() {
if (isAnimating(this)) {
const {
to,
config
} = this.animation;
raf.batchedUpdates(() => {
this._onStart();
if (!config.decay) {
this._set(to, false);
}
this._stop();
});
}
return this;
}
update(props) {
const queue = this.queue || (this.queue = []);
queue.push(props);
return this;
}
start(to, arg2) {
let queue;
if (!is.und(to)) {
queue = [is.obj(to) ? to : _extends({}, arg2, {
to
})];
} else {
queue = this.queue || [];
this.queue = [];
}
return Promise.all(queue.map(props => {
const up = this._update(props);
return up;
})).then(results => getCombinedResult(this, results));
}
stop(cancel) {
const {
to
} = this.animation;
this._focus(this.get());
stopAsync(this._state, cancel && this._lastCallId);
raf.batchedUpdates(() => this._stop(to, cancel));
return this;
}
reset() {
this._update({
reset: true
});
}
eventObserved(event) {
if (event.type == 'change') {
this._start();
} else if (event.type == 'priority') {
this.priority = event.priority + 1;
}
}
_prepareNode(props) {
const key = this.key || '';
let {
to,
from
} = props;
to = is.obj(to) ? to[key] : to;
if (to == null || isAsyncTo(to)) {
to = undefined;
}
from = is.obj(from) ? from[key] : from;
if (from == null) {
from = undefined;
}
const range = {
to,
from
};
if (!hasAnimated(this)) {
if (props.reverse) [to, from] = [from, to];
from = getFluidValue(from);
if (!is.und(from)) {
this._set(from);
} else if (!getAnimated(this)) {
this._set(to);
}
}
return range;
}
_update(_ref, isLoop) {
let props = _extends({}, _ref);
const {
key,
defaultProps
} = this;
if (props.default) Object.assign(defaultProps, getDefaultProps(props, (value, prop) => /^on/.test(prop) ? resolveProp(value, key) : value));
mergeActiveFn(this, props, 'onProps');
sendEvent(this, 'onProps', props, this);
const range = this._prepareNode(props);
if (Object.isFrozen(this)) {
throw Error('Cannot animate a `SpringValue` object that is frozen. ' + 'Did you forget to pass your component to `animated(...)` before animating its props?');
}
const state = this._state;
return scheduleProps(++this._lastCallId, {
key,
props,
defaultProps,
state,
actions: {
pause: () => {
if (!isPaused(this)) {
setPausedBit(this, true);
flushCalls(state.pauseQueue);
sendEvent(this, 'onPause', getFinishedResult(this, checkFinished(this, this.animation.to)), this);
}
},
resume: () => {
if (isPaused(this)) {
setPausedBit(this, false);
if (isAnimating(this)) {
this._resume();
}
flushCalls(state.resumeQueue);
sendEvent(this, 'onResume', getFinishedResult(this, checkFinished(this, this.animation.to)), this);
}
},
start: this._merge.bind(this, range)
}
}).then(result => {
if (props.loop && result.finished && !(isLoop && result.noop)) {
const nextProps = createLoopUpdate(props);
if (nextProps) {
return this._update(nextProps, true);
}
}
return result;
});
}
_merge(range, props, resolve) {
if (props.cancel) {
this.stop(true);
return resolve(getCancelledResult(this));
}
const hasToProp = !is.und(range.to);
const hasFromProp = !is.und(range.from);
if (hasToProp || hasFromProp) {
if (props.callId > this._lastToId) {
this._lastToId = props.callId;
} else {
return resolve(getCancelledResult(this));
}
}
const {
key,
defaultProps,
animation: anim
} = this;
const {
to: prevTo,
from: prevFrom
} = anim;
let {
to = prevTo,
from = prevFrom
} = range;
if (hasFromProp && !hasToProp && (!props.default || is.und(to))) {
to = from;
}
if (props.reverse) [to, from] = [from, to];
const hasFromChanged = !isEqual(from, prevFrom);
if (hasFromChanged) {
anim.from = from;
}
from = getFluidValue(from);
const hasToChanged = !isEqual(to, prevTo);
if (hasToChanged) {
this._focus(to);
}
const hasAsyncTo = isAsyncTo(props.to);
const {
config
} = anim;
const {
decay,
velocity
} = config;
if (hasToProp || hasFromProp) {
config.velocity = 0;
}
if (props.config && !hasAsyncTo) {
mergeConfig(config, callProp(props.config, key), props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0);
}
let node = getAnimated(this);
if (!node || is.und(to)) {
return resolve(getFinishedResult(this, true));
}
const reset = is.und(props.reset) ? hasFromProp && !props.default : !is.und(from) && matchProp(props.reset, key);
const value = reset ? from : this.get();
const goal = computeGoal(to);
const isAnimatable = is.num(goal) || is.arr(goal) || isAnimatedString(goal);
const immediate = !hasAsyncTo && (!isAnimatable || matchProp(defaultProps.immediate || props.immediate, key));
if (hasToChanged) {
const nodeType = getAnimatedType(to);
if (nodeType !== node.constructor) {
if (immediate) {
node = this._set(goal);
} else throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`);
}
}
const goalType = node.constructor;
let started = hasFluidValue(to);
let finished = false;
if (!started) {
const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged;
if (hasToChanged || hasValueChanged) {
finished = isEqual(computeGoal(value), goal);
started = !finished;
}
if (!isEqual(anim.immediate, immediate) && !immediate || !isEqual(config.decay, decay) || !isEqual(config.velocity, velocity)) {
started = true;
}
}
if (finished && isAnimating(this)) {
if (anim.changed && !reset) {
started = true;
} else if (!started) {
this._stop(prevTo);
}
}
if (!hasAsyncTo) {
if (started || hasFluidValue(prevTo)) {
anim.values = node.getPayload();
anim.toValues = hasFluidValue(to) ? null : goalType == AnimatedString ? [1] : toArray(goal);
}
if (anim.immediate != immediate) {
anim.immediate = immediate;
if (!immediate && !reset) {
this._set(prevTo);
}
}
if (started) {
const {
onRest
} = anim;
each(ACTIVE_EVENTS, type => mergeActiveFn(this, props, type));
const result = getFinishedResult(this, checkFinished(this, prevTo));
flushCalls(this._pendingCalls, result);
this._pendingCalls.add(resolve);
if (anim.changed) raf.batchedUpdates(() => {
anim.changed = !reset;
onRest == null ? void 0 : onRest(result, this);
if (reset) {
callProp(defaultProps.onRest, result);
} else {
anim.onStart == null ? void 0 : anim.onStart(result, this);
}
});
}
}
if (reset) {
this._set(value);
}
if (hasAsyncTo) {
resolve(runAsync(props.to, props, this._state, this));
} else if (started) {
this._start();
} else if (isAnimating(this) && !hasToChanged) {
this._pendingCalls.add(resolve);
} else {
resolve(getNoopResult(value));
}
}
_focus(value) {
const anim = this.animation;
if (value !== anim.to) {
if (getFluidObservers(this)) {
this._detach();
}
anim.to = value;
if (getFluidObservers(this)) {
this._attach();
}
}
}
_attach() {
let priority = 0;
const {
to
} = this.animation;
if (hasFluidValue(to)) {
addFluidObserver(to, this);
if (isFrameValue(to)) {
priority = to.priority + 1;
}
}
this.priority = priority;
}
_detach() {
const {
to
} = this.animation;
if (hasFluidValue(to)) {
removeFluidObserver(to, this);
}
}
_set(arg, idle = true) {
const value = getFluidValue(arg);
if (!is.und(value)) {
const oldNode = getAnimated(this);
if (!oldNode || !isEqual(value, oldNode.getValue())) {
const nodeType = getAnimatedType(value);
if (!oldNode || oldNode.constructor != nodeType) {
setAnimated(this, nodeType.create(value));
} else {
oldNode.setValue(value);
}
if (oldNode) {
raf.batchedUpdates(() => {
this._onChange(value, idle);
});
}
}
}
return getAnimated(this);
}
_onStart() {
const anim = this.animation;
if (!anim.changed) {
anim.changed = true;
sendEvent(this, 'onStart', getFinishedResult(this, checkFinished(this, anim.to)), this);
}
}
_onChange(value, idle) {
if (!idle) {
this._onStart();
callProp(this.animation.onChange, value, this);
}
callProp(this.defaultProps.onChange, value, this);
super._onChange(value, idle);
}
_start() {
const anim = this.animation;
getAnimated(this).reset(getFluidValue(anim.to));
if (!anim.immediate) {
anim.fromValues = anim.values.map(node => node.lastPosition);
}
if (!isAnimating(this)) {
setActiveBit(this, true);
if (!isPaused(this)) {
this._resume();
}
}
}
_resume() {
if (Globals.skipAnimation) {
this.finish();
} else {
frameLoop.start(this);
}
}
_stop(goal, cancel) {
if (isAnimating(this)) {
setActiveBit(this, false);
const anim = this.animation;
each(anim.values, node => {
node.done = true;
});
if (anim.toValues) {
anim.onChange = anim.onPause = anim.onResume = undefined;
}
callFluidObservers(this, {
type: 'idle',
parent: this
});
const result = cancel ? getCancelledResult(this.get()) : getFinishedResult(this.get(), checkFinished(this, goal != null ? goal : anim.to));
flushCalls(this._pendingCalls, result);
if (anim.changed) {
anim.changed = false;
sendEvent(this, 'onRest', result, this);
}
}
}
}
function checkFinished(target, to) {
const goal = computeGoal(to);
const value = computeGoal(target.get());
return isEqual(value, goal);
}
function createLoopUpdate(props, loop = props.loop, to = props.to) {
let loopRet = callProp(loop);
if (loopRet) {
const overrides = loopRet !== true && inferTo(loopRet);
const reverse = (overrides || props).reverse;
const reset = !overrides || overrides.reset;
return createUpdate(_extends({}, props, {
loop,
default: false,
pause: undefined,
to: !reverse || isAsyncTo(to) ? to : undefined,
from: reset ? props.from : undefined,
reset
}, overrides));
}
}
function createUpdate(props) {
const {
to,
from
} = props = inferTo(props);
const keys = new Set();
if (is.obj(to)) findDefined(to, keys);
if (is.obj(from)) findDefined(from, keys);
props.keys = keys.size ? Array.from(keys) : null;
return props;
}
function declareUpdate(props) {
const update = createUpdate(props);
if (is.und(update.default)) {
update.default = getDefaultProps(update);
}
return update;
}
function findDefined(values, keys) {
eachProp(values, (value, key) => value != null && keys.add(key));
}
const ACTIVE_EVENTS = ['onStart', 'onRest', 'onChange', 'onPause', 'onResume'];
function mergeActiveFn(target, props, type) {
target.animation[type] = props[type] !== getDefaultProp(props, type) ? resolveProp(props[type], target.key) : undefined;
}
function sendEvent(target, type, ...args) {
var _target$animation$typ, _target$animation, _target$defaultProps$, _target$defaultProps;
(_target$animation$typ = (_target$animation = target.animation)[type]) == null ? void 0 : _target$animation$typ.call(_target$animation, ...args);
(_target$defaultProps$ = (_target$defaultProps = target.defaultProps)[type]) == null ? void 0 : _target$defaultProps$.call(_target$defaultProps, ...args);
}
const BATCHED_EVENTS = ['onStart', 'onChange', 'onRest'];
let nextId = 1;
class Controller {
constructor(props, flush) {
this.id = nextId++;
this.springs = {};
this.queue = [];
this.ref = void 0;
this._flush = void 0;
this._initialProps = void 0;
this._lastAsyncId = 0;
this._active = new Set();
this._changed = new Set();
this._started = false;
this._item = void 0;
this._state = {
paused: false,
pauseQueue: new Set(),
resumeQueue: new Set(),
timeouts: new Set()
};
this._events = {
onStart: new Map(),
onChange: new Map(),
onRest: new Map()
};
this._onFrame = this._onFrame.bind(this);
if (flush) {
this._flush = flush;
}
if (props) {
this.start(_extends({
default: true
}, props));
}
}
get idle() {
return !this._state.asyncTo && Object.values(this.springs).every(spring => {
return spring.idle && !spring.isDelayed && !spring.isPaused;
});
}
get item() {
return this._item;
}
set item(item) {
this._item = item;
}
get() {
const values = {};
this.each((spring, key) => values[key] = spring.get());
return values;
}
set(values) {
for (const key in values) {
const value = values[key];
if (!is.und(value)) {
this.springs[key].set(value);
}
}
}
update(props) {
if (props) {
this.queue.push(createUpdate(props));
}
return this;
}
start(props) {
let {
queue
} = this;
if (props) {
queue = toArray(props).map(createUpdate);
} else {
this.queue = [];
}
if (this._flush) {
return this._flush(this, queue);
}
prepareKeys(this, queue);
return flushUpdateQueue(this, queue);
}
stop(arg, keys) {
if (arg !== !!arg) {
keys = arg;
}
if (keys) {
const springs = this.springs;
each(toArray(keys), key => springs[key].stop(!!arg));
} else {
stopAsync(this._state, this._lastAsyncId);
this.each(spring => spring.stop(!!arg));
}
return this;
}
pause(keys) {
if (is.und(keys)) {
this.start({
pause: true
});
} else {
const springs = this.springs;
each(toArray(keys), key => springs[key].pause());
}
return this;
}
resume(keys) {
if (is.und(keys)) {
this.start({
pause: false
});
} else {
const springs = this.springs;
each(toArray(keys), key => springs[key].resume());
}
return this;
}
each(iterator) {
eachProp(this.springs, iterator);
}
_onFrame() {
const {
onStart,
onChange,
onRest
} = this._events;
const active = this._active.size > 0;
const changed = this._changed.size > 0;
if (active && !this._started || changed && !this._started) {
this._started = true;
flush(onStart, ([onStart, result]) => {
result.value = this.get();
onStart(result, this, this._item);
});
}
const idle = !active && this._started;
const values = changed || idle && onRest.size ? this.get() : null;
if (changed && onChange.size) {
flush(onChange, ([onChange, result]) => {
result.value = values;
onChange(result, this, this._item);
});
}
if (idle) {
this._started = false;
flush(onRest, ([onRest, result]) => {
result.value = values;
onRest(result, this, this._item);
});
}
}
eventObserved(event) {
if (event.type == 'change') {
this._changed.add(event.parent);
if (!event.idle) {
this._active.add(event.parent);
}
} else if (event.type == 'idle') {
this._active.delete(event.parent);
} else return;
raf.onFrame(this._onFrame);
}
}
function flushUpdateQueue(ctrl, queue) {
return Promise.all(queue.map(props => flushUpdate(ctrl, props))).then(results => getCombinedResult(ctrl, results));
}
async function flushUpdate(ctrl, props, isLoop) {
const {
keys,
to,
from,
loop,
onRest,
onResolve
} = props;
const defaults = is.obj(props.default) && props.default;
if (loop) {
props.loop = false;
}
if (to === false) props.to = null;
if (from === false) props.from = null;
const asyncTo = is.arr(to) || is.fun(to) ? to : undefined;
if (asyncTo) {
props.to = undefined;
props.onRest = undefined;
if (defaults) {
defaults.onRest = undefined;
}
} else {
each(BATCHED_EVENTS, key => {
const handler = props[key];
if (is.fun(handler)) {
const queue = ctrl['_events'][key];
props[key] = ({
finished,
cancelled
}) => {
const result = queue.get(handler);
if (result) {
if (!finished) result.finished = false;
if (cancelled) result.cancelled = true;
} else {
queue.set(handler, {
value: null,
finished: finished || false,
cancelled: cancelled || false
});
}
};
if (defaults) {
defaults[key] = props[key];
}
}
});
}
const state = ctrl['_state'];
if (props.pause === !state.paused) {
state.paused = props.pause;
flushCalls(props.pause ? state.pauseQueue : state.resumeQueue);
} else if (state.paused) {
props.pause = true;
}
const promises = (keys || Object.keys(ctrl.springs)).map(key => ctrl.springs[key].start(props));
const cancel = props.cancel === true || getDefaultProp(props, 'cancel') === true;
if (asyncTo || cancel && state.asyncId) {
promises.push(scheduleProps(++ctrl['_lastAsyncId'], {
props,
state,
actions: {
pause: noop,
resume: noop,
start(props, resolve) {
if (cancel) {
stopAsync(state, ctrl['_lastAsyncId']);
resolve(getCancelledResult(ctrl));
} else {
props.onRest = onRest;
resolve(runAsync(asyncTo, props, state, ctrl));
}
}
}
}));
}
if (state.paused) {
await new Promise(resume => {
state.resumeQueue.add(resume);
});
}
const result = getCombinedResult(ctrl, await Promise.all(promises));
if (loop && result.finished && !(isLoop && result.noop)) {
const nextProps = createLoopUpdate(props, loop, to);
if (nextProps) {
prepareKeys(ctrl, [nextProps]);
return flushUpdate(ctrl, nextProps, true);
}
}
if (onResolve) {
raf.batchedUpdates(() => onResolve(result, ctrl, ctrl.item));
}
return result;
}
function getSprings(ctrl, props) {
const springs = _extends({}, ctrl.springs);
if (props) {
each(toArray(props), props => {
if (is.und(props.keys)) {
props = createUpdate(props);
}
if (!is.obj(props.to)) {
props = _extends({}, props, {
to: undefined
});
}
prepareSprings(springs, props, key => {
return createSpring(key);
});
});
}
setSprings(ctrl, springs);
return springs;
}
function setSprings(ctrl, springs) {
eachProp(springs, (spring, key) => {
if (!ctrl.springs[key]) {
ctrl.springs[key] = spring;
addFluidObserver(spring, ctrl);
}
});
}
function createSpring(key, observer) {
const spring = new SpringValue();
spring.key = key;
if (observer) {
addFluidObserver(spring, observer);
}
return spring;
}
function prepareSprings(springs, props, create) {
if (props.keys) {
each(props.keys, key => {
const spring = springs[key] || (springs[key] = create(key));
spring['_prepareNode'](props);
});
}
}
function prepareKeys(ctrl, queue) {
each(queue, props => {
prepareSprings(ctrl.springs, props, key => {
return createSpring(key, ctrl);
});
});
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
const _excluded$3 = ["children"];
const SpringContext = _ref => {
let {
children
} = _ref,
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
const inherited = useContext(ctx);
const pause = props.pause || !!inherited.pause,
immediate = props.immediate || !!inherited.immediate;
props = useMemoOne(() => ({
pause,
immediate
}), [pause, immediate]);
const {
Provider
} = ctx;
return React.createElement(Provider, {
value: props
}, children);
};
const ctx = makeContext(SpringContext, {});
SpringContext.Provider = ctx.Provider;
SpringContext.Consumer = ctx.Consumer;
function makeContext(target, init) {
Object.assign(target, React.createContext(init));
target.Provider._context = target;
target.Consumer._context = target;
return target;
}
const SpringRef = () => {
const current = [];
const SpringRef = function SpringRef(props) {
deprecateDirectCall();
const results = [];
each(current, (ctrl, i) => {
if (is.und(props)) {
results.push(ctrl.start());
} else {
const update = _getProps(props, ctrl, i);
if (update) {
results.push(ctrl.start(update));
}
}
});
return results;
};
SpringRef.current = current;
SpringRef.add = function (ctrl) {
if (!current.includes(ctrl)) {
current.push(ctrl);
}
};
SpringRef.delete = function (ctrl) {
const i = current.indexOf(ctrl);
if (~i) current.splice(i, 1);
};
SpringRef.pause = function () {
each(current, ctrl => ctrl.pause(...arguments));
return this;
};
SpringRef.resume = function () {
each(current, ctrl => ctrl.resume(...arguments));
return this;
};
SpringRef.set = function (values) {
each(current, ctrl => ctrl.set(values));
};
SpringRef.start = function (props) {
const results = [];
each(current, (ctrl, i) => {
if (is.und(props)) {
results.push(ctrl.start());
} else {
const update = this._getProps(props, ctrl, i);
if (update) {
results.push(ctrl.start(update));
}
}
});
return results;
};
SpringRef.stop = function () {
each(current, ctrl => ctrl.stop(...arguments));
return this;
};
SpringRef.update = function (props) {
each(current, (ctrl, i) => ctrl.update(this._getProps(props, ctrl, i)));
return this;
};
const _getProps = function _getProps(arg, ctrl, index) {
return is.fun(arg) ? arg(index, ctrl) : arg;
};
SpringRef._getProps = _getProps;
return SpringRef;
};
function useSprings(length, props, deps) {
const propsFn = is.fun(props) && props;
if (propsFn && !deps) deps = [];
const ref = useMemo(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []);
const layoutId = useRef(0);
const forceUpdate = useForceUpdate();
const state = useMemo(() => ({
ctrls: [],
queue: [],
flush(ctrl, updates) {
const springs = getSprings(ctrl, updates);
const canFlushSync = layoutId.current > 0 && !state.queue.length && !Object.keys(springs).some(key => !ctrl.springs[key]);
return canFlushSync ? flushUpdateQueue(ctrl, updates) : new Promise(resolve => {
setSprings(ctrl, springs);
state.queue.push(() => {
resolve(flushUpdateQueue(ctrl, updates));
});
forceUpdate();
});
}
}), []);
const ctrls = useRef([...state.ctrls]);
const updates = [];
const prevLength = usePrev(length) || 0;
useMemo(() => {
each(ctrls.current.slice(length, prevLength), ctrl => {
detachRefs(ctrl, ref);
ctrl.stop(true);
});
ctrls.current.length = length;
declareUpdates(prevLength, length);
}, [length]);
useMemo(() => {
declareUpdates(0, Math.min(prevLength, length));
}, deps);
function declareUpdates(startIndex, endIndex) {
for (let i = startIndex; i < endIndex; i++) {
const ctrl = ctrls.current[i] || (ctrls.current[i] = new Controller(null, state.flush));
const update = propsFn ? propsFn(i, ctrl) : props[i];
if (update) {
updates[i] = declareUpdate(update);
}
}
}
const springs = ctrls.current.map((ctrl, i) => getSprings(ctrl, updates[i]));
const context = useContext(SpringContext);
const prevContext = usePrev(context);
const hasContext = context !== prevContext && hasProps(context);
useLayoutEffect(() => {
layoutId.current++;
state.ctrls = ctrls.current;
const {
queue
} = state;
if (queue.length) {
state.queue = [];
each(queue, cb => cb());
}
each(ctrls.current, (ctrl, i) => {
ref == null ? void 0 : ref.add(ctrl);
if (hasContext) {
ctrl.start({
default: context
});
}
const update = updates[i];
if (update) {
replaceRef(ctrl, update.ref);
if (ctrl.ref) {
ctrl.queue.push(update);
} else {
ctrl.start(update);
}
}
});
});
useOnce(() => () => {
each(state.ctrls, ctrl => ctrl.stop(true));
});
const values = springs.map(x => _extends({}, x));
return ref ? [values, ref] : values;
}
function useSpring(props, deps) {
const isFn = is.fun(props);
const [[values], ref] = useSprings(1, isFn ? props : [props], isFn ? deps || [] : deps);
return isFn || arguments.length == 2 ? [values, ref] : values;
}
const initSpringRef = () => SpringRef();
const useSpringRef = () => useState(initSpringRef)[0];
function useTrail(length, propsArg, deps) {
var _passedRef;
const propsFn = is.fun(propsArg) && propsArg;
if (propsFn && !deps) deps = [];
let reverse = true;
let passedRef = undefined;
const result = useSprings(length, (i, ctrl) => {
const props = propsFn ? propsFn(i, ctrl) : propsArg;
passedRef = props.ref;
reverse = reverse && props.reverse;
return props;
}, deps || [{}]);
const ref = (_passedRef = passedRef) != null ? _passedRef : result[1];
useLayoutEffect(() => {
each(ref.current, (ctrl, i) => {
const parent = ref.current[i + (reverse ? 1 : -1)];
if (parent) {
ctrl.start({
to: parent.springs
});
} else {
ctrl.start();
}
});
}, deps);
if (propsFn || arguments.length == 3) {
ref['_getProps'] = (propsArg, ctrl, i) => {
const props = is.fun(propsArg) ? propsArg(i, ctrl) : propsArg;
if (props) {
const parent = ref.current[i + (props.reverse ? 1 : -1)];
if (parent) props.to = parent.springs;
return props;
}
};
return result;
}
ref['start'] = propsArg => {
const results = [];
each(ref.current, (ctrl, i) => {
const props = is.fun(propsArg) ? propsArg(i, ctrl) : propsArg;
const parent = ref.current[i + (reverse ? 1 : -1)];
if (parent) {
results.push(ctrl.start(_extends({}, props, {
to: parent.springs
})));
} else {
results.push(ctrl.start(_extends({}, props)));
}
});
return results;
};
return result[0];
}
let TransitionPhase;
(function (TransitionPhase) {
TransitionPhase["MOUNT"] = "mount";
TransitionPhase["ENTER"] = "enter";
TransitionPhase["UPDATE"] = "update";
TransitionPhase["LEAVE"] = "leave";
})(TransitionPhase || (TransitionPhase = {}));
function useTransition(data, props, deps) {
const propsFn = is.fun(props) && props;
const {
reset,
sort,
trail = 0,
expires = true,
exitBeforeEnter = false,
onDestroyed,
ref: propsRef,
config: propsConfig
} = propsFn ? propsFn() : props;
const ref = useMemo(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []);
const items = toArray(data);
const transitions = [];
const usedTransitions = useRef(null);
const prevTransitions = reset ? null : usedTransitions.current;
useLayoutEffect(() => {
usedTransitions.current = transitions;
});
useOnce(() => {
each(usedTransitions.current, t => {
var _t$ctrl$ref;
(_t$ctrl$ref = t.ctrl.ref) == null ? void 0 : _t$ctrl$ref.add(t.ctrl);
const change = changes.get(t);
if (change) {
t.ctrl.start(change.payload);
}
});
return () => {
each(usedTransitions.current, t => {
if (t.expired) {
clearTimeout(t.expirationId);
}
detachRefs(t.ctrl, ref);
t.ctrl.stop(true);
});
};
});
const keys = getKeys(items, propsFn ? propsFn() : props, prevTransitions);
const expired = reset && usedTransitions.current || [];
useLayoutEffect(() => each(expired, ({
ctrl,
item,
key
}) => {
detachRefs(ctrl, ref);
callProp(onDestroyed, item, key);
}));
const reused = [];
if (prevTransitions) each(prevTransitions, (t, i) => {
if (t.expired) {
clearTimeout(t.expirationId);
expired.push(t);
} else {
i = reused[i] = keys.indexOf(t.key);
if (~i) transitions[i] = t;
}
});
each(items, (item, i) => {
if (!transitions[i]) {
transitions[i] = {
key: keys[i],
item,
phase: TransitionPhase.MOUNT,
ctrl: new Controller()
};
transitions[i].ctrl.item = item;
}
});
if (reused.length) {
let i = -1;
const {
leave
} = propsFn ? propsFn() : props;
each(reused, (keyIndex, prevIndex) => {
const t = prevTransitions[prevIndex];
if (~keyIndex) {
i = transitions.indexOf(t);
transitions[i] = _extends({}, t, {
item: items[keyIndex]
});
} else if (leave) {
transitions.splice(++i, 0, t);
}
});
}
if (is.fun(sort)) {
transitions.sort((a, b) => sort(a.item, b.item));
}
let delay = -trail;
const forceUpdate = useForceUpdate();
const defaultProps = getDefaultProps(props);
const changes = new Map();
const exitingTransitions = useRef(new Map());
const forceChange = useRef(false);
each(transitions, (t, i) => {
const key = t.key;
const prevPhase = t.phase;
const p = propsFn ? propsFn() : props;
let to;
let phase;
let propsDelay = callProp(p.delay || 0, key);
if (prevPhase == TransitionPhase.MOUNT) {
to = p.enter;
phase = TransitionPhase.ENTER;
} else {
const isLeave = keys.indexOf(key) < 0;
if (prevPhase != TransitionPhase.LEAVE) {
if (isLeave) {
to = p.leave;
phase = TransitionPhase.LEAVE;
} else if (to = p.update) {
phase = TransitionPhase.UPDATE;
} else return;
} else if (!isLeave) {
to = p.enter;
phase = TransitionPhase.ENTER;
} else return;
}
to = callProp(to, t.item, i);
to = is.obj(to) ? inferTo(to) : {
to
};
if (!to.config) {
const config = propsConfig || defaultProps.config;
to.config = callProp(config, t.item, i, phase);
}
delay += trail;
const payload = _extends({}, defaultProps, {
delay: propsDelay + delay,
ref: propsRef,
immediate: p.immediate,
reset: false
}, to);
if (phase == TransitionPhase.ENTER && is.und(payload.from)) {
const _p = propsFn ? propsFn() : props;
const from = is.und(_p.initial) || prevTransitions ? _p.from : _p.initial;
payload.from = callProp(from, t.item, i);
}
const {
onResolve
} = payload;
payload.onResolve = result => {
callProp(onResolve, result);
const transitions = usedTransitions.current;
const t = transitions.find(t => t.key === key);
if (!t) return;
if (result.cancelled && t.phase != TransitionPhase.UPDATE) {
return;
}
if (t.ctrl.idle) {
const idle = transitions.every(t => t.ctrl.idle);
if (t.phase == TransitionPhase.LEAVE) {
const expiry = callProp(expires, t.item);
if (expiry !== false) {
const expiryMs = expiry === true ? 0 : expiry;
t.expired = true;
if (!idle && expiryMs > 0) {
if (expiryMs <= 0x7fffffff) t.expirationId = setTimeout(forceUpdate, expiryMs);
return;
}
}
}
if (idle && transitions.some(t => t.expired)) {
exitingTransitions.current.delete(t);
if (exitBeforeEnter) {
forceChange.current = true;
}
forceUpdate();
}
}
};
const springs = getSprings(t.ctrl, payload);
if (phase === TransitionPhase.LEAVE && exitBeforeEnter) {
exitingTransitions.current.set(t, {
phase,
springs,
payload
});
} else {
changes.set(t, {
phase,
springs,
payload
});
}
});
const context = useContext(SpringContext);
const prevContext = usePrev(context);
const hasContext = context !== prevContext && hasProps(context);
useLayoutEffect(() => {
if (hasContext) {
each(transitions, t => {
t.ctrl.start({
default: context
});
});
}
}, [context]);
each(changes, (_, t) => {
if (exitingTransitions.current.size) {
const ind = transitions.findIndex(state => state.key === t.key);
transitions.splice(ind, 1);
}
});
useLayoutEffect(() => {
each(exitingTransitions.current.size ? exitingTransitions.current : changes, ({
phase,
payload
}, t) => {
const {
ctrl
} = t;
t.phase = phase;
ref == null ? void 0 : ref.add(ctrl);
if (hasContext && phase == TransitionPhase.ENTER) {
ctrl.start({
default: context
});
}
if (payload) {
replaceRef(ctrl, payload.ref);
if (ctrl.ref && !forceChange.current) {
ctrl.update(payload);
} else {
ctrl.start(payload);
if (forceChange.current) {
forceChange.current = false;
}
}
}
});
}, reset ? void 0 : deps);
const renderTransitions = render => React.createElement(React.Fragment, null, transitions.map((t, i) => {
const {
springs
} = changes.get(t) || t.ctrl;
const elem = render(_extends({}, springs), t.item, t, i);
return elem && elem.type ? React.createElement(elem.type, _extends({}, elem.props, {
key: is.str(t.key) || is.num(t.key) ? t.key : t.ctrl.id,
ref: elem.ref
})) : elem;
}));
return ref ? [renderTransitions, ref] : renderTransitions;
}
let nextKey = 1;
function getKeys(items, {
key,
keys = key
}, prevTransitions) {
if (keys === null) {
const reused = new Set();
return items.map(item => {
const t = prevTransitions && prevTransitions.find(t => t.item === item && t.phase !== TransitionPhase.LEAVE && !reused.has(t));
if (t) {
reused.add(t);
return t.key;
}
return nextKey++;
});
}
return is.und(keys) ? items : is.fun(keys) ? items.map(keys) : toArray(keys);
}
const _excluded$2 = ["children"];
function Spring(_ref) {
let {
children
} = _ref,
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
return children(useSpring(props));
}
const _excluded$1 = ["items", "children"];
function Trail(_ref) {
let {
items,
children
} = _ref,
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
const trails = useTrail(items.length, props);
return items.map((item, index) => {
const result = children(item, index);
return is.fun(result) ? result(trails[index]) : result;
});
}
const _excluded = ["items", "children"];
function Transition(_ref) {
let {
items,
children
} = _ref,
props = _objectWithoutPropertiesLoose(_ref, _excluded);
return useTransition(items, props)(children);
}
class Interpolation extends FrameValue {
constructor(source, args) {
super();
this.key = void 0;
this.idle = true;
this.calc = void 0;
this._active = new Set();
this.source = source;
this.calc = createInterpolator(...args);
const value = this._get();
const nodeType = getAnimatedType(value);
setAnimated(this, nodeType.create(value));
}
advance(_dt) {
const value = this._get();
const oldValue = this.get();
if (!isEqual(value, oldValue)) {
getAnimated(this).setValue(value);
this._onChange(value, this.idle);
}
if (!this.idle && checkIdle(this._active)) {
becomeIdle(this);
}
}
_get() {
const inputs = is.arr(this.source) ? this.source.map(getFluidValue) : toArray(getFluidValue(this.source));
return this.calc(...inputs);
}
_start() {
if (this.idle && !checkIdle(this._active)) {
this.idle = false;
each(getPayload(this), node => {
node.done = false;
});
if (Globals.skipAnimation) {
raf.batchedUpdates(() => this.advance());
becomeIdle(this);
} else {
frameLoop.start(this);
}
}
}
_attach() {
let priority = 1;
each(toArray(this.source), source => {
if (hasFluidValue(source)) {
addFluidObserver(source, this);
}
if (isFrameValue(source)) {
if (!source.idle) {
this._active.add(source);
}
priority = Math.max(priority, source.priority + 1);
}
});
this.priority = priority;
this._start();
}
_detach() {
each(toArray(this.source), source => {
if (hasFluidValue(source)) {
removeFluidObserver(source, this);
}
});
this._active.clear();
becomeIdle(this);
}
eventObserved(event) {
if (event.type == 'change') {
if (event.idle) {
this.advance();
} else {
this._active.add(event.parent);
this._start();
}
} else if (event.type == 'idle') {
this._active.delete(event.parent);
} else if (event.type == 'priority') {
this.priority = toArray(this.source).reduce((highest, parent) => Math.max(highest, (isFrameValue(parent) ? parent.priority : 0) + 1), 0);
}
}
}
function isIdle(source) {
return source.idle !== false;
}
function checkIdle(active) {
return !active.size || Array.from(active).every(isIdle);
}
function becomeIdle(self) {
if (!self.idle) {
self.idle = true;
each(getPayload(self), node => {
node.done = true;
});
callFluidObservers(self, {
type: 'idle',
parent: self
});
}
}
const to = (source, ...args) => new Interpolation(source, args);
const interpolate = (source, ...args) => (deprecateInterpolate(), new Interpolation(source, args));
Globals.assign({
createStringInterpolator,
to: (source, args) => new Interpolation(source, args)
});
const update = frameLoop.advance;
export { BailSignal, Controller, FrameValue, Interpolation, Spring, SpringContext, SpringRef, SpringValue, Trail, Transition, config, easings, inferTo, interpolate, to, update, useChain, useSpring, useSpringRef, useSprings, useTrail, useTransition };
webpack://frontend-tpt/../../node_modules/@react-spring/native/dist/react-spring-native.esm.js
import { View, Text, Image, StyleSheet } from 'react-native';
import { AnimatedObject, createHost } from '@react-spring/animated';
import { eachProp, getFluidValue, each, Globals, createStringInterpolator, colors, is } from '@react-spring/shared';
export * from '@react-spring/core';
const primitives = {
View: View,
Text: Text,
Image
};
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
class AnimatedTransform extends AnimatedObject {
constructor(source) {
super(source);
}
getValue() {
return this.source ? this.source.map(source => {
const transform = {};
eachProp(source, (source, key) => {
transform[key] = getFluidValue(source);
});
return transform;
}) : [];
}
setValue(source) {
this.source = source;
this.payload = this._makePayload(source);
}
_makePayload(source) {
if (!source) return [];
const payload = new Set();
each(source, transform => eachProp(transform, this._addToPayload, payload));
return Array.from(payload);
}
}
class AnimatedStyle extends AnimatedObject {
constructor(style) {
super(style);
}
setValue(style) {
super.setValue(style && style.transform ? _extends({}, style, {
transform: new AnimatedTransform(style.transform)
}) : style);
}
}
Globals.assign({
batchedUpdates: require('react-native').unstable_batchedUpdates,
createStringInterpolator,
colors
});
const host = createHost(primitives, {
applyAnimatedValues(instance, props) {
if (is.und(props.children) && instance.setNativeProps) {
instance.setNativeProps(props);
return true;
}
return false;
},
createAnimatedStyle(styles) {
styles = StyleSheet.flatten(styles);
if (is.obj(styles.shadowOffset)) {
styles.shadowOffset = new AnimatedObject(styles.shadowOffset);
}
return new AnimatedStyle(styles);
}
});
const animated = host.animated;
export { animated as a, animated };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/loading/components/spinner/index.tsx
import React from "react";
import { Circle, G } from "react-native-svg";
import { animated, useSpring } from "@react-spring/native";
import { easeExpInOut } from "d3-ease";
import { useQaLabel } from "../../../../hooks";
import { SpinnerProps } from "../../types";
const AnimatedCircle = animated(G);
export const Spinner = ({ strokeWidth, color }: SpinnerProps) => {
const circleTestProps = useQaLabel("circle");
const { strokeDashoffset } = useSpring({
from: { strokeDashoffset: 68 },
to: { strokeDashoffset: 5 },
config: { easing: easeExpInOut, duration: 1800 },
loop: { reverse: true },
reset: true
});
return (
<AnimatedCircle
strokeDasharray="68.7"
strokeDashoffset={strokeDashoffset}
stroke={color}
strokeWidth={strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
transform="rotate(-90 12 12)"
{...circleTestProps}
>
<Circle fill="transparent" cx="12" cy="12" r="11" />
</AnimatedCircle>
);
};
export default Spinner;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/loading/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
export const Container = styled(View)<{ iconSize: string }>`
display: flex;
flex-flow: row wrap;
align-content: center;
height: ${(props) => props.iconSize}px;
width: ${(props) => props.iconSize}px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/loading/index.tsx
import React, { forwardRef, memo, useEffect } from "react";
import { Animated, View } from "react-native";
import { Svg, Circle } from "react-native-svg";
import { easeExpInOut } from "d3-ease";
import { get } from "lodash";
import { useTheme } from "../../theming";
import { useIconSize, useQaLabel } from "../../hooks";
import { Spinner } from "./components";
import { Container } from "./styled-components";
import { LoadingProps } from "./types";
const LoadingSpinner = forwardRef<View, LoadingProps>(
(
{
size = "l",
color = "blue_accent.500",
bgColor = "blue_accent.200",
qaLabel = "loading-spinner"
}: LoadingProps,
ref
) => {
const testProps = useQaLabel(qaLabel);
const { colors } = useTheme();
const { iconSize, strokeWidth } = useIconSize(size);
const rotationAnim = new Animated.Value(0);
const interpolateRotation = rotationAnim.interpolate({
inputRange: [0, 1],
outputRange: ["0deg", "360deg"]
});
useEffect(() => {
const animation = Animated.loop(
Animated.timing(rotationAnim, {
useNativeDriver: false,
toValue: 1,
duration: 1800,
easing: easeExpInOut
}),
{
iterations: -1
}
);
animation.start();
return () => {
if (animation) {
animation.stop();
}
};
}, []);
return (
<Container {...testProps} iconSize={iconSize} ref={ref}>
<Animated.View style={{ transform: [{ rotate: interpolateRotation }] }}>
<Svg viewBox="0 0 24 24" height={iconSize} width={iconSize}>
<Circle
fill="transparent"
cx="12"
cy="12"
r="11"
stroke={get(colors, bgColor, bgColor)}
strokeWidth="2"
strokeDasharray="68.7"
/>
<Spinner
color={get(colors, color, color)}
strokeWidth={strokeWidth}
/>
</Svg>
</Animated.View>
</Container>
);
}
);
export const Loading = LoadingSpinner;
export type { LoadingProps };
export default memo(LoadingSpinner);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/iconButton/styled-components.ts
import styled from "styled-components/native";
import { View, TouchableHighlight } from "react-native";
import { space, compose, variant } from "../../theming/styledSystem";
import { useQaLabel } from "../../hooks/useQaLabel";
import { IconButtonProps } from "./types";
export const iconButtonSizes = {
s: {
width: "32px",
height: "32px",
padding: "space-2",
borderRadius: "16px"
},
m: {
width: "44px",
height: "44px",
padding: "space-4",
borderRadius: "22px"
},
l: {
width: "48px",
height: "48px",
padding: "14px",
borderRadius: "24px"
}
};
const buttonStyles = compose(
space,
variant({ prop: "size", variants: iconButtonSizes })
);
export const StyledButton = styled(TouchableHighlight).attrs<{
qaLabel: string;
}>((props: IconButtonProps) => ({
accessibilityRole: "button",
accessibilityLabel: props.textTooltip,
...useQaLabel(props.qaLabel)
}))<
IconButtonProps & {
hoveredColor: boolean;
pressedColor: boolean;
isHovered: boolean;
isPressed: boolean;
}
>`
align-items: center;
justify-content: center;
border-radius: var(--fd-radii-border-radius-010);
${({ theme, variant: buttonVariant }) =>
theme.iconButtons[buttonVariant]?.default};
${({
theme,
variant: buttonVariant,
isDisabled,
hoveredColor,
pressedColor,
isHovered,
isPressed,
isActive
}) =>
isActive
? theme.iconButtons[buttonVariant]?.pressed
: (!isDisabled &&
isPressed &&
(buttonVariant !== "tertiary"
? theme.iconButtons[buttonVariant]?.pressed
: `background-color:${pressedColor}`)) ||
(!isDisabled &&
(isHovered || isActive) &&
(buttonVariant !== "tertiary"
? theme.iconButtons[buttonVariant]?.hovered
: `background-color:${hoveredColor}`))};
opacity: ${(props) => (props.isDisabled ? 0.5 : 1)};
${buttonStyles}
`;
export const Container = styled(View)`
align-items: center;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/context/popperReducer.ts
import { State, ReducerActions, ReducerActionTypes } from "../types";
export const INITIAL_STATE: State = {
isOpen: false,
triggerLayout: {
x: 0,
y: 0,
width: 0,
height: 0
}
};
export const ACTIONS: ReducerActionTypes = {
OPEN_POPPER: "OPEN_POPPER",
CLOSE_POPPER: "CLOSE_POPPER"
};
const popperReducer = (
state: State = INITIAL_STATE,
action: ReducerActions
) => {
switch (action.type) {
case ACTIONS.OPEN_POPPER:
return {
...state,
isOpen: true,
triggerLayout: action.payload
};
case ACTIONS.CLOSE_POPPER:
return {
...state,
isOpen: false
};
default:
return state;
}
};
export default popperReducer;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/context/popperProvider.tsx
import React, {
createContext,
useContext,
useReducer,
useMemo,
FC
} from "react";
import { Context } from "../types";
import popperReducer, { INITIAL_STATE } from "./popperReducer";
const PopperContext = createContext<Context>([INITIAL_STATE, () => {}]);
const PopperProvider: FC = ({ children }) => {
const [state, dispatch] = useReducer(popperReducer, INITIAL_STATE);
const context: Context = useMemo(() => [state, dispatch], [state, dispatch]);
return (
<PopperContext.Provider value={context}>{children}</PopperContext.Provider>
);
};
export const usePopperContext = () => useContext(PopperContext);
export default PopperProvider;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/hooks/usePopper.ts
import { useCallback, useMemo, useEffect } from "react";
import { Platform } from "react-native";
import { usePopperContext } from "../context/popperProvider";
import { ACTIONS } from "../context/popperReducer";
import { EventTypes, Layout } from "../types";
const isWeb = Platform.OS === "web";
const usePopper = () => {
const [state, dispatch] = usePopperContext();
useEffect(() => {
if (Platform.OS === "web" && typeof window !== "undefined") {
window.addEventListener("scroll", closeContent);
}
return () => {
if (Platform.OS === "web" && typeof window !== "undefined") {
window.removeEventListener("scroll", closeContent);
}
};
}, []);
const openContent = useCallback(
(triggerLayout: Layout) => {
dispatch({ type: ACTIONS.OPEN_POPPER, payload: triggerLayout });
},
[dispatch]
);
const closeContent = useCallback(() => {
dispatch({ type: ACTIONS.CLOSE_POPPER });
}, [dispatch]);
const getHandlers = useCallback(
(
on: EventTypes = "press",
callback: (fn: (layout: Layout) => void) => void
) => {
const openCallback = () => callback(openContent);
if (on === "hover" && !isWeb) return null;
if (on === "hover" && isWeb) {
return {
onMouseEnter: openCallback,
onMouseLeave: closeContent,
onFocus: openCallback,
onBlur: closeContent
};
}
return { onPress: state.isOpen ? closeContent : openCallback };
},
[state.isOpen]
);
return useMemo(
() => ({
isWeb,
isOpen: state.isOpen,
triggerLayout: state.triggerLayout,
openContent,
closeContent,
getHandlers
}),
[isWeb, state.isOpen, openContent, closeContent, getHandlers]
);
};
export default usePopper;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/hooks/useCloseOnClickOutside.ts
/* TODO: move to a global hooks folder */
import { useEffect, RefObject } from "react";
import { View } from "react-native";
export interface CloseOnClickOutside {
isWeb: boolean;
refs: RefObject<View>[];
onPress: () => void;
}
const isTouchDevice =
typeof window !== "undefined" &&
typeof navigator !== "undefined" &&
("ontouchstart" in window || navigator.maxTouchPoints > 0);
const useCloseOnClickOutside = ({
isWeb,
refs,
onPress
}: CloseOnClickOutside) => {
useEffect(() => {
const listener = (e: MouseEvent | TouchEvent) => {
let clickedInRefs = false;
if (refs) {
refs.forEach((ref) => {
if (
ref &&
ref.current &&
ref.current instanceof HTMLElement &&
ref.current.contains(e.target as HTMLElement)
) {
clickedInRefs = true;
}
});
}
if (!clickedInRefs) onPress();
};
const eventName = isTouchDevice ? "touchstart" : "click";
if (isWeb) {
document.addEventListener(eventName, listener);
}
return () => {
if (isWeb) {
document.removeEventListener(eventName, listener);
}
};
}, []);
};
export default useCloseOnClickOutside;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/hooks/useGetCoordinates.ts
import { Dispatch, SetStateAction, useEffect, useState } from "react";
import { useDebounce } from "../../../hooks";
import { Layout, Placement } from "../types";
export interface GetCoordinates {
triggerLayout: Layout;
placement: Placement;
windowWidth: number;
windowHeight: number;
}
interface Coordinates {
top: number;
left?: number;
right?: number;
}
const DEFAULT_COORDINATES: Coordinates = {
left: 0,
top: 0
};
const useGetCoordinates = ({
triggerLayout,
placement,
windowWidth,
windowHeight
}: GetCoordinates) => {
const {
x: triggerX = 0,
y: triggerY = 0,
width: triggerWidth,
height: triggerHeight
} = triggerLayout;
const [coordinates, setCoordinates]: [
Coordinates,
Dispatch<SetStateAction<Coordinates>>
] = useState(DEFAULT_COORDINATES);
const [isReady, setIsReady]: [boolean, Dispatch<SetStateAction<boolean>>] =
useState(false as boolean);
const debounce = useDebounce();
const getHorizontalCoordinates = (contentWidth: number) => {
if (triggerWidth >= contentWidth) {
return triggerX + (triggerWidth - contentWidth) / 2;
}
return triggerX - contentWidth / 2 + triggerWidth / 2;
};
const getVerticalCoordinates = (contentHeight: number) => {
if (triggerHeight >= contentHeight) {
return triggerY + (triggerHeight - contentHeight) / 2;
}
return triggerY - contentHeight / 2 + triggerHeight / 2;
};
const updateCoordinates = (contentWidth: number, contentHeight: number) => {
const newCoordinates: Coordinates = { top: triggerY };
// Calculates the initial position based on placement
switch (placement) {
case "top-left":
newCoordinates.top -= contentHeight;
newCoordinates.left = triggerX;
break;
case "top-mid":
newCoordinates.top -= contentHeight;
newCoordinates.left = getHorizontalCoordinates(contentWidth);
break;
case "top-right":
newCoordinates.top -= contentHeight;
newCoordinates.left = triggerX + triggerWidth - contentWidth;
break;
case "left":
newCoordinates.top = getVerticalCoordinates(contentHeight);
newCoordinates.left = triggerX - contentWidth;
break;
case "right":
newCoordinates.top = getVerticalCoordinates(contentHeight);
newCoordinates.left = triggerX + triggerWidth;
break;
case "bottom-left":
newCoordinates.top += triggerHeight;
newCoordinates.left = triggerX;
break;
case "bottom-mid":
newCoordinates.top += triggerHeight;
newCoordinates.left = getHorizontalCoordinates(contentWidth);
break;
case "bottom-right":
newCoordinates.top += triggerHeight;
newCoordinates.left = triggerX + triggerWidth - contentWidth;
break;
case "drop-down":
newCoordinates.top += triggerHeight;
newCoordinates.left = triggerX;
break;
default:
break;
}
// It verifies if the tooltip is going out of viewport
// Adjusts the min margin to the left to avoid leaking on the left side
if (newCoordinates.left && newCoordinates.left < 0) {
newCoordinates.left = 10; // minimum margin on the left
}
// adjusts to not allow going further viewport width (cannot go out on the right side)
if (
newCoordinates.left &&
newCoordinates.left + contentWidth > windowWidth
) {
newCoordinates.left = windowWidth - contentWidth - 10; // minimum margin on the right
}
// Adjusts the min margin to the top to avoid leaking on the top
if (newCoordinates.top < 0) {
newCoordinates.top = 10; // minimum margin on the top
}
// adjusts to not allow going further viewport height (cannot go out on the bottom)
if (newCoordinates.top + contentHeight > windowHeight) {
newCoordinates.top = windowHeight - contentHeight - 10; // minimum margin at the bottom
}
setCoordinates(newCoordinates);
};
// use debounce since onLayout is triggered as the Content changes position
// and we only want to set ready on the last position update
useEffect(
debounce(() => setIsReady(true), 32),
[coordinates.left, coordinates.top]
);
useEffect(
() => () => {
setIsReady(false);
},
[]
);
return {
style: { ...coordinates },
isReady,
updateCoordinates
};
};
export default useGetCoordinates;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/components/content/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
export const StyledView = styled(View)`
position: absolute;
max-width: fill-available;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/components/content/index.tsx
import React, { forwardRef, ReactNode } from "react";
import {
View,
StyleSheet,
AccessibilityRole,
LayoutChangeEvent,
useWindowDimensions
} from "react-native";
import { EventTypes, Placement } from "../../types";
import { useGetCoordinates, usePopper } from "../../hooks";
import { StyledView } from "./styled-components";
export interface Props {
placement: Placement;
children: ReactNode;
on?: EventTypes;
}
const Content = forwardRef<View, Props>(
({ children, placement, on = "hover" }, ref) => {
const { isWeb, triggerLayout } = usePopper();
const { width: windowWidth, height: windowHeight } = useWindowDimensions();
const { style, isReady, updateCoordinates } = useGetCoordinates({
triggerLayout,
placement,
windowWidth,
windowHeight
});
const handleOnLayout = ({
nativeEvent: {
layout: { width, height }
}
}: LayoutChangeEvent) => {
updateCoordinates(width, height);
};
return (
<StyledView
accessibilityRole={isWeb ? ("dialog" as AccessibilityRole) : "none"}
pointerEvents={on === "hover" ? "none" : "auto"}
ref={ref}
style={[styles.box, { ...style, opacity: +isReady }]}
onLayout={handleOnLayout}
>
{children}
</StyledView>
);
}
);
const styles = StyleSheet.create({
box: {
position: "absolute",
zIndex: 1
}
});
export default Content;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/components/overlay/styled-components.ts
import { Animated, View, TouchableOpacity, Pressable } from "react-native";
import styled, { css } from "styled-components/native";
import { zIndex, ZIndexProps } from "../../../../theming/styledSystem";
const Overlay = (isFixed: boolean) => css`
${zIndex};
position: ${isFixed ? "fixed" : "absolute"};
cursor: default;
left: 0;
right: 0;
top: 0;
bottom: 0;
`;
export const StyledView = styled(Animated.View)<ZIndexProps>`
${Overlay(false)};
`;
export const StyledPressable = styled(Pressable)<ZIndexProps>`
${Overlay(true)};
`;
export const StyledContent = styled(View)<ZIndexProps>`
${Overlay(false)};
`;
export const StyledTouchableOpacity = styled(TouchableOpacity)<ZIndexProps>`
${zIndex};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/components/overlay/index.tsx
import React, { useEffect, useRef, useState } from "react";
import ReactDOM from "react-dom";
import { StyleSheet, Animated, Platform, Easing } from "react-native";
import { usePopper, useCloseOnClickOutside } from "../../hooks";
import {
StyledView,
StyledPressable,
StyledContent
} from "./styled-components";
import { OverlayProps } from "./types";
/**
* The overlay component will render the Popper content
* it will have extra features for web such as clicking outside and closing
* TODO: keyboard events
*
*/
const Overlay = ({
children,
triggerRef,
contentRef,
on = "hover",
zIndex = 1999
}: OverlayProps) => {
const { isWeb, isOpen, closeContent } = usePopper();
useCloseOnClickOutside({
isWeb,
refs: [contentRef, triggerRef],
onPress: closeContent
});
const fadeAnim = useRef(new Animated.Value(0)).current;
const scaleAnim = useRef(new Animated.Value(0.95)).current;
const [showOpacity, setShowOpacity] = useState(false);
useEffect(() => {
if (isOpen) setShowOpacity(isOpen);
Animated.parallel([
Animated.timing(fadeAnim, {
toValue: isOpen ? 1 : 0,
duration: 200,
useNativeDriver: Platform.OS !== "web",
easing: Easing.inOut(Easing.ease)
}),
Animated.timing(scaleAnim, {
toValue: isOpen ? 1 : 0.95,
duration: 200,
useNativeDriver: Platform.OS !== "web",
easing: Easing.inOut(Easing.ease)
})
]).start(() => {
setShowOpacity(isOpen);
});
}, [isOpen]);
const styles = StyleSheet.create({
toolTip: {
position: "absolute",
// @ts-ignore
cursor: "default",
left: 0,
right: 0,
top: 0,
bottom: 0
}
});
return showOpacity
? ReactDOM.createPortal(
on === "press" ? (
<StyledView
zIndex={zIndex}
pointerEvents="none"
style={[
styles.toolTip,
{
opacity: fadeAnim,
transform: [{ scale: scaleAnim }]
}
]}
>
<StyledPressable onPress={closeContent} zIndex={zIndex} />
<StyledContent zIndex={zIndex}>{children}</StyledContent>
</StyledView>
) : (
<StyledView
zIndex={zIndex}
pointerEvents="none"
style={[
styles.toolTip,
{
opacity: fadeAnim,
transform: [{ scale: scaleAnim }]
}
]}
>
{children}
</StyledView>
),
document.body
)
: null;
};
export default Overlay;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
export default function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/utils/measureLayout.ts
import { RefObject } from "react";
import { View } from "react-native";
import { Layout } from "../types";
const measureLayout = (ref: RefObject<View>, isWeb?: boolean) =>
new Promise<Layout>((resolve) => {
if (ref.current) {
if (isWeb) {
// @ts-ignore
const { x, y, width, height } = ref.current.getBoundingClientRect();
resolve({ x, y, width, height });
} else {
ref.current.measureInWindow(
(x: number, y: number, width: number, height: number) => {
resolve({ x, y, width, height });
}
);
}
}
});
export default measureLayout;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/components/trigger/index.tsx
import React, { forwardRef, isValidElement, RefObject } from "react";
import { Pressable, View } from "react-native";
import { useQaLabel } from "../../../../hooks/useQaLabel";
import { EventTypes, Layout } from "../../types";
import usePopper from "../../hooks/usePopper";
import measureLayout from "../../utils/measureLayout";
export interface Props {
on: EventTypes;
isDisabled?: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
children?: any;
}
const Trigger = forwardRef<View, Props>(
({ children, on, isDisabled = false }, ref) => {
const { getHandlers, isWeb } = usePopper();
const popperQaLabel = useQaLabel("popper-trigger");
const hasValidChildren = isValidElement(children);
const getTriggerLayout = async (callback: (layout: Layout) => void) => {
let scrollXOffset = 0;
let scrollYOffset = 0;
let topPosition = 0;
if (isWeb) {
scrollXOffset = document.documentElement.scrollLeft;
scrollYOffset = document.documentElement.scrollTop;
// @ts-ignore
topPosition = ref.current ? ref.current.getBoundingClientRect().top : 0;
}
const triggerLayout = await measureLayout(ref as RefObject<View>, isWeb);
callback({
...triggerLayout,
x: Number(triggerLayout.x) + scrollXOffset,
y: Number(topPosition || triggerLayout.y) + scrollYOffset
});
};
if (!hasValidChildren) return null;
if (isDisabled) return children;
return on === "press" ? (
<Pressable
ref={ref}
{...getHandlers(on, getTriggerLayout)}
{...popperQaLabel}
>
{children}
</Pressable>
) : (
<View ref={ref} {...getHandlers(on, getTriggerLayout)} {...popperQaLabel}>
{children}
</View>
);
}
);
export default Trigger;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/popper/index.tsx
import React, { RefObject, useRef } from "react";
import { View } from "react-native";
import { PopperProps } from "./types";
import PopperProvider from "./context/popperProvider";
import { Content, Overlay, Trigger } from "./components";
const Popper = ({
children,
on,
content,
placement = "top-mid",
isDisabled = false,
layer = 1999,
...rest
}: PopperProps) => {
const triggerRef: RefObject<View> = useRef(null);
const contentRef: RefObject<View> = useRef(null);
return (
<PopperProvider>
<Trigger ref={triggerRef} isDisabled={isDisabled} on={on}>
{children}
</Trigger>
<Overlay
triggerRef={triggerRef}
contentRef={contentRef}
on={on}
zIndex={layer}
>
<Content ref={contentRef} on={on} placement={placement} {...rest}>
{content}
</Content>
</Overlay>
</PopperProvider>
);
};
Popper.defaultProps = {
placement: "top-mid"
};
export default Popper;
export { usePopper } from "./hooks";
export * from "./types";
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tooltip/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { compose, variant } from "../../theming/styledSystem";
import { TooltipContentProps } from "./types";
import { useQaLabel } from "../../hooks/useQaLabel";
const styles = compose(
variant({
prop: "variant",
variants: {
dark: {
backgroundColor: "blue_accent.900"
},
light: {
backgroundColor: "white.900"
}
}
})
);
export const Content = styled(View).attrs<TooltipContentProps>((props) => ({
...(props.qaLabel && useQaLabel(props.qaLabel))
}))<TooltipContentProps>`
${styles};
border-radius: ${({ theme }) => theme.radii.s};
padding: ${({ theme }) => theme.space["space-3"]};
margin: ${({ theme }) => theme.space["space-1"]};
box-shadow: ${({ theme }) => theme.elevations.medium};
justify-content: center;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tooltip/index.tsx
import React, { FC } from "react";
import { TooltipProps } from "./types";
import Popper from "../popper";
import Paragraph from "../typography/paragraph";
import { Content as StyledContent } from "./styled-components";
export const Tooltip: FC<TooltipProps> = ({
children,
content,
placement = "top-mid",
isDarkMode = false,
isDisabled = false,
qaLabel,
layer = 1999,
...rest
}) => (
<Popper
on="hover"
placement={placement}
isDisabled={isDisabled}
layer={layer}
content={
<StyledContent
qaLabel={qaLabel}
variant={isDarkMode ? "light" : "dark"}
placement={placement}
{...rest}
>
<Paragraph
color={isDarkMode ? "blue.900" : "white.900"}
qaLabel="tooltip-text"
fontSize="xs"
>
{content}
</Paragraph>
</StyledContent>
}
>
{children}
</Popper>
);
export * from "./types";
export default Tooltip;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeCell/types.ts
import { GestureResponderEvent } from "react-native";
import { SpaceProps, LayoutProps } from "styled-system";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import { SaddleSelectionsProps } from "../saddleSelections";
import { Breed } from "../saddle";
type BetStatusType = "NONE" | "PLACED" | "ERROR" | "PROCESSING";
export enum BetStatusCodesEnum {
ACTIVE = "A",
REFUNDED = "R",
LOSER = "L",
WINNER = "W",
CANCELED = "C"
}
export interface BetTypeCellProps extends SpaceProps, LayoutProps {
/** Bet Amount */
betAmount: number | string;
/** Bet type name */
betTypeName: string;
/** Bet Ticket value */
betTicket: number | string;
/** Number Wagerable Runners */
numWagerableRunners?: string[] | undefined;
/** Approximated Payout */
approximatedPayout: string;
/** Bet type */
type: WagerTypeCodesEnum;
/** Type of race */
breed?: Breed;
/** Saddle selections */
selections: SaddleSelectionsProps[];
/** Complete Selection Array */
completeSelection?: SaddleSelectionsProps[][];
/** Status of the bet */
betStatus: BetStatusType;
/** Repeat bet handler */
onRepeatBetHandler?: (event: GestureResponderEvent) => void;
/** Cancel bet handler */
onCancelBetHandler?: (event: GestureResponderEvent) => void;
/** Custom data-qa-label attribute applied to element */
qaLabel?: string;
/** Is leg bet * */
isLeg: boolean;
/** If include scratch in selections */
scratches?: string[][];
/** Is Key bet */
isKey?: boolean;
/** Is Box bet */
isBox?: boolean;
/** Is Wheel bet */
isWheel?: boolean;
/** Current race number */
raceNumber?: string;
/** No header and no border */
showOnlySelections?: boolean;
betStatusCode?: BetStatusCodesEnum;
winAmountBet?: number | string;
/** Is the bet refund amount */
betRefund?: number | string;
/** Is the bet repeatable */
isRepeatable?: boolean;
/** Is the bet done on a special wager track */
isSpecialWager?: boolean;
/** If is on handicaping */
onHandicaping?: boolean;
/** If alternates should be displayed */
displayAlternateSelection?: boolean;
/** If alternate placeholder should be displayed */
showAlternatePlaceholder?: boolean;
/** Has race started */
isRaceOff?: boolean;
}
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/iconButton/index.tsx
import React, { useContext } from "react";
import { useTheme } from "../../theming";
import { Icon } from "../icon";
import type { IconButtonProps } from "./types";
import { StyledButton, Container } from "./styled-components";
import Tooltip from "../tooltip";
import { useEvents } from "../../hooks/useEvents";
import { TvgConfContext } from "../../utils/tvgConfProvider";
export const IconButton = ({
variant,
size = "l",
iconSize = "m",
iconName = "arrowLeft",
placementTooltip = "bottom-mid",
tertiaryColor = "grey.900",
textTooltip = "",
qaLabel,
onPress,
isActive,
...rest
}: IconButtonProps) => {
const { iconButtons, colors } = useTheme();
const { events, hoverHandlers, pressHandlers, focusHandlers } = useEvents({});
const { device } = useContext(TvgConfContext);
const isDesktop = device === "desktop";
const containerIconButton = () => (
<StyledButton
variant={variant}
size={size}
textTooltip={textTooltip || undefined}
tertiaryColor={tertiaryColor}
hoveredColor={getTertiaryColor(tertiaryColor, true, false, true)}
pressedColor={getTertiaryColor(tertiaryColor, false, true, true)}
disabled={rest.isDisabled}
activeOpacity={1}
underlayColor={
variant !== "tertiary"
? iconButtons[variant]?.pressed?.background
: getTertiaryColor(tertiaryColor, false, true, true)
}
isActive={isActive}
onPress={onPress}
qaLabel={qaLabel}
{...rest}
{...events}
{...(isDesktop ? hoverHandlers : {})}
{...pressHandlers}
{...focusHandlers}
>
<Icon
name={iconName}
size={iconSize}
lineColor={
variant !== "tertiary"
? iconButtons[variant]?.default?.color
: getTertiaryColor(tertiaryColor, false, false)
}
backgroundColor="transparent"
qaLabel="button-icon"
/>
</StyledButton>
);
const getTertiaryColor = (
colorValue: string,
isHovered: boolean,
isPressed: boolean,
isMobile?: boolean
) => {
if (colorValue.startsWith("#") || colorValue.startsWith("var")) {
return colorValue;
}
const [color, variantColor] = colorValue.split(".");
// @ts-ignore
const getColor = colors[color];
let setColor;
if (isMobile) return null;
if (isHovered) setColor = getColor[100];
if (isPressed) setColor = getColor[200];
return setColor ?? getColor[variantColor];
};
return (
<Container>
{textTooltip ? (
<Tooltip
qaLabel="tooltip"
content={textTooltip}
placement={placementTooltip}
isDarkMode={
variant === "secondary_dark" || variant === "tertiary_dark"
}
isDisabled={rest.isDisabled}
>
{containerIconButton()}
</Tooltip>
) : (
containerIconButton()
)}
</Container>
);
};
export type { IconButtonProps };
export default IconButton;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeCell/styled-components.ts
import styled, { css } from "styled-components/native";
import { View } from "react-native";
import { space, layout, compose } from "styled-system";
const styledUtils = compose(space, layout);
export const Container = styled(View)<{ showOnlySelections?: boolean }>`
overflow: hidden;
${styledUtils}
border-radius: ${({ theme }) => theme.radii.xs};
${({ showOnlySelections }) =>
!showOnlySelections &&
css`
border: 1px solid ${({ theme }) => theme.colorTokens.border.default};
`}
`;
export const Header = styled(View)`
flex-direction: row;
justify-content: space-between;
align-items: center;
border-bottom-width: 1px;
background-color: ${({ theme }) => theme.colorTokens.background.layer};
border-bottom-color: ${({ theme }) => theme.colors.blue["100"]};
padding: ${({ theme }) =>
`${theme.space["space-2"]} ${theme.space["space-4"]}`};
`;
export const ContentActionsWrapper = styled(View)`
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
`;
export const Content = styled(View)<{ hasButtons: boolean }>`
background-color: ${({ theme }) => theme.colorTokens.surface};
padding: ${({ theme }) => theme.space["space-4"]};
max-width: ${({ hasButtons }) => (hasButtons ? "calc(100% - 72px)" : "100%")};
`;
export const Actions = styled(View)`
display: flex;
flex-direction: row;
gap: ${({ theme }) => theme.space["space-3"]};
margin: ${({ theme }) =>
`${theme.space["space-2"]} ${theme.space["space-4"]} ${theme.space["space-2"]} 0`};
`;
export const VerticalParagraphLeft = styled(View)`
text-align: left;
`;
export const VerticalParagraphRight = styled(View)`
text-align: right;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeCell/components/CustomBetSelectionsView/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
export const PositionsGrid = styled(View)<{
isLeg?: boolean;
isSpecialWager?: boolean;
}>`
display: grid;
grid-template-columns: ${({ isLeg, isSpecialWager }) =>
isLeg && !isSpecialWager ? "58px" : "25px"} auto;
column-gap: ${({ theme }) => theme.space["space-3"]};
row-gap: ${({ theme }) => theme.space["space-4"]};
`;
export const Content = styled(View)`
width: 65px;
justify-content: center;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeCell/components/CustomBetSelectionsView/index.tsx
import React, { Fragment } from "react";
import formatSequencial from "@tvg/formatter/numeric";
import BetSelection from "../../../betSelections";
import { Paragraph } from "../../../typography";
import { CustomBetSelectionsViewProps } from "../types";
import Icon from "../../../icon";
import { PositionsGrid, Content } from "./styled-components";
export const CustomBetSelectionsView: React.FC<
CustomBetSelectionsViewProps
> = ({
completeSelection,
numWagerableRunners,
type,
isKey,
isBox,
isWheel,
isLeg,
isExoticBet,
isSpecialWager,
currentRaceNumber,
scratches,
breed,
isAlternateView,
showAlternatePlaceholder
}) => {
const renderKeyOrKeyBox = (index: number) => {
const isKeyBox = isKey && isBox;
const defaultText = isKeyBox ? "Box" : "w/";
return (
<Paragraph qaLabel={`selection-label-key${isKeyBox ? "-box" : ""}`}>
{index === 0 ? <Icon name="key" size="s" qaLabel="key" /> : defaultText}
</Paragraph>
);
};
const renderKeyBoxOrKeyOrBox = (index: number) => {
if (isKey) {
return renderKeyOrKeyBox(index);
}
return <Paragraph qaLabel="selection-label-box">Box</Paragraph>;
};
const renderExoticOrLegBet = (index: number) =>
isExoticBet ? (
<Paragraph qaLabel={`selection-label-${formatSequencial(index + 1)}`}>
{formatSequencial(index + 1)}
</Paragraph>
) : (
<Content>
<Paragraph qaLabel={`selection-label-${formatSequencial(index + 1)}`}>
{isSpecialWager
? `L${Number(currentRaceNumber) + index}`
: `L${index + 1} - R${Number(currentRaceNumber) + index}`}
</Paragraph>
</Content>
);
const renderWheel = (index: number) => (
<Paragraph qaLabel="selection-label-wheel">
{index === 0 ? <></> : "w/"}
</Paragraph>
);
return completeSelection?.length ? (
<PositionsGrid isLeg={isLeg} isSpecialWager={isSpecialWager}>
{completeSelection.map((selection, index) => (
<Fragment key={`${type}-${index.toString()}`}>
{(isKey || isBox) && renderKeyBoxOrKeyOrBox(index)}
{(isExoticBet || isLeg) && renderExoticOrLegBet(index)}
{isWheel && renderWheel(index)}
<BetSelection
scratches={scratches?.[index]}
numWagerableRunners={
isLeg ? numWagerableRunners?.[index] : numWagerableRunners?.[0]
}
selections={selection}
type={type}
showBetType={false}
breed={breed}
isAlternateView={isAlternateView}
showAlternatePlaceholder={showAlternatePlaceholder}
/>
</Fragment>
))}
</PositionsGrid>
) : null;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeCell/index.tsx
import React from "react";
import { View } from "react-native";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import { isZeroLike } from "@tvg/utils/generalUtils";
import { useQaLabel } from "../../hooks";
import { useTheme } from "../../theming";
import BetSelection from "../betSelections";
import Loading from "../loading";
import { IconButton } from "../iconButton";
import { Tag } from "../tag";
import { Paragraph } from "../typography";
import {
Container,
ContentActionsWrapper,
Content,
Actions,
Header,
VerticalParagraphLeft,
VerticalParagraphRight
} from "./styled-components";
import { BetTypeCellProps, BetStatusCodesEnum } from "./types";
import { CustomBetSelectionsView } from "./components/CustomBetSelectionsView";
const exoticBets = [
WagerTypeCodesEnum.EXACTA,
WagerTypeCodesEnum.TRIFECTA,
WagerTypeCodesEnum.SUPERFECTA,
WagerTypeCodesEnum.SUPERHIGHFIVE
];
export const BetTypeCell = ({
numWagerableRunners,
type,
breed = "thoroughbred",
betTypeName,
selections,
completeSelection,
qaLabel = "bet-type-cell",
approximatedPayout,
betAmount,
betStatus,
betTicket,
isLeg,
scratches,
onRepeatBetHandler,
onCancelBetHandler,
isKey,
isBox,
isWheel,
raceNumber,
betStatusCode,
winAmountBet,
showOnlySelections,
betRefund,
isSpecialWager = false,
isRepeatable = true,
displayAlternateSelection,
showAlternatePlaceholder,
isRaceOff = false,
...rest
}: BetTypeCellProps) => {
const betTypeCellQaLabel = useQaLabel(qaLabel);
const { colors } = useTheme();
const isExoticBet = exoticBets.includes(type);
const isCustomSelectionsView =
isKey || isLeg || isBox || isWheel || isExoticBet;
const hasPayout = !isZeroLike(approximatedPayout);
const isWon = betStatusCode === BetStatusCodesEnum.WINNER;
const isRefund = betStatusCode === BetStatusCodesEnum.REFUNDED;
const betStatusCodeMap: Record<
BetStatusCodesEnum,
{ label: string; value?: number | string }
> = {
A: {
label: hasPayout ? "APPROX. PAYOUT" : "",
value: hasPayout ? approximatedPayout : ""
},
R: { label: "REFUND", value: betRefund },
L: { label: "RETURN", value: "$0.00" },
W: { label: "WON", value: winAmountBet },
C: { label: "REFUND", value: betRefund }
};
const renderRightColumn = () => {
switch (betStatus) {
case "PROCESSING":
return (
<View>
<Loading />
</View>
);
case "ERROR":
return (
<View>
<Tag size="s" variant="warning" label="Failed" />
</View>
);
case "PLACED":
return (
<View>
<Tag size="s" variant="optedin" label="Placed" />
</View>
);
default:
return (
<VerticalParagraphRight>
<Paragraph
fontFamily={isWon || isRefund ? "medium" : "regular"}
fontWeight={isWon || isRefund ? 500 : 400}
color={isWon ? colors.green["700"] : colors.grey["900"]}
qaLabel="approximate-payout-value"
>
<>
{
betStatusCodeMap[betStatusCode || BetStatusCodesEnum.ACTIVE]
.value
}
</>
</Paragraph>
<Paragraph
qaLabel="approximate-payout"
fontFamily="condensedRegular"
color={isWon ? colors.green["700"] : colors.grey["800"]}
fontSize="xs"
textAlign={isWon ? "end" : "start"}
>
<>
{
betStatusCodeMap[betStatusCode || BetStatusCodesEnum.ACTIVE]
.label
}
</>
</Paragraph>
</VerticalParagraphRight>
);
}
};
const renderSelections = () =>
isCustomSelectionsView ? (
<CustomBetSelectionsView
isKey={isKey}
isBox={isBox}
isLeg={isLeg}
isWheel={isWheel}
isSpecialWager={isSpecialWager}
isExoticBet={isExoticBet}
completeSelection={completeSelection}
numWagerableRunners={numWagerableRunners}
type={type}
currentRaceNumber={raceNumber}
scratches={scratches}
breed={breed}
isAlternateView={displayAlternateSelection}
showAlternatePlaceholder={showAlternatePlaceholder}
/>
) : (
<BetSelection
numWagerableRunners={numWagerableRunners?.[0]}
selections={selections}
type={type}
breed={breed}
showBetType={false}
scratches={Array.from(new Set(scratches?.flat(1)))} // remove duplicates
onHandicaping={rest.onHandicaping}
isAlternateView={displayAlternateSelection}
showAlternatePlaceholder={showAlternatePlaceholder}
/>
);
return (
<Container
showOnlySelections={showOnlySelections}
{...betTypeCellQaLabel}
{...rest}
>
{!showOnlySelections && (
<Header>
<VerticalParagraphLeft>
<Paragraph qaLabel="bet-amount">{`${betAmount} ${betTypeName}`}</Paragraph>
<Paragraph
qaLabel="ticket-amount"
fontFamily="condensedRegular"
color={colors.grey["800"]}
fontSize="xs"
>
{`${betTicket} TICKET`}
</Paragraph>
</VerticalParagraphLeft>
{renderRightColumn()}
</Header>
)}
<ContentActionsWrapper>
<Content hasButtons={!!onRepeatBetHandler || !!onCancelBetHandler}>
{selections?.length ? renderSelections() : null}
</Content>
{(onRepeatBetHandler && !isRaceOff) ||
(onCancelBetHandler && !isRaceOff) ? (
<Actions>
{onRepeatBetHandler && isRepeatable && (
<IconButton
iconName="repeat"
qaLabel="repeat-bet-btn"
size="s"
variant="tertiary"
tertiaryColor="grey.800"
onPress={onRepeatBetHandler}
/>
)}
{onCancelBetHandler && (
<IconButton
iconName="trash"
qaLabel="cancel-bet-btn"
size="s"
variant="tertiary"
tertiaryColor="grey.800"
onPress={onCancelBetHandler}
/>
)}
</Actions>
) : null}
</ContentActionsWrapper>
</Container>
);
};
export default BetTypeCell;
export { BetStatusCodesEnum };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeSelector/components/betTypeButton/styled-components.ts
import styled, { css } from "styled-components/native";
import { StyledProps } from "./types";
export const BetTypesTouchable = styled.TouchableHighlight<StyledProps>`
height: 100%;
padding: ${({ theme }) =>
`${theme.space["space-6"]} ${theme.space["space-4"]}`};
border-top-color: ${({ theme }) => theme.colorTokens.background.surface};
border-top-width: 2px;
${({ isHovered, theme }) =>
isHovered &&
css`
background-color: ${theme.colorTokens.component.button.buttonLink
.background.hover};
`}
${({ isPressed, theme }) =>
isPressed &&
css`
background-color: ${theme.colorTokens.component.input.pressed};
border-bottom-color: ${theme.colorTokens.content.link};
border-bottom-width: 2px;
`}
${({ isSelected, theme }) =>
isSelected &&
css`
border-bottom-color: ${theme.colorTokens.content.link};
border-bottom-width: 2px;
`};
`;
export const BetTypesText = styled.Text<StyledProps>`
color: ${({ theme }) => theme.colorTokens.content.default};
font-family: ${({ theme }) => theme.fonts.medium};
font-size: ${({ theme }) => theme.fontSizes.s};
text-align: center;
${({ isSelected, isPressed, theme }) =>
(isSelected || isPressed) &&
css`
color: ${theme.colorTokens.content.link};
`};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeSelector/components/betTypeExpandableButton/styled-components.ts
import { ForwardedRef } from "react";
import styled, { css } from "styled-components/native";
import { View, TouchableHighlight, Text } from "react-native";
import { StyledProps } from "./types";
export const Container = styled(View)<{
ref: ForwardedRef<View & HTMLDivElement>;
}>`
position: relative;
`;
export const ButtonContent = styled(View)`
display: flex;
flex-direction: row;
`;
export const BetTypesTouchable = styled(TouchableHighlight)<StyledProps>`
height: 100%;
padding: ${({ theme }) =>
`${theme.space["space-6"]} ${theme.space["space-4"]}`};
border-top-color: ${({ theme }) => theme.colorTokens.background.surface};
border-top-width: 2px;
${({ isHovered, theme }) =>
isHovered &&
css`
background-color: ${theme.colorTokens.component.button.buttonLink
.background.hover};
`}
${({ isPressed, theme }) =>
isPressed &&
css`
background-color: ${theme.colorTokens.component.input.pressed};
border-bottom-color: ${theme.colorTokens.content.link};
border-bottom-width: 2px;
`}
${({ isSelected, theme }) =>
isSelected &&
css`
border-bottom-color: ${theme.colorTokens.content.link};
border-bottom-width: 2px;
`};
`;
export const BetTypesText = styled(Text)<StyledProps>`
color: ${({ theme }) => theme.colorTokens.content.default};
font-family: ${({ theme }) => theme.fonts.medium};
font-size: ${({ theme }) => theme.fontSizes.s};
text-align: center;
${({ isSelected, isPressed, theme }) =>
(isSelected || isPressed) &&
css`
color: ${theme.colorTokens.content.link};
`};
margin-right: 4px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeSelector/components/betTypeExpandableButton/animatedDropdown/styled-components.ts
import styled from "styled-components/native";
import { AnimatedDropdownProps } from "./types";
import { Theme } from "../../../../../theming/types";
export const Container = styled.View<
Pick<AnimatedDropdownProps, "top" | "left" | "width" | "isTop">
>`
display: flex;
left: ${({ left }) => left}px;
padding-top: 8px;
position: ${({ isTop }) => (isTop ? "fixed" : "absolute")};
top: ${({ top }) => top}px;
width: ${({ width }) => width}px;
`;
export const ContentContainer = styled.View`
display: flex;
flex-direction: column;
position: absolute;
z-index: 999;
`;
export const Dropdown = styled.View<{
theme: Theme;
children?: React.ReactNode;
}>`
background-color: ${({ theme }) => theme.colorTokens.background.surface};
border-color: ${({ theme }) => theme.colorTokens.border.default};
border-radius: 4px;
border-width: 1px;
`;
export const ListItem = styled.View<{ children?: React.ReactNode }>`
display: flex;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeSelector/components/betTypeExpandableButton/dropdownSelection/styled-components.ts
import styled, { css } from "styled-components/native";
import { StyledProps } from "./types";
export const BetTypeTouchable = styled.TouchableHighlight<StyledProps>`
height: 100%;
border-bottom-color: ${({ theme }) => theme.colorTokens.border.default};
border-bottom-width: 1px;
padding-left: ${({ theme }) => `${theme.space["space-4"]}`};
padding-top: ${({ theme }) => `${theme.space["space-5"]}`};
padding-bottom: ${({ theme }) => `${theme.space["space-5"]}`};
${({ isHovered, theme }) =>
isHovered &&
css`
background-color: ${theme.colorTokens.component.button.buttonLink
.background.hover};
`}
${({ isPressed, theme }) =>
isPressed &&
css`
background-color: ${theme.colorTokens.component.input.pressed};
border-bottom-color: ${theme.colorTokens.content.link};
border-bottom-width: 1px;
`}
${({ isSelected, theme }) =>
isSelected &&
css`
border-bottom-color: ${theme.colorTokens.content.link};
border-bottom-width: 1px;
`}
${({ isHovered, isSelected, isParentHovered, theme }) =>
!isHovered &&
isSelected &&
!isParentHovered &&
css`
background-color: ${theme.colorTokens.component.button.buttonLink
.background.hover};
`}
`;
export const BetTypeText = styled.Text<StyledProps>`
color: ${({ theme }) => theme.colorTokens.content.default};
font-family: ${({ theme }) => theme.fonts.medium};
font-size: ${({ theme }) => theme.fontSizes.s};
${({ isSelected, isPressed, theme }) =>
(isSelected || isPressed) &&
css`
color: ${theme.colorTokens.content.link};
`};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeSelector/components/betTypeExpandableButton/animatedDropdown/index.tsx
import React from "react";
import { useTransition, config, animated } from "@react-spring/native";
import ReactDOM from "react-dom";
import { useQaLabel } from "../../../../../hooks/useQaLabel";
import { useEvents } from "../../../../../hooks/useEvents";
import {
Container,
ContentContainer,
Dropdown,
ListItem
} from "./styled-components";
import { AnimatedDropdownProps } from "./types";
import { DropdownSelection } from "../dropdownSelection";
const AnimatedContainer = animated(ContentContainer);
export const AnimatedDropdown: React.FC<AnimatedDropdownProps> = ({
isDropdownVisible,
onSelectValue,
values,
selectedValue,
qaLabel,
isTop,
top,
left,
width
}) => {
const viewTestProps = useQaLabel(qaLabel);
const { events, eventsHandlers, hoverHandlers } = useEvents({});
const dropdownTransition = useTransition(isDropdownVisible, {
config: isDropdownVisible ? { ...config.stiff } : { duration: 150 },
from: { opacity: 0 },
enter: { opacity: 1 },
leave: { opacity: 0 }
});
return ReactDOM.createPortal(
<>
{dropdownTransition(
(styles, isOpen) =>
values.length > 0 &&
isOpen && (
// @ts-ignore
<Container
{...viewTestProps}
{...eventsHandlers}
{...events}
{...hoverHandlers}
isTop={isTop}
top={top}
left={left}
width={width}
>
<AnimatedContainer style={styles}>
<Dropdown>
{values.map((item, index) => (
<ListItem key={index.toString()}>
<DropdownSelection
item={item}
onSelectValue={onSelectValue}
selectedValue={selectedValue}
isParentHovered={events.isHovered}
qaLabel={qaLabel}
/>
</ListItem>
))}
</Dropdown>
</AnimatedContainer>
</Container>
)
)}
</>,
document.body
);
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeSelector/components/betTypeExpandableButton/animatedDropdown/index.native.tsx
import React from "react";
import { useTransition, config, animated } from "@react-spring/native";
import { useQaLabel } from "../../../../../hooks/useQaLabel";
import { useEvents } from "../../../../../hooks/useEvents";
import {
Container,
ContentContainer,
Dropdown,
ListItem
} from "./styled-components";
import { AnimatedDropdownProps } from "./types";
import { DropdownSelection } from "../dropdownSelection";
const AnimatedContainer = animated(ContentContainer);
export const AnimatedDropdownNative: React.FC<AnimatedDropdownProps> = ({
isDropdownVisible,
onSelectValue,
values,
selectedValue,
qaLabel,
isTop,
top,
left,
width
}) => {
const viewTestProps = useQaLabel(qaLabel);
const { events, eventsHandlers, hoverHandlers } = useEvents({});
const dropdownTransition = useTransition(isDropdownVisible, {
config: isDropdownVisible ? { ...config.stiff } : { duration: 150 },
from: { opacity: 0 },
enter: { opacity: 1 },
leave: { opacity: 0 }
});
return (
<>
{dropdownTransition(
(styles, isOpen) =>
isOpen &&
values.length > 0 && (
// @ts-ignore
<Container
{...viewTestProps}
{...eventsHandlers}
{...events}
{...hoverHandlers}
isTop={isTop}
top={top}
left={left}
width={width}
>
<AnimatedContainer style={styles}>
<Dropdown>
{values.map((item, index) => (
<ListItem key={index.toString()}>
<DropdownSelection
item={item}
onSelectValue={onSelectValue}
selectedValue={selectedValue}
isParentHovered={events.isHovered}
qaLabel={qaLabel}
/>
</ListItem>
))}
</Dropdown>
</AnimatedContainer>
</Container>
)
)}
</>
);
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/betTypeSelector/styled-components.ts
import styled from "styled-components/native";
import { View, Text } from "react-native";
import { space } from "../../theming/styledSystem";
export const BetTypeSelectorContainer = styled(View)`
display: flex;
flex-direction: row;
flex-grow: 1;
${space};
z-index: 1;
width: 100%;
background-color: ${({ theme }) => theme.colorTokens.background.surface};
`;
export const InfoContainer = styled(View)`
width: 94px;
flex-grow: 0;
padding: ${({ theme }) =>
`${theme.space["space-3"]} ${theme.space["space-4"]}`};
background-color: ${({ theme }) => theme.colorTokens.background.accent};
border-bottom-color: ${({ theme }) => theme.colorTokens.border.default};
border-bottom-width: 1px;
border-top-color: ${({ theme }) => theme.colorTokens.border.default};
border-top-width: 1px;
border-right-color: ${({ theme }) => theme.colorTokens.border.default};
border-right-width: 1px;
border-top-left-radius: 4px;
`;
export const InfoText = styled(Text)`
font-size: ${({ theme }) => theme.fontSizes.m};
font-family: ${({ theme }) => theme.fonts.bold};
color: ${({ theme }) => theme.colorTokens.content.default};
text-align: center;
width: 70px;
height: 40px;
line-height: 20px;
`;
export const FadeLayer = styled(View)<{
orientation: "left" | "right";
width: number;
}>`
width: ${({ width }) => width}px;
position: absolute;
height: 55px;
left: 94px;
pointer-events: none;
background-image: linear-gradient(
to ${({ orientation }) => orientation},
rgba(255, 255, 255, 1) 0%,
rgba(255, 255, 255, 0) 5%
);
`;
export const BetTypesContainer = styled(View)<{ isOverFlowing: boolean }>`
flex: auto;
height: 60px;
display: flex;
flex-direction: row;
border-bottom-color: ${({ theme }) => theme.colorTokens.border.default};
border-bottom-width: 1px;
background-color: ${({ theme }) => theme.colorTokens.background.surface};
width: ${({ isOverFlowing }) =>
isOverFlowing ? "calc(100% - 166px)" : "calc(100% - 94px)"};
overflow-x: hidden;
border-top-right-radius: 4px;
`;
export const Navigation = styled(View)`
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 8px;
padding: 6px 12px 6px 12px;
background-color: ${({ theme }) => theme.colorTokens.background.surface};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/button/styled-components.ts
import styled from "styled-components/native";
import { View, Text, TouchableHighlight } from "react-native";
import {
space,
SpaceProps,
width,
minWidth,
compose,
variant,
border
} from "../../theming/styledSystem";
import { Colors } from "../../theming";
import { useQaLabel } from "../../hooks/useQaLabel";
import { getAccessibilityRole } from "../../utils/accessibility";
import { ButtonProps, ButtonVariant, ButtonSize, IconPosition } from "./types";
export const TERNARY_COLOR_CODE = "blue_accent.500";
export const getTertiaryColor = (
colors: Colors,
colorCode: string,
event?: "hover" | "press",
isMobile?: boolean
) => {
if (isMobile) return null;
const eventVariantColor = {
hover: 100,
press: 200
};
const [color, variantColor] = colorCode.split(".");
const newVariantColor = event ? eventVariantColor[event] : variantColor;
// @ts-ignore
return colors[color][newVariantColor];
};
export const buttonSizes = {
s: {
height: "25px",
paddingX: "space-3"
},
m: {
height: "32px",
paddingX: "space-3"
},
l: {
height: "44px",
paddingX: "space-5"
}
};
const buttonStyles = compose(
space,
width,
minWidth,
border,
variant({ prop: "size", variants: buttonSizes })
);
export const StyledButton = styled(TouchableHighlight).attrs<{
qaLabel: string;
variant: string;
tertiaryColor: string;
isMobile?: boolean;
}>((props) => ({
...useQaLabel(props.qaLabel),
accessibilityRole: "button",
underlayColor:
props.variant === "tertiary"
? getTertiaryColor(
props.theme.colors,
props.tertiaryColor,
"press",
props.isMobile
)
: props.theme.buttons[props.variant as ButtonVariant]?.pressed?.background
}))<
ButtonProps & {
isPressed: boolean;
isHovered: boolean;
tertiaryColor: string;
isMobile?: boolean;
}
>`
align-items: center;
justify-content: center;
border-radius: ${({ theme }) => theme.radii.xs};
${({ theme, variant: buttonVariant }) =>
theme.buttons[buttonVariant as ButtonVariant]?.default};
${({
theme,
variant: buttonVariant,
isHovered,
isPressed,
isDisabled,
isLoading,
tertiaryColor,
isMobile
}) =>
(!isDisabled &&
!isLoading &&
isPressed &&
(buttonVariant === "tertiary"
? `background-color:${getTertiaryColor(
theme.colors,
tertiaryColor,
"press",
isMobile
)}`
: theme.buttons[buttonVariant as ButtonVariant]?.pressed)) ||
(!isDisabled &&
!isLoading &&
isHovered &&
(buttonVariant === "tertiary"
? `background-color:${getTertiaryColor(
theme.colors,
tertiaryColor,
"hover",
isMobile
)}`
: theme.buttons[buttonVariant as ButtonVariant]?.hovered))};
${buttonStyles};
opacity: ${(props) => (props.isDisabled || props.isLoading ? 0.5 : 1)};
${(props) => (props.isStretched ? "width: 100%;" : "align-self: flex-start;")}
flex-grow: ${(props) => (props.isStretched ? "1" : "0")};
`;
export const ButtonRow = styled(View)<{ iconPosition?: IconPosition }>`
align-items: center;
flex-direction: ${(props) =>
props.iconPosition === "end" ? "row-reverse" : "row"};
`;
const textSizes = {
s: {
fontFamily: "medium",
fontSize: "xs"
},
m: {
fontFamily: "medium",
fontSize: "s"
},
l: {
fontFamily: "medium",
fontSize: "s"
}
};
const textStyles = compose(
space,
variant({ prop: "size", variants: textSizes })
);
export const StyledText = styled(Text).attrs<{
color?: string;
}>(({ color }: { color?: string }) => ({
accessibilityRole: getAccessibilityRole("span"),
color
}))<{ variant?: ButtonVariant; size: ButtonSize; color?: string } & SpaceProps>`
${textStyles};
color: ${({ color, theme }) => color || theme.colors.white[900]};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/button/container/index.tsx
import React from "react";
import { useTheme } from "../../../theming";
import { Icon, IconNames } from "../../icon";
import LoadingSpinner from "../../loading";
import {
ButtonRow,
StyledText,
getTertiaryColor,
TERNARY_COLOR_CODE
} from "../styled-components";
import { ButtonIcon, ButtonProps, ButtonVariant } from "../types";
const getButtonIcon = (icon: ButtonIcon, color: string) =>
React.isValidElement(icon) ? (
icon
) : (
<Icon
name={icon as IconNames}
size="s"
lineColor={color}
backgroundColor="transparent"
qaLabel="button-icon"
/>
);
export const ButtonContainer = ({
iconPosition,
variant,
isLoading,
size = "l",
icon,
children,
tertiaryColor
}: ButtonProps) => {
const { buttons, colors } = useTheme();
const color =
variant === "tertiary"
? getTertiaryColor(colors, tertiaryColor || TERNARY_COLOR_CODE)
: buttons[variant as ButtonVariant]?.default.color;
const bgColor =
variant === "tertiary"
? getTertiaryColor(colors, tertiaryColor || TERNARY_COLOR_CODE, "press")
: buttons[variant as ButtonVariant]?.loading?.background;
return (
<ButtonRow iconPosition={iconPosition}>
{isLoading ? (
<LoadingSpinner size={size || "l"} color={color} bgColor={bgColor} />
) : (
<>
{icon && getButtonIcon(icon, color || colors.white[900])}
{React.isValidElement(children) ? (
children
) : (
<StyledText
variant={variant}
color={color as string}
size={size}
ml={
children && icon && iconPosition === "start" ? "space-3" : "0px"
}
mr={
children && icon && iconPosition === "end" ? "space-3" : "0px"
}
>
{children}
</StyledText>
)}
</>
)}
</ButtonRow>
);
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/button/index.tsx
import React from "react";
import { type ButtonProps, ButtonSize } from "./types";
import { StyledButton, TERNARY_COLOR_CODE } from "./styled-components";
import { ButtonContainer } from "./container";
import { useEvents } from "../../hooks/useEvents";
export const Button = ({
variant,
size = "l",
children,
onPress,
isLoading = false,
iconPosition = "start",
icon,
tertiaryColor = TERNARY_COLOR_CODE,
isMobile = false,
qaLabel,
...rest
}: ButtonProps) => {
const { events, hoverHandlers, pressHandlers, focusHandlers } = useEvents({});
const disabled = rest.isDisabled || isLoading;
return (
<StyledButton
variant={variant}
size={size}
disabled={disabled}
isLoading={isLoading}
activeOpacity={1}
tertiaryColor={tertiaryColor}
isMobile={isMobile}
onPress={onPress}
qaLabel={qaLabel}
{...rest}
{...events}
{...hoverHandlers}
{...pressHandlers}
{...focusHandlers}
>
<ButtonContainer
iconPosition={iconPosition}
variant={variant}
isLoading={isLoading}
size={size}
icon={icon}
onPress={onPress}
qaLabel={qaLabel}
tertiaryColor={tertiaryColor}
isMobile={isMobile}
>
{children}
</ButtonContainer>
</StyledButton>
);
};
export { ButtonSize, StyledButton, TERNARY_COLOR_CODE };
export type { ButtonProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/buttonBar/styled-components.ts
import styled, { css } from "styled-components/native";
import { rgba } from "polished";
import { TouchableHighlight, Text } from "react-native";
import { EventsProps } from "./types";
import { borderRadius, compose } from "../../theming/styledSystem";
const buttonStyles = compose(borderRadius);
export const StyledTouchableHighlight = styled(TouchableHighlight)<EventsProps>`
height: 32px;
align-self: flex-start;
justify-content: center;
background-color: ${({ theme }) => theme.colorTokens.component.input.surface};
padding-left: ${({ theme, isCondensed }) =>
isCondensed ? 10 : theme.space["space-5"]};
padding-right: ${({ theme, isCondensed }) =>
isCondensed ? 10 : theme.space["space-5"]};
${({ isHovered, isPressed, isSelected, theme }) =>
(isHovered || isSelected) &&
css`
background-color: ${isPressed
? theme.colorTokens.component.button.buttonLink
: theme.colorTokens.component.button.tertiary.background.hover};
`}
${({ isCondensed, theme }) =>
!isCondensed &&
css`
box-shadow: 0 1px 3px ${rgba(17, 43, 68, 0.12)};
margin-right: 8px;
height: 44px;
border-width: 1px;
border-radius: ${theme.radii.xs};
border-color: ${theme.colorTokens.border.default};
`}
${({ isHovered, isCondensed }) =>
isHovered &&
!isCondensed &&
css`
box-shadow: 0 2px 4px ${rgba(17, 43, 68, 0.14)};
`}
${({ isSelected, theme }) =>
isSelected &&
css`
background-color: ${theme.colorTokens.component.button.buttonLink
.background.active};
border-color: ${theme.colorTokens.border.default};
box-shadow: none;
`};
${({ isPressed, theme }) =>
isPressed &&
css`
border-color: ${theme.colorTokens.border.default};
background-color: ${theme.colorTokens.component.button.tertiary.background
.hover};
box-shadow: none;
`}
${buttonStyles};
`;
export const StyledText = styled(Text)<EventsProps>`
display: flex;
justify-content: center;
font-family: ${({ theme }) => theme.fonts.medium};
font-size: ${({ theme }) => theme.fontSizes.s};
color: ${({ theme }) => theme.colorTokens.content.default};
${({ isHovered, theme }) =>
isHovered &&
css`
color: ${theme.colorTokens.content.default};
`}
${({ isPressed, theme }) =>
isPressed &&
css`
color: ${theme.colorTokens.content.default};
`}
${({ isSelected, isPressed, theme }) =>
isSelected &&
!isPressed &&
css`
color: ${theme.colorTokens.component.button.buttonLink.content.active};
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/buttonBar/buttonBarGroup/styled-components.ts
import styled, { css } from "styled-components/native";
import { Platform } from "react-native";
import { rgba } from "polished";
import { margin } from "styled-system";
import { Theme } from "../../../theming/types";
export const StyleViewContainer = styled.View<{
isCondensed: boolean;
theme: Theme;
children?: React.ReactNode;
}>`
${margin}
flex-direction: row;
${Platform.OS === "web" && `width: auto;`}
${({ isCondensed, theme }) =>
isCondensed &&
css`
border-width: 1px;
border-color: ${theme.colors.blue[100]};
border-radius: ${theme.radii.xs};
box-shadow: 0 1px 3px ${rgba(17, 43, 68, 0.12)};
width: fit-content;
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/scrollViewFading/styled-components.ts
import styled from "styled-components/native";
import { ScrollView } from "react-native";
export const StyledScrollView = styled(ScrollView)<{ paddingAround: boolean }>`
flex-grow: 0;
${({ paddingAround }) => paddingAround && "padding: 2px 0;"}
`;
webpack://frontend-tpt/../../node_modules/uuid/dist/esm-browser/native.js
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
export default {
randomUUID
};
webpack://frontend-tpt/../../node_modules/uuid/dist/esm-browser/rng.js
// Unique ID creation requires a high quality random # generator. In the browser we therefore
// require the crypto API and do not support built-in fallback to lower quality random number
// generators (like Math.random()).
let getRandomValues;
const rnds8 = new Uint8Array(16);
export default function rng() {
// lazy load so that environments that need to polyfill have a chance to do so
if (!getRandomValues) {
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
if (!getRandomValues) {
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
}
}
return getRandomValues(rnds8);
}
webpack://frontend-tpt/../../node_modules/uuid/dist/esm-browser/stringify.js
import validate from './validate.js';
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
const byteToHex = [];
for (let i = 0; i < 256; ++i) {
byteToHex.push((i + 0x100).toString(16).slice(1));
}
export function unsafeStringify(arr, offset = 0) {
// Note: Be careful editing this code! It's been tuned for performance
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
}
function stringify(arr, offset = 0) {
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
// of the following:
// - One or more input array values don't map to a hex octet (leading to
// "undefined" in the uuid)
// - Invalid input values for the RFC `version` or `variant` fields
if (!validate(uuid)) {
throw TypeError('Stringified UUID is invalid');
}
return uuid;
}
export default stringify;
webpack://frontend-tpt/../../node_modules/uuid/dist/esm-browser/v4.js
import native from './native.js';
import rng from './rng.js';
import { unsafeStringify } from './stringify.js';
function v4(options, buf, offset) {
if (native.randomUUID && !buf && !options) {
return native.randomUUID();
}
options = options || {};
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = rnds[6] & 0x0f | 0x40;
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = rnds[i];
}
return buf;
}
return unsafeStringify(rnds);
}
export default v4;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/scrollViewFading/fading/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { useQaLabel } from "../../../hooks";
export const StyledViewContainer = styled(View).attrs<{
qaLabel?: string;
}>((props) => ({
...useQaLabel(props.qaLabel || "StyledViewContainer")
}))<{
position: string;
height: string;
width: string;
qaLabel?: string;
}>`
position: absolute;
z-index: 1;
width: ${({ width }) => width || `44px`};
height: ${({ height }) => height || `48px`};
${({ position }) =>
position === "end" ? `right: 0` : position === "bottom" && `top: 99%`};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/scrollViewFading/fading/index.tsx
import React from "react";
import { v4 as generateUUID } from "uuid";
import Svg, { Path, LinearGradient, Defs, Stop } from "react-native-svg";
import { colors } from "../../../theming/themes/common/colors";
import { ScrollFadeProps } from "./types";
import { StyledViewContainer } from "./styled-components";
const defaultGradientPosition = {
x1: 44,
y1: 24,
x2: 0,
y2: 24
};
export const Fading = ({
position,
isVisible,
height = "48",
width = "44",
viewBox,
preserveAspectRatio,
gradientPosition = defaultGradientPosition,
qaLabel
}: ScrollFadeProps) => {
const gradientID = generateUUID();
const pathId = `paint0_linear_${gradientID}`;
return isVisible ? (
<StyledViewContainer
position={position}
width={width}
height={height}
qaLabel={qaLabel}
>
<Svg
height={height}
width={width}
style={position === "start" && { transform: [{ rotate: "180deg" }] }}
viewBox={viewBox}
preserveAspectRatio={preserveAspectRatio}
>
<Path d="M44 0H0V48H44V0Z" fill={`url(#${pathId})`} />
<Defs>
<LinearGradient
id={pathId}
{...gradientPosition}
gradientUnits="userSpaceOnUse"
>
<Stop stopColor="white" />
<Stop offset="1" stopColor={colors.white[900]} stopOpacity="0" />
</LinearGradient>
</Defs>
</Svg>
</StyledViewContainer>
) : null;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/buttonBar/index.tsx
import React, { useContext, useEffect, useRef } from "react";
import { TouchableHighlight } from "react-native";
import { useColorTokens } from "../../theming";
import { useQaLabel } from "../../hooks/useQaLabel";
import { ButtonBarProps, ButtonBarCompoundComponent } from "./types";
import { StyledTouchableHighlight, StyledText } from "./styled-components";
import { ButtonBarGroup, GroupContext } from "./buttonBarGroup";
import { useEvents } from "../../hooks/useEvents";
export const ButtonBar = (({
children,
isSelected = false,
value,
qaLabel,
focusOnSelected = false,
...rest
}) => {
const viewTestProps = useQaLabel(qaLabel);
const colorTokens = useColorTokens();
const { isCondensed = false } = useContext(GroupContext);
const { events, eventsHandlers, setEvents } = useEvents({});
const { selectedValue, onChange = () => {} } = useContext(GroupContext);
const buttonRef = useRef<typeof TouchableHighlight | null>(null);
useEffect(() => {
setEvents({ ...events, isSelected });
}, [isSelected]);
useEffect(() => {
setEvents({
...events,
isSelected: isSelected || selectedValue === value
});
}, [selectedValue]);
useEffect(() => {
if (focusOnSelected && events.isSelected) {
// @ts-ignore
buttonRef?.current?.scrollIntoView({
behavior: "smooth",
block: "nearest",
inline: "center"
});
}
}, [focusOnSelected, events.isSelected]);
const pressHandler = () => {
onChange(value);
};
return (
<StyledTouchableHighlight
// @ts-ignore
ref={buttonRef}
{...rest}
{...viewTestProps}
{...eventsHandlers}
{...events}
isCondensed={isCondensed}
onPress={pressHandler}
accessibilityRole="button"
underlayColor={colorTokens.border.info}
onLongPress={pressHandler}
>
{typeof children === "string" ? (
<StyledText {...events} isCondensed={isCondensed}>
{children}
</StyledText>
) : (
children
)}
</StyledTouchableHighlight>
);
}) as ButtonBarCompoundComponent<typeof ButtonBarGroup>;
export type { ButtonBarProps };
ButtonBar.Group = ButtonBarGroup;
export default ButtonBar;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/checkbox/checkboxGroup/styled-components.ts
import styled from "styled-components/native";
import { margin } from "styled-system";
import { Theme } from "../../../theming/types";
export const StyledViewContainer = styled.View`
${margin}
border-width: 1px;
border-color: transparent;
`;
export const StyledTextLabel = styled.Text<{
theme: Theme;
children?: React.ReactNode;
}>`
font-family: ${({ theme }) => theme.fonts.medium};
color: ${({ theme }) => theme.colors.grey[900]};
margin-bottom: ${({ theme }) => theme.space["space-4"]};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/checkbox/checkboxGroup/index.tsx
import { View } from "react-native";
import React, { createContext, forwardRef, useState, useEffect } from "react";
import { useQaLabel } from "../../../hooks/useQaLabel";
import { CheckboxGroupProps, CheckboxGroupContextProps } from "./types";
import { StyledViewContainer, StyledTextLabel } from "./styled-components";
const initialState = {
selectedValues: [],
onChange: () => {},
values: new Set<string>()
};
export const GroupContext = createContext<
CheckboxGroupContextProps & {
values: Set<string>;
}
>(initialState);
export const CheckboxGroup = forwardRef<View, CheckboxGroupProps>(
(
{
label = "",
children,
selectedValues,
qaLabel,
isDisabled = false,
onChange,
...rest
},
ref
) => {
const viewTestProps = useQaLabel(qaLabel);
const [values, setValues] = useState<Set<string>>(new Set([]));
useEffect(() => {
setValues(new Set(selectedValues));
}, [String(selectedValues)]);
return (
// @ts-ignore
<StyledViewContainer ref={ref} {...rest} {...viewTestProps}>
<GroupContext.Provider
value={{ values, selectedValues, onChange, isDisabled }}
>
{label !== "" && (
<View>
<StyledTextLabel accessibilityLabel={label}>
{label}
</StyledTextLabel>
</View>
)}
<View>{children}</View>
</GroupContext.Provider>
</StyledViewContainer>
);
}
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/checkbox/checker.tsx
import React from "react";
import Svg, { Path } from "react-native-svg";
import { useTheme } from "../../theming";
import { CheckerProps } from "./types";
export const Checker = ({ isDisabled }: CheckerProps) => {
const { colors } = useTheme();
return (
<Svg
width="14"
height="10"
viewBox="0 0 14 10"
fill="none"
focusable={false}
>
<Path
d="M1.5 5L5 8.5L12.5 1"
stroke={isDisabled ? colors.blue[200] : colors.white[900]}
strokeWidth="1.5"
strokeLinejoin="round"
/>
</Svg>
);
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/checkbox/styled-components.ts
import styled from "styled-components/native";
import { Platform, Pressable, Text, View } from "react-native";
import { margin, flex } from "styled-system";
import { CheckboxProps } from "./types";
const setDefaultCursor = Platform.OS === "web" && `cursor: default;`;
export const StyledPressableContainer = styled(Pressable)<{
isHovered: boolean;
isDisabled: boolean;
isInvalid: boolean;
isChecked: boolean;
isPressed: boolean;
}>`
height: 24px;
width: 24px;
background-color: ${({ theme }) => theme.colors.white[900]};
border-radius: ${({ theme }) => theme.radii.s};
border: 1px solid ${({ theme }) => theme.colors.blue[200]};
justify-content: center;
align-items: center;
box-shadow: ${({ theme }) => theme.elevations.low};
${setDefaultCursor}
${({ isHovered, isDisabled, theme }) =>
isHovered &&
`
border: 2px solid ${
isDisabled ? theme.colors.blue[100] : theme.colors.blue_accent[500]
};
box-shadow: ${theme.elevations.medium};
`}
${({ isInvalid, isDisabled, theme }) =>
isInvalid &&
`
border: 2px solid ${
isDisabled ? theme.colors.blue[100] : theme.colors.orange[600]
};
`}
${({ isChecked, theme }) =>
isChecked &&
`
background-color: ${theme.colors.blue_accent[500]};
border: 2px solid ${theme.colors.blue_accent[500]};
box-shadow: none;
`}
${({ isPressed, theme }) =>
isPressed &&
`
background-color: ${theme.colors.blue_accent[500]};
border: 2px solid ${theme.colors.blue_accent[500]};
box-shadow: none;
`}
${({ isDisabled, isChecked, theme }) =>
isDisabled &&
`
background-color: ${theme.colors.blue["000"]};
border: ${isChecked ? "2px" : "1px"} solid ${theme.colors.blue[100]};
box-shadow: none;
${setDefaultCursor}
`}
`;
export const StyledPressableLabelContainer = styled(Pressable)`
${setDefaultCursor}
flex-shrink: 1;
`;
export const StyledTextLabel = styled(Text)<{ isDisabled: boolean }>`
flex-shrink: 1;
font-family: ${({ theme }) => theme.fonts.regular};
color: ${({ theme }) => theme.colors.grey[900]};
margin-left: ${({ theme }) => theme.space["space-3"]};
margin-right: ${({ theme }) => theme.space["space-6"]};
${({ isDisabled, theme }) =>
isDisabled &&
`
color: ${theme.colors.grey[600]};
`}
`;
export const StyledViewContainer = styled(View)`
flex-direction: row;
align-items: center;
margin-bottom: ${({ theme }) => theme.space["space-4"]};
${margin}
`;
export const Checkbox = styled(Text).attrs<CheckboxProps>((props) => ({
alignLabel: props.flex === "start" ? "start" : "end"
}))<CheckboxProps>`
${flex}
`;
Checkbox.defaultProps = {
alignLabel: "center"
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/checkbox/index.tsx
import React, { useContext, forwardRef, useState, useEffect } from "react";
import { View } from "react-native";
import { useQaLabel } from "../../hooks/useQaLabel";
import { CheckboxGroup, GroupContext } from "./checkboxGroup";
import { CheckboxProps, CheckboxCompoundComponent } from "./types";
import { useEvents } from "../../hooks/useEvents";
import { Checker } from "./checker";
import {
StyledPressableContainer,
StyledTextLabel,
StyledViewContainer,
StyledPressableLabelContainer
} from "./styled-components";
export const Checkbox = forwardRef<View, CheckboxProps>(
({ value, label, isInvalid = false, qaLabel = value, ...rest }, ref) => {
const [isChecked, setIsChecked] = useState(false);
const { events, eventsHandlers } = useEvents({});
const { onChange, isDisabled = false, values } = useContext(GroupContext);
useEffect(() => {
setIsChecked(values.has(value));
}, [values]);
const pressHandler = () => {
if (isDisabled) return;
const currentState = !isChecked;
setIsChecked(currentState);
if (currentState) {
values?.add(value);
} else {
values?.delete(value);
}
onChange(Array.from(values));
};
return (
<StyledViewContainer {...useQaLabel(qaLabel)} {...rest}>
<StyledPressableContainer
{...rest}
{...useQaLabel(`${qaLabel}-input`)}
{...events}
{...eventsHandlers}
onPress={pressHandler}
ref={ref}
accessibilityRole="checkbox"
focusable
isInvalid={isInvalid}
isChecked={isChecked}
isDisabled={isDisabled}
accessibilityState={{ checked: isChecked }}
>
{isChecked && <Checker isDisabled={isDisabled} />}
</StyledPressableContainer>
{label !== "" && (
<StyledPressableLabelContainer
focusable={false}
onPress={pressHandler}
{...events}
{...eventsHandlers}
>
<StyledTextLabel
isDisabled={isDisabled}
{...useQaLabel(`${qaLabel}-label`)}
>
{label}
</StyledTextLabel>
</StyledPressableLabelContainer>
)}
</StyledViewContainer>
);
}
) as CheckboxCompoundComponent<typeof CheckboxGroup>;
export type { CheckboxProps };
Checkbox.Group = CheckboxGroup;
export default Checkbox;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/iconWithBackground/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
export const StyledComponent = styled(View)`
justify-content: center;
align-items: center;
`;
export const IconContainer = styled(View)`
position: absolute;
width: ${({ theme }) => theme.space["space-7"]};
height: ${({ theme }) => theme.space["space-7"]};
`;
export const BagdeContainer = styled(View)`
position: absolute;
right: 0.5px;
top: 0.2px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/dialogMessage/illustrations/error.tsx
import React from "react";
import Svg, { Path } from "react-native-svg";
import { tvgColorPalette as colors } from "../../../theming/themes/common";
export const Error = () => (
<Svg width="60" height="60" viewBox="0 0 60 60" fill="none">
<Path
d="M58.095 30.0108C58.095 45.5272 45.5164 58.1058 30 58.1058C14.4836 58.1058 1.90503 45.5272 1.90503 30.0108C1.90503 14.4944 14.4836 1.91583 30 1.91583C45.5164 1.91583 58.095 14.4944 58.095 30.0108Z"
fill={colors.red[100]}
/>
<Path
d="M18.3752 18.375L30.0002 30M30.0002 30L41.6252 41.625M30.0002 30L18.3752 41.625M30.0002 30L41.6252 18.375M58.095 30.0108C58.095 45.5272 45.5164 58.1058 30 58.1058C14.4836 58.1058 1.90503 45.5272 1.90503 30.0108C1.90503 14.4944 14.4836 1.91583 30 1.91583C45.5164 1.91583 58.095 14.4944 58.095 30.0108Z"
stroke={colors.red[600]}
strokeWidth="3"
/>
</Svg>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/dialogMessage/styled-components.ts
import styled, { css } from "styled-components/native";
import { View, Text } from "react-native";
import { space, layout, compose } from "styled-system";
import { Paragraph } from "../typography";
const styledUtils = compose(space, layout);
export const StyledViewContainer = styled(View)`
${styledUtils};
align-items: center;
`;
export const StyledParagraph = styled(Paragraph)`
text-align: center;
color: ${({ theme }) => theme.colors.grey[800]};
`;
export const StyledTextTitle = styled(Text)`
text-align: center;
${({ theme }) => css`
font-family: ${theme.fonts.bold};
font-size: ${theme.fontSizes.m};
color: ${theme.colors.grey[900]};
margin-top: ${theme.space["space-6"]};
margin-bottom: ${theme.space["space-3"]};
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/filterCells/components/filterButton/styled-components.ts
import styled, { css } from "styled-components/native";
import { Pressable } from "react-native";
import { FilterButtonProps, ButtonStates } from "./types";
import { Theme } from "../../../../theming/types";
const buttonSizes = {
s: css`
height: 25px;
padding: 4px 7px;
`,
m: css`
height: 32px;
padding: 6px 7px;
`,
l: css`
height: 44px;
padding: 12px 15px;
`
} as const;
const buttonStates = {
default: css`
background: transparent;
border: solid 1px transparent;
`,
hover: css`
background: ${({ theme }) =>
theme.colorTokens.component.button.tertiary.background.hover};
border: 1px solid ${({ theme }) => theme.colorTokens.border.default};
`,
active: css`
background: ${({ theme }) =>
theme.colorTokens.component.activeGroupedFilterCell.background};
border: 1px solid
${({ theme }) =>
theme.colorTokens.component.activeGroupedFilterCell.border};
z-index: 1;
`,
pressed: css`
background: ${({ theme }) =>
theme.colorTokens.component.button.buttonLink.background.hover};
border: 1px solid ${({ theme }) => theme.colorTokens.border.default};
`
} as const;
export const StyledButton = styled(Pressable)<
Pick<
FilterButtonProps,
"size" | "iconSide" | "minWidth" | "isStretch" | "hasWidth"
> &
ButtonStates
>`
align-items: center;
justify-content: center;
border-radius: 2px;
flex-direction: ${({ iconSide }) =>
iconSide === "left" ? "row" : "row-reverse"};
gap: 10px;
line-height: 18px;
margin: 0 -1px;
transition: all 0.2s ease-in-out;
${({ hasWidth }) =>
hasWidth &&
css`
width: max-content;
`}
${({ isStretch }) =>
isStretch &&
css`
flex: 1;
`}
${({ minWidth }) =>
minWidth &&
css`
min-width: ${minWidth}px;
`}
${({ size }) => buttonSizes[size as FilterButtonProps["size"]]}
${({ isHovered, isPressed, isActive }) => {
if (isActive) return buttonStates.active;
if (isPressed) return buttonStates.pressed;
if (isHovered) return buttonStates.hover;
return buttonStates.default;
}}
`;
export const StyledText = styled.Text<
Pick<ButtonStates, "isActive"> &
Pick<FilterButtonProps, "size"> & {
theme: Theme;
children?: React.ReactNode;
}
>`
color: ${({ theme, isActive }) =>
isActive
? theme.colorTokens.component.activeGroupedFilterCell.content
: theme.colorTokens.content.default};
font-family: ${({ theme }) => theme.fonts.medium};
font-size: ${({ theme, size }) =>
size === "s" ? theme.fontSizes.xs : theme.fontSizes.s};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/filterCells/styled-components.ts
import styled, { css } from "styled-components/native";
import { View } from "react-native";
import { space, color, compose } from "styled-system";
import { FilterCellsProps } from "./types";
const stylesFn = compose(space, color);
const containerSizes = {
s: css`
height: 25px;
`,
m: css`
height: 32px;
`,
l: css`
height: 44px;
`
} as const;
const containerWidth = {
stretch: css`
width: 100%;
`,
maxContent: css`
width: max-content;
`
} as const;
export const FilterCellContainer = styled(View)<
Pick<FilterCellsProps, "size" | "hasShadow" | "isStretch" | "hasWidth">
>`
align-items: center;
border-radius: 2px;
${({ hasShadow }) =>
hasShadow &&
css`
box-shadow: ${({ theme }) => theme.elevations.low};
`}
border: 1px solid ${({ theme }) => theme.colorTokens.border.default};
flex-direction: row;
${({ hasWidth, isStretch }) => {
if (hasWidth && isStretch) return containerWidth.stretch;
return hasWidth && !isStretch && containerWidth.maxContent;
}}
${({ size }) => containerSizes[size as FilterCellsProps["size"]]};
${stylesFn}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/flag/styled-components.ts
import styled from "styled-components/native";
import { Svg } from "react-native-svg";
import { space } from "../../theming/styledSystem";
export const StyledSvg = styled(Svg)`
border-radius: 2px;
${space}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/headers/sectionHeader/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { layout } from "styled-system";
import { colors } from "../../../theming/themes/common/colors";
import { Paragraph } from "../../typography";
export const StyledComponent = styled(View)<{ isDesktop: boolean }>`
justify-content: center;
padding-left: ${({ theme }) => theme.space["space-4"]};
background-color: ${colors.white["900"]};
box-shadow: 0 1px 0 ${colors.blue["100"]};
min-height: ${({ isDesktop }) => (isDesktop ? "64px" : "48px")};
${layout}
`;
export const TextContainer = styled(View)`
flex-shrink: 1;
`;
export const Subtitle = styled(Paragraph)`
color: var(--fd-colors-content-subtle);
line-height: 125%;
margin-top: var(--fd-space-space-05, 2px);
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/headers/baseHeaders/styled-components.ts
import styled, { css } from "styled-components/native";
import { View } from "react-native";
import { Header, Paragraph } from "../../typography";
import { colors } from "../../../theming/themes/common/colors";
export const StyledComponent = styled(View)<{
hasRoundedCorners: boolean;
hasBorderBottom?: boolean;
hasShadow: boolean;
hasSubtitle: boolean;
isMobile: boolean;
isDarkMode?: boolean;
}>`
flex-direction: row;
align-content: space-between;
padding: ${({ isMobile, theme }) =>
isMobile ? theme.space["space-3"] : "14px"};
background-color: ${({ theme, isDarkMode }) =>
isDarkMode
? theme.colorTokens.background.promotional
: "var(--fd-colors-background-surface)"};
border-bottom-color: var(--fd-colors-border-subtle);
${({ hasBorderBottom }) =>
hasBorderBottom ? "border-bottom-width: 1px;" : "border-bottom-width: 0px;"}
${({ hasShadow }) =>
hasShadow && `box-shadow: 0 1px 3px ${colors.blue["100"]}`};
${({ hasSubtitle, isMobile }) =>
isMobile
? `min-height: ${hasSubtitle ? "69px" : "48px"}`
: `min-height: ${hasSubtitle ? "85px" : "64px"}`};
${({ hasRoundedCorners }) =>
hasRoundedCorners &&
"border-top-left-radius: var(--fd-radii-border-radius-020); border-top-right-radius: var(--fd-radii-border-radius-020);"}
`;
export const StyledHeader = styled(Header)`
font-size: var(--fd-font-sizes-font-size-060);
line-height: var(--fd-line-heights-line-height-010);
${({ isDarkMode }) =>
isDarkMode
? "color: var(--fd-colors-content-on-dark)"
: "color: var(--fd-colors-content-strong)"};
`;
const trackModalleftPadding = (isTrackRulesModal?: boolean) =>
isTrackRulesModal ? "4px" : "0";
export const TextContainer = styled(View)<{
isMobile: boolean;
isPaddingLeft: boolean;
isPaddingRight: boolean;
withoutButton: boolean;
titlePosition?: string;
isTrackRulesModal?: boolean;
}>`
flex-direction: column;
${({ titlePosition }) =>
titlePosition &&
css`
align-items: ${titlePosition};
`};
justify-content: center;
flex-grow: 1;
flex-shrink: 1;
padding: ${({
isMobile,
theme,
isPaddingLeft,
isPaddingRight,
isTrackRulesModal
}) =>
isMobile
? `${theme.space["space-1"]}
${isPaddingRight ? theme.space["space-8"] : "0"}
${theme.space["space-1"]}
${
isPaddingLeft && !isTrackRulesModal
? theme.space["space-8"]
: trackModalleftPadding(isTrackRulesModal)
}`
: `${theme.space["space-2"]}
${isPaddingRight ? theme.space["space-8"] : "0"}
${theme.space["space-2"]}
${isPaddingLeft ? theme.space["space-8"] : "0"}`};
${({ withoutButton, isMobile, theme }) =>
withoutButton &&
`padding: ${isMobile ? theme.space["space-1"] : theme.space["space-2"]}`};
`;
export const DescriptionContainer = styled(View)`
flex-direction: row;
align-items: center;
padding-top: ${({ theme }) => theme.space["space-1"]};
`;
export const ButtonIconContainer = styled(View)`
padding: 2px 0;
`;
export const ContainerLink = styled(View)`
flex-shrink: 1;
`;
export const StyledParagraph = styled(Paragraph)`
text-align: center;
`;
export const LeftElement = styled(View)`
justify-content: center;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/headers/baseHeaders/index.tsx
import React, { useContext } from "react";
import { useTheme } from "../../../theming";
import { TvgConfContext } from "../../../utils/tvgConfProvider";
import { useQaLabel } from "../../../hooks/useQaLabel";
import { Icon } from "../../icon";
import { IconButton } from "../../iconButton";
import {
DescriptionContainer,
StyledComponent,
StyledHeader,
TextContainer,
ButtonIconContainer,
ContainerLink,
StyledParagraph,
LeftElement
} from "./styled-components";
import { ModalHeaderProps, PagesHeaderProps } from "./types";
import { Link } from "../../link";
export const BaseHeader = ({
qaLabel = "modal-label",
title,
subtitle = "",
subtitleType = "description",
hasRoundedCorners = false,
hasShadow = false,
linkUrl,
onBack,
onClose,
headerLeftElement,
isDarkMode = false,
titlePosition,
isTrackRulesModal,
hasBorderBottom = false,
...rest
}: PagesHeaderProps & ModalHeaderProps) => {
const viewTestProps = useQaLabel(qaLabel);
const { device } = useContext(TvgConfContext);
const isMobile = device === "mobile";
const { fonts } = useTheme();
return (
<StyledComponent
hasRoundedCorners={hasRoundedCorners}
hasSubtitle={!!subtitle}
hasShadow={hasShadow}
isMobile={isMobile}
isDarkMode={isDarkMode}
hasBorderBottom={hasBorderBottom}
{...viewTestProps}
{...rest}
>
{React.isValidElement(headerLeftElement) && (
<LeftElement>{headerLeftElement}</LeftElement>
)}
{onBack && (
<ButtonIconContainer>
<IconButton
qaLabel="back-button-pages"
iconName="arrowLeft"
size="s"
variant="tertiary"
onPress={onBack}
/>
</ButtonIconContainer>
)}
<TextContainer
isMobile={isMobile}
isPaddingLeft={!onBack && !!onClose && !headerLeftElement}
isPaddingRight={!!onBack && !onClose}
withoutButton={!onClose && !onBack}
titlePosition={titlePosition}
isTrackRulesModal={isTrackRulesModal}
>
{typeof title === "string" && (
<StyledHeader
isDarkMode={isDarkMode}
tag="h2"
qaLabel="pages-header"
fontFamily="bold"
>
{title}
</StyledHeader>
)}
{React.isValidElement(title) && <>{title}</>}
{subtitle !== "" && (
<DescriptionContainer>
{subtitleType === "link" && (
<>
<Icon
name="info"
size="s"
pr="space-1"
qaLabel="description-icon"
lineColor="var(--fd-colors-system-info-content-accent)"
backgroundColor="var(--fd-colors-system-info-background-subtle)"
/>
<ContainerLink>
<Link
qaLabel="link"
href={linkUrl}
// eslint-disable-next-line react-native/no-inline-styles, react-native/no-color-literals
style={{
color: "var(--fd-colors-link-default-base)",
fontFamily: fonts.regular,
textAlign: "center"
}}
>
{subtitle}
</Link>
</ContainerLink>
</>
)}
{subtitleType === "description" && (
<StyledParagraph
qaLabel="pages-paragraph"
color="var(--fd-colors-content-subtle)"
>
{subtitle}
</StyledParagraph>
)}
{subtitleType === "element" && React.isValidElement(subtitle) && (
<>{subtitle}</>
)}
</DescriptionContainer>
)}
</TextContainer>
{onClose && (
<ButtonIconContainer>
<IconButton
qaLabel="close-button-pages"
iconName="close"
size="s"
variant={isDarkMode ? "tertiary_dark" : "tertiary"}
onPress={onClose}
/>
</ButtonIconContainer>
)}
</StyledComponent>
);
};
export type { PagesHeaderProps, ModalHeaderProps };
export default BaseHeader;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/headers/modalHeader/index.tsx
import React from "react";
import { BaseHeader } from "../baseHeaders";
import { ModalHeaderProps } from "../baseHeaders/types";
export const ModalHeader = ({
qaLabel = "modalHeader",
title,
subtitle = "",
subtitleType = "description",
hasRoundedCorners = false,
hasShadow = false,
hasBorderBottom = true,
isDarkMode = false,
linkUrl,
onBack,
onClose,
titlePosition,
headerLeftElement,
isTrackRulesModal
}: ModalHeaderProps) => (
<BaseHeader
qaLabel={qaLabel}
title={title}
subtitle={subtitle}
hasRoundedCorners={hasRoundedCorners}
hasShadow={hasShadow}
subtitleType={subtitleType}
linkUrl={linkUrl}
onBack={onBack}
onClose={onClose}
hasBorderBottom={hasBorderBottom}
headerLeftElement={headerLeftElement}
isDarkMode={isDarkMode}
titlePosition={titlePosition}
isTrackRulesModal={isTrackRulesModal}
/>
);
export type { ModalHeaderProps };
export default ModalHeader;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/headers/pageHeader/index.tsx
import React from "react";
import { BaseHeader } from "../baseHeaders";
import { PagesHeaderProps } from "../baseHeaders/types";
export const PageHeader = ({
qaLabel = "pageHeader",
title,
subtitle = "",
subtitleType = "description",
hasShadow = false,
linkUrl,
onBack,
titlePosition,
isTrackRulesModal,
hasBorderBottom = false
}: PagesHeaderProps) => (
<BaseHeader
qaLabel={qaLabel}
title={title}
subtitle={subtitle}
subtitleType={subtitleType}
hasShadow={hasShadow}
linkUrl={linkUrl}
onBack={onBack}
titlePosition={titlePosition}
isTrackRulesModal={isTrackRulesModal}
hasBorderBottom={hasBorderBottom}
/>
);
export type { PagesHeaderProps };
export default PageHeader;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/illustration/styled-components.ts
import styled from "styled-components";
import { space } from "styled-system";
import { Svg } from "react-native-svg";
export const StyledSVG = styled(Svg)`
${space}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/image/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { space } from "styled-system";
export const StyledImage = styled.Image(space);
export const Container = styled(View)`
width: 100%;
`;
export const ErrorContainer = styled(View)`
flex-direction: row;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/input/styled-components.ts
import { Platform, View, Pressable, TextInput, Text } from "react-native";
import styled, { css } from "styled-components/native";
import {
space,
width,
color,
borderColor,
compose
} from "../../theming/styledSystem";
import { InputBoxProps, StyledInputProps } from "./types";
const backgroundColors = {
default: "white.900",
disabled: "blue.000",
pressed: "blue_accent.100",
hover: "blue_accent.000"
};
const borderColors = {
default: "blue.100",
hovered: "blue_accent.300",
focused: "blue_accent.500",
invalid: "orange.600"
};
const borderDefault = {
borderWidth: "1px",
borderStyle: "solid",
borderRadius: "2px",
borderColor: borderColors.default
};
const cssBorder = ({ isInvalid, isFocused }: InputBoxProps) => ({
...borderDefault,
borderWidth: isFocused || isInvalid ? "2px" : borderDefault.borderWidth
});
const cssBoxShadow = ({
isPressed,
isDisabled,
isHovered,
theme
}: InputBoxProps) => {
if (isDisabled || isPressed) {
return { boxShadow: "none" };
}
return isHovered
? { boxShadow: theme.elevations.medium }
: { boxShadow: theme.elevations.low };
};
const styledUtils = compose(space, width, color, borderColor);
export const InputBox = styled(View).attrs<InputBoxProps>((props) => ({
bg:
((props.isDisabled || !props.editable) && backgroundColors.disabled) ||
(props.isPressed && backgroundColors.pressed) ||
(props.isHovered && backgroundColors.hover) ||
backgroundColors.default,
borderColor:
(props.isFocused && borderColors.focused) ||
(props.isInvalid && borderColors.invalid) ||
(props.isHovered && borderColors.hovered) ||
borderColors.default
}))<InputBoxProps>`
flex-grow: 1;
width: auto;
height: 42px;
flex-direction: row;
align-content: space-between;
align-items: center;
${cssBoxShadow}
${cssBorder};
${styledUtils};
${({ isSelect }) =>
isSelect &&
css`
margin-left: 0;
margin-right: 0;
`}
`;
export const StyledInput = styled(TextInput).attrs<{
isDisabled: boolean;
}>((props) => ({
placeholderTextColor: props.isDisabled
? props.theme.colors?.blue[300]
: props.theme.colors?.grey[700]
}))<StyledInputProps>`
${Platform.OS === "web" &&
css`
outline-style: none;
`};
flex-grow: 1;
width: auto;
height: ${({ isNested }) => (isNested ? "100%" : "42px")};
${({ theme, isDisabled }) => css`
padding: ${theme.space["space-4"]};
font-family: ${theme.fonts?.regular};
font-size: ${theme.fontSizes?.s};
color: ${isDisabled ? theme.colors?.blue[300] : theme.colors?.grey[900]};
`}
`;
export const StyledPressable = styled(Pressable)`
align-items: stretch;
height: 42px;
flex-grow: 1;
flex-shrink: 1;
`;
export const TopWrapper = styled(View)`
flex-direction: row;
justify-content: space-between;
`;
export const LabelWrapper = styled(View)`
flex-direction: row;
align-content: flex-start;
align-items: center;
`;
export const StyledLabel = styled(Text)`
${space};
${({ theme }) => css`
font-family: ${theme.fonts?.medium};
font-size: ${theme.fontSizes?.s};
color: ${theme.colors?.grey[900]};
`}
`;
export const StyledOptionalTag = styled(Text)`
${({ theme }) => css`
margin-left: ${theme.space["space-1"]};
font-family: ${theme.fonts?.medium};
font-size: ${theme.fontSizes?.xs};
color: ${theme.colors?.grey[700]};
`}
`;
export const InputWrapper = styled(View)(compose(space, width));
export const IconWrapper = styled(View)`
margin-left: ${({ theme }) => theme.space["space-1"]};
`;
export const MessageWrapper = styled(View)`
${space};
flex-direction: row;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/input/inputSelect/styled-components.ts
// @ts-ignore
import { createElement, View } from "react-native";
import styled from "styled-components/native";
import type { OptionsProps, SelectProps } from "../types";
export const SelectElement = (props: SelectProps) =>
createElement("select", props);
export const OptionElement = (props: OptionsProps) =>
createElement("option", props);
export const Select = styled(SelectElement)<
Pick<SelectProps, "fonts" | "fontsizes" | "colors">
>`
appearance: none;
height: 42px;
background-color: transparent;
border: transparent;
z-index: 1;
padding-left: 12px;
padding-right: 36px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
font-family: ${({ fonts }) => fonts.regular};
font-size: ${({ fontsizes }) => fontsizes.s};
color: ${({ disabled, value, placeholder }) =>
disabled || (!value && placeholder)
? "var(--fd-colors-component-data-input-content-disabled)"
: "var(--fd-colors-component-data-input-content-base)"};
`;
export const Option = styled(OptionElement)<OptionsProps>`
font-family: ${({ fonts }) => fonts.regular};
`;
export const SelectWrapper = styled(View)`
margin-top: var(--fd-space-space-4);
padding: var(--fd-space-space-3);
width: 100%;
box-shadow: 0 2px 2px rgba(17, 43, 68, 0.15);
border-color: blue;
border-radius: 2px;
`;
export const SelectIconWrapper = styled(View)<{
isDisabled: boolean;
isMobile?: boolean;
}>`
position: absolute;
align-items: center;
justify-content: center;
right: 5px;
${({ isMobile }) =>
isMobile &&
`
top: calc(var(--fd-space-space-2)-2);
`};
border-radius: 100px;
height: var(--fd-space-space-8);
width: var(--fd-space-space-8);
`;
export const RnSelectWrapper = styled(View)`
align-items: center;
justify-content: center;
padding-left: var(--fd-space-space-3);
flex-grow: 1;
height: 42px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/linkCard/linkCardList/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { compose, space, border } from "../../../theming/styledSystem";
export const borderStyles = {
borderWidth: "1px",
borderColor: "blue.100",
borderRadius: "s"
};
export const getListElemDividerStyles = (index: number, listLength: number) => {
let styles = {};
const isFirstElement = index === 0;
const isLastElement = index === listLength - 1;
if (isFirstElement) {
styles = {
borderTopLeftRadius: borderStyles.borderRadius,
borderTopRightRadius: borderStyles.borderRadius
};
} else {
styles = {
borderTopWidth: borderStyles.borderWidth,
borderTopColor: borderStyles.borderColor
};
}
if (isLastElement) {
styles = {
...styles,
borderBottomLeftRadius: borderStyles.borderRadius,
borderBottomRightRadius: borderStyles.borderRadius
};
}
return styles;
};
const StyledCardListUtils = compose(space, border);
export const StyledCardList = styled(View)(StyledCardListUtils);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/linkCard/linkCardList/index.tsx
import React, { cloneElement } from "react";
import { useQaLabel } from "../../../hooks/useQaLabel";
import {
StyledCardList,
getListElemDividerStyles,
borderStyles
} from "./styled-components";
import { LinkCardListProps } from "../types";
const resetBorderStyles = {
borderWidth: 0,
borderRadius: 0
};
export const LinkCardList = ({
children,
qaLabel,
...rest
}: LinkCardListProps) => {
const listElements = React.Children.toArray(children);
const listLength = listElements.length;
return (
<StyledCardList
accessibilityRole="menu"
{...borderStyles}
{...useQaLabel(qaLabel)}
{...rest}
>
{listElements.map(
(elem, index) =>
React.isValidElement(elem) &&
cloneElement(elem, {
key: `list-${index}`,
accessibilityRole: "menuitem",
...resetBorderStyles,
...getListElemDividerStyles(index, listLength)
} as Partial<unknown>)
)}
</StyledCardList>
);
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/linkItem/styled-components.ts
import { Platform, View, Pressable } from "react-native";
import styled, { css } from "styled-components/native";
import { compose, space, color, border } from "../../theming/styledSystem";
import { Header } from "../typography";
const styledComponentUtils = compose(space, color, border);
export const StyledComponent = styled(Pressable).attrs<{
isDisabled?: boolean;
isHovered: boolean;
isPressed: boolean;
}>(({ isDisabled, isHovered, isPressed }) => ({
...(Platform.OS === "web"
? {
disabled: isDisabled
}
: {}),
...(isDisabled || isPressed || isHovered
? {
backgroundColor:
(isDisabled && "blue.000") ||
(isPressed && "blue_accent.200") ||
(isHovered && "blue_accent.100")
}
: {})
}))<{
isDisabled: boolean;
hasDividerLine: boolean;
}>`
width: 100%;
flex-direction: row;
justify-content: space-between;
${({ theme }) => css`
padding: ${theme.space["space-5"]} ${theme.space["space-4"]};
background-color: ${theme.colors.white["900"]};
`};
${styledComponentUtils};
${({ isDisabled, hasDividerLine }) =>
(isDisabled &&
(Platform.OS === "web"
? css`
opacity: 0.5;
cursor: default;
`
: css`
opacity: 0.5;
`)) || // visual fix for focus when using tab navigation
(hasDividerLine &&
Platform.OS === "web" &&
css`
outline-offset: -2px;
`)};
`;
export const ContentWrapper = styled(View)`
flex: 1;
flex-direction: row;
align-items: center;
`;
export const StyledContent = styled(View)`
flex: 1;
justify-content: space-between;
`;
export const StyledHeader = styled(Header).attrs({ tag: "h3" })`
${({ theme }) => css`
font-size: ${theme.fontSizes.s};
line-height: ${theme.lineHeights.s};
`}
`;
export const StyledDivider = styled(View)`
${({ theme }) => css`
position: absolute;
left: ${theme.space["space-4"]};
right: 0;
bottom: 0;
height: 1px;
background: ${theme.colors.blue[100]};
`}
`;
export const IconContainer = styled(View)<{ iconSize?: string }>`
height: ${({ iconSize }) => (iconSize && iconSize !== "s" ? "50%" : "100%")};
justify-content: ${({ iconSize }) =>
iconSize && iconSize !== "s" ? "center" : "flex-start"};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/logo/types.ts
import { MarginProps } from "styled-system";
export type Brand = "4njbets" | "iowa" | "tvg" | "fdr" | "fdr-iowa";
export interface LogoProps extends MarginProps {
/**
* Set custom height
*/
height?: number;
/**
* Set TVG lettering to white
*/
isDarkMode?: boolean;
/**
* Brand
*/
brand?: Brand;
/**
* Show only illustration
*/
isOnlyIllustration?: boolean;
/**
* Set aria-label
*/
accessibilityLabel?: string;
/**
* Custom data-qa-label
*/
qaLabel?: string;
}
export enum DEFAULTS {
height = 18,
widthComplete = 103,
widthIllustration = 33
}
export enum TYPE_LOGO {
illustration = "illustration",
complete = "complete"
}
export type Dimension = {
dimension: {
viewBox: string;
height: number;
width: number;
};
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/linkItem/linkItemList/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { compose, space, border } from "../../../theming/styledSystem";
const StyledItemListUtils = compose(space, border);
export const StyledItemList = styled(View)(StyledItemListUtils);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/linkItem/index.tsx
import React, { forwardRef } from "react";
import { TouchableHighlight, GestureResponderEvent } from "react-native";
import { useQaLabel } from "../../hooks/useQaLabel";
import { useEvents } from "../../hooks/useEvents";
import { Paragraph } from "../typography";
import { LinkItemProps, LinkItemCompoundComponent } from "./types";
import {
StyledComponent,
ContentWrapper,
StyledContent,
StyledHeader,
StyledDivider,
IconContainer
} from "./styled-components";
import { Icon } from "../icon";
import { LinkItemList } from "./linkItemList";
export const LinkItem = forwardRef<typeof TouchableHighlight, LinkItemProps>(
(
{
title,
description,
isDisabled = false,
start,
end,
onPress,
qaLabel,
hasDividerLine = false,
hasArrowRight = true,
...rest
},
ref
) => {
const { events, eventsHandlers } = useEvents({}, !isDisabled);
const marginByIconSize = (iconSize: string) => {
switch (iconSize) {
case "l":
return { mt: 6 };
case "m":
return { mt: 8 };
default:
return { mt: 2 };
}
};
const handleMargin = () =>
typeof title?.render === "object" && title?.iconSize
? marginByIconSize(title.iconSize)
: { mt: 0 };
return (
<StyledComponent
// @ts-ignore
ref={ref}
accessibilityRole="button"
isDisabled={isDisabled}
hasDividerLine={hasDividerLine}
onPress={(event: GestureResponderEvent) => {
if (typeof onPress === "function" && !isDisabled) onPress(event);
}}
{...events}
{...eventsHandlers}
{...rest}
{...useQaLabel(qaLabel)}
>
<>
<ContentWrapper>
{start}
<StyledContent>
{!!title &&
(React.isValidElement(title.render) ? (
title.render
) : (
<StyledHeader qaLabel={`${qaLabel}-title`} tag="h3">
{title.render}
</StyledHeader>
))}
{description && (
<Paragraph
color="grey.800"
qaLabel={`${qaLabel}-description`}
{...handleMargin()}
>
{description}
</Paragraph>
)}
</StyledContent>
{end}
</ContentWrapper>
{!isDisabled && onPress && hasArrowRight && (
<IconContainer iconSize={title?.iconSize}>
<Icon
name="chevronRight"
size="s"
lineColor="grey.800"
// @ts-ignore - avoid keyboard tab flow
focusable={false}
/>
</IconContainer>
)}
{hasDividerLine && <StyledDivider />}
</>
</StyledComponent>
);
}
) as LinkItemCompoundComponent<typeof LinkItemList>;
export type { LinkItemProps };
export { StyledHeader as LinkItemTitle };
LinkItem.List = LinkItemList;
export default LinkItem;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/linkItem/linkItemList/index.tsx
import React, { cloneElement } from "react";
import { useQaLabel } from "../../../hooks/useQaLabel";
import { StyledItemList } from "./styled-components";
import { LinkItemListProps } from "../types";
export const LinkItemList = ({
children,
qaLabel,
...rest
}: LinkItemListProps) => {
const listElements = React.Children.toArray(children);
const lastElemIndex = listElements.length - 1;
return (
<StyledItemList accessibilityRole="menu" {...useQaLabel(qaLabel)} {...rest}>
{listElements.map(
(elem, index) =>
React.isValidElement(elem) &&
cloneElement(elem, {
key: `list-${index}`,
accessibilityRole: "menuitem",
hasDividerLine: index !== lastElemIndex
} as Partial<unknown>)
)}
</StyledItemList>
);
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/linkCard/index.tsx
import React, { forwardRef } from "react";
import { TouchableHighlight } from "react-native";
import { LinkCardProps, LinkCardCompoundComponent } from "./types";
import { LinkCardList } from "./linkCardList";
import { borderStyles } from "./linkCardList/styled-components";
import { LinkItem, LinkItemTitle } from "../linkItem";
export const LinkCard = forwardRef<typeof TouchableHighlight, LinkCardProps>(
(props, ref) => (
<LinkItem ref={ref} bg="blue_accent.000" {...borderStyles} {...props} />
)
) as LinkCardCompoundComponent<typeof LinkCardList>;
export type { LinkCardProps };
export { LinkItemTitle as LinkCardTitle, borderStyles as linkCardBorderStyles };
LinkCard.List = LinkCardList;
export default LinkCard;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/loadingMaskAnimation/styled-components.ts
import { animated } from "@react-spring/native";
import styled from "styled-components/native";
import { margin } from "styled-system";
export const StyledAnimatedContainer = styled(animated.View)`
${margin}
width: 100%;
height: 100%;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/logo/utils.ts
import { Brand, DEFAULTS, TYPE_LOGO, Dimension } from "./types";
const defaultDimensions = {
[TYPE_LOGO.complete]: [DEFAULTS.widthComplete, DEFAULTS.height],
[TYPE_LOGO.illustration]: [DEFAULTS.widthIllustration, DEFAULTS.height]
};
export const getDimensions = (
brand: Brand,
height: number,
typeLogo: TYPE_LOGO
): Dimension => {
const [defaultWidth, defaultHeight] = defaultDimensions[`${typeLogo}`];
switch (brand) {
case "iowa":
return {
dimension: {
viewBox: `0 0 103 30`,
height,
width: (height * 103) / 30
}
};
case "fdr":
return {
dimension: {
viewBox: `0 0 123 36`,
height: 36,
width: 126
}
};
case "4njbets":
return {
dimension: {
viewBox: `0 0 ${defaultWidth} ${defaultHeight}`,
height: height * 1.5,
width: (defaultWidth / defaultHeight) * (height * 1.5)
}
};
case "fdr-iowa":
return {
dimension: {
viewBox: `0 0 172 36`,
height: 36,
width: 172
}
};
default:
return {
dimension: {
viewBox: `0 0 112 34`,
height: 34,
width: 112
}
};
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/logo/styled-components.ts
import styled from "styled-components/native";
import { margin } from "styled-system";
import SVG from "react-native-svg";
export const StyledSVG = styled(SVG)(margin);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/logo/pathIllustation.tsx
import React from "react";
import { Path } from "react-native-svg";
import { useTheme } from "../../theming";
export const PathIllustration = () => {
const { colors } = useTheme();
return (
<>
<Path
fillRule="evenodd"
clipRule="evenodd"
d="M4.54017 0.576019L0 17.3625L27.7691 17.364L32.31 0.578247L4.54017 0.576019Z"
fill={colors.green[500]}
/>
<Path
fillRule="evenodd"
clipRule="evenodd"
d="M22.8947 2.43442L23.1079 3.43632L22.9995 3.46009C11.6449 5.9719 5.17597 15.3151 5.11284 15.4094L5.04674 15.506L4.17777 14.8539L4.2409 14.7655C11.717 4.34093 22.6801 2.46932 22.79 2.4515L22.8947 2.43442ZM20.6704 10.4827C21.073 10.9261 21.6671 11.137 22.4254 11.1206L22.5376 11.1177L22.5561 12.0156L22.4544 12.026C22.441 12.0275 22.3593 12.0356 22.2293 12.0356C21.7971 12.0356 20.8338 11.9473 20.0963 11.232C19.3937 10.5525 19.0899 9.4919 19.1939 8.08077L19.2028 7.96713L20.074 8.04957L20.0599 8.16321L20.0598 8.16435C20.0545 8.21268 19.8999 9.63513 20.6704 10.4827ZM21.984 4.46323L21.34 5.14131L26.7692 11.1342L25.4583 12.9842L26.178 13.5643L27.965 11.0569L21.984 4.46323ZM2.14371 9.55649H6.79826V10.5079H1.88674L2.14371 9.55649ZM13.1147 4.53061H3.50626L3.25003 5.46715H13.1147V4.53061ZM2.82164 7.05112H9.61296V7.98766H2.56838L2.82164 7.05112Z"
fill={colors.white[900]}
/>
</>
);
};
webpack://frontend-tpt/../../node_modules/react-native-safe-area-context/lib/module/SafeAreaContext.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import * as React from 'react';
import { Dimensions, StyleSheet } from 'react-native';
import NativeSafeAreaProvider from './NativeSafeAreaProvider';
export const SafeAreaInsetsContext = /*#__PURE__*/React.createContext(null);
SafeAreaInsetsContext.displayName = 'SafeAreaInsetsContext';
export const SafeAreaFrameContext = /*#__PURE__*/React.createContext(null);
SafeAreaFrameContext.displayName = 'SafeAreaFrameContext';
export function SafeAreaProvider({
children,
initialMetrics,
initialSafeAreaInsets,
style
}) {
var _ref, _ref2, _initialMetrics$inset, _ref3, _initialMetrics$frame;
const parentInsets = useParentSafeAreaInsets();
const parentFrame = useParentSafeAreaFrame();
const [insets, setInsets] = React.useState((_ref = (_ref2 = (_initialMetrics$inset = initialMetrics === null || initialMetrics === void 0 ? void 0 : initialMetrics.insets) !== null && _initialMetrics$inset !== void 0 ? _initialMetrics$inset : initialSafeAreaInsets) !== null && _ref2 !== void 0 ? _ref2 : parentInsets) !== null && _ref !== void 0 ? _ref : null);
const [frame, setFrame] = React.useState((_ref3 = (_initialMetrics$frame = initialMetrics === null || initialMetrics === void 0 ? void 0 : initialMetrics.frame) !== null && _initialMetrics$frame !== void 0 ? _initialMetrics$frame : parentFrame) !== null && _ref3 !== void 0 ? _ref3 : {
// Backwards compat so we render anyway if we don't have frame.
x: 0,
y: 0,
width: Dimensions.get('window').width,
height: Dimensions.get('window').height
});
const onInsetsChange = React.useCallback(event => {
const {
nativeEvent: {
frame: nextFrame,
insets: nextInsets
}
} = event;
if ( // Backwards compat with old native code that won't send frame.
nextFrame && (nextFrame.height !== frame.height || nextFrame.width !== frame.width || nextFrame.x !== frame.x || nextFrame.y !== frame.y)) {
setFrame(nextFrame);
}
if (!insets || nextInsets.bottom !== insets.bottom || nextInsets.left !== insets.left || nextInsets.right !== insets.right || nextInsets.top !== insets.top) {
setInsets(nextInsets);
}
}, [frame, insets]);
return /*#__PURE__*/React.createElement(NativeSafeAreaProvider, {
style: [styles.fill, style],
onInsetsChange: onInsetsChange
}, insets != null ? /*#__PURE__*/React.createElement(SafeAreaFrameContext.Provider, {
value: frame
}, /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Provider, {
value: insets
}, children)) : null);
}
const styles = StyleSheet.create({
fill: {
flex: 1
}
});
function useParentSafeAreaInsets() {
return React.useContext(SafeAreaInsetsContext);
}
function useParentSafeAreaFrame() {
return React.useContext(SafeAreaFrameContext);
}
export function useSafeAreaInsets() {
const safeArea = React.useContext(SafeAreaInsetsContext);
if (safeArea == null) {
throw new Error('No safe area insets value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.');
}
return safeArea;
}
export function useSafeAreaFrame() {
const frame = React.useContext(SafeAreaFrameContext);
if (frame == null) {
throw new Error('No safe area frame value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.');
}
return frame;
}
export function withSafeAreaInsets(WrappedComponent) {
return /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(SafeAreaConsumer, null, insets => /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
insets: insets,
ref: ref
}))));
}
/**
* @deprecated
*/
export function useSafeArea() {
return useSafeAreaInsets();
}
/**
* @deprecated
*/
export const SafeAreaConsumer = SafeAreaInsetsContext.Consumer;
/**
* @deprecated
*/
export const SafeAreaContext = SafeAreaInsetsContext;
//# sourceMappingURL=SafeAreaContext.js.map
webpack://frontend-tpt/../../node_modules/react-native-safe-area-context/lib/module/SafeAreaView.js
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import { useSafeAreaInsets } from './SafeAreaContext';
// prettier-ignore
const TOP = 0b1000,
RIGHT = 0b0100,
BOTTOM = 0b0010,
LEFT = 0b0001,
ALL = 0b1111;
/* eslint-disable no-bitwise */
const edgeBitmaskMap = {
top: TOP,
right: RIGHT,
bottom: BOTTOM,
left: LEFT
};
export function SafeAreaView({
style = {},
mode,
edges,
...rest
}) {
const insets = useSafeAreaInsets();
const edgeBitmask = edges != null ? edges.reduce((accum, edge) => accum | edgeBitmaskMap[edge], 0) : ALL;
const appliedStyle = React.useMemo(() => {
const insetTop = edgeBitmask & TOP ? insets.top : 0;
const insetRight = edgeBitmask & RIGHT ? insets.right : 0;
const insetBottom = edgeBitmask & BOTTOM ? insets.bottom : 0;
const insetLeft = edgeBitmask & LEFT ? insets.left : 0;
const flatStyle = StyleSheet.flatten(style);
if (mode === 'margin') {
const {
margin = 0,
marginVertical = margin,
marginHorizontal = margin,
marginTop = marginVertical,
marginRight = marginHorizontal,
marginBottom = marginVertical,
marginLeft = marginHorizontal
} = flatStyle;
const marginStyle = {
marginTop: marginTop + insetTop,
marginRight: marginRight + insetRight,
marginBottom: marginBottom + insetBottom,
marginLeft: marginLeft + insetLeft
};
return [style, marginStyle];
} else {
const {
padding = 0,
paddingVertical = padding,
paddingHorizontal = padding,
paddingTop = paddingVertical,
paddingRight = paddingHorizontal,
paddingBottom = paddingVertical,
paddingLeft = paddingHorizontal
} = flatStyle;
const paddingStyle = {
paddingTop: paddingTop + insetTop,
paddingRight: paddingRight + insetRight,
paddingBottom: paddingBottom + insetBottom,
paddingLeft: paddingLeft + insetLeft
};
return [style, paddingStyle];
}
}, [style, insets, mode, edgeBitmask]);
return /*#__PURE__*/React.createElement(View, _extends({
style: appliedStyle
}, rest));
}
//# sourceMappingURL=SafeAreaView.js.map
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/styled-components.ts
import { RefAttributes } from "react";
import styled, { css } from "styled-components/native";
import { initialWindowMetrics } from "react-native-safe-area-context";
import { ThemedStyledProps } from "styled-components";
import {
View,
ViewProps,
Modal,
TouchableWithoutFeedback,
Platform
} from "react-native";
import {
maxHeight,
MaxHeightProps,
maxWidth,
MaxWidthProps,
padding,
PaddingProps
} from "../../theming/styledSystem";
import { IsMobileProp, IsNativeProp, ModalTypeProp } from "./types";
import { Theme } from "../../theming/types";
export const INSET_VERTICAL = initialWindowMetrics
? initialWindowMetrics?.insets?.bottom + initialWindowMetrics?.insets?.top
: 0;
export const INSET_BOTTOM = initialWindowMetrics?.insets?.bottom || 0;
const PADDING_PROPS = [
"p",
"padding",
"pt",
"paddingTop",
"pb",
"paddingBottom",
"pl",
"paddingLeft",
"pr",
"paddingRight",
"py",
"paddingY",
"px",
"paddingX"
];
export const StyledModal = styled(Modal)`
background: ${({ theme }) => theme.colorTokens.background.surface};
`;
export const TouchableOverlayContainer = styled(TouchableWithoutFeedback)``;
export const TouchableContainer = styled(View)`
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
`;
export const OverlayContainer = styled(View)<ModalTypeProp>`
${({ theme, type }) => {
if (type === "full-width-page") {
return css`
background-color: ${theme.colorTokens.background.surface};
`;
}
if (type === "modal-custom-height") {
return "";
}
return css`
/* José asked to use this one by now */
background-color: ${theme.colors.black["700"]};
`;
}}
bottom: 0;
top: 0;
width: 100%;
position: absolute;
`;
export const ContentContainerFullscreen = styled(View)<{ topPosition: number }>`
border-top-right-radius: 4px;
border-top-left-radius: 4px;
position: absolute;
top: ${({ theme, topPosition }) => topPosition ?? theme.space["space-5"]};
bottom: 0;
background: ${({ theme }) => theme.colorTokens.background.surface};
width: 100%;
height: 100%;
padding-bottom: ${INSET_VERTICAL}px;
`;
export const ContentContainerCustomHeight = styled(View)<MaxHeightProps>`
border-top-right-radius: 4px;
border-top-left-radius: 4px;
position: absolute;
bottom: 0;
background: ${({ theme }) => theme.colorTokens.background.surface};
width: 100%;
height: 100%;
padding-bottom: ${INSET_VERTICAL}px;
${maxHeight}
`;
export const ContentContainerFullWidthPage = styled(View)`
position: absolute;
top: 0;
bottom: 0;
background: ${({ theme }) => theme.colorTokens.background.surface};
width: 100%;
padding-bottom: ${INSET_VERTICAL}px;
`;
const LIGHTBOX_DESKTOP_AND_TABLET_WIDTH = 391;
export const LIGHTBOX_MARGIN_SIDE = 12;
export const LIGHTBOX_MARGIN = LIGHTBOX_MARGIN_SIDE * 2;
export const ContentContainerLightbox = styled(View)<
{
height: number;
width: number;
contentHeight: number;
} & IsNativeProp
>`
position: absolute;
width: ${(props) => props.width - LIGHTBOX_MARGIN}px;
height: ${(props) => props.height - LIGHTBOX_MARGIN - INSET_VERTICAL}px;
display: flex;
margin: ${(props) => props.theme.space["space-4"]};
${(props) =>
props.contentHeight < props.height
? css`
justify-content: center;
`
: `justify-content: flex-start`};
align-items: center;
`;
export const ContentInnerLightbox = styled(View)<
{
height: number;
contentHeight?: number;
} & IsNativeProp &
IsMobileProp &
MaxWidthProps
>`
border-radius: ${(props) => props.theme.radii.s};
background: ${({ theme }) => theme.colors.white["900"]};
width: 100%;
max-width: ${(props) =>
props.isMobile ? "100%" : `${LIGHTBOX_DESKTOP_AND_TABLET_WIDTH}px`};
overflow: hidden;
${(props) => {
if (!props.isNative) return `height: auto;`;
return props?.contentHeight &&
props.contentHeight < props.height - LIGHTBOX_MARGIN
? css`
height: ${props.contentHeight}px;
`
: css`
height: ${props.height - INSET_VERTICAL}px;
`;
}};
max-height: ${(props) => props.height - LIGHTBOX_MARGIN}px;
${maxWidth}
`;
// We should consider using the safe area insets from react-native-safe-area-context
// The initialWindowMetrics for inset vertical is not returning the expected value
const insetVertical =
Platform.OS === "web" ? "env(safe-area-inset-top, 0)" : "0";
export const ContentContainerFlexible = styled(View)<{
contentHeight: number;
height: number;
}>`
position: absolute;
margin-top: ${LIGHTBOX_MARGIN_SIDE}px;
bottom: 0;
left: 0;
width: 100%;
height: ${(props) =>
props.contentHeight < props.height
? props.contentHeight + insetVertical
: props.height - LIGHTBOX_MARGIN_SIDE}px;
`;
export const ContentInnerFlexible = styled(View)`
position: relative;
border-top-right-radius: ${(props) => props.theme.radii.s};
border-top-left-radius: ${(props) => props.theme.radii.s};
background: ${({ theme }) => theme.colorTokens.background.surface};
bottom: 0;
width: 100%;
height: 100%;
/* stylelint-disable-next-line */
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
`;
export const childrenSpacing = (
props: ThemedStyledProps<
ViewProps & RefAttributes<View> & IsMobileProp & ModalTypeProp,
Theme
>
) =>
`padding: ${
props.type === "lightbox" && !props.isMobile
? props.theme.space["space-6"]
: props.theme.space["space-4"]
}`;
export const ChildrenContainer = styled(View)<
IsMobileProp &
ModalTypeProp & {
hasPages: boolean;
pageHeight: number;
isDarkMode: boolean;
} & PaddingProps
>`
background-color: ${({ theme, isDarkMode }) =>
isDarkMode
? theme.colorTokens.background.promotional
: theme.colorTokens.background.surface};
${(props) => (!props.hasPages ? childrenSpacing(props) : ``)};
${(props) =>
!props.hasPages &&
// check if has any padding prop
Object.keys(props).some((prop) => PADDING_PROPS.includes(prop))
? padding(props)
: ``};
${(props) =>
props.type === "full-width-page" ||
props.type === "fullscreen" ||
props.type === "modal-custom-height"
? css`
height: ${props.pageHeight}px;
`
: ``};
`;
export const StickyAreaContainer = styled(View)<IsMobileProp & ModalTypeProp>`
${childrenSpacing};
box-shadow: 0 -2px 4px rgb(17 43 68 / 14%);
background-color: ${({ theme }) => theme.colorTokens.background.surface};
`;
export const TopStickyAreaContainer = styled(View)<
ModalTypeProp & {
isScrolling: boolean;
}
>`
z-index: 1;
background-color: ${(props) => props.theme.colors.white[900]};
${({ isScrolling }) =>
isScrolling &&
css`
box-shadow: 0 2px 4px rgb(17 43 68 / 14%);
`}
`;
webpack://frontend-tpt/../../node_modules/d3-ease/src/back.js
var overshoot = 1.70158;
export var backIn = (function custom(s) {
s = +s;
function backIn(t) {
return (t = +t) * t * (s * (t - 1) + t);
}
backIn.overshoot = custom;
return backIn;
})(overshoot);
export var backOut = (function custom(s) {
s = +s;
function backOut(t) {
return --t * t * ((t + 1) * s + t) + 1;
}
backOut.overshoot = custom;
return backOut;
})(overshoot);
export var backInOut = (function custom(s) {
s = +s;
function backInOut(t) {
return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;
}
backInOut.overshoot = custom;
return backInOut;
})(overshoot);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/hooks/useModalAnimations.tsx
import { useEffect, useState, useRef, Dispatch, SetStateAction } from "react";
import { Animated, Platform } from "react-native";
import { easeBackOut, easeBackInOut } from "d3-ease";
import { ModalBaseProps, ModalCloseType } from "../types";
interface UseModalAnimationsProps
extends Pick<
ModalBaseProps,
"onBack" | "onAfterClose" | "onClose" | "onOverlayClick" | "type"
> {
isModalOpen: boolean;
setModalIsOpen: Dispatch<SetStateAction<boolean>>;
closeType: ModalCloseType;
setCloseType: Dispatch<SetStateAction<ModalCloseType>>;
}
const useNativeDriver = Platform.OS !== "web";
export const useModalAnimations = ({
isModalOpen,
setModalIsOpen,
onClose,
closeType,
setCloseType,
onBack,
onOverlayClick,
type,
onAfterClose
}: UseModalAnimationsProps) => {
const [isClosing, setIsClosing] = useState(false);
const [isAnimating, setIsAnimating] = useState(false);
const overlayOpacityAnimation = useRef(new Animated.Value(0)).current;
const contentOpacityAnimation = useRef(new Animated.Value(0)).current;
const lightboxContentAnimation = useRef(new Animated.Value(0.5)).current;
const lightboxScaleAnimation = useRef(new Animated.Value(0.5)).current;
const flexibleContentAnimation = useRef(new Animated.Value(0)).current;
const fullscreenContentAnimation = useRef(new Animated.Value(0)).current;
const fullWidthPageContentAnimation = useRef(new Animated.Value(0)).current;
const animationController = useRef<Animated.CompositeAnimation | null>(null);
const animationCallback = () => {
setIsAnimating(false);
animationController.current = null;
if (isClosing) {
setModalIsOpen(false);
setIsClosing(false);
if (typeof onAfterClose === "function") {
onAfterClose(closeType);
}
switch (closeType) {
case "onBack":
if (typeof onBack === "function") {
onBack();
}
break;
case "onClose":
if (typeof onClose === "function") {
onClose();
}
break;
case "onOverlayClick":
if (typeof onOverlayClick === "function") {
onOverlayClick();
}
break;
default:
}
setCloseType("none");
}
};
const getModalAnimation = (
contentSequence: Array<Animated.CompositeAnimation> = []
): Animated.CompositeAnimation => {
setIsAnimating(true);
animationController.current = Animated.sequence(
isClosing
? [
...contentSequence,
Animated.timing(overlayOpacityAnimation, {
toValue: isClosing ? 0 : 0.6,
duration: 300,
useNativeDriver
})
]
: [
Animated.timing(overlayOpacityAnimation, {
toValue: isClosing ? 0 : 0.6,
duration: 300,
useNativeDriver
}),
...contentSequence
]
);
animationController.current.start(animationCallback);
return animationController.current;
};
const getContentOpacityAnimation = ({
duration,
delay = 0
}: {
duration: number;
delay?: number;
}) =>
Animated.timing(contentOpacityAnimation, {
toValue: isClosing ? 0 : 1,
duration,
delay,
useNativeDriver
});
// handle open and close with animations
useEffect(() => {
if (animationController.current) {
animationController.current.stop();
}
if ((!isClosing && isModalOpen) || isClosing) {
switch (type) {
case "lightbox": {
getModalAnimation([
Animated.parallel([
getContentOpacityAnimation({ duration: isClosing ? 200 : 300 }),
Animated.timing(lightboxContentAnimation, {
toValue: isClosing ? 0.5 : 1,
duration: 300,
delay: isClosing ? 100 : 0,
useNativeDriver,
easing: easeBackOut?.overshoot(0.8)
}),
Animated.timing(lightboxScaleAnimation, {
toValue: isClosing ? 0 : 1,
duration: 300,
useNativeDriver,
easing: easeBackInOut
})
])
]);
break;
}
case "fullscreen": {
getModalAnimation([
Animated.parallel(
[
getContentOpacityAnimation({
duration: 250,
delay: isClosing ? 0 : 150
}),
Animated.timing(fullscreenContentAnimation, {
toValue: isClosing ? 0 : 1,
duration: isClosing ? 500 : 400,
useNativeDriver,
easing: easeBackInOut?.overshoot(0.8)
})
],
{ stopTogether: false }
)
]);
break;
}
case "modal-custom-height": {
getModalAnimation([
Animated.parallel(
[
Animated.timing(fullscreenContentAnimation, {
toValue: isClosing ? 0 : 1,
duration: isClosing ? 500 : 400,
useNativeDriver,
easing: easeBackInOut?.overshoot(0.8)
})
],
{ stopTogether: false }
)
]);
break;
}
case "flexible": {
getModalAnimation([
Animated.parallel([
getContentOpacityAnimation({ duration: 300 }),
Animated.timing(flexibleContentAnimation, {
toValue: isClosing ? 0 : 1,
duration: 300,
useNativeDriver,
easing: easeBackInOut
})
])
]);
break;
}
case "full-width-page": {
getModalAnimation([
Animated.parallel(
[
getContentOpacityAnimation({
duration: 250,
delay: isClosing ? 0 : 150
}),
Animated.timing(fullWidthPageContentAnimation, {
toValue: isClosing ? 0 : 1,
duration: isClosing ? 500 : 400,
useNativeDriver,
easing: easeBackInOut?.overshoot(0.8)
})
],
{ stopTogether: false }
)
]);
break;
}
default:
}
}
}, [isClosing, isModalOpen]);
return {
isAnimating,
isClosing,
setIsClosing,
overlayOpacityAnimation,
contentOpacityAnimation,
lightboxContentAnimation,
lightboxScaleAnimation,
flexibleContentAnimation,
fullscreenContentAnimation,
fullWidthPageContentAnimation
};
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/components/page/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { childrenSpacing } from "../../styled-components";
export const Page = styled(View)`
width: 100%;
position: absolute;
top: 0;
left: 0;
background-color: ${(props) => props.theme.colors.white[900]};
${childrenSpacing}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/context/modalPagesReducer.ts
import { State, ReducerActions, ReducerActionTypes } from "./types";
export const INITIAL_STATE: State = {
activePage: undefined,
totalPages: undefined,
nextPage: undefined,
pageHeight: 0,
isFlexible: false,
isAnimating: false,
isFirstRender: true
};
export const ACTIONS: ReducerActionTypes = {
INIT: "INIT",
SET_STATE: "SET_STATE",
START_ANIMATION: "START_ANIMATION",
START_CHANGE_PAGE: "START_CHANGE_PAGE",
END_CHANGE_PAGE: "END_CHANGE_PAGE"
};
export const modalPagesReducer = (
state: State = INITIAL_STATE,
action: ReducerActions
) => {
switch (action.type) {
case ACTIONS.INIT:
return {
...state,
totalPages: action.payload.totalPages
};
case ACTIONS.SET_STATE:
return {
...state,
...action.payload
};
case ACTIONS.START_ANIMATION:
return {
...state,
isAnimating: true
};
case ACTIONS.START_CHANGE_PAGE:
return {
...state,
nextPage: action.payload.nextPage
};
case ACTIONS.END_CHANGE_PAGE:
return {
...state,
isAnimating: false,
activePage: state.nextPage
};
default:
return state;
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/context/modalPagesContext.tsx
import { createContext, useContext, useReducer, useMemo } from "react";
import { Context, State } from "./types";
import { modalPagesReducer, INITIAL_STATE } from "./modalPagesReducer";
export const ModalPagesContext = createContext<Context>([
INITIAL_STATE,
() => {}
]);
ModalPagesContext.displayName = "ModalPagesContext";
export const useModalPagesReducer = (initialState?: Partial<State>) => {
const [state, dispatch] = useReducer(
modalPagesReducer,
{ ...INITIAL_STATE, ...initialState } ?? INITIAL_STATE
);
const context: Context = useMemo(() => [state, dispatch], [state, dispatch]);
return context;
};
export const useModalPagesContext = () => useContext(ModalPagesContext);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/components/page/index.tsx
import React, { useRef, useEffect, useCallback } from "react";
import {
Animated,
Platform,
Dimensions,
LayoutChangeEvent
} from "react-native";
import { easeBackInOut } from "d3-ease";
import { useQaLabel } from "../../../../hooks/useQaLabel";
import { ModalPageProps } from "./types";
import { Page } from "./styled-components";
import { useModalPagesContext } from "../../context/modalPagesContext";
import { ACTIONS } from "../../context/modalPagesReducer";
const useNativeDriver = Platform.OS !== "web";
type AnimationDirection = "IN" | "OUT";
const AnimatedPage = Animated.createAnimatedComponent(Page);
export const ModalPage = ({ children, page, qaLabel }: ModalPageProps) => {
const [{ activePage, nextPage, isAnimating }, dispatch] =
useModalPagesContext();
const viewTestProps = useQaLabel(qaLabel ?? "modalPage" + page);
const sideAnimation = useRef(
new Animated.Value(page === activePage ? 1 : 0)
).current;
const opacityAnimation = useRef(
new Animated.Value(page === activePage ? 1 : 0)
).current;
useEffect(() => {
// skip animation
if (
page === activePage ||
(nextPage && activePage && nextPage < activePage && page === nextPage)
) {
sideAnimation.setValue(1);
opacityAnimation.setValue(1);
}
// wait for animations to end until re-running
if (isAnimating || activePage === nextPage) return;
if (typeof page === "number" && page === nextPage) {
runChangePageAnimated("IN");
} else if (
typeof page === "number" &&
page === activePage &&
nextPage &&
page > nextPage
) {
runChangePageAnimated("OUT");
}
}, [activePage, nextPage, page]);
const runChangePageAnimated = useCallback((direction: AnimationDirection) => {
dispatch({ type: ACTIONS.START_ANIMATION });
const animatedConfig = {
toValue: direction === "IN" ? 1 : 0,
duration: 300,
useNativeDriver
};
Animated.parallel([
Animated.timing(sideAnimation, {
...animatedConfig,
easing: easeBackInOut?.overshoot(0.8)
}),
Animated.timing(opacityAnimation, animatedConfig)
]).start(() => {
dispatch({
type: ACTIONS.END_CHANGE_PAGE
});
});
}, []);
const handleLayoutChange = useCallback((event: LayoutChangeEvent) => {
dispatch({
type: ACTIONS.SET_STATE,
payload: {
pageHeight: event.nativeEvent.layout.height
}
});
}, []);
return page === activePage || page === nextPage ? (
<AnimatedPage
{...viewTestProps}
onLayout={handleLayoutChange}
style={{
opacity: opacityAnimation,
transform: [
{
translateX: sideAnimation.interpolate({
inputRange: [0, 1],
outputRange: [Dimensions.get("window").width / 2, 0]
})
}
]
}}
>
{children}
</AnimatedPage>
) : null;
};
export type { ModalPageProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/components/pageContainer/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { PageHeight } from "../../context/types";
export const StyledView = styled(View)<PageHeight>`
background-color: ${(props) => props.theme.colors.white[900]};
width: 100%;
height: ${({ isFlexible, pageHeight }) => (isFlexible ? pageHeight : "100%")};
top: 0;
left: 0;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/index.tsx
import React, {
useState,
useLayoutEffect,
useEffect,
useMemo,
isValidElement,
forwardRef,
useRef
} from "react";
import {
View,
Animated,
LayoutRectangle,
Platform,
NativeSyntheticEvent,
NativeScrollEvent,
ScrollView,
KeyboardAvoidingView,
StyleSheet,
LayoutChangeEvent
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { useQaLabel } from "../../hooks/useQaLabel";
import { useTvgConfContext } from "../../utils/tvgConfProvider";
import {
ModalProps,
ModalCloseType,
ModalType,
ModalCompoundComponent
} from "./types";
import { ModalHeader, PageHeader } from "../headers";
import {
StyledModal,
OverlayContainer,
ContentContainerFullscreen,
ContentContainerLightbox,
ContentInnerLightbox,
ContentContainerFlexible,
ContentInnerFlexible,
ContentContainerFullWidthPage,
ChildrenContainer,
TouchableContainer,
TouchableOverlayContainer,
StickyAreaContainer,
LIGHTBOX_MARGIN_SIDE,
INSET_VERTICAL,
INSET_BOTTOM,
TopStickyAreaContainer,
ContentContainerCustomHeight
} from "./styled-components";
import { getAccessibilityRole } from "../../utils/accessibility";
import { useWebKeyPress } from "../../hooks";
import { useModalAnimations } from "./hooks/useModalAnimations";
import { useScreenSize } from "./hooks/useScreenSize";
import { ModalPage, ModalPageContainer } from "./components";
import {
useModalPagesReducer,
ModalPagesContext
} from "./context/modalPagesContext";
import { Fading } from "../scrollViewFading/fading";
const AnimatedOverlayContainer =
Animated.createAnimatedComponent(OverlayContainer);
const AnimatedContentContainerFullscreen = Animated.createAnimatedComponent(
ContentContainerFullscreen
);
const AnimatedContentContainerCustomHeight = Animated.createAnimatedComponent(
ContentContainerCustomHeight
);
const AnimatedContentContainerLightbox = Animated.createAnimatedComponent(
ContentContainerLightbox
);
const AnimatedContentContainerFlexible = Animated.createAnimatedComponent(
ContentContainerFlexible
);
const AnimatedContentContainerFullWidth = Animated.createAnimatedComponent(
ContentContainerFullWidthPage
);
const isNative = Platform.OS !== "web";
const getPageHeight = ({
type,
height,
headerHeight = 0,
childrenHeight = 0,
modalHeight = 0
}: {
type: ModalType;
height: number;
headerHeight?: number;
childrenHeight?: number;
modalHeight?: number;
}) => {
switch (type) {
case "fullscreen":
return height - INSET_VERTICAL - headerHeight - LIGHTBOX_MARGIN_SIDE;
case "full-width-page":
return height - INSET_VERTICAL - headerHeight;
case "modal-custom-height":
return modalHeight;
default:
return childrenHeight;
}
};
export const modalTypesWithFade = ["full-width-page", "flexible", "fullscreen"];
const styles = StyleSheet.create({
keyboardView: {
flex: 1
}
});
export const Modal = forwardRef<View, ModalProps>(
(
{
type = "lightbox",
children,
isOpen: isOpenFromProps = true,
onOpen,
onClose,
onBack,
onOverlayClick,
onAfterClose,
onAfterOpen,
qaLabel = "modal-label",
topStickyArea,
stickyArea,
alwaysBounceVertical = true,
shouldCloseOnEsc = true,
maxWidth,
isDarkMode = false,
titlePosition = "center",
isTrackRulesModal = false,
maxHeight,
onScroll,
onRender,
hasBackgroundModal = false,
hasHeader = true,
topPosition,
hideBack,
...modalHeaderProps
},
ref
) => {
const [isModalOpen, setModalIsOpen] = useState(isOpenFromProps);
const [closeType, setCloseType] = useState<ModalCloseType>("none");
// handle open and close with animations per type
const {
isAnimating,
isClosing,
setIsClosing,
contentOpacityAnimation,
overlayOpacityAnimation,
lightboxContentAnimation,
lightboxScaleAnimation,
flexibleContentAnimation,
fullscreenContentAnimation,
fullWidthPageContentAnimation
} = useModalAnimations({
isModalOpen,
setModalIsOpen,
onClose,
closeType,
setCloseType,
onBack,
onOverlayClick,
type,
onAfterClose
});
useEffect(() => {
if (
typeof onAfterOpen === "function" &&
!isAnimating &&
isOpenFromProps &&
isModalOpen
) {
onAfterOpen();
}
}, [isAnimating]);
const { height, width } = useScreenSize();
const [childrenLayout, setChildrenLayout] = useState<
Partial<LayoutRectangle>
>({});
const [headerLayout, setHeaderLayout] = useState<Partial<LayoutRectangle>>(
{}
);
const [stickyAreaLayout, setStickyAreaLayout] = useState<
Partial<LayoutRectangle>
>({});
const [customModalLayout, setCustomModalLayout] = useState<
Partial<LayoutRectangle>
>({});
const [topStickyAreaLayout, setTopStickyAreaLayout] = useState<
Partial<LayoutRectangle>
>({});
const [isScrolling, setIsScrolling] = useState(false);
const { device } = useTvgConfContext();
const isMobile = device === "mobile";
const isEscPressed = useWebKeyPress("Escape");
const viewTestProps = useQaLabel(qaLabel);
const modalViewTestProps = useQaLabel(`${qaLabel}-safe-area`);
const overlayTestProps = useQaLabel("overlay");
const stickyAreaTestProps = useQaLabel("sticky-area");
const topStickyAreaTestProps = useQaLabel("sticky-area");
const [state, dispatch] = useModalPagesReducer({
isFlexible: type === "flexible" || type === "lightbox"
});
const scrollRef = useRef<ScrollView | null>(null);
const hasPages = useMemo(
() =>
isValidElement(children) &&
(children as JSX.Element)?.type.name === "ModalPageContainer",
[children, type]
);
// set initial render before animation
useLayoutEffect(
() => () => {
setModalIsOpen(false);
},
[]
);
useEffect(() => {
if (onRender) {
onRender({ scrollRef });
}
}, [scrollRef.current]);
// close on escape press
useEffect(() => {
if (shouldCloseOnEsc && isModalOpen && !isClosing && isEscPressed) {
setIsClosing(true);
onClose?.();
}
}, [isEscPressed]);
// Prevents background from scrolling while modal is opened
useEffect(() => {
if (!isNative && isModalOpen) {
document.body.style.overflow = "hidden";
}
return () => {
if (!isNative && !hasBackgroundModal) {
document.body.style.overflow = "initial";
}
};
}, [isModalOpen]);
// handle initial open/close animation from isOpen prop
useEffect(() => {
if (isOpenFromProps) {
// open up modal with animation
setModalIsOpen(true);
// if open is false from props but the state is open, begin closing animation
} else if (isModalOpen) {
setIsClosing(true);
}
if (isOpenFromProps && typeof onOpen === "function") {
onOpen();
}
}, [isOpenFromProps]);
// set is scrolling for header shadow
const handleOnScroll = (e: NativeSyntheticEvent<NativeScrollEvent>) => {
const {
contentOffset: { y }
} = e.nativeEvent;
setIsScrolling(y > 0);
if (typeof onScroll === "function") {
onScroll({
ref: scrollRef.current,
event: e
});
}
};
// scroll to top on page change
useEffect(() => {
if (hasPages && state.nextPage === state.activePage) {
scrollRef.current?.scrollTo({ y: 0, animated: true });
}
}, [hasPages, state.nextPage, state.activePage]);
// height of header and children
const childrenHeight =
typeof childrenLayout?.height === "number"
? childrenLayout.height + 1
: undefined;
const stickyAreaLayoutHeight =
React.isValidElement(stickyArea) &&
typeof stickyAreaLayout?.height === "number"
? stickyAreaLayout.height
: 0;
const topStickyAreaLayoutHeight =
React.isValidElement(topStickyArea) &&
typeof topStickyAreaLayout?.height === "number"
? topStickyAreaLayout.height
: 0;
const childrenWithStickyHeight = childrenHeight
? stickyAreaLayoutHeight + topStickyAreaLayoutHeight + childrenHeight
: childrenHeight;
const contentHeight =
typeof headerLayout?.height === "number" &&
typeof childrenWithStickyHeight === "number"
? headerLayout.height + childrenWithStickyHeight
: undefined;
const pageHeight = useMemo(
() =>
getPageHeight({
type,
height,
headerHeight: headerLayout?.height,
childrenHeight: childrenWithStickyHeight,
modalHeight: customModalLayout?.height
}),
[childrenWithStickyHeight, height, headerLayout, customModalLayout]
);
const renderOverlay = () => (
<TouchableOverlayContainer
onPress={() => {
if (!isAnimating) {
setIsClosing(true);
setCloseType("onOverlayClick");
onClose?.();
}
}}
>
<TouchableContainer
style={{
height,
width
}}
{...overlayTestProps}
/>
</TouchableOverlayContainer>
);
const showBack =
(typeof onBack === "function" ||
(state.activePage && state.activePage > 1)) &&
!hideBack;
const handleOnClose = () => {
setCloseType("onClose");
setIsClosing(true);
};
const renderContent = () => (
<>
<View
onLayout={(event) => setHeaderLayout(event?.nativeEvent?.layout)}
ref={ref}
>
{
// render header depending on type
type === "full-width-page" ? (
<PageHeader
{...modalHeaderProps}
{...(showBack
? {
onBack: () => {
setCloseType("onBack");
setIsClosing(true);
}
}
: {})}
hasShadow={isScrolling}
qaLabel="pageHeader"
titlePosition={titlePosition}
isTrackRulesModal={isTrackRulesModal}
/>
) : (
hasHeader && (
<ModalHeader
{...modalHeaderProps}
onClose={handleOnClose}
{...(showBack
? {
onBack: () => {
setCloseType("onBack");
setIsClosing(false);
if (onBack) onBack();
}
}
: {})}
hasRoundedCorners
hasShadow={isScrolling}
isDarkMode={isDarkMode}
qaLabel="modalHeader"
titlePosition={titlePosition}
isTrackRulesModal={isTrackRulesModal}
/>
)
)
}
</View>
{React.isValidElement(topStickyArea) && (
<TopStickyAreaContainer
isScrolling={isScrolling}
type={type}
onLayout={(event) =>
setTopStickyAreaLayout(event?.nativeEvent?.layout)
}
{...topStickyAreaTestProps}
>
{topStickyArea}
</TopStickyAreaContainer>
)}
<ScrollView
onScroll={handleOnScroll}
scrollEventThrottle={500}
alwaysBounceVertical={alwaysBounceVertical}
ref={scrollRef}
>
<ChildrenContainer
hasPages={hasPages}
pageHeight={pageHeight}
isMobile={isMobile}
type={type}
isDarkMode={isDarkMode}
onLayout={(event) => setChildrenLayout(event?.nativeEvent?.layout)}
{...modalHeaderProps}
>
<ModalPagesContext.Provider value={[state, dispatch]}>
{children}
</ModalPagesContext.Provider>
</ChildrenContainer>
</ScrollView>
{modalTypesWithFade.includes(type) && isMobile && hasHeader && (
<Fading
position="bottom"
height="10px"
width="100%"
viewBox="0 0 10 45"
preserveAspectRatio="none"
isVisible
gradientPosition={{
x1: 24,
y1: 44,
x2: 24,
y2: 0
}}
qaLabel="fading-effect"
/>
)}
{React.isValidElement(stickyArea) && (
<StickyAreaContainer
isMobile={isMobile}
type={type}
onLayout={(event) =>
setStickyAreaLayout(event?.nativeEvent?.layout)
}
{...stickyAreaTestProps}
>
{stickyArea}
</StickyAreaContainer>
)}
</>
);
// render container dependending on modal type
const renderContainer = () => {
switch (type) {
case "fullscreen": {
return (
<AnimatedContentContainerFullscreen
topPosition={topPosition}
style={{
height: hasHeader ? height - LIGHTBOX_MARGIN_SIDE : height,
opacity: contentOpacityAnimation,
transform: [
{
translateY: fullscreenContentAnimation.interpolate({
inputRange: [0, 1],
outputRange: ["100%", "0%"]
})
}
]
}}
>
{renderOverlay()}
<KeyboardAvoidingView
behavior="height"
keyboardVerticalOffset={INSET_VERTICAL}
style={styles.keyboardView}
{...viewTestProps}
>
{renderContent()}
</KeyboardAvoidingView>
</AnimatedContentContainerFullscreen>
);
}
case "modal-custom-height": {
return (
<AnimatedContentContainerCustomHeight
style={{
height: height - LIGHTBOX_MARGIN_SIDE,
transform: [
{
translateY: fullscreenContentAnimation.interpolate({
inputRange: [0, 1],
outputRange: ["100%", "0%"]
})
}
]
}}
maxHeight={maxHeight}
onLayout={(event: LayoutChangeEvent) =>
setCustomModalLayout(event?.nativeEvent?.layout)
}
>
{renderOverlay()}
<KeyboardAvoidingView
behavior="height"
keyboardVerticalOffset={INSET_VERTICAL}
style={styles.keyboardView}
{...viewTestProps}
>
{renderContent()}
</KeyboardAvoidingView>
</AnimatedContentContainerCustomHeight>
);
}
case "lightbox": {
return (
<AnimatedContentContainerLightbox
width={width}
height={height}
contentHeight={contentHeight || 0}
isNative={isNative}
style={{
opacity: contentOpacityAnimation,
transform: [
{
translateY: lightboxContentAnimation.interpolate({
inputRange: [0, 1],
outputRange: [50, 0]
})
},
{
scale: lightboxScaleAnimation.interpolate({
inputRange: [0.5, 1],
outputRange: [0.5, 1]
})
}
]
}}
>
{renderOverlay()}
<ContentInnerLightbox
height={height}
contentHeight={contentHeight}
isNative={isNative}
isMobile={isMobile}
maxWidth={maxWidth}
>
<KeyboardAvoidingView
behavior="height"
keyboardVerticalOffset={INSET_VERTICAL}
style={styles.keyboardView}
{...viewTestProps}
>
{renderContent()}
</KeyboardAvoidingView>
</ContentInnerLightbox>
</AnimatedContentContainerLightbox>
);
}
case "flexible": {
return (
<KeyboardAvoidingView
behavior="height"
keyboardVerticalOffset={-INSET_BOTTOM}
style={styles.keyboardView}
>
<AnimatedContentContainerFlexible
contentHeight={contentHeight || 0}
height={height}
style={{
opacity: contentOpacityAnimation,
transform: [
{
translateY: flexibleContentAnimation.interpolate({
inputRange: [0, 1],
outputRange: ["100%", "0%"]
})
}
]
}}
>
{renderOverlay()}
<ContentInnerFlexible {...viewTestProps}>
{renderContent()}
</ContentInnerFlexible>
</AnimatedContentContainerFlexible>
</KeyboardAvoidingView>
);
}
case "full-width-page": {
return (
<KeyboardAvoidingView
behavior="height"
keyboardVerticalOffset={-INSET_BOTTOM}
style={styles.keyboardView}
>
<AnimatedContentContainerFullWidth
style={{
opacity: contentOpacityAnimation,
transform: [
{
translateX: fullWidthPageContentAnimation.interpolate({
inputRange: [0, 1],
outputRange: ["100%", "0%"]
})
}
]
}}
{...viewTestProps}
>
{renderContent()}
</AnimatedContentContainerFullWidth>
</KeyboardAvoidingView>
);
}
default:
}
return null;
};
return (
<StyledModal
visible={isModalOpen}
onDismiss={() => {
if (isModalOpen && !isClosing) {
setIsClosing(true);
}
}}
presentationStyle="overFullScreen"
animationType="none"
transparent
// accessibility props
accessibilityRole={getAccessibilityRole("dialog")}
{...(!isNative
? {
"aria-modal": true
}
: {})}
{...viewTestProps}
>
<AnimatedOverlayContainer
type={type}
style={
type !== "modal-custom-height"
? {
opacity: overlayOpacityAnimation
}
: undefined
}
/>
<SafeAreaView>
<View
style={{
height,
width
}}
{...modalViewTestProps}
>
{renderOverlay()}
{renderContainer()}
</View>
</SafeAreaView>
</StyledModal>
);
}
) as ModalCompoundComponent<typeof ModalPageContainer, typeof ModalPage>;
Modal.PageGroup = ModalPageContainer;
Modal.Page = ModalPage;
export default Modal;
export type { ModalProps, ModalType };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/hooks/useScreenSize.ts
import { useEffect, useState } from "react";
import { useWindowDimensions, Platform } from "react-native";
interface ScreenInfo {
width: number;
height: number;
}
export const useScreenSize = (): ScreenInfo => {
const [screenInfo, setScreenInfo] = useState<ScreenInfo>(
useWindowDimensions()
);
useEffect(() => {
const isNative = Platform.OS !== "web";
if (!isNative && typeof window !== undefined) {
setScreenInfo({ height: window.innerHeight, width: window.innerWidth });
}
}, []);
return screenInfo;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/hooks/useWebKeyPress.ts
/*
Used to check if a key is being pressed or not on the web.
Usage:
const escPress = useWebKeyPress("Escape");
*/
import { useState, useEffect } from "react";
import { Platform } from "react-native";
export function useWebKeyPress(targetKey: string): boolean {
if (
// only work in browser
Platform.OS !== "web"
) {
return false;
}
const [keyPressed, setKeyPressed] = useState(false);
function downHandler({ key }: { key: string }): void {
if (key === targetKey) {
setKeyPressed(true);
}
}
const upHandler = ({ key }: { key: string }): void => {
if (key === targetKey) {
setKeyPressed(false);
}
};
// Add event listeners
// eslint-disable-next-line consistent-return
useEffect(() => {
if (document) {
document.addEventListener("keydown", downHandler);
document.addEventListener("keyup", upHandler);
// Remove event listeners on cleanup
return () => {
document.removeEventListener("keydown", downHandler);
document.removeEventListener("keyup", upHandler);
};
}
}, []);
return keyPressed;
}
export default useWebKeyPress;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/components/pageContainer/index.tsx
import React, { useEffect } from "react";
import { useQaLabel } from "../../../../hooks/useQaLabel";
import { useFirstRender } from "../../hooks/useFirstRender";
import { ModalPageContainerProps } from "./types";
import { StyledView } from "./styled-components";
import { useModalPagesContext } from "../../context/modalPagesContext";
export const ModalPageContainer = ({
children,
page: pageFromProps
}: ModalPageContainerProps) => {
const isFirstRender = useFirstRender();
const [
{ totalPages, activePage, nextPage, pageHeight, isFlexible },
dispatch
] = useModalPagesContext();
const viewTestProps = useQaLabel("modalContainer");
const renderPages = () =>
children.map((pageElement, index) =>
// eslint-disable-next-line react/no-array-index-key
React.cloneElement(pageElement, { page: index + 1, key: index + 1 })
);
useEffect(() => {
dispatch({
type: "INIT",
payload: {
totalPages: React.Children.count(children)
}
});
}, [children]);
useEffect(() => {
dispatch({
type: "SET_STATE",
payload: {
// set page without animation
activePage:
isFirstRender && pageFromProps ? pageFromProps : activePage || 1,
isFirstRender
}
});
// handle animations
if (
pageFromProps &&
totalPages &&
pageFromProps <= totalPages &&
(pageFromProps !== activePage || pageFromProps !== nextPage)
) {
dispatch({
type: "START_CHANGE_PAGE",
payload: {
nextPage: pageFromProps
}
});
}
}, [pageFromProps, isFirstRender, totalPages]);
return (
<StyledView
{...viewTestProps}
pageHeight={pageHeight}
isFlexible={isFlexible}
>
{renderPages()}
</StyledView>
);
};
export { ModalPageContainerProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/modal/hooks/useFirstRender.tsx
import { useRef, useEffect } from "react";
export const useFirstRender = () => {
const firstRender = useRef(true);
useEffect(() => {
firstRender.current = false;
}, []);
return firstRender.current;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/mtp/styled-components.ts
import styled, { css } from "styled-components/native";
import { Text } from "react-native";
import {
space,
compose,
typography,
system,
color
} from "../../theming/styledSystem";
import { MtpProps } from "./types";
const transformText = system({
whiteSpace: {
property: "whiteSpace"
}
});
const styledComponentUtils = compose(space, color, typography, transformText);
const baseTextStyle = css<Pick<MtpProps, "isCollapsed">>`
font-size: ${({ theme, isCollapsed }) =>
theme.fontSizes[isCollapsed ? "s" : "3xl"]};
line-height: ${({ theme, isCollapsed }) =>
theme.lineHeights[isCollapsed ? "s" : "3xl"]};
${typography};
`;
export const RaceOff = styled(Text)<
Pick<MtpProps, "isCollapsed" | "hasFullText">
>`
color: ${({ theme }) => theme.colorTokens.lhnHeader.content.positive};
font-weight: ${({ theme, isCollapsed, hasFullText }) =>
theme.fontWeights[isCollapsed && !hasFullText ? "normal" : "bold"]};
${baseTextStyle};
${styledComponentUtils};
`;
export const Resulted = styled(Text)<
Pick<MtpProps, "isCollapsed" | "hasFullText"> & { defaultColor: string }
>`
color: ${({ defaultColor }) => defaultColor};
font-weight: ${({ theme, isCollapsed, hasFullText }) =>
theme.fontWeights[isCollapsed && !hasFullText ? "normal" : "bold"]};
${baseTextStyle};
${styledComponentUtils};
`;
export const RaceTime = styled(Text)<
Pick<MtpProps, "isCollapsed" | "hasFullText"> & { defaultColor: string }
>`
color: ${({ defaultColor }) => defaultColor};
${({ theme, isCollapsed, hasFullText }) => {
if (isCollapsed) {
return css`
${!hasFullText &&
css`
width: min-content;
text-align: center;
`};
font-size: ${theme.fontSizes.s};
`;
}
return css`
font-size: ${theme.fontSizes["3xl"]};
`;
}}
font-weight: ${({ theme, hasFullText }) =>
hasFullText ? theme.fontWeights.bold : theme.fontWeights.normal};
line-height: ${({ theme, isCollapsed }) =>
theme.lineHeights[isCollapsed ? "s" : "3xl"]};
${styledComponentUtils};
`;
export const MinutesText = styled(Text)<
Pick<MtpProps, "mtp" | "isCollapsed"> & { defaultColor: string }
>`
color: ${({ theme, mtp, defaultColor }) =>
mtp > 5 ? defaultColor : theme.colorTokens.lhnHeader.content.negative};
font-weight: ${({ theme }) => theme.fontWeights.bold};
${baseTextStyle};
${styledComponentUtils};
`;
export const TextDescription = styled(Text)<
Pick<MtpProps, "mtp"> & { defaultColor: string }
>`
color: ${({ theme, mtp, defaultColor }) =>
mtp > 5 ? defaultColor : theme.colorTokens.lhnHeader.content.negative};
font-family: ${({ theme }) => theme.fonts.condensedRegular};
font-size: ${({ theme }) => theme.fontSizes.m};
line-height: 16px;
margin-bottom: 5px;
text-transform: uppercase;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/mtpCell/styled-components.ts
import styled, { css } from "styled-components/native";
import { margin } from "styled-system";
import { View } from "react-native";
import { MtpCellProps } from "./types";
export const Container = styled(View)<
Pick<MtpCellProps, "withBackground" | "align"> & {
bgColor: string;
lineColor: string;
}
>`
background-color: ${({ withBackground, bgColor }) =>
withBackground ? bgColor : "transparent"};
border-style: solid;
border-top-left-radius: 4px;
display: flex;
flex-direction: column;
height: 60px;
max-width: 102px;
width: max-content;
padding: 10px 11px 10px 12px;
${({ align, lineColor, withBackground }) =>
align === "left"
? css`
border-right-color: ${lineColor};
border-right-width: ${withBackground ? "1px" : 0};
`
: css`
border-left-color: ${lineColor};
border-left-width: ${withBackground ? "1px" : 0};
`};
${margin}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/pebble/pebbleGroup/styled-components.ts
import styled from "styled-components/native";
import { margin } from "styled-system";
export const StyledViewContainer = styled.View`
${margin}
flex-direction: row;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/pebble/pebbleGroup/index.tsx
import React, { createContext, forwardRef } from "react";
import { View } from "react-native";
import { useQaLabel } from "../../../hooks/useQaLabel";
import { PebbleGroupProps, PebbleGroupContextProps } from "./types";
import { StyledViewContainer } from "./styled-components";
const initialState = { selectedValue: "", onChange: () => {} };
export const GroupContext =
createContext<PebbleGroupContextProps>(initialState);
export const PebbleGroup = forwardRef<View, PebbleGroupProps>(
({ children, selectedValue, onChange, qaLabel, ...rest }, ref) => {
const viewTestProps = useQaLabel(qaLabel);
return (
// @ts-ignore
<StyledViewContainer ref={ref} {...rest} {...viewTestProps}>
<GroupContext.Provider value={{ selectedValue, onChange }}>
{children}
</GroupContext.Provider>
</StyledViewContainer>
);
}
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/pebble/styled-components.ts
import styled from "styled-components/native";
import { margin, compose, variant } from "styled-system";
import { rgba } from "polished";
import { TouchableHighlight, View, Text } from "react-native";
import { RefAttributes } from "react";
import { Icon } from "../icon";
import {
StatesProps,
TransientStatesProps,
StyledStatesProps,
Theme
} from "./types";
export const colorStates = {
prop: "state",
variants: {
normal: {
backgroundColor: "blue_accent.000",
color: "grey.800",
borderColor: "blue.100"
},
hovered: {
backgroundColor: "blue_accent.100",
color: "blue_accent.600",
borderColor: "blue_accent.500"
},
pressed: {
backgroundColor: "blue_accent.200",
color: "blue_accent.600",
borderColor: "blue_accent.500",
boxShadow: "none"
}
}
};
export const stylesColorStates = compose(variant(colorStates));
const getState = (
isHovered: boolean,
isPressed: boolean,
isSelected: boolean
) => {
if (isPressed) return "pressed";
if (isHovered || isSelected) return "hovered";
return "normal";
};
const getColorIconCircle = (
isHovered: boolean,
isPressed: boolean,
isSelected: boolean,
theme: Theme
) => {
if (isPressed) return theme?.colors.blue_accent[300];
if (isHovered || isSelected) return theme?.colors.blue_accent[200];
return theme?.colors.blue_accent[100];
};
const getColorIconLine = (
isHovered: boolean,
isPressed: boolean,
isSelected: boolean,
theme: Theme
) => {
if (isPressed) return theme?.colors.blue_accent[600];
if (isHovered || isSelected) return theme?.colors.blue_accent[600];
return theme?.colors.blue[400];
};
export const StyledViewTagContainer = styled(View)`
position: absolute;
top: -9px;
right: -9px;
`;
export const StyledTouchableHighlight = styled(
TouchableHighlight
).attrs<StatesProps>(({ isHovered, isPressed, isSelected }) => ({
state: getState(isHovered, isPressed, isSelected)
}))<StyledStatesProps & RefAttributes<typeof TouchableHighlight>>`
${margin}
`;
export const StyledViewContainer = styled(View).attrs<StatesProps>(
({ isHovered, isPressed, isSelected }) => ({
state: getState(isHovered, isPressed, isSelected)
})
)<StyledStatesProps>`
${margin};
border-width: 1px;
${({ theme, isHovered, isSelected }) =>
(isHovered || isSelected
? "box-shadow: 0 2px 4px "
: "box-shadow: 0 1px 3px ") +
rgba(theme.colors.blue[900], isHovered || isSelected ? 0.18 : 0.12)};
width: 104px;
border-radius: ${({ theme }) => theme.radii.s};
padding: ${({ theme }) => theme.space["space-4"]};
align-items: center;
${stylesColorStates}
`;
export const StyledViewIconCircle = styled(View)<StatesProps>`
background-color: ${({ theme, isHovered, isPressed, isSelected }) =>
getColorIconCircle(isHovered, isPressed, isSelected, theme)};
width: 40px;
height: 40px;
border-radius: 99px;
align-items: center;
justify-content: center;
margin-bottom: ${({ theme }) => theme.space["space-4"]};
`;
// transient props here avoid error on svg because the camel case prop names
// https://styled-components.com/docs/api (Styled System 5.1)
export const StyledIcon = styled(Icon).attrs<TransientStatesProps>(
({ theme, $isHovered, $isPressed, $isSelected }) => ({
lineColor: getColorIconLine($isHovered, $isPressed, $isSelected, theme),
backgroundColor: "transparent"
})
)<TransientStatesProps>``;
export const StyledTextTitle = styled(Text).attrs<StatesProps>(
({ isHovered, isPressed, isSelected }) => ({
state: getState(isHovered, isPressed, isSelected)
})
)`
font-family: ${({ theme }) => theme.fonts.medium};
font-size: ${({ theme }) => theme.fontSizes.s};
margin-bottom: ${({ theme }) => theme.space["space-2"]};
${stylesColorStates}
`;
export const StyledTextDescription = styled(Text).attrs<StatesProps>(
({ isHovered, isPressed, isSelected }) => ({
state: getState(isHovered, isPressed, isSelected)
})
)<StatesProps>`
font-family: ${({ theme }) => theme.fonts.regular};
font-size: ${({ theme }) => theme.fontSizes.s};
color: ${({ theme }) => theme.colors.grey[800]};
${stylesColorStates}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/pebble/index.tsx
import React, { useContext, useEffect, forwardRef } from "react";
import { TouchableHighlight } from "react-native";
import { useQaLabel } from "../../hooks/useQaLabel";
import { type PebbleProps, PebbleCompoundComponent } from "./types";
import { Tag } from "../tag";
import { PebbleGroup, GroupContext } from "./pebbleGroup";
import { useEvents } from "../../hooks/useEvents";
import {
StyledViewTagContainer,
StyledTouchableHighlight,
StyledViewContainer,
StyledViewIconCircle,
StyledIcon,
StyledTextTitle,
StyledTextDescription
} from "./styled-components";
export const Pebble = forwardRef<typeof TouchableHighlight, PebbleProps>(
(
{
iconName,
title,
description,
tag,
isSelected = false,
qaLabel,
value,
...rest
},
ref
) => {
const viewTestProps = useQaLabel(qaLabel);
const { events, setEvents, eventsHandlers } = useEvents({});
const { selectedValue, onChange = () => {} } = useContext(GroupContext);
useEffect(() => {
setEvents({ ...events, isSelected });
}, [isSelected]);
useEffect(() => {
setEvents({
...events,
isSelected: isSelected || selectedValue === value
});
}, [selectedValue]);
const pressHandler = () => {
onChange(value);
};
const RenderTag = () => (
<StyledViewTagContainer {...events}>
{typeof tag === "string" ? (
<Tag label={tag} variant="promo" size="s" />
) : (
tag
)}
</StyledViewTagContainer>
);
return (
<StyledTouchableHighlight
// @ts-ignore
ref={ref}
{...rest}
{...viewTestProps}
{...eventsHandlers}
{...events}
onPress={pressHandler}
accessibilityRole="button"
underlayColor="none"
onLongPress={pressHandler}
>
<StyledViewContainer {...events}>
{!!tag && <RenderTag />}
<StyledViewIconCircle {...events}>
<StyledIcon
name={iconName}
size="m"
$isHovered={events.isHovered}
$isPressed={events.isPressed}
$isSelected={events.isSelected}
/>
</StyledViewIconCircle>
<StyledTextTitle {...events}>{title}</StyledTextTitle>
{description && (
<StyledTextDescription {...events}>
{description}
</StyledTextDescription>
)}
</StyledViewContainer>
</StyledTouchableHighlight>
);
}
) as PebbleCompoundComponent<typeof PebbleGroup>;
export type { PebbleProps };
Pebble.Group = PebbleGroup;
export default Pebble;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/progressBar/styled-components.ts
import styled from "styled-components/native";
import { space, width } from "styled-system";
import { View } from "react-native";
export const StyledContainer = styled(View)`
width: auto;
flex-direction: row;
${width}
${space}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/progressBar/context/index.ts
import { createContext } from "react";
import { PBContextProps } from "../types";
const initialState: PBContextProps = {
completedSteps: 0
};
export const PBContext = createContext<PBContextProps>(initialState);
PBContext.displayName = "PBContext";
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/progressBar/components/styles.ts
import { compose, variant } from "../../../theming/styledSystem";
export const stylesStepBarUncompleted = compose(
variant({
prop: "variant",
variants: {
dark: {
backgroundColor: "blue.400"
},
light: {
backgroundColor: "blue.100"
}
}
})
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/progressBar/components/step/styled-components.ts
import styled, { css } from "styled-components/native";
import { View, Text } from "react-native";
import {
compose,
variant,
space,
SpaceProps
} from "../../../../theming/styledSystem";
import { stylesStepBarUncompleted } from "../styles";
import { ProgressBarVariant } from "../../types";
export const stylesStepBarDescription = compose(
variant({
prop: "variant",
variants: {
dark: {
color: "white.900"
},
light: {
color: "grey.900"
}
}
})
);
export const StyledStepBarContainer = styled(View)`
flex: 1;
`;
export const StyledStepBar = styled(View)<{
isCompleted?: boolean;
variant: ProgressBarVariant;
}>`
height: 4px;
${({ theme, isCompleted }) =>
isCompleted
? css`
background-color: ${theme.colors.green[500]};
`
: stylesStepBarUncompleted}
`;
export const StyledStepBarDescription = styled(Text)<
{
variant: ProgressBarVariant;
} & SpaceProps
>`
text-align: center;
${space}
${stylesStepBarDescription}
${({ theme }) => css`
font-family: ${theme.fonts.regular};
font-size: ${theme.fontSizes.xs};
font-weight: ${theme.fontWeights.normal};
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/progressBar/components/step/index.tsx
import React, { forwardRef, useContext } from "react";
import { View } from "react-native";
import { useQaLabel } from "../../../../hooks/useQaLabel";
import { ProgressBarStepProps } from "../../types";
import { PBContext } from "../../context";
import {
StyledStepBarContainer,
StyledStepBar,
StyledStepBarDescription
} from "./styled-components";
export const ProgressBarStep = forwardRef<View, ProgressBarStepProps>(
(
{
qaLabel = "progress-bar-step",
stepNumber = 1,
stepDescription = null,
isDarkMode = false,
...rest
},
ref
) => {
const viewTestProps = useQaLabel(qaLabel);
const { completedSteps } = useContext(PBContext);
return (
<StyledStepBarContainer ref={ref} {...rest} {...viewTestProps}>
<StyledStepBar
variant={isDarkMode ? "dark" : "light"}
isCompleted={stepNumber <= completedSteps}
/>
{stepDescription ? (
<StyledStepBarDescription
variant={isDarkMode ? "dark" : "light"}
mt="space-1"
>
{stepDescription}
</StyledStepBarDescription>
) : null}
</StyledStepBarContainer>
);
}
);
export default ProgressBarStep;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/progressBar/components/achievementStep/styles.ts
import styled, { css } from "styled-components/native";
import { compose, variant } from "../../../../theming/styledSystem";
import { stylesStepBarUncompleted } from "../styles";
import { ProgressBarVariant } from "../../types";
import { Theme } from "../../../../theming/types";
const stylesStepBarUncompletedText = compose(
variant({
prop: "variant",
variants: {
dark: {
color: "blue.800"
},
light: {
color: "blue.300"
}
}
})
);
export const StyledAchievementStepContainer = styled.View<{
isCompleted?: boolean;
variant: ProgressBarVariant;
isMobile: boolean;
theme: Theme;
}>`
display: flex;
height: ${({ isMobile }) => (isMobile ? "24px" : "32px")};
width: ${({ isMobile }) => (isMobile ? "24px" : "32px")};
border-radius: ${({ isMobile }) => (isMobile ? "24px" : "32px")};
justify-content: center;
align-items: center;
margin-left: 1px;
${({ theme, isCompleted }) =>
isCompleted
? css`
background-color: ${theme.colors.green[500]};
color: ${theme.colors.white[900]};
`
: css`
background-color: ${theme.colors.blue[100]};
${stylesStepBarUncompleted}
`}
`;
export const StyledAchievementStepText = styled.Text<{
isCompleted?: boolean;
variant: ProgressBarVariant;
isMobile: boolean;
theme: Theme;
children?: React.ReactNode;
}>`
${({ theme, isMobile }) => css`
font-family: ${theme.fonts.regular};
font-size: ${isMobile ? theme.fontSizes.s : theme.fontSizes.l};
font-weight: ${theme.fontWeights.bold};
`}
${({ theme, isCompleted }) =>
isCompleted
? css`
color: ${theme.colors.white[900]};
`
: stylesStepBarUncompletedText}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/progressBar/components/achievementStep/index.tsx
import React, { forwardRef, useContext } from "react";
import { View } from "react-native";
import { TvgConfContext } from "../../../../utils/tvgConfProvider";
import { ProgressBarAchievementStepProps } from "../../types";
import { useQaLabel } from "../../../../hooks";
import { PBContext } from "../../context";
import {
StyledAchievementStepContainer,
StyledAchievementStepText
} from "./styles";
export const AchievementStep = forwardRef<
View,
ProgressBarAchievementStepProps
>(
(
{
qaLabel = "progress-bar-achievement-step",
icon,
totalSteps = 0,
isDarkMode = false,
...rest
},
ref
) => {
const viewTestProps = useQaLabel(qaLabel);
const { completedSteps } = useContext(PBContext);
const { device } = useContext(TvgConfContext);
const isAchievementStep = completedSteps > totalSteps;
return (
<StyledAchievementStepContainer
isCompleted={isAchievementStep}
variant={isDarkMode ? "dark" : "light"}
isMobile={device === "mobile"}
// @ts-ignore
ref={ref}
{...rest}
{...viewTestProps}
>
{typeof icon === "string" ? (
<StyledAchievementStepText
variant={isDarkMode ? "dark" : "light"}
isCompleted={isAchievementStep}
isMobile={device === "mobile"}
>
{icon}
</StyledAchievementStepText>
) : (
icon
)}
</StyledAchievementStepContainer>
);
}
);
export default AchievementStep;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/progressBar/index.tsx
import React, { forwardRef, memo, useContext } from "react";
import { View } from "react-native";
import { TvgConfContext } from "../../utils/tvgConfProvider";
import { Devices } from "../../theming/types";
import { useQaLabel } from "../../hooks/useQaLabel";
import { StyledContainer } from "./styled-components";
import {
Step as ProgressBarStep,
AchievementStep as ProgressAchievementStep
} from "./components";
import { PBContext } from "./context";
import {
ProgressBarProps,
ProgressBarStepProps,
ProgressBarAchievementStepProps,
ProgressBarCompoundComponent
} from "./types";
export const stylesFn = (device: Devices) => ({
base: {
marginLeft: 1,
marginRight: 1
},
firstStep: {
marginLeft: 0,
borderBottomLeftRadius: 4,
borderTopLeftRadius: 4
},
lastStep: {
marginRight: 0,
borderBottomRightRadius: 4,
borderTopRightRadius: 4
},
withIcon: {
marginTop: device === "mobile" ? 10 : 14
}
});
export const ProgressBar = memo(
forwardRef<View, ProgressBarProps>(
(
{
qaLabel = "progress-bar",
completedSteps = 0,
icon = null,
isDarkMode = false,
children,
...rest
},
ref
) => {
const viewTestProps = useQaLabel(qaLabel);
const { device } = useContext(TvgConfContext);
const styles = stylesFn(device);
const renderSteps = () =>
children.map((stepElement, index) => {
let style = {};
if (index === 0) {
style = styles.firstStep;
} else if (index === children.length - 1 && !icon) {
style = styles.lastStep;
}
if (icon) {
style = {
...style,
...styles.withIcon
};
}
const stepNumber = index + 1;
return React.cloneElement(stepElement, {
key: stepNumber,
stepNumber,
style: [styles.base, style],
isDarkMode
});
});
return (
<StyledContainer ref={ref} {...rest} {...viewTestProps}>
<PBContext.Provider value={{ completedSteps }}>
{renderSteps()}
{icon ? (
<ProgressAchievementStep
icon={icon}
totalSteps={children.length}
isDarkMode={isDarkMode}
/>
) : null}
</PBContext.Provider>
</StyledContainer>
);
}
)
) as ProgressBarCompoundComponent<
typeof ProgressBarStep,
typeof ProgressAchievementStep
>;
ProgressBar.Step = ProgressBarStep;
ProgressBar.AchievementStep = ProgressAchievementStep;
export type {
ProgressBarProps,
ProgressBarStepProps,
ProgressBarAchievementStepProps
};
export default ProgressBar;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/radio/radioGroup/styled-components.ts
import styled from "styled-components/native";
import { margin } from "styled-system";
import { Theme } from "../../../theming/types";
export const StyledViewContainer = styled.View`
${margin}
border-width: 1px;
border-color: transparent;
`;
export const StyledTextLabel = styled.Text<{
theme: Theme;
children?: React.ReactNode;
}>`
font-family: ${({ theme }) => theme.fonts.medium};
color: ${({ theme }) => theme.colors.grey[900]};
margin-bottom: ${({ theme }) => theme.space["space-4"]};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/radio/radioGroup/index.tsx
import { View } from "react-native";
import React, { createContext, forwardRef } from "react";
import { useQaLabel } from "../../../hooks/useQaLabel";
import { RadioGroupProps, RadioGroupContextProps } from "./types";
import { StyledViewContainer, StyledTextLabel } from "./styled-components";
const initialState = { selectedValue: "", onChange: () => {} };
export const GroupContext = createContext<RadioGroupContextProps>(initialState);
export const RadioGroup = forwardRef<View, RadioGroupProps>(
(
{
label,
children,
selectedValue,
qaLabel,
onChange,
isDisabled = false,
...rest
},
ref
) => {
const viewTestProps = useQaLabel(qaLabel);
return (
<StyledViewContainer
// @ts-ignore
ref={ref}
{...rest}
{...viewTestProps}
accessibilityRole="radiogroup"
>
<GroupContext.Provider value={{ selectedValue, onChange, isDisabled }}>
{label && (
<View>
<StyledTextLabel accessibilityLabel={label}>
{label}
</StyledTextLabel>
</View>
)}
<View>{children}</View>
</GroupContext.Provider>
</StyledViewContainer>
);
}
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/radio/styled-components.ts
import styled from "styled-components/native";
import { Platform, View, Text, Pressable } from "react-native";
import { margin } from "styled-system";
const setDefaultCursor = Platform.OS === "web" && `cursor: default;`;
export const StyledPressableContainer = styled(Pressable)<{
isHovered: boolean;
isDisabled: boolean;
isInvalid: boolean;
isChecked: boolean;
isPressed: boolean;
}>`
${margin};
height: 24px;
width: 24px;
background-color: ${({ theme }) => theme.colors.white[900]};
border-radius: 99px;
border: 1px solid ${({ theme }) => theme.colors.blue[200]};
justify-content: center;
align-items: center;
box-shadow: ${({ theme }) => theme.elevations.low};
${setDefaultCursor}
${({ isHovered, isDisabled, theme }) =>
isHovered &&
`
border: 2px solid ${
isDisabled ? theme.colors.blue[100] : theme.colors.blue_accent[500]
};
box-shadow: ${theme.elevations.medium};
`}
${({ isInvalid, isDisabled, theme }) =>
isInvalid &&
`
border: 2px solid ${
isDisabled ? theme.colors.blue[100] : theme.colors.orange[600]
};
`}
${({ isChecked, theme }) =>
isChecked &&
`
background-color: ${theme.colors.blue_accent[500]};
border: 2px solid ${theme.colors.blue_accent[500]};
box-shadow: none;
`}
${({ isPressed, theme }) =>
isPressed &&
`
background-color: ${theme.colors.blue_accent[500]};
border: 2px solid ${theme.colors.blue_accent[500]};
box-shadow: none;
`}
${({ isDisabled, theme }) =>
isDisabled &&
`
background-color: ${theme.colors.blue["000"]};
border: 1px solid ${theme.colors.blue[100]};
box-shadow: none;
${setDefaultCursor}
`}
`;
export const StyledViewChecker = styled(View)<{
isChecked: boolean;
isDisabled: boolean;
}>`
height: 8px;
width: 8px;
border-radius: 99px;
background-color: ${({ theme }) => theme.colors.white[900]};
${({ isChecked, isDisabled, theme }) =>
isChecked &&
`
background-color: ${
isDisabled ? theme.colors.blue[200] : theme.colors.white[900]
};
`}
${({ isDisabled, isChecked, theme }) =>
isDisabled &&
`
background-color: ${
isChecked ? theme.colors.blue[200] : theme.colors.blue["000"]
};
`}
`;
export const StyledLabelContainer = styled(Text)`
display: flex;
justify-content: center;
padding-left: ${({ theme }) => theme.space["space-3"]};
padding-right: ${({ theme }) => theme.space["space-6"]};
`;
export const StyledLabel = styled(Text)<{ isDisabled: boolean }>`
${setDefaultCursor};
font-family: ${({ theme }) => theme.fonts.regular};
color: ${({ theme }) => theme.colors.grey[900]};
${({ isDisabled, theme }) =>
isDisabled &&
`
color: ${theme.colors.grey[600]};
`}
`;
export const StyledViewContainer = styled(View)`
flex-direction: row;
align-items: center;
margin-bottom: ${({ theme }) => theme.space["space-4"]};
`;
export const StyledView = styled(View)`
flex-shrink: 1;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/radio/index.tsx
import React, { useContext, forwardRef } from "react";
import { View } from "react-native";
import { useQaLabel } from "../../hooks/useQaLabel";
import { RadioGroup, GroupContext } from "./radioGroup";
import { RadioProps, RadioCompoundComponent } from "./types";
import { useEvents } from "../../hooks/useEvents";
import {
StyledPressableContainer,
StyledViewChecker,
StyledLabelContainer,
StyledViewContainer,
StyledLabel
} from "./styled-components";
export const Radio = forwardRef<View, RadioProps>(
({ value, label, isInvalid = false, qaLabel = value, ...rest }, ref) => {
const {
onChange,
selectedValue,
isDisabled = false
} = useContext(GroupContext);
const { events, eventsHandlers } = useEvents({});
const pressHandler = () => {
if (isDisabled) return;
onChange(value);
};
return (
<StyledViewContainer {...useQaLabel(qaLabel)}>
<StyledPressableContainer
{...rest}
{...useQaLabel(`${qaLabel}-input`)}
{...events}
{...eventsHandlers}
onPress={pressHandler}
ref={ref}
focusable
accessibilityRole="radio"
accessibilityState={{ selected: selectedValue === value }}
accessibilityLabel={label}
isInvalid={isInvalid}
isChecked={selectedValue === value}
isDisabled={isDisabled}
>
<StyledViewChecker
isChecked={selectedValue === value}
isDisabled={isDisabled}
/>
</StyledPressableContainer>
<StyledLabelContainer
{...events}
{...eventsHandlers}
onPress={pressHandler}
>
<StyledLabel
isDisabled={isDisabled}
{...useQaLabel(`${qaLabel}-label`)}
>
{label}
</StyledLabel>
</StyledLabelContainer>
</StyledViewContainer>
);
}
) as RadioCompoundComponent<typeof RadioGroup>;
export type { RadioProps };
Radio.Group = RadioGroup;
export default Radio;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/segmentedControl/styled-components.ts
import styled, { css } from "styled-components/native";
import { View, Text, Pressable, Platform, Animated } from "react-native";
import { space, width } from "../../theming/styledSystem";
import { SegmentSize } from "./types";
export const sizesMap = {
s: {
height: 32
},
m: {
height: 40
},
l: {
height: 52
}
};
export const StyledComponent = styled(View)<{
isDisabled: boolean;
size: SegmentSize;
}>`
overflow: hidden;
position: relative;
height: ${({ size }) => sizesMap[size]?.height}px;
border-radius: 68px;
${({ theme }) => css`
background-color: ${theme.colorTokens.background.base};
padding: ${theme.space["space-1"]};
`};
${({ isDisabled }) =>
isDisabled &&
css`
opacity: 0.4;
`}
${space};
${width};
`;
export const SegmentsContainer = styled(View)`
flex: 1;
flex-direction: row;
justify-content: space-evenly;
align-items: center;
elevation: 5;
background-color: ${({ theme }) => theme.colorTokens.background.default};
`;
export const SegmentTab = styled(Pressable)<{ isFocused: boolean }>`
height: 100%;
flex: 1;
${({ isFocused }) =>
Platform.OS !== "web" &&
isFocused &&
css`
outline-style: solid;
outline-width: 1px;
`}
`;
export const SegmentTabContent = styled(Animated.View)`
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
margin: 1px;
`;
export const SegmentText = styled(Text)<{ isSelected?: boolean }>`
${({ theme, isSelected }) => css`
font-family: ${theme.fonts.medium};
font-size: ${theme.fontSizes.s};
line-height: ${theme.lineHeights.s};
color: ${isSelected
? theme.colorTokens.content.default
: theme.colorTokens.content.subtle};
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/segmentedControl/segmentedControl.tsx
import React, { createContext, useEffect, useState } from "react";
import { LayoutChangeEvent } from "react-native";
import { getAccessibilityRole } from "../../utils/accessibility";
import { useQaLabel } from "../../hooks/useQaLabel";
import {
SegmentedControlProps,
SCContextProps,
SCTabSelectedProps
} from "./types";
import { StyledComponent, SegmentsContainer } from "./styled-components";
import { SegmentedControlPill } from "./segmentedControlPill";
const initialState: SCContextProps = {
selectedValue: "",
onSelect: () => {},
isDisabled: false
};
export const SCContext = createContext<SCContextProps>(initialState);
SCContext.displayName = "SCContext";
export const SegmentedControl = ({
style,
onChange,
selectedValue,
size,
isDisabled = false,
children,
qaLabel,
...rest
}: SegmentedControlProps): JSX.Element => {
const [segmentWidth, setSegmentWidth] = useState(0);
const [tabsNbr, setTabsNbr] = useState(
React.Children.toArray(children).length
);
const [selectedTab, setSelectedTab] = useState<SCTabSelectedProps>({
index: 0,
children: ""
});
useEffect(() => {
let selectedTabChildren;
let selectedTabEnd;
const childrenElements = React.Children.toArray(children);
const selectedTabIndex = childrenElements.findIndex((elem) => {
if (
React.isValidElement<{
value: string;
children: string | JSX.Element;
end?: JSX.Element;
}>(elem) &&
elem.props.value === selectedValue
) {
selectedTabChildren = elem.props.children;
selectedTabEnd = elem.props.end;
return true;
}
return false;
});
if (selectedTabIndex !== -1) {
setSelectedTab({
index: selectedTabIndex,
children: selectedTabChildren || "",
end: selectedTabEnd
});
}
if (childrenElements.length !== tabsNbr) {
setTabsNbr(childrenElements.length);
}
}, [children, selectedValue]);
const handleChange = (value: string | number) => {
// mocks iOS's nativeEvent
const event = {
nativeEvent: {
value
}
};
// @ts-ignore
if (typeof onChange === "function") onChange(event);
};
const handleLayoutChange = (event: LayoutChangeEvent) => {
const { width } = event.nativeEvent.layout;
const newSegmentWidth = tabsNbr ? width / tabsNbr : 0;
if (newSegmentWidth !== segmentWidth) {
setSegmentWidth(newSegmentWidth);
}
};
return (
<StyledComponent
{...useQaLabel(qaLabel)}
accessibilityRole={getAccessibilityRole("tablist")}
style={style}
size={size}
isDisabled={isDisabled}
onLayout={handleLayoutChange}
{...rest}
>
<SegmentsContainer>
<SCContext.Provider
value={{ selectedValue, onSelect: handleChange, isDisabled }}
>
{children}
</SCContext.Provider>
</SegmentsContainer>
{segmentWidth ? (
<SegmentedControlPill
segmentWidth={segmentWidth}
selectedIndex={selectedTab.index}
end={selectedTab.end}
qaLabel={`${qaLabel}-pill`}
>
{selectedTab.children}
</SegmentedControlPill>
) : null}
</StyledComponent>
);
};
export type { SegmentedControlProps };
export default SegmentedControl;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/segmentedControl/segmentedControlPill.tsx
import React, { isValidElement } from "react";
import { Animated, StyleSheet } from "react-native";
import { easeSinInOut } from "d3-ease";
import { useColorTokens } from "@tvg/design-system/web/hooks";
import { getAccessibilityRole } from "../../utils/accessibility";
import { useQaLabel } from "../../hooks/useQaLabel";
import { SCPillProps } from "./types";
import { SegmentTabContent, SegmentText } from "./styled-components";
const sliderMargin = 4;
export const SegmentedControlPill = ({
segmentWidth,
selectedIndex,
children,
end,
qaLabel = "segmented-control-pill"
}: SCPillProps) => {
const animation = React.useRef(
new Animated.Value(segmentWidth * selectedIndex)
).current;
const colorTokens = useColorTokens();
React.useEffect(() => {
if (animation && segmentWidth) {
Animated.timing(animation, {
toValue: segmentWidth * selectedIndex,
duration: 300,
easing: easeSinInOut,
useNativeDriver: true
}).start();
}
}, [animation, segmentWidth, selectedIndex]);
const opacity = animation.interpolate({
inputRange: [
segmentWidth * (selectedIndex - 1),
segmentWidth * selectedIndex - segmentWidth / 2,
segmentWidth * selectedIndex - segmentWidth / 4,
segmentWidth * selectedIndex,
segmentWidth * selectedIndex + segmentWidth / 4,
segmentWidth * selectedIndex + segmentWidth / 2,
segmentWidth * (selectedIndex + 1)
],
outputRange: [0, 0.1, 0.2, 1, 0.2, 0.1, 0],
extrapolate: "clamp",
easing: easeSinInOut
});
return selectedIndex != null && segmentWidth ? (
<Animated.View
{...useQaLabel(qaLabel)}
style={[
styles.slider,
{
transform: [{ translateX: animation }],
width: segmentWidth - 2 * sliderMargin,
backgroundColor: colorTokens.background.surface,
shadowColor: colorTokens.background.secundary
}
]}
>
<SegmentTabContent
style={{
opacity
}}
>
{isValidElement(children) ? (
children
) : (
<SegmentText
accessibilityRole={getAccessibilityRole("span")}
isSelected
>
<Animated.Text>{children}</Animated.Text>
</SegmentText>
)}
{end}
</SegmentTabContent>
</Animated.View>
) : null;
};
const styles = StyleSheet.create({
slider: {
position: "absolute",
alignItems: "center",
justifyContent: "center",
borderRadius: 68,
top: sliderMargin,
bottom: sliderMargin,
right: sliderMargin,
left: sliderMargin,
shadowOffset: {
width: 0,
height: 1
},
shadowOpacity: 0.12,
shadowRadius: 3,
elevation: 3
}
});
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/seoArea/styled-components.ts
import styled from "styled-components";
import { Theme } from "../../theming/types";
export const SeoContainer = styled.div<{ theme: Theme }>`
background-color: ${({ theme }) => theme.colors.white[900]};
padding: 15px 12px 20px;
box-shadow: inset 0 0 0 1px ${({ theme }) => theme.colors.blue[100]};
a {
vertical-align: baseline;
color: ${({ theme }) => theme.colors.blue_accent[800]};
cursor: pointer;
}
p {
padding-top: 12px;
}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/sort/styled-components.ts
import styled, { css } from "styled-components/native";
import { StyledButton } from "../button";
import {
color,
background,
space,
borderRadius,
width,
compose
} from "../../theming/styledSystem";
const styles = compose(color, background, space, borderRadius, width);
export const SortButton = styled(StyledButton)<{ justifyContent: string }>`
flex-direction: row;
justify-content: ${({ justifyContent }) => justifyContent};
${styles};
`;
export const Container = styled.View<{
hasBorder: boolean;
children?: React.ReactNode;
}>`
position: relative;
${({ hasBorder }) =>
hasBorder &&
css`
border: 1px solid ${({ theme }) => theme.colorTokens.border.default};
box-shadow: 0 2px 4px #112b4424;
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/sort/context.ts
import { createContext } from "react";
import { noop } from "lodash";
import { SortContextProps } from "./types";
const initialState: SortContextProps = {
isDropdownOpen: false,
onChange: noop,
selectedValue: "",
layer: 999
};
export const SortContext = createContext<SortContextProps>(initialState);
SortContext.displayName = "SortContext";
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/sort/components/animatedDropdown/styled-components.ts
import styled, { css } from "styled-components/native";
import { rgba } from "polished";
import {
color,
background,
space,
borderRadius,
width,
compose
} from "../../../../theming/styledSystem";
import { Theme } from "../../../../theming/types";
const styleFns = compose(color, background, borderRadius, width);
export const Container = styled.View`
display: flex;
`;
export const ContentContainer = styled.View<{
layer: number;
width: string;
children?: React.ReactNode;
}>`
position: absolute;
z-index: ${({ layer }) => layer};
display: flex;
flex-direction: column;
${space}
${styleFns}
`;
export const Dropdown = styled.View<{
isDarkMode: boolean;
theme: Theme;
children?: React.ReactNode;
}>`
border-width: 1px;
${({ theme, isDarkMode }) => css`
background-color: ${isDarkMode
? theme.colors.blue["900"]
: theme.colors.white["900"]};
border-color: ${theme.colors.blue["100"]};
border-radius: ${theme.radii.s};
filter: drop-shadow(0 1px 3px ${rgba(theme.colors.blue[900], 0.14)});
will-change: filter;
`}
${styleFns}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/sort/components/option/styled-components.ts
import styled, { css } from "styled-components/native";
import { TouchableHighlight, Text } from "react-native";
import { StyledProps, DisabledProps } from "./types";
export const StyledPressable = styled(TouchableHighlight)<
StyledProps & DisabledProps
>`
min-height: 42px;
background-color: ${({ theme }) => theme.colors.white[900]};
padding: ${({ theme }) => theme.space["space-4"]};
justify-content: center;
align-items: left;
${({ isHovered, isDisabled, theme }) =>
isHovered &&
css`
background-color: ${theme.colors.blue_accent["000"]};
cursor: ${isDisabled ? "default" : "pointer"};
`}
${({ isPressed, theme }) =>
isPressed &&
css`
background-color: ${theme.colors.blue_accent[100]};
`}
${({ isDisabled, theme }) =>
isDisabled &&
css`
background-color: ${theme.colors.white[500]};
`};
${({ isSelected, theme }) =>
isSelected &&
css`
background-color: ${theme.colors.blue_accent["000"]};
border-bottom-color: ${theme.colors.blue["000"]};
border-bottom-width: 1px;
border-left-color: ${theme.colors.blue_accent[500]};
border-left-width: 2px;
`}
`;
export const StyledTextTitle = styled(Text)<StyledProps & DisabledProps>`
${({ theme, isSelected, isPressed, isDisabled }) => css`
font-family: ${isSelected || isPressed
? theme.fonts.medium
: theme.fonts.regular};
font-size: ${theme.fontSizes.s};
color: ${((isSelected || isPressed) && theme.colors.blue_accent[500]) ||
(isDisabled && theme.colors.grey[600]) ||
theme.colors.grey[900]};
`}
`;
export const StyledTextDescription = styled(Text)<StyledProps>`
${({ theme, isSelected, isPressed }) => css`
font-family: ${isSelected || isPressed
? theme.fonts.medium
: theme.fonts.regular};
font-size: ${theme.fontSizes.xs};
color: ${theme.colors.grey[700]};
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/switch/styled-components.ts
import { Platform, View, Text } from "react-native";
import styled, { css } from "styled-components/native";
import { getAccessibilityRole } from "../../utils/accessibility";
const setDefaultCursor = Platform.OS === "web" && `cursor: default;`;
export const Toggle = styled(View)<{ on: boolean; isDisabled: boolean }>`
height: 24px;
align-items: center;
justify-content: center;
border-radius: ${({ theme }) => theme.radii.l};
${({ on, isDisabled, theme }) =>
on
? css`
background-color: ${isDisabled
? theme.colors.blue["000"]
: theme.colors.blue_accent[500]};
`
: css`
background-color: ${isDisabled
? theme.colors.blue["000"]
: theme.colors.grey[300]};
`};
${({ isDisabled }) => isDisabled && setDefaultCursor}
`;
export const Slider = styled(View)`
width: 18px;
height: 18px;
border-radius: ${({ theme }) => theme.radii.m};
background-color: ${({ theme }) => theme.colors.white[900]};
`;
export const TextArea = styled(Text).attrs(() => ({
accessibilityRole: getAccessibilityRole("span")
}))<{ on: boolean; isDisabled: boolean }>`
color: ${({ theme, isDisabled }) =>
isDisabled ? theme.colors.blue[200] : theme.colors.white[900]};
font-size: ${({ theme }) => theme.fontSizes.xs};
font-family: ${({ theme }) => theme.fonts.medium};
${(props) =>
props.on
? css`
margin-right: ${props.theme.space["space-6"]};
`
: css`
margin-left: ${props.theme.space["space-6"]};
`};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tabs/tabs.tsx
import React, { createContext, useState, useMemo } from "react";
import { View, ScrollView } from "react-native";
import { useQaLabel } from "../../hooks/useQaLabel";
import { TabsProps, TabsContextProps, TabsLayout } from "./types";
import {
StyledViewContainer,
ContentView,
TabHeaderContainer
} from "./styled-components";
const initialState: TabsContextProps = {
selectedValue: "",
onChange: () => {},
isStretched: false,
tabsLayout: {},
setTabsLayout: () => {},
isFullHeight: false
};
export const TabsContext = createContext<TabsContextProps>(initialState);
TabsContext.displayName = "TabsContext";
export const Tabs = ({
qaLabel,
children,
selectedValue,
onChange,
isFullHeight = false,
useViewComponent = false,
headerPadding,
headerWidth,
...rest
}: TabsProps) => {
const content = useMemo(() => {
const childrenElements = React.Children.toArray(children);
return childrenElements.filter((val) => {
if (React.isValidElement<{ value: string }>(val)) {
return val.props.value === selectedValue;
}
return val;
});
}, [selectedValue, children]);
const viewTestProps = useQaLabel(qaLabel);
const [tabsLayout, setTabsLayout] = useState<TabsLayout>({});
let tabList;
if (children[0]?.props.qaLabel === "tabList") {
tabList = children[0];
} else {
throw new Error(
"TabList child element is required to be used at first place"
);
}
return (
<StyledViewContainer
isFullHeight={isFullHeight}
{...rest}
{...viewTestProps}
>
<TabsContext.Provider
value={{
selectedValue,
onChange,
tabsLayout,
setTabsLayout,
isFullHeight
}}
>
<TabHeaderContainer
headerPadding={headerPadding}
headerWidth={headerWidth}
>
{tabList}
</TabHeaderContainer>
<ContentView
as={useViewComponent ? View : ScrollView}
isFullHeight={isFullHeight}
>
{content}
</ContentView>
</TabsContext.Provider>
</StyledViewContainer>
);
};
export type { TabsProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/switch/index.tsx
import React, { useCallback, useRef, useEffect } from "react";
import { Animated, Pressable } from "react-native";
import useQaLabel from "../../hooks/useQaLabel";
import { Toggle, Slider, TextArea } from "./styled-components";
import { SwitchProps } from "./types";
const AnimatedSlider = Animated.createAnimatedComponent(Slider);
export const Switch = ({
isOn,
onPress,
qaLabel,
isDisabled = false
}: SwitchProps) => {
const testProps = useQaLabel(qaLabel);
const leftAnimatedValue = useRef(new Animated.Value(isOn ? 1 : 0)).current;
const turnOnOff = (on: boolean) =>
Animated.timing(leftAnimatedValue, {
toValue: on ? 0 : 1,
duration: 200,
useNativeDriver: false
}).start();
useEffect(() => {
requestAnimationFrame(() => {
turnOnOff(!isOn);
});
}, [isOn]);
const onPressSwitch = useCallback(() => {
onPress();
requestAnimationFrame(() => {
turnOnOff(!!isOn);
});
}, [isOn, onPress]);
const leftValue = leftAnimatedValue.interpolate({
inputRange: [0, 1],
outputRange: [4, 30]
});
return (
<Pressable
accessibilityRole="switch"
accessibilityState={{ checked: isOn, disabled: isDisabled }}
onPress={onPressSwitch}
disabled={isDisabled}
// eslint-disable-next-line
style={{ width: 52 }}
>
<Toggle {...testProps} on={isOn} isDisabled={isDisabled}>
<TextArea on={isOn} isDisabled={isDisabled}>
{isOn ? "ON" : "OFF"}
</TextArea>
<AnimatedSlider
// eslint-disable-next-line
style={{
position: "absolute",
left: leftValue
}}
/>
</Toggle>
</Pressable>
);
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tabs/styled-components.ts
import styled, { css } from "styled-components/native";
import { margin } from "styled-system";
import { View, ScrollView } from "react-native";
export const StyledViewContainer = styled(View)<{ isFullHeight: boolean }>`
position: relative;
${({ isFullHeight }) => isFullHeight && "flex-grow:1"};
${margin}
`;
export const ContentView = styled(ScrollView)<{ isFullHeight: boolean }>`
${({ isFullHeight }) => isFullHeight && "flex-grow:1"};
`;
export const TabHeaderContainer = styled(View)<{
headerPadding?: string;
headerWidth?: string;
}>`
border-bottom-color: ${({ theme }) => theme.colors.blue[100]};
border-bottom-width: 1px;
width: ${({ headerWidth }) => headerWidth || `100%`};
background-color: ${({ theme }) => theme.colors.white[900]};
z-index: 1;
${({ headerPadding }) =>
headerPadding &&
css`
padding: ${headerPadding};
`}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tabs/components/tab/styled-components.ts
import styled from "styled-components/native";
import { TouchableHighlight, Text, View } from "react-native";
import { StrechedProps, StyledProps, DisabledProps } from "./types";
export const StyledPressable = styled(TouchableHighlight)<
StyledProps & StrechedProps & DisabledProps
>`
height: 48px;
background-color: ${({ theme }) => theme.colors.white[900]};
border-bottom-color: ${({ theme }) => theme.colors.blue[100]};
border-bottom-width: ${({ noBorder }) => (noBorder ? "0" : "1px")};
padding-left: ${({ theme }) => theme.space["space-4"]};
padding-right: ${({ theme }) => theme.space["space-4"]};
justify-content: center;
align-items: center;
${({ isStretched }) =>
isStretched &&
`
flex-grow: 1;
`}
${({ isHovered, isDisabled, theme, hoverColor }) =>
isHovered &&
`background-color: ${hoverColor || theme.colors.blue_accent["000"]};
cursor: ${isDisabled ? "default" : "pointer"}
`}
${({ isPressed, theme, hasPressedColor }) =>
isPressed &&
hasPressedColor &&
`
background-color: ${theme.colors.blue_accent[100]};
`}
${({ isDisabled, theme }) =>
isDisabled &&
`
background-color: ${theme.colors.white[500]};
`};
`;
export const StyledTextTitle = styled(Text)<StyledProps & DisabledProps>`
color: ${({ theme, textTitleColor }) =>
textTitleColor || theme.colors.grey[900]};
font-size: ${({ theme }) => theme.fontSizes.s};
font-family: ${({ theme }) => theme.fonts.medium};
${({ isSelected, theme, textTitleSelectedColor }) =>
isSelected &&
`
color: ${textTitleSelectedColor || theme.colors.blue_accent[500]}
`}
${({ isPressed, theme, hasPressedColor }) =>
isPressed &&
hasPressedColor &&
`
color: ${theme.colors.blue_accent[500]}
`}
${({ isDisabled, theme }) =>
isDisabled &&
`
color: ${theme.colors.grey[600]};
`}
${({ isTitleUppercase }) => isTitleUppercase && `text-transform: uppercase;`}
`;
export const StyledViewIconContainer = styled(View)`
margin-left: ${({ theme }) => theme.space["space-1"]};
`;
export const StyledTextDescription = styled(Text)<StyledProps & DisabledProps>`
font-size: ${({ theme }) => theme.fontSizes.xs};
font-family: ${({ theme }) => theme.fonts.regular};
color: ${({ theme }) => theme.colors.grey[800]};
margin-top: 2px;
${({ isSelected, theme }) =>
isSelected &&
`
color: ${theme.colors.blue_accent[400]}
`}
${({ isPressed, theme }) =>
isPressed &&
`
color: ${theme.colors.blue_accent[400]}
`}
${({ isDisabled, theme }) =>
isDisabled &&
`
color: ${theme.colors.grey[500]};
`}
`;
export const StyledViewTitleContainer = styled(View)`
flex-direction: row;
margin-bottom: 2px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tabs/components/tabSelectionIndicator/index.tsx
import React, { useContext, useEffect, useRef } from "react";
import { Animated, Platform, StyleSheet } from "react-native";
import { tvgColorPalette as colors } from "../../../../theming/themes/common";
import { TabsContext } from "../../tabs";
import { TabSelectionIndicatorProps } from "./types";
const isWeb = Platform.OS === "web";
export const TabSelectionIndicator = ({
width,
x,
tabSelectionIndicatorColor
}: TabSelectionIndicatorProps) => {
const { selectedValue, tabsLayout } = useContext(TabsContext);
const translation = useRef(new Animated.Value(x)).current;
useEffect(() => {
Animated.timing(translation, {
toValue: x,
useNativeDriver: !isWeb,
duration: 200
}).start();
}, [selectedValue, tabsLayout]);
return (
<Animated.View
style={[
styles.slider,
{
width,
backgroundColor:
tabSelectionIndicatorColor || colors.blue_accent[500],
transform: [{ translateX: translation }]
}
]}
/>
);
};
const styles = StyleSheet.create({
slider: {
position: "absolute",
top: 46,
height: 2
}
});
export { TabSelectionIndicatorProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tabs/components/tabList/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
export const StyledViewContainer = styled(View)`
flex-direction: row;
height: 48px;
border: none;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tabs/components/tabPanel/styled-components.ts
import styled from "styled-components/native";
import { View } from "react-native";
import { padding } from "styled-system";
export const StyledView = styled(View)<{ isFullHeight?: boolean }>`
${({ isFullHeight }) => isFullHeight && "flex-grow:1"};
${padding};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tabs/components/tabList/index.tsx
import React, { useContext, useEffect, Children, cloneElement } from "react";
import { View } from "react-native";
import { TabsContext } from "../../tabs";
import { TabSelectionIndicator } from "../tabSelectionIndicator";
import { StyledViewContainer } from "./styled-components";
import { TabListProps } from "./types";
import { ScrollViewFading } from "../../../scrollViewFading";
export const TabList = ({
children,
isStretched,
tabSelectionIndicatorColor
}: TabListProps) => {
const { tabsLayout, setTabsLayout, selectedValue } = useContext(TabsContext);
const activeTabLayout = (tab: string | undefined) => {
let result = { width: 0, x: 0 };
Object.entries(tabsLayout).forEach((item) => {
if (item[0] === tab) {
result = {
width: (item[1] as { width: number }).width,
x: (item[1] as { x: number }).x
};
}
});
return result;
};
useEffect(() => {
React.Children.forEach(children, (child) => {
const state = {
...tabsLayout,
[child.props.value]: { width: 0, x: 0 }
};
setTabsLayout(state);
});
}, []);
return isStretched ? (
<View>
<StyledViewContainer accessibilityRole="tablist">
{Children.map(children, (child) =>
cloneElement(child, { isStretched })
)}
</StyledViewContainer>
<TabSelectionIndicator
width={activeTabLayout(selectedValue)?.width}
x={activeTabLayout(selectedValue)?.x}
tabSelectionIndicatorColor={tabSelectionIndicatorColor}
/>
</View>
) : (
<ScrollViewFading>
<StyledViewContainer accessibilityRole="tablist">
{Children.map(children, (child) =>
cloneElement(child, { isStretched })
)}
</StyledViewContainer>
<TabSelectionIndicator
width={activeTabLayout(selectedValue)?.width}
x={activeTabLayout(selectedValue)?.x}
tabSelectionIndicatorColor={tabSelectionIndicatorColor}
/>
</ScrollViewFading>
);
};
export { TabListProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/toastMessage/hooks/useToastAnimation.ts
import { useState, useEffect, useRef, Ref } from "react";
import { Animated, View, Platform } from "react-native";
import { easeExpInOut } from "d3-ease";
const useNativeDriver = Platform.OS !== "web";
const useToastAnimation = (
toastRef: Ref<View>,
duration: number,
autoHide: boolean,
onHide?: () => void
) => {
const opacity = useRef(new Animated.Value(0)).current;
const [isAnimating, setIsAnimating] = useState(false);
const [showTimeout, setShowTimeout] = useState(0);
const [hideTimeout, setHideTimeout] = useState(0);
useEffect(
() => () => {
clearTimeout(showTimeout);
clearTimeout(hideTimeout);
},
[showTimeout, hideTimeout]
);
const show = () => {
clearTimeout(showTimeout);
if (isAnimating) return;
clearTimeout(hideTimeout);
setIsAnimating(true);
if (
typeof toastRef !== "function" &&
typeof toastRef?.current?.setNativeProps === "function"
) {
toastRef?.current?.setNativeProps({
pointerEvents: "auto"
});
}
Animated.timing(opacity, {
useNativeDriver,
toValue: 1,
duration: 300,
easing: easeExpInOut
}).start(({ finished }) => {
if (finished) {
setIsAnimating(false);
// @ts-ignore
if (autoHide) setHideTimeout(setTimeout(() => hide(), duration));
}
});
};
const hide = () => {
clearTimeout(showTimeout);
clearTimeout(hideTimeout);
if (isAnimating) return;
if (
typeof toastRef !== "function" &&
typeof toastRef?.current?.setNativeProps === "function"
) {
toastRef?.current?.setNativeProps({
pointerEvents: "none"
});
}
Animated.timing(opacity, {
useNativeDriver,
toValue: 0,
duration: 500,
easing: easeExpInOut
}).start(({ finished }) => {
if (finished) {
setIsAnimating(false);
if (typeof onHide === "function") onHide();
}
});
};
return {
opacity,
show,
hide,
isAnimating,
setIsAnimating,
setShowTimeout,
setHideTimeout
};
};
export default useToastAnimation;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/toastMessage/messageContainer.tsx
import React, { useState, useEffect, useRef, useContext } from "react";
import {
Platform,
Keyboard,
Animated,
LayoutChangeEvent,
StyleSheet,
View,
EmitterSubscription,
GestureResponderEvent
} from "react-native";
import { useQaLabel } from "../../hooks/useQaLabel";
import { ToastMessageProps } from "./types";
import useToastAnimation from "./hooks/useToastAnimation";
import AlertInline from "../alertInline";
import { TvgConfContext } from "../../utils/tvgConfProvider";
export const durations = {
SHORT: 5000,
LONG: 10000
};
export const bottomOffsets = {
SHORT: 20,
TALL: 68
};
export const ToastMessage = ({
isVisible = true,
autoHide = true,
onHide,
delay = 0,
duration,
topOffset = 76,
bottomOffset = bottomOffsets.SHORT,
keyboardOffset = 15,
position = "bottom",
hasDismissButton = false,
qaLabel = "toastMessage",
isFromDSManager = false,
isFullWidth = true,
icon,
onClick,
...rest
}: ToastMessageProps) => {
const { device } = useContext(TvgConfContext);
const toastDuration =
duration ?? ((rest.title && durations.LONG) || durations.SHORT);
const toastRef = useRef<View>(null);
const { opacity, show, hide, setShowTimeout } = useToastAnimation(
toastRef,
toastDuration,
autoHide,
onHide
);
const [height, setHeight] = useState(60);
const [keyboardHeight, setKeyboardHeight] = useState(0);
const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
useEffect(() => {
let keyboardDidShowListener: EmitterSubscription;
let keyboardDidHideListener: EmitterSubscription;
if (Platform.OS === "ios") {
keyboardDidShowListener = Keyboard.addListener(
"keyboardDidShow",
keyboardDidShow
);
keyboardDidHideListener = Keyboard.addListener(
"keyboardDidHide",
keyboardDidHide
);
}
return () => {
if (keyboardDidShowListener || keyboardDidHideListener) {
keyboardDidShowListener.remove();
keyboardDidHideListener.remove();
}
};
}, []);
useEffect(() => {
if (isVisible) {
// @ts-ignore
setShowTimeout(setTimeout(() => show(), delay));
} else {
hide();
}
}, [isVisible, isKeyboardVisible]);
// @ts-ignore
const keyboardDidShow = (event) => {
setIsKeyboardVisible(true);
setKeyboardHeight(event.endCoordinates?.height);
};
const keyboardDidHide = () => {
setIsKeyboardVisible(false);
setKeyboardHeight(0);
};
const onLayout = (e: LayoutChangeEvent) => {
setHeight(e.nativeEvent.layout.height);
};
const offset =
position === "bottom"
? (isKeyboardVisible && keyboardOffset + keyboardHeight) || bottomOffset
: topOffset;
const range = [height, -offset];
const outputRange =
position === "bottom" ? range : range.map((value) => -value);
const translateY = opacity.interpolate({
inputRange: [0, 1],
outputRange
});
const dismissPressHandler = (e: GestureResponderEvent) => {
hide();
if (rest.onDismissPress) {
rest.onDismissPress(e);
}
};
const deviceStyles = StyleSheet.create({
mobile: {
justifyContent: "center",
flex: 1,
left: 0,
right: 0,
marginRight: 12,
marginLeft: 12
},
tablet:
Platform.OS === "web"
? {
justifyContent: "center",
left: 0,
right: 0,
margin: "auto",
width: 351
}
: {
width: 351,
flex: 1,
alignSelf: "center",
justifyContent: "center"
},
desktop: {
justifyContent: "center",
left: 0,
right: 0,
margin: "auto",
width: 351
}
} as const);
const messagePosition = position === "bottom" ? { bottom: 0 } : { top: 0 };
return (
<Animated.View
style={[
{ opacity, transform: [{ translateY }] },
isFromDSManager ? styleForDsToastManager.base : style.base,
deviceStyles[device],
messagePosition
]}
pointerEvents={isVisible ? "auto" : "none"}
onLayout={onLayout}
ref={toastRef}
{...useQaLabel(qaLabel)}
>
<AlertInline
type="toast"
variant={rest.variant}
title={rest.title}
message={rest.message}
actionLink={rest.actionLink}
hasRoundedStyle={rest.hasRoundedStyle}
onDismissPress={hasDismissButton ? dismissPressHandler : undefined}
hasDismissAnimation={false}
qaLabel={`${qaLabel}-message`}
isFullWidth={isFullWidth}
icon={icon}
onClick={onClick}
/>
</Animated.View>
);
};
const style = StyleSheet.create({
base: {
// @ts-ignore
position: Platform.OS === "web" ? "relative" : "absolute",
zIndex: 99999
}
});
const styleForDsToastManager = StyleSheet.create({
base: {
// @ts-ignore
position: Platform.OS === "web" ? "fixed" : "absolute",
zIndex: 99999
}
});
export default ToastMessage;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/toastMessage/toastManager.tsx
import React, { Component } from "react";
import ReactDOM from "react-dom";
import { isEqual } from "lodash";
import ToastMessage from "./messageContainer";
import { ToastMessageProps, ToastOptions } from "./types";
export interface ToastState extends ToastOptions {
/** If toast message is visible */
isVisible: boolean;
}
class ToastManager extends Component<ToastMessageProps, ToastState> {
static displayName = "ToastManager";
static ref: ToastManager | null = null;
static setRef(ref: ToastManager | null) {
ToastManager.ref = ref;
}
static getRef() {
return ToastManager.ref;
}
static clearRef() {
ToastManager.ref = null;
}
static show(options: ToastMessageProps) {
ToastManager.ref?.show(options);
}
static hide() {
ToastManager.ref?.hide();
}
root: Element | null = null;
el: Element | null = null;
constructor(props: ToastMessageProps) {
super(props);
this.state = {
variant: props.variant,
message: props.message,
isVisible: props.isVisible !== undefined ?? false
};
this.hide = this.hide.bind(this);
}
componentDidMount() {
if (typeof window !== "undefined") {
this.el = document.createElement("div");
this.root = document.body;
this.root.appendChild(this.el);
}
}
shouldComponentUpdate(nextProps: ToastMessageProps, nextState: ToastState) {
return !isEqual(nextProps, this.props) || !isEqual(nextState, this.state);
}
componentWillUnmount = () => {
if (this.el && this.state.isVisible) this.root?.removeChild(this.el);
};
show = (options: ToastOptions) => {
this.setState({
...options,
isVisible: true
});
};
hide = () => {
if (this.state.isVisible) {
this.setState({ isVisible: false });
}
};
render() {
if (typeof window === undefined || !this.el) return null;
return ReactDOM.createPortal(
<ToastMessage
{...this.props}
{...this.state}
onHide={this.hide}
qaLabel="toast-portal"
isFromDSManager
/>,
this.el
);
}
}
export { ToastManager };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tooltipDescriptive/styled-components.ts
import styled from "styled-components/native";
import { rgba } from "polished";
import { View } from "react-native";
import {
color,
background,
space,
borderRadius,
width,
compose,
variant
} from "../../theming/styledSystem";
import { TooltipDescriptiveWrapperProps } from "./types";
const OFFSET_SPACE: string = "space-3";
const styles = compose(
color,
background,
space,
borderRadius,
width,
variant({
prop: "placement",
variants: {
top: { marginBottom: OFFSET_SPACE },
bottom: { marginTop: OFFSET_SPACE },
left: { marginRight: OFFSET_SPACE },
right: { marginLeft: OFFSET_SPACE }
}
})
);
export const Wrapper = styled(View)<
TooltipDescriptiveWrapperProps & { isSmall: boolean }
>`
${styles};
box-shadow: 0 4px 4px ${({ theme }) => rgba(theme.colors.black[900], 0.14)};
margin: ${({ theme }) => theme.space["space-1"]};
${({ isSmall }) => isSmall && "margin-right: 48px"};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/tvBrand/styled-components.ts
import styled from "styled-components/native";
import { space } from "styled-system";
import { Svg } from "react-native-svg";
export const StyledSvg = styled(Svg)`
${space}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/webScrollbar/styled-components.ts
import styled, { css } from "styled-components";
import { layout, position, space } from "styled-system";
import {
WebScrollbarProps,
OverflowProps,
ScrollOrientation,
ScrollContainerProps,
ShadowWrapperProps
} from "./types";
const scrollStyle = ({ scrollOrientation, overflow }: OverflowProps) => {
const orientation = {
horizontal: css`
overflow-x: ${overflow};
overflow-y: hidden;
`,
vertical: css`
overflow-y: ${overflow};
overflow-x: hidden;
`,
both: css`
overflow-x: ${overflow};
overflow-y: ${overflow};
`
};
return orientation[scrollOrientation as ScrollOrientation];
};
export const ScrollWrapper = styled.div`
position: relative;
width: 100%;
height: 100%;
margin-left: auto;
margin-right: auto;
overflow: auto;
`;
export const ScrollbarContainer = styled.div<
Pick<
WebScrollbarProps,
| "width"
| "height"
| "isDark"
| "scrollOrientation"
| "overflow"
| "bg"
| "scrollInternalPadding"
> &
ScrollContainerProps
>`
background-color: ${({ bg }) => bg};
${space}
padding-bottom:${({ scrollX, scrollInternalPadding }) =>
scrollX ? `${scrollInternalPadding}px` : "0"};
padding-right: ${({ scrollY, scrollInternalPadding }) =>
scrollY ? `${scrollInternalPadding}px` : "0"};
${layout}
${({ scrollOrientation = "vertical", overflow = "auto" }) =>
scrollStyle({ scrollOrientation, overflow })}
${position}
/* width */
::-webkit-scrollbar {
width: 7px;
}
/* Track */
::-webkit-scrollbar-track {
background: transparent;
box-shadow: none;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: ${({ isDark }) =>
isDark ? "rgba(255, 255, 255, 0.5)" : "rgba(56, 64, 72, 0.5)"};
border-radius: 12px;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: ${({ isDark }) =>
isDark ? "rgba(255, 255, 255, 0.8)" : "rgba(56, 64, 72, 0.8)"};
}
`;
const shadowTop = css<ShadowWrapperProps>`
&::before {
content: "";
box-shadow: inset 0 3px 3px rgba(17, 43, 68, 0.25);
display: flex;
height: 16px;
left: -2px;
pointer-events: none;
position: absolute;
width: calc(${({ width }) => width || "100%"} + 4px);
z-index: 1000;
overflow: hidden;
}
`;
const shadowBottom = css<ShadowWrapperProps>`
&::after {
content: "";
box-shadow: inset 0 -3px 3px rgba(17, 43, 68, 0.25);
display: flex;
height: 16px;
left: -2px;
margin-top: -16px;
pointer-events: none;
position: absolute;
width: calc(${({ width }) => width || "100%"} + 4px);
z-index: 999;
}
`;
export const ShadowWrapper = styled.div<ShadowWrapperProps>`
${space}
${layout}
max-height: ${({ maxHeight }) => maxHeight};
${({ scrollPosition, scrollY }) =>
(scrollPosition === "bottom" || scrollPosition === "mid") && scrollY
? shadowTop
: ""}
${({ scrollPosition, scrollY }) =>
(scrollPosition === "top" || scrollPosition === "mid") && scrollY
? shadowBottom
: ""}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/mtpPro/styled-components.ts
import styled, { css } from "styled-components/native";
import { Text } from "react-native";
import { space, compose } from "../../theming/styledSystem";
import { MtpProps } from "./types";
const styledComponentUtils = compose(space);
const baseTextStyle = css<Pick<MtpProps, "isCollapsed">>`
font-size: ${({ theme, isCollapsed }) =>
theme.fontSizes[isCollapsed ? "s" : "2xl"]};
line-height: ${({ theme, isCollapsed }) =>
theme.lineHeights[isCollapsed ? "l" : "2xl"]};
`;
export const RaceOff = styled(Text)<
Pick<MtpProps, "isCollapsed" | "hasFullText">
>`
display: flex;
align-items: center;
color: ${({ theme }) => theme.colorTokens.lhnHeader.content.positive};
font-weight: ${({ theme, isCollapsed, hasFullText }) =>
theme.fontWeights[isCollapsed && !hasFullText ? "normal" : "bold"]};
${baseTextStyle};
${styledComponentUtils};
`;
export const Resulted = styled(Text)<
Pick<MtpProps, "isCollapsed" | "hasFullText">
>`
display: flex;
align-items: center;
color: ${({ theme }) => theme.colorTokens.lhnHeader.content.brandSecondary};
font-weight: ${({ theme, isCollapsed, hasFullText }) =>
theme.fontWeights[isCollapsed && !hasFullText ? "normal" : "bold"]};
${baseTextStyle};
${styledComponentUtils};
`;
export const RaceTime = styled(Text)<
Pick<MtpProps, "isCollapsed" | "hasFullText">
>`
display: flex;
align-items: center;
color: ${({ theme }) => theme.colorTokens.lhnHeader.content.brandSecondary};
${({ theme, isCollapsed, hasFullText }) => {
if (isCollapsed) {
return css`
${!hasFullText &&
css`
width: min-content;
text-align: center;
`};
font-size: ${theme.fontSizes.s};
`;
}
return css`
font-size: ${theme.fontSizes["2xl"]};
`;
}}
font-weight: ${({ theme, hasFullText }) =>
hasFullText ? theme.fontWeights.bold : theme.fontWeights.normal};
line-height: ${({ theme, isCollapsed }) =>
theme.lineHeights[isCollapsed ? "s" : "2xl"]};
${styledComponentUtils};
`;
export const MinutesText = styled(Text)<Pick<MtpProps, "mtp" | "isCollapsed">>`
display: flex;
align-items: center;
color: ${({ theme, mtp }) =>
mtp > 5
? theme.colorTokens.lhnHeader.content.brandSecondary
: theme.colorTokens.lhnHeader.content.negative};
font-weight: ${({ theme }) => theme.fontWeights.bold};
${baseTextStyle};
${styledComponentUtils};
font-size: ${({ theme }) => theme.fontSizes["4xl"]};
`;
export const TextDescription = styled(Text)<Pick<MtpProps, "mtp">>`
display: block;
color: ${({ theme, mtp }) =>
mtp > 5
? theme.colorTokens.lhnHeader.content.brandSecondary
: theme.colorTokens.lhnHeader.content.negative};
font-family: ${({ theme }) => theme.fonts.condensedRegular};
font-size: 14px;
text-transform: uppercase;
margin-bottom: 0;
line-height: 125%;
width: 65px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/components/mtpPro/index.tsx
import React from "react";
import moment from "moment";
import {
MinutesText,
RaceOff,
RaceTime,
Resulted,
TextDescription
} from "./styled-components";
import { MtpProps } from "./types";
import { useQaLabel } from "../../hooks";
const MtpPro: React.FC<MtpProps> = ({
status,
mtp,
postTime,
isCollapsed = false,
hasFullText = false,
qaLabel = "mtp",
...rest
}) => {
const testProps = useQaLabel(qaLabel);
if (status === "SK") {
return (
<RaceOff
isCollapsed={isCollapsed}
hasFullText={hasFullText}
{...testProps}
{...rest}
>
{isCollapsed && !hasFullText ? "OFF" : "Race Off"}
</RaceOff>
);
}
if (status === "RO") {
return !isCollapsed || hasFullText ? (
<Resulted
isCollapsed={isCollapsed}
hasFullText={hasFullText}
{...testProps}
{...rest}
>
Resulted
</Resulted>
) : null;
}
const getMTPSufix = (collapsed: boolean, hasFText: boolean): string => {
if (collapsed && hasFText) {
return " MTP";
}
if (collapsed && !hasFText) {
return "m";
}
return " ";
};
return mtp > 59 ? (
<RaceTime
hasFullText={hasFullText}
isCollapsed={isCollapsed}
{...testProps}
{...rest}
>
{moment(postTime).format("hh:mm A")}
</RaceTime>
) : (
<MinutesText mtp={mtp} isCollapsed={isCollapsed} {...testProps} {...rest}>
{mtp > 9 ? mtp : `0${mtp}`}
{getMTPSufix(isCollapsed, hasFullText)}
{!isCollapsed && (
<TextDescription mtp={mtp} data-qa-label="mtp-text">
{mtp === 1 ? "MINUTE" : "MINUTES"} TILL POST
</TextDescription>
)}
</MinutesText>
);
};
export default MtpPro;
export { MtpPro };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/_static/colorPalette/index.tsx
import palette from "./palette.json"; export const buildColor = < Color extends keyof typeof palette, Variation extends keyof typeof palette[Color] >( color: Color, variation: Variation ) => palette[color][variation]; export default buildColor;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/src/utils/breakpoints.tsx
import tvgConf from "@tvg/conf";
const breakpoints = {
desktop: {
min: {
sm: "(min-width: 920px)",
md: "(min-width: 1024px)",
lg: "(min-width: 1152px)",
xl: "(min-width: 1255px)",
xxl: "(min-width: 1364px)"
},
max: {
sm: "(max-width: 919.98px)",
md: "(max-width: 1023.98px)",
lg: "(max-width: 1151.98px)",
xl: "(max-width: 1254.98px)",
xxl: "(max-width: 1363.98px)"
}
},
tablet: {
min: {
sm:
tvgConf().product === "tvg5" // preventing responsive components on desktop
? "(min-width: 1px)"
: "(min-width: 768px)",
md: "(min-width: 1194px)",
lg: "(min-width: 1366px)"
},
max: {
sm:
tvgConf().product === "tvg5" // preventing responsive components on desktop
? "(max-width: 1px)"
: "(max-width: 767.98px)",
md: "(max-width: 1193.98px)",
lg: "(max-width: 1365.98px)"
}
}
};
export default breakpoints;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/components/TalentPicksCard/BetSummary/index.tsx
import React from "react";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import { VisualSelection } from "@tvg/ts-types/Selections";
import BetUtils from "@tvg/utils/betSelection";
import formatCurrency from "@tvg/formatter/currency";
import { BetTypeCell } from "@tvg/design-system";
interface Props {
wagerAmount: string;
betTotal: string;
selections: VisualSelection[][];
wagerTypeCode: WagerTypeCodesEnum;
wagerTypeName: string;
isKey: boolean;
isBox: boolean;
isWheel: boolean;
legCount: number;
raceNumber: string;
numWagerableRunners?: string[];
onHandicaping?: boolean;
}
const BetSummary = ({
wagerAmount,
betTotal,
selections,
wagerTypeCode,
wagerTypeName,
isKey,
isBox,
legCount,
numWagerableRunners,
raceNumber,
onHandicaping,
isWheel
}: Props) => (
<BetTypeCell
m={1}
showOnlySelections
qaLabel="talent-picks-bet-type-cell"
completeSelection={selections}
selections={selections[0]}
scratches={BetUtils.getSelectionsRunnerNbrScratched(selections)}
approximatedPayout="0"
betAmount={formatCurrency(+wagerAmount)}
betTicket={formatCurrency(+betTotal)}
type={wagerTypeCode}
isKey={isKey}
isBox={isBox}
isWheel={isWheel}
betStatus="NONE"
betTypeName={wagerTypeName}
isLeg={legCount > 1}
numWagerableRunners={numWagerableRunners}
raceNumber={raceNumber}
onHandicaping={onHandicaping}
/>
);
export default BetSummary;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/components/TalentPicksCard/styled-components.ts
import styled, { css } from "styled-components";
import { breakpoints } from "@tvg/design-system";
export const CardWrapper = styled.div<{
isFDR: boolean;
isOnHomePage: boolean;
width?: string;
}>`
display: flex;
flex-direction: column;
box-shadow: inset 0 0 0 1px var(--fd-colors-border-default);
border-radius: 4px;
background-color: var(--fd-colors-background-surface);
${({ isOnHomePage }) =>
isOnHomePage
? css`
width: 96%;
height: 302px;
border-radius: 4px;
`
: css`
max-width: 351px;
width: 96%;
height: 282px;
`}
@media screen and ${breakpoints.desktop.min.sm} {
width: ${({ width }) => width || "335px"};
}
${({ isFDR }) =>
isFDR &&
css`
flex-shrink: 0;
scroll-snap-stop: always;
scroll-snap-align: start;
@media screen and ${breakpoints.tablet.max.sm} {
&:only-child {
width: 100%;
max-width: 100%;
}
}
`}
`;
export const CardHeader = styled.div<{
isOnHomePage?: boolean;
isFDTVPage?: boolean;
}>`
height: 64px;
padding: var(--fd-space-space-3);
display: flex;
align-items: center;
background-color: var(--fd-colors-background-layer);
box-shadow: inset 0 0 0 1px var(--fd-colors-border-default);
${({ isOnHomePage, isFDTVPage }) =>
isOnHomePage || isFDTVPage
? css`
border-radius: 4px 4px 0 0;
&:hover {
cursor: pointer;
background-color: var(--fd-colors-background-hover);
}
`
: css`
border-radius: 2px;
`}
`;
export const RaceSummaryInfo = styled.div<{ hidden: boolean }>`
display: ${({ hidden }) => (hidden ? "none" : "flex")};
flex-direction: column;
justify-content: center;
@media screen and ${breakpoints.tablet.max.sm} {
display: none;
}
`;
export const ActionsWrapper = styled.div<{
isOnHomePage: boolean;
}>`
width: 100%;
display: flex;
margin-top: auto;
${({ isOnHomePage }) =>
!isOnHomePage
? css`
padding: var(--fd-space-space-3);
& > div {
flex: 1 0 0;
&:not(:first-child) {
margin-left: var(--fd-space-space-3);
}
}
`
: css`
justify-content: space-between;
padding: var(--fd-space-space-3) var(--fd-space-space-3) 0
var(--fd-space-space-3);
`}
`;
export const AmountContainer = styled.div`
display: flex;
&:not(:last-child) {
border-right: 1px solid var(--fd-colors-border-subtle);
}
`;
webpack://frontend-tpt/../../node_modules/date-fns/esm/startOfDay/index.js
import toDate from '../toDate/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
/**
* @name startOfDay
* @category Day Helpers
* @summary Return the start of a day for the given date.
*
* @description
* Return the start of a day for the given date.
* The result will be in the local timezone.
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* @param {Date|Number} date - the original date
* @returns {Date} the start of a day
* @throws {TypeError} 1 argument required
*
* @example
* // The start of a day for 2 September 2014 11:55:00:
* var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 02 2014 00:00:00
*/
export default function startOfDay(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setHours(0, 0, 0, 0);
return date;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/differenceInDays/index.js
import toDate from '../toDate/index.js';
import differenceInCalendarDays from '../differenceInCalendarDays/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js'; // Like `compareAsc` but uses local time not UTC, which is needed
// for accurate equality comparisons of UTC timestamps that end up
// having the same representation in local time, e.g. one hour before
// DST ends vs. the instant that DST ends.
function compareLocalAsc(dateLeft, dateRight) {
var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();
if (diff < 0) {
return -1;
} else if (diff > 0) {
return 1; // Return 0 if diff is 0; return NaN if diff is NaN
} else {
return diff;
}
}
/**
* @name differenceInDays
* @category Day Helpers
* @summary Get the number of full days between the given dates.
*
* @description
* Get the number of full day periods between two dates. Fractional days are
* truncated towards zero.
*
* One "full day" is the distance between a local time in one day to the same
* local time on the next or previous day. A full day can sometimes be less than
* or more than 24 hours if a daylight savings change happens between two dates.
*
* To ignore DST and only measure exact 24-hour periods, use this instead:
* `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`.
*
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* @param {Date|Number} dateLeft - the later date
* @param {Date|Number} dateRight - the earlier date
* @returns {Number} the number of full days according to the local timezone
* @throws {TypeError} 2 arguments required
*
* @example
* // How many full days are between
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
* var result = differenceInDays(
* new Date(2012, 6, 2, 0, 0),
* new Date(2011, 6, 2, 23, 0)
* )
* //=> 365
* // How many full days are between
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
* var result = differenceInDays(
* new Date(2011, 6, 3, 0, 1),
* new Date(2011, 6, 2, 23, 59)
* )
* //=> 0
* // How many full days are between
* // 1 March 2020 0:00 and 1 June 2020 0:00 ?
* // Note: because local time is used, the
* // result will always be 92 days, even in
* // time zones where DST starts and the
* // period has only 92*24-1 hours.
* var result = differenceInDays(
* new Date(2020, 5, 1),
* new Date(2020, 2, 1)
* )
//=> 92
*/
export default function differenceInDays(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign = compareLocalAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));
dateLeft.setDate(dateLeft.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full
// If so, result must be decreased by 1 in absolute value
var isLastDayNotFull = compareLocalAsc(dateLeft, dateRight) === -sign;
var result = sign * (difference - isLastDayNotFull); // Prevent negative zero
return result === 0 ? 0 : result;
}
webpack://frontend-tpt/../../node_modules/date-fns/esm/differenceInCalendarDays/index.js
import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';
import startOfDay from '../startOfDay/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
var MILLISECONDS_IN_DAY = 86400000;
/**
* @name differenceInCalendarDays
* @category Day Helpers
* @summary Get the number of calendar days between the given dates.
*
* @description
* Get the number of calendar days between the given dates. This means that the times are removed
* from the dates and then the difference in days is calculated.
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* @param {Date|Number} dateLeft - the later date
* @param {Date|Number} dateRight - the earlier date
* @returns {Number} the number of calendar days
* @throws {TypeError} 2 arguments required
*
* @example
* // How many calendar days are between
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
* var result = differenceInCalendarDays(
* new Date(2012, 6, 2, 0, 0),
* new Date(2011, 6, 2, 23, 0)
* )
* //=> 366
* // How many calendar days are between
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
* var result = differenceInCalendarDays(
* new Date(2011, 6, 3, 0, 1),
* new Date(2011, 6, 2, 23, 59)
* )
* //=> 1
*/
export default function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var startOfDayLeft = startOfDay(dirtyDateLeft);
var startOfDayRight = startOfDay(dirtyDateRight);
var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);
var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); // Round the number of days to the nearest integer
// because the number of milliseconds in a day is not constant
// (e.g. it's different in the day of the daylight saving time clock shift)
return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
}
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Typography/Paragraph/styled-components.ts
import styled from "styled-components";
import {
space,
system,
compose,
fontFamily,
fontSize,
flex,
layout,
typography,
color
} from "styled-system";
import type { ParagraphProps } from "./types";
const lineHeightNormal = system({
fontSize: {
property: "lineHeight",
scale: "lineHeights"
}
});
const lineHeightTaller = system({
fontSize: {
property: "lineHeight",
scale: "lineHeightsTaller"
}
});
const transformText = system({
textTransform: {
property: "textTransform"
},
whiteSpace: {
property: "whiteSpace"
},
textOverflow: {
property: "textOverflow"
}
});
const styles = compose(
space,
fontFamily,
fontSize,
transformText,
typography,
layout,
color
);
export const StyledParagraph = styled.p<ParagraphProps>`
${({ isLineHigher }) => (isLineHigher ? lineHeightTaller : lineHeightNormal)}
overflow: ${({ textOverflow }) =>
textOverflow === "ellipsis" ? "hidden" : "visible"};
${styles};
${flex}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Typography/utils.ts
export function getColor(color: string): string {
return color.startsWith("--") ? `var(${color})` : color;
}
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Typography/Paragraph/index.tsx
import React, { FC } from "react";
import type { ParagraphProps, ParagraphFonts } from "./types";
import { StyledParagraph } from "./styled-components";
import { getColor } from "../utils";
export const Paragraph: FC<ParagraphProps> = ({
children,
qaLabel,
color = "--fd-colors-content-default",
textOverflow,
...rest
}) => {
const selectedColor = getColor(color);
return (
<StyledParagraph
role="paragraph"
textOverflow={textOverflow}
color={selectedColor}
data-qa-label={qaLabel}
{...rest}
>
{children}
</StyledParagraph>
);
};
export type { ParagraphProps, ParagraphFonts };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Mtp/constants.ts
import type { MtpTheme } from "./types";
export const sizeVariantStyles: MtpTheme = {
xs: {
mtpText: {
fontFamily: "medium",
fontSize: "14px",
fontWeight: "500",
lineHeight: "125%"
},
mtpExtraDates: {
fontFamily: "regular",
fontSize: "14px",
fontWeight: "400",
lineHeight: "125%"
}
},
s: {
mtpText: {
fontFamily: "medium",
fontSize: "18px",
fontWeight: "500",
lineHeight: "125%"
},
mtpExtraDates: {
fontFamily: "condensedRegular",
fontSize: "14px",
fontWeight: "400",
lineHeight: "110%"
}
},
m: {
mtpText: {
fontFamily: "medium",
fontSize: "24px",
fontWeight: "500",
lineHeight: "125%"
},
mtpExtraDates: {
fontFamily: "condensedRegular",
fontSize: "16px",
fontWeight: "400",
lineHeight: "100%"
}
},
xxs: {
mtpText: {
fontFamily: "medium",
fontSize: "14px",
fontWeight: "500",
lineHeight: "125%"
},
mtpExtraDates: {
fontFamily: "regular",
fontSize: "14px",
fontWeight: "400",
lineHeight: "100%"
}
},
l: {
mtpText: {
fontFamily: "regular",
fontSize: "28px",
fontWeight: "500",
lineHeight: "125%"
},
mtpExtraDates: {
fontFamily: "condensedRegular",
fontSize: "16px",
fontWeight: "400",
lineHeight: "100%"
}
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Mtp/styled-components.ts
import styled from "styled-components";
import {
space,
compose,
typography,
system,
color,
fontFamily,
fontSize,
layout,
flex,
alignItems,
flexDirection,
justifyContent,
type TypographyProps
} from "styled-system";
import type { ParagraphProps } from "../Typography";
const transformText = system({
whiteSpace: {
property: "whiteSpace"
}
});
const styles = compose(fontFamily, fontSize, transformText, typography, color);
export const DecoratedResulted = styled.span<ParagraphProps>`
${styles}
${space}
${layout}
${flex}
${alignItems}
${flexDirection}
${justifyContent}
`;
export const MtpWrapper = styled.div`
display: flex;
align-items: center;
${styles}
${space}
`;
export const ProExtensionWrapper = styled.span<TypographyProps>`
letter-spacing: -0.5px;
${fontSize}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Mtp/builder.tsx
/* eslint-disable security/detect-object-injection */
import React from "react";
import { differenceInDays, format, startOfDay } from "date-fns";
import { RaceStatusEnum } from "@tvg/ts-types/Race";
import type { MtpAlign, MtpSizes } from "./types";
import { Paragraph, ParagraphFonts } from "../Typography";
import { sizeVariantStyles } from "./constants";
import { DecoratedResulted, ProExtensionWrapper } from "./styled-components";
// Formatter depending on alignment
const formatter: Record<MtpAlign, Record<string, string>> = {
right: {
extraSmall: "dd MMM yyyy -",
default: "hh:mm a - dd MMM yyyy"
},
left: {
extraSmall: " - dd MMM yyyy",
default: " hh:mm a - dd MMM yyyy"
},
center: {
extraSmall: " - dd MMM yyyy",
default: " hh:mm a - dd MMM yyyy"
}
};
export const getResultedFontFamily = (
size: MtpSizes,
value: ParagraphFonts
) => {
if (size === "l" || size === "m") {
return "bold";
}
return value;
};
// Race off computation
export const GetRaceOffAndOfficialText = (
status: RaceStatusEnum,
size: MtpSizes,
postTime: string,
align: MtpAlign,
qaLabel: string,
mode: "dark" | "light"
) => {
if (status === RaceStatusEnum.RACE_OFF) {
return (
<Paragraph
data-mode={mode}
color="--fd-colors-system-component-mtp-content-race-off"
fontFamily={sizeVariantStyles[size].mtpText.fontFamily}
fontSize={sizeVariantStyles[size].mtpText.fontSize}
fontWeight={sizeVariantStyles[size].mtpText.fontWeight}
lineHeight={sizeVariantStyles[size].mtpText.lineHeight}
textAlign={align}
qaLabel={qaLabel}
margin={0}
>
{size === "xxs" ? "OFF" : "Race Off"}
</Paragraph>
);
}
// Compute format of the race resulted
const today = startOfDay(new Date());
const diffInDays = differenceInDays(new Date(postTime), today);
if (diffInDays > 0 && size !== "xxs") {
const formatParam =
formatter[align][size === "xs" ? "extraSmall" : "default"];
const extraData = format(new Date(postTime), formatParam);
return (
<Paragraph
data-mode={mode}
color="--fd-colors-system-component-mtp-content-resulted"
fontFamily={sizeVariantStyles[size].mtpExtraDates.fontFamily}
fontSize={sizeVariantStyles[size].mtpExtraDates.fontSize}
fontWeight={sizeVariantStyles[size].mtpExtraDates.fontWeight}
lineHeight={sizeVariantStyles[size].mtpExtraDates.lineHeight}
textAlign={align}
qaLabel={qaLabel}
margin={0}
>
{align === "right" && (
<>
<>{extraData}</>
</>
)}
<DecoratedResulted
data-mode={mode}
color="--fd-colors-system-component-mtp-content-resulted"
fontFamily={
["m", "l"].includes(size)
? "bold"
: sizeVariantStyles[size].mtpText.fontFamily
}
fontSize={sizeVariantStyles[size].mtpText.fontSize}
fontWeight={sizeVariantStyles[size].mtpText.fontWeight}
lineHeight={sizeVariantStyles[size].mtpText.lineHeight}
textAlign={align}
margin={0}
>
Resulted
</DecoratedResulted>
{align !== "right" && (
<>
<>{extraData}</>
</>
)}
</Paragraph>
);
}
return (
<Paragraph
data-mode={mode}
color="--fd-colors-system-component-mtp-content-resulted"
fontFamily={getResultedFontFamily(
size,
sizeVariantStyles[size].mtpText.fontFamily
)}
fontSize={sizeVariantStyles[size].mtpText.fontSize}
fontWeight={sizeVariantStyles[size].mtpText.fontWeight}
lineHeight={sizeVariantStyles[size].mtpText.lineHeight}
textAlign={align}
margin={0}
>
{size === "xxs" ? "RES" : "Resulted"}
</Paragraph>
);
};
// More than 60m computation
export const getPostTimeMoreThanSixtyMinutes = (
size: MtpSizes,
postTime: string,
isMtpPro: boolean
) => {
if (size === "xxs") {
const output = format(new Date(postTime), "hh:mm a");
const parts = output.split(" ");
return (
<>
{parts[0]}
<div>{parts[1]}</div>
</>
);
}
const today = startOfDay(new Date());
const diffInDays = differenceInDays(new Date(postTime), today);
if (diffInDays > 0) {
const date = format(new Date(postTime), "MMM dd, hh:mm a");
if (isMtpPro) {
return <ProExtensionWrapper fontSize="18px">{date} </ProExtensionWrapper>;
}
return date;
}
return format(new Date(postTime), "hh:mm a");
};
// compute font weight special cases
export const getWeight = (mtp: number, size: MtpSizes) => {
if ((size === "s" && mtp < 6) || size === "xs" || size === "xxs") {
return 500;
}
return 700;
};
const getFontSize = (size: MtpSizes) => {
if (size === "l") {
return "16px";
}
if (size === "m") {
return "14px";
}
return sizeVariantStyles[size].mtpExtraDates.fontSize;
};
// Less than 60m computation
export const getPostTimeLessThanSixtyMinutes = (
size: MtpSizes,
mtp: number,
align: MtpAlign,
color: string,
mode: "dark" | "light",
isMtpPro = false
) => {
if (size === "xxs") {
return `${mtp}m`;
}
if (["xs", "s"].includes(size)) {
return `${mtp} MTP`;
}
let formatMtp = `${mtp}`;
if (mtp < 9) {
formatMtp = `0${mtp}`;
}
let props = {};
if (isMtpPro) {
props = {
display: "flex",
flexDirection: "column",
justifyContent: "center",
fontSize: getFontSize(size)
};
}
return (
<>
{formatMtp}
<DecoratedResulted
data-mode={mode}
color={`var(${color})`}
fontFamily={sizeVariantStyles[size].mtpExtraDates.fontFamily}
fontSize={sizeVariantStyles[size].mtpExtraDates.fontSize}
fontWeight={sizeVariantStyles[size].mtpExtraDates.fontWeight}
lineHeight={sizeVariantStyles[size].mtpExtraDates.lineHeight}
textAlign={align}
{...props}
>
{isMtpPro ? (
<>
MINUTE{mtp > 1 ? "S" : ""}
<ProExtensionWrapper>TILL POST</ProExtensionWrapper>
</>
) : (
<>MINUTE{mtp > 1 ? "S" : ""} TILL POST</>
)}
</DecoratedResulted>
</>
);
};
// Get variants styles
export const getSizeVariantsStyles = (
size: MtpSizes,
mtp: number,
status: RaceStatusEnum
) => {
const defaultValue = sizeVariantStyles;
if ((size === "s" && mtp < 6) || status === RaceStatusEnum.RACE_OFF) {
defaultValue[size as keyof typeof defaultValue].mtpText.fontFamily = "bold";
defaultValue[size as keyof typeof defaultValue].mtpText.fontWeight = "700";
}
return defaultValue;
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Mtp/index.tsx
/* eslint-disable security/detect-object-injection */
import React from "react";
import { RaceStatusEnum } from "@tvg/ts-types/Race";
import type { MtpProps, FutureRace } from "./types";
import {
getPostTimeLessThanSixtyMinutes,
getPostTimeMoreThanSixtyMinutes,
GetRaceOffAndOfficialText,
getSizeVariantsStyles,
getWeight
} from "./builder";
import { Paragraph } from "../Typography";
import { DecoratedResulted, MtpWrapper } from "./styled-components";
export const Mtp: React.FC<MtpProps> = ({
status,
mtp,
postTime,
size = "s",
align = "left",
qaLabel = "mtp",
mode = "light",
isMtpPro = false,
futureRace = null,
isMobile = false,
...props
}) => {
const sizeVariantStyles = getSizeVariantsStyles(
size,
futureRace ? futureRace.mtp : mtp,
status
);
if (
[RaceStatusEnum.RACE_OFF, RaceStatusEnum.RACE_OFFICIAL].includes(status) &&
!futureRace
) {
return (
<MtpWrapper {...props} data-mode={mode}>
{GetRaceOffAndOfficialText(
status,
size,
postTime,
align,
qaLabel,
mode
)}
</MtpWrapper>
);
}
const decoratedFutureResultProps = {
display: "flex",
flexDirection: "column",
justifyContent: "center",
fontFamily: sizeVariantStyles.m.mtpText.fontFamily,
fontSize: !isMtpPro
? sizeVariantStyles.xs.mtpExtraDates.fontSize
: sizeVariantStyles.m.mtpExtraDates.fontSize,
lineHeight: "125%",
fontWeight: "500"
};
return mtp > 59 || futureRace ? (
<MtpWrapper {...props}>
<Paragraph
data-mode={mode}
color="--fd-colors-system-component-mtp-more-than-six-minutes"
fontSize={sizeVariantStyles[size].mtpText.fontSize}
fontWeight={sizeVariantStyles[size].mtpText.fontWeight}
lineHeight={sizeVariantStyles[size].mtpText.lineHeight}
fontFamily={sizeVariantStyles[size].mtpText.fontFamily}
textAlign={align}
qaLabel={qaLabel}
margin={0}
>
{futureRace && !isMobile && `Next: Leg ${futureRace.raceNumber} - `}
{futureRace && isMobile ? (
<DecoratedResulted {...decoratedFutureResultProps}>
Next:
{!isMtpPro ? (
` Leg ${futureRace.raceNumber}`
) : (
<span>Leg {futureRace.raceNumber}</span>
)}
</DecoratedResulted>
) : (
getPostTimeMoreThanSixtyMinutes(
size,
futureRace ? futureRace.postTime : postTime,
isMtpPro
)
)}
</Paragraph>
</MtpWrapper>
) : (
<MtpWrapper {...props}>
<Paragraph
data-mode={mode}
color={
mtp < 6
? "--fd-colors-system-component-mtp-less-than-six-minutes"
: "--fd-colors-system-component-mtp-more-than-six-minutes"
}
fontFamily={sizeVariantStyles[size].mtpText.fontFamily}
fontSize={sizeVariantStyles[size].mtpText.fontSize}
fontWeight={getWeight(mtp, size)}
lineHeight={sizeVariantStyles[size].mtpText.lineHeight}
textAlign={align}
qaLabel={qaLabel}
margin={0}
display={isMtpPro ? "flex" : ""}
>
{getPostTimeLessThanSixtyMinutes(
size,
mtp,
align,
mtp < 6
? "--fd-colors-system-component-mtp-less-than-six-minutes"
: "--fd-colors-system-component-mtp-more-than-six-minutes",
mode,
isMtpPro
)}
</Paragraph>
</MtpWrapper>
);
};
export type { MtpProps, FutureRace };
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/components/TalentPicksCard/MtpBody/styled-components.ts
import styled from "styled-components";
export const Container = styled.div`
display: ${({ hidden }) => (hidden ? "none" : "flex")};
align-items: center;
margin: ${({ theme }) => theme.space["space-4"]}
${({ theme }) => theme.space["space-4"]} 0;
`;
export const TrackNameWrapper = styled.div`
max-width: 157px;
overflow: hidden;
text-overflow: ellipsis;
margin-left: ${({ theme }) => theme.space["space-3"]};
`;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/components/TalentPicksCard/MtpBody/index.tsx
import React, { FC } from "react";
import { TalentPickData } from "@tvg/ts-types/TalentPicks";
import { RaceStatusEnum } from "@tvg/ts-types/Race";
import { Paragraph, useColorTokens } from "@tvg/design-system";
import { Mtp } from "@tvg/design-system/web";
import { Container, TrackNameWrapper } from "./styled-components";
interface MtpBodyProps {
hidden?: boolean;
qaLabel: string;
talentPick: TalentPickData;
}
const MtpBody: FC<MtpBodyProps> = ({ hidden, qaLabel, talentPick }) => {
const colorTokens = useColorTokens();
const {
mtp,
raceStatus,
race: raceNumber,
trackName,
racePostTime
} = talentPick;
return (
<Container data-qa-label={qaLabel} hidden={hidden}>
<Mtp
mtp={+mtp}
status={raceStatus as RaceStatusEnum}
postTime={racePostTime}
size="xs"
/>
<TrackNameWrapper>
<Paragraph
qaLabel="mtp-track-name"
whiteSpace="nowrap"
color={colorTokens.content.subtle}
>
{trackName}
</Paragraph>
</TrackNameWrapper>
<Paragraph qaLabel="mtp-race-number">{` - R${raceNumber}`}</Paragraph>
</Container>
);
};
export default MtpBody;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/components/TalentPicksCard/helpers.ts
import { RaceTypeCodeEnum } from "@tvg/ts-types/Race";
import { VisualSelection } from "@tvg/ts-types/Selections";
import { getRunnerColors } from "@tvg/design-system";
export const getVisualSelections = (
pickSelections: Array<string> | Array<Array<string>>,
raceType: RaceTypeCodeEnum
): Array<VisualSelection> | Array<Array<VisualSelection>> =>
pickSelections.map((selection) =>
Array.isArray(selection)
? (getVisualSelections(selection, raceType) as unknown as VisualSelection)
: {
number: selection,
...getRunnerColors(
selection,
raceType === RaceTypeCodeEnum.HARNESS ? "harness" : "thoroughbred"
)
}
);
export const isProgramPage = (): boolean => {
if (window !== undefined) {
const { pathname } = window.location;
return pathname.includes("/racetracks");
}
return false;
};
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/utils/amplitude/index.ts
import mediator from "@tvg/mediator";
import {
EVENTS,
MODULE,
FILTER,
LINK_TEXT
} from "@urp/amplitude/src/modules/talentPicks/constants";
import { TPTModule } from "@urp/amplitude/src/modules/talentPicks/types";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import { isProgramPage } from "../../components/TalentPicksCard/helpers";
interface Payload {
module?: TPTModule | "Race Card";
talentName?: string;
trackName?: string;
raceNumber?: number;
wagerTypeCode?: WagerTypeCodesEnum;
cardPosition?: number;
raceURL?: string;
linkText?: (typeof LINK_TEXT)[keyof typeof LINK_TEXT];
betTotal?: string;
filterName?: (typeof FILTER)[keyof typeof FILTER];
filterLabel?: string;
selectionSource?: string;
}
export const triggerAmplitudeEvent = (event: string, payload: Payload = {}) => {
const {
module,
raceURL,
linkText,
talentName,
trackName,
raceNumber,
wagerTypeCode,
cardPosition,
betTotal,
filterName,
filterLabel,
selectionSource
} = payload;
switch (event) {
case EVENTS.CARD_CLICKED:
mediator.base.dispatch({
type: "TALENT_PICKS_CARD_CLICKED",
payload: {
module,
raceURL,
linkText,
talentName,
trackName,
raceNumber,
wagerTypeCode,
cardPosition: (cardPosition as number) + 1
}
});
break;
case EVENTS.ADD_TO_BETSLIP:
mediator.base.dispatch({
type: "TALENT_PICKS_ADD_TO_BETSLIP",
payload: {
module,
selectionSource,
talentName,
trackName,
raceNumber,
wagerTypeCode,
cardPosition: (cardPosition as number) + 1,
betTotal
}
});
break;
case EVENTS.CTA_CLICKED:
mediator.base.dispatch({ type: "TALENT_PICKS_CTA_CLICKED" });
break;
case EVENTS.FILTERS_APPLIED:
mediator.base.dispatch({
type: "TALENT_PICKS_FILTERS_APPLIED",
payload: {
filterName,
filterLabel
}
});
break;
case EVENTS.EMPTY_STATE_VIEWED:
mediator.base.dispatch({
type: "TALENT_PICKS_EMPTY_STATE_VIEWED"
});
break;
default:
return null;
}
return null;
};
export const getModule = (pathname: string) => {
if (pathname === "/" || pathname === "/home") {
return MODULE.HOME;
}
if (isProgramPage()) {
return MODULE.RACE_CARD;
}
return MODULE.PICKS_PAGE;
};
webpack://frontend-tpt/../../packages/tvg-lib-utils/talentPicksUtils.js
import { reduce, get } from "lodash";
export const mapSelections = (selections) =>
(selections ?? []).map((selection) =>
selection.map((runner) => get(runner, "order", "").toString())
);
export const mapSelectionsToString = (selections) =>
(selections ?? [])
.map((selection) => selection.map((runner) => runner).join(","))
.join("-");
export const mapTalentPickFromGraph = (pick) => ({
id: pick.id,
selections: mapSelections(pick.selections),
favorites: mapSelections(pick.favorites),
amount: pick.amount,
price: pick.price,
wagerType: {
id: pick.wagerType.type.id,
abbreviation: pick.wagerType.type.code,
legCount: pick.wagerType.legCount,
isBox: pick.wagerType.isBox,
isKey: pick.wagerType.isKey,
isWheel: pick.wagerType.isWheel
},
track: pick.race.track.code,
trackName: pick.race.track.name,
race: +pick.race.number,
raceId: pick.race.id,
raceType: pick.race.type.code,
raceStatus: pick.race.status.code,
talent: pick.talent,
published: pick.published ?? true,
racePostTime: pick.race.postTime,
mtp: pick.race.mtp,
highlighted: pick.race.highlighted
});
export const mapTalentPickFromService = (pick) => ({
...pick,
selections: mapSelections(pick.selections),
favorites: mapSelections(pick.favorites)
});
export const mapTalentPicksListFromGraph = (talentPicks) =>
reduce(
talentPicks,
(list, pick) => {
list.push(mapTalentPickFromGraph(pick));
return list;
},
[]
);
export const mapTalentPicksListFromService = (talentPicks) =>
reduce(
talentPicks,
(list, pick) => {
list.push(mapTalentPickFromService(pick));
return list;
},
[]
);
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/types.ts
import { Dispatch } from "redux";
import { Location, History } from "history";
import { UnaryFn, BinaryFn, NullaryFn } from "@tvg/ts-types/Functional";
import {
RaceInfoMyBets,
RaceStatusEnum,
BettingInterest,
PickBetFavorite,
RaceProgram
} from "@tvg/ts-types/Race";
import { BetSelection, BetBasicInfo, BetStatus } from "@tvg/ts-types/Bet";
import { ApolloClient, NormalizedCacheObject } from "@apollo/client";
import { WroWager, WroWagerGroup } from "@tvg/ts-types/WroWager";
import { Selections } from "@tvg/ts-types/Selections";
import { NavigationLayoutType } from "@tvg/ts-types/Generic";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
export enum ActiveTabEnum {
ACTIVE = "ACTIVE",
SETTLED = "SETTLED",
FUTURES = "FUTURES"
}
export enum SettledTabEnum {
TODAY = "TODAY",
YESTERDAY = "YESTERDAY",
LAST_WEEK = "LAST_WEEK",
LAST_MONTH = "LAST_MONTH"
}
export enum MyBetsPastPerformanceTab {
BETS = "bets",
RESULTS = "results",
FULL_RESULT = "fullresult",
RACECARD = "racecard"
}
export interface MyBetsDynamicFilter {
name: string;
code: string;
isActive: boolean;
}
export type MyBetsDynamicFilters = MyBetsDynamicFilter[];
export interface QueryTrackFilter {
name: string;
code: string;
}
export interface QueryBetTypeFilter {
id: number;
name: string;
code: string;
}
export interface GraphWagerType {
type: {
code: string;
};
isKey: boolean;
isBox: boolean;
isWheel: boolean;
legCount: number;
positionCount: number;
columnCount: number;
}
export interface GraphResponse {
raceDate: string;
wagerTypes: GraphWagerType[];
races: RaceInfoMyBets[];
subscribeToMore: UnaryFn<unknown, void>;
loading: boolean;
networkStatus: number;
refetch: UnaryFn<unknown, void>;
}
export interface ActiveBetsInfoType {
bets?: WroWagerGroup[];
totalBets?: number;
totalAmount?: number;
}
export interface BetCancelResult {
status?: "success" | "failure" | "aborted";
errorCode?: string;
}
export interface OnBetCancelClosePayload {
result?: BetCancelResult;
}
export interface StatusFilters {
Cancelled: boolean;
Won: boolean;
Refunded: boolean;
Lost: boolean;
}
export interface BetCancelRedux {
betAmount?: number;
betsNumber?: number;
bettingInterests?: number[];
cancelRequestError?: unknown;
dateDiff?: number;
index?: number;
isGreyhound?: boolean;
isLoading?: boolean;
isOpen?: boolean;
mtp?: number;
queryError?: unknown;
raceNumber?: string;
racePostTime?: string;
result?: BetCancelResult;
statusCode?: RaceStatusEnum;
trackCode?: string;
trackName?: string;
wager?: WroWager;
winningsAmount?: number;
}
interface RulesMessage {
text: string;
title?: string;
}
export interface ExternalProps {
behgClient?: ApolloClient<NormalizedCacheObject>;
isDesktop: boolean;
accountNumber: string;
}
export interface Props {
dispatch: Dispatch;
location: Location;
history: History;
device: "mobile" | "tablet" | "desktop";
isLogged: boolean;
accountNumber: string;
behgClient?: ApolloClient<NormalizedCacheObject>;
fcpClient?: ApolloClient<NormalizedCacheObject>;
totalActiveBets: number;
totalFutureBets: number;
totalSettledBets: number;
activeWageredAmount: number;
futureWageredAmount: number;
settledWageredAmount: number;
selectedTab: ActiveTabEnum;
selectedSettledTab: SettledTabEnum;
// Graph types
isLoadingGraph: boolean;
subscribeToMore: UnaryFn<unknown, void>;
subscribeToMoreGraph: UnaryFn<unknown, void>;
queryBets: ActiveBetsInfoType;
races: RaceInfoMyBets[];
// Conditional for dates fix in IOS
betCancel: BetCancelRedux;
raceDate: string;
isMyBetsModalOpen: boolean;
wagerCancellationModal: {
isOpen: boolean;
hasBack: boolean;
};
trackRulesModal: {
isOpen: boolean;
betType: string;
};
userLocation: string;
cancelRulesMessages: Record<string, Array<RulesMessage>>;
cancelLimitationsByState?: string;
// Race Results
trackRulesMessages: string;
fetchMore: BinaryFn<UnaryFn<boolean, void>, number, void>;
isLoadingBehg: boolean;
myBetsPaginationConf: {
wagersPerPage: number;
intersectionWagerPercentage: number;
};
modalScrollableRef: HTMLDivElement;
isMyBetsPastPerformanceOpen: boolean;
isLoading: boolean;
isLoadingActiveTotals: boolean;
isLoadingSettledTotals: boolean;
scrollYPosition: number;
customStartDate?: string;
customEndDate?: string;
statusFilters?: StatusFilters;
refetchSettled?: NullaryFn<void>;
trackFilters?: MyBetsDynamicFilters;
betTypeFilters?: MyBetsDynamicFilters;
wagerProfile: string;
isCustomTimeFrame?: boolean;
isDesktop?: boolean;
redirectWithoutActiveBetsToggle?: boolean;
isDefaultSettled: boolean;
isDefaultFuture: boolean;
statusFilterCount: number;
trackFilterCount: number;
betTypeFilterCount: number;
queryTrackList: Array<QueryTrackFilter & QueryBetTypeFilter>;
wagerTypeFilter: Array<QueryTrackFilter & QueryBetTypeFilter>;
}
export interface BetCanceDataCommonInfo {
trackCode: string;
trackName: string;
raceNumber: number;
isGreyhound: boolean;
racePostTime: string;
mtp: number;
statusCode: RaceStatusEnum;
betsNumber: number;
betAmount: number;
dateDiff: number;
winningsAmount: number;
bettingInterests: BettingInterest[][];
}
export interface OnBetCancelPayload {
bet: WroWagerGroup;
wager: WroWager;
hasBackgroundModal?: boolean;
}
export interface OnRacePageBetCancelPayload {
bet: { value: string; wagers: Array<BetBasicInfo> };
wager: BetBasicInfo;
}
export type OnCancelFunction = UnaryFn<OnBetCancelPayload, void>;
export interface SafeJSONParseArg<T = Object> {
defaultValue: T;
jsonToParse: string;
}
export interface StartTimerArgs {
time: number;
fn: NullaryFn<void>;
}
export interface MyBetsBaseGtm {
selectedTab?: string;
selectedSettledTab?: string;
show?: boolean;
activeBetsCount?: number;
settledBetsCount?: number;
futureBetsCount?: number;
previousSelectedTab?: string;
}
export interface OnWatchReplayEvent {
trackName: string;
raceNumber: number;
index: number;
}
export type BetComboHash = Record<string, number>;
export type ProbableValueList = number[];
export interface PotentialReturn {
betSelections: string[][];
betCombosHash: Record<string, number>;
minWagerAmount: number;
betAmount: number;
wagerTypeId?: number;
}
export interface CheckRaceStatus {
isAllRunnersScratched: boolean;
legContainsScratch: boolean;
isMultiRace: boolean;
selectionIndex: number;
selection: BetSelection[] | Selections[];
races: RaceInfoMyBets[];
raceNumber: number;
selectionLength: number;
isCanceled: boolean;
betStatusName?: string;
wagerType: string;
favoriteRunner?: PickBetFavorite;
shouldShowReplacement: boolean;
}
export interface CheckSelectionLabel {
raceNumber: number;
selectionLength: number;
selectionIndex: number;
selectionsModifier?: string;
isMultiRace: boolean;
isKey?: boolean;
isBox?: boolean;
isDesktop?: boolean;
isSpecialWager?: boolean;
}
export type MyBetsCounterType = { counter: number; amount: number };
type FooterLinkType = {
name: string;
href: string;
onClick?: NullaryFn<unknown>;
};
export interface FooterProps {
dispatch: Dispatch;
isLogged: boolean;
accountNumber: string;
totalActiveBets: number;
links: FooterLinkType[];
activePath: string;
layout: NavigationLayoutType;
behgClient: ApolloClient<NormalizedCacheObject>;
subscribeToMore: UnaryFn<unknown, void>;
selectedTab: ActiveTabEnum;
selectedSettledTab: SettledTabEnum;
subscribeToMoreSettled: UnaryFn<unknown, void>;
refetchSettled: NullaryFn<void>;
activeBetsCounter: number;
isCustomTimeFrame?: boolean;
customStartDate?: Date;
customEndDate?: Date;
}
export interface SelectedFilters {
statusFilters?: StatusFilters;
trackFilters?: MyBetsDynamicFilters;
betTypeFilters?: MyBetsDynamicFilters;
}
export type OnBetSocialSharePayload = {
bet: WroWagerGroup;
wager: WroWager;
currentRace?: RaceProgram;
repeatButtonSearch?: string;
isMyBets?: boolean;
};
export interface WagerGroup {
betStatus: BetStatus;
tvgRaceId: number;
trackCode?: string;
}
export interface WagerHistory {
id: string;
futureWagersList: {
totals: {
totalCount: number;
totalAmount: number;
};
};
totals: {
totalBets: number;
totalAmount: number;
totalGambledCount: number;
totalGambledAmount: number;
};
groupWagers?: {
wagers: WagerGroup[];
}[];
}
export interface WagerHistoryProps {
wagerHistory: WagerHistory;
}
export interface BetsType {
totalActiveBets?: number;
totalFutureBets?: number;
activeWageredAmount?: number;
futureWageredAmount?: number;
}
export type XsellBlacklistedBets = {
blacklistedBets: [WagerTypeCodesEnum];
};
webpack://frontend-tpt/../../packages/sh-lib-my-bets/redux/reducers.ts
import { RaceInfoMyBets } from "@tvg/ts-types/Race";
import { WroWager, WroWagerGroup } from "@tvg/ts-types/WroWager";
import { BetBasicInfo } from "@tvg/ts-types/Bet";
import { Actions, SelectedRace } from "./actions";
import {
ActiveTabEnum,
SettledTabEnum,
StatusFilters,
MyBetsDynamicFilters,
MyBetsPastPerformanceTab
} from "../utils/types";
export interface ActiveBets {
totalBets: number;
totalAmount: number;
bets: WroWagerGroup[];
}
export interface BetCancelModal {
isOpen?: boolean;
wager?: WroWager | BetBasicInfo;
races?: RaceInfoMyBets[];
isLoading?: boolean;
result?: {
status?: "success" | "failure" | "aborted";
errorCode?: string;
};
cancelRequestError?: unknown;
hasBackgroundModal?: boolean;
queryError?: null;
}
export interface BetSocialShareModal {
isOpen?: boolean;
wager?: WroWager;
races?: RaceInfoMyBets[];
isLoading?: boolean;
}
export interface WagerCancellationModal {
isOpen: boolean;
hasBack: boolean;
}
export interface TrackRulesModal {
isOpen: boolean;
betType: string;
alternates?: boolean;
}
export interface State {
isOpen: boolean;
activeBets: ActiveBets;
selectedTab: ActiveTabEnum;
selectedSettledTab: SettledTabEnum;
totalActiveBets: number;
totalSettledBets: number;
totalFutureBets: number;
deletedBets: string[];
isLoading: boolean;
betCancelModal: BetCancelModal;
betSocialShareModal: BetSocialShareModal;
approxPayoutModal: {
isOpen?: boolean;
};
wagerCancellationModal: WagerCancellationModal;
trackRulesModal: TrackRulesModal;
pastPerformance: {
isOpen: boolean;
selectedRace: SelectedRace | {};
modalTitle?: string;
selectedTab: MyBetsPastPerformanceTab;
hasBack: boolean;
races?: RaceInfoMyBets[];
};
activeWageredAmount: number;
settledWageredAmount: number;
futureWageredAmount: number;
statusFilters: StatusFilters;
statusFilterCount: number;
trackFilters: MyBetsDynamicFilters;
trackFilterCount: number;
betTypeFilters: MyBetsDynamicFilters;
betTypeFilterCount: number;
customStartDate?: Date | null;
customEndDate: Date | null;
isCustomTimeFrame: boolean;
shouldDefaultToSettled: boolean;
shouldDefaultToFuture: boolean;
racesActiveBets: Record<number, number>;
}
const initialMyBetsIPP = {
isOpen: false,
selectedRace: {},
modalTitle: "My Bets",
selectedTab: MyBetsPastPerformanceTab.FULL_RESULT,
hasBack: true,
races: []
};
export const initialState: State = {
isOpen: false,
activeBets: {
totalBets: 0,
totalAmount: 0,
bets: []
},
selectedTab: ActiveTabEnum.SETTLED,
selectedSettledTab: SettledTabEnum.TODAY,
totalActiveBets: 0,
totalSettledBets: 0,
totalFutureBets: 0,
deletedBets: [],
isLoading: false,
betCancelModal: {
isOpen: false,
hasBackgroundModal: false
},
betSocialShareModal: {
isOpen: false
},
approxPayoutModal: {
isOpen: false
},
wagerCancellationModal: {
isOpen: false,
hasBack: false
},
trackRulesModal: {
isOpen: false,
betType: "",
alternates: false
},
pastPerformance: {
...initialMyBetsIPP
},
activeWageredAmount: 0,
settledWageredAmount: 0,
futureWageredAmount: 0,
statusFilters: {
Cancelled: false,
Won: false,
Lost: false,
Refunded: false
},
statusFilterCount: 0,
trackFilters: [],
trackFilterCount: 0,
betTypeFilters: [],
betTypeFilterCount: 0,
customStartDate: null,
customEndDate: null,
isCustomTimeFrame: false,
shouldDefaultToSettled: true,
shouldDefaultToFuture: false,
racesActiveBets: {}
};
export default function reducer(
// eslint-disable-next-line
state: State = initialState,
action: Actions
): State {
switch (action.type) {
case "OPEN_MYBETS_STANDALONE":
return { ...state, isOpen: true };
case "CLOSE_MYBETS_STANDALONE":
return {
...state,
isOpen: false,
pastPerformance: {
...initialMyBetsIPP
}
};
case "SET_ACTIVE_BETS_MYBETS_STANDALONE":
return {
...state,
activeBets: {
...state.activeBets,
...action.payload
}
};
case "SET_SELECTED_TAB_MYBETS_STANDALONE":
return { ...state, selectedTab: action.payload };
case "SET_SELECTED_SETTLED_TAB_MYBETS_STANDALONE":
return { ...state, selectedSettledTab: action.payload };
case "SET_RACES_ACTIVE_BETS_STANDALONE":
return { ...state, racesActiveBets: action.payload };
case "SET_COUNTER_MYBETS_STANDALONE":
if (action.payload === state.totalActiveBets) return state;
return { ...state, totalActiveBets: action.payload };
case "SET_SETTLED_COUNTER_MYBETS_STANDALONE":
if (action.payload === state.totalSettledBets) return state;
return { ...state, totalSettledBets: action.payload };
case "SET_ACTIVE_WAGERED_AMOUNT_MYBETS_STANDALONE":
if (action.payload === state.activeWageredAmount) return state;
return { ...state, activeWageredAmount: action.payload };
case "SET_SETTLED_WAGERED_AMOUNT_MYBETS_STANDALONE":
if (action.payload === state.settledWageredAmount) return state;
return { ...state, settledWageredAmount: action.payload };
case "SET_FUTURE_WAGERED_AMOUNT_MYBETS_STANDALONE":
if (action.payload === state.futureWageredAmount) return state;
return { ...state, futureWageredAmount: action.payload };
case "SET_FUTURE_COUNTER_MYBETS_STANDALONE":
if (action.payload === state.totalFutureBets) return state;
return { ...state, totalFutureBets: action.payload };
case "SET_SHOULD_DEFAULT_TO_SETTLED":
return {
...state,
shouldDefaultToSettled: action.payload.isDefaultSettled,
selectedTab:
!state.isOpen && state.totalActiveBets
? ActiveTabEnum.ACTIVE
: state.selectedTab
};
case "SET_SHOULD_DEFAULT_TO_FUTURE":
return {
...state,
shouldDefaultToFuture: action.payload.isDefaultFuture,
selectedTab:
!state.isOpen && action.payload.isDefaultFuture
? ActiveTabEnum.FUTURES
: state.selectedTab
};
case "MY_BETS_UPDATING_RACES":
return {
...state,
betCancelModal: {
...state.betCancelModal,
races: action.payload
},
pastPerformance: {
...state.pastPerformance,
races: action.payload
}
};
case "OPEN_BET_CANCEL_MODAL": {
const { betCancelModal } = state;
return {
...state,
betCancelModal: {
...betCancelModal,
...action.payload,
isLoading: false,
isOpen: true
}
};
}
case "CLOSE_BET_CANCEL_MODAL": {
const { betCancelModal } = state;
return {
...state,
betCancelModal: {
...betCancelModal,
...action.payload,
isOpen: false
}
};
}
case "OPEN_BET_SOCIAL_SHARE_MODAL": {
const { betSocialShareModal } = state;
return {
...state,
betSocialShareModal: {
...betSocialShareModal,
...action.payload,
isLoading: false,
isOpen: true
}
};
}
case "CLOSE_BET_SOCIAL_SHARE_MODAL": {
return {
...state,
betSocialShareModal: {
isOpen: false
}
};
}
case "LOADING_BET_CANCEL_MODAL_ON": {
const { betCancelModal } = state;
betCancelModal.isLoading = true;
return {
...state,
betCancelModal
};
}
case "LOADING_BET_CANCEL_MODAL_OFF": {
const { betCancelModal } = state;
betCancelModal.isLoading = false;
return {
...state,
betCancelModal
};
}
case "LOADING_BET_CANCEL_MODAL_ERROR": {
const { betCancelModal } = state;
betCancelModal.isLoading = false;
betCancelModal.cancelRequestError = action.payload;
return {
...state,
betCancelModal
};
}
case "CLEAN_BET_CANCEL_RESULT": {
const { betCancelModal } = state;
betCancelModal.result = {};
betCancelModal.cancelRequestError = null;
betCancelModal.queryError = null;
return {
...state,
betCancelModal
};
}
case "OPEN_APPROX_PAYOUT_MODAL": {
return {
...state,
approxPayoutModal: {
isOpen: true
}
};
}
case "CLOSE_APPROX_PAYOUT_MODAL": {
return {
...state,
approxPayoutModal: {
isOpen: false
}
};
}
case "OPEN_WAGER_CANCELLATION_RULES_MODAL": {
return {
...state,
wagerCancellationModal: {
isOpen: true,
hasBack: action.payload.hasBack
}
};
}
case "CLOSE_WAGER_CANCELLATION_RULES_MODAL": {
return {
...state,
wagerCancellationModal: {
isOpen: false,
hasBack: false
}
};
}
case "OPEN_TRACK_RULES_MODAL": {
return {
...state,
trackRulesModal: {
isOpen: true,
betType: action.payload.betType,
alternates: action.payload.alternates
}
};
}
case "CLOSE_TRACK_RULES_MODAL": {
return {
...state,
trackRulesModal: {
isOpen: false,
betType: "",
alternates: false
}
};
}
case "CLOSE_MYBETS_PAST_PERFORMANCE": {
return {
...state,
pastPerformance: {
...initialMyBetsIPP
}
};
}
case "OPEN_MYBETS_PAST_PERFORMANCE": {
return {
...state,
pastPerformance: {
...state.pastPerformance,
isOpen: true,
selectedRace: action.payload.selectedRace,
modalTitle: action.payload.modalTitle || initialMyBetsIPP.modalTitle,
selectedTab:
action.payload.selectedTab || state.pastPerformance.selectedTab,
hasBack: action.payload.hasBack
}
};
}
case "IS_LOADING_MYBETS": {
return {
...state,
isLoading: action.payload.isLoading
};
}
default: {
return state;
}
case "SELECT_MYBETS_STATUS_FILTERS": {
return {
...state,
statusFilters: action.payload.statusFilter
};
}
case "CLEAR_MYBETS_STATUS_FILTERS": {
return {
...state,
statusFilters: initialState.statusFilters
};
}
case "SET_MYBETS_STATUS_FILTER_COUNT": {
return {
...state,
statusFilterCount: action.payload.count
};
}
case "SELECT_MYBETS_TRACKS_FILTERS": {
return {
...state,
trackFilters: action.payload.trackFilter
};
}
case "SET_MYBETS_TRACKS_FILTER_COUNT": {
return {
...state,
trackFilterCount: action.payload.count
};
}
case "SET_MYBETS_BET_TYPE_FILTERS": {
return {
...state,
betTypeFilters: action.payload.betTypeFilter
};
}
case "SET_MYBETS_BET_TYPE_FILTER_COUNT": {
return {
...state,
betTypeFilterCount: action.payload.count
};
}
case "SET_MYBETS_CUSTOM_END_DATE": {
return {
...state,
customEndDate: action.payload.date
};
}
case "SET_MYBETS_CUSTOM_START_DATE": {
return {
...state,
customStartDate: action.payload.date
};
}
case "SET_MYBETS_IS_CUSTOM_TIMEFRAME": {
return {
...state,
isCustomTimeFrame: action.payload.isCustomTimeFrame
};
}
}
}
webpack://frontend-tpt/../../packages/sh-lib-my-bets/redux/selectors.ts
import { Store } from "redux";
import { get } from "lodash";
import parseCAPIMessage from "@tvg/utils/capiUtils";
import { WroWager, WroWagerGroup } from "@tvg/ts-types/WroWager";
import { RaceInfoMyBets, RaceProgram } from "@tvg/ts-types/Race";
import { XsellHeaderMessage } from "@urp/my-bets/components/modals/mybets/alertXsell/types";
import {
BetCancelModal,
initialState,
TrackRulesModal,
WagerCancellationModal
} from "./reducers";
import {
ActiveTabEnum,
BetCancelResult,
MyBetsDynamicFilters,
SettledTabEnum,
StatusFilters,
XsellBlacklistedBets
} from "../utils/types";
// Feature Toggles
export const getMyBetsCounterToggle = (store: Store): boolean =>
get(store, "capi.featureToggles.myBetsCounterToggle", false);
export const getWatchReplayWithinMyBets = (store: Store): boolean =>
get(store, "capi.featureToggles.watchReplayWithinMyBets", false);
export const getShowSeeResult = (store: Store): boolean =>
get(store, "capi.featureToggles.showSeeResult", false);
export const getMyBetsTrackRulesToggle = (store: Store): boolean =>
get(store, "capi.featureToggles.myBetsTrackRules", false);
export const getRedirectWithoutActiveBetsToggle = (store: Store): boolean =>
get(store, "capi.featureToggles.redirectWithoutActiveBetsToggle", false);
export const getSocialShareToggle = (store: Store): boolean =>
get(store, "capi.featureToggles.betSocialShareModalFlow", false);
export const getBetCancelModalToggle = (store: Store): boolean =>
get(store, "capi.featureToggles.betCancelModalFlow", false);
export const getMyBetsResultedBetTicketToggle = (store: Store): boolean =>
get(store, "capi.featureToggles.myBetsResultedBetTicket", false);
// End feature toggles
export const getIsMyBetsOpen = (store: Store): boolean =>
get(store, "myBetsStandalone.isOpen", initialState.isOpen);
export const getRacesActiveBets = (store: Store): Record<number, number> =>
get(store, "myBetsStandalone.racesActiveBets", initialState.racesActiveBets);
export const getSelectedTab = (store: Store): ActiveTabEnum =>
get(store, "myBetsStandalone.selectedTab", initialState.selectedTab);
export const getSelectedSettledTab = (store: Store): SettledTabEnum =>
get(
store,
"myBetsStandalone.selectedSettledTab",
initialState.selectedSettledTab
);
export const getTotalActiveBets = (store: Store): number =>
get(store, "myBetsStandalone.totalActiveBets", initialState.totalActiveBets);
export const getTotalSettledBets = (store: Store): number =>
get(
store,
"myBetsStandalone.totalSettledBets",
initialState.totalSettledBets
);
export const getBetCancel = (store: Store): BetCancelModal | undefined =>
get(store, "myBetsStandalone.betCancelModal");
export const getBetCancelWager = (store: Store): WroWager | undefined =>
get(store, "myBetsStandalone.betCancelModal.wager");
export const getBetCancelRaceNumber = (store: Store): number | undefined =>
get(store, "myBetsStandalone.betCancelModal.raceNumber");
export const getBetCancelIsLoadingBetCancelRequest = (
store: Store
): boolean | undefined =>
get(store, "myBetsStandalone.betCancelModal.isLoading");
export const getBetCancelRequestError = (store: Store): unknown | undefined =>
get(store, "myBetsStandalone.betCancelModal.cancelRequestError");
export const getBetCancelIsLoadingRequest = (
store: Store
): boolean | undefined =>
get(store, "myBetsStandalone.betCancelModal.isLoading");
export const getBetCancelIsOpen = (store: Store): boolean =>
get(store, "myBetsStandalone.betCancelModal.isOpen", false);
export const getBetCancelNotification = (
store: Store
): BetCancelResult | undefined =>
get(store, "myBetsStandalone.betCancelModal.result");
export const getBetSocialShareIsOpen = (store: Store): boolean =>
get(store, "myBetsStandalone.betSocialShareModal.isOpen", false);
export const getBetSocialShareWager = (store: Store): WroWager =>
get(store, "myBetsStandalone.betSocialShareModal.wager");
export const getBetSocialSelectionsUrl = (store: Store): string =>
get(store, "myBetsStandalone.betSocialShareModal.repeatButtonSearch");
export const getBetSocialShareBet = (store: Store): Array<WroWagerGroup> =>
get(store, "myBetsStandalone.betSocialShareModal.bet");
export const getBetSocialShareModule = (store: Store): boolean =>
get(store, "myBetsStandalone.betSocialShareModal.isMyBets");
export const getBetSocialCurrentRace = (store: Store): RaceProgram =>
get(store, "myBetsStandalone.betSocialShareModal.currentRace");
export const getBetSocialShareMessage = (store: Store): string =>
get(store, "capi.messages.Homepage.betSocialSharingMessage", "");
export const getWebBetSocialShareMessage = (store: Store): string =>
get(store, "capi.messages.betSocialSharingMessage", "");
export const getTrackRulesModalTitleMessage = (store: Store): string =>
get(store, "capi.messages.trackRulesModalTitleLabel", "Scratch Rules");
export const getBetCancelRaces = (store: Store): Array<RaceInfoMyBets> =>
get(store, "myBetsStandalone.betCancelModal.races");
export const getBetCancelLimitations = (store: Store): string | undefined =>
get(store, "capi.messages.myBetsCancelLimitations");
export const getBetCancelLimitationsByState = (
store: Store
): string | undefined =>
get(store, "capi.messages.myBetsCancelLimitationsByState");
export const getFeatureUseTvgPotReturn = (store: Store): boolean =>
get(store, "capi.featureToggles.useTvgPotReturn", false);
export const getIsWagerCancellationRulesModalOpen = (
store: Store
): WagerCancellationModal =>
get(
store,
"myBetsStandalone.wagerCancellationModal",
initialState.wagerCancellationModal
);
export const getIsTrackRulesModalOpen = (store: Store): TrackRulesModal =>
get(store, "myBetsStandalone.trackRulesModal", initialState.trackRulesModal);
export const getPickBetRebetToggle = (store: Store): boolean =>
get(store, "capi.featureToggles.enablePickBetRebetMyBetsStandalone", false);
export const enableRepeatBetsMyBets = (store: Store): boolean =>
get(store, "capi.featureToggles.enableRepeatBetsMyBets", false);
export const getFeatureIsMTPNewRules = (store: Store): boolean =>
get(store, "capi.featureToggles.MTPColoursRules", true);
export const getShowMyBetsCardDesign = (store: Store): boolean =>
get(store, "capi.featureToggles.showMyBetsCardDesign", false);
export const getTodayActiveCounter = (store: Store): number =>
get(store, "myBetsStandalone.totalActiveBets", 0);
export const getTodaySettledCounter = (store: Store): number =>
get(
store,
"myBetsStandalone.totalSettledBets",
initialState.totalSettledBets
);
export const getTodayFutureCounter = (store: Store): number =>
get(store, "myBetsStandalone.totalFutureBets", 0);
export const getActiveWageredAmountCounter = (store: Store): number =>
get(store, "myBetsStandalone.activeWageredAmount", 0);
export const getSettledWageredAmountCounter = (store: Store): number =>
get(store, "myBetsStandalone.settledWageredAmount", 0);
export const getFutureWageredAmountCounter = (store: Store): number =>
get(store, "myBetsStandalone.futureWageredAmount", 0);
export const getMyBetsPastPerformanceRaces = (
store: Store
): Array<RaceInfoMyBets> =>
get(store, "myBetsStandalone.pastPerformance.races", []);
export const getIsMyBetsPastPerformanceOpen = (store: Store): boolean =>
get(store, "myBetsStandalone.pastPerformance.isOpen", false);
export const getHasMyBetsPastPerformanceBack = (store: Store): SettledTabEnum =>
get(
store,
"myBetsStandalone.pastPerformance.hasBack",
initialState.pastPerformance.hasBack
);
export const getMyBetsPastPerformanceTrackCode = (store: Store): string =>
get(store, "myBetsStandalone.pastPerformance.selectedRace.trackCode", "");
export const getMyBetsPastPerformanceRaceNumber = (store: Store): number =>
get(store, "myBetsStandalone.pastPerformance.selectedRace.raceNumber", 1);
export const getMyBetsPastPerformanceDate = (store: Store): string =>
get(store, "myBetsStandalone.pastPerformance.selectedRace.raceDate", "");
export const getBetCancelBet = (store: Store): WroWagerGroup | undefined =>
get(store, "myBetsStandalone.betCancelModal.bet");
export const getIsLoadingMyBets = (store: Store): boolean | undefined =>
get(store, "myBetsStandalone.isLoading");
export const getMyBetsTrackRulesMessage = (store: Store): string =>
get(store, "capi.messages.myBetsTrackRulesMessage", "");
export const getMyBetsPaginationConf = (store: Store): string | undefined =>
parseCAPIMessage(store, "capi.messages.myBetsPaginationConf");
export const getStatusFilters = (store: Store): StatusFilters | undefined =>
get(store, "myBetsStandalone.statusFilters");
export const getStatusFiltersCount = (store: Store): number | undefined =>
get(store, "myBetsStandalone.statusFilterCount");
export const getIsApproxPayoutModalOpen = (store: Store): boolean =>
get(store, "myBetsStandalone.approxPayoutModal.isOpen", false);
export const getTrackFilters = (store: Store): Array<MyBetsDynamicFilters> =>
get(store, "myBetsStandalone.trackFilters", []);
export const getTrackFiltersCount = (store: Store): number =>
get(store, "myBetsStandalone.trackFilterCount", 0);
export const getBetTypeFilters = (store: Store): Array<MyBetsDynamicFilters> =>
get(store, "myBetsStandalone.betTypeFilters", []);
export const getBetTypeFiltersCount = (store: Store): number =>
get(store, "myBetsStandalone.betTypeFilterCount", 0);
export const getCustomStartDate = (store: Store): string | null =>
get(store, "myBetsStandalone.customStartDate", null);
export const getCustomEndDate = (store: Store): Date =>
get(store, "myBetsStandalone.customEndDate", new Date());
export const getIsCustomTimeFrame = (store: Store): boolean =>
get(store, "myBetsStandalone.isCustomTimeFrame", false);
export const getIsDefaultSettled = (store: Store): boolean =>
get(store, "myBetsStandalone.shouldDefaultToSettled", false);
export const getIsDefaultFuture = (store: Store): boolean =>
get(store, "myBetsStandalone.shouldDefaultToFuture", false);
export const getPastPerformanceModaLTitle = (store: Store): string =>
get(store, "myBetsStandalone.pastPerformance.modalTitle", "");
// TODO: try to figured out those types.
export const getDeletedBets = (store: Store) =>
get(store, "myBetsStandalone.deletedBets");
// This one have this redux selector but we don't have the bettingInterests inside the interface BetCancelModal
export const getMyBetBettingInterests = (store: Store) =>
get(store, "myBetsStandalone.betCancelModal.bettingInterests");
export const getBetSocialProgramPageWagerType = (store: Store) =>
get(store, "RaceProgram.betType");
export const getHeaderMessage = (store: Store): XsellHeaderMessage =>
parseCAPIMessage(store, "capi.messages.myBetsInfoMessage");
export const getXsellBlacklistedMyBets = (store: Store): XsellBlacklistedBets =>
parseCAPIMessage(store, "capi.messages.FDRBlacklistedBets", {
blacklistedBets: []
});
export const getHasBackgroundModal = (store: Store): boolean =>
get(store, "myBetsStandalone.betCancelModal.hasBackgroundModal", false);
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/raceDetails.ts
import {
RaceInfoMyBetsResults,
RaceInfoMyBets,
RaceVideoFeedback,
RaceStatusEnum,
RaceInfoMyBetsRunner,
RaceLegStatus,
RaceTypeCodeEnum
} from "@tvg/ts-types/Race";
import { useSelector } from "react-redux";
import { get, first, find, every } from "lodash";
import { isBefore } from "date-fns";
import { CheckRaceStatus } from "@tvg/sh-lib-my-bets/utils/types";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import { WroWagerGroup } from "@tvg/ts-types/WroWager";
import { Selections, SelectionRunner } from "@tvg/ts-types/Selections";
import { getXsellBlacklistedMyBets } from "../redux/selectors";
type Props = {
isMultiRace: boolean;
isSettledBet: boolean;
isCancelled: boolean;
legRaces: Array<RaceInfoMyBets>;
currentRace?: RaceInfoMyBets;
currentLeg?: RaceInfoMyBets;
bet: WroWagerGroup;
currentRaceDate: string;
betDate: string;
videoFeedback: RaceVideoFeedback;
raceNumber: number;
};
const betTypesCodes = {
exotic: [
"EX",
"EKB",
"EXB",
"EXW",
"EXK",
"TR",
"TRB",
"TRW",
"TRK",
"TKB",
"SU",
"SUB",
"SUK",
"SUW",
"SKB",
"SH5",
"H5B",
"H5W",
"S5K",
"5KB",
"QN",
"QNB",
"OM",
"OMB",
"TI",
"TIB"
],
multiRace: [
"DB",
"P3",
"P4",
"P5",
"P6",
"P7",
"P8",
"P9",
"P10",
"P11",
"P12",
"A3",
"A4",
"A5",
"A6",
"A7",
"A8",
"A9",
"A10",
"A11",
"A12",
"L3",
"L4",
"L5",
"L6",
"L7",
"L8",
"L9",
"L10",
"GS"
],
pickBet: [
"DB",
"P3",
"P4",
"P5",
"P6",
"P7",
"P8",
"P9",
"P10",
"P11",
"P12"
],
pickBetScratchRules: [
"DB",
"P3",
"P4",
"P5",
"P6",
"A3",
"A4",
"A5",
"A6",
"GS"
],
pickBetSub: ["P4", "P5", "P6", "A4", "A5", "A6", "GS"],
keyBoxWheel: [
"EXB",
"EXK",
"EXW",
"EKB",
"TRB",
"TRK",
"TRW",
"TKB",
"SUB",
"SUK",
"SUW",
"SKB",
"H5B",
"S5K",
"H5W",
"5KB",
"QNB",
"QNW",
"OMB",
"OMW",
"TIB",
"TIW"
]
};
export const getPickAll = (
pickType: string,
startNumber: number,
endNumber: number
): Array<string> =>
new Array(endNumber - startNumber + 1)
.fill(pickType)
.map((value: string, index) => `${value}${index + startNumber}`);
export const isPickBetWithInvalidResults = (wagerType: string) =>
["GS", ...getPickAll("L", 3, 20)].includes(wagerType);
export const isPicketBetScratchRules = (betTypesCode: WagerTypeCodesEnum) =>
betTypesCodes.pickBetScratchRules.includes(betTypesCode);
export const isPickBetSub = (betTypesCode: WagerTypeCodesEnum) =>
betTypesCodes.pickBetSub.includes(betTypesCode);
export const isPickBetWager = (betTypeCode: WagerTypeCodesEnum) =>
betTypesCodes.pickBet.includes(betTypeCode);
export const isMultiRaceBet = (betTypeCode: WagerTypeCodesEnum) =>
betTypesCodes.multiRace.includes(betTypeCode);
export const isExoticBet = (betTypeCode: WagerTypeCodesEnum) =>
betTypesCodes.exotic.includes(betTypeCode);
export const useIsXsellBlacklistedBet = (
betTypeCode: WagerTypeCodesEnum,
isURPPpOnXSellEnabled: boolean
) => {
const blacklistedBets = useSelector(getXsellBlacklistedMyBets);
return (
!isURPPpOnXSellEnabled &&
blacklistedBets.blacklistedBets.includes(betTypeCode)
);
};
export const getWinnerBI = (
results: RaceInfoMyBetsResults,
finishPosition: number = 1
) => {
const runners = get(results, "runners") || [];
return runners.reduce((acc: RaceInfoMyBetsRunner[], runner) => {
if (runner.finishPosition === finishPosition) {
const currentRunner = { ...runner };
return [...acc, currentRunner];
}
return acc;
}, []);
};
export const shouldShowWillPays = (
races: RaceInfoMyBets[],
selection: Selections[],
results: RaceInfoMyBetsResults[],
finalBettedLeg: number
) => {
let showWillPays = false;
const lastFinishedRace = first(
races
.filter((race) => race.status.code === "RO")
.sort((a, b) => +b.number - +a.number)
);
const lastFinishedLeg = lastFinishedRace ? lastFinishedRace.number : 0;
const currentLeg = +lastFinishedLeg + 1;
const isTrackOver = races.findIndex((race) => +race.number === 1) === -1;
if (!isTrackOver && finalBettedLeg - currentLeg === 0 && results) {
const finishedResults = results
? results.filter((result) => result !== null)
: [];
if (finishedResults.length === selection.length - 1) {
const isWinningSoFar = Array(selection.length - 1);
// eslint-disable-next-line
finishedResults.forEach((result, index) => {
if (result.runners) {
const winnerBI = getWinnerBI(result);
isWinningSoFar[index as number] = !!selection[
index as number
].runners.find(
(runner: SelectionRunner) =>
!!winnerBI &&
(+runner.number === +get(winnerBI, "[0].biNumber", -1) ||
+runner.number === +get(winnerBI, "[1].biNumber", -1))
);
}
});
if (isWinningSoFar.every((w) => w)) {
showWillPays = true;
}
}
}
return showWillPays;
};
export const getActiveLegs = (
races: RaceInfoMyBets[],
raceNumber: number,
length: number
) =>
races
.filter(
(race) =>
race.number >= +raceNumber && race.number <= +raceNumber + length - 1
)
.filter((race) => race.status.code !== RaceStatusEnum.RACE_OFFICIAL);
export const getRacesInPickBets = (
races: RaceInfoMyBets[],
raceNumber: number,
length: number
) =>
races.filter(
(race) =>
race.number >= +raceNumber && race.number <= +raceNumber + length - 1
);
export const getRaceProps = ({
isMultiRace,
isSettledBet,
legRaces,
currentRace,
currentLeg,
bet,
currentRaceDate,
betDate,
videoFeedback,
raceNumber,
isCancelled
}: Props) => {
let statusCode: RaceStatusEnum = get(currentRace, "status.code");
const raceType: RaceTypeCodeEnum = get(bet, "wagers[0].raceTypeAbbreviation");
if (currentRace && !statusCode) {
statusCode = RaceStatusEnum.OPEN;
}
if (
(!currentRace && !statusCode) ||
isBefore(new Date(betDate), new Date(currentRaceDate))
) {
statusCode = RaceStatusEnum.RACE_OFFICIAL;
}
const hasLiveVideo =
currentRaceDate === betDate &&
(isMultiRace && currentLeg && !isSettledBet
? videoFeedback.indexOf("AVAILABLE") === 0 &&
currentLeg.status.code !== RaceStatusEnum.RACE_OFFICIAL &&
currentLeg.status.code !== RaceStatusEnum.MANUALLY_CLOSED
: videoFeedback.indexOf("AVAILABLE") === 0 &&
statusCode !== RaceStatusEnum.RACE_OFFICIAL &&
statusCode !== RaceStatusEnum.MANUALLY_CLOSED);
if (isMultiRace && currentLeg && (!isSettledBet || isCancelled)) {
const currentLegNumber =
legRaces &&
currentLeg &&
legRaces.findIndex((race) => race.number === currentLeg.number) + 1;
const mtp = isCancelled
? get(currentRace, "mtp", 0)
: get(currentLeg, "mtp", 0);
const legStatusCode = isCancelled
? get(currentRace, "status.code")
: get(currentLeg, "status.code");
const currentRaceNumber = currentLegNumber + raceNumber - 1;
return {
mtp,
postTime: currentLeg.postTime,
statusCode,
legStatusCode,
legNumber: currentLegNumber,
currentRaceNumber,
hasLiveVideo: hasLiveVideo && mtp <= 60,
raceType
};
}
const mtp = get(currentLeg, "mtp", null) || get(currentRace, "mtp", 0);
return {
mtp,
postTime: get(bet, "wagers[0].racePostTime"),
statusCode,
legStatusCode: null,
legNumber: 0,
currentRaceNumber: raceNumber,
hasLiveVideo: hasLiveVideo && mtp <= 60,
raceType
};
};
export const getRaceStatus = ({
isAllRunnersScratched,
legContainsScratch,
isMultiRace,
selectionIndex,
selection,
races,
raceNumber,
selectionLength,
isCanceled,
betStatusName,
wagerType,
favoriteRunner,
shouldShowReplacement
}: CheckRaceStatus) => {
const winnerBI = !!find(selection, { isWinner: true });
const isRaceActive = betStatusName?.toLowerCase() === "active";
const isInvalidWagerType = isPickBetWithInvalidResults(wagerType);
let raceStatus: RaceLegStatus = "open";
if (isMultiRace) {
if (isRaceActive) {
if (get(races, "length", 0) > 0) {
const legRaces = getRacesInPickBets(races, raceNumber, selectionLength);
const legStatus = get(legRaces, `${selectionIndex}.status.code`);
const legResults = get(legRaces, `${selectionIndex}.results`);
const activeLegs = getActiveLegs(races, raceNumber, selectionLength);
const currentActiveLeg = first(activeLegs);
if (winnerBI) {
raceStatus = "win";
} else if (!legResults && legStatus === RaceStatusEnum.RACE_OFFICIAL) {
raceStatus = "raceOff";
} else if (
(!legStatus || legStatus === RaceStatusEnum.RACE_OFFICIAL) &&
!winnerBI
) {
raceStatus = "lost";
} else if (
activeLegs.length > 0 &&
currentActiveLeg?.number &&
+currentActiveLeg?.number === +raceNumber + selectionIndex &&
currentActiveLeg.status.code !== RaceStatusEnum.MANUALLY_CLOSED
) {
raceStatus = "raceOff";
} else if (isAllRunnersScratched || legContainsScratch) {
raceStatus = "attention";
}
} else if (selectionIndex === 0) {
raceStatus = "raceOff";
}
} else if (!isCanceled) {
const isUnknownStatus = get(selection, "0.isWinner") === null;
const alternateBI = get(
find(
selection,
(item) =>
every(get(item, "runners", []), { isScratched: true }) &&
get(item, "alternate")
),
"alternate"
);
const isAlternateWinnerBI = get(alternateBI, "isWinner", false);
if (isUnknownStatus) {
raceStatus = "unknown";
} else if (winnerBI || isAlternateWinnerBI) {
raceStatus = "win";
} else {
raceStatus = "lost";
const isAlternateScratched = every(get(alternateBI, "runners", []), {
isScratched: true
});
const showFavoriteRunnerStatus = !alternateBI || isAlternateScratched;
if (
favoriteRunner &&
favoriteRunner.isWinner &&
isAllRunnersScratched &&
shouldShowReplacement &&
showFavoriteRunnerStatus
) {
raceStatus = "win";
}
}
}
}
if (
!["open", "raceOff", "attention"].includes(raceStatus) &&
isInvalidWagerType
) {
raceStatus = "unknown";
}
return raceStatus;
};
export const getRacesIds = (bets: WroWagerGroup[] = []): Array<string> =>
bets.map((bet) => {
const [, trackCode] = bet.value.split("|");
return trackCode;
});
export const isRaceOff = (status: RaceStatusEnum): boolean =>
status === RaceStatusEnum.RACE_OFF || status === RaceStatusEnum.RACE_OFFICIAL;
webpack://frontend-tpt/../../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js
export default function _taggedTemplateLiteralLoose(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
strings.raw = raw;
return strings;
}
webpack://frontend-tpt/../../node_modules/graphql/jsutils/isObjectLike.mjs
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* Return true if `value` is object-like. A value is object-like if it's not
* `null` and has a `typeof` result of "object".
*/
export default function isObjectLike(value) {
return _typeof(value) == 'object' && value !== null;
}
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/options.graph.ts
import { get } from "lodash";
import { QueryHookOptions, WatchQueryFetchPolicy } from "@apollo/client";
import { WagerProfile } from "@tvg/ts-types/User";
import { TalentPickData } from "@tvg/ts-types/TalentPicks";
import { Talent } from "@tvg/ts-types/Talent";
import { RaceProgram, TalentPickGraphData } from "@tvg/ts-types/Race";
import BetUtils from "@tvg/utils/betSelection";
import { mapTalentPicksListFromGraph } from "@tvg/utils/talentPicksUtils";
import tvgConf from "@tvg/conf";
import { isMultiRaceBet } from "@tvg/sh-lib-my-bets/utils/raceDetails";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import { getPortByBrand } from "@tvg/utils/generalUtils";
import { RacesApolloClientOptions, UseTalentPicksProps } from "../types";
const highlightedOptions = {
product: tvgConf().product.toUpperCase(),
brand: tvgConf().brand.toUpperCase(),
device: tvgConf().device
};
const QUERY_VARIABLES = {
...highlightedOptions
};
const POLL_INTERVAL = 60000;
export const getUniqueTalents = (
talents: Array<TalentPickData>
): Array<Talent> =>
talents.reduce(
(uniqueTalents: Array<Talent>, currentValue) =>
uniqueTalents.some(
(elem: Talent) => elem.talentId === currentValue.talent.talentId
)
? uniqueTalents
: uniqueTalents.concat(currentValue.talent),
[]
);
export const getTalentPicksWithVisualSelections = (
talentPicksList: Array<TalentPickGraphData>,
races?: Array<RaceProgram>
) =>
mapTalentPicksListFromGraph(talentPicksList).map(
(talentPick: TalentPickData) => {
let talentPickRaces: Array<RaceProgram> = [];
if (races && races.length > 0) {
const currentRaceIndex = races.findIndex((race) => {
const trackCode = race?.track?.trackCode || race?.track?.code;
return (
race.number &&
trackCode &&
+race.number === +talentPick.race &&
talentPick.track === trackCode
);
});
talentPickRaces =
currentRaceIndex > -1
? [...races].splice(currentRaceIndex, talentPick.selections.length)
: [];
} else {
// Only do this if don't have races list from the track
const currentTalentPick = talentPicksList.find(
(tp: TalentPickGraphData) => tp.id === talentPick.id
);
const talentPickRace = get(
currentTalentPick,
"race"
) as unknown as RaceProgram;
if (talentPickRace) {
talentPickRaces.push(talentPickRace);
}
}
const isPick = talentPick.wagerType.legCount > 1;
const visualSelections = BetUtils.getVisualSelectionsWithRaces(
talentPick.selections,
talentPickRaces,
isPick
);
return {
...talentPick,
visualSelections,
numRunnersAllRaces: talentPickRaces.map(
(race) => race.numWagerableRunners?.toString() || ""
)
};
}
);
const getProps = (result: { talentPicksList: Array<TalentPickGraphData> }) => {
const talentPicksList: Array<TalentPickGraphData> = get(
result,
"talentPicksList",
[]
);
const talentPicksWithVisualSelections: Array<TalentPickData> =
getTalentPicksWithVisualSelections(talentPicksList);
return {
talentPicks: talentPicksWithVisualSelections,
talentsList: getUniqueTalents(talentPicksWithVisualSelections)
};
};
export default {
// @TODO: validar props
skip: (props: UseTalentPicksProps) =>
!get(props, "shouldUpdate") || get(props, "skip"),
options: (props: UseTalentPicksProps) => {
const trackCode = get(props, "trackCode", undefined);
const raceNumber = get(props, "raceNumber", undefined);
const useCache = get(props, "useCache", false);
const variables = {
...QUERY_VARIABLES,
wagerProfile: get(props, "wagerProfile") || getPortByBrand(),
trackCode,
raceNumber
};
return {
skip: !props.wagerProfile || get(props, "skip"),
fetchPolicy: useCache
? "cache-first"
: ("cache-and-network" as WatchQueryFetchPolicy),
ssr: false,
variables
};
},
getProps
};
const getNeededRacesCode = (talentPicks: Array<TalentPickGraphData>) =>
talentPicks.reduce<Array<string>>((racesCode, talentPick) => {
const talentPickTrack = talentPick.track || "";
if (
isMultiRaceBet(
talentPick?.wagerType?.abbreviation as WagerTypeCodesEnum
) &&
!racesCode.includes(talentPickTrack)
) {
racesCode.push(talentPickTrack);
}
return racesCode;
}, []);
export const racesApolloClientOptions = ({
talentPicks = [],
wagerProfile = ""
}: RacesApolloClientOptions) => {
const tracksCode = getNeededRacesCode(talentPicks || []);
return {
skip: !tracksCode.length,
pollInterval: POLL_INTERVAL,
fetchPolicy: "cache-and-network" as WatchQueryFetchPolicy,
ssr: false,
variables: {
wagerProfile,
tracksCode
}
};
};
export const ApolloOptionsTracks = (props: {
wagerProfile: WagerProfile;
hasRequestedLogin: boolean;
}): QueryHookOptions => {
const variables = {
wagerProfile: props.wagerProfile || getPortByBrand(),
sortByName: {
byName: "ASC"
},
trackFilters: {
allTrackClasses: true
},
...tvgConf().graphContext()
};
return {
skip: !props.hasRequestedLogin,
fetchPolicy: "cache-and-network",
pollInterval: POLL_INTERVAL,
variables
};
};
export const ApolloOptionsRaces = (props: {
trackCode?: string;
wagerProfile: WagerProfile;
hasRequestedLogin: boolean;
}): QueryHookOptions => {
const variables = {
wagerProfile: props.wagerProfile || getPortByBrand(),
filterByTrack: {
trackCode: [props.trackCode]
},
sortByRaceNumber: {
byRaceNumber: "ASC"
},
...tvgConf().graphContext()
};
return {
skip: typeof props.trackCode === "undefined" || !props.hasRequestedLogin,
fetchPolicy: "cache-and-network",
variables
};
};
webpack://frontend-tpt/../../node_modules/graphql/polyfills/symbols.mjs
// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') export var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') export var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') export var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';
webpack://frontend-tpt/../../node_modules/graphql/language/location.mjs
/**
* Represents a location in a Source.
*/
/**
* Takes a Source and a UTF-8 character offset, and returns the corresponding
* line and column as a SourceLocation.
*/
export function getLocation(source, position) {
var lineRegexp = /\r\n|[\n\r]/g;
var line = 1;
var column = position + 1;
var match;
while ((match = lineRegexp.exec(source.body)) && match.index < position) {
line += 1;
column = position + 1 - (match.index + match[0].length);
}
return {
line: line,
column: column
};
}
webpack://frontend-tpt/../../node_modules/graphql/language/printLocation.mjs
import { getLocation } from "./location.mjs";
/**
* Render a helpful description of the location in the GraphQL Source document.
*/
export function printLocation(location) {
return printSourceLocation(location.source, getLocation(location.source, location.start));
}
/**
* Render a helpful description of the location in the GraphQL Source document.
*/
export function printSourceLocation(source, sourceLocation) {
var firstLineColumnOffset = source.locationOffset.column - 1;
var body = whitespace(firstLineColumnOffset) + source.body;
var lineIndex = sourceLocation.line - 1;
var lineOffset = source.locationOffset.line - 1;
var lineNum = sourceLocation.line + lineOffset;
var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;
var columnNum = sourceLocation.column + columnOffset;
var locationStr = "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, "\n");
var lines = body.split(/\r\n|[\n\r]/g);
var locationLine = lines[lineIndex]; // Special case for minified documents
if (locationLine.length > 120) {
var subLineIndex = Math.floor(columnNum / 80);
var subLineColumnNum = columnNum % 80;
var subLines = [];
for (var i = 0; i < locationLine.length; i += 80) {
subLines.push(locationLine.slice(i, i + 80));
}
return locationStr + printPrefixedLines([["".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {
return ['', subLine];
}), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));
}
return locationStr + printPrefixedLines([// Lines specified like this: ["prefix", "string"],
["".concat(lineNum - 1), lines[lineIndex - 1]], ["".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], ["".concat(lineNum + 1), lines[lineIndex + 1]]]);
}
function printPrefixedLines(lines) {
var existingLines = lines.filter(function (_ref) {
var _ = _ref[0],
line = _ref[1];
return line !== undefined;
});
var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) {
var prefix = _ref2[0];
return prefix.length;
}));
return existingLines.map(function (_ref3) {
var prefix = _ref3[0],
line = _ref3[1];
return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |');
}).join('\n');
}
function whitespace(len) {
return Array(len + 1).join(' ');
}
function leftPad(len, str) {
return whitespace(len - str.length) + str;
}
webpack://frontend-tpt/../../node_modules/graphql/error/GraphQLError.mjs
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
import isObjectLike from "../jsutils/isObjectLike.mjs";
import { SYMBOL_TO_STRING_TAG } from "../polyfills/symbols.mjs";
import { getLocation } from "../language/location.mjs";
import { printLocation, printSourceLocation } from "../language/printLocation.mjs";
/**
* A GraphQLError describes an Error found during the parse, validate, or
* execute phases of performing a GraphQL operation. In addition to a message
* and stack trace, it also includes information about the locations in a
* GraphQL document and/or execution result that correspond to the Error.
*/
export var GraphQLError = /*#__PURE__*/function (_Error) {
_inherits(GraphQLError, _Error);
var _super = _createSuper(GraphQLError);
/**
* An array of { line, column } locations within the source GraphQL document
* which correspond to this error.
*
* Errors during validation often contain multiple locations, for example to
* point out two things with the same name. Errors during execution include a
* single location, the field which produced the error.
*
* Enumerable, and appears in the result of JSON.stringify().
*/
/**
* An array describing the JSON-path into the execution response which
* corresponds to this error. Only included for errors during execution.
*
* Enumerable, and appears in the result of JSON.stringify().
*/
/**
* An array of GraphQL AST Nodes corresponding to this error.
*/
/**
* The source GraphQL document for the first location of this error.
*
* Note that if this Error represents more than one node, the source may not
* represent nodes after the first node.
*/
/**
* An array of character offsets within the source GraphQL document
* which correspond to this error.
*/
/**
* The original error thrown from a field resolver during execution.
*/
/**
* Extension fields to add to the formatted error.
*/
function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {
var _nodeLocations, _nodeLocations2, _nodeLocations3;
var _this;
_classCallCheck(this, GraphQLError);
_this = _super.call(this, message);
_this.name = 'GraphQLError';
_this.originalError = originalError !== null && originalError !== void 0 ? originalError : undefined; // Compute list of blame nodes.
_this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined);
var nodeLocations = [];
for (var _i2 = 0, _ref3 = (_this$nodes = _this.nodes) !== null && _this$nodes !== void 0 ? _this$nodes : []; _i2 < _ref3.length; _i2++) {
var _this$nodes;
var _ref4 = _ref3[_i2];
var loc = _ref4.loc;
if (loc != null) {
nodeLocations.push(loc);
}
}
nodeLocations = undefinedIfEmpty(nodeLocations); // Compute locations in the source for the given nodes/positions.
_this.source = source !== null && source !== void 0 ? source : (_nodeLocations = nodeLocations) === null || _nodeLocations === void 0 ? void 0 : _nodeLocations[0].source;
_this.positions = positions !== null && positions !== void 0 ? positions : (_nodeLocations2 = nodeLocations) === null || _nodeLocations2 === void 0 ? void 0 : _nodeLocations2.map(function (loc) {
return loc.start;
});
_this.locations = positions && source ? positions.map(function (pos) {
return getLocation(source, pos);
}) : (_nodeLocations3 = nodeLocations) === null || _nodeLocations3 === void 0 ? void 0 : _nodeLocations3.map(function (loc) {
return getLocation(loc.source, loc.start);
});
_this.path = path !== null && path !== void 0 ? path : undefined;
var originalExtensions = originalError === null || originalError === void 0 ? void 0 : originalError.extensions;
if (extensions == null && isObjectLike(originalExtensions)) {
_this.extensions = _objectSpread({}, originalExtensions);
} else {
_this.extensions = extensions !== null && extensions !== void 0 ? extensions : {};
} // By being enumerable, JSON.stringify will include bellow properties in the resulting output.
// This ensures that the simplest possible GraphQL service adheres to the spec.
Object.defineProperties(_assertThisInitialized(_this), {
message: {
enumerable: true
},
locations: {
enumerable: _this.locations != null
},
path: {
enumerable: _this.path != null
},
extensions: {
enumerable: _this.extensions != null && Object.keys(_this.extensions).length > 0
},
name: {
enumerable: false
},
nodes: {
enumerable: false
},
source: {
enumerable: false
},
positions: {
enumerable: false
},
originalError: {
enumerable: false
}
}); // Include (non-enumerable) stack trace.
if (originalError !== null && originalError !== void 0 && originalError.stack) {
Object.defineProperty(_assertThisInitialized(_this), 'stack', {
value: originalError.stack,
writable: true,
configurable: true
});
return _possibleConstructorReturn(_this);
} // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
if (Error.captureStackTrace) {
Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError);
} else {
Object.defineProperty(_assertThisInitialized(_this), 'stack', {
value: Error().stack,
writable: true,
configurable: true
});
}
return _this;
}
_createClass(GraphQLError, [{
key: "toString",
value: function toString() {
return printError(this);
} // FIXME: workaround to not break chai comparisons, should be remove in v16
// $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet
}, {
key: SYMBOL_TO_STRING_TAG,
get: function get() {
return 'Object';
}
}]);
return GraphQLError;
}( /*#__PURE__*/_wrapNativeSuper(Error));
function undefinedIfEmpty(array) {
return array === undefined || array.length === 0 ? undefined : array;
}
/**
* Prints a GraphQLError to a string, representing useful location information
* about the error's position in the source.
*/
export function printError(error) {
var output = error.message;
if (error.nodes) {
for (var _i4 = 0, _error$nodes2 = error.nodes; _i4 < _error$nodes2.length; _i4++) {
var node = _error$nodes2[_i4];
if (node.loc) {
output += '\n\n' + printLocation(node.loc);
}
}
} else if (error.source && error.locations) {
for (var _i6 = 0, _error$locations2 = error.locations; _i6 < _error$locations2.length; _i6++) {
var location = _error$locations2[_i6];
output += '\n\n' + printSourceLocation(error.source, location);
}
}
return output;
}
webpack://frontend-tpt/../../node_modules/graphql/error/syntaxError.mjs
import { GraphQLError } from "./GraphQLError.mjs";
/**
* Produces a GraphQLError representing a syntax error, containing useful
* descriptive information about the syntax error's position in the source.
*/
export function syntaxError(source, position, description) {
return new GraphQLError("Syntax Error: ".concat(description), undefined, source, [position]);
}
webpack://frontend-tpt/../../node_modules/graphql/language/kinds.mjs
/**
* The set of allowed kind values for AST nodes.
*/
export var Kind = Object.freeze({
// Name
NAME: 'Name',
// Document
DOCUMENT: 'Document',
OPERATION_DEFINITION: 'OperationDefinition',
VARIABLE_DEFINITION: 'VariableDefinition',
SELECTION_SET: 'SelectionSet',
FIELD: 'Field',
ARGUMENT: 'Argument',
// Fragments
FRAGMENT_SPREAD: 'FragmentSpread',
INLINE_FRAGMENT: 'InlineFragment',
FRAGMENT_DEFINITION: 'FragmentDefinition',
// Values
VARIABLE: 'Variable',
INT: 'IntValue',
FLOAT: 'FloatValue',
STRING: 'StringValue',
BOOLEAN: 'BooleanValue',
NULL: 'NullValue',
ENUM: 'EnumValue',
LIST: 'ListValue',
OBJECT: 'ObjectValue',
OBJECT_FIELD: 'ObjectField',
// Directives
DIRECTIVE: 'Directive',
// Types
NAMED_TYPE: 'NamedType',
LIST_TYPE: 'ListType',
NON_NULL_TYPE: 'NonNullType',
// Type System Definitions
SCHEMA_DEFINITION: 'SchemaDefinition',
OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',
// Type Definitions
SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',
OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',
FIELD_DEFINITION: 'FieldDefinition',
INPUT_VALUE_DEFINITION: 'InputValueDefinition',
INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',
UNION_TYPE_DEFINITION: 'UnionTypeDefinition',
ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',
ENUM_VALUE_DEFINITION: 'EnumValueDefinition',
INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',
// Directive Definitions
DIRECTIVE_DEFINITION: 'DirectiveDefinition',
// Type System Extensions
SCHEMA_EXTENSION: 'SchemaExtension',
// Type Extensions
SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',
OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',
INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',
UNION_TYPE_EXTENSION: 'UnionTypeExtension',
ENUM_TYPE_EXTENSION: 'EnumTypeExtension',
INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'
});
/**
* The enum type representing the possible kind values of AST nodes.
*/
webpack://frontend-tpt/../../node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;
export default nodejsCustomInspectSymbol;
webpack://frontend-tpt/../../node_modules/graphql/jsutils/defineInspect.mjs
import invariant from "./invariant.mjs";
import nodejsCustomInspectSymbol from "./nodejsCustomInspectSymbol.mjs";
/**
* The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON`
*/
export default function defineInspect(classObject) {
var fn = classObject.prototype.toJSON;
typeof fn === 'function' || invariant(0);
classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')
if (nodejsCustomInspectSymbol) {
classObject.prototype[nodejsCustomInspectSymbol] = fn;
}
}
webpack://frontend-tpt/../../node_modules/graphql/jsutils/invariant.mjs
export default function invariant(condition, message) {
var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')
if (!booleanCondition) {
throw new Error(message != null ? message : 'Unexpected invariant triggered.');
}
}
webpack://frontend-tpt/../../node_modules/graphql/language/ast.mjs
import defineInspect from "../jsutils/defineInspect.mjs";
/**
* Contains a range of UTF-8 character offsets and token references that
* identify the region of the source from which the AST derived.
*/
export var Location = /*#__PURE__*/function () {
/**
* The character offset at which this Node begins.
*/
/**
* The character offset at which this Node ends.
*/
/**
* The Token at which this Node begins.
*/
/**
* The Token at which this Node ends.
*/
/**
* The Source document the AST represents.
*/
function Location(startToken, endToken, source) {
this.start = startToken.start;
this.end = endToken.end;
this.startToken = startToken;
this.endToken = endToken;
this.source = source;
}
var _proto = Location.prototype;
_proto.toJSON = function toJSON() {
return {
start: this.start,
end: this.end
};
};
return Location;
}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.
defineInspect(Location);
/**
* Represents a range of characters represented by a lexical token
* within a Source.
*/
export var Token = /*#__PURE__*/function () {
/**
* The kind of Token.
*/
/**
* The character offset at which this Node begins.
*/
/**
* The character offset at which this Node ends.
*/
/**
* The 1-indexed line number on which this Token appears.
*/
/**
* The 1-indexed column number at which this Token begins.
*/
/**
* For non-punctuation tokens, represents the interpreted value of the token.
*/
/**
* Tokens exist as nodes in a double-linked-list amongst all tokens
* including ignored tokens. <SOF> is always the first node and <EOF>
* the last.
*/
function Token(kind, start, end, line, column, prev, value) {
this.kind = kind;
this.start = start;
this.end = end;
this.line = line;
this.column = column;
this.value = value;
this.prev = prev;
this.next = null;
}
var _proto2 = Token.prototype;
_proto2.toJSON = function toJSON() {
return {
kind: this.kind,
value: this.value,
line: this.line,
column: this.column
};
};
return Token;
}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.
defineInspect(Token);
/**
* @internal
*/
export function isNode(maybeNode) {
return maybeNode != null && typeof maybeNode.kind === 'string';
}
/**
* The list of all possible AST node types.
*/
webpack://frontend-tpt/../../node_modules/graphql/language/tokenKind.mjs
/**
* An exported enum describing the different kinds of tokens that the
* lexer emits.
*/
export var TokenKind = Object.freeze({
SOF: '<SOF>',
EOF: '<EOF>',
BANG: '!',
DOLLAR: '$',
AMP: '&',
PAREN_L: '(',
PAREN_R: ')',
SPREAD: '...',
COLON: ':',
EQUALS: '=',
AT: '@',
BRACKET_L: '[',
BRACKET_R: ']',
BRACE_L: '{',
PIPE: '|',
BRACE_R: '}',
NAME: 'Name',
INT: 'Int',
FLOAT: 'Float',
STRING: 'String',
BLOCK_STRING: 'BlockString',
COMMENT: 'Comment'
});
/**
* The enum type representing the token kinds values.
*/
webpack://frontend-tpt/../../node_modules/graphql/jsutils/inspect.mjs
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/* eslint-disable flowtype/no-weak-types */
import nodejsCustomInspectSymbol from "./nodejsCustomInspectSymbol.mjs";
var MAX_ARRAY_LENGTH = 10;
var MAX_RECURSIVE_DEPTH = 2;
/**
* Used to print values in error messages.
*/
export default function inspect(value) {
return formatValue(value, []);
}
function formatValue(value, seenValues) {
switch (_typeof(value)) {
case 'string':
return JSON.stringify(value);
case 'function':
return value.name ? "[function ".concat(value.name, "]") : '[function]';
case 'object':
if (value === null) {
return 'null';
}
return formatObjectValue(value, seenValues);
default:
return String(value);
}
}
function formatObjectValue(value, previouslySeenValues) {
if (previouslySeenValues.indexOf(value) !== -1) {
return '[Circular]';
}
var seenValues = [].concat(previouslySeenValues, [value]);
var customInspectFn = getCustomFn(value);
if (customInspectFn !== undefined) {
var customValue = customInspectFn.call(value); // check for infinite recursion
if (customValue !== value) {
return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);
}
} else if (Array.isArray(value)) {
return formatArray(value, seenValues);
}
return formatObject(value, seenValues);
}
function formatObject(object, seenValues) {
var keys = Object.keys(object);
if (keys.length === 0) {
return '{}';
}
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
return '[' + getObjectTag(object) + ']';
}
var properties = keys.map(function (key) {
var value = formatValue(object[key], seenValues);
return key + ': ' + value;
});
return '{ ' + properties.join(', ') + ' }';
}
function formatArray(array, seenValues) {
if (array.length === 0) {
return '[]';
}
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
return '[Array]';
}
var len = Math.min(MAX_ARRAY_LENGTH, array.length);
var remaining = array.length - len;
var items = [];
for (var i = 0; i < len; ++i) {
items.push(formatValue(array[i], seenValues));
}
if (remaining === 1) {
items.push('... 1 more item');
} else if (remaining > 1) {
items.push("... ".concat(remaining, " more items"));
}
return '[' + items.join(', ') + ']';
}
function getCustomFn(object) {
var customInspectFn = object[String(nodejsCustomInspectSymbol)];
if (typeof customInspectFn === 'function') {
return customInspectFn;
}
if (typeof object.inspect === 'function') {
return object.inspect;
}
}
function getObjectTag(object) {
var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, '');
if (tag === 'Object' && typeof object.constructor === 'function') {
var name = object.constructor.name;
if (typeof name === 'string' && name !== '') {
return name;
}
}
return tag;
}
webpack://frontend-tpt/../../node_modules/graphql/jsutils/devAssert.mjs
export default function devAssert(condition, message) {
var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')
if (!booleanCondition) {
throw new Error(message);
}
}
webpack://frontend-tpt/../../node_modules/graphql/language/source.mjs
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
import { SYMBOL_TO_STRING_TAG } from "../polyfills/symbols.mjs";
import inspect from "../jsutils/inspect.mjs";
import devAssert from "../jsutils/devAssert.mjs";
import instanceOf from "../jsutils/instanceOf.mjs";
/**
* A representation of source input to GraphQL. The `name` and `locationOffset` parameters are
* optional, but they are useful for clients who store GraphQL documents in source files.
* For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might
* be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`.
* The `line` and `column` properties in `locationOffset` are 1-indexed.
*/
export var Source = /*#__PURE__*/function () {
function Source(body) {
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';
var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
line: 1,
column: 1
};
typeof body === 'string' || devAssert(0, "Body must be a string. Received: ".concat(inspect(body), "."));
this.body = body;
this.name = name;
this.locationOffset = locationOffset;
this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');
this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');
} // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet
_createClass(Source, [{
key: SYMBOL_TO_STRING_TAG,
get: function get() {
return 'Source';
}
}]);
return Source;
}();
/**
* Test if the given value is a Source object.
*
* @internal
*/
// eslint-disable-next-line no-redeclare
export function isSource(source) {
return instanceOf(source, Source);
}
webpack://frontend-tpt/../../node_modules/graphql/language/directiveLocation.mjs
/**
* The set of allowed directive location values.
*/
export var DirectiveLocation = Object.freeze({
// Request Definitions
QUERY: 'QUERY',
MUTATION: 'MUTATION',
SUBSCRIPTION: 'SUBSCRIPTION',
FIELD: 'FIELD',
FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',
FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',
INLINE_FRAGMENT: 'INLINE_FRAGMENT',
VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',
// Type System Definitions
SCHEMA: 'SCHEMA',
SCALAR: 'SCALAR',
OBJECT: 'OBJECT',
FIELD_DEFINITION: 'FIELD_DEFINITION',
ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',
INTERFACE: 'INTERFACE',
UNION: 'UNION',
ENUM: 'ENUM',
ENUM_VALUE: 'ENUM_VALUE',
INPUT_OBJECT: 'INPUT_OBJECT',
INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'
});
/**
* The enum type representing the directive location values.
*/
webpack://frontend-tpt/../../node_modules/graphql/language/blockString.mjs
/**
* Produces the value of a block string from its parsed raw value, similar to
* CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.
*
* This implements the GraphQL spec's BlockStringValue() static algorithm.
*
* @internal
*/
export function dedentBlockStringValue(rawString) {
// Expand a block string's raw value into independent lines.
var lines = rawString.split(/\r\n|[\n\r]/g); // Remove common indentation from all lines but first.
var commonIndent = getBlockStringIndentation(rawString);
if (commonIndent !== 0) {
for (var i = 1; i < lines.length; i++) {
lines[i] = lines[i].slice(commonIndent);
}
} // Remove leading and trailing blank lines.
var startLine = 0;
while (startLine < lines.length && isBlank(lines[startLine])) {
++startLine;
}
var endLine = lines.length;
while (endLine > startLine && isBlank(lines[endLine - 1])) {
--endLine;
} // Return a string of the lines joined with U+000A.
return lines.slice(startLine, endLine).join('\n');
}
function isBlank(str) {
for (var i = 0; i < str.length; ++i) {
if (str[i] !== ' ' && str[i] !== '\t') {
return false;
}
}
return true;
}
/**
* @internal
*/
export function getBlockStringIndentation(value) {
var _commonIndent;
var isFirstLine = true;
var isEmptyLine = true;
var indent = 0;
var commonIndent = null;
for (var i = 0; i < value.length; ++i) {
switch (value.charCodeAt(i)) {
case 13:
// \r
if (value.charCodeAt(i + 1) === 10) {
++i; // skip \r\n as one symbol
}
// falls through
case 10:
// \n
isFirstLine = false;
isEmptyLine = true;
indent = 0;
break;
case 9: // \t
case 32:
// <space>
++indent;
break;
default:
if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {
commonIndent = indent;
}
isEmptyLine = false;
}
}
return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;
}
/**
* Print a block string in the indented block form by adding a leading and
* trailing blank line. However, if a block string starts with whitespace and is
* a single-line, adding a leading blank line would strip that whitespace.
*
* @internal
*/
export function printBlockString(value) {
var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var isSingleLine = value.indexOf('\n') === -1;
var hasLeadingSpace = value[0] === ' ' || value[0] === '\t';
var hasTrailingQuote = value[value.length - 1] === '"';
var hasTrailingSlash = value[value.length - 1] === '\\';
var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines;
var result = ''; // Format a multi-line block quote to account for leading space.
if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) {
result += '\n' + indentation;
}
result += indentation ? value.replace(/\n/g, '\n' + indentation) : value;
if (printAsMultipleLines) {
result += '\n';
}
return '"""' + result.replace(/"""/g, '\\"""') + '"""';
}
webpack://frontend-tpt/../../node_modules/graphql/language/lexer.mjs
import { syntaxError } from "../error/syntaxError.mjs";
import { Token } from "./ast.mjs";
import { TokenKind } from "./tokenKind.mjs";
import { dedentBlockStringValue } from "./blockString.mjs";
/**
* Given a Source object, creates a Lexer for that source.
* A Lexer is a stateful stream generator in that every time
* it is advanced, it returns the next token in the Source. Assuming the
* source lexes, the final Token emitted by the lexer will be of kind
* EOF, after which the lexer will repeatedly return the same EOF token
* whenever called.
*/
export var Lexer = /*#__PURE__*/function () {
/**
* The previously focused non-ignored token.
*/
/**
* The currently focused non-ignored token.
*/
/**
* The (1-indexed) line containing the current token.
*/
/**
* The character offset at which the current line begins.
*/
function Lexer(source) {
var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);
this.source = source;
this.lastToken = startOfFileToken;
this.token = startOfFileToken;
this.line = 1;
this.lineStart = 0;
}
/**
* Advances the token stream to the next non-ignored token.
*/
var _proto = Lexer.prototype;
_proto.advance = function advance() {
this.lastToken = this.token;
var token = this.token = this.lookahead();
return token;
}
/**
* Looks ahead and returns the next non-ignored token, but does not change
* the state of Lexer.
*/
;
_proto.lookahead = function lookahead() {
var token = this.token;
if (token.kind !== TokenKind.EOF) {
do {
var _token$next;
// Note: next is only mutable during parsing, so we cast to allow this.
token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);
} while (token.kind === TokenKind.COMMENT);
}
return token;
};
return Lexer;
}();
/**
* @internal
*/
export function isPunctuatorTokenKind(kind) {
return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;
}
function printCharCode(code) {
return (// NaN/undefined represents access beyond the end of the file.
isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.
code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.
"\"\\u".concat(('00' + code.toString(16).toUpperCase()).slice(-4), "\"")
);
}
/**
* Gets the next token from the source starting at the given position.
*
* This skips over whitespace until it finds the next lexable token, then lexes
* punctuators immediately or calls the appropriate helper function for more
* complicated tokens.
*/
function readToken(lexer, prev) {
var source = lexer.source;
var body = source.body;
var bodyLength = body.length;
var pos = prev.end;
while (pos < bodyLength) {
var code = body.charCodeAt(pos);
var _line = lexer.line;
var _col = 1 + pos - lexer.lineStart; // SourceCharacter
switch (code) {
case 0xfeff: // <BOM>
case 9: // \t
case 32: // <space>
case 44:
// ,
++pos;
continue;
case 10:
// \n
++pos;
++lexer.line;
lexer.lineStart = pos;
continue;
case 13:
// \r
if (body.charCodeAt(pos + 1) === 10) {
pos += 2;
} else {
++pos;
}
++lexer.line;
lexer.lineStart = pos;
continue;
case 33:
// !
return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);
case 35:
// #
return readComment(source, pos, _line, _col, prev);
case 36:
// $
return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);
case 38:
// &
return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);
case 40:
// (
return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);
case 41:
// )
return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);
case 46:
// .
if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {
return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);
}
break;
case 58:
// :
return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);
case 61:
// =
return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);
case 64:
// @
return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);
case 91:
// [
return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);
case 93:
// ]
return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);
case 123:
// {
return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);
case 124:
// |
return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);
case 125:
// }
return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);
case 34:
// "
if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {
return readBlockString(source, pos, _line, _col, prev, lexer);
}
return readString(source, pos, _line, _col, prev);
case 45: // -
case 48: // 0
case 49: // 1
case 50: // 2
case 51: // 3
case 52: // 4
case 53: // 5
case 54: // 6
case 55: // 7
case 56: // 8
case 57:
// 9
return readNumber(source, pos, code, _line, _col, prev);
case 65: // A
case 66: // B
case 67: // C
case 68: // D
case 69: // E
case 70: // F
case 71: // G
case 72: // H
case 73: // I
case 74: // J
case 75: // K
case 76: // L
case 77: // M
case 78: // N
case 79: // O
case 80: // P
case 81: // Q
case 82: // R
case 83: // S
case 84: // T
case 85: // U
case 86: // V
case 87: // W
case 88: // X
case 89: // Y
case 90: // Z
case 95: // _
case 97: // a
case 98: // b
case 99: // c
case 100: // d
case 101: // e
case 102: // f
case 103: // g
case 104: // h
case 105: // i
case 106: // j
case 107: // k
case 108: // l
case 109: // m
case 110: // n
case 111: // o
case 112: // p
case 113: // q
case 114: // r
case 115: // s
case 116: // t
case 117: // u
case 118: // v
case 119: // w
case 120: // x
case 121: // y
case 122:
// z
return readName(source, pos, _line, _col, prev);
}
throw syntaxError(source, pos, unexpectedCharacterMessage(code));
}
var line = lexer.line;
var col = 1 + pos - lexer.lineStart;
return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);
}
/**
* Report a message that an unexpected character was encountered.
*/
function unexpectedCharacterMessage(code) {
if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {
return "Cannot contain the invalid character ".concat(printCharCode(code), ".");
}
if (code === 39) {
// '
return 'Unexpected single quote character (\'), did you mean to use a double quote (")?';
}
return "Cannot parse the unexpected character ".concat(printCharCode(code), ".");
}
/**
* Reads a comment token from the source file.
*
* #[\u0009\u0020-\uFFFF]*
*/
function readComment(source, start, line, col, prev) {
var body = source.body;
var code;
var position = start;
do {
code = body.charCodeAt(++position);
} while (!isNaN(code) && ( // SourceCharacter but not LineTerminator
code > 0x001f || code === 0x0009));
return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));
}
/**
* Reads a number token from the source file, either a float
* or an int depending on whether a decimal point appears.
*
* Int: -?(0|[1-9][0-9]*)
* Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)?
*/
function readNumber(source, start, firstCode, line, col, prev) {
var body = source.body;
var code = firstCode;
var position = start;
var isFloat = false;
if (code === 45) {
// -
code = body.charCodeAt(++position);
}
if (code === 48) {
// 0
code = body.charCodeAt(++position);
if (code >= 48 && code <= 57) {
throw syntaxError(source, position, "Invalid number, unexpected digit after 0: ".concat(printCharCode(code), "."));
}
} else {
position = readDigits(source, position, code);
code = body.charCodeAt(position);
}
if (code === 46) {
// .
isFloat = true;
code = body.charCodeAt(++position);
position = readDigits(source, position, code);
code = body.charCodeAt(position);
}
if (code === 69 || code === 101) {
// E e
isFloat = true;
code = body.charCodeAt(++position);
if (code === 43 || code === 45) {
// + -
code = body.charCodeAt(++position);
}
position = readDigits(source, position, code);
code = body.charCodeAt(position);
} // Numbers cannot be followed by . or NameStart
if (code === 46 || isNameStart(code)) {
throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), "."));
}
return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));
}
/**
* Returns the new position in the source after reading digits.
*/
function readDigits(source, start, firstCode) {
var body = source.body;
var position = start;
var code = firstCode;
if (code >= 48 && code <= 57) {
// 0 - 9
do {
code = body.charCodeAt(++position);
} while (code >= 48 && code <= 57); // 0 - 9
return position;
}
throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), "."));
}
/**
* Reads a string token from the source file.
*
* "([^"\\\u000A\u000D]|(\\(u[0-9a-fA-F]{4}|["\\/bfnrt])))*"
*/
function readString(source, start, line, col, prev) {
var body = source.body;
var position = start + 1;
var chunkStart = position;
var code = 0;
var value = '';
while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator
code !== 0x000a && code !== 0x000d) {
// Closing Quote (")
if (code === 34) {
value += body.slice(chunkStart, position);
return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);
} // SourceCharacter
if (code < 0x0020 && code !== 0x0009) {
throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), "."));
}
++position;
if (code === 92) {
// \
value += body.slice(chunkStart, position - 1);
code = body.charCodeAt(position);
switch (code) {
case 34:
value += '"';
break;
case 47:
value += '/';
break;
case 92:
value += '\\';
break;
case 98:
value += '\b';
break;
case 102:
value += '\f';
break;
case 110:
value += '\n';
break;
case 114:
value += '\r';
break;
case 116:
value += '\t';
break;
case 117:
{
// uXXXX
var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));
if (charCode < 0) {
var invalidSequence = body.slice(position + 1, position + 5);
throw syntaxError(source, position, "Invalid character escape sequence: \\u".concat(invalidSequence, "."));
}
value += String.fromCharCode(charCode);
position += 4;
break;
}
default:
throw syntaxError(source, position, "Invalid character escape sequence: \\".concat(String.fromCharCode(code), "."));
}
++position;
chunkStart = position;
}
}
throw syntaxError(source, position, 'Unterminated string.');
}
/**
* Reads a block string token from the source file.
*
* """("?"?(\\"""|\\(?!=""")|[^"\\]))*"""
*/
function readBlockString(source, start, line, col, prev, lexer) {
var body = source.body;
var position = start + 3;
var chunkStart = position;
var code = 0;
var rawValue = '';
while (position < body.length && !isNaN(code = body.charCodeAt(position))) {
// Closing Triple-Quote (""")
if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {
rawValue += body.slice(chunkStart, position);
return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));
} // SourceCharacter
if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {
throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), "."));
}
if (code === 10) {
// new line
++position;
++lexer.line;
lexer.lineStart = position;
} else if (code === 13) {
// carriage return
if (body.charCodeAt(position + 1) === 10) {
position += 2;
} else {
++position;
}
++lexer.line;
lexer.lineStart = position;
} else if ( // Escape Triple-Quote (\""")
code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {
rawValue += body.slice(chunkStart, position) + '"""';
position += 4;
chunkStart = position;
} else {
++position;
}
}
throw syntaxError(source, position, 'Unterminated string.');
}
/**
* Converts four hexadecimal chars to the integer that the
* string represents. For example, uniCharCode('0','0','0','f')
* will return 15, and uniCharCode('0','0','f','f') returns 255.
*
* Returns a negative number on error, if a char was invalid.
*
* This is implemented by noting that char2hex() returns -1 on error,
* which means the result of ORing the char2hex() will also be negative.
*/
function uniCharCode(a, b, c, d) {
return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);
}
/**
* Converts a hex character to its integer value.
* '0' becomes 0, '9' becomes 9
* 'A' becomes 10, 'F' becomes 15
* 'a' becomes 10, 'f' becomes 15
*
* Returns -1 on error.
*/
function char2hex(a) {
return a >= 48 && a <= 57 ? a - 48 // 0-9
: a >= 65 && a <= 70 ? a - 55 // A-F
: a >= 97 && a <= 102 ? a - 87 // a-f
: -1;
}
/**
* Reads an alphanumeric + underscore name from the source.
*
* [_A-Za-z][_0-9A-Za-z]*
*/
function readName(source, start, line, col, prev) {
var body = source.body;
var bodyLength = body.length;
var position = start + 1;
var code = 0;
while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _
code >= 48 && code <= 57 || // 0-9
code >= 65 && code <= 90 || // A-Z
code >= 97 && code <= 122) // a-z
) {
++position;
}
return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));
} // _ A-Z a-z
function isNameStart(code) {
return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;
}
webpack://frontend-tpt/../../node_modules/graphql/language/parser.mjs
import { syntaxError } from "../error/syntaxError.mjs";
import { Kind } from "./kinds.mjs";
import { Location } from "./ast.mjs";
import { TokenKind } from "./tokenKind.mjs";
import { Source, isSource } from "./source.mjs";
import { DirectiveLocation } from "./directiveLocation.mjs";
import { Lexer, isPunctuatorTokenKind } from "./lexer.mjs";
/**
* Configuration options to control parser behavior
*/
/**
* Given a GraphQL source, parses it into a Document.
* Throws GraphQLError if a syntax error is encountered.
*/
export function parse(source, options) {
var parser = new Parser(source, options);
return parser.parseDocument();
}
/**
* Given a string containing a GraphQL value (ex. `[42]`), parse the AST for
* that value.
* Throws GraphQLError if a syntax error is encountered.
*
* This is useful within tools that operate upon GraphQL Values directly and
* in isolation of complete GraphQL documents.
*
* Consider providing the results to the utility function: valueFromAST().
*/
export function parseValue(source, options) {
var parser = new Parser(source, options);
parser.expectToken(TokenKind.SOF);
var value = parser.parseValueLiteral(false);
parser.expectToken(TokenKind.EOF);
return value;
}
/**
* Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for
* that type.
* Throws GraphQLError if a syntax error is encountered.
*
* This is useful within tools that operate upon GraphQL Types directly and
* in isolation of complete GraphQL documents.
*
* Consider providing the results to the utility function: typeFromAST().
*/
export function parseType(source, options) {
var parser = new Parser(source, options);
parser.expectToken(TokenKind.SOF);
var type = parser.parseTypeReference();
parser.expectToken(TokenKind.EOF);
return type;
}
/**
* This class is exported only to assist people in implementing their own parsers
* without duplicating too much code and should be used only as last resort for cases
* such as experimental syntax or if certain features could not be contributed upstream.
*
* It is still part of the internal API and is versioned, so any changes to it are never
* considered breaking changes. If you still need to support multiple versions of the
* library, please use the `versionInfo` variable for version detection.
*
* @internal
*/
export var Parser = /*#__PURE__*/function () {
function Parser(source, options) {
var sourceObj = isSource(source) ? source : new Source(source);
this._lexer = new Lexer(sourceObj);
this._options = options;
}
/**
* Converts a name lex token into a name parse node.
*/
var _proto = Parser.prototype;
_proto.parseName = function parseName() {
var token = this.expectToken(TokenKind.NAME);
return {
kind: Kind.NAME,
value: token.value,
loc: this.loc(token)
};
} // Implements the parsing rules in the Document section.
/**
* Document : Definition+
*/
;
_proto.parseDocument = function parseDocument() {
var start = this._lexer.token;
return {
kind: Kind.DOCUMENT,
definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),
loc: this.loc(start)
};
}
/**
* Definition :
* - ExecutableDefinition
* - TypeSystemDefinition
* - TypeSystemExtension
*
* ExecutableDefinition :
* - OperationDefinition
* - FragmentDefinition
*/
;
_proto.parseDefinition = function parseDefinition() {
if (this.peek(TokenKind.NAME)) {
switch (this._lexer.token.value) {
case 'query':
case 'mutation':
case 'subscription':
return this.parseOperationDefinition();
case 'fragment':
return this.parseFragmentDefinition();
case 'schema':
case 'scalar':
case 'type':
case 'interface':
case 'union':
case 'enum':
case 'input':
case 'directive':
return this.parseTypeSystemDefinition();
case 'extend':
return this.parseTypeSystemExtension();
}
} else if (this.peek(TokenKind.BRACE_L)) {
return this.parseOperationDefinition();
} else if (this.peekDescription()) {
return this.parseTypeSystemDefinition();
}
throw this.unexpected();
} // Implements the parsing rules in the Operations section.
/**
* OperationDefinition :
* - SelectionSet
* - OperationType Name? VariableDefinitions? Directives? SelectionSet
*/
;
_proto.parseOperationDefinition = function parseOperationDefinition() {
var start = this._lexer.token;
if (this.peek(TokenKind.BRACE_L)) {
return {
kind: Kind.OPERATION_DEFINITION,
operation: 'query',
name: undefined,
variableDefinitions: [],
directives: [],
selectionSet: this.parseSelectionSet(),
loc: this.loc(start)
};
}
var operation = this.parseOperationType();
var name;
if (this.peek(TokenKind.NAME)) {
name = this.parseName();
}
return {
kind: Kind.OPERATION_DEFINITION,
operation: operation,
name: name,
variableDefinitions: this.parseVariableDefinitions(),
directives: this.parseDirectives(false),
selectionSet: this.parseSelectionSet(),
loc: this.loc(start)
};
}
/**
* OperationType : one of query mutation subscription
*/
;
_proto.parseOperationType = function parseOperationType() {
var operationToken = this.expectToken(TokenKind.NAME);
switch (operationToken.value) {
case 'query':
return 'query';
case 'mutation':
return 'mutation';
case 'subscription':
return 'subscription';
}
throw this.unexpected(operationToken);
}
/**
* VariableDefinitions : ( VariableDefinition+ )
*/
;
_proto.parseVariableDefinitions = function parseVariableDefinitions() {
return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);
}
/**
* VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
*/
;
_proto.parseVariableDefinition = function parseVariableDefinition() {
var start = this._lexer.token;
return {
kind: Kind.VARIABLE_DEFINITION,
variable: this.parseVariable(),
type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),
defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined,
directives: this.parseDirectives(true),
loc: this.loc(start)
};
}
/**
* Variable : $ Name
*/
;
_proto.parseVariable = function parseVariable() {
var start = this._lexer.token;
this.expectToken(TokenKind.DOLLAR);
return {
kind: Kind.VARIABLE,
name: this.parseName(),
loc: this.loc(start)
};
}
/**
* SelectionSet : { Selection+ }
*/
;
_proto.parseSelectionSet = function parseSelectionSet() {
var start = this._lexer.token;
return {
kind: Kind.SELECTION_SET,
selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),
loc: this.loc(start)
};
}
/**
* Selection :
* - Field
* - FragmentSpread
* - InlineFragment
*/
;
_proto.parseSelection = function parseSelection() {
return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
}
/**
* Field : Alias? Name Arguments? Directives? SelectionSet?
*
* Alias : Name :
*/
;
_proto.parseField = function parseField() {
var start = this._lexer.token;
var nameOrAlias = this.parseName();
var alias;
var name;
if (this.expectOptionalToken(TokenKind.COLON)) {
alias = nameOrAlias;
name = this.parseName();
} else {
name = nameOrAlias;
}
return {
kind: Kind.FIELD,
alias: alias,
name: name,
arguments: this.parseArguments(false),
directives: this.parseDirectives(false),
selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined,
loc: this.loc(start)
};
}
/**
* Arguments[Const] : ( Argument[?Const]+ )
*/
;
_proto.parseArguments = function parseArguments(isConst) {
var item = isConst ? this.parseConstArgument : this.parseArgument;
return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);
}
/**
* Argument[Const] : Name : Value[?Const]
*/
;
_proto.parseArgument = function parseArgument() {
var start = this._lexer.token;
var name = this.parseName();
this.expectToken(TokenKind.COLON);
return {
kind: Kind.ARGUMENT,
name: name,
value: this.parseValueLiteral(false),
loc: this.loc(start)
};
};
_proto.parseConstArgument = function parseConstArgument() {
var start = this._lexer.token;
return {
kind: Kind.ARGUMENT,
name: this.parseName(),
value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),
loc: this.loc(start)
};
} // Implements the parsing rules in the Fragments section.
/**
* Corresponds to both FragmentSpread and InlineFragment in the spec.
*
* FragmentSpread : ... FragmentName Directives?
*
* InlineFragment : ... TypeCondition? Directives? SelectionSet
*/
;
_proto.parseFragment = function parseFragment() {
var start = this._lexer.token;
this.expectToken(TokenKind.SPREAD);
var hasTypeCondition = this.expectOptionalKeyword('on');
if (!hasTypeCondition && this.peek(TokenKind.NAME)) {
return {
kind: Kind.FRAGMENT_SPREAD,
name: this.parseFragmentName(),
directives: this.parseDirectives(false),
loc: this.loc(start)
};
}
return {
kind: Kind.INLINE_FRAGMENT,
typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,
directives: this.parseDirectives(false),
selectionSet: this.parseSelectionSet(),
loc: this.loc(start)
};
}
/**
* FragmentDefinition :
* - fragment FragmentName on TypeCondition Directives? SelectionSet
*
* TypeCondition : NamedType
*/
;
_proto.parseFragmentDefinition = function parseFragmentDefinition() {
var _this$_options;
var start = this._lexer.token;
this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes
// the grammar of FragmentDefinition:
// - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet
if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {
return {
kind: Kind.FRAGMENT_DEFINITION,
name: this.parseFragmentName(),
variableDefinitions: this.parseVariableDefinitions(),
typeCondition: (this.expectKeyword('on'), this.parseNamedType()),
directives: this.parseDirectives(false),
selectionSet: this.parseSelectionSet(),
loc: this.loc(start)
};
}
return {
kind: Kind.FRAGMENT_DEFINITION,
name: this.parseFragmentName(),
typeCondition: (this.expectKeyword('on'), this.parseNamedType()),
directives: this.parseDirectives(false),
selectionSet: this.parseSelectionSet(),
loc: this.loc(start)
};
}
/**
* FragmentName : Name but not `on`
*/
;
_proto.parseFragmentName = function parseFragmentName() {
if (this._lexer.token.value === 'on') {
throw this.unexpected();
}
return this.parseName();
} // Implements the parsing rules in the Values section.
/**
* Value[Const] :
* - [~Const] Variable
* - IntValue
* - FloatValue
* - StringValue
* - BooleanValue
* - NullValue
* - EnumValue
* - ListValue[?Const]
* - ObjectValue[?Const]
*
* BooleanValue : one of `true` `false`
*
* NullValue : `null`
*
* EnumValue : Name but not `true`, `false` or `null`
*/
;
_proto.parseValueLiteral = function parseValueLiteral(isConst) {
var token = this._lexer.token;
switch (token.kind) {
case TokenKind.BRACKET_L:
return this.parseList(isConst);
case TokenKind.BRACE_L:
return this.parseObject(isConst);
case TokenKind.INT:
this._lexer.advance();
return {
kind: Kind.INT,
value: token.value,
loc: this.loc(token)
};
case TokenKind.FLOAT:
this._lexer.advance();
return {
kind: Kind.FLOAT,
value: token.value,
loc: this.loc(token)
};
case TokenKind.STRING:
case TokenKind.BLOCK_STRING:
return this.parseStringLiteral();
case TokenKind.NAME:
this._lexer.advance();
switch (token.value) {
case 'true':
return {
kind: Kind.BOOLEAN,
value: true,
loc: this.loc(token)
};
case 'false':
return {
kind: Kind.BOOLEAN,
value: false,
loc: this.loc(token)
};
case 'null':
return {
kind: Kind.NULL,
loc: this.loc(token)
};
default:
return {
kind: Kind.ENUM,
value: token.value,
loc: this.loc(token)
};
}
case TokenKind.DOLLAR:
if (!isConst) {
return this.parseVariable();
}
break;
}
throw this.unexpected();
};
_proto.parseStringLiteral = function parseStringLiteral() {
var token = this._lexer.token;
this._lexer.advance();
return {
kind: Kind.STRING,
value: token.value,
block: token.kind === TokenKind.BLOCK_STRING,
loc: this.loc(token)
};
}
/**
* ListValue[Const] :
* - [ ]
* - [ Value[?Const]+ ]
*/
;
_proto.parseList = function parseList(isConst) {
var _this = this;
var start = this._lexer.token;
var item = function item() {
return _this.parseValueLiteral(isConst);
};
return {
kind: Kind.LIST,
values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),
loc: this.loc(start)
};
}
/**
* ObjectValue[Const] :
* - { }
* - { ObjectField[?Const]+ }
*/
;
_proto.parseObject = function parseObject(isConst) {
var _this2 = this;
var start = this._lexer.token;
var item = function item() {
return _this2.parseObjectField(isConst);
};
return {
kind: Kind.OBJECT,
fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),
loc: this.loc(start)
};
}
/**
* ObjectField[Const] : Name : Value[?Const]
*/
;
_proto.parseObjectField = function parseObjectField(isConst) {
var start = this._lexer.token;
var name = this.parseName();
this.expectToken(TokenKind.COLON);
return {
kind: Kind.OBJECT_FIELD,
name: name,
value: this.parseValueLiteral(isConst),
loc: this.loc(start)
};
} // Implements the parsing rules in the Directives section.
/**
* Directives[Const] : Directive[?Const]+
*/
;
_proto.parseDirectives = function parseDirectives(isConst) {
var directives = [];
while (this.peek(TokenKind.AT)) {
directives.push(this.parseDirective(isConst));
}
return directives;
}
/**
* Directive[Const] : @ Name Arguments[?Const]?
*/
;
_proto.parseDirective = function parseDirective(isConst) {
var start = this._lexer.token;
this.expectToken(TokenKind.AT);
return {
kind: Kind.DIRECTIVE,
name: this.parseName(),
arguments: this.parseArguments(isConst),
loc: this.loc(start)
};
} // Implements the parsing rules in the Types section.
/**
* Type :
* - NamedType
* - ListType
* - NonNullType
*/
;
_proto.parseTypeReference = function parseTypeReference() {
var start = this._lexer.token;
var type;
if (this.expectOptionalToken(TokenKind.BRACKET_L)) {
type = this.parseTypeReference();
this.expectToken(TokenKind.BRACKET_R);
type = {
kind: Kind.LIST_TYPE,
type: type,
loc: this.loc(start)
};
} else {
type = this.parseNamedType();
}
if (this.expectOptionalToken(TokenKind.BANG)) {
return {
kind: Kind.NON_NULL_TYPE,
type: type,
loc: this.loc(start)
};
}
return type;
}
/**
* NamedType : Name
*/
;
_proto.parseNamedType = function parseNamedType() {
var start = this._lexer.token;
return {
kind: Kind.NAMED_TYPE,
name: this.parseName(),
loc: this.loc(start)
};
} // Implements the parsing rules in the Type Definition section.
/**
* TypeSystemDefinition :
* - SchemaDefinition
* - TypeDefinition
* - DirectiveDefinition
*
* TypeDefinition :
* - ScalarTypeDefinition
* - ObjectTypeDefinition
* - InterfaceTypeDefinition
* - UnionTypeDefinition
* - EnumTypeDefinition
* - InputObjectTypeDefinition
*/
;
_proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {
// Many definitions begin with a description and require a lookahead.
var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;
if (keywordToken.kind === TokenKind.NAME) {
switch (keywordToken.value) {
case 'schema':
return this.parseSchemaDefinition();
case 'scalar':
return this.parseScalarTypeDefinition();
case 'type':
return this.parseObjectTypeDefinition();
case 'interface':
return this.parseInterfaceTypeDefinition();
case 'union':
return this.parseUnionTypeDefinition();
case 'enum':
return this.parseEnumTypeDefinition();
case 'input':
return this.parseInputObjectTypeDefinition();
case 'directive':
return this.parseDirectiveDefinition();
}
}
throw this.unexpected(keywordToken);
};
_proto.peekDescription = function peekDescription() {
return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);
}
/**
* Description : StringValue
*/
;
_proto.parseDescription = function parseDescription() {
if (this.peekDescription()) {
return this.parseStringLiteral();
}
}
/**
* SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
*/
;
_proto.parseSchemaDefinition = function parseSchemaDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
this.expectKeyword('schema');
var directives = this.parseDirectives(true);
var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
return {
kind: Kind.SCHEMA_DEFINITION,
description: description,
directives: directives,
operationTypes: operationTypes,
loc: this.loc(start)
};
}
/**
* OperationTypeDefinition : OperationType : NamedType
*/
;
_proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {
var start = this._lexer.token;
var operation = this.parseOperationType();
this.expectToken(TokenKind.COLON);
var type = this.parseNamedType();
return {
kind: Kind.OPERATION_TYPE_DEFINITION,
operation: operation,
type: type,
loc: this.loc(start)
};
}
/**
* ScalarTypeDefinition : Description? scalar Name Directives[Const]?
*/
;
_proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
this.expectKeyword('scalar');
var name = this.parseName();
var directives = this.parseDirectives(true);
return {
kind: Kind.SCALAR_TYPE_DEFINITION,
description: description,
name: name,
directives: directives,
loc: this.loc(start)
};
}
/**
* ObjectTypeDefinition :
* Description?
* type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
*/
;
_proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
this.expectKeyword('type');
var name = this.parseName();
var interfaces = this.parseImplementsInterfaces();
var directives = this.parseDirectives(true);
var fields = this.parseFieldsDefinition();
return {
kind: Kind.OBJECT_TYPE_DEFINITION,
description: description,
name: name,
interfaces: interfaces,
directives: directives,
fields: fields,
loc: this.loc(start)
};
}
/**
* ImplementsInterfaces :
* - implements `&`? NamedType
* - ImplementsInterfaces & NamedType
*/
;
_proto.parseImplementsInterfaces = function parseImplementsInterfaces() {
var _this$_options2;
if (!this.expectOptionalKeyword('implements')) {
return [];
}
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
var types = []; // Optional leading ampersand
this.expectOptionalToken(TokenKind.AMP);
do {
types.push(this.parseNamedType());
} while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));
return types;
}
return this.delimitedMany(TokenKind.AMP, this.parseNamedType);
}
/**
* FieldsDefinition : { FieldDefinition+ }
*/
;
_proto.parseFieldsDefinition = function parseFieldsDefinition() {
var _this$_options3;
// Legacy support for the SDL?
if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {
this._lexer.advance();
this._lexer.advance();
return [];
}
return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);
}
/**
* FieldDefinition :
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
*/
;
_proto.parseFieldDefinition = function parseFieldDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
var name = this.parseName();
var args = this.parseArgumentDefs();
this.expectToken(TokenKind.COLON);
var type = this.parseTypeReference();
var directives = this.parseDirectives(true);
return {
kind: Kind.FIELD_DEFINITION,
description: description,
name: name,
arguments: args,
type: type,
directives: directives,
loc: this.loc(start)
};
}
/**
* ArgumentsDefinition : ( InputValueDefinition+ )
*/
;
_proto.parseArgumentDefs = function parseArgumentDefs() {
return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);
}
/**
* InputValueDefinition :
* - Description? Name : Type DefaultValue? Directives[Const]?
*/
;
_proto.parseInputValueDef = function parseInputValueDef() {
var start = this._lexer.token;
var description = this.parseDescription();
var name = this.parseName();
this.expectToken(TokenKind.COLON);
var type = this.parseTypeReference();
var defaultValue;
if (this.expectOptionalToken(TokenKind.EQUALS)) {
defaultValue = this.parseValueLiteral(true);
}
var directives = this.parseDirectives(true);
return {
kind: Kind.INPUT_VALUE_DEFINITION,
description: description,
name: name,
type: type,
defaultValue: defaultValue,
directives: directives,
loc: this.loc(start)
};
}
/**
* InterfaceTypeDefinition :
* - Description? interface Name Directives[Const]? FieldsDefinition?
*/
;
_proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
this.expectKeyword('interface');
var name = this.parseName();
var interfaces = this.parseImplementsInterfaces();
var directives = this.parseDirectives(true);
var fields = this.parseFieldsDefinition();
return {
kind: Kind.INTERFACE_TYPE_DEFINITION,
description: description,
name: name,
interfaces: interfaces,
directives: directives,
fields: fields,
loc: this.loc(start)
};
}
/**
* UnionTypeDefinition :
* - Description? union Name Directives[Const]? UnionMemberTypes?
*/
;
_proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
this.expectKeyword('union');
var name = this.parseName();
var directives = this.parseDirectives(true);
var types = this.parseUnionMemberTypes();
return {
kind: Kind.UNION_TYPE_DEFINITION,
description: description,
name: name,
directives: directives,
types: types,
loc: this.loc(start)
};
}
/**
* UnionMemberTypes :
* - = `|`? NamedType
* - UnionMemberTypes | NamedType
*/
;
_proto.parseUnionMemberTypes = function parseUnionMemberTypes() {
return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];
}
/**
* EnumTypeDefinition :
* - Description? enum Name Directives[Const]? EnumValuesDefinition?
*/
;
_proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
this.expectKeyword('enum');
var name = this.parseName();
var directives = this.parseDirectives(true);
var values = this.parseEnumValuesDefinition();
return {
kind: Kind.ENUM_TYPE_DEFINITION,
description: description,
name: name,
directives: directives,
values: values,
loc: this.loc(start)
};
}
/**
* EnumValuesDefinition : { EnumValueDefinition+ }
*/
;
_proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {
return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);
}
/**
* EnumValueDefinition : Description? EnumValue Directives[Const]?
*
* EnumValue : Name
*/
;
_proto.parseEnumValueDefinition = function parseEnumValueDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
var name = this.parseName();
var directives = this.parseDirectives(true);
return {
kind: Kind.ENUM_VALUE_DEFINITION,
description: description,
name: name,
directives: directives,
loc: this.loc(start)
};
}
/**
* InputObjectTypeDefinition :
* - Description? input Name Directives[Const]? InputFieldsDefinition?
*/
;
_proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
this.expectKeyword('input');
var name = this.parseName();
var directives = this.parseDirectives(true);
var fields = this.parseInputFieldsDefinition();
return {
kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,
description: description,
name: name,
directives: directives,
fields: fields,
loc: this.loc(start)
};
}
/**
* InputFieldsDefinition : { InputValueDefinition+ }
*/
;
_proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {
return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);
}
/**
* TypeSystemExtension :
* - SchemaExtension
* - TypeExtension
*
* TypeExtension :
* - ScalarTypeExtension
* - ObjectTypeExtension
* - InterfaceTypeExtension
* - UnionTypeExtension
* - EnumTypeExtension
* - InputObjectTypeDefinition
*/
;
_proto.parseTypeSystemExtension = function parseTypeSystemExtension() {
var keywordToken = this._lexer.lookahead();
if (keywordToken.kind === TokenKind.NAME) {
switch (keywordToken.value) {
case 'schema':
return this.parseSchemaExtension();
case 'scalar':
return this.parseScalarTypeExtension();
case 'type':
return this.parseObjectTypeExtension();
case 'interface':
return this.parseInterfaceTypeExtension();
case 'union':
return this.parseUnionTypeExtension();
case 'enum':
return this.parseEnumTypeExtension();
case 'input':
return this.parseInputObjectTypeExtension();
}
}
throw this.unexpected(keywordToken);
}
/**
* SchemaExtension :
* - extend schema Directives[Const]? { OperationTypeDefinition+ }
* - extend schema Directives[Const]
*/
;
_proto.parseSchemaExtension = function parseSchemaExtension() {
var start = this._lexer.token;
this.expectKeyword('extend');
this.expectKeyword('schema');
var directives = this.parseDirectives(true);
var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
if (directives.length === 0 && operationTypes.length === 0) {
throw this.unexpected();
}
return {
kind: Kind.SCHEMA_EXTENSION,
directives: directives,
operationTypes: operationTypes,
loc: this.loc(start)
};
}
/**
* ScalarTypeExtension :
* - extend scalar Name Directives[Const]
*/
;
_proto.parseScalarTypeExtension = function parseScalarTypeExtension() {
var start = this._lexer.token;
this.expectKeyword('extend');
this.expectKeyword('scalar');
var name = this.parseName();
var directives = this.parseDirectives(true);
if (directives.length === 0) {
throw this.unexpected();
}
return {
kind: Kind.SCALAR_TYPE_EXTENSION,
name: name,
directives: directives,
loc: this.loc(start)
};
}
/**
* ObjectTypeExtension :
* - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
* - extend type Name ImplementsInterfaces? Directives[Const]
* - extend type Name ImplementsInterfaces
*/
;
_proto.parseObjectTypeExtension = function parseObjectTypeExtension() {
var start = this._lexer.token;
this.expectKeyword('extend');
this.expectKeyword('type');
var name = this.parseName();
var interfaces = this.parseImplementsInterfaces();
var directives = this.parseDirectives(true);
var fields = this.parseFieldsDefinition();
if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {
throw this.unexpected();
}
return {
kind: Kind.OBJECT_TYPE_EXTENSION,
name: name,
interfaces: interfaces,
directives: directives,
fields: fields,
loc: this.loc(start)
};
}
/**
* InterfaceTypeExtension :
* - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
* - extend interface Name ImplementsInterfaces? Directives[Const]
* - extend interface Name ImplementsInterfaces
*/
;
_proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {
var start = this._lexer.token;
this.expectKeyword('extend');
this.expectKeyword('interface');
var name = this.parseName();
var interfaces = this.parseImplementsInterfaces();
var directives = this.parseDirectives(true);
var fields = this.parseFieldsDefinition();
if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {
throw this.unexpected();
}
return {
kind: Kind.INTERFACE_TYPE_EXTENSION,
name: name,
interfaces: interfaces,
directives: directives,
fields: fields,
loc: this.loc(start)
};
}
/**
* UnionTypeExtension :
* - extend union Name Directives[Const]? UnionMemberTypes
* - extend union Name Directives[Const]
*/
;
_proto.parseUnionTypeExtension = function parseUnionTypeExtension() {
var start = this._lexer.token;
this.expectKeyword('extend');
this.expectKeyword('union');
var name = this.parseName();
var directives = this.parseDirectives(true);
var types = this.parseUnionMemberTypes();
if (directives.length === 0 && types.length === 0) {
throw this.unexpected();
}
return {
kind: Kind.UNION_TYPE_EXTENSION,
name: name,
directives: directives,
types: types,
loc: this.loc(start)
};
}
/**
* EnumTypeExtension :
* - extend enum Name Directives[Const]? EnumValuesDefinition
* - extend enum Name Directives[Const]
*/
;
_proto.parseEnumTypeExtension = function parseEnumTypeExtension() {
var start = this._lexer.token;
this.expectKeyword('extend');
this.expectKeyword('enum');
var name = this.parseName();
var directives = this.parseDirectives(true);
var values = this.parseEnumValuesDefinition();
if (directives.length === 0 && values.length === 0) {
throw this.unexpected();
}
return {
kind: Kind.ENUM_TYPE_EXTENSION,
name: name,
directives: directives,
values: values,
loc: this.loc(start)
};
}
/**
* InputObjectTypeExtension :
* - extend input Name Directives[Const]? InputFieldsDefinition
* - extend input Name Directives[Const]
*/
;
_proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {
var start = this._lexer.token;
this.expectKeyword('extend');
this.expectKeyword('input');
var name = this.parseName();
var directives = this.parseDirectives(true);
var fields = this.parseInputFieldsDefinition();
if (directives.length === 0 && fields.length === 0) {
throw this.unexpected();
}
return {
kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,
name: name,
directives: directives,
fields: fields,
loc: this.loc(start)
};
}
/**
* DirectiveDefinition :
* - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
*/
;
_proto.parseDirectiveDefinition = function parseDirectiveDefinition() {
var start = this._lexer.token;
var description = this.parseDescription();
this.expectKeyword('directive');
this.expectToken(TokenKind.AT);
var name = this.parseName();
var args = this.parseArgumentDefs();
var repeatable = this.expectOptionalKeyword('repeatable');
this.expectKeyword('on');
var locations = this.parseDirectiveLocations();
return {
kind: Kind.DIRECTIVE_DEFINITION,
description: description,
name: name,
arguments: args,
repeatable: repeatable,
locations: locations,
loc: this.loc(start)
};
}
/**
* DirectiveLocations :
* - `|`? DirectiveLocation
* - DirectiveLocations | DirectiveLocation
*/
;
_proto.parseDirectiveLocations = function parseDirectiveLocations() {
return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
}
/*
* DirectiveLocation :
* - ExecutableDirectiveLocation
* - TypeSystemDirectiveLocation
*
* ExecutableDirectiveLocation : one of
* `QUERY`
* `MUTATION`
* `SUBSCRIPTION`
* `FIELD`
* `FRAGMENT_DEFINITION`
* `FRAGMENT_SPREAD`
* `INLINE_FRAGMENT`
*
* TypeSystemDirectiveLocation : one of
* `SCHEMA`
* `SCALAR`
* `OBJECT`
* `FIELD_DEFINITION`
* `ARGUMENT_DEFINITION`
* `INTERFACE`
* `UNION`
* `ENUM`
* `ENUM_VALUE`
* `INPUT_OBJECT`
* `INPUT_FIELD_DEFINITION`
*/
;
_proto.parseDirectiveLocation = function parseDirectiveLocation() {
var start = this._lexer.token;
var name = this.parseName();
if (DirectiveLocation[name.value] !== undefined) {
return name;
}
throw this.unexpected(start);
} // Core parsing utility functions
/**
* Returns a location object, used to identify the place in the source that created a given parsed object.
*/
;
_proto.loc = function loc(startToken) {
var _this$_options4;
if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {
return new Location(startToken, this._lexer.lastToken, this._lexer.source);
}
}
/**
* Determines if the next token is of a given kind
*/
;
_proto.peek = function peek(kind) {
return this._lexer.token.kind === kind;
}
/**
* If the next token is of the given kind, return that token after advancing the lexer.
* Otherwise, do not change the parser state and throw an error.
*/
;
_proto.expectToken = function expectToken(kind) {
var token = this._lexer.token;
if (token.kind === kind) {
this._lexer.advance();
return token;
}
throw syntaxError(this._lexer.source, token.start, "Expected ".concat(getTokenKindDesc(kind), ", found ").concat(getTokenDesc(token), "."));
}
/**
* If the next token is of the given kind, return that token after advancing the lexer.
* Otherwise, do not change the parser state and return undefined.
*/
;
_proto.expectOptionalToken = function expectOptionalToken(kind) {
var token = this._lexer.token;
if (token.kind === kind) {
this._lexer.advance();
return token;
}
return undefined;
}
/**
* If the next token is a given keyword, advance the lexer.
* Otherwise, do not change the parser state and throw an error.
*/
;
_proto.expectKeyword = function expectKeyword(value) {
var token = this._lexer.token;
if (token.kind === TokenKind.NAME && token.value === value) {
this._lexer.advance();
} else {
throw syntaxError(this._lexer.source, token.start, "Expected \"".concat(value, "\", found ").concat(getTokenDesc(token), "."));
}
}
/**
* If the next token is a given keyword, return "true" after advancing the lexer.
* Otherwise, do not change the parser state and return "false".
*/
;
_proto.expectOptionalKeyword = function expectOptionalKeyword(value) {
var token = this._lexer.token;
if (token.kind === TokenKind.NAME && token.value === value) {
this._lexer.advance();
return true;
}
return false;
}
/**
* Helper function for creating an error when an unexpected lexed token is encountered.
*/
;
_proto.unexpected = function unexpected(atToken) {
var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;
return syntaxError(this._lexer.source, token.start, "Unexpected ".concat(getTokenDesc(token), "."));
}
/**
* Returns a possibly empty list of parse nodes, determined by the parseFn.
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
* Advances the parser to the next lex token after the closing token.
*/
;
_proto.any = function any(openKind, parseFn, closeKind) {
this.expectToken(openKind);
var nodes = [];
while (!this.expectOptionalToken(closeKind)) {
nodes.push(parseFn.call(this));
}
return nodes;
}
/**
* Returns a list of parse nodes, determined by the parseFn.
* It can be empty only if open token is missing otherwise it will always return non-empty list
* that begins with a lex token of openKind and ends with a lex token of closeKind.
* Advances the parser to the next lex token after the closing token.
*/
;
_proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {
if (this.expectOptionalToken(openKind)) {
var nodes = [];
do {
nodes.push(parseFn.call(this));
} while (!this.expectOptionalToken(closeKind));
return nodes;
}
return [];
}
/**
* Returns a non-empty list of parse nodes, determined by the parseFn.
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
* Advances the parser to the next lex token after the closing token.
*/
;
_proto.many = function many(openKind, parseFn, closeKind) {
this.expectToken(openKind);
var nodes = [];
do {
nodes.push(parseFn.call(this));
} while (!this.expectOptionalToken(closeKind));
return nodes;
}
/**
* Returns a non-empty list of parse nodes, determined by the parseFn.
* This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
* Advances the parser to the next lex token after last item in the list.
*/
;
_proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {
this.expectOptionalToken(delimiterKind);
var nodes = [];
do {
nodes.push(parseFn.call(this));
} while (this.expectOptionalToken(delimiterKind));
return nodes;
};
return Parser;
}();
/**
* A helper function to describe a token as a string for debugging.
*/
function getTokenDesc(token) {
var value = token.value;
return getTokenKindDesc(token.kind) + (value != null ? " \"".concat(value, "\"") : '');
}
/**
* A helper function to describe a token kind as a string for debugging.
*/
function getTokenKindDesc(kind) {
return isPunctuatorTokenKind(kind) ? "\"".concat(kind, "\"") : kind;
}
webpack://frontend-tpt/../../node_modules/@apollo/client/node_modules/graphql-tag/lib/index.js
import { __assign } from "tslib";
import { parse } from 'graphql';
var docCache = new Map();
var fragmentSourceMap = new Map();
var printFragmentWarnings = true;
var experimentalFragmentVariables = false;
function normalize(string) {
return string.replace(/[\s,]+/g, ' ').trim();
}
function cacheKeyFromLoc(loc) {
return normalize(loc.source.body.substring(loc.start, loc.end));
}
function processFragments(ast) {
var seenKeys = new Set();
var definitions = [];
ast.definitions.forEach(function (fragmentDefinition) {
if (fragmentDefinition.kind === 'FragmentDefinition') {
var fragmentName = fragmentDefinition.name.value;
var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);
var sourceKeySet = fragmentSourceMap.get(fragmentName);
if (sourceKeySet && !sourceKeySet.has(sourceKey)) {
if (printFragmentWarnings) {
console.warn("Warning: fragment with name " + fragmentName + " already exists.\n"
+ "graphql-tag enforces all fragment names across your application to be unique; read more about\n"
+ "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names");
}
}
else if (!sourceKeySet) {
fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);
}
sourceKeySet.add(sourceKey);
if (!seenKeys.has(sourceKey)) {
seenKeys.add(sourceKey);
definitions.push(fragmentDefinition);
}
}
else {
definitions.push(fragmentDefinition);
}
});
return __assign(__assign({}, ast), { definitions: definitions });
}
function stripLoc(doc) {
var workSet = new Set(doc.definitions);
workSet.forEach(function (node) {
if (node.loc)
delete node.loc;
Object.keys(node).forEach(function (key) {
var value = node[key];
if (value && typeof value === 'object') {
workSet.add(value);
}
});
});
var loc = doc.loc;
if (loc) {
delete loc.startToken;
delete loc.endToken;
}
return doc;
}
function parseDocument(source) {
var cacheKey = normalize(source);
if (!docCache.has(cacheKey)) {
var parsed = parse(source, {
experimentalFragmentVariables: experimentalFragmentVariables,
allowLegacyFragmentVariables: experimentalFragmentVariables
});
if (!parsed || parsed.kind !== 'Document') {
throw new Error('Not a valid GraphQL document.');
}
docCache.set(cacheKey, stripLoc(processFragments(parsed)));
}
return docCache.get(cacheKey);
}
export function gql(literals) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
if (typeof literals === 'string') {
literals = [literals];
}
var result = literals[0];
args.forEach(function (arg, i) {
if (arg && arg.kind === 'Document') {
result += arg.loc.source.body;
}
else {
result += arg;
}
result += literals[i + 1];
});
return parseDocument(result);
}
export function resetCaches() {
docCache.clear();
fragmentSourceMap.clear();
}
export function disableFragmentWarnings() {
printFragmentWarnings = false;
}
export function enableExperimentalFragmentVariables() {
experimentalFragmentVariables = true;
}
export function disableExperimentalFragmentVariables() {
experimentalFragmentVariables = false;
}
var extras = {
gql: gql,
resetCaches: resetCaches,
disableFragmentWarnings: disableFragmentWarnings,
enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,
disableExperimentalFragmentVariables: disableExperimentalFragmentVariables
};
(function (gql_1) {
gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;
})(gql || (gql = {}));
gql["default"] = gql;
export default gql;
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/fragments/TalentFragment.ts
import { gql } from "@apollo/client";
export const TalentPickTalentFragment = {
entry: gql`
fragment Talent on TalentPickType {
talent {
talentId
name
pictureUrl
phrases
pickCount
}
}
`
};
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/fragments/RaceFragment.ts
import { gql } from "@apollo/client";
export const TalentPickRaceFragment = {
entry: gql`
fragment Race on TalentPickType {
race {
id
tvgRaceId
number
track {
id
code
name
}
mtp
postTime
isGreyhound
numRunners
status {
code
}
type {
code
}
highlighted(product: $product, device: $device, brand: $brand) {
description
style
}
bettingInterests {
biNumber
saddleColor
numberColor
runners {
runnerId
entityRunnerId
scratched
}
}
}
}
`
};
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/fragments/WagerTypesFragment.ts
import { gql } from "@apollo/client";
export const TalentPickWagerFragment = {
entry: gql`
fragment WagerType on TalentPickType {
wagerType {
type {
id
code
}
legCount
isBox
isKey
isWheel
}
}
`
};
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/queries/talentPicksQuery.ts
import { gql } from "@apollo/client";
import { TalentPickTalentFragment } from "../fragments/TalentFragment";
import { TalentPickRaceFragment } from "../fragments/RaceFragment";
import { TalentPickWagerFragment } from "../fragments/WagerTypesFragment";
export const GET_GRAPH_TALENT_PICKS = gql`
query getGraphTalentPicks(
$wagerProfile: String
$product: String
$device: String
$brand: String
$trackCode: String
$raceNumber: String
) {
talentPicksList: talentPicks(
sort: { byPostTime: ASC }
profile: $wagerProfile
trackCode: $trackCode
raceNumber: $raceNumber
) {
id
...Talent
...Race
...WagerType
amount
price
selections {
order
}
favorites {
order
}
}
}
${TalentPickTalentFragment.entry}
${TalentPickRaceFragment.entry}
${TalentPickWagerFragment.entry}
`;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/queries/talentPicksSubscription.ts
import { gql } from "@apollo/client";
import { TalentPickTalentFragment } from "../fragments/TalentFragment";
import { TalentPickRaceFragment } from "../fragments/RaceFragment";
import { TalentPickWagerFragment } from "../fragments/WagerTypesFragment";
export const GET_TALENT_PICKS_SUBSCRIPTION = gql`
subscription newTalentPickUpdate(
$wagerProfile: String
$product: String
$device: String
$brand: String
) {
talentPicksList: newTalentPickUpdate(profile: $wagerProfile) {
id
...Talent
...Race
...WagerType
amount
price
selections {
order
}
favorites {
order
}
}
}
${TalentPickTalentFragment.entry}
${TalentPickRaceFragment.entry}
${TalentPickWagerFragment.entry}
`;
webpack://frontend-tpt/../../node_modules/uuid/dist/esm-browser/v1.js
import rng from './rng.js';
import { unsafeStringify } from './stringify.js'; // **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
let _nodeId;
let _clockseq; // Previous uuid creation time
let _lastMSecs = 0;
let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
let i = buf && offset || 0;
const b = buf || new Array(16);
options = options || {};
let node = options.node || _nodeId;
let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
// specified. We do this lazily to minimize issues related to insufficient
// system entropy. See #189
if (node == null || clockseq == null) {
const seedBytes = options.random || (options.rng || rng)();
if (node == null) {
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
}
if (clockseq == null) {
// Per 4.2.2, randomize (14 bit) clockseq
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
}
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
if (dt < 0 && options.clockseq === undefined) {
clockseq = clockseq + 1 & 0x3fff;
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
// time interval
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
nsecs = 0;
} // Per 4.2.1.2 Throw error if too many uuids are requested
if (nsecs >= 10000) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
msecs += 12219292800000; // `time_low`
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
b[i++] = tl >>> 24 & 0xff;
b[i++] = tl >>> 16 & 0xff;
b[i++] = tl >>> 8 & 0xff;
b[i++] = tl & 0xff; // `time_mid`
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
b[i++] = tmh >>> 8 & 0xff;
b[i++] = tmh & 0xff; // `time_high_and_version`
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
b[i++] = clockseq & 0xff; // `node`
for (let n = 0; n < 6; ++n) {
b[i + n] = node[n];
}
return buf || unsafeStringify(b);
}
export default v1;
webpack://frontend-tpt/../../packages/tvg-lib-api/tpm/index.ts
import tvgConf from "@tvg/conf";
import { get } from "lodash/fp";
// @ts-ignore
import { v1 as generateUUID } from "uuid";
import { TalentPickData } from "@tvg/ts-types/TalentPicks";
import getProtocol from "../protocolSetter";
import requester from "../requester";
const tpmService: string = "service.tpm";
const getTpmServiceUrl = (): string => `${tvgConf().config(tpmService)}`;
type raceType = {
trackAbbr: string | undefined;
raceNumber: string | undefined;
};
type pick = {
id: string;
};
type TalentsParams = {
isActive: boolean;
};
export type selectionsType = Array<
Array<{
order: number;
}>
>;
const placePick = (
selections: selectionsType,
favoriteSelections: selectionsType,
wagerType: string,
betAmount: number,
betCost: number,
race: raceType,
talentId?: number
): Promise<pick> => {
if (betAmount <= 0 && betCost <= 0) {
return Promise.reject(new Error("Invalid bet params"));
}
if (!talentId) {
return Promise.reject(new Error("Invalid talent id"));
}
if (!selections.length) {
return Promise.reject(new Error("Invalid selections"));
}
if (!get("trackAbbr", race) || !get("raceNumber", race)) {
return Promise.reject(new Error("Invalid race params"));
}
const uuid = generateUUID();
const postData = {
id: uuid,
selections,
favorites: favoriteSelections,
amount: betAmount,
price: +betCost.toFixed(2),
wagerType: { abbreviation: wagerType },
track: race.trackAbbr,
race: race.raceNumber,
published: true
};
return requester()({
method: "post",
url: `${getProtocol()}${getTpmServiceUrl()}/talents/${talentId}/picks`,
data: postData,
withCredentials: true,
headers: {
"Content-Type": "application/json",
"X-XSRF-TOKEN": uuid,
"x-tvg-context": tvgConf().context()
}
}).then(get("data"));
};
const getAllTalents = (params?: TalentsParams) =>
requester()({
method: "get",
url: `${getProtocol()}${getTpmServiceUrl()}/talents`,
withCredentials: true,
headers: {
"Content-Type": "application/json",
"x-tvg-context": tvgConf().context()
},
params
});
const updateTalentPick = (
updatedTalentPick: TalentPickData
): Promise<unknown> =>
requester()({
method: "put",
url: `${getProtocol()}${getTpmServiceUrl()}/talents/${updatedTalentPick.talent.talentId}/picks/${updatedTalentPick.id}`,
data: updatedTalentPick,
withCredentials: true,
headers: {
"Content-Type": "application/json",
"x-tvg-context": tvgConf().context()
}
}).then(get("data"));
const getWagerOpsPicks = () =>
requester()({
method: "get",
url: `${getProtocol()}${getTpmServiceUrl()}/picks`,
withCredentials: true,
headers: {
"Content-Type": "application/json",
"x-tvg-context": tvgConf().context()
}
}).then(get("data"));
const getTalentPicks = (talentId: string) =>
requester()({
method: "get",
url: `${getProtocol()}${getTpmServiceUrl()}/talents/${talentId}/picks`,
withCredentials: true,
headers: {
"Content-Type": "application/json",
"x-tvg-context": tvgConf().context()
}
}).then(get("data"));
const TPM_SERVICE = {
placePick,
getAllTalents,
updateTalentPick,
getWagerOpsPicks,
getTalentPicks
};
export default TPM_SERVICE;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/redux/defaultValues.ts
import { TalentPicksDefaultMessages } from "../types";
export const talentPicksDefaultMessages: TalentPicksDefaultMessages = {
title: "FDTV Picks",
picksResulted: "Resulted Races",
emptyState: {
title: "No FDTV picks available",
description: "There are no picks available for today"
},
trackFilter: {
filterLabel: "Track",
selectedValue: "",
selectedLabel: "All Tracks"
},
expertFilter: {
filterLabel: "Expert",
selectedValue: "",
selectedLabel: "All Experts"
},
tool: {
alert: {
title: "Talent Picks Tool.",
description: "You can create or disable FDTV Picks for today here."
},
myPicksFilter: "My FDTV Picks",
toolBar: {
description: "Create an FDTV Pick from the selections.",
cancelButton: "Cancel",
createButton: "Create FDTV Pick"
},
talentsModal: {
title: "Create FDTV Pick on behalf of:",
selectButton: "Select",
cancelButton: "Cancel"
},
createModal: {
title: "Create FDTV Pick",
wagerTypeSelector: {
empty: "This pick has started. No bets available for this leg."
}
},
confirmModal: {
title: "Confirm FDTV Pick",
success: {
title: "FDTV Pick Created"
},
checkboxLabel: "Don't show me confirmation step again",
errorMessage:
"Sorry we cannot confirm your FDTV Pick card. Please try again in a few minutes.",
returnButton: "Return to Race",
retainButton: "Retain Runners",
syncToastText:
"Talent Picks may take a moment to update, we appreciate your patience"
}
}
};
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/redux/selectors.ts
import { isURP } from "@tvg/utils/generalUtils";
import { AccountRolesEnum } from "@tvg/ts-types/Account";
import { get } from "lodash";
import parseCAPIMessage from "@tvg/utils/capiUtils";
import { Store } from "@reduxjs/toolkit";
import { TalentPicksDefaultMessages } from "../types";
import { talentPicksDefaultMessages } from "./defaultValues";
export const getTalentPicksPageMsgs = (
store: Store
): TalentPicksDefaultMessages =>
parseCAPIMessage(
store,
"capi.messages.TalentPicksPage",
talentPicksDefaultMessages
);
export const getBlacklistedWagerTypes = (
store: unknown,
isURPProgramPageXSellEnabled: boolean
) =>
isURP || isURPProgramPageXSellEnabled
? parseCAPIMessage(store, "capi.messages.URP_FDRBlacklistedBets", undefined)
: parseCAPIMessage(store, "capi.messages.FDRBlacklistedBets", undefined);
export const getTalentPicksSectionTitle = (store: Store) =>
parseCAPIMessage(store, "capi.messages.TalentPicks_pgp", "FDTV Picks");
export const getTalentPicksListSize = (store: Store) =>
parseCAPIMessage(store, "capi.messages.numTPCardstoShowInHP", 5);
export const getTalentPicksErrorCodes = (store: Store) =>
parseCAPIMessage(store, "capi.messages.talentPicksToolErrorCodes", {});
export const getTalentPicksToggleONPgP = (store: Store) =>
parseCAPIMessage(store, "capi.featureToggles.talentPicksOnProgPage", false);
export const getEnableURPTalentPicksTool = (store: Store) =>
parseCAPIMessage(
store,
"capi.featureToggles.enableURPTalentPicksTool",
false
);
export const userRoles = (store: Store): Array<AccountRolesEnum> =>
get(store, "userData.user.accountRoles", []);
export const getTalentPicksSelectedTalent = (store: Store) =>
get(store, "talentPicks.talent.selectedTalent", null);
webpack://frontend-tpt/../../node_modules/@amplitude/analytics-connector/dist/analytics-connector.esm.js
var ApplicationContextProviderImpl = /** @class */ (function () {
function ApplicationContextProviderImpl() {
}
ApplicationContextProviderImpl.prototype.getApplicationContext = function () {
return {
versionName: this.versionName,
language: getLanguage(),
platform: 'Web',
os: undefined,
deviceModel: undefined,
};
};
return ApplicationContextProviderImpl;
}());
var getLanguage = function () {
return ((typeof navigator !== 'undefined' &&
((navigator.languages && navigator.languages[0]) ||
navigator.language)) ||
'');
};
var EventBridgeImpl = /** @class */ (function () {
function EventBridgeImpl() {
this.queue = [];
}
EventBridgeImpl.prototype.logEvent = function (event) {
if (!this.receiver) {
if (this.queue.length < 512) {
this.queue.push(event);
}
}
else {
this.receiver(event);
}
};
EventBridgeImpl.prototype.setEventReceiver = function (receiver) {
this.receiver = receiver;
if (this.queue.length > 0) {
this.queue.forEach(function (event) {
receiver(event);
});
this.queue = [];
}
};
return EventBridgeImpl;
}());
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var isEqual = function (obj1, obj2) {
var primitive = ['string', 'number', 'boolean', 'undefined'];
var typeA = typeof obj1;
var typeB = typeof obj2;
if (typeA !== typeB) {
return false;
}
for (var _i = 0, primitive_1 = primitive; _i < primitive_1.length; _i++) {
var p = primitive_1[_i];
if (p === typeA) {
return obj1 === obj2;
}
}
// check null
if (obj1 == null && obj2 == null) {
return true;
}
else if (obj1 == null || obj2 == null) {
return false;
}
// if got here - objects
if (obj1.length !== obj2.length) {
return false;
}
//check if arrays
var isArrayA = Array.isArray(obj1);
var isArrayB = Array.isArray(obj2);
if (isArrayA !== isArrayB) {
return false;
}
if (isArrayA && isArrayB) {
//arrays
for (var i = 0; i < obj1.length; i++) {
if (!isEqual(obj1[i], obj2[i])) {
return false;
}
}
}
else {
//objects
var sorted1 = Object.keys(obj1).sort();
var sorted2 = Object.keys(obj2).sort();
if (!isEqual(sorted1, sorted2)) {
return false;
}
//compare object values
var result_1 = true;
Object.keys(obj1).forEach(function (key) {
if (!isEqual(obj1[key], obj2[key])) {
result_1 = false;
}
});
return result_1;
}
return true;
};
var ID_OP_SET = '$set';
var ID_OP_UNSET = '$unset';
var ID_OP_CLEAR_ALL = '$clearAll';
// Polyfill for Object.entries
if (!Object.entries) {
Object.entries = function (obj) {
var ownProps = Object.keys(obj);
var i = ownProps.length;
var resArray = new Array(i);
while (i--) {
resArray[i] = [ownProps[i], obj[ownProps[i]]];
}
return resArray;
};
}
var IdentityStoreImpl = /** @class */ (function () {
function IdentityStoreImpl() {
this.identity = { userProperties: {} };
this.listeners = new Set();
}
IdentityStoreImpl.prototype.editIdentity = function () {
// eslint-disable-next-line @typescript-eslint/no-this-alias
var self = this;
var actingUserProperties = __assign({}, this.identity.userProperties);
var actingIdentity = __assign(__assign({}, this.identity), { userProperties: actingUserProperties });
return {
setUserId: function (userId) {
actingIdentity.userId = userId;
return this;
},
setDeviceId: function (deviceId) {
actingIdentity.deviceId = deviceId;
return this;
},
setUserProperties: function (userProperties) {
actingIdentity.userProperties = userProperties;
return this;
},
setOptOut: function (optOut) {
actingIdentity.optOut = optOut;
return this;
},
updateUserProperties: function (actions) {
var actingProperties = actingIdentity.userProperties || {};
for (var _i = 0, _a = Object.entries(actions); _i < _a.length; _i++) {
var _b = _a[_i], action = _b[0], properties = _b[1];
switch (action) {
case ID_OP_SET:
for (var _c = 0, _d = Object.entries(properties); _c < _d.length; _c++) {
var _e = _d[_c], key = _e[0], value = _e[1];
actingProperties[key] = value;
}
break;
case ID_OP_UNSET:
for (var _f = 0, _g = Object.keys(properties); _f < _g.length; _f++) {
var key = _g[_f];
delete actingProperties[key];
}
break;
case ID_OP_CLEAR_ALL:
actingProperties = {};
break;
}
}
actingIdentity.userProperties = actingProperties;
return this;
},
commit: function () {
self.setIdentity(actingIdentity);
return this;
},
};
};
IdentityStoreImpl.prototype.getIdentity = function () {
return __assign({}, this.identity);
};
IdentityStoreImpl.prototype.setIdentity = function (identity) {
var originalIdentity = __assign({}, this.identity);
this.identity = __assign({}, identity);
if (!isEqual(originalIdentity, this.identity)) {
this.listeners.forEach(function (listener) {
listener(identity);
});
}
};
IdentityStoreImpl.prototype.addIdentityListener = function (listener) {
this.listeners.add(listener);
};
IdentityStoreImpl.prototype.removeIdentityListener = function (listener) {
this.listeners.delete(listener);
};
return IdentityStoreImpl;
}());
var safeGlobal = typeof globalThis !== 'undefined'
? globalThis
: typeof global !== 'undefined'
? global
: self;
var AnalyticsConnector = /** @class */ (function () {
function AnalyticsConnector() {
this.identityStore = new IdentityStoreImpl();
this.eventBridge = new EventBridgeImpl();
this.applicationContextProvider = new ApplicationContextProviderImpl();
}
AnalyticsConnector.getInstance = function (instanceName) {
if (!safeGlobal['analyticsConnectorInstances']) {
safeGlobal['analyticsConnectorInstances'] = {};
}
if (!safeGlobal['analyticsConnectorInstances'][instanceName]) {
safeGlobal['analyticsConnectorInstances'][instanceName] =
new AnalyticsConnector();
}
return safeGlobal['analyticsConnectorInstances'][instanceName];
};
return AnalyticsConnector;
}());
export { AnalyticsConnector };
webpack://frontend-tpt/../../node_modules/@amplitude/experiment-core/dist/experiment-core.esm.js
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
};
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P ? value : new P(function (resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1];
return t[1];
},
trys: [],
ops: []
},
f,
y,
t,
g;
return g = {
next: verb(0),
"throw": verb(1),
"return": verb(2)
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
return this;
}), g;
function verb(n) {
return function (v) {
return step([n, v]);
};
}
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return {
value: op[1],
done: false
};
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5) throw op[1];
return {
value: op[0] ? op[1] : void 0,
done: true
};
}
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator,
m = s && o[s],
i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return {
value: o && o[i++],
done: !o
};
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
} catch (error) {
e = {
error: error
};
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var EvaluationOperator = {
IS: 'is',
IS_NOT: 'is not',
CONTAINS: 'contains',
DOES_NOT_CONTAIN: 'does not contain',
LESS_THAN: 'less',
LESS_THAN_EQUALS: 'less or equal',
GREATER_THAN: 'greater',
GREATER_THAN_EQUALS: 'greater or equal',
VERSION_LESS_THAN: 'version less',
VERSION_LESS_THAN_EQUALS: 'version less or equal',
VERSION_GREATER_THAN: 'version greater',
VERSION_GREATER_THAN_EQUALS: 'version greater or equal',
SET_IS: 'set is',
SET_IS_NOT: 'set is not',
SET_CONTAINS: 'set contains',
SET_DOES_NOT_CONTAIN: 'set does not contain',
SET_CONTAINS_ANY: 'set contains any',
SET_DOES_NOT_CONTAIN_ANY: 'set does not contain any',
REGEX_MATCH: 'regex match',
REGEX_DOES_NOT_MATCH: 'regex does not match',
};
var stringToUtf8ByteArray = function (str) {
var out = [];
var p = 0;
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i);
if (c < 128) {
out[p++] = c;
}
else if (c < 2048) {
out[p++] = (c >> 6) | 192;
out[p++] = (c & 63) | 128;
}
else if ((c & 0xfc00) == 0xd800 &&
i + 1 < str.length &&
(str.charCodeAt(i + 1) & 0xfc00) == 0xdc00) {
// Surrogate Pair
c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);
out[p++] = (c >> 18) | 240;
out[p++] = ((c >> 12) & 63) | 128;
out[p++] = ((c >> 6) & 63) | 128;
out[p++] = (c & 63) | 128;
}
else {
out[p++] = (c >> 12) | 224;
out[p++] = ((c >> 6) & 63) | 128;
out[p++] = (c & 63) | 128;
}
}
return Uint8Array.from(out);
};
var C1_32 = -0x3361d2af;
var C2_32 = 0x1b873593;
var R1_32 = 15;
var R2_32 = 13;
var M_32 = 5;
var N_32 = -0x19ab949c;
var hash32x86 = function (input, seed) {
if (seed === void 0) { seed = 0; }
var data = stringToUtf8ByteArray(input);
var length = data.length;
var nBlocks = length >> 2;
var hash = seed;
// body
for (var i = 0; i < nBlocks; i++) {
var index_1 = i << 2;
var k = readIntLe(data, index_1);
hash = mix32(k, hash);
}
// tail
var index = nBlocks << 2;
var k1 = 0;
switch (length - index) {
case 3:
k1 ^= data[index + 2] << 16;
k1 ^= data[index + 1] << 8;
k1 ^= data[index];
k1 = Math.imul(k1, C1_32);
k1 = rotateLeft(k1, R1_32);
k1 = Math.imul(k1, C2_32);
hash ^= k1;
break;
case 2:
k1 ^= data[index + 1] << 8;
k1 ^= data[index];
k1 = Math.imul(k1, C1_32);
k1 = rotateLeft(k1, R1_32);
k1 = Math.imul(k1, C2_32);
hash ^= k1;
break;
case 1:
k1 ^= data[index];
k1 = Math.imul(k1, C1_32);
k1 = rotateLeft(k1, R1_32);
k1 = Math.imul(k1, C2_32);
hash ^= k1;
break;
}
hash ^= length;
return fmix32(hash) >>> 0;
};
var mix32 = function (k, hash) {
var kResult = k;
var hashResult = hash;
kResult = Math.imul(kResult, C1_32);
kResult = rotateLeft(kResult, R1_32);
kResult = Math.imul(kResult, C2_32);
hashResult ^= kResult;
hashResult = rotateLeft(hashResult, R2_32);
hashResult = Math.imul(hashResult, M_32);
return (hashResult + N_32) | 0;
};
var fmix32 = function (hash) {
var hashResult = hash;
hashResult ^= hashResult >>> 16;
hashResult = Math.imul(hashResult, -0x7a143595);
hashResult ^= hashResult >>> 13;
hashResult = Math.imul(hashResult, -0x3d4d51cb);
hashResult ^= hashResult >>> 16;
return hashResult;
};
var rotateLeft = function (x, n, width) {
if (width === void 0) { width = 32; }
if (n > width)
n = n % width;
var mask = (0xffffffff << (width - n)) >>> 0;
var r = (((x & mask) >>> 0) >>> (width - n)) >>> 0;
return ((x << n) | r) >>> 0;
};
var readIntLe = function (data, index) {
if (index === void 0) { index = 0; }
var n = (data[index] << 24) |
(data[index + 1] << 16) |
(data[index + 2] << 8) |
data[index + 3];
return reverseBytes(n);
};
var reverseBytes = function (n) {
return (((n & -0x1000000) >>> 24) |
((n & 0x00ff0000) >>> 8) |
((n & 0x0000ff00) << 8) |
((n & 0x000000ff) << 24));
};
var select = function (selectable, selector) {
var e_1, _a;
if (!selector || selector.length === 0) {
return undefined;
}
try {
for (var selector_1 = __values(selector), selector_1_1 = selector_1.next(); !selector_1_1.done; selector_1_1 = selector_1.next()) {
var selectorElement = selector_1_1.value;
if (!selectorElement || !selectable || typeof selectable !== 'object') {
return undefined;
}
selectable = selectable[selectorElement];
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (selector_1_1 && !selector_1_1.done && (_a = selector_1.return)) _a.call(selector_1);
}
finally { if (e_1) throw e_1.error; }
}
if (!selectable) {
return undefined;
}
else {
return selectable;
}
};
// major and minor should be non-negative numbers separated by a dot
var MAJOR_MINOR_REGEX = '(\\d+)\\.(\\d+)';
// patch should be a non-negative number
var PATCH_REGEX = '(\\d+)';
// prerelease is optional. If provided, it should be a hyphen followed by a
// series of dot separated identifiers where an identifer can contain anything in [-0-9a-zA-Z]
var PRERELEASE_REGEX = '(-(([-\\w]+\\.?)*))?';
// version pattern should be major.minor(.patchAndPreRelease) where .patchAndPreRelease is optional
var VERSION_PATTERN = "^".concat(MAJOR_MINOR_REGEX, "(\\.").concat(PATCH_REGEX).concat(PRERELEASE_REGEX, ")?$");
var SemanticVersion = /** @class */ (function () {
function SemanticVersion(major, minor, patch, preRelease) {
if (preRelease === void 0) { preRelease = undefined; }
this.major = major;
this.minor = minor;
this.patch = patch;
this.preRelease = preRelease;
}
SemanticVersion.parse = function (version) {
if (!version) {
return undefined;
}
var matchGroup = new RegExp(VERSION_PATTERN).exec(version);
if (!matchGroup) {
return undefined;
}
var major = Number(matchGroup[1]);
var minor = Number(matchGroup[2]);
if (isNaN(major) || isNaN(minor)) {
return undefined;
}
var patch = Number(matchGroup[4]) || 0;
var preRelease = matchGroup[5] || undefined;
return new SemanticVersion(major, minor, patch, preRelease);
};
SemanticVersion.prototype.compareTo = function (other) {
if (this.major > other.major)
return 1;
if (this.major < other.major)
return -1;
if (this.minor > other.minor)
return 1;
if (this.minor < other.minor)
return -1;
if (this.patch > other.patch)
return 1;
if (this.patch < other.patch)
return -1;
if (this.preRelease && !other.preRelease)
return -1;
if (!this.preRelease && other.preRelease)
return 1;
if (this.preRelease && other.preRelease) {
if (this.preRelease > other.preRelease)
return 1;
if (this.preRelease < other.preRelease)
return -1;
return 0;
}
return 0;
};
return SemanticVersion;
}());
var EvaluationEngine = /** @class */ (function () {
function EvaluationEngine() {
}
EvaluationEngine.prototype.evaluate = function (context, flags) {
var e_1, _a;
var results = {};
var target = {
context: context,
result: results,
};
try {
for (var flags_1 = __values(flags), flags_1_1 = flags_1.next(); !flags_1_1.done; flags_1_1 = flags_1.next()) {
var flag = flags_1_1.value;
// Evaluate flag and update results.
var variant = this.evaluateFlag(target, flag);
if (variant) {
results[flag.key] = variant;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (flags_1_1 && !flags_1_1.done && (_a = flags_1.return)) _a.call(flags_1);
}
finally { if (e_1) throw e_1.error; }
}
return results;
};
EvaluationEngine.prototype.evaluateFlag = function (target, flag) {
var e_2, _a;
var result;
try {
for (var _b = __values(flag.segments), _c = _b.next(); !_c.done; _c = _b.next()) {
var segment = _c.value;
result = this.evaluateSegment(target, flag, segment);
if (result) {
// Merge all metadata into the result
var metadata = __assign(__assign(__assign({}, flag.metadata), segment.metadata), result.metadata);
result = __assign(__assign({}, result), { metadata: metadata });
break;
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
return result;
};
EvaluationEngine.prototype.evaluateSegment = function (target, flag, segment) {
var e_3, _a, e_4, _b;
if (!segment.conditions) {
// Null conditions always match
var variantKey = this.bucket(target, segment);
if (variantKey !== undefined) {
return flag.variants[variantKey];
}
else {
return undefined;
}
}
try {
// Outer list logic is "or" (||)
for (var _c = __values(segment.conditions), _d = _c.next(); !_d.done; _d = _c.next()) {
var conditions = _d.value;
var match = true;
try {
for (var conditions_1 = (e_4 = void 0, __values(conditions)), conditions_1_1 = conditions_1.next(); !conditions_1_1.done; conditions_1_1 = conditions_1.next()) {
var condition = conditions_1_1.value;
match = this.matchCondition(target, condition);
if (!match) {
break;
}
}
}
catch (e_4_1) { e_4 = { error: e_4_1 }; }
finally {
try {
if (conditions_1_1 && !conditions_1_1.done && (_b = conditions_1.return)) _b.call(conditions_1);
}
finally { if (e_4) throw e_4.error; }
}
// On match, bucket the user.
if (match) {
var variantKey = this.bucket(target, segment);
if (variantKey !== undefined) {
return flag.variants[variantKey];
}
else {
return undefined;
}
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
}
finally { if (e_3) throw e_3.error; }
}
return undefined;
};
EvaluationEngine.prototype.matchCondition = function (target, condition) {
var propValue = select(target, condition.selector);
// We need special matching for null properties and set type prop values
// and operators. All other values are matched as strings, since the
// filter values are always strings.
if (!propValue) {
return this.matchNull(condition.op, condition.values);
}
else if (this.isSetOperator(condition.op)) {
var propValueStringList = this.coerceStringArray(propValue);
if (!propValueStringList) {
return false;
}
return this.matchSet(propValueStringList, condition.op, condition.values);
}
else {
var propValueString = this.coerceString(propValue);
if (propValueString !== undefined) {
return this.matchString(propValueString, condition.op, condition.values);
}
else {
return false;
}
}
};
EvaluationEngine.prototype.getHash = function (key) {
return hash32x86(key);
};
EvaluationEngine.prototype.bucket = function (target, segment) {
var e_5, _a, e_6, _b;
if (!segment.bucket) {
// A null bucket means the segment is fully rolled out. Select the
// default variant.
return segment.variant;
}
// Select the bucketing value.
var bucketingValue = this.coerceString(select(target, segment.bucket.selector));
if (!bucketingValue || bucketingValue.length === 0) {
// A null or empty bucketing value cannot be bucketed. Select the
// default variant.
return segment.variant;
}
// Salt and has the value, and compute the allocation and distribution
// values.
var keyToHash = "".concat(segment.bucket.salt, "/").concat(bucketingValue);
var hash = this.getHash(keyToHash);
var allocationValue = hash % 100;
var distributionValue = Math.floor(hash / 100);
try {
for (var _c = __values(segment.bucket.allocations), _d = _c.next(); !_d.done; _d = _c.next()) {
var allocation = _d.value;
var allocationStart = allocation.range[0];
var allocationEnd = allocation.range[1];
if (allocationValue >= allocationStart &&
allocationValue < allocationEnd) {
try {
for (var _e = (e_6 = void 0, __values(allocation.distributions)), _f = _e.next(); !_f.done; _f = _e.next()) {
var distribution = _f.value;
var distributionStart = distribution.range[0];
var distributionEnd = distribution.range[1];
if (distributionValue >= distributionStart &&
distributionValue < distributionEnd) {
return distribution.variant;
}
}
}
catch (e_6_1) { e_6 = { error: e_6_1 }; }
finally {
try {
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
}
finally { if (e_6) throw e_6.error; }
}
}
}
}
catch (e_5_1) { e_5 = { error: e_5_1 }; }
finally {
try {
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
}
finally { if (e_5) throw e_5.error; }
}
return segment.variant;
};
EvaluationEngine.prototype.matchNull = function (op, filterValues) {
var containsNone = this.containsNone(filterValues);
switch (op) {
case EvaluationOperator.IS:
case EvaluationOperator.CONTAINS:
case EvaluationOperator.LESS_THAN:
case EvaluationOperator.LESS_THAN_EQUALS:
case EvaluationOperator.GREATER_THAN:
case EvaluationOperator.GREATER_THAN_EQUALS:
case EvaluationOperator.VERSION_LESS_THAN:
case EvaluationOperator.VERSION_LESS_THAN_EQUALS:
case EvaluationOperator.VERSION_GREATER_THAN:
case EvaluationOperator.VERSION_GREATER_THAN_EQUALS:
case EvaluationOperator.SET_IS:
case EvaluationOperator.SET_CONTAINS:
case EvaluationOperator.SET_CONTAINS_ANY:
return containsNone;
case EvaluationOperator.IS_NOT:
case EvaluationOperator.DOES_NOT_CONTAIN:
case EvaluationOperator.SET_DOES_NOT_CONTAIN:
case EvaluationOperator.SET_DOES_NOT_CONTAIN_ANY:
return !containsNone;
default:
return false;
}
};
EvaluationEngine.prototype.matchSet = function (propValues, op, filterValues) {
switch (op) {
case EvaluationOperator.SET_IS:
return this.setEquals(propValues, filterValues);
case EvaluationOperator.SET_IS_NOT:
return !this.setEquals(propValues, filterValues);
case EvaluationOperator.SET_CONTAINS:
return this.matchesSetContainsAll(propValues, filterValues);
case EvaluationOperator.SET_DOES_NOT_CONTAIN:
return !this.matchesSetContainsAll(propValues, filterValues);
case EvaluationOperator.SET_CONTAINS_ANY:
return this.matchesSetContainsAny(propValues, filterValues);
case EvaluationOperator.SET_DOES_NOT_CONTAIN_ANY:
return !this.matchesSetContainsAny(propValues, filterValues);
default:
return false;
}
};
EvaluationEngine.prototype.matchString = function (propValue, op, filterValues) {
var _this = this;
switch (op) {
case EvaluationOperator.IS:
return this.matchesIs(propValue, filterValues);
case EvaluationOperator.IS_NOT:
return !this.matchesIs(propValue, filterValues);
case EvaluationOperator.CONTAINS:
return this.matchesContains(propValue, filterValues);
case EvaluationOperator.DOES_NOT_CONTAIN:
return !this.matchesContains(propValue, filterValues);
case EvaluationOperator.LESS_THAN:
case EvaluationOperator.LESS_THAN_EQUALS:
case EvaluationOperator.GREATER_THAN:
case EvaluationOperator.GREATER_THAN_EQUALS:
return this.matchesComparable(propValue, op, filterValues, function (value) { return _this.parseNumber(value); }, this.comparator);
case EvaluationOperator.VERSION_LESS_THAN:
case EvaluationOperator.VERSION_LESS_THAN_EQUALS:
case EvaluationOperator.VERSION_GREATER_THAN:
case EvaluationOperator.VERSION_GREATER_THAN_EQUALS:
return this.matchesComparable(propValue, op, filterValues, function (value) { return SemanticVersion.parse(value); }, this.versionComparator);
case EvaluationOperator.REGEX_MATCH:
return this.matchesRegex(propValue, filterValues);
case EvaluationOperator.REGEX_DOES_NOT_MATCH:
return !this.matchesRegex(propValue, filterValues);
default:
return false;
}
};
EvaluationEngine.prototype.matchesIs = function (propValue, filterValues) {
if (this.containsBooleans(filterValues)) {
var lower_1 = propValue.toLowerCase();
if (lower_1 === 'true' || lower_1 === 'false') {
return filterValues.some(function (value) { return value.toLowerCase() === lower_1; });
}
}
return filterValues.some(function (value) { return propValue === value; });
};
EvaluationEngine.prototype.matchesContains = function (propValue, filterValues) {
var e_7, _a;
try {
for (var filterValues_1 = __values(filterValues), filterValues_1_1 = filterValues_1.next(); !filterValues_1_1.done; filterValues_1_1 = filterValues_1.next()) {
var filterValue = filterValues_1_1.value;
if (propValue.toLowerCase().includes(filterValue.toLowerCase())) {
return true;
}
}
}
catch (e_7_1) { e_7 = { error: e_7_1 }; }
finally {
try {
if (filterValues_1_1 && !filterValues_1_1.done && (_a = filterValues_1.return)) _a.call(filterValues_1);
}
finally { if (e_7) throw e_7.error; }
}
return false;
};
EvaluationEngine.prototype.matchesComparable = function (propValue, op, filterValues, typeTransformer, typeComparator) {
var _this = this;
var propValueTransformed = typeTransformer(propValue);
var filterValuesTransformed = filterValues
.map(function (filterValue) {
return typeTransformer(filterValue);
})
.filter(function (filterValue) {
return filterValue !== undefined;
});
if (propValueTransformed === undefined ||
filterValuesTransformed.length === 0) {
return filterValues.some(function (filterValue) {
return _this.comparator(propValue, op, filterValue);
});
}
else {
return filterValuesTransformed.some(function (filterValueTransformed) {
return typeComparator(propValueTransformed, op, filterValueTransformed);
});
}
};
EvaluationEngine.prototype.comparator = function (propValue, op, filterValue) {
switch (op) {
case EvaluationOperator.LESS_THAN:
case EvaluationOperator.VERSION_LESS_THAN:
return propValue < filterValue;
case EvaluationOperator.LESS_THAN_EQUALS:
case EvaluationOperator.VERSION_LESS_THAN_EQUALS:
return propValue <= filterValue;
case EvaluationOperator.GREATER_THAN:
case EvaluationOperator.VERSION_GREATER_THAN:
return propValue > filterValue;
case EvaluationOperator.GREATER_THAN_EQUALS:
case EvaluationOperator.VERSION_GREATER_THAN_EQUALS:
return propValue >= filterValue;
default:
return false;
}
};
EvaluationEngine.prototype.versionComparator = function (propValue, op, filterValue) {
var compareTo = propValue.compareTo(filterValue);
switch (op) {
case EvaluationOperator.LESS_THAN:
case EvaluationOperator.VERSION_LESS_THAN:
return compareTo < 0;
case EvaluationOperator.LESS_THAN_EQUALS:
case EvaluationOperator.VERSION_LESS_THAN_EQUALS:
return compareTo <= 0;
case EvaluationOperator.GREATER_THAN:
case EvaluationOperator.VERSION_GREATER_THAN:
return compareTo > 0;
case EvaluationOperator.GREATER_THAN_EQUALS:
case EvaluationOperator.VERSION_GREATER_THAN_EQUALS:
return compareTo >= 0;
default:
return false;
}
};
EvaluationEngine.prototype.matchesRegex = function (propValue, filterValues) {
return filterValues.some(function (filterValue) {
return Boolean(new RegExp(filterValue).exec(propValue));
});
};
EvaluationEngine.prototype.containsNone = function (filterValues) {
return filterValues.some(function (filterValue) {
return filterValue === '(none)';
});
};
EvaluationEngine.prototype.containsBooleans = function (filterValues) {
return filterValues.some(function (filterValue) {
switch (filterValue.toLowerCase()) {
case 'true':
case 'false':
return true;
default:
return false;
}
});
};
EvaluationEngine.prototype.parseNumber = function (value) {
var _a;
return (_a = Number(value)) !== null && _a !== void 0 ? _a : undefined;
};
EvaluationEngine.prototype.coerceString = function (value) {
if (!value) {
return undefined;
}
if (typeof value === 'object') {
return JSON.stringify(value);
}
return String(value);
};
EvaluationEngine.prototype.coerceStringArray = function (value) {
var _this = this;
if (Array.isArray(value)) {
var anyArray = value;
return anyArray
.map(function (e) { return _this.coerceString(e); })
.filter(Boolean);
}
var stringValue = String(value);
try {
var parsedValue = JSON.parse(stringValue);
if (Array.isArray(parsedValue)) {
var anyArray = value;
return anyArray
.map(function (e) { return _this.coerceString(e); })
.filter(Boolean);
}
else {
return undefined;
}
}
catch (_a) {
return undefined;
}
};
EvaluationEngine.prototype.isSetOperator = function (op) {
switch (op) {
case EvaluationOperator.SET_IS:
case EvaluationOperator.SET_IS_NOT:
case EvaluationOperator.SET_CONTAINS:
case EvaluationOperator.SET_DOES_NOT_CONTAIN:
case EvaluationOperator.SET_CONTAINS_ANY:
case EvaluationOperator.SET_DOES_NOT_CONTAIN_ANY:
return true;
default:
return false;
}
};
EvaluationEngine.prototype.setEquals = function (xa, ya) {
var xs = new Set(xa);
var ys = new Set(ya);
return xs.size === ys.size && __spreadArray([], __read(ys), false).every(function (y) { return xs.has(y); });
};
EvaluationEngine.prototype.matchesSetContainsAll = function (propValues, filterValues) {
var e_8, _a;
if (propValues.length < filterValues.length) {
return false;
}
try {
for (var filterValues_2 = __values(filterValues), filterValues_2_1 = filterValues_2.next(); !filterValues_2_1.done; filterValues_2_1 = filterValues_2.next()) {
var filterValue = filterValues_2_1.value;
if (!this.matchesIs(filterValue, propValues)) {
return false;
}
}
}
catch (e_8_1) { e_8 = { error: e_8_1 }; }
finally {
try {
if (filterValues_2_1 && !filterValues_2_1.done && (_a = filterValues_2.return)) _a.call(filterValues_2);
}
finally { if (e_8) throw e_8.error; }
}
return true;
};
EvaluationEngine.prototype.matchesSetContainsAny = function (propValues, filterValues) {
var e_9, _a;
try {
for (var filterValues_3 = __values(filterValues), filterValues_3_1 = filterValues_3.next(); !filterValues_3_1.done; filterValues_3_1 = filterValues_3.next()) {
var filterValue = filterValues_3_1.value;
if (this.matchesIs(filterValue, propValues)) {
return true;
}
}
}
catch (e_9_1) { e_9 = { error: e_9_1 }; }
finally {
try {
if (filterValues_3_1 && !filterValues_3_1.done && (_a = filterValues_3.return)) _a.call(filterValues_3);
}
finally { if (e_9) throw e_9.error; }
}
return false;
};
return EvaluationEngine;
}());
var topologicalSort = function (flags, flagKeys) {
var e_1, _a;
var available = __assign({}, flags);
var result = [];
var startingKeys = flagKeys || Object.keys(available);
try {
for (var startingKeys_1 = __values(startingKeys), startingKeys_1_1 = startingKeys_1.next(); !startingKeys_1_1.done; startingKeys_1_1 = startingKeys_1.next()) {
var flagKey = startingKeys_1_1.value;
var traversal = parentTraversal(flagKey, available);
if (traversal) {
result.push.apply(result, __spreadArray([], __read(traversal), false));
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (startingKeys_1_1 && !startingKeys_1_1.done && (_a = startingKeys_1.return)) _a.call(startingKeys_1);
}
finally { if (e_1) throw e_1.error; }
}
return result;
};
var parentTraversal = function (flagKey, available, path) {
var e_2, _a;
if (path === void 0) { path = []; }
var flag = available[flagKey];
if (!flag) {
return undefined;
}
else if (!flag.dependencies || flag.dependencies.length === 0) {
delete available[flag.key];
return [flag];
}
path.push(flag.key);
var result = [];
var _loop_1 = function (parentKey) {
if (path.some(function (p) { return p === parentKey; })) {
throw Error("Detected a cycle between flags ".concat(path));
}
var traversal = parentTraversal(parentKey, available, path);
if (traversal) {
result.push.apply(result, __spreadArray([], __read(traversal), false));
}
};
try {
for (var _b = __values(flag.dependencies), _c = _b.next(); !_c.done; _c = _b.next()) {
var parentKey = _c.value;
_loop_1(parentKey);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
result.push(flag);
path.pop();
delete available[flag.key];
return result;
};
/**
* base64.ts
*
* Licensed under the BSD 3-Clause License.
* http://opensource.org/licenses/BSD-3-Clause
*
* References:
* http://en.wikipedia.org/wiki/Base64
*
* @author Dan Kogai (https://github.com/dankogai)
*/
const version = '3.7.5';
/**
* @deprecated use lowercase `version`.
*/
const VERSION = version;
const _hasatob = typeof atob === 'function';
const _hasbtoa = typeof btoa === 'function';
const _hasBuffer = typeof Buffer === 'function';
const _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
const _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
const b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
const b64chs = Array.prototype.slice.call(b64ch);
const b64tab = (a => {
let tab = {};
a.forEach((c, i) => tab[c] = i);
return tab;
})(b64chs);
const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
const _fromCC = String.fromCharCode.bind(String);
const _U8Afrom = typeof Uint8Array.from === 'function' ? Uint8Array.from.bind(Uint8Array) : it => new Uint8Array(Array.prototype.slice.call(it, 0));
const _mkUriSafe = src => src.replace(/=/g, '').replace(/[+\/]/g, m0 => m0 == '+' ? '-' : '_');
const _tidyB64 = s => s.replace(/[^A-Za-z0-9\+\/]/g, '');
/**
* polyfill version of `btoa`
*/
const btoaPolyfill = bin => {
// console.log('polyfilled');
let u32,
c0,
c1,
c2,
asc = '';
const pad = bin.length % 3;
for (let i = 0; i < bin.length;) {
if ((c0 = bin.charCodeAt(i++)) > 255 || (c1 = bin.charCodeAt(i++)) > 255 || (c2 = bin.charCodeAt(i++)) > 255) throw new TypeError('invalid character found');
u32 = c0 << 16 | c1 << 8 | c2;
asc += b64chs[u32 >> 18 & 63] + b64chs[u32 >> 12 & 63] + b64chs[u32 >> 6 & 63] + b64chs[u32 & 63];
}
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
};
/**
* does what `window.btoa` of web browsers do.
* @param {String} bin binary string
* @returns {string} Base64-encoded string
*/
const _btoa = _hasbtoa ? bin => btoa(bin) : _hasBuffer ? bin => Buffer.from(bin, 'binary').toString('base64') : btoaPolyfill;
const _fromUint8Array = _hasBuffer ? u8a => Buffer.from(u8a).toString('base64') : u8a => {
// cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
const maxargs = 0x1000;
let strs = [];
for (let i = 0, l = u8a.length; i < l; i += maxargs) {
strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
}
return _btoa(strs.join(''));
};
/**
* converts a Uint8Array to a Base64 string.
* @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
* @returns {string} Base64 string
*/
const fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
// const utob = (src: string) => unescape(encodeURIComponent(src));
// reverting good old fationed regexp
const cb_utob = c => {
if (c.length < 2) {
var cc = c.charCodeAt(0);
return cc < 0x80 ? c : cc < 0x800 ? _fromCC(0xc0 | cc >>> 6) + _fromCC(0x80 | cc & 0x3f) : _fromCC(0xe0 | cc >>> 12 & 0x0f) + _fromCC(0x80 | cc >>> 6 & 0x3f) + _fromCC(0x80 | cc & 0x3f);
} else {
var cc = 0x10000 + (c.charCodeAt(0) - 0xD800) * 0x400 + (c.charCodeAt(1) - 0xDC00);
return _fromCC(0xf0 | cc >>> 18 & 0x07) + _fromCC(0x80 | cc >>> 12 & 0x3f) + _fromCC(0x80 | cc >>> 6 & 0x3f) + _fromCC(0x80 | cc & 0x3f);
}
};
const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
/**
* @deprecated should have been internal use only.
* @param {string} src UTF-8 string
* @returns {string} UTF-16 string
*/
const utob = u => u.replace(re_utob, cb_utob);
//
const _encode = _hasBuffer ? s => Buffer.from(s, 'utf8').toString('base64') : _TE ? s => _fromUint8Array(_TE.encode(s)) : s => _btoa(utob(s));
/**
* converts a UTF-8-encoded string to a Base64 string.
* @param {boolean} [urlsafe] if `true` make the result URL-safe
* @returns {string} Base64 string
*/
const encode = (src, urlsafe = false) => urlsafe ? _mkUriSafe(_encode(src)) : _encode(src);
/**
* converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
* @returns {string} Base64 string
*/
const encodeURI = src => encode(src, true);
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
// const btou = (src: string) => decodeURIComponent(escape(src));
// reverting good old fationed regexp
const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
const cb_btou = cccc => {
switch (cccc.length) {
case 4:
var cp = (0x07 & cccc.charCodeAt(0)) << 18 | (0x3f & cccc.charCodeAt(1)) << 12 | (0x3f & cccc.charCodeAt(2)) << 6 | 0x3f & cccc.charCodeAt(3),
offset = cp - 0x10000;
return _fromCC((offset >>> 10) + 0xD800) + _fromCC((offset & 0x3FF) + 0xDC00);
case 3:
return _fromCC((0x0f & cccc.charCodeAt(0)) << 12 | (0x3f & cccc.charCodeAt(1)) << 6 | 0x3f & cccc.charCodeAt(2));
default:
return _fromCC((0x1f & cccc.charCodeAt(0)) << 6 | 0x3f & cccc.charCodeAt(1));
}
};
/**
* @deprecated should have been internal use only.
* @param {string} src UTF-16 string
* @returns {string} UTF-8 string
*/
const btou = b => b.replace(re_btou, cb_btou);
/**
* polyfill version of `atob`
*/
const atobPolyfill = asc => {
// console.log('polyfilled');
asc = asc.replace(/\s+/g, '');
if (!b64re.test(asc)) throw new TypeError('malformed base64.');
asc += '=='.slice(2 - (asc.length & 3));
let u24,
bin = '',
r1,
r2;
for (let i = 0; i < asc.length;) {
u24 = b64tab[asc.charAt(i++)] << 18 | b64tab[asc.charAt(i++)] << 12 | (r1 = b64tab[asc.charAt(i++)]) << 6 | (r2 = b64tab[asc.charAt(i++)]);
bin += r1 === 64 ? _fromCC(u24 >> 16 & 255) : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255) : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
}
return bin;
};
/**
* does what `window.atob` of web browsers do.
* @param {String} asc Base64-encoded string
* @returns {string} binary string
*/
const _atob = _hasatob ? asc => atob(_tidyB64(asc)) : _hasBuffer ? asc => Buffer.from(asc, 'base64').toString('binary') : atobPolyfill;
//
const _toUint8Array = _hasBuffer ? a => _U8Afrom(Buffer.from(a, 'base64')) : a => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));
/**
* converts a Base64 string to a Uint8Array.
*/
const toUint8Array = a => _toUint8Array(_unURI(a));
//
const _decode = _hasBuffer ? a => Buffer.from(a, 'base64').toString('utf8') : _TD ? a => _TD.decode(_toUint8Array(a)) : a => btou(_atob(a));
const _unURI = a => _tidyB64(a.replace(/[-_]/g, m0 => m0 == '-' ? '+' : '/'));
/**
* converts a Base64 string to a UTF-8 string.
* @param {String} src Base64 string. Both normal and URL-safe are supported
* @returns {string} UTF-8 string
*/
const decode = src => _decode(_unURI(src));
/**
* check if a value is a valid Base64 string
* @param {String} src a value to check
*/
const isValid = src => {
if (typeof src !== 'string') return false;
const s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
};
//
const _noEnum = v => {
return {
value: v,
enumerable: false,
writable: true,
configurable: true
};
};
/**
* extend String.prototype with relevant methods
*/
const extendString = function () {
const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));
_add('fromBase64', function () {
return decode(this);
});
_add('toBase64', function (urlsafe) {
return encode(this, urlsafe);
});
_add('toBase64URI', function () {
return encode(this, true);
});
_add('toBase64URL', function () {
return encode(this, true);
});
_add('toUint8Array', function () {
return toUint8Array(this);
});
};
/**
* extend Uint8Array.prototype with relevant methods
*/
const extendUint8Array = function () {
const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));
_add('toBase64', function (urlsafe) {
return fromUint8Array(this, urlsafe);
});
_add('toBase64URI', function () {
return fromUint8Array(this, true);
});
_add('toBase64URL', function () {
return fromUint8Array(this, true);
});
};
/**
* extend Builtin prototypes with relevant methods
*/
const extendBuiltins = () => {
extendString();
extendUint8Array();
};
const gBase64 = {
version: version,
VERSION: VERSION,
atob: _atob,
atobPolyfill: atobPolyfill,
btoa: _btoa,
btoaPolyfill: btoaPolyfill,
fromBase64: decode,
toBase64: encode,
encode: encode,
encodeURI: encodeURI,
encodeURL: encodeURI,
utob: utob,
btou: btou,
decode: decode,
isValid: isValid,
fromUint8Array: fromUint8Array,
toUint8Array: toUint8Array,
extendString: extendString,
extendUint8Array: extendUint8Array,
extendBuiltins: extendBuiltins
};
var FetchError = /** @class */ (function (_super) {
__extends(FetchError, _super);
function FetchError(statusCode, message) {
var _this = _super.call(this, message) || this;
_this.statusCode = statusCode;
Object.setPrototypeOf(_this, FetchError.prototype);
return _this;
}
return FetchError;
}(Error));
var SdkEvaluationApi = /** @class */ (function () {
function SdkEvaluationApi(deploymentKey, serverUrl, httpClient) {
this.deploymentKey = deploymentKey;
this.serverUrl = serverUrl;
this.httpClient = httpClient;
}
SdkEvaluationApi.prototype.getVariants = function (user, options) {
return __awaiter(this, void 0, void 0, function () {
var userJsonBase64, headers, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
userJsonBase64 = gBase64.encodeURL(JSON.stringify(user));
headers = {
Authorization: "Api-Key ".concat(this.deploymentKey),
'X-Amp-Exp-User': userJsonBase64,
};
if (options === null || options === void 0 ? void 0 : options.flagKeys) {
headers['X-Amp-Exp-Flag-Keys'] = gBase64.encodeURL(JSON.stringify(options.flagKeys));
}
if (options === null || options === void 0 ? void 0 : options.trackingOption) {
headers['X-Amp-Exp-Track'] = options.trackingOption;
}
return [4 /*yield*/, this.httpClient.request({
requestUrl: "".concat(this.serverUrl, "/sdk/v2/vardata?v=0"),
method: 'GET',
headers: headers,
timeoutMillis: options === null || options === void 0 ? void 0 : options.timeoutMillis,
})];
case 1:
response = _a.sent();
if (response.status != 200) {
throw new FetchError(response.status, "Fetch error response: status=".concat(response.status));
}
return [2 /*return*/, JSON.parse(response.body)];
}
});
});
};
return SdkEvaluationApi;
}());
var SdkFlagApi = /** @class */ (function () {
function SdkFlagApi(deploymentKey, serverUrl, httpClient) {
this.deploymentKey = deploymentKey;
this.serverUrl = serverUrl;
this.httpClient = httpClient;
}
SdkFlagApi.prototype.getFlags = function (options) {
return __awaiter(this, void 0, void 0, function () {
var headers, response, flagsArray;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
headers = {
Authorization: "Api-Key ".concat(this.deploymentKey),
};
if ((options === null || options === void 0 ? void 0 : options.libraryName) && (options === null || options === void 0 ? void 0 : options.libraryVersion)) {
headers['X-Amp-Exp-Library'] = "".concat(options.libraryName, "/").concat(options.libraryVersion);
}
return [4 /*yield*/, this.httpClient.request({
requestUrl: "".concat(this.serverUrl, "/sdk/v2/flags"),
method: 'GET',
headers: headers,
timeoutMillis: options === null || options === void 0 ? void 0 : options.timeoutMillis,
})];
case 1:
response = _a.sent();
if (response.status != 200) {
throw Error("Flags error response: status=".concat(response.status));
}
flagsArray = JSON.parse(response.body);
return [2 /*return*/, flagsArray.reduce(function (map, flag) {
map[flag.key] = flag;
return map;
}, {})];
}
});
});
};
return SdkFlagApi;
}());
var safeGlobal = typeof globalThis !== 'undefined' ? globalThis : global || self;
var Poller = /** @class */ (function () {
function Poller(action, ms) {
this.poller = undefined;
this.action = action;
this.ms = ms;
}
Poller.prototype.start = function () {
if (this.poller) {
return;
}
this.poller = safeGlobal.setInterval(this.action, this.ms);
void this.action();
};
Poller.prototype.stop = function () {
if (!this.poller) {
return;
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
safeGlobal.clearInterval(this.poller);
this.poller = undefined;
};
return Poller;
}());
export { EvaluationEngine, EvaluationOperator, FetchError, Poller, SdkEvaluationApi, SdkFlagApi, safeGlobal, topologicalSort };
webpack://frontend-tpt/../../node_modules/@amplitude/experiment-js-client/dist/experiment.esm.js
import { AnalyticsConnector } from '@amplitude/analytics-connector';
import { safeGlobal, topologicalSort, FetchError, EvaluationEngine, Poller, SdkFlagApi, SdkEvaluationApi } from '@amplitude/experiment-core';
import { UAParser } from '@amplitude/ua-parser-js';
/**
* @deprecated Update your version of the amplitude analytics-js SDK to 8.17.0+ and for seamless
* integration with the amplitude analytics SDK.
*/
var AmplitudeUserProvider = /** @class */ (function () {
function AmplitudeUserProvider(amplitudeInstance) {
this.amplitudeInstance = amplitudeInstance;
}
AmplitudeUserProvider.prototype.getUser = function () {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
return {
device_id: (_b = (_a = this.amplitudeInstance) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.deviceId,
user_id: (_d = (_c = this.amplitudeInstance) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.userId,
version: (_f = (_e = this.amplitudeInstance) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.versionName,
language: (_h = (_g = this.amplitudeInstance) === null || _g === void 0 ? void 0 : _g.options) === null || _h === void 0 ? void 0 : _h.language,
platform: (_k = (_j = this.amplitudeInstance) === null || _j === void 0 ? void 0 : _j.options) === null || _k === void 0 ? void 0 : _k.platform,
os: this.getOs(),
device_model: this.getDeviceModel(),
};
};
AmplitudeUserProvider.prototype.getOs = function () {
var _a, _b, _c, _d, _e, _f;
return [
(_c = (_b = (_a = this.amplitudeInstance) === null || _a === void 0 ? void 0 : _a._ua) === null || _b === void 0 ? void 0 : _b.browser) === null || _c === void 0 ? void 0 : _c.name,
(_f = (_e = (_d = this.amplitudeInstance) === null || _d === void 0 ? void 0 : _d._ua) === null || _e === void 0 ? void 0 : _e.browser) === null || _f === void 0 ? void 0 : _f.major,
]
.filter(function (e) { return e !== null && e !== undefined; })
.join(' ');
};
AmplitudeUserProvider.prototype.getDeviceModel = function () {
var _a, _b, _c;
return (_c = (_b = (_a = this.amplitudeInstance) === null || _a === void 0 ? void 0 : _a._ua) === null || _b === void 0 ? void 0 : _b.os) === null || _c === void 0 ? void 0 : _c.name;
};
return AmplitudeUserProvider;
}());
/**
* @deprecated Update your version of the amplitude analytics-js SDK to 8.17.0+ and for seamless
* integration with the amplitude analytics SDK.
*/
var AmplitudeAnalyticsProvider = /** @class */ (function () {
function AmplitudeAnalyticsProvider(amplitudeInstance) {
this.amplitudeInstance = amplitudeInstance;
}
AmplitudeAnalyticsProvider.prototype.track = function (event) {
this.amplitudeInstance.logEvent(event.name, event.properties);
};
AmplitudeAnalyticsProvider.prototype.setUserProperty = function (event) {
var _a;
var _b;
// if the variant has a value, set the user property and log an event
this.amplitudeInstance.setUserProperties((_a = {},
_a[event.userProperty] = (_b = event.variant) === null || _b === void 0 ? void 0 : _b.value,
_a));
};
AmplitudeAnalyticsProvider.prototype.unsetUserProperty = function (event) {
var _a;
// if the variant does not have a value, unset the user property
this.amplitudeInstance['_logEvent']('$identify', null, null, {
$unset: (_a = {}, _a[event.userProperty] = '-', _a),
});
};
return AmplitudeAnalyticsProvider;
}());
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P ? value : new P(function (resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1];
return t[1];
},
trys: [],
ops: []
},
f,
y,
t,
g;
return g = {
next: verb(0),
"throw": verb(1),
"return": verb(2)
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
return this;
}), g;
function verb(n) {
return function (v) {
return step([n, v]);
};
}
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return {
value: op[1],
done: false
};
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5) throw op[1];
return {
value: op[0] ? op[1] : void 0,
done: true
};
}
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator,
m = s && o[s],
i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return {
value: o && o[i++],
done: !o
};
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
} catch (error) {
e = {
error: error
};
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
function unfetch (e, n) {
return n = n || {}, new Promise(function (t, r) {
var s = new XMLHttpRequest(),
o = [],
u = [],
i = {},
a = function () {
return {
ok: 2 == (s.status / 100 | 0),
statusText: s.statusText,
status: s.status,
url: s.responseURL,
text: function () {
return Promise.resolve(s.responseText);
},
json: function () {
return Promise.resolve(JSON.parse(s.responseText));
},
blob: function () {
return Promise.resolve(new Blob([s.response]));
},
clone: a,
headers: {
keys: function () {
return o;
},
entries: function () {
return u;
},
get: function (e) {
return i[e.toLowerCase()];
},
has: function (e) {
return e.toLowerCase() in i;
}
}
};
};
for (var l in s.open(n.method || "get", e, !0), s.onload = function () {
s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function (e, n, t) {
o.push(n = n.toLowerCase()), u.push([n, t]), i[n] = i[n] ? i[n] + "," + t : t;
}), t(a());
}, s.onerror = r, s.withCredentials = "include" == n.credentials, n.headers) s.setRequestHeader(l, n.headers[l]);
s.send(n.body || null);
});
}
/**
* @packageDocumentation
* @internal
*/
var fetch = safeGlobal.fetch || unfetch;
/*
* Copied from:
* https://github.com/github/fetch/issues/175#issuecomment-284787564
*/
var timeout = function (promise, timeoutMillis) {
// Don't timeout if timeout is null or invalid
if (timeoutMillis == null || timeoutMillis <= 0) {
return promise;
}
return new Promise(function (resolve, reject) {
safeGlobal.setTimeout(function () {
reject(Error('Request timeout after ' + timeoutMillis + ' milliseconds'));
}, timeoutMillis);
promise.then(resolve, reject);
});
};
var _request = function (requestUrl, method, headers, data, timeoutMillis) {
var call = function () { return __awaiter(void 0, void 0, void 0, function () {
var response, simpleResponse;
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, fetch(requestUrl, {
method: method,
headers: headers,
body: data,
})];
case 1:
response = _b.sent();
_a = {
status: response.status
};
return [4 /*yield*/, response.text()];
case 2:
simpleResponse = (_a.body = _b.sent(),
_a);
return [2 /*return*/, simpleResponse];
}
});
}); };
return timeout(call(), timeoutMillis);
};
/**
* Wrap the exposed HttpClient in a CoreClient implementation to work with
* FlagsApi and EvaluationApi.
*/
var WrapperClient = /** @class */ (function () {
function WrapperClient(client) {
this.client = client;
}
WrapperClient.prototype.request = function (request) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.client.request(request.requestUrl, request.method, request.headers, null, request.timeoutMillis)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
return WrapperClient;
}());
var FetchHttpClient = { request: _request };
/**
* Determines the primary source of variants before falling back.
*
* @category Source
*/
var Source;
(function (Source) {
/**
* The default way to source variants within your application. Before the
* assignments are fetched, `getVariant(s)` will fallback to local storage
* first, then `initialVariants` if local storage is empty. This option
* effectively falls back to an assignment fetched previously.
*/
Source["LocalStorage"] = "localStorage";
/**
* This bootstrap option is used primarily for servers-side rendering using an
* Experiment server SDK. This bootstrap option always prefers the config
* `initialVariants` over data in local storage, even if variants are fetched
* successfully and stored locally.
*/
Source["InitialVariants"] = "initialVariants";
})(Source || (Source = {}));
/**
* Indicates from which source the variant() function determines the variant
*
* @category Source
*/
var VariantSource;
(function (VariantSource) {
VariantSource["LocalStorage"] = "storage";
VariantSource["InitialVariants"] = "initial";
VariantSource["SecondaryLocalStorage"] = "secondary-storage";
VariantSource["SecondaryInitialVariants"] = "secondary-initial";
VariantSource["FallbackInline"] = "fallback-inline";
VariantSource["FallbackConfig"] = "fallback-config";
VariantSource["LocalEvaluation"] = "local-evaluation";
})(VariantSource || (VariantSource = {}));
/**
* Returns true if the VariantSource is one of the fallbacks (inline or config)
*
* @param source a {@link VariantSource}
* @returns true if source is {@link VariantSource.FallbackInline} or {@link VariantSource.FallbackConfig}
*/
var isFallback = function (source) {
return (!source ||
source === VariantSource.FallbackInline ||
source === VariantSource.FallbackConfig ||
source === VariantSource.SecondaryInitialVariants);
};
/**
Defaults for Experiment Config options
| **Option** | **Default** |
|------------------|-----------------------------------|
| **debug** | `false` |
| **instanceName** | `$default_instance` |
| **fallbackVariant** | `null` |
| **initialVariants** | `null` |
| **initialFlags** | `undefined` |
| **source** | `Source.LocalStorage` |
| **serverUrl** | `"https://api.lab.amplitude.com"` |
| **flagsServerUrl** | `"https://flag.lab.amplitude.com"` |
| **serverZone** | `"US"` |
| **assignmentTimeoutMillis** | `10000` |
| **retryFailedAssignment** | `true` |
| **automaticExposureTracking** | `true` |
| **pollOnStart** | `true` |
| **fetchOnStart** | `true` |
| **automaticFetchOnAmplitudeIdentityChange** | `false` |
| **userProvider** | `null` |
| **analyticsProvider** | `null` |
| **exposureTrackingProvider** | `null` |
*
* @category Configuration
*/
var Defaults = {
debug: false,
instanceName: '$default_instance',
fallbackVariant: {},
initialVariants: {},
initialFlags: undefined,
source: Source.LocalStorage,
serverUrl: 'https://api.lab.amplitude.com',
flagsServerUrl: 'https://flag.lab.amplitude.com',
serverZone: 'US',
fetchTimeoutMillis: 10000,
retryFetchOnFailure: true,
automaticExposureTracking: true,
pollOnStart: true,
fetchOnStart: true,
automaticFetchOnAmplitudeIdentityChange: false,
userProvider: null,
analyticsProvider: null,
exposureTrackingProvider: null,
httpClient: FetchHttpClient,
};
var version = "1.10.2";
var ConnectorUserProvider = /** @class */ (function () {
function ConnectorUserProvider(identityStore) {
this.identityStore = identityStore;
}
ConnectorUserProvider.prototype.identityReady = function (ms) {
return __awaiter(this, void 0, void 0, function () {
var identity;
var _this = this;
return __generator(this, function (_a) {
identity = this.identityStore.getIdentity();
if (!identity.userId && !identity.deviceId) {
return [2 /*return*/, Promise.race([
new Promise(function (resolve) {
var listener = function () {
resolve(undefined);
_this.identityStore.removeIdentityListener(listener);
};
_this.identityStore.addIdentityListener(listener);
}),
new Promise(function (resolve, reject) {
safeGlobal.setTimeout(reject, ms, 'Timed out waiting for Amplitude Analytics SDK to initialize. ' +
'You must ensure that the analytics SDK is initialized prior to calling fetch().');
}),
])];
}
return [2 /*return*/];
});
});
};
ConnectorUserProvider.prototype.getUser = function () {
var identity = this.identityStore.getIdentity();
var userProperties = undefined;
try {
userProperties = identity.userProperties;
}
catch (_a) {
console.warn('[Experiment] failed to cast user properties');
}
return {
user_id: identity.userId,
device_id: identity.deviceId,
user_properties: userProperties,
};
};
return ConnectorUserProvider;
}());
var ConnectorExposureTrackingProvider = /** @class */ (function () {
function ConnectorExposureTrackingProvider(eventBridge) {
this.eventBridge = eventBridge;
}
ConnectorExposureTrackingProvider.prototype.track = function (exposure) {
this.eventBridge.logEvent({
eventType: '$exposure',
eventProperties: exposure,
});
};
return ConnectorExposureTrackingProvider;
}());
var DefaultUserProvider = /** @class */ (function () {
function DefaultUserProvider(applicationContextProvider, userProvider) {
this.ua = new UAParser(typeof navigator !== 'undefined' ? navigator.userAgent : null).getResult();
this.contextProvider = applicationContextProvider;
this.userProvider = userProvider;
}
DefaultUserProvider.prototype.getUser = function () {
var _a;
var user = ((_a = this.userProvider) === null || _a === void 0 ? void 0 : _a.getUser()) || {};
var context = this.contextProvider.getApplicationContext();
return __assign({ version: context.versionName, language: context.language, platform: context.platform, os: context.os || this.getOs(this.ua), device_model: context.deviceModel || this.getDeviceModel(this.ua) }, user);
};
DefaultUserProvider.prototype.getOs = function (ua) {
var _a, _b;
return [(_a = ua.browser) === null || _a === void 0 ? void 0 : _a.name, (_b = ua.browser) === null || _b === void 0 ? void 0 : _b.major]
.filter(function (e) { return e !== null && e !== undefined; })
.join(' ');
};
DefaultUserProvider.prototype.getDeviceModel = function (ua) {
var _a;
return (_a = ua.os) === null || _a === void 0 ? void 0 : _a.name;
};
return DefaultUserProvider;
}());
var LocalStorage = /** @class */ (function () {
function LocalStorage() {
}
LocalStorage.prototype.get = function (key) {
return localStorage.getItem(key);
};
LocalStorage.prototype.put = function (key, value) {
localStorage.setItem(key, value);
};
LocalStorage.prototype.delete = function (key) {
localStorage.removeItem(key);
};
return LocalStorage;
}());
var getVariantStorage = function (deploymentKey, instanceName, storage) {
var truncatedDeployment = deploymentKey.substring(deploymentKey.length - 6);
var namespace = "amp-exp-".concat(instanceName, "-").concat(truncatedDeployment);
return new LoadStoreCache(namespace, storage, transformVariantFromStorage);
};
var getFlagStorage = function (deploymentKey, instanceName, storage) {
if (storage === void 0) { storage = new LocalStorage(); }
var truncatedDeployment = deploymentKey.substring(deploymentKey.length - 6);
var namespace = "amp-exp-".concat(instanceName, "-").concat(truncatedDeployment, "-flags");
return new LoadStoreCache(namespace, storage);
};
var LoadStoreCache = /** @class */ (function () {
function LoadStoreCache(namespace, storage, transformer) {
this.cache = {};
this.namespace = namespace;
this.storage = storage;
this.transformer = transformer;
}
LoadStoreCache.prototype.get = function (key) {
return this.cache[key];
};
LoadStoreCache.prototype.getAll = function () {
return __assign({}, this.cache);
};
LoadStoreCache.prototype.put = function (key, value) {
this.cache[key] = value;
};
LoadStoreCache.prototype.putAll = function (values) {
var e_1, _a;
try {
for (var _b = __values(Object.keys(values)), _c = _b.next(); !_c.done; _c = _b.next()) {
var key = _c.value;
this.cache[key] = values[key];
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
};
LoadStoreCache.prototype.remove = function (key) {
delete this.cache[key];
};
LoadStoreCache.prototype.clear = function () {
this.cache = {};
};
LoadStoreCache.prototype.load = function () {
var e_2, _a;
var rawValues = this.storage.get(this.namespace);
var jsonValues;
try {
jsonValues = JSON.parse(rawValues) || {};
}
catch (_b) {
// Do nothing
return;
}
var values = {};
try {
for (var _c = __values(Object.keys(jsonValues)), _d = _c.next(); !_d.done; _d = _c.next()) {
var key = _d.value;
try {
var value = void 0;
if (this.transformer) {
value = this.transformer(jsonValues[key]);
}
else {
value = jsonValues[key];
}
if (value) {
values[key] = value;
}
}
catch (_e) {
// Do nothing
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
}
finally { if (e_2) throw e_2.error; }
}
this.clear();
this.putAll(values);
};
LoadStoreCache.prototype.store = function (values) {
if (values === void 0) { values = this.cache; }
this.storage.put(this.namespace, JSON.stringify(values));
};
return LoadStoreCache;
}());
var transformVariantFromStorage = function (storageValue) {
if (typeof storageValue === 'string') {
// From v0 string format
return {
key: storageValue,
value: storageValue,
};
}
else if (typeof storageValue === 'object') {
// From v1 or v2 object format
var key = storageValue['key'];
var value = storageValue['value'];
var payload = storageValue['payload'];
var metadata = storageValue['metadata'];
var experimentKey = storageValue['expKey'];
if (metadata && metadata.experimentKey) {
experimentKey = metadata.experimentKey;
}
else if (experimentKey) {
metadata = metadata || {};
metadata['experimentKey'] = experimentKey;
}
var variant = {};
if (key) {
variant.key = key;
}
else if (value) {
variant.key = value;
}
if (value)
variant.value = value;
if (metadata)
variant.metadata = metadata;
if (payload)
variant.payload = payload;
if (experimentKey)
variant.expKey = experimentKey;
return variant;
}
};
/**
* Event for tracking a user's exposure to a variant. This event will not count
* towards your analytics event volume.
*
* @deprecated use ExposureTrackingProvider instead
*/
var exposureEvent = function (user, key, variant, source) {
var _a;
var name = '[Experiment] Exposure';
var value = variant === null || variant === void 0 ? void 0 : variant.value;
var userProperty = "[Experiment] ".concat(key);
return {
name: name,
user: user,
key: key,
variant: variant,
userProperty: userProperty,
properties: {
key: key,
variant: value,
source: source,
},
userProperties: (_a = {},
_a[userProperty] = value,
_a),
};
};
var isNullOrUndefined = function (value) {
return value === null || value === undefined;
};
var isNullUndefinedOrEmpty = function (value) {
if (isNullOrUndefined(value))
return true;
return value && Object.keys(value).length === 0;
};
var isLocalEvaluationMode = function (flag) {
var _a;
return ((_a = flag === null || flag === void 0 ? void 0 : flag.metadata) === null || _a === void 0 ? void 0 : _a.evaluationMode) === 'local';
};
var Backoff = /** @class */ (function () {
function Backoff(attempts, min, max, scalar) {
this.started = false;
this.done = false;
this.attempts = attempts;
this.min = min;
this.max = max;
this.scalar = scalar;
}
Backoff.prototype.start = function (fn) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.started) {
this.started = true;
}
else {
throw Error('Backoff already started');
}
return [4 /*yield*/, this.backoff(fn, 0, this.min)];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
Backoff.prototype.cancel = function () {
this.done = true;
clearTimeout(this.timeoutHandle);
};
Backoff.prototype.backoff = function (fn, attempt, delay) {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
if (this.done) {
return [2 /*return*/];
}
this.timeoutHandle = safeGlobal.setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
var nextAttempt, nextDelay;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, fn()];
case 1:
_a.sent();
return [3 /*break*/, 3];
case 2:
_a.sent();
nextAttempt = attempt + 1;
if (nextAttempt < this.attempts) {
nextDelay = Math.min(delay * this.scalar, this.max);
this.backoff(fn, nextAttempt, nextDelay);
}
return [3 /*break*/, 3];
case 3: return [2 /*return*/];
}
});
}); }, delay);
return [2 /*return*/];
});
});
};
return Backoff;
}());
var convertUserToContext = function (user) {
var e_1, _a;
var _b, _c;
if (!user) {
return {};
}
var context = { user: user };
var groups = {};
if (!user.groups) {
return context;
}
try {
for (var _d = __values(Object.keys(user.groups)), _e = _d.next(); !_e.done; _e = _d.next()) {
var groupType = _e.value;
var groupNames = user.groups[groupType];
if (groupNames.length > 0 && groupNames[0]) {
var groupName = groupNames[0];
var groupNameMap = {
group_name: groupName,
};
// Check for group properties
var groupProperties = (_c = (_b = user.group_properties) === null || _b === void 0 ? void 0 : _b[groupType]) === null || _c === void 0 ? void 0 : _c[groupName];
if (groupProperties && Object.keys(groupProperties).length > 0) {
groupNameMap['group_properties'] = groupProperties;
}
groups[groupType] = groupNameMap;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
}
finally { if (e_1) throw e_1.error; }
}
if (Object.keys(groups).length > 0) {
context['groups'] = groups;
}
delete context.user['groups'];
delete context.user['group_properties'];
return context;
};
var convertVariant = function (value) {
if (value === null || value === undefined) {
return {};
}
if (typeof value == 'string') {
return {
key: value,
value: value,
};
}
else {
return value;
}
};
var convertEvaluationVariantToVariant = function (evaluationVariant) {
if (!evaluationVariant) {
return {};
}
var experimentKey = undefined;
if (evaluationVariant.metadata) {
experimentKey = evaluationVariant.metadata['experimentKey'];
}
var variant = {};
if (evaluationVariant.key)
variant.key = evaluationVariant.key;
if (evaluationVariant.value)
variant.value = evaluationVariant.value;
if (evaluationVariant.payload)
variant.payload = evaluationVariant.payload;
if (experimentKey)
variant.expKey = experimentKey;
if (evaluationVariant.metadata)
variant.metadata = evaluationVariant.metadata;
return variant;
};
/**
* A wrapper for an analytics provider which only sends one exposure event per
* flag, per variant, per session. In other words, wrapping an analytics
* provider in this class will prevent the same exposure event to be sent twice
* in one session.
*/
var SessionAnalyticsProvider = /** @class */ (function () {
function SessionAnalyticsProvider(analyticsProvider) {
// In memory record of flagKey and variant value to in order to only set
// user properties and track an exposure event once per session unless the
// variant value changes
this.setProperties = {};
this.unsetProperties = {};
this.analyticsProvider = analyticsProvider;
}
SessionAnalyticsProvider.prototype.track = function (event) {
if (this.setProperties[event.key] == event.variant.value) {
return;
}
else {
this.setProperties[event.key] = event.variant.value;
delete this.unsetProperties[event.key];
}
this.analyticsProvider.track(event);
};
SessionAnalyticsProvider.prototype.setUserProperty = function (event) {
if (this.setProperties[event.key] == event.variant.value) {
return;
}
this.analyticsProvider.setUserProperty(event);
};
SessionAnalyticsProvider.prototype.unsetUserProperty = function (event) {
if (this.unsetProperties[event.key]) {
return;
}
else {
this.unsetProperties[event.key] = 'unset';
delete this.setProperties[event.key];
}
this.analyticsProvider.unsetUserProperty(event);
};
return SessionAnalyticsProvider;
}());
var SessionExposureTrackingProvider = /** @class */ (function () {
function SessionExposureTrackingProvider(exposureTrackingProvider) {
this.tracked = {};
this.exposureTrackingProvider = exposureTrackingProvider;
}
SessionExposureTrackingProvider.prototype.track = function (exposure) {
var trackedExposure = this.tracked[exposure.flag_key];
if (trackedExposure && trackedExposure.variant === exposure.variant) {
return;
}
else {
this.tracked[exposure.flag_key] = exposure;
this.exposureTrackingProvider.track(exposure);
}
};
return SessionExposureTrackingProvider;
}());
/**
* @packageDocumentation
* @module experiment-js-client
*/
// Configs which have been removed from the public API.
// May be added back in the future.
var fetchBackoffTimeout = 10000;
var fetchBackoffAttempts = 8;
var fetchBackoffMinMillis = 500;
var fetchBackoffMaxMillis = 10000;
var fetchBackoffScalar = 1.5;
var flagPollerIntervalMillis = 60000;
var euServerUrl = 'https://api.lab.eu.amplitude.com';
var euFlagsServerUrl = 'https://flag.lab.eu.amplitude.com';
/**
* The default {@link Client} used to fetch variations from Experiment's
* servers.
*
* @category Core Usage
*/
var ExperimentClient = /** @class */ (function () {
/**
* Creates a new ExperimentClient instance.
*
* In most cases you will want to use the `initialize` factory method in
* {@link Experiment}.
*
* @param apiKey The Client key for the Experiment project
* @param config See {@link ExperimentConfig} for config options
*/
function ExperimentClient(apiKey, config) {
var _this = this;
var _a, _b;
this.engine = new EvaluationEngine();
this.poller = new Poller(function () { return _this.doFlags(); }, flagPollerIntervalMillis);
this.isRunning = false;
this.apiKey = apiKey;
// Merge configs with defaults and wrap providers
this.config = __assign(__assign(__assign({}, Defaults), config), {
// Set server URLs separately
serverUrl: (config === null || config === void 0 ? void 0 : config.serverUrl) ||
(((_a = config === null || config === void 0 ? void 0 : config.serverZone) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'eu'
? euServerUrl
: Defaults.serverUrl), flagsServerUrl: (config === null || config === void 0 ? void 0 : config.flagsServerUrl) ||
(((_b = config === null || config === void 0 ? void 0 : config.serverZone) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'eu'
? euFlagsServerUrl
: Defaults.flagsServerUrl) });
// Transform initialVariants
if (this.config.initialVariants) {
for (var flagKey in this.config.initialVariants) {
this.config.initialVariants[flagKey] = transformVariantFromStorage(this.config.initialVariants[flagKey]);
}
}
if (this.config.userProvider) {
this.userProvider = this.config.userProvider;
}
if (this.config.analyticsProvider) {
this.analyticsProvider = new SessionAnalyticsProvider(this.config.analyticsProvider);
}
if (this.config.exposureTrackingProvider) {
this.exposureTrackingProvider = new SessionExposureTrackingProvider(this.config.exposureTrackingProvider);
}
// Setup Remote APIs
var httpClient = new WrapperClient(this.config.httpClient || FetchHttpClient);
this.flagApi = new SdkFlagApi(this.apiKey, this.config.flagsServerUrl, httpClient);
this.evaluationApi = new SdkEvaluationApi(this.apiKey, this.config.serverUrl, httpClient);
// Storage & Caching
var storage = new LocalStorage();
this.variants = getVariantStorage(this.apiKey, this.config.instanceName, storage);
this.flags = getFlagStorage(this.apiKey, this.config.instanceName, storage);
try {
this.flags.load();
this.variants.load();
}
catch (e) {
// catch localStorage undefined error
}
this.mergeInitialFlagsWithStorage();
}
/**
* Start the SDK by getting flag configurations from the server and fetching
* variants for the user. The promise returned by this function resolves when
* local flag configurations have been updated, and the {@link fetch()}
* result has been received (if the request was made).
*
* To force this function not to fetch variants, set the {@link fetchOnStart}
* configuration option to `false` when initializing the SDK.
*
* Finally, this function will start polling for flag configurations at a
* fixed interval. To disable polling, set the {@link pollOnStart}
* configuration option to `false` on initialization.
*
* @param user The user to set in the SDK.
* @see fetchOnStart
* @see pollOnStart
* @see fetch
* @see variant
*/
ExperimentClient.prototype.start = function (user) {
var _a;
return __awaiter(this, void 0, void 0, function () {
var flagsReadyPromise, fetchOnStart;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
if (this.isRunning) {
return [2 /*return*/];
}
else {
this.isRunning = true;
}
this.setUser(user);
flagsReadyPromise = this.doFlags();
fetchOnStart = (_a = this.config.fetchOnStart) !== null && _a !== void 0 ? _a : true;
if (!fetchOnStart) return [3 /*break*/, 2];
return [4 /*yield*/, Promise.all([this.fetch(user), flagsReadyPromise])];
case 1:
_b.sent();
return [3 /*break*/, 4];
case 2: return [4 /*yield*/, flagsReadyPromise];
case 3:
_b.sent();
_b.label = 4;
case 4:
if (this.config.pollOnStart) {
this.poller.start();
}
return [2 /*return*/];
}
});
});
};
/**
* Stop the local flag configuration poller.
*/
ExperimentClient.prototype.stop = function () {
if (!this.isRunning) {
return;
}
this.poller.stop();
this.isRunning = false;
};
/**
* Assign the given user to the SDK and asynchronously fetch all variants
* from the server. Subsequent calls may omit the user from the argument to
* use the user from the previous call.
*
* If an {@link ExperimentUserProvider} has been set, the argument user will
* be merged with the provider user, preferring user fields from the argument
* user and falling back on the provider for fields which are null or
* undefined.
*
* If configured, fetch retries the request in the background on failure.
* Variants received from a successful retry are stored in local storage for
* access.
*
* If you are using the `initialVariants` config option to preload this SDK
* from the server, you generally do not need to call `fetch`.
*
* @param user The user to fetch variants for.
* @param options Options for this specific fetch call.
* @returns Promise that resolves when the request for variants completes.
* @see ExperimentUser
* @see ExperimentUserProvider
*/
ExperimentClient.prototype.fetch = function (user, options) {
if (user === void 0) { user = this.user; }
return __awaiter(this, void 0, void 0, function () {
var e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.setUser(user || {});
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, this.fetchInternal(user, this.config.fetchTimeoutMillis, this.config.retryFetchOnFailure, options)];
case 2:
_a.sent();
return [3 /*break*/, 4];
case 3:
e_1 = _a.sent();
console.error(e_1);
return [3 /*break*/, 4];
case 4: return [2 /*return*/, this];
}
});
});
};
/**
* Returns the variant for the provided key.
*
* Access the variant from {@link Source}, falling back on the given
* fallback, then the configured fallbackVariant.
*
* If an {@link ExposureTrackingProvider} is configured and the
* {@link automaticExposureTracking} configuration option is `true`, this
* function will call the provider with an {@link Exposure} event. The
* exposure event does not count towards your event volume within Amplitude.
*
* @param key The key to get the variant for.
* @param fallback The highest priority fallback.
* @see ExperimentConfig
* @see ExposureTrackingProvider
*/
ExperimentClient.prototype.variant = function (key, fallback) {
var _a, _b;
if (!this.apiKey) {
return { value: undefined };
}
var sourceVariant = this.variantAndSource(key, fallback);
if (this.config.automaticExposureTracking) {
this.exposureInternal(key, sourceVariant);
}
this.debug("[Experiment] variant for ".concat(key, " is ").concat(((_a = sourceVariant.variant) === null || _a === void 0 ? void 0 : _a.key) || ((_b = sourceVariant.variant) === null || _b === void 0 ? void 0 : _b.value)));
return sourceVariant.variant || {};
};
/**
* Track an exposure event for the variant associated with the flag/experiment
* {@link key}.
*
* This method requires that an {@link ExposureTrackingProvider} be
* configured when this client is initialized, either manually, or through the
* Amplitude Analytics SDK integration from set up using
* {@link Experiment.initializeWithAmplitudeAnalytics}.
*
* @param key The flag/experiment key to track an exposure for.
* @see ExposureTrackingProvider
*/
ExperimentClient.prototype.exposure = function (key) {
var sourceVariant = this.variantAndSource(key);
this.exposureInternal(key, sourceVariant);
};
/**
* Returns all variants for the user.
*
* The primary source of variants is based on the
* {@link Source} configured in the {@link ExperimentConfig}.
*
* @see Source
* @see ExperimentConfig
*/
ExperimentClient.prototype.all = function () {
if (!this.apiKey) {
return {};
}
var evaluatedVariants = this.evaluate();
for (var flagKey in evaluatedVariants) {
var flag = this.flags.get(flagKey);
if (!isLocalEvaluationMode(flag)) {
delete evaluatedVariants[flagKey];
}
}
return __assign(__assign(__assign({}, this.secondaryVariants()), this.sourceVariants()), evaluatedVariants);
};
/**
* Clear all variants in the cache and storage.
*/
ExperimentClient.prototype.clear = function () {
this.variants.clear();
try {
void this.variants.store();
}
catch (e) {
// catch localStorage undefined error
}
};
/**
* Get a copy of the internal {@link ExperimentUser} object if it is set.
*
* @returns a copy of the internal user object if set.
*/
ExperimentClient.prototype.getUser = function () {
var _a;
if (!this.user) {
return this.user;
}
if ((_a = this.user) === null || _a === void 0 ? void 0 : _a.user_properties) {
var userPropertiesCopy = __assign({}, this.user.user_properties);
return __assign(__assign({}, this.user), { user_properties: userPropertiesCopy });
}
else {
return __assign({}, this.user);
}
};
/**
* Copy in and set the user within the experiment client.
*
* @param user the user to set within the experiment client.
*/
ExperimentClient.prototype.setUser = function (user) {
var _a;
if (!user) {
this.user = null;
return;
}
if ((_a = this.user) === null || _a === void 0 ? void 0 : _a.user_properties) {
var userPropertiesCopy = __assign({}, user.user_properties);
this.user = __assign(__assign({}, user), { user_properties: userPropertiesCopy });
}
else {
this.user = __assign({}, user);
}
};
/**
* Get the user provider set by {@link setUserProvider} or null if the user
* provider has not been set.
*
* @returns The user provider set by {@link setUserProvider} or null.
* @deprecated use ExperimentConfig.userProvider instead
*/
ExperimentClient.prototype.getUserProvider = function () {
return this.userProvider;
};
/**
* Sets a user provider that will inject identity information into the user
* for {@link fetch()} requests. The user provider will only set user fields
* in outgoing requests which are null or undefined.
*
* See {@link ExperimentUserProvider} for more details
* @param userProvider
* @deprecated use ExperimentConfig.userProvider instead
*/
ExperimentClient.prototype.setUserProvider = function (userProvider) {
this.userProvider = userProvider;
return this;
};
ExperimentClient.prototype.mergeInitialFlagsWithStorage = function () {
var _this = this;
if (this.config.initialFlags) {
var initialFlags = JSON.parse(this.config.initialFlags);
initialFlags.forEach(function (flag) {
if (!_this.flags.get(flag.key)) {
_this.flags.put(flag.key, flag);
}
});
}
};
ExperimentClient.prototype.evaluate = function (flagKeys) {
var e_2, _a;
var user = this.addContext(this.user);
var flags = topologicalSort(this.flags.getAll(), flagKeys);
var context = convertUserToContext(user);
var evaluationVariants = this.engine.evaluate(context, flags);
var variants = {};
try {
for (var _b = __values(Object.keys(evaluationVariants)), _c = _b.next(); !_c.done; _c = _b.next()) {
var flagKey = _c.value;
variants[flagKey] = convertEvaluationVariantToVariant(evaluationVariants[flagKey]);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
return variants;
};
ExperimentClient.prototype.variantAndSource = function (key, fallback) {
var sourceVariant = {};
if (this.config.source === Source.LocalStorage) {
sourceVariant = this.localStorageVariantAndSource(key, fallback);
}
else if (this.config.source === Source.InitialVariants) {
sourceVariant = this.initialVariantsVariantAndSource(key, fallback);
}
var flag = this.flags.get(key);
if (isLocalEvaluationMode(flag) || (!sourceVariant.variant && flag)) {
sourceVariant = this.localEvaluationVariantAndSource(key, flag, fallback);
}
return sourceVariant;
};
/**
* This function assumes the flag exists and is local evaluation mode. For
* local evaluation, fallback order goes:
*
* 1. Local evaluation
* 2. Inline function fallback
* 3. Initial variants
* 4. Config fallback
*
* If there is a default variant and no fallback, return the default variant.
*/
ExperimentClient.prototype.localEvaluationVariantAndSource = function (key, flag, fallback) {
var _a;
var defaultSourceVariant = {};
// Local evaluation
var variant = this.evaluate([flag.key])[key];
var source = VariantSource.LocalEvaluation;
var isLocalEvaluationDefault = (_a = variant === null || variant === void 0 ? void 0 : variant.metadata) === null || _a === void 0 ? void 0 : _a.default;
if (!isNullOrUndefined(variant) && !isLocalEvaluationDefault) {
return {
variant: convertVariant(variant),
source: source,
hasDefaultVariant: false,
};
}
else if (isLocalEvaluationDefault) {
defaultSourceVariant = {
variant: convertVariant(variant),
source: source,
hasDefaultVariant: true,
};
}
// Inline fallback
if (!isNullOrUndefined(fallback)) {
return {
variant: convertVariant(fallback),
source: VariantSource.FallbackInline,
hasDefaultVariant: defaultSourceVariant.hasDefaultVariant,
};
}
// Initial variants
var initialVariant = this.config.initialVariants[key];
if (!isNullOrUndefined(initialVariant)) {
return {
variant: convertVariant(initialVariant),
source: VariantSource.SecondaryInitialVariants,
hasDefaultVariant: defaultSourceVariant.hasDefaultVariant,
};
}
// Configured fallback, or default variant
var fallbackVariant = convertVariant(this.config.fallbackVariant);
var fallbackSourceVariant = {
variant: fallbackVariant,
source: VariantSource.FallbackConfig,
hasDefaultVariant: defaultSourceVariant.hasDefaultVariant,
};
if (!isNullUndefinedOrEmpty(fallbackVariant)) {
return fallbackSourceVariant;
}
return defaultSourceVariant;
};
/**
* For Source.LocalStorage, fallback order goes:
*
* 1. Local Storage
* 2. Inline function fallback
* 3. InitialFlags
* 4. Config fallback
*
* If there is a default variant and no fallback, return the default variant.
*/
ExperimentClient.prototype.localStorageVariantAndSource = function (key, fallback) {
var _a;
var defaultSourceVariant = {};
// Local storage
var localStorageVariant = this.variants.get(key);
var isLocalStorageDefault = (_a = localStorageVariant === null || localStorageVariant === void 0 ? void 0 : localStorageVariant.metadata) === null || _a === void 0 ? void 0 : _a.default;
if (!isNullOrUndefined(localStorageVariant) && !isLocalStorageDefault) {
return {
variant: convertVariant(localStorageVariant),
source: VariantSource.LocalStorage,
hasDefaultVariant: false,
};
}
else if (isLocalStorageDefault) {
defaultSourceVariant = {
variant: convertVariant(localStorageVariant),
source: VariantSource.LocalStorage,
hasDefaultVariant: true,
};
}
// Inline fallback
if (!isNullOrUndefined(fallback)) {
return {
variant: convertVariant(fallback),
source: VariantSource.FallbackInline,
hasDefaultVariant: defaultSourceVariant.hasDefaultVariant,
};
}
// Initial variants
var initialVariant = this.config.initialVariants[key];
if (!isNullOrUndefined(initialVariant)) {
return {
variant: convertVariant(initialVariant),
source: VariantSource.SecondaryInitialVariants,
hasDefaultVariant: defaultSourceVariant.hasDefaultVariant,
};
}
// Configured fallback, or default variant
var fallbackVariant = convertVariant(this.config.fallbackVariant);
var fallbackSourceVariant = {
variant: fallbackVariant,
source: VariantSource.FallbackConfig,
hasDefaultVariant: defaultSourceVariant.hasDefaultVariant,
};
if (!isNullUndefinedOrEmpty(fallbackVariant)) {
return fallbackSourceVariant;
}
return defaultSourceVariant;
};
/**
* For Source.InitialVariants, fallback order goes:
*
* 1. Initial variants
* 2. Local storage
* 3. Inline function fallback
* 4. Config fallback
*
* If there is a default variant and no fallback, return the default variant.
*/
ExperimentClient.prototype.initialVariantsVariantAndSource = function (key, fallback) {
var _a;
var defaultSourceVariant = {};
// Initial variants
var initialVariantsVariant = this.config.initialVariants[key];
if (!isNullOrUndefined(initialVariantsVariant)) {
return {
variant: convertVariant(initialVariantsVariant),
source: VariantSource.InitialVariants,
hasDefaultVariant: false,
};
}
// Local storage
var localStorageVariant = this.variants.get(key);
var isLocalStorageDefault = (_a = localStorageVariant === null || localStorageVariant === void 0 ? void 0 : localStorageVariant.metadata) === null || _a === void 0 ? void 0 : _a.default;
if (!isNullOrUndefined(localStorageVariant) && !isLocalStorageDefault) {
return {
variant: convertVariant(localStorageVariant),
source: VariantSource.LocalStorage,
hasDefaultVariant: false,
};
}
else if (isLocalStorageDefault) {
defaultSourceVariant = {
variant: convertVariant(localStorageVariant),
source: VariantSource.LocalStorage,
hasDefaultVariant: true,
};
}
// Inline fallback
if (!isNullOrUndefined(fallback)) {
return {
variant: convertVariant(fallback),
source: VariantSource.FallbackInline,
hasDefaultVariant: defaultSourceVariant.hasDefaultVariant,
};
}
// Configured fallback, or default variant
var fallbackVariant = convertVariant(this.config.fallbackVariant);
var fallbackSourceVariant = {
variant: fallbackVariant,
source: VariantSource.FallbackConfig,
hasDefaultVariant: defaultSourceVariant.hasDefaultVariant,
};
if (!isNullUndefinedOrEmpty(fallbackVariant)) {
return fallbackSourceVariant;
}
return defaultSourceVariant;
};
ExperimentClient.prototype.fetchInternal = function (user, timeoutMillis, retry, options) {
return __awaiter(this, void 0, void 0, function () {
var variants, e_3;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
// Don't even try to fetch variants if API key is not set
if (!this.apiKey) {
throw Error('Experiment API key is empty');
}
this.debug("[Experiment] Fetch all: retry=".concat(retry));
// Proactively cancel retries if active in order to avoid unnecessary API
// requests. A new failure will restart the retries.
if (retry) {
this.stopRetries();
}
_a.label = 1;
case 1:
_a.trys.push([1, 4, , 5]);
return [4 /*yield*/, this.doFetch(user, timeoutMillis, options)];
case 2:
variants = _a.sent();
return [4 /*yield*/, this.storeVariants(variants, options)];
case 3:
_a.sent();
return [2 /*return*/, variants];
case 4:
e_3 = _a.sent();
if (retry && this.shouldRetryFetch(e_3)) {
void this.startRetries(user, options);
}
throw e_3;
case 5: return [2 /*return*/];
}
});
});
};
ExperimentClient.prototype.doFetch = function (user, timeoutMillis, options) {
return __awaiter(this, void 0, void 0, function () {
var results, variants, _a, _b, key;
var e_4, _c;
return __generator(this, function (_d) {
switch (_d.label) {
case 0: return [4 /*yield*/, this.addContextOrWait(user, 10000)];
case 1:
user = _d.sent();
this.debug('[Experiment] Fetch variants for user: ', user);
return [4 /*yield*/, this.evaluationApi.getVariants(user, {
timeoutMillis: timeoutMillis,
flagKeys: options === null || options === void 0 ? void 0 : options.flagKeys,
})];
case 2:
results = _d.sent();
variants = {};
try {
for (_a = __values(Object.keys(results)), _b = _a.next(); !_b.done; _b = _a.next()) {
key = _b.value;
variants[key] = convertEvaluationVariantToVariant(results[key]);
}
}
catch (e_4_1) { e_4 = { error: e_4_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
}
finally { if (e_4) throw e_4.error; }
}
this.debug('[Experiment] Received variants: ', variants);
return [2 /*return*/, variants];
}
});
});
};
ExperimentClient.prototype.doFlags = function () {
return __awaiter(this, void 0, void 0, function () {
var flags;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.flagApi.getFlags({
libraryName: 'experiment-js-client',
libraryVersion: version,
timeoutMillis: this.config.fetchTimeoutMillis,
})];
case 1:
flags = _a.sent();
this.flags.clear();
this.flags.putAll(flags);
try {
this.flags.store();
}
catch (e) {
// catch localStorage undefined error
}
this.mergeInitialFlagsWithStorage();
return [2 /*return*/];
}
});
});
};
ExperimentClient.prototype.storeVariants = function (variants, options) {
return __awaiter(this, void 0, void 0, function () {
var failedFlagKeys, _loop_1, this_1, key, key;
return __generator(this, function (_a) {
failedFlagKeys = options && options.flagKeys ? options.flagKeys : [];
if (failedFlagKeys.length === 0) {
this.variants.clear();
}
_loop_1 = function (key) {
failedFlagKeys = failedFlagKeys.filter(function (flagKey) { return flagKey !== key; });
this_1.variants.put(key, variants[key]);
};
this_1 = this;
for (key in variants) {
_loop_1(key);
}
for (key in failedFlagKeys) {
this.variants.remove(key);
}
try {
this.variants.store();
}
catch (e) {
// catch localStorage undefined error
}
this.debug('[Experiment] Stored variants: ', variants);
return [2 /*return*/];
});
});
};
ExperimentClient.prototype.startRetries = function (user, options) {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
this.debug('[Experiment] Retry fetch');
this.retriesBackoff = new Backoff(fetchBackoffAttempts, fetchBackoffMinMillis, fetchBackoffMaxMillis, fetchBackoffScalar);
void this.retriesBackoff.start(function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.fetchInternal(user, fetchBackoffTimeout, false, options)];
case 1:
_a.sent();
return [2 /*return*/];
}
});
}); });
return [2 /*return*/];
});
});
};
ExperimentClient.prototype.stopRetries = function () {
if (this.retriesBackoff) {
this.retriesBackoff.cancel();
}
};
ExperimentClient.prototype.addContext = function (user) {
var _a, _b;
var providedUser = (_a = this.userProvider) === null || _a === void 0 ? void 0 : _a.getUser();
var mergedUserProperties = __assign(__assign({}, user === null || user === void 0 ? void 0 : user.user_properties), providedUser === null || providedUser === void 0 ? void 0 : providedUser.user_properties);
return __assign(__assign(__assign({ library: "experiment-js-client/".concat(version) }, (_b = this.userProvider) === null || _b === void 0 ? void 0 : _b.getUser()), user), { user_properties: mergedUserProperties });
};
ExperimentClient.prototype.addContextOrWait = function (user, ms) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!(this.userProvider instanceof DefaultUserProvider)) return [3 /*break*/, 2];
if (!(this.userProvider.userProvider instanceof ConnectorUserProvider)) return [3 /*break*/, 2];
return [4 /*yield*/, this.userProvider.userProvider.identityReady(ms)];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2 /*return*/, this.addContext(user)];
}
});
});
};
ExperimentClient.prototype.sourceVariants = function () {
if (this.config.source == Source.LocalStorage) {
return this.variants.getAll();
}
else if (this.config.source == Source.InitialVariants) {
return this.config.initialVariants;
}
};
ExperimentClient.prototype.secondaryVariants = function () {
if (this.config.source == Source.LocalStorage) {
return this.config.initialVariants;
}
else if (this.config.source == Source.InitialVariants) {
return this.variants.getAll();
}
};
ExperimentClient.prototype.exposureInternal = function (key, sourceVariant) {
var _a, _b, _c, _d, _e, _f;
this.legacyExposureInternal(key, sourceVariant.variant, sourceVariant.source);
var exposure = { flag_key: key };
// Do not track exposure for fallback variants that are not associated with
// a default variant.
var fallback = isFallback(sourceVariant.source);
if (fallback && !sourceVariant.hasDefaultVariant) {
return;
}
if ((_a = sourceVariant.variant) === null || _a === void 0 ? void 0 : _a.expKey) {
exposure.experiment_key = (_b = sourceVariant.variant) === null || _b === void 0 ? void 0 : _b.expKey;
}
var metadata = (_c = sourceVariant.variant) === null || _c === void 0 ? void 0 : _c.metadata;
if (!fallback && !(metadata === null || metadata === void 0 ? void 0 : metadata.default)) {
if ((_d = sourceVariant.variant) === null || _d === void 0 ? void 0 : _d.key) {
exposure.variant = sourceVariant.variant.key;
}
else if ((_e = sourceVariant.variant) === null || _e === void 0 ? void 0 : _e.value) {
exposure.variant = sourceVariant.variant.value;
}
}
if (metadata)
exposure.metadata = metadata;
(_f = this.exposureTrackingProvider) === null || _f === void 0 ? void 0 : _f.track(exposure);
};
ExperimentClient.prototype.legacyExposureInternal = function (key, variant, source) {
var _a, _b, _c, _d, _e;
if (this.analyticsProvider) {
var user = this.addContext(this.getUser());
var event_1 = exposureEvent(user, key, variant, source);
if (isFallback(source) || !(variant === null || variant === void 0 ? void 0 : variant.value)) {
(_b = (_a = this.analyticsProvider) === null || _a === void 0 ? void 0 : _a.unsetUserProperty) === null || _b === void 0 ? void 0 : _b.call(_a, event_1);
}
else if (variant === null || variant === void 0 ? void 0 : variant.value) {
(_d = (_c = this.analyticsProvider) === null || _c === void 0 ? void 0 : _c.setUserProperty) === null || _d === void 0 ? void 0 : _d.call(_c, event_1);
(_e = this.analyticsProvider) === null || _e === void 0 ? void 0 : _e.track(event_1);
}
}
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ExperimentClient.prototype.debug = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
if (this.config.debug) {
console.debug.apply(console, __spreadArray([message], __read(optionalParams), false));
}
};
ExperimentClient.prototype.shouldRetryFetch = function (e) {
if (e instanceof FetchError) {
return e.statusCode < 400 || e.statusCode >= 500 || e.statusCode === 429;
}
return true;
};
return ExperimentClient;
}());
var instances = {};
/**
* Initializes a singleton {@link ExperimentClient} identified by the configured
* instance name.
*
* @param apiKey The deployment API Key
* @param config See {@link ExperimentConfig} for config options
*/
var initialize = function (apiKey, config) {
// Store instances by appending the instance name and api key. Allows for
// initializing multiple default instances for different api keys.
var instanceName = (config === null || config === void 0 ? void 0 : config.instanceName) || Defaults.instanceName;
var instanceKey = "".concat(instanceName, ".").concat(apiKey);
var connector = AnalyticsConnector.getInstance(instanceName);
if (!instances[instanceKey]) {
config = __assign(__assign({}, config), { userProvider: new DefaultUserProvider(connector.applicationContextProvider, config === null || config === void 0 ? void 0 : config.userProvider) });
instances[instanceKey] = new ExperimentClient(apiKey, config);
}
return instances[instanceKey];
};
/**
* Initialize a singleton {@link ExperimentClient} which automatically
* integrates with the installed and initialized instance of the amplitude
* analytics SDK.
*
* You must be using amplitude-js SDK version 8.17.0+ for this integration to
* work.
*
* @param apiKey The deployment API Key
* @param config See {@link ExperimentConfig} for config options
*/
var initializeWithAmplitudeAnalytics = function (apiKey, config) {
// Store instances by appending the instance name and api key. Allows for
// initializing multiple default instances for different api keys.
var instanceName = (config === null || config === void 0 ? void 0 : config.instanceName) || Defaults.instanceName;
var instanceKey = "".concat(instanceName, ".").concat(apiKey);
var connector = AnalyticsConnector.getInstance(instanceName);
if (!instances[instanceKey]) {
config = __assign({ userProvider: new DefaultUserProvider(connector.applicationContextProvider, new ConnectorUserProvider(connector.identityStore)), exposureTrackingProvider: new ConnectorExposureTrackingProvider(connector.eventBridge) }, config);
instances[instanceKey] = new ExperimentClient(apiKey, config);
if (config.automaticFetchOnAmplitudeIdentityChange) {
connector.identityStore.addIdentityListener(function () {
instances[instanceKey].fetch();
});
}
}
return instances[instanceKey];
};
/**
* Provides factory methods for storing singleton instances of {@link ExperimentClient}
* @category Core Usage
*/
var Experiment = {
initialize: initialize,
initializeWithAmplitudeAnalytics: initializeWithAmplitudeAnalytics,
};
/**
* A stub {@link Client} implementation that does nothing for all methods
*/
var StubExperimentClient = /** @class */ (function () {
function StubExperimentClient() {
}
StubExperimentClient.prototype.getUser = function () {
return {};
};
StubExperimentClient.prototype.start = function (user) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
};
StubExperimentClient.prototype.stop = function () { };
StubExperimentClient.prototype.setUser = function (user) { };
StubExperimentClient.prototype.fetch = function (user) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this];
});
});
};
StubExperimentClient.prototype.getUserProvider = function () {
return null;
};
StubExperimentClient.prototype.setUserProvider = function (uerProvider) {
return this;
};
StubExperimentClient.prototype.variant = function (key, fallback) {
return Defaults.fallbackVariant;
};
StubExperimentClient.prototype.all = function () {
return {};
};
StubExperimentClient.prototype.clear = function () { };
StubExperimentClient.prototype.exposure = function (key) { };
return StubExperimentClient;
}());
export { AmplitudeAnalyticsProvider, AmplitudeUserProvider, Experiment, ExperimentClient, Source, StubExperimentClient };
webpack://frontend-tpt/../../packages/urp-lib-amplitude-experiments/src/constants.ts
import tvgConf from "@tvg/conf";
import { get } from "lodash";
import { EnvKey, KeysList } from "./types";
const KEYS_LIST: KeysList = {
qa: {
fdr_fe: {
web: "client-sJeHwbwoOdpgTjlausdjWW5szEQK3PMG"
},
tvg: {
web: "client-jnKlEobFN5VznDxIalCa79Cxx11b03PZ"
},
sbk: {
ios: "client-hGUIVcs9WJyi9qBb65hmoxoNWgcwcJdg",
android: "client-em33htTASmGwBq2PuooW9BGrBaHPL8v3",
web: "client-YA2sGyaXthgkCAsBCEbrx4OD6Oy02ItY"
}
},
staging: {
tvg: {
web: "client-DybuPFka20yiegOqJwv7R3t4TZBFgvzd"
},
fdr_fe: {
web: "client-WGddpVy4j4U8ouXQajgXL5qwQNrjiM0v"
},
sbk: {
ios: "client-hGUIVcs9WJyi9qBb65hmoxoNWgcwcJdg",
android: "client-em33htTASmGwBq2PuooW9BGrBaHPL8v3",
web: "client-YA2sGyaXthgkCAsBCEbrx4OD6Oy02ItY"
}
},
production: {
fdr_fe: {
web: "client-UxgLTJk47Cc6ce5aUb7gcwUvH1tCcDSp"
},
tvg: {
web: "client-QWuoGcQ3o0cUyK9IvZLiB3BZZ2eSa6QN"
},
sbk: {
ios: "client-25U3VqPyrxX2F1Nc4FmbKBcXTLCXkAi3",
android: "client-qENtN9i7TECUlin6ww2zU9th6496lKQi",
web: "client-5xlIVGL8e7Nfnt2H6wIgLm7p8Ked2VTH"
}
}
};
const { environment = "production" } = tvgConf();
export const ENV_KEYS: EnvKey = get(KEYS_LIST, environment, KEYS_LIST.qa);
webpack://frontend-tpt/../../packages/urp-lib-amplitude-experiments/src/experiments/useTvg5/types.ts
export enum ValueEnum {
TVG4 = "tvg4",
TVG5 = "tvg5"
}
export interface Props {
accountNumber: string;
}
webpack://frontend-tpt/../../packages/urp-lib-amplitude-experiments/src/experiments/useTalentPickNewOption/types.ts
export enum VariantEnum {
HOME = "home-header-section",
SECTION = "account-panel-section",
OPTION = "account-panel-option"
}
export interface Payload {
to?: string;
label?: string;
qaLabel?: string;
iconName?: string;
}
webpack://frontend-tpt/../../packages/urp-lib-amplitude-experiments/src/types.ts
export interface Variant<V, P> {
value: V | undefined;
payload: P | null;
}
export interface EnvKey {
fdr_fe: {
web: string;
};
tvg: {
web: string;
};
sbk: {
ios: string;
android: string;
web: string;
};
}
export interface KeysList {
qa: EnvKey;
staging: EnvKey;
production: EnvKey;
}
export enum VariantEnum {
CONTROL = "control",
TREATMENT = "treatment"
}
webpack://frontend-tpt/../../packages/urp-lib-amplitude-experiments/src/experiments/useAutoPlayPPVideos/types.ts
export enum VariantEnum {
CONTROL = "control",
TREATMENT = "treatment",
OFF = "off"
}
export interface AutoPlayConfig {
autoPlay: boolean;
mtpThreshold: number;
}
webpack://frontend-tpt/../../packages/urp-lib-amplitude-experiments/src/experiments/useTvg5/constants.ts
import { ENV_KEYS } from "../../constants";
export const EXPERIMENT_KEY =
"qfd-374-replace-beta-program-by-amplitude-experiment";
export const DEPLOYMENT_KEY = ENV_KEYS.tvg.web;
export const TVG5_COOKIE = "useTvg5";
webpack://frontend-tpt/../../packages/urp-lib-amplitude-experiments/src/utils.ts
import { getDeviceId } from "@amplitude/analytics-browser";
import { Variant } from "@amplitude/experiment-js-client";
import { isAndroid, isIos, isXSell } from "@tvg/sh-utils/mobileUtils";
import { getFdUserId } from "@urp/store-selectors";
import { useEffect, useState } from "react";
import { useSelector } from "react-redux";
import { ENV_KEYS } from "./constants";
import { VariantEnum } from "./types";
import useExperiments from "./useExperiments";
export const getXsellKeys = () => {
if (isIos()) return ENV_KEYS.sbk.ios;
if (isAndroid()) return ENV_KEYS.sbk.android;
return ENV_KEYS.sbk.web;
};
export const DEPLOYMENT_KEY = isXSell() ? getXsellKeys() : ENV_KEYS.fdr_fe.web;
export const useIsTreatmentVariant = (experimentKey: string) => {
const { getVariant } = useExperiments(DEPLOYMENT_KEY);
const variant = getVariant<VariantEnum, boolean>(experimentKey);
return variant?.value === VariantEnum.TREATMENT;
};
export const useIsTreatmentVariantByUser = (experimentKey: string) => {
const { setUserExperiment, getVariant } = useExperiments(DEPLOYMENT_KEY);
const [variant, setVariant] = useState<Variant>();
const accountNumber = useSelector(getFdUserId);
const deviceId = getDeviceId();
useEffect(() => {
setUserExperiment({ user_id: accountNumber, device_id: deviceId }).then(
() => {
setVariant(getVariant<VariantEnum, number>(experimentKey));
}
);
}, [accountNumber, deviceId]);
return variant?.value === VariantEnum.TREATMENT;
};
webpack://frontend-tpt/../../packages/urp-lib-amplitude-experiments/src/experiments/useAutoPlayPPVideos/utils.ts
import { Variant } from "../../types";
import { DEFAULT_PAYLOAD } from "./constants";
import { AutoPlayConfig, VariantEnum } from "./types";
export const parseResponse = (
variant: Variant<VariantEnum, number> | undefined
): AutoPlayConfig => ({
autoPlay: variant?.value === VariantEnum.TREATMENT,
mtpThreshold:
variant?.payload && !Number.isNaN(variant.payload)
? variant.payload
: DEFAULT_PAYLOAD
});
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/constants.ts
import { FilterOption, TalentFilter } from "./types";
export const CONTENT_FILTER_WIDTH = 145;
export const TRACK_FILTER_DEFAULT: FilterOption = {
label: "All Tracks",
value: ""
};
export const EXPERT_FILTER_DEFAULT: FilterOption = {
label: "All Experts",
value: ""
};
export const TALENT_FILTER_DEFAULT: TalentFilter = {
label: "All",
value: "",
image: "",
picksCount: 0
};
export const BASE_QA_LABEL = "talentPicks";
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/fragments/BettingInterestsFragment.ts
import { gql } from "@apollo/client";
export const TalentPickRaceFragment = {
entry: gql`
fragment BettingInterests on Race {
bettingInterests {
biNumber
saddleColor
numberColor
runners {
runnerId
entityRunnerId
scratched
}
}
}
`
};
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/queries/talentPicksRacesQuery.ts
import { gql } from "@apollo/client";
import { TalentPickRaceFragment } from "../fragments/BettingInterestsFragment";
export const GET_GRAPH_TALENT_PICKS_RACES = gql`
query getTalentPicksRaces($tracksCode: [String], $wagerProfile: String) {
talentPicksRaces: tracks(
profile: $wagerProfile
filter: { code: $tracksCode }
) {
id
races {
id
number
track {
id
code
}
numRunners
numWagerableRunners
...BettingInterests
}
}
}
${TalentPickRaceFragment.entry}
`;
webpack://frontend-tpt/../../packages/tvg-comp-toast-manager/src/store/actions.ts
import { ToastMessageStore } from "../types";
export type AddToast = {
type: "ADD_TOAST";
payload: {
toastProps: ToastMessageStore;
};
};
export type RemoveToast = {
type: "REMOVE_TOAST";
payload: {
toastId: string;
};
};
export type ClearToasts = {
type: "CLEAR_TOASTS";
};
export type ToastActions = AddToast | RemoveToast | ClearToasts;
export const addToast = (toastProps: ToastMessageStore): AddToast => ({
type: "ADD_TOAST",
payload: {
toastProps
}
});
export const removeToast = (toastId: string): RemoveToast => ({
type: "REMOVE_TOAST",
payload: { toastId }
});
export const clearToasts = (): ClearToasts => ({
type: "CLEAR_TOASTS"
});
webpack://frontend-tpt/../../packages/tvg-comp-desktop-bet-ticket/src/utils/groupByWagerType.ts
import { cloneDeep, isEmpty, get } from "lodash";
import { WagerTypes, WagerTypesGroup } from "@tvg/ts-types/Wager";
import { RaceWagerType } from "@tvg/ts-types/Race";
const groupedPlace = [
WagerTypes.WIN_PLACE,
WagerTypes.PLACE_SHOW,
WagerTypes.WIN_PLACE_SHOW
];
const groupedShow = [
WagerTypes.WIN_SHOW,
WagerTypes.PLACE_SHOW,
WagerTypes.WIN_PLACE_SHOW
];
export const getLegGroup = (wagerType: WagerTypes) => {
switch (wagerType) {
case WagerTypes.WIN_PLACE:
case WagerTypes.PLACE_SHOW:
case WagerTypes.WIN_SHOW:
return 2;
case WagerTypes.WIN_PLACE_SHOW:
return 3;
default:
return 1;
}
};
const setGroupWagerTypes = (
wagerTypesList: RaceWagerType[],
wagerGroupList: RaceWagerType[]
) =>
wagerTypesList.map((wagerType) => {
const wagerTypeGroupped = { ...wagerType };
const specialGroup =
(wagerType.group.id === WagerTypes.WIN &&
wagerType.type.id !== WagerTypes.WIN) ||
(wagerType.group.id === WagerTypes.PLACE &&
wagerType.type.id !== WagerTypes.PLACE);
if (!wagerTypeGroupped.types) {
wagerTypeGroupped.specialGroup = specialGroup;
wagerTypeGroupped.types = specialGroup ? wagerGroupList : [];
}
return wagerTypeGroupped;
});
const groupWinPlaceShow = (
newWagerType: RaceWagerType,
wagerTypeList: RaceWagerType[]
) => {
let foundGroupIndex = -1;
const filteredList = wagerTypeList;
const filteredWagerType = cloneDeep(newWagerType);
if (
filteredWagerType.type.id === WagerTypes.PLACE ||
filteredWagerType.type.id === WagerTypes.SHOW
) {
return wagerTypeList;
}
if (filteredWagerType.type.id === WagerTypes.WIN) {
return [...wagerTypeList, filteredWagerType];
}
filteredWagerType.columnCount = getLegGroup(filteredWagerType.type.id);
foundGroupIndex = filteredList.findIndex(
(wagerTypeFiltered) =>
wagerTypeFiltered.type.id === WagerTypes.WIN_PLACE ||
wagerTypeFiltered.type.id === WagerTypes.WIN_SHOW ||
wagerTypeFiltered.type.id === WagerTypes.PLACE_SHOW ||
wagerTypeFiltered.type.id === WagerTypes.WIN_PLACE_SHOW
);
if (foundGroupIndex >= 0) {
// eslint-disable-next-line security/detect-object-injection
filteredList[foundGroupIndex] = filteredWagerType;
} else {
return [...filteredList, filteredWagerType];
}
return filteredList;
};
const groupByWagerType = (wagerTypes: RaceWagerType[]) => {
let groupedWagerTypes: RaceWagerType[] = [];
const winGroup: RaceWagerType[] = [];
if (wagerTypes && wagerTypes.length > 0) {
groupedWagerTypes = wagerTypes.reduce<RaceWagerType[]>(
(arrayFiltered, wagerType) => {
const foundEqual = arrayFiltered.find(
(item) => item.group.id === wagerType.group.id
);
if (WagerTypesGroup.WIN_PLACE_SHOW.includes(wagerType.group.id)) {
winGroup.push(cloneDeep(wagerType));
return groupWinPlaceShow(wagerType, arrayFiltered);
}
if (
foundEqual &&
!WagerTypesGroup.WIN_PLACE_SHOW.includes(wagerType.group.id)
) {
return [...arrayFiltered, wagerType];
}
if (!foundEqual) {
return [...arrayFiltered, wagerType];
}
return arrayFiltered;
},
[]
);
if (
isEmpty(groupedWagerTypes) ||
!groupedWagerTypes.find((wagerTypeItem) =>
groupedShow.includes(wagerTypeItem.type.id)
)
) {
const showWagerType = wagerTypes.find(
(wager) => get(wager, "type.id") === WagerTypes.SHOW
);
groupedWagerTypes = showWagerType
? [showWagerType, ...groupedWagerTypes]
: groupedWagerTypes;
}
if (
isEmpty(groupedWagerTypes) ||
!groupedWagerTypes.some((wagerTypeItem) =>
groupedPlace.includes(wagerTypeItem.type.id)
)
) {
const placeWagerType = wagerTypes.find(
(wager) => get(wager, "type.id") === WagerTypes.PLACE
);
groupedWagerTypes = placeWagerType
? [placeWagerType, ...groupedWagerTypes]
: groupedWagerTypes;
}
}
return setGroupWagerTypes(groupedWagerTypes, winGroup);
};
export default groupByWagerType;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/WagerTypesFragment.ts
import { gql } from "@apollo/client";
const WagerTypesFragments = {
entry: gql`
fragment WagerTypes on Race {
wagerTypes {
positionCount
minWagerAmount
wagerAmounts
columnCount
legCount
isBox
isKey
isWheel
allowAlternateSelection
unitedWagerTypeCode
type {
id
name
code
}
group {
id
name
code
}
}
}
`
};
export default WagerTypesFragments;
webpack://frontend-tpt/../../node_modules/graphql-tag/lib/index.js
import { __assign } from "tslib";
import { parse } from 'graphql';
var docCache = new Map();
var fragmentSourceMap = new Map();
var printFragmentWarnings = true;
var experimentalFragmentVariables = false;
function normalize(string) {
return string.replace(/[\s,]+/g, ' ').trim();
}
function cacheKeyFromLoc(loc) {
return normalize(loc.source.body.substring(loc.start, loc.end));
}
function processFragments(ast) {
var seenKeys = new Set();
var definitions = [];
ast.definitions.forEach(function (fragmentDefinition) {
if (fragmentDefinition.kind === 'FragmentDefinition') {
var fragmentName = fragmentDefinition.name.value;
var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);
var sourceKeySet = fragmentSourceMap.get(fragmentName);
if (sourceKeySet && !sourceKeySet.has(sourceKey)) {
if (printFragmentWarnings) {
console.warn("Warning: fragment with name " + fragmentName + " already exists.\n"
+ "graphql-tag enforces all fragment names across your application to be unique; read more about\n"
+ "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names");
}
}
else if (!sourceKeySet) {
fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);
}
sourceKeySet.add(sourceKey);
if (!seenKeys.has(sourceKey)) {
seenKeys.add(sourceKey);
definitions.push(fragmentDefinition);
}
}
else {
definitions.push(fragmentDefinition);
}
});
return __assign(__assign({}, ast), { definitions: definitions });
}
function stripLoc(doc) {
var workSet = new Set(doc.definitions);
workSet.forEach(function (node) {
if (node.loc)
delete node.loc;
Object.keys(node).forEach(function (key) {
var value = node[key];
if (value && typeof value === 'object') {
workSet.add(value);
}
});
});
var loc = doc.loc;
if (loc) {
delete loc.startToken;
delete loc.endToken;
}
return doc;
}
function parseDocument(source) {
var cacheKey = normalize(source);
if (!docCache.has(cacheKey)) {
var parsed = parse(source, {
experimentalFragmentVariables: experimentalFragmentVariables
});
if (!parsed || parsed.kind !== 'Document') {
throw new Error('Not a valid GraphQL document.');
}
docCache.set(cacheKey, stripLoc(processFragments(parsed)));
}
return docCache.get(cacheKey);
}
export function gql(literals) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
if (typeof literals === 'string') {
literals = [literals];
}
var result = literals[0];
args.forEach(function (arg, i) {
if (arg && arg.kind === 'Document') {
result += arg.loc.source.body;
}
else {
result += arg;
}
result += literals[i + 1];
});
return parseDocument(result);
}
export function resetCaches() {
docCache.clear();
fragmentSourceMap.clear();
}
export function disableFragmentWarnings() {
printFragmentWarnings = false;
}
export function enableExperimentalFragmentVariables() {
experimentalFragmentVariables = true;
}
export function disableExperimentalFragmentVariables() {
experimentalFragmentVariables = false;
}
var extras = {
gql: gql,
resetCaches: resetCaches,
disableFragmentWarnings: disableFragmentWarnings,
enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,
disableExperimentalFragmentVariables: disableExperimentalFragmentVariables
};
(function (gql_1) {
gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;
})(gql || (gql = {}));
gql["default"] = gql;
export default gql;
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/TimeAndStatusFragment.ts
import gql from "graphql-tag";
const TimeAndStatusFragments = {
entry: gql`
fragment TimeAndStatus on Race {
mtp
postTime
status {
code
}
raceDate
}
`
};
export default TimeAndStatusFragments;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/ChangesFrament.ts
import { gql } from "@apollo/client";
const ChangesFragments = {
entry: gql`
fragment Changes on Race {
changes: changes {
surface {
course {
oldValue
newValue
date
}
distance {
date
oldValue {
value
code
name
shortName
}
newValue {
value
code
name
shortName
}
}
tempRailDistance {
oldValue
newValue
date
}
condition {
oldValue
newValue
date
}
}
horse {
scratched {
runnerId
horseName
date
scratched
reason
}
jockey {
runnerId
horseName
date
oldValue
newValue
}
}
}
}
`
};
export default ChangesFragments;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/RaceDetailsFragment.ts
import { gql } from "@apollo/client";
import ChangesFragments from "./ChangesFrament";
const RaceDetailsFragments = {
entry: gql`
fragment RaceDetails on Race {
raceNumber: number
trackCode
description
distance
purse
isGreyhound
numRunners
numWagerableRunners
claimingPrice
surface {
name
shortName
defaultCondition
}
type {
name
code
shortName
}
raceClass {
name
shortName
}
talentPicks {
id
}
timeform {
analystVerdict
}
...Changes
}
${ChangesFragments.entry}
`
};
export default RaceDetailsFragments;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/ResultsFragment.ts
import gql from "graphql-tag";
const ResultsFragments = {
entry: gql`
fragment Results on Race {
results {
runners {
betAmount
biNumber
finishPosition
placePayoff
runnerName
showPayoff
winPayoff
runnerNumber
timeform {
postRaceReport
accBeatenDistance
accBeatenDistanceStatus
}
}
payoffs {
selections {
payoutAmount
selection
}
wagerAmount
wagerType {
code
name
}
}
winningTime
}
}
`
};
export default ResultsFragments;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/PromosFragment.ts
import { gql } from "@apollo/client";
const PromosFragments = {
entry: gql`
fragment Promos on Race {
promos(product: $product, brand: $brand) {
rootParentPromoID
isAboveTheLine
promoPath
isPromoTagShown
}
}
`
};
export default PromosFragments;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/HandicappingFragment.ts
import { gql } from "@apollo/client";
const HandicappingFragments = {
entry: gql`
fragment handicappingFragment on Runner {
ownerName
sire
damSire
dam
handicapping {
speedAndClass {
avgClassRating
highSpeed
avgSpeed
lastClassRating
avgDistance
}
averagePace {
finish
numRaces
middle
early
}
jockeyTrainer {
places
jockeyName
trainerName
shows
wins
starts
}
snapshot {
powerRating
daysOff
horseWins
horseStarts
}
pastResults {
totalNumberOfStarts
numberOfFirstPlace
numberOfSecondPlace
numberOfThirdPlace
winPercentage
winPercentageRanking
top3Percentage
top3PercentageRanking
}
}
}
`
};
export default HandicappingFragments;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/TimeformFragment.ts
import { gql } from "@apollo/client";
const TimeformFragments = {
entry: gql`
fragment timeformFragment on Runner {
timeform {
analystsComments
silkUrl
silkUrlSvg
freePick {
number
info
}
flags {
horseInFocus
warningHorse
jockeyUplift
trainerUplift
horsesForCoursePos
horsesForCourseNeg
hotTrainer
coldTrainer
highestLastSpeedRating
sectionalFlag
significantImprover
jockeyInForm
clearTopRated
interestingJockeyBooking
firstTimeBlinkers
}
}
}
`
};
export default TimeformFragments;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/BettingInterestsFragment.ts
import { gql } from "@apollo/client";
import HandicappingFragments from "./HandicappingFragment";
import TimeformFragments from "./TimeformFragment";
const BettingInterestsFragments = {
entry: gql`
fragment BettingInterests on Race {
bettingInterests {
biNumber
favorite
numberColor
saddleColor
currentOdds {
numerator
denominator
}
morningLineOdds {
numerator
denominator
}
recentOdds(pages: [{ current: 0, results: 4 }]) {
trending
odd
}
biPools {
wagerType {
id
code
name
}
poolRunnersData {
amount
}
}
runners {
runnerId
scratched
jockey
trainer
horseName
hasJockeyChanges
...timeformFragment
...handicappingFragment
handicapping {
freePick {
number
info
}
}
}
}
}
${HandicappingFragments.entry}
${TimeformFragments.entry}
`
};
export default BettingInterestsFragments;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/RaceTrackFragment.ts
import { gql } from "@apollo/client";
const RaceTrackFragments = {
entry: gql`
fragment RaceTrack on Race {
track {
id
trackName: name
trackCode: code
perfAbbr
shortName
featured
numberOfRaces
trackLocation: location {
country
}
trackDataSource
}
}
`
};
export default RaceTrackFragments;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/ProbablesFragment.ts
import { gql } from "@apollo/client";
const ProbablesFragment = {
entry: gql`
fragment Probables on Race {
probables {
amount
minWagerAmount
wagerType {
id
code
name
}
betCombos {
runner1
runner2
payout
}
}
}
`
};
export default ProbablesFragment;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/RaceFragment.ts
import { gql } from "@apollo/client";
import WagerTypesFragments from "./WagerTypesFragment";
import TimeAndStatusFragments from "./TimeAndStatusFragment";
import RaceDetailsFragments from "./RaceDetailsFragment";
import ResultsFragments from "./ResultsFragment";
import PromosFragments from "./PromosFragment";
import BettingInterestsFragments from "./BettingInterestsFragment";
import RaceTrackFragments from "./RaceTrackFragment";
import ProbablesFragment from "./ProbablesFragment";
const RaceFragment = {
entry: gql`
fragment Race on Race {
id
tvgRaceId
...RaceTrack
...RaceDetails
...TimeAndStatus
...WagerTypes
...Promos
...Results
...BettingInterests
...Probables
}
${RaceTrackFragments.entry}
${WagerTypesFragments.entry}
${TimeAndStatusFragments.entry}
${RaceDetailsFragments.entry}
${BettingInterestsFragments.entry}
${ResultsFragments.entry}
${PromosFragments.entry}
${ProbablesFragment.entry}
`
};
export default RaceFragment;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/queries/RacesSubscription.ts
import { gql } from "@apollo/client";
import RaceFragment from "@urp/wagerpad/src/graphql/fragments/RaceFragment";
export const GET_RACES_SUBSCRIPTION = gql`
subscription raceUpdateByTvgRaceIds(
$wagerProfile: String!
$product: String
$brand: String
$tvgRaceIds: [Long!]
) {
raceUpdateByTvgRaceIds(
profile: $wagerProfile
tvgRaceIds: $tvgRaceIds
brand: $brand
product: $product
) {
id
tvgRaceId
...Race
...BettingInterests
}
}
${RaceFragment.entry}
`;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/queries/RacesQuery.ts
import { gql } from "@apollo/client";
import RaceFragment from "@urp/wagerpad/src/graphql/fragments/RaceFragment";
export const GET_RACES_LIST = gql`
query getRaces(
$wagerProfile: String
$filterByTrack: RaceListFilter
$sortByRaceNumber: RaceListSort
$product: String
$brand: String
) {
races: races(
profile: $wagerProfile
filter: $filterByTrack
sort: $sortByRaceNumber
) {
...Race
}
}
${RaceFragment.entry}
`;
webpack://frontend-tpt/../../packages/urp-comp-wagerpad/src/graphql/fragments/TrackFragment.ts
import { gql } from "@apollo/client";
import RaceFragments from "./RaceFragment";
const TrackFragment = {
entry: gql`
fragment Track on Track {
id
featured
name
perfAbbr
code
hasAboveTheLinePromo(product: $product, brand: $brand)
location {
country
}
currentRace {
...Race
}
}
${RaceFragments.entry}
`
};
export default TrackFragment;
webpack://frontend-tpt/../../node_modules/immer/dist/immer.esm.mjs
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return"'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return!!n&&!!n[Q]}function t(n){var r;return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return"production"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return"production"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];"production"!==process.env.NODE_ENV&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.g&&n(3,JSON.stringify(p(r)))}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c="add";m("Patches",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];"string"!=typeof p&&"number"!=typeof p&&(p=""+p),0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return"-"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=r.concat(n);t.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:r.concat(["length"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:"replace",path:[],value:r===H?void 0:r}),e.push({op:"replace",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,"size",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m("MapSet",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?g(c):O(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);export default fn;export{un as Immer,pn as applyPatches,K as castDraft,$ as castImmutable,ln as createDraft,R as current,J as enableAllPlugins,F as enableES5,C as enableMapSet,T as enablePatches,dn as finishDraft,d as freeze,L as immerable,r as isDraft,t as isDraftable,H as nothing,e as original,fn as produce,cn as produceWithPatches,sn as setAutoFreeze,vn as setUseProxies};
//# sourceMappingURL=immer.esm.js.map
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/graphql/queries/TracksQuery.ts
import { gql } from "@apollo/client";
import TrackFragment from "@urp/wagerpad/src/graphql/fragments/TrackFragment";
export const GET_TRACKS_LIST = gql`
query getTracks(
$wagerProfile: String
$sortByName: TrackListSort
$trackFilters: TrackListFilter
$product: String
$brand: String
) {
tracks(profile: $wagerProfile, sort: $sortByName, filter: $trackFilters) {
...Track
}
}
${TrackFragment.entry}
`;
webpack://frontend-tpt/../../node_modules/@reduxjs/toolkit/node_modules/redux/es/redux.js
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
/**
* Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
*
* Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
* during build.
* @param {number} code
*/
function formatProdErrorMessage(code) {
return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
}
// Inlined version of the `symbol-observable` polyfill
var $$observable = (function () {
return typeof Symbol === 'function' && Symbol.observable || '@@observable';
})();
/**
* These are private action types reserved by Redux.
* For any unknown actions, you must return the current state.
* If the current state is undefined, you must return the initial state.
* Do not reference these action types directly in your code.
*/
var randomString = function randomString() {
return Math.random().toString(36).substring(7).split('').join('.');
};
var ActionTypes = {
INIT: "@@redux/INIT" + randomString(),
REPLACE: "@@redux/REPLACE" + randomString(),
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
}
};
/**
* @param {any} obj The object to inspect.
* @returns {boolean} True if the argument appears to be a plain object.
*/
function isPlainObject(obj) {
if (typeof obj !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
function miniKindOf(val) {
if (val === void 0) return 'undefined';
if (val === null) return 'null';
var type = typeof val;
switch (type) {
case 'boolean':
case 'string':
case 'number':
case 'symbol':
case 'function':
{
return type;
}
}
if (Array.isArray(val)) return 'array';
if (isDate(val)) return 'date';
if (isError(val)) return 'error';
var constructorName = ctorName(val);
switch (constructorName) {
case 'Symbol':
case 'Promise':
case 'WeakMap':
case 'WeakSet':
case 'Map':
case 'Set':
return constructorName;
} // other
return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
}
function ctorName(val) {
return typeof val.constructor === 'function' ? val.constructor.name : null;
}
function isError(val) {
return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
}
function isDate(val) {
if (val instanceof Date) return true;
return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
}
function kindOf(val) {
var typeOfVal = typeof val;
if (process.env.NODE_ENV !== 'production') {
typeOfVal = miniKindOf(val);
}
return typeOfVal;
}
/**
* @deprecated
*
* **We recommend using the `configureStore` method
* of the `@reduxjs/toolkit` package**, which replaces `createStore`.
*
* Redux Toolkit is our recommended approach for writing Redux logic today,
* including store setup, reducers, data fetching, and more.
*
* **For more details, please read this Redux docs page:**
* **https://redux.js.org/introduction/why-rtk-is-redux-today**
*
* `configureStore` from Redux Toolkit is an improved version of `createStore` that
* simplifies setup and helps avoid common bugs.
*
* You should not be using the `redux` core package by itself today, except for learning purposes.
* The `createStore` method from the core `redux` package will not be removed, but we encourage
* all users to migrate to using Redux Toolkit for all Redux code.
*
* If you want to use `createStore` without this visual deprecation warning, use
* the `legacy_createStore` import instead:
*
* `import { legacy_createStore as createStore} from 'redux'`
*
*/
function createStore(reducer, preloadedState, enhancer) {
var _ref2;
if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');
}
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
enhancer = preloadedState;
preloadedState = undefined;
}
if (typeof enhancer !== 'undefined') {
if (typeof enhancer !== 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(1) : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
}
return enhancer(createStore)(reducer, preloadedState);
}
if (typeof reducer !== 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(2) : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
}
var currentReducer = reducer;
var currentState = preloadedState;
var currentListeners = [];
var nextListeners = currentListeners;
var isDispatching = false;
/**
* This makes a shallow copy of currentListeners so we can use
* nextListeners as a temporary list while dispatching.
*
* This prevents any bugs around consumers calling
* subscribe/unsubscribe in the middle of a dispatch.
*/
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
/**
* Reads the state tree managed by the store.
*
* @returns {any} The current state tree of your application.
*/
function getState() {
if (isDispatching) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
}
return currentState;
}
/**
* Adds a change listener. It will be called any time an action is dispatched,
* and some part of the state tree may potentially have changed. You may then
* call `getState()` to read the current state tree inside the callback.
*
* You may call `dispatch()` from a change listener, with the following
* caveats:
*
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
* If you subscribe or unsubscribe while the listeners are being invoked, this
* will not have any effect on the `dispatch()` that is currently in progress.
* However, the next `dispatch()` call, whether nested or not, will use a more
* recent snapshot of the subscription list.
*
* 2. The listener should not expect to see all state changes, as the state
* might have been updated multiple times during a nested `dispatch()` before
* the listener is called. It is, however, guaranteed that all subscribers
* registered before the `dispatch()` started will be called with the latest
* state by the time it exits.
*
* @param {Function} listener A callback to be invoked on every dispatch.
* @returns {Function} A function to remove this change listener.
*/
function subscribe(listener) {
if (typeof listener !== 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(4) : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
}
if (isDispatching) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener);
return function unsubscribe() {
if (!isSubscribed) {
return;
}
if (isDispatching) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index = nextListeners.indexOf(listener);
nextListeners.splice(index, 1);
currentListeners = null;
};
}
/**
* Dispatches an action. It is the only way to trigger a state change.
*
* The `reducer` function, used to create the store, will be called with the
* current state tree and the given `action`. Its return value will
* be considered the **next** state of the tree, and the change listeners
* will be notified.
*
* The base implementation only supports plain object actions. If you want to
* dispatch a Promise, an Observable, a thunk, or something else, you need to
* wrap your store creating function into the corresponding middleware. For
* example, see the documentation for the `redux-thunk` package. Even the
* middleware will eventually dispatch plain object actions using this method.
*
* @param {Object} action A plain object representing “what changed”. It is
* a good idea to keep actions serializable so you can record and replay user
* sessions, or use the time travelling `redux-devtools`. An action must have
* a `type` property which may not be `undefined`. It is a good idea to use
* string constants for action types.
*
* @returns {Object} For convenience, the same action object you dispatched.
*
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
* return something else (for example, a Promise you can await).
*/
function dispatch(action) {
if (!isPlainObject(action)) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(7) : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
}
if (typeof action.type === 'undefined') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
}
if (isDispatching) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');
}
try {
isDispatching = true;
currentState = currentReducer(currentState, action);
} finally {
isDispatching = false;
}
var listeners = currentListeners = nextListeners;
for (var i = 0; i < listeners.length; i++) {
var listener = listeners[i];
listener();
}
return action;
}
/**
* Replaces the reducer currently used by the store to calculate the state.
*
* You might need this if your app implements code splitting and you want to
* load some of the reducers dynamically. You might also need this if you
* implement a hot reloading mechanism for Redux.
*
* @param {Function} nextReducer The reducer for the store to use instead.
* @returns {void}
*/
function replaceReducer(nextReducer) {
if (typeof nextReducer !== 'function') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(10) : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
}
currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
// Any reducers that existed in both the new and old rootReducer
// will receive the previous state. This effectively populates
// the new state tree with any relevant data from the old one.
dispatch({
type: ActionTypes.REPLACE
});
}
/**
* Interoperability point for observable/reactive libraries.
* @returns {observable} A minimal observable of state changes.
* For more information, see the observable proposal:
* https://github.com/tc39/proposal-observable
*/
function observable() {
var _ref;
var outerSubscribe = subscribe;
return _ref = {
/**
* The minimal observable subscription method.
* @param {Object} observer Any object that can be used as an observer.
* The observer object should have a `next` method.
* @returns {subscription} An object with an `unsubscribe` method that can
* be used to unsubscribe the observable from the store, and prevent further
* emission of values from the observable.
*/
subscribe: function subscribe(observer) {
if (typeof observer !== 'object' || observer === null) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(11) : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
}
function observeState() {
if (observer.next) {
observer.next(getState());
}
}
observeState();
var unsubscribe = outerSubscribe(observeState);
return {
unsubscribe: unsubscribe
};
}
}, _ref[$$observable] = function () {
return this;
}, _ref;
} // When a store is created, an "INIT" action is dispatched so that every
// reducer returns their initial state. This effectively populates
// the initial state tree.
dispatch({
type: ActionTypes.INIT
});
return _ref2 = {
dispatch: dispatch,
subscribe: subscribe,
getState: getState,
replaceReducer: replaceReducer
}, _ref2[$$observable] = observable, _ref2;
}
/**
* Creates a Redux store that holds the state tree.
*
* **We recommend using `configureStore` from the
* `@reduxjs/toolkit` package**, which replaces `createStore`:
* **https://redux.js.org/introduction/why-rtk-is-redux-today**
*
* The only way to change the data in the store is to call `dispatch()` on it.
*
* There should only be a single store in your app. To specify how different
* parts of the state tree respond to actions, you may combine several reducers
* into a single reducer function by using `combineReducers`.
*
* @param {Function} reducer A function that returns the next state tree, given
* the current state tree and the action to handle.
*
* @param {any} [preloadedState] The initial state. You may optionally specify it
* to hydrate the state from the server in universal apps, or to restore a
* previously serialized user session.
* If you use `combineReducers` to produce the root reducer function, this must be
* an object with the same shape as `combineReducers` keys.
*
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
* to enhance the store with third-party capabilities such as middleware,
* time travel, persistence, etc. The only store enhancer that ships with Redux
* is `applyMiddleware()`.
*
* @returns {Store} A Redux store that lets you read the state, dispatch actions
* and subscribe to changes.
*/
var legacy_createStore = createStore;
/**
* Prints a warning in the console if it exists.
*
* @param {String} message The warning message.
* @returns {void}
*/
function warning(message) {
/* eslint-disable no-console */
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error(message);
}
/* eslint-enable no-console */
try {
// This error was thrown as a convenience so that if you enable
// "break on all exceptions" in your console,
// it would pause the execution at this line.
throw new Error(message);
} catch (e) {} // eslint-disable-line no-empty
}
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
var reducerKeys = Object.keys(reducers);
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
if (reducerKeys.length === 0) {
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
}
if (!isPlainObject(inputState)) {
return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
}
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
});
unexpectedKeys.forEach(function (key) {
unexpectedKeyCache[key] = true;
});
if (action && action.type === ActionTypes.REPLACE) return;
if (unexpectedKeys.length > 0) {
return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
}
}
function assertReducerShape(reducers) {
Object.keys(reducers).forEach(function (key) {
var reducer = reducers[key];
var initialState = reducer(undefined, {
type: ActionTypes.INIT
});
if (typeof initialState === 'undefined') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : "The slice reducer for key \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
}
if (typeof reducer(undefined, {
type: ActionTypes.PROBE_UNKNOWN_ACTION()
}) === 'undefined') {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : "The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
}
});
}
/**
* Turns an object whose values are different reducer functions, into a single
* reducer function. It will call every child reducer, and gather their results
* into a single state object, whose keys correspond to the keys of the passed
* reducer functions.
*
* @param {Object} reducers An object whose values correspond to different
* reducer functions that need to be combined into one. One handy way to obtain
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
* undefined for any action. Instead, they should return their initial state
* if the state passed to them was undefined, and the current state for any
* unrecognized action.
*
* @returns {Function} A reducer function that invokes every reducer inside the
* passed object, and builds a state object with the same shape.
*/
function combineReducers(reducers) {
var reducerKeys = Object.keys(reducers);
var finalReducers = {};
for (var i = 0; i < reducerKeys.length; i++) {
var key = reducerKeys[i];
if (process.env.NODE_ENV !== 'production') {
if (typeof reducers[key] === 'undefined') {
warning("No reducer provided for key \"" + key + "\"");
}
}
if (typeof reducers[key] === 'function') {
finalReducers[key] = reducers[key];
}
}
var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
// keys multiple times.
var unexpectedKeyCache;
if (process.env.NODE_ENV !== 'production') {
unexpectedKeyCache = {};
}
var shapeAssertionError;
try {
assertReducerShape(finalReducers);
} catch (e) {
shapeAssertionError = e;
}
return function combination(state, action) {
if (state === void 0) {
state = {};
}
if (shapeAssertionError) {
throw shapeAssertionError;
}
if (process.env.NODE_ENV !== 'production') {
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
if (warningMessage) {
warning(warningMessage);
}
}
var hasChanged = false;
var nextState = {};
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
var _key = finalReducerKeys[_i];
var reducer = finalReducers[_key];
var previousStateForKey = state[_key];
var nextStateForKey = reducer(previousStateForKey, action);
if (typeof nextStateForKey === 'undefined') {
var actionType = action && action.type;
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : "When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : '(unknown type)') + ", the slice reducer for key \"" + _key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.");
}
nextState[_key] = nextStateForKey;
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
}
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
return hasChanged ? nextState : state;
};
}
function bindActionCreator(actionCreator, dispatch) {
return function () {
return dispatch(actionCreator.apply(this, arguments));
};
}
/**
* Turns an object whose values are action creators, into an object with the
* same keys, but with every function wrapped into a `dispatch` call so they
* may be invoked directly. This is just a convenience method, as you can call
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
*
* For convenience, you can also pass an action creator as the first argument,
* and get a dispatch wrapped function in return.
*
* @param {Function|Object} actionCreators An object whose values are action
* creator functions. One handy way to obtain it is to use ES6 `import * as`
* syntax. You may also pass a single function.
*
* @param {Function} dispatch The `dispatch` function available on your Redux
* store.
*
* @returns {Function|Object} The object mimicking the original object, but with
* every action creator wrapped into the `dispatch` call. If you passed a
* function as `actionCreators`, the return value will also be a single
* function.
*/
function bindActionCreators(actionCreators, dispatch) {
if (typeof actionCreators === 'function') {
return bindActionCreator(actionCreators, dispatch);
}
if (typeof actionCreators !== 'object' || actionCreators === null) {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(16) : "bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
}
var boundActionCreators = {};
for (var key in actionCreators) {
var actionCreator = actionCreators[key];
if (typeof actionCreator === 'function') {
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
}
}
return boundActionCreators;
}
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
*
* @param {...Function} funcs The functions to compose.
* @returns {Function} A function obtained by composing the argument functions
* from right to left. For example, compose(f, g, h) is identical to doing
* (...args) => f(g(h(...args))).
*/
function compose() {
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
if (funcs.length === 0) {
return function (arg) {
return arg;
};
}
if (funcs.length === 1) {
return funcs[0];
}
return funcs.reduce(function (a, b) {
return function () {
return a(b.apply(void 0, arguments));
};
});
}
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
function applyMiddleware() {
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
middlewares[_key] = arguments[_key];
}
return function (createStore) {
return function () {
var store = createStore.apply(void 0, arguments);
var _dispatch = function dispatch() {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
};
var middlewareAPI = {
getState: store.getState,
dispatch: function dispatch() {
return _dispatch.apply(void 0, arguments);
}
};
var chain = middlewares.map(function (middleware) {
return middleware(middlewareAPI);
});
_dispatch = compose.apply(void 0, chain)(store.dispatch);
return _objectSpread(_objectSpread({}, store), {}, {
dispatch: _dispatch
});
};
};
}
export { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore, legacy_createStore };
webpack://frontend-tpt/../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };
var __spreadValues = function (a, b) {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
var prop = _c[_i];
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };
var __async = function (__this, __arguments, generator) {
return new Promise(function (resolve, reject) {
var fulfilled = function (value) {
try {
step(generator.next(value));
}
catch (e) {
reject(e);
}
};
var rejected = function (value) {
try {
step(generator.throw(value));
}
catch (e) {
reject(e);
}
};
var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/index.ts
import { enableES5 } from "immer";
export * from "redux";
import { default as default2, current as current2, freeze, original, isDraft as isDraft4 } from "immer";
import { createSelector as createSelector2 } from "reselect";
// src/createDraftSafeSelector.ts
import { current, isDraft } from "immer";
import { createSelector } from "reselect";
var createDraftSafeSelector = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var selector = createSelector.apply(void 0, args);
var wrappedSelector = function (value) {
var rest = [];
for (var _i = 1; _i < arguments.length; _i++) {
rest[_i - 1] = arguments[_i];
}
return selector.apply(void 0, __spreadArray([isDraft(value) ? current(value) : value], rest));
};
return wrappedSelector;
};
// src/configureStore.ts
import { createStore, compose as compose2, applyMiddleware, combineReducers } from "redux";
// src/devtoolsExtension.ts
import { compose } from "redux";
var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {
if (arguments.length === 0)
return void 0;
if (typeof arguments[0] === "object")
return compose;
return compose.apply(null, arguments);
};
var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {
return function (noop2) {
return noop2;
};
};
// src/isPlainObject.ts
function isPlainObject(value) {
if (typeof value !== "object" || value === null)
return false;
var proto = Object.getPrototypeOf(value);
if (proto === null)
return true;
var baseProto = proto;
while (Object.getPrototypeOf(baseProto) !== null) {
baseProto = Object.getPrototypeOf(baseProto);
}
return proto === baseProto;
}
// src/getDefaultMiddleware.ts
import thunkMiddleware from "redux-thunk";
// src/utils.ts
import createNextState, { isDraftable } from "immer";
function getTimeMeasureUtils(maxDelay, fnName) {
var elapsed = 0;
return {
measureTime: function (fn) {
var started = Date.now();
try {
return fn();
}
finally {
var finished = Date.now();
elapsed += finished - started;
}
},
warnIfExceeded: function () {
if (elapsed > maxDelay) {
console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.");
}
}
};
}
var MiddlewareArray = /** @class */ (function (_super) {
__extends(MiddlewareArray, _super);
function MiddlewareArray() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
Object.setPrototypeOf(_this, MiddlewareArray.prototype);
return _this;
}
Object.defineProperty(MiddlewareArray, Symbol.species, {
get: function () {
return MiddlewareArray;
},
enumerable: false,
configurable: true
});
MiddlewareArray.prototype.concat = function () {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
return _super.prototype.concat.apply(this, arr);
};
MiddlewareArray.prototype.prepend = function () {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
if (arr.length === 1 && Array.isArray(arr[0])) {
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();
}
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();
};
return MiddlewareArray;
}(Array));
var EnhancerArray = /** @class */ (function (_super) {
__extends(EnhancerArray, _super);
function EnhancerArray() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
Object.setPrototypeOf(_this, EnhancerArray.prototype);
return _this;
}
Object.defineProperty(EnhancerArray, Symbol.species, {
get: function () {
return EnhancerArray;
},
enumerable: false,
configurable: true
});
EnhancerArray.prototype.concat = function () {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
return _super.prototype.concat.apply(this, arr);
};
EnhancerArray.prototype.prepend = function () {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
if (arr.length === 1 && Array.isArray(arr[0])) {
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();
}
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();
};
return EnhancerArray;
}(Array));
function freezeDraftable(val) {
return isDraftable(val) ? createNextState(val, function () {
}) : val;
}
// src/immutableStateInvariantMiddleware.ts
var isProduction = process.env.NODE_ENV === "production";
var prefix = "Invariant failed";
function invariant(condition, message) {
if (condition) {
return;
}
if (isProduction) {
throw new Error(prefix);
}
throw new Error(prefix + ": " + (message || ""));
}
function stringify(obj, serializer, indent, decycler) {
return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
}
function getSerialize(serializer, decycler) {
var stack = [], keys = [];
if (!decycler)
decycler = function (_, value) {
if (stack[0] === value)
return "[Circular ~]";
return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
};
return function (key, value) {
if (stack.length > 0) {
var thisPos = stack.indexOf(this);
~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
if (~stack.indexOf(value))
value = decycler.call(this, key, value);
}
else
stack.push(value);
return serializer == null ? value : serializer.call(this, key, value);
};
}
function isImmutableDefault(value) {
return typeof value !== "object" || value == null || Object.isFrozen(value);
}
function trackForMutations(isImmutable, ignorePaths, obj) {
var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
return {
detectMutations: function () {
return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
}
};
}
function trackProperties(isImmutable, ignorePaths, obj, path) {
if (ignorePaths === void 0) { ignorePaths = []; }
if (path === void 0) { path = ""; }
var tracked = { value: obj };
if (!isImmutable(obj)) {
tracked.children = {};
for (var key in obj) {
var childPath = path ? path + "." + key : key;
if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
continue;
}
tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
}
}
return tracked;
}
function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {
if (ignoredPaths === void 0) { ignoredPaths = []; }
if (sameParentRef === void 0) { sameParentRef = false; }
if (path === void 0) { path = ""; }
var prevObj = trackedProperty ? trackedProperty.value : void 0;
var sameRef = prevObj === obj;
if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
return { wasMutated: true, path: path };
}
if (isImmutable(prevObj) || isImmutable(obj)) {
return { wasMutated: false };
}
var keysToDetect = {};
for (var key in trackedProperty.children) {
keysToDetect[key] = true;
}
for (var key in obj) {
keysToDetect[key] = true;
}
var hasIgnoredPaths = ignoredPaths.length > 0;
var _loop_1 = function (key) {
var nestedPath = path ? path + "." + key : key;
if (hasIgnoredPaths) {
var hasMatches = ignoredPaths.some(function (ignored) {
if (ignored instanceof RegExp) {
return ignored.test(nestedPath);
}
return nestedPath === ignored;
});
if (hasMatches) {
return "continue";
}
}
var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);
if (result.wasMutated) {
return { value: result };
}
};
for (var key in keysToDetect) {
var state_1 = _loop_1(key);
if (typeof state_1 === "object")
return state_1.value;
}
return { wasMutated: false };
}
function createImmutableStateInvariantMiddleware(options) {
if (options === void 0) { options = {}; }
if (process.env.NODE_ENV === "production") {
return function () { return function (next) { return function (action) { return next(action); }; }; };
}
var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore;
ignoredPaths = ignoredPaths || ignore;
var track = trackForMutations.bind(null, isImmutable, ignoredPaths);
return function (_c) {
var getState = _c.getState;
var state = getState();
var tracker = track(state);
var result;
return function (next) { return function (action) {
var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware");
measureUtils.measureTime(function () {
state = getState();
result = tracker.detectMutations();
tracker = track(state);
invariant(!result.wasMutated, "A state mutation was detected between dispatches, in the path '" + (result.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
});
var dispatchedAction = next(action);
measureUtils.measureTime(function () {
state = getState();
result = tracker.detectMutations();
tracker = track(state);
result.wasMutated && invariant(!result.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (result.path || "") + ". Take a look at the reducer(s) handling the action " + stringify(action) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
});
measureUtils.warnIfExceeded();
return dispatchedAction;
}; };
};
}
// src/serializableStateInvariantMiddleware.ts
function isPlain(val) {
var type = typeof val;
return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val);
}
function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {
if (path === void 0) { path = ""; }
if (isSerializable === void 0) { isSerializable = isPlain; }
if (ignoredPaths === void 0) { ignoredPaths = []; }
var foundNestedSerializable;
if (!isSerializable(value)) {
return {
keyPath: path || "<root>",
value: value
};
}
if (typeof value !== "object" || value === null) {
return false;
}
if (cache == null ? void 0 : cache.has(value))
return false;
var entries = getEntries != null ? getEntries(value) : Object.entries(value);
var hasIgnoredPaths = ignoredPaths.length > 0;
var _loop_2 = function (key, nestedValue) {
var nestedPath = path ? path + "." + key : key;
if (hasIgnoredPaths) {
var hasMatches = ignoredPaths.some(function (ignored) {
if (ignored instanceof RegExp) {
return ignored.test(nestedPath);
}
return nestedPath === ignored;
});
if (hasMatches) {
return "continue";
}
}
if (!isSerializable(nestedValue)) {
return { value: {
keyPath: nestedPath,
value: nestedValue
} };
}
if (typeof nestedValue === "object") {
foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);
if (foundNestedSerializable) {
return { value: foundNestedSerializable };
}
}
};
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
var state_2 = _loop_2(key, nestedValue);
if (typeof state_2 === "object")
return state_2.value;
}
if (cache && isNestedFrozen(value))
cache.add(value);
return false;
}
function isNestedFrozen(value) {
if (!Object.isFrozen(value))
return false;
for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {
var nestedValue = _c[_i];
if (typeof nestedValue !== "object" || nestedValue === null)
continue;
if (!isNestedFrozen(nestedValue))
return false;
}
return true;
}
function createSerializableStateInvariantMiddleware(options) {
if (options === void 0) { options = {}; }
if (process.env.NODE_ENV === "production") {
return function () { return function (next) { return function (action) { return next(action); }; }; };
}
var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j, _k = options.disableCache, disableCache = _k === void 0 ? false : _k;
var cache = !disableCache && WeakSet ? new WeakSet() : void 0;
return function (storeAPI) { return function (next) { return function (action) {
var result = next(action);
var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
measureUtils.measureTime(function () {
var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache);
if (foundActionNonSerializableValue) {
var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
}
});
}
if (!ignoreState) {
measureUtils.measureTime(function () {
var state = storeAPI.getState();
var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache);
if (foundStateNonSerializableValue) {
var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)");
}
});
measureUtils.warnIfExceeded();
}
return result;
}; }; };
}
// src/getDefaultMiddleware.ts
function isBoolean(x) {
return typeof x === "boolean";
}
function curryGetDefaultMiddleware() {
return function curriedGetDefaultMiddleware(options) {
return getDefaultMiddleware(options);
};
}
function getDefaultMiddleware(options) {
if (options === void 0) { options = {}; }
var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e;
var middlewareArray = new MiddlewareArray();
if (thunk) {
if (isBoolean(thunk)) {
middlewareArray.push(thunkMiddleware);
}
else {
middlewareArray.push(thunkMiddleware.withExtraArgument(thunk.extraArgument));
}
}
if (process.env.NODE_ENV !== "production") {
if (immutableCheck) {
var immutableOptions = {};
if (!isBoolean(immutableCheck)) {
immutableOptions = immutableCheck;
}
middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
}
if (serializableCheck) {
var serializableOptions = {};
if (!isBoolean(serializableCheck)) {
serializableOptions = serializableCheck;
}
middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
}
}
return middlewareArray;
}
// src/configureStore.ts
var IS_PRODUCTION = process.env.NODE_ENV === "production";
function configureStore(options) {
var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;
var rootReducer;
if (typeof reducer === "function") {
rootReducer = reducer;
}
else if (isPlainObject(reducer)) {
rootReducer = combineReducers(reducer);
}
else {
throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
}
var finalMiddleware = middleware;
if (typeof finalMiddleware === "function") {
finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
throw new Error("when using a middleware builder function, an array of middleware must be returned");
}
}
if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) {
throw new Error("each middleware provided to configureStore must be a function");
}
var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware);
var finalCompose = compose2;
if (devTools) {
finalCompose = composeWithDevTools(__spreadValues({
trace: !IS_PRODUCTION
}, typeof devTools === "object" && devTools));
}
var defaultEnhancers = new EnhancerArray(middlewareEnhancer);
var storeEnhancers = defaultEnhancers;
if (Array.isArray(enhancers)) {
storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
}
else if (typeof enhancers === "function") {
storeEnhancers = enhancers(defaultEnhancers);
}
var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
return createStore(rootReducer, preloadedState, composedEnhancer);
}
// src/createAction.ts
function createAction(type, prepareAction) {
function actionCreator() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (prepareAction) {
var prepared = prepareAction.apply(void 0, args);
if (!prepared) {
throw new Error("prepareAction did not return an object");
}
return __spreadValues(__spreadValues({
type: type,
payload: prepared.payload
}, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
}
return { type: type, payload: args[0] };
}
actionCreator.toString = function () { return "" + type; };
actionCreator.type = type;
actionCreator.match = function (action) { return action.type === type; };
return actionCreator;
}
function isAction(action) {
return isPlainObject(action) && "type" in action;
}
function isFSA(action) {
return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
}
function isValidKey(key) {
return ["type", "payload", "error", "meta"].indexOf(key) > -1;
}
function getType(actionCreator) {
return "" + actionCreator;
}
// src/createReducer.ts
import createNextState2, { isDraft as isDraft2, isDraftable as isDraftable2 } from "immer";
// src/mapBuilders.ts
function executeReducerBuilderCallback(builderCallback) {
var actionsMap = {};
var actionMatchers = [];
var defaultCaseReducer;
var builder = {
addCase: function (typeOrActionCreator, reducer) {
if (process.env.NODE_ENV !== "production") {
if (actionMatchers.length > 0) {
throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
}
if (defaultCaseReducer) {
throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
}
}
var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
if (type in actionsMap) {
throw new Error("addCase cannot be called with two reducers for the same action type");
}
actionsMap[type] = reducer;
return builder;
},
addMatcher: function (matcher, reducer) {
if (process.env.NODE_ENV !== "production") {
if (defaultCaseReducer) {
throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
}
}
actionMatchers.push({ matcher: matcher, reducer: reducer });
return builder;
},
addDefaultCase: function (reducer) {
if (process.env.NODE_ENV !== "production") {
if (defaultCaseReducer) {
throw new Error("`builder.addDefaultCase` can only be called once");
}
}
defaultCaseReducer = reducer;
return builder;
}
};
builderCallback(builder);
return [actionsMap, actionMatchers, defaultCaseReducer];
}
// src/createReducer.ts
function isStateFunction(x) {
return typeof x === "function";
}
var hasWarnedAboutObjectNotation = false;
function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
if (actionMatchers === void 0) { actionMatchers = []; }
if (process.env.NODE_ENV !== "production") {
if (typeof mapOrBuilderCallback === "object") {
if (!hasWarnedAboutObjectNotation) {
hasWarnedAboutObjectNotation = true;
console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
}
}
}
var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
var getInitialState;
if (isStateFunction(initialState)) {
getInitialState = function () { return freezeDraftable(initialState()); };
}
else {
var frozenInitialState_1 = freezeDraftable(initialState);
getInitialState = function () { return frozenInitialState_1; };
}
function reducer(state, action) {
if (state === void 0) { state = getInitialState(); }
var caseReducers = __spreadArray([
actionsMap[action.type]
], finalActionMatchers.filter(function (_c) {
var matcher = _c.matcher;
return matcher(action);
}).map(function (_c) {
var reducer2 = _c.reducer;
return reducer2;
}));
if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {
caseReducers = [finalDefaultCaseReducer];
}
return caseReducers.reduce(function (previousState, caseReducer) {
if (caseReducer) {
if (isDraft2(previousState)) {
var draft = previousState;
var result = caseReducer(draft, action);
if (result === void 0) {
return previousState;
}
return result;
}
else if (!isDraftable2(previousState)) {
var result = caseReducer(previousState, action);
if (result === void 0) {
if (previousState === null) {
return previousState;
}
throw Error("A case reducer on a non-draftable value must not return undefined");
}
return result;
}
else {
return createNextState2(previousState, function (draft) {
return caseReducer(draft, action);
});
}
}
return previousState;
}, state);
}
reducer.getInitialState = getInitialState;
return reducer;
}
// src/createSlice.ts
var hasWarnedAboutObjectNotation2 = false;
function getType2(slice, actionKey) {
return slice + "/" + actionKey;
}
function createSlice(options) {
var name = options.name;
if (!name) {
throw new Error("`name` is a required option for createSlice");
}
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
if (options.initialState === void 0) {
console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
}
}
var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
var reducers = options.reducers || {};
var reducerNames = Object.keys(reducers);
var sliceCaseReducersByName = {};
var sliceCaseReducersByType = {};
var actionCreators = {};
reducerNames.forEach(function (reducerName) {
var maybeReducerWithPrepare = reducers[reducerName];
var type = getType2(name, reducerName);
var caseReducer;
var prepareCallback;
if ("reducer" in maybeReducerWithPrepare) {
caseReducer = maybeReducerWithPrepare.reducer;
prepareCallback = maybeReducerWithPrepare.prepare;
}
else {
caseReducer = maybeReducerWithPrepare;
}
sliceCaseReducersByName[reducerName] = caseReducer;
sliceCaseReducersByType[type] = caseReducer;
actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
});
function buildReducer() {
if (process.env.NODE_ENV !== "production") {
if (typeof options.extraReducers === "object") {
if (!hasWarnedAboutObjectNotation2) {
hasWarnedAboutObjectNotation2 = true;
console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
}
}
}
var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;
var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
return createReducer(initialState, function (builder) {
for (var key in finalCaseReducers) {
builder.addCase(key, finalCaseReducers[key]);
}
for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {
var m = actionMatchers_1[_i];
builder.addMatcher(m.matcher, m.reducer);
}
if (defaultCaseReducer) {
builder.addDefaultCase(defaultCaseReducer);
}
});
}
var _reducer;
return {
name: name,
reducer: function (state, action) {
if (!_reducer)
_reducer = buildReducer();
return _reducer(state, action);
},
actions: actionCreators,
caseReducers: sliceCaseReducersByName,
getInitialState: function () {
if (!_reducer)
_reducer = buildReducer();
return _reducer.getInitialState();
}
};
}
// src/entities/entity_state.ts
function getInitialEntityState() {
return {
ids: [],
entities: {}
};
}
function createInitialStateFactory() {
function getInitialState(additionalState) {
if (additionalState === void 0) { additionalState = {}; }
return Object.assign(getInitialEntityState(), additionalState);
}
return { getInitialState: getInitialState };
}
// src/entities/state_selectors.ts
function createSelectorsFactory() {
function getSelectors(selectState) {
var selectIds = function (state) { return state.ids; };
var selectEntities = function (state) { return state.entities; };
var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });
var selectId = function (_, id) { return id; };
var selectById = function (entities, id) { return entities[id]; };
var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });
if (!selectState) {
return {
selectIds: selectIds,
selectEntities: selectEntities,
selectAll: selectAll,
selectTotal: selectTotal,
selectById: createDraftSafeSelector(selectEntities, selectId, selectById)
};
}
var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);
return {
selectIds: createDraftSafeSelector(selectState, selectIds),
selectEntities: selectGlobalizedEntities,
selectAll: createDraftSafeSelector(selectState, selectAll),
selectTotal: createDraftSafeSelector(selectState, selectTotal),
selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)
};
}
return { getSelectors: getSelectors };
}
// src/entities/state_adapter.ts
import createNextState3, { isDraft as isDraft3 } from "immer";
function createSingleArgumentStateOperator(mutator) {
var operator = createStateOperator(function (_, state) { return mutator(state); });
return function operation(state) {
return operator(state, void 0);
};
}
function createStateOperator(mutator) {
return function operation(state, arg) {
function isPayloadActionArgument(arg2) {
return isFSA(arg2);
}
var runMutator = function (draft) {
if (isPayloadActionArgument(arg)) {
mutator(arg.payload, draft);
}
else {
mutator(arg, draft);
}
};
if (isDraft3(state)) {
runMutator(state);
return state;
}
else {
return createNextState3(state, runMutator);
}
};
}
// src/entities/utils.ts
function selectIdValue(entity, selectId) {
var key = selectId(entity);
if (process.env.NODE_ENV !== "production" && key === void 0) {
console.warn("The entity passed to the `selectId` implementation returned undefined.", "You should probably provide your own `selectId` implementation.", "The entity that was passed:", entity, "The `selectId` implementation:", selectId.toString());
}
return key;
}
function ensureEntitiesArray(entities) {
if (!Array.isArray(entities)) {
entities = Object.values(entities);
}
return entities;
}
function splitAddedUpdatedEntities(newEntities, selectId, state) {
newEntities = ensureEntitiesArray(newEntities);
var added = [];
var updated = [];
for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {
var entity = newEntities_1[_i];
var id = selectIdValue(entity, selectId);
if (id in state.entities) {
updated.push({ id: id, changes: entity });
}
else {
added.push(entity);
}
}
return [added, updated];
}
// src/entities/unsorted_state_adapter.ts
function createUnsortedStateAdapter(selectId) {
function addOneMutably(entity, state) {
var key = selectIdValue(entity, selectId);
if (key in state.entities) {
return;
}
state.ids.push(key);
state.entities[key] = entity;
}
function addManyMutably(newEntities, state) {
newEntities = ensureEntitiesArray(newEntities);
for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {
var entity = newEntities_2[_i];
addOneMutably(entity, state);
}
}
function setOneMutably(entity, state) {
var key = selectIdValue(entity, selectId);
if (!(key in state.entities)) {
state.ids.push(key);
}
state.entities[key] = entity;
}
function setManyMutably(newEntities, state) {
newEntities = ensureEntitiesArray(newEntities);
for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {
var entity = newEntities_3[_i];
setOneMutably(entity, state);
}
}
function setAllMutably(newEntities, state) {
newEntities = ensureEntitiesArray(newEntities);
state.ids = [];
state.entities = {};
addManyMutably(newEntities, state);
}
function removeOneMutably(key, state) {
return removeManyMutably([key], state);
}
function removeManyMutably(keys, state) {
var didMutate = false;
keys.forEach(function (key) {
if (key in state.entities) {
delete state.entities[key];
didMutate = true;
}
});
if (didMutate) {
state.ids = state.ids.filter(function (id) { return id in state.entities; });
}
}
function removeAllMutably(state) {
Object.assign(state, {
ids: [],
entities: {}
});
}
function takeNewKey(keys, update, state) {
var original2 = state.entities[update.id];
var updated = Object.assign({}, original2, update.changes);
var newKey = selectIdValue(updated, selectId);
var hasNewKey = newKey !== update.id;
if (hasNewKey) {
keys[update.id] = newKey;
delete state.entities[update.id];
}
state.entities[newKey] = updated;
return hasNewKey;
}
function updateOneMutably(update, state) {
return updateManyMutably([update], state);
}
function updateManyMutably(updates, state) {
var newKeys = {};
var updatesPerEntity = {};
updates.forEach(function (update) {
if (update.id in state.entities) {
updatesPerEntity[update.id] = {
id: update.id,
changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)
};
}
});
updates = Object.values(updatesPerEntity);
var didMutateEntities = updates.length > 0;
if (didMutateEntities) {
var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;
if (didMutateIds) {
state.ids = Object.keys(state.entities);
}
}
}
function upsertOneMutably(entity, state) {
return upsertManyMutably([entity], state);
}
function upsertManyMutably(newEntities, state) {
var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
updateManyMutably(updated, state);
addManyMutably(added, state);
}
return {
removeAll: createSingleArgumentStateOperator(removeAllMutably),
addOne: createStateOperator(addOneMutably),
addMany: createStateOperator(addManyMutably),
setOne: createStateOperator(setOneMutably),
setMany: createStateOperator(setManyMutably),
setAll: createStateOperator(setAllMutably),
updateOne: createStateOperator(updateOneMutably),
updateMany: createStateOperator(updateManyMutably),
upsertOne: createStateOperator(upsertOneMutably),
upsertMany: createStateOperator(upsertManyMutably),
removeOne: createStateOperator(removeOneMutably),
removeMany: createStateOperator(removeManyMutably)
};
}
// src/entities/sorted_state_adapter.ts
function createSortedStateAdapter(selectId, sort) {
var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;
function addOneMutably(entity, state) {
return addManyMutably([entity], state);
}
function addManyMutably(newEntities, state) {
newEntities = ensureEntitiesArray(newEntities);
var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });
if (models.length !== 0) {
merge(models, state);
}
}
function setOneMutably(entity, state) {
return setManyMutably([entity], state);
}
function setManyMutably(newEntities, state) {
newEntities = ensureEntitiesArray(newEntities);
if (newEntities.length !== 0) {
merge(newEntities, state);
}
}
function setAllMutably(newEntities, state) {
newEntities = ensureEntitiesArray(newEntities);
state.entities = {};
state.ids = [];
addManyMutably(newEntities, state);
}
function updateOneMutably(update, state) {
return updateManyMutably([update], state);
}
function updateManyMutably(updates, state) {
var appliedUpdates = false;
for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {
var update = updates_1[_i];
var entity = state.entities[update.id];
if (!entity) {
continue;
}
appliedUpdates = true;
Object.assign(entity, update.changes);
var newId = selectId(entity);
if (update.id !== newId) {
delete state.entities[update.id];
state.entities[newId] = entity;
}
}
if (appliedUpdates) {
resortEntities(state);
}
}
function upsertOneMutably(entity, state) {
return upsertManyMutably([entity], state);
}
function upsertManyMutably(newEntities, state) {
var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
updateManyMutably(updated, state);
addManyMutably(added, state);
}
function areArraysEqual(a, b) {
if (a.length !== b.length) {
return false;
}
for (var i = 0; i < a.length && i < b.length; i++) {
if (a[i] === b[i]) {
continue;
}
return false;
}
return true;
}
function merge(models, state) {
models.forEach(function (model) {
state.entities[selectId(model)] = model;
});
resortEntities(state);
}
function resortEntities(state) {
var allEntities = Object.values(state.entities);
allEntities.sort(sort);
var newSortedIds = allEntities.map(selectId);
var ids = state.ids;
if (!areArraysEqual(ids, newSortedIds)) {
state.ids = newSortedIds;
}
}
return {
removeOne: removeOne,
removeMany: removeMany,
removeAll: removeAll,
addOne: createStateOperator(addOneMutably),
updateOne: createStateOperator(updateOneMutably),
upsertOne: createStateOperator(upsertOneMutably),
setOne: createStateOperator(setOneMutably),
setMany: createStateOperator(setManyMutably),
setAll: createStateOperator(setAllMutably),
addMany: createStateOperator(addManyMutably),
updateMany: createStateOperator(updateManyMutably),
upsertMany: createStateOperator(upsertManyMutably)
};
}
// src/entities/create_adapter.ts
function createEntityAdapter(options) {
if (options === void 0) { options = {}; }
var _c = __spreadValues({
sortComparer: false,
selectId: function (instance) { return instance.id; }
}, options), selectId = _c.selectId, sortComparer = _c.sortComparer;
var stateFactory = createInitialStateFactory();
var selectorsFactory = createSelectorsFactory();
var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);
return __spreadValues(__spreadValues(__spreadValues({
selectId: selectId,
sortComparer: sortComparer
}, stateFactory), selectorsFactory), stateAdapter);
}
// src/nanoid.ts
var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
var nanoid = function (size) {
if (size === void 0) { size = 21; }
var id = "";
var i = size;
while (i--) {
id += urlAlphabet[Math.random() * 64 | 0];
}
return id;
};
// src/createAsyncThunk.ts
var commonProperties = [
"name",
"message",
"stack",
"code"
];
var RejectWithValue = /** @class */ (function () {
function RejectWithValue(payload, meta) {
this.payload = payload;
this.meta = meta;
}
return RejectWithValue;
}());
var FulfillWithMeta = /** @class */ (function () {
function FulfillWithMeta(payload, meta) {
this.payload = payload;
this.meta = meta;
}
return FulfillWithMeta;
}());
var miniSerializeError = function (value) {
if (typeof value === "object" && value !== null) {
var simpleError = {};
for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
var property = commonProperties_1[_i];
if (typeof value[property] === "string") {
simpleError[property] = value[property];
}
}
return simpleError;
}
return { message: String(value) };
};
var createAsyncThunk = (function () {
function createAsyncThunk2(typePrefix, payloadCreator, options) {
var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({
payload: payload,
meta: __spreadProps(__spreadValues({}, meta || {}), {
arg: arg,
requestId: requestId,
requestStatus: "fulfilled"
})
}); });
var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({
payload: void 0,
meta: __spreadProps(__spreadValues({}, meta || {}), {
arg: arg,
requestId: requestId,
requestStatus: "pending"
})
}); });
var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({
payload: payload,
error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
meta: __spreadProps(__spreadValues({}, meta || {}), {
arg: arg,
requestId: requestId,
rejectedWithValue: !!payload,
requestStatus: "rejected",
aborted: (error == null ? void 0 : error.name) === "AbortError",
condition: (error == null ? void 0 : error.name) === "ConditionError"
})
}); });
var displayedWarning = false;
var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () {
function class_1() {
this.signal = {
aborted: false,
addEventListener: function () {
},
dispatchEvent: function () {
return false;
},
onabort: function () {
},
removeEventListener: function () {
},
reason: void 0,
throwIfAborted: function () {
}
};
}
class_1.prototype.abort = function () {
if (process.env.NODE_ENV !== "production") {
if (!displayedWarning) {
displayedWarning = true;
console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.");
}
}
};
return class_1;
}());
function actionCreator(arg) {
return function (dispatch, getState, extra) {
var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
var abortController = new AC();
var abortReason;
var started = false;
function abort(reason) {
abortReason = reason;
abortController.abort();
}
var promise2 = function () {
return __async(this, null, function () {
var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_c.trys.push([0, 4, , 5]);
conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });
if (!isThenable(conditionResult)) return [3 /*break*/, 2];
return [4 /*yield*/, conditionResult];
case 1:
conditionResult = _c.sent();
_c.label = 2;
case 2:
if (conditionResult === false || abortController.signal.aborted) {
throw {
name: "ConditionError",
message: "Aborted due to condition callback returning false."
};
}
started = true;
abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({
name: "AbortError",
message: abortReason || "Aborted"
}); }); });
dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra })));
return [4 /*yield*/, Promise.race([
abortedPromise,
Promise.resolve(payloadCreator(arg, {
dispatch: dispatch,
getState: getState,
extra: extra,
requestId: requestId,
signal: abortController.signal,
abort: abort,
rejectWithValue: function (value, meta) {
return new RejectWithValue(value, meta);
},
fulfillWithValue: function (value, meta) {
return new FulfillWithMeta(value, meta);
}
})).then(function (result) {
if (result instanceof RejectWithValue) {
throw result;
}
if (result instanceof FulfillWithMeta) {
return fulfilled(result.payload, requestId, arg, result.meta);
}
return fulfilled(result, requestId, arg);
})
])];
case 3:
finalAction = _c.sent();
return [3 /*break*/, 5];
case 4:
err_1 = _c.sent();
finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
return [3 /*break*/, 5];
case 5:
skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
if (!skipDispatch) {
dispatch(finalAction);
}
return [2 /*return*/, finalAction];
}
});
});
}();
return Object.assign(promise2, {
abort: abort,
requestId: requestId,
arg: arg,
unwrap: function () {
return promise2.then(unwrapResult);
}
});
};
}
return Object.assign(actionCreator, {
pending: pending,
rejected: rejected,
fulfilled: fulfilled,
typePrefix: typePrefix
});
}
createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };
return createAsyncThunk2;
})();
function unwrapResult(action) {
if (action.meta && action.meta.rejectedWithValue) {
throw action.payload;
}
if (action.error) {
throw action.error;
}
return action.payload;
}
function isThenable(value) {
return value !== null && typeof value === "object" && typeof value.then === "function";
}
// src/tsHelpers.ts
var hasMatchFunction = function (v) {
return v && typeof v.match === "function";
};
// src/matchers.ts
var matches = function (matcher, action) {
if (hasMatchFunction(matcher)) {
return matcher.match(action);
}
else {
return matcher(action);
}
};
function isAnyOf() {
var matchers = [];
for (var _i = 0; _i < arguments.length; _i++) {
matchers[_i] = arguments[_i];
}
return function (action) {
return matchers.some(function (matcher) { return matches(matcher, action); });
};
}
function isAllOf() {
var matchers = [];
for (var _i = 0; _i < arguments.length; _i++) {
matchers[_i] = arguments[_i];
}
return function (action) {
return matchers.every(function (matcher) { return matches(matcher, action); });
};
}
function hasExpectedRequestMetadata(action, validStatus) {
if (!action || !action.meta)
return false;
var hasValidRequestId = typeof action.meta.requestId === "string";
var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
return hasValidRequestId && hasValidRequestStatus;
}
function isAsyncThunkArray(a) {
return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0];
}
function isPending() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
if (asyncThunks.length === 0) {
return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); };
}
if (!isAsyncThunkArray(asyncThunks)) {
return isPending()(asyncThunks[0]);
}
return function (action) {
var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });
var combinedMatcher = isAnyOf.apply(void 0, matchers);
return combinedMatcher(action);
};
}
function isRejected() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
if (asyncThunks.length === 0) {
return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); };
}
if (!isAsyncThunkArray(asyncThunks)) {
return isRejected()(asyncThunks[0]);
}
return function (action) {
var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });
var combinedMatcher = isAnyOf.apply(void 0, matchers);
return combinedMatcher(action);
};
}
function isRejectedWithValue() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
var hasFlag = function (action) {
return action && action.meta && action.meta.rejectedWithValue;
};
if (asyncThunks.length === 0) {
return function (action) {
var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
return combinedMatcher(action);
};
}
if (!isAsyncThunkArray(asyncThunks)) {
return isRejectedWithValue()(asyncThunks[0]);
}
return function (action) {
var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
return combinedMatcher(action);
};
}
function isFulfilled() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
if (asyncThunks.length === 0) {
return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); };
}
if (!isAsyncThunkArray(asyncThunks)) {
return isFulfilled()(asyncThunks[0]);
}
return function (action) {
var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });
var combinedMatcher = isAnyOf.apply(void 0, matchers);
return combinedMatcher(action);
};
}
function isAsyncThunkAction() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
if (asyncThunks.length === 0) {
return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); };
}
if (!isAsyncThunkArray(asyncThunks)) {
return isAsyncThunkAction()(asyncThunks[0]);
}
return function (action) {
var matchers = [];
for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {
var asyncThunk = asyncThunks_1[_i];
matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);
}
var combinedMatcher = isAnyOf.apply(void 0, matchers);
return combinedMatcher(action);
};
}
// src/listenerMiddleware/utils.ts
var assertFunction = function (func, expected) {
if (typeof func !== "function") {
throw new TypeError(expected + " is not a function");
}
};
var noop = function () {
};
var catchRejection = function (promise2, onError) {
if (onError === void 0) { onError = noop; }
promise2.catch(onError);
return promise2;
};
var addAbortSignalListener = function (abortSignal, callback) {
abortSignal.addEventListener("abort", callback, { once: true });
return function () { return abortSignal.removeEventListener("abort", callback); };
};
var abortControllerWithReason = function (abortController, reason) {
var signal = abortController.signal;
if (signal.aborted) {
return;
}
if (!("reason" in signal)) {
Object.defineProperty(signal, "reason", {
enumerable: true,
value: reason,
configurable: true,
writable: true
});
}
;
abortController.abort(reason);
};
// src/listenerMiddleware/exceptions.ts
var task = "task";
var listener = "listener";
var completed = "completed";
var cancelled = "cancelled";
var taskCancelled = "task-" + cancelled;
var taskCompleted = "task-" + completed;
var listenerCancelled = listener + "-" + cancelled;
var listenerCompleted = listener + "-" + completed;
var TaskAbortError = /** @class */ (function () {
function TaskAbortError(code) {
this.code = code;
this.name = "TaskAbortError";
this.message = task + " " + cancelled + " (reason: " + code + ")";
}
return TaskAbortError;
}());
// src/listenerMiddleware/task.ts
var validateActive = function (signal) {
if (signal.aborted) {
throw new TaskAbortError(signal.reason);
}
};
function raceWithSignal(signal, promise2) {
var cleanup = noop;
return new Promise(function (resolve, reject) {
var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };
if (signal.aborted) {
notifyRejection();
return;
}
cleanup = addAbortSignalListener(signal, notifyRejection);
promise2.finally(function () { return cleanup(); }).then(resolve, reject);
}).finally(function () {
cleanup = noop;
});
}
var runTask = function (task2, cleanUp) { return __async(void 0, null, function () {
var value, error_1;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_c.trys.push([0, 3, 4, 5]);
return [4 /*yield*/, Promise.resolve()];
case 1:
_c.sent();
return [4 /*yield*/, task2()];
case 2:
value = _c.sent();
return [2 /*return*/, {
status: "ok",
value: value
}];
case 3:
error_1 = _c.sent();
return [2 /*return*/, {
status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected",
error: error_1
}];
case 4:
cleanUp == null ? void 0 : cleanUp();
return [7 /*endfinally*/];
case 5: return [2 /*return*/];
}
});
}); };
var createPause = function (signal) {
return function (promise2) {
return catchRejection(raceWithSignal(signal, promise2).then(function (output) {
validateActive(signal);
return output;
}));
};
};
var createDelay = function (signal) {
var pause = createPause(signal);
return function (timeoutMs) {
return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));
};
};
// src/listenerMiddleware/index.ts
var assign = Object.assign;
var INTERNAL_NIL_TOKEN = {};
var alm = "listenerMiddleware";
var createFork = function (parentAbortSignal) {
var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };
return function (taskExecutor) {
assertFunction(taskExecutor, "taskExecutor");
var childAbortController = new AbortController();
linkControllers(childAbortController);
var result = runTask(function () { return __async(void 0, null, function () {
var result2;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
validateActive(parentAbortSignal);
validateActive(childAbortController.signal);
return [4 /*yield*/, taskExecutor({
pause: createPause(childAbortController.signal),
delay: createDelay(childAbortController.signal),
signal: childAbortController.signal
})];
case 1:
result2 = _c.sent();
validateActive(childAbortController.signal);
return [2 /*return*/, result2];
}
});
}); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });
return {
result: createPause(parentAbortSignal)(result),
cancel: function () {
abortControllerWithReason(childAbortController, taskCancelled);
}
};
};
};
var createTakePattern = function (startListening, signal) {
var take = function (predicate, timeout) { return __async(void 0, null, function () {
var unsubscribe, tuplePromise, promises, output;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
validateActive(signal);
unsubscribe = function () {
};
tuplePromise = new Promise(function (resolve, reject) {
var stopListening = startListening({
predicate: predicate,
effect: function (action, listenerApi) {
listenerApi.unsubscribe();
resolve([
action,
listenerApi.getState(),
listenerApi.getOriginalState()
]);
}
});
unsubscribe = function () {
stopListening();
reject();
};
});
promises = [
tuplePromise
];
if (timeout != null) {
promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));
}
_c.label = 1;
case 1:
_c.trys.push([1, , 3, 4]);
return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))];
case 2:
output = _c.sent();
validateActive(signal);
return [2 /*return*/, output];
case 3:
unsubscribe();
return [7 /*endfinally*/];
case 4: return [2 /*return*/];
}
});
}); };
return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };
};
var getListenerEntryPropsFrom = function (options) {
var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;
if (type) {
predicate = createAction(type).match;
}
else if (actionCreator) {
type = actionCreator.type;
predicate = actionCreator.match;
}
else if (matcher) {
predicate = matcher;
}
else if (predicate) {
}
else {
throw new Error("Creating or removing a listener requires one of the known fields for matching an action");
}
assertFunction(effect, "options.listener");
return { predicate: predicate, type: type, effect: effect };
};
var createListenerEntry = function (options) {
var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;
var id = nanoid();
var entry = {
id: id,
effect: effect,
type: type,
predicate: predicate,
pending: new Set(),
unsubscribe: function () {
throw new Error("Unsubscribe not initialized");
}
};
return entry;
};
var cancelActiveListeners = function (entry) {
entry.pending.forEach(function (controller) {
abortControllerWithReason(controller, listenerCancelled);
});
};
var createClearListenerMiddleware = function (listenerMap) {
return function () {
listenerMap.forEach(cancelActiveListeners);
listenerMap.clear();
};
};
var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {
try {
errorHandler(errorToNotify, errorInfo);
}
catch (errorHandlerError) {
setTimeout(function () {
throw errorHandlerError;
}, 0);
}
};
var addListener = createAction(alm + "/add");
var clearAllListeners = createAction(alm + "/removeAll");
var removeListener = createAction(alm + "/remove");
var defaultErrorHandler = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
console.error.apply(console, __spreadArray([alm + "/error"], args));
};
function createListenerMiddleware(middlewareOptions) {
var _this = this;
if (middlewareOptions === void 0) { middlewareOptions = {}; }
var listenerMap = new Map();
var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;
assertFunction(onError, "onError");
var insertEntry = function (entry) {
entry.unsubscribe = function () { return listenerMap.delete(entry.id); };
listenerMap.set(entry.id, entry);
return function (cancelOptions) {
entry.unsubscribe();
if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
cancelActiveListeners(entry);
}
};
};
var findListenerEntry = function (comparator) {
for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {
var entry = _c[_i];
if (comparator(entry)) {
return entry;
}
}
return void 0;
};
var startListening = function (options) {
var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });
if (!entry) {
entry = createListenerEntry(options);
}
return insertEntry(entry);
};
var stopListening = function (options) {
var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;
var entry = findListenerEntry(function (entry2) {
var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate;
return matchPredicateOrType && entry2.effect === effect;
});
if (entry) {
entry.unsubscribe();
if (options.cancelActive) {
cancelActiveListeners(entry);
}
}
return !!entry;
};
var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {
var internalTaskController, take, listenerError_1;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
internalTaskController = new AbortController();
take = createTakePattern(startListening, internalTaskController.signal);
_c.label = 1;
case 1:
_c.trys.push([1, 3, 4, 5]);
entry.pending.add(internalTaskController);
return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {
getOriginalState: getOriginalState,
condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },
take: take,
delay: createDelay(internalTaskController.signal),
pause: createPause(internalTaskController.signal),
extra: extra,
signal: internalTaskController.signal,
fork: createFork(internalTaskController.signal),
unsubscribe: entry.unsubscribe,
subscribe: function () {
listenerMap.set(entry.id, entry);
},
cancelActiveListeners: function () {
entry.pending.forEach(function (controller, _, set) {
if (controller !== internalTaskController) {
abortControllerWithReason(controller, listenerCancelled);
set.delete(controller);
}
});
}
})))];
case 2:
_c.sent();
return [3 /*break*/, 5];
case 3:
listenerError_1 = _c.sent();
if (!(listenerError_1 instanceof TaskAbortError)) {
safelyNotifyError(onError, listenerError_1, {
raisedBy: "effect"
});
}
return [3 /*break*/, 5];
case 4:
abortControllerWithReason(internalTaskController, listenerCompleted);
entry.pending.delete(internalTaskController);
return [7 /*endfinally*/];
case 5: return [2 /*return*/];
}
});
}); };
var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
var middleware = function (api) { return function (next) { return function (action) {
if (!isAction(action)) {
return next(action);
}
if (addListener.match(action)) {
return startListening(action.payload);
}
if (clearAllListeners.match(action)) {
clearListenerMiddleware();
return;
}
if (removeListener.match(action)) {
return stopListening(action.payload);
}
var originalState = api.getState();
var getOriginalState = function () {
if (originalState === INTERNAL_NIL_TOKEN) {
throw new Error(alm + ": getOriginalState can only be called synchronously");
}
return originalState;
};
var result;
try {
result = next(action);
if (listenerMap.size > 0) {
var currentState = api.getState();
var listenerEntries = Array.from(listenerMap.values());
for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {
var entry = listenerEntries_1[_i];
var runListener = false;
try {
runListener = entry.predicate(action, currentState, originalState);
}
catch (predicateError) {
runListener = false;
safelyNotifyError(onError, predicateError, {
raisedBy: "predicate"
});
}
if (!runListener) {
continue;
}
notifyListener(entry, action, api, getOriginalState);
}
}
}
finally {
originalState = INTERNAL_NIL_TOKEN;
}
return result;
}; }; };
return {
middleware: middleware,
startListening: startListening,
stopListening: stopListening,
clearListeners: clearListenerMiddleware
};
}
// src/autoBatchEnhancer.ts
var SHOULD_AUTOBATCH = "RTK_autoBatch";
var prepareAutoBatched = function () { return function (payload) {
var _c;
return ({
payload: payload,
meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)
});
}; };
var promise;
var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () {
throw err;
}, 0); }); };
var createQueueWithTimer = function (timeout) {
return function (notify) {
setTimeout(notify, timeout);
};
};
var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);
var autoBatchEnhancer = function (options) {
if (options === void 0) { options = { type: "raf" }; }
return function (next) { return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var store = next.apply(void 0, args);
var notifying = true;
var shouldNotifyAtEndOfTick = false;
var notificationQueued = false;
var listeners = new Set();
var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
var notifyListeners = function () {
notificationQueued = false;
if (shouldNotifyAtEndOfTick) {
shouldNotifyAtEndOfTick = false;
listeners.forEach(function (l) { return l(); });
}
};
return Object.assign({}, store, {
subscribe: function (listener2) {
var wrappedListener = function () { return notifying && listener2(); };
var unsubscribe = store.subscribe(wrappedListener);
listeners.add(listener2);
return function () {
unsubscribe();
listeners.delete(listener2);
};
},
dispatch: function (action) {
var _a;
try {
notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);
shouldNotifyAtEndOfTick = !notifying;
if (shouldNotifyAtEndOfTick) {
if (!notificationQueued) {
notificationQueued = true;
queueCallback(notifyListeners);
}
}
return store.dispatch(action);
}
finally {
notifying = true;
}
}
});
}; };
};
// src/index.ts
enableES5();
export { EnhancerArray, MiddlewareArray, SHOULD_AUTOBATCH, TaskAbortError, addListener, autoBatchEnhancer, clearAllListeners, configureStore, createAction, createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createImmutableStateInvariantMiddleware, createListenerMiddleware, default2 as createNextState, createReducer, createSelector2 as createSelector, createSerializableStateInvariantMiddleware, createSlice, current2 as current, findNonSerializableValue, freeze, getDefaultMiddleware, getType, isAction, isAllOf, isAnyOf, isAsyncThunkAction, isDraft4 as isDraft, isFSA as isFluxStandardAction, isFulfilled, isImmutableDefault, isPending, isPlain, isPlainObject, isRejected, isRejectedWithValue, miniSerializeError, nanoid, original, prepareAutoBatched, removeListener, unwrapResult };
//# sourceMappingURL=redux-toolkit.esm.js.map
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/redux/slices/talentSlice.ts
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { Talent } from "@tvg/ts-types/Talent";
export type State = {
selectedTalent: Talent | null;
};
export const initialState: State = {
selectedTalent: null
};
const talentSlice = createSlice({
name: "talent",
initialState,
reducers: {
setSelectedTalent(state, action: PayloadAction<Talent | null>) {
state.selectedTalent = action.payload;
}
}
});
export const { setSelectedTalent } = talentSlice.actions;
export default talentSlice.reducer;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/components/TalentPicksCard/index.tsx
import React from "react";
import { useSelector } from "react-redux";
import { useLocation } from "react-router";
import { useNavigate } from "react-router-dom";
import { get, isEmpty, startCase } from "lodash";
import { TalentPickData } from "@tvg/ts-types/TalentPicks";
import { UnaryFn } from "@tvg/ts-types/Functional";
import buildRaceUrl, { buildTalentPicksTVG5Url } from "@tvg/formatter/url";
import { WagerTypeCodesInvertedEnum } from "@tvg/ts-types/Wager";
import { AccountRolesEnum } from "@tvg/ts-types/Account";
import formatCurrency from "@tvg/formatter/currency";
import { RaceStatusEnum } from "@tvg/ts-types/Race";
import { getAccountNumber } from "@urp/store-selectors";
import {
EVENTS,
LINK_TEXT
} from "@urp/amplitude/src/modules/talentPicks/constants";
import {
Avatar,
BodyText,
Box,
Button,
Flex,
Switch
} from "@fanduel/formation-react-components";
import BetSummary from "./BetSummary";
import {
CardWrapper,
CardHeader,
ActionsWrapper,
AmountContainer
} from "./styled-components";
import MtpBody from "./MtpBody";
import { isFdr } from "../../helpers";
import { triggerAmplitudeEvent, getModule } from "../../utils/amplitude";
import { useUpdateTalentPick } from "../../hooks";
import { BASE_QA_LABEL } from "../../constants";
import { userRoles } from "../../redux/selectors";
interface Props {
talentPick: TalentPickData;
cardPosition: number;
showRaceSummaryInfo?: boolean;
showViewRaceButton?: boolean;
showAddToBetslipButton?: boolean;
qaLabel?: string;
onAddToBetslip?: UnaryFn<TalentPickData, void>;
numWagerableRunners?: string[];
onHomePage?: boolean;
isFDTVPage?: boolean;
canCreatePicks?: boolean;
width?: string;
}
const TalentPicksCard = ({
talentPick,
cardPosition,
showAddToBetslipButton = true,
showViewRaceButton = true,
showRaceSummaryInfo = true,
qaLabel = "talentPick-card",
onAddToBetslip,
numWagerableRunners,
onHomePage = false,
isFDTVPage = false,
canCreatePicks = false,
width
}: Props) => {
const navigate = useNavigate();
const location = useLocation();
const { pathname, search } = location;
const params = new URLSearchParams(search);
const source = Number(params.get("race"));
const accountNumber = useSelector(getAccountNumber);
const accountRoles = useSelector(userRoles);
const {
talent,
track: trackCode,
race: raceNumber,
trackName,
amount: wagerAmount,
price: betTotal,
wagerType,
visualSelections,
numRunnersAllRaces,
published
} = talentPick;
const { name: talentName, pictureUrl: talentPicture } = talent;
const {
abbreviation: wagerTypeCode,
isKey,
isBox,
legCount,
isWheel
} = wagerType;
const isFDR = isFdr();
const raceURL = buildRaceUrl(trackCode, trackName, raceNumber);
const switchRef = React.useRef<HTMLDivElement | null>(null);
const { updateTalentPick, isLoadingPickEdit, isPublishedSwitchOn } =
useUpdateTalentPick(published);
const isCardDisabled =
canCreatePicks && (!isPublishedSwitchOn || isLoadingPickEdit);
const module = getModule(pathname);
const amplitudePayload = {
module,
talentName,
trackName,
raceNumber,
wagerTypeCode,
cardPosition,
selectionSource: module
};
const handleViewRace = () => {
triggerAmplitudeEvent(EVENTS.CARD_CLICKED, {
...amplitudePayload,
raceURL,
linkText: LINK_TEXT.VIEW_RACE
});
navigate(buildRaceUrl(trackCode, trackName, raceNumber));
};
const handleAddToBetslip = () => {
triggerAmplitudeEvent(EVENTS.ADD_TO_BETSLIP, {
...amplitudePayload,
module: "Race Card",
betTotal
});
triggerAmplitudeEvent(EVENTS.CARD_CLICKED, {
...amplitudePayload,
raceURL,
linkText: LINK_TEXT.ADD_TO_BETSLIP
});
if (onAddToBetslip) {
onAddToBetslip(talentPick);
if (source !== raceNumber) {
navigate(buildTalentPicksTVG5Url(talentPick));
}
} else {
navigate(buildTalentPicksTVG5Url(talentPick));
}
};
const handleOnCardHeaderClick = (e: React.MouseEvent<HTMLDivElement>) => {
if (!(switchRef.current && switchRef.current.contains(e.target as Node))) {
navigate(raceURL);
triggerAmplitudeEvent(EVENTS.CARD_CLICKED, {
...amplitudePayload,
raceURL,
linkText: LINK_TEXT.TALENT_NAME
});
}
};
const handleOnSwitchChange = () => {
const updatedTalentPick = {
...talentPick,
published: !isPublishedSwitchOn,
// BE expects favorites to be an array of arrays, never an empty array
favorites: isEmpty(talentPick.favorites) ? [[]] : talentPick.favorites
};
updateTalentPick(updatedTalentPick);
};
const rawWagerType = get(WagerTypeCodesInvertedEnum, wagerTypeCode);
const wagerTypeName = rawWagerType
? startCase(rawWagerType.replace("_", " ").toLowerCase())
: "";
const isAccountTalent =
!accountRoles.includes(AccountRolesEnum.WAGEROPS) &&
accountRoles.includes(AccountRolesEnum.TALENT);
const shouldShowPublishSwitch =
canCreatePicks &&
(accountRoles.includes(AccountRolesEnum.WAGEROPS) ||
(isAccountTalent && talent.tvgAccountId === accountNumber)) &&
talentPick.raceStatus !== RaceStatusEnum.RACE_OFFICIAL &&
talentPick.raceStatus !== RaceStatusEnum.RACE_OFF;
return (
<CardWrapper
className="tpWrapper"
data-qa-label={qaLabel}
isOnHomePage={onHomePage}
isFDR={isFDR}
width={width}
>
<CardHeader
isOnHomePage={onHomePage}
onClick={handleOnCardHeaderClick}
isFDTVPage={isFDTVPage}
>
<Box
borderRadius="50%"
overflow="hidden"
opacity={isCardDisabled ? 0.5 : 1}
marginRight="space2"
>
<Avatar
alt={`${talentName} Avatar`}
src={talentPicture}
size={40}
data-qa-label={`${BASE_QA_LABEL}-talent-avatar`}
/>
</Box>
{showRaceSummaryInfo && (
<Flex
data-qa-label={`${BASE_QA_LABEL}-race-summary-info`}
flex={1}
justifyContent="space-between"
marginLeft="space3"
>
<Flex direction="column" justifyContent="center">
<BodyText
fontWeight="var(--fd-font-weights-font-weight-030)"
data-qa-label={`${BASE_QA_LABEL}-talent-name`}
color={
isCardDisabled
? "var(--fd-colors-content-disabled)"
: "var(--fd-colors-content-default)"
}
>
{talentName}
</BodyText>
<Flex justifyContent="flex-start" alignItems="flex-start">
<AmountContainer>
<BodyText
data-qa-label={`${BASE_QA_LABEL}-bet-amount-n-type`}
color={
isCardDisabled
? "var(--fd-colors-content-disabled)"
: "var(--fd-colors-content-subtle)"
}
fontWeight="var(--fd-font-weights-font-weight-020)"
marginRight="space1"
>{`${formatCurrency(
+wagerAmount
)} ${wagerTypeCode}`}</BodyText>
</AmountContainer>
<AmountContainer>
<BodyText
data-qa-label={`${BASE_QA_LABEL}-bet-total-n-type`}
color={
isCardDisabled
? "var(--fd-colors-content-disabled)"
: "var(--fd-colors-content-subtle)"
}
fontWeight="var(--fd-font-weights-font-weight-020)"
marginLeft="space1"
>
{`${formatCurrency(+betTotal)} Ticket`}
</BodyText>
</AmountContainer>
</Flex>
</Flex>
</Flex>
)}
{shouldShowPublishSwitch && (
<Switch
ref={switchRef}
data-qa-label={`${BASE_QA_LABEL}-pick-publish-switch`}
label="Hidden Label"
on={isPublishedSwitchOn}
disabled={isLoadingPickEdit}
labelPosition="hidden"
onChange={handleOnSwitchChange}
/>
)}
</CardHeader>
<Box
maxHeight={showAddToBetslipButton ? "150px" : "220px"}
overflow="auto"
marginRight="space4"
>
<MtpBody qaLabel="tp-body-mtp" talentPick={talentPick} />
<BetSummary
wagerAmount={wagerAmount}
betTotal={betTotal}
selections={visualSelections || []}
wagerTypeCode={wagerTypeCode}
wagerTypeName={wagerTypeName}
isKey={isKey}
isBox={isBox}
isWheel={isWheel}
legCount={legCount}
numWagerableRunners={numRunnersAllRaces || numWagerableRunners}
raceNumber={raceNumber?.toString()}
onHandicaping
/>
</Box>
<ActionsWrapper isOnHomePage={onHomePage}>
{showViewRaceButton && (
<Flex width={onHomePage ? "35%" : "auto"}>
<Button
data-qa-label={`${BASE_QA_LABEL}-view-race-button`}
variant="tertiary"
label="View Race"
onClick={handleViewRace}
disabled={isCardDisabled}
fill
/>
</Flex>
)}
{showAddToBetslipButton && (
<Flex width={onHomePage ? "62%" : "auto"}>
<Button
data-qa-label={`${BASE_QA_LABEL}-add-to-betslip-button`}
variant="primary"
label="Add to Betslip"
onClick={handleAddToBetslip}
disabled={isCardDisabled}
fill
/>
</Flex>
)}
</ActionsWrapper>
</CardWrapper>
);
};
export default TalentPicksCard;
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/helpers.ts
import { TalentPickData } from "@tvg/ts-types/TalentPicks";
import { RaceStatusEnum } from "@tvg/ts-types/Race";
import tvgConf from "@tvg/conf";
import {
EVENTS,
FILTER
} from "@urp/amplitude/src/modules/talentPicks/constants";
import { FilterOption, TalentFilter } from "./types";
import { triggerAmplitudeEvent } from "./utils/amplitude";
export const onFilterHandler =
(
options: Array<FilterOption>,
setSelectedOption: (selected: FilterOption) => void
) =>
(selectValue: string) => {
const optionSelected = options.find(
(option) => option.value === selectValue
);
if (optionSelected) setSelectedOption(optionSelected);
triggerAmplitudeEvent(EVENTS.FILTERS_APPLIED, {
filterName:
options?.[0]?.label === "All Tracks" ? FILTER.TRACK : FILTER.TALENT,
filterLabel: optionSelected ? optionSelected.label : ""
});
};
export const onTalentsFilterHandler =
(
talents: Array<TalentFilter>,
talentsFilter: Array<TalentFilter>,
setSelectedOption: (selected: TalentFilter[]) => void
) =>
(selectValue: string): void => {
const optionSelected = talents.find(
(talent) => talent.value === selectValue
);
if (!optionSelected || optionSelected?.value === "") {
setSelectedOption([]);
} else {
const existOption = talentsFilter.find(
(talent) => talent.value === optionSelected.value
);
if (existOption) {
setSelectedOption(
talentsFilter.filter(
(talent) => talent.value !== optionSelected.value
)
);
} else {
setSelectedOption([...talentsFilter, optionSelected]);
}
}
};
export const filterTalentPicks = (
talentPicksList: Array<TalentPickData>,
trackCode: string,
expertId: string
) =>
(talentPicksList || []).filter(
(talentPick: TalentPickData) =>
(!trackCode || talentPick.track === trackCode) &&
(!expertId || talentPick.talent.talentId === expertId)
);
export const filterTalentPicksByTalents = (
talentPicksList: Array<TalentPickData>,
talents: Array<TalentFilter>,
blacklistedBets: string[]
) =>
(talentPicksList || []).filter((talentPick: TalentPickData) => {
if (blacklistedBets?.includes(talentPick.wagerType.abbreviation)) {
return false;
}
const found = talents.find(
(talent) => talent.value === talentPick.talent.talentId
);
return talents.length === 0 || Boolean(found);
});
export const getTalentPicksGroups = (
talentPicksList: Array<TalentPickData>,
onHomePage?: boolean
): {
talentPicksActive: Array<TalentPickData>;
talentPicksResulted: Array<TalentPickData>;
} =>
talentPicksList.reduce(
(
groups: {
talentPicksActive: Array<TalentPickData>;
talentPicksResulted: Array<TalentPickData>;
},
talentPick: TalentPickData
) =>
[
RaceStatusEnum.OPEN,
RaceStatusEnum.UP_NEXT,
!onHomePage ? RaceStatusEnum.RACE_OFF : null
]
.filter((val) => val)
.includes(talentPick.raceStatus)
? {
talentPicksActive: [...groups.talentPicksActive, talentPick],
talentPicksResulted: groups.talentPicksResulted
}
: {
talentPicksActive: groups.talentPicksActive,
talentPicksResulted: [...groups.talentPicksResulted, talentPick]
},
{ talentPicksActive: [], talentPicksResulted: [] }
);
export const filterTalentPicksByBetTypes = (
talentPicks: Array<TalentPickData>,
blacklistedBets: string[]
): Array<TalentPickData> =>
talentPicks.filter(
(talentPick: TalentPickData) =>
!blacklistedBets?.includes(talentPick.wagerType.abbreviation)
) || [];
export const isFdr = () => tvgConf().brand === "fdr";
webpack://frontend-tpt/../../packages/urp-comp-talent-picks/src/hooks/useUpdateTalentPick.ts
import { useState, useCallback } from "react";
import { v4 as uuid } from "uuid";
import tpm from "@tvg/api/tpm";
import { TalentPickData } from "@tvg/ts-types/TalentPicks";
import { useDispatch, useSelector } from "react-redux";
import { addToast, removeToast } from "@tvg/toast-manager/src/store/actions";
import { get } from "lodash";
import {
getTalentPicksErrorCodes,
getTalentPicksPageMsgs
} from "../redux/selectors";
import { TpmError } from "../types";
export const useUpdateTalentPick = (published: boolean) => {
const dispatch = useDispatch();
const [isLoadingPickEdit, setIsLoadingPickEdit] = useState(false);
const [isPublishedSwitchOn, setIsPublishedSwitchOn] = useState(published);
const talentPicksErrorCodes = useSelector(getTalentPicksErrorCodes);
const talentPicksPageMsgs = useSelector(getTalentPicksPageMsgs);
const updateTalentPick = useCallback(
async (updatedTalentPick: TalentPickData) => {
const toastId = uuid();
try {
setIsLoadingPickEdit(true);
await tpm.updateTalentPick(updatedTalentPick);
setIsPublishedSwitchOn(updatedTalentPick.published);
dispatch(
addToast({
id: toastId,
variant: "informational",
message:
talentPicksPageMsgs.tool?.confirmModal?.syncToastText ?? "",
qaLabel: "talent-pick-sync-toast",
hasDismissButton: true,
onHide: () => dispatch(removeToast(toastId)),
onDismissPress: () => dispatch(removeToast(toastId))
})
);
} catch (error) {
setIsPublishedSwitchOn(!updatedTalentPick.published);
console.error("Error updating talent pick:", error);
const err = error as TpmError;
const code = err.response?.data?.code;
const message =
(code && get(talentPicksErrorCodes, `${code}`, undefined)) ||
"An unexpected error occurred while updating the talent pick.";
dispatch(
addToast({
id: toastId,
variant: "error",
message,
qaLabel: "update-talent-pick-error-toast",
onHide: () => dispatch(removeToast(toastId))
})
);
} finally {
setIsLoadingPickEdit(false);
}
},
[dispatch, talentPicksErrorCodes]
);
return {
updateTalentPick,
isLoadingPickEdit,
isPublishedSwitchOn
};
};
export default useUpdateTalentPick;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/LiveButtonsGroup/styled-components.js
import styled from "styled-components";
import { Link } from "react-router-dom";
import buildColor from "../../_static/ColorPalette";
export const TvgLiveLink = styled(Link)`
height: 100%;
width: 100%;
background-color: #2a4259;
color: ${buildColor("white", "100")};
border-radius: 2px;
outline: none;
flex-grow: 1;
text-decoration: none;
font-size: 11px;
font-weight: bold;
&:not(:first-child) {
margin-left: 10px;
}
/* only add hover state for fine pointers, meaning that only on desktops using a mouse the hover state will work */
@media (pointer: fine) {
&:hover {
background-color: ${buildColor("green", "500")};
}
}
&:active {
background-color: ${buildColor("green", "700")};
/* on touch devices (coarse), the active color should be the hover spec according to the style guide on zeplin */
@media (pointer: coarse) {
background-color: ${buildColor("green", "500")};
}
}
`;
export const ButtonContainer = styled.div`
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
align-items: center;
justify-content: space-between;
& > svg {
flex-grow: 1;
}
`;
export const LogoContainer = styled.div`
height: 144px;
padding: 20px;
`;
export const WatchLiveLabel = styled.div`
background: #122b43;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 32px;
& > svg {
padding-left: 10px;
width: 13px;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/SvgImages/ArrowRight.jsx
import React from "react";
const ArrowRightSVG = () => (
<svg
width="14"
height="12"
viewBox="0 0 14 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M10.6893 6.74999H0.5C0.223858 6.74999 0 6.52613 0 6.24999V5.74999C0 5.47384 0.223858 5.24999 0.5 5.24999H10.6893L7.32322 1.88386C7.12796 1.6886 7.12796 1.37202 7.32322 1.17676L7.67677 0.823205C7.87203 0.627942 8.18862 0.627942 8.38388 0.823204L13.0303 5.46965C13.3232 5.76254 13.3232 6.23742 13.0303 6.53031L8.38388 11.1768C8.18862 11.372 7.87203 11.372 7.67677 11.1768L7.32322 10.8232C7.12796 10.6279 7.12796 10.3114 7.32322 10.1161L10.6893 6.74999Z"
fill="white"
/>
</svg>
);
export default ArrowRightSVG;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/LiveButtonsGroup/index.jsx
import React, { PureComponent, Fragment } from "react";
import {
WatchLiveLabel,
ButtonContainer,
LogoContainer,
TvgLiveLink
} from "./styled-components";
import ArrowRightSVG from "../../_static/SvgImages/ArrowRight";
import { LogoFanduelTV, LogoFanduelRacing } from "../../_static/Logos";
export default class LiveButtonsGroup extends PureComponent {
static defaultProps = {
className: "",
tvg1Link: null,
tvg2Link: null
};
renderMainBlock = () => (
<Fragment>
{this.props.tvg1Link && (
<TvgLiveLink to={this.props.tvg1Link} data-qa-label="tvg-live-channel1">
<ButtonContainer>
<LogoContainer>
<LogoFanduelTV />
</LogoContainer>
<WatchLiveLabel>
Watch Live <ArrowRightSVG />
</WatchLiveLabel>
</ButtonContainer>
</TvgLiveLink>
)}
{this.props.tvg2Link && (
<TvgLiveLink to={this.props.tvg2Link} data-qa-label="tvg-live-channel2">
<ButtonContainer>
<LogoContainer>
<LogoFanduelRacing />
</LogoContainer>
<WatchLiveLabel>
Watch Live <ArrowRightSVG />
</WatchLiveLabel>
</ButtonContainer>
</TvgLiveLink>
)}
</Fragment>
);
render() {
return this.props.className ? (
<div className={this.props.className}>{this.renderMainBlock()}</div>
) : (
this.renderMainBlock()
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Toggle/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
export const Switch = styled.label`
width: 46px;
height: 24px;
background-color: ${(props) =>
props.$on ? buildColor("blue_accent", "500") : buildColor("grey", "300")};
border-radius: 12px;
display: flex;
padding: 3px;
position: relative;
cursor: pointer;
transition: background-color ease 0.3s;
> input {
display: none;
}
&::before {
${(props) =>
props.$on
? css`
left: 0;
content: "ON";
padding: 3px 5px;
`
: css`
right: 0;
content: "OFF";
padding: 3px;
`};
color: ${buildColor("white", "100")};
font-size: 10px;
font-weight: bold;
position: absolute;
}
`;
export const Slider = styled.span`
width: 18px;
height: 18px;
background-color: ${buildColor("white", "100")};
border-radius: 50%;
position: absolute;
transition: left ease 0.3s;
left: ${(props) => (props.$on ? "25px" : "3px")};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Toggle/index.jsx
import React, { Component } from "react";
import { noop, bindAll } from "lodash";
import { Switch, Slider } from "./styled-components";
export default class Toggle extends Component {
static defaultProps = {
on: false,
onClick: noop,
qaLabel: ""
};
constructor(props) {
super(props);
bindAll(this, ["clickToggle"]);
}
clickToggle(evt) {
evt.stopPropagation();
evt.preventDefault();
this.props.onClick();
}
render() {
return (
<Switch $on={this.props.on} onClick={this.clickToggle}>
<input
type="checkbox"
{...(this.props.qaLabel !== ""
? {
"data-qa-label": this.props.qaLabel
}
: {})}
data-qa-active={this.props.on}
/>
<Slider $on={this.props.on} />
</Switch>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TalentPickCardHeader/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import MTP from "../../_atom/MTP";
import buildColor from "../../_static/ColorPalette";
import { fontMedium, fontNormal } from "../../_static/Typography";
const linkStyle = css`
position: relative;
display: flex;
width: 100%;
height: 56px;
padding: 11px;
text-decoration: none;
background-color: ${buildColor("blue_accent", "000")};
border-radius: 4px;
&:hover {
background-color: ${buildColor("blue_accent", "100")};
}
`;
export const MobileLink = styled(Link)`
${linkStyle};
`;
export const DesktopLink = styled(Link)`
${linkStyle};
cursor: pointer;
`;
export const RaceMTP = styled(MTP)`
flex: 0 0 44px;
`;
export const Header = styled.header`
position: relative;
`;
export const InfoWrapper = styled.div`
flex: 1 1 auto;
overflow: hidden;
padding: 0 ${(props) => (props.isPictureShown ? "80px" : 0)} 0 8px;
display: flex;
flex-flow: column nowrap;
justify-content: space-between;
`;
export const Image = styled.img`
width: 72px;
height: auto;
position: absolute;
right: 12px;
bottom: 0;
`;
export const TrackRace = styled.div`
display: flex;
flex-flow: row nowrap;
font-weight: 500;
font-size: 14px;
color: ${buildColor("grey", "900")};
${(props) =>
props.isFeatured &&
css`
color: ${buildColor("blue", "500")};
`}
`;
export const Track = styled.span`
font-family: ${fontMedium};
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;
export const Race = styled.span`
font-family: ${fontMedium};
text-transform: uppercase;
margin-left: 4px;
flex: 0 0 auto;
`;
export const Talent = styled.span`
font-size: 14px;
font-family: ${fontNormal};
color: ${buildColor("grey", "800")};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TalentPickCardHeader/index.jsx
import React, { Component, Fragment } from "react";
import { noop } from "lodash";
import { isTvg5 } from "@tvg/utils/generalUtils";
import tvgConf from "@tvg/conf";
import {
Header,
Image,
MobileLink,
DesktopLink,
RaceMTP,
InfoWrapper,
Talent,
TrackRace,
Track,
Race
} from "./styled-components";
export default class TalentPickCardHeader extends Component {
static defaultProps = {
talentId: "",
name: "",
pictureUrl: "",
popularity: 0,
tvgAccountId: "",
phrases: [],
imageBaseURL: "//www.tvg.com",
isDesktop: false,
mtp: 0,
postTime: "",
status: "",
isFeatured: false,
featuredText: "",
trackName: "",
trackCode: "",
race: 0,
onClick: noop,
raceUrl: ""
};
renderContent = () => (
<Fragment>
<RaceMTP
isPlainMTP
mtp={this.props.mtp}
postTime={this.props.postTime}
status={this.props.status}
/>
<InfoWrapper isPictureShown={!!this.props.pictureUrl}>
<TrackRace isFeatured={this.props.isFeatured} data-qa-label="trackRace">
<Track>
{this.props.isFeatured
? this.props.featuredText
: this.props.trackName}
</Track>
<Race>
{this.props.isFeatured && `- ${this.props.trackCode} `}
{`R${this.props.race}`}
</Race>
</TrackRace>
<Talent data-qa-label="talentName">{this.props.name}</Talent>
</InfoWrapper>
{!!this.props.pictureUrl &&
!this.props.pictureUrl.includes("tvgpicks_placeholder") &&
!this.props.pictureUrl.includes("test_talent") && (
<Image
data-qa-label="image"
src={`${this.props.imageBaseURL}/${this.props.pictureUrl}`}
alt={this.props.name}
/>
)}
</Fragment>
);
render() {
const [pathname, search] = (this.props.raceUrl || "").split("?");
const costumLinkProps =
this.props.isDesktop && isTvg5()
? { to: { pathname, search } }
: { as: "a", href: this.props.raceUrl };
return (
<Header data-qa-label="header">
{this.props.isDesktop ? (
<DesktopLink
{...costumLinkProps}
data-qa-label="link"
onClick={(event) => {
if (!isTvg5()) {
event.preventDefault();
this.props.onClick();
}
}}
>
{this.renderContent()}
</DesktopLink>
) : (
<MobileLink
data-qa-label="link"
to={this.props.raceUrl}
onClick={() => {
this.props.onClick();
}}
>
{this.renderContent()}
</MobileLink>
)}
</Header>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/RunnerNumber/styled-components.js
import styled, { css } from "styled-components";
import Icon from "../../_static/Icons";
import { generateTransition, cubic } from "../../_static/Transitions";
import { fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const StarIcon = styled(Icon)`
position: absolute;
${({ isBetsStandalone }) =>
isBetsStandalone
? css`
top: -5px;
left: -5px;
`
: css`
top: -4px;
right: -2px;
`}
`;
export const SelectIcon = styled(Icon)`
transform: ${(props) =>
props.isRotated ? "rotate(180deg)" : "rotate(0deg)"};
will-change: transform;
transition: ${generateTransition(cubic, "transform")};
`;
export const WinnerIconWrapper = styled.div`
position: absolute;
bottom: -4px;
right: -4px;
width: 12px;
height: 12px;
background: ${buildColor("green", "500")};
border-radius: 50%;
border: 1px solid ${buildColor("green", "000")};
z-index: 2;
`;
export const WinnerIcon = styled(Icon)`
position: absolute;
top: 1px;
left: 1px;
`;
const sharedScratchedStyles = css`
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
`;
export const RunnerNumberAtom = styled.span`
font-size: 12px;
color: ${(props) => props.numberColor};
position: relative;
text-shadow: ${(props) => props.textShadow};
background: ${(props) => props.gradient};
border: ${(props) => props.border};
display: flex;
align-items: center;
justify-content: center;
background-color: ${(props) => props.saddleColor};
flex-direction: ${(props) => props.flexDirection};
font-family: ${fontMedium};
border-radius: 1px;
${({
isBetsStandalone,
isActiveMultiRaceLegOver,
isWinnerBI,
isRaceOver,
isScratched,
isBetsDetailedView,
isAllRunners
}) =>
(isBetsStandalone && isActiveMultiRaceLegOver && !isWinnerBI) ||
(isBetsStandalone && !isRaceOver && isScratched && !isBetsDetailedView) ||
(isBetsStandalone && isAllRunners && isActiveMultiRaceLegOver)
? css`
opacity: 0.2;
`
: css`
opacity: 1;
`}
${({ isBetsStandalone, isWinnerBI, isUnknownWinnerStatus }) =>
isBetsStandalone
? css`
height: 20px;
min-width: 20px;
padding: 0 2px;
${(isWinnerBI || isUnknownWinnerStatus) && "z-index: 2;"}
`
: css`
width: 100%;
height: 100%;
min-width: 16px;
min-height: 16px;
font-weight: bold;
`}
${({
isBetsStandalone,
isScratched,
isBetsDetailedView,
isRaceOver,
isUnknownWinnerStatus
}) =>
!isUnknownWinnerStatus &&
isBetsStandalone &&
isScratched &&
!isBetsDetailedView &&
isRaceOver &&
css`
&::before {
content: "";
${sharedScratchedStyles};
background-color: ${buildColor("white", "40")};
z-index: 2;
}
`}
`;
export const ScratchedBoxIconContainer = styled.div`
${sharedScratchedStyles};
z-index: 1;
`;
export const AlternateIconContainer = styled.div`
display: inline-flex;
position: absolute;
top: -8px;
right: -8px;
z-index: 2;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/RunnerNumber/SaddleColors/thoroughbred.js
const colors = [
{
number: 0,
numberColor: "#FFFFFF",
saddleColor: "#C20E0E"
},
{
number: 1,
numberColor: "#FFFFFF",
saddleColor: "#C20E0E"
},
{
number: 2,
numberColor: "#000000",
saddleColor: "#BCC8C8"
},
{
number: 3,
numberColor: "#FFFFFF",
saddleColor: "#3B4E8C"
},
{
number: 4,
numberColor: "#000000",
saddleColor: "#D3B13C"
},
{
number: 5,
numberColor: "#FFFFFF",
saddleColor: "#116410"
},
{
number: 6,
numberColor: "#FFFFFF",
saddleColor: "#303030"
},
{
number: 7,
numberColor: "#000000",
saddleColor: "#D65A2F"
},
{
number: 8,
numberColor: "#000000",
saddleColor: "#E095AA"
},
{
number: 9,
numberColor: "#000000",
saddleColor: "#2AAAA5"
},
{
number: 10,
numberColor: "#FFFFFF",
saddleColor: "#713A98"
},
{
number: 11,
numberColor: "#FFFFFF",
saddleColor: "#6B6B6B"
},
{
number: 12,
numberColor: "#000000",
saddleColor: "#4EA958"
},
{
number: 13,
numberColor: "#FFFFFF",
saddleColor: "#58514D"
},
{
number: 14,
numberColor: "#FFFFFF",
saddleColor: "#94335A"
},
{
number: 15,
numberColor: "#FFFFFF",
saddleColor: "#69522F"
},
{
number: 16,
numberColor: "#FFFFFF",
saddleColor: "#4C6E9F"
},
{
number: 17,
numberColor: "#FFFFFF",
saddleColor: "#373786"
},
{
number: 18,
numberColor: "#FFFFFF",
saddleColor: "#285F23"
},
{
number: 19,
numberColor: "#FFFFFF",
saddleColor: "#32496D"
},
{
number: 20,
numberColor: "#FFFFFF",
saddleColor: "#671334"
}
];
export default colors;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/RunnerNumber/SaddleColors/harness.js
const colors = [
{
number: 0,
numberColor: "#FFFFFF",
saddleColor: "#AF0000"
},
{
number: 1,
numberColor: "#FFFFFF",
saddleColor: "#AF0000"
},
{
number: 2,
numberColor: "#FFFFFF",
saddleColor: "#253C85"
},
{
number: 3,
numberColor: "#000000",
saddleColor: "#B2B4B1"
},
{
number: 4,
numberColor: "#FFFFFF",
saddleColor: "#1C5B1B"
},
{
number: 5,
numberColor: "#FFFFFF",
saddleColor: "#252525"
},
{
number: 6,
numberColor: "#000000",
saddleColor: "#B69E00"
},
{
number: 7,
numberColor: "#000000",
saddleColor: "#B27492"
},
{
number: 8,
numberColor: "#FFFFFF",
saddleColor: "#6B6B6B"
},
{
number: 9,
numberColor: "#FFFFFF",
saddleColor: "#610F9A"
},
{
number: 10,
numberColor: "#FFFFFF",
saddleColor: "#263D88"
},
{
number: 11,
numberColor: "#FFFFFF",
saddleColor: "#3B5E90"
},
{
number: 12,
numberColor: "#FFFFFF",
saddleColor: "#A90000"
},
{
number: 13,
numberColor: "#FFFFFF",
saddleColor: "#1D5E1C"
},
{
number: 14,
numberColor: "#FFFFFF",
saddleColor: "#725933"
},
{
number: 15,
numberColor: "#FFFFFF",
saddleColor: "#C0C0C0"
}
];
export default colors;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/RunnerNumber/SaddleColors/greyhound.js
const whiteTextStroke = `-1px -1px 0 white,
-1px 0 0 white,
-1px 1px 0 white,
1px -1px 0 white,
1px 0 0 white,
1px 1px 0 white,
0 1px 0 white`;
const colors = [
{
number: 0,
numberColor: "#ffffff",
saddleColor: "#c30d0d"
},
{
number: 1,
numberColor: "#ffffff",
saddleColor: "#c30d0d"
},
{
number: 2,
numberColor: "#ffffff",
saddleColor: "#3b4e8c"
},
{
number: 3,
numberColor: "#000000",
saddleColor: "#ffffff",
border: "solid 1px #CCC"
},
{
number: 4,
numberColor: "#ffffff",
saddleColor: "#116410"
},
{
number: 5,
numberColor: "#c20e0e",
saddleColor: "#303030",
textShadow: whiteTextStroke
},
{
number: 6,
numberColor: "#000000",
saddleColor: "#d3b13c"
},
{
number: 7,
numberColor: "#000000",
saddleColor: "#5d9634",
textShadow: whiteTextStroke,
border: "solid 1px #CCC",
gradient: `linear-gradient(
to bottom,
white 0,
white 14%,
#5d9634 14%,
#5d9634 29%,
white 29%,
white 43%,
#5d9634 43%,
#5d9634 57%,
white 57%,
white 71%,
#5d9634 71%,
#5d9634 86%,
white 86%,
white 100%
)`
},
{
number: 8,
numberColor: "#ffffff",
saddleColor: "#303030",
gradient: `linear-gradient(
to right,
#303030 12.5%,
#d3b13c 12.5%,
#d3b13c 25%,
#303030 25%,
#303030 75%,
#d3b13c 75%,
#d3b13c 87.5%,
#303030 87.5%
)`
},
{
number: 9,
numberColor: "#ffffff",
saddleColor: "#713a98"
}
];
export default colors;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/RunnerNumber/SaddleColors/index.js
import thoroughbred from "./thoroughbred";
import harness from "./harness";
import greyhound from "./greyhound";
import buildColor from "../../../_static/ColorPalette";
const empty = {
number: 0,
saddleColor: buildColor("blue", "000"),
numberColor: buildColor("grey", "900")
};
const getSaddleColor = (raceType, saddleNumber) => {
if (isNaN(saddleNumber)) {
return empty;
}
switch (raceType.toUpperCase()) {
case "H":
return harness[saddleNumber] || harness[0];
case "G":
return greyhound[saddleNumber] || greyhound[0];
case "T":
default:
return thoroughbred[saddleNumber] || thoroughbred[0];
}
};
export default getSaddleColor;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/RunnerNumber/index.jsx
import React, { PureComponent } from "react";
import {
SelectIcon,
StarIcon,
WinnerIconWrapper,
WinnerIcon,
RunnerNumberAtom,
ScratchedBoxIconContainer,
AlternateIconContainer
} from "./styled-components";
import getColor from "./SaddleColors";
import {
starOutlineFill,
arrowDown,
star,
tick
} from "../../_static/Icons/icons";
import { scratchedBox } from "../../_static/Icons/iconsDuotone";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
const DoubleArrowIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
>
<g clipPath="url(#clip0_12166_13982)">
<path
d="M5.5 5.4999C5.5 5.77604 5.72386 5.9999 6 5.9999L11.6667 5.9999L10.4187 7.31024C10.2283 7.51021 10.236 7.8267 10.436 8.01714L11.1601 8.7068C11.2561 8.79825 11.3845 8.84781 11.5171 8.84458C11.6497 8.84134 11.7755 8.78558 11.867 8.68955L14.7241 5.68955C15.092 5.30335 15.092 4.69645 14.7241 4.31024L11.867 1.31024C11.7755 1.21422 11.6497 1.15845 11.5171 1.15522C11.3845 1.15199 11.2561 1.20155 11.1601 1.293L10.436 1.98266C10.236 2.1731 10.2283 2.48959 10.4187 2.68955L11.6667 3.9999L6 3.9999C5.86739 3.9999 5.74021 4.05258 5.64645 4.14635C5.55268 4.24011 5.5 4.36729 5.5 4.4999L5.5 5.4999Z"
fill="white"
stroke="#05285A"
strokeLinejoin="round"
/>
<path
d="M10.5 10.5001C10.5 10.3675 10.4473 10.2403 10.3536 10.1465C10.2598 10.0528 10.1326 10.0001 10 10.0001L4.33333 10.0001L5.58128 8.68976C5.67273 8.59373 5.72229 8.46531 5.71906 8.33274C5.71583 8.20017 5.66006 8.07431 5.56404 7.98286L4.8399 7.2932C4.63993 7.10276 4.32345 7.11048 4.133 7.31045L1.27586 10.3104C0.908046 10.6967 0.908046 11.3035 1.27586 11.6898L4.133 14.6898C4.22446 14.7858 4.35031 14.8415 4.48288 14.8448C4.61545 14.848 4.74387 14.7985 4.8399 14.707L5.56404 14.0173C5.764 13.8269 5.77172 13.5104 5.58128 13.3104L4.33333 12.0001L10 12.0001C10.2761 12.0001 10.5 11.7762 10.5 11.5001L10.5 10.5001Z"
fill="white"
stroke="#05285A"
strokeLinejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_12166_13982">
<rect width="16" height="16" fill="white" />
</clipPath>
</defs>
</svg>
);
export default class RunnerNumber extends PureComponent {
static defaultProps = {
qaLabel: "runnerNumber",
runnerId: "",
raceTypeCode: "T",
isFavorite: false,
arrowDirection: "none",
isBetsStandalone: false,
isScratched: false,
isAllRunners: false,
isWinnerBI: false,
isActiveMultiRaceLegOver: false,
isRaceOver: false,
isBetsDetailedView: false,
isUnknownWinnerStatus: false,
isAlternate: false
};
render() {
const saddle = getColor(
this.props.raceTypeCode,
parseInt(this.props.runnerId, 10)
);
return (
<RunnerNumberAtom
data-qa-label={`${this.props.qaLabel}-${this.props.runnerId}`}
saddleColor={
!this.props.isAllRunners
? this.props.saddleColor || saddle.saddleColor
: buildColor("blue", "100")
}
numberColor={
!this.props.isAllRunners
? this.props.numberColor || saddle.numberColor
: buildColor("black", "100")
}
gradient={
!this.props.isAllRunners ? saddle.gradient : buildColor("blue", "100")
}
textShadow={saddle.textShadow}
isFavorite={this.props.isFavorite}
border={saddle.border}
flexDirection={this.props.arrowDirection !== "none" ? "column" : "row"}
isRotated={this.props.arrowDirection === "up"}
isBetsStandalone={this.props.isBetsStandalone}
isScratched={this.props.isScratched}
isWinnerBI={this.props.isWinnerBI}
isActiveMultiRaceLegOver={this.props.isActiveMultiRaceLegOver}
isBetsDetailedView={this.props.isBetsDetailedView}
isAllRunners={this.props.isAllRunners}
isRaceOver={this.props.isRaceOver}
isUnknownWinnerStatus={this.props.isUnknownWinnerStatus}
>
{this.props.isAlternate && (
<AlternateIconContainer>
<DoubleArrowIcon />
</AlternateIconContainer>
)}
{this.props.isBetsStandalone && this.props.isScratched && (
<ScratchedBoxIconContainer>
<Icon
icon={scratchedBox}
viewBoxSize={20}
size={20}
color={buildColor("grey", "900")}
/>
</ScratchedBoxIconContainer>
)}
{this.props.isWinnerBI && !this.props.isScratched && (
<WinnerIconWrapper>
<WinnerIcon
size={8}
icon={tick}
color={buildColor("green", "000")}
/>
</WinnerIconWrapper>
)}
{this.props.isFavorite && (
/* TODO update icon according to design for bet standalone */
<StarIcon
size={this.props.isBetsStandalone ? 12 : 9}
icon={this.props.isBetsStandalone ? star : starOutlineFill}
color={buildColor("yellow", "500")}
isBetsStandalone={this.props.isBetsStandalone}
/>
)}
{!this.props.runnerId ? "?" : this.props.runnerId}
{this.props.arrowDirection !== "none" && (
<SelectIcon
isRotated={this.props.arrowDirection === "up"}
icon={arrowDown}
size={12}
color={saddle.numberColor}
/>
)}
</RunnerNumberAtom>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/SequentialLabel/styled-components.js
import styled from "styled-components";
import { fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
const Label = styled.span`
font-weight: 500;
font-size: 14px;
font-family: ${fontMedium};
color: ${buildColor("grey", "900")};
& > sup {
font-size: 10px;
vertical-align: super;
}
`;
export default Label;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/SequentialLabel/index.jsx
import React, { PureComponent } from "react";
import Label from "./styled-components";
export default class SequentialLabel extends PureComponent {
static defaultProps = {
label: ""
};
processLabel = () => {
const isLeg = this.props.label.charAt(0) === "R";
const number = !isLeg ? this.props.label.slice(0, -2) : this.props.label;
const letters = !isLeg ? this.props.label.slice(-2).toLowerCase() : "";
return {
number,
letters
};
};
render() {
const { number, letters } = this.processLabel();
return (
<Label>
{number}
{letters && <sup>{letters}</sup>}
</Label>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RunnerNumberGroup/styled-components.js
import styled from "styled-components";
import { titleFont } from "../../_static/Typography";
import { buildText } from "../../_atom/Text";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
export const RunnerNumberGroupMolecule = styled.ol`
list-style-type: none;
display: flex;
width: 100%;
align-items: center;
`;
export const ListItem = styled.li`
min-width: 20px;
height: 20px;
display: flex;
justify-content: center;
align-items: center;
&:not(:first-child) {
margin-left: 1px;
}
`;
export const LabelItem = styled.li`
height: 16px;
width: 21px;
margin-right: 7px;
display: inline-flex;
align-items: center;
`;
export const Label = styled(
buildText({
tag: "strong",
fontSize: 12,
bold: true,
color: buildColor("grey", "900"),
uppercase: true
})
)`
font-family: ${titleFont};
`;
export const ArrowIcon = styled(Icon)`
margin: 2px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RunnerNumberGroup/index.jsx
import React, { Component, Fragment } from "react";
import { isEqual, includes } from "lodash";
import RunnerNumber from "../../_atom/RunnerNumber";
import SequentialLabel from "../../_atom/SequentialLabel";
import Icon from "../../_static/Icons";
import { key, arrowForward } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import {
RunnerNumberGroupMolecule,
ListItem,
LabelItem,
ArrowIcon
} from "./styled-components";
const doubleEntryRegex = /^[0-9]+[a-zA-Z]+$/; // Double Entry validation regex
const getListItem = (runner, isFavorite, isArrow, raceTypeCode) => (
<ListItem
data-qa-label={`runnerNumberGroup-${isArrow ? runner : "saddleItem"}`}
key={`runnerNumberGroup-${runner}-${isFavorite ? "Fav" : "Nfav"}`}
>
{isArrow ? (
<ArrowIcon
size={12}
icon={arrowForward}
color={buildColor("blue", "800")}
/>
) : (
<RunnerNumber
runnerId={runner}
raceTypeCode={raceTypeCode}
isFavorite={isFavorite}
/>
)}
</ListItem>
);
const getEmptyList = () => (
<Fragment>
<ListItem key="empty">
<RunnerNumber />
</ListItem>
</Fragment>
);
const getFullList = (runners, favorites, raceTypeCode) => (
<Fragment>
{runners.map((runner) =>
getListItem(runner, includes(favorites, runner), false, raceTypeCode)
)}
</Fragment>
);
export const checkFavoriteSequence = (runner, favorites, lastFavoriteAdded) =>
lastFavoriteAdded &&
!includes(favorites, runner) &&
((doubleEntryRegex.test(runner) &&
(lastFavoriteAdded === runner ||
parseInt(lastFavoriteAdded, 10) === parseInt(runner, 10))) ||
parseInt(lastFavoriteAdded, 10) + 1 === parseInt(runner, 10));
export const getShortedSelectionsList = (runners, favorites, raceTypeCode) => {
let isFavorite;
let lastFavoriteAdded = "";
let startWithFavorite;
let count;
let countDE; // Double Entry count.
let i = 0;
const shortedSelections = [];
while (i < runners.length) {
count = 1;
countDE = 0;
while (
doubleEntryRegex.test(runners[i + count]) ||
parseInt(runners[i], 10) + (count - countDE) ===
parseInt(runners[i + count], 10)
) {
if (doubleEntryRegex.test(runners[i + count])) {
countDE += 1;
}
count += 1;
if (includes(favorites, runners[i + count - 1])) {
break;
}
}
startWithFavorite = 0; // new runners sequence starts with a favorite (0 -> false, 1 -> true)
if (
count === 2 &&
checkFavoriteSequence(runners[i], favorites, lastFavoriteAdded)
) {
// check if the last runner added to the array was a favorite and if the next one is sequencial to the favorite
startWithFavorite = 1;
}
if (count + startWithFavorite >= 3) {
// Sequence
if (!checkFavoriteSequence(runners[i], favorites, lastFavoriteAdded)) {
// if sequence not start after a favorite then add new runner.
isFavorite = includes(favorites, runners[i]);
shortedSelections.push(
getListItem(
isFavorite ? runners[i] : parseInt(runners[i], 10).toString(),
isFavorite,
false,
raceTypeCode
)
);
}
shortedSelections.push(
getListItem(`arrow${i}`, false, true, raceTypeCode)
);
isFavorite = includes(favorites, runners[i + count - 1]);
shortedSelections.push(
getListItem(
isFavorite
? runners[i + count - 1]
: parseInt(runners[i + count - 1], 10).toString(),
isFavorite,
false,
raceTypeCode
)
);
lastFavoriteAdded = isFavorite ? runners[i + count - 1] : "";
i += count;
} else {
// Single entry
isFavorite = includes(favorites, runners[i]);
lastFavoriteAdded = isFavorite ? runners[i] : "";
shortedSelections.push(
getListItem(runners[i], isFavorite, false, raceTypeCode)
);
i += 1;
}
}
return <Fragment>{shortedSelections}</Fragment>;
};
export default class RunnerNumberGroup extends Component {
static defaultProps = {
runners: [],
raceTypeCode: "T",
label: "",
isKey: false,
isShort: true,
favoriteRunners: []
};
shouldComponentUpdate(nextProps) {
return (
nextProps.runners.length !== this.props.runners.length ||
nextProps.favoriteRunners.length !== this.props.favoriteRunners.length ||
!isEqual(nextProps, this.props)
);
}
buildSaddleList = () => {
if (!this.props.runners.length) {
return getEmptyList();
}
if (this.props.isShort && this.props.runners.length > 2) {
return getShortedSelectionsList(
this.props.runners,
this.props.favoriteRunners,
this.props.raceTypeCode
);
}
return getFullList(
this.props.runners,
this.props.favoriteRunners,
this.props.raceTypeCode
);
};
render() {
return (
<RunnerNumberGroupMolecule data-qa-label="runnerNumberGroup">
{(this.props.isKey || this.props.label) && (
<LabelItem>
{!this.props.isKey ? (
<SequentialLabel label={this.props.label} />
) : (
<Icon icon={key} size={16} color={buildColor("grey", "900")} />
)}
</LabelItem>
)}
{this.buildSaddleList()}
</RunnerNumberGroupMolecule>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/BetSummary/styled-components.js
import styled, { css } from "styled-components";
import { buildText } from "../../_atom/Text";
import ButtonDefault from "../../_atom/Buttons/default";
import buildColor from "../../_static/ColorPalette";
import { fontMedium } from "../../_static/Typography";
export const BetDetailsContainer = styled.div`
display: flex;
height: 40px;
align-items: center;
background-color: ${buildColor("blue", "000")};
padding-right: ${(props) => (props.isCancelable ? "0" : "8px")};
`;
export const BetDetails = styled.div`
display: flex;
flex-direction: column;
flex-grow: 1;
place-items: flex-start center;
padding-left: 8px;
span:not(:first-child) {
margin-left: 4px;
}
`;
export const TrashButton = styled(ButtonDefault)`
width: 48px;
height: 40px;
background: transparent;
border: 0;
border-radius: 0;
`;
export const TrashContainer = styled.div`
display: flex;
align-items: center;
justify-content: center;
`;
export const PromoOptedInWrapper = styled.div`
display: flex;
align-items: center;
margin-top: 2px;
`;
export const PromoOptedInLabel = styled.small`
font-size: 10px;
display: inline-block;
margin-left: 2px;
text-transform: uppercase;
color: ${buildColor("grey", "800")};
`;
export const SelectionsContainer = styled.div`
display: flex;
align-items: center;
min-height: 40px;
${(props) =>
props.layout === "full" &&
css`
background: ${buildColor("white", "100")};
border-top: 1px solid ${buildColor("blue", "100")};
padding: 8px;
`};
${(props) =>
props.layout === "simple" &&
css`
padding: 12px 0;
`};
${(props) =>
props.isVertical
? css`
flex-direction: column;
justify-content: center;
& > ol {
flex-basis: auto;
&:not(:first-child) {
margin: 8px 0 0;
}
}
`
: css`
flex-flow: row nowrap;
justify-content: flex-start;
overflow: auto;
& > ol {
flex-basis: 0;
&:not(:first-child) {
margin: 0 0 0 8px;
}
}
`};
`;
export const BetSummaryContainer = styled.div`
position: relative;
border: 1px solid ${buildColor("grey", "300")};
border-radius: 2px;
`;
export const BetAmount = styled(
buildText({
tag: "span",
fontSize: 12,
bold: false,
color: buildColor("grey", "900"),
qaLabel: "betSummary-betAmount"
})
)`
letter-spacing: normal;
font-family: ${fontMedium};
`;
export const TicketAmount = buildText({
fontSize: 12,
color: buildColor("grey", "800"),
qaLabel: "betSummary-ticketAmount"
});
export const BetLabel = styled.span`
background-color: ${(props) => props.bgColor};
color: ${(props) => props.color};
padding: 0 3px;
height: 16px;
line-height: 16px;
font-size: 11px;
border-radius: 1px;
text-transform: uppercase;
font-weight: bold;
`;
export const RepeatableLabel = styled.span`
margin-left: 3px;
`;
export const RepeatButton = styled.span`
> button {
padding: 0;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/BetSummary/index.jsx
import React, { Component, Fragment } from "react";
import { noop, isEqual, isString } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import formatSequencial from "@tvg/formatter/numeric";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import { trash, promosolid } from "../../_static/Icons/icons";
import RunnerNumberGroup from "../RunnerNumberGroup";
import Button from "../../_atom/Buttons/button";
import {
BetDetailsContainer,
BetDetails,
TrashButton,
TrashContainer,
SelectionsContainer,
BetSummaryContainer,
BetAmount,
TicketAmount,
BetLabel,
RepeatableLabel,
RepeatButton,
PromoOptedInWrapper,
PromoOptedInLabel
} from "./styled-components";
export const getListRunnerNumberGroup = (
selectionsList = [],
raceTypeCode = "T",
isKey = false,
isLeg = false,
raceNumber = 1,
favoriteRunners = [],
showAllSelections = true
) => {
const multipleColumns = selectionsList.length > 1;
return (
<Fragment>
{(!showAllSelections && selectionsList.length > 5
? selectionsList.slice(0, 5)
: selectionsList
).map((selection, index) => {
if (isKey && index > 1) {
return false;
}
const favoritesColumn = isLeg ? index : 0;
const favorites = favoriteRunners[favoritesColumn] || [];
const favoritesAsStrings = favorites.every((fav) => isString(fav));
const normalizedFavs = favoritesAsStrings
? favorites
: favorites.map((fav) => `${fav}`);
let key = false;
let label = "";
if (multipleColumns) {
key = index === 0 && isKey;
if (isKey && index !== 0) {
label = "W/";
} else {
label = !isLeg
? formatSequencial(index + 1)
: `R${raceNumber + index}`;
}
}
return (
<RunnerNumberGroup
key={`runner-group${label}`}
runners={selection}
raceTypeCode={raceTypeCode}
isKey={key}
label={label}
favoriteRunners={normalizedFavs}
/>
);
})}
</Fragment>
);
};
class BetSummary extends Component {
static defaultProps = {
onDelete: noop,
onRepeatClick: noop,
isCancelable: false,
betTotal: 0,
wagerAmount: 0,
selectionTypeCode: "",
selections: [],
favoriteRunners: [],
raceTypeCode: "T",
isKey: false,
isLeg: false,
isVertical: true,
isLost: false,
isRepeatable: false,
isPromoQualifying: false,
repetitionsNr: 1,
isCancelled: false,
isRefunded: false,
totalWinAmount: null,
className: "",
raceNumber: "1",
layout: "full",
hasRepeaterEnabled: false,
hideRepeatButton: false,
hasPromosOptedIn: false,
showAllSelections: true
};
shouldComponentUpdate(nextProps) {
return (
this.props.selections.length !== nextProps.selections.length ||
this.props.repetitionsNr !== nextProps.repetitionsNr ||
!isEqual(this.props, nextProps)
);
}
renderBetDetails() {
return (
<BetDetails>
<div>
<BetAmount>
<span data-qa-label="betSummary-betAmount-amount">
{formatCurrency(this.props.wagerAmount || 0)}
</span>
<span data-qa-label="betSummary-betAmount-betType">
{this.props.selectionTypeCode}
</span>
{this.props.repetitionsNr > 1 && (
<RepeatableLabel data-qa-label="betSummary-betAmount-repetitionsNr">
[x{this.props.repetitionsNr}]
</RepeatableLabel>
)}
</BetAmount>
<TicketAmount>
<span data-qa-label="betSummary-betAmount-betTotal">
{this.props.repetitionsNr > 1
? formatCurrency(this.props.betTotal * this.props.repetitionsNr)
: formatCurrency(this.props.betTotal || 0)}
</span>
<span>Ticket</span>
</TicketAmount>
</div>
{this.props.hasPromosOptedIn && this.props.isPromoQualifying && (
<PromoOptedInWrapper>
<Icon icon={promosolid} color={buildColor("yellow", "500")} />
<PromoOptedInLabel>Opted-In</PromoOptedInLabel>
</PromoOptedInWrapper>
)}
</BetDetails>
);
}
renderTrashButton() {
return (
<TrashButton
onClick={this.props.onDelete}
qaLabel="betSummary-cancelBetBtn"
>
<TrashContainer>
<Icon size={16} icon={trash} color={buildColor("grey", "900")} />
</TrashContainer>
</TrashButton>
);
}
renderSelections() {
return getListRunnerNumberGroup(
this.props.selections,
this.props.raceTypeCode,
this.props.isKey,
this.props.isLeg,
+this.props.raceNumber,
this.props.favoriteRunners,
this.props.showAllSelections
);
}
renderFullBetSummary() {
return (
<BetSummaryContainer
data-qa-label="betSummary"
className={this.props.className}
>
<BetDetailsContainer
isRepeatable={
this.props.isRepeatable &&
this.props.hasRepeaterEnabled &&
!this.props.hideRepeatButton
}
isCancelable={this.props.isCancelable}
>
{this.renderBetDetails()}
{this.props.isRepeatable &&
this.props.hasRepeaterEnabled &&
!this.props.hideRepeatButton &&
!this.props.isCancelled &&
!this.props.isLost &&
!this.props.isRefunded &&
!this.props.totalWinAmount && (
<RepeatButton>
<Button
type="tertiary"
qaLabel="betSummary-repeatLink"
onClick={this.props.onRepeatClick}
>
Repeat
</Button>
</RepeatButton>
)}
{this.props.isCancelable && this.renderTrashButton()}
{this.props.isCancelled && (
<BetLabel
bgColor={buildColor("white", "100")}
color={buildColor("grey", "900")}
data-qa-label="betSummary-cancelledLabel"
>
Cancelled
</BetLabel>
)}
{this.props.isRefunded && (
<BetLabel
bgColor={buildColor("white", "100")}
color={buildColor("grey", "900")}
data-qa-label="betSummary-refundedLabel"
>
Refunded
</BetLabel>
)}
{this.props.isLost && (
<BetLabel
bgColor={buildColor("blue", "100")}
color={buildColor("grey", "900")}
data-qa-label="betSummary-lostLabel"
>
Lost
</BetLabel>
)}
{this.props.totalWinAmount && (
<BetLabel
bgColor={buildColor("green", "600")}
color={buildColor("white", "100")}
data-qa-label="betSummary-winlabel"
>
Won {formatCurrency(this.props.totalWinAmount)}
</BetLabel>
)}
</BetDetailsContainer>
<SelectionsContainer
data-qa-label="runnerSelections"
isVertical={this.props.isVertical}
layout={this.props.layout}
isMyBets={!this.props.isRepeatable && !this.props.hasRepeaterEnabled}
>
{this.renderSelections()}
</SelectionsContainer>
</BetSummaryContainer>
);
}
renderSimpleBetSummary() {
return (
<div className={`simpleBetSummaryWrapper ${this.props.className}`}>
{this.renderBetDetails()}
<SelectionsContainer
data-qa-label="runnerSelections"
isVertical={this.props.isVertical}
layout={this.props.layout}
>
{this.renderSelections()}
</SelectionsContainer>
</div>
);
}
render() {
switch (this.props.layout) {
case "simple":
return this.renderSimpleBetSummary();
case "full":
default:
return this.renderFullBetSummary();
}
}
}
export default BetSummary;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/TalentPickCard/style-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import DefaultButton from "../../_atom/Buttons/default";
import { fontMedium } from "../../_static/Typography";
const handleIfIsTvg5 = (isTvg5) => {
return isTvg5 ? "100%" : "311px";
};
export const CardWrapper = styled.article`
background-color: ${buildColor("white", "100")};
border: 1px solid ${buildColor("blue", "100")};
border-radius: 4px;
box-shadow: 0 1px 2px 0 ${buildColor("blue", "000")};
${(props, isTvg5) =>
props.isHorizontalLayout &&
css`
margin-right: 8px;
display: flex;
flex-direction: column;
width: ${({ isDesktop }) =>
isDesktop ? handleIfIsTvg5(isTvg5) : "290px"};
width: 100%;
height: 302px;
`};
`;
export const SelectionsWrapper = styled.div`
position: relative;
padding: 12px 12px 4px;
border-top: 1px solid ${buildColor("blue", "100")};
flex: 1 1 auto;
& > .talentPickCard > div {
padding-left: 0;
}
`;
export const TogglesWrapper = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid ${buildColor("blue", "100")};
padding: 8px;
font-size: 12px;
cursor: pointer;
`;
export const ActionsWrapper = styled.footer`
display: flex;
flex-wrap: wrap;
background-color: ${buildColor("white", "100")};
padding: 0 12px 12px;
border-radius: 4px;
& > button {
padding: 0 16px;
&:not(:last-child) {
margin-right: 8px;
}
&:nth-child(2n) {
font-size: 14px;
flex-grow: 1;
}
}
`;
export const SeeAllSelections = styled(DefaultButton)`
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 40px;
font-size: 14px;
font-weight: 500;
font-family: ${fontMedium};
color: ${buildColor("blue_accent", "500")};
background: rgba(255, 255, 255, 0.9);
&:hover {
text-decoration: underline;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/TalentPickCard/index.jsx
import React, { Component, Fragment } from "react";
import { map, throttle, get, noop } from "lodash";
import { isTvg5 } from "@tvg/utils/generalUtils";
import buildRaceUrl from "@tvg/formatter/url";
import Button from "../../_atom/Buttons/button";
import Toggle from "../../_atom/Toggle";
import TalentPickCardHeader from "../../_molecule/TalentPickCardHeader";
import BetSummary from "../../_molecule/BetSummary";
import {
CardWrapper,
SelectionsWrapper,
TogglesWrapper,
ActionsWrapper,
SeeAllSelections
} from "./style-components";
export default class TalentPickCard extends Component {
static defaultProps = {
talentPick: {
id: "0",
selections: [],
favorites: [],
amount: "0",
price: "0",
wagerType: {
abbreviation: "",
legCount: 1,
isBox: false,
isKey: false,
isWheel: false
},
track: "",
trackName: "",
race: 0,
raceType: "T",
status: "RO",
talent: {
talentId: "",
name: "",
pictureUrl: "",
popularity: 0,
tvgAccountId: "",
phrases: [],
isActive: true
},
published: true,
racePostTime: "2018-06-06T21:51:00.000Z",
mtp: 474
},
isRacePick: false,
buttons: [],
onPublishToggle: null,
imageBaseURL: "//www.tvg.com",
isDesktop: false,
showButtonsCallBack: () => true,
onSeeAllSelections: null,
isHorizontalLayout: false,
onClickHeader: noop
};
publish = throttle(
() => {
get(
this.props,
"onPublishToggle",
noop
)({
id: this.props.talentPick.id,
published: this.props.talentPick.published
});
},
1500,
{ trailing: false }
);
renderPick() {
const showSeeAllBtn =
typeof this.props.onSeeAllSelections === "function" &&
this.props.talentPick.selections.length > 5;
return (
<SelectionsWrapper data-qa-label="body">
<BetSummary
className="talentPickCard"
betTotal={+this.props.talentPick.price}
wagerAmount={+this.props.talentPick.amount}
selectionTypeCode={this.props.talentPick.wagerType.abbreviation}
isKey={this.props.talentPick.wagerType.isKey}
isLeg={this.props.talentPick.wagerType.legCount > 1}
selections={this.props.talentPick.selections}
favoriteRunners={this.props.talentPick.favorites}
raceTypeCode={this.props.talentPick.raceType}
raceNumber={this.props.talentPick.race}
isVertical
layout="simple"
showAllSelections={!showSeeAllBtn}
/>
{showSeeAllBtn && (
<SeeAllSelections
onClick={() =>
typeof this.props.onSeeAllSelections === "function" &&
this.props.onSeeAllSelections(this.props.talentPick)
}
>
See all selections
</SeeAllSelections>
)}
</SelectionsWrapper>
);
}
renderToggles() {
return (
typeof this.props.onPublishToggle === "function" && (
<Fragment>
<TogglesWrapper data-qa-label="publish-button" onClick={this.publish}>
Talent pick published
<Toggle
on={this.props.talentPick.published}
onClick={this.publish}
/>
</TogglesWrapper>
</Fragment>
)
);
}
renderButtons() {
return (
this.props.buttons.length > 0 && (
<ActionsWrapper data-qa-label="footer">
{map(this.props.buttons, (button, index) => (
<Button
key={`actionbutton-${+index}`}
type={button.type}
qaLabel={button.qaLabel}
onClick={() => button.onClick(this.props.talentPick)}
size="big"
>
{button.label(+get(this.props, "talentPick.price", 0))}
</Button>
))}
</ActionsWrapper>
)
);
}
render() {
const showButtons = this.props.showButtonsCallBack(this.props.talentPick);
const {
track,
race,
talent,
wagerType,
trackName,
raceType,
mtp,
racePostTime,
raceStatus
} = this.props.talentPick;
const raceUrl = buildRaceUrl(track, trackName, race, raceType === "G");
return (
<CardWrapper
isHorizontalLayout={this.props.isHorizontalLayout}
data-qa-label={`pick_${talent.talentId}_${track}_${race}_${wagerType.abbreviation}`}
isDesktop={this.props.isDesktop}
isTvg5={isTvg5()}
>
<TalentPickCardHeader
{...this.props.talentPick.talent}
imageBaseURL={this.props.imageBaseURL}
raceUrl={raceUrl}
mtp={mtp}
postTime={racePostTime}
status={raceStatus}
trackCode={track}
trackName={trackName}
race={race}
isFeatured={
get(this.props, "talentPick.highlighted.style", "") ===
"Highlighted"
}
featuredText={get(
this.props,
"talentPick.highlighted.description",
""
)}
isDesktop={this.props.isDesktop}
onClick={
this.props.isDesktop
? () =>
this.props.onClickHeader(
this.props.talentPick,
raceUrl,
"header"
)
: () =>
this.props.onClickHeader(
this.props.talentPick,
"edit",
"header"
)
}
/>
{this.renderPick()}
{this.renderToggles()}
{showButtons && this.renderButtons()}
</CardWrapper>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/TalentPickFilter/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
export const TalentPickFilterWrapper = styled.ul`
overflow-x: scroll;
display: flex;
padding-bottom: 8px;
list-style: none;
${({ device }) =>
device !== "mobile"
? css`
padding-top: 8px;
background-color: ${buildColor("blue", "800")};
& > li:first-child {
margin-left: auto;
}
& > li:last-child {
margin-right: auto;
}
`
: css`
background-color: ${buildColor("blue", "700")};
`}
`;
export const AlertButton = styled.button`
width: 72px;
background-color: transparent;
display: flex;
flex-direction: column;
align-items: center;
flex-shrink: 0;
outline: none;
border-right: 1px solid ${buildColor("white", "20")};
${({ device }) =>
device === "tablet" &&
css`
margin-left: auto;
`};
`;
export const IconHolder = styled.div`
width: 56px;
height: 56px;
border-radius: 50%;
background-color: ${buildColor("white", "20")};
display: flex;
justify-content: center;
align-items: center;
`;
export const AlertButtonDescription = styled.span`
padding-top: 3px;
font-size: 10px;
color: ${buildColor("blue", "100")};
text-align: center;
line-height: 11px;
`;
export const TalentFilterSection = styled.section`
width: 100%;
position: sticky;
z-index: 20;
left: 0;
top: 56px;
`;
export const EmptyStateMessageContainer = styled.div`
display: flex;
align-items: center;
justify-content: flex-start;
position: relative;
margin-right: auto;
`;
export const Message = styled.span`
color: ${buildColor("white", "100")};
font-size: 12px;
text-align: left;
${({ device }) =>
device !== "mobile"
? css`
width: 196px;
margin: 18px 16px 18px 70px;
`
: css`
margin: 18px 16px 18px 20px;
`}
`;
export const ArrowIcon = styled(Icon)`
position: absolute;
left: ${({ device }) => (device !== "mobile" ? "-25px" : "-65px")};
&& {
width: 100px;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TalentPickFilterSelector/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
export const FilterSelectorWrapper = styled.button`
width: 72px;
position: relative;
outline: none;
background-color: transparent;
display: flex;
flex-direction: column;
align-items: center;
flex-shrink: 0;
${(props) =>
props.hasSelected &&
!props.isActive &&
css`
opacity: 0.5;
`}
&:hover {
cursor: pointer;
}
`;
export const TalentImage = styled.img`
width: 56px;
height: 56px;
border-radius: 50%;
background-color: ${buildColor("grey", "300")};
object-fit: cover;
`;
export const TalentName = styled.span`
padding-top: 3px;
font-size: 10px;
width: 68px;
color: ${(props) =>
props.isActive && props.hasSelected
? buildColor("white", "100")
: buildColor("blue", "100")};
text-align: center;
line-height: 11px;
`;
export const TalentNumber = styled.div`
position: absolute;
right: 8px;
display: flex;
align-items: center;
justify-content: center;
&::after {
content: "${(props) => props.number}";
background-color: ${buildColor("red", "500")};
color: ${buildColor("white", "100")};
border-radius: 8px;
margin-left: 4px;
display: block;
min-width: 12px;
height: 16px;
line-height: 16px;
padding: 0 2px;
text-align: center;
font-weight: bold;
font-size: 11px;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TalentPickFilterSelector/index.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import {
FilterSelectorWrapper,
TalentImage,
TalentName,
TalentNumber
} from "./styled-components";
export default class TalentPickFilterSelector extends PureComponent {
static defaultProps = {
talent: { talentId: "0", name: "", pictureUrl: "", pickCount: 0 },
onClick: noop,
activeFilters: [],
imageBaseURL: "//www.tvg.com"
};
isTalentActive = (talentId) => this.props.activeFilters.includes(talentId);
render() {
return (
<li data-qa-label={`talent_${this.props.talent.talentId}`}>
<FilterSelectorWrapper
onClick={() =>
this.props.onClick(
this.props.talent.talentId,
this.props.talent.name
)
}
hasSelected={this.props.activeFilters.length !== 0}
isActive={this.isTalentActive(this.props.talent.talentId)}
data-qa-label="talentFilterButton"
>
<TalentNumber
number={this.props.talent.pickCount}
data-qa-label="talentFilterNumber"
/>
<TalentImage
src={`${this.props.imageBaseURL}/${this.props.talent.pictureUrl}`}
data-qa-label="talentFilterImage"
/>
<TalentName
isActive={this.isTalentActive(this.props.talent.talentId)}
hasSelected={this.props.activeFilters.length !== 0}
data-qa-label="talentFilterName"
>
{this.props.talent.name}
</TalentName>
</FilterSelectorWrapper>
</li>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/TalentPickFilter/index.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import { alert, curvedArrow } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import {
TalentPickFilterWrapper,
AlertButton,
IconHolder,
AlertButtonDescription,
TalentFilterSection,
EmptyStateMessageContainer,
Message,
ArrowIcon
} from "./styled-components";
import TalentPickFilterSelector from "../../_molecule/TalentPickFilterSelector";
import Icon from "../../_static/Icons";
export default class TalentPickFilter extends PureComponent {
static defaultProps = {
talents: [],
onClick: noop,
activeFilters: [],
device: "mobile",
picksAlertsToggle: false,
filterEmptyStateMessage: "",
hasAlerts: false,
enableTalentFilter: false,
imageBaseURL: "//www.tvg.com"
};
renderAlertButton = () => (
<AlertButton
data-qa-label="talentPicksAlertsButton"
device={this.props.device}
onClick={() => this.props.onClick("open_alerts_modal")}
>
<IconHolder>
<Icon icon={alert} color={buildColor("white", "100")} size={24} />
</IconHolder>
<AlertButtonDescription>Alerts</AlertButtonDescription>
</AlertButton>
);
renderTalents = () =>
this.props.enableTalentFilter && this.props.talents.length > 0
? this.props.talents.map((talent) => (
<TalentPickFilterSelector
key={talent.talentId}
activeFilters={this.props.activeFilters}
onClick={this.props.onClick}
talent={talent}
imageBaseURL={this.props.imageBaseURL}
/>
))
: this.renderEmptyMessage();
renderEmptyMessage = () =>
this.props.hasAlerts && (
<EmptyStateMessageContainer>
<ArrowIcon
device={this.props.device}
icon={curvedArrow}
color={buildColor("white", "100")}
size={10}
/>
<Message device={this.props.device}>
{this.props.filterEmptyStateMessage}
</Message>
</EmptyStateMessageContainer>
);
render() {
return (
<TalentFilterSection data-qa-label="talentPicksFilterSection">
<TalentPickFilterWrapper
device={this.props.device}
data-qa-label="talentPicksFilterList"
>
{this.props.picksAlertsToggle &&
this.props.hasAlerts &&
this.renderAlertButton()}
{this.renderTalents()}
</TalentPickFilterWrapper>
</TalentFilterSection>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RedirectCard/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import { fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const Card = styled.div`
width: ${(props) => props.cardWidth}px;
height: ${(props) => props.cardHeight}px;
display: flex;
justify-content: center;
align-items: center;
min-width: 292px;
`;
const linkStyle = css`
text-decoration: none;
text-transform: uppercase;
text-align: center;
color: ${buildColor("blue_accent", "500")};
font-size: 12px;
font-family: ${fontMedium};
font-weight: 500;
padding: 12px;
`;
export const RedirectLink = styled(Link)`
${linkStyle}
`;
export const RedirectLinkTVG4 = styled.a`
${linkStyle}
&:hover {
cursor: pointer;
}
`;
export const IconWrapper = styled.div`
width: 60px;
height: 60px;
margin: auto;
margin-bottom: 20px;
background: ${buildColor("white", "100")};
border-radius: 50%;
border: 1px solid ${buildColor("grey", "300")};
display: flex;
justify-content: center;
align-items: center;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RedirectCard/index.jsx
import React, { PureComponent, Fragment } from "react";
import { noop } from "lodash";
import {
Card,
RedirectLink,
RedirectLinkTVG4,
IconWrapper
} from "./styled-components";
import Icon from "../../_static/Icons";
import { arrowForward } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
export default class RedirectCard extends PureComponent {
static defaultProps = {
text: "See all",
cardWidth: 292,
cardHeight: 292,
isDesktop: false,
url: "",
onClick: noop,
qaLabel: "seeAllCard"
};
onClick = (event) => this.props.onClick(event, this.props.url);
renderLinkContent = () => (
<Fragment>
<IconWrapper>
<Icon
size={16}
icon={arrowForward}
color={buildColor("blue_accent", "500")}
/>
</IconWrapper>
{this.props.text}
</Fragment>
);
render() {
return (
<Card
cardWidth={this.props.cardWidth}
cardHeight={this.props.cardHeight}
data-qa-label={this.props.qaLabel}
>
{this.props.isDesktop ? (
<RedirectLinkTVG4 href={this.props.url} onClick={this.onClick}>
{this.renderLinkContent()}
</RedirectLinkTVG4>
) : (
<RedirectLink to={this.props.url} onClick={this.onClick}>
{this.renderLinkContent()}
</RedirectLink>
)}
</Card>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/TalentPicksList/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import ButtonDefault from "../../_atom/Buttons/default";
import buildColor from "../../_static/ColorPalette";
import { fontBold, fontMedium } from "../../_static/Typography";
export const PicksWrapper = styled.div`
align-self: center;
flex-grow: 1;
position: relative;
width: 100%;
${({ isOnProgramPage, isOnTool, isOnHomePage }) =>
!isOnProgramPage &&
!isOnTool &&
!isOnHomePage &&
css`
margin: auto;
@media (min-width: 486px) {
max-width: 414px;
}
@media (min-width: 1200px) {
max-width: 485px;
}
@media (min-width: 1366px) {
max-width: 552px;
}
`}
& > article {
margin-top: 16px;
margin-bottom: 1px;
}
& > * {
flex: 0 0 auto;
}
${(props) =>
props.isEmpty &&
css`
display: flex;
align-items: center;
justify-content: center;
padding: 12px 0;
`};
${(props) =>
props.isHorizontalLayout &&
css`
display: flex;
align-items: stretch;
overflow: hidden;
& > article:first-child {
margin-left: 4px;
}
`};
${({ onModalDesktop }) =>
onModalDesktop &&
css`
width: 292px;
`};
`;
export const TalentPickWrapper = styled.div`
${({ isDesktop, isTvg5, talentPickWrapperWidth }) =>
isDesktop
? css`
max-width: ${isTvg5 ? talentPickWrapperWidth : "312px"};
`
: css`
margin-left: 8px;
max-width: 290px;
&:first-of-type {
margin-left: ${(props) => !props.isDesktop && "12px"};
}
`};
${({ isLastCard }) =>
isLastCard &&
css`
margin-right: calc(100% - 292px);
`};
padding: 12px 0 2px;
`;
export const TalentPicksContainer = styled.section`
align-self: center;
${({ isOnProgramPage, isOnTool, isEmpty }) =>
!isOnProgramPage &&
!isOnTool &&
!isEmpty &&
css`
position: relative;
`};
display: flex;
width: 100%;
flex-direction: column;
flex-grow: 1;
${(props) =>
props.hasNewButton &&
css`
padding-bottom: 80px;
`};
${(props) =>
props.isHorizontalLayout &&
css`
background-color: ${buildColor("white", "100")};
padding-bottom: 12px;
`};
& > .talentPicksWatchLiveBox {
background-color: ${buildColor("white", "100")};
margin-top: 8px;
padding-top: 16px;
white-space: pre-line;
& a {
margin-top: 8px;
margin-right: 8px;
padding: 10px 8px;
width: 102px;
}
}
& .emptyStateContainer {
left: 0;
right: 0;
}
${({ isDesktop }) =>
isDesktop &&
css`
margin-bottom: 12px;
`};
${({ isEmpty, onProgramPage }) =>
isEmpty &&
onProgramPage &&
css`
background-color: ${buildColor("white", "100")};
`};
`;
export const WatchLiveButtonWrapper = styled.div`
display: flex;
flex-direction: row;
margin-left: 24px;
margin-top: 8px;
a,
button {
font-size: 14px;
span {
font-family: ${fontMedium};
}
}
a:not(:last-child) {
margin-right: 8px;
}
`;
export const WatchLiveLabel = styled.span`
margin-left: 4px;
white-space: nowrap;
`;
export const NewButton = styled(ButtonDefault)`
width: 50px;
height: 50px;
padding: 8px;
font-size: 9px;
border-radius: 50%;
background-color: ${buildColor("blue", "500")};
color: ${buildColor("white", "100")};
font-weight: bold;
box-shadow:
0 -2px 9px 0 rgba(0, 0, 0, 0.16),
0 0 1px 0 rgba(0, 0, 0, 0.24);
position: fixed;
bottom: 16px;
@media (max-width: 600px) {
right: 8px;
}
@media (min-width: 600px) {
left: 50%;
transform: translate(-50%, 0);
margin-left: 251px;
}
`;
export const MessageContainer = styled.div`
width: 90%;
top: ${(props) => (props.isFilterEnabled ? `86px` : `0px`)};
left: 0;
right: 0;
bottom: 0;
margin: auto;
height: 280px;
& a {
display: block;
width: 135px;
height: 188px;
}
& .liveButtonsWrapper {
display: flex;
align-items: space-between;
padding-top: 18px;
}
`;
export const Title = styled.h1`
color: ${buildColor("grey", "900")};
font-family: ${fontBold};
font-weight: bold;
${({ isDesktop }) =>
isDesktop
? css`
font-size: 18px;
margin-right: 12px;
`
: css`
font-size: 16px;
`};
`;
export const TitleContainer = styled.div`
display: flex;
padding: 12px 12px 0;
align-items: center;
${({ isDesktop }) =>
isDesktop
? css`
position: absolute;
height: 46px;
`
: css`
justify-content: space-between;
`}
`;
const linkStyle = `
color: ${buildColor("blue_accent", "500")};
font-family: ${fontMedium};
font-size: 14px;
text-decoration: none;
vertical-align: middle;
text-align:right;
:hover {
cursor:pointer;
text-decoration: underline;
}
`;
export const RedirectLink = styled(Link)`
${linkStyle}
`;
export const RedirectLinkDesktop = styled.a`
${linkStyle};
margin-top: 4px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Masks/talent-pick-card.jsx
import React, { PureComponent } from "react";
import styled, { keyframes, css } from "styled-components";
import color from "../ColorPalette";
const SVGContainer = styled.div`
width: 100%;
margin-bottom: ${(props) => (props.isDesktop ? "12px" : 0)};
overflow: hidden;
`;
const pulseAnimation = keyframes`
0% {
fill: ${color("grey", "000")};
}
50% {
fill: ${color("blue", "000")};
}
100% {
fill: ${color("grey", "000")};
}
`;
const SVG = styled.svg`
${({ isDesktop }) =>
isDesktop
? css`
width: 663px;
height: 360px;
`
: css`
width: 1032px;
height: 352px;
`}
display: block;
rect.pulse {
animation: ${pulseAnimation} 1.25s infinite;
}
rect.stroke {
stroke: ${color("blue", "100")};
stroke-width: 1;
}
`;
/*
TODO: Use buildColor to set the mask color
*/
export default class HPTalentPicksMask extends PureComponent {
static defaultProps = {
isDesktop: false
};
render() {
return (
<SVGContainer
data-qa-label="HPTalentPicksMask"
isDesktop={this.props.isDesktop}
>
<SVG isDesktop={this.props.isDesktop}>
{this.props.isDesktop ? (
<g fill="none" fillRule="evenodd" transform="translate(-53 -1526)">
<rect width="1391" height="2692" fill="#E9EFF5" />
<g transform="translate(53 1526)">
<rect
width="663"
height="360"
fill="#FFF"
fillRule="nonzero"
rx="4"
/>
<rect
width="130"
height="8"
x="12"
y="24"
fill="#E9EFF5"
rx="1"
/>
<rect
width="312"
height="291"
x="12.5"
y="56.5"
fill="#FFF"
fillRule="nonzero"
stroke="#E9EFF5"
rx="4"
/>
<rect
width="130"
height="8"
x="24"
y="127"
fill="#E9EFF5"
rx="1"
/>
<rect width="20" height="20" x="53" y="152" fill="#E9EFF5" />
<rect width="20" height="20" x="53" y="264" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="152" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="180" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="208" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="236" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="264" fill="#E9EFF5" />
<rect width="20" height="20" x="53" y="236" fill="#E9EFF5" />
<rect width="20" height="20" x="53" y="180" fill="#E9EFF5" />
<rect width="20" height="20" x="53" y="208" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="151" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="152" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="236" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="180" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="208" fill="#E9EFF5" />
<rect width="20" height="20" x="95" y="152" fill="#E9EFF5" />
<rect width="20" height="20" x="95" y="236" fill="#E9EFF5" />
<rect width="20" height="20" x="95" y="180" fill="#E9EFF5" />
<rect width="20" height="20" x="116" y="180" fill="#E9EFF5" />
<rect
width="105"
height="39"
x="24.5"
y="296.5"
fill="#FFF"
stroke="#E9EFF5"
rx="2"
/>
<rect
width="175"
height="40"
x="138"
y="296"
fill="#E9EFF5"
rx="2"
/>
<path
fill="#FAFCFF"
d="M16,57 L321,57 C322.656854,57 324,58.3431458 324,60 L324,111 L13,111 L13,60 C13,58.3431458 14.3431458,57 16,57 Z"
/>
<rect
width="21"
height="8"
x="25"
y="71"
fill="#E9EFF5"
rx="1"
/>
<rect
width="109"
height="8"
x="78"
y="71"
fill="#E9EFF5"
rx="1"
/>
<rect
width="85"
height="8"
x="78"
y="89"
fill="#E9EFF5"
rx="1"
/>
<rect width="311" height="1" x="13" y="110" fill="#E9EFF5" />
<rect
width="312"
height="291"
x="337.5"
y="56.5"
fill="#FFF"
fillRule="nonzero"
stroke="#E9EFF5"
rx="4"
/>
<rect
width="130"
height="8"
x="349"
y="127"
fill="#E9EFF5"
rx="1"
/>
<rect width="20" height="20" x="378" y="152" fill="#E9EFF5" />
<rect width="20" height="20" x="378" y="264" fill="#E9EFF5" />
<rect width="20" height="20" x="349" y="152" fill="#E9EFF5" />
<rect width="20" height="20" x="349" y="180" fill="#E9EFF5" />
<rect width="20" height="20" x="349" y="208" fill="#E9EFF5" />
<rect width="20" height="20" x="349" y="236" fill="#E9EFF5" />
<rect width="20" height="20" x="349" y="264" fill="#E9EFF5" />
<rect width="20" height="20" x="378" y="236" fill="#E9EFF5" />
<rect width="20" height="20" x="378" y="180" fill="#E9EFF5" />
<rect width="20" height="20" x="378" y="208" fill="#E9EFF5" />
<rect width="20" height="20" x="399" y="151" fill="#E9EFF5" />
<rect width="20" height="20" x="399" y="152" fill="#E9EFF5" />
<rect width="20" height="20" x="399" y="236" fill="#E9EFF5" />
<rect width="20" height="20" x="399" y="180" fill="#E9EFF5" />
<rect width="20" height="20" x="399" y="208" fill="#E9EFF5" />
<rect width="20" height="20" x="420" y="152" fill="#E9EFF5" />
<rect width="20" height="20" x="420" y="236" fill="#E9EFF5" />
<rect width="20" height="20" x="420" y="180" fill="#E9EFF5" />
<rect width="20" height="20" x="441" y="180" fill="#E9EFF5" />
<rect
width="105"
height="39"
x="349.5"
y="296.5"
fill="#FFF"
stroke="#E9EFF5"
rx="2"
/>
<rect
width="175"
height="40"
x="463"
y="296"
fill="#E9EFF5"
rx="2"
/>
<path
fill="#FAFCFF"
d="M341,57 L646,57 C647.656854,57 649,58.3431458 649,60 L649,111 L338,111 L338,60 C338,58.3431458 339.343146,57 341,57 Z"
/>
<rect
width="21"
height="8"
x="350"
y="71"
fill="#E9EFF5"
rx="1"
/>
<rect
width="109"
height="8"
x="403"
y="71"
fill="#E9EFF5"
rx="1"
/>
<rect
width="85"
height="8"
x="403"
y="89"
fill="#E9EFF5"
rx="1"
/>
<rect width="311" height="1" x="338" y="110" fill="#E9EFF5" />
</g>
</g>
) : (
<g fill="none" fillRule="evenodd" transform="translate(-53 -602)">
<rect width="1391" height="2692" fill="#E9EFF5" />
<g transform="translate(53 602)">
<rect
width="1032"
height="352"
fill="#FFF"
fillRule="nonzero"
/>
<rect
width="291"
height="291"
x="12.5"
y="48.5"
fill="#FFF"
fillRule="nonzero"
stroke="#E9EFF5"
rx="4"
/>
<rect
width="130"
height="8"
x="24"
y="119"
fill="#E9EFF5"
rx="1"
/>
<rect
width="90"
height="8"
x="12"
y="21"
fill="#E9EFF5"
rx="1"
/>
<rect width="20" height="20" x="53" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="53" y="256" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="24" y="256" fill="#E9EFF5" />
<rect width="20" height="20" x="53" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="53" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="53" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="143" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="74" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="95" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="95" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="95" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="116" y="172" fill="#E9EFF5" />
<rect
width="90"
height="39"
x="24.5"
y="288.5"
fill="#FFF"
stroke="#E9EFF5"
rx="2"
/>
<rect
width="169"
height="40"
x="123"
y="288"
fill="#E9EFF5"
rx="2"
/>
<path
fill="#FAFCFF"
d="M16,49 L300,49 C301.656854,49 303,50.3431458 303,52 L303,103 L13,103 L13,52 C13,50.3431458 14.3431458,49 16,49 Z"
/>
<rect width="290" height="1" x="13" y="102" fill="#E9EFF5" />
<rect
width="21"
height="8"
x="25"
y="63"
fill="#E9EFF5"
rx="1"
/>
<rect
width="109"
height="8"
x="78"
y="63"
fill="#E9EFF5"
rx="1"
/>
<rect
width="85"
height="8"
x="78"
y="81"
fill="#E9EFF5"
rx="1"
/>
<rect
width="291"
height="291"
x="312.5"
y="48.5"
fill="#FFF"
fillRule="nonzero"
stroke="#E9EFF5"
rx="4"
/>
<rect
width="130"
height="8"
x="324"
y="119"
fill="#E9EFF5"
rx="1"
/>
<rect width="20" height="20" x="353" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="353" y="256" fill="#E9EFF5" />
<rect width="20" height="20" x="324" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="324" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="324" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="324" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="324" y="256" fill="#E9EFF5" />
<rect width="20" height="20" x="353" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="353" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="353" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="374" y="143" fill="#E9EFF5" />
<rect width="20" height="20" x="374" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="374" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="374" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="374" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="395" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="395" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="395" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="416" y="172" fill="#E9EFF5" />
<rect
width="90"
height="39"
x="324.5"
y="288.5"
fill="#FFF"
stroke="#E9EFF5"
rx="2"
/>
<rect
width="169"
height="40"
x="423"
y="288"
fill="#E9EFF5"
rx="2"
/>
<path
fill="#FAFCFF"
d="M316,49 L600,49 C601.656854,49 603,50.3431458 603,52 L603,103 L313,103 L313,52 C313,50.3431458 314.343146,49 316,49 Z"
/>
<rect width="290" height="1" x="313" y="102" fill="#E9EFF5" />
<rect
width="21"
height="8"
x="325"
y="63"
fill="#E9EFF5"
rx="1"
/>
<rect
width="109"
height="8"
x="378"
y="63"
fill="#E9EFF5"
rx="1"
/>
<rect
width="85"
height="8"
x="378"
y="81"
fill="#E9EFF5"
rx="1"
/>
<rect
width="291"
height="291"
x="612.5"
y="48.5"
fill="#FFF"
fillRule="nonzero"
stroke="#E9EFF5"
rx="4"
/>
<rect
width="130"
height="8"
x="624"
y="119"
fill="#E9EFF5"
rx="1"
/>
<rect width="20" height="20" x="653" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="653" y="256" fill="#E9EFF5" />
<rect width="20" height="20" x="624" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="624" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="624" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="624" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="624" y="256" fill="#E9EFF5" />
<rect width="20" height="20" x="653" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="653" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="653" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="674" y="143" fill="#E9EFF5" />
<rect width="20" height="20" x="674" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="674" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="674" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="674" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="695" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="695" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="695" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="716" y="172" fill="#E9EFF5" />
<rect
width="90"
height="39"
x="624.5"
y="288.5"
fill="#FFF"
stroke="#E9EFF5"
rx="2"
/>
<rect
width="169"
height="40"
x="723"
y="288"
fill="#E9EFF5"
rx="2"
/>
<path
fill="#FAFCFF"
d="M616,49 L900,49 C901.656854,49 903,50.3431458 903,52 L903,103 L613,103 L613,52 C613,50.3431458 614.343146,49 616,49 Z"
/>
<rect width="290" height="1" x="613" y="102" fill="#E9EFF5" />
<rect
width="21"
height="8"
x="625"
y="63"
fill="#E9EFF5"
rx="1"
/>
<rect
width="109"
height="8"
x="678"
y="63"
fill="#E9EFF5"
rx="1"
/>
<rect
width="85"
height="8"
x="678"
y="81"
fill="#E9EFF5"
rx="1"
/>
<rect
width="291"
height="291"
x="912.5"
y="48.5"
fill="#FFF"
fillRule="nonzero"
stroke="#E9EFF5"
rx="4"
/>
<rect
width="130"
height="8"
x="924"
y="119"
fill="#E9EFF5"
rx="1"
/>
<rect width="20" height="20" x="953" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="953" y="256" fill="#E9EFF5" />
<rect width="20" height="20" x="924" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="924" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="924" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="924" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="924" y="256" fill="#E9EFF5" />
<rect width="20" height="20" x="953" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="953" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="953" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="974" y="143" fill="#E9EFF5" />
<rect width="20" height="20" x="974" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="974" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="974" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="974" y="200" fill="#E9EFF5" />
<rect width="20" height="20" x="995" y="144" fill="#E9EFF5" />
<rect width="20" height="20" x="995" y="228" fill="#E9EFF5" />
<rect width="20" height="20" x="995" y="172" fill="#E9EFF5" />
<rect width="20" height="20" x="1016" y="172" fill="#E9EFF5" />
<rect
width="90"
height="39"
x="924.5"
y="288.5"
fill="#FFF"
stroke="#E9EFF5"
rx="2"
/>
<rect
width="169"
height="40"
x="1023"
y="288"
fill="#E9EFF5"
rx="2"
/>
<path
fill="#FAFCFF"
d="M916,49 L1200,49 C1201.65685,49 1203,50.3431458 1203,52 L1203,103 L913,103 L913,52 C913,50.3431458 914.343146,49 916,49 Z"
/>
<rect width="290" height="1" x="913" y="102" fill="#E9EFF5" />
<rect
width="21"
height="8"
x="925"
y="63"
fill="#E9EFF5"
rx="1"
/>
<rect
width="109"
height="8"
x="978"
y="63"
fill="#E9EFF5"
rx="1"
/>
<rect
width="85"
height="8"
x="978"
y="81"
fill="#E9EFF5"
rx="1"
/>
</g>
</g>
)}
</SVG>
</SVGContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/ScrollArea/styled-components.js
import styled, { css } from "styled-components";
export default styled.div`
overflow: hidden;
${({ isDesktop }) =>
isDesktop
? css`
${({ contextSA }) =>
contextSA === "topraces"
? css`
margin: 12px 12px 0 12px;
`
: css`
margin: 0 12px;
`};
`
: css`
width: 100%;
`};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/ScrollArea/index.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import ReactIdSwiper from "react-id-swiper";
import ContainerLimits from "./styled-components";
export default class ScrollArea extends PureComponent {
static defaultProps = {
setSwiper: noop,
hasPagination: false,
cardsPerPage: 3,
contextSA: "topraces",
isFreeScroll: false
};
computeParams = () => {
if (!this.props.hasPagination)
return {
slidesPerView: "auto",
watchSlidesVisibility: true,
pagination: {
hide: true
},
shouldSwiperUpdate: true,
autoHeight: true,
freeMode: this.props.isFreeScroll
};
return {
slidesPerView: this.props.cardsPerPage,
spaceBetween: this.props.contextSA !== "talentpicks" ? 11 : 16,
watchSlidesVisibility: true,
pagination: {
hide: true
},
shouldSwiperUpdate: true
};
};
// this is a hack, we need to access the swiper component inside the swiper id component,
// but isn't ready when we receive the ref
setSwiperRef = (node) =>
setTimeout(
() => node && node.swiper && this.props.setSwiper(node.swiper),
100
);
render() {
const params = this.computeParams();
return (
<ContainerLimits
isDesktop={this.props.hasPagination}
data-qa-label="top-races-scrollAreaContainer"
contextSA={this.props.contextSA}
>
<div>
<ReactIdSwiper {...params} ref={this.setSwiperRef}>
{this.props.children}
</ReactIdSwiper>
</div>
</ContainerLimits>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/Pagination/styled-components.js
import styled, { css } from "styled-components";
import { buildText } from "../../_atom/Text";
import DefaultButton from "../../_atom/Buttons/default";
import buildColor from "../../_static/ColorPalette";
import { fontNormal } from "../../_static/Typography";
import Icon from "../../_static/Icons";
export const PaginationWrapper = styled.nav`
display: flex;
justify-content: space-between;
align-items: center;
${(props) => {
let returnCSS = "";
switch (props.theme) {
case "tutorials":
returnCSS = css`
margin-top: 22px;
& > button {
min-width: 60px;
text-transform: uppercase;
background-color: ${buildColor("white", "0")};
&:first-child {
text-align: left;
}
svg {
fill: ${buildColor("blue_accent", "500")};
}
}
`;
break;
case "topRaces":
returnCSS = css`
max-width: 64px;
border: 1px solid ${buildColor("blue", "100")};
background-color: ${buildColor("blue_accent", "000")};
border-radius: 4px;
&:hover {
cursor: pointer;
}
& > button {
background-color: ${buildColor("white", "0")};
width: 32px;
height: 32px;
padding: 8px;
svg {
fill: ${buildColor("blue_accent", "500")};
}
&:hover {
background-color: ${buildColor("blue_accent", "100")};
}
}
`;
break;
default:
returnCSS = css`
background-color: ${buildColor("white", "0")};
padding: 8px 12px;
padding-bottom: calc(constant(safe-area-inset-bottom) + 8px);
padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
& > button {
background-color: ${buildColor("white", "0")};
min-width: 40px;
height: 40px;
&:first-child:active,
:last-child:active {
background-color: ${buildColor("blue", "100")};
}
}
`;
break;
}
return returnCSS;
}};
`;
export const PaginationBullet = styled.span`
background-color: ${(props) =>
props.active
? buildColor("blue_accent", "500")
: buildColor("blue_accent", "100")};
width: 8px;
height: 8px;
border-radius: 50%;
padding: 0;
margin-right: 8px;
`;
export const PagesWrapper = styled.div`
display: flex;
justify-content: center;
`;
export const TopRacesButtonDefault = styled(DefaultButton)`
border: none;
margin: 0;
`;
export const NextWrapper = styled.span`
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: row;
color: ${buildColor("blue_accent", "500")};
font-weight: bold;
`;
export const NavigationWrapper = styled.span`
min-width: 80px;
display: flex;
justify-content: ${({ alignRight }) =>
alignRight ? "flex-end" : "flex-start"};
align-items: center;
font-size: 12px;
line-height: 17px;
${({ isHidden }) =>
isHidden &&
css`
visibility: hidden;
`}
`;
export const WordWrapper = styled.span`
font-family: ${fontNormal};
padding: 0 8px;
`;
export const SelectorContainer = styled.div`
width: 98px;
height: 32px;
overflow: hidden;
flex: 0 0 auto;
margin: 0 8px;
border: 1px solid ${buildColor("blue", "100")};
box-sizing: border-box;
box-shadow:
0 2px 4px rgb(17 43 68 / 6%),
0 1px 2px rgb(17 43 68 / 8%);
border-radius: 4px;
position: relative;
`;
export const LabelsWrapper = styled(
buildText({
tag: "span",
fontSize: 14,
color: buildColor("grey", "900"),
ellipsis: true
})
)`
padding: 6px 32px 6px 8px;
line-height: 18px;
width: 100%;
height: 32px;
display: flex;
align-items: center;
justify-content: flex-start;
`;
export const PageSelected = styled(
buildText({
tag: "span",
fontSize: 14,
color: buildColor("grey", "900")
})
)`
line-height: 19px;
font-weight: 500;
vertical-align: baseline;
`;
export const SelectIcon = styled(Icon)`
position: absolute;
right: 8px;
top: 50%;
transform: translate(0, -50%);
`;
export const SelectList = styled.select.attrs({
"data-qa-label": "pageSelector"
})`
opacity: 0;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 1;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/Pagination/index.jsx
import React, { PureComponent, Fragment } from "react";
import { noop } from "lodash";
import Icon from "../../_static/Icons";
import buildColor from "../../_static/ColorPalette";
import { arrowBack, arrowForward, arrowDown } from "../../_static/Icons/icons";
import DefaultButton from "../../_atom/Buttons/default";
import {
PaginationWrapper,
TopRacesButtonDefault,
PagesWrapper,
NextWrapper,
WordWrapper,
NavigationWrapper,
PaginationBullet,
SelectList,
SelectorContainer,
LabelsWrapper,
PageSelected,
SelectIcon
} from "./styled-components";
export default class Pagination extends PureComponent {
static defaultProps = {
pageSelected: 1,
totalPages: 1,
onBackPage: noop,
onForwardPage: noop,
onSelectPage: undefined,
theme: "default",
className: "",
qaLabel: "pagination",
isBackDisabled: false,
isForwardDisabled: false,
isLabelsShown: false
};
defaultPaginationRender = () => {
const {
theme,
onBackPage,
pageSelected,
onSelectPage,
onForwardPage,
totalPages,
isLabelsShown
} = this.props;
return (
<PaginationWrapper
theme={theme}
className={this.props.className}
data-qa-label={this.props.qaLabel}
>
<DefaultButton
onClick={onBackPage}
isDisabled={pageSelected === 1}
qaLabel="previous-page-button"
>
{isLabelsShown ? (
<NavigationWrapper isHidden={pageSelected === 1}>
<Icon icon={arrowBack} />
<WordWrapper>Previous</WordWrapper>
</NavigationWrapper>
) : (
<Icon icon={arrowBack} />
)}
</DefaultButton>
<PagesWrapper>
{onSelectPage ? (
this.renderButtons()
) : (
<Fragment>
<strong>{pageSelected}</strong> of
<strong>{totalPages}</strong>
</Fragment>
)}
</PagesWrapper>
<DefaultButton
onClick={onForwardPage}
isDisabled={pageSelected === totalPages}
qaLabel="next-page-button"
>
{isLabelsShown ? (
<NavigationWrapper
isHidden={pageSelected === totalPages}
alignRight
>
<WordWrapper>Next</WordWrapper>
<Icon icon={arrowForward} />
</NavigationWrapper>
) : (
<Icon icon={arrowForward} />
)}
</DefaultButton>
</PaginationWrapper>
);
};
topRacesPaginationRender = () => (
<PaginationWrapper
theme={this.props.theme}
className={this.props.className}
data-qa-label={this.props.qaLabel}
>
<TopRacesButtonDefault
onClick={this.props.onBackPage}
isDisabled={this.props.isBackDisabled}
size={16}
qaLabel="pagination-previousButton"
>
<Icon icon={arrowBack} />
</TopRacesButtonDefault>
<TopRacesButtonDefault
onClick={this.props.onForwardPage}
isDisabled={this.props.isForwardDisabled}
size={16}
qaLabel="pagination-forwardButton"
>
<Icon icon={arrowForward} />
</TopRacesButtonDefault>
</PaginationWrapper>
);
tutorialsPaginationRender = () => {
const { theme, onBackPage, pageSelected, onForwardPage, totalPages } =
this.props;
return (
<PaginationWrapper
theme={theme}
className={this.props.className}
data-qa-label={this.props.qaLabel}
>
<DefaultButton
onClick={onBackPage}
isDisabled={pageSelected === 1}
qaLabel="pagination-previousButton"
>
<Icon icon={arrowBack} />
</DefaultButton>
{pageSelected !== totalPages && (
<Fragment>
<PagesWrapper>{this.renderButtons()}</PagesWrapper>
<DefaultButton
onClick={onForwardPage}
isDisabled={pageSelected === totalPages}
qaLabel="pagination-nextButton"
>
<NextWrapper>
<WordWrapper>NEXT</WordWrapper>
<Icon icon={arrowForward} />
</NextWrapper>
</DefaultButton>
</Fragment>
)}
</PaginationWrapper>
);
};
renderButtons = () => {
const { theme, totalPages, pageSelected, onSelectPage } = this.props;
if (theme === "tutorials") {
const buttonsArray = [];
for (let i = 1; i <= totalPages; i += 1) {
buttonsArray.push(
<PaginationBullet key={`wbp-${i}`} active={pageSelected === i} />
);
}
return <Fragment>{buttonsArray}</Fragment>;
}
return (
<SelectorContainer>
<LabelsWrapper>
<PageSelected data-qa-label="pageSelected">
{pageSelected}
</PageSelected>
{`of ${totalPages}`}
</LabelsWrapper>
<SelectList
onChange={(event) => {
if (onSelectPage) onSelectPage(+event.target.value);
}}
value={pageSelected}
>
<option value="select-page" disabled>
Select Page
</option>
{Array.from(Array(totalPages), (_, i) => i + 1).map((page) => (
<option key={`page-${page}`} value={page}>
{page}
</option>
))}
</SelectList>
<SelectIcon icon={arrowDown} color={buildColor("grey", "900")} />
</SelectorContainer>
);
};
render() {
const { theme } = this.props;
let returnRender;
switch (theme) {
case "tutorials":
returnRender = this.tutorialsPaginationRender();
break;
case "topRaces":
returnRender = this.topRacesPaginationRender();
break;
default:
returnRender = this.defaultPaginationRender();
break;
}
return returnRender;
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/MagnetScrollArea/styled-components.js
import styled from "styled-components"; export default styled.div` padding: 12px 12px 0; display: flex; justify-content: flex-end; `;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/MagnetScrollArea/index.jsx
import React, { Component, Fragment } from "react";
import { noop, get } from "lodash";
import ScrollArea from "../../_static/ScrollArea";
import Pagination from "../../_molecule/Pagination";
import PaginationArea from "./styled-components";
export default class MagnetScrollArea extends Component {
static defaultProps = {
hasPagination: false,
onHandleTransition: noop,
children: [],
activeIndex: 0,
isLoading: false,
cardsPerPage: 3,
contextSA: "topraces",
isFreeScroll: false,
isRunnerScroll: false,
hasTouchMove: true
};
constructor(props) {
super(props);
this.state = {
isNextRacesButtonInactive:
get(this.props, "children[0].length", 0) <= this.props.cardsPerPage - 1,
isPreviousRacesButtonInactive: true
};
if (typeof window !== "undefined") {
window.addEventListener("updateResizableArea", this.updateSwiper);
}
}
componentDidUpdate(prevProps) {
if (
this.props.activeIndex !== prevProps.activeIndex &&
!this.swiper.animating &&
this.props.activeIndex !== null
) {
this.swiper.slideTo(
this.props.activeIndex,
this.props.isRunnerScroll ? 500 : 0
);
}
if (
get(this.props, "children[0]?.length") !==
get(prevProps, "children[0]?.length")
) {
this.updatePaginationState();
}
}
componentWillUnmount() {
if (typeof window !== "undefined") {
window.removeEventListener("updateResizableArea", this.updateSwiper);
}
}
setSwiper = (swiper) => {
this.swiper = swiper;
// This verification aims to prevent a bug where a stack of event listeners
// was being created and causing
// multiple triggers
if (!get(this.swiper, "eventsListeners.transitionEnd")) {
this.swiper.on("transitionEnd", () =>
this.props.onHandleTransition(swiper.activeIndex)
);
}
this.swiper.autoHeight = !this.props.isFreeScroll;
this.swiper.freeMode = this.props.isFreeScroll;
this.swiper.freeModeMomentumBounce = false;
this.swiper.slideToClickedSlide = true;
if (!this.props.hasTouchMove) {
this.swiper.allowTouchMove = false;
}
if (this.props.hasPagination) {
this.swiper.allowTouchMove = false;
}
if (this.props.hasPagination) {
this.updatePaginationState();
}
if (!this.swiper.animating) {
this.swiper.slideTo(
this.props.activeIndex,
this.props.isRunnerScroll ? 500 : 0
);
}
};
updateSwiper = () => {
if (this.swiper) {
this.swiper.updateAutoHeight(200, false);
}
};
swiper;
showNextCards = () => {
this.swiper.slideTo(this.swiper.activeIndex + this.props.cardsPerPage, 500);
this.updatePaginationState();
};
showPreviousCards = () => {
this.swiper.slideTo(this.swiper.activeIndex - this.props.cardsPerPage, 500);
this.updatePaginationState();
};
// A magnet scroll area will always require a last element
// That's why this.props.children needs to be decoupled
updatePaginationState = () => {
this.setState({
isNextRacesButtonInactive:
this.swiper.activeIndex + this.props.cardsPerPage >=
get(this.props, "children[0].length", 0) + 1,
isPreviousRacesButtonInactive: this.swiper.activeIndex === 0
});
};
render() {
return (
<Fragment>
{this.props.hasPagination && (
<PaginationArea data-qa-label="top-races-paginationArea">
<Pagination
theme="topRaces"
onForwardPage={this.showNextCards}
onBackPage={this.showPreviousCards}
isForwardDisabled={this.state.isNextRacesButtonInactive}
isBackDisabled={this.state.isPreviousRacesButtonInactive}
/>
</PaginationArea>
)}
<ScrollArea
data-qa-label="top-races-scrollableArea"
hasPagination={this.props.hasPagination}
contextSA={this.props.contextSA}
setSwiper={this.setSwiper}
cardsPerPage={this.props.cardsPerPage}
isFreeScroll={this.props.isFreeScroll}
>
{this.props.children}
</ScrollArea>
</Fragment>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/TalentPicksList/index.jsx
import React, { PureComponent, Fragment } from "react";
import { get, noop } from "lodash";
import { isTvg5 } from "@tvg/utils/generalUtils";
import TalentPicksCard from "@urp/talent-picks/src/components/TalentPicksCard";
import MessageBox from "../../_molecule/MessageBox";
import LiveButtonsGroup from "../../_organism/LiveButtonsGroup";
import TalentPickCard from "../../_organism/TalentPickCard";
import TalentPickFilter from "../../_organism/TalentPickFilter";
import ButtonLink from "../../_atom/Buttons/buttonLink";
import Icon from "../../_static/Icons";
import { video } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import RedirectCard from "../../_molecule/RedirectCard";
import {
TalentPicksContainer,
NewButton,
MessageContainer,
WatchLiveButtonWrapper,
WatchLiveLabel,
PicksWrapper,
Title,
TalentPickWrapper,
TitleContainer,
RedirectLink,
RedirectLinkDesktop
} from "./styled-components";
import TalentPickCardMask from "../../_static/Masks/talent-pick-card";
import MagnetScrollArea from "../MagnetScrollArea";
export default class TalentPicksList extends PureComponent {
static defaultProps = {
talentPickList: [],
isRaceList: false,
hideOnPickWager: false,
buttons: [],
onPublishToggle: null,
onNewPick: null,
context: "mep",
tvg1Link: null,
tvg2Link: null,
imageBaseURL: "//www.tvg.com",
showButtonsCallBack: () => true,
enableLiveButtons: false,
onProgramPage: false,
onHomePage: false,
talentsFilter: [],
onFilterClick: noop,
device: "mobile",
activeFilters: [],
picksAlertsToggle: false,
enableTalentFilter: false,
filterEmptyStateMessage: "",
hasAlerts: false,
onSeeAllSelections: null,
isLoading: false,
title: "Talent Picks",
onRedirectTalentPage: noop,
onClickHeader: noop,
onHandleTransition: noop,
activeIndex: 0,
onModalDesktop: false,
talentPicksOnHomepageToggle: false,
talentPicksPageMsgs: {},
triggerCTAClickedAmplitudeEvent: noop
};
talentPicksRef = React.createRef();
constructor(props) {
super(props);
this.state = {
context: typeof this.props.onNewPick === "function" ? "tool" : "app",
talentPicksWidth: 0
};
}
componentDidMount() {
this.handleResize();
if (window !== "undefined") {
window.addEventListener("resize", this.handleResize);
}
}
componentWillUnmount() {
window.removeEventListener("resize", this.handleResize);
}
handleResize = () => {
if (this.talentPicksRef.current) {
this.setState({
talentPicksWidth: this.talentPicksRef.current.clientWidth / 2
});
}
};
createTalentPickCards = () => {
const insideTvg5 = isTvg5();
const bettingBtn = this.props.buttons.find((button) =>
button.type.includes("bet")
);
return this.props.talentPickList.map((talentPick) =>
!this.props.onHomePage ? (
<TalentPickCard
key={`talent-pick-${get(talentPick, "id", "tp")}`}
talentPick={talentPick}
isRacePick={this.props.isRaceList}
buttons={this.props.buttons}
onPublishToggle={this.props.onPublishToggle}
imageBaseURL={this.props.imageBaseURL}
showButtonsCallBack={this.props.showButtonsCallBack}
isDesktop={this.props.device === "desktop"}
onSeeAllSelections={this.props.onSeeAllSelections}
isHorizontalLayout={this.props.onHomePage}
onClickHeader={this.props.onClickHeader}
/>
) : (
<TalentPickWrapper
key={`talentPick-${talentPick.id}`}
isDesktop={this.props.device === "desktop"}
talentPickWrapperWidth={this.state.talentPicksWidth}
isTvg5={insideTvg5}
>
{insideTvg5 && this.props.talentPicksOnHomepageToggle ? (
<TalentPicksCard
talentPick={talentPick}
onHomePage={this.props.onHomePage}
bettingBtn={bettingBtn}
showAddToBetslipButton
/>
) : (
<TalentPickCard
key={`talent-pick-${get(talentPick, "id", "tp")}`}
talentPick={talentPick}
isRacePick={this.props.isRaceList}
buttons={this.props.buttons}
onPublishToggle={this.props.onPublishToggle}
imageBaseURL={this.props.imageBaseURL}
showButtonsCallBack={this.props.showButtonsCallBack}
isDesktop={this.props.device === "desktop"}
onSeeAllSelections={this.props.onSeeAllSelections}
isHorizontalLayout={this.props.onHomePage}
onClickHeader={this.props.onClickHeader}
/>
)}
</TalentPickWrapper>
)
);
};
createRedirectCard = () => (
<TalentPickWrapper
key="talentPick-lastCard"
isLastCard
isDesktop={this.props.device === "desktop"}
talentPickWrapperWidth={this.state.talentPicksWidth}
isTvg5={isTvg5()}
>
<RedirectCard
isDesktop={this.props.device === "desktop"}
text="see all picks"
url="/handicapping/talent-picks"
onClick={(event, url) => {
if (this.props.device === "desktop") {
event.preventDefault();
}
this.props.onRedirectTalentPage(url);
if (
this.props.triggerCTAClickedAmplitudeEvent &&
typeof this.props.triggerCTAClickedAmplitudeEvent === "function"
) {
this.props.triggerCTAClickedAmplitudeEvent();
}
}}
qaLabel="seeAllCard"
/>
</TalentPickWrapper>
);
renderPicks(renderFilter) {
const emptyMessages = {
app: "No TVG picks are currently available",
tool: "No picks are currently available. Start inspiring your fans!",
hidden: "Talent Picks are only offered in the 1st leg of this wager"
};
const endOfListMessage = `You reached the end of the talent list.\nWatch FDTV now from your device for today's racing brought to you by TVG's team of expert analysts.`;
const hasBottomMessageBox =
this.props.enableLiveButtons &&
(this.props.tvg1Link || this.props.tvg2Link);
const emptyStateTitle = this.props.tvg1Link
? "No TVG Picks available."
: "";
emptyMessages.app = this.props.enableLiveButtons
? emptyStateTitle
: emptyMessages.app;
const liveMessage = hasBottomMessageBox
? "Watch FDTV now from your device for today's racing brought to you by TVG's team of expert analysts."
: "No TVG picks are currently available.";
const EmptyStateComponent =
this.props.enableLiveButtons && !this.props.onProgramPage ? (
<Fragment>
<MessageContainer isFilterEnabled={renderFilter}>
<MessageBox
title={
this.props.hideOnPickWager
? emptyMessages.hidden
: emptyMessages[this.state.context]
}
type="info"
message={liveMessage}
hasIcon
isVertical
/>
<LiveButtonsGroup
className="liveButtonsWrapper"
tvg1Link={this.props.tvg1Link}
tvg2Link={this.props.tvg2Link}
/>
</MessageContainer>
</Fragment>
) : (
<MessageBox
type="info"
message={
this.props.hideOnPickWager
? emptyMessages.hidden
: emptyMessages[this.state.context]
}
hasIcon
isVertical
/>
);
return this.props.talentPickList.length && !this.props.hideOnPickWager ? (
<Fragment>
{this.createTalentPickCards()}
{hasBottomMessageBox &&
!this.props.onProgramPage &&
!this.props.onHomePage && (
<MessageBox
className="talentPicksWatchLiveBox"
type="infoWhiteBackground"
message={endOfListMessage}
hasIcon
hasBorderBottom
hasBorderTop
hasMarginTop
hasMarginBottom
>
<WatchLiveButtonWrapper>
{this.props.tvg1Link && (
<ButtonLink
url={get(this.props, "tvg1Link")}
type="secondary"
qaLabel="tvg1-link-button"
>
<Icon
icon={video}
size={16}
color={buildColor("grey", "900")}
qaLabel="tvg1-link-button-icon"
/>
<WatchLiveLabel>Watch FanDuel TV</WatchLiveLabel>
</ButtonLink>
)}
{this.props.tvg2Link && (
<ButtonLink
url={get(this.props, "tvg2Link")}
type="secondary"
className="tvg2Button"
qaLabel="tvg2-link-button"
>
<Icon
icon={video}
size={16}
color={buildColor("grey", "900")}
qaLabel="tvg2-link-button-icon"
/>
<WatchLiveLabel>Watch FanDuel Racing</WatchLiveLabel>
</ButtonLink>
)}
</WatchLiveButtonWrapper>
</MessageBox>
)}
</Fragment>
) : (
EmptyStateComponent
);
}
render() {
const isEmpty =
!this.props.talentPickList.length || this.props.hideOnPickWager;
const onTool = this.state.context === "tool";
const renderFilter =
(this.props.hasAlerts && this.props.picksAlertsToggle) ||
(this.props.enableTalentFilter && this.props.talentsFilter.length > 0);
return this.props.isLoading ? (
<TalentPickCardMask isDesktop={this.props.device === "desktop"} />
) : (
<TalentPicksContainer
ref={this.talentPicksRef}
isFilterEnabled={this.props.enableTalentFilter}
hideOnPickWager={this.props.hideOnPickWager}
hasNewButton={onTool}
data-qa-label="talentPicks"
isOnProgramPage={this.props.onProgramPage}
isOnTool={onTool}
isEmpty={isEmpty}
isHorizontalLayout={this.props.onHomePage}
isDesktop={this.props.device === "desktop"}
>
{!this.props.onProgramPage &&
!this.props.onHomePage &&
renderFilter && (
<TalentPickFilter
enableTalentFilter={this.props.enableTalentFilter}
onClick={this.props.onFilterClick}
imageBaseURL={this.props.imageBaseURL}
hasAlerts={this.props.hasAlerts}
talents={this.props.talentsFilter}
activeFilters={this.props.activeFilters}
device={this.props.device}
picksAlertsToggle={this.props.picksAlertsToggle}
filterEmptyStateMessage={this.props.filterEmptyStateMessage}
/>
)}
{this.props.onHomePage && (
<TitleContainer isDesktop={this.props.device === "desktop"}>
<Title
data-qa-label="title"
isDesktop={this.props.device === "desktop"}
>
{this.props.onHomePage
? this.props.talentPicksPageMsgs?.title
: this.props.title}
</Title>
{this.props.device !== "desktop" || isTvg5() ? (
<RedirectLink
to="/handicapping/talent-picks"
onClick={this.props.triggerCTAClickedAmplitudeEvent}
>
See all
</RedirectLink>
) : (
<RedirectLinkDesktop
onClick={(e) => {
e.preventDefault();
this.props.onRedirectTalentPage("/handicapping/talent-picks");
}}
>
See all
</RedirectLinkDesktop>
)}
</TitleContainer>
)}
{!this.props.onHomePage ? (
<PicksWrapper
isHorizontalLayout={this.props.onHomePage}
isEmpty={isEmpty}
isOnProgramPage={this.props.onProgramPage}
isOnTool={onTool}
isOnHomePage={!!this.props.onHomePage}
onModalDesktop={this.props.onModalDesktop}
>
{this.renderPicks(renderFilter)}
</PicksWrapper>
) : (
<MagnetScrollArea
hasPagination={this.props.device === "desktop"}
onHandleTransition={this.props.onHandleTransition}
activeIndex={this.props.activeIndex}
isLoading={this.props.isLoading}
cardsPerPage={2}
contextSA="talentpicks"
>
{this.createTalentPickCards()}
{this.createRedirectCard()}
</MagnetScrollArea>
)}
{onTool && (
<NewButton qaLabel="new-pick-button" onClick={this.props.onNewPick}>
NEW PICK
</NewButton>
)}
</TalentPicksContainer>
);
}
}
webpack://frontend-tpt/../../node_modules/@wry/caches/lib/weak.js
function noop() { }
const defaultDispose = noop;
const _WeakRef = typeof WeakRef !== "undefined"
? WeakRef
: function (value) {
return { deref: () => value };
};
const _WeakMap = typeof WeakMap !== "undefined" ? WeakMap : Map;
const _FinalizationRegistry = typeof FinalizationRegistry !== "undefined"
? FinalizationRegistry
: function () {
return {
register: noop,
unregister: noop,
};
};
const finalizationBatchSize = 10024;
export class WeakCache {
constructor(max = Infinity, dispose = defaultDispose) {
this.max = max;
this.dispose = dispose;
this.map = new _WeakMap();
this.newest = null;
this.oldest = null;
this.unfinalizedNodes = new Set();
this.finalizationScheduled = false;
this.size = 0;
this.finalize = () => {
const iterator = this.unfinalizedNodes.values();
for (let i = 0; i < finalizationBatchSize; i++) {
const node = iterator.next().value;
if (!node)
break;
this.unfinalizedNodes.delete(node);
const key = node.key;
delete node.key;
node.keyRef = new _WeakRef(key);
this.registry.register(key, node, node);
}
if (this.unfinalizedNodes.size > 0) {
queueMicrotask(this.finalize);
}
else {
this.finalizationScheduled = false;
}
};
this.registry = new _FinalizationRegistry(this.deleteNode.bind(this));
}
has(key) {
return this.map.has(key);
}
get(key) {
const node = this.getNode(key);
return node && node.value;
}
getNode(key) {
const node = this.map.get(key);
if (node && node !== this.newest) {
const { older, newer } = node;
if (newer) {
newer.older = older;
}
if (older) {
older.newer = newer;
}
node.older = this.newest;
node.older.newer = node;
node.newer = null;
this.newest = node;
if (node === this.oldest) {
this.oldest = newer;
}
}
return node;
}
set(key, value) {
let node = this.getNode(key);
if (node) {
return (node.value = value);
}
node = {
key,
value,
newer: null,
older: this.newest,
};
if (this.newest) {
this.newest.newer = node;
}
this.newest = node;
this.oldest = this.oldest || node;
this.scheduleFinalization(node);
this.map.set(key, node);
this.size++;
return node.value;
}
clean() {
while (this.oldest && this.size > this.max) {
this.deleteNode(this.oldest);
}
}
deleteNode(node) {
if (node === this.newest) {
this.newest = node.older;
}
if (node === this.oldest) {
this.oldest = node.newer;
}
if (node.newer) {
node.newer.older = node.older;
}
if (node.older) {
node.older.newer = node.newer;
}
this.size--;
const key = node.key || (node.keyRef && node.keyRef.deref());
this.dispose(node.value, key);
if (!node.keyRef) {
this.unfinalizedNodes.delete(node);
}
else {
this.registry.unregister(node);
}
if (key)
this.map.delete(key);
}
delete(key) {
const node = this.map.get(key);
if (node) {
this.deleteNode(node);
return true;
}
return false;
}
scheduleFinalization(node) {
this.unfinalizedNodes.add(node);
if (!this.finalizationScheduled) {
this.finalizationScheduled = true;
queueMicrotask(this.finalize);
}
}
}
//# sourceMappingURL=weak.js.map
webpack://frontend-tpt/../../node_modules/@wry/caches/lib/strong.js
function defaultDispose() { }
export class StrongCache {
constructor(max = Infinity, dispose = defaultDispose) {
this.max = max;
this.dispose = dispose;
this.map = new Map();
this.newest = null;
this.oldest = null;
}
has(key) {
return this.map.has(key);
}
get(key) {
const node = this.getNode(key);
return node && node.value;
}
get size() {
return this.map.size;
}
getNode(key) {
const node = this.map.get(key);
if (node && node !== this.newest) {
const { older, newer } = node;
if (newer) {
newer.older = older;
}
if (older) {
older.newer = newer;
}
node.older = this.newest;
node.older.newer = node;
node.newer = null;
this.newest = node;
if (node === this.oldest) {
this.oldest = newer;
}
}
return node;
}
set(key, value) {
let node = this.getNode(key);
if (node) {
return node.value = value;
}
node = {
key,
value,
newer: null,
older: this.newest
};
if (this.newest) {
this.newest.newer = node;
}
this.newest = node;
this.oldest = this.oldest || node;
this.map.set(key, node);
return node.value;
}
clean() {
while (this.oldest && this.map.size > this.max) {
this.delete(this.oldest.key);
}
}
delete(key) {
const node = this.map.get(key);
if (node) {
if (node === this.newest) {
this.newest = node.older;
}
if (node === this.oldest) {
this.oldest = node.newer;
}
if (node.newer) {
node.newer.older = node.older;
}
if (node.older) {
node.older.newer = node.newer;
}
this.map.delete(key);
this.dispose(node.value, key);
return true;
}
return false;
}
}
//# sourceMappingURL=strong.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/caching/caches.js
import { WeakCache, StrongCache } from "@wry/caches";
var scheduledCleanup = new WeakSet();
function schedule(cache) {
if (!scheduledCleanup.has(cache)) {
scheduledCleanup.add(cache);
setTimeout(function () {
cache.clean();
scheduledCleanup.delete(cache);
}, 100);
}
}
/**
* @internal
* A version of WeakCache that will auto-schedule a cleanup of the cache when
* a new item is added.
* Throttled to once per 100ms.
*
* @privateRemarks
* Should be used throughout the rest of the codebase instead of WeakCache,
* with the notable exception of usage in `wrap` from `optimism` - that one
* already handles cleanup and should remain a `WeakCache`.
*/
export var AutoCleanedWeakCache = function (max, dispose) {
/*
Some builds of `WeakCache` are function prototypes, some are classes.
This library still builds with an ES5 target, so we can't extend the
real classes.
Instead, we have to use this workaround until we switch to a newer build
target.
*/
var cache = new WeakCache(max, dispose);
cache.set = function (key, value) {
schedule(this);
return WeakCache.prototype.set.call(this, key, value);
};
return cache;
};
/**
* @internal
* A version of StrongCache that will auto-schedule a cleanup of the cache when
* a new item is added.
* Throttled to once per 100ms.
*
* @privateRemarks
* Should be used throughout the rest of the codebase instead of StrongCache,
* with the notable exception of usage in `wrap` from `optimism` - that one
* already handles cleanup and should remain a `StrongCache`.
*/
export var AutoCleanedStrongCache = function (max, dispose) {
/*
Some builds of `StrongCache` are function prototypes, some are classes.
This library still builds with an ES5 target, so we can't extend the
real classes.
Instead, we have to use this workaround until we switch to a newer build
target.
*/
var cache = new StrongCache(max, dispose);
cache.set = function (key, value) {
schedule(this);
return StrongCache.prototype.set.call(this, key, value);
};
return cache;
};
//# sourceMappingURL=caches.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/caching/sizes.js
import { __assign } from "tslib";
import { global } from "../globals/index.js";
var cacheSizeSymbol = Symbol.for("apollo.cacheSize");
/**
*
* The global cache size configuration for Apollo Client.
*
* @remarks
*
* You can directly modify this object, but any modification will
* only have an effect on caches that are created after the modification.
*
* So for global caches, such as `parser`, `canonicalStringify` and `print`,
* you might need to call `.reset` on them, which will essentially re-create them.
*
* Alternatively, you can set `globalThis[Symbol.for("apollo.cacheSize")]` before
* you load the Apollo Client package:
*
* @example
* ```ts
* globalThis[Symbol.for("apollo.cacheSize")] = {
* parser: 100
* } satisfies Partial<CacheSizes> // the `satisfies` is optional if using TypeScript
* ```
*/
export var cacheSizes = __assign({}, global[cacheSizeSymbol]);
//# sourceMappingURL=sizes.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/caching/getMemoryInternals.js
import { __assign, __spreadArray } from "tslib";
import { cacheSizes } from "./sizes.js";
var globalCaches = {};
export function registerGlobalCache(name, getSize) {
globalCaches[name] = getSize;
}
/**
* For internal purposes only - please call `ApolloClient.getMemoryInternals` instead
* @internal
*/
export var getApolloClientMemoryInternals = globalThis.__DEV__ !== false ?
_getApolloClientMemoryInternals
: undefined;
/**
* For internal purposes only - please call `ApolloClient.getMemoryInternals` instead
* @internal
*/
export var getInMemoryCacheMemoryInternals = globalThis.__DEV__ !== false ?
_getInMemoryCacheMemoryInternals
: undefined;
/**
* For internal purposes only - please call `ApolloClient.getMemoryInternals` instead
* @internal
*/
export var getApolloCacheMemoryInternals = globalThis.__DEV__ !== false ?
_getApolloCacheMemoryInternals
: undefined;
function getCurrentCacheSizes() {
// `defaultCacheSizes` is a `const enum` that will be inlined during build, so we have to reconstruct it's shape here
var defaults = {
parser: 1000 /* defaultCacheSizes["parser"] */,
canonicalStringify: 1000 /* defaultCacheSizes["canonicalStringify"] */,
print: 2000 /* defaultCacheSizes["print"] */,
"documentTransform.cache": 2000 /* defaultCacheSizes["documentTransform.cache"] */,
"queryManager.getDocumentInfo": 2000 /* defaultCacheSizes["queryManager.getDocumentInfo"] */,
"PersistedQueryLink.persistedQueryHashes": 2000 /* defaultCacheSizes["PersistedQueryLink.persistedQueryHashes"] */,
"fragmentRegistry.transform": 2000 /* defaultCacheSizes["fragmentRegistry.transform"] */,
"fragmentRegistry.lookup": 1000 /* defaultCacheSizes["fragmentRegistry.lookup"] */,
"fragmentRegistry.findFragmentSpreads": 4000 /* defaultCacheSizes["fragmentRegistry.findFragmentSpreads"] */,
"cache.fragmentQueryDocuments": 1000 /* defaultCacheSizes["cache.fragmentQueryDocuments"] */,
"removeTypenameFromVariables.getVariableDefinitions": 2000 /* defaultCacheSizes["removeTypenameFromVariables.getVariableDefinitions"] */,
"inMemoryCache.maybeBroadcastWatch": 5000 /* defaultCacheSizes["inMemoryCache.maybeBroadcastWatch"] */,
"inMemoryCache.executeSelectionSet": 50000 /* defaultCacheSizes["inMemoryCache.executeSelectionSet"] */,
"inMemoryCache.executeSubSelectedArray": 10000 /* defaultCacheSizes["inMemoryCache.executeSubSelectedArray"] */,
};
return Object.fromEntries(Object.entries(defaults).map(function (_a) {
var k = _a[0], v = _a[1];
return [
k,
cacheSizes[k] || v,
];
}));
}
function _getApolloClientMemoryInternals() {
var _a, _b, _c, _d, _e;
if (!(globalThis.__DEV__ !== false))
throw new Error("only supported in development mode");
return {
limits: getCurrentCacheSizes(),
sizes: __assign({ print: (_a = globalCaches.print) === null || _a === void 0 ? void 0 : _a.call(globalCaches), parser: (_b = globalCaches.parser) === null || _b === void 0 ? void 0 : _b.call(globalCaches), canonicalStringify: (_c = globalCaches.canonicalStringify) === null || _c === void 0 ? void 0 : _c.call(globalCaches), links: linkInfo(this.link), queryManager: {
getDocumentInfo: this["queryManager"]["transformCache"].size,
documentTransforms: transformInfo(this["queryManager"].documentTransform),
} }, (_e = (_d = this.cache).getMemoryInternals) === null || _e === void 0 ? void 0 : _e.call(_d)),
};
}
function _getApolloCacheMemoryInternals() {
return {
cache: {
fragmentQueryDocuments: getWrapperInformation(this["getFragmentDoc"]),
},
};
}
function _getInMemoryCacheMemoryInternals() {
var fragments = this.config.fragments;
return __assign(__assign({}, _getApolloCacheMemoryInternals.apply(this)), { addTypenameDocumentTransform: transformInfo(this["addTypenameTransform"]), inMemoryCache: {
executeSelectionSet: getWrapperInformation(this["storeReader"]["executeSelectionSet"]),
executeSubSelectedArray: getWrapperInformation(this["storeReader"]["executeSubSelectedArray"]),
maybeBroadcastWatch: getWrapperInformation(this["maybeBroadcastWatch"]),
}, fragmentRegistry: {
findFragmentSpreads: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.findFragmentSpreads),
lookup: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.lookup),
transform: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.transform),
} });
}
function isWrapper(f) {
return !!f && "dirtyKey" in f;
}
function getWrapperInformation(f) {
return isWrapper(f) ? f.size : undefined;
}
function isDefined(value) {
return value != null;
}
function transformInfo(transform) {
return recurseTransformInfo(transform).map(function (cache) { return ({ cache: cache }); });
}
function recurseTransformInfo(transform) {
return transform ?
__spreadArray(__spreadArray([
getWrapperInformation(transform === null || transform === void 0 ? void 0 : transform["performWork"])
], recurseTransformInfo(transform === null || transform === void 0 ? void 0 : transform["left"]), true), recurseTransformInfo(transform === null || transform === void 0 ? void 0 : transform["right"]), true).filter(isDefined)
: [];
}
function linkInfo(link) {
var _a;
return link ?
__spreadArray(__spreadArray([
(_a = link === null || link === void 0 ? void 0 : link.getMemoryInternals) === null || _a === void 0 ? void 0 : _a.call(link)
], linkInfo(link === null || link === void 0 ? void 0 : link.left), true), linkInfo(link === null || link === void 0 ? void 0 : link.right), true).filter(isDefined)
: [];
}
//# sourceMappingURL=getMemoryInternals.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/parser/index.js
import { invariant } from "../../utilities/globals/index.js";
import { AutoCleanedWeakCache, cacheSizes, } from "../../utilities/index.js";
import { registerGlobalCache } from "../../utilities/caching/getMemoryInternals.js";
export var DocumentType;
(function (DocumentType) {
DocumentType[DocumentType["Query"] = 0] = "Query";
DocumentType[DocumentType["Mutation"] = 1] = "Mutation";
DocumentType[DocumentType["Subscription"] = 2] = "Subscription";
})(DocumentType || (DocumentType = {}));
var cache;
export function operationName(type) {
var name;
switch (type) {
case DocumentType.Query:
name = "Query";
break;
case DocumentType.Mutation:
name = "Mutation";
break;
case DocumentType.Subscription:
name = "Subscription";
break;
}
return name;
}
// This parser is mostly used to safety check incoming documents.
export function parser(document) {
if (!cache) {
cache = new AutoCleanedWeakCache(cacheSizes.parser || 1000 /* defaultCacheSizes.parser */);
}
var cached = cache.get(document);
if (cached)
return cached;
var variables, type, name;
invariant(!!document && !!document.kind, 59, document);
var fragments = [];
var queries = [];
var mutations = [];
var subscriptions = [];
for (var _i = 0, _a = document.definitions; _i < _a.length; _i++) {
var x = _a[_i];
if (x.kind === "FragmentDefinition") {
fragments.push(x);
continue;
}
if (x.kind === "OperationDefinition") {
switch (x.operation) {
case "query":
queries.push(x);
break;
case "mutation":
mutations.push(x);
break;
case "subscription":
subscriptions.push(x);
break;
}
}
}
invariant(!fragments.length ||
queries.length ||
mutations.length ||
subscriptions.length, 60);
invariant(
queries.length + mutations.length + subscriptions.length <= 1,
61,
document,
queries.length,
subscriptions.length,
mutations.length
);
type = queries.length ? DocumentType.Query : DocumentType.Mutation;
if (!queries.length && !mutations.length)
type = DocumentType.Subscription;
var definitions = queries.length ? queries
: mutations.length ? mutations
: subscriptions;
invariant(definitions.length === 1, 62, document, definitions.length);
var definition = definitions[0];
variables = definition.variableDefinitions || [];
if (definition.name && definition.name.kind === "Name") {
name = definition.name.value;
}
else {
name = "data"; // fallback to using data if no name
}
var payload = { name: name, type: type, variables: variables };
cache.set(document, payload);
return payload;
}
parser.resetCache = function () {
cache = undefined;
};
if (globalThis.__DEV__ !== false) {
registerGlobalCache("parser", function () { return (cache ? cache.size : 0); });
}
export function verifyDocumentType(document, type) {
var operation = parser(document);
var requiredOperationName = operationName(type);
var usedOperationName = operationName(operation.type);
invariant(
operation.type === type,
63,
requiredOperationName,
requiredOperationName,
usedOperationName
);
}
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hooks/useSyncExternalStore.js
import { invariant } from "../../utilities/globals/index.js";
import * as React from "rehackt";
import { canUseLayoutEffect } from "../../utilities/index.js";
var didWarnUncachedGetSnapshot = false;
// Prevent webpack from complaining about our feature detection of the
// useSyncExternalStore property of the React namespace, which is expected not
// to exist when using React 17 and earlier, and that's fine.
var uSESKey = "useSyncExternalStore";
var realHook = React[uSESKey];
// Adapted from https://www.npmjs.com/package/use-sync-external-store, with
// Apollo Client deviations called out by "// DEVIATION ..." comments.
// When/if React.useSyncExternalStore is defined, delegate fully to it.
export var useSyncExternalStore = realHook ||
(function (subscribe, getSnapshot, getServerSnapshot) {
// Read the current snapshot from the store on every render. Again, this
// breaks the rules of React, and only works here because of specific
// implementation details, most importantly that updates are
// always synchronous.
var value = getSnapshot();
if (
// DEVIATION: Using __DEV__
globalThis.__DEV__ !== false &&
!didWarnUncachedGetSnapshot &&
// DEVIATION: Not using Object.is because we know our snapshots will never
// be exotic primitive values like NaN, which is !== itself.
value !== getSnapshot()) {
didWarnUncachedGetSnapshot = true;
// DEVIATION: Using invariant.error instead of console.error directly.
globalThis.__DEV__ !== false && invariant.error(58);
}
// Because updates are synchronous, we don't queue them. Instead we force a
// re-render whenever the subscribed state changes by updating an some
// arbitrary useState hook. Then, during render, we call getSnapshot to read
// the current value.
//
// Because we don't actually use the state returned by the useState hook, we
// can save a bit of memory by storing other stuff in that slot.
//
// To implement the early bailout, we need to track some things on a mutable
// object. Usually, we would put that in a useRef hook, but we can stash it in
// our useState hook instead.
//
// To force a re-render, we call forceUpdate({inst}). That works because the
// new object always fails an equality check.
var _a = React.useState({
inst: { value: value, getSnapshot: getSnapshot },
}), inst = _a[0].inst, forceUpdate = _a[1];
// Track the latest getSnapshot function with a ref. This needs to be updated
// in the layout phase so we can access it during the tearing check that
// happens on subscribe.
if (canUseLayoutEffect) {
// DEVIATION: We avoid calling useLayoutEffect when !canUseLayoutEffect,
// which may seem like a conditional hook, but this code ends up behaving
// unconditionally (one way or the other) because canUseLayoutEffect is
// constant.
React.useLayoutEffect(function () {
Object.assign(inst, { value: value, getSnapshot: getSnapshot });
// Whenever getSnapshot or subscribe changes, we need to check in the
// commit phase if there was an interleaved mutation. In concurrent mode
// this can happen all the time, but even in synchronous mode, an earlier
// effect may have mutated the store.
if (checkIfSnapshotChanged(inst)) {
// Force a re-render.
forceUpdate({ inst: inst });
}
}, [subscribe, value, getSnapshot]);
}
else {
Object.assign(inst, { value: value, getSnapshot: getSnapshot });
}
React.useEffect(function () {
// Check for changes right before subscribing. Subsequent changes will be
// detected in the subscription handler.
if (checkIfSnapshotChanged(inst)) {
// Force a re-render.
forceUpdate({ inst: inst });
}
// Subscribe to the store and return a clean-up function.
return subscribe(function handleStoreChange() {
// TODO: Because there is no cross-renderer API for batching updates, it's
// up to the consumer of this library to wrap their subscription event
// with unstable_batchedUpdates. Should we try to detect when this isn't
// the case and print a warning in development?
// The store changed. Check if the snapshot changed since the last time we
// read from the store.
if (checkIfSnapshotChanged(inst)) {
// Force a re-render.
forceUpdate({ inst: inst });
}
});
}, [subscribe]);
return value;
});
function checkIfSnapshotChanged(_a) {
var value = _a.value, getSnapshot = _a.getSnapshot;
try {
return value !== getSnapshot();
}
catch (_b) {
return true;
}
}
//# sourceMappingURL=useSyncExternalStore.js.map
webpack://frontend-tpt/../../node_modules/@wry/equality/lib/index.js
const { toString, hasOwnProperty } = Object.prototype;
const fnToStr = Function.prototype.toString;
const previousComparisons = new Map();
/**
* Performs a deep equality check on two JavaScript values, tolerating cycles.
*/
export function equal(a, b) {
try {
return check(a, b);
}
finally {
previousComparisons.clear();
}
}
// Allow default imports as well.
export default equal;
function check(a, b) {
// If the two values are strictly equal, our job is easy.
if (a === b) {
return true;
}
// Object.prototype.toString returns a representation of the runtime type of
// the given value that is considerably more precise than typeof.
const aTag = toString.call(a);
const bTag = toString.call(b);
// If the runtime types of a and b are different, they could maybe be equal
// under some interpretation of equality, but for simplicity and performance
// we just return false instead.
if (aTag !== bTag) {
return false;
}
switch (aTag) {
case '[object Array]':
// Arrays are a lot like other objects, but we can cheaply compare their
// lengths as a short-cut before comparing their elements.
if (a.length !== b.length)
return false;
// Fall through to object case...
case '[object Object]': {
if (previouslyCompared(a, b))
return true;
const aKeys = definedKeys(a);
const bKeys = definedKeys(b);
// If `a` and `b` have a different number of enumerable keys, they
// must be different.
const keyCount = aKeys.length;
if (keyCount !== bKeys.length)
return false;
// Now make sure they have the same keys.
for (let k = 0; k < keyCount; ++k) {
if (!hasOwnProperty.call(b, aKeys[k])) {
return false;
}
}
// Finally, check deep equality of all child properties.
for (let k = 0; k < keyCount; ++k) {
const key = aKeys[k];
if (!check(a[key], b[key])) {
return false;
}
}
return true;
}
case '[object Error]':
return a.name === b.name && a.message === b.message;
case '[object Number]':
// Handle NaN, which is !== itself.
if (a !== a)
return b !== b;
// Fall through to shared +a === +b case...
case '[object Boolean]':
case '[object Date]':
return +a === +b;
case '[object RegExp]':
case '[object String]':
return a == `${b}`;
case '[object Map]':
case '[object Set]': {
if (a.size !== b.size)
return false;
if (previouslyCompared(a, b))
return true;
const aIterator = a.entries();
const isMap = aTag === '[object Map]';
while (true) {
const info = aIterator.next();
if (info.done)
break;
// If a instanceof Set, aValue === aKey.
const [aKey, aValue] = info.value;
// So this works the same way for both Set and Map.
if (!b.has(aKey)) {
return false;
}
// However, we care about deep equality of values only when dealing
// with Map structures.
if (isMap && !check(aValue, b.get(aKey))) {
return false;
}
}
return true;
}
case '[object Uint16Array]':
case '[object Uint8Array]': // Buffer, in Node.js.
case '[object Uint32Array]':
case '[object Int32Array]':
case '[object Int8Array]':
case '[object Int16Array]':
case '[object ArrayBuffer]':
// DataView doesn't need these conversions, but the equality check is
// otherwise the same.
a = new Uint8Array(a);
b = new Uint8Array(b);
// Fall through...
case '[object DataView]': {
let len = a.byteLength;
if (len === b.byteLength) {
while (len-- && a[len] === b[len]) {
// Keep looping as long as the bytes are equal.
}
}
return len === -1;
}
case '[object AsyncFunction]':
case '[object GeneratorFunction]':
case '[object AsyncGeneratorFunction]':
case '[object Function]': {
const aCode = fnToStr.call(a);
if (aCode !== fnToStr.call(b)) {
return false;
}
// We consider non-native functions equal if they have the same code
// (native functions require === because their code is censored).
// Note that this behavior is not entirely sound, since !== function
// objects with the same code can behave differently depending on
// their closure scope. However, any function can behave differently
// depending on the values of its input arguments (including this)
// and its calling context (including its closure scope), even
// though the function object is === to itself; and it is entirely
// possible for functions that are not === to behave exactly the
// same under all conceivable circumstances. Because none of these
// factors are statically decidable in JavaScript, JS function
// equality is not well-defined. This ambiguity allows us to
// consider the best possible heuristic among various imperfect
// options, and equating non-native functions that have the same
// code has enormous practical benefits, such as when comparing
// functions that are repeatedly passed as fresh function
// expressions within objects that are otherwise deeply equal. Since
// any function created from the same syntactic expression (in the
// same code location) will always stringify to the same code
// according to fnToStr.call, we can reasonably expect these
// repeatedly passed function expressions to have the same code, and
// thus behave "the same" (with all the caveats mentioned above),
// even though the runtime function objects are !== to one another.
return !endsWith(aCode, nativeCodeSuffix);
}
}
// Otherwise the values are not equal.
return false;
}
function definedKeys(obj) {
// Remember that the second argument to Array.prototype.filter will be
// used as `this` within the callback function.
return Object.keys(obj).filter(isDefinedKey, obj);
}
function isDefinedKey(key) {
return this[key] !== void 0;
}
const nativeCodeSuffix = "{ [native code] }";
function endsWith(full, suffix) {
const fromIndex = full.length - suffix.length;
return fromIndex >= 0 &&
full.indexOf(suffix, fromIndex) === fromIndex;
}
function previouslyCompared(a, b) {
// Though cyclic references can make an object graph appear infinite from the
// perspective of a depth-first traversal, the graph still contains a finite
// number of distinct object references. We use the previousComparisons cache
// to avoid comparing the same pair of object references more than once, which
// guarantees termination (even if we end up comparing every object in one
// graph to every object in the other graph, which is extremely unlikely),
// while still allowing weird isomorphic structures (like rings with different
// lengths) a chance to pass the equality test.
let bSet = previousComparisons.get(a);
if (bSet) {
// Return true here because we can be sure false will be returned somewhere
// else if the objects are not equivalent.
if (bSet.has(b))
return true;
}
else {
previousComparisons.set(a, bSet = new Set);
}
bSet.add(b);
return false;
}
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/compact.js
/**
* Merges the provided objects shallowly and removes
* all properties with an `undefined` value
*/
export function compact() {
var objects = [];
for (var _i = 0; _i < arguments.length; _i++) {
objects[_i] = arguments[_i];
}
var result = Object.create(null);
objects.forEach(function (obj) {
if (!obj)
return;
Object.keys(obj).forEach(function (key) {
var value = obj[key];
if (value !== void 0) {
result[key] = value;
}
});
});
return result;
}
//# sourceMappingURL=compact.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/mergeOptions.js
import { __assign } from "tslib";
import { compact } from "./compact.js";
export function mergeOptions(defaults, options) {
return compact(defaults, options, options.variables && {
variables: compact(__assign(__assign({}, (defaults && defaults.variables)), options.variables)),
});
}
//# sourceMappingURL=mergeOptions.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/objects.js
export function isNonNullObject(obj) {
return obj !== null && typeof obj === "object";
}
export function isPlainObject(obj) {
return (obj !== null &&
typeof obj === "object" &&
(Object.getPrototypeOf(obj) === Object.prototype ||
Object.getPrototypeOf(obj) === null));
}
//# sourceMappingURL=objects.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/errors/index.js
import { __extends, __spreadArray } from "tslib";
import "../utilities/globals/index.js";
import { isNonNullObject } from "../utilities/index.js";
// This Symbol allows us to pass transport-specific errors from the link chain
// into QueryManager/client internals without risking a naming collision within
// extensions (which implementers can use as they see fit).
export var PROTOCOL_ERRORS_SYMBOL = Symbol();
export function graphQLResultHasProtocolErrors(result) {
if (result.extensions) {
return Array.isArray(result.extensions[PROTOCOL_ERRORS_SYMBOL]);
}
return false;
}
export function isApolloError(err) {
return err.hasOwnProperty("graphQLErrors");
}
// Sets the error message on this error according to the
// the GraphQL and network errors that are present.
// If the error message has already been set through the
// constructor or otherwise, this function is a nop.
var generateErrorMessage = function (err) {
var errors = __spreadArray(__spreadArray(__spreadArray([], err.graphQLErrors, true), err.clientErrors, true), err.protocolErrors, true);
if (err.networkError)
errors.push(err.networkError);
return (errors
// The rest of the code sometimes unsafely types non-Error objects as GraphQLErrors
.map(function (err) {
return (isNonNullObject(err) && err.message) || "Error message not found.";
})
.join("\n"));
};
var ApolloError = /** @class */ (function (_super) {
__extends(ApolloError, _super);
// Constructs an instance of ApolloError given a GraphQLError
// or a network error. Note that one of these has to be a valid
// value or the constructed error will be meaningless.
function ApolloError(_a) {
var graphQLErrors = _a.graphQLErrors, protocolErrors = _a.protocolErrors, clientErrors = _a.clientErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo;
var _this = _super.call(this, errorMessage) || this;
_this.name = "ApolloError";
_this.graphQLErrors = graphQLErrors || [];
_this.protocolErrors = protocolErrors || [];
_this.clientErrors = clientErrors || [];
_this.networkError = networkError || null;
_this.message = errorMessage || generateErrorMessage(_this);
_this.extraInfo = extraInfo;
// We're not using `Object.setPrototypeOf` here as it isn't fully
// supported on Android (see issue #3236).
_this.__proto__ = ApolloError.prototype;
return _this;
}
return ApolloError;
}(Error));
export { ApolloError };
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/core/networkStatus.js
/**
* The current status of a query’s execution in our system.
*/
export var NetworkStatus;
(function (NetworkStatus) {
/**
* The query has never been run before and the query is now currently running. A query will still
* have this network status even if a partial data result was returned from the cache, but a
* query was dispatched anyway.
*/
NetworkStatus[NetworkStatus["loading"] = 1] = "loading";
/**
* If `setVariables` was called and a query was fired because of that then the network status
* will be `setVariables` until the result of that query comes back.
*/
NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables";
/**
* Indicates that `fetchMore` was called on this query and that the query created is currently in
* flight.
*/
NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore";
/**
* Similar to the `setVariables` network status. It means that `refetch` was called on a query
* and the refetch request is currently in flight.
*/
NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch";
/**
* Indicates that a polling query is currently in flight. So for example if you are polling a
* query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever
* a poll request has been sent but not resolved.
*/
NetworkStatus[NetworkStatus["poll"] = 6] = "poll";
/**
* No request is in flight for this query, and no errors happened. Everything is OK.
*/
NetworkStatus[NetworkStatus["ready"] = 7] = "ready";
/**
* No request is in flight for this query, but one or more errors were detected.
*/
NetworkStatus[NetworkStatus["error"] = 8] = "error";
})(NetworkStatus || (NetworkStatus = {}));
/**
* Returns true if there is currently a network request in flight according to a given network
* status.
*/
export function isNetworkRequestInFlight(networkStatus) {
return networkStatus ? networkStatus < 7 : false;
}
/**
* Returns true if the network request is in ready or error state according to a given network
* status.
*/
export function isNetworkRequestSettled(networkStatus) {
return networkStatus === 7 || networkStatus === 8;
}
//# sourceMappingURL=networkStatus.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hooks/useApolloClient.js
import { invariant } from "../../utilities/globals/index.js";
import * as React from "rehackt";
import { getApolloContext } from "../context/index.js";
/**
* @example
* ```jsx
* import { useApolloClient } from '@apollo/client';
*
* function SomeComponent() {
* const client = useApolloClient();
* // `client` is now set to the `ApolloClient` instance being used by the
* // application (that was configured using something like `ApolloProvider`)
* }
* ```
*
* @since 3.0.0
* @returns The `ApolloClient` instance being used by the application.
*/
export function useApolloClient(override) {
var context = React.useContext(getApolloContext());
var client = override || context.client;
invariant(!!client, 49);
return client;
}
//# sourceMappingURL=useApolloClient.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js
import { isNonNullObject } from "./objects.js";
function deepFreeze(value) {
var workSet = new Set([value]);
workSet.forEach(function (obj) {
if (isNonNullObject(obj) && shallowFreeze(obj) === obj) {
Object.getOwnPropertyNames(obj).forEach(function (name) {
if (isNonNullObject(obj[name]))
workSet.add(obj[name]);
});
}
});
return value;
}
function shallowFreeze(obj) {
if (globalThis.__DEV__ !== false && !Object.isFrozen(obj)) {
try {
Object.freeze(obj);
}
catch (e) {
// Some types like Uint8Array and Node.js's Buffer cannot be frozen, but
// they all throw a TypeError when you try, so we re-throw any exceptions
// that are not TypeErrors, since that would be unexpected.
if (e instanceof TypeError)
return null;
throw e;
}
}
return obj;
}
export function maybeDeepFreeze(obj) {
if (globalThis.__DEV__ !== false) {
deepFreeze(obj);
}
return obj;
}
//# sourceMappingURL=maybeDeepFreeze.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/arrays.js
// A version of Array.isArray that works better with readonly arrays.
export var isArray = Array.isArray;
export function isNonEmptyArray(value) {
return Array.isArray(value) && value.length > 0;
}
//# sourceMappingURL=arrays.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hooks/useQuery.js
import { __assign, __rest } from "tslib";
import { invariant } from "../../utilities/globals/index.js";
import * as React from "rehackt";
import { useSyncExternalStore } from "./useSyncExternalStore.js";
import { equal } from "@wry/equality";
import { mergeOptions } from "../../utilities/index.js";
import { getApolloContext } from "../context/index.js";
import { ApolloError } from "../../errors/index.js";
import { NetworkStatus } from "../../core/index.js";
import { DocumentType, verifyDocumentType } from "../parser/index.js";
import { useApolloClient } from "./useApolloClient.js";
import { canUseWeakMap, compact, isNonEmptyArray, maybeDeepFreeze, } from "../../utilities/index.js";
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* A hook for executing queries in an Apollo application.
*
* To run a query within a React component, call `useQuery` and pass it a GraphQL query document.
*
* When your component renders, `useQuery` returns an object from Apollo Client that contains `loading`, `error`, and `data` properties you can use to render your UI.
*
* > Refer to the [Queries](https://www.apollographql.com/docs/react/data/queries) section for a more in-depth overview of `useQuery`.
*
* @example
* ```jsx
* import { gql, useQuery } from '@apollo/client';
*
* const GET_GREETING = gql`
* query GetGreeting($language: String!) {
* greeting(language: $language) {
* message
* }
* }
* `;
*
* function Hello() {
* const { loading, error, data } = useQuery(GET_GREETING, {
* variables: { language: 'english' },
* });
* if (loading) return <p>Loading ...</p>;
* return <h1>Hello {data.greeting.message}!</h1>;
* }
* ```
* @since 3.0.0
* @param query - A GraphQL query document parsed into an AST by `gql`.
* @param options - Options to control how the query is executed.
* @returns Query result object
*/
export function useQuery(query, options) {
if (options === void 0) { options = Object.create(null); }
return useInternalState(useApolloClient(options.client), query).useQuery(options);
}
export function useInternalState(client, query) {
var stateRef = React.useRef();
if (!stateRef.current ||
client !== stateRef.current.client ||
query !== stateRef.current.query) {
stateRef.current = new InternalState(client, query, stateRef.current);
}
var state = stateRef.current;
// By default, InternalState.prototype.forceUpdate is an empty function, but
// we replace it here (before anyone has had a chance to see this state yet)
// with a function that unconditionally forces an update, using the latest
// setTick function. Updating this state by calling state.forceUpdate is the
// only way we trigger React component updates (no other useState calls within
// the InternalState class).
state.forceUpdateState = React.useReducer(function (tick) { return tick + 1; }, 0)[1];
return state;
}
var InternalState = /** @class */ (function () {
function InternalState(client, query, previous) {
var _this = this;
this.client = client;
this.query = query;
/**
* Will be overwritten by the `useSyncExternalStore` "force update" method
* whenever it is available and reset to `forceUpdateState` when it isn't.
*/
this.forceUpdate = function () { return _this.forceUpdateState(); };
this.ssrDisabledResult = maybeDeepFreeze({
loading: true,
data: void 0,
error: void 0,
networkStatus: NetworkStatus.loading,
});
this.skipStandbyResult = maybeDeepFreeze({
loading: false,
data: void 0,
error: void 0,
networkStatus: NetworkStatus.ready,
});
// This cache allows the referential stability of this.result (as returned by
// getCurrentResult) to translate into referential stability of the resulting
// QueryResult object returned by toQueryResult.
this.toQueryResultCache = new (canUseWeakMap ? WeakMap : Map)();
verifyDocumentType(query, DocumentType.Query);
// Reuse previousData from previous InternalState (if any) to provide
// continuity of previousData even if/when the query or client changes.
var previousResult = previous && previous.result;
var previousData = previousResult && previousResult.data;
if (previousData) {
this.previousData = previousData;
}
}
/**
* Forces an update using local component state.
* As this is not batched with `useSyncExternalStore` updates,
* this is only used as a fallback if the `useSyncExternalStore` "force update"
* method is not registered at the moment.
* See https://github.com/facebook/react/issues/25191
* */
InternalState.prototype.forceUpdateState = function () {
// Replaced (in useInternalState) with a method that triggers an update.
globalThis.__DEV__ !== false && invariant.warn(51);
};
InternalState.prototype.executeQuery = function (options) {
var _this = this;
var _a;
if (options.query) {
Object.assign(this, { query: options.query });
}
this.watchQueryOptions = this.createWatchQueryOptions((this.queryHookOptions = options));
var concast = this.observable.reobserveAsConcast(this.getObsQueryOptions());
// Make sure getCurrentResult returns a fresh ApolloQueryResult<TData>,
// but save the current data as this.previousData, just like setResult
// usually does.
this.previousData = ((_a = this.result) === null || _a === void 0 ? void 0 : _a.data) || this.previousData;
this.result = void 0;
this.forceUpdate();
return new Promise(function (resolve) {
var result;
// Subscribe to the concast independently of the ObservableQuery in case
// the component gets unmounted before the promise resolves. This prevents
// the concast from terminating early and resolving with `undefined` when
// there are no more subscribers for the concast.
concast.subscribe({
next: function (value) {
result = value;
},
error: function () {
resolve(_this.toQueryResult(_this.observable.getCurrentResult()));
},
complete: function () {
resolve(_this.toQueryResult(result));
},
});
});
};
// Methods beginning with use- should be called according to the standard
// rules of React hooks: only at the top level of the calling function, and
// without any dynamic conditional logic.
InternalState.prototype.useQuery = function (options) {
var _this = this;
// The renderPromises field gets initialized here in the useQuery method, at
// the beginning of everything (for a given component rendering, at least),
// so we can safely use this.renderPromises in other/later InternalState
// methods without worrying it might be uninitialized. Even after
// initialization, this.renderPromises is usually undefined (unless SSR is
// happening), but that's fine as long as it has been initialized that way,
// rather than left uninitialized.
this.renderPromises = React.useContext(getApolloContext()).renderPromises;
this.useOptions(options);
var obsQuery = this.useObservableQuery();
var result = useSyncExternalStore(React.useCallback(function (handleStoreChange) {
if (_this.renderPromises) {
return function () { };
}
_this.forceUpdate = handleStoreChange;
var onNext = function () {
var previousResult = _this.result;
// We use `getCurrentResult()` instead of the onNext argument because
// the values differ slightly. Specifically, loading results will have
// an empty object for data instead of `undefined` for some reason.
var result = obsQuery.getCurrentResult();
// Make sure we're not attempting to re-render similar results
if (previousResult &&
previousResult.loading === result.loading &&
previousResult.networkStatus === result.networkStatus &&
equal(previousResult.data, result.data)) {
return;
}
_this.setResult(result);
};
var onError = function (error) {
subscription.unsubscribe();
subscription = obsQuery.resubscribeAfterError(onNext, onError);
if (!hasOwnProperty.call(error, "graphQLErrors")) {
// The error is not a GraphQL error
throw error;
}
var previousResult = _this.result;
if (!previousResult ||
(previousResult && previousResult.loading) ||
!equal(error, previousResult.error)) {
_this.setResult({
data: (previousResult && previousResult.data),
error: error,
loading: false,
networkStatus: NetworkStatus.error,
});
}
};
var subscription = obsQuery.subscribe(onNext, onError);
// Do the "unsubscribe" with a short delay.
// This way, an existing subscription can be reused without an additional
// request if "unsubscribe" and "resubscribe" to the same ObservableQuery
// happen in very fast succession.
return function () {
setTimeout(function () { return subscription.unsubscribe(); });
_this.forceUpdate = function () { return _this.forceUpdateState(); };
};
}, [
// We memoize the subscribe function using useCallback and the following
// dependency keys, because the subscribe function reference is all that
// useSyncExternalStore uses internally as a dependency key for the
// useEffect ultimately responsible for the subscription, so we are
// effectively passing this dependency array to that useEffect buried
// inside useSyncExternalStore, as desired.
obsQuery,
this.renderPromises,
this.client.disableNetworkFetches,
]), function () { return _this.getCurrentResult(); }, function () { return _this.getCurrentResult(); });
// TODO Remove this method when we remove support for options.partialRefetch.
this.unsafeHandlePartialRefetch(result);
return this.toQueryResult(result);
};
InternalState.prototype.useOptions = function (options) {
var _a;
var watchQueryOptions = this.createWatchQueryOptions((this.queryHookOptions = options));
// Update this.watchQueryOptions, but only when they have changed, which
// allows us to depend on the referential stability of
// this.watchQueryOptions elsewhere.
var currentWatchQueryOptions = this.watchQueryOptions;
if (!equal(watchQueryOptions, currentWatchQueryOptions)) {
this.watchQueryOptions = watchQueryOptions;
if (currentWatchQueryOptions && this.observable) {
// Though it might be tempting to postpone this reobserve call to the
// useEffect block, we need getCurrentResult to return an appropriate
// loading:true result synchronously (later within the same call to
// useQuery). Since we already have this.observable here (not true for
// the very first call to useQuery), we are not initiating any new
// subscriptions, though it does feel less than ideal that reobserve
// (potentially) kicks off a network request (for example, when the
// variables have changed), which is technically a side-effect.
this.observable.reobserve(this.getObsQueryOptions());
// Make sure getCurrentResult returns a fresh ApolloQueryResult<TData>,
// but save the current data as this.previousData, just like setResult
// usually does.
this.previousData = ((_a = this.result) === null || _a === void 0 ? void 0 : _a.data) || this.previousData;
this.result = void 0;
}
}
// Make sure state.onCompleted and state.onError always reflect the latest
// options.onCompleted and options.onError callbacks provided to useQuery,
// since those functions are often recreated every time useQuery is called.
// Like the forceUpdate method, the versions of these methods inherited from
// InternalState.prototype are empty no-ops, but we can override them on the
// base state object (without modifying the prototype).
this.onCompleted =
options.onCompleted || InternalState.prototype.onCompleted;
this.onError = options.onError || InternalState.prototype.onError;
if ((this.renderPromises || this.client.disableNetworkFetches) &&
this.queryHookOptions.ssr === false &&
!this.queryHookOptions.skip) {
// If SSR has been explicitly disabled, and this function has been called
// on the server side, return the default loading state.
this.result = this.ssrDisabledResult;
}
else if (this.queryHookOptions.skip ||
this.watchQueryOptions.fetchPolicy === "standby") {
// When skipping a query (ie. we're not querying for data but still want to
// render children), make sure the `data` is cleared out and `loading` is
// set to `false` (since we aren't loading anything).
//
// NOTE: We no longer think this is the correct behavior. Skipping should
// not automatically set `data` to `undefined`, but instead leave the
// previous data in place. In other words, skipping should not mandate that
// previously received data is all of a sudden removed. Unfortunately,
// changing this is breaking, so we'll have to wait until Apollo Client 4.0
// to address this.
this.result = this.skipStandbyResult;
}
else if (this.result === this.ssrDisabledResult ||
this.result === this.skipStandbyResult) {
this.result = void 0;
}
};
InternalState.prototype.getObsQueryOptions = function () {
var toMerge = [];
var globalDefaults = this.client.defaultOptions.watchQuery;
if (globalDefaults)
toMerge.push(globalDefaults);
if (this.queryHookOptions.defaultOptions) {
toMerge.push(this.queryHookOptions.defaultOptions);
}
// We use compact rather than mergeOptions for this part of the merge,
// because we want watchQueryOptions.variables (if defined) to replace
// this.observable.options.variables whole. This replacement allows
// removing variables by removing them from the variables input to
// useQuery. If the variables were always merged together (rather than
// replaced), there would be no way to remove existing variables.
// However, the variables from options.defaultOptions and globalDefaults
// (if provided) should be merged, to ensure individual defaulted
// variables always have values, if not otherwise defined in
// observable.options or watchQueryOptions.
toMerge.push(compact(this.observable && this.observable.options, this.watchQueryOptions));
return toMerge.reduce(mergeOptions);
};
// A function to massage options before passing them to ObservableQuery.
InternalState.prototype.createWatchQueryOptions = function (_a) {
var _b;
if (_a === void 0) { _a = {}; }
var skip = _a.skip, ssr = _a.ssr, onCompleted = _a.onCompleted, onError = _a.onError, defaultOptions = _a.defaultOptions,
// The above options are useQuery-specific, so this ...otherOptions spread
// makes otherOptions almost a WatchQueryOptions object, except for the
// query property that we add below.
otherOptions = __rest(_a, ["skip", "ssr", "onCompleted", "onError", "defaultOptions"]);
// This Object.assign is safe because otherOptions is a fresh ...rest object
// that did not exist until just now, so modifications are still allowed.
var watchQueryOptions = Object.assign(otherOptions, { query: this.query });
if (this.renderPromises &&
(watchQueryOptions.fetchPolicy === "network-only" ||
watchQueryOptions.fetchPolicy === "cache-and-network")) {
// this behavior was added to react-apollo without explanation in this PR
// https://github.com/apollographql/react-apollo/pull/1579
watchQueryOptions.fetchPolicy = "cache-first";
}
if (!watchQueryOptions.variables) {
watchQueryOptions.variables = {};
}
if (skip) {
var _c = watchQueryOptions.fetchPolicy, fetchPolicy = _c === void 0 ? this.getDefaultFetchPolicy() : _c, _d = watchQueryOptions.initialFetchPolicy, initialFetchPolicy = _d === void 0 ? fetchPolicy : _d;
// When skipping, we set watchQueryOptions.fetchPolicy initially to
// "standby", but we also need/want to preserve the initial non-standby
// fetchPolicy that would have been used if not skipping.
Object.assign(watchQueryOptions, {
initialFetchPolicy: initialFetchPolicy,
fetchPolicy: "standby",
});
}
else if (!watchQueryOptions.fetchPolicy) {
watchQueryOptions.fetchPolicy =
((_b = this.observable) === null || _b === void 0 ? void 0 : _b.options.initialFetchPolicy) ||
this.getDefaultFetchPolicy();
}
return watchQueryOptions;
};
InternalState.prototype.getDefaultFetchPolicy = function () {
var _a, _b;
return (((_a = this.queryHookOptions.defaultOptions) === null || _a === void 0 ? void 0 : _a.fetchPolicy) ||
((_b = this.client.defaultOptions.watchQuery) === null || _b === void 0 ? void 0 : _b.fetchPolicy) ||
"cache-first");
};
// Defining these methods as no-ops on the prototype allows us to call
// state.onCompleted and/or state.onError without worrying about whether a
// callback was provided.
InternalState.prototype.onCompleted = function (data) { };
InternalState.prototype.onError = function (error) { };
InternalState.prototype.useObservableQuery = function () {
// See if there is an existing observable that was used to fetch the same
// data and if so, use it instead since it will contain the proper queryId
// to fetch the result set. This is used during SSR.
var obsQuery = (this.observable =
(this.renderPromises &&
this.renderPromises.getSSRObservable(this.watchQueryOptions)) ||
this.observable || // Reuse this.observable if possible (and not SSR)
this.client.watchQuery(this.getObsQueryOptions()));
this.obsQueryFields = React.useMemo(function () { return ({
refetch: obsQuery.refetch.bind(obsQuery),
reobserve: obsQuery.reobserve.bind(obsQuery),
fetchMore: obsQuery.fetchMore.bind(obsQuery),
updateQuery: obsQuery.updateQuery.bind(obsQuery),
startPolling: obsQuery.startPolling.bind(obsQuery),
stopPolling: obsQuery.stopPolling.bind(obsQuery),
subscribeToMore: obsQuery.subscribeToMore.bind(obsQuery),
}); }, [obsQuery]);
var ssrAllowed = !(this.queryHookOptions.ssr === false || this.queryHookOptions.skip);
if (this.renderPromises && ssrAllowed) {
this.renderPromises.registerSSRObservable(obsQuery);
if (obsQuery.getCurrentResult().loading) {
// TODO: This is a legacy API which could probably be cleaned up
this.renderPromises.addObservableQueryPromise(obsQuery);
}
}
return obsQuery;
};
InternalState.prototype.setResult = function (nextResult) {
var previousResult = this.result;
if (previousResult && previousResult.data) {
this.previousData = previousResult.data;
}
this.result = nextResult;
// Calling state.setResult always triggers an update, though some call sites
// perform additional equality checks before committing to an update.
this.forceUpdate();
this.handleErrorOrCompleted(nextResult, previousResult);
};
InternalState.prototype.handleErrorOrCompleted = function (result, previousResult) {
var _this = this;
if (!result.loading) {
var error_1 = this.toApolloError(result);
// wait a tick in case we are in the middle of rendering a component
Promise.resolve()
.then(function () {
if (error_1) {
_this.onError(error_1);
}
else if (result.data &&
(previousResult === null || previousResult === void 0 ? void 0 : previousResult.networkStatus) !== result.networkStatus &&
result.networkStatus === NetworkStatus.ready) {
_this.onCompleted(result.data);
}
})
.catch(function (error) {
globalThis.__DEV__ !== false && invariant.warn(error);
});
}
};
InternalState.prototype.toApolloError = function (result) {
return isNonEmptyArray(result.errors) ?
new ApolloError({ graphQLErrors: result.errors })
: result.error;
};
InternalState.prototype.getCurrentResult = function () {
// Using this.result as a cache ensures getCurrentResult continues returning
// the same (===) result object, unless state.setResult has been called, or
// we're doing server rendering and therefore override the result below.
if (!this.result) {
this.handleErrorOrCompleted((this.result = this.observable.getCurrentResult()));
}
return this.result;
};
InternalState.prototype.toQueryResult = function (result) {
var queryResult = this.toQueryResultCache.get(result);
if (queryResult)
return queryResult;
var data = result.data, partial = result.partial, resultWithoutPartial = __rest(result, ["data", "partial"]);
this.toQueryResultCache.set(result, (queryResult = __assign(__assign(__assign({ data: data }, resultWithoutPartial), this.obsQueryFields), { client: this.client, observable: this.observable, variables: this.observable.variables, called: !this.queryHookOptions.skip, previousData: this.previousData })));
if (!queryResult.error && isNonEmptyArray(result.errors)) {
// Until a set naming convention for networkError and graphQLErrors is
// decided upon, we map errors (graphQLErrors) to the error options.
// TODO: Is it possible for both result.error and result.errors to be
// defined here?
queryResult.error = new ApolloError({ graphQLErrors: result.errors });
}
return queryResult;
};
InternalState.prototype.unsafeHandlePartialRefetch = function (result) {
// WARNING: SIDE-EFFECTS IN THE RENDER FUNCTION
//
// TODO: This code should be removed when the partialRefetch option is
// removed. I was unable to get this hook to behave reasonably in certain
// edge cases when this block was put in an effect.
if (result.partial &&
this.queryHookOptions.partialRefetch &&
!result.loading &&
(!result.data || Object.keys(result.data).length === 0) &&
this.observable.options.fetchPolicy !== "cache-only") {
Object.assign(result, {
loading: true,
networkStatus: NetworkStatus.refetch,
});
this.observable.refetch();
}
};
return InternalState;
}());
//# sourceMappingURL=useQuery.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/components/Query.js
import { __rest } from "tslib";
import * as PropTypes from "prop-types";
import { useQuery } from "../hooks/index.js";
/**
* @deprecated
* Official support for React Apollo render prop components ended in March 2020.
* This library is still included in the `@apollo/client` package,
* but it no longer receives feature updates or bug fixes.
*/
export function Query(props) {
var children = props.children, query = props.query, options = __rest(props, ["children", "query"]);
var result = useQuery(query, options);
return result ? children(result) : null;
}
Query.propTypes = {
client: PropTypes.object,
children: PropTypes.func.isRequired,
fetchPolicy: PropTypes.string,
notifyOnNetworkStatusChange: PropTypes.bool,
onCompleted: PropTypes.func,
onError: PropTypes.func,
pollInterval: PropTypes.number,
query: PropTypes.object.isRequired,
variables: PropTypes.object,
ssr: PropTypes.bool,
partialRefetch: PropTypes.bool,
returnPartialData: PropTypes.bool,
};
//# sourceMappingURL=Query.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hoc/hoc-utils.js
import { __extends } from "tslib";
import { invariant } from "../../utilities/globals/index.js";
import * as React from "rehackt";
export var defaultMapPropsToOptions = function () { return ({}); };
export var defaultMapResultToProps = function (props) { return props; };
export var defaultMapPropsToSkip = function () { return false; };
export function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || "Component";
}
export function calculateVariablesFromProps(operation, props) {
var variables = {};
for (var _i = 0, _a = operation.variables; _i < _a.length; _i++) {
var _b = _a[_i], variable = _b.variable, type = _b.type;
if (!variable.name || !variable.name.value)
continue;
var variableName = variable.name.value;
var variableProp = props[variableName];
if (typeof variableProp !== "undefined") {
variables[variableName] = variableProp;
continue;
}
// Allow optional props
if (type.kind !== "NonNullType") {
variables[variableName] = undefined;
}
}
return variables;
}
// base class for hocs to easily manage refs
var GraphQLBase = /** @class */ (function (_super) {
__extends(GraphQLBase, _super);
function GraphQLBase(props) {
var _this = _super.call(this, props) || this;
_this.withRef = false;
_this.setWrappedInstance = _this.setWrappedInstance.bind(_this);
return _this;
}
GraphQLBase.prototype.getWrappedInstance = function () {
invariant(this.withRef, 47);
return this.wrappedInstance;
};
GraphQLBase.prototype.setWrappedInstance = function (ref) {
this.wrappedInstance = ref;
};
return GraphQLBase;
}(React.Component));
export { GraphQLBase };
//# sourceMappingURL=hoc-utils.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/components/Mutation.js
import * as PropTypes from "prop-types";
import { useMutation } from "../hooks/index.js";
/**
* @deprecated
* Official support for React Apollo render prop components ended in March 2020.
* This library is still included in the `@apollo/client` package,
* but it no longer receives feature updates or bug fixes.
*/
export function Mutation(props) {
var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
return props.children ? props.children(runMutation, result) : null;
}
Mutation.propTypes = {
mutation: PropTypes.object.isRequired,
variables: PropTypes.object,
optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
refetchQueries: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),
PropTypes.func,
]),
awaitRefetchQueries: PropTypes.bool,
update: PropTypes.func,
children: PropTypes.func.isRequired,
onCompleted: PropTypes.func,
onError: PropTypes.func,
fetchPolicy: PropTypes.string,
};
//# sourceMappingURL=Mutation.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hooks/useMutation.js
import { __assign } from "tslib";
import * as React from "rehackt";
import { mergeOptions } from "../../utilities/index.js";
import { equal } from "@wry/equality";
import { DocumentType, verifyDocumentType } from "../parser/index.js";
import { ApolloError } from "../../errors/index.js";
import { useApolloClient } from "./useApolloClient.js";
/**
*
*
* > Refer to the [Mutations](https://www.apollographql.com/docs/react/data/mutations/) section for a more in-depth overview of `useMutation`.
*
* @example
* ```jsx
* import { gql, useMutation } from '@apollo/client';
*
* const ADD_TODO = gql`
* mutation AddTodo($type: String!) {
* addTodo(type: $type) {
* id
* type
* }
* }
* `;
*
* function AddTodo() {
* let input;
* const [addTodo, { data }] = useMutation(ADD_TODO);
*
* return (
* <div>
* <form
* onSubmit={e => {
* e.preventDefault();
* addTodo({ variables: { type: input.value } });
* input.value = '';
* }}
* >
* <input
* ref={node => {
* input = node;
* }}
* />
* <button type="submit">Add Todo</button>
* </form>
* </div>
* );
* }
* ```
* @since 3.0.0
* @param mutation - A GraphQL mutation document parsed into an AST by `gql`.
* @param options - Options to control how the mutation is executed.
* @returns A tuple in the form of `[mutate, result]`
*/
export function useMutation(mutation, options) {
var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
verifyDocumentType(mutation, DocumentType.Mutation);
var _a = React.useState({
called: false,
loading: false,
client: client,
}), result = _a[0], setResult = _a[1];
var ref = React.useRef({
result: result,
mutationId: 0,
isMounted: true,
client: client,
mutation: mutation,
options: options,
});
// TODO: Trying to assign these in a useEffect or useLayoutEffect breaks
// higher-order components.
{
Object.assign(ref.current, { client: client, options: options, mutation: mutation });
}
var execute = React.useCallback(function (executeOptions) {
if (executeOptions === void 0) { executeOptions = {}; }
var _a = ref.current, options = _a.options, mutation = _a.mutation;
var baseOptions = __assign(__assign({}, options), { mutation: mutation });
var client = executeOptions.client || ref.current.client;
if (!ref.current.result.loading &&
!baseOptions.ignoreResults &&
ref.current.isMounted) {
setResult((ref.current.result = {
loading: true,
error: void 0,
data: void 0,
called: true,
client: client,
}));
}
var mutationId = ++ref.current.mutationId;
var clientOptions = mergeOptions(baseOptions, executeOptions);
return client
.mutate(clientOptions)
.then(function (response) {
var _a, _b;
var data = response.data, errors = response.errors;
var error = errors && errors.length > 0 ?
new ApolloError({ graphQLErrors: errors })
: void 0;
var onError = executeOptions.onError || ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onError);
if (error && onError) {
onError(error, clientOptions);
}
if (mutationId === ref.current.mutationId &&
!clientOptions.ignoreResults) {
var result_1 = {
called: true,
loading: false,
data: data,
error: error,
client: client,
};
if (ref.current.isMounted && !equal(ref.current.result, result_1)) {
setResult((ref.current.result = result_1));
}
}
var onCompleted = executeOptions.onCompleted || ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.onCompleted);
if (!error) {
onCompleted === null || onCompleted === void 0 ? void 0 : onCompleted(response.data, clientOptions);
}
return response;
})
.catch(function (error) {
var _a;
if (mutationId === ref.current.mutationId && ref.current.isMounted) {
var result_2 = {
loading: false,
error: error,
data: void 0,
called: true,
client: client,
};
if (!equal(ref.current.result, result_2)) {
setResult((ref.current.result = result_2));
}
}
var onError = executeOptions.onError || ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onError);
if (onError) {
onError(error, clientOptions);
// TODO(brian): why are we returning this here???
return { data: void 0, errors: error };
}
throw error;
});
}, []);
var reset = React.useCallback(function () {
if (ref.current.isMounted) {
var result_3 = { called: false, loading: false, client: client };
Object.assign(ref.current, { mutationId: 0, result: result_3 });
setResult(result_3);
}
}, []);
React.useEffect(function () {
ref.current.isMounted = true;
return function () {
ref.current.isMounted = false;
};
}, []);
return [execute, __assign({ reset: reset }, result)];
}
//# sourceMappingURL=useMutation.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/components/Subscription.js
import * as PropTypes from "prop-types";
import { useSubscription } from "../hooks/index.js";
/**
* @deprecated
* Official support for React Apollo render prop components ended in March 2020.
* This library is still included in the `@apollo/client` package,
* but it no longer receives feature updates or bug fixes.
*/
export function Subscription(props) {
var result = useSubscription(props.subscription, props);
return props.children && result ? props.children(result) : null;
}
Subscription.propTypes = {
subscription: PropTypes.object.isRequired,
variables: PropTypes.object,
children: PropTypes.func,
onSubscriptionData: PropTypes.func,
onData: PropTypes.func,
onSubscriptionComplete: PropTypes.func,
onComplete: PropTypes.func,
shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
};
//# sourceMappingURL=Subscription.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hooks/useSubscription.js
import { invariant } from "../../utilities/globals/index.js";
import * as React from "rehackt";
import { equal } from "@wry/equality";
import { DocumentType, verifyDocumentType } from "../parser/index.js";
import { useApolloClient } from "./useApolloClient.js";
/**
* > Refer to the [Subscriptions](https://www.apollographql.com/docs/react/data/subscriptions/) section for a more in-depth overview of `useSubscription`.
*
* @example
* ```jsx
* const COMMENTS_SUBSCRIPTION = gql`
* subscription OnCommentAdded($repoFullName: String!) {
* commentAdded(repoFullName: $repoFullName) {
* id
* content
* }
* }
* `;
*
* function DontReadTheComments({ repoFullName }) {
* const {
* data: { commentAdded },
* loading,
* } = useSubscription(COMMENTS_SUBSCRIPTION, { variables: { repoFullName } });
* return <h4>New comment: {!loading && commentAdded.content}</h4>;
* }
* ```
* @remarks
* #### Subscriptions and React 18 Automatic Batching
*
* With React 18's [automatic batching](https://react.dev/blog/2022/03/29/react-v18#new-feature-automatic-batching), multiple state updates may be grouped into a single re-render for better performance.
*
* If your subscription API sends multiple messages at the same time or in very fast succession (within fractions of a millisecond), it is likely that only the last message received in that narrow time frame will result in a re-render.
*
* Consider the following component:
*
* ```jsx
* export function Subscriptions() {
* const { data, error, loading } = useSubscription(query);
* const [accumulatedData, setAccumulatedData] = useState([]);
*
* useEffect(() => {
* setAccumulatedData((prev) => [...prev, data]);
* }, [data]);
*
* return (
* <>
* {loading && <p>Loading...</p>}
* {JSON.stringify(accumulatedData, undefined, 2)}
* </>
* );
* }
* ```
*
* If your subscription back-end emits two messages with the same timestamp, only the last message received by Apollo Client will be rendered. This is because React 18 will batch these two state updates into a single re-render.
*
* Since the component above is using `useEffect` to push `data` into a piece of local state on each `Subscriptions` re-render, the first message will never be added to the `accumulatedData` array since its render was skipped.
*
* Instead of using `useEffect` here, we can re-write this component to use the `onData` callback function accepted in `useSubscription`'s `options` object:
*
* ```jsx
* export function Subscriptions() {
* const [accumulatedData, setAccumulatedData] = useState([]);
* const { data, error, loading } = useSubscription(
* query,
* {
* onData({ data }) {
* setAccumulatedData((prev) => [...prev, data])
* }
* }
* );
*
* return (
* <>
* {loading && <p>Loading...</p>}
* {JSON.stringify(accumulatedData, undefined, 2)}
* </>
* );
* }
* ```
*
* > ⚠️ **Note:** The `useSubscription` option `onData` is available in Apollo Client >= 3.7. In previous versions, the equivalent option is named `onSubscriptionData`.
*
* Now, the first message will be added to the `accumulatedData` array since `onData` is called _before_ the component re-renders. React 18 automatic batching is still in effect and results in a single re-render, but with `onData` we can guarantee each message received after the component mounts is added to `accumulatedData`.
*
* @since 3.0.0
* @param subscription - A GraphQL subscription document parsed into an AST by `gql`.
* @param options - Options to control how the subscription is executed.
* @returns Query result object
*/
export function useSubscription(subscription, options) {
var hasIssuedDeprecationWarningRef = React.useRef(false);
var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
verifyDocumentType(subscription, DocumentType.Subscription);
var _a = React.useState({
loading: !(options === null || options === void 0 ? void 0 : options.skip),
error: void 0,
data: void 0,
variables: options === null || options === void 0 ? void 0 : options.variables,
}), result = _a[0], setResult = _a[1];
if (!hasIssuedDeprecationWarningRef.current) {
hasIssuedDeprecationWarningRef.current = true;
if (options === null || options === void 0 ? void 0 : options.onSubscriptionData) {
globalThis.__DEV__ !== false && invariant.warn(options.onData ? 52 : 53);
}
if (options === null || options === void 0 ? void 0 : options.onSubscriptionComplete) {
globalThis.__DEV__ !== false && invariant.warn(options.onComplete ? 54 : 55);
}
}
var _b = React.useState(function () {
if (options === null || options === void 0 ? void 0 : options.skip) {
return null;
}
return client.subscribe({
query: subscription,
variables: options === null || options === void 0 ? void 0 : options.variables,
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
context: options === null || options === void 0 ? void 0 : options.context,
});
}), observable = _b[0], setObservable = _b[1];
var canResetObservableRef = React.useRef(false);
React.useEffect(function () {
return function () {
canResetObservableRef.current = true;
};
}, []);
var ref = React.useRef({ client: client, subscription: subscription, options: options });
React.useEffect(function () {
var _a, _b, _c, _d;
var shouldResubscribe = options === null || options === void 0 ? void 0 : options.shouldResubscribe;
if (typeof shouldResubscribe === "function") {
shouldResubscribe = !!shouldResubscribe(options);
}
if (options === null || options === void 0 ? void 0 : options.skip) {
if (!(options === null || options === void 0 ? void 0 : options.skip) !== !((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.skip) ||
canResetObservableRef.current) {
setResult({
loading: false,
data: void 0,
error: void 0,
variables: options === null || options === void 0 ? void 0 : options.variables,
});
setObservable(null);
canResetObservableRef.current = false;
}
}
else if ((shouldResubscribe !== false &&
(client !== ref.current.client ||
subscription !== ref.current.subscription ||
(options === null || options === void 0 ? void 0 : options.fetchPolicy) !== ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.fetchPolicy) ||
!(options === null || options === void 0 ? void 0 : options.skip) !== !((_c = ref.current.options) === null || _c === void 0 ? void 0 : _c.skip) ||
!equal(options === null || options === void 0 ? void 0 : options.variables, (_d = ref.current.options) === null || _d === void 0 ? void 0 : _d.variables))) ||
canResetObservableRef.current) {
setResult({
loading: true,
data: void 0,
error: void 0,
variables: options === null || options === void 0 ? void 0 : options.variables,
});
setObservable(client.subscribe({
query: subscription,
variables: options === null || options === void 0 ? void 0 : options.variables,
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
context: options === null || options === void 0 ? void 0 : options.context,
}));
canResetObservableRef.current = false;
}
Object.assign(ref.current, { client: client, subscription: subscription, options: options });
}, [client, subscription, options, canResetObservableRef.current]);
React.useEffect(function () {
if (!observable) {
return;
}
var subscriptionStopped = false;
var subscription = observable.subscribe({
next: function (fetchResult) {
var _a, _b;
if (subscriptionStopped) {
return;
}
var result = {
loading: false,
// TODO: fetchResult.data can be null but SubscriptionResult.data
// expects TData | undefined only
data: fetchResult.data,
error: void 0,
variables: options === null || options === void 0 ? void 0 : options.variables,
};
setResult(result);
if ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onData) {
ref.current.options.onData({
client: client,
data: result,
});
}
else if ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.onSubscriptionData) {
ref.current.options.onSubscriptionData({
client: client,
subscriptionData: result,
});
}
},
error: function (error) {
var _a, _b;
if (!subscriptionStopped) {
setResult({
loading: false,
data: void 0,
error: error,
variables: options === null || options === void 0 ? void 0 : options.variables,
});
(_b = (_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);
}
},
complete: function () {
var _a, _b;
if (!subscriptionStopped) {
if ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onComplete) {
ref.current.options.onComplete();
}
else if ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.onSubscriptionComplete) {
ref.current.options.onSubscriptionComplete();
}
}
},
});
return function () {
// immediately stop receiving subscription values, but do not unsubscribe
// until after a short delay in case another useSubscription hook is
// reusing the same underlying observable and is about to subscribe
subscriptionStopped = true;
setTimeout(function () {
subscription.unsubscribe();
});
};
}, [observable]);
return result;
}
//# sourceMappingURL=useSubscription.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hoc/graphql.js
import { parser, DocumentType } from "../parser/index.js";
import { withQuery } from "./query-hoc.js";
import { withMutation } from "./mutation-hoc.js";
import { withSubscription } from "./subscription-hoc.js";
/**
* @deprecated
* Official support for React Apollo higher order components ended in March 2020.
* This library is still included in the `@apollo/client` package, but it no longer receives feature updates or bug fixes.
*/
export function graphql(document, operationOptions) {
if (operationOptions === void 0) { operationOptions = {}; }
switch (parser(document).type) {
case DocumentType.Mutation:
return withMutation(document, operationOptions);
case DocumentType.Subscription:
return withSubscription(document, operationOptions);
case DocumentType.Query:
default:
return withQuery(document, operationOptions);
}
}
//# sourceMappingURL=graphql.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hoc/mutation-hoc.js
import { __assign, __extends, __rest } from "tslib";
import * as React from "rehackt";
import hoistNonReactStatics from "hoist-non-react-statics";
import { parser } from "../parser/index.js";
import { Mutation } from "../components/index.js";
import { defaultMapPropsToOptions, getDisplayName, calculateVariablesFromProps, GraphQLBase, } from "./hoc-utils.js";
/**
* @deprecated
* Official support for React Apollo higher order components ended in March 2020.
* This library is still included in the `@apollo/client` package, but it no longer receives feature updates or bug fixes.
*/
export function withMutation(document, operationOptions) {
if (operationOptions === void 0) { operationOptions = {}; }
// this is memoized so if coming from `graphql` there is nearly no extra cost
var operation = parser(document);
// extract options
var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.alias, alias = _b === void 0 ? "Apollo" : _b;
var mapPropsToOptions = options;
if (typeof mapPropsToOptions !== "function")
mapPropsToOptions = function () {
return options;
};
return function (WrappedComponent) {
var graphQLDisplayName = "".concat(alias, "(").concat(getDisplayName(WrappedComponent), ")");
var GraphQL = /** @class */ (function (_super) {
__extends(GraphQL, _super);
function GraphQL() {
return _super !== null && _super.apply(this, arguments) || this;
}
GraphQL.prototype.render = function () {
var props = this.props;
var opts = mapPropsToOptions(props);
if (operationOptions.withRef) {
this.withRef = true;
props = Object.assign({}, props, {
ref: this.setWrappedInstance,
});
}
if (!opts.variables && operation.variables.length > 0) {
opts.variables = calculateVariablesFromProps(operation, props);
}
return (React.createElement(Mutation, __assign({ ignoreResults: true }, opts, { mutation: document }), function (mutate, _a) {
var _b, _c;
var data = _a.data, r = __rest(_a, ["data"]);
// the HOC's historically hoisted the data from the execution result
// up onto the result since it was passed as a nested prop
// we massage the Mutation component's shape here to replicate that
// this matches the query HoC
var result = Object.assign(r, data || {});
var name = operationOptions.name || "mutate";
var resultName = operationOptions.name ? "".concat(name, "Result") : "result";
var childProps = (_b = {},
_b[name] = mutate,
_b[resultName] = result,
_b);
if (operationOptions.props) {
var newResult = (_c = {},
_c[name] = mutate,
_c[resultName] = result,
_c.ownProps = props,
_c);
childProps = operationOptions.props(newResult);
}
return React.createElement(WrappedComponent, __assign({}, props, childProps));
}));
};
GraphQL.displayName = graphQLDisplayName;
GraphQL.WrappedComponent = WrappedComponent;
return GraphQL;
}(GraphQLBase));
// Make sure we preserve any custom statics on the original component.
return hoistNonReactStatics(GraphQL, WrappedComponent, {});
};
}
//# sourceMappingURL=mutation-hoc.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hoc/subscription-hoc.js
import { __assign, __extends, __rest } from "tslib";
import * as React from "rehackt";
import hoistNonReactStatics from "hoist-non-react-statics";
import { parser } from "../parser/index.js";
import { Subscription } from "../components/index.js";
import { getDisplayName, GraphQLBase, calculateVariablesFromProps, defaultMapPropsToOptions, defaultMapPropsToSkip, } from "./hoc-utils.js";
/**
* @deprecated
* Official support for React Apollo higher order components ended in March 2020.
* This library is still included in the `@apollo/client` package, but it no longer receives feature updates or bug fixes.
*/
export function withSubscription(document, operationOptions) {
if (operationOptions === void 0) { operationOptions = {}; }
// this is memoized so if coming from `graphql` there is nearly no extra cost
var operation = parser(document);
// extract options
var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? "Apollo" : _c, shouldResubscribe = operationOptions.shouldResubscribe;
var mapPropsToOptions = options;
if (typeof mapPropsToOptions !== "function")
mapPropsToOptions = function () { return options; };
var mapPropsToSkip = skip;
if (typeof mapPropsToSkip !== "function")
mapPropsToSkip = function () { return skip; };
// allow for advanced referential equality checks
var lastResultProps;
return function (WrappedComponent) {
var graphQLDisplayName = "".concat(alias, "(").concat(getDisplayName(WrappedComponent), ")");
var GraphQL = /** @class */ (function (_super) {
__extends(GraphQL, _super);
function GraphQL(props) {
var _this = _super.call(this, props) || this;
_this.state = { resubscribe: false };
return _this;
}
GraphQL.prototype.updateResubscribe = function (resubscribe) {
this.setState({ resubscribe: resubscribe });
};
GraphQL.prototype.componentDidUpdate = function (prevProps) {
var resubscribe = !!(shouldResubscribe && shouldResubscribe(prevProps, this.props));
if (this.state.resubscribe !== resubscribe) {
this.updateResubscribe(resubscribe);
}
};
GraphQL.prototype.render = function () {
var _this = this;
var props = this.props;
var shouldSkip = mapPropsToSkip(props);
var opts = shouldSkip ? Object.create(null) : mapPropsToOptions(props);
if (!shouldSkip && !opts.variables && operation.variables.length > 0) {
opts.variables = calculateVariablesFromProps(operation, props);
}
return (React.createElement(Subscription, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {
var _b, _c;
var data = _a.data, r = __rest(_a, ["data"]);
if (operationOptions.withRef) {
_this.withRef = true;
props = Object.assign({}, props, {
ref: _this.setWrappedInstance,
});
}
// if we have skipped, no reason to manage any reshaping
if (shouldSkip) {
return (React.createElement(WrappedComponent, __assign({}, props, {})));
}
// the HOC's historically hoisted the data from the execution result
// up onto the result since it was passed as a nested prop
// we massage the Query components shape here to replicate that
var result = Object.assign(r, data || {});
var name = operationOptions.name || "data";
var childProps = (_b = {}, _b[name] = result, _b);
if (operationOptions.props) {
var newResult = (_c = {},
_c[name] = result,
_c.ownProps = props,
_c);
lastResultProps = operationOptions.props(newResult, lastResultProps);
childProps = lastResultProps;
}
return (React.createElement(WrappedComponent, __assign({}, props, childProps)));
}));
};
GraphQL.displayName = graphQLDisplayName;
GraphQL.WrappedComponent = WrappedComponent;
return GraphQL;
}(GraphQLBase));
// Make sure we preserve any custom statics on the original component.
return hoistNonReactStatics(GraphQL, WrappedComponent, {});
};
}
//# sourceMappingURL=subscription-hoc.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/react/hoc/query-hoc.js
import { __assign, __extends, __rest } from "tslib";
import * as React from "rehackt";
import hoistNonReactStatics from "hoist-non-react-statics";
import { parser } from "../parser/index.js";
import { Query } from "../components/index.js";
import { getDisplayName, GraphQLBase, calculateVariablesFromProps, defaultMapPropsToOptions, defaultMapPropsToSkip, } from "./hoc-utils.js";
/**
* @deprecated
* Official support for React Apollo higher order components ended in March 2020.
* This library is still included in the `@apollo/client` package, but it no longer receives feature updates or bug fixes.
*/
export function withQuery(document, operationOptions) {
if (operationOptions === void 0) { operationOptions = {}; }
// this is memoized so if coming from `graphql` there is nearly no extra cost
var operation = parser(document);
// extract options
var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? "Apollo" : _c;
var mapPropsToOptions = options;
if (typeof mapPropsToOptions !== "function") {
mapPropsToOptions = function () { return options; };
}
var mapPropsToSkip = skip;
if (typeof mapPropsToSkip !== "function") {
mapPropsToSkip = function () { return skip; };
}
// allow for advanced referential equality checks
var lastResultProps;
return function (WrappedComponent) {
var graphQLDisplayName = "".concat(alias, "(").concat(getDisplayName(WrappedComponent), ")");
var GraphQL = /** @class */ (function (_super) {
__extends(GraphQL, _super);
function GraphQL() {
return _super !== null && _super.apply(this, arguments) || this;
}
GraphQL.prototype.render = function () {
var _this = this;
var props = this.props;
var shouldSkip = mapPropsToSkip(props);
var opts = shouldSkip ? Object.create(null) : __assign({}, mapPropsToOptions(props));
if (!shouldSkip && !opts.variables && operation.variables.length > 0) {
opts.variables = calculateVariablesFromProps(operation, props);
}
return (React.createElement(Query, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document }), function (_a) {
var _b, _c;
var _ = _a.client, data = _a.data, r = __rest(_a, ["client", "data"]);
if (operationOptions.withRef) {
_this.withRef = true;
props = Object.assign({}, props, {
ref: _this.setWrappedInstance,
});
}
// if we have skipped, no reason to manage any reshaping
if (shouldSkip) {
return (React.createElement(WrappedComponent, __assign({}, props, {})));
}
// the HOC's historically hoisted the data from the execution result
// up onto the result since it was passed as a nested prop
// we massage the Query components shape here to replicate that
var result = Object.assign(r, data || {});
var name = operationOptions.name || "data";
var childProps = (_b = {}, _b[name] = result, _b);
if (operationOptions.props) {
var newResult = (_c = {},
_c[name] = result,
_c.ownProps = props,
_c);
lastResultProps = operationOptions.props(newResult, lastResultProps);
childProps = lastResultProps;
}
return (React.createElement(WrappedComponent, __assign({}, props, childProps)));
}));
};
GraphQL.displayName = graphQLDisplayName;
GraphQL.WrappedComponent = WrappedComponent;
return GraphQL;
}(GraphQLBase));
// Make sure we preserve any custom statics on the original component.
return hoistNonReactStatics(GraphQL, WrappedComponent, {});
};
}
//# sourceMappingURL=query-hoc.js.map
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TitleHeader/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import { buildTitle } from "../../_atom/Title";
import { buildText } from "../../_atom/Text";
import { defaultTextFont } from "../../_static/Typography";
export const Title = buildTitle({
bold: true,
fontSize: 14,
color: buildColor("blue", "500"),
uppercase: true,
qaLabel: "titleHeader-title"
});
export const TitleHeaderWrapper = styled.div`
background-color: ${buildColor("blue", "000")};
padding: 0 8px;
display: flex;
${(props) =>
props.subTitlePos === "bottom"
? css`
align-items: initial;
flex-direction: column;
justify-content: center;
`
: css`
align-items: center;
justify-content: space-between;
`}
height: 40px;
${(props) =>
props.showTopBorder &&
css`
border-top: 1px solid ${buildColor("blue", "100")};
`};
${(props) =>
props.showBottomBorder &&
css`
border-bottom: 1px solid ${buildColor("blue", "100")};
`};
`;
export const RightText = buildText({
fontSize: 12,
qaLabel: "titleHeader-subTitle"
});
export const BottomText = styled.strong`
font-family: ${defaultTextFont};
font-size: 12px;
font-weight: bold;
font-style: normal;
line-height: 1.33;
text-transform: uppercase;
color: ${buildColor("grey", "900")};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TitleHeader/index.jsx
import React, { PureComponent } from "react";
import {
Title,
TitleHeaderWrapper,
RightText,
BottomText
} from "./styled-components";
export default class TitleHeader extends PureComponent {
static defaultProps = {
title: "",
subTitle: "",
subTitlePos: "right",
showTopBorder: true,
showBottomBorder: true,
qaLabel: ""
};
renderSubTitle = () => {
const posMap = {
right: RightText,
bottom: BottomText
};
const SubTitleComp = posMap[this.props.subTitlePos];
return <SubTitleComp>{this.props.subTitle}</SubTitleComp>;
};
render() {
return (
<TitleHeaderWrapper
data-qa-label={this.props.qaLabel || "titleHeader"}
showTopBorder={this.props.showTopBorder}
showBottomBorder={this.props.showBottomBorder}
subTitlePos={this.props.subTitlePos}
>
<Title>{this.props.title}</Title>
{this.props.subTitle && this.renderSubTitle()}
</TitleHeaderWrapper>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/TrackListMain/styled-components.js
import styled, { css } from "styled-components";
import Button from "../../_atom/Buttons/button";
import Icon from "../../_static/Icons/index";
import MessageBox from "../../_molecule/MessageBox/index";
import buildColor from "../../_static/ColorPalette";
export const LoginButton = styled(Button)`
margin-right: ${(props) => props.hasSignUp && "8px"};
`;
export const LockIcon = styled(Icon)`
margin-right: 4px;
`;
export const EmptyState = styled(MessageBox)`
border-radius: 2px;
`;
export const WhiteBackground = styled.div`
background-color: ${buildColor("white", "100")};
padding: 8px;
`;
export const ButtonsContainer = styled.div`
display: flex;
justify-content: flex-end;
margin-top: 8px;
`;
export const ListTracks = styled.div`
& > :not(:first-child) {
border-top: 1px solid ${buildColor("blue", "100")};
}
`;
export const ListTracksSection = styled.section`
border-bottom: 1px solid ${buildColor("grey", "300")};
${(props) =>
props.device === "tablet" &&
css`
border: 1px solid ${buildColor("grey", "300")};
border-radius: 2px;
overflow: hidden;
`};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/TrackListMain/index.jsx
import React, { PureComponent } from "react";
import TitleHeader from "../../_molecule/TitleHeader";
import getEmptyState from "./emptyStates";
import { ListTracks, ListTracksSection } from "./styled-components";
export default class TrackListMain extends PureComponent {
static defaultProps = {
hasTracks: false,
title: "",
children: null,
emptyStateData: { type: "DEFAULT" },
isLoading: false,
qaLabelId: "",
device: "mobile"
};
render() {
return (
<ListTracksSection
data-qa-label={`tracks-${this.props.qaLabelId}`}
device={this.props.device}
>
<TitleHeader
title={this.props.title}
showTopBorder={this.props.device !== "tablet"}
/>
{!this.props.hasTracks && !this.props.isLoading ? (
getEmptyState(this.props.emptyStateData)
) : (
<ListTracks data-qa-label="trackList-items">
{this.props.children}
</ListTracks>
)}
</ListTracksSection>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/TrackListMain/emptyStates.jsx
import React from "react";
import Button from "../../_atom/Buttons/button";
import LinkButton from "../../_atom/Buttons/buttonLink";
import { lock, selectFavorite } from "../../_static/Icons/icons";
import Icon from "../../_static/Icons";
import buildColor from "../../_static/ColorPalette";
import {
EmptyState,
WhiteBackground,
ButtonsContainer,
LoginButton,
LockIcon
} from "./styled-components";
export const isExternalSignup = (signUpUrl) =>
/^https?:\/\//.test(signUpUrl || "");
const getEmptyState = (emptyStateData) => {
switch (emptyStateData.type) {
case "AZ_FILTERS":
return (
<WhiteBackground>
<EmptyState
type="warning"
message={
'Your filters have hidden all tracks. "CLEAR FILTERS" to see tracks'
}
>
{emptyStateData.onClearFilters && (
<ButtonsContainer>
<Button
type="secondary"
onClick={emptyStateData.onClearFilters}
>
clear filters
</Button>
</ButtonsContainer>
)}
</EmptyState>
</WhiteBackground>
);
case "AZ_NO_TRACKS":
return (
<WhiteBackground>
<EmptyState
type="warning"
message="There seems to be a problem loading in the tracks that are running today."
/>
</WhiteBackground>
);
case "FAV_FILTERS":
return (
<WhiteBackground>
<EmptyState
type="warning"
message={
'Your filters have hidden your favorite tracks. "CLEAR FILTERS" to see favorites'
}
>
{emptyStateData.onClearFilters && (
<ButtonsContainer>
<Button
type="secondary"
onClick={emptyStateData.onClearFilters}
>
clear filters
</Button>
</ButtonsContainer>
)}
</EmptyState>
</WhiteBackground>
);
case "FAV_LOGIN":
return (
<WhiteBackground>
<EmptyState
type="warning"
message="You need to be logged in to be able to see favorites"
>
<ButtonsContainer>
{emptyStateData.onLoginClick && (
<LoginButton
hasSignUp={emptyStateData.signUpUrl}
type="secondary"
onClick={emptyStateData.onLoginClick}
>
<LockIcon
icon={lock}
size={16}
color={buildColor("grey", "900")}
/>
<span>Login</span>
</LoginButton>
)}
{emptyStateData.signUpUrl && (
<LinkButton
tag={
isExternalSignup(emptyStateData.signUpUrl) ? "a" : "link"
}
url={emptyStateData.signUpUrl}
>
<span>Sign up</span>
</LinkButton>
)}
</ButtonsContainer>
</EmptyState>
</WhiteBackground>
);
case "FAV_NO_FAVORITES":
return (
<WhiteBackground>
<EmptyState
type="infoNoBackground"
message="No favorite tracks selected. Tap the star icon to add a track shortcut here."
>
<div style={{ textAlign: "center", marginTop: "10px" }}>
<Icon icon={selectFavorite} size={40} />
</div>
</EmptyState>
</WhiteBackground>
);
case "FAV_NO_RACES_TODAY":
return (
<WhiteBackground>
<EmptyState
type="infoNoBackground"
message="There are no races running for your favorite tracks today"
/>
</WhiteBackground>
);
case "DEFAULT":
default:
return (
<WhiteBackground>
<EmptyState
type="warning"
message="There seems to be a problem loading in the tracks that are running today."
/>
</WhiteBackground>
);
}
};
export default getEmptyState;
webpack://frontend-tpt/../../packages/tvg-comp-tracks-header/actions.js
export const selectRaceFilter = (filterSelected) => ({
type: "RACE_FILTER_SELECTED",
payload: { filterSelected }
});
export const selectRegionFilter = (filterSelected) => ({
type: "REGION_FILTER_SELECTED",
payload: { filterSelected }
});
export const setRaceFiltersFromPreferences = (filters) => ({
type: "SET_RACE_FILTERS",
payload: { filters }
});
export const setRegionFiltersFromPreferences = (filters) => ({
type: "SET_REGION_FILTERS",
payload: { filters }
});
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ExpandableRow/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import { generateTransition, cubic } from "../../_static/Transitions";
export const RowContainer = styled.div`
${({ forceHeight }) =>
forceHeight &&
css`
div:first-child {
max-height: 108px;
}
`}
`;
export const Row = styled.div.attrs({
"data-qa-label": "expandableRow"
})`
display: flex;
flex-flow: column nowrap;
background-color: ${buildColor("white", "100")};
& > div:last-child {
position: relative;
}
`;
export const ExpandableHeader = styled.div`
position: relative;
&:active {
background-color: ${buildColor("blue", "000")};
}
`;
export const IconContainer = styled.div`
width: 16px;
height: 16px;
position: absolute;
right: 8px;
top: 50%;
z-index: 0;
will-change: transform;
transition: ${generateTransition(cubic, "transform")};
transform: translateY(-8px)
rotate(${(props) => (props.isOpen ? "180deg" : "0deg")});
`;
export const ClickableArea = styled.div`
background: none;
display: block;
width: 100%;
position: relative;
z-index: 1;
padding-right: 32px;
`;
export const RowLineBreak = styled.div`
height: 1px;
width: 100%;
background-color: ${buildColor("grey", "200")};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/ExpandableRow/index.jsx
import React, { PureComponent } from "react";
import { Collapse } from "react-collapse";
import { bindAll, noop } from "lodash";
import Icon from "../../_static/Icons/index";
import buildColor from "../../_static/ColorPalette";
import { arrowDown } from "../../_static/Icons/icons";
import {
RowContainer,
Row,
ExpandableHeader,
IconContainer,
ClickableArea,
RowLineBreak
} from "./styled-components";
export default class ExpandableRow extends PureComponent {
static defaultProps = {
header: null,
children: null,
isExpandable: true,
isOpen: false,
onExpand: noop,
className: "",
hasLineBreak: false,
forceHeight: false,
trackCode: ""
};
constructor(props) {
super(props);
this.state = {
isOpen: props.isOpen
};
bindAll(this, "onExpand");
}
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
if (
nextProps.isOpen !== undefined &&
nextProps.isOpen !== this.props.isOpen
) {
this.setState({
isOpen: nextProps.isOpen
});
}
}
onExpand() {
if (this.props.isExpandable) {
this.props.onExpand(this.state.isOpen);
this.setState((prevState) => ({
isOpen: !prevState.isOpen
}));
}
}
render() {
return (
<RowContainer forceHeight={this.props.forceHeight}>
<Row
className={this.props.className}
data-qa-label={`expandableRow-collapser${this.props.trackCode}`}
>
<ExpandableHeader onTouchStart={noop}>
<ClickableArea onClick={this.onExpand}>
{this.props.header}
</ClickableArea>
{this.props.isExpandable && (
<IconContainer isOpen={this.state.isOpen}>
<Icon
icon={arrowDown}
size={16}
color={buildColor("grey", "600")}
qaLabel="expandableRow-arrow-icon"
/>
</IconContainer>
)}
</ExpandableHeader>
{this.props.isExpandable && (
<Collapse
isOpened={this.state.isOpen}
springConfig={{ stiffness: 200, damping: 25 }}
>
{this.props.children}
</Collapse>
)}
</Row>
{this.props.hasLineBreak && <RowLineBreak />}
</RowContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/TextHighlighted/styled-components.js
import styled from "styled-components";
import { buildText } from "../Text";
const createTextHighlightComponent = (
type,
fontSize,
bold,
uppercase,
qaLabel
) => styled(
buildText({ fontSize, color: type.textColor, bold, uppercase, qaLabel })
)`
background-color: ${type.bgColor};
padding: 0 2px;
border-radius: 30px;
display: inline-flex;
@media (pointer: coarse) {
padding: 0 6px;
}
`;
export default createTextHighlightComponent;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/TextHighlighted/index.jsx
import React, { PureComponent } from "react";
import createTextHighlightComponent from "./styled-components";
import buildColor from "../../_static/ColorPalette";
export const TYPES = {
primary: {
bgColor: buildColor("blue_accent", "500"),
textColor: buildColor("white", "100")
},
secondary: {
bgColor: buildColor("blue", "100"),
textColor: buildColor("grey", "900")
},
bet: {
bgColor: buildColor("green", "600"),
textColor: buildColor("white", "100")
},
marketing: {
bgColor: buildColor("yellow", "500"),
textColor: buildColor("grey", "900")
},
pending: {
bgColor: buildColor("grey", "100"),
textColor: buildColor("grey", "800")
}
};
export const getType = (type) => TYPES[type];
export const buildTextHighlighted = createTextHighlightComponent;
export default class TextHighlighted extends PureComponent {
static defaultProps = {
children: null,
fontSize: 11,
type: "primary",
uppercase: true,
bold: false,
className: "",
qaLabel: ""
};
render() {
const ExtendedText = createTextHighlightComponent(
getType(this.props.type),
this.props.fontSize,
this.props.bold,
this.props.uppercase,
this.props.qaLabel
);
return (
<ExtendedText className={this.props.className}>
{this.props.children}
</ExtendedText>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/TrackInfoRow/styled-components.js
import styled from "styled-components";
import ButtonDefault from "../../_atom/Buttons/default";
import TextHighlighted from "../../_atom/TextHighlighted";
import buildColor from "../../_static/ColorPalette";
import { buildText } from "../../_atom/Text/index";
import { titleFont } from "../../_static/Typography";
export const TrackInfo = styled.div.attrs({
"data-qa-label": "trackInfo"
})`
width: 100%;
height: 40px;
padding: 8px;
display: flex;
justify-content: space-between;
align-items: center;
`;
export const TrackName = styled(
buildText({
fontSize: 14,
uppercase: true,
ellipsis: true,
qaLabel: "trackInfo-trackName"
})
)`
font-family: ${titleFont};
`;
export const LabelText = styled(
buildText({
fontSize: 10,
uppercase: true,
bold: true,
color: buildColor("grey", "800"),
qaLabel: "trackInfo-promoLabel"
})
)`
margin-left: 3px;
display: inline-flex;
align-items: center;
`;
export const GreyhoundText = buildText({
fontSize: 11,
uppercase: true,
ellipsis: true,
bold: true,
color: buildColor("grey", "800"),
qaLabel: "trackInfo-isGreyhound"
});
export const TrackContainer = styled.div`
flex: 1 1 100%;
padding: ${(props) => props.isTaggable && "0 8px"};
padding-right: ${(props) => !props.isTaggable && "8px"};
min-width: 0;
`;
export const FavoriteButton = styled(ButtonDefault)`
flex: 0 0 24px;
height: 24px;
background-color: transparent;
`;
export const HighLightedLabels = styled(TextHighlighted)`
margin-left: 2px;
`;
export const LabelsContainer = styled.div.attrs({
"data-qa-label": "trackInfo-labels"
})`
flex: 0 0 auto;
display: flex;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/TrackInfoRow/index.jsx
import React, { Component, Fragment } from "react";
import { noop } from "lodash";
import { buildTextHighlighted } from "../../_atom/TextHighlighted";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import { star, promo } from "../../_static/Icons/icons";
import {
TrackName,
GreyhoundText,
TrackInfo,
LabelsContainer,
FavoriteButton,
TrackContainer,
LabelText
} from "./styled-components";
export default class TrackInfoRow extends Component {
static defaultProps = {
trackName: "",
trackCode: "",
isFavorite: false,
isGreyhound: false,
labels: [],
className: "",
onTagFavorite: noop,
isTalentPicksContext: false,
hasPromoBadge: false
};
getLabel = (label) => {
const ResultsLabel = buildTextHighlighted(
{
bgColor: buildColor("grey", "100"),
textColor: buildColor("grey", "900")
},
11,
true,
true,
`trackInfo-${label.text}Label`
);
switch (label.text) {
case "promo":
return (
this.props.hasPromoBadge && (
<Fragment key={`promo:${label.text}`}>
<Icon size={14} icon={promo} />
<LabelText>{label.text}</LabelText>
</Fragment>
)
);
case "bet":
case "res":
default:
return (
<ResultsLabel
key={`key:${label.text}${label.type}`}
qaLabel={`trackInfo-${label.text}Label`}
>
{label.text}
</ResultsLabel>
);
}
};
render() {
const componentProps = {
className: this.props.className
};
return (
<TrackInfo {...componentProps}>
{this.props.onTagFavorite !== noop &&
!this.props.isTalentPicksContext && (
<FavoriteButton
onClick={(e) => {
e.stopPropagation();
this.props.onTagFavorite();
}}
qaLabel={`trackInfo-favBtn-${this.props.isFavorite ? "on" : "off"}`}
>
<Icon
icon={star}
size={18}
color={
!this.props.isFavorite
? buildColor("grey", "100")
: buildColor("yellow", "500")
}
/>
</FavoriteButton>
)}
<TrackContainer isTaggable={this.props.onTagFavorite !== noop}>
<TrackName>{this.props.trackName}</TrackName>
{!!this.props.isGreyhound && (
<GreyhoundText>Greyhounds</GreyhoundText>
)}
</TrackContainer>
{!!this.props.labels.length && (
<LabelsContainer>
{this.props.labels.map(this.getLabel)}
</LabelsContainer>
)}
</TrackInfo>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/theme/tokens/colors.ts
import { Colors } from "../types";
export const colors: Colors = {
blue_accent: {
"000": "#FAFCFF",
"100": "#EBF5FF",
"200": "#CDDFFA",
"300": "#AFCCFA",
"400": "#87B2F5",
"500": "#5390ED",
"600": "#3574D4",
"700": "#2F67BD",
"800": "#2959A3",
"900": "#1C3D70"
},
green: {
"000": "#F5FFF7",
"100": "#CEEBD4",
"200": "#B1DEBA",
"300": "#90D19D",
"400": "#69BF7A",
"500": "#38AB4F",
"600": "#329A47",
"700": "#2D873F",
"800": "#246F33",
"900": "#195024"
},
yellow: {
"000": "#FFF6E0",
"100": "#FFECBF",
"200": "#FFE099",
"300": "#FFD470",
"400": "#FFC642",
"500": "#FFB80C",
"600": "#E6A40A",
"700": "#CA9008",
"800": "#A87707",
"900": "#795605"
},
blue: {
"000": "#E9EFF5",
"100": "#D6E3F0",
"200": "#B7CCE1",
"300": "#92B0CE",
"400": "#668FB8",
"500": "#27619B",
"600": "#23568A",
"700": "#1E4B79",
"800": "#193D62",
"900": "#112B44"
},
orange: {
"000": "#FFF3E6",
"100": "#FFE6CC",
"200": "#FAD5AF",
"300": "#F5C089",
"400": "#F0A556",
"500": "#ED850C",
"600": "#D67A11",
"700": "#BD6909",
"800": "#AD6008",
"900": "#854A06"
},
red: {
"000": "#FCEBEB",
"100": "#F7D5D5",
"200": "#F5BCBC",
"300": "#F09E9E",
"400": "#E87676",
"500": "#DE3131",
"600": "#C92C2C",
"700": "#B02727",
"800": "#912020",
"900": "#661616"
},
grey: {
"000": "#F8F8F9",
"100": "#ECEDEE",
"200": "#DEE1E3",
"300": "#CFD2D6",
"400": "#BFC4C8",
"500": "#ADB3B9",
"600": "#99A0A7",
"700": "#818A92",
"800": "#626D78",
"900": "#384048"
},
black: {
"000": "rgba(0, 0, 0, 0.1)",
"100": "rgba(0, 0, 0, 0.2)",
"200": "rgba(0, 0, 0, 0.3)",
"300": "rgba(0, 0, 0, 0.4)",
"400": "rgba(0, 0, 0, 0.5)",
"500": "rgba(0, 0, 0, 0.6)",
"600": "rgba(0, 0, 0, 0.7)",
"700": "rgba(0, 0, 0, 0.8)",
"800": "rgba(0, 0, 0, 0.9)",
"900": "#000000"
},
white: {
"000": "rgba(255, 255, 255, 0.1)",
"100": "rgba(255, 255, 255, 0.2)",
"200": "rgba(255, 255, 255, 0.3)",
"300": "rgba(255, 255, 255, 0.4)",
"400": "rgba(255, 255, 255, 0.5)",
"500": "rgba(255, 255, 255, 0.6)",
"600": "rgba(255, 255, 255, 0.7)",
"700": "rgba(255, 255, 255, 0.8)",
"800": "rgba(255, 255, 255, 0.9)",
"900": "#FFFFFF"
},
tint: {
blue_tint: "#1A4066",
green_tint: "#194546",
yellow_tint: "#414739"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/theme/ThemeProvider.tsx
import React, { FC } from "react";
import { ThemeProvider } from "styled-components";
import {
fanduelColorTokens,
tvgColorTokens
} from "../../src/theming/themes/tokens";
import { ThemeProps } from "./types";
import {
colors,
elevations,
space,
iconSizes,
fonts,
fontSizes,
lineHeights,
lineHeightsShorter,
lineHeightsTaller,
fontWeights
} from "./tokens";
interface TVGThemeProviderProps {
children: React.ReactNode;
isFanduelTheme?: boolean;
}
const TVG_THEME = {
name: "tvg",
colors,
elevations,
space,
iconSizes,
colorTokens: tvgColorTokens,
fonts,
fontSizes,
lineHeights,
lineHeightsShorter,
lineHeightsTaller,
fontWeights
};
const TVGThemeProvider: FC<TVGThemeProviderProps> = ({
children,
isFanduelTheme
}) => {
const colorTokens = isFanduelTheme ? fanduelColorTokens : tvgColorTokens;
return (
<ThemeProvider theme={{ ...TVG_THEME, colorTokens } as ThemeProps}>
{children}
</ThemeProvider>
);
};
export { TVG_THEME, TVGThemeProvider, iconSizes };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/theme/tokens/elevations.ts
import { rgba } from "polished";
import { colors } from "./colors";
import { Elevations } from "../types";
export const elevations: Elevations = {
low: `0px 1px 3px ${rgba(colors.blue["900"], 0.12)}`,
medium: `0px 2px 4px ${rgba(colors.blue["900"], 0.14)}`,
high: `0px 1px 16px ${rgba(colors.blue["900"], 0.25)}`
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/theme/tokens/space.ts
import { Space } from "../types";
export const space: Space = {
"space-1": "4px",
"space-2": "6px",
"space-3": "8px",
"space-4": "12px",
"space-5": "16px",
"space-6": "20px",
"space-7": "24px",
"space-8": "32px"
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/theme/tokens/iconSizes.ts
import { IconSizes } from "../types";
export const iconSizes: IconSizes = {
s: {
iconSize: "16",
strokeWidth: "2.3"
},
m: {
iconSize: "20",
strokeWidth: "2.2"
},
l: {
iconSize: "24",
strokeWidth: "2"
},
xl: {
iconSize: "32",
strokeWidth: "1.6"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/theme/tokens/fonts.ts
import { FontWeights, Fonts, FontSizes, LineHeights } from "../types";
export const fonts: Fonts = {
condensedRegular: "RobotoCondensed-Regular",
regular: "Roboto-Regular",
medium: "Roboto-Medium",
bold: "Roboto-Bold"
};
export const fontSizes: FontSizes = {
xs: "12px",
s: "14px",
m: "16px",
l: "18px",
xl: "20px",
"2xl": "24px",
"3xl": "28px",
"4xl": "32px"
};
export const lineHeights: LineHeights = {
xs: "15px",
s: "18px",
m: "20px",
l: "22px",
xl: "25px",
"2xl": "30px",
"3xl": "35px",
"4xl": "40px"
};
export const lineHeightsShorter = {
xs: "13px",
s: "15px"
};
export const lineHeightsTaller = {
xs: "18px",
s: "21px"
};
export const fontWeights: FontWeights = {
normal: 400,
medium: 500,
bold: 700
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/hooks/useTheme/index.ts
import { TVG_THEME, ThemeProps } from "../../theme";
export const useTheme = (): ThemeProps => TVG_THEME;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/styled-components.ts
import styled from "styled-components";
import { space } from "styled-system";
export const Svg = styled.svg`
${space}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Icon/index.tsx
import React, { FC, memo } from "react";
import type { IconSizeVariants } from "../../theme";
import { useColorTokens, useTheme } from "../../hooks";
import * as Icons from "./components/IconPaths";
import { Svg } from "./styled-components";
import type { IconNames, IconProps } from "./types";
export const Icon: FC<IconProps> = memo(
({
name,
lineColor = "content.link",
size,
backgroundColor = "transparent",
qaLabel,
...rest
}) => {
const { iconSizes } = useTheme();
const { iconSize, strokeWidth } = iconSizes[size as IconSizeVariants];
const IconContent = Icons[name as IconNames];
// TODO: delete when color tokens for every use case are implemented
// Checking if color has # or rgba, so we use the color instead of token
const filterColor = (color: string | undefined) =>
color && (color.includes("#") || color.includes("rgba"))
? color
: useColorTokens(color);
const checkIsTransparent = (color: string) =>
backgroundColor === "transparent" ? "transparent" : filterColor(color);
const selectedLineColor = lineColor.startsWith("--")
? `var(${lineColor})`
: filterColor(lineColor);
const selectedBackgroundColor = backgroundColor.startsWith("--")
? `var(${backgroundColor})`
: checkIsTransparent(backgroundColor);
return (
<Svg
width={iconSize}
height={iconSize}
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
data-qa-label={qaLabel || name}
{...rest}
>
<IconContent
lineColor={selectedLineColor}
backgroundColor={selectedBackgroundColor}
strokeWidth={strokeWidth}
/>
</Svg>
);
}
);
export type { IconProps, IconNames };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/LoadingSpinner/styled-components.ts
import styled, { keyframes } from "styled-components";
import { space } from "styled-system";
const PathAnimationOne = keyframes`
0% {
stroke-dashoffset: 67.69px;
}
41.3793% {
stroke-dashoffset: 68.69px;
animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
}
100% {
stroke-dashoffset: -69.69px;
}
`;
const PathAnimationTwo = keyframes`
0% {
stroke-dashoffset: 68.69px;
animation-timing-function: cubic-bezier(0.42, 0, 1, 1);
}
58.6207% {
stroke-dashoffset: -68.69px;
}
100% {
stroke-dashoffset: -68.69px;
}
`;
export const Svg = styled.svg`
${space}
`;
export const AnimatedCircleOne = styled.ellipse`
animation: ${PathAnimationOne} 2.9s linear infinite both;
`;
export const AnimatedCircleTwo = styled.ellipse`
animation: ${PathAnimationTwo} 2.9s linear infinite both;
`;
export const Circle = styled.ellipse``;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/LoadingSpinner/index.tsx
import React, { FC } from "react";
import { useColorTokens } from "@tvg/design-system/web/hooks";
import type { IconSizeVariants } from "../../theme";
import { useTheme } from "../../hooks";
import {
Svg,
AnimatedCircleOne,
AnimatedCircleTwo,
Circle
} from "./styled-components";
import type { LoadingSpinnerProps } from "./types";
export const LoadingSpinner: FC<LoadingSpinnerProps> = ({
size = "s",
color = "--fd-colors-component-button-tertiary-content-active",
bgColor = "--fd-colors-core-white-tint-020",
qaLabel = "loading-spinner",
...rest
}) => {
const { iconSizes } = useTheme();
const { iconSize, strokeWidth } = iconSizes[size as IconSizeVariants];
const filterColor = (receivedColor: string | undefined) =>
receivedColor && (receivedColor.includes("#") || color.includes("rgba"))
? receivedColor
: useColorTokens(receivedColor);
const filteredColor = color.startsWith("--")
? `var(${color})`
: filterColor(color);
const filterBgColor = bgColor.startsWith("--")
? `var(${bgColor})`
: filterColor(bgColor);
return (
<Svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width={iconSize}
height={iconSize}
data-qa-label={qaLabel}
{...rest}
>
<Circle
rx="11"
ry="11"
fill="none"
stroke={filterBgColor}
strokeWidth={strokeWidth}
strokeDashoffset="0"
strokeLinecap="round"
transform="translate(12,12)"
/>
<AnimatedCircleOne
rx="11"
ry="11"
fill="none"
stroke={filteredColor}
strokeWidth={strokeWidth}
strokeDashoffset="67.69"
strokeDasharray="68.69"
strokeLinecap="round"
transform="translate(8,8) rotate(-90) translate(-4,4)"
/>
<AnimatedCircleTwo
rx="11"
ry="11"
fill="none"
stroke={filteredColor}
strokeWidth={strokeWidth}
strokeDashoffset="68.69"
strokeDasharray="68.69"
strokeLinecap="round"
transform="translate(8,8) rotate(-90) translate(-4,4)"
/>
</Svg>
);
};
export type { LoadingSpinnerProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Button/styled-components.ts
import styled from "styled-components";
import {
space,
width,
layout,
flexbox,
border,
boxShadow,
compose,
variant as styledVariant
} from "styled-system";
import type { ColorPropertiesGroups, IconPosition, ButtonSize } from "./types";
export const buttonSizes = {
s: {
height: "26px",
padding: "4px 8px"
},
m: {
height: "32px",
padding: "7px 8px"
},
ml: {
height: "44px",
padding: "8px 8px"
},
l: {
height: "44px",
padding: "13px 16px"
}
};
const buttonStyles = compose(
space,
width,
layout,
flexbox,
boxShadow,
border,
styledVariant({ prop: "size", variants: buttonSizes })
);
export const StyledButton = styled.button<{
colorPalette: ColorPropertiesGroups;
iconPosition: IconPosition;
isLoading: boolean;
isStretched: boolean;
size: ButtonSize;
hasIcon: boolean;
}>`
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
gap: 8px;
flex-shrink: 0;
font-family: Roboto-Medium, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: 125%;
color: ${({ colorPalette }) => colorPalette.default?.color};
background-color: ${({ colorPalette, isLoading }) =>
isLoading
? colorPalette.pressed?.background
: colorPalette.default?.background};
border: ${({ colorPalette }) => colorPalette.default?.border};
box-shadow: ${({ colorPalette }) => colorPalette.default?.boxShadow};
opacity: 1;
flex-grow: ${({ isStretched }) => (isStretched ? 1 : 0)};
${({ isStretched }) =>
isStretched ? "width: 100%;" : "align-self: flex-start;"};
flex-direction: ${({ iconPosition }) =>
iconPosition === "end" ? "row-reverse" : "row"};
${buttonStyles};
& svg path,
svg rect {
stroke: ${({ colorPalette, hasIcon }) =>
hasIcon && colorPalette.default.color};
}
@media (hover: hover) {
&:hover {
background-color: ${({ colorPalette }) =>
colorPalette.hovered?.background};
border: ${({ colorPalette }) => colorPalette.hovered?.border};
box-shadow: ${({ colorPalette }) => colorPalette.hovered?.boxShadow};
color: ${({ colorPalette }) => colorPalette.hovered?.color};
& svg path,
svg rect {
stroke: ${({ colorPalette }) => colorPalette.hovered?.color};
}
}
}
&:active {
background-color: ${({ colorPalette }) => colorPalette.pressed?.background};
border: ${({ colorPalette }) => colorPalette.pressed?.border};
box-shadow: ${({ colorPalette }) => colorPalette.pressed?.boxShadow};
color: ${({ colorPalette }) => colorPalette.pressed?.color};
& svg path,
svg rect {
stroke: ${({ colorPalette, hasIcon }) =>
hasIcon && colorPalette.pressed.color};
}
}
&:disabled {
background-color: ${({ colorPalette }) =>
colorPalette.disabled?.background};
border: ${({ colorPalette }) => colorPalette.disabled?.border};
box-shadow: ${({ colorPalette }) => colorPalette.disabled?.boxShadow};
color: ${({ colorPalette }) => colorPalette.disabled?.color};
cursor: default;
& svg path,
svg rect {
stroke: ${({ colorPalette, hasIcon }) =>
hasIcon && colorPalette.disabled.color};
}
}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Button/buttonsColorPalette.ts
export const primary = {
default: {
background: "var(--fd-colors-component-button-secondary-background-base)",
border:
"1px solid var(--fd-colors-component-button-secondary-background-base)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-secondary-content-base)"
},
hovered: {
background: "var(--fd-colors-component-button-secondary-background-hover)",
border:
"1px solid var(--fd-colors-component-button-secondary-background-hover)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-secondary-content-hover)"
},
pressed: {
background: "var(--fd-colors-component-button-secondary-background-active)",
border:
"1px solid var(--fd-colors-component-button-secondary-background-active)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-secondary-content-active)"
},
disabled: {
background:
"var(--fd-colors-component-button-secondary-background-disabled)",
border:
"1px solid var(--fd-colors-component-button-secondary-background-disabled)",
boxShadow: "none",
color: "var(--fd-colors-component-button-secondary-content-disabled)"
}
};
export const primaryDark = {
default: {
background: "var(--fd-colors-component-button-secondary-background-base)",
border:
"1px solid var(--fd-colors-component-button-secondary-background-base)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-secondary-content-base)"
},
hovered: {
background: "var(--fd-colors-component-button-secondary-background-hover)",
border:
"1px solid var(--fd-colors-component-button-secondary-background-hover)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-secondary-content-hover)"
},
pressed: {
background: "var(--fd-colors-component-button-secondary-background-active)",
border:
"1px solid var(--fd-colors-component-button-secondary-background-active)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-secondary-content-active)"
},
disabled: {
background: "var(--fd-colors-core-white-tint-005)",
border: "1px solid var(--fd-colors-core-white-tint-005)",
boxShadow: "none",
color: "var(--fd-colors-component-button-secondary-content-disabled)"
}
};
export const secondary = {
default: {
background: "var(--fd-colors-background-surface)",
border: `1px solid var(--fd-colors-component-button-tertiary-border-base)`,
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-tertiary-content-base)"
},
hovered: {
background: "var(--fd-colors-component-button-tertiary-background-hover)",
border: `1px solid var(--fd-colors-component-button-tertiary-border-hover)`,
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-tertiary-content-hover)"
},
pressed: {
background: "var(--fd-colors-component-button-tertiary-background-active)",
border: `1px solid var(--fd-colors-component-button-tertiary-border-active)`,
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-tertiary-content-active)"
},
disabled: {
background:
"var(--fd-colors-component-button-tertiary-background-disabled)",
border: `1px solid var(--fd-colors-component-button-tertiary-border-disabled)`,
boxShadow: "none",
color: "var(--fd-colors-component-button-tertiary-content-disabled)"
}
};
export const secondaryDark = {
default: {
background:
"var(--fd-colors-component-button-transparent-background-hover)",
border:
"1px solid var(--fd-colors-component-button-transparent-background-hover)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-transparent-content-base)"
},
hovered: {
background: "var(--fd-colors-core-white-tint-020)",
border: "1px solid var(--fd-colors-core-white-tint-020)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-transparent-content-hover)"
},
pressed: {
background: "var(--fd-colors-core-white-tint-030)",
border: "1px solid var(--fd-colors-core-white-tint-030)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-transparent-content-active)"
},
disabled: {
background:
"var(--fd-colors-component-button-transparent-background-disabled)",
border:
"1px solid var(--fd-colors-component-button-transparent-background-disabled)",
boxShadow: "none",
color: "var(--fd-colors-component-button-transparent-content-disabled)"
}
};
export const tertiary = {
default: {
background: "var(--fd-colors-component-button-button-link-background-base)",
border:
"1px solid var(--fd-colors-component-button-button-link-background-base)",
boxShadow: "none",
color: "var(--fd-colors-component-button-tertiary-content-base)"
},
hovered: {
background: "var(--fd-colors-component-button-tertiary-background-hover)",
border:
"1px solid var(--fd-colors-component-button-tertiary-background-hover)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-tertiary-content-hover)"
},
pressed: {
background:
"var(--fd-colors-component-button-button-link-background-active)",
border:
"1px solid var(--fd-colors-component-button-button-link-background-active)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-tertiary-content-active)"
},
disabled: {
background:
"var(--fd-colors-component-button-button-link-background-disabled)",
border:
"1px solid var(--fd-colors-component-button-button-link-background-disabled)",
boxShadow: "none",
color: "var(--fd-colors-component-button-tertiary-content-disabled)"
}
};
export const tertiaryDark = {
default: {
background: "var(--fd-colors-component-button-transparent-background-base)",
border:
"1px solid var(--fd-colors-component-button-transparent-background-base)",
boxShadow: "none",
color: "var(--fd-colors-component-button-transparent-content-base)"
},
hovered: {
background:
"var(--fd-colors-component-button-transparent-background-hover)",
border:
"1px solid var(--fd-colors-component-button-transparent-background-hover)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-transparent-content-hover)"
},
pressed: {
background: "var(--fd-colors-core-white-tint-030)",
border: "1px solid var(--fd-colors-core-white-tint-030)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-transparent-content-active)"
},
disabled: {
background:
"var(--fd-colors-component-button-transparent-background-disabled)",
border:
"1px solid var(--fd-colors-component-button-transparent-background-disabled)",
boxShadow: "none",
color: "var(--fd-colors-component-button-transparent-content-disabled)"
}
};
export const betting = {
default: {
background: "var(--fd-colors-component-button-primary-background-base)",
border:
"1px solid var(--fd-colors-component-button-primary-background-base)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-primary-content-base)"
},
hovered: {
background: "var(--fd-colors-component-button-primary-background-hover)",
border:
"1px solid var(--fd-colors-component-button-primary-background-hover)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-primary-content-hover)"
},
pressed: {
background: "var(--fd-colors-component-button-primary-background-active)",
border:
"1px solid var(--fd-colors-component-button-primary-background-active)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-primary-content-active)"
},
disabled: {
background: "var(--fd-colors-component-button-primary-background-disabled)",
border:
"1px solid var(--fd-colors-component-button-primary-background-disabled)",
boxShadow: "none",
color: "var(--fd-colors-component-button-primary-content-disabled)"
}
};
export const promo = {
default: {
background: "var(--fd-colors-brand-tertiary-default)",
border: "1px solid var(--fd-colors-brand-tertiary-default)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-content-on-light)"
},
hovered: {
background: "var(--fd-colors-core-yellow-l-3)",
border: "1px solid var(--fd-colors-core-yellow-l-3)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-content-on-light)"
},
pressed: {
background: "var(--fd-colors-core-yellow-l-2)",
border: "1px solid var(--fd-colors-core-yellow-l-2)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-content-on-light)"
},
disabled: {
background: "var(--fd-colors-component-button-primary-background-disabled)",
border:
"1px solid var(--fd-colors-component-button-primary-background-disabled)",
boxShadow: "none",
color: "var(--fd-colors-component-button-primary-content-disabled)"
}
};
export const destructive = {
default: {
background: "var(--fd-colors-component-button-destructive-background-base)",
border:
"1px solid var(--fd-colors-component-button-destructive-background-base)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-destructive-content-base)"
},
hovered: {
background:
"var(--fd-colors-component-button-destructive-background-hover)",
border:
"1px solid var(--fd-colors-component-button-destructive-background-hover)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-destructive-content-hover)"
},
pressed: {
background:
"var(--fd-colors-component-button-destructive-background-active)",
border:
"1px solid var(--fd-colors-component-button-destructive-background-active)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-destructive-content-active)"
},
disabled: {
background:
"var(--fd-colors-component-button-destructive-background-disabled)",
border:
"1px solid var(--fd-colors-component-button-destructive-background-disabled)",
boxShadow: "none",
color: "var(--fd-colors-component-button-destructive-content-disabled)"
}
};
export const tertiaryDestructive = {
default: {
background: "var(--fd-colors-component-button-button-link-background-base)",
border:
"1px solid var(--fd-colors-component-button-button-link-background-base)",
boxShadow: "none",
color: "var(--fd-colors-link-destructive-base)"
},
hovered: {
background: "var(--fd-colors-core-red-l-5)",
border: "1px solid var(--fd-colors-core-red-l-5)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-link-destructive-hover)"
},
pressed: {
background:
"var(--fd-colors-component-button-destructive-background-active)",
border:
"1px solid var(--fd-colors-component-button-destructive-background-active)",
boxShadow: "var(--fd-shadows-elevations-bottom-low)",
color: "var(--fd-colors-component-button-tertiary-content-active)"
},
disabled: {
background:
"var(--fd-colors-component-button-button-link-background-disabled)",
border:
"1px solid var(--fd-colors-component-button-button-link-background-disabled)",
boxShadow: "none",
color: "var(--fd-colors-component-button-tertiary-content-disabled)"
}
};
export const buttonsColorPalette = {
primary,
secondary,
tertiary,
betting,
promo,
destructive,
tertiaryDestructive,
primaryDark,
secondaryDark,
tertiaryDark
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Button/utils.ts
import type { ColorPropertiesGroups, ButtonVariant } from "./types";
import { buttonsColorPalette } from "./buttonsColorPalette";
export const createPalette = (
variant: ButtonVariant,
colorsObject?: ColorPropertiesGroups
) => {
const baseColors = buttonsColorPalette[variant as ButtonVariant];
return { ...baseColors, ...colorsObject };
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Button/index.tsx
import React from "react";
import type { ButtonProps, ButtonIcon, ButtonVariant } from "./types";
import { Icon, type IconNames } from "../Icon";
import { LoadingSpinner } from "../LoadingSpinner";
import { StyledButton } from "./styled-components";
import { createPalette } from "./utils";
import { buttonsColorPalette } from "./buttonsColorPalette";
const getButtonIcon = (icon: ButtonIcon) =>
React.isValidElement(icon) ? (
icon
) : (
<Icon
name={icon as IconNames}
size="s"
lineColor="--fd-colors-component-button-secondary-content-base"
backgroundColor="transparent"
qaLabel="button-icon"
/>
);
export const Button = ({
variant = "primary",
size = "l",
children,
onClick,
isLoading = false,
iconPosition = "start",
icon,
overrideColors,
isStretched = false,
isDisabled = false,
qaLabel = "button",
...rest
}: ButtonProps) => {
const colorPalette = createPalette(variant, overrideColors);
return (
<StyledButton
size={size}
disabled={isDisabled}
colorPalette={colorPalette}
isStretched={isStretched}
isLoading={isLoading}
iconPosition={iconPosition}
onClick={onClick}
hasIcon={!!icon}
data-qa-label={qaLabel}
{...rest}
>
{isLoading ? (
<LoadingSpinner
size="s"
color={
isDisabled
? "--fd-colors-core-blue-d-1"
: "--fd-colors-component-button-tertiary-content-active"
}
bgColor={
isDisabled
? "--fd-colors-core-blue-l-4"
: "--fd-colors-core-white-tint-020"
}
/>
) : (
<>
{icon && getButtonIcon(icon)}
{children}
</>
)}
</StyledButton>
);
};
export { buttonsColorPalette };
export type { ButtonProps, ButtonVariant };
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/EmptyRaceList/styled-components.ts
import styled from "styled-components";
export const Container = styled.div`
margin: 12px;
`;
export const EmptyTitle = styled.p`
margin: 21px 0 8px 0;
& + div {
align-items: flex-start;
padding-left: 0;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/EmptyRaceList/index.tsx
import React from "react";
import { Button } from "@tvg/design-system/web";
import { Container, EmptyTitle } from "./styled-components";
interface Props {
title: string;
actionText: string;
onActionClick: () => void;
}
const EmptyRaceList = ({ title, actionText, onActionClick }: Props) => (
<Container>
<EmptyTitle>{title}</EmptyTitle>
<Button
variant="tertiary"
qaLabel="todays-racing-link"
iconPosition="end"
icon="arrowRight"
onClick={() => onActionClick()}
>
{actionText}
</Button>
</Container>
);
export default EmptyRaceList;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Masks/races.jsx
import React, { PureComponent } from "react";
import styled, { keyframes } from "styled-components";
import buildColor from "../ColorPalette";
const SVGContainer = styled.div`
width: 100%;
`;
const pulseAnimation = keyframes`
0% {
fill: ${buildColor("blue", "100")};
}
50% {
fill: ${buildColor("blue", "200")};
}
100% {
fill: ${buildColor("blue", "100")};
}
`;
const SVG = styled.svg`
display: block;
width: 100%;
height: 720px;
background: ${buildColor("white", "100")};
rect.pulse {
animation: ${pulseAnimation} 1.25s infinite;
}
rect.stroke {
stroke: ${buildColor("blue", "200")};
stroke-width: 1;
}
`;
export default class RacesMask extends PureComponent {
render() {
return (
<SVGContainer data-qa-label="racesMask">
<SVG>
<g fill="none" fillRule="evenodd">
<g transform="translate(0 -48)">
<rect
className="stroke"
width="91"
height="47"
x="12.5"
y="48.5"
rx="4"
/>
<rect
className="stroke"
width="91"
height="47"
x="112.5"
y="48.5"
rx="4"
/>
<rect
className="pulse"
width="15"
height="8"
x="20"
y="77"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="15"
height="8"
x="120"
y="77"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="35"
height="8"
x="20"
y="59"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="51"
height="8"
x="120"
y="59"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="stroke"
width="91"
height="47"
x="212.5"
y="48.5"
rx="4"
/>
<rect
className="pulse"
width="15"
height="8"
x="220"
y="77"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="51"
height="8"
x="220"
y="59"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="stroke"
width="91"
height="47"
x="312.5"
y="48.5"
rx="4"
/>
</g>
<rect
className="pulse"
width="15"
height="8"
x="320"
y="29"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="35"
height="8"
x="320"
y="11"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="stroke"
width="91"
height="47"
x="412.5"
y=".5"
rx="4"
/>
<rect
className="pulse"
width="15"
height="8"
x="420"
y="29"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="51"
height="8"
x="420"
y="11"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="stroke"
width="91"
height="47"
x="512.5"
y=".5"
rx="4"
/>
<rect
className="pulse"
width="15"
height="8"
x="520"
y="29"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="35"
height="8"
x="520"
y="11"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="stroke"
width="91"
height="47"
x="612.5"
y=".5"
rx="4"
/>
<rect
className="pulse"
width="15"
height="8"
x="620"
y="29"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="35"
height="8"
x="620"
y="11"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="stroke"
width="91"
height="47"
x="712.5"
y=".5"
rx="4"
/>
<rect
className="stroke"
width="91"
height="47"
x="812.5"
y=".5"
rx="4"
/>
<rect
className="pulse"
width="15"
height="8"
x="720"
y="29"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="15"
height="8"
x="820"
y="29"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="35"
height="8"
x="720"
y="11"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="35"
height="8"
x="820"
y="11"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="stroke"
width="91"
height="47"
x="912.5"
y=".5"
rx="4"
/>
<rect
className="pulse"
width="15"
height="8"
x="920"
y="29"
fill={buildColor("blue", "200")}
rx="1"
/>
<rect
className="pulse"
width="35"
height="8"
x="920"
y="11"
fill={buildColor("blue", "200")}
rx="1"
/>
</g>
</SVG>
</SVGContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RaceLinkAbbr/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import buildColor from "../../_static/ColorPalette";
import { buildTitle } from "../../_atom/Title";
import { buildTextHighlighted } from "../../_atom/TextHighlighted";
export const RaceLinkTitle = buildTitle({
tag: "h6",
fontSize: 14,
bold: true,
uppercase: true
});
export const BetLabel = buildTextHighlighted(
{ bgColor: buildColor("blue", "800"), textColor: buildColor("white", "100") },
11,
true,
true,
"raceLinkAbbr-betLabel"
);
export const ResultsLabel = styled(
buildTextHighlighted(
{
bgColor: buildColor("grey", "100"),
textColor: buildColor("grey", "900")
},
11,
true,
true,
"raceLinkAbbr-resultsLabel"
)
)`
padding-top: 1px;
`;
export const LabelsWrapper = styled.span`
display: flex;
align-items: center;
margin-left: 5px;
> span {
width: 12px;
height: 12px;
&:not(:last-child) {
margin-right: 2px;
}
}
`;
export const RaceLinkAbbrLink = styled(Link).attrs((props) => ({
id: props.id,
"data-qa-label": "raceLinkAbbr"
}))`
text-decoration: none;
outline: none;
color: ${buildColor("grey", "900")};
background-color: ${buildColor("white", "100")};
border-radius: 2px;
border: 1px solid ${buildColor("grey", "300")};
box-shadow: 0 1px 0 0 ${buildColor("grey", "300")};
padding: 5px 8px;
min-width: 64px;
display: inline-flex;
flex-direction: column;
&:active {
background-color: ${buildColor("blue", "000")};
}
`;
export const RaceLinkAbbrNameWrapper = styled.span`
display: flex;
justify-content: space-between;
align-items: center;
`;
export const MtpContainer = styled.span`
${(props) =>
props.smaller &&
css`
& > time > span {
width: 28px;
height: 12px;
font-size: 11px;
}
`};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RaceLinkAbbr/index.jsx
import React, { Component } from "react";
import { noop, get } from "lodash";
import buildRaceUrl, { buildTalentPickRaceUrl } from "@tvg/formatter/url";
import Icon from "../../_static/Icons";
import buildColor from "../../_static/ColorPalette";
import { promo, promosolid } from "../../_static/Icons/icons";
import {
RaceLinkAbbrNameWrapper,
RaceLinkAbbrLink,
LabelsWrapper,
ResultsLabel,
BetLabel,
RaceLinkTitle,
MtpContainer
} from "./styled-components";
import MTP from "../../_atom/MTP";
export default class RaceLinkAbbr extends Component {
static defaultProps = {
idPrefix: "",
trackName: "",
trackCode: "",
number: "",
hasBets: false,
promo: null,
hasResults: false,
isGreyhound: false,
postTime: null,
mtp: null,
showTrackCode: false,
onRaceClick: noop,
isTalentPicksContext: false,
isMTPNewRules: false
};
renderLabels = () => {
if (this.props.hasBets || this.props.promo) {
const renderPromoIcon = () =>
get(this.props.promo, "isOptedIn", false) ? (
<Icon
size={14}
icon={promosolid}
color={buildColor("yellow", "500")}
/>
) : (
<Icon size={14} icon={promo} />
);
return (
<LabelsWrapper>
{this.props.hasBets && <BetLabel>B</BetLabel>}
{get(this.props.promo, "isAboveTheLine", false) && renderPromoIcon()}
</LabelsWrapper>
);
}
return null;
};
render() {
const id =
this.props.idPrefix && this.props.trackCode && this.props.number
? `${this.props.idPrefix}_raceElement_${this.props.trackCode}_${this.props.number}`
: "";
const url = !this.props.isTalentPicksContext
? buildRaceUrl(
this.props.trackCode,
this.props.trackName,
this.props.number
)
: buildTalentPickRaceUrl(
this.props.trackCode,
this.props.trackName,
this.props.number
);
return (
<RaceLinkAbbrLink
onTouchStart={noop}
id={id}
data-qa-label="raceLinkAbbr"
number={this.props.number}
onClick={() => this.props.onRaceClick(url)}
to={url}
>
<RaceLinkAbbrNameWrapper>
<RaceLinkTitle>
{this.props.showTrackCode && (
<span
data-qa-label="raceLinkAbbr-trackCode"
style={{ marginRight: "3px" }}
>
{this.props.trackCode}
</span>
)}
<span data-qa-label="raceLinkAbbr-raceNumber">
R{this.props.number}
</span>
</RaceLinkTitle>
{this.renderLabels()}
</RaceLinkAbbrNameWrapper>
<span>
{this.props.hasResults ? (
<ResultsLabel>RES</ResultsLabel>
) : (
<MtpContainer smaller={this.props.raceStatus === "SK"}>
<MTP
mtp={this.props.mtp}
postTime={this.props.postTime}
status={this.props.raceStatus}
paddingless
isMTPNewRules={this.props.isMTPNewRules}
/>
</MtpContainer>
)}
</span>
</RaceLinkAbbrLink>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-utils/swipeEventHandlers.js
let xDown = null;
let timeStamp = null;
export const handleTouchStart = (evt) => {
xDown = evt.touches[0].clientX;
};
export const handleTouchMove = (evt) => {
if (timeStamp && Date.now() - timeStamp < 1000) {
return 0;
}
timeStamp = Date.now();
return xDown - evt.touches[0].clientX;
};
export const evaluateReachingEdge = (e) => {
const scrollableElement = e.currentTarget;
let edgeHasBeenReached = false;
if (scrollableElement) {
const { scrollLeft, scrollWidth, clientWidth } = scrollableElement;
edgeHasBeenReached =
(scrollLeft === 0 && xDown - e.touches[0].clientX < 0) ||
(scrollLeft + clientWidth === scrollWidth &&
xDown - e.touches[0].clientX > 0);
}
return edgeHasBeenReached;
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/TrackLine/styled-components.js
import styled, { css } from "styled-components";
import { fontNormal, fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const Container = styled.div`
width: 100%;
height: 96px;
padding: 0;
display: flex;
flex-direction: column;
`;
export const TrackInfo = styled.div`
width: 100%;
display: flex;
flex-direction: row;
padding: 0 12px;
`;
export const FavoriteIconWrapper = styled.button`
width: 16px;
height: 24px;
padding: 0;
margin-right: 8px;
display: flex;
justify-content: center;
align-items: center;
background-color: transparent;
outline: none;
cursor: pointer;
`;
export const TrackName = styled.span`
display: flex;
align-items: center;
flex-grow: 1;
color: ${buildColor("grey", "900")};
font-family: ${fontMedium};
font-size: 14px;
font-weight: 500;
height: 24px;
> :first-child {
width: 100%;
}
`;
export const RaceList = styled.ul`
flex-grow: 1;
display: flex;
flex-wrap: nowrap;
list-style: none;
position: relative;
overflow: ${(props) => (props.device === "desktop" ? "hidden" : "auto")};
padding-bottom: 12px;
li:first-child {
padding-left: 0;
${(props) =>
props.device === "desktop"
? css`
margin-left: ${props.hasNavigation ? "8px" : 0};
`
: css`
margin-left: 12px;
`};
}
li:last-child {
${(props) =>
props.device === "desktop"
? css`
min-width: 100px;
padding-right: 8px;
`
: css`
min-width: 104px;
padding-right: 12px;
`};
}
li {
margin-left: 8px;
}
${(props) =>
props.hasLineBreak &&
css`
flex-flow: wrap;
li,
li:first-child {
margin-left: 8px;
margin-bottom: 8px;
}
`}
`;
export const DesktopWrapper = styled.div`
display: flex;
flex-direction: row;
padding: 0 12px;
`;
export const PaginationWrapper = styled.div`
margin: 0;
background: ${buildColor("blue_accent", "000")};
border-radius: 4px;
border: 1px solid ${buildColor("blue", "100")};
height: 48px;
min-width: 32px;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
&:hover {
cursor: pointer;
}
& > button {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
overflow: hidden;
background-color: ${buildColor("blue_accent", "000")};
svg {
fill: ${buildColor("blue_accent", "500")};
display: flex;
align-items: center;
justify-content: center;
}
&:hover {
background-color: ${buildColor("blue_accent", "100")};
}
}
> :first-child {
display: flex;
}
`;
export const ResultedTag = styled.span`
color: ${buildColor("grey", "800")};
font-family: ${fontNormal};
font-size: 14px;
letter-spacing: 0;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TrackRaceLink/styled-components.js
import styled from "styled-components";
import { Link } from "react-router-dom";
import { fontNormal, fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const Container = styled(Link)`
width: 92px;
height: 48px;
padding: 6px 8px;
background: ${buildColor("blue_accent", "000")};
border: 1px solid ${buildColor("blue", "100")};
box-shadow: 0 1px 2px 0 ${buildColor("blue", "000")};
border-radius: 4px;
display: flex;
justify-content: space-between;
flex-direction: column;
cursor: pointer;
text-decoration: none;
flex-shrink: 0;
:hover {
background-color: ${buildColor("blue_accent", "100")};
}
`;
export const RaceTime = styled.span`
width: 100%;
height: 16px;
color: ${buildColor("grey", "800")};
font-family: ${fontNormal};
font-size: 14px;
display: block;
`;
export const RaceInfo = styled.div`
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
`;
export const RaceNumber = styled.span`
flex-grow: 1;
color: ${buildColor("grey", "900")};
font-family: ${fontMedium};
font-size: 14px;
font-weight: 500;
display: block;
`;
export const RacePromoIcon = styled.span`
display: block;
width: 16px;
height: 16px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TrackRaceLink/index.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import {
Container,
RaceTime,
RaceInfo,
RaceNumber,
RacePromoIcon
} from "./styled-components";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import { promosolid, optedin } from "../../_static/Icons/icons";
import MTP from "../../_atom/MTP";
export default class TrackRaceLink extends PureComponent {
static defaultProps = {
raceTime: "",
raceNumber: "",
qaLabel: "",
hasPromo: false,
optedIn: false,
mtp: 0,
status: "O",
to: "",
onClickCallback: noop,
idPrefix: "",
trackCode: "",
isMTPNewRules: false,
isSEORacetracks: false
};
buildIdObject = () => {
const id =
this.props.idPrefix && this.props.trackCode && this.props.raceNumber
? `${this.props.idPrefix}_raceElement_${this.props.trackCode}_${this.props.raceNumber}`
: null;
return id ? {} : { id };
};
renderIcon = () =>
this.props.hasPromo && (
<RacePromoIcon>
{this.props.optedIn ? (
<Icon
qaLabel={`${this.props.qaLabel}OptedInIcon`}
icon={optedin}
color={buildColor("grey", "900")}
/>
) : (
<Icon
qaLabel={`${this.props.qaLabel}PromoIcon`}
icon={promosolid}
color={buildColor("yellow", "500")}
/>
)}
</RacePromoIcon>
);
render() {
const idObject = this.buildIdObject();
return (
<Container
{...idObject}
onClick={(event) => {
this.props.onClickCallback(event);
}}
to={this.props.to}
data-qa-label={`${this.props.qaLabel}Link`}
>
<RaceTime data-qa-label={`${this.props.qaLabel}RaceTime`}>
<MTP
mtp={this.props.mtp}
postTime={this.props.raceTime}
status={this.props.status}
isPlainMTP
isMTPNewRules={this.props.isMTPNewRules}
/>
</RaceTime>
<RaceInfo>
<RaceNumber data-qa-label={`${this.props.qaLabel}RaceNumber`}>
{this.props.isSEORacetracks
? `Race ${this.props.raceNumber}`
: `R${this.props.raceNumber}`}
</RaceNumber>
{this.renderIcon()}
</RaceInfo>
</Container>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/TrackLine/index.jsx
import React, { Component } from "react";
import { noop, get } from "lodash";
import { buildRaceUrl } from "@tvg/formatter";
import {
handleTouchMove,
handleTouchStart,
evaluateReachingEdge
} from "@tvg/utils/swipeEventHandlers";
import { getHasPromo } from "@tvg/utils/PromoUtils";
import {
DesktopWrapper,
PaginationWrapper,
RaceList
} from "./styled-components";
import Icon from "../../_static/Icons";
import { arrowBack, arrowForward } from "../../_static/Icons/icons";
import TrackRaceLink from "../../_molecule/TrackRaceLink";
import DefaultButton from "../../_atom/Buttons/default";
const bestPromo = ({ isLogged, promos }) => {
let belowTheLinePromo;
let aboveTheLinePromo;
promos.forEach((promo) => {
if (!promo.isAboveTheLine && isLogged && !belowTheLinePromo) {
belowTheLinePromo = promo;
}
if (promo.isAboveTheLine && !aboveTheLinePromo) {
aboveTheLinePromo = promo;
}
});
return belowTheLinePromo || aboveTheLinePromo;
};
export const findMissingScrollAmount = (currentScrollAmount) => {
const stringValue = currentScrollAmount.toString();
return +stringValue.substring(stringValue.length - 2, stringValue.length);
};
export default class TrackLine extends Component {
static defaultProps = {
device: "mobile",
idPrefix: "",
trackRaces: [],
qaLabel: "",
isGreyhound: false,
trackCode: "",
trackName: "",
isFavorite: false,
isLogged: false,
sendGTMScrollEvent: noop,
onRaceSelect: noop,
isMTPNewRules: false,
isSEORacetracks: false,
useIsPromoTagShownFlag: false
};
constructor(props) {
super(props);
this.SCROLL_AMOUNT = 100;
this.shallDisplayNavigationArrows = true;
this.state = {
disableLeftScroll: true,
disableRightScroll: true
};
this.scrollTimeout = null;
}
componentDidMount() {
const tempRaceList = document.getElementById(
`${this.props.idPrefix}_racesContainer-${this.props.trackCode}`
);
if (tempRaceList !== null) {
const navigationStatus = {
disableLeftScroll: tempRaceList.scrollLeft === 0,
disableRightScroll:
tempRaceList.offsetWidth + tempRaceList.scrollLeft >=
tempRaceList.scrollWidth
};
/* eslint-disable */ this.setState({
...navigationStatus
}); /* eslint-enable */
this.shallDisplayNavigationArrows = !navigationStatus.disableRightScroll;
if (
this.shallDisplayNavigationArrows &&
this.props.device === "desktop"
) {
tempRaceList.addEventListener("scroll", this.removeEventAfterScroll);
}
}
}
scrollTimeout;
// hack to detect scroll move on beginnig
removeEventAfterScroll = (event) => {
if (this.scrollTimeout) {
clearTimeout(this.scrollTimeout);
}
this.scrollTimeout = setTimeout(() => {
this.scrollRaceList(0);
event.target.removeEventListener("scroll", this.removeEventAfterScroll);
}, 50);
};
raceList;
shallDisplayNavigationArrows;
SCROLL_AMOUNT;
scrollRaceList = (amount) => {
const disableLeftScroll = this.raceList.scrollLeft + amount <= 0;
this.setState({
disableLeftScroll,
disableRightScroll:
this.raceList.offsetWidth + this.raceList.scrollLeft + amount >=
this.raceList.scrollWidth
});
if (amount !== 0) {
this.raceList.scroll({
left: this.raceList.scrollLeft + amount,
behavior: "smooth"
});
}
};
scrollForward = () => {
this.props.sendGTMScrollEvent(false);
this.scrollRaceList(this.SCROLL_AMOUNT);
};
scrollBack = () => {
const amountToScroll = this.state.disableRightScroll
? -findMissingScrollAmount(this.raceList.scrollLeft)
: -this.SCROLL_AMOUNT;
this.props.sendGTMScrollEvent(true);
this.scrollRaceList(amountToScroll);
};
handleSwipeGTMEvents = (e) => {
let swipeDirection = handleTouchMove(e);
const isLivingOnTheEdge = evaluateReachingEdge(e);
swipeDirection = isLivingOnTheEdge ? 0 : swipeDirection;
if (swipeDirection !== 0) {
this.props.sendGTMScrollEvent(swipeDirection < 0);
}
};
renderTrackRaceLinks = (isDesktop) =>
this.props.trackRaces.map((trackRace) => {
const userPromotions = get(trackRace, "userPromotions", []);
let aboveTheLine = null;
let belowTheLine = null;
userPromotions.forEach((promo) => {
if (!promo.isAboveTheLine && !belowTheLine) {
belowTheLine = promo;
}
if (promo.isAboveTheLine && !aboveTheLine) {
aboveTheLine = promo;
}
});
const tracksPromos = get(trackRace, "promos", []);
const promo = bestPromo({
isLogged: this.props.isLogged,
promos: tracksPromos
});
const userPromo = belowTheLine || aboveTheLine;
const hasPromo = get(promo, "isAboveTheLine", false) || !!userPromo;
const isPromoTagShown =
!!get(userPromo, "isPromoTagShown", false) ||
!!get(promo, "isPromoTagShown", false);
const shouldShowPromo = getHasPromo(
this.props.useIsPromoTagShownFlag,
hasPromo,
isPromoTagShown
);
const isOptedIn =
get(userPromo, "optedIn", false) || get(promo, "optedIn", false);
let promoState = "no promo";
if (isOptedIn || shouldShowPromo) {
promoState = isOptedIn ? "promo optin" : "promo";
}
const programPageURL = buildRaceUrl(
this.props.trackCode,
this.props.trackName,
trackRace.number,
this.props.device === "desktop" && this.props.isGreyhound
);
const id =
this.props.idPrefix && this.props.trackCode && trackRace.number
? `${this.props.idPrefix}_raceElement_${this.props.trackCode}_${trackRace.number}`
: "";
return (
<li
id={id}
key={`trackRaceLink_${trackRace.number}`}
data-qa-label={`trackRace${trackRace.number}Item`}
>
<TrackRaceLink
onClickCallback={(event) => {
if (isDesktop) {
event.preventDefault();
}
this.props.onRaceSelect(
programPageURL,
this.props.trackName,
trackRace,
promoState,
this.props.isFavorite,
this.props.isGreyhound
);
}}
raceNumber={trackRace.number}
raceTime={trackRace.postTime}
hasPromo={isOptedIn || shouldShowPromo}
optedIn={isOptedIn}
qaLabel="trackRace"
mtp={trackRace.mtp}
status={trackRace.raceStatus}
to={programPageURL}
isMTPNewRules={this.props.isMTPNewRules}
isSEORacetracks={this.props.isSEORacetracks}
/>
</li>
);
});
render() {
return this.props.device === "desktop" ? (
<DesktopWrapper data-qa-label={`${this.props.qaLabel}Container`}>
{this.shallDisplayNavigationArrows && (
<PaginationWrapper>
<DefaultButton
isDisabled={this.state.disableLeftScroll}
onClick={() => this.scrollBack()}
qaLabel={`${this.props.qaLabel}BackButton`}
>
<Icon icon={arrowBack} />
</DefaultButton>
</PaginationWrapper>
)}
<RaceList
data-qa-label={`${this.props.qaLabel}RaceList`}
ref={(raceList) => {
if (raceList) {
this.raceList = raceList;
}
}}
device={this.props.device}
id={`${this.props.idPrefix}_racesContainer-${this.props.trackCode}`}
hasLineBreak={this.props.isSEORacetracks}
hasNavigation={
this.props.device === "desktop" && this.shallDisplayNavigationArrows
}
>
{this.renderTrackRaceLinks(true)}
</RaceList>
{this.shallDisplayNavigationArrows && (
<PaginationWrapper isRight>
<DefaultButton
isDisabled={this.state.disableRightScroll}
onClick={() => this.scrollForward()}
qaLabel={`${this.props.qaLabel}ForwardButton`}
>
<Icon icon={arrowForward} />
</DefaultButton>
</PaginationWrapper>
)}
</DesktopWrapper>
) : (
<RaceList
id={`${this.props.idPrefix}_racesContainer-${this.props.trackCode}`}
hasLineBreak={
this.props.isSEORacetracks && this.props.device === "tablet"
}
onTouchStart={(e) => handleTouchStart(e)}
onTouchMove={(e) => this.handleSwipeGTMEvents(e)}
data-qa-label={`${this.props.qaLabel}RaceList`}
>
{this.renderTrackRaceLinks(false)}
</RaceList>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-utils/PromoUtils.ts
import { forEach, get, has } from "lodash";
// @ts-ignore
import cookie from "react-cookie";
import queryString from "query-string";
import type { Promo, RacePanelLink, UserPromotions } from "@tvg/ts-types/Race";
import type { UserOptedInPromos } from "@tvg/ts-types/User";
const getOptedInPromos = (
promos: Promo[],
optedInPromos: UserOptedInPromos,
isUserLogged = false
): Promo | null => {
let aboveTheLineRacePromo: Promo | null = null;
let belowTheLineRacePromo: Promo | null = null;
promos.forEach((promo) => {
if (promo && promo.isAboveTheLine && aboveTheLineRacePromo === null) {
aboveTheLineRacePromo = promo;
} else if (
promo &&
!promo.isAboveTheLine &&
belowTheLineRacePromo === null &&
has(optedInPromos, `[${promo.rootParentPromoID}]`)
) {
belowTheLineRacePromo = promo;
}
});
if (
isUserLogged &&
belowTheLineRacePromo &&
optedInPromos[(belowTheLineRacePromo as Promo).rootParentPromoID] !==
undefined
) {
return {
...(belowTheLineRacePromo as Promo),
isOptedIn:
optedInPromos[(belowTheLineRacePromo as Promo).rootParentPromoID]
};
}
if (
isUserLogged &&
aboveTheLineRacePromo &&
optedInPromos[(aboveTheLineRacePromo as Promo).rootParentPromoID] !==
undefined
) {
return {
...(aboveTheLineRacePromo as Promo),
isOptedIn:
optedInPromos[(aboveTheLineRacePromo as Promo).rootParentPromoID]
};
}
return aboveTheLineRacePromo;
};
export const getHasPromo = (
useIsPromoTagShownFlag: boolean,
hasPromo: boolean,
isPromoTagShown: boolean
) => (useIsPromoTagShownFlag ? hasPromo && isPromoTagShown : hasPromo);
export const hasPromoFromGraph = (
race: RacePanelLink,
useIsPromoTagShownFlag = false
) => {
const hasPromo =
!!get(race, "promos[0].isAboveTheLine", false) ||
!!get(race, "userPromotions.length", false);
const isPromoTagShown =
get(race, "promos[0].isPromoTagShown", false) ||
get(race, "userPromotions[0].isPromoTagShown", false);
const isOptedIn = get(race, "userPromotions[0].optedIn", false);
return (
(hasPromo && isOptedIn) ||
getHasPromo(useIsPromoTagShownFlag, hasPromo, isPromoTagShown)
);
};
export const getRDAOptinStatus = (race: RacePanelLink) => {
const userPromotions = get(race, "userPromotions", []);
let aboveTheLine: UserPromotions | null = null;
let belowTheLine: UserPromotions | null = null;
userPromotions.forEach((promo) => {
if (!promo.isAboveTheLine && !belowTheLine) {
belowTheLine = promo;
}
if (promo.isAboveTheLine && !aboveTheLine) {
aboveTheLine = promo;
}
});
return belowTheLine
? (belowTheLine as UserPromotions).optedIn
: get(aboveTheLine, "optedIn", false);
};
export const setRFRCookie = (isApp: boolean, location: { search: string }) => {
const { referrer } = document;
const rfrParameters = {
"12_001_0001":
/https?:\/\/(www\.tvg|4njbets\.us\.betfair)(\.[a-z]{2,3}){1,2}\/?/,
"0_022_0208": /https?:\/\/www\.google(\.[a-z]{2,3}){1,2}\/?/,
"0_023_0209": /https?:\/\/www\.bing(\.[a-z]{2,3}){1,2}\/?/,
"0_024_0210": /https?:\/\/[a-z.]+\.yahoo(\.[a-z]{2,3}){1,2}\/?/
};
const getCookieValue = (name: string) =>
document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`)?.pop() || "";
const rfrCookieExists = !document.cookie.includes("RFR=");
const existingCookie = rfrCookieExists ? "" : getCookieValue("RFR");
const queryParams = queryString.parse(location.search.toLowerCase());
const rfr = get(queryParams, "rfr", false);
const rafCode = get(queryParams, "rcode", false);
const extraCookieConfig = "/";
const existingRfrType = (cookieValue: string) => {
switch (cookieValue) {
case "":
return "empty";
case Object.keys(rfrParameters)[0]:
return "tvg";
case Object.keys(rfrParameters)[1]:
case Object.keys(rfrParameters)[2]:
case Object.keys(rfrParameters)[3]:
return "seo";
case "10_001_0001":
return "raf";
default:
return "promo";
}
};
const rfrType = existingRfrType(existingCookie);
if (referrer) {
forEach(rfrParameters, (value, key) => {
// Don't override current rfr cookie when referrer is from tvg.com
if (
value.test(referrer.toLowerCase()) &&
key !== Object.keys(rfrParameters)[0] &&
rfrType !== "raf" &&
rfrType !== "promo"
) {
// set rfr value for seo journeys
cookie.save("RFR", key, { path: extraCookieConfig });
}
});
} else if (!isApp && rfrCookieExists && !rfr) {
// set tvg.com rfr value when no referrer and no cookie is set for direct journey
cookie.save("RFR", Object.keys(rfrParameters)[0], {
path: extraCookieConfig
});
}
if (rfr) {
// set rfr value for url journeys
cookie.save("RFR", rfr, { path: extraCookieConfig });
}
if (rafCode) {
// set rfr value for refer a friend referral
cookie.save("RFR", "10_001_0001", { path: extraCookieConfig });
}
};
export default getOptedInPromos;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/RacesContainer/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
export default styled.div.attrs((props) => ({
id: props.id,
"data-qa-label": "trackList-races"
}))`
width: 100%;
overflow: scroll hidden;
padding: 0 8px 16px;
white-space: nowrap;
height: 63px;
${(props) =>
props.hasNewLayout &&
css`
display: flex;
`};
& > a:not(:first-child) {
margin-left: 8px;
}
& > a:last-child {
margin-right: 8px;
}
& .emptyStateRacesContainer {
background-color: ${buildColor("white", "100")};
display: flex;
align-items: center;
height: 63px;
white-space: normal;
& > div {
align-items: center;
}
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/ScrollWrapper/styled-components.js
import styled, { css } from "styled-components";
const CommonFaderStyles = css`
position: absolute;
width: ${(props) => props.fadersWidth}px;
z-index: 20;
${(props) =>
props.centerFaders
? css`
top: 5%;
height: 90%;
`
: css`
top: 0;
height: 100%;
`};
`;
export const ScrollWrapperContainer = styled.div`
position: relative;
overflow-x: ${({ isFullWidth }) => (isFullWidth ? "hidden" : "auto")};
z-index: ${(props) => (props.showFaders ? 1 : 0)};
${(props) =>
props.showFaders &&
css`
${props.hasContentLeft &&
css`
&::before {
content: "";
left: 0;
background-image: linear-gradient(
to left,
${props.fadeFrom},
${props.fadeTo}
);
${CommonFaderStyles};
}
`};
${props.hasContentRight &&
css`
&::after {
content: "";
right: 0;
background-image: linear-gradient(
to right,
${props.fadeFrom},
${props.fadeTo}
);
${CommonFaderStyles};
}
`};
${props.stretch && `min-width: 100%;`}
`};
`;
export default ScrollWrapperContainer;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/ScrollWrapper/index.jsx
import React, { PureComponent } from "react";
import { bindAll, get } from "lodash";
import { ScrollWrapperContainer } from "./styled-components";
export default class ScrollWrapper extends PureComponent {
static defaultProps = {
showFaders: true,
centerFaders: true,
fadersWidth: 18,
fadeFrom: "rgba(255, 255, 255, 0)",
fadeTo: "rgba(255, 255, 255, 1)",
qaLabel: "scrollWrapper",
isFullWidth: false,
stretch: true
};
constructor(props) {
super(props);
this.ref = React.createRef();
this.state = {
hasContentLeft: false,
hasContentRight: false,
isListening: false
};
bindAll(this, ["verifyContentOverflow", "checkScrollableElement"]);
}
componentDidMount() {
// FIX: fixes problem with modal opening on my bets and probables - if we dont have this setTimeout, opening my bets, the modal doesn't show any transition
// it seems that it is too much js processing and the transition group can't handle it so we need to take this execution off the call stack
setTimeout(() => this.checkScrollableElement(), 0);
}
componentDidUpdate(prevProps) {
const previousChildrenKey = get(prevProps, "children.key");
const currentChildrenKey = get(this.props, "children.key");
if (previousChildrenKey !== currentChildrenKey) {
// means content has changed, re-check for scrollable element inside children
this.checkScrollableElement();
}
}
componentWillUnmount() {
if (get(this, "scrollableElement.removeEventListener")) {
this.scrollableElement.removeEventListener(
"scroll",
this.verifyContentOverflow
);
}
}
checkScrollableElement() {
this.scrollableElement = get(this.ref, "firstChild");
if (
this.scrollableElement &&
this.scrollableElement.scrollWidth > this.scrollableElement.clientWidth
) {
this.verifyContentOverflow();
if (!this.state.isListening) {
this.scrollableElement.addEventListener(
"scroll",
this.verifyContentOverflow
);
this.setState({ isListening: true });
}
}
}
verifyContentOverflow() {
const hasContentLeft = this.scrollableElement.scrollLeft > 0;
const hasContentRight =
this.scrollableElement.scrollLeft <
this.scrollableElement.scrollWidth - this.scrollableElement.clientWidth;
this.setState({ hasContentLeft, hasContentRight });
}
ref;
scrollableElement;
render() {
return (
<ScrollWrapperContainer
data-qa-label={this.props.qaLabel}
fadersWidth={this.props.fadersWidth}
fadeFrom={this.props.fadeFrom}
fadeTo={this.props.fadeTo}
hasContentLeft={this.state.hasContentLeft}
hasContentRight={this.state.hasContentRight}
showFaders={this.props.showFaders}
centerFaders={this.props.centerFaders}
ref={(comp) => (this.ref = comp)}
isFullWidth={this.props.isFullWidth}
stretch={this.props.stretch}
>
{this.props.children}
</ScrollWrapperContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/RacesContainer/index.jsx
import React, { Component } from "react";
import { noop, get } from "lodash";
import EmptyRaceList from "@tvg/atomic-ui/_molecule/EmptyRaceList";
import RacesMask from "../../_static/Masks/races";
import RaceLinkAbbr from "../../_molecule/RaceLinkAbbr";
import TrackLine from "../../_organism/TrackLine";
import RacesContainer from "./styled-components";
import MessageBox from "../../_molecule/MessageBox";
import ScrollWrapper from "../../_molecule/ScrollWrapper";
const buildRaceContainerId = (idPrefix, trackCode) =>
`${idPrefix}_racesContainer-${trackCode}`;
export default class RaceContainer extends Component {
static defaultProps = {
idPrefix: "",
raceList: [],
trackCode: "",
trackName: "",
raceIndexScroll: 0,
onRaceClick: noop,
isGreyhound: false,
isDisplayingRaces: false,
isLoading: true,
isTalentPicksContext: false,
hasPromoBadge: false,
optedInPromos: {},
hasNewLayout: false,
isDesktop: false,
onRaceSelect: noop,
isFavorite: false,
sendGTMScrollEvent: noop,
device: "mobile",
isOpen: false,
isSEORacetracks: false,
onEmptyActionClick: noop,
isLogged: false,
isMTPNewRules: false,
useIsPromoTagShownFlag: false
};
didScrollOnce = false;
componentDidUpdate() {
if (this.props.idPrefix && this.props.raceIndexScroll) {
const elementToScrollId = `${this.props.idPrefix}_raceElement_${this.props.trackCode}_${this.props.raceIndexScroll}`;
const parentElement = document.getElementById(
buildRaceContainerId(this.props.idPrefix, this.props.trackCode)
);
const elementToScroll = document.querySelector(`#${elementToScrollId}`);
const elementToScrollPosition = elementToScroll
? elementToScroll.offsetLeft
: 0;
if (!this.props.isOpen) {
this.didScrollOnce = false;
}
if (
elementToScroll &&
parentElement &&
typeof parentElement.scrollTo === "function"
) {
if (!this.didScrollOnce) {
const offsetToScroll =
get(this.props, "raceIndexScroll", 0) === 1 ? 12 : 8;
const to = elementToScrollPosition - offsetToScroll;
// This is a trick to make a scroll smooth on Safari, because
// smooth scroll feature on Safari is not implemented yet
const smoothScrollFeature =
"scrollBehavior" in document.documentElement.style;
if (!smoothScrollFeature) {
let i = 0;
const int = setInterval(() => {
if (i > to - 20) i += 1;
else if (i > to - 40) i += 3;
else if (i > to - 80) i += 8;
else if (i > to - 160) i += 18;
else if (i > to - 200) i += 24;
else if (i > to - 300) i += 40;
else i += 60;
parentElement.scrollTo(i, 0);
if (i >= to) clearInterval(int);
}, 15);
} else {
parentElement.scrollTo({
left: to,
behavior: "smooth"
});
}
this.didScrollOnce = true;
}
// The next two lines are part of a shameful hack to activate an element reflow
// this fixes the "stuck scroll" bug described in MEP-947
if (this.props.device !== "desktop") {
parentElement.style.overflowX = "hidden";
setTimeout(() => {
parentElement.style.overflowX = "auto";
}, 0);
}
}
}
}
renderOldLayout() {
let outputMarkup;
const {
isLoading,
raceList,
optedInPromos,
idPrefix,
hasPromoBadge,
onRaceClick,
isTalentPicksContext,
trackCode,
isMTPNewRules
} = this.props;
if (isLoading) {
outputMarkup = <RacesMask />;
} else if (!raceList.length) {
outputMarkup = (
<MessageBox
className="emptyStateRacesContainer"
type="info"
message="There are no races running for this track. Please check back later."
title=""
hasIcon
isVertical={false}
/>
);
} else {
const getRacePromo = (promo) => {
if (promo) {
return {
...promo,
isOptedIn: get(optedInPromos, promo.rootParentPromoID)
};
}
return promo;
};
outputMarkup = raceList.map((race) => (
<RaceLinkAbbr
idPrefix={idPrefix}
key={`key:${race.trackCode}${race.number}`}
trackName={race.trackName}
trackCode={race.trackCode}
number={race.number}
raceStatus={race.raceStatus}
hasBets={race.hasBets}
promo={hasPromoBadge ? getRacePromo(race.promo) : null}
hasResults={race.hasResults}
postTime={race.postTime}
mtp={race.mtp}
showTrackCode={get(race, "showTrackCode", false)}
onRaceClick={(url) => onRaceClick(race, url)}
isTalentPicksContext={isTalentPicksContext}
isMTPNewRules={isMTPNewRules}
/>
));
}
return (
<ScrollWrapper centerFaders={false}>
<RacesContainer
id={buildRaceContainerId(idPrefix, trackCode)}
key={isLoading ? "loading-mask" : "races"}
hasNewLayout
>
{outputMarkup}
</RacesContainer>
</ScrollWrapper>
);
}
renderNewLayout() {
const {
isLoading,
raceList,
idPrefix,
trackCode,
isFavorite,
sendGTMScrollEvent,
onRaceSelect,
isSEORacetracks
} = this.props;
if (
((isLoading && !this.props.isDisplayingRaces) ||
(isLoading && !raceList.length)) &&
this.props.isOpen
) {
this.didScrollOnce = false;
return (
<div style={{ width: "100%", height: "72px", overflow: "hidden" }}>
<RacesMask />
</div>
);
}
if (!raceList.length && this.props.isOpen) {
return isSEORacetracks ? (
<EmptyRaceList
title="No races available today"
actionText="See all today's racing"
onActionClick={this.props.onEmptyActionClick}
/>
) : (
<MessageBox
className="emptyStateRacesContainer"
type="info"
message="There are no races running for this track. Please check back later."
title=""
hasIcon
isVertical={false}
/>
);
}
return (
<TrackLine
key={`trackLine-${trackCode}`}
idPrefix={idPrefix}
device={this.props.device}
isFavorite={isFavorite}
isGreyhound={this.props.isGreyhound}
trackCode={trackCode}
trackName={get(this.props, "trackName", "")}
trackRaces={raceList}
qaLabel="trackLine"
sendGTMScrollEvent={sendGTMScrollEvent}
onRaceSelect={onRaceSelect}
isLogged={this.props.isLogged}
isMTPNewRules={this.props.isMTPNewRules}
isSEORacetracks={this.props.isSEORacetracks}
useIsPromoTagShownFlag={this.props.useIsPromoTagShownFlag}
/>
);
}
render() {
const { hasNewLayout } = this.props;
return hasNewLayout ? this.renderNewLayout() : this.renderOldLayout();
}
}
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az-races/graphql/queries/TracksAZRacesQuery.ts
import { gql } from "@apollo/client";
export const GET_RACES_TRACKS_AZRACES = gql`
query getRacesTracksAZRaces(
$wagerProfile: String
$sortByRaceNumber: RaceListSort
$raceFilters: RaceListFilter
) {
races: races(
profile: $wagerProfile
filter: $raceFilters
sort: $sortByRaceNumber
) {
id
trackName
trackCode
number
postTime
isGreyhound
mtp
status {
code
}
promos {
rootParentPromoID
isAboveTheLine
}
}
}
`;
export default GET_RACES_TRACKS_AZRACES;
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az-races/helpers/raceIndexScroll.js
import { get, sortBy } from "lodash";
export default (raceList = []) => {
let raceToScroll = 0;
if (raceList.length) {
const allRacesOver = raceList.every(
(race) => race.status.code === "RO" || race.status.code === "SK"
);
const raceListLimit = raceList.length - 1;
if (allRacesOver) {
raceToScroll = raceList[raceListLimit].number;
} else {
const sortedFilteredRaces = sortBy(raceList, (race) => race.mtp).filter(
(race) => race.status.code === "IC" || race.status.code === "O"
);
raceToScroll = get(sortedFilteredRaces, "[0].number", 0);
}
}
return +raceToScroll;
};
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az-races/graphql/options.graph.js
import { get, isArray } from "lodash";
import raceIndexScroll from "../helpers/raceIndexScroll";
const INCLUDE_GREYHOUNDS = true;
const QUERY_VARIABLES = (trackCode = "", wagerProfile = "PORT-Generic") => ({
wagerProfile,
sortByRaceNumber: {
byRaceNumber: "ASC"
},
raceFilters: {
allRaceClasses: INCLUDE_GREYHOUNDS,
trackCode: trackCode || undefined
}
});
const raceInResults = (race) => !!(get(race, "status.code", "") === "RO");
const racesTracksAzTemplate = (races = []) =>
races.map((race) => ({
trackName: race.trackName,
trackCode: race.trackCode,
number: race.number,
raceStatus: get(race, "status.code", ""),
hasBets: false,
promo: race.promos
? {
...get(race, "promos[0]", {}),
promoPath: "",
isOptedIn: false
}
: null,
hasResults: raceInResults(race),
postTime: race.postTime,
mtp: race.mtp,
isGreyhound: race.isGreyhound,
showTrackCode: false
}));
export default {
skip: (props) => !get(props, "shouldUpdate"),
options: (props) => {
const variables = QUERY_VARIABLES(props.trackCode, props.wagerProfile);
if (props.raceTypeFilters && props.raceTypeFilters.length > 0) {
variables.raceFilters = {
...variables.raceFilters,
typeCode: props.raceTypeFilters
};
}
if (isArray(props.regionFilters)) {
if (
props.regionFilters.indexOf("USA") >= 0 &&
props.regionFilters.indexOf("INT") < 0
) {
variables.raceFilters = {
...variables.raceFilters,
includeCountries: ["USA"]
};
}
if (
props.regionFilters.indexOf("USA") < 0 &&
props.regionFilters.indexOf("INT") >= 0
) {
variables.raceFilters = {
...variables.raceFilters,
excludeCountries: ["USA"]
};
}
}
return {
fetchPolicy: "cache-and-network",
ssr: false,
variables
};
},
props: (result) => ({
raceList: racesTracksAzTemplate(result.data.races),
raceIndexScroll: raceIndexScroll(result.data.races),
isLoading: result.data.loading
})
};
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az-races/index.jsx
import React, { Component } from "react";
import mediator from "@tvg/mediator";
import { connect } from "react-redux";
import { graphql } from "@apollo/client/react/hoc";
import { get, isEqual, noop } from "lodash";
import RacesContainer from "@tvg/atomic-ui/_templates/RacesContainer";
import TracksAZRacesQuery from "./graphql/queries/TracksAZRacesQuery";
import ApolloOptions from "./graphql/options.graph";
export class TracksAzRaces extends Component {
static defaultProps = {
idPrefix: "",
wagerProfile: "PORT-Generic",
trackCode: "",
raceList: [],
shouldUpdate: false,
raceTypeFilters: [],
regionFilters: [],
raceIndexScroll: 1,
isLoading: true,
isTalentPicksContext: false,
hasPromoBadge: false,
onTalentPicksModalToggle: noop,
optedInPromos: {}
};
shouldComponentUpdate(nextProps) {
return (
!isEqual(nextProps.raceTypeFilters, this.props.raceTypeFilters) ||
!isEqual(nextProps.regionFilters, this.props.regionFilters) ||
!isEqual(this.props.optedInPromos, nextProps.optedInPromos) ||
nextProps.shouldUpdate
);
}
onRaceClickHandler = (race, url) => {
let tag = [];
let mtp;
if (race.hasBets) {
tag.push("Bet");
}
if (race.promo) {
tag.push("Promo");
}
tag = tag.length ? tag.join(",") : "no tag";
if (race.mtp === 0) {
mtp = race.raceStatus === "RO" ? "Result" : "Race off";
} else {
mtp = race.mtp;
}
mediator.base.dispatch({
type: "RACE_NAVIGATION",
payload: {
trackName: race.trackName,
raceNumber: race.number,
mtp: ` - ${mtp}`,
module: "tracks",
runnerType: race.isGreyhound ? "Greyhounds" : "Horse",
menu: "A to Z",
tag,
url
}
});
if (
this.props.isTalentPicksContext &&
this.props.onTalentPicksModalToggle
) {
this.props.onTalentPicksModalToggle();
}
};
render() {
return (
<RacesContainer
idPrefix={this.props.idPrefix}
raceList={this.props.raceList}
trackCode={this.props.trackCode}
raceIndexScroll={this.props.raceIndexScroll}
isLoading={this.props.isLoading}
onRaceClick={this.onRaceClickHandler}
isTalentPicksContext={this.props.isTalentPicksContext}
hasPromoBadge={this.props.hasPromoBadge}
optedInPromos={this.props.optedInPromos}
/>
);
}
}
export default connect(
(store) => ({
hasPromoBadge: get(store, "capi.featureToggles.promosDisplayBadge", false),
wagerProfile: get(store, "userData.user.profile", "PORT-Generic"),
raceTypeFilters: get(store, "raceFilters.raceTypeFilters"),
regionFilters: get(store, "raceFilters.regionFilters"),
optedInPromos: get(store, "userData.optedInPromos", {})
}),
() => ({})
)(graphql(TracksAZRacesQuery, ApolloOptions)(TracksAzRaces));
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-expandable-row/index.jsx
import React, { Component } from "react";
import { get, noop } from "lodash";
import ExpandableRow from "@tvg/atomic-ui/_templates/ExpandableRow";
import TrackInfoRow from "@tvg/atomic-ui/_templates/TrackInfoRow";
import TracksAzRacesComponent from "../tracks-az-races";
const getTrackComponent = (
track,
isTalentPicksContext,
hasPromoBadge = false
) => (
<TrackInfoRow
trackName={track.trackShortName}
trackCode={track.trackCode}
isFavorite={track.isFavorite}
onTagFavorite={track.onTagFavorite}
isGreyhound={track.isGreyhound}
labels={track.labels}
isTalentPicksContext={isTalentPicksContext}
hasPromoBadge={hasPromoBadge}
/>
);
/* eslint-disable */
export default class TracksExpandableRow extends Component {
static defaultProps = {
track: {
trackInfo: {
trackName: "",
trackShortName: "",
trackCode: "",
isFavorite: false,
onTagFavorite: noop,
isGreyhound: false,
labels: [],
className: ""
},
isOpen: false,
raceList: []
},
trackDropdownIsOpen: noop,
openTracks: [],
idPrefix: "",
isTalentPicksContext: false,
hasPromoBadge: false,
onTalentPicksModalToggle: noop,
isLoggedIn: false
};
shouldComponentUpdate(nextProps) {
const trackCode = this.props.track.trackInfo.trackCode;
const currentOpenTracks = this.props.openTracks;
const nextOpenTracks = nextProps.openTracks;
const changedOpenState =
currentOpenTracks.indexOf(trackCode) > -1 !==
nextOpenTracks.indexOf(trackCode) > -1;
const favoriteToggle =
this.props.track.trackInfo.isFavorite !==
nextProps.track.trackInfo.isFavorite;
const loginChanged = nextProps.isLoggedIn !== this.props.isLoggedIn;
const isOpenStateChanged =
this.props.track.isOpen !== nextProps.track.isOpen;
return (
changedOpenState || favoriteToggle || loginChanged || isOpenStateChanged
);
}
render() {
return (
<ExpandableRow
forceHeight
onExpand={(isOpen) =>
this.props.onTrackClickHandler(
this.props.track.trackInfo.trackShortName,
this.props.track.trackInfo.trackCode,
this.props.track.trackInfo.labels,
isOpen
)
}
header={getTrackComponent(
get(this, "props.track.trackInfo"),
this.props.isTalentPicksContext,
this.props.hasPromoBadge
)}
isOpen={this.props.trackDropdownIsOpen(
this.props.track.trackInfo.trackCode
)}
>
<TracksAzRacesComponent
idPrefix={this.props.idPrefix}
trackCode={this.props.track.trackInfo.trackCode}
shouldUpdate={this.props.trackDropdownIsOpen(
this.props.track.trackInfo.trackCode
)}
isTalentPicksContext={this.props.isTalentPicksContext}
onTalentPicksModalToggle={this.props.onTalentPicksModalToggle}
/>
</ExpandableRow>
);
}
}
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az/actions.js
export const toggleOpenTrackRow = (openTracks) => ({
type: "TRACKSAZ_TOGGLE_TRACK",
payload: { openTracks }
});
export default toggleOpenTrackRow;
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az/graphql/queries/TracksAZQuery.ts
import { gql } from "@apollo/client";
export const GET_TRACKS_AZ = gql`
query getTracksAZ(
$wagerProfile: String
$sortByName: TrackListSort
$trackFilters: TrackListFilter
) {
tracks: tracks(
profile: $wagerProfile
sort: $sortByName
filter: $trackFilters
) {
id
featured
name
shortName
code
numberOfRaces
isGreyhound
isFinished
hasAboveTheLinePromo
}
}
`;
export default GET_TRACKS_AZ;
webpack://frontend-tpt/../../packages/tvg-lib-ts-types/Alerts.ts
export enum ChannelType {
Email = "email",
PushNotification = "push"
}
export enum EntityType {
Race = "race",
Runner = "runner",
Jockey = "jockey",
Trainer = "trainer",
Owner = "owner"
}
export const EntityLabel = {
[EntityType.Race]: "race",
[EntityType.Runner]: "Horse",
[EntityType.Jockey]: "Jockey",
[EntityType.Trainer]: "Trainer",
[EntityType.Owner]: "Owner"
};
export enum EventType {
All = "all",
RaceResults = "raceResults",
RaceDay = "raceDay",
TimeToRace = "timeToRace"
}
export interface SubscriptionChannel {
type: ChannelType;
}
export interface Subscription {
eventType: EventType;
channels: Array<SubscriptionChannel>;
}
export interface ChannelUFC {
favoriteId: number;
entityType: EntityType;
entityName: string;
entityDob?: number;
entityRunnerId?: number;
subscriptions: Array<Subscription>;
}
export interface Pagination {
currentPage: number;
totalPages: number;
totalResults: number;
}
export interface GetAlertsResponse {
pagination: Pagination;
favorites: Array<ChannelUFC>;
}
webpack://frontend-tpt/../../packages/tvg-lib-api/ufc/index.ts
import tvgConf from "@tvg/conf";
import {
GetAlertsResponse,
ChannelType,
Subscription,
ChannelUFC,
EntityType
} from "@tvg/ts-types/Alerts";
import { FavoriteTopTracksSuccessResponse } from "@tvg/ts-types/Track";
import getProtocol from "../protocolSetter";
import requester from "../requester";
import { serviceResponse } from "../types";
const ufcService: string = "service.ufc";
const getUfcServiceUrl = (): string => `${tvgConf().config(ufcService)}`;
const getUserFavoriteTracks = (accountId: number): Promise<serviceResponse> =>
requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/tracks`,
method: "get",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const setUserFavoriteTrack = (
accountId: number,
trackCode: string
): Promise<serviceResponse> =>
requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/tracks/${trackCode}`,
method: "post",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const deleteUserFavoriteTrack = (
accountId: number,
trackCode: string
): Promise<serviceResponse> =>
requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/tracks/${trackCode}`,
method: "delete",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const getUserAlerts = (
accountId: string,
entityType: string = "race",
page?: number,
results?: number
): Promise<{ data: GetAlertsResponse; status: number }> => {
const params: Record<string, string | number> = { entityTypes: entityType };
if (page) params.page = page;
if (results) params.results = results;
return requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/favorites`,
method: "get",
params,
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
};
const deleteUserAlert = (
accountId: string,
ids: Array<number>
): Promise<{ status: number }> => {
const idsString = ids
.reduce((currentValue, accumulator) => `${currentValue}${accumulator},`, "")
.slice(0, -1);
return requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/favorites`,
method: "delete",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() },
params: { ids: idsString }
});
};
const addEntityAlerts = (accountId: string, entities: ChannelUFC[]) => {
const newAlerts = entities
.filter(({ subscriptions }) => subscriptions?.length)
.map(
({
entityRunnerId,
entityDob,
entityName,
entityType,
subscriptions
}) => ({
entityName,
entityType,
...(entityType === EntityType.Runner
? { entityRunnerId, entityDob }
: {}),
subscriptions
})
);
return requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/favorites`,
method: "post",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() },
data: newAlerts
});
};
const setUserAlerts = (
accountId: string,
entityNames: string[],
entityType: string = "race",
eventTypes: string[] = ["raceResults"],
channelType: ChannelType = ChannelType.PushNotification
): Promise<{ status: number }> => {
const subscriptions = eventTypes.map((subscription) => ({
eventType: subscription,
channels: [
{
type: channelType
}
]
}));
const newAlerts = entityNames.map((entityName) => ({
entityType,
entityName,
subscriptions
}));
return requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/favorites`,
method: "post",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() },
data: newAlerts
});
};
export const updateUserAlerts = (
accountId: string,
updates: Array<{
favoriteId: number;
subscriptions: Array<Subscription>;
}>
): Promise<{ status: number }> =>
requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/favorites`,
method: "put",
data: updates,
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
export const addFavorite = (
accountId: string,
entityType: string,
entityNames: string[]
): Promise<FavoriteTopTracksSuccessResponse> => {
const newFavorites = entityNames.map((entityName) => ({
accountId,
entityType,
entityName
}));
return requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/favorites`,
method: "post",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() },
data: newFavorites
});
};
const removeFavorite = (
accountId: string,
favoriteId: number | null
): Promise<{ status: number }> =>
requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/favorites/${favoriteId}`,
method: "delete",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
});
const addRunnerToStable = (
accountId: string,
entityType: string,
entityIds: string[],
entityDob: number,
entityName: string,
eventTypes: string[] = ["raceResults", "raceDay", "timeToRace"]
): Promise<FavoriteTopTracksSuccessResponse> => {
const subscriptions = eventTypes.map((subscription) => ({
eventType: subscription,
channels: [
{
type: "email"
}
]
}));
const newFavorites = entityIds.map((entityRunnerId) => ({
entityType,
entityRunnerId,
entityName,
entityDob,
subscriptions
}));
return requester()({
url: `${getProtocol()}${getUfcServiceUrl()}/users/${accountId}/favorites`,
method: "post",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() },
data: newFavorites
});
};
const UFC_SERVICE = {
getUserFavoriteTracks,
setUserFavoriteTrack,
deleteUserFavoriteTrack,
getUserAlerts,
deleteUserAlert,
setUserAlerts,
updateUserAlerts,
addFavorite,
removeFavorite,
addRunnerToStable,
addEntityAlerts
};
export default UFC_SERVICE;
webpack://frontend-tpt/../../packages/tvg-lib-shared-actions/UserActions.ts
import {
SetUserFavoriteTrack,
SetUserFavoriteTracks
} from "@tvg/tracks/src/v2/redux/actions";
import { ChannelUFC } from "@tvg/ts-types/Alerts";
import { FavoriteTrackWithId } from "@tvg/ts-types/User";
export type UpdateBalanceActionType = {
type: "USER_BALANCE_SUCCESS";
payload: { balance: number };
};
export type UpdateWalletBalancesActionType = {
type: "USER_WALLET_BALANCES_SUCCESS";
payload: {
balance: number;
bonus: number;
sharedDeposits: number;
sharedWinnings: number;
};
};
export type FailBalanceRequestAction = {
type: "USER_BALANCE_FAIL";
payload: Error;
error: true;
};
export type UpdatePromoFundsActionType = {
type: "USER_PROMO_FUNDS_SUCCESS";
payload: { promoFunds: number };
};
export type SetFavoriteTrackActionType = {
type: "SET_FAVORITE_TRACK";
payload: {
trackCode: string;
favoriteId?: number;
};
};
export type RemoveFavoriteTrackActionType = {
type: "REMOVE_FAVORITE_TRACK";
payload: {
trackCode: string;
};
};
export type SetDefaultBetPrefsAction = {
type: "SET_DEFAULT_BET_PREFERENCES";
payload: {};
};
export type SetNewPreferenceValue = {
type: "SET_NEW_PREFERENCE_VALUE";
payload: {
preferenceKey: string;
preferenceValue: string;
};
};
export type SetRaceAlertsActionType = {
type: "SET_RACE_ALERTS";
payload: {
channels: ChannelUFC[];
};
};
export type SetUserFavoriteTracksWithIdActionType = {
type: "SET_USER_FAVORITE_TRACKS_WITH_FAVORITE_ID";
payload: {
favoriteTracksWithId: FavoriteTrackWithId;
};
};
export type AddFavoriteTrackWithId = {
type: "SET_USER_FAVORITE_TRACKS_WITH_FAVORITE_ID";
payload: {
trackCode: string;
favoriteId: number;
};
};
export type SessionStartUpdate = {
type: "USER_SESSION_START_UPDATE";
payload: {
sessionStartAt: Date;
};
};
export const updateBalance = (balance: number): UpdateBalanceActionType => ({
type: "USER_BALANCE_SUCCESS",
payload: { balance }
});
export const failBalanceRequest = (err: Error): FailBalanceRequestAction => ({
type: "USER_BALANCE_FAIL",
payload: err,
error: true
});
export const updateWalletBalances = (
balance: number,
bonus: number,
sharedDeposits: number,
sharedWinnings: number
): UpdateWalletBalancesActionType => ({
type: "USER_WALLET_BALANCES_SUCCESS",
payload: { balance, bonus, sharedDeposits, sharedWinnings }
});
export const updatePromoFunds = (
promoFunds: number
): UpdatePromoFundsActionType => ({
type: "USER_PROMO_FUNDS_SUCCESS",
payload: { promoFunds }
});
export const setFavoriteTrack = (
trackCode: string,
favoriteId?: number
): SetFavoriteTrackActionType => ({
type: "SET_FAVORITE_TRACK",
payload: { trackCode, favoriteId }
});
export const removeFavoriteTrack = (
trackCode: string
): RemoveFavoriteTrackActionType => ({
type: "REMOVE_FAVORITE_TRACK",
payload: { trackCode }
});
export const setDefaultBetPrefs =
(preferences: {}): SetDefaultBetPrefsAction => ({
type: "SET_DEFAULT_BET_PREFERENCES",
payload: preferences
});
export const setNewPreferenceValue = (
preferenceKey: string,
preferenceValue: string
): SetNewPreferenceValue => ({
type: "SET_NEW_PREFERENCE_VALUE",
payload: { preferenceKey, preferenceValue }
});
export const setRaceAlerts = (
channels: ChannelUFC[]
): SetRaceAlertsActionType => ({
type: "SET_RACE_ALERTS",
payload: { channels }
});
export const setUserFavoriteTracksWithId = (
favoriteTracksWithId: FavoriteTrackWithId
): SetUserFavoriteTracksWithIdActionType => ({
type: "SET_USER_FAVORITE_TRACKS_WITH_FAVORITE_ID",
payload: { favoriteTracksWithId }
});
export const setUserFavoriteTracks = (
favoriteTracks: string[]
): SetUserFavoriteTracks => ({
type: "SET_USER_FAVORITE_TRACKS",
payload: { favoriteTracks }
});
export const setUserFavoriteTrack = (
trackCode: string,
favoriteId: number
): SetUserFavoriteTrack => ({
type: "SET_FAVORITE_TRACK",
payload: { trackCode, favoriteId }
});
export const sessionStartUpdate = (
sessionStartAt: Date
): SessionStartUpdate => ({
type: "USER_SESSION_START_UPDATE",
payload: {
sessionStartAt
}
});
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az/helpers/tracksAzDataFeeder.js
import mediator from "@tvg/mediator";
import ufc from "@tvg/api/ufc";
import { remove as _remove, isNumber, get } from "lodash";
import {
removeFavoriteTrack,
setFavoriteTrack,
setUserFavoriteTracksWithId
} from "@tvg/shared-actions/UserActions";
import { toggleOpenFavoriteTrackRow } from "../../tracks-favorites/actions";
const LABELS = {
BET: "bet",
RES: "res",
PROMO: "promo"
};
const labelCreator = (track) => {
let labels = [];
if (track.hasAboveTheLinePromo) {
labels.push({
text: LABELS.PROMO,
type: "secondary"
});
}
if (track.isFinished) {
labels = [];
labels.push({
text: LABELS.RES,
type: "secondary"
});
}
return labels;
};
let trackCode = "";
export const setFavoriteAfterLogin = (
accountNumber,
dispatch,
favoriteTracksWithId
) => {
if (trackCode) {
dispatch(setFavoriteTrack(trackCode));
ufc
.setUserAlerts(accountNumber.toString(), [trackCode], "track", [])
.then((result) => {
const createdFavorite = get(result, "data[0]");
const newFavoriteTrack = {};
newFavoriteTrack[createdFavorite.entityName] =
createdFavorite.favoriteId;
const updatedFavoriteTracks = {
...favoriteTracksWithId,
...newFavoriteTrack
};
// add this trackCode and favoriteId to list
dispatch(setUserFavoriteTracksWithId(updatedFavoriteTracks));
});
trackCode = "";
}
};
export default (
tracks = [],
dispatch,
favoriteTracks = [],
openFavoriteTracks = [],
accountNumber,
favoriteTracksWithId
) => {
const finalStruct = {
tracks: [],
isLoading: true
};
const addFavorite = (code) => {
if (!accountNumber || !isNumber(+accountNumber)) {
trackCode = code;
mediator.base.dispatch({
type: "OPEN_LOGIN",
payload: {
triggerAction: "tracks_az_add_favorite"
}
});
} else {
// add this track to favorites
ufc.setUserAlerts(accountNumber, [code], "track", []).then((result) => {
const createdFavorite = get(result, "data[0]");
const newFavoriteTrack = {};
newFavoriteTrack[createdFavorite.entityName] =
createdFavorite.favoriteId;
const updatedFavoriteTracks = {
...favoriteTracksWithId,
...newFavoriteTrack
};
// add this trackCode to list
dispatch(setFavoriteTrack(code));
// add this trackCode and favoriteId to list
dispatch(setUserFavoriteTracksWithId(updatedFavoriteTracks));
});
}
};
const removeFavorite = (code) => {
const remove = () => {
const openFavoriteTracksCopy = [...openFavoriteTracks];
_remove(openFavoriteTracksCopy, (codeOnArray) => codeOnArray === code);
dispatch(removeFavoriteTrack(code));
dispatch(toggleOpenFavoriteTrackRow(openFavoriteTracksCopy));
const updatedFavoriteTracks = {};
if (favoriteTracksWithId) {
Object.keys(favoriteTracksWithId).forEach((key) => {
if (key !== code) {
updatedFavoriteTracks[key] = favoriteTracksWithId[key];
}
});
dispatch(setUserFavoriteTracksWithId(updatedFavoriteTracks));
ufc.deleteUserAlert(accountNumber, [+favoriteTracksWithId[code]]);
}
};
if (!accountNumber || !isNumber(+accountNumber)) {
mediator.base.dispatch({
type: "OPEN_LOGIN",
payload: {
callback: remove,
triggerAction: "tracks_az_remove_favorite"
}
});
} else {
remove();
}
};
finalStruct.tracks = tracks.map((track) => {
const isFavorite = favoriteTracks.indexOf(track.code) > -1;
return {
trackInfo: {
trackName: track.name,
trackShortName: track.shortName,
trackCode: track.code,
isFavorite,
onTagFavorite: () =>
isFavorite ? removeFavorite(track.code) : addFavorite(track.code),
isGreyhound: track.isGreyhound,
labels: labelCreator(track)
},
isOpen: false
};
});
return finalStruct;
};
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az/graphql/options.graph.js
import { get } from "lodash";
import TracksAZDataFeeder from "../helpers/tracksAzDataFeeder";
const INCLUDE_GREYHOUNDS = true;
const buildQueryVariables = (
wagerProfile = "",
raceTypeFilters = [],
regionFilters = []
) => {
const queryVariables = {
wagerProfile,
sortByName: { byName: "ASC" },
trackFilters: { allTrackClasses: INCLUDE_GREYHOUNDS }
};
if (raceTypeFilters.length) {
queryVariables.trackFilters.raceTypes = raceTypeFilters;
}
if (regionFilters.length) {
if (regionFilters.indexOf("USA") >= 0 && regionFilters.indexOf("INT") < 0) {
queryVariables.trackFilters.includeCountries = ["USA"];
}
if (regionFilters.indexOf("USA") < 0 && regionFilters.indexOf("INT") >= 0) {
queryVariables.trackFilters.excludeCountries = ["USA"];
}
}
return queryVariables;
};
export default {
skip: (props) => !get(props, "shouldUpdate"),
options: (props) => ({
fetchPolicy: "cache-and-network",
ssr: false,
variables: buildQueryVariables(
props.wagerProfile,
props.raceTypeFilters,
props.regionFilters
)
}),
props: (result) =>
Object.assign(
TracksAZDataFeeder(
get(result, "data.tracks", []),
result.ownProps.dispatch,
result.ownProps.favoriteTracks,
result.ownProps.openFavoriteTracks,
result.ownProps.accountNumber,
result.ownProps.favoriteTracksWithId
),
{
isLoading: result.data.loading && !get(result, "data.tracks")
}
)
};
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-favorites/actions.js
export const toggleOpenFavoriteTrackRow = (openFavoriteTracks) => ({
type: "TRACKSAZ_FAV_TOGGLE_TRACK",
payload: { openFavoriteTracks }
});
export default toggleOpenFavoriteTrackRow;
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az/index.jsx
import React, { Component } from "react";
import mediator from "@tvg/mediator";
import { connect } from "react-redux";
import { graphql } from "@apollo/client/react/hoc";
import { bindAll, get, indexOf, isEqual, noop } from "lodash";
import TrackListMain from "@tvg/atomic-ui/_templates/TrackListMain";
import tvgConf from "@tvg/conf";
import filtersService from "@tvg/tracks-header/service";
import {
setRaceFiltersFromPreferences,
setRegionFiltersFromPreferences
} from "@tvg/tracks-header/actions";
import { getAccountNumber } from "@urp/store-selectors";
import TracksExpandableRow from "../tracks-expandable-row";
import { toggleOpenTrackRow } from "./actions";
import TracksQuery from "./graphql/queries/TracksAZQuery";
import ApolloOptions from "./graphql/options.graph";
import { setFavoriteAfterLogin } from "./helpers/tracksAzDataFeeder";
import perf from "./helpers/perf";
const trackGTMTagging = (trackName, trackLabels, isOpen) => {
const tag = trackLabels.length
? trackLabels.map((label) => label.text).join(", ")
: "no tag";
mediator.base.dispatch({
type: "TRACKS_TRACK_CLICK",
payload: {
isOpen,
trackName,
tag
}
});
};
const toggle = (array, valueToToggle) => {
const index = indexOf(array, valueToToggle);
const newStruct = array.slice(0);
if (index !== -1) {
newStruct.splice(index, 1);
} else {
newStruct.push(valueToToggle);
}
return newStruct;
};
/* eslint-disable */
export class TracksAz extends Component {
static defaultProps = {
accountNumber: null,
dispatch: noop,
favoriteTracks: [],
isLoading: true,
hasPromoBadge: false,
openTracks: [],
raceTypeFilters: [],
regionFilters: [],
shouldUpdate: false,
tracks: [],
wagerProfile: "PORT-Generic",
signalLoadedComponent: noop,
isTalentPicksContext: false,
onTalentPicksModalToggle: noop
};
constructor(props) {
super(props);
bindAll(this, [
"onTrackClickHandler",
"trackDropdownIsOpen",
"toggleOpenTracks"
]);
}
shouldComponentUpdate(nextProps) {
const raceTypeFiltersChanged = !isEqual(
this.props.raceTypeFilters,
nextProps.raceTypeFilters
);
const regionFiltersChanged = !isEqual(
this.props.regionFilters,
nextProps.regionFilters
);
const favoritesCountChanged =
get(this.props, "favoriteTracks.length") !==
get(nextProps, "favoriteTracks.length");
const trackCountChanged =
get(this.props, "tracks.length") !== get(nextProps, "tracks.length");
const openTracksChanged =
get(this.props, "openTracks.length") !==
get(nextProps, "openTracks.length");
const propsChanged = !isEqual(this.props, nextProps);
return (
nextProps.shouldUpdate &&
(raceTypeFiltersChanged ||
regionFiltersChanged ||
favoritesCountChanged ||
trackCountChanged ||
openTracksChanged ||
propsChanged)
);
}
componentDidUpdate(prevProps) {
if (!prevProps.accountNumber && this.props.accountNumber) {
const set = () => {
setFavoriteAfterLogin(
+this.props.accountNumber,
this.props.dispatch,
this.props.favoriteTracksWithId
);
mediator.base.unsubscribe("GOT_FAVORITE_TRACKS", set);
};
// user logged in
mediator.base.subscribe("GOT_FAVORITE_TRACKS", set);
}
if (!this.props.isLoading && this.props.shouldUpdate) {
this.props.signalLoadedComponent("tracksAz");
}
}
onTrackClickHandler(trackName, trackCode, trackLabels, isOpen) {
const openTracks = this.toggleOpenTracks(trackCode);
this.props.dispatch(toggleOpenTrackRow(openTracks));
trackGTMTagging(trackName, trackLabels, isOpen);
}
toggleOpenTracks(trackCode) {
return toggle(this.props.openTracks, trackCode);
}
trackDropdownIsOpen(trackCode) {
return this.props.openTracks.indexOf(trackCode) > -1;
}
getEmptyStateData() {
if (
get(this.props, "raceTypeFilters.length") > 0 ||
get(this.props, "regionFilters.length") > 0
) {
return {
type: "AZ_FILTERS",
onClearFilters: () => {
this.props.dispatch(setRaceFiltersFromPreferences([]));
this.props.dispatch(setRegionFiltersFromPreferences([]));
filtersService.setRaceFilterPreference([]);
filtersService.setRegionFilterPreference([]);
}
};
}
return { type: "AZ_NO_TRACKS" };
}
render() {
const TITLE = "TRACKS A-Z";
let emptyStateData;
if (get(this.props, "tracks.length")) {
perf.measure("page_load", { page: "tracks" });
} else {
emptyStateData = this.getEmptyStateData();
}
return (
<TrackListMain
hasTracks={!!get(this.props, "tracks.length")}
emptyStateData={emptyStateData}
isLoading={this.props.isLoading}
title={TITLE}
qaLabelId={"tracksAz"}
device={tvgConf().device}
>
{this.props.tracks.map((track) => (
<TracksExpandableRow
key={`trackExpandableRow${get(track, "trackInfo.trackCode")}`}
idPrefix="TracksAz"
track={track}
openTracks={this.props.openTracks}
onTrackClickHandler={this.onTrackClickHandler}
trackDropdownIsOpen={this.trackDropdownIsOpen}
isTalentPicksContext={this.props.isTalentPicksContext}
onTalentPicksModalToggle={this.props.onTalentPicksModalToggle}
hasPromoBadge={this.props.hasPromoBadge}
isLoggedIn={!!this.props.accountNumber}
/>
))}
</TrackListMain>
);
}
}
export default connect(
(store) => ({
hasPromoBadge: get(store, "capi.featureToggles.promosDisplayBadge", false),
accountNumber: getAccountNumber(store),
wagerProfile: get(store, "userData.user.profile"),
favoriteTracks: get(store, "userFavorites.tracks"),
favoriteTracksWithId: get(store, "userFavorites.tracksWithId"),
openTracks: get(store, "tracksAz.openTracks"),
raceTypeFilters: get(store, "raceFilters.raceTypeFilters"),
openFavoriteTracks: get(store, "tracksAzFavorites.openFavoriteTracks"),
regionFilters: get(store, "raceFilters.regionFilters")
}),
(dispatch) => ({ dispatch })
)(graphql(TracksQuery, ApolloOptions)(TracksAz));
webpack://frontend-tpt/../../packages/tvg-comp-tracks-header/service.js
import { attempt } from "lodash";
const RACE_FILTERS_KEY = "raceTypeFilters";
const REGION_FILTERS_KEY = "regionFilters";
const setRaceFilterPreference = (filters) =>
attempt(() =>
window.localStorage.setItem(RACE_FILTERS_KEY, filters.join(","))
);
const setRegionFilterPreference = (filters) =>
attempt(() =>
window.localStorage.setItem(REGION_FILTERS_KEY, filters.join(","))
);
const getUserRaceFilters = () => {
if (typeof window !== "undefined") {
const localStoredRaceFilters = attempt(() =>
window.localStorage.getItem(RACE_FILTERS_KEY)
);
if (localStoredRaceFilters) {
return localStoredRaceFilters.split(",");
}
}
return [];
};
const getUserRegionFilters = () => {
if (typeof window !== "undefined") {
const localStoredRegions = attempt(
() => window.localStorage.getItem(REGION_FILTERS_KEY),
null
);
if (localStoredRegions) {
return localStoredRegions.split(",");
}
}
return [];
};
export default {
setRaceFilterPreference,
setRegionFilterPreference,
getUserRaceFilters,
getUserRegionFilters
};
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az/helpers/perf.js
export default {
register: (mark, timing = null) => {
if (typeof window === "object" && window.perf) {
window.perf.register(mark, timing);
}
},
measure: (mark, tags) => {
if (typeof window === "object" && window.perf) {
window.perf.measure(mark, tags);
}
}
};
webpack://frontend-tpt/../../packages/tvg-comp-tpt-home/src/actions.js
export const picksPageLoading = (isLoading) => ({
type: "TPM_PICKS_LOADING",
payload: isLoading
});
export const successRequest = (picksList) => ({
type: "TPM_PICKS_REQUEST_SUCCESS",
payload: picksList
});
export const successNoResults = () => ({
type: "TPM_PICKS_REQUEST_SUCCESS_NO_RESULTS"
});
export const failRequest = (err) => ({
type: "TPM_PICKS_REQUEST_FAIL",
payload: err,
error: true
});
export const successPublishRequest = (picksList) => ({
type: "TPM_PICKS_REQUEST_PUBLISH_SUCCESS",
payload: picksList
});
webpack://frontend-tpt/../../packages/tvg-comp-tpt-home/src/picksFetchingService.js
import axios from "axios";
import { get } from "lodash";
import tvgConf from "@tvg/conf";
import { mapTalentPicksListFromService } from "@tvg/utils/talentPicksUtils";
import {
successRequest,
failRequest,
successNoResults,
picksPageLoading
} from "./actions";
const pickTimeout = () => (typeof window === "object" ? 10000 : 500);
const pickServiceEndpoint = (talentId, isAdmin) =>
typeof window === "undefined" &&
typeof process !== "undefined" &&
get(process, "env.ENVIRONMENT") !== "dev"
? "http://service-qa.tvg.com/tpm/v1/picks"
: `${tvgConf().config("service.tpm")}/${
isAdmin ? "" : `talents/${talentId}/`
}picks`;
const requestOptions = (talentId, isAdmin) => ({
url: pickServiceEndpoint(talentId, isAdmin),
method: "get",
timeout: pickTimeout(),
withCredentials: true,
headers: {
"content-type": "application/json"
},
data: {
isActive: true
}
});
const handleResponse = (response, dispatch) => {
if (!response || !response.data) {
return dispatch(
failRequest(
new Error("Failed to retrieve data from Talent Picks service")
)
);
}
if (!get(response, "data.length")) {
return dispatch(successNoResults());
}
return dispatch(successRequest(mapTalentPicksListFromService(response.data)));
};
const makeRequest = (dispatch, talentId, isAdmin = false) => {
const options = requestOptions(talentId, isAdmin);
return axios(options)
.then((picksData) => handleResponse(picksData, dispatch))
.catch((err) => dispatch(failRequest(err)))
.then(() => dispatch(picksPageLoading(false)));
};
export default {
makeRequest
};
webpack://frontend-tpt/../../packages/tvg-comp-tpt-home/src/index.jsx
import React, { Component, Fragment } from "react";
import { connect } from "react-redux";
import { noop, get, isEqual } from "lodash";
import TalentPicksList from "@tvg/atomic-ui/_templates/TalentPicksList";
import ModalV2 from "@tvg/atomic-ui/_templates/ModalV2";
import TracksAzComponent from "@tvg/tracks/src/tracks-az";
import TVGConf from "@tvg/conf";
import PicksFetchingService from "./picksFetchingService";
import PicksPublishingService from "./picksPublishingService";
const baseURL = `//${TVGConf().config("domain.desktop")}`;
export class TPTHome extends Component {
static defaultProps = {
talentPickList: [],
talentId: "",
accountNumber: null,
isAdmin: false
};
constructor(props) {
super(props);
this.state = { isTalentsRaceSelectorOpen: false };
}
componentDidMount() {
if (this.props.accountNumber) {
PicksFetchingService.makeRequest(
this.props.dispatch,
this.props.talentId,
this.props.isAdmin
);
}
}
shouldComponentUpdate(nextProps, nextState) {
return (
this.props.talentPickList.length !== nextProps.talentPickList.length ||
!isEqual(this.props.talentPickList, nextProps.talentPickList) ||
!isEqual(this.props, nextProps) ||
!isEqual(this.state, nextState)
);
}
openRacesModal = () => {
this.setState({ isTalentsRaceSelectorOpen: true });
};
closeRacesModal = () => {
this.setState({ isTalentsRaceSelectorOpen: false });
};
publishTogglePick = (publishData) => {
const updatedData = { ...publishData, published: !publishData.published };
PicksPublishingService.makeRequest(
this.props.dispatch,
this.props.talentPickList,
updatedData
);
return updatedData.published;
};
renderRacesSelectorModal = () => {
const props = {
title: "Race Selector",
isOpen: this.state.isTalentsRaceSelectorOpen,
onClose: this.closeRacesModal,
qaLabel: "talents-RaceSelector",
offsetTop: 0,
isFullHeight: true,
isFullWidth: true,
animation: "fade"
};
return (
<ModalV2 {...props}>
{() => (
<TracksAzComponent
shouldUpdate={this.state.isTalentsRaceSelectorOpen}
signalLoadedComponent={noop}
isTalentPicksContext
/>
)}
</ModalV2>
);
};
render() {
return (
<Fragment>
<TalentPicksList
imageBaseURL={baseURL}
onNewPick={this.openRacesModal}
talentPickList={this.props.talentPickList}
onPublishToggle={this.publishTogglePick}
context="talentPicks"
onProgramPage={false}
/>
{this.renderRacesSelectorModal()}
</Fragment>
);
}
}
export default connect(
(store) => ({
talentPickList: get(store, "TalentPicks.talentPicksList", []),
wagerProfile: get(store, "userData.user.profile"),
enableLiveButtons: get(store, "capi.featureToggles.TPwithTVGLiveButtons")
}),
(dispatch) => ({ dispatch })
)(TPTHome);
webpack://frontend-tpt/../../packages/tvg-comp-tpt-home/src/picksPublishingService.js
import axios from "axios";
import { get, findIndex } from "lodash";
import tvgConf from "@tvg/conf";
import { successPublishRequest } from "./actions";
const pickTimeout = () => (typeof window === "object" ? 10000 : 500);
const pickServiceEndpoint = (talentId, pickId) =>
typeof window === "undefined" &&
typeof process !== "undefined" &&
get(process, "env.ENVIRONMENT") !== "dev"
? "http://service-qa.tvg.com/tpm/v1/picks"
: `${tvgConf().config("service.tpm")}/talents/${talentId}/picks/${pickId}`;
const requestOptions = (data) => ({
url: pickServiceEndpoint(get(data.talent, "talentId"), data.id),
method: "put",
timeout: pickTimeout(),
withCredentials: true,
headers: {
"content-type": "application/json"
},
data
});
const handleResponse = (picksList, pickIndex, newPick, dispatch) => {
const updatedList = picksList.slice();
updatedList[pickIndex] = newPick;
return dispatch(successPublishRequest(updatedList));
};
const makeRequest = (dispatch, picksList, updatedData) => {
const pickIndex = findIndex(picksList, (pick) => pick.id === updatedData.id);
const newPick = { ...picksList[pickIndex], ...updatedData };
const requestPick = { ...newPick };
// convert to service needs
requestPick.selections = newPick.selections.map((column) =>
column.map((selection) => ({ order: +selection }))
);
// convert to service needs
requestPick.favorites = newPick.favorites.map((column) =>
column.map((selection) => ({ order: +selection }))
);
const options = requestOptions(requestPick);
return axios(options).then(() =>
handleResponse(picksList, pickIndex, newPick, dispatch)
);
};
export default {
makeRequest
};
webpack://frontend-tpt/./src/pages/components/Home.tsx
import React, { Component } from "react";
import { get, isEqual, find } from "lodash";
import { connect } from "react-redux";
import type { Dispatch } from "redux";
// @ts-ignore
import TPHome from "@tvg/tpt-home";
import { TalentPickData } from "@tvg/ts-types/TalentPicks";
interface Props {
tpList: TalentPickData[];
talentsList: TalentPickData[];
accountNumber: number;
isAdmin: boolean;
}
export const getTalentId = (
tpList: TalentPickData[],
accountNumber: string
): string =>
get(
find(tpList, (tpItem) => get(tpItem, "tvgAccountId") === accountNumber),
"talentId",
""
);
export class Home extends Component<Props> {
static defaultProps = { tpList: [] };
shouldComponentUpdate(nextProps: Props) {
return (
this.props.tpList.length !== nextProps.tpList.length ||
!isEqual(this.props.tpList, nextProps.tpList) ||
!isEqual(this.props.talentsList, nextProps.talentsList)
);
}
render() {
return (
<TPHome
talentId={getTalentId(
this.props.talentsList,
`${this.props.accountNumber}`
)}
accountNumber={this.props.accountNumber}
isAdmin={this.props.isAdmin}
/>
);
}
}
export default connect(
// $FlowFixMe
(store) => ({
tpList: get(store, "TalentPicks.talentPicksList", []),
talentsList: get(store, "Talents.talentsList", []),
accountNumber: get(store, "userData.user.accountNumber", []),
isAdmin: get(store, "userData.user.isAdmin", [])
}),
(dispatch: Dispatch) => ({ dispatch })
)(Home);
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_static/Masks/program-page.jsx
import React, { PureComponent } from "react";
import styled, { keyframes } from "styled-components";
import color from "../ColorPalette";
const SVGContainer = styled.div`
width: 100%;
`;
const pulseAnimation = keyframes`
0% {
fill: ${color("grey", "000")};
}
50% {
fill: ${color("grey", "100")};
}
100% {
fill: ${color("grey", "000")};
}
`;
const SVG = styled.svg`
display: block;
width: 100%;
height: 720px;
background: ${color("white", "100")};
rect.pulse {
animation: ${pulseAnimation} 1.25s infinite;
}
rect.stroke {
stroke: ${color("grey", "100")};
stroke-width: 1;
}
`;
export default class ProgramPageMask extends PureComponent {
render() {
return (
<SVGContainer data-qa-label="ProgramPageMask">
<SVG>
<rect
fill={color("blue", "700")}
x="0"
y="0"
width="100%"
height="120"
/>
<rect
fill={color("white", "100")}
x="0"
y="120"
width="100%"
height="48"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="8"
y="140"
width="56"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="80"
y="140"
width="56"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="152"
y="140"
width="56"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="224"
y="140"
width="56"
height="8"
rx="1"
/>
<rect
fill={color("grey", "100")}
x="0"
y="167"
width="100%"
height="1"
/>
<rect
fill={color("white", "100")}
x="0"
y="208"
width="100%"
height="503"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="0"
y="263"
width="100%"
height="1"
/>
<rect
fill={color("blue_accent", "000")}
x="0"
y="168"
width="100%"
height="40"
/>
<rect
fill={color("grey", "100")}
x="0"
y="207"
width="100%"
height="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="224"
width="144"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="240"
width="176"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="0"
y="319"
width="100%"
height="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="280"
width="64"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="296"
width="168"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="0"
y="375"
width="100%"
height="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="336"
width="56"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="352"
width="112"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="0"
y="431"
width="100%"
height="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="392"
width="72"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="408"
width="128"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="0"
y="487"
width="100%"
height="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="448"
width="104"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="464"
width="160"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="504"
width="104"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="560"
width="80"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="520"
width="152"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="576"
width="128"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="0"
y="543"
width="100%"
height="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="0"
y="599"
width="100%"
height="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="8"
y="184"
width="48"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="184"
width="192"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="616"
width="72"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="632"
width="184"
height="8"
rx="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="0"
y="655"
width="100%"
height="1"
/>
<rect
className="pulse"
fill={color("blue", "000")}
x="72"
y="672"
width="120"
height="8"
rx="1"
/>
<rect fill="#F3CFCF" x="0" y="208" width="24" height="55" />
<rect fill="#F2F4F4" x="0" y="264" width="24" height="55" />
<rect fill="#D8DCE8" x="0" y="320" width="24" height="55" />
<rect fill="#F6EFD8" x="0" y="376" width="24" height="55" />
<rect fill="#CFE0CF" x="0" y="432" width="24" height="55" />
<rect fill="#D6D6D6" x="0" y="488" width="24" height="55" />
<rect fill="#F7DED5" x="0" y="544" width="24" height="55" />
<rect fill="#F9EAEE" x="0" y="600" width="24" height="55" />
<rect fill="#D4EEED" x="0" y="656" width="24" height="55" />
<rect
fillOpacity="0.1"
fill={color("white", "100")}
x="8"
y="60"
width="216"
height="8"
rx="1"
/>
<rect
fillOpacity="0.1"
fill={color("white", "100")}
x="8"
y="20"
width="40"
height="8"
rx="1"
/>
<rect
fillOpacity="0.1"
fill={color("white", "100")}
x="64"
y="20"
width="176"
height="8"
rx="1"
/>
<rect
fillOpacity="0.1"
fill={color("white", "100")}
x="8"
y="80"
width="46%"
height="32"
rx="2"
/>
<rect
fillOpacity="0.1"
fill={color("white", "100")}
x="51%"
y="80"
width="46%"
height="32"
rx="2"
/>
</SVG>
</SVGContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/graphql/fragments/BettingInterests.ts
import { gql } from "@apollo/client";
export const BETTING_INTERESTS = gql`
fragment BettingInterests on Race {
bettingInterests {
biNumber
saddleColor
numberColor
favorite
currentOdds {
numerator
denominator
}
morningLineOdds {
numerator
denominator
}
runners {
runnerId
scratched
horseName
jockey
trainer
hasJockeyChanges
}
}
}
`;
export default BETTING_INTERESTS;
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/graphql/fragments/WagerTypes.ts
import { gql } from "@apollo/client";
export const WAGER_TYPES = gql`
fragment WagerTypes on Race {
wagerTypes {
positionCount
minWagerAmount
maxWagerAmount
wagerAmounts
columnCount
legCount
isBox
isKey
isWheel
unitedWagerTypeCode
type {
id
name
code
}
group {
id
name
code
}
}
}
`;
export default WAGER_TYPES;
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/graphql/fragments/TimeAndStatus.ts
import { gql } from "@apollo/client";
export const TIME_AND_STATUS = gql`
fragment TimeAndStatus on Race {
mtp
postTime
status {
code
}
}
`;
export default TIME_AND_STATUS;
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/graphql/fragments/RaceDetails.ts
import { gql } from "@apollo/client";
export const RACE_DETAILS = gql`
fragment RaceDetails on Race {
id
raceNumber: number
description
distance
purse
isGreyhound
numRunners
claimingPrice
surface {
name
shortName
defaultCondition
}
type {
name
code
shortName
}
raceClass {
name
shortName
}
changes {
surface {
distance {
oldValue {
value
code
name
shortName
}
newValue {
value
code
name
shortName
}
}
course {
oldValue
newValue
date
}
condition {
oldValue
newValue
date
}
tempRailDistance {
oldValue
newValue
date
}
}
}
}
`;
export default RACE_DETAILS;
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/graphql/fragments/Track.ts
import { gql } from "@apollo/client";
export const TRACK = gql`
fragment Track on Race {
track {
id
trackName: name
trackCode: code
shortName
featured
numberOfRaces
trackLocation: location {
country
}
}
}
`;
export default TRACK;
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/graphql/queries/RaceProgramQuery.ts
import { gql } from "@apollo/client";
import { BETTING_INTERESTS } from "../fragments/BettingInterests";
import { WAGER_TYPES } from "../fragments/WagerTypes";
import { TIME_AND_STATUS } from "../fragments/TimeAndStatus";
import { RACE_DETAILS } from "../fragments/RaceDetails";
import { TRACK } from "../fragments/Track";
export const GET_GRAPH_RACE = gql`
query getGraphRace(
$trackAbbr: String
$wagerProfile: String
$raceNumber: String
$withRaces: Boolean!
$withoutRaces: Boolean!
) {
races: races(
filter: { trackCode: [$trackAbbr] }
profile: $wagerProfile
sort: { byRaceNumber: ASC }
) {
id
...RaceDetails
...TimeAndStatus
...Track
}
race: race(track: $trackAbbr, number: $raceNumber, profile: $wagerProfile) {
id
...Track
...BettingInterests @skip(if: $withRaces)
...WagerTypes
}
bettingInterests: races(
filter: { trackCode: [$trackAbbr] }
profile: $wagerProfile
sort: { byRaceNumber: ASC }
) @skip(if: $withoutRaces) {
id
...BettingInterests
}
}
${BETTING_INTERESTS}
${WAGER_TYPES}
${TIME_AND_STATUS}
${RACE_DETAILS}
${TRACK}
`;
export default GET_GRAPH_RACE;
webpack://frontend-tpt/../../node_modules/apollo-utilities/lib/bundle.esm.js
import { visit } from 'graphql/language/visitor';
import { InvariantError, invariant } from 'ts-invariant';
import { __assign, __spreadArrays } from 'tslib';
import stringify from 'fast-json-stable-stringify';
export { equal as isEqual } from '@wry/equality';
function isScalarValue(value) {
return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;
}
function isNumberValue(value) {
return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;
}
function isStringValue(value) {
return value.kind === 'StringValue';
}
function isBooleanValue(value) {
return value.kind === 'BooleanValue';
}
function isIntValue(value) {
return value.kind === 'IntValue';
}
function isFloatValue(value) {
return value.kind === 'FloatValue';
}
function isVariable(value) {
return value.kind === 'Variable';
}
function isObjectValue(value) {
return value.kind === 'ObjectValue';
}
function isListValue(value) {
return value.kind === 'ListValue';
}
function isEnumValue(value) {
return value.kind === 'EnumValue';
}
function isNullValue(value) {
return value.kind === 'NullValue';
}
function valueToObjectRepresentation(argObj, name, value, variables) {
if (isIntValue(value) || isFloatValue(value)) {
argObj[name.value] = Number(value.value);
}
else if (isBooleanValue(value) || isStringValue(value)) {
argObj[name.value] = value.value;
}
else if (isObjectValue(value)) {
var nestedArgObj_1 = {};
value.fields.map(function (obj) {
return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables);
});
argObj[name.value] = nestedArgObj_1;
}
else if (isVariable(value)) {
var variableValue = (variables || {})[value.name.value];
argObj[name.value] = variableValue;
}
else if (isListValue(value)) {
argObj[name.value] = value.values.map(function (listValue) {
var nestedArgArrayObj = {};
valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables);
return nestedArgArrayObj[name.value];
});
}
else if (isEnumValue(value)) {
argObj[name.value] = value.value;
}
else if (isNullValue(value)) {
argObj[name.value] = null;
}
else {
throw process.env.NODE_ENV === "production" ? new InvariantError(17) : new InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" +
'is not supported. Use variables instead of inline arguments to ' +
'overcome this limitation.');
}
}
function storeKeyNameFromField(field, variables) {
var directivesObj = null;
if (field.directives) {
directivesObj = {};
field.directives.forEach(function (directive) {
directivesObj[directive.name.value] = {};
if (directive.arguments) {
directive.arguments.forEach(function (_a) {
var name = _a.name, value = _a.value;
return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables);
});
}
});
}
var argObj = null;
if (field.arguments && field.arguments.length) {
argObj = {};
field.arguments.forEach(function (_a) {
var name = _a.name, value = _a.value;
return valueToObjectRepresentation(argObj, name, value, variables);
});
}
return getStoreKeyName(field.name.value, argObj, directivesObj);
}
var KNOWN_DIRECTIVES = [
'connection',
'include',
'skip',
'client',
'rest',
'export',
];
function getStoreKeyName(fieldName, args, directives) {
if (directives &&
directives['connection'] &&
directives['connection']['key']) {
if (directives['connection']['filter'] &&
directives['connection']['filter'].length > 0) {
var filterKeys = directives['connection']['filter']
? directives['connection']['filter']
: [];
filterKeys.sort();
var queryArgs_1 = args;
var filteredArgs_1 = {};
filterKeys.forEach(function (key) {
filteredArgs_1[key] = queryArgs_1[key];
});
return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")";
}
else {
return directives['connection']['key'];
}
}
var completeFieldName = fieldName;
if (args) {
var stringifiedArgs = stringify(args);
completeFieldName += "(" + stringifiedArgs + ")";
}
if (directives) {
Object.keys(directives).forEach(function (key) {
if (KNOWN_DIRECTIVES.indexOf(key) !== -1)
return;
if (directives[key] && Object.keys(directives[key]).length) {
completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")";
}
else {
completeFieldName += "@" + key;
}
});
}
return completeFieldName;
}
function argumentsObjectFromField(field, variables) {
if (field.arguments && field.arguments.length) {
var argObj_1 = {};
field.arguments.forEach(function (_a) {
var name = _a.name, value = _a.value;
return valueToObjectRepresentation(argObj_1, name, value, variables);
});
return argObj_1;
}
return null;
}
function resultKeyNameFromField(field) {
return field.alias ? field.alias.value : field.name.value;
}
function isField(selection) {
return selection.kind === 'Field';
}
function isInlineFragment(selection) {
return selection.kind === 'InlineFragment';
}
function isIdValue(idObject) {
return idObject &&
idObject.type === 'id' &&
typeof idObject.generated === 'boolean';
}
function toIdValue(idConfig, generated) {
if (generated === void 0) { generated = false; }
return __assign({ type: 'id', generated: generated }, (typeof idConfig === 'string'
? { id: idConfig, typename: undefined }
: idConfig));
}
function isJsonValue(jsonObject) {
return (jsonObject != null &&
typeof jsonObject === 'object' &&
jsonObject.type === 'json');
}
function defaultValueFromVariable(node) {
throw process.env.NODE_ENV === "production" ? new InvariantError(18) : new InvariantError("Variable nodes are not supported by valueFromNode");
}
function valueFromNode(node, onVariable) {
if (onVariable === void 0) { onVariable = defaultValueFromVariable; }
switch (node.kind) {
case 'Variable':
return onVariable(node);
case 'NullValue':
return null;
case 'IntValue':
return parseInt(node.value, 10);
case 'FloatValue':
return parseFloat(node.value);
case 'ListValue':
return node.values.map(function (v) { return valueFromNode(v, onVariable); });
case 'ObjectValue': {
var value = {};
for (var _i = 0, _a = node.fields; _i < _a.length; _i++) {
var field = _a[_i];
value[field.name.value] = valueFromNode(field.value, onVariable);
}
return value;
}
default:
return node.value;
}
}
function getDirectiveInfoFromField(field, variables) {
if (field.directives && field.directives.length) {
var directiveObj_1 = {};
field.directives.forEach(function (directive) {
directiveObj_1[directive.name.value] = argumentsObjectFromField(directive, variables);
});
return directiveObj_1;
}
return null;
}
function shouldInclude(selection, variables) {
if (variables === void 0) { variables = {}; }
return getInclusionDirectives(selection.directives).every(function (_a) {
var directive = _a.directive, ifArgument = _a.ifArgument;
var evaledValue = false;
if (ifArgument.value.kind === 'Variable') {
evaledValue = variables[ifArgument.value.name.value];
process.env.NODE_ENV === "production" ? invariant(evaledValue !== void 0, 13) : invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.");
}
else {
evaledValue = ifArgument.value.value;
}
return directive.name.value === 'skip' ? !evaledValue : evaledValue;
});
}
function getDirectiveNames(doc) {
var names = [];
visit(doc, {
Directive: function (node) {
names.push(node.name.value);
},
});
return names;
}
function hasDirectives(names, doc) {
return getDirectiveNames(doc).some(function (name) { return names.indexOf(name) > -1; });
}
function hasClientExports(document) {
return (document &&
hasDirectives(['client'], document) &&
hasDirectives(['export'], document));
}
function isInclusionDirective(_a) {
var value = _a.name.value;
return value === 'skip' || value === 'include';
}
function getInclusionDirectives(directives) {
return directives ? directives.filter(isInclusionDirective).map(function (directive) {
var directiveArguments = directive.arguments;
var directiveName = directive.name.value;
process.env.NODE_ENV === "production" ? invariant(directiveArguments && directiveArguments.length === 1, 14) : invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.");
var ifArgument = directiveArguments[0];
process.env.NODE_ENV === "production" ? invariant(ifArgument.name && ifArgument.name.value === 'if', 15) : invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.");
var ifValue = ifArgument.value;
process.env.NODE_ENV === "production" ? invariant(ifValue &&
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 16) : invariant(ifValue &&
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.");
return { directive: directive, ifArgument: ifArgument };
}) : [];
}
function getFragmentQueryDocument(document, fragmentName) {
var actualFragmentName = fragmentName;
var fragments = [];
document.definitions.forEach(function (definition) {
if (definition.kind === 'OperationDefinition') {
throw process.env.NODE_ENV === "production" ? new InvariantError(11) : new InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
'No operations are allowed when using a fragment as a query. Only fragments are allowed.');
}
if (definition.kind === 'FragmentDefinition') {
fragments.push(definition);
}
});
if (typeof actualFragmentName === 'undefined') {
process.env.NODE_ENV === "production" ? invariant(fragments.length === 1, 12) : invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.");
actualFragmentName = fragments[0].name.value;
}
var query = __assign(__assign({}, document), { definitions: __spreadArrays([
{
kind: 'OperationDefinition',
operation: 'query',
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'FragmentSpread',
name: {
kind: 'Name',
value: actualFragmentName,
},
},
],
},
}
], document.definitions) });
return query;
}
function assign(target) {
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
sources.forEach(function (source) {
if (typeof source === 'undefined' || source === null) {
return;
}
Object.keys(source).forEach(function (key) {
target[key] = source[key];
});
});
return target;
}
function getMutationDefinition(doc) {
checkDocument(doc);
var mutationDef = doc.definitions.filter(function (definition) {
return definition.kind === 'OperationDefinition' &&
definition.operation === 'mutation';
})[0];
process.env.NODE_ENV === "production" ? invariant(mutationDef, 1) : invariant(mutationDef, 'Must contain a mutation definition.');
return mutationDef;
}
function checkDocument(doc) {
process.env.NODE_ENV === "production" ? invariant(doc && doc.kind === 'Document', 2) : invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
var operations = doc.definitions
.filter(function (d) { return d.kind !== 'FragmentDefinition'; })
.map(function (definition) {
if (definition.kind !== 'OperationDefinition') {
throw process.env.NODE_ENV === "production" ? new InvariantError(3) : new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"");
}
return definition;
});
process.env.NODE_ENV === "production" ? invariant(operations.length <= 1, 4) : invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations");
return doc;
}
function getOperationDefinition(doc) {
checkDocument(doc);
return doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; })[0];
}
function getOperationDefinitionOrDie(document) {
var def = getOperationDefinition(document);
process.env.NODE_ENV === "production" ? invariant(def, 5) : invariant(def, "GraphQL document is missing an operation");
return def;
}
function getOperationName(doc) {
return (doc.definitions
.filter(function (definition) {
return definition.kind === 'OperationDefinition' && definition.name;
})
.map(function (x) { return x.name.value; })[0] || null);
}
function getFragmentDefinitions(doc) {
return doc.definitions.filter(function (definition) { return definition.kind === 'FragmentDefinition'; });
}
function getQueryDefinition(doc) {
var queryDef = getOperationDefinition(doc);
process.env.NODE_ENV === "production" ? invariant(queryDef && queryDef.operation === 'query', 6) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');
return queryDef;
}
function getFragmentDefinition(doc) {
process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 7) : invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
process.env.NODE_ENV === "production" ? invariant(doc.definitions.length <= 1, 8) : invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.');
var fragmentDef = doc.definitions[0];
process.env.NODE_ENV === "production" ? invariant(fragmentDef.kind === 'FragmentDefinition', 9) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');
return fragmentDef;
}
function getMainDefinition(queryDoc) {
checkDocument(queryDoc);
var fragmentDefinition;
for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) {
var definition = _a[_i];
if (definition.kind === 'OperationDefinition') {
var operation = definition.operation;
if (operation === 'query' ||
operation === 'mutation' ||
operation === 'subscription') {
return definition;
}
}
if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {
fragmentDefinition = definition;
}
}
if (fragmentDefinition) {
return fragmentDefinition;
}
throw process.env.NODE_ENV === "production" ? new InvariantError(10) : new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.');
}
function createFragmentMap(fragments) {
if (fragments === void 0) { fragments = []; }
var symTable = {};
fragments.forEach(function (fragment) {
symTable[fragment.name.value] = fragment;
});
return symTable;
}
function getDefaultValues(definition) {
if (definition &&
definition.variableDefinitions &&
definition.variableDefinitions.length) {
var defaultValues = definition.variableDefinitions
.filter(function (_a) {
var defaultValue = _a.defaultValue;
return defaultValue;
})
.map(function (_a) {
var variable = _a.variable, defaultValue = _a.defaultValue;
var defaultValueObj = {};
valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue);
return defaultValueObj;
});
return assign.apply(void 0, __spreadArrays([{}], defaultValues));
}
return {};
}
function variablesInOperation(operation) {
var names = new Set();
if (operation.variableDefinitions) {
for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) {
var definition = _a[_i];
names.add(definition.variable.name.value);
}
}
return names;
}
function filterInPlace(array, test, context) {
var target = 0;
array.forEach(function (elem, i) {
if (test.call(this, elem, i, array)) {
array[target++] = elem;
}
}, context);
array.length = target;
return array;
}
var TYPENAME_FIELD = {
kind: 'Field',
name: {
kind: 'Name',
value: '__typename',
},
};
function isEmpty(op, fragments) {
return op.selectionSet.selections.every(function (selection) {
return selection.kind === 'FragmentSpread' &&
isEmpty(fragments[selection.name.value], fragments);
});
}
function nullIfDocIsEmpty(doc) {
return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc)))
? null
: doc;
}
function getDirectiveMatcher(directives) {
return function directiveMatcher(directive) {
return directives.some(function (dir) {
return (dir.name && dir.name === directive.name.value) ||
(dir.test && dir.test(directive));
});
};
}
function removeDirectivesFromDocument(directives, doc) {
var variablesInUse = Object.create(null);
var variablesToRemove = [];
var fragmentSpreadsInUse = Object.create(null);
var fragmentSpreadsToRemove = [];
var modifiedDoc = nullIfDocIsEmpty(visit(doc, {
Variable: {
enter: function (node, _key, parent) {
if (parent.kind !== 'VariableDefinition') {
variablesInUse[node.name.value] = true;
}
},
},
Field: {
enter: function (node) {
if (directives && node.directives) {
var shouldRemoveField = directives.some(function (directive) { return directive.remove; });
if (shouldRemoveField &&
node.directives &&
node.directives.some(getDirectiveMatcher(directives))) {
if (node.arguments) {
node.arguments.forEach(function (arg) {
if (arg.value.kind === 'Variable') {
variablesToRemove.push({
name: arg.value.name.value,
});
}
});
}
if (node.selectionSet) {
getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) {
fragmentSpreadsToRemove.push({
name: frag.name.value,
});
});
}
return null;
}
}
},
},
FragmentSpread: {
enter: function (node) {
fragmentSpreadsInUse[node.name.value] = true;
},
},
Directive: {
enter: function (node) {
if (getDirectiveMatcher(directives)(node)) {
return null;
}
},
},
}));
if (modifiedDoc &&
filterInPlace(variablesToRemove, function (v) { return !variablesInUse[v.name]; }).length) {
modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);
}
if (modifiedDoc &&
filterInPlace(fragmentSpreadsToRemove, function (fs) { return !fragmentSpreadsInUse[fs.name]; })
.length) {
modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc);
}
return modifiedDoc;
}
function addTypenameToDocument(doc) {
return visit(checkDocument(doc), {
SelectionSet: {
enter: function (node, _key, parent) {
if (parent &&
parent.kind === 'OperationDefinition') {
return;
}
var selections = node.selections;
if (!selections) {
return;
}
var skip = selections.some(function (selection) {
return (isField(selection) &&
(selection.name.value === '__typename' ||
selection.name.value.lastIndexOf('__', 0) === 0));
});
if (skip) {
return;
}
var field = parent;
if (isField(field) &&
field.directives &&
field.directives.some(function (d) { return d.name.value === 'export'; })) {
return;
}
return __assign(__assign({}, node), { selections: __spreadArrays(selections, [TYPENAME_FIELD]) });
},
},
});
}
var connectionRemoveConfig = {
test: function (directive) {
var willRemove = directive.name.value === 'connection';
if (willRemove) {
if (!directive.arguments ||
!directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {
process.env.NODE_ENV === "production" || invariant.warn('Removing an @connection directive even though it does not have a key. ' +
'You may want to use the key parameter to specify a store key.');
}
}
return willRemove;
},
};
function removeConnectionDirectiveFromDocument(doc) {
return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc));
}
function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) {
if (nestedCheck === void 0) { nestedCheck = true; }
return (selectionSet &&
selectionSet.selections &&
selectionSet.selections.some(function (selection) {
return hasDirectivesInSelection(directives, selection, nestedCheck);
}));
}
function hasDirectivesInSelection(directives, selection, nestedCheck) {
if (nestedCheck === void 0) { nestedCheck = true; }
if (!isField(selection)) {
return true;
}
if (!selection.directives) {
return false;
}
return (selection.directives.some(getDirectiveMatcher(directives)) ||
(nestedCheck &&
hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck)));
}
function getDirectivesFromDocument(directives, doc) {
checkDocument(doc);
var parentPath;
return nullIfDocIsEmpty(visit(doc, {
SelectionSet: {
enter: function (node, _key, _parent, path) {
var currentPath = path.join('-');
if (!parentPath ||
currentPath === parentPath ||
!currentPath.startsWith(parentPath)) {
if (node.selections) {
var selectionsWithDirectives = node.selections.filter(function (selection) { return hasDirectivesInSelection(directives, selection); });
if (hasDirectivesInSelectionSet(directives, node, false)) {
parentPath = currentPath;
}
return __assign(__assign({}, node), { selections: selectionsWithDirectives });
}
else {
return null;
}
}
},
},
}));
}
function getArgumentMatcher(config) {
return function argumentMatcher(argument) {
return config.some(function (aConfig) {
return argument.value &&
argument.value.kind === 'Variable' &&
argument.value.name &&
(aConfig.name === argument.value.name.value ||
(aConfig.test && aConfig.test(argument)));
});
};
}
function removeArgumentsFromDocument(config, doc) {
var argMatcher = getArgumentMatcher(config);
return nullIfDocIsEmpty(visit(doc, {
OperationDefinition: {
enter: function (node) {
return __assign(__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) {
return !config.some(function (arg) { return arg.name === varDef.variable.name.value; });
}) });
},
},
Field: {
enter: function (node) {
var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; });
if (shouldRemoveField) {
var argMatchCount_1 = 0;
node.arguments.forEach(function (arg) {
if (argMatcher(arg)) {
argMatchCount_1 += 1;
}
});
if (argMatchCount_1 === 1) {
return null;
}
}
},
},
Argument: {
enter: function (node) {
if (argMatcher(node)) {
return null;
}
},
},
}));
}
function removeFragmentSpreadFromDocument(config, doc) {
function enter(node) {
if (config.some(function (def) { return def.name === node.name.value; })) {
return null;
}
}
return nullIfDocIsEmpty(visit(doc, {
FragmentSpread: { enter: enter },
FragmentDefinition: { enter: enter },
}));
}
function getAllFragmentSpreadsFromSelectionSet(selectionSet) {
var allFragments = [];
selectionSet.selections.forEach(function (selection) {
if ((isField(selection) || isInlineFragment(selection)) &&
selection.selectionSet) {
getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { return allFragments.push(frag); });
}
else if (selection.kind === 'FragmentSpread') {
allFragments.push(selection);
}
});
return allFragments;
}
function buildQueryFromSelectionSet(document) {
var definition = getMainDefinition(document);
var definitionOperation = definition.operation;
if (definitionOperation === 'query') {
return document;
}
var modifiedDoc = visit(document, {
OperationDefinition: {
enter: function (node) {
return __assign(__assign({}, node), { operation: 'query' });
},
},
});
return modifiedDoc;
}
function removeClientSetsFromDocument(document) {
checkDocument(document);
var modifiedDoc = removeDirectivesFromDocument([
{
test: function (directive) { return directive.name.value === 'client'; },
remove: true,
},
], document);
if (modifiedDoc) {
modifiedDoc = visit(modifiedDoc, {
FragmentDefinition: {
enter: function (node) {
if (node.selectionSet) {
var isTypenameOnly = node.selectionSet.selections.every(function (selection) {
return isField(selection) && selection.name.value === '__typename';
});
if (isTypenameOnly) {
return null;
}
}
},
},
});
}
return modifiedDoc;
}
var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' &&
navigator.product === 'ReactNative');
var toString = Object.prototype.toString;
function cloneDeep(value) {
return cloneDeepHelper(value, new Map());
}
function cloneDeepHelper(val, seen) {
switch (toString.call(val)) {
case "[object Array]": {
if (seen.has(val))
return seen.get(val);
var copy_1 = val.slice(0);
seen.set(val, copy_1);
copy_1.forEach(function (child, i) {
copy_1[i] = cloneDeepHelper(child, seen);
});
return copy_1;
}
case "[object Object]": {
if (seen.has(val))
return seen.get(val);
var copy_2 = Object.create(Object.getPrototypeOf(val));
seen.set(val, copy_2);
Object.keys(val).forEach(function (key) {
copy_2[key] = cloneDeepHelper(val[key], seen);
});
return copy_2;
}
default:
return val;
}
}
function getEnv() {
if (typeof process !== 'undefined' && process.env.NODE_ENV) {
return process.env.NODE_ENV;
}
return 'development';
}
function isEnv(env) {
return getEnv() === env;
}
function isProduction() {
return isEnv('production') === true;
}
function isDevelopment() {
return isEnv('development') === true;
}
function isTest() {
return isEnv('test') === true;
}
function tryFunctionOrLogError(f) {
try {
return f();
}
catch (e) {
if (console.error) {
console.error(e);
}
}
}
function graphQLResultHasError(result) {
return result.errors && result.errors.length;
}
function deepFreeze(o) {
Object.freeze(o);
Object.getOwnPropertyNames(o).forEach(function (prop) {
if (o[prop] !== null &&
(typeof o[prop] === 'object' || typeof o[prop] === 'function') &&
!Object.isFrozen(o[prop])) {
deepFreeze(o[prop]);
}
});
return o;
}
function maybeDeepFreeze(obj) {
if (isDevelopment() || isTest()) {
var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string';
if (!symbolIsPolyfilled) {
return deepFreeze(obj);
}
}
return obj;
}
var hasOwnProperty = Object.prototype.hasOwnProperty;
function mergeDeep() {
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
return mergeDeepArray(sources);
}
function mergeDeepArray(sources) {
var target = sources[0] || {};
var count = sources.length;
if (count > 1) {
var pastCopies = [];
target = shallowCopyForMerge(target, pastCopies);
for (var i = 1; i < count; ++i) {
target = mergeHelper(target, sources[i], pastCopies);
}
}
return target;
}
function isObject(obj) {
return obj !== null && typeof obj === 'object';
}
function mergeHelper(target, source, pastCopies) {
if (isObject(source) && isObject(target)) {
if (Object.isExtensible && !Object.isExtensible(target)) {
target = shallowCopyForMerge(target, pastCopies);
}
Object.keys(source).forEach(function (sourceKey) {
var sourceValue = source[sourceKey];
if (hasOwnProperty.call(target, sourceKey)) {
var targetValue = target[sourceKey];
if (sourceValue !== targetValue) {
target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies);
}
}
else {
target[sourceKey] = sourceValue;
}
});
return target;
}
return source;
}
function shallowCopyForMerge(value, pastCopies) {
if (value !== null &&
typeof value === 'object' &&
pastCopies.indexOf(value) < 0) {
if (Array.isArray(value)) {
value = value.slice(0);
}
else {
value = __assign({ __proto__: Object.getPrototypeOf(value) }, value);
}
pastCopies.push(value);
}
return value;
}
var haveWarned = Object.create({});
function warnOnceInDevelopment(msg, type) {
if (type === void 0) { type = 'warn'; }
if (!isProduction() && !haveWarned[msg]) {
if (!isTest()) {
haveWarned[msg] = true;
}
if (type === 'error') {
console.error(msg);
}
else {
console.warn(msg);
}
}
}
function stripSymbols(data) {
return JSON.parse(JSON.stringify(data));
}
export { addTypenameToDocument, argumentsObjectFromField, assign, buildQueryFromSelectionSet, canUseWeakMap, checkDocument, cloneDeep, createFragmentMap, getDefaultValues, getDirectiveInfoFromField, getDirectiveNames, getDirectivesFromDocument, getEnv, getFragmentDefinition, getFragmentDefinitions, getFragmentQueryDocument, getInclusionDirectives, getMainDefinition, getMutationDefinition, getOperationDefinition, getOperationDefinitionOrDie, getOperationName, getQueryDefinition, getStoreKeyName, graphQLResultHasError, hasClientExports, hasDirectives, isDevelopment, isEnv, isField, isIdValue, isInlineFragment, isJsonValue, isNumberValue, isProduction, isScalarValue, isTest, maybeDeepFreeze, mergeDeep, mergeDeepArray, removeArgumentsFromDocument, removeClientSetsFromDocument, removeConnectionDirectiveFromDocument, removeDirectivesFromDocument, removeFragmentSpreadFromDocument, resultKeyNameFromField, shouldInclude, storeKeyNameFromField, stripSymbols, toIdValue, tryFunctionOrLogError, valueFromNode, valueToObjectRepresentation, variablesInOperation, warnOnceInDevelopment };
//# sourceMappingURL=bundle.esm.js.map
webpack://frontend-tpt/../../node_modules/graphql-anywhere/lib/bundle.esm.js
import { getMainDefinition, getFragmentDefinitions, createFragmentMap, shouldInclude, isField, resultKeyNameFromField, isInlineFragment, argumentsObjectFromField, getDirectiveInfoFromField, getInclusionDirectives } from 'apollo-utilities';
import { invariant } from 'ts-invariant';
function graphql(resolver, document, rootValue, contextValue, variableValues, execOptions) {
if (variableValues === void 0) { variableValues = {}; }
if (execOptions === void 0) { execOptions = {}; }
var mainDefinition = getMainDefinition(document);
var fragments = getFragmentDefinitions(document);
var fragmentMap = createFragmentMap(fragments);
var resultMapper = execOptions.resultMapper;
var fragmentMatcher = execOptions.fragmentMatcher || (function () { return true; });
var execContext = {
fragmentMap: fragmentMap,
contextValue: contextValue,
variableValues: variableValues,
resultMapper: resultMapper,
resolver: resolver,
fragmentMatcher: fragmentMatcher,
};
return executeSelectionSet(mainDefinition.selectionSet, rootValue, execContext);
}
function executeSelectionSet(selectionSet, rootValue, execContext) {
var fragmentMap = execContext.fragmentMap, contextValue = execContext.contextValue, variables = execContext.variableValues;
var result = {};
selectionSet.selections.forEach(function (selection) {
if (variables && !shouldInclude(selection, variables)) {
return;
}
if (isField(selection)) {
var fieldResult = executeField(selection, rootValue, execContext);
var resultFieldKey = resultKeyNameFromField(selection);
if (fieldResult !== undefined) {
if (result[resultFieldKey] === undefined) {
result[resultFieldKey] = fieldResult;
}
else {
merge(result[resultFieldKey], fieldResult);
}
}
}
else {
var fragment = void 0;
if (isInlineFragment(selection)) {
fragment = selection;
}
else {
fragment = fragmentMap[selection.name.value];
if (!fragment) {
throw new Error("No fragment named " + selection.name.value);
}
}
var typeCondition = fragment.typeCondition.name.value;
if (execContext.fragmentMatcher(rootValue, typeCondition, contextValue)) {
var fragmentResult = executeSelectionSet(fragment.selectionSet, rootValue, execContext);
merge(result, fragmentResult);
}
}
});
if (execContext.resultMapper) {
return execContext.resultMapper(result, rootValue);
}
return result;
}
function executeField(field, rootValue, execContext) {
var variables = execContext.variableValues, contextValue = execContext.contextValue, resolver = execContext.resolver;
var fieldName = field.name.value;
var args = argumentsObjectFromField(field, variables);
var info = {
isLeaf: !field.selectionSet,
resultKey: resultKeyNameFromField(field),
directives: getDirectiveInfoFromField(field, variables),
field: field,
};
var result = resolver(fieldName, rootValue, args, contextValue, info);
if (!field.selectionSet) {
return result;
}
if (result == null) {
return result;
}
if (Array.isArray(result)) {
return executeSubSelectedArray(field, result, execContext);
}
return executeSelectionSet(field.selectionSet, result, execContext);
}
function executeSubSelectedArray(field, result, execContext) {
return result.map(function (item) {
if (item === null) {
return null;
}
if (Array.isArray(item)) {
return executeSubSelectedArray(field, item, execContext);
}
return executeSelectionSet(field.selectionSet, item, execContext);
});
}
var hasOwn = Object.prototype.hasOwnProperty;
function merge(dest, src) {
if (src !== null && typeof src === 'object') {
Object.keys(src).forEach(function (key) {
var srcVal = src[key];
if (!hasOwn.call(dest, key)) {
dest[key] = srcVal;
}
else {
merge(dest[key], srcVal);
}
});
}
}
var hasOwnProperty = Object.prototype.hasOwnProperty;
function filter(doc, data, variableValues) {
if (variableValues === void 0) { variableValues = {}; }
if (data === null)
return data;
var resolver = function (fieldName, root, args, context, info) {
return root[info.resultKey];
};
return Array.isArray(data)
? data.map(function (dataObj) { return graphql(resolver, doc, dataObj, null, variableValues); })
: graphql(resolver, doc, data, null, variableValues);
}
function check(doc, data, variables) {
if (variables === void 0) { variables = {}; }
var resolver = function (fieldName, root, args, context, info) {
process.env.NODE_ENV === "production" ? invariant(hasOwnProperty.call(root, info.resultKey) ||
(!variables && hasVariableInclusions(info.field.directives)), 1) : invariant(hasOwnProperty.call(root, info.resultKey) ||
(!variables && hasVariableInclusions(info.field.directives)), info.resultKey + " missing on " + JSON.stringify(root));
return root[info.resultKey];
};
graphql(resolver, doc, data, {}, variables, {
fragmentMatcher: function () { return false; },
});
}
function hasVariableInclusions(directives) {
return getInclusionDirectives(directives).some(function (_a) {
var ifArgument = _a.ifArgument;
return ifArgument.value && ifArgument.value.kind === 'Variable';
});
}
var ANONYMOUS = '<<anonymous>>';
function PropTypeError(message) {
this.message = message;
this.stack = '';
}
PropTypeError.prototype = Error.prototype;
var reactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context',
};
function createChainableTypeChecker(validate) {
function checkType(isRequired, props, propName, componentName, location, propFullName) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (props[propName] == null) {
var locationName = reactPropTypeLocationNames[location];
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError("The " + locationName + " `" + propFullName + "` is marked as required " +
("in `" + componentName + "`, but its value is `null`."));
}
return new PropTypeError("The " + locationName + " `" + propFullName + "` is marked as required in " +
("`" + componentName + "`, but its value is `undefined`."));
}
return null;
}
else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function propType(doc, mapPropsToVariables) {
if (mapPropsToVariables === void 0) { mapPropsToVariables = function (props) { return null; }; }
return createChainableTypeChecker(function (props, propName) {
var prop = props[propName];
try {
if (!prop.loading) {
check(doc, prop, mapPropsToVariables(props));
}
return null;
}
catch (e) {
return e;
}
});
}
export default graphql;
export { check, filter, propType };
//# sourceMappingURL=bundle.esm.js.map
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/graphql/options.graph.js
import { filter } from "graphql-anywhere";
import { attempt, get, merge, some } from "lodash/fp";
import { getPortByBrand } from "@tvg/utils/generalUtils";
import BettingInterests from "./fragments/BettingInterests";
import TimeAndStatus from "./fragments/TimeAndStatus";
import Track from "./fragments/Track";
import RaceDetails from "./fragments/RaceDetails";
import WagerTypes from "./fragments/WagerTypes";
const QUERY_VARIABLES = {
trackAbbr: null
};
const POLL_INTERVAL = 15000;
const getDecimalOddsValue = ({ numerator, denominator }) => {
let decimal = denominator && numerator ? numerator / denominator : numerator;
if (!decimal || isNaN(decimal)) {
decimal = Number.MAX_VALUE;
}
return decimal;
};
const getLowestOdd = (arr) => {
let lowestOdd = Number.MAX_VALUE;
let myOdd = Number.MAX_VALUE;
try {
for (let i = 0; i < arr.length; i += 1) {
if (some((runner) => runner.scratched === false, arr[i].runners)) {
myOdd = getDecimalOddsValue(arr[i].currentOdds);
if (myOdd < lowestOdd) {
lowestOdd = myOdd;
}
}
}
} catch (e) {
console.error(e);
}
return lowestOdd;
};
const isFavorite = (currentOdds, lowestOdd) => {
const odd = getDecimalOddsValue(currentOdds);
return odd === lowestOdd && odd !== 99;
};
const isFavoriteBIScratched = (bettingInterests) => {
for (let i = 0; i < bettingInterests.length; i += 1) {
if (bettingInterests[i].favorite) {
const { runners } = bettingInterests[i];
for (let j = 0; j < runners.length; j += 1) {
if (!runners[j].scratched) {
return false;
}
}
}
}
return true;
};
const extractInfoFromRace = (processingRace) => {
const raceInfo = {};
if (processingRace.id) {
raceInfo.id = processingRace.id;
}
// Handle bettingInterests
attempt(() => {
const bettingInterests = filter(BettingInterests, processingRace);
Object.assign(raceInfo, bettingInterests);
});
// Handle timeAndStatus
attempt(() => {
const timeAndStatus = filter(TimeAndStatus, processingRace);
Object.assign(raceInfo, timeAndStatus);
});
// Handle track
attempt(() => {
const track = filter(Track, processingRace);
Object.assign(raceInfo, track);
});
// Handle race
attempt(() => {
const race = filter(RaceDetails, processingRace);
Object.assign(raceInfo, race);
});
// Handle wagerTypes
attempt(() => {
const wagerTypes = filter(WagerTypes, processingRace);
Object.assign(raceInfo, wagerTypes);
});
// Handle favorites
attempt(() => {
const bettingInterests = get("bettingInterests", raceInfo);
if (bettingInterests) {
const useLowestOddFavorite = isFavoriteBIScratched(bettingInterests);
const newBettingInterests = bettingInterests.map((bettingInterest) => {
if (bettingInterest.runners.length) {
if (useLowestOddFavorite) {
const lowestOdd = getLowestOdd(bettingInterests);
return Object.assign(bettingInterest, {
isFavorite: isFavorite(bettingInterest.currentOdds, lowestOdd)
});
}
return Object.assign(bettingInterest, {
isFavorite: bettingInterest.favorite
});
}
return bettingInterest;
});
Object.assign(raceInfo, { bettingInterests: newBettingInterests });
}
});
// Handle race open for betting
attempt(() => {
if (get("status.code", processingRace)) {
const wagerable =
["SK", "C", "RO"].indexOf(get("status.code", processingRace)) < 0;
Object.assign(raceInfo, { wagerable });
}
});
return raceInfo;
};
const getProps = (result) => {
const races = get("data.races", result) || [];
const race = extractInfoFromRace(get("data.race", result) || {});
const bettingInterests = get("data.bettingInterests", result) || [];
const props = {
races: []
};
// iterate on races received
for (let i = 0, { length } = races; i < length; i += 1) {
let processingRace = {};
// Add current track info
const currentRace = extractInfoFromRace(races[i]);
const currentBettingInterest = extractInfoFromRace(
get(`[${i}]`, bettingInterests) || {}
);
if (currentRace.id === race.id) {
processingRace = merge(race, currentRace);
processingRace = merge(processingRace, currentBettingInterest);
} else {
processingRace = merge(currentRace, currentBettingInterest);
}
// push race to races arrays
props.races.push(processingRace);
}
return props;
};
const stopPolling = (result) => {
let shouldStop = false;
try {
// if some race is not RO or with result we should not stop polling
shouldStop =
!result.data.races.some((race) => race.status.code !== "RO") &&
!result.data.races.some((race) => !race.results);
} catch (e) {
shouldStop = false;
}
return shouldStop;
};
export default {
skip: (props) => !get("shouldUpdate", props),
options: (props) => {
const variables = {
...QUERY_VARIABLES,
trackAbbr: (get("trackAbbr", props) || "").toUpperCase(),
wagerProfile: get("wagerProfile", props) || getPortByBrand(),
raceNumber: get("raceNumber", props) || "",
withRaces: get("withRaces", props) || false,
withoutRaces: !(get("withRaces", props) || false)
};
return {
pollInterval: POLL_INTERVAL,
fetchPolicy: "cache-and-network",
ssr: false,
variables
};
},
props: (result) => {
if (stopPolling(result)) {
result.data.stopPolling();
} else {
result.data.startPolling(POLL_INTERVAL);
}
return {
...getProps(result),
isLoading:
result.data.networkStatus === 1 || result.data.networkStatus === 2
};
}
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/WagerTypeSelector/styled-components.js
import styled, { css } from "styled-components";
import ButtonDefault from "../../_atom/Buttons/default";
import buildColor from "../../_static/ColorPalette";
import { fontMedium } from "../../_static/Typography";
import {
easeInOut,
cubic,
generateTransition
} from "../../_static/Transitions";
export const WagerTypeContainer = styled.section`
position: sticky;
top: ${(props) => `${props.fixedOffset}px`};
z-index: 20;
height: 48px;
min-height: 48px;
background-color: ${buildColor("white", "100")};
overflow: hidden;
display: flex;
`;
export const SelectorWrapper = styled.ul.attrs({
"data-qa-label": "wagerTypeSelector"
})`
position: relative;
display: flex;
padding: 0;
list-style: none;
flex-wrap: nowrap;
flex: 0 0 100%;
overflow: auto hidden;
left: 0;
right: 0;
background-color: ${buildColor("white", "0")};
box-shadow:
0 -1px 0 0 ${buildColor("grey", "300")},
inset 0 -1px 0 0 ${buildColor("grey", "300")};
z-index: ${(props) => (props.isVisible ? 1 : 0)};
will-change: opacity;
transition: ${generateTransition(easeInOut, "opacity")};
opacity: ${(props) => (props.isVisible ? 1 : 0)};
${(props) =>
props.device === "tablet" &&
css`
border-right: 1px solid ${buildColor("grey", "300")};
border-left: 1px solid ${buildColor("grey", "300")};
`};
`;
export const WagerTypeButton = styled(ButtonDefault)`
white-space: nowrap;
min-width: 48px;
height: 48px;
padding: 0 8px;
text-transform: uppercase;
background-color: ${buildColor("white", "0")};
font-size: 14px;
font-family: ${fontMedium};
will-change: color;
font-weight: normal;
transition: ${generateTransition(easeInOut, "color")};
color: ${(props) =>
props.selected
? buildColor("blue_accent", "600")
: buildColor("grey", "900")};
position: relative;
display: flex;
align-items: center;
&:active {
background-color: ${buildColor("blue", "000")};
box-shadow:
0 -1px 0 0 ${buildColor("grey", "300")},
inset 0 -1px 0 0 ${buildColor("grey", "300")};
}
&::after {
content: "";
display: block;
position: absolute;
left: 0;
right: 0;
bottom: ${(props) => (props.selected ? "0" : "-3px")};
height: 3px;
will-change: bottom;
transition: ${generateTransition(easeInOut, "bottom")};
background-color: ${buildColor("blue_accent", "600")};
}
`;
export const OptionsWrapper = styled.div.attrs({
"data-qa-label": "subWagerTypeSelector"
})`
display: flex;
left: 0;
right: 0;
background-color: ${buildColor("white", "0")};
box-shadow:
0 -1px 0 0 ${buildColor("grey", "300")},
inset 0 -1px 0 0 ${buildColor("grey", "300")};
position: absolute;
z-index: ${(props) => (props.isVisible ? 1 : 0)};
& > :first-child {
flex: 0 0 auto;
}
`;
export const SubSelectorWrapper = styled.div`
background-color: ${buildColor("white", "0")};
box-shadow:
0 -1px 0 0 ${buildColor("grey", "300")},
inset 0 -1px 0 0 ${buildColor("grey", "300")};
will-change: transform, opacity;
overflow: auto hidden;
flex-grow: 1;
transition: ${generateTransition(cubic, "transform")},
${generateTransition(easeInOut, "opacity")};
${(props) =>
props.isVisible
? css`
opacity: 1;
transform: translate(0, 0);
transition-delay: 200ms;
`
: css`
opacity: 0;
transform: translate(100%, 0);
`};
`;
export const SubSelectorList = styled.ul.attrs({
"data-qa-label": "subWagerTypeSelectorList"
})`
padding: 0;
list-style: none;
display: flex;
flex: 1 0 0;
flex-wrap: nowrap;
overflow: auto hidden;
`;
export const BackButton = styled(ButtonDefault)`
height: 48px;
padding: 0 8px;
background-color: ${buildColor("white", "0")};
display: flex;
align-items: center;
border-right: 1px solid ${buildColor("grey", "300")};
will-change: transform, opacity;
transition: ${generateTransition(cubic, "transform")},
${generateTransition(easeInOut, "opacity")};
${(props) =>
props.isVisible
? css`
opacity: 1;
transform: translate(0, 0);
transition-delay: 200ms;
`
: css`
opacity: 0;
transform: translate(-100%, 0);
`};
& > :first-child {
margin: 16px 0;
}
`;
export const TextContainer = styled.span`
display: flex;
flex-direction: column;
justify-content: space-between;
height: 48px;
padding: 10px 0;
margin-left: 8px;
text-transform: uppercase;
text-align: left;
font-size: 14px;
font-family: ${fontMedium};
color: ${buildColor("grey", "900")};
& > :first-child {
display: block;
color: ${buildColor("grey", "700")};
font-size: 10px;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/WagerTypeSelector/index.jsx
import React, { Component } from "react";
import { noop, bindAll, find, findIndex, isEqual } from "lodash";
import { Icon as DSIcon } from "@tvg/design-system";
import {
WagerTypeContainer,
SelectorWrapper,
SubSelectorWrapper,
SubSelectorList,
WagerTypeButton,
OptionsWrapper,
BackButton,
TextContainer
} from "./styled-components";
import Icon from "../../_static/Icons";
import { arrowBack } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import ScrollWrapper from "../../_molecule/ScrollWrapper";
const getWagerTypeByModifier = (wagerTypes, active) => {
let found = false;
let i = -1;
let indexSubWT = -1;
do {
i += 1;
indexSubWT = findIndex(
wagerTypes[i] ? wagerTypes[i].options : [],
(wt) => wt.code === active
);
found = indexSubWT >= 0;
} while (!found && i < wagerTypes.length);
return found ? wagerTypes[i] : undefined;
};
export const getModifierName = (name, code, index) => {
if (index === 0) {
return code;
}
if (name.includes("Wheel")) {
return "WHEEL";
}
if (name.includes("Key Box")) {
return "KEYBOX";
}
if (name.includes("Box")) {
return "BOX";
}
if (name.includes("Key")) {
return "KEY";
}
return name;
};
const getWagerTypesList = (wagerTypes, promoOnboardingWagerTypes = []) => {
const wagerTypesList = [];
wagerTypes.forEach((wt) => {
const index = findIndex(
wagerTypesList,
(group) => group.code === wt.group.code
);
const type = {
...wt.type,
hasPromoIcon: promoOnboardingWagerTypes.includes(wt.type.code)
};
if (index < 0) {
wagerTypesList.push({
id: wt.group.id,
code: wt.group.code,
name: wt.group.name,
legCount: wt.legCount,
isKey: wt.isKey,
isWheel: wt.isWheel,
isBox: wt.isBox,
hasPromoIcon: promoOnboardingWagerTypes.includes(wt.group.code),
options: [type]
});
} else {
wagerTypesList[index].options.push(type);
}
});
return wagerTypesList;
};
const getIsMainWagerType = (wagerTypes, active, isMainWagerType) => {
if (!isMainWagerType) {
const wt = getWagerTypeByModifier(wagerTypes, active);
return wt ? wt.options.length < 1 : true;
}
return true;
};
export default class WagerTypeSelector extends Component {
static defaultProps = {
wagerTypes: [],
onSelectWagerType: noop,
onSelectLegRace: noop,
onBackToMainWagerTypeSelector: noop,
isMainWagerType: true,
raceNumber: 1,
fixedOffset: 48,
activeRace: 0,
active: "",
device: "mobile",
shouldShowPromoOnboardingIcons: false,
promoOnboardingWagerTypes: []
};
constructor(props) {
super(props);
this.state = {
active:
this.props.active ||
(this.props.wagerTypes.length > 0 &&
this.props.wagerTypes[0].type.code) ||
"",
activeRace: this.props.activeRace || 0,
isMainWagerType: this.props.isMainWagerType,
wagerTypes: getWagerTypesList(
this.props.wagerTypes,
this.props.promoOnboardingWagerTypes
)
};
this.ref = React.createRef();
bindAll(this, [
"handleSelectWagerType",
"handleSelectModifier",
"handleSelectRace",
"renderModifiersList",
"renderLegRacesList",
"renderWagerTypeList"
]);
}
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
if (
this.state.active !== nextProps.active ||
this.state.activeRace !== nextProps.activeRace ||
this.state.isMainWagerType !== nextProps.isMainWagerType ||
!isEqual(this.props.wagerTypes, nextProps.wagerTypes)
) {
this.setState({
active: nextProps.active,
activeRace: nextProps.activeRace,
isMainWagerType: getIsMainWagerType(
this.state.wagerTypes,
nextProps.active || this.state.active,
nextProps.isMainWagerType
),
wagerTypes: getWagerTypesList(
nextProps.wagerTypes,
nextProps.promoOnboardingWagerTypes
)
});
}
}
shouldComponentUpdate(nextProps, nextState) {
return (
this.state.active !== nextState.active ||
this.state.active !== nextProps.active ||
this.props.wagerTypes.length !== nextProps.wagerTypes.length ||
this.state.activeRace !== nextProps.activeRace ||
this.state.activeRace !== nextState.activeRace ||
this.props.isMainWagerType !== nextProps.isMainWagerType ||
this.props.fixedOffset !== nextProps.fixedOffset ||
this.state.isMainWagerType !== nextProps.isMainWagerType ||
this.props.shouldShowPromoOnboardingIcons !==
nextProps.shouldShowPromoOnboardingIcons ||
this.props.promoOnboardingWagerTypes !==
nextProps.promoOnboardingWagerTypes
);
}
ref;
handleSelectWagerType(wagerType) {
this.setState({
active: wagerType.code
});
this.props.onSelectWagerType({
id: wagerType.id,
code: wagerType.code,
name: wagerType.name
});
this.ref.scrollTo(0, 0);
}
handleSelectModifier(betType, wagerType) {
this.setState({ active: wagerType.code });
this.props.onSelectWagerType(wagerType, {
id: betType.id,
code: betType.code,
name: betType.name
});
}
handleSelectRace(id) {
this.setState({ activeRace: id });
this.props.onSelectLegRace(id);
}
renderModifiersList(wagerType) {
return (
<SubSelectorWrapper isVisible={!this.state.isMainWagerType}>
<ScrollWrapper>
<SubSelectorList ref={(comp) => (this.ref = comp)}>
{wagerType.options.map((opt, index) => (
<li key={`modifier-${opt.code}`}>
<WagerTypeButton
onClick={() => this.handleSelectModifier(wagerType, opt)}
selected={this.state.active === opt.code}
qaLabel={`wagerTypeSelector-wagerTypeBtn-${opt.code}`}
>
{getModifierName(opt.name, opt.code, index)}
{opt.hasPromoIcon &&
this.props.shouldShowPromoOnboardingIcons && (
<DSIcon name="promo" size="s" ml="space-1" />
)}
</WagerTypeButton>
</li>
))}
</SubSelectorList>
</ScrollWrapper>
</SubSelectorWrapper>
);
}
renderLegRacesList(legCount, raceNumber) {
const legRacesList = [];
for (let i = 0; i < legCount; i += 1) {
legRacesList.push(
<li key={`wagerType-R${raceNumber + i}`}>
<WagerTypeButton
onClick={() => this.handleSelectRace(i)}
selected={this.state.activeRace === i}
qaLabel="wagerTypeSelector-wagerTypeBtn-race"
>
{`R${raceNumber + i}`}
</WagerTypeButton>
</li>
);
}
return (
<SubSelectorWrapper isVisible={!this.state.isMainWagerType}>
<ScrollWrapper>
<SubSelectorList ref={(comp) => (this.ref = comp)}>
{legRacesList}
</SubSelectorList>
</ScrollWrapper>
</SubSelectorWrapper>
);
}
renderSubWagerTypeList() {
let subWagerTypes;
let wagerType = find(
this.state.wagerTypes,
(wt) => wt.code === this.state.active
);
if (wagerType) {
subWagerTypes =
wagerType.legCount > 1
? this.renderLegRacesList(wagerType.legCount, this.props.raceNumber)
: this.renderModifiersList(wagerType);
} else {
wagerType = getWagerTypeByModifier(
this.state.wagerTypes,
this.state.active
);
subWagerTypes = wagerType ? (
this.renderModifiersList(wagerType)
) : (
<SubSelectorWrapper>
<ScrollWrapper>
<SubSelectorList ref={(comp) => (this.ref = comp)} />
</ScrollWrapper>
</SubSelectorWrapper>
);
}
return (
<OptionsWrapper isVisible={!this.state.isMainWagerType}>
<BackButton
isVisible={!this.state.isMainWagerType}
qaLabel="wagerTypeSelector-backBtn"
onClick={this.props.onBackToMainWagerTypeSelector}
>
<Icon size={16} icon={arrowBack} color={buildColor("grey", "900")} />
<TextContainer>
<span>BET TYPE</span>
<span data-qa-label="wagerTypeSelector-backBtn-wagerType">
{wagerType && wagerType.name}
</span>
</TextContainer>
</BackButton>
{subWagerTypes}
</OptionsWrapper>
);
}
renderWagerTypeList() {
return (
<ScrollWrapper showFaders={this.state.isMainWagerType}>
<SelectorWrapper
isVisible={this.state.isMainWagerType}
device={this.props.device}
>
{this.state.wagerTypes.map((wagerType) => (
<li key={`wagerType-${wagerType.code}`}>
<WagerTypeButton
onClick={() => this.handleSelectWagerType(wagerType)}
qaLabel={`wagerTypeSelector-wagerTypeBtn-${wagerType.name.replace(
" ",
""
)}`}
>
{wagerType.name}
{wagerType.hasPromoIcon &&
this.props.shouldShowPromoOnboardingIcons && (
<DSIcon name="promo" size="s" ml="space-1" />
)}
</WagerTypeButton>
</li>
))}
</SelectorWrapper>
</ScrollWrapper>
);
}
render() {
return (
this.props.wagerTypes.length > 0 && (
<WagerTypeContainer fixedOffset={this.props.fixedOffset}>
{this.renderWagerTypeList()}
{this.renderSubWagerTypeList()}
</WagerTypeContainer>
)
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/InlineInfo/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import { buildText } from "../Text";
import { fontMedium, fontNormal } from "../../_static/Typography";
export const InfoContainer = styled.span`
display: flex;
flex-wrap: wrap;
text-align: left;
word-wrap: break-word;
align-items: center;
font-family: ${({ isFirstFontMedium }) =>
isFirstFontMedium ? fontMedium : fontNormal};
span {
font-family: ${fontNormal};
}
span:first-child {
font-family: ${({ isFirstFontMedium }) =>
isFirstFontMedium ? fontMedium : fontNormal};
}
`;
export const InlineInfoWrapper = styled.div`
${(props) =>
props.showInfoInline &&
css`
display: inline-flex;
`}
`;
export const IconWrapper = styled.span`
display: inline-flex;
align-items: center;
line-height: 1.3;
& > svg {
margin-right: 2px;
}
`;
export const Description = styled(
buildText({
tag: "span",
fontSize: 14,
color: buildColor("grey", "900"),
capitalize: true
})
)`
${({ showInfoInline }) =>
showInfoInline
? css`
margin-right: 5px;
`
: css`
display: block;
`};
font-weight: ${({ isDescriptionBold }) =>
isDescriptionBold ? "bold" : "normal"};
text-align: left;
padding-bottom: ${({ showInfoInline }) => (showInfoInline ? "0" : "2px")};
font-family: ${fontMedium};
`;
export const OptionItem = styled(
buildText({
tag: "span",
color: buildColor("grey", "800")
})
)`
${({ showInfoInline }) =>
showInfoInline
? css`
font-size: 14px;
color: ${buildColor("grey", "700")};
`
: css`
font-size: 12px;
`};
position: relative;
&:not(:last-child) {
margin-right: 4px;
padding-right: 5px;
&::after {
position: absolute;
right: 0;
top: 1px;
bottom: 1px;
content: "";
border-right: 1px solid ${buildColor("grey", "300")};
}
}
`;
export const SortActive = styled.strong`
position: relative;
display: inline-flex;
align-items: flex-end;
background-color: ${buildColor("grey", "200")};
color: ${buildColor("grey", "900")};
padding: 1px 2px;
border-radius: 1px;
${({ hasArrow }) =>
hasArrow &&
css`
padding: 1px 13px 1px 2px;
`}
& > svg {
transform: translate(1px, 0);
position: absolute;
top: calc(50% - 6px);
right: 2px;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/InlineInfo/index.jsx
import React, { PureComponent } from "react";
import { endsWith, get } from "lodash";
import {
Description,
OptionItem,
InfoContainer,
IconWrapper,
InlineInfoWrapper,
SortActive
} from "./styled-components";
import Icon from "../../_static/Icons";
import { changes, arrowUpward, arrowDownward } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
export default class InlineInfo extends PureComponent {
static defaultProps = {
title: "",
info: [],
isDescriptionBold: true,
isFirstBold: false,
hasJockeyChanges: false,
showInfoInline: false,
handicappingSort: true,
showHandicappingSortMode: false,
handicappingSortMode: "saddlecloth",
isFirstFontMedium: true
};
render() {
const noArrowExceptions = ["med"];
return (
<InlineInfoWrapper showInfoInline={this.props.showInfoInline}>
{!!this.props.title && (
<Description
showInfoInline={this.props.showInfoInline}
data-qa-label="handicapDescription"
>
{this.props.title}
</Description>
)}
<InfoContainer>
{this.props.info.map((handicapping, index) => {
let icon = null;
if (
handicapping.sorting &&
typeof handicapping !== "string" &&
!noArrowExceptions.includes(
get(handicapping, "key", "saddlecloth")
)
) {
switch (handicapping.sorting) {
case "asc":
icon = arrowUpward;
break;
case "desc":
icon = arrowDownward;
break;
default:
icon = null;
}
}
return (
<OptionItem
key={`inlineinfo-item-${index.toString()}`}
isFirstBold={this.props.isFirstBold}
showInfoInline={this.props.showInfoInline}
data-qa-label="handicapItem"
isFirstFontMedium={this.props.isFirstFontMedium}
>
{typeof handicapping === "object" ? (
<IconWrapper>
{this.props.hasJockeyChanges &&
(handicapping.key === "jockey" ||
handicapping.key ===
"handicapping.jockeyTrainer.jockeyName") && (
<Icon
icon={changes}
color={buildColor("yellow", "500")}
/>
)}
{this.props.handicappingSort &&
this.props.showHandicappingSortMode &&
(handicapping.key === this.props.handicappingSortMode ||
endsWith(
handicapping.key,
this.props.handicappingSortMode
)) ? (
<SortActive hasArrow={!!icon}>
{handicapping.value}
{icon && (
<Icon
icon={icon}
size={11}
color={buildColor("grey", "900")}
/>
)}
</SortActive>
) : (
handicapping.value
)}
</IconWrapper>
) : (
handicapping
)}
</OptionItem>
);
})}
</InfoContainer>
</InlineInfoWrapper>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RunnerListHeader/styled-components.js
import styled, { css } from "styled-components";
import { buildText } from "../../_atom/Text";
import { fontMedium, titleFont } from "../../_static/Typography";
import ButtonDefault from "../../_atom/Buttons/default";
import buildColor from "../../_static/ColorPalette";
export const RLHeader = styled.tr`
width: 100%;
border-style: solid;
border-width: ${(props) => (props.leg ? "0 1px 1px 1px" : "0 0 1px 0")};
border-color: ${buildColor("grey", "300")};
border-bottom: 0;
height: 40px;
background-color: ${buildColor("blue", "000")};
`;
export const RLHandicap = styled.tr`
height: 24px;
background-color: ${buildColor("blue", "000")};
border-style: solid;
border-color: ${buildColor("grey", "300")};
border-width: ${(props) => (props.leg ? "0 1px 0 1px" : "0")};
border-top: 0;
`;
export const HandicapWrapper = styled.td`
padding: 0 8px;
text-align: left;
position: relative;
`;
export const InlineContainer = styled.span`
display: flex;
padding: 4px 0;
border-top: 1px solid ${buildColor("blue", "100")};
`;
export const RunnerInfoWrapper = styled.th`
max-width: 0;
padding: 0 0 0 4px;
text-align: left;
`;
export const BetAllWrapper = styled.th`
width: ${(props) => (props.isLeg ? "30px" : "70px")};
padding: ${(props) => (props.numColumns < 3 ? "0" : "0 4px 0 0")};
& > div {
display: flex;
justify-content: flex-end;
}
`;
export const BetAllButton = styled(ButtonDefault)`
width: 48px;
height: 40px;
background: none;
font-family: ${fontMedium};
font-size: 14px;
cursor: pointer;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
span {
height: auto;
margin: 0;
}
`;
export const CloseButton = styled(ButtonDefault)`
width: 48px;
height: 40px;
background: none;
cursor: pointer;
display: flex;
flex-direction: row-reverse;
justify-content: center;
& > svg {
float: right;
}
`;
export const HandicappTypeWrapper = styled(ButtonDefault)`
position: relative;
display: inline-flex;
align-items: center;
justify-content: space-between;
background: none;
padding: 4px;
margin: 0;
font-size: 14px;
${({ iconBefore }) =>
iconBefore &&
css`
padding: 4px 4px 4px 19px;
`}
&:active {
background-color: ${buildColor("blue", "100")};
}
& > svg {
position: absolute;
top: calc(50% - 6px);
left: 4px;
}
`;
export const SeparatorLine = styled.div`
border-left: 1px solid ${buildColor("grey", "600")};
width: 0;
height: 16px;
display: inline-block;
margin: 0 4px;
`;
export const Text = styled(
buildText({
tag: "span",
fontSize: 14,
color: buildColor("blue_accent", "500"),
uppercase: true,
bold: false
})
)`
${({ verticalSpacer }) =>
verticalSpacer &&
css`
margin-bottom: 4px;
`}
height: 11px;
font-family: ${fontMedium};
`;
export const TitleBoldEllipsis = styled(
buildText({
tag: "strong",
uppercase: false,
fontSize: 10,
bold: true,
color: buildColor("grey", "900"),
ellipsis: true,
qaLabel: "handicapTitle"
})
)`
padding-right: 9px;
font-family: ${titleFont};
`;
export const FixedHandicapContainer = styled.div`
min-height: 24px;
display: flex;
align-items: center;
padding: 4px 8px;
background-color: ${buildColor("blue", "000")};
position: fixed;
${(props) =>
props.isLeg
? css`
left: 17px;
right: 17px;
`
: css`
left: 0;
right: 0;
margin: 0 4px;
border-left: 1px solid ${buildColor("grey", "300")};
border-right: 1px solid ${buildColor("grey", "300")};
`};
top: ${(props) => props.isHandicapFixed && `${props.fixedOffset}px`};
box-shadow:
0 -1px 0 0 ${buildColor("grey", "300")},
inset 0 -1px 0 0 ${buildColor("grey", "300")};
`;
export const OptionTitle = styled(
buildText({
tag: "span",
fontSize: 14,
color: buildColor("grey", "900"),
uppercase: false,
bold: false
})
)`
text-transform: capitalize;
padding: 0;
font-family: ${fontMedium};
`;
export const BetAllOption = styled(
buildText({
tag: "span",
fontSize: 14,
color: buildColor("grey", "900"),
uppercase: true,
bold: false
})
)`
position: relative;
display: flex;
align-items: center;
justify-content: center;
padding-right: 14px;
font-family: ${fontMedium};
&:active {
background-color: ${buildColor("blue", "100")};
}
& > svg {
position: absolute;
top: calc(50% - 6px);
right: 0;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RunnerListHeader/index.jsx
import React, { PureComponent, Fragment } from "react";
import { noop, times, isFunction } from "lodash";
import { createPortal } from "react-dom";
import formatSequencial from "@tvg/formatter/numeric";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import { key, arrowDown } from "../../_static/Icons/icons";
import InlineInfo from "../../_atom/InlineInfo";
import {
RLHeader,
RunnerInfoWrapper,
BetAllWrapper,
BetAllButton,
Text,
TitleBoldEllipsis,
HandicappTypeWrapper,
SeparatorLine,
RLHandicap,
HandicapWrapper,
InlineContainer,
FixedHandicapContainer,
OptionTitle,
BetAllOption
} from "./styled-components";
const getSelectionText = (selectionType, column, selected) => {
const text = [];
switch (selectionType) {
case "key":
if (column === 0) {
text.push(
<Icon key="key-icon" icon={key} color={buildColor("blue", "800")} />
);
} else {
text.push(<Text key="line1">{!selected ? "W/" : "RESET"}</Text>);
text.push(<Text key="line2">ALL</Text>);
}
break;
case "number":
text.push(
<Text key="line1">
{!selected ? formatSequencial(column + 1) : "RESET"}
</Text>
);
text.push(<Text key="line2">ALL</Text>);
break;
case "default":
default:
text.push(
<Text verticalSpacer={!selected} key="line1">
{!selected ? "BET" : "RESET"}
</Text>
);
text.push(<Text key="line2">ALL</Text>);
break;
}
return text;
};
export default class RunnerListHeader extends PureComponent {
static defaultProps = {
leg: 0,
isWagerable: true,
raceTypeCode: "T",
numColumns: 1,
fixedHandicapOffset: 0,
isHandicapFixed: false,
isKey: false,
isLeg: false,
isWheel: false,
isAllSelected: [false],
handicapInfo: [],
onAllRunnersSelect: noop,
hasHandicappingSelection: false,
handicapOptions: [],
handicapTitle: "",
refHeader: { current: null },
toggleBetAll: noop,
handicappingSortMode: "saddlecloth",
shouldRenderPromoOnboarding: false,
renderPromoOnboarding: noop
};
el;
buildHandicapFormat = () => {
/* istanbul ignore next */
if (typeof window !== "undefined") {
this.el = document.querySelector("#app > section > div") || document.body;
}
return (
!!this.props.handicapInfo.length &&
(this.props.isHandicapFixed && this.el ? (
createPortal(
<FixedHandicapContainer
isHandicapFixed
fixedOffset={this.props.fixedHandicapOffset}
isLeg={this.props.isLeg}
name="handicapWrapper"
>
<InlineInfo
info={this.props.handicapInfo}
showHandicappingSortMode={this.props.raceTypeCode !== "G"}
handicappingSortMode={this.props.handicappingSortMode}
/>
</FixedHandicapContainer>,
this.el
)
) : (
<RLHandicap name="handicapWrapper" leg={this.props.isLeg}>
<HandicapWrapper colSpan={4}>
<InlineContainer>
<InlineInfo
info={this.props.handicapInfo}
showHandicappingSortMode={this.props.raceTypeCode !== "G"}
handicappingSortMode={this.props.handicappingSortMode}
/>
</InlineContainer>
</HandicapWrapper>
</RLHandicap>
))
);
};
renderSelectAll = () => {
const selectionType = (() => {
if (!this.props.isKey) {
return this.props.numColumns === 1 ? "default" : "number";
}
return "key";
})();
const buildQALabel = (column) => {
if (this.props.isKey) {
return column === 0
? "runnerListHeader-selectKeyButton"
: "runnerListHeader-selectWithButton";
}
return this.props.numColumns === 1
? "runnerListHeader-selectAllButton"
: `runnerListHeader-select-${column + 1}-button`;
};
return this.props.numColumns < 3 ? (
times(
this.props.numColumns,
(column) =>
!(this.props.isWheel && column === 0) && (
<BetAllButton
key={`button-${column}`}
onClick={() =>
this.props.onAllRunnersSelect(
this.props.leg > 0 ? this.props.leg : column
)
}
qaLabel={buildQALabel(column)}
isBold={false}
>
{getSelectionText(
selectionType,
column,
this.props.isAllSelected[column]
)}
</BetAllButton>
)
)
) : (
<HandicappTypeWrapper
onTouchStart={noop}
qaLabel="runnerListHeader-BetAllSelector"
onClick={this.props.toggleBetAll}
>
<BetAllOption>
BET ALL <Icon icon={arrowDown} size={11} />
</BetAllOption>
</HandicappTypeWrapper>
);
};
renderSelectOptions = () =>
this.props.handicapOptions
.filter((option) => option.visible)
.map((option, index, options) => (
<Fragment key={`select-option-${index.toString()}`}>
<HandicappTypeWrapper
onTouchStart={noop}
qaLabel={option.qaLabel}
onClick={option.callback}
iconBefore
>
{!!option.icon && <Icon icon={option.icon} size={11} />}
<OptionTitle>{option.title.toLowerCase()}</OptionTitle>
</HandicappTypeWrapper>
{index < options.length - 1 && <SeparatorLine />}
</Fragment>
));
render() {
const promoOnboardingComponent = isFunction(
this.props.renderPromoOnboarding
)
? this.props.renderPromoOnboarding()
: null;
return (
<thead data-qa-label="runnerListHeader" ref={this.props.refHeader}>
<RLHeader leg={this.props.isLeg}>
<RunnerInfoWrapper colSpan={this.props.isWagerable ? 3 : 4}>
{this.props.hasHandicappingSelection ? (
this.renderSelectOptions()
) : (
<TitleBoldEllipsis>{this.props.handicapTitle}</TitleBoldEllipsis>
)}
</RunnerInfoWrapper>
{this.props.isWagerable && (
<BetAllWrapper
isLeg={this.props.isLeg}
numColumns={this.props.numColumns}
>
<div>{this.renderSelectAll()}</div>
</BetAllWrapper>
)}
</RLHeader>
{this.buildHandicapFormat()}
{this.props.shouldRenderPromoOnboarding &&
!!promoOnboardingComponent && (
<tr>
<td colSpan={4}>{promoOnboardingComponent}</td>
</tr>
)}
</thead>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-utils/handicappingUtils.js
import { get } from "lodash";
import sortRunnerList from "./handicappingSort";
export const getHandicappingMode = (logged, mode, isGreyhound) => {
if (logged) {
if (isGreyhound && mode !== "basic") {
return "advanced";
}
return mode;
}
return "basic";
};
const getSnapShotHandicapping = (runner) => {
const handicapping = [];
// power
const power = get(runner, "handicapping.snapshot.powerRating");
if (power !== undefined && power !== null && power !== "") {
handicapping.push({ key: "power", value: power.toString() });
} else {
handicapping.push({ key: "power", value: "-" });
}
// horse wins and horse starts
const horseWins = get(runner, "handicapping.snapshot.horseWins");
const horseStarts = get(runner, "handicapping.snapshot.horseStarts");
let winStarts = "";
if (horseWins !== undefined && horseWins !== null && horseWins !== "") {
winStarts += horseWins;
} else {
winStarts += "-";
}
winStarts += "/";
if (horseStarts !== undefined && horseStarts !== null && horseStarts !== "") {
winStarts += horseStarts;
} else {
winStarts += "-";
}
handicapping.push({ key: "winStarts", value: winStarts });
// Days off
const daysOff = get(runner, "handicapping.snapshot.daysOff");
if (daysOff !== undefined && daysOff !== null && daysOff !== "") {
handicapping.push({ key: "daysOff", value: `${daysOff}` });
} else {
handicapping.push({ key: "daysOff", value: "-" });
}
return handicapping;
};
export const addOptions = (keys, mappingObject) => {
const handicapping = [];
keys.forEach((option) => {
const defaultValue = "-";
const value = get(mappingObject, `${option}`, defaultValue);
handicapping.push({
key: option,
value: value === "" ? defaultValue : value
});
});
return handicapping;
};
const buildHandicapping = (key, runner, isGreyhound = false) => {
let optionsArray;
switch (key) {
case "advanced":
optionsArray = isGreyhound
? ["jockey", "trainer", "weight", "age", "sex", "sire", "dam"]
: [
"age",
"sex",
"jockey",
"trainer",
"med",
"weight",
"sire",
"dam",
"damSire",
"ownerName"
];
return addOptions(optionsArray, runner);
case "snapshot":
return getSnapShotHandicapping(runner);
case "speed":
optionsArray = [
"handicapping.speedAndClass.avgSpeed",
"handicapping.speedAndClass.avgDistance",
"handicapping.speedAndClass.highSpeed",
"handicapping.speedAndClass.avgClassRating",
"handicapping.speedAndClass.lastClassRating"
];
return addOptions(optionsArray, runner);
case "pace":
optionsArray = [
"handicapping.averagePace.numRaces",
"handicapping.averagePace.early",
"handicapping.averagePace.middle",
"handicapping.averagePace.finish"
];
return addOptions(optionsArray, runner);
case "stats":
optionsArray = [
"handicapping.jockeyTrainer.jockeyName",
"handicapping.jockeyTrainer.trainerName",
"handicapping.jockeyTrainer.starts",
"handicapping.jockeyTrainer.wins",
"handicapping.jockeyTrainer.places",
"handicapping.jockeyTrainer.shows"
];
return addOptions(optionsArray, runner);
default:
optionsArray = ["jockey", "trainer"];
return addOptions(optionsArray, runner);
}
};
export const buildRunners = (
key,
runners,
isGreyhound = false,
trackCode = "",
showPickNumber = false,
isJockeyChangeShown = false
) => {
if (!trackCode.includes("HKS") && !trackCode.includes("HKH")) {
return (
runners &&
runners.map((runner) => ({
...runner,
hasJockeyChanges: isJockeyChangeShown
? !!runner.hasJockeyChanges
: false,
handicapping: buildHandicapping(key, runner, isGreyhound),
masterPickNumber: showPickNumber
? get(runner, "handicapping.freePick.number")
: -1
}))
);
}
const newRunners = [];
runners.forEach((runner) => {
if (!get(runner, "runnerId", "").includes("S")) {
newRunners.push({
...runner,
hasJockeyChanges: isJockeyChangeShown
? !!runner.hasJockeyChanges
: false,
handicapping: buildHandicapping(key, runner, isGreyhound),
masterPickNumber: showPickNumber
? get(runner, "handicapping.freePick.number")
: -1
});
}
});
return newRunners;
};
export const getRunnersInfoForRace = (
bettingInterests = [],
key = "basic",
isGreyhound = false,
trackCode = "",
showPickNumber = false,
isJockeyChangeShown = false,
handicappingMode = "basic",
handicappingSortMode = "saddlecloth"
) => {
const mappedBettingInterests = bettingInterests.map((bettingInterest) => ({
biNumber: bettingInterest.biNumber,
currentOdds: bettingInterest.currentOdds,
morningLineOdds: bettingInterest.morningLineOdds,
recentOdds: bettingInterest.recentOdds,
isFavorite: bettingInterest.isFavorite,
runners: buildRunners(
key,
bettingInterest.runners,
isGreyhound,
trackCode,
showPickNumber,
isJockeyChangeShown
)
}));
return handicappingSortMode &&
handicappingSortMode !== "saddlecloth" &&
!isGreyhound
? sortRunnerList(
mappedBettingInterests,
handicappingMode,
handicappingSortMode
)
: mappedBettingInterests;
};
const getRunnersInfoForRaceCard = (
bettingInterestsMatrix = [],
key = "basic",
isGreyhound = false,
trackCode = "",
showPickNumber = false,
isJockeyChangeShown = false,
handicappingMode = "basic",
handicappingSortMode = "saddlecloth"
) =>
bettingInterestsMatrix.map((bettingInterests) =>
getRunnersInfoForRace(
bettingInterests,
key,
isGreyhound,
trackCode,
showPickNumber,
isJockeyChangeShown,
handicappingMode,
handicappingSortMode
)
);
export const isFirstElementBold = (key) => ["basic", "stats"].includes(key);
export const doesSilkLoads = (bettingInterests, isRacecard = false) => {
if (!!bettingInterests && bettingInterests.length > 0) {
const runnerList = isRacecard
? get(bettingInterests, "[0].[0].runners", {})
: get(bettingInterests, "[0].runners", {});
const silkUrl = get(runnerList, "[0].timeform.silkUrlSvg");
if (silkUrl) {
return new Promise((resolve) => {
const img = new Image();
// eslint-disable-next-line
img.onerror = img.onabort = () => {
resolve(false);
};
img.onload = () => {
resolve(true);
};
img.src = silkUrl;
});
}
}
return Promise.resolve(false);
};
export default getRunnersInfoForRaceCard;
webpack://frontend-tpt/../../packages/tvg-lib-utils/handicappingSort.ts
import { find, get, findKey, endsWith, orderBy } from "lodash";
import {
HandicapOptionsType,
HandicapSortOptionsType,
RaceCardBettingInterest,
BettingInterest,
RaceOdds
} from "@tvg/ts-types/Race";
import { UnaryFn } from "@tvg/ts-types/Functional";
import handicappingOptions from "./handicapping-conf/handicappingOptions";
type OrderEnum = "asc" | "desc";
const setHandicappingSortOrderMode = (
handicappingMode: HandicapOptionsType,
handicappingSortMode: HandicapSortOptionsType
): OrderEnum => {
const matchedHandicappingMode = find(handicappingOptions, {
key: handicappingMode
});
const matchedHandicappingSortMode = find(
get(matchedHandicappingMode, "handicapData", {
key: handicappingSortMode,
sorting: "asc"
}),
// @ts-ignore
{ key: handicappingSortMode }
);
return get(matchedHandicappingSortMode, "sorting", "asc");
};
const sortRunnerList = (
runnersList: RaceCardBettingInterest[],
handicappingMode: HandicapOptionsType,
handicappingSortMode: HandicapSortOptionsType
): RaceCardBettingInterest[] => {
let handicappingOrderMode = setHandicappingSortOrderMode(
handicappingMode,
handicappingSortMode
);
const defaultHandicappingSortMode = HandicapSortOptionsType.SADDLECLOTH;
const defaultHandicappingOrderMode: OrderEnum = "asc";
const firstElementSample = get(
runnersList,
"[0].runners[0].handicapping",
{}
);
// Find sort mode criteria within betting interest structure
const findDataByKey = (dataToSort: HandicapSortOptionsType): string => {
const foundValueByKey = findKey(firstElementSample, (val) =>
endsWith(val.key, dataToSort)
);
return foundValueByKey
? `runners[0].handicapping[${foundValueByKey}].value`
: "";
};
const rateCalculation = (
numerator: number | null | undefined,
denominator: number | null | undefined
): number => {
let returnValue = 0;
if (denominator && numerator) {
returnValue = numerator / denominator;
} else if (denominator === null && numerator) {
returnValue = numerator;
}
return !Number.isNaN(returnValue) ? returnValue : 0;
};
// Figuring out which values should be cast to number for sorting or not
const valuesToCastToNumber = [
HandicapSortOptionsType.AGE,
HandicapSortOptionsType.WEIGHT,
HandicapSortOptionsType.POWER,
HandicapSortOptionsType.DAYS_OFF,
HandicapSortOptionsType.AVG_SPEED,
HandicapSortOptionsType.AVG_DISTANCE,
HandicapSortOptionsType.HIGH_SPEED,
HandicapSortOptionsType.AVG_CLASS_RATING,
HandicapSortOptionsType.LAST_CLASS_RATING,
HandicapSortOptionsType.NUM_RACES,
HandicapSortOptionsType.EARLY,
HandicapSortOptionsType.MIDDLE,
HandicapSortOptionsType.FINISH,
HandicapSortOptionsType.STARTS,
HandicapSortOptionsType.WINS,
HandicapSortOptionsType.PLACES,
HandicapSortOptionsType.SHOWS
];
const valueCasting =
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(dataToSort: string | UnaryFn<any, number>) => (value: BettingInterest) => {
// @ts-ignore
if (typeof dataToSort === "string") {
let valueToReturn = get(value, dataToSort, "-");
const limit = dataToSort.length - 6;
const keyValue = `${dataToSort.substring(0, limit)}.key`;
const keyToReturn = get(value, keyValue, "");
// This string transformation is here because of long key names with dots
// The objective is to get the last value splitted by dots to match any
// values on the valuesToCastToNumber array above
if (
valuesToCastToNumber.includes(keyToReturn.split(".").slice(-1)[0])
) {
valueToReturn = !Number.isNaN(+valueToReturn) ? +valueToReturn : 0;
}
return valueToReturn;
}
return "";
};
// Sort modes config
const sortModes = {
saddlecloth: "biNumber",
odds: ({ currentOdds }: { currentOdds: RaceOdds }): number => {
const { numerator, denominator } = currentOdds || {
numerator: 99,
denominator: 0
};
return rateCalculation(numerator, denominator);
},
age: findDataByKey(HandicapSortOptionsType.AGE),
med: findDataByKey(HandicapSortOptionsType.MED),
weight: findDataByKey(HandicapSortOptionsType.WEIGHT),
power: findDataByKey(HandicapSortOptionsType.POWER),
winStarts: (bettingInterest: BettingInterest): number => {
const winStarts = get(
bettingInterest,
findDataByKey(HandicapSortOptionsType.WIN_STARTS),
"0"
);
const [numerator, denominator] = winStarts.split("/");
return rateCalculation(numerator, denominator);
},
daysOff: findDataByKey(HandicapSortOptionsType.DAYS_OFF),
avgSpeed: findDataByKey(HandicapSortOptionsType.AVG_SPEED),
avgDistance: findDataByKey(HandicapSortOptionsType.AVG_DISTANCE),
highSpeed: findDataByKey(HandicapSortOptionsType.HIGH_SPEED),
avgClassRating: findDataByKey(HandicapSortOptionsType.AVG_CLASS_RATING),
lastClassRating: findDataByKey(HandicapSortOptionsType.LAST_CLASS_RATING),
numRaces: findDataByKey(HandicapSortOptionsType.NUM_RACES),
early: findDataByKey(HandicapSortOptionsType.EARLY),
middle: findDataByKey(HandicapSortOptionsType.MIDDLE),
finish: findDataByKey(HandicapSortOptionsType.FINISH),
starts: findDataByKey(HandicapSortOptionsType.STARTS),
wins: findDataByKey(HandicapSortOptionsType.WINS),
places: findDataByKey(HandicapSortOptionsType.PLACES),
shows: findDataByKey(HandicapSortOptionsType.SHOWS)
};
const bettingInterests: RaceCardBettingInterest[] = [];
const bettingInterestsScratched: RaceCardBettingInterest[] = [];
// Sorting out scratched and coupled entries
runnersList.forEach((bettingInterest) => {
if (bettingInterest.runners && bettingInterest.runners.length > 1) {
bettingInterest.runners.forEach((currentRunner) => {
const runner = {
...bettingInterest,
runners: [currentRunner]
};
if (currentRunner.scratched) {
bettingInterestsScratched.push(runner);
} else {
bettingInterests.push(runner);
}
});
} else if (
bettingInterest.runners &&
bettingInterest.runners[0].scratched
) {
bettingInterestsScratched.push(bettingInterest);
} else {
bettingInterests.push(bettingInterest);
}
});
// exception for when you have year of birth instead of age
if (handicappingSortMode === HandicapSortOptionsType.AGE) {
const ageSample = get(
bettingInterests,
`[0].${findDataByKey(HandicapSortOptionsType.AGE)}`,
0
);
handicappingOrderMode = ageSample < 100 ? "asc" : "desc";
}
// Actual sorting criteria
const exceptionsToCast = [
HandicapSortOptionsType.ODDS,
HandicapSortOptionsType.WIN_STARTS
];
// Take note of the exception for odds, which has its own sorting method
const sortOptions = [
exceptionsToCast.includes(handicappingSortMode)
? sortModes[`${handicappingSortMode}`]
: valueCasting(sortModes[`${handicappingSortMode}`]),
sortModes[`${defaultHandicappingSortMode}`]
];
const sortOrders = [handicappingOrderMode, defaultHandicappingOrderMode];
const bettingInterestsSorted = orderBy(
bettingInterests,
sortOptions,
sortOrders
);
const bettingInterestsScratchedSorted = orderBy(
bettingInterestsScratched,
sortOptions,
sortOrders
);
// @ts-ignore
return bettingInterestsSorted.concat(bettingInterestsScratchedSorted);
};
export default sortRunnerList;
webpack://frontend-tpt/../../packages/urp-lib-alchemer/types.ts
export enum AlchemerFeedbackWidget {
OPEN = "BETA-PROGRAM:OPEN_FEEDBACK_WIDGET",
SUBMIT = "BETA-PROGRAM:SUBMIT_FEEDBACK_WIDGET"
}
webpack://frontend-tpt/../../packages/urp-lib-alchemer/amplitude.ts
import mediator from "@tvg/mediator";
import { AlchemerFeedbackWidget } from "./types";
export const sendOpenFeedbackWidgetEvent = () =>
mediator.base.dispatch({
type: AlchemerFeedbackWidget.OPEN
});
export const sendSubmitFeedbackWidgetEvent = () =>
mediator.base.dispatch({
type: AlchemerFeedbackWidget.SUBMIT
});
webpack://frontend-tpt/../../packages/urp-lib-alchemer/utils.ts
import mediator from "@tvg/mediator";
import { isMobile } from "@tvg/sh-utils/mobileUtils";
import { UserInfo } from "@tvg/ts-types/User";
import {
sendOpenFeedbackWidgetEvent,
sendSubmitFeedbackWidgetEvent
} from "./amplitude";
export const createConversation = ({
accountNumber,
firstName,
lastName,
emailAddress,
profile,
homeAddress,
primaryPhone
}: UserInfo) => {
if (typeof window !== "undefined" && window.ApptentiveSDK) {
const payload = {
app_release: {
version: "1.0.0"
},
person: {
custom_data: {
account_id: accountNumber,
first_name: firstName,
last_name: lastName,
email: emailAddress,
day_of_birthday: "",
home_city: homeAddress ? homeAddress.state : "",
gender: "",
country: homeAddress ? homeAddress.country : "",
phone: primaryPhone,
full_home_address: "",
key_account_yn: false,
value_band: profile
}
},
device: {
custom_data: {
flash: true,
es6: false
}
}
};
window.ApptentiveSDK.createConversation(payload);
}
};
export const engageApptentiveEvent = (eventName: string) => {
if (isMobile()) {
mediator.ios.dispatch({
type: "ALCHEMER_EVENTS",
payload: { alchemerEvent: eventName }
});
} else if (typeof window !== "undefined" && window.ApptentiveSDK) {
window.ApptentiveSDK.engage(eventName);
}
};
export const dispatchSubmited = () => {
sendSubmitFeedbackWidgetEvent();
document.removeEventListener("apptentive:survey:submit", dispatchSubmited);
};
export const trackBetaFeatureFeedback = () => {
sendOpenFeedbackWidgetEvent();
document.addEventListener("apptentive:survey:submit", dispatchSubmited);
};
export const closeSurveyAfterSubmit = () => {
const closeButton = document.getElementsByClassName(
"apptentive-button--primary"
);
const closeSurvey = () => {
closeButton[0]?.removeEventListener("click", closeSurvey);
};
closeButton[0]?.addEventListener("click", closeSurvey);
};
export const hideMinimizeSurveyButton = () => {
const alchemerMinimizeBtn = document?.getElementsByClassName(
"apptentive-appbar__action--minimize"
);
if (document?.body && alchemerMinimizeBtn.length) {
// @ts-ignore
alchemerMinimizeBtn[0].style = "display:none";
}
};
webpack://frontend-tpt/../../packages/urp-lib-alchemer/events/accountWallet.ts
import { engageApptentiveEvent } from "../utils";
// when a user logs in to TVG
export const login = () => engageApptentiveEvent("Login");
// when user close the success deposit modal
export const closeDeposit = () => engageApptentiveEvent("Deposit");
// when user close the success withdrawal modal
export const closeWithdrawal = () => engageApptentiveEvent("Withdrawal");
// when user select Responsible Gaming
export const selectResponsibleGaming = () =>
engageApptentiveEvent("Responsible Gaming");
// when user select Wallet
export const selectWallet = () => engageApptentiveEvent("Wallet is tapped");
// when user navigate to Home
export const navigateHome = () => engageApptentiveEvent("Home tapped");
webpack://frontend-tpt/../../packages/urp-lib-alchemer/events/betActivities.ts
import { engageApptentiveEvent } from "../utils";
// when a user logs in to TVG
export const placeABet = () => engageApptentiveEvent("Places bet");
// when a user select handicap option
export const selectHandicapOptions = () =>
engageApptentiveEvent("Handicapping options tapped");
// when a user select the TVG Logo
export const selectTVGLogo = () => engageApptentiveEvent("TVG Logo tapped");
// when a user set a track as favorite
export const setTrackAsFavorite = () =>
engageApptentiveEvent("Race track is favorited");
// when a user selects/uses inline pps in raace page
export const selectInlinePastPerformance = () =>
engageApptentiveEvent("Inline past performance tapped");
// when a user selects 'More' in the race page to view pps
export const selectMoreButton = () =>
engageApptentiveEvent(`User taps "more" in race page to view PPs`);
// when a user selects a bet type tooltip in the race page
export const selectBetTypeTooltip = () =>
engageApptentiveEvent("Bet Type tooltip is tapped");
webpack://frontend-tpt/../../packages/urp-lib-alchemer/events/interactions.ts
import { engageApptentiveEvent, hideMinimizeSurveyButton } from "../utils";
// when a user wants to give feedback on the New Program Page beta feature
export const showNewProgramPageFeedbackSurvey = () =>
engageApptentiveEvent("Beta Program Page Feedback");
export const showExitNewFeedbackBetaProgramSurvey = () =>
engageApptentiveEvent("New Feature Exit Beta");
// when a user wants to give feedback for the whole app
// ("Send Feedback" buttons on the Account Panel)
export const showSendFeedbackSurvey = () => {
engageApptentiveEvent("Send Feedback");
hideMinimizeSurveyButton();
};
webpack://frontend-tpt/../../packages/urp-lib-alchemer/events/featureActivities.ts
import { engageApptentiveEvent } from "../utils";
// when a user receives referral bonus inbox/email
export const refferalBonusDeposited = () =>
engageApptentiveEvent("Refferal bonus is deposited to user account");
// when a user selects any video
export const selectEducationVideo = () =>
engageApptentiveEvent("Education videos is tapped");
// when a user selects 'Watch Live'
export const selectWatchLiveButton = () =>
engageApptentiveEvent("Watch Live is tapped");
webpack://frontend-tpt/../../packages/urp-lib-alchemer/events/raceActivities.ts
import { engageApptentiveEvent } from "../utils";
// when a user selects on Races Starting Soon
export const selectStartsSoonRace = () =>
engageApptentiveEvent("Races Starting Soon is tapped");
// when a user selects on Today's Popular Races
export const selectPopularRace = () =>
engageApptentiveEvent("Today's Popular Races is tapped");
webpack://frontend-tpt/../../packages/urp-lib-alchemer/events/navigationActivities.ts
import { engageApptentiveEvent } from "../utils";
// when a user selects back to return to the home screen
export const backTapped = () =>
engageApptentiveEvent("Back button/icon is tapped");
// when a user selects the FDR logo to go to home screen
export const fdrLogoTapped = () => engageApptentiveEvent("FDR Logo tapped");
// when a user selects home button
export const homeTapped = () => engageApptentiveEvent("Home tapped");
// when a users favorites a track
export const selectFavouriteTrack = () =>
engageApptentiveEvent("Race track is favorited");
// when a user selects Earn $20 (RAF)
export const earnBonusTapped = () =>
engageApptentiveEvent("Earn $20 (RAF) tapped");
// when a user selects "Tutorials" tab
export const selectTutorialsTab = () =>
engageApptentiveEvent(`"Tutorials" is tapped`);
// when a user select "Learn horse racing"
export const selectLearnHorseRacing = () =>
engageApptentiveEvent(`"Learn horse racing" is tapped`);
webpack://frontend-tpt/../../packages/urp-lib-alchemer/events/index.ts
import * as accountWallet from "./accountWallet";
import * as betActivities from "./betActivities";
import * as interactions from "./interactions";
import * as featureActivities from "./featureActivities";
import * as raceActivities from "./raceActivities";
import * as navigationActivities from "./navigationActivities";
export const events = {
...accountWallet,
...betActivities,
...interactions,
...featureActivities,
...raceActivities,
...navigationActivities
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/RunnerOdds/styled-components.js
import styled from "styled-components";
import { fontMedium, fontNormal } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
import { generateTransition, easeInOut } from "../../_static/Transitions";
export const RunnerOddsAtom = styled.div`
position: absolute;
top: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
height: 100%;
align-items: center;
text-align: center;
font-size: 12px;
line-height: 14px;
opacity: ${(props) => props.scratched && 0.4};
background-color: ${(props) => props.favorite && buildColor("yellow", "100")};
will-change: background-color;
transition: ${generateTransition(easeInOut, "background-color")};
& > strong {
margin-bottom: 2px;
}
`;
export const Strong = styled.span`
display: block;
font-size: 14px;
font-family: ${fontMedium};
height: 16px;
letter-spacing: 0;
text-align: center;
margin: 0 0 2px;
color: ${buildColor("grey", "900")};
`;
export const Span = styled.span`
display: block;
font-size: 12px;
font-family: ${fontNormal};
font-weight: 500;
height: 14px;
letter-spacing: 0;
text-align: center;
color: ${buildColor("grey", "800")};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/RunnerOdds/index.jsx
import React, { PureComponent } from "react";
import { isNumber, toString, toNumber } from "lodash";
import { RunnerOddsAtom, Strong, Span } from "./styled-components";
const getRunnerOddQALabelSuffix = (isFavorite, isScratched) => {
if (isScratched) {
return "-scratched";
}
if (isFavorite) {
return "-favorite";
}
return "";
};
export default class RunnerOdds extends PureComponent {
static defaultProps = {
isScratched: false,
isSelected: false,
isFavorite: false,
currentOddsNumerator: null,
currentOddsDenominator: null,
morningLineOddsNumerator: null,
morningLineOddsDenominator: null
};
renderOddDenominator() {
return (
(isNumber(this.props.currentOddsDenominator) &&
`/${toString(this.props.currentOddsDenominator)}`) ||
""
);
}
renderOdd() {
if (!this.props.isScratched) {
if (!isNumber(this.props.currentOddsNumerator)) {
return "n/a";
}
return `${toString(
this.props.currentOddsNumerator
)}${this.renderOddDenominator()}`;
}
return "scr";
}
renderMorningLineDenominator() {
return (
(toNumber(this.props.morningLineOddsDenominator) > 1 &&
`/${toString(this.props.morningLineOddsDenominator)}`) ||
""
);
}
renderMorningLine() {
if (isNumber(this.props.morningLineOddsNumerator)) {
return `${
this.props.morningLineOddsNumerator
}${this.renderMorningLineDenominator()}`;
}
return "n/a";
}
render() {
return (
<RunnerOddsAtom
data-qa-label={`runnerOdds${getRunnerOddQALabelSuffix(
this.props.isFavorite,
this.props.isScratched
)}`}
scratched={this.props.isScratched}
favorite={this.props.isFavorite && !this.props.isScratched}
>
<Strong qaLabel="runnerOdds-odd">{this.renderOdd()}</Strong>
<Span qaLabel="runnerOdds-morningLineOdd">
{this.renderMorningLine()}
</Span>
</RunnerOddsAtom>
);
}
}
webpack://frontend-tpt/../../packages/tvg-comp-inline-past-performance/src/components/SimpleInlineInfo/styled-components.ts
import styled, { css } from "styled-components";
import { tvgColorPalette as colors } from "@tvg/design-system/src/theming/themes/common/tvgColorPalette";
import { fonts } from "@tvg/design-system/src/theming/themes/common/fonts";
export const InfoContainer = styled.div`
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
`;
export const Description = styled.span`
text-transform: capitalize;
display: block;
font-weight: bold;
text-align: left;
padding-bottom: 2px;
font-size: 12px;
${({ theme }) => `color: ${theme.colorTokens.content.default}`};
`;
export const OptionItem = styled.span`
position: relative;
font-size: 12px;
color: ${({ theme }) => theme.colorTokens.content.subtle};
&:not(:last-child) {
margin-right: 4px;
padding-right: 5px;
}
`;
export const InfoItems = styled.ul`
white-space: normal;
font-size: 12px;
line-height: 18px;
font-family: ${fonts.regular};
color: ${({ theme }) => theme.colorTokens.content.subtle};
`;
export const InfoItem = styled.li<{
isHighlighted: boolean;
hasChanges: boolean;
}>`
display: inline;
${({ isHighlighted }) =>
isHighlighted &&
css`
font-family: ${fonts.medium};
font-weight: 500;
`};
${({ hasChanges }) =>
hasChanges &&
css`
color: ${colors.orange[700]};
`};
`;
export const Separator = styled.span`
font-weight: normal;
line-height: 17px;
vertical-align: initial;
font-size: 12px;
font-family: ${fonts.regular};
${({ theme }) => `color: ${theme.colorTokens.background.neutral}`};
`;
export const FavoriteTag = styled.span`
margin-left: 2px;
padding: 1px 6px;
border-radius: 12px;
font-style: normal;
line-height: 14px;
text-align: center;
vertical-align: text-top;
font-family: ${fonts.condensedRegular};
font-weight: 500;
font-size: 12px;
${({ theme }) => `
color: ${theme.colorTokens.content.alert};
background: ${theme.colorTokens.background.alertSubtle};
`}
`;
export const IconContainer = styled.div`
display: inline-flex;
margin-right: 4px;
vertical-align: inherit;
`;
webpack://frontend-tpt/../../packages/tvg-comp-inline-past-performance/src/components/SimpleInlineInfo/index.tsx
import React, { FC } from "react";
import { get } from "lodash";
import { HandicapOptions } from "@tvg/ts-types/Race";
import { Icon } from "@tvg/design-system";
import {
Description,
OptionItem,
InfoItems,
InfoItem,
InfoContainer,
FavoriteTag,
Separator,
IconContainer
} from "./styled-components";
interface Props {
/**
* Description of the race
*/
title?: string;
/**
* Inline data to displayed
*/
info: Array<HandicapOptions | string>;
/**
* Handicap options keys to highlight (only available if info typeof HandicapOptions)
*/
highlighted?: Array<string>;
/**
* Handicap options keys to mark has changed (only available if info typeof HandicapOptions)
*/
changed?: Array<string>;
/**
* Handicap options keys with favorite tag (only available if info typeof HandicapOptions)
*/
favorite?: Array<string>;
/**
* Handicap info separator
*/
separator?: string;
/**
* Style class name
*/
className?: string;
/*
use updated icon to not break anywhere the icon
*/
useUpdatedIcon?: boolean;
}
const SimpleInlineInfo: FC<Props> = ({
title = "",
info = [],
highlighted = [],
changed = [],
favorite = [],
separator = " |",
className = "",
useUpdatedIcon = false
}) => {
const isInfoArrayOfStrings = () =>
info.reduce(
(result, infoItem) => result && typeof infoItem === "string",
true
);
const renderInfoItems = () => (
<InfoItems data-qa-label="handicapItems">
{info.map((infoItem, infoIndex) => {
const hasSeparator = infoIndex !== 0;
if (typeof infoItem === "string")
return hasSeparator ? `${separator} ${infoItem}` : infoItem;
const infoItemKey = get(infoItem, "key", `keyDefault_${infoIndex}`);
const hasChanges = changed && changed.includes(infoItemKey);
return (
<InfoItem
key={infoItemKey}
data-qa-label={`handicapItem-${infoItemKey}`}
isHighlighted={highlighted && highlighted.includes(infoItemKey)}
hasChanges={hasChanges}
>
{hasSeparator && <Separator>{`${separator} `}</Separator>}
{hasChanges && (
<IconContainer>
<Icon
name="changes"
size="s"
backgroundColor={
useUpdatedIcon ? "orange.400" : "transparent"
}
lineColor={useUpdatedIcon ? "grey.900" : "orange.400"}
/>
</IconContainer>
)}
{infoItem.value}
{favorite && favorite.includes(infoItemKey) && (
<FavoriteTag>FAV</FavoriteTag>
)}
</InfoItem>
);
})}
</InfoItems>
);
return (
<InfoContainer className={className}>
{!!title && (
<Description data-qa-label="handicapDescription">{title}</Description>
)}
{isInfoArrayOfStrings() ? (
<OptionItem data-qa-label="handicapItem">
{info.join(`${separator} `)}
</OptionItem>
) : (
renderInfoItems()
)}
</InfoContainer>
);
};
export default SimpleInlineInfo;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Saddle/styled-components.ts
import styled, { css } from "styled-components";
import { space } from "styled-system";
import { SaddleProps } from "./types";
import { Paragraph } from "../Typography";
const hexToRgba = (hexCode = "#fff", opacity = 1) => {
let hex = hexCode.replace("#", "");
if (hex.length === 3) {
hex = `${hex[0]}${hex[0]}${hex[1]}${hex[1]}${hex[2]}${hex[2]}`;
}
const r = parseInt(hex.substring(0, 2), 16);
const g = parseInt(hex.substring(2, 4), 16);
const b = parseInt(hex.substring(4, 6), 16);
return `rgba(${r},${g},${b},${opacity})`;
};
export const StyledSaddle = styled.div<
Pick<
SaddleProps,
| "all"
| "saddleColor"
| "fullHeight"
| "isScratched"
| "size"
| "raceFinished"
| "enableMyBetsBehavior"
| "isWinner"
| "showAlternateIcon"
>
>`
align-items: center;
background-color: ${({
saddleColor,
isScratched,
isWinner,
raceFinished,
enableMyBetsBehavior
}) =>
isScratched || (enableMyBetsBehavior && raceFinished && !isWinner)
? `${hexToRgba(saddleColor, 0.4)}`
: saddleColor};
border-radius: 2px;
display: flex;
justify-content: center;
position: relative;
${({ isScratched, enableMyBetsBehavior }) =>
isScratched &&
enableMyBetsBehavior &&
css`
box-shadow: inset 0 0 0 2px var(--fd-colors-core-grey-d-2);
`}
${({ showAlternateIcon }) =>
showAlternateIcon &&
css`
& > svg {
position: absolute;
top: -8px;
right: -8px;
z-index: 2;
}
`}
${({ size, fullHeight, all }) => {
if (fullHeight && size !== "s") {
return css`
flex-grow: 1;
height: 100%;
width: 32px;
`;
}
if (all === true && size === "s") {
return css`
width: 44px;
height: 20px;
`;
}
return css`
height: ${size === "s" ? "20px" : "44px"};
width: ${size === "s" ? "20px" : "32px"};
`;
}}
${space};
${({ isWinner }) =>
isWinner &&
css`
&::after {
content: "";
position: absolute;
top: 12px;
left: 12px;
width: 12px;
height: 12px;
z-index: 2;
background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.438 6.00219C11.438 9.00537 9.00342 11.4399 6.00024 11.4399C2.99706 11.4399 0.5625 9.00537 0.5625 6.00219C0.5625 2.99901 2.99706 0.564453 6.00024 0.564453C9.00342 0.564453 11.438 2.99901 11.438 6.00219Z' fill='%23128000'/%3E%3Cpath d='M3.37527 6.0001L5.25027 7.8751L9.00027 4.1251M11.438 6.00219C11.438 9.00537 9.00342 11.4399 6.00024 11.4399C2.99706 11.4399 0.5625 9.00537 0.5625 6.00219C0.5625 2.99901 2.99706 0.564453 6.00024 0.564453C9.00342 0.564453 11.438 2.99901 11.438 6.00219Z' stroke='white'/%3E%3C/svg%3E ");
}
`};
`;
export const DiagonalLine = styled.div`
position: absolute;
width: 24px;
height: 2px;
background-color: var(--fd-colors-core-grey-d-2);
top: calc(50% - 1px);
left: -2px;
transform: rotate(135deg);
z-index: 1;
`;
export const StyledParagraph = styled(Paragraph)<
Pick<
SaddleProps,
| "size"
| "isScratched"
| "isWinner"
| "raceFinished"
| "enableMyBetsBehavior"
>
>`
font-family: ${({ size }) =>
size === "s"
? `${'"Roboto-Regular", sans-serif'}`
: `${'"Roboto-Bold", sans-serif'}`};
font-size: ${({ size }) => (size === "s" ? "12px" : "18px")};
text-align: center;
line-height: ${({ size }) => (size === "s" ? "15px" : "22px")};
opacity: ${({ isScratched, isWinner, raceFinished, enableMyBetsBehavior }) =>
isScratched || (enableMyBetsBehavior && raceFinished && !isWinner)
? 0.4
: 1};
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Saddle/consts.ts
import type { SaddleColors } from "./types";
export const SADDLE_COLORS: SaddleColors = {
thoroughbred: {
"1": { numberColor: "#FFFFFF", saddleColor: "#C20E0E" },
"2": { numberColor: "#000000", saddleColor: "#BCC8C8" },
"3": { numberColor: "#FFFFFF", saddleColor: "#3B4E8C" },
"4": { numberColor: "#000000", saddleColor: "#D3B13C" },
"5": { numberColor: "#FFFFFF", saddleColor: "#116410" },
"6": { numberColor: "#FFFFFF", saddleColor: "#303030" },
"7": { numberColor: "#000000", saddleColor: "#D65A2F" },
"8": { numberColor: "#000000", saddleColor: "#E095AA" },
"9": { numberColor: "#000000", saddleColor: "#2AAAA5" },
"10": { numberColor: "#FFFFFF", saddleColor: "#713A98" },
"11": { numberColor: "#FFFFFF", saddleColor: "#6B6B6B" },
"12": { numberColor: "#000000", saddleColor: "#4EA958" },
"13": { numberColor: "#FFFFFF", saddleColor: "#58514D" },
"14": { numberColor: "#FFFFFF", saddleColor: "#94335A" },
"15": { numberColor: "#FFFFFF", saddleColor: "#69522F" },
"16": { numberColor: "#FFFFFF", saddleColor: "#4C6E9F" },
"17": { numberColor: "#FFFFFF", saddleColor: "#373786" },
"18": { numberColor: "#FFFFFF", saddleColor: "#285F23" },
"19": { numberColor: "#FFFFFF", saddleColor: "#32496D" },
"20": { numberColor: "#FFFFFF", saddleColor: "#671334" }
},
harness: {
"1": { numberColor: "#FFFFFF", saddleColor: "#AF0000" },
"2": { numberColor: "#FFFFFF", saddleColor: "#253C85" },
"3": { numberColor: "#000000", saddleColor: "#B2B4B1" },
"4": { numberColor: "#FFFFFF", saddleColor: "#1C5B1B" },
"5": { numberColor: "#FFFFFF", saddleColor: "#252525" },
"6": { numberColor: "#000000", saddleColor: "#B69E00" },
"7": { numberColor: "#000000", saddleColor: "#B27492" },
"8": { numberColor: "#FFFFFF", saddleColor: "#6B6B6B" },
"9": { numberColor: "#FFFFFF", saddleColor: "#610F9A" },
"10": { numberColor: "#FFFFFF", saddleColor: "#263D88" },
"11": { numberColor: "#FFFFFF", saddleColor: "#3B5E90" },
"12": { numberColor: "#FFFFFF", saddleColor: "#A90000" },
"13": { numberColor: "#FFFFFF", saddleColor: "#1D5E1C" },
"14": { numberColor: "#FFFFFF", saddleColor: "#725933" },
"15": { numberColor: "#FFFFFF", saddleColor: "#C0C0C0" }
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Saddle/index.tsx
import React, { FC, memo } from "react";
import { get } from "lodash";
import { Icon } from "../Icon";
import {
StyledSaddle,
StyledParagraph,
DiagonalLine
} from "./styled-components";
import {
SaddleProps,
Breed,
HarnessVariation,
ThoroughbredVariation,
SaddleColor
} from "./types";
import { SADDLE_COLORS } from "./consts";
const getRunnerColors = (
runnerNumber: number | string,
breed: Breed = "thoroughbred"
): SaddleColor => {
const runnerNumberInt =
typeof runnerNumber === "string"
? parseInt(runnerNumber, 10)
: runnerNumber;
const breedFilter = get(SADDLE_COLORS, `[${breed}]`) ? breed : "thoroughbred";
const { numberColor, saddleColor } = get(
SADDLE_COLORS,
`[${breedFilter}][${runnerNumberInt}]`,
get(
SADDLE_COLORS,
breedFilter === "harness"
? `[${breedFilter}][15]`
: `[${breedFilter}][20]`
)
);
return {
numberColor,
saddleColor
};
};
export const Saddle: FC<SaddleProps> = memo(
({
all,
number,
qaLabel,
numberColor,
saddleColor,
fullHeight,
size,
isWinner = false,
breed = "thoroughbred",
isScratched = false,
raceFinished = false,
enableMyBetsBehavior = false,
showAlternateIcon = false,
...rest
}) => {
const saddleNumber =
typeof number === "number" ? number.toString() : number;
const defaultColors = getRunnerColors(number, breed);
const runnerColors: SaddleColor = {
numberColor: numberColor || defaultColors.numberColor,
saddleColor: saddleColor || defaultColors.saddleColor
};
return (
<StyledSaddle
data-qa-label={qaLabel || `saddle-container-${number}`}
all={all}
saddleColor={all ? "#C6D3E1" : runnerColors.saddleColor}
fullHeight={fullHeight}
size={size}
isScratched={isScratched}
raceFinished={raceFinished}
enableMyBetsBehavior={enableMyBetsBehavior}
isWinner={isWinner}
showAlternateIcon={showAlternateIcon}
{...rest}
>
{isScratched && size === "s" && enableMyBetsBehavior && (
<DiagonalLine />
)}
{showAlternateIcon && (
<Icon
name="doubleChevronLeftRight"
color="--fd-colors-content-on-dark"
backgroundColor="--fd-colors-content-on-dark"
size="s"
lineColor="--fd-colors-content-on-light"
/>
)}
<StyledParagraph
fontFamily="bold"
fontSize="s"
color={all ? "#0A0A0A" : runnerColors.numberColor}
textTransform={all ? "capitalize" : "none"}
qaLabel="saddle-number"
size={size}
isScratched={isScratched}
isWinner={isWinner}
raceFinished={raceFinished}
enableMyBetsBehavior={enableMyBetsBehavior}
>
{all ? saddleNumber.toLowerCase() : saddleNumber}
</StyledParagraph>
</StyledSaddle>
);
}
);
export default Saddle;
export { SADDLE_COLORS, getRunnerColors };
export type { SaddleProps, Breed, HarnessVariation, ThoroughbredVariation };
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/redux/selector/account/index.ts
import type { Store } from "redux";
import { get } from "lodash";
const reducerRootSelector = "unifiedModules.Account";
export const getAccountModalOpened = (store: Store) =>
get(store, `${reducerRootSelector}.isOpened`, false);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Typography/Header/styled-components.ts
import { createElement } from "react";
import styled from "styled-components";
import {
space,
system,
compose,
fontFamily,
fontSize,
flex,
layout,
typography,
variant,
color
} from "styled-system";
import { HeaderProps } from "./types";
const systemProps = system({
textTransform: {
property: "textTransform"
},
whiteSpace: {
property: "whiteSpace"
},
textOverflow: {
property: "textOverflow"
}
});
const styles = compose(
color,
space,
systemProps,
typography,
fontFamily,
fontSize,
layout,
variant({
prop: "tag",
scale: "headingSizes"
})
);
export const StyledHeader = styled(
({ tag, gap, textOverflow, whiteSpace, accessibilityLevel, ...props }) =>
createElement(tag || "p", props)
).attrs<HeaderProps>(({ tag, textOverflow }) => ({
accessibilityLevel: tag && tag.replace("h", ""),
overflow: textOverflow === "ellipsis" ? "hidden" : "visible"
}))<HeaderProps>`
${styles}
${flex}
${({ gap }) => gap && `gap: ${gap};`} /* Conditionally apply gap */
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Typography/Header/index.tsx
import React, { FC, memo } from "react";
import { StyledHeader } from "./styled-components";
import type { HeaderProps } from "./types";
import { getColor } from "../utils";
export const Header: FC<HeaderProps> = memo(
({
children,
fontFamily = "medium",
textOverflow = "clip",
whiteSpace = "normal",
color = "--fd-colors-content-default",
tag = "h1",
qaLabel = "header",
...rest
}) => {
const selectedColor = getColor(color);
return (
<StyledHeader
role="heading"
fontFamily={fontFamily}
color={selectedColor}
tag={tag}
textOverflow={textOverflow}
whiteSpace={whiteSpace}
data-qa-label={qaLabel}
{...rest}
>
{children}
</StyledHeader>
);
}
);
export type { HeaderProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/PageHeader/components/styled-components.ts
import styled from "styled-components"; export const Button = styled.button` background-color: transparent; border: none; cursor: pointer; height: 20px; margin: 0; padding: 0; width: 20px; `;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/PageHeader/components/BackButton/index.tsx
import React from "react";
import { Icon } from "../../../Icon";
import { Button } from "../styled-components";
import type { BackButtonProps } from "./types";
export const BackButton = ({ onBack, ...rest }: BackButtonProps) => (
<Button onClick={onBack} {...rest}>
<Icon size="m" lineColor="--fd-colors-content-default" name="arrowLeft" />
</Button>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/PageHeader/components/CloseButton/index.tsx
import React from "react";
import { Icon } from "../../../Icon";
import { Button } from "../styled-components";
import type { CloseButtonProps } from "./types";
export const CloseButton = ({ onClose, ...rest }: CloseButtonProps) => (
<Button onClick={onClose} {...rest}>
<Icon size="m" lineColor="--fd-colors-content-default" name="close" />
</Button>
);
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/PageHeader/styled-components.ts
import styled from "styled-components";
import { space } from "styled-system";
import type { PageHeaderSize } from "./types";
const paddingMap = {
small: "12px",
medium: "20px 16px"
};
export const HeaderContainer = styled.div<{ size: PageHeaderSize }>`
background-color: var(--fd-colors-background-surface);
border-bottom: 1px solid var(--fd-colors-border-subtle);
border-radius: 4px 4px 0 0;
display: flex;
flex-direction: row;
gap: 16px;
height: max-content;
justify-content: space-between;
padding: ${({ size }) => paddingMap[size as PageHeaderSize]};
${space}
`;
export const HeaderSection = styled.div`
align-items: center;
display: flex;
flex-direction: column;
gap: 4px;
justify-content: flex-start;
width: 80%;
`;
export const Wrapper = styled.div`
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
height: max-content;
align-items: center;
gap: 8px;
`;
export const ActionContainer = styled.div`
width: 20px;
height: 20px;
min-width: 20px;
max-height: 20px;
`;
export const LinkWrapper = styled.div`
display: flex;
flex-direction: row;
gap: 4px;
justify-content: center;
width: max-content;
`;
export const Link = styled.a`
color: var(--fd-colors-link-default-base);
cursor: pointer;
font-family: "Roboto-Regular", sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 125%;
text-align: center;
text-decoration: none;
&:hover {
color: var(--fd-colors-link-default-hover);
}
&:active {
color: var(--fd-colors-link-default-hover);
}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/PageHeader/index.tsx
import React, { type FC } from "react";
import { Header, Paragraph } from "../Typography";
import { Icon } from "../Icon";
import { BackButton } from "./components/BackButton";
import { CloseButton } from "./components/CloseButton";
import {
HeaderContainer,
HeaderSection,
ActionContainer,
Wrapper,
LinkWrapper,
Link
} from "./styled-components";
import type { PageHeaderProps, PageHeaderSize } from "./types";
export const PageHeader: FC<PageHeaderProps> = ({
title,
description,
showBackButton = false,
showCloseButton = false,
onBack,
onClose,
linkLabel = "Link",
linkUrl,
showLink = false,
qaLabel = "page-header",
saddle,
size = "medium",
...rest
}) => (
<HeaderContainer data-qa-label={qaLabel} size={size} {...rest}>
<ActionContainer>
{showBackButton && (
<BackButton data-qa-label={`${qaLabel}-back-button`} onBack={onBack} />
)}
</ActionContainer>
<HeaderSection>
<Wrapper>
{saddle}
<Header
p={0}
m={0}
tag="h3"
color="--fd-colors-content-strong"
fontSize={18}
textAlign="center"
width="max-content"
data-qa-label={`${qaLabel}-title`}
>
{title}
</Header>
</Wrapper>
{description && !showLink && (
<Paragraph
p={0}
m={0}
fontFamily="regular"
color="--fd-colors-content-subtle"
fontSize={14}
lineHeight="125%"
textAlign="center"
width="max-content"
data-qa-label={`${qaLabel}-description`}
>
{description}
</Paragraph>
)}
{showLink && (
<LinkWrapper>
<Icon
size="s"
lineColor="--fd-colors-system-info-content-accent"
backgroundColor="--fd-colors-system-info-background-subtle"
name="info"
data-qa-label={`${qaLabel}-icon-info`}
/>
<Link href={linkUrl} data-qa-label={`${qaLabel}-link`}>
{linkLabel}
</Link>
</LinkWrapper>
)}
</HeaderSection>
<ActionContainer>
{showCloseButton && (
<CloseButton
data-qa-label={`${qaLabel}-close-button`}
onClose={onClose}
/>
)}
</ActionContainer>
</HeaderContainer>
);
export type { PageHeaderProps, PageHeaderSize };
webpack://frontend-tpt/../../node_modules/@react-spring/core/node_modules/@react-spring/rafz/dist/react-spring_rafz.modern.mjs
// src/index.ts
var updateQueue = makeQueue();
var raf = (fn) => schedule(fn, updateQueue);
var writeQueue = makeQueue();
raf.write = (fn) => schedule(fn, writeQueue);
var onStartQueue = makeQueue();
raf.onStart = (fn) => schedule(fn, onStartQueue);
var onFrameQueue = makeQueue();
raf.onFrame = (fn) => schedule(fn, onFrameQueue);
var onFinishQueue = makeQueue();
raf.onFinish = (fn) => schedule(fn, onFinishQueue);
var timeouts = [];
raf.setTimeout = (handler, ms) => {
const time = raf.now() + ms;
const cancel = () => {
const i = timeouts.findIndex((t) => t.cancel == cancel);
if (~i)
timeouts.splice(i, 1);
pendingCount -= ~i ? 1 : 0;
};
const timeout = { time, handler, cancel };
timeouts.splice(findTimeout(time), 0, timeout);
pendingCount += 1;
start();
return timeout;
};
var findTimeout = (time) => ~(~timeouts.findIndex((t) => t.time > time) || ~timeouts.length);
raf.cancel = (fn) => {
onStartQueue.delete(fn);
onFrameQueue.delete(fn);
onFinishQueue.delete(fn);
updateQueue.delete(fn);
writeQueue.delete(fn);
};
raf.sync = (fn) => {
sync = true;
raf.batchedUpdates(fn);
sync = false;
};
raf.throttle = (fn) => {
let lastArgs;
function queuedFn() {
try {
fn(...lastArgs);
} finally {
lastArgs = null;
}
}
function throttled(...args) {
lastArgs = args;
raf.onStart(queuedFn);
}
throttled.handler = fn;
throttled.cancel = () => {
onStartQueue.delete(queuedFn);
lastArgs = null;
};
return throttled;
};
var nativeRaf = typeof window != "undefined" ? window.requestAnimationFrame : (
// eslint-disable-next-line @typescript-eslint/no-empty-function
() => {
}
);
raf.use = (impl) => nativeRaf = impl;
raf.now = typeof performance != "undefined" ? () => performance.now() : Date.now;
raf.batchedUpdates = (fn) => fn();
raf.catch = console.error;
raf.frameLoop = "always";
raf.advance = () => {
if (raf.frameLoop !== "demand") {
console.warn(
"Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"
);
} else {
update();
}
};
var ts = -1;
var pendingCount = 0;
var sync = false;
function schedule(fn, queue) {
if (sync) {
queue.delete(fn);
fn(0);
} else {
queue.add(fn);
start();
}
}
function start() {
if (ts < 0) {
ts = 0;
if (raf.frameLoop !== "demand") {
nativeRaf(loop);
}
}
}
function stop() {
ts = -1;
}
function loop() {
if (~ts) {
nativeRaf(loop);
raf.batchedUpdates(update);
}
}
function update() {
const prevTs = ts;
ts = raf.now();
const count = findTimeout(ts);
if (count) {
eachSafely(timeouts.splice(0, count), (t) => t.handler());
pendingCount -= count;
}
if (!pendingCount) {
stop();
return;
}
onStartQueue.flush();
updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667);
onFrameQueue.flush();
writeQueue.flush();
onFinishQueue.flush();
}
function makeQueue() {
let next = /* @__PURE__ */ new Set();
let current = next;
return {
add(fn) {
pendingCount += current == next && !next.has(fn) ? 1 : 0;
next.add(fn);
},
delete(fn) {
pendingCount -= current == next && next.has(fn) ? 1 : 0;
return next.delete(fn);
},
flush(arg) {
if (current.size) {
next = /* @__PURE__ */ new Set();
pendingCount -= current.size;
eachSafely(current, (fn) => fn(arg) && next.add(fn));
pendingCount += next.size;
current = next;
}
}
};
}
function eachSafely(values, each) {
values.forEach((value) => {
try {
each(value);
} catch (e) {
raf.catch(e);
}
});
}
var __raf = {
/** The number of pending tasks */
count() {
return pendingCount;
},
/** Whether there's a raf update loop running */
isRunning() {
return ts >= 0;
},
/** Clear internal state. Never call from update loop! */
clear() {
ts = -1;
timeouts = [];
onStartQueue = makeQueue();
updateQueue = makeQueue();
onFrameQueue = makeQueue();
writeQueue = makeQueue();
onFinishQueue = makeQueue();
pendingCount = 0;
}
};
export {
__raf,
raf
};
//# sourceMappingURL=react-spring_rafz.modern.mjs.map
webpack://frontend-tpt/../../node_modules/@react-spring/core/node_modules/@react-spring/shared/dist/react-spring_shared.modern.mjs
var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
// src/globals.ts
var globals_exports = {};
__export(globals_exports, {
assign: () => assign,
colors: () => colors,
createStringInterpolator: () => createStringInterpolator,
skipAnimation: () => skipAnimation,
to: () => to,
willAdvance: () => willAdvance
});
import { raf } from "@react-spring/rafz";
// src/helpers.ts
function noop() {
}
var defineHidden = (obj, key, value) => Object.defineProperty(obj, key, { value, writable: true, configurable: true });
var is = {
arr: Array.isArray,
obj: (a) => !!a && a.constructor.name === "Object",
fun: (a) => typeof a === "function",
str: (a) => typeof a === "string",
num: (a) => typeof a === "number",
und: (a) => a === void 0
};
function isEqual(a, b) {
if (is.arr(a)) {
if (!is.arr(b) || a.length !== b.length)
return false;
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i])
return false;
}
return true;
}
return a === b;
}
var each = (obj, fn) => obj.forEach(fn);
function eachProp(obj, fn, ctx) {
if (is.arr(obj)) {
for (let i = 0; i < obj.length; i++) {
fn.call(ctx, obj[i], `${i}`);
}
return;
}
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
fn.call(ctx, obj[key], key);
}
}
}
var toArray = (a) => is.und(a) ? [] : is.arr(a) ? a : [a];
function flush(queue, iterator) {
if (queue.size) {
const items = Array.from(queue);
queue.clear();
each(items, iterator);
}
}
var flushCalls = (queue, ...args) => flush(queue, (fn) => fn(...args));
var isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
// src/globals.ts
var createStringInterpolator;
var to;
var colors = null;
var skipAnimation = false;
var willAdvance = noop;
var assign = (globals) => {
if (globals.to)
to = globals.to;
if (globals.now)
raf.now = globals.now;
if (globals.colors !== void 0)
colors = globals.colors;
if (globals.skipAnimation != null)
skipAnimation = globals.skipAnimation;
if (globals.createStringInterpolator)
createStringInterpolator = globals.createStringInterpolator;
if (globals.requestAnimationFrame)
raf.use(globals.requestAnimationFrame);
if (globals.batchedUpdates)
raf.batchedUpdates = globals.batchedUpdates;
if (globals.willAdvance)
willAdvance = globals.willAdvance;
if (globals.frameLoop)
raf.frameLoop = globals.frameLoop;
};
// src/FrameLoop.ts
import { raf as raf2 } from "@react-spring/rafz";
var startQueue = /* @__PURE__ */ new Set();
var currentFrame = [];
var prevFrame = [];
var priority = 0;
var frameLoop = {
get idle() {
return !startQueue.size && !currentFrame.length;
},
/** Advance the given animation on every frame until idle. */
start(animation) {
if (priority > animation.priority) {
startQueue.add(animation);
raf2.onStart(flushStartQueue);
} else {
startSafely(animation);
raf2(advance);
}
},
/** Advance all animations by the given time. */
advance,
/** Call this when an animation's priority changes. */
sort(animation) {
if (priority) {
raf2.onFrame(() => frameLoop.sort(animation));
} else {
const prevIndex = currentFrame.indexOf(animation);
if (~prevIndex) {
currentFrame.splice(prevIndex, 1);
startUnsafely(animation);
}
}
},
/**
* Clear all animations. For testing purposes.
*
* ☠️ Never call this from within the frameloop.
*/
clear() {
currentFrame = [];
startQueue.clear();
}
};
function flushStartQueue() {
startQueue.forEach(startSafely);
startQueue.clear();
raf2(advance);
}
function startSafely(animation) {
if (!currentFrame.includes(animation))
startUnsafely(animation);
}
function startUnsafely(animation) {
currentFrame.splice(
findIndex(currentFrame, (other) => other.priority > animation.priority),
0,
animation
);
}
function advance(dt) {
const nextFrame = prevFrame;
for (let i = 0; i < currentFrame.length; i++) {
const animation = currentFrame[i];
priority = animation.priority;
if (!animation.idle) {
willAdvance(animation);
animation.advance(dt);
if (!animation.idle) {
nextFrame.push(animation);
}
}
}
priority = 0;
prevFrame = currentFrame;
prevFrame.length = 0;
currentFrame = nextFrame;
return currentFrame.length > 0;
}
function findIndex(arr, test) {
const index = arr.findIndex(test);
return index < 0 ? arr.length : index;
}
// src/clamp.ts
var clamp = (min, max, v) => Math.min(Math.max(v, min), max);
// src/colors.ts
var colors2 = {
transparent: 0,
aliceblue: 4042850303,
antiquewhite: 4209760255,
aqua: 16777215,
aquamarine: 2147472639,
azure: 4043309055,
beige: 4126530815,
bisque: 4293182719,
black: 255,
blanchedalmond: 4293643775,
blue: 65535,
blueviolet: 2318131967,
brown: 2771004159,
burlywood: 3736635391,
burntsienna: 3934150143,
cadetblue: 1604231423,
chartreuse: 2147418367,
chocolate: 3530104575,
coral: 4286533887,
cornflowerblue: 1687547391,
cornsilk: 4294499583,
crimson: 3692313855,
cyan: 16777215,
darkblue: 35839,
darkcyan: 9145343,
darkgoldenrod: 3095792639,
darkgray: 2846468607,
darkgreen: 6553855,
darkgrey: 2846468607,
darkkhaki: 3182914559,
darkmagenta: 2332068863,
darkolivegreen: 1433087999,
darkorange: 4287365375,
darkorchid: 2570243327,
darkred: 2332033279,
darksalmon: 3918953215,
darkseagreen: 2411499519,
darkslateblue: 1211993087,
darkslategray: 793726975,
darkslategrey: 793726975,
darkturquoise: 13554175,
darkviolet: 2483082239,
deeppink: 4279538687,
deepskyblue: 12582911,
dimgray: 1768516095,
dimgrey: 1768516095,
dodgerblue: 512819199,
firebrick: 2988581631,
floralwhite: 4294635775,
forestgreen: 579543807,
fuchsia: 4278255615,
gainsboro: 3705462015,
ghostwhite: 4177068031,
gold: 4292280575,
goldenrod: 3668254975,
gray: 2155905279,
green: 8388863,
greenyellow: 2919182335,
grey: 2155905279,
honeydew: 4043305215,
hotpink: 4285117695,
indianred: 3445382399,
indigo: 1258324735,
ivory: 4294963455,
khaki: 4041641215,
lavender: 3873897215,
lavenderblush: 4293981695,
lawngreen: 2096890111,
lemonchiffon: 4294626815,
lightblue: 2916673279,
lightcoral: 4034953471,
lightcyan: 3774873599,
lightgoldenrodyellow: 4210742015,
lightgray: 3553874943,
lightgreen: 2431553791,
lightgrey: 3553874943,
lightpink: 4290167295,
lightsalmon: 4288707327,
lightseagreen: 548580095,
lightskyblue: 2278488831,
lightslategray: 2005441023,
lightslategrey: 2005441023,
lightsteelblue: 2965692159,
lightyellow: 4294959359,
lime: 16711935,
limegreen: 852308735,
linen: 4210091775,
magenta: 4278255615,
maroon: 2147483903,
mediumaquamarine: 1724754687,
mediumblue: 52735,
mediumorchid: 3126187007,
mediumpurple: 2473647103,
mediumseagreen: 1018393087,
mediumslateblue: 2070474495,
mediumspringgreen: 16423679,
mediumturquoise: 1221709055,
mediumvioletred: 3340076543,
midnightblue: 421097727,
mintcream: 4127193855,
mistyrose: 4293190143,
moccasin: 4293178879,
navajowhite: 4292783615,
navy: 33023,
oldlace: 4260751103,
olive: 2155872511,
olivedrab: 1804477439,
orange: 4289003775,
orangered: 4282712319,
orchid: 3664828159,
palegoldenrod: 4008225535,
palegreen: 2566625535,
paleturquoise: 2951671551,
palevioletred: 3681588223,
papayawhip: 4293907967,
peachpuff: 4292524543,
peru: 3448061951,
pink: 4290825215,
plum: 3718307327,
powderblue: 2967529215,
purple: 2147516671,
rebeccapurple: 1714657791,
red: 4278190335,
rosybrown: 3163525119,
royalblue: 1097458175,
saddlebrown: 2336560127,
salmon: 4202722047,
sandybrown: 4104413439,
seagreen: 780883967,
seashell: 4294307583,
sienna: 2689740287,
silver: 3233857791,
skyblue: 2278484991,
slateblue: 1784335871,
slategray: 1887473919,
slategrey: 1887473919,
snow: 4294638335,
springgreen: 16744447,
steelblue: 1182971135,
tan: 3535047935,
teal: 8421631,
thistle: 3636451583,
tomato: 4284696575,
turquoise: 1088475391,
violet: 4001558271,
wheat: 4125012991,
white: 4294967295,
whitesmoke: 4126537215,
yellow: 4294902015,
yellowgreen: 2597139199
};
// src/colorMatchers.ts
var NUMBER = "[-+]?\\d*\\.?\\d+";
var PERCENTAGE = NUMBER + "%";
function call(...parts) {
return "\\(\\s*(" + parts.join(")\\s*,\\s*(") + ")\\s*\\)";
}
var rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
var rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
var hsl = new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE));
var hsla = new RegExp(
"hsla" + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)
);
var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
var hex6 = /^#([0-9a-fA-F]{6})$/;
var hex8 = /^#([0-9a-fA-F]{8})$/;
// src/normalizeColor.ts
function normalizeColor(color) {
let match;
if (typeof color === "number") {
return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null;
}
if (match = hex6.exec(color))
return parseInt(match[1] + "ff", 16) >>> 0;
if (colors && colors[color] !== void 0) {
return colors[color];
}
if (match = rgb.exec(color)) {
return (parse255(match[1]) << 24 | // r
parse255(match[2]) << 16 | // g
parse255(match[3]) << 8 | // b
255) >>> // a
0;
}
if (match = rgba.exec(color)) {
return (parse255(match[1]) << 24 | // r
parse255(match[2]) << 16 | // g
parse255(match[3]) << 8 | // b
parse1(match[4])) >>> // a
0;
}
if (match = hex3.exec(color)) {
return parseInt(
match[1] + match[1] + // r
match[2] + match[2] + // g
match[3] + match[3] + // b
"ff",
// a
16
) >>> 0;
}
if (match = hex8.exec(color))
return parseInt(match[1], 16) >>> 0;
if (match = hex4.exec(color)) {
return parseInt(
match[1] + match[1] + // r
match[2] + match[2] + // g
match[3] + match[3] + // b
match[4] + match[4],
// a
16
) >>> 0;
}
if (match = hsl.exec(color)) {
return (hslToRgb(
parse360(match[1]),
// h
parsePercentage(match[2]),
// s
parsePercentage(match[3])
// l
) | 255) >>> // a
0;
}
if (match = hsla.exec(color)) {
return (hslToRgb(
parse360(match[1]),
// h
parsePercentage(match[2]),
// s
parsePercentage(match[3])
// l
) | parse1(match[4])) >>> // a
0;
}
return null;
}
function hue2rgb(p, q, t) {
if (t < 0)
t += 1;
if (t > 1)
t -= 1;
if (t < 1 / 6)
return p + (q - p) * 6 * t;
if (t < 1 / 2)
return q;
if (t < 2 / 3)
return p + (q - p) * (2 / 3 - t) * 6;
return p;
}
function hslToRgb(h, s, l) {
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
const p = 2 * l - q;
const r = hue2rgb(p, q, h + 1 / 3);
const g = hue2rgb(p, q, h);
const b = hue2rgb(p, q, h - 1 / 3);
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
}
function parse255(str) {
const int = parseInt(str, 10);
if (int < 0)
return 0;
if (int > 255)
return 255;
return int;
}
function parse360(str) {
const int = parseFloat(str);
return (int % 360 + 360) % 360 / 360;
}
function parse1(str) {
const num = parseFloat(str);
if (num < 0)
return 0;
if (num > 1)
return 255;
return Math.round(num * 255);
}
function parsePercentage(str) {
const int = parseFloat(str);
if (int < 0)
return 0;
if (int > 100)
return 1;
return int / 100;
}
// src/colorToRgba.ts
function colorToRgba(input) {
let int32Color = normalizeColor(input);
if (int32Color === null)
return input;
int32Color = int32Color || 0;
const r = (int32Color & 4278190080) >>> 24;
const g = (int32Color & 16711680) >>> 16;
const b = (int32Color & 65280) >>> 8;
const a = (int32Color & 255) / 255;
return `rgba(${r}, ${g}, ${b}, ${a})`;
}
// src/createInterpolator.ts
var createInterpolator = (range, output, extrapolate) => {
if (is.fun(range)) {
return range;
}
if (is.arr(range)) {
return createInterpolator({
range,
output,
extrapolate
});
}
if (is.str(range.output[0])) {
return createStringInterpolator(range);
}
const config = range;
const outputRange = config.output;
const inputRange = config.range || [0, 1];
const extrapolateLeft = config.extrapolateLeft || config.extrapolate || "extend";
const extrapolateRight = config.extrapolateRight || config.extrapolate || "extend";
const easing = config.easing || ((t) => t);
return (input) => {
const range2 = findRange(input, inputRange);
return interpolate(
input,
inputRange[range2],
inputRange[range2 + 1],
outputRange[range2],
outputRange[range2 + 1],
easing,
extrapolateLeft,
extrapolateRight,
config.map
);
};
};
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
let result = map ? map(input) : input;
if (result < inputMin) {
if (extrapolateLeft === "identity")
return result;
else if (extrapolateLeft === "clamp")
result = inputMin;
}
if (result > inputMax) {
if (extrapolateRight === "identity")
return result;
else if (extrapolateRight === "clamp")
result = inputMax;
}
if (outputMin === outputMax)
return outputMin;
if (inputMin === inputMax)
return input <= inputMin ? outputMin : outputMax;
if (inputMin === -Infinity)
result = -result;
else if (inputMax === Infinity)
result = result - inputMin;
else
result = (result - inputMin) / (inputMax - inputMin);
result = easing(result);
if (outputMin === -Infinity)
result = -result;
else if (outputMax === Infinity)
result = result + outputMin;
else
result = result * (outputMax - outputMin) + outputMin;
return result;
}
function findRange(input, inputRange) {
for (var i = 1; i < inputRange.length - 1; ++i)
if (inputRange[i] >= input)
break;
return i - 1;
}
// src/easings.ts
var steps = (steps2, direction = "end") => (progress2) => {
progress2 = direction === "end" ? Math.min(progress2, 0.999) : Math.max(progress2, 1e-3);
const expanded = progress2 * steps2;
const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded);
return clamp(0, 1, rounded / steps2);
};
var c1 = 1.70158;
var c2 = c1 * 1.525;
var c3 = c1 + 1;
var c4 = 2 * Math.PI / 3;
var c5 = 2 * Math.PI / 4.5;
var bounceOut = (x) => {
const n1 = 7.5625;
const d1 = 2.75;
if (x < 1 / d1) {
return n1 * x * x;
} else if (x < 2 / d1) {
return n1 * (x -= 1.5 / d1) * x + 0.75;
} else if (x < 2.5 / d1) {
return n1 * (x -= 2.25 / d1) * x + 0.9375;
} else {
return n1 * (x -= 2.625 / d1) * x + 0.984375;
}
};
var easings = {
linear: (x) => x,
easeInQuad: (x) => x * x,
easeOutQuad: (x) => 1 - (1 - x) * (1 - x),
easeInOutQuad: (x) => x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2,
easeInCubic: (x) => x * x * x,
easeOutCubic: (x) => 1 - Math.pow(1 - x, 3),
easeInOutCubic: (x) => x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2,
easeInQuart: (x) => x * x * x * x,
easeOutQuart: (x) => 1 - Math.pow(1 - x, 4),
easeInOutQuart: (x) => x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2,
easeInQuint: (x) => x * x * x * x * x,
easeOutQuint: (x) => 1 - Math.pow(1 - x, 5),
easeInOutQuint: (x) => x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2,
easeInSine: (x) => 1 - Math.cos(x * Math.PI / 2),
easeOutSine: (x) => Math.sin(x * Math.PI / 2),
easeInOutSine: (x) => -(Math.cos(Math.PI * x) - 1) / 2,
easeInExpo: (x) => x === 0 ? 0 : Math.pow(2, 10 * x - 10),
easeOutExpo: (x) => x === 1 ? 1 : 1 - Math.pow(2, -10 * x),
easeInOutExpo: (x) => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2,
easeInCirc: (x) => 1 - Math.sqrt(1 - Math.pow(x, 2)),
easeOutCirc: (x) => Math.sqrt(1 - Math.pow(x - 1, 2)),
easeInOutCirc: (x) => x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2,
easeInBack: (x) => c3 * x * x * x - c1 * x * x,
easeOutBack: (x) => 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2),
easeInOutBack: (x) => x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2,
easeInElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4),
easeOutElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1,
easeInOutElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1,
easeInBounce: (x) => 1 - bounceOut(1 - x),
easeOutBounce: bounceOut,
easeInOutBounce: (x) => x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2,
steps
};
// src/fluids.ts
var $get = Symbol.for("FluidValue.get");
var $observers = Symbol.for("FluidValue.observers");
var hasFluidValue = (arg) => Boolean(arg && arg[$get]);
var getFluidValue = (arg) => arg && arg[$get] ? arg[$get]() : arg;
var getFluidObservers = (target) => target[$observers] || null;
function callFluidObserver(observer2, event) {
if (observer2.eventObserved) {
observer2.eventObserved(event);
} else {
observer2(event);
}
}
function callFluidObservers(target, event) {
const observers = target[$observers];
if (observers) {
observers.forEach((observer2) => {
callFluidObserver(observer2, event);
});
}
}
var FluidValue = class {
constructor(get) {
if (!get && !(get = this.get)) {
throw Error("Unknown getter");
}
setFluidGetter(this, get);
}
};
$get, $observers;
var setFluidGetter = (target, get) => setHidden(target, $get, get);
function addFluidObserver(target, observer2) {
if (target[$get]) {
let observers = target[$observers];
if (!observers) {
setHidden(target, $observers, observers = /* @__PURE__ */ new Set());
}
if (!observers.has(observer2)) {
observers.add(observer2);
if (target.observerAdded) {
target.observerAdded(observers.size, observer2);
}
}
}
return observer2;
}
function removeFluidObserver(target, observer2) {
const observers = target[$observers];
if (observers && observers.has(observer2)) {
const count = observers.size - 1;
if (count) {
observers.delete(observer2);
} else {
target[$observers] = null;
}
if (target.observerRemoved) {
target.observerRemoved(count, observer2);
}
}
}
var setHidden = (target, key, value) => Object.defineProperty(target, key, {
value,
writable: true,
configurable: true
});
// src/regexs.ts
var numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;
var unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, "i");
var rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;
var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
// src/variableToRgba.ts
var variableToRgba = (input) => {
const [token, fallback] = parseCSSVariable(input);
if (!token || isSSR()) {
return input;
}
const value = window.getComputedStyle(document.documentElement).getPropertyValue(token);
if (value) {
return value.trim();
} else if (fallback && fallback.startsWith("--")) {
const value2 = window.getComputedStyle(document.documentElement).getPropertyValue(fallback);
if (value2) {
return value2;
} else {
return input;
}
} else if (fallback && cssVariableRegex.test(fallback)) {
return variableToRgba(fallback);
} else if (fallback) {
return fallback;
}
return input;
};
var parseCSSVariable = (current) => {
const match = cssVariableRegex.exec(current);
if (!match)
return [,];
const [, token, fallback] = match;
return [token, fallback];
};
// src/stringInterpolation.ts
var namedColorRegex;
var rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`;
var createStringInterpolator2 = (config) => {
if (!namedColorRegex)
namedColorRegex = colors ? (
// match color names, ignore partial matches
new RegExp(`(${Object.keys(colors).join("|")})(?!\\w)`, "g")
) : (
// never match
/^\b$/
);
const output = config.output.map((value) => {
return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba);
});
const keyframes = output.map((value) => value.match(numberRegex).map(Number));
const outputRanges = keyframes[0].map(
(_, i) => keyframes.map((values) => {
if (!(i in values)) {
throw Error('The arity of each "output" value must be equal');
}
return values[i];
})
);
const interpolators = outputRanges.map(
(output2) => createInterpolator({ ...config, output: output2 })
);
return (input) => {
const missingUnit = !unitRegex.test(output[0]) && output.find((value) => unitRegex.test(value))?.replace(numberRegex, "");
let i = 0;
return output[0].replace(
numberRegex,
() => `${interpolators[i++](input)}${missingUnit || ""}`
).replace(rgbaRegex, rgbaRound);
};
};
// src/deprecations.ts
var prefix = "react-spring: ";
var once = (fn) => {
const func = fn;
let called = false;
if (typeof func != "function") {
throw new TypeError(`${prefix}once requires a function parameter`);
}
return (...args) => {
if (!called) {
func(...args);
called = true;
}
};
};
var warnInterpolate = once(console.warn);
function deprecateInterpolate() {
warnInterpolate(
`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`
);
}
var warnDirectCall = once(console.warn);
function deprecateDirectCall() {
warnDirectCall(
`${prefix}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`
);
}
// src/isAnimatedString.ts
function isAnimatedString(value) {
return is.str(value) && (value[0] == "#" || /\d/.test(value) || // Do not identify a CSS variable as an AnimatedString if its SSR
!isSSR() && cssVariableRegex.test(value) || value in (colors || {}));
}
// src/dom-events/scroll/index.ts
import { raf as raf3 } from "@react-spring/rafz";
// src/dom-events/resize/resizeElement.ts
var observer;
var resizeHandlers = /* @__PURE__ */ new WeakMap();
var handleObservation = (entries) => entries.forEach(({ target, contentRect }) => {
return resizeHandlers.get(target)?.forEach((handler) => handler(contentRect));
});
function resizeElement(handler, target) {
if (!observer) {
if (typeof ResizeObserver !== "undefined") {
observer = new ResizeObserver(handleObservation);
}
}
let elementHandlers = resizeHandlers.get(target);
if (!elementHandlers) {
elementHandlers = /* @__PURE__ */ new Set();
resizeHandlers.set(target, elementHandlers);
}
elementHandlers.add(handler);
if (observer) {
observer.observe(target);
}
return () => {
const elementHandlers2 = resizeHandlers.get(target);
if (!elementHandlers2)
return;
elementHandlers2.delete(handler);
if (!elementHandlers2.size && observer) {
observer.unobserve(target);
}
};
}
// src/dom-events/resize/resizeWindow.ts
var listeners = /* @__PURE__ */ new Set();
var cleanupWindowResizeHandler;
var createResizeHandler = () => {
const handleResize = () => {
listeners.forEach(
(callback) => callback({
width: window.innerWidth,
height: window.innerHeight
})
);
};
window.addEventListener("resize", handleResize);
return () => {
window.removeEventListener("resize", handleResize);
};
};
var resizeWindow = (callback) => {
listeners.add(callback);
if (!cleanupWindowResizeHandler) {
cleanupWindowResizeHandler = createResizeHandler();
}
return () => {
listeners.delete(callback);
if (!listeners.size && cleanupWindowResizeHandler) {
cleanupWindowResizeHandler();
cleanupWindowResizeHandler = void 0;
}
};
};
// src/dom-events/resize/index.ts
var onResize = (callback, { container = document.documentElement } = {}) => {
if (container === document.documentElement) {
return resizeWindow(callback);
} else {
return resizeElement(callback, container);
}
};
// src/progress.ts
var progress = (min, max, value) => max - min === 0 ? 1 : (value - min) / (max - min);
// src/dom-events/scroll/ScrollHandler.ts
var SCROLL_KEYS = {
x: {
length: "Width",
position: "Left"
},
y: {
length: "Height",
position: "Top"
}
};
var ScrollHandler = class {
constructor(callback, container) {
this.createAxis = () => ({
current: 0,
progress: 0,
scrollLength: 0
});
this.updateAxis = (axisName) => {
const axis = this.info[axisName];
const { length, position } = SCROLL_KEYS[axisName];
axis.current = this.container[`scroll${position}`];
axis.scrollLength = this.container[`scroll${length}`] - this.container[`client${length}`];
axis.progress = progress(0, axis.scrollLength, axis.current);
};
this.update = () => {
this.updateAxis("x");
this.updateAxis("y");
};
this.sendEvent = () => {
this.callback(this.info);
};
this.advance = () => {
this.update();
this.sendEvent();
};
this.callback = callback;
this.container = container;
this.info = {
time: 0,
x: this.createAxis(),
y: this.createAxis()
};
}
};
// src/dom-events/scroll/index.ts
var scrollListeners = /* @__PURE__ */ new WeakMap();
var resizeListeners = /* @__PURE__ */ new WeakMap();
var onScrollHandlers = /* @__PURE__ */ new WeakMap();
var getTarget = (container) => container === document.documentElement ? window : container;
var onScroll = (callback, { container = document.documentElement } = {}) => {
let containerHandlers = onScrollHandlers.get(container);
if (!containerHandlers) {
containerHandlers = /* @__PURE__ */ new Set();
onScrollHandlers.set(container, containerHandlers);
}
const containerHandler = new ScrollHandler(callback, container);
containerHandlers.add(containerHandler);
if (!scrollListeners.has(container)) {
const listener = () => {
containerHandlers?.forEach((handler) => handler.advance());
return true;
};
scrollListeners.set(container, listener);
const target = getTarget(container);
window.addEventListener("resize", listener, { passive: true });
if (container !== document.documentElement) {
resizeListeners.set(container, onResize(listener, { container }));
}
target.addEventListener("scroll", listener, { passive: true });
}
const animateScroll = scrollListeners.get(container);
raf3(animateScroll);
return () => {
raf3.cancel(animateScroll);
const containerHandlers2 = onScrollHandlers.get(container);
if (!containerHandlers2)
return;
containerHandlers2.delete(containerHandler);
if (containerHandlers2.size)
return;
const listener = scrollListeners.get(container);
scrollListeners.delete(container);
if (listener) {
getTarget(container).removeEventListener("scroll", listener);
window.removeEventListener("resize", listener);
resizeListeners.get(container)?.();
}
};
};
// src/hooks/useConstant.ts
import { useRef } from "react";
function useConstant(init) {
const ref = useRef(null);
if (ref.current === null) {
ref.current = init();
}
return ref.current;
}
// src/hooks/useForceUpdate.ts
import { useState } from "react";
// src/hooks/useIsMounted.ts
import { useRef as useRef2 } from "react";
// src/hooks/useIsomorphicLayoutEffect.ts
import { useEffect, useLayoutEffect } from "react";
var useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
// src/hooks/useIsMounted.ts
var useIsMounted = () => {
const isMounted = useRef2(false);
useIsomorphicLayoutEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
return isMounted;
};
// src/hooks/useForceUpdate.ts
function useForceUpdate() {
const update = useState()[1];
const isMounted = useIsMounted();
return () => {
if (isMounted.current) {
update(Math.random());
}
};
}
// src/hooks/useMemoOne.ts
import { useEffect as useEffect2, useRef as useRef3, useState as useState2 } from "react";
function useMemoOne(getResult, inputs) {
const [initial] = useState2(
() => ({
inputs,
result: getResult()
})
);
const committed = useRef3();
const prevCache = committed.current;
let cache = prevCache;
if (cache) {
const useCache = Boolean(
inputs && cache.inputs && areInputsEqual(inputs, cache.inputs)
);
if (!useCache) {
cache = {
inputs,
result: getResult()
};
}
} else {
cache = initial;
}
useEffect2(() => {
committed.current = cache;
if (prevCache == initial) {
initial.inputs = initial.result = void 0;
}
}, [cache]);
return cache.result;
}
function areInputsEqual(next, prev) {
if (next.length !== prev.length) {
return false;
}
for (let i = 0; i < next.length; i++) {
if (next[i] !== prev[i]) {
return false;
}
}
return true;
}
// src/hooks/useOnce.ts
import { useEffect as useEffect3 } from "react";
var useOnce = (effect) => useEffect3(effect, emptyDeps);
var emptyDeps = [];
// src/hooks/usePrev.ts
import { useEffect as useEffect4, useRef as useRef4 } from "react";
function usePrev(value) {
const prevRef = useRef4();
useEffect4(() => {
prevRef.current = value;
});
return prevRef.current;
}
// src/hooks/useReducedMotion.ts
import { useState as useState3 } from "react";
var useReducedMotion = () => {
const [reducedMotion, setReducedMotion] = useState3(null);
useIsomorphicLayoutEffect(() => {
const mql = window.matchMedia("(prefers-reduced-motion)");
const handleMediaChange = (e) => {
setReducedMotion(e.matches);
assign({
skipAnimation: e.matches
});
};
handleMediaChange(mql);
if (mql.addEventListener) {
mql.addEventListener("change", handleMediaChange);
} else {
mql.addListener(handleMediaChange);
}
return () => {
if (mql.removeEventListener) {
mql.removeEventListener("change", handleMediaChange);
} else {
mql.removeListener(handleMediaChange);
}
};
}, []);
return reducedMotion;
};
// src/index.ts
import { raf as raf4 } from "@react-spring/rafz";
export {
FluidValue,
globals_exports as Globals,
addFluidObserver,
callFluidObserver,
callFluidObservers,
clamp,
colorToRgba,
colors2 as colors,
createInterpolator,
createStringInterpolator2 as createStringInterpolator,
defineHidden,
deprecateDirectCall,
deprecateInterpolate,
each,
eachProp,
easings,
flush,
flushCalls,
frameLoop,
getFluidObservers,
getFluidValue,
hasFluidValue,
hex3,
hex4,
hex6,
hex8,
hsl,
hsla,
is,
isAnimatedString,
isEqual,
isSSR,
noop,
onResize,
onScroll,
once,
prefix,
raf4 as raf,
removeFluidObserver,
rgb,
rgba,
setFluidGetter,
toArray,
useConstant,
useForceUpdate,
useIsomorphicLayoutEffect,
useMemoOne,
useOnce,
usePrev,
useReducedMotion
};
//# sourceMappingURL=react-spring_shared.modern.mjs.map
webpack://frontend-tpt/../../node_modules/@react-spring/core/node_modules/@react-spring/animated/dist/react-spring_animated.modern.mjs
// src/Animated.ts
import { defineHidden } from "@react-spring/shared";
var $node = Symbol.for("Animated:node");
var isAnimated = (value) => !!value && value[$node] === value;
var getAnimated = (owner) => owner && owner[$node];
var setAnimated = (owner, node) => defineHidden(owner, $node, node);
var getPayload = (owner) => owner && owner[$node] && owner[$node].getPayload();
var Animated = class {
constructor() {
setAnimated(this, this);
}
/** Get every `AnimatedValue` used by this node. */
getPayload() {
return this.payload || [];
}
};
// src/AnimatedValue.ts
import { is } from "@react-spring/shared";
var AnimatedValue = class extends Animated {
constructor(_value) {
super();
this._value = _value;
this.done = true;
this.durationProgress = 0;
if (is.num(this._value)) {
this.lastPosition = this._value;
}
}
/** @internal */
static create(value) {
return new AnimatedValue(value);
}
getPayload() {
return [this];
}
getValue() {
return this._value;
}
setValue(value, step) {
if (is.num(value)) {
this.lastPosition = value;
if (step) {
value = Math.round(value / step) * step;
if (this.done) {
this.lastPosition = value;
}
}
}
if (this._value === value) {
return false;
}
this._value = value;
return true;
}
reset() {
const { done } = this;
this.done = false;
if (is.num(this._value)) {
this.elapsedTime = 0;
this.durationProgress = 0;
this.lastPosition = this._value;
if (done)
this.lastVelocity = null;
this.v0 = null;
}
}
};
// src/AnimatedString.ts
import { is as is2, createInterpolator } from "@react-spring/shared";
var AnimatedString = class extends AnimatedValue {
constructor(value) {
super(0);
this._string = null;
this._toString = createInterpolator({
output: [value, value]
});
}
/** @internal */
static create(value) {
return new AnimatedString(value);
}
getValue() {
const value = this._string;
return value == null ? this._string = this._toString(this._value) : value;
}
setValue(value) {
if (is2.str(value)) {
if (value == this._string) {
return false;
}
this._string = value;
this._value = 1;
} else if (super.setValue(value)) {
this._string = null;
} else {
return false;
}
return true;
}
reset(goal) {
if (goal) {
this._toString = createInterpolator({
output: [this.getValue(), goal]
});
}
this._value = 0;
super.reset();
}
};
// src/AnimatedArray.ts
import { isAnimatedString } from "@react-spring/shared";
// src/AnimatedObject.ts
import {
each,
eachProp,
getFluidValue,
hasFluidValue
} from "@react-spring/shared";
// src/context.ts
var TreeContext = { dependencies: null };
// src/AnimatedObject.ts
var AnimatedObject = class extends Animated {
constructor(source) {
super();
this.source = source;
this.setValue(source);
}
getValue(animated) {
const values = {};
eachProp(this.source, (source, key) => {
if (isAnimated(source)) {
values[key] = source.getValue(animated);
} else if (hasFluidValue(source)) {
values[key] = getFluidValue(source);
} else if (!animated) {
values[key] = source;
}
});
return values;
}
/** Replace the raw object data */
setValue(source) {
this.source = source;
this.payload = this._makePayload(source);
}
reset() {
if (this.payload) {
each(this.payload, (node) => node.reset());
}
}
/** Create a payload set. */
_makePayload(source) {
if (source) {
const payload = /* @__PURE__ */ new Set();
eachProp(source, this._addToPayload, payload);
return Array.from(payload);
}
}
/** Add to a payload set. */
_addToPayload(source) {
if (TreeContext.dependencies && hasFluidValue(source)) {
TreeContext.dependencies.add(source);
}
const payload = getPayload(source);
if (payload) {
each(payload, (node) => this.add(node));
}
}
};
// src/AnimatedArray.ts
var AnimatedArray = class extends AnimatedObject {
constructor(source) {
super(source);
}
/** @internal */
static create(source) {
return new AnimatedArray(source);
}
getValue() {
return this.source.map((node) => node.getValue());
}
setValue(source) {
const payload = this.getPayload();
if (source.length == payload.length) {
return payload.map((node, i) => node.setValue(source[i])).some(Boolean);
}
super.setValue(source.map(makeAnimated));
return true;
}
};
function makeAnimated(value) {
const nodeType = isAnimatedString(value) ? AnimatedString : AnimatedValue;
return nodeType.create(value);
}
// src/getAnimatedType.ts
import { is as is3, isAnimatedString as isAnimatedString2 } from "@react-spring/shared";
function getAnimatedType(value) {
const parentNode = getAnimated(value);
return parentNode ? parentNode.constructor : is3.arr(value) ? AnimatedArray : isAnimatedString2(value) ? AnimatedString : AnimatedValue;
}
// src/createHost.ts
import { is as is5, eachProp as eachProp2 } from "@react-spring/shared";
// src/withAnimated.tsx
import * as React from "react";
import { forwardRef, useRef, useCallback, useEffect } from "react";
import {
is as is4,
each as each2,
raf,
useForceUpdate,
useOnce,
addFluidObserver,
removeFluidObserver,
useIsomorphicLayoutEffect
} from "@react-spring/shared";
var withAnimated = (Component, host) => {
const hasInstance = (
// Function components must use "forwardRef" to avoid being
// re-rendered on every animation frame.
!is4.fun(Component) || Component.prototype && Component.prototype.isReactComponent
);
return forwardRef((givenProps, givenRef) => {
const instanceRef = useRef(null);
const ref = hasInstance && // eslint-disable-next-line react-hooks/rules-of-hooks
useCallback(
(value) => {
instanceRef.current = updateRef(givenRef, value);
},
[givenRef]
);
const [props, deps] = getAnimatedState(givenProps, host);
const forceUpdate = useForceUpdate();
const callback = () => {
const instance = instanceRef.current;
if (hasInstance && !instance) {
return;
}
const didUpdate = instance ? host.applyAnimatedValues(instance, props.getValue(true)) : false;
if (didUpdate === false) {
forceUpdate();
}
};
const observer = new PropsObserver(callback, deps);
const observerRef = useRef();
useIsomorphicLayoutEffect(() => {
observerRef.current = observer;
each2(deps, (dep) => addFluidObserver(dep, observer));
return () => {
if (observerRef.current) {
each2(
observerRef.current.deps,
(dep) => removeFluidObserver(dep, observerRef.current)
);
raf.cancel(observerRef.current.update);
}
};
});
useEffect(callback, []);
useOnce(() => () => {
const observer2 = observerRef.current;
each2(observer2.deps, (dep) => removeFluidObserver(dep, observer2));
});
const usedProps = host.getComponentProps(props.getValue());
return /* @__PURE__ */ React.createElement(Component, { ...usedProps, ref });
});
};
var PropsObserver = class {
constructor(update, deps) {
this.update = update;
this.deps = deps;
}
eventObserved(event) {
if (event.type == "change") {
raf.write(this.update);
}
}
};
function getAnimatedState(props, host) {
const dependencies = /* @__PURE__ */ new Set();
TreeContext.dependencies = dependencies;
if (props.style)
props = {
...props,
style: host.createAnimatedStyle(props.style)
};
props = new AnimatedObject(props);
TreeContext.dependencies = null;
return [props, dependencies];
}
function updateRef(ref, value) {
if (ref) {
if (is4.fun(ref))
ref(value);
else
ref.current = value;
}
return value;
}
// src/createHost.ts
var cacheKey = Symbol.for("AnimatedComponent");
var createHost = (components, {
applyAnimatedValues = () => false,
createAnimatedStyle = (style) => new AnimatedObject(style),
getComponentProps = (props) => props
} = {}) => {
const hostConfig = {
applyAnimatedValues,
createAnimatedStyle,
getComponentProps
};
const animated = (Component) => {
const displayName = getDisplayName(Component) || "Anonymous";
if (is5.str(Component)) {
Component = animated[Component] || (animated[Component] = withAnimated(Component, hostConfig));
} else {
Component = Component[cacheKey] || (Component[cacheKey] = withAnimated(Component, hostConfig));
}
Component.displayName = `Animated(${displayName})`;
return Component;
};
eachProp2(components, (Component, key) => {
if (is5.arr(components)) {
key = getDisplayName(Component);
}
animated[key] = animated(Component);
});
return {
animated
};
};
var getDisplayName = (arg) => is5.str(arg) ? arg : arg && is5.str(arg.displayName) ? arg.displayName : is5.fun(arg) && arg.name || null;
export {
Animated,
AnimatedArray,
AnimatedObject,
AnimatedString,
AnimatedValue,
createHost,
getAnimated,
getAnimatedType,
getPayload,
isAnimated,
setAnimated
};
//# sourceMappingURL=react-spring_animated.modern.mjs.map
webpack://frontend-tpt/../../node_modules/@react-spring/core/dist/react-spring_core.modern.mjs
// src/hooks/useChain.ts
import { each, useIsomorphicLayoutEffect } from "@react-spring/shared";
// src/helpers.ts
import {
is,
toArray,
eachProp,
getFluidValue,
isAnimatedString,
Globals as G
} from "@react-spring/shared";
function callProp(value, ...args) {
return is.fun(value) ? value(...args) : value;
}
var matchProp = (value, key) => value === true || !!(key && value && (is.fun(value) ? value(key) : toArray(value).includes(key)));
var resolveProp = (prop, key) => is.obj(prop) ? key && prop[key] : prop;
var getDefaultProp = (props, key) => props.default === true ? props[key] : props.default ? props.default[key] : void 0;
var noopTransform = (value) => value;
var getDefaultProps = (props, transform = noopTransform) => {
let keys = DEFAULT_PROPS;
if (props.default && props.default !== true) {
props = props.default;
keys = Object.keys(props);
}
const defaults2 = {};
for (const key of keys) {
const value = transform(props[key], key);
if (!is.und(value)) {
defaults2[key] = value;
}
}
return defaults2;
};
var DEFAULT_PROPS = [
"config",
"onProps",
"onStart",
"onChange",
"onPause",
"onResume",
"onRest"
];
var RESERVED_PROPS = {
config: 1,
from: 1,
to: 1,
ref: 1,
loop: 1,
reset: 1,
pause: 1,
cancel: 1,
reverse: 1,
immediate: 1,
default: 1,
delay: 1,
onProps: 1,
onStart: 1,
onChange: 1,
onPause: 1,
onResume: 1,
onRest: 1,
onResolve: 1,
// Transition props
items: 1,
trail: 1,
sort: 1,
expires: 1,
initial: 1,
enter: 1,
update: 1,
leave: 1,
children: 1,
onDestroyed: 1,
// Internal props
keys: 1,
callId: 1,
parentId: 1
};
function getForwardProps(props) {
const forward = {};
let count = 0;
eachProp(props, (value, prop) => {
if (!RESERVED_PROPS[prop]) {
forward[prop] = value;
count++;
}
});
if (count) {
return forward;
}
}
function inferTo(props) {
const to2 = getForwardProps(props);
if (to2) {
const out = { to: to2 };
eachProp(props, (val, key) => key in to2 || (out[key] = val));
return out;
}
return { ...props };
}
function computeGoal(value) {
value = getFluidValue(value);
return is.arr(value) ? value.map(computeGoal) : isAnimatedString(value) ? G.createStringInterpolator({
range: [0, 1],
output: [value, value]
})(1) : value;
}
function hasProps(props) {
for (const _ in props)
return true;
return false;
}
function isAsyncTo(to2) {
return is.fun(to2) || is.arr(to2) && is.obj(to2[0]);
}
function detachRefs(ctrl, ref) {
ctrl.ref?.delete(ctrl);
ref?.delete(ctrl);
}
function replaceRef(ctrl, ref) {
if (ref && ctrl.ref !== ref) {
ctrl.ref?.delete(ctrl);
ref.add(ctrl);
ctrl.ref = ref;
}
}
// src/hooks/useChain.ts
function useChain(refs, timeSteps, timeFrame = 1e3) {
useIsomorphicLayoutEffect(() => {
if (timeSteps) {
let prevDelay = 0;
each(refs, (ref, i) => {
const controllers = ref.current;
if (controllers.length) {
let delay = timeFrame * timeSteps[i];
if (isNaN(delay))
delay = prevDelay;
else
prevDelay = delay;
each(controllers, (ctrl) => {
each(ctrl.queue, (props) => {
const memoizedDelayProp = props.delay;
props.delay = (key) => delay + callProp(memoizedDelayProp || 0, key);
});
});
ref.start();
}
});
} else {
let p = Promise.resolve();
each(refs, (ref) => {
const controllers = ref.current;
if (controllers.length) {
const queues = controllers.map((ctrl) => {
const q = ctrl.queue;
ctrl.queue = [];
return q;
});
p = p.then(() => {
each(
controllers,
(ctrl, i) => each(queues[i] || [], (update2) => ctrl.queue.push(update2))
);
return Promise.all(ref.start());
});
}
});
}
});
}
// src/hooks/useSpring.ts
import { is as is9 } from "@react-spring/shared";
// src/hooks/useSprings.ts
import { useContext as useContext2, useMemo, useRef } from "react";
import {
is as is8,
each as each5,
usePrev,
useOnce,
useForceUpdate,
useIsomorphicLayoutEffect as useIsomorphicLayoutEffect2
} from "@react-spring/shared";
// src/SpringValue.ts
import {
is as is5,
raf as raf3,
each as each2,
isEqual,
toArray as toArray2,
eachProp as eachProp3,
frameLoop as frameLoop2,
flushCalls,
getFluidValue as getFluidValue2,
isAnimatedString as isAnimatedString2,
Globals as G5,
callFluidObservers as callFluidObservers2,
hasFluidValue,
addFluidObserver,
removeFluidObserver,
getFluidObservers
} from "@react-spring/shared";
import {
AnimatedValue,
AnimatedString,
getPayload,
getAnimated as getAnimated2,
setAnimated,
getAnimatedType
} from "@react-spring/animated";
// src/AnimationConfig.ts
import { is as is2, easings } from "@react-spring/shared";
// src/constants.ts
var config = {
default: { tension: 170, friction: 26 },
gentle: { tension: 120, friction: 14 },
wobbly: { tension: 180, friction: 12 },
stiff: { tension: 210, friction: 20 },
slow: { tension: 280, friction: 60 },
molasses: { tension: 280, friction: 120 }
};
// src/AnimationConfig.ts
var defaults = {
...config.default,
mass: 1,
damping: 1,
easing: easings.linear,
clamp: false
};
var AnimationConfig = class {
constructor() {
/**
* The initial velocity of one or more values.
*
* @default 0
*/
this.velocity = 0;
Object.assign(this, defaults);
}
};
function mergeConfig(config2, newConfig, defaultConfig) {
if (defaultConfig) {
defaultConfig = { ...defaultConfig };
sanitizeConfig(defaultConfig, newConfig);
newConfig = { ...defaultConfig, ...newConfig };
}
sanitizeConfig(config2, newConfig);
Object.assign(config2, newConfig);
for (const key in defaults) {
if (config2[key] == null) {
config2[key] = defaults[key];
}
}
let { frequency, damping } = config2;
const { mass } = config2;
if (!is2.und(frequency)) {
if (frequency < 0.01)
frequency = 0.01;
if (damping < 0)
damping = 0;
config2.tension = Math.pow(2 * Math.PI / frequency, 2) * mass;
config2.friction = 4 * Math.PI * damping * mass / frequency;
}
return config2;
}
function sanitizeConfig(config2, props) {
if (!is2.und(props.decay)) {
config2.duration = void 0;
} else {
const isTensionConfig = !is2.und(props.tension) || !is2.und(props.friction);
if (isTensionConfig || !is2.und(props.frequency) || !is2.und(props.damping) || !is2.und(props.mass)) {
config2.duration = void 0;
config2.decay = void 0;
}
if (isTensionConfig) {
config2.frequency = void 0;
}
}
}
// src/Animation.ts
var emptyArray = [];
var Animation = class {
constructor() {
this.changed = false;
this.values = emptyArray;
this.toValues = null;
this.fromValues = emptyArray;
this.config = new AnimationConfig();
this.immediate = false;
}
};
// src/scheduleProps.ts
import { is as is3, raf, Globals as G2 } from "@react-spring/shared";
function scheduleProps(callId, { key, props, defaultProps, state, actions }) {
return new Promise((resolve, reject) => {
let delay;
let timeout;
let cancel = matchProp(props.cancel ?? defaultProps?.cancel, key);
if (cancel) {
onStart();
} else {
if (!is3.und(props.pause)) {
state.paused = matchProp(props.pause, key);
}
let pause = defaultProps?.pause;
if (pause !== true) {
pause = state.paused || matchProp(pause, key);
}
delay = callProp(props.delay || 0, key);
if (pause) {
state.resumeQueue.add(onResume);
actions.pause();
} else {
actions.resume();
onResume();
}
}
function onPause() {
state.resumeQueue.add(onResume);
state.timeouts.delete(timeout);
timeout.cancel();
delay = timeout.time - raf.now();
}
function onResume() {
if (delay > 0 && !G2.skipAnimation) {
state.delayed = true;
timeout = raf.setTimeout(onStart, delay);
state.pauseQueue.add(onPause);
state.timeouts.add(timeout);
} else {
onStart();
}
}
function onStart() {
if (state.delayed) {
state.delayed = false;
}
state.pauseQueue.delete(onPause);
state.timeouts.delete(timeout);
if (callId <= (state.cancelId || 0)) {
cancel = true;
}
try {
actions.start({ ...props, callId, cancel }, resolve);
} catch (err) {
reject(err);
}
}
});
}
// src/runAsync.ts
import {
is as is4,
raf as raf2,
flush,
eachProp as eachProp2,
Globals as G3
} from "@react-spring/shared";
// src/AnimationResult.ts
var getCombinedResult = (target, results) => results.length == 1 ? results[0] : results.some((result) => result.cancelled) ? getCancelledResult(target.get()) : results.every((result) => result.noop) ? getNoopResult(target.get()) : getFinishedResult(
target.get(),
results.every((result) => result.finished)
);
var getNoopResult = (value) => ({
value,
noop: true,
finished: true,
cancelled: false
});
var getFinishedResult = (value, finished, cancelled = false) => ({
value,
finished,
cancelled
});
var getCancelledResult = (value) => ({
value,
cancelled: true,
finished: false
});
// src/runAsync.ts
function runAsync(to2, props, state, target) {
const { callId, parentId, onRest } = props;
const { asyncTo: prevTo, promise: prevPromise } = state;
if (!parentId && to2 === prevTo && !props.reset) {
return prevPromise;
}
return state.promise = (async () => {
state.asyncId = callId;
state.asyncTo = to2;
const defaultProps = getDefaultProps(
props,
(value, key) => (
// The `onRest` prop is only called when the `runAsync` promise is resolved.
key === "onRest" ? void 0 : value
)
);
let preventBail;
let bail;
const bailPromise = new Promise(
(resolve, reject) => (preventBail = resolve, bail = reject)
);
const bailIfEnded = (bailSignal) => {
const bailResult = (
// The `cancel` prop or `stop` method was used.
callId <= (state.cancelId || 0) && getCancelledResult(target) || // The async `to` prop was replaced.
callId !== state.asyncId && getFinishedResult(target, false)
);
if (bailResult) {
bailSignal.result = bailResult;
bail(bailSignal);
throw bailSignal;
}
};
const animate = (arg1, arg2) => {
const bailSignal = new BailSignal();
const skipAnimationSignal = new SkipAnimationSignal();
return (async () => {
if (G3.skipAnimation) {
stopAsync(state);
skipAnimationSignal.result = getFinishedResult(target, false);
bail(skipAnimationSignal);
throw skipAnimationSignal;
}
bailIfEnded(bailSignal);
const props2 = is4.obj(arg1) ? { ...arg1 } : { ...arg2, to: arg1 };
props2.parentId = callId;
eachProp2(defaultProps, (value, key) => {
if (is4.und(props2[key])) {
props2[key] = value;
}
});
const result2 = await target.start(props2);
bailIfEnded(bailSignal);
if (state.paused) {
await new Promise((resume) => {
state.resumeQueue.add(resume);
});
}
return result2;
})();
};
let result;
if (G3.skipAnimation) {
stopAsync(state);
return getFinishedResult(target, false);
}
try {
let animating;
if (is4.arr(to2)) {
animating = (async (queue) => {
for (const props2 of queue) {
await animate(props2);
}
})(to2);
} else {
animating = Promise.resolve(to2(animate, target.stop.bind(target)));
}
await Promise.all([animating.then(preventBail), bailPromise]);
result = getFinishedResult(target.get(), true, false);
} catch (err) {
if (err instanceof BailSignal) {
result = err.result;
} else if (err instanceof SkipAnimationSignal) {
result = err.result;
} else {
throw err;
}
} finally {
if (callId == state.asyncId) {
state.asyncId = parentId;
state.asyncTo = parentId ? prevTo : void 0;
state.promise = parentId ? prevPromise : void 0;
}
}
if (is4.fun(onRest)) {
raf2.batchedUpdates(() => {
onRest(result, target, target.item);
});
}
return result;
})();
}
function stopAsync(state, cancelId) {
flush(state.timeouts, (t) => t.cancel());
state.pauseQueue.clear();
state.resumeQueue.clear();
state.asyncId = state.asyncTo = state.promise = void 0;
if (cancelId)
state.cancelId = cancelId;
}
var BailSignal = class extends Error {
constructor() {
super(
"An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."
);
}
};
var SkipAnimationSignal = class extends Error {
constructor() {
super("SkipAnimationSignal");
}
};
// src/FrameValue.ts
import {
deprecateInterpolate,
frameLoop,
FluidValue as FluidValue2,
Globals as G4,
callFluidObservers
} from "@react-spring/shared";
import { getAnimated } from "@react-spring/animated";
var isFrameValue = (value) => value instanceof FrameValue;
var nextId = 1;
var FrameValue = class extends FluidValue2 {
constructor() {
super(...arguments);
this.id = nextId++;
this._priority = 0;
}
get priority() {
return this._priority;
}
set priority(priority) {
if (this._priority != priority) {
this._priority = priority;
this._onPriorityChange(priority);
}
}
/** Get the current value */
get() {
const node = getAnimated(this);
return node && node.getValue();
}
/** Create a spring that maps our value to another value */
to(...args) {
return G4.to(this, args);
}
/** @deprecated Use the `to` method instead. */
interpolate(...args) {
deprecateInterpolate();
return G4.to(this, args);
}
toJSON() {
return this.get();
}
observerAdded(count) {
if (count == 1)
this._attach();
}
observerRemoved(count) {
if (count == 0)
this._detach();
}
/** Called when the first child is added. */
_attach() {
}
/** Called when the last child is removed. */
_detach() {
}
/** Tell our children about our new value */
_onChange(value, idle = false) {
callFluidObservers(this, {
type: "change",
parent: this,
value,
idle
});
}
/** Tell our children about our new priority */
_onPriorityChange(priority) {
if (!this.idle) {
frameLoop.sort(this);
}
callFluidObservers(this, {
type: "priority",
parent: this,
priority
});
}
};
// src/SpringPhase.ts
var $P = Symbol.for("SpringPhase");
var HAS_ANIMATED = 1;
var IS_ANIMATING = 2;
var IS_PAUSED = 4;
var hasAnimated = (target) => (target[$P] & HAS_ANIMATED) > 0;
var isAnimating = (target) => (target[$P] & IS_ANIMATING) > 0;
var isPaused = (target) => (target[$P] & IS_PAUSED) > 0;
var setActiveBit = (target, active) => active ? target[$P] |= IS_ANIMATING | HAS_ANIMATED : target[$P] &= ~IS_ANIMATING;
var setPausedBit = (target, paused) => paused ? target[$P] |= IS_PAUSED : target[$P] &= ~IS_PAUSED;
// src/SpringValue.ts
var SpringValue = class extends FrameValue {
constructor(arg1, arg2) {
super();
/** The animation state */
this.animation = new Animation();
/** Some props have customizable default values */
this.defaultProps = {};
/** The state for `runAsync` calls */
this._state = {
paused: false,
delayed: false,
pauseQueue: /* @__PURE__ */ new Set(),
resumeQueue: /* @__PURE__ */ new Set(),
timeouts: /* @__PURE__ */ new Set()
};
/** The promise resolvers of pending `start` calls */
this._pendingCalls = /* @__PURE__ */ new Set();
/** The counter for tracking `scheduleProps` calls */
this._lastCallId = 0;
/** The last `scheduleProps` call that changed the `to` prop */
this._lastToId = 0;
this._memoizedDuration = 0;
if (!is5.und(arg1) || !is5.und(arg2)) {
const props = is5.obj(arg1) ? { ...arg1 } : { ...arg2, from: arg1 };
if (is5.und(props.default)) {
props.default = true;
}
this.start(props);
}
}
/** Equals true when not advancing on each frame. */
get idle() {
return !(isAnimating(this) || this._state.asyncTo) || isPaused(this);
}
get goal() {
return getFluidValue2(this.animation.to);
}
get velocity() {
const node = getAnimated2(this);
return node instanceof AnimatedValue ? node.lastVelocity || 0 : node.getPayload().map((node2) => node2.lastVelocity || 0);
}
/**
* When true, this value has been animated at least once.
*/
get hasAnimated() {
return hasAnimated(this);
}
/**
* When true, this value has an unfinished animation,
* which is either active or paused.
*/
get isAnimating() {
return isAnimating(this);
}
/**
* When true, all current and future animations are paused.
*/
get isPaused() {
return isPaused(this);
}
/**
*
*
*/
get isDelayed() {
return this._state.delayed;
}
/** Advance the current animation by a number of milliseconds */
advance(dt) {
let idle = true;
let changed = false;
const anim = this.animation;
let { toValues } = anim;
const { config: config2 } = anim;
const payload = getPayload(anim.to);
if (!payload && hasFluidValue(anim.to)) {
toValues = toArray2(getFluidValue2(anim.to));
}
anim.values.forEach((node2, i) => {
if (node2.done)
return;
const to2 = (
// Animated strings always go from 0 to 1.
node2.constructor == AnimatedString ? 1 : payload ? payload[i].lastPosition : toValues[i]
);
let finished = anim.immediate;
let position = to2;
if (!finished) {
position = node2.lastPosition;
if (config2.tension <= 0) {
node2.done = true;
return;
}
let elapsed = node2.elapsedTime += dt;
const from = anim.fromValues[i];
const v0 = node2.v0 != null ? node2.v0 : node2.v0 = is5.arr(config2.velocity) ? config2.velocity[i] : config2.velocity;
let velocity;
const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3));
if (!is5.und(config2.duration)) {
let p = 1;
if (config2.duration > 0) {
if (this._memoizedDuration !== config2.duration) {
this._memoizedDuration = config2.duration;
if (node2.durationProgress > 0) {
node2.elapsedTime = config2.duration * node2.durationProgress;
elapsed = node2.elapsedTime += dt;
}
}
p = (config2.progress || 0) + elapsed / this._memoizedDuration;
p = p > 1 ? 1 : p < 0 ? 0 : p;
node2.durationProgress = p;
}
position = from + config2.easing(p) * (to2 - from);
velocity = (position - node2.lastPosition) / dt;
finished = p == 1;
} else if (config2.decay) {
const decay = config2.decay === true ? 0.998 : config2.decay;
const e = Math.exp(-(1 - decay) * elapsed);
position = from + v0 / (1 - decay) * (1 - e);
finished = Math.abs(node2.lastPosition - position) <= precision;
velocity = v0 * e;
} else {
velocity = node2.lastVelocity == null ? v0 : node2.lastVelocity;
const restVelocity = config2.restVelocity || precision / 10;
const bounceFactor = config2.clamp ? 0 : config2.bounce;
const canBounce = !is5.und(bounceFactor);
const isGrowing = from == to2 ? node2.v0 > 0 : from < to2;
let isMoving;
let isBouncing = false;
const step = 1;
const numSteps = Math.ceil(dt / step);
for (let n = 0; n < numSteps; ++n) {
isMoving = Math.abs(velocity) > restVelocity;
if (!isMoving) {
finished = Math.abs(to2 - position) <= precision;
if (finished) {
break;
}
}
if (canBounce) {
isBouncing = position == to2 || position > to2 == isGrowing;
if (isBouncing) {
velocity = -velocity * bounceFactor;
position = to2;
}
}
const springForce = -config2.tension * 1e-6 * (position - to2);
const dampingForce = -config2.friction * 1e-3 * velocity;
const acceleration = (springForce + dampingForce) / config2.mass;
velocity = velocity + acceleration * step;
position = position + velocity * step;
}
}
node2.lastVelocity = velocity;
if (Number.isNaN(position)) {
console.warn(`Got NaN while animating:`, this);
finished = true;
}
}
if (payload && !payload[i].done) {
finished = false;
}
if (finished) {
node2.done = true;
} else {
idle = false;
}
if (node2.setValue(position, config2.round)) {
changed = true;
}
});
const node = getAnimated2(this);
const currVal = node.getValue();
if (idle) {
const finalVal = getFluidValue2(anim.to);
if ((currVal !== finalVal || changed) && !config2.decay) {
node.setValue(finalVal);
this._onChange(finalVal);
} else if (changed && config2.decay) {
this._onChange(currVal);
}
this._stop();
} else if (changed) {
this._onChange(currVal);
}
}
/** Set the current value, while stopping the current animation */
set(value) {
raf3.batchedUpdates(() => {
this._stop();
this._focus(value);
this._set(value);
});
return this;
}
/**
* Freeze the active animation in time, as well as any updates merged
* before `resume` is called.
*/
pause() {
this._update({ pause: true });
}
/** Resume the animation if paused. */
resume() {
this._update({ pause: false });
}
/** Skip to the end of the current animation. */
finish() {
if (isAnimating(this)) {
const { to: to2, config: config2 } = this.animation;
raf3.batchedUpdates(() => {
this._onStart();
if (!config2.decay) {
this._set(to2, false);
}
this._stop();
});
}
return this;
}
/** Push props into the pending queue. */
update(props) {
const queue = this.queue || (this.queue = []);
queue.push(props);
return this;
}
start(to2, arg2) {
let queue;
if (!is5.und(to2)) {
queue = [is5.obj(to2) ? to2 : { ...arg2, to: to2 }];
} else {
queue = this.queue || [];
this.queue = [];
}
return Promise.all(
queue.map((props) => {
const up = this._update(props);
return up;
})
).then((results) => getCombinedResult(this, results));
}
/**
* Stop the current animation, and cancel any delayed updates.
*
* Pass `true` to call `onRest` with `cancelled: true`.
*/
stop(cancel) {
const { to: to2 } = this.animation;
this._focus(this.get());
stopAsync(this._state, cancel && this._lastCallId);
raf3.batchedUpdates(() => this._stop(to2, cancel));
return this;
}
/** Restart the animation. */
reset() {
this._update({ reset: true });
}
/** @internal */
eventObserved(event) {
if (event.type == "change") {
this._start();
} else if (event.type == "priority") {
this.priority = event.priority + 1;
}
}
/**
* Parse the `to` and `from` range from the given `props` object.
*
* This also ensures the initial value is available to animated components
* during the render phase.
*/
_prepareNode(props) {
const key = this.key || "";
let { to: to2, from } = props;
to2 = is5.obj(to2) ? to2[key] : to2;
if (to2 == null || isAsyncTo(to2)) {
to2 = void 0;
}
from = is5.obj(from) ? from[key] : from;
if (from == null) {
from = void 0;
}
const range = { to: to2, from };
if (!hasAnimated(this)) {
if (props.reverse)
[to2, from] = [from, to2];
from = getFluidValue2(from);
if (!is5.und(from)) {
this._set(from);
} else if (!getAnimated2(this)) {
this._set(to2);
}
}
return range;
}
/** Every update is processed by this method before merging. */
_update({ ...props }, isLoop) {
const { key, defaultProps } = this;
if (props.default)
Object.assign(
defaultProps,
getDefaultProps(
props,
(value, prop) => /^on/.test(prop) ? resolveProp(value, key) : value
)
);
mergeActiveFn(this, props, "onProps");
sendEvent(this, "onProps", props, this);
const range = this._prepareNode(props);
if (Object.isFrozen(this)) {
throw Error(
"Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?"
);
}
const state = this._state;
return scheduleProps(++this._lastCallId, {
key,
props,
defaultProps,
state,
actions: {
pause: () => {
if (!isPaused(this)) {
setPausedBit(this, true);
flushCalls(state.pauseQueue);
sendEvent(
this,
"onPause",
getFinishedResult(this, checkFinished(this, this.animation.to)),
this
);
}
},
resume: () => {
if (isPaused(this)) {
setPausedBit(this, false);
if (isAnimating(this)) {
this._resume();
}
flushCalls(state.resumeQueue);
sendEvent(
this,
"onResume",
getFinishedResult(this, checkFinished(this, this.animation.to)),
this
);
}
},
start: this._merge.bind(this, range)
}
}).then((result) => {
if (props.loop && result.finished && !(isLoop && result.noop)) {
const nextProps = createLoopUpdate(props);
if (nextProps) {
return this._update(nextProps, true);
}
}
return result;
});
}
/** Merge props into the current animation */
_merge(range, props, resolve) {
if (props.cancel) {
this.stop(true);
return resolve(getCancelledResult(this));
}
const hasToProp = !is5.und(range.to);
const hasFromProp = !is5.und(range.from);
if (hasToProp || hasFromProp) {
if (props.callId > this._lastToId) {
this._lastToId = props.callId;
} else {
return resolve(getCancelledResult(this));
}
}
const { key, defaultProps, animation: anim } = this;
const { to: prevTo, from: prevFrom } = anim;
let { to: to2 = prevTo, from = prevFrom } = range;
if (hasFromProp && !hasToProp && (!props.default || is5.und(to2))) {
to2 = from;
}
if (props.reverse)
[to2, from] = [from, to2];
const hasFromChanged = !isEqual(from, prevFrom);
if (hasFromChanged) {
anim.from = from;
}
from = getFluidValue2(from);
const hasToChanged = !isEqual(to2, prevTo);
if (hasToChanged) {
this._focus(to2);
}
const hasAsyncTo = isAsyncTo(props.to);
const { config: config2 } = anim;
const { decay, velocity } = config2;
if (hasToProp || hasFromProp) {
config2.velocity = 0;
}
if (props.config && !hasAsyncTo) {
mergeConfig(
config2,
callProp(props.config, key),
// Avoid calling the same "config" prop twice.
props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0
);
}
let node = getAnimated2(this);
if (!node || is5.und(to2)) {
return resolve(getFinishedResult(this, true));
}
const reset = (
// When `reset` is undefined, the `from` prop implies `reset: true`,
// except for declarative updates. When `reset` is defined, there
// must exist a value to animate from.
is5.und(props.reset) ? hasFromProp && !props.default : !is5.und(from) && matchProp(props.reset, key)
);
const value = reset ? from : this.get();
const goal = computeGoal(to2);
const isAnimatable = is5.num(goal) || is5.arr(goal) || isAnimatedString2(goal);
const immediate = !hasAsyncTo && (!isAnimatable || matchProp(defaultProps.immediate || props.immediate, key));
if (hasToChanged) {
const nodeType = getAnimatedType(to2);
if (nodeType !== node.constructor) {
if (immediate) {
node = this._set(goal);
} else
throw Error(
`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`
);
}
}
const goalType = node.constructor;
let started = hasFluidValue(to2);
let finished = false;
if (!started) {
const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged;
if (hasToChanged || hasValueChanged) {
finished = isEqual(computeGoal(value), goal);
started = !finished;
}
if (!isEqual(anim.immediate, immediate) && !immediate || !isEqual(config2.decay, decay) || !isEqual(config2.velocity, velocity)) {
started = true;
}
}
if (finished && isAnimating(this)) {
if (anim.changed && !reset) {
started = true;
} else if (!started) {
this._stop(prevTo);
}
}
if (!hasAsyncTo) {
if (started || hasFluidValue(prevTo)) {
anim.values = node.getPayload();
anim.toValues = hasFluidValue(to2) ? null : goalType == AnimatedString ? [1] : toArray2(goal);
}
if (anim.immediate != immediate) {
anim.immediate = immediate;
if (!immediate && !reset) {
this._set(prevTo);
}
}
if (started) {
const { onRest } = anim;
each2(ACTIVE_EVENTS, (type) => mergeActiveFn(this, props, type));
const result = getFinishedResult(this, checkFinished(this, prevTo));
flushCalls(this._pendingCalls, result);
this._pendingCalls.add(resolve);
if (anim.changed)
raf3.batchedUpdates(() => {
anim.changed = !reset;
onRest?.(result, this);
if (reset) {
callProp(defaultProps.onRest, result);
} else {
anim.onStart?.(result, this);
}
});
}
}
if (reset) {
this._set(value);
}
if (hasAsyncTo) {
resolve(runAsync(props.to, props, this._state, this));
} else if (started) {
this._start();
} else if (isAnimating(this) && !hasToChanged) {
this._pendingCalls.add(resolve);
} else {
resolve(getNoopResult(value));
}
}
/** Update the `animation.to` value, which might be a `FluidValue` */
_focus(value) {
const anim = this.animation;
if (value !== anim.to) {
if (getFluidObservers(this)) {
this._detach();
}
anim.to = value;
if (getFluidObservers(this)) {
this._attach();
}
}
}
_attach() {
let priority = 0;
const { to: to2 } = this.animation;
if (hasFluidValue(to2)) {
addFluidObserver(to2, this);
if (isFrameValue(to2)) {
priority = to2.priority + 1;
}
}
this.priority = priority;
}
_detach() {
const { to: to2 } = this.animation;
if (hasFluidValue(to2)) {
removeFluidObserver(to2, this);
}
}
/**
* Update the current value from outside the frameloop,
* and return the `Animated` node.
*/
_set(arg, idle = true) {
const value = getFluidValue2(arg);
if (!is5.und(value)) {
const oldNode = getAnimated2(this);
if (!oldNode || !isEqual(value, oldNode.getValue())) {
const nodeType = getAnimatedType(value);
if (!oldNode || oldNode.constructor != nodeType) {
setAnimated(this, nodeType.create(value));
} else {
oldNode.setValue(value);
}
if (oldNode) {
raf3.batchedUpdates(() => {
this._onChange(value, idle);
});
}
}
}
return getAnimated2(this);
}
_onStart() {
const anim = this.animation;
if (!anim.changed) {
anim.changed = true;
sendEvent(
this,
"onStart",
getFinishedResult(this, checkFinished(this, anim.to)),
this
);
}
}
_onChange(value, idle) {
if (!idle) {
this._onStart();
callProp(this.animation.onChange, value, this);
}
callProp(this.defaultProps.onChange, value, this);
super._onChange(value, idle);
}
// This method resets the animation state (even if already animating) to
// ensure the latest from/to range is used, and it also ensures this spring
// is added to the frameloop.
_start() {
const anim = this.animation;
getAnimated2(this).reset(getFluidValue2(anim.to));
if (!anim.immediate) {
anim.fromValues = anim.values.map((node) => node.lastPosition);
}
if (!isAnimating(this)) {
setActiveBit(this, true);
if (!isPaused(this)) {
this._resume();
}
}
}
_resume() {
if (G5.skipAnimation) {
this.finish();
} else {
frameLoop2.start(this);
}
}
/**
* Exit the frameloop and notify `onRest` listeners.
*
* Always wrap `_stop` calls with `batchedUpdates`.
*/
_stop(goal, cancel) {
if (isAnimating(this)) {
setActiveBit(this, false);
const anim = this.animation;
each2(anim.values, (node) => {
node.done = true;
});
if (anim.toValues) {
anim.onChange = anim.onPause = anim.onResume = void 0;
}
callFluidObservers2(this, {
type: "idle",
parent: this
});
const result = cancel ? getCancelledResult(this.get()) : getFinishedResult(this.get(), checkFinished(this, goal ?? anim.to));
flushCalls(this._pendingCalls, result);
if (anim.changed) {
anim.changed = false;
sendEvent(this, "onRest", result, this);
}
}
}
};
function checkFinished(target, to2) {
const goal = computeGoal(to2);
const value = computeGoal(target.get());
return isEqual(value, goal);
}
function createLoopUpdate(props, loop = props.loop, to2 = props.to) {
const loopRet = callProp(loop);
if (loopRet) {
const overrides = loopRet !== true && inferTo(loopRet);
const reverse = (overrides || props).reverse;
const reset = !overrides || overrides.reset;
return createUpdate({
...props,
loop,
// Avoid updating default props when looping.
default: false,
// Never loop the `pause` prop.
pause: void 0,
// For the "reverse" prop to loop as expected, the "to" prop
// must be undefined. The "reverse" prop is ignored when the
// "to" prop is an array or function.
to: !reverse || isAsyncTo(to2) ? to2 : void 0,
// Ignore the "from" prop except on reset.
from: reset ? props.from : void 0,
reset,
// The "loop" prop can return a "useSpring" props object to
// override any of the original props.
...overrides
});
}
}
function createUpdate(props) {
const { to: to2, from } = props = inferTo(props);
const keys = /* @__PURE__ */ new Set();
if (is5.obj(to2))
findDefined(to2, keys);
if (is5.obj(from))
findDefined(from, keys);
props.keys = keys.size ? Array.from(keys) : null;
return props;
}
function declareUpdate(props) {
const update2 = createUpdate(props);
if (is5.und(update2.default)) {
update2.default = getDefaultProps(update2);
}
return update2;
}
function findDefined(values, keys) {
eachProp3(values, (value, key) => value != null && keys.add(key));
}
var ACTIVE_EVENTS = [
"onStart",
"onRest",
"onChange",
"onPause",
"onResume"
];
function mergeActiveFn(target, props, type) {
target.animation[type] = props[type] !== getDefaultProp(props, type) ? resolveProp(props[type], target.key) : void 0;
}
function sendEvent(target, type, ...args) {
target.animation[type]?.(...args);
target.defaultProps[type]?.(...args);
}
// src/Controller.ts
import {
is as is6,
raf as raf4,
each as each3,
noop,
flush as flush2,
toArray as toArray3,
eachProp as eachProp4,
flushCalls as flushCalls2,
addFluidObserver as addFluidObserver2
} from "@react-spring/shared";
var BATCHED_EVENTS = ["onStart", "onChange", "onRest"];
var nextId2 = 1;
var Controller = class {
constructor(props, flush3) {
this.id = nextId2++;
/** The animated values */
this.springs = {};
/** The queue of props passed to the `update` method. */
this.queue = [];
/** The counter for tracking `scheduleProps` calls */
this._lastAsyncId = 0;
/** The values currently being animated */
this._active = /* @__PURE__ */ new Set();
/** The values that changed recently */
this._changed = /* @__PURE__ */ new Set();
/** Equals false when `onStart` listeners can be called */
this._started = false;
/** State used by the `runAsync` function */
this._state = {
paused: false,
pauseQueue: /* @__PURE__ */ new Set(),
resumeQueue: /* @__PURE__ */ new Set(),
timeouts: /* @__PURE__ */ new Set()
};
/** The event queues that are flushed once per frame maximum */
this._events = {
onStart: /* @__PURE__ */ new Map(),
onChange: /* @__PURE__ */ new Map(),
onRest: /* @__PURE__ */ new Map()
};
this._onFrame = this._onFrame.bind(this);
if (flush3) {
this._flush = flush3;
}
if (props) {
this.start({ default: true, ...props });
}
}
/**
* Equals `true` when no spring values are in the frameloop, and
* no async animation is currently active.
*/
get idle() {
return !this._state.asyncTo && Object.values(this.springs).every((spring) => {
return spring.idle && !spring.isDelayed && !spring.isPaused;
});
}
get item() {
return this._item;
}
set item(item) {
this._item = item;
}
/** Get the current values of our springs */
get() {
const values = {};
this.each((spring, key) => values[key] = spring.get());
return values;
}
/** Set the current values without animating. */
set(values) {
for (const key in values) {
const value = values[key];
if (!is6.und(value)) {
this.springs[key].set(value);
}
}
}
/** Push an update onto the queue of each value. */
update(props) {
if (props) {
this.queue.push(createUpdate(props));
}
return this;
}
/**
* Start the queued animations for every spring, and resolve the returned
* promise once all queued animations have finished or been cancelled.
*
* When you pass a queue (instead of nothing), that queue is used instead of
* the queued animations added with the `update` method, which are left alone.
*/
start(props) {
let { queue } = this;
if (props) {
queue = toArray3(props).map(createUpdate);
} else {
this.queue = [];
}
if (this._flush) {
return this._flush(this, queue);
}
prepareKeys(this, queue);
return flushUpdateQueue(this, queue);
}
/** @internal */
stop(arg, keys) {
if (arg !== !!arg) {
keys = arg;
}
if (keys) {
const springs = this.springs;
each3(toArray3(keys), (key) => springs[key].stop(!!arg));
} else {
stopAsync(this._state, this._lastAsyncId);
this.each((spring) => spring.stop(!!arg));
}
return this;
}
/** Freeze the active animation in time */
pause(keys) {
if (is6.und(keys)) {
this.start({ pause: true });
} else {
const springs = this.springs;
each3(toArray3(keys), (key) => springs[key].pause());
}
return this;
}
/** Resume the animation if paused. */
resume(keys) {
if (is6.und(keys)) {
this.start({ pause: false });
} else {
const springs = this.springs;
each3(toArray3(keys), (key) => springs[key].resume());
}
return this;
}
/** Call a function once per spring value */
each(iterator) {
eachProp4(this.springs, iterator);
}
/** @internal Called at the end of every animation frame */
_onFrame() {
const { onStart, onChange, onRest } = this._events;
const active = this._active.size > 0;
const changed = this._changed.size > 0;
if (active && !this._started || changed && !this._started) {
this._started = true;
flush2(onStart, ([onStart2, result]) => {
result.value = this.get();
onStart2(result, this, this._item);
});
}
const idle = !active && this._started;
const values = changed || idle && onRest.size ? this.get() : null;
if (changed && onChange.size) {
flush2(onChange, ([onChange2, result]) => {
result.value = values;
onChange2(result, this, this._item);
});
}
if (idle) {
this._started = false;
flush2(onRest, ([onRest2, result]) => {
result.value = values;
onRest2(result, this, this._item);
});
}
}
/** @internal */
eventObserved(event) {
if (event.type == "change") {
this._changed.add(event.parent);
if (!event.idle) {
this._active.add(event.parent);
}
} else if (event.type == "idle") {
this._active.delete(event.parent);
} else
return;
raf4.onFrame(this._onFrame);
}
};
function flushUpdateQueue(ctrl, queue) {
return Promise.all(queue.map((props) => flushUpdate(ctrl, props))).then(
(results) => getCombinedResult(ctrl, results)
);
}
async function flushUpdate(ctrl, props, isLoop) {
const { keys, to: to2, from, loop, onRest, onResolve } = props;
const defaults2 = is6.obj(props.default) && props.default;
if (loop) {
props.loop = false;
}
if (to2 === false)
props.to = null;
if (from === false)
props.from = null;
const asyncTo = is6.arr(to2) || is6.fun(to2) ? to2 : void 0;
if (asyncTo) {
props.to = void 0;
props.onRest = void 0;
if (defaults2) {
defaults2.onRest = void 0;
}
} else {
each3(BATCHED_EVENTS, (key) => {
const handler = props[key];
if (is6.fun(handler)) {
const queue = ctrl["_events"][key];
props[key] = ({ finished, cancelled }) => {
const result2 = queue.get(handler);
if (result2) {
if (!finished)
result2.finished = false;
if (cancelled)
result2.cancelled = true;
} else {
queue.set(handler, {
value: null,
finished: finished || false,
cancelled: cancelled || false
});
}
};
if (defaults2) {
defaults2[key] = props[key];
}
}
});
}
const state = ctrl["_state"];
if (props.pause === !state.paused) {
state.paused = props.pause;
flushCalls2(props.pause ? state.pauseQueue : state.resumeQueue);
} else if (state.paused) {
props.pause = true;
}
const promises = (keys || Object.keys(ctrl.springs)).map(
(key) => ctrl.springs[key].start(props)
);
const cancel = props.cancel === true || getDefaultProp(props, "cancel") === true;
if (asyncTo || cancel && state.asyncId) {
promises.push(
scheduleProps(++ctrl["_lastAsyncId"], {
props,
state,
actions: {
pause: noop,
resume: noop,
start(props2, resolve) {
if (cancel) {
stopAsync(state, ctrl["_lastAsyncId"]);
resolve(getCancelledResult(ctrl));
} else {
props2.onRest = onRest;
resolve(
runAsync(
asyncTo,
props2,
state,
ctrl
)
);
}
}
}
})
);
}
if (state.paused) {
await new Promise((resume) => {
state.resumeQueue.add(resume);
});
}
const result = getCombinedResult(ctrl, await Promise.all(promises));
if (loop && result.finished && !(isLoop && result.noop)) {
const nextProps = createLoopUpdate(props, loop, to2);
if (nextProps) {
prepareKeys(ctrl, [nextProps]);
return flushUpdate(ctrl, nextProps, true);
}
}
if (onResolve) {
raf4.batchedUpdates(() => onResolve(result, ctrl, ctrl.item));
}
return result;
}
function getSprings(ctrl, props) {
const springs = { ...ctrl.springs };
if (props) {
each3(toArray3(props), (props2) => {
if (is6.und(props2.keys)) {
props2 = createUpdate(props2);
}
if (!is6.obj(props2.to)) {
props2 = { ...props2, to: void 0 };
}
prepareSprings(springs, props2, (key) => {
return createSpring(key);
});
});
}
setSprings(ctrl, springs);
return springs;
}
function setSprings(ctrl, springs) {
eachProp4(springs, (spring, key) => {
if (!ctrl.springs[key]) {
ctrl.springs[key] = spring;
addFluidObserver2(spring, ctrl);
}
});
}
function createSpring(key, observer) {
const spring = new SpringValue();
spring.key = key;
if (observer) {
addFluidObserver2(spring, observer);
}
return spring;
}
function prepareSprings(springs, props, create) {
if (props.keys) {
each3(props.keys, (key) => {
const spring = springs[key] || (springs[key] = create(key));
spring["_prepareNode"](props);
});
}
}
function prepareKeys(ctrl, queue) {
each3(queue, (props) => {
prepareSprings(ctrl.springs, props, (key) => {
return createSpring(key, ctrl);
});
});
}
// src/SpringContext.tsx
import * as React from "react";
import { useContext } from "react";
import { useMemoOne } from "@react-spring/shared";
var SpringContext = ({
children,
...props
}) => {
const inherited = useContext(ctx);
const pause = props.pause || !!inherited.pause, immediate = props.immediate || !!inherited.immediate;
props = useMemoOne(() => ({ pause, immediate }), [pause, immediate]);
const { Provider } = ctx;
return /* @__PURE__ */ React.createElement(Provider, { value: props }, children);
};
var ctx = makeContext(SpringContext, {});
SpringContext.Provider = ctx.Provider;
SpringContext.Consumer = ctx.Consumer;
function makeContext(target, init) {
Object.assign(target, React.createContext(init));
target.Provider._context = target;
target.Consumer._context = target;
return target;
}
// src/SpringRef.ts
import { each as each4, is as is7, deprecateDirectCall } from "@react-spring/shared";
var SpringRef = () => {
const current = [];
const SpringRef2 = function(props) {
deprecateDirectCall();
const results = [];
each4(current, (ctrl, i) => {
if (is7.und(props)) {
results.push(ctrl.start());
} else {
const update2 = _getProps(props, ctrl, i);
if (update2) {
results.push(ctrl.start(update2));
}
}
});
return results;
};
SpringRef2.current = current;
SpringRef2.add = function(ctrl) {
if (!current.includes(ctrl)) {
current.push(ctrl);
}
};
SpringRef2.delete = function(ctrl) {
const i = current.indexOf(ctrl);
if (~i)
current.splice(i, 1);
};
SpringRef2.pause = function() {
each4(current, (ctrl) => ctrl.pause(...arguments));
return this;
};
SpringRef2.resume = function() {
each4(current, (ctrl) => ctrl.resume(...arguments));
return this;
};
SpringRef2.set = function(values) {
each4(current, (ctrl, i) => {
const update2 = is7.fun(values) ? values(i, ctrl) : values;
if (update2) {
ctrl.set(update2);
}
});
};
SpringRef2.start = function(props) {
const results = [];
each4(current, (ctrl, i) => {
if (is7.und(props)) {
results.push(ctrl.start());
} else {
const update2 = this._getProps(props, ctrl, i);
if (update2) {
results.push(ctrl.start(update2));
}
}
});
return results;
};
SpringRef2.stop = function() {
each4(current, (ctrl) => ctrl.stop(...arguments));
return this;
};
SpringRef2.update = function(props) {
each4(current, (ctrl, i) => ctrl.update(this._getProps(props, ctrl, i)));
return this;
};
const _getProps = function(arg, ctrl, index) {
return is7.fun(arg) ? arg(index, ctrl) : arg;
};
SpringRef2._getProps = _getProps;
return SpringRef2;
};
// src/hooks/useSprings.ts
function useSprings(length, props, deps) {
const propsFn = is8.fun(props) && props;
if (propsFn && !deps)
deps = [];
const ref = useMemo(
() => propsFn || arguments.length == 3 ? SpringRef() : void 0,
[]
);
const layoutId = useRef(0);
const forceUpdate = useForceUpdate();
const state = useMemo(
() => ({
ctrls: [],
queue: [],
flush(ctrl, updates2) {
const springs2 = getSprings(ctrl, updates2);
const canFlushSync = layoutId.current > 0 && !state.queue.length && !Object.keys(springs2).some((key) => !ctrl.springs[key]);
return canFlushSync ? flushUpdateQueue(ctrl, updates2) : new Promise((resolve) => {
setSprings(ctrl, springs2);
state.queue.push(() => {
resolve(flushUpdateQueue(ctrl, updates2));
});
forceUpdate();
});
}
}),
[]
);
const ctrls = useRef([...state.ctrls]);
const updates = [];
const prevLength = usePrev(length) || 0;
useMemo(() => {
each5(ctrls.current.slice(length, prevLength), (ctrl) => {
detachRefs(ctrl, ref);
ctrl.stop(true);
});
ctrls.current.length = length;
declareUpdates(prevLength, length);
}, [length]);
useMemo(() => {
declareUpdates(0, Math.min(prevLength, length));
}, deps);
function declareUpdates(startIndex, endIndex) {
for (let i = startIndex; i < endIndex; i++) {
const ctrl = ctrls.current[i] || (ctrls.current[i] = new Controller(null, state.flush));
const update2 = propsFn ? propsFn(i, ctrl) : props[i];
if (update2) {
updates[i] = declareUpdate(update2);
}
}
}
const springs = ctrls.current.map((ctrl, i) => getSprings(ctrl, updates[i]));
const context = useContext2(SpringContext);
const prevContext = usePrev(context);
const hasContext = context !== prevContext && hasProps(context);
useIsomorphicLayoutEffect2(() => {
layoutId.current++;
state.ctrls = ctrls.current;
const { queue } = state;
if (queue.length) {
state.queue = [];
each5(queue, (cb) => cb());
}
each5(ctrls.current, (ctrl, i) => {
ref?.add(ctrl);
if (hasContext) {
ctrl.start({ default: context });
}
const update2 = updates[i];
if (update2) {
replaceRef(ctrl, update2.ref);
if (ctrl.ref) {
ctrl.queue.push(update2);
} else {
ctrl.start(update2);
}
}
});
});
useOnce(() => () => {
each5(state.ctrls, (ctrl) => ctrl.stop(true));
});
const values = springs.map((x) => ({ ...x }));
return ref ? [values, ref] : values;
}
// src/hooks/useSpring.ts
function useSpring(props, deps) {
const isFn = is9.fun(props);
const [[values], ref] = useSprings(
1,
isFn ? props : [props],
isFn ? deps || [] : deps
);
return isFn || arguments.length == 2 ? [values, ref] : values;
}
// src/hooks/useSpringRef.ts
import { useState } from "react";
var initSpringRef = () => SpringRef();
var useSpringRef = () => useState(initSpringRef)[0];
// src/hooks/useSpringValue.ts
import { useConstant, useOnce as useOnce2 } from "@react-spring/shared";
var useSpringValue = (initial, props) => {
const springValue = useConstant(() => new SpringValue(initial, props));
useOnce2(() => () => {
springValue.stop();
});
return springValue;
};
// src/hooks/useTrail.ts
import { each as each6, is as is10, useIsomorphicLayoutEffect as useIsomorphicLayoutEffect3 } from "@react-spring/shared";
function useTrail(length, propsArg, deps) {
const propsFn = is10.fun(propsArg) && propsArg;
if (propsFn && !deps)
deps = [];
let reverse = true;
let passedRef = void 0;
const result = useSprings(
length,
(i, ctrl) => {
const props = propsFn ? propsFn(i, ctrl) : propsArg;
passedRef = props.ref;
reverse = reverse && props.reverse;
return props;
},
// Ensure the props function is called when no deps exist.
// This works around the 3 argument rule.
deps || [{}]
);
useIsomorphicLayoutEffect3(() => {
each6(result[1].current, (ctrl, i) => {
const parent = result[1].current[i + (reverse ? 1 : -1)];
replaceRef(ctrl, passedRef);
if (ctrl.ref) {
if (parent) {
ctrl.update({ to: parent.springs });
}
return;
}
if (parent) {
ctrl.start({ to: parent.springs });
} else {
ctrl.start();
}
});
}, deps);
if (propsFn || arguments.length == 3) {
const ref = passedRef ?? result[1];
ref["_getProps"] = (propsArg2, ctrl, i) => {
const props = is10.fun(propsArg2) ? propsArg2(i, ctrl) : propsArg2;
if (props) {
const parent = ref.current[i + (props.reverse ? 1 : -1)];
if (parent)
props.to = parent.springs;
return props;
}
};
return result;
}
return result[0];
}
// src/hooks/useTransition.tsx
import * as React2 from "react";
import { useContext as useContext3, useRef as useRef2, useMemo as useMemo2 } from "react";
import {
is as is11,
toArray as toArray4,
useForceUpdate as useForceUpdate2,
useOnce as useOnce3,
usePrev as usePrev2,
each as each7,
useIsomorphicLayoutEffect as useIsomorphicLayoutEffect4
} from "@react-spring/shared";
function useTransition(data, props, deps) {
const propsFn = is11.fun(props) && props;
const {
reset,
sort,
trail = 0,
expires = true,
exitBeforeEnter = false,
onDestroyed,
ref: propsRef,
config: propsConfig
} = propsFn ? propsFn() : props;
const ref = useMemo2(
() => propsFn || arguments.length == 3 ? SpringRef() : void 0,
[]
);
const items = toArray4(data);
const transitions = [];
const usedTransitions = useRef2(null);
const prevTransitions = reset ? null : usedTransitions.current;
useIsomorphicLayoutEffect4(() => {
usedTransitions.current = transitions;
});
useOnce3(() => {
each7(transitions, (t) => {
ref?.add(t.ctrl);
t.ctrl.ref = ref;
});
return () => {
each7(usedTransitions.current, (t) => {
if (t.expired) {
clearTimeout(t.expirationId);
}
detachRefs(t.ctrl, ref);
t.ctrl.stop(true);
});
};
});
const keys = getKeys(items, propsFn ? propsFn() : props, prevTransitions);
const expired = reset && usedTransitions.current || [];
useIsomorphicLayoutEffect4(
() => each7(expired, ({ ctrl, item, key }) => {
detachRefs(ctrl, ref);
callProp(onDestroyed, item, key);
})
);
const reused = [];
if (prevTransitions)
each7(prevTransitions, (t, i) => {
if (t.expired) {
clearTimeout(t.expirationId);
expired.push(t);
} else {
i = reused[i] = keys.indexOf(t.key);
if (~i)
transitions[i] = t;
}
});
each7(items, (item, i) => {
if (!transitions[i]) {
transitions[i] = {
key: keys[i],
item,
phase: "mount" /* MOUNT */,
ctrl: new Controller()
};
transitions[i].ctrl.item = item;
}
});
if (reused.length) {
let i = -1;
const { leave } = propsFn ? propsFn() : props;
each7(reused, (keyIndex, prevIndex) => {
const t = prevTransitions[prevIndex];
if (~keyIndex) {
i = transitions.indexOf(t);
transitions[i] = { ...t, item: items[keyIndex] };
} else if (leave) {
transitions.splice(++i, 0, t);
}
});
}
if (is11.fun(sort)) {
transitions.sort((a, b) => sort(a.item, b.item));
}
let delay = -trail;
const forceUpdate = useForceUpdate2();
const defaultProps = getDefaultProps(props);
const changes = /* @__PURE__ */ new Map();
const exitingTransitions = useRef2(/* @__PURE__ */ new Map());
const forceChange = useRef2(false);
each7(transitions, (t, i) => {
const key = t.key;
const prevPhase = t.phase;
const p = propsFn ? propsFn() : props;
let to2;
let phase;
const propsDelay = callProp(p.delay || 0, key);
if (prevPhase == "mount" /* MOUNT */) {
to2 = p.enter;
phase = "enter" /* ENTER */;
} else {
const isLeave = keys.indexOf(key) < 0;
if (prevPhase != "leave" /* LEAVE */) {
if (isLeave) {
to2 = p.leave;
phase = "leave" /* LEAVE */;
} else if (to2 = p.update) {
phase = "update" /* UPDATE */;
} else
return;
} else if (!isLeave) {
to2 = p.enter;
phase = "enter" /* ENTER */;
} else
return;
}
to2 = callProp(to2, t.item, i);
to2 = is11.obj(to2) ? inferTo(to2) : { to: to2 };
if (!to2.config) {
const config2 = propsConfig || defaultProps.config;
to2.config = callProp(config2, t.item, i, phase);
}
delay += trail;
const payload = {
...defaultProps,
// we need to add our props.delay value you here.
delay: propsDelay + delay,
ref: propsRef,
immediate: p.immediate,
// This prevents implied resets.
reset: false,
// Merge any phase-specific props.
...to2
};
if (phase == "enter" /* ENTER */ && is11.und(payload.from)) {
const p2 = propsFn ? propsFn() : props;
const from = is11.und(p2.initial) || prevTransitions ? p2.from : p2.initial;
payload.from = callProp(from, t.item, i);
}
const { onResolve } = payload;
payload.onResolve = (result) => {
callProp(onResolve, result);
const transitions2 = usedTransitions.current;
const t2 = transitions2.find((t3) => t3.key === key);
if (!t2)
return;
if (result.cancelled && t2.phase != "update" /* UPDATE */) {
return;
}
if (t2.ctrl.idle) {
const idle = transitions2.every((t3) => t3.ctrl.idle);
if (t2.phase == "leave" /* LEAVE */) {
const expiry = callProp(expires, t2.item);
if (expiry !== false) {
const expiryMs = expiry === true ? 0 : expiry;
t2.expired = true;
if (!idle && expiryMs > 0) {
if (expiryMs <= 2147483647)
t2.expirationId = setTimeout(forceUpdate, expiryMs);
return;
}
}
}
if (idle && transitions2.some((t3) => t3.expired)) {
exitingTransitions.current.delete(t2);
if (exitBeforeEnter) {
forceChange.current = true;
}
forceUpdate();
}
}
};
const springs = getSprings(t.ctrl, payload);
if (phase === "leave" /* LEAVE */ && exitBeforeEnter) {
exitingTransitions.current.set(t, { phase, springs, payload });
} else {
changes.set(t, { phase, springs, payload });
}
});
const context = useContext3(SpringContext);
const prevContext = usePrev2(context);
const hasContext = context !== prevContext && hasProps(context);
useIsomorphicLayoutEffect4(() => {
if (hasContext) {
each7(transitions, (t) => {
t.ctrl.start({ default: context });
});
}
}, [context]);
each7(changes, (_, t) => {
if (exitingTransitions.current.size) {
const ind = transitions.findIndex((state) => state.key === t.key);
transitions.splice(ind, 1);
}
});
useIsomorphicLayoutEffect4(
() => {
each7(
exitingTransitions.current.size ? exitingTransitions.current : changes,
({ phase, payload }, t) => {
const { ctrl } = t;
t.phase = phase;
ref?.add(ctrl);
if (hasContext && phase == "enter" /* ENTER */) {
ctrl.start({ default: context });
}
if (payload) {
replaceRef(ctrl, payload.ref);
if ((ctrl.ref || ref) && !forceChange.current) {
ctrl.update(payload);
} else {
ctrl.start(payload);
if (forceChange.current) {
forceChange.current = false;
}
}
}
}
);
},
reset ? void 0 : deps
);
const renderTransitions = (render) => /* @__PURE__ */ React2.createElement(React2.Fragment, null, transitions.map((t, i) => {
const { springs } = changes.get(t) || t.ctrl;
const elem = render({ ...springs }, t.item, t, i);
return elem && elem.type ? /* @__PURE__ */ React2.createElement(
elem.type,
{
...elem.props,
key: is11.str(t.key) || is11.num(t.key) ? t.key : t.ctrl.id,
ref: elem.ref
}
) : elem;
}));
return ref ? [renderTransitions, ref] : renderTransitions;
}
var nextKey = 1;
function getKeys(items, { key, keys = key }, prevTransitions) {
if (keys === null) {
const reused = /* @__PURE__ */ new Set();
return items.map((item) => {
const t = prevTransitions && prevTransitions.find(
(t2) => t2.item === item && t2.phase !== "leave" /* LEAVE */ && !reused.has(t2)
);
if (t) {
reused.add(t);
return t.key;
}
return nextKey++;
});
}
return is11.und(keys) ? items : is11.fun(keys) ? items.map(keys) : toArray4(keys);
}
// src/hooks/useScroll.ts
import { each as each8, onScroll, useIsomorphicLayoutEffect as useIsomorphicLayoutEffect5 } from "@react-spring/shared";
var useScroll = ({
container,
...springOptions
} = {}) => {
const [scrollValues, api] = useSpring(
() => ({
scrollX: 0,
scrollY: 0,
scrollXProgress: 0,
scrollYProgress: 0,
...springOptions
}),
[]
);
useIsomorphicLayoutEffect5(() => {
const cleanupScroll = onScroll(
({ x, y }) => {
api.start({
scrollX: x.current,
scrollXProgress: x.progress,
scrollY: y.current,
scrollYProgress: y.progress
});
},
{ container: container?.current || void 0 }
);
return () => {
each8(Object.values(scrollValues), (value) => value.stop());
cleanupScroll();
};
}, []);
return scrollValues;
};
// src/hooks/useResize.ts
import { onResize, each as each9, useIsomorphicLayoutEffect as useIsomorphicLayoutEffect6 } from "@react-spring/shared";
var useResize = ({
container,
...springOptions
}) => {
const [sizeValues, api] = useSpring(
() => ({
width: 0,
height: 0,
...springOptions
}),
[]
);
useIsomorphicLayoutEffect6(() => {
const cleanupScroll = onResize(
({ width, height }) => {
api.start({
width,
height,
immediate: sizeValues.width.get() === 0 || sizeValues.height.get() === 0
});
},
{ container: container?.current || void 0 }
);
return () => {
each9(Object.values(sizeValues), (value) => value.stop());
cleanupScroll();
};
}, []);
return sizeValues;
};
// src/hooks/useInView.ts
import { useRef as useRef3, useState as useState2 } from "react";
import { is as is12, useIsomorphicLayoutEffect as useIsomorphicLayoutEffect7 } from "@react-spring/shared";
var defaultThresholdOptions = {
any: 0,
all: 1
};
function useInView(props, args) {
const [isInView, setIsInView] = useState2(false);
const ref = useRef3();
const propsFn = is12.fun(props) && props;
const springsProps = propsFn ? propsFn() : {};
const { to: to2 = {}, from = {}, ...restSpringProps } = springsProps;
const intersectionArguments = propsFn ? args : props;
const [springs, api] = useSpring(() => ({ from, ...restSpringProps }), []);
useIsomorphicLayoutEffect7(() => {
const element = ref.current;
const {
root,
once,
amount = "any",
...restArgs
} = intersectionArguments ?? {};
if (!element || once && isInView || typeof IntersectionObserver === "undefined")
return;
const activeIntersections = /* @__PURE__ */ new WeakMap();
const onEnter = () => {
if (to2) {
api.start(to2);
}
setIsInView(true);
const cleanup = () => {
if (from) {
api.start(from);
}
setIsInView(false);
};
return once ? void 0 : cleanup;
};
const handleIntersection = (entries) => {
entries.forEach((entry) => {
const onLeave = activeIntersections.get(entry.target);
if (entry.isIntersecting === Boolean(onLeave)) {
return;
}
if (entry.isIntersecting) {
const newOnLeave = onEnter();
if (is12.fun(newOnLeave)) {
activeIntersections.set(entry.target, newOnLeave);
} else {
observer.unobserve(entry.target);
}
} else if (onLeave) {
onLeave();
activeIntersections.delete(entry.target);
}
});
};
const observer = new IntersectionObserver(handleIntersection, {
root: root && root.current || void 0,
threshold: typeof amount === "number" || Array.isArray(amount) ? amount : defaultThresholdOptions[amount],
...restArgs
});
observer.observe(element);
return () => observer.unobserve(element);
}, [intersectionArguments]);
if (propsFn) {
return [ref, springs];
}
return [ref, isInView];
}
// src/components/Spring.tsx
function Spring({ children, ...props }) {
return children(useSpring(props));
}
// src/components/Trail.tsx
import { is as is13 } from "@react-spring/shared";
function Trail({
items,
children,
...props
}) {
const trails = useTrail(items.length, props);
return items.map((item, index) => {
const result = children(item, index);
return is13.fun(result) ? result(trails[index]) : result;
});
}
// src/components/Transition.tsx
function Transition({
items,
children,
...props
}) {
return useTransition(items, props)(children);
}
// src/interpolate.ts
import { deprecateInterpolate as deprecateInterpolate2 } from "@react-spring/shared";
// src/Interpolation.ts
import {
is as is14,
raf as raf5,
each as each10,
isEqual as isEqual2,
toArray as toArray5,
frameLoop as frameLoop3,
getFluidValue as getFluidValue3,
createInterpolator,
Globals as G6,
callFluidObservers as callFluidObservers3,
addFluidObserver as addFluidObserver3,
removeFluidObserver as removeFluidObserver2,
hasFluidValue as hasFluidValue2
} from "@react-spring/shared";
import {
getAnimated as getAnimated3,
setAnimated as setAnimated2,
getAnimatedType as getAnimatedType2,
getPayload as getPayload2
} from "@react-spring/animated";
var Interpolation = class extends FrameValue {
constructor(source, args) {
super();
this.source = source;
/** Equals false when in the frameloop */
this.idle = true;
/** The inputs which are currently animating */
this._active = /* @__PURE__ */ new Set();
this.calc = createInterpolator(...args);
const value = this._get();
const nodeType = getAnimatedType2(value);
setAnimated2(this, nodeType.create(value));
}
advance(_dt) {
const value = this._get();
const oldValue = this.get();
if (!isEqual2(value, oldValue)) {
getAnimated3(this).setValue(value);
this._onChange(value, this.idle);
}
if (!this.idle && checkIdle(this._active)) {
becomeIdle(this);
}
}
_get() {
const inputs = is14.arr(this.source) ? this.source.map(getFluidValue3) : toArray5(getFluidValue3(this.source));
return this.calc(...inputs);
}
_start() {
if (this.idle && !checkIdle(this._active)) {
this.idle = false;
each10(getPayload2(this), (node) => {
node.done = false;
});
if (G6.skipAnimation) {
raf5.batchedUpdates(() => this.advance());
becomeIdle(this);
} else {
frameLoop3.start(this);
}
}
}
// Observe our sources only when we're observed.
_attach() {
let priority = 1;
each10(toArray5(this.source), (source) => {
if (hasFluidValue2(source)) {
addFluidObserver3(source, this);
}
if (isFrameValue(source)) {
if (!source.idle) {
this._active.add(source);
}
priority = Math.max(priority, source.priority + 1);
}
});
this.priority = priority;
this._start();
}
// Stop observing our sources once we have no observers.
_detach() {
each10(toArray5(this.source), (source) => {
if (hasFluidValue2(source)) {
removeFluidObserver2(source, this);
}
});
this._active.clear();
becomeIdle(this);
}
/** @internal */
eventObserved(event) {
if (event.type == "change") {
if (event.idle) {
this.advance();
} else {
this._active.add(event.parent);
this._start();
}
} else if (event.type == "idle") {
this._active.delete(event.parent);
} else if (event.type == "priority") {
this.priority = toArray5(this.source).reduce(
(highest, parent) => Math.max(highest, (isFrameValue(parent) ? parent.priority : 0) + 1),
0
);
}
}
};
function isIdle(source) {
return source.idle !== false;
}
function checkIdle(active) {
return !active.size || Array.from(active).every(isIdle);
}
function becomeIdle(self) {
if (!self.idle) {
self.idle = true;
each10(getPayload2(self), (node) => {
node.done = true;
});
callFluidObservers3(self, {
type: "idle",
parent: self
});
}
}
// src/interpolate.ts
var to = (source, ...args) => new Interpolation(source, args);
var interpolate = (source, ...args) => (deprecateInterpolate2(), new Interpolation(source, args));
// src/globals.ts
import {
Globals,
frameLoop as frameLoop4,
createStringInterpolator
} from "@react-spring/shared";
Globals.assign({
createStringInterpolator,
to: (source, args) => new Interpolation(source, args)
});
var update = frameLoop4.advance;
// src/index.ts
import {
createInterpolator as createInterpolator2,
useIsomorphicLayoutEffect as useIsomorphicLayoutEffect8,
useReducedMotion,
easings as easings2
} from "@react-spring/shared";
export * from "@react-spring/types";
export {
BailSignal,
Controller,
FrameValue,
Globals,
Interpolation,
Spring,
SpringContext,
SpringRef,
SpringValue,
Trail,
Transition,
config,
createInterpolator2 as createInterpolator,
easings2 as easings,
inferTo,
interpolate,
to,
update,
useChain,
useInView,
useIsomorphicLayoutEffect8 as useIsomorphicLayoutEffect,
useReducedMotion,
useResize,
useScroll,
useSpring,
useSpringRef,
useSpringValue,
useSprings,
useTrail,
useTransition
};
//# sourceMappingURL=react-spring_core.modern.mjs.map
webpack://frontend-tpt/../../node_modules/@react-spring/web/node_modules/@react-spring/rafz/dist/react-spring_rafz.modern.mjs
// src/index.ts
var updateQueue = makeQueue();
var raf = (fn) => schedule(fn, updateQueue);
var writeQueue = makeQueue();
raf.write = (fn) => schedule(fn, writeQueue);
var onStartQueue = makeQueue();
raf.onStart = (fn) => schedule(fn, onStartQueue);
var onFrameQueue = makeQueue();
raf.onFrame = (fn) => schedule(fn, onFrameQueue);
var onFinishQueue = makeQueue();
raf.onFinish = (fn) => schedule(fn, onFinishQueue);
var timeouts = [];
raf.setTimeout = (handler, ms) => {
const time = raf.now() + ms;
const cancel = () => {
const i = timeouts.findIndex((t) => t.cancel == cancel);
if (~i)
timeouts.splice(i, 1);
pendingCount -= ~i ? 1 : 0;
};
const timeout = { time, handler, cancel };
timeouts.splice(findTimeout(time), 0, timeout);
pendingCount += 1;
start();
return timeout;
};
var findTimeout = (time) => ~(~timeouts.findIndex((t) => t.time > time) || ~timeouts.length);
raf.cancel = (fn) => {
onStartQueue.delete(fn);
onFrameQueue.delete(fn);
onFinishQueue.delete(fn);
updateQueue.delete(fn);
writeQueue.delete(fn);
};
raf.sync = (fn) => {
sync = true;
raf.batchedUpdates(fn);
sync = false;
};
raf.throttle = (fn) => {
let lastArgs;
function queuedFn() {
try {
fn(...lastArgs);
} finally {
lastArgs = null;
}
}
function throttled(...args) {
lastArgs = args;
raf.onStart(queuedFn);
}
throttled.handler = fn;
throttled.cancel = () => {
onStartQueue.delete(queuedFn);
lastArgs = null;
};
return throttled;
};
var nativeRaf = typeof window != "undefined" ? window.requestAnimationFrame : (
// eslint-disable-next-line @typescript-eslint/no-empty-function
() => {
}
);
raf.use = (impl) => nativeRaf = impl;
raf.now = typeof performance != "undefined" ? () => performance.now() : Date.now;
raf.batchedUpdates = (fn) => fn();
raf.catch = console.error;
raf.frameLoop = "always";
raf.advance = () => {
if (raf.frameLoop !== "demand") {
console.warn(
"Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"
);
} else {
update();
}
};
var ts = -1;
var pendingCount = 0;
var sync = false;
function schedule(fn, queue) {
if (sync) {
queue.delete(fn);
fn(0);
} else {
queue.add(fn);
start();
}
}
function start() {
if (ts < 0) {
ts = 0;
if (raf.frameLoop !== "demand") {
nativeRaf(loop);
}
}
}
function stop() {
ts = -1;
}
function loop() {
if (~ts) {
nativeRaf(loop);
raf.batchedUpdates(update);
}
}
function update() {
const prevTs = ts;
ts = raf.now();
const count = findTimeout(ts);
if (count) {
eachSafely(timeouts.splice(0, count), (t) => t.handler());
pendingCount -= count;
}
if (!pendingCount) {
stop();
return;
}
onStartQueue.flush();
updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667);
onFrameQueue.flush();
writeQueue.flush();
onFinishQueue.flush();
}
function makeQueue() {
let next = /* @__PURE__ */ new Set();
let current = next;
return {
add(fn) {
pendingCount += current == next && !next.has(fn) ? 1 : 0;
next.add(fn);
},
delete(fn) {
pendingCount -= current == next && next.has(fn) ? 1 : 0;
return next.delete(fn);
},
flush(arg) {
if (current.size) {
next = /* @__PURE__ */ new Set();
pendingCount -= current.size;
eachSafely(current, (fn) => fn(arg) && next.add(fn));
pendingCount += next.size;
current = next;
}
}
};
}
function eachSafely(values, each) {
values.forEach((value) => {
try {
each(value);
} catch (e) {
raf.catch(e);
}
});
}
var __raf = {
/** The number of pending tasks */
count() {
return pendingCount;
},
/** Whether there's a raf update loop running */
isRunning() {
return ts >= 0;
},
/** Clear internal state. Never call from update loop! */
clear() {
ts = -1;
timeouts = [];
onStartQueue = makeQueue();
updateQueue = makeQueue();
onFrameQueue = makeQueue();
writeQueue = makeQueue();
onFinishQueue = makeQueue();
pendingCount = 0;
}
};
export {
__raf,
raf
};
//# sourceMappingURL=react-spring_rafz.modern.mjs.map
webpack://frontend-tpt/../../node_modules/@react-spring/web/node_modules/@react-spring/shared/dist/react-spring_shared.modern.mjs
var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
// src/globals.ts
var globals_exports = {};
__export(globals_exports, {
assign: () => assign,
colors: () => colors,
createStringInterpolator: () => createStringInterpolator,
skipAnimation: () => skipAnimation,
to: () => to,
willAdvance: () => willAdvance
});
import { raf } from "@react-spring/rafz";
// src/helpers.ts
function noop() {
}
var defineHidden = (obj, key, value) => Object.defineProperty(obj, key, { value, writable: true, configurable: true });
var is = {
arr: Array.isArray,
obj: (a) => !!a && a.constructor.name === "Object",
fun: (a) => typeof a === "function",
str: (a) => typeof a === "string",
num: (a) => typeof a === "number",
und: (a) => a === void 0
};
function isEqual(a, b) {
if (is.arr(a)) {
if (!is.arr(b) || a.length !== b.length)
return false;
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i])
return false;
}
return true;
}
return a === b;
}
var each = (obj, fn) => obj.forEach(fn);
function eachProp(obj, fn, ctx) {
if (is.arr(obj)) {
for (let i = 0; i < obj.length; i++) {
fn.call(ctx, obj[i], `${i}`);
}
return;
}
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
fn.call(ctx, obj[key], key);
}
}
}
var toArray = (a) => is.und(a) ? [] : is.arr(a) ? a : [a];
function flush(queue, iterator) {
if (queue.size) {
const items = Array.from(queue);
queue.clear();
each(items, iterator);
}
}
var flushCalls = (queue, ...args) => flush(queue, (fn) => fn(...args));
var isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
// src/globals.ts
var createStringInterpolator;
var to;
var colors = null;
var skipAnimation = false;
var willAdvance = noop;
var assign = (globals) => {
if (globals.to)
to = globals.to;
if (globals.now)
raf.now = globals.now;
if (globals.colors !== void 0)
colors = globals.colors;
if (globals.skipAnimation != null)
skipAnimation = globals.skipAnimation;
if (globals.createStringInterpolator)
createStringInterpolator = globals.createStringInterpolator;
if (globals.requestAnimationFrame)
raf.use(globals.requestAnimationFrame);
if (globals.batchedUpdates)
raf.batchedUpdates = globals.batchedUpdates;
if (globals.willAdvance)
willAdvance = globals.willAdvance;
if (globals.frameLoop)
raf.frameLoop = globals.frameLoop;
};
// src/FrameLoop.ts
import { raf as raf2 } from "@react-spring/rafz";
var startQueue = /* @__PURE__ */ new Set();
var currentFrame = [];
var prevFrame = [];
var priority = 0;
var frameLoop = {
get idle() {
return !startQueue.size && !currentFrame.length;
},
/** Advance the given animation on every frame until idle. */
start(animation) {
if (priority > animation.priority) {
startQueue.add(animation);
raf2.onStart(flushStartQueue);
} else {
startSafely(animation);
raf2(advance);
}
},
/** Advance all animations by the given time. */
advance,
/** Call this when an animation's priority changes. */
sort(animation) {
if (priority) {
raf2.onFrame(() => frameLoop.sort(animation));
} else {
const prevIndex = currentFrame.indexOf(animation);
if (~prevIndex) {
currentFrame.splice(prevIndex, 1);
startUnsafely(animation);
}
}
},
/**
* Clear all animations. For testing purposes.
*
* ☠️ Never call this from within the frameloop.
*/
clear() {
currentFrame = [];
startQueue.clear();
}
};
function flushStartQueue() {
startQueue.forEach(startSafely);
startQueue.clear();
raf2(advance);
}
function startSafely(animation) {
if (!currentFrame.includes(animation))
startUnsafely(animation);
}
function startUnsafely(animation) {
currentFrame.splice(
findIndex(currentFrame, (other) => other.priority > animation.priority),
0,
animation
);
}
function advance(dt) {
const nextFrame = prevFrame;
for (let i = 0; i < currentFrame.length; i++) {
const animation = currentFrame[i];
priority = animation.priority;
if (!animation.idle) {
willAdvance(animation);
animation.advance(dt);
if (!animation.idle) {
nextFrame.push(animation);
}
}
}
priority = 0;
prevFrame = currentFrame;
prevFrame.length = 0;
currentFrame = nextFrame;
return currentFrame.length > 0;
}
function findIndex(arr, test) {
const index = arr.findIndex(test);
return index < 0 ? arr.length : index;
}
// src/clamp.ts
var clamp = (min, max, v) => Math.min(Math.max(v, min), max);
// src/colors.ts
var colors2 = {
transparent: 0,
aliceblue: 4042850303,
antiquewhite: 4209760255,
aqua: 16777215,
aquamarine: 2147472639,
azure: 4043309055,
beige: 4126530815,
bisque: 4293182719,
black: 255,
blanchedalmond: 4293643775,
blue: 65535,
blueviolet: 2318131967,
brown: 2771004159,
burlywood: 3736635391,
burntsienna: 3934150143,
cadetblue: 1604231423,
chartreuse: 2147418367,
chocolate: 3530104575,
coral: 4286533887,
cornflowerblue: 1687547391,
cornsilk: 4294499583,
crimson: 3692313855,
cyan: 16777215,
darkblue: 35839,
darkcyan: 9145343,
darkgoldenrod: 3095792639,
darkgray: 2846468607,
darkgreen: 6553855,
darkgrey: 2846468607,
darkkhaki: 3182914559,
darkmagenta: 2332068863,
darkolivegreen: 1433087999,
darkorange: 4287365375,
darkorchid: 2570243327,
darkred: 2332033279,
darksalmon: 3918953215,
darkseagreen: 2411499519,
darkslateblue: 1211993087,
darkslategray: 793726975,
darkslategrey: 793726975,
darkturquoise: 13554175,
darkviolet: 2483082239,
deeppink: 4279538687,
deepskyblue: 12582911,
dimgray: 1768516095,
dimgrey: 1768516095,
dodgerblue: 512819199,
firebrick: 2988581631,
floralwhite: 4294635775,
forestgreen: 579543807,
fuchsia: 4278255615,
gainsboro: 3705462015,
ghostwhite: 4177068031,
gold: 4292280575,
goldenrod: 3668254975,
gray: 2155905279,
green: 8388863,
greenyellow: 2919182335,
grey: 2155905279,
honeydew: 4043305215,
hotpink: 4285117695,
indianred: 3445382399,
indigo: 1258324735,
ivory: 4294963455,
khaki: 4041641215,
lavender: 3873897215,
lavenderblush: 4293981695,
lawngreen: 2096890111,
lemonchiffon: 4294626815,
lightblue: 2916673279,
lightcoral: 4034953471,
lightcyan: 3774873599,
lightgoldenrodyellow: 4210742015,
lightgray: 3553874943,
lightgreen: 2431553791,
lightgrey: 3553874943,
lightpink: 4290167295,
lightsalmon: 4288707327,
lightseagreen: 548580095,
lightskyblue: 2278488831,
lightslategray: 2005441023,
lightslategrey: 2005441023,
lightsteelblue: 2965692159,
lightyellow: 4294959359,
lime: 16711935,
limegreen: 852308735,
linen: 4210091775,
magenta: 4278255615,
maroon: 2147483903,
mediumaquamarine: 1724754687,
mediumblue: 52735,
mediumorchid: 3126187007,
mediumpurple: 2473647103,
mediumseagreen: 1018393087,
mediumslateblue: 2070474495,
mediumspringgreen: 16423679,
mediumturquoise: 1221709055,
mediumvioletred: 3340076543,
midnightblue: 421097727,
mintcream: 4127193855,
mistyrose: 4293190143,
moccasin: 4293178879,
navajowhite: 4292783615,
navy: 33023,
oldlace: 4260751103,
olive: 2155872511,
olivedrab: 1804477439,
orange: 4289003775,
orangered: 4282712319,
orchid: 3664828159,
palegoldenrod: 4008225535,
palegreen: 2566625535,
paleturquoise: 2951671551,
palevioletred: 3681588223,
papayawhip: 4293907967,
peachpuff: 4292524543,
peru: 3448061951,
pink: 4290825215,
plum: 3718307327,
powderblue: 2967529215,
purple: 2147516671,
rebeccapurple: 1714657791,
red: 4278190335,
rosybrown: 3163525119,
royalblue: 1097458175,
saddlebrown: 2336560127,
salmon: 4202722047,
sandybrown: 4104413439,
seagreen: 780883967,
seashell: 4294307583,
sienna: 2689740287,
silver: 3233857791,
skyblue: 2278484991,
slateblue: 1784335871,
slategray: 1887473919,
slategrey: 1887473919,
snow: 4294638335,
springgreen: 16744447,
steelblue: 1182971135,
tan: 3535047935,
teal: 8421631,
thistle: 3636451583,
tomato: 4284696575,
turquoise: 1088475391,
violet: 4001558271,
wheat: 4125012991,
white: 4294967295,
whitesmoke: 4126537215,
yellow: 4294902015,
yellowgreen: 2597139199
};
// src/colorMatchers.ts
var NUMBER = "[-+]?\\d*\\.?\\d+";
var PERCENTAGE = NUMBER + "%";
function call(...parts) {
return "\\(\\s*(" + parts.join(")\\s*,\\s*(") + ")\\s*\\)";
}
var rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
var rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
var hsl = new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE));
var hsla = new RegExp(
"hsla" + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)
);
var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
var hex6 = /^#([0-9a-fA-F]{6})$/;
var hex8 = /^#([0-9a-fA-F]{8})$/;
// src/normalizeColor.ts
function normalizeColor(color) {
let match;
if (typeof color === "number") {
return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null;
}
if (match = hex6.exec(color))
return parseInt(match[1] + "ff", 16) >>> 0;
if (colors && colors[color] !== void 0) {
return colors[color];
}
if (match = rgb.exec(color)) {
return (parse255(match[1]) << 24 | // r
parse255(match[2]) << 16 | // g
parse255(match[3]) << 8 | // b
255) >>> // a
0;
}
if (match = rgba.exec(color)) {
return (parse255(match[1]) << 24 | // r
parse255(match[2]) << 16 | // g
parse255(match[3]) << 8 | // b
parse1(match[4])) >>> // a
0;
}
if (match = hex3.exec(color)) {
return parseInt(
match[1] + match[1] + // r
match[2] + match[2] + // g
match[3] + match[3] + // b
"ff",
// a
16
) >>> 0;
}
if (match = hex8.exec(color))
return parseInt(match[1], 16) >>> 0;
if (match = hex4.exec(color)) {
return parseInt(
match[1] + match[1] + // r
match[2] + match[2] + // g
match[3] + match[3] + // b
match[4] + match[4],
// a
16
) >>> 0;
}
if (match = hsl.exec(color)) {
return (hslToRgb(
parse360(match[1]),
// h
parsePercentage(match[2]),
// s
parsePercentage(match[3])
// l
) | 255) >>> // a
0;
}
if (match = hsla.exec(color)) {
return (hslToRgb(
parse360(match[1]),
// h
parsePercentage(match[2]),
// s
parsePercentage(match[3])
// l
) | parse1(match[4])) >>> // a
0;
}
return null;
}
function hue2rgb(p, q, t) {
if (t < 0)
t += 1;
if (t > 1)
t -= 1;
if (t < 1 / 6)
return p + (q - p) * 6 * t;
if (t < 1 / 2)
return q;
if (t < 2 / 3)
return p + (q - p) * (2 / 3 - t) * 6;
return p;
}
function hslToRgb(h, s, l) {
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
const p = 2 * l - q;
const r = hue2rgb(p, q, h + 1 / 3);
const g = hue2rgb(p, q, h);
const b = hue2rgb(p, q, h - 1 / 3);
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
}
function parse255(str) {
const int = parseInt(str, 10);
if (int < 0)
return 0;
if (int > 255)
return 255;
return int;
}
function parse360(str) {
const int = parseFloat(str);
return (int % 360 + 360) % 360 / 360;
}
function parse1(str) {
const num = parseFloat(str);
if (num < 0)
return 0;
if (num > 1)
return 255;
return Math.round(num * 255);
}
function parsePercentage(str) {
const int = parseFloat(str);
if (int < 0)
return 0;
if (int > 100)
return 1;
return int / 100;
}
// src/colorToRgba.ts
function colorToRgba(input) {
let int32Color = normalizeColor(input);
if (int32Color === null)
return input;
int32Color = int32Color || 0;
const r = (int32Color & 4278190080) >>> 24;
const g = (int32Color & 16711680) >>> 16;
const b = (int32Color & 65280) >>> 8;
const a = (int32Color & 255) / 255;
return `rgba(${r}, ${g}, ${b}, ${a})`;
}
// src/createInterpolator.ts
var createInterpolator = (range, output, extrapolate) => {
if (is.fun(range)) {
return range;
}
if (is.arr(range)) {
return createInterpolator({
range,
output,
extrapolate
});
}
if (is.str(range.output[0])) {
return createStringInterpolator(range);
}
const config = range;
const outputRange = config.output;
const inputRange = config.range || [0, 1];
const extrapolateLeft = config.extrapolateLeft || config.extrapolate || "extend";
const extrapolateRight = config.extrapolateRight || config.extrapolate || "extend";
const easing = config.easing || ((t) => t);
return (input) => {
const range2 = findRange(input, inputRange);
return interpolate(
input,
inputRange[range2],
inputRange[range2 + 1],
outputRange[range2],
outputRange[range2 + 1],
easing,
extrapolateLeft,
extrapolateRight,
config.map
);
};
};
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
let result = map ? map(input) : input;
if (result < inputMin) {
if (extrapolateLeft === "identity")
return result;
else if (extrapolateLeft === "clamp")
result = inputMin;
}
if (result > inputMax) {
if (extrapolateRight === "identity")
return result;
else if (extrapolateRight === "clamp")
result = inputMax;
}
if (outputMin === outputMax)
return outputMin;
if (inputMin === inputMax)
return input <= inputMin ? outputMin : outputMax;
if (inputMin === -Infinity)
result = -result;
else if (inputMax === Infinity)
result = result - inputMin;
else
result = (result - inputMin) / (inputMax - inputMin);
result = easing(result);
if (outputMin === -Infinity)
result = -result;
else if (outputMax === Infinity)
result = result + outputMin;
else
result = result * (outputMax - outputMin) + outputMin;
return result;
}
function findRange(input, inputRange) {
for (var i = 1; i < inputRange.length - 1; ++i)
if (inputRange[i] >= input)
break;
return i - 1;
}
// src/easings.ts
var steps = (steps2, direction = "end") => (progress2) => {
progress2 = direction === "end" ? Math.min(progress2, 0.999) : Math.max(progress2, 1e-3);
const expanded = progress2 * steps2;
const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded);
return clamp(0, 1, rounded / steps2);
};
var c1 = 1.70158;
var c2 = c1 * 1.525;
var c3 = c1 + 1;
var c4 = 2 * Math.PI / 3;
var c5 = 2 * Math.PI / 4.5;
var bounceOut = (x) => {
const n1 = 7.5625;
const d1 = 2.75;
if (x < 1 / d1) {
return n1 * x * x;
} else if (x < 2 / d1) {
return n1 * (x -= 1.5 / d1) * x + 0.75;
} else if (x < 2.5 / d1) {
return n1 * (x -= 2.25 / d1) * x + 0.9375;
} else {
return n1 * (x -= 2.625 / d1) * x + 0.984375;
}
};
var easings = {
linear: (x) => x,
easeInQuad: (x) => x * x,
easeOutQuad: (x) => 1 - (1 - x) * (1 - x),
easeInOutQuad: (x) => x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2,
easeInCubic: (x) => x * x * x,
easeOutCubic: (x) => 1 - Math.pow(1 - x, 3),
easeInOutCubic: (x) => x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2,
easeInQuart: (x) => x * x * x * x,
easeOutQuart: (x) => 1 - Math.pow(1 - x, 4),
easeInOutQuart: (x) => x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2,
easeInQuint: (x) => x * x * x * x * x,
easeOutQuint: (x) => 1 - Math.pow(1 - x, 5),
easeInOutQuint: (x) => x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2,
easeInSine: (x) => 1 - Math.cos(x * Math.PI / 2),
easeOutSine: (x) => Math.sin(x * Math.PI / 2),
easeInOutSine: (x) => -(Math.cos(Math.PI * x) - 1) / 2,
easeInExpo: (x) => x === 0 ? 0 : Math.pow(2, 10 * x - 10),
easeOutExpo: (x) => x === 1 ? 1 : 1 - Math.pow(2, -10 * x),
easeInOutExpo: (x) => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2,
easeInCirc: (x) => 1 - Math.sqrt(1 - Math.pow(x, 2)),
easeOutCirc: (x) => Math.sqrt(1 - Math.pow(x - 1, 2)),
easeInOutCirc: (x) => x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2,
easeInBack: (x) => c3 * x * x * x - c1 * x * x,
easeOutBack: (x) => 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2),
easeInOutBack: (x) => x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2,
easeInElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4),
easeOutElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1,
easeInOutElastic: (x) => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1,
easeInBounce: (x) => 1 - bounceOut(1 - x),
easeOutBounce: bounceOut,
easeInOutBounce: (x) => x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2,
steps
};
// src/fluids.ts
var $get = Symbol.for("FluidValue.get");
var $observers = Symbol.for("FluidValue.observers");
var hasFluidValue = (arg) => Boolean(arg && arg[$get]);
var getFluidValue = (arg) => arg && arg[$get] ? arg[$get]() : arg;
var getFluidObservers = (target) => target[$observers] || null;
function callFluidObserver(observer2, event) {
if (observer2.eventObserved) {
observer2.eventObserved(event);
} else {
observer2(event);
}
}
function callFluidObservers(target, event) {
const observers = target[$observers];
if (observers) {
observers.forEach((observer2) => {
callFluidObserver(observer2, event);
});
}
}
var FluidValue = class {
constructor(get) {
if (!get && !(get = this.get)) {
throw Error("Unknown getter");
}
setFluidGetter(this, get);
}
};
$get, $observers;
var setFluidGetter = (target, get) => setHidden(target, $get, get);
function addFluidObserver(target, observer2) {
if (target[$get]) {
let observers = target[$observers];
if (!observers) {
setHidden(target, $observers, observers = /* @__PURE__ */ new Set());
}
if (!observers.has(observer2)) {
observers.add(observer2);
if (target.observerAdded) {
target.observerAdded(observers.size, observer2);
}
}
}
return observer2;
}
function removeFluidObserver(target, observer2) {
const observers = target[$observers];
if (observers && observers.has(observer2)) {
const count = observers.size - 1;
if (count) {
observers.delete(observer2);
} else {
target[$observers] = null;
}
if (target.observerRemoved) {
target.observerRemoved(count, observer2);
}
}
}
var setHidden = (target, key, value) => Object.defineProperty(target, key, {
value,
writable: true,
configurable: true
});
// src/regexs.ts
var numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;
var unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, "i");
var rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;
var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
// src/variableToRgba.ts
var variableToRgba = (input) => {
const [token, fallback] = parseCSSVariable(input);
if (!token || isSSR()) {
return input;
}
const value = window.getComputedStyle(document.documentElement).getPropertyValue(token);
if (value) {
return value.trim();
} else if (fallback && fallback.startsWith("--")) {
const value2 = window.getComputedStyle(document.documentElement).getPropertyValue(fallback);
if (value2) {
return value2;
} else {
return input;
}
} else if (fallback && cssVariableRegex.test(fallback)) {
return variableToRgba(fallback);
} else if (fallback) {
return fallback;
}
return input;
};
var parseCSSVariable = (current) => {
const match = cssVariableRegex.exec(current);
if (!match)
return [,];
const [, token, fallback] = match;
return [token, fallback];
};
// src/stringInterpolation.ts
var namedColorRegex;
var rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`;
var createStringInterpolator2 = (config) => {
if (!namedColorRegex)
namedColorRegex = colors ? (
// match color names, ignore partial matches
new RegExp(`(${Object.keys(colors).join("|")})(?!\\w)`, "g")
) : (
// never match
/^\b$/
);
const output = config.output.map((value) => {
return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba);
});
const keyframes = output.map((value) => value.match(numberRegex).map(Number));
const outputRanges = keyframes[0].map(
(_, i) => keyframes.map((values) => {
if (!(i in values)) {
throw Error('The arity of each "output" value must be equal');
}
return values[i];
})
);
const interpolators = outputRanges.map(
(output2) => createInterpolator({ ...config, output: output2 })
);
return (input) => {
const missingUnit = !unitRegex.test(output[0]) && output.find((value) => unitRegex.test(value))?.replace(numberRegex, "");
let i = 0;
return output[0].replace(
numberRegex,
() => `${interpolators[i++](input)}${missingUnit || ""}`
).replace(rgbaRegex, rgbaRound);
};
};
// src/deprecations.ts
var prefix = "react-spring: ";
var once = (fn) => {
const func = fn;
let called = false;
if (typeof func != "function") {
throw new TypeError(`${prefix}once requires a function parameter`);
}
return (...args) => {
if (!called) {
func(...args);
called = true;
}
};
};
var warnInterpolate = once(console.warn);
function deprecateInterpolate() {
warnInterpolate(
`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`
);
}
var warnDirectCall = once(console.warn);
function deprecateDirectCall() {
warnDirectCall(
`${prefix}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`
);
}
// src/isAnimatedString.ts
function isAnimatedString(value) {
return is.str(value) && (value[0] == "#" || /\d/.test(value) || // Do not identify a CSS variable as an AnimatedString if its SSR
!isSSR() && cssVariableRegex.test(value) || value in (colors || {}));
}
// src/dom-events/scroll/index.ts
import { raf as raf3 } from "@react-spring/rafz";
// src/dom-events/resize/resizeElement.ts
var observer;
var resizeHandlers = /* @__PURE__ */ new WeakMap();
var handleObservation = (entries) => entries.forEach(({ target, contentRect }) => {
return resizeHandlers.get(target)?.forEach((handler) => handler(contentRect));
});
function resizeElement(handler, target) {
if (!observer) {
if (typeof ResizeObserver !== "undefined") {
observer = new ResizeObserver(handleObservation);
}
}
let elementHandlers = resizeHandlers.get(target);
if (!elementHandlers) {
elementHandlers = /* @__PURE__ */ new Set();
resizeHandlers.set(target, elementHandlers);
}
elementHandlers.add(handler);
if (observer) {
observer.observe(target);
}
return () => {
const elementHandlers2 = resizeHandlers.get(target);
if (!elementHandlers2)
return;
elementHandlers2.delete(handler);
if (!elementHandlers2.size && observer) {
observer.unobserve(target);
}
};
}
// src/dom-events/resize/resizeWindow.ts
var listeners = /* @__PURE__ */ new Set();
var cleanupWindowResizeHandler;
var createResizeHandler = () => {
const handleResize = () => {
listeners.forEach(
(callback) => callback({
width: window.innerWidth,
height: window.innerHeight
})
);
};
window.addEventListener("resize", handleResize);
return () => {
window.removeEventListener("resize", handleResize);
};
};
var resizeWindow = (callback) => {
listeners.add(callback);
if (!cleanupWindowResizeHandler) {
cleanupWindowResizeHandler = createResizeHandler();
}
return () => {
listeners.delete(callback);
if (!listeners.size && cleanupWindowResizeHandler) {
cleanupWindowResizeHandler();
cleanupWindowResizeHandler = void 0;
}
};
};
// src/dom-events/resize/index.ts
var onResize = (callback, { container = document.documentElement } = {}) => {
if (container === document.documentElement) {
return resizeWindow(callback);
} else {
return resizeElement(callback, container);
}
};
// src/progress.ts
var progress = (min, max, value) => max - min === 0 ? 1 : (value - min) / (max - min);
// src/dom-events/scroll/ScrollHandler.ts
var SCROLL_KEYS = {
x: {
length: "Width",
position: "Left"
},
y: {
length: "Height",
position: "Top"
}
};
var ScrollHandler = class {
constructor(callback, container) {
this.createAxis = () => ({
current: 0,
progress: 0,
scrollLength: 0
});
this.updateAxis = (axisName) => {
const axis = this.info[axisName];
const { length, position } = SCROLL_KEYS[axisName];
axis.current = this.container[`scroll${position}`];
axis.scrollLength = this.container[`scroll${length}`] - this.container[`client${length}`];
axis.progress = progress(0, axis.scrollLength, axis.current);
};
this.update = () => {
this.updateAxis("x");
this.updateAxis("y");
};
this.sendEvent = () => {
this.callback(this.info);
};
this.advance = () => {
this.update();
this.sendEvent();
};
this.callback = callback;
this.container = container;
this.info = {
time: 0,
x: this.createAxis(),
y: this.createAxis()
};
}
};
// src/dom-events/scroll/index.ts
var scrollListeners = /* @__PURE__ */ new WeakMap();
var resizeListeners = /* @__PURE__ */ new WeakMap();
var onScrollHandlers = /* @__PURE__ */ new WeakMap();
var getTarget = (container) => container === document.documentElement ? window : container;
var onScroll = (callback, { container = document.documentElement } = {}) => {
let containerHandlers = onScrollHandlers.get(container);
if (!containerHandlers) {
containerHandlers = /* @__PURE__ */ new Set();
onScrollHandlers.set(container, containerHandlers);
}
const containerHandler = new ScrollHandler(callback, container);
containerHandlers.add(containerHandler);
if (!scrollListeners.has(container)) {
const listener = () => {
containerHandlers?.forEach((handler) => handler.advance());
return true;
};
scrollListeners.set(container, listener);
const target = getTarget(container);
window.addEventListener("resize", listener, { passive: true });
if (container !== document.documentElement) {
resizeListeners.set(container, onResize(listener, { container }));
}
target.addEventListener("scroll", listener, { passive: true });
}
const animateScroll = scrollListeners.get(container);
raf3(animateScroll);
return () => {
raf3.cancel(animateScroll);
const containerHandlers2 = onScrollHandlers.get(container);
if (!containerHandlers2)
return;
containerHandlers2.delete(containerHandler);
if (containerHandlers2.size)
return;
const listener = scrollListeners.get(container);
scrollListeners.delete(container);
if (listener) {
getTarget(container).removeEventListener("scroll", listener);
window.removeEventListener("resize", listener);
resizeListeners.get(container)?.();
}
};
};
// src/hooks/useConstant.ts
import { useRef } from "react";
function useConstant(init) {
const ref = useRef(null);
if (ref.current === null) {
ref.current = init();
}
return ref.current;
}
// src/hooks/useForceUpdate.ts
import { useState } from "react";
// src/hooks/useIsMounted.ts
import { useRef as useRef2 } from "react";
// src/hooks/useIsomorphicLayoutEffect.ts
import { useEffect, useLayoutEffect } from "react";
var useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
// src/hooks/useIsMounted.ts
var useIsMounted = () => {
const isMounted = useRef2(false);
useIsomorphicLayoutEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
return isMounted;
};
// src/hooks/useForceUpdate.ts
function useForceUpdate() {
const update = useState()[1];
const isMounted = useIsMounted();
return () => {
if (isMounted.current) {
update(Math.random());
}
};
}
// src/hooks/useMemoOne.ts
import { useEffect as useEffect2, useRef as useRef3, useState as useState2 } from "react";
function useMemoOne(getResult, inputs) {
const [initial] = useState2(
() => ({
inputs,
result: getResult()
})
);
const committed = useRef3();
const prevCache = committed.current;
let cache = prevCache;
if (cache) {
const useCache = Boolean(
inputs && cache.inputs && areInputsEqual(inputs, cache.inputs)
);
if (!useCache) {
cache = {
inputs,
result: getResult()
};
}
} else {
cache = initial;
}
useEffect2(() => {
committed.current = cache;
if (prevCache == initial) {
initial.inputs = initial.result = void 0;
}
}, [cache]);
return cache.result;
}
function areInputsEqual(next, prev) {
if (next.length !== prev.length) {
return false;
}
for (let i = 0; i < next.length; i++) {
if (next[i] !== prev[i]) {
return false;
}
}
return true;
}
// src/hooks/useOnce.ts
import { useEffect as useEffect3 } from "react";
var useOnce = (effect) => useEffect3(effect, emptyDeps);
var emptyDeps = [];
// src/hooks/usePrev.ts
import { useEffect as useEffect4, useRef as useRef4 } from "react";
function usePrev(value) {
const prevRef = useRef4();
useEffect4(() => {
prevRef.current = value;
});
return prevRef.current;
}
// src/hooks/useReducedMotion.ts
import { useState as useState3 } from "react";
var useReducedMotion = () => {
const [reducedMotion, setReducedMotion] = useState3(null);
useIsomorphicLayoutEffect(() => {
const mql = window.matchMedia("(prefers-reduced-motion)");
const handleMediaChange = (e) => {
setReducedMotion(e.matches);
assign({
skipAnimation: e.matches
});
};
handleMediaChange(mql);
if (mql.addEventListener) {
mql.addEventListener("change", handleMediaChange);
} else {
mql.addListener(handleMediaChange);
}
return () => {
if (mql.removeEventListener) {
mql.removeEventListener("change", handleMediaChange);
} else {
mql.removeListener(handleMediaChange);
}
};
}, []);
return reducedMotion;
};
// src/index.ts
import { raf as raf4 } from "@react-spring/rafz";
export {
FluidValue,
globals_exports as Globals,
addFluidObserver,
callFluidObserver,
callFluidObservers,
clamp,
colorToRgba,
colors2 as colors,
createInterpolator,
createStringInterpolator2 as createStringInterpolator,
defineHidden,
deprecateDirectCall,
deprecateInterpolate,
each,
eachProp,
easings,
flush,
flushCalls,
frameLoop,
getFluidObservers,
getFluidValue,
hasFluidValue,
hex3,
hex4,
hex6,
hex8,
hsl,
hsla,
is,
isAnimatedString,
isEqual,
isSSR,
noop,
onResize,
onScroll,
once,
prefix,
raf4 as raf,
removeFluidObserver,
rgb,
rgba,
setFluidGetter,
toArray,
useConstant,
useForceUpdate,
useIsomorphicLayoutEffect,
useMemoOne,
useOnce,
usePrev,
useReducedMotion
};
//# sourceMappingURL=react-spring_shared.modern.mjs.map
webpack://frontend-tpt/../../node_modules/@react-spring/web/node_modules/@react-spring/animated/dist/react-spring_animated.modern.mjs
// src/Animated.ts
import { defineHidden } from "@react-spring/shared";
var $node = Symbol.for("Animated:node");
var isAnimated = (value) => !!value && value[$node] === value;
var getAnimated = (owner) => owner && owner[$node];
var setAnimated = (owner, node) => defineHidden(owner, $node, node);
var getPayload = (owner) => owner && owner[$node] && owner[$node].getPayload();
var Animated = class {
constructor() {
setAnimated(this, this);
}
/** Get every `AnimatedValue` used by this node. */
getPayload() {
return this.payload || [];
}
};
// src/AnimatedValue.ts
import { is } from "@react-spring/shared";
var AnimatedValue = class extends Animated {
constructor(_value) {
super();
this._value = _value;
this.done = true;
this.durationProgress = 0;
if (is.num(this._value)) {
this.lastPosition = this._value;
}
}
/** @internal */
static create(value) {
return new AnimatedValue(value);
}
getPayload() {
return [this];
}
getValue() {
return this._value;
}
setValue(value, step) {
if (is.num(value)) {
this.lastPosition = value;
if (step) {
value = Math.round(value / step) * step;
if (this.done) {
this.lastPosition = value;
}
}
}
if (this._value === value) {
return false;
}
this._value = value;
return true;
}
reset() {
const { done } = this;
this.done = false;
if (is.num(this._value)) {
this.elapsedTime = 0;
this.durationProgress = 0;
this.lastPosition = this._value;
if (done)
this.lastVelocity = null;
this.v0 = null;
}
}
};
// src/AnimatedString.ts
import { is as is2, createInterpolator } from "@react-spring/shared";
var AnimatedString = class extends AnimatedValue {
constructor(value) {
super(0);
this._string = null;
this._toString = createInterpolator({
output: [value, value]
});
}
/** @internal */
static create(value) {
return new AnimatedString(value);
}
getValue() {
const value = this._string;
return value == null ? this._string = this._toString(this._value) : value;
}
setValue(value) {
if (is2.str(value)) {
if (value == this._string) {
return false;
}
this._string = value;
this._value = 1;
} else if (super.setValue(value)) {
this._string = null;
} else {
return false;
}
return true;
}
reset(goal) {
if (goal) {
this._toString = createInterpolator({
output: [this.getValue(), goal]
});
}
this._value = 0;
super.reset();
}
};
// src/AnimatedArray.ts
import { isAnimatedString } from "@react-spring/shared";
// src/AnimatedObject.ts
import {
each,
eachProp,
getFluidValue,
hasFluidValue
} from "@react-spring/shared";
// src/context.ts
var TreeContext = { dependencies: null };
// src/AnimatedObject.ts
var AnimatedObject = class extends Animated {
constructor(source) {
super();
this.source = source;
this.setValue(source);
}
getValue(animated) {
const values = {};
eachProp(this.source, (source, key) => {
if (isAnimated(source)) {
values[key] = source.getValue(animated);
} else if (hasFluidValue(source)) {
values[key] = getFluidValue(source);
} else if (!animated) {
values[key] = source;
}
});
return values;
}
/** Replace the raw object data */
setValue(source) {
this.source = source;
this.payload = this._makePayload(source);
}
reset() {
if (this.payload) {
each(this.payload, (node) => node.reset());
}
}
/** Create a payload set. */
_makePayload(source) {
if (source) {
const payload = /* @__PURE__ */ new Set();
eachProp(source, this._addToPayload, payload);
return Array.from(payload);
}
}
/** Add to a payload set. */
_addToPayload(source) {
if (TreeContext.dependencies && hasFluidValue(source)) {
TreeContext.dependencies.add(source);
}
const payload = getPayload(source);
if (payload) {
each(payload, (node) => this.add(node));
}
}
};
// src/AnimatedArray.ts
var AnimatedArray = class extends AnimatedObject {
constructor(source) {
super(source);
}
/** @internal */
static create(source) {
return new AnimatedArray(source);
}
getValue() {
return this.source.map((node) => node.getValue());
}
setValue(source) {
const payload = this.getPayload();
if (source.length == payload.length) {
return payload.map((node, i) => node.setValue(source[i])).some(Boolean);
}
super.setValue(source.map(makeAnimated));
return true;
}
};
function makeAnimated(value) {
const nodeType = isAnimatedString(value) ? AnimatedString : AnimatedValue;
return nodeType.create(value);
}
// src/getAnimatedType.ts
import { is as is3, isAnimatedString as isAnimatedString2 } from "@react-spring/shared";
function getAnimatedType(value) {
const parentNode = getAnimated(value);
return parentNode ? parentNode.constructor : is3.arr(value) ? AnimatedArray : isAnimatedString2(value) ? AnimatedString : AnimatedValue;
}
// src/createHost.ts
import { is as is5, eachProp as eachProp2 } from "@react-spring/shared";
// src/withAnimated.tsx
import * as React from "react";
import { forwardRef, useRef, useCallback, useEffect } from "react";
import {
is as is4,
each as each2,
raf,
useForceUpdate,
useOnce,
addFluidObserver,
removeFluidObserver,
useIsomorphicLayoutEffect
} from "@react-spring/shared";
var withAnimated = (Component, host) => {
const hasInstance = (
// Function components must use "forwardRef" to avoid being
// re-rendered on every animation frame.
!is4.fun(Component) || Component.prototype && Component.prototype.isReactComponent
);
return forwardRef((givenProps, givenRef) => {
const instanceRef = useRef(null);
const ref = hasInstance && // eslint-disable-next-line react-hooks/rules-of-hooks
useCallback(
(value) => {
instanceRef.current = updateRef(givenRef, value);
},
[givenRef]
);
const [props, deps] = getAnimatedState(givenProps, host);
const forceUpdate = useForceUpdate();
const callback = () => {
const instance = instanceRef.current;
if (hasInstance && !instance) {
return;
}
const didUpdate = instance ? host.applyAnimatedValues(instance, props.getValue(true)) : false;
if (didUpdate === false) {
forceUpdate();
}
};
const observer = new PropsObserver(callback, deps);
const observerRef = useRef();
useIsomorphicLayoutEffect(() => {
observerRef.current = observer;
each2(deps, (dep) => addFluidObserver(dep, observer));
return () => {
if (observerRef.current) {
each2(
observerRef.current.deps,
(dep) => removeFluidObserver(dep, observerRef.current)
);
raf.cancel(observerRef.current.update);
}
};
});
useEffect(callback, []);
useOnce(() => () => {
const observer2 = observerRef.current;
each2(observer2.deps, (dep) => removeFluidObserver(dep, observer2));
});
const usedProps = host.getComponentProps(props.getValue());
return /* @__PURE__ */ React.createElement(Component, { ...usedProps, ref });
});
};
var PropsObserver = class {
constructor(update, deps) {
this.update = update;
this.deps = deps;
}
eventObserved(event) {
if (event.type == "change") {
raf.write(this.update);
}
}
};
function getAnimatedState(props, host) {
const dependencies = /* @__PURE__ */ new Set();
TreeContext.dependencies = dependencies;
if (props.style)
props = {
...props,
style: host.createAnimatedStyle(props.style)
};
props = new AnimatedObject(props);
TreeContext.dependencies = null;
return [props, dependencies];
}
function updateRef(ref, value) {
if (ref) {
if (is4.fun(ref))
ref(value);
else
ref.current = value;
}
return value;
}
// src/createHost.ts
var cacheKey = Symbol.for("AnimatedComponent");
var createHost = (components, {
applyAnimatedValues = () => false,
createAnimatedStyle = (style) => new AnimatedObject(style),
getComponentProps = (props) => props
} = {}) => {
const hostConfig = {
applyAnimatedValues,
createAnimatedStyle,
getComponentProps
};
const animated = (Component) => {
const displayName = getDisplayName(Component) || "Anonymous";
if (is5.str(Component)) {
Component = animated[Component] || (animated[Component] = withAnimated(Component, hostConfig));
} else {
Component = Component[cacheKey] || (Component[cacheKey] = withAnimated(Component, hostConfig));
}
Component.displayName = `Animated(${displayName})`;
return Component;
};
eachProp2(components, (Component, key) => {
if (is5.arr(components)) {
key = getDisplayName(Component);
}
animated[key] = animated(Component);
});
return {
animated
};
};
var getDisplayName = (arg) => is5.str(arg) ? arg : arg && is5.str(arg.displayName) ? arg.displayName : is5.fun(arg) && arg.name || null;
export {
Animated,
AnimatedArray,
AnimatedObject,
AnimatedString,
AnimatedValue,
createHost,
getAnimated,
getAnimatedType,
getPayload,
isAnimated,
setAnimated
};
//# sourceMappingURL=react-spring_animated.modern.mjs.map
webpack://frontend-tpt/../../node_modules/@react-spring/web/dist/react-spring_web.modern.mjs
// src/index.ts
import { Globals } from "@react-spring/core";
import { unstable_batchedUpdates } from "react-dom";
import { createStringInterpolator, colors } from "@react-spring/shared";
import { createHost } from "@react-spring/animated";
// src/applyAnimatedValues.ts
var isCustomPropRE = /^--/;
function dangerousStyleValue(name, value) {
if (value == null || typeof value === "boolean" || value === "")
return "";
if (typeof value === "number" && value !== 0 && !isCustomPropRE.test(name) && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]))
return value + "px";
return ("" + value).trim();
}
var attributeCache = {};
function applyAnimatedValues(instance, props) {
if (!instance.nodeType || !instance.setAttribute) {
return false;
}
const isFilterElement = instance.nodeName === "filter" || instance.parentNode && instance.parentNode.nodeName === "filter";
const {
className,
style,
children,
scrollTop,
scrollLeft,
viewBox,
...attributes
} = props;
const values = Object.values(attributes);
const names = Object.keys(attributes).map(
(name) => isFilterElement || instance.hasAttribute(name) ? name : attributeCache[name] || (attributeCache[name] = name.replace(
/([A-Z])/g,
// Attributes are written in dash case
(n) => "-" + n.toLowerCase()
))
);
if (children !== void 0) {
instance.textContent = children;
}
for (const name in style) {
if (style.hasOwnProperty(name)) {
const value = dangerousStyleValue(name, style[name]);
if (isCustomPropRE.test(name)) {
instance.style.setProperty(name, value);
} else {
instance.style[name] = value;
}
}
}
names.forEach((name, i) => {
instance.setAttribute(name, values[i]);
});
if (className !== void 0) {
instance.className = className;
}
if (scrollTop !== void 0) {
instance.scrollTop = scrollTop;
}
if (scrollLeft !== void 0) {
instance.scrollLeft = scrollLeft;
}
if (viewBox !== void 0) {
instance.setAttribute("viewBox", viewBox);
}
}
var isUnitlessNumber = {
animationIterationCount: true,
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
columns: true,
flex: true,
flexGrow: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
flexOrder: true,
gridRow: true,
gridRowEnd: true,
gridRowSpan: true,
gridRowStart: true,
gridColumn: true,
gridColumnEnd: true,
gridColumnSpan: true,
gridColumnStart: true,
fontWeight: true,
lineClamp: true,
lineHeight: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related properties
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true
};
var prefixKey = (prefix, key) => prefix + key.charAt(0).toUpperCase() + key.substring(1);
var prefixes = ["Webkit", "Ms", "Moz", "O"];
isUnitlessNumber = Object.keys(isUnitlessNumber).reduce((acc, prop) => {
prefixes.forEach((prefix) => acc[prefixKey(prefix, prop)] = acc[prop]);
return acc;
}, isUnitlessNumber);
// src/AnimatedStyle.ts
import { AnimatedObject } from "@react-spring/animated";
import {
is,
each,
toArray,
eachProp,
FluidValue,
getFluidValue,
callFluidObservers,
hasFluidValue,
addFluidObserver,
removeFluidObserver
} from "@react-spring/shared";
var domTransforms = /^(matrix|translate|scale|rotate|skew)/;
var pxTransforms = /^(translate)/;
var degTransforms = /^(rotate|skew)/;
var addUnit = (value, unit) => is.num(value) && value !== 0 ? value + unit : value;
var isValueIdentity = (value, id) => is.arr(value) ? value.every((v) => isValueIdentity(v, id)) : is.num(value) ? value === id : parseFloat(value) === id;
var AnimatedStyle = class extends AnimatedObject {
constructor({ x, y, z, ...style }) {
const inputs = [];
const transforms = [];
if (x || y || z) {
inputs.push([x || 0, y || 0, z || 0]);
transforms.push((xyz) => [
`translate3d(${xyz.map((v) => addUnit(v, "px")).join(",")})`,
// prettier-ignore
isValueIdentity(xyz, 0)
]);
}
eachProp(style, (value, key) => {
if (key === "transform") {
inputs.push([value || ""]);
transforms.push((transform) => [transform, transform === ""]);
} else if (domTransforms.test(key)) {
delete style[key];
if (is.und(value))
return;
const unit = pxTransforms.test(key) ? "px" : degTransforms.test(key) ? "deg" : "";
inputs.push(toArray(value));
transforms.push(
key === "rotate3d" ? ([x2, y2, z2, deg]) => [
`rotate3d(${x2},${y2},${z2},${addUnit(deg, unit)})`,
isValueIdentity(deg, 0)
] : (input) => [
`${key}(${input.map((v) => addUnit(v, unit)).join(",")})`,
isValueIdentity(input, key.startsWith("scale") ? 1 : 0)
]
);
}
});
if (inputs.length) {
style.transform = new FluidTransform(inputs, transforms);
}
super(style);
}
};
var FluidTransform = class extends FluidValue {
constructor(inputs, transforms) {
super();
this.inputs = inputs;
this.transforms = transforms;
this._value = null;
}
get() {
return this._value || (this._value = this._get());
}
_get() {
let transform = "";
let identity = true;
each(this.inputs, (input, i) => {
const arg1 = getFluidValue(input[0]);
const [t, id] = this.transforms[i](
is.arr(arg1) ? arg1 : input.map(getFluidValue)
);
transform += " " + t;
identity = identity && id;
});
return identity ? "none" : transform;
}
// Start observing our inputs once we have an observer.
observerAdded(count) {
if (count == 1)
each(
this.inputs,
(input) => each(
input,
(value) => hasFluidValue(value) && addFluidObserver(value, this)
)
);
}
// Stop observing our inputs once we have no observers.
observerRemoved(count) {
if (count == 0)
each(
this.inputs,
(input) => each(
input,
(value) => hasFluidValue(value) && removeFluidObserver(value, this)
)
);
}
eventObserved(event) {
if (event.type == "change") {
this._value = null;
}
callFluidObservers(this, event);
}
};
// src/primitives.ts
var primitives = [
"a",
"abbr",
"address",
"area",
"article",
"aside",
"audio",
"b",
"base",
"bdi",
"bdo",
"big",
"blockquote",
"body",
"br",
"button",
"canvas",
"caption",
"cite",
"code",
"col",
"colgroup",
"data",
"datalist",
"dd",
"del",
"details",
"dfn",
"dialog",
"div",
"dl",
"dt",
"em",
"embed",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hgroup",
"hr",
"html",
"i",
"iframe",
"img",
"input",
"ins",
"kbd",
"keygen",
"label",
"legend",
"li",
"link",
"main",
"map",
"mark",
"menu",
"menuitem",
"meta",
"meter",
"nav",
"noscript",
"object",
"ol",
"optgroup",
"option",
"output",
"p",
"param",
"picture",
"pre",
"progress",
"q",
"rp",
"rt",
"ruby",
"s",
"samp",
"script",
"section",
"select",
"small",
"source",
"span",
"strong",
"style",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"textarea",
"tfoot",
"th",
"thead",
"time",
"title",
"tr",
"track",
"u",
"ul",
"var",
"video",
"wbr",
// SVG
"circle",
"clipPath",
"defs",
"ellipse",
"foreignObject",
"g",
"image",
"line",
"linearGradient",
"mask",
"path",
"pattern",
"polygon",
"polyline",
"radialGradient",
"rect",
"stop",
"svg",
"text",
"tspan"
];
// src/index.ts
export * from "@react-spring/core";
Globals.assign({
batchedUpdates: unstable_batchedUpdates,
createStringInterpolator,
colors
});
var host = createHost(primitives, {
applyAnimatedValues,
createAnimatedStyle: (style) => new AnimatedStyle(style),
// eslint-disable-next-line @typescript-eslint/no-unused-vars
getComponentProps: ({ scrollTop, scrollLeft, ...props }) => props
});
var animated = host.animated;
export {
animated as a,
animated
};
//# sourceMappingURL=react-spring_web.modern.mjs.map
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/AlertInLine/styled-components.ts
import styled, { css } from "styled-components";
import { space } from "styled-system";
import { animated } from "@react-spring/web";
import type {
AlertInlineProps,
AlertInlineVariants,
AlertInlineTypes
} from "./types";
const alertInlineVariants = {
success: css`
background-color: var(--fd-colors-system-positive-background-subtle);
border-color: var(--fd-colors-system-positive-border-default);
`,
informational: css`
background-color: var(--fd-colors-system-info-background-subtle);
border-color: var(--fd-colors-system-info-border-default);
`,
error: css`
background-color: var(--fd-colors-system-important-background-subtle);
border-color: var(--fd-colors-system-important-border-default);
`,
warning: css`
background-color: var(--fd-colors-system-warning-background-subtle);
border-color: var(--fd-colors-system-warning-border-default);
`,
promo: css`
background-color: var(--fd-colors-system-alert-background-subtle);
border-color: var(--fd-colors-system-alert-border-default);
`
};
const alertInlineTypes = {
floating: css`
border-radius: 4px;
border-style: solid;
border-width: 1px;
`,
fixed: css`
border-radius: 0;
border-style: solid;
border-width: 1px 0;
`
};
export const AnimatedWrapper = styled(animated.div)`
width: 100%;
height: max-content;
`;
export const AlertInlineContainer = styled.div<
Pick<AlertInlineProps, "variant" | "type">
>`
box-sizing: content-box;
display: flex;
gap: 12px;
padding: 12px;
${({ type }) => alertInlineTypes[type as AlertInlineTypes]}
${({ variant }) => alertInlineVariants[variant as AlertInlineVariants]}
${space}
`;
export const AlertInlineInfo = styled.div<{ flexDirection: string }>`
display: flex;
flex-direction: ${({ flexDirection }) => flexDirection};
flex: 1;
gap: 4px;
justify-content: space-between;
`;
export const IconContainer = styled.div`
display: inline-flex;
align-items: center;
justify-content: center;
height: 18px;
flex-shrink: 0;
`;
export const AlertInlineCloseButton = styled.button`
background: transparent;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 18px;
height: 18px;
padding: 0;
cursor: pointer;
border: 0;
`;
export const Link = styled.a<{ color: string }>`
color: ${({ color }) => `var(${color})`};
cursor: pointer;
font-family: Roboto, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: 125%;
text-decoration: none;
display: flex;
flex-direction: row;
`;
export const LinkWrapper = styled.span`
display: flex;
flex-direction: row;
`;
export const TitleWrapper = styled.div`
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
gap: 12px;
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/AlertInLine/constants.ts
export const alertInlineContentMap = {
success: {
icon: {
name: "success",
lineColor: "--fd-colors-system-positive-content-accent",
backgroundColor: "transparent"
},
text: "--fd-colors-system-positive-content-on-subtle",
link: "--fd-colors-system-positive-link-on-subtle"
},
informational: {
icon: {
name: "info",
lineColor: "--fd-colors-system-info-content-accent",
backgroundColor: "transparent"
},
text: "--fd-colors-system-info-content-on-subtle",
link: "--fd-colors-system-info-link-on-subtle"
},
error: {
icon: {
name: "exclamation",
lineColor: "--fd-colors-system-important-content-accent",
backgroundColor: "transparent"
},
text: "--fd-colors-system-important-content-on-subtle",
link: "--fd-colors-system-important-link-on-subtle"
},
warning: {
icon: {
name: "warning",
lineColor: "--fd-colors-system-warning-content-accent",
backgroundColor: "transparent"
},
text: "--fd-colors-system-warning-content-on-subtle",
link: "--fd-colors-system-warning-link-on-subtle"
},
promo: {
icon: {
name: "promo",
lineColor: "--fd-colors-system-alert-content-accent",
backgroundColor: "transparent"
},
text: "--fd-colors-system-alert-content-on-subtle",
link: "--fd-colors-system-alert-link-on-subtle"
}
};
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/AlertInLine/index.tsx
/* eslint-disable react/no-danger */
import React, { memo, FC, useState, useCallback } from "react";
import { useSpring } from "@react-spring/web";
import { Icon } from "../Icon";
import {
AnimatedWrapper,
AlertInlineContainer,
AlertInlineInfo,
AlertInlineCloseButton,
Link,
LinkWrapper,
TitleWrapper,
IconContainer
} from "./styled-components";
import { IconNames } from "../Icon/types";
import type { AlertInlineProps, AlertInlineVariants } from "./types";
import { alertInlineContentMap } from "./constants";
import { Paragraph } from "../Typography";
export const AlertInLine: FC<AlertInlineProps> = memo(
({
variant,
title,
message = "",
hasDismissButton,
hasDismissAnimation,
onDismissPress,
type = "floating",
linkLabel,
onLinkClick,
linkExtraInfo = "",
qaLabel,
children,
...rest
}) => {
const [isVisible, setIsVisible] = useState(true);
const { name, lineColor, backgroundColor } =
alertInlineContentMap[variant as AlertInlineVariants].icon;
const [animatedStyle, api] = useSpring(() => ({
from: {
opacity: 1
}
}));
const handleDismiss = useCallback((e) => {
onDismissPress?.(e);
// We need to maintain this with js since it has interaction
// depending on the animation
if (hasDismissAnimation) {
api.start({
from: { opacity: 1 },
to: {
opacity: 0
},
onRest: () => {
setIsVisible(false);
}
});
} else {
setIsVisible(false);
}
}, []);
return isVisible ? (
<AnimatedWrapper style={{ ...animatedStyle }}>
<AlertInlineContainer
variant={variant}
type={type}
data-qa-label={qaLabel}
data-status={isVisible ? "visible" : "hidden"}
{...rest}
>
<IconContainer>
<Icon
name={name as IconNames}
lineColor={lineColor}
backgroundColor={backgroundColor}
size="s"
qaLabel={`alert-inline-icon-${name}`}
/>
</IconContainer>
<AlertInlineInfo flexDirection={title ? "column" : "row"}>
{title || message ? (
<TitleWrapper>
<Paragraph
qaLabel={
title ? "alert-inline-title" : "alert-inline-message"
}
color={
alertInlineContentMap[variant as AlertInlineVariants].text
}
fontSize="14px"
fontWeight={!title ? 400 : 500}
lineHeight="125%"
margin={0}
fontFamily={!title ? "regular" : "medium"}
>
<span
dangerouslySetInnerHTML={{
__html: title || message || ""
}}
/>
</Paragraph>
{(!message || !title) && linkLabel && (
<LinkWrapper>
<Link
role="link"
data-qa-label="alert-inline-link"
onClick={(e) => {
onLinkClick?.(e);
}}
color={
alertInlineContentMap[variant as AlertInlineVariants]
.link
}
>
{linkLabel}
</Link>
{linkExtraInfo.length ? (
<Paragraph
color={
alertInlineContentMap[variant as AlertInlineVariants]
.link
}
fontSize="14px"
fontWeight={400}
lineHeight="135%"
fontFamily="regular"
margin={0}
>
{linkExtraInfo}
</Paragraph>
) : (
<></>
)}
</LinkWrapper>
)}
</TitleWrapper>
) : null}
{((title && message) || children) && (
<Paragraph
qaLabel="alert-inline-message"
color={
alertInlineContentMap[variant as AlertInlineVariants].text
}
fontSize="14px"
fontWeight={400}
lineHeight="125%"
fontFamily="regular"
margin={0}
>
{children}
<span
dangerouslySetInnerHTML={{
__html: message
}}
/>
</Paragraph>
)}
{linkLabel && title && message && (
<LinkWrapper>
<Link
role="link"
data-qa-label="alert-inline-link"
onClick={(e) => {
onLinkClick?.(e);
}}
color={
alertInlineContentMap[variant as AlertInlineVariants].link
}
>
{linkLabel}
</Link>
{linkExtraInfo.length ? (
<Paragraph
color={
alertInlineContentMap[variant as AlertInlineVariants].link
}
fontSize="14px"
fontWeight={400}
lineHeight="135%"
fontFamily="regular"
margin={0}
>
{linkExtraInfo}
</Paragraph>
) : (
<></>
)}
</LinkWrapper>
)}
</AlertInlineInfo>
{hasDismissButton && (
<AlertInlineCloseButton
onClick={handleDismiss}
data-qa-label="alert-inline-close-button"
>
<Icon
name="close"
lineColor={
alertInlineContentMap[variant as AlertInlineVariants].text
}
backgroundColor="transparent"
size="s"
qaLabel="alert-inline-icon-close"
/>
</AlertInlineCloseButton>
)}
</AlertInlineContainer>
</AnimatedWrapper>
) : null;
}
);
export type { AlertInlineProps, AlertInlineVariants };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Modal/styled-components.ts
import styled, { css, keyframes } from "styled-components";
import { compose, space } from "styled-system";
import breakpoints from "../../../src/utils/breakpoints";
export const TOP_TRESHOLD = 40;
export const ANIMATION_DURATION = 400;
export const fadeIn = keyframes`
from { opacity: 0.5; }
to { opacity: 1; }
`;
const fadeOut = keyframes`
from {
opacity: 0.8;
}
to {
opacity: 0;
}
`;
const scaleUp = keyframes`
from {
transform: translate(-50%, 50%) scale(0.5);
opacity: 0.5;
}
to {
transform: translate(-50%, -50%) scale(1);
opacity: 1;
}
`;
const slideUp = keyframes`
from {
transform: translateY(100%);
opacity: 0.5;
}
to {
transform: translateY(0);
opacity: 1;
}
`;
const slideDown = keyframes`
from {
transform: translateY(0);
opacity: 1;
}
to {
transform: translateY(100%);
opacity: 0.5;
}
`;
const scaleDown = keyframes`
from {
transform: translate(-50%, -50%) scale(1);
opacity: 1;
}
to {
transform: translate(-50%, 50%) scale(0.5);
opacity: 0;
}
`;
const slideLeft = keyframes`
from { transform: translateX(-70%); }
to { transform: translateX(0); }
`;
const slideRight = keyframes`
from { transform: translateX(70%); }
to { transform: translateX(0); }
`;
const styles = compose(space);
export const Backdrop = styled.div`
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999;
&[data-hide-overlay="true"] {
background: inherit;
}
&[data-hide-overlay="false"] {
background: var(--fd-colors-core-black-tint-070);
}
&[data-closing="true"] {
${css`
animation: ${fadeOut} ${ANIMATION_DURATION}ms ease-out;
`};
opacity: 0;
pointer-events: none;
}
&[data-closing="false"] {
${css`
animation: ${fadeIn} ${ANIMATION_DURATION}ms ease-out;
`};
opacity: 1;
pointer-events: auto;
}
`;
export const ModalContainer = styled.div<{
maxHeight?: string;
hasMaxHeight?: boolean;
maxWidth?: string;
overrideInset?: number;
}>`
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
position: fixed;
background: var(--fd-colors-background-surface);
z-index: 999;
overflow: hidden;
@media screen and ${breakpoints.tablet.min.sm} {
height: ${({ hasMaxHeight, maxHeight }) =>
hasMaxHeight ? `${maxHeight} || 98vh` : "auto"};
max-height: ${({ maxHeight }) => maxHeight || "98vh"};
max-width: ${({ maxWidth }) => maxWidth || "375px"};
width: 90%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
transform-origin: center;
border-radius: 4px;
box-shadow: var(--fd-shadows-elevations-all-around-high);
&[data-closing="true"] {
${css`
animation: ${scaleDown} ${ANIMATION_DURATION}ms
cubic-bezier(0.25, 1, 0.5, 1);
`};
}
&[data-closing="false"] {
${css`
animation: ${scaleUp} ${ANIMATION_DURATION}ms
cubic-bezier(0.25, 1, 0.5, 1);
`};
}
}
@media screen and ${breakpoints.tablet.max.sm} {
bottom: 0;
left: 0;
width: 100%;
border-radius: 8px 8px 0 0;
box-shadow: var(--fd-shadows-elevations-top-low);
&[data-closing="true"] {
${css`
animation: ${slideDown} ${ANIMATION_DURATION}ms
cubic-bezier(0.25, 1, 0.5, 1);
`};
}
&[data-closing="false"] {
${css`
animation: ${slideUp} ${ANIMATION_DURATION}ms
cubic-bezier(0.25, 1, 0.5, 1);
`};
}
${({ hasMaxHeight, overrideInset, maxHeight }) =>
hasMaxHeight
? css`
height: calc(
${maxHeight || "100vh"} -
${overrideInset !== undefined ? overrideInset : TOP_TRESHOLD}px
);
${overrideInset === 0 && "border-radius: 0;"}
`
: css`
height: auto;
max-height: calc(
${maxHeight || "100vh"} -
${overrideInset !== undefined ? overrideInset : TOP_TRESHOLD}px
);
`}
}
`;
export const ModalHeader = styled.div`
font-size: 1.25rem;
font-weight: bold;
margin-bottom: 16px;
`;
export const ModalContent = styled.div<{
hasMaxHeight?: boolean;
hasPadding?: boolean;
}>`
display: flex;
flex-direction: column;
width: -webkit-fill-available;
@-moz-document url-prefix() {
width: 100%;
}
${({ hasPadding }) =>
hasPadding
? css`
padding: 12px;
`
: css`
padding: 0;
`}
${({ hasMaxHeight }) =>
hasMaxHeight
? css`
height: 100%;
flex: 1;
`
: css`
height: auto;
`}
${styles}
`;
export const ModalFooter = styled.div`
bottom: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
background: var(--fd-colors-background-surface);
padding: 0 12px 12px;
@media screen and ${breakpoints.tablet.max.sm} {
position: sticky;
}
`;
export const TopStickyArea = styled.div`
position: sticky;
top: 0;
z-index: 999;
width: 100%;
`;
export const ModalHeaderContainer = styled.div`
width: 100%;
overflow: hidden;
display: flex;
`;
export const PagesSlider = styled.div`
padding: 12px;
height: 100%;
overflow: hidden;
${styles}
&[data-slide="right"] {
${css`
animation: ${slideRight} ${ANIMATION_DURATION}ms forwards;
`};
}
&[data-slide="left"] {
${css`
animation: ${slideLeft} ${ANIMATION_DURATION}ms forwards;
`};
}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Scroll/styled-components.ts
import styled, { css } from "styled-components";
import {
layout,
space,
color,
margin,
padding,
width,
maxWidth,
height,
maxHeight
} from "styled-system";
import type { BorderToShow } from "./types";
const createBorder = (bordersToShow: BorderToShow) =>
Object.entries(bordersToShow).map(([key, value]) => {
if (value) {
return css`border-${key}: 1px solid var(--fd-colors-border-subtle);`;
}
return "";
});
export const ShadowWrapper = styled.div`
overflow: hidden;
&:not([data-scroll-position="top"])[data-hide-shadow="false"]::before {
content: "";
box-shadow: inset 3px 3px 3px rgba(17, 43, 68, 0.25);
display: flex;
height: 16px;
left: -6px;
pointer-events: none;
position: relative;
margin-bottom: -16px;
width: calc(100% - 10px);
z-index: 1000;
}
&:not([data-scroll-position="bottom"])[data-hide-shadow="false"]::after {
content: "";
box-shadow: inset 3px -3px 3px rgba(17, 43, 68, 0.25);
display: flex;
height: 16px;
left: -6px;
margin-top: -16px;
pointer-events: none;
width: calc(100% - 10px);
z-index: 1000;
position: relative;
}
${width}
${maxWidth}
${height}
${maxHeight}
${margin}
`;
export const ScrollContainer = styled.div<{
hasShadow: boolean;
borderToShow: BorderToShow;
}>`
overflow: auto;
overscroll-behavior: contain;
&::-webkit-scrollbar {
width: 16px;
${({ borderToShow }) => createBorder(borderToShow)}
}
&::-webkit-scrollbar-track {
background: transparent;
overflow: auto;
}
&::-webkit-scrollbar-thumb {
background: var(--fd-colors-component-data-input-icon-base);
border-radius: 16px;
border: 4px solid transparent;
background-clip: padding-box;
}
&::-webkit-scrollbar-thumb:hover {
background: var(--fd-colors-component-data-input-content-base);
border-radius: 16px;
border: 4px solid transparent;
background-clip: padding-box;
}
${color}
${({ hasShadow }) => (hasShadow ? padding : space)}
${layout}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Scroll/index.tsx
import React, {
useRef,
useLayoutEffect,
useState,
type FC,
useEffect,
Ref
} from "react";
import { ScrollContainer, ShadowWrapper } from "./styled-components";
import type { ScrollProps, BorderToShow } from "./types";
export const Scroll: FC<ScrollProps> = ({
children,
isDark = false,
qaLabel = "scroll",
showBorderTop = false,
showBorderRight = false,
showBorderBottom = false,
showBorderLeft = false,
hasShadow = false,
component = "div",
...props
}) => {
const [scrollPosition, setScrollPosition] = useState("top");
const [hideShadow, setHideShadow] = useState(false);
const scrollRef = useRef<HTMLDivElement>(null);
const borderToShow: BorderToShow = {
top: showBorderTop,
right: showBorderRight,
bottom: showBorderBottom,
left: showBorderLeft
};
useLayoutEffect(() => {
if (hasShadow && scrollRef.current) {
setHideShadow(
scrollRef.current?.clientHeight === scrollRef.current?.scrollHeight
);
scrollRef.current?.addEventListener("scroll", handleScroll);
return () => {
scrollRef.current?.removeEventListener("scroll", handleScroll);
};
}
return () => scrollRef.current?.removeEventListener("scroll", handleScroll);
}, [scrollRef, hasShadow]);
const handleScroll = () => {
if (scrollRef.current) {
if (props.onImperativeScroll) {
props.onImperativeScroll(
scrollRef.current as unknown as Ref<HTMLDivElement | null>
);
}
if (scrollRef.current?.scrollTop === 0) {
return setScrollPosition("top");
}
const differenceScroll =
scrollRef.current?.scrollTop +
scrollRef.current?.clientHeight -
scrollRef.current?.scrollHeight;
if (differenceScroll > -3 && differenceScroll < 3) {
return setScrollPosition("bottom");
}
return scrollPosition !== "middle" && setScrollPosition("middle");
}
return null;
};
useEffect(() => {
if (props.onRender && scrollRef) {
props.onRender(scrollRef);
}
}, [props?.onRender, scrollRef]);
return hasShadow ? (
<ShadowWrapper
data-scroll-position={scrollPosition}
data-hide-shadow={hideShadow}
data-qa-label={`${qaLabel}-shadow`}
{...props}
>
<ScrollContainer
ref={scrollRef}
data-mode={isDark ? "dark" : "light"}
data-qa-label={qaLabel}
borderToShow={borderToShow}
hasShadow={hasShadow}
as={component}
{...props}
>
{children}
</ScrollContainer>
</ShadowWrapper>
) : (
<ScrollContainer
ref={scrollRef}
data-mode={isDark ? "dark" : "light"}
data-qa-label={qaLabel}
borderToShow={borderToShow}
hasShadow={hasShadow}
as={component}
{...props}
>
{children}
</ScrollContainer>
);
};
export type { ScrollProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Modal/index.tsx
import React, { useEffect, useRef, useState } from "react";
import { createPortal } from "react-dom";
import { v4 as uuid } from "uuid";
import { useSelector } from "react-redux";
import { getAccountModalOpened } from "@urp/unified-modules/src/redux/selector/account";
import { PageHeader } from "../PageHeader";
import { AlertInLine } from "../AlertInLine";
import {
Backdrop,
ANIMATION_DURATION,
ModalContainer,
ModalContent,
ModalFooter,
TopStickyArea,
ModalHeaderContainer,
PagesSlider
} from "./styled-components";
import type { ModalProps } from "./types";
import { Scroll } from "../Scroll";
export const Modal = ({
isOpen,
headerProps,
customHeader,
alertProps = [],
onClose,
hasMaxHeight = false,
maxHeight,
hasPadding = true,
footerContent,
stickyAreaExtraContent,
onAfterClose,
qaLabel,
hideOverlayColor = false,
maxWidth,
hasPages = false,
hideHeader = false,
page,
overrideInset = undefined,
onOpen,
mode = "light",
children,
disableExitAnimation = false,
onScroll,
onRender,
disableBodyScroll = false,
...rest
}: ModalProps) => {
const portalRef = useRef<HTMLDivElement | null>(null);
const isAccountModalOpened = useSelector(getAccountModalOpened);
const stickyAreaRef = useRef<HTMLDivElement>(null);
const [isClosing, setIsClosing] = useState(false);
const [visible, setVisible] = useState(isOpen);
const [slideDirection, setSlideDirection] = useState<
"left" | "right" | "none"
>("none");
const prevPage = useRef<number | undefined>(undefined);
useEffect(() => {
let timer = 0;
if (isOpen) {
const portalElement = document.createElement("div");
const modalWrapper = document.getElementById("modals");
portalElement.id = `portal-${qaLabel || uuid()}`;
if (modalWrapper) {
modalWrapper.appendChild(portalElement);
} else {
document.body.appendChild(portalElement);
}
portalRef.current = portalElement;
document.body.style.overflow = "hidden";
if (onOpen) {
onOpen();
}
setIsClosing(false);
setVisible(true);
} else if (!disableExitAnimation && !isOpen && portalRef.current) {
setIsClosing(true);
document.body.style.overflow = "auto";
timer = setTimeout(() => {
setVisible(false);
setIsClosing(false);
if (portalRef.current) {
if (onAfterClose) onAfterClose();
document.getElementById(`portal-${qaLabel}`)?.remove();
portalRef.current.remove();
portalRef.current = null;
}
}, ANIMATION_DURATION - 20);
} else if (!isOpen && portalRef.current) {
setVisible(false);
document.body.style.overflow = "auto";
if (portalRef.current) {
if (onAfterClose) onAfterClose();
document.getElementById(`portal-${qaLabel}`)?.remove();
portalRef.current.remove();
portalRef.current = null;
}
}
return () => {
if (document.body) {
document.body.style.overflow = "auto";
}
return clearTimeout(timer);
};
}, [isOpen]);
useEffect(() => {
if (page !== undefined) {
if (prevPage.current !== page) {
if (prevPage.current !== undefined) {
setSlideDirection(prevPage.current > page ? "left" : "right");
setTimeout(() => {
setSlideDirection("none");
}, ANIMATION_DURATION + 10);
}
prevPage.current = page;
}
}
}, [page]);
useEffect(() => {
const portal = document.getElementById(`portal-${qaLabel}`);
if (portal) {
if (isAccountModalOpened) {
portal.style.visibility = "hidden";
}
if (!isAccountModalOpened) {
portal.style.visibility = "visible";
}
}
}, [isAccountModalOpened]);
if (!visible) return null;
const modalContent = (
<>
<Backdrop
onClick={onClose}
data-closing={isClosing}
data-hide-overlay={hideOverlayColor}
id={`backdrop-${qaLabel}`}
/>
<ModalContainer
id={qaLabel}
data-qa-label={qaLabel}
maxHeight={maxHeight}
maxWidth={maxWidth}
data-closing={isClosing}
hasMaxHeight={hasMaxHeight}
overrideInset={overrideInset}
>
{headerProps && !hideHeader ? (
<PageHeader {...headerProps} onClose={onClose} />
) : null}
{customHeader ? (
<ModalHeaderContainer data-qa-label="modalHeader">
{customHeader}
</ModalHeaderContainer>
) : null}
<TopStickyArea ref={stickyAreaRef}>
{alertProps?.length
? alertProps.map((props) => (
<AlertInLine
{...props}
onDismissPress={(e) => {
if (props.onDismissPress) {
props.onDismissPress(e);
}
}}
/>
))
: null}
{stickyAreaExtraContent}
</TopStickyArea>
{disableBodyScroll ? (
children
) : (
<Scroll
overflowY="auto"
overflowX={hasPages ? "hidden" : "auto"}
hasShadow
height="100%"
maxHeight={`calc(${(maxHeight && "100%") || "100vh"} - ${hideHeader || maxHeight ? "0" : "120px"})`}
isDark={mode === "dark"}
width="100%"
onImperativeScroll={onScroll}
onRender={onRender}
>
<ModalContent
padding={hasPages && 0}
hasMaxHeight={hasMaxHeight}
hasPadding={hasPadding}
{...rest}
>
{hasPages ? (
<PagesSlider data-slide={slideDirection}>
{children}
</PagesSlider>
) : (
children
)}
</ModalContent>
</Scroll>
)}
{footerContent && <ModalFooter>{footerContent}</ModalFooter>}
</ModalContainer>
</>
);
if (
typeof process !== "undefined" &&
process?.env?.JEST_WORKER_ID !== undefined
)
return modalContent;
if (portalRef.current) {
return createPortal(modalContent, portalRef.current);
}
return null;
};
export type { ModalProps };
webpack://frontend-tpt/../../packages/tvg-comp-inline-past-performance/src/components/TagList/styled-components.ts
import styled from "styled-components";
export const Container = styled.div`
display: flex;
flex-direction: column;
`;
export const TitleElement = styled.h4`
color: ${({ theme }) => theme.colorTokens.content.default};
font-family: ${({ theme }) => theme.fonts.medium};
font-style: normal;
font-weight: 500;
line-height: 19px;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin: 0;
`;
export const Separator = styled.div`
&::before {
margin: 12px -12px 16px 0;
content: " ";
display: block;
border-bottom: 1px solid ${({ theme }) => theme.colorTokens.border.default};
}
`;
export const Description = styled.div`
color: ${({ theme }) => theme.colorTokens.content.subtle};
font-size: 14px;
margin-top: 6px;
& * {
font-family: ${({ theme }) => theme.fonts.regular};
line-height: 18px;
}
& ol,
ul {
margin-top: 8px;
}
& li {
margin-left: 16px;
list-style-type: disc;
}
`;
webpack://frontend-tpt/../../packages/tvg-comp-inline-past-performance/src/components/TagList/index.tsx
import React, { Fragment, ReactNode } from "react";
import { Tag } from "@tvg/design-system/src/components/tag";
import { TagProps as TagFlowType } from "@tvg/design-system/src/components/tag/types";
import {
Container,
TitleElement,
Description,
Separator
} from "./styled-components";
type Props = {
title?: string | ReactNode;
tags: TagFlowType[];
qaLabel: string;
};
const TagList = (props: Props) => (
<Container data-qa-label={props.qaLabel}>
{props.title && <TitleElement>{props.title}</TitleElement>}
{props.tags.map((tag: TagFlowType) => {
const key = `tag-${tag.label.replace(/ /g, "-")}`;
return (
<Fragment key={key}>
<Separator />
<Tag qaLabel={key} {...tag} />
<Description
data-qa-label={`${key}-description`}
dangerouslySetInnerHTML={{ __html: tag.description || "" }}
/>
</Fragment>
);
})}
</Container>
);
TagList.defaultProps = {
title: "",
tags: [],
qaLabel: "tagList"
};
export default TagList;
webpack://frontend-tpt/../../packages/tvg-comp-inline-past-performance/src/components/RunnerFlags/styled-components.ts
import styled, { css } from "styled-components";
export const RunnerFlagsWrapper = styled.ul`
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
& .runner-flag {
margin-right: 8px;
&:last-of-type {
margin-right: 0;
}
}
`;
export const ContentWrapper = styled.div<{ hasSeparator: boolean }>`
background-color: ${({ theme }) => theme.colorTokens.content.onDark};
padding: 12px;
${({ hasSeparator, theme }) =>
hasSeparator
? css`
border-top: 10px solid ${theme.colorTokens.border.default};
`
: css`
border-bottom: 1px solid ${theme.colorTokens.border.default};
`}
`;
export const IconWrapper = styled.span`
margin-left: 4px;
height: 24px;
width: 24px;
display: flex;
justify-content: center;
align-items: center;
`;
export const RunnerNumberContainer = styled.div`
display: inline-block;
min-width: 20px;
height: 20px;
margin-right: 4px;
`;
webpack://frontend-tpt/../../packages/tvg-comp-inline-past-performance/src/components/RunnerFlags/index.tsx
import React, { ReactNode, useEffect, useState } from "react";
import { get, uniqWith } from "lodash";
import { UnaryFn } from "@tvg/ts-types/Functional";
import { RunnerFlags as RunnerFlagsType } from "@tvg/ts-types/Race";
import { replaceCAPIVariables } from "@tvg/utils/capiUtils";
import { useColorTokens, Icon, Tag, TagProps } from "@tvg/design-system";
import { Modal, Saddle } from "@tvg/design-system/web";
import TagList from "../TagList";
import {
RunnerFlagsWrapper,
ContentWrapper,
IconWrapper,
RunnerNumberContainer
} from "./styled-components";
type FlagConfig = {
id: string;
name: string;
description: string;
isCondensed: boolean;
};
export type HandicappingRunnerFlags = {
title: string;
subtitle: string;
subtitleRunnerFlags: string;
flags: Array<FlagConfig>;
};
type Props = {
runnerId: string;
runnerName: string;
flags: RunnerFlagsType;
maxFlags?: number;
handicappingRunnerFlags: HandicappingRunnerFlags;
helpShown: boolean;
};
const mapToTag = (flag: FlagConfig): TagProps => ({
label: flag.name,
description: flag.description,
icon: undefined,
qaLabel: `flag-${flag.id}`,
variant: "warning",
size: "l"
});
const renderContentWrapper = (
title: string | ReactNode,
flags: Array<FlagConfig>,
hasSeparator = false
) => (
<ContentWrapper hasSeparator={hasSeparator}>
<TagList title={title} tags={flags.map((flag) => mapToTag(flag))} />
</ContentWrapper>
);
const getRunnerTitle = (
titleTemplate: string,
runnerId: string,
runnerName: string
) => (
<>
{replaceCAPIVariables(titleTemplate, {
runnerName: ""
})}
<RunnerNumberContainer>
<Saddle
size="s"
number={runnerId}
qaLabel={`saddle-container-${runnerId}`}
/>
</RunnerNumberContainer>
{runnerName}
</>
);
const renderFlagsHelpContent = (
runnerId: string,
runnerName: string,
handicappingRunnerFlags: HandicappingRunnerFlags,
runnerFlags: string[] = []
) => {
const flagsUniq = uniqWith(
handicappingRunnerFlags.flags,
(flagCfgA, flagCfgB) => flagCfgA.name === flagCfgB.name
);
// runner flags config
const RunnerFlagsTitle = getRunnerTitle(
handicappingRunnerFlags.subtitleRunnerFlags,
runnerId,
runnerName
);
const runnerFlagsConfig =
runnerFlags && runnerFlags.length > 0
? flagsUniq.filter((handicappingFlag) =>
runnerFlags.includes(handicappingFlag.id)
)
: [];
// other flags config
const hasSeparator = true;
const otherFlagsTitle = handicappingRunnerFlags.subtitle;
const otherFlagsConfig = flagsUniq.filter(
(handicappingFlag) => !runnerFlags.includes(handicappingFlag.id)
);
return (
<>
{runnerFlagsConfig.length > 0 &&
renderContentWrapper(RunnerFlagsTitle, runnerFlagsConfig)}
{renderContentWrapper(otherFlagsTitle, otherFlagsConfig, hasSeparator)}
</>
);
};
const renderFlagsHelpModal = (
runnerId: string,
runnerName: string,
handicappingRunnerFlags: HandicappingRunnerFlags,
flagsList: string[],
isModalOpen: boolean,
setIsModalOpen: UnaryFn<boolean, void>
) => {
const modalProps = {
isOpen: isModalOpen,
headerProps: {
title: handicappingRunnerFlags.title,
showCloseButton: true,
showBackButton: true,
onBack: () => {
setIsModalOpen(false);
}
},
onClose: () => {
setIsModalOpen(false);
},
padding: "0px",
hasMaxHeight: true
};
return (
<Modal {...modalProps}>
{renderFlagsHelpContent(
runnerId,
runnerName,
handicappingRunnerFlags,
flagsList
)}
</Modal>
);
};
const RunnerFlags = (props: Props) => {
const {
runnerId,
runnerName,
flags,
maxFlags,
handicappingRunnerFlags,
helpShown
} = props;
const [isModalOpen, setIsModalOpen] = useState(false);
const [flagsList, setFlagsList] = useState<string[]>([]);
const colorTokens = useColorTokens();
useEffect(() => {
setFlagsList(
Object.keys(flags).filter(
(flag) => flags[flag as keyof RunnerFlagsType] && flag !== "__typename"
)
);
}, [runnerName, flags]);
const getFlagConfig = (flag: string) =>
get(handicappingRunnerFlags, "flags", []).find(
(flagConfig) => flagConfig.id === flag
) || { id: flag, name: flag, description: flag, isCondensed: true };
return flagsList.length > 0 ? (
<>
<RunnerFlagsWrapper>
{flagsList.slice(0, maxFlags || flagsList.length).map((flag) => (
<Tag key={flag} {...mapToTag(getFlagConfig(flag))} />
))}
{helpShown && !!handicappingRunnerFlags && (
<IconWrapper onClick={() => setIsModalOpen(true)}>
<Icon
name="support"
lineColor={colorTokens.content.link}
size="m"
backgroundColor={colorTokens.background.infoSubtle}
/>
</IconWrapper>
)}
</RunnerFlagsWrapper>
{renderFlagsHelpModal(
runnerId,
runnerName,
handicappingRunnerFlags,
flagsList,
isModalOpen,
setIsModalOpen
)}
</>
) : null;
};
RunnerFlags.defaultProps = {
runnerId: "",
runnerName: "",
flags: {
horseInFocus: false,
warningHorse: false,
jockeyUplift: false,
trainerUplift: false,
horsesForCoursePos: false,
horsesForCourseNeg: false,
hotTrainer: false,
coldTrainer: false,
highestLastSpeedRating: false,
sectionalFlag: false,
significantImprover: false,
jockeyInForm: false,
clearTopRated: false,
interestingJockeyBooking: false,
firstTimeBlinkers: false
},
maxFlags: null,
handicappingRunnerFlags: {
title: "",
subtitle: "",
subtitleRunnerFlags: "",
flags: []
},
helpShown: false
};
export default RunnerFlags;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TrackMasterPickTag/styled-components.js
import styled, { css } from "styled-components";
import { fontCondensedNormal } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
const TagWrapper = styled.span`
display: flex;
flex-direction: row;
font-weight: 500;
align-items: center;
justify-content: flex-start;
font-size: 12px;
font-family: ${fontCondensedNormal};
${(props) =>
props.labelDarker
? css`
margin-bottom: 4px;
color: ${buildColor("grey", "800")};
`
: css`
margin-top: 4px;
margin-bottom: 4px;
color: ${buildColor("grey", "800")};
`}
${(props) =>
props.isScratched
? css`
opacity: 0.5;
`
: css`
opacity: 1;
`}
& svg {
margin-right: 4px;
fill: ${buildColor("grey", "800")};
}
`;
export default TagWrapper;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TrackMasterPickTag/RacingAndSportsIcon.jsx
import React from "react";
const RacingAndSportsIcon = () => (
<svg
height="16"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 226.3 119.87"
data-qa-label="racingAndSportsIcon"
>
<path
fill="#b1b235"
d="M197.05,42.89c-.22-1.54-.66-2.64-1.54-3.74-.66-.88-1.54-1.76-2.64-2.2-1.98-1.1-4.4-1.54-7.26-1.54-3.08,0-5.5,.44-6.82,1.32s-2.2,1.98-2.2,3.74c0,1.54,.66,2.86,2.2,3.96s3.3,1.98,5.72,2.86c2.42,.88,5.06,1.54,7.92,2.2,2.86,.66,5.94,1.54,9.02,2.42s6.16,1.98,9.02,3.08c2.86,1.32,5.5,2.86,7.92,4.84,2.42,1.98,4.18,4.4,5.72,7.04,1.54,2.86,2.2,6.16,2.2,10.12,0,5.06-1.1,9.46-3.08,13.2-1.98,3.74-4.84,6.82-8.36,9.24-3.52,2.42-7.92,4.18-12.76,5.5-5.06,1.32-10.34,1.76-16.28,1.76s-10.78-.88-15.4-2.42c-4.62-1.54-8.58-3.74-11.88-6.38-3.3-2.64-5.94-5.72-7.7-9.24-1.98-3.52-2.86-7.26-3.08-11h27.05c.66,3.08,2.2,5.28,4.62,6.82,1.1,.66,2.42,1.32,3.74,1.54,1.54,.44,2.86,.44,4.18,.44,3.52,0,6.38-.44,8.58-1.54s3.08-2.64,3.08-4.84-1.32-3.74-3.74-5.06c-2.42-1.1-5.5-2.2-9.24-3.08-3.74-.88-7.7-1.98-12.1-3.08-4.4-1.1-8.36-2.64-12.1-4.62-3.74-1.98-6.82-4.62-9.24-8.14-2.42-3.3-3.74-7.7-3.74-13.42,0-4.62,.88-8.58,2.86-12.1s4.4-6.38,7.7-8.58c3.3-2.2,7.26-3.96,11.88-5.06s9.46-1.76,14.96-1.76c5.94,0,11.22,.66,15.62,2.2,4.4,1.54,8.14,3.3,11,5.94,3.08,2.42,5.28,5.28,7.04,8.8,1.76,3.3,2.86,6.82,3.3,10.56h-26.17v.22Z"
/>
<g>
<polygon
fill="#b1b235"
points="96.93 45.53 96.93 56.3 112.77 56.3 96.93 69.06 96.93 80.5 131.68 80.5 131.68 69.06 116.06 69.06 131.68 56.52 131.68 45.53 96.93 45.53"
/>
<path
fill="#b1b235"
d="M96.93,86v18.25s.88,15.62,17.38,15.62,17.38-15.62,17.38-15.62v-18.25h-34.75Zm24.85,16.06s-.66,6.82-7.48,6.82-7.48-6.82-7.48-6.82v-4.62h14.96v4.62h0Z"
/>
<path
fill="#b1b235"
d="M96.93,0V13.2l3.96,1.76v13.2l-3.96,1.98v12.32l34.75-14.52V15.62L96.93,0Zm12.76,24.41v-6.6l9.9,3.3-9.9,3.3Z"
/>
</g>
<path
fill="#004693"
d="M83.14,44.87c.44-18.69-18.91-24.19-27.71-24.19H13.64L0,106.23H23.53l5.28-31.23h7.48l13.2,31.23h26.17l-15.62-32.77s22.65-8.36,23.09-28.59Zm-28.37,10.34c-2.2,1.98-3.96,2.86-6.82,2.86H31.45l3.08-18.91h11.44c2.86,0,6.16-.66,8.8,1.1,2.42,1.54,3.52,4.62,3.52,7.26,0,3.3-1.32,5.94-3.52,7.7Z"
/>
</svg>
);
export default RacingAndSportsIcon;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TrackMasterPickTag/index.jsx
import React, { PureComponent } from "react";
import {
TRACK_DATA_SOURCE_GSA,
TRACK_DATA_SOURCE_RAS,
TRACK_DATA_SOURCE_SRW
} from "@tvg/utils/trackMasterPicksUtils";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import {
trackMasterPick,
timeformPick,
srwPick,
numberFirePick
} from "../../_static/Icons/icons";
import TagWrapper from "./styled-components";
import RacingAndSportsIcon from "./RacingAndSportsIcon";
export default class TrackMasterPickTag extends PureComponent {
static defaultProps = {
pickNumber: -1,
labelDarker: false,
isScratched: false,
trackDataSource: "",
isNumberFirePick: false
};
getIcon = (trackDataSource, isNumberFirePick) => {
if (isNumberFirePick) return numberFirePick;
switch (trackDataSource) {
case TRACK_DATA_SOURCE_GSA:
return timeformPick;
case TRACK_DATA_SOURCE_SRW:
return srwPick;
default:
return trackMasterPick;
}
};
render() {
const {
pickNumber,
labelDarker,
isScratched,
trackDataSource,
isNumberFirePick
} = this.props;
let message = "";
const color = labelDarker
? buildColor("grey", "900")
: buildColor("grey", "800");
const svgIcon = this.getIcon(trackDataSource, isNumberFirePick);
switch (pickNumber) {
case 1:
message = "1ST PICK";
break;
case 2:
message = "2ND PICK";
break;
case 3:
message = "3RD PICK";
break;
default:
return "";
}
return (
<TagWrapper labelDarker={labelDarker} isScratched={isScratched}>
{trackDataSource === TRACK_DATA_SOURCE_RAS && <RacingAndSportsIcon />}
{trackDataSource !== TRACK_DATA_SOURCE_RAS && (
<Icon size={16} icon={svgIcon} color={color} />
)}
{message}
</TagWrapper>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-utils/trackMasterPicksUtils.js
import { isNull, get, sortBy, flatMap } from "lodash";
export const TALENT_PICKS = "talentpicks";
export const TRACKMASTER_PICKS = "trackmasterpicks";
export const TIMEFORM_PICKS = "timeformpicks";
export const HANDICAPPING_STORE = "handicappingStore";
export const RACING_AND_SPORTS = "racingAndSports";
export const TRACK_DATA_SOURCE_USGSA = "USGSA";
export const TRACK_DATA_SOURCE_GSA = "GSA";
export const TRACK_DATA_SOURCE_SRW = "SRW";
export const TRACK_DATA_SOURCE_EQB = "EQB";
export const TRACK_DATA_SOURCE_RAS = "RAS";
const getOddsInfo = (bettingInterestRunnerInfo) => {
const currentOddsNumerator =
get(bettingInterestRunnerInfo, "currentOdds.numerator") || "";
const currentOddsDenominator =
get(bettingInterestRunnerInfo, "currentOdds.denominator") || "";
const mlOddsNumerator =
get(bettingInterestRunnerInfo, "morningLineOdds.numerator") || "";
const mlOddsDenominator =
get(bettingInterestRunnerInfo, "morningLineOdds.denominator") || "";
const isMorningLine =
currentOddsNumerator === "" && currentOddsDenominator === "";
return {
currentOddsNumerator: isMorningLine
? mlOddsNumerator
: currentOddsNumerator,
currentOddsDenominator: isMorningLine
? mlOddsDenominator
: currentOddsDenominator,
isMorningLine
};
};
const hasInfo = (freePicks) =>
!!freePicks && !isNull(freePicks.number) && !isNull(freePicks.info);
const getPickInfo = (bettingInterestData, picksType = TRACKMASTER_PICKS) => {
const returnPicksInfo = [];
bettingInterestData.runners.forEach((runner) => {
const pickInfo =
picksType === TIMEFORM_PICKS
? get(runner, "timeform.freePick")
: get(runner, "handicapping.freePick");
if (hasInfo(pickInfo)) {
returnPicksInfo.push({
runnerInfo: runner,
pickInfo
});
}
});
return returnPicksInfo;
};
const hasPicksInfo = (bettingInterestData, picksType = TRACKMASTER_PICKS) =>
bettingInterestData.runners &&
bettingInterestData.runners.some((runner) =>
hasInfo(
picksType === TIMEFORM_PICKS
? get(runner, "timeform.freePick")
: get(runner, "handicapping.freePick")
)
);
const processBettingInterests = (
raceData = [],
raceTypeCode = "T",
picksType = TRACKMASTER_PICKS
) =>
raceData
.filter((bettingInterestData) =>
hasPicksInfo(bettingInterestData, picksType)
)
.map((bettingInterestData) => {
const runnerAndPicksInfoStruct =
getPickInfo(bettingInterestData, picksType) || [];
const runnerOddsInfo = getOddsInfo(bettingInterestData);
return runnerAndPicksInfoStruct.map((runnerAndPicksInfo) => ({
info: runnerAndPicksInfo.pickInfo.info,
number: runnerAndPicksInfo.pickInfo.number,
horseName: runnerAndPicksInfo.runnerInfo.horseName,
runnerId: runnerAndPicksInfo.runnerInfo.runnerId,
raceTypeCode,
scratched: runnerAndPicksInfo.runnerInfo.scratched,
isMorningLine: runnerOddsInfo.isMorningLine,
currentOddsNumerator: runnerOddsInfo.currentOddsNumerator,
currentOddsDenominator: runnerOddsInfo.currentOddsDenominator
}));
});
const prepDataForPicks = (
bettingInsterestData,
raceTypeCode,
picksType = TRACKMASTER_PICKS
) =>
sortBy(
flatMap(
processBettingInterests(bettingInsterestData, raceTypeCode, picksType)
),
["number"]
);
export const filterPicksBettingInterests = (
raceData,
picksType = TRACKMASTER_PICKS
) => {
const biWithPicks = [];
if (!!raceData && raceData.length > 0) {
raceData
.filter((bettingInterestData) =>
hasPicksInfo(bettingInterestData, picksType)
)
.forEach((bi) => {
bi.runners.forEach((runner) => {
const freePick =
picksType === TIMEFORM_PICKS
? get(runner, "timeform.freePick")
: get(runner, "handicapping.freePick");
if (hasInfo(freePick)) {
biWithPicks[get(freePick, "number", 0) - 1] = {
biNumber: bi.biNumber,
currentOdds: bi.currentOdds,
morningLineOdds: bi.morningLineOdds,
isFavorite: bi.isFavorite,
runners: [
{
horseName: get(runner, "horseName"),
runnerId: get(runner, "runnerId"),
scratched: get(runner, "scratched"),
masterPickNumber: get(freePick, "number"),
masterPickInfo: get(freePick, "info", "") || ""
}
]
};
}
});
});
}
return biWithPicks;
};
export const getTrackDataSourceTitle = (trackDataFromTimeform, withPicks) => {
let title = "Trackmaster";
if (trackDataFromTimeform === TRACK_DATA_SOURCE_GSA) {
title = "Timeform 1-2-3";
} else if (trackDataFromTimeform === TRACK_DATA_SOURCE_SRW) {
title = "Free";
}
return `${title}${withPicks ? " Picks" : ""}`;
};
export default prepDataForPicks;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RunnerBio/styled-components.js
import styled from "styled-components";
import { ellipsis } from "polished";
import { fontBold } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const BioWrapper = styled.dl`
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
padding: 8px 8px 4px;
margin: 0;
position: relative;
`;
export const BioTitle = styled.dt.attrs((props) => ({
title: props.runnerName,
"data-qa-label": "runnerBio-title"
}))`
text-transform: uppercase;
font-size: 14px;
font-family: ${fontBold};
font-weight: 500;
min-height: 16px;
margin-bottom: 2px;
letter-spacing: 0;
${ellipsis()};
color: ${buildColor("grey", "900")};
text-decoration: ${(props) => (props.isScratched ? "line-through" : "")};
opacity: ${(props) => (props.isScratched ? 0.5 : 1)};
& svg {
padding-right: 4px;
}
`;
export const BioDescription = styled.dd`
font-size: 12px;
color: ${buildColor("grey", "800")};
margin: 0;
max-width: 100%;
min-height: 14px;
letter-spacing: 0;
opacity: ${(props) => props.isScratched && 0.5};
& > :not(:last-child) {
margin-right: 8px;
padding-right: 8px;
}
`;
export const Results = styled.dt`
position: absolute;
top: 8px;
right: 0;
display: flex;
font-size: 12px;
line-height: 1.6;
`;
export const ResultsDistance = styled.strong`
width: 70px;
text-align: right;
`;
export const ResultsOdds = styled.span`
width: 44px;
text-align: right;
padding-left: 16px;
`;
export const FlagsAndPick = styled.div`
display: flex;
flex-wrap: wrap;
width: 100%;
margin-top: 4px;
> span {
margin-right: 8px;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RunnerBio/index.jsx
import React, { PureComponent } from "react";
import { get } from "lodash";
import SimpleInlineInfo from "@tvg/ipp/src/components/SimpleInlineInfo";
import RunnerFlags from "@tvg/ipp/src/components/RunnerFlags";
import InlineInfo from "../../_atom/InlineInfo";
import Icon from "../../_static/Icons";
import { star } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import TrackMasterPickTag from "../TrackMasterPickTag";
import {
BioWrapper,
BioTitle,
BioDescription,
Results,
ResultsDistance,
ResultsOdds,
FlagsAndPick
} from "./styled-components";
export default class RunnerBio extends PureComponent {
static defaultProps = {
raceTypeCode: "T",
runnerName: "",
handicappingData: [],
isScratched: false,
firstHandicapBold: false,
showFavorite: false,
isFavorite: false,
runnerMasterPickNumber: -1,
isRunnerTrackMasterPick: false,
isRunnerNumberFirePick: false,
resultsData: null,
hasJockeyChanges: false,
handicappingSortMode: "saddlecloth",
hasTrackMasterInfo: true,
trackDataSource: "",
runnerData: null,
showFlags: true,
handicappingRunnerFlags: {
title: "",
subtitle: "",
subtitleRunnerFlags: "",
flags: []
}
};
renderOdds = () => {
const odds = get(this.props.resultsData, "odds");
if (!!odds && !!odds.numerator) {
return `${odds.numerator}${
odds.denominator ? `/${odds.denominator}` : ""
}`;
}
return "n/a";
};
renderRunnerFlags = () => {
const flagsObg = get(this.props.runnerData, "timeform.flags", {});
const hasFlags = Object.keys(flagsObg).some((flag) => flagsObg[flag]);
return (
hasFlags &&
this.props.showFlags && (
<RunnerFlags
flags={flagsObg}
maxFlags={2}
handicappingRunnerFlags={this.props.handicappingRunnerFlags}
/>
)
);
};
render() {
const flagsObg = get(this.props.runnerData, "timeform.flags", {});
const hasFlags = Object.keys(flagsObg).some((flag) => flagsObg[flag]);
const hasPicksOrFlags =
(hasFlags && this.props.showFlags) || this.props.hasTrackMasterInfo;
return (
<BioWrapper>
{(this.props.isRunnerTrackMasterPick ||
this.props.isRunnerNumberFirePick) && (
<TrackMasterPickTag
pickNumber={this.props.runnerMasterPickNumber}
labelDarker={this.props.isRunnerTrackMasterPick}
isScratched={this.props.isScratched}
trackDataSource={this.props.trackDataSource}
isNumberFirePick={this.props.isRunnerNumberFirePick}
/>
)}
<BioTitle
runnerName={this.props.runnerName}
isScratched={this.props.isScratched}
>
{this.props.showFavorite && (
<Icon
icon={star}
size={14}
color={
!this.props.isFavorite
? buildColor("grey", "100")
: buildColor("yellow", "500")
}
/>
)}
{this.props.runnerName}
</BioTitle>
{!!this.props.resultsData && (
<Results>
<ResultsDistance>
{this.props.resultsData.accBeatenDistance}
</ResultsDistance>
<ResultsOdds>{this.renderOdds()}</ResultsOdds>
</Results>
)}
<BioDescription isScratched={this.props.isScratched}>
{this.props.handicappingData.length > 0 &&
(this.props.hasTrackMasterInfo ? (
<InlineInfo
isFirstBold={this.props.firstHandicapBold}
info={this.props.handicappingData}
hasJockeyChanges={this.props.hasJockeyChanges}
isScratched={this.props.isScratched}
showHandicappingSortMode={this.props.raceTypeCode !== "G"}
handicappingSortMode={this.props.handicappingSortMode}
/>
) : (
<SimpleInlineInfo info={this.props.handicappingData} />
))}
</BioDescription>
{hasPicksOrFlags && (
<FlagsAndPick>
{!this.props.isRunnerTrackMasterPick &&
!this.props.isRunnerNumberFirePick &&
this.props.hasTrackMasterInfo && (
<TrackMasterPickTag
pickNumber={this.props.runnerMasterPickNumber}
labelDarker={this.props.isRunnerTrackMasterPick}
trackDataSource={this.props.trackDataSource}
/>
)}
{hasFlags && this.props.showFlags && (
<RunnerFlags
flags={flagsObg}
maxFlags={2}
handicappingRunnerFlags={this.props.handicappingRunnerFlags}
/>
)}
</FlagsAndPick>
)}
</BioWrapper>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/SelectionButton/styled-components.js
import styled, { css } from "styled-components";
import Icon from "../../_static/Icons";
import buildColor from "../../_static/ColorPalette";
import ButtonDefault from "../Buttons/default";
import { generateTransition, cubic } from "../../_static/Transitions";
export const Selection = styled(ButtonDefault)`
width: ${(props) => props.width};
height: ${(props) => props.height};
position: relative;
background-color: ${buildColor("white", "0")};
`;
export const IconsWrapper = styled.span`
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
`;
export const Circle = styled.span`
display: inline-flex;
width: 24px;
height: 24px;
border: 2px solid ${buildColor("green", "600")};
border-radius: 50%;
align-items: center;
justify-content: center;
background-color: ${buildColor("white", "100")};
will-change: transform;
transition: ${generateTransition(cubic, "transform")};
transform: ${(props) => (props.checked ? "scale(0)" : "scale(1)")};
position: relative;
line-height: 24px;
font-size: 12px;
font-weight: bold;
color: ${(props) =>
!props.checked ? buildColor("green", "600") : buildColor("white", "100")};
${({ hasHover }) =>
hasHover &&
css`
&:hover {
background-color: ${buildColor("green", "000")};
}
`}
`;
export const CircleChecked = styled(Circle)`
position: absolute;
background-color: ${buildColor("green", "600")};
transform: ${(props) => (props.checked ? "scale(1)" : "scale(0)")};
`;
export const NumberIcon = styled(Icon)`
position: absolute;
border: 1px solid
${(props) =>
!props.checked ? buildColor("green", "600") : buildColor("white", "100")};
border-radius: 50%;
top: -2px;
right: -7px;
background: ${(props) =>
!props.checked ? buildColor("white", "100") : buildColor("green", "600")};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/SelectionButton/index.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import { add, tick, key } from "../../_static/Icons/icons";
import {
Selection,
Circle,
CircleChecked,
NumberIcon,
IconsWrapper
} from "./styled-components";
const onChangeFunc = (e, isScratched, onChange, redirectToRacecard) => {
if (!redirectToRacecard) {
e.preventDefault();
e.stopPropagation();
}
if (!isScratched) {
onChange();
}
};
const getIcon = (selectionType, isChecked, color) => {
switch (selectionType) {
case "number":
return (
<NumberIcon
icon={!isChecked ? add : tick}
color={color}
size={10}
checked={isChecked}
/>
);
case "key":
return <Icon icon={key} color={color} />;
default:
return <Icon icon={!isChecked ? add : tick} color={color} />;
}
};
const getSelectionButtonQAPrefix = (isChecked, isScratched, selectionType) => {
if (isScratched) {
return "scratched";
}
if (selectionType === "key") {
if (isChecked) {
return "key-checked";
}
return "key";
}
if (isChecked) {
return "checked";
}
return null;
};
export default class SelectionButton extends PureComponent {
static defaultProps = {
selectionKey: "",
width: "48px",
height: "100%",
selectionType: "default",
number: 0,
isChecked: false,
isScratched: false,
onChange: noop,
hasHover: false,
redirectToRacecard: false
};
render() {
return (
<Selection
width={this.props.width}
height={this.props.height}
onClick={(e) =>
onChangeFunc(
e,
this.props.isScratched,
this.props.onChange,
this.props.redirectToRacecard
)
}
qaLabel="selectionButton"
>
<IconsWrapper
data-qa-label={getSelectionButtonQAPrefix(
this.props.isChecked,
this.props.isScratched,
this.props.selectionType
)}
>
{!this.props.isScratched && [
<CircleChecked key="selected" checked={this.props.isChecked}>
{this.props.selectionType === "number" && this.props.number}
{getIcon(
this.props.selectionType,
this.props.isChecked,
buildColor("white", "100")
)}
</CircleChecked>,
<Circle
key="unselected"
checked={this.props.isChecked}
hasHover={this.props.hasHover}
>
{this.props.selectionType === "number" && this.props.number}
{getIcon(
this.props.selectionType,
this.props.isChecked,
buildColor("green", "600")
)}
</Circle>
]}
</IconsWrapper>
</Selection>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RunnerLine/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import { generateTransition, easeInOut } from "../../_static/Transitions";
export const RunnerWrapper = styled.tr`
background-color: ${buildColor("white", "100")};
${(props) =>
props.leg
? css`
border-top: 1px solid ${buildColor("blue", "100")};
border-bottom: 1px solid ${buildColor("blue", "100")};
border-left: 1px solid ${buildColor("grey", "300")};
border-right: 1px solid ${buildColor("grey", "300")};
`
: css`
border-top: 1px solid ${buildColor("blue", "100")};
border-bottom: 1px solid ${buildColor("blue", "100")};
`};
&:active {
${(props) =>
props.showActiveState &&
`background-color: ${buildColor("blue", "000")}`};
}
`;
export const AnimateContainer = styled.div`
max-height: 0;
overflow: hidden;
transition: ${generateTransition(easeInOut, "max-height")};
`;
export const SecondRow = styled.tr`
& .animatedContainer {
max-height: 1000px;
}
&.expand-enter .animatedContainer {
max-height: 0;
}
&.expand-enter-active .animatedContainer {
max-height: 1000px;
}
&.expand-enter-done .animatedContainer {
max-height: 1000px;
}
&.expand-exit-active .animatedContainer {
max-height: 0;
}
&.expand-exit-done .animatedContainer {
max-height: 0;
}
`;
export const RunnerCell = styled.td`
height: 0;
`;
export const RunnerNumberWrapper = styled(RunnerCell)`
width: 24px;
position: relative;
`;
export const RunnerNumberContainer = styled.div`
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
`;
export const RunnerOddWrapper = styled(RunnerCell)`
width: 40px;
position: relative;
`;
export const RunnerBioWrapper = styled(RunnerCell)`
padding: ${(props) => !props.removeVerticalPadding && "4px 0"};
max-width: 225px;
border-left: 1px solid ${buildColor("blue", "100")};
${({ hasHover }) =>
hasHover &&
css`
&:hover {
background-color: ${buildColor("grey", "000")};
}
`}
`;
export const RunnerSelectionWrapped = styled.div`
display: flex;
align-items: center;
justify-content: flex-end;
${({ vertical }) =>
vertical
? css`
min-height: 0;
padding-bottom: 12px;
`
: css`
min-height: 40px;
`}
`;
export const RunnerTrackMasterInfo = styled.p`
font-size: 12px;
color: ${buildColor("grey", "800")};
margin-top: -4px;
${({ vertical }) =>
vertical
? css`
padding: 0 8px 8px;
`
: css`
padding: 0 8px 4px;
`};
`;
export const BioSelectionsWrapper = styled.div`
display: flex;
${({ vertical }) =>
vertical
? css`
flex-direction: column;
`
: css`
align-items: center;
`};
& > :first-child {
flex: 1;
min-width: 0;
}
& > :not(:first-child):last-child {
flex: 0 0 auto;
}
`;
export const SilkContainer = styled(RunnerCell)`
margin: 12px 0;
padding-right: 8px;
width: 31px;
height: 100%;
position: relative;
`;
export const Silk = styled.img`
height: 31px;
width: 31px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RunnerLine/index.jsx
import React, { Component, Fragment } from "react";
import { noop, times, get, isEqual } from "lodash";
import { CSSTransition } from "react-transition-group";
import { Link } from "react-router-dom";
import { events as AlchemerEvents } from "@urp/alchemer";
import RunnerNumber from "../../_atom/RunnerNumber";
import RunnerOdds from "../../_atom/RunnerOdds";
import RunnerBio from "../RunnerBio";
import SelectionButton from "../../_atom/SelectionButton";
import {
RunnerWrapper,
RunnerNumberWrapper,
RunnerOddWrapper,
RunnerBioWrapper,
RunnerSelectionWrapped,
SecondRow,
AnimateContainer,
RunnerTrackMasterInfo,
BioSelectionsWrapper,
RunnerNumberContainer,
SilkContainer,
Silk
} from "./styled-components";
export default class RunnerLine extends Component {
static defaultProps = {
biNumber: 0,
leg: 0,
raceTypeCode: "T",
currentOddsNumerator: 0,
currentOddsDenominator: 0,
morningLineOddsNumerator: 0,
morningLineOddsDenominator: 0,
jockeyKannelName: "",
trainerName: "",
isFavorite: false,
selections: [false],
isWagerable: true,
onRunnerSelect: noop,
numColumns: 1,
isKey: false,
isLeg: false,
firstHandicapBold: false,
isFavoriteSelectionActive: false,
favoriteSelection: false,
expandedRunner: "",
expandLine: noop,
expandInfo: noop,
inLinePastPerformance: false,
isRunnerTrackMasterPick: false,
isRunnerNumberFirePick: false,
isRunnerRacingAndSports: false,
handicappingSortMode: "saddlecloth",
redirectToRaceCard: false,
raceUrl: "/",
hasTrackMasterInfo: true,
onRunnerSelection: noop,
race: null,
hasHover: false,
showActiveState: true,
trackDataSource: "",
runners: [],
currentRace: {},
handicappingRunnerFlags: {
title: "",
subtitle: "",
subtitleRunnerFlags: "",
flags: []
},
scrollRunnerPP: false,
scrollOffset: 0,
doesSilkLoads: true
};
constructor(props) {
super(props);
this.ref = React.createRef();
}
shouldComponentUpdate(nextProps) {
const { expandedRunner: expandedRunnerNext, ...restNext } = nextProps;
const { expandedRunner: expandedRunnerProps, ...restProps } = this.props;
const expandedRunnerChange =
expandedRunnerNext !== expandedRunnerProps &&
(expandedRunnerNext === restProps.runnerData.runnerId ||
expandedRunnerProps === restProps.runnerData.runnerId);
return (
!isEqual(restNext, restProps) ||
expandedRunnerChange ||
!isEqual(this.props.currentRace, nextProps.currentRace)
);
}
handleLineSelection = (direction) => {
if (direction === "down") {
AlchemerEvents.selectHandicapOptions();
}
this.props.expandLine({
runnerId: this.props.runnerData.runnerId,
selection: this.props.biNumber.toString(),
column: this.props.leg,
fromIcon: false,
direction: direction.toString(),
isScratched: this.props.runnerData.scratched
});
};
handleSelectionButtonClick = (column, event) =>
this.props.redirectToRaceCard && this.props.race
? this.props.onRunnerSelection(
this.props.race,
this.props.biNumber,
this.props.raceUrl,
event
)
: this.props.onRunnerSelect(
this.props.biNumber.toString(),
this.props.leg > 0 ? this.props.leg : column,
true
);
handleLineClick = (direction) =>
!this.props.redirectToRaceCard && this.handleLineSelection(direction);
showRunnerSilk = (isWagerable, runnerTimeform) =>
this.props.doesSilkLoads &&
!isWagerable &&
runnerTimeform &&
runnerTimeform.silkUrlSvg;
scrollIntoView = () => {
const element = this.ref;
const tabletColumn = document.querySelector(
"#programpage-dualColumn-right"
);
const containerOffset = tabletColumn
? tabletColumn.scrollTop
: window.pageYOffset;
const scrollPosition =
element.getBoundingClientRect().top +
containerOffset -
this.props.scrollOffset;
if (tabletColumn) {
const header = document.querySelector("#raceCardHeader");
const headerHeight = header ? header.offsetHeight : 0;
// this is because of the auto height from magnet scroll that is breaking scroll
setTimeout(() => {
tabletColumn.scrollTo({
top: scrollPosition - headerHeight,
behavior: "smooth"
});
}, 200);
} else {
window.scrollTo({
top: scrollPosition,
behavior: "smooth"
});
}
};
ref;
renderSelectionButtons = () => {
const selectionType = (() => {
if (!this.props.isKey) {
return this.props.numColumns === 1 ? "default" : "number";
}
return "key";
})();
const columns = times(this.props.numColumns, (column) =>
!this.props.redirectToRaceCard ? (
<SelectionButton
key={`selection-${column + 1}`}
selectionType={
this.props.isKey && column > 0 ? "default" : selectionType
}
number={column + 1}
isChecked={!!this.props.selections[column]}
isScratched={this.props.runnerData.scratched}
onChange={() => this.handleSelectionButtonClick(column)}
hasHover={this.props.hasHover}
/>
) : (
<Link
key={`selection-${column + 1}`}
to={`${this.props.raceUrl}&selectedRunner=${get(
this.props,
"biNumber"
)}&betType=10`}
onClick={(event) => this.handleSelectionButtonClick(column, event)}
>
<SelectionButton
selectionType={
this.props.isKey && column > 0 ? "default" : selectionType
}
redirectToRacecard
number={column + 1}
isChecked={!!this.props.selections[column]}
isScratched={this.props.runnerData.scratched}
hasHover={this.props.hasHover}
/>
</Link>
)
);
return (
<RunnerSelectionWrapped
vertical={this.props.numColumns >= 3}
data-qa-label="runnerLine-selectionButtons"
>
{columns}
</RunnerSelectionWrapped>
);
};
renderSingleRow = (direction) => {
const runner = this.props.runners.find(
(runnerBI) => get(runnerBI, "biNumber") === get(this.props, "biNumber")
);
const runnerTimeform = get(runner, "runners[0].timeform", {});
const isSilkShown = this.showRunnerSilk(
this.props.isWagerable,
runnerTimeform
);
return (
<RunnerWrapper
ref={(comp) => (this.ref = comp)}
onTouchStart={noop}
key={`runner-${this.props.runnerData.runnerId}`}
data-qa-label={`${this.props.runnerData.runnerId}-runnerLine${
this.props.runnerData.runnerId.match(/[a-zA-Z]/i) ? "-coupled" : ""
}${this.props.runnerData.scratched ? "-scratched" : ""}`}
leg={this.props.isLeg}
hasHover={this.props.hasHover}
showActiveState={this.props.showActiveState}
>
<RunnerNumberWrapper onClick={() => this.handleLineClick(direction)}>
<RunnerNumberContainer>
<RunnerNumber
raceTypeCode={this.props.raceTypeCode}
runnerId={this.props.runnerData.runnerId}
arrowDirection={direction}
/>
</RunnerNumberContainer>
</RunnerNumberWrapper>
<RunnerOddWrapper onClick={() => this.handleLineClick(direction)}>
<RunnerOdds
currentOddsNumerator={this.props.currentOddsNumerator}
currentOddsDenominator={this.props.currentOddsDenominator}
morningLineOddsNumerator={this.props.morningLineOddsNumerator}
morningLineOddsDenominator={this.props.morningLineOddsDenominator}
isScratched={this.props.runnerData.scratched}
isFavorite={this.props.isFavorite}
/>
</RunnerOddWrapper>
<RunnerBioWrapper
removeVerticalPadding={
this.props.numColumns >= 3 && this.props.isWagerable
}
onClick={() => this.handleLineClick(direction)}
colSpan={this.props.isWagerable ? 2 : 1}
>
<BioSelectionsWrapper vertical={this.props.numColumns >= 3}>
<RunnerBio
raceTypeCode={this.props.raceTypeCode}
firstHandicapBold={this.props.firstHandicapBold}
runnerName={this.props.runnerData.horseName}
handicappingData={
this.props.isRunnerTrackMasterPick
? []
: this.props.runnerData.handicapping
}
isScratched={this.props.runnerData.scratched}
showFavorite={
this.props.isWagerable && this.props.isFavoriteSelectionActive
}
isFavorite={this.props.favoriteSelection}
runnerMasterPickNumber={this.props.runnerData.masterPickNumber}
isRunnerTrackMasterPick={this.props.isRunnerTrackMasterPick}
isRunnerNumberFirePick={this.props.isRunnerNumberFirePick}
hasJockeyChanges={this.props.runnerData.hasJockeyChanges}
handicappingSortMode={this.props.handicappingSortMode}
hasTrackMasterInfo={this.props.hasTrackMasterInfo}
trackDataSource={this.props.trackDataSource}
runnerData={this.props.runnerData}
showFlags={
(this.props.expandedRunner === "" ||
this.props.expandedRunner !==
this.props.runnerData.runnerId) &&
this.props.expandInfo !== noop
}
handicappingRunnerFlags={this.props.handicappingRunnerFlags}
/>
{this.props.isWagerable &&
!this.props.runnerData.scratched &&
this.renderSelectionButtons()}
</BioSelectionsWrapper>
{(this.props.isRunnerTrackMasterPick ||
this.props.isRunnerNumberFirePick ||
this.props.isRunnerRacingAndSports) && (
<RunnerTrackMasterInfo vertical={this.props.numColumns >= 3}>
{this.props.runnerData.masterPickInfo}
</RunnerTrackMasterInfo>
)}
</RunnerBioWrapper>
{isSilkShown && (
<SilkContainer>
<Silk src={runnerTimeform.silkUrlSvg} />
</SilkContainer>
)}
</RunnerWrapper>
);
};
renderExpandedRow = () => {
const info = this.props.expandInfo(
this.props.runnerData.horseName,
get(this.props.runnerData, "dob", 0),
this.props.runners,
get(this.props.runnerData, "entityRunnerId", "")
);
return (
!!info && (
<td colSpan={4}>
<AnimateContainer className="animatedContainer">
{info}
</AnimateContainer>
</td>
)
);
};
render() {
const showSecondRow =
this.props.expandedRunner === this.props.runnerData.runnerId &&
this.props.expandedRunner !== "" &&
this.props.expandInfo !== noop;
const direction = showSecondRow ? "up" : "down";
return (
<Fragment>
{this.renderSingleRow(
this.props.inLinePastPerformance ? direction : "none"
)}
<CSSTransition
in={showSecondRow}
classNames="expand"
timeout={200}
unmountOnExit
onEntered={() => {
if (
this.ref instanceof Element &&
typeof window !== "undefined" &&
this.props.scrollRunnerPP
) {
this.scrollIntoView();
}
}}
>
<SecondRow>{this.renderExpandedRow()}</SecondRow>
</CSSTransition>
</Fragment>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/RunnerList/index.jsx
import React, { Component } from "react";
import { noop, isEqual, indexOf, toString, get } from "lodash";
import { doesSilkLoads } from "@tvg/utils/handicappingUtils";
import RunnerLine from "../../_molecule/RunnerLine";
const getRunnerSelections = (biNumber, selections) =>
selections.map((column) => indexOf(column, toString(biNumber)) >= 0);
const getFavoriteSelections = (biNumber, leg) =>
leg.indexOf(`${biNumber}`) >= 0;
export default class RunnerList extends Component {
static defaultProps = {
runners: [],
leg: 0,
isLeg: false,
isWagerable: true,
onRunnerSelect: noop,
raceTypeCode: "T",
selections: [[]],
numColumns: 1,
isKey: false,
firstHandicapBold: false,
isFavoriteSelectionActive: false,
favoriteSelections: [[]],
expandedRunner: "",
expandLine: noop,
expandInfo: noop,
inLinePastPerformance: false,
isTrackMasterPick: false,
isNumberFirePick: false,
isRacingAndSports: false,
handicappingSortMode: "saddlecloth",
redirectToRaceCard: false,
raceUrl: "/",
hasTrackMasterInfo: true,
onRunnerSelection: noop,
race: null,
hasHover: false,
showRunnerLineActiveState: true,
trackDataSource: "",
currentRace: {},
handicappingRunnerFlags: {
title: "",
subtitle: "",
subtitleRunnerFlags: "",
flags: []
},
scrollRunnerPP: false,
scrollOffset: 0
};
state = {
doesSilkLoads: true
};
componentDidMount() {
this.setDoesSilkLoads();
}
shouldComponentUpdate(nextProps, nextState) {
return (
this.state.doesSilkLoads !== nextState.doesSilkLoads ||
!isEqual(nextProps, this.props)
);
}
componentDidUpdate(prevProps) {
if (!isEqual(this.props.currentRace, prevProps.currentRace)) {
this.setDoesSilkLoads();
}
}
setDoesSilkLoads() {
doesSilkLoads(this.props.runners).then((silkLoads) => {
if (this.state.doesSilkLoads !== silkLoads) {
// eslint-disable-next-line react/no-did-update-set-state
this.setState({
doesSilkLoads: silkLoads
});
}
});
}
renderRunners() {
return (
this.props.runners &&
this.props.runners.map((bi) =>
bi.runners.map((runner) => (
<RunnerLine
race={this.props.race}
runners={this.props.runners}
key={`runner-${runner.runnerId}`}
selections={getRunnerSelections(bi.biNumber, this.props.selections)}
runnerData={runner}
isFavorite={bi.isFavorite}
biNumber={bi.biNumber}
leg={this.props.leg}
raceTypeCode={this.props.raceTypeCode}
currentOddsNumerator={get(bi, "currentOdds.numerator")}
currentOddsDenominator={get(bi, "currentOdds.denominator")}
morningLineOddsNumerator={get(bi, "morningLineOdds.numerator")}
morningLineOddsDenominator={get(bi, "morningLineOdds.denominator")}
isWagerable={this.props.isWagerable}
onRunnerSelect={this.props.onRunnerSelect}
numColumns={this.props.numColumns}
isKey={this.props.isKey}
isLeg={this.props.isLeg}
expandedRunner={this.props.expandedRunner}
expandLine={this.props.expandLine}
expandInfo={this.props.expandInfo}
firstHandicapBold={this.props.firstHandicapBold}
isFavoriteSelectionActive={this.props.isFavoriteSelectionActive}
onRunnerSelection={this.props.onRunnerSelection}
favoriteSelection={
this.props.isFavoriteSelectionActive &&
getFavoriteSelections(
bi.biNumber,
this.props.favoriteSelections[this.props.leg]
)
}
inLinePastPerformance={this.props.inLinePastPerformance}
isRunnerTrackMasterPick={this.props.isTrackMasterPick}
isRunnerNumberFirePick={this.props.isNumberFirePick}
isRunnerRacingAndSports={this.props.isRacingAndSports}
handicappingSortMode={this.props.handicappingSortMode}
redirectToRaceCard={this.props.redirectToRaceCard}
raceUrl={this.props.raceUrl}
hasTrackMasterInfo={this.props.hasTrackMasterInfo}
hasHover={this.props.hasHover}
showActiveState={this.props.showRunnerLineActiveState}
trackDataSource={this.props.trackDataSource}
currentRace={this.props.currentRace}
handicappingRunnerFlags={this.props.handicappingRunnerFlags}
scrollRunnerPP={this.props.scrollRunnerPP}
scrollOffset={this.props.scrollOffset}
doesSilkLoads={this.state.doesSilkLoads}
/>
))
)
);
}
render() {
return !!this.props.runners.length && <tbody>{this.renderRunners()}</tbody>;
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/RaceCard/styled-components.js
import styled, { css, keyframes } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import ButtonDefault from "../../_atom/Buttons/default";
import { buildText } from "../../_atom/Text";
const fadeIn = keyframes`
from {
opacity: 0;
}
to {
opacity: 1;
}
`;
const fadeOut = keyframes`
from {
opacity: 1;
}
to {
opacity: 0;
}
`;
const slideIn = keyframes`
from {
opacity: 0;
left: 200px;
}
to {
opacity: 1;
left: 0;
}
`;
const slideOut = keyframes`
from {
opacity: 1;
left: 0;
}
to {
opacity: 0;
left: 200px;
}
`;
export const RaceCardSection = styled.section`
width: 100%;
flex: 1 1 0;
background-color: ${buildColor("white", "0")};
padding-top: ${(props) =>
props.isHandicapFixed && `${props.handicapFormatHeight}px`};
`;
export const RaceCardTableWrapper = styled.div`
${(props) =>
props.device === "mobile" &&
!props.isLeg &&
css`
border: 1px solid ${buildColor("grey", "300")};
border-radius: 2px;
overflow: hidden;
${({ removeMargin }) =>
!removeMargin &&
css`
margin: 4px;
`};
`}
`;
export const RaceCardTable = styled.table`
width: 100%;
background-color: ${buildColor("white", "100")};
${(props) =>
props.device === "tablet" &&
css`
border-right: 1px solid ${buildColor("grey", "300")};
border-left: 1px solid ${buildColor("grey", "300")};
`};
${(props) =>
props.noBorderOnFirstChild &&
css`
& tr:first-child {
border-top: 0;
}
`};
`;
export const RaceDataContainer = styled.div`
padding: 4px 8px;
background-color: ${buildColor("white", "100")};
border: 1px solid ${buildColor("grey", "300")};
border-top-left-radius: 2px;
border-top-right-radius: 2px;
`;
export const RaceCardLegWrapper = styled.div`
width: calc(100% - 16px);
padding: 12px 0 12px 8px;
&:first-child {
padding-left: 12px;
}
&:last-child {
width: 100%;
margin-right: 1px;
}
`;
export const Text = styled(
buildText({
tag: "span",
fontSize: 10,
color: buildColor("blue_accent", "500"),
uppercase: true,
bold: true
})
)`
height: 11px;
`;
export const BetAllModalWrapper = styled.div`
visibility: ${({ isBetAllOpened }) =>
isBetAllOpened ? "visible" : "hidden"};
height: 0;
position: relative;
z-index: 1;
${({ isBetAllOpened }) =>
isBetAllOpened
? css`
animation: ${fadeIn} 0.8s linear;
transition: visibility 0.8s linear;
`
: css`
animation: ${fadeOut} 0.8s ease-out;
animation-delay: ${({ numColumns }) => 0.09 * numColumns}s;
transition: visibility 0.8s ease-out;
`}
`;
export const BetAllModal = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
height: ${(props) => props.headerHeight}px;
background-color: ${buildColor("white", "100")};
overflow: hidden;
${(props) =>
props.device === "tablet" &&
css`
border-right: 1px solid ${buildColor("grey", "300")};
border-left: 1px solid ${buildColor("grey", "300")};
`};
`;
export const CloseButton = styled.div`
width: 48px;
height: 40px;
position: relative;
display: flex;
justify-content: center;
align-items: center;
background-color: ${buildColor("white", "0")};
${({ isBetAllOpened }) =>
isBetAllOpened
? css`
animation: ${slideIn} 0.5s ease-in;
`
: css`
animation: ${slideOut} 0.5s ease-in;
animation-delay: ${({ numColumns }) => 0.09 * numColumns}s;
`}
`;
export const BetAllButtons = styled.div`
display: flex;
justify-content: flex-end;
`;
export const BetAllButton = styled(ButtonDefault)`
width: 48px;
height: 40px;
position: relative;
background-color: ${buildColor("white", "0")};
${({ isBetAllOpened }) =>
isBetAllOpened
? css`
animation: ${slideIn} 0.5s ease-in;
animation-delay: ${({ column }) => 0.09 * column}s;
animation-fill-mode: backwards;
`
: css`
animation: ${slideOut} 0.5s ease-in;
animation-delay: ${(props) =>
0.09 * (props.numColumns - props.column)}s;
animation-fill-mode: forwards;
`}
& > span {
display: block;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/RaceCard/index.jsx
import React, { Component } from "react";
import { noop, isEqual, map, get, times, debounce } from "lodash";
import formatSequencial from "@tvg/formatter/numeric";
import handicappingOptions, {
handicappingGreyhoundOptions,
handicappingHarnessOptions
} from "@tvg/utils/handicapping-conf/handicappingOptions";
import Icon from "../../_static/Icons";
import { key, close } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import RunnerListHeader from "../../_molecule/RunnerListHeader";
import RunnerList from "../../_organism/RunnerList";
import RaceInfoInline from "../../_molecule/RaceInfoInline";
import MagnetScrollArea from "../MagnetScrollArea";
import {
RaceCardSection,
RaceCardLegWrapper,
RaceCardTableWrapper,
RaceCardTable,
RaceDataContainer,
Text,
BetAllModalWrapper,
BetAllModal,
CloseButton,
BetAllButtons,
BetAllButton
} from "./styled-components";
const getSelectionText = (selectionType, column, selected) => {
const text = [];
switch (selectionType) {
case "key":
if (column === 0) {
text.push(
<Icon key="key-icon" icon={key} color={buildColor("blue", "800")} />
);
} else {
text.push(<Text key="line1">{!selected ? "W/" : "RESET"}</Text>);
text.push(<Text key="line2">ALL</Text>);
}
break;
case "number":
text.push(
<Text key="line1">
{!selected ? formatSequencial(column + 1) : "RESET"}
</Text>
);
text.push(<Text key="line2">ALL</Text>);
break;
case "default":
default:
text.push(<Text key="line1">{!selected ? "BET" : "RESET"}</Text>);
text.push(<Text key="line2">ALL</Text>);
break;
}
return text;
};
export default class RaceCard extends Component {
static defaultProps = {
bettingInterests: [[]],
racesData: [[]],
raceTypeCode: "T",
handicapType: "basic",
isWagerable: true,
selections: [[]],
isAllSelected: [],
numColumns: 1,
isKey: false,
isWheel: false,
onRunnerSelect: noop,
onAllRunnersSelect: noop,
selectedLeg: 0,
onLegSelect: noop,
fixHandicapSection: {
isHandicapFixed: false,
fixedOffset: 0,
handicapFormatHeight: 24
},
firstHandicapBold: false,
hasHandicappingSelection: false,
isFavoriteSelectionActive: false,
favoriteSelections: [[]],
renderRaceAlerts: noop,
device: "mobile",
legExpandedRunner: [],
expandLine: noop,
expandInfo: noop,
inLinePastPerformance: false,
subscribeBaseEvent: noop,
handicapOptions: [],
handicappingSortMode: "saddlecloth",
trackDataSource: "",
currentRace: {},
handicappingRunnerFlags: {
title: "",
subtitle: "",
subtitleRunnerFlags: "",
flags: []
},
scrollRunnerPP: false,
scrollOffset: 0,
renderPromoOnboarding: noop,
shouldRenderPromoOnboarding: false
};
constructor(props) {
super(props);
this.state = {
isBetAllOpened: false,
headerHeight: 40
};
this.refHeader = React.createRef();
}
componentDidMount() {
const headerDimensions = this.refHeader.current;
if (headerDimensions) {
this.setHeight(headerDimensions.getBoundingClientRect().height);
}
const column = document.getElementById("programpage-dualColumn-right");
if (column) {
column.addEventListener("scroll", this.debounceOffset, {
passive: true
});
} else {
window.addEventListener("scroll", this.debounceOffset, {
passive: true
});
}
}
shouldComponentUpdate(nextProps) {
return (
nextProps.bettingInterests.length !==
this.props.bettingInterests.length ||
nextProps.bettingInterests[0].length !==
this.props.bettingInterests[0].length ||
!isEqual(nextProps, this.props)
);
}
componentDidUpdate(nextProps) {
if (!isEqual(nextProps, this.props)) {
const headerDimensions = this.refHeader.current;
// Get Header Height to Bet All
if (headerDimensions) {
this.setHeight(headerDimensions.getBoundingClientRect().height);
}
// Check change bets type
if (
this.props.numColumns !== nextProps.numColumns &&
this.state.isBetAllOpened
) {
this.toggleBetAll();
}
}
}
componentWillUnmount() {
const column = document.getElementById("programpage-dualColumn-right");
if (column) {
column.removeEventListener("scroll", this.debounceOffset, {
passive: true
});
} else {
window.removeEventListener("scroll", this.debounceOffset, {
passive: true
});
}
}
setHeight = (height) => {
if (height > 0) this.setState({ headerHeight: height });
};
getOffset = () => {
const headerDimensions = this.refHeader.current;
const topToHide = this.props.device === "mobile" ? 48 : 130;
if (
headerDimensions &&
headerDimensions.getBoundingClientRect().top < topToHide &&
this.state.isBetAllOpened
) {
this.toggleBetAll();
}
};
debounceOffset = debounce(() => this.getOffset(), 150);
refHeader;
handleSelectAll(index) {
this.props.onAllRunnersSelect(index);
}
getHandicappingFormat = (handicapKey) => {
let option = [];
if (this.props.raceTypeCode === "G") {
option = handicappingGreyhoundOptions;
} else if (this.props.raceTypeCode === "H") {
option = handicappingHarnessOptions;
} else {
option = handicappingOptions;
}
const findRes =
option.find((handicapItem) => handicapItem.key === handicapKey) ||
option[0];
return handicapKey === "basic"
? {
title: findRes.title
}
: findRes;
};
toggleBetAll = () => {
this.setState({ isBetAllOpened: !this.state.isBetAllOpened });
this.forceUpdate();
};
renderRaceInfo(leg) {
return (
<RaceDataContainer data-qa-label="raceCard-header-leg">
<RaceInfoInline raceData={this.props.racesData[leg]} />
</RaceDataContainer>
);
}
renderRaceCard = () => {
if (this.props.bettingInterests.length > 1) {
return (
<MagnetScrollArea
onHandleTransition={this.props.onLegSelect}
activeIndex={this.props.selectedLeg}
isLoading={false}
key={`RaceCardWithLeg${this.props.bettingInterests.length}`}
>
{map(this.props.bettingInterests, (bi, leg) => (
<RaceCardLegWrapper
data-qa-label="raceCard-leg"
key={`RaceCard-leg-${leg + 1}`}
>
{this.renderRaceInfo(leg)}
{this.renderLegRaceCard(bi, leg, true)}
</RaceCardLegWrapper>
))}
</MagnetScrollArea>
);
}
return (
this.props.bettingInterests.length &&
this.renderLegRaceCard(this.props.bettingInterests[0])
);
};
renderLegRaceCard = (bi, leg = 0, isLeg = false) => {
const handicappingFormat = this.getHandicappingFormat(
this.props.handicapType
);
return (
<RaceCardTableWrapper device={this.props.device} isLeg={isLeg}>
{this.renderBetAllModal()}
<RaceCardTable
data-qa-label="raceCard-table"
device={this.props.device}
>
<RunnerListHeader
isHandicapFixed={get(
this.props,
"fixHandicapSection.isHandicapFixed"
)}
fixedHandicapOffset={get(
this.props,
"fixHandicapSection.fixedOffset"
)}
handicapInfo={get(handicappingFormat, "handicapData")}
raceTypeCode={this.props.raceTypeCode}
handicapOptions={this.props.handicapOptions}
leg={leg}
isWagerable={this.props.isWagerable}
isLeg={isLeg}
isAllSelected={
isLeg ? [this.props.isAllSelected[leg]] : this.props.isAllSelected
}
numColumns={this.props.numColumns}
isKey={this.props.isKey}
isWheel={this.props.isWheel}
onAllRunnersSelect={this.props.onAllRunnersSelect}
hasHandicappingSelection={this.props.hasHandicappingSelection}
refHeader={this.refHeader}
toggleBetAll={this.toggleBetAll}
handicappingSortMode={this.props.handicappingSortMode}
shouldRenderPromoOnboarding={this.props.shouldRenderPromoOnboarding}
renderPromoOnboarding={this.props.renderPromoOnboarding}
/>
<RunnerList
runners={bi}
leg={leg}
isLeg={isLeg}
selections={
isLeg ? [this.props.selections[leg]] : this.props.selections
}
isWagerable={this.props.isWagerable}
onRunnerSelect={this.props.onRunnerSelect}
raceTypeCode={this.props.raceTypeCode}
numColumns={this.props.numColumns}
isKey={this.props.isKey}
firstHandicapBold={this.props.firstHandicapBold}
isFavoriteSelectionActive={this.props.isFavoriteSelectionActive}
favoriteSelections={this.props.favoriteSelections}
expandedRunner={this.props.legExpandedRunner[leg] || ""}
expandLine={this.props.expandLine}
expandInfo={this.props.expandInfo}
inLinePastPerformance={this.props.inLinePastPerformance}
handicappingSortMode={this.props.handicappingSortMode}
trackDataSource={this.props.trackDataSource}
currentRace={this.props.currentRace}
handicappingRunnerFlags={this.props.handicappingRunnerFlags}
scrollRunnerPP={this.props.scrollRunnerPP}
scrollOffset={this.props.scrollOffset}
/>
</RaceCardTable>
</RaceCardTableWrapper>
);
};
renderSelectAll = () => {
const selectionType = (() => {
if (!this.props.isKey) {
return this.props.numColumns === 1 ? "default" : "number";
}
return "key";
})();
const buildQALabel = (column) => {
if (this.props.isKey) {
return column === 0
? "runnerListHeader-selectKeyButton"
: "runnerListHeader-selectWithButton";
}
return this.props.numColumns === 1
? "runnerListHeader-selectAllButton"
: `runnerListHeader-select-${column + 1}-button`;
};
return times(this.props.numColumns, (column) => (
<BetAllButton
key={`button-${column}`}
onClick={() => this.handleSelectAll(column)}
qaLabel={buildQALabel(column)}
isBetAllOpened={this.state.isBetAllOpened}
column={column + 1}
numColumns={this.props.numColumns}
>
{getSelectionText(
selectionType,
column,
this.props.isAllSelected[column]
)}
</BetAllButton>
));
};
renderBetAllModal = () => (
<BetAllModalWrapper
isBetAllOpened={this.state.isBetAllOpened}
numColumns={this.props.numColumns}
data-qa-label="raceCard-betAllSelector"
>
<BetAllModal
headerHeight={this.state.headerHeight}
device={this.props.device}
>
<CloseButton
onClick={this.toggleBetAll}
isBetAllOpened={this.state.isBetAllOpened}
numColumns={this.props.numColumns}
data-qa-label="raceCard-betAllSelector-closeBtn"
>
<Icon icon={close} size={16} />
</CloseButton>
<BetAllButtons>{this.renderSelectAll()}</BetAllButtons>
</BetAllModal>
</BetAllModalWrapper>
);
render() {
return (
<RaceCardSection
device={this.props.device}
data-qa-label="raceCard-section"
isHandicapFixed={get(this.props, "fixHandicapSection.isHandicapFixed")}
handicapFormatHeight={get(
this.props,
"fixHandicapSection.handicapFormatHeight"
)}
biLength={this.props.bettingInterests.length}
>
{this.renderRaceCard()}
{this.props.renderRaceAlerts()}
</RaceCardSection>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-shared-actions/BetActions.ts
import { BetStateType } from "@tvg/desktop-bet/src/types";
import { BetTicketState } from "@tvg/ts-types/Bet";
import { TabKey } from "@tvg/ts-types/Generic";
import { RaceBet, RaceWagerType } from "@tvg/ts-types/Race";
import { TalentPickData } from "@tvg/ts-types/TalentPicks";
// Declare existing actions
type SetBetConfirmationAction = {
type: "SET_BET_CONFIRMATION";
payload: boolean;
};
type SetShowRepeatBetAction = {
type: "SET_SHOW_REPEAT_BET";
payload: boolean;
};
type SetBetTicketStateAction = {
type: "SET_BET_TICKET_STATE";
payload: BetTicketState;
};
type SetBetRepeatNumberStateAction = {
type: "SET_BET_REPEAT_NUMBER";
payload: number;
};
type ClearBetRepeatNumberStateAction = {
type: "SET_BET_REPEAT_NUMBER";
};
type SetRaceBets = {
type: "SET_RACE_BETS";
payload: Array<RaceBet>;
};
type SetBetAmountAction = {
type: "SET_BET_AMOUNT";
payload: number;
};
type SetPickAction = {
type: "SET_PICK";
payload: {
value?: TalentPickData | null;
triggerOrigin?: "programpage" | "pickspage";
};
};
type SetApplyPickAction = {
type: "SET_APPLY_PICK";
payload: boolean;
};
type SetEditButtonAction = {
type: "SET_PICK_EDIT_BUTTON";
payload: boolean;
};
type SetOpenConfirmationModal = {
type: "SET_OPEN_CONFIRMATION_MODAL";
payload: boolean;
};
type NoMandatoryTalentIdSelected = {
type: "NO_TALENT_ID_SELECTED_WARNING_VISIBLE";
payload: boolean;
};
type SetScratchedSelectionAction = {
type: "SET_SELECTION_SCRATCHED";
payload: string[][];
};
type SetBetTypeAction = {
type: "SET_BET_TYPE";
payload?: RaceWagerType | null | undefined;
};
type SetWagerTypesAction = {
type: "SET_WAGER_TYPES";
payload?: RaceWagerType[];
};
type SetStartBettingAction = {
type: "SET_START_BETTING";
payload: boolean;
};
type SetBetStateAction = {
type: "SET_BET_STATE";
payload: BetStateType;
};
type SetPickLegAction = {
type: "SET_PICK_LEG";
payload: number;
};
type SetResultsOfficialsTab = {
type: "SET_RESULTS_OFFICIALS_TAB";
payload: TabKey;
};
type SetSelectionRequestAction = {
type: "SET_BET_SELECTIONS";
payload: string[][];
};
type SetSelectionMatrixRequestAction = {
type: "SET_SELECTIONS_MATRIX";
payload: { selections: string[][]; favoriteSelections: string[][] };
};
type ResetSelectionAction = { type: "RESET_BET_SELECTIONS" };
type ResetBettingAction = { type: "RESET_BETTING" };
type SetFavoriteSelectionRequestAction = {
type: "SET_FAVORITE_SELECTIONS";
payload: string[][];
};
export type Actions =
| NoMandatoryTalentIdSelected
| SetSelectionRequestAction
| SetSelectionMatrixRequestAction
| ResetSelectionAction
| SetStartBettingAction
| SetBetConfirmationAction
| SetBetStateAction
| SetBetTypeAction
| SetWagerTypesAction
| SetBetAmountAction
| SetPickLegAction
| SetPickAction
| SetOpenConfirmationModal
| SetResultsOfficialsTab
| SetRaceBets
| SetScratchedSelectionAction
| ResetBettingAction
| SetFavoriteSelectionRequestAction
| SetEditButtonAction
| SetApplyPickAction
| SetBetTicketStateAction
| SetBetRepeatNumberStateAction
| ClearBetRepeatNumberStateAction
| SetShowRepeatBetAction;
export const resetSelection = (): ResetSelectionAction => ({
type: "RESET_BET_SELECTIONS"
});
export const resetBetting = (): ResetBettingAction => ({
type: "RESET_BETTING"
});
export const setShowRepeatBet = (status: boolean): SetShowRepeatBetAction => ({
type: "SET_SHOW_REPEAT_BET",
payload: status
});
export const noMandatoryTalentIdSelected = (
status: boolean
): NoMandatoryTalentIdSelected => ({
type: "NO_TALENT_ID_SELECTED_WARNING_VISIBLE",
payload: status
});
export const setSelectionRequest = (
selections: string[][]
): SetSelectionRequestAction => ({
type: "SET_BET_SELECTIONS",
payload: selections
});
export const setSelectionMatrixRequest = (selections: {
selections: string[][];
favoriteSelections: string[][];
}): SetSelectionMatrixRequestAction => ({
type: "SET_SELECTIONS_MATRIX",
payload: selections
});
export const setFavoriteSelectionRequest = (
selections: string[][]
): SetFavoriteSelectionRequestAction => ({
type: "SET_FAVORITE_SELECTIONS",
payload: selections
});
export const setStartBetting = (
value: boolean = true
): SetStartBettingAction => ({
type: "SET_START_BETTING",
payload: value
});
export const setBetConfirmation = (
value: boolean
): SetBetConfirmationAction => ({
type: "SET_BET_CONFIRMATION",
payload: value
});
export const setBetTicketState = (
value: BetTicketState
): SetBetTicketStateAction => ({
type: "SET_BET_TICKET_STATE",
payload: value
});
export const setBetRepeatNumber = (
value: number
): SetBetRepeatNumberStateAction => ({
type: "SET_BET_REPEAT_NUMBER",
payload: value
});
export const clearBetRepeatNumber = (): ClearBetRepeatNumberStateAction => ({
type: "SET_BET_REPEAT_NUMBER"
});
export const setBetAmount = (value: number): SetBetAmountAction => ({
type: "SET_BET_AMOUNT",
payload: value
});
export const setPickAction = (
value?: TalentPickData | null,
triggerOrigin?: "programpage" | "pickspage"
): SetPickAction => ({
type: "SET_PICK",
payload: {
value,
triggerOrigin
}
});
export const setApplyPickAction = (value: boolean): SetApplyPickAction => ({
type: "SET_APPLY_PICK",
payload: value
});
export const setPickEditButtonAction = (
value: boolean
): SetEditButtonAction => ({
type: "SET_PICK_EDIT_BUTTON",
payload: value
});
export const setSelectionScratched = (
value: string[][]
): SetScratchedSelectionAction => ({
type: "SET_SELECTION_SCRATCHED",
payload: value
});
export const setBetType = (
value?: RaceWagerType | null | undefined
): SetBetTypeAction => ({
type: "SET_BET_TYPE",
payload: value
});
export const setWagerTypes = (
value?: RaceWagerType[]
): SetWagerTypesAction => ({
type: "SET_WAGER_TYPES",
payload: value
});
export const setBetState = (value: BetStateType): SetBetStateAction => ({
type: "SET_BET_STATE",
payload: value
});
export const setPickLeg = (value: number): SetPickLegAction => ({
type: "SET_PICK_LEG",
payload: value
});
export const setRaceBets = (value: Array<RaceBet>): SetRaceBets => ({
type: "SET_RACE_BETS",
payload: value
});
export const setResultsOfficialsTab = (
value: TabKey
): SetResultsOfficialsTab => ({
type: "SET_RESULTS_OFFICIALS_TAB",
payload: value
});
webpack://frontend-tpt/../../packages/tvg-lib-shared-actions/ProgramActions.ts
import {
HandicapOptionsType,
HandicapSortOptionsType,
RaceProgram
} from "@tvg/ts-types/Race";
import { Talent } from "@tvg/ts-types/Talent";
// Declare existing actions
type GraphPendingAction = { type: "GRAPH_REQUEST_PENDING" };
type GraphFinishAction = { type: "GRAPH_REQUEST_FINISH" };
type wagerSelectorFixedType = {
isWagerSelectorFixed: boolean;
fixedOffset: number;
};
type FixHandicapType = {
isHandicapFixed: boolean;
fixedOffset: number;
handicapFormatHeight: number;
};
type SetQueryWithRacesAction = {
type: "SET_QUERY_WITH_RACES";
payload: boolean;
};
type SetQueryWithHandicappingAction = {
type: "SET_QUERY_WITH_HANDICAPPING";
payload: boolean;
};
type SetHandicappingFavoriteModeAction = {
type: "SET_HANDICAPPING_FAVORITE_MODE";
payload: HandicapOptionsType;
};
type SetHandicappingModeAction = {
type: "SET_HANDICAPPING_MODE";
payload: HandicapOptionsType;
};
type SetHandicappingModalStateAction = {
type: "SET_HANDICAPPING_MODAL_STATE";
payload: boolean;
};
type UserSetHandicappingModeAction = {
type: "USER_SET_HANDICAPPING_MODE";
payload?: HandicapOptionsType;
};
type UserSetHandicappingSortModeAction = {
type: "USER_SET_HANDICAPPING_SORT_MODE";
payload?: HandicapSortOptionsType;
};
type SetHandicappingSortFavoriteModeAction = {
type: "SET_HANDICAPPING_SORT_FAVORITE_MODE";
payload: HandicapSortOptionsType;
};
type SetHandicappingSortModeAction = {
type: "SET_HANDICAPPING_SORT_MODE";
payload: HandicapSortOptionsType;
};
type SetHandicappingSortModalStateAction = {
type: "SET_HANDICAPPING_SORT_MODAL_STATE";
payload: boolean;
};
type SetRaceSelectorModalStateAction = {
type: "SET_RACE_SELECTOR_MODAL_STATE";
payload: boolean;
};
type SetCurrentRaceAction = {
type: "SET_CURRENT_RACE";
payload: RaceProgram;
};
type ShowRaceNavigationHeaderAction = {
type: "SHOW_HEADER_NAVIGATION";
payload: boolean;
};
type fixWagerSelectorAction = {
type: "FIX_WAGER_SELECTOR";
payload: wagerSelectorFixedType;
};
type showVideoButtonHeaderAction = {
type: "SHOW_VIDEO_BUTTON_HEADER";
payload: boolean;
};
type saveVideoFeedbackAction = {
type: "SAVE_VIDEO_FEEDBACK";
payload: string;
};
type fixHandicapSectionAction = {
type: "FIX_HANDICAP";
payload: FixHandicapType;
};
type TalentPicksRaceSelectorOpenAction = {
type: "TALENT_TOGGLE_RACE_SELECTOR";
};
type TalentPicksDropdownOpenAction = {
type: "TALENT_TOGGLE_TALENT_DROPDOWN";
};
type TalentPicksPopulateListAction = {
type: "TALENT_POPULATE_LIST";
payload: Talent[];
};
type TalentPicksSetSelectedIdAction = {
type: "TALENT_SET_SELECTED_TALENT_ID";
payload: string;
};
type ShowMainWagerType = {
type: "SHOW_MAIN_WAGER_TYPE";
payload: boolean;
};
export type Actions =
| GraphPendingAction
| GraphFinishAction
| SetQueryWithRacesAction
| SetHandicappingModeAction
| SetHandicappingSortModeAction
| SetQueryWithHandicappingAction
| SetHandicappingModalStateAction
| SetHandicappingSortModalStateAction
| SetHandicappingFavoriteModeAction
| SetHandicappingSortFavoriteModeAction
| SetRaceSelectorModalStateAction
| SetCurrentRaceAction
| fixWagerSelectorAction
| ShowRaceNavigationHeaderAction
| saveVideoFeedbackAction
| fixHandicapSectionAction
| showVideoButtonHeaderAction
| TalentPicksRaceSelectorOpenAction
| TalentPicksDropdownOpenAction
| TalentPicksPopulateListAction
| TalentPicksSetSelectedIdAction
| ShowMainWagerType
| UserSetHandicappingModeAction
| UserSetHandicappingSortModeAction;
export const graphPending = (): GraphPendingAction => ({
type: "GRAPH_REQUEST_PENDING"
});
export const graphFinish = (): GraphFinishAction => ({
type: "GRAPH_REQUEST_FINISH"
});
export const setQueryWithRacesAction = (
value: boolean
): SetQueryWithRacesAction => ({
type: "SET_QUERY_WITH_RACES",
payload: value
});
export const setHandicappingFavoriteModeAction = (
value: HandicapOptionsType
): SetHandicappingFavoriteModeAction => ({
type: "SET_HANDICAPPING_FAVORITE_MODE",
payload: value
});
export const setHandicappingModeAction = (
value: HandicapOptionsType
): SetHandicappingModeAction => ({
type: "SET_HANDICAPPING_MODE",
payload: value
});
export const userSetHandicappingModeAction = (
value?: HandicapOptionsType
): UserSetHandicappingModeAction => ({
type: "USER_SET_HANDICAPPING_MODE",
payload: value
});
export const userSetHandicappingSortModeAction = (
value?: HandicapSortOptionsType
): UserSetHandicappingSortModeAction => ({
type: "USER_SET_HANDICAPPING_SORT_MODE",
payload: value
});
export const setHandicappingModalStateAction = (
value: boolean
): SetHandicappingModalStateAction => ({
type: "SET_HANDICAPPING_MODAL_STATE",
payload: value
});
export const setHandicappingSortFavoriteModeAction = (
value: HandicapSortOptionsType
): SetHandicappingSortFavoriteModeAction => ({
type: "SET_HANDICAPPING_SORT_FAVORITE_MODE",
payload: value
});
export const setHandicappingSortModeAction = (
value: HandicapSortOptionsType
): SetHandicappingSortModeAction => ({
type: "SET_HANDICAPPING_SORT_MODE",
payload: value
});
export const setHandicappingSortModalStateAction = (
value: boolean
): SetHandicappingSortModalStateAction => ({
type: "SET_HANDICAPPING_SORT_MODAL_STATE",
payload: value
});
export const setRaceSelectorModalStateAction = (
value: boolean
): SetRaceSelectorModalStateAction => ({
type: "SET_RACE_SELECTOR_MODAL_STATE",
payload: value
});
export const setCurrentRaceAction = (
race: RaceProgram
): SetCurrentRaceAction => ({
type: "SET_CURRENT_RACE",
payload: race
});
export const showRaceNavigationHeader = (
value: boolean
): ShowRaceNavigationHeaderAction => ({
type: "SHOW_HEADER_NAVIGATION",
payload: value
});
export const fixWagerSelector = (
payload: wagerSelectorFixedType
): fixWagerSelectorAction => ({
type: "FIX_WAGER_SELECTOR",
payload: {
isWagerSelectorFixed: payload.isWagerSelectorFixed,
fixedOffset: payload.fixedOffset
}
});
export const showVideoButtonHeader = (
value: boolean
): showVideoButtonHeaderAction => ({
type: "SHOW_VIDEO_BUTTON_HEADER",
payload: value
});
export const saveVideoFeedback = (value: string): saveVideoFeedbackAction => ({
type: "SAVE_VIDEO_FEEDBACK",
payload: value
});
export const fixHandicapSection = (
payload: FixHandicapType
): fixHandicapSectionAction => ({
type: "FIX_HANDICAP",
payload: {
isHandicapFixed: payload.isHandicapFixed,
fixedOffset: payload.fixedOffset,
handicapFormatHeight: payload.handicapFormatHeight
}
});
export const talentPicksRaceSelectorOpen =
(): TalentPicksRaceSelectorOpenAction => ({
type: "TALENT_TOGGLE_RACE_SELECTOR"
});
export const talentPicksTalentDropdown = (): TalentPicksDropdownOpenAction => ({
type: "TALENT_TOGGLE_TALENT_DROPDOWN"
});
export const talentPicksPopulateList = (
payload: Talent[]
): TalentPicksPopulateListAction => ({
type: "TALENT_POPULATE_LIST",
payload
});
export const setSelectedTalentId = (
payload: string
): TalentPicksSetSelectedIdAction => ({
type: "TALENT_SET_SELECTED_TALENT_ID",
payload
});
export const setQueryWithHandicappingAction = (
value: boolean
): SetQueryWithHandicappingAction => ({
type: "SET_QUERY_WITH_HANDICAPPING",
payload: value
});
export const showMainWagerType = (value: boolean): ShowMainWagerType => ({
type: "SHOW_MAIN_WAGER_TYPE",
payload: value
});
webpack://frontend-tpt/../../packages/tvg-lib-utils/betSelectionUtils.js
import { get, find } from "lodash";
import { setSelectionMatrixRequest } from "@tvg/shared-actions/BetActions";
import { setQueryWithRacesAction } from "@tvg/shared-actions/ProgramActions";
// bets that need reset with only 1 column
const resetBetTypes = [80, 90, 100];
const setMatrixSizeByColumnCount = (columnCount) =>
columnCount >= 1 ? Array(columnCount).fill([]) : [[]];
const setMatrixSizeByLegCount = (legCount) =>
legCount >= 1 ? Array(legCount).fill([]) : [[]];
const configureProgramPageByBetType = (
columnCount,
legCount,
betId,
matrix,
dispatch,
betFromPick = false
) => {
if (columnCount === 1) {
if (matrix.length !== 1 || resetBetTypes.indexOf(betId) > -1) {
dispatch(
setSelectionMatrixRequest({
selections: betFromPick
? matrix
: setMatrixSizeByColumnCount(columnCount),
favoriteSelections: setMatrixSizeByLegCount(legCount)
})
);
}
} else if (columnCount > 1) {
dispatch(
setSelectionMatrixRequest({
selections: betFromPick
? matrix
: setMatrixSizeByColumnCount(columnCount),
favoriteSelections: setMatrixSizeByLegCount(legCount)
})
);
if (legCount > 1) {
dispatch(setQueryWithRacesAction(true));
}
}
};
const filterHKCoupledEntries = (bettingInterests) =>
bettingInterests.map((bi) => ({
...bi,
runners: bi.runners.filter((runner) => !runner.runnerId.includes("S"))
}));
const hasSelections = (selections = []) =>
!!selections.find((selection) => selection.length);
const hasBetType = (betTypeID = "", currentRace) => {
const wagerTypes = get(currentRace, "wagerTypes", []);
return !!find(
wagerTypes,
(wagerType) => `${wagerType.type.id}` === `${betTypeID}`
);
};
const getDefaultBetType = (
currentRace,
defaultBetTypeID = "",
logged = false
) => {
const wagerTypes = get(currentRace, "wagerTypes", []);
const defaultType = get(wagerTypes, "[0]");
if (logged) {
const findWagerType = find(
wagerTypes,
(wagerType) => `${wagerType.type.id}` === `${defaultBetTypeID}`
);
return findWagerType || defaultType;
}
return defaultType;
};
export const mapSelectionsToNumber = (betSelections) => {
return betSelections.map((selections) => {
return selections.reduce((currentSelections, selection) => {
const biNumber = +selection.toString().replace(/[A-Za-z]/g, "");
return !biNumber ||
isNaN(biNumber) ||
currentSelections.includes(biNumber)
? currentSelections
: [...currentSelections, biNumber];
}, []);
});
};
/**
* Receives an array of arrays of bet selections and will go through all the elements and return only the runner number of each element
*
* NOTE: this was created to serve the function onRepeatBets (packages/tvg-comp-my-bets-desktop/src/MyBetsRow.tsx). Somehow that function is not passing a string[][] to the mapSelectionsToNumber execution
* anymore so this one was created here as it may serve other situations alike.
* @param {*} betSelections
* @returns Array of runner numbers
*/
export const mapBetSelectionsToNumber = (betSelections) =>
betSelections.map((selections) => {
return selections.reduce((currentSelections, selection) => {
const runnerNumber = get(selection, "runnerNumber", "");
const biNumber = +runnerNumber.toString().replace(/[A-Za-z]/g, "");
return !biNumber ||
isNaN(biNumber) ||
currentSelections.includes(biNumber)
? currentSelections
: [...currentSelections, biNumber];
}, []);
});
const betSelections = {
getDefaultBetType,
hasSelections,
setMatrixSizeByColumnCount,
configureProgramPageByBetType,
filterHKCoupledEntries,
mapSelectionsToNumber,
mapBetSelectionsToNumber,
hasBetType
};
export default betSelections;
webpack://frontend-tpt/../../packages/tvg-lib-utils/RaceHeaderUtils.js
import { get, has, map, omit, forEach, pickBy } from "lodash";
import { formatPurse } from "@tvg/formatter/currency";
import { differenceInMinutes } from "date-fns";
const createRaceDataForHeader = (race, enableRaceChanges = false) => {
const keysRace = [
"numRunners",
"distance",
"surface.shortName",
"surface.defaultCondition",
"raceClass.shortName",
"type.shortName",
"purse"
];
const changesKeyMap = {
distance: "distance",
"surface.shortName": "course",
"surface.defaultCondition": "condition"
};
const keyGreyhoundsRace = ["distance", "raceClass.name"];
const dataArr = get(race, "isGreyhound") ? keyGreyhoundsRace : keysRace;
const surfaceChanges = pickBy(get(race, "changes.surface"));
const resArr = [];
forEach(dataArr, (item) => {
const defRes = {
item,
changed:
enableRaceChanges &&
Object.keys(surfaceChanges).indexOf(changesKeyMap[item]) !== -1
};
if (has(race, item)) {
if (item === "raceClass.shortName" && get(race, "claimingPrice") > 0) {
resArr.push({
...defRes,
value: `${formatPurse(get(race, "claimingPrice"))} ${get(race, item)}`
});
} else if (item === "purse") {
resArr.push({
...defRes,
value: formatPurse(get(race, "purse"))
});
} else {
const raceItem = get(race, item);
if (raceItem) {
resArr.push({
...defRes,
value: item === "numRunners" ? `${raceItem} runners` : raceItem
});
}
}
}
});
return map(resArr, (e) => omit(e, "item"));
};
export const getVideoFeedback = (
currentRace,
firstRace,
lastRace,
enableReplays
) => {
let replayValue = false;
if (
enableReplays &&
get(currentRace, "video.hasReplay", false) &&
get(currentRace, "video.replayFileName") &&
get(currentRace, "video.mobileAvailable")
) {
replayValue = true;
}
if (!get(currentRace, "video.liveStreaming")) {
return replayValue ? "NOT_AVAILABLE_REPLAY" : "NOT_AVAILABLE_NO_REPLAY";
}
const firstRaceDate = new Date(get(firstRace, "postTime"));
const lastRaceDate = new Date(get(lastRace, "postTime"));
const dateNow = new Date();
const firstRaceDiff = differenceInMinutes(dateNow, firstRaceDate);
const lastRaceDiff = differenceInMinutes(lastRaceDate, dateNow);
// one hour and a half before the first race
if (firstRaceDiff < -90) {
return replayValue ? "NOT_AVAILABLE_REPLAY" : "NOT_AVAILABLE_NO_REPLAY";
}
// between 1 hour and a half and 1 hour before the first race
if (firstRaceDiff >= -90 && firstRaceDiff < -60) {
return replayValue ? "STARTING_SOON_REPLAY" : "STARTING_SOON_NO_REPLAY";
}
// half an hour after the last race
if (lastRaceDiff < -30) {
return replayValue ? "FINISHED_REPLAY" : "FINISHED_NO_REPLAY";
}
return replayValue ? "AVAILABLE_REPLAY" : "AVAILABLE_NO_REPLAY";
};
const getImportanceLevel = (level) => (level === "Normal" ? "0" : "1");
const RaceHeaderUtils = {
createRaceDataForHeader,
getVideoFeedback,
getImportanceLevel
};
export default RaceHeaderUtils;
webpack://frontend-tpt/../../packages/tvg-lib-api/wtx/index.ts
import tvgConf from "@tvg/conf";
import { PRODUCTS_FDR_X_SELL } from "@tvg/conf/src/product";
import { get } from "lodash/fp";
import { v1 as generateUUID } from "uuid";
import getProtocol from "../protocolSetter";
import requester from "../requester";
const isNative = tvgConf().context().includes("iosnative");
if (isNative) {
// @ts-ignore -> This import only need on react native because the UUID library since UUID use native module to generate UUID.
import("react-native-get-random-values");
}
const X_GEO_PACKET = "X-Geo-Packet";
const X_GEO_TOKEN = "X-Geo-Token";
const X_SELL = "X-Sell";
const wtxService: string = "service.wtx";
const getWtxServiceUrl = (): string =>
`${getProtocol()}${tvgConf().config(wtxService)}`;
type raceType = {
trackAbbr: string | undefined | null;
raceNumber: string | undefined | null;
};
export type SuccessReceipt = {
price: number;
serialNumber: string;
};
export type ErrorReceipt = {
code: number;
message: string;
exception: string;
};
export type BetReceipt = {
success?: SuccessReceipt;
error?: ErrorReceipt;
statusCode: number;
};
export type WagerSummary = {
requested: number;
fulfilled: number;
failed: number;
price: number;
userBalance: number;
wagerReference: string;
};
export type Wager = {
summary: WagerSummary;
status: BetReceipt[];
};
export type CancelBetResponse = {
status: number;
config: {
url: string;
};
data: {
userBalance: number;
code: number;
message: string;
exception: string;
timestamp: string;
path: string;
};
};
export type LegSelectionsType = Array<{
bettingInterests: Array<{
order: number;
}>;
alternate?: number | null;
}>;
export type SelectionsType = Array<
Array<{
order: number;
}>
>;
const cancelBet = (
serialNumber: string,
wagerReference: string,
accountNumber: string
): Promise<CancelBetResponse> =>
requester()({
url: `${getWtxServiceUrl()}/users/${accountNumber}/wagers/${wagerReference}/${serialNumber}`,
method: "delete",
withCredentials: true,
headers: { "x-tvg-context": tvgConf().context() }
}) as unknown as Promise<CancelBetResponse>;
const placeBet = (
selections: SelectionsType,
betType: string,
betAmount: number,
betCost: number,
race: raceType,
location: unknown,
regionDetails: unknown,
accountNumber: string,
numberOfBets: number = 1
): Promise<Wager> => {
if (betAmount <= 0 && betCost <= 0) {
return Promise.reject(new Error("Invalid bet params"));
}
if (!selections.length) {
return Promise.reject(new Error("Invalid selections"));
}
if (!get("trackAbbr", race) || !get("raceNumber", race)) {
return Promise.reject(new Error("Invalid race params"));
}
const uuid = generateUUID();
const betToPlace = {
wagerReference: uuid,
track: race.trackAbbr,
race: race.raceNumber,
amount: betAmount,
price: +betCost.toFixed(2),
type: betType,
selections
};
const postData = {
wager: betToPlace,
regions: regionDetails,
location
};
const url = `${getWtxServiceUrl()}/users/${accountNumber}/wagers${
numberOfBets > 1 ? `?wagersToBePlaced=${numberOfBets}` : ""
}`;
const moreHeaders: Record<string, string | boolean | undefined> = {};
const geoPacket = isNative
? ""
: typeof window !== "undefined" && localStorage.getItem(X_GEO_TOKEN);
if (geoPacket) {
moreHeaders[X_GEO_PACKET] = geoPacket;
}
const isXSell = PRODUCTS_FDR_X_SELL.includes(tvgConf().product);
if (isXSell) {
moreHeaders[X_SELL] = true;
}
return requester()({
method: "post",
url,
data: postData,
withCredentials: true,
headers: {
"Content-Type": "application/json",
"X-XSRF-TOKEN": uuid,
"x-tvg-context": tvgConf().context(),
...moreHeaders
}
}).then(get("data"));
};
const placeWager = (
selections: LegSelectionsType,
betType: string,
betAmount: number,
betCost: number,
race: raceType,
location: unknown,
regionDetails: unknown,
accountNumber: string,
numberOfBets: number = 1
): Promise<Wager> => {
if (betAmount <= 0 && betCost <= 0) {
return Promise.reject(new Error("Invalid bet params"));
}
if (!selections.length) {
return Promise.reject(new Error("Invalid selections"));
}
if (!get("trackAbbr", race) || !get("raceNumber", race)) {
return Promise.reject(new Error("Invalid race params"));
}
const uuid = generateUUID();
const betToPlace = {
wagerReference: uuid,
track: race.trackAbbr,
race: race.raceNumber,
amount: betAmount,
price: +betCost.toFixed(2),
type: betType,
legSelections: selections
};
const postData = {
wager: betToPlace,
regions: regionDetails,
location
};
const url = `${getWtxServiceUrl()}/users/${accountNumber}/wagers${
numberOfBets > 1 ? `?wagersToBePlaced=${numberOfBets}` : ""
}`;
const moreHeaders: Record<string, string | boolean | undefined> = {};
const geoPacket = isNative
? ""
: typeof window !== "undefined" && localStorage.getItem(X_GEO_TOKEN);
if (geoPacket) {
moreHeaders[X_GEO_PACKET] = geoPacket;
}
const isXSell = PRODUCTS_FDR_X_SELL.includes(tvgConf().product);
if (isXSell) {
moreHeaders[X_SELL] = true;
}
return requester()({
method: "post",
url,
data: postData,
withCredentials: true,
headers: {
"Content-Type": "application/json",
"X-XSRF-TOKEN": uuid,
"x-tvg-context": tvgConf().context(),
...moreHeaders
}
}).then(get("data"));
};
const WTX_SERVICE = {
cancelBet,
placeBet,
placeWager
};
export default WTX_SERVICE;
webpack://frontend-tpt/../../packages/tvg-lib-api/wtx/BetSelectionsHelper.ts
const DEFAULT_SEPARATOR = ",";
const CONSECUTIVE_SELECTIONS_SEPARATOR = "-";
let consecutiveSelections: string[];
let currentSelection: number[];
/**
* Calculate the correct string separator
* @param selections
*/
const getStringSeparator = (selections: Array<number>): string =>
selections.length === 2 && selections[1] - selections[0] > 1
? CONSECUTIVE_SELECTIONS_SEPARATOR
: DEFAULT_SEPARATOR;
/**
* Add consecutive selection
*/
const pushCurrentSelectionToConsecutiveSelections = (): void => {
consecutiveSelections.push(
currentSelection.join(getStringSeparator(currentSelection))
);
};
/**
* Process each selection and add it to the current selection
* @param selection
*/
const forEachSelectionCallback = (selection: number): void => {
if (currentSelection.length) {
if (selection - currentSelection[currentSelection.length - 1] === 1) {
if (currentSelection.length === 2) {
currentSelection[1] = selection;
} else {
currentSelection.push(selection);
}
} else {
pushCurrentSelectionToConsecutiveSelections();
currentSelection = [selection];
}
} else {
currentSelection.push(selection);
}
};
/**
* Calculate string in each step of selections
* @param selections
* @return {string}
*/
const stepSelectionsStringFilter = (selections: Array<number>): string => {
// Reset state
consecutiveSelections = [];
currentSelection = [];
if (!Array.isArray(selections)) {
return selections;
}
const sortedSelections = selections.sort((a, b) => a - b);
sortedSelections.forEach(forEachSelectionCallback);
pushCurrentSelectionToConsecutiveSelections();
return consecutiveSelections.join(DEFAULT_SEPARATOR);
};
export default stepSelectionsStringFilter;
webpack://frontend-tpt/../../packages/tvg-lib-api/wtx/BetHelper.ts
import { get, compact } from "lodash";
import { RaceWagerType } from "@tvg/ts-types/Race";
import stepSelectionsStringFilter from "./BetSelectionsHelper";
type UserSelections = Array<Array<number>>;
export type BetTotal = {
betCount: number;
betAmount?: number;
betCost: string;
wagerName: string;
wagerId: number;
wagerCode?: string;
wagersString: string;
userSelections?: UserSelections;
};
// This will filter bad selections of scratched runners before doing a bet
const filterBadSelections = (selections: UserSelections) =>
selections
.filter((selection) => selection)
.map((selection) => selection.filter((s) => s));
/**
* wager multiplier by betType
*/
const wagerMultiplier = {
WP: 2,
WS: 2,
PS: 2,
WPS: 3
};
/**
* step by bet type
*/
const betSteps = {
QN: 2,
QNB: 2,
EXB: 2,
TRB: 3,
SUB: 4,
H5B: 5,
OM: 2,
OMB: 2,
OMW: 2,
TI: 3,
TIB: 4
};
/**
* Build wager string from bet type and selection
* @param wagerType
* @param userSelections
* @return {string}
*/
const getWagerString = (
wagerType: RaceWagerType,
userSelections: UserSelections
): string => {
let wagerString = "";
for (let i = 0; i < wagerType.columnCount; i += 1) {
if (i !== 0) {
wagerString += " | ";
}
if (get(userSelections, `[${i}]`, []).length) {
wagerString += stepSelectionsStringFilter(userSelections[i]);
} else {
wagerString += "?";
}
}
return wagerString;
};
/**
* Calculate the cartesian product of a matrix
* @param matrix
* @return {Array<Array<number>>}
*/
const cartesianProductOf = (
matrix: Array<Array<number>>
): Array<Array<number>> =>
matrix.reduce(
(a: Array<Array<number>>, b: Array<number>) => {
const ret: Array<Array<number>> = [];
a.forEach((tempA) => {
b.forEach((tempB) => {
if (tempA.indexOf(tempB) < 0) {
ret.push(tempA.concat([tempB]));
}
});
});
return ret;
},
[[]]
);
/**
* Return minimal user selection per step by bet type
* @param wagerType
* @returns {number}
*/
const getMinUserSelectionPerStep = (wagerType: RaceWagerType) =>
get(betSteps, wagerType.type.code, 1);
/**
* Return bet multiplier by bet type
* @param wagerType
* @returns {number}
*/
const getWagerTypeMultiplier = (wagerType: RaceWagerType) =>
get(wagerMultiplier, wagerType.type.code, 1);
/**
* Calculate total number of fecta box bets
* @param userSelections
* @param numOfPositions
* @returns {number}
*/
const calculateFectaBoxTotalBets = (
userSelections: UserSelections,
numOfPositions: number
): number => {
let selections = get(userSelections, "[0].length");
let res = 1;
for (let i = 0; i < numOfPositions; i += 1) {
res *= selections;
selections -= 1;
}
return res;
};
/**
* Calculate total number of fecta wheels bets
* @param userSelections
* @returns {Array}
*/
const calculateFectaWheelsTotalBets = (
userSelections: UserSelections
): Array<Array<number>> => {
let res: Array<Array<number>> = [];
let firstColumn: Array<number> = [];
let selectionsLength = 0;
let i;
const otherColumns = [];
const userSelectionLength = userSelections.length;
for (i = 0; i < userSelectionLength; i += 1) {
const column = userSelections[i];
if (i === 0) {
firstColumn = column;
selectionsLength = firstColumn.length;
} else {
otherColumns.push(column);
}
}
for (i = 0; i < selectionsLength; i += 1) {
const firstColumnValue = [firstColumn[i]];
const matrix = otherColumns.slice(0);
matrix.unshift(firstColumnValue);
res = res.concat(cartesianProductOf(matrix));
}
return res;
};
/**
* Calculate number of bets on straight and legs bets
* @param userSelections
* @return {number}
*/
const calculateStraightAndLegsTotalBets = (userSelections: UserSelections) => {
let res = 1;
for (let i = 0; i < userSelections.length; i += 1) {
const legSelections = userSelections[i].length;
res *= legSelections;
}
return res;
};
/**
* Calculate total number of bets on Quinella
* @param userSelections
* @returns {number}
*/
const calculateQuinellaTotalBets = (userSelections: UserSelections): number => {
const selections = get(userSelections, "[0].length");
return selections === 2 ? 1 : 0;
};
/**
* Calculate total number of bets on Quinella Box
* @param userSelections
* @returns {number}
*/
const calculateQuinellaBoxTotalBets = (
userSelections: UserSelections
): number => {
const selections = get(userSelections, "[0].length");
return selections >= 2 ? (selections * (selections - 1)) / 2 : 0;
};
/**
* Calculate the possible combination of bets for Quinella wheel
* @param userSelections
* @returns {number}
*/
const calculateQuinellaWheelTotalBets = (
userSelections: UserSelections
): Array<Array<number>> => {
let res: Array<Array<number>> = [];
const firstColumn = userSelections[0];
const firstColumnLength = firstColumn.length;
const secColumn = userSelections[1];
const secColumnLength = secColumn.length;
const alreadyUsedKeys = [];
/* eslint-disable */
for (let i = 0; i < firstColumnLength; i += 1) {
const firstColumnValue = [firstColumn[i]];
const matrix: Array<Array<number>> = [[]];
for (let j = 0; j < secColumnLength; j += 1) {
const secColumnItem = secColumn[j];
const keyPar =
(BigInt(1) << BigInt(secColumnItem)) ^
// @ts-ignore
(BigInt(1) << BigInt(firstColumnValue)); // bitwise operation if 2nd column value is different from de 1st, calculate the bitwise value of the column to generate a unique key the pair combination
if (
// @ts-ignore
secColumnItem != firstColumnValue &&
alreadyUsedKeys.indexOf(keyPar) < 0
) {
matrix[0].push(secColumnItem);
}
alreadyUsedKeys.push(keyPar);
}
matrix.unshift(firstColumnValue);
res = res.concat(cartesianProductOf(matrix));
}
/* eslint-enable */
return res;
};
/**
* Calculate the possible combination of bets for Trio
* @param userSelections
* @returns {number}
*/
const calculateTrioTotalBets = (userSelections: UserSelections): number => {
const selections = get(userSelections, "[0].length");
return selections === 3 ? 1 : 0;
};
/**
* Calculate the possible combination of bets for Trio Box
* @param userSelections
* @returns {number}
*/
const calculateTrioBoxTotalBets = (userSelections: UserSelections): number => {
const selections = get(userSelections, "[0].length");
return selections >= 4
? (selections * (selections - 1) * (selections - 2)) / 6
: 0;
};
/**
* Calculate the possible combination of bets for Trio Wheel
* @param userSelections
* @returns {number}
*/
function calculateTrioWheelTotalBets(userSelections: UserSelections) {
const firstColLength = get(userSelections, "[0].length");
const secColLength = get(userSelections, "[1].length");
let res = 1;
if (
firstColLength < 1 ||
firstColLength > 2 ||
firstColLength + secColLength < 3
) {
res = 0;
} else if (firstColLength === 2) {
res = secColLength;
} else {
const filteredSelections = userSelections[1].filter(
(selection) => !userSelections[0].includes(selection)
);
res = filteredSelections.reduce(
(acc, _, i, self) => acc + self.slice(i + 1).length,
0
);
}
return res;
}
/**
* Calculate total number of bets for keys types
* @param userSelections
* @param numOfPositions
* @param isBox
* @returns {number}
*/
const calculateKeysTotalBets = (
userSelections: UserSelections,
numOfPositions: number,
isBox: boolean
) => {
let selections = 0;
let res = 1;
if (
get(userSelections, "[0]", []).length &&
get(userSelections, "[1]", []).length
) {
selections = userSelections[1].length;
for (let i = 0; i < numOfPositions - 1; i += 1) {
res *= selections;
selections -= 1;
}
if (isBox) {
res *= numOfPositions;
}
} else {
res = 0;
}
return res;
};
/**
* Calculate the bet count by bet type
* @param wagerType
* @param selections
* @return {number}
*/
const calculateBetCount = (
wagerType: RaceWagerType,
selections: UserSelections
): number => {
let betCount = 0;
if (wagerType.type.code === "QN" || wagerType.type.code === "OM") {
betCount = calculateQuinellaTotalBets(selections);
} else if (wagerType.type.code === "QNB" || wagerType.type.code === "OMB") {
betCount = calculateQuinellaBoxTotalBets(selections);
} else if (wagerType.type.code === "QNW" || wagerType.type.code === "OMW") {
betCount = calculateQuinellaWheelTotalBets(selections).length;
} else if (wagerType.type.code === "TI") {
betCount = calculateTrioTotalBets(selections);
} else if (wagerType.type.code === "TIB") {
betCount = calculateTrioBoxTotalBets(selections);
} else if (wagerType.type.code === "TIW") {
betCount = calculateTrioWheelTotalBets(selections);
} else if (wagerType.isKey) {
betCount = calculateKeysTotalBets(
selections,
wagerType.positionCount,
wagerType.isBox
);
} else if (wagerType.isBox) {
const numberOfPositions = getMinUserSelectionPerStep(wagerType);
betCount = calculateFectaBoxTotalBets(selections, numberOfPositions);
} else if (wagerType.columnCount > 1 && wagerType.legCount === 1) {
if (wagerType.isWheel) {
betCount = calculateFectaWheelsTotalBets(selections).length;
} else {
// calculate bet count for fecta bets
betCount = cartesianProductOf(selections).length;
}
} else {
const betTypeMultiplier = getWagerTypeMultiplier(wagerType);
betCount =
calculateStraightAndLegsTotalBets(selections) * betTypeMultiplier;
}
return betCount;
};
/**
* Calculate bet totals and if the selected params are valid
* @param Amount amount per bet
* @param WagerType wager type select
* @param userSelections matrix off user selections
* @returns {{}}
*/
const calculateBetTotal = (
amount: number,
wagerType: RaceWagerType,
userSelections: UserSelections
): BetTotal => {
const filteredUS = filterBadSelections(compact(userSelections));
const result: {
betCount: number;
betAmount?: number;
betCost: string;
wagerName: string;
wagerId: number;
wagerCode?: string;
wagersString: string;
userSelections?: number[][];
BIs: number[][];
} = {
betCount: 0,
betCost: "0.00",
wagerName: wagerType.type.name,
wagerId: wagerType.type.id,
wagersString: "",
BIs: filteredUS
};
if (!(amount > 0.0 && filteredUS && filteredUS.length > 0)) {
return result;
}
const betCount = calculateBetCount(wagerType, filteredUS);
result.betCount = betCount;
result.betAmount = amount;
result.betCost = (betCount * amount).toFixed(2);
result.wagerName = wagerType.type.name;
result.wagerId = wagerType.type.id;
result.wagerCode = wagerType.type.code;
result.wagersString = getWagerString(wagerType, filteredUS);
result.userSelections = filteredUS;
return result;
};
export const sortRunnersSelections = (
runnerNumberA: string | number,
runnerNumberB: string | number
) => +runnerNumberA - +runnerNumberB;
export default calculateBetTotal;
webpack://frontend-tpt/../../packages/tvg-lib-geolocation/src/index.js
import axios from "axios";
import { get, has } from "lodash";
import TvgConf from "@tvg/conf";
import getProtocol from "@tvg/api/protocolSetter";
/**
* TVG Geoloction instance
*/
export default class Geolocation {
locationOptions;
/**
* Instantiates class with default configurations
* @param config
*/
constructor(
config = {
enableHighAccuracy: true,
timeout: 10000,
maximumAge: 300000
}
) {
this.locationOptions = {
enableHighAccuracy: config.enableHighAccuracy,
timeout: config.timeout,
maximumAge: config.maximumAge
};
}
/**
* Default region data
* @type {{location: {latitude: number, longitude: number}, regions: [null]}}
*/
static defaultRegionObject = {
location: {
latitude: 0,
longitude: 0
},
regions: [
{
description: "",
id: 0,
name: "Default",
type: "Default"
}
],
state: ""
};
/**
* Determines if geolocation browser api is availiable
* @returns {boolean|Geolocation}
*/
static isGeolocationAvailable() {
return typeof navigator === "object" && navigator.geolocation;
}
/**
* Sets region data with location coordinates
* and region obtained from GEO or default region
* @param position
* @param region
* @returns {RegionData}
*/
static setRegionData(position, region) {
const { latitude, longitude } = get(position, "coords");
const regionData = Geolocation.defaultRegionObject;
regionData.location.latitude = latitude;
regionData.location.longitude = longitude;
regionData.regions = get(region, "regions");
return regionData;
}
/**
* Make request to GEO and resolves with region data
* @param position
* @returns {Promise|Promise.<RegionData>}
*/
static requestGeoRegion(position, enableMockedLocation = false) {
const { latitude, longitude } = position.coords;
const requestMethod = "/regions/search/findByGpsCoordinate";
const requestParams = `?latitude=${latitude || "null"}&longitude=${
longitude || "null"
}`;
const requestUrl = `${getProtocol()}${TvgConf().config(
"service.geo"
)}${requestMethod}${requestParams}`;
return axios
.get(requestUrl, {
withCredentials: true,
headers: {
"x-tvg-context": TvgConf().context(),
"mock-successful-response": enableMockedLocation
}
})
.then((response) => get(response, "data"));
}
/**
* Gets geo location coordinates trough browser api
* and resolves region data from GEO service
* or default region with location obtained
* @returns {Promise|Promise.<RegionData>}
*/
requestLocation() {
return new Promise((resolve, reject) =>
Geolocation.isGeolocationAvailable()
? navigator.geolocation.getCurrentPosition(
(position) =>
Geolocation.requestGeoRegion(position)
.catch(() => null)
.then((regionData) =>
Geolocation.setRegionData(position, regionData)
)
.then(resolve),
(error) => reject(error),
this.locationOptions
)
: reject("Geolocation is not supported")
);
}
/**
* Set geo location coordinates
* and resolves region data from GEO service
* or default region with location obtained
* @returns {Promise|Promise.<RegionData>}
*/
static setLocation(latitude, longitude) {
const position = {
coords: {
latitude,
longitude
}
};
return new Promise((resolve) =>
Geolocation.requestGeoRegion(position)
.then((regionData) => Geolocation.setRegionData(position, regionData))
.catch(() => null)
.then((regionData) => Geolocation.setRegionData(position, regionData))
.then(resolve)
);
}
/**
* Make request to GEO to validate state with context
* @param state:string
* @returns {Promise|Promise.<boolean>}
*/
static validateState(state) {
const requestMethod = `/states/${state}`;
const requestParams = "/blacklisted";
const requestUrl = `${getProtocol()}${TvgConf().config(
"service.geo"
)}${requestMethod}${requestParams}`;
return axios
.get(requestUrl, {
headers: { "x-tvg-context": TvgConf().context() }
})
.then((response) => {
if (has(response, "data.blacklisted")) {
return response.data.blacklisted;
}
throw new Error("Invalid response");
});
}
}
webpack://frontend-tpt/../../legacy/mediator/src/utils.js
// This file is here to replace Lodash.
// Currently we need to import 70Kb (after optimizations) from lodash just to use 6 functions.
// This is not worth it. If the uses cases for lodash increase, we should get
// rid of this.
export const isUndefined = (val) => typeof val === "undefined";
export const curry = (fn) =>
function cf(...args) {
return args.length >= fn.length
? fn(...args)
: (...a) => cf(...[...args, ...a]);
};
export const defaultTo = curry((defaults, value) =>
value === undefined || value === null || Number.isNaN(value)
? defaults
: value
);
export const isDifferent = curry((a, b) => a !== b);
webpack://frontend-tpt/../../legacy/mediator/src/Mediator.js
import { isUndefined, isDifferent } from "./utils";
const createEventHandler = (val) => ({
subscribers: [],
lastValue: val
});
class Mediator {
handlers;
constructor() {
this.handlers = {};
}
subscribe(type, handler) {
this.handlers[type] = this.handlers[type] || createEventHandler();
this.handlers[type].subscribers = [
...this.handlers[type].subscribers,
handler
];
return () => this.unsubscribe(type, handler);
}
subscribeTimes(times, type, handler) {
let count = 0;
const fnTimes = (current, max, val) => {
count += 1;
if (count === times) {
this.unsubscribe(type, fnTimes);
}
return handler(val);
};
this.subscribe(type, fnTimes);
return () => this.unsubscribe(type, fnTimes);
}
subscribeWithPast(type, handler) {
const unsubscribeHandler = this.subscribe(type, handler);
const eventHandler = this.handlers[type];
if (!isUndefined(eventHandler.lastValue)) {
handler(eventHandler.lastValue);
}
return unsubscribeHandler;
}
unsubscribe(type, handler) {
const evtHandler = this.handlers[type];
if (evtHandler) {
evtHandler.subscribers = evtHandler.subscribers.filter(
isDifferent(handler)
);
}
return this;
}
dispatch(type, value) {
const handler = this.handlers[type];
if (handler && handler.subscribers.length) {
handler.subscribers.map((fn) => fn(value));
this.handlers[type].lastValue = value;
} else {
this.handlers[type] = createEventHandler(value);
}
return this;
}
query(type) {
const handler = this.handlers[type];
return handler && handler.lastValue ? handler.lastValue : undefined;
}
}
export default Mediator;
webpack://frontend-tpt/../../legacy/mediator/src/MediatorNoop.js
class MediatorNoop {
handlers;
constructor() {
this.handlers = {};
}
subscribe(type, handler) {
return () => this.unsubscribe(type, handler);
}
subscribeTimes(times, type, handler) {
return () => this.unsubscribe(type, handler);
}
subscribeWithPast(type, handler) {
return () => this.unsubscribe(type, handler);
}
unsubscribe(
type,
handler // eslint-disable-line no-unused-vars
) {
return this;
}
// eslint-disable-next-line no-unused-vars
dispatch(type, value) {
return this;
}
query(type) {
const handler = this.handlers[type];
return handler && handler.lastValue ? handler.lastValue : undefined;
}
}
export default MediatorNoop;
webpack://frontend-tpt/../../legacy/mediator/src/index.js
import { curry } from "./utils";
import Mediator from "./Mediator";
import MediatorNoop from "./MediatorNoop";
const createMediator = () => {
if (typeof window !== "undefined" && !window.mediator) {
window.mediator = new Mediator();
return window.mediator;
}
if (typeof window !== "undefined" && window.mediator) {
return window.mediator;
}
return new MediatorNoop();
};
const instance = createMediator();
export const subscribe = curry((name, handler) =>
instance.subscribe(name, handler)
);
export const subscribeWithPast = curry((name, handler) =>
instance.subscribeWithPast(name, handler)
);
export const subscribeTimes = curry((count, name, handler) =>
instance.subscribeTimes(count, name, handler)
);
export const subscribeOnce = subscribeTimes(1);
export const subscribeTwice = subscribeTimes(2);
export const subscribeThrice = subscribeTimes(3);
export const unsubscribe = curry((name, handler) =>
instance.unsubscribe(name, handler)
);
export const dispatch = curry((type, value) => instance.dispatch(type, value));
export const query = (type) => instance.query(type);
webpack://frontend-tpt/../../packages/tvg-comp-location-splash/actions.js
export const openLocationSplash = () => ({
type: "OPEN_LOCATION_SPLASH"
});
export const clearSplashErrors = () => ({
type: "CLEAR_ERROR_SPLASH"
});
export const setBlockedCountry = (isLocationRequired) => ({
type: "SET_BLOCKED_COUNTRY",
payload: isLocationRequired
});
export const setAndroidBlockedState = () => ({
type: "ANDROID_BLOCKED_STATE"
});
export const closeLocationSplash = () => ({
type: "CLOSE_LOCATION_SPLASH"
});
export const setLocationRequired = (locationRequired) => ({
type: "SET_LOCATION_REQUIRED",
payload: locationRequired
});
export const setLocationLoading = (loading) => ({
type: "SET_LOCATION_LOADING",
payload: loading
});
export const setLocationDenied = () => ({
type: "SET_LOCATION_DENIED"
});
export const setLocationUnsupported = () => ({
type: "SET_LOCATION_UNSUPPORTED"
});
export const setLocationUnknownError = (showClose) => ({
type: "SET_LOCATION_UNKNOWN_ERROR",
payload: showClose
});
export const setLocationUnavailable = () => ({
type: "SET_LOCATION_UNAVAILABLE"
});
export const setLocationTimedOut = () => ({
type: "SET_LOCATION_TIMED_OUT"
});
export const setLocationUnauthorized = () => ({
type: "SET_LOCATION_UNAUTHORIZED"
});
export const getGeoLocation = (locationData) => ({
type: "GEO_LOCATION_GET",
payload: locationData
});
export const setOnLocationGet = (callback) => ({
type: "SET_ON_LOCATION_GET",
payload: callback
});
export const rgTimeoutExclusionSplash = (type, endDate) => ({
type: "RG_TIMEOUT_EXCLUSION_SPLASH",
payload: {
type,
endDate
}
});
webpack://frontend-tpt/../../packages/tvg-comp-location-splash/splashBuilder.js
import { attempt, isFunction, get } from "lodash";
import TvgGeolocation from "@tvg/geolocation";
import openExternalLinkIosFunc from "@tvg/utils/mediatorUtils";
import mediator from "@tvg/mediator";
import {
closeLocationSplash,
openLocationSplash,
setLocationDenied,
setLocationUnsupported,
setLocationTimedOut,
setLocationUnavailable,
setLocationUnknownError,
setLocationLoading,
getGeoLocation,
setOnLocationGet
} from "./actions";
import getInstructions from "./instructions";
export const requestLocation = (
dispatch,
geolocation,
onLocationGet,
fromTimeout = false
) => {
if (TvgGeolocation.isGeolocationAvailable()) {
dispatch(setLocationLoading(true));
geolocation
.requestLocation()
.then((locationData) => {
if (
window &&
window.localStorage &&
isFunction(window.localStorage.setItem)
) {
attempt(() =>
window.localStorage.setItem("shownLocationSplash", true)
);
}
dispatch(getGeoLocation(locationData));
if (onLocationGet && isFunction(onLocationGet)) {
onLocationGet(locationData);
}
dispatch(setLocationLoading(false));
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
})
.catch((error) => {
dispatch(setLocationLoading(false));
if (
window &&
window.localStorage &&
isFunction(window.localStorage.setItem)
) {
attempt(() =>
window.localStorage.setItem("shownLocationSplash", true)
);
}
switch (error.code) {
case error.PERMISSION_DENIED:
dispatch(setLocationDenied());
dispatch(openLocationSplash());
break;
case error.POSITION_UNAVAILABLE:
if (fromTimeout) {
requestLocation(dispatch, geolocation, onLocationGet);
} else {
dispatch(setLocationUnavailable());
dispatch(openLocationSplash());
}
break;
case error.TIMEOUT:
dispatch(setLocationTimedOut());
dispatch(openLocationSplash());
break;
case error.UNKNOWN_ERROR:
default:
dispatch(setLocationUnknownError(false));
dispatch(openLocationSplash());
break;
}
});
} else {
dispatch(setLocationUnsupported());
dispatch(openLocationSplash());
}
};
export const buildAllowLocationSplash = (
dispatch,
geolocation,
isLoading,
onLocationGet,
brand,
customerServicesUrl,
isIos
) => ({
brand,
onClose: isLoading
? undefined
: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
},
icon: "location",
preTitle: "Please Allow",
title: "Location Services",
description:
"Sorry but for legal reasons we need location services to be enabled to confirm you are in an area that allows online horse wagering.",
infoText:
"If prompted to share your current location press \u201cok\u201d or \u201callow\u201d",
showCustomerServicesUrl: true,
customerServicesUrl,
isIos,
iOSMessageUsCallback: () => openExternalLinkIosFunc(customerServicesUrl),
buttons: [
[
{
type: "primary",
icon: "location",
text: "allow location services",
onClick: () => requestLocation(dispatch, geolocation, onLocationGet),
isDisabled: isLoading
}
],
[
{
type: "tertiary",
text: "I don't want to bet",
onClick: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
},
isDisabled: isLoading
}
]
]
});
export const buildBlockedCountrySplash = (dispatch, brand, isLoading) => ({
brand,
isLoading,
title: `${brand.toUpperCase()} is not available outside the US`,
description: `Wagering on ${brand} is not enabled while abroad. </br> When you return home, come back and try again.`,
isAndroidBlocked: true,
androidBlockType: "country",
buttons: [
[
{
type: "primary",
icon: "location",
text: "Check my location again",
onClick: () => {
dispatch(setLocationLoading(true));
mediator.ios.dispatch({ type: "ASK_LOCATION" });
}
}
]
]
});
export const buildAndroidBlockedState = (
messages,
dispatch,
brand,
isLoading
) => {
return {
brand,
isLoading,
title: get(messages, `tvg.title`),
description: get(messages, `tvg.description`),
isAndroidBlocked: true,
androidBlockType: "state"
};
};
export const buildLocationDeniedSplash = (
dispatch,
brand,
customerServicesUrl,
isApp
) => ({
brand,
onClose: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
},
icon: "warning",
preTitle: "Please Allow",
title: "Location Services",
infoText: "We are unable to access your location",
infoType: "error",
instructions: getInstructions("denied"),
showCustomerServicesUrl: true,
customerServicesUrl,
isApp,
iOSMessageUsCallback: () => openExternalLinkIosFunc(customerServicesUrl),
buttons: [
[
{
type: "primary",
icon: "refresh",
text: "refresh",
onClick: () => {
if (location && isFunction(location.reload)) {
location.reload();
}
}
}
]
]
});
export const buildLocationUnsupportedSplash = (
dispatch,
brand,
customerServicesUrl,
isApp
) => ({
brand,
onClose: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
},
icon: "warning",
title: "Browser Unsupported",
description:
"Sorry but we don't support the browser you're using, please use the latest version of Chrome for the best results.",
infoText:
"This site requires location services which are not supported in the browser you are using",
showCustomerServicesUrl: true,
customerServicesUrl,
isApp,
iOSMessageUsCallback: () => openExternalLinkIosFunc(customerServicesUrl),
buttons: [
[
{
type: "primary",
text: "close",
onClick: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
}
}
]
]
});
export const buildUnknownErrorSplash = (
dispatch,
geolocation,
isLoading,
onLocationGet,
brand,
customerServicesUrl,
isApp,
showClose = false
) => ({
brand,
onClose: isLoading
? undefined
: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
},
icon: "warning",
title: "Unknown Error",
description:
"Sorry we're not sure what went wrong, please check you are connected to the internet and location services are turned on and try again.",
infoText: "An error has occurred whilst trying to access location services",
showCustomerServicesUrl: true,
customerServicesUrl,
isApp,
iOSMessageUsCallback: () => openExternalLinkIosFunc(customerServicesUrl),
buttons: [
[
{
type: "primary",
text: showClose ? "close" : "try again",
onClick: () => {
if (showClose) {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
} else {
requestLocation(dispatch, geolocation, onLocationGet);
}
},
isDisabled: isLoading
}
]
]
});
export const buildPositionUnavailableSplash = (
dispatch,
brand,
customerServicesUrl,
isApp
) => ({
brand,
onClose: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
},
icon: "warning",
preTitle: "Please Allow",
title: "Location Services",
infoText: "We are unable to access your location",
infoType: "error",
instructions: getInstructions("unavailable"),
showCustomerServicesUrl: true,
customerServicesUrl,
isApp,
iOSMessageUsCallback: () => openExternalLinkIosFunc(customerServicesUrl),
buttons: [
[
{
type: "primary",
icon: "refresh",
text: "refresh",
onClick: () => {
if (location && isFunction(location.reload)) {
location.reload();
}
}
}
]
]
});
export const buildTimedOutSplash = (
dispatch,
geolocation,
isLoading,
onLocationGet,
brand,
customerServicesUrl,
isApp
) => ({
brand,
onClose: isLoading
? undefined
: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
},
icon: "warning",
title: "Request Timed Out",
description:
"Sorry we lost connection, please try again, this could be your internet is unstable or our site is very busy.",
infoText:
"The request to check if your location services are enabled has timed out",
showCustomerServicesUrl: true,
customerServicesUrl,
isApp,
iOSMessageUsCallback: () => openExternalLinkIosFunc(customerServicesUrl),
buttons: [
[
{
type: "primary",
text: "try again",
onClick: () => {
requestLocation(dispatch, geolocation, onLocationGet, true);
},
isDisabled: isLoading
}
]
]
});
export const buildUnauthorizedLocationSplash = (
dispatch,
geolocation,
isLoading,
brand,
customerServicesUrl,
isApp
) => ({
brand,
onClose: isLoading
? undefined
: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
},
icon: "warning",
title: "Invalid wagering state",
description:
"It seems you are trying to access the application from a non valid wagering state.",
infoType: "warning",
infoText:
"Sorry but for legal reasons you need to be in valid wagering state, if you are please check your location services are enabled or you can <a target='_blank' href='https://support.tvg.com/s/' style='color:inherit; text-decoration: underline; font-weight:bold; font-family: inherit; display: contents;'>message our customer service</a> for more info.",
showCustomerServicesUrl: true,
customerServicesUrl,
isApp,
iOSMessageUsCallback: () => openExternalLinkIosFunc(customerServicesUrl),
buttons: [
[
{
type: "primary",
text: "Close",
onClick: () => {
dispatch(setOnLocationGet(null));
dispatch(closeLocationSplash());
}
}
]
]
});
export const buildTimeoutExclusionSplash = (
brand,
customerServicesUrl,
isApp,
title,
description,
icon
) => ({
brand,
icon,
title,
description,
infoType: "warning",
showCustomerServicesUrl: true,
customerServicesUrl,
isApp,
iOSMessageUsCallback: () => openExternalLinkIosFunc(customerServicesUrl),
buttons: [],
className: "rgErrorPageMainContent"
});
webpack://frontend-tpt/../../packages/tvg-lib-utils/performanceUtils.js
export default {
register: (mark, timing = null) => {
if (typeof window === "object" && window.perf) {
window.perf.register(mark, timing);
}
},
measure: (mark, tags) => {
if (typeof window === "object" && window.perf) {
window.perf.measure(mark, tags);
}
}
};
webpack://frontend-tpt/../../packages/tvg-lib-api/fem/index.ts
import tvgConf from "@tvg/conf";
import getProtocol from "../protocolSetter";
import requester from "../requester";
const femService = "service.fem";
const sendMetric = (accountId: string, metricData: {}) =>
requester()({
method: "POST",
url: `${getProtocol()}${tvgConf().config(
femService
)}/users/${accountId}/metrics`,
headers: { "x-tvg-context": tvgConf().context() },
data: metricData,
withCredentials: true
});
const FEM_SERVICES = {
sendMetric
};
export default FEM_SERVICES;
webpack://frontend-tpt/../../packages/tvg-lib-metrics-collector/src/index.js
import femService from "@tvg/api/fem";
import tvgConf from "@tvg/conf";
import { BRAND_FDR } from "@tvg/conf/src/brand";
import metricsConfig from "./metricsConfigurations";
export const getDefaultLabels = (app) => ({
"part-of": "frontend",
technology: "node",
application: app
});
export const mapMetricDataToService = (app, metrics) =>
metrics.map((metric) => {
const metricConfig =
typeof metric === "string"
? {
...(metricsConfig[metric] || {})
}
: {
...(metricsConfig[metric.name] || {}),
value: metric.value
};
return { ...metricConfig, tags: { ...getDefaultLabels(app) } };
});
const sendAppMetrics = (app, accountId, metrics) => {
try {
femService
.sendMetric(accountId, mapMetricDataToService(app, metrics))
.catch(() => {
console.log("Error sending metrics");
});
} catch (e) {
console.log(e, "Error sending metrics");
}
};
export const getApp = () => {
const { brand } = tvgConf();
const { device } = tvgConf();
if (brand === BRAND_FDR) {
return "frontend-fdm";
}
return device === "desktop" ? "frontend-desk" : "frontend-mbl";
};
export default sendAppMetrics;
webpack://frontend-tpt/../../packages/tvg-lib-shared-actions/LocationActions.ts
import { RegionData } from "@tvg/geolocation";
import { NullaryFn, UnaryFn } from "@tvg/ts-types/Functional";
export type LocationOpenSplashAction = {
type: "OPEN_LOCATION_SPLASH";
};
export type SetOnLocationGet = {
type: "SET_ON_LOCATION_GET";
payload?: UnaryFn<RegionData, unknown> | NullaryFn<unknown>;
};
export type LocationSplashActions = LocationOpenSplashAction | SetOnLocationGet;
export const openLocationSplash = (): LocationOpenSplashAction => ({
type: "OPEN_LOCATION_SPLASH"
});
export const setOnLocationGet = (
callback?: UnaryFn<RegionData, unknown> | NullaryFn<unknown>
): SetOnLocationGet => ({
type: "SET_ON_LOCATION_GET",
payload: callback
});
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/CustomAmount/styled-components.js
import styled from "styled-components";
import NumberFormat from "react-number-format";
import buildColor from "../../_static/ColorPalette";
import { buildText } from "../../_atom/Text";
import ButtonDefault from "../../_atom/Buttons/default";
export const ClearButton = styled(ButtonDefault)`
background: ${buildColor("white", "0")};
position: absolute;
width: 40px;
height: 100%;
right: 0;
top: 50%;
transform: translate(0, -50%);
`;
export const CustomAmountContainer = styled.div`
display: flex;
flex-direction: column;
position: relative;
background-color: ${buildColor("white", "100")};
padding: 16px 40px;
text-align: center;
`;
export const MessageWrapper = styled.div`
padding: 8px;
background-color: ${buildColor("white", "100")};
`;
export const CustomAmountInput = styled(NumberFormat).attrs({
id: "customAmountInputId",
"data-qa-label": "customAmount-amountInput",
prefix: "$",
isNumericString: true,
displayType: "input",
decimalSeparator: ".",
thousandSeparator: true,
decimalScale: 2,
allowNegative: false
})`
height: 32px;
margin: 0 8px;
outline: none;
border: none;
font-size: 24px;
color: ${buildColor("grey", "900")};
text-align: center;
`;
export const CustomAmountLabel = buildText({
fontSize: 11,
color: buildColor("grey", "800")
});
export const UpdateButtonContainer = styled.div`
border-top: 1px solid ${buildColor("grey", "300")};
background-color: ${buildColor("blue", "000")};
padding: 8px;
& > button {
width: 100%;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/CustomAmount/index.jsx
import React, { Component, Fragment } from "react";
import { noop, toNumber } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import betAmountValidation from "@tvg/api/wtx/BetAmountHelper";
import {
ClearButton,
CustomAmountContainer,
UpdateButtonContainer,
CustomAmountInput,
CustomAmountLabel,
MessageWrapper
} from "./styled-components";
import buildColor from "../../_static/ColorPalette";
import { errorOutline } from "../../_static/Icons/icons";
import Icon from "../../_static/Icons";
import Button from "../../_atom/Buttons/button";
import MessageBox from "../MessageBox";
export default class CustomAmount extends Component {
static defaultProps = {
onUpdateBetAmount: noop,
minimumAmount: 0.1,
maxWagerAmount: 0
};
constructor(props) {
super(props);
this.state = {
amount: 0,
message: ""
};
}
onClearAmount = () => {
this.setState({
amount: 0,
message: ""
});
this.putFocusOnInput();
};
onChangeAmount = (format) => {
if (format.floatValue >= 100000) {
this.setState({ amount: this.state.amount });
return;
}
if (
isNaN(format.value[0]) ||
isNaN(format.value[format.value.length - 1])
) {
this.setState({ amount: format.value }); // keep the value as it is in case the user use the "." to enter a decimal value
this.putFocusOnInput();
} else {
this.setState({ amount: parseFloat(format.value) }); // remove zero from the begin of the string value if the amout is 1 or bigger. eg: 01.03 --> 1.03
}
};
onUpdateBetAmount = (value) => {
const validation = betAmountValidation(
value,
this.props.minimumAmount,
this.props.maxWagerAmount
);
if (validation && validation.message) {
this.setState({
message: validation.message,
amount: validation.amount
});
} else {
this.props.onUpdateBetAmount(validation.amount);
this.setState({
message: "",
amount: validation.amount
});
}
};
putFocusOnInput = () => {
const elem = document.getElementById("customAmountInputId");
if (elem) {
elem.focus();
setTimeout(() => elem.setSelectionRange(100, 100), 0); // this will throw the cursor to the end of the input
}
};
render() {
return (
<Fragment>
{this.state.message && (
<MessageWrapper>
<MessageBox type="warning" message={this.state.message} />
</MessageWrapper>
)}
<CustomAmountContainer>
<CustomAmountInput
onValueChange={this.onChangeAmount}
value={this.state.amount}
/>
<CustomAmountLabel data-qa-label="customAmount-minimumAmountLbl">
{`${formatCurrency(this.props.minimumAmount)} Minimum`}
</CustomAmountLabel>
<CustomAmountLabel data-qa-label="customAmount-maximumAmountLbl">
{`${formatCurrency(this.props.maxWagerAmount)} Maximum`}
</CustomAmountLabel>
<ClearButton
onClick={this.onClearAmount}
qaLabel="customAmount-clearBtn"
>
<Icon
icon={errorOutline}
size={16}
color={buildColor("grey", "900")}
/>
</ClearButton>
</CustomAmountContainer>
<UpdateButtonContainer>
<Button
size="big"
qaLabel="customAmount-updateAmountBtn"
onClick={() => this.onUpdateBetAmount(toNumber(this.state.amount))}
>
Update Bet Amount
</Button>
</UpdateButtonContainer>
</Fragment>
);
}
}
webpack://frontend-tpt/../../packages/tvg-lib-api/wtx/BetAmountHelper.ts
export type BetAmountValidationType = {
message: string;
amount: number;
};
const betAmountValidation = (
amount: number,
minimum: number,
maximum: number
): BetAmountValidationType => {
const errorMessage = "You inputted an incorrect bet size, we rounded it to: ";
const result = {
message: "",
amount
};
// eslint-disable-next-line
if (amount < minimum || Number.isNaN(amount)) {
result.message = errorMessage + minimum;
result.amount = minimum;
} else if (amount > maximum || Number.isNaN(amount)) {
result.message = errorMessage + maximum;
result.amount = maximum;
} else if (amount < 1) {
const remnant = ((amount * 100) % (minimum * 100)) / 100;
if (remnant !== 0) {
const newAmount = Math.floor(amount / minimum) * minimum;
result.message = errorMessage + newAmount;
result.amount = newAmount;
}
} else if (!Number.isInteger(amount)) {
result.message = errorMessage + parseInt(`${amount}`, 10);
result.amount = parseInt(`${amount}`, 10);
}
return result;
};
export default betAmountValidation;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/AmountSelector/styled-components.js
import styled from "styled-components";
import buildColor from "../../_static/ColorPalette";
import { buildText } from "../../_atom/Text";
import Icon from "../../_static/Icons";
import { fontMedium } from "../../_static/Typography";
export const AmountSelectorContainer = styled.div`
width: 120px;
height: 40px;
overflow: hidden;
flex: 0 0 auto;
margin: 0 8px;
border: 1px solid ${buildColor("grey", "300")};
border-radius: 2px;
position: relative;
`;
export const AmountLabelsWrapper = styled.span`
width: 100%;
height: 40px;
display: flex;
align-items: center;
justify-content: flex-start;
padding: 6px 32px 6px 8px;
`;
export const AmountValue = styled(
buildText({
tag: "span",
fontSize: 14,
color: buildColor("grey", "900"),
uppercase: true,
ellipsis: true
})
)`
font-family: ${fontMedium};
`;
export const SelectIcon = styled(Icon)`
position: absolute;
right: 8px;
top: 50%;
transform: translate(0, -50%);
`;
export const SelectList = styled.select.attrs({
"data-qa-label": "betTicket-amountSelector"
})`
opacity: 0;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 1;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/AmountSelector/index.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import {
SelectList,
AmountSelectorContainer,
AmountLabelsWrapper,
AmountValue,
SelectIcon
} from "./styled-components";
import buildColor from "../../_static/ColorPalette";
import { arrowDown } from "../../_static/Icons/icons";
export default class AmountSelector extends PureComponent {
static defaultProps = {
selectedBetAmount: 0,
onChangeBetAmount: noop,
betAmounts: [],
hasOtherAmount: false
};
getBetAmounts = () => {
const newBetAmounts = this.props.betAmounts.slice();
if (
this.props.selectedBetAmount > 0 &&
newBetAmounts.indexOf(this.props.selectedBetAmount) === -1
) {
newBetAmounts.push(this.props.selectedBetAmount);
}
return newBetAmounts.sort((a, b) => a - b);
};
render() {
const betAmounts = this.getBetAmounts();
return (
<AmountSelectorContainer>
<AmountLabelsWrapper>
<AmountValue data-qa-label="betTicket-amountSelectorValue">
{formatCurrency(this.props.selectedBetAmount)}
</AmountValue>
</AmountLabelsWrapper>
<SelectList
onChange={(event) => {
this.props.onChangeBetAmount(+event.target.value);
}}
value={this.props.selectedBetAmount}
>
{betAmounts.map((amount) => (
<option key={`betamount-${amount}`} value={amount}>
{formatCurrency(amount)}
</option>
))}
{this.props.hasOtherAmount && (
<option key="betamount-other" value="0">
Other
</option>
)}
</SelectList>
<SelectIcon
icon={arrowDown}
size={16}
color={buildColor("grey", "900")}
/>
</AmountSelectorContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/BetAmount/styled-components.js
import styled from "styled-components"; const BetAmountContainer = styled.div` width: 100%; `; export default BetAmountContainer;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/BetAmount/index.jsx
import React, { Component } from "react";
import { noop } from "lodash";
import useFakeInput from "@tvg/utils/useFakeInput";
import ModalV2 from "../../_templates/ModalV2";
import CustomAmount from "../../_molecule/CustomAmount";
import AmountSelector from "../../_molecule/AmountSelector";
import BetAmountContainer from "./styled-components";
export const getFirstSelectedAmount = (selectedBetAmount, maxWagerAmount) => {
return selectedBetAmount >= maxWagerAmount
? maxWagerAmount
: selectedBetAmount;
};
export default class BetAmount extends Component {
static defaultProps = {
selectedBetAmount: 0,
maxWagerAmount: 0,
onChangeBetAmount: noop,
onCloseCustomAmountModal: noop,
betAmounts: [],
hasOtherAmount: false,
minimumAmount: 0.1,
modalType: "bottom",
inIosAppTablet: false
};
constructor(props) {
super(props);
this.state = {
selectedBetAmount: getFirstSelectedAmount(
this.props.selectedBetAmount,
this.props.maxWagerAmount
),
isModalShown: false
};
}
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
if (
nextProps.selectedBetAmount !== this.props.selectedBetAmount ||
nextProps.maxWagerAmount !== this.props.maxWagerAmount
) {
this.setState({
selectedBetAmount: getFirstSelectedAmount(
nextProps.selectedBetAmount,
nextProps.maxWagerAmount
)
});
}
}
shouldComponentUpdate(nextProps, nextState) {
return (
nextProps.selectedBetAmount !== this.props.selectedBetAmount ||
nextProps.maxWagerAmount !== this.props.maxWagerAmount ||
nextProps.betAmounts.length !== this.props.betAmounts.length ||
nextProps.hasOtherAmount !== this.props.hasOtherAmount ||
nextProps.minimumAmount !== this.props.minimumAmount ||
nextState.selectedBetAmount !== this.state.selectedBetAmount ||
nextState.isModalShown !== this.state.isModalShown
);
}
onCloseModal = () => {
this.setState({
isModalShown: false
});
this.props.onCloseCustomAmountModal();
};
onOpenModal = () => {
if (!this.props.inIosAppTablet) {
const elem = document.getElementById("customAmountInputId");
if (elem) {
elem.focus();
setTimeout(() => elem.setSelectionRange(100, 100), 0); // this will throw the cursor to the end of the input
}
}
};
onChange = (value) => {
if (value > 0) {
this.setState({
selectedBetAmount: value
});
this.props.onChangeBetAmount(value, false);
} else {
this.setState({
isModalShown: true
});
}
};
updateBetAmount = (value) => {
// Hack for iOSApp in tablet when closing amount modal to fix the layout issues with the keyboard
if (this.props.inIosAppTablet) {
useFakeInput();
}
this.props.onChangeBetAmount(value, true);
this.setState({
selectedBetAmount: value,
isModalShown: false
});
};
render() {
const baseProps = {
title: "Custom Amount",
animation: this.props.modalType,
isOpen: this.state.isModalShown,
onClose: this.onCloseModal,
onOpen: this.onOpenModal,
qaLabel: "modal-customAmount",
isFullHeight: false,
useFakeInput: this.props.inIosAppTablet
};
const props =
this.props.modalType === "bottom"
? baseProps
: { ...baseProps, isFullWidth: false, offsetTop: 0 };
return (
<BetAmountContainer>
<AmountSelector
selectedBetAmount={this.state.selectedBetAmount}
onChangeBetAmount={this.onChange}
betAmounts={this.props.betAmounts}
hasOtherAmount={this.props.hasOtherAmount}
/>
<ModalV2 {...props}>
{
/* istanbul ignore next */
() => (
<CustomAmount
maxWagerAmount={this.props.maxWagerAmount}
minimumAmount={this.props.minimumAmount}
onUpdateBetAmount={this.updateBetAmount}
/>
)
}
</ModalV2>
</BetAmountContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/BetTicket/styled-components.js
import styled, { css } from "styled-components";
import { transparentize } from "polished";
import { buildText } from "../../_atom/Text";
import Button from "../../_atom/Buttons/button";
import ButtonDefault from "../../_atom/Buttons/default";
import Icon from "../../_static/Icons";
import buildColor from "../../_static/ColorPalette";
import {
generateTransition,
easeInOut,
cubic,
delayTime,
grow
} from "../../_static/Transitions";
import { fontMedium } from "../../_static/Typography";
export const BetTicketContainer = styled.div`
width: 100%;
${({ isDualColumn, isVisible }) =>
isDualColumn &&
css`
position: sticky;
bottom: 0;
z-index: 10;
${!isVisible &&
css`
display: none;
`};
`};
`;
export const BetTicketSection = styled.section`
width: 100%;
z-index: 30;
bottom: -85px;
min-height: 85px;
display: flex;
max-width: 600px;
flex: 0 0 auto;
background-color: ${buildColor("white", "100")};
box-shadow:
0 -3px 9px 0 ${transparentize(0.85, buildColor("black", "100"))},
0 1px 3px 0 ${buildColor("black", "100")};
will-change: bottom, opacity;
transition: ${generateTransition(cubic, "bottom")},
${generateTransition(easeInOut, "opacity")};
${(props) =>
props.isMobile
? css`
position: fixed;
`
: css`
position: sticky;
`};
${(props) =>
props.isVisible
? css`
bottom: 0;
opacity: 1;
transition-delay: ${delayTime};
`
: css`
opacity: 0;
overflow: hidden;
`};
&::before {
${(props) =>
props.isVisible &&
css`
content: "";
`};
background: transparent;
height: 20px;
position: absolute;
top: -20px;
width: 100%;
}
`;
export const TalentPicksWarning = styled.div`
position: sticky;
bottom: 85px;
`;
export const BetTypeTrashContainer = styled.div`
display: flex;
width: 56px;
flex: 0 0 auto;
flex-direction: column;
background-color: ${buildColor("blue", "000")};
border-right: 1px solid ${buildColor("blue", "100")};
align-items: center;
justify-content: space-between;
padding-bottom: 0;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
`;
export const WagersSubmitContainer = styled.div`
flex-grow: 1;
min-width: 0;
padding-bottom: 0;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
`;
export const ControlsContainer = styled.div`
display: flex;
padding: 8px 8px 8px 0;
`;
export const WagersContainer = styled.div`
width: 100%;
min-width: 0;
white-space: nowrap;
overflow: auto;
`;
export const BetTypeText = styled(
buildText({
tag: "span",
align: "center",
fontSize: 12,
uppercase: true
})
)`
display: flex;
flex: 0 0 auto;
width: 40px;
align-items: center;
justify-content: center;
height: 28px;
background-color: ${buildColor("blue", "000")};
border-bottom: 1px solid ${buildColor("blue", "100")};
line-height: 1;
`;
export const SelectionsWrapper = styled.div`
display: flex;
flex-grow: 1;
align-items: center;
flex-wrap: nowrap;
overflow: auto;
height: 28px;
padding: 0 8px;
border-bottom: 1px solid ${buildColor("blue", "100")};
& > ol {
flex-basis: 0;
& li > span {
animation: ${grow} 0.25s;
}
&:not(:first-child) {
margin-left: 8px;
}
}
`;
export const SelectionsEmpty = styled(buildText({ tag: "span", fontSize: 12 }))`
display: flex;
flex-grow: 1;
align-items: center;
justify-content: center;
height: 28px;
padding: 0 8px;
`;
export const Cancel = styled(ButtonDefault)`
width: 100%;
height: 40px;
flex: 1 0 auto;
border: 0;
border-radius: 0;
background-color: transparent;
`;
export const Add = styled(Icon)`
border-radius: 50%;
border: 2px solid ${buildColor("green", "600")};
margin-left: 4px;
`;
export const BetNowButton = styled(Button)`
font-weight: normal;
text-transform: capitalize;
& > span {
font-weight: normal;
line-height: 16px;
font-size: 14px;
font-family: ${fontMedium};
color: ${buildColor("white", "100")};
}
`;
export const WarningMessageWrapper = styled.div`
position: absolute;
bottom: calc(constant(safe-area-inset-bottom) + 96px);
bottom: calc(env(safe-area-inset-bottom) + 96px);
left: 0;
right: 0;
padding: 8px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/BetTicket/index.jsx
import React, { Component } from "react";
import { noop, isEqual, get, flatten } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import buildColor from "../../_static/ColorPalette";
import ProcessingOverlay from "../../_static/ProcessingOverlay";
import { getListRunnerNumberGroup } from "../../_molecule/BetSummary";
import MessageBox from "../../_molecule/MessageBox";
import BetAmount from "../../_organism/BetAmount";
import { trash20, add } from "../../_static/Icons/icons";
import Icon from "../../_static/Icons";
import {
BetTicketSection,
WagersContainer,
ControlsContainer,
BetTypeText,
SelectionsWrapper,
SelectionsEmpty,
Cancel,
Add,
BetNowButton,
BetTypeTrashContainer,
WagersSubmitContainer,
WarningMessageWrapper,
TalentPicksWarning,
BetTicketContainer
} from "./styled-components";
import ScrollWrapper from "../../_molecule/ScrollWrapper";
export default class BetTicket extends Component {
static defaultProps = {
betType: "WN",
selectedBetAmount: 0,
betAmounts: [],
minimumWagerAmount: 0,
maxWagerAmount: 0,
betTotal: 0,
selections: [],
favoriteRunners: [],
raceTypeCode: "T",
onPlaceBet: noop,
onCancelBet: noop,
onChangeBetAmount: noop,
onDismissError: noop,
isBetDisabled: false,
isKey: false,
isLeg: false,
isVisible: false,
isProcessing: false,
isBettingError: false,
isSelectionScratched: false,
hasOtherAmount: false,
raceNumber: "1",
modalType: "bottom",
onWarningClose: noop,
onCloseCustomAmountModal: noop,
scratchedSelectionMessage: "",
errorBetTitle: "",
errorBetMessage: "",
contextBT: "mep",
selectTalentIdErrorVisible: false,
dismissTalentPicksWarning: noop,
isMobile: true,
inIosAppTablet: false
};
shouldComponentUpdate(nextProps) {
return !isEqual(nextProps, this.props);
}
renderSelections() {
if (
this.props.selections.length <= 1 &&
(!this.props.selections[0] || this.props.selections[0].length === 0)
) {
return (
<SelectionsEmpty key="empty" data-qa-label="betTicket-runnerGroupEmpty">
SELECT A RUNNER USING THE
<Add icon={add} size={16} color={buildColor("green", "600")} />
</SelectionsEmpty>
);
}
return getListRunnerNumberGroup(
this.props.selections,
this.props.raceTypeCode,
this.props.isKey,
this.props.isLeg,
+this.props.raceNumber,
this.props.favoriteRunners
);
}
render() {
const hasTalentPicksOnBehalfWarning =
this.props.contextBT === "talentPicks" &&
this.props.selectTalentIdErrorVisible;
const betNowButtonLabel =
this.props.contextBT === "talentPicks"
? `CREATE ${formatCurrency(this.props.betTotal)} PICK`
: `Bet ${formatCurrency(this.props.betTotal)}`;
return (
<BetTicketContainer
isVisible={this.props.isVisible}
isDualColumn={this.props.modalType === "fade"}
>
<TalentPicksWarning>
{hasTalentPicksOnBehalfWarning && (
<MessageBox
type="error"
title={'"On behalf of field" is empty!'}
hasIcon
message={
'No Talent selected on "On Behalf of field". Please select one on the dropdown above.'
}
onClose={this.props.dismissTalentPicksWarning}
/>
)}
</TalentPicksWarning>
<BetTicketSection
isVisible={this.props.isVisible}
isMobile={this.props.isMobile}
data-qa-label="betTicket"
>
{this.props.isProcessing && <ProcessingOverlay />}
{this.props.isSelectionScratched && (
<WarningMessageWrapper>
<MessageBox
type="warning"
title={this.props.scratchedSelectionMessage}
onClose={this.props.onWarningClose}
/>
</WarningMessageWrapper>
)}
{this.props.isBettingError && (
<WarningMessageWrapper>
<MessageBox
type="error"
title={`ERROR - ${get(this.props, "errorBetTitle")}`}
message={get(this.props, "errorBetMessage")}
onClose={this.props.onDismissError}
/>
</WarningMessageWrapper>
)}
<BetTypeTrashContainer>
<BetTypeText data-qa-label="betTicket-betType">
{this.props.betType}
</BetTypeText>
<Cancel
size="big"
type="secondary"
hasRoundedCorners={false}
onClick={this.props.onCancelBet}
qaLabel="betTicket-cancelButton"
>
<Icon
icon={trash20}
size={20}
color={buildColor("grey", "900")}
/>
</Cancel>
</BetTypeTrashContainer>
<WagersSubmitContainer>
<WagersContainer>
<ScrollWrapper>
<SelectionsWrapper
key={flatten(this.props.selections).toString()}
>
{this.renderSelections()}
</SelectionsWrapper>
</ScrollWrapper>
</WagersContainer>
<ControlsContainer data-qa-label="betTicket-controls">
<BetAmount
hasOtherAmount={this.props.hasOtherAmount}
betAmounts={this.props.betAmounts}
onChangeBetAmount={this.props.onChangeBetAmount}
selectedBetAmount={this.props.selectedBetAmount}
onCloseCustomAmountModal={this.props.onCloseCustomAmountModal}
minimumAmount={this.props.minimumWagerAmount}
maxWagerAmount={this.props.maxWagerAmount}
modalType={this.props.modalType}
inIosAppTablet={this.props.inIosAppTablet}
/>
<BetNowButton
type="bet"
size="big"
isStretched
isDisabled={this.props.isBetDisabled}
onClick={this.props.onPlaceBet}
qaLabel="betTicket-betNowButton"
hasRunnersSelected={this.props.betTotal > 0}
>
{this.props.betTotal === 0
? "Select Runners"
: betNowButtonLabel}
</BetNowButton>
</ControlsContainer>
</WagersSubmitContainer>
</BetTicketSection>
</BetTicketContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TalentPickConfirmationHeader/styled-components.js
import styled from "styled-components";
import buildColor from "../../_static/ColorPalette";
export const MessageContainer = styled.div`
height: auto;
min-height: 56px;
max-height: 90px;
padding: 16px;
font-size: 12px;
background: ${buildColor("white", "100")};
display: flex;
width: 190px;
align-items: center;
justify-content: center;
margin-left: 15px;
position: relative;
border-radius: 2px;
flex-grow: 1;
margin-right: 8px;
align-self: flex-end;
margin-bottom: 8px;
&::after {
content: "";
width: 0;
height: 0;
left: -15px;
border-top: 15px solid transparent;
border-bottom: 0 solid transparent;
border-right: 15px solid ${buildColor("white", "100")};
position: absolute;
}
& p {
text-overflow: ellipsis;
overflow: hidden;
}
`;
export const TalentConfirmationHeader = styled.div`
width: 100%;
display: flex;
align-items: center;
justify-content: flex-start;
`;
export const Image = styled.img`
width: 120px;
height: auto;
`;
export default {
MessageContainer,
TalentConfirmationHeader,
Image
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/TalentPickConfirmationHeader/index.jsx
import React, { PureComponent } from "react";
import {
MessageContainer,
Image,
TalentConfirmationHeader
} from "./styled-components";
import Icon from "../../_static/Icons";
import { talentShape } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
export default class TalentPickConfirmationHeader extends PureComponent {
static defaultProps = {
talentImage: "",
message: ""
};
render() {
return (
<TalentConfirmationHeader>
{this.props.talentImage ? (
<Image
src={this.props.talentImage}
alt={this.props.talentImage}
data-qa-label="talentImg"
/>
) : (
<Icon
icon={talentShape}
color={buildColor("grey", "600")}
size={100}
data-qa-label="talentImg"
/>
)}
{this.props.message && (
<MessageContainer data-qa-label="talentMsg">
<p>{this.props.message}</p>
</MessageContainer>
)}
</TalentConfirmationHeader>
);
}
}
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/general.ts
import { get } from "lodash";
import { useEffect, useLayoutEffect } from "react";
import { Location } from "react-router-dom";
import { Dispatch } from "redux";
import { History } from "@tvg/ts-types/History";
import mediator from "@tvg/mediator";
import {
BetCancelResult,
CheckSelectionLabel
} from "@tvg/sh-lib-my-bets/utils/types";
import formatSequencial from "@tvg/formatter/numeric";
import { BetSelection, BetStatus } from "@tvg/ts-types/Bet";
import {
BettingInterest,
RaceInfoMyBets,
RaceStatusEnum,
RaceWagerType
} from "@tvg/ts-types/Race";
import { isEqual } from "date-fns";
import { Selections } from "@tvg/ts-types/Selections";
import { WroWager } from "@tvg/ts-types/WroWager";
import { TabKey } from "@tvg/ts-types/Generic";
import { NullaryFn, UnaryFn } from "@tvg/ts-types/Functional";
import { ActiveTabEnum, SettledTabEnum } from "./types";
import { closeMyBetsStandalone } from "../redux/actions";
import { onToggleShowDetails } from "./gtm";
import {
isExoticBet,
isMultiRaceBet,
isPickBetWager,
useIsXsellBlacklistedBet
} from "./raceDetails";
export const calculateProbableValue = (
comboAmount: number,
minWagerAmount: number,
userAmount: number
): number => (comboAmount * userAmount) / minWagerAmount;
export const SELECTIONS_MODIFIERS = {
KEY: "KY",
KEY_BOX: "KYBX",
BOX: "BX"
};
export const isSuccessBetCancel = (betCancelNotification: BetCancelResult) =>
get(betCancelNotification, "status", "") === "success";
export const closeModal = (
dispatch: Dispatch,
location?: Location,
history?: History
) => {
if (location !== undefined && history !== undefined) {
const currentPath = `${location.pathname}${location.search}`;
history.push(currentPath);
}
dispatch(closeMyBetsStandalone());
mediator.base.dispatch({ type: "MYBETS_MODAL_CLOSE" });
};
export const scrollToView = (element: Element | HTMLElement | null) => {
if (
element &&
typeof window !== "undefined" &&
window.navigator &&
window.navigator.userAgent &&
typeof get(element, "scrollIntoView") === "function"
) {
const ua = window.navigator.userAgent;
if (
(!!ua.match(/Safari/i) || !!ua.match(/AppleWebKit/i)) &&
!ua.match(/Chrome/i)
) {
setTimeout(() => {
element.scrollIntoView();
}, 0);
} else {
element.scrollIntoView();
}
}
};
export const scrollActivePillIntoView = () => {
const elements = document.getElementsByClassName("active");
if (elements) {
Array.from(elements).forEach((el) => {
if (el.className.includes("PillAtom")) {
scrollToView(el);
}
});
}
};
export const scrollActiveBetIntoView = (indexBuffer: number) => {
if (indexBuffer !== 0) {
const elmnt = document.getElementById(`activebet-${indexBuffer}`);
scrollToView(elmnt);
}
};
export const useIsomorphicLayoutEffect =
typeof window !== "undefined" ? useLayoutEffect : useEffect;
export const changeTab = (
selectedTab: TabKey,
setSelectedTab: UnaryFn<TabKey, void>
) => {
setSelectedTab(selectedTab);
return true;
};
export const getWinType = (winningsAmount: number, betAmount: number) => {
let winType;
if (winningsAmount < betAmount * 5) {
winType = "SmallWin";
} else if (
winningsAmount >= betAmount * 5 &&
winningsAmount < betAmount * 10
) {
winType = "Win";
} else if (winningsAmount >= betAmount * 10) {
winType = "BigWin";
}
return winType;
};
export const getSelectionLabel = ({
raceNumber,
selectionLength,
selectionIndex,
selectionsModifier,
isMultiRace,
isKey,
isBox,
isDesktop,
isSpecialWager = false
}: CheckSelectionLabel) => {
const isKeyRace = isKey || selectionsModifier === SELECTIONS_MODIFIERS.KEY;
const isKeyBox = isBox || selectionsModifier === SELECTIONS_MODIFIERS.KEY_BOX;
const isBoxRace = isBox || selectionsModifier === SELECTIONS_MODIFIERS.BOX;
let pickBetsLabelLength = 10;
let key = false;
let label = "";
// check multiple selections
if (selectionLength > 1) {
key =
(selectionIndex === 0 && isKeyRace) || (selectionIndex === 0 && isKeyBox);
if (isKeyBox && selectionIndex !== 0) {
label = "Box";
} else if (isKeyRace && selectionIndex !== 0) {
label = "W/";
} else {
const legNumber = selectionIndex + 1;
if (!isMultiRace) {
label = formatSequencial(legNumber);
} else {
label = isDesktop
? `${isSpecialWager ? "L" : "R"}${raceNumber + selectionIndex}`
: `LEG ${legNumber} - R${raceNumber + selectionIndex}`;
}
}
} else if (isBoxRace) {
label = "Box";
}
if (selectionLength >= 10 && raceNumber + selectionLength > 10) {
pickBetsLabelLength = 12;
} else if (selectionLength >= 10 || raceNumber + selectionLength > 10) {
pickBetsLabelLength = 11;
}
return {
label,
key,
pickBetsLabelLength
};
};
export const checkAllDetailedViewIsOpen = (showBetsDetailedView: boolean[]) =>
showBetsDetailedView &&
!!showBetsDetailedView.length &&
typeof showBetsDetailedView.find((isOpen) => !isOpen) === "undefined";
export const toggleAllDetailViews = (
showBetsDetailedView: boolean[],
setShowBetsDetailedView: UnaryFn<Array<boolean>, void>,
selections: BetSelection[][] | Selections[][] = []
) => {
const closeAll = checkAllDetailedViewIsOpen(showBetsDetailedView);
const showBetsDetailedViewState = new Array(selections.length).fill(
!closeAll
);
setShowBetsDetailedView(showBetsDetailedViewState);
};
export const setShowContent = (
value: boolean,
id: string,
showContentObj: Record<string, boolean>,
setShowContentObj: UnaryFn<Record<string, boolean>, void>
) => {
const auxObj = { ...showContentObj };
auxObj[id] = value;
setShowContentObj(auxObj);
};
export const handleDetailsButton = (
selectedTab: ActiveTabEnum,
selectedSettledTab: SettledTabEnum,
isDetailsOpened: boolean,
showBetsDetailedView: boolean[],
setShowBetsDetailedView: UnaryFn<boolean[], void>,
// eslint-disable-next-line @typescript-eslint/default-param-last
selections: BetSelection[][] | Selections[][] = [],
handleScrollPosition: NullaryFn<void>,
totalActiveBets?: number,
totalSettledBets?: number
) => {
onToggleShowDetails({
selectedTab,
selectedSettledTab,
show: !isDetailsOpened,
activeBetsCount: totalActiveBets,
settledBetsCount: totalSettledBets
});
toggleAllDetailViews(
showBetsDetailedView,
setShowBetsDetailedView,
selections
);
handleScrollPosition();
};
export const getWagerToRender = (
wagers: WroWager[],
selectedWager?: WroWager
) => {
if (selectedWager) {
return [selectedWager];
}
return wagers;
};
// Rule to protect wagers being shown from previous day when BE doesnt have new info from TOTE
export const shouldRenderWager = (
selectedTab: ActiveTabEnum,
currentRaceDate: string,
wagerRaceDate: string,
trackNameFilters?: string[],
trackName?: string
) => {
if (trackNameFilters && trackNameFilters.length && trackName) {
return trackNameFilters.includes(trackName);
}
return selectedTab !== "ACTIVE" || currentRaceDate === wagerRaceDate;
};
export const checkWagerIsCancelable = (
wager: WroWager,
statusCode: RaceStatusEnum
) => {
const cancelableStatus: RaceStatusEnum[] = [
RaceStatusEnum.OPEN,
RaceStatusEnum.UP_NEXT
];
return (
get(wager, "cancelable", false) && cancelableStatus.includes(statusCode)
);
};
export const getWagerBetStatus = (wagerBetStatus: BetStatus) => ({
isCanceled: wagerBetStatus.name === "canceled",
isActive: wagerBetStatus.code === "A"
});
export const checkWagerIsBetWinner = (wager: WroWager) =>
get(wager, "winningsAmount", 0) > get(wager, "betTotal", 0);
export const getWagerProps = (
wager: WroWager,
statusCode: RaceStatusEnum,
currentRaceDate: string,
mainWagerDetails: string,
isURPPpOnXSellEnabled: boolean,
currentRace?: RaceInfoMyBets
) => {
const wagerBetStatus = get(wager, "betStatus", {} as BetStatus);
const currentWagerTypeCode = get(wager, "wagerType.code", "");
const currentWagerTypeId = get(wager, "wagerType.id", 10);
const raceWagerTypes = get(currentRace, "wagerTypes", []);
const currentWagerTypeByRace = raceWagerTypes.find(
(wagerType: RaceWagerType) =>
get(wagerType, "type.id") === currentWagerTypeId
);
const isOptedIn = get(wager, "promoQualifying", false);
const isCurrentRaceDate = isEqual(
new Date(mainWagerDetails),
new Date(currentRaceDate)
);
const { isCanceled, isActive } = getWagerBetStatus(wagerBetStatus);
const isWagerCancelable = checkWagerIsCancelable(wager, statusCode);
const isMultiRace = isMultiRaceBet(currentWagerTypeCode);
const isPickBet = isPickBetWager(currentWagerTypeCode);
const isExotic = isExoticBet(currentWagerTypeCode);
const isXsellBlacklisted = useIsXsellBlacklistedBet(
currentWagerTypeCode,
isURPPpOnXSellEnabled
);
const isBetWinner = checkWagerIsBetWinner(wager);
const isWheel = get(currentWagerTypeByRace, "isWheel", false);
const isKey = get(currentWagerTypeByRace, "isKey", false);
const isBox = get(currentWagerTypeByRace, "isBox", false);
return {
wagerBetStatus,
isCurrentRaceDate,
isCanceled,
isActive,
currentWagerTypeCode,
currentWagerTypeId,
isWagerCancelable,
isMultiRace,
isPickBet,
isExotic,
isBetWinner,
isOptedIn,
isWheel,
isKey,
isBox,
isXsellBlacklisted
};
};
export const isFavoriteRunner = (
raceDate: string,
currentBiNumber: number,
race?: RaceInfoMyBets
): boolean => {
const bettingInterestsRaceDate = get(race, `raceDate`, "");
if (bettingInterestsRaceDate === raceDate) {
const bettingInterests = get(
race,
`bettingInterests`,
[] as Array<BettingInterest>
);
return bettingInterests.reduce(
(isFavorite: boolean, betInterests: BettingInterest) => {
const betInterestsFavorite =
get(betInterests, "favorite", false) ||
get(betInterests, "isFavorite", false);
const biNumber = get(betInterests, "biNumber");
return (
isFavorite ||
(bettingInterestsRaceDate === raceDate &&
betInterestsFavorite &&
biNumber === currentBiNumber)
);
},
false
);
}
return false;
};
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/potentialReturn.ts
import { isEmpty, flatten, get, size } from "lodash";
import { Probable, RaceWagerType, ProbableBetCombo } from "@tvg/ts-types/Race";
import formatCurrency, {
formatPurseWithoutCurrency
} from "@tvg/formatter/currency";
import { WagerTypes, WagerTypesPos, WagerType } from "@tvg/ts-types/Wager";
import { exactaAndDailyDouble } from "./potentialReturn/exactaAndDailyDouble";
import { quinella } from "./potentialReturn/quinella";
import { placeAndShow } from "./potentialReturn/placeAndShow";
import { win } from "./potentialReturn/win";
import { BetComboHash } from "./types";
export const doesRaceWagerTypeHasProbables = (
probables: Probable[],
currentWagerTypeId: number
): boolean => {
if (!isEmpty(probables) && currentWagerTypeId) {
let probableIndex = -1;
// Checking if has index there for it means we have a probable for current wager type
if (
currentWagerTypeId === WagerTypes.WIN_PLACE ||
currentWagerTypeId === WagerTypes.WIN_SHOW ||
currentWagerTypeId === WagerTypes.PLACE_SHOW ||
currentWagerTypeId === WagerTypes.WIN_PLACE_SHOW
) {
[WagerTypes.WIN, WagerTypes.PLACE, WagerTypes.SHOW].forEach((type) => {
const possibleIndex = probables.findIndex(
(probable: Probable) => probable.wagerType.id === type
);
if (possibleIndex > -1) {
probableIndex = possibleIndex;
}
});
} else {
probableIndex = probables.findIndex(
(probable: Probable) => probable.wagerType.id === currentWagerTypeId
);
}
if (probableIndex > -1) {
return true;
}
}
return false;
};
export const formatProbableAmountList = (
probableAmountList: number[],
betAmount: number,
betsNumber: number = 1
): string => {
const probableAmountLength = probableAmountList.length;
// To ensure that minimum probable value is always more than my initial bet amount
const probableAmountDefault = betAmount * 1.05;
const minValue =
Math.max(Math.min(...probableAmountList), probableAmountDefault) *
betsNumber;
const maxValue =
Math.max(...probableAmountList, probableAmountDefault) * betsNumber;
if (!probableAmountLength) {
return "0";
}
if (probableAmountLength === 1) {
return probableAmountList[0] > 999
? formatPurseWithoutCurrency(probableAmountList[0] * betsNumber)
: formatCurrency(probableAmountList[0] * betsNumber);
}
const minValueFormated =
minValue > 999
? formatPurseWithoutCurrency(minValue)
: formatCurrency(minValue);
const maxValueFormated =
maxValue > 999
? formatPurseWithoutCurrency(maxValue)
: formatCurrency(maxValue);
if (minValueFormated === maxValueFormated) {
return minValueFormated;
}
if (minValueFormated === "$0.00" && maxValueFormated !== "$0.00") {
return maxValueFormated;
}
return `${minValueFormated} - ${maxValueFormated}`;
};
export const getBetCombosHash = (betCombos: ProbableBetCombo[]): BetComboHash =>
betCombos.reduce(
(accumulator: BetComboHash, currentValue: ProbableBetCombo) => {
const newValue: BetComboHash = {};
if (currentValue.runner2 === null) {
newValue[currentValue.runner1] = currentValue.payout;
} else {
newValue[`${currentValue.runner1}-${currentValue.runner2}`] =
currentValue.payout;
}
return {
...accumulator,
...newValue
};
},
{}
);
export const getKindOfSpecialGroupType = (
betSelections: string[][],
wagerType: RaceWagerType | WagerType | null
): number[] => {
const type = get(wagerType, "id") || get(wagerType, "type.id");
const isSpecialGroup = !![
WagerTypes.WIN_PLACE,
WagerTypes.WIN_SHOW,
WagerTypes.PLACE_SHOW,
WagerTypes.WIN_PLACE_SHOW
].find((id) => id === type);
// Check if is multiple wager types and max runners is 3
if (isSpecialGroup) {
const MAX_RUNNERS = 3;
if (betSelections[0].length <= MAX_RUNNERS) {
let specialGroup: number[];
switch (type) {
case WagerTypes.WIN_PLACE:
specialGroup = [WagerTypes.WIN, WagerTypes.PLACE];
break;
case WagerTypes.WIN_SHOW:
specialGroup = [WagerTypes.WIN, WagerTypes.SHOW];
break;
case WagerTypes.PLACE_SHOW:
specialGroup = [WagerTypes.PLACE, WagerTypes.SHOW];
break;
case WagerTypes.WIN_PLACE_SHOW:
specialGroup = [WagerTypes.WIN, WagerTypes.PLACE, WagerTypes.SHOW];
break;
default:
specialGroup = [];
}
return specialGroup;
}
}
return [];
};
export const getProbableValues = (
probableIndex: number,
probables: Probable[],
betSelections: string[][],
betAmount: number
): number[] => {
if (probableIndex !== -1) {
// Search and calculate probable
const { wagerType, minWagerAmount, betCombos } = probables[probableIndex];
// Turn betCombo into an hashTable
const betCombosHash = getBetCombosHash(betCombos);
// Find which payout we want to multiply
const typesProps = {
betSelections,
betCombosHash,
minWagerAmount,
betAmount
};
switch (wagerType.id) {
// Exacta
case WagerTypes.EXACTA:
return exactaAndDailyDouble(typesProps);
// Daily Double
case WagerTypes.DAILY_DOUBLE:
return exactaAndDailyDouble(typesProps);
// Quinella
case WagerTypes.QUINELLA:
return quinella(typesProps);
// Show
case WagerTypes.SHOW:
return placeAndShow({
...typesProps,
wagerTypeId: wagerType.id
});
// Place
case WagerTypes.PLACE:
return placeAndShow({
...typesProps,
wagerTypeId: wagerType.id
});
// Win
case WagerTypes.WIN:
return win(typesProps);
default:
return [];
}
}
return [];
};
export const hasCalculatedProbable = (currentProbable: string = "0"): boolean =>
currentProbable !== "0";
export const getCurrentProbableValue = (
probables: Probable[],
currentWagerType: RaceWagerType | WagerType | null,
betAmount: number,
betSelections: string[][],
betsNumber: number = 1
): string => {
let probableValueList: number[] = [];
if (
isEmpty(probables) ||
isEmpty(currentWagerType) ||
!betAmount ||
isEmpty(flatten(betSelections))
) {
return "0";
}
let probableIndex = -1;
const specialGroupWagerTypes = getKindOfSpecialGroupType(
betSelections,
currentWagerType
);
if (specialGroupWagerTypes.length) {
const allProbables = specialGroupWagerTypes.map((wagerTypeId) => {
const probIndex = probables.findIndex(
(probable: Probable) => probable.wagerType.id === wagerTypeId
);
return getProbableValues(probIndex, probables, betSelections, betAmount);
});
// Check if it has invalid probable
if (allProbables.find((probable) => !size(probable))) {
return "0";
}
let minOfMin = 999999;
let maxOfWin = 0;
let maxOfPlace = 0;
let maxOfShow = 0;
allProbables.forEach((probable, index) => {
// Get the biggest numbers for each wager
if (index === WagerTypesPos.Win) {
maxOfWin = Math.max(...probable);
} else if (index === WagerTypesPos.Place) {
maxOfPlace = Math.max(...probable);
} else if (index === WagerTypesPos.Show) {
maxOfShow = Math.max(...probable);
}
// Get the lowest number but checking on each wager
const currentMinNumber = Math.min(...probable);
if (currentMinNumber < minOfMin) {
minOfMin = currentMinNumber;
}
});
const sumOfWagerTypes = maxOfWin + maxOfPlace + maxOfShow;
probableValueList = [minOfMin, sumOfWagerTypes];
} else {
probableIndex = probables.findIndex(
(probable: Probable) =>
probable.wagerType.id === get(currentWagerType, "type.id") ||
probable.wagerType.id === get(currentWagerType, "id")
);
probableValueList = getProbableValues(
probableIndex,
probables,
betSelections,
betAmount
);
}
return formatProbableAmountList(probableValueList, betAmount, betsNumber);
};
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/types.ts
export interface Payload<T = string, P = unknown> {
type: T;
payload?: P;
}
export enum UMEventsGeneric {
HotReload = "HOT_RELOAD"
}
export enum UMEventsAccount {
Session = "GET_SESSION",
Join = "TRIGGER_JOIN",
Logout = "TRIGGER_LOGOUT",
OpenSettings = "OPEN_USER_SETTINGS",
PresentModal = "PRESENT_MODAL",
AcceptTerms = "TRIGGER_ACCEPT_TERMS",
Verification = "TRIGGER_VERIFICATION",
KeepAlive = "KEEP_ALIVE",
SessionUpdate = "SESSION_UPDATE",
FirstLoad = "FIRST_LOAD"
}
export enum UMEventsWallet {
GetBalance = "GET_BALANCE",
Deposit = "DEPOSIT",
Tax = "TAX",
Transactions = "TRANSACTIONS",
Withdraw = "WITHDRAW",
Activity = "ACTIVITY",
AccountHome = "ACCOUNT_HOME"
}
export enum UMEventsAmplitude {
SetDeviceId = "SET_DEVICE_ID",
SetSessionId = "SET_SESSION_ID"
}
export enum UMEventsResponsibleGaming {
ResponsiblePlay = "RESPONSIBLE_PLAY",
RealityCheck = "REALITY_CHECK",
GlobalDepositLimits = "GLOBAL_DEPOSIT_LIMITS"
}
export const UMEvents = {
...UMEventsAccount,
...UMEventsWallet,
...UMEventsAmplitude,
...UMEventsGeneric,
...UMEventsResponsibleGaming
};
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/potentialReturn/exactaAndDailyDouble.ts
import { get, isNaN } from "lodash";
import { PotentialReturn, ProbableValueList } from "../types";
import { calculateProbableValue } from "../general";
export const exactaAndDailyDouble = ({
betSelections,
betCombosHash,
minWagerAmount,
betAmount
}: PotentialReturn): ProbableValueList => {
const probableValueList: ProbableValueList = [];
const firstPlaceSelectionsLength = get(betSelections, "[0].length", 0);
const secondPlaceSelectionsLength = get(betSelections, "[1].length", 0);
if (firstPlaceSelectionsLength > 0 && secondPlaceSelectionsLength > 0) {
try {
// There are selections, now find combinations and add payouts to probableValueList
get(betSelections, "[0]", []).forEach((firstPlaceSelection: string) => {
get(betSelections, "[1]", []).forEach(
(secondPlaceSelection: string) => {
const payout =
+betCombosHash[`${firstPlaceSelection}-${secondPlaceSelection}`];
if (!isNaN(payout)) {
if (payout) {
probableValueList.push(
calculateProbableValue(payout, minWagerAmount, betAmount)
);
}
} else {
throw new Error("NaN");
}
}
);
});
} catch (e) {
return [];
}
}
return probableValueList;
};
export default exactaAndDailyDouble;
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/potentialReturn/quinella.ts
import { get, isNaN } from "lodash";
import { PotentialReturn, ProbableValueList } from "../types";
import { calculateProbableValue } from "../general";
export const quinella = ({
betSelections,
betCombosHash,
minWagerAmount,
betAmount
}: PotentialReturn): ProbableValueList => {
const probableValueList: ProbableValueList = [];
const first = get(betSelections, "[0][0]", "");
const second = get(betSelections, "[0][1]", "");
if (first && second) {
const payout = +betCombosHash[`${first}-${second}`];
try {
if (!isNaN(payout)) {
if (payout) {
probableValueList.push(
calculateProbableValue(payout, minWagerAmount, betAmount)
);
}
} else {
throw new Error("NaN");
}
} catch (e) {
return [];
}
}
return probableValueList;
};
export default quinella;
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/potentialReturn/placeAndShow.ts
import { isNaN } from "lodash";
import { PotentialReturn, ProbableValueList } from "../types";
import { calculateProbableValue } from "../general";
export const placeAndShow = ({
betSelections,
betCombosHash,
minWagerAmount,
betAmount,
wagerTypeId
}: PotentialReturn): ProbableValueList => {
const probableValueList: ProbableValueList = [];
const comboHashKeys = Object.keys(betCombosHash);
const hashLength = Number(
comboHashKeys[comboHashKeys.length - 1].split("-")[0]
);
const payoutsMaximum: number[] = [];
try {
betSelections[0].forEach((betSelection) => {
const runnerPayoutList: number[] = [];
// P.S: I KNOW, it can be `i++` but just complain eslint... (we can change this rule later :) )
for (let i = 1; i <= hashLength; i += 1) {
const payout = +betCombosHash[`${i}-${betSelection}`];
if (!isNaN(payout)) {
if (payout) {
probableValueList.push(
calculateProbableValue(payout, minWagerAmount, betAmount)
);
}
} else {
throw new Error("NaN");
}
runnerPayoutList.push(payout);
}
// Check biggest runner payout and add to payouts maximum
payoutsMaximum.push(Math.max(...runnerPayoutList));
});
} catch (e) {
return [];
}
// Check the biggest 2 (Place) | 3 (Show) runners payouts and add to probable value list
if (payoutsMaximum.length > 2) {
const sortedPayoutsMaximum = payoutsMaximum.sort();
const sortedPayoutsMaximumLength = sortedPayoutsMaximum.length;
let payoutsSum =
sortedPayoutsMaximum[sortedPayoutsMaximumLength - 1] +
sortedPayoutsMaximum[sortedPayoutsMaximumLength - 2];
if (wagerTypeId === 30) {
// Show requires to sum the third biggest payout
payoutsSum += sortedPayoutsMaximum[sortedPayoutsMaximumLength - 3];
}
probableValueList.push(
calculateProbableValue(payoutsSum, minWagerAmount, betAmount)
);
} else {
// Sum payouts available (1 OR 2 can be sum here)
probableValueList.push(
calculateProbableValue(
payoutsMaximum.reduce((acc, value) => acc + value, 0),
minWagerAmount,
betAmount
)
);
}
return probableValueList;
};
export default placeAndShow;
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/potentialReturn/win.ts
import { isNaN } from "lodash";
import { PotentialReturn, ProbableValueList } from "../types";
import { calculateProbableValue } from "../general";
export const win = ({
betSelections,
betCombosHash,
minWagerAmount,
betAmount
}: PotentialReturn): ProbableValueList => {
const probableValueList: ProbableValueList = [];
try {
betSelections[0].forEach((betSelection) => {
const payout = +betCombosHash[betSelection];
if (!isNaN(payout)) {
if (payout) {
probableValueList.push(
calculateProbableValue(payout, minWagerAmount, betAmount)
);
}
} else {
throw new Error("NaN");
}
});
} catch (e) {
return [];
}
return probableValueList;
};
export default win;
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/events.ts
import {
UMEventsAccount,
UMEventsAmplitude,
UMEventsGeneric,
UMEventsResponsibleGaming,
UMEventsWallet
} from "./types";
export const getUMEvent = (
event:
| UMEventsAccount
| UMEventsWallet
| UMEventsAmplitude
| UMEventsGeneric
| UMEventsResponsibleGaming
) => ({
trigger: event,
completion: `${event}_COMPLETE`
});
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/apps/web/events.ts
import { UMEvents } from "../../types";
import type { Events } from "../types";
export default {
// Account
[UMEvents.OpenSettings]: `UM_ACCOUNT_OPEN_SETTINGS`,
[UMEvents.FirstLoad]: `UM_ACCOUNT_FIRST_LOAD`,
[UMEvents.KeepAlive]: `UM_ACCOUNT_KEEP_ALIVE`,
[UMEvents.Logout]: `UM_ACCOUNT_LOGOUT`,
[UMEvents.Session]: `UM_ACCOUNT_SESSION`,
[UMEvents.SessionUpdate]: `UM_ACCOUNT_SESSION_UPDATE`,
[UMEvents.Verification]: `UM_ACCOUNT_VERIFICATION`,
[UMEvents.AcceptTerms]: `UM_ACCOUNT_ACCEPT_TERMS`,
// Generic
[UMEvents.PresentModal]: `UM_ACCOUNT_PRESENT_MODAL`,
// Wallet
[UMEvents.GetBalance]: `UM_ACCOUNT_GET_BALANCE`,
[UMEvents.Deposit]: `UM_ACCOUNT_DEPOSIT`,
[UMEvents.Tax]: `UM_ACCOUNT_TAX`,
[UMEvents.Transactions]: `UM_ACCOUNT_TRANSACTIONS`,
[UMEvents.Withdraw]: `UM_ACCOUNT_WITHDRAW`,
[UMEvents.Activity]: `UM_ACCOUNT_ACTIVITY`,
[UMEvents.AccountHome]: `UM_ACCOUNT_ACCOUNT_HOME`,
// Amplitude
[UMEvents.SetSessionId]: "UM_SET_SESSION_ID",
[UMEvents.SetDeviceId]: "UM_SET_DEVICE_ID",
// ResponsibleGaming
[UMEvents.ResponsiblePlay]: "UM_RESPONSIBLE_PLAY",
[UMEvents.RealityCheck]: "UM_REALITY_CHECK",
[UMEvents.GlobalDepositLimits]: "UM_GLOBAL_DEPOSIT_LIMITS"
} as Events;
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/apps/formatEvents.ts
import { isArray, omitBy } from "lodash";
import { getUMEvent } from "../events";
import type { Events } from "./types";
import type { UMEventsAccount, UMEventsWallet } from "../types";
export const formatEvents = (events: Events) =>
Object.entries(events).reduce(
(eventsAcc, currentEvent) => {
const [eventKey, mapEventValue] = currentEvent;
let eventTrigger;
let eventCompletion;
if (typeof mapEventValue === "string") {
const eventFormatted = getUMEvent(
mapEventValue as UMEventsAccount | UMEventsWallet
);
eventTrigger = eventFormatted.trigger;
eventCompletion = eventFormatted.completion;
} else if (isArray(mapEventValue)) {
eventTrigger = mapEventValue[0];
eventCompletion = mapEventValue[1];
} else {
throw new Error("[UM]: Wrong configuration on UM events");
}
const eventsWithCompletion = omitBy(
{
[eventKey]: eventTrigger,
[`${eventKey}_COMPLETE`]: eventCompletion
},
(event) => event === ""
);
return {
triggers: {
...eventsAcc.triggers,
...eventsWithCompletion
},
subscriptions: {
...eventsAcc.subscriptions,
...eventsWithCompletion
}
};
},
{
triggers: {},
subscriptions: {}
}
);
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/apps/web/index.ts
import events from "./events";
import { AppConfig } from "../types";
import { formatEvents } from "../formatEvents";
export default formatEvents(events) as AppConfig;
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/apps/hybrid/events.ts
import { UMEvents } from "../../types";
import type { Events } from "../types";
export default {
// Account
[UMEvents.OpenSettings]: `UM_ACCOUNT_OPEN_SETTINGS`,
[UMEvents.FirstLoad]: `UM_ACCOUNT_FIRST_LOAD`,
[UMEvents.KeepAlive]: `UM_ACCOUNT_KEEP_ALIVE`,
[UMEvents.Logout]: `UM_ACCOUNT_LOGOUT`,
[UMEvents.Session]: `UM_ACCOUNT_SESSION`,
[UMEvents.SessionUpdate]: `UM_ACCOUNT_SESSION_UPDATE`,
[UMEvents.Verification]: `UM_ACCOUNT_VERIFICATION`,
[UMEvents.AcceptTerms]: `UM_ACCOUNT_ACCEPT_TERMS`,
// Generic
[UMEvents.PresentModal]: `UM_ACCOUNT_PRESENT_MODAL`,
// Wallet
[UMEvents.GetBalance]: `UM_ACCOUNT_GET_BALANCE`,
[UMEvents.Deposit]: `UM_ACCOUNT_DEPOSIT`,
[UMEvents.Tax]: `UM_ACCOUNT_TAX`,
[UMEvents.Transactions]: `UM_ACCOUNT_TRANSACTIONS`,
[UMEvents.Withdraw]: `UM_ACCOUNT_WITHDRAW`,
[UMEvents.Activity]: `UM_ACCOUNT_ACTIVITY`,
[UMEvents.AccountHome]: `UM_ACCOUNT_ACCOUNT_HOME`,
// Amplitude
[UMEvents.SetSessionId]: "UM_SET_SESSION_ID",
[UMEvents.SetDeviceId]: "UM_SET_DEVICE_ID",
// Generic
[UMEvents.HotReload]: "UM_HOT_RELOAD",
// ResponsibleGaming
[UMEvents.ResponsiblePlay]: "UM_RESPONSIBLE_PLAY",
[UMEvents.RealityCheck]: "UM_REALITY_CHECK",
[UMEvents.GlobalDepositLimits]: "UM_GLOBAL_DEPOSIT_LIMITS"
} as Events;
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/apps/hybrid/index.ts
import events from "./events";
import { AppConfig } from "../types";
import { formatEvents } from "../formatEvents";
export default formatEvents(events) as AppConfig;
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/apps/xsell/events.ts
import { UMEvents } from "../../types";
import type { Events } from "../types";
export default {
// Account
[UMEvents.Session]: [
"x-sell/bridge/to-react/onTriggerLogin",
"x-sell/bridge/to-native/loginFlowComplete"
],
[UMEvents.Join]: ["x-sell/bridge/to-react/onTriggerJoin"],
[UMEvents.KeepAlive]: ["x-sell/bridge/to-react/onUserTouch"],
[UMEvents.AcceptTerms]: [
"x-sell/bridge/to-react/onTriggerAcceptTerms",
"UM_ACCOUNT_ACCEPT_TERMS_COMPLETED"
],
[UMEvents.Verification]: ["x-sell/bridge/to-react/onTriggerVerification"],
[UMEvents.OpenSettings]: ["x-sell/bridge/to-react/onTriggerAccountSummary"],
[UMEvents.FirstLoad]: ["x-sell/bridge/to-react/firstLoadComplete"],
// Wallet
[UMEvents.Deposit]: ["x-sell/bridge/to-react/onTriggerDeposit"],
// Only Subscription
[UMEvents.SessionUpdate]: [
undefined,
"x-sell/bridge/to-native/authDetailsUpdated"
],
[UMEvents.Logout]: [undefined, "x-sell/bridge/to-native/logoutFlowComplete"],
[UMEvents.PresentModal]: [
undefined,
"x-sell/bridge/to-native/accountAndWalletClosed"
]
} as Events;
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/apps/xsell/index.ts
import events from "./events";
import { AppConfig } from "../types";
import { formatEvents } from "../formatEvents";
export default formatEvents(events) as AppConfig;
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/mediator/index.ts
import mediator from "@tvg/mediator";
import { isMobile, isXSell } from "@tvg/sh-utils/mobileUtils";
import { get } from "lodash";
import { xSellConfig, webConfig, hybridConfig } from "./apps";
import { AppConfig, MediatorChannel } from "./apps/types";
let mediatorInstance: typeof mediator;
let eventMappedInstance: AppConfig | null = null;
const getMediatorChannel = (): MediatorChannel => {
if (!mediatorInstance) {
if (isMobile()) {
mediatorInstance = mediator.ios;
eventMappedInstance = isXSell() ? xSellConfig : hybridConfig;
} else {
mediatorInstance = mediator.base;
eventMappedInstance = webConfig;
}
}
return {
dispatch: (action) => {
const type = get(eventMappedInstance?.triggers, action?.type);
if (type) {
mediatorInstance.dispatch({
type,
payload: action.payload
});
} else {
console.warn(`[UM] Can't find event ${action?.type} to dispatch`);
}
},
subscribe: (eventType, callback) => {
const type = get(eventMappedInstance?.subscriptions, eventType);
if (type) {
mediatorInstance.subscribe(type, callback);
} else {
console.warn(`[UM] Can't find event ${eventType} to subscribe`);
}
}
};
};
export default getMediatorChannel();
webpack://frontend-tpt/../../packages/tvg-lib-ts-types/Amplitude.ts
export enum LoginModalMediatorEventType {
// TVG ONLY
START = "LOGIN_MODAL_START",
ATTEMPT = "LOGIN_MODAL_LOGIN_ATTEMPT",
SUCCESS = "LOGIN_MODAL_SUCCESS",
ERROR = "LOGIN_MODAL_LOGIN_ERROR",
FIELD_COMPLETE = "LOGIN_MODAL_FIELD_COMPLETE",
SELECT_STATE = "LOGIN_MODAL_SELECT_STATE",
FORGOT_CREDENTIALS = "LOGIN_MODAL_FORGOT_CREDENTIALS",
// FDR & TVG
LOCATION_MODAL_VIEWED = "LOGIN_MODAL_LOCATION_MODAL_VIEWED",
LOCATION_MODAL_CLOSED = "LOGIN_MODAL_LOCATION_MODAL_CLOSED",
LOCATION_MODAL_CTA_CLICKED = "LOGIN_MODAL_LOCATION_MODAL_CTA_CLICKED",
LOGIN_SERVICE_LOADED = "OPEN_LOGIN_SUCCESS",
LOGIN_MODAL_OPEN = "LOGIN_MODAL_OPENED",
REGISTRATION_MODAL_OPEN = "REGISTRATION_MODAL_OPENED",
LOGIN_ERROR_MODAL_VIEWED = "LOGIN_MODAL_DEFAULT_ERROR_VIEWED",
LOGIN_ERROR_MODAL_CTA_CLICKED = "LOGIN_MODAL_DEFAULT_ERROR_CTA_CLICKED",
LOGIN_ERROR_MODAL_CLOSED = "LOGIN_MODAL_DEFAULT_ERROR_CLOSED"
}
export enum ProgramPageMediatorEventType {
URP_RUNNER_SELECTION = "PPM_TVG5_RUNNER_SELECTION",
RUNNER_SELECTION = "PPM_RUNNER_SELECTION",
SELECT_ALL_RUNNERS = "PPM_SELECT_ALL_RUNNERS",
RESET_ALL_RUNNERS = "PPM_RESET_ALL_RUNNERS",
SELECT_BET_TYPE = "PPM_SELECT_BET_TYPE",
SET_BET_AMOUNT = "PPM_SET_BET_AMOUNT",
BET_TIMEOUT = "PPM_BET_TIMEOUT",
BET_NOW = "PPM_BET_NOW",
DELETE_BET_TICKET = "PPM_DELETE_BET_TICKET",
OPEN_RACE_NAVIGATION = "PPM_OPEN_RACE_NAVIGATION",
HANDICAP_STORE_PRODUCT = "PPM_HANDICAP_STORE_PRODUCT",
HANDICAP_STORE_SEE_ALL = "PPM_HANDICAP_STORE_SEE_ALL",
RUNNER_MODIFIER_FILTER_APPLIED = "PROGRAM_PAGE_RUNNER_MODIFIER_FILTER_APPLIED",
RUNNER_MODIFIER_SORT_APPLIED = "PROGRAM_PAGE_RUNNER_MODIFIER_SORT_APPLIED",
WILL_PAYS_SELECT_OPTION = "PPM_WILL_PAYS_SELECT_OPTION",
PROBABLES_SELECT_OPTION = "PPM_PROBABLES_SELECT_OPTION",
PROGRAM_RUNNER_INFO_MODAL_OPENED = "PROGRAM_RUNNER_INFO_MODAL_OPENED",
PROGRAM_RUNNER_INFO_MODAL_CLOSED = "PROGRAM_RUNNER_INFO_MODAL_CLOSED",
FAVORITE_INTERACTION = "PPM_FAVORITE_INTERACTION",
POOLS_AND_INFO_MODAL_OPENED = "POOLS_AND_INFO_MODAL_OPENED",
POOLS_AND_INFO_TAB_OPENED = "POOLS_AND_INFO_TAB_OPENED",
HANDICAPPING_TAB_OPENED = "HANDICAPPING_TAB_OPENED",
RUNNER_TAGS_EXPANDED = "RUNNER_TAGS_EXPANDED",
PROGRAM_FREE_PP_DOWNLOAD = "PROGRAM_FREE_PP_DOWNLOAD",
DROPDOWN_OPEN = "PPM_DROPDOWN_OPEN",
DROPDOWN_RACE_SELECTED = "PPM_DROPDOWN_RACE_SELECTED",
ALTERNATE_SELECTION = "ALTERNATE_SELECTION"
}
export enum GlobalWalletMediatorEventType {
BALANCE_EXPANDED = "BALANCE_EXPANDED",
NAVIGATION = "MORE_NAVIGATION",
ACCOUNT_NAVIGATION = "ACCOUNT_NAVIGATION",
OPEN_CONTENT = "MORE_OPEN_CONTENT",
SWITCH_TOGGLE = "MORE_SWITCH_TOGGLE",
SUPPORT_TOGGLE = "SUPPORT_MODAL_TOGGLE",
WITHDRAW_DEPOSIT = "WITHDRAWAL_AND_DEPOSIT_BUTTON",
VIEW_BALANCE_DETAILS = "VIEW_BALANCE_DETAILS",
PLAYABLE_BALANCE_MODAL = "PLAYABLE_BALANCE_MODAL"
}
export enum RaceCellMediatorEventType {
CLICKED = "RACE_CELL_CLICKED"
}
export enum RaceCellModule {
TRACKS_AZ = "tracks_az",
FAVORITES = "favorites",
UPCOMING_RACES = "upcoming_races",
TIL = "tracks_information",
POOLS = "top_pools",
TOP_TRACKS = "top_tracks",
WINNERS = "previous_winners"
}
export interface RaceCellEventData {
type: RaceCellMediatorEventType;
payload: {
module: RaceCellModule;
trackName: string;
raceNumber: string;
linkUrl: string;
raceHasPromos: boolean;
trackHasPromos: boolean;
promoOptedIn: "true" | "false" | "none";
isFDTV: boolean;
trackCountry: string;
tabActive?: string;
activeFilters?: Record<string, string>[];
filterName?: string;
filterValue?: string;
specialWagerType?:
| "advance"
| "future"
| "special_pick"
| "future_special_pick"
| "advance_special_pick"
| "none";
position?: number;
};
}
export enum TracksMediatorEventType {
TRACK_CLICK = "TRACKS_TRACK_CLICK",
RACE_NAVIGATION = "RACE_NAVIGATION",
FILTER_CLICK = "TRACKS_FILTER_CLICK",
TAB_OPENED = "TRACKS_TAB_OPENED",
FILTER_APPLIED = "TRACKS_FILTER_APPLIED",
SEARCH_APPLIED = "TRACKS_SEARCH_APPLIED",
TRACKS_FAVORITE = "TRACKS_FAVORITE",
ALL_FILTERS_MODAL_OPENED = "TRACKS_ALL_FILTERS_MODAL_OPENED"
}
export enum RaceTracksMediatorEventType {
PAGE_VIEW = "RACETRACKS:PAGE_VIEW",
TRACK_CLICK = "RACETRACKS:TRACK_CLICK",
RACE_CLICK = "RACETRACKS:RACE_CLICK",
ADD_FAVORITE_CLICK = "RACETRACKS:ADD_FAVORITE_CLICK",
ADD_FAVORITE_SUCCESS = "RACETRACKS:ADD_FAVORITE_SUCCESS",
SEE_ALL_TODAYS_RACING = "RACETRACKS:SEE_ALL_TODAYS_RACING",
RETURN_TO_RACETRACKS = "RACETRACKS:RETURN_TO_RACETRACKS"
}
export interface RaceTracksDataPayload {
trackName?: string;
raceNumber?: number;
mtp?: number;
destinationUrl?: string;
}
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/account/gtm/index.ts
import mediator from "@tvg/mediator";
import { LoginModalMediatorEventType } from "@tvg/ts-types/Amplitude";
import type { UserInfo } from "../../../types/account/user";
// All of those functions have weird name, but I can't identify if we can change and If is really necessary,
// so I'll keep, but if in future you know, please change that.
export const loginSuccessGtm = (accountId: string, userBalance?: number) => {
mediator.base.dispatch({
type: "FDR_LOGIN_SUCCESS",
payload: {
accountId,
userBalance
}
});
};
export const openLoginSuccessGtm = (user: UserInfo, isVerified: boolean) => {
mediator.base.dispatch({
type: LoginModalMediatorEventType.LOGIN_SERVICE_LOADED,
payload: { user, isVerified }
});
};
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/hooks/useWallet/hooks/useSubscriptions/utils/completion/getBalance/setRacingWallet.ts
// @ts-nocheck
import { Dispatch } from "redux";
import { get, set, has } from "lodash";
import type { Balance } from "@fanduel/wallet-contract";
import {
failBalanceRequest,
updateWalletBalances
} from "@tvg/shared-actions/UserActions";
import * as mediatorClassic from "@tvg/mediator-classic/src";
import { loginSuccessGtm } from "../../../../../../../utils/account/gtm";
const balanceMap = {
RACING_PLAYABLE: "racingPlayable",
USER_RACING_BONUS: "racingBonus",
RACING_OTHER_CASH: "sharedDeposits",
SHARED_WINNINGS: "sharedWinnings"
};
export const setRacingWallet = (
balances: Set<Balance> | null,
dispatch: Dispatch,
accountNumber?: string
) => {
let balancePlayable: number | undefined;
if (balances) {
const racingWalletBalances = {};
balances.forEach((wallet) => {
// TODO: remove this accountTypeKey after the standardization of the keys sent by wallet lib (there's a mismatch between ios and android)
const accountTypeKey = has(wallet, "accountType")
? "accountType"
: "account_type";
/* @ts-ignore */
const walletKey = get(balanceMap, wallet[accountTypeKey]);
if (walletKey) {
set(racingWalletBalances, walletKey, wallet.balance);
}
});
balancePlayable = get(racingWalletBalances, balanceMap.RACING_PLAYABLE);
dispatch(
updateWalletBalances(
get(racingWalletBalances, "racingPlayable"),
get(racingWalletBalances, "racingBonus"),
get(racingWalletBalances, "sharedDeposits"),
get(racingWalletBalances, "sharedWinnings")
)
);
mediatorClassic.dispatch("BALANCE_UPDATE", balancePlayable);
} else {
dispatch(failBalanceRequest());
}
// TODO: Move this because is in wrong place.
if (accountNumber) {
loginSuccessGtm(accountNumber, balancePlayable);
}
};
webpack://frontend-tpt/../../packages/urp-lib-unified-modules/src/utils/wallet/getBalance/index.ts
import { Dispatch } from "redux";
import { isXSell } from "@tvg/sh-utils/mobileUtils";
import { getWalletBalances } from "@tvg/api/aw";
import { getAuthTokenCookie } from "@tvg/sh-utils/sessionUtils";
import { getUMEvent } from "../../mediator/events";
import { UMEvents } from "../../mediator/types";
import mediator from "../../mediator";
import { setRacingWallet } from "../../../hooks/useWallet/hooks/useSubscriptions/utils/completion/getBalance/setRacingWallet";
export const getBalance = (dispatch?: Dispatch, accountNumber?: string) => {
if (isXSell()) {
const authToken = getAuthTokenCookie();
if (authToken && dispatch) {
getWalletBalances(getAuthTokenCookie())
.then((balances) => {
const formattedBalances = new Set(
balances.map(({ account_type, ...rawBalances }) => ({
...rawBalances,
accountType: account_type
}))
);
setRacingWallet(formattedBalances, dispatch, accountNumber);
})
.catch(() => console.warn("[UM] Get balance failed"));
}
} else {
const event = getUMEvent(UMEvents.GetBalance);
const payload = accountNumber
? {
gtm: {
accountNumber
}
}
: {};
mediator.dispatch({
type: event.trigger,
payload
});
}
};
webpack://frontend-tpt/../../packages/tvg-comp-bet/utils.js
import { find, get, first } from "lodash";
export const getBetSelectionsToShow = (
betSelections,
bettingInterests = []
) => {
// if we don't have betting interest info return the selections values
if (bettingInterests.length === 0) {
return betSelections.map((column) =>
column.map((selection) => `${selection}`)
);
}
const betSelectionsToShow = [];
// leg races have multiple betInterest
const isLegRace = bettingInterests.length > 1;
betSelections.forEach((selection, index) => {
const column = [];
// if race is leg we should get the correct one
const raceBettingInterests = isLegRace
? bettingInterests[index]
: bettingInterests[0];
selection.forEach((bet) => {
const betInterest = find(
raceBettingInterests,
(bi) => bet === bi.biNumber.toString()
);
get(betInterest, "runners", []).forEach((runner) => {
if (!get(runner, "scratched")) {
column.push(get(runner, "runnerId").toString());
}
});
});
betSelectionsToShow.push(column);
});
return betSelectionsToShow;
};
export default {
getBetSelectionsToShow
};
export const getDateDiff = (postTime) =>
Math.round(
(new Date(postTime).getTime() - new Date().getTime()) / (1000 * 3600 * 24)
);
export const buildRunnersAndInterests = (
selections,
selectionsIndex,
bettingInterests
) => {
const runners = [];
const interests = [];
selections.forEach((runnerId) => {
let currentBetInterest = get(bettingInterests, selectionsIndex, []);
if (currentBetInterest.length < selectionsIndex) {
currentBetInterest = get(bettingInterests, 0, []);
}
const selectedBetInterest = currentBetInterest.filter((bettingInterest) =>
bettingInterest.runners.some((runner) => runner.runnerId === runnerId)
);
const biRunner = selectedBetInterest.length
? first(selectedBetInterest)
: undefined;
const biNumberInArray =
biRunner &&
interests.some((interest) => +interest.biNumber === +biRunner.biNumber);
if (biRunner !== undefined && !biNumberInArray) {
runners.push(biRunner.runners);
interests.push(biRunner);
}
});
return { runners, interests };
};
export const buildSelections = (selections, bettingInterests) =>
selections.reduce((accumulator, currentValue, currentIndex) => {
const { runners, interests } = buildRunnersAndInterests(
currentValue,
currentIndex,
bettingInterests
);
accumulator.push({
runners,
bettingInterests: interests
});
return accumulator;
}, []);
export const formatWager = ({
betTotal,
cancelable,
racePostTime,
mtp,
raceNumber,
raceTypeAbbreviation,
selections,
bettingInterests,
trackName,
wagerAmount,
winningsAmount,
probable,
wagerType
}) => {
return {
betStatus: {
code: "A",
name: "active"
},
serialNumber: "",
trackAbbreviation: "",
betTotal,
cancelable,
racePostTime,
mtp,
raceNumber,
raceTypeAbbreviation,
selections: {
selection: buildSelections(selections, bettingInterests)
},
trackName,
wagerAmount,
winningsAmount,
probable,
wagerType
};
};
export const BetError = {
raceOff: 136505,
insufficientFunds: 136518,
wagerLimits: 136521,
maxWagerSizeLimit: 136522,
expiredToken: 158405,
stateMismatch: 136525,
geoComplyTokenRejected: 136524,
geoComplyTokenMissing: 136463
};
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/pickBets.ts
import { get, isEmpty } from "lodash";
import {
RaceInfoMyBets,
RaceWagerType,
FavoriteRunners,
BettingInterest
} from "@tvg/ts-types/Race";
import {
BetSelection,
BetRunnerDetails,
ScratchedRunnersByLeg
} from "@tvg/ts-types/Bet";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import { SixFn } from "@tvg/ts-types/Functional";
import { handleCreateBetGtm } from "./gtm";
export const getCurrentWagerResults = (
races: RaceInfoMyBets[],
raceNumber: number,
totalWagers: number
): RaceInfoMyBets[] =>
races
.slice(raceNumber - 1, raceNumber + totalWagers - 1)
.filter(
(race: RaceInfoMyBets) =>
race.status.code !== "IC" && race.status.code !== "O"
);
export const checkForScratchedRunnersByLeg = (
selections: BetSelection[][],
totalResults: number
): boolean =>
selections
.slice(totalResults)
.map((selection: BetSelection[]) =>
selection.map((runners: BetSelection) =>
runners.runners.every((runner: BetRunnerDetails) => runner.isScratched)
)
)
.map((checks) => checks.every((check) => check))
.includes(true);
export const getScratchedLegNumbersIndex = (
selections: BetSelection[][]
): number[] =>
selections &&
selections
.map((selection: BetSelection[]) =>
selection
.filter((runners: BetSelection) => runners.runners.length > 0)
.map((runners: BetSelection) =>
runners.runners.every(
(runner: BetRunnerDetails) => runner.isScratched
)
)
.some((leg) => leg)
)
.reduce<Array<boolean>>((a, b) => a.concat(b), [])
.map((check: boolean, index) => (check ? index : -1))
.filter((leg: number) => leg > -1);
export const getWinningLegsBiNumbers = (results: RaceInfoMyBets[]): number[] =>
results.map((result: RaceInfoMyBets) =>
get(result, "results.runners[0].biNumber", 0)
);
export const verifyWagerWinningLegs = (
winningLegs: number[],
selections: BetSelection[][]
): boolean =>
winningLegs
.map((leg: number, index) =>
get(selections, `[${index}]`, [])
.map((runner: BetSelection) => +runner.runnerNumber === +leg)
.includes(true)
)
.every((leg) => leg === true);
export const getEligibleSelections = (
selections: BetSelection[][],
totalResults: number
): string[][] =>
selections.slice(totalResults).map((selection) =>
selection.reduce<Array<string>>((accSelection, currSelection) => {
const runners = get(currSelection, "runners") || [];
if (runners.some((runner) => !runner.isScratched)) {
accSelection.push(currSelection.runnerNumber.toString());
}
if (currSelection.alternate) {
const alternateNumber = `${currSelection.alternate.biNumber}B`;
const alternateRunners = get(currSelection.alternate, "runners") || [];
if (
!accSelection.includes(alternateNumber) &&
alternateRunners.some((runner) => !runner.isScratched)
) {
accSelection.push(alternateNumber);
}
}
return accSelection;
}, [])
);
export const pickBetWagerTypes = [
"WN",
"DB",
"P3",
"P4",
"P5",
"P6",
"P7",
"P8",
"P9",
"P10",
"P11",
"P12"
];
export const getEligibleNextRaceWagerTypeConfigs = (
race: RaceInfoMyBets | null,
pendingSelections: number
): RaceWagerType | typeof undefined =>
get(race, "wagerTypes", []).find(
(config: RaceWagerType) =>
config.type.code === pickBetWagerTypes[pendingSelections - 1]
);
export const betTypeChecker = (code: WagerTypeCodesEnum): boolean =>
pickBetWagerTypes.includes(code);
const selectionsToStringReducer = (
selectionString: string,
selections: BetSelection[],
index: number
) =>
get(selections, "length", 0)
? `${selectionString}&s${index}=${selections
.map((v) =>
v.alternate?.biNumber
? `${v.runnerNumber},${v.alternate.biNumber}B`
: v.runnerNumber
)
.toString()}`
: selectionString;
const selectionsToStringBetSlipReducer = (
selectionString: string[],
selections: BetSelection[]
) =>
get(selections, "length", 0)
? [...selectionString, selections.map((v) => v.runnerNumber).join()]
: [];
const reBetSelectionsToStringReducer = (
selectionString: string,
selections: string[],
index: number
) =>
get(selections, "length", 0)
? `${selectionString}&s${index}=${selections.map((v) => v).toString()}`
: selectionString;
export const stringifySelections = (selections: BetSelection[][]): string =>
selections.reduce(selectionsToStringReducer, "");
export const stringifySelectionsBetSlip = (
selections: BetSelection[][]
): string => selections.reduce(selectionsToStringBetSlipReducer, []).join(";");
export const stringifyReBetSelections = (selections: string[][]) =>
selections.reduce(reBetSelectionsToStringReducer, "");
const scratchesToStringReducer = (acc: string, value: number) => {
const seperator = acc.length ? ", " : "";
return `${acc}${seperator}${value + 1}`;
};
export const stringifyLegScratches = (scratchIndexes: number[]): string =>
scratchIndexes
.reduce(scratchesToStringReducer, "")
.replace(/,(?=[^,]*$)/, " &");
export const calculateBetTotalAmount = (
wagerSelections: string[][],
wagerAmount: number
): number =>
wagerSelections
.filter((selection) => !Number.isNaN(selection))
.map((selection) => selection.length)
.reduce((accumulator, currentValue) => accumulator * currentValue) *
wagerAmount;
export const getFavoriteRunnerByLeg = (
selections: BetSelection[][],
races: RaceInfoMyBets[],
raceNumber: number | string,
raceDate: string
): FavoriteRunners => {
const slicedRaces = races.slice(
+raceNumber - 1,
+raceNumber + get(selections, "length", 0) - 1
);
const isRaceToday = get(races, "0.raceDate", "") === raceDate;
if (!isRaceToday) {
return {};
}
return slicedRaces.reduce((accumulator, race: RaceInfoMyBets, index) => {
const raceFavorites: BettingInterest[] = race.bettingInterests.filter(
(runner) =>
(runner.favorite || runner.isFavorite) && !runner.runners[0].scratched
);
let filterBySingleFavorite = {};
if (raceFavorites.length === 1 && race.results) {
const raceFavorite = raceFavorites[0];
const isFavoriteWinner =
race.results &&
race.results.runners &&
race.results.runners.some(
(runner) =>
runner.finishPosition === 1 &&
runner.biNumber === raceFavorites[0].biNumber
);
filterBySingleFavorite = {
runnerNumber: +raceFavorite.biNumber,
runnerName: raceFavorite.runners[0].horseName,
isWinner: isFavoriteWinner,
isFavorite: raceFavorite.favorite || raceFavorite.isFavorite
};
}
return {
...accumulator,
[index]: filterBySingleFavorite
};
}, {});
};
export const getScratchedRunnersByLeg = (
selections: BetSelection[][]
): ScratchedRunnersByLeg =>
selections.reduce((acc, selection: BetSelection[], index) => {
const legScratches = selection
.map((runners: BetSelection) =>
runners.runners.filter((runner: BetRunnerDetails) => runner.isScratched)
)
.reduce((a, b) => a.concat(b), []);
return {
...acc,
[index]: legScratches
};
}, {});
export const checkScratchedLegsForFavorite = (
scratchedLegsByIndex: number[],
favoriteRunnerByLeg: FavoriteRunners
): boolean =>
(scratchedLegsByIndex || []).some(
(legIndex: number) =>
Object.keys(get(favoriteRunnerByLeg, legIndex, {})).length > 0
);
export const checkLegForScratchedFavorite = (
scratchedLegsByIndex: number[],
favoriteRunnerByLeg: FavoriteRunners,
scratchedRunnersByLeg: ScratchedRunnersByLeg
): number[] =>
scratchedLegsByIndex.filter((legIndex) =>
scratchedRunnersByLeg[legIndex].filter(
(runner) =>
!isEmpty(runner) &&
Object.keys(get(favoriteRunnerByLeg, legIndex, {})).length > 0 &&
+runner.runnerId !== +favoriteRunnerByLeg[legIndex].runnerNumber
)
);
export const handleRebetClickEvent = (
callback: SixFn<
string,
number,
WagerTypeCodesEnum,
number,
number,
string,
void
>,
rebetWagerAmount: number,
betAmount: number,
rebetWagerTypeCode: WagerTypeCodesEnum,
selections: string,
nextRaceNumber: number,
currentOpenLeg?: RaceInfoMyBets
) => {
// @ts-ignore
callback();
handleCreateBetGtm({
runnerAmount: rebetWagerAmount,
trackName: get(currentOpenLeg, "trackName", ""),
betAmount,
betType: rebetWagerTypeCode,
repeatBet: 0,
sport: get(currentOpenLeg, "isGreyhound", false)
? "Greyhounds Racing"
: "Horse Racing",
runnerSelectionList: selections.replace(/&s\d=/g, " ").trim(),
raceNumber: +nextRaceNumber
});
};
export const formatRepeatBetsSelections = (
selections: string[][],
currentWagerTypeCode: string,
wagerAmount: number
) =>
`&wt=${currentWagerTypeCode}&bet=${wagerAmount}${stringifyReBetSelections(
selections
)}`;
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/betsBetCard.ts
import { BetSelection } from "@tvg/ts-types/Bet";
import { Selections } from "@tvg/ts-types/Selections";
export const calculateShowBetsDetailedView = (
selections: BetSelection[][] | Selections[][],
showWillPays: boolean
): boolean[] => {
const selectionsLength = selections.length - 1;
return selections.map(
(_obj, index) =>
!!(selectionsLength > 0 && index === selectionsLength && showWillPays)
);
};
webpack://frontend-tpt/../../packages/sh-lib-my-bets/hooks/usePickBetRebet.ts
import { useEffect, useState } from "react";
import { get } from "lodash";
import { BetSelection } from "@tvg/ts-types/Bet";
import { RaceInfoMyBets, RaceWagerType } from "@tvg/ts-types/Race";
import { NullaryFn, SixFn } from "@tvg/ts-types/Functional";
import { WagerType, WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import {
calculateBetTotalAmount,
checkForScratchedRunnersByLeg,
getCurrentWagerResults,
getEligibleNextRaceWagerTypeConfigs,
getEligibleSelections,
getWinningLegsBiNumbers,
handleRebetClickEvent,
stringifyReBetSelections,
verifyWagerWinningLegs
} from "../utils/pickBets";
export type PickBetRebet = {
allRacesFromTrack: RaceInfoMyBets[];
mainWagerDetails: string[];
currentRace?: RaceInfoMyBets;
currentOpenLeg?: RaceInfoMyBets;
callback: SixFn<
string,
number,
WagerTypeCodesEnum,
number,
number,
string,
void
>;
selections: BetSelection[][];
enablePickBetRebet: boolean;
isPickBet: boolean;
isCurrentRaceDate: boolean;
isSettledBet: boolean;
};
export type PickBetRebetResult = [
NullaryFn<void>,
string,
string,
boolean,
string,
string,
number,
number,
Array<Array<string>>,
WagerType | {}
];
export const usePickBetRebet = ({
allRacesFromTrack,
mainWagerDetails,
currentRace,
currentOpenLeg,
selections,
callback,
enablePickBetRebet,
isPickBet,
isCurrentRaceDate,
isSettledBet
}: PickBetRebet): PickBetRebetResult => {
const [shouldShowRebet, setShouldShowRebet] = useState(false);
const [totalWagerResults, setTotalWagerResults] = useState(0);
const [
eligibleNextRaceWagerTypeConfigs,
setEligibleNextRaceWagerTypeConfigs
] = useState<RaceWagerType>();
useEffect(() => {
try {
if (enablePickBetRebet && isPickBet && !isSettledBet) {
const wagerRaceNumber = get(mainWagerDetails, 2);
const currentOpenLegStatusCode = get(currentOpenLeg, "status.code", "");
const totalWagerSelections = selections.length;
// Map races(legs) that are resulted
const listOfLegsResulted = getCurrentWagerResults(
allRacesFromTrack,
+wagerRaceNumber,
totalWagerSelections
);
const legsResultedLength = listOfLegsResulted.length;
// Count of missing legs to run
const totalPendingLegs = totalWagerSelections - legsResultedLength;
const tempEligibleNextRaceWagerTypeConfigs =
currentOpenLeg &&
getEligibleNextRaceWagerTypeConfigs(currentOpenLeg, totalPendingLegs);
// Validation to check straight away that there are no next wager
const hasNextLeg = legsResultedLength === totalWagerSelections;
// Validation to check if we have any result (leg that has finished already)
const noWagerResults = listOfLegsResulted.every(
(race) => race.results === null
);
const isNextRaceClosed =
currentOpenLegStatusCode === "RO" ||
currentOpenLegStatusCode === "SK";
const containsScratchedLeg = checkForScratchedRunnersByLeg(
selections,
legsResultedLength
);
const isCurrentRaceInRaceOff =
get(currentRace, "status.code", "") === "SK";
const winningLegsBiNumber = getWinningLegsBiNumbers(listOfLegsResulted);
const isWinningBet = verifyWagerWinningLegs(
winningLegsBiNumber,
selections
);
setTotalWagerResults(legsResultedLength);
setEligibleNextRaceWagerTypeConfigs(
tempEligibleNextRaceWagerTypeConfigs
);
if (
!hasNextLeg &&
!noWagerResults &&
!containsScratchedLeg &&
!isNextRaceClosed &&
!isCurrentRaceInRaceOff &&
!isWinningBet &&
isCurrentRaceDate &&
tempEligibleNextRaceWagerTypeConfigs
) {
setShouldShowRebet(true);
} else {
setShouldShowRebet(false);
}
}
} catch (e) {
// Something failed while check should show rebet
console.warn("[usePickBetRebet]: Error:", e);
}
}, [
enablePickBetRebet,
isPickBet,
allRacesFromTrack,
currentOpenLeg,
isCurrentRaceDate,
selections
]);
const currentOpenLegRaceNumber = get(currentOpenLeg, "number", 0);
const eligibleWagerSelections = getEligibleSelections(
selections,
totalWagerResults
);
const rebetWagerType = get(eligibleNextRaceWagerTypeConfigs, "type", {});
const rebetWagerTypeName = get(
eligibleNextRaceWagerTypeConfigs,
"type.name",
""
);
const rebetWagerTypeCode = get(
eligibleNextRaceWagerTypeConfigs,
"type.code",
""
);
const rebetWagerTypeId = get(eligibleNextRaceWagerTypeConfigs, "type.id", "");
const rebetWagerAmount = get(
eligibleNextRaceWagerTypeConfigs,
"wagerAmounts[0]",
""
);
const rebetSelections = stringifyReBetSelections(eligibleWagerSelections);
const betAmount = get(eligibleWagerSelections, "length", 0)
? calculateBetTotalAmount(eligibleWagerSelections, rebetWagerAmount)
: 0;
const rebetSearch = `?race=${currentOpenLegRaceNumber}&wt=${rebetWagerTypeCode}&bet=${rebetWagerAmount}${rebetSelections}&type=Rebet`;
return [
() =>
handleRebetClickEvent(
callback,
rebetWagerAmount,
betAmount,
rebetWagerTypeCode,
rebetSelections,
currentOpenLegRaceNumber,
currentOpenLeg
),
rebetWagerTypeName,
rebetSearch,
shouldShowRebet,
rebetWagerTypeId,
rebetSelections,
rebetWagerAmount,
betAmount,
eligibleWagerSelections,
rebetWagerType
];
};
export default usePickBetRebet;
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/gtm.ts
import mediator from "@tvg/mediator";
import { Dispatch } from "redux";
import { MultiLegCreateBetGTM, PayloadRepeatBetGTM } from "@tvg/ts-types/Bet";
import { get } from "lodash";
import { UnaryFn } from "@tvg/ts-types/Functional";
import {
openApproxPayoutModal,
openBetCancelModal,
openTrackRulesModal
} from "../redux/actions";
import {
ActiveTabEnum,
MyBetsBaseGtm,
OnBetCancelPayload,
SettledTabEnum
} from "./types";
export const sendTabSelectionGtmEvent = (tabSelected: ActiveTabEnum) =>
mediator.base.dispatch({
type: "MYBETS_TAB_SELECT",
payload: {
tab: tabSelected.toLocaleLowerCase()
}
});
export const sendTimeframeSelectionGtmEvent = (
timeframe: string,
tab: ActiveTabEnum | SettledTabEnum,
totalActiveBets: number,
totalSettledBets: number
) =>
mediator.base.dispatch({
type: "MYBETS_TIMEFRAME_SELECTED",
payload: {
timeframe,
tab,
activeBets: totalActiveBets,
settledBets: totalSettledBets
}
});
export const onApproxPayoutModalGtm = (
dispatch: Dispatch,
payload: MyBetsBaseGtm
) => {
dispatch(openApproxPayoutModal());
mediator.base.dispatch({ type: "OPEN_APPROX_PAYOUT_MODAL" });
mediator.base.dispatch({
type: "MYBETS_POTENTIAL_PAYOUT_CLICK",
payload: {
selectedTab: payload.selectedTab,
selectedSettledTab: payload.selectedSettledTab,
activeBets: payload.activeBetsCount,
settledBets: payload.settledBetsCount
}
});
};
export const onCancelBetModalGtm = (
dispatch: Dispatch,
payload: OnBetCancelPayload,
selectedTab: string,
selectedSettledTab: string,
totalActiveBets?: number,
totalSettledBets?: number
) => {
dispatch(openBetCancelModal(payload));
mediator.base.dispatch({
type: "MYBETS_CANCEL_BET",
payload: {
selectedTab,
selectedSettledTab,
activeBets: totalActiveBets,
settledBets: totalSettledBets
}
});
mediator.base.dispatch({ type: "OPEN_BET_CANCEL_MODAL" });
};
export const handleCreateBetGtm = (payload: MultiLegCreateBetGTM) => {
mediator.base.dispatch({
type: "MYBETS_PICKBET_CREATE_BET",
payload
});
};
export const onHideShowLegsGTM = (payload: {
isOpening: boolean;
activeBets: number;
settledBets: number;
}) => {
mediator.base.dispatch({
type: "HIDE-SHOW-LEGS-GTM",
payload
});
};
export const onToggleShowDetails = (payload: MyBetsBaseGtm) => {
mediator.base.dispatch({
type: "MYBETS_SHOW_DETAILS",
payload: {
selectedTab: payload.selectedTab,
selectedSettledTab: payload.selectedSettledTab,
show: payload.show,
totalActiveBets: payload.activeBetsCount,
totalSettledBets: payload.settledBetsCount
}
});
};
export const showTrackRulesGtm = (
dispatch: Dispatch,
selectedTab: string,
selectedSettledTab: string,
betType: string,
alternates: boolean = false
) => {
dispatch(openTrackRulesModal({ betType, alternates }));
mediator.base.dispatch({
type: "MYBETS_OPEN_TRACK_RULES",
payload: {
selectedTab,
selectedSettledTab
}
});
};
export const expandCollapseLegGtm = (
action: string,
legNumber: number,
selectedTab: string,
selectedSettledTab: string,
activeBetsCounter: number,
settledBetsCounter: number
) => {
mediator.base.dispatch({
type: "MYBETS_EXPAND_COLLAPSE_INDIVIDUAL_LEG",
payload: {
gaEventAction: action,
legNumber: `Leg ${legNumber}`,
selectedTab,
selectedSettledTab,
activeBets: activeBetsCounter,
settledBets: settledBetsCounter
}
});
};
export type RaceHeaderGTM = {
selectedTab: string;
selectedSettledTab: string;
activeBets: number;
settledBets: number;
gaEventLabel?: string;
};
export const handleRaceHeaderGtm = (type: string, payload: RaceHeaderGTM) => {
mediator.base.dispatch({
type,
payload
});
};
export const onReturnBettingGtm = (
selectedTab: string,
selectedSettledTab: string
) => {
mediator.base.dispatch({
type: "MYBETS_RETURN_TO_BETTING",
payload: {
selectedTab,
selectedSettledTab
}
});
};
export const handleCancelBetNotificationGtm = (
selectedTab: string,
selectedSettledTab: string,
activeBetsCounter: number,
settledBetsCounter: number
) => {
mediator.base.dispatch({
type: "MYBETS_USER_CLICKS_SEE_RULES_ON_CANCELLED_BET",
payload: {
selectedTab,
selectedSettledTab,
activeBets: activeBetsCounter,
settledBets: settledBetsCounter
}
});
};
export const onTabClickGtm = (payload: MyBetsBaseGtm) => {
mediator.base.dispatch({
type: "MYBETS_TAB_CLICK",
payload: {
selectedTab: get(payload, "selectedTab"),
selectedSettledTab: get(payload, "selectedSettledTab"),
activeBets: get(payload, "activeBetsCount"),
settledBets: get(payload, "settledBetsCount"),
futureBets: get(payload, "futureBetsCount"),
previousSelectedTab: get(payload, "previousSelectedTab")
}
});
};
export const onMyBetsStartupGtm = (
isMyBetsModalOpen: boolean,
activeBetsCounter: number,
settledBetsCounter: number,
isComponentLoading: boolean,
hasSentGtm: boolean,
setHasSentGtm: UnaryFn<boolean, void>
) => {
if (
isMyBetsModalOpen &&
activeBetsCounter >= 0 &&
settledBetsCounter >= 0 &&
!isComponentLoading &&
!hasSentGtm
) {
mediator.base.dispatch({
type: "MYBETS_STARTUP",
payload: {
activeBetsCounter,
settledBetsCounter
}
});
setHasSentGtm(true);
return true;
}
return false;
};
export const onMyBetsFilterHandling = (
filter: string,
tab: string,
settledTab: string,
activeBets: number,
settledBets: number,
isOpening: boolean
) =>
mediator.base.dispatch({
type: "MYBETS_FILTERS_HANDLING",
payload: {
filter,
tab,
settledTab,
activeBets,
settledBets,
isOpening
}
});
export const clearFilterDropdown = (
name: string,
activeFilter: string,
activeBets: number,
settledBets: number
) =>
mediator.base.dispatch({
type: "CLEAR_MYBETS_FILTER_DROPDOWN",
payload: {
name,
activeFilter,
activeBets,
settledBets
}
});
export const selectedNewFiltersGtm = (
name: string,
activeFilter: string,
activeBets: number,
settledBets: number
) =>
mediator.base.dispatch({
type: "SELECT_MYBETS_FILTER_TYPE",
payload: {
name,
activeFilter,
activeBets,
settledBets
}
});
export const selectedNewCustomDateGtm = (
activeBets?: number,
settledBets?: number
) =>
mediator.base.dispatch({
type: "SELECT_MYBETS_CUSTOM_DATE",
payload: {
activeBets,
settledBets
}
});
export const clearAllFiltersGtm = (
activeFilter: string,
activeBets: number,
settledBets: number
) =>
mediator.base.dispatch({
type: "CLEAR_ALL_MYBETS_FILTERS",
payload: {
activeFilter,
activeBets,
settledBets
}
});
export const onNavigateToTrackGtm = (
selectedTab: string,
selectedSettledTab: string,
activeBetsCounter: number,
settledBetsCounter: number,
destinationUrl: string
) => {
mediator.base.dispatch({
type: "MYBETS_NAVIGATE_TO_TRACK",
payload: {
selectedTab,
selectedSettledTab,
activeBets: activeBetsCounter,
settledBets: settledBetsCounter,
destinationUrl
}
});
};
export const onRepeatBetGTM = (payload: PayloadRepeatBetGTM) => {
mediator.base.dispatch({
type: "MYBETS_REPEAT_BET",
payload
});
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MyBetsWagerHeader/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import buildColor from "../../_static/ColorPalette";
import Text from "../../_atom/Text";
import {
fontCondensedNormal,
fontMedium,
fontNormal
} from "../../_static/Typography";
/* Use z-index on runnerNumber when (ex: winner) to surpass these styles */
const MutedStyles = (color = "white", variation = "80") => css`
position: relative;
&::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: ${buildColor(color, variation)};
z-index: 1;
}
`;
export const BetCardHeader = styled.div`
display: flex;
justify-content: space-between;
height: ${({ isBigHeader }) => (isBigHeader ? "72px" : "56px")};
padding: 11px 12px;
background-color: ${buildColor("blue_accent", "000")};
border-top-left-radius: 4px;
border-top-right-radius: 4px;
${({ isCenter }) =>
isCenter &&
css`
align-items: center;
`}
${({ hasBorderBottom }) =>
hasBorderBottom &&
css`
border-bottom: 1px solid ${buildColor("blue", "100")};
`}
${({ hasRoundBorderBottom }) =>
hasRoundBorderBottom &&
css`
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
`}
`;
export const HeaderColumn = styled.div`
display: flex;
flex-direction: column;
margin-right: ${({ addMargin }) => (addMargin ? "12px" : "8px")};
&:last-child:not(:first-child) {
margin-right: 0;
align-items: flex-end;
}
${({ betStatus }) =>
betStatus === "canceled" && MutedStyles("blue_accent", "50")}
${({ textRight }) => textRight && "text-align: right"}
`;
export const HeaderText = styled(Text)`
font-size: 14px;
line-height: 18px;
font-family: ${({ isWinner, isRefund }) =>
isWinner || isRefund ? fontMedium : fontNormal};
${({ isCanceled }) =>
isCanceled &&
css`
text-decoration: line-through;
`}
${({ isWinner }) =>
isWinner
? css`
color: ${buildColor("green", "700")};
`
: css`
color: ${buildColor("grey", "900")};
`}
`;
export const HeaderTitle = styled(Text)`
color: ${({ isWinner }) =>
buildColor(isWinner ? "green" : "grey", isWinner ? "700" : "800")};
font-family: ${fontCondensedNormal};
font-size: 12px;
line-height: 16px;
text-transform: uppercase;
${({ isCanceled }) =>
isCanceled &&
css`
text-decoration: line-through;
`}
`;
export const HideShowContainer = styled.button`
background: none;
border: none;
outline: none;
display: flex;
align-items: center;
`;
export const HideShowLabel = styled.span`
color: ${buildColor("blue_accent", "500")};
font-family: ${fontNormal};
font-style: normal;
font-weight: 500;
font-size: 12px;
line-height: 17px;
margin-left: 4px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/WagerHeaderStatus/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import Text from "../../_atom/Text";
import {
fontCondensedNormal,
fontMedium,
fontNormal
} from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
const IconTextInlineStyles = css`
display: flex;
align-items: center;
svg {
margin-right: 4px;
}
`;
/* Use z-index on runnerNumber when (ex: winner) to surpass these styles */
const MutedStyles = (color = "white", variation = "80") => css`
position: relative;
&::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: ${buildColor(color, variation)};
z-index: 1;
}
`;
export const HeaderCanceledContainer = styled.div`
${IconTextInlineStyles};
`;
export const HeaderColumn = styled.div`
display: flex;
flex-direction: column;
${({ betStatus }) =>
betStatus === "canceled" && MutedStyles("blue_accent", "50")}
${({ textRight }) => textRight && "text-align: right;"}
${({ addMargin }) => addMargin && "margin-right: 8px;"}
`;
export const HeaderContainer = styled.div`
display: flex;
flex-direction: row;
`;
export const HeaderPayoutButton = styled.button`
${IconTextInlineStyles};
background-color: transparent;
outline: none;
border: none;
cursor: pointer;
`;
export const HeaderRefundedLink = styled(Link)`
${IconTextInlineStyles};
text-decoration: none;
${({ smallText }) =>
smallText &&
css`
font-size: 12px;
`}
`;
export const HeaderRow = styled.div`
display: flex;
flex-direction: row;
${({ center }) =>
center &&
css`
justify-content: center;
`}
`;
export const HeaderText = styled(Text)`
font-size: 14px;
line-height: 18px;
font-family: ${({ isWinner, isRefund }) =>
isWinner || isRefund ? fontMedium : fontNormal};
${({ isCanceled }) =>
isCanceled &&
css`
color: ${buildColor("grey", "800")};
`}
${({ isWinner }) =>
isWinner
? css`
color: ${buildColor("green", "700")};
`
: css`
color: ${buildColor("grey", "800")};
`}
`;
export const HeaderRefundText = styled(Text)`
display: flex;
align-items: center;
font-family: ${fontCondensedNormal};
font-size: 12px;
line-height: 14px;
color: ${buildColor("grey", "900")};
margin-right: 1ch;
`;
export const HeaderTitle = styled(Text)`
color: ${({ isWinner }) =>
buildColor(isWinner ? "green" : "grey", isWinner ? "700" : "800")};
font-family: ${fontCondensedNormal};
font-size: 12px;
line-height: 16px;
text-transform: uppercase;
${({ isCanceled }) =>
isCanceled &&
css`
text-decoration: line-through;
`}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/WonIllustration/Illustrations.jsx
import React from "react";
import buildColor from "../../_static/ColorPalette";
export const TVGLogo = () => (
<svg
width="41"
height="11"
viewBox="0 0 41 11"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M33.231 2.86552C31.3785 2.86552 30.0099 3.60725 29.5156 5.49764C29.0647 7.22552 29.9538 8.13688 32.2088 8.13688C33.6917 8.13688 34.5571 7.66807 35.0635 6.96462H33.1912L33.745 4.84272H40.2183L38.8233 10.1849H36.8699L36.5799 9.31893C35.1786 10.1733 33.607 10.501 30.9953 10.501C27.8055 10.501 23.6249 9.85764 24.7533 5.53726C24.9428 4.81245 25.235 4.18737 25.6043 3.64776L20.2934 10.1849H15.5163L13.4845 3.18296H9.51629L7.68791 10.1849H3.13712L4.96506 3.18296H0.515991L1.13307 0.818416H12.798V0.817525H17.8009L18.7658 6.82616H18.798L22.9007 0.817525H24.8362L24.8357 0.816635H30.3491C31.4295 0.587348 32.5467 0.500977 33.5904 0.500977C38.6557 0.500977 40.7659 1.63094 40.4926 4.03777H35.3597C35.357 3.55293 35.0971 3.25197 34.7197 3.08724C34.3285 2.91761 33.8262 2.86552 33.231 2.86552Z"
fill={buildColor("green", "700")}
/>
</svg>
);
export const Laurel = ({ direction }) =>
direction === "left" ? (
<svg
width="20"
height="33"
viewBox="0 0 20 33"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M7.47955 0.617188C0.730745 2.59239 4.74955 8.75319 4.74955 8.75319C4.74955 8.75319 9.52555 7.14159 7.47955 0.617188ZM6.79195 16.7296V16.7272C6.98995 16.6408 11.7071 14.5432 10.0943 9.39399C10.0943 9.39399 5.22355 9.72999 6.15835 14.7988C5.34115 12.9232 3.57835 10.2796 0.016745 9.71079C-0.391255 19.72 6.79195 16.7296 6.79195 16.7296ZM12.2771 15.9856C15.5219 21.0376 11.2043 24.3376 11.1191 24.4012C11.0159 24.4864 5.01115 29.368 2.31235 19.7404C5.63275 19.2868 8.07475 20.9464 9.53515 22.408C7.46755 17.59 12.2771 15.9856 12.2771 15.9856ZM16.4603 21.3244C16.4603 21.3244 12.4691 24.4864 16.2719 28.3492C14.1839 27.6292 10.9463 27.106 7.99075 29.1352C15.2903 36.8344 18.4859 29.3632 18.4859 29.3632L18.4847 29.3608C19.1423 27.9784 20.3723 24.2656 16.4603 21.3244Z"
fill={buildColor("green", "500")}
/>
</svg>
) : (
<svg
width="20"
height="33"
viewBox="0 0 20 33"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M11.9523 0.617188C18.7011 2.59239 14.6811 8.75319 14.6811 8.75319C14.6811 8.75319 9.90629 7.14159 11.9523 0.617188ZM12.6387 16.7296L12.6399 16.7272C12.4419 16.6408 7.72469 14.5432 9.33749 9.39399C9.33749 9.39399 14.2071 9.72999 13.2723 14.7988C14.0895 12.9232 15.8523 10.2796 19.4151 9.71079C19.8231 19.72 12.6387 16.7296 12.6387 16.7296ZM7.15349 15.9844C3.90869 21.0376 8.22749 24.3364 8.31149 24.4012C8.41589 24.4864 14.4207 29.368 17.1183 19.7404C13.7991 19.2868 11.3571 20.9464 9.89669 22.408C11.9631 17.59 7.15349 15.9844 7.15349 15.9844ZM2.97029 21.3244C2.97029 21.3244 6.96269 24.4864 3.15989 28.348C5.24789 27.628 8.48429 27.106 11.4411 29.1352C4.14149 36.8344 0.94469 29.3632 0.94469 29.3632L0.947089 29.3608C0.288289 27.9784 -0.940515 24.2656 2.97029 21.3244Z"
fill={buildColor("green", "500")}
/>
</svg>
);
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/WonIllustration/styled-components.js
import styled, { css } from "styled-components";
import { fontBold, fontNormal } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const Container = styled.div`
${({ hideLogo }) =>
!hideLogo &&
css`
min-width: 140px;
`}
position: relative;
display: flex;
align-items: flex-end;
z-index: 2;
justify-content: flex-end;
`;
export const TextContainer = styled.div`
display: flex;
flex-direction: column;
align-items: center;
margin: 0 4px;
${({ shouldWrap }) =>
shouldWrap &&
css`
max-width: min-content;
`};
`;
export const WinAmountContainer = styled.div`
background-color: ${buildColor("green", "600")};
transform: skew(-15deg);
padding: 0 4px;
text-align: center;
${({ shouldWrap }) =>
!shouldWrap &&
css`
min-width: 90px;
`};
`;
export const WinAmountValue = styled.span`
display: inline-flex;
font-family: ${fontBold};
font-size: 14px;
transform: skew(15deg);
color: ${buildColor("white", "100")};
`;
export const WinAmountDescriptionWrapper = styled.div`
display: flex;
margin-top: 2px;
align-items: center;
`;
export const WinAmountDescription = styled.span`
font-family: ${fontNormal};
font-size: 12px;
font-style: normal;
font-weight: 700;
color: ${buildColor("green", "700")};
text-transform: uppercase;
text-align: center;
margin-right: 2px;
${({ hideLogo }) =>
!hideLogo &&
css`
padding-top: 1px;
`}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/WonIllustration/index.jsx
import React from "react";
import formatCurrency from "@tvg/formatter/currency";
import { TVGLogo, Laurel } from "./Illustrations";
import {
Container,
TextContainer,
WinAmountContainer,
WinAmountValue,
WinAmountDescription,
WinAmountDescriptionWrapper
} from "./styled-components";
const MAX_VALUE_FOR_WRAPPING = 1000;
const WonIllustration = (props) => {
const { qaLabel, winAmount, hideLogo } = props;
const description = hideLogo ? "Won on fanduel" : "Won on";
const shouldWrap = hideLogo && winAmount < MAX_VALUE_FOR_WRAPPING;
return (
<Container data-qa-label={qaLabel} hideLogo={hideLogo}>
<Laurel direction="left" data-qa-label={`${qaLabel}-laurel-left`} />
<TextContainer shouldWrap={shouldWrap}>
<WinAmountContainer
data-qa-label={`${qaLabel}-amount-container`}
shouldWrap={shouldWrap}
>
<WinAmountValue data-qa-label={`${qaLabel}-amount`}>
{formatCurrency(winAmount || 0)}
</WinAmountValue>
</WinAmountContainer>
<WinAmountDescriptionWrapper data-qa-label={`${qaLabel}-description`}>
<WinAmountDescription hideLogo={hideLogo}>
{description}
</WinAmountDescription>
{!hideLogo && <TVGLogo />}
</WinAmountDescriptionWrapper>
</TextContainer>
<Laurel direction="right" data-qa-label={`${qaLabel}-laurel-right`} />
</Container>
);
};
WonIllustration.defaultProps = {
winAmount: 0,
qaLabel: "wonIllustration",
hideLogo: false
};
export default WonIllustration;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/WagerHeaderStatus/index.jsx
import React from "react";
import { noop } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import {
HeaderCanceledContainer,
HeaderColumn,
HeaderContainer,
HeaderPayoutButton,
HeaderRefundedLink,
HeaderRefundText,
HeaderRow,
HeaderText,
HeaderTitle
} from "./styled-components";
import Icon from "../../_static/Icons";
import { betCanceled, info, question } from "../../_static/Icons/iconsDuotone";
import buildColor from "../../_static/ColorPalette";
import WonIllustration from "../../_atom/WonIllustration";
const renderRefundStatus = (betRefund, qaLabel, addMargin) => (
<HeaderColumn
data-qa-label={`${qaLabel}-status-list`}
textRight
addMargin={addMargin}
>
<HeaderText qaLabel={`${qaLabel}-status-text`} isRefund>
{formatCurrency(betRefund || 0)}
</HeaderText>
{/* There will be a modal explaining this */}
<HeaderRefundedLink data-qa-label={`${qaLabel}-status-link`} to="/">
<Icon
qaLabel={`${qaLabel}-status-icon`}
icon={info}
viewBoxSize={16}
size={16}
color={buildColor("blue_accent", "100")}
stroke={buildColor("blue_accent", "500")}
/>
<HeaderTitle qaLabel={`${qaLabel}-status-title`}>refunded</HeaderTitle>
</HeaderRefundedLink>
</HeaderColumn>
);
export const WagerHeaderStatus = (props) => {
const {
betStatus,
winningsAmount,
probableValue,
onApproxPayout,
betRefund,
isBetWinner,
shouldShowPotentialReturn,
qaLabel,
showMinMaxWillPays,
minWillPays,
maxWillPays,
isFDR
} = props;
const renderPotentialPayout = () => (
<HeaderColumn data-qa-label={`${qaLabel}-status-list`} textRight>
<HeaderText qaLabel={`${qaLabel}-status-text`}>
{probableValue}
</HeaderText>
<HeaderPayoutButton onClick={onApproxPayout}>
<Icon
icon={question}
viewBoxSize={16}
size={16}
color={buildColor("blue_accent", "100")}
stroke={buildColor("blue_accent", "500")}
/>
<HeaderTitle qaLabel={`${qaLabel}-status-title`}>
approx. payout
</HeaderTitle>
</HeaderPayoutButton>
</HeaderColumn>
);
const renderWillPays = () => (
<HeaderColumn>
<HeaderText data-qa-label="my-bets-payout-value">
{`${formatCurrency(minWillPays, "USD")} - ${formatCurrency(
maxWillPays,
"USD"
)}`}
</HeaderText>
<HeaderTitle data-qa-label="my-bets-payout-button-text">
Will Pays
</HeaderTitle>
</HeaderColumn>
);
switch (betStatus) {
case "canceled":
return (
<HeaderColumn data-qa-label={`${qaLabel}-status-list`} textRight>
<HeaderCanceledContainer data-qa-label={`${qaLabel}-status-wrapper`}>
<Icon
qaLabel={`${qaLabel}-status-icon`}
icon={betCanceled}
viewBoxSize={16}
size={16}
color={buildColor("white", "10")}
stroke={buildColor("grey", "800")}
/>
<HeaderText qaLabel={`${qaLabel}-status-text`} isCanceled>
Cancelled
</HeaderText>
</HeaderCanceledContainer>
</HeaderColumn>
);
case "winner":
return isBetWinner ? (
<HeaderRow>
<HeaderContainer>
<HeaderColumn data-qa-label={`${qaLabel}-status-list`}>
<WonIllustration
winAmount={winningsAmount || 0}
hideLogo={isFDR}
/>
{!!betRefund && (
<HeaderRow data-qa-label={`${qaLabel}-status-list`} center>
<HeaderRefundText qaLabel={`${qaLabel}-status-text`}>
+{formatCurrency(betRefund || 0)}
</HeaderRefundText>
{/* There will be a modal explaining this */}
<HeaderRefundedLink
smallText
data-qa-label={`${qaLabel}-status-link`}
to="/"
>
<HeaderTitle qaLabel={`${qaLabel}-status-title`}>
refund
</HeaderTitle>
</HeaderRefundedLink>
</HeaderRow>
)}
</HeaderColumn>
</HeaderContainer>
</HeaderRow>
) : (
<HeaderRow>
{!!betRefund && (
<HeaderColumn data-qa-label={`${qaLabel}-status-list`} textRight>
<HeaderText qaLabel={`${qaLabel}-status-text`}>
{formatCurrency(betRefund || 0)}
</HeaderText>
{/* There will be a modal explaining this */}
<HeaderRefundedLink
data-qa-label={`${qaLabel}-status-link`}
to="/"
>
<HeaderTitle qaLabel={`${qaLabel}-status-title`}>
refund
</HeaderTitle>
</HeaderRefundedLink>
</HeaderColumn>
)}
<HeaderContainer>
<HeaderColumn data-qa-label={`${qaLabel}-status-list`} textRight>
<HeaderText
qaLabel={`${qaLabel}-status-text`}
isWinner={isBetWinner}
>
{formatCurrency(winningsAmount || 0)}
</HeaderText>
<HeaderTitle
qaLabel={`${qaLabel}-status-title`}
isWinner={isBetWinner}
>
return
</HeaderTitle>
</HeaderColumn>
</HeaderContainer>
</HeaderRow>
);
case "loser":
return (
<HeaderContainer>
{betRefund > 0 && renderRefundStatus(betRefund, qaLabel, true)}
<HeaderColumn data-qa-label={`${qaLabel}-status-list`} textRight>
<HeaderText qaLabel={`${qaLabel}-status-text`}>
{formatCurrency(0)}
</HeaderText>
<HeaderTitle qaLabel={`${qaLabel}-status-title`}>
return
</HeaderTitle>
</HeaderColumn>
</HeaderContainer>
);
case "refunded":
return (
<React.Fragment>
{renderRefundStatus(betRefund, qaLabel, false)}
</React.Fragment>
);
default:
return (
<React.Fragment>
{shouldShowPotentialReturn && renderPotentialPayout()}
{showMinMaxWillPays && renderWillPays()}
</React.Fragment>
);
}
};
WagerHeaderStatus.defaultProps = {
betStatus: "active",
winningsAmount: 0,
probableValue: "",
onApproxPayout: noop,
betRefund: 0,
isBetWinner: false,
shouldShowPotentialReturn: false,
qaLabel: "wager-header-status",
showMinMaxWillPays: false,
minWillPays: 0,
maxWillPays: 0,
isFDR: false
};
export default WagerHeaderStatus;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MyBetsWagerHeader/index.jsx
import React from "react";
import { get, noop } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import Icon from "../../_static/Icons";
import buildColor from "../../_static/ColorPalette";
import { eyeHide, eyeShow } from "../../_static/Icons/icons";
import {
BetCardHeader,
HeaderColumn,
HeaderText,
HeaderTitle,
HideShowContainer,
HideShowLabel
} from "./styled-components";
import WagerHeaderStatus from "../WagerHeaderStatus";
const MyBetsWagerHeader = (props) => {
const {
isOptedIn,
betStatus,
isCanceled,
wager,
probableValue,
onApproxPayout,
onHideShowLegsGTM,
showContent,
setShowContent,
betRefund,
isBetWinner,
shouldShowPotentialReturn,
shouldShowHideLegButton,
shouldShowRebet,
qaLabel,
betsNumber,
showMinMaxWillPays,
minWillPays,
maxWillPays,
isFDR
} = props;
return (
<BetCardHeader
data-qa-label={qaLabel}
hasBorderBottom={showContent && (!isOptedIn || !shouldShowRebet)}
hasRoundBorderBottom={!showContent && !shouldShowRebet}
isBigHeader={!!betRefund && betStatus === "winner"}
isCenter={!betRefund || betStatus !== "winner"}
>
<HeaderColumn data-qa-label={`${qaLabel}-info`} betStatus={betStatus}>
<HeaderText qalabel={`${qaLabel}-text`} isCanceled={isCanceled}>
{formatCurrency(wager.wagerAmount || 0)}{" "}
{get(wager, "wagerType.name", "")}
{betsNumber > 1 && ` (x${betsNumber})`}
</HeaderText>
<HeaderTitle qaLabel={`${qaLabel}-title`} isCanceled={isCanceled}>
{formatCurrency((wager.betTotal || 0) * betsNumber)} ticket
</HeaderTitle>
</HeaderColumn>
<HeaderColumn data-qa-label={`${qaLabel}-status-wrapper`}>
<WagerHeaderStatus
betStatus={get(wager, "betStatus.name", "")}
winningsAmount={get(wager, "winningsAmount", 0)}
probableValue={probableValue}
onApproxPayout={onApproxPayout}
betRefund={betRefund}
isBetWinner={isBetWinner}
shouldShowPotentialReturn={shouldShowPotentialReturn}
showMinMaxWillPays={showMinMaxWillPays}
minWillPays={minWillPays}
maxWillPays={maxWillPays}
isFDR={isFDR}
/>
{shouldShowHideLegButton && (
<HideShowContainer
onClick={() => {
onHideShowLegsGTM(!showContent);
setShowContent(!showContent, get(wager, "id"));
}}
>
<Icon
icon={showContent ? eyeHide : eyeShow}
size={16}
color={buildColor("blue_accent", "100")}
stroke={buildColor("blue_accent", "500")}
/>
<HideShowLabel>{showContent ? "Hide" : "Show"} legs</HideShowLabel>
</HideShowContainer>
)}
</HeaderColumn>
</BetCardHeader>
);
};
MyBetsWagerHeader.defaultProps = {
isOptedIn: false,
betStatus: "active",
isCanceled: false,
wager: {},
probableValue: "",
onApproxPayout: noop,
onHideShowLegsGTM: noop,
showContent: true,
setShowContent: noop,
betRefund: 0,
isBetWinner: false,
shouldShowPotentialReturn: false,
shouldShowHideLegButton: false,
qaLabel: "my-bets-wager-header",
betsNumber: 1,
isFDR: false
};
export default MyBetsWagerHeader;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MyBetsWagerFooter/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import ButtonDefault from "../../_atom/Buttons/default";
import { fontMedium } from "../../_static/Typography";
export const BetCardFooter = styled.div.attrs({
"data-qa-label": "myBets-betTicket-footer"
})`
display: flex;
align-items: center;
justify-content: flex-end;
${({ isDesktop }) =>
!isDesktop &&
css`
height: 48px;
padding: 0 4px;
`};
${({ hasTopBorder, isDesktop }) =>
hasTopBorder &&
!isDesktop &&
`border-top: 1px solid ${buildColor("blue", "100")};`}
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
`;
export const FooterButton = styled(ButtonDefault)`
font-family: ${fontMedium};
text-decoration: none;
display: flex;
align-items: center;
height: 32px;
padding: 0 8px;
font-size: 14px;
border-radius: 2px;
color: ${({ isCancelButton }) =>
buildColor(
isCancelButton ? "red" : "grey",
isCancelButton ? "600" : "900"
)};
${({ isDetailsButton }) =>
isDetailsButton
? css`
margin-left: auto;
${({ isDesktop }) =>
isDesktop &&
`
margin-right: -6px;
`};
svg {
margin-left: 8px;
}
`
: css`
margin-right: 4px;
svg {
margin-right: 8px;
}
`};
svg {
flex-shrink: 0;
}
${({ isDetailsButton, isDesktop }) => {
if (isDesktop) {
return css`
position: absolute;
bottom: 8px;
right: 12px;
&:hover {
background-color: ${isDetailsButton
? buildColor("blue_accent", "100")
: buildColor("grey", "100")};
}
`;
}
return "";
}}
&:active {
background-color: ${({ isCancelButton, isDesktop }) => {
if (isCancelButton) {
return buildColor("red", "200");
}
if (isDesktop) {
return buildColor("blue_accent", "200");
}
return buildColor("grey", "200");
}};
}
${({ isDesktop }) =>
isDesktop &&
css`
color: ${buildColor("blue_accent", "500")};
`};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MyBetsWagerFooter/index.jsx
import React from "react";
import { Link } from "react-router-dom";
import { first, noop } from "lodash";
import { Icon as DSIcon } from "@tvg/design-system";
import Icon from "../../_static/Icons";
import {
chevronDown,
chevronUp,
repeat,
trash
} from "../../_static/Icons/iconsDuotone";
import buildColor from "../../_static/ColorPalette";
import { BetCardFooter, FooterButton } from "./styled-components";
const parseSelectionsUrl = (url) => {
if (!url) return "";
const urlParsed = url.split("&");
if (urlParsed.length) {
urlParsed.shift();
urlParsed.pop();
return urlParsed.join("&");
}
return "";
};
const MyBetsWagerFooter = ({
closeModal,
raceUrl,
isDetailsOpened,
handleDetailsButton,
shouldRenderFooter,
isBetActive,
isWagerCancelable,
repeatButtonSearch,
showRepeatButton,
onCancelWager,
isContentDisplayed,
isDesktop,
onShareWager,
socialShareModalToggle
}) =>
shouldRenderFooter && (
<BetCardFooter hasTopBorder={isContentDisplayed} isDesktop={isDesktop}>
{socialShareModalToggle && (
<FooterButton
data-qa-label="myBets-social-share"
onClick={() => onShareWager(parseSelectionsUrl(repeatButtonSearch))}
>
<DSIcon
name="popout"
size="s"
lineColor={buildColor("blue", "900")}
/>
</FooterButton>
)}
{showRepeatButton && (
<FooterButton
data-qa-label="myBets-betTicked-repeatButton"
as={Link}
onClick={closeModal}
isDesktop={isDesktop}
to={{
pathname: first(raceUrl.split("?")),
search: repeatButtonSearch.substring(1)
}}
>
<Icon
icon={repeat}
viewBoxSize={16}
size={16}
color={buildColor("grey", "100")}
stroke={buildColor("blue", "900")}
/>
{isBetActive ? "Repeat bet" : "Re-Bet"}
</FooterButton>
)}
{isWagerCancelable && (
<FooterButton
qaLabel="myBets-betTicked-cancelButton"
isCancelButton
isDesktop={isDesktop}
onClick={onCancelWager}
>
<Icon
icon={trash}
viewBoxSize={16}
size={16}
color={buildColor("red", "000")}
stroke={
isDesktop
? buildColor("blue_accent", "500")
: buildColor("red", "600")
}
/>
Cancel
</FooterButton>
)}
<FooterButton
qaLabel="myBets-betTicked-detailsButton"
isDetailsButton
isDesktop={isDesktop}
showDetails={!isDetailsOpened}
onClick={handleDetailsButton}
>
{isDetailsOpened ? "Hide details" : "Show details"}
<Icon
icon={!isDetailsOpened ? chevronDown : chevronUp}
viewBoxSize={16}
size={16}
color="transparent"
stroke={
isDesktop
? buildColor("blue_accent", "500")
: buildColor("grey", "900")
}
/>
</FooterButton>
</BetCardFooter>
);
MyBetsWagerFooter.defaultProps = {
closeModal: noop,
raceUrl: "",
isDetailsOpened: false,
handleDetailsButton: noop,
shouldRenderFooter: false,
isBetActive: false,
isWagerCancelable: false,
repeatButtonSearch: "",
showRepeatButton: false,
onCancelWager: noop,
isDesktop: false
};
export default MyBetsWagerFooter;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/PickBetRebet/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import buildColor from "../../_static/ColorPalette";
export const PickBetsContainer = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 12px;
background-color: ${buildColor("white", "100")};
border-top: 1px solid ${buildColor("blue", "100")};
${({ hasRoundBottomBorder }) =>
hasRoundBottomBorder &&
css`
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
`}
${({ bigLayout }) =>
bigLayout &&
css`
flex-direction: column;
border-top: 0;
background: #e9eff5;
border-radius: 4px;
`}
`;
export const PickBetsTextWrapper = styled.div`
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: ${({ bigLayout }) =>
bigLayout ? "center" : "space-between"};
`;
export const PickBetsLinkContainer = styled(Link)`
display: flex;
flex-direction: row;
flex-shrink: 0;
text-decoration: none;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/PickBetRebet/index.jsx
import React, { Fragment } from "react";
import { first, noop } from "lodash";
import { TVGThemeProvider, Paragraph } from "@tvg/design-system";
import { Button } from "@tvg/design-system/web";
import {
PickBetsContainer,
PickBetsTextWrapper,
PickBetsLinkContainer
} from "./styled-components";
const PickBetRebet = ({
raceUrl,
handleRebetClickEvent,
rebetWagerTypeName,
rebetSearch,
isContentDisplayed,
bigLayout,
isTVG4
}) => {
const PickBetWrapper = isTVG4 ? Fragment : PickBetsLinkContainer;
return (
<TVGThemeProvider>
<PickBetsContainer
bigLayout={bigLayout}
hasRoundBottomBorder={!isContentDisplayed}
>
<PickBetsTextWrapper bigLayout={bigLayout}>
<Paragraph
fontFamily="medium"
color="blue_accent.800"
qaLabel="pick-bets-rebet-title"
>{`${rebetWagerTypeName} Available`}</Paragraph>
<Paragraph
qaLabel="pick-bets-rebet-description"
fontSize="xs"
marginBottom={bigLayout ? "space-4" : ""}
>
Bet using your remaining selections
</Paragraph>
</PickBetsTextWrapper>
<PickBetWrapper
data-qa-label="myBets-pickbets-link"
to={{
pathname: raceUrl && first(raceUrl.split("?")),
search: rebetSearch,
state: {
openVideo: false
}
}}
>
<Button
variant="betting"
iconPosition="end"
icon="arrowRight"
onClick={handleRebetClickEvent}
qaLabel="button"
size="m"
isStretched
>
Create Bet
</Button>
</PickBetWrapper>
</PickBetsContainer>
</TVGThemeProvider>
);
};
PickBetRebet.defaultProps = {
raceUrl: "",
handleRebetClickEvent: noop,
rebetWagerTypeName: "",
rebetSearch: "",
isContentDisplayed: true,
bigLayout: false,
isTVG4: false
};
export default React.memo(PickBetRebet);
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/BetNotification/styled-components.js
/* eslint-disable import/prefer-default-export */
import styled, { css } from "styled-components";
import { fontNormal, fontMedium } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const Notification = styled.div`
position: relative;
font-family: ${fontNormal};
display: flex;
justify-content: space-between;
padding: 12px;
background-color: ${({ colorBackground }) => colorBackground};
color: ${({ color }) => color};
width: 100%;
border-bottom: 1px solid ${({ colorBorder }) => colorBorder};
`;
const borderColor = css`
position: absolute;
background: ${({ colorBorder }) => colorBorder};
`;
export const NotificationTopBorder = styled.div`
${borderColor};
top: -1px;
left: 0;
width: 100%;
height: 1px;
`;
export const NotificationLeftBorder = styled.div`
${borderColor};
top: -1px;
left: -1px;
width: 1px;
height: calc(100% + 2px);
`;
export const NotificationRightBorder = styled.div`
${borderColor};
top: -1px;
right: -1px;
width: 1px;
height: calc(100% + 2px);
`;
const paddingLeft = css`
padding-left: 26px;
`;
export const NotificationWrapper = styled.div`
display: flex;
flex-direction: column;
position: relative;
`;
export const NotificationTitle = styled.div`
font-family: ${({ titleIsBold }) => (titleIsBold ? fontMedium : fontNormal)};
font-size: 14px;
line-height: 19px;
display: flex;
align-items: center;
> svg {
position: absolute;
}
> div {
${paddingLeft}
}
`;
const largeTextFont = css`
font-size: 14px;
line-height: 18px;
`;
const smallTextFont = css`
font-size: 12px;
line-height: 17px;
`;
export const NotificationText = styled.div`
font-family: ${fontNormal};
${({ textFontSize }) =>
textFontSize === "small" ? smallTextFont : largeTextFont};
${paddingLeft};
`;
export const CloseNotification = styled.button`
display: flex;
justify-content: center;
align-items: flex-start;
height: 100%;
background-color: ${({ colorBackground }) => colorBackground};
`;
export const RulesButton = styled.button`
display: flex;
outline: none;
text-decoration: underline;
color: ${({ color }) => color || buildColor("orange", "700")};
font-family: ${({ fontFamily }) => fontFamily || fontMedium};
font-size: 12px;
line-height: 17px;
background-color: ${({ colorBackground }) => colorBackground};
${paddingLeft};
cursor: pointer;
`;
export const CancelBetRulesContainer = styled.div`
font-family: ${fontMedium};
font-size: 12px;
line-height: 17px;
margin-top: 2px;
display: flex;
align-items: baseline;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/BetNotification/index.jsx
import React from "react";
import { noop } from "lodash";
import Icon from "../../_static/Icons";
import { infoOutline } from "../../_static/Icons/icons";
import { close } from "../../_static/Icons/iconsDuotone";
import {
CloseNotification,
Notification,
NotificationText,
NotificationTitle,
NotificationWrapper,
RulesButton,
CancelBetRulesContainer,
NotificationTopBorder,
NotificationLeftBorder,
NotificationRightBorder
} from "./styled-components";
function BetCancelNotification(props) {
const {
qaLabel,
color,
colorBackground,
colorBorder,
colorList,
iconElement,
viewBoxSize,
iconColor,
strokeColor,
title,
text,
textFontSize,
showCloseButton,
showNotificationFn,
showRulesLink,
showRulesFn,
useLargerWidth,
showCancelRulesFn,
showCancelRules,
hasTopBorder,
titleIsBold
} = props;
return (
<Notification
data-qa-label={qaLabel}
color={color}
colorBackground={colorBackground}
colorBorder={colorBorder}
>
{useLargerWidth && <NotificationLeftBorder colorBorder={colorBorder} />}
{useLargerWidth && <NotificationRightBorder colorBorder={colorBorder} />}
{(useLargerWidth || hasTopBorder) && (
<NotificationTopBorder colorBorder={colorBorder} />
)}
<NotificationWrapper data-qa-label={`${qaLabel}-wrapper`}>
<NotificationTitle
data-qa-label={`${qaLabel}-title`}
titleIsBold={titleIsBold}
>
{colorList && colorList.length > 0 ? (
<Icon
icon={iconElement}
colorList={colorList}
size={14}
viewBoxSize={viewBoxSize}
/>
) : (
<Icon
icon={iconElement}
color={iconColor || color}
size={14}
viewBoxSize={viewBoxSize}
stroke={strokeColor}
/>
)}
<div data-qa-label={`${qaLabel}-rules-title-text`}>{title}</div>
</NotificationTitle>
{typeof text === "string" && (
<NotificationText
data-qa-label={`${qaLabel}-text`}
textFontSize={textFontSize}
>
{text}
</NotificationText>
)}
{Array.isArray(text) &&
text.map((elemText, index) => (
<NotificationText
data-qa-label={`${qaLabel + index}-text`}
textFontSize={textFontSize}
>
{elemText}
</NotificationText>
))}
{showRulesLink && showRulesFn && (
<RulesButton
data-qa-label={`${qaLabel}-rules-link`}
onClick={() => showRulesFn(true)}
colorBackground={colorBackground}
>
See track rules
</RulesButton>
)}
{showCancelRules && showCancelRulesFn && (
<CancelBetRulesContainer>
<RulesButton
data-qa-label={`${qaLabel}-rules-link`}
onClick={() => showCancelRulesFn(true)}
colorBackground="transparent"
fontFamily="inherit"
color={color}
>
See rules
</RulesButton>
<span data-qa-label={`${qaLabel}-rules-link-text`}>
for more details
</span>
</CancelBetRulesContainer>
)}
</NotificationWrapper>
{showCloseButton && showNotificationFn && (
<CloseNotification
data-qa-label={`${qaLabel}-close`}
onClick={() => showNotificationFn(false)}
colorBackground={colorBackground}
>
<Icon icon={close} stroke={color} size={16} viewBoxSize={16} />
</CloseNotification>
)}
</Notification>
);
}
BetCancelNotification.defaultProps = {
colorList: [],
viewBoxSize: 1024,
iconElement: infoOutline,
strokeColor: "",
iconColor: "",
qaLabel: "bet-notification",
showNotificationFn: noop,
showCloseButton: false,
showRulesLink: false,
showRulesFn: noop,
textFontSize: "large",
useLargerWidth: false,
hasTopBorder: false,
titleIsBold: true
};
export default BetCancelNotification;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/OptedInTag/styled-components.ts
import styled, { css } from "styled-components";
import buildColor from "@tvg/atomic-ui/_static/ColorPalette";
import { fontCondensedNormal } from "@tvg/atomic-ui/_static/Typography";
export const Wrapper = styled.div<{
isInline: boolean;
}>`
align-items: center;
justify-content: center;
background-color: ${buildColor("green", "100")};
${({ isInline }) =>
isInline
? css`
display: inline-flex;
height: 24px;
padding: 4px 8px;
border-radius: 12px;
`
: css`
display: flex;
height: 30px;
padding: 0 8px;
border-top: 1px solid ${buildColor("green", "200")};
border-bottom: 1px solid ${buildColor("green", "200")};
`}
`;
export const Text = styled.span<{
isInline: boolean;
}>`
font-family: ${fontCondensedNormal};
color: ${buildColor("green", "800")};
text-transform: uppercase;
font-size: ${({ isInline }) => (isInline ? "14px" : "12px")};
line-height: 17px;
margin-left: 4px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/OptedInTag/index.tsx
import React from "react";
import Icon from "@tvg/atomic-ui/_static/Icons";
import buildColor from "@tvg/atomic-ui/_static/ColorPalette";
import { optedIn } from "@tvg/atomic-ui/_static/Icons/iconsDuotone";
import { Wrapper, Text } from "./styled-components";
export type Props = {
isInline?: boolean;
qaLabel?: string;
};
const OptedInTag = ({
isInline = false,
qaLabel = "myBets-betTicket-optedInTag"
}: Props) => (
<Wrapper data-qa-label={`${qaLabel}-container`} isInline={isInline}>
<Icon
icon={optedIn}
viewBoxSize={16}
size={16}
color={buildColor("green", "200")}
stroke={buildColor("green", "700")}
/>
<Text data-qa-label={`${qaLabel}-text`} isInline={isInline}>
opted in
</Text>
</Wrapper>
);
export default OptedInTag;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/MyBetsWager/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "@tvg/atomic-ui/_static/ColorPalette";
import { fontMedium } from "../../_static/Typography";
/* Use z-index on runnerNumber when (ex: winner) to surpass these styles */
const MutedStyles = css`
position: relative;
&::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: ${buildColor("white", "80")};
z-index: 1;
}
`;
export const BetCard = styled.div.attrs({
"data-qa-label": "myBets-betTicket"
})`
border-radius: 4px;
border: 1px solid ${buildColor("blue", "100")};
&:not(:last-child) {
margin-bottom: 12px;
}
`;
export const BetCardBody = styled.div.attrs({
"data-qa-label": "myBets-betTicket-selections"
})`
padding: 12px 10px;
${({ hasContentMaxHeight, isScrollable }) =>
hasContentMaxHeight &&
css`
overflow-y: auto;
max-height: 25vh;
box-shadow: ${isScrollable
? "inset 0px -2px 6px rgba(56, 64, 72, 0.15)"
: "none"};
`}
${({ isBetsDetailedView }) =>
!isBetsDetailedView &&
css`
/* hasMutedStyles in all bets status - (active & winner horses) */
${({ betStatus }) =>
["winner", "canceled", "loser", "refunded"].includes(betStatus) &&
MutedStyles}
`}
`;
export const AlertInlineAction = styled.p`
display: flex;
font-family: ${fontMedium};
font-size: 14px;
line-height: 16px;
cursor: pointer;
text-decoration-line: underline;
color: ${buildColor("blue_accent", "700")};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/MyBetsWager/index.jsx
import React, { useCallback } from "react";
import { noop, get } from "lodash";
import { AlertInline } from "@tvg/design-system";
import MyBetsWagerHeader from "../../_molecule/MyBetsWagerHeader";
import MyBetsWagerFooter from "../../_molecule/MyBetsWagerFooter";
import PickBetRebet from "../../_molecule/PickBetRebet";
import { infoOutline } from "../../_static/Icons/iconsDuotone";
import buildColor from "../../_static/ColorPalette";
import BetNotificationScratch from "../../_molecule/BetNotification";
import OptedInTag from "../../_atom/OptedInTag";
import { BetCard, BetCardBody, AlertInlineAction } from "./styled-components";
const MyBetsWager = ({
wager,
probableValue,
raceUrl,
closeModal,
onApproxPayout,
showTrackRules,
onHideShowLegsGTM = noop,
showContent,
setShowContent = noop,
betCardRef,
betCardBodyRef,
isOptedIn,
betStatus,
isCanceled,
showBetsDetailedView,
betRefund,
isBetWinner,
shouldShowHideLegButton,
shouldShowPotentialReturn,
hasFooter,
shouldShowRebet,
isDetailsOpened,
handleDetailsButton,
shouldRenderFooter,
isBetActive,
isWagerCancelable,
repeatButtonSearch,
showRepeatButton,
renderRunnerSelection,
showScratchedNotification,
shouldNotHideScratchNotification,
setShouldNotHideScratchNotification,
scratchedTitle,
scratchedLegText,
onCancelWager,
handleRebetClickEvent,
rebetWagerTypeName,
rebetSearch,
qaLabel,
hasContentMaxHeight,
isMyBetsOpen,
betsNumber,
isCardBodyScrollable,
isDesktop,
isScratchInfoDesign,
showMinMaxWillPays,
minWillPays,
maxWillPays,
renderPromoOnboarding,
onShareWager,
socialShareModalToggle,
isFDR
}) => {
if (!wager) {
return null;
}
const wagerId = get(wager, "id", "unk");
const getBetNotificationScratch = useCallback(
() =>
isScratchInfoDesign ? (
<AlertInline
message={scratchedLegText}
title={scratchedTitle}
type="fixed"
variant="informational"
qaLabel={`notification-scratch-${wagerId}`}
marginBottom="space-5"
onDismissPress={setShouldNotHideScratchNotification}
actionLink={
<AlertInlineAction
qaLabel="notification-scratch-modal"
onClick={showTrackRules}
>
See Rules
</AlertInlineAction>
}
/>
) : (
<BetNotificationScratch
qaLabel={`notification-scratch-${wagerId}`}
title={scratchedTitle}
text={scratchedLegText}
textFontSize="small"
color={buildColor("orange", "700")}
colorList={[buildColor("orange", "200"), buildColor("orange", "700")]}
colorBorder={buildColor("orange", "200")}
colorBackground={buildColor("orange", "000")}
iconElement={infoOutline}
showCloseButton
showNotificationFn={setShouldNotHideScratchNotification}
showRulesLink={isMyBetsOpen}
useLargerWidth
showRulesFn={showTrackRules}
/>
),
[
wagerId,
scratchedTitle,
scratchedLegText,
setShouldNotHideScratchNotification,
isMyBetsOpen,
showTrackRules,
isScratchInfoDesign
]
);
return (
<BetCard data-qa-label={qaLabel} ref={betCardRef}>
<MyBetsWagerHeader
isOptedIn={isOptedIn}
betStatus={betStatus}
isCanceled={isCanceled}
wager={wager}
probableValue={probableValue}
onApproxPayout={onApproxPayout}
onHideShowLegsGTM={onHideShowLegsGTM}
showContent={showContent}
setShowContent={setShowContent}
betRefund={betRefund}
isBetWinner={isBetWinner}
shouldShowHideLegButton={shouldShowHideLegButton}
shouldShowPotentialReturn={shouldShowPotentialReturn}
shouldShowRebet={shouldShowRebet}
betsNumber={betsNumber}
showMinMaxWillPays={showMinMaxWillPays}
minWillPays={minWillPays}
maxWillPays={maxWillPays}
isFDR={isFDR}
/>
{isOptedIn && <OptedInTag />}
{showScratchedNotification &&
shouldNotHideScratchNotification &&
getBetNotificationScratch()}
{showContent && (
<BetCardBody
ref={betCardBodyRef}
betStatus={betStatus}
isScrollable={isCardBodyScrollable}
isBetsDetailedView={
showBetsDetailedView &&
showBetsDetailedView.length > 0 &&
showBetsDetailedView.every((value) => value)
}
hasContentMaxHeight={hasContentMaxHeight}
>
{renderRunnerSelection}
</BetCardBody>
)}
{shouldShowRebet && (
<PickBetRebet
raceUrl={raceUrl}
handleRebetClickEvent={handleRebetClickEvent}
rebetWagerTypeName={rebetWagerTypeName}
rebetSearch={rebetSearch}
isContentDisplayed={showContent}
/>
)}
{renderPromoOnboarding}
{hasFooter && (
<MyBetsWagerFooter
closeModal={closeModal}
raceUrl={raceUrl}
isDetailsOpened={isDetailsOpened}
handleDetailsButton={handleDetailsButton}
shouldRenderFooter={shouldRenderFooter && showContent}
isBetActive={isBetActive}
isWagerCancelable={isWagerCancelable}
repeatButtonSearch={repeatButtonSearch}
showRepeatButton={showRepeatButton}
onCancelWager={onCancelWager}
isContentDisplayed={showContent}
isDesktop={isDesktop}
onShareWager={onShareWager}
socialShareModalToggle={socialShareModalToggle}
/>
)}
</BetCard>
);
};
MyBetsWager.defaultProps = {
wager: {},
probableValue: null,
raceUrl: "",
closeModal: noop,
onApproxPayout: noop,
showTrackRules: false,
onHideShowLegsGTM: noop,
showContent: true,
setShowContent: noop,
betCardRef: null,
isOptedIn: false,
betStatus: "O",
isCanceled: false,
showBetsDetailedView: false,
betRefund: 0,
isBetWinner: false,
shouldShowHideLegButton: false,
shouldShowPotentialReturn: false,
hasFooter: true,
shouldShowRebet: false,
isDetailsOpened: false,
handleDetailsButton: noop,
shouldRenderFooter: true,
isBetActive: false,
isWagerCancelable: false,
repeatButtonSearch: "",
showRepeatButton: false,
renderRunnerSelection: null,
showScratchedNotification: false,
shouldNotHideScratchNotification: false,
setShouldNotHideScratchNotification: noop,
scratchedTitle: "",
scratchedLegText: "",
onCancelWager: noop,
handleRebetClickEvent: noop,
rebetWagerTypeName: "",
rebetSearch: "",
qaLabel: "my-bets-wager",
hasContentMaxHeight: false,
isMyBetsOpen: false,
betsNumber: 1,
isCardBodyScrollable: false,
isScratchInfoDesign: false,
showMinMaxWillPays: false,
minWillPays: 0,
maxWillPays: 0,
renderPromoOnboarding: null,
isFDR: false
};
export default MyBetsWager;
webpack://frontend-tpt/../../packages/sh-lib-my-bets/utils/runnerNumberGroupUtils.ts
import { get, includes } from "lodash";
import { BetSelection } from "@tvg/ts-types/Bet";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
const getWagerTypeIndex = (wagerCode: string, payoutsTitle: string[] = []) => {
const payoutsCharCode = payoutsTitle.map((title) => title[0]);
const charWagerCode = wagerCode[0];
return payoutsCharCode.findIndex(
(payoutCode) => payoutCode.toLowerCase() === charWagerCode.toLowerCase()
);
};
export const getWillPaysSimpleRace = (
runner: BetSelection,
payoutsTitles: string[] = []
) => {
const payoutsTitlesLength = payoutsTitles.length;
const payoutsTable = new Array(payoutsTitlesLength).fill(null);
(get(runner, "payouts") || []).forEach((payout) => {
const wagerCode = get(payout, "wagerType.code");
const amount = get(payout, "amount", 0);
const payoutsTableIndex = getWagerTypeIndex(wagerCode, payoutsTitles);
if (payoutsTableIndex >= 0) {
payoutsTable[payoutsTableIndex] = amount;
}
});
return payoutsTable;
};
export const getPayoutsHeaderTitle = (
wagerTypeCode: WagerTypeCodesEnum,
runners: BetSelection[]
) => {
const wagerCode = wagerTypeCode || "";
const raceFinished = !!runners.find(
(runner) => get(runner, "payouts.length") > 0
);
const hasPayouts = {
win: raceFinished && wagerCode.includes("W"),
place: raceFinished && wagerCode.includes("P"),
show: raceFinished && wagerCode.includes("S")
};
return Object.entries(hasPayouts).reduce(
(accPayouts: string[], currPayout) => {
const [payoutKey, payoutValue] = currPayout;
if (payoutValue) {
return [...accPayouts, payoutKey];
}
return accPayouts;
},
[]
);
};
export const checkFavoriteSequence = (
runner: BetSelection,
favorites: string[],
lastFavoriteAdded: string,
doubleEntryRegex: RegExp
) =>
lastFavoriteAdded &&
!includes(favorites, runner.runnerNumber) &&
((doubleEntryRegex.test(runner.runnerNumber) &&
(lastFavoriteAdded === runner.runnerNumber ||
parseInt(lastFavoriteAdded, 10) === parseInt(runner.runnerNumber, 10))) ||
parseInt(lastFavoriteAdded, 10) + 1 === parseInt(runner.runnerNumber, 10));
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/constant.ts
// @ts-ignore
import buildColor from "../../_static/ColorPalette";
import {
successRound,
errorRound,
questionMarkRound,
exclamationMarkRound
// @ts-ignore
} from "../../_static/Icons/iconsDuotone";
export const iconStyles = {
open: {
border: "transparent",
background: "transparent",
dotColor: buildColor("grey", "600"),
textColor: buildColor("grey", "800"),
iconColor: buildColor("grey", "600"),
trackingColor: buildColor("grey", "300")
},
raceOff: {
border: buildColor("grey", "800"),
background: buildColor("white", "100"),
textColor: buildColor("grey", "900"),
iconColor: buildColor("grey", "800"),
dotColor: buildColor("grey", "800"),
trackingColor: buildColor("grey", "300")
},
unknown: {
border: buildColor("grey", "800"),
background: buildColor("white", "100"),
textColor: buildColor("grey", "900"),
iconColor: buildColor("grey", "800"),
dotColor: buildColor("grey", "800"),
trackingColor: buildColor("grey", "300")
// TODO: future unknown status
// border: buildColor("orange", "600"),
// background: buildColor("orange", "200"),
// textColor: buildColor("grey", "800"),
// iconColor: buildColor("orange", "600"),
// trackingColor: buildColor("orange", "300"),
// icon: exclamationMark
},
win: {
border: buildColor("green", "700"),
background: buildColor("green", "100"),
textColor: buildColor("green", "700"),
iconColor: buildColor("green", "700"),
trackingColor: buildColor("green", "300"),
icon: successRound
},
lost: {
border: buildColor("red", "700"),
background: buildColor("red", "100"),
textColor: buildColor("red", "700"),
iconColor: buildColor("red", "700"),
trackingColor: buildColor("red", "300"),
icon: errorRound
},
pending: {
border: buildColor("orange", "900"),
background: buildColor("orange", "200"),
textColor: buildColor("orange", "600"),
iconColor: buildColor("orange", "600"),
trackingColor: buildColor("orange", "300"),
icon: questionMarkRound
},
attention: {
border: buildColor("grey", "900"),
background: buildColor("orange", "400"),
textColor: buildColor("orange", "700"),
iconColor: buildColor("grey", "900"),
trackingColor: buildColor("orange", "300"),
icon: exclamationMarkRound
}
};
export default iconStyles;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/styled-components.ts
import styled, { css, keyframes } from "styled-components";
import { get } from "lodash";
import {
fontMedium,
fontNormal,
fontBold,
fontCondensedNormal,
defaultSize
// @ts-ignore
} from "../../_static/Typography";
// @ts-ignore
import buildColor from "../../_static/ColorPalette";
// @ts-ignore
import Icon from "../../_static/Icons";
// @ts-ignore
import { iconStyles } from "./constant";
const textStyling = css`
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;
const fadeIn = keyframes`
0% {
opacity: 0;
}
100% {
opacity: 1;
}
`;
const getIconStyle = (raceStatus: string, element: string) =>
element
? get(iconStyles, `${raceStatus}.${element}`)
: get(iconStyles, `${raceStatus}`);
/* Use z-index on runnerNumber when (ex: winner) to surpass these styles */
const MutedStyles = (color = "white", variation = "80") => css`
position: relative;
&::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: ${buildColor(color, variation)};
z-index: 1;
}
`;
export const RunnerNumberContainer = styled.div`
display: flex;
flex-direction: column;
flex-grow: 1;
width: 100%;
`;
export const RunnerNumberGroupMolecule = styled.ol<{
isBetsDetailedView: boolean;
betStatusName: string;
raceStatus: string;
}>`
list-style-type: none;
display: flex;
width: 100%;
${({ isBetsDetailedView }) =>
isBetsDetailedView
? css`
flex-direction: column;
`
: css`
align-items: center;
flex-wrap: wrap;
`}
/* surpass muted styles in detailed view on these bet status */
${({ isBetsDetailedView, betStatusName, raceStatus }) =>
isBetsDetailedView &&
raceStatus !== "unknown" &&
["winner", "canceled", "loser", "refunded"].includes(betStatusName) &&
css`
z-index: 2;
/* Text color for all bets status but not active */
.runner-name {
color: ${buildColor("grey", "700")};
}
`}
${({ raceStatus }) =>
raceStatus === "unknown" &&
css`
z-index: 2;
`}
`;
export const ListItem = styled.li<{ isBetsDetailedView?: boolean }>`
display: flex;
align-items: center;
&:not(:first-child) {
${({ isBetsDetailedView }) =>
isBetsDetailedView
? css`
margin-top: 2px;
`
: css`
margin-left: 4px;
`}
}
`;
export const RunnerNameContainer = styled.div<{
isWinnerBI?: boolean;
isUnknownWinnerStatus?: boolean;
isActiveMultiRaceLegOver?: boolean;
}>`
display: flex;
flex-direction: row;
margin-left: 8px;
${textStyling}
/* Text styles for winner runners */
${({ isWinnerBI, isUnknownWinnerStatus }) =>
isWinnerBI &&
!isUnknownWinnerStatus &&
css`
& > .runner-name {
font-family: ${fontMedium};
color: ${buildColor("grey", "900")};
}
`}
${({ isWinnerBI, isUnknownWinnerStatus, isActiveMultiRaceLegOver }) =>
!isWinnerBI &&
!isUnknownWinnerStatus &&
isActiveMultiRaceLegOver &&
css`
& > .runner-name {
color: ${buildColor("grey", "700")};
}
`}
`;
export const RunnerName = styled.span<{ isScratched?: boolean }>`
font-family: ${fontNormal};
font-size: 14px;
line-height: 18px;
${textStyling};
color: ${({ isScratched }) =>
buildColor("grey", isScratched ? "700" : "900")};
${({ isScratched }) =>
isScratched &&
css`
text-decoration: line-through;
`}
`;
export const DetailedViewInfoContainer = styled.div`
display: flex;
flex-direction: row;
margin-left: auto;
align-items: center;
flex: 1;
justify-content: flex-end;
`;
export const Tag = styled.span`
display: flex;
margin-left: 6px;
`;
export const RaceOdds = styled.span<{
isBetsDetailedView?: boolean;
showReplacement?: boolean;
}>`
font-family: ${fontBold};
font-size: 14px;
line-height: 18px;
`;
export const WillPaysInfoContainer = styled.div<{ isDesktop: boolean }>`
display: flex;
width: 100%;
margin-top: 2px;
margin-bottom: 8px;
${({ isDesktop }) =>
isDesktop &&
css`
margin-left: 2px;
margin-top: 4px;
`}
`;
export const WillPaysInfoDesktopText = styled.span`
font-family: ${fontNormal};
font-size: 12px;
color: ${buildColor("blue_accent", "700")};
`;
export const WillPays = styled.span<{ hasMargin?: boolean }>`
font-family: ${fontMedium};
font-size: ${defaultSize};
line-height: 18px;
text-align: right;
font-weight: 500;
color: ${buildColor("grey", "900")};
flex: 1;
display: flex;
align-self: center;
justify-content: flex-end;
${({ hasMargin }) =>
hasMargin &&
`
&:not(:last-child) {
flex-grow: 2;
}
`}
`;
export const WillPaysLabel = styled.span`
position: absolute;
top: 6px;
right: 26px;
font-family: ${fontCondensedNormal};
font-size: 12px;
color: ${buildColor("grey", "800")};
`;
export const PickBetContainer = styled.div<{
showUpperHorizontalRule: boolean;
isBetsDetailedView: boolean;
isDesktop: boolean;
showHorizontalRule: boolean;
isCanceled: boolean;
raceStatus: string;
}>`
position: relative;
&:not(:first-child) {
margin-top: 2px;
${({ showUpperHorizontalRule }) =>
showUpperHorizontalRule &&
css`
margin-top: 15px;
`};
}
&:not(:last-child) {
${({ isBetsDetailedView, isDesktop, showHorizontalRule }) => {
if (isBetsDetailedView) {
if (isDesktop) {
if (!showHorizontalRule) {
return "";
}
return css`
padding-bottom: 13px;
`;
}
return css`
padding-bottom: 6px;
`;
}
if (!isDesktop) {
return css`
padding-bottom: 8px;
`;
}
return css``;
}};
${({ isCanceled, isDesktop, raceStatus }) =>
!isCanceled && !isDesktop
? css`
&::after {
content: "";
width: 2px;
height: calc(100% - 18px);
background: ${getIconStyle(raceStatus, "trackingColor")};
border-radius: 1px;
position: absolute;
top: 20px;
left: 9px;
z-index: 2;
}
`
: ""}
}
`;
export const PickBetsWrapper = styled.div`
display: flex;
position: relative;
`;
export const PickBetLabelIconContainer = styled.div<{
isDesktop: boolean;
raceStatus: string;
}>`
display: flex;
align-items: center;
justify-content: ${({ isDesktop, raceStatus }) =>
isDesktop && (raceStatus === "open" || raceStatus === "raceOff")
? "right"
: "center"};
flex-shrink: 0;
height: 20px;
width: 20px;
margin-right: ${({ isDesktop }) => (isDesktop ? "6px" : "8px")};
position: relative;
z-index: 2;
`;
export const PickBetLabelRunnersWrapper = styled.div<{
detailExpanded: boolean;
}>`
display: flex;
flex-grow: 1;
${({ detailExpanded }) =>
detailExpanded &&
css`
flex-direction: column;
align-items: flex-start;
`}
`;
export const PickBetHrContainer = styled.div<{
isDesktop?: boolean;
isTopHr?: boolean;
}>`
position: absolute;
left: 0;
right: 0;
padding: ${({ isDesktop }) => (isDesktop ? "0 2px 0 26px" : "0 2px 0 28px")};
z-index: 3;
${({ isTopHr, isDesktop }) => {
if (isTopHr) {
if (isDesktop) {
return css`
top: -9px;
`;
}
return css`
top: -6px;
`;
}
if (isDesktop) {
return css`
bottom: 6px;
`;
}
return css`
bottom: 3px;
`;
}}
`;
export const ExoticBetContainer = styled.div<{ isDesktop: boolean }>`
display: flex;
&:not(:last-child) {
margin-bottom: ${({ isDesktop }) => (isDesktop ? "2px" : "10px")};
}
`;
export const LabelItem = styled.div<{
isDesktop?: boolean;
pickBetsDetailExpanded?: boolean;
isPickBets?: boolean;
pickBetsLabelLength?: number;
}>`
height: 20px;
margin-left: ${({ isDesktop }) => (isDesktop ? "0" : "2px")};
display: inline-flex;
align-items: center;
flex-shrink: 0;
position: relative;
z-index: 2;
${({ pickBetsDetailExpanded }) =>
pickBetsDetailExpanded &&
css`
margin-bottom: 6px;
`}
${({ isPickBets, pickBetsLabelLength, isDesktop }) =>
isPickBets
? css`
margin-right: 8px;
justify-content: flex-start;
${pickBetsLabelLength === 11 &&
css`
min-width: 64px;
`}
${pickBetsLabelLength === 12 &&
css`
min-width: 71px;
`}
`
: css`
margin-right: ${isDesktop ? "6px" : "14px"};
justify-content: ${isDesktop ? "flex-start" : "flex-end"};
min-width: ${isDesktop ? "20px" : "24px"};
`}
`;
export const TextLabel = styled.div<{
isPickBets?: boolean;
isDesktop?: boolean;
raceStatus?: string;
}>`
font-family: ${({ isPickBets }) =>
isPickBets ? fontCondensedNormal : fontNormal};
font-size: ${({ isDesktop }) => (isDesktop ? "12px" : "14px")};
line-height: 18px;
color: ${({ raceStatus }) =>
raceStatus
? getIconStyle(raceStatus, "textColor")
: buildColor("grey", "800")};
`;
export const HorizontalRule = styled.hr.attrs({
"data-qa-label": "myBets-horizontalRule"
})<{
isPickBets?: boolean;
isDesktop?: boolean;
}>`
height: 1px;
background-color: ${buildColor("blue", "100")};
width: calc(100% - 4px);
border: none;
position: relative;
left: 2px;
z-index: 2;
margin: ${({ isPickBets, isDesktop }) => {
if (isPickBets) {
return "0";
}
if (isDesktop) {
return "6px 0 6px";
}
return "10px 0 0";
}};
animation: ${fadeIn} 0.2s cubic-bezier(0.39, 0.575, 0.565, 1) both;
`;
export const LabelIconWrapper = styled.div<{
raceStatus: string;
isDesktop: boolean;
}>`
position: relative;
width: 16px;
height: 16px;
${({ raceStatus, isDesktop }) => {
if (
(["open", "raceOff"].includes(raceStatus) && !isDesktop) ||
(["unknown"].includes(raceStatus) && isDesktop)
) {
return css`
border: 2px solid ${getIconStyle(raceStatus, "border")};
background: ${getIconStyle(raceStatus, "background")};
border-radius: 50%;
`;
}
return "";
}}
`;
export const LabelDot = styled.div<{ raceStatus: string }>`
position: absolute;
content: "";
width: 4px;
height: 4px;
top: calc(50% - 2px);
left: calc(50% - 2px);
background: ${({ raceStatus }) => getIconStyle(raceStatus, "dotColor")};
border-radius: 50%;
`;
export const LabelIcon = styled(Icon)`
${({ raceStatus }) =>
["open", "raceOff"].includes(raceStatus) &&
css`
position: absolute;
top: calc(50% - 5px);
left: calc(50% - 5px);
border-radius: 50%;
`}
`;
export const LabelText = styled.span<{ boldText: boolean }>`
font-family: ${({ boldText }) => (boldText ? fontBold : fontNormal)};
font-size: 12px;
align-self: flex-end;
color: ${({ boldText }) =>
boldText ? buildColor("grey", "900") : buildColor("grey", "800")};
`;
export const FavArrowIcon = styled(Icon)`
margin: 0 4px;
z-index: 4;
`;
export const PickBetsExpandButton = styled.button`
display: flex;
align-items: center;
justify-content: center;
height: 20px;
width: 24px;
outline: none;
background-color: transparent;
border-radius: 50%;
position: relative;
z-index: 4;
left: 2px;
&::before {
content: "";
position: absolute;
top: -4px;
left: -4px;
height: 32px;
width: 32px;
background-color: transparent;
border-radius: 50%;
z-index: -1;
}
&:active {
&::before {
background-color: ${buildColor("grey", "200")};
}
svg {
stroke: ${buildColor("grey", "900")};
}
}
`;
export const LegScratchNotificationContainer = styled.div<{
isDesktop: boolean;
}>`
display: flex;
flex-direction: column;
align-items: flex-start;
margin-top: ${({ isDesktop }) => (isDesktop ? "2px" : "-6px")};
margin-bottom: ${({ isDesktop }) => (isDesktop ? "0" : "8px")};
${({ isDesktop }) =>
isDesktop &&
css`
margin-left: 2px;
`}
`;
export const LegScratchNotification = styled.span`
font-family: ${fontMedium};
font-size: 12px;
line-height: 17px;
color: ${buildColor("orange", "700")};
`;
export const RunnerInfoContainer = styled.span<{
isBetsDetailedView?: boolean;
cols: number;
isDesktop?: boolean;
betStatusName: string;
}>`
display: flex;
align-items: center;
${({ isBetsDetailedView, cols }) =>
isBetsDetailedView &&
cols &&
css`
width: ${cols > 2 ? "105px" : "210px"};
`}
${({ isBetsDetailedView, cols, isDesktop }) =>
isBetsDetailedView &&
cols &&
isDesktop &&
css`
width: 105px;
`}
${({ isBetsDetailedView, betStatusName, isDesktop }) =>
!isBetsDetailedView &&
isDesktop &&
["winner", "canceled", "loser", "refunded"].includes(betStatusName) &&
MutedStyles()}
`;
export const PayoutHeader = styled.div<{ cols: number; isDesktop: boolean }>`
display: flex;
flex: 1;
justify-content: flex-end;
::before {
content: "";
${({ cols }) =>
cols &&
css`
width: ${cols > 2 ? "105px" : "193px"};
`};
${({ isDesktop }) =>
isDesktop &&
css`
width: 105px;
`};
}
`;
export const PayoutHeaderItem = styled.span<{ hasTwoColumns: boolean }>`
text-align: right;
text-transform: uppercase;
font-family: ${fontCondensedNormal};
font-size: 12px;
font-weight: 400;
color: ${buildColor("grey", "900")};
flex: 1;
${({ hasTwoColumns }) =>
hasTwoColumns &&
css`
&:not(:last-child) {
flex-grow: 2;
}
`}
`;
export const PayoutSeparator = styled.hr`
width: calc(100% + 20px);
margin-left: -10px;
border: 0;
border-bottom: 1px solid ${buildColor("blue", "100")};
`;
export const ListItemWrapper = styled.ul<{ isBetsDetailedView?: boolean }>`
display: flex;
flex-direction: ${({ isBetsDetailedView }) =>
isBetsDetailedView ? "column" : "row"};
flex: 1;
`;
export const SelectionList = styled.div<{
isBetsDetailedView?: boolean;
isDesktop?: boolean;
}>`
display: flex;
margin: 0 2px 2px;
${({ isBetsDetailedView, isDesktop }) =>
isBetsDetailedView &&
css`
&:not(:only-child, :last-child) {
margin-bottom: ${isDesktop ? "4px" : "12px"};
}
`}
`;
export const DetailAction = styled.div`
position: absolute;
width: 100%;
height: 20px;
z-index: 3;
`;
export const AlternateSeparatorContainer = styled.div`
display: inline-flex;
align-items: center;
height: 20px;
padding: 0 3px;
margin-bottom: 2px;
`;
export const AlternateSeparator = styled.div`
height: 12px;
width: 1px;
background-color: #6a6f73;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/components/AlternateRunners.tsx
import React from "react";
import { BetRunnerDetails } from "@tvg/ts-types/Bet";
// @ts-ignore
import RunnerNumber from "../../../_atom/RunnerNumber";
import {
AlternateSeparator,
AlternateSeparatorContainer,
ListItem,
ListItemWrapper,
RunnerInfoContainer,
RunnerName,
RunnerNameContainer,
SelectionList
} from "../styled-components";
interface AlternateRunnersProps {
alternateRunners: BetRunnerDetails[];
isBetsDetailedView: boolean;
isDesktop: boolean;
titles: string[];
betStatusName: string;
raceTypeCode: string;
isActiveMultiRaceLegOver: boolean;
isRaceOver: boolean;
isUnknownWinnerStatus: boolean;
}
const AlternateRunners = ({
alternateRunners,
isBetsDetailedView,
isDesktop,
titles,
betStatusName,
raceTypeCode,
isActiveMultiRaceLegOver,
isRaceOver,
isUnknownWinnerStatus
}: AlternateRunnersProps) => (
<>
{!isBetsDetailedView && (
<AlternateSeparatorContainer>
<AlternateSeparator />
</AlternateSeparatorContainer>
)}
{alternateRunners?.map((runner: BetRunnerDetails, index: number) => (
<SelectionList
key={`selection-list--${index.toString()}`}
isBetsDetailedView={isBetsDetailedView}
isDesktop={isDesktop}
>
<ListItemWrapper isBetsDetailedView={isBetsDetailedView}>
<ListItem
data-qa-label="alternate-runnerNumber-ListItem"
isBetsDetailedView={isBetsDetailedView}
>
<RunnerInfoContainer
data-qa-label="alternate-saddle-row"
isBetsDetailedView={isBetsDetailedView}
cols={titles.length}
betStatusName={betStatusName}
isDesktop={isDesktop}
>
<RunnerNumber
qaLabel={`saddle-container-${runner.runnerId}`}
runnerId={runner.runnerId}
saddleColor={runner.saddleColor}
numberColor={runner.numberColor}
raceTypeCode={raceTypeCode}
isBetsStandalone
isScratched={runner.isScratched}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && !isBetsDetailedView
}
isRaceOver={isRaceOver}
isBetsDetailedView={isBetsDetailedView}
isUnknownWinnerStatus={isUnknownWinnerStatus}
isAlternate
/>
{isBetsDetailedView && (
<RunnerNameContainer
data-qa-label="runnerName"
isUnknownWinnerStatus={isUnknownWinnerStatus}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && isBetsDetailedView
}
>
<RunnerName
className="runner-name"
isScratched={runner?.isScratched ?? false}
>
{runner?.runnerName ?? ""}
</RunnerName>
</RunnerNameContainer>
)}
</RunnerInfoContainer>
</ListItem>
</ListItemWrapper>
</SelectionList>
))}
</>
);
export default AlternateRunners;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/components/PayoutsHeader.tsx
import React from "react";
import {
PayoutHeader,
PayoutHeaderItem,
PayoutSeparator
} from "../styled-components";
export interface PayoutsHeaderProps {
titles: string[];
isCanceled: boolean;
isDesktop: boolean;
}
const PayoutsHeaderComp = ({
titles,
isCanceled,
isDesktop
}: PayoutsHeaderProps) => {
if (titles.length > 1 && !isCanceled) {
return (
<>
<PayoutHeader cols={titles.length} isDesktop={isDesktop}>
{titles.map((title, index) => (
<PayoutHeaderItem
key={index.toString()}
hasTwoColumns={titles.length === 2}
>
{title}
</PayoutHeaderItem>
))}
</PayoutHeader>
<PayoutSeparator />
</>
);
}
return null;
};
export default PayoutsHeaderComp;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/IconDescription/styled-components.js
import styled from "styled-components";
import colorBuilder from "../../_static/ColorPalette";
import { fontNormal, defaultSize } from "../../_static/Typography";
export const IconContainer = styled.div`
display: inline-grid;
grid-template-columns: 1fr auto;
grid-column-gap: ${(props) => props.iconMargin};
color: ${colorBuilder("grey", "800")};
font-size: ${(props) =>
props.fontSize ? `${props.fontSize}px` : defaultSize};
font-weight: normal;
font-family: ${fontNormal};
letter-spacing: 0;
`;
export const DescriptionText = styled.span`
color: ${(props) => props.color};
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/IconDescription/index.jsx
import React from "react";
import Icon from "../../_static/Icons";
import buildColor from "../../_static/ColorPalette";
import * as allIcons from "../../_static/Icons/icons";
import * as duotoneIcons from "../../_static/Icons/iconsDuotone";
import { IconContainer, DescriptionText } from "./styled-components";
const IconDescription = ({
icon,
description,
size,
color,
stroke,
variation,
strokeVariation,
isDuotone,
viewBoxSize,
textColor,
textColorVariation,
iconMargin,
id,
fontSize
}) => (
<IconContainer iconMargin={`${iconMargin || "10"}px`} fontSize={fontSize}>
<Icon
qaLabel={`icon_${id}`}
icon={isDuotone ? duotoneIcons[icon] : allIcons[icon]}
color={buildColor(color || "grey", variation || "800")}
stroke={
stroke && strokeVariation ? buildColor(stroke, strokeVariation) : null
}
size={size}
viewBoxSize={viewBoxSize}
/>
<DescriptionText
color={buildColor(textColor || "grey", textColorVariation || "800")}
data-qa-label={`description_${id}`}
>
{description}
</DescriptionText>
</IconContainer>
);
IconDescription.defaultProps = {
icon: "lock",
description: "",
size: 16,
color: "grey",
stroke: "grey",
variation: "800",
strokeVariation: "800",
isDuotone: false,
textColor: "grey",
textColorVariation: "800",
iconMargin: 10,
viewBoxSize: 1024,
fontSize: 14
};
export default IconDescription;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/components/LabelIcon.tsx
import React from "react";
import { get } from "lodash";
import { iconStyles } from "../constant";
import { LabelIcon, LabelText, LabelDot } from "../styled-components";
export interface LabelIconProps {
raceStatus: string;
label: string;
qaLabel?: string;
isDesktop: boolean;
}
const LabelIconComp = ({
raceStatus,
label,
qaLabel = "myBets-label-icon",
isDesktop
}: LabelIconProps) => {
const iconProps = {
icon: get(iconStyles, `${raceStatus}.icon`),
viewBoxSize: 16,
size: 16,
color: get(iconStyles, `${raceStatus}.background`),
stroke: get(iconStyles, `${raceStatus}.iconColor`)
};
if (isDesktop && (raceStatus === "open" || raceStatus === "raceOff")) {
return <LabelText boldText={raceStatus === "raceOff"}>{label}</LabelText>;
}
return iconProps.icon ? (
<LabelIcon {...iconProps} data-qa-label={qaLabel} />
) : (
<LabelDot raceStatus={raceStatus} data-qa-label={qaLabel} />
);
};
export default LabelIconComp;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/components/ScratchNotifications.tsx
import React from "react";
import {
isMultiRaceBet,
isPickBetSub
} from "@tvg/sh-lib-my-bets/utils/raceDetails";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import {
LegScratchNotificationContainer,
LegScratchNotification
} from "../styled-components";
export interface ScratchNotificationsProps {
wagerTypeCode: WagerTypeCodesEnum;
isDesktop: boolean;
hasAlternateReplacement: boolean;
}
const ScratchNotifications = ({
wagerTypeCode,
isDesktop,
hasAlternateReplacement
}: ScratchNotificationsProps) => {
const showFavoriteMsg = wagerTypeCode && isPickBetSub(wagerTypeCode);
const showScratchMsgDetails = wagerTypeCode && isMultiRaceBet(wagerTypeCode);
if (!showScratchMsgDetails) {
return null;
}
return (
<LegScratchNotificationContainer isDesktop={isDesktop}>
{hasAlternateReplacement && (
<LegScratchNotification data-qa-label="LegScratchNotification">
Scratch will be replaced with the alternate selection.
</LegScratchNotification>
)}
{showFavoriteMsg && !hasAlternateReplacement && (
<LegScratchNotification data-qa-label="LegScratchNotification">
Scratch will be replaced with the FAV.
</LegScratchNotification>
)}
<LegScratchNotification data-qa-label="LegScratchNotification">
Awaiting official result to confirm the bet status.
</LegScratchNotification>
</LegScratchNotificationContainer>
);
};
export default ScratchNotifications;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/components/PickBetLayout.tsx
import React from "react";
import { BetSelection } from "@tvg/ts-types/Bet";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import {
DetailAction,
HorizontalRule,
LabelIconWrapper,
LabelItem,
PickBetContainer,
PickBetHrContainer,
PickBetLabelIconContainer,
PickBetLabelRunnersWrapper,
PickBetsExpandButton,
PickBetsWrapper,
RunnerNumberContainer,
TextLabel,
WillPaysInfoContainer,
WillPaysInfoDesktopText,
WillPaysLabel
} from "../styled-components";
// @ts-ignore
import IconDescription from "../../IconDescription";
// @ts-ignore
import Icon from "../../../_static/Icons";
// @ts-ignore
import { chevronDown, chevronUp } from "../../../_static/Icons/iconsDuotone";
// @ts-ignore
import buildColor from "../../../_static/ColorPalette";
import LabelIcon from "./LabelIcon";
import ScratchNotifications from "./ScratchNotifications";
export interface PickBetLayoutProps {
raceStatus: string;
isDesktop: boolean;
isBetsDetailedView: boolean;
showUpperHorizontalRule: boolean;
isCanceled: boolean;
showHorizontalRule: boolean;
isFirstRowOfRunners: boolean;
runners: BetSelection[];
hasDetails: boolean;
onDetailedView?: () => void;
label: string;
pickBetsLabelLength: number;
isLastRowOfRunners: boolean;
runnersHaveWillPayAmount: boolean;
isPickBet: boolean;
wagerTypeCode: WagerTypeCodesEnum;
isRaceOver: boolean;
hasAlternates: boolean;
hasAlternateReplacement: boolean;
runnerNumberGroup: React.ReactNode;
}
const PickBetLayout = ({
raceStatus,
isBetsDetailedView,
showHorizontalRule,
isCanceled,
isDesktop,
showUpperHorizontalRule,
isFirstRowOfRunners,
runners,
onDetailedView,
hasDetails,
label,
pickBetsLabelLength,
isLastRowOfRunners,
runnersHaveWillPayAmount,
wagerTypeCode,
isPickBet,
isRaceOver,
hasAlternates,
runnerNumberGroup,
hasAlternateReplacement
}: PickBetLayoutProps) => (
<PickBetContainer
data-qa-label="myBets-pickBets-container"
raceStatus={raceStatus}
isCanceled={isCanceled}
isBetsDetailedView={isBetsDetailedView}
isDesktop={isDesktop}
showHorizontalRule={showHorizontalRule}
showUpperHorizontalRule={isDesktop && showUpperHorizontalRule}
>
{!isCanceled &&
!isFirstRowOfRunners &&
isBetsDetailedView &&
(runners.length > 1 || hasAlternates) && (
<PickBetHrContainer
data-qa-label="myBets-hr-container"
isTopHr
isDesktop={isDesktop}
>
<HorizontalRule data-qa-label="myBets-horizontal-line" isPickBets />
</PickBetHrContainer>
)}
<PickBetsWrapper data-qa-label="myBets-pickBets-wrapper">
{hasDetails && <DetailAction onClick={onDetailedView} />}
{!isCanceled && (
<PickBetLabelIconContainer
isDesktop={isDesktop}
raceStatus={raceStatus}
>
<LabelIconWrapper
isDesktop={isDesktop}
raceStatus={raceStatus}
data-qa-label="myBets-icon-wrapper"
>
<LabelIcon
raceStatus={raceStatus}
label={label}
isDesktop={isDesktop}
/>
</LabelIconWrapper>
</PickBetLabelIconContainer>
)}
<PickBetLabelRunnersWrapper
data-qa-label="myBets-label-runners-wrapper"
detailExpanded={isBetsDetailedView}
>
{!isDesktop && (
<LabelItem
isPickBets
pickBetsLabelLength={pickBetsLabelLength}
pickBetsDetailExpanded={isBetsDetailedView}
data-qa-label="myBets-label-wrapper"
>
<TextLabel
data-qa-label="myBets-pickBets-label"
raceStatus={raceStatus}
isPickBets
>
{label}
</TextLabel>
</LabelItem>
)}
{isBetsDetailedView &&
isLastRowOfRunners &&
runnersHaveWillPayAmount && (
<WillPaysInfoContainer isDesktop={isDesktop}>
{isDesktop ? (
<WillPaysInfoDesktopText>
Will Pays subject to change due to scratches
</WillPaysInfoDesktopText>
) : (
<IconDescription
id="willpays-info"
icon="info"
isDuotone
size={16}
viewBoxSize={16}
color="blue_accent"
variation="200"
stroke="blue_accent"
strokeVariation="700"
textColor="blue_accent"
textColorVariation="700"
iconMargin={12}
description="Will Pays subject to change due to scratches"
fontSize={12}
/>
)}
</WillPaysInfoContainer>
)}
{isBetsDetailedView &&
isPickBet &&
wagerTypeCode &&
raceStatus === "attention" &&
!isRaceOver &&
!runnersHaveWillPayAmount &&
!isDesktop && (
<ScratchNotifications
wagerTypeCode={wagerTypeCode}
isDesktop={isDesktop}
hasAlternateReplacement={hasAlternateReplacement}
/>
)}
<RunnerNumberContainer data-qa-label="myBets-runner-number-container">
{runnerNumberGroup}
</RunnerNumberContainer>
{isBetsDetailedView &&
isPickBet &&
wagerTypeCode &&
raceStatus === "attention" &&
!isRaceOver &&
!runnersHaveWillPayAmount &&
isDesktop && (
<ScratchNotifications
wagerTypeCode={wagerTypeCode}
isDesktop={isDesktop}
hasAlternateReplacement={hasAlternateReplacement}
/>
)}
</PickBetLabelRunnersWrapper>
{hasDetails &&
isBetsDetailedView &&
isLastRowOfRunners &&
runnersHaveWillPayAmount &&
!isDesktop && <WillPaysLabel>WILL PAYS</WillPaysLabel>}
{hasDetails && !isDesktop && (
<PickBetsExpandButton onClick={onDetailedView}>
<Icon
icon={isBetsDetailedView ? chevronUp : chevronDown}
viewBoxSize={16}
size={16}
color="transparent"
stroke={buildColor("grey", "800")}
/>
</PickBetsExpandButton>
)}
</PickBetsWrapper>
{showHorizontalRule &&
isBetsDetailedView &&
(runners.length > 1 || hasAlternates) &&
!isCanceled && (
<PickBetHrContainer
data-qa-label="myBets-hr-container"
isDesktop={isDesktop}
>
<HorizontalRule data-qa-label="myBets-horizontal-line" isPickBets />
</PickBetHrContainer>
)}
</PickBetContainer>
);
export default PickBetLayout;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/components/ExoticBetsLayout.tsx
import React from "react";
// @ts-ignore
import Icon from "../../../_static/Icons";
// @ts-ignore
import { key } from "../../../_static/Icons/iconsDuotone";
// @ts-ignore
import buildColor from "../../../_static/ColorPalette";
import {
ExoticBetContainer,
HorizontalRule,
LabelItem,
RunnerNumberContainer,
TextLabel
} from "../styled-components";
export interface ExoticBetsLayoutProps {
isBetsDetailedView: boolean;
isDesktop: boolean;
label: string;
isKey: boolean;
showHorizontalRule: boolean;
runnerNumberGroup: React.ReactNode;
}
const ExoticBetsLayout = ({
isDesktop,
isKey,
label,
runnerNumberGroup,
isBetsDetailedView,
showHorizontalRule
}: ExoticBetsLayoutProps) => (
<ExoticBetContainer
data-qa-label="myBets-exoticBet-container"
isDesktop={isDesktop}
>
{(isKey || label) && (
<LabelItem isDesktop={isDesktop}>
{!isKey ? (
<TextLabel
data-qa-label="myBets-exoticBet-label"
isDesktop={isDesktop}
>
{label}
</TextLabel>
) : (
<Icon
qaLabel="myBets-exoticBet-icon"
icon={key}
viewBoxSize={16}
size={16}
color={buildColor("white", "10")}
stroke={buildColor("grey", "800")}
/>
)}
</LabelItem>
)}
<RunnerNumberContainer>
{runnerNumberGroup}
{showHorizontalRule && isBetsDetailedView && (
<HorizontalRule isDesktop={isDesktop} />
)}
</RunnerNumberContainer>
</ExoticBetContainer>
);
export default ExoticBetsLayout;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/components/ListItemDetails.tsx
import React from "react";
import { get } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import { BetSelection } from "@tvg/ts-types/Bet";
import { FavoriteTag as YellowTag } from "@tvg/ipp/src/components/SimpleInlineInfo/styled-components";
import {
DetailedViewInfoContainer,
RaceOdds,
Tag,
WillPays
} from "../styled-components";
export interface ListItemDetailsProps {
showDetails: boolean;
isWinnerBI: boolean;
isUnknownWinnerStatus: boolean;
runner: BetSelection;
isCanceled: boolean;
isBetRefund: boolean;
isLastRowOfRunners: boolean;
showTag: boolean;
isRaceOver: boolean;
}
const ListItemDetails = ({
showDetails,
isWinnerBI,
isUnknownWinnerStatus,
runner,
isBetRefund,
isCanceled,
isLastRowOfRunners,
showTag,
isRaceOver
}: ListItemDetailsProps) => (
<DetailedViewInfoContainer>
{showDetails && (
<>
{isWinnerBI && isRaceOver && (
<RaceOdds>
{runner.alternate?.currentOdds ? (
// Show alternate odds if alternate is winner and has odds
<>
{get(runner.alternate, "currentOdds.numerator")}
{get(runner.alternate, "currentOdds.denominator")
? `/${get(runner.alternate, "currentOdds.denominator")}`
: ""}
</>
) : (
// Show runner odds if runner is winner and has odds
get(runner, "currentOdds") && (
<>
{get(runner, "currentOdds.numerator")}
{get(runner, "currentOdds.denominator")
? `/${get(runner, "currentOdds.denominator")}`
: ""}
</>
)
)}
</RaceOdds>
)}
{get(runner, "isFavorite", false) && isRaceOver && (
<Tag>
<YellowTag as="span">FAV</YellowTag>
</Tag>
)}
{!isCanceled &&
!isBetRefund &&
!isUnknownWinnerStatus &&
get(runner, "willPayAmount", 0) > 0 &&
isLastRowOfRunners && (
<WillPays>
{formatCurrency(get(runner, "willPayAmount", 0), "USD")}
</WillPays>
)}
</>
)}
{showTag && (
<Tag>
<YellowTag as="span">REFUND</YellowTag>
</Tag>
)}
</DetailedViewInfoContainer>
);
export default ListItemDetails;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/components/WillPaysDetails.tsx
import React from "react";
import { get } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import { BetSelection } from "@tvg/ts-types/Bet";
import { getWillPaysSimpleRace } from "@tvg/sh-lib-my-bets/utils/runnerNumberGroupUtils";
import { WillPays } from "../styled-components";
export interface WillPaysDetailsProps {
runner: BetSelection;
payoutsTitles?: string[];
runnerNumber: string;
payoutsTitlesLength: number;
}
const WillPaysDetails = ({
payoutsTitles,
runner,
runnerNumber,
payoutsTitlesLength
}: WillPaysDetailsProps) => (
<>
{getWillPaysSimpleRace(runner, payoutsTitles).map((amount) => (
<WillPays
key={`${runnerNumber}-${get(runner, "willPayAmount", "")}-willPays`}
hasMargin={payoutsTitlesLength < 3}
>
{typeof amount === "number" &&
amount > 0 &&
formatCurrency(amount, "USD")}
</WillPays>
))}
</>
);
export default WillPaysDetails;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MybetsRunnerNumberGroup/index.tsx
import React from "react";
import { includes, get, isEmpty } from "lodash";
import { isPickBetSub } from "@tvg/sh-lib-my-bets/utils/raceDetails";
import {
checkFavoriteSequence,
getPayoutsHeaderTitle
} from "@tvg/sh-lib-my-bets/utils/runnerNumberGroupUtils";
import { BetSelection } from "@tvg/ts-types/Bet";
// @ts-ignore
import RunnerNumber from "../../_atom/RunnerNumber";
import {
arrowForward
// @ts-ignore
} from "../../_static/Icons/iconsDuotone";
// @ts-ignore
import buildColor from "../../_static/ColorPalette";
// @ts-ignore
import Icon from "../../_static/Icons";
import {
RunnerNumberGroupMolecule,
ListItem,
RunnerNameContainer,
RunnerName,
FavArrowIcon,
RunnerInfoContainer,
ListItemWrapper,
SelectionList
} from "./styled-components";
import AlternateRunners from "./components/AlternateRunners";
import PayoutsHeader from "./components/PayoutsHeader";
import PickBetLayout from "./components/PickBetLayout";
import ExoticBetsLayout from "./components/ExoticBetsLayout";
import ListItemDetails from "./components/ListItemDetails";
import {
ListItemProps,
MyBetsRunnerNumberGroupProps,
ShortedSelectionsListProps
} from "./types";
import WillPaysDetails from "./components/WillPaysDetails";
const doubleEntryRegex = /^[0-9]+[a-zA-Z]+$/; // Double Entry validation regex
const getListItem = ({
idx,
runner,
isMultiRace = false,
isCanceled = false,
isFavorite = false,
isArrow = false,
raceTypeCode,
isUnknownWinnerStatus = false,
betStatusName = "",
isBetsDetailedView = false,
allRunnersSelected = false,
isLastRowOfRunners = false,
isWinnerBI = false,
wagerTypeCode,
isRaceOver = false,
isActiveMultiRaceLegOver = false,
payoutsTitles = [],
favoriteRunner,
isCurrentRaceDate = false,
isBetRefund = false,
isDesktop
}: ListItemProps) => {
const allowsPickBetSub = wagerTypeCode && isPickBetSub(wagerTypeCode);
const runners = get(runner, "runners", []) || [];
const showReplacement = runners.every(
(currentRunner) => currentRunner.isScratched
);
const payoutsTitlesLength = payoutsTitles.length;
const allRunnerIsScratched = get(runner, "runners", []).every(
(currRunner) => currRunner.isScratched
);
const showTag =
isBetRefund && allRunnerIsScratched && (isRaceOver || !isWinnerBI);
const showDetails =
isMultiRace &&
!showTag &&
(!allRunnerIsScratched || !runner?.alternate?.runners[0]?.isScratched) &&
!isCanceled;
const showWillPays = isDesktop
? !isCanceled && isBetsDetailedView && !isMultiRace
: isBetsDetailedView && !isMultiRace;
const runnerNumber = get(runner, "runnerNumber", "");
const hasAvailableAlternateRunners = runner?.alternate?.runners.some(
(altRunner) => !altRunner.isScratched
);
if (!isBetsDetailedView && allRunnersSelected) {
return (
<SelectionList
key={`Runner${!isArrow ? runnerNumber : `_arrow_${idx}`}`}
isBetsDetailedView={isBetsDetailedView}
isDesktop={isDesktop}
>
<ListItemWrapper isBetsDetailedView={isBetsDetailedView}>
<ListItem
data-qa-label="runnerNumber-ListItem"
isBetsDetailedView={false}
>
<RunnerInfoContainer
isBetsDetailedView={isBetsDetailedView}
cols={payoutsTitlesLength}
betStatusName={betStatusName}
isDesktop={isDesktop}
>
<RunnerNumber
runnerId="All"
raceTypeCode={raceTypeCode}
isFavorite={false}
isBetsStandalone
isAllRunners
isWinnerBI={isWinnerBI}
isUnknownWinnerStatus={isUnknownWinnerStatus}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && !isBetsDetailedView
}
/>
</RunnerInfoContainer>
</ListItem>
</ListItemWrapper>
</SelectionList>
);
}
// Display alternate runners as replacements if at least one alternate in a coupled entry is not scratched.
// If all alternates are scratched, skip them and proceed with rendering the favorite runner instead, inside the logic below.
if (showReplacement && hasAvailableAlternateRunners && isRaceOver) {
return (
<SelectionList key={`alternate-runner-section-list-${idx.toString()}`}>
<ListItemWrapper isBetsDetailedView={isBetsDetailedView}>
{runner?.alternate?.runners
.sort((a, b) => Number(a.isScratched) - Number(b.isScratched))
.map((altRunner, alternateIndex) => (
<ListItem
key={`alternate-runner-${alternateIndex.toString()}`}
data-qa-label="runnerNumber-ListItem"
isBetsDetailedView={isBetsDetailedView}
>
<RunnerInfoContainer
isBetsDetailedView={isBetsDetailedView}
cols={payoutsTitlesLength}
betStatusName={betStatusName}
isDesktop={isDesktop}
>
{alternateIndex === 0 &&
runners.map((mainScratchedRunner, mainScrIndex) => (
<RunnerNumber
key={`main-scratched-runner-${mainScrIndex.toString()}`}
qaLabel={`saddle-container-${mainScratchedRunner.runnerId}`}
runnerId={mainScratchedRunner.runnerId}
saddleColor={mainScratchedRunner.saddleColor}
numberColor={mainScratchedRunner.numberColor}
raceTypeCode={raceTypeCode}
isFavorite={isFavorite}
isBetsStandalone
isScratched={mainScratchedRunner.isScratched}
isWinnerBI={isWinnerBI && !isCanceled}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && !isBetsDetailedView
}
isRaceOver={isRaceOver}
isBetsDetailedView={isBetsDetailedView}
isUnknownWinnerStatus={isUnknownWinnerStatus}
/>
))}
<>
{alternateIndex === 0 && (
<FavArrowIcon
icon={arrowForward}
viewBoxSize={16}
size={16}
color={buildColor("orange", "600")}
/>
)}
<RunnerNumber
qaLabel={`saddle-container-${altRunner?.runnerId}`}
runnerId={altRunner?.runnerId}
saddleColor={altRunner.saddleColor}
numberColor={altRunner.numberColor}
raceTypeCode={raceTypeCode}
isFavorite={false}
isBetsStandalone
isScratched={altRunner.isScratched}
isWinnerBI={runner?.alternate?.isWinner ?? false}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && !isBetsDetailedView
}
isRaceOver={isRaceOver}
isBetsDetailedView={isBetsDetailedView}
/>
{isBetsDetailedView && (
<RunnerNameContainer
data-qa-label={`runnerName-${altRunner?.runnerId}`}
isWinnerBI={
(runner?.alternate?.isWinner ?? false) && !isCanceled
}
isUnknownWinnerStatus={isUnknownWinnerStatus}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && isBetsDetailedView
}
>
<RunnerName
className="runner-name"
isScratched={altRunner?.isScratched ?? false}
>
{altRunner?.runnerName ?? ""}
</RunnerName>
</RunnerNameContainer>
)}
</>
</RunnerInfoContainer>
</ListItem>
))}
</ListItemWrapper>
{showWillPays && (
<WillPaysDetails
runner={runner}
payoutsTitlesLength={payoutsTitlesLength}
runnerNumber={runnerNumber}
payoutsTitles={payoutsTitles}
/>
)}
{isBetsDetailedView && (
<ListItemDetails
isLastRowOfRunners={isLastRowOfRunners}
isRaceOver={isRaceOver}
isCanceled={isCanceled}
runner={runner}
isUnknownWinnerStatus={isUnknownWinnerStatus}
isWinnerBI={isWinnerBI || !!runner?.alternate?.isWinner}
showDetails={showDetails}
showTag={showTag}
isBetRefund={isBetRefund}
/>
)}
</SelectionList>
);
}
return (
<SelectionList
key={`Runner${!isArrow ? runnerNumber : `_arrow_${idx}`}`}
isBetsDetailedView={isBetsDetailedView}
isDesktop={isDesktop}
>
<ListItemWrapper isBetsDetailedView={isBetsDetailedView}>
{runners.map((currentRunner, index) => {
let toRender = null;
if (isArrow && index === runners.length - 1) {
toRender = (
<Icon
viewBoxSize={16}
size={20}
icon={arrowForward}
color={buildColor("black", "100")}
/>
);
}
if (!isArrow) {
// Check if no favorite is available and all runners are scratched
const allRunnersScratched = runners.every((r) => r.isScratched);
const noFavoriteAvailable =
!favoriteRunner || isEmpty(favoriteRunner);
if (allRunnersScratched && noFavoriteAvailable) {
toRender = (
<RunnerInfoContainer
data-qa-label="main-saddle-row"
isBetsDetailedView={isBetsDetailedView}
cols={payoutsTitlesLength}
betStatusName={betStatusName}
isDesktop={isDesktop}
>
<RunnerNumber
qaLabel={`saddle-container-${currentRunner.runnerId}`}
runnerId={currentRunner.runnerId}
saddleColor={currentRunner.saddleColor}
numberColor={currentRunner.numberColor}
raceTypeCode={raceTypeCode}
isFavorite={isFavorite}
isBetsStandalone
isScratched={currentRunner.isScratched}
isWinnerBI={isWinnerBI && !isCanceled}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && !isBetsDetailedView
}
isRaceOver={isRaceOver}
isBetsDetailedView={isBetsDetailedView}
isUnknownWinnerStatus={isUnknownWinnerStatus}
/>
{isRaceOver && !isCanceled && (
<>
<FavArrowIcon
icon={arrowForward}
viewBoxSize={16}
size={16}
color={buildColor("orange", "600")}
/>
<RunnerNumber
runnerId=""
raceTypeCode={raceTypeCode}
isFavorite={false}
isBetsStandalone
isScratched={false}
isWinnerBI={false}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && !isBetsDetailedView
}
isRaceOver={isRaceOver}
isBetsDetailedView={isBetsDetailedView}
isUnknownWinnerStatus={isUnknownWinnerStatus}
/>
</>
)}
</RunnerInfoContainer>
);
} else {
toRender = (
<>
<RunnerInfoContainer
isBetsDetailedView={isBetsDetailedView}
cols={payoutsTitlesLength}
betStatusName={betStatusName}
isDesktop={isDesktop}
>
<RunnerNumber
runnerId={currentRunner.runnerId}
raceTypeCode={raceTypeCode}
isFavorite={isFavorite}
isBetsStandalone
isScratched={currentRunner.isScratched}
isWinnerBI={isWinnerBI && !isCanceled}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && !isBetsDetailedView
}
isRaceOver={isRaceOver}
isBetsDetailedView={isBetsDetailedView}
isUnknownWinnerStatus={isUnknownWinnerStatus}
/>
{allowsPickBetSub &&
isCurrentRaceDate &&
favoriteRunner &&
!isEmpty(favoriteRunner) &&
isRaceOver &&
showReplacement &&
!isCanceled && (
<>
<FavArrowIcon
icon={arrowForward}
viewBoxSize={16}
size={16}
color={buildColor("orange", "600")}
/>
<RunnerNumber
runnerId={favoriteRunner?.runnerNumber}
raceTypeCode={raceTypeCode}
isFavorite={false}
isBetsStandalone
isScratched={false}
isWinnerBI={favoriteRunner?.isWinner}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && !isBetsDetailedView
}
isRaceOver={isRaceOver}
isBetsDetailedView={isBetsDetailedView}
/>
</>
)}
{isBetsDetailedView && (
<RunnerNameContainer
data-qa-label={`runnerName-${currentRunner?.runnerId}`}
isWinnerBI={isWinnerBI && !isCanceled}
isUnknownWinnerStatus={isUnknownWinnerStatus}
isActiveMultiRaceLegOver={
isActiveMultiRaceLegOver && isBetsDetailedView
}
>
{allowsPickBetSub &&
isCurrentRaceDate &&
favoriteRunner &&
!!favoriteRunner?.runnerName &&
isRaceOver &&
showReplacement ? (
<RunnerName className="runner-name">
{favoriteRunner?.runnerName ?? ""}
</RunnerName>
) : (
<RunnerName
className="runner-name"
isScratched={currentRunner?.isScratched ?? false}
>
{currentRunner?.runnerName ?? ""}
</RunnerName>
)}
</RunnerNameContainer>
)}
</RunnerInfoContainer>
</>
);
}
}
if (toRender) {
return (
<ListItem
data-qa-label="runnerNumber-ListItem"
key={`runnerNumberGroup-${get(
runner,
"runnerNumber",
""
)}-${index.toString()}-${isFavorite ? "Fav" : "Nfav"}`}
isBetsDetailedView={isBetsDetailedView}
>
{toRender}
</ListItem>
);
}
return toRender;
})}
</ListItemWrapper>
{showWillPays && (
<WillPaysDetails
runner={runner}
payoutsTitlesLength={payoutsTitlesLength}
runnerNumber={runnerNumber}
payoutsTitles={payoutsTitles}
/>
)}
{isBetsDetailedView && (showDetails || showTag) && (
<ListItemDetails
isLastRowOfRunners={isLastRowOfRunners}
isRaceOver={isRaceOver}
isCanceled={isCanceled}
runner={runner}
isUnknownWinnerStatus={isUnknownWinnerStatus}
isWinnerBI={isWinnerBI}
showDetails={showDetails}
showTag={showTag}
isBetRefund={isBetRefund}
/>
)}
</SelectionList>
);
};
export const getShortedSelectionsList = ({
runners,
favorites,
raceTypeCode,
isMultiRace = false,
isUnknownWinnerStatus = false,
wagerTypeCode,
isRaceOver,
isActiveMultiRaceLegOver,
isCanceled = false,
betStatusName = "",
isDesktop
}: ShortedSelectionsListProps) => {
let isFavorite;
let lastFavoriteAdded = "";
let startWithFavorite;
let i = 0;
const shortedSelections = [];
while (i < runners.length) {
const currentRunner = runners[i];
const isScratched = currentRunner.runners.some(
(r: { isScratched: boolean }) => r.isScratched
);
if (isScratched) {
isFavorite = includes(favorites, currentRunner.runnerNumber);
shortedSelections.push(
getListItem({
idx: i,
runner: currentRunner,
isMultiRace,
isCanceled,
isFavorite,
raceTypeCode,
isUnknownWinnerStatus,
betStatusName,
isWinnerBI: currentRunner?.isWinner ?? false,
wagerTypeCode,
isRaceOver,
isActiveMultiRaceLegOver,
isDesktop
})
);
i += 1;
} else {
let count = 1;
let countDE = 0;
while (
i + count < runners.length &&
(doubleEntryRegex.test(runners[i + count].runnerNumber) ||
parseInt(currentRunner.runnerNumber, 10) + (count - countDE) ===
parseInt(runners[i + count].runnerNumber, 10))
) {
if (
runners[i + count].runners.some(
(r: { isScratched: boolean }) => r.isScratched
) ||
get(runners[i + count], "isWinner", false)
) {
break;
}
if (doubleEntryRegex.test(runners[i + count].runnerNumber)) {
countDE += 1;
}
count += 1;
}
startWithFavorite = 0; // new runners sequence starts with a favorite (0 -> false, 1 -> true)
if (
count === 2 &&
checkFavoriteSequence(
currentRunner,
favorites,
lastFavoriteAdded,
doubleEntryRegex
)
) {
// check if the last runner added to the array was a favorite and if the next one is sequential to the favorite
startWithFavorite = 1;
}
if (count + startWithFavorite > 2) {
isFavorite = includes(favorites, currentRunner.runnerNumber);
// Add first runner
shortedSelections.push(
getListItem({
idx: i,
runner: currentRunner,
isMultiRace,
isCanceled,
isFavorite,
raceTypeCode,
isUnknownWinnerStatus,
betStatusName,
isWinnerBI: currentRunner?.isWinner ?? false,
wagerTypeCode,
isRaceOver,
isActiveMultiRaceLegOver,
isDesktop
})
);
// Add arrow
shortedSelections.push(
getListItem({
idx: i,
runner: currentRunner,
isMultiRace,
isCanceled,
isArrow: true,
raceTypeCode,
isUnknownWinnerStatus,
betStatusName,
isDesktop
})
);
// Add the last runner of arrow
const shortedIndex = i + count - 1;
isFavorite = includes(favorites, runners[shortedIndex].runnerNumber);
shortedSelections.push(
getListItem({
idx: shortedIndex,
runner: runners[shortedIndex],
isMultiRace,
isCanceled,
isFavorite,
raceTypeCode,
isUnknownWinnerStatus,
betStatusName,
isWinnerBI: runners[shortedIndex]?.isWinner ?? false,
wagerTypeCode,
isRaceOver,
isActiveMultiRaceLegOver,
isDesktop
})
);
lastFavoriteAdded = isFavorite
? runners[i + count - 1].runnerNumber
: "";
i += count;
} else {
// Single entry
isFavorite = includes(favorites, currentRunner.runnerNumber);
lastFavoriteAdded = isFavorite ? currentRunner.runnerNumber : "";
shortedSelections.push(
getListItem({
idx: i,
runner: currentRunner,
isMultiRace,
isCanceled,
isFavorite,
raceTypeCode,
isUnknownWinnerStatus,
betStatusName,
isWinnerBI: currentRunner?.isWinner ?? false,
wagerTypeCode,
isRaceOver,
isActiveMultiRaceLegOver,
isDesktop
})
);
i += 1;
}
}
}
return <>{shortedSelections}</>;
};
const MyBetsRunnerNumberGroup = ({
runners,
favoriteRunners,
raceTypeCode,
isBetsDetailedView = false,
isKey = false,
label,
showHorizontalRule = false,
showUpperHorizontalRule = false,
wagerTypeCode,
onDetailedView,
raceStatus,
isFirstRowOfRunners = false,
isLastRowOfRunners = false,
allRunnersSelected = false,
hasDetails = true,
betStatusName,
isPickBet = false,
isCanceled = false,
pickBetsLabelLength,
favoriteRunner,
isCurrentRaceDate = false,
isBetRefund = false,
isMultiRace = false,
isExotic = false,
isDesktop = false
}: MyBetsRunnerNumberGroupProps) => {
const notScratchedRunners = runners.filter((runner) =>
get(runner, "runners", []).every(
(currentRunner) => !currentRunner.isScratched
)
);
const runnersHaveWillPayAmount =
!isCanceled &&
!isBetRefund &&
notScratchedRunners.length > 0 &&
notScratchedRunners.some((runner) => get(runner, "willPayAmount", 0) > 0);
const isRaceOver = ["winner", "canceled", "loser", "refunded"].includes(
betStatusName
);
const isActiveMultiRaceLegOver =
isMultiRace &&
["win", "lost"].includes(raceStatus) &&
betStatusName === "active";
const isUnknownWinnerStatus = raceStatus === "unknown";
const hasScratchedRunners = runners.length > notScratchedRunners.length;
const alternateRunners = runners[0]?.alternate?.runners ?? [];
const hasAlternates = alternateRunners.length > 0;
const alternateRunnerReplacement = alternateRunners.filter(
(altRunner) => !altRunner.isScratched
);
const showAlternateReplacement =
hasScratchedRunners && !!alternateRunnerReplacement.length && isRaceOver;
const renderAllRunnersSelected = () => {
const allSelections = [];
allSelections.push(
getListItem({
idx: 0,
runner: runners[0],
isMultiRace,
isCanceled,
raceTypeCode,
isUnknownWinnerStatus,
betStatusName,
allRunnersSelected,
isActiveMultiRaceLegOver,
isDesktop
})
);
if (!isCanceled) {
runners.forEach((runner, idx) => {
if (get(runner, "isWinner", false)) {
allSelections.push(
getListItem({
idx,
runner,
isMultiRace,
isCanceled,
raceTypeCode,
isUnknownWinnerStatus,
betStatusName,
isWinnerBI: true,
isDesktop
})
);
}
});
}
return allSelections;
};
const buildSaddleList = (payoutsTitles: Array<string> = []) => {
if (!isBetsDetailedView && allRunnersSelected && !hasScratchedRunners) {
return renderAllRunnersSelected();
}
if (
!isBetsDetailedView &&
runners.length > 3 &&
notScratchedRunners.length > 0
) {
return getShortedSelectionsList({
runners,
favorites: favoriteRunners ?? [],
raceTypeCode,
isMultiRace,
isUnknownWinnerStatus,
allRunnersSelected,
wagerTypeCode,
isRaceOver,
isActiveMultiRaceLegOver,
isCanceled,
betStatusName,
isDesktop
});
}
return runners.map((biRunner, idx) =>
getListItem({
idx,
runner: biRunner,
isMultiRace,
isCanceled,
isFavorite: includes(favoriteRunners, biRunner.runnerNumber),
raceTypeCode,
isUnknownWinnerStatus,
betStatusName,
isBetsDetailedView,
allRunnersSelected,
isLastRowOfRunners,
isWinnerBI: biRunner?.isWinner ?? false,
wagerTypeCode,
isRaceOver,
isActiveMultiRaceLegOver,
payoutsTitles,
favoriteRunner,
isCurrentRaceDate,
isBetRefund,
isDesktop
})
);
};
const renderRunnerNumberGroup = () => {
const titles = getPayoutsHeaderTitle(
wagerTypeCode,
runners as BetSelection[]
);
return (
<RunnerNumberGroupMolecule
data-qa-label="runnerNumberGroup"
isBetsDetailedView={isBetsDetailedView}
betStatusName={betStatusName}
raceStatus={raceStatus}
>
{isBetsDetailedView && (
<PayoutsHeader
titles={titles}
isDesktop={isDesktop}
isCanceled={isCanceled}
/>
)}
{buildSaddleList(titles)}
{!showAlternateReplacement && alternateRunners.length > 0 && (
<AlternateRunners
alternateRunners={alternateRunners}
isBetsDetailedView={isBetsDetailedView}
isDesktop={isDesktop}
titles={titles}
betStatusName={betStatusName}
raceTypeCode={raceTypeCode}
isActiveMultiRaceLegOver={isActiveMultiRaceLegOver}
isRaceOver={isRaceOver}
isUnknownWinnerStatus={isUnknownWinnerStatus}
/>
)}
</RunnerNumberGroupMolecule>
);
};
if (isExotic) {
return (
<ExoticBetsLayout
isBetsDetailedView={isBetsDetailedView}
label={label}
isDesktop={isDesktop}
isKey={isKey}
showHorizontalRule={showHorizontalRule}
runnerNumberGroup={renderRunnerNumberGroup()}
/>
);
}
// Render Pick Bets
if (isMultiRace) {
return (
<PickBetLayout
runners={runners}
isDesktop={isDesktop}
isCanceled={isCanceled}
isBetsDetailedView={isBetsDetailedView}
onDetailedView={onDetailedView}
isPickBet={isPickBet}
isRaceOver={isRaceOver}
raceStatus={raceStatus}
label={label}
wagerTypeCode={wagerTypeCode}
hasAlternates={hasAlternates}
hasAlternateReplacement={!!alternateRunnerReplacement.length}
hasDetails={hasDetails}
isFirstRowOfRunners={isFirstRowOfRunners}
isLastRowOfRunners={isLastRowOfRunners}
runnersHaveWillPayAmount={runnersHaveWillPayAmount}
showHorizontalRule={showHorizontalRule}
showUpperHorizontalRule={showUpperHorizontalRule}
pickBetsLabelLength={pickBetsLabelLength}
runnerNumberGroup={renderRunnerNumberGroup()}
/>
);
}
// return default for simple bet types
return renderRunnerNumberGroup();
};
export default MyBetsRunnerNumberGroup;
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/redux/selectors/index.ts
import { get, size } from "lodash";
import { Store } from "redux";
import { StoryblokComponentPropsFormatted } from "../../types/storyblok";
import { PromoOnboarding } from "../../types/promoOnboarding";
import {
PromoMappedSteps,
PromoOnboardingStep,
PromoStepType
} from "../../types/promoSteps";
import { StoryblokPlaceName } from "../../types/promoOnboardingComponents";
const REDUCER_BASE_PATH = "promosOnboarding";
export const getStoryblokPromos = (store: Store): PromoOnboarding =>
get(store, REDUCER_BASE_PATH, {} as PromoOnboarding);
export const getPromoOnboardingAllSteps = (store: Store): PromoMappedSteps =>
get(store, `${REDUCER_BASE_PATH}.steps`, {});
export const getPromoOnboardingCompletedSteps = (store: Store): number =>
get(store, `${REDUCER_BASE_PATH}.completedSteps`, 0);
export const getPromoOnboardingCurrentStepType = (
store: Store
): PromoStepType => get(store, `${REDUCER_BASE_PATH}.currentStepType`);
export const getPromoOnboardingIsPromoExpired = (store: Store): boolean =>
get(store, `${REDUCER_BASE_PATH}.isPromoExpired`, false);
export const getPromoOnboardingNumberOfSteps = (store: Store): number =>
get(store, `${REDUCER_BASE_PATH}.numberSteps`, 0);
export const getPromoOnboardingPromoId = (store: Store): number | undefined =>
get(store, `${REDUCER_BASE_PATH}.promotionId`);
export const getPromoOnboardingRebateLimit = (store: Store): number =>
get(store, `${REDUCER_BASE_PATH}.rebateLimit`, 0);
export const getPromoOnboardingRemaingDays = (store: Store): number =>
get(store, `${REDUCER_BASE_PATH}.remainingDays`, 0);
export const getPromoOnboardingPromoRootId = (
store: Store
): number | undefined => get(store, `${REDUCER_BASE_PATH}.rootId`);
export const hasPromoOnboardingActivated = (store: Store) => {
const steps = getPromoOnboardingAllSteps(store);
return !!size(steps);
};
export const getStoryblokPromoByStep = (
store: Store,
step: PromoStepType
): PromoOnboardingStep | null =>
get(store, `${REDUCER_BASE_PATH}.steps.${step}`, null);
export const getStoryblokCurrentStep = (
store: Store,
step?: PromoStepType
): PromoOnboardingStep | null => {
const currentStep = step || getPromoOnboardingCurrentStepType(store);
return get(store, `${REDUCER_BASE_PATH}.steps.${currentStep}`, null);
};
export const getStoryblokPromoByPlace = (
store: Store,
place: StoryblokPlaceName,
step?: PromoStepType
): StoryblokComponentPropsFormatted | null => {
const currentStep = step || getPromoOnboardingCurrentStepType(store);
return get(
store,
`${REDUCER_BASE_PATH}.steps.${currentStep}.places.${place}`,
null
);
};
export const getPromoOnboardingPollerTime = (store: Store): number =>
get(store, `${REDUCER_BASE_PATH}.pollerTime`, 60);
export const getPromosOnboardingToggle = (store: Store): boolean =>
get(store, `capi.featureToggles.promosOnboarding`, false);
export const getPromoOnboardingCustomMessage = (store: Store): boolean =>
get(store, `capi.messages.myBetsPromoOnboardingCustomMessage`, "");
export const getPromosOnboardingWalletSteps = (store: Store): string[] => {
const steps = get(
store,
"capi.messages.promoOnboardingWalletSteps",
"$~amountToShow~ in wagering credit will be refunded if you don't win."
);
return steps.split("\r\n") || [];
};
export const getPromosOnboardingWalletSuccessHeaders = (
store: Store
): string[] => {
const headers = get(
store,
"capi.messages.promoOnboardingWalletSuccessHeaders",
""
);
return headers.split("\r\n") || [];
};
export const hasPromoOnboardingComponent = (
store: Store,
place: StoryblokPlaceName,
step?: PromoStepType
): boolean =>
!!get(getStoryblokPromoByPlace(store, place, step), "component", false);
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/constraints/onboardingDictionary.ts
import { AlertInline, Tag } from "@tvg/design-system/src/index";
import { ComponentDictionary } from "../types/promoOnboardingComponents";
export const ONBOARDING_DICTIONARY: ComponentDictionary = {
alert_inline: {
component: AlertInline,
defaultProps: {
qaLabel: "promoOnboardingAlertInline",
type: "fixed",
hasDismissButton: false
}
},
tag: {
component: Tag,
defaultProps: {
qaLabel: "promoOnboardingTag",
size: "m",
icon: "optedIn",
variant: "promo",
label: ""
}
},
unknown: {
component: null,
defaultProps: {}
}
};
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/utils/getStoryblokComponent.ts
import { createElement } from "react";
import { get } from "lodash";
import { StoryblokComponentPropsFormatted } from "../types/storyblok";
import { ONBOARDING_DICTIONARY } from "../constraints/onboardingDictionary";
import {
StoryblokBlock,
StorybookAvailableComponents
} from "../types/promoOnboardingComponents";
export const getStoryblokComponent = (
storyblokComponent: StoryblokComponentPropsFormatted
) => {
const { component: componentName, props } = storyblokComponent;
const storyblokBlok: StoryblokBlock<StorybookAvailableComponents> = get(
ONBOARDING_DICTIONARY,
componentName,
{} as StoryblokBlock<unknown>
);
const componentRender = get(storyblokBlok, "component", null);
const componentProps = {
...get(storyblokBlok, "defaultProps", {}),
...props
};
return componentRender && createElement(componentRender, componentProps);
};
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/types/promoOnboardingComponents.ts
import { FunctionComponent } from "react";
import { AlertInlineProps, TagProps } from "@tvg/design-system";
export enum StoryblokComponentName {
ALERT_INLINE = "alert_inline",
TAG = "tag",
UNKNOWN = ""
}
export enum StoryblokPlaceName {
PROGRAM_PAGE = "program_page",
TRACKS = "tracks_page",
BETSLIP_CONFIRMATION = "betslip_confirmation",
BETSLIP_PLACED = "betslip_placed",
MYBETS_WAGER_FOOTER = "bet_ticket",
MYBETS_CANCEL = "cancel_bet",
MYBETS_RACE_DETAILS = "mybets_race_details",
WALLET_HOME = "wallet_home",
WALLET_HOME_DESKTOP = "wallet_home_desktop",
WALLET_QUICK_DEPOSIT = "wallet_quick_deposit",
WALLET_DEPOSIT_TOP = "wallet_deposit_top",
WALLET_DEPOSIT_TAG = "wallet_deposit_tag",
UNKNOWN = ""
}
export interface PromoOnboardingComponent<T = unknown> {
component: StoryblokComponentName;
props: T;
}
export type PromoComponent<T = unknown> = Partial<
Record<StoryblokPlaceName, PromoOnboardingComponent<T>>
>;
export interface StoryblokBlock<T> {
component: FunctionComponent<T>;
defaultProps: Partial<T>;
}
export interface ComponentDictionary {
alert_inline: StoryblokBlock<AlertInlineProps>;
tag: StoryblokBlock<TagProps>;
unknown: Object;
}
export type StorybookAvailableComponents = Partial<AlertInlineProps | TagProps>;
export type StoryblokComponentProps = StorybookAvailableComponents & {
component: StoryblokComponentName;
};
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/utils/getValueFromProposition.ts
import { capitalize, first, get } from "lodash";
import { WagerTypeCodesInvertedEnum } from "@tvg/ts-types/Wager";
import {
DepositProposition,
WagerProposition
} from "../types/promoPropositions";
export enum VariableModifier {
MAX = "max",
MIN = "min",
NONE = ""
}
export const extractVariableModifier = (
variable: string
): { variableName: string; modifier: VariableModifier } => {
const modifierMatch = variable.match(/(.*)_(.*)/);
if (modifierMatch) {
return {
variableName: modifierMatch[2],
modifier: modifierMatch[1] as VariableModifier
};
}
return {
variableName: variable,
modifier: VariableModifier.NONE
};
};
export const getValueWithModifier = (
variable: string,
propositions: Array<DepositProposition | WagerProposition> = [],
modifier: VariableModifier
) => {
// The following logic applies to the following DEPOSIT STEP variables:
// bonusAmount, bonusPercentage and minimumDepositAmount
if (modifier !== VariableModifier.NONE) {
const variableArray = propositions.reduce(
(acc: Array<number>, proposition) => {
const originalVar = get(proposition, variable);
const newVar =
typeof originalVar === "string"
? +originalVar.replace("%", "").trim()
: originalVar;
return typeof newVar === "number" ? [...acc, newVar] : acc;
},
[]
);
if (modifier === VariableModifier.MAX) {
return Math.max(...variableArray);
}
if (modifier === VariableModifier.MIN) {
return Math.min(...variableArray);
}
}
// The following logic applies to the following WAGER STEP variables:
// raceDate, raceNumber, trackCode and wagerTypeCode
if (propositions.length > 1) {
if (variable === "wagerTypeCode") {
return "Multiple Wager Types";
}
if (variable === "trackCode") {
return "Multiple Tracks";
}
if (variable === "raceNumber") {
return "Multiple Races";
}
if (variable === "raceDate") {
return "Multiple Dates";
}
}
const variableValue = get(first(propositions), variable);
if (
variable === "wagerTypeCode" &&
variableValue in WagerTypeCodesInvertedEnum
) {
const wagerTypeName: string = get(
WagerTypeCodesInvertedEnum,
variableValue
);
return capitalize(wagerTypeName);
}
if (variable === "trackCode" && variableValue === "ALL") {
return "All Tracks";
}
if (variable === "raceNumber" && variableValue === 0) {
return "All Races";
}
if (variable === "raceDate" && !variableValue) {
return "Any Date";
}
return variableValue;
};
export const getValueFromProposition = (
variable: string,
propositions: Array<WagerProposition> | Array<DepositProposition>
) => {
const { variableName, modifier } = extractVariableModifier(variable);
return getValueWithModifier(variableName, propositions, modifier);
};
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/helpers/formatStoryblokText.ts
import { get, replace } from "lodash";
import { PromoOnboarding } from "../types/promoOnboarding";
import { PromoOnboardingStep } from "../types/promoSteps";
import { getValueFromProposition } from "../utils/getValueFromProposition";
const variableRegex = new RegExp("({{)(\\w*)(}})", "g");
export const formatStoryblokText = (
text: string,
promo: PromoOnboarding,
currentStep: PromoOnboardingStep
) => {
let editedText = text;
const matches = editedText.match(variableRegex);
if (matches) {
const variables = matches.map((match) =>
match.replace(variableRegex, (_, __, varName) => varName)
);
variables.forEach((variable) => {
const varToSearch = `{{${variable}}}`;
const replaceRegex = new RegExp(varToSearch, "g");
let newText = get(promo, variable);
if (!newText) {
// Try to find again but inside the step.
newText = get(currentStep, variable);
// Now try to find it again inside the propositions.
if (!newText) {
newText =
getValueFromProposition(
variable,
get(currentStep, "depositPropositions") ||
get(currentStep, "wagerPropositions") ||
[]
) || varToSearch;
}
}
editedText = replace(editedText, replaceRegex, newText);
});
}
return editedText;
};
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/hooks/usePromosOnboardingComponent.ts
import { useState, useEffect, FunctionComponentElement } from "react";
import { getStoryblokComponent } from "../utils/getStoryblokComponent";
import { StoryblokComponentPropsFormatted } from "../types/storyblok";
import {
StoryblokComponentName,
StorybookAvailableComponents
} from "../types/promoOnboardingComponents";
import { PromoOnboarding } from "../types/promoOnboarding";
import { PromoOnboardingStep } from "../types/promoSteps";
import { formatComponentWithDynamicVariables } from "../helpers/formatComponentWithDynamicVariables";
export const usePromosOnboardingComponent = (
promoOnboarding: StoryblokComponentPropsFormatted | null,
promo: PromoOnboarding | null,
currentStep: PromoOnboardingStep | null,
customMessage?: string | null
) => {
const [promoComponent, setPromoComponent] =
useState<FunctionComponentElement<StorybookAvailableComponents> | null>(
null
);
useEffect(() => {
const swappedMessage = (() => {
switch (promoOnboarding?.component) {
case StoryblokComponentName.ALERT_INLINE:
return { message: customMessage };
case StoryblokComponentName.TAG:
return { label: customMessage };
default:
return {};
}
})();
const componentWithCustomMessage = customMessage
? {
...promoOnboarding,
props: { ...promoOnboarding?.props, ...swappedMessage }
}
: promoOnboarding;
const formattedComponent =
componentWithCustomMessage && promo && currentStep
? formatComponentWithDynamicVariables(
componentWithCustomMessage as StoryblokComponentPropsFormatted,
promo,
currentStep
)
: promoOnboarding;
setPromoComponent(
promoOnboarding &&
getStoryblokComponent(
formattedComponent as StoryblokComponentPropsFormatted
)
);
}, [promoOnboarding]);
return promoComponent;
};
webpack://frontend-tpt/../../packages/tvg-lib-ts-types/Device.ts
export enum Device {
MOBILE = "mobile",
TABLET = "tablet",
DESKTOP = "desktop"
}
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/constraints/config.ts
import tvgConf from "@tvg/conf";
export const STORYBLOK_CONTENT_PATH = "promo-onboarding";
export const STORYBLOK_URL = "https://api.storyblok.com/v1/cdn/stories";
export const STORYBLOK_SPACES_URL = `https://api.storyblok.com/v1/cdn/spaces/${STORYBLOK_CONTENT_PATH}`;
export const {
storyblokToken: STORYBLOK_TOKEN,
storyblokVersion: STORYBLOK_VERSION
} = tvgConf().config();
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/types/storyblok.ts
import { PromoAcquisition } from "./promos";
import { PromoMappedSteps, PromoStepType } from "./promoSteps";
import {
StoryblokComponentName,
StoryblokComponentProps,
StoryblokPlaceName,
StorybookAvailableComponents
} from "./promoOnboardingComponents";
export type StoryblokComponentPropsFormatted<T = StorybookAvailableComponents> =
{
component: StoryblokComponentName;
props: T;
};
export type StoryblokMessagesFormatted = Partial<
Record<StoryblokPlaceName, StoryblokComponentPropsFormatted>
>;
export interface StoryblokRenderPlace {
component: string;
places: Array<StoryblokPlaceName>;
}
export interface StoryblokMessages {
component: string;
promo_component: Array<StoryblokComponentProps>;
render_place: Array<StoryblokRenderPlace>;
}
export interface StoryblokStepDescription {
plugin: string;
type: PromoStepType;
description?: string;
description_lost?: string;
description_win?: string;
description_processing?: string;
}
export interface StoryblokStep {
component: string;
messages: Array<StoryblokMessages>;
step_config: StoryblokStepDescription;
}
export interface StoryblokContent {
component: string;
steps: Array<StoryblokStep>;
}
export enum StoryblokVersion {
PUBLISHED = "published",
DRAFT = "draft"
}
export interface StoryblokDraftConfig {
draft?: StoryblokDraft;
draftForceService?: PromoAcquisition;
}
export type StoryblokDraft = boolean | StoryblokVersion;
export interface StoryBlokComponentsFormatted {
steps: PromoMappedSteps;
}
export enum StoryblokPlugin {
TEXT = "promo-onboarding-component"
}
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/utils/getStoryblokVersion.ts
import { StoryblokDraft, StoryblokVersion } from "../types/storyblok";
import { STORYBLOK_VERSION } from "../constraints/config";
export const getStoryblokVersion = (
draft?: StoryblokDraft
): StoryblokVersion => {
if (typeof draft === "boolean") {
return draft ? StoryblokVersion.DRAFT : StoryblokVersion.PUBLISHED;
}
return draft || STORYBLOK_VERSION;
};
webpack://frontend-tpt/../../node_modules/date-fns/esm/getTime/index.js
import toDate from '../toDate/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
/**
* @name getTime
* @category Timestamp Helpers
* @summary Get the milliseconds timestamp of the given date.
*
* @description
* Get the milliseconds timestamp of the given date.
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* @param {Date|Number} date - the given date
* @returns {Number} the timestamp
* @throws {TypeError} 1 argument required
*
* @example
* // Get the timestamp of 29 February 2012 11:45:05.123:
* var result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123))
* //=> 1330515905123
*/
export default function getTime(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var timestamp = date.getTime();
return timestamp;
}
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/utils/fetchStoryBlokCacheVersion.ts
import axios from "axios";
import { get } from "lodash";
import { getTime } from "date-fns";
import { getStoryblokVersion } from "./getStoryblokVersion";
import { StoryblokDraft } from "../types/storyblok";
import { STORYBLOK_SPACES_URL, STORYBLOK_TOKEN } from "../constraints/config";
export const fetchStoryBlokCacheVersion = async (
draft?: StoryblokDraft
): Promise<number | null> => {
const cacheTimestamp = getTime(Date.now());
try {
const response = await axios({
method: "GET",
url: STORYBLOK_SPACES_URL,
headers: {
"content-type": "application/json"
},
params: {
version: getStoryblokVersion(draft),
token: STORYBLOK_TOKEN
}
});
return get(response, "data.space.version", cacheTimestamp);
} catch (error: unknown) {
console.error("Error trying to get cache version in storyblok", error);
return cacheTimestamp;
}
};
export default fetchStoryBlokCacheVersion;
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/types/promoSteps.ts
import { DepositProposition, WagerProposition } from "./promoPropositions";
import { PromoComponent } from "./promoOnboardingComponents";
export type PromoStepResponseType = "DepositStep" | "WagerStep" | "PayoutStep";
export enum PromoStepType {
DEPOSIT = "DEPOSIT_STEP",
WAGER = "WAGER_STEP",
PAYOUT = "PAYOUT_STEP",
UNKNOWN = ""
}
export enum PromoStepDescriptionKey {
DEFAULT = "default",
LOSS = "loss",
WIN = "win",
PROCESSING = "processing"
}
export type PromoStepDescriptions = Partial<
Record<PromoStepDescriptionKey, string>
>;
export enum PromoStepWagerStatus {
PLACED = "P",
WIN = "W",
LOST = "L"
}
export interface PromoGenericStep {
isFulfilled?: boolean;
places: PromoComponent;
description: PromoStepDescriptions;
stepType?: PromoStepType;
"@type"?: PromoStepResponseType;
}
export interface DepositStep extends PromoGenericStep {
stepType?: PromoStepType.DEPOSIT;
depositDate?: string;
depositPropositions?: Array<DepositProposition>;
"@type"?: "DepositStep";
}
export interface WagerStep extends PromoGenericStep {
isGreyHound?: boolean;
raceDate?: string;
raceNumber?: number;
serialNumber?: string;
stepType?: PromoStepType.WAGER;
trackCode?: string;
trackName?: string;
wagerStatus?: PromoStepWagerStatus;
wagerDate?: string;
wagerPropositions?: Array<WagerProposition>;
"@type"?: "WagerStep";
}
export interface PayoutStep extends PromoGenericStep {
payoutUUID: string;
amount: number;
timestamp: string;
"@type"?: "PayoutStep";
}
export type PromoOnboardingStep = WagerStep | PayoutStep | DepositStep;
export type PromoMappedSteps = Partial<
Record<PromoStepType, PromoOnboardingStep>
>;
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/utils/fetchStoryblok.ts
import axios from "axios";
import { StoryblokDraft } from "../types/storyblok";
import {
STORYBLOK_CONTENT_PATH,
STORYBLOK_TOKEN,
STORYBLOK_URL
} from "../constraints/config";
import { getStoryblokVersion } from "./getStoryblokVersion";
import { fetchStoryBlokCacheVersion } from "./fetchStoryBlokCacheVersion";
export const fetchStoryblok = async (
promoId: number,
draft?: StoryblokDraft
) => {
const storyblokUrl = `${STORYBLOK_URL}/${STORYBLOK_CONTENT_PATH}/${promoId}`;
const cacheVersion = await fetchStoryBlokCacheVersion(draft);
return axios({
method: "GET",
url: storyblokUrl,
headers: {
"content-type": "application/json"
},
params: {
version: getStoryblokVersion(draft),
token: STORYBLOK_TOKEN,
resolve_relations: "global_ref.reference",
cv: cacheVersion
}
});
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/PromoPreview/styled-components.ts
import styled from "styled-components";
import { buildColor } from "@tvg/design-system";
export const PromoPreviewWrapper = styled.div`
display: flex;
flex-direction: column;
padding: 24px;
background-color: ${buildColor("white", "900")};
`;
export const PromoPreviewHeader = styled.div`
display: flex;
flex-direction: row;
justify-content: space-between;
`;
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/preview/helpers/formatStepName.ts
import { get } from "lodash";
import { PromoStepType } from "@tvg/sh-lib-promos-onboarding/types/promoSteps";
const formattedStepName: Record<PromoStepType, string> = {
[PromoStepType.DEPOSIT]: "Deposit Step",
[PromoStepType.WAGER]: "Wager Step",
[PromoStepType.PAYOUT]: "Payout Step",
[PromoStepType.UNKNOWN]: ""
};
export const formatStepName = (step: PromoStepType): string =>
get(formattedStepName, step, "");
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/Table/styled-components.ts
import styled, { css } from "styled-components";
import buildColor from "@tvg/atomic-ui/_static/ColorPalette";
import { fontMedium } from "@tvg/atomic-ui/_static/Typography";
export const TableWrapper = styled.table`
width: 100%;
border-radius: 4px;
background-color: ${buildColor("white", "100")};
border-collapse: separate;
`;
export const BodySectionWrapper = styled.tbody`
tr {
&:not(:last-of-type) td {
box-shadow: inset 0 -1px 0 ${buildColor("blue", "100")};
}
&:hover {
background-color: ${buildColor("blue_accent", "000")};
td:first-of-type {
box-shadow:
inset 0 -1px 0 ${buildColor("blue", "100")},
inset 2px 0 0 ${buildColor("blue_accent", "500")};
}
&:last-of-type td:first-of-type {
box-shadow: inset 2px 0 0 ${buildColor("blue_accent", "500")};
}
}
&:last-of-type {
border-radius: 0 0 4px 4px;
td:first-of-type {
border-radius: 0 0 0 4px;
}
td:last-of-type {
border-radius: 0 0 4px;
}
}
}
`;
export const HeadCellWrapper = styled.th<{
colSize?: string;
addShadow?: boolean;
isPositionRelative?: boolean;
}>`
text-align: left;
padding: 12px;
line-height: 17px;
font-size: 12px;
font-weight: 500;
font-family: ${fontMedium};
border-right: 1px solid ${buildColor("blue", "100")};
color: ${buildColor("grey", "900")};
background-color: ${buildColor("blue_accent", "000")};
width: ${(props) => props.colSize || "auto"};
box-shadow:
inset 0 -1px 0 ${buildColor("blue", "100")},
0 -4px 0 ${buildColor("blue", "000")};
background-clip: padding-box;
${(props) =>
props.addShadow &&
css`
&::after {
content: "";
position: absolute;
width: 100%;
bottom: -1px;
left: 0;
z-index: -1;
transform: scale(1);
box-shadow: 0 0 2px 1px rgba(17, 43, 68, 0.15);
}
`};
&:first-of-type {
border-radius: 4px 0 0;
}
&:last-of-type {
border-radius: 0 4px 0 0;
border-right: 0 none;
}
${(props) =>
props.isPositionRelative &&
css`
padding-bottom: 36px;
position: relative;
`}
`;
export const BodyCellWrapper = styled.td<{
colSize?: string;
isPositionRelative?: boolean;
}>`
padding: 12px;
vertical-align: top !important;
width: ${(props) => props.colSize || "auto"};
border-right: 1px solid ${buildColor("blue", "100")};
position: relative;
&:last-of-type {
border-right: 0 none;
}
${(props) =>
props.isPositionRelative &&
css`
padding-bottom: 36px;
position: relative;
`}
`;
export const HeadSectionWrapper = styled.thead<{
headerSticky?: boolean;
}>`
${(props) =>
props.headerSticky &&
css`
th {
position: sticky;
top: 0;
z-index: 6;
}
`};
`;
export const RowWrapper = styled.tr``;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/Table/index.tsx
/* eslint-disable react/no-array-index-key */
import React, { forwardRef } from "react";
import { TableProps, RowProps, CellProps } from "./types";
import {
TableWrapper,
RowWrapper,
HeadSectionWrapper,
BodySectionWrapper,
HeadCellWrapper,
BodyCellWrapper
} from "./styled-components";
const Table = forwardRef<HTMLTableElement, TableProps>(
(
{
children,
headerShadow,
headerSticky,
theadData,
qaLabel = "table",
...rest
},
ref
) => (
<TableWrapper {...rest} ref={ref} data-qa-label={qaLabel}>
{theadData && (
<HeadSectionWrapper headerSticky={headerSticky}>
<TableRow qaLabel={`${qaLabel}-thead-row`}>
{theadData.map((item, index) => (
<TableCell
key={`table-thead-cell-${index}`}
type="th"
colSize={item.size || "auto"}
addShadow={!!headerShadow}
>
{item.title}
</TableCell>
))}
</TableRow>
</HeadSectionWrapper>
)}
{children && <BodySectionWrapper>{children}</BodySectionWrapper>}
</TableWrapper>
)
);
const TableRow = forwardRef<HTMLTableRowElement, RowProps>(
({ children, qaLabel = "table-tbody-row", ...rest }, ref) => (
<RowWrapper {...rest} ref={ref} data-qa-label={qaLabel}>
{children}
</RowWrapper>
)
);
const TableCell = forwardRef<HTMLTableCellElement, CellProps>(
({ children, type = "td", qaLabel = "table-cell", ...rest }, ref) => {
if (type === "th") {
return (
<HeadCellWrapper
{...rest}
ref={ref}
data-qa-label={`${qaLabel}-${type}`}
>
{children}
</HeadCellWrapper>
);
}
return (
<BodyCellWrapper {...rest} ref={ref} data-qa-label={`${qaLabel}-${type}`}>
{children}
</BodyCellWrapper>
);
}
);
export default Object.assign(Table, {
Row: TableRow,
Cell: TableCell
});
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/PromoPreviewStep/styled-components.ts
import styled, { css } from "styled-components";
export const StepWrapper = styled.div`
display: flex;
flex-direction: column;
margin-bottom: 24px;
`;
export const RowWrapper = styled.tr``;
export const ColumnWrapper = styled.td<{
addPadding?: boolean;
}>`
${({ addPadding }) =>
addPadding &&
css`
padding: 0 12px;
`}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/PromoPreviewStep/index.tsx
import React from "react";
import { get } from "lodash";
import { formatStepName } from "@tvg/promos-onboarding/src/components/preview/helpers/formatStepName";
import { Header } from "@tvg/design-system";
import Table from "../../_molecule/Table";
import { StepWrapper, RowWrapper, ColumnWrapper } from "./styled-components";
import { Props } from "./types";
const theadData = [
{ title: "Render Places", size: "150px" },
{ title: "Component Preview", size: "300px" }
];
export const PromoPreviewStep = ({ step, components }: Props) => (
<StepWrapper key={get(step, "_uid", "")}>
<Header tag="h2" marginBottom="space-4" qaLabel="PromoStep-Heading">
{formatStepName(get(step, "step_config.type", ""))}
</Header>
<Table theadData={theadData}>
{!!get(components, "length", 0) &&
components.map((component, index) => (
<RowWrapper key={get(step, `messages[${index}]._uid`, "")}>
<ColumnWrapper addPadding>
{get(component, "renderPlaces", "")}
</ColumnWrapper>
<ColumnWrapper>{get(component, "component", "")}</ColumnWrapper>
</RowWrapper>
))}
</Table>
</StepWrapper>
);
export default PromoPreviewStep;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/PromoPreview/index.tsx
import React from "react";
import { get } from "lodash";
import { Header, Button } from "@tvg/design-system";
import { PromoPreviewWrapper, PromoPreviewHeader } from "./styled-components";
import { Props } from "./types";
import PromoPreviewStep from "../../_organism/PromoPreviewStep";
export const PromoPreviewTemplate = ({
steps,
components,
refetchStoryblok
}: Props) => (
<PromoPreviewWrapper>
<PromoPreviewHeader>
<Header tag="h1" marginBottom="space-7" qaLabel="PromoPreview-Heading">
Steps
</Header>
<Button
variant="primary"
icon="refresh"
onPress={refetchStoryblok}
qaLabel="PromoPreview-RefetchButton"
>
Refresh preview
</Button>
</PromoPreviewHeader>
{steps.map((step, index) => (
<PromoPreviewStep
key={get(step, "_uid", "")}
step={step}
components={components[+index]}
/>
))}
</PromoPreviewWrapper>
);
export default PromoPreviewTemplate;
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/helpers/formatStoryblokProps.ts
import { get, omit } from "lodash";
import { StoryblokPlugin } from "../types/storyblok";
import { StoryblokComponentProps } from "../types/promoOnboardingComponents";
export const formatStoryblokProps = (componentProps: StoryblokComponentProps) =>
Object.entries(omit(componentProps, ["component"])).reduce(
(propsFormatted, [key, value]) => {
if (
typeof value === "object" &&
get(value, "plugin") === StoryblokPlugin.TEXT
) {
return {
...propsFormatted,
[key]: get(value, "value", "")
};
}
return {
...propsFormatted,
[key]: value
};
},
{}
);
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/preview/index.tsx
import React, { useState, useEffect } from "react";
import { get } from "lodash";
import { fetchStoryblok } from "@tvg/sh-lib-promos-onboarding/utils/fetchStoryblok";
import {
StoryblokVersion,
StoryblokStep
} from "@tvg/sh-lib-promos-onboarding/types/storyblok";
import PromoPreviewTemplate from "@tvg/atomic-ui/_templates/PromoPreview";
import { ComponentPreview } from "./types";
import { formatPreviewComponents } from "./helpers/formatPreviewComponents";
import { PreviewProps } from "../sharedComponentTypes";
export const PromoPreviewComponent = ({
previewContentId = ""
}: PreviewProps) => {
const [shouldFetchStoryblok, setShouldFetchStoryblok] = useState(true);
const [previewSteps, setPreviewSteps] = useState<StoryblokStep[]>([]);
const [previewComponents, setPreviewComponents] = useState<
ComponentPreview[][]
>([]);
useEffect(() => {
if (shouldFetchStoryblok) {
fetchStoryblok(+previewContentId, StoryblokVersion.DRAFT)
.then((response) => {
const steps: Array<StoryblokStep> = get(
response,
"data.story.content.steps",
[]
);
setPreviewSteps(steps);
setShouldFetchStoryblok(false);
})
.catch((error) => {
// eslint-disable-next-line no-console
console.error(error);
});
}
}, [previewContentId, shouldFetchStoryblok]);
useEffect(() => {
const formattedPreviewComponents = formatPreviewComponents(previewSteps);
setPreviewComponents(formattedPreviewComponents);
}, [previewSteps]);
return (
<PromoPreviewTemplate
steps={previewSteps}
components={previewComponents}
refetchStoryblok={() => {
setShouldFetchStoryblok(true);
}}
/>
);
};
export default PromoPreviewComponent;
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/preview/helpers/formatPreviewComponents.ts
import { get } from "lodash";
import { getStoryblokComponent } from "@tvg/sh-lib-promos-onboarding/utils/getStoryblokComponent";
import { formatStoryblokProps } from "@tvg/sh-lib-promos-onboarding/helpers/formatStoryblokProps";
import {
StoryblokStep,
StoryblokComponentPropsFormatted
} from "@tvg/sh-lib-promos-onboarding/types/storyblok";
import { ComponentPreview } from "../types";
export const formatPreviewComponents = (steps: StoryblokStep[]) => {
const componentsByStep: ComponentPreview[][] = [];
steps.forEach((step, index) => {
const componentsInCurrentStep = get(step, "messages", []);
componentsInCurrentStep.forEach((currentComponent) => {
const { component, ...rest } = get(
currentComponent,
"promo_component[0]",
{}
);
const props = formatStoryblokProps(rest);
const formattedComponent: StoryblokComponentPropsFormatted = {
component,
props
};
const currentRenderedComponent =
getStoryblokComponent(formattedComponent);
const renderPlaces = get(
currentComponent,
"render_place[0].places",
[]
).reduce(
(places: string, currentPlace: string) =>
`${places ? places + ", " : ""}${currentPlace}`,
""
);
if (!get(componentsByStep, index)) {
componentsByStep[+index] = [];
}
componentsByStep[+index].push({
component: currentRenderedComponent,
renderPlaces
});
});
});
return componentsByStep;
};
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/PromoProgress/styled-components.ts
import styled, { css, FlattenSimpleInterpolation } from "styled-components";
import { buildColor } from "@tvg/design-system";
import { Device } from "@tvg/ts-types/Device";
const getPromoProgressContainerStyle = (
device: Device,
isHomePageSection: boolean
): FlattenSimpleInterpolation => {
let styles: FlattenSimpleInterpolation;
if (device === Device.MOBILE) {
styles = css`
flex-direction: column;
padding: 12px;
`;
} else {
styles = css`
flex-direction: row;
padding: 20px;
justify-content: space-between;
align-items: center;
`;
}
if (isHomePageSection) {
styles =
device === Device.DESKTOP
? css`
${styles};
border-bottom: 1px solid ${buildColor("blue", "100")};
`
: css`
${styles};
margin-bottom: 8px;
`;
}
return styles;
};
export const PromoProgressContainer = styled.div<{
device: Device;
isDarkMode?: boolean;
isHomePageSection?: boolean;
}>`
display: flex;
flex: 1;
background-color: ${({ isDarkMode }) =>
isDarkMode ? buildColor("blue", "800") : buildColor("blue_accent", "000")};
${({ device, isHomePageSection }) =>
getPromoProgressContainerStyle(device, !!isHomePageSection)};
`;
export const InfoContainer = styled.div<{
device?: Device;
}>`
display: flex;
flex-wrap: wrap;
justify-content: space-between;
${({ device }) =>
device !== Device.MOBILE &&
css`
flex-direction: column;
margin-right: 20px;
width: 25%;
`}
`;
export const HeaderContainer = styled.div<{
device?: Device;
}>`
${({ device }) =>
device !== Device.MOBILE
? css`
flex: 0;
order: 0;
`
: css`
flex: 50%;
`};
`;
export const DaysContainer = styled.div<{
device?: Device;
}>`
display: flex;
${({ device }) =>
device !== Device.MOBILE
? css`
flex: 0;
order: 2;
margin-top: 8px;
justify-content: start;
`
: css`
flex: 50%;
justify-content: flex-end;
`}
`;
export const DetailsContainer = styled.div<{
device?: Device;
}>`
margin-top: 2px;
flex: 100%;
${({ device }) =>
device !== Device.MOBILE &&
css`
order: 1;
`}
`;
export const ProgressBarContainer = styled.div<{
device?: Device;
}>`
flex: 1;
${({ device }) =>
device === Device.MOBILE &&
css`
margin-bottom: 12px;
`}
`;
export const ButtonContainer = styled.div<{
device?: Device;
}>`
${({ device }) =>
device !== Device.MOBILE &&
css`
min-width: 112px;
margin-left: 20px;
`}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/PromoProgress/index.tsx
import React from "react";
import { Button, ProgressBar, Header, Paragraph } from "@tvg/design-system";
import { noop } from "lodash";
import { Device } from "@tvg/ts-types/Device";
import {
PromoProgressContainer,
InfoContainer,
HeaderContainer,
DaysContainer,
DetailsContainer,
ProgressBarContainer,
ButtonContainer
} from "./styled-components";
import { Props } from "./types";
export const PromoProgress = ({
qaLabel = "promoProgress",
CTALabel = "",
onCTAPress = noop,
promoDescription = "",
progressBarIcon = "$",
progressBarSteps = [],
completedSteps = 0,
promoTitle = "",
showRemainingDays = false,
remainingDays = 0,
CTAShow = true,
isDarkMode = false,
device = Device.MOBILE,
isHomePageSection = false
}: Props) => (
<PromoProgressContainer
data-qa-label={qaLabel}
isDarkMode={isDarkMode}
isHomePageSection={isHomePageSection}
device={device}
>
<InfoContainer device={device}>
<HeaderContainer device={device}>
<Header
qaLabel="promoProgressTitle"
tag="h2"
color={isDarkMode ? "white.900" : "blue.600"}
mb="space-1"
fontFamily="bold"
>
{promoTitle}
</Header>
</HeaderContainer>
{showRemainingDays && !!remainingDays && (
<DaysContainer device={device}>
<Paragraph
qaLabel="promoProgressRemainDays"
color={isDarkMode ? "blue_accent.200" : "blue_accent.500"}
textTransform="uppercase"
fontSize="xs"
fontFamily="condensedRegular"
>
{`${remainingDays} Days left`}
</Paragraph>
</DaysContainer>
)}
<DetailsContainer>
<Paragraph
qaLabel="promoProgressDescription"
color={isDarkMode ? "blue_accent.200" : "grey.800"}
mb="space-1"
>
{promoDescription}
</Paragraph>
</DetailsContainer>
</InfoContainer>
<ProgressBarContainer device={device}>
<ProgressBar
completedSteps={completedSteps}
icon={progressBarIcon}
isDarkMode={isDarkMode}
>
{progressBarSteps.map((description) => (
<ProgressBar.Step
key={description}
stepDescription={description}
qaLabel={`progress-bar-step-${description.toLowerCase()}`}
/>
))}
</ProgressBar>
</ProgressBarContainer>
{CTAShow && CTALabel && typeof onCTAPress === "function" && (
<ButtonContainer device={device}>
<Button
qaLabel="promoProgressCTA"
onPress={onCTAPress}
variant="primary"
isStretched
>
{CTALabel}
</Button>
</ButtonContainer>
)}
</PromoProgressContainer>
);
export default PromoProgress;
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/utils/gtm.ts
import mediator from "@tvg/mediator";
export const promoOnboardingCTAClickGTM = (
linkLabel: string,
promoId?: number,
promoName?: string
) =>
mediator.base.dispatch({
type: "PROMOS_ONBOARDING:CTA_CLICK",
payload: {
link: linkLabel,
promoId,
promoName
}
});
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/constraints/promoCTA.ts
import { noop } from "lodash";
import { PromoCTA } from "../types";
export const defaultCTA: PromoCTA = {
CTALabel: "",
onCTAPress: noop,
CTAShow: false
};
webpack://frontend-tpt/../../packages/tvg-lib-utils/routeRedirectUtils.ts
import mediator from "@tvg/mediator";
import { isTvg5 } from "@tvg/utils/generalUtils";
import buildRaceUrl from "@tvg/formatter/url";
import { History } from "@tvg/ts-types/History";
export const genericRedirect = (
history: History,
route: string,
isDesktop = false,
event = ""
) => {
const { location } = history;
if (location && location.pathname === route) {
return;
}
if (!isDesktop || isTvg5()) {
history.push(route);
} else {
mediator.base.dispatch({
type: "TVG4_NAVIGATION",
payload: { route, event }
});
}
};
export const goToWallet = (history: History, isDesktop = false) => {
genericRedirect(history, "/wallet", isDesktop, "Wallet");
};
export const goToTracksPage = (history: History, isDesktop = false) => {
genericRedirect(history, "/races", isDesktop, "Races");
};
export const goToProgramPage = (
history: History,
trackCode: string,
trackName: string,
raceNumber: number,
isGreyHound: boolean,
isDesktop = false
) => {
genericRedirect(
history,
buildRaceUrl(trackCode, trackName, raceNumber, isGreyHound),
isDesktop,
"Program Page"
);
};
export const hasRoutePath = (path: string, config: Array<{ path: string }>) =>
config.some((route) => {
if (route.path === "*") {
return false;
}
if (route.path === path) {
return true;
}
const regexPattern = new RegExp(
// eslint-disable-next-line no-useless-escape
`^${route.path.replace(/:[^\/]+/g, "[^/]+")}$`
);
return regexPattern.test(path);
});
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/constraints/promoCurrentStatus.ts
import { PromoCurrentStatus } from "../types";
import { defaultCTA } from "./promoCTA";
export const defaultStatus: PromoCurrentStatus = {
...defaultCTA,
promoDescription: "",
progressBarIcon: "$",
progressBarSteps: [],
completedSteps: 0,
promoTitle: "",
remainingDays: 0,
showRemainingDays: true
};
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/helpers/formatPromoCurrentStatus.ts
import { History } from "@tvg/ts-types/History";
import { mathPercentageFormatted } from "@tvg/utils/mathUtils";
import { get, has } from "lodash";
import {
PromoMappedSteps,
PromoOnboardingStep,
PromoStepDescriptions,
PromoStepType,
PromoStepWagerStatus
} from "@tvg/sh-lib-promos-onboarding/types/promoSteps";
import { PromoOnboarding } from "@tvg/sh-lib-promos-onboarding/types/promoOnboarding";
import tvgConf from "@tvg/conf";
import { PromoCurrentStatus } from "../types";
import { getCTA } from "../utils/getPromoCTA";
import { getPromoDescription } from "../utils/getPromoDescription";
import { getPromoStepsLabel } from "../utils/getPromoStepsLabel";
import { getCompletedSteps } from "../utils/getCompletedSteps";
import { defaultStatus } from "../constraints/promoCurrentStatus";
export const formatPromoCurrentStatus = (
storyblokPromos: PromoOnboarding,
history: History
): PromoCurrentStatus | null => {
const isDesktop = tvgConf().device === "desktop";
const promoSteps: PromoMappedSteps = get(
storyblokPromos,
"steps",
{} as PromoMappedSteps
);
const hasPromoPayoutStep = has(promoSteps, `${PromoStepType.PAYOUT}.@type`);
const currentStepType = hasPromoPayoutStep
? PromoStepType.PAYOUT
: get(storyblokPromos, "currentStepType");
const currentStep: PromoOnboardingStep | null = get(
promoSteps,
currentStepType,
null
);
if (!currentStep) {
return null;
}
const stepDescription: PromoStepDescriptions = get(
currentStep,
`description`,
{} as PromoStepDescriptions
);
const stepIsFulfilled = get(currentStep, `isFulfilled`, false);
const CTA = getCTA(
currentStepType,
stepIsFulfilled,
currentStep,
history,
isDesktop
);
const wagerStatus = get(currentStep, "wagerStatus");
const promoRedeem =
wagerStatus && wagerStatus !== PromoStepWagerStatus.PLACED;
const promoDescription = getPromoDescription(
stepDescription,
storyblokPromos,
currentStep
);
const progressBarSteps = ["Register", ...getPromoStepsLabel(promoSteps)];
const completedSteps = getCompletedSteps(
get(storyblokPromos, "completedSteps", 0),
promoRedeem ? PromoStepType.PAYOUT : currentStepType,
stepIsFulfilled || promoRedeem
);
const promoTitle =
currentStepType === PromoStepType.PAYOUT && stepIsFulfilled
? "Promotion Redeemed"
: `${mathPercentageFormatted(
progressBarSteps.length,
completedSteps
)} Complete`;
const remainingDays = get(storyblokPromos, "remainingDays", 0);
return {
...defaultStatus,
...CTA,
promoDescription,
progressBarSteps,
completedSteps,
promoTitle,
remainingDays,
showRemainingDays: !promoRedeem && currentStepType !== PromoStepType.PAYOUT
};
};
export default formatPromoCurrentStatus;
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/utils/getPromoCTA.ts
import { History } from "@tvg/ts-types/History";
import {
PromoOnboardingStep,
PromoStepType,
WagerStep
} from "@tvg/sh-lib-promos-onboarding/types/promoSteps";
import { PromoCTA } from "../types";
import { defaultCTA } from "../constraints/promoCTA";
import { getDepositCTA } from "./CTA/getDepositCTA";
import { getBetCTA } from "./CTA/getBetCTA";
import { getWatchLiveCTA } from "./CTA/getWatchLiveCTA";
export const getCTA = (
stepType: PromoStepType,
isFulfilled: boolean,
promoOnboardingStep: PromoOnboardingStep,
history: History,
isDesktop: boolean
): PromoCTA => {
switch (stepType) {
case PromoStepType.DEPOSIT:
return getDepositCTA(isFulfilled, history, isDesktop);
case PromoStepType.WAGER:
if (isFulfilled) {
return getWatchLiveCTA(
history,
promoOnboardingStep as WagerStep,
isDesktop
);
}
return getBetCTA(history, isDesktop);
default:
return defaultCTA;
}
};
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/utils/CTA/getDepositCTA.ts
import { History } from "@tvg/ts-types/History";
import { goToWallet } from "@tvg/utils/routeRedirectUtils";
import { PromoCTA } from "../../types";
export const getDepositCTA = (
isFulfilled: boolean,
history: History,
isDesktop: boolean
) =>
({
CTALabel: "Deposit Now",
onCTAPress: () => {
goToWallet(history, isDesktop);
},
CTAShow: !isFulfilled
}) as PromoCTA;
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/utils/CTA/getWatchLiveCTA.ts
import { History } from "@tvg/ts-types/History";
import {
PromoStepWagerStatus,
WagerStep
} from "@tvg/sh-lib-promos-onboarding/types/promoSteps";
import { goToProgramPage } from "@tvg/utils/routeRedirectUtils";
import { PromoCTA } from "../../types";
export const getWatchLiveCTA = (
history: History,
promoOnboardingStep: WagerStep,
isDesktop: boolean
) => {
const { trackCode, trackName, raceNumber, isGreyHound, wagerStatus } =
promoOnboardingStep;
return {
CTALabel: "Watch Live",
onCTAPress: () => {
if (trackCode && trackName && raceNumber) {
goToProgramPage(
history,
trackCode,
trackName,
raceNumber,
!!isGreyHound,
isDesktop
);
}
},
CTAShow: wagerStatus === PromoStepWagerStatus.PLACED
} as PromoCTA;
};
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/utils/CTA/getBetCTA.ts
import { History } from "@tvg/ts-types/History";
import { goToTracksPage } from "@tvg/utils/routeRedirectUtils";
import { PromoCTA } from "../../types";
export const getBetCTA = (history: History, isDesktop: boolean) =>
({
CTALabel: "Bet Now",
onCTAPress: () => {
goToTracksPage(history, isDesktop);
},
CTAShow: true
}) as PromoCTA;
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/utils/getPromoDescription.ts
import { get } from "lodash";
import {
PromoOnboardingStep,
PromoStepDescriptionKey,
PromoStepDescriptions,
PromoStepType,
PromoStepWagerStatus
} from "@tvg/sh-lib-promos-onboarding/types/promoSteps";
import { formatStoryblokText } from "@tvg/sh-lib-promos-onboarding/helpers/formatStoryblokText";
import { PromoOnboarding } from "@tvg/sh-lib-promos-onboarding/types/promoOnboarding";
import { checkOnboardingPromoAvailable } from "@tvg/sh-lib-promos-onboarding/utils/checkOnboardingPromoAvailable";
const getPromoFinishedDescriptionsKey = (
wagerStatus?: PromoStepWagerStatus
): PromoStepDescriptionKey => {
switch (wagerStatus) {
case PromoStepWagerStatus.WIN: {
return PromoStepDescriptionKey.WIN;
}
case PromoStepWagerStatus.LOST: {
return PromoStepDescriptionKey.LOSS;
}
default: {
return PromoStepDescriptionKey.DEFAULT;
}
}
};
const getPromoAvailableDescriptionKey = (
wagerStatus?: PromoStepWagerStatus
): PromoStepDescriptionKey =>
wagerStatus && wagerStatus === PromoStepWagerStatus.PLACED
? PromoStepDescriptionKey.PROCESSING
: PromoStepDescriptionKey.DEFAULT;
export const getPromoDescription = (
messages: PromoStepDescriptions,
promoOnboarding: PromoOnboarding,
currentStep: PromoOnboardingStep
): string => {
const defaultText = get(messages, "default", "");
const promoSteps = get(promoOnboarding, "steps", {});
const wagerStatus = get(promoSteps, `${PromoStepType.WAGER}.wagerStatus`);
const promoAvailable = checkOnboardingPromoAvailable(promoSteps);
const messageKey = promoAvailable
? getPromoAvailableDescriptionKey(wagerStatus)
: getPromoFinishedDescriptionsKey(wagerStatus);
const description = get(messages, messageKey, "");
return formatStoryblokText(
description || defaultText,
promoOnboarding,
currentStep
);
};
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/utils/checkOnboardingPromoAvailable.ts
import { get } from "lodash";
import {
PromoMappedSteps,
PromoStepType,
PromoStepWagerStatus
} from "../types/promoSteps";
export const checkOnboardingPromoAvailable = (
steps: PromoMappedSteps
): boolean => {
const wagerStep = get(steps, PromoStepType.WAGER);
const payoutStep = get(steps, `${PromoStepType.PAYOUT}.timestamp`);
const wagerStatus = get(steps, `${PromoStepType.WAGER}.wagerStatus`);
const depositDate = get(steps, `${PromoStepType.DEPOSIT}.depositDate`);
return wagerStep
? !payoutStep && wagerStatus !== PromoStepWagerStatus.WIN
: !payoutStep && !depositDate;
};
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/utils/getPromoStepsLabel.ts
import {
PromoMappedSteps,
PromoStepType
} from "@tvg/sh-lib-promos-onboarding/types/promoSteps";
export const getPromoStepsLabel = (
promoSteps: PromoMappedSteps
): Array<string> =>
(Object.keys(promoSteps) as Array<PromoStepType>).reduce((steps, step) => {
let label = "";
switch (step) {
case PromoStepType.DEPOSIT:
label = "Deposit";
break;
case PromoStepType.WAGER:
label = "Wager";
break;
default:
return steps;
}
return [...steps, label];
}, [] as Array<string>);
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/utils/getCompletedSteps.ts
import { PromoStepType } from "@tvg/sh-lib-promos-onboarding/types/promoSteps";
// Those vars is to make offset registration and payout step because this step is only on FE side.
export const OFFSET_REGISTRATION_STEP = 1;
export const OFFSET_PAYOUT_STEP = 2;
export const getCompletedSteps = (
completedSteps: number,
currentStepType: PromoStepType,
isFulfilled: boolean
) =>
currentStepType === PromoStepType.PAYOUT && isFulfilled
? completedSteps + OFFSET_PAYOUT_STEP
: completedSteps + OFFSET_REGISTRATION_STEP;
webpack://frontend-tpt/../../packages/tvg-lib-utils/mathUtils.ts
export const mathPercentage = (total: number, done: number) =>
total > 0 ? (100 * done) / total : 0;
export const mathClamp = (value: number, min: number, max: number) =>
Math.min(Math.max(value, min), max);
export const mathPercentageFormatted = (
total: number,
done: number,
fractionDigits: number = 0
) => {
const percentage = mathClamp(mathPercentage(total, done), 0, 100);
const percentageFixed =
fractionDigits > 0
? percentage.toFixed(fractionDigits)
: Math.floor(percentage);
return `${percentageFixed}%`;
};
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/index.tsx
import React, { useCallback, useMemo } from "react";
import { useSelector } from "react-redux";
import PromoProgress from "@tvg/atomic-ui/_molecule/PromoProgress";
import { getStoryblokPromos } from "@tvg/sh-lib-promos-onboarding/redux/selectors";
import { useNavigate } from "@tvg/custom-hooks";
import { Device } from "@tvg/ts-types/Device";
import { promoOnboardingCTAClickGTM } from "../../utils/gtm";
import { useCurrentProgress } from "./hooks/useCurrentProgress";
import { ProgressProps } from "../sharedComponentTypes";
export const PromoProgressComponent = ({
device = Device.MOBILE,
isDarkMode = false,
isHomePageSection = false
}: ProgressProps) => {
const history = useNavigate();
const storyblokPromos = useSelector(getStoryblokPromos);
const promoCurrentStatus = useCurrentProgress(history, storyblokPromos);
const handleCTA = useCallback(() => {
if (typeof promoCurrentStatus?.onCTAPress === "function") {
promoCurrentStatus.onCTAPress();
promoOnboardingCTAClickGTM(
promoCurrentStatus.CTALabel,
storyblokPromos.promotionId,
storyblokPromos.promoName
);
}
}, [promoCurrentStatus, storyblokPromos]);
return useMemo(
() =>
promoCurrentStatus && (
<PromoProgress
{...promoCurrentStatus}
device={device}
onCTAPress={handleCTA}
isDarkMode={isDarkMode}
isHomePageSection={isHomePageSection}
/>
),
[promoCurrentStatus, storyblokPromos]
);
};
export default PromoProgressComponent;
webpack://frontend-tpt/../../packages/tvg-lib-custom-hooks/hooks/useNavigate.ts
import {
useNavigate as useRouterNavigate,
useLocation
} from "react-router-dom";
const useNavigate = () => ({
push: useRouterNavigate(),
location: useLocation()
});
export default useNavigate;
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/components/progress/hooks/useCurrentProgress.ts
import { useEffect, useState } from "react";
import { History } from "@tvg/ts-types/History";
import { PromoOnboarding } from "@tvg/sh-lib-promos-onboarding/types/promoOnboarding";
import { PromoCurrentStatus } from "../types";
import { formatPromoCurrentStatus } from "../helpers/formatPromoCurrentStatus";
export const useCurrentProgress = (
history: History,
storyblokPromos: PromoOnboarding | null
) => {
const [promoCurrentStatus, setPromoCurrentStatus] =
useState<PromoCurrentStatus | null>(null);
useEffect(() => {
if (storyblokPromos) {
setPromoCurrentStatus(formatPromoCurrentStatus(storyblokPromos, history));
} else {
setPromoCurrentStatus(null);
}
}, [storyblokPromos]);
return promoCurrentStatus;
};
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/types.ts
import { StoryblokPlaceName } from "@tvg/sh-lib-promos-onboarding/types/promoOnboardingComponents";
import { Device } from "@tvg/ts-types/Device";
export interface Props {
placeToRender: StoryblokPlaceName;
componentName: InternalComponentNames;
isInternalComponent: boolean;
isDarkMode: boolean;
shouldUpdate: boolean;
device: Device;
isShown: boolean;
isHomePageSection: boolean;
previewContentId: string;
customMessage?: string;
}
export enum InternalComponentNames {
PROGRESS = "progress",
PREVIEW = "preview",
UNKNOWN = ""
}
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/utils/getInternalComponent.ts
import { createElement } from "react";
import { Device } from "@tvg/ts-types/Device";
import PromoPreviewComponent from "../components/preview";
import PromoProgressComponent from "../components/progress";
import { InternalComponentNames } from "../types";
import {
GenericProps,
PreviewProps,
ProgressProps
} from "../components/sharedComponentTypes";
export const getInternalComponent = (
componentName: InternalComponentNames,
device: Device = Device.MOBILE,
options: Partial<GenericProps> = {}
) => {
switch (componentName) {
case InternalComponentNames.PROGRESS: {
const { isDarkMode, isHomePageSection } = options as ProgressProps;
return createElement(PromoProgressComponent, {
isDarkMode: !!isDarkMode,
device,
isHomePageSection: !!isHomePageSection
});
}
case InternalComponentNames.PREVIEW: {
const { previewContentId } = options as PreviewProps;
return createElement(PromoPreviewComponent, {
previewContentId
});
}
default: {
return null;
}
}
};
export default getInternalComponent;
webpack://frontend-tpt/../../packages/tvg-comp-promos-onboarding/src/index.tsx
import { useSelector } from "react-redux";
import { Store } from "redux";
import {
getPromosOnboardingToggle,
getStoryblokCurrentStep,
getStoryblokPromoByPlace,
getStoryblokPromos
} from "@tvg/sh-lib-promos-onboarding/redux/selectors";
import { usePromosOnboardingComponent } from "@tvg/sh-lib-promos-onboarding/hooks/usePromosOnboardingComponent";
import { StoryblokPlaceName } from "@tvg/sh-lib-promos-onboarding/types/promoOnboardingComponents";
import tvgConf from "@tvg/conf";
import getInternalComponent from "./utils/getInternalComponent";
import { InternalComponentNames, Props } from "./types";
const PromosOnboarding = ({
placeToRender = StoryblokPlaceName.UNKNOWN,
isInternalComponent = false,
componentName = InternalComponentNames.UNKNOWN,
isDarkMode = false,
device,
isShown = true,
isHomePageSection = false,
previewContentId = "",
customMessage = ""
}: Partial<Props>) => {
const storyblokPromo = useSelector((store: Store) =>
placeToRender ? getStoryblokPromoByPlace(store, placeToRender) : null
);
const promoObject = useSelector((store: Store) => getStoryblokPromos(store));
const promoCurrentStep = useSelector((store: Store) =>
getStoryblokCurrentStep(store)
);
const promosOnboardingToggle = useSelector(getPromosOnboardingToggle);
const promoOnboardingComponent = !isInternalComponent
? usePromosOnboardingComponent(
storyblokPromo,
promoObject,
promoCurrentStep,
customMessage
)
: null;
if (!promosOnboardingToggle || !isShown) {
return null;
}
return isInternalComponent
? getInternalComponent(componentName, device || tvgConf().device, {
isDarkMode,
isHomePageSection,
previewContentId
})
: promoOnboardingComponent;
};
export default PromosOnboarding;
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/helpers/formatComponentWithDynamicVariables.ts
import { get } from "lodash";
import { PromoOnboarding } from "../types/promoOnboarding";
import { StorybookAvailableComponents } from "../types/promoOnboardingComponents";
import { PromoOnboardingStep } from "../types/promoSteps";
import { StoryblokComponentPropsFormatted } from "../types/storyblok";
import { formatStoryblokText } from "./formatStoryblokText";
export const formatComponentWithDynamicVariables = (
promoOnboardingComponent: StoryblokComponentPropsFormatted,
promo: PromoOnboarding,
currentStep: PromoOnboardingStep
): StoryblokComponentPropsFormatted => {
const formattedProps = Object.entries(
get(promoOnboardingComponent, "props", {})
).reduce((acc: StorybookAvailableComponents, [key, value]) => {
if (typeof value === "string") {
return {
...acc,
[key]: formatStoryblokText(value, promo, currentStep)
};
}
return { ...acc };
}, {});
return {
...promoOnboardingComponent,
props: formattedProps
} as StoryblokComponentPropsFormatted;
};
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/utils/matchWagerPropositions.ts
import { get, find } from "lodash";
import { parseISO, isSameDay } from "date-fns";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import { RaceTypeCodeEnum } from "@tvg/ts-types/Race";
import type { PromoOnboardingStep } from "../types/promoSteps";
import type { MyBetsWager } from "../types/wager";
export const validateWagerPlaced = (serialNumber: string) => !!serialNumber;
export const validateTrackCode = (promoTrackCode: string, trackCode: string) =>
promoTrackCode === "ALL" || promoTrackCode === trackCode;
export const validateTypeCode = (
promoWagerTypeCode: WagerTypeCodesEnum,
wagerTypeCode: WagerTypeCodesEnum | null
) => promoWagerTypeCode === wagerTypeCode;
export const validateRaceNumber = (
promoRaceNumber: number,
raceNumber: number
) => promoRaceNumber === 0 || promoRaceNumber === raceNumber;
export const validateBettingInterest = (
promoBettingInterest: number,
bettingInterests: number[]
) => {
if (promoBettingInterest === 0) {
return true;
}
return bettingInterests.includes(promoBettingInterest);
};
export const validateRaceDate = (
promoRaceDate: string | null,
raceDate: string
) =>
promoRaceDate === null ||
isSameDay(parseISO(promoRaceDate), parseISO(raceDate));
export const validateBreedType = (
promoRaceTypeCode: RaceTypeCodeEnum,
raceTypeCode: RaceTypeCodeEnum | null
) =>
promoRaceTypeCode === RaceTypeCodeEnum.ALL ||
promoRaceTypeCode === raceTypeCode;
export const matchWagerPropositions = (
step: PromoOnboardingStep,
wager: Partial<MyBetsWager>
) => {
const isWagerPlaced = validateWagerPlaced(get(step, "serialNumber", ""));
if (isWagerPlaced) {
return false;
}
const propositions = get(step, "wagerPropositions", []);
const matchProposition = find(propositions, (proposition) => {
const {
trackCode,
wagerTypeCode,
raceNumber,
bettingInterest,
raceDate,
breedTypeCode
} = proposition;
const isTrackCodeValid = validateTrackCode(
trackCode,
get(wager, "trackCode", "")
);
const isTypeCodeValid = validateTypeCode(
wagerTypeCode,
get(wager, "wagerTypeCode", null)
);
const isRaceNumberValid = validateRaceNumber(
raceNumber,
get(wager, "raceNumber", 0)
);
const isBettingInterestValid = validateBettingInterest(
bettingInterest,
get(wager, "bettingInterests", [])
);
const isRaceDateValid = validateRaceDate(
raceDate,
get(wager, "raceDate", "")
);
const isBreedTypeCodeValid = validateBreedType(
breedTypeCode,
get(wager, "breedTypeCode", null)
);
return (
isTrackCodeValid &&
isTypeCodeValid &&
isRaceNumberValid &&
isBettingInterestValid &&
isRaceDateValid &&
isBreedTypeCodeValid
);
});
return !!matchProposition;
};
webpack://frontend-tpt/../../node_modules/date-fns/esm/isSameDay/index.js
import startOfDay from '../startOfDay/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
/**
* @name isSameDay
* @category Day Helpers
* @summary Are the given dates in the same day?
*
* @description
* Are the given dates in the same day?
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* @param {Date|Number} dateLeft - the first date to check
* @param {Date|Number} dateRight - the second date to check
* @returns {Boolean} the dates are in the same day
* @throws {TypeError} 2 arguments required
*
* @example
* // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
* var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
* //=> true
*/
export default function isSameDay(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeftStartOfDay = startOfDay(dirtyDateLeft);
var dateRightStartOfDay = startOfDay(dirtyDateRight);
return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
}
webpack://frontend-tpt/../../packages/tvg-comp-my-bets-standalone/src/MyBetsWager.jsx
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState
} from "react";
import { get, isEmpty, noop } from "lodash";
import { connect } from "react-redux";
import useScratchNotification from "@tvg/sh-lib-my-bets/hooks/useScratchNotification";
import {
getFeatureUseTvgPotReturn,
getIsMyBetsOpen,
getPickBetRebetToggle,
getSelectedSettledTab,
getSelectedTab,
getTodayActiveCounter,
getTodaySettledCounter,
getMyBetsTrackRulesToggle,
getSocialShareToggle
} from "@tvg/sh-lib-my-bets/redux/selectors";
import { calculateShowBetsDetailedView } from "@tvg/sh-lib-my-bets/utils/betsBetCard";
import {
getRaceStatus,
shouldShowWillPays,
isPickBetSub
} from "@tvg/sh-lib-my-bets/utils/raceDetails";
import {
getFavoriteRunnerByLeg,
getScratchedLegNumbersIndex,
stringifySelections
} from "@tvg/sh-lib-my-bets/utils/pickBets";
import usePickBetRebet from "@tvg/sh-lib-my-bets/hooks/usePickBetRebet";
import {
expandCollapseLegGtm,
onApproxPayoutModalGtm,
onHideShowLegsGTM,
showTrackRulesGtm
} from "@tvg/sh-lib-my-bets/utils/gtm";
import {
checkAllDetailedViewIsOpen,
getSelectionLabel,
getWagerProps,
handleDetailsButton,
setShowContent
} from "@tvg/sh-lib-my-bets/utils/general";
import MyBetsWagerOrganism from "@tvg/atomic-ui/_organism/MyBetsWager";
import {
BetCard,
BetCardBody
} from "@tvg/atomic-ui/_organism/MyBetsWager/styled-components";
import MyBetsRunnerNumberGroup from "@tvg/atomic-ui/_molecule/MybetsRunnerNumberGroup";
import PromosOnboarding from "@tvg/promos-onboarding";
import useSelections from "@tvg/sh-lib-my-bets/hooks/useSelections";
import useMinMaxWillPays from "@tvg/sh-lib-my-bets/hooks/useMinMaxWillPays";
import useResults from "@tvg/sh-lib-my-bets/hooks/useResults";
import {
getStoryblokPromoByStep,
getStoryblokPromos
} from "@tvg/sh-lib-promos-onboarding/redux/selectors";
import { matchWagerPropositions } from "@tvg/sh-lib-promos-onboarding/utils/matchWagerPropositions";
import { matchPlacedWager } from "@tvg/sh-lib-promos-onboarding/utils/matchPlacedWager";
import { isFDR } from "@tvg/utils/generalUtils";
import { PromoStepType } from "@tvg/sh-lib-promos-onboarding/types/promoSteps";
export const MyBetsWager = (props) => {
const {
dispatch,
wager,
mainWagerDetails,
index,
useTvgPotReturnToggle,
selectedTab,
selectedSettledTab,
races,
raceNumber,
statusCode,
betAmount,
bettingInterests,
currentRaceDate,
allRacesFromTrack,
enablePickBetRebet,
modalScrollableRef,
activeBetsCounter,
settledBetsCounter,
closeModal,
raceUrl,
showContentObj,
setShowContentObj,
currentRace,
currentOpenLeg,
hasFooter,
onCancelWager,
hasDetails,
legStatusCode,
hasContentMaxHeight,
isKey,
isBox,
isMyBetsOpen,
isBetPlaced,
isBetConfirmation,
isInsideRaceOfficials,
betsNumber,
isDesktop,
myBetsTrackRulesToggle,
promosOnboardingObject,
promosOnboardingStep,
onShareWager,
socialShareModalToggle
} = props;
const {
wagerBetStatus,
isCurrentRaceDate,
isCanceled,
isActive,
currentWagerTypeCode,
isWagerCancelable,
isMultiRace,
isPickBet,
isExotic,
isBetWinner,
isOptedIn,
isWheel
} = getWagerProps(
wager,
legStatusCode || statusCode,
currentRaceDate,
get(mainWagerDetails, 0, ""),
currentRace
);
const selectionSize = get(wager, "selections.selection.length", 0);
const finalBettedLeg = currentRace
? +get(currentRace, "number", "0") + (selectionSize - 1)
: 0;
const betResults = [];
const betRefund = get(wager, "betRefund", 0);
const betStatusName = wagerBetStatus.name;
const betStatusCode = wagerBetStatus.code;
const betProbableValue = get(wager, "probable", "0");
if (allRacesFromTrack && allRacesFromTrack.length > 0 && raceNumber) {
for (let j = +raceNumber - 1; j < +raceNumber + selectionSize - 1; j += 1) {
if (allRacesFromTrack[j] && allRacesFromTrack[j].results) {
betResults.push(allRacesFromTrack[j].results);
}
}
}
const showWillPays =
currentRace && allRacesFromTrack && isMultiRace && betResults && !isCanceled
? shouldShowWillPays(
allRacesFromTrack,
wager.selections.selection,
betResults,
finalBettedLeg
)
: false;
const results = useResults({
allRacesFromTrack
});
const selections = useSelections({
wager,
isMultiRace,
raceNumber,
currentRace,
currentRaceDate,
finalBettedLeg,
showWillPays,
allRacesFromTrack,
currentWagerTypeCode,
isActive,
results,
isExotic
});
const hasAlternate = useMemo(() => {
return selections.some((selectionGroup) =>
selectionGroup.some((s) => !!s.alternate)
);
}, [selections]);
const { minWillPays, maxWillPays, showMinMaxWillPays } =
useMinMaxWillPays(selections);
const betCardRef = useRef(null);
const betCardBodyRef = useRef(null);
const [showBetsDetailedView, setShowBetsDetailedView] = useState(
calculateShowBetsDetailedView(selections, showWillPays)
);
const isCardBodyScrollable =
betCardBodyRef.current &&
betCardBodyRef.current.scrollHeight > betCardBodyRef.current.clientHeight;
// Scroll betCard inToView
const handleScrollPosition = useCallback(() => {
if (
betCardRef.current &&
modalScrollableRef &&
typeof betCardRef.current.scrollIntoView === "function" &&
typeof betCardRef.current.getBoundingClientRect === "function"
) {
setTimeout(() => {
// this headerOffset is based on modal header height + plus Tab height and or plus the timeframe height
const headerOffset = selectedTab === "SETTLED" ? 164 : 96;
const betCardBoundingClientRect =
betCardRef.current.getBoundingClientRect();
const screenHeight =
get(window, "innerHeight") ||
get(document, "documentElement.clientHeight", 0);
const isBetCardVisible =
betCardBoundingClientRect.top >= headerOffset &&
betCardBoundingClientRect.bottom <= screenHeight;
if (!isBetCardVisible) {
modalScrollableRef.scrollTo({
top: betCardRef.current.offsetTop - headerOffset,
behavior: "smooth"
});
}
}, 0);
}
}, [showBetsDetailedView]);
const [favoriteRunnerByLeg, setFavoriteRunnerByLeg] = useState([]);
const [autoOpenedWillPays, setAutoOpenedWillPays] = useState(false);
const hasLostOneLeg = useCallback(
() =>
selections.some(
(leg) =>
leg.some((sel) => sel.isWinner || sel.isWinner === null) === false
),
[selections]
);
const shouldShowPotentialReturn =
useTvgPotReturnToggle &&
!showWillPays &&
!hasLostOneLeg() &&
betProbableValue !== "0";
const shouldShowHideLegButton =
isMultiRace &&
hasLostOneLeg() &&
selectedTab === "ACTIVE" &&
!shouldShowPotentialReturn &&
!isInsideRaceOfficials;
const isDetailsOpened = checkAllDetailedViewIsOpen(showBetsDetailedView);
const hadScratchedRunner = getScratchedLegNumbersIndex(selections);
const [shouldRenderFooter, setShouldRenderFooter] = useState(true);
const repeatButtonSearch = useCallback(() => {
const newSelectionsWithoutScratch = selections.map((selection) =>
selection.reduce((accSelection, currSelection) => {
const runners = get(currSelection, "runners") || [];
if (runners.some((runner) => !runner.isScratched)) {
accSelection.push(currSelection);
}
return accSelection;
}, [])
);
return `?race=${raceNumber}&wt=${currentWagerTypeCode}&bet=${
wager.wagerAmount
}${stringifySelections(newSelectionsWithoutScratch)}&type=Repeat`;
}, [
currentWagerTypeCode,
raceNumber,
JSON.stringify(selections),
wager.wagerAmount
]);
useEffect(() => {
const willPaysFetched =
currentOpenLeg &&
!!get(
allRacesFromTrack,
`[${+currentOpenLeg.number - 1}].willPays`,
false
);
if (
!showBetsDetailedView.length ||
!get(showBetsDetailedView, "[0].length", true)
) {
setShowBetsDetailedView(
calculateShowBetsDetailedView(selections, showWillPays)
);
} else if (showWillPays && willPaysFetched && !autoOpenedWillPays) {
const newDetailedView = showBetsDetailedView.map(
(leg, legIndex) => legIndex === showBetsDetailedView.length - 1 || leg
);
setAutoOpenedWillPays(true);
setShowBetsDetailedView(newDetailedView);
}
}, [selectedTab, selections, showWillPays]);
useEffect(() => {
if (allRacesFromTrack) {
setFavoriteRunnerByLeg(
getFavoriteRunnerByLeg(
selections,
allRacesFromTrack,
+raceNumber,
wager.raceDate
)
);
}
}, [allRacesFromTrack, selections]);
useEffect(() => {
if (get(wager, "betStatus.code") === "R") {
const isCancelDataOpen = statusCode === "O";
const isCancelDataUpNext = statusCode === "IC";
setShouldRenderFooter(isCancelDataOpen || isCancelDataUpNext);
}
}, []);
useEffect(() => {
setShowBetsDetailedView(Array(selections.length).fill(false));
}, [showContentObj]);
const [
showScratchedNotification,
shouldNotHideScratchNotification,
setShouldNotHideScratchNotification,
scratchedTitle,
scratchedLegText
] = useScratchNotification({
selections,
isPickBet,
betStatusCode,
favoriteRunnerByLeg,
currentWagerTypeCode,
isCurrentRaceDate,
betRefund
});
const defaultScratchedText = "Scratch occurred.";
const [
handleRebetClickEvent,
rebetWagerTypeName,
rebetSearch,
shouldShowRebet
] = usePickBetRebet({
allRacesFromTrack,
mainWagerDetails,
currentRace,
currentOpenLeg,
callback: closeModal,
selections,
enablePickBetRebet,
isPickBet,
isCurrentRaceDate,
isSettledBet: selectedTab === "SETTLED"
});
const showRepeatButton =
!shouldShowRebet &&
!isWheel &&
(wager.cancelable ||
betStatusName === "canceled" ||
betStatusName === "active") &&
raceNumber &&
closeModal &&
raceUrl &&
betAmount !== undefined &&
(statusCode === "O" || statusCode === "IC") &&
selectedTab !== "FUTURES" &&
hadScratchedRunner.length === 0;
const renderedRunnerGroup = useCallback(() => {
return selections.map((selection, indexSelection, { length }) => {
const { key, label, pickBetsLabelLength } = getSelectionLabel({
selectionIndex: indexSelection,
selectionLength: length,
raceNumber: +raceNumber,
selectionsModifier: get(wager, "selections.modifier"),
isMultiRace,
isKey,
isBox,
isDesktop
});
const isAllRunnersScratched = selection.every((runner) =>
runner.runners.every((r) => r.isScratched)
);
const legContainsScratch = selection.some((runner) =>
runner.runners.every((r) => r.isScratched)
);
const betBettingInterests = [];
if (bettingInterests && bettingInterests.length > 0 && raceNumber) {
if (!isMultiRace) {
betBettingInterests.push(
get(
allRacesFromTrack.find((race) => +race.number === +raceNumber),
"bettingInterests",
bettingInterests[+raceNumber - 1]
)
);
} else {
for (
let i = isBetConfirmation ? 0 : +raceNumber;
i < +raceNumber + selectionSize;
i += 1
) {
const raceArrayIterator = isBetConfirmation ? i : i - 1;
if (bettingInterests[raceArrayIterator]) {
betBettingInterests.push(
get(
allRacesFromTrack.find((race) => +race.number === i),
"bettingInterests",
bettingInterests[raceArrayIterator]
)
);
}
}
}
}
const resultsIndex = isMultiRace ? indexSelection : 0;
const currentBettingInterestsLength = get(
betBettingInterests,
`${resultsIndex}.length`,
0
);
const allRunnersSelected =
currentBettingInterestsLength === selection.length;
const favoriteRunner = get(
favoriteRunnerByLeg,
indexSelection,
undefined
);
const allowsPickBetSub =
currentWagerTypeCode && isPickBetSub(currentWagerTypeCode);
const selectionRaceStatus = getRaceStatus({
isAllRunnersScratched,
legContainsScratch,
selection,
selectionIndex: indexSelection,
races: allRacesFromTrack,
raceNumber,
selectionLength: length,
isMultiRace,
isCanceled,
betStatusName,
wagerType: currentWagerTypeCode,
favoriteRunner,
shouldShowReplacement: allowsPickBetSub
});
const isBetRefund =
get(wager, "betRefund", 0) > 0 &&
(betStatusName === "winner" || betStatusName === "refunded");
const sortedSelection = selection.sort(
(a, b) => +a.runnerNumber - +b.runnerNumber
);
return (
<MyBetsRunnerNumberGroup
key={`runner-group${indexSelection.toString()}${get(
wager,
"id",
"unk"
)}`}
runners={sortedSelection}
raceTypeCode={wager.raceTypeAbbreviation}
isMultiRace={isMultiRace}
isExotic={isExotic}
isBetsStandalone
isBetsDetailedView={get(showBetsDetailedView, indexSelection, false)}
isKey={key}
label={label}
showHorizontalRule={length !== indexSelection + 1}
isFirstRowOfRunners={indexSelection === 0}
isLastRowOfRunners={indexSelection === length - 1}
wagerTypeCode={currentWagerTypeCode}
onDetailedView={() => {
const isOpened = get(showBetsDetailedView, indexSelection, false);
expandCollapseLegGtm(
isOpened ? "Closed Leg" : "Opened Leg",
indexSelection + 1,
selectedTab,
selectedSettledTab,
activeBetsCounter,
settledBetsCounter
);
setShowBetsDetailedView((prevShowedBets) => {
const updatedShowedBet = [...prevShowedBets];
updatedShowedBet[indexSelection] =
!prevShowedBets[indexSelection];
return updatedShowedBet;
});
}}
allRunnersSelected={allRunnersSelected}
hasDetails={hasDetails}
raceStatus={selectionRaceStatus}
betStatusName={betStatusName}
isPickBet={isPickBet}
isCanceled={isCanceled}
pickBetsLabelLength={pickBetsLabelLength}
favoriteRunner={favoriteRunner}
isCurrentRaceDate={isCurrentRaceDate}
isBetRefund={isBetRefund}
/>
);
});
}, [
selections,
raceNumber,
wager,
isMultiRace,
races,
raceNumber,
isCanceled,
betStatusName,
favoriteRunnerByLeg,
showBetsDetailedView,
currentWagerTypeCode,
selectedTab,
selectedSettledTab,
activeBetsCounter,
settledBetsCounter,
isPickBet,
isCurrentRaceDate,
isKey,
isBox
]);
const promosOnboardingProps = useMemo(() => {
const biNumbers = bettingInterests.reduce((previous, current) => {
return [...previous, ...(current || []).map((bi) => bi.biNumber)];
}, []);
const wagerData = {
bettingInterests: biNumbers,
raceNumber: currentRace.number,
breedTypeCode: get(wager, "raceTypeAbbreviation", ""),
raceDate: get(currentRace, "raceDate", ""),
trackCode: get(currentRace, "trackCode", ""),
wagerTypeCode: get(wager, "wagerType.code", ""),
serialNumber: get(wager, "serialNumber", "")
};
if (isBetConfirmation) {
const placeToRender = isBetPlaced
? "betslip_placed"
: "betslip_confirmation";
const shouldShowPromoOnboarding = promosOnboardingStep
? matchWagerPropositions(promosOnboardingStep, wagerData)
: false;
return { placeToRender, shouldShowPromoOnboarding };
}
const shouldShowPromoOnboarding = promosOnboardingStep
? matchPlacedWager(promosOnboardingStep, wagerData)
: false;
return { placeToRender: "bet_ticket", shouldShowPromoOnboarding };
}, [
wager,
currentRace,
isBetPlaced,
bettingInterests,
isBetConfirmation,
promosOnboardingStep
]);
const renderPromoOnboarding = useCallback(() => {
const wagerAmount = get(wager, "betTotal", 0);
const rebateLimit = get(promosOnboardingObject, "rebateLimit", 0);
const amountToShow = wagerAmount > rebateLimit ? rebateLimit : wagerAmount;
const customMessage = `$${amountToShow} in wagering credit will be refunded if you don't win.`;
const { placeToRender, shouldShowPromoOnboarding } = promosOnboardingProps;
return (
<PromosOnboarding
placeToRender={placeToRender}
customMessage={customMessage}
isShown={shouldShowPromoOnboarding}
/>
);
}, [promosOnboardingProps]);
return (
<MyBetsWagerOrganism
key={`wager-${get(wager, "id", index)}`}
wager={wager}
raceUrl={raceUrl}
closeModal={closeModal}
onApproxPayout={() =>
onApproxPayoutModalGtm(dispatch, {
selectedTab,
selectedSettledTab,
activeBetsCount: +activeBetsCounter,
settledBetsCount: +settledBetsCounter
})
}
showTrackRules={() =>
showTrackRulesGtm(
dispatch,
selectedTab,
selectedSettledTab,
currentWagerTypeCode,
hasAlternate
)
}
onHideShowLegsGTM={(isOpening) =>
onHideShowLegsGTM({
isOpening,
activeBets: activeBetsCounter,
settledBets: settledBetsCounter
})
}
showContent={get(showContentObj, wager.id, true)}
setShowContent={(value, id) =>
setShowContent(value, id, showContentObj, setShowContentObj)
}
betCardRef={betCardRef}
betCardBodyRef={betCardBodyRef}
isOptedIn={isOptedIn}
isBetActive={isActive}
betStatus={betStatusName}
isCanceled={isCanceled}
showBetsDetailedView={showBetsDetailedView}
betRefund={betRefund}
isBetWinner={isBetWinner}
probableValue={betProbableValue}
shouldShowHideLegButton={shouldShowHideLegButton}
shouldShowPotentialReturn={shouldShowPotentialReturn}
isDetailsOpened={isDetailsOpened}
handleDetailsButton={() =>
handleDetailsButton(
selectedTab,
selectedSettledTab,
isDetailsOpened,
showBetsDetailedView,
setShowBetsDetailedView,
selections,
handleScrollPosition
)
}
shouldRenderFooter={shouldRenderFooter}
isWagerCancelable={
isPickBet && currentOpenLeg
? isWagerCancelable && +currentOpenLeg.number === +raceNumber
: isWagerCancelable
}
repeatButtonSearch={repeatButtonSearch()}
showRepeatButton={!!showRepeatButton}
renderRunnerSelection={renderedRunnerGroup()}
showScratchedNotification={showScratchedNotification}
shouldNotHideScratchNotification={shouldNotHideScratchNotification}
setShouldNotHideScratchNotification={setShouldNotHideScratchNotification}
scratchedTitle={scratchedTitle}
scratchedLegText={
isInsideRaceOfficials ? defaultScratchedText : scratchedLegText
}
hasFooter={hasFooter}
onCancelWager={() => {
onCancelWager(wager);
}}
shouldShowRebet={shouldShowRebet && !isInsideRaceOfficials}
handleRebetClickEvent={handleRebetClickEvent}
rebetWagerTypeName={rebetWagerTypeName}
rebetSearch={rebetSearch}
hasContentMaxHeight={hasContentMaxHeight}
isMyBetsOpen={isMyBetsOpen}
betsNumber={betsNumber}
isCardBodyScrollable={isCardBodyScrollable}
showMinMaxWillPays={showMinMaxWillPays}
minWillPays={minWillPays}
maxWillPays={maxWillPays}
isScratchInfoDesign={myBetsTrackRulesToggle}
renderPromoOnboarding={renderPromoOnboarding()}
onShareWager={onShareWager}
socialShareModalToggle={socialShareModalToggle && !isInsideRaceOfficials}
isFDR={isFDR()}
/>
);
};
MyBetsWager.defaultProps = {
dispatch: noop,
wager: {},
mainWagerDetails: [],
index: -1,
useTvgPotReturnToggle: false,
selectedTab: "ACTIVE",
selectedSettledTab: "TODAY",
races: [],
raceNumber: 1,
statusCode: "O",
betAmount: 0,
bettingInterests: [],
raceDate: "",
currentRaceDate: "",
allRacesFromTrack: [],
enablePickBetRebet: false,
modalScrollableRef: null,
activeBetsCounter: 0,
settledBetsCounter: 0,
closeModal: noop,
raceUrl: "",
showContentObj: {},
setShowContentObj: noop,
currentRace: {},
currentOpenLeg: null,
hasFooter: false,
onCancelWager: noop,
hasDetails: false,
hasContentMaxHeight: false,
isKey: false,
isBox: false,
isMyBetsOpen: false,
isBetPlaced: false,
isBetConfirmation: false,
isInsideRaceOfficials: false,
betsNumber: 1,
promosOnboardingStep: null,
onShareWager: noop
};
export default connect(
(store) => ({
selectedTab: getSelectedTab(store),
isMyBetsOpen: getIsMyBetsOpen(store),
selectedSettledTab: getSelectedSettledTab(store),
activeBetsCounter: getTodayActiveCounter(store),
settledBetsCounter: getTodaySettledCounter(store),
enablePickBetRebet: getPickBetRebetToggle(store),
useTvgPotReturnToggle: getFeatureUseTvgPotReturn(store),
myBetsTrackRulesToggle: getMyBetsTrackRulesToggle(store),
promosOnboardingObject: getStoryblokPromos(store),
promosOnboardingStep: getStoryblokPromoByStep(store, PromoStepType.WAGER),
socialShareModalToggle: getSocialShareToggle(store)
}),
(dispatch) => ({ dispatch })
)(MyBetsWager);
webpack://frontend-tpt/../../node_modules/date-fns/esm/isEqual/index.js
import toDate from '../toDate/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
/**
* @name isEqual
* @category Common Helpers
* @summary Are the given dates equal?
*
* @description
* Are the given dates equal?
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* @param {Date|Number} dateLeft - the first date to compare
* @param {Date|Number} dateRight - the second date to compare
* @returns {Boolean} the dates are equal
* @throws {TypeError} 2 arguments required
*
* @example
* // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?
* var result = isEqual(
* new Date(2014, 6, 2, 6, 30, 45, 0),
* new Date(2014, 6, 2, 6, 30, 45, 500)
* )
* //=> false
*/
export default function isEqual(dirtyLeftDate, dirtyRightDate) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyLeftDate);
var dateRight = toDate(dirtyRightDate);
return dateLeft.getTime() === dateRight.getTime();
}
webpack://frontend-tpt/../../packages/sh-lib-my-bets/hooks/useResults.ts
import { useEffect, useState } from "react";
import { get } from "lodash";
import { RaceInfoMyBets, RaceInfoMyBetsResults } from "@tvg/ts-types/Race";
type Props = {
allRacesFromTrack: RaceInfoMyBets[];
};
function useResults(props: Props): Array<RaceInfoMyBetsResults> {
const { allRacesFromTrack } = props;
const [results, setResults] = useState<Array<RaceInfoMyBetsResults>>([]);
useEffect(() => {
if (allRacesFromTrack) {
setResults(
allRacesFromTrack.map((race) =>
get(race, "results", [] as RaceInfoMyBetsResults)
)
);
}
}, [allRacesFromTrack]);
return results;
}
export default useResults;
webpack://frontend-tpt/../../packages/sh-lib-my-bets/hooks/useSelections.ts
import { useEffect, useState, useMemo } from "react";
import { get, first } from "lodash";
import type { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import type { WroWager } from "@tvg/ts-types/WroWager";
import type { Selections } from "@tvg/ts-types/Selections";
import type { BettingInterests, BIPayouts, BIRunner } from "@tvg/ts-types/Bet";
import type {
RaceInfoMyBets,
RaceInfoMyBetsResults,
Willpay,
WillpayPayout
} from "@tvg/ts-types/Race";
import { BetSelection } from "@tvg/ts-types/Bet";
import { isFavoriteRunner } from "../utils/general";
import { getWinnerBI } from "../utils/raceDetails";
export interface Props {
wager: WroWager;
isMultiRace: boolean;
raceNumber: number;
currentRace?: RaceInfoMyBets;
currentRaceDate: string;
finalBettedLeg: number;
showWillPays: boolean;
allRacesFromTrack: RaceInfoMyBets[];
currentWagerTypeCode: WagerTypeCodesEnum;
isActive: boolean;
results: RaceInfoMyBetsResults[] | null;
isExotic: boolean;
}
export const getAlternateDetails = (
biRunner: BettingInterests,
allRacesFromTrack: RaceInfoMyBets[],
raceNumberIndex: number
) => {
const selectedBI = get(
allRacesFromTrack,
`${raceNumberIndex}.bettingInterests`,
[]
).find((bi: BettingInterests) => bi.biNumber === biRunner.biNumber);
const runners = (biRunner?.runners || []).map((currentRunner: BIRunner) => ({
runnerId: currentRunner.runnerId,
runnerName: currentRunner.horseName,
saddleColor: selectedBI?.saddleColor,
numberColor: selectedBI?.numberColor,
isScratched: currentRunner.scratched,
isAlternate: true,
currentOdds: selectedBI?.currentOdds
}));
const isWinner = get(biRunner, "isWinner", null);
return { ...biRunner, isWinner, runners };
};
function useSelections({
wager,
isMultiRace,
raceNumber,
currentRace,
currentRaceDate,
finalBettedLeg,
showWillPays,
allRacesFromTrack,
currentWagerTypeCode,
isActive,
isExotic
}: Props): BetSelection[][] {
const initialSelections = useMemo(
() =>
get(wager, "selections.selection", []).map(
(selection: Selections, selectionIndex: number) => {
const currentRaceNumberIndex = isMultiRace
? +raceNumber - 1 + selectionIndex
: +raceNumber - 1;
const alternate = selection.alternateBettingInterest
? getAlternateDetails(
selection.alternateBettingInterest,
allRacesFromTrack,
currentRaceNumberIndex
)
: null;
return selection.bettingInterests.map(
(biRunner: BettingInterests) => {
const biNumber = get(biRunner, "biNumber", 0);
const selectedBI = get(
allRacesFromTrack,
`${currentRaceNumberIndex}.bettingInterests`,
[]
).find(
(bi: BettingInterests) => bi.biNumber === biRunner.biNumber
);
const currentOdds = get(biRunner, "currentOdds", {});
const runners = get(biRunner, "runners") || [];
const runnersDetails = runners.map((currentRunner: BIRunner) => ({
runnerId: currentRunner.runnerId,
runnerName: currentRunner.horseName,
saddleColor: selectedBI?.saddleColor,
numberColor: selectedBI?.numberColor,
isScratched: currentRunner.scratched,
isAlternate: false
}));
const payouts = get(biRunner, "payouts") || [];
let isWinner = get(biRunner, "isWinner", null);
let willPayAmount = 0;
let isFavorite = false;
if (!isMultiRace) {
isFavorite = isFavoriteRunner(
currentRaceDate,
biNumber,
currentRace
);
if (payouts.length > 0) {
willPayAmount = payouts.reduce(
(willPaysAmount: number, currentPayout: BIPayouts) =>
willPaysAmount + currentPayout.amount,
0
);
}
} else {
const finalLegWillPays = get(
allRacesFromTrack,
`${finalBettedLeg - 1}.willPays`
);
const currentLeg = get(
allRacesFromTrack,
currentRaceNumberIndex
);
if (isWinner === null && isActive) {
const raceResultsPath = `${currentRaceNumberIndex}.results`;
const currentRaceResults = get(
allRacesFromTrack,
raceResultsPath
);
if (currentRaceResults && currentRaceResults.runners) {
const winnersBI = getWinnerBI(
currentRaceResults,
(isExotic ? currentRaceNumberIndex : 0) + 1
);
isWinner =
!!winnersBI &&
!!winnersBI.find(
(winnerBi) => winnerBi.biNumber === biNumber
);
}
}
if (showWillPays && finalLegWillPays) {
const willPays = first<Willpay>(
finalLegWillPays.filter(
(currentWillPays: Willpay) =>
currentWillPays.type.code === currentWagerTypeCode
)
);
const willPayDetails = first<WillpayPayout>(
(get(willPays, "payouts") || []).filter(
(payout: WillpayPayout) =>
+payout.bettingInterestNumber === biNumber
)
);
if (willPays && willPayDetails) {
willPayAmount =
(+willPayDetails.payoutAmount / +willPays.wagerAmount) *
+wager.wagerAmount;
}
}
if (currentLeg) {
isFavorite = isFavoriteRunner(
currentRaceDate,
biNumber,
currentLeg
);
}
}
return {
runnerNumber: biNumber,
runners: runnersDetails,
alternate,
willPayAmount,
payouts,
currentOdds,
isFavorite,
isWinner
};
}
);
}
),
[
wager,
allRacesFromTrack,
isMultiRace,
raceNumber,
currentRaceDate,
finalBettedLeg,
showWillPays,
currentWagerTypeCode,
isActive,
isExotic,
currentRace
]
);
const [selections, setSelections] =
useState<BetSelection[][]>(initialSelections);
useEffect(() => {
setSelections(initialSelections);
}, [initialSelections]);
return selections;
}
export default useSelections;
webpack://frontend-tpt/../../packages/sh-lib-my-bets/hooks/useMinMaxWillPays.ts
import { useEffect, useState } from "react";
import { BetSelection } from "@tvg/ts-types/Bet";
const useMinMaxWillPays = (selections: BetSelection[][]) => {
const [minWillPays, setMinWillPays] = useState(0);
const [maxWillPays, setMaxWillPays] = useState(0);
const [showMinMaxWillPays, setShowMinMaxWillPays] = useState(false);
useEffect(() => {
setMinWillPays(
Math.min(
...selections.map((selection) =>
selection.reduce(
(min, sel) =>
sel.willPayAmount === 0
? min
: Math.min(min, sel.willPayAmount || Infinity),
Infinity
)
)
)
);
setMaxWillPays(
Math.max(
...selections.map((selection) =>
selection.reduce(
(max, sel) => Math.max(max, sel.willPayAmount || 0),
0
)
)
)
);
setShowMinMaxWillPays(minWillPays > 0 && maxWillPays > 0);
}, [selections, minWillPays, maxWillPays]);
return {
minWillPays,
maxWillPays,
showMinMaxWillPays
};
};
export default useMinMaxWillPays;
webpack://frontend-tpt/../../packages/sh-lib-my-bets/hooks/useScratchNotification.ts
import { Dispatch, SetStateAction, useEffect, useState } from "react";
import { BetSelection, BetStatusCodesEnum } from "@tvg/ts-types/Bet";
import { FavoriteRunners } from "@tvg/ts-types/Race";
import { WagerTypeCodesEnum } from "@tvg/ts-types/Wager";
import {
checkLegForScratchedFavorite,
checkScratchedLegsForFavorite,
getScratchedLegNumbersIndex,
getScratchedRunnersByLeg,
stringifyLegScratches
} from "../utils/pickBets";
import { isPickBetSub } from "../utils/raceDetails";
export type ScratchNotification = {
selections: BetSelection[][];
isPickBet: boolean;
betStatusCode: BetStatusCodesEnum;
favoriteRunnerByLeg: FavoriteRunners;
currentWagerTypeCode: WagerTypeCodesEnum;
isCurrentRaceDate: boolean;
betRefund: number;
};
export const useScratchNotification = ({
selections,
isPickBet,
betStatusCode,
favoriteRunnerByLeg,
currentWagerTypeCode,
isCurrentRaceDate,
betRefund
}: ScratchNotification): [
boolean,
boolean,
Dispatch<SetStateAction<boolean>>,
string,
string,
boolean
] => {
const [showScratchedNotification, setShowScratchedNotification] =
useState(false);
const [
shouldNotHideScratchNotification,
setShouldNotHideScratchNotification
] = useState(true);
const [scratchedTitle, setScratchedTitle] = useState("");
const [scratchedLegText, setScratchedLegText] = useState("");
const [hasAlternates, setHasAlternates] = useState(false);
// Handle show notification
useEffect(() => {
const scratchedLegsByIndex = getScratchedLegNumbersIndex(selections);
const showScratched =
!!scratchedLegsByIndex.length &&
(isPickBet || betStatusCode !== "A") &&
betStatusCode !== "C";
setShowScratchedNotification(showScratched);
if (selections) {
setHasAlternates(
selections.flat().some((selection) => !!selection.alternate)
);
}
}, [isPickBet, betStatusCode, selections]);
useEffect(() => {
const scratchedRunnersByLeg = getScratchedRunnersByLeg(selections);
const scratchedLegsByIndex = getScratchedLegNumbersIndex(selections);
const verifiedReplacementsByLegIndex = checkLegForScratchedFavorite(
scratchedLegsByIndex || [],
favoriteRunnerByLeg,
scratchedRunnersByLeg
);
const isPickBetReplacementEligible =
isPickBetSub(currentWagerTypeCode) &&
checkScratchedLegsForFavorite(
scratchedLegsByIndex,
favoriteRunnerByLeg
) &&
verifiedReplacementsByLegIndex.length > 0;
if (isPickBet && betStatusCode === "A") {
setScratchedTitle("Runner Scratched");
if (scratchedLegsByIndex.length > 1) {
setScratchedLegText(
`Scratches occurred in Legs ${stringifyLegScratches(
scratchedLegsByIndex
)}`
);
} else {
setScratchedLegText(
`Scratch occurred in Leg ${scratchedLegsByIndex[0] + 1}`
);
}
}
if (betStatusCode !== "A") {
if (isPickBetReplacementEligible && isCurrentRaceDate) {
setScratchedTitle("Scratch Replacement");
if (verifiedReplacementsByLegIndex.length > 1) {
setScratchedLegText(
`Selections in Legs ${stringifyLegScratches(
verifiedReplacementsByLegIndex
)} were replaced.`
);
} else {
setScratchedLegText(
`Selection in Leg ${
verifiedReplacementsByLegIndex[0] + 1
} was replaced`
);
}
} else if (
isPickBet &&
betRefund > 0 &&
(betStatusCode === "W" || betStatusCode === "R")
) {
setScratchedTitle("Scratch Refund");
if (verifiedReplacementsByLegIndex.length > 1) {
setScratchedLegText(
`Selections in Legs ${stringifyLegScratches(
scratchedLegsByIndex
)} were refunded.`
);
} else {
setScratchedLegText(
`Selection in Leg ${scratchedLegsByIndex[0] + 1} was refunded`
);
}
} else if (
betRefund > 0 &&
(betStatusCode === "W" || betStatusCode === "R")
) {
setScratchedTitle("Scratch Refund");
setScratchedLegText(
"Due to a scratch on certain selections, you have received a refund."
);
} else if (isPickBet && betRefund === 0) {
setScratchedTitle("Runner Scratched");
if (scratchedLegsByIndex.length > 1) {
setScratchedLegText(
`Scratches occurred in Legs ${stringifyLegScratches(
scratchedLegsByIndex
)}`
);
} else {
setScratchedLegText(
`Scratch occurred in Leg ${scratchedLegsByIndex[0] + 1}`
);
}
} else {
setScratchedTitle("Runner Scratched");
setScratchedLegText("Scratch occurred.");
}
}
}, [selections, betStatusCode, isCurrentRaceDate, isPickBet, betRefund]);
return [
showScratchedNotification,
shouldNotHideScratchNotification,
setShouldNotHideScratchNotification,
scratchedTitle,
scratchedLegText,
hasAlternates
];
};
export default useScratchNotification;
webpack://frontend-tpt/../../packages/sh-lib-promos-onboarding/utils/matchPlacedWager.ts
import { get } from "lodash";
import { WagerStep } from "../types/promoSteps";
import type { MyBetsWager } from "../types/wager";
export const validateSerialNumber = (
promoSerialNumber: string,
wagerSerialNumber: string
) =>
!!promoSerialNumber && promoSerialNumber.trim() === wagerSerialNumber.trim();
export const matchPlacedWager = (
step: WagerStep,
wager: Partial<MyBetsWager>
) => {
const promoSerialNumber = get(step, "serialNumber", "");
const wagerSerialNumber = get(wager, "serialNumber", "");
return validateSerialNumber(promoSerialNumber, wagerSerialNumber);
};
webpack://frontend-tpt/../../packages/sh-lib-my-bets/redux/actions.ts
import { RaceInfoMyBets } from "@tvg/ts-types/Race";
import {
ActiveTabEnum,
SettledTabEnum,
ActiveBetsInfoType,
OnBetCancelPayload,
OnRacePageBetCancelPayload,
OnBetCancelClosePayload,
StatusFilters,
MyBetsDynamicFilters,
OnBetSocialSharePayload,
MyBetsPastPerformanceTab
} from "../utils/types";
type ModalOpen = {
type: "OPEN_MYBETS_STANDALONE";
};
type ModalClose = {
type: "CLOSE_MYBETS_STANDALONE";
};
type SetActiveBetsAction = {
type: "SET_ACTIVE_BETS_MYBETS_STANDALONE";
payload: ActiveBetsInfoType;
};
type SetActiveBetsActionLegacy = {
type: "MYBETS_GET_ACTIVE_BETS";
payload: ActiveBetsInfoType;
};
type SetSelectedTab = {
type: "SET_SELECTED_TAB_MYBETS_STANDALONE";
payload: ActiveTabEnum;
};
type SetSelectedSettledTab = {
type: "SET_SELECTED_SETTLED_TAB_MYBETS_STANDALONE";
payload: SettledTabEnum;
};
type SetCounter = {
type: "SET_COUNTER_MYBETS_STANDALONE";
payload: number;
};
type SetSettledCounter = {
type: "SET_SETTLED_COUNTER_MYBETS_STANDALONE";
payload: number;
};
type SetFutureCounter = {
type: "SET_FUTURE_COUNTER_MYBETS_STANDALONE";
payload: number;
};
type SetActiveWageredAmount = {
type: "SET_ACTIVE_WAGERED_AMOUNT_MYBETS_STANDALONE";
payload: number;
};
type SetSettledWageredAmount = {
type: "SET_SETTLED_WAGERED_AMOUNT_MYBETS_STANDALONE";
payload: number;
};
type SetFutureWageredAmount = {
type: "SET_FUTURE_WAGERED_AMOUNT_MYBETS_STANDALONE";
payload: number;
};
export type BetCancelOpenModalAction = {
type: "OPEN_BET_CANCEL_MODAL";
payload?: OnBetCancelPayload | OnRacePageBetCancelPayload;
};
export type SocialShareOpenModalAction = {
type: "OPEN_BET_SOCIAL_SHARE_MODAL";
payload: OnBetSocialSharePayload;
};
export type SocialShareCloseModalAction = {
type: "CLOSE_BET_SOCIAL_SHARE_MODAL";
};
export type BetCancelUpdateModalAction = {
type: "MY_BETS_UPDATING_RACES";
payload: RaceInfoMyBets[];
};
export type BetCancelCloseModalAction = {
type: "CLOSE_BET_CANCEL_MODAL";
payload?: OnBetCancelClosePayload;
};
export type BetCancelLoadingModalActionOn = {
type: "LOADING_BET_CANCEL_MODAL_ON";
};
export type BetCancelLoadingModalActionOff = {
type: "LOADING_BET_CANCEL_MODAL_OFF";
};
export type BetCancelLoadingModalActionError = {
type: "LOADING_BET_CANCEL_MODAL_ERROR";
payload: string;
};
export type CleanBetCancelResultAction = {
type: "CLEAN_BET_CANCEL_RESULT";
};
export type OpenApproxPayoutModalAction = {
type: "OPEN_APPROX_PAYOUT_MODAL";
};
export type CloseApproxPayoutModalAction = {
type: "CLOSE_APPROX_PAYOUT_MODAL";
};
export type CloseWagerCancellationRulesModalAction = {
type: "CLOSE_WAGER_CANCELLATION_RULES_MODAL";
};
export type OpenWagerCancellationRulesModalAction = {
type: "OPEN_WAGER_CANCELLATION_RULES_MODAL";
payload: { hasBack: boolean };
};
type SetLoadMoreWagerGroups = {
type: "SET_LOAD_MORE_WAGER_GROUPS";
payload: boolean;
};
export type OpenTrackRulesModalAction = {
type: "OPEN_TRACK_RULES_MODAL";
payload: { betType: string; alternates?: boolean };
};
export type CloseTrackRulesModalAction = {
type: "CLOSE_TRACK_RULES_MODAL";
};
export type SelectedRace = {
trackCode: string;
raceNumber: number;
raceDate: string;
};
export type OpenMyBetsPastPerformance = {
type: "OPEN_MYBETS_PAST_PERFORMANCE";
payload: {
selectedRace: SelectedRace;
modalTitle: string;
selectedTab?: MyBetsPastPerformanceTab;
hasBack: boolean;
};
};
export type CloseMyBetsPastPerfomance = {
type: "CLOSE_MYBETS_PAST_PERFORMANCE";
};
export type IsLoadingAction = {
type: "IS_LOADING_MYBETS";
payload: {
isLoading: boolean;
};
};
export type SelectStatusFiltersAction = {
type: "SELECT_MYBETS_STATUS_FILTERS";
payload: {
statusFilter: StatusFilters;
};
};
export type ClearStatusFiltersAction = {
type: "CLEAR_MYBETS_STATUS_FILTERS";
};
export type SetStatusFilterCount = {
type: "SET_MYBETS_STATUS_FILTER_COUNT";
payload: {
count: number;
};
};
export type SelectTrackFiltersAction = {
type: "SELECT_MYBETS_TRACKS_FILTERS";
payload: {
trackFilter: MyBetsDynamicFilters;
};
};
export type ClearTrackFiltersAction = {
type: "CLEAR_MYBETS_TRACKS_FILTERS";
};
export type SetTrackFilterCount = {
type: "SET_MYBETS_TRACKS_FILTER_COUNT";
payload: {
count: number;
};
};
export type SetBetTypeFiltersAction = {
type: "SET_MYBETS_BET_TYPE_FILTERS";
payload: {
betTypeFilter: MyBetsDynamicFilters;
};
};
export type SetBetTypeFilterCount = {
type: "SET_MYBETS_BET_TYPE_FILTER_COUNT";
payload: {
count: number;
};
};
export type SetCustomEndDate = {
type: "SET_MYBETS_CUSTOM_END_DATE";
payload: {
date: Date | null;
};
};
export type SetCustomStartDate = {
type: "SET_MYBETS_CUSTOM_START_DATE";
payload: {
date: Date | null;
};
};
export type SetIsCustomTimeFrame = {
type: "SET_MYBETS_IS_CUSTOM_TIMEFRAME";
payload: {
isCustomTimeFrame: boolean;
};
};
export type SetIsDefaultSettled = {
type: "SET_SHOULD_DEFAULT_TO_SETTLED";
payload: {
isDefaultSettled: boolean;
};
};
export type SetIsDefaultFuture = {
type: "SET_SHOULD_DEFAULT_TO_FUTURE";
payload: {
isDefaultFuture: boolean;
};
};
export type SetRacesActiveBetsStandalone = {
type: "SET_RACES_ACTIVE_BETS_STANDALONE";
payload: Record<number, number>;
};
export type Actions =
| ModalOpen
| ModalClose
| SetActiveBetsAction
| SetSelectedTab
| SetSelectedSettledTab
| SetCounter
| SetSettledCounter
| SetFutureCounter
| BetCancelCloseModalAction
| BetCancelOpenModalAction
| BetCancelLoadingModalActionOn
| BetCancelLoadingModalActionOff
| BetCancelLoadingModalActionError
| CleanBetCancelResultAction
| OpenApproxPayoutModalAction
| CloseApproxPayoutModalAction
| OpenWagerCancellationRulesModalAction
| SetLoadMoreWagerGroups
| CloseWagerCancellationRulesModalAction
| OpenTrackRulesModalAction
| CloseTrackRulesModalAction
| OpenMyBetsPastPerformance
| CloseMyBetsPastPerfomance
| IsLoadingAction
| BetCancelUpdateModalAction
| SetActiveWageredAmount
| SetSettledWageredAmount
| SetFutureWageredAmount
| SelectStatusFiltersAction
| ClearStatusFiltersAction
| SetStatusFilterCount
| SelectTrackFiltersAction
| ClearTrackFiltersAction
| SetTrackFilterCount
| SetBetTypeFiltersAction
| SetBetTypeFilterCount
| SetCustomStartDate
| SetCustomEndDate
| SetIsCustomTimeFrame
| SetIsDefaultSettled
| SetIsDefaultFuture
| SocialShareOpenModalAction
| SocialShareCloseModalAction
| SetRacesActiveBetsStandalone;
export const openMyBetsStandalone = (): ModalOpen => ({
type: "OPEN_MYBETS_STANDALONE"
});
export const closeMyBetsStandalone = (): ModalClose => ({
type: "CLOSE_MYBETS_STANDALONE"
});
export const setRacesActiveBetsStandalone = (
payload: Record<number, number>
): SetRacesActiveBetsStandalone => ({
type: "SET_RACES_ACTIVE_BETS_STANDALONE",
payload
});
export const setActiveBetsInfoMyBetsStandalone = (
activeBetsInfo: ActiveBetsInfoType
): SetActiveBetsAction => ({
type: "SET_ACTIVE_BETS_MYBETS_STANDALONE",
payload: activeBetsInfo
});
export const setSelectedTabMyBetsStandalone = (
selectedTab: ActiveTabEnum
): SetSelectedTab => ({
type: "SET_SELECTED_TAB_MYBETS_STANDALONE",
payload: selectedTab
});
export const setSelectedSettledTabMyBetsStandalone = (
selectedSettledTab: SettledTabEnum
): SetSelectedSettledTab => ({
type: "SET_SELECTED_SETTLED_TAB_MYBETS_STANDALONE",
payload: selectedSettledTab
});
export const setCounterMyBetsStandalone = (total: number): SetCounter => ({
type: "SET_COUNTER_MYBETS_STANDALONE",
payload: total
});
export const setSettledCounterMyBetsStandalone = (
total: number
): SetSettledCounter => ({
type: "SET_SETTLED_COUNTER_MYBETS_STANDALONE",
payload: total
});
export const setActiveWagerAmountMyBetsStandalone = (
totalAmount: number
): SetActiveWageredAmount => ({
type: "SET_ACTIVE_WAGERED_AMOUNT_MYBETS_STANDALONE",
payload: totalAmount
});
export const setSettledWagerAmountMyBetsStandalone = (
totalAmount: number
): SetSettledWageredAmount => ({
type: "SET_SETTLED_WAGERED_AMOUNT_MYBETS_STANDALONE",
payload: totalAmount
});
export const setFutureCounterMyBetsStandalone = (
total: number
): SetFutureCounter => ({
type: "SET_FUTURE_COUNTER_MYBETS_STANDALONE",
payload: total
});
export const setFutureWageredAmountMyBetsStandalone = (
totalAmount: number
): SetFutureWageredAmount => ({
type: "SET_FUTURE_WAGERED_AMOUNT_MYBETS_STANDALONE",
payload: totalAmount
});
export const loadingBetCancelModalOn = (): BetCancelLoadingModalActionOn => ({
type: "LOADING_BET_CANCEL_MODAL_ON"
});
export const loadingBetCancelModalOff = (): BetCancelLoadingModalActionOff => ({
type: "LOADING_BET_CANCEL_MODAL_OFF"
});
export const betCancelRequestError = ({
payload
}: {
payload: string;
}): BetCancelLoadingModalActionError => ({
type: "LOADING_BET_CANCEL_MODAL_ERROR",
payload
});
export const closeBetCancelModal = (
payload?: OnBetCancelClosePayload
): BetCancelCloseModalAction => ({
type: "CLOSE_BET_CANCEL_MODAL",
payload
});
export const updateRacesMyBets = (
races: RaceInfoMyBets[]
): BetCancelUpdateModalAction => ({
type: "MY_BETS_UPDATING_RACES",
payload: races
});
export const openBetCancelModal = (
payload?: OnBetCancelPayload | OnRacePageBetCancelPayload
): BetCancelOpenModalAction => ({
type: "OPEN_BET_CANCEL_MODAL",
payload
});
export const openBetSocialShareModal = (
payload: OnBetSocialSharePayload
): SocialShareOpenModalAction => ({
type: "OPEN_BET_SOCIAL_SHARE_MODAL",
payload
});
export const closeBetSocialShareModal = (): SocialShareCloseModalAction => ({
type: "CLOSE_BET_SOCIAL_SHARE_MODAL"
});
export const cleanBetCancelResult = () => ({
type: "CLEAN_BET_CANCEL_RESULT"
});
export const closeApproxPayoutModal = () => ({
type: "CLOSE_APPROX_PAYOUT_MODAL"
});
export const openApproxPayoutModal = () => ({
type: "OPEN_APPROX_PAYOUT_MODAL"
});
export const openWagerCancellationRulesModal = (payload: {
hasBack: boolean;
}): OpenWagerCancellationRulesModalAction => ({
type: "OPEN_WAGER_CANCELLATION_RULES_MODAL",
payload
});
export const closeWagerCancellationRulesModal =
(): CloseWagerCancellationRulesModalAction => ({
type: "CLOSE_WAGER_CANCELLATION_RULES_MODAL"
});
export const openTrackRulesModal = (payload: {
betType: string;
alternates?: boolean;
}): OpenTrackRulesModalAction => ({
type: "OPEN_TRACK_RULES_MODAL",
payload
});
export const closeTrackRulesModal = (): CloseTrackRulesModalAction => ({
type: "CLOSE_TRACK_RULES_MODAL"
});
export const openMybetsPastPerformance = (
selectedRace: SelectedRace,
modalTitle: string,
selectedTab?: MyBetsPastPerformanceTab,
hasBack = true
): OpenMyBetsPastPerformance => ({
type: "OPEN_MYBETS_PAST_PERFORMANCE",
payload: {
selectedRace,
modalTitle,
selectedTab,
hasBack
}
});
export const closeMybetsPastPerformance = (): CloseMyBetsPastPerfomance => ({
type: "CLOSE_MYBETS_PAST_PERFORMANCE"
});
export const isLoadingMyBets = (isLoading: boolean): IsLoadingAction => ({
type: "IS_LOADING_MYBETS",
payload: {
isLoading
}
});
export const selectStatusFilters = (
statusFilter: StatusFilters
): SelectStatusFiltersAction => ({
type: "SELECT_MYBETS_STATUS_FILTERS",
payload: {
statusFilter
}
});
export const clearStatusFilters = (): ClearStatusFiltersAction => ({
type: "CLEAR_MYBETS_STATUS_FILTERS"
});
export const setStatusFilterCount = (count: number): SetStatusFilterCount => ({
type: "SET_MYBETS_STATUS_FILTER_COUNT",
payload: {
count
}
});
export const selectTrackFilters = (
trackFilter: MyBetsDynamicFilters
): SelectTrackFiltersAction => ({
type: "SELECT_MYBETS_TRACKS_FILTERS",
payload: {
trackFilter
}
});
export const setTrackFilterCount = (count: number): SetTrackFilterCount => ({
type: "SET_MYBETS_TRACKS_FILTER_COUNT",
payload: {
count
}
});
export const setBetTypeFilters = (
betTypeFilter: MyBetsDynamicFilters
): SetBetTypeFiltersAction => ({
type: "SET_MYBETS_BET_TYPE_FILTERS",
payload: {
betTypeFilter
}
});
export const setBetTypeFilterCount = (
count: number
): SetBetTypeFilterCount => ({
type: "SET_MYBETS_BET_TYPE_FILTER_COUNT",
payload: {
count
}
});
export const setCustomEndDate = (date: Date): SetCustomEndDate => ({
type: "SET_MYBETS_CUSTOM_END_DATE",
payload: {
date
}
});
export const setCustomStartDate = (date: Date | null): SetCustomStartDate => ({
type: "SET_MYBETS_CUSTOM_START_DATE",
payload: {
date
}
});
export const setIsCustomTimeFrame = (
isCustomTimeFrame: boolean
): SetIsCustomTimeFrame => ({
type: "SET_MYBETS_IS_CUSTOM_TIMEFRAME",
payload: {
isCustomTimeFrame
}
});
export const setShouldDefaultToSettled = (
isDefaultSettled: boolean
): SetIsDefaultSettled => ({
type: "SET_SHOULD_DEFAULT_TO_SETTLED",
payload: { isDefaultSettled }
});
export const setShouldDefaultToFuture = (
isDefaultFuture: boolean
): SetIsDefaultFuture => ({
type: "SET_SHOULD_DEFAULT_TO_FUTURE",
payload: { isDefaultFuture }
});
export const setActiveBetsInfo = (
payload: ActiveBetsInfoType
): SetActiveBetsActionLegacy => ({
type: "MYBETS_GET_ACTIVE_BETS",
payload
});
export const setRacesActiveBets = (payload: Record<number, number>) => ({
type: "MYBETS_GET_RACES_ACTIVE_BETS",
payload
});
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RaceLink/styled-components.js
import styled from "styled-components";
import { Link } from "react-router-dom";
import MTP from "../../_atom/MTP";
import { buildText } from "../../_atom/Text";
import { buildTitle } from "../../_atom/Title";
import buildColor from "../../_static/ColorPalette";
export const buildRaceLinkContainer = (isDark) => styled(Link).attrs({
"data-qa-label": "raceLink"
})`
display: flex;
align-items: center;
padding: 8px 12px 8px 0;
min-height: 40px;
text-decoration: none;
outline: none;
color: ${isDark ? buildColor("white", "100") : buildColor("grey", "900")};
background-color: ${isDark
? buildColor("blue", "700")
: buildColor("white", "100")};
&:active {
background-color: ${buildColor("blue", "000")};
}
`;
export const buildRaceContainer = (isDark) =>
buildRaceLinkContainer(isDark).withComponent("div");
export const RaceMTP = styled(MTP).attrs({
isHighlightedBellowThreshold: true
})`
flex: 0;
`;
export const buildRaceInfo = (isDark) => styled.dl`
display: flex;
flex-direction: column;
min-width: 0;
align-self: stretch;
align-items: center;
justify-content: center;
margin: 0;
flex: 1;
overflow: hidden;
padding-left: 8px;
border-left: 1px solid
${isDark ? buildColor("blue", "500") : buildColor("blue", "100")};
`;
export const RaceTitle = styled.dt`
display: flex;
align-items: center;
width: 100%;
margin: 0;
`;
export const RaceDescription = styled.dd`
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
width: 100%;
padding: 0;
margin: 1px 0 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
& *:not(:last-child) {
margin-right: 3px;
}
`;
export const RaceTitleWrapper = styled.div`
min-width: 0;
height: 16px;
line-height: 18px;
`;
export const RaceNumber = styled(
buildTitle({
tag: "h4",
fontSize: 15,
bold: true,
qaLabel: "raceLink-raceNumber"
})
)`
white-space: nowrap;
height: 16px;
line-height: 18px;
padding-left: 6px;
`;
export const GreyhoundText = styled(
buildText({
fontSize: 10,
uppercase: true,
bold: true,
qaLabel: "raceLink-greyhound"
})
)`
margin-top: 2px;
`;
export const OptionsWrapper = styled.div`
display: flex;
flex-wrap: wrap;
margin-top: 3px;
`;
export const Title = buildTitle({
tag: "h3",
fontSize: 15,
bold: true,
ellipsis: true,
uppercase: true,
qaLabel: "raceLink-trackName"
});
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/RaceLink/index.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import buildRaceUrl from "@tvg/formatter/url";
import { buildText } from "../../_atom/Text";
import TextHighlighted from "../../_atom/TextHighlighted";
import buildColor from "../../_static/ColorPalette";
import {
buildRaceLinkContainer,
buildRaceContainer,
buildRaceInfo,
RaceMTP,
RaceTitle,
RaceDescription,
RaceTitleWrapper,
RaceNumber,
GreyhoundText,
OptionsWrapper,
Title
} from "./styled-components";
const buildRaceOption = (
isDark,
description,
color,
bold = true,
uppercase = true
) => {
const Text = buildText({
fontSize: 12,
color,
bold,
uppercase,
qaLabel: "raceLink-description"
});
return <Text key="description">{description}</Text>;
};
const buildRaceHighlightedOption = (key, description, type, size, qaLabel) => (
<TextHighlighted
key={key}
type={type}
size={size}
uppercase
bold
qaLabel={qaLabel}
>
{description}
</TextHighlighted>
);
export default class RaceLink extends PureComponent {
static defaultProps = {
mtp: 0,
postTime: "",
status: "O",
isGreyhound: false,
trackAbbr: "",
trackName: "",
trackShortName: "",
raceNumber: "1",
importanceLevel: "",
description: "",
onTvg: false,
onTvg2: false,
isDark: false,
isLink: true,
showRaceDate: false,
isMtpHighlightedBellowThreshold: true,
onRaceClickGTM: noop,
closePreviousModal: noop
};
renderRaceOptions() {
const raceOptions = [];
if (this.props.description.length) {
switch (this.props.importanceLevel) {
case "0":
raceOptions.push(
buildRaceOption(
this.props.isDark,
this.props.description,
buildColor("grey", "800")
)
);
break;
case "1":
raceOptions.push(
buildRaceOption(
this.props.isDark,
this.props.description,
this.props.isDark
? buildColor("white", "100")
: buildColor("blue", "500")
)
);
break;
case "2":
raceOptions.push(
buildRaceHighlightedOption(
"description",
this.props.description,
"marketing",
11,
"raceLink-descriptionLabel"
)
);
break;
case "3":
raceOptions.push(
buildRaceOption(
this.props.isDark,
this.props.description,
buildColor("grey", "800"),
false,
false
)
);
break;
default:
break;
}
}
if (this.props.onTvg) {
raceOptions.push(
buildRaceHighlightedOption(
"On TVG",
"On TVG",
"secondary",
11,
"raceLink-onTvgLabel"
)
);
} else if (this.props.onTvg2) {
raceOptions.push(
buildRaceHighlightedOption(
"On TVG2",
"On TVG2",
"secondary",
11,
"raceLink-onTvg2Label"
)
);
}
return (
(raceOptions.length > 0 || this.props.isGreyhound) && (
<RaceDescription>
{this.props.isGreyhound && (
<GreyhoundText
color={
this.props.isDark
? buildColor("white", "100")
: buildColor("grey", "800")
}
>
Greyhounds
</GreyhoundText>
)}
{raceOptions.length > 0 && (
<OptionsWrapper>{raceOptions}</OptionsWrapper>
)}
</RaceDescription>
)
);
}
render() {
const RaceContainer = this.props.isLink
? buildRaceLinkContainer(this.props.isDark)
: buildRaceContainer(this.props.isDark);
const url = buildRaceUrl(
this.props.trackAbbr,
this.props.trackName,
this.props.raceNumber
);
const gtmNavigationData = {
trackName: this.props.trackName,
number: this.props.raceNumber,
mtp: this.props.mtp,
isGreyhound: this.props.isGreyhound,
url
};
const handleRaceContainerClick = () => {
this.props.onRaceClickGTM(gtmNavigationData);
this.props.closePreviousModal(gtmNavigationData);
};
const raceContainerProps = this.props.isLink
? {
to: buildRaceUrl(
this.props.trackAbbr,
this.props.trackName,
this.props.raceNumber
),
onClick: () => handleRaceContainerClick()
}
: {};
const RaceInfo = buildRaceInfo(this.props.isDark);
return (
<RaceContainer {...raceContainerProps} onTouchStart={noop}>
<RaceMTP
mtp={this.props.mtp}
postTime={this.props.postTime}
status={this.props.status}
showRaceDate={this.props.showRaceDate}
multipleLine
isHighlightedBellowThreshold={
this.props.isMtpHighlightedBellowThreshold
}
/>
<RaceInfo>
<RaceTitle>
<RaceTitleWrapper>
<Title>{this.props.trackShortName || this.props.trackName}</Title>
</RaceTitleWrapper>
<RaceNumber>R{this.props.raceNumber}</RaceNumber>
</RaceTitle>
{this.renderRaceOptions()}
</RaceInfo>
</RaceContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/MyBetsCard/styled-components.js
import styled from "styled-components";
import buildColor from "../../_static/ColorPalette";
export const BetCardWrapper = styled.div`
display: flex;
flex-direction: column;
background-color: ${buildColor("white", "100")};
`;
export const BetCardRaceHeaderContainer = styled.div`
display: flex;
flex: 1 0 auto;
flex-direction: column;
justify-content: center;
text-decoration: none;
color: ${buildColor("grey", "800")};
padding: 12px;
`;
export const WagersList = styled.ul.attrs({
"data-qa-label": "myBets-betTicket-list"
})`
padding: 0 12px 12px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MyBetsCardHeader/styled-components.js
import styled, { css } from "styled-components";
import { Link } from "react-router-dom";
import buildColor from "../../_static/ColorPalette";
import {
fontNormal,
fontMedium,
fontBold,
defaultSize
} from "../../_static/Typography";
import Button from "../../_atom/Buttons/button";
const wrapper = `
display: flex;
justify-content: space-between;
flex: 1;
`;
export const RaceHeaderContainer = styled.div`
display: flex;
flex-direction: column;
`;
export const RaceHeaderWrapper = styled(Link)`
outline: none;
color: inherit;
text-decoration: inherit;
${wrapper}
`;
export const RaceWatchReplayWrapper = styled.div`
margin-top: 12px;
${wrapper}
`;
export const RaceHeaderInfo = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
text-decoration: none;
margin-right: 12px;
overflow: hidden;
`;
export const RaceFeaturedEventName = styled.div`
font-family: ${fontBold};
font-size: 14px;
color: ${buildColor("yellow", "800")};
`;
export const RaceTrackNameWrapper = styled.div`
display: flex;
flex-direction: row;
font-family: ${fontBold};
font-size: 16px;
color: ${buildColor("grey", "900")};
line-height: 22px;
white-space: pre;
`;
export const RaceTrackName = styled.div`
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;
export const RaceTrackNumber = styled.div``;
export const RaceBetsInfo = styled.div`
margin-top: 4px;
font-family: ${fontNormal};
font-size: 14px;
color: ${buildColor("grey", "800")};
line-height: 18px;
`;
export const RaceHeaderActions = styled.div`
display: flex;
align-items: center;
> a,
> button {
min-width: 125px;
}
> * {
&:first-child {
margin-left: 0;
}
margin-left: 12px;
}
`;
export const VideoButtonIconWrapper = styled.span`
display: flex;
margin-right: 8px;
`;
export const RepeatBetButton = styled(Button).attrs({
size: "bigger",
isBold: false,
isUppercase: false,
type: "non_styled",
fontFamily: fontMedium
})`
color: ${buildColor("blue_accent", "500")};
font-size: ${defaultSize};
min-width: 0;
padding: 0;
background: "transparent";
> span {
justify-content: flex-end;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MyBetsMTP/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import { fontMedium } from "../../_static/Typography";
export const RaceStatus = styled.div`
display: flex;
font-size: 14px;
${(props) =>
props.device === "desktop"
? css`
flex-direction: column;
& > span {
color: ${buildColor("grey", "800")};
}
`
: css`
margin-bottom: 4px;
`};
time {
line-height: 19px;
${(props) =>
props.device === "desktop" &&
css`
display: inline;
& > span {
white-space: normal;
}
`}
}
`;
export const LegStatus = styled.span`
font-family: ${fontMedium};
font-size: 14px;
line-height: 19px;
margin-right: 4px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MyBetsMTP/index.jsx
import React from "react";
import { formatPeriod, formatPostTime, formatRaceDate } from "@tvg/formatter";
import { LegStatus, RaceStatus } from "./styled-components";
import { PlainMTPText } from "../../_atom/MTP/styled-components";
import MTP from "../../_atom/MTP";
const MyBetsMTP = (props) => {
const {
qaLabel,
showRaceLeg,
legNumber,
isFutureBet,
raceDate,
currentDate,
raceMtp,
racePostTime,
raceStatusCode,
raceDateDiff,
isMTPNewRules,
device
} = props;
return (
<RaceStatus data-qa-label={`${qaLabel}-wrapper`} device={device}>
{showRaceLeg && legNumber > 0 && (
<LegStatus data-qa-label={`${qaLabel}-leg-status`}>{`Leg ${legNumber} ${
device === "desktop" ? "" : "-"
}`}</LegStatus>
)}
{isFutureBet && raceDate && raceDate !== currentDate ? (
<PlainMTPText data-qa-label={qaLabel}>
{`${formatPostTime(racePostTime)} `}
{formatPeriod(racePostTime)} - {formatRaceDate(raceDate)}
</PlainMTPText>
) : (
<MTP
mtp={raceMtp}
postTime={racePostTime}
status={raceStatusCode}
dateDiff={raceDateDiff}
isPlainMTP
isMyBets
isMTPNewRules={isMTPNewRules}
/>
)}
</RaceStatus>
);
};
MyBetsMTP.defaultProps = {
qaLabel: "mybets-mtp",
showRaceLeg: false,
legNumber: 1,
isFutureBet: false,
raceDate: "",
currentDate: "",
raceMtp: 60,
racePostTime: "",
raceStatusCode: "O",
raceDateDiff: "",
isMTPNewRules: true,
device: "mobile"
};
export default MyBetsMTP;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/MyBetsCardHeader/index.jsx
import React from "react";
import { noop } from "lodash";
import { Link } from "react-router-dom";
import { formatPastRaceDate } from "@tvg/formatter/dates";
import formatCurrency from "@tvg/formatter/currency";
import ButtonLink from "../../_atom/Buttons/buttonLink";
import Icon from "../../_static/Icons";
import { play } from "../../_static/Icons/iconsDuotone";
import { hasReplay } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
import {
RaceHeaderContainer,
RaceHeaderWrapper,
RaceWatchReplayWrapper,
RaceHeaderInfo,
RaceTrackNameWrapper,
RaceTrackName,
RaceTrackNumber,
RaceFeaturedEventName,
RaceBetsInfo,
RaceHeaderActions,
VideoButtonIconWrapper,
RepeatBetButton
} from "./styled-components";
import MyBetsMTP from "../MyBetsMTP";
import Button from "../../_atom/Buttons/button";
const getBetsInfo = (betAmount, bets) => {
const betTitle = `Bet${bets > 1 ? "s" : ""}`;
return `${bets} ${betTitle} • ${formatCurrency(betAmount)} staked`;
};
const getButtonProps = (hasReplayVideo) =>
hasReplayVideo
? {
text: "Watch Replay",
type: "primary",
hasIcon: true,
hasShadow: false
}
: {
text: "See Result",
type: "secondary",
hasIcon: false,
hasShadow: true
};
const renderVideoButton = (
raceUrl,
currentRaceNumber,
showRaceNumber,
isRaceNear,
onVideoRedirect
) => {
const [racePathname] = raceUrl.split("?");
const iconColor = isRaceNear
? buildColor("white", "100")
: buildColor("blue_accent", "500");
return (
<ButtonLink
url={{
pathname: racePathname,
search: `?race=${currentRaceNumber}`,
state: {
openVideo: true
}
}}
onClick={onVideoRedirect}
qaLabel="watch-video-button"
size="bigger"
isBold={false}
isUppercase={false}
type={isRaceNear ? "primary" : "secondary"}
hasShadow={!isRaceNear}
>
<VideoButtonIconWrapper>
<Icon
icon={play}
size={14}
viewBoxSize={20}
color={buildColor("white", "0")}
stroke={iconColor}
/>
</VideoButtonIconWrapper>
Watch {showRaceNumber ? `R${currentRaceNumber}` : "Live"}
</ButtonLink>
);
};
const renderRedirectReplayButton = (
raceUrl,
hasReplayVideo,
onWatchReplay,
closeModal
) => {
const [racePathname, raceSearch] = raceUrl.split("?");
const buttonProps = getButtonProps(hasReplayVideo);
return (
<RaceWatchReplayWrapper>
<ButtonLink
isStretched
size="bigger"
isBold={false}
isUppercase={false}
url={{
pathname: racePathname,
search: raceSearch,
state: {
openVideo: true
}
}}
onClick={() => {
onWatchReplay(false);
closeModal();
}}
qaLabel="watch-video-button"
hasRoundedCorners
type={buttonProps.type}
hasShadow={buttonProps.hasShadow}
>
{buttonProps.hasIcon && (
<VideoButtonIconWrapper>
<Icon
icon={hasReplay}
size={15}
color={buildColor("white", "100")}
/>
</VideoButtonIconWrapper>
)}
{buttonProps.text}
</ButtonLink>
</RaceWatchReplayWrapper>
);
};
const renderReplayButton = (
onWatchReplay,
isReplayInsideMyBets,
hasReplayVideo,
raceUrl,
showSeeResult,
closeModal
// eslint-disable-next-line consistent-return
) => {
if (!isReplayInsideMyBets && hasReplayVideo) {
return renderRedirectReplayButton(
raceUrl,
hasReplayVideo,
onWatchReplay,
closeModal
);
}
if (showSeeResult || isReplayInsideMyBets) {
const buttonProps = getButtonProps(hasReplayVideo);
return (
<RaceWatchReplayWrapper>
<Button
isStretched
size="bigger"
isBold={false}
isUppercase={false}
onClick={onWatchReplay}
qaLabel="watch-video-button"
hasRoundedCorners
type={buttonProps.type}
hasShadow={buttonProps.hasShadow}
>
{buttonProps.hasIcon && (
<VideoButtonIconWrapper>
<Icon
icon={hasReplay}
size={15}
color={buildColor("white", "100")}
/>
</VideoButtonIconWrapper>
)}
{buttonProps.text}
</Button>
</RaceWatchReplayWrapper>
);
}
};
const MyBetsCardHeader = (props) => {
const {
racePostTime,
statusCode,
trackName,
eventName,
raceNumber,
currentRaceNumber,
mtp,
bets,
betAmount,
dateDiff,
winningsAmount,
raceUrl,
closeModal,
onWatchReplay,
isFutureBet,
raceDate,
isMTPNewRules,
hasReplayVideo,
hasLiveVideo,
postTime,
showRaceLeg,
legNumber,
onVideoRedirect,
isReplayInsideMyBets,
showBetInfo,
qaLabel,
hasPastPerformance,
isRaceNear,
showSeeResult,
isMyBetsOpen,
hasRepeatBet,
onRepeatBet,
isSpecialWager
} = props;
return (
<RaceHeaderContainer data-qa-label={qaLabel}>
<RaceHeaderWrapper
data-qa-label={`${qaLabel}-details`}
as={dateDiff === 0 && isMyBetsOpen ? Link : "div"}
to={raceUrl}
onClick={closeModal}
>
<RaceHeaderInfo data-qa-label={`${qaLabel}-info`}>
<MyBetsMTP
showRaceLeg={showRaceLeg}
legNumber={legNumber}
isFutureBet={isFutureBet}
raceDate={raceDate}
postTime={postTime}
currentDate={formatPastRaceDate(postTime || "")}
raceMtp={mtp}
racePostTime={racePostTime}
raceStatusCode={statusCode}
raceDateDiff={dateDiff}
isMTPNewRules={isMTPNewRules}
qaLabel={`${qaLabel}-mtp`}
/>
{eventName && (
<RaceFeaturedEventName data-qa-label={`${qaLabel}-event-name`}>
{eventName}
</RaceFeaturedEventName>
)}
<RaceTrackNameWrapper data-qa-label={`${qaLabel}-track-name`}>
<RaceTrackName> {trackName}</RaceTrackName>
{raceNumber && !isSpecialWager && (
<RaceTrackNumber>{` R${raceNumber}`}</RaceTrackNumber>
)}
</RaceTrackNameWrapper>
{showBetInfo && (
<RaceBetsInfo data-qa-label={`${qaLabel}-bets-info`}>
{getBetsInfo(betAmount, bets)}
</RaceBetsInfo>
)}
</RaceHeaderInfo>
<RaceHeaderActions data-qa-label={`${qaLabel}-header-actions`}>
{hasLiveVideo &&
renderVideoButton(
raceUrl,
currentRaceNumber,
!!legNumber,
isRaceNear,
onVideoRedirect
)}
{hasRepeatBet && (
<RepeatBetButton onClick={onRepeatBet} qaLabel="repeat-bet-link">
Repeat bet
</RepeatBetButton>
)}
</RaceHeaderActions>
</RaceHeaderWrapper>
{hasPastPerformance &&
renderReplayButton(
onWatchReplay,
isReplayInsideMyBets,
hasReplayVideo,
raceUrl,
showSeeResult,
closeModal
)}
</RaceHeaderContainer>
);
};
MyBetsCardHeader.defaultProps = {
racePostTime: "2020-11-04T17:00:00Z",
statusCode: "O",
trackName: "",
eventName: "",
raceNumber: 1,
mtp: 60,
bets: 0,
betAmount: 0,
dateDiff: 0,
winningsAmount: 0,
raceUrl: "",
closeModal: noop,
onWatchReplay: noop,
isFutureBet: false,
raceDate: "",
isMTPNewRules: true,
hasReplayVideo: false,
hasLiveVideo: false,
postTime: "",
showRaceLeg: false,
legNumber: 1,
onVideoRedirect: noop,
isReplayInsideMyBets: true,
showBetInfo: false,
qaLabel: "mybets-card-header",
hasPastPerformance: true,
isRaceNear: false,
currentRaceNumber: 1,
showSeeResult: false,
isMyBetsOpen: false,
hasRepeatBet: false,
onRepeatBet: noop
};
export default MyBetsCardHeader;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/MyBetsCard/index.jsx
import React from "react";
import { noop } from "lodash";
import {
BetCardWrapper,
BetCardRaceHeaderContainer,
WagersList
} from "./styled-components";
import MyBetsCardHeader from "../../_molecule/MyBetsCardHeader";
const MyBetsCard = (props) => {
const {
children,
dateDiff,
closeModal,
onWatchReplay,
index,
isReplayInsideMyBets,
isMTPNewRules,
intersectableRef,
itemToRef,
racePostTime,
trackName,
mtp,
statusCode,
legStatusCode,
raceNumber,
raceUrl,
betsNumber,
betAmount,
winningsAmount,
hasReplayVideo,
hasLiveVideo,
onVideoRedirect,
showBetInfoHeader,
isFutureBet,
raceDate,
qaLabel,
showRaceLeg,
legNumber,
hasPastPerformance,
isRaceNear,
currentRaceNumber,
showSeeResult,
isMyBetsOpen,
hasRepeatBet,
onRepeatBet,
isSpecialWager
} = props;
return (
<BetCardWrapper
data-qa-label={qaLabel}
id={`activebet-${index}`}
ref={index === itemToRef ? intersectableRef : null}
>
<BetCardRaceHeaderContainer data-qa-label={`${qaLabel}-header-container`}>
<MyBetsCardHeader
showBetInfo={showBetInfoHeader}
racePostTime={racePostTime}
trackName={trackName}
mtp={mtp}
statusCode={legStatusCode || statusCode}
raceNumber={raceNumber}
bets={betsNumber}
betAmount={betAmount}
dateDiff={dateDiff}
winningsAmount={winningsAmount}
raceUrl={raceUrl}
closeModal={closeModal}
onWatchReplay={onWatchReplay}
isReplayInsideMyBets={isReplayInsideMyBets}
isFutureBet={isFutureBet}
raceDate={raceDate}
isMTPNewRules={isMTPNewRules}
hasReplayVideo={hasReplayVideo}
hasLiveVideo={hasLiveVideo}
onVideoRedirect={onVideoRedirect}
showRaceLeg={showRaceLeg}
legNumber={legNumber}
hasPastPerformance={hasPastPerformance}
isRaceNear={isRaceNear}
currentRaceNumber={currentRaceNumber}
showSeeResult={showSeeResult}
isMyBetsOpen={isMyBetsOpen}
hasRepeatBet={hasRepeatBet}
onRepeatBet={onRepeatBet}
isSpecialWager={isSpecialWager}
/>
</BetCardRaceHeaderContainer>
<WagersList>{children}</WagersList>
</BetCardWrapper>
);
};
MyBetsCard.defaultProps = {
children: null,
dateDiff: 0,
closeModal: noop,
onWatchReplay: noop,
index: -1,
isReplayInsideMyBets: true,
isMTPNewRules: true,
intersectableRef: null,
itemToRef: 0,
racePostTime: "",
trackName: "",
mtp: 60,
statusCode: "O",
raceNumber: 1,
raceUrl: "",
betsNumber: 0,
betAmount: 0,
winningsAmount: 0,
hasReplayVideo: false,
hasLiveVideo: false,
onVideoRedirect: noop,
showBetInfoHeader: false,
isFutureBet: false,
raceDate: "",
qaLabel: "mybets-bets-race-card",
showRaceLeg: false,
legNumber: 0,
hasPastPerformance: false,
isRaceNear: false,
currentRaceNumber: 1,
legStatusCode: null,
showSeeResult: false,
isMyBetsOpen: false,
hasRepeatBet: false,
onRepeatBet: noop
};
export default MyBetsCard;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/BetConfirmation/styled-components.js
import styled, { css } from "styled-components";
import DefaultButton from "../../_atom/Buttons/default";
import MessageBox from "../../_molecule/MessageBox";
import buildColor from "../../_static/ColorPalette";
export const WarningMessage = styled(MessageBox)`
min-height: 40px;
display: flex;
`;
export const Wrapper = styled.div`
position: relative;
background-color: ${buildColor("white", "100")};
`;
export const ConfirmationButtonContainer = styled.div`
padding: 8px;
${(props) =>
props.hasTopMargin &&
css`
margin-top: 8px;
`};
${({ hasFlexDisplay }) =>
hasFlexDisplay &&
css`
display: flex;
align-items: center;
justify-content: space-between;
`}
text-align: right;
background-color: ${buildColor("blue", "000")};
border-top: 1px solid ${buildColor("grey", "300")};
position: sticky;
left: 0;
right: 0;
bottom: 0;
`;
export const Container = styled.div``;
export const BetSummaryContainer = styled.div`
padding: 0 8px;
overflow-y: scroll;
`;
export const RetainButton = styled(DefaultButton)`
font-size: 12px;
background-color: ${buildColor("white", "0")};
color: ${buildColor("blue_accent", "500")};
margin-right: 20px;
font-weight: bold;
`;
export const WarningMessageWrapper = styled.div`
padding: 8px 8px 0;
`;
export const WagerAmountContainer = styled.span`
font-size: 14px;
font-weight: bold;
`;
export const TotalAmountText = styled.strong`
font-size: 14px;
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/BetConfirmation/index.jsx
import React, { Component, Fragment } from "react";
import { bindAll, noop, isEqual, get } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import tvgConf from "@tvg/conf";
import MyBetsWager from "@tvg/my-bets-standalone/src/MyBetsWager";
import { Icon as DSIcon } from "@tvg/design-system";
import Button from "../../_atom/Buttons/button";
import ProcessingOverlay from "../../_static/ProcessingOverlay";
import RaceLink from "../../_molecule/RaceLink";
import BetSummary from "../../_molecule/BetSummary";
import MyBetsCard from "../../_organism/MyBetsCard";
import {
Wrapper,
ConfirmationButtonContainer,
BetSummaryContainer,
RetainButton,
WarningMessageWrapper,
WagerAmountContainer,
TotalAmountText,
WarningMessage,
Container
} from "./styled-components";
import { FooterButton } from "../../_molecule/MyBetsWagerFooter/styled-components";
import buildColor from "../../_static/ColorPalette";
export class BetConfirmation extends Component {
static defaultProps = {
postTime: "",
mtp: 0,
raceNumber: "1",
raceTypeCode: "T",
trackName: "",
isGreyhound: false,
betTotal: 0,
isCancelable: false,
wagerAmount: 0,
wagerTypeName: "",
wagerCode: "",
selections: [],
onConfirmation: noop,
feedbackState: "none",
feedbackMessage: "placing bet...",
isKey: false,
isLeg: false,
isBox: false,
isBetPlaced: false,
isBettingError: false,
isProcessing: false,
hasRaceAlertsBar: false,
errorBetMessage: "",
onRetain: noop,
onBackToRace: noop,
confirmText: "Confirm $amount Bet",
favoriteRunners: [],
repetitionsNr: 1,
onRepeatClick: noop,
hasRepeaterEnabled: false,
renderRaceAlerts: noop,
showMyBetsCardDesign: false,
probableValue: "",
showRepeatButton: true,
bettingInterests: [],
socialShareModalToggle: false,
onShareWager: noop
};
constructor(props) {
super(props);
this.state = {
isLoading: false
};
bindAll(this, [
"handleConfirmation",
"renderButtons",
"renderBetSummary",
"renderLegacyBetSummary"
]);
}
shouldComponentUpdate(nextProps, nextState) {
return (
this.state.isLoading !== nextState.isLoading ||
this.props.selections.length !== nextProps.selections.length ||
this.props.repetitionsNr !== nextProps.repetitionsNr ||
this.props.hasRaceAlertsBar !== nextProps.hasRaceAlertsBar ||
!isEqual(this.props, nextProps)
);
}
handleConfirmation() {
this.setState({ isLoading: true });
this.props.onConfirmation();
}
renderButtons() {
if (this.props.isBetPlaced && !this.props.isBettingError) {
return (
<Fragment>
{this.props.socialShareModalToggle && (
<FooterButton
data-qa-label="myBets-social-share"
onClick={() => this.props.onShareWager()}
>
<DSIcon
name="popout"
size="s"
lineColor={buildColor("blue", "900")}
/>
{tvgConf().device === "mobile" && "Share"}
</FooterButton>
)}
<Container>
<RetainButton
onClick={this.props.onRetain}
qaLabel="betConfirmation-retainRunnersBtn"
>
RETAIN RUNNERS
</RetainButton>
<Button
onClick={this.props.onBackToRace}
type="primary"
size="big"
qaLabel="betConfirmation-backToRaceBtn"
>
BACK TO RACE
</Button>
</Container>
</Fragment>
);
}
if (this.props.isBettingError) {
return (
<Button
type="primary"
size="big"
isStretched
onClick={this.props.onRetain}
qaLabel="betConfirmation-closeBtn"
>
close
</Button>
);
}
return (
<Button
type="bet"
size="big"
isStretched
onClick={this.handleConfirmation}
qaLabel="betConfirmation-confirmationButton"
>
<WagerAmountContainer>
<span>{this.props.confirmText.split("$amount")[0]}</span>
<TotalAmountText>
{formatCurrency(get(this.props, "betTotal", 0))}
</TotalAmountText>
<span>{this.props.confirmText.split("$amount")[1]}</span>
</WagerAmountContainer>
</Button>
);
}
renderBetSummary() {
return (
<MyBetsCard
showBetInfoHeader={false}
showRaceLeg={this.props.isLeg}
mtp={this.props.mtp}
isRaceNear={this.props.mtp <= 5}
isReplayInsideMyBets={
this.props.hasRepeaterEnabled && !this.props.isBettingError
}
isMTPNewRules
racePostTime={this.props.postTime}
trackName={this.props.trackName}
raceNumber={+this.props.raceNumber}
legNumber={1}
betsNumber={this.props.repetitionsNr}
betAmount={this.props.betTotal}
dateDiff={this.props.dateDiff}
hasRepeatBet={this.props.showRepeatButton}
onRepeatBet={this.props.onRepeatClick}
>
<MyBetsWager
wager={this.props.wager}
raceNumber={+this.props.raceNumber}
betAmount={this.props.betTotal}
bettingInterests={this.props.bettingInterests}
hasFooter={false}
hasDetails={false}
isKey={this.props.isKey}
isBox={this.props.isBox}
isBetPlaced={this.props.isBetPlaced}
isBetConfirmation
betsNumber={this.props.repetitionsNr}
/>
</MyBetsCard>
);
}
renderLegacyBetSummary() {
return (
<React.Fragment>
<RaceLink
mtp={this.props.mtp}
postTime={this.props.postTime}
trackName={this.props.trackName}
raceNumber={this.props.raceNumber}
isGreyhound={this.props.isGreyhound}
isLink={false}
/>
<BetSummaryContainer>
<BetSummary
isCancelable={false}
isRepeatable
betTotal={this.props.betTotal}
favoriteRunners={this.props.favoriteRunners}
selectionTypeName={this.props.wagerTypeName}
wagerAmount={this.props.wagerAmount}
selections={this.props.selections}
raceTypeCode={this.props.raceTypeCode}
isKey={this.props.isKey}
isLeg={this.props.isLeg}
raceNumber={this.props.raceNumber}
isVertical
repetitionsNr={this.props.repetitionsNr}
onRepeatClick={this.props.onRepeatClick}
hasRepeaterEnabled={
this.props.hasRepeaterEnabled && !this.props.isBettingError
}
/>
</BetSummaryContainer>
</React.Fragment>
);
}
renderFeedback() {
let message = get(this.props, "errorBetMessage");
let type = "error";
let title = "";
if (this.props.hasFeedback) {
type = get(this.props, "feedbackType", "error");
message = !this.props.partialFailure ? (
<span data-qa-label="repeatBets-infoMessage">
<span
dangerouslySetInnerHTML={{
__html: this.props.feedbackMsg
}}
/>
</span>
) : (
<span data-qa-label="repeatBets-infoMessage">
{this.props.partialInfo}
<br />
<span
dangerouslySetInnerHTML={{
__html: this.props.partialInfoDetails
}}
/>
</span>
);
title = this.props.feedbackTitle;
}
return (
<WarningMessageWrapper>
<WarningMessage
title={title}
type={type}
message={message}
qaLabel="bet-confirmation-warning"
/>
</WarningMessageWrapper>
);
}
render() {
return (
<Fragment>
{this.props.isProcessing && <ProcessingOverlay />}
<Wrapper data-qa-label="betConfirmation">
{(this.props.isBettingError || this.props.hasFeedback) &&
this.renderFeedback()}
{this.props.showMyBetsCardDesign
? this.renderBetSummary()
: this.renderLegacyBetSummary()}
{this.props.hasRaceAlertsBar && this.props.renderRaceAlerts()}
<ConfirmationButtonContainer
hasFlexDisplay={this.props.socialShareModalToggle}
hasTopMargin={!this.props.hasRaceAlertsBar}
>
{this.renderButtons()}
</ConfirmationButtonContainer>
</Wrapper>
</Fragment>
);
}
}
export default BetConfirmation;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Switch/styled-components.ts
import styled from "styled-components";
export const SwitchComp = styled.div`
position: relative;
width: 52px;
height: 24px;
background-color: var(
--fd-colors-component-selection-control-background-unselected
);
border-radius: 12px;
gap: 4px;
transition: 200ms all ease-in-out;
&::before {
transition: 200ms all ease-in-out;
content: "";
position: absolute;
width: 18px;
height: 18px;
border-radius: 10px;
top: 50%;
left: 4px;
background-color: var(
--fd-colors-component-selection-control-background-base
);
transform: translate(0, -50%);
}
`;
export const Input = styled.input`
opacity: 0;
position: absolute;
&:checked + ${SwitchComp} {
background-color: var(
--fd-colors-component-selection-control-background-selected
);
&::before {
transform: translate(26px, -50%);
}
}
&:disabled + ${SwitchComp} {
background-color: var(
--fd-colors-component-selection-control-background-disabled
);
}
&:checked:disabled + ${SwitchComp} {
background-color: var(
--fd-colors-component-selection-control-background-disabled
);
}
`;
export const SliderWrapper = styled.div`
display: flex;
position: relative;
width: fit-content;
&::before {
width: 22px;
color: var(--fd-colors-content-on-dark);
display: flex;
height: 100%;
align-items: center;
justify-content: center;
z-index: 2;
position: absolute;
content: attr(data-status);
font-size: 12px;
font-family: Roboto-Regular, sans-serif;
right: 4px;
font-weight: 500;
line-height: 125%;
}
&:has(input:checked)::before {
left: 4px;
}
&:has(input:disabled)::before {
color: var(--fd-colors-content-disabled);
}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/Switch/index.tsx
import React, { useCallback } from "react";
import { SwitchComp, SliderWrapper, Input } from "./styled-components";
import type { SwitchProps } from "./types";
export const Switch = ({
isOn,
onPress,
qaLabel,
isDisabled = false
}: SwitchProps) => {
const onPressSwitch = useCallback(() => {
if (isDisabled) return;
onPress();
}, [isOn, onPress]);
return (
<SliderWrapper
aria-disabled={isDisabled}
aria-checked={isOn}
onClick={onPressSwitch}
tabIndex={0}
role="switch"
data-status={isOn ? "ON" : "OFF"}
data-qa-label={qaLabel}
>
<Input
checked={isOn}
type="checkbox"
onChange={onPressSwitch}
disabled={isDisabled}
data-qa-label={`${qaLabel}-input`}
/>
<SwitchComp data-qa-label={`${qaLabel}-toggle`} />
</SliderWrapper>
);
};
export type { SwitchProps };
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/RaceAlert/styled-components.ts
import styled from "styled-components";
export const RaceAlertsRow = styled.div`
height: 40px;
background-color: var(--fd-colors-content-on-dark);
display: flex;
align-items: center;
justify-content: space-between;
flex-shrink: 0;
> div {
align-items: center;
display: flex;
}
`;
webpack://frontend-tpt/../../packages/tvg-lib-design-system/web/components/RaceAlert/index.tsx
import React from "react";
import { Switch } from "../Switch";
import { Paragraph } from "../Typography/Paragraph";
import { RaceAlertsRow } from "./styled-components";
interface Props {
isOn: boolean;
onToggleClick: () => void;
raceNumber?: string;
}
export const RaceAlerts = ({ isOn, onToggleClick, raceNumber = "" }: Props) => (
<RaceAlertsRow>
<Paragraph>
Alerts for race
{raceNumber && ` - R${raceNumber}`}
</Paragraph>
<Switch
isOn={isOn}
onPress={onToggleClick}
qaLabel="race-alert-switch"
data-testid="race-alert-switch"
/>
</RaceAlertsRow>
);
webpack://frontend-tpt/../../packages/tvg-comp-race-alerts/src/index.tsx
import React, { useCallback, useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Store } from "redux";
import { get, find } from "lodash";
import mediator from "@tvg/mediator";
import ufc from "@tvg/api/ufc";
import { getAccountNumber } from "@urp/store-selectors";
import { RaceAlerts } from "@tvg/design-system/web/components";
import { setRaceAlerts } from "@tvg/shared-actions/UserActions";
export interface Channel {
entityName: string;
favoriteId: string;
}
interface RaceAlertsComponentProps {
racePostTime?: string;
raceTrackCode?: string;
raceNumber?: string;
tvgRaceId?: string;
showRaceNumber?: boolean;
module?: string;
}
export const getRaceAlert = (
channels: Channel[],
raceId: string
): Channel | undefined =>
channels.find((channel) => channel.entityName === raceId);
export const RaceAlertsComponent: React.FC<RaceAlertsComponentProps> = ({
raceNumber = "",
tvgRaceId = "",
showRaceNumber = false,
module = ""
}) => {
const dispatch = useDispatch();
const [isPedingPermission, setIsPendingPermission] = React.useState(false);
// Redux selectors
const isRaceAlertsAvailable = useSelector((state) =>
get(state, "capi.featureToggles.raceAlertsUFC", false)
);
const isNotificationsEnabled = useSelector((state) =>
get(state, "ios.isNotificationsEnabled", true)
);
const raceAlerts = useSelector((state) =>
get(state, "alerts.raceAlerts", [])
);
const accountNumber = useSelector(
(state) => getAccountNumber(state as Store) || ""
);
const isRaceAlertsEnabled = useCallback(
(): boolean =>
!!find(raceAlerts, (c) => c.entityName === tvgRaceId.toString()),
[raceAlerts, tvgRaceId]
);
// Handler for enabling race alerts
const onEnableRaceAlerts = useCallback((): void => {
if (isNotificationsEnabled) {
// request to ufc: add this race to alerts
ufc
.setUserAlerts(accountNumber, [tvgRaceId], "race", [
"raceResults",
"timeToRace"
])
.then((results) => {
const updatedRaceAlerts = [...raceAlerts, get(results, "data[0]")];
dispatch(setRaceAlerts(updatedRaceAlerts));
});
} else {
mediator.ios.dispatch({ type: "ASK_PUSH_NOTIFICATION_STATE" });
setIsPendingPermission(true);
}
// gtm event
mediator.base.dispatch({
type: "RACE_ALERTS:TOGGLE",
payload: {
toggledOn: true,
module,
eventLabel: "Alerts For Race"
}
});
}, [
isNotificationsEnabled,
accountNumber,
tvgRaceId,
raceAlerts,
module,
dispatch
]);
useEffect(() => {
if (isNotificationsEnabled && isPedingPermission) {
setIsPendingPermission(false);
onEnableRaceAlerts();
}
}, [isNotificationsEnabled, isPedingPermission]);
// Handler for disabling race alerts
const onDisableRaceAlerts = useCallback((): void => {
const updatedChannels = raceAlerts.filter(
(channel: Channel) => channel.entityName !== tvgRaceId.toString()
);
const alert = getRaceAlert(raceAlerts, tvgRaceId.toString());
if (alert) {
ufc.deleteUserAlert(accountNumber, [+get(alert, "favoriteId")]);
}
dispatch(setRaceAlerts(updatedChannels));
// gtm event
mediator.base.dispatch({
type: "RACE_ALERTS:TOGGLE",
payload: {
toggledOn: false,
module,
eventLabel: "Alerts For Race"
}
});
}, [raceAlerts, tvgRaceId, accountNumber, module, dispatch]);
if (!isRaceAlertsAvailable) {
return null;
}
const alertsEnabled = isRaceAlertsEnabled();
return (
<RaceAlerts
raceNumber={showRaceNumber ? raceNumber : undefined}
onToggleClick={alertsEnabled ? onDisableRaceAlerts : onEnableRaceAlerts}
isOn={alertsEnabled}
/>
);
};
export default RaceAlertsComponent;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/CustomKeyboard/styled-components.js
import styled, { css } from "styled-components";
import { fontNormal } from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const KeyboardContainer = styled.div`
display: flex;
background-color: ${buildColor("white", "100")};
`;
const sharedButtonStyles = css`
border: none;
background-color: transparent;
outline: none;
font-family: ${fontNormal};
font-size: 20px;
line-height: 23px;
height: 52px;
display: flex;
justify-content: center;
align-items: center;
&:active {
background-color: ${buildColor("blue", "100")};
}
`;
export const NumericButtonsContainer = styled.div`
display: flex;
flex-wrap: wrap;
flex-grow: 1;
`;
export const NumericButton = styled.button`
${sharedButtonStyles};
flex: 1 0 33.33%;
color: ${buildColor("grey", "900")};
&:disabled {
color: ${buildColor("grey", "700")};
}
`;
export const MoneyPillsContainer = styled.div`
display: flex;
flex-direction: column;
width: 95px;
border-left: 1px solid ${buildColor("blue", "100")};
`;
export const MoneyPillButton = styled.button`
${sharedButtonStyles};
color: ${buildColor("blue_accent", "500")};
span {
min-width: 45px;
text-align: end;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_molecule/CustomKeyboard/index.jsx
import React from "react";
import { noop } from "lodash";
import {
KeyboardContainer,
NumericButtonsContainer,
NumericButton,
MoneyPillsContainer,
MoneyPillButton
} from "./styled-components";
import Icon from "../../_static/Icons";
import { deleteIcon } from "../../_static/Icons/icons";
import buildColor from "../../_static/ColorPalette";
const CustomKeyboard = ({
moneyPills,
showMoneyPills,
onChangeValue,
onPeriod,
onDelete,
showPeriod,
isNumbersDisabled,
className,
onClickMoneyPills
}) => {
return (
<KeyboardContainer data-qa-label="custom-keyboard" className={className}>
<NumericButtonsContainer data-qa-label="custom-keyboard-numeric-buttons">
{[...Array(9)].map((e, index) => (
<NumericButton
key={index.toString()}
onClick={() => onChangeValue(index + 1, "mobile")}
disabled={isNumbersDisabled}
data-qa-label={`numeric-button-${index.toString()}`}
>
{index + 1}
</NumericButton>
))}
{showPeriod ? (
<NumericButton onClick={onPeriod}>.</NumericButton>
) : (
<NumericButton disabled />
)}
<NumericButton
onClick={() => onChangeValue(0, "mobile")}
disabled={isNumbersDisabled}
>
0
</NumericButton>
<NumericButton
onClick={onDelete}
data-qa-label="keyboard-delete-button"
>
<Icon
icon={deleteIcon}
size={24}
viewBoxSize={24}
color={buildColor("grey", "900")}
/>
</NumericButton>
</NumericButtonsContainer>
{showMoneyPills && (
<MoneyPillsContainer data-qa-label="custom-keyboard-money-pills">
{moneyPills &&
moneyPills.map((moneyPill, index) => (
<MoneyPillButton
key={index.toString()}
onClick={() => {
onChangeValue(moneyPill, "moneyPills");
onClickMoneyPills();
}}
data-qa-label={`money-pill-button-${index.toString()}`}
>
<span>{`$${moneyPill}`}</span>
</MoneyPillButton>
))}
</MoneyPillsContainer>
)}
</KeyboardContainer>
);
};
CustomKeyboard.defaultProps = {
showMoneyPills: true,
moneyPills: [50, 100, 200, 300],
showPeriod: true,
onPeriod: noop,
onClickMoneyPills: noop,
isNumbersDisabled: false
};
export default CustomKeyboard;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/RepeatBets/styled-components.js
import styled from "styled-components";
import buildColor from "../../_static/ColorPalette";
import { fontNormal } from "../../_static/Typography";
export const RepeatCounter = styled.h1`
display: flex;
align-items: center;
font-size: 52px;
text-align: center;
font-family: ${fontNormal};
color: ${({ isDisabled, showWarning }) => {
if (showWarning) {
return buildColor("yellow", "700");
}
if (isDisabled) {
return buildColor("blue_accent", "300");
}
return buildColor("blue_accent", "600");
}};
&::before {
content: "x";
font-size: 24px;
font-weight: 500;
color: ${({ showWarning }) =>
showWarning
? buildColor("orange", "700")
: buildColor("blue_accent", "600")};
}
`;
export const RepeatBetDetails = styled.div`
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
margin-top: 32px;
`;
export const RepeatBetsContainer = styled.div`
background: ${buildColor("white", "100")};
`;
export const RepeatButtonWrapper = styled.div`
padding: 16px 12px 20px;
`;
export const SetToMaxWrapper = styled.div`
margin-top: 4px;
margin-bottom: 32px;
display: flex;
align-items: center;
svg {
margin-right: 5px;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Tag/styled-components.js
import styled, { css } from "styled-components";
import { fontMedium, fontCondensedNormal } from "../../_static/Typography";
export const TagLabel = styled.span`
margin-left: ${({ flagPadding }) => (flagPadding ? "6px" : "4px")};
color: ${({ fontColor }) => fontColor};
font-family: ${({ isCondensed }) =>
isCondensed ? fontCondensedNormal : fontMedium};
font-size: ${({ textSize }) => `${textSize}px`};
font-weight: 500;
${({ uppercase }) =>
uppercase &&
css`
text-transform: uppercase;
`}
`;
export const TagContainer = styled.div`
background-color: ${({ bgColor }) => bgColor};
height: 24px;
min-width: 24px;
display: flex;
justify-content: center;
align-items: center;
flex-shrink: 1;
width: max-content;
border-radius: 12px;
& > svg {
padding-left: 6px;
${({ isCollapsed }) =>
isCollapsed &&
css`
padding-right: 6px;
`}
}
& > ${TagLabel} {
padding-right: 6px;
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_atom/Tag/index.jsx
import React, { PureComponent } from "react";
import Icon from "../../_static/Icons";
import color from "../../_static/ColorPalette";
import { TagContainer, TagLabel } from "./styled-components";
export default class Tag extends PureComponent {
static defaultProps = {
name: "",
description: "",
icon: null,
iconSize: 14,
textSize: 12,
isCollapsed: false,
uppercase: false,
bgColor: ["grey", "000"],
qaLabel: "tag",
tagType: "DefaultTag",
className: "",
isCondensed: false
};
processTagColors = () => {
switch (this.props.tagType) {
case "PromoTag":
return {
background: color("yellow", "100"),
iconColorList: [color("yellow", "500"), color("yellow", "900")],
text: color("yellow", "900")
};
case "OptedInTag":
return {
background: color("green", "100"),
iconColorList: [color("green", "900"), color("green", "500")],
text: color("green", "900")
};
case "RunnerFlag":
return {
background: color("orange", "000"),
iconColorList: [color("orange", "500"), color("orange", "700")],
text: color("orange", "700")
};
case "RepeatBet":
return {
background: color("blue_accent", "100"),
text: color("blue_accent", "500"),
iconColorList: [
color("blue_accent", "500"),
color("blue_accent", "700")
]
};
default:
return {
background: color("blue", "000"),
iconColorList: [color("grey", "800"), color("grey", "800")],
text: color("grey", "800")
};
}
};
render() {
const {
icon,
iconSize,
isCollapsed,
name,
uppercase,
qaLabel,
tagType,
isCondensed
} = this.props;
const tagColors = this.processTagColors();
return (
(!!icon || !isCollapsed) && (
<TagContainer
className={this.props.className}
data-qa-label={`${qaLabel}Container${tagType}`}
isCollapsed={isCollapsed}
bgColor={tagColors.background}
>
{!!icon && (
<Icon
data-qa-label={`${qaLabel}Icon`}
icon={icon}
colorList={tagColors.iconColorList}
size={iconSize}
/>
)}
{!isCollapsed && (
<TagLabel
flagPadding={this.props.tagType === "RunnerFlag"}
data-qa-label={`${qaLabel}Label`}
uppercase={uppercase}
isCondensed={isCondensed}
fontColor={tagColors.text}
textSize={this.props.textSize}
>
{name}
</TagLabel>
)}
</TagContainer>
)
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/RepeatBets/index.jsx
import React from "react";
import { noop } from "lodash";
import formatCurrency from "@tvg/formatter/currency";
import pluralize from "@tvg/utils/generalUtils";
import BetCancelNotification from "../../_molecule/BetNotification";
import buildColor from "../../_static/ColorPalette";
import { infoOutline, warning } from "../../_static/Icons/iconsDuotone";
import CustomKeyboard from "../../_molecule/CustomKeyboard";
import {
RepeatBetDetails,
RepeatCounter,
RepeatBetsContainer,
RepeatButtonWrapper,
SetToMaxWrapper
} from "./styled-components";
import Tag from "../../_atom/Tag";
import Button from "../../_atom/Buttons/button";
import { refresh, warningOutline } from "../../_static/Icons/icons";
import Icon from "../../_static/Icons";
import { fontMedium } from "../../_static/Typography";
const renderNotification = (notificationText, maxCounter, showWarningStyle) => {
const colors = !showWarningStyle
? {
color: buildColor("blue_accent", "600"),
colorBackground: buildColor("blue_accent", "000"),
colorBorder: buildColor("blue", "100"),
colorList: [
buildColor("blue_accent", "200"),
buildColor("blue_accent", "600")
],
iconElement: infoOutline
}
: {
color: buildColor("orange", "700"),
colorBackground: buildColor("orange", "000"),
colorBorder: buildColor("blue", "100"),
iconColor: buildColor("orange", "200"),
strokeColor: buildColor("orange", "700"),
iconElement: warning,
viewBoxSize: 16
};
return (
<BetCancelNotification
qaLabel="repeat-bet-notification"
{...colors}
title={notificationText}
titleIsBold={false}
textFontSize="large"
/>
);
};
export const RepeatBets = ({
counter,
betAmount,
maxCounter,
maxCounterByAmount,
onRepeatBets,
onChangeValue,
onSetToMax,
isMaxCounterExceeded,
isBalanceExceeded,
notificationText
}) => {
const hasCounter = !!counter;
return (
<RepeatBetsContainer data-qa-label="repeat-bets">
{renderNotification(
notificationText,
maxCounterByAmount,
!isBalanceExceeded && isMaxCounterExceeded
)}
<RepeatBetDetails>
<RepeatCounter
isDisabled={!hasCounter}
showWarning={isMaxCounterExceeded || isBalanceExceeded}
data-qa-label="repeat-bets-counter"
>
{counter}
</RepeatCounter>
<Tag
name={
isMaxCounterExceeded
? `${maxCounter} repeats exceeded`
: `${formatCurrency(betAmount * counter)} Ticket total`
}
uppercase
tagType={
isMaxCounterExceeded || isBalanceExceeded
? "RunnerFlag"
: "RepeatBet"
}
isCondensed
textSize={14}
icon={
isMaxCounterExceeded || isBalanceExceeded ? warningOutline : null
}
qaLabel="repeat-bets-notification"
/>
<SetToMaxWrapper data-qa-label="repeat-bets-set-to-max-wrapper">
<Button
onClick={() => {
onSetToMax(
maxCounter < maxCounterByAmount
? maxCounter
: maxCounterByAmount
);
}}
type="tertiary"
size="small"
isUppercase={false}
isBold={false}
isDisabled={maxCounter === counter}
qaLabel="repeat-bets-set-to-max"
>
<Icon
icon={refresh}
size={14}
color={buildColor("blue_accent", "500")}
qaLabel="repeat-bets-set-to-max-icon"
/>
Set to max
</Button>
</SetToMaxWrapper>
</RepeatBetDetails>
<CustomKeyboard
showMoneyPills={false}
showPeriod={false}
onChangeValue={(keyPressed) => {
const newCounter = +`${counter}${keyPressed}`;
onChangeValue(newCounter);
}}
onDelete={() => {
const newCounter = +`${counter}`.slice(0, -1);
onChangeValue(newCounter);
}}
isNumbersDisabled={isMaxCounterExceeded}
/>
<RepeatButtonWrapper data-qa-label="repeat-bets-confirm-wrapper">
<Button
isStretched
isUppercase={false}
size="bigger"
onClick={() => onRepeatBets(counter)}
isDisabled={isMaxCounterExceeded || !hasCounter}
qaLabel="repeat-bets-confirm"
fontFamily={fontMedium}
>
Set{" "}
{pluralize(hasCounter ? counter : 2, "repeat", hasCounter, "s", "x")}
</Button>
</RepeatButtonWrapper>
</RepeatBetsContainer>
);
};
RepeatBets.defaultProps = {
counter: 0,
betAmount: 0,
maxCounter: 25,
maxCounterByAmount: 25,
onRepeatBets: noop,
onChangeValue: noop,
onSetToMax: noop,
isMaxCounterExceeded: false,
isBalanceExceeded: false,
notificationText: ""
};
export default RepeatBets;
webpack://frontend-tpt/../../packages/tvg-comp-bet/BetConfirmationModalComponent/index.jsx
import React, { PureComponent } from "react";
import { connect } from "react-redux";
import { bindAll, get, noop } from "lodash";
import calculateTotals from "@tvg/api/wtx/BetHelper";
import mediator from "@tvg/mediator";
import tvgConf from "@tvg/conf";
import isMobile from "@tvg/utils/mobileUtils";
import { mapSelectionsToString } from "@tvg/utils/talentPicksUtils";
import ModalV2 from "@tvg/atomic-ui/_templates/ModalV2";
import BetConfirmation from "@tvg/atomic-ui/_templates/BetConfirmation";
import RaceAlerts from "@tvg/race-alerts";
import {
setBetConfirmation,
setPickAction,
setPickEditButtonAction,
setShowRepeatBet,
setBetTicketState,
setBetRepeatNumber,
clearBetRepeatNumber
} from "@tvg/shared-actions/BetActions";
import {
getShowMyBetsCardDesign,
getSocialShareToggle
} from "@tvg/sh-lib-my-bets/redux/selectors";
import RepeatBets from "@tvg/atomic-ui/_templates/RepeatBets";
import { getBetSelectionsToShow } from "@tvg/bet/utils";
import { parseCAPIMessage, replaceCAPIVariables } from "@tvg/utils/capiUtils";
import formatCurrency from "@tvg/formatter/currency";
import buildColor from "@tvg/atomic-ui/_static/ColorPalette";
import { fontCondensedNormal } from "@tvg/atomic-ui/_static/Typography";
import { openBetSocialShareModal } from "@tvg/sh-lib-my-bets/redux/actions";
import { formatRepeatBetsSelections } from "@tvg/sh-lib-my-bets/utils/pickBets";
import { mapSelectionsToNumber } from "@tvg/utils/betSelectionUtils";
import { getBalance } from "@urp/store-selectors";
import { formatWager, getDateDiff } from "../utils";
export const getTitleType = (isBetPlaced, isBettingError) => {
if (isBetPlaced && !isBettingError) {
return "success";
}
if (isBettingError) {
return "error";
}
return "default";
};
export class BetConfirmationModalComponent extends PureComponent {
static defaultProps = {
isOpen: false,
isBetPlaced: false,
isProcessing: false,
isBettingError: false,
errorBetMessage: "",
onConfirmation: noop,
onRetain: noop,
onBackToRace: noop,
isNotificationsEnabled: false,
modalType: "bottom",
modalTopChildren: noop,
contextBT: "mep",
favoriteRunners: [],
bettingInterests: [],
talentPick: null,
talentPickTriggerOrigin: null,
enableRepeatBetsPgmPage: false,
enableRepeatBetsTalentPicks: false,
pickEditButton: false,
repetitionsNr: 1,
probableValue: "",
showMyBetsCardDesign: false,
showBetConfirmation: false,
betConfirmationTitle: "",
repeatBetTitle: "",
showRepeatButton: true,
hasFeedback: false,
feedbackType: "error",
partialFailure: false,
partialInfo: "",
partialInfoDetails: "",
feedbackTitle: "",
feedbackMsg: "",
showRepeatBet: false,
repeatBetsLimit: 25,
socialShareModalToggle: false
};
tvg;
constructor(props) {
super(props);
bindAll(this, [
"onClose",
"onConfirmationHandler",
"openRepeatBets",
"renderBetConfirmation",
"renderRepeatBet",
"onRepeatBets",
"closeRepeatBets",
"onRepeatBetChange",
"onSetToMax"
]);
this.tvg = tvgConf();
this.state = {
repeatBetCounter: 0,
showBalanceError: false
};
}
onRepeatBets(betsNumber) {
this.props.dispatch(setBetRepeatNumber(betsNumber));
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBetPlaced: false,
isBettingError: false,
errorBetMessage: "",
betConfirmationTitle: "confirm bet",
randomTalentPhrase: "",
randomTalentPhraseId: -1
})
);
mediator.base.dispatch({
type: "REPEAT_BETS:SET_BETS",
payload: {
repeatBet: betsNumber.toString()
}
});
this.closeRepeatBets();
}
openRepeatBets() {
this.props.dispatch(setShowRepeatBet(true));
if (this.props.showMyBetsCardDesign) {
this.props.dispatch(setBetConfirmation(false));
mediator.base.dispatch({
type: "REPEAT_BETS:SHOW"
});
} else {
mediator.base.dispatch({
type: "REPEAT_BETS:LINK_CLICK",
payload: {
module: this.props.isBetPlaced
? "Bet Success Modal"
: "Confirm Bet Modal",
tag: this.props.talentPickTriggerOrigin ? "Talent" : undefined
}
});
}
}
closeRepeatBets() {
this.props.dispatch(setShowRepeatBet(false));
this.props.dispatch(setBetConfirmation(true));
}
onClose() {
if (this.props.isBetPlaced && !this.props.isBettingError) {
// the bet was placed - clean betting and remove bet ticket
this.props.onBackToRace();
mediator.base.dispatch({
type: "BET_CONFIRMATION:CLOSE_CONFIRM_MODAL",
payload: {
confirmMode: false
}
});
} else {
// when bet is not placed hide betConfirmation
this.props.dispatch(setBetConfirmation(false));
this.props.dispatch(setBetTicketState({ repeatBetNumber: 1 }));
setTimeout(() => this.props.resetState(), 400);
if (this.props.talentPick && this.props.contextBT === "mep") {
mediator.base.dispatch({
type: "TP_PROGRAMPAGE_CONFIRM_BET_CLOSE",
payload: {
action: "Close",
label: "TP Confirm Bet Modal"
}
});
} else {
mediator.base.dispatch({
type: "BET_CONFIRMATION:CLOSE_CONFIRM_MODAL",
payload: {
confirmMode: true
}
});
}
}
if (this.props.talentPick) {
this.props.dispatch(setPickAction(null));
this.props.dispatch(setPickEditButtonAction(true));
}
if (this.props.showMyBetsCardDesign) {
this.props.dispatch(setShowRepeatBet(false));
this.props.dispatch(clearBetRepeatNumber());
this.setState({
repeatBetCounter: 0
});
}
}
onConfirmationHandler(betTotal) {
if (this.props.talentPick && this.props.contextBT === "mep") {
mediator.base.dispatch({
type: "TP_PROGRAMPAGE_CONFIRM_BET_OK",
payload: {
action: "Bet Confirm",
label: `Talent Pick - ${get(this.props.talentPick, "talent.name")}`,
talentPickOrigin: this.props.talentPickTriggerOrigin,
tag: mapSelectionsToString(
get(this.props.talentPick, "selections", [])
),
race: {
raceNumber: get(this.props.talentPick, "race"),
track: {
trackName: get(this.props.talentPick, "trackName")
},
type: {
code: get(this.props.talentPick, "raceType")
}
},
betAmount: get(this.props.talentPick, "amount"),
betType: get(this.props.talentPick, "wagerType.abbreviation")
}
});
} else {
mediator.base.dispatch({
type: "BET_CONFIRMATION:CONFIRM_BET",
payload: {
selections: get(this.props, "betSelections").join(", "),
trackName: get(this.props, "race.track.trackName"),
raceNumber: get(this.props, "race.raceNumber"),
betAmount: betTotal,
runnerAmount: get(this.props, "betAmount"),
betType: get(this.props, "betType.type.code"),
runnerType:
get(this.props, "race.type.code") === "G" ? "Greyhound" : "Horse"
}
});
}
if (this.props.showMyBetsCardDesign) {
this.setState({
repeatBetCounter: 0,
showBalanceError: false
});
}
this.props.onConfirmation(this.props.betsNumber);
}
renderBetConfirmation(betTotal) {
const hasRaceAlertsBar =
isMobile(this.tvg.product) && this.props.isBetPlaced;
const bettingInterests = get(this.props, "bettingInterests", [[]]);
const selections = getBetSelectionsToShow(
this.props.betSelections,
bettingInterests
);
const wagerTypeName = get(
this.props,
"betType.type.name",
""
).toUpperCase();
const racePostTime = get(this.props, "race.postTime", "");
const mtp = get(this.props, "race.mtp");
const raceNumber = get(this.props, "race.raceNumber");
const raceDate = get(this.props, "race.raceDate");
const trackName = get(this.props, "race.track.trackName");
const trackCode = get(this.props, "race.track.trackCode");
const wagerAmount = get(this.props, "betAmount");
const raceTypeAbbreviation = get(this.props, "race.type.code");
const probable = get(this.props, "probableValue");
const wager = formatWager({
betTotal,
cancelable: false,
racePostTime,
mtp,
raceNumber,
raceTypeAbbreviation,
selections,
bettingInterests,
trackName,
wagerAmount,
winningsAmount: betTotal,
probable,
wagerType: get(this.props, "betType.type", {})
});
const bet = {
value: `${raceDate}|${trackCode}|${raceNumber}`,
wagers: [wager]
};
const socialShareParams = formatRepeatBetsSelections(
selections,
wager.wagerType.code,
wager.wagerAmount
);
return (
<BetConfirmation
wager={wager}
socialShareModalToggle={this.props.socialShareModalToggle}
onShareWager={() => {
this.props.dispatch(
openBetSocialShareModal({
isMyBets: false,
wager: { ...wager, cancelable: true },
bet,
currentRace: this.props.race,
repeatButtonSearch: socialShareParams
})
);
}}
postTime={racePostTime}
isProcessing={this.props.isProcessing}
mtp={mtp}
raceNumber={raceNumber}
trackName={trackName}
isGreyhound={raceTypeAbbreviation === "G"}
raceTypeCode={raceTypeAbbreviation}
wagerTypeName={wagerTypeName}
wagerCode={get(this.props, "betType.type.code")}
isKey={get(this.props, "betType.isKey", false)}
isBox={get(this.props, "betType.isBox", false)}
isLeg={get(this.props, "betType.legCount", 1) > 1}
betTotal={betTotal * this.props.repetitionsNr}
wagerAmount={wagerAmount}
isCancelable={false}
selections={selections}
bettingInterests={bettingInterests}
favoriteRunners={this.props.favoriteRunners}
onConfirmation={() => this.onConfirmationHandler(betTotal)}
onRetain={this.props.onRetain}
onBackToRace={this.props.onBackToRace}
isBetPlaced={this.props.isBetPlaced}
isBettingError={this.props.isBettingError}
errorBetMessage={this.props.errorBetMessage}
hasRaceAlertsBar={hasRaceAlertsBar}
confirmText={
this.props.contextBT === "mep"
? "Confirm $amount Bet"
: "Publish Pick"
}
onRepeatClick={this.openRepeatBets}
hasRepeaterEnabled={
(!this.props.pickEditButton &&
this.props.isBetPlaced &&
this.props.enableRepeatBetsTalentPicks) ||
(this.props.pickEditButton && this.props.enableRepeatBetsPgmPage)
}
repetitionsNr={this.props.repetitionsNr}
probableValue={probable}
showMyBetsCardDesign={this.props.showMyBetsCardDesign}
dateDiff={getDateDiff(racePostTime)}
showRepeatButton={this.props.showRepeatButton}
hasFeedback={this.props.hasFeedback}
feedbackType={this.props.feedbackType}
partialFailure={this.props.partialFailure}
partialInfo={this.props.partialInfo}
partialInfoDetails={this.props.partialInfoDetails}
feedbackTitle={this.props.feedbackTitle}
feedbackMsg={this.props.feedbackMsg}
renderRaceAlerts={() => (
<RaceAlerts
raceTrackCode={get(this.props, "race.track.trackCode", "")}
raceNumber={get(this.props, "race.raceNumber", "")}
racePostTime={racePostTime}
module="Bet Success Modal"
tvgRaceId={get(this.props, "race.tvgRaceId")}
/>
)}
/>
);
}
onRepeatBetChange(repeatBetCounter) {
this.setState({
repeatBetCounter
});
}
onSetToMax(maxBet) {
mediator.base.dispatch({
type: "REPEAT_BETS:SET_TO_MAX"
});
this.setState({
repeatBetCounter: maxBet
});
}
renderRepeatBet(betTotal) {
const maxCounter = this.props.repeatBetsLimit;
const maxByAmount = Math.floor(this.props.balance / betTotal);
const isMaxCounterExceeded = this.state.repeatBetCounter > maxCounter;
const isBalanceExceeded = this.state.repeatBetCounter > maxByAmount;
const showBalanceError = maxByAmount < maxCounter;
const notification = showBalanceError
? {
message: get(this.props, "notificationText.balanceExceeded", ""),
counter: maxByAmount
}
: {
message: get(this.props, "notificationText.maxExceeded", ""),
counter: maxCounter
};
this.setState({
showBalanceError:
showBalanceError && this.state.repeatBetCounter > maxByAmount
});
return (
<RepeatBets
counter={this.state.repeatBetCounter}
onChangeValue={this.onRepeatBetChange}
betAmount={betTotal}
maxCounter={maxCounter}
maxCounterByAmount={maxByAmount}
onRepeatBets={this.onRepeatBets}
onSetToMax={this.onSetToMax}
isMaxCounterExceeded={isMaxCounterExceeded}
isBalanceExceeded={isBalanceExceeded}
notificationText={replaceCAPIVariables(notification.message, {
counter: notification.counter
})}
/>
);
}
render() {
const baseProps = {
title: this.props.betConfirmationTitle,
titleType: getTitleType(
this.props.isBetPlaced,
this.props.isBettingError
),
animation: this.props.modalType,
isOpen: this.props.isOpen,
onClose: this.onClose,
isFullHeight: false,
qaLabel: "modal-betConfirmation",
key: "betConfirmationModal",
modalTopChildren: this.props.modalTopChildren
};
const basePropsRepeat =
!this.props.showBetConfirmation && this.props.showMyBetsCardDesign
? {
title: this.props.repeatBetTitle,
titleType: "default",
subtitle: `BALANCE ${formatCurrency(this.props.balance)}`,
isTitleCenter: true,
useModalHeaderV3: true,
onBack: () => {
mediator.base.dispatch({
type: "REPEAT_BETS:BACK"
});
this.setState({
repeatBetCounter:
this.props.betsNumber > 1 ? this.props.betsNumber : 0
});
this.closeRepeatBets();
},
subtitleColor: this.state.showBalanceError
? buildColor("orange", "700")
: buildColor("grey", "800"),
subtitleFontFamily: fontCondensedNormal
}
: {};
const props =
this.props.modalType === "bottom"
? {
...baseProps,
...basePropsRepeat,
hasVideoOffset: this.props.isVideoShown
}
: {
...baseProps,
...basePropsRepeat,
isFullWidth: false,
offsetTop: 0
};
const totals =
this.props.isOpen &&
get(this.props, "wagerType.columnCount") &&
calculateTotals(
get(this.props, "betAmount"),
get(this.props, "betType"),
mapSelectionsToNumber(
getBetSelectionsToShow(
this.props.betSelections,
get(this.props, "bettingInterests", [])
)
)
);
const betTotal = this.props.betAmount * get(totals, "betCount", 0);
return (
<ModalV2 {...props}>
{() => (
<div>
{this.props.showRepeatBet && this.props.showMyBetsCardDesign
? this.renderRepeatBet(betTotal)
: this.renderBetConfirmation(betTotal)}
</div>
)}
</ModalV2>
);
}
}
export default connect(
(store, props) => ({
race: props.race,
bettingInterests: props.bettingInterests,
betType: props.wagerType,
betAmount: props.betAmount,
showBetConfirmation: props.showBetConfirmation,
modalTopChildren: props.modalTopChildren,
betSelections: props.betSelections,
isVideoShown: props.isVideoShown,
showRepeatBet: props.showRepeatBet,
enableRepeatBetsPgmPage: get(
store,
"capi.featureToggles.enableRepeatBetsPgmPage"
),
enableRepeatBetsTalentPicks: get(
store,
"capi.featureToggles.enableRepeatBetsTalentPicks"
),
talentPick: get(store, "RaceProgram.talentPick", null),
talentPickTriggerOrigin: get(
store,
"RaceProgram.talentPickTriggerOrigin",
null
),
pickEditButton: get(store, "RaceProgram.pickEditButton", null),
showMyBetsCardDesign: getShowMyBetsCardDesign(store),
balance: getBalance(store),
notificationText: parseCAPIMessage(store, "capi.messages.betConfirmation"),
betsNumber: get(store, "BetTicket.repeatBetNumber"),
repeatBetsLimit: +get(store, "capi.messages.repeatBetsLimit", 25),
socialShareModalToggle: getSocialShareToggle(store)
}),
(dispatch) => ({ dispatch })
)(BetConfirmationModalComponent);
webpack://frontend-tpt/../../packages/tvg-comp-bet/index.jsx
import React, { Component, Fragment } from "react";
import { get, bindAll, isEqual, some, noop, attempt } from "lodash";
import { connect } from "react-redux";
import mediator from "@tvg/mediator";
import wtx from "@tvg/api/wtx";
import tpm from "@tvg/api/tpm";
import calculateTotals from "@tvg/api/wtx/BetHelper";
import tvgConf from "@tvg/conf";
import TvgGeolocation from "@tvg/geolocation";
import { requestLocation } from "@tvg/location-splash/splashBuilder";
import { setLocationLoading } from "@tvg/location-splash/actions";
import { events as AlchemerEvents } from "@urp/alchemer";
import performanceUtils from "@tvg/utils/performanceUtils";
import isMobile from "@tvg/utils/mobileUtils";
import sendAppMetrics from "@tvg/metrics-collector";
import BetUtils, { mapSelectionsToNumber } from "@tvg/utils/betSelectionUtils";
import { mapSelectionsToString } from "@tvg/utils/talentPicksUtils";
import parseJSONCapiMessage from "@tvg/utils/capiUtils";
import {
resetBetting,
resetSelection,
setBetConfirmation,
setBetAmount,
setPickLeg,
setSelectionScratched,
setPickAction,
noMandatoryTalentIdSelected,
setBetTicketState,
setBetType,
setShowRepeatBet,
clearBetRepeatNumber
} from "@tvg/shared-actions/BetActions";
import { showMainWagerType } from "@tvg/shared-actions/ProgramActions";
import { updateBalance } from "@tvg/shared-actions/UserActions";
import {
openLocationSplash,
setOnLocationGet
} from "@tvg/shared-actions/LocationActions";
import buildColor from "@tvg/atomic-ui/_static/ColorPalette";
import sendToAppsFlyer, { AppsFlyerEvents } from "@tvg/utils/appsflyerUtils";
import BetTicket from "@tvg/atomic-ui/_templates/BetTicket";
import TalentPickConfirmationHeader from "@tvg/atomic-ui/_molecule/TalentPickConfirmationHeader";
import { getCurrentProbableValue } from "@tvg/sh-lib-my-bets/utils/potentialReturn";
import { getShowMyBetsCardDesign } from "@tvg/sh-lib-my-bets/redux/selectors";
import uwt from "@tvg/api/uwt";
import { onRepeatBetGTM } from "@tvg/sh-lib-my-bets/utils/gtm";
import { getAccountNumber, getResidenceState } from "@urp/store-selectors";
import { isFDR } from "@tvg/utils/generalUtils";
import { getBalance } from "@urp/unified-modules/src/utils/wallet/getBalance";
import { BetError, getBetSelectionsToShow } from "./utils";
import BetConfirmationModal from "./BetConfirmationModalComponent";
const tvgGeolocation = new TvgGeolocation();
const isScratchedSelections = (selections) =>
some(selections, (selection) => selection.length > 0);
export const getTitleScratchedRunners = (scratchedSelections = [[]]) => {
if (!isScratchedSelections(scratchedSelections)) return " ";
if (scratchedSelections.length > 1) {
return scratchedSelections
.map((selection, index) => {
if (selection.length > 0) {
return `Race ${index + 1} - Horse ${selection.join(
", "
)} just got scratched`;
}
return selection;
})
.join(" ");
}
return `Runner ${scratchedSelections[0].join(", ")} just got scratched`;
};
export class BetTicketComponent extends Component {
static defaultProps = {
betSelections: [[]],
scratchedSelections: [[]],
favoriteSelections: [[]],
isLogged: false,
showBetConfirmationPreference: "1",
showBetConfirmation: false,
betAmount: 0,
isVisible: false,
isLocationRequired: false,
isRequestingLocation: false,
columnLayout: "single",
isVideoShown: false,
isAdmin: false,
selectTalentIdErrorVisible: false,
contextBT: "mep",
selectedTalentId: -1,
talentPick: null,
talentPickTriggerOrigin: null,
pickEditButton: false,
wtxErrorMessages: "",
betTicketState: {},
accountNumber: "",
userHomeState: "",
betErrorMessageToggle: false,
updateLocationRequired: false,
statesUpdateLocationRequired: [],
fromRepeatBet: false,
repeatBetType: "",
showMyBetsCardDesign: false,
accountId: 0
};
constructor(props) {
super(props);
this.tvgConf = tvgConf();
bindAll(this, [
"cancelBet",
"submitBet",
"setBetAmount",
"handleCloseWarning",
"handleBetNow",
"onRetainRunners",
"onBackToRace",
"resetState",
"placeBetFunction",
"loginCallback",
"parseErrorMessage",
"placePick",
"submitPick"
]);
}
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.showBetConfirmation !== nextProps.showBetConfirmation) {
mediator.ios.dispatch({
type: "TOGGLE_BACKGROUND_COLOR",
payload: {
backgroundColor: nextProps.showBetConfirmation
? buildColor("blue", "000")
: buildColor("blue", "500")
}
});
}
}
shouldComponentUpdate(nextProps) {
return (
!isEqual(nextProps.race, this.props.race) ||
!isEqual(nextProps.betSelections, this.props.betSelections) ||
!isEqual(nextProps.bettingInterests, this.props.bettingInterests) ||
!isEqual(nextProps.showBetConfirmation, this.props.showBetConfirmation) ||
!isEqual(nextProps.showRepeatBet, this.props.showRepeatBet) ||
nextProps.betAmount !== this.props.betAmount ||
!isEqual(nextProps.wagerType, this.props.wagerType) ||
nextProps.isLogged !== this.props.isLogged ||
nextProps.isVisible !== this.props.isVisible ||
nextProps.isVideoShown !== this.props.isVideoShown ||
nextProps.selectTalentIdErrorVisible !==
this.props.selectTalentIdErrorVisible ||
nextProps.selectedTalentId !== this.props.selectedTalentId ||
!isEqual(nextProps.favoriteSelections, this.props.favoriteSelections) ||
!isEqual(nextProps.scratchedSelections, this.props.scratchedSelections) ||
!isEqual(this.props.geolocation, nextProps.geolocation) ||
this.props.isRequestingLocation !== nextProps.isRequestingLocation ||
!isEqual(nextProps.talentPick, this.props.talentPick) ||
!isEqual(nextProps.betTicketState, this.props.betTicketState) ||
!isEqual(nextProps.betsNumber, this.props.betsNumber)
);
}
componentDidUpdate(prevProps) {
if (
this.props.isVisible &&
Object.values(this.props.betSelections).every((selection) => {
return Array.isArray(selection) && selection.length === 0;
}) &&
(this.props.isVisible !== prevProps.isVisible ||
!isEqual(this.props.betSelections, prevProps.betSelections))
) {
this.onBackToRace();
}
if (
get(this.props, "race.raceNumber") !== get(prevProps, "race.raceNumber")
) {
this.resetState();
}
if (!this.props.isLogged && prevProps.isLogged) {
this.props.dispatch(setShowRepeatBet(false));
this.props.dispatch(setBetConfirmation(false));
this.props.dispatch(setBetTicketState({ repeatBetNumber: 1 }));
}
}
componentWillUnmount() {
this.resetState();
}
onRetainRunners() {
this.props.dispatch(setBetConfirmation(false));
this.props.dispatch(setBetTicketState({ repeatBetNumber: 1 }));
this.props.dispatch(setPickAction(null));
// this timeout is for animations to roll and prevent flicker
setTimeout(this.resetState, 400);
mediator.base.dispatch({
type: "BET_CONFIRMATION:RETAIN_RUNNERS",
payload: {
trackName: get(this.props, "race.track.trackName"),
raceNumber: get(this.props, "race.raceNumber"),
betType: get(this.props, "wagerType.type.code"),
runnerType:
get(this.props, "race.type.code") === "G" ? "Greyhound" : "Horse"
}
});
}
handleCloseWarning() {
this.props.dispatch(setSelectionScratched([[]]));
}
onBackToRace() {
this.props.dispatch(setBetConfirmation(false));
this.props.dispatch(setBetTicketState({ repeatBetNumber: 1 }));
this.props.dispatch(setPickAction(null));
// this timeout is for animations to roll and prevent flicker
setTimeout(() => {
if (this.props.showMyBetsCardDesign) {
this.props.dispatch(clearBetRepeatNumber());
}
this.props.dispatch(resetSelection());
this.props.dispatch(setPickLeg(0));
this.props.dispatch(setSelectionScratched([[]]));
this.props.dispatch(
setBetTicketState({
isBetPlaced: false,
betConfirmationTitle: "confirm bet",
randomTalentPhrase: "",
randomTalentPhraseId: -1
})
);
}, 400);
}
onCloseCustomAmountModal = () => {
mediator.base.dispatch({
type: "PPM_CLOSE_CUSTOM_AMOUNT"
});
this.forceUpdate();
};
setBetAmount(value, isCustomAmount) {
this.props.dispatch(setBetAmount(parseFloat(value)));
mediator.base.dispatch({
type: "PPM_SET_BET_AMOUNT",
payload: {
betAmount: value,
isCustomAmount
}
});
}
resetState() {
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBetPlaced: false,
isBettingError: false,
errorBetMessage: "",
betConfirmationTitle: "confirm bet",
randomTalentPhrase: "",
randomTalentPhraseId: -1,
hasFeedback: false,
feedbackType: "error",
partialFailure: false,
partialInfo: "",
partialInfoDetails: "",
feedbackTitle: "",
feedbackMsg: ""
})
);
this.props.dispatch(clearBetRepeatNumber());
}
cancelBet(isTrashClicked) {
if (
this.props.showBetConfirmation &&
this.props.betTicketState.isBetPlaced
) {
this.props.dispatch(setBetConfirmation(false));
this.props.dispatch(setBetTicketState({ repeatBetNumber: 1 }));
} else {
this.props.dispatch(resetBetting());
this.resetState();
}
if (isTrashClicked) {
const wt = BetUtils.getDefaultBetType(this.props.race, "", false);
this.props.dispatch(setBetType(wt));
this.props.dispatch(showMainWagerType(true));
mediator.base.dispatch({
type: "PPM_DELETE_BET_TICKET",
payload: {
trackName: get(this.props, "race.track.trackName"),
raceNumber: get(this.props, "race.raceNumber"),
betType: get(this.props, "wagerType.group.name"),
runnerType: get(this.props, "race.isGreyhound")
? "Greyhounds"
: "Horse"
}
});
}
}
placeBetFunction() {
this.resetState();
if (this.props.showBetConfirmationPreference === "0") {
this.submitBet();
} else {
this.props.dispatch(setBetConfirmation(true));
this.props.dispatch(
setBetTicketState({
betConfirmationTitle: "confirm bet"
})
);
}
}
placePick() {
const isTalentPicksTool =
get(this.props, "contextBT", "") === "talentPicks";
const hasValidTalentId = get(this.props, "selectedTalentId", "") !== "";
if (isTalentPicksTool && !hasValidTalentId && this.props.isAdmin) {
this.props.dispatch(noMandatoryTalentIdSelected(true));
return;
}
this.props.dispatch(noMandatoryTalentIdSelected(false));
this.resetState();
this.props.dispatch(setBetConfirmation(true));
this.props.dispatch(
setBetTicketState({
betConfirmationTitle: "confirm and publish pick"
})
);
}
loginCallback(error, success) {
if (get(success, "status", "fail") === "success") {
this.props.dispatch(setOnLocationGet(this.placeBetFunction));
}
}
updateUserLocation() {
const { dispatch } = this.props;
if (isMobile(this.tvgConf.product)) {
mediator.ios.dispatch({ type: "ASK_LOCATION" });
dispatch(setLocationLoading(true));
dispatch(setOnLocationGet(this.placeBetFunction));
} else {
requestLocation(dispatch, tvgGeolocation, this.placeBetFunction);
}
}
handleBetNow(betCount = 0) {
mediator.base.dispatch({
type: "PPM_BET_NOW",
payload: {
selections: get(this.props, "betSelections").join(", "),
trackName: get(this.props, "race.track.trackName"),
raceNumber: get(this.props, "race.raceNumber"),
betAmount: get(this.props, "betAmount", 1) * betCount,
runnerAmount: get(this.props, "betAmount"),
betType: get(this.props, "wagerType.type.code"),
runnerType:
get(this.props, "race.type.code") === "G" ? "Greyhound" : "Horse"
}
});
if (this.props.fromRepeatBet && this.props.repeatBetType) {
const totals = calculateTotals(
this.props.betAmount,
get(this.props, "wagerType"),
mapSelectionsToNumber(
getBetSelectionsToShow(
this.props.betSelections,
get(this.props, "bettingInterests", [])
)
)
);
onRepeatBetGTM({
gaEventLabel: get(this.props, "repeatBetType", ""),
runnerAmount: get(this.props, "betAmount", 0),
trackName: get(this.props, "race.track.trackName", ""),
betTotal: totals.betCount * get(this.props, "betAmount", 0),
betType: get(this.props, "wagerType.group.code", ""),
betId: get(this.props, "wagerType.type.id"),
isGreyhound: get(this.props, "race.isGreyhound", false),
runnerSelectionList: get(this.props, "betSelections").join(", "),
raceNumber: get(this.props, "race.raceNumber", 0)
});
}
if (!this.props.isLogged) {
mediator.base.dispatch({
type: "OPEN_LOGIN",
payload: {
callback: this.loginCallback,
triggerAction: "ppm_bet_now"
}
});
} else {
const {
geolocation,
isLocationRequired,
updateLocationRequired,
statesUpdateLocationRequired,
userHomeState
} = this.props;
const isCoordsAvailable =
get(geolocation, "location.latitude", null) &&
get(geolocation, "location.longitude", null);
const shouldUpdateLocation =
isCoordsAvailable &&
updateLocationRequired &&
statesUpdateLocationRequired.includes(userHomeState.toLowerCase());
if (isLocationRequired && shouldUpdateLocation) {
this.updateUserLocation();
} else if (!isLocationRequired || isCoordsAvailable) {
this.placeBetFunction();
} else {
this.props.dispatch(setOnLocationGet(this.placeBetFunction));
this.props.dispatch(openLocationSplash());
}
}
}
submitPick() {
const totals = calculateTotals(
this.props.betAmount,
get(this.props, "wagerType"),
mapSelectionsToNumber(
getBetSelectionsToShow(
this.props.betSelections,
get(this.props, "bettingInterests", [])
)
)
);
const wagerSelection = this.props.betSelections.map((column) =>
column.map((selection) => ({ order: +selection }))
);
const favoriteSelections = this.props.favoriteSelections.map((column) =>
column.map((selection) => ({ order: +selection }))
);
const race = {
trackAbbr: get(this.props, "race.track.trackCode"),
raceNumber: get(this.props, "race.raceNumber")
};
this.props.dispatch(
setBetTicketState({
isProcessing: true
})
);
return tpm
.placePick(
wagerSelection,
favoriteSelections,
get(this.props, "wagerType.type.code"),
this.props.betAmount,
this.props.betAmount * totals.betCount,
race,
get(this.props, "talentPick.talent.talentId", "")
)
.then(() => {
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBetPlaced: true,
betConfirmationTitle: "Pick placed!"
})
);
this.props.dispatch(setBetConfirmation(true));
})
.catch((error) => {
const errorBetMessage = this.parseErrorMessage(
get(error, "response.data")
);
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBettingError: true,
betConfirmationTitle: "Pick not placed!",
errorBetMessage
})
);
});
}
processErrorState(code, fulfilled, requested) {
const message = this.parseErrorMessage(code);
let partialFailure = false;
let baseMessage = message;
if (fulfilled && requested && fulfilled !== requested) {
partialFailure = true;
baseMessage = `We were only able to repeat ${fulfilled} of ${requested} bets.`;
}
return {
betConfirmationTitle: "Bet not placed!",
partialFailure,
isBettingError: true,
failed: partialFailure ? (requested || 0) - (fulfilled || 0) : 1,
feedbackTitle: partialFailure
? "Unable to repeat all your bets"
: "Unable to repeat bets",
partialInfo: partialFailure ? baseMessage : "",
partialInfoDetails: partialFailure ? message : "",
feedbackMsg: !partialFailure ? message : ""
};
}
handleBetSuccess(betCount, betCost, serialNumber) {
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBetPlaced: true,
betConfirmationTitle: "Bet placed!",
randomTalentPhrase: "Good luck!",
randomTalentPhraseId: 0
})
);
this.props.dispatch(setBetConfirmation(true));
performanceUtils.measure("place_bet");
if (this.props.talentPick && this.props.contextBT === "mep") {
mediator.base.dispatch({
type: "TP_PROGRAMPAGE_BET_SUCCESS",
payload: {
action: "Bet Success",
label: get(this.props.talentPick, "wagerType.abbreviation"),
talentPickOrigin: this.props.talentPickTriggerOrigin,
tag: mapSelectionsToString(
get(this.props.talentPick, "selections", [])
),
race: {
raceNumber: get(this.props.talentPick, "race"),
track: {
trackName: get(this.props.talentPick, "trackName")
},
type: {
code: get(this.props.talentPick, "raceType")
}
},
betId: get(this.props, "wagerType.type.id"),
betAmount: +get(this.props.talentPick, "amount"),
betType: get(this.props.talentPick, "wagerType.abbreviation")
}
});
} else {
mediator.base.dispatch({
type: "BET_CONFIRMATION:BET_SUCCESS",
payload: {
selections: mapSelectionsToString(
get(this.props, "betSelections", [])
),
trackName: get(this.props, "race.track.trackName"),
raceNumber: get(this.props, "race.raceNumber"),
betAmount: get(this.props, "betAmount", 1) * betCount,
runnerAmount: get(this.props, "betAmount"),
module: "Bet Ticket",
betType: get(this.props, "wagerType.type.code"),
betId: get(this.props, "wagerType.type.id"),
runnerType:
get(this.props, "race.type.code") === "G" ? "Greyhound" : "Horse",
wagerSerialNumber: serialNumber
}
});
}
if (isMobile(this.tvgConf.product)) {
mediator.ios.dispatch({
type: "PUSHWOOSH_EVENTS",
payload: {
pushwooshTags: {
LastBet: (+(new Date().getTime() / 1000)).toFixed(0)
}
}
});
sendToAppsFlyer({
key: AppsFlyerEvents.AfBetCost,
values: {
accountId: this.props.accountNumber.toString(),
af_revenue: betCost.toString()
}
});
}
}
sendGtmRepeatBettingError(errorCode, numberOfBets = 1, betCount = 0) {
mediator.base.dispatch({
type: "BET_CONFIRMATION:BET_ERROR",
payload: {
error: errorCode,
module: "Repeat Bet Modal",
selections: mapSelectionsToString(get(this.props, "betSelections", [])),
trackName: get(this.props, "race.track.trackName"),
raceNumber: get(this.props, "race.raceNumber"),
betAmount: get(this.props, "betAmount", 1) * betCount,
runnerAmount: get(this.props, "betAmount"),
betId: get(this.props, "wagerType.type.id"),
betType: get(this.props, "wagerType.type.code"),
runnerType:
get(this.props, "race.type.code") === "G"
? "Greyhounds Racing"
: "Horse Racing",
repeatBet: numberOfBets.toString()
}
});
}
handleRepeatBetMessageError(status, fulfilled, requested) {
const isRaceClosedError = status.filter(
(item) =>
item.error && (item.error.code === 136505 || item.error.code === 136554)
);
if (isRaceClosedError.length > 0) {
let raceClosedErrorCode = -1;
const raceClosedError = isRaceClosedError[0];
if (raceClosedError.error) {
raceClosedErrorCode = raceClosedError.error.code;
}
// Race closed error is present amongst the error objects
return this.processErrorState(raceClosedErrorCode, fulfilled, requested);
}
const firstError = status.filter((item) => item.error);
const error = firstError[0];
let errorCode = -1;
if (error.error) {
errorCode = error.error.code;
}
return this.processErrorState(errorCode, fulfilled, requested);
}
handleRepeatBetSuccess(status, summary, numberOfBets = 1, betCount = 0) {
const { requested, fulfilled } = summary;
if (requested === fulfilled) {
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBetPlaced: true,
betConfirmationTitle: "Bet placed!",
repeatBetNumber: fulfilled
})
);
performanceUtils.measure("place_bet");
mediator.base.dispatch({
type: "BET_CONFIRMATION:BET_SUCCESS",
payload: {
selections: mapSelectionsToString(
get(this.props, "betSelections", [])
),
trackName: get(this.props, "race.track.trackName"),
module: "Repeat Bet Modal",
raceNumber: get(this.props, "race.raceNumber"),
betAmount: get(this.props, "betAmount", 1) * betCount,
runnerAmount: get(this.props, "betAmount"),
betId: get(this.props, "wagerType.type.id"),
betType: get(this.props, "wagerType.type.code"),
runnerType:
get(this.props, "race.type.code") === "G" ? "Greyhounds" : "Horse",
repeatBet: numberOfBets.toString()
}
});
if (isMobile(tvgConf().product)) {
mediator.ios.dispatch({
type: "PUSHWOOSH_EVENTS",
payload: {
pushwooshTags: {
LastBet: (+(new Date().getTime() / 1000)).toFixed(0)
}
}
});
}
} else {
// RB-29 - gtm guys didnt care about all the errors, sending the 1st
const failedBets = status.filter((r) => r.statusCode !== 200);
const failedBetsGtmError = failedBets[0]
? get(failedBets[0], "error.code")
: 400;
const allFailed = summary.requested === summary.failed;
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBettingError: true,
hasFeedback: true,
feedbackType: allFailed ? "error" : "warning",
...this.handleRepeatBetMessageError(status, fulfilled, requested)
})
);
this.sendGtmRepeatBettingError(
failedBetsGtmError,
numberOfBets,
betCount
);
}
}
showMessage(message, isGroup = false) {
if (isGroup) {
this.props.dispatch(setBetConfirmation(true));
}
this.props.dispatch(setBetTicketState(message));
}
handleBetError(errorCode, message, betCount = 0) {
const bets = Object.keys(get(this.props, "betTicketGroupStatus") || {});
const isSpecialGroup =
get(this.props, "wagerType.specialGroup", false) && bets.length > 1;
let errorBetMessage = this.parseErrorMessage(errorCode);
if (errorCode === 136457) {
const replaceObj = {
_betAmount:
this.props.talentPick && this.props.contextBT === "mep"
? get(this.props.talentPick, "amount", 0).toFixed(2)
: get(this.props, "betAmount", 0).toFixed(2),
_minAmount: message.split("=").pop().split(")")[0].trim()
};
errorBetMessage = this.props.betErrorMessageToggle
? errorBetMessage.replace(
/_betAmount|_minAmount/gi,
(matched) => replaceObj[matched]
)
: this.parseErrorMessage(errorCode + 1);
// we increment the errorCode by 1 because the next message is exactly the same as the old message
const responsibleGamingErrorCodes = [
BetError.wagerLimits,
BetError.maxWagerSizeLimit
];
this.showMessage(
{
isProcessing: false,
isBettingError: true,
betConfirmationTitle: "Bet not placed!",
errorBetMessage
},
isSpecialGroup || responsibleGamingErrorCodes.includes(errorCode)
);
}
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBettingError: true,
betConfirmationTitle: "Bet not placed!",
errorBetMessage
})
);
if (this.props.talentPick && this.props.contextBT === "mep") {
mediator.base.dispatch({
type: "TP_PROGRAMPAGE_BET_ERROR",
payload: {
action: "Bet Error",
label: errorBetMessage,
talentPickOrigin: this.props.talentPickTriggerOrigin,
tag: mapSelectionsToString(
get(this.props.talentPick, "selections", [])
),
race: {
raceNumber: get(this.props.talentPick, "race"),
track: {
trackName: get(this.props.talentPick, "trackName")
},
type: {
code: get(this.props.talentPick, "raceType")
}
},
betAmount: get(this.props.talentPick, "amount"),
betType: get(this.props.talentPick, "wagerType.abbreviation")
}
});
} else {
mediator.base.dispatch({
type: "BET_CONFIRMATION:BET_ERROR",
payload: {
error: errorCode,
module: this.props.showBetConfirmation
? "Confirm Bet Modal"
: "Bet Ticket",
selections: mapSelectionsToString(
get(this.props, "betSelections", [])
),
trackName: get(this.props, "race.track.trackName"),
raceNumber: get(this.props, "race.raceNumber"),
betAmount: get(this.props, "betAmount", 1) * betCount,
runnerAmount: get(this.props, "betAmount"),
betType: get(this.props, "wagerType.type.code"),
runnerType:
get(this.props, "race.type.code") === "G"
? "Greyhounds Racing"
: "Horse Racing"
}
});
}
}
handleRepeatBetError(errorCode, numberOfBets = 1, betCount = 0) {
const errorObj = this.processErrorState(errorCode);
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBettingError: true,
hasFeedback: true,
feedbackType: "error",
...errorObj
})
);
this.sendGtmRepeatBettingError(errorCode, numberOfBets, betCount);
}
submitBet(numberOfBets) {
const isRepeatBets = typeof numberOfBets === "number";
const totals = calculateTotals(
this.props.betAmount,
get(this.props, "wagerType"),
mapSelectionsToNumber(
getBetSelectionsToShow(
this.props.betSelections,
get(this.props, "bettingInterests", [])
)
)
);
const wagerSelection = mapSelectionsToNumber(
getBetSelectionsToShow(
this.props.betSelections,
get(this.props, "bettingInterests", [])
)
).map((column) => ({
bettingInterests: column.map((selection) => ({ order: selection }))
}));
const race = {
trackAbbr: get(this.props, "race.track.trackCode"),
raceNumber: get(this.props, "race.raceNumber")
};
const betCost = this.props.betAmount * totals.betCount;
performanceUtils.register("place_bet");
// --------- add overlay processing on betTicket
this.props.dispatch(
setBetTicketState({
isProcessing: true
})
);
const startBetTime = performance.now();
return wtx
.placeWager(
wagerSelection,
get(this.props, "wagerType.type.code"),
this.props.betAmount,
betCost,
race,
get(this.props, "geolocation.location"),
get(this.props, "geolocation.regions"),
this.props.accountNumber,
numberOfBets
)
.then((response) => {
sendAppMetrics("frontend-mbl", this.props.accountId, [
"bets_number",
{
name: "bet_placement_time",
value: Math.floor(performance.now() - startBetTime)
}
]);
if (response.summary) {
if (
response.summary.userBalance !== null &&
!isNaN(response.summary.userBalance)
) {
// new wtx approach
this.props.dispatch(updateBalance(response.summary.userBalance));
} else if (isRepeatBets) {
if (isFDR()) {
getBalance(this.props.dispatch, this.props.accountNumber);
} else {
uwt.getBalance(this.props.accountId, false).then((res) => {
const balance = get(res, "data.balance", undefined);
this.props.dispatch(updateBalance(balance));
});
}
}
// --------- remove overlay processing on betTicket
if (isRepeatBets) {
this.handleRepeatBetSuccess(
get(response, "status", []),
response.summary,
numberOfBets,
totals.betCount
);
} else {
this.handleBetSuccess(
totals.betCount,
betCost,
get(response, "status[0].success.serialNumber", "")
);
AlchemerEvents.placeABet();
}
if (this.props.showMyBetsCardDesign) {
this.props.dispatch(
setBetTicketState({
repeatBetNumber: numberOfBets
})
);
this.props.dispatch(clearBetRepeatNumber());
}
} else if (isRepeatBets) {
this.props.dispatch(
setBetTicketState({
isProcessing: false,
isBettingError: true,
hasFeedback: true,
feedbackType: "warning",
feedbackTitle: "Unable to repeat all your bets",
feedbackMsg:
"We were unable to check if the bets were all successfully submitted. Please check your bet history."
})
);
}
})
.catch((error) => {
sendAppMetrics("frontend-mbl", this.props.accountId, [
"bets_number",
"place_bets_error"
]);
if (isRepeatBets) {
this.handleRepeatBetError(
get(error.response, "data.code"),
numberOfBets,
totals.betCount
);
} else {
this.handleBetError(
get(error.response, "data.code"),
get(error.response, "data.message"),
totals.betCount
);
}
});
}
parseErrorMessage(code) {
const defaultMessage = "An error occurred while trying to place your bet.";
const wtxErrorMessages = attempt(() =>
JSON.parse(this.props.wtxErrorMessages)
);
return wtxErrorMessages[code] || defaultMessage;
}
dismissTalentPicksWarning = () => {
this.props.dispatch(noMandatoryTalentIdSelected(false));
};
tvgConf;
renderTalentHeader = () =>
this.props.showBetConfirmation &&
!this.props.pickEditButton &&
!!get(this.props, "talentPick", null) &&
get(this.props, "talentPick.talent.pictureUrl", "") !== ""
? () => (
<TalentPickConfirmationHeader
{...(get(this.props, "talentPick.talent.pictureUrl", "") !== ""
? {
talentImage: `//${this.tvgConf.config(
"domain.desktop"
)}/${get(this.props, "talentPick.talent.pictureUrl", "")}`
}
: {})}
message={this.props.betTicketState.randomTalentPhrase || ""}
/>
)
: noop;
render() {
const wagerType = get(this.props, "wagerType");
const repetitionsNr =
typeof this.props.betsNumber === "number"
? this.props.betsNumber
: this.props.betTicketState.repeatBetNumber;
const probableValue = getCurrentProbableValue(
get(this.props, "probables"),
wagerType,
this.props.betAmount,
get(this.props, "betSelections", []),
this.props.showMyBetsCardDesign ? repetitionsNr : 1
);
const totals =
this.props.isVisible && get(this.props, "wagerType.columnCount")
? calculateTotals(
get(this.props, "betAmount"),
get(this.props, "wagerType"),
mapSelectionsToNumber(
getBetSelectionsToShow(
get(this.props, "betSelections"),
get(this.props, "bettingInterests", [])
)
)
)
: { betCount: 0 };
return (
<Fragment>
<BetTicket
key="betTicketComponent"
selections={getBetSelectionsToShow(
this.props.betSelections,
get(this.props, "bettingInterests", [])
)}
onCancelBet={() => this.cancelBet(true)}
onPlaceBet={
this.props.contextBT === "mep"
? () => this.handleBetNow(totals.betCount)
: this.placePick
}
onChangeBetAmount={this.setBetAmount}
onCloseCustomAmountModal={this.onCloseCustomAmountModal}
betType={get(this.props, "wagerType.type.code")}
betTotal={this.props.betAmount * totals.betCount}
betAmounts={get(this.props, "wagerType.wagerAmounts")}
minimumWagerAmount={get(wagerType, "minWagerAmount")}
maxWagerAmount={get(wagerType, "maxWagerAmount")}
selectedBetAmount={this.props.betAmount}
raceTypeCode={get(this.props, "race.type.code")}
isVisible={this.props.isVisible}
hasOtherAmount
isBetDisabled={this.props.betAmount * totals.betCount <= 0}
isKey={get(this.props, "wagerType.isKey", false)}
isLeg={get(this.props, "wagerType.legCount", 1) > 1}
isProcessing={
this.props.betTicketState.isProcessing ||
this.props.isRequestingLocation
}
raceNumber={this.props.race.raceNumber}
modalType={this.props.columnLayout === "single" ? "bottom" : "fade"}
onWarningClose={this.handleCloseWarning}
scratchedSelectionMessage={getTitleScratchedRunners(
this.props.scratchedSelections
)}
onDismissError={() => this.resetState()}
isSelectionScratched={isScratchedSelections(
this.props.scratchedSelections
)}
isBettingError={
!+this.props.showBetConfirmationPreference &&
this.props.betTicketState.isBettingError
}
errorBetTitle={this.props.betTicketState.betConfirmationTitle}
errorBetMessage={this.props.betTicketState.errorBetMessage}
contextBT={this.props.contextBT}
favoriteRunners={this.props.favoriteSelections}
selectTalentIdErrorVisible={this.props.selectTalentIdErrorVisible}
dismissTalentPicksWarning={this.dismissTalentPicksWarning}
isMobile={this.props.columnLayout === "single"}
inIosAppTablet={
this.tvgConf.product === "ios2" && this.tvgConf.device === "tablet"
}
/>
<BetConfirmationModal
race={this.props.race}
wagerType={this.props.wagerType}
betSelections={this.props.betSelections}
betAmount={this.props.betAmount}
showBetConfirmation={this.props.showBetConfirmation}
isVideoShown={this.props.isVideoShown}
isProcessing={this.props.betTicketState.isProcessing}
isBetPlaced={this.props.betTicketState.isBetPlaced}
isBettingError={this.props.betTicketState.isBettingError}
betConfirmationTitle={this.props.betTicketState.betConfirmationTitle}
repeatBetTitle="Repeat bet"
errorBetMessage={this.props.betTicketState.errorBetMessage}
bettingInterests={this.props.bettingInterests}
isOpen={this.props.showBetConfirmation || this.props.showRepeatBet}
onRetain={this.onRetainRunners}
onBackToRace={this.onBackToRace}
onConfirmation={
this.props.contextBT === "mep" ? this.submitBet : this.submitPick
}
resetState={this.resetState}
modalType={this.props.columnLayout === "single" ? "bottom" : "fade"}
modalTopChildren={this.renderTalentHeader()}
contextBT={this.props.contextBT}
favoriteRunners={this.props.favoriteSelections}
repetitionsNr={repetitionsNr}
probableValue={probableValue}
showRepeatButton={
!this.props.betTicketState.isBettingError &&
(this.props.betTicketState.isBetPlaced || !!this.props.betsNumber)
}
hasFeedback={this.props.betTicketState.hasFeedback}
feedbackType={this.props.betTicketState.feedbackType}
partialFailure={this.props.betTicketState.partialFailure}
partialInfo={this.props.betTicketState.partialInfo}
partialInfoDetails={this.props.betTicketState.partialInfoDetails}
feedbackTitle={this.props.betTicketState.feedbackTitle}
feedbackMsg={this.props.betTicketState.feedbackMsg}
showRepeatBet={this.props.showRepeatBet}
/>
</Fragment>
);
}
}
export default connect(
(store, props) => ({
bettingInterests: props.bettingInterests,
race: props.race,
wagerType: props.wagerType,
columnLayout: props.columnLayout,
betSelections: props.betSelections,
betAmount: props.betAmount,
showBetConfirmation: props.showBetConfirmation,
scratchedSelections: props.scratchedSelections,
isVideoShown: props.isVideoShown,
isLogged: store.userData.logged,
accountNumber: getAccountNumber(store),
userHomeState: getResidenceState(store),
isAdmin: get(store, "userData.user.isAdmin"),
showBetConfirmationPreference: get(
store,
"userData.preferences.show_bet_confirm",
"1"
),
selectTalentIdErrorVisible: get(
store,
"TalentProgram.selectTalentIdErrorVisible",
false
),
geolocation: store.geolocation,
isLocationRequired: get(store, "locationSplash.isLocationRequired"),
isRequestingLocation: get(store, "locationSplash.isLoading"),
wtxErrorMessages: get(store, "capi.messages.wtxErrorMessages"),
statesUpdateLocationRequired: parseJSONCapiMessage(
store,
"capi.messages.statesUpdateLocationRequired",
[]
),
pickEditButton: get(store, "RaceProgram.pickEditButton", true),
betTicketState: store.BetTicket.config,
betsNumber: get(store, "BetTicket.repeatBetNumber"),
showRepeatBet: props.showRepeatBet,
talentPickTriggerOrigin: get(
store,
"RaceProgram.talentPickTriggerOrigin",
null
),
betErrorMessageToggle: get(
store,
"capi.featureToggles.betErrorMessage",
false
),
updateLocationRequired: get(
store,
"capi.featureToggles.updateLocationRequired",
false
),
showMyBetsCardDesign: getShowMyBetsCardDesign(store),
accountId: getAccountNumber(store)
}),
(dispatch) => ({ dispatch })
)(BetTicketComponent);
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/TalentPickRaceCardComponent/index.jsx
import React, { Component, Fragment } from "react";
import { connect } from "react-redux";
import {
get,
find,
isEqual,
every,
slice,
findIndex,
noop,
includes
} from "lodash";
import ModalV2 from "@tvg/atomic-ui/_templates/ModalV2";
import WagerTypeSelector from "@tvg/atomic-ui/_templates/WagerTypeSelector";
import RaceCard from "@tvg/atomic-ui/_templates/RaceCard";
import { handicapping, sorting } from "@tvg/atomic-ui/_static/Icons/icons";
import buildColor from "@tvg/atomic-ui/_static/ColorPalette";
import mediator from "@tvg/mediator";
import BetSelectionUtils from "@tvg/utils/betSelectionUtils";
import RaceHeaderUtils from "@tvg/utils/RaceHeaderUtils";
import getRunnersInfoForRaceCard from "@tvg/utils/handicappingUtils";
import TracksAzComponent from "@tvg/tracks/src/tracks-az";
import BetTicketComp from "@tvg/bet";
import {
setQueryWithRacesAction,
setRaceSelectorModalStateAction,
setCurrentRaceAction,
talentPicksRaceSelectorOpen
} from "@tvg/shared-actions/ProgramActions";
import {
setSelectionRequest,
setFavoriteSelectionRequest,
resetSelection,
setBetState,
setStartBetting,
setBetType,
setBetAmount,
setPickLeg,
setSelectionScratched,
resetBetting
} from "@tvg/shared-actions/BetActions";
import { sortRunnersSelections } from "@tvg/api/wtx/BetHelper";
import { getAccountNumber } from "@urp/store-selectors";
const closedRaces = ["RO", "SK"];
/*
100 Quinella Wheel
130 Exacta Wheel
180 Trifecta Wheel
230 Superfecta Wheel
280 Superhighfive Wheel
880 Omni Wheel
*/
const notAllowedBets = [100, 130, 180, 230, 280, 880];
const getStartIndex = (races, column) => {
// get index of the 1st race
const startIndex = findIndex(races, (race) => column === +race.raceNumber);
return startIndex < 0 ? 0 : startIndex;
};
export const getRaceCardRaces = (props) => {
const numberOfLegs = get(props, "betType.legCount");
if (numberOfLegs > 1) {
const races = get(props, "races", []);
// get index of the 1st race
const startIndex = getStartIndex(races, props.raceNumber);
const legs = slice(races, startIndex, startIndex + numberOfLegs);
const trackData = {
bettingInterests: [],
racesData: []
};
if (get(props, "currentRace.track.trackCode", "").includes("HKS")) {
legs.forEach((race) => {
trackData.bettingInterests.push(
BetSelectionUtils.filterHKCoupledEntries(
get(race, "bettingInterests", [])
)
);
trackData.racesData.push(RaceHeaderUtils.createRaceDataForHeader(race));
});
} else {
legs.forEach((race) => {
trackData.bettingInterests.push(get(race, "bettingInterests", []));
trackData.racesData.push(RaceHeaderUtils.createRaceDataForHeader(race));
});
}
return trackData;
}
return {
bettingInterests: [
get(props, "currentRace.track.trackCode", "").includes("HKS")
? BetSelectionUtils.filterHKCoupledEntries(
get(props, "currentRace.bettingInterests", [])
)
: get(props, "currentRace.bettingInterests", [])
],
racesData: [RaceHeaderUtils.createRaceDataForHeader(props.currentRace)]
};
};
export const getBetableRunners = (bettingInterests = []) => {
const noScratchedRunners = [];
bettingInterests.forEach((bettingInterest) => {
if (
!every(
get(bettingInterest, "runners"),
(runner) => runner.scratched === true
)
) {
noScratchedRunners.push(get(bettingInterest, "biNumber").toString());
}
});
return noScratchedRunners;
};
export class RaceCardComponent extends Component {
static defaultProps = {
betSelections: [[]],
betState: "none",
startBetting: false,
isVideoShown: false,
betType: null,
betAmount: 0,
isHandicappingModalOpen: false,
fixWagerSelector: {
isWagerSelectorFixed: false,
fixedOffset: 0
},
favoriteSelections: [[]],
scratchedSelections: [[]],
isTalentsRaceSelectorOpen: false,
showBetConfirmation: false,
talentList: [],
isAdmin: false,
accountNumber: -1,
selectedTalentId: ""
};
constructor(props) {
super(props);
this.state = { isMainWagerType: true };
this.props.dispatch(resetSelection());
this.props.dispatch(setBetState("none"));
// set BetType, BetAmount, PickLeg and betSelections
const defaultBetType = BetSelectionUtils.getDefaultBetType(
this.props.currentRace
);
this.updateBetType(get(defaultBetType, "type"));
}
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
if (
this.props.currentRace.id !== get(nextProps, "currentRace.id", "") ||
!nextProps.betType
) {
this.setState({ isMainWagerType: true });
}
if (
!isEqual(get(this.props, "currentRace"), get(nextProps, "currentRace"))
) {
this.props.dispatch(setCurrentRaceAction(get(nextProps, "currentRace")));
}
}
shouldComponentUpdate(nextProps, nextState) {
return (
nextProps.shouldUpdate &&
(!isEqual(nextProps.currentRace, this.props.currentRace) ||
!isEqual(nextProps.betSelections, this.props.betSelections) ||
!isEqual(
nextProps.scratchedSelections,
this.props.scratchedSelections
) ||
!isEqual(nextProps.favoriteSelections, this.props.favoriteSelections) ||
!isEqual(
nextProps.showBetConfirmation,
this.props.showBetConfirmation
) ||
!isEqual(nextProps.betState, this.props.betState) ||
!isEqual(nextProps.startBetting, this.props.startBetting) ||
!isEqual(nextProps.betType, this.props.betType) ||
!isEqual(nextProps.betLeg, this.props.betLeg) ||
!isEqual(nextProps.races, this.props.races) ||
!isEqual(nextProps.accountNumber, this.props.accountNumber) ||
!isEqual(nextProps.isAdmin, this.props.isAdmin) ||
nextProps.betAmount !== this.props.betAmount ||
nextProps.isTalentsRaceSelectorOpen !==
this.props.isTalentsRaceSelectorOpen ||
nextProps.selectedTalentId !== this.props.selectedTalentId ||
this.state.isMainWagerType !== nextState.isMainWagerType)
);
}
componentDidUpdate(prevProps) {
// if no bet type select pre select the first from list
const raceIsClosed =
closedRaces.indexOf(get(this.props, "currentRace.status.code")) > -1;
const raceWasNotClosed =
closedRaces.indexOf(get(prevProps, "currentRace.status.code")) === -1;
// disable bet ticket when race is off
if (raceIsClosed && raceWasNotClosed) {
this.resetBetting();
}
if (!this.props.betType) {
this.updateBetType();
}
if (this.props.betType && !this.props.betAmount) {
this.props.dispatch(
setBetAmount(get(this.props, "betType.wagerAmounts[0]", 0))
);
}
if (
get(this.props, "betType.legCount") === get(prevProps, "betType.legCount")
) {
const bettingInts = getRaceCardRaces(this.props).bettingInterests;
const prevBettingInts = getRaceCardRaces(prevProps).bettingInterests;
if (
bettingInts.join().length === prevBettingInts.join().length &&
!isEqual(bettingInts, prevBettingInts)
) {
const diffArr = [];
const newSelection = [];
for (let i = 0; i < get(this.props, "betType.columnCount"); i += 1) {
newSelection.push([]);
}
for (let i = 0; i < get(this.props, "betType.legCount"); i += 1) {
diffArr.push([]);
}
bettingInts.forEach((bettingInt, indexTop) =>
bettingInt.forEach((bi, indexMed) =>
bi.runners.forEach(
(runner, ind) =>
runner.scratched !==
prevBettingInts[indexTop][indexMed].runners[ind].scratched &&
diffArr[
get(this.props, "betType.legCount") > 1 ? indexTop : 0
].push(runner.runnerId)
)
)
);
this.props.betSelections.forEach((selections, index) =>
selections.forEach(
(selection) =>
!diffArr[
get(this.props, "betType.legCount") > 1 ? index : 0
].includes(selection.toString()) &&
newSelection[index].push(selection)
)
);
if (
newSelection.join().length !== this.props.betSelections.join().length
) {
// set new selections
this.props.dispatch(setSelectionRequest(newSelection));
this.props.dispatch(setStartBetting());
// set scratched runners
this.props.dispatch(setSelectionScratched(diffArr));
}
}
}
}
componentWillUnmount() {
this.resetBetting();
this.props.dispatch(setRaceSelectorModalStateAction(false));
this.props.dispatch(setQueryWithRacesAction(false));
this.props.dispatch(setCurrentRaceAction({}));
}
onTalentsRaceSelectorClose = () => {
this.props.dispatch(talentPicksRaceSelectorOpen());
};
onBackToMainWagerTypeSelector = () => {
this.setState({ isMainWagerType: true });
mediator.base.dispatch({ type: "PPM_BET_TYPE:GO_BACK" });
};
onSelectRunner = (selection, column = 0, fromIcon = true) => {
if (fromIcon) {
this.selectRunner(selection, column);
} else {
this.selectFavoriteRunner(selection, column);
}
};
setPickLeg = (leg = 0) => {
this.props.dispatch(setPickLeg(leg));
};
getCurrentBettingInterests = (column) =>
get(this.props, "betType.legCount") > 1
? get(
this.props,
`races[${
getStartIndex(this.props.races, this.props.raceNumber) + column
}].bettingInterests`
)
: get(this.props, "currentRace.bettingInterests");
getWagerTypeFromList = (wagerType) => {
const id = get(wagerType, "id");
return find(
get(this.props, "currentRace.wagerTypes", []),
(wt) => wt.type.id === id
);
};
getListOfWagerTypes = () => {
const racesWagerTypes = get(this.props, "currentRace.wagerTypes", []);
return racesWagerTypes
.map((wagerType) => ({
type: wagerType.type,
group: wagerType.group,
legCount: wagerType.legCount,
isKey: wagerType.isKey,
isWheel: wagerType.isWheel,
isBox: wagerType.isBox
}))
.filter((wt) => notAllowedBets.indexOf(wt.type.id) === -1);
};
getTalentInfo = () => {
if (this.props.isAdmin) {
const talent = find(
this.props.talentList,
(value) => value.talentId === this.props.selectedTalentId
);
return talent || {};
}
const talent = find(
this.props.talentList,
(value) => value.tvgAccountId === this.props.accountNumber
);
return talent || {};
};
shouldShowBetTicket = () => {
if (this.props.startBetting && this.props.betType) {
mediator.ios.dispatch({
type: "TOGGLE_BACKGROUND_COLOR",
payload: {
backgroundColor: buildColor("white", "100")
}
});
} else {
mediator.ios.dispatch({
type: "TOGGLE_BACKGROUND_COLOR",
payload: {
backgroundColor: buildColor("blue", "500")
}
});
}
return !!(this.props.startBetting && this.props.betType);
};
updateBetType = (wagerType) => {
const wt =
this.getWagerTypeFromList(wagerType) ||
get(this.props, "currentRace.wagerTypes[0]");
const betAmount = get(wt, "wagerAmounts[0]") || 0;
this.props.dispatch(setBetType(wt));
this.props.dispatch(setBetAmount(betAmount));
this.props.dispatch(setPickLeg(0));
// build matrix for the new betType
BetSelectionUtils.configureProgramPageByBetType(
get(wt, "columnCount"),
get(wt, "legCount"),
get(wt, "type.id"),
this.props.betSelections,
this.props.dispatch
);
};
selectBetType = (wagerType, groupWagerType) => {
this.setState({ isMainWagerType: false });
if (wagerType.id !== get(this.props, "betType.type.id")) {
this.updateBetType(wagerType);
mediator.base.dispatch({
type: "PPM_SELECT_BET_TYPE",
payload: {
primaryType: !groupWagerType ? wagerType.name : groupWagerType.name,
secondaryType: !groupWagerType ? "" : wagerType.name
}
});
}
// show hide betTicket
this.props.dispatch(setStartBetting(true));
};
selectAllRunners = (column = 0) => {
let columnSelection = [];
// should not make a select all on key column
if (get(this.props, "betType.isKey") && column === 0) {
return;
}
// TODO add logic for picks
const selection = get(this.props, `betSelections[${column}]`);
let allBetableRunners = getBetableRunners(
this.getCurrentBettingInterests(column)
);
// isKey --- key is founded on betSelections on position 0/0 of matrix
if (get(this.props, "betType.isKey")) {
const keySelection = get(this.props, "betSelections[0][0]");
if (keySelection) {
allBetableRunners = allBetableRunners.filter(
(value) => value !== keySelection
);
}
}
// Add all runner on column
if (allBetableRunners.length !== selection.length) {
this.setState({ isMainWagerType: false });
columnSelection = allBetableRunners;
}
// replace old column with new on the matrix
const newSelection = this.props.betSelections.slice();
newSelection[column] = columnSelection;
if (newSelection[column].length === 0) {
const favColumn = get(this.props, "betType.legCount", 1) > 1 ? column : 0;
const favorite = this.props.favoriteSelections[favColumn][0];
this.removeFavoriteOnUnselectRunner(favorite, column);
}
this.props.dispatch(setSelectionRequest(newSelection));
// show hide betTicket
this.props.dispatch(
setStartBetting(BetSelectionUtils.hasSelections(newSelection))
);
};
selectFavoriteRunner = (selection, column = 0) => {
let runnerSelected = false;
if (
get(this.props, "betType.legCount", 1) <= 1 &&
this.props.betSelections.length > 1
) {
for (let i = 0; i < this.props.betSelections.length; i += 1) {
if (includes(this.props.betSelections[i], selection)) {
runnerSelected = true;
break;
}
}
} else {
runnerSelected = includes(this.props.betSelections[column], selection);
}
if (runnerSelected) {
const columnSelection = [];
const selectionString = `${selection}`;
// find selection selection on column
const findSelection = this.props.favoriteSelections[
get(this.props, "betType.legCount", 1) > 1 ? column : 0
].find((runner) => runner === selectionString);
if (!findSelection) {
columnSelection.push(selectionString);
}
// replace old column with new on the matrix
const newSelection = this.props.favoriteSelections.slice();
newSelection[column] = columnSelection;
// save matrix on redux store
this.props.dispatch(setFavoriteSelectionRequest(newSelection));
}
};
removeFavoriteOnUnselectRunner = (selection, column) => {
let runnerSelected = false;
let multiSelection = false;
if (
get(this.props, "betType.legCount", 1) <= 1 &&
this.props.betSelections.length > 1
) {
if (includes(this.props.favoriteSelections[0], `${selection}`)) {
for (let i = 0; i < this.props.betSelections.length; i += 1) {
if (includes(this.props.betSelections[i], selection)) {
if (runnerSelected) {
multiSelection = true;
break;
}
runnerSelected = true;
}
}
}
} else {
runnerSelected = includes(
this.props.favoriteSelections[column],
`${selection}`
);
}
if (runnerSelected && !multiSelection) {
// remove favorite
this.selectFavoriteRunner(
selection,
get(this.props, "betType.legCount", 1) > 1 ? column : 0
);
}
};
selectRunner = (selection, column = 0) => {
let columnSelection = [];
// find selection selection on column
const findSelection = this.props.betSelections[column].find(
(runner) => runner === selection
);
if (findSelection) {
// remove selection from column
this.removeFavoriteOnUnselectRunner(selection, column);
columnSelection = this.props.betSelections[column].filter(
(runnerId) => runnerId !== selection
);
} else {
// add selection to the column
this.setState({ isMainWagerType: false });
columnSelection = get(this.props, `betSelections[${column}]`).slice();
columnSelection.push(selection);
}
// reorder column
columnSelection = columnSelection.sort(sortRunnersSelections);
// replace old column with new on the matrix
const newSelection = this.props.betSelections.slice();
const isKey = get(this.props, "betType.isKey", false);
// handle keys and wheels
if (isKey || get(this.props, "betType.isWheel", false)) {
if (column === 0) {
columnSelection = columnSelection.filter(
(value) => value === selection
);
const current = get(newSelection, "[1]", []);
newSelection[1] = isKey
? current.filter((value) => value !== selection)
: current;
} else {
const current = get(newSelection, "[0]", []);
newSelection[0] = isKey
? current.filter((value) => value !== selection)
: current;
}
}
newSelection[column] = columnSelection;
// save matrix on redux store
this.props.dispatch(setSelectionRequest(newSelection));
// show hide betTicket
this.props.dispatch(
setStartBetting(BetSelectionUtils.hasSelections(newSelection))
);
};
resetBetting() {
this.props.dispatch(resetBetting());
}
isAllSelected() {
const resIsAllSelected = [];
let keySelection;
// isKey get key selected on 1st column
if (get(this.props, "betType.isKey")) {
keySelection = get(this.props, "betSelections[0][0]");
}
// get betable runners for 1st leg or single race
let betableRunners = getBetableRunners(this.getCurrentBettingInterests(0));
this.props.betSelections.forEach((selection, index) => {
// get betable runners multiple race bets
if (get(this.props, "betType.legCount") > 1 && index > 0) {
betableRunners = getBetableRunners(
this.getCurrentBettingInterests(index)
);
}
// if key selected the all selected id the total less 1 position
if (keySelection) {
resIsAllSelected.push(selection.length === betableRunners.length - 1);
} else {
resIsAllSelected.push(selection.length === betableRunners.length);
}
});
return resIsAllSelected;
}
renderBetTicket = (trackData) => {
const talent = this.getTalentInfo();
return (
<BetTicketComp
key="raceCardBetTicket"
isVisible={this.props.startBetting}
bettingInterests={trackData.bettingInterests}
race={this.props.currentRace}
wagerType={get(this.props, "betType")}
betSelections={this.props.betSelections}
betAmount={this.props.betAmount}
columnLayout="single"
showBetConfirmation={this.props.showBetConfirmation}
isVideoShown={false}
scratchedSelections={this.props.scratchedSelections}
contextBT="talentPicks"
favoriteSelections={this.props.favoriteSelections}
talentPick={{ talent }}
selectedTalentId={this.props.selectedTalentId}
/>
);
};
render() {
if (get(this.props, "currentRace.bettingInterests")) {
const legCount = get(this.props, "betType.legCount");
const trackData = getRaceCardRaces(this.props);
const wagerable = get(this.props, "currentRace.wagerable");
const raceSelectorProps = {
title: "Race Selector",
isOpen: this.props.isTalentsRaceSelectorOpen,
onClose: this.onTalentsRaceSelectorClose,
qaLabel: "talents-RaceSelector",
offsetTop: 0,
isFullHeight: true,
isFullWidth: true,
animation: "fade"
};
const handicapOptions = [
{
title: "Handicapping Info",
callback: noop,
icon: handicapping,
visible: true,
qaLabel: "runnerListHeader-handicapInfoBtn"
},
{
title: "Sort",
callback: noop,
icon: sorting,
visible: false,
qaLabel: "runnerListHeader-handicapSortBtn"
}
];
return (
<Fragment>
{wagerable && (
<WagerTypeSelector
wagerTypes={this.getListOfWagerTypes()}
active={get(this.props, "betType.type.code")}
activeRace={this.props.betLeg}
onSelectWagerType={this.selectBetType}
onSelectLegRace={this.setPickLeg}
onBackToMainWagerTypeSelector={this.onBackToMainWagerTypeSelector}
isMainWagerType={this.state.isMainWagerType}
raceNumber={this.props.raceNumber}
/>
)}
<RaceCard
key="BetRaceCard"
bettingInterests={getRunnersInfoForRaceCard(
trackData.bettingInterests,
"basic",
get(this.props, "currentRace.isGreyhound"),
get(this.props, "currentRace.track.trackCode"),
false,
true
)}
racesData={trackData.racesData}
raceTypeCode={get(this.props, "currentRace.type.code")}
isWagerable={wagerable}
selections={this.props.betSelections}
isKey={get(this.props, "betType.isKey")}
isWheel={get(this.props, "betType.isWheel")}
numColumns={legCount > 1 ? 1 : this.props.betSelections.length}
isAllSelected={this.isAllSelected()}
onRunnerSelect={this.onSelectRunner}
onAllRunnersSelect={this.selectAllRunners}
selectedLeg={this.props.betLeg}
onLegSelect={this.setPickLeg}
handicapType="basic"
firstHandicapBold
isFavoriteSelectionActive
favoriteSelections={this.props.favoriteSelections}
expandLine={(runner) => {
this.onSelectRunner(
runner.runnerId,
runner.column,
runner.fromIcon
);
}}
hasHandicappingSelection
handicapOptions={handicapOptions}
isGreyhound={get(this.props, "currentRace.isGreyhound")}
/>
{this.props.startBetting && this.renderBetTicket(trackData)}
<ModalV2 {...raceSelectorProps}>
{() => (
<TracksAzComponent
shouldUpdate={this.props.isTalentsRaceSelectorOpen}
signalLoadedComponent={noop}
isTalentPicksContext
onTalentPicksModalToggle={this.onTalentsRaceSelectorClose}
/>
)}
</ModalV2>
</Fragment>
);
}
return "";
}
}
export default connect(
(store, props) => ({
currentRace: props.currentRace,
races: props.races,
raceNumber: props.raceNumber,
shouldUpdate: props.shouldUpdate,
startBetting: store.TalentProgram.startBetting,
showBetConfirmation: store.TalentProgram.showBetConfirmation,
betType: store.TalentProgram.betType,
betAmount: store.TalentProgram.betAmount,
fixWagerSelector: store.TalentProgram.fixWagerSelector,
betState: store.TalentProgram.betState,
betSelections: store.TalentProgram.betSelections,
favoriteSelections: store.TalentProgram.favoriteSelections,
scratchedSelections: store.TalentProgram.scratchedSelections,
betLeg: store.TalentProgram.betLeg,
isTalentsRaceSelectorOpen: store.TalentProgram.isTalentsRaceSelectorOpen,
isLoading: store.TalentProgramLoading,
selectedTalentId: store.TalentProgram.selectedTalentId,
talentList: store.Talents.talentsList,
accountNumber: getAccountNumber(store),
isAdmin: get(store, "userData.user.isAdmin")
}),
(dispatch) => ({ dispatch })
)(RaceCardComponent);
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/TalentListDropdown/styled-components.js
import styled from "styled-components";
import { buildTitle } from "../../_atom/Title";
import buildColor from "../../_static/ColorPalette";
export const ArrowContainer = styled.span`
display: flex;
padding-left: 8px;
align-self: center;
`;
export const Title = buildTitle({
tag: "h3",
fontSize: 16,
color: buildColor("white", "100"),
bold: true,
uppercase: true,
qaLabel: "raceLink-trackName"
});
export const Container = styled.button`
display: flex;
position: relative;
align-items: center;
justify-content: space-between;
padding: 0 8px;
text-decoration: none;
border-radius: 2px;
outline: none;
width: 100%;
height: 48px;
background: ${buildColor("black", "30")};
color: ${buildColor("white", "100")};
&:active {
background-color: ${buildColor("white", "10")};
}
`;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_organism/TalentListDropdown/index.jsx
import React, { PureComponent } from "react";
import { noop } from "lodash";
import buildColor from "../../_static/ColorPalette";
import { arrowDown } from "../../_static/Icons/icons";
import Icon from "../../_static/Icons";
import { ArrowContainer, Title, Container } from "./styled-components";
export default class TalentPickSelector extends PureComponent {
static defaultProps = {
onClickCallback: noop,
selectedTalentName: "On behalf of"
};
render() {
return (
<Container
onTouchStart={noop}
onClick={() => this.props.onClickCallback()}
>
<Title>{this.props.selectedTalentName}</Title>
<ArrowContainer>
<Icon size={16} icon={arrowDown} color={buildColor("white", "100")} />
</ArrowContainer>
</Container>
);
}
}
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/TalentPicksRaceCardHeader/styled-components.js
import styled from "styled-components";
import buildColor from "../../_static/ColorPalette";
import { buildText } from "../../_atom/Text/index";
const RaceHeaderContainer = styled.div`
background-color: ${buildColor("blue", "700")};
padding: 8px;
`;
export const LeftContainer = styled.div`
display: flex;
& button:first-child {
width: 52px;
}
`;
export const WrapSpan = styled(
buildText({
tag: "span"
})
)`
padding-left: 4px;
`;
export const TalentSelect = styled.select`
position: absolute;
top: 0;
right: 0;
width: calc(100% - 16px);
height: 48px;
opacity: 0;
padding: 0;
`;
export const RaceInfoContainer = styled.div`
margin: 8px 0;
`;
export const SelectorContainerWrapper = styled.div`
display: flex;
flex: 0 0 auto;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
@media (width <= 736px) {
flex-direction: column;
}
`;
export const Subcontainer = styled.div`
position: relative;
${(props) => (props.isTalentLoggedIn ? "width: 100%" : "width: 49%")};
& > button {
width: 100%;
}
@media (width <= 736px) {
width: 100%;
&:last-child {
padding-top: 8px;
}
}
`;
export default RaceHeaderContainer;
webpack://frontend-tpt/../../packages/tvg-atomic-ui/_templates/TalentPicksRaceCardHeader/index.jsx
import React, { PureComponent } from "react";
import { get, noop, findIndex } from "lodash";
import RaceNavigation from "../../_organism/RaceNavigation";
import TalentsListDropdown from "../../_organism/TalentListDropdown";
import RaceInfoInline from "../../_molecule/RaceInfoInline";
import RaceHeaderContainer, {
Subcontainer,
TalentSelect,
RaceInfoContainer,
SelectorContainerWrapper
} from "./styled-components";
const TALENT_DEFAULT_LABEL = "On behalf of";
export default class TalentPicksRaceCardHeader extends PureComponent {
static defaultProps = {
raceInfo: {},
raceData: {},
openRaceNavigation: noop,
onOpenTalentPicksTalentDropdown: noop,
onChangeTalentPicksTalentDropdown: noop,
isControlsDisabled: false,
talentsList: [],
isTalentLoggedIn: false
};
onHandleTalentChange = (event) => {
if (!(event.target instanceof window.HTMLSelectElement)) {
return;
}
this.props.onChangeTalentPicksTalentDropdown(event.target.value);
};
renderRaceInfo = () => (
<RaceInfoContainer>
<RaceInfoInline
description={get(this.props, "raceData.highlightedDescription")}
importanceLevel={get(this.props, "raceData.importanceLevel")}
raceData={get(this.props, "raceData.raceInfo")}
isDark
isRaceDataChangesShown
/>
</RaceInfoContainer>
);
render() {
const selectedTalentIndex = findIndex(
this.props.talentsList,
(talent) => talent.talentId === this.props.selectedTalentId
);
const talentName =
selectedTalentIndex >= 0
? this.props.talentsList[selectedTalentIndex].name
: TALENT_DEFAULT_LABEL;
return (
<RaceHeaderContainer data-qa-label="talentsRaceCardHeader">
<SelectorContainerWrapper>
<Subcontainer isTalentLoggedIn={this.props.isTalentLoggedIn}>
<RaceNavigation
{...this.props.raceInfo}
onClickCallback={this.props.onOpenRaceNavigation}
arrowType="arrowRight"
/>
</Subcontainer>
{!this.props.isTalentLoggedIn && (
<Subcontainer isTalentLoggedIn={this.props.isTalentLoggedIn}>
<TalentsListDropdown
onClickCallback={this.props.onOpenTalentPicksTalentDropdown}
selectedTalentName={talentName}
/>
<TalentSelect
data-qa-label="talentsListSelect"
onChange={this.onHandleTalentChange}
value={this.props.selectedTalentId}
>
<option key="talent-none" value="">
{TALENT_DEFAULT_LABEL}
</option>
{this.props.talentsList &&
!!this.props.talentsList.length &&
this.props.talentsList.map((talent) => (
<option
key={`talent-${talent.talentId}`}
value={talent.talentId}
>
{talent.name}
</option>
))}
</TalentSelect>
</Subcontainer>
)}
</SelectorContainerWrapper>
{this.renderRaceInfo()}
</RaceHeaderContainer>
);
}
}
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/TalentPickRaceCardHeaderComponent/index.jsx
import React, { Component } from "react";
import { connect } from "react-redux";
import { get, bindAll, isEqual } from "lodash";
import TalentPickRaceCardHeader from "@tvg/atomic-ui/_templates/TalentPicksRaceCardHeader";
import RaceHeaderUtils from "@tvg/utils/RaceHeaderUtils";
import {
talentPicksRaceSelectorOpen,
talentPicksTalentDropdown,
setSelectedTalentId
} from "@tvg/shared-actions/ProgramActions";
import {
noMandatoryTalentIdSelected,
resetBetting
} from "@tvg/shared-actions/BetActions";
export class TalentPickRaceHeaderComponent extends Component {
static defaultProps = {
selectTalentIdErrorVisible: false,
currentRace: {},
talentsList: [],
selectedTalentId: "",
isAdmin: false
};
constructor(props) {
super(props);
bindAll(this, [
"talentPicksRaceSelectorOpen",
"talentPicksTalentDropdown",
"talentPicksChangeTalentDropdown"
]);
}
shouldComponentUpdate(nextProps) {
return !isEqual(nextProps, this.props);
}
componentDidUpdate(prevProps) {
if (
prevProps.currentRace.raceNumber !== this.props.currentRace.raceNumber ||
get(prevProps, "currentRace.track.trackCode") !==
get(this.props, "currentRace.track.trackCode")
) {
this.props.dispatch(resetBetting());
}
}
talentPicksRaceSelectorOpen() {
this.props.dispatch(talentPicksRaceSelectorOpen());
}
talentPicksTalentDropdown() {
this.props.dispatch(talentPicksTalentDropdown());
}
talentPicksChangeTalentDropdown(id) {
if (
this.props.isAdmin &&
this.props.selectTalentIdErrorVisible &&
id !== ""
) {
this.props.dispatch(noMandatoryTalentIdSelected(false));
}
this.props.dispatch(setSelectedTalentId(id));
}
render() {
const { currentRace } = this.props;
const raceInfo = {
mtp: get(currentRace, "mtp"),
raceNumber: get(currentRace, "raceNumber"),
trackAbbr: get(currentRace, "track.trackCode"),
trackName: get(currentRace, "track.shortName"),
status: get(currentRace, "status.code"),
postTime: get(currentRace, "postTime"),
isGreyhound: get(currentRace, "type.code") === "G"
};
const raceData = {
highlightedDescription: get(currentRace, "highlighted.description", ""),
importanceLevel:
get(this.props, "currentRace.highlighted.style") === "Normal"
? "0"
: "1",
raceInfo: RaceHeaderUtils.createRaceDataForHeader(currentRace, true)
};
return (
<TalentPickRaceCardHeader
raceData={raceData}
raceInfo={raceInfo}
onOpenRaceNavigation={this.talentPicksRaceSelectorOpen}
onOpenTalentPicksTalentDropdown={this.talentPicksTalentDropdown}
onChangeTalentPicksTalentDropdown={this.talentPicksChangeTalentDropdown}
talentsList={this.props.talentsList}
selectedTalentId={this.props.selectedTalentId}
isTalentLoggedIn={!this.props.isAdmin}
/>
);
}
}
export default connect(
(store) => ({
talentsList: store.Talents.talentsList,
selectedTalentId: store.TalentProgram.selectedTalentId,
isAdmin: get(store, "userData.user.isAdmin"),
selectTalentIdErrorVisible: get(
store,
"TalentProgram.selectTalentIdErrorVisible",
false
)
}),
(dispatch) => ({ dispatch })
)(TalentPickRaceHeaderComponent);
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/TalentPickRaceCardWrapper/index.jsx
import React, { PureComponent, Fragment } from "react";
import { get, find, isEmpty } from "lodash";
import { graphql } from "@apollo/client/react/hoc";
import ProgramPageMask from "@tvg/atomic-ui/_static/Masks/program-page";
import RaceQuery from "../graphql/queries/RaceProgramQuery";
import ApolloOptions from "../graphql/options.graph";
import TalentPickRaceCard from "../TalentPickRaceCardComponent";
import TalentPickRaceCardHeaderComponent from "../TalentPickRaceCardHeaderComponent";
export const trackNameHandler = (trackName = "") =>
trackName.trim().replace(/\s/g, "-").replace(/-+/g, "-").toLowerCase();
export class TalentPickRaceCardWrapper extends PureComponent {
render() {
const race =
find(
this.props.races,
(tempRace) => tempRace.raceNumber === this.props.raceNumber
) || {};
return !isEmpty(race) ? (
<Fragment>
<TalentPickRaceCardHeaderComponent currentRace={race} />
<TalentPickRaceCard
shouldUpdate={this.props.shouldUpdate}
races={get(this.props, "races", [])}
currentRace={race}
raceNumber={+this.props.raceNumber}
/>
</Fragment>
) : (
<ProgramPageMask />
);
}
}
export default graphql(RaceQuery, ApolloOptions)(TalentPickRaceCardWrapper);
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/index.jsx
import React, { PureComponent, Fragment } from "react";
import RaceCardWrapper from "./TalentPickRaceCardWrapper";
export class TalentPickProgramComponent extends PureComponent {
render() {
return (
<Fragment>
<RaceCardWrapper
trackName={this.props.trackName}
trackAbbr={this.props.trackAbbr}
raceNumber={this.props.raceNumber}
wagerProfile={this.props.wagerProfile}
shouldUpdate={this.props.shouldUpdate}
withRaces={this.props.withRaces}
/>
</Fragment>
);
}
}
export default TalentPickProgramComponent;
webpack://frontend-tpt/./src/pages/components/ComponentRouter.tsx
import React from "react";
import { Route, Routes } from "react-router-dom";
import { get } from "lodash";
import type { RouteType, TransitionState } from "../../types";
import HomePage from "./Home";
import ProgramPage from "./Program";
import RedirectPage from "./RedirectPage";
import RoutesConfig from "../Routes";
const ComponentMap = {
default: HomePage,
home: HomePage,
program: ProgramPage,
redirect: RedirectPage
};
export const PageRoutes: Array<RouteType> = RoutesConfig.map((route) => ({
...route,
component: get(ComponentMap, route.key)
}));
interface Props {
// eslint-disable-next-line react/no-unused-prop-types
location: Location;
prevPath: string;
isLogged: boolean;
accountNumber: number;
isAdmin: boolean;
state?: TransitionState;
}
export default (props: Props) => (
<Routes>
{PageRoutes.map(
(Page: RouteType) =>
Page.component && (
<Route
path={Page.path}
key={Page.key}
// @ts-ignore
exact={Page.exact}
element={
// eslint-disable-next-line react/jsx-pascal-case
<Page.component
// @ts-ignore
transitionState={props.state}
prevPath={props.prevPath}
isLogged={props.isLogged}
accountNumber={props.accountNumber}
isAdmin={props.isAdmin}
/>
}
/>
)
).filter(Boolean)}
</Routes>
);
webpack://frontend-tpt/./src/pages/components/Program.tsx
import React, { PureComponent } from "react";
import { get } from "lodash";
// @ts-ignore
import TalentProgram from "@tvg/talent-program";
import withRouter from "@tvg/utils/withCustomRouter";
const getRaceNumber = (race: string = ""): string => {
if (race && race.length) {
const raceNumber = race.split("-");
return raceNumber.length > 0 ? raceNumber[1] : raceNumber[0];
}
return "1";
};
export class Program extends PureComponent<unknown> {
constructor() {
// @ts-ignore
super();
if (typeof window !== "undefined") {
const { body } = document;
if (body) {
body.classList.toggle("modal", false);
}
}
}
render() {
/**
* Get race number from route param
*/
const raceNumber = getRaceNumber(
get(this.props, "match.params.raceNumber")
);
const trackAbbr = get(this.props, "match.params.trackAbbr");
const trackName = get(this.props, "match.params.trackName");
return (
// $FlowFixMe
<TalentProgram
trackAbbr={trackAbbr}
raceNumber={raceNumber}
trackName={trackName}
wagerProfile="PORT-AllTracks"
withRaces
shouldUpdate
/>
);
}
}
export default withRouter(Program);
webpack://frontend-tpt/./src/pages/components/RedirectPage.tsx
import React from "react";
import { Navigate } from "react-router-dom";
const RedirectPage = () => <Navigate to="/talent-picks/" replace />;
export default RedirectPage;
webpack://frontend-tpt/./src/pages/Routes.ts
import type { RouteType } from "../types";
const Routes: Array<RouteType> = [
{
key: "default",
path: "/talent-picks",
exact: true
},
{
key: "home",
name: "Home",
path: "/talent-picks/home",
exact: false
},
{
key: "program",
name: "Program",
path: "/talent-picks/program/:trackAbbr/:trackName/:raceNumber",
exact: false
},
{
key: "redirect",
path: "*",
exact: false
}
];
export default Routes;
webpack://frontend-tpt/./src/pages/Main.tsx
import React from "react";
import { type Location } from "react-router-dom";
import { Containers } from "@tvg/atomic-ui/_static/BaseComponents";
import withRouter from "@tvg/utils/withCustomRouter";
import ComponentRouter from "./components/ComponentRouter";
interface Props {
location: Location;
prevPath: string;
isLogged: boolean;
accountNumber: number;
isAdmin: boolean;
isBetting: boolean;
}
const Main = ({
location,
prevPath,
isLogged,
accountNumber,
isAdmin,
isBetting
}: Props) => (
<Containers.MainTool isBetting={isBetting}>
<ComponentRouter
// @ts-ignore
location={location}
prevPath={prevPath}
isLogged={isLogged}
accountNumber={accountNumber}
isAdmin={isAdmin}
/>
</Containers.MainTool>
);
export default withRouter(Main);
webpack://frontend-tpt/./src/pages/index.tsx
import React, { Component, Fragment } from "react";
import { connect } from "react-redux";
import type { Dispatch } from "redux";
import { get, attempt, isEqual, intersection, includes } from "lodash";
import tvgConf from "@tvg/conf";
import "@tvg/mobile-login";
import mediator from "@tvg/mediator";
import { Containers } from "@tvg/atomic-ui/_static/BaseComponents";
import ErrorPage from "@tvg/atomic-ui/_templates/ErrorPage";
import withRouter from "@tvg/utils/withCustomRouter";
import { TvgConf } from "@tvg/conf/src/types";
import Header from "./components/Header";
import TalentFetchingService from "../services/talentsFetchingService/talentsFetchingService";
import {
type UserData,
getUserData,
setUserAccountNumber,
setUserAdminUpdate
} from "../actions/user";
import { type State, initialState } from "../reducers/App/appReducer";
import Main from "./Main";
const RolesEnum = { TALENT: "TALENT", WAGEROPS: "WAGEROPS", ADMIN: "ADMIN" };
// eslint-disable-next-line
export class Root extends Component<any, State> {
// eslint-disable-next-line
constructor(props: any) {
super(props);
this.tvg = tvgConf();
}
state: State = initialState;
componentDidMount() {
// tries to get the user id (accountNumber) from localStorage and dispatch it to user data
// this is useful because every component initialized by tvg-mobile will know if the user is logged, plus it's
// account number beforehand
attempt(() => {
const userId = window.localStorage.getItem("userId");
if (userId) {
this.props.dispatch(setUserAccountNumber(userId));
}
});
this.fetchTalents();
// eslint-disable-next-line
mediator.base.subscribe("TVG_LOGIN:USER_SESSION_UPDATE", (data: any) => {
const user: UserData = get(data, "payload");
let isAppReady = false;
if (get(user, "user")) {
this.props.dispatch(getUserData(user));
if (this.hasValidPermissions(user)) {
isAppReady = true;
this.setState({ isAppReady });
}
}
if (!isAppReady && typeof window !== "undefined") {
//
window.location.href = `https://${this.tvg.config("domain.desktop")}`;
}
});
}
// eslint-disable-next-line
shouldComponentUpdate(nextProps: any, nextState: any) {
return !isEqual(nextProps, this.props) || !isEqual(nextState, this.state);
}
// eslint-disable-next-line
componentDidUpdate(prevProps: any) {
if (
typeof window !== "undefined" &&
get(prevProps, "location.pathname") !==
get(this.props, "location.pathname")
) {
window.scrollTo(0, 0);
}
}
getHigherRole = () => {
if (includes(this.props.user.accountRoles, RolesEnum.ADMIN)) {
return "Admin";
}
if (includes(this.props.user.accountRoles, RolesEnum.WAGEROPS)) {
return "WagerOps";
}
return "";
};
fetchTalents = () => {
TalentFetchingService.makeRequest(this.props.dispatch);
};
hasValidPermissions = (userData: UserData) => {
const isAdmin =
userData.logged &&
intersection(userData.user.accountRoles, [
RolesEnum.WAGEROPS,
RolesEnum.ADMIN
]).length > 0;
this.props.dispatch(setUserAdminUpdate(isAdmin));
return (
userData.logged &&
(isAdmin || includes(userData.user.accountRoles, RolesEnum.TALENT))
);
};
tvg: TvgConf;
render() {
return !this.state.isAppReady ? (
<Containers.LoadingAppContainer>
<ErrorPage icon="loading" title="Loading APP" />
</Containers.LoadingAppContainer>
) : (
<>
<Header
userName={`${this.props.user.firstName} ${this.props.user.lastName}`}
userRole={this.getHigherRole()}
currentUrl={this.props.location.pathname}
/>
<Main
key="main"
prevPath={this.state.prevPath}
isLogged={this.props.user.isLogged}
isBetting={this.props.isBetting}
/>
</>
);
}
}
export default connect(
// $FlowFixMe
(store) => ({
user: {
isLogged: get(store, "userData.logged", false),
accountNumber: get(store, "userData.user.accountNumber"),
userName: get(store, "userData.user.userName"),
firstName: get(store, "userData.user.firstName", ""),
lastName: get(store, "userData.user.lastName", ""),
accountRoles: get(store, "userData.user.accountRoles", [])
},
isBetting: get(store, "TalentProgram.startBetting", false)
}),
(dispatch: Dispatch) => ({ dispatch })
)(withRouter(Root));
webpack://frontend-tpt/./src/services/talentsFetchingService/talentsFetchingService.ts
import axios from "axios";
import { get } from "lodash";
import { type Dispatch } from "redux";
import tvgConf from "@tvg/conf";
import { type Talent } from "@tvg/ts-types/Talent";
import {
type Actions,
successRequest,
failRequest,
successNoResults,
talentsPageLoading
} from "./actions";
interface TalentsResponse {
data: Talent[];
}
const talentTimeout = () => (typeof window === "object" ? 10000 : 500);
const talentServiceEndpoint = () =>
typeof window === "undefined" &&
typeof process !== "undefined" &&
get(process, "env.ENVIRONMENT") !== "development"
? "//service-qa.tvg.com/tpm/v1/talents"
: `${tvgConf().config("service.tpm")}/talents`;
const requestOptions = () => ({
url: talentServiceEndpoint(),
method: "get",
timeout: talentTimeout(),
withCredentials: true,
headers: {
"content-type": "application/json"
},
data: {
isActive: true
}
});
const handleResponse = (
response: TalentsResponse,
dispatch: Dispatch<Actions>
): Actions => {
if (!response || !response.data) {
return dispatch(
failRequest(new Error("Failed to retrieve data from Talents service"))
);
}
if (!get(response, "data.length")) {
return dispatch(successNoResults());
}
const talents = response.data.filter((talent) => talent.isActive);
return dispatch(successRequest(talents));
};
const makeRequest = (dispatch: Dispatch<Actions>): Promise<Actions> => {
const options = requestOptions();
return (
axios(options)
// $FlowFixMe
.then(
(talentsData: TalentsResponse): Actions =>
handleResponse(talentsData, dispatch)
)
.catch((err) => dispatch(failRequest(err)))
.then(() => dispatch(talentsPageLoading(false)))
);
};
export default {
makeRequest
};
webpack://frontend-tpt/../../node_modules/zen-observable-ts/module.js
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
// === Symbol Support ===
var hasSymbols = function () {
return typeof Symbol === 'function';
};
var hasSymbol = function (name) {
return hasSymbols() && Boolean(Symbol[name]);
};
var getSymbol = function (name) {
return hasSymbol(name) ? Symbol[name] : '@@' + name;
};
if (hasSymbols() && !hasSymbol('observable')) {
Symbol.observable = Symbol('observable');
}
var SymbolIterator = getSymbol('iterator');
var SymbolObservable = getSymbol('observable');
var SymbolSpecies = getSymbol('species'); // === Abstract Operations ===
function getMethod(obj, key) {
var value = obj[key];
if (value == null) return undefined;
if (typeof value !== 'function') throw new TypeError(value + ' is not a function');
return value;
}
function getSpecies(obj) {
var ctor = obj.constructor;
if (ctor !== undefined) {
ctor = ctor[SymbolSpecies];
if (ctor === null) {
ctor = undefined;
}
}
return ctor !== undefined ? ctor : Observable;
}
function isObservable(x) {
return x instanceof Observable; // SPEC: Brand check
}
function hostReportError(e) {
if (hostReportError.log) {
hostReportError.log(e);
} else {
setTimeout(function () {
throw e;
});
}
}
function enqueue(fn) {
Promise.resolve().then(function () {
try {
fn();
} catch (e) {
hostReportError(e);
}
});
}
function cleanupSubscription(subscription) {
var cleanup = subscription._cleanup;
if (cleanup === undefined) return;
subscription._cleanup = undefined;
if (!cleanup) {
return;
}
try {
if (typeof cleanup === 'function') {
cleanup();
} else {
var unsubscribe = getMethod(cleanup, 'unsubscribe');
if (unsubscribe) {
unsubscribe.call(cleanup);
}
}
} catch (e) {
hostReportError(e);
}
}
function closeSubscription(subscription) {
subscription._observer = undefined;
subscription._queue = undefined;
subscription._state = 'closed';
}
function flushSubscription(subscription) {
var queue = subscription._queue;
if (!queue) {
return;
}
subscription._queue = undefined;
subscription._state = 'ready';
for (var i = 0; i < queue.length; ++i) {
notifySubscription(subscription, queue[i].type, queue[i].value);
if (subscription._state === 'closed') break;
}
}
function notifySubscription(subscription, type, value) {
subscription._state = 'running';
var observer = subscription._observer;
try {
var m = getMethod(observer, type);
switch (type) {
case 'next':
if (m) m.call(observer, value);
break;
case 'error':
closeSubscription(subscription);
if (m) m.call(observer, value);else throw value;
break;
case 'complete':
closeSubscription(subscription);
if (m) m.call(observer);
break;
}
} catch (e) {
hostReportError(e);
}
if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';
}
function onNotify(subscription, type, value) {
if (subscription._state === 'closed') return;
if (subscription._state === 'buffering') {
subscription._queue.push({
type: type,
value: value
});
return;
}
if (subscription._state !== 'ready') {
subscription._state = 'buffering';
subscription._queue = [{
type: type,
value: value
}];
enqueue(function () {
return flushSubscription(subscription);
});
return;
}
notifySubscription(subscription, type, value);
}
var Subscription = /*#__PURE__*/function () {
function Subscription(observer, subscriber) {
// ASSERT: observer is an object
// ASSERT: subscriber is callable
this._cleanup = undefined;
this._observer = observer;
this._queue = undefined;
this._state = 'initializing';
var subscriptionObserver = new SubscriptionObserver(this);
try {
this._cleanup = subscriber.call(undefined, subscriptionObserver);
} catch (e) {
subscriptionObserver.error(e);
}
if (this._state === 'initializing') this._state = 'ready';
}
var _proto = Subscription.prototype;
_proto.unsubscribe = function unsubscribe() {
if (this._state !== 'closed') {
closeSubscription(this);
cleanupSubscription(this);
}
};
_createClass(Subscription, [{
key: "closed",
get: function () {
return this._state === 'closed';
}
}]);
return Subscription;
}();
var SubscriptionObserver = /*#__PURE__*/function () {
function SubscriptionObserver(subscription) {
this._subscription = subscription;
}
var _proto2 = SubscriptionObserver.prototype;
_proto2.next = function next(value) {
onNotify(this._subscription, 'next', value);
};
_proto2.error = function error(value) {
onNotify(this._subscription, 'error', value);
};
_proto2.complete = function complete() {
onNotify(this._subscription, 'complete');
};
_createClass(SubscriptionObserver, [{
key: "closed",
get: function () {
return this._subscription._state === 'closed';
}
}]);
return SubscriptionObserver;
}();
var Observable = /*#__PURE__*/function () {
function Observable(subscriber) {
if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');
if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');
this._subscriber = subscriber;
}
var _proto3 = Observable.prototype;
_proto3.subscribe = function subscribe(observer) {
if (typeof observer !== 'object' || observer === null) {
observer = {
next: observer,
error: arguments[1],
complete: arguments[2]
};
}
return new Subscription(observer, this._subscriber);
};
_proto3.forEach = function forEach(fn) {
var _this = this;
return new Promise(function (resolve, reject) {
if (typeof fn !== 'function') {
reject(new TypeError(fn + ' is not a function'));
return;
}
function done() {
subscription.unsubscribe();
resolve();
}
var subscription = _this.subscribe({
next: function (value) {
try {
fn(value, done);
} catch (e) {
reject(e);
subscription.unsubscribe();
}
},
error: reject,
complete: resolve
});
});
};
_proto3.map = function map(fn) {
var _this2 = this;
if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');
var C = getSpecies(this);
return new C(function (observer) {
return _this2.subscribe({
next: function (value) {
try {
value = fn(value);
} catch (e) {
return observer.error(e);
}
observer.next(value);
},
error: function (e) {
observer.error(e);
},
complete: function () {
observer.complete();
}
});
});
};
_proto3.filter = function filter(fn) {
var _this3 = this;
if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');
var C = getSpecies(this);
return new C(function (observer) {
return _this3.subscribe({
next: function (value) {
try {
if (!fn(value)) return;
} catch (e) {
return observer.error(e);
}
observer.next(value);
},
error: function (e) {
observer.error(e);
},
complete: function () {
observer.complete();
}
});
});
};
_proto3.reduce = function reduce(fn) {
var _this4 = this;
if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');
var C = getSpecies(this);
var hasSeed = arguments.length > 1;
var hasValue = false;
var seed = arguments[1];
var acc = seed;
return new C(function (observer) {
return _this4.subscribe({
next: function (value) {
var first = !hasValue;
hasValue = true;
if (!first || hasSeed) {
try {
acc = fn(acc, value);
} catch (e) {
return observer.error(e);
}
} else {
acc = value;
}
},
error: function (e) {
observer.error(e);
},
complete: function () {
if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));
observer.next(acc);
observer.complete();
}
});
});
};
_proto3.concat = function concat() {
var _this5 = this;
for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
sources[_key] = arguments[_key];
}
var C = getSpecies(this);
return new C(function (observer) {
var subscription;
var index = 0;
function startNext(next) {
subscription = next.subscribe({
next: function (v) {
observer.next(v);
},
error: function (e) {
observer.error(e);
},
complete: function () {
if (index === sources.length) {
subscription = undefined;
observer.complete();
} else {
startNext(C.from(sources[index++]));
}
}
});
}
startNext(_this5);
return function () {
if (subscription) {
subscription.unsubscribe();
subscription = undefined;
}
};
});
};
_proto3.flatMap = function flatMap(fn) {
var _this6 = this;
if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');
var C = getSpecies(this);
return new C(function (observer) {
var subscriptions = [];
var outer = _this6.subscribe({
next: function (value) {
if (fn) {
try {
value = fn(value);
} catch (e) {
return observer.error(e);
}
}
var inner = C.from(value).subscribe({
next: function (value) {
observer.next(value);
},
error: function (e) {
observer.error(e);
},
complete: function () {
var i = subscriptions.indexOf(inner);
if (i >= 0) subscriptions.splice(i, 1);
completeIfDone();
}
});
subscriptions.push(inner);
},
error: function (e) {
observer.error(e);
},
complete: function () {
completeIfDone();
}
});
function completeIfDone() {
if (outer.closed && subscriptions.length === 0) observer.complete();
}
return function () {
subscriptions.forEach(function (s) {
return s.unsubscribe();
});
outer.unsubscribe();
};
});
};
_proto3[SymbolObservable] = function () {
return this;
};
Observable.from = function from(x) {
var C = typeof this === 'function' ? this : Observable;
if (x == null) throw new TypeError(x + ' is not an object');
var method = getMethod(x, SymbolObservable);
if (method) {
var observable = method.call(x);
if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');
if (isObservable(observable) && observable.constructor === C) return observable;
return new C(function (observer) {
return observable.subscribe(observer);
});
}
if (hasSymbol('iterator')) {
method = getMethod(x, SymbolIterator);
if (method) {
return new C(function (observer) {
enqueue(function () {
if (observer.closed) return;
for (var _iterator = _createForOfIteratorHelperLoose(method.call(x)), _step; !(_step = _iterator()).done;) {
var item = _step.value;
observer.next(item);
if (observer.closed) return;
}
observer.complete();
});
});
}
}
if (Array.isArray(x)) {
return new C(function (observer) {
enqueue(function () {
if (observer.closed) return;
for (var i = 0; i < x.length; ++i) {
observer.next(x[i]);
if (observer.closed) return;
}
observer.complete();
});
});
}
throw new TypeError(x + ' is not observable');
};
Observable.of = function of() {
for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
items[_key2] = arguments[_key2];
}
var C = typeof this === 'function' ? this : Observable;
return new C(function (observer) {
enqueue(function () {
if (observer.closed) return;
for (var i = 0; i < items.length; ++i) {
observer.next(items[i]);
if (observer.closed) return;
}
observer.complete();
});
});
};
_createClass(Observable, null, [{
key: SymbolSpecies,
get: function () {
return this;
}
}]);
return Observable;
}();
if (hasSymbols()) {
Object.defineProperty(Observable, Symbol('extensions'), {
value: {
symbol: SymbolObservable,
hostReportError: hostReportError
},
configurable: true
});
}
export { Observable };
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/graphql/fragments.js
import { __assign, __spreadArray } from "tslib";
import { invariant, newInvariantError } from "../globals/index.js";
/**
* Returns a query document which adds a single query operation that only
* spreads the target fragment inside of it.
*
* So for example a document of:
*
* ```graphql
* fragment foo on Foo { a b c }
* ```
*
* Turns into:
*
* ```graphql
* { ...foo }
*
* fragment foo on Foo { a b c }
* ```
*
* The target fragment will either be the only fragment in the document, or a
* fragment specified by the provided `fragmentName`. If there is more than one
* fragment, but a `fragmentName` was not defined then an error will be thrown.
*/
export function getFragmentQueryDocument(document, fragmentName) {
var actualFragmentName = fragmentName;
// Build an array of all our fragment definitions that will be used for
// validations. We also do some validations on the other definitions in the
// document while building this list.
var fragments = [];
document.definitions.forEach(function (definition) {
// Throw an error if we encounter an operation definition because we will
// define our own operation definition later on.
if (definition.kind === "OperationDefinition") {
throw newInvariantError(
71,
definition.operation,
definition.name ? " named '".concat(definition.name.value, "'") : ""
);
}
// Add our definition to the fragments array if it is a fragment
// definition.
if (definition.kind === "FragmentDefinition") {
fragments.push(definition);
}
});
// If the user did not give us a fragment name then let us try to get a
// name from a single fragment in the definition.
if (typeof actualFragmentName === "undefined") {
invariant(fragments.length === 1, 72, fragments.length);
actualFragmentName = fragments[0].name.value;
}
// Generate a query document with an operation that simply spreads the
// fragment inside of it.
var query = __assign(__assign({}, document), { definitions: __spreadArray([
{
kind: "OperationDefinition",
// OperationTypeNode is an enum
operation: "query",
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: {
kind: "Name",
value: actualFragmentName,
},
},
],
},
}
], document.definitions, true) });
return query;
}
// Utility function that takes a list of fragment definitions and makes a hash out of them
// that maps the name of the fragment to the fragment definition.
export function createFragmentMap(fragments) {
if (fragments === void 0) { fragments = []; }
var symTable = {};
fragments.forEach(function (fragment) {
symTable[fragment.name.value] = fragment;
});
return symTable;
}
export function getFragmentFromSelection(selection, fragmentMap) {
switch (selection.kind) {
case "InlineFragment":
return selection;
case "FragmentSpread": {
var fragmentName = selection.name.value;
if (typeof fragmentMap === "function") {
return fragmentMap(fragmentName);
}
var fragment = fragmentMap && fragmentMap[fragmentName];
invariant(fragment, 73, fragmentName);
return fragment || null;
}
default:
return null;
}
}
//# sourceMappingURL=fragments.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/canonicalStringify.js
import { AutoCleanedStrongCache, cacheSizes, } from "../../utilities/caching/index.js";
import { registerGlobalCache } from "../caching/getMemoryInternals.js";
/**
* Like JSON.stringify, but with object keys always sorted in the same order.
*
* To achieve performant sorting, this function uses a Map from JSON-serialized
* arrays of keys (in any order) to sorted arrays of the same keys, with a
* single sorted array reference shared by all permutations of the keys.
*
* As a drawback, this function will add a little bit more memory for every
* object encountered that has different (more, less, a different order of) keys
* than in the past.
*
* In a typical application, this extra memory usage should not play a
* significant role, as `canonicalStringify` will be called for only a limited
* number of object shapes, and the cache will not grow beyond a certain point.
* But in some edge cases, this could be a problem, so we provide
* canonicalStringify.reset() as a way of clearing the cache.
* */
export var canonicalStringify = Object.assign(function canonicalStringify(value) {
return JSON.stringify(value, stableObjectReplacer);
}, {
reset: function () {
// Clearing the sortingMap will reclaim all cached memory, without
// affecting the logical results of canonicalStringify, but potentially
// sacrificing performance until the cache is refilled.
sortingMap = new AutoCleanedStrongCache(cacheSizes.canonicalStringify || 1000 /* defaultCacheSizes.canonicalStringify */);
},
});
if (globalThis.__DEV__ !== false) {
registerGlobalCache("canonicalStringify", function () { return sortingMap.size; });
}
// Values are JSON-serialized arrays of object keys (in any order), and values
// are sorted arrays of the same keys.
var sortingMap;
canonicalStringify.reset();
// The JSON.stringify function takes an optional second argument called a
// replacer function. This function is called for each key-value pair in the
// object being stringified, and its return value is used instead of the
// original value. If the replacer function returns a new value, that value is
// stringified as JSON instead of the original value of the property.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#the_replacer_parameter
function stableObjectReplacer(key, value) {
if (value && typeof value === "object") {
var proto = Object.getPrototypeOf(value);
// We don't want to mess with objects that are not "plain" objects, which
// means their prototype is either Object.prototype or null. This check also
// prevents needlessly rearranging the indices of arrays.
if (proto === Object.prototype || proto === null) {
var keys = Object.keys(value);
// If keys is already sorted, let JSON.stringify serialize the original
// value instead of creating a new object with keys in the same order.
if (keys.every(everyKeyInOrder))
return value;
var unsortedKey = JSON.stringify(keys);
var sortedKeys = sortingMap.get(unsortedKey);
if (!sortedKeys) {
keys.sort();
var sortedKey = JSON.stringify(keys);
// Checking for sortedKey in the sortingMap allows us to share the same
// sorted array reference for all permutations of the same set of keys.
sortedKeys = sortingMap.get(sortedKey) || keys;
sortingMap.set(unsortedKey, sortedKeys);
sortingMap.set(sortedKey, sortedKeys);
}
var sortedObject_1 = Object.create(proto);
// Reassigning the keys in sorted order will cause JSON.stringify to
// serialize them in sorted order.
sortedKeys.forEach(function (key) {
sortedObject_1[key] = value[key];
});
return sortedObject_1;
}
}
return value;
}
// Since everything that happens in stableObjectReplacer benefits from being as
// efficient as possible, we use a static function as the callback for
// keys.every in order to test if the provided keys are already sorted without
// allocating extra memory for a callback.
function everyKeyInOrder(key, i, keys) {
return i === 0 || keys[i - 1] <= key;
}
//# sourceMappingURL=canonicalStringify.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/graphql/storeUtils.js
import { newInvariantError } from "../globals/index.js";
import { isNonNullObject } from "../common/objects.js";
import { getFragmentFromSelection } from "./fragments.js";
import { canonicalStringify } from "../common/canonicalStringify.js";
export function makeReference(id) {
return { __ref: String(id) };
}
export function isReference(obj) {
return Boolean(obj && typeof obj === "object" && typeof obj.__ref === "string");
}
export function isDocumentNode(value) {
return (isNonNullObject(value) &&
value.kind === "Document" &&
Array.isArray(value.definitions));
}
function isStringValue(value) {
return value.kind === "StringValue";
}
function isBooleanValue(value) {
return value.kind === "BooleanValue";
}
function isIntValue(value) {
return value.kind === "IntValue";
}
function isFloatValue(value) {
return value.kind === "FloatValue";
}
function isVariable(value) {
return value.kind === "Variable";
}
function isObjectValue(value) {
return value.kind === "ObjectValue";
}
function isListValue(value) {
return value.kind === "ListValue";
}
function isEnumValue(value) {
return value.kind === "EnumValue";
}
function isNullValue(value) {
return value.kind === "NullValue";
}
export function valueToObjectRepresentation(argObj, name, value, variables) {
if (isIntValue(value) || isFloatValue(value)) {
argObj[name.value] = Number(value.value);
}
else if (isBooleanValue(value) || isStringValue(value)) {
argObj[name.value] = value.value;
}
else if (isObjectValue(value)) {
var nestedArgObj_1 = {};
value.fields.map(function (obj) {
return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables);
});
argObj[name.value] = nestedArgObj_1;
}
else if (isVariable(value)) {
var variableValue = (variables || {})[value.name.value];
argObj[name.value] = variableValue;
}
else if (isListValue(value)) {
argObj[name.value] = value.values.map(function (listValue) {
var nestedArgArrayObj = {};
valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables);
return nestedArgArrayObj[name.value];
});
}
else if (isEnumValue(value)) {
argObj[name.value] = value.value;
}
else if (isNullValue(value)) {
argObj[name.value] = null;
}
else {
throw newInvariantError(82, name.value, value.kind);
}
}
export function storeKeyNameFromField(field, variables) {
var directivesObj = null;
if (field.directives) {
directivesObj = {};
field.directives.forEach(function (directive) {
directivesObj[directive.name.value] = {};
if (directive.arguments) {
directive.arguments.forEach(function (_a) {
var name = _a.name, value = _a.value;
return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables);
});
}
});
}
var argObj = null;
if (field.arguments && field.arguments.length) {
argObj = {};
field.arguments.forEach(function (_a) {
var name = _a.name, value = _a.value;
return valueToObjectRepresentation(argObj, name, value, variables);
});
}
return getStoreKeyName(field.name.value, argObj, directivesObj);
}
var KNOWN_DIRECTIVES = [
"connection",
"include",
"skip",
"client",
"rest",
"export",
"nonreactive",
];
// Default stable JSON.stringify implementation used by getStoreKeyName. Can be
// updated/replaced with something better by calling
// getStoreKeyName.setStringify(newStringifyFunction).
var storeKeyNameStringify = canonicalStringify;
export var getStoreKeyName = Object.assign(function (fieldName, args, directives) {
if (args &&
directives &&
directives["connection"] &&
directives["connection"]["key"]) {
if (directives["connection"]["filter"] &&
directives["connection"]["filter"].length > 0) {
var filterKeys = directives["connection"]["filter"] ?
directives["connection"]["filter"]
: [];
filterKeys.sort();
var filteredArgs_1 = {};
filterKeys.forEach(function (key) {
filteredArgs_1[key] = args[key];
});
return "".concat(directives["connection"]["key"], "(").concat(storeKeyNameStringify(filteredArgs_1), ")");
}
else {
return directives["connection"]["key"];
}
}
var completeFieldName = fieldName;
if (args) {
// We can't use `JSON.stringify` here since it's non-deterministic,
// and can lead to different store key names being created even though
// the `args` object used during creation has the same properties/values.
var stringifiedArgs = storeKeyNameStringify(args);
completeFieldName += "(".concat(stringifiedArgs, ")");
}
if (directives) {
Object.keys(directives).forEach(function (key) {
if (KNOWN_DIRECTIVES.indexOf(key) !== -1)
return;
if (directives[key] && Object.keys(directives[key]).length) {
completeFieldName += "@".concat(key, "(").concat(storeKeyNameStringify(directives[key]), ")");
}
else {
completeFieldName += "@".concat(key);
}
});
}
return completeFieldName;
}, {
setStringify: function (s) {
var previous = storeKeyNameStringify;
storeKeyNameStringify = s;
return previous;
},
});
export function argumentsObjectFromField(field, variables) {
if (field.arguments && field.arguments.length) {
var argObj_1 = {};
field.arguments.forEach(function (_a) {
var name = _a.name, value = _a.value;
return valueToObjectRepresentation(argObj_1, name, value, variables);
});
return argObj_1;
}
return null;
}
export function resultKeyNameFromField(field) {
return field.alias ? field.alias.value : field.name.value;
}
export function getTypenameFromResult(result, selectionSet, fragmentMap) {
var fragments;
for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) {
var selection = _a[_i];
if (isField(selection)) {
if (selection.name.value === "__typename") {
return result[resultKeyNameFromField(selection)];
}
}
else if (fragments) {
fragments.push(selection);
}
else {
fragments = [selection];
}
}
if (typeof result.__typename === "string") {
return result.__typename;
}
if (fragments) {
for (var _b = 0, fragments_1 = fragments; _b < fragments_1.length; _b++) {
var selection = fragments_1[_b];
var typename = getTypenameFromResult(result, getFragmentFromSelection(selection, fragmentMap).selectionSet, fragmentMap);
if (typeof typename === "string") {
return typename;
}
}
}
}
export function isField(selection) {
return selection.kind === "Field";
}
export function isInlineFragment(selection) {
return selection.kind === "InlineFragment";
}
//# sourceMappingURL=storeUtils.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/graphql/getFromAST.js
import { invariant, newInvariantError } from "../globals/index.js";
import { valueToObjectRepresentation } from "./storeUtils.js";
// Checks the document for errors and throws an exception if there is an error.
export function checkDocument(doc) {
invariant(doc && doc.kind === "Document", 74);
var operations = doc.definitions
.filter(function (d) { return d.kind !== "FragmentDefinition"; })
.map(function (definition) {
if (definition.kind !== "OperationDefinition") {
throw newInvariantError(75, definition.kind);
}
return definition;
});
invariant(operations.length <= 1, 76, operations.length);
return doc;
}
export function getOperationDefinition(doc) {
checkDocument(doc);
return doc.definitions.filter(function (definition) {
return definition.kind === "OperationDefinition";
})[0];
}
export function getOperationName(doc) {
return (doc.definitions
.filter(function (definition) {
return definition.kind === "OperationDefinition" && !!definition.name;
})
.map(function (x) { return x.name.value; })[0] || null);
}
// Returns the FragmentDefinitions from a particular document as an array
export function getFragmentDefinitions(doc) {
return doc.definitions.filter(function (definition) {
return definition.kind === "FragmentDefinition";
});
}
export function getQueryDefinition(doc) {
var queryDef = getOperationDefinition(doc);
invariant(queryDef && queryDef.operation === "query", 77);
return queryDef;
}
export function getFragmentDefinition(doc) {
invariant(doc.kind === "Document", 78);
invariant(doc.definitions.length <= 1, 79);
var fragmentDef = doc.definitions[0];
invariant(fragmentDef.kind === "FragmentDefinition", 80);
return fragmentDef;
}
/**
* Returns the first operation definition found in this document.
* If no operation definition is found, the first fragment definition will be returned.
* If no definitions are found, an error will be thrown.
*/
export function getMainDefinition(queryDoc) {
checkDocument(queryDoc);
var fragmentDefinition;
for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) {
var definition = _a[_i];
if (definition.kind === "OperationDefinition") {
var operation = definition.operation;
if (operation === "query" ||
operation === "mutation" ||
operation === "subscription") {
return definition;
}
}
if (definition.kind === "FragmentDefinition" && !fragmentDefinition) {
// we do this because we want to allow multiple fragment definitions
// to precede an operation definition.
fragmentDefinition = definition;
}
}
if (fragmentDefinition) {
return fragmentDefinition;
}
throw newInvariantError(81);
}
export function getDefaultValues(definition) {
var defaultValues = Object.create(null);
var defs = definition && definition.variableDefinitions;
if (defs && defs.length) {
defs.forEach(function (def) {
if (def.defaultValue) {
valueToObjectRepresentation(defaultValues, def.variable.name, def.defaultValue);
}
});
}
return defaultValues;
}
//# sourceMappingURL=getFromAST.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/core/ApolloLink.js
import { newInvariantError, invariant } from "../../utilities/globals/index.js";
import { Observable } from "../../utilities/index.js";
import { validateOperation, createOperation, transformOperation, } from "../utils/index.js";
function passthrough(op, forward) {
return (forward ? forward(op) : Observable.of());
}
function toLink(handler) {
return typeof handler === "function" ? new ApolloLink(handler) : handler;
}
function isTerminating(link) {
return link.request.length <= 1;
}
var ApolloLink = /** @class */ (function () {
function ApolloLink(request) {
if (request)
this.request = request;
}
ApolloLink.empty = function () {
return new ApolloLink(function () { return Observable.of(); });
};
ApolloLink.from = function (links) {
if (links.length === 0)
return ApolloLink.empty();
return links.map(toLink).reduce(function (x, y) { return x.concat(y); });
};
ApolloLink.split = function (test, left, right) {
var leftLink = toLink(left);
var rightLink = toLink(right || new ApolloLink(passthrough));
var ret;
if (isTerminating(leftLink) && isTerminating(rightLink)) {
ret = new ApolloLink(function (operation) {
return test(operation) ?
leftLink.request(operation) || Observable.of()
: rightLink.request(operation) || Observable.of();
});
}
else {
ret = new ApolloLink(function (operation, forward) {
return test(operation) ?
leftLink.request(operation, forward) || Observable.of()
: rightLink.request(operation, forward) || Observable.of();
});
}
return Object.assign(ret, { left: leftLink, right: rightLink });
};
ApolloLink.execute = function (link, operation) {
return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());
};
ApolloLink.concat = function (first, second) {
var firstLink = toLink(first);
if (isTerminating(firstLink)) {
globalThis.__DEV__ !== false && invariant.warn(35, firstLink);
return firstLink;
}
var nextLink = toLink(second);
var ret;
if (isTerminating(nextLink)) {
ret = new ApolloLink(function (operation) {
return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();
});
}
else {
ret = new ApolloLink(function (operation, forward) {
return (firstLink.request(operation, function (op) {
return nextLink.request(op, forward) || Observable.of();
}) || Observable.of());
});
}
return Object.assign(ret, { left: firstLink, right: nextLink });
};
ApolloLink.prototype.split = function (test, left, right) {
return this.concat(ApolloLink.split(test, left, right || new ApolloLink(passthrough)));
};
ApolloLink.prototype.concat = function (next) {
return ApolloLink.concat(this, next);
};
ApolloLink.prototype.request = function (operation, forward) {
throw newInvariantError(36);
};
ApolloLink.prototype.onError = function (error, observer) {
if (observer && observer.error) {
observer.error(error);
// Returning false indicates that observer.error does not need to be
// called again, since it was already called (on the previous line).
// Calling observer.error again would not cause any real problems,
// since only the first call matters, but custom onError functions
// might have other reasons for wanting to prevent the default
// behavior by returning false.
return false;
}
// Throw errors will be passed to observer.error.
throw error;
};
ApolloLink.prototype.setOnError = function (fn) {
this.onError = fn;
return this;
};
return ApolloLink;
}());
export { ApolloLink };
//# sourceMappingURL=ApolloLink.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/utils/createOperation.js
import { __assign } from "tslib";
export function createOperation(starting, operation) {
var context = __assign({}, starting);
var setContext = function (next) {
if (typeof next === "function") {
context = __assign(__assign({}, context), next(context));
}
else {
context = __assign(__assign({}, context), next);
}
};
var getContext = function () { return (__assign({}, context)); };
Object.defineProperty(operation, "setContext", {
enumerable: false,
value: setContext,
});
Object.defineProperty(operation, "getContext", {
enumerable: false,
value: getContext,
});
return operation;
}
//# sourceMappingURL=createOperation.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/utils/transformOperation.js
import { getOperationName } from "../../utilities/index.js";
export function transformOperation(operation) {
var transformedOperation = {
variables: operation.variables || {},
extensions: operation.extensions || {},
operationName: operation.operationName,
query: operation.query,
};
// Best guess at an operation name
if (!transformedOperation.operationName) {
transformedOperation.operationName =
typeof transformedOperation.query !== "string" ?
getOperationName(transformedOperation.query) || undefined
: "";
}
return transformedOperation;
}
//# sourceMappingURL=transformOperation.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/utils/validateOperation.js
import { newInvariantError } from "../../utilities/globals/index.js";
export function validateOperation(operation) {
var OPERATION_FIELDS = [
"query",
"operationName",
"variables",
"extensions",
"context",
];
for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
var key = _a[_i];
if (OPERATION_FIELDS.indexOf(key) < 0) {
throw newInvariantError(43, key);
}
}
return operation;
}
//# sourceMappingURL=validateOperation.js.map
webpack://frontend-tpt/../../node_modules/graphql/language/visitor.mjs
import inspect from "../jsutils/inspect.mjs";
import { isNode } from "./ast.mjs";
/**
* A visitor is provided to visit, it contains the collection of
* relevant functions to be called during the visitor's traversal.
*/
export var QueryDocumentKeys = {
Name: [],
Document: ['definitions'],
OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],
VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],
Variable: ['name'],
SelectionSet: ['selections'],
Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],
Argument: ['name', 'value'],
FragmentSpread: ['name', 'directives'],
InlineFragment: ['typeCondition', 'directives', 'selectionSet'],
FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed
// or removed in the future.
'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],
IntValue: [],
FloatValue: [],
StringValue: [],
BooleanValue: [],
NullValue: [],
EnumValue: [],
ListValue: ['values'],
ObjectValue: ['fields'],
ObjectField: ['name', 'value'],
Directive: ['name', 'arguments'],
NamedType: ['name'],
ListType: ['type'],
NonNullType: ['type'],
SchemaDefinition: ['description', 'directives', 'operationTypes'],
OperationTypeDefinition: ['type'],
ScalarTypeDefinition: ['description', 'name', 'directives'],
ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],
FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],
InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],
InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],
UnionTypeDefinition: ['description', 'name', 'directives', 'types'],
EnumTypeDefinition: ['description', 'name', 'directives', 'values'],
EnumValueDefinition: ['description', 'name', 'directives'],
InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],
DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],
SchemaExtension: ['directives', 'operationTypes'],
ScalarTypeExtension: ['name', 'directives'],
ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],
InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],
UnionTypeExtension: ['name', 'directives', 'types'],
EnumTypeExtension: ['name', 'directives', 'values'],
InputObjectTypeExtension: ['name', 'directives', 'fields']
};
export var BREAK = Object.freeze({});
/**
* visit() will walk through an AST using a depth-first traversal, calling
* the visitor's enter function at each node in the traversal, and calling the
* leave function after visiting that node and all of its child nodes.
*
* By returning different values from the enter and leave functions, the
* behavior of the visitor can be altered, including skipping over a sub-tree of
* the AST (by returning false), editing the AST by returning a value or null
* to remove the value, or to stop the whole traversal by returning BREAK.
*
* When using visit() to edit an AST, the original AST will not be modified, and
* a new version of the AST with the changes applied will be returned from the
* visit function.
*
* const editedAST = visit(ast, {
* enter(node, key, parent, path, ancestors) {
* // @return
* // undefined: no action
* // false: skip visiting this node
* // visitor.BREAK: stop visiting altogether
* // null: delete this node
* // any value: replace this node with the returned value
* },
* leave(node, key, parent, path, ancestors) {
* // @return
* // undefined: no action
* // false: no action
* // visitor.BREAK: stop visiting altogether
* // null: delete this node
* // any value: replace this node with the returned value
* }
* });
*
* Alternatively to providing enter() and leave() functions, a visitor can
* instead provide functions named the same as the kinds of AST nodes, or
* enter/leave visitors at a named key, leading to four permutations of the
* visitor API:
*
* 1) Named visitors triggered when entering a node of a specific kind.
*
* visit(ast, {
* Kind(node) {
* // enter the "Kind" node
* }
* })
*
* 2) Named visitors that trigger upon entering and leaving a node of
* a specific kind.
*
* visit(ast, {
* Kind: {
* enter(node) {
* // enter the "Kind" node
* }
* leave(node) {
* // leave the "Kind" node
* }
* }
* })
*
* 3) Generic visitors that trigger upon entering and leaving any node.
*
* visit(ast, {
* enter(node) {
* // enter any node
* },
* leave(node) {
* // leave any node
* }
* })
*
* 4) Parallel visitors for entering and leaving nodes of a specific kind.
*
* visit(ast, {
* enter: {
* Kind(node) {
* // enter the "Kind" node
* }
* },
* leave: {
* Kind(node) {
* // leave the "Kind" node
* }
* }
* })
*/
export function visit(root, visitor) {
var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;
/* eslint-disable no-undef-init */
var stack = undefined;
var inArray = Array.isArray(root);
var keys = [root];
var index = -1;
var edits = [];
var node = undefined;
var key = undefined;
var parent = undefined;
var path = [];
var ancestors = [];
var newRoot = root;
/* eslint-enable no-undef-init */
do {
index++;
var isLeaving = index === keys.length;
var isEdited = isLeaving && edits.length !== 0;
if (isLeaving) {
key = ancestors.length === 0 ? undefined : path[path.length - 1];
node = parent;
parent = ancestors.pop();
if (isEdited) {
if (inArray) {
node = node.slice();
} else {
var clone = {};
for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) {
var k = _Object$keys2[_i2];
clone[k] = node[k];
}
node = clone;
}
var editOffset = 0;
for (var ii = 0; ii < edits.length; ii++) {
var editKey = edits[ii][0];
var editValue = edits[ii][1];
if (inArray) {
editKey -= editOffset;
}
if (inArray && editValue === null) {
node.splice(editKey, 1);
editOffset++;
} else {
node[editKey] = editValue;
}
}
}
index = stack.index;
keys = stack.keys;
edits = stack.edits;
inArray = stack.inArray;
stack = stack.prev;
} else {
key = parent ? inArray ? index : keys[index] : undefined;
node = parent ? parent[key] : newRoot;
if (node === null || node === undefined) {
continue;
}
if (parent) {
path.push(key);
}
}
var result = void 0;
if (!Array.isArray(node)) {
if (!isNode(node)) {
throw new Error("Invalid AST Node: ".concat(inspect(node), "."));
}
var visitFn = getVisitFn(visitor, node.kind, isLeaving);
if (visitFn) {
result = visitFn.call(visitor, node, key, parent, path, ancestors);
if (result === BREAK) {
break;
}
if (result === false) {
if (!isLeaving) {
path.pop();
continue;
}
} else if (result !== undefined) {
edits.push([key, result]);
if (!isLeaving) {
if (isNode(result)) {
node = result;
} else {
path.pop();
continue;
}
}
}
}
}
if (result === undefined && isEdited) {
edits.push([key, node]);
}
if (isLeaving) {
path.pop();
} else {
var _visitorKeys$node$kin;
stack = {
inArray: inArray,
index: index,
keys: keys,
edits: edits,
prev: stack
};
inArray = Array.isArray(node);
keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : [];
index = -1;
edits = [];
if (parent) {
ancestors.push(parent);
}
parent = node;
}
} while (stack !== undefined);
if (edits.length !== 0) {
newRoot = edits[edits.length - 1][1];
}
return newRoot;
}
/**
* Creates a new visitor instance which delegates to many visitors to run in
* parallel. Each visitor will be visited for each node before moving on.
*
* If a prior visitor edits a node, no following visitors will see that node.
*/
export function visitInParallel(visitors) {
var skipping = new Array(visitors.length);
return {
enter: function enter(node) {
for (var i = 0; i < visitors.length; i++) {
if (skipping[i] == null) {
var fn = getVisitFn(visitors[i], node.kind,
/* isLeaving */
false);
if (fn) {
var result = fn.apply(visitors[i], arguments);
if (result === false) {
skipping[i] = node;
} else if (result === BREAK) {
skipping[i] = BREAK;
} else if (result !== undefined) {
return result;
}
}
}
}
},
leave: function leave(node) {
for (var i = 0; i < visitors.length; i++) {
if (skipping[i] == null) {
var fn = getVisitFn(visitors[i], node.kind,
/* isLeaving */
true);
if (fn) {
var result = fn.apply(visitors[i], arguments);
if (result === BREAK) {
skipping[i] = BREAK;
} else if (result !== undefined && result !== false) {
return result;
}
}
} else if (skipping[i] === node) {
skipping[i] = null;
}
}
}
};
}
/**
* Given a visitor instance, if it is leaving or not, and a node kind, return
* the function the visitor runtime should call.
*/
export function getVisitFn(visitor, kind, isLeaving) {
var kindVisitor = visitor[kind];
if (kindVisitor) {
if (!isLeaving && typeof kindVisitor === 'function') {
// { Kind() {} }
return kindVisitor;
}
var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;
if (typeof kindSpecificVisitor === 'function') {
// { Kind: { enter() {}, leave() {} } }
return kindSpecificVisitor;
}
} else {
var specificVisitor = isLeaving ? visitor.leave : visitor.enter;
if (specificVisitor) {
if (typeof specificVisitor === 'function') {
// { enter() {}, leave() {} }
return specificVisitor;
}
var specificKindVisitor = specificVisitor[kind];
if (typeof specificKindVisitor === 'function') {
// { enter: { Kind() {} }, leave: { Kind() {} } }
return specificKindVisitor;
}
}
}
}
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/graphql/directives.js
import { invariant } from "../globals/index.js";
import { visit, BREAK } from "graphql";
export function shouldInclude(_a, variables) {
var directives = _a.directives;
if (!directives || !directives.length) {
return true;
}
return getInclusionDirectives(directives).every(function (_a) {
var directive = _a.directive, ifArgument = _a.ifArgument;
var evaledValue = false;
if (ifArgument.value.kind === "Variable") {
evaledValue =
variables && variables[ifArgument.value.name.value];
invariant(evaledValue !== void 0, 67, directive.name.value);
}
else {
evaledValue = ifArgument.value.value;
}
return directive.name.value === "skip" ? !evaledValue : evaledValue;
});
}
export function getDirectiveNames(root) {
var names = [];
visit(root, {
Directive: function (node) {
names.push(node.name.value);
},
});
return names;
}
export var hasAnyDirectives = function (names, root) {
return hasDirectives(names, root, false);
};
export var hasAllDirectives = function (names, root) {
return hasDirectives(names, root, true);
};
export function hasDirectives(names, root, all) {
var nameSet = new Set(names);
var uniqueCount = nameSet.size;
visit(root, {
Directive: function (node) {
if (nameSet.delete(node.name.value) && (!all || !nameSet.size)) {
return BREAK;
}
},
});
// If we found all the names, nameSet will be empty. If we only care about
// finding some of them, the < condition is sufficient.
return all ? !nameSet.size : nameSet.size < uniqueCount;
}
export function hasClientExports(document) {
return document && hasDirectives(["client", "export"], document, true);
}
function isInclusionDirective(_a) {
var value = _a.name.value;
return value === "skip" || value === "include";
}
export function getInclusionDirectives(directives) {
var result = [];
if (directives && directives.length) {
directives.forEach(function (directive) {
if (!isInclusionDirective(directive))
return;
var directiveArguments = directive.arguments;
var directiveName = directive.name.value;
invariant(directiveArguments && directiveArguments.length === 1, 68, directiveName);
var ifArgument = directiveArguments[0];
invariant(ifArgument.name && ifArgument.name.value === "if", 69, directiveName);
var ifValue = ifArgument.value;
// means it has to be a variable value if this is a valid @skip or @include directive
invariant(ifValue &&
(ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 70, directiveName);
result.push({ directive: directive, ifArgument: ifArgument });
});
}
return result;
}
//# sourceMappingURL=directives.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/serializeFetchParameter.js
import { newInvariantError } from "../../utilities/globals/index.js";
export var serializeFetchParameter = function (p, label) {
var serialized;
try {
serialized = JSON.stringify(p);
}
catch (e) {
var parseError = newInvariantError(39, label, e.message);
parseError.parseError = e;
throw parseError;
}
return serialized;
};
//# sourceMappingURL=serializeFetchParameter.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/iterators/reader.js
/**
* Original source:
* https://github.com/kmalakoff/response-iterator/blob/master/src/iterators/reader.ts
*/
import { canUseAsyncIteratorSymbol } from "../../../utilities/index.js";
export default function readerIterator(reader) {
var iterator = {
next: function () {
return reader.read();
},
};
if (canUseAsyncIteratorSymbol) {
iterator[Symbol.asyncIterator] = function () {
return this;
};
}
return iterator;
}
//# sourceMappingURL=reader.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/responseIterator.js
/**
* Original source:
* https://github.com/kmalakoff/response-iterator/blob/master/src/index.ts
*/
import { canUseAsyncIteratorSymbol } from "../../utilities/index.js";
import asyncIterator from "./iterators/async.js";
import nodeStreamIterator from "./iterators/nodeStream.js";
import promiseIterator from "./iterators/promise.js";
import readerIterator from "./iterators/reader.js";
function isNodeResponse(value) {
return !!value.body;
}
function isReadableStream(value) {
return !!value.getReader;
}
function isAsyncIterableIterator(value) {
return !!(canUseAsyncIteratorSymbol &&
value[Symbol.asyncIterator]);
}
function isStreamableBlob(value) {
return !!value.stream;
}
function isBlob(value) {
return !!value.arrayBuffer;
}
function isNodeReadableStream(value) {
return !!value.pipe;
}
export function responseIterator(response) {
var body = response;
if (isNodeResponse(response))
body = response.body;
if (isAsyncIterableIterator(body))
return asyncIterator(body);
if (isReadableStream(body))
return readerIterator(body.getReader());
// this errors without casting to ReadableStream<T>
// because Blob.stream() returns a NodeJS ReadableStream
if (isStreamableBlob(body)) {
return readerIterator(body.stream().getReader());
}
if (isBlob(body))
return promiseIterator(body.arrayBuffer());
if (isNodeReadableStream(body))
return nodeStreamIterator(body);
throw new Error("Unknown body type for responseIterator. Please pass a streamable response.");
}
//# sourceMappingURL=responseIterator.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/iterators/async.js
/**
* Original source:
* https://github.com/kmalakoff/response-iterator/blob/master/src/iterators/async.ts
*/
export default function asyncIterator(source) {
var _a;
var iterator = source[Symbol.asyncIterator]();
return _a = {
next: function () {
return iterator.next();
}
},
_a[Symbol.asyncIterator] = function () {
return this;
},
_a;
}
//# sourceMappingURL=async.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/iterators/promise.js
/**
* Original source:
* https://github.com/kmalakoff/response-iterator/blob/master/src/iterators/promise.ts
*/
import { canUseAsyncIteratorSymbol } from "../../../utilities/index.js";
export default function promiseIterator(promise) {
var resolved = false;
var iterator = {
next: function () {
if (resolved)
return Promise.resolve({
value: undefined,
done: true,
});
resolved = true;
return new Promise(function (resolve, reject) {
promise
.then(function (value) {
resolve({ value: value, done: false });
})
.catch(reject);
});
},
};
if (canUseAsyncIteratorSymbol) {
iterator[Symbol.asyncIterator] = function () {
return this;
};
}
return iterator;
}
//# sourceMappingURL=promise.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/iterators/nodeStream.js
/**
* Original source:
* https://github.com/kmalakoff/response-iterator/blob/master/src/iterators/nodeStream.ts
*/
import { canUseAsyncIteratorSymbol } from "../../../utilities/index.js";
export default function nodeStreamIterator(stream) {
var cleanup = null;
var error = null;
var done = false;
var data = [];
var waiting = [];
function onData(chunk) {
if (error)
return;
if (waiting.length) {
var shiftedArr = waiting.shift();
if (Array.isArray(shiftedArr) && shiftedArr[0]) {
return shiftedArr[0]({ value: chunk, done: false });
}
}
data.push(chunk);
}
function onError(err) {
error = err;
var all = waiting.slice();
all.forEach(function (pair) {
pair[1](err);
});
!cleanup || cleanup();
}
function onEnd() {
done = true;
var all = waiting.slice();
all.forEach(function (pair) {
pair[0]({ value: undefined, done: true });
});
!cleanup || cleanup();
}
cleanup = function () {
cleanup = null;
stream.removeListener("data", onData);
stream.removeListener("error", onError);
stream.removeListener("end", onEnd);
stream.removeListener("finish", onEnd);
stream.removeListener("close", onEnd);
};
stream.on("data", onData);
stream.on("error", onError);
stream.on("end", onEnd);
stream.on("finish", onEnd);
stream.on("close", onEnd);
function getNext() {
return new Promise(function (resolve, reject) {
if (error)
return reject(error);
if (data.length)
return resolve({ value: data.shift(), done: false });
if (done)
return resolve({ value: undefined, done: true });
waiting.push([resolve, reject]);
});
}
var iterator = {
next: function () {
return getNext();
},
};
if (canUseAsyncIteratorSymbol) {
iterator[Symbol.asyncIterator] = function () {
return this;
};
}
return iterator;
}
//# sourceMappingURL=nodeStream.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/utils/throwServerError.js
export var throwServerError = function (response, result, message) {
var error = new Error(message);
error.name = "ServerError";
error.response = response;
error.statusCode = response.status;
error.result = result;
throw error;
};
//# sourceMappingURL=throwServerError.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/mergeDeep.js
import { __assign, __spreadArray } from "tslib";
import { isNonNullObject } from "./objects.js";
var hasOwnProperty = Object.prototype.hasOwnProperty;
export function mergeDeep() {
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
return mergeDeepArray(sources);
}
// In almost any situation where you could succeed in getting the
// TypeScript compiler to infer a tuple type for the sources array, you
// could just use mergeDeep instead of mergeDeepArray, so instead of
// trying to convert T[] to an intersection type we just infer the array
// element type, which works perfectly when the sources array has a
// consistent element type.
export function mergeDeepArray(sources) {
var target = sources[0] || {};
var count = sources.length;
if (count > 1) {
var merger = new DeepMerger();
for (var i = 1; i < count; ++i) {
target = merger.merge(target, sources[i]);
}
}
return target;
}
var defaultReconciler = function (target, source, property) {
return this.merge(target[property], source[property]);
};
var DeepMerger = /** @class */ (function () {
function DeepMerger(reconciler) {
if (reconciler === void 0) { reconciler = defaultReconciler; }
this.reconciler = reconciler;
this.isObject = isNonNullObject;
this.pastCopies = new Set();
}
DeepMerger.prototype.merge = function (target, source) {
var _this = this;
var context = [];
for (var _i = 2; _i < arguments.length; _i++) {
context[_i - 2] = arguments[_i];
}
if (isNonNullObject(source) && isNonNullObject(target)) {
Object.keys(source).forEach(function (sourceKey) {
if (hasOwnProperty.call(target, sourceKey)) {
var targetValue = target[sourceKey];
if (source[sourceKey] !== targetValue) {
var result = _this.reconciler.apply(_this, __spreadArray([target,
source,
sourceKey], context, false));
// A well-implemented reconciler may return targetValue to indicate
// the merge changed nothing about the structure of the target.
if (result !== targetValue) {
target = _this.shallowCopyForMerge(target);
target[sourceKey] = result;
}
}
}
else {
// If there is no collision, the target can safely share memory with
// the source, and the recursion can terminate here.
target = _this.shallowCopyForMerge(target);
target[sourceKey] = source[sourceKey];
}
});
return target;
}
// If source (or target) is not an object, let source replace target.
return source;
};
DeepMerger.prototype.shallowCopyForMerge = function (value) {
if (isNonNullObject(value)) {
if (!this.pastCopies.has(value)) {
if (Array.isArray(value)) {
value = value.slice(0);
}
else {
value = __assign({ __proto__: Object.getPrototypeOf(value) }, value);
}
this.pastCopies.add(value);
}
}
return value;
};
return DeepMerger;
}());
export { DeepMerger };
//# sourceMappingURL=mergeDeep.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/incrementalResult.js
import { isNonNullObject } from "./objects.js";
import { isNonEmptyArray } from "./arrays.js";
import { DeepMerger } from "./mergeDeep.js";
export function isExecutionPatchIncrementalResult(value) {
return "incremental" in value;
}
export function isExecutionPatchInitialResult(value) {
return "hasNext" in value && "data" in value;
}
export function isExecutionPatchResult(value) {
return (isExecutionPatchIncrementalResult(value) ||
isExecutionPatchInitialResult(value));
}
// This function detects an Apollo payload result before it is transformed
// into a FetchResult via HttpLink; it cannot detect an ApolloPayloadResult
// once it leaves the link chain.
export function isApolloPayloadResult(value) {
return isNonNullObject(value) && "payload" in value;
}
export function mergeIncrementalData(prevResult, result) {
var mergedData = prevResult;
var merger = new DeepMerger();
if (isExecutionPatchIncrementalResult(result) &&
isNonEmptyArray(result.incremental)) {
result.incremental.forEach(function (_a) {
var data = _a.data, path = _a.path;
for (var i = path.length - 1; i >= 0; --i) {
var key = path[i];
var isNumericKey = !isNaN(+key);
var parent_1 = isNumericKey ? [] : {};
parent_1[key] = data;
data = parent_1;
}
mergedData = merger.merge(mergedData, data);
});
}
return mergedData;
}
//# sourceMappingURL=incrementalResult.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js
import { __assign, __awaiter, __generator } from "tslib";
import { responseIterator } from "./responseIterator.js";
import { throwServerError } from "../utils/index.js";
import { PROTOCOL_ERRORS_SYMBOL } from "../../errors/index.js";
import { isApolloPayloadResult } from "../../utilities/common/incrementalResult.js";
var hasOwnProperty = Object.prototype.hasOwnProperty;
export function readMultipartBody(response, nextValue) {
var _a;
return __awaiter(this, void 0, void 0, function () {
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _b, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
var _c, _d;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
if (TextDecoder === undefined) {
throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");
}
decoder = new TextDecoder("utf-8");
contentType = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get("content-type");
delimiter = "boundary=";
boundaryVal = (contentType === null || contentType === void 0 ? void 0 : contentType.includes(delimiter)) ?
contentType === null || contentType === void 0 ? void 0 : contentType.substring((contentType === null || contentType === void 0 ? void 0 : contentType.indexOf(delimiter)) + delimiter.length).replace(/['"]/g, "").replace(/\;(.*)/gm, "").trim()
: "-";
boundary = "\r\n--".concat(boundaryVal);
buffer = "";
iterator = responseIterator(response);
running = true;
_e.label = 1;
case 1:
if (!running) return [3 /*break*/, 3];
return [4 /*yield*/, iterator.next()];
case 2:
_b = _e.sent(), value = _b.value, done = _b.done;
chunk = typeof value === "string" ? value : decoder.decode(value);
searchFrom = buffer.length - boundary.length + 1;
running = !done;
buffer += chunk;
bi = buffer.indexOf(boundary, searchFrom);
while (bi > -1) {
message = void 0;
_c = [
buffer.slice(0, bi),
buffer.slice(bi + boundary.length),
], message = _c[0], buffer = _c[1];
i = message.indexOf("\r\n\r\n");
headers = parseHeaders(message.slice(0, i));
contentType_1 = headers["content-type"];
if (contentType_1 &&
contentType_1.toLowerCase().indexOf("application/json") === -1) {
throw new Error("Unsupported patch content type: application/json is required.");
}
body = message.slice(i);
if (body) {
result = parseJsonBody(response, body);
if (Object.keys(result).length > 1 ||
"data" in result ||
"incremental" in result ||
"errors" in result ||
"payload" in result) {
if (isApolloPayloadResult(result)) {
next = {};
if ("payload" in result) {
next = __assign({}, result.payload);
}
if ("errors" in result) {
next = __assign(__assign({}, next), { extensions: __assign(__assign({}, ("extensions" in next ? next.extensions : null)), (_d = {}, _d[PROTOCOL_ERRORS_SYMBOL] = result.errors, _d)) });
}
nextValue(next);
}
else {
// for the last chunk with only `hasNext: false`
// we don't need to call observer.next as there is no data/errors
nextValue(result);
}
}
else if (
// If the chunk contains only a "hasNext: false", we can call
// observer.complete() immediately.
Object.keys(result).length === 1 &&
"hasNext" in result &&
!result.hasNext) {
return [2 /*return*/];
}
}
bi = buffer.indexOf(boundary);
}
return [3 /*break*/, 1];
case 3: return [2 /*return*/];
}
});
});
}
export function parseHeaders(headerText) {
var headersInit = {};
headerText.split("\n").forEach(function (line) {
var i = line.indexOf(":");
if (i > -1) {
// normalize headers to lowercase
var name_1 = line.slice(0, i).trim().toLowerCase();
var value = line.slice(i + 1).trim();
headersInit[name_1] = value;
}
});
return headersInit;
}
export function parseJsonBody(response, bodyText) {
if (response.status >= 300) {
// Network error
var getResult = function () {
try {
return JSON.parse(bodyText);
}
catch (err) {
return bodyText;
}
};
throwServerError(response, getResult(), "Response not successful: Received status code ".concat(response.status));
}
try {
return JSON.parse(bodyText);
}
catch (err) {
var parseError = err;
parseError.name = "ServerParseError";
parseError.response = response;
parseError.statusCode = response.status;
parseError.bodyText = bodyText;
throw parseError;
}
}
export function handleError(err, observer) {
// if it is a network error, BUT there is graphql result info fire
// the next observer before calling error this gives apollo-client
// (and react-apollo) the `graphqlErrors` and `networkErrors` to
// pass to UI this should only happen if we *also* have data as
// part of the response key per the spec
if (err.result && err.result.errors && err.result.data) {
// if we don't call next, the UI can only show networkError
// because AC didn't get any graphqlErrors this is graphql
// execution result info (i.e errors and possibly data) this is
// because there is no formal spec how errors should translate to
// http status codes. So an auth error (401) could have both data
// from a public field, errors from a private field, and a status
// of 401
// {
// user { // this will have errors
// firstName
// }
// products { // this is public so will have data
// cost
// }
// }
//
// the result of above *could* look like this:
// {
// data: { products: [{ cost: "$10" }] },
// errors: [{
// message: 'your session has timed out',
// path: []
// }]
// }
// status code of above would be a 401
// in the UI you want to show data where you can, errors as data where you can
// and use correct http status codes
observer.next(err.result);
}
observer.error(err);
}
export function parseAndCheckHttpResponse(operations) {
return function (response) {
return response
.text()
.then(function (bodyText) { return parseJsonBody(response, bodyText); })
.then(function (result) {
if (!Array.isArray(result) &&
!hasOwnProperty.call(result, "data") &&
!hasOwnProperty.call(result, "errors")) {
// Data error
throwServerError(response, result, "Server response was missing for query '".concat(Array.isArray(operations) ?
operations.map(function (op) { return op.operationName; })
: operations.operationName, "'."));
}
return result;
});
};
}
//# sourceMappingURL=parseAndCheckHttpResponse.js.map
webpack://frontend-tpt/../../node_modules/graphql/language/printer.mjs
import { visit } from "./visitor.mjs";
import { printBlockString } from "./blockString.mjs";
/**
* Converts an AST into a string, using one set of reasonable
* formatting rules.
*/
export function print(ast) {
return visit(ast, {
leave: printDocASTReducer
});
}
var MAX_LINE_LENGTH = 80; // TODO: provide better type coverage in future
var printDocASTReducer = {
Name: function Name(node) {
return node.value;
},
Variable: function Variable(node) {
return '$' + node.name;
},
// Document
Document: function Document(node) {
return join(node.definitions, '\n\n') + '\n';
},
OperationDefinition: function OperationDefinition(node) {
var op = node.operation;
var name = node.name;
var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');
var directives = join(node.directives, ' ');
var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use
// the query short form.
return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');
},
VariableDefinition: function VariableDefinition(_ref) {
var variable = _ref.variable,
type = _ref.type,
defaultValue = _ref.defaultValue,
directives = _ref.directives;
return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' '));
},
SelectionSet: function SelectionSet(_ref2) {
var selections = _ref2.selections;
return block(selections);
},
Field: function Field(_ref3) {
var alias = _ref3.alias,
name = _ref3.name,
args = _ref3.arguments,
directives = _ref3.directives,
selectionSet = _ref3.selectionSet;
var prefix = wrap('', alias, ': ') + name;
var argsLine = prefix + wrap('(', join(args, ', '), ')');
if (argsLine.length > MAX_LINE_LENGTH) {
argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)');
}
return join([argsLine, join(directives, ' '), selectionSet], ' ');
},
Argument: function Argument(_ref4) {
var name = _ref4.name,
value = _ref4.value;
return name + ': ' + value;
},
// Fragments
FragmentSpread: function FragmentSpread(_ref5) {
var name = _ref5.name,
directives = _ref5.directives;
return '...' + name + wrap(' ', join(directives, ' '));
},
InlineFragment: function InlineFragment(_ref6) {
var typeCondition = _ref6.typeCondition,
directives = _ref6.directives,
selectionSet = _ref6.selectionSet;
return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');
},
FragmentDefinition: function FragmentDefinition(_ref7) {
var name = _ref7.name,
typeCondition = _ref7.typeCondition,
variableDefinitions = _ref7.variableDefinitions,
directives = _ref7.directives,
selectionSet = _ref7.selectionSet;
return (// Note: fragment variable definitions are experimental and may be changed
// or removed in the future.
"fragment ".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), " ") + "on ".concat(typeCondition, " ").concat(wrap('', join(directives, ' '), ' ')) + selectionSet
);
},
// Value
IntValue: function IntValue(_ref8) {
var value = _ref8.value;
return value;
},
FloatValue: function FloatValue(_ref9) {
var value = _ref9.value;
return value;
},
StringValue: function StringValue(_ref10, key) {
var value = _ref10.value,
isBlockString = _ref10.block;
return isBlockString ? printBlockString(value, key === 'description' ? '' : ' ') : JSON.stringify(value);
},
BooleanValue: function BooleanValue(_ref11) {
var value = _ref11.value;
return value ? 'true' : 'false';
},
NullValue: function NullValue() {
return 'null';
},
EnumValue: function EnumValue(_ref12) {
var value = _ref12.value;
return value;
},
ListValue: function ListValue(_ref13) {
var values = _ref13.values;
return '[' + join(values, ', ') + ']';
},
ObjectValue: function ObjectValue(_ref14) {
var fields = _ref14.fields;
return '{' + join(fields, ', ') + '}';
},
ObjectField: function ObjectField(_ref15) {
var name = _ref15.name,
value = _ref15.value;
return name + ': ' + value;
},
// Directive
Directive: function Directive(_ref16) {
var name = _ref16.name,
args = _ref16.arguments;
return '@' + name + wrap('(', join(args, ', '), ')');
},
// Type
NamedType: function NamedType(_ref17) {
var name = _ref17.name;
return name;
},
ListType: function ListType(_ref18) {
var type = _ref18.type;
return '[' + type + ']';
},
NonNullType: function NonNullType(_ref19) {
var type = _ref19.type;
return type + '!';
},
// Type System Definitions
SchemaDefinition: addDescription(function (_ref20) {
var directives = _ref20.directives,
operationTypes = _ref20.operationTypes;
return join(['schema', join(directives, ' '), block(operationTypes)], ' ');
}),
OperationTypeDefinition: function OperationTypeDefinition(_ref21) {
var operation = _ref21.operation,
type = _ref21.type;
return operation + ': ' + type;
},
ScalarTypeDefinition: addDescription(function (_ref22) {
var name = _ref22.name,
directives = _ref22.directives;
return join(['scalar', name, join(directives, ' ')], ' ');
}),
ObjectTypeDefinition: addDescription(function (_ref23) {
var name = _ref23.name,
interfaces = _ref23.interfaces,
directives = _ref23.directives,
fields = _ref23.fields;
return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
}),
FieldDefinition: addDescription(function (_ref24) {
var name = _ref24.name,
args = _ref24.arguments,
type = _ref24.type,
directives = _ref24.directives;
return name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' '));
}),
InputValueDefinition: addDescription(function (_ref25) {
var name = _ref25.name,
type = _ref25.type,
defaultValue = _ref25.defaultValue,
directives = _ref25.directives;
return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');
}),
InterfaceTypeDefinition: addDescription(function (_ref26) {
var name = _ref26.name,
interfaces = _ref26.interfaces,
directives = _ref26.directives,
fields = _ref26.fields;
return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
}),
UnionTypeDefinition: addDescription(function (_ref27) {
var name = _ref27.name,
directives = _ref27.directives,
types = _ref27.types;
return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');
}),
EnumTypeDefinition: addDescription(function (_ref28) {
var name = _ref28.name,
directives = _ref28.directives,
values = _ref28.values;
return join(['enum', name, join(directives, ' '), block(values)], ' ');
}),
EnumValueDefinition: addDescription(function (_ref29) {
var name = _ref29.name,
directives = _ref29.directives;
return join([name, join(directives, ' ')], ' ');
}),
InputObjectTypeDefinition: addDescription(function (_ref30) {
var name = _ref30.name,
directives = _ref30.directives,
fields = _ref30.fields;
return join(['input', name, join(directives, ' '), block(fields)], ' ');
}),
DirectiveDefinition: addDescription(function (_ref31) {
var name = _ref31.name,
args = _ref31.arguments,
repeatable = _ref31.repeatable,
locations = _ref31.locations;
return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | ');
}),
SchemaExtension: function SchemaExtension(_ref32) {
var directives = _ref32.directives,
operationTypes = _ref32.operationTypes;
return join(['extend schema', join(directives, ' '), block(operationTypes)], ' ');
},
ScalarTypeExtension: function ScalarTypeExtension(_ref33) {
var name = _ref33.name,
directives = _ref33.directives;
return join(['extend scalar', name, join(directives, ' ')], ' ');
},
ObjectTypeExtension: function ObjectTypeExtension(_ref34) {
var name = _ref34.name,
interfaces = _ref34.interfaces,
directives = _ref34.directives,
fields = _ref34.fields;
return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
},
InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {
var name = _ref35.name,
interfaces = _ref35.interfaces,
directives = _ref35.directives,
fields = _ref35.fields;
return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
},
UnionTypeExtension: function UnionTypeExtension(_ref36) {
var name = _ref36.name,
directives = _ref36.directives,
types = _ref36.types;
return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');
},
EnumTypeExtension: function EnumTypeExtension(_ref37) {
var name = _ref37.name,
directives = _ref37.directives,
values = _ref37.values;
return join(['extend enum', name, join(directives, ' '), block(values)], ' ');
},
InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {
var name = _ref38.name,
directives = _ref38.directives,
fields = _ref38.fields;
return join(['extend input', name, join(directives, ' '), block(fields)], ' ');
}
};
function addDescription(cb) {
return function (node) {
return join([node.description, cb(node)], '\n');
};
}
/**
* Given maybeArray, print an empty string if it is null or empty, otherwise
* print all items together separated by separator if provided
*/
function join(maybeArray) {
var _maybeArray$filter$jo;
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {
return x;
}).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';
}
/**
* Given array, print each item on its own line, wrapped in an
* indented "{ }" block.
*/
function block(array) {
return wrap('{\n', indent(join(array, '\n')), '\n}');
}
/**
* If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.
*/
function wrap(start, maybeString) {
var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
return maybeString != null && maybeString !== '' ? start + maybeString + end : '';
}
function indent(str) {
return wrap(' ', str.replace(/\n/g, '\n '));
}
function isMultiline(str) {
return str.indexOf('\n') !== -1;
}
function hasMultilineItems(maybeArray) {
return maybeArray != null && maybeArray.some(isMultiline);
}
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/graphql/print.js
import { print as origPrint } from "graphql";
import { AutoCleanedWeakCache, cacheSizes, } from "../caching/index.js";
import { registerGlobalCache } from "../caching/getMemoryInternals.js";
var printCache;
export var print = Object.assign(function (ast) {
var result = printCache.get(ast);
if (!result) {
result = origPrint(ast);
printCache.set(ast, result);
}
return result;
}, {
reset: function () {
printCache = new AutoCleanedWeakCache(cacheSizes.print || 2000 /* defaultCacheSizes.print */);
},
});
print.reset();
if (globalThis.__DEV__ !== false) {
registerGlobalCache("print", function () { return (printCache ? printCache.size : 0); });
}
//# sourceMappingURL=print.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js
import { __assign, __spreadArray } from "tslib";
import { print } from "../../utilities/index.js";
var defaultHttpOptions = {
includeQuery: true,
includeExtensions: false,
preserveHeaderCase: false,
};
var defaultHeaders = {
// headers are case insensitive (https://stackoverflow.com/a/5259004)
accept: "*/*",
// The content-type header describes the type of the body of the request, and
// so it typically only is sent with requests that actually have bodies. One
// could imagine that Apollo Client would remove this header when constructing
// a GET request (which has no body), but we historically have not done that.
// This means that browsers will preflight all Apollo Client requests (even
// GET requests). Apollo Server's CSRF prevention feature (introduced in
// AS3.7) takes advantage of this fact and does not block requests with this
// header. If you want to drop this header from GET requests, then you should
// probably replace it with a `apollo-require-preflight` header, or servers
// with CSRF prevention enabled might block your GET request. See
// https://www.apollographql.com/docs/apollo-server/security/cors/#preventing-cross-site-request-forgery-csrf
// for more details.
"content-type": "application/json",
};
var defaultOptions = {
method: "POST",
};
export var fallbackHttpConfig = {
http: defaultHttpOptions,
headers: defaultHeaders,
options: defaultOptions,
};
export var defaultPrinter = function (ast, printer) { return printer(ast); };
export function selectHttpOptionsAndBody(operation, fallbackConfig) {
var configs = [];
for (var _i = 2; _i < arguments.length; _i++) {
configs[_i - 2] = arguments[_i];
}
configs.unshift(fallbackConfig);
return selectHttpOptionsAndBodyInternal.apply(void 0, __spreadArray([operation,
defaultPrinter], configs, false));
}
export function selectHttpOptionsAndBodyInternal(operation, printer) {
var configs = [];
for (var _i = 2; _i < arguments.length; _i++) {
configs[_i - 2] = arguments[_i];
}
var options = {};
var http = {};
configs.forEach(function (config) {
options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), config.headers) });
if (config.credentials) {
options.credentials = config.credentials;
}
http = __assign(__assign({}, http), config.http);
});
if (options.headers) {
options.headers = removeDuplicateHeaders(options.headers, http.preserveHeaderCase);
}
//The body depends on the http options
var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;
var body = { operationName: operationName, variables: variables };
if (http.includeExtensions)
body.extensions = extensions;
// not sending the query (i.e persisted queries)
if (http.includeQuery)
body.query = printer(query, print);
return {
options: options,
body: body,
};
}
// Remove potential duplicate header names, preserving last (by insertion order).
// This is done to prevent unintentionally duplicating a header instead of
// overwriting it (See #8447 and #8449).
function removeDuplicateHeaders(headers, preserveHeaderCase) {
// If we're not preserving the case, just remove duplicates w/ normalization.
if (!preserveHeaderCase) {
var normalizedHeaders_1 = Object.create(null);
Object.keys(Object(headers)).forEach(function (name) {
normalizedHeaders_1[name.toLowerCase()] = headers[name];
});
return normalizedHeaders_1;
}
// If we are preserving the case, remove duplicates w/ normalization,
// preserving the original name.
// This allows for non-http-spec-compliant servers that expect intentionally
// capitalized header names (See #6741).
var headerData = Object.create(null);
Object.keys(Object(headers)).forEach(function (name) {
headerData[name.toLowerCase()] = {
originalName: name,
value: headers[name],
};
});
var normalizedHeaders = Object.create(null);
Object.keys(headerData).forEach(function (name) {
normalizedHeaders[headerData[name].originalName] = headerData[name].value;
});
return normalizedHeaders;
}
//# sourceMappingURL=selectHttpOptionsAndBody.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/utils/fromError.js
import { Observable } from "../../utilities/index.js";
export function fromError(errorValue) {
return new Observable(function (observer) {
observer.error(errorValue);
});
}
//# sourceMappingURL=fromError.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/graphql/transform.js
import { __assign, __spreadArray } from "tslib";
import { invariant } from "../globals/index.js";
import { visit, Kind } from "graphql";
import { checkDocument, getOperationDefinition, getFragmentDefinition, getFragmentDefinitions, getMainDefinition, } from "./getFromAST.js";
import { isField } from "./storeUtils.js";
import { createFragmentMap } from "./fragments.js";
import { isArray, isNonEmptyArray } from "../common/arrays.js";
var TYPENAME_FIELD = {
kind: Kind.FIELD,
name: {
kind: Kind.NAME,
value: "__typename",
},
};
function isEmpty(op, fragmentMap) {
return (!op ||
op.selectionSet.selections.every(function (selection) {
return selection.kind === Kind.FRAGMENT_SPREAD &&
isEmpty(fragmentMap[selection.name.value], fragmentMap);
}));
}
function nullIfDocIsEmpty(doc) {
return (isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc)))) ?
null
: doc;
}
function getDirectiveMatcher(configs) {
var names = new Map();
var tests = new Map();
configs.forEach(function (directive) {
if (directive) {
if (directive.name) {
names.set(directive.name, directive);
}
else if (directive.test) {
tests.set(directive.test, directive);
}
}
});
return function (directive) {
var config = names.get(directive.name.value);
if (!config && tests.size) {
tests.forEach(function (testConfig, test) {
if (test(directive)) {
config = testConfig;
}
});
}
return config;
};
}
function makeInUseGetterFunction(defaultKey) {
var map = new Map();
return function inUseGetterFunction(key) {
if (key === void 0) { key = defaultKey; }
var inUse = map.get(key);
if (!inUse) {
map.set(key, (inUse = {
// Variable and fragment spread names used directly within this
// operation or fragment definition, as identified by key. These sets
// will be populated during the first traversal of the document in
// removeDirectivesFromDocument below.
variables: new Set(),
fragmentSpreads: new Set(),
}));
}
return inUse;
};
}
export function removeDirectivesFromDocument(directives, doc) {
checkDocument(doc);
// Passing empty strings to makeInUseGetterFunction means we handle anonymous
// operations as if their names were "". Anonymous fragment definitions are
// not supposed to be possible, but the same default naming strategy seems
// appropriate for that case as well.
var getInUseByOperationName = makeInUseGetterFunction("");
var getInUseByFragmentName = makeInUseGetterFunction("");
var getInUse = function (ancestors) {
for (var p = 0, ancestor = void 0; p < ancestors.length && (ancestor = ancestors[p]); ++p) {
if (isArray(ancestor))
continue;
if (ancestor.kind === Kind.OPERATION_DEFINITION) {
// If an operation is anonymous, we use the empty string as its key.
return getInUseByOperationName(ancestor.name && ancestor.name.value);
}
if (ancestor.kind === Kind.FRAGMENT_DEFINITION) {
return getInUseByFragmentName(ancestor.name.value);
}
}
globalThis.__DEV__ !== false && invariant.error(83);
return null;
};
var operationCount = 0;
for (var i = doc.definitions.length - 1; i >= 0; --i) {
if (doc.definitions[i].kind === Kind.OPERATION_DEFINITION) {
++operationCount;
}
}
var directiveMatcher = getDirectiveMatcher(directives);
var shouldRemoveField = function (nodeDirectives) {
return isNonEmptyArray(nodeDirectives) &&
nodeDirectives
.map(directiveMatcher)
.some(function (config) { return config && config.remove; });
};
var originalFragmentDefsByPath = new Map();
// Any time the first traversal of the document below makes a change like
// removing a fragment (by returning null), this variable should be set to
// true. Once it becomes true, it should never be set to false again. If this
// variable remains false throughout the traversal, then we can return the
// original doc immediately without any modifications.
var firstVisitMadeChanges = false;
var fieldOrInlineFragmentVisitor = {
enter: function (node) {
if (shouldRemoveField(node.directives)) {
firstVisitMadeChanges = true;
return null;
}
},
};
var docWithoutDirectiveSubtrees = visit(doc, {
// These two AST node types share the same implementation, defined above.
Field: fieldOrInlineFragmentVisitor,
InlineFragment: fieldOrInlineFragmentVisitor,
VariableDefinition: {
enter: function () {
// VariableDefinition nodes do not count as variables in use, though
// they do contain Variable nodes that might be visited below. To avoid
// counting variable declarations as usages, we skip visiting the
// contents of this VariableDefinition node by returning false.
return false;
},
},
Variable: {
enter: function (node, _key, _parent, _path, ancestors) {
var inUse = getInUse(ancestors);
if (inUse) {
inUse.variables.add(node.name.value);
}
},
},
FragmentSpread: {
enter: function (node, _key, _parent, _path, ancestors) {
if (shouldRemoveField(node.directives)) {
firstVisitMadeChanges = true;
return null;
}
var inUse = getInUse(ancestors);
if (inUse) {
inUse.fragmentSpreads.add(node.name.value);
}
// We might like to remove this FragmentSpread by returning null here if
// the corresponding FragmentDefinition node is also going to be removed
// by the logic below, but we can't control the relative order of those
// events, so we have to postpone the removal of dangling FragmentSpread
// nodes until after the current visit of the document has finished.
},
},
FragmentDefinition: {
enter: function (node, _key, _parent, path) {
originalFragmentDefsByPath.set(JSON.stringify(path), node);
},
leave: function (node, _key, _parent, path) {
var originalNode = originalFragmentDefsByPath.get(JSON.stringify(path));
if (node === originalNode) {
// If the FragmentNode received by this leave function is identical to
// the one received by the corresponding enter function (above), then
// the visitor must not have made any changes within this
// FragmentDefinition node. This fragment definition may still be
// removed if there are no ...spread references to it, but it won't be
// removed just because it has only a __typename field.
return node;
}
if (
// This logic applies only if the document contains one or more
// operations, since removing all fragments from a document containing
// only fragments makes the document useless.
operationCount > 0 &&
node.selectionSet.selections.every(function (selection) {
return selection.kind === Kind.FIELD &&
selection.name.value === "__typename";
})) {
// This is a somewhat opinionated choice: if a FragmentDefinition ends
// up having no fields other than __typename, we remove the whole
// fragment definition, and later prune ...spread references to it.
getInUseByFragmentName(node.name.value).removed = true;
firstVisitMadeChanges = true;
return null;
}
},
},
Directive: {
leave: function (node) {
// If a matching directive is found, remove the directive itself. Note
// that this does not remove the target (field, argument, etc) of the
// directive, but only the directive itself.
if (directiveMatcher(node)) {
firstVisitMadeChanges = true;
return null;
}
},
},
});
if (!firstVisitMadeChanges) {
// If our first pass did not change anything about the document, then there
// is no cleanup we need to do, and we can return the original doc.
return doc;
}
// Utility for making sure inUse.transitiveVars is recursively populated.
// Because this logic assumes inUse.fragmentSpreads has been completely
// populated and inUse.removed has been set if appropriate,
// populateTransitiveVars must be called after that information has been
// collected by the first traversal of the document.
var populateTransitiveVars = function (inUse) {
if (!inUse.transitiveVars) {
inUse.transitiveVars = new Set(inUse.variables);
if (!inUse.removed) {
inUse.fragmentSpreads.forEach(function (childFragmentName) {
populateTransitiveVars(getInUseByFragmentName(childFragmentName)).transitiveVars.forEach(function (varName) {
inUse.transitiveVars.add(varName);
});
});
}
}
return inUse;
};
// Since we've been keeping track of fragment spreads used by particular
// operations and fragment definitions, we now need to compute the set of all
// spreads used (transitively) by any operations in the document.
var allFragmentNamesUsed = new Set();
docWithoutDirectiveSubtrees.definitions.forEach(function (def) {
if (def.kind === Kind.OPERATION_DEFINITION) {
populateTransitiveVars(getInUseByOperationName(def.name && def.name.value)).fragmentSpreads.forEach(function (childFragmentName) {
allFragmentNamesUsed.add(childFragmentName);
});
}
else if (def.kind === Kind.FRAGMENT_DEFINITION &&
// If there are no operations in the document, then all fragment
// definitions count as usages of their own fragment names. This heuristic
// prevents accidentally removing all fragment definitions from the
// document just because it contains no operations that use the fragments.
operationCount === 0 &&
!getInUseByFragmentName(def.name.value).removed) {
allFragmentNamesUsed.add(def.name.value);
}
});
// Now that we have added all fragment spreads used by operations to the
// allFragmentNamesUsed set, we can complete the set by transitively adding
// all fragment spreads used by those fragments, and so on.
allFragmentNamesUsed.forEach(function (fragmentName) {
// Once all the childFragmentName strings added here have been seen already,
// the top-level allFragmentNamesUsed.forEach loop will terminate.
populateTransitiveVars(getInUseByFragmentName(fragmentName)).fragmentSpreads.forEach(function (childFragmentName) {
allFragmentNamesUsed.add(childFragmentName);
});
});
var fragmentWillBeRemoved = function (fragmentName) {
return !!(
// A fragment definition will be removed if there are no spreads that refer
// to it, or the fragment was explicitly removed because it had no fields
// other than __typename.
(!allFragmentNamesUsed.has(fragmentName) ||
getInUseByFragmentName(fragmentName).removed));
};
var enterVisitor = {
enter: function (node) {
if (fragmentWillBeRemoved(node.name.value)) {
return null;
}
},
};
return nullIfDocIsEmpty(visit(docWithoutDirectiveSubtrees, {
// If the fragment is going to be removed, then leaving any dangling
// FragmentSpread nodes with the same name would be a mistake.
FragmentSpread: enterVisitor,
// This is where the fragment definition is actually removed.
FragmentDefinition: enterVisitor,
OperationDefinition: {
leave: function (node) {
// Upon leaving each operation in the depth-first AST traversal, prune
// any variables that are declared by the operation but unused within.
if (node.variableDefinitions) {
var usedVariableNames_1 = populateTransitiveVars(
// If an operation is anonymous, we use the empty string as its key.
getInUseByOperationName(node.name && node.name.value)).transitiveVars;
// According to the GraphQL spec, all variables declared by an
// operation must either be used by that operation or used by some
// fragment included transitively into that operation:
// https://spec.graphql.org/draft/#sec-All-Variables-Used
//
// To stay on the right side of this validation rule, if/when we
// remove the last $var references from an operation or its fragments,
// we must also remove the corresponding $var declaration from the
// enclosing operation. This pruning applies only to operations and
// not fragment definitions, at the moment. Fragments may be able to
// declare variables eventually, but today they can only consume them.
if (usedVariableNames_1.size < node.variableDefinitions.length) {
return __assign(__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) {
return usedVariableNames_1.has(varDef.variable.name.value);
}) });
}
}
},
},
}));
}
export var addTypenameToDocument = Object.assign(function (doc) {
return visit(doc, {
SelectionSet: {
enter: function (node, _key, parent) {
// Don't add __typename to OperationDefinitions.
if (parent &&
parent.kind ===
Kind.OPERATION_DEFINITION) {
return;
}
// No changes if no selections.
var selections = node.selections;
if (!selections) {
return;
}
// If selections already have a __typename, or are part of an
// introspection query, do nothing.
var skip = selections.some(function (selection) {
return (isField(selection) &&
(selection.name.value === "__typename" ||
selection.name.value.lastIndexOf("__", 0) === 0));
});
if (skip) {
return;
}
// If this SelectionSet is @export-ed as an input variable, it should
// not have a __typename field (see issue #4691).
var field = parent;
if (isField(field) &&
field.directives &&
field.directives.some(function (d) { return d.name.value === "export"; })) {
return;
}
// Create and return a new SelectionSet with a __typename Field.
return __assign(__assign({}, node), { selections: __spreadArray(__spreadArray([], selections, true), [TYPENAME_FIELD], false) });
},
},
});
}, {
added: function (field) {
return field === TYPENAME_FIELD;
},
});
var connectionRemoveConfig = {
test: function (directive) {
var willRemove = directive.name.value === "connection";
if (willRemove) {
if (!directive.arguments ||
!directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
globalThis.__DEV__ !== false && invariant.warn(84);
}
}
return willRemove;
},
};
export function removeConnectionDirectiveFromDocument(doc) {
return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc));
}
function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) {
if (nestedCheck === void 0) { nestedCheck = true; }
return (!!selectionSet &&
selectionSet.selections &&
selectionSet.selections.some(function (selection) {
return hasDirectivesInSelection(directives, selection, nestedCheck);
}));
}
function hasDirectivesInSelection(directives, selection, nestedCheck) {
if (nestedCheck === void 0) { nestedCheck = true; }
if (!isField(selection)) {
return true;
}
if (!selection.directives) {
return false;
}
return (selection.directives.some(getDirectiveMatcher(directives)) ||
(nestedCheck &&
hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck)));
}
function getArgumentMatcher(config) {
return function argumentMatcher(argument) {
return config.some(function (aConfig) {
return argument.value &&
argument.value.kind === Kind.VARIABLE &&
argument.value.name &&
(aConfig.name === argument.value.name.value ||
(aConfig.test && aConfig.test(argument)));
});
};
}
export function removeArgumentsFromDocument(config, doc) {
var argMatcher = getArgumentMatcher(config);
return nullIfDocIsEmpty(visit(doc, {
OperationDefinition: {
enter: function (node) {
return __assign(__assign({}, node), {
// Remove matching top level variables definitions.
variableDefinitions: node.variableDefinitions ?
node.variableDefinitions.filter(function (varDef) {
return !config.some(function (arg) { return arg.name === varDef.variable.name.value; });
})
: [] });
},
},
Field: {
enter: function (node) {
// If `remove` is set to true for an argument, and an argument match
// is found for a field, remove the field as well.
var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; });
if (shouldRemoveField) {
var argMatchCount_1 = 0;
if (node.arguments) {
node.arguments.forEach(function (arg) {
if (argMatcher(arg)) {
argMatchCount_1 += 1;
}
});
}
if (argMatchCount_1 === 1) {
return null;
}
}
},
},
Argument: {
enter: function (node) {
// Remove all matching arguments.
if (argMatcher(node)) {
return null;
}
},
},
}));
}
export function removeFragmentSpreadFromDocument(config, doc) {
function enter(node) {
if (config.some(function (def) { return def.name === node.name.value; })) {
return null;
}
}
return nullIfDocIsEmpty(visit(doc, {
FragmentSpread: { enter: enter },
FragmentDefinition: { enter: enter },
}));
}
// If the incoming document is a query, return it as is. Otherwise, build a
// new document containing a query operation based on the selection set
// of the previous main operation.
export function buildQueryFromSelectionSet(document) {
var definition = getMainDefinition(document);
var definitionOperation = definition.operation;
if (definitionOperation === "query") {
// Already a query, so return the existing document.
return document;
}
// Build a new query using the selection set of the main operation.
var modifiedDoc = visit(document, {
OperationDefinition: {
enter: function (node) {
return __assign(__assign({}, node), { operation: "query" });
},
},
});
return modifiedDoc;
}
// Remove fields / selection sets that include an @client directive.
export function removeClientSetsFromDocument(document) {
checkDocument(document);
var modifiedDoc = removeDirectivesFromDocument([
{
test: function (directive) { return directive.name.value === "client"; },
remove: true,
},
], document);
return modifiedDoc;
}
//# sourceMappingURL=transform.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/createHttpLink.js
import { __assign, __rest } from "tslib";
import { invariant } from "../../utilities/globals/index.js";
import { ApolloLink } from "../core/index.js";
import { Observable, hasDirectives } from "../../utilities/index.js";
import { serializeFetchParameter } from "./serializeFetchParameter.js";
import { selectURI } from "./selectURI.js";
import { handleError, readMultipartBody, parseAndCheckHttpResponse, } from "./parseAndCheckHttpResponse.js";
import { checkFetcher } from "./checkFetcher.js";
import { selectHttpOptionsAndBodyInternal, defaultPrinter, fallbackHttpConfig, } from "./selectHttpOptionsAndBody.js";
import { rewriteURIForGET } from "./rewriteURIForGET.js";
import { fromError, filterOperationVariables } from "../utils/index.js";
import { maybe, getMainDefinition, removeClientSetsFromDocument, } from "../../utilities/index.js";
var backupFetch = maybe(function () { return fetch; });
export var createHttpLink = function (linkOptions) {
if (linkOptions === void 0) { linkOptions = {}; }
var _a = linkOptions.uri, uri = _a === void 0 ? "/graphql" : _a,
// use default global fetch if nothing passed in
preferredFetch = linkOptions.fetch, _b = linkOptions.print, print = _b === void 0 ? defaultPrinter : _b, includeExtensions = linkOptions.includeExtensions, preserveHeaderCase = linkOptions.preserveHeaderCase, useGETForQueries = linkOptions.useGETForQueries, _c = linkOptions.includeUnusedVariables, includeUnusedVariables = _c === void 0 ? false : _c, requestOptions = __rest(linkOptions, ["uri", "fetch", "print", "includeExtensions", "preserveHeaderCase", "useGETForQueries", "includeUnusedVariables"]);
if (globalThis.__DEV__ !== false) {
// Make sure at least one of preferredFetch, window.fetch, or backupFetch is
// defined, so requests won't fail at runtime.
checkFetcher(preferredFetch || backupFetch);
}
var linkConfig = {
http: { includeExtensions: includeExtensions, preserveHeaderCase: preserveHeaderCase },
options: requestOptions.fetchOptions,
credentials: requestOptions.credentials,
headers: requestOptions.headers,
};
return new ApolloLink(function (operation) {
var chosenURI = selectURI(operation, uri);
var context = operation.getContext();
// `apollographql-client-*` headers are automatically set if a
// `clientAwareness` object is found in the context. These headers are
// set first, followed by the rest of the headers pulled from
// `context.headers`. If desired, `apollographql-client-*` headers set by
// the `clientAwareness` object can be overridden by
// `apollographql-client-*` headers set in `context.headers`.
var clientAwarenessHeaders = {};
if (context.clientAwareness) {
var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;
if (name_1) {
clientAwarenessHeaders["apollographql-client-name"] = name_1;
}
if (version) {
clientAwarenessHeaders["apollographql-client-version"] = version;
}
}
var contextHeaders = __assign(__assign({}, clientAwarenessHeaders), context.headers);
var contextConfig = {
http: context.http,
options: context.fetchOptions,
credentials: context.credentials,
headers: contextHeaders,
};
if (hasDirectives(["client"], operation.query)) {
var transformedQuery = removeClientSetsFromDocument(operation.query);
if (!transformedQuery) {
return fromError(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));
}
operation.query = transformedQuery;
}
//uses fallback, link, and then context to build options
var _b = selectHttpOptionsAndBodyInternal(operation, print, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body;
if (body.variables && !includeUnusedVariables) {
body.variables = filterOperationVariables(body.variables, operation.query);
}
var controller;
if (!options.signal && typeof AbortController !== "undefined") {
controller = new AbortController();
options.signal = controller.signal;
}
// If requested, set method to GET if there are no mutations.
var definitionIsMutation = function (d) {
return d.kind === "OperationDefinition" && d.operation === "mutation";
};
var definitionIsSubscription = function (d) {
return d.kind === "OperationDefinition" && d.operation === "subscription";
};
var isSubscription = definitionIsSubscription(getMainDefinition(operation.query));
// does not match custom directives beginning with @defer
var hasDefer = hasDirectives(["defer"], operation.query);
if (useGETForQueries &&
!operation.query.definitions.some(definitionIsMutation)) {
options.method = "GET";
}
if (hasDefer || isSubscription) {
options.headers = options.headers || {};
var acceptHeader = "multipart/mixed;";
// Omit defer-specific headers if the user attempts to defer a selection
// set on a subscription and log a warning.
if (isSubscription && hasDefer) {
globalThis.__DEV__ !== false && invariant.warn(38);
}
if (isSubscription) {
acceptHeader +=
"boundary=graphql;subscriptionSpec=1.0,application/json";
}
else if (hasDefer) {
acceptHeader += "deferSpec=20220824,application/json";
}
options.headers.accept = acceptHeader;
}
if (options.method === "GET") {
var _c = rewriteURIForGET(chosenURI, body), newURI = _c.newURI, parseError = _c.parseError;
if (parseError) {
return fromError(parseError);
}
chosenURI = newURI;
}
else {
try {
options.body = serializeFetchParameter(body, "Payload");
}
catch (parseError) {
return fromError(parseError);
}
}
return new Observable(function (observer) {
// Prefer linkOptions.fetch (preferredFetch) if provided, and otherwise
// fall back to the *current* global window.fetch function (see issue
// #7832), or (if all else fails) the backupFetch function we saved when
// this module was first evaluated. This last option protects against the
// removal of window.fetch, which is unlikely but not impossible.
var currentFetch = preferredFetch || maybe(function () { return fetch; }) || backupFetch;
var observerNext = observer.next.bind(observer);
currentFetch(chosenURI, options)
.then(function (response) {
var _a;
operation.setContext({ response: response });
var ctype = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get("content-type");
if (ctype !== null && /^multipart\/mixed/i.test(ctype)) {
return readMultipartBody(response, observerNext);
}
else {
return parseAndCheckHttpResponse(operation)(response).then(observerNext);
}
})
.then(function () {
controller = undefined;
observer.complete();
})
.catch(function (err) {
controller = undefined;
handleError(err, observer);
});
return function () {
// XXX support canceling this request
// https://developers.google.com/web/updates/2017/09/abortable-fetch
if (controller)
controller.abort();
};
});
});
};
//# sourceMappingURL=createHttpLink.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/checkFetcher.js
import { newInvariantError } from "../../utilities/globals/index.js";
export var checkFetcher = function (fetcher) {
if (!fetcher && typeof fetch === "undefined") {
throw newInvariantError(37);
}
};
//# sourceMappingURL=checkFetcher.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/selectURI.js
export var selectURI = function (operation, fallbackURI) {
var context = operation.getContext();
var contextURI = context.uri;
if (contextURI) {
return contextURI;
}
else if (typeof fallbackURI === "function") {
return fallbackURI(operation);
}
else {
return fallbackURI || "/graphql";
}
};
//# sourceMappingURL=selectURI.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/utils/filterOperationVariables.js
import { __assign } from "tslib";
import { visit } from "graphql";
export function filterOperationVariables(variables, query) {
var result = __assign({}, variables);
var unusedNames = new Set(Object.keys(variables));
visit(query, {
Variable: function (node, _key, parent) {
// A variable type definition at the top level of a query is not
// enough to silence server-side errors about the variable being
// unused, so variable definitions do not count as usage.
// https://spec.graphql.org/draft/#sec-All-Variables-Used
if (parent &&
parent.kind !== "VariableDefinition") {
unusedNames.delete(node.name.value);
}
},
});
unusedNames.forEach(function (name) {
delete result[name];
});
return result;
}
//# sourceMappingURL=filterOperationVariables.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/rewriteURIForGET.js
import { serializeFetchParameter } from "./serializeFetchParameter.js";
// For GET operations, returns the given URI rewritten with parameters, or a
// parse error.
export function rewriteURIForGET(chosenURI, body) {
// Implement the standard HTTP GET serialization, plus 'extensions'. Note
// the extra level of JSON serialization!
var queryParams = [];
var addQueryParam = function (key, value) {
queryParams.push("".concat(key, "=").concat(encodeURIComponent(value)));
};
if ("query" in body) {
addQueryParam("query", body.query);
}
if (body.operationName) {
addQueryParam("operationName", body.operationName);
}
if (body.variables) {
var serializedVariables = void 0;
try {
serializedVariables = serializeFetchParameter(body.variables, "Variables map");
}
catch (parseError) {
return { parseError: parseError };
}
addQueryParam("variables", serializedVariables);
}
if (body.extensions) {
var serializedExtensions = void 0;
try {
serializedExtensions = serializeFetchParameter(body.extensions, "Extensions map");
}
catch (parseError) {
return { parseError: parseError };
}
addQueryParam("extensions", serializedExtensions);
}
// Reconstruct the URI with added query params.
// XXX This assumes that the URI is well-formed and that it doesn't
// already contain any of these query params. We could instead use the
// URL API and take a polyfill (whatwg-url@6) for older browsers that
// don't support URLSearchParams. Note that some browsers (and
// versions of whatwg-url) support URL but not URLSearchParams!
var fragment = "", preFragment = chosenURI;
var fragmentStart = chosenURI.indexOf("#");
if (fragmentStart !== -1) {
fragment = chosenURI.substr(fragmentStart);
preFragment = chosenURI.substr(0, fragmentStart);
}
var queryParamsPrefix = preFragment.indexOf("?") === -1 ? "?" : "&";
var newURI = preFragment + queryParamsPrefix + queryParams.join("&") + fragment;
return { newURI: newURI };
}
//# sourceMappingURL=rewriteURIForGET.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/core/split.js
import { ApolloLink } from "./ApolloLink.js";
export var split = ApolloLink.split;
//# sourceMappingURL=split.js.map
webpack://frontend-tpt/../../node_modules/@wry/trie/lib/index.js
// A [trie](https://en.wikipedia.org/wiki/Trie) data structure that holds
// object keys weakly, yet can also hold non-object keys, unlike the
// native `WeakMap`.
// If no makeData function is supplied, the looked-up data will be an empty,
// null-prototype Object.
const defaultMakeData = () => Object.create(null);
// Useful for processing arguments objects as well as arrays.
const { forEach, slice } = Array.prototype;
const { hasOwnProperty } = Object.prototype;
export class Trie {
constructor(weakness = true, makeData = defaultMakeData) {
this.weakness = weakness;
this.makeData = makeData;
}
lookup() {
return this.lookupArray(arguments);
}
lookupArray(array) {
let node = this;
forEach.call(array, key => node = node.getChildTrie(key));
return hasOwnProperty.call(node, "data")
? node.data
: node.data = this.makeData(slice.call(array));
}
peek() {
return this.peekArray(arguments);
}
peekArray(array) {
let node = this;
for (let i = 0, len = array.length; node && i < len; ++i) {
const map = node.mapFor(array[i], false);
node = map && map.get(array[i]);
}
return node && node.data;
}
remove() {
return this.removeArray(arguments);
}
removeArray(array) {
let data;
if (array.length) {
const head = array[0];
const map = this.mapFor(head, false);
const child = map && map.get(head);
if (child) {
data = child.removeArray(slice.call(array, 1));
if (!child.data && !child.weak && !(child.strong && child.strong.size)) {
map.delete(head);
}
}
}
else {
data = this.data;
delete this.data;
}
return data;
}
getChildTrie(key) {
const map = this.mapFor(key, true);
let child = map.get(key);
if (!child)
map.set(key, child = new Trie(this.weakness, this.makeData));
return child;
}
mapFor(key, create) {
return this.weakness && isObjRef(key)
? this.weak || (create ? this.weak = new WeakMap : void 0)
: this.strong || (create ? this.strong = new Map : void 0);
}
}
function isObjRef(value) {
switch (typeof value) {
case "object":
if (value === null)
break;
// Fall through to return true...
case "function":
return true;
}
return false;
}
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/@wry/context/lib/slot.js
// This currentContext variable will only be used if the makeSlotClass
// function is called, which happens only if this is the first copy of the
// @wry/context package to be imported.
let currentContext = null;
// This unique internal object is used to denote the absence of a value
// for a given Slot, and is never exposed to outside code.
const MISSING_VALUE = {};
let idCounter = 1;
// Although we can't do anything about the cost of duplicated code from
// accidentally bundling multiple copies of the @wry/context package, we can
// avoid creating the Slot class more than once using makeSlotClass.
const makeSlotClass = () => class Slot {
constructor() {
// If you have a Slot object, you can find out its slot.id, but you cannot
// guess the slot.id of a Slot you don't have access to, thanks to the
// randomized suffix.
this.id = [
"slot",
idCounter++,
Date.now(),
Math.random().toString(36).slice(2),
].join(":");
}
hasValue() {
for (let context = currentContext; context; context = context.parent) {
// We use the Slot object iself as a key to its value, which means the
// value cannot be obtained without a reference to the Slot object.
if (this.id in context.slots) {
const value = context.slots[this.id];
if (value === MISSING_VALUE)
break;
if (context !== currentContext) {
// Cache the value in currentContext.slots so the next lookup will
// be faster. This caching is safe because the tree of contexts and
// the values of the slots are logically immutable.
currentContext.slots[this.id] = value;
}
return true;
}
}
if (currentContext) {
// If a value was not found for this Slot, it's never going to be found
// no matter how many times we look it up, so we might as well cache
// the absence of the value, too.
currentContext.slots[this.id] = MISSING_VALUE;
}
return false;
}
getValue() {
if (this.hasValue()) {
return currentContext.slots[this.id];
}
}
withValue(value, callback,
// Given the prevalence of arrow functions, specifying arguments is likely
// to be much more common than specifying `this`, hence this ordering:
args, thisArg) {
const slots = {
__proto__: null,
[this.id]: value,
};
const parent = currentContext;
currentContext = { parent, slots };
try {
// Function.prototype.apply allows the arguments array argument to be
// omitted or undefined, so args! is fine here.
return callback.apply(thisArg, args);
}
finally {
currentContext = parent;
}
}
// Capture the current context and wrap a callback function so that it
// reestablishes the captured context when called.
static bind(callback) {
const context = currentContext;
return function () {
const saved = currentContext;
try {
currentContext = context;
return callback.apply(this, arguments);
}
finally {
currentContext = saved;
}
};
}
// Immediately run a callback function without any captured context.
static noContext(callback,
// Given the prevalence of arrow functions, specifying arguments is likely
// to be much more common than specifying `this`, hence this ordering:
args, thisArg) {
if (currentContext) {
const saved = currentContext;
try {
currentContext = null;
// Function.prototype.apply allows the arguments array argument to be
// omitted or undefined, so args! is fine here.
return callback.apply(thisArg, args);
}
finally {
currentContext = saved;
}
}
else {
return callback.apply(thisArg, args);
}
}
};
function maybe(fn) {
try {
return fn();
}
catch (ignored) { }
}
// We store a single global implementation of the Slot class as a permanent
// non-enumerable property of the globalThis object. This obfuscation does
// nothing to prevent access to the Slot class, but at least it ensures the
// implementation (i.e. currentContext) cannot be tampered with, and all copies
// of the @wry/context package (hopefully just one) will share the same Slot
// implementation. Since the first copy of the @wry/context package to be
// imported wins, this technique imposes a steep cost for any future breaking
// changes to the Slot class.
const globalKey = "@wry/context:Slot";
const host =
// Prefer globalThis when available.
// https://github.com/benjamn/wryware/issues/347
maybe(() => globalThis) ||
// Fall back to global, which works in Node.js and may be converted by some
// bundlers to the appropriate identifier (window, self, ...) depending on the
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
maybe(() => global) ||
// Otherwise, use a dummy host that's local to this module. We used to fall
// back to using the Array constructor as a namespace, but that was flagged in
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
Object.create(null);
// Whichever globalHost we're using, make TypeScript happy about the additional
// globalKey property.
const globalHost = host;
export const Slot = globalHost[globalKey] ||
// Earlier versions of this package stored the globalKey property on the Array
// constructor, so we check there as well, to prevent Slot class duplication.
Array[globalKey] ||
(function (Slot) {
try {
Object.defineProperty(globalHost, globalKey, {
value: Slot,
enumerable: false,
writable: false,
// When it was possible for globalHost to be the Array constructor (a
// legacy Slot dedup strategy), it was important for the property to be
// configurable:true so it could be deleted. That does not seem to be as
// important when globalHost is the global object, but I don't want to
// cause similar problems again, and configurable:true seems safest.
// https://github.com/endojs/endo/issues/576#issuecomment-1178274008
configurable: true
});
}
finally {
return Slot;
}
})(makeSlotClass());
//# sourceMappingURL=slot.js.map
webpack://frontend-tpt/../../node_modules/@wry/context/lib/index.js
import { Slot } from "./slot.js";
export { Slot };
export const { bind, noContext } = Slot;
// Like global.setTimeout, except the callback runs with captured context.
export { setTimeoutWithContext as setTimeout };
function setTimeoutWithContext(callback, delay) {
return setTimeout(bind(callback), delay);
}
// Turn any generator function into an async function (using yield instead
// of await), with context automatically preserved across yields.
export function asyncFromGen(genFn) {
return function () {
const gen = genFn.apply(this, arguments);
const boundNext = bind(gen.next);
const boundThrow = bind(gen.throw);
return new Promise((resolve, reject) => {
function invoke(method, argument) {
try {
var result = method.call(gen, argument);
}
catch (error) {
return reject(error);
}
const next = result.done ? resolve : invokeNext;
if (isPromiseLike(result.value)) {
result.value.then(next, result.done ? reject : invokeThrow);
}
else {
next(result.value);
}
}
const invokeNext = (value) => invoke(boundNext, value);
const invokeThrow = (error) => invoke(boundThrow, error);
invokeNext();
});
};
}
function isPromiseLike(value) {
return value && typeof value.then === "function";
}
// If you use the fibers npm package to implement coroutines in Node.js,
// you should call this function at least once to ensure context management
// remains coherent across any yields.
const wrappedFibers = [];
export function wrapYieldingFiberMethods(Fiber) {
// There can be only one implementation of Fiber per process, so this array
// should never grow longer than one element.
if (wrappedFibers.indexOf(Fiber) < 0) {
const wrap = (obj, method) => {
const fn = obj[method];
obj[method] = function () {
return noContext(fn, arguments, this);
};
};
// These methods can yield, according to
// https://github.com/laverdet/node-fibers/blob/ddebed9b8ae3883e57f822e2108e6943e5c8d2a8/fibers.js#L97-L100
wrap(Fiber, "yield");
wrap(Fiber.prototype, "run");
wrap(Fiber.prototype, "throwInto");
wrappedFibers.push(Fiber);
}
return Fiber;
}
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/optimism/lib/context.js
import { Slot } from "@wry/context";
export const parentEntrySlot = new Slot();
export function nonReactive(fn) {
return parentEntrySlot.withValue(void 0, fn);
}
export { Slot };
export { bind as bindContext, noContext, setTimeout, asyncFromGen, } from "@wry/context";
//# sourceMappingURL=context.js.map
webpack://frontend-tpt/../../node_modules/optimism/lib/helpers.js
export const { hasOwnProperty, } = Object.prototype;
export const arrayFromSet = Array.from ||
function (set) {
const array = [];
set.forEach(item => array.push(item));
return array;
};
export function maybeUnsubscribe(entryOrDep) {
const { unsubscribe } = entryOrDep;
if (typeof unsubscribe === "function") {
entryOrDep.unsubscribe = void 0;
unsubscribe();
}
}
//# sourceMappingURL=helpers.js.map
webpack://frontend-tpt/../../node_modules/optimism/lib/entry.js
import { parentEntrySlot } from "./context.js";
import { maybeUnsubscribe, arrayFromSet } from "./helpers.js";
const emptySetPool = [];
const POOL_TARGET_SIZE = 100;
// Since this package might be used browsers, we should avoid using the
// Node built-in assert module.
function assert(condition, optionalMessage) {
if (!condition) {
throw new Error(optionalMessage || "assertion failure");
}
}
function valueIs(a, b) {
const len = a.length;
return (
// Unknown values are not equal to each other.
len > 0 &&
// Both values must be ordinary (or both exceptional) to be equal.
len === b.length &&
// The underlying value or exception must be the same.
a[len - 1] === b[len - 1]);
}
function valueGet(value) {
switch (value.length) {
case 0: throw new Error("unknown value");
case 1: return value[0];
case 2: throw value[1];
}
}
function valueCopy(value) {
return value.slice(0);
}
export class Entry {
constructor(fn) {
this.fn = fn;
this.parents = new Set();
this.childValues = new Map();
// When this Entry has children that are dirty, this property becomes
// a Set containing other Entry objects, borrowed from emptySetPool.
// When the set becomes empty, it gets recycled back to emptySetPool.
this.dirtyChildren = null;
this.dirty = true;
this.recomputing = false;
this.value = [];
this.deps = null;
++Entry.count;
}
peek() {
if (this.value.length === 1 && !mightBeDirty(this)) {
rememberParent(this);
return this.value[0];
}
}
// This is the most important method of the Entry API, because it
// determines whether the cached this.value can be returned immediately,
// or must be recomputed. The overall performance of the caching system
// depends on the truth of the following observations: (1) this.dirty is
// usually false, (2) this.dirtyChildren is usually null/empty, and thus
// (3) valueGet(this.value) is usually returned without recomputation.
recompute(args) {
assert(!this.recomputing, "already recomputing");
rememberParent(this);
return mightBeDirty(this)
? reallyRecompute(this, args)
: valueGet(this.value);
}
setDirty() {
if (this.dirty)
return;
this.dirty = true;
reportDirty(this);
// We can go ahead and unsubscribe here, since any further dirty
// notifications we receive will be redundant, and unsubscribing may
// free up some resources, e.g. file watchers.
maybeUnsubscribe(this);
}
dispose() {
this.setDirty();
// Sever any dependency relationships with our own children, so those
// children don't retain this parent Entry in their child.parents sets,
// thereby preventing it from being fully garbage collected.
forgetChildren(this);
// Because this entry has been kicked out of the cache (in index.js),
// we've lost the ability to find out if/when this entry becomes dirty,
// whether that happens through a subscription, because of a direct call
// to entry.setDirty(), or because one of its children becomes dirty.
// Because of this loss of future information, we have to assume the
// worst (that this entry might have become dirty very soon), so we must
// immediately mark this entry's parents as dirty. Normally we could
// just call entry.setDirty() rather than calling parent.setDirty() for
// each parent, but that would leave this entry in parent.childValues
// and parent.dirtyChildren, which would prevent the child from being
// truly forgotten.
eachParent(this, (parent, child) => {
parent.setDirty();
forgetChild(parent, this);
});
}
forget() {
// The code that creates Entry objects in index.ts will replace this method
// with one that actually removes the Entry from the cache, which will also
// trigger the entry.dispose method.
this.dispose();
}
dependOn(dep) {
dep.add(this);
if (!this.deps) {
this.deps = emptySetPool.pop() || new Set();
}
this.deps.add(dep);
}
forgetDeps() {
if (this.deps) {
arrayFromSet(this.deps).forEach(dep => dep.delete(this));
this.deps.clear();
emptySetPool.push(this.deps);
this.deps = null;
}
}
}
Entry.count = 0;
function rememberParent(child) {
const parent = parentEntrySlot.getValue();
if (parent) {
child.parents.add(parent);
if (!parent.childValues.has(child)) {
parent.childValues.set(child, []);
}
if (mightBeDirty(child)) {
reportDirtyChild(parent, child);
}
else {
reportCleanChild(parent, child);
}
return parent;
}
}
function reallyRecompute(entry, args) {
forgetChildren(entry);
// Set entry as the parent entry while calling recomputeNewValue(entry).
parentEntrySlot.withValue(entry, recomputeNewValue, [entry, args]);
if (maybeSubscribe(entry, args)) {
// If we successfully recomputed entry.value and did not fail to
// (re)subscribe, then this Entry is no longer explicitly dirty.
setClean(entry);
}
return valueGet(entry.value);
}
function recomputeNewValue(entry, args) {
entry.recomputing = true;
const { normalizeResult } = entry;
let oldValueCopy;
if (normalizeResult && entry.value.length === 1) {
oldValueCopy = valueCopy(entry.value);
}
// Make entry.value an empty array, representing an unknown value.
entry.value.length = 0;
try {
// If entry.fn succeeds, entry.value will become a normal Value.
entry.value[0] = entry.fn.apply(null, args);
// If we have a viable oldValueCopy to compare with the (successfully
// recomputed) new entry.value, and they are not already === identical, give
// normalizeResult a chance to pick/choose/reuse parts of oldValueCopy[0]
// and/or entry.value[0] to determine the final cached entry.value.
if (normalizeResult && oldValueCopy && !valueIs(oldValueCopy, entry.value)) {
try {
entry.value[0] = normalizeResult(entry.value[0], oldValueCopy[0]);
}
catch (_a) {
// If normalizeResult throws, just use the newer value, rather than
// saving the exception as entry.value[1].
}
}
}
catch (e) {
// If entry.fn throws, entry.value will hold that exception.
entry.value[1] = e;
}
// Either way, this line is always reached.
entry.recomputing = false;
}
function mightBeDirty(entry) {
return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size);
}
function setClean(entry) {
entry.dirty = false;
if (mightBeDirty(entry)) {
// This Entry may still have dirty children, in which case we can't
// let our parents know we're clean just yet.
return;
}
reportClean(entry);
}
function reportDirty(child) {
eachParent(child, reportDirtyChild);
}
function reportClean(child) {
eachParent(child, reportCleanChild);
}
function eachParent(child, callback) {
const parentCount = child.parents.size;
if (parentCount) {
const parents = arrayFromSet(child.parents);
for (let i = 0; i < parentCount; ++i) {
callback(parents[i], child);
}
}
}
// Let a parent Entry know that one of its children may be dirty.
function reportDirtyChild(parent, child) {
// Must have called rememberParent(child) before calling
// reportDirtyChild(parent, child).
assert(parent.childValues.has(child));
assert(mightBeDirty(child));
const parentWasClean = !mightBeDirty(parent);
if (!parent.dirtyChildren) {
parent.dirtyChildren = emptySetPool.pop() || new Set;
}
else if (parent.dirtyChildren.has(child)) {
// If we already know this child is dirty, then we must have already
// informed our own parents that we are dirty, so we can terminate
// the recursion early.
return;
}
parent.dirtyChildren.add(child);
// If parent was clean before, it just became (possibly) dirty (according to
// mightBeDirty), since we just added child to parent.dirtyChildren.
if (parentWasClean) {
reportDirty(parent);
}
}
// Let a parent Entry know that one of its children is no longer dirty.
function reportCleanChild(parent, child) {
// Must have called rememberChild(child) before calling
// reportCleanChild(parent, child).
assert(parent.childValues.has(child));
assert(!mightBeDirty(child));
const childValue = parent.childValues.get(child);
if (childValue.length === 0) {
parent.childValues.set(child, valueCopy(child.value));
}
else if (!valueIs(childValue, child.value)) {
parent.setDirty();
}
removeDirtyChild(parent, child);
if (mightBeDirty(parent)) {
return;
}
reportClean(parent);
}
function removeDirtyChild(parent, child) {
const dc = parent.dirtyChildren;
if (dc) {
dc.delete(child);
if (dc.size === 0) {
if (emptySetPool.length < POOL_TARGET_SIZE) {
emptySetPool.push(dc);
}
parent.dirtyChildren = null;
}
}
}
// Removes all children from this entry and returns an array of the
// removed children.
function forgetChildren(parent) {
if (parent.childValues.size > 0) {
parent.childValues.forEach((_value, child) => {
forgetChild(parent, child);
});
}
// Remove this parent Entry from any sets to which it was added by the
// addToSet method.
parent.forgetDeps();
// After we forget all our children, this.dirtyChildren must be empty
// and therefore must have been reset to null.
assert(parent.dirtyChildren === null);
}
function forgetChild(parent, child) {
child.parents.delete(parent);
parent.childValues.delete(child);
removeDirtyChild(parent, child);
}
function maybeSubscribe(entry, args) {
if (typeof entry.subscribe === "function") {
try {
maybeUnsubscribe(entry); // Prevent double subscriptions.
entry.unsubscribe = entry.subscribe.apply(null, args);
}
catch (e) {
// If this Entry has a subscribe function and it threw an exception
// (or an unsubscribe function it previously returned now throws),
// return false to indicate that we were not able to subscribe (or
// unsubscribe), and this Entry should remain dirty.
entry.setDirty();
return false;
}
}
// Returning true indicates either that there was no entry.subscribe
// function or that it succeeded.
return true;
}
//# sourceMappingURL=entry.js.map
webpack://frontend-tpt/../../node_modules/optimism/lib/dep.js
import { parentEntrySlot } from "./context.js";
import { hasOwnProperty, maybeUnsubscribe, arrayFromSet, } from "./helpers.js";
const EntryMethods = {
setDirty: true,
dispose: true,
forget: true, // Fully remove parent Entry from LRU cache and computation graph
};
export function dep(options) {
const depsByKey = new Map();
const subscribe = options && options.subscribe;
function depend(key) {
const parent = parentEntrySlot.getValue();
if (parent) {
let dep = depsByKey.get(key);
if (!dep) {
depsByKey.set(key, dep = new Set);
}
parent.dependOn(dep);
if (typeof subscribe === "function") {
maybeUnsubscribe(dep);
dep.unsubscribe = subscribe(key);
}
}
}
depend.dirty = function dirty(key, entryMethodName) {
const dep = depsByKey.get(key);
if (dep) {
const m = (entryMethodName &&
hasOwnProperty.call(EntryMethods, entryMethodName)) ? entryMethodName : "setDirty";
// We have to use arrayFromSet(dep).forEach instead of dep.forEach,
// because modifying a Set while iterating over it can cause elements in
// the Set to be removed from the Set before they've been iterated over.
arrayFromSet(dep).forEach(entry => entry[m]());
depsByKey.delete(key);
maybeUnsubscribe(dep);
}
};
return depend;
}
//# sourceMappingURL=dep.js.map
webpack://frontend-tpt/../../node_modules/optimism/lib/index.js
import { Trie } from "@wry/trie";
import { StrongCache } from "@wry/caches";
import { Entry } from "./entry.js";
import { parentEntrySlot } from "./context.js";
// These helper functions are important for making optimism work with
// asynchronous code. In order to register parent-child dependencies,
// optimism needs to know about any currently active parent computations.
// In ordinary synchronous code, the parent context is implicit in the
// execution stack, but asynchronous code requires some extra guidance in
// order to propagate context from one async task segment to the next.
export { bindContext, noContext, nonReactive, setTimeout, asyncFromGen, Slot, } from "./context.js";
// A lighter-weight dependency, similar to OptimisticWrapperFunction, except
// with only one argument, no makeCacheKey, no wrapped function to recompute,
// and no result value. Useful for representing dependency leaves in the graph
// of computation. Subscriptions are supported.
export { dep } from "./dep.js";
// The defaultMakeCacheKey function is remarkably powerful, because it gives
// a unique object for any shallow-identical list of arguments. If you need
// to implement a custom makeCacheKey function, you may find it helpful to
// delegate the final work to defaultMakeCacheKey, which is why we export it
// here. However, you may want to avoid defaultMakeCacheKey if your runtime
// does not support WeakMap, or you have the ability to return a string key.
// In those cases, just write your own custom makeCacheKey functions.
let defaultKeyTrie;
export function defaultMakeCacheKey(...args) {
const trie = defaultKeyTrie || (defaultKeyTrie = new Trie(typeof WeakMap === "function"));
return trie.lookupArray(args);
}
// If you're paranoid about memory leaks, or you want to avoid using WeakMap
// under the hood, but you still need the behavior of defaultMakeCacheKey,
// import this constructor to create your own tries.
export { Trie as KeyTrie };
;
const caches = new Set();
export function wrap(originalFunction, { max = Math.pow(2, 16), keyArgs, makeCacheKey = defaultMakeCacheKey, normalizeResult, subscribe, cache: cacheOption = StrongCache, } = Object.create(null)) {
const cache = typeof cacheOption === "function"
? new cacheOption(max, entry => entry.dispose())
: cacheOption;
const optimistic = function () {
const key = makeCacheKey.apply(null, keyArgs ? keyArgs.apply(null, arguments) : arguments);
if (key === void 0) {
return originalFunction.apply(null, arguments);
}
let entry = cache.get(key);
if (!entry) {
cache.set(key, entry = new Entry(originalFunction));
entry.normalizeResult = normalizeResult;
entry.subscribe = subscribe;
// Give the Entry the ability to trigger cache.delete(key), even though
// the Entry itself does not know about key or cache.
entry.forget = () => cache.delete(key);
}
const value = entry.recompute(Array.prototype.slice.call(arguments));
// Move this entry to the front of the least-recently used queue,
// since we just finished computing its value.
cache.set(key, entry);
caches.add(cache);
// Clean up any excess entries in the cache, but only if there is no
// active parent entry, meaning we're not in the middle of a larger
// computation that might be flummoxed by the cleaning.
if (!parentEntrySlot.hasValue()) {
caches.forEach(cache => cache.clean());
caches.clear();
}
return value;
};
Object.defineProperty(optimistic, "size", {
get: () => cache.size,
configurable: false,
enumerable: false,
});
Object.freeze(optimistic.options = {
max,
keyArgs,
makeCacheKey,
normalizeResult,
subscribe,
cache,
});
function dirtyKey(key) {
const entry = key && cache.get(key);
if (entry) {
entry.setDirty();
}
}
optimistic.dirtyKey = dirtyKey;
optimistic.dirty = function dirty() {
dirtyKey(makeCacheKey.apply(null, arguments));
};
function peekKey(key) {
const entry = key && cache.get(key);
if (entry) {
return entry.peek();
}
}
optimistic.peekKey = peekKey;
optimistic.peek = function peek() {
return peekKey(makeCacheKey.apply(null, arguments));
};
function forgetKey(key) {
return key ? cache.delete(key) : false;
}
optimistic.forgetKey = forgetKey;
optimistic.forget = function forget() {
return forgetKey(makeCacheKey.apply(null, arguments));
};
optimistic.makeCacheKey = makeCacheKey;
optimistic.getKey = keyArgs ? function getKey() {
return makeCacheKey.apply(null, keyArgs.apply(null, arguments));
} : makeCacheKey;
return Object.freeze(optimistic);
}
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/core/cache.js
import { __assign, __rest } from "tslib";
import { wrap } from "optimism";
import { cacheSizes, getFragmentQueryDocument, } from "../../utilities/index.js";
import { WeakCache } from "@wry/caches";
import { getApolloCacheMemoryInternals } from "../../utilities/caching/getMemoryInternals.js";
var ApolloCache = /** @class */ (function () {
function ApolloCache() {
this.assumeImmutableResults = false;
// Make sure we compute the same (===) fragment query document every
// time we receive the same fragment in readFragment.
this.getFragmentDoc = wrap(getFragmentQueryDocument, {
max: cacheSizes["cache.fragmentQueryDocuments"] ||
1000 /* defaultCacheSizes["cache.fragmentQueryDocuments"] */,
cache: WeakCache,
});
}
// Transactional API
// The batch method is intended to replace/subsume both performTransaction
// and recordOptimisticTransaction, but performTransaction came first, so we
// provide a default batch implementation that's just another way of calling
// performTransaction. Subclasses of ApolloCache (such as InMemoryCache) can
// override the batch method to do more interesting things with its options.
ApolloCache.prototype.batch = function (options) {
var _this = this;
var optimisticId = typeof options.optimistic === "string" ? options.optimistic
: options.optimistic === false ? null
: void 0;
var updateResult;
this.performTransaction(function () { return (updateResult = options.update(_this)); }, optimisticId);
return updateResult;
};
ApolloCache.prototype.recordOptimisticTransaction = function (transaction, optimisticId) {
this.performTransaction(transaction, optimisticId);
};
// Optional API
// Called once per input document, allowing the cache to make static changes
// to the query, such as adding __typename fields.
ApolloCache.prototype.transformDocument = function (document) {
return document;
};
// Called before each ApolloLink request, allowing the cache to make dynamic
// changes to the query, such as filling in missing fragment definitions.
ApolloCache.prototype.transformForLink = function (document) {
return document;
};
ApolloCache.prototype.identify = function (object) {
return;
};
ApolloCache.prototype.gc = function () {
return [];
};
ApolloCache.prototype.modify = function (options) {
return false;
};
// DataProxy API
ApolloCache.prototype.readQuery = function (options, optimistic) {
if (optimistic === void 0) { optimistic = !!options.optimistic; }
return this.read(__assign(__assign({}, options), { rootId: options.id || "ROOT_QUERY", optimistic: optimistic }));
};
ApolloCache.prototype.readFragment = function (options, optimistic) {
if (optimistic === void 0) { optimistic = !!options.optimistic; }
return this.read(__assign(__assign({}, options), { query: this.getFragmentDoc(options.fragment, options.fragmentName), rootId: options.id, optimistic: optimistic }));
};
ApolloCache.prototype.writeQuery = function (_a) {
var id = _a.id, data = _a.data, options = __rest(_a, ["id", "data"]);
return this.write(Object.assign(options, {
dataId: id || "ROOT_QUERY",
result: data,
}));
};
ApolloCache.prototype.writeFragment = function (_a) {
var id = _a.id, data = _a.data, fragment = _a.fragment, fragmentName = _a.fragmentName, options = __rest(_a, ["id", "data", "fragment", "fragmentName"]);
return this.write(Object.assign(options, {
query: this.getFragmentDoc(fragment, fragmentName),
dataId: id,
result: data,
}));
};
ApolloCache.prototype.updateQuery = function (options, update) {
return this.batch({
update: function (cache) {
var value = cache.readQuery(options);
var data = update(value);
if (data === void 0 || data === null)
return value;
cache.writeQuery(__assign(__assign({}, options), { data: data }));
return data;
},
});
};
ApolloCache.prototype.updateFragment = function (options, update) {
return this.batch({
update: function (cache) {
var value = cache.readFragment(options);
var data = update(value);
if (data === void 0 || data === null)
return value;
cache.writeFragment(__assign(__assign({}, options), { data: data }));
return data;
},
});
};
return ApolloCache;
}());
export { ApolloCache };
if (globalThis.__DEV__ !== false) {
ApolloCache.prototype.getMemoryInternals = getApolloCacheMemoryInternals;
}
//# sourceMappingURL=cache.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/core/types/common.js
import { __extends } from "tslib";
var MissingFieldError = /** @class */ (function (_super) {
__extends(MissingFieldError, _super);
function MissingFieldError(message, path, query, variables) {
var _a;
// 'Error' breaks prototype chain here
var _this = _super.call(this, message) || this;
_this.message = message;
_this.path = path;
_this.query = query;
_this.variables = variables;
if (Array.isArray(_this.path)) {
_this.missing = _this.message;
for (var i = _this.path.length - 1; i >= 0; --i) {
_this.missing = (_a = {}, _a[_this.path[i]] = _this.missing, _a);
}
}
else {
_this.missing = _this.path;
}
// We're not using `Object.setPrototypeOf` here as it isn't fully supported
// on Android (see issue #3236).
_this.__proto__ = MissingFieldError.prototype;
return _this;
}
return MissingFieldError;
}(Error));
export { MissingFieldError };
//# sourceMappingURL=common.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/graphql/DocumentTransform.js
import { Trie } from "@wry/trie";
import { canUseWeakMap, canUseWeakSet } from "../common/canUse.js";
import { checkDocument } from "./getFromAST.js";
import { invariant } from "../globals/index.js";
import { WeakCache } from "@wry/caches";
import { wrap } from "optimism";
import { cacheSizes } from "../caching/index.js";
function identity(document) {
return document;
}
var DocumentTransform = /** @class */ (function () {
function DocumentTransform(transform, options) {
if (options === void 0) { options = Object.create(null); }
this.resultCache = canUseWeakSet ? new WeakSet() : new Set();
this.transform = transform;
if (options.getCacheKey) {
// Override default `getCacheKey` function, which returns [document].
this.getCacheKey = options.getCacheKey;
}
this.cached = options.cache !== false;
this.resetCache();
}
// This default implementation of getCacheKey can be overridden by providing
// options.getCacheKey to the DocumentTransform constructor. In general, a
// getCacheKey function may either return an array of keys (often including
// the document) to be used as a cache key, or undefined to indicate the
// transform for this document should not be cached.
DocumentTransform.prototype.getCacheKey = function (document) {
return [document];
};
DocumentTransform.identity = function () {
// No need to cache this transform since it just returns the document
// unchanged. This should save a bit of memory that would otherwise be
// needed to populate the `documentCache` of this transform.
return new DocumentTransform(identity, { cache: false });
};
DocumentTransform.split = function (predicate, left, right) {
if (right === void 0) { right = DocumentTransform.identity(); }
return Object.assign(new DocumentTransform(function (document) {
var documentTransform = predicate(document) ? left : right;
return documentTransform.transformDocument(document);
},
// Reasonably assume both `left` and `right` transforms handle their own caching
{ cache: false }), { left: left, right: right });
};
/**
* Resets the internal cache of this transform, if it has one.
*/
DocumentTransform.prototype.resetCache = function () {
var _this = this;
if (this.cached) {
var stableCacheKeys_1 = new Trie(canUseWeakMap);
this.performWork = wrap(DocumentTransform.prototype.performWork.bind(this), {
makeCacheKey: function (document) {
var cacheKeys = _this.getCacheKey(document);
if (cacheKeys) {
invariant(Array.isArray(cacheKeys), 66);
return stableCacheKeys_1.lookupArray(cacheKeys);
}
},
max: cacheSizes["documentTransform.cache"],
cache: (WeakCache),
});
}
};
DocumentTransform.prototype.performWork = function (document) {
checkDocument(document);
return this.transform(document);
};
DocumentTransform.prototype.transformDocument = function (document) {
// If a user passes an already transformed result back to this function,
// immediately return it.
if (this.resultCache.has(document)) {
return document;
}
var transformedDocument = this.performWork(document);
this.resultCache.add(transformedDocument);
return transformedDocument;
};
DocumentTransform.prototype.concat = function (otherTransform) {
var _this = this;
return Object.assign(new DocumentTransform(function (document) {
return otherTransform.transformDocument(_this.transformDocument(document));
},
// Reasonably assume both transforms handle their own caching
{ cache: false }), {
left: this,
right: otherTransform,
});
};
return DocumentTransform;
}());
export { DocumentTransform };
//# sourceMappingURL=DocumentTransform.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/inmemory/helpers.js
import { isReference, isField, DeepMerger, resultKeyNameFromField, shouldInclude, isNonNullObject, compact, createFragmentMap, getFragmentDefinitions, isArray, } from "../../utilities/index.js";
export var hasOwn = Object.prototype.hasOwnProperty;
export function isNullish(value) {
return value === null || value === void 0;
}
export { isArray };
export function defaultDataIdFromObject(_a, context) {
var __typename = _a.__typename, id = _a.id, _id = _a._id;
if (typeof __typename === "string") {
if (context) {
context.keyObject =
!isNullish(id) ? { id: id }
: !isNullish(_id) ? { _id: _id }
: void 0;
}
// If there is no object.id, fall back to object._id.
if (isNullish(id) && !isNullish(_id)) {
id = _id;
}
if (!isNullish(id)) {
return "".concat(__typename, ":").concat(typeof id === "number" || typeof id === "string" ?
id
: JSON.stringify(id));
}
}
}
var defaultConfig = {
dataIdFromObject: defaultDataIdFromObject,
addTypename: true,
resultCaching: true,
// Thanks to the shouldCanonizeResults helper, this should be the only line
// you have to change to reenable canonization by default in the future.
canonizeResults: false,
};
export function normalizeConfig(config) {
return compact(defaultConfig, config);
}
export function shouldCanonizeResults(config) {
var value = config.canonizeResults;
return value === void 0 ? defaultConfig.canonizeResults : value;
}
export function getTypenameFromStoreObject(store, objectOrReference) {
return isReference(objectOrReference) ?
store.get(objectOrReference.__ref, "__typename")
: objectOrReference && objectOrReference.__typename;
}
export var TypeOrFieldNameRegExp = /^[_a-z][_0-9a-z]*/i;
export function fieldNameFromStoreName(storeFieldName) {
var match = storeFieldName.match(TypeOrFieldNameRegExp);
return match ? match[0] : storeFieldName;
}
export function selectionSetMatchesResult(selectionSet, result, variables) {
if (isNonNullObject(result)) {
return isArray(result) ?
result.every(function (item) {
return selectionSetMatchesResult(selectionSet, item, variables);
})
: selectionSet.selections.every(function (field) {
if (isField(field) && shouldInclude(field, variables)) {
var key = resultKeyNameFromField(field);
return (hasOwn.call(result, key) &&
(!field.selectionSet ||
selectionSetMatchesResult(field.selectionSet, result[key], variables)));
}
// If the selection has been skipped with @skip(true) or
// @include(false), it should not count against the matching. If
// the selection is not a field, it must be a fragment (inline or
// named). We will determine if selectionSetMatchesResult for that
// fragment when we get to it, so for now we return true.
return true;
});
}
return false;
}
export function storeValueIsStoreObject(value) {
return isNonNullObject(value) && !isReference(value) && !isArray(value);
}
export function makeProcessedFieldsMerger() {
return new DeepMerger();
}
export function extractFragmentContext(document, fragments) {
// FragmentMap consisting only of fragments defined directly in document, not
// including other fragments registered in the FragmentRegistry.
var fragmentMap = createFragmentMap(getFragmentDefinitions(document));
return {
fragmentMap: fragmentMap,
lookupFragment: function (name) {
var def = fragmentMap[name];
if (!def && fragments) {
def = fragments.lookup(name);
}
return def || null;
},
};
}
//# sourceMappingURL=helpers.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/inmemory/entityStore.js
import { __assign, __extends, __rest } from "tslib";
import { invariant } from "../../utilities/globals/index.js";
import { dep } from "optimism";
import { equal } from "@wry/equality";
import { Trie } from "@wry/trie";
import { isReference, makeReference, DeepMerger, maybeDeepFreeze, canUseWeakMap, isNonNullObject, } from "../../utilities/index.js";
import { hasOwn, fieldNameFromStoreName } from "./helpers.js";
var DELETE = Object.create(null);
var delModifier = function () { return DELETE; };
var INVALIDATE = Object.create(null);
var EntityStore = /** @class */ (function () {
function EntityStore(policies, group) {
var _this = this;
this.policies = policies;
this.group = group;
this.data = Object.create(null);
// Maps root entity IDs to the number of times they have been retained, minus
// the number of times they have been released. Retained entities keep other
// entities they reference (even indirectly) from being garbage collected.
this.rootIds = Object.create(null);
// Lazily tracks { __ref: <dataId> } strings contained by this.data[dataId].
this.refs = Object.create(null);
// Bound function that can be passed around to provide easy access to fields
// of Reference objects as well as ordinary objects.
this.getFieldValue = function (objectOrReference, storeFieldName) {
return maybeDeepFreeze(isReference(objectOrReference) ?
_this.get(objectOrReference.__ref, storeFieldName)
: objectOrReference && objectOrReference[storeFieldName]);
};
// Returns true for non-normalized StoreObjects and non-dangling
// References, indicating that readField(name, objOrRef) has a chance of
// working. Useful for filtering out dangling references from lists.
this.canRead = function (objOrRef) {
return isReference(objOrRef) ?
_this.has(objOrRef.__ref)
: typeof objOrRef === "object";
};
// Bound function that converts an id or an object with a __typename and
// primary key fields to a Reference object. If called with a Reference object,
// that same Reference object is returned. Pass true for mergeIntoStore to persist
// an object into the store.
this.toReference = function (objOrIdOrRef, mergeIntoStore) {
if (typeof objOrIdOrRef === "string") {
return makeReference(objOrIdOrRef);
}
if (isReference(objOrIdOrRef)) {
return objOrIdOrRef;
}
var id = _this.policies.identify(objOrIdOrRef)[0];
if (id) {
var ref = makeReference(id);
if (mergeIntoStore) {
_this.merge(id, objOrIdOrRef);
}
return ref;
}
};
}
// Although the EntityStore class is abstract, it contains concrete
// implementations of the various NormalizedCache interface methods that
// are inherited by the Root and Layer subclasses.
EntityStore.prototype.toObject = function () {
return __assign({}, this.data);
};
EntityStore.prototype.has = function (dataId) {
return this.lookup(dataId, true) !== void 0;
};
EntityStore.prototype.get = function (dataId, fieldName) {
this.group.depend(dataId, fieldName);
if (hasOwn.call(this.data, dataId)) {
var storeObject = this.data[dataId];
if (storeObject && hasOwn.call(storeObject, fieldName)) {
return storeObject[fieldName];
}
}
if (fieldName === "__typename" &&
hasOwn.call(this.policies.rootTypenamesById, dataId)) {
return this.policies.rootTypenamesById[dataId];
}
if (this instanceof Layer) {
return this.parent.get(dataId, fieldName);
}
};
EntityStore.prototype.lookup = function (dataId, dependOnExistence) {
// The has method (above) calls lookup with dependOnExistence = true, so
// that it can later be invalidated when we add or remove a StoreObject for
// this dataId. Any consumer who cares about the contents of the StoreObject
// should not rely on this dependency, since the contents could change
// without the object being added or removed.
if (dependOnExistence)
this.group.depend(dataId, "__exists");
if (hasOwn.call(this.data, dataId)) {
return this.data[dataId];
}
if (this instanceof Layer) {
return this.parent.lookup(dataId, dependOnExistence);
}
if (this.policies.rootTypenamesById[dataId]) {
return Object.create(null);
}
};
EntityStore.prototype.merge = function (older, newer) {
var _this = this;
var dataId;
// Convert unexpected references to ID strings.
if (isReference(older))
older = older.__ref;
if (isReference(newer))
newer = newer.__ref;
var existing = typeof older === "string" ? this.lookup((dataId = older)) : older;
var incoming = typeof newer === "string" ? this.lookup((dataId = newer)) : newer;
// If newer was a string ID, but that ID was not defined in this store,
// then there are no fields to be merged, so we're done.
if (!incoming)
return;
invariant(typeof dataId === "string", 1);
var merged = new DeepMerger(storeObjectReconciler).merge(existing, incoming);
// Even if merged === existing, existing may have come from a lower
// layer, so we always need to set this.data[dataId] on this level.
this.data[dataId] = merged;
if (merged !== existing) {
delete this.refs[dataId];
if (this.group.caching) {
var fieldsToDirty_1 = Object.create(null);
// If we added a new StoreObject where there was previously none, dirty
// anything that depended on the existence of this dataId, such as the
// EntityStore#has method.
if (!existing)
fieldsToDirty_1.__exists = 1;
// Now invalidate dependents who called getFieldValue for any fields
// that are changing as a result of this merge.
Object.keys(incoming).forEach(function (storeFieldName) {
if (!existing ||
existing[storeFieldName] !== merged[storeFieldName]) {
// Always dirty the full storeFieldName, which may include
// serialized arguments following the fieldName prefix.
fieldsToDirty_1[storeFieldName] = 1;
// Also dirty fieldNameFromStoreName(storeFieldName) if it's
// different from storeFieldName and this field does not have
// keyArgs configured, because that means the cache can't make
// any assumptions about how field values with the same field
// name but different arguments might be interrelated, so it
// must err on the side of invalidating all field values that
// share the same short fieldName, regardless of arguments.
var fieldName = fieldNameFromStoreName(storeFieldName);
if (fieldName !== storeFieldName &&
!_this.policies.hasKeyArgs(merged.__typename, fieldName)) {
fieldsToDirty_1[fieldName] = 1;
}
// If merged[storeFieldName] has become undefined, and this is the
// Root layer, actually delete the property from the merged object,
// which is guaranteed to have been created fresh in this method.
if (merged[storeFieldName] === void 0 && !(_this instanceof Layer)) {
delete merged[storeFieldName];
}
}
});
if (fieldsToDirty_1.__typename &&
!(existing && existing.__typename) &&
// Since we return default root __typename strings
// automatically from store.get, we don't need to dirty the
// ROOT_QUERY.__typename field if merged.__typename is equal
// to the default string (usually "Query").
this.policies.rootTypenamesById[dataId] === merged.__typename) {
delete fieldsToDirty_1.__typename;
}
Object.keys(fieldsToDirty_1).forEach(function (fieldName) {
return _this.group.dirty(dataId, fieldName);
});
}
}
};
EntityStore.prototype.modify = function (dataId, fields) {
var _this = this;
var storeObject = this.lookup(dataId);
if (storeObject) {
var changedFields_1 = Object.create(null);
var needToMerge_1 = false;
var allDeleted_1 = true;
var sharedDetails_1 = {
DELETE: DELETE,
INVALIDATE: INVALIDATE,
isReference: isReference,
toReference: this.toReference,
canRead: this.canRead,
readField: function (fieldNameOrOptions, from) {
return _this.policies.readField(typeof fieldNameOrOptions === "string" ?
{
fieldName: fieldNameOrOptions,
from: from || makeReference(dataId),
}
: fieldNameOrOptions, { store: _this });
},
};
Object.keys(storeObject).forEach(function (storeFieldName) {
var fieldName = fieldNameFromStoreName(storeFieldName);
var fieldValue = storeObject[storeFieldName];
if (fieldValue === void 0)
return;
var modify = typeof fields === "function" ? fields : (fields[storeFieldName] || fields[fieldName]);
if (modify) {
var newValue = modify === delModifier ? DELETE : (modify(maybeDeepFreeze(fieldValue), __assign(__assign({}, sharedDetails_1), { fieldName: fieldName, storeFieldName: storeFieldName, storage: _this.getStorage(dataId, storeFieldName) })));
if (newValue === INVALIDATE) {
_this.group.dirty(dataId, storeFieldName);
}
else {
if (newValue === DELETE)
newValue = void 0;
if (newValue !== fieldValue) {
changedFields_1[storeFieldName] = newValue;
needToMerge_1 = true;
fieldValue = newValue;
if (globalThis.__DEV__ !== false) {
var checkReference = function (ref) {
if (_this.lookup(ref.__ref) === undefined) {
globalThis.__DEV__ !== false && invariant.warn(2, ref);
return true;
}
};
if (isReference(newValue)) {
checkReference(newValue);
}
else if (Array.isArray(newValue)) {
// Warn about writing "mixed" arrays of Reference and non-Reference objects
var seenReference = false;
var someNonReference = void 0;
for (var _i = 0, newValue_1 = newValue; _i < newValue_1.length; _i++) {
var value = newValue_1[_i];
if (isReference(value)) {
seenReference = true;
if (checkReference(value))
break;
}
else {
// Do not warn on primitive values, since those could never be represented
// by a reference. This is a valid (albeit uncommon) use case.
if (typeof value === "object" && !!value) {
var id = _this.policies.identify(value)[0];
// check if object could even be referenced, otherwise we are not interested in it for this warning
if (id) {
someNonReference = value;
}
}
}
if (seenReference && someNonReference !== undefined) {
globalThis.__DEV__ !== false && invariant.warn(3, someNonReference);
break;
}
}
}
}
}
}
}
if (fieldValue !== void 0) {
allDeleted_1 = false;
}
});
if (needToMerge_1) {
this.merge(dataId, changedFields_1);
if (allDeleted_1) {
if (this instanceof Layer) {
this.data[dataId] = void 0;
}
else {
delete this.data[dataId];
}
this.group.dirty(dataId, "__exists");
}
return true;
}
}
return false;
};
// If called with only one argument, removes the entire entity
// identified by dataId. If called with a fieldName as well, removes all
// fields of that entity whose names match fieldName according to the
// fieldNameFromStoreName helper function. If called with a fieldName
// and variables, removes all fields of that entity whose names match fieldName
// and whose arguments when cached exactly match the variables passed.
EntityStore.prototype.delete = function (dataId, fieldName, args) {
var _a;
var storeObject = this.lookup(dataId);
if (storeObject) {
var typename = this.getFieldValue(storeObject, "__typename");
var storeFieldName = fieldName && args ?
this.policies.getStoreFieldName({ typename: typename, fieldName: fieldName, args: args })
: fieldName;
return this.modify(dataId, storeFieldName ? (_a = {},
_a[storeFieldName] = delModifier,
_a) : delModifier);
}
return false;
};
EntityStore.prototype.evict = function (options, limit) {
var evicted = false;
if (options.id) {
if (hasOwn.call(this.data, options.id)) {
evicted = this.delete(options.id, options.fieldName, options.args);
}
if (this instanceof Layer && this !== limit) {
evicted = this.parent.evict(options, limit) || evicted;
}
// Always invalidate the field to trigger rereading of watched
// queries, even if no cache data was modified by the eviction,
// because queries may depend on computed fields with custom read
// functions, whose values are not stored in the EntityStore.
if (options.fieldName || evicted) {
this.group.dirty(options.id, options.fieldName || "__exists");
}
}
return evicted;
};
EntityStore.prototype.clear = function () {
this.replace(null);
};
EntityStore.prototype.extract = function () {
var _this = this;
var obj = this.toObject();
var extraRootIds = [];
this.getRootIdSet().forEach(function (id) {
if (!hasOwn.call(_this.policies.rootTypenamesById, id)) {
extraRootIds.push(id);
}
});
if (extraRootIds.length) {
obj.__META = { extraRootIds: extraRootIds.sort() };
}
return obj;
};
EntityStore.prototype.replace = function (newData) {
var _this = this;
Object.keys(this.data).forEach(function (dataId) {
if (!(newData && hasOwn.call(newData, dataId))) {
_this.delete(dataId);
}
});
if (newData) {
var __META = newData.__META, rest_1 = __rest(newData, ["__META"]);
Object.keys(rest_1).forEach(function (dataId) {
_this.merge(dataId, rest_1[dataId]);
});
if (__META) {
__META.extraRootIds.forEach(this.retain, this);
}
}
};
EntityStore.prototype.retain = function (rootId) {
return (this.rootIds[rootId] = (this.rootIds[rootId] || 0) + 1);
};
EntityStore.prototype.release = function (rootId) {
if (this.rootIds[rootId] > 0) {
var count = --this.rootIds[rootId];
if (!count)
delete this.rootIds[rootId];
return count;
}
return 0;
};
// Return a Set<string> of all the ID strings that have been retained by
// this layer/root *and* any layers/roots beneath it.
EntityStore.prototype.getRootIdSet = function (ids) {
if (ids === void 0) { ids = new Set(); }
Object.keys(this.rootIds).forEach(ids.add, ids);
if (this instanceof Layer) {
this.parent.getRootIdSet(ids);
}
else {
// Official singleton IDs like ROOT_QUERY and ROOT_MUTATION are
// always considered roots for garbage collection, regardless of
// their retainment counts in this.rootIds.
Object.keys(this.policies.rootTypenamesById).forEach(ids.add, ids);
}
return ids;
};
// The goal of garbage collection is to remove IDs from the Root layer of the
// store that are no longer reachable starting from any IDs that have been
// explicitly retained (see retain and release, above). Returns an array of
// dataId strings that were removed from the store.
EntityStore.prototype.gc = function () {
var _this = this;
var ids = this.getRootIdSet();
var snapshot = this.toObject();
ids.forEach(function (id) {
if (hasOwn.call(snapshot, id)) {
// Because we are iterating over an ECMAScript Set, the IDs we add here
// will be visited in later iterations of the forEach loop only if they
// were not previously contained by the Set.
Object.keys(_this.findChildRefIds(id)).forEach(ids.add, ids);
// By removing IDs from the snapshot object here, we protect them from
// getting removed from the root store layer below.
delete snapshot[id];
}
});
var idsToRemove = Object.keys(snapshot);
if (idsToRemove.length) {
var root_1 = this;
while (root_1 instanceof Layer)
root_1 = root_1.parent;
idsToRemove.forEach(function (id) { return root_1.delete(id); });
}
return idsToRemove;
};
EntityStore.prototype.findChildRefIds = function (dataId) {
if (!hasOwn.call(this.refs, dataId)) {
var found_1 = (this.refs[dataId] = Object.create(null));
var root = this.data[dataId];
if (!root)
return found_1;
var workSet_1 = new Set([root]);
// Within the store, only arrays and objects can contain child entity
// references, so we can prune the traversal using this predicate:
workSet_1.forEach(function (obj) {
if (isReference(obj)) {
found_1[obj.__ref] = true;
// In rare cases, a { __ref } Reference object may have other fields.
// This often indicates a mismerging of References with StoreObjects,
// but garbage collection should not be fooled by a stray __ref
// property in a StoreObject (ignoring all the other fields just
// because the StoreObject looks like a Reference). To avoid this
// premature termination of findChildRefIds recursion, we fall through
// to the code below, which will handle any other properties of obj.
}
if (isNonNullObject(obj)) {
Object.keys(obj).forEach(function (key) {
var child = obj[key];
// No need to add primitive values to the workSet, since they cannot
// contain reference objects.
if (isNonNullObject(child)) {
workSet_1.add(child);
}
});
}
});
}
return this.refs[dataId];
};
EntityStore.prototype.makeCacheKey = function () {
return this.group.keyMaker.lookupArray(arguments);
};
return EntityStore;
}());
export { EntityStore };
// A single CacheGroup represents a set of one or more EntityStore objects,
// typically the Root store in a CacheGroup by itself, and all active Layer
// stores in a group together. A single EntityStore object belongs to only
// one CacheGroup, store.group. The CacheGroup is responsible for tracking
// dependencies, so store.group is helpful for generating unique keys for
// cached results that need to be invalidated when/if those dependencies
// change. If we used the EntityStore objects themselves as cache keys (that
// is, store rather than store.group), the cache would become unnecessarily
// fragmented by all the different Layer objects. Instead, the CacheGroup
// approach allows all optimistic Layer objects in the same linked list to
// belong to one CacheGroup, with the non-optimistic Root object belonging
// to another CacheGroup, allowing resultCaching dependencies to be tracked
// separately for optimistic and non-optimistic entity data.
var CacheGroup = /** @class */ (function () {
function CacheGroup(caching, parent) {
if (parent === void 0) { parent = null; }
this.caching = caching;
this.parent = parent;
this.d = null;
this.resetCaching();
}
CacheGroup.prototype.resetCaching = function () {
this.d = this.caching ? dep() : null;
this.keyMaker = new Trie(canUseWeakMap);
};
CacheGroup.prototype.depend = function (dataId, storeFieldName) {
if (this.d) {
this.d(makeDepKey(dataId, storeFieldName));
var fieldName = fieldNameFromStoreName(storeFieldName);
if (fieldName !== storeFieldName) {
// Fields with arguments that contribute extra identifying
// information to the fieldName (thus forming the storeFieldName)
// depend not only on the full storeFieldName but also on the
// short fieldName, so the field can be invalidated using either
// level of specificity.
this.d(makeDepKey(dataId, fieldName));
}
if (this.parent) {
this.parent.depend(dataId, storeFieldName);
}
}
};
CacheGroup.prototype.dirty = function (dataId, storeFieldName) {
if (this.d) {
this.d.dirty(makeDepKey(dataId, storeFieldName),
// When storeFieldName === "__exists", that means the entity identified
// by dataId has either disappeared from the cache or was newly added,
// so the result caching system would do well to "forget everything it
// knows" about that object. To achieve that kind of invalidation, we
// not only dirty the associated result cache entry, but also remove it
// completely from the dependency graph. For the optimism implementation
// details, see https://github.com/benjamn/optimism/pull/195.
storeFieldName === "__exists" ? "forget" : "setDirty");
}
};
return CacheGroup;
}());
function makeDepKey(dataId, storeFieldName) {
// Since field names cannot have '#' characters in them, this method
// of joining the field name and the ID should be unambiguous, and much
// cheaper than JSON.stringify([dataId, fieldName]).
return storeFieldName + "#" + dataId;
}
export function maybeDependOnExistenceOfEntity(store, entityId) {
if (supportsResultCaching(store)) {
// We use this pseudo-field __exists elsewhere in the EntityStore code to
// represent changes in the existence of the entity object identified by
// entityId. This dependency gets reliably dirtied whenever an object with
// this ID is deleted (or newly created) within this group, so any result
// cache entries (for example, StoreReader#executeSelectionSet results) that
// depend on __exists for this entityId will get dirtied as well, leading to
// the eventual recomputation (instead of reuse) of those result objects the
// next time someone reads them from the cache.
store.group.depend(entityId, "__exists");
}
}
(function (EntityStore) {
// Refer to this class as EntityStore.Root outside this namespace.
var Root = /** @class */ (function (_super) {
__extends(Root, _super);
function Root(_a) {
var policies = _a.policies, _b = _a.resultCaching, resultCaching = _b === void 0 ? true : _b, seed = _a.seed;
var _this = _super.call(this, policies, new CacheGroup(resultCaching)) || this;
_this.stump = new Stump(_this);
_this.storageTrie = new Trie(canUseWeakMap);
if (seed)
_this.replace(seed);
return _this;
}
Root.prototype.addLayer = function (layerId, replay) {
// Adding an optimistic Layer on top of the Root actually adds the Layer
// on top of the Stump, so the Stump always comes between the Root and
// any Layer objects that we've added.
return this.stump.addLayer(layerId, replay);
};
Root.prototype.removeLayer = function () {
// Never remove the root layer.
return this;
};
Root.prototype.getStorage = function () {
return this.storageTrie.lookupArray(arguments);
};
return Root;
}(EntityStore));
EntityStore.Root = Root;
})(EntityStore || (EntityStore = {}));
// Not exported, since all Layer instances are created by the addLayer method
// of the EntityStore.Root class.
var Layer = /** @class */ (function (_super) {
__extends(Layer, _super);
function Layer(id, parent, replay, group) {
var _this = _super.call(this, parent.policies, group) || this;
_this.id = id;
_this.parent = parent;
_this.replay = replay;
_this.group = group;
replay(_this);
return _this;
}
Layer.prototype.addLayer = function (layerId, replay) {
return new Layer(layerId, this, replay, this.group);
};
Layer.prototype.removeLayer = function (layerId) {
var _this = this;
// Remove all instances of the given id, not just the first one.
var parent = this.parent.removeLayer(layerId);
if (layerId === this.id) {
if (this.group.caching) {
// Dirty every ID we're removing. Technically we might be able to avoid
// dirtying fields that have values in higher layers, but we don't have
// easy access to higher layers here, and we're about to recreate those
// layers anyway (see parent.addLayer below).
Object.keys(this.data).forEach(function (dataId) {
var ownStoreObject = _this.data[dataId];
var parentStoreObject = parent["lookup"](dataId);
if (!parentStoreObject) {
// The StoreObject identified by dataId was defined in this layer
// but will be undefined in the parent layer, so we can delete the
// whole entity using this.delete(dataId). Since we're about to
// throw this layer away, the only goal of this deletion is to dirty
// the removed fields.
_this.delete(dataId);
}
else if (!ownStoreObject) {
// This layer had an entry for dataId but it was undefined, which
// means the entity was deleted in this layer, and it's about to
// become undeleted when we remove this layer, so we need to dirty
// all fields that are about to be reexposed.
_this.group.dirty(dataId, "__exists");
Object.keys(parentStoreObject).forEach(function (storeFieldName) {
_this.group.dirty(dataId, storeFieldName);
});
}
else if (ownStoreObject !== parentStoreObject) {
// If ownStoreObject is not exactly the same as parentStoreObject,
// dirty any fields whose values will change as a result of this
// removal.
Object.keys(ownStoreObject).forEach(function (storeFieldName) {
if (!equal(ownStoreObject[storeFieldName], parentStoreObject[storeFieldName])) {
_this.group.dirty(dataId, storeFieldName);
}
});
}
});
}
return parent;
}
// No changes are necessary if the parent chain remains identical.
if (parent === this.parent)
return this;
// Recreate this layer on top of the new parent.
return parent.addLayer(this.id, this.replay);
};
Layer.prototype.toObject = function () {
return __assign(__assign({}, this.parent.toObject()), this.data);
};
Layer.prototype.findChildRefIds = function (dataId) {
var fromParent = this.parent.findChildRefIds(dataId);
return hasOwn.call(this.data, dataId) ? __assign(__assign({}, fromParent), _super.prototype.findChildRefIds.call(this, dataId)) : fromParent;
};
Layer.prototype.getStorage = function () {
var p = this.parent;
while (p.parent)
p = p.parent;
return p.getStorage.apply(p,
// @ts-expect-error
arguments);
};
return Layer;
}(EntityStore));
// Represents a Layer permanently installed just above the Root, which allows
// reading optimistically (and registering optimistic dependencies) even when
// no optimistic layers are currently active. The stump.group CacheGroup object
// is shared by any/all Layer objects added on top of the Stump.
var Stump = /** @class */ (function (_super) {
__extends(Stump, _super);
function Stump(root) {
return _super.call(this, "EntityStore.Stump", root, function () { }, new CacheGroup(root.group.caching, root.group)) || this;
}
Stump.prototype.removeLayer = function () {
// Never remove the Stump layer.
return this;
};
Stump.prototype.merge = function (older, newer) {
// We never want to write any data into the Stump, so we forward any merge
// calls to the Root instead. Another option here would be to throw an
// exception, but the toReference(object, true) function can sometimes
// trigger Stump writes (which used to be Root writes, before the Stump
// concept was introduced).
return this.parent.merge(older, newer);
};
return Stump;
}(Layer));
function storeObjectReconciler(existingObject, incomingObject, property) {
var existingValue = existingObject[property];
var incomingValue = incomingObject[property];
// Wherever there is a key collision, prefer the incoming value, unless
// it is deeply equal to the existing value. It's worth checking deep
// equality here (even though blindly returning incoming would be
// logically correct) because preserving the referential identity of
// existing data can prevent needless rereading and rerendering.
return equal(existingValue, incomingValue) ? existingValue : incomingValue;
}
export function supportsResultCaching(store) {
// When result caching is disabled, store.depend will be null.
return !!(store instanceof EntityStore && store.group.caching);
}
//# sourceMappingURL=entityStore.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/inmemory/object-canon.js
import { __assign } from "tslib";
import { Trie } from "@wry/trie";
import { canUseWeakMap, canUseWeakSet, isNonNullObject as isObjectOrArray, } from "../../utilities/index.js";
import { isArray } from "./helpers.js";
function shallowCopy(value) {
if (isObjectOrArray(value)) {
return isArray(value) ?
value.slice(0)
: __assign({ __proto__: Object.getPrototypeOf(value) }, value);
}
return value;
}
// When programmers talk about the "canonical form" of an object, they
// usually have the following meaning in mind, which I've copied from
// https://en.wiktionary.org/wiki/canonical_form:
//
// 1. A standard or normal presentation of a mathematical entity [or
// object]. A canonical form is an element of a set of representatives
// of equivalence classes of forms such that there is a function or
// procedure which projects every element of each equivalence class
// onto that one element, the canonical form of that equivalence
// class. The canonical form is expected to be simpler than the rest of
// the forms in some way.
//
// That's a long-winded way of saying any two objects that have the same
// canonical form may be considered equivalent, even if they are !==,
// which usually means the objects are structurally equivalent (deeply
// equal), but don't necessarily use the same memory.
//
// Like a literary or musical canon, this ObjectCanon class represents a
// collection of unique canonical items (JavaScript objects), with the
// important property that canon.admit(a) === canon.admit(b) if a and b
// are deeply equal to each other. In terms of the definition above, the
// canon.admit method is the "function or procedure which projects every"
// object "onto that one element, the canonical form."
//
// In the worst case, the canonicalization process may involve looking at
// every property in the provided object tree, so it takes the same order
// of time as deep equality checking. Fortunately, already-canonicalized
// objects are returned immediately from canon.admit, so the presence of
// canonical subtrees tends to speed up canonicalization.
//
// Since consumers of canonical objects can check for deep equality in
// constant time, canonicalizing cache results can massively improve the
// performance of application code that skips re-rendering unchanged
// results, such as "pure" UI components in a framework like React.
//
// Of course, since canonical objects may be shared widely between
// unrelated consumers, it's important to think of them as immutable, even
// though they are not actually frozen with Object.freeze in production,
// due to the extra performance overhead that comes with frozen objects.
//
// Custom scalar objects whose internal class name is neither Array nor
// Object can be included safely in the admitted tree, but they will not
// be replaced with a canonical version (to put it another way, they are
// assumed to be canonical already).
//
// If we ignore custom objects, no detection of cycles or repeated object
// references is currently required by the StoreReader class, since
// GraphQL result objects are JSON-serializable trees (and thus contain
// neither cycles nor repeated subtrees), so we can avoid the complexity
// of keeping track of objects we've already seen during the recursion of
// the admit method.
//
// In the future, we may consider adding additional cases to the switch
// statement to handle other common object types, such as "[object Date]"
// objects, as needed.
var ObjectCanon = /** @class */ (function () {
function ObjectCanon() {
// Set of all canonical objects this ObjectCanon has admitted, allowing
// canon.admit to return previously-canonicalized objects immediately.
this.known = new (canUseWeakSet ? WeakSet : Set)();
// Efficient storage/lookup structure for canonical objects.
this.pool = new Trie(canUseWeakMap);
// Make the ObjectCanon assume this value has already been
// canonicalized.
this.passes = new WeakMap();
// Arrays that contain the same elements in a different order can share
// the same SortedKeysInfo object, to save memory.
this.keysByJSON = new Map();
// This has to come last because it depends on keysByJSON.
this.empty = this.admit({});
}
ObjectCanon.prototype.isKnown = function (value) {
return isObjectOrArray(value) && this.known.has(value);
};
ObjectCanon.prototype.pass = function (value) {
if (isObjectOrArray(value)) {
var copy = shallowCopy(value);
this.passes.set(copy, value);
return copy;
}
return value;
};
ObjectCanon.prototype.admit = function (value) {
var _this = this;
if (isObjectOrArray(value)) {
var original = this.passes.get(value);
if (original)
return original;
var proto = Object.getPrototypeOf(value);
switch (proto) {
case Array.prototype: {
if (this.known.has(value))
return value;
var array = value.map(this.admit, this);
// Arrays are looked up in the Trie using their recursively
// canonicalized elements, and the known version of the array is
// preserved as node.array.
var node = this.pool.lookupArray(array);
if (!node.array) {
this.known.add((node.array = array));
// Since canonical arrays may be shared widely between
// unrelated consumers, it's important to regard them as
// immutable, even if they are not frozen in production.
if (globalThis.__DEV__ !== false) {
Object.freeze(array);
}
}
return node.array;
}
case null:
case Object.prototype: {
if (this.known.has(value))
return value;
var proto_1 = Object.getPrototypeOf(value);
var array_1 = [proto_1];
var keys = this.sortedKeys(value);
array_1.push(keys.json);
var firstValueIndex_1 = array_1.length;
keys.sorted.forEach(function (key) {
array_1.push(_this.admit(value[key]));
});
// Objects are looked up in the Trie by their prototype (which
// is *not* recursively canonicalized), followed by a JSON
// representation of their (sorted) keys, followed by the
// sequence of recursively canonicalized values corresponding to
// those keys. To keep the final results unambiguous with other
// sequences (such as arrays that just happen to contain [proto,
// keys.json, value1, value2, ...]), the known version of the
// object is stored as node.object.
var node = this.pool.lookupArray(array_1);
if (!node.object) {
var obj_1 = (node.object = Object.create(proto_1));
this.known.add(obj_1);
keys.sorted.forEach(function (key, i) {
obj_1[key] = array_1[firstValueIndex_1 + i];
});
// Since canonical objects may be shared widely between
// unrelated consumers, it's important to regard them as
// immutable, even if they are not frozen in production.
if (globalThis.__DEV__ !== false) {
Object.freeze(obj_1);
}
}
return node.object;
}
}
}
return value;
};
// It's worthwhile to cache the sorting of arrays of strings, since the
// same initial unsorted arrays tend to be encountered many times.
// Fortunately, we can reuse the Trie machinery to look up the sorted
// arrays in linear time (which is faster than sorting large arrays).
ObjectCanon.prototype.sortedKeys = function (obj) {
var keys = Object.keys(obj);
var node = this.pool.lookupArray(keys);
if (!node.keys) {
keys.sort();
var json = JSON.stringify(keys);
if (!(node.keys = this.keysByJSON.get(json))) {
this.keysByJSON.set(json, (node.keys = { sorted: keys, json: json }));
}
}
return node.keys;
};
return ObjectCanon;
}());
export { ObjectCanon };
//# sourceMappingURL=object-canon.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/inmemory/readFromStore.js
import { __assign } from "tslib";
import { invariant, newInvariantError } from "../../utilities/globals/index.js";
import { Kind } from "graphql";
import { wrap } from "optimism";
import { isField, resultKeyNameFromField, isReference, makeReference, shouldInclude, addTypenameToDocument, getDefaultValues, getMainDefinition, getQueryDefinition, getFragmentFromSelection, maybeDeepFreeze, mergeDeepArray, DeepMerger, isNonNullObject, canUseWeakMap, compact, canonicalStringify, cacheSizes, } from "../../utilities/index.js";
import { maybeDependOnExistenceOfEntity, supportsResultCaching, } from "./entityStore.js";
import { isArray, extractFragmentContext, getTypenameFromStoreObject, shouldCanonizeResults, } from "./helpers.js";
import { MissingFieldError } from "../core/types/common.js";
import { ObjectCanon } from "./object-canon.js";
function execSelectionSetKeyArgs(options) {
return [
options.selectionSet,
options.objectOrReference,
options.context,
// We split out this property so we can pass different values
// independently without modifying options.context itself.
options.context.canonizeResults,
];
}
var StoreReader = /** @class */ (function () {
function StoreReader(config) {
var _this = this;
this.knownResults = new (canUseWeakMap ? WeakMap : Map)();
this.config = compact(config, {
addTypename: config.addTypename !== false,
canonizeResults: shouldCanonizeResults(config),
});
this.canon = config.canon || new ObjectCanon();
// memoized functions in this class will be "garbage-collected"
// by recreating the whole `StoreReader` in
// `InMemoryCache.resetResultsCache`
// (triggered from `InMemoryCache.gc` with `resetResultCache: true`)
this.executeSelectionSet = wrap(function (options) {
var _a;
var canonizeResults = options.context.canonizeResults;
var peekArgs = execSelectionSetKeyArgs(options);
// Negate this boolean option so we can find out if we've already read
// this result using the other boolean value.
peekArgs[3] = !canonizeResults;
var other = (_a = _this.executeSelectionSet).peek.apply(_a, peekArgs);
if (other) {
if (canonizeResults) {
return __assign(__assign({}, other), {
// If we previously read this result without canonizing it, we can
// reuse that result simply by canonizing it now.
result: _this.canon.admit(other.result) });
}
// If we previously read this result with canonization enabled, we can
// return that canonized result as-is.
return other;
}
maybeDependOnExistenceOfEntity(options.context.store, options.enclosingRef.__ref);
// Finally, if we didn't find any useful previous results, run the real
// execSelectionSetImpl method with the given options.
return _this.execSelectionSetImpl(options);
}, {
max: this.config.resultCacheMaxSize ||
cacheSizes["inMemoryCache.executeSelectionSet"] ||
50000 /* defaultCacheSizes["inMemoryCache.executeSelectionSet"] */,
keyArgs: execSelectionSetKeyArgs,
// Note that the parameters of makeCacheKey are determined by the
// array returned by keyArgs.
makeCacheKey: function (selectionSet, parent, context, canonizeResults) {
if (supportsResultCaching(context.store)) {
return context.store.makeCacheKey(selectionSet, isReference(parent) ? parent.__ref : parent, context.varString, canonizeResults);
}
},
});
this.executeSubSelectedArray = wrap(function (options) {
maybeDependOnExistenceOfEntity(options.context.store, options.enclosingRef.__ref);
return _this.execSubSelectedArrayImpl(options);
}, {
max: this.config.resultCacheMaxSize ||
cacheSizes["inMemoryCache.executeSubSelectedArray"] ||
10000 /* defaultCacheSizes["inMemoryCache.executeSubSelectedArray"] */,
makeCacheKey: function (_a) {
var field = _a.field, array = _a.array, context = _a.context;
if (supportsResultCaching(context.store)) {
return context.store.makeCacheKey(field, array, context.varString);
}
},
});
}
StoreReader.prototype.resetCanon = function () {
this.canon = new ObjectCanon();
};
/**
* Given a store and a query, return as much of the result as possible and
* identify if any data was missing from the store.
*/
StoreReader.prototype.diffQueryAgainstStore = function (_a) {
var store = _a.store, query = _a.query, _b = _a.rootId, rootId = _b === void 0 ? "ROOT_QUERY" : _b, variables = _a.variables, _c = _a.returnPartialData, returnPartialData = _c === void 0 ? true : _c, _d = _a.canonizeResults, canonizeResults = _d === void 0 ? this.config.canonizeResults : _d;
var policies = this.config.cache.policies;
variables = __assign(__assign({}, getDefaultValues(getQueryDefinition(query))), variables);
var rootRef = makeReference(rootId);
var execResult = this.executeSelectionSet({
selectionSet: getMainDefinition(query).selectionSet,
objectOrReference: rootRef,
enclosingRef: rootRef,
context: __assign({ store: store, query: query, policies: policies, variables: variables, varString: canonicalStringify(variables), canonizeResults: canonizeResults }, extractFragmentContext(query, this.config.fragments)),
});
var missing;
if (execResult.missing) {
// For backwards compatibility we still report an array of
// MissingFieldError objects, even though there will only ever be at most
// one of them, now that all missing field error messages are grouped
// together in the execResult.missing tree.
missing = [
new MissingFieldError(firstMissing(execResult.missing), execResult.missing, query, variables),
];
if (!returnPartialData) {
throw missing[0];
}
}
return {
result: execResult.result,
complete: !missing,
missing: missing,
};
};
StoreReader.prototype.isFresh = function (result, parent, selectionSet, context) {
if (supportsResultCaching(context.store) &&
this.knownResults.get(result) === selectionSet) {
var latest = this.executeSelectionSet.peek(selectionSet, parent, context,
// If result is canonical, then it could only have been previously
// cached by the canonizing version of executeSelectionSet, so we can
// avoid checking both possibilities here.
this.canon.isKnown(result));
if (latest && result === latest.result) {
return true;
}
}
return false;
};
// Uncached version of executeSelectionSet.
StoreReader.prototype.execSelectionSetImpl = function (_a) {
var _this = this;
var selectionSet = _a.selectionSet, objectOrReference = _a.objectOrReference, enclosingRef = _a.enclosingRef, context = _a.context;
if (isReference(objectOrReference) &&
!context.policies.rootTypenamesById[objectOrReference.__ref] &&
!context.store.has(objectOrReference.__ref)) {
return {
result: this.canon.empty,
missing: "Dangling reference to missing ".concat(objectOrReference.__ref, " object"),
};
}
var variables = context.variables, policies = context.policies, store = context.store;
var typename = store.getFieldValue(objectOrReference, "__typename");
var objectsToMerge = [];
var missing;
var missingMerger = new DeepMerger();
if (this.config.addTypename &&
typeof typename === "string" &&
!policies.rootIdsByTypename[typename]) {
// Ensure we always include a default value for the __typename
// field, if we have one, and this.config.addTypename is true. Note
// that this field can be overridden by other merged objects.
objectsToMerge.push({ __typename: typename });
}
function handleMissing(result, resultName) {
var _a;
if (result.missing) {
missing = missingMerger.merge(missing, (_a = {},
_a[resultName] = result.missing,
_a));
}
return result.result;
}
var workSet = new Set(selectionSet.selections);
workSet.forEach(function (selection) {
var _a, _b;
// Omit fields with directives @skip(if: <truthy value>) or
// @include(if: <falsy value>).
if (!shouldInclude(selection, variables))
return;
if (isField(selection)) {
var fieldValue = policies.readField({
fieldName: selection.name.value,
field: selection,
variables: context.variables,
from: objectOrReference,
}, context);
var resultName = resultKeyNameFromField(selection);
if (fieldValue === void 0) {
if (!addTypenameToDocument.added(selection)) {
missing = missingMerger.merge(missing, (_a = {},
_a[resultName] = "Can't find field '".concat(selection.name.value, "' on ").concat(isReference(objectOrReference) ?
objectOrReference.__ref + " object"
: "object " + JSON.stringify(objectOrReference, null, 2)),
_a));
}
}
else if (isArray(fieldValue)) {
fieldValue = handleMissing(_this.executeSubSelectedArray({
field: selection,
array: fieldValue,
enclosingRef: enclosingRef,
context: context,
}), resultName);
}
else if (!selection.selectionSet) {
// If the field does not have a selection set, then we handle it
// as a scalar value. To keep this.canon from canonicalizing
// this value, we use this.canon.pass to wrap fieldValue in a
// Pass object that this.canon.admit will later unwrap as-is.
if (context.canonizeResults) {
fieldValue = _this.canon.pass(fieldValue);
}
}
else if (fieldValue != null) {
// In this case, because we know the field has a selection set,
// it must be trying to query a GraphQLObjectType, which is why
// fieldValue must be != null.
fieldValue = handleMissing(_this.executeSelectionSet({
selectionSet: selection.selectionSet,
objectOrReference: fieldValue,
enclosingRef: isReference(fieldValue) ? fieldValue : enclosingRef,
context: context,
}), resultName);
}
if (fieldValue !== void 0) {
objectsToMerge.push((_b = {}, _b[resultName] = fieldValue, _b));
}
}
else {
var fragment = getFragmentFromSelection(selection, context.lookupFragment);
if (!fragment && selection.kind === Kind.FRAGMENT_SPREAD) {
throw newInvariantError(9, selection.name.value);
}
if (fragment && policies.fragmentMatches(fragment, typename)) {
fragment.selectionSet.selections.forEach(workSet.add, workSet);
}
}
});
var result = mergeDeepArray(objectsToMerge);
var finalResult = { result: result, missing: missing };
var frozen = context.canonizeResults ?
this.canon.admit(finalResult)
// Since this.canon is normally responsible for freezing results (only in
// development), freeze them manually if canonization is disabled.
: maybeDeepFreeze(finalResult);
// Store this result with its selection set so that we can quickly
// recognize it again in the StoreReader#isFresh method.
if (frozen.result) {
this.knownResults.set(frozen.result, selectionSet);
}
return frozen;
};
// Uncached version of executeSubSelectedArray.
StoreReader.prototype.execSubSelectedArrayImpl = function (_a) {
var _this = this;
var field = _a.field, array = _a.array, enclosingRef = _a.enclosingRef, context = _a.context;
var missing;
var missingMerger = new DeepMerger();
function handleMissing(childResult, i) {
var _a;
if (childResult.missing) {
missing = missingMerger.merge(missing, (_a = {}, _a[i] = childResult.missing, _a));
}
return childResult.result;
}
if (field.selectionSet) {
array = array.filter(context.store.canRead);
}
array = array.map(function (item, i) {
// null value in array
if (item === null) {
return null;
}
// This is a nested array, recurse
if (isArray(item)) {
return handleMissing(_this.executeSubSelectedArray({
field: field,
array: item,
enclosingRef: enclosingRef,
context: context,
}), i);
}
// This is an object, run the selection set on it
if (field.selectionSet) {
return handleMissing(_this.executeSelectionSet({
selectionSet: field.selectionSet,
objectOrReference: item,
enclosingRef: isReference(item) ? item : enclosingRef,
context: context,
}), i);
}
if (globalThis.__DEV__ !== false) {
assertSelectionSetForIdValue(context.store, field, item);
}
return item;
});
return {
result: context.canonizeResults ? this.canon.admit(array) : array,
missing: missing,
};
};
return StoreReader;
}());
export { StoreReader };
function firstMissing(tree) {
try {
JSON.stringify(tree, function (_, value) {
if (typeof value === "string")
throw value;
return value;
});
}
catch (result) {
return result;
}
}
function assertSelectionSetForIdValue(store, field, fieldValue) {
if (!field.selectionSet) {
var workSet_1 = new Set([fieldValue]);
workSet_1.forEach(function (value) {
if (isNonNullObject(value)) {
invariant(
!isReference(value),
10,
getTypenameFromStoreObject(store, value),
field.name.value
);
Object.values(value).forEach(workSet_1.add, workSet_1);
}
});
}
}
//# sourceMappingURL=readFromStore.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/cloneDeep.js
var toString = Object.prototype.toString;
/**
* Deeply clones a value to create a new instance.
*/
export function cloneDeep(value) {
return cloneDeepHelper(value);
}
function cloneDeepHelper(val, seen) {
switch (toString.call(val)) {
case "[object Array]": {
seen = seen || new Map();
if (seen.has(val))
return seen.get(val);
var copy_1 = val.slice(0);
seen.set(val, copy_1);
copy_1.forEach(function (child, i) {
copy_1[i] = cloneDeepHelper(child, seen);
});
return copy_1;
}
case "[object Object]": {
seen = seen || new Map();
if (seen.has(val))
return seen.get(val);
// High fidelity polyfills of Object.create and Object.getPrototypeOf are
// possible in all JS environments, so we will assume they exist/work.
var copy_2 = Object.create(Object.getPrototypeOf(val));
seen.set(val, copy_2);
Object.keys(val).forEach(function (key) {
copy_2[key] = cloneDeepHelper(val[key], seen);
});
return copy_2;
}
default:
return val;
}
}
//# sourceMappingURL=cloneDeep.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/inmemory/reactiveVars.js
import { dep, Slot } from "optimism";
// Contextual Slot that acquires its value when custom read functions are
// called in Policies#readField.
export var cacheSlot = new Slot();
var cacheInfoMap = new WeakMap();
function getCacheInfo(cache) {
var info = cacheInfoMap.get(cache);
if (!info) {
cacheInfoMap.set(cache, (info = {
vars: new Set(),
dep: dep(),
}));
}
return info;
}
export function forgetCache(cache) {
getCacheInfo(cache).vars.forEach(function (rv) { return rv.forgetCache(cache); });
}
// Calling forgetCache(cache) serves to silence broadcasts and allows the
// cache to be garbage collected. However, the varsByCache WeakMap
// preserves the set of reactive variables that were previously associated
// with this cache, which makes it possible to "recall" the cache at a
// later time, by reattaching it to those variables. If the cache has been
// garbage collected in the meantime, because it is no longer reachable,
// you won't be able to call recallCache(cache), and the cache will
// automatically disappear from the varsByCache WeakMap.
export function recallCache(cache) {
getCacheInfo(cache).vars.forEach(function (rv) { return rv.attachCache(cache); });
}
export function makeVar(value) {
var caches = new Set();
var listeners = new Set();
var rv = function (newValue) {
if (arguments.length > 0) {
if (value !== newValue) {
value = newValue;
caches.forEach(function (cache) {
// Invalidate any fields with custom read functions that
// consumed this variable, so query results involving those
// fields will be recomputed the next time we read them.
getCacheInfo(cache).dep.dirty(rv);
// Broadcast changes to any caches that have previously read
// from this variable.
broadcast(cache);
});
// Finally, notify any listeners added via rv.onNextChange.
var oldListeners = Array.from(listeners);
listeners.clear();
oldListeners.forEach(function (listener) { return listener(value); });
}
}
else {
// When reading from the variable, obtain the current cache from
// context via cacheSlot. This isn't entirely foolproof, but it's
// the same system that powers varDep.
var cache = cacheSlot.getValue();
if (cache) {
attach(cache);
getCacheInfo(cache).dep(rv);
}
}
return value;
};
rv.onNextChange = function (listener) {
listeners.add(listener);
return function () {
listeners.delete(listener);
};
};
var attach = (rv.attachCache = function (cache) {
caches.add(cache);
getCacheInfo(cache).vars.add(rv);
return rv;
});
rv.forgetCache = function (cache) { return caches.delete(cache); };
return rv;
}
function broadcast(cache) {
if (cache.broadcastWatches) {
cache.broadcastWatches();
}
}
//# sourceMappingURL=reactiveVars.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/inmemory/key-extractor.js
import { invariant } from "../../utilities/globals/index.js";
import { argumentsObjectFromField, DeepMerger, isNonEmptyArray, isNonNullObject, } from "../../utilities/index.js";
import { hasOwn, isArray } from "./helpers.js";
// Mapping from JSON-encoded KeySpecifier strings to associated information.
var specifierInfoCache = Object.create(null);
function lookupSpecifierInfo(spec) {
// It's safe to encode KeySpecifier arrays with JSON.stringify, since they're
// just arrays of strings or nested KeySpecifier arrays, and the order of the
// array elements is important (and suitably preserved by JSON.stringify).
var cacheKey = JSON.stringify(spec);
return (specifierInfoCache[cacheKey] ||
(specifierInfoCache[cacheKey] = Object.create(null)));
}
export function keyFieldsFnFromSpecifier(specifier) {
var info = lookupSpecifierInfo(specifier);
return (info.keyFieldsFn || (info.keyFieldsFn = function (object, context) {
var extract = function (from, key) {
return context.readField(key, from);
};
var keyObject = (context.keyObject = collectSpecifierPaths(specifier, function (schemaKeyPath) {
var extracted = extractKeyPath(context.storeObject, schemaKeyPath,
// Using context.readField to extract paths from context.storeObject
// allows the extraction to see through Reference objects and respect
// custom read functions.
extract);
if (extracted === void 0 &&
object !== context.storeObject &&
hasOwn.call(object, schemaKeyPath[0])) {
// If context.storeObject fails to provide a value for the requested
// path, fall back to the raw result object, if it has a top-level key
// matching the first key in the path (schemaKeyPath[0]). This allows
// key fields included in the written data to be saved in the cache
// even if they are not selected explicitly in context.selectionSet.
// Not being mentioned by context.selectionSet is convenient here,
// since it means these extra fields cannot be affected by field
// aliasing, which is why we can use extractKey instead of
// context.readField for this extraction.
extracted = extractKeyPath(object, schemaKeyPath, extractKey);
}
invariant(extracted !== void 0, 4, schemaKeyPath.join("."), object);
return extracted;
}));
return "".concat(context.typename, ":").concat(JSON.stringify(keyObject));
}));
}
// The keyArgs extraction process is roughly analogous to keyFields extraction,
// but there are no aliases involved, missing fields are tolerated (by merely
// omitting them from the key), and drawing from field.directives or variables
// is allowed (in addition to drawing from the field's arguments object).
// Concretely, these differences mean passing a different key path extractor
// function to collectSpecifierPaths, reusing the shared extractKeyPath helper
// wherever possible.
export function keyArgsFnFromSpecifier(specifier) {
var info = lookupSpecifierInfo(specifier);
return (info.keyArgsFn ||
(info.keyArgsFn = function (args, _a) {
var field = _a.field, variables = _a.variables, fieldName = _a.fieldName;
var collected = collectSpecifierPaths(specifier, function (keyPath) {
var firstKey = keyPath[0];
var firstChar = firstKey.charAt(0);
if (firstChar === "@") {
if (field && isNonEmptyArray(field.directives)) {
var directiveName_1 = firstKey.slice(1);
// If the directive appears multiple times, only the first
// occurrence's arguments will be used. TODO Allow repetition?
// TODO Cache this work somehow, a la aliasMap?
var d = field.directives.find(function (d) { return d.name.value === directiveName_1; });
// Fortunately argumentsObjectFromField works for DirectiveNode!
var directiveArgs = d && argumentsObjectFromField(d, variables);
// For directives without arguments (d defined, but directiveArgs ===
// null), the presence or absence of the directive still counts as
// part of the field key, so we return null in those cases. If no
// directive with this name was found for this field (d undefined and
// thus directiveArgs undefined), we return undefined, which causes
// this value to be omitted from the key object returned by
// collectSpecifierPaths.
return (directiveArgs &&
extractKeyPath(directiveArgs,
// If keyPath.length === 1, this code calls extractKeyPath with an
// empty path, which works because it uses directiveArgs as the
// extracted value.
keyPath.slice(1)));
}
// If the key started with @ but there was no corresponding directive,
// we want to omit this value from the key object, not fall through to
// treating @whatever as a normal argument name.
return;
}
if (firstChar === "$") {
var variableName = firstKey.slice(1);
if (variables && hasOwn.call(variables, variableName)) {
var varKeyPath = keyPath.slice(0);
varKeyPath[0] = variableName;
return extractKeyPath(variables, varKeyPath);
}
// If the key started with $ but there was no corresponding variable, we
// want to omit this value from the key object, not fall through to
// treating $whatever as a normal argument name.
return;
}
if (args) {
return extractKeyPath(args, keyPath);
}
});
var suffix = JSON.stringify(collected);
// If no arguments were passed to this field, and it didn't have any other
// field key contributions from directives or variables, hide the empty
// :{} suffix from the field key. However, a field passed no arguments can
// still end up with a non-empty :{...} suffix if its key configuration
// refers to directives or variables.
if (args || suffix !== "{}") {
fieldName += ":" + suffix;
}
return fieldName;
}));
}
export function collectSpecifierPaths(specifier, extractor) {
// For each path specified by specifier, invoke the extractor, and repeatedly
// merge the results together, with appropriate ancestor context.
var merger = new DeepMerger();
return getSpecifierPaths(specifier).reduce(function (collected, path) {
var _a;
var toMerge = extractor(path);
if (toMerge !== void 0) {
// This path is not expected to contain array indexes, so the toMerge
// reconstruction will not contain arrays. TODO Fix this?
for (var i = path.length - 1; i >= 0; --i) {
toMerge = (_a = {}, _a[path[i]] = toMerge, _a);
}
collected = merger.merge(collected, toMerge);
}
return collected;
}, Object.create(null));
}
export function getSpecifierPaths(spec) {
var info = lookupSpecifierInfo(spec);
if (!info.paths) {
var paths_1 = (info.paths = []);
var currentPath_1 = [];
spec.forEach(function (s, i) {
if (isArray(s)) {
getSpecifierPaths(s).forEach(function (p) { return paths_1.push(currentPath_1.concat(p)); });
currentPath_1.length = 0;
}
else {
currentPath_1.push(s);
if (!isArray(spec[i + 1])) {
paths_1.push(currentPath_1.slice(0));
currentPath_1.length = 0;
}
}
});
}
return info.paths;
}
function extractKey(object, key) {
return object[key];
}
export function extractKeyPath(object, path, extract) {
// For each key in path, extract the corresponding child property from obj,
// flattening arrays if encountered (uncommon for keyFields and keyArgs, but
// possible). The final result of path.reduce is normalized so unexpected leaf
// objects have their keys safely sorted. That final result is difficult to
// type as anything other than any. You're welcome to try to improve the
// return type, but keep in mind extractKeyPath is not a public function
// (exported only for testing), so the effort may not be worthwhile unless the
// limited set of actual callers (see above) pass arguments that TypeScript
// can statically type. If we know only that path is some array of strings
// (and not, say, a specific tuple of statically known strings), any (or
// possibly unknown) is the honest answer.
extract = extract || extractKey;
return normalize(path.reduce(function reducer(obj, key) {
return isArray(obj) ?
obj.map(function (child) { return reducer(child, key); })
: obj && extract(obj, key);
}, object));
}
function normalize(value) {
// Usually the extracted value will be a scalar value, since most primary
// key fields are scalar, but just in case we get an object or an array, we
// need to do some normalization of the order of (nested) keys.
if (isNonNullObject(value)) {
if (isArray(value)) {
return value.map(normalize);
}
return collectSpecifierPaths(Object.keys(value).sort(), function (path) {
return extractKeyPath(value, path);
});
}
return value;
}
//# sourceMappingURL=key-extractor.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/inmemory/policies.js
import { __assign, __rest } from "tslib";
import { invariant, newInvariantError } from "../../utilities/globals/index.js";
import { storeKeyNameFromField, argumentsObjectFromField, isReference, getStoreKeyName, isNonNullObject, stringifyForDisplay, } from "../../utilities/index.js";
import { hasOwn, fieldNameFromStoreName, storeValueIsStoreObject, selectionSetMatchesResult, TypeOrFieldNameRegExp, defaultDataIdFromObject, isArray, } from "./helpers.js";
import { cacheSlot } from "./reactiveVars.js";
import { keyArgsFnFromSpecifier, keyFieldsFnFromSpecifier, } from "./key-extractor.js";
function argsFromFieldSpecifier(spec) {
return (spec.args !== void 0 ? spec.args
: spec.field ? argumentsObjectFromField(spec.field, spec.variables)
: null);
}
var nullKeyFieldsFn = function () { return void 0; };
var simpleKeyArgsFn = function (_args, context) { return context.fieldName; };
// These merge functions can be selected by specifying merge:true or
// merge:false in a field policy.
var mergeTrueFn = function (existing, incoming, _a) {
var mergeObjects = _a.mergeObjects;
return mergeObjects(existing, incoming);
};
var mergeFalseFn = function (_, incoming) { return incoming; };
var Policies = /** @class */ (function () {
function Policies(config) {
this.config = config;
this.typePolicies = Object.create(null);
this.toBeAdded = Object.create(null);
// Map from subtype names to sets of supertype names. Note that this
// representation inverts the structure of possibleTypes (whose keys are
// supertypes and whose values are arrays of subtypes) because it tends
// to be much more efficient to search upwards than downwards.
this.supertypeMap = new Map();
// Any fuzzy subtypes specified by possibleTypes will be converted to
// RegExp objects and recorded here. Every key of this map can also be
// found in supertypeMap. In many cases this Map will be empty, which
// means no fuzzy subtype checking will happen in fragmentMatches.
this.fuzzySubtypes = new Map();
this.rootIdsByTypename = Object.create(null);
this.rootTypenamesById = Object.create(null);
this.usingPossibleTypes = false;
this.config = __assign({ dataIdFromObject: defaultDataIdFromObject }, config);
this.cache = this.config.cache;
this.setRootTypename("Query");
this.setRootTypename("Mutation");
this.setRootTypename("Subscription");
if (config.possibleTypes) {
this.addPossibleTypes(config.possibleTypes);
}
if (config.typePolicies) {
this.addTypePolicies(config.typePolicies);
}
}
Policies.prototype.identify = function (object, partialContext) {
var _a;
var policies = this;
var typename = (partialContext &&
(partialContext.typename || ((_a = partialContext.storeObject) === null || _a === void 0 ? void 0 : _a.__typename))) ||
object.__typename;
// It should be possible to write root Query fields with writeFragment,
// using { __typename: "Query", ... } as the data, but it does not make
// sense to allow the same identification behavior for the Mutation and
// Subscription types, since application code should never be writing
// directly to (or reading directly from) those root objects.
if (typename === this.rootTypenamesById.ROOT_QUERY) {
return ["ROOT_QUERY"];
}
// Default context.storeObject to object if not otherwise provided.
var storeObject = (partialContext && partialContext.storeObject) || object;
var context = __assign(__assign({}, partialContext), { typename: typename, storeObject: storeObject, readField: (partialContext && partialContext.readField) ||
function () {
var options = normalizeReadFieldOptions(arguments, storeObject);
return policies.readField(options, {
store: policies.cache["data"],
variables: options.variables,
});
} });
var id;
var policy = typename && this.getTypePolicy(typename);
var keyFn = (policy && policy.keyFn) || this.config.dataIdFromObject;
while (keyFn) {
var specifierOrId = keyFn(__assign(__assign({}, object), storeObject), context);
if (isArray(specifierOrId)) {
keyFn = keyFieldsFnFromSpecifier(specifierOrId);
}
else {
id = specifierOrId;
break;
}
}
id = id ? String(id) : void 0;
return context.keyObject ? [id, context.keyObject] : [id];
};
Policies.prototype.addTypePolicies = function (typePolicies) {
var _this = this;
Object.keys(typePolicies).forEach(function (typename) {
var _a = typePolicies[typename], queryType = _a.queryType, mutationType = _a.mutationType, subscriptionType = _a.subscriptionType, incoming = __rest(_a, ["queryType", "mutationType", "subscriptionType"]);
// Though {query,mutation,subscription}Type configurations are rare,
// it's important to call setRootTypename as early as possible,
// since these configurations should apply consistently for the
// entire lifetime of the cache. Also, since only one __typename can
// qualify as one of these root types, these three properties cannot
// be inherited, unlike the rest of the incoming properties. That
// restriction is convenient, because the purpose of this.toBeAdded
// is to delay the processing of type/field policies until the first
// time they're used, allowing policies to be added in any order as
// long as all relevant policies (including policies for supertypes)
// have been added by the time a given policy is used for the first
// time. In other words, since inheritance doesn't matter for these
// properties, there's also no need to delay their processing using
// the this.toBeAdded queue.
if (queryType)
_this.setRootTypename("Query", typename);
if (mutationType)
_this.setRootTypename("Mutation", typename);
if (subscriptionType)
_this.setRootTypename("Subscription", typename);
if (hasOwn.call(_this.toBeAdded, typename)) {
_this.toBeAdded[typename].push(incoming);
}
else {
_this.toBeAdded[typename] = [incoming];
}
});
};
Policies.prototype.updateTypePolicy = function (typename, incoming) {
var _this = this;
var existing = this.getTypePolicy(typename);
var keyFields = incoming.keyFields, fields = incoming.fields;
function setMerge(existing, merge) {
existing.merge =
typeof merge === "function" ? merge
// Pass merge:true as a shorthand for a merge implementation
// that returns options.mergeObjects(existing, incoming).
: merge === true ? mergeTrueFn
// Pass merge:false to make incoming always replace existing
// without any warnings about data clobbering.
: merge === false ? mergeFalseFn
: existing.merge;
}
// Type policies can define merge functions, as an alternative to
// using field policies to merge child objects.
setMerge(existing, incoming.merge);
existing.keyFn =
// Pass false to disable normalization for this typename.
keyFields === false ? nullKeyFieldsFn
// Pass an array of strings to use those fields to compute a
// composite ID for objects of this typename.
: isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields)
// Pass a function to take full control over identification.
: typeof keyFields === "function" ? keyFields
// Leave existing.keyFn unchanged if above cases fail.
: existing.keyFn;
if (fields) {
Object.keys(fields).forEach(function (fieldName) {
var existing = _this.getFieldPolicy(typename, fieldName, true);
var incoming = fields[fieldName];
if (typeof incoming === "function") {
existing.read = incoming;
}
else {
var keyArgs = incoming.keyArgs, read = incoming.read, merge = incoming.merge;
existing.keyFn =
// Pass false to disable argument-based differentiation of
// field identities.
keyArgs === false ? simpleKeyArgsFn
// Pass an array of strings to use named arguments to
// compute a composite identity for the field.
: isArray(keyArgs) ? keyArgsFnFromSpecifier(keyArgs)
// Pass a function to take full control over field identity.
: typeof keyArgs === "function" ? keyArgs
// Leave existing.keyFn unchanged if above cases fail.
: existing.keyFn;
if (typeof read === "function") {
existing.read = read;
}
setMerge(existing, merge);
}
if (existing.read && existing.merge) {
// If we have both a read and a merge function, assume
// keyArgs:false, because read and merge together can take
// responsibility for interpreting arguments in and out. This
// default assumption can always be overridden by specifying
// keyArgs explicitly in the FieldPolicy.
existing.keyFn = existing.keyFn || simpleKeyArgsFn;
}
});
}
};
Policies.prototype.setRootTypename = function (which, typename) {
if (typename === void 0) { typename = which; }
var rootId = "ROOT_" + which.toUpperCase();
var old = this.rootTypenamesById[rootId];
if (typename !== old) {
invariant(!old || old === which, 5, which);
// First, delete any old __typename associated with this rootId from
// rootIdsByTypename.
if (old)
delete this.rootIdsByTypename[old];
// Now make this the only __typename that maps to this rootId.
this.rootIdsByTypename[typename] = rootId;
// Finally, update the __typename associated with this rootId.
this.rootTypenamesById[rootId] = typename;
}
};
Policies.prototype.addPossibleTypes = function (possibleTypes) {
var _this = this;
this.usingPossibleTypes = true;
Object.keys(possibleTypes).forEach(function (supertype) {
// Make sure all types have an entry in this.supertypeMap, even if
// their supertype set is empty, so we can return false immediately
// from policies.fragmentMatches for unknown supertypes.
_this.getSupertypeSet(supertype, true);
possibleTypes[supertype].forEach(function (subtype) {
_this.getSupertypeSet(subtype, true).add(supertype);
var match = subtype.match(TypeOrFieldNameRegExp);
if (!match || match[0] !== subtype) {
// TODO Don't interpret just any invalid typename as a RegExp.
_this.fuzzySubtypes.set(subtype, new RegExp(subtype));
}
});
});
};
Policies.prototype.getTypePolicy = function (typename) {
var _this = this;
if (!hasOwn.call(this.typePolicies, typename)) {
var policy_1 = (this.typePolicies[typename] = Object.create(null));
policy_1.fields = Object.create(null);
// When the TypePolicy for typename is first accessed, instead of
// starting with an empty policy object, inherit any properties or
// fields from the type policies of the supertypes of typename.
//
// Any properties or fields defined explicitly within the TypePolicy
// for typename will take precedence, and if there are multiple
// supertypes, the properties of policies whose types were added
// later via addPossibleTypes will take precedence over those of
// earlier supertypes. TODO Perhaps we should warn about these
// conflicts in development, and recommend defining the property
// explicitly in the subtype policy?
//
// Field policy inheritance is atomic/shallow: you can't inherit a
// field policy and then override just its read function, since read
// and merge functions often need to cooperate, so changing only one
// of them would be a recipe for inconsistency.
//
// Once the TypePolicy for typename has been accessed, its properties can
// still be updated directly using addTypePolicies, but future changes to
// inherited supertype policies will not be reflected in this subtype
// policy, because this code runs at most once per typename.
var supertypes_1 = this.supertypeMap.get(typename);
if (!supertypes_1 && this.fuzzySubtypes.size) {
// To make the inheritance logic work for unknown typename strings that
// may have fuzzy supertypes, we give this typename an empty supertype
// set and then populate it with any fuzzy supertypes that match.
supertypes_1 = this.getSupertypeSet(typename, true);
// This only works for typenames that are directly matched by a fuzzy
// supertype. What if there is an intermediate chain of supertypes?
// While possible, that situation can only be solved effectively by
// specifying the intermediate relationships via possibleTypes, manually
// and in a non-fuzzy way.
this.fuzzySubtypes.forEach(function (regExp, fuzzy) {
if (regExp.test(typename)) {
// The fuzzy parameter is just the original string version of regExp
// (not a valid __typename string), but we can look up the
// associated supertype(s) in this.supertypeMap.
var fuzzySupertypes = _this.supertypeMap.get(fuzzy);
if (fuzzySupertypes) {
fuzzySupertypes.forEach(function (supertype) {
return supertypes_1.add(supertype);
});
}
}
});
}
if (supertypes_1 && supertypes_1.size) {
supertypes_1.forEach(function (supertype) {
var _a = _this.getTypePolicy(supertype), fields = _a.fields, rest = __rest(_a, ["fields"]);
Object.assign(policy_1, rest);
Object.assign(policy_1.fields, fields);
});
}
}
var inbox = this.toBeAdded[typename];
if (inbox && inbox.length) {
// Merge the pending policies into this.typePolicies, in the order they
// were originally passed to addTypePolicy.
inbox.splice(0).forEach(function (policy) {
_this.updateTypePolicy(typename, policy);
});
}
return this.typePolicies[typename];
};
Policies.prototype.getFieldPolicy = function (typename, fieldName, createIfMissing) {
if (typename) {
var fieldPolicies = this.getTypePolicy(typename).fields;
return (fieldPolicies[fieldName] ||
(createIfMissing && (fieldPolicies[fieldName] = Object.create(null))));
}
};
Policies.prototype.getSupertypeSet = function (subtype, createIfMissing) {
var supertypeSet = this.supertypeMap.get(subtype);
if (!supertypeSet && createIfMissing) {
this.supertypeMap.set(subtype, (supertypeSet = new Set()));
}
return supertypeSet;
};
Policies.prototype.fragmentMatches = function (fragment, typename, result, variables) {
var _this = this;
if (!fragment.typeCondition)
return true;
// If the fragment has a type condition but the object we're matching
// against does not have a __typename, the fragment cannot match.
if (!typename)
return false;
var supertype = fragment.typeCondition.name.value;
// Common case: fragment type condition and __typename are the same.
if (typename === supertype)
return true;
if (this.usingPossibleTypes && this.supertypeMap.has(supertype)) {
var typenameSupertypeSet = this.getSupertypeSet(typename, true);
var workQueue_1 = [typenameSupertypeSet];
var maybeEnqueue_1 = function (subtype) {
var supertypeSet = _this.getSupertypeSet(subtype, false);
if (supertypeSet &&
supertypeSet.size &&
workQueue_1.indexOf(supertypeSet) < 0) {
workQueue_1.push(supertypeSet);
}
};
// We need to check fuzzy subtypes only if we encountered fuzzy
// subtype strings in addPossibleTypes, and only while writing to
// the cache, since that's when selectionSetMatchesResult gives a
// strong signal of fragment matching. The StoreReader class calls
// policies.fragmentMatches without passing a result object, so
// needToCheckFuzzySubtypes is always false while reading.
var needToCheckFuzzySubtypes = !!(result && this.fuzzySubtypes.size);
var checkingFuzzySubtypes = false;
// It's important to keep evaluating workQueue.length each time through
// the loop, because the queue can grow while we're iterating over it.
for (var i = 0; i < workQueue_1.length; ++i) {
var supertypeSet = workQueue_1[i];
if (supertypeSet.has(supertype)) {
if (!typenameSupertypeSet.has(supertype)) {
if (checkingFuzzySubtypes) {
globalThis.__DEV__ !== false && invariant.warn(6, typename, supertype);
}
// Record positive results for faster future lookup.
// Unfortunately, we cannot safely cache negative results,
// because new possibleTypes data could always be added to the
// Policies class.
typenameSupertypeSet.add(supertype);
}
return true;
}
supertypeSet.forEach(maybeEnqueue_1);
if (needToCheckFuzzySubtypes &&
// Start checking fuzzy subtypes only after exhausting all
// non-fuzzy subtypes (after the final iteration of the loop).
i === workQueue_1.length - 1 &&
// We could wait to compare fragment.selectionSet to result
// after we verify the supertype, but this check is often less
// expensive than that search, and we will have to do the
// comparison anyway whenever we find a potential match.
selectionSetMatchesResult(fragment.selectionSet, result, variables)) {
// We don't always need to check fuzzy subtypes (if no result
// was provided, or !this.fuzzySubtypes.size), but, when we do,
// we only want to check them once.
needToCheckFuzzySubtypes = false;
checkingFuzzySubtypes = true;
// If we find any fuzzy subtypes that match typename, extend the
// workQueue to search through the supertypes of those fuzzy
// subtypes. Otherwise the for-loop will terminate and we'll
// return false below.
this.fuzzySubtypes.forEach(function (regExp, fuzzyString) {
var match = typename.match(regExp);
if (match && match[0] === typename) {
maybeEnqueue_1(fuzzyString);
}
});
}
}
}
return false;
};
Policies.prototype.hasKeyArgs = function (typename, fieldName) {
var policy = this.getFieldPolicy(typename, fieldName, false);
return !!(policy && policy.keyFn);
};
Policies.prototype.getStoreFieldName = function (fieldSpec) {
var typename = fieldSpec.typename, fieldName = fieldSpec.fieldName;
var policy = this.getFieldPolicy(typename, fieldName, false);
var storeFieldName;
var keyFn = policy && policy.keyFn;
if (keyFn && typename) {
var context = {
typename: typename,
fieldName: fieldName,
field: fieldSpec.field || null,
variables: fieldSpec.variables,
};
var args = argsFromFieldSpecifier(fieldSpec);
while (keyFn) {
var specifierOrString = keyFn(args, context);
if (isArray(specifierOrString)) {
keyFn = keyArgsFnFromSpecifier(specifierOrString);
}
else {
// If the custom keyFn returns a falsy value, fall back to
// fieldName instead.
storeFieldName = specifierOrString || fieldName;
break;
}
}
}
if (storeFieldName === void 0) {
storeFieldName =
fieldSpec.field ?
storeKeyNameFromField(fieldSpec.field, fieldSpec.variables)
: getStoreKeyName(fieldName, argsFromFieldSpecifier(fieldSpec));
}
// Returning false from a keyArgs function is like configuring
// keyArgs: false, but more dynamic.
if (storeFieldName === false) {
return fieldName;
}
// Make sure custom field names start with the actual field.name.value
// of the field, so we can always figure out which properties of a
// StoreObject correspond to which original field names.
return fieldName === fieldNameFromStoreName(storeFieldName) ? storeFieldName
: fieldName + ":" + storeFieldName;
};
Policies.prototype.readField = function (options, context) {
var objectOrReference = options.from;
if (!objectOrReference)
return;
var nameOrField = options.field || options.fieldName;
if (!nameOrField)
return;
if (options.typename === void 0) {
var typename = context.store.getFieldValue(objectOrReference, "__typename");
if (typename)
options.typename = typename;
}
var storeFieldName = this.getStoreFieldName(options);
var fieldName = fieldNameFromStoreName(storeFieldName);
var existing = context.store.getFieldValue(objectOrReference, storeFieldName);
var policy = this.getFieldPolicy(options.typename, fieldName, false);
var read = policy && policy.read;
if (read) {
var readOptions = makeFieldFunctionOptions(this, objectOrReference, options, context, context.store.getStorage(isReference(objectOrReference) ?
objectOrReference.__ref
: objectOrReference, storeFieldName));
// Call read(existing, readOptions) with cacheSlot holding this.cache.
return cacheSlot.withValue(this.cache, read, [
existing,
readOptions,
]);
}
return existing;
};
Policies.prototype.getReadFunction = function (typename, fieldName) {
var policy = this.getFieldPolicy(typename, fieldName, false);
return policy && policy.read;
};
Policies.prototype.getMergeFunction = function (parentTypename, fieldName, childTypename) {
var policy = this.getFieldPolicy(parentTypename, fieldName, false);
var merge = policy && policy.merge;
if (!merge && childTypename) {
policy = this.getTypePolicy(childTypename);
merge = policy && policy.merge;
}
return merge;
};
Policies.prototype.runMergeFunction = function (existing, incoming, _a, context, storage) {
var field = _a.field, typename = _a.typename, merge = _a.merge;
if (merge === mergeTrueFn) {
// Instead of going to the trouble of creating a full
// FieldFunctionOptions object and calling mergeTrueFn, we can
// simply call mergeObjects, as mergeTrueFn would.
return makeMergeObjectsFunction(context.store)(existing, incoming);
}
if (merge === mergeFalseFn) {
// Likewise for mergeFalseFn, whose implementation is even simpler.
return incoming;
}
// If cache.writeQuery or cache.writeFragment was called with
// options.overwrite set to true, we still call merge functions, but
// the existing data is always undefined, so the merge function will
// not attempt to combine the incoming data with the existing data.
if (context.overwrite) {
existing = void 0;
}
return merge(existing, incoming, makeFieldFunctionOptions(this,
// Unlike options.readField for read functions, we do not fall
// back to the current object if no foreignObjOrRef is provided,
// because it's not clear what the current object should be for
// merge functions: the (possibly undefined) existing object, or
// the incoming object? If you think your merge function needs
// to read sibling fields in order to produce a new value for
// the current field, you might want to rethink your strategy,
// because that's a recipe for making merge behavior sensitive
// to the order in which fields are written into the cache.
// However, readField(name, ref) is useful for merge functions
// that need to deduplicate child objects and references.
void 0, {
typename: typename,
fieldName: field.name.value,
field: field,
variables: context.variables,
}, context, storage || Object.create(null)));
};
return Policies;
}());
export { Policies };
function makeFieldFunctionOptions(policies, objectOrReference, fieldSpec, context, storage) {
var storeFieldName = policies.getStoreFieldName(fieldSpec);
var fieldName = fieldNameFromStoreName(storeFieldName);
var variables = fieldSpec.variables || context.variables;
var _a = context.store, toReference = _a.toReference, canRead = _a.canRead;
return {
args: argsFromFieldSpecifier(fieldSpec),
field: fieldSpec.field || null,
fieldName: fieldName,
storeFieldName: storeFieldName,
variables: variables,
isReference: isReference,
toReference: toReference,
storage: storage,
cache: policies.cache,
canRead: canRead,
readField: function () {
return policies.readField(normalizeReadFieldOptions(arguments, objectOrReference, variables), context);
},
mergeObjects: makeMergeObjectsFunction(context.store),
};
}
export function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables) {
var fieldNameOrOptions = readFieldArgs[0], from = readFieldArgs[1], argc = readFieldArgs.length;
var options;
if (typeof fieldNameOrOptions === "string") {
options = {
fieldName: fieldNameOrOptions,
// Default to objectOrReference only when no second argument was
// passed for the from parameter, not when undefined is explicitly
// passed as the second argument.
from: argc > 1 ? from : objectOrReference,
};
}
else {
options = __assign({}, fieldNameOrOptions);
// Default to objectOrReference only when fieldNameOrOptions.from is
// actually omitted, rather than just undefined.
if (!hasOwn.call(options, "from")) {
options.from = objectOrReference;
}
}
if (globalThis.__DEV__ !== false && options.from === void 0) {
globalThis.__DEV__ !== false && invariant.warn(7, stringifyForDisplay(Array.from(readFieldArgs)));
}
if (void 0 === options.variables) {
options.variables = variables;
}
return options;
}
function makeMergeObjectsFunction(store) {
return function mergeObjects(existing, incoming) {
if (isArray(existing) || isArray(incoming)) {
throw newInvariantError(8);
}
// These dynamic checks are necessary because the parameters of a
// custom merge function can easily have the any type, so the type
// system cannot always enforce the StoreObject | Reference parameter
// types of options.mergeObjects.
if (isNonNullObject(existing) && isNonNullObject(incoming)) {
var eType = store.getFieldValue(existing, "__typename");
var iType = store.getFieldValue(incoming, "__typename");
var typesDiffer = eType && iType && eType !== iType;
if (typesDiffer) {
return incoming;
}
if (isReference(existing) && storeValueIsStoreObject(incoming)) {
// Update the normalized EntityStore for the entity identified by
// existing.__ref, preferring/overwriting any fields contributed by the
// newer incoming StoreObject.
store.merge(existing.__ref, incoming);
return existing;
}
if (storeValueIsStoreObject(existing) && isReference(incoming)) {
// Update the normalized EntityStore for the entity identified by
// incoming.__ref, taking fields from the older existing object only if
// those fields are not already present in the newer StoreObject
// identified by incoming.__ref.
store.merge(existing, incoming.__ref);
return incoming;
}
if (storeValueIsStoreObject(existing) &&
storeValueIsStoreObject(incoming)) {
return __assign(__assign({}, existing), incoming);
}
}
return incoming;
};
}
//# sourceMappingURL=policies.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/inmemory/writeToStore.js
import { __assign } from "tslib";
import { invariant, newInvariantError } from "../../utilities/globals/index.js";
import { equal } from "@wry/equality";
import { Trie } from "@wry/trie";
import { Kind } from "graphql";
import { getFragmentFromSelection, getDefaultValues, getOperationDefinition, getTypenameFromResult, makeReference, isField, resultKeyNameFromField, isReference, shouldInclude, cloneDeep, addTypenameToDocument, isNonEmptyArray, argumentsObjectFromField, canonicalStringify, } from "../../utilities/index.js";
import { isArray, makeProcessedFieldsMerger, fieldNameFromStoreName, storeValueIsStoreObject, extractFragmentContext, } from "./helpers.js";
import { normalizeReadFieldOptions } from "./policies.js";
// Since there are only four possible combinations of context.clientOnly and
// context.deferred values, we should need at most four "flavors" of any given
// WriteContext. To avoid creating multiple copies of the same context, we cache
// the contexts in the context.flavors Map (shared by all flavors) according to
// their clientOnly and deferred values (always in that order).
function getContextFlavor(context, clientOnly, deferred) {
var key = "".concat(clientOnly).concat(deferred);
var flavored = context.flavors.get(key);
if (!flavored) {
context.flavors.set(key, (flavored =
context.clientOnly === clientOnly && context.deferred === deferred ?
context
: __assign(__assign({}, context), { clientOnly: clientOnly, deferred: deferred })));
}
return flavored;
}
var StoreWriter = /** @class */ (function () {
function StoreWriter(cache, reader, fragments) {
this.cache = cache;
this.reader = reader;
this.fragments = fragments;
}
StoreWriter.prototype.writeToStore = function (store, _a) {
var _this = this;
var query = _a.query, result = _a.result, dataId = _a.dataId, variables = _a.variables, overwrite = _a.overwrite;
var operationDefinition = getOperationDefinition(query);
var merger = makeProcessedFieldsMerger();
variables = __assign(__assign({}, getDefaultValues(operationDefinition)), variables);
var context = __assign(__assign({ store: store, written: Object.create(null), merge: function (existing, incoming) {
return merger.merge(existing, incoming);
}, variables: variables, varString: canonicalStringify(variables) }, extractFragmentContext(query, this.fragments)), { overwrite: !!overwrite, incomingById: new Map(), clientOnly: false, deferred: false, flavors: new Map() });
var ref = this.processSelectionSet({
result: result || Object.create(null),
dataId: dataId,
selectionSet: operationDefinition.selectionSet,
mergeTree: { map: new Map() },
context: context,
});
if (!isReference(ref)) {
throw newInvariantError(11, result);
}
// So far, the store has not been modified, so now it's time to process
// context.incomingById and merge those incoming fields into context.store.
context.incomingById.forEach(function (_a, dataId) {
var storeObject = _a.storeObject, mergeTree = _a.mergeTree, fieldNodeSet = _a.fieldNodeSet;
var entityRef = makeReference(dataId);
if (mergeTree && mergeTree.map.size) {
var applied = _this.applyMerges(mergeTree, entityRef, storeObject, context);
if (isReference(applied)) {
// Assume References returned by applyMerges have already been merged
// into the store. See makeMergeObjectsFunction in policies.ts for an
// example of how this can happen.
return;
}
// Otherwise, applyMerges returned a StoreObject, whose fields we should
// merge into the store (see store.merge statement below).
storeObject = applied;
}
if (globalThis.__DEV__ !== false && !context.overwrite) {
var fieldsWithSelectionSets_1 = Object.create(null);
fieldNodeSet.forEach(function (field) {
if (field.selectionSet) {
fieldsWithSelectionSets_1[field.name.value] = true;
}
});
var hasSelectionSet_1 = function (storeFieldName) {
return fieldsWithSelectionSets_1[fieldNameFromStoreName(storeFieldName)] ===
true;
};
var hasMergeFunction_1 = function (storeFieldName) {
var childTree = mergeTree && mergeTree.map.get(storeFieldName);
return Boolean(childTree && childTree.info && childTree.info.merge);
};
Object.keys(storeObject).forEach(function (storeFieldName) {
// If a merge function was defined for this field, trust that it
// did the right thing about (not) clobbering data. If the field
// has no selection set, it's a scalar field, so it doesn't need
// a merge function (even if it's an object, like JSON data).
if (hasSelectionSet_1(storeFieldName) &&
!hasMergeFunction_1(storeFieldName)) {
warnAboutDataLoss(entityRef, storeObject, storeFieldName, context.store);
}
});
}
store.merge(dataId, storeObject);
});
// Any IDs written explicitly to the cache will be retained as
// reachable root IDs for garbage collection purposes. Although this
// logic includes root IDs like ROOT_QUERY and ROOT_MUTATION, their
// retainment counts are effectively ignored because cache.gc() always
// includes them in its root ID set.
store.retain(ref.__ref);
return ref;
};
StoreWriter.prototype.processSelectionSet = function (_a) {
var _this = this;
var dataId = _a.dataId, result = _a.result, selectionSet = _a.selectionSet, context = _a.context,
// This object allows processSelectionSet to report useful information
// to its callers without explicitly returning that information.
mergeTree = _a.mergeTree;
var policies = this.cache.policies;
// This variable will be repeatedly updated using context.merge to
// accumulate all fields that need to be written into the store.
var incoming = Object.create(null);
// If typename was not passed in, infer it. Note that typename is
// always passed in for tricky-to-infer cases such as "Query" for
// ROOT_QUERY.
var typename = (dataId && policies.rootTypenamesById[dataId]) ||
getTypenameFromResult(result, selectionSet, context.fragmentMap) ||
(dataId && context.store.get(dataId, "__typename"));
if ("string" === typeof typename) {
incoming.__typename = typename;
}
// This readField function will be passed as context.readField in the
// KeyFieldsContext object created within policies.identify (called below).
// In addition to reading from the existing context.store (thanks to the
// policies.readField(options, context) line at the very bottom), this
// version of readField can read from Reference objects that are currently
// pending in context.incomingById, which is important whenever keyFields
// need to be extracted from a child object that processSelectionSet has
// turned into a Reference.
var readField = function () {
var options = normalizeReadFieldOptions(arguments, incoming, context.variables);
if (isReference(options.from)) {
var info = context.incomingById.get(options.from.__ref);
if (info) {
var result_1 = policies.readField(__assign(__assign({}, options), { from: info.storeObject }), context);
if (result_1 !== void 0) {
return result_1;
}
}
}
return policies.readField(options, context);
};
var fieldNodeSet = new Set();
this.flattenFields(selectionSet, result,
// This WriteContext will be the default context value for fields returned
// by the flattenFields method, but some fields may be assigned a modified
// context, depending on the presence of @client and other directives.
context, typename).forEach(function (context, field) {
var _a;
var resultFieldKey = resultKeyNameFromField(field);
var value = result[resultFieldKey];
fieldNodeSet.add(field);
if (value !== void 0) {
var storeFieldName = policies.getStoreFieldName({
typename: typename,
fieldName: field.name.value,
field: field,
variables: context.variables,
});
var childTree = getChildMergeTree(mergeTree, storeFieldName);
var incomingValue = _this.processFieldValue(value, field,
// Reset context.clientOnly and context.deferred to their default
// values before processing nested selection sets.
field.selectionSet ?
getContextFlavor(context, false, false)
: context, childTree);
// To determine if this field holds a child object with a merge function
// defined in its type policy (see PR #7070), we need to figure out the
// child object's __typename.
var childTypename = void 0;
// The field's value can be an object that has a __typename only if the
// field has a selection set. Otherwise incomingValue is scalar.
if (field.selectionSet &&
(isReference(incomingValue) || storeValueIsStoreObject(incomingValue))) {
childTypename = readField("__typename", incomingValue);
}
var merge = policies.getMergeFunction(typename, field.name.value, childTypename);
if (merge) {
childTree.info = {
// TODO Check compatibility against any existing childTree.field?
field: field,
typename: typename,
merge: merge,
};
}
else {
maybeRecycleChildMergeTree(mergeTree, storeFieldName);
}
incoming = context.merge(incoming, (_a = {},
_a[storeFieldName] = incomingValue,
_a));
}
else if (globalThis.__DEV__ !== false &&
!context.clientOnly &&
!context.deferred &&
!addTypenameToDocument.added(field) &&
// If the field has a read function, it may be a synthetic field or
// provide a default value, so its absence from the written data should
// not be cause for alarm.
!policies.getReadFunction(typename, field.name.value)) {
globalThis.__DEV__ !== false && invariant.error(12, resultKeyNameFromField(field), result);
}
});
// Identify the result object, even if dataId was already provided,
// since we always need keyObject below.
try {
var _b = policies.identify(result, {
typename: typename,
selectionSet: selectionSet,
fragmentMap: context.fragmentMap,
storeObject: incoming,
readField: readField,
}), id = _b[0], keyObject = _b[1];
// If dataId was not provided, fall back to the id just generated by
// policies.identify.
dataId = dataId || id;
// Write any key fields that were used during identification, even if
// they were not mentioned in the original query.
if (keyObject) {
// TODO Reverse the order of the arguments?
incoming = context.merge(incoming, keyObject);
}
}
catch (e) {
// If dataId was provided, tolerate failure of policies.identify.
if (!dataId)
throw e;
}
if ("string" === typeof dataId) {
var dataRef = makeReference(dataId);
// Avoid processing the same entity object using the same selection
// set more than once. We use an array instead of a Set since most
// entity IDs will be written using only one selection set, so the
// size of this array is likely to be very small, meaning indexOf is
// likely to be faster than Set.prototype.has.
var sets = context.written[dataId] || (context.written[dataId] = []);
if (sets.indexOf(selectionSet) >= 0)
return dataRef;
sets.push(selectionSet);
// If we're about to write a result object into the store, but we
// happen to know that the exact same (===) result object would be
// returned if we were to reread the result with the same inputs,
// then we can skip the rest of the processSelectionSet work for
// this object, and immediately return a Reference to it.
if (this.reader &&
this.reader.isFresh(result, dataRef, selectionSet, context)) {
return dataRef;
}
var previous_1 = context.incomingById.get(dataId);
if (previous_1) {
previous_1.storeObject = context.merge(previous_1.storeObject, incoming);
previous_1.mergeTree = mergeMergeTrees(previous_1.mergeTree, mergeTree);
fieldNodeSet.forEach(function (field) { return previous_1.fieldNodeSet.add(field); });
}
else {
context.incomingById.set(dataId, {
storeObject: incoming,
// Save a reference to mergeTree only if it is not empty, because
// empty MergeTrees may be recycled by maybeRecycleChildMergeTree and
// reused for entirely different parts of the result tree.
mergeTree: mergeTreeIsEmpty(mergeTree) ? void 0 : mergeTree,
fieldNodeSet: fieldNodeSet,
});
}
return dataRef;
}
return incoming;
};
StoreWriter.prototype.processFieldValue = function (value, field, context, mergeTree) {
var _this = this;
if (!field.selectionSet || value === null) {
// In development, we need to clone scalar values so that they can be
// safely frozen with maybeDeepFreeze in readFromStore.ts. In production,
// it's cheaper to store the scalar values directly in the cache.
return globalThis.__DEV__ !== false ? cloneDeep(value) : value;
}
if (isArray(value)) {
return value.map(function (item, i) {
var value = _this.processFieldValue(item, field, context, getChildMergeTree(mergeTree, i));
maybeRecycleChildMergeTree(mergeTree, i);
return value;
});
}
return this.processSelectionSet({
result: value,
selectionSet: field.selectionSet,
context: context,
mergeTree: mergeTree,
});
};
// Implements https://spec.graphql.org/draft/#sec-Field-Collection, but with
// some additions for tracking @client and @defer directives.
StoreWriter.prototype.flattenFields = function (selectionSet, result, context, typename) {
if (typename === void 0) { typename = getTypenameFromResult(result, selectionSet, context.fragmentMap); }
var fieldMap = new Map();
var policies = this.cache.policies;
var limitingTrie = new Trie(false); // No need for WeakMap, since limitingTrie does not escape.
(function flatten(selectionSet, inheritedContext) {
var visitedNode = limitingTrie.lookup(selectionSet,
// Because we take inheritedClientOnly and inheritedDeferred into
// consideration here (in addition to selectionSet), it's possible for
// the same selection set to be flattened more than once, if it appears
// in the query with different @client and/or @directive configurations.
inheritedContext.clientOnly, inheritedContext.deferred);
if (visitedNode.visited)
return;
visitedNode.visited = true;
selectionSet.selections.forEach(function (selection) {
if (!shouldInclude(selection, context.variables))
return;
var clientOnly = inheritedContext.clientOnly, deferred = inheritedContext.deferred;
if (
// Since the presence of @client or @defer on this field can only
// cause clientOnly or deferred to become true, we can skip the
// forEach loop if both clientOnly and deferred are already true.
!(clientOnly && deferred) &&
isNonEmptyArray(selection.directives)) {
selection.directives.forEach(function (dir) {
var name = dir.name.value;
if (name === "client")
clientOnly = true;
if (name === "defer") {
var args = argumentsObjectFromField(dir, context.variables);
// The @defer directive takes an optional args.if boolean
// argument, similar to @include(if: boolean). Note that
// @defer(if: false) does not make context.deferred false, but
// instead behaves as if there was no @defer directive.
if (!args || args.if !== false) {
deferred = true;
}
// TODO In the future, we may want to record args.label using
// context.deferred, if a label is specified.
}
});
}
if (isField(selection)) {
var existing = fieldMap.get(selection);
if (existing) {
// If this field has been visited along another recursive path
// before, the final context should have clientOnly or deferred set
// to true only if *all* paths have the directive (hence the &&).
clientOnly = clientOnly && existing.clientOnly;
deferred = deferred && existing.deferred;
}
fieldMap.set(selection, getContextFlavor(context, clientOnly, deferred));
}
else {
var fragment = getFragmentFromSelection(selection, context.lookupFragment);
if (!fragment && selection.kind === Kind.FRAGMENT_SPREAD) {
throw newInvariantError(13, selection.name.value);
}
if (fragment &&
policies.fragmentMatches(fragment, typename, result, context.variables)) {
flatten(fragment.selectionSet, getContextFlavor(context, clientOnly, deferred));
}
}
});
})(selectionSet, context);
return fieldMap;
};
StoreWriter.prototype.applyMerges = function (mergeTree, existing, incoming, context, getStorageArgs) {
var _a;
var _this = this;
if (mergeTree.map.size && !isReference(incoming)) {
var e_1 =
// Items in the same position in different arrays are not
// necessarily related to each other, so when incoming is an array
// we process its elements as if there was no existing data.
(!isArray(incoming) &&
// Likewise, existing must be either a Reference or a StoreObject
// in order for its fields to be safe to merge with the fields of
// the incoming object.
(isReference(existing) || storeValueIsStoreObject(existing))) ?
existing
: void 0;
// This narrowing is implied by mergeTree.map.size > 0 and
// !isReference(incoming), though TypeScript understandably cannot
// hope to infer this type.
var i_1 = incoming;
// The options.storage objects provided to read and merge functions
// are derived from the identity of the parent object plus a
// sequence of storeFieldName strings/numbers identifying the nested
// field name path of each field value to be merged.
if (e_1 && !getStorageArgs) {
getStorageArgs = [isReference(e_1) ? e_1.__ref : e_1];
}
// It's possible that applying merge functions to this subtree will
// not change the incoming data, so this variable tracks the fields
// that did change, so we can create a new incoming object when (and
// only when) at least one incoming field has changed. We use a Map
// to preserve the type of numeric keys.
var changedFields_1;
var getValue_1 = function (from, name) {
return (isArray(from) ?
typeof name === "number" ?
from[name]
: void 0
: context.store.getFieldValue(from, String(name)));
};
mergeTree.map.forEach(function (childTree, storeFieldName) {
var eVal = getValue_1(e_1, storeFieldName);
var iVal = getValue_1(i_1, storeFieldName);
// If we have no incoming data, leave any existing data untouched.
if (void 0 === iVal)
return;
if (getStorageArgs) {
getStorageArgs.push(storeFieldName);
}
var aVal = _this.applyMerges(childTree, eVal, iVal, context, getStorageArgs);
if (aVal !== iVal) {
changedFields_1 = changedFields_1 || new Map();
changedFields_1.set(storeFieldName, aVal);
}
if (getStorageArgs) {
invariant(getStorageArgs.pop() === storeFieldName);
}
});
if (changedFields_1) {
// Shallow clone i so we can add changed fields to it.
incoming = (isArray(i_1) ? i_1.slice(0) : __assign({}, i_1));
changedFields_1.forEach(function (value, name) {
incoming[name] = value;
});
}
}
if (mergeTree.info) {
return this.cache.policies.runMergeFunction(existing, incoming, mergeTree.info, context, getStorageArgs && (_a = context.store).getStorage.apply(_a, getStorageArgs));
}
return incoming;
};
return StoreWriter;
}());
export { StoreWriter };
var emptyMergeTreePool = [];
function getChildMergeTree(_a, name) {
var map = _a.map;
if (!map.has(name)) {
map.set(name, emptyMergeTreePool.pop() || { map: new Map() });
}
return map.get(name);
}
function mergeMergeTrees(left, right) {
if (left === right || !right || mergeTreeIsEmpty(right))
return left;
if (!left || mergeTreeIsEmpty(left))
return right;
var info = left.info && right.info ? __assign(__assign({}, left.info), right.info) : left.info || right.info;
var needToMergeMaps = left.map.size && right.map.size;
var map = needToMergeMaps ? new Map()
: left.map.size ? left.map
: right.map;
var merged = { info: info, map: map };
if (needToMergeMaps) {
var remainingRightKeys_1 = new Set(right.map.keys());
left.map.forEach(function (leftTree, key) {
merged.map.set(key, mergeMergeTrees(leftTree, right.map.get(key)));
remainingRightKeys_1.delete(key);
});
remainingRightKeys_1.forEach(function (key) {
merged.map.set(key, mergeMergeTrees(right.map.get(key), left.map.get(key)));
});
}
return merged;
}
function mergeTreeIsEmpty(tree) {
return !tree || !(tree.info || tree.map.size);
}
function maybeRecycleChildMergeTree(_a, name) {
var map = _a.map;
var childTree = map.get(name);
if (childTree && mergeTreeIsEmpty(childTree)) {
emptyMergeTreePool.push(childTree);
map.delete(name);
}
}
var warnings = new Set();
// Note that this function is unused in production, and thus should be
// pruned by any well-configured minifier.
function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
var getChild = function (objOrRef) {
var child = store.getFieldValue(objOrRef, storeFieldName);
return typeof child === "object" && child;
};
var existing = getChild(existingRef);
if (!existing)
return;
var incoming = getChild(incomingObj);
if (!incoming)
return;
// It's always safe to replace a reference, since it refers to data
// safely stored elsewhere.
if (isReference(existing))
return;
// If the values are structurally equivalent, we do not need to worry
// about incoming replacing existing.
if (equal(existing, incoming))
return;
// If we're replacing every key of the existing object, then the
// existing data would be overwritten even if the objects were
// normalized, so warning would not be helpful here.
if (Object.keys(existing).every(function (key) { return store.getFieldValue(incoming, key) !== void 0; })) {
return;
}
var parentType = store.getFieldValue(existingRef, "__typename") ||
store.getFieldValue(incomingObj, "__typename");
var fieldName = fieldNameFromStoreName(storeFieldName);
var typeDotName = "".concat(parentType, ".").concat(fieldName);
// Avoid warning more than once for the same type and field name.
if (warnings.has(typeDotName))
return;
warnings.add(typeDotName);
var childTypenames = [];
// Arrays do not have __typename fields, and always need a custom merge
// function, even if their elements are normalized entities.
if (!isArray(existing) && !isArray(incoming)) {
[existing, incoming].forEach(function (child) {
var typename = store.getFieldValue(child, "__typename");
if (typeof typename === "string" && !childTypenames.includes(typename)) {
childTypenames.push(typename);
}
});
}
globalThis.__DEV__ !== false && invariant.warn(14, fieldName, parentType, childTypenames.length ?
"either ensure all objects of type " +
childTypenames.join(" and ") +
" have an ID or a custom merge function, or "
: "", typeDotName, existing, incoming);
}
//# sourceMappingURL=writeToStore.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/cache/inmemory/inMemoryCache.js
import { __assign, __extends } from "tslib";
import { invariant } from "../../utilities/globals/index.js";
// Make builtins like Map and Set safe to use with non-extensible objects.
import "./fixPolyfills.js";
import { wrap } from "optimism";
import { equal } from "@wry/equality";
import { ApolloCache } from "../core/cache.js";
import { MissingFieldError } from "../core/types/common.js";
import { addTypenameToDocument, isReference, DocumentTransform, canonicalStringify, print, cacheSizes, } from "../../utilities/index.js";
import { StoreReader } from "./readFromStore.js";
import { StoreWriter } from "./writeToStore.js";
import { EntityStore, supportsResultCaching } from "./entityStore.js";
import { makeVar, forgetCache, recallCache } from "./reactiveVars.js";
import { Policies } from "./policies.js";
import { hasOwn, normalizeConfig, shouldCanonizeResults } from "./helpers.js";
import { getInMemoryCacheMemoryInternals } from "../../utilities/caching/getMemoryInternals.js";
var InMemoryCache = /** @class */ (function (_super) {
__extends(InMemoryCache, _super);
function InMemoryCache(config) {
if (config === void 0) { config = {}; }
var _this = _super.call(this) || this;
_this.watches = new Set();
_this.addTypenameTransform = new DocumentTransform(addTypenameToDocument);
// Override the default value, since InMemoryCache result objects are frozen
// in development and expected to remain logically immutable in production.
_this.assumeImmutableResults = true;
_this.makeVar = makeVar;
_this.txCount = 0;
_this.config = normalizeConfig(config);
_this.addTypename = !!_this.config.addTypename;
_this.policies = new Policies({
cache: _this,
dataIdFromObject: _this.config.dataIdFromObject,
possibleTypes: _this.config.possibleTypes,
typePolicies: _this.config.typePolicies,
});
_this.init();
return _this;
}
InMemoryCache.prototype.init = function () {
// Passing { resultCaching: false } in the InMemoryCache constructor options
// will completely disable dependency tracking, which will improve memory
// usage but worsen the performance of repeated reads.
var rootStore = (this.data = new EntityStore.Root({
policies: this.policies,
resultCaching: this.config.resultCaching,
}));
// When no optimistic writes are currently active, cache.optimisticData ===
// cache.data, so there are no additional layers on top of the actual data.
// When an optimistic update happens, this.optimisticData will become a
// linked list of EntityStore Layer objects that terminates with the
// original this.data cache object.
this.optimisticData = rootStore.stump;
this.resetResultCache();
};
InMemoryCache.prototype.resetResultCache = function (resetResultIdentities) {
var _this = this;
var previousReader = this.storeReader;
var fragments = this.config.fragments;
// The StoreWriter is mostly stateless and so doesn't really need to be
// reset, but it does need to have its writer.storeReader reference updated,
// so it's simpler to update this.storeWriter as well.
this.storeWriter = new StoreWriter(this, (this.storeReader = new StoreReader({
cache: this,
addTypename: this.addTypename,
resultCacheMaxSize: this.config.resultCacheMaxSize,
canonizeResults: shouldCanonizeResults(this.config),
canon: resetResultIdentities ? void 0 : (previousReader && previousReader.canon),
fragments: fragments,
})), fragments);
this.maybeBroadcastWatch = wrap(function (c, options) {
return _this.broadcastWatch(c, options);
}, {
max: this.config.resultCacheMaxSize ||
cacheSizes["inMemoryCache.maybeBroadcastWatch"] ||
5000 /* defaultCacheSizes["inMemoryCache.maybeBroadcastWatch"] */,
makeCacheKey: function (c) {
// Return a cache key (thus enabling result caching) only if we're
// currently using a data store that can track cache dependencies.
var store = c.optimistic ? _this.optimisticData : _this.data;
if (supportsResultCaching(store)) {
var optimistic = c.optimistic, id = c.id, variables = c.variables;
return store.makeCacheKey(c.query,
// Different watches can have the same query, optimistic
// status, rootId, and variables, but if their callbacks are
// different, the (identical) result needs to be delivered to
// each distinct callback. The easiest way to achieve that
// separation is to include c.callback in the cache key for
// maybeBroadcastWatch calls. See issue #5733.
c.callback, canonicalStringify({ optimistic: optimistic, id: id, variables: variables }));
}
},
});
// Since we have thrown away all the cached functions that depend on the
// CacheGroup dependencies maintained by EntityStore, we should also reset
// all CacheGroup dependency information.
new Set([this.data.group, this.optimisticData.group]).forEach(function (group) {
return group.resetCaching();
});
};
InMemoryCache.prototype.restore = function (data) {
this.init();
// Since calling this.init() discards/replaces the entire StoreReader, along
// with the result caches it maintains, this.data.replace(data) won't have
// to bother deleting the old data.
if (data)
this.data.replace(data);
return this;
};
InMemoryCache.prototype.extract = function (optimistic) {
if (optimistic === void 0) { optimistic = false; }
return (optimistic ? this.optimisticData : this.data).extract();
};
InMemoryCache.prototype.read = function (options) {
var
// Since read returns data or null, without any additional metadata
// about whether/where there might have been missing fields, the
// default behavior cannot be returnPartialData = true (like it is
// for the diff method), since defaulting to true would violate the
// integrity of the T in the return type. However, partial data may
// be useful in some cases, so returnPartialData:true may be
// specified explicitly.
_a = options.returnPartialData,
// Since read returns data or null, without any additional metadata
// about whether/where there might have been missing fields, the
// default behavior cannot be returnPartialData = true (like it is
// for the diff method), since defaulting to true would violate the
// integrity of the T in the return type. However, partial data may
// be useful in some cases, so returnPartialData:true may be
// specified explicitly.
returnPartialData = _a === void 0 ? false : _a;
try {
return (this.storeReader.diffQueryAgainstStore(__assign(__assign({}, options), { store: options.optimistic ? this.optimisticData : this.data, config: this.config, returnPartialData: returnPartialData })).result || null);
}
catch (e) {
if (e instanceof MissingFieldError) {
// Swallow MissingFieldError and return null, so callers do not need to
// worry about catching "normal" exceptions resulting from incomplete
// cache data. Unexpected errors will be re-thrown. If you need more
// information about which fields were missing, use cache.diff instead,
// and examine diffResult.missing.
return null;
}
throw e;
}
};
InMemoryCache.prototype.write = function (options) {
try {
++this.txCount;
return this.storeWriter.writeToStore(this.data, options);
}
finally {
if (!--this.txCount && options.broadcast !== false) {
this.broadcastWatches();
}
}
};
InMemoryCache.prototype.modify = function (options) {
if (hasOwn.call(options, "id") && !options.id) {
// To my knowledge, TypeScript does not currently provide a way to
// enforce that an optional property?:type must *not* be undefined
// when present. That ability would be useful here, because we want
// options.id to default to ROOT_QUERY only when no options.id was
// provided. If the caller attempts to pass options.id with a
// falsy/undefined value (perhaps because cache.identify failed), we
// should not assume the goal was to modify the ROOT_QUERY object.
// We could throw, but it seems natural to return false to indicate
// that nothing was modified.
return false;
}
var store = ((options.optimistic) // Defaults to false.
) ?
this.optimisticData
: this.data;
try {
++this.txCount;
return store.modify(options.id || "ROOT_QUERY", options.fields);
}
finally {
if (!--this.txCount && options.broadcast !== false) {
this.broadcastWatches();
}
}
};
InMemoryCache.prototype.diff = function (options) {
return this.storeReader.diffQueryAgainstStore(__assign(__assign({}, options), { store: options.optimistic ? this.optimisticData : this.data, rootId: options.id || "ROOT_QUERY", config: this.config }));
};
InMemoryCache.prototype.watch = function (watch) {
var _this = this;
if (!this.watches.size) {
// In case we previously called forgetCache(this) because
// this.watches became empty (see below), reattach this cache to any
// reactive variables on which it previously depended. It might seem
// paradoxical that we're able to recall something we supposedly
// forgot, but the point of calling forgetCache(this) is to silence
// useless broadcasts while this.watches is empty, and to allow the
// cache to be garbage collected. If, however, we manage to call
// recallCache(this) here, this cache object must not have been
// garbage collected yet, and should resume receiving updates from
// reactive variables, now that it has a watcher to notify.
recallCache(this);
}
this.watches.add(watch);
if (watch.immediate) {
this.maybeBroadcastWatch(watch);
}
return function () {
// Once we remove the last watch from this.watches, cache.broadcastWatches
// no longer does anything, so we preemptively tell the reactive variable
// system to exclude this cache from future broadcasts.
if (_this.watches.delete(watch) && !_this.watches.size) {
forgetCache(_this);
}
// Remove this watch from the LRU cache managed by the
// maybeBroadcastWatch OptimisticWrapperFunction, to prevent memory
// leaks involving the closure of watch.callback.
_this.maybeBroadcastWatch.forget(watch);
};
};
InMemoryCache.prototype.gc = function (options) {
var _a;
canonicalStringify.reset();
print.reset();
this.addTypenameTransform.resetCache();
(_a = this.config.fragments) === null || _a === void 0 ? void 0 : _a.resetCaches();
var ids = this.optimisticData.gc();
if (options && !this.txCount) {
if (options.resetResultCache) {
this.resetResultCache(options.resetResultIdentities);
}
else if (options.resetResultIdentities) {
this.storeReader.resetCanon();
}
}
return ids;
};
// Call this method to ensure the given root ID remains in the cache after
// garbage collection, along with its transitive child entities. Note that
// the cache automatically retains all directly written entities. By default,
// the retainment persists after optimistic updates are removed. Pass true
// for the optimistic argument if you would prefer for the retainment to be
// discarded when the top-most optimistic layer is removed. Returns the
// resulting (non-negative) retainment count.
InMemoryCache.prototype.retain = function (rootId, optimistic) {
return (optimistic ? this.optimisticData : this.data).retain(rootId);
};
// Call this method to undo the effect of the retain method, above. Once the
// retainment count falls to zero, the given ID will no longer be preserved
// during garbage collection, though it may still be preserved by other safe
// entities that refer to it. Returns the resulting (non-negative) retainment
// count, in case that's useful.
InMemoryCache.prototype.release = function (rootId, optimistic) {
return (optimistic ? this.optimisticData : this.data).release(rootId);
};
// Returns the canonical ID for a given StoreObject, obeying typePolicies
// and keyFields (and dataIdFromObject, if you still use that). At minimum,
// the object must contain a __typename and any primary key fields required
// to identify entities of that type. If you pass a query result object, be
// sure that none of the primary key fields have been renamed by aliasing.
// If you pass a Reference object, its __ref ID string will be returned.
InMemoryCache.prototype.identify = function (object) {
if (isReference(object))
return object.__ref;
try {
return this.policies.identify(object)[0];
}
catch (e) {
globalThis.__DEV__ !== false && invariant.warn(e);
}
};
InMemoryCache.prototype.evict = function (options) {
if (!options.id) {
if (hasOwn.call(options, "id")) {
// See comment in modify method about why we return false when
// options.id exists but is falsy/undefined.
return false;
}
options = __assign(__assign({}, options), { id: "ROOT_QUERY" });
}
try {
// It's unlikely that the eviction will end up invoking any other
// cache update operations while it's running, but {in,de}crementing
// this.txCount still seems like a good idea, for uniformity with
// the other update methods.
++this.txCount;
// Pass this.data as a limit on the depth of the eviction, so evictions
// during optimistic updates (when this.data is temporarily set equal to
// this.optimisticData) do not escape their optimistic Layer.
return this.optimisticData.evict(options, this.data);
}
finally {
if (!--this.txCount && options.broadcast !== false) {
this.broadcastWatches();
}
}
};
InMemoryCache.prototype.reset = function (options) {
var _this = this;
this.init();
canonicalStringify.reset();
if (options && options.discardWatches) {
// Similar to what happens in the unsubscribe function returned by
// cache.watch, applied to all current watches.
this.watches.forEach(function (watch) { return _this.maybeBroadcastWatch.forget(watch); });
this.watches.clear();
forgetCache(this);
}
else {
// Calling this.init() above unblocks all maybeBroadcastWatch caching, so
// this.broadcastWatches() triggers a broadcast to every current watcher
// (letting them know their data is now missing). This default behavior is
// convenient because it means the watches do not have to be manually
// reestablished after resetting the cache. To prevent this broadcast and
// cancel all watches, pass true for options.discardWatches.
this.broadcastWatches();
}
return Promise.resolve();
};
InMemoryCache.prototype.removeOptimistic = function (idToRemove) {
var newOptimisticData = this.optimisticData.removeLayer(idToRemove);
if (newOptimisticData !== this.optimisticData) {
this.optimisticData = newOptimisticData;
this.broadcastWatches();
}
};
InMemoryCache.prototype.batch = function (options) {
var _this = this;
var update = options.update, _a = options.optimistic, optimistic = _a === void 0 ? true : _a, removeOptimistic = options.removeOptimistic, onWatchUpdated = options.onWatchUpdated;
var updateResult;
var perform = function (layer) {
var _a = _this, data = _a.data, optimisticData = _a.optimisticData;
++_this.txCount;
if (layer) {
_this.data = _this.optimisticData = layer;
}
try {
return (updateResult = update(_this));
}
finally {
--_this.txCount;
_this.data = data;
_this.optimisticData = optimisticData;
}
};
var alreadyDirty = new Set();
if (onWatchUpdated && !this.txCount) {
// If an options.onWatchUpdated callback is provided, we want to call it
// with only the Cache.WatchOptions objects affected by options.update,
// but there might be dirty watchers already waiting to be broadcast that
// have nothing to do with the update. To prevent including those watchers
// in the post-update broadcast, we perform this initial broadcast to
// collect the dirty watchers, so we can re-dirty them later, after the
// post-update broadcast, allowing them to receive their pending
// broadcasts the next time broadcastWatches is called, just as they would
// if we never called cache.batch.
this.broadcastWatches(__assign(__assign({}, options), { onWatchUpdated: function (watch) {
alreadyDirty.add(watch);
return false;
} }));
}
if (typeof optimistic === "string") {
// Note that there can be multiple layers with the same optimistic ID.
// When removeOptimistic(id) is called for that id, all matching layers
// will be removed, and the remaining layers will be reapplied.
this.optimisticData = this.optimisticData.addLayer(optimistic, perform);
}
else if (optimistic === false) {
// Ensure both this.data and this.optimisticData refer to the root
// (non-optimistic) layer of the cache during the update. Note that
// this.data could be a Layer if we are currently executing an optimistic
// update function, but otherwise will always be an EntityStore.Root
// instance.
perform(this.data);
}
else {
// Otherwise, leave this.data and this.optimisticData unchanged and run
// the update with broadcast batching.
perform();
}
if (typeof removeOptimistic === "string") {
this.optimisticData = this.optimisticData.removeLayer(removeOptimistic);
}
// Note: if this.txCount > 0, then alreadyDirty.size === 0, so this code
// takes the else branch and calls this.broadcastWatches(options), which
// does nothing when this.txCount > 0.
if (onWatchUpdated && alreadyDirty.size) {
this.broadcastWatches(__assign(__assign({}, options), { onWatchUpdated: function (watch, diff) {
var result = onWatchUpdated.call(this, watch, diff);
if (result !== false) {
// Since onWatchUpdated did not return false, this diff is
// about to be broadcast to watch.callback, so we don't need
// to re-dirty it with the other alreadyDirty watches below.
alreadyDirty.delete(watch);
}
return result;
} }));
// Silently re-dirty any watches that were already dirty before the update
// was performed, and were not broadcast just now.
if (alreadyDirty.size) {
alreadyDirty.forEach(function (watch) { return _this.maybeBroadcastWatch.dirty(watch); });
}
}
else {
// If alreadyDirty is empty or we don't have an onWatchUpdated
// function, we don't need to go to the trouble of wrapping
// options.onWatchUpdated.
this.broadcastWatches(options);
}
return updateResult;
};
InMemoryCache.prototype.performTransaction = function (update, optimisticId) {
return this.batch({
update: update,
optimistic: optimisticId || optimisticId !== null,
});
};
InMemoryCache.prototype.transformDocument = function (document) {
return this.addTypenameToDocument(this.addFragmentsToDocument(document));
};
InMemoryCache.prototype.broadcastWatches = function (options) {
var _this = this;
if (!this.txCount) {
this.watches.forEach(function (c) { return _this.maybeBroadcastWatch(c, options); });
}
};
InMemoryCache.prototype.addFragmentsToDocument = function (document) {
var fragments = this.config.fragments;
return fragments ? fragments.transform(document) : document;
};
InMemoryCache.prototype.addTypenameToDocument = function (document) {
if (this.addTypename) {
return this.addTypenameTransform.transformDocument(document);
}
return document;
};
// This method is wrapped by maybeBroadcastWatch, which is called by
// broadcastWatches, so that we compute and broadcast results only when
// the data that would be broadcast might have changed. It would be
// simpler to check for changes after recomputing a result but before
// broadcasting it, but this wrapping approach allows us to skip both
// the recomputation and the broadcast, in most cases.
InMemoryCache.prototype.broadcastWatch = function (c, options) {
var lastDiff = c.lastDiff;
// Both WatchOptions and DiffOptions extend ReadOptions, and DiffOptions
// currently requires no additional properties, so we can use c (a
// WatchOptions object) as DiffOptions, without having to allocate a new
// object, and without having to enumerate the relevant properties (query,
// variables, etc.) explicitly. There will be some additional properties
// (lastDiff, callback, etc.), but cache.diff ignores them.
var diff = this.diff(c);
if (options) {
if (c.optimistic && typeof options.optimistic === "string") {
diff.fromOptimisticTransaction = true;
}
if (options.onWatchUpdated &&
options.onWatchUpdated.call(this, c, diff, lastDiff) === false) {
// Returning false from the onWatchUpdated callback will prevent
// calling c.callback(diff) for this watcher.
return;
}
}
if (!lastDiff || !equal(lastDiff.result, diff.result)) {
c.callback((c.lastDiff = diff), lastDiff);
}
};
return InMemoryCache;
}(ApolloCache));
export { InMemoryCache };
if (globalThis.__DEV__ !== false) {
InMemoryCache.prototype.getMemoryInternals = getInMemoryCacheMemoryInternals;
}
//# sourceMappingURL=inMemoryCache.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/core/execute.js
import { ApolloLink } from "./ApolloLink.js";
export var execute = ApolloLink.execute;
//# sourceMappingURL=execute.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/http/HttpLink.js
import { __extends } from "tslib";
import { ApolloLink } from "../core/index.js";
import { createHttpLink } from "./createHttpLink.js";
var HttpLink = /** @class */ (function (_super) {
__extends(HttpLink, _super);
function HttpLink(options) {
if (options === void 0) { options = {}; }
var _this = _super.call(this, createHttpLink(options).request) || this;
_this.options = options;
return _this;
}
return HttpLink;
}(ApolloLink));
export { HttpLink };
//# sourceMappingURL=HttpLink.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/observables/asyncMap.js
import { Observable } from "./Observable.js";
// Like Observable.prototype.map, except that the mapping function can
// optionally return a Promise (or be async).
export function asyncMap(observable, mapFn, catchFn) {
return new Observable(function (observer) {
var promiseQueue = {
// Normally we would initialize promiseQueue to Promise.resolve(), but
// in this case, for backwards compatibility, we need to be careful to
// invoke the first callback synchronously.
then: function (callback) {
return new Promise(function (resolve) { return resolve(callback()); });
},
};
function makeCallback(examiner, key) {
return function (arg) {
if (examiner) {
var both = function () {
// If the observer is closed, we don't want to continue calling the
// mapping function - it's result will be swallowed anyways.
return observer.closed ?
/* will be swallowed */ 0
: examiner(arg);
};
promiseQueue = promiseQueue.then(both, both).then(function (result) { return observer.next(result); }, function (error) { return observer.error(error); });
}
else {
observer[key](arg);
}
};
}
var handler = {
next: makeCallback(mapFn, "next"),
error: makeCallback(catchFn, "error"),
complete: function () {
// no need to reassign `promiseQueue`, after `observer.complete`,
// the observer will be closed and short-circuit everything anyways
/*promiseQueue = */ promiseQueue.then(function () { return observer.complete(); });
},
};
var sub = observable.subscribe(handler);
return function () { return sub.unsubscribe(); };
});
}
//# sourceMappingURL=asyncMap.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/common/errorHandling.js
import { isNonEmptyArray } from "./arrays.js";
import { isExecutionPatchIncrementalResult } from "./incrementalResult.js";
export function graphQLResultHasError(result) {
var errors = getGraphQLErrorsFromResult(result);
return isNonEmptyArray(errors);
}
export function getGraphQLErrorsFromResult(result) {
var graphQLErrors = isNonEmptyArray(result.errors) ? result.errors.slice(0) : [];
if (isExecutionPatchIncrementalResult(result) &&
isNonEmptyArray(result.incremental)) {
result.incremental.forEach(function (incrementalResult) {
if (incrementalResult.errors) {
graphQLErrors.push.apply(graphQLErrors, incrementalResult.errors);
}
});
}
return graphQLErrors;
}
//# sourceMappingURL=errorHandling.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/observables/iteration.js
export function iterateObserversSafely(observers, method, argument) {
// In case observers is modified during iteration, we need to commit to the
// original elements, which also provides an opportunity to filter them down
// to just the observers with the given method.
var observersWithMethod = [];
observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); });
observersWithMethod.forEach(function (obs) { return obs[method](argument); });
}
//# sourceMappingURL=iteration.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/observables/subclassing.js
import { Observable } from "./Observable.js";
import { canUseSymbol } from "../common/canUse.js";
// Generic implementations of Observable.prototype methods like map and
// filter need to know how to create a new Observable from an Observable
// subclass (like Concast or ObservableQuery). Those methods assume
// (perhaps unwisely?) that they can call the subtype's constructor with a
// Subscriber function, even though the subclass constructor might expect
// different parameters. Defining this static Symbol.species property on
// the subclass is a hint to generic Observable code to use the default
// constructor instead of trying to do `new Subclass(observer => ...)`.
export function fixObservableSubclass(subclass) {
function set(key) {
// Object.defineProperty is necessary because the Symbol.species
// property is a getter by default in modern JS environments, so we
// can't assign to it with a normal assignment expression.
Object.defineProperty(subclass, key, { value: Observable });
}
if (canUseSymbol && Symbol.species) {
set(Symbol.species);
}
// The "@@species" string is used as a fake Symbol.species value in some
// polyfill systems (including the SymbolSpecies variable used by
// zen-observable), so we should set it as well, to be safe.
set("@@species");
return subclass;
}
//# sourceMappingURL=subclassing.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/utilities/observables/Concast.js
import { __extends } from "tslib";
import { Observable } from "./Observable.js";
import { iterateObserversSafely } from "./iteration.js";
import { fixObservableSubclass } from "./subclassing.js";
function isPromiseLike(value) {
return value && typeof value.then === "function";
}
// A Concast<T> observable concatenates the given sources into a single
// non-overlapping sequence of Ts, automatically unwrapping any promises,
// and broadcasts the T elements of that sequence to any number of
// subscribers, all without creating a bunch of intermediary Observable
// wrapper objects.
//
// Even though any number of observers can subscribe to the Concast, each
// source observable is guaranteed to receive at most one subscribe call,
// and the results are multicast to all observers.
//
// In addition to broadcasting every next/error message to this.observers,
// the Concast stores the most recent message using this.latest, so any
// new observers can immediately receive the latest message, even if it
// was originally delivered in the past. This behavior means we can assume
// every active observer in this.observers has received the same most
// recent message.
//
// With the exception of this.latest replay, a Concast is a "hot"
// observable in the sense that it does not replay past results from the
// beginning of time for each new observer.
//
// Could we have used some existing RxJS class instead? Concast<T> is
// similar to a BehaviorSubject<T>, because it is multicast and redelivers
// the latest next/error message to new subscribers. Unlike Subject<T>,
// Concast<T> does not expose an Observer<T> interface (this.handlers is
// intentionally private), since Concast<T> gets its inputs from the
// concatenated sources. If we ever switch to RxJS, there may be some
// value in reusing their code, but for now we use zen-observable, which
// does not contain any Subject implementations.
var Concast = /** @class */ (function (_super) {
__extends(Concast, _super);
// Not only can the individual elements of the iterable be promises, but
// also the iterable itself can be wrapped in a promise.
function Concast(sources) {
var _this = _super.call(this, function (observer) {
_this.addObserver(observer);
return function () { return _this.removeObserver(observer); };
}) || this;
// Active observers receiving broadcast messages. Thanks to this.latest,
// we can assume all observers in this Set have received the same most
// recent message, though possibly at different times in the past.
_this.observers = new Set();
_this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
// Bound handler functions that can be reused for every internal
// subscription.
_this.handlers = {
next: function (result) {
if (_this.sub !== null) {
_this.latest = ["next", result];
_this.notify("next", result);
iterateObserversSafely(_this.observers, "next", result);
}
},
error: function (error) {
var sub = _this.sub;
if (sub !== null) {
// Delay unsubscribing from the underlying subscription slightly,
// so that immediately subscribing another observer can keep the
// subscription active.
if (sub)
setTimeout(function () { return sub.unsubscribe(); });
_this.sub = null;
_this.latest = ["error", error];
_this.reject(error);
_this.notify("error", error);
iterateObserversSafely(_this.observers, "error", error);
}
},
complete: function () {
var _a = _this, sub = _a.sub, _b = _a.sources, sources = _b === void 0 ? [] : _b;
if (sub !== null) {
// If complete is called before concast.start, this.sources may be
// undefined, so we use a default value of [] for sources. That works
// here because it falls into the if (!value) {...} block, which
// appropriately terminates the Concast, even if this.sources might
// eventually have been initialized to a non-empty array.
var value = sources.shift();
if (!value) {
if (sub)
setTimeout(function () { return sub.unsubscribe(); });
_this.sub = null;
if (_this.latest && _this.latest[0] === "next") {
_this.resolve(_this.latest[1]);
}
else {
_this.resolve();
}
_this.notify("complete");
// We do not store this.latest = ["complete"], because doing so
// discards useful information about the previous next (or
// error) message. Instead, if new observers subscribe after
// this Concast has completed, they will receive the final
// 'next' message (unless there was an error) immediately
// followed by a 'complete' message (see addObserver).
iterateObserversSafely(_this.observers, "complete");
}
else if (isPromiseLike(value)) {
value.then(function (obs) { return (_this.sub = obs.subscribe(_this.handlers)); }, _this.handlers.error);
}
else {
_this.sub = value.subscribe(_this.handlers);
}
}
},
};
_this.nextResultListeners = new Set();
// A public way to abort observation and broadcast.
_this.cancel = function (reason) {
_this.reject(reason);
_this.sources = [];
_this.handlers.complete();
};
// Suppress rejection warnings for this.promise, since it's perfectly
// acceptable to pay no attention to this.promise if you're consuming
// the results through the normal observable API.
_this.promise.catch(function (_) { });
// If someone accidentally tries to create a Concast using a subscriber
// function, recover by creating an Observable from that subscriber and
// using it as the source.
if (typeof sources === "function") {
sources = [new Observable(sources)];
}
if (isPromiseLike(sources)) {
sources.then(function (iterable) { return _this.start(iterable); }, _this.handlers.error);
}
else {
_this.start(sources);
}
return _this;
}
Concast.prototype.start = function (sources) {
if (this.sub !== void 0)
return;
// In practice, sources is most often simply an Array of observables.
// TODO Consider using sources[Symbol.iterator]() to take advantage
// of the laziness of non-Array iterables.
this.sources = Array.from(sources);
// Calling this.handlers.complete() kicks off consumption of the first
// source observable. It's tempting to do this step lazily in
// addObserver, but this.promise can be accessed without calling
// addObserver, so consumption needs to begin eagerly.
this.handlers.complete();
};
Concast.prototype.deliverLastMessage = function (observer) {
if (this.latest) {
var nextOrError = this.latest[0];
var method = observer[nextOrError];
if (method) {
method.call(observer, this.latest[1]);
}
// If the subscription is already closed, and the last message was
// a 'next' message, simulate delivery of the final 'complete'
// message again.
if (this.sub === null && nextOrError === "next" && observer.complete) {
observer.complete();
}
}
};
Concast.prototype.addObserver = function (observer) {
if (!this.observers.has(observer)) {
// Immediately deliver the most recent message, so we can always
// be sure all observers have the latest information.
this.deliverLastMessage(observer);
this.observers.add(observer);
}
};
Concast.prototype.removeObserver = function (observer) {
if (this.observers.delete(observer) && this.observers.size < 1) {
// In case there are still any listeners in this.nextResultListeners, and
// no error or completion has been broadcast yet, make sure those
// observers have a chance to run and then remove themselves from
// this.observers.
this.handlers.complete();
}
};
Concast.prototype.notify = function (method, arg) {
var nextResultListeners = this.nextResultListeners;
if (nextResultListeners.size) {
// Replacing this.nextResultListeners first ensures it does not grow while
// we are iterating over it, potentially leading to infinite loops.
this.nextResultListeners = new Set();
nextResultListeners.forEach(function (listener) { return listener(method, arg); });
}
};
// We need a way to run callbacks just *before* the next result (or error or
// completion) is delivered by this Concast, so we can be sure any code that
// runs as a result of delivering that result/error observes the effects of
// running the callback(s). It was tempting to reuse the Observer type instead
// of introducing NextResultListener, but that messes with the sizing and
// maintenance of this.observers, and ends up being more code overall.
Concast.prototype.beforeNext = function (callback) {
var called = false;
this.nextResultListeners.add(function (method, arg) {
if (!called) {
called = true;
callback(method, arg);
}
});
};
return Concast;
}(Observable));
export { Concast };
// Necessary because the Concast constructor has a different signature
// than the Observable constructor.
fixObservableSubclass(Concast);
//# sourceMappingURL=Concast.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/core/equalByQuery.js
import { __rest } from "tslib";
import equal from "@wry/equality";
import { createFragmentMap, getFragmentDefinitions, getFragmentFromSelection, getMainDefinition, isField, resultKeyNameFromField, shouldInclude, } from "../utilities/index.js";
// Returns true if aResult and bResult are deeply equal according to the fields
// selected by the given query, ignoring any fields marked as @nonreactive.
export function equalByQuery(query, _a, _b, variables) {
var aData = _a.data, aRest = __rest(_a, ["data"]);
var bData = _b.data, bRest = __rest(_b, ["data"]);
return (equal(aRest, bRest) &&
equalBySelectionSet(getMainDefinition(query).selectionSet, aData, bData, {
fragmentMap: createFragmentMap(getFragmentDefinitions(query)),
variables: variables,
}));
}
function equalBySelectionSet(selectionSet, aResult, bResult, context) {
if (aResult === bResult) {
return true;
}
var seenSelections = new Set();
// Returning true from this Array.prototype.every callback function skips the
// current field/subtree. Returning false aborts the entire traversal
// immediately, causing equalBySelectionSet to return false.
return selectionSet.selections.every(function (selection) {
// Avoid re-processing the same selection at the same level of recursion, in
// case the same field gets included via multiple indirect fragment spreads.
if (seenSelections.has(selection))
return true;
seenSelections.add(selection);
// Ignore @skip(if: true) and @include(if: false) fields.
if (!shouldInclude(selection, context.variables))
return true;
// If the field or (named) fragment spread has a @nonreactive directive on
// it, we don't care if it's different, so we pretend it's the same.
if (selectionHasNonreactiveDirective(selection))
return true;
if (isField(selection)) {
var resultKey = resultKeyNameFromField(selection);
var aResultChild = aResult && aResult[resultKey];
var bResultChild = bResult && bResult[resultKey];
var childSelectionSet = selection.selectionSet;
if (!childSelectionSet) {
// These are scalar values, so we can compare them with deep equal
// without redoing the main recursive work.
return equal(aResultChild, bResultChild);
}
var aChildIsArray = Array.isArray(aResultChild);
var bChildIsArray = Array.isArray(bResultChild);
if (aChildIsArray !== bChildIsArray)
return false;
if (aChildIsArray && bChildIsArray) {
var length_1 = aResultChild.length;
if (bResultChild.length !== length_1) {
return false;
}
for (var i = 0; i < length_1; ++i) {
if (!equalBySelectionSet(childSelectionSet, aResultChild[i], bResultChild[i], context)) {
return false;
}
}
return true;
}
return equalBySelectionSet(childSelectionSet, aResultChild, bResultChild, context);
}
else {
var fragment = getFragmentFromSelection(selection, context.fragmentMap);
if (fragment) {
// The fragment might === selection if it's an inline fragment, but
// could be !== if it's a named fragment ...spread.
if (selectionHasNonreactiveDirective(fragment))
return true;
return equalBySelectionSet(fragment.selectionSet,
// Notice that we reuse the same aResult and bResult values here,
// since the fragment ...spread does not specify a field name, but
// consists of multiple fields (within the fragment's selection set)
// that should be applied to the current result value(s).
aResult, bResult, context);
}
}
});
}
function selectionHasNonreactiveDirective(selection) {
return (!!selection.directives && selection.directives.some(directiveIsNonreactive));
}
function directiveIsNonreactive(dir) {
return dir.name.value === "nonreactive";
}
//# sourceMappingURL=equalByQuery.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/core/ObservableQuery.js
import { __assign, __extends } from "tslib";
import { invariant } from "../utilities/globals/index.js";
import { equal } from "@wry/equality";
import { NetworkStatus, isNetworkRequestInFlight } from "./networkStatus.js";
import { cloneDeep, compact, getOperationDefinition, Observable, iterateObserversSafely, fixObservableSubclass, getQueryDefinition, } from "../utilities/index.js";
import { equalByQuery } from "./equalByQuery.js";
var assign = Object.assign, hasOwnProperty = Object.hasOwnProperty;
var ObservableQuery = /** @class */ (function (_super) {
__extends(ObservableQuery, _super);
function ObservableQuery(_a) {
var queryManager = _a.queryManager, queryInfo = _a.queryInfo, options = _a.options;
var _this = _super.call(this, function (observer) {
// Zen Observable has its own error function, so in order to log correctly
// we need to provide a custom error callback.
try {
var subObserver = observer._subscription._observer;
if (subObserver && !subObserver.error) {
subObserver.error = defaultSubscriptionObserverErrorCallback;
}
}
catch (_a) { }
var first = !_this.observers.size;
_this.observers.add(observer);
// Deliver most recent error or result.
var last = _this.last;
if (last && last.error) {
observer.error && observer.error(last.error);
}
else if (last && last.result) {
observer.next && observer.next(last.result);
}
// Initiate observation of this query if it hasn't been reported to
// the QueryManager yet.
if (first) {
// Blindly catching here prevents unhandled promise rejections,
// and is safe because the ObservableQuery handles this error with
// this.observer.error, so we're not just swallowing the error by
// ignoring it here.
_this.reobserve().catch(function () { });
}
return function () {
if (_this.observers.delete(observer) && !_this.observers.size) {
_this.tearDownQuery();
}
};
}) || this;
_this.observers = new Set();
_this.subscriptions = new Set();
// related classes
_this.queryInfo = queryInfo;
_this.queryManager = queryManager;
// active state
_this.waitForOwnResult = skipCacheDataFor(options.fetchPolicy);
_this.isTornDown = false;
var _b = queryManager.defaultOptions.watchQuery, _c = _b === void 0 ? {} : _b, _d = _c.fetchPolicy, defaultFetchPolicy = _d === void 0 ? "cache-first" : _d;
var _e = options.fetchPolicy, fetchPolicy = _e === void 0 ? defaultFetchPolicy : _e,
// Make sure we don't store "standby" as the initialFetchPolicy.
_f = options.initialFetchPolicy,
// Make sure we don't store "standby" as the initialFetchPolicy.
initialFetchPolicy = _f === void 0 ? fetchPolicy === "standby" ? defaultFetchPolicy : (fetchPolicy) : _f;
_this.options = __assign(__assign({}, options), {
// Remember the initial options.fetchPolicy so we can revert back to this
// policy when variables change. This information can also be specified
// (or overridden) by providing options.initialFetchPolicy explicitly.
initialFetchPolicy: initialFetchPolicy,
// This ensures this.options.fetchPolicy always has a string value, in
// case options.fetchPolicy was not provided.
fetchPolicy: fetchPolicy });
_this.queryId = queryInfo.queryId || queryManager.generateQueryId();
var opDef = getOperationDefinition(_this.query);
_this.queryName = opDef && opDef.name && opDef.name.value;
return _this;
}
Object.defineProperty(ObservableQuery.prototype, "query", {
// The `query` computed property will always reflect the document transformed
// by the last run query. `this.options.query` will always reflect the raw
// untransformed query to ensure document transforms with runtime conditionals
// are run on the original document.
get: function () {
return this.lastQuery || this.options.query;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ObservableQuery.prototype, "variables", {
// Computed shorthand for this.options.variables, preserved for
// backwards compatibility.
/**
* An object containing the variables that were provided for the query.
*/
get: function () {
return this.options.variables;
},
enumerable: false,
configurable: true
});
ObservableQuery.prototype.result = function () {
var _this = this;
return new Promise(function (resolve, reject) {
// TODO: this code doesn’t actually make sense insofar as the observer
// will never exist in this.observers due how zen-observable wraps observables.
// https://github.com/zenparsing/zen-observable/blob/master/src/Observable.js#L169
var observer = {
next: function (result) {
resolve(result);
// Stop the query within the QueryManager if we can before
// this function returns.
//
// We do this in order to prevent observers piling up within
// the QueryManager. Notice that we only fully unsubscribe
// from the subscription in a setTimeout(..., 0) call. This call can
// actually be handled by the browser at a much later time. If queries
// are fired in the meantime, observers that should have been removed
// from the QueryManager will continue to fire, causing an unnecessary
// performance hit.
_this.observers.delete(observer);
if (!_this.observers.size) {
_this.queryManager.removeQuery(_this.queryId);
}
setTimeout(function () {
subscription.unsubscribe();
}, 0);
},
error: reject,
};
var subscription = _this.subscribe(observer);
});
};
/** @internal */
ObservableQuery.prototype.resetDiff = function () {
this.queryInfo.resetDiff();
};
ObservableQuery.prototype.getCurrentResult = function (saveAsLastResult) {
if (saveAsLastResult === void 0) { saveAsLastResult = true; }
// Use the last result as long as the variables match this.variables.
var lastResult = this.getLastResult(true);
var networkStatus = this.queryInfo.networkStatus ||
(lastResult && lastResult.networkStatus) ||
NetworkStatus.ready;
var result = __assign(__assign({}, lastResult), { loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus });
var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? "cache-first" : _a;
if (
// These fetch policies should never deliver data from the cache, unless
// redelivering a previously delivered result.
skipCacheDataFor(fetchPolicy) ||
// If this.options.query has @client(always: true) fields, we cannot
// trust diff.result, since it was read from the cache without running
// local resolvers (and it's too late to run resolvers now, since we must
// return a result synchronously).
this.queryManager.getDocumentInfo(this.query).hasForcedResolvers) {
// Fall through.
}
else if (this.waitForOwnResult) {
// This would usually be a part of `QueryInfo.getDiff()`.
// which we skip in the waitForOwnResult case since we are not
// interested in the diff.
this.queryInfo["updateWatch"]();
}
else {
var diff = this.queryInfo.getDiff();
if (diff.complete || this.options.returnPartialData) {
result.data = diff.result;
}
if (equal(result.data, {})) {
result.data = void 0;
}
if (diff.complete) {
// Similar to setting result.partial to false, but taking advantage of the
// falsiness of missing fields.
delete result.partial;
// If the diff is complete, and we're using a FetchPolicy that
// terminates after a complete cache read, we can assume the next result
// we receive will have NetworkStatus.ready and !loading.
if (diff.complete &&
result.networkStatus === NetworkStatus.loading &&
(fetchPolicy === "cache-first" || fetchPolicy === "cache-only")) {
result.networkStatus = NetworkStatus.ready;
result.loading = false;
}
}
else {
result.partial = true;
}
if (globalThis.__DEV__ !== false &&
!diff.complete &&
!this.options.partialRefetch &&
!result.loading &&
!result.data &&
!result.error) {
logMissingFieldErrors(diff.missing);
}
}
if (saveAsLastResult) {
this.updateLastResult(result);
}
return result;
};
// Compares newResult to the snapshot we took of this.lastResult when it was
// first received.
ObservableQuery.prototype.isDifferentFromLastResult = function (newResult, variables) {
if (!this.last) {
return true;
}
var resultIsDifferent = this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective ?
!equalByQuery(this.query, this.last.result, newResult, this.variables)
: !equal(this.last.result, newResult);
return (resultIsDifferent || (variables && !equal(this.last.variables, variables)));
};
ObservableQuery.prototype.getLast = function (key, variablesMustMatch) {
var last = this.last;
if (last &&
last[key] &&
(!variablesMustMatch || equal(last.variables, this.variables))) {
return last[key];
}
};
ObservableQuery.prototype.getLastResult = function (variablesMustMatch) {
return this.getLast("result", variablesMustMatch);
};
ObservableQuery.prototype.getLastError = function (variablesMustMatch) {
return this.getLast("error", variablesMustMatch);
};
ObservableQuery.prototype.resetLastResults = function () {
delete this.last;
this.isTornDown = false;
};
ObservableQuery.prototype.resetQueryStoreErrors = function () {
this.queryManager.resetErrors(this.queryId);
};
/**
* Update the variables of this observable query, and fetch the new results.
* This method should be preferred over `setVariables` in most use cases.
*
* @param variables - The new set of variables. If there are missing variables,
* the previous values of those variables will be used.
*/
ObservableQuery.prototype.refetch = function (variables) {
var _a;
var reobserveOptions = {
// Always disable polling for refetches.
pollInterval: 0,
};
// Unless the provided fetchPolicy always consults the network
// (no-cache, network-only, or cache-and-network), override it with
// network-only to force the refetch for this fetchQuery call.
var fetchPolicy = this.options.fetchPolicy;
if (fetchPolicy === "cache-and-network") {
reobserveOptions.fetchPolicy = fetchPolicy;
}
else if (fetchPolicy === "no-cache") {
reobserveOptions.fetchPolicy = "no-cache";
}
else {
reobserveOptions.fetchPolicy = "network-only";
}
if (globalThis.__DEV__ !== false && variables && hasOwnProperty.call(variables, "variables")) {
var queryDef = getQueryDefinition(this.query);
var vars = queryDef.variableDefinitions;
if (!vars || !vars.some(function (v) { return v.variable.name.value === "variables"; })) {
globalThis.__DEV__ !== false && invariant.warn(
20,
variables,
((_a = queryDef.name) === null || _a === void 0 ? void 0 : _a.value) || queryDef
);
}
}
if (variables && !equal(this.options.variables, variables)) {
// Update the existing options with new variables
reobserveOptions.variables = this.options.variables = __assign(__assign({}, this.options.variables), variables);
}
this.queryInfo.resetLastWrite();
return this.reobserve(reobserveOptions, NetworkStatus.refetch);
};
/**
* A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
*/
ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) {
var _this = this;
var combinedOptions = __assign(__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : (__assign(__assign(__assign(__assign({}, this.options), { query: this.options.query }), fetchMoreOptions), { variables: __assign(__assign({}, this.options.variables), fetchMoreOptions.variables) })))), {
// The fetchMore request goes immediately to the network and does
// not automatically write its result to the cache (hence no-cache
// instead of network-only), because we allow the caller of
// fetchMore to provide an updateQuery callback that determines how
// the data gets written to the cache.
fetchPolicy: "no-cache" });
combinedOptions.query = this.transformDocument(combinedOptions.query);
var qid = this.queryManager.generateQueryId();
// If a temporary query is passed to `fetchMore`, we don't want to store
// it as the last query result since it may be an optimized query for
// pagination. We will however run the transforms on the original document
// as well as the document passed in `fetchMoreOptions` to ensure the cache
// uses the most up-to-date document which may rely on runtime conditionals.
this.lastQuery =
fetchMoreOptions.query ?
this.transformDocument(this.options.query)
: combinedOptions.query;
// Simulate a loading result for the original query with
// result.networkStatus === NetworkStatus.fetchMore.
var queryInfo = this.queryInfo;
var originalNetworkStatus = queryInfo.networkStatus;
queryInfo.networkStatus = NetworkStatus.fetchMore;
if (combinedOptions.notifyOnNetworkStatusChange) {
this.observe();
}
var updatedQuerySet = new Set();
return this.queryManager
.fetchQuery(qid, combinedOptions, NetworkStatus.fetchMore)
.then(function (fetchMoreResult) {
_this.queryManager.removeQuery(qid);
if (queryInfo.networkStatus === NetworkStatus.fetchMore) {
queryInfo.networkStatus = originalNetworkStatus;
}
// Performing this cache update inside a cache.batch transaction ensures
// any affected cache.watch watchers are notified at most once about any
// updates. Most watchers will be using the QueryInfo class, which
// responds to notifications by calling reobserveCacheFirst to deliver
// fetchMore cache results back to this ObservableQuery.
_this.queryManager.cache.batch({
update: function (cache) {
var updateQuery = fetchMoreOptions.updateQuery;
if (updateQuery) {
cache.updateQuery({
query: _this.query,
variables: _this.variables,
returnPartialData: true,
optimistic: false,
}, function (previous) {
return updateQuery(previous, {
fetchMoreResult: fetchMoreResult.data,
variables: combinedOptions.variables,
});
});
}
else {
// If we're using a field policy instead of updateQuery, the only
// thing we need to do is write the new data to the cache using
// combinedOptions.variables (instead of this.variables, which is
// what this.updateQuery uses, because it works by abusing the
// original field value, keyed by the original variables).
cache.writeQuery({
query: combinedOptions.query,
variables: combinedOptions.variables,
data: fetchMoreResult.data,
});
}
},
onWatchUpdated: function (watch) {
// Record the DocumentNode associated with any watched query whose
// data were updated by the cache writes above.
updatedQuerySet.add(watch.query);
},
});
return fetchMoreResult;
})
.finally(function () {
// In case the cache writes above did not generate a broadcast
// notification (which would have been intercepted by onWatchUpdated),
// likely because the written data were the same as what was already in
// the cache, we still want fetchMore to deliver its final loading:false
// result with the unchanged data.
if (!updatedQuerySet.has(_this.query)) {
reobserveCacheFirst(_this);
}
});
};
// XXX the subscription variables are separate from the query variables.
// if you want to update subscription variables, right now you have to do that separately,
// and you can only do it by stopping the subscription and then subscribing again with new variables.
/**
* A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
*
* This function returns _another_ function that you can call to terminate the subscription.
*/
ObservableQuery.prototype.subscribeToMore = function (options) {
var _this = this;
var subscription = this.queryManager
.startGraphQLSubscription({
query: options.document,
variables: options.variables,
context: options.context,
})
.subscribe({
next: function (subscriptionData) {
var updateQuery = options.updateQuery;
if (updateQuery) {
_this.updateQuery(function (previous, _a) {
var variables = _a.variables;
return updateQuery(previous, {
subscriptionData: subscriptionData,
variables: variables,
});
});
}
},
error: function (err) {
if (options.onError) {
options.onError(err);
return;
}
globalThis.__DEV__ !== false && invariant.error(21, err);
},
});
this.subscriptions.add(subscription);
return function () {
if (_this.subscriptions.delete(subscription)) {
subscription.unsubscribe();
}
};
};
ObservableQuery.prototype.setOptions = function (newOptions) {
return this.reobserve(newOptions);
};
ObservableQuery.prototype.silentSetOptions = function (newOptions) {
var mergedOptions = compact(this.options, newOptions || {});
assign(this.options, mergedOptions);
};
/**
* Update the variables of this observable query, and fetch the new results
* if they've changed. Most users should prefer `refetch` instead of
* `setVariables` in order to to be properly notified of results even when
* they come from the cache.
*
* Note: the `next` callback will *not* fire if the variables have not changed
* or if the result is coming from cache.
*
* Note: the promise will return the old results immediately if the variables
* have not changed.
*
* Note: the promise will return null immediately if the query is not active
* (there are no subscribers).
*
* @param variables - The new set of variables. If there are missing variables,
* the previous values of those variables will be used.
*/
ObservableQuery.prototype.setVariables = function (variables) {
if (equal(this.variables, variables)) {
// If we have no observers, then we don't actually want to make a network
// request. As soon as someone observes the query, the request will kick
// off. For now, we just store any changes. (See #1077)
return this.observers.size ? this.result() : Promise.resolve();
}
this.options.variables = variables;
// See comment above
if (!this.observers.size) {
return Promise.resolve();
}
return this.reobserve({
// Reset options.fetchPolicy to its original value.
fetchPolicy: this.options.initialFetchPolicy,
variables: variables,
}, NetworkStatus.setVariables);
};
/**
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
*
* See [using updateQuery and updateFragment](https://www.apollographql.com/docs/react/caching/cache-interaction/#using-updatequery-and-updatefragment) for additional information.
*/
ObservableQuery.prototype.updateQuery = function (mapFn) {
var queryManager = this.queryManager;
var result = queryManager.cache.diff({
query: this.options.query,
variables: this.variables,
returnPartialData: true,
optimistic: false,
}).result;
var newResult = mapFn(result, {
variables: this.variables,
});
if (newResult) {
queryManager.cache.writeQuery({
query: this.options.query,
data: newResult,
variables: this.variables,
});
queryManager.broadcastQueries();
}
};
/**
* A function that instructs the query to begin re-executing at a specified interval (in milliseconds).
*/
ObservableQuery.prototype.startPolling = function (pollInterval) {
this.options.pollInterval = pollInterval;
this.updatePolling();
};
/**
* A function that instructs the query to stop polling after a previous call to `startPolling`.
*/
ObservableQuery.prototype.stopPolling = function () {
this.options.pollInterval = 0;
this.updatePolling();
};
// Update options.fetchPolicy according to options.nextFetchPolicy.
ObservableQuery.prototype.applyNextFetchPolicy = function (reason,
// It's possible to use this method to apply options.nextFetchPolicy to
// options.fetchPolicy even if options !== this.options, though that happens
// most often when the options are temporary, used for only one request and
// then thrown away, so nextFetchPolicy may not end up mattering.
options) {
if (options.nextFetchPolicy) {
var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? "cache-first" : _a, _b = options.initialFetchPolicy, initialFetchPolicy = _b === void 0 ? fetchPolicy : _b;
if (fetchPolicy === "standby") {
// Do nothing, leaving options.fetchPolicy unchanged.
}
else if (typeof options.nextFetchPolicy === "function") {
// When someone chooses "cache-and-network" or "network-only" as their
// initial FetchPolicy, they often do not want future cache updates to
// trigger unconditional network requests, which is what repeatedly
// applying the "cache-and-network" or "network-only" policies would
// seem to imply. Instead, when the cache reports an update after the
// initial network request, it may be desirable for subsequent network
// requests to be triggered only if the cache result is incomplete. To
// that end, the options.nextFetchPolicy option provides an easy way to
// update options.fetchPolicy after the initial network request, without
// having to call observableQuery.setOptions.
options.fetchPolicy = options.nextFetchPolicy(fetchPolicy, {
reason: reason,
options: options,
observable: this,
initialFetchPolicy: initialFetchPolicy,
});
}
else if (reason === "variables-changed") {
options.fetchPolicy = initialFetchPolicy;
}
else {
options.fetchPolicy = options.nextFetchPolicy;
}
}
return options.fetchPolicy;
};
ObservableQuery.prototype.fetch = function (options, newNetworkStatus, query) {
// TODO Make sure we update the networkStatus (and infer fetchVariables)
// before actually committing to the fetch.
this.queryManager.setObservableQuery(this);
return this.queryManager["fetchConcastWithInfo"](this.queryId, options, newNetworkStatus, query);
};
// Turns polling on or off based on this.options.pollInterval.
ObservableQuery.prototype.updatePolling = function () {
var _this = this;
// Avoid polling in SSR mode
if (this.queryManager.ssrMode) {
return;
}
var _a = this, pollingInfo = _a.pollingInfo, pollInterval = _a.options.pollInterval;
if (!pollInterval) {
if (pollingInfo) {
clearTimeout(pollingInfo.timeout);
delete this.pollingInfo;
}
return;
}
if (pollingInfo && pollingInfo.interval === pollInterval) {
return;
}
invariant(pollInterval, 22);
var info = pollingInfo || (this.pollingInfo = {});
info.interval = pollInterval;
var maybeFetch = function () {
var _a, _b;
if (_this.pollingInfo) {
if (!isNetworkRequestInFlight(_this.queryInfo.networkStatus) &&
!((_b = (_a = _this.options).skipPollAttempt) === null || _b === void 0 ? void 0 : _b.call(_a))) {
_this.reobserve({
// Most fetchPolicy options don't make sense to use in a polling context, as
// users wouldn't want to be polling the cache directly. However, network-only and
// no-cache are both useful for when the user wants to control whether or not the
// polled results are written to the cache.
fetchPolicy: _this.options.initialFetchPolicy === "no-cache" ?
"no-cache"
: "network-only",
}, NetworkStatus.poll).then(poll, poll);
}
else {
poll();
}
}
};
var poll = function () {
var info = _this.pollingInfo;
if (info) {
clearTimeout(info.timeout);
info.timeout = setTimeout(maybeFetch, info.interval);
}
};
poll();
};
ObservableQuery.prototype.updateLastResult = function (newResult, variables) {
if (variables === void 0) { variables = this.variables; }
var error = this.getLastError();
// Preserve this.last.error unless the variables have changed.
if (error && this.last && !equal(variables, this.last.variables)) {
error = void 0;
}
return (this.last = __assign({ result: this.queryManager.assumeImmutableResults ?
newResult
: cloneDeep(newResult), variables: variables }, (error ? { error: error } : null)));
};
ObservableQuery.prototype.reobserveAsConcast = function (newOptions, newNetworkStatus) {
var _this = this;
this.isTornDown = false;
var useDisposableConcast =
// Refetching uses a disposable Concast to allow refetches using different
// options/variables, without permanently altering the options of the
// original ObservableQuery.
newNetworkStatus === NetworkStatus.refetch ||
// The fetchMore method does not actually call the reobserve method, but,
// if it did, it would definitely use a disposable Concast.
newNetworkStatus === NetworkStatus.fetchMore ||
// Polling uses a disposable Concast so the polling options (which force
// fetchPolicy to be "network-only" or "no-cache") won't override the original options.
newNetworkStatus === NetworkStatus.poll;
// Save the old variables, since Object.assign may modify them below.
var oldVariables = this.options.variables;
var oldFetchPolicy = this.options.fetchPolicy;
var mergedOptions = compact(this.options, newOptions || {});
var options = useDisposableConcast ?
// Disposable Concast fetches receive a shallow copy of this.options
// (merged with newOptions), leaving this.options unmodified.
mergedOptions
: assign(this.options, mergedOptions);
// Don't update options.query with the transformed query to avoid
// overwriting this.options.query when we aren't using a disposable concast.
// We want to ensure we can re-run the custom document transforms the next
// time a request is made against the original query.
var query = this.transformDocument(options.query);
this.lastQuery = query;
if (!useDisposableConcast) {
// We can skip calling updatePolling if we're not changing this.options.
this.updatePolling();
// Reset options.fetchPolicy to its original value when variables change,
// unless a new fetchPolicy was provided by newOptions.
if (newOptions &&
newOptions.variables &&
!equal(newOptions.variables, oldVariables) &&
// Don't mess with the fetchPolicy if it's currently "standby".
options.fetchPolicy !== "standby" &&
// If we're changing the fetchPolicy anyway, don't try to change it here
// using applyNextFetchPolicy. The explicit options.fetchPolicy wins.
options.fetchPolicy === oldFetchPolicy) {
this.applyNextFetchPolicy("variables-changed", options);
if (newNetworkStatus === void 0) {
newNetworkStatus = NetworkStatus.setVariables;
}
}
}
this.waitForOwnResult && (this.waitForOwnResult = skipCacheDataFor(options.fetchPolicy));
var finishWaitingForOwnResult = function () {
if (_this.concast === concast) {
_this.waitForOwnResult = false;
}
};
var variables = options.variables && __assign({}, options.variables);
var _a = this.fetch(options, newNetworkStatus, query), concast = _a.concast, fromLink = _a.fromLink;
var observer = {
next: function (result) {
if (equal(_this.variables, variables)) {
finishWaitingForOwnResult();
_this.reportResult(result, variables);
}
},
error: function (error) {
if (equal(_this.variables, variables)) {
finishWaitingForOwnResult();
_this.reportError(error, variables);
}
},
};
if (!useDisposableConcast && (fromLink || !this.concast)) {
// We use the {add,remove}Observer methods directly to avoid wrapping
// observer with an unnecessary SubscriptionObserver object.
if (this.concast && this.observer) {
this.concast.removeObserver(this.observer);
}
this.concast = concast;
this.observer = observer;
}
concast.addObserver(observer);
return concast;
};
ObservableQuery.prototype.reobserve = function (newOptions, newNetworkStatus) {
return this.reobserveAsConcast(newOptions, newNetworkStatus)
.promise;
};
ObservableQuery.prototype.resubscribeAfterError = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
// If `lastError` is set in the current when the subscription is re-created,
// the subscription will immediately receive the error, which will
// cause it to terminate again. To avoid this, we first clear
// the last error/result from the `observableQuery` before re-starting
// the subscription, and restore the last value afterwards so that the
// subscription has a chance to stay open.
var last = this.last;
this.resetLastResults();
var subscription = this.subscribe.apply(this, args);
this.last = last;
return subscription;
};
// (Re)deliver the current result to this.observers without applying fetch
// policies or making network requests.
ObservableQuery.prototype.observe = function () {
this.reportResult(
// Passing false is important so that this.getCurrentResult doesn't
// save the fetchMore result as this.lastResult, causing it to be
// ignored due to the this.isDifferentFromLastResult check in
// this.reportResult.
this.getCurrentResult(false), this.variables);
};
ObservableQuery.prototype.reportResult = function (result, variables) {
var lastError = this.getLastError();
var isDifferent = this.isDifferentFromLastResult(result, variables);
// Update the last result even when isDifferentFromLastResult returns false,
// because the query may be using the @nonreactive directive, and we want to
// save the the latest version of any nonreactive subtrees (in case
// getCurrentResult is called), even though we skip broadcasting changes.
if (lastError || !result.partial || this.options.returnPartialData) {
this.updateLastResult(result, variables);
}
if (lastError || isDifferent) {
iterateObserversSafely(this.observers, "next", result);
}
};
ObservableQuery.prototype.reportError = function (error, variables) {
// Since we don't get the current result on errors, only the error, we
// must mirror the updates that occur in QueryStore.markQueryError here
var errorResult = __assign(__assign({}, this.getLastResult()), { error: error, errors: error.graphQLErrors, networkStatus: NetworkStatus.error, loading: false });
this.updateLastResult(errorResult, variables);
iterateObserversSafely(this.observers, "error", (this.last.error = error));
};
ObservableQuery.prototype.hasObservers = function () {
return this.observers.size > 0;
};
ObservableQuery.prototype.tearDownQuery = function () {
if (this.isTornDown)
return;
if (this.concast && this.observer) {
this.concast.removeObserver(this.observer);
delete this.concast;
delete this.observer;
}
this.stopPolling();
// stop all active GraphQL subscriptions
this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
this.subscriptions.clear();
this.queryManager.stopQuery(this.queryId);
this.observers.clear();
this.isTornDown = true;
};
ObservableQuery.prototype.transformDocument = function (document) {
return this.queryManager.transform(document);
};
return ObservableQuery;
}(Observable));
export { ObservableQuery };
// Necessary because the ObservableQuery constructor has a different
// signature than the Observable constructor.
fixObservableSubclass(ObservableQuery);
// Reobserve with fetchPolicy effectively set to "cache-first", triggering
// delivery of any new data from the cache, possibly falling back to the network
// if any cache data are missing. This allows _complete_ cache results to be
// delivered without also kicking off unnecessary network requests when
// this.options.fetchPolicy is "cache-and-network" or "network-only". When
// this.options.fetchPolicy is any other policy ("cache-first", "cache-only",
// "standby", or "no-cache"), we call this.reobserve() as usual.
export function reobserveCacheFirst(obsQuery) {
var _a = obsQuery.options, fetchPolicy = _a.fetchPolicy, nextFetchPolicy = _a.nextFetchPolicy;
if (fetchPolicy === "cache-and-network" || fetchPolicy === "network-only") {
return obsQuery.reobserve({
fetchPolicy: "cache-first",
// Use a temporary nextFetchPolicy function that replaces itself with the
// previous nextFetchPolicy value and returns the original fetchPolicy.
nextFetchPolicy: function (currentFetchPolicy, context) {
// Replace this nextFetchPolicy function in the options object with the
// original this.options.nextFetchPolicy value.
this.nextFetchPolicy = nextFetchPolicy;
// If the original nextFetchPolicy value was a function, give it a
// chance to decide what happens here.
if (typeof this.nextFetchPolicy === "function") {
return this.nextFetchPolicy(currentFetchPolicy, context);
}
// Otherwise go back to the original this.options.fetchPolicy.
return fetchPolicy;
},
});
}
return obsQuery.reobserve();
}
function defaultSubscriptionObserverErrorCallback(error) {
globalThis.__DEV__ !== false && invariant.error(23, error.message, error.stack);
}
export function logMissingFieldErrors(missing) {
if (globalThis.__DEV__ !== false && missing) {
globalThis.__DEV__ !== false && invariant.debug(24, missing);
}
}
function skipCacheDataFor(fetchPolicy /* `undefined` would mean `"cache-first"` */) {
return (fetchPolicy === "network-only" ||
fetchPolicy === "no-cache" ||
fetchPolicy === "standby");
}
//# sourceMappingURL=ObservableQuery.js.map
webpack://frontend-tpt/../../node_modules/graphql/language/predicates.mjs
import { Kind } from "./kinds.mjs";
export function isDefinitionNode(node) {
return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node);
}
export function isExecutableDefinitionNode(node) {
return node.kind === Kind.OPERATION_DEFINITION || node.kind === Kind.FRAGMENT_DEFINITION;
}
export function isSelectionNode(node) {
return node.kind === Kind.FIELD || node.kind === Kind.FRAGMENT_SPREAD || node.kind === Kind.INLINE_FRAGMENT;
}
export function isValueNode(node) {
return node.kind === Kind.VARIABLE || node.kind === Kind.INT || node.kind === Kind.FLOAT || node.kind === Kind.STRING || node.kind === Kind.BOOLEAN || node.kind === Kind.NULL || node.kind === Kind.ENUM || node.kind === Kind.LIST || node.kind === Kind.OBJECT;
}
export function isTypeNode(node) {
return node.kind === Kind.NAMED_TYPE || node.kind === Kind.LIST_TYPE || node.kind === Kind.NON_NULL_TYPE;
}
export function isTypeSystemDefinitionNode(node) {
return node.kind === Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === Kind.DIRECTIVE_DEFINITION;
}
export function isTypeDefinitionNode(node) {
return node.kind === Kind.SCALAR_TYPE_DEFINITION || node.kind === Kind.OBJECT_TYPE_DEFINITION || node.kind === Kind.INTERFACE_TYPE_DEFINITION || node.kind === Kind.UNION_TYPE_DEFINITION || node.kind === Kind.ENUM_TYPE_DEFINITION || node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION;
}
export function isTypeSystemExtensionNode(node) {
return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node);
}
export function isTypeExtensionNode(node) {
return node.kind === Kind.SCALAR_TYPE_EXTENSION || node.kind === Kind.OBJECT_TYPE_EXTENSION || node.kind === Kind.INTERFACE_TYPE_EXTENSION || node.kind === Kind.UNION_TYPE_EXTENSION || node.kind === Kind.ENUM_TYPE_EXTENSION || node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION;
}
webpack://frontend-tpt/../../node_modules/@apollo/client/core/LocalState.js
import { __assign, __awaiter, __generator } from "tslib";
import { invariant } from "../utilities/globals/index.js";
import { visit, BREAK, isSelectionNode } from "graphql";
import { argumentsObjectFromField, buildQueryFromSelectionSet, createFragmentMap, getFragmentDefinitions, getMainDefinition, hasDirectives, isField, isInlineFragment, mergeDeep, mergeDeepArray, removeClientSetsFromDocument, resultKeyNameFromField, shouldInclude, } from "../utilities/index.js";
import { cacheSlot } from "../cache/index.js";
var LocalState = /** @class */ (function () {
function LocalState(_a) {
var cache = _a.cache, client = _a.client, resolvers = _a.resolvers, fragmentMatcher = _a.fragmentMatcher;
this.selectionsToResolveCache = new WeakMap();
this.cache = cache;
if (client) {
this.client = client;
}
if (resolvers) {
this.addResolvers(resolvers);
}
if (fragmentMatcher) {
this.setFragmentMatcher(fragmentMatcher);
}
}
LocalState.prototype.addResolvers = function (resolvers) {
var _this = this;
this.resolvers = this.resolvers || {};
if (Array.isArray(resolvers)) {
resolvers.forEach(function (resolverGroup) {
_this.resolvers = mergeDeep(_this.resolvers, resolverGroup);
});
}
else {
this.resolvers = mergeDeep(this.resolvers, resolvers);
}
};
LocalState.prototype.setResolvers = function (resolvers) {
this.resolvers = {};
this.addResolvers(resolvers);
};
LocalState.prototype.getResolvers = function () {
return this.resolvers || {};
};
// Run local client resolvers against the incoming query and remote data.
// Locally resolved field values are merged with the incoming remote data,
// and returned. Note that locally resolved fields will overwrite
// remote data using the same field name.
LocalState.prototype.runResolvers = function (_a) {
var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b;
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_c) {
if (document) {
return [2 /*return*/, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (__assign(__assign({}, remoteResult), { data: localResult.result })); })];
}
return [2 /*return*/, remoteResult];
});
});
};
LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) {
this.fragmentMatcher = fragmentMatcher;
};
LocalState.prototype.getFragmentMatcher = function () {
return this.fragmentMatcher;
};
// Client queries contain everything in the incoming document (if a @client
// directive is found).
LocalState.prototype.clientQuery = function (document) {
if (hasDirectives(["client"], document)) {
if (this.resolvers) {
return document;
}
}
return null;
};
// Server queries are stripped of all @client based selection sets.
LocalState.prototype.serverQuery = function (document) {
return removeClientSetsFromDocument(document);
};
LocalState.prototype.prepareContext = function (context) {
var cache = this.cache;
return __assign(__assign({}, context), { cache: cache,
// Getting an entry's cache key is useful for local state resolvers.
getCacheKey: function (obj) {
return cache.identify(obj);
} });
};
// To support `@client @export(as: "someVar")` syntax, we'll first resolve
// @client @export fields locally, then pass the resolved values back to be
// used alongside the original operation variables.
LocalState.prototype.addExportedVariables = function (document, variables, context) {
if (variables === void 0) { variables = {}; }
if (context === void 0) { context = {}; }
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
if (document) {
return [2 /*return*/, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (__assign(__assign({}, variables), data.exportedVariables)); })];
}
return [2 /*return*/, __assign({}, variables)];
});
});
};
LocalState.prototype.shouldForceResolvers = function (document) {
var forceResolvers = false;
visit(document, {
Directive: {
enter: function (node) {
if (node.name.value === "client" && node.arguments) {
forceResolvers = node.arguments.some(function (arg) {
return arg.name.value === "always" &&
arg.value.kind === "BooleanValue" &&
arg.value.value === true;
});
if (forceResolvers) {
return BREAK;
}
}
},
},
});
return forceResolvers;
};
// Query the cache and return matching data.
LocalState.prototype.buildRootValueFromCache = function (document, variables) {
return this.cache.diff({
query: buildQueryFromSelectionSet(document),
variables: variables,
returnPartialData: true,
optimistic: false,
}).result;
};
LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) {
if (context === void 0) { context = {}; }
if (variables === void 0) { variables = {}; }
if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; }
if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; }
return __awaiter(this, void 0, void 0, function () {
var mainDefinition, fragments, fragmentMap, selectionsToResolve, definitionOperation, defaultOperationType, _a, cache, client, execContext, isClientFieldDescendant;
return __generator(this, function (_b) {
mainDefinition = getMainDefinition(document);
fragments = getFragmentDefinitions(document);
fragmentMap = createFragmentMap(fragments);
selectionsToResolve = this.collectSelectionsToResolve(mainDefinition, fragmentMap);
definitionOperation = mainDefinition.operation;
defaultOperationType = definitionOperation ?
definitionOperation.charAt(0).toUpperCase() +
definitionOperation.slice(1)
: "Query";
_a = this, cache = _a.cache, client = _a.client;
execContext = {
fragmentMap: fragmentMap,
context: __assign(__assign({}, context), { cache: cache, client: client }),
variables: variables,
fragmentMatcher: fragmentMatcher,
defaultOperationType: defaultOperationType,
exportedVariables: {},
selectionsToResolve: selectionsToResolve,
onlyRunForcedResolvers: onlyRunForcedResolvers,
};
isClientFieldDescendant = false;
return [2 /*return*/, this.resolveSelectionSet(mainDefinition.selectionSet, isClientFieldDescendant, rootValue, execContext).then(function (result) { return ({
result: result,
exportedVariables: execContext.exportedVariables,
}); })];
});
});
};
LocalState.prototype.resolveSelectionSet = function (selectionSet, isClientFieldDescendant, rootValue, execContext) {
return __awaiter(this, void 0, void 0, function () {
var fragmentMap, context, variables, resultsToMerge, execute;
var _this = this;
return __generator(this, function (_a) {
fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables;
resultsToMerge = [rootValue];
execute = function (selection) { return __awaiter(_this, void 0, void 0, function () {
var fragment, typeCondition;
return __generator(this, function (_a) {
if (!isClientFieldDescendant &&
!execContext.selectionsToResolve.has(selection)) {
// Skip selections without @client directives
// (still processing if one of the ancestors or one of the child fields has @client directive)
return [2 /*return*/];
}
if (!shouldInclude(selection, variables)) {
// Skip this entirely.
return [2 /*return*/];
}
if (isField(selection)) {
return [2 /*return*/, this.resolveField(selection, isClientFieldDescendant, rootValue, execContext).then(function (fieldResult) {
var _a;
if (typeof fieldResult !== "undefined") {
resultsToMerge.push((_a = {},
_a[resultKeyNameFromField(selection)] = fieldResult,
_a));
}
})];
}
if (isInlineFragment(selection)) {
fragment = selection;
}
else {
// This is a named fragment.
fragment = fragmentMap[selection.name.value];
invariant(fragment, 18, selection.name.value);
}
if (fragment && fragment.typeCondition) {
typeCondition = fragment.typeCondition.name.value;
if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {
return [2 /*return*/, this.resolveSelectionSet(fragment.selectionSet, isClientFieldDescendant, rootValue, execContext).then(function (fragmentResult) {
resultsToMerge.push(fragmentResult);
})];
}
}
return [2 /*return*/];
});
}); };
return [2 /*return*/, Promise.all(selectionSet.selections.map(execute)).then(function () {
return mergeDeepArray(resultsToMerge);
})];
});
});
};
LocalState.prototype.resolveField = function (field, isClientFieldDescendant, rootValue, execContext) {
return __awaiter(this, void 0, void 0, function () {
var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve;
var _this = this;
return __generator(this, function (_a) {
if (!rootValue) {
return [2 /*return*/, null];
}
variables = execContext.variables;
fieldName = field.name.value;
aliasedFieldName = resultKeyNameFromField(field);
aliasUsed = fieldName !== aliasedFieldName;
defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];
resultPromise = Promise.resolve(defaultResult);
// Usually all local resolvers are run when passing through here, but
// if we've specifically identified that we only want to run forced
// resolvers (that is, resolvers for fields marked with
// `@client(always: true)`), then we'll skip running non-forced resolvers.
if (!execContext.onlyRunForcedResolvers ||
this.shouldForceResolvers(field)) {
resolverType = rootValue.__typename || execContext.defaultOperationType;
resolverMap = this.resolvers && this.resolvers[resolverType];
if (resolverMap) {
resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];
if (resolve) {
resultPromise = Promise.resolve(
// In case the resolve function accesses reactive variables,
// set cacheSlot to the current cache instance.
cacheSlot.withValue(this.cache, resolve, [
rootValue,
argumentsObjectFromField(field, variables),
execContext.context,
{ field: field, fragmentMap: execContext.fragmentMap },
]));
}
}
}
return [2 /*return*/, resultPromise.then(function (result) {
var _a, _b;
if (result === void 0) { result = defaultResult; }
// If an @export directive is associated with the current field, store
// the `as` export variable name and current result for later use.
if (field.directives) {
field.directives.forEach(function (directive) {
if (directive.name.value === "export" && directive.arguments) {
directive.arguments.forEach(function (arg) {
if (arg.name.value === "as" && arg.value.kind === "StringValue") {
execContext.exportedVariables[arg.value.value] = result;
}
});
}
});
}
// Handle all scalar types here.
if (!field.selectionSet) {
return result;
}
// From here down, the field has a selection set, which means it's trying
// to query a GraphQLObjectType.
if (result == null) {
// Basically any field in a GraphQL response can be null, or missing
return result;
}
var isClientField = (_b = (_a = field.directives) === null || _a === void 0 ? void 0 : _a.some(function (d) { return d.name.value === "client"; })) !== null && _b !== void 0 ? _b : false;
if (Array.isArray(result)) {
return _this.resolveSubSelectedArray(field, isClientFieldDescendant || isClientField, result, execContext);
}
// Returned value is an object, and the query has a sub-selection. Recurse.
if (field.selectionSet) {
return _this.resolveSelectionSet(field.selectionSet, isClientFieldDescendant || isClientField, result, execContext);
}
})];
});
});
};
LocalState.prototype.resolveSubSelectedArray = function (field, isClientFieldDescendant, result, execContext) {
var _this = this;
return Promise.all(result.map(function (item) {
if (item === null) {
return null;
}
// This is a nested array, recurse.
if (Array.isArray(item)) {
return _this.resolveSubSelectedArray(field, isClientFieldDescendant, item, execContext);
}
// This is an object, run the selection set on it.
if (field.selectionSet) {
return _this.resolveSelectionSet(field.selectionSet, isClientFieldDescendant, item, execContext);
}
}));
};
// Collect selection nodes on paths from document root down to all @client directives.
// This function takes into account transitive fragment spreads.
// Complexity equals to a single `visit` over the full document.
LocalState.prototype.collectSelectionsToResolve = function (mainDefinition, fragmentMap) {
var isSingleASTNode = function (node) { return !Array.isArray(node); };
var selectionsToResolveCache = this.selectionsToResolveCache;
function collectByDefinition(definitionNode) {
if (!selectionsToResolveCache.has(definitionNode)) {
var matches_1 = new Set();
selectionsToResolveCache.set(definitionNode, matches_1);
visit(definitionNode, {
Directive: function (node, _, __, ___, ancestors) {
if (node.name.value === "client") {
ancestors.forEach(function (node) {
if (isSingleASTNode(node) && isSelectionNode(node)) {
matches_1.add(node);
}
});
}
},
FragmentSpread: function (spread, _, __, ___, ancestors) {
var fragment = fragmentMap[spread.name.value];
invariant(fragment, 19, spread.name.value);
var fragmentSelections = collectByDefinition(fragment);
if (fragmentSelections.size > 0) {
// Fragment for this spread contains @client directive (either directly or transitively)
// Collect selection nodes on paths from the root down to fields with the @client directive
ancestors.forEach(function (node) {
if (isSingleASTNode(node) && isSelectionNode(node)) {
matches_1.add(node);
}
});
matches_1.add(spread);
fragmentSelections.forEach(function (selection) {
matches_1.add(selection);
});
}
},
});
}
return selectionsToResolveCache.get(definitionNode);
}
return collectByDefinition(mainDefinition);
};
return LocalState;
}());
export { LocalState };
//# sourceMappingURL=LocalState.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/core/QueryInfo.js
import { __assign } from "tslib";
import { equal } from "@wry/equality";
import { DeepMerger } from "../utilities/index.js";
import { mergeIncrementalData } from "../utilities/index.js";
import { reobserveCacheFirst } from "./ObservableQuery.js";
import { isNonEmptyArray, graphQLResultHasError, canUseWeakMap, } from "../utilities/index.js";
import { NetworkStatus, isNetworkRequestInFlight } from "./networkStatus.js";
var destructiveMethodCounts = new (canUseWeakMap ? WeakMap : Map)();
function wrapDestructiveCacheMethod(cache, methodName) {
var original = cache[methodName];
if (typeof original === "function") {
// @ts-expect-error this is just too generic to be typed correctly
cache[methodName] = function () {
destructiveMethodCounts.set(cache,
// The %1e15 allows the count to wrap around to 0 safely every
// quadrillion evictions, so there's no risk of overflow. To be
// clear, this is more of a pedantic principle than something
// that matters in any conceivable practical scenario.
(destructiveMethodCounts.get(cache) + 1) % 1e15);
// @ts-expect-error this is just too generic to be typed correctly
return original.apply(this, arguments);
};
}
}
function cancelNotifyTimeout(info) {
if (info["notifyTimeout"]) {
clearTimeout(info["notifyTimeout"]);
info["notifyTimeout"] = void 0;
}
}
// A QueryInfo object represents a single query managed by the
// QueryManager, which tracks all QueryInfo objects by queryId in its
// this.queries Map. QueryInfo objects store the latest results and errors
// for the given query, and are responsible for reporting those results to
// the corresponding ObservableQuery, via the QueryInfo.notify method.
// Results are reported asynchronously whenever setDiff marks the
// QueryInfo object as dirty, though a call to the QueryManager's
// broadcastQueries method may trigger the notification before it happens
// automatically. This class used to be a simple interface type without
// any field privacy or meaningful methods, which is why it still has so
// many public fields. The effort to lock down and simplify the QueryInfo
// interface is ongoing, and further improvements are welcome.
var QueryInfo = /** @class */ (function () {
function QueryInfo(queryManager, queryId) {
if (queryId === void 0) { queryId = queryManager.generateQueryId(); }
this.queryId = queryId;
this.listeners = new Set();
this.document = null;
this.lastRequestId = 1;
this.stopped = false;
this.dirty = false;
this.observableQuery = null;
var cache = (this.cache = queryManager.cache);
// Track how often cache.evict is called, since we want eviction to
// override the feud-stopping logic in the markResult method, by
// causing shouldWrite to return true. Wrapping the cache.evict method
// is a bit of a hack, but it saves us from having to make eviction
// counting an official part of the ApolloCache API.
if (!destructiveMethodCounts.has(cache)) {
destructiveMethodCounts.set(cache, 0);
wrapDestructiveCacheMethod(cache, "evict");
wrapDestructiveCacheMethod(cache, "modify");
wrapDestructiveCacheMethod(cache, "reset");
}
}
QueryInfo.prototype.init = function (query) {
var networkStatus = query.networkStatus || NetworkStatus.loading;
if (this.variables &&
this.networkStatus !== NetworkStatus.loading &&
!equal(this.variables, query.variables)) {
networkStatus = NetworkStatus.setVariables;
}
if (!equal(query.variables, this.variables)) {
this.lastDiff = void 0;
}
Object.assign(this, {
document: query.document,
variables: query.variables,
networkError: null,
graphQLErrors: this.graphQLErrors || [],
networkStatus: networkStatus,
});
if (query.observableQuery) {
this.setObservableQuery(query.observableQuery);
}
if (query.lastRequestId) {
this.lastRequestId = query.lastRequestId;
}
return this;
};
QueryInfo.prototype.reset = function () {
cancelNotifyTimeout(this);
this.dirty = false;
};
QueryInfo.prototype.resetDiff = function () {
this.lastDiff = void 0;
};
QueryInfo.prototype.getDiff = function () {
var options = this.getDiffOptions();
if (this.lastDiff && equal(options, this.lastDiff.options)) {
return this.lastDiff.diff;
}
this.updateWatch(this.variables);
var oq = this.observableQuery;
if (oq && oq.options.fetchPolicy === "no-cache") {
return { complete: false };
}
var diff = this.cache.diff(options);
this.updateLastDiff(diff, options);
return diff;
};
QueryInfo.prototype.updateLastDiff = function (diff, options) {
this.lastDiff =
diff ?
{
diff: diff,
options: options || this.getDiffOptions(),
}
: void 0;
};
QueryInfo.prototype.getDiffOptions = function (variables) {
var _a;
if (variables === void 0) { variables = this.variables; }
return {
query: this.document,
variables: variables,
returnPartialData: true,
optimistic: true,
canonizeResults: (_a = this.observableQuery) === null || _a === void 0 ? void 0 : _a.options.canonizeResults,
};
};
QueryInfo.prototype.setDiff = function (diff) {
var _this = this;
var oldDiff = this.lastDiff && this.lastDiff.diff;
this.updateLastDiff(diff);
if (!this.dirty && !equal(oldDiff && oldDiff.result, diff && diff.result)) {
this.dirty = true;
if (!this.notifyTimeout) {
this.notifyTimeout = setTimeout(function () { return _this.notify(); }, 0);
}
}
};
QueryInfo.prototype.setObservableQuery = function (oq) {
var _this = this;
if (oq === this.observableQuery)
return;
if (this.oqListener) {
this.listeners.delete(this.oqListener);
}
this.observableQuery = oq;
if (oq) {
oq["queryInfo"] = this;
this.listeners.add((this.oqListener = function () {
var diff = _this.getDiff();
if (diff.fromOptimisticTransaction) {
// If this diff came from an optimistic transaction, deliver the
// current cache data to the ObservableQuery, but don't perform a
// reobservation, since oq.reobserveCacheFirst might make a network
// request, and we never want to trigger network requests in the
// middle of optimistic updates.
oq["observe"]();
}
else {
// Otherwise, make the ObservableQuery "reobserve" the latest data
// using a temporary fetch policy of "cache-first", so complete cache
// results have a chance to be delivered without triggering additional
// network requests, even when options.fetchPolicy is "network-only"
// or "cache-and-network". All other fetch policies are preserved by
// this method, and are handled by calling oq.reobserve(). If this
// reobservation is spurious, isDifferentFromLastResult still has a
// chance to catch it before delivery to ObservableQuery subscribers.
reobserveCacheFirst(oq);
}
}));
}
else {
delete this.oqListener;
}
};
QueryInfo.prototype.notify = function () {
var _this = this;
cancelNotifyTimeout(this);
if (this.shouldNotify()) {
this.listeners.forEach(function (listener) { return listener(_this); });
}
this.dirty = false;
};
QueryInfo.prototype.shouldNotify = function () {
if (!this.dirty || !this.listeners.size) {
return false;
}
if (isNetworkRequestInFlight(this.networkStatus) && this.observableQuery) {
var fetchPolicy = this.observableQuery.options.fetchPolicy;
if (fetchPolicy !== "cache-only" && fetchPolicy !== "cache-and-network") {
return false;
}
}
return true;
};
QueryInfo.prototype.stop = function () {
if (!this.stopped) {
this.stopped = true;
// Cancel the pending notify timeout
this.reset();
this.cancel();
// Revert back to the no-op version of cancel inherited from
// QueryInfo.prototype.
this.cancel = QueryInfo.prototype.cancel;
var oq = this.observableQuery;
if (oq)
oq.stopPolling();
}
};
// This method is a no-op by default, until/unless overridden by the
// updateWatch method.
QueryInfo.prototype.cancel = function () { };
QueryInfo.prototype.updateWatch = function (variables) {
var _this = this;
if (variables === void 0) { variables = this.variables; }
var oq = this.observableQuery;
if (oq && oq.options.fetchPolicy === "no-cache") {
return;
}
var watchOptions = __assign(__assign({}, this.getDiffOptions(variables)), { watcher: this, callback: function (diff) { return _this.setDiff(diff); } });
if (!this.lastWatch || !equal(watchOptions, this.lastWatch)) {
this.cancel();
this.cancel = this.cache.watch((this.lastWatch = watchOptions));
}
};
QueryInfo.prototype.resetLastWrite = function () {
this.lastWrite = void 0;
};
QueryInfo.prototype.shouldWrite = function (result, variables) {
var lastWrite = this.lastWrite;
return !(lastWrite &&
// If cache.evict has been called since the last time we wrote this
// data into the cache, there's a chance writing this result into
// the cache will repair what was evicted.
lastWrite.dmCount === destructiveMethodCounts.get(this.cache) &&
equal(variables, lastWrite.variables) &&
equal(result.data, lastWrite.result.data));
};
QueryInfo.prototype.markResult = function (result, document, options, cacheWriteBehavior) {
var _this = this;
var merger = new DeepMerger();
var graphQLErrors = isNonEmptyArray(result.errors) ? result.errors.slice(0) : [];
// Cancel the pending notify timeout (if it exists) to prevent extraneous network
// requests. To allow future notify timeouts, diff and dirty are reset as well.
this.reset();
if ("incremental" in result && isNonEmptyArray(result.incremental)) {
var mergedData = mergeIncrementalData(this.getDiff().result, result);
result.data = mergedData;
// Detect the first chunk of a deferred query and merge it with existing
// cache data. This ensures a `cache-first` fetch policy that returns
// partial cache data or a `cache-and-network` fetch policy that already
// has full data in the cache does not complain when trying to merge the
// initial deferred server data with existing cache data.
}
else if ("hasNext" in result && result.hasNext) {
var diff = this.getDiff();
result.data = merger.merge(diff.result, result.data);
}
this.graphQLErrors = graphQLErrors;
if (options.fetchPolicy === "no-cache") {
this.updateLastDiff({ result: result.data, complete: true }, this.getDiffOptions(options.variables));
}
else if (cacheWriteBehavior !== 0 /* CacheWriteBehavior.FORBID */) {
if (shouldWriteResult(result, options.errorPolicy)) {
// Using a transaction here so we have a chance to read the result
// back from the cache before the watch callback fires as a result
// of writeQuery, so we can store the new diff quietly and ignore
// it when we receive it redundantly from the watch callback.
this.cache.performTransaction(function (cache) {
if (_this.shouldWrite(result, options.variables)) {
cache.writeQuery({
query: document,
data: result.data,
variables: options.variables,
overwrite: cacheWriteBehavior === 1 /* CacheWriteBehavior.OVERWRITE */,
});
_this.lastWrite = {
result: result,
variables: options.variables,
dmCount: destructiveMethodCounts.get(_this.cache),
};
}
else {
// If result is the same as the last result we received from
// the network (and the variables match too), avoid writing
// result into the cache again. The wisdom of skipping this
// cache write is far from obvious, since any cache write
// could be the one that puts the cache back into a desired
// state, fixing corruption or missing data. However, if we
// always write every network result into the cache, we enable
// feuds between queries competing to update the same data in
// incompatible ways, which can lead to an endless cycle of
// cache broadcasts and useless network requests. As with any
// feud, eventually one side must step back from the brink,
// letting the other side(s) have the last word(s). There may
// be other points where we could break this cycle, such as
// silencing the broadcast for cache.writeQuery (not a good
// idea, since it just delays the feud a bit) or somehow
// avoiding the network request that just happened (also bad,
// because the server could return useful new data). All
// options considered, skipping this cache write seems to be
// the least damaging place to break the cycle, because it
// reflects the intuition that we recently wrote this exact
// result into the cache, so the cache *should* already/still
// contain this data. If some other query has clobbered that
// data in the meantime, that's too bad, but there will be no
// winners if every query blindly reverts to its own version
// of the data. This approach also gives the network a chance
// to return new data, which will be written into the cache as
// usual, notifying only those queries that are directly
// affected by the cache updates, as usual. In the future, an
// even more sophisticated cache could perhaps prevent or
// mitigate the clobbering somehow, but that would make this
// particular cache write even less important, and thus
// skipping it would be even safer than it is today.
if (_this.lastDiff && _this.lastDiff.diff.complete) {
// Reuse data from the last good (complete) diff that we
// received, when possible.
result.data = _this.lastDiff.diff.result;
return;
}
// If the previous this.diff was incomplete, fall through to
// re-reading the latest data with cache.diff, below.
}
var diffOptions = _this.getDiffOptions(options.variables);
var diff = cache.diff(diffOptions);
// In case the QueryManager stops this QueryInfo before its
// results are delivered, it's important to avoid restarting the
// cache watch when markResult is called. We also avoid updating
// the watch if we are writing a result that doesn't match the current
// variables to avoid race conditions from broadcasting the wrong
// result.
if (!_this.stopped && equal(_this.variables, options.variables)) {
// Any time we're about to update this.diff, we need to make
// sure we've started watching the cache.
_this.updateWatch(options.variables);
}
// If we're allowed to write to the cache, and we can read a
// complete result from the cache, update result.data to be the
// result from the cache, rather than the raw network result.
// Set without setDiff to avoid triggering a notify call, since
// we have other ways of notifying for this result.
_this.updateLastDiff(diff, diffOptions);
if (diff.complete) {
result.data = diff.result;
}
});
}
else {
this.lastWrite = void 0;
}
}
};
QueryInfo.prototype.markReady = function () {
this.networkError = null;
return (this.networkStatus = NetworkStatus.ready);
};
QueryInfo.prototype.markError = function (error) {
this.networkStatus = NetworkStatus.error;
this.lastWrite = void 0;
this.reset();
if (error.graphQLErrors) {
this.graphQLErrors = error.graphQLErrors;
}
if (error.networkError) {
this.networkError = error.networkError;
}
return error;
};
return QueryInfo;
}());
export { QueryInfo };
export function shouldWriteResult(result, errorPolicy) {
if (errorPolicy === void 0) { errorPolicy = "none"; }
var ignoreErrors = errorPolicy === "ignore" || errorPolicy === "all";
var writeWithErrors = !graphQLResultHasError(result);
if (!writeWithErrors && ignoreErrors && result.data) {
writeWithErrors = true;
}
return writeWithErrors;
}
//# sourceMappingURL=QueryInfo.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/core/QueryManager.js
import { __assign, __awaiter, __generator } from "tslib";
import { invariant, newInvariantError } from "../utilities/globals/index.js";
import { equal } from "@wry/equality";
import { execute } from "../link/core/index.js";
import { hasDirectives, isExecutionPatchIncrementalResult, isExecutionPatchResult, removeDirectivesFromDocument, } from "../utilities/index.js";
import { canonicalStringify } from "../cache/index.js";
import { getDefaultValues, getOperationDefinition, getOperationName, hasClientExports, graphQLResultHasError, getGraphQLErrorsFromResult, Observable, asyncMap, isNonEmptyArray, Concast, makeUniqueId, isDocumentNode, isNonNullObject, DocumentTransform, } from "../utilities/index.js";
import { mergeIncrementalData } from "../utilities/common/incrementalResult.js";
import { ApolloError, isApolloError, graphQLResultHasProtocolErrors, } from "../errors/index.js";
import { ObservableQuery, logMissingFieldErrors } from "./ObservableQuery.js";
import { NetworkStatus, isNetworkRequestInFlight } from "./networkStatus.js";
import { LocalState } from "./LocalState.js";
import { QueryInfo, shouldWriteResult, } from "./QueryInfo.js";
import { PROTOCOL_ERRORS_SYMBOL } from "../errors/index.js";
import { print } from "../utilities/index.js";
var hasOwnProperty = Object.prototype.hasOwnProperty;
var IGNORE = Object.create(null);
import { Trie } from "@wry/trie";
import { AutoCleanedWeakCache, cacheSizes } from "../utilities/index.js";
var QueryManager = /** @class */ (function () {
function QueryManager(_a) {
var cache = _a.cache, link = _a.link, defaultOptions = _a.defaultOptions, documentTransform = _a.documentTransform, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, onBroadcast = _a.onBroadcast, _c = _a.ssrMode, ssrMode = _c === void 0 ? false : _c, _d = _a.clientAwareness, clientAwareness = _d === void 0 ? {} : _d, localState = _a.localState, _e = _a.assumeImmutableResults, assumeImmutableResults = _e === void 0 ? !!cache.assumeImmutableResults : _e, defaultContext = _a.defaultContext;
var _this = this;
this.clientAwareness = {};
// All the queries that the QueryManager is currently managing (not
// including mutations and subscriptions).
this.queries = new Map();
// Maps from queryId strings to Promise rejection functions for
// currently active queries and fetches.
// Use protected instead of private field so
// @apollo/experimental-nextjs-app-support can access type info.
this.fetchCancelFns = new Map();
this.transformCache = new AutoCleanedWeakCache(cacheSizes["queryManager.getDocumentInfo"] ||
2000 /* defaultCacheSizes["queryManager.getDocumentInfo"] */);
this.queryIdCounter = 1;
this.requestIdCounter = 1;
this.mutationIdCounter = 1;
// Use protected instead of private field so
// @apollo/experimental-nextjs-app-support can access type info.
this.inFlightLinkObservables = new Trie(false);
var defaultDocumentTransform = new DocumentTransform(function (document) { return _this.cache.transformDocument(document); },
// Allow the apollo cache to manage its own transform caches
{ cache: false });
this.cache = cache;
this.link = link;
this.defaultOptions = defaultOptions || Object.create(null);
this.queryDeduplication = queryDeduplication;
this.clientAwareness = clientAwareness;
this.localState = localState || new LocalState({ cache: cache });
this.ssrMode = ssrMode;
this.assumeImmutableResults = assumeImmutableResults;
this.documentTransform =
documentTransform ?
defaultDocumentTransform
.concat(documentTransform)
// The custom document transform may add new fragment spreads or new
// field selections, so we want to give the cache a chance to run
// again. For example, the InMemoryCache adds __typename to field
// selections and fragments from the fragment registry.
.concat(defaultDocumentTransform)
: defaultDocumentTransform;
this.defaultContext = defaultContext || Object.create(null);
if ((this.onBroadcast = onBroadcast)) {
this.mutationStore = Object.create(null);
}
}
/**
* Call this method to terminate any active query processes, making it safe
* to dispose of this QueryManager instance.
*/
QueryManager.prototype.stop = function () {
var _this = this;
this.queries.forEach(function (_info, queryId) {
_this.stopQueryNoBroadcast(queryId);
});
this.cancelPendingFetches(newInvariantError(25));
};
QueryManager.prototype.cancelPendingFetches = function (error) {
this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });
this.fetchCancelFns.clear();
};
QueryManager.prototype.mutate = function (_a) {
var _b, _c;
var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueries = _a.updateQueries, _d = _a.refetchQueries, refetchQueries = _d === void 0 ? [] : _d, _e = _a.awaitRefetchQueries, awaitRefetchQueries = _e === void 0 ? false : _e, updateWithProxyFn = _a.update, onQueryUpdated = _a.onQueryUpdated, _f = _a.fetchPolicy, fetchPolicy = _f === void 0 ? ((_b = this.defaultOptions.mutate) === null || _b === void 0 ? void 0 : _b.fetchPolicy) || "network-only" : _f, _g = _a.errorPolicy, errorPolicy = _g === void 0 ? ((_c = this.defaultOptions.mutate) === null || _c === void 0 ? void 0 : _c.errorPolicy) || "none" : _g, keepRootFields = _a.keepRootFields, context = _a.context;
return __awaiter(this, void 0, void 0, function () {
var mutationId, hasClientExports, mutationStoreValue, isOptimistic, self;
return __generator(this, function (_h) {
switch (_h.label) {
case 0:
invariant(mutation, 26);
invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 27);
mutationId = this.generateMutationId();
mutation = this.cache.transformForLink(this.transform(mutation));
hasClientExports = this.getDocumentInfo(mutation).hasClientExports;
variables = this.getVariables(mutation, variables);
if (!hasClientExports) return [3 /*break*/, 2];
return [4 /*yield*/, this.localState.addExportedVariables(mutation, variables, context)];
case 1:
variables = (_h.sent());
_h.label = 2;
case 2:
mutationStoreValue = this.mutationStore &&
(this.mutationStore[mutationId] = {
mutation: mutation,
variables: variables,
loading: true,
error: null,
});
isOptimistic = optimisticResponse &&
this.markMutationOptimistic(optimisticResponse, {
mutationId: mutationId,
document: mutation,
variables: variables,
fetchPolicy: fetchPolicy,
errorPolicy: errorPolicy,
context: context,
updateQueries: updateQueries,
update: updateWithProxyFn,
keepRootFields: keepRootFields,
});
this.broadcastQueries();
self = this;
return [2 /*return*/, new Promise(function (resolve, reject) {
return asyncMap(self.getObservableFromLink(mutation, __assign(__assign({}, context), { optimisticResponse: isOptimistic ? optimisticResponse : void 0 }), variables, false), function (result) {
if (graphQLResultHasError(result) && errorPolicy === "none") {
throw new ApolloError({
graphQLErrors: getGraphQLErrorsFromResult(result),
});
}
if (mutationStoreValue) {
mutationStoreValue.loading = false;
mutationStoreValue.error = null;
}
var storeResult = __assign({}, result);
if (typeof refetchQueries === "function") {
refetchQueries = refetchQueries(storeResult);
}
if (errorPolicy === "ignore" && graphQLResultHasError(storeResult)) {
delete storeResult.errors;
}
return self.markMutationResult({
mutationId: mutationId,
result: storeResult,
document: mutation,
variables: variables,
fetchPolicy: fetchPolicy,
errorPolicy: errorPolicy,
context: context,
update: updateWithProxyFn,
updateQueries: updateQueries,
awaitRefetchQueries: awaitRefetchQueries,
refetchQueries: refetchQueries,
removeOptimistic: isOptimistic ? mutationId : void 0,
onQueryUpdated: onQueryUpdated,
keepRootFields: keepRootFields,
});
}).subscribe({
next: function (storeResult) {
self.broadcastQueries();
// Since mutations might receive multiple payloads from the
// ApolloLink chain (e.g. when used with @defer),
// we resolve with a SingleExecutionResult or after the final
// ExecutionPatchResult has arrived and we have assembled the
// multipart response into a single result.
if (!("hasNext" in storeResult) || storeResult.hasNext === false) {
resolve(storeResult);
}
},
error: function (err) {
if (mutationStoreValue) {
mutationStoreValue.loading = false;
mutationStoreValue.error = err;
}
if (isOptimistic) {
self.cache.removeOptimistic(mutationId);
}
self.broadcastQueries();
reject(err instanceof ApolloError ? err : (new ApolloError({
networkError: err,
})));
},
});
})];
}
});
});
};
QueryManager.prototype.markMutationResult = function (mutation, cache) {
var _this = this;
if (cache === void 0) { cache = this.cache; }
var result = mutation.result;
var cacheWrites = [];
var skipCache = mutation.fetchPolicy === "no-cache";
if (!skipCache && shouldWriteResult(result, mutation.errorPolicy)) {
if (!isExecutionPatchIncrementalResult(result)) {
cacheWrites.push({
result: result.data,
dataId: "ROOT_MUTATION",
query: mutation.document,
variables: mutation.variables,
});
}
if (isExecutionPatchIncrementalResult(result) &&
isNonEmptyArray(result.incremental)) {
var diff = cache.diff({
id: "ROOT_MUTATION",
// The cache complains if passed a mutation where it expects a
// query, so we transform mutations and subscriptions to queries
// (only once, thanks to this.transformCache).
query: this.getDocumentInfo(mutation.document).asQuery,
variables: mutation.variables,
optimistic: false,
returnPartialData: true,
});
var mergedData = void 0;
if (diff.result) {
mergedData = mergeIncrementalData(diff.result, result);
}
if (typeof mergedData !== "undefined") {
// cast the ExecutionPatchResult to FetchResult here since
// ExecutionPatchResult never has `data` when returned from the server
result.data = mergedData;
cacheWrites.push({
result: mergedData,
dataId: "ROOT_MUTATION",
query: mutation.document,
variables: mutation.variables,
});
}
}
var updateQueries_1 = mutation.updateQueries;
if (updateQueries_1) {
this.queries.forEach(function (_a, queryId) {
var observableQuery = _a.observableQuery;
var queryName = observableQuery && observableQuery.queryName;
if (!queryName || !hasOwnProperty.call(updateQueries_1, queryName)) {
return;
}
var updater = updateQueries_1[queryName];
var _b = _this.queries.get(queryId), document = _b.document, variables = _b.variables;
// Read the current query result from the store.
var _c = cache.diff({
query: document,
variables: variables,
returnPartialData: true,
optimistic: false,
}), currentQueryResult = _c.result, complete = _c.complete;
if (complete && currentQueryResult) {
// Run our reducer using the current query result and the mutation result.
var nextQueryResult = updater(currentQueryResult, {
mutationResult: result,
queryName: (document && getOperationName(document)) || void 0,
queryVariables: variables,
});
// Write the modified result back into the store if we got a new result.
if (nextQueryResult) {
cacheWrites.push({
result: nextQueryResult,
dataId: "ROOT_QUERY",
query: document,
variables: variables,
});
}
}
});
}
}
if (cacheWrites.length > 0 ||
(mutation.refetchQueries || "").length > 0 ||
mutation.update ||
mutation.onQueryUpdated ||
mutation.removeOptimistic) {
var results_1 = [];
this.refetchQueries({
updateCache: function (cache) {
if (!skipCache) {
cacheWrites.forEach(function (write) { return cache.write(write); });
}
// If the mutation has some writes associated with it then we need to
// apply those writes to the store by running this reducer again with
// a write action.
var update = mutation.update;
// Determine whether result is a SingleExecutionResult,
// or the final ExecutionPatchResult.
var isFinalResult = !isExecutionPatchResult(result) ||
(isExecutionPatchIncrementalResult(result) && !result.hasNext);
if (update) {
if (!skipCache) {
// Re-read the ROOT_MUTATION data we just wrote into the cache
// (the first cache.write call in the cacheWrites.forEach loop
// above), so field read functions have a chance to run for
// fields within mutation result objects.
var diff = cache.diff({
id: "ROOT_MUTATION",
// The cache complains if passed a mutation where it expects a
// query, so we transform mutations and subscriptions to queries
// (only once, thanks to this.transformCache).
query: _this.getDocumentInfo(mutation.document).asQuery,
variables: mutation.variables,
optimistic: false,
returnPartialData: true,
});
if (diff.complete) {
result = __assign(__assign({}, result), { data: diff.result });
if ("incremental" in result) {
delete result.incremental;
}
if ("hasNext" in result) {
delete result.hasNext;
}
}
}
// If we've received the whole response,
// either a SingleExecutionResult or the final ExecutionPatchResult,
// call the update function.
if (isFinalResult) {
update(cache, result, {
context: mutation.context,
variables: mutation.variables,
});
}
}
// TODO Do this with cache.evict({ id: 'ROOT_MUTATION' }) but make it
// shallow to allow rolling back optimistic evictions.
if (!skipCache && !mutation.keepRootFields && isFinalResult) {
cache.modify({
id: "ROOT_MUTATION",
fields: function (value, _a) {
var fieldName = _a.fieldName, DELETE = _a.DELETE;
return fieldName === "__typename" ? value : DELETE;
},
});
}
},
include: mutation.refetchQueries,
// Write the final mutation.result to the root layer of the cache.
optimistic: false,
// Remove the corresponding optimistic layer at the same time as we
// write the final non-optimistic result.
removeOptimistic: mutation.removeOptimistic,
// Let the caller of client.mutate optionally determine the refetching
// behavior for watched queries after the mutation.update function runs.
// If no onQueryUpdated function was provided for this mutation, pass
// null instead of undefined to disable the default refetching behavior.
onQueryUpdated: mutation.onQueryUpdated || null,
}).forEach(function (result) { return results_1.push(result); });
if (mutation.awaitRefetchQueries || mutation.onQueryUpdated) {
// Returning a promise here makes the mutation await that promise, so we
// include results in that promise's work if awaitRefetchQueries or an
// onQueryUpdated function was specified.
return Promise.all(results_1).then(function () { return result; });
}
}
return Promise.resolve(result);
};
QueryManager.prototype.markMutationOptimistic = function (optimisticResponse, mutation) {
var _this = this;
var data = typeof optimisticResponse === "function" ?
optimisticResponse(mutation.variables, { IGNORE: IGNORE })
: optimisticResponse;
if (data === IGNORE) {
return false;
}
this.cache.recordOptimisticTransaction(function (cache) {
try {
_this.markMutationResult(__assign(__assign({}, mutation), { result: { data: data } }), cache);
}
catch (error) {
globalThis.__DEV__ !== false && invariant.error(error);
}
}, mutation.mutationId);
return true;
};
QueryManager.prototype.fetchQuery = function (queryId, options, networkStatus) {
return this.fetchConcastWithInfo(queryId, options, networkStatus).concast
.promise;
};
QueryManager.prototype.getQueryStore = function () {
var store = Object.create(null);
this.queries.forEach(function (info, queryId) {
store[queryId] = {
variables: info.variables,
networkStatus: info.networkStatus,
networkError: info.networkError,
graphQLErrors: info.graphQLErrors,
};
});
return store;
};
QueryManager.prototype.resetErrors = function (queryId) {
var queryInfo = this.queries.get(queryId);
if (queryInfo) {
queryInfo.networkError = undefined;
queryInfo.graphQLErrors = [];
}
};
QueryManager.prototype.transform = function (document) {
return this.documentTransform.transformDocument(document);
};
QueryManager.prototype.getDocumentInfo = function (document) {
var transformCache = this.transformCache;
if (!transformCache.has(document)) {
var cacheEntry = {
// TODO These three calls (hasClientExports, shouldForceResolvers, and
// usesNonreactiveDirective) are performing independent full traversals
// of the transformed document. We should consider merging these
// traversals into a single pass in the future, though the work is
// cached after the first time.
hasClientExports: hasClientExports(document),
hasForcedResolvers: this.localState.shouldForceResolvers(document),
hasNonreactiveDirective: hasDirectives(["nonreactive"], document),
clientQuery: this.localState.clientQuery(document),
serverQuery: removeDirectivesFromDocument([
{ name: "client", remove: true },
{ name: "connection" },
{ name: "nonreactive" },
], document),
defaultVars: getDefaultValues(getOperationDefinition(document)),
// Transform any mutation or subscription operations to query operations
// so we can read/write them from/to the cache.
asQuery: __assign(__assign({}, document), { definitions: document.definitions.map(function (def) {
if (def.kind === "OperationDefinition" &&
def.operation !== "query") {
return __assign(__assign({}, def), { operation: "query" });
}
return def;
}) }),
};
transformCache.set(document, cacheEntry);
}
return transformCache.get(document);
};
QueryManager.prototype.getVariables = function (document, variables) {
return __assign(__assign({}, this.getDocumentInfo(document).defaultVars), variables);
};
QueryManager.prototype.watchQuery = function (options) {
var query = this.transform(options.query);
// assign variable default values if supplied
// NOTE: We don't modify options.query here with the transformed query to
// ensure observable.options.query is set to the raw untransformed query.
options = __assign(__assign({}, options), { variables: this.getVariables(query, options.variables) });
if (typeof options.notifyOnNetworkStatusChange === "undefined") {
options.notifyOnNetworkStatusChange = false;
}
var queryInfo = new QueryInfo(this);
var observable = new ObservableQuery({
queryManager: this,
queryInfo: queryInfo,
options: options,
});
observable["lastQuery"] = query;
this.queries.set(observable.queryId, queryInfo);
// We give queryInfo the transformed query to ensure the first cache diff
// uses the transformed query instead of the raw query
queryInfo.init({
document: query,
observableQuery: observable,
variables: observable.variables,
});
return observable;
};
QueryManager.prototype.query = function (options, queryId) {
var _this = this;
if (queryId === void 0) { queryId = this.generateQueryId(); }
invariant(options.query, 28);
invariant(options.query.kind === "Document", 29);
invariant(!options.returnPartialData, 30);
invariant(!options.pollInterval, 31);
return this.fetchQuery(queryId, __assign(__assign({}, options), { query: this.transform(options.query) })).finally(function () { return _this.stopQuery(queryId); });
};
QueryManager.prototype.generateQueryId = function () {
return String(this.queryIdCounter++);
};
QueryManager.prototype.generateRequestId = function () {
return this.requestIdCounter++;
};
QueryManager.prototype.generateMutationId = function () {
return String(this.mutationIdCounter++);
};
QueryManager.prototype.stopQueryInStore = function (queryId) {
this.stopQueryInStoreNoBroadcast(queryId);
this.broadcastQueries();
};
QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) {
var queryInfo = this.queries.get(queryId);
if (queryInfo)
queryInfo.stop();
};
QueryManager.prototype.clearStore = function (options) {
if (options === void 0) { options = {
discardWatches: true,
}; }
// Before we have sent the reset action to the store, we can no longer
// rely on the results returned by in-flight requests since these may
// depend on values that previously existed in the data portion of the
// store. So, we cancel the promises and observers that we have issued
// so far and not yet resolved (in the case of queries).
this.cancelPendingFetches(newInvariantError(32));
this.queries.forEach(function (queryInfo) {
if (queryInfo.observableQuery) {
// Set loading to true so listeners don't trigger unless they want
// results with partial data.
queryInfo.networkStatus = NetworkStatus.loading;
}
else {
queryInfo.stop();
}
});
if (this.mutationStore) {
this.mutationStore = Object.create(null);
}
// begin removing data from the store
return this.cache.reset(options);
};
QueryManager.prototype.getObservableQueries = function (include) {
var _this = this;
if (include === void 0) { include = "active"; }
var queries = new Map();
var queryNamesAndDocs = new Map();
var legacyQueryOptions = new Set();
if (Array.isArray(include)) {
include.forEach(function (desc) {
if (typeof desc === "string") {
queryNamesAndDocs.set(desc, false);
}
else if (isDocumentNode(desc)) {
queryNamesAndDocs.set(_this.transform(desc), false);
}
else if (isNonNullObject(desc) && desc.query) {
legacyQueryOptions.add(desc);
}
});
}
this.queries.forEach(function (_a, queryId) {
var oq = _a.observableQuery, document = _a.document;
if (oq) {
if (include === "all") {
queries.set(queryId, oq);
return;
}
var queryName = oq.queryName, fetchPolicy = oq.options.fetchPolicy;
if (fetchPolicy === "standby" ||
(include === "active" && !oq.hasObservers())) {
return;
}
if (include === "active" ||
(queryName && queryNamesAndDocs.has(queryName)) ||
(document && queryNamesAndDocs.has(document))) {
queries.set(queryId, oq);
if (queryName)
queryNamesAndDocs.set(queryName, true);
if (document)
queryNamesAndDocs.set(document, true);
}
}
});
if (legacyQueryOptions.size) {
legacyQueryOptions.forEach(function (options) {
// We will be issuing a fresh network request for this query, so we
// pre-allocate a new query ID here, using a special prefix to enable
// cleaning up these temporary queries later, after fetching.
var queryId = makeUniqueId("legacyOneTimeQuery");
var queryInfo = _this.getQuery(queryId).init({
document: options.query,
variables: options.variables,
});
var oq = new ObservableQuery({
queryManager: _this,
queryInfo: queryInfo,
options: __assign(__assign({}, options), { fetchPolicy: "network-only" }),
});
invariant(oq.queryId === queryId);
queryInfo.setObservableQuery(oq);
queries.set(queryId, oq);
});
}
if (globalThis.__DEV__ !== false && queryNamesAndDocs.size) {
queryNamesAndDocs.forEach(function (included, nameOrDoc) {
if (!included) {
globalThis.__DEV__ !== false && invariant.warn(typeof nameOrDoc === "string" ? 33 : 34, nameOrDoc);
}
});
}
return queries;
};
QueryManager.prototype.reFetchObservableQueries = function (includeStandby) {
var _this = this;
if (includeStandby === void 0) { includeStandby = false; }
var observableQueryPromises = [];
this.getObservableQueries(includeStandby ? "all" : "active").forEach(function (observableQuery, queryId) {
var fetchPolicy = observableQuery.options.fetchPolicy;
observableQuery.resetLastResults();
if (includeStandby ||
(fetchPolicy !== "standby" && fetchPolicy !== "cache-only")) {
observableQueryPromises.push(observableQuery.refetch());
}
_this.getQuery(queryId).setDiff(null);
});
this.broadcastQueries();
return Promise.all(observableQueryPromises);
};
QueryManager.prototype.setObservableQuery = function (observableQuery) {
this.getQuery(observableQuery.queryId).setObservableQuery(observableQuery);
};
QueryManager.prototype.startGraphQLSubscription = function (_a) {
var _this = this;
var query = _a.query, fetchPolicy = _a.fetchPolicy, _b = _a.errorPolicy, errorPolicy = _b === void 0 ? "none" : _b, variables = _a.variables, _c = _a.context, context = _c === void 0 ? {} : _c;
query = this.transform(query);
variables = this.getVariables(query, variables);
var makeObservable = function (variables) {
return _this.getObservableFromLink(query, context, variables).map(function (result) {
if (fetchPolicy !== "no-cache") {
// the subscription interface should handle not sending us results we no longer subscribe to.
// XXX I don't think we ever send in an object with errors, but we might in the future...
if (shouldWriteResult(result, errorPolicy)) {
_this.cache.write({
query: query,
result: result.data,
dataId: "ROOT_SUBSCRIPTION",
variables: variables,
});
}
_this.broadcastQueries();
}
var hasErrors = graphQLResultHasError(result);
var hasProtocolErrors = graphQLResultHasProtocolErrors(result);
if (hasErrors || hasProtocolErrors) {
var errors = {};
if (hasErrors) {
errors.graphQLErrors = result.errors;
}
if (hasProtocolErrors) {
errors.protocolErrors = result.extensions[PROTOCOL_ERRORS_SYMBOL];
}
// `errorPolicy` is a mechanism for handling GraphQL errors, according
// to our documentation, so we throw protocol errors regardless of the
// set error policy.
if (errorPolicy === "none" || hasProtocolErrors) {
throw new ApolloError(errors);
}
}
if (errorPolicy === "ignore") {
delete result.errors;
}
return result;
});
};
if (this.getDocumentInfo(query).hasClientExports) {
var observablePromise_1 = this.localState
.addExportedVariables(query, variables, context)
.then(makeObservable);
return new Observable(function (observer) {
var sub = null;
observablePromise_1.then(function (observable) { return (sub = observable.subscribe(observer)); }, observer.error);
return function () { return sub && sub.unsubscribe(); };
});
}
return makeObservable(variables);
};
QueryManager.prototype.stopQuery = function (queryId) {
this.stopQueryNoBroadcast(queryId);
this.broadcastQueries();
};
QueryManager.prototype.stopQueryNoBroadcast = function (queryId) {
this.stopQueryInStoreNoBroadcast(queryId);
this.removeQuery(queryId);
};
QueryManager.prototype.removeQuery = function (queryId) {
// teardown all links
// Both `QueryManager.fetchRequest` and `QueryManager.query` create separate promises
// that each add their reject functions to fetchCancelFns.
// A query created with `QueryManager.query()` could trigger a `QueryManager.fetchRequest`.
// The same queryId could have two rejection fns for two promises
this.fetchCancelFns.delete(queryId);
if (this.queries.has(queryId)) {
this.getQuery(queryId).stop();
this.queries.delete(queryId);
}
};
QueryManager.prototype.broadcastQueries = function () {
if (this.onBroadcast)
this.onBroadcast();
this.queries.forEach(function (info) { return info.notify(); });
};
QueryManager.prototype.getLocalState = function () {
return this.localState;
};
QueryManager.prototype.getObservableFromLink = function (query, context, variables,
// Prefer context.queryDeduplication if specified.
deduplication) {
var _this = this;
var _a;
if (deduplication === void 0) { deduplication = (_a = context === null || context === void 0 ? void 0 : context.queryDeduplication) !== null && _a !== void 0 ? _a : this.queryDeduplication; }
var observable;
var _b = this.getDocumentInfo(query), serverQuery = _b.serverQuery, clientQuery = _b.clientQuery;
if (serverQuery) {
var _c = this, inFlightLinkObservables_1 = _c.inFlightLinkObservables, link = _c.link;
var operation = {
query: serverQuery,
variables: variables,
operationName: getOperationName(serverQuery) || void 0,
context: this.prepareContext(__assign(__assign({}, context), { forceFetch: !deduplication })),
};
context = operation.context;
if (deduplication) {
var printedServerQuery_1 = print(serverQuery);
var varJson_1 = canonicalStringify(variables);
var entry = inFlightLinkObservables_1.lookup(printedServerQuery_1, varJson_1);
observable = entry.observable;
if (!observable) {
var concast = new Concast([
execute(link, operation),
]);
observable = entry.observable = concast;
concast.beforeNext(function () {
inFlightLinkObservables_1.remove(printedServerQuery_1, varJson_1);
});
}
}
else {
observable = new Concast([
execute(link, operation),
]);
}
}
else {
observable = new Concast([Observable.of({ data: {} })]);
context = this.prepareContext(context);
}
if (clientQuery) {
observable = asyncMap(observable, function (result) {
return _this.localState.runResolvers({
document: clientQuery,
remoteResult: result,
context: context,
variables: variables,
});
});
}
return observable;
};
QueryManager.prototype.getResultsFromLink = function (queryInfo, cacheWriteBehavior, options) {
var requestId = (queryInfo.lastRequestId = this.generateRequestId());
// Performing transformForLink here gives this.cache a chance to fill in
// missing fragment definitions (for example) before sending this document
// through the link chain.
var linkDocument = this.cache.transformForLink(options.query);
return asyncMap(this.getObservableFromLink(linkDocument, options.context, options.variables), function (result) {
var graphQLErrors = getGraphQLErrorsFromResult(result);
var hasErrors = graphQLErrors.length > 0;
// If we interrupted this request by calling getResultsFromLink again
// with the same QueryInfo object, we ignore the old results.
if (requestId >= queryInfo.lastRequestId) {
if (hasErrors && options.errorPolicy === "none") {
// Throwing here effectively calls observer.error.
throw queryInfo.markError(new ApolloError({
graphQLErrors: graphQLErrors,
}));
}
// Use linkDocument rather than queryInfo.document so the
// operation/fragments used to write the result are the same as the
// ones used to obtain it from the link.
queryInfo.markResult(result, linkDocument, options, cacheWriteBehavior);
queryInfo.markReady();
}
var aqr = {
data: result.data,
loading: false,
networkStatus: NetworkStatus.ready,
};
if (hasErrors && options.errorPolicy !== "ignore") {
aqr.errors = graphQLErrors;
aqr.networkStatus = NetworkStatus.error;
}
return aqr;
}, function (networkError) {
var error = isApolloError(networkError) ? networkError : (new ApolloError({ networkError: networkError }));
// Avoid storing errors from older interrupted queries.
if (requestId >= queryInfo.lastRequestId) {
queryInfo.markError(error);
}
throw error;
});
};
QueryManager.prototype.fetchConcastWithInfo = function (queryId, options,
// The initial networkStatus for this fetch, most often
// NetworkStatus.loading, but also possibly fetchMore, poll, refetch,
// or setVariables.
networkStatus, query) {
var _this = this;
if (networkStatus === void 0) { networkStatus = NetworkStatus.loading; }
if (query === void 0) { query = options.query; }
var variables = this.getVariables(query, options.variables);
var queryInfo = this.getQuery(queryId);
var defaults = this.defaultOptions.watchQuery;
var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? (defaults && defaults.fetchPolicy) || "cache-first" : _a, _b = options.errorPolicy, errorPolicy = _b === void 0 ? (defaults && defaults.errorPolicy) || "none" : _b, _c = options.returnPartialData, returnPartialData = _c === void 0 ? false : _c, _d = options.notifyOnNetworkStatusChange, notifyOnNetworkStatusChange = _d === void 0 ? false : _d, _e = options.context, context = _e === void 0 ? {} : _e;
var normalized = Object.assign({}, options, {
query: query,
variables: variables,
fetchPolicy: fetchPolicy,
errorPolicy: errorPolicy,
returnPartialData: returnPartialData,
notifyOnNetworkStatusChange: notifyOnNetworkStatusChange,
context: context,
});
var fromVariables = function (variables) {
// Since normalized is always a fresh copy of options, it's safe to
// modify its properties here, rather than creating yet another new
// WatchQueryOptions object.
normalized.variables = variables;
var sourcesWithInfo = _this.fetchQueryByPolicy(queryInfo, normalized, networkStatus);
if (
// If we're in standby, postpone advancing options.fetchPolicy using
// applyNextFetchPolicy.
normalized.fetchPolicy !== "standby" &&
// The "standby" policy currently returns [] from fetchQueryByPolicy, so
// this is another way to detect when nothing was done/fetched.
sourcesWithInfo.sources.length > 0 &&
queryInfo.observableQuery) {
queryInfo.observableQuery["applyNextFetchPolicy"]("after-fetch", options);
}
return sourcesWithInfo;
};
// This cancel function needs to be set before the concast is created,
// in case concast creation synchronously cancels the request.
var cleanupCancelFn = function () { return _this.fetchCancelFns.delete(queryId); };
this.fetchCancelFns.set(queryId, function (reason) {
cleanupCancelFn();
// This delay ensures the concast variable has been initialized.
setTimeout(function () { return concast.cancel(reason); });
});
var concast, containsDataFromLink;
// If the query has @export(as: ...) directives, then we need to
// process those directives asynchronously. When there are no
// @export directives (the common case), we deliberately avoid
// wrapping the result of this.fetchQueryByPolicy in a Promise,
// since the timing of result delivery is (unfortunately) important
// for backwards compatibility. TODO This code could be simpler if
// we deprecated and removed LocalState.
if (this.getDocumentInfo(normalized.query).hasClientExports) {
concast = new Concast(this.localState
.addExportedVariables(normalized.query, normalized.variables, normalized.context)
.then(fromVariables)
.then(function (sourcesWithInfo) { return sourcesWithInfo.sources; }));
// there is just no way we can synchronously get the *right* value here,
// so we will assume `true`, which is the behaviour before the bug fix in
// #10597. This means that bug is not fixed in that case, and is probably
// un-fixable with reasonable effort for the edge case of @export as
// directives.
containsDataFromLink = true;
}
else {
var sourcesWithInfo = fromVariables(normalized.variables);
containsDataFromLink = sourcesWithInfo.fromLink;
concast = new Concast(sourcesWithInfo.sources);
}
concast.promise.then(cleanupCancelFn, cleanupCancelFn);
return {
concast: concast,
fromLink: containsDataFromLink,
};
};
QueryManager.prototype.refetchQueries = function (_a) {
var _this = this;
var updateCache = _a.updateCache, include = _a.include, _b = _a.optimistic, optimistic = _b === void 0 ? false : _b, _c = _a.removeOptimistic, removeOptimistic = _c === void 0 ? optimistic ? makeUniqueId("refetchQueries") : void 0 : _c, onQueryUpdated = _a.onQueryUpdated;
var includedQueriesById = new Map();
if (include) {
this.getObservableQueries(include).forEach(function (oq, queryId) {
includedQueriesById.set(queryId, {
oq: oq,
lastDiff: _this.getQuery(queryId).getDiff(),
});
});
}
var results = new Map();
if (updateCache) {
this.cache.batch({
update: updateCache,
// Since you can perform any combination of cache reads and/or writes in
// the cache.batch update function, its optimistic option can be either
// a boolean or a string, representing three distinct modes of
// operation:
//
// * false: read/write only the root layer
// * true: read/write the topmost layer
// * string: read/write a fresh optimistic layer with that ID string
//
// When typeof optimistic === "string", a new optimistic layer will be
// temporarily created within cache.batch with that string as its ID. If
// we then pass that same string as the removeOptimistic option, we can
// make cache.batch immediately remove the optimistic layer after
// running the updateCache function, triggering only one broadcast.
//
// However, the refetchQueries method accepts only true or false for its
// optimistic option (not string). We interpret true to mean a temporary
// optimistic layer should be created, to allow efficiently rolling back
// the effect of the updateCache function, which involves passing a
// string instead of true as the optimistic option to cache.batch, when
// refetchQueries receives optimistic: true.
//
// In other words, we are deliberately not supporting the use case of
// writing to an *existing* optimistic layer (using the refetchQueries
// updateCache function), since that would potentially interfere with
// other optimistic updates in progress. Instead, you can read/write
// only the root layer by passing optimistic: false to refetchQueries,
// or you can read/write a brand new optimistic layer that will be
// automatically removed by passing optimistic: true.
optimistic: (optimistic && removeOptimistic) || false,
// The removeOptimistic option can also be provided by itself, even if
// optimistic === false, to remove some previously-added optimistic
// layer safely and efficiently, like we do in markMutationResult.
//
// If an explicit removeOptimistic string is provided with optimistic:
// true, the removeOptimistic string will determine the ID of the
// temporary optimistic layer, in case that ever matters.
removeOptimistic: removeOptimistic,
onWatchUpdated: function (watch, diff, lastDiff) {
var oq = watch.watcher instanceof QueryInfo && watch.watcher.observableQuery;
if (oq) {
if (onQueryUpdated) {
// Since we're about to handle this query now, remove it from
// includedQueriesById, in case it was added earlier because of
// options.include.
includedQueriesById.delete(oq.queryId);
var result = onQueryUpdated(oq, diff, lastDiff);
if (result === true) {
// The onQueryUpdated function requested the default refetching
// behavior by returning true.
result = oq.refetch();
}
// Record the result in the results Map, as long as onQueryUpdated
// did not return false to skip/ignore this result.
if (result !== false) {
results.set(oq, result);
}
// Allow the default cache broadcast to happen, except when
// onQueryUpdated returns false.
return result;
}
if (onQueryUpdated !== null) {
// If we don't have an onQueryUpdated function, and onQueryUpdated
// was not disabled by passing null, make sure this query is
// "included" like any other options.include-specified query.
includedQueriesById.set(oq.queryId, { oq: oq, lastDiff: lastDiff, diff: diff });
}
}
},
});
}
if (includedQueriesById.size) {
includedQueriesById.forEach(function (_a, queryId) {
var oq = _a.oq, lastDiff = _a.lastDiff, diff = _a.diff;
var result;
// If onQueryUpdated is provided, we want to use it for all included
// queries, even the QueryOptions ones.
if (onQueryUpdated) {
if (!diff) {
var info = oq["queryInfo"];
info.reset(); // Force info.getDiff() to read from cache.
diff = info.getDiff();
}
result = onQueryUpdated(oq, diff, lastDiff);
}
// Otherwise, we fall back to refetching.
if (!onQueryUpdated || result === true) {
result = oq.refetch();
}
if (result !== false) {
results.set(oq, result);
}
if (queryId.indexOf("legacyOneTimeQuery") >= 0) {
_this.stopQueryNoBroadcast(queryId);
}
});
}
if (removeOptimistic) {
// In case no updateCache callback was provided (so cache.batch was not
// called above, and thus did not already remove the optimistic layer),
// remove it here. Since this is a no-op when the layer has already been
// removed, we do it even if we called cache.batch above, since it's
// possible this.cache is an instance of some ApolloCache subclass other
// than InMemoryCache, and does not fully support the removeOptimistic
// option for cache.batch.
this.cache.removeOptimistic(removeOptimistic);
}
return results;
};
QueryManager.prototype.fetchQueryByPolicy = function (queryInfo, _a,
// The initial networkStatus for this fetch, most often
// NetworkStatus.loading, but also possibly fetchMore, poll, refetch,
// or setVariables.
networkStatus) {
var _this = this;
var query = _a.query, variables = _a.variables, fetchPolicy = _a.fetchPolicy, refetchWritePolicy = _a.refetchWritePolicy, errorPolicy = _a.errorPolicy, returnPartialData = _a.returnPartialData, context = _a.context, notifyOnNetworkStatusChange = _a.notifyOnNetworkStatusChange;
var oldNetworkStatus = queryInfo.networkStatus;
queryInfo.init({
document: query,
variables: variables,
networkStatus: networkStatus,
});
var readCache = function () { return queryInfo.getDiff(); };
var resultsFromCache = function (diff, networkStatus) {
if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || NetworkStatus.loading; }
var data = diff.result;
if (globalThis.__DEV__ !== false && !returnPartialData && !equal(data, {})) {
logMissingFieldErrors(diff.missing);
}
var fromData = function (data) {
return Observable.of(__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true })));
};
if (data && _this.getDocumentInfo(query).hasForcedResolvers) {
return _this.localState
.runResolvers({
document: query,
remoteResult: { data: data },
context: context,
variables: variables,
onlyRunForcedResolvers: true,
})
.then(function (resolved) { return fromData(resolved.data || void 0); });
}
// Resolves https://github.com/apollographql/apollo-client/issues/10317.
// If errorPolicy is 'none' and notifyOnNetworkStatusChange is true,
// data was incorrectly returned from the cache on refetch:
// if diff.missing exists, we should not return cache data.
if (errorPolicy === "none" &&
networkStatus === NetworkStatus.refetch &&
Array.isArray(diff.missing)) {
return fromData(void 0);
}
return fromData(data);
};
var cacheWriteBehavior = fetchPolicy === "no-cache" ? 0 /* CacheWriteBehavior.FORBID */
// Watched queries must opt into overwriting existing data on refetch,
// by passing refetchWritePolicy: "overwrite" in their WatchQueryOptions.
: (networkStatus === NetworkStatus.refetch &&
refetchWritePolicy !== "merge") ?
1 /* CacheWriteBehavior.OVERWRITE */
: 2 /* CacheWriteBehavior.MERGE */;
var resultsFromLink = function () {
return _this.getResultsFromLink(queryInfo, cacheWriteBehavior, {
query: query,
variables: variables,
context: context,
fetchPolicy: fetchPolicy,
errorPolicy: errorPolicy,
});
};
var shouldNotify = notifyOnNetworkStatusChange &&
typeof oldNetworkStatus === "number" &&
oldNetworkStatus !== networkStatus &&
isNetworkRequestInFlight(networkStatus);
switch (fetchPolicy) {
default:
case "cache-first": {
var diff = readCache();
if (diff.complete) {
return {
fromLink: false,
sources: [resultsFromCache(diff, queryInfo.markReady())],
};
}
if (returnPartialData || shouldNotify) {
return {
fromLink: true,
sources: [resultsFromCache(diff), resultsFromLink()],
};
}
return { fromLink: true, sources: [resultsFromLink()] };
}
case "cache-and-network": {
var diff = readCache();
if (diff.complete || returnPartialData || shouldNotify) {
return {
fromLink: true,
sources: [resultsFromCache(diff), resultsFromLink()],
};
}
return { fromLink: true, sources: [resultsFromLink()] };
}
case "cache-only":
return {
fromLink: false,
sources: [resultsFromCache(readCache(), queryInfo.markReady())],
};
case "network-only":
if (shouldNotify) {
return {
fromLink: true,
sources: [resultsFromCache(readCache()), resultsFromLink()],
};
}
return { fromLink: true, sources: [resultsFromLink()] };
case "no-cache":
if (shouldNotify) {
return {
fromLink: true,
// Note that queryInfo.getDiff() for no-cache queries does not call
// cache.diff, but instead returns a { complete: false } stub result
// when there is no queryInfo.diff already defined.
sources: [resultsFromCache(queryInfo.getDiff()), resultsFromLink()],
};
}
return { fromLink: true, sources: [resultsFromLink()] };
case "standby":
return { fromLink: false, sources: [] };
}
};
QueryManager.prototype.getQuery = function (queryId) {
if (queryId && !this.queries.has(queryId)) {
this.queries.set(queryId, new QueryInfo(this, queryId));
}
return this.queries.get(queryId);
};
QueryManager.prototype.prepareContext = function (context) {
if (context === void 0) { context = {}; }
var newContext = this.localState.prepareContext(context);
return __assign(__assign(__assign({}, this.defaultContext), newContext), { clientAwareness: this.clientAwareness });
};
return QueryManager;
}());
export { QueryManager };
//# sourceMappingURL=QueryManager.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/core/ApolloClient.js
import { __assign } from "tslib";
import { invariant, newInvariantError } from "../utilities/globals/index.js";
import { ApolloLink, execute } from "../link/core/index.js";
import { version } from "../version.js";
import { HttpLink } from "../link/http/index.js";
import { QueryManager } from "./QueryManager.js";
import { LocalState } from "./LocalState.js";
var hasSuggestedDevtools = false;
// Though mergeOptions now resides in @apollo/client/utilities, it was
// previously declared and exported from this module, and then reexported from
// @apollo/client/core. Since we need to preserve that API anyway, the easiest
// solution is to reexport mergeOptions where it was previously declared (here).
import { mergeOptions } from "../utilities/index.js";
import { getApolloClientMemoryInternals } from "../utilities/caching/getMemoryInternals.js";
export { mergeOptions };
/**
* This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries
* and mutations) to a GraphQL spec-compliant server over an {@link ApolloLink} instance,
* receive results from the server and cache the results in a store. It also delivers updates
* to GraphQL queries through {@link Observable} instances.
*/
var ApolloClient = /** @class */ (function () {
/**
* Constructs an instance of {@link ApolloClient}.
*
* @example
* ```js
* import { ApolloClient, InMemoryCache } from '@apollo/client';
*
* const cache = new InMemoryCache();
*
* const client = new ApolloClient({
* // Provide required constructor fields
* cache: cache,
* uri: 'http://localhost:4000/',
*
* // Provide some optional constructor fields
* name: 'react-web-client',
* version: '1.3',
* queryDeduplication: false,
* defaultOptions: {
* watchQuery: {
* fetchPolicy: 'cache-and-network',
* },
* },
* });
* ```
*/
function ApolloClient(options) {
var _this = this;
this.resetStoreCallbacks = [];
this.clearStoreCallbacks = [];
if (!options.cache) {
throw newInvariantError(15);
}
var uri = options.uri, credentials = options.credentials, headers = options.headers, cache = options.cache, documentTransform = options.documentTransform, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b,
// Expose the client instance as window.__APOLLO_CLIENT__ and call
// onBroadcast in queryManager.broadcastQueries to enable browser
// devtools, but disable them by default in production.
_c = options.connectToDevTools,
// Expose the client instance as window.__APOLLO_CLIENT__ and call
// onBroadcast in queryManager.broadcastQueries to enable browser
// devtools, but disable them by default in production.
connectToDevTools = _c === void 0 ? typeof window === "object" &&
!window.__APOLLO_CLIENT__ &&
globalThis.__DEV__ !== false : _c, _d = options.queryDeduplication, queryDeduplication = _d === void 0 ? true : _d, defaultOptions = options.defaultOptions, defaultContext = options.defaultContext, _e = options.assumeImmutableResults, assumeImmutableResults = _e === void 0 ? cache.assumeImmutableResults : _e, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version;
var link = options.link;
if (!link) {
link =
uri ? new HttpLink({ uri: uri, credentials: credentials, headers: headers }) : ApolloLink.empty();
}
this.link = link;
this.cache = cache;
this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;
this.queryDeduplication = queryDeduplication;
this.defaultOptions = defaultOptions || Object.create(null);
this.typeDefs = typeDefs;
if (ssrForceFetchDelay) {
setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay);
}
this.watchQuery = this.watchQuery.bind(this);
this.query = this.query.bind(this);
this.mutate = this.mutate.bind(this);
this.resetStore = this.resetStore.bind(this);
this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);
this.version = version;
this.localState = new LocalState({
cache: cache,
client: this,
resolvers: resolvers,
fragmentMatcher: fragmentMatcher,
});
this.queryManager = new QueryManager({
cache: this.cache,
link: this.link,
defaultOptions: this.defaultOptions,
defaultContext: defaultContext,
documentTransform: documentTransform,
queryDeduplication: queryDeduplication,
ssrMode: ssrMode,
clientAwareness: {
name: clientAwarenessName,
version: clientAwarenessVersion,
},
localState: this.localState,
assumeImmutableResults: assumeImmutableResults,
onBroadcast: connectToDevTools ?
function () {
if (_this.devToolsHookCb) {
_this.devToolsHookCb({
action: {},
state: {
queries: _this.queryManager.getQueryStore(),
mutations: _this.queryManager.mutationStore || {},
},
dataWithOptimisticResults: _this.cache.extract(true),
});
}
}
: void 0,
});
if (connectToDevTools)
this.connectToDevTools();
}
ApolloClient.prototype.connectToDevTools = function () {
if (typeof window === "object") {
var windowWithDevTools = window;
var devtoolsSymbol = Symbol.for("apollo.devtools");
(windowWithDevTools[devtoolsSymbol] =
windowWithDevTools[devtoolsSymbol] || []).push(this);
windowWithDevTools.__APOLLO_CLIENT__ = this;
}
/**
* Suggest installing the devtools for developers who don't have them
*/
if (!hasSuggestedDevtools && globalThis.__DEV__ !== false) {
hasSuggestedDevtools = true;
setTimeout(function () {
if (typeof window !== "undefined" &&
window.document &&
window.top === window.self &&
!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {
var nav = window.navigator;
var ua = nav && nav.userAgent;
var url = void 0;
if (typeof ua === "string") {
if (ua.indexOf("Chrome/") > -1) {
url =
"https://chrome.google.com/webstore/detail/" +
"apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
}
else if (ua.indexOf("Firefox/") > -1) {
url =
"https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
}
}
if (url) {
globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
"experience: %s", url);
}
}
}, 10000);
}
};
Object.defineProperty(ApolloClient.prototype, "documentTransform", {
/**
* The `DocumentTransform` used to modify GraphQL documents before a request
* is made. If a custom `DocumentTransform` is not provided, this will be the
* default document transform.
*/
get: function () {
return this.queryManager.documentTransform;
},
enumerable: false,
configurable: true
});
/**
* Call this method to terminate any active client processes, making it safe
* to dispose of this `ApolloClient` instance.
*/
ApolloClient.prototype.stop = function () {
this.queryManager.stop();
};
/**
* This watches the cache store of the query according to the options specified and
* returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and
* receive updated results through a GraphQL observer when the cache store changes.
*
* Note that this method is not an implementation of GraphQL subscriptions. Rather,
* it uses Apollo's store in order to reactively deliver updates to your query results.
*
* For example, suppose you call watchQuery on a GraphQL query that fetches a person's
* first and last name and this person has a particular object identifier, provided by
* dataIdFromObject. Later, a different query fetches that same person's
* first and last name and the first name has now changed. Then, any observers associated
* with the results of the first query will be updated with a new result object.
*
* Note that if the cache does not change, the subscriber will *not* be notified.
*
* See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for
* a description of store reactivity.
*/
ApolloClient.prototype.watchQuery = function (options) {
if (this.defaultOptions.watchQuery) {
options = mergeOptions(this.defaultOptions.watchQuery, options);
}
// XXX Overwriting options is probably not the best way to do this long term...
if (this.disableNetworkFetches &&
(options.fetchPolicy === "network-only" ||
options.fetchPolicy === "cache-and-network")) {
options = __assign(__assign({}, options), { fetchPolicy: "cache-first" });
}
return this.queryManager.watchQuery(options);
};
/**
* This resolves a single query according to the options specified and
* returns a `Promise` which is either resolved with the resulting data
* or rejected with an error.
*
* @param options - An object of type {@link QueryOptions} that allows us to
* describe how this query should be treated e.g. whether it should hit the
* server at all or just resolve from the cache, etc.
*/
ApolloClient.prototype.query = function (options) {
if (this.defaultOptions.query) {
options = mergeOptions(this.defaultOptions.query, options);
}
invariant(options.fetchPolicy !== "cache-and-network", 16);
if (this.disableNetworkFetches && options.fetchPolicy === "network-only") {
options = __assign(__assign({}, options), { fetchPolicy: "cache-first" });
}
return this.queryManager.query(options);
};
/**
* This resolves a single mutation according to the options specified and returns a
* Promise which is either resolved with the resulting data or rejected with an
* error. In some cases both `data` and `errors` might be undefined, for example
* when `errorPolicy` is set to `'ignore'`.
*
* It takes options as an object with the following keys and values:
*/
ApolloClient.prototype.mutate = function (options) {
if (this.defaultOptions.mutate) {
options = mergeOptions(this.defaultOptions.mutate, options);
}
return this.queryManager.mutate(options);
};
/**
* This subscribes to a graphql subscription according to the options specified and returns an
* {@link Observable} which either emits received data or an error.
*/
ApolloClient.prototype.subscribe = function (options) {
return this.queryManager.startGraphQLSubscription(options);
};
/**
* Tries to read some data from the store in the shape of the provided
* GraphQL query without making a network request. This method will start at
* the root query. To start at a specific id returned by `dataIdFromObject`
* use `readFragment`.
*
* @param optimistic - Set to `true` to allow `readQuery` to return
* optimistic results. Is `false` by default.
*/
ApolloClient.prototype.readQuery = function (options, optimistic) {
if (optimistic === void 0) { optimistic = false; }
return this.cache.readQuery(options, optimistic);
};
/**
* Tries to read some data from the store in the shape of the provided
* GraphQL fragment without making a network request. This method will read a
* GraphQL fragment from any arbitrary id that is currently cached, unlike
* `readQuery` which will only read from the root query.
*
* You must pass in a GraphQL document with a single fragment or a document
* with multiple fragments that represent what you are reading. If you pass
* in a document with multiple fragments then you must also specify a
* `fragmentName`.
*
* @param optimistic - Set to `true` to allow `readFragment` to return
* optimistic results. Is `false` by default.
*/
ApolloClient.prototype.readFragment = function (options, optimistic) {
if (optimistic === void 0) { optimistic = false; }
return this.cache.readFragment(options, optimistic);
};
/**
* Writes some data in the shape of the provided GraphQL query directly to
* the store. This method will start at the root query. To start at a
* specific id returned by `dataIdFromObject` then use `writeFragment`.
*/
ApolloClient.prototype.writeQuery = function (options) {
var ref = this.cache.writeQuery(options);
if (options.broadcast !== false) {
this.queryManager.broadcastQueries();
}
return ref;
};
/**
* Writes some data in the shape of the provided GraphQL fragment directly to
* the store. This method will write to a GraphQL fragment from any arbitrary
* id that is currently cached, unlike `writeQuery` which will only write
* from the root query.
*
* You must pass in a GraphQL document with a single fragment or a document
* with multiple fragments that represent what you are writing. If you pass
* in a document with multiple fragments then you must also specify a
* `fragmentName`.
*/
ApolloClient.prototype.writeFragment = function (options) {
var ref = this.cache.writeFragment(options);
if (options.broadcast !== false) {
this.queryManager.broadcastQueries();
}
return ref;
};
ApolloClient.prototype.__actionHookForDevTools = function (cb) {
this.devToolsHookCb = cb;
};
ApolloClient.prototype.__requestRaw = function (payload) {
return execute(this.link, payload);
};
/**
* Resets your entire store by clearing out your cache and then re-executing
* all of your active queries. This makes it so that you may guarantee that
* there is no data left in your store from a time before you called this
* method.
*
* `resetStore()` is useful when your user just logged out. You’ve removed the
* user session, and you now want to make sure that any references to data you
* might have fetched while the user session was active is gone.
*
* It is important to remember that `resetStore()` *will* refetch any active
* queries. This means that any components that might be mounted will execute
* their queries again using your network interface. If you do not want to
* re-execute any queries then you should make sure to stop watching any
* active queries.
*/
ApolloClient.prototype.resetStore = function () {
var _this = this;
return Promise.resolve()
.then(function () {
return _this.queryManager.clearStore({
discardWatches: false,
});
})
.then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); })
.then(function () { return _this.reFetchObservableQueries(); });
};
/**
* Remove all data from the store. Unlike `resetStore`, `clearStore` will
* not refetch any active queries.
*/
ApolloClient.prototype.clearStore = function () {
var _this = this;
return Promise.resolve()
.then(function () {
return _this.queryManager.clearStore({
discardWatches: true,
});
})
.then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); });
};
/**
* Allows callbacks to be registered that are executed when the store is
* reset. `onResetStore` returns an unsubscribe function that can be used
* to remove registered callbacks.
*/
ApolloClient.prototype.onResetStore = function (cb) {
var _this = this;
this.resetStoreCallbacks.push(cb);
return function () {
_this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { return c !== cb; });
};
};
/**
* Allows callbacks to be registered that are executed when the store is
* cleared. `onClearStore` returns an unsubscribe function that can be used
* to remove registered callbacks.
*/
ApolloClient.prototype.onClearStore = function (cb) {
var _this = this;
this.clearStoreCallbacks.push(cb);
return function () {
_this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { return c !== cb; });
};
};
/**
* Refetches all of your active queries.
*
* `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage
*
* It is important to remember that `reFetchObservableQueries()` *will* refetch any active
* queries. This means that any components that might be mounted will execute
* their queries again using your network interface. If you do not want to
* re-execute any queries then you should make sure to stop watching any
* active queries.
* Takes optional parameter `includeStandby` which will include queries in standby-mode when refetching.
*/
ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) {
return this.queryManager.reFetchObservableQueries(includeStandby);
};
/**
* Refetches specified active queries. Similar to "reFetchObservableQueries()" but with a specific list of queries.
*
* `refetchQueries()` is useful for use cases to imperatively refresh a selection of queries.
*
* It is important to remember that `refetchQueries()` *will* refetch specified active
* queries. This means that any components that might be mounted will execute
* their queries again using your network interface. If you do not want to
* re-execute any queries then you should make sure to stop watching any
* active queries.
*/
ApolloClient.prototype.refetchQueries = function (options) {
var map = this.queryManager.refetchQueries(options);
var queries = [];
var results = [];
map.forEach(function (result, obsQuery) {
queries.push(obsQuery);
results.push(result);
});
var result = Promise.all(results);
// In case you need the raw results immediately, without awaiting
// Promise.all(results):
result.queries = queries;
result.results = results;
// If you decide to ignore the result Promise because you're using
// result.queries and result.results instead, you shouldn't have to worry
// about preventing uncaught rejections for the Promise.all result.
result.catch(function (error) {
globalThis.__DEV__ !== false && invariant.debug(17, error);
});
return result;
};
/**
* Get all currently active `ObservableQuery` objects, in a `Map` keyed by
* query ID strings.
*
* An "active" query is one that has observers and a `fetchPolicy` other than
* "standby" or "cache-only".
*
* You can include all `ObservableQuery` objects (including the inactive ones)
* by passing "all" instead of "active", or you can include just a subset of
* active queries by passing an array of query names or DocumentNode objects.
*/
ApolloClient.prototype.getObservableQueries = function (include) {
if (include === void 0) { include = "active"; }
return this.queryManager.getObservableQueries(include);
};
/**
* Exposes the cache's complete state, in a serializable format for later restoration.
*/
ApolloClient.prototype.extract = function (optimistic) {
return this.cache.extract(optimistic);
};
/**
* Replaces existing state in the cache (if any) with the values expressed by
* `serializedState`.
*
* Called when hydrating a cache (server side rendering, or offline storage),
* and also (potentially) during hot reloads.
*/
ApolloClient.prototype.restore = function (serializedState) {
return this.cache.restore(serializedState);
};
/**
* Add additional local resolvers.
*/
ApolloClient.prototype.addResolvers = function (resolvers) {
this.localState.addResolvers(resolvers);
};
/**
* Set (override existing) local resolvers.
*/
ApolloClient.prototype.setResolvers = function (resolvers) {
this.localState.setResolvers(resolvers);
};
/**
* Get all registered local resolvers.
*/
ApolloClient.prototype.getResolvers = function () {
return this.localState.getResolvers();
};
/**
* Set a custom local state fragment matcher.
*/
ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) {
this.localState.setFragmentMatcher(fragmentMatcher);
};
/**
* Define a new ApolloLink (or link chain) that Apollo Client will use.
*/
ApolloClient.prototype.setLink = function (newLink) {
this.link = this.queryManager.link = newLink;
};
Object.defineProperty(ApolloClient.prototype, "defaultContext", {
get: function () {
return this.queryManager.defaultContext;
},
enumerable: false,
configurable: true
});
return ApolloClient;
}());
export { ApolloClient };
if (globalThis.__DEV__ !== false) {
ApolloClient.prototype.getMemoryInternals = getApolloClientMemoryInternals;
}
//# sourceMappingURL=ApolloClient.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/retry/retryLink.js
import { __awaiter, __extends, __generator } from "tslib";
import { ApolloLink } from "../core/index.js";
import { Observable } from "../../utilities/index.js";
import { buildDelayFunction } from "./delayFunction.js";
import { buildRetryFunction } from "./retryFunction.js";
/**
* Tracking and management of operations that may be (or currently are) retried.
*/
var RetryableOperation = /** @class */ (function () {
function RetryableOperation(observer, operation, forward, delayFor, retryIf) {
var _this = this;
this.observer = observer;
this.operation = operation;
this.forward = forward;
this.delayFor = delayFor;
this.retryIf = retryIf;
this.retryCount = 0;
this.currentSubscription = null;
this.onError = function (error) { return __awaiter(_this, void 0, void 0, function () {
var shouldRetry;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.retryCount += 1;
return [4 /*yield*/, this.retryIf(this.retryCount, this.operation, error)];
case 1:
shouldRetry = _a.sent();
if (shouldRetry) {
this.scheduleRetry(this.delayFor(this.retryCount, this.operation, error));
return [2 /*return*/];
}
this.observer.error(error);
return [2 /*return*/];
}
});
}); };
this.try();
}
/**
* Stop retrying for the operation, and cancel any in-progress requests.
*/
RetryableOperation.prototype.cancel = function () {
if (this.currentSubscription) {
this.currentSubscription.unsubscribe();
}
clearTimeout(this.timerId);
this.timerId = undefined;
this.currentSubscription = null;
};
RetryableOperation.prototype.try = function () {
this.currentSubscription = this.forward(this.operation).subscribe({
next: this.observer.next.bind(this.observer),
error: this.onError,
complete: this.observer.complete.bind(this.observer),
});
};
RetryableOperation.prototype.scheduleRetry = function (delay) {
var _this = this;
if (this.timerId) {
throw new Error("RetryLink BUG! Encountered overlapping retries");
}
this.timerId = setTimeout(function () {
_this.timerId = undefined;
_this.try();
}, delay);
};
return RetryableOperation;
}());
var RetryLink = /** @class */ (function (_super) {
__extends(RetryLink, _super);
function RetryLink(options) {
var _this = _super.call(this) || this;
var _a = options || {}, attempts = _a.attempts, delay = _a.delay;
_this.delayFor =
typeof delay === "function" ? delay : buildDelayFunction(delay);
_this.retryIf =
typeof attempts === "function" ? attempts : buildRetryFunction(attempts);
return _this;
}
RetryLink.prototype.request = function (operation, nextLink) {
var _this = this;
return new Observable(function (observer) {
var retryable = new RetryableOperation(observer, operation, nextLink, _this.delayFor, _this.retryIf);
return function () {
retryable.cancel();
};
});
};
return RetryLink;
}(ApolloLink));
export { RetryLink };
//# sourceMappingURL=retryLink.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/retry/delayFunction.js
export function buildDelayFunction(delayOptions) {
var _a = delayOptions || {}, _b = _a.initial, initial = _b === void 0 ? 300 : _b, _c = _a.jitter, jitter = _c === void 0 ? true : _c, _d = _a.max, max = _d === void 0 ? Infinity : _d;
// If we're jittering, baseDelay is half of the maximum delay for that
// attempt (and is, on average, the delay we will encounter).
// If we're not jittering, adjust baseDelay so that the first attempt
// lines up with initialDelay, for everyone's sanity.
var baseDelay = jitter ? initial : initial / 2;
return function delayFunction(count) {
var delay = Math.min(max, baseDelay * Math.pow(2, count));
if (jitter) {
// We opt for a full jitter approach for a mostly uniform distribution,
// but bound it within initialDelay and delay for everyone's sanity.
delay = Math.random() * delay;
}
return delay;
};
}
//# sourceMappingURL=delayFunction.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/retry/retryFunction.js
export function buildRetryFunction(retryOptions) {
var _a = retryOptions || {}, retryIf = _a.retryIf, _b = _a.max, max = _b === void 0 ? 5 : _b;
return function retryFunction(count, operation, error) {
if (count >= max)
return false;
return retryIf ? retryIf(error, operation) : !!error;
};
}
//# sourceMappingURL=retryFunction.js.map
webpack://frontend-tpt/../../node_modules/@apollo/client/link/error/index.js
import { __extends } from "tslib";
import { Observable } from "../../utilities/index.js";
import { ApolloLink } from "../core/index.js";
export function onError(errorHandler) {
return new ApolloLink(function (operation, forward) {
return new Observable(function (observer) {
var sub;
var retriedSub;
var retriedResult;
try {
sub = forward(operation).subscribe({
next: function (result) {
if (result.errors) {
retriedResult = errorHandler({
graphQLErrors: result.errors,
response: result,
operation: operation,
forward: forward,
});
if (retriedResult) {
retriedSub = retriedResult.subscribe({
next: observer.next.bind(observer),
error: observer.error.bind(observer),
complete: observer.complete.bind(observer),
});
return;
}
}
observer.next(result);
},
error: function (networkError) {
retriedResult = errorHandler({
operation: operation,
networkError: networkError,
//Network errors can return GraphQL errors on for example a 403
graphQLErrors: networkError &&
networkError.result &&
networkError.result.errors,
forward: forward,
});
if (retriedResult) {
retriedSub = retriedResult.subscribe({
next: observer.next.bind(observer),
error: observer.error.bind(observer),
complete: observer.complete.bind(observer),
});
return;
}
observer.error(networkError);
},
complete: function () {
// disable the previous sub from calling complete on observable
// if retry is in flight.
if (!retriedResult) {
observer.complete.bind(observer)();
}
},
});
}
catch (e) {
errorHandler({ networkError: e, operation: operation, forward: forward });
observer.error(e);
}
return function () {
if (sub)
sub.unsubscribe();
if (retriedSub)
sub.unsubscribe();
};
});
});
}
var ErrorLink = /** @class */ (function (_super) {
__extends(ErrorLink, _super);
function ErrorLink(errorHandler) {
var _this = _super.call(this) || this;
_this.link = onError(errorHandler);
return _this;
}
ErrorLink.prototype.request = function (operation, forward) {
return this.link.request(operation, forward);
};
return ErrorLink;
}(ApolloLink));
export { ErrorLink };
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../packages/tvg-lib-utils/apolloPolicies.js
import { merge as lodashMerge, isArray, get } from "lodash";
const safeMergeObjects = (existing, incoming, mergeFunction) => {
if (incoming === null || incoming === undefined) {
return incoming;
}
if (existing === null || existing === undefined) {
return incoming;
}
return mergeFunction(existing, incoming);
};
const mergeObjectWithArrayEntry = (
existing = [],
incoming,
{ mergeObjects }
) => {
const merged = existing ? existing.slice(0) : [];
incoming &&
incoming.forEach((obj, i) => {
if (existing && existing[i]) {
const newvalue = { ...existing[i] };
Object.keys(obj).forEach((entry) => {
if (Array.isArray(obj[entry])) {
newvalue[entry] = mergeObjectWithArrayEntry(
existing[i][entry],
obj[entry],
{ mergeObjects }
);
} else {
newvalue[entry] = safeMergeObjects(
existing[i][entry],
obj[entry],
mergeObjects
);
}
});
merged[i] = newvalue;
} else {
merged.push(obj);
}
});
return merged;
};
const mergeArrayByField = (fieldNames, keyfield) => {
return (existing = [], incoming, { readField, mergeObjects }) => {
const merged = existing ? existing.slice(0) : [];
const objectFieldToIndex = Object.create(null);
if (existing) {
existing.forEach((obj, index) => {
objectFieldToIndex[readField(fieldNames[keyfield], obj)] = index;
});
}
incoming &&
incoming.forEach((obj) => {
const field = readField(fieldNames[keyfield], obj);
const index = objectFieldToIndex[field];
if (typeof index === "number") {
const newvalue = { ...existing[index] };
Object.keys(obj).forEach((entry) => {
if (
Object.keys(fieldNames).some((fieldName) => fieldName === entry)
) {
newvalue[entry] = mergeArrayByField(fieldNames, entry)(
existing[index][entry],
obj[entry],
{ readField, mergeObjects }
);
} else if (Array.isArray(obj[entry])) {
newvalue[entry] = mergeObjectWithArrayEntry(
existing[index][entry],
obj[entry],
{ mergeObjects }
);
} else {
newvalue[entry] = safeMergeObjects(
existing[index][entry],
obj[entry],
mergeObjects
);
}
});
merged[index] = newvalue;
} else {
objectFieldToIndex[fieldNames[keyfield]] = merged.length;
merged.push(obj);
}
});
return merged;
};
};
export const policies = {
typePolicies: {
Subscription: {
fields: {
featuredTrackAndRaceMtpOrStatusUpdate: {
merge(existing, incoming) {
return incoming;
}
}
}
},
Track: {
merge(existing, incoming, { mergeObjects }) {
return safeMergeObjects(existing, incoming, mergeObjects);
},
fields: {
races: {
merge(existing, incoming, { readField, mergeObjects }) {
return mergeArrayByField({ main: "id" }, "main")(
existing,
incoming,
{ readField, mergeObjects }
);
}
},
location: {
merge(existing, incoming, { mergeObjects }) {
return safeMergeObjects(existing, incoming, mergeObjects);
}
}
}
},
Race: {
fields: {
numRaces: {
merge: true
},
status: {
merge(existing, incoming) {
return incoming;
}
},
video: {
merge: true
},
promos: {
merge(existing, incoming) {
return incoming ? [...incoming] : null;
}
},
highlighted: {
merge(existing, incoming) {
return incoming;
}
},
location: {
merge: true
},
surface: {
merge: true
},
type: {
merge: true
},
raceClass: {
merge: true
},
changes: {
surface: {
merge: true
},
horse: {
merge: true
}
},
timeform: { merge: true },
talentPicks: {
merge(existing, incoming) {
return isArray(incoming) ? [...incoming] : [...existing];
}
},
wagerTypes: {
merge(existing, incoming) {
return incoming ? [...incoming] : null;
}
},
racePools: {
merge(existing, incoming) {
return incoming ? [...incoming] : null;
}
},
runnersPools: {
merge(existing, incoming) {
return incoming ? [...incoming] : null;
}
},
willPays: {
type: {
merge: true
},
payouts: {
merge(existing, incoming) {
return incoming ? [...incoming] : null;
}
},
legResults: {
merge(existing, incoming) {
return incoming ? [...incoming] : null;
}
}
},
probables: {
merge(existing, incoming) {
return incoming ? [...incoming] : null;
}
},
results: {
runners: {
merge(existing, incoming) {
return incoming ? [...incoming] : null;
}
},
payoffs: {
merge(existing, incoming) {
return incoming ? [...incoming] : null;
}
}
},
bettingInterests: {
merge(existing, incoming, { args, readField, mergeObjects }) {
return get(args, "page", null) && get(args, "page.results", null)
? [...incoming]
: mergeArrayByField(
{ main: "biNumber", runners: "runnerId" },
"main"
)(existing, incoming, {
readField,
mergeObjects
});
}
}
}
},
PastResultsType: {
fields: {
runners: {
read(runners, { variables }) {
const runnerResult = runners.find(
({ entityRunnerId }) =>
entityRunnerId.toString() === variables?.entityRunnerId
);
if (variables?.entityRunnerId && runnerResult) {
return [runnerResult];
}
return runners.slice().sort((a, b) => {
if (a.finishPosition === null) {
return 1;
}
if (b.finishPosition === null) {
return -1;
}
return a.finishPosition - b.finishPosition;
});
},
merge: mergeArrayByField({ main: "entityRunnerId" }, "main")
}
}
},
WagerHistoryResponse: {
fields: {
totals: {
merge(existing, incoming) {
return lodashMerge({ ...existing }, { ...incoming });
}
},
cancelLimits: {
merge: true
},
wagers: {
merge: mergeArrayByField({ main: "id" }, "main")
},
groupWagers: {
merge(existing = [], incoming = []) {
return incoming ? [...incoming] : [...existing];
}
},
futureWagersList: {
total: { merge: true },
wagers: {
merge(existing, incoming) {
return incoming ? [...incoming] : [...existing];
}
}
},
wagersList: {
totals: {
merge(existing, incoming) {
return lodashMerge({ ...existing }, { ...incoming });
}
},
wagers: {
merge(existing, incoming) {
return incoming ? [...incoming] : [...existing];
}
}
},
groupWagersList: {
total: { merge: true },
groupWagers: {
merge(existing, incoming) {
return incoming ? [...incoming] : [...existing];
}
}
}
}
}
},
resultCaching: false,
canonizeResults: false
};
export default { policies };
webpack://frontend-tpt/../../node_modules/graphql-ws/lib/common.mjs
/**
*
* common
*
*/
import { areGraphQLErrors, extendedTypeof, isObject } from './utils.mjs';
/**
* The WebSocket sub-protocol used for the [GraphQL over WebSocket Protocol](https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverWebSocket.md).
*
* @category Common
*/
export const GRAPHQL_TRANSPORT_WS_PROTOCOL = 'graphql-transport-ws';
/**
* The deprecated subprotocol used by [subscriptions-transport-ws](https://github.com/apollographql/subscriptions-transport-ws).
*
* @private
*/
export const DEPRECATED_GRAPHQL_WS_PROTOCOL = 'graphql-ws';
/**
* `graphql-ws` expected and standard close codes of the [GraphQL over WebSocket Protocol](https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverWebSocket.md).
*
* @category Common
*/
export var CloseCode;
(function (CloseCode) {
CloseCode[CloseCode["InternalServerError"] = 4500] = "InternalServerError";
CloseCode[CloseCode["InternalClientError"] = 4005] = "InternalClientError";
CloseCode[CloseCode["BadRequest"] = 4400] = "BadRequest";
CloseCode[CloseCode["BadResponse"] = 4004] = "BadResponse";
/** Tried subscribing before connect ack */
CloseCode[CloseCode["Unauthorized"] = 4401] = "Unauthorized";
CloseCode[CloseCode["Forbidden"] = 4403] = "Forbidden";
CloseCode[CloseCode["SubprotocolNotAcceptable"] = 4406] = "SubprotocolNotAcceptable";
CloseCode[CloseCode["ConnectionInitialisationTimeout"] = 4408] = "ConnectionInitialisationTimeout";
CloseCode[CloseCode["ConnectionAcknowledgementTimeout"] = 4504] = "ConnectionAcknowledgementTimeout";
/** Subscriber distinction is very important */
CloseCode[CloseCode["SubscriberAlreadyExists"] = 4409] = "SubscriberAlreadyExists";
CloseCode[CloseCode["TooManyInitialisationRequests"] = 4429] = "TooManyInitialisationRequests";
})(CloseCode || (CloseCode = {}));
/**
* Types of messages allowed to be sent by the client/server over the WS protocol.
*
* @category Common
*/
export var MessageType;
(function (MessageType) {
MessageType["ConnectionInit"] = "connection_init";
MessageType["ConnectionAck"] = "connection_ack";
MessageType["Ping"] = "ping";
MessageType["Pong"] = "pong";
MessageType["Subscribe"] = "subscribe";
MessageType["Next"] = "next";
MessageType["Error"] = "error";
MessageType["Complete"] = "complete";
})(MessageType || (MessageType = {}));
/**
* Validates the message against the GraphQL over WebSocket Protocol.
*
* Invalid messages will throw descriptive errors.
*
* @category Common
*/
export function validateMessage(val) {
if (!isObject(val)) {
throw new Error(`Message is expected to be an object, but got ${extendedTypeof(val)}`);
}
if (!val.type) {
throw new Error(`Message is missing the 'type' property`);
}
if (typeof val.type !== 'string') {
throw new Error(`Message is expects the 'type' property to be a string, but got ${extendedTypeof(val.type)}`);
}
switch (val.type) {
case MessageType.ConnectionInit:
case MessageType.ConnectionAck:
case MessageType.Ping:
case MessageType.Pong: {
if (val.payload != null && !isObject(val.payload)) {
throw new Error(`"${val.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${val.payload}"`);
}
break;
}
case MessageType.Subscribe: {
if (typeof val.id !== 'string') {
throw new Error(`"${val.type}" message expects the 'id' property to be a string, but got ${extendedTypeof(val.id)}`);
}
if (!val.id) {
throw new Error(`"${val.type}" message requires a non-empty 'id' property`);
}
if (!isObject(val.payload)) {
throw new Error(`"${val.type}" message expects the 'payload' property to be an object, but got ${extendedTypeof(val.payload)}`);
}
if (typeof val.payload.query !== 'string') {
throw new Error(`"${val.type}" message payload expects the 'query' property to be a string, but got ${extendedTypeof(val.payload.query)}`);
}
if (val.payload.variables != null && !isObject(val.payload.variables)) {
throw new Error(`"${val.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${extendedTypeof(val.payload.variables)}`);
}
if (val.payload.operationName != null &&
extendedTypeof(val.payload.operationName) !== 'string') {
throw new Error(`"${val.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${extendedTypeof(val.payload.operationName)}`);
}
if (val.payload.extensions != null && !isObject(val.payload.extensions)) {
throw new Error(`"${val.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${extendedTypeof(val.payload.extensions)}`);
}
break;
}
case MessageType.Next: {
if (typeof val.id !== 'string') {
throw new Error(`"${val.type}" message expects the 'id' property to be a string, but got ${extendedTypeof(val.id)}`);
}
if (!val.id) {
throw new Error(`"${val.type}" message requires a non-empty 'id' property`);
}
if (!isObject(val.payload)) {
throw new Error(`"${val.type}" message expects the 'payload' property to be an object, but got ${extendedTypeof(val.payload)}`);
}
break;
}
case MessageType.Error: {
if (typeof val.id !== 'string') {
throw new Error(`"${val.type}" message expects the 'id' property to be a string, but got ${extendedTypeof(val.id)}`);
}
if (!val.id) {
throw new Error(`"${val.type}" message requires a non-empty 'id' property`);
}
if (!areGraphQLErrors(val.payload)) {
throw new Error(`"${val.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(val.payload)}`);
}
break;
}
case MessageType.Complete: {
if (typeof val.id !== 'string') {
throw new Error(`"${val.type}" message expects the 'id' property to be a string, but got ${extendedTypeof(val.id)}`);
}
if (!val.id) {
throw new Error(`"${val.type}" message requires a non-empty 'id' property`);
}
break;
}
default:
throw new Error(`Invalid message 'type' property "${val.type}"`);
}
return val;
}
/**
* Checks if the provided value is a valid GraphQL over WebSocket message.
*
* @deprecated Use `validateMessage` instead.
*
* @category Common
*/
export function isMessage(val) {
try {
validateMessage(val);
return true;
}
catch (_a) {
return false;
}
}
/**
* Parses the raw websocket message data to a valid message.
*
* @category Common
*/
export function parseMessage(data, reviver) {
return validateMessage(typeof data === 'string' ? JSON.parse(data, reviver) : data);
}
/**
* Stringifies a valid message ready to be sent through the socket.
*
* @category Common
*/
export function stringifyMessage(msg, replacer) {
validateMessage(msg);
return JSON.stringify(msg, replacer);
}
webpack://frontend-tpt/../../node_modules/@apollo/client/link/subscriptions/index.js
// This file is adapted from the graphql-ws npm package:
// https://github.com/enisdenjo/graphql-ws
//
// Most of the file comes from that package's README; some other parts (such as
// isLikeCloseEvent) come from its source.
//
// Here's the license of the original code:
//
// The MIT License (MIT)
//
// Copyright (c) 2020-2021 Denis Badurina
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import { __assign, __extends } from "tslib";
import { print } from "../../utilities/index.js";
import { ApolloLink } from "../core/index.js";
import { isNonNullObject, Observable } from "../../utilities/index.js";
import { ApolloError } from "../../errors/index.js";
// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event
function isLikeCloseEvent(val) {
return isNonNullObject(val) && "code" in val && "reason" in val;
}
// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event
function isLikeErrorEvent(err) {
var _a;
return isNonNullObject(err) && ((_a = err.target) === null || _a === void 0 ? void 0 : _a.readyState) === WebSocket.CLOSED;
}
var GraphQLWsLink = /** @class */ (function (_super) {
__extends(GraphQLWsLink, _super);
function GraphQLWsLink(client) {
var _this = _super.call(this) || this;
_this.client = client;
return _this;
}
GraphQLWsLink.prototype.request = function (operation) {
var _this = this;
return new Observable(function (observer) {
return _this.client.subscribe(__assign(__assign({}, operation), { query: print(operation.query) }), {
next: observer.next.bind(observer),
complete: observer.complete.bind(observer),
error: function (err) {
if (err instanceof Error) {
return observer.error(err);
}
var likeClose = isLikeCloseEvent(err);
if (likeClose || isLikeErrorEvent(err)) {
return observer.error(
// reason will be available on clean closes
new Error("Socket closed".concat(likeClose ? " with event ".concat(err.code) : "").concat(likeClose ? " ".concat(err.reason) : "")));
}
return observer.error(new ApolloError({
graphQLErrors: Array.isArray(err) ? err : [err],
}));
},
});
});
};
return GraphQLWsLink;
}(ApolloLink));
export { GraphQLWsLink };
//# sourceMappingURL=index.js.map
webpack://frontend-tpt/../../node_modules/graphql-ws/lib/utils.mjs
/** @private */
export function extendedTypeof(val) {
if (val === null) {
return 'null';
}
if (Array.isArray(val)) {
return 'array';
}
return typeof val;
}
/** @private */
export function isObject(val) {
return extendedTypeof(val) === 'object';
}
/** @private */
export function isAsyncIterable(val) {
return typeof Object(val)[Symbol.asyncIterator] === 'function';
}
/** @private */
export function isAsyncGenerator(val) {
return (isObject(val) &&
typeof Object(val)[Symbol.asyncIterator] === 'function' &&
typeof val.return === 'function'
// for lazy ones, we only need the return anyway
// typeof val.throw === 'function' &&
// typeof val.next === 'function'
);
}
/** @private */
export function areGraphQLErrors(obj) {
return (Array.isArray(obj) &&
// must be at least one error
obj.length > 0 &&
// error has at least a message
obj.every((ob) => 'message' in ob));
}
/**
* Limits the WebSocket close event reason to not exceed a length of one frame.
* Reference: https://datatracker.ietf.org/doc/html/rfc6455#section-5.2.
*
* @private
*/
export function limitCloseReason(reason, whenTooLong) {
return reason.length < 124 ? reason : whenTooLong;
}
webpack://frontend-tpt/../../node_modules/graphql-ws/lib/client.mjs
/**
*
* client
*
*/
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
};
import { GRAPHQL_TRANSPORT_WS_PROTOCOL, CloseCode, MessageType, parseMessage, stringifyMessage, } from './common.mjs';
import { isObject, limitCloseReason } from './utils.mjs';
/** This file is the entry point for browsers, re-export common elements. */
export * from './common.mjs';
/**
* Creates a disposable GraphQL over WebSocket client.
*
* @category Client
*/
export function createClient(options) {
const { url, connectionParams, lazy = true, onNonLazyError = console.error, lazyCloseTimeout: lazyCloseTimeoutMs = 0, keepAlive = 0, disablePong, connectionAckWaitTimeout = 0, retryAttempts = 5, retryWait = async function randomisedExponentialBackoff(retries) {
let retryDelay = 1000; // start with 1s delay
for (let i = 0; i < retries; i++) {
retryDelay *= 2;
}
await new Promise((resolve) => setTimeout(resolve, retryDelay +
// add random timeout from 300ms to 3s
Math.floor(Math.random() * (3000 - 300) + 300)));
}, shouldRetry = isLikeCloseEvent, isFatalConnectionProblem, on, webSocketImpl,
/**
* Generates a v4 UUID to be used as the ID using `Math`
* as the random number generator. Supply your own generator
* in case you need more uniqueness.
*
* Reference: https://gist.github.com/jed/982883
*/
generateID = function generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}, jsonMessageReplacer: replacer, jsonMessageReviver: reviver, } = options;
let ws;
if (webSocketImpl) {
if (!isWebSocket(webSocketImpl)) {
throw new Error('Invalid WebSocket implementation provided');
}
ws = webSocketImpl;
}
else if (typeof WebSocket !== 'undefined') {
ws = WebSocket;
}
else if (typeof global !== 'undefined') {
ws =
global.WebSocket ||
// @ts-expect-error: Support more browsers
global.MozWebSocket;
}
else if (typeof window !== 'undefined') {
ws =
window.WebSocket ||
// @ts-expect-error: Support more browsers
window.MozWebSocket;
}
if (!ws)
throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");
const WebSocketImpl = ws;
// websocket status emitter, subscriptions are handled differently
const emitter = (() => {
const message = (() => {
const listeners = {};
return {
on(id, listener) {
listeners[id] = listener;
return () => {
delete listeners[id];
};
},
emit(message) {
var _a;
if ('id' in message)
(_a = listeners[message.id]) === null || _a === void 0 ? void 0 : _a.call(listeners, message);
},
};
})();
const listeners = {
connecting: (on === null || on === void 0 ? void 0 : on.connecting) ? [on.connecting] : [],
opened: (on === null || on === void 0 ? void 0 : on.opened) ? [on.opened] : [],
connected: (on === null || on === void 0 ? void 0 : on.connected) ? [on.connected] : [],
ping: (on === null || on === void 0 ? void 0 : on.ping) ? [on.ping] : [],
pong: (on === null || on === void 0 ? void 0 : on.pong) ? [on.pong] : [],
message: (on === null || on === void 0 ? void 0 : on.message) ? [message.emit, on.message] : [message.emit],
closed: (on === null || on === void 0 ? void 0 : on.closed) ? [on.closed] : [],
error: (on === null || on === void 0 ? void 0 : on.error) ? [on.error] : [],
};
return {
onMessage: message.on,
on(event, listener) {
const l = listeners[event];
l.push(listener);
return () => {
l.splice(l.indexOf(listener), 1);
};
},
emit(event, ...args) {
// we copy the listeners so that unlistens dont "pull the rug under our feet"
for (const listener of [...listeners[event]]) {
// @ts-expect-error: The args should fit
listener(...args);
}
},
};
})();
// invokes the callback either when an error or closed event is emitted,
// first one that gets called prevails, other emissions are ignored
function errorOrClosed(cb) {
const listening = [
// errors are fatal and more critical than close events, throw them first
emitter.on('error', (err) => {
listening.forEach((unlisten) => unlisten());
cb(err);
}),
// closes can be graceful and not fatal, throw them second (if error didnt throw)
emitter.on('closed', (event) => {
listening.forEach((unlisten) => unlisten());
cb(event);
}),
];
}
let connecting, locks = 0, lazyCloseTimeout, retrying = false, retries = 0, disposed = false;
async function connect() {
// clear the lazy close timeout immediatelly so that close gets debounced
// see: https://github.com/enisdenjo/graphql-ws/issues/388
clearTimeout(lazyCloseTimeout);
const [socket, throwOnClose] = await (connecting !== null && connecting !== void 0 ? connecting : (connecting = new Promise((connected, denied) => (async () => {
if (retrying) {
await retryWait(retries);
// subscriptions might complete while waiting for retry
if (!locks) {
connecting = undefined;
return denied({ code: 1000, reason: 'All Subscriptions Gone' });
}
retries++;
}
emitter.emit('connecting', retrying);
const socket = new WebSocketImpl(typeof url === 'function' ? await url() : url, GRAPHQL_TRANSPORT_WS_PROTOCOL);
let connectionAckTimeout, queuedPing;
function enqueuePing() {
if (isFinite(keepAlive) && keepAlive > 0) {
clearTimeout(queuedPing); // in case where a pong was received before a ping (this is valid behaviour)
queuedPing = setTimeout(() => {
if (socket.readyState === WebSocketImpl.OPEN) {
socket.send(stringifyMessage({ type: MessageType.Ping }));
emitter.emit('ping', false, undefined);
}
}, keepAlive);
}
}
errorOrClosed((errOrEvent) => {
connecting = undefined;
clearTimeout(connectionAckTimeout);
clearTimeout(queuedPing);
denied(errOrEvent);
if (errOrEvent instanceof TerminatedCloseEvent) {
socket.close(4499, 'Terminated'); // close event is artificial and emitted manually, see `Client.terminate()` below
socket.onerror = null;
socket.onclose = null;
}
});
socket.onerror = (err) => emitter.emit('error', err);
socket.onclose = (event) => emitter.emit('closed', event);
socket.onopen = async () => {
try {
emitter.emit('opened', socket);
const payload = typeof connectionParams === 'function'
? await connectionParams()
: connectionParams;
// connectionParams might take too long causing the server to kick off the client
// the necessary error/close event is already reported - simply stop execution
if (socket.readyState !== WebSocketImpl.OPEN)
return;
socket.send(stringifyMessage(payload
? {
type: MessageType.ConnectionInit,
payload,
}
: {
type: MessageType.ConnectionInit,
// payload is completely absent if not provided
}, replacer));
if (isFinite(connectionAckWaitTimeout) &&
connectionAckWaitTimeout > 0) {
connectionAckTimeout = setTimeout(() => {
socket.close(CloseCode.ConnectionAcknowledgementTimeout, 'Connection acknowledgement timeout');
}, connectionAckWaitTimeout);
}
enqueuePing(); // enqueue ping (noop if disabled)
}
catch (err) {
emitter.emit('error', err);
socket.close(CloseCode.InternalClientError, limitCloseReason(err instanceof Error ? err.message : new Error(err).message, 'Internal client error'));
}
};
let acknowledged = false;
socket.onmessage = ({ data }) => {
try {
const message = parseMessage(data, reviver);
emitter.emit('message', message);
if (message.type === 'ping' || message.type === 'pong') {
emitter.emit(message.type, true, message.payload); // received
if (message.type === 'pong') {
enqueuePing(); // enqueue next ping (noop if disabled)
}
else if (!disablePong) {
// respond with pong on ping
socket.send(stringifyMessage(message.payload
? {
type: MessageType.Pong,
payload: message.payload,
}
: {
type: MessageType.Pong,
// payload is completely absent if not provided
}));
emitter.emit('pong', false, message.payload);
}
return; // ping and pongs can be received whenever
}
if (acknowledged)
return; // already connected and acknowledged
if (message.type !== MessageType.ConnectionAck)
throw new Error(`First message cannot be of type ${message.type}`);
clearTimeout(connectionAckTimeout);
acknowledged = true;
emitter.emit('connected', socket, message.payload, retrying); // connected = socket opened + acknowledged
retrying = false; // future lazy connects are not retries
retries = 0; // reset the retries on connect
connected([
socket,
new Promise((_, reject) => errorOrClosed(reject)),
]);
}
catch (err) {
socket.onmessage = null; // stop reading messages as soon as reading breaks once
emitter.emit('error', err);
socket.close(CloseCode.BadResponse, limitCloseReason(err instanceof Error ? err.message : new Error(err).message, 'Bad response'));
}
};
})())));
// if the provided socket is in a closing state, wait for the throw on close
if (socket.readyState === WebSocketImpl.CLOSING)
await throwOnClose;
let release = () => {
// releases this connection
};
const released = new Promise((resolve) => (release = resolve));
return [
socket,
release,
Promise.race([
// wait for
released.then(() => {
if (!locks) {
// and if no more locks are present, complete the connection
const complete = () => socket.close(1000, 'Normal Closure');
if (isFinite(lazyCloseTimeoutMs) && lazyCloseTimeoutMs > 0) {
// if the keepalive is set, allow for the specified calmdown time and
// then complete if the socket is still open.
lazyCloseTimeout = setTimeout(() => {
if (socket.readyState === WebSocketImpl.OPEN)
complete();
}, lazyCloseTimeoutMs);
}
else {
// otherwise complete immediately
complete();
}
}
}),
// or
throwOnClose,
]),
];
}
/**
* Checks the `connect` problem and evaluates if the client should retry.
*/
function shouldRetryConnectOrThrow(errOrCloseEvent) {
// some close codes are worth reporting immediately
if (isLikeCloseEvent(errOrCloseEvent) &&
(isFatalInternalCloseCode(errOrCloseEvent.code) ||
[
CloseCode.InternalServerError,
CloseCode.InternalClientError,
CloseCode.BadRequest,
CloseCode.BadResponse,
CloseCode.Unauthorized,
// CloseCode.Forbidden, might grant access out after retry
CloseCode.SubprotocolNotAcceptable,
// CloseCode.ConnectionInitialisationTimeout, might not time out after retry
// CloseCode.ConnectionAcknowledgementTimeout, might not time out after retry
CloseCode.SubscriberAlreadyExists,
CloseCode.TooManyInitialisationRequests,
// 4499, // Terminated, probably because the socket froze, we want to retry
].includes(errOrCloseEvent.code)))
throw errOrCloseEvent;
// client was disposed, no retries should proceed regardless
if (disposed)
return false;
// normal closure (possibly all subscriptions have completed)
// if no locks were acquired in the meantime, shouldnt try again
if (isLikeCloseEvent(errOrCloseEvent) && errOrCloseEvent.code === 1000)
return locks > 0;
// retries are not allowed or we tried to many times, report error
if (!retryAttempts || retries >= retryAttempts)
throw errOrCloseEvent;
// throw non-retryable connection problems
if (!shouldRetry(errOrCloseEvent))
throw errOrCloseEvent;
// @deprecated throw fatal connection problems immediately
if (isFatalConnectionProblem === null || isFatalConnectionProblem === void 0 ? void 0 : isFatalConnectionProblem(errOrCloseEvent))
throw errOrCloseEvent;
// looks good, start retrying
return (retrying = true);
}
// in non-lazy (hot?) mode always hold one connection lock to persist the socket
if (!lazy) {
(async () => {
locks++;
for (;;) {
try {
const [, , throwOnClose] = await connect();
await throwOnClose; // will always throw because releaser is not used
}
catch (errOrCloseEvent) {
try {
if (!shouldRetryConnectOrThrow(errOrCloseEvent))
return;
}
catch (errOrCloseEvent) {
// report thrown error, no further retries
return onNonLazyError === null || onNonLazyError === void 0 ? void 0 : onNonLazyError(errOrCloseEvent);
}
}
}
})();
}
function subscribe(payload, sink) {
const id = generateID(payload);
let done = false, errored = false, releaser = () => {
// for handling completions before connect
locks--;
done = true;
};
(async () => {
locks++;
for (;;) {
try {
const [socket, release, waitForReleaseOrThrowOnClose] = await connect();
// if done while waiting for connect, release the connection lock right away
if (done)
return release();
const unlisten = emitter.onMessage(id, (message) => {
switch (message.type) {
case MessageType.Next: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- payload will fit type
sink.next(message.payload);
return;
}
case MessageType.Error: {
(errored = true), (done = true);
sink.error(message.payload);
releaser();
return;
}
case MessageType.Complete: {
done = true;
releaser(); // release completes the sink
return;
}
}
});
socket.send(stringifyMessage({
id,
type: MessageType.Subscribe,
payload,
}, replacer));
releaser = () => {
if (!done && socket.readyState === WebSocketImpl.OPEN)
// if not completed already and socket is open, send complete message to server on release
socket.send(stringifyMessage({
id,
type: MessageType.Complete,
}, replacer));
locks--;
done = true;
release();
};
// either the releaser will be called, connection completed and
// the promise resolved or the socket closed and the promise rejected.
// whatever happens though, we want to stop listening for messages
await waitForReleaseOrThrowOnClose.finally(unlisten);
return; // completed, shouldnt try again
}
catch (errOrCloseEvent) {
if (!shouldRetryConnectOrThrow(errOrCloseEvent))
return;
}
}
})()
.then(() => {
// delivering either an error or a complete terminates the sequence
if (!errored)
sink.complete();
}) // resolves on release or normal closure
.catch((err) => {
sink.error(err);
}); // rejects on close events and errors
return () => {
// dispose only of active subscriptions
if (!done)
releaser();
};
}
return {
on: emitter.on,
subscribe,
iterate(request) {
const pending = [];
const deferred = {
done: false,
error: null,
resolve: () => {
// noop
},
};
const dispose = subscribe(request, {
next(val) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
pending.push(val);
deferred.resolve();
},
error(err) {
deferred.done = true;
deferred.error = err;
deferred.resolve();
},
complete() {
deferred.done = true;
deferred.resolve();
},
});
const iterator = (function iterator() {
return __asyncGenerator(this, arguments, function* iterator_1() {
for (;;) {
if (!pending.length) {
// only wait if there are no pending messages available
yield __await(new Promise((resolve) => (deferred.resolve = resolve)));
}
// first flush
while (pending.length) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
yield yield __await(pending.shift());
}
// then error
if (deferred.error) {
throw deferred.error;
}
// or complete
if (deferred.done) {
return yield __await(void 0);
}
}
});
})();
iterator.throw = async (err) => {
if (!deferred.done) {
deferred.done = true;
deferred.error = err;
deferred.resolve();
}
return { done: true, value: undefined };
};
iterator.return = async () => {
dispose();
return { done: true, value: undefined };
};
return iterator;
},
async dispose() {
disposed = true;
if (connecting) {
// if there is a connection, close it
const [socket] = await connecting;
socket.close(1000, 'Normal Closure');
}
},
terminate() {
if (connecting) {
// only if there is a connection
emitter.emit('closed', new TerminatedCloseEvent());
}
},
};
}
/**
* A syntetic close event `4499: Terminated` is issued to the current to immediately
* close the connection without waiting for the one coming from `WebSocket.onclose`.
*
* Terminating is not considered fatal and a connection retry will occur as expected.
*
* Useful in cases where the WebSocket is stuck and not emitting any events;
* can happen on iOS Safari, see: https://github.com/enisdenjo/graphql-ws/discussions/290.
*/
export class TerminatedCloseEvent extends Error {
constructor() {
super(...arguments);
this.name = 'TerminatedCloseEvent';
this.message = '4499: Terminated';
this.code = 4499;
this.reason = 'Terminated';
this.wasClean = false;
}
}
function isLikeCloseEvent(val) {
return isObject(val) && 'code' in val && 'reason' in val;
}
function isFatalInternalCloseCode(code) {
if ([
1000,
1001,
1006,
1005,
1012,
1013,
1014, // Bad Gateway
].includes(code))
return false;
// all other internal errors are fatal
return code >= 1000 && code <= 1999;
}
function isWebSocket(val) {
return (typeof val === 'function' &&
'constructor' in val &&
'CLOSED' in val &&
'CLOSING' in val &&
'CONNECTING' in val &&
'OPEN' in val);
}
webpack://frontend-tpt/./src/apolloClient/ApolloClient.ts
import {
ApolloClient,
InMemoryCache,
createHttpLink,
split,
NormalizedCacheObject
} from "@apollo/client";
import { getMainDefinition } from "@apollo/client/utilities";
import { RetryLink } from "@apollo/client/link/retry";
import { onError } from "@apollo/client/link/error";
import fetch from "node-fetch";
import { policies } from "@tvg/utils/apolloPolicies";
import TVGConf from "@tvg/conf";
import { GraphQLWsLink } from "@apollo/client/link/subscriptions";
import { createClient } from "graphql-ws";
export type GraphClient = "graph" | "fcp" | "rda" | "gas" | "behg";
const getClientURI = (graphClient: GraphClient): string => {
let uri;
switch (graphClient) {
case "rda":
uri = TVGConf().config().service.rda;
break;
default:
uri = TVGConf().config().service.cosmo;
break;
}
return uri;
};
const getClientWsUri = (graphClient: GraphClient): string | null => {
let uri;
switch (graphClient) {
case "graph":
uri = TVGConf().config().service.cosmoWS;
break;
default:
uri = "";
break;
}
return uri.replace("https:", "").replace("http:", "").replace("//", "wss://");
};
export default {
getClient(
graphClient: GraphClient = "graph"
): ApolloClient<NormalizedCacheObject> {
switch (graphClient) {
case "rda":
// @ts-ignore
return this.rdaClient;
case "fcp":
// @ts-ignore
return this.fcpClient;
case "gas":
// @ts-ignore
return this.gasClient;
case "behg":
// @ts-ignore
return this.behgClient;
default:
// @ts-ignore
return this.graphClient;
}
},
setClient(
client: ApolloClient<NormalizedCacheObject>,
type: GraphClient
): void {
switch (type) {
case "rda":
// @ts-ignore
this.rdaClient = client;
break;
case "fcp":
// @ts-ignore
this.fcpClient = client;
break;
case "gas":
// @ts-ignore
this.gasClient = client;
break;
case "behg":
// @ts-ignore
this.behgClient = client;
break;
default:
// @ts-ignore
this.graphClient = client;
break;
}
},
createClient(
ssrMode: boolean = false,
graphClient: GraphClient = "graph"
): ApolloClient<NormalizedCacheObject> {
const httpLink = createHttpLink({
// @ts-ignore
fetch: typeof window === "undefined" ? fetch : window.fetch,
uri: getClientURI(graphClient).replace("http", "https"),
credentials: "include",
headers: {
"x-tvg-context": TVGConf().context()
}
});
const retryLink = new RetryLink({
attempts: () => true,
delay: (count: number) => {
if (count < 25) {
return 2000 * Math.random();
}
return 15000;
}
});
const errorLink = onError(({ graphQLErrors, networkError, operation }) => {
if (graphQLErrors)
graphQLErrors.map(({ message, locations, path }) =>
// eslint-disable-next-line no-console
console.error(
`[GraphQL error]: Operation: ${operation.operationName}, Message: ${message}, Location: ${locations}, Path: ${path}`
)
);
if (networkError) {
console.error(`[Network error]: ${networkError}`); // eslint-disable-line no-console
}
});
let link;
// @ts-ignore
let wsLink;
if (typeof window === "undefined") {
link = errorLink.concat(httpLink);
} else {
const wsUri = getClientWsUri(graphClient);
if (wsUri !== "") {
// @ts-ignore
let activeSocket;
// @ts-ignore
let timedOut;
wsLink = new GraphQLWsLink(
createClient({
url: wsUri || "",
keepAlive: 20_000, // ping server every 10 seconds
on: {
// eslint-disable-next-line
connected: (socket) => (activeSocket = socket),
ping: (received) => {
if (!received)
// sent
timedOut = setTimeout(() => {
// @ts-ignore
if (activeSocket?.readyState === WebSocket.OPEN)
activeSocket?.close(4408, "Request Timeout");
}, 5_000); // wait 5 seconds for the pong and then close the connection
},
pong: (received) => {
// @ts-ignore
if (received) clearTimeout(timedOut); // pong is received, clear connection close timeout
}
},
// @ts-ignore
error: (err) => console.log(err, "ERROR")
})
);
}
const tmplink = wsLink
? split(
// split based on operation type
({ query }) => {
const definition = getMainDefinition(query);
return (
definition.kind === "OperationDefinition" &&
definition.operation === "subscription"
);
},
wsLink,
httpLink
)
: httpLink;
link = retryLink.concat(errorLink).concat(tmplink);
}
const cache = new InMemoryCache(policies);
if (typeof window !== "undefined") {
// @ts-ignore
cache.restore(window.__APOLLO_STATE__); // eslint-disable-line no-underscore-dangle
}
const client = new ApolloClient({
link,
cache,
// @ts-ignore
addTypename: true,
connectToDevTools: true,
ssrMode
});
this.setClient(client, graphClient);
if (wsLink) {
return {
...client,
// @ts-ignore
subscriptionCosmoClient: wsLink?.client,
/* eslint-disable */ // @ts-ignore
subscribe: client.__proto__.subscribe,
// @ts-ignore
stop: client.__proto__.stop
/* eslint-enable */
};
}
return client;
}
};
webpack://frontend-tpt/../../node_modules/redux-thunk/es/index.js
/** A function that accepts a potential "extra argument" value to be injected later,
* and returns an instance of the thunk middleware that uses that value
*/
function createThunkMiddleware(extraArgument) {
// Standard Redux middleware definition pattern:
// See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
var middleware = function middleware(_ref) {
var dispatch = _ref.dispatch,
getState = _ref.getState;
return function (next) {
return function (action) {
// The thunk middleware looks for any functions that were passed to `store.dispatch`.
// If this "action" is really a function, call it and return the result.
if (typeof action === 'function') {
// Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
return action(dispatch, getState, extraArgument);
} // Otherwise, pass the action down the middleware chain as usual
return next(action);
};
};
};
return middleware;
}
var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
// with whatever "extra arg" they want to inject into their thunks
thunk.withExtraArgument = createThunkMiddleware;
export default thunk;
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/reducers/app.js
export const initialState = {
currentRace: {},
betSelections: [[]],
favoriteSelections: [[]],
startBetting: false,
betState: "none",
betAmount: 0,
betType: null,
betLeg: 0,
queryWithRaces: false,
scratchedSelections: [[]],
fixWagerSelector: {
isWagerSelectorFixed: false,
fixedOffset: 0
},
isTalentsRaceSelectorOpen: false,
isTalentDropdownOpen: false,
talentList: [],
selectedTalentId: "",
selectTalentIdErrorVisible: false,
showBetConfirmation: false
};
const resetArrayNumber = (matrix) => matrix.map(() => []);
const resetArrayString = (matrix) => matrix.map(() => []);
export default function reducer(state = initialState, action) {
switch (action.type) {
case "SET_BET_CONFIRMATION": {
return {
...state,
showBetConfirmation: action.payload
};
}
case "SET_START_BETTING": {
return {
...state,
startBetting: action.payload
};
}
case "SET_BET_AMOUNT": {
return {
...state,
betAmount: action.payload
};
}
case "SET_SELECTION_SCRATCHED": {
return {
...state,
scratchedSelections: action.payload
};
}
case "SET_BET_TYPE": {
return {
...state,
betType: action.payload
};
}
case "SET_BET_SELECTIONS": {
return {
...state,
betSelections: action.payload
};
}
case "SET_SELECTIONS_MATRIX": {
return {
...state,
betSelections: action.payload.selections,
favoriteSelections: action.payload.favoriteSelections
};
}
case "SET_FAVORITE_SELECTIONS": {
return {
...state,
favoriteSelections: action.payload
};
}
case "RESET_BET_SELECTIONS": {
return {
...state,
betSelections: resetArrayNumber(state.betSelections),
favoriteSelections: resetArrayString(state.favoriteSelections),
startBetting: false
};
}
case "RESET_BETTING": {
return {
...state,
betSelections: [[]],
favoriteSelections: [[]],
startBetting: false,
betState: "none",
betAmount: 0,
betType: null,
betLeg: 0
};
}
case "SET_BET_STATE": {
return {
...state,
betState: action.payload
};
}
case "SET_PICK_LEG": {
return {
...state,
betLeg: action.payload
};
}
case "SET_QUERY_WITH_RACES": {
return {
...state,
queryWithRaces: action.payload
};
}
case "SET_CURRENT_RACE": {
return {
...state,
currentRace: action.payload
};
}
case "FIX_WAGER_SELECTOR": {
return {
...state,
fixWagerSelector: action.payload
};
}
case "TALENT_TOGGLE_RACE_SELECTOR": {
return {
...state,
isTalentsRaceSelectorOpen: !state.isTalentsRaceSelectorOpen
};
}
case "TALENT_TOGGLE_TALENT_DROPDOWN": {
return {
...state,
isTalentDropdownOpen: !state.isTalentDropdownOpen
};
}
case "TALENT_SET_SELECTED_TALENT_ID": {
return {
...state,
selectedTalentId: action.payload
};
}
case "NO_TALENT_ID_SELECTED_WARNING_VISIBLE": {
return {
...state,
selectTalentIdErrorVisible: action.payload
};
}
case "TALENT_POPULATE_LIST": {
return {
...state,
talentList: action.payload
};
}
default: {
return state;
}
}
}
webpack://frontend-tpt/../../packages/tvg-comp-tracks/src/tracks-az/reducers.js
export const initialState = {
favoriteTracks: [],
wagerProfile: "PORT-Generic",
accountNumber: "",
shouldUpdate: false,
openTracks: []
};
export default function reducer(state = initialState, action) {
switch (action.type) {
case "TRACKSAZ_TOGGLE_TRACK": {
return {
...state,
openTracks: action.payload.openTracks
};
}
default: {
return state;
}
}
}
webpack://frontend-tpt/../../packages/tvg-comp-bet/reducers.js
import { get } from "lodash";
export const initialState = {
config: {
isProcessing: false,
isBetPlaced: false,
isBettingError: false,
errorBetMessage: "",
betConfirmationTitle: "",
repeatBetNumber: 1,
randomTalentPhrase: "",
randomTalentPhraseId: -1,
hasFeedback: false,
feedbackType: "error",
partialFailure: false,
partialInfo: "",
partialInfoDetails: "",
feedbackTitle: "",
feedbackMsg: ""
},
repeatBetNumber: 1,
showRepeatBet: false
};
export default function reducer(state = initialState, action) {
switch (action.type) {
case "SET_BET_TICKET_STATE": {
return {
...state,
config: { ...state.config, ...action.payload }
};
}
case "SET_BET_REPEAT_NUMBER": {
return {
...state,
repeatBetNumber: get(action, "payload")
};
}
case "SET_SHOW_REPEAT_BET": {
return {
...state,
showRepeatBet: action.payload
};
}
default: {
return state;
}
}
}
webpack://frontend-tpt/../../packages/tvg-comp-tpt-home/src/reducers.js
export const initialState = {
talentPicksList: [],
loading: true
};
export default function reducer(state = initialState, action) {
switch (action.type) {
case "TPM_PICKS_LOADING": {
return {
...state,
loading: action.payload
};
}
case "TPM_PICKS_REQUEST_SUCCESS_NO_RESULTS": {
return {
...state,
talentPicksList: []
};
}
case "TPM_PICKS_REQUEST_SUCCESS": {
return {
...state,
talentPicksList: action.payload
};
}
case "TPM_PICKS_REQUEST_PUBLISH_SUCCESS": {
return {
...state,
talentPicksList: action.payload
};
}
case "TPM_PICKS_REQUEST_FAIL": {
return { ...state };
}
default: {
return state;
}
}
}
webpack://frontend-tpt/./src/reducers/App/userDataReducer.ts
import type { AddressSelection, UserInfo } from "@tvg/ts-types/User";
import type { UserActions } from "../../actions/user";
export interface State {
error: boolean;
hasRequested: boolean;
logged: boolean;
logging: boolean;
user: UserInfo & {
isAdmin: boolean;
};
wasLogin: boolean;
balance: number | null;
balancePoller: number;
preferences: Object;
}
export const initialState = {
error: false,
hasRequested: false,
logged: false,
logging: false,
user: {
accountNumber: "",
emailAddress: "",
firstName: "",
homeAddress: {
streetNumber: "",
address1: "",
address2: "",
city: "",
state: "",
stateAbbr: "",
type: "RESIDENTIAL" as AddressSelection,
country: "",
zipCode: ""
},
lastName: "",
mailingAddress: {
streetNumber: "",
address1: "",
address2: "",
city: "",
state: "",
stateAbbr: "",
type: "MAILING" as AddressSelection,
country: "",
zipCode: ""
},
primaryPhone: "",
profile: "PORT-AllTracks",
signalProviderId: "",
status: "",
transportId: "",
userName: "",
wagerStatus: 0,
isAdmin: false,
accountRoles: []
},
preferences: {},
wasLogin: false,
balance: null,
balancePoller: 120
};
// eslint-disable-next-line @typescript-eslint/default-param-last
const userDataReducer = (state: State = initialState, action: UserActions) => {
switch (action.type) {
case "USER_DATA_UPDATE": {
return { ...state, ...action.payload };
}
case "USER_LOGGED_STATE": {
return { ...state, logged: action.payload.isLogged };
}
case "USER_ADMIN_UPDATE": {
return { ...state, user: { ...state.user, isAdmin: action.payload } };
}
case "USER_ACCOUNT_NUMBER": {
return {
...state,
user: { ...state.user, accountNumber: action.payload.accountNumber }
};
}
default: {
return state;
}
}
};
export default userDataReducer;
webpack://frontend-tpt/./src/services/talentsFetchingService/reducers.ts
import { type Talent } from "@tvg/ts-types/Talent";
import type { Actions } from "./actions";
export type State = {
talentsList: Talent[];
loading: boolean;
};
export const initialState = {
talentsList: [],
loading: true
};
export default function reducer(
// eslint-disable-next-line @typescript-eslint/default-param-last
state: State = initialState,
action: Actions
): State {
switch (action.type) {
case "TPM_LOADING": {
return {
...state,
loading: action.payload
};
}
case "TPM_REQUEST_SUCCESS_NO_RESULTS": {
return {
...state,
talentsList: []
};
}
case "TPM_REQUEST_SUCCESS": {
return {
...state,
talentsList: action.payload
};
}
case "TPM_REQUEST_FAIL": {
return { ...state };
}
default: {
return state;
}
}
}
webpack://frontend-tpt/./src/reducers/index.ts
import { combineReducers } from "redux";
// Talent program reducers
import TalentProgram, {
type State as TLPState,
initialState as initialTLPState
// @ts-ignore
} from "@tvg/talent-program/reducers/app";
import TalentProgramLoading, {
type Loading as LoadingTLPState,
initialState as initialLoadingTLPState
// @ts-ignore
} from "@tvg/talent-program/reducers/loading";
import tracksAzReducer, {
type State as TracksAzState,
initialState as initialTracksAzState
// @ts-ignore
} from "@tvg/tracks/src/tracks-az/reducers";
import betTicketReducer, {
type State as betTicketState,
initialState as initialBetTicketState
// @ts-ignore
} from "@tvg/bet/reducers";
import talentPicksListReducer, {
type State as TalentPicksListState,
initialState as initialTalentPicksListState
// @ts-ignore
} from "@tvg/tpt-home/src/reducers";
import userDataReducer, {
type State as UserState,
initialState as initialUserState
} from "./App/userDataReducer";
import talentsListReducer, {
type State as TalentsListState,
initialState as initialTalentsListState
} from "../services/talentsFetchingService/reducers";
import appReducer from "./App/appReducer";
export interface State {
userData: UserState;
tracksAz: TracksAzState;
TalentProgram: TLPState;
TalentProgramLoading: LoadingTLPState;
Talents: TalentsListState;
TalentPicks: TalentPicksListState;
BetTicket: betTicketState;
}
export const initialState = {
userData: initialUserState,
tracksAz: initialTracksAzState,
TalentProgram: initialTLPState,
TalentProgramLoading: initialLoadingTLPState,
Talents: initialTalentsListState,
TalentPicks: initialTalentPicksListState,
BetTicket: initialBetTicketState
};
export default combineReducers({
app: appReducer,
userData: userDataReducer,
tracksAz: tracksAzReducer,
TalentProgram,
TalentProgramLoading,
Talents: talentsListReducer,
TalentPicks: talentPicksListReducer,
BetTicket: betTicketReducer
});
webpack://frontend-tpt/../../packages/tvg-comp-talent-pick-program/reducers/loading.js
export const initialState = false;
export default function reducer(state = initialState, action) {
switch (action.type) {
case "GRAPH_REQUEST_PENDING": {
return true;
}
case "GRAPH_REQUEST_FINISH": {
return false;
}
default: {
return state;
}
}
}
webpack://frontend-tpt/./src/configureStore.ts
import { createStore, compose, applyMiddleware } from "redux";
import type { Store } from "redux";
import thunk from "redux-thunk";
import reducers, { initialState, type State } from "./reducers";
let composeEnhancers = compose;
/* eslint-disable */
// @ts-ignore
composeEnhancers =
typeof window === "object" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? // @ts-ignore
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({})
: compose;
/* eslint-enable */
// eslint-disable-next-line
export default (state: State = initialState): Store<State, any> => {
const middlewares = [thunk];
const enhancer = composeEnhancers(applyMiddleware(...middlewares));
// @ts-ignore
const store = createStore(reducers, state, enhancer);
if (module.hot) {
module.hot.accept("./reducers", () =>
import("./reducers").then((reducerModule) =>
store.replaceReducer(reducerModule.default)
)
);
}
return store;
};
webpack://frontend-tpt/./src/entry-client.tsx
import React, { type ComponentType } from "react";
import { ApolloProvider } from "@apollo/client";
import { Provider } from "react-redux";
import { BrowserRouter } from "react-router-dom";
import tvgConf from "@tvg/conf";
import { hydrateRoot } from "react-dom/client";
import Root from "./pages";
import ApolloClient from "./apolloClient/ApolloClient";
import configureStore from "./configureStore";
// @ts-ignore
const preloadedState = window.__TPT_PRELOADED_STATE__; // eslint-disable-line no-underscore-dangle
// @ts-ignore
delete window.__TPT_PRELOADED_STATE__; // eslint-disable-line no-underscore-dangle
tvgConf(window.location.hostname, window.navigator.userAgent);
const store = configureStore(preloadedState);
const hotRender = (App: ComponentType) =>
hydrateRoot(
// @ts-ignore
document.getElementById("talentPicksTool"),
<ApolloProvider client={ApolloClient.createClient(false)}>
<Provider store={store}>
<BrowserRouter>
<App />
</BrowserRouter>
</Provider>
</ApolloProvider>
);
if (process.env.NODE_ENV === "development") {
// @ts-ignore
if (module.hot) {
// @ts-ignore
module.hot.accept();
}
// @ts-ignore
if (!window.store) {
// @ts-ignore
window.store = store;
}
}
export default hotRender(Root);