\r\n \r\n \r\n }\r\n Dir={props.CurrentPageProps.Dir}\r\n NumOfImages={props.MainContent ? props.MainContent.length : 0}\r\n NonCollapsible={true}\r\n />\r\n );\r\n};\r\n\r\nexport default SlideShowBlock;","import React from 'react';\r\nimport { ImageGalleryImage } from '../platformui/ImageGallery';\r\nimport withLazyLoad from '../platformui/Containers/withLazyLoad';\r\nimport withSrcSets from '../platformui/Containers/withSrcSets';\r\nimport withSensitiveImage from '../platformui/Containers/withSensitiveImage';\r\nimport ImageBlock from '../platformui/ImageBlock';\r\nimport * as Render from '../platformui/Base/Render';\r\nimport Linklist from '../platformui/Linklist';\r\n\r\nconst ImageBlockWithSrcSets = withLazyLoad(\r\n withSrcSets(withSensitiveImage(ImageBlock))\r\n);\r\n\r\nconst SlideshowImageBlock = (props) => (\r\n \r\n }\r\n ImageText={props.Photographer}\r\n ImageGalleryHeading={Render.PropertyAsHTML(\r\n props.ImageHeading,\r\n 'ImageHeading'\r\n )}\r\n ImageGalleryText={Render.PropertyAsHTML(props.ImageText, 'ImageText')}\r\n ImageGalleryLinks={\r\n !props.ImageLinks && !props.CurrentPageProps.IsEditMode\r\n ? null\r\n : Render.Property( , 'ImageLinks')\r\n }\r\n />\r\n);\r\n\r\nexport default SlideshowImageBlock;","import React from 'react';\r\nimport Heading from '../components/heading';\r\nimport * as Render from '../platformui/Base/Render';\r\nimport { isSmallViewport } from '../platformui/Hooks/useMedia';\r\nimport ZoomContainer from '../platformui/ZoomContainer/index';\r\n\r\nconst TableContent = (props) => {\r\n const tableOverflowClass =\r\n props.Heading || props.Description\r\n ? 'table-overflow table-overflow--has-caption'\r\n : 'table-overflow';\r\n const tableHeadingClass =\r\n props.Heading && props.Description\r\n ? 'table__heading table__heading--with-description'\r\n : 'table__heading';\r\n\r\n return (\r\n \r\n {(props.Heading || props.Description) && (\r\n
\r\n {props.Heading && (\r\n \r\n )}\r\n {props.Description && (\r\n \r\n {Render.Property(props.Description, 'Description')}\r\n
\r\n )}\r\n \r\n )}\r\n {props.Table && (\r\n
\r\n {Render.PropertyAsHTML(props.Table, 'Table')}\r\n
\r\n )}\r\n {props.Footnote && (\r\n
\r\n {Render.Property(props.Footnote, 'Footnote')}\r\n
\r\n )}\r\n
\r\n );\r\n};\r\n\r\nconst TableBlock = (props) => {\r\n const dataPrintSidebarTitle = props.Heading + ' (Tabell)' || 'Tabell';\r\n return (\r\n \r\n {props.Table && (isSmallViewport() || !props.HasTableZoom) ? (\r\n
\r\n ) : (\r\n props.Table && (\r\n
\r\n \r\n \r\n )\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default TableBlock;\r\n","import React from 'react';\r\nimport Video from '../platformui/Video';\r\n\r\nexport default (props) => ;","import React from 'react';\r\nimport classNames from 'classnames';\r\n\r\nconst ActionTable = (props) => {\r\n const tableWrapper = classNames({\r\n 'table-wrapper-inner': true,\r\n wide: true,\r\n 'table-wrapper-inner--border-top': props.Heading,\r\n });\r\n\r\n const dataPrintSidebarTitle = props?.StepOne?.Heading\r\n ? `${props?.StepOne?.Heading} (Tabell)`\r\n : 'Tabell';\r\n\r\n return (\r\n \r\n
\r\n
\r\n {props.Heading != null && (\r\n
{props.Heading}
\r\n )}\r\n
\r\n
{props.StepOne.Heading}
\r\n
{props.StepTwo.Heading}
\r\n
\r\n
\r\n
\r\n
\r\n {props.StepOne.Heading}\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n {props.StepTwo.Heading}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {props.StepTwo.Heading}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {props.FootnoteSettings.DefaultFootnote && (\r\n
\r\n )}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default ActionTable;\r\n","import React from 'react';\r\nimport * as Render from '../../platformui/Base/Render';\r\nimport classNames from 'classnames';\r\n\r\nconst Heading = (props) => {\r\n const HeadingContent = Render.Property(\r\n props.Heading,\r\n props.PropertyName ? props.PropertyName : 'HeadingContent'\r\n );\r\n\r\n const headingClasses = classNames({\r\n 'anchor-nav-multi-item': props.isAnchorMultiNav && props.HeadingLevel !== 1,\r\n [props.className]: props.className,\r\n });\r\n\r\n if (props.HeadingLevel > 6)\r\n return {HeadingContent} ;\r\n\r\n switch (props.HeadingLevel) {\r\n case 1:\r\n return {HeadingContent} ;\r\n case 2:\r\n return (\r\n \r\n {HeadingContent}\r\n \r\n );\r\n case 3:\r\n return (\r\n \r\n {HeadingContent}\r\n \r\n );\r\n case 4:\r\n return (\r\n \r\n {HeadingContent}\r\n \r\n );\r\n case 5:\r\n return {HeadingContent} ;\r\n case 6:\r\n return {HeadingContent} ;\r\n default:\r\n return {HeadingContent} ;\r\n }\r\n};\r\n\r\nexport default Heading;","import React from 'react';\r\n\r\nconst Reference = (props) => {\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Reference;\r\n","export const hasSelectedRegion = (currentSelectedRegion, SelectedRegions) => {\r\n if (SelectedRegions && SelectedRegions.length === 0) return true;\r\n\r\n return SelectedRegions.find(\r\n (regionCode) => regionCode === currentSelectedRegion\r\n );\r\n};\r\n\r\nexport const regionHasContent = (currentRegion, RegionContent) => {\r\n return RegionContent.find((block) => {\r\n return block.SelectedRegions.find(\r\n (regionCode) => regionCode === currentRegion\r\n );\r\n });\r\n};\r\n","import React, { useState } from 'react';\r\nimport classNames from 'classnames';\r\nimport { regionHasContent } from './helpers';\r\nimport RegionPicker from './region-picker';\r\nimport RegionsContent from './region-content';\r\n\r\nconst Regionalization = (props) => {\r\n const selectedRegion = props.RegionForm.Regions.Options.find(\r\n (item) => item.Selected === true\r\n );\r\n const region = selectedRegion ? selectedRegion : null;\r\n\r\n const [currentRegion, setCurrentRegion] = useState(region);\r\n const [regionPickerVisible, setRegionPickerVisible] = useState(false);\r\n\r\n const handleScreenReaderChangeRegion = (e) => {\r\n e.preventDefault();\r\n };\r\n\r\n const handleChangeRegion = (e) => {\r\n const selectedRegion = props.RegionForm.Regions.Options.find(\r\n (item) => item.Value === e.currentTarget.value\r\n );\r\n\r\n setCurrentRegion(selectedRegion);\r\n setRegionPickerVisible(false);\r\n };\r\n\r\n const handleToggleRegionPicker = () => {\r\n setRegionPickerVisible(!regionPickerVisible);\r\n };\r\n\r\n const getHeading = () => {\r\n const { RegionForm, RegionContent } = props;\r\n\r\n if (!region) return RegionForm.DefaultLabel;\r\n\r\n if (regionHasContent(currentRegion.Value, RegionContent))\r\n return RegionForm.AdditionLabel;\r\n\r\n return RegionForm.NoAdditionLabel;\r\n };\r\n\r\n const { RegionForm, RegionContent } = props;\r\n\r\n if (!RegionContent) return null;\r\n\r\n const toggleClass = classNames({\r\n 'c-regionalization__toggle': true,\r\n 'c-regionalization__toggle--is-expanded': regionPickerVisible,\r\n });\r\n\r\n return (\r\n \r\n
\r\n
{getHeading()} \r\n handleToggleRegionPicker(e)}\r\n aria-controls={props.UniqueBlockId}\r\n aria-expanded={regionPickerVisible}\r\n >\r\n {currentRegion ? currentRegion.Label : RegionForm.Regions.Label}\r\n \r\n \r\n
handleChangeRegion(e)}\r\n handleScreenReaderChangeRegion={(e) =>\r\n handleScreenReaderChangeRegion(e)\r\n }\r\n regionPickerVisible={regionPickerVisible}\r\n currentSelectedRegion={currentRegion ? currentRegion.Value : null}\r\n />\r\n \r\n \r\n );\r\n};\r\n\r\nexport default Regionalization;\r\n","import React from 'react';\r\nimport * as Render from '../../platformui/Base/Render';\r\nimport classNames from 'classnames';\r\nimport { hasSelectedRegion, regionHasContent } from './helpers';\r\nimport LinkCollectionBlock from '../../blocks/linklist-block';\r\nimport useWindowLocationHref from '../../platformui/Hooks/useWindowLocation';\r\n\r\nconst Blocks = {\r\n LinkCollectionBlock,\r\n};\r\n\r\nconst RegionalizedBlocks = (props) => {\r\n const hrefLocation = useWindowLocationHref();\r\n\r\n const httpRegex = /^http|https/i;\r\n\r\n var trackAttributes = {\r\n 'data-event-category': hrefLocation || 'novalue',\r\n 'data-event-action': 'Regionaliserat',\r\n 'data-event-name': '',\r\n };\r\n\r\n if (props.BlockTypeName === 'LinkCollectionBlock') {\r\n props.Links.forEach((link) => {\r\n if (httpRegex.test(link.Href)) {\r\n const linkAttributes = {\r\n ...trackAttributes,\r\n 'data-event-name': link.Text,\r\n };\r\n\r\n link.TrackAttr = linkAttributes;\r\n }\r\n });\r\n }\r\n\r\n if (!hasSelectedRegion(props.currentSelectedRegion, props.SelectedRegions))\r\n return null;\r\n\r\n return ;\r\n};\r\n\r\nconst Content = (props) => {\r\n return (\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nconst RegionContent = (props) => {\r\n if (!props.RegionContent) return null;\r\n\r\n const currentSelectedRegion = props.currentRegion\r\n ? props.currentRegion.Value\r\n : null;\r\n\r\n const contentClasses = classNames({\r\n 'c-regionalization__contents': true,\r\n 'c-regionalization__contents--hidden':\r\n typeof regionHasContent(currentSelectedRegion, props.RegionContent) ===\r\n 'undefined',\r\n });\r\n\r\n return (\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default RegionContent;\r\n","import React from 'react';\r\nimport classNames from 'classnames';\r\nimport { regionHasContent } from './helpers';\r\n\r\nconst RegionPicker = (props) => {\r\n const regionClasses = classNames({\r\n 'c-regionalization__region-picker': true,\r\n 'c-regionalization__region-picker--is-visible': props.regionPickerVisible,\r\n });\r\n\r\n return (\r\n \r\n
\r\n
\r\n {props.Options &&\r\n props.Options.map((option, key) => (\r\n \r\n ))}\r\n
\r\n\r\n {typeof regionHasContent(\r\n props.currentSelectedRegion,\r\n props.RegionContent\r\n ) === 'undefined' && (\r\n
\r\n Välj en region för att visa tillägg\r\n \r\n )}\r\n\r\n
\r\n Visa tillägg\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nconst Region = (props) => {\r\n if (!props.RegionContent) return null;\r\n\r\n const regionClasses = classNames({\r\n 'c-regionalization__region': true,\r\n 'c-regionalization__region--has-content': regionHasContent(\r\n props.Value,\r\n props.RegionContent\r\n ),\r\n 'c-regionalization__region--is-current': props.Selected,\r\n });\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {props.Name}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default RegionPicker;\r\n","import PropTypes from 'prop-types';\r\nimport React from 'react';\r\nimport useWindowLocationHref from '../../Hooks/useWindowLocation';\r\nconst LinkButton = ({ link, linkText, buttonClass, altLinkText }) => {\r\n const href = useWindowLocationHref();\r\n return link ? (\r\n \r\n ) : null;\r\n};\r\n\r\nLinkButton.propTypes = {\r\n link: PropTypes.string,\r\n linkText: PropTypes.string,\r\n buttonClass: PropTypes.string,\r\n};\r\n\r\nexport default LinkButton;\r\n","import React from 'react';\r\nimport * as Render from '../Base/Render';\r\nimport View from './view';\r\nimport ToggleChapter from '../ToggleChapter';\r\n\r\nconst ChapterContainer = (props) => {\r\n return props.AnchorSectionId && props.Heading && !props.showBlocksInMobileAlways ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n );\r\n};\r\n\r\nexport default ChapterContainer;\r\n","import React from 'react';\r\nimport * as Render from '../Base/Render';\r\nimport classNames from 'classnames';\r\n\r\nconst View = (props) => {\r\n const cssNames = classNames({\r\n 'c-chapter-container': true,\r\n 'c-chapter-container--is-nav': props.isNav && props.AnchorSectionId,\r\n });\r\n\r\n const dataPrintSidebarTitle = props.Heading || '';\r\n\r\n return (\r\n \r\n {props.Heading &&
{props.Heading} }\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default View;\r\n","import classNames from 'classnames';\r\nimport React, { createRef, useEffect } from 'react';\r\nimport ToggleChapter from '../ToggleChapter';\r\nimport View from './view';\r\n\r\nconst Chapter = (props) => {\r\n const content = createRef(null);\r\n function fitInWidth() {\r\n if (content.current === null) {\r\n return null;\r\n }\r\n const elements = content.current.querySelectorAll('.table-wrapper-inner');\r\n for (let i = 0; i < elements.length; i++) {\r\n const wideTable = elements[i].className.indexOf('wide');\r\n\r\n const offsetWidth = elements[i].offsetWidth;\r\n\r\n // If tables width is greater than scrollwidth it should have overflow\r\n if (offsetWidth < elements[i].scrollWidth) {\r\n // If table has class .wide, eg is not -1, set classes for overflow AND for wide\r\n if (wideTable !== -1) {\r\n elements[i].parentNode.className =\r\n 'table-wrapper table-wrapper--is-wide table-wrapper--is-overflow';\r\n } else {\r\n elements[i].parentNode.className =\r\n 'table-wrapper table-wrapper--is-overflow';\r\n }\r\n }\r\n }\r\n }\r\n\r\n function wrapTables() {\r\n if (!props.ContentString || content.current === null) {\r\n return null;\r\n }\r\n\r\n const table = content.current.querySelectorAll('table');\r\n if (table.length === 0) return;\r\n\r\n for (var i = 0; table.length - i; i++) {\r\n const parent = table[i].parentNode;\r\n\r\n if (parent.parentNode.className.indexOf('table-wrapper-inner') > -1)\r\n continue;\r\n\r\n const wrapper = document.createElement('div');\r\n wrapper.className = 'table-wrapper';\r\n\r\n const tableWrapper = document.querySelectorAll('.table-wrapper');\r\n const wrapperInner = document.createElement('div');\r\n const innerTableWrapper = document.createElement('div');\r\n const tableClasses = table[i].className;\r\n wrapperInner.className = `table-wrapper-inner ${tableClasses}`;\r\n tableWrapper.className = `table-wrapper ${tableClasses}`;\r\n\r\n // insert wrapper before el in the DOM tree\r\n parent.insertBefore(wrapperInner, table[i]);\r\n innerTableWrapper.appendChild(table[i]);\r\n wrapperInner.appendChild(innerTableWrapper);\r\n parent.insertBefore(wrapper, wrapperInner);\r\n wrapper.appendChild(wrapperInner);\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (typeof window !== 'undefined') {\r\n window.requestAnimationFrame(() => {\r\n wrapTables();\r\n fitInWidth();\r\n });\r\n }\r\n }, []);\r\n\r\n const hasInlineImage =\r\n props.ImageProperties === 'mini' ||\r\n props.ImageProperties === 'mini-reverse' ||\r\n props.ImageProperties === 'xsmall' ||\r\n props.ImageProperties === 'xsmall-reverse';\r\n\r\n const dataPrintSidebarTitle = props.Heading || '';\r\n\r\n return (\r\n \r\n {!props.noToggle &&\r\n props.Heading &&\r\n props.AnchorSectionId &&\r\n !props.isH3 &&\r\n !props.CurrentPageProps.Content.HideAnchorNavigation &&\r\n !props.HideAnchorLink ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default Chapter;\r\n","const ResponsiveImages = (props) => {\r\n return (\r\n (props.ImageProperties === 'small-bleed' && {\r\n sizes: '(min-width: 640px) 315px, (min-width: 1024px) 403px, 100vw',\r\n }) ||\r\n (props.ImageProperties === 'mini-bleed' && {\r\n sizes: '(min-width: 640px) 315px, (min-width: 1024px) 193px, 100vw',\r\n }) ||\r\n (props.ImageProperties === 'mini' && {\r\n sizes: '(min-width: 640px) 315px, (min-width: 1024px) 193px, 100vw',\r\n }) ||\r\n (props.ImageProperties === 'mini-reverse' && {\r\n sizes: '(min-width: 640px) 315px, (min-width: 1024px) 193px, 100vw',\r\n }) ||\r\n (props.ImageProperties === 'xsmall-bleed' && {\r\n sizes: '(min-width: 640px) 315px, (min-width: 1024px) 300px, 100vw',\r\n }) ||\r\n (props.ImageProperties === 'xsmall' && {\r\n sizes: '(min-width: 640px) 315px, (min-width: 1024px) 300px, 100vw',\r\n }) ||\r\n (props.ImageProperties === 'xsmall-reverse' && {\r\n sizes: '(min-width: 640px) 315px, (min-width: 1024px) 300px, 100vw',\r\n }) ||\r\n (props.ImageProperties && { sizes: '(min-width: 640px) 652px, 100vw' })\r\n );\r\n};\r\n\r\nexport default ResponsiveImages;\r\n","import React, { Fragment } from 'react';\r\nimport classNames from 'classnames';\r\nimport * as Render from '../Base/Render';\r\nimport ImageBlock from '../ImageBlock';\r\nimport withLazyLoad from '../Containers/withLazyLoad';\r\nimport withSrcSets from '../Containers/withSrcSets';\r\nimport withSensitiveImage from '../Containers/withSensitiveImage';\r\nimport SemanticHeader from './semantic-header';\r\nimport ResponsiveImages from './responsive-images';\r\n\r\nconst ImageBlockLazyLoad = withLazyLoad(\r\n withSrcSets(withSensitiveImage(ImageBlock))\r\n);\r\n\r\nconst View = (props) => (\r\n \r\n {props.Heading && (\r\n \r\n {props.Heading}\r\n \r\n )}\r\n {props.RegionAddition?.ContentAbove && (\r\n \r\n \r\n \r\n )}\r\n {props.Preamble && {props.Preamble}
}\r\n {props.Image && (\r\n \r\n \r\n \r\n \r\n
\r\n )}\r\n {props.ContentString}\r\n {props.RegionAddition?.ContentBelow && (\r\n \r\n \r\n \r\n )}\r\n \r\n);\r\n\r\nexport default View;\r\n","import React, { useRef, useState } from 'react';\r\nimport classNames from 'classnames';\r\n\r\nconst DEFAULT_CLASSNAME = 'c-collapsible-text';\r\n\r\nconst CollapsibleText = (props) => {\r\n const collapsibleContentInner = useRef();\r\n const collapsibleContent = useRef();\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n const extendsContent =\r\n collapsibleContentInner.clientHeight > collapsibleContent.clientHeight;\r\n\r\n const handleClick = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n\r\n const componentClass = props.className ? props.className : DEFAULT_CLASSNAME;\r\n const buttonText = isExpanded\r\n ? props.buttonReadLessText\r\n : props.buttonReadMoreText;\r\n const classes = classNames({\r\n [`${componentClass}`]: true,\r\n [`${componentClass}--expanded`]: isExpanded,\r\n [`${componentClass}--extends-content`]: extendsContent,\r\n ...props.Modifiers,\r\n });\r\n if (props.hideCollapsibleText)\r\n return {props.children}
;\r\n\r\n return (\r\n \r\n {props.heading && (\r\n
{props.heading} \r\n )}\r\n
\r\n
{props.children}
\r\n
\r\n\r\n
handleClick()}\r\n type=\"button\"\r\n >\r\n {props.buttonChildren && props.buttonChildren}\r\n\r\n {buttonText} \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default CollapsibleText;\r\n","import { useState } from 'react';\r\n\r\nconst ToggleContainer = (props) => {\r\n const [open, setOpen] = useState(props.open);\r\n const [animation, setAnimation] = useState(props.open);\r\n\r\n const toggleHandler = () => {\r\n setOpen(!open);\r\n\r\n animation\r\n ? setAnimation(!animation)\r\n : setTimeout(() => setAnimation(!animation), 100);\r\n };\r\n\r\n const { children } = props;\r\n\r\n return children({\r\n open: open,\r\n toggle: toggleHandler,\r\n animation: animation,\r\n });\r\n};\r\n\r\nexport default ToggleContainer;\r\n","import React, { useState } from 'react';\r\n\r\nexport default (WrappedComponent) => {\r\n return (props) => {\r\n const [itemId, setItemId] = useState(null);\r\n\r\n const currentActiveMenuItem = (id) => {\r\n setItemId(id);\r\n };\r\n\r\n return (\r\n currentActiveMenuItem(id)}\r\n />\r\n );\r\n };\r\n};\r\n\r\nexport function equalSectionIdsOnPageLoad(id) {\r\n if (typeof window !== 'undefined') {\r\n return window.location.hash === '#' + id;\r\n }\r\n}\r\n","import React, { useEffect } from 'react';\r\n\r\nexport default (WrappedComponent) => {\r\n return (props) => {\r\n let isBlockInBlock = props.CurrentPageProps.CurrentPageProps !== undefined;\r\n\r\n const { currentActiveId, currentActiveMenuItem } = isBlockInBlock\r\n ? props.CurrentPageProps.CurrentPageProps\r\n : props.CurrentPageProps;\r\n\r\n useEffect(() => {\r\n if (\r\n props.CurrentPageProps.PageTypeName !== 'ReferencePage' && //Temp fix. ReferencePage should not render with anchor nav trigger.\r\n props.isInRange\r\n ) {\r\n if (\r\n props.AnchorSectionId &&\r\n currentActiveId !== props.AnchorSectionId\r\n ) {\r\n typeof currentActiveMenuItem === 'function' &&\r\n currentActiveMenuItem(props.AnchorSectionId);\r\n }\r\n }\r\n }, [props.isInRange]);\r\n\r\n return ;\r\n };\r\n};\r\n","import React, { useEffect, useRef } from 'react';\r\n\r\nexport default (WrappedComponent) => {\r\n const TABBABLE_ELEMENTS = 'a[href], button';\r\n const KEYCODE_ESC = 27;\r\n const KEYCODE_TAB = 9;\r\n\r\n const Container = (props) => {\r\n const keepTab = useRef();\r\n\r\n // Handle ESC key\r\n useEffect(() => {\r\n const escKeyListener = (event) => {\r\n if ((event.which || event.keyCode) === KEYCODE_ESC) {\r\n props.closeHandler && props.closeHandler();\r\n }\r\n };\r\n\r\n document.addEventListener('keydown', escKeyListener, false);\r\n\r\n return () => {\r\n document.removeEventListener('keydown', escKeyListener, false);\r\n };\r\n }, [props.closeHandler]);\r\n\r\n // Focus-trapping logic\r\n useEffect(() => {\r\n const keyListener = (event) => {\r\n const { keyCode, shiftKey, target } = event;\r\n\r\n if (keyCode === KEYCODE_TAB) {\r\n const tabbableElements = Array.from(\r\n keepTab.current.querySelectorAll(TABBABLE_ELEMENTS)\r\n );\r\n\r\n if (tabbableElements.length === 0) return;\r\n\r\n const firstTabbableElement = tabbableElements[0];\r\n const lastTabbableElement =\r\n tabbableElements[tabbableElements.length - 1];\r\n\r\n // Move focus to first element that can be tabbed if shift isn't used\r\n if (target === lastTabbableElement && !shiftKey) {\r\n event.preventDefault();\r\n firstTabbableElement.focus();\r\n\r\n // Move focus to last element that can be tabbed if shift is used\r\n } else if (target === firstTabbableElement && shiftKey) {\r\n event.preventDefault();\r\n lastTabbableElement.focus();\r\n }\r\n }\r\n };\r\n\r\n if (keepTab.current) {\r\n keepTab.current.addEventListener('keydown', keyListener, false);\r\n }\r\n\r\n return () => {\r\n if (keepTab.current) {\r\n keepTab.current.removeEventListener('keydown', keyListener, false);\r\n }\r\n };\r\n }, []);\r\n\r\n const { className } = props;\r\n\r\n return (\r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n return Container;\r\n};\r\n","import classNames from 'classnames';\r\nimport { object, string, array } from 'prop-types';\r\nimport React from 'react';\r\nimport LinkButton from '../Buttons/LinkButton';\r\nimport SemanticHeader from '../Chapter/semantic-header';\r\n\r\nconst HighLight = (props) => {\r\n const {\r\n SelectedType,\r\n SelectedIcon,\r\n SelectedBackgroundColor,\r\n Buttons,\r\n Heading,\r\n ContentString,\r\n isMemberOfChapterContainer,\r\n isH3,\r\n } = props;\r\n const classes = classNames({\r\n 'c-highlight': true,\r\n [`c-highlight--${SelectedType}`]: SelectedType,\r\n [`c-highlight--${SelectedIcon}`]: SelectedIcon,\r\n [`c-highlight--${SelectedBackgroundColor}`]: SelectedBackgroundColor,\r\n });\r\n\r\n const dataPrintSidebarTitle =\r\n Heading ||\r\n props.CurrentPageProps?.Content?.Translations?.highlightblock ||\r\n '';\r\n return (\r\n \r\n );\r\n};\r\n\r\nHighLight.propTypes = {\r\n SelectedType: string,\r\n SelectedIcon: string,\r\n SelectedBackgroundColor: string,\r\n Buttons: array,\r\n Heading: string,\r\n ContentString: object,\r\n};\r\n\r\nexport default HighLight;\r\n","import { useEffect, useRef } from 'react';\r\n\r\n/**\r\n * Custom hook for creating Matomo track-events. The event-parameters corresponds to their Matomo equivalents. (e.g., eventCategory = Event Category)\r\n * @param {string} eventCategory - The category of the tracked event.\r\n * @param {string} eventAction - The action associated with the event.\r\n * @param {string} eventName - The name of the event.\r\n * @param {number} eventValue - The value to track (e.g., an index).\r\n * @param {number} debounceTime - Debounce time in milliseconds.\r\n */\r\nconst useMatomoTrackEventOnChange = (\r\n eventCategory,\r\n eventAction,\r\n eventName,\r\n eventValue,\r\n debounceTime = 300\r\n) => {\r\n if (\r\n typeof window === undefined ||\r\n !eventCategory ||\r\n !eventAction ||\r\n !eventName ||\r\n eventValue == null\r\n ) {\r\n return;\r\n }\r\n\r\n const timeoutRef = useRef(null);\r\n const eventValueUnchanged = useRef(true);\r\n\r\n useEffect(() => {\r\n if (eventValueUnchanged.current) {\r\n eventValueUnchanged.current = false;\r\n return;\r\n }\r\n\r\n clearTimeout(timeoutRef.current);\r\n\r\n timeoutRef.current = setTimeout(() => {\r\n window?._paq?.push([\r\n 'trackEvent',\r\n eventCategory,\r\n eventAction,\r\n eventName,\r\n eventValue,\r\n ]);\r\n }, debounceTime);\r\n\r\n return () => {\r\n clearTimeout(timeoutRef.current);\r\n };\r\n }, [eventCategory, eventAction, eventValue]);\r\n};\r\n\r\nexport default useMatomoTrackEventOnChange;\r\n","import classNames from 'classnames';\r\nimport React, { Fragment, useEffect, useState } from 'react';\r\nimport SemanticHeader from '../Chapter/semantic-header';\r\nimport CollapsibleText from '../CollapsibleText';\r\nimport useMatomoTrackEventOnChange from '../Hooks/useMatomoTrackEventOnChange';\r\nimport useWindowLocationHref from '../Hooks/useWindowLocation';\r\n\r\nconst ImageGallery = (props) => {\r\n const href = useWindowLocationHref();\r\n const numOfImages = props.NumOfImages;\r\n\r\n const [currentImage, setCurrentImage] = useState(1);\r\n\r\n useEffect(() => {\r\n if (containsImages(props.Images)) {\r\n trackEvent();\r\n }\r\n }, []);\r\n const trackEvent = () => {};\r\n\r\n const getNextImageNum = () => {\r\n return currentImage + 1 > numOfImages ? 1 : currentImage + 1;\r\n };\r\n\r\n const getPrevImageNum = () => {\r\n return currentImage - 1 < 1 ? numOfImages : currentImage - 1;\r\n };\r\n\r\n const nextImage = () => {\r\n setCurrentImage(getNextImageNum());\r\n trackEvent();\r\n };\r\n\r\n const prevImage = () => {\r\n setCurrentImage(getPrevImageNum());\r\n trackEvent();\r\n };\r\n\r\n const containsImages = (imageBlock) => {\r\n let hasImage = false;\r\n try {\r\n imageBlock.props.blocks.forEach((element) => {\r\n if (element.ImageUrl) {\r\n hasImage = true;\r\n }\r\n });\r\n } catch (error) {\r\n throw new Error('Du måste ha minst en bild i bildspelet');\r\n }\r\n\r\n return hasImage;\r\n };\r\n\r\n useMatomoTrackEventOnChange(\r\n 'Bildspel',\r\n 'Bläddrar',\r\n href || 'novalue',\r\n currentImage\r\n );\r\n\r\n const { Heading, Images, Dir, Translations } = props;\r\n\r\n const hasImages = containsImages(Images);\r\n\r\n const swipeDir = Dir === 'rtl' ? 1 : -1;\r\n\r\n const dataPrintSidebarTitle =\r\n Heading ||\r\n props.CurrentPageProps?.Content?.Translations?.imagegalleryblock ||\r\n '';\r\n\r\n if (!Translations)\r\n throw new Error(`There is no Translation object for ImageGallery`);\r\n return (\r\n \r\n {Heading && (\r\n
\r\n {Heading}\r\n \r\n )}\r\n
\r\n
\r\n
\r\n
\r\n {React.cloneElement(Images, {\r\n currentImage: currentImage,\r\n ParentBlockId: props.UniqueBlockId,\r\n Translations: Translations,\r\n numOfImages: props.NumOfImages,\r\n hasImages,\r\n NonCollapsible: props.NonCollapsible,\r\n IllustratorTop: props.IllustratorTop,\r\n ShowAuthor: props.ShowAuthor ?? true,\r\n })}\r\n
\r\n
\r\n
\r\n nextImage()}\r\n >\r\n {Translations.next} \r\n \r\n prevImage()}\r\n >\r\n {Translations.previous} \r\n \r\n
\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst Illustrator = (props) =>\r\n props.ShowAuthor && (props.Illustrator || props.Photographer) ? (\r\n \r\n {props.Illustrator\r\n ? `${props.Translations.illustrator}: ${props.Illustrator}`\r\n : `${props.CurrentPageProps.Content.Translations.photographer}: ${props.Photographer}`}\r\n
\r\n ) : null;\r\n\r\nconst ImageGalleryImage = (props) => {\r\n const imageClasses = classNames({\r\n 'c-image-gallery__item': true,\r\n 'c-image-gallery__item--current': props.index + 1 === props.currentImage,\r\n 'c-image-gallery__item--no-images': !props.hasImages,\r\n });\r\n\r\n return (\r\n \r\n
\r\n {props.Translations.counter} {props.currentImage}{' '}\r\n \r\n\r\n
\r\n {props.hasImages && props.Image}\r\n
\r\n
\r\n {props.Translations.counter} {' '}\r\n \r\n {props.currentImage}/{props.numOfImages}\r\n \r\n
\r\n
\r\n
\r\n\r\n {props.IllustratorTop &&
}\r\n\r\n {props.ImageGalleryHeading && (\r\n
\r\n {props.ImageGalleryHeading}\r\n \r\n )}\r\n\r\n {(props.ImageGalleryText || props.ImageGalleryLinks) && (\r\n
\r\n {props.NonCollapsible && (\r\n
\r\n \r\n
\r\n )}\r\n {!props.NonCollapsible && (\r\n
\r\n \r\n \r\n )}\r\n
\r\n )}\r\n\r\n {!props.IllustratorTop &&
}\r\n
\r\n );\r\n};\r\n\r\nconst ImageGalleryText = (props) => {\r\n return (\r\n \r\n {props.ImageGalleryText && (\r\n \r\n {props.ImageGalleryText}\r\n
\r\n )}\r\n {props.ImageGalleryLinks && (\r\n \r\n {props.ImageGalleryLinks}\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nexport { ImageGallery, ImageGalleryImage, ImageGalleryText };\r\n","import React from 'react';\r\nimport * as Render from '../Base/Render';\r\nimport classNames from 'classnames';\r\n\r\nconst Container = (props) => {\r\n const { Heading } = props;\r\n\r\n const dataPrintSidebarTitle = Heading || props.CurrentPageProps?.Content?.Translations?.linklistblock || '';\r\n const listcontainer = \"data-list-container\"\r\n return (\r\n \r\n {Heading &&
{Heading} }\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Container;\r\n","import React from 'react';\r\nimport SectionWrapper from './section-wrapper';\r\nimport Container from './container';\r\n\r\nconst ListContainer = (props) => {\r\n switch (props.CurrentPageProps.PageTypeName) {\r\n case 'ArticlePage':\r\n return ;\r\n default:\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n};\r\n\r\nexport default ListContainer;\r\n","import React from 'react';\r\nimport Section from '../Section';\r\n\r\nconst SectionWrapper = (props) => {\r\n return (\r\n \r\n \r\n
{props.children}
\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default SectionWrapper;\r\n","import React, { Fragment } from 'react';\r\nimport { ModalPanel, CloseModalButton } from './index';\r\n\r\nconst FullscreenModalInner = ({\r\n classModifier,\r\n id,\r\n children,\r\n showCloseModalText,\r\n ...props\r\n}) => {\r\n return (\r\n \r\n
\r\n
\r\n \r\n Stäng \r\n \r\n {React.cloneElement(children, { ...props })}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst FullscreenModal = ({\r\n classModifier,\r\n id,\r\n children,\r\n closeModal,\r\n showCloseModalText = false,\r\n hideWithCss = false,\r\n}) => {\r\n return (\r\n \r\n \r\n \r\n {children}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default FullscreenModal;\r\n","import React, { useState, useEffect, createContext } from 'react';\r\nimport withKeepTabFocus from '../Containers/withKeepTabFocus';\r\nimport classNames from 'classnames';\r\n\r\nconst context = createContext({});\r\n\r\nconst { Provider, Consumer } = context;\r\n\r\nconst OpenModalButton = ({\r\n id,\r\n children,\r\n className,\r\n clickCallback,\r\n fullScreen,\r\n tabIndex,\r\n ariaLabel,\r\n}) => {\r\n const clickHandler = (changeModal) => {\r\n changeModal(id);\r\n if (clickCallback !== undefined) clickCallback();\r\n if (fullScreen) document.body.classList.add('no-scroll');\r\n };\r\n\r\n return (\r\n \r\n {({ changeModal, activeModalId }) => (\r\n clickHandler(changeModal)}\r\n >\r\n {children}\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nconst CloseModalButton = ({ children, className, id }) => (\r\n \r\n {({ closeModal }) => (\r\n closeModal(id)}\r\n >\r\n {children}\r\n \r\n )}\r\n \r\n);\r\n\r\nconst ModalPanelInner = withKeepTabFocus(({ children, ...props }) => {\r\n return React.cloneElement(children, { ...props });\r\n});\r\n\r\nconst ModalPanel = ({ whenActive, children, hideWithCss }) => (\r\n \r\n {({ activeModalId }) =>\r\n activeModalId === whenActive || hideWithCss ? (\r\n \r\n {children} \r\n
\r\n ) : null\r\n }\r\n \r\n);\r\n\r\nconst Modal = (props) => {\r\n const [activeModalId, setActiveModalId] = useState('');\r\n const fullScreenModal = props.fullScreen;\r\n\r\n const changeModal = (newModalId) => {\r\n setActiveModalId(activeModalId === newModalId ? '' : newModalId);\r\n };\r\n\r\n const closeModal = (id) => {\r\n setActiveModalId('');\r\n if (\r\n props.noScroll === true &&\r\n document.body.classList.contains('no-scroll')\r\n )\r\n document.body.classList.remove('no-scroll');\r\n if (document.querySelector(`[data-buttonid='open${id}']`))\r\n document.querySelector(`[data-buttonid='open${id}']`).focus();\r\n };\r\n\r\n const escCloseHandler = (e) => {\r\n if (activeModalId !== '') {\r\n if (e.keyCode === 27) {\r\n e.preventDefault();\r\n closeModal();\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n const handleClick = (e) => {\r\n if (activeModalId !== '') {\r\n if (e.target.className === 'category-lists-modal__modal-panel') {\r\n closeModal();\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n useEffect(() => {\r\n document.addEventListener('keydown', (e) => escCloseHandler(e));\r\n document.addEventListener('mousedown', (e) => handleClick(e));\r\n }, [activeModalId]);\r\n\r\n useEffect(() => {\r\n return () => {\r\n document.removeEventListener('keydown', escCloseHandler());\r\n document.removeEventListener('mousedown', handleClick());\r\n };\r\n }, []);\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n );\r\n};\r\n\r\nModal.defaultProps = {\r\n noScroll: true,\r\n};\r\n\r\nexport default Modal;\r\nexport { OpenModalButton, CloseModalButton, ModalPanel, Consumer };\r\n","import React from 'react';\r\nimport T from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport ToggleContainer from '../Containers/toggleContainer';\r\nimport withSearch from '../Containers/withSearch';\r\nimport ItemList from './item-list';\r\n\r\nconst SearchLinkList = (props) => {\r\n const {\r\n Heading,\r\n SearchResult: { TotalHits, SearchHits },\r\n } = props;\r\n\r\n if (!SearchHits || SearchHits.length === 0) return null;\r\n\r\n return (\r\n \r\n {({ open, toggle }) => (\r\n \r\n
\r\n \r\n {`${Heading} (${TotalHits} st)`} \r\n \r\n\r\n
\r\n \r\n
\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nSearchLinkList.propTypes = {\r\n BlockId: T.oneOfType([T.string, T.number]),\r\n Heading: T.string,\r\n isOpen: T.bool,\r\n /** See - component */\r\n SearchHits: T.array,\r\n};\r\n\r\nexport default withSearch(SearchLinkList, 'SearchLinkList');\r\nexport { SearchLinkList };\r\n","import React, { Fragment } from 'react';\r\nimport T from 'prop-types';\r\nimport Item from './item';\r\nimport Pagination from '../Pagination';\r\nimport Spinner from '../Spinner';\r\n\r\nconst propTypes = {\r\n LinkText: T.string,\r\n LinkUrl: T.string,\r\n /** See
- component */\r\n SearchHits: T.array,\r\n};\r\n\r\nfunction focusLastItem() {\r\n document.getElementById('search-link__last-item').focus();\r\n}\r\n\r\nconst ItemList = (props) => {\r\n const {\r\n LinkText,\r\n LinkUrl,\r\n SearchResult: { SearchHits, BatchText, NextPage },\r\n } = props;\r\n\r\n const renderItem = (item, idx) => (\r\n
\r\n );\r\n return (\r\n \r\n {SearchHits.map(renderItem)} \r\n {(NextPage || (LinkUrl && LinkText)) && (\r\n \r\n
\r\n {NextPage && (\r\n
}\r\n >\r\n {BatchText}\r\n \r\n )}\r\n {LinkUrl && LinkText && (\r\n
\r\n {LinkText} \r\n \r\n )}\r\n
\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nItemList.propTypes = propTypes;\r\n\r\nItemList.defaultProps = {};\r\n\r\nexport default ItemList;\r\n","import React from 'react';\r\nimport T from 'prop-types';\r\n\r\nconst propTypes = {\r\n Name: T.string,\r\n URL: T.string,\r\n isLast: T.bool,\r\n};\r\n\r\nconst Item = (item) => {\r\n const { Name, URL } = item;\r\n const lastItem = item.isLast ? (\r\n \r\n ) : null;\r\n\r\n return (\r\n \r\n \r\n {Name} \r\n \r\n {lastItem}\r\n \r\n );\r\n};\r\n\r\nItem.propTypes = propTypes;\r\n\r\nexport default Item;\r\n","import React from 'react';\r\nimport classNames from 'classnames';\r\nconst Icons = (props) => {\r\n return (\r\n \r\n \r\n {props.iconType ? 'rätt svar' : 'fel eller ofullständigt svar'}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default Icons;\r\n","import classNames from 'classnames';\r\nimport React from 'react';\r\nimport * as Render from '../Base/Render';\r\nimport Icons from './icons';\r\nimport SelfTestQuestion from './selftestquestion';\r\n\r\nclass SelfTest extends React.Component {\r\n questions = [];\r\n\r\n state = {\r\n isValid: null,\r\n correctAnsers: null,\r\n };\r\n\r\n addCtrlToValidation(question) {\r\n this.questions.push(question);\r\n }\r\n\r\n validate() {\r\n let isValid = true;\r\n let numOfCorrectAnswers = this.questions.length;\r\n this.questions.forEach((question) => {\r\n if (question.validateQuestion() !== true) {\r\n isValid = false;\r\n numOfCorrectAnswers--;\r\n }\r\n });\r\n\r\n this.setState({\r\n isValid: isValid,\r\n correctAnsers: numOfCorrectAnswers,\r\n });\r\n }\r\n\r\n scrollToTop() {\r\n const heading = document.getElementById('result');\r\n if (heading !== null && typeof heading !== 'undefined') {\r\n heading.scrollIntoView();\r\n heading.focus();\r\n document.querySelector('.c-self-test__button[type=button]').blur();\r\n }\r\n }\r\n componentDidUpdate() {\r\n this.scrollToTop();\r\n }\r\n\r\n reset() {\r\n this.questions.forEach((question) => question.resetQuestion());\r\n\r\n this.setState({\r\n isValid: null,\r\n correctAnsers: null,\r\n });\r\n this.scrollToTop();\r\n let elem = document.querySelector(\r\n '.c-self-test .c-self-test__optionheading'\r\n );\r\n elem.setAttribute('tabindex', 0);\r\n elem.focus();\r\n }\r\n\r\n render() {\r\n const classes = classNames({\r\n 'c-self-test': true,\r\n 'c-self-test--is-valid': this.state.isValid,\r\n 'c-self-test--is-error': this.state.isValid === false,\r\n });\r\n\r\n const { Translations } = this.props.Content;\r\n const correctTestText =\r\n this.state.isValid !== null\r\n ? Translations.correcttestagain\r\n : Translations.correcttest;\r\n\r\n return (\r\n \r\n {this.state.isValid !== null && (\r\n
\r\n
\r\n {Translations.yougot} {this.state.correctAnsers} {Translations.of}{' '}\r\n {this.questions.length} {Translations.correct}\r\n \r\n {this.props.Content.AnswerSpans &&\r\n this.props.Content.AnswerSpans.find(\r\n (answer) => this.state.correctAnsers < answer.Max\r\n ) && (\r\n
\r\n
\r\n {\r\n this.props.Content.AnswerSpans.find(\r\n (answer) => this.state.correctAnsers < answer.Max\r\n ).Text\r\n }\r\n
\r\n
\r\n )}\r\n {this.props.Content.FeedbackText && (\r\n
\r\n )}\r\n
\r\n )}\r\n {this.state.isValid !== null && (\r\n
\r\n
\r\n \r\n \r\n = rätt svar\r\n \r\n
\r\n
\r\n = fel eller ofullständigt svar\r\n
\r\n
\r\n )}\r\n\r\n
\r\n \r\n this.addCtrlToValidation(question)\r\n }\r\n />\r\n \r\n {this.props.Content.Questions && (\r\n
{\r\n this.validate();\r\n }}\r\n >\r\n {correctTestText}\r\n \r\n )}\r\n {this.state.isValid !== null && (\r\n
this.reset()}\r\n >\r\n {Translations.redotest}\r\n \r\n )}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default SelfTest;\r\n","import React from 'react';\r\nimport classNames from 'classnames';\r\nconst lodashUtil = require('lodash/util');\r\n\r\nclass SelfTestOption extends React.Component {\r\n state = {\r\n isValid: false === this.props.IsCorrect,\r\n checked: false,\r\n };\r\n id = lodashUtil.uniqueId('option-');\r\n\r\n\r\n isValid(e) {\r\n this.setState({\r\n isValid: e.currentTarget.checked === this.props.IsCorrect,\r\n checked: e.currentTarget.checked,\r\n });\r\n }\r\n\r\n resetOption() {\r\n this.setState({\r\n isValid: false === this.props.IsCorrect,\r\n checked: false,\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.props.addOptionToValidation(this);\r\n }\r\n \r\n\r\n render() {\r\n const classes = classNames({\r\n 'c-self-test__label': true,\r\n 'c-self-test__label__checked': this.state.checked,\r\n });\r\n const id = this.id;\r\n return (\r\n \r\n this.isValid(e)}\r\n checked={this.state.checked}\r\n type=\"checkbox\"\r\n className=\"c-self-test__checkbox\"\r\n id={id}\r\n />\r\n \r\n {this.props.AnswerText}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default SelfTestOption;\r\n","import classNames from 'classnames';\r\nimport React from 'react';\r\nimport * as Render from '../Base/Render';\r\nimport withSrcSets from '../Containers/withSrcSets';\r\nimport ImageBlock from '../ImageBlock';\r\nimport Icons from './icons';\r\nimport Option from './option';\r\nconst ImageBlockWithSrcSets = withSrcSets(ImageBlock);\r\n\r\nclass SelfTestQuestion extends React.Component {\r\n options = [];\r\n\r\n state = {\r\n isValid: null,\r\n isValidated: false,\r\n };\r\n\r\n addOptionToValidation(option) {\r\n this.options.push(option);\r\n }\r\n\r\n validateQuestion() {\r\n let isValid = true;\r\n this.options.forEach((option) => {\r\n if (option.state.isValid !== true) {\r\n isValid = false;\r\n }\r\n });\r\n\r\n this.setState({\r\n isValid: isValid,\r\n });\r\n\r\n return isValid;\r\n }\r\n\r\n resetQuestion() {\r\n this.options.forEach((option) => option.resetOption());\r\n\r\n this.setState({\r\n isValid: null,\r\n isValidated: false,\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.props.addCtrlToValidation(this);\r\n }\r\n\r\n render() {\r\n if (!this.props.AnswerAlternatives) return null;\r\n\r\n const classes = classNames({\r\n 'c-self-test__question': true,\r\n 'c-self-test__question--is-valid': this.state.isValid,\r\n 'c-self-test__question--is-error': this.state.isValid === false,\r\n });\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n {this.props.QuestionText}\r\n
\r\n {this.state.isValid !== null && (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n\r\n \r\n {this.props.AnswerAlternatives.map((qAlternative, key) => (\r\n \r\n this.addOptionToValidation(option)\r\n }\r\n />\r\n ))}\r\n
\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default SelfTestQuestion;\r\n","import React, { useState, useEffect } from 'react';\r\nimport classNames from 'classnames';\r\nimport { equalSectionIdsOnPageLoad } from '../Containers/withAnchorNav';\r\nimport { isMediumViewport } from '../Hooks/useMedia';\r\n\r\nconst ToggleChapter = (props) => {\r\n const [isOpen, setIsOpen] = useState(\r\n !isMediumViewport()\r\n ? true\r\n : equalSectionIdsOnPageLoad(props.AnchorSectionId)\r\n );\r\n\r\n useEffect(() => {\r\n if (!equalSectionIdsOnPageLoad(props.AnchorSectionId)) return;\r\n const element = document.getElementById(props.AnchorSectionId);\r\n if (!element) return;\r\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\r\n window.scrollTo({ top: elementTop, behavior: 'smooth' });\r\n }, [props.AnchorSectionId]);\r\n\r\n return (\r\n \r\n {isMediumViewport() ? (\r\n setIsOpen(e.target.open)}\r\n id={props.id}\r\n >\r\n \r\n {props.Heading} \r\n \r\n \r\n {props.children}\r\n \r\n ) : (\r\n props.children\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default ToggleChapter;\r\n","import React from 'react';\r\nimport { string, bool, node } from 'prop-types';\r\nimport Modal, { OpenModalButton } from '../Modal';\r\nimport FullscreenModal from '../Modal/fullscreen-modal';\r\n\r\nconst ZoomContainer = (props) => {\r\n return (\r\n \r\n \r\n \r\n {props.OpenZoomButtonText && (\r\n \r\n {props.OpenZoomButtonText}\r\n \r\n )}\r\n \r\n \r\n {props.children}\r\n \r\n \r\n {props.children}\r\n
\r\n );\r\n};\r\n\r\nZoomContainer.propTypes = {\r\n /** Show the open modal button text or not.\r\n * Will still be visible to screenreaders if set to false\r\n */\r\n showOpenModalText: bool,\r\n /** Show the close modal button text or not\r\n * Will still be visible to screenreaders if set to false\r\n */\r\n showCloseModalText: bool,\r\n /** Body of the content */\r\n children: node,\r\n /** If you want the zoomcontent to be fullscreen or not */\r\n fullScreen: bool,\r\n /** The component id, used to identify which component to open */\r\n id: string,\r\n /** Button text for the open modal button */\r\n OpenZoomButtonText: string\r\n}\r\n\r\nexport default ZoomContainer;\r\n"],"names":["withViewport","withAnchorNavTrigger","props","_jsx","Chapter","_objectSpread","ContentString","Render","Heading","ChapterContainer","EpiserverFormsBlock","HighLight","Linklist","Modifiers","ListContainer","Blocks","ReferenceBlock","referenceListItem","blocks","References","propertyName","currentPageProps","children","_jsxs","Fragment","className","ShowNumberedList","SearchLinkList","SelfTest","SlideshowImageBlock","ImageGallery","Images","MainContent","CurrentPageProps","Dir","NumOfImages","length","NonCollapsible","ImageBlockWithSrcSets","withLazyLoad","withSrcSets","withSensitiveImage","ImageBlock","ImageGalleryImage","ReadMoreText","Content","Translations","readmore","ReadLessText","readless","Image","ImageText","Photographer","ImageGalleryHeading","ImageHeading","ImageGalleryText","ImageGalleryLinks","ImageLinks","IsEditMode","Links","TableContent","tableOverflowClass","Description","tableHeadingClass","HeadingLevel","PropertyName","Table","Footnote","_props$CurrentPagePro","_props$CurrentPagePro2","dataPrintSidebarTitle","isMemberOfChapterContainer","isSmallViewport","HasTableZoom","ZoomContainer","id","BlockId","toString","showCloseModalText","showOpenModalText","OpenZoomButtonText","expandtable","Video","_props$StepOne","_props$StepOne2","tableWrapper","classNames","wide","StepOne","concat","StepTwo","dangerouslySetInnerHTML","__html","StepThree","FootnoteSettings","DefaultFootnote","HeadingContent","headingClasses","isAnchorMultiNav","ReferenceItem","hasSelectedRegion","currentSelectedRegion","SelectedRegions","find","regionCode","regionHasContent","currentRegion","RegionContent","block","selectedRegion","RegionForm","Regions","Options","item","Selected","region","setCurrentRegion","useState","regionPickerVisible","setRegionPickerVisible","toggleClass","getHeading","Value","AdditionLabel","NoAdditionLabel","DefaultLabel","onClick","e","UniqueBlockId","Label","RegionPicker","Id","handleChangeRegion","currentTarget","value","handleScreenReaderChangeRegion","preventDefault","RegionsContent","LinkCollectionBlock","RegionalizedBlocks","hrefLocation","useWindowLocationHref","httpRegex","trackAttributes","BlockTypeName","forEach","link","test","Href","linkAttributes","Text","TrackAttr","contentClasses","tabIndex","Region","regionClasses","type","name","onChange","disabled","defaultChecked","Name","map","option","key","_ref","_ref2","linkText","buttonClass","altLinkText","href","role","AnchorSectionId","showBlocksInMobileAlways","ToggleChapter","isChapterContainer","View","isNav","cssNames","undefined","isH3","_props$regionalName","content","createRef","useEffect","window","requestAnimationFrame","current","table","querySelectorAll","i","parent","parentNode","indexOf","wrapper","document","createElement","wrapperInner","innerTableWrapper","tableClasses","insertBefore","appendChild","wrapTables","elements","wideTable","offsetWidth","scrollWidth","fitInWidth","hasInlineImage","ImageProperties","ref","regionalName","noToggle","HideAnchorNavigation","HideAnchorLink","sizes","ImageBlockLazyLoad","_props$RegionAddition","_props$RegionAddition2","SemanticHeader","StoryPageHeading","RegionAddition","ContentAbove","Preamble","isMemberOfChapter","Sizes","ResponsiveImages","ContentBelow","collapsibleContentInner","useRef","collapsibleContent","isExpanded","setIsExpanded","extendsContent","clientHeight","componentClass","buttonText","buttonReadLessText","buttonReadMoreText","classes","hideCollapsibleText","heading","buttonChildren","open","setOpen","animation","setAnimation","toggle","toggleHandler","setTimeout","WrappedComponent","itemId","setItemId","currentActiveId","currentActiveMenuItem","equalSectionIdsOnPageLoad","location","hash","isBlockInBlock","PageTypeName","isInRange","keepTab","escKeyListener","event","which","keyCode","closeHandler","addEventListener","removeEventListener","keyListener","shiftKey","target","tabbableElements","Array","from","firstTabbableElement","lastTabbableElement","focus","_props$CurrentPagePro3","SelectedType","SelectedIcon","SelectedBackgroundColor","Buttons","highlightblock","LinkButton","ButtonLink","ButtonText","ButtonStyling","eventCategory","eventAction","eventName","eventValue","debounceTime","arguments","timeoutRef","eventValueUnchanged","clearTimeout","_window","_window$_paq","_paq","push","_props$ShowAuthor","numOfImages","currentImage","setCurrentImage","containsImages","trackEvent","nextImage","prevImage","imageBlock","hasImage","element","ImageUrl","error","Error","useMatomoTrackEventOnChange","hasImages","swipeDir","imagegalleryblock","style","transform","React","ParentBlockId","IllustratorTop","ShowAuthor","next","previous","Illustrator","illustrator","photographer","imageClasses","index","counter","CollapsibleText","linklistblock","hasSectionWrapper","Container","SectionWrapper","Section","FullscreenModalInner","classModifier","_objectWithoutProperties","_excluded","CloseModalButton","closeModal","hideWithCss","ModalPanel","whenActive","context","createContext","Provider","Consumer","OpenModalButton","clickCallback","fullScreen","ariaLabel","changeModal","activeModalId","body","classList","add","clickHandler","_ref3","_ref4","autoFocus","ModalPanelInner","withKeepTabFocus","_ref5","_ref6","_ref7","Modal","setActiveModalId","fullScreenModal","noScroll","contains","remove","querySelector","escCloseHandler","handleClick","newModalId","defaultProps","withSearch","SearchResult","TotalHits","SearchHits","ToggleContainer","isOpen","ItemList","focusLastItem","getElementById","LinkText","LinkUrl","BatchText","NextPage","renderItem","idx","Item","isLast","URL","Pagination","Spinner","lastItem","iconType","constructor","questions","state","isValid","correctAnsers","addCtrlToValidation","question","this","validate","numOfCorrectAnswers","validateQuestion","setState","scrollToTop","scrollIntoView","blur","componentDidUpdate","reset","resetQuestion","elem","setAttribute","render","correctTestText","correcttestagain","correcttest","yougot","of","correct","AnswerSpans","answer","Max","FeedbackText","Icons","Questions","SelfTestQuestion","redotest","lodashUtil","require","SelfTestOption","IsCorrect","checked","uniqueId","resetOption","componentDidMount","addOptionToValidation","htmlFor","AnswerText","options","isValidated","AnswerAlternatives","QuestionText","UseZoom","qAlternative","Option","setIsOpen","isMediumViewport","elementTop","getBoundingClientRect","top","scrollY","scrollTo","behavior","onToggle","FullscreenModal"],"sourceRoot":""}