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AA,EAAAA,GACEC,KAAKC,MAAMnC,MAAAA,GAAX,UAAWA,EAAagC,sBAAxB,aAAW,EAA6BI,KACxCnC,M,qOC9CGoC,EAAOC,EAAAA,QAAAA,IAAAA,WAAH,yEAAGA,CAAH,2IAaJC,EAAWD,EAAAA,QAAAA,EAAAA,WAAH,6EAAGA,CAAH,kCAKRE,EAASF,EAAAA,QAAAA,GAAAA,WAAH,2EAAGA,CAAH,sHASNG,EAAaH,EAAAA,QAAAA,IAAAA,WAAH,+EAAGA,CAAH,mFAQVI,EAAYJ,EAAAA,QAAAA,EAAAA,WAAH,8EAAGA,CAAH,2GAUTK,EAAUL,EAAAA,QAAAA,GAAAA,WAAH,4EAAGA,CAAH","sources":["webpack://commercial-ultramar/./src/components/slpCenterRichText/slpCenterRichText.js","webpack://commercial-ultramar/./src/components/slpCenterRichText/slpCenterRichTextStyles.js"],"sourcesContent":["import React from 'react';\nimport { BLOCKS, INLINES } from '@contentful/rich-text-types';\nimport { documentToReactComponents } from '@contentful/rich-text-react-renderer';\nimport * as Styled from './slpCenterRichTextStyles';\nimport useContentfulAssets from '../../hooks/useContentfulAssets';\nimport isExternalUrl, { addTrailingSlash, isExternalUrlHref } from '../../utils';\n\nfunction SlpCenterRichText({ sectionData }) {\n const optionsMainStyle = {\n renderNode: {\n [BLOCKS.PARAGRAPH]: (node, children) => (\n {children}\n ),\n [BLOCKS.HEADING_1]: (node, children) => (\n {children}\n ),\n [INLINES.HYPERLINK]: (node, children) => {\n \n {children}\n ;\n },\n [BLOCKS.EMBEDDED_ASSET]: (node) => {\n const asset = useContentfulAssets(node.data.target.sys.id);\n return asset.node.file.url.includes('image') ? (\n \n ) : (\n <>>\n );\n },\n },\n renderText: (text) =>\n text.split('\\n').flatMap((text, i) => [i > 0 &&
, text]),\n };\n return (\n \n {sectionData?.header?.trim() && (\n {sectionData?.header}\n )}\n {sectionData?.contentDetails &&\n documentToReactComponents(\n JSON.parse(sectionData?.contentDetails?.raw),\n optionsMainStyle\n )}\n \n );\n}\n\nexport default SlpCenterRichText;\n","import styled from 'styled-components';\n\nexport const Body = styled.div`\n padding: 75px;\n text-align: center;\n width: 820px;\n margin: 0 auto;\n @media (max-width: 767px) {\n padding: 35px;\n }\n @media (max-width: 767px) {\n width: 100%;\n }\n`;\n\nexport const ParaText = styled.p`\n margin: 0 0 20px 0;\n padding: 0;\n`;\n\nexport const Header = styled.h1`\n padding: 0;\n margin: 0 0 30px 0;\n font-family: 'MrAlex', arial, sans-serif;\n font-size: 60px;\n line-height: 60px;\n color: #00539f;\n`;\n\nexport const ImageStyle = styled.img`\n display: block;\n width: 100%;\n max-width: 520px;\n height: auto;\n margin: 0 auto 50px auto;\n`;\n\nexport const LinkStyle = styled.a`\n width: 70%;\n margin: 0 auto;\n padding: 30px;\n text-align: center;\n font-size: 14px;\n line-height: 130%;\n color: #9a9a9a;\n`;\n\nexport const Header2 = styled.h2`\n position: relative;\n margin: 0 0 35px 0;\n font-family: 'MrAlex', sans-serif;\n font-size: 45px;\n line-height: 50px;\n color: #00539d;\n @media (max-width: 1399px) {\n font-size: 40px;\n line-height: 45px;\n margin-bottom: 30px;\n }\n @media (max-width: 767px) {\n font-size: 30px;\n line-height: 35px;\n }\n`;\n"],"names":["sectionData","optionsMainStyle","renderNode","BLOCKS","node","children","INLINES","isExternalUrlHref","data","uri","addTrailingSlash","process","isExternalUrl","asset","useContentfulAssets","target","sys","id","file","url","includes","src","alt","title","renderText","text","split","flatMap","i","key","header","trim","contentDetails","documentToReactComponents","JSON","parse","raw","Body","styled","ParaText","Header","ImageStyle","LinkStyle","Header2"],"sourceRoot":""}