source map exposed
analyzed
https://4njbets.us.betfair.com/static/rcf/assets/credentialsReset.ead742fcc4043c5403ec.js
map: https://4njbets.us.betfair.com/static/rcf/assets/credentialsReset.ead742fcc4043c5403ec.js.map
799 source files
4.3 MB map size
32 endpoints found
47 secrets found
discovered 6 hours, 29 minutes ago
799
source files
4.3 MB
map size
47
secrets
32
endpoints
secrets from source map (47)
gcpKey
{'key': 'AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks'}
0.9
Source: webpack://frontend-rcf/../../packages/tvg-lib-conf/content/staging/base.ts
gcpKey
{'key': 'AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks'}
0.9
Source: webpack://frontend-rcf/../../packages/tvg-lib-conf/content/production/base.ts
gcpKey
{'key': 'AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks'}
0.9
Source: webpack://frontend-rcf/../../packages/tvg-lib-conf/content/aws-stg/base.ts
gcpKey
{'key': 'AIzaSyCvQe2IeP1DnZT6v0PLK-n4bjK9RqcEarQ'}
0.9
Source: webpack://frontend-rcf/../../packages/tvg-lib-conf/content/qa/base.ts
gcpKey
{'key': 'AIzaSyCvQe2IeP1DnZT6v0PLK-n4bjK9RqcEarQ'}
0.9
Source: webpack://frontend-rcf/../../packages/tvg-lib-conf/content/default.ts
gcpKey
{'key': 'AIzaSyBwhD0RAB-vMDrx4IDcO_gezIVGpn7dFks'}
0.9
Source: webpack://frontend-rcf/../../packages/tvg-lib-conf/content/aws-prd/base.ts
gcpKey
{'key': 'AIzaSyCvQe2IeP1DnZT6v0PLK-n4bjK9RqcEarQ'}
0.9
Source: webpack://frontend-rcf/../../packages/tvg-lib-conf/content/aws-int/base.ts
internal_url
typeof process.env.ENVIRONMENT === "string" &&
0.8
Source map: webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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
var validateFormat = process.env.NODE_ENV !== "production" ? function (format) {
0.8
Source map: webpack://frontend-rcf/../../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
if (process.env.NODE_ENV === 'production') {
0.8
Source map: webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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
var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';
0.8
Source map: webpack://frontend-rcf/../../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
return process.env.NODE_ENV !== 'production' ? prefix + "-" + name + "-" + hashedString : prefix + "-" + hashedString;
0.8
Source map: webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
0.8
Source map: webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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
if (process.env.NODE_ENV === 'production') {
0.8
Source map: webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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') {
0.8
Source map: webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../node_modules/react-router-dom/dist/index.js
}
if (process.env.NODE_ENV !== "production") {
HistoryRouter.displayName = "unstable_HistoryRouter";
}
internal_url
* uri: 'http://localhost:4000/',
0.8
Source map: webpack://frontend-rcf/../../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 !== 'production') {
0.8
Source map: webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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
url: "https://storage.googleapis.com",
0.8
Source map: webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-lib-conf/content/staging/base.ts
},
gcs: {
url: "https://storage.googleapis.com",
tvgStatic: "tvg-static-staging"
}
endpoints from source map (32)
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
../../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/globals/index.js
GET
../utilities/index.js
GET
../../errors/index.js
GET
../../utilities/common/incrementalResult.js
GET
../caching/index.js
GET
../common/arrays.js
GET
../core/index.js
GET
../../utilities/caching/getMemoryInternals.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/
GET
/sportsbook
source file tree (799)
799 files with original sourcewebpack://frontend-rcf/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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/axios/index.js
module.exports = require('./lib/axios');
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/axios/lib/cancel/isCancel.js
'use strict';
module.exports = function isCancel(value) {
return !!(value && value.__CANCEL__);
};
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/axios/lib/defaults/transitional.js
'use strict';
module.exports = {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
};
webpack://frontend-rcf/../../node_modules/axios/lib/env/data.js
module.exports = {
"version": "0.27.2"
};
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/axios/lib/helpers/null.js
// eslint-disable-next-line strict module.exports = null;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-lib-api/protocolSetter.ts
import { get } from "lodash";
const getProtocol = () => (get(global, "appConf", false) ? "https:" : "");
export default getProtocol;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-lib-conf/utils/fdr/storyblok.ts
module.exports = {
STORYBLOK_TOKENS: {
QA: "O5iNnduumLUeBTEXgAUvRgtt",
STAGING: "gH2jxeroVxBkGa6Uvekv1wtt",
PRODUCTION: "YngyYOiNVuwhQx0qf0oynQtt"
}
};
webpack://frontend-rcf/../../packages/tvg-lib-conf/utils/mep/amplitude.ts
module.exports = {
AMPLITUDE_API_KEYS: {
QA: "9f0f370fab408d6e388b0aedce7d7f5d",
STAGING: "fe68f6456a5b8261fb971f9ef7b0825f",
PRODUCTION: "b632c2d052db2bf1e2da225654d64cce"
}
};
webpack://frontend-rcf/../../packages/tvg-lib-conf/utils/tvg4/amplitude.ts
module.exports = {
AMPLITUDE_API_KEYS: {
QA: "5c88fe8d83b3fe0e258ce1ebb0e2963d",
STAGING: "e3cca0c4e7b31d9282bc6afa3538b70e",
PRODUCTION: "29fd9abf9fb0e60e22136ab6f59a84b1"
}
};
webpack://frontend-rcf/../../packages/tvg-lib-conf/utils/urp/amplitude.ts
module.exports = {
AMPLITUDE_API_KEYS: {
QA: "5c88fe8d83b3fe0e258ce1ebb0e2963d",
STAGING: "e3cca0c4e7b31d9282bc6afa3538b70e",
PRODUCTION: "29fd9abf9fb0e60e22136ab6f59a84b1"
}
};
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/lodash/_Symbol.js
var root = require('./_root');
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
webpack://frontend-rcf/../../node_modules/lodash/_Uint8Array.js
var root = require('./_root');
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/lodash/_getPrototype.js
var overArg = require('./_overArg');
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/lodash/_metaMap.js
var WeakMap = require('./_WeakMap');
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
module.exports = metaMap;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/lodash/_realNames.js
/** Used to lookup unminified function names. */
var realNames = {};
module.exports = realNames;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/lodash/fp/_falseOptions.js
module.exports = {
'cap': false,
'curry': false,
'fixed': false,
'immutable': false,
'rearg': false
};
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/lodash/fp/get.js
var convert = require('./convert'),
func = convert('get', require('../get'));
func.placeholder = require('./placeholder');
module.exports = func;
webpack://frontend-rcf/../../node_modules/lodash/fp/noop.js
var convert = require('./convert'),
func = convert('noop', require('../noop'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
webpack://frontend-rcf/../../node_modules/lodash/fp/placeholder.js
/**
* The default argument placeholder value for methods.
*
* @type {Object}
*/
module.exports = {};
webpack://frontend-rcf/../../node_modules/lodash/fp/set.js
var convert = require('./convert'),
func = convert('set', require('../set'));
func.placeholder = require('./placeholder');
module.exports = func;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/rehackt/index.js
"use strict";
module.exports = require("react");
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/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;
}
webpack://frontend-rcf/webpack/runtime/amd define
__webpack_require__.amdD = function () {
throw new Error('define cannot be used indirect');
};
webpack://frontend-rcf/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-rcf/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-rcf/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-rcf/webpack/runtime/hasOwnProperty shorthand
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
webpack://frontend-rcf/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-rcf/webpack/runtime/node module decorator
__webpack_require__.nmd = (module) => {
module.paths = [];
if (!module.children) module.children = [];
return module;
};
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/@apollo/client/version.js
export var version = "3.9.4"; //# sourceMappingURL=version.js.map
webpack://frontend-rcf/../../node_modules/@apollo/client/utilities/globals/maybe.js
export function maybe(thunk) {
try {
return thunk();
}
catch (_a) { }
}
//# sourceMappingURL=maybe.js.map
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-lib-utils/apolloContext.js
import React from "react";
const ApolloContext = React.createContext({
fcpClient: null,
rdaClient: null,
behgClient: null
});
export default ApolloContext;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/@apollo/client/link/core/split.js
import { ApolloLink } from "./ApolloLink.js";
export var split = ApolloLink.split;
//# sourceMappingURL=split.js.map
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/@apollo/client/link/core/execute.js
import { ApolloLink } from "./ApolloLink.js";
export var execute = ApolloLink.execute;
//# sourceMappingURL=execute.js.map
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/./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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-lib-mediator/src/EventEmitters/Node.ts
import BaseEventEmitter from "./Base";
class NodeEventEmitter extends BaseEventEmitter {}
export default NodeEventEmitter;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/./src/reducers/App/capiReducer.ts
import mediator from "@tvg/mediator";
import { CapiActions } from "../../actions/capi";
export type State = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
featureToggles: any;
messages: [];
features: [];
};
export const initialState = {
featureToggles: {},
features: [],
messages: []
};
export default function capiReducer(
// @ts-ignore
state: State = initialState,
action: CapiActions
) {
switch (action.type) {
case "FEATURES_GET_SUCCESS": {
mediator.base.dispatch({ type: "FEATURE_TOGGLES_LOADED", payload: {} });
return { ...state, featureToggles: action.payload.featureToggles };
}
case "FEATURES_GET_FAIL": {
return { ...state };
}
case "FEATURES_CHANGE": {
const featureToggles = {
...state.featureToggles,
[action.payload.toggleName]: action.payload.newValue
};
return { ...state, featureToggles };
}
case "FEATURES_RESPONSE": {
return { ...state, features: action.payload.features };
}
case "MESSAGES_GET_SUCCESS":
return { ...state, messages: action.payload.messages };
case "MESSAGES_GET_FAIL": {
return { ...state };
}
default: {
return state;
}
}
}
webpack://frontend-rcf/./src/reducers/App/userDataReducer.ts
import { UserActions } from "../../actions/user";
export type State = {
error: boolean;
hasRequested: boolean;
logged: boolean | typeof undefined;
logging: boolean;
user: {
accountNumber: string;
emailAddress: string;
firstName: string;
homeAddress: {
streetNumber: string;
address1: string;
address2: string;
city: string;
stateAbbr: string;
};
lastName: string;
mailingAddress: {
streetNumber: string;
address1: string;
address2: string;
city: string;
stateAbbr: string;
};
primaryPhone: string;
profile: string;
signalProviderId: string;
status: string;
transportId: string;
userName: string;
wagerStatus: number;
accountRoles: ["USER" | "TALENT" | "WAGEROPS" | "ADMIN"];
};
wasLogin: boolean;
};
export const initialState = {
error: false,
hasRequested: false,
logged: undefined,
logging: false,
loginPin: 0,
tvg3token: "",
userLogin: false,
userLogout: true,
user: {
accountNumber: "",
emailAddress: "",
firstName: "",
homeAddress: {
streetNumber: "",
address1: "",
address2: "",
city: "",
state: "",
stateAbbr: ""
},
lastName: "",
mailingAddress: {
streetNumber: "",
address1: "",
address2: "",
city: "",
state: "",
stateAbbr: ""
},
primaryPhone: "",
profile: "PORT-Generic",
signalProviderId: "",
status: "",
transportId: "",
userName: "",
wagerStatus: 0,
accountRoles: ["USER"]
},
wasLogin: false
};
// @ts-ignore
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, hasRequested: true };
}
case "USER_ACCOUNT_NUMBER": {
return {
...state,
user: { ...state.user, accountNumber: action.payload.accountNumber }
};
}
default: {
return state;
}
}
};
export default userDataReducer;
webpack://frontend-rcf/./src/reducers/index.ts
import { combineReducers } from "redux";
import capiReducer, {
State as CapiState,
initialState as initialCapiState
} from "./App/capiReducer";
import userDataReducer, {
State as UserState,
initialState as initialUserState
} from "./App/userDataReducer";
export type State = {
capi: CapiState;
userData: UserState;
};
export const initialState = {
capi: initialCapiState,
userData: initialUserState
};
// @ts-ignore
export default combineReducers({
capi: capiReducer,
userData: userDataReducer
});
webpack://frontend-rcf/./src/configureStore.ts
import { createStore, compose, applyMiddleware } from "redux";
import thunk from "redux-thunk";
import reducers, { initialState } from "./reducers";
let composeEnhancers = compose;
/* eslint-disable */
// @ts-ignore
composeEnhancers =
// @ts-ignore
typeof window === "object" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? // @ts-ignore
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({})
: compose;
/* eslint-enable */
export default (state = initialState) => {
const middlewares = [thunk];
const enhancer = composeEnhancers(applyMiddleware(...middlewares));
// @ts-ignore
const store = createStore(reducers, state, enhancer);
// @ts-ignore
if (module.hot) {
// @ts-ignore
module.hot.accept("./reducers", () =>
import("./reducers").then((reducerModule) =>
store.replaceReducer(reducerModule.default)
)
);
}
return store;
};
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-lib-utils/featuresUtils.jsx
import tvgConf from "@tvg/conf";
import { get } from "lodash";
export const getCapiFeatureToggles = (store, key, defaultValue) => {
if (key.includes("-beta") && tvgConf().isProduction) {
return false;
}
return get(store, `capi.featureToggles.${key}`, defaultValue);
};
const calculateFeatureOverride = (
hasFeaturesOverrides,
featureOverrides,
toggle
) => {
const { percentage } = toggle;
const overrides = featureOverrides;
let { enabled } = toggle;
let random = 0;
// Disable feature override if toggle was disabled or percentage is 0
if (
featureOverrides[toggle.name] &&
(!toggle.enabled || toggle.percentage === 0)
) {
enabled = false;
overrides[toggle.name] = { enabled, percentage };
}
// Calculate new feature throttle by percentage or if it was disabled and percentage was increased
if (
(!hasFeaturesOverrides && toggle.enabled && toggle.percentage < 100) ||
(featureOverrides[toggle.name] &&
!featureOverrides[toggle.name].enabled &&
percentage > featureOverrides[toggle.name].percentage)
) {
random = Math.floor(Math.random() * 100 + 1);
enabled = toggle.percentage >= random;
overrides[toggle.name] = { enabled, percentage };
}
return overrides;
};
export default calculateFeatureOverride;
webpack://frontend-rcf/./src/actions/capi.ts
type FeaturesRequestSuccessAction = {
type: "FEATURES_GET_SUCCESS";
payload: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
featureToggles: any;
};
};
type FeaturesRequestFailAction = {
type: "FEATURES_GET_FAIL";
payload: Error;
error: true;
};
type FeaturesChange = {
type: "FEATURES_CHANGE";
payload: {
toggleName: string;
newValue: boolean;
};
};
type FeaturesResponseAction = {
type: "FEATURES_RESPONSE";
payload: {
features: [];
};
};
type MessagesRequestSuccessAction = {
type: "MESSAGES_GET_SUCCESS";
payload: {
messages: false;
};
};
type MessagesRequestFailAction = {
type: "MESSAGES_GET_FAIL";
payload: Error;
error: true;
};
export type CapiActions =
| MessagesRequestFailAction
| MessagesRequestSuccessAction
| FeaturesRequestFailAction
| FeaturesRequestSuccessAction
| FeaturesResponseAction
| FeaturesChange;
export const successFeaturesRequest = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
featureToggles: any
): FeaturesRequestSuccessAction => ({
type: "FEATURES_GET_SUCCESS",
payload: {
featureToggles
}
});
export const failFeaturesRequest = (err: Error): FeaturesRequestFailAction => ({
type: "FEATURES_GET_FAIL",
payload: err,
error: true
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const featuresResponse = (features: any): FeaturesResponseAction => ({
type: "FEATURES_RESPONSE",
payload: {
features
}
});
export const successMessagesRequest = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
messagesData: any
): MessagesRequestSuccessAction => ({
type: "MESSAGES_GET_SUCCESS",
payload: {
messages: messagesData
}
});
export const failMessagesRequest = (err: Error): MessagesRequestFailAction => ({
type: "MESSAGES_GET_FAIL",
payload: err,
error: true
});
webpack://frontend-rcf/./src/actions/user.ts
export type UserData = {
error: boolean | null;
hasRequested: boolean;
logged: boolean;
logging: boolean;
user: {
accountNumber: string;
emailAddress: string;
firstName: string;
homeAddress: {
streetNumber: string;
address1: string;
address2: string;
city: string;
stateAbbr: string;
};
lastName: string;
mailingAddress: {
streetNumber: string;
address1: string;
address2: string;
city: string;
stateAbbr: string;
};
primaryPhone: string;
profile: string;
signalProviderId: string;
status: string;
transportId: string;
userName: string;
wagerStatus: number;
accountRoles: ["USER" | "TALENT" | "WAGEROPS" | "ADMIN"];
};
wasLogin: boolean;
userLogin: boolean;
userLogout: boolean;
loginPin: number;
tvg3token: string;
};
type UserSessionSuccessAction = {
type: "USER_DATA_UPDATE";
payload: UserData;
};
export type SetUserLoggedState = {
type: "USER_LOGGED_STATE";
payload: {
isLogged: boolean;
};
};
export type SetUserAccountNumber = {
type: "USER_ACCOUNT_NUMBER";
payload: {
accountNumber: string;
};
};
export type UserActions =
| UserSessionSuccessAction
| SetUserAccountNumber
| SetUserLoggedState;
export const getUserData = (userData: UserData): UserSessionSuccessAction => ({
type: "USER_DATA_UPDATE",
payload: userData
});
export const setUserLoggedState = (isLogged: boolean): SetUserLoggedState => ({
type: "USER_LOGGED_STATE",
payload: {
isLogged
}
});
export const setUserAccountNumber = (
accountNumber: string
): SetUserAccountNumber => ({
type: "USER_ACCOUNT_NUMBER",
payload: {
accountNumber
}
});
webpack://frontend-rcf/../../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-rcf/../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
export default function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-lib-utils/mediatorUtils.js
import TvgConfig from "@tvg/conf";
import mediator from "@tvg/mediator";
import * as mediatorClassic from "@tvg/mediator-classic/src";
const FULL_URL_REGEX = /^https?:\/\//;
const RELATIVE_PATH_REGEX = /^\/+(.*)/;
const NATIVE_PRODUCTS = ["iosnative", "androidnative"];
const EXTERNAL_APP_PRODUCTS = [
"ios2",
"androidwrapper",
"fdrandroid",
"tvgandroid"
];
const isFullUrl = (url) => FULL_URL_REGEX.test(url);
const isRelativePath = (url) => RELATIVE_PATH_REGEX.test(url);
export const inferUrl = (url) => {
let inferredUrl;
if (isFullUrl(url)) {
inferredUrl = url;
} else if (isRelativePath(url)) {
inferredUrl = `${window.location.origin}${url}`;
} else {
inferredUrl = `http://${url}`;
}
return inferredUrl;
};
export const openExternalLinkIos = (url) => {
const openExternalApp = inferUrl(url);
mediator.ios.dispatch({
type: "OPEN_EXTERNAL_APP",
payload: {
openExternalApp
}
});
};
export const openExternalLinkNative = (url) => {
const confInstance = TvgConfig();
let absoluteUrl = url;
if (isRelativePath(url)) {
absoluteUrl = confInstance.buildUrl({
app: confInstance.product,
path: url
});
}
window.handleNativeMessages("OPEN_EXTERNAL_URL", {
url: absoluteUrl
});
};
export const openExternalApp = (url) => {
const confInstance = TvgConfig();
if (NATIVE_PRODUCTS.includes(confInstance.product)) {
openExternalLinkNative(url);
} else if (EXTERNAL_APP_PRODUCTS.includes(confInstance.product)) {
openExternalLinkIos(url);
} else if (window) {
const openExternalLink = inferUrl(url);
const tab = window.open(openExternalLink, "_blank");
tab.focus();
}
};
export const openQuickDepositDesktop = () => {
const confInstance = TvgConfig();
if (confInstance.device !== "desktop") return;
mediatorClassic.dispatch("HEADER_DESKTOP_OPEN_SECTION", {
section: "Quick Deposit"
});
mediatorClassic.dispatch("OPEN_QUICK_DEPOSIT", {});
};
export const generateLinkString = (url, text, callback) => {
if (isRelativePath(url))
return `<a href='${url}' onclick='${callback}'>${text}</a>`;
const confInstance = TvgConfig();
if (confInstance.device === "mobile" && confInstance.product === "ios2") {
return `<a href='#' onclick='window.webkit && window.webkit.messageHandlers["OPEN_EXTERNAL_APP"].postMessage({ type: "OPEN_EXTERNAL_APP", payload: { openExternalApp: "${inferUrl(
url
)}"}})'>${text}</a>`;
}
return `<a target='_blank' href='${inferUrl(url)}'>${text}</a>`;
};
export default openExternalLinkIos;
webpack://frontend-rcf/../../packages/tvg-lib-utils/liveChatUtils.js
import { openExternalApp } from "./mediatorUtils";
export const costumerSupportURL = "https://support.tvg.com/s/";
export const openLiveChat = () => {
openExternalApp(costumerSupportURL);
};
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-lib-ts-types/Preferences.ts
export enum CONFIRM_MODAL_PREFERENCE {
ALWAYS = "1",
NEVER = "0"
}
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-lib-api/crf/index.ts
import tvgConf from "@tvg/conf";
import requester from "../requester";
import getProtocol from "../protocolSetter";
import { serviceResponse } from "../types";
const crfService: string = "service.crf";
const getCrfServiceUrl = tvgConf().config(crfService);
const context = tvgConf().context();
export const postUserCredentialsReset = (
token: string
): Promise<serviceResponse> => {
const url = `${getProtocol()}${getCrfServiceUrl}/user`;
const requestOptions = {
method: "POST",
url,
headers: {
"content-type": "application/json",
"x-tvg-context": context
},
data: {
token
},
withCredentials: false
};
return requester()(requestOptions);
};
export const postCredentialsRecovery = (userId: string): Promise<{}> => {
const url = `${getProtocol()}${getCrfServiceUrl}/token`;
const requestOptions = {
method: "POST",
url,
headers: {
"content-type": "application/json",
"x-tvg-context": context
},
data: {
id: userId
},
withCredentials: false
};
return requester()(requestOptions);
};
export const postResendCredentialsRecovery = (token: string): Promise<{}> => {
const url = `${getProtocol()}${getCrfServiceUrl}/reset-token`;
const requestOptions = {
method: "POST",
url,
headers: {
"content-type": "application/json",
"x-tvg-context": context
},
data: {
token
},
withCredentials: false
};
return requester()(requestOptions);
};
export const postNewCredential = (
token: string,
newPassword: string
): Promise<{}> => {
const url = `${getProtocol()}${getCrfServiceUrl}/reset-password`;
const requestOptions = {
method: "POST",
url,
headers: {
"content-type": "application/json",
"x-tvg-context": context
},
data: {
token,
credentials: newPassword
},
withCredentials: false
};
return requester()(requestOptions);
};
export const postNewPin = (token: string, newPassword: string): Promise<{}> => {
const url = `${getProtocol()}${getCrfServiceUrl}/reset-pin`;
const requestOptions = {
method: "POST",
url,
headers: {
"content-type": "application/json",
"x-tvg-context": context
},
data: {
token,
credentials: newPassword
},
withCredentials: false
};
return requester()(requestOptions);
};
/**
* Recover user's login with date of birth and last 4 ssn digits Parameters
* @returns {Promise<{}>}
*/
export const postRecoveryUsername = (
dateOfBirth: string,
last4Ssn: string
): Promise<{
data: Record<string, number | string>;
isAxiosError: boolean;
}> => {
const conf = tvgConf();
const url = `${conf.config().service.crf}/recovery`;
const requestOptions = {
method: "POST",
url,
headers: {
"content-type": "application/json",
"x-tvg-context": conf.context()
},
data: {
birthday: dateOfBirth,
last4Ssn
},
withCredentials: false
};
return requester()(requestOptions) as unknown as Promise<{
data: Record<string, number | string>;
isAxiosError: boolean;
}>;
};
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-atomic-ui/_static/ColorPalette/index.jsx
import ColorPalette from "./palette.json"; export default (color, variation) => ColorPalette[color][variation].value;
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-atomic-ui/_molecule/Info/styled-components.js
import styled, { css } from "styled-components";
import { transparentize } from "polished";
import {
fontNormal,
fontMedium,
fontBold,
defaultSize
} from "../../_static/Typography";
import buildColor from "../../_static/ColorPalette";
export const InfoWrapper = styled.div`
align-items: center;
background-color: ${buildColor("white", "100")};
max-width: 100%;
padding-bottom: 20px;
height: auto;
flex-wrap: wrap;
${({ full }) =>
full
? css`
display: column;
margin: auto;
padding-top: 22px;
`
: css`
display: flex;
`}
`;
export const InfoLogoWrapper = styled.span`
position: relative;
width: ${({ size }) => `${size}px`};
height: ${({ size }) => `${size}px`};
margin-right: 12px;
display: flex;
justify-content: center;
align-items: center;
background-color: ${buildColor("grey", "100")};
border-radius: 40px;
${({ full }) =>
full &&
css`
margin: auto;
`}
`;
export const OverlayIconContainer = styled.span`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
right: 0;
background-color: ${buildColor("white", "100")};
border-radius: 50%;
${({ full }) =>
full
? css`
width: 20px;
height: 20px;
`
: css`
width: 14px;
height: 14px;
`}
`;
export const InfoContainer = styled.div`
display: flex;
flex-direction: column;
flex: 1;
word-wrap: break-word;
${({ full }) =>
full &&
css`
margin-top: 22px;
`}
`;
export const InfoTitle = styled.p`
color: ${buildColor("grey", "900")};
font-family: ${fontBold};
font-size: ${defaultSize};
font-weight: 700;
letter-spacing: 0;
${({ full }) =>
full &&
css`
margin: auto;
`}
`;
export const InfoMessage = styled.div`
color: ${buildColor("grey", "800")};
font-size: ${defaultSize};
font-family: ${fontNormal};
font-weight: 400;
letter-spacing: 0;
padding-top: 4px;
padding-right: 22px;
${({ full }) =>
full &&
css`
margin: auto;
text-align: center;
padding: 4px 36px 0;
`}
`;
export const ButtonContainer = styled.div`
background: ${buildColor("white", "100")};
display: flex;
width: 100%;
flex-wrap: wrap;
padding: 12px 12px 8px;
& > button,
> a {
font-family: ${fontMedium};
font-weight: 500;
text-transform: none;
box-shadow: 0 2px 2px ${transparentize(0.85, buildColor("blue", "900"))};
}
`;
webpack://frontend-rcf/../../packages/tvg-atomic-ui/_molecule/Info/index.jsx
import React from "react";
import { withTheme } from "styled-components";
import { noop } from "lodash";
import buildColor from "../../_static/ColorPalette";
import Icon from "../../_static/Icons";
import {
refresh,
info,
error as errorIcon,
success,
exclamation
} from "../../_static/Icons/icons";
import Button from "../../_atom/Buttons/button";
import ButtonLink from "../../_atom/Buttons/buttonLink";
import {
InfoWrapper,
InfoLogoWrapper,
OverlayIconContainer,
InfoContainer,
InfoTitle,
InfoMessage,
ButtonContainer
} from "./styled-components";
const LOGO_SIZE_M = 40;
const LOGO_SIZE_L = 60;
const MAIN_ICON_SIZE_M = 18;
const MAIN_ICON_SIZE_L = 24;
const OVERLAY_ICON_SIZE_M = 12;
const OVERLAY_ICON_SIZE_L = 16;
const getIcon = (messageType, overlayIcon, overlayIconColor) => {
switch (messageType) {
case "info": {
return {
color: buildColor("blue_accent", "400"),
icon: info
};
}
case "success": {
return {
color: buildColor("green", "500"),
icon: success
};
}
case "warning": {
return {
color: buildColor("yellow", "500"),
icon: exclamation
};
}
case "error": {
return {
color: buildColor("red", "500"),
icon: errorIcon
};
}
default: {
return {
color: overlayIconColor || buildColor("red", "500"),
icon: overlayIcon || errorIcon
};
}
}
};
const Info = ({
messageType,
title,
message,
mainIcon,
overlayIcon,
overlayIconColor,
hasOverlayIcon,
full,
hasButton,
buttonText,
buttonHandler,
buttonUrl,
qaLabel
}) => {
const overlayIconProps = getIcon(messageType, overlayIcon, overlayIconColor);
return (
<InfoWrapper full={full} data-qa-label={`${qaLabel}-wrapper`}>
<InfoLogoWrapper
full={full}
size={full ? LOGO_SIZE_L : LOGO_SIZE_M}
data-qa-label={`${qaLabel}-logo-wrapper`}
>
<Icon
icon={mainIcon}
size={full ? MAIN_ICON_SIZE_L : MAIN_ICON_SIZE_M}
qaLabel={`${qaLabel}-main-icon`}
color={buildColor("grey", "900")}
/>
{hasOverlayIcon && (
<OverlayIconContainer full={full}>
<Icon
icon={overlayIconProps.icon}
size={full ? OVERLAY_ICON_SIZE_L : OVERLAY_ICON_SIZE_M}
qaLabel={`${qaLabel}-overlay-icon`}
color={overlayIconProps.color}
/>
</OverlayIconContainer>
)}
</InfoLogoWrapper>
<InfoContainer full={full}>
<InfoTitle full={full} data-qa-label={`${qaLabel}-title`}>
{title}
</InfoTitle>
<InfoMessage
full={full}
data-qa-label={`${qaLabel}-message`}
as={typeof message === "string" ? "p" : "div"}
>
{message}
</InfoMessage>
</InfoContainer>
{hasButton && (
<ButtonContainer>
{buttonUrl ? (
<ButtonLink
type="secondary"
size="bigger"
isStretched
onClick={buttonHandler}
url={buttonUrl}
qaLabel={`${qaLabel}-button`}
>
{buttonText}
</ButtonLink>
) : (
<Button
type="secondary"
size="bigger"
isStretched
onClick={buttonHandler || window.location.reload}
qaLabel={`${qaLabel}-button`}
>
{buttonText}
</Button>
)}
</ButtonContainer>
)}
</InfoWrapper>
);
};
Info.defaultProps = {
messageType: "error",
mainIcon: refresh,
title: "Something went wrong",
message:
"Sorry we're having tech issues, we are working to resolve these quickly. Check back soon.",
overlayIcon: errorIcon,
overlayIconColor: "",
hasOverlayIcon: true,
full: false,
hasButton: false,
buttonText: "Refresh",
buttonHandler: noop,
buttonUrl: "",
qaLabel: "info-message"
};
export default React.memo(withTheme(Info));
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../node_modules/react-transition-group/esm/config.js
export default {
disabled: false
};
webpack://frontend-rcf/../../node_modules/react-transition-group/esm/TransitionGroupContext.js
import React from 'react'; export default React.createContext(null);
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-atomic-ui/_templates/ModalV2/utils.js
export const stopTouchEvent = (e) => e && e.stopPropagation();
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-atomic-ui/_atom/Input/index.jsx
import { InputElement } from "./styled-components";
export default (inputDataInit) => InputElement(inputDataInit);
webpack://frontend-rcf/../../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-rcf/../../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-rcf/../../packages/tvg-atomic-ui/_organism/CredentialsReset/styled-components.js
import styled, { css } from "styled-components";
import buildColor from "../../_static/ColorPalette";
import { fontNormal, fontBold, fontMedium } from "../../_static/Typography";
import Input from "../../_molecule/LoginInput";
import Button from "../../_atom/Buttons/button";
import ButtonLink from "../../_atom/Buttons/buttonLink";
export const Container = styled.div`
width: 100%;
display: flex;
flex-direction: column;
background-color: ${buildColor("white", "100")};
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
${({ isMobile, windowInnerHeight }) =>
isMobile
? css`
top: initial;
bottom: initial;
height: ${windowInnerHeight ? `${windowInnerHeight}px` : "100vh"};
width: 100vw;
padding: 12px;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
`
: css`
position: fixed;
top: 80px;
width: 391px;
height: 450px;
padding: 20px;
margin: 192px auto 20px;
@media screen and (orientation: landscape) {
margin: auto;
}
`};
`;
/* stylelint-disable */
export const Form = styled.form`
width: 100%;
flex: 1;
font-size: 14px;
background-color: ${buildColor("white", "100")};
display: flex;
flex-direction: column;
position: absolute;
top: 56px;
left: 0;
right: 0;
bottom: 0;
${({ isMobile, windowInnerHeight }) =>
isMobile
? css`
height: ${windowInnerHeight
? `calc(${windowInnerHeight}px - 56px)`
: `calc(100vh - 56px)`};
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
`
: css`
position: fixed;
top: 80px;
width: 391px;
height: 450px;
margin: 136px auto 20px;
@media screen and (orientation: landscape) {
margin: auto;
}
`};
`;
/* stylelint-enable */
export const FormContainer = styled.div`
padding: 12px 12px 20px;
flex: 1;
display: flex;
flex-direction: column;
${({ isMobile }) =>
!isMobile &&
`
padding: 20px;
`};
`;
export const Title = styled.p`
color: ${buildColor("grey", "900")};
font-size: 18px;
font-family: ${fontBold};
font-weight: 700;
margin-bottom: 20px;
`;
export const RulesList = styled.ul`
list-style: ${({ hasBullets }) => (hasBullets ? "disc" : "none")};
padding-left: ${({ hasBullets }) => (hasBullets ? "25px" : 0)};
`;
export const RuleText = styled.li`
color: ${({ isValid }) =>
isValid ? buildColor("green", "800") : buildColor("grey", "700")};
line-height: 18px;
position: relative;
padding-left: 6.5px;
margin-left: ${({ isValid, isPinReset }) =>
isValid && isPinReset ? "18px" : ""};
&:not(:last-child) {
margin-bottom: 12px;
}
svg {
display: ${({ isValid }) => (isValid ? "inline-block" : "none")};
position: absolute;
top: 50%;
z-index: 1;
background: ${buildColor("green", "100")};
border-radius: 50%;
transform: translateY(-50%);
left: ${({ isPinReset }) => (isPinReset ? "-18px" : "-21px")};
}
`;
export const FormGroup = styled.div`
margin-bottom: 20px;
`;
export const FormFooter = styled.div`
${({ isMobile }) => (isMobile ? "margin-top: 20px;" : "margin-top: auto;")};
`;
export const FormLabel = styled.label`
color: ${buildColor("grey", "900")};
display: inline-block;
line-height: 19px;
font-family: ${fontMedium};
margin-bottom: 8px;
`;
export const FormInput = styled(Input)`
label {
line-height: 19px;
margin-bottom: 5px;
color: ${buildColor("grey", "900")};
}
`;
export const RulesDescription = styled.p`
color: ${buildColor("grey", "900")};
font-family: ${fontNormal};
line-height: 18px;
margin-bottom: 12px;
`;
export const FormButton = styled(Button)`
text-transform: capitalize;
box-shadow:
0 2px 4px rgba(17, 43, 68, 0.06),
0 1px 2px rgba(17, 43, 68, 0.08);
margin-bottom: ${({ insideModal }) => (insideModal ? "10px" : "12px")};
margin-top: ${({ insideModal }) => insideModal && "14.5px"};
font-family: ${fontMedium};
opacity: ${({ isDisabled }) => isDisabled && "0.6"};
span {
font-family: ${fontNormal};
}
`;
export const CallToActionWrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
`;
export const StyledLink = styled(ButtonLink)`
font-family: ${fontMedium};
span {
font-family: ${fontNormal};
}
${({ withMarginTop }) => withMarginTop && "margin-top: 10px;"}
`;
export const ModalContent = styled.div`
padding: 16px 12px 10px;
background-color: ${buildColor("white", "100")};
`;
webpack://frontend-rcf/../../packages/tvg-atomic-ui/_organism/CredentialsReset/index.jsx
import React, { PureComponent, Fragment } from "react";
import { noop } from "lodash/fp";
import Text from "../../_atom/Text";
import Icon from "../../_static/Icons";
import { successOutline, account, email } from "../../_static/Icons/icons";
import Spinner from "../../_static/Spinners";
import buildColor from "../../_static/ColorPalette";
import ProcessingOverlay from "../../_static/ProcessingOverlay";
import Info from "../../_molecule/Info";
import MessageBox from "../../_molecule/MessageBoxV2";
import ModalV2 from "../../_templates/ModalV2";
import {
Title,
Form,
RuleText,
RulesList,
FormContainer,
StyledLink,
FormLabel,
FormGroup,
FormInput,
FormButton,
FormFooter,
RulesDescription,
Container,
CallToActionWrapper,
ModalContent
} from "./styled-components";
export default class CredentialsReset extends PureComponent {
static defaultProps = {
resetCredentials: {
title: "",
userIdLabel: "",
useIdField: "email",
inputLabel: "",
inputPlaceholder: "",
inputPattern: "\\S",
requirementsDescription: "",
requirements: [],
buttonText: "",
linkText: ""
},
newCredential: "",
setNewCredential: noop,
submitHandler: noop,
username: "",
isLoading: false,
initialLoading: true,
hasError: false,
hasExpiredToken: false,
isInvalidPassword: false,
onCloseModalCallback: noop,
errorData: {
title: "",
message: "",
buttonText: "",
linkText: "",
returnToHomepage: ""
},
isPinReset: false,
device: "mobile",
modalData: {
title: "",
message: "",
buttonText: "",
linkText: "",
returnToHomepage: "Return to Homepage"
},
isModalOpen: false,
onClose: () => {},
onOpen: () => {},
navigateHome: () => {},
hasResentEmail: false,
resentEmailMessage: {
title: "",
message: ""
},
resentEmailPageMessage: {
title: "",
message: ""
},
returnText: "",
onBlurHandler: noop,
isRn: false,
onCloseModalCTA: noop
};
constructor(props) {
super(props);
this.state = { windowInnerHeight: 0 };
}
componentDidMount() {
if (typeof window !== "undefined") {
this.setWindowInnerHeight();
window.addEventListener("resize", this.setWindowInnerHeight);
}
}
componentWillUnmount() {
if (typeof window !== "undefined") {
window.removeEventListener("resize", this.setWindowInnerHeight);
}
}
setWindowInnerHeight = () => {
this.setState({
windowInnerHeight:
document.documentElement?.clientHeight || window.innerHeight
});
};
renderEmailResentMessage = (message) => (
<span dangerouslySetInnerHTML={{ __html: message }} />
);
renderRules = (
rules,
isPinReset
) =>
rules.map((rule, index) => (
<RuleText
data-qa-label={`input-rule-${index}`}
isValid={rule.verified}
isPinReset={isPinReset}
key={rule.label}
>
<Icon
icon={successOutline}
color={buildColor("green", "800")}
stoke={buildColor("green", "800")}
/>
{rule.label}
</RuleText>
));
renderLoading = () => (
<Container
data-qa-label="reset-password-loading-container"
device={this.props.device}
isMobile={this.props.device === "mobile"}
windowInnerHeight={this.state.windowInnerHeight}
>
<ProcessingOverlay />
</Container>
);
renderSuccess = () => (
<Container
data-qa-label="reset-password-container-success"
device={this.props.device}
isMobile={this.props.device === "mobile"}
windowInnerHeight={this.state.windowInnerHeight}
>
<Info
qaLabel="reset-password-info-success"
mainIcon={email}
hasOverlayIcon
messageType="success"
title={this.props.resentEmailPageMessage.title}
message={this.props.resentEmailPageMessage.message}
full
/>
<CallToActionWrapper>
<StyledLink
qaLabel="reset-password-cta-success"
isStretched
tag="link"
size="huge"
type="tertiary"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
const { onCloseModalCallback } = this.props;
if (onCloseModalCallback) {
onCloseModalCallback("New email was sent");
}
}}
>
{!this.props.isRn
? this.props.returnText
: this.props.modalData.returnToHomepage}
</StyledLink>
</CallToActionWrapper>
</Container>
);
getPrimaryCTAQALabel = () => {
if (this.props.hasExpiredToken) {
return "resend-recovery-email";
}
if (this.props.isInvalidPassword) {
return "try-again";
}
return "open-live-person";
};
renderError = () => {
const {
errorData,
device,
hasExpiredToken,
hasResentEmail,
resentEmailMessage,
isRn
} = this.props;
const infosData = hasExpiredToken
? {
mainIcon: email,
messageType: "warning"
}
: {
mainIcon: account,
messageType: "error"
};
return (
<Container
device={device}
isMobile={device === "mobile"}
windowInnerHeight={this.state.windowInnerHeight}
data-qa-label="loginSignUpBlockFailure"
>
<Info
qaLabel="reset-password-info-failure"
{...infosData}
title={errorData.title}
message={errorData.message}
hasOverlayIcon
full
/>
<CallToActionWrapper>
{hasResentEmail ? (
<MessageBox
qaLabel="reset-password-reset-email"
type="success"
subtype="floating"
title={resentEmailMessage.title}
message={this.renderEmailResentMessage(
resentEmailMessage.message
)}
/>
) : (
<StyledLink
isStretched
size="huge"
url="#"
isUppercase={false}
onClick={this.props.handleOnPrimaryCTAClick}
qaLabel={this.getPrimaryCTAQALabel()}
>
{errorData.buttonText}
</StyledLink>
)}
<StyledLink
isStretched
tag="link"
size="huge"
type="tertiary"
withMarginTop
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
const { onCloseModalCallback } = this.props;
if (onCloseModalCallback) {
onCloseModalCallback(
hasExpiredToken
? "This link has expired"
: "Something went wrong!"
);
}
}}
qaLabel="close-modal-link"
>
{isRn ? errorData.returnToHomepage : errorData.linkText}
</StyledLink>
</CallToActionWrapper>
</Container>
);
};
renderModal = () => {
const { modalData, onCloseModalCTA, navigateHome, isRn } = this.props;
return (
<ModalContent data-qa-label="reset-password-modal-content">
<Text
qaLabel="reset-password-modal-message"
tag="p"
lineHeight="18px"
color={buildColor("grey", "800")}
>
{modalData.message}
</Text>
<FormButton
qaLabel="reset-password-form-cta"
insideModal
size="big"
isStretched
isUppercase={false}
onClick={() => onCloseModalCTA(modalData.buttonText)}
>
<Text tag="span" fontSize={14} lineHeight="16px" font>
{modalData.buttonText}
</Text>
</FormButton>
<StyledLink
qaLabel="reset-password-redirect"
isStretched
tag="link"
size="big"
type="tertiary"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
navigateHome(modalData.linkText);
}}
>
<Text tag="span" fontSize={14} lineHeight="16px">
{isRn ? modalData.returnToHomepage : modalData.linkText}
</Text>
</StyledLink>
</ModalContent>
);
};
render() {
const {
resetCredentials,
submitHandler,
setNewCredential,
newCredential,
username,
isLoading,
initialLoading,
hasError,
hasResentEmail,
isPinReset,
device,
modalData,
isModalOpen,
onOpen,
onClose
} = this.props;
if (hasError) {
return this.renderError();
}
if (hasResentEmail) {
return this.renderSuccess();
}
if (initialLoading) {
return this.renderLoading();
}
return (
<Fragment>
<ModalV2
title={modalData.title}
isOpen={isModalOpen}
onClose={onClose}
animation="fade"
shouldBeClosable={false}
isFullWidth={false}
isFluidWidth={device !== "mobile"}
isFullHeight={false}
qaLabel="bridgeLogin-redirectModal"
>
{() => this.renderModal()}
</ModalV2>
<Form
data-qa-label="reset-password-form"
device={device}
isMobile={device === "mobile"}
windowInnerHeight={this.state.windowInnerHeight}
>
<FormContainer isMobile={device === "mobile"}>
<Title
data-qa-label="reset-password-form-title"
fontSize={18}
tag="p"
>
{resetCredentials.title}
</Title>
<FormGroup>
<FormLabel
data-qa-label="reset-password-form-label"
tag="p"
fontSize="14px"
>
{resetCredentials.userIdLabel}
</FormLabel>
<Text tag="p">{username}</Text>
</FormGroup>
<FormInput
qaLabel="reset-password-password-input"
loginV2
status={null}
type="password"
placeholder={resetCredentials.inputPlaceholder}
isButtonShown
label={resetCredentials.inputLabel}
value={newCredential}
onChangeHandler={(_, value) => {
const re = new RegExp(resetCredentials.inputPattern);
if (value === "" || re.test(value)) {
return setNewCredential(value);
}
return re;
}}
onBlurHandler={() =>
resetCredentials.requirements.every((rule) => rule.verified) &&
this.props.onBlurHandler()
}
/>
<Fragment>
{resetCredentials.requirementsDescription && (
<RulesDescription data-qa-label="reset-password-rules-description">
{resetCredentials.requirementsDescription}
</RulesDescription>
)}
<RulesList
data-qa-label="reset-password-rules-list"
hasBullets={resetCredentials.requirements.length > 1}
>
{this.renderRules(resetCredentials.requirements, isPinReset)}
</RulesList>
</Fragment>
<FormFooter isMobile={device === "mobile"}>
<FormButton
qaLabel="reset-password-form-button"
isDisabled={
!resetCredentials.requirements.every(
(rule) => rule.verified
) && !isLoading
}
size="big"
isStretched
isUppercase={false}
onClick={submitHandler}
>
{isLoading ? (
<Spinner color="white" height={14} width={14} />
) : (
resetCredentials.buttonText
)}
</FormButton>
<StyledLink
qaLabel="reset-password-form-link"
isStretched
tag="a"
size="big"
type="tertiary"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
onOpen();
}}
>
{resetCredentials.linkText}
</StyledLink>
</FormFooter>
</FormContainer>
</Form>
</Fragment>
);
}
}
webpack://frontend-rcf/../../packages/tvg-comp-reset-credentials/index.jsx
import React, { useEffect, useState } from "react";
import { connect } from "react-redux";
import { get, isEqual } from "lodash";
import { isTvg5 } from "@tvg/utils/generalUtils";
import mediator from "@tvg/mediator";
import { openLiveChat } from "@tvg/utils/liveChatUtils";
import { useNavigate } from "@tvg/custom-hooks";
import {
postUserCredentialsReset,
postNewCredential,
postNewPin,
postResendCredentialsRecovery
} from "@tvg/api/crf";
import parseCapiMessage, { replaceCAPIVariables } from "@tvg/utils/capiUtils";
import CredentialsReset from "@tvg/atomic-ui/_organism/CredentialsReset";
const getModalData = (resetCredentialsMsgs, config) => {
const { inputPlaceholder } = config;
const { modal } = resetCredentialsMsgs;
if (!modal || !inputPlaceholder) return modal;
const message = replaceCAPIVariables(modal.message, {
inputPlaceholder: inputPlaceholder.toLowerCase()
});
const buttonText = replaceCAPIVariables(modal.buttonText || "", {
inputPlaceholder
});
return { ...modal, message, buttonText };
};
const RecoveryTypePin = 1;
const ExpiredToken = 117410;
const InvalidPassword = 117411;
const ResetCredentials = (props) => {
const history = useNavigate();
const [newCredential, setNewCredential] = useState("");
const [rulesValidated, setRulesValidated] = useState([]);
const [user, setUser] = useState({});
const [config, setConfig] = useState({});
const [loading, setLoading] = useState(false);
const [initialLoading, setInitialLoading] = useState(true);
const [hasError, setHasError] = useState(false);
const [isModalOpen, setIsModalOpen] = useState(false);
const [errorCode, setErrorCode] = useState(null);
const [hasResentEmail, setHasResentEmail] = useState(false);
const expiredTokenMsg = get(props.resetCredentialsMsgs, "expiredToken");
const invalidPasswordMsg = get(props.resetCredentialsMsgs, "invalidPassword");
const defaultMsg = get(props.resetCredentialsMsgs, "error");
const errorDataMapper = {
[ExpiredToken]: expiredTokenMsg,
[InvalidPassword]: invalidPasswordMsg
};
const gtmHandler = (payload, type) => {
mediator.base.dispatch({
type,
payload: { field: payload }
});
};
useEffect(() => {
if (props.resend) {
postResendCredentialsRecovery(props.token)
.then(() => {
gtmHandler("Success", "FORGOT_CREDENTIALS_EMAIL_LINK_LANDED");
setHasResentEmail(true);
setInitialLoading(false);
})
.catch(() => {
setHasError(true);
});
} else {
postUserCredentialsReset(props.token)
.then((res) => {
gtmHandler("Success", "FORGOT_CREDENTIALS_EMAIL_LINK_LANDED");
setUser(res.data);
})
.catch((err) => {
setHasError(true);
const code = get(err, "response.data.code");
setErrorCode(code);
if (code === ExpiredToken) {
gtmHandler("Link Expired", "FORGOT_CREDENTIALS_EMAIL_LINK_LANDED");
}
});
}
}, []);
useEffect(() => {
if (props.isLogged) {
mediator.base.dispatch({ type: "TVG_LOGIN:DO_LOGOUT" });
}
}, [props.isLogged]);
useEffect(() => {
if (isEqual(user, {}) || isEqual(props.resetCredentialsConfig, {})) return;
const initialConfig = props.resetCredentialsConfig.find(
(credentials) => credentials.recoveryType === user.recoveryType
);
const requirements = initialConfig && initialConfig.requirements;
setRulesValidated(
requirements &&
requirements.map((rule) => ({
...rule,
verified: false
}))
);
setConfig(initialConfig);
setInitialLoading(false);
}, [JSON.stringify(user), JSON.stringify(props.resetCredentialsConfig)]);
useEffect(() => {
setRulesValidated(
rulesValidated.map((rule) => ({
...rule,
verified: new RegExp(rule.rule).test(newCredential)
}))
);
}, [newCredential]);
const openLogin = () => {
mediator.base.dispatch({
type: "OPEN_LOGIN",
payload: {
hasSuccessMessage: true,
successMessage: {
user:
config.userIdField !== "email" ||
(config.userIdField === "email" &&
get(user, "username") === get(user, "email"))
? get(user, `${config.userIdField}`)
: null,
title: replaceCAPIVariables(
get(props.resetCredentialsMsgs, "success.title"),
{
inputPlaceholder: config.inputPlaceholder
}
),
message: replaceCAPIVariables(
get(props.resetCredentialsMsgs, "success.message"),
{
userIdLabel: config.userIdLabel.toLowerCase(),
inputPlaceholder: config.inputPlaceholder.toLowerCase()
}
)
}
}
});
};
const navigateToHome = (label) => {
gtmHandler(label, "FORGOT_CREDENTIALS_LEAVE_PAGE_CTA_CLICK");
if (props.product === "iosnative") {
mediator.base.dispatch({ type: "LEAVE_CRF" });
return;
}
if (props.device === "desktop" && !isTvg5()) {
mediator.base.dispatch({
type: "TVG4_NAVIGATION",
payload: { route: "/" }
});
return;
}
setIsModalOpen(false);
history.push("/");
};
const submitHandler = (e) => {
e.preventDefault();
e.stopPropagation();
gtmHandler(config.inputPlaceholder, "FORGOT_CREDENTIALS_UPDATE_CREDENTIAL");
setLoading(true);
const isRecoveryTypePin = user.recoveryType === RecoveryTypePin;
const postCredentials = isRecoveryTypePin ? postNewPin : postNewCredential;
postCredentials(props.token, newCredential)
.then(() => {
setLoading(false);
gtmHandler(
config.inputPlaceholder,
"FORGOT_CREDENTIALS_UPDATE_CREDENTIAL_SUCCESSFULLY"
);
if (props.product === "iosnative") {
mediator.base.dispatch({
type: "LEAVE_CRF_SUCCESS",
payload: {
user:
config.userIdField !== "email" ||
(config.userIdField === "email" &&
get(user, "username") === get(user, "email"))
? get(user, `${config.userIdField}`)
: null,
recoveryType: isRecoveryTypePin ? "pin" : "password"
}
});
} else {
navigateToHome();
}
openLogin();
})
.catch((err) => {
const code = get(err, "response.data.code");
setErrorCode(code);
setHasError(true);
})
.finally(() => {
setNewCredential("");
});
};
const resendRecoveryEmail = () => {
mediator.base.dispatch({
type: "FORGOT_CREDENTIALS_LINK_EXPIRED"
});
postResendCredentialsRecovery(props.token)
.then(() => {
setHasResentEmail(true);
})
.catch(() => {
setHasError(true);
setHasResentEmail(false);
setErrorCode(null);
});
};
const tryAgain = () => {
setHasError(false);
setLoading(false);
};
const onCloseModal = (module) => {
mediator.base.dispatch({
type: "FORGOT_CREDENTIALS_RETURN_TO_TVG_COM",
payload: {
module
}
});
setHasError(false);
navigateToHome();
};
const handleOnPrimaryCTAClick = (e) => {
e.preventDefault();
e.stopPropagation();
switch (errorCode) {
case ExpiredToken:
resendRecoveryEmail();
break;
case InvalidPassword:
tryAgain();
break;
default:
openLiveChat();
}
};
return (
<CredentialsReset
device={props.device}
newCredential={newCredential}
setNewCredential={setNewCredential}
submitHandler={submitHandler}
resetCredentials={{
...config,
requirements: rulesValidated
}}
username={get(user, `${config.userIdField}`)}
isLoading={loading}
initialLoading={initialLoading}
hasError={hasError}
hasExpiredToken={errorCode === ExpiredToken}
isInvalidPassword={errorCode === InvalidPassword}
isPinReset={rulesValidated.length === 1}
onCloseModalCallback={onCloseModal}
modalData={getModalData(props.resetCredentialsMsgs, config)}
errorData={errorDataMapper[errorCode] || defaultMsg}
isModalOpen={isModalOpen}
navigateHome={navigateToHome}
onCloseModalCTA={(label) => {
const gtmLabel = label.toLowerCase().includes("continue updating")
? "Continue Updating Credentials"
: label;
gtmHandler(gtmLabel, "FORGOT_CREDENTIALS_LEAVE_PAGE_CTA_CLICK");
setIsModalOpen(false);
}}
onClose={() => {
setIsModalOpen(false);
}}
onOpen={() => {
mediator.base.dispatch({
type: "FORGOT_CREDENTIALS_CANCEL_RESET",
payload: {
field: config.inputPlaceholder,
module: "Forgot Credentials"
}
});
setIsModalOpen(true);
}}
resendRecoveryEmail={resendRecoveryEmail}
handleOnPrimaryCTAClick={handleOnPrimaryCTAClick}
hasResentEmail={hasResentEmail}
resentEmailMessage={props.resentEmailMessage}
resentEmailPageMessage={props.resentEmailPageMessage}
returnText={props.returnText}
openLiveChat={openLiveChat}
onBlurHandler={() =>
gtmHandler(config.inputLabel, "FORGOT_CREDENTIALS_NEW_PWPIN")
}
isRn={props.product === "iosnative"}
/>
);
};
ResetCredentials.defaultProps = {
isLogged: false,
resetType: "password",
resetCredentialsConfig: {},
resetCredentialsMsgs: {},
resentEmailMessage: {
title: "",
message: ""
},
resentEmailPageMessage: {
title: "",
message: ""
},
returnText: "",
device: "mobile"
};
export default connect((store) => ({
resetCredentialsConfig: parseCapiMessage(
store,
"capi.messages.resetCredentials"
),
resetCredentialsMsgs: parseCapiMessage(
store,
"capi.messages.resetCredentialsMsgs"
),
resentEmailMessage: get(
parseCapiMessage(store, "capi.messages.credentialsRecoveryModal"),
"success.resent"
),
resentEmailPageMessage: get(
parseCapiMessage(store, "capi.messages.credentialsRecoveryModal"),
"success.resentPage"
),
returnText: get(
parseCapiMessage(store, "capi.messages.credentialsRecoveryModal"),
"return"
)
}))(ResetCredentials);
webpack://frontend-rcf/../../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-rcf/../../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-rcf/./src/pages/components/webview-header/styled-components.ts
import styled, { css } from "styled-components";
import buildColor from "@tvg/atomic-ui/_static/ColorPalette";
export const HeaderContainer = styled.header<{
isMobile: boolean;
isRn: boolean;
}>`
width: 100%;
${({ isMobile }) =>
isMobile
? css`
margin: 16px 0;
background-color: ${buildColor("white", "100")};
box-shadow: inset 0 -1px 0 ${buildColor("blue", "100")};
`
: css`
position: relative;
margin: 20px 0 80px;
background-color: transparent;
`}
display: flex;
justify-content: center;
${({ isRn, isMobile }) =>
isRn &&
isMobile &&
css`
top: 0;
position: absolute;
background-color: red;
margin: 0;
background-color: ${buildColor("white", "100")};
height: 56px !important;
display: flex;
align-items: center;
z-index: 20;
`};
${({ isRn, isMobile }) =>
isRn &&
!isMobile &&
css`
@media only screen and (min-height: 768px) {
margin: 0;
position: fixed;
top: 120px;
}
@media only screen and (max-height: 768px) {
margin: 0;
position: initial;
margin-bottom: 80px;
}
`};
`;
export default HeaderContainer;
webpack://frontend-rcf/./src/pages/components/webview-header/index.tsx
import React, { useCallback, useEffect } from "react";
import { Link } from "react-router-dom";
import mediator from "@tvg/mediator";
import Logo from "@tvg/atomic-ui/_static/Logos";
import { noop } from "lodash";
import HeaderContainer from "./styled-components";
type Props = {
device: string;
brand: string;
isRn: boolean;
};
const Header = (props: Props) => {
const isMobile = props.device === "mobile";
const handleNavigation = useCallback(
(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
if (props.device === "desktop") {
mediator.base.dispatch({
type: "TVG4_NAVIGATION",
payload: { route: "/home" }
});
} else {
mediator.base.dispatch({ type: "LEAVE_CRF" });
}
e.stopPropagation();
e.preventDefault();
},
[]
);
useEffect(() => {
mediator.base.subscribe("LEAVE_CRF", noop);
}, []);
return (
<HeaderContainer isMobile={isMobile} isRn={props.isRn}>
<Link to="/home" onClick={handleNavigation}>
<Logo
height={isMobile ? 18 : 28}
brand={props.brand}
data-qa-label="tvgLogo"
isDark
/>
</Link>
</HeaderContainer>
);
};
export default Header;
webpack://frontend-rcf/./src/pages/components/MicroApp/styled-components.ts
import styled, { css } from "styled-components";
import buildColor from "@tvg/atomic-ui/_static/ColorPalette";
const Wrapper = styled.div<{ device: string; isRn: boolean }>`
background-color: ${buildColor("blue", "000")};
width: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
${({ device }) =>
device === "desktop"
? css`
align-items: center;
margin: auto;
& > form,
& > div {
position: relative;
top: 0;
margin-top: 0;
inset: 0;
max-height: 532px;
@media screen and (orientation: landscape) {
margin: 0 auto 20px;
}
}
`
: css`
align-items: flex-start;
`}
${({ isRn, device }) =>
isRn &&
device === "tablet" &&
css`
& > form,
& > div {
@media only screen and (min-height: 768px) {
margin: 0 auto;
top: calc(120px + 80px + 31px);
position: fixed;
}
@media only screen and (max-height: 768px) {
margin: 0;
position: initial;
}
}
@media only screen and (max-height: 768px) {
display: flex;
justify-content: center;
align-items: center;
}
`}
`;
export default Wrapper;
webpack://frontend-rcf/./src/pages/components/MicroApp/index.tsx
/* eslint-disable react/default-props-match-prop-types */
/* eslint-disable react/destructuring-assignment */
/* eslint-disable react/require-default-props */
import React, { useEffect } from "react";
import { get, noop } from "lodash";
import mediator from "@tvg/mediator";
import queryString from "query-string";
import ResetCredentials from "@tvg/reset-credentials";
import WebviewHeader from "../webview-header";
import perf from "../../utils/perf";
import Wrapper from "./styled-components";
type Props = {
isLogged: boolean;
device: string;
product: string;
brand: string;
location: Location;
};
export const CredentialsRecovery = (props: Props) => {
useEffect(() => {
perf.measure("page_render", { page: "reset-credentials" });
}, [props]);
const urlParams = queryString.parse(get(props.location, "search"));
useEffect(() => {
mediator.base.subscribe("LEAVE_CRF", noop);
mediator.base.subscribe("OPEN_EXTERNAL_URL", noop);
mediator.base.subscribe("LEAVE_CRF_SUCCESS", noop);
}, []);
return (
<Wrapper device={props.device} isRn={props.product === "iosnative"}>
<WebviewHeader
device={props.device}
brand={props.brand}
isRn={props.product === "iosnative"}
/>
<ResetCredentials
isLogged={props.isLogged}
token={urlParams.token}
resend={urlParams.resend}
device={props.device}
product={props.product}
/>
</Wrapper>
);
};
export default CredentialsRecovery;
webpack://frontend-rcf/./src/pages/utils/perf.ts
declare global {
interface Window {
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-explicit-any
perf: Record<string, any>;
}
}
export default {
register: (mark: string, timing: number | null = null) => {
if (typeof window === "object" && window.perf) {
window.perf.register(mark, timing);
}
},
measure: (mark: string, tags: Record<string, string> | null = null) => {
if (typeof window === "object" && window.perf) {
window.perf.measure(mark, tags);
}
}
};
webpack://frontend-rcf/./src/pages/index.tsx
/* eslint-disable react/destructuring-assignment */
import React, { PureComponent } from "react";
import { Route, Routes } from "react-router-dom";
import withRouter from "@tvg/utils/withCustomRouter";
import { connect } from "react-redux";
import { Dispatch } from "redux";
import { attempt, get, isEmpty } from "lodash";
import tvgConf from "@tvg/conf";
import LoginService from "@tvg/login-service";
import * as mediatorClassic from "@tvg/mediator-classic/src";
import mediator from "@tvg/mediator";
import calculateFeatureOverride from "@tvg/utils/featuresUtils";
import {
failFeaturesRequest,
failMessagesRequest,
successFeaturesRequest,
successMessagesRequest
} from "../actions/capi";
import {
getUserData,
setUserAccountNumber,
setUserLoggedState,
UserData
} from "../actions/user";
import MicroApp from "./components/MicroApp";
type Props = {
userData: UserData;
isLogged: boolean;
dispatch: Dispatch;
features: [];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
featureToggles: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
messages: any;
location: Location;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
history: any;
};
export class Main extends PureComponent<Props> {
tvg = tvgConf();
device = get(this.tvg, "device");
product = get(this.tvg, "product");
brand = get(this.tvg, "brand");
componentDidMount() {
if (typeof window !== "undefined") {
LoginService.validateSession().then(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(response: { success: { data: any } }) => {
if (response.success) {
// @ts-ignore
this.props.dispatch(getUserData(response.success.data));
this.props.dispatch(setUserLoggedState(true));
} else {
this.props.dispatch(setUserLoggedState(false));
}
}
);
if (!isEmpty(this.props.features)) {
const featureToggles = {};
let featureOverrides = this.getFeaturesOverrides() || {};
const hasFeaturesOverrides = !!this.getFeaturesOverrides();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.props.features.forEach((toggle: any) => {
let { enabled } = toggle;
featureOverrides = calculateFeatureOverride(
hasFeaturesOverrides,
featureOverrides,
toggle
);
if (get(featureOverrides, toggle.name)) {
// eslint-disable-next-line prefer-destructuring
enabled = featureOverrides[toggle.name].enabled;
}
// @ts-ignore
featureToggles[toggle.name] = enabled;
});
if (typeof window !== "undefined" && !isEmpty(featureOverrides)) {
this.setFeaturesOverrides(featureOverrides);
}
this.props.dispatch(successFeaturesRequest(featureToggles));
} else {
this.getFeatures();
}
this.getMessages();
// 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(() => {
if (window.sessionStorage.getItem("userId")) {
this.props.dispatch(
setUserAccountNumber(
window.sessionStorage.getItem("userId") as string
)
);
}
});
mediatorClassic.subscribe("UPDATE_ROUTER", () => {
const pathWithParameters = window.location.href.replace(
window.location.origin,
""
);
if (this.props.location.pathname !== pathWithParameters) {
this.props.history.replace(pathWithParameters);
}
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
mediator.base.subscribe("TVG4_NAVIGATION", (data: any) => {
mediatorClassic.dispatch("TVG4_NAVIGATION", data.payload);
});
mediatorClassic.subscribeWithPast(
"TVG_LOGIN:USER_SESSION_UPDATE",
(data: UserData) => {
this.props.dispatch(getUserData(data));
}
);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
mediator.base.subscribe("TVG_LOGIN:DO_LOGOUT", (data: any) => {
mediatorClassic.dispatch("TVG_LOGIN:DO_LOGOUT", data.payload);
});
}
}
componentWillUnmount() {
// @ts-ignore
if (this.unlisten) {
// @ts-ignore
this.unlisten();
}
}
getFeaturesOverrides = () =>
attempt(
() =>
JSON.parse(window.localStorage.getItem("featureOverrides") as string),
false
);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setFeaturesOverrides = (features: any) =>
attempt(() =>
window.localStorage.setItem("featureOverrides", JSON.stringify(features))
);
getFeatures = () =>
typeof window !== "undefined" &&
this.tvg
.getFeatures()
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.then((response: any) => {
const featureToggles = {};
let featureOverrides = this.getFeaturesOverrides() || {};
const hasFeaturesOverrides = !!this.getFeaturesOverrides();
if (response && Array.isArray(response.featureToggles)) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
response.featureToggles.forEach((toggle: any) => {
let { enabled } = toggle;
featureOverrides = calculateFeatureOverride(
hasFeaturesOverrides,
featureOverrides,
toggle
);
if (get(featureOverrides, toggle.name)) {
// eslint-disable-next-line prefer-destructuring
enabled = featureOverrides[toggle.name].enabled;
}
// @ts-ignore
featureToggles[toggle.name] = enabled;
});
}
if (!isEmpty(featureOverrides)) {
this.setFeaturesOverrides(featureOverrides);
}
this.props.dispatch(successFeaturesRequest(featureToggles));
})
.catch((err: Error) => this.props.dispatch(failFeaturesRequest(err)));
getMessages = () => {
const messageNamespaces = ["Global", "PasswordRecovery"];
return (
this.tvg
.getMessages(messageNamespaces)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.then((response: any) =>
this.props.dispatch(successMessagesRequest(response))
)
.catch((err: Error) => this.props.dispatch(failMessagesRequest(err)))
);
};
render = () => (
<Routes>
<Route
path="/credentials-reset"
element={
<MicroApp
isLogged={this.props.isLogged}
device={this.device}
product={this.product}
brand={this.brand}
location={this.props.location}
/>
}
/>
</Routes>
);
}
export default connect(
(store) => ({
isLogged: get(store, "userData.logged"),
userData: get(store, "userData"),
featureToggles: get(store, "capi.featureToggles"),
features: get(store, "capi.features"),
// @ts-ignore
messages: store.capi.messages
})
// @ts-ignore
)(withRouter(Main));
webpack://frontend-rcf/../../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-rcf/./src/entry-client.tsx
import React from "react";
import { ApolloProvider } from "@apollo/client";
// @ts-ignore
import { AppRegistry } from "react-native-web";
import { Provider } from "react-redux";
import { BrowserRouter } from "react-router-dom";
import ApolloContext from "@tvg/utils/apolloContext";
import tvgConf from "@tvg/conf";
import ApolloClient from "./apolloClient/ApolloClient";
import configureStore from "./configureStore";
import Main from "./pages";
// @ts-ignore
// eslint-disable-next-line no-underscore-dangle
const preloadedState = window.__RCF_PRELOADED_STATE__;
const store = configureStore(preloadedState);
// gets conf for specific host / device
tvgConf(window.location.hostname, window.navigator.userAgent);
const App = () => {
const apolloClient = ApolloClient.createClient(false);
return (
<ApolloProvider client={apolloClient}>
<ApolloContext.Provider
value={{
gasClient: apolloClient
}}
>
{/* @ts-ignore */}
<Provider store={store}>
<BrowserRouter>
<Main />
</BrowserRouter>
</Provider>
</ApolloContext.Provider>
</ApolloProvider>
);
};
const Render = () => {
if (document.getElementById("credentialsReset")) {
AppRegistry.registerComponent("App", () => App);
AppRegistry.runApplication("App", {
initialProps: {},
rootTag: document.getElementById("credentialsReset")
});
}
};
export default Render();