{"version":3,"sources":["webpack:///./src/modules/Richtext/index.ts","webpack:///./src/utils/gtag.ts","webpack:///./src/utils/dom.ts","webpack:///./src/modules/Richtext/Richtext.tsx"],"names":["ONLY_SERVER","global","trackEvent","_ref","event","eventData","eventLabel","window","gtmEvent","concat","site_section","dataLayer","push","truncateString","string","length","substring","Error","Richtext","source","cta","dividerHeadline","id","hideDivider","React","createElement","Rte","className","cx","styles","richtext","DividerComp","displayName"],"mappings":"2FAAA,0GAMO,IAAMA,GAAc,G,kCCN3BC,YAWO,SAASC,EAAUC,GAA8C,IAA3CC,EAAKD,EAALC,MAAOC,EAASF,EAATE,UAAWC,EAAUH,EAAVG,WAC7C,GAAsB,oBAAXC,OAAX,CACA,IACMC,EAAW,CACfJ,MAFgBA,EAAQ,GAAHK,OAAMF,OAAOG,cAAgB,SAAQ,KAAAD,OAAIL,GAAU,GAGxE,aAAcC,GAAa,GAC3B,cAAeC,GAAc,IAG3BL,EAAOU,WAAaH,EAASJ,OAC/BH,EAAOU,UAAUC,KAAKJ,IArB1BP,oCAAOU,UAAYV,EAAOU,WAAa,K,mDC2KhC,SAASE,EAAeC,EAAQC,GACrC,GAAID,EAAOC,OAASA,EAAQ,CAC1B,GAAsB,iBAAXD,GAAyC,iBAAXC,EACvC,OAAOD,EAAOE,UAAU,EAAGD,GAAU,IAErC,MAAM,IAAIE,MAAM,sDAEb,OAAOH,EAlLhB,mC,iCCAA,2EAeMI,EAAW,SAAHf,GAAiE,IAA3DgB,EAAMhB,EAANgB,OAAQC,EAAGjB,EAAHiB,IAAKC,EAAelB,EAAfkB,gBAAiBC,EAAEnB,EAAFmB,GAAIC,EAAWpB,EAAXoB,YACpD,OAAKJ,GAAWE,EAEdG,IAAAC,cAAA,OAAKH,GAAIA,GAAM,IACbE,IAAAC,cAACC,IAAG,CACFC,UAAWC,IAAGC,IAAOC,UACrBX,OAAQA,EACRE,gBAAiBA,EACjBD,IAAKA,KAELG,GAAeC,IAAAC,cAACM,IAAW,OATO,MAc1Cb,EAASc,YAAc,WACRd","file":"static/scripts/54-2e45d68b86fd0055a1f3.js","sourcesContent":["export { default } from './Richtext'\n\n/**\n * Should the component only render server side?\n * You can set this to true if the component is a pure static component.\n */\nexport const ONLY_SERVER = false","global.dataLayer = global.dataLayer || []\nexport type GtagEvent = {\n event?: string\n eventData?: string\n eventLabel?: string\n}\n\n/**\n * Track an event\n * Supply a callback, that gets triggered after the event is tracked\n */\nexport function trackEvent({ event, eventData, eventLabel }: GtagEvent) {\n if (typeof window === 'undefined') return\n const eventName = event ? `${window.site_section || 'pensam'}-${event}` : ''\n const gtmEvent = {\n event: eventName,\n 'event-data': eventData || '',\n 'event-label': eventLabel || '',\n }\n\n if (global.dataLayer && gtmEvent.event) {\n global.dataLayer.push(gtmEvent)\n } //\n // if (\n // process.env.NODE_ENV === 'development' &&\n // global.dataLayer &&\n // gtmEvent.event\n // ) {\n // console.log('dataLayer', global.dataLayer)\n // }\n}\n","export function scrollOffset(element, offset = 0, alignment = 'top') {\n const body = document.body\n const html = document.documentElement\n const elemRect = element.getBoundingClientRect()\n const clientHeight = html.clientHeight\n const documentHeight = Math.max(\n body.scrollHeight,\n body.offsetHeight,\n html.clientHeight,\n html.scrollHeight,\n html.offsetHeight,\n )\n let scrollPosition\n\n if (alignment === 'bottom') {\n scrollPosition = elemRect.bottom - clientHeight\n } else if (alignment === 'middle') {\n scrollPosition = elemRect.bottom - clientHeight / 2 - elemRect.height / 2\n } else {\n // top and default\n scrollPosition = elemRect.top\n }\n\n const maxScrollPosition = documentHeight - clientHeight\n return Math.min(scrollPosition + offset + window.pageYOffset, maxScrollPosition)\n}\n\n/**\n * Return true if child is contained in parent\n * @param parent {HTMLElement}\n * @param child {HTMLElement}\n * @returns {boolean}\n */\nexport function isDescendant(parent, child) {\n if (!child || !child.parentNode) return false\n let node = child.parentNode\n\n while (node != null) {\n if (node === parent) {\n return true\n }\n\n node = node.parentNode\n }\n\n return false\n}\nlet matchesFn\n\n/**\n * Find the closest element that matches the selector\n * @param el {HTMLElement}\n * @param selector {string}\n * @returns {HTMLElement}\n */\nexport function closest(el, selector) {\n if (!matchesFn) {\n // find vendor prefix\n ;[\n 'matches',\n 'webkitMatchesSelector',\n 'mozMatchesSelector',\n 'msMatchesSelector',\n 'oMatchesSelector',\n ].some((fn) => {\n if (typeof document.body[fn] === 'function') {\n matchesFn = fn\n return true\n }\n\n return false\n })\n }\n\n // traverse parents\n let parent\n let element = el\n\n while (element !== null) {\n parent = element.parentElement\n\n if (parent !== null && parent[matchesFn](selector)) {\n return parent\n }\n\n element = parent\n }\n\n return null\n}\n\n/**\n * Get the previous sibling DOM node to an element\n * @param node {HTMLElement}\n * @returns {HTMLElement}\n */\nexport function previousSibling(node) {\n if (!node) return null\n let element = node\n\n do {\n element = element.previousSibling\n if (!isIgnorable(element)) return element\n } while (element)\n\n return null\n}\n\n/**\n * Get the next sibling DOM node to an element\n * @param node {HTMLElement}\n * @returns {HTMLElement}\n */\nexport function nextSibling(node) {\n if (!node) return null\n let element = node\n\n do {\n element = element.nextSibling\n if (element && !isIgnorable(element)) return element\n } while (element)\n\n return null\n}\n\n/**\n * Ignore commment and text nodes.\n * @param node\n * @returns {*}\n */\nfunction isIgnorable(node) {\n if (!node) return null\n return node.nodeType === 8 || (node.nodeType === 3 && isAllWs(node))\n}\n\n/**\n * Ignore all whitespace nodes\n * @param node\n * @returns {*}\n */\nfunction isAllWs(node) {\n if (!node) return null\n // Use ECMA-262 Edition 3 String and RegExp features\n return !/[^\\t\\n\\r ]/.test(node.textContent)\n}\n\nexport function getNodePath(node) {\n if (!node) return null\n let currentNode = node\n let path\n\n while (currentNode.parentNode) {\n const tag = currentNode.tagName.toLowerCase()\n const classes = currentNode.getAttribute('class')\n const className = classes ? `.${classes.trim().split(' ').join('.')}` : ''\n\n if (path) {\n path = `${tag}${className} > ${path}`\n } else {\n path = `${tag}${className}`\n }\n\n // Move up in the tree\n currentNode = currentNode.parentNode\n }\n\n return path\n}\nexport function insertAfter(newNode, referenceNode) {\n referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n}\nexport function truncateString(string, length) {\n if (string.length > length) {\n if (typeof string === 'string' && typeof length === 'number') {\n return string.substring(0, length) + '\\u2026'\n } else {\n throw new Error('Function truncateString take args @string, @number')\n }\n } else return string\n}\nexport default {\n closest,\n isDescendant,\n previousSibling,\n nextSibling,\n scrollOffset,\n getNodePath,\n insertAfter,\n truncateString,\n}","import React from 'react'\nimport Rte from '../../components/Rte/Rte'\nimport type { CtaViewModel } from '../../view-models/CtaViewModel'\nimport styles from './richtext-styles.css'\nimport cx from 'classnames'\nimport DividerComp from '../../components/DividerComp/DividerComp'\ntype Props = {\n source?: string\n cta?: CtaViewModel\n dividerHeadline?: string\n hideDivider?: boolean\n id?: string\n /*will be sent by backend for the Anchor Points*/\n}\n\nconst Richtext = ({ source, cta, dividerHeadline, id, hideDivider }: Props) => {\n if (!source && !dividerHeadline) return null\n return (\n
\n \n {!hideDivider && }\n
\n )\n}\n\nRichtext.displayName = 'Richtext'\nexport default Richtext"],"sourceRoot":""}