(ReviewItemsProvider)(ReviewsComponent);\n","export const REVIEW_COUNT = 20;\n","import * as React from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Grid } from '@notino/react-styleguide';\nimport { getImageAttributes } from '@notino/react-web-utils';\n\nimport { ContentWrapper } from '@components';\nimport { Divider } from '@components/Divider';\nimport ErrorBoundary from '@components/ErrorBoundary';\nimport productDetailMessages from '@containers/ProductDetailContainer/messages';\nimport { Breadcrumb } from '@containers/ProductDetailContainer/ProductDetail/Breadcrumb';\nimport { HeadMeta } from '@containers/ProductDetailContainer/ProductDetail/HeadMeta';\nimport { getProductFullName } from '@containers/ProductDetailContainer/ProductDetail/ProductTabContent/utils';\nimport {\n IProductViewProviderProps,\n ProductViewProvider,\n useProductView,\n} from '@context/product-view';\nimport useFeatureSwitches from '@hooks/useFeatureSwitches';\n\nimport { Header } from './Header';\nimport { Reviews } from './Reviews';\n\nconst ReviewsPage = () => {\n const { newPdDesignEnabled, product, variant, data } = useProductView();\n const { reviewsOnServerIds } = useFeatureSwitches();\n const { formatMessage } = useIntl();\n\n const productFullName = getProductFullName(product);\n\n const annotation =\n variant.attributes && variant.attributes.Master\n ? product.annotation\n : variant.variantName;\n\n const imageAttrs = getImageAttributes(\n variant.imagesByCategory.mainImage,\n data.Settings.imageDomainPath,\n 'detailMain'\n );\n\n const breadcrumbs = [\n ...product.breadcrumb,\n {\n name: formatMessage(productDetailMessages.reviewHeader, { name: '' }),\n link: null,\n },\n ];\n\n const simpleDescription = product.description.split(/(.*?)<\\/p>/g)?.[1];\n\n return (\n <>\n \n \n \n\n \n \n \n \n\n \n\n \n\n \n \n \n \n >\n );\n};\n\nconst WrappedReviewsPage: React.FC = ({\n productId,\n ssrEnabled,\n}) => {\n return (\n \n \n \n );\n};\n\nexport default WrappedReviewsPage;\n","export const subtractArrays = (arr1: T[], arr2: T[]) =>\n arr1.filter((item) => !arr2.includes(item));\n\n/**\n * Partitions an array by a given key\n * @param arr\n * @param partitionBy\n * @param groups\n *\n * @example\n * const arr = [\n * { id: 1, name: 'a' },\n * { id: 2, name: 'b' },\n * { id: 3, name: 'c' },\n * { id: 4, name: 'a' },\n * ];\n * partition(arr, 'name', ['a', 'b']);\n * // [\n * // [ { id: 1, name: 'a' }, { id: 4, name: 'a' } ],\n * // [ { id: 2, name: 'b' } ],\n * // ]\n */\nexport function partition(\n arr: T[],\n partitionBy: Key,\n groups: Array\n): Array {\n const retArray: Array = [];\n\n for (const group of groups) {\n const groupArray: T[] = [];\n for (const item of arr) {\n if (item[partitionBy] === group) {\n groupArray.push(item);\n }\n }\n retArray.push(groupArray);\n }\n\n return retArray;\n}\n","\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"getReviewSummary\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"masterId\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"String\"}}},\"directives\":[]}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"productDetailByMasterId\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"masterId\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"masterId\"}}}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"reviewSummary\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"averageRating\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalVotes\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"votes\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"ratings\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"score\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"ratingType\"},\"arguments\":[],\"directives\":[]}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"reviewOverview\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"textReviewsCount\"},\"arguments\":[],\"directives\":[]}]}}]}}]}}],\"loc\":{\"start\":0,\"end\":300}};\n doc.loc.source = {\"body\":\"query getReviewSummary($masterId: String!) {\\n productDetailByMasterId(masterId: $masterId) {\\n id\\n reviewSummary {\\n averageRating\\n totalVotes\\n votes\\n ratings {\\n id\\n score\\n ratingType\\n }\\n }\\n reviewOverview {\\n textReviewsCount\\n }\\n }\\n}\\n\",\"name\":\"GraphQL request\",\"locationOffset\":{\"line\":1,\"column\":1}};\n \n\n var names = {};\n function unique(defs) {\n return defs.filter(\n function(def) {\n if (def.kind !== 'FragmentDefinition') return true;\n var name = def.name.value\n if (names[name]) {\n return false;\n } else {\n names[name] = true;\n return true;\n }\n }\n )\n }\n \n\n // Collect any fragment/type references from a node, adding them to the refs Set\n function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }\n\n var definitionRefs = {};\n (function extractReferences() {\n doc.definitions.forEach(function(def) {\n if (def.name) {\n var refs = new Set();\n collectFragmentReferences(def, refs);\n definitionRefs[def.name.value] = refs;\n }\n });\n })();\n\n function findOperation(doc, name) {\n for (var i = 0; i < doc.definitions.length; i++) {\n var element = doc.definitions[i];\n if (element.name && element.name.value == name) {\n return element;\n }\n }\n }\n\n function oneQuery(doc, operationName) {\n // Copy the DocumentNode, but clear out the definitions\n var newDoc = {\n kind: doc.kind,\n definitions: [findOperation(doc, operationName)]\n };\n if (doc.hasOwnProperty(\"loc\")) {\n newDoc.loc = doc.loc;\n }\n\n // Now, for the operation we're running, find any fragments referenced by\n // it or the fragments it references\n var opRefs = definitionRefs[operationName] || new Set();\n var allRefs = new Set();\n var newRefs = new Set();\n\n // IE 11 doesn't support \"new Set(iterable)\", so we add the members of opRefs to newRefs one by one\n opRefs.forEach(function(refName) {\n newRefs.add(refName);\n });\n\n while (newRefs.size > 0) {\n var prevRefs = newRefs;\n newRefs = new Set();\n\n prevRefs.forEach(function(refName) {\n if (!allRefs.has(refName)) {\n allRefs.add(refName);\n var childRefs = definitionRefs[refName] || new Set();\n childRefs.forEach(function(childRef) {\n newRefs.add(childRef);\n });\n }\n });\n }\n\n allRefs.forEach(function(refName) {\n var op = findOperation(doc, refName);\n if (op) {\n newDoc.definitions.push(op);\n }\n });\n\n return newDoc;\n }\n \n module.exports = doc;\n \n module.exports[\"getReviewSummary\"] = oneQuery(doc, \"getReviewSummary\");\n \n\ndoc.documentId = \"b2e73361c03d879fdd2ec3def02ce79cc6123f300c13b4aafdc106fc851e6d56\"","\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"getReviews\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"page\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}},\"directives\":[]},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"pageSize\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}},\"directives\":[]},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"orderDesc\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Boolean\"}}},\"directives\":[]},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"ReviewOrderBy\"}}},\"directives\":[]},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"code\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"String\"}}},\"directives\":[]},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"hideTranslated\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Boolean\"}},\"directives\":[]}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"reviews\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"page\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"page\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"pageSize\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"pageSize\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderDesc\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"orderDesc\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"orderBy\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"code\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"code\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"hideTranslated\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"hideTranslated\"}}}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"text\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"userName\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"score\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"createdDate\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"like\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"dislike\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alreadyLiked\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"alreadyDisliked\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"translatedFrom\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"authorType\"},\"arguments\":[],\"directives\":[]}]}}]}}],\"loc\":{\"start\":0,\"end\":458}};\n doc.loc.source = {\"body\":\"query getReviews(\\n $page: Int!\\n $pageSize: Int!\\n $orderDesc: Boolean!\\n $orderBy: ReviewOrderBy!\\n $code: String!\\n $hideTranslated: Boolean\\n) {\\n reviews(\\n page: $page\\n pageSize: $pageSize\\n orderDesc: $orderDesc\\n orderBy: $orderBy\\n code: $code\\n hideTranslated: $hideTranslated\\n ) {\\n id\\n text\\n userName\\n score\\n createdDate\\n like\\n dislike\\n alreadyLiked\\n alreadyDisliked\\n translatedFrom\\n authorType\\n }\\n}\\n\",\"name\":\"GraphQL request\",\"locationOffset\":{\"line\":1,\"column\":1}};\n \n\n var names = {};\n function unique(defs) {\n return defs.filter(\n function(def) {\n if (def.kind !== 'FragmentDefinition') return true;\n var name = def.name.value\n if (names[name]) {\n return false;\n } else {\n names[name] = true;\n return true;\n }\n }\n )\n }\n \n\n // Collect any fragment/type references from a node, adding them to the refs Set\n function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }\n\n var definitionRefs = {};\n (function extractReferences() {\n doc.definitions.forEach(function(def) {\n if (def.name) {\n var refs = new Set();\n collectFragmentReferences(def, refs);\n definitionRefs[def.name.value] = refs;\n }\n });\n })();\n\n function findOperation(doc, name) {\n for (var i = 0; i < doc.definitions.length; i++) {\n var element = doc.definitions[i];\n if (element.name && element.name.value == name) {\n return element;\n }\n }\n }\n\n function oneQuery(doc, operationName) {\n // Copy the DocumentNode, but clear out the definitions\n var newDoc = {\n kind: doc.kind,\n definitions: [findOperation(doc, operationName)]\n };\n if (doc.hasOwnProperty(\"loc\")) {\n newDoc.loc = doc.loc;\n }\n\n // Now, for the operation we're running, find any fragments referenced by\n // it or the fragments it references\n var opRefs = definitionRefs[operationName] || new Set();\n var allRefs = new Set();\n var newRefs = new Set();\n\n // IE 11 doesn't support \"new Set(iterable)\", so we add the members of opRefs to newRefs one by one\n opRefs.forEach(function(refName) {\n newRefs.add(refName);\n });\n\n while (newRefs.size > 0) {\n var prevRefs = newRefs;\n newRefs = new Set();\n\n prevRefs.forEach(function(refName) {\n if (!allRefs.has(refName)) {\n allRefs.add(refName);\n var childRefs = definitionRefs[refName] || new Set();\n childRefs.forEach(function(childRef) {\n newRefs.add(childRef);\n });\n }\n });\n }\n\n allRefs.forEach(function(refName) {\n var op = findOperation(doc, refName);\n if (op) {\n newDoc.definitions.push(op);\n }\n });\n\n return newDoc;\n }\n \n module.exports = doc;\n \n module.exports[\"getReviews\"] = oneQuery(doc, \"getReviews\");\n \n\ndoc.documentId = \"6b418f74d475acb33651d32700b11edf31f6773fe42d9451389d5e875cc126dc\""],"names":["o","viewBox","fill","d","messages","defineMessages","deliveryPiece","id","deliveryPrice","brands0Categories0","brands1Categories0","brands2Categories0","brands3Categories0","brandsNCategories0","brands0Categories1","brands0Categories2","brands0Categories3","brands0CategoriesN","brands1Categories1","brands1Categories2","brands2Categories1","brands2Categories2","brandsNCategoriesN","selectedProducts","tooltipInfo","Link","styled","ConditionsRow","ConditionsTooltip","children","targets","content","map","target","idx","key","url","href","name","length","Tooltip","interactive","wrapText","alignDesktop","transformToMessageValues","reduce","acc","type","toLowerCase","Condition","formatMessage","useIntl","brands","categories","partition","formattedMessage","these","parts","messageId","brandsCount","others","slice","categoriesCount","Text","typography","block","marginTop","Wrapper","leftPadding","LabelRow","PriceWrapper","isSpaced","isPrefix","css","WrapperComponent","LineSeparator","Line","conditionalFreeDelivery","value","color","Colors","width","height","price","PriceLabel","currencyComponent","wrapperComponent","breakpointToCenter","breakpoints","position","TooltipModel","FormattedMessage","InfoCircleIcon","dashedLine","MainImgWrapper","ImageWrapper","MainImgComponent","MainImage","imageAttrs","loading","reviewsPageBuy","TopSection","DescriptionWrapper","H1","Heading","Annotation","Description","BuyLink","fullWidth","WhiteBlock","isInView","Header","annotation","brandInfoName","redirectUrl","simpleDescription","newPdDesignEnabled","ref","inView","useInView","initialInView","productDetailMessages","values","ReviewsWrapper","ReviewCount","TitleCSS","TitleWrapper","Reviews","withProviders","ReviewItemsProvider","masterId","productCode","isAllReviewsPage","renderReviewsOnServer","state","orderBy","orderDesc","page","hideTranslated","useReviewItemsContext","data","reviewsSummaryData","reviewsSummaryLoading","error","reviewsSummaryError","refetch","reviewsSummaryRefetch","useQuery","getReviewSummaryQuery","variables","ssr","notifyOnNetworkStatusChange","reviewsRefetch","fetchMore","getReviewsQuery","code","pageSize","partialRefetch","reviewOverview","productDetailByMasterId","reviewSummary","textReviewsCount","reviewsLength","reviews","reviewCount","LoadingWrapper","isLoading","isError","skeleton","ReviewSummarySkeleton","ActionButton","onClick","buttonSize","ButtonModel","ReviewsSummary","ReviewsSkeleton","reviewsLoading","reviewsError","ReviewsPage","product","variant","useProductView","reviewsOnServerIds","useFeatureSwitches","productFullName","getProductFullName","attributes","Master","variantName","getImageAttributes","imagesByCategory","mainImage","Settings","imageDomainPath","breadcrumbs","breadcrumb","link","description","split","ErrorBoundary","HeadMeta","Grid","fluid","Breadcrumb","items","Divider","includes","productId","ssrEnabled","subtractArrays","arr1","arr2","filter","item","arr","partitionBy","groups","retArray","group","groupArray","push","doc","collectFragmentReferences","node","refs","kind","add","selectionSet","selections","forEach","selection","variableDefinitions","def","definitions","loc","source","definitionRefs","findOperation","i","element","Set","module","exports","operationName","newDoc","hasOwnProperty","opRefs","allRefs","newRefs","refName","size","prevRefs","has","childRef","op","oneQuery","documentId"],"sourceRoot":""}