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EAAAA,EAAiBd,oBAAY,WAA7Bc,EAA6B,EAAE6C,UAE3CC,QAAQH,EAAAA,EAAAA,KAAG,IACgB,QAAf3C,EAAAA,EAAKc,kBAAU,IAAfd,GAA6B,QAA7BA,EAAAA,EAAiBd,oBAAY,WAA7Bc,EAA6B,EAAE8C,QAE3CC,QAAQJ,EAAAA,EAAAA,KAAG,IACgB,QAAf3C,EAAAA,EAAKc,kBAAU,IAAfd,GAA6B,QAA7BA,EAAAA,EAAiBd,oBAAY,WAA7Bc,EAA6B,EAAE+C,QAE3CC,KAAM7D,EACA,CACEA,QAAAA,EACAC,kBAAAA,GAEF","sources":["webpack://_N_E/./node_modules/lodash/_arrayReduce.js","webpack://_N_E/./node_modules/lodash/_baseReduce.js","webpack://_N_E/./node_modules/lodash/_baseValues.js","webpack://_N_E/./node_modules/lodash/reduce.js","webpack://_N_E/./node_modules/lodash/values.js","webpack://_N_E/./src/components/LandingBlock/Ligal/styled.tsx","webpack://_N_E/./src/components/LandingBlock/Ligal/index.tsx","webpack://_N_E/./src/services/blocks/preparePreview.ts"],"sourcesContent":["/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;\n","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n","var arrayReduce = require('./_arrayReduce'),\n baseEach = require('./_baseEach'),\n baseIteratee = require('./_baseIteratee'),\n baseReduce = require('./_baseReduce'),\n isArray = require('./isArray');\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nmodule.exports = reduce;\n","var baseValues = require('./_baseValues'),\n keys = require('./keys');\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","import styled from 'styled-components';\nimport { FlexBoxCol, FlexBoxRow } from '@r1-frontend/ui-react/components/layouts/flexBoxGrid';\nimport GridContainer from '@r1-frontend/ui-react/components/layouts/gridContainer';\nimport { COLORS } from '@r1-frontend/ui-react/assets/js/constants';\nimport { fonts } from '~/src/helpers/font';\nimport { breakPoints, styleWithBreakPoints, CSSPropWithBreakpoints, blockMargin } from '~/src/components/LandingBlock/styled';\n\nexport interface ILigalBlockStyles {\n [key: string]: CSSPropWithBreakpoints;\n}\n\nexport const Wrapper = styled.div<{ [key: string]: string }>`\n position:relative;\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n color: ${COLORS.black};\n padding-top: 100px;\n background: ${p => p.background ? `url(${p.background}) no-repeat center / cover` : 'transparent'};\n \n @media (max-width: ${breakPoints.desktop}) {\n \n margin-left: 0;\n margin-right: 0;\n }\n \n @media (max-width: ${breakPoints.sDesktop}) {\n overflow: hidden; \n }\n \n @media (max-width: ${breakPoints.mobile}) {\n margin-top: 50px;\n }\n\n ${p => blockMargin(p)}; \n ${p => styleWithBreakPoints(p, 'Ligal')};\n`;\n\nexport const StyledGrid = styled(GridContainer)`\n display: flex;\n max-width: 100%;\n`;\n\nexport const Row = styled(FlexBoxRow)`\n width: 100%;\n`;\n\nexport const LigalItem = styled(FlexBoxCol)<{ styleKey: string }>`\n position:relative;\n margin-bottom: 68px;\n max-width: 100%;\n\n &:first-child {\n padding-left: 70px;\n\n &:before {\n content: '';\n position:absolute;\n left: 0;\n top: -5px;\n width: 50px;\n height: 50px;\n background: url(${p => p.logo}) no-repeat;\n background-size: contain;\n \n @media (max-width: ${breakPoints.sDesktop}) {\n top: 5px;\n }\n \n @media (max-width: 467px) {\n top: 14px;\n }\n }\n }\n\n &:not(:only-child) {\n &:first-child {\n max-width: 41.66666666666667%;\n\n p {\n max-width: 322px;\n white-space: pre-wrap;\n }\n }\n\n &:nth-child(2) {\n max-width: 58.333333333333336%;\n margin-left: auto;\n }\n }\n\n @media (max-width: ${breakPoints.mobile}) {\n margin-bottom: 30px;\n\n &:not(:only-child) {\n &:first-child {\n max-width: 100%;\n }\n &:nth-child(2) {\n max-width: 100%;\n margin-left: auto;\n }\n }\n }\n\n ${p => styleWithBreakPoints(p, p.styleKey)}\n`;\n\nexport const LigalText = styled.div<{ styleKey: string }>`\n font: ${fonts.XS};\n color: rgba(0,0,0,.5);\n \n @media (max-width: ${breakPoints.sDesktop}) {\n padding-top: 10px;\n }\n\n ${p => styleWithBreakPoints(p, p.styleKey)};\n`;\n","import { useMemo } from 'react';\nimport { INormalizedLandingElement } from '~/src/services/projects';\nimport { prepareColumnsToPreview, ILigalItem } from '~/src/services/blocks/preparePreview';\nimport { ICityData } from '~/src/components/LandingBlock/Header/HeaderPanel';\nimport * as ST from './styled';\n\nexport interface ILigalBlockProps {\n blockId: string,\n ligalColumnCount: {\n desktop: string;\n sDesktop: string;\n table: string;\n mobile: string;\n } | string;\n logo?: string;\n columns: INormalizedLandingElement;\n customStyles?: ST.ILigalBlockStyles;\n isAdmin?: boolean;\n currentBreakpoint?: string;\n background?: string;\n cityData: ICityData | Record;\n additionalBlockConfig?: any;\n}\n\nconst Ligal = ({\n blockId,\n columns,\n customStyles,\n isAdmin,\n currentBreakpoint,\n background,\n cityData = {},\n additionalBlockConfig,\n}: ILigalBlockProps): JSX.Element => {\n const { city } = cityData;\n\n const { logo_narrow = '/landing/icons/domru.svg' } = city || {};\n\n const items: ILigalItem[] = useMemo(() => {\n return prepareColumnsToPreview(columns, isAdmin, currentBreakpoint);\n }, [columns, currentBreakpoint, isAdmin]);\n\n return (\n \n \n \n {\n items?.map((item: ILigalItem) => (\n \n \n \n ))\n }\n \n \n \n );\n};\n\nexport default Ligal;\n","import values from 'lodash/values';\nimport reduce from 'lodash/reduce';\nimport { css } from 'styled-components';\nimport { EElementType, INormalizedLandingElement } from '~/src/services/projects';\nimport { CSSPropWithBreakpoints } from '~/src/components/LandingBlock/styled';\nimport { ILandingBlock } from '~/src/components/LandingBlock';\n\nexport interface IGridItem {\n id?: string;\n key: string;\n src: string;\n webp: string;\n alt: string;\n customStyles: {\n Image: CSSPropWithBreakpoints;\n Text: CSSPropWithBreakpoints;\n SubTitle?: CSSPropWithBreakpoints;\n Title?: CSSPropWithBreakpoints;\n };\n backgroundColor?: string;\n padding?: {\n vertical?: number;\n horizontal?: number\n }\n borderRadius?: number;\n sortOrder?: number;\n width?: number;\n}\n\nexport interface ITabItem{\n [key: string]: any;\n}\n\nexport interface ILigalItem {\n key: string;\n customStyles: {\n Text: CSSPropWithBreakpoints;\n };\n sortOrder?: number;\n}\n\nexport const prepareColumnsToPreview = (columns: INormalizedLandingElement, isAdmin = false, currentBreakpoint?: string): IGridItem[] => {\n const result: IGridItem[] = values(reduce(columns, (acc, item) => {\n if (item.title === 'Header') return acc;\n const itemCustomStyles = prepareCustomStyles(item, item.title, isAdmin, currentBreakpoint);\n switch (item.type) {\n case EElementType.Column:\n case EElementType.HeaderColumn:\n case EElementType.ImageGridColumn:\n case EElementType.BlockGridColumn:\n case EElementType.AccordionColumn:\n case EElementType.ImageSection:\n case EElementType.Button:\n acc[item.id] = {\n ...acc[item.id],\n customStyles: {},\n key: item.id,\n sortOrder: item.properties ? +item.properties['sortOrder'] : undefined,\n backgroundColor: item.properties ? item.properties['backgroundColor'] : undefined,\n padding: {\n horizontal: item.properties ? item.properties['paddingHorizontal'] ?? 0 : 0,\n vertical: item.properties ? item.properties['paddingVertical'] ?? 0 : 0,\n },\n borderRadius: item.properties ? +item.properties['borderRadius'] : 0,\n defaultOpen: item.properties ? item.properties['defaultOpen'] : false,\n width: item.properties ? item.properties['width'] : 4,\n };\n break;\n case EElementType.LigalColumn:\n acc[item.id] = {\n ...acc[item.id],\n customStyles: {\n ...acc[item.parentId]?.customStyles,\n ...itemCustomStyles,\n },\n key: item.id,\n sortOrder: item.properties ? +item.properties['sortOrder'] : undefined,\n };\n break;\n case EElementType.Image:\n acc[item.parentId] = {\n ...acc[item.parentId],\n src: item.properties.content,\n webp: item.properties.webp,\n alt: item.properties.alt,\n customStyles: {\n ...acc[item.parentId]?.customStyles,\n ...itemCustomStyles,\n },\n };\n break;\n case EElementType.Text:\n if (acc[item.parentId] !== undefined) {\n acc[item.parentId] = {\n ...acc[item.parentId],\n [item.title?.toLowerCase()]: item.properties.content,\n customStyles: {\n ...acc[item.parentId].customStyles,\n ...itemCustomStyles,\n },\n };\n } else {\n acc[item.id] = {\n ...acc[item.id],\n customStyles: { ...itemCustomStyles },\n key: item.id,\n sortOrder: item.properties ? +item.properties['sortOrder'] : undefined,\n };\n }\n break;\n case EElementType.RTE:\n acc[item.parentId] = {\n ...acc[item.parentId],\n [item.title?.toLowerCase()]: item.properties.htmlContent,\n customStyles: {\n ...acc[item.parentId].customStyles,\n ...itemCustomStyles,\n },\n };\n break;\n }\n return acc;\n }, {}));\n return result.sort((a, b) => a.sortOrder - b.sortOrder);\n};\n\nexport const prepareTabsToPreview = (tabs: INormalizedLandingElement, isAdmin = false, currentBreakpoint?: string): ITabItem[] => {\n // @ts-ignore\n const result: ITabItem[] = reduce(tabs, (acc, item) => {\n if (item.title === 'Header') return acc;\n const itemCustomStyles = prepareCustomStyles(item, item.title, isAdmin, currentBreakpoint);\n switch (item.type) {\n case EElementType.TabColumn:\n acc[item.id] = {\n ...acc[item.id],\n customStyles: {},\n key: item.id,\n type: item.type,\n sortOrder: item.properties ? +item.properties['sortOrder'] : undefined,\n };\n break;\n case EElementType.Image:\n acc[item.parentId] = {\n ...acc[item.parentId],\n src: item.properties.content,\n webp: item.properties.webp,\n alt: item.properties.alt,\n customStyles: {\n ...acc[item.parentId]?.customStyles,\n ...itemCustomStyles,\n },\n };\n break;\n case EElementType.Text:\n acc[item.parentId] = {\n ...acc[item.parentId],\n [item.title?.toLowerCase()]: item.properties.content,\n customStyles: {\n ...acc[item.parentId].customStyles,\n ...itemCustomStyles,\n },\n };\n break;\n case EElementType.RTE:\n acc[item.parentId] = {\n ...acc[item.parentId],\n [item.title?.toLowerCase()]: item.properties.htmlContent,\n customStyles: {\n ...acc[item.parentId].customStyles,\n ...itemCustomStyles,\n },\n };\n break;\n case EElementType.Button:\n acc[item.id] = {\n ...acc[item.id],\n customStyles: {},\n key: item.id,\n sortOrder: item.properties ? +item.properties['sortOrder'] : undefined,\n };\n break;\n }\n return acc;\n }, {});\n return result;\n};\n\nexport interface IPreparedBlock extends ILandingBlock {\n key: string;\n customStyles: any;\n}\n\nexport const prepareImagesToPreview = (columns: INormalizedLandingElement, isAdmin = false, currentBreakpoint?: string): IGridItem[] => {\n const result: IGridItem[] = values(reduce(columns, (acc, item) => {\n const itemCustomStyles = prepareCustomStyles(item, item.title, isAdmin, currentBreakpoint);\n switch (item.type) {\n case EElementType.Column:\n case EElementType.CarouselImage:\n acc[item.id] = {\n ...acc[item.id],\n customStyles: {},\n key: item.id,\n sortOrder: item.properties ? +item.properties['sortOrder'] : undefined,\n };\n break;\n case EElementType.Image:\n acc[item.parentId] = {\n ...acc[item.parentId],\n src: item.properties.content,\n webp: item.properties.webp,\n alt: item.properties.alt,\n customStyles: {\n ...acc[item.parentId].customStyles,\n ...itemCustomStyles,\n },\n };\n break;\n }\n return acc;\n }, {}));\n return result.sort((a, b) => a.sortOrder - b.sortOrder);\n};\n\nexport const prepareBlock = (body: INormalizedLandingElement, isAdmin = false, currentBreakpoint?: string): IPreparedBlock[] => {\n const result: IPreparedBlock[] = [];\n // Связку id блока с индексом в результирующем массиве\n const cachedIndex: Record = {};\n\n // Цикл критичный по производительности, поэтому используем только нативные циклы и заполняем cachedIndex\n // Вся обработка структуры проходит за O(n)\n for (const key in body) {\n const item = body[key];\n const blockIndex = cachedIndex[item.blockId];\n\n const itemCustomStyles = prepareCustomStyles(item, item.renderId, isAdmin, currentBreakpoint);\n\n if (item.type === EElementType.Block) {\n if (!blockIndex) {\n result.push({\n key: item.id,\n block: item,\n items: {},\n customStyles: { ...itemCustomStyles },\n enableWebp: true,\n });\n cachedIndex[item.id] = result.length - 1;\n } else {\n result[blockIndex] = {\n ...result[blockIndex],\n block: item,\n customStyles: { ...result[blockIndex].customStyles, ...itemCustomStyles },\n };\n }\n } else {\n if (!result[blockIndex]) {\n result.push({\n key: item.blockId,\n block: {},\n items: { [item.id]: item },\n customStyles: { ...itemCustomStyles },\n enableWebp: true,\n });\n cachedIndex[item.blockId] = result.length - 1;\n }\n result[blockIndex] = {\n ...result[blockIndex],\n items: { ...result[blockIndex]?.items, [item.id]: item },\n customStyles: { ...result[blockIndex]?.customStyles, ...itemCustomStyles },\n };\n }\n }\n\n // Поскольку количество блоков на странице не большое, можем сделать сортировку стандартным методом\n // и не переусложнять логику цикла, который формирует данные\n return result.sort((a, b) => a.block.properties['sortOrder'] - b.block.properties['sortOrder']);\n};\n\nexport const prepareCustomStyles = (item, key, isAdmin, currentBreakpoint) => {\n return {\n [key]: {\n desktop: css`\n ${item.properties?.customize}\n ${item.properties?.customStyles?.desktop}\n `,\n sDesktop: css`\n ${item.properties?.customStyles?.sDesktop}\n `,\n tablet: css`\n ${item.properties?.customStyles?.tablet}\n `,\n mobile: css`\n ${item.properties?.customStyles?.mobile}\n `,\n meta: isAdmin\n ? {\n isAdmin,\n currentBreakpoint,\n }\n : null,\n },\n };\n};\n"],"names":["module","exports","array","iteratee","accumulator","initAccum","index","length","collection","eachFunc","value","arrayMap","object","props","key","arrayReduce","baseEach","baseIteratee","baseReduce","isArray","func","arguments","baseValues","keys","Wrapper","styled","COLORS","p","background","breakPoints","blockMargin","styleWithBreakPoints","StyledGrid","GridContainer","Row","FlexBoxRow","LigalItem","FlexBoxCol","logo","styleKey","LigalText","fonts","blockId","columns","customStyles","isAdmin","currentBreakpoint","cityData","additionalBlockConfig","city","logo_narrow","items","useMemo","prepareColumnsToPreview","ST","id","modeName","map","item","replace","dangerouslySetInnerHTML","__html","result","values","reduce","acc","title","itemCustomStyles","prepareCustomStyles","type","EElementType","sortOrder","properties","undefined","backgroundColor","padding","horizontal","vertical","borderRadius","defaultOpen","width","parentId","src","content","webp","alt","toLowerCase","htmlContent","sort","a","b","prepareImagesToPreview","prepareBlock","body","cachedIndex","blockIndex","renderId","block","push","enableWebp","desktop","css","customize","sDesktop","tablet","mobile","meta"],"sourceRoot":""}