{"version":3,"sources":["webpack://elc-service-ratings-reviews/./node_modules/@estee/elc-logging/node_modules/debug/src/browser.js","webpack://elc-service-ratings-reviews/./node_modules/@estee/elc-logging/node_modules/debug/src/common.js","webpack://elc-service-ratings-reviews/./src/internal/constants/PowerReviews.ts","webpack://elc-service-ratings-reviews/./node_modules/@estee/elc-service/src/decorators/Decorators.ts","webpack://elc-service-ratings-reviews/./node_modules/@estee/elc-service/src/ViewController.ts","webpack://elc-service-ratings-reviews/./src/internal/use-cases/RatingSelectedUseCase.ts","webpack://elc-service-ratings-reviews/./src/internal/constants/ProductReview.ts","webpack://elc-service-ratings-reviews/./src/internal/use-cases/RatingsLoadedUseCase.tsx","webpack://elc-service-ratings-reviews/./src/internal/constants/NoValue.ts","webpack://elc-service-ratings-reviews/./src/internal/utils/ComputeRoundedValueFor.ts","webpack://elc-service-ratings-reviews/./src/internal/controllers/ProductRatingViewController.ts","webpack://elc-service-ratings-reviews/./src/internal/constants/ServiceReviews.ts","webpack://elc-service-ratings-reviews/./src/internal/controllers/RatingsReviewsBaseController.ts","webpack://elc-service-ratings-reviews/./src/internal/controllers/ProductReviewsViewController.ts","webpack://elc-service-ratings-reviews/./src/internal/utils/UsableValues.ts","webpack://elc-service-ratings-reviews/./src/internal/domain/entities/ReviewProduct.ts","webpack://elc-service-ratings-reviews/./src/internal/domain/entities/ReviewDetails.ts","webpack://elc-service-ratings-reviews/./src/internal/controllers/ReviewDetailsViewController.ts","webpack://elc-service-ratings-reviews/./src/internal/repositories/ConfigRepository.ts","webpack://elc-service-ratings-reviews/./src/internal/constants/InventoryStatuses.ts","webpack://elc-service-ratings-reviews/./src/internal/domain/entities/PowerReviewsProduct.ts","webpack://elc-service-ratings-reviews/./src/internal/repositories/ProductRepository.ts","webpack://elc-service-ratings-reviews/./src/internal/domain/entities/Config.ts","webpack://elc-service-ratings-reviews/./node_modules/@estee/elc-logging/src/ELCLoggerValidations.ts","webpack://elc-service-ratings-reviews/./node_modules/@estee/elc-logging/src/LoggerApiSDK.ts","webpack://elc-service-ratings-reviews/./node_modules/@estee/elc-logging/src/ELCLogger.ts","webpack://elc-service-ratings-reviews/./node_modules/@estee/elc-service/src/Api.ts","webpack://elc-service-ratings-reviews/./src/api/RatingsAndReviewsApiSdk.ts","webpack://elc-service-ratings-reviews/./src/internal/use-cases/PowerReviewsInitializedUseCase.ts","webpack://elc-service-ratings-reviews/./src/internal/use-cases/ReadReviewsClickedUseCase.ts","webpack://elc-service-ratings-reviews/./src/internal/use-cases/WriteReviewClickedUseCase.ts","webpack://elc-service-ratings-reviews/./src/internal/use-cases/ProductFullLoadedUseCase.ts","webpack://elc-service-ratings-reviews/./src/service-setup/ServiceBusController.ts","webpack://elc-service-ratings-reviews/./node_modules/@loadable/component/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://elc-service-ratings-reviews/./node_modules/@loadable/component/node_modules/@babel/runtime/helpers/esm/extends.js","webpack://elc-service-ratings-reviews/./node_modules/@loadable/component/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://elc-service-ratings-reviews/./node_modules/@loadable/component/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://elc-service-ratings-reviews/./node_modules/@loadable/component/dist/loadable.esm.js","webpack://elc-service-ratings-reviews/./node_modules/@estee/elc-service/src/Service/Service.ts","webpack://elc-service-ratings-reviews/./src/internal/use-cases/RatingsReviewsServiceStartedUseCase.ts","webpack://elc-service-ratings-reviews/./src/service-setup/RatingsReviewsService.ts","webpack://elc-service-ratings-reviews/./src/service-setup/ConfigStore.tsx","webpack://elc-service-ratings-reviews/./src/internal/domain/entities/ReviewSnippet.ts","webpack://elc-service-ratings-reviews/./src/internal/repositories/RatingsRepository.ts","webpack://elc-service-ratings-reviews/./src/service-setup/diContainer.tsx","webpack://elc-service-ratings-reviews/./node_modules/@loadable/component/node_modules/react-is/cjs/react-is.production.min.js","webpack://elc-service-ratings-reviews/./node_modules/@loadable/component/node_modules/react-is/index.js","webpack://elc-service-ratings-reviews/./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack://elc-service-ratings-reviews/./node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","webpack://elc-service-ratings-reviews/./node_modules/hoist-non-react-statics/node_modules/react-is/index.js","webpack://elc-service-ratings-reviews/./node_modules/ms/index.js"],"names":[],"mappings":"gMAMA,EAAQ,WAAa,EACrB,EAAQ,KAAO,EACf,EAAQ,KAAO,EACf,EAAQ,UAAY,EACpB,EAAQ,QAAU,IAMlB,EAAQ,OAAS,CAChB,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,WAYD,YAAqB,CAIpB,MAAI,OAAO,SAAW,aAAe,OAAO,SAAY,QAAO,QAAQ,OAAS,YAAc,OAAO,QAAQ,QACrG,GAIJ,MAAO,YAAc,aAAe,UAAU,WAAa,UAAU,UAAU,cAAc,MAAM,yBAC/F,GAKA,MAAO,WAAa,aAAe,SAAS,iBAAmB,SAAS,gBAAgB,OAAS,SAAS,gBAAgB,MAAM,kBAEtI,MAAO,SAAW,aAAe,OAAO,SAAY,QAAO,QAAQ,SAAY,OAAO,QAAQ,WAAa,OAAO,QAAQ,QAG1H,MAAO,YAAc,aAAe,UAAU,WAAa,UAAU,UAAU,cAAc,MAAM,mBAAqB,SAAS,OAAO,GAAI,KAAO,IAEnJ,MAAO,YAAc,aAAe,UAAU,WAAa,UAAU,UAAU,cAAc,MAAM,sBAStG,WAAoB,EAAM,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\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* Active `debug` instances.\n\t*/\n\tcreateDebug.instances = [];\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.enabled = createDebug.enabled(namespace);\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.destroy = destroy;\n\t\tdebug.extend = extend;\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\tcreateDebug.instances.push(debug);\n\n\t\treturn debug;\n\t}\n\n\tfunction destroy() {\n\t\tconst index = createDebug.instances.indexOf(this);\n\t\tif (index !== -1) {\n\t\t\tcreateDebug.instances.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < createDebug.instances.length; i++) {\n\t\t\tconst instance = createDebug.instances[i];\n\t\t\tinstance.enabled = createDebug.enabled(instance.namespace);\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","export const PRODUCT_REVIEWS_CLASS = 'js-reviews-wrapper';\nexport const ENTER_KEY = 'Enter';\nexport const ENTER_KEY_CODE = 'NumpadEnter';\nexport const REVIEW_DISPLAY = 'pr-review-display';\nexport const REVIEW_SNIPPET = 'pr-review-snippet';\nexport const QUESTION_DISPLAY = 'pr-questiondisplay';\nexport const SNAPSHOT_TYPE = 'SIMPLE';\nexport const enum PAGINATION_TYPE {\n DEFAULT = 'DEFAULT',\n VERTICAL = 'VERTICAL'\n}\nexport const REVIEW_COMPONENTS = {\n ReviewDisplay: REVIEW_DISPLAY,\n ReviewSnippet: REVIEW_SNIPPET\n};\nexport const AVERAGE_RATING = 'averageRating';\nexport const POWER_REVIEWS_SCRIPT = '//ui.powerreviews.com/stable/4.0/ui.js';\nexport const POWER_REVIEWS_API_LINK = 'https://readservices-b2c.powerreviews.com';\nexport const TOTAL_NUMBER_OF_STARS = 5;\nexport const HELPFUL_YES_CLASS = 'pr-helpful-yes';\nexport const HELPFUL_NO_CLASS = 'pr-helpful-no';\nexport const FLAG_REVIEW_CLASS = 'pr-rd-flag-review-container';\nexport const SORT_BY_ID = 'pr-rd-sort-by';\nexport const MULTI_SELECT_CLASS = 'pr-multiselect';\nexport const MULTI_SELECT_ITEM_CLASS = 'pr-multiselect-item';\nexport const MULTI_SELECT_BUTTON_LABEL_CLASS = 'pr-multiselect-button-label';\nexport const REVIEWS_SEARCH_CLASS = 'pr-rd-search-reviews-input';\nexport const REVIEWS_SEARCH_BUTTON_CLASS = 'pr-rd-search-reviews-icon-button';\nexport const ASK_AND_ANSWER_BUTTON_ID = 'pr-question-form-link';\nexport const ASK_AND_ANSWER_FORM_ID = 'pr-question-form-content';\nexport const ASK_AND_ANSWER_SEARCH_CLASS = 'pr-qa-display-searchbar';\nexport const ASK_AND_ANSWER_SEARCH_BUTTON_CLASS = 'pr-qa-search-btn';\nexport const ASK_AND_ANSWER_SORT_BY_ID = 'pr-qa-sort-by';\nexport const ASK_AND_ANSWER_SHOW_MORE_CLASS = 'pr-qa-display-show-more-questions';\nexport const DEFAULT_AVERAGE_RATING = 0;\nexport const DEFAULT_REVIEW_COUNT = 0;\nexport const DEFAULT_ANSWERED_QUESTIONS = 0;\nexport const DEFAULT_REVIEW_TITLE = 'Reviews';\nexport const REVIEW_SNAPSHOT_ID = 'pr-review-snapshot';\n\nexport enum ReviewClickEventSelectors {\n WRITE_REVIEW = '.pr-snippet-write-review-link',\n REVIEW_HELPFUL_YES = '#pr-review-display .pr-helpful-yes',\n REVIEW_HELPFUL_NO = '#pr-review-display .pr-helpful-no',\n FLAG_REVIEW = '.pr-rd-flag-review-container',\n MULTI_SELECT = '.pr-multiselect-item',\n REVIEW_SEARCH = '.pr-rd-search-reviews-icon-button',\n ASK_AND_ANSWER_BUTTON = '#pr-question-form-link',\n ASK_AND_ANSWER_SEARCH = '.pr-qa-search-btn',\n ASK_AND_ANSWER_HELPFUL_YES = '#pr-questiondisplay .pr-helpful-yes',\n ASK_AND_ANSWER_HELPFUL_NO = '#pr-questiondisplay .pr-helpful-no',\n ASK_AND_ANSWER_SHOW_MORE = '.pr-qa-display-show-more-questions'\n}\n","import { Container } from 'hypo-container';\nexport const getDecorators = (container: Container) => ({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n lazyInject: (name?: string) => (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n target: any,\n key: string,\n descriptor?: PropertyDescriptor\n ) => {\n const resourceName = name || key;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sbGetter = function (this: any) {\n const resource = container.get(resourceName);\n if (!resource) {\n throw new Error(`The requested ${resourceName} does not exists`);\n }\n\n return resource;\n };\n let propertyDescriptor = descriptor || {};\n if (!descriptor) {\n propertyDescriptor = {\n get: sbGetter\n };\n Object.defineProperty(target, key, propertyDescriptor);\n } else {\n propertyDescriptor.get = sbGetter;\n }\n }\n});\n","import { observable } from 'mobx';\nimport {\n IComponentViewController,\n IViewControllerData,\n ViewControllerLoadedMethod\n} from '@estee/elc-universal-utils';\n\nexport class ViewController implements IComponentViewController {\n public id?: string;\n public dataState?: IViewControllerData;\n public loaded?: ViewControllerLoadedMethod;\n public configMergeStrategy?: Function;\n @observable public isLoading: boolean = true;\n\n public setSSRState = (data?: IViewControllerData) => {\n this.dataState = data;\n };\n\n public setId = (id?: string) => {\n this.id = id && btoa(unescape(encodeURIComponent(id)));\n };\n\n public get data(): IViewControllerData {\n return {};\n }\n}\n","import { diContainer, serviceNames } from '../../service-setup/diContainer';\nimport { ProductRatingViewController } from '../controllers/ProductRatingViewController';\n\nexport class RatingSelectedUseCase {\n private selectedIndex: number;\n private productRatingViewController: ProductRatingViewController;\n\n constructor(selectedIndex: number) {\n this.selectedIndex = selectedIndex;\n this.productRatingViewController = diContainer.get(\n serviceNames.productRatingViewController\n );\n }\n\n public execute = () => {\n this.productRatingViewController.setRating(this.selectedIndex);\n };\n}\n","// tslint:disable-next-line:export-name\nexport const DEFAULT_NUMBER_OF_STARS = 5;\nexport const REVIEW_CATEGORY = 'product reviews / ask answer';\n","import { query, serviceQueries } from '@estee/elc-service-bus';\nimport { diContainer, serviceNames } from '../../service-setup/diContainer';\nimport { observable } from 'mobx';\nimport { ProductRepository } from '../repositories/ProductRepository';\nimport { IProduct } from '../interfaces/IRating';\n\nexport class RatingsLoadedUseCase {\n @observable public productRepository: ProductRepository;\n @observable public productId: string;\n\n constructor(productId: string) {\n this.productId = productId;\n this.productRepository = diContainer.get(serviceNames.productRepository);\n }\n\n public execute = async () => {\n // tslint:disable-next-line: await-promise\n const products = await query(serviceQueries.GET_PRODUCT_DATA, {\n filterBy: {\n productIds: [this.productId]\n }\n });\n\n this.productRepository.setProducts(products as IProduct[]);\n };\n}\n","// tslint:disable:export-name\nexport const NO_VALUE: number = -3.1415926535;\n","const DEFAULT_NUMBER_OF_DIGITS = 1;\n\nexport const computeRoundedValueFor = (\n number: number,\n numberOfDigits: number = DEFAULT_NUMBER_OF_DIGITS\n) => {\n const roundMultiplier = Math.pow(10, numberOfDigits);\n\n return Math.round(number * roundMultiplier) / roundMultiplier;\n};\n","import { ViewController } from '@estee/elc-service';\nimport { emit, events } from '@estee/elc-service-bus';\nimport { observable, computed, action } from 'mobx';\nimport { RatingSelectedUseCase } from '../use-cases/RatingSelectedUseCase';\nimport { DEFAULT_NUMBER_OF_STARS, REVIEW_CATEGORY } from '../constants/ProductReview';\nimport { RatingsLoadedUseCase } from '../use-cases/RatingsLoadedUseCase';\nimport { ProductRepository } from '../repositories/ProductRepository';\nimport { NO_VALUE } from '../constants/NoValue';\nimport { RatingsRepository } from '../repositories/RatingsRepository';\nimport { AVERAGE_RATING } from '../constants/PowerReviews';\nimport { computeRoundedValueFor } from '../utils/ComputeRoundedValueFor';\nimport { IProduct } from '../interfaces/IRating';\n\ninterface IProductRatingViewControllerInitializeProps {\n productId: string;\n numberOfStars: number;\n productRating?: number;\n reviewsNumber?: number;\n product: IProduct;\n}\n\ninterface IProductRating {\n averageRating: number;\n reviewCount: number;\n}\n\nexport class ProductRatingViewController extends ViewController {\n @observable public selectedRatingIndex: number = -1;\n @observable public productRepository: ProductRepository;\n @observable public productId: string;\n @observable private numberOfStars: number = DEFAULT_NUMBER_OF_STARS;\n @observable public numberOfReviews: number;\n @observable private ratingsRepository: RatingsRepository;\n @observable private hasLoaded: boolean = false;\n @observable private productItem: IProduct;\n private defaultRating: IProductRating;\n\n constructor(productRepository: ProductRepository, ratingsRepository: RatingsRepository) {\n super();\n this.productRepository = productRepository;\n this.ratingsRepository = ratingsRepository;\n }\n\n @computed\n public get data() {\n return {\n selectedRatingIndex: this.selectedRatingIndex,\n percentageRating: this.percentageRating,\n onSelectRating: this.onSelectRating,\n onReadReviewsClick: this.onReadReviewsClick,\n onWriteReviewClick: this.onWriteReviewClick,\n numberOfReviews: this.rating?.reviewCount,\n averageRating: this.rating?.averageRating,\n loaded: this.hasLoaded\n };\n }\n\n @computed\n public get rating(): IProductRating {\n return (\n this.ratingsRepository.productRatings[this.productId] ||\n this.productLevelReviews ||\n this.defaultRating\n );\n }\n\n @computed\n public get product() {\n return this.productItem || this.productRepository.getProductById(this.productId);\n }\n\n @action\n public loaded = async (props: IProductRatingViewControllerInitializeProps) => {\n this.isLoading = true;\n\n this.defaultRating = {\n reviewCount: props.reviewsNumber || 0,\n averageRating: computeRoundedValueFor(props.productRating || 0)\n };\n\n this.productItem = props.product || null;\n\n const { numberOfStars, productId } = props;\n this.numberOfStars = numberOfStars;\n this.productId = productId;\n\n if (!props.product) {\n const ratingsLoadedUseCase = new RatingsLoadedUseCase(this.productId);\n await ratingsLoadedUseCase.execute();\n }\n this.ratingsRepository.getProductRating(productId);\n this.isLoading = false;\n this.hasLoaded = true;\n };\n\n @computed\n private get percentageRating() {\n const defaultVal = undefined;\n\n if (this.rating && AVERAGE_RATING in this.rating) {\n const { averageRating } = this.rating;\n\n return averageRating === NO_VALUE\n ? defaultVal\n : (averageRating * 100) / this.numberOfStars;\n }\n\n return defaultVal;\n }\n\n @action\n public onSelectRating = (index: number) => {\n this.selectedRatingIndex = index;\n\n const ratingSelectedUseCase = new RatingSelectedUseCase(index);\n ratingSelectedUseCase.execute();\n };\n\n @action\n public onReadReviewsClick = () => {\n emit(events.READ_REVIEWS_LINK_CLICKED, this.getReviewPayload());\n };\n\n @action\n public onWriteReviewClick = () => {\n emit(events.WRITE_REVIEWS_LINK_CLICKED, this.getReviewPayload());\n };\n\n @computed\n private get productLevelReviews() {\n if (!this.product) {\n return null;\n }\n\n return {\n reviewCount: this.product.reviews.numberOfReviews,\n averageRating: this.product.reviews.averageRating\n };\n }\n\n private getReviewPayload() {\n const { productId, displayName } = this.product;\n\n return {\n id: productId,\n name: displayName,\n reviewCategory: REVIEW_CATEGORY\n };\n }\n\n @action\n public setRating = (index: number) => {\n this.numberOfReviews = this.numberOfReviews + 1;\n };\n}\n","export const SERVICE_REVIEWS_CLASS = 'elc-review-detail-wrapper';\nexport const REVIEW_CATEGORY = 'service reviews';\n","import { ViewController } from '@estee/elc-service';\nimport { emit, events } from '@estee/elc-service-bus';\nimport * as PowerReviewsConstants from '../constants/PowerReviews';\nimport { IReviewsPayload } from '../interfaces/IReviews';\nimport { SERVICE_REVIEWS_CLASS } from '../constants/ServiceReviews';\n\nexport interface IEventHandlerType {\n id: string;\n name: string;\n reviewCategory: string;\n}\n\nexport class RatingsReviewsBaseController extends ViewController {\n private productReviewsContainer: HTMLElement | null;\n public eventHandlerData: IEventHandlerType;\n\n public addReviewsEventHandlers(eventHandlerData: IEventHandlerType) {\n this.eventHandlerData = eventHandlerData;\n this.productReviewsContainer = (\n document.querySelector(\n `.${PowerReviewsConstants.PRODUCT_REVIEWS_CLASS}, .${SERVICE_REVIEWS_CLASS}`\n )\n );\n if (!this.productReviewsContainer) {\n return;\n }\n this.productReviewsContainer.addEventListener('click', this.handleReviewsClickEventHandler);\n this.productReviewsContainer.addEventListener(\n 'change',\n this.handleReviewsChangeEventHandler\n );\n this.productReviewsContainer.addEventListener('keyup', this.handleReviewsKeyupEventHandler);\n }\n\n private handleReviewsClickEventHandler = (event: MouseEvent) => {\n const { id, name, reviewCategory } = this.eventHandlerData;\n const eventTarget = event.target;\n\n const payload: IReviewsPayload = {\n id,\n name,\n reviewCategory\n };\n\n const selector = Object.keys(PowerReviewsConstants.ReviewClickEventSelectors).find(\n (key) => {\n return !!eventTarget.closest(\n PowerReviewsConstants.ReviewClickEventSelectors[\n key as keyof typeof PowerReviewsConstants.ReviewClickEventSelectors\n ]\n );\n }\n );\n if (selector) {\n this.handleReviewClickEvents[\n PowerReviewsConstants.ReviewClickEventSelectors[\n selector as keyof typeof PowerReviewsConstants.ReviewClickEventSelectors\n ]\n ]({ eventTarget, payload });\n }\n };\n\n private handleReviewClickEvents: {\n [key in PowerReviewsConstants.ReviewClickEventSelectors]: (params: {\n eventTarget: HTMLElement;\n payload: IReviewsPayload;\n }) => void;\n } = {\n [PowerReviewsConstants.ReviewClickEventSelectors.WRITE_REVIEW]: (params) => {\n emit(events.WRITE_REVIEW_STARTED, params.payload);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.REVIEW_HELPFUL_YES]: (params) => {\n emit(events.REVIEWS_HELPFUL_YES_CLICKED, params.payload);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.REVIEW_HELPFUL_NO]: (params) => {\n emit(events.REVIEWS_HELPFUL_NO_CLICKED, params.payload);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.FLAG_REVIEW]: (params) => {\n emit(events.REVIEWS_FLAG_REVIEW_CLICKED, params.payload);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.MULTI_SELECT]: (params) => {\n this.handleMultiSelectItem(params.eventTarget);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.REVIEW_SEARCH]: (params) => {\n this.handleReviewsSearch(params.eventTarget);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.ASK_AND_ANSWER_BUTTON]: (params) => {\n this.handleAskAndAnswerButton(params.payload);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.ASK_AND_ANSWER_SEARCH]: (params) => {\n this.handleAskAndAnswerSearch(params.eventTarget);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.ASK_AND_ANSWER_HELPFUL_YES]: (params) => {\n emit(events.ASK_AND_ANSWER_HELPFUL_YES_CLICKED, params.payload);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.ASK_AND_ANSWER_HELPFUL_NO]: (params) => {\n emit(events.ASK_AND_ANSWER_HELPFUL_NO_CLICKED, params.payload);\n },\n [PowerReviewsConstants.ReviewClickEventSelectors.ASK_AND_ANSWER_SHOW_MORE]: (params) => {\n emit(events.ASK_AND_ANSWER_SHOW_MORE_CLICKED, params.payload);\n }\n };\n\n private handleAskAndAnswerButton = (payload: IReviewsPayload) => {\n if (!document.getElementById(PowerReviewsConstants.ASK_AND_ANSWER_FORM_ID)) {\n emit(events.ASK_AND_ANSWER_CLICKED, payload);\n }\n };\n\n private handleReviewsChangeEventHandler = (event: Event) => {\n const eventTarget = event.target;\n const { id, name, reviewCategory } = this.eventHandlerData;\n const { SORT_BY_ID, ASK_AND_ANSWER_SORT_BY_ID } = PowerReviewsConstants;\n const payload: IReviewsPayload = {\n id,\n name,\n reviewCategory,\n selectedValue: (eventTarget).value\n };\n switch (eventTarget && eventTarget.id) {\n case SORT_BY_ID: {\n emit(events.REVIEWS_SORT_BY_CHANGED, payload);\n break;\n }\n case ASK_AND_ANSWER_SORT_BY_ID: {\n emit(events.ASK_AND_ANSWERS_SORT_BY_CHANGED, payload);\n break;\n }\n default:\n }\n };\n\n private handleReviewsKeyupEventHandler = (event: KeyboardEvent) => {\n const eventTarget = event.target;\n const {\n REVIEWS_SEARCH_CLASS,\n ASK_AND_ANSWER_SEARCH_CLASS,\n ENTER_KEY,\n ENTER_KEY_CODE\n } = PowerReviewsConstants;\n const isEnterKey = event.code === ENTER_KEY_CODE || event.key === ENTER_KEY;\n\n if (!!eventTarget.closest(`.${REVIEWS_SEARCH_CLASS}`) && isEnterKey) {\n this.handleReviewsSearch(eventTarget);\n } else if (!!eventTarget.closest(`.${ASK_AND_ANSWER_SEARCH_CLASS}`) && isEnterKey) {\n this.handleAskAndAnswerSearch(eventTarget);\n }\n };\n\n private handleMultiSelectItem(eventTarget: HTMLElement) {\n const { MULTI_SELECT_CLASS, MULTI_SELECT_ITEM_CLASS } = PowerReviewsConstants;\n const multiSelectParent = eventTarget && eventTarget.closest(`.${MULTI_SELECT_CLASS}`);\n const currentItem = eventTarget && eventTarget.closest(`.${MULTI_SELECT_ITEM_CLASS}`);\n const { id, name, reviewCategory } = this.eventHandlerData;\n\n if (currentItem && currentItem.hasAttribute('data-selected')) {\n currentItem.removeAttribute('data-selected');\n\n return;\n }\n currentItem && currentItem.setAttribute('data-selected', '');\n\n const selectedFlags = this.getMultiSelectedItems(multiSelectParent);\n const multiSelectButtonText = this.getMultiSelectButtonText(multiSelectParent);\n\n if (selectedFlags.length > 0) {\n const payload: IReviewsPayload = {\n id,\n name,\n reviewCategory,\n selectedValue: `${multiSelectButtonText} | ${selectedFlags.join(',')}`\n };\n emit(events.REVIEWS_FILTER_CLICKED, payload);\n }\n }\n\n private getMultiSelectButtonText(multiSelectParent: Element | null) {\n const multiSelectButton =\n multiSelectParent &&\n multiSelectParent.querySelector(\n `.${PowerReviewsConstants.MULTI_SELECT_BUTTON_LABEL_CLASS}`\n );\n\n return multiSelectButton && multiSelectButton.textContent;\n }\n\n private getMultiSelectedItems(multiSelectParent: Element | null) {\n const multiSelectItems =\n multiSelectParent &&\n multiSelectParent.querySelectorAll(`.${PowerReviewsConstants.MULTI_SELECT_ITEM_CLASS}`);\n const selectedFlags: string[] = [];\n multiSelectItems &&\n multiSelectItems.forEach((selectItem) => {\n if (selectItem.hasAttribute('data-selected')) {\n const selectedFlagContainer = selectItem && selectItem.querySelector('span');\n const selectedFlagText =\n selectedFlagContainer && selectedFlagContainer.textContent;\n selectedFlagText && selectedFlags.push(selectedFlagText);\n }\n });\n\n return selectedFlags;\n }\n\n private handleReviewsSearch(eventTarget: HTMLElement) {\n const searchParent =\n eventTarget && eventTarget.closest(`.${PowerReviewsConstants.REVIEWS_SEARCH_CLASS}`);\n const searchBox = searchParent && searchParent.querySelector('input');\n const searchValue = searchBox && searchBox.value;\n const { id, name, reviewCategory } = this.eventHandlerData;\n if (!searchValue) {\n return;\n }\n const payload: IReviewsPayload = {\n id,\n name,\n reviewCategory,\n selectedValue: searchValue\n };\n emit(events.REVIEWS_SEARCH_CLICKED, payload);\n }\n\n private handleAskAndAnswerSearch(eventTarget: HTMLElement) {\n const searchParent =\n eventTarget &&\n eventTarget.closest(`.${PowerReviewsConstants.ASK_AND_ANSWER_SEARCH_CLASS}`);\n const searchBox = searchParent && searchParent.querySelector('input');\n const searchValue = searchBox && searchBox.value;\n const { id, name, reviewCategory } = this.eventHandlerData;\n if (!searchValue) {\n return;\n }\n const payload: IReviewsPayload = {\n id,\n name,\n reviewCategory,\n selectedValue: searchValue\n };\n emit(events.ASK_AND_ANSWER_SEARCH_CLICKED, payload);\n }\n\n public removeReviewsEventHandlers() {\n if (!this.productReviewsContainer) {\n return;\n }\n this.productReviewsContainer.removeEventListener(\n 'click',\n this.handleReviewsClickEventHandler\n );\n this.productReviewsContainer.removeEventListener(\n 'change',\n this.handleReviewsChangeEventHandler\n );\n this.productReviewsContainer.removeEventListener(\n 'keyup',\n this.handleReviewsKeyupEventHandler\n );\n }\n}\n","import { emit, events } from '@estee/elc-service-bus';\nimport { observable, computed, action } from 'mobx';\nimport { ConfigStore } from '../../service-setup/ConfigStore';\nimport { ProductRepository } from '../repositories/ProductRepository';\nimport * as Constants from '../constants/PowerReviews';\nimport { IRatingsReviewsConfig } from '../interfaces/IRating';\nimport { RatingsLoadedUseCase } from '../use-cases/RatingsLoadedUseCase';\nimport { IProductReviews } from '../../exported/product-reviews/ProductReviews';\nimport { RatingsReviewsBaseController } from './RatingsReviewsBaseController';\nimport { REVIEW_CATEGORY } from '../constants/ProductReview';\n\nexport class ProductReviewsViewController extends RatingsReviewsBaseController {\n @observable public isLoading: boolean = true;\n @observable public config: IRatingsReviewsConfig;\n @observable public productRepository: ProductRepository;\n @observable public powerReviewsScript: HTMLScriptElement;\n @observable public activeTab: string = 'tab-1';\n\n constructor(configStore: ConfigStore, productRepository: ProductRepository) {\n super();\n this.config = configStore.config;\n this.productRepository = productRepository;\n }\n\n public initialize(props: IProductReviews) {\n const { config } = props;\n this.config = { ...this.config, ...config };\n }\n\n @computed\n get data() {\n return {\n isLoading: this.isLoading,\n activeTab: this.activeTab\n };\n }\n\n @computed\n public get productId() {\n return this.productRepository.productId || this.config.productId;\n }\n\n @computed\n public get product() {\n return this.productRepository.getProductById(this.productId);\n }\n\n @computed\n public get numberOfReviewsValue(): number {\n return this.product && this.product.reviews && this.product.reviews.numberOfReviews;\n }\n\n @action\n public setPaginationType = (paginationType: string) => {\n this.productRepository.setPaginationType(paginationType);\n };\n\n @action\n public onTabClick = (event: React.MouseEvent) => {\n const target = event.target;\n this.activeTab = target.dataset.tab || '';\n };\n\n @action\n public loadReviews = (powerReviewsScript: HTMLScriptElement) => {\n this.isLoading = false;\n // tslint:disable-next-line: no-floating-promises\n this.loaded().then(() => {\n this.loadPowerReviewsScripts(powerReviewsScript);\n this.addReviewsEventHandlers({\n id: this.productId,\n name: this.product?.displayName || '',\n reviewCategory: REVIEW_CATEGORY\n });\n });\n };\n\n public handleProductReviewsUnmount = () => {\n this.removeReviewsEventHandlers();\n };\n\n @action\n public loadPowerReviewsScripts = (powerReviewsScript: HTMLScriptElement) => {\n const bodyFirstScript = document.querySelector('body > script');\n const parentNode = bodyFirstScript.parentNode;\n powerReviewsScript.type = 'text/javascript';\n powerReviewsScript.src = Constants.POWER_REVIEWS_SCRIPT;\n powerReviewsScript.defer = true;\n powerReviewsScript.async = true;\n powerReviewsScript.onload = () => {\n this.emitReviewsInit();\n };\n parentNode.insertBefore(powerReviewsScript, bodyFirstScript.nextSibling);\n\n this.powerReviewsScript = powerReviewsScript;\n };\n\n public showReviews = () => {\n const prScript = document.createElement('script');\n if (!this.powerReviewsScript) {\n this.loadReviews(prScript);\n }\n };\n\n public loaded = async () => {\n if (this.productId) {\n const ratingsLoadedUseCase = new RatingsLoadedUseCase(this.productId);\n await ratingsLoadedUseCase.execute();\n }\n\n return Promise.resolve();\n };\n\n public emitReviewsInit = () => {\n emit(events.SPP_POWER_REVIEWS_INIT, this.productId);\n };\n}\n","export interface ICopyUsableValues {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\nexport const copyUsableValues = (source: ICopyUsableValues, target: ICopyUsableValues) => {\n Object.keys(source).forEach((key) => {\n if (source[key] !== null && source[key] !== undefined) {\n target[key] = source[key];\n }\n });\n};\n","import { copyUsableValues } from '../../utils/UsableValues';\r\nimport { IReviewDetailsData } from './ReviewDetails';\r\n\r\nexport class ReviewProduct {\r\n public name: string;\r\n public image_url: string;\r\n public description: string;\r\n public category_name: string;\r\n public url: string;\r\n public manufacturer_id?: string;\r\n public price?: string;\r\n public upc?: string;\r\n public brand_name?: string;\r\n public in_stock?: boolean;\r\n\r\n public static toJson(data: IReviewDetailsData) {\r\n const reviewProduct = new ReviewProduct();\r\n const mappingData = {\r\n name: data.name,\r\n url: data.url,\r\n image_url: data.imageUrl,\r\n description: data.description,\r\n category_name: data.categoryName,\r\n manufacturer_id: data.manufacturerId,\r\n upc: data.upc,\r\n brand_name: data.brandName,\r\n price: data.price\r\n };\r\n copyUsableValues(mappingData, reviewProduct);\r\n\r\n return reviewProduct;\r\n }\r\n}\r\n","import { ReviewProduct } from './ReviewProduct';\nimport { copyUsableValues } from '../../utils/UsableValues';\n\ninterface IReviewComponents {\n ReviewSnippet?: string;\n ReviewImageSnippet?: string;\n ReviewDetails?: string;\n}\n\nexport interface IReviewDetailsData {\n apiKey: string;\n merchantId: string;\n merchantGroupId: string;\n locale: string;\n pageId: string;\n name: string;\n imageUrl: string;\n description: string;\n categoryName: string;\n manufacturerId?: string;\n upc?: string;\n brandName?: string;\n price?: string;\n inStock?: boolean;\n url: string;\n reviewWrapperUrl: string;\n components?: IReviewComponents;\n onRender?(): boolean;\n onSubmit?(): boolean;\n}\n\nexport class ReviewDetails {\n public api_key: string;\n public merchant_id: string;\n public merchant_group_id: string;\n public locale: string;\n public page_id: string;\n public product: string;\n public review_wrapper_url: string;\n public components: IReviewComponents;\n public on_render: void;\n public on_submit: void;\n\n public static toJson(data: IReviewDetailsData) {\n const reviewDetails = new ReviewDetails();\n const mappingData = {\n api_key: data.apiKey,\n merchant_id: data.merchantId,\n merchant_group_id: data.merchantGroupId,\n locale: data.locale,\n page_id: data.pageId,\n product: ReviewProduct.toJson(data),\n review_wrapper_url: data.reviewWrapperUrl,\n components: data.components,\n on_render: data.onRender,\n on_submit: data.onSubmit\n };\n copyUsableValues(mappingData, reviewDetails);\n\n return reviewDetails;\n }\n}\n","import { action } from 'mobx';\nimport {\n POWER_REVIEWS_SCRIPT,\n REVIEW_COMPONENTS,\n REVIEW_SNAPSHOT_ID\n} from '../constants/PowerReviews';\nimport { IReviewDetailsData, ReviewDetails } from '../domain/entities/ReviewDetails';\nimport { IReviewDetailsConfig } from '../../exported/review-details/ReviewDetails';\nimport { ConfigStore } from '../../service-setup/ConfigStore';\nimport { RatingsReviewsBaseController } from './RatingsReviewsBaseController';\nimport { emit, events } from '@estee/elc-service-bus';\nimport { REVIEW_CATEGORY } from '../constants/ServiceReviews';\nimport { IPowerReviews } from '../interfaces/IPowerReviews';\n\ndeclare let POWERREVIEWS: IPowerReviews;\n\ninterface IReviewDetailsControllerData {\n config: IReviewDetailsConfig;\n reviewDetailsRef: React.RefObject;\n}\n\nexport class ReviewDetailsViewController extends RatingsReviewsBaseController {\n private isReviewLoaded: boolean;\n private reviewDetailsData: IReviewDetailsData;\n private configs: ConfigStore;\n private reviewDetailsRef: React.RefObject;\n private isProductInfoVisible: boolean;\n\n constructor(configStore: ConfigStore) {\n super();\n this.configs = configStore;\n }\n\n @action\n public loaded = async (props: IReviewDetailsControllerData) => {\n this.reviewDetailsData = props.config;\n const payload = {\n id: this.reviewDetailsData.pageId,\n name: this.reviewDetailsData.name,\n reviewCategory: REVIEW_CATEGORY\n };\n this.reviewDetailsRef = props.reviewDetailsRef;\n this.isProductInfoVisible = props.config.showPageInfo;\n this.showReviewOverlay();\n this.addReviewsEventHandlers(payload);\n emit(events.REVIEW_OVERLAY_OPENED, payload);\n };\n\n private showReviewOverlay() {\n if (this.isReviewLoaded) {\n this.renderOverlay();\n\n return;\n }\n this.loadPowerReviews();\n }\n\n private loadPowerReviews() {\n const script = document.getElementsByTagName('script')[0];\n const powerReviewsScript = document.createElement('script');\n powerReviewsScript.type = 'text/javascript';\n powerReviewsScript.async = true;\n powerReviewsScript.src = POWER_REVIEWS_SCRIPT;\n powerReviewsScript.onload = () => {\n this.isReviewLoaded = true;\n this.showReviewOverlay();\n };\n\n script.parentNode && script.parentNode.insertBefore(powerReviewsScript, script);\n }\n\n private renderOverlay() {\n const reviewsConfig = {\n ...this.configs.config.ratingsReviewsConfig,\n components: REVIEW_COMPONENTS\n };\n const reviewDisplayParams = ReviewDetails.toJson({\n ...reviewsConfig,\n ...this.reviewDetailsData\n });\n POWERREVIEWS.display.render(reviewDisplayParams);\n this.isProductInfoVisible && this.observeReviewDetails();\n }\n\n private observeReviewDetails = () => {\n const reviewDetailsContainer = this.reviewDetailsRef.current;\n if (reviewDetailsContainer === null) {\n return;\n }\n const mutationObserver: MutationObserver = new MutationObserver(this.onReviewDetailsLoaded);\n const config = {\n childList: true,\n subtree: true\n };\n\n mutationObserver.observe(reviewDetailsContainer, config);\n };\n\n private onReviewDetailsLoaded = (\n mutationList: MutationRecord[],\n mutationObserver: MutationObserver\n ) => {\n for (const mutation of mutationList) {\n if ((mutation.target).querySelector(`#${REVIEW_SNAPSHOT_ID}`)) {\n this.appendProductDetails();\n mutationObserver.disconnect();\n break;\n }\n }\n };\n\n // Hacky code to inject product/service info into review details as Power Reviews doesn't support this\n private appendProductDetails() {\n const reviewSnapShotContainer = document.getElementById(REVIEW_SNAPSHOT_ID);\n if (!reviewSnapShotContainer) {\n return;\n }\n const imageElement = document.createElement('img');\n const productElement = document.createElement('p');\n const descriptionElement = document.createElement('p');\n const productInfoWrapper = document.createElement('div');\n\n imageElement.src = this.reviewDetailsData.imageUrl;\n imageElement.alt = this.reviewDetailsData.name;\n imageElement.className = 'elc-pr-review-product-image';\n\n productElement.innerHTML = this.reviewDetailsData.name;\n productElement.className = 'elc-pr-review-product-name';\n\n descriptionElement.innerHTML = this.reviewDetailsData.description;\n descriptionElement.className = 'elc-pr-review-product-description';\n\n productInfoWrapper.className = 'elc-pr-review-product-wrapper';\n productInfoWrapper.appendChild(productElement);\n productInfoWrapper.appendChild(descriptionElement);\n\n reviewSnapShotContainer.prepend(imageElement, productInfoWrapper);\n }\n\n public handleUnmount() {\n this.removeReviewsEventHandlers();\n emit(events.REVIEW_OVERLAY_CLOSED, {\n id: this.reviewDetailsData.pageId,\n name: this.reviewDetailsData.name || '',\n reviewCategory: 'service reviews'\n });\n }\n}\n","import { diContainer, serviceNames } from '../../service-setup/diContainer';\nimport { query, serviceQueries } from '@estee/elc-service-bus';\nimport { Config } from '../domain/entities/Config';\n\nexport class ConfigRepository {\n private config: Config;\n\n constructor() {\n this.config = diContainer.get(serviceNames.config);\n }\n\n public getConfigs = async (configs: string[]) => {\n const config = await query(serviceQueries.GET_CONFIG, configs);\n\n this.config.updateConfig(config);\n };\n}\n","export enum InventoryStatuses {\n Active = 'Active',\n TempOutOfStock = 'Temporarily out of stock',\n ComingSoon = 'Coming Soon',\n SoldOut = 'Sold Out',\n FreePromo = 'Free Promo',\n DoNotDisplay = 'Do Not Display',\n Inactive = 'Inactive',\n PreOrder = 'Pre Order'\n}\n","import {\n IProduct,\n IVariant,\n IRatingsReviewsConfig,\n IComponents,\n IPRProductProduct,\n ISkuData\n} from '../../interfaces/IRating';\nimport {\n REVIEW_DISPLAY,\n QUESTION_DISPLAY,\n SNAPSHOT_TYPE,\n PAGINATION_TYPE\n} from '../../constants/PowerReviews';\nimport { emit, events } from '@estee/elc-service-bus';\nimport { REVIEW_CATEGORY } from '../../constants/ServiceReviews';\nimport { InventoryStatuses } from '../../constants/InventoryStatuses';\n\nexport class PowerReviewsProduct {\n public api_key: string;\n public locale: string;\n public merchant_group_id: string;\n public merchant_id: string;\n public page_id: string;\n public review_wrapper_url: string;\n public components: IComponents = {\n ReviewDisplay: REVIEW_DISPLAY,\n QuestionDisplay: QUESTION_DISPLAY\n };\n public REVIEW_DISPLAY_SNAPSHOT_TYPE: string;\n public REVIEW_DISPLAY_PAGINATION_TYPE = PAGINATION_TYPE.DEFAULT;\n public variants: IVariant[];\n public product: IPRProductProduct;\n public on_submit: () => void;\n\n public static fromJson(\n data: IProduct,\n ratingsReviewsConfig: IRatingsReviewsConfig,\n paginationType: string,\n selectedSkuId?: string\n ): PowerReviewsProduct {\n const prProduct = new PowerReviewsProduct();\n\n const {\n apiKey,\n locale,\n merchantGroupId,\n merchantId,\n pageId,\n reviewWrapperUrl,\n reviewDisplaySnapshotType,\n brandName\n } = ratingsReviewsConfig;\n\n const {\n productId,\n displayName,\n productUrl,\n shortDescription,\n defaultCategory,\n defaultSku: { price, originalPrice },\n skus,\n defaultSku\n } = data;\n\n const baseUrl = `${window.location.protocol}//${document.location.hostname}`;\n const prPageId = pageId || productId;\n\n prProduct.api_key = apiKey;\n prProduct.locale = locale;\n prProduct.merchant_group_id = merchantGroupId;\n prProduct.merchant_id = merchantId;\n prProduct.page_id = prPageId;\n prProduct.review_wrapper_url = prProduct.reviewUrl(reviewWrapperUrl, prPageId);\n prProduct.REVIEW_DISPLAY_SNAPSHOT_TYPE = reviewDisplaySnapshotType || SNAPSHOT_TYPE;\n\n // Converting boolean to string as requested by PowerReviews\n const inStock = prProduct.isInStock(data, selectedSkuId).toString();\n\n prProduct.product = {\n name: displayName,\n url: baseUrl.concat(productUrl),\n image_url: prProduct.getDefaultImage(defaultSku),\n description: shortDescription,\n category_name: defaultCategory.id,\n brand_name: brandName,\n price: price || originalPrice,\n in_stock: inStock\n };\n\n if (skus.length > 1) {\n prProduct.product.variants = prProduct.productVariants(data);\n } else {\n prProduct.product.upc = defaultSku.upc;\n }\n\n if (paginationType === PAGINATION_TYPE.VERTICAL) {\n prProduct.REVIEW_DISPLAY_PAGINATION_TYPE = paginationType;\n }\n\n prProduct.on_submit = function () {\n prProduct.onPrFormSubmit(data);\n };\n\n return prProduct;\n }\n\n private isInStock(data: IProduct, selectedSkuId?: string) {\n const { isOutOfStock, skus } = data;\n\n if (selectedSkuId) {\n const selectedSku = skus.find((sku) => sku.skuId === selectedSkuId);\n if (selectedSku) {\n return selectedSku.inventoryStatus === InventoryStatuses.Active;\n }\n }\n\n return !isOutOfStock;\n }\n\n private onPrFormSubmit(data: IProduct) {\n const payLoad = {\n id: data.productId,\n name: data.displayName,\n reviewCategory: REVIEW_CATEGORY\n };\n emit(events.ASK_AND_ANSWER_SUBMITTED, { ...payLoad });\n }\n\n private reviewUrl(reviewWrapperUrl: string, pageId: string): string {\n const url = reviewWrapperUrl || '/review/create';\n const queryString = `?pr_page_id=${pageId}`;\n\n return `${url}${queryString}`;\n }\n\n private productVariants(data: IProduct) {\n const isShaded = data.isShaded;\n\n return data.skus.reduce((variantAcc: IVariant[], sku) => {\n variantAcc.push({\n name: this.getVariantName(sku, isShaded) || '',\n image_url: this.getDefaultImage(sku),\n upc: sku.upc,\n page_id_variant: sku.perlgem.SKU_BASE_ID\n });\n\n return variantAcc;\n }, []);\n }\n\n private getVariantName(sku: ISkuData, isShaded: boolean) {\n if (isShaded) {\n return sku.shades.length && sku.shades[0].name;\n }\n\n return sku.sizes.length && sku.sizes[0].value;\n }\n\n private getDefaultImage(sku: ISkuData) {\n const baseUrl = `${window.location.protocol}//${document.location.hostname}`;\n const { defaultLargeImage, defaultMediumImage } = sku;\n\n if (defaultLargeImage && defaultLargeImage.src) {\n return baseUrl.concat(defaultLargeImage.src);\n }\n\n if (defaultMediumImage && defaultMediumImage.src) {\n return baseUrl.concat(defaultMediumImage.src);\n }\n\n return '';\n }\n}\n","import { action, observable } from 'mobx';\nimport { IProduct } from '../interfaces/IRating';\nimport { PowerReviewsProduct } from '../domain/entities/PowerReviewsProduct';\nimport { Config } from '../domain/entities/Config';\n\nexport class ProductRepository {\n @observable public products: IProduct[] = [];\n @observable public productId: string = '';\n @observable public selectedSkuId: string = '';\n @observable public configService: Config;\n @observable public paginationType: string = '';\n\n constructor(configService: Config) {\n this.configService = configService;\n }\n\n @action\n public updateProductId = (productId: string) => {\n this.productId = productId;\n };\n\n @action\n public setPaginationType = (paginationType: string) => {\n this.paginationType = paginationType;\n };\n\n @action\n public setSelectedSkuId = (skuId: string) => {\n this.selectedSkuId = skuId;\n };\n\n @action\n public setProducts = (products: IProduct[]) => {\n const listOfProducts = [...this.products, ...products];\n\n this.products = listOfProducts.filter(\n (product, index, arr) =>\n arr.findIndex((i) => i.productId === product.productId) === index\n );\n };\n\n public getProductById = (productId: string) =>\n this.products.find((prod: IProduct) => prod.productId === productId);\n\n public getPowerReviewsProduct(products: IProduct[]) {\n const {\n ratingsReviewsConfig,\n brand: { literal: brandName }\n } = this.configService.config;\n\n return PowerReviewsProduct.fromJson(\n products[0],\n { ...ratingsReviewsConfig, brandName },\n this.paginationType,\n this.selectedSkuId\n );\n }\n}\n","import { observable, action } from 'mobx';\nimport { IBrand, IRatingsReviewsConfig } from '../../interfaces/IRating';\n\nexport interface IConfig {\n ratingsReviewsConfig: IRatingsReviewsConfig;\n brand: IBrand;\n}\nexport class Config {\n @observable public config: IConfig;\n\n @action\n public updateConfig(config: Partial) {\n this.config = { ...this.config, ...config };\n }\n}\n","const isString: Function = (value: unknown) => typeof value === 'string';\n\nconst VALIDATORS: { [key: string]: Function[] } = {\n buid: [Boolean],\n context: [Boolean],\n environment: [Boolean, isString],\n level: [Boolean, isString],\n message: [Boolean, isString],\n serviceName: [Boolean, isString],\n serviceVersion: [Boolean, isString],\n triggerType: [Boolean, isString],\n userAgent: [Boolean, isString]\n};\n\nexport const validate = (requestBody: { [key: string]: unknown }) => {\n const result = Object.keys(VALIDATORS).reduce((acc: boolean[], key) => {\n VALIDATORS[key].forEach((validator: (value: unknown) => boolean) => {\n const requestValue = requestBody[key];\n acc.push(validator(requestValue));\n });\n\n return acc;\n }, []);\n\n return result.every(Boolean);\n};\n","import { root, IFrontendLogger } from '@estee/elc-universal-utils';\nimport { validate } from './ELCLoggerValidations';\nimport { ILogData, IFullData } from './ELCLogger';\n\nexport class LoggerApiSDK {\n private loggingServiceUrl: string = '/stardust-fe-logging-v0/logMessage';\n private queue: ILogData[] = [];\n private isRequestIdleCallbackScheduled: boolean;\n private lastTimeExecuted: number = Date.now();\n private frontendLogger: IFrontendLogger = root.site ? root.site.frontendLogger || {} : {};\n\n private generateRequestBody(fullData: IFullData) {\n const { config, level, logdata } = fullData;\n\n const { payload = {}, message, triggerType } = logdata;\n const {\n serviceName: payloadServiceName,\n serviceVersion: payloadServiceVersion,\n context,\n error\n } = payload;\n\n const {\n serviceName: configServiceName,\n serviceVersion: configServiceVersion,\n buid: configBuid,\n environment: configEnvironment\n } = config;\n const stringifiedError = error && JSON.stringify(error, Object.getOwnPropertyNames(error));\n\n return {\n context: {\n ...context,\n date: new Date().toUTCString(),\n error: stringifiedError\n },\n environment: configEnvironment || root.env,\n level: level,\n message,\n serviceName: payloadServiceName || configServiceName,\n serviceVersion: payloadServiceVersion || configServiceVersion,\n siteUrl: root.location.href,\n buid: configBuid || root.buid,\n triggerType,\n userAgent: root.navigator.userAgent\n };\n }\n\n public sendLog(fullData: IFullData) {\n const requestBody = this.generateRequestBody(fullData);\n const loggedServices = this.frontendLogger.loggedServices || {};\n const serviceConfig = loggedServices[requestBody.serviceName] || {};\n const isServiceEnabled = serviceConfig.isEnabled;\n\n if (this.frontendLogger.isEnabled && isServiceEnabled) {\n if (!validate(requestBody)) {\n throw new Error(`Request body for error logging did not validate`);\n }\n\n this.addLogToQueue(requestBody);\n }\n }\n\n public addLogToQueue = (log: ILogData) => {\n this.queue.push(log);\n this.schedulePendingEvents();\n };\n\n private schedulePendingEvents = () => {\n if (this.isRequestIdleCallbackScheduled) {\n return;\n }\n\n this.isRequestIdleCallbackScheduled = true;\n root.requestIdleCallback(this.processPendingLogs);\n };\n\n private processPendingLogs = () => {\n this.isRequestIdleCallbackScheduled = false;\n\n if (this.queue.length > 0 && Date.now() - this.lastTimeExecuted > 2000) {\n root.HttpTransport.post({\n url: this.loggingServiceUrl,\n body: this.queue\n }).catch(() => console.error('Errors failed to be sent to sumoLogic', this.queue));\n\n this.queue = [];\n this.lastTimeExecuted = Date.now();\n }\n\n if (this.queue.length > 0) {\n this.schedulePendingEvents();\n }\n };\n}\n","import { debug, Debugger } from 'debug';\nimport { LoggerApiSDK } from './LoggerApiSDK';\nimport { getSandboxEnvironment, root, ISandboxEnvironment } from '@estee/elc-universal-utils';\n\nexport interface IFullData {\n logdata: ILogData;\n level: string;\n config: IELCLogger;\n}\n\nexport interface IPayload {\n error?: Error;\n context?: object;\n serviceName?: string;\n serviceVersion?: string;\n}\n\nexport interface ILogData {\n triggerType: TriggerType;\n message: string;\n payload?: IPayload;\n}\n\nexport enum TriggerType {\n runtimeError = 'runtimeError',\n api = 'api',\n graphqlApi = 'graphqlApi',\n render = 'render',\n serviceBus = 'serviceBus',\n config = 'config',\n translation = 'translation',\n other = 'other'\n}\n\nexport interface IELCLogger {\n serviceName: string;\n serviceVersion?: string;\n environment?: string;\n buid?: string;\n}\n\nexport class ELCLogger {\n private config: IELCLogger;\n\n private errorDebugger?: Debugger;\n private infoDebugger?: Debugger;\n private warningDebugger?: Debugger;\n private eventDebugger?: Debugger;\n private queryDebugger?: Debugger;\n private commandDebugger?: Debugger;\n\n constructor(config: IELCLogger) {\n this.config = config;\n const logger = debug(this.config.serviceName);\n root.loggerApiSDK = root.loggerApiSDK || new LoggerApiSDK();\n\n this.errorDebugger = logger.extend('error');\n this.infoDebugger = logger.extend('info');\n this.warningDebugger = logger.extend('warning');\n this.eventDebugger = logger.extend('event');\n this.queryDebugger = logger.extend('query');\n this.commandDebugger = logger.extend('command');\n }\n\n public error = async (logdata: ILogData) => {\n if (this.errorDebugger) {\n this.errorDebugger(this.enhanceLogData(logdata));\n }\n\n const isProd =\n this.config.environment === ISandboxEnvironment.PRODUCTION ||\n root.env === ISandboxEnvironment.PRODUCTION;\n\n if ((isProd && getSandboxEnvironment() === ISandboxEnvironment.LIVE) || !isProd) {\n return this.sendLog(logdata, 'error');\n }\n };\n\n public info = (logdata: ILogData) => {\n if (this.infoDebugger) {\n this.infoDebugger(this.enhanceLogData(logdata));\n }\n };\n\n public warning = (logdata: ILogData) => {\n if (this.warningDebugger) {\n this.warningDebugger(this.enhanceLogData(logdata));\n }\n };\n\n public event = (logdata: ILogData) => {\n if (this.eventDebugger) {\n this.eventDebugger(this.enhanceLogData(logdata));\n }\n };\n\n public query = (logdata: ILogData) => {\n if (this.queryDebugger) {\n this.queryDebugger(this.enhanceLogData(logdata));\n }\n };\n\n public command = (logdata: ILogData) => {\n if (this.commandDebugger) {\n this.commandDebugger(this.enhanceLogData(logdata));\n }\n };\n\n private enhanceLogData = (logdata: ILogData) => ({\n ...logdata,\n triggerSource: this.config.serviceName,\n date: new Date().toUTCString()\n });\n // @ts-ignore\n private async sendLog(logdata: ILogData, level: string) {\n try {\n root.loggerApiSDK.sendLog({ logdata, level, config: this.config });\n } catch (e) {\n if (this.errorDebugger) {\n this.errorDebugger(\n this.enhanceLogData({\n message: 'Could not send log',\n triggerType: TriggerType.api,\n payload: {\n error: e,\n context: logdata\n }\n })\n );\n }\n }\n }\n}\n","import { HeaderType, HeaderObject, root } from '@estee/elc-universal-utils';\nimport { ELCLogger, TriggerType } from '@estee/elc-logging';\n\nexport const AUTHORIZATION_HEADER_NAME = 'AuthorizationToken';\nexport const BUSINESS_UNIT_HEADER_NAME = 'Business-Unit';\n\nexport interface IError {\n status: number;\n}\nexport interface IDataMapperOperations {\n [key: string]: Function | undefined;\n request?(request: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [k: string]: any;\n }): {};\n response?(response: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [k: string]: any;\n }): {};\n}\nexport interface IDataMappings {\n [key: string]: IDataMapperOperations;\n}\nexport interface IResponse {\n data: T;\n reponseHeaders: Headers | {};\n}\nexport interface IPayload {\n url: string;\n body?: {};\n options?: {};\n headers?: {};\n returnAsPlainText?: boolean;\n}\nexport interface IGetPayload {\n url: string;\n options?: {};\n headers?: {};\n params?: {};\n}\nexport interface IRequestOptions {\n debounceInterval?: number;\n bypassCache?: boolean;\n}\nexport interface IHttpTransport {\n addGlobalHeaders(header: HeaderObject): void;\n removeGlobalHeader(headerName: string): void;\n delete(payload: string | IPayload): Promise>;\n post(payload: IPayload): Promise>;\n patch(payload: IPayload): Promise>;\n put(payload: IPayload): Promise>;\n get(payload: string | IGetPayload, IRequestOptions?: IRequestOptions): Promise>;\n}\nexport interface IDataMapper {\n // eslint-disable-next-line @typescript-eslint/ban-types\n mapRequest(name: string, request: Object): {};\n // eslint-disable-next-line @typescript-eslint/ban-types\n mapResponse(name: string, response: Object): {};\n dataMappings?: IDataMappings;\n}\n\nexport interface IConfig {\n cartId?: string;\n httpTransport: IHttpTransport;\n dataMapper?: IDataMapper;\n businessUnitId?: string;\n drupalDomain?: string;\n}\n\nexport class Api {\n protected bearerToken: string;\n protected httpTransport: IHttpTransport;\n protected businessUnitId: string | undefined;\n private logger: ELCLogger;\n\n constructor(configStore: IConfig, serviceName: string, serviceVersion: string) {\n this.httpTransport = configStore.httpTransport;\n this.businessUnitId = configStore.businessUnitId;\n this.logger = new ELCLogger({ serviceName, serviceVersion });\n }\n\n public addHeader(header: HeaderObject) {\n this.httpTransport.addGlobalHeaders(header);\n }\n\n public removeHeader(headerName: HeaderType) {\n this.httpTransport.removeGlobalHeader(headerName);\n }\n\n public setBearerToken(bearerToken: string) {\n if (bearerToken) {\n this.addHeader({\n [AUTHORIZATION_HEADER_NAME]: `${bearerToken}`\n });\n } else {\n this.removeHeader(AUTHORIZATION_HEADER_NAME);\n }\n }\n protected delete = async (payload: IPayload) => {\n let response: IResponse = { data: {} as T, reponseHeaders: {} };\n\n try {\n response = await this.httpTransport.delete(payload);\n } catch (e) {\n this.handleError(e, 'delete', payload);\n }\n\n return response;\n };\n\n protected get = async (\n payload: IGetPayload | string,\n { debounceInterval = 200, bypassCache = false }: IRequestOptions = {}\n ) => {\n let response: IResponse = { data: {} as T, reponseHeaders: {} };\n\n try {\n response = await this.httpTransport.get(payload, {\n debounceInterval,\n bypassCache\n });\n } catch (e) {\n this.handleError(e, 'get', payload);\n }\n\n return response;\n };\n\n protected patch = async (payload: IPayload) => {\n let response: IResponse = { data: {} as T, reponseHeaders: {} };\n\n try {\n response = await this.httpTransport.patch(payload);\n } catch (e) {\n this.handleError(e, 'patch', payload);\n }\n\n return response;\n };\n\n protected post = async (payload: IPayload) => {\n let response: IResponse = { data: {} as T, reponseHeaders: {} };\n try {\n response = await this.httpTransport.post(payload);\n } catch (e) {\n this.handleError(e, 'post', payload);\n }\n\n return response;\n };\n protected put = async (payload: IPayload) => {\n let response: IResponse = { data: {} as T, reponseHeaders: {} };\n\n try {\n response = await this.httpTransport.put(payload);\n } catch (e) {\n this.handleError(e, 'put', payload);\n }\n\n return response;\n };\n\n private handleError = (e: Error, requestType: string, originalPayload: IPayload | string) => {\n this.logger.error({\n triggerType: TriggerType.api,\n message: `${e}`,\n payload: {\n context: {\n subdomain: root.site && root.site.client && root.site.client.subdomain,\n originalPayload,\n requestType\n },\n error: e\n }\n });\n };\n}\n","import { Api, IConfig } from '@estee/elc-service';\nimport { POWER_REVIEWS_API_LINK } from '../internal/constants/PowerReviews';\nimport { ConfigStore } from '../service-setup/ConfigStore';\n\nexport interface IReviewSnippetApiSdkConfig extends IConfig {\n configStore: ConfigStore;\n}\n\nexport interface IReviewSnippetResultData {\n data: {\n results: IReviewSnippetApiResult[];\n };\n}\n\nexport interface IReviewSnippetApiResult {\n page_id: string;\n rollup: IRollupJsonData;\n}\n\nexport interface IRollupJsonData {\n average_rating: number;\n review_count: number;\n answered_questions: number;\n}\n\nexport interface IRollUp {\n averageRating: number;\n reviewCount: number;\n answeredQuestions: number;\n}\n\nexport class RatingsAndReviewsApiSdk extends Api {\n private config: IReviewSnippetApiSdkConfig;\n\n constructor(config: IReviewSnippetApiSdkConfig, serviceName: string, serviceVersion: string) {\n super(config, serviceName, serviceVersion);\n this.config = config;\n }\n\n public async getRatingReviewsData(pageIds: string[]): Promise {\n try {\n const {\n merchantId,\n locale,\n apiKey\n } = this.config.configStore.config.ratingsReviewsConfig;\n const joinedPageIds = pageIds.join(',');\n\n const url = `${POWER_REVIEWS_API_LINK}/m/${merchantId}/l/${locale}/product/${joinedPageIds}/snippet?apikey=${apiKey}`;\n const response: IReviewSnippetResultData = await this.httpTransport.get({ url });\n\n return response.data.results;\n } catch (err) {\n throw err;\n }\n }\n}\n","import { diContainer, serviceNames } from '../../service-setup/diContainer';\nimport { observable } from 'mobx';\nimport { ProductRepository } from '../repositories/ProductRepository';\nimport { IPowerReviews, IPowerReviewsProduct, IProduct } from '../interfaces/IRating';\nimport { query, serviceQueries } from '@estee/elc-service-bus';\n\ndeclare let POWERREVIEWS: IPowerReviews;\n\nexport class PowerReviewsInitializedUseCase {\n @observable public productRepository: ProductRepository;\n @observable public productId: string;\n\n constructor(productId: string) {\n this.productId = productId;\n this.productRepository = diContainer.get(serviceNames.productRepository);\n }\n\n private renderReviews(powerReviewsProduct: IPowerReviewsProduct) {\n POWERREVIEWS.display.render(powerReviewsProduct);\n const reviewSection = document.querySelector('.spp-reviews-wrapper');\n if (reviewSection) {\n reviewSection.classList.remove('hidden');\n }\n }\n\n public execute = async () => {\n const products = await query(serviceQueries.GET_PRODUCT_DATA, {\n filterBy: { productIds: [this.productId] }\n });\n\n const powerReviewsProduct: IPowerReviewsProduct = this.productRepository.getPowerReviewsProduct(\n products\n );\n\n this.renderReviews(powerReviewsProduct);\n };\n}\n","export class ReadReviewsClickedUseCase {\n public execute = () => {\n // This class name is being passed by the Drupal file sd_spp_reviews_v1.mustache\n const reviewsSection = document.querySelector('.js-product-reviews');\n\n if (reviewsSection) {\n reviewsSection.scrollIntoView({\n behavior: 'smooth',\n block: 'start'\n });\n }\n };\n}\n","import { ConfigStore } from '../../service-setup/ConfigStore';\nimport { diContainer, serviceNames } from '../../service-setup/diContainer';\nimport { IReviewsPayload } from '../interfaces/IReviews';\n\nexport class WriteReviewClickedUseCase {\n private reviewInfo: IReviewsPayload;\n private configStore: ConfigStore;\n constructor(reviewInfo: IReviewsPayload) {\n this.configStore = diContainer.get(serviceNames.configStore);\n this.reviewInfo = reviewInfo;\n }\n public execute = () => {\n const config = this.configStore.config;\n const reviewWrapperUrl =\n config.ratingsReviewsConfig && config.ratingsReviewsConfig.reviewWrapperUrl;\n const createReviewLink: HTMLElement | null = document.querySelector(\n '.pr-snippet-write-review-link'\n );\n const { reviewInfo } = this;\n const reviewLink = reviewInfo && reviewInfo.reviewLink;\n const defaultReviewPath = `${reviewWrapperUrl}?pr_page_id=${reviewInfo.id}`;\n if (createReviewLink) {\n createReviewLink.click();\n\n return;\n }\n window.location.assign(reviewLink || defaultReviewPath);\n };\n}\n","import { ProductRepository } from '../repositories/ProductRepository';\nimport { diContainer, serviceNames } from '../../service-setup/diContainer';\n\nexport class ProductFullLoadedUseCase {\n private productRepository: ProductRepository;\n private productId: string;\n private skuId: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(productId: string, skuId: string) {\n this.productRepository = diContainer.get(serviceNames.productRepository);\n this.productId = productId;\n this.skuId = skuId;\n }\n\n public execute = () => {\n this.productRepository.updateProductId(this.productId);\n this.productRepository.setSelectedSkuId(this.skuId);\n };\n}\n","import { events, on, queryProvider, serviceQueries } from '@estee/elc-service-bus';\nimport { PowerReviewsInitializedUseCase } from '../internal/use-cases/PowerReviewsInitializedUseCase';\nimport { ReadReviewsClickedUseCase } from '../internal/use-cases/ReadReviewsClickedUseCase';\nimport { WriteReviewClickedUseCase } from '../internal/use-cases/WriteReviewClickedUseCase';\nimport { ProductFullLoadedUseCase } from '../internal/use-cases/ProductFullLoadedUseCase';\nimport { IReviewsPayload } from '../internal/interfaces/IReviews';\nimport { RatingsRepository } from '../internal/repositories/RatingsRepository';\n\ninterface IProductFullLoaded {\n productId: string;\n skuId: string;\n}\nexport class ServiceBusController {\n private ratingsRepository: RatingsRepository;\n\n constructor(ratingsRepository: RatingsRepository) {\n this.ratingsRepository = ratingsRepository;\n }\n\n @on(events.SPP_POWER_REVIEWS_INIT)\n public powerReviewsInitialized = async (productId: string) => {\n const powerReviewsInitializedUseCase = new PowerReviewsInitializedUseCase(productId);\n await powerReviewsInitializedUseCase.execute();\n };\n\n @on(events.READ_REVIEWS_LINK_CLICKED)\n public readReviewsLinkClicked = () => {\n const readReviewsLinkClickedUseCase = new ReadReviewsClickedUseCase();\n readReviewsLinkClickedUseCase.execute();\n };\n\n @on(events.WRITE_REVIEWS_LINK_CLICKED)\n public writeReviewsLinkClicked = (reviewInfo: IReviewsPayload) => {\n const writeReviewsLinkClickedUseCase = new WriteReviewClickedUseCase(reviewInfo);\n writeReviewsLinkClickedUseCase.execute();\n };\n\n @on(events.PRODUCT_FULL_LOADED)\n public productFullLoaded = ({ productId, skuId }: IProductFullLoaded) => {\n const productFullLoadedUseCase = new ProductFullLoadedUseCase(productId, skuId);\n productFullLoadedUseCase.execute();\n };\n\n @queryProvider(serviceQueries.GET_REVIEW_SNIPPET)\n public getReviewSnippets = async (pageIds: string[]) => {\n return this.ratingsRepository.getProductsRating(pageIds);\n };\n}\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import React from 'react';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport { isValidElementType } from 'react-is';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\n/* eslint-disable import/prefer-default-export */\nfunction invariant(condition, message) {\n if (condition) return;\n var error = new Error(\"loadable: \" + message);\n error.framesToPop = 1;\n error.name = 'Invariant Violation';\n throw error;\n}\nfunction warn(message) {\n // eslint-disable-next-line no-console\n console.warn(\"loadable: \" + message);\n}\n\nvar Context = /*#__PURE__*/\nReact.createContext();\n\nvar LOADABLE_REQUIRED_CHUNKS_KEY = '__LOADABLE_REQUIRED_CHUNKS__';\nfunction getRequiredChunkKey(namespace) {\n return \"\" + namespace + LOADABLE_REQUIRED_CHUNKS_KEY;\n}\n\nvar sharedInternals = /*#__PURE__*/Object.freeze({\n __proto__: null,\n getRequiredChunkKey: getRequiredChunkKey,\n invariant: invariant,\n Context: Context\n});\n\nvar LOADABLE_SHARED = {\n initialChunks: {}\n};\n\nvar STATUS_PENDING = 'PENDING';\nvar STATUS_RESOLVED = 'RESOLVED';\nvar STATUS_REJECTED = 'REJECTED';\n\nfunction resolveConstructor(ctor) {\n if (typeof ctor === 'function') {\n return {\n requireAsync: ctor,\n resolve: function resolve() {\n return undefined;\n },\n chunkName: function chunkName() {\n return undefined;\n }\n };\n }\n\n return ctor;\n}\n\nvar withChunkExtractor = function withChunkExtractor(Component) {\n return function (props) {\n return React.createElement(Context.Consumer, null, function (extractor) {\n return React.createElement(Component, Object.assign({\n __chunkExtractor: extractor\n }, props));\n });\n };\n};\n\nvar identity = function identity(v) {\n return v;\n};\n\nfunction createLoadable(_ref) {\n var _ref$defaultResolveCo = _ref.defaultResolveComponent,\n defaultResolveComponent = _ref$defaultResolveCo === void 0 ? identity : _ref$defaultResolveCo,\n _render = _ref.render,\n onLoad = _ref.onLoad;\n\n function loadable(loadableConstructor, options) {\n if (options === void 0) {\n options = {};\n }\n\n var ctor = resolveConstructor(loadableConstructor);\n var cache = {};\n /**\n * Cachekey represents the component to be loaded\n * if key changes - component has to be reloaded\n * @param props\n * @returns {null|Component}\n */\n\n function _getCacheKey(props) {\n if (options.cacheKey) {\n return options.cacheKey(props);\n }\n\n if (ctor.resolve) {\n return ctor.resolve(props);\n }\n\n return 'static';\n }\n /**\n * Resolves loaded `module` to a specific `Component\n * @param module\n * @param props\n * @param Loadable\n * @returns Component\n */\n\n\n function resolve(module, props, Loadable) {\n var Component = options.resolveComponent ? options.resolveComponent(module, props) : defaultResolveComponent(module);\n\n if (options.resolveComponent && !isValidElementType(Component)) {\n throw new Error(\"resolveComponent returned something that is not a React component!\");\n }\n\n hoistNonReactStatics(Loadable, Component, {\n preload: true\n });\n return Component;\n }\n\n var InnerLoadable =\n /*#__PURE__*/\n function (_React$Component) {\n _inheritsLoose(InnerLoadable, _React$Component);\n\n InnerLoadable.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {\n var cacheKey = _getCacheKey(props);\n\n return _extends({}, state, {\n cacheKey: cacheKey,\n // change of a key triggers loading state automatically\n loading: state.loading || state.cacheKey !== cacheKey\n });\n };\n\n function InnerLoadable(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.state = {\n result: null,\n error: null,\n loading: true,\n cacheKey: _getCacheKey(props)\n };\n invariant(!props.__chunkExtractor || ctor.requireSync, 'SSR requires `@loadable/babel-plugin`, please install it'); // Server-side\n\n if (props.__chunkExtractor) {\n // This module has been marked with no SSR\n if (options.ssr === false) {\n return _assertThisInitialized(_this);\n } // We run load function, we assume that it won't fail and that it\n // triggers a synchronous loading of the module\n\n\n ctor.requireAsync(props)[\"catch\"](function () {\n return null;\n }); // So we can require now the module synchronously\n\n _this.loadSync();\n\n props.__chunkExtractor.addChunk(ctor.chunkName(props));\n\n return _assertThisInitialized(_this);\n } // Client-side with `isReady` method present (SSR probably)\n // If module is already loaded, we use a synchronous loading\n // Only perform this synchronous loading if the component has not\n // been marked with no SSR, else we risk hydration mismatches\n\n\n if (options.ssr !== false && ( // is ready - was loaded in this session\n ctor.isReady && ctor.isReady(props) || // is ready - was loaded during SSR process\n ctor.chunkName && LOADABLE_SHARED.initialChunks[ctor.chunkName(props)])) {\n _this.loadSync();\n }\n\n return _this;\n }\n\n var _proto = InnerLoadable.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true; // retrieve loading promise from a global cache\n\n var cachedPromise = this.getCache(); // if promise exists, but rejected - clear cache\n\n if (cachedPromise && cachedPromise.status === STATUS_REJECTED) {\n this.setCache();\n } // component might be resolved synchronously in the constructor\n\n\n if (this.state.loading) {\n this.loadAsync();\n }\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n // Component has to be reloaded on cacheKey change\n if (prevState.cacheKey !== this.state.cacheKey) {\n this.loadAsync();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n if (this.mounted) {\n this.setState(nextState, callback);\n }\n }\n /**\n * returns a cache key for the current props\n * @returns {Component|string}\n */\n ;\n\n _proto.getCacheKey = function getCacheKey() {\n return _getCacheKey(this.props);\n }\n /**\n * access the persistent cache\n */\n ;\n\n _proto.getCache = function getCache() {\n return cache[this.getCacheKey()];\n }\n /**\n * sets the cache value. If called without value sets it as undefined\n */\n ;\n\n _proto.setCache = function setCache(value) {\n if (value === void 0) {\n value = undefined;\n }\n\n cache[this.getCacheKey()] = value;\n };\n\n _proto.triggerOnLoad = function triggerOnLoad() {\n var _this2 = this;\n\n if (onLoad) {\n setTimeout(function () {\n onLoad(_this2.state.result, _this2.props);\n });\n }\n }\n /**\n * Synchronously loads component\n * target module is expected to already exists in the module cache\n * or be capable to resolve synchronously (webpack target=node)\n */\n ;\n\n _proto.loadSync = function loadSync() {\n // load sync is expecting component to be in the \"loading\" state already\n // sounds weird, but loading=true is the initial state of InnerLoadable\n if (!this.state.loading) return;\n\n try {\n var loadedModule = ctor.requireSync(this.props);\n var result = resolve(loadedModule, this.props, Loadable);\n this.state.result = result;\n this.state.loading = false;\n } catch (error) {\n console.error('loadable-components: failed to synchronously load component, which expected to be available', {\n fileName: ctor.resolve(this.props),\n chunkName: ctor.chunkName(this.props),\n error: error ? error.message : error\n });\n this.state.error = error;\n }\n }\n /**\n * Asynchronously loads a component.\n */\n ;\n\n _proto.loadAsync = function loadAsync() {\n var _this3 = this;\n\n var promise = this.resolveAsync();\n promise.then(function (loadedModule) {\n var result = resolve(loadedModule, _this3.props, {\n Loadable: Loadable\n });\n\n _this3.safeSetState({\n result: result,\n loading: false\n }, function () {\n return _this3.triggerOnLoad();\n });\n })[\"catch\"](function (error) {\n return _this3.safeSetState({\n error: error,\n loading: false\n });\n });\n return promise;\n }\n /**\n * Asynchronously resolves(not loads) a component.\n * Note - this function does not change the state\n */\n ;\n\n _proto.resolveAsync = function resolveAsync() {\n var _this4 = this;\n\n var _this$props = this.props,\n __chunkExtractor = _this$props.__chunkExtractor,\n forwardedRef = _this$props.forwardedRef,\n props = _objectWithoutPropertiesLoose(_this$props, [\"__chunkExtractor\", \"forwardedRef\"]);\n\n var promise = this.getCache();\n\n if (!promise) {\n promise = ctor.requireAsync(props);\n promise.status = STATUS_PENDING;\n this.setCache(promise);\n promise.then(function () {\n promise.status = STATUS_RESOLVED;\n }, function (error) {\n console.error('loadable-components: failed to asynchronously load component', {\n fileName: ctor.resolve(_this4.props),\n chunkName: ctor.chunkName(_this4.props),\n error: error ? error.message : error\n });\n promise.status = STATUS_REJECTED;\n });\n }\n\n return promise;\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n forwardedRef = _this$props2.forwardedRef,\n propFallback = _this$props2.fallback,\n __chunkExtractor = _this$props2.__chunkExtractor,\n props = _objectWithoutPropertiesLoose(_this$props2, [\"forwardedRef\", \"fallback\", \"__chunkExtractor\"]);\n\n var _this$state = this.state,\n error = _this$state.error,\n loading = _this$state.loading,\n result = _this$state.result;\n\n if (options.suspense) {\n var cachedPromise = this.getCache() || this.loadAsync();\n\n if (cachedPromise.status === STATUS_PENDING) {\n throw this.loadAsync();\n }\n }\n\n if (error) {\n throw error;\n }\n\n var fallback = propFallback || options.fallback || null;\n\n if (loading) {\n return fallback;\n }\n\n return _render({\n fallback: fallback,\n result: result,\n options: options,\n props: _extends({}, props, {\n ref: forwardedRef\n })\n });\n };\n\n return InnerLoadable;\n }(React.Component);\n\n var EnhancedInnerLoadable = withChunkExtractor(InnerLoadable);\n var Loadable = React.forwardRef(function (props, ref) {\n return React.createElement(EnhancedInnerLoadable, Object.assign({\n forwardedRef: ref\n }, props));\n }); // In future, preload could use ``\n\n Loadable.preload = function (props) {\n ctor.requireAsync(props);\n };\n\n Loadable.load = function (props) {\n return ctor.requireAsync(props);\n };\n\n return Loadable;\n }\n\n function lazy(ctor, options) {\n return loadable(ctor, _extends({}, options, {\n suspense: true\n }));\n }\n\n return {\n loadable: loadable,\n lazy: lazy\n };\n}\n\nfunction defaultResolveComponent(loadedModule) {\n // eslint-disable-next-line no-underscore-dangle\n return loadedModule.__esModule ? loadedModule[\"default\"] : loadedModule[\"default\"] || loadedModule;\n}\n\n/* eslint-disable no-use-before-define, react/no-multi-comp */\n\nvar _createLoadable =\n/*#__PURE__*/\ncreateLoadable({\n defaultResolveComponent: defaultResolveComponent,\n render: function render(_ref) {\n var Component = _ref.result,\n props = _ref.props;\n return React.createElement(Component, props);\n }\n}),\n loadable = _createLoadable.loadable,\n lazy = _createLoadable.lazy;\n\n/* eslint-disable no-use-before-define, react/no-multi-comp */\n\nvar _createLoadable$1 =\n/*#__PURE__*/\ncreateLoadable({\n onLoad: function onLoad(result, props) {\n if (result && props.forwardedRef) {\n if (typeof props.forwardedRef === 'function') {\n props.forwardedRef(result);\n } else {\n props.forwardedRef.current = result;\n }\n }\n },\n render: function render(_ref) {\n var result = _ref.result,\n props = _ref.props;\n\n if (props.children) {\n return props.children(result);\n }\n\n return null;\n }\n}),\n loadable$1 = _createLoadable$1.loadable,\n lazy$1 = _createLoadable$1.lazy;\n\n/* eslint-disable no-underscore-dangle, camelcase */\nvar BROWSER = typeof window !== 'undefined';\nfunction loadableReady(done, _temp) {\n if (done === void 0) {\n done = function done() {};\n }\n\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$namespace = _ref.namespace,\n namespace = _ref$namespace === void 0 ? '' : _ref$namespace;\n\n if (!BROWSER) {\n warn('`loadableReady()` must be called in browser only');\n done();\n return Promise.resolve();\n }\n\n var requiredChunks = null;\n\n if (BROWSER) {\n var id = getRequiredChunkKey(namespace);\n var dataElement = document.getElementById(id);\n\n if (dataElement) {\n requiredChunks = JSON.parse(dataElement.textContent);\n var extElement = document.getElementById(id + \"_ext\");\n\n if (extElement) {\n var _JSON$parse = JSON.parse(extElement.textContent),\n namedChunks = _JSON$parse.namedChunks;\n\n namedChunks.forEach(function (chunkName) {\n LOADABLE_SHARED.initialChunks[chunkName] = true;\n });\n } else {\n // version mismatch\n throw new Error('loadable-component: @loadable/server does not match @loadable/component');\n }\n }\n }\n\n if (!requiredChunks) {\n warn('`loadableReady()` requires state, please use `getScriptTags` or `getScriptElements` server-side');\n done();\n return Promise.resolve();\n }\n\n var resolved = false;\n return new Promise(function (resolve) {\n window.__LOADABLE_LOADED_CHUNKS__ = window.__LOADABLE_LOADED_CHUNKS__ || [];\n var loadedChunks = window.__LOADABLE_LOADED_CHUNKS__;\n var originalPush = loadedChunks.push.bind(loadedChunks);\n\n function checkReadyState() {\n if (requiredChunks.every(function (chunk) {\n return loadedChunks.some(function (_ref2) {\n var chunks = _ref2[0];\n return chunks.indexOf(chunk) > -1;\n });\n })) {\n if (!resolved) {\n resolved = true;\n resolve();\n }\n }\n }\n\n loadedChunks.push = function () {\n originalPush.apply(void 0, arguments);\n checkReadyState();\n };\n\n checkReadyState();\n }).then(done);\n}\n\n/* eslint-disable no-underscore-dangle */\nvar loadable$2 = loadable;\nloadable$2.lib = loadable$1;\nvar lazy$2 = lazy;\nlazy$2.lib = lazy$1;\nvar __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = sharedInternals;\n\nexport default loadable$2;\nexport { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, lazy$2 as lazy, loadableReady };\n","import loadable from '@loadable/component';\nimport {\n root,\n IAppConfig,\n ICachedComponentsRegistry,\n IComponentRegistry,\n IComponentViewController,\n IManifestServiceRegistryComp,\n IServiceRegistryComponent,\n RegisteredComponent,\n ServiceInitializer\n} from '@estee/elc-universal-utils';\nimport { ELCLogger, TriggerType } from '@estee/elc-logging';\nimport { ServiceBusController } from './ServiceBusController';\nimport { getServices } from './utils';\n\nroot.ServiceRegistry = root.ServiceRegistry || {};\n\nexport abstract class Service implements IServiceRegistryComponent {\n protected logger: ELCLogger;\n\n public serviceBusController: ServiceBusController;\n public componentsRegistry: IComponentRegistry = {};\n public cachedComponentsRegistry: ICachedComponentsRegistry = {};\n public isLazy: boolean = false;\n public isStarted: boolean = false;\n public views: string[] = [];\n public startPromise: Promise;\n\n constructor(\n public name: string,\n public version: string,\n public serviceInitializer: ServiceInitializer\n ) {}\n\n public async initializeService(appConfig: IAppConfig): Promise {\n try {\n await this.serviceInitializer(appConfig);\n this.isStarted = true;\n } catch (error) {\n this.logger.error({\n message: `Could not start service ${this.name}`,\n triggerType: TriggerType.render,\n payload: {\n error,\n context: {\n serviceRegistry: root.ServiceRegistry\n }\n }\n });\n }\n }\n\n public start(appConfig: IAppConfig): Promise {\n if (!this.startPromise && !this.isStarted) {\n this.logger = new ELCLogger({\n serviceName: this.name,\n environment: appConfig.env || root.env,\n buid: appConfig.businessUnitId || root.buid,\n serviceVersion: this.version\n });\n\n this.startPromise = this.initializeService(appConfig);\n }\n\n return this.startPromise as Promise;\n }\n\n public register = (overrideValues: Omit) => {\n root.ServiceRegistry = getServices();\n\n root.ServiceRegistry[this.name] = Object.assign(\n root.ServiceRegistry[this.name] || {},\n {\n start: this.start,\n startPromise: this.startPromise,\n name: this.name,\n version: this.version,\n views: this.views,\n getView: this.getView,\n registerView: this.registerView,\n initializeService: this.initializeService,\n setViewInCache: this.setViewInCache,\n getViewFromCache: this.getViewFromCache,\n serviceInitializer: this.serviceInitializer,\n componentsRegistry: this.componentsRegistry,\n cachedComponentsRegistry: this.cachedComponentsRegistry,\n isStarted: this.isStarted,\n isLazy: this.isLazy\n },\n overrideValues || {}\n );\n };\n\n public getView = (componentName: string) => {\n return this.componentsRegistry[componentName] || null;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setViewInCache = (componentName: string, component: React.ComponentType) => {\n this.cachedComponentsRegistry[componentName] = component;\n };\n\n public getViewFromCache = (componentName: string) => {\n return this.cachedComponentsRegistry[componentName] || null;\n };\n\n public registerView = (\n componentName: string,\n component: RegisteredComponent,\n viewController?: () => IComponentViewController\n ) => {\n this.views.push(componentName);\n\n this.componentsRegistry[componentName] = {\n componentName,\n component: loadable(component),\n viewController\n };\n };\n}\n","import { diContainer, serviceNames } from '../../service-setup/diContainer';\nimport { ConfigRepository } from '../repositories/ConfigRepository';\n\nexport class RatingsReviewsServiceStartedUseCase {\n private configRepository: ConfigRepository;\n private configs: string[];\n\n constructor(configs: string[]) {\n this.configRepository = diContainer.get(serviceNames.configRepository);\n this.configs = configs;\n }\n\n public execute = async () => {\n await this.configRepository.getConfigs(this.configs);\n };\n}\n","import { PRODUCT_RATING, PRODUCT_REVIEWS, REVIEW_DETAILS } from '@estee/elc-service-view-names';\nimport { IAppConfig, ServiceInitializer } from '@estee/elc-universal-utils';\nimport { Service } from '@estee/elc-service';\n\nimport { serviceNames, diContainer } from './diContainer';\nimport { RatingsReviewsServiceStartedUseCase } from '../internal/use-cases/RatingsReviewsServiceStartedUseCase';\n\nconst { name, version } = __serviceInfo__;\n\nexport class RatingsReviewsService extends Service {\n constructor(serviceInitializer: ServiceInitializer) {\n super(name, version, serviceInitializer);\n this.registerView(\n PRODUCT_RATING,\n () =>\n import(\n /* webpackChunkName: 'ProductRating' */\n '../exported/product-rating/ProductRating'\n ),\n () => diContainer.get(serviceNames.productRatingViewController)\n );\n this.registerView(\n PRODUCT_REVIEWS,\n () =>\n import(\n /* webpackChunkName: 'ProductReviews' */\n '../exported/product-reviews/ProductReviews'\n ),\n () => diContainer.get(serviceNames.productReviewsViewController)\n );\n this.registerView(\n REVIEW_DETAILS,\n () =>\n import(\n /* webpackChunkName: 'ReviewDetails' */\n '../exported/review-details/ReviewDetails'\n ),\n () => diContainer.get(serviceNames.reviewDetailsViewController)\n );\n }\n\n public async start(config: IAppConfig) {\n const service = await super.start(config);\n\n const useCase = new RatingsReviewsServiceStartedUseCase(['ratingsReviewsConfig', 'brand']);\n await useCase.execute();\n\n return service;\n }\n}\n","import { observable, action } from 'mobx';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Config = any;\n\nexport class ConfigStore {\n @observable public config: Config = {};\n\n constructor(config: Config) {\n this.updateConfig(config);\n }\n\n @action\n public updateConfig(config: Config) {\n this.config = { ...config };\n }\n}\n","import { IReviewSnippetApiResult } from '../../../api/RatingsAndReviewsApiSdk';\nimport { TOTAL_NUMBER_OF_STARS } from '../../constants/PowerReviews';\nimport { computeRoundedValueFor } from '../../utils/ComputeRoundedValueFor';\n\nexport class ReviewSnippet {\n public pageId: string;\n public averageRating: number = 0;\n public reviewCount: number;\n public answeredQuestions: number;\n\n public static fromJson(data: IReviewSnippetApiResult): ReviewSnippet {\n const reviewSnippet = new ReviewSnippet();\n reviewSnippet.pageId = data.page_id;\n reviewSnippet.averageRating = computeRoundedValueFor(data.rollup.average_rating || 0);\n reviewSnippet.reviewCount = data.rollup.review_count;\n reviewSnippet.answeredQuestions = data.rollup.answered_questions;\n\n return reviewSnippet;\n }\n\n public get reviewPercentage() {\n return (this.averageRating / TOTAL_NUMBER_OF_STARS) * 100;\n }\n}\n","import { action, observable } from 'mobx';\nimport { RatingsAndReviewsApiSdk } from '../../api/RatingsAndReviewsApiSdk';\nimport { diContainer, serviceNames } from '../../service-setup/diContainer';\nimport { ReviewSnippet } from '../domain/entities/ReviewSnippet';\nimport {\n DEFAULT_ANSWERED_QUESTIONS,\n DEFAULT_AVERAGE_RATING,\n DEFAULT_REVIEW_COUNT\n} from '../constants/PowerReviews';\n\nconst RATINGS_FETCH_DEBOUNCE_TIMEOUT = 300;\n\ninterface IProductsRating {\n [key: string]: ReviewSnippet;\n}\n\ninterface IStashedPromise {\n resolver(productsSnippet: IProductsRating): void;\n rejecter(): void;\n productIds: string[];\n}\n\nexport class RatingsRepository {\n private apiSdk: RatingsAndReviewsApiSdk;\n private stashedProductIds: string[] = [];\n private ratingsQueryTimeout: number;\n private stashedPromises: IStashedPromise[] = [];\n\n @observable public productRatings: IProductsRating = {};\n\n constructor() {\n this.apiSdk = diContainer.get(serviceNames.ratingsReviewsApiSdk);\n }\n\n public getProductsRating = (productIds: string[]) => {\n return this.debounceGetRatings(productIds);\n };\n\n public getProductRating = (productId: string) => {\n return this.getProductsRating([productId]);\n };\n\n @action\n private fetchProductsRating = async () => {\n const stashedProductIds = this.stashedProductIds;\n const stashedPromises = this.stashedPromises;\n this.stashedPromises = [];\n\n if (stashedProductIds.length) {\n this.stashedProductIds = [];\n\n const data = await this.apiSdk.getRatingReviewsData(stashedProductIds);\n const productRatings = { ...this.productRatings };\n\n this.productRatings = data.reduce((accumulator, dataItem) => {\n accumulator[dataItem.page_id] = ReviewSnippet.fromJson(dataItem);\n\n return accumulator;\n }, productRatings);\n }\n\n this.resolvePromises(stashedPromises);\n };\n\n private createPromise = (productIds: string[]) => {\n return new Promise((resolver, rejecter) => {\n this.stashedPromises.push({\n resolver,\n rejecter,\n productIds\n });\n });\n };\n\n private debounceGetRatings = (productIds: string[]) => {\n const newProductIds = this.getNewProductIdsToStash(productIds);\n\n if (newProductIds.length) {\n clearTimeout(this.ratingsQueryTimeout);\n\n this.stashedProductIds = [...new Set([...this.stashedProductIds, ...newProductIds])];\n this.ratingsQueryTimeout = setTimeout(\n this.fetchProductsRating,\n RATINGS_FETCH_DEBOUNCE_TIMEOUT\n );\n\n return this.createPromise(productIds);\n }\n\n return this.getProductsRatingsById(productIds);\n };\n\n private resolvePromises = (stashedPromises: IStashedPromise[]) => {\n stashedPromises.forEach(this.resolvePromise);\n };\n\n private resolvePromise = (promise: IStashedPromise) => {\n const productReviews = this.getProductsRatingsById(promise.productIds);\n\n promise.resolver(productReviews);\n };\n\n private getProductsRatingsById(productIds: string[]) {\n return productIds.reduce((ratingsList: IProductsRating, productId) => {\n const productRating = this.productRatings[productId];\n const _ratingsList = { ...ratingsList };\n\n _ratingsList[productId] = productRating || this.getEmptyRating(productId);\n\n return _ratingsList;\n }, {});\n }\n\n private getNewProductIdsToStash(productIds: string[]) {\n return productIds.reduce((accumulator: string[], productId) => {\n const newProductIds = [...accumulator];\n\n if (!this.productRatings[productId]) {\n newProductIds.push(productId);\n }\n\n return newProductIds;\n }, []);\n }\n\n private getEmptyRating(pageId: string): ReviewSnippet {\n return ReviewSnippet.fromJson({\n page_id: pageId,\n rollup: {\n average_rating: DEFAULT_AVERAGE_RATING,\n review_count: DEFAULT_REVIEW_COUNT,\n answered_questions: DEFAULT_ANSWERED_QUESTIONS\n }\n });\n }\n}\n","import { root, getServiceVersion } from '@estee/elc-universal-utils';\nimport { getDecorators } from '@estee/elc-service';\nimport { Container } from 'hypo-container';\nimport { ProductRatingViewController } from '../internal/controllers/ProductRatingViewController';\nimport { ProductReviewsViewController } from '../internal/controllers/ProductReviewsViewController';\nimport { ReviewDetailsViewController } from '../internal/controllers/ReviewDetailsViewController';\nimport { ConfigRepository } from '../internal/repositories/ConfigRepository';\nimport { ProductRepository } from '../internal/repositories/ProductRepository';\nimport { Config } from '../internal/domain/entities/Config';\nimport { RatingsAndReviewsApiSdk } from '../api/RatingsAndReviewsApiSdk';\nimport { ServiceBusController } from './ServiceBusController';\nimport { RatingsReviewsService } from './RatingsReviewsService';\nimport { ConfigStore } from './ConfigStore';\nimport { RatingsRepository } from '../internal/repositories/RatingsRepository';\n\nexport const diContainer = new Container();\nexport const serviceNames = {\n configStore: 'CONFIG_STORE',\n config: 'CONFIG',\n configRepository: 'CONFIG_REPOSITORY',\n serviceBusController: 'SERVICE_BUS_CONTROLLER',\n ratingsReviewsService: 'RATINGS_REVIEWS_SERVICE',\n productRatingViewController: 'PRODUCT_RATING_VIEW_CONTROLLER',\n productReviewsViewController: 'PRODUCT_REVIEWS_VIEW_CONTROLLER',\n reviewDetailsViewController: 'REVIEW_DETAILS_VIEW_CONTROLLER',\n productRepository: 'PRODUCT_REPOSITORY',\n ratingsRepository: 'RATINGS_REPOSITORY',\n ratingsReviewsApiSdk: 'REVIEW_SNIPPET_API_SDK',\n httpTransport: 'HTTP_TRANSPORT'\n};\n\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nexport const setConfig = (configJSON: any) => {\n diContainer.config = configJSON;\n};\n\ndiContainer\n .register(\n serviceNames.configStore,\n diContainer.factory((c) => new ConfigStore(c.config))\n )\n .register(serviceNames.config, (c) => new Config())\n .register(serviceNames.configRepository, () => new ConfigRepository())\n .register(\n serviceNames.serviceBusController,\n (c) => new ServiceBusController(c.get(serviceNames.ratingsRepository))\n )\n .register(\n serviceNames.ratingsReviewsService,\n (c) =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new RatingsReviewsService((config: any) => {\n setConfig(config);\n\n return c.get(serviceNames.serviceBusController);\n })\n )\n .register(\n serviceNames.productRatingViewController,\n diContainer.factory(\n (c) =>\n new ProductRatingViewController(\n c.get(serviceNames.productRepository),\n c.get(serviceNames.ratingsRepository)\n )\n )\n )\n .register(\n serviceNames.productReviewsViewController,\n diContainer.factory(\n (c) =>\n new ProductReviewsViewController(\n c.get(serviceNames.config),\n c.get(serviceNames.productRepository)\n )\n )\n )\n .register(serviceNames.ratingsReviewsApiSdk, (c) => {\n const config = {\n httpTransport: c.get(serviceNames.httpTransport),\n configStore: c.get(serviceNames.configStore)\n };\n const reviewSnippetServiceName = serviceNames.ratingsReviewsApiSdk;\n const reviewSnippetServiceVersion = getServiceVersion(reviewSnippetServiceName);\n\n return new RatingsAndReviewsApiSdk(\n config,\n reviewSnippetServiceName,\n reviewSnippetServiceVersion\n );\n })\n .register(serviceNames.httpTransport, (c) => {\n return root.HttpTransport;\n })\n .register(\n serviceNames.productRepository,\n (c) => new ProductRepository(c.get(serviceNames.config))\n )\n .register(serviceNames.ratingsRepository, (c) => new RatingsRepository())\n .register(\n serviceNames.reviewDetailsViewController,\n (c) => new ReviewDetailsViewController(c.get(serviceNames.configStore))\n );\n\nconst { lazyInject } = getDecorators(diContainer);\n\nexport { lazyInject };\n","/** @license React v16.13.0\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'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?\nSymbol.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;\nfunction 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;\nexports.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};\nexports.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};\nexports.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;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/** @license React v16.13.0\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'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?\nSymbol.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;\nfunction 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;\nexports.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};\nexports.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};\nexports.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;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n"],"sourceRoot":""}