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,C,C,C,E,E,E,O,C,U,W,O,C,G,I,E,E,S,E,E,SChJA,EAPwB,AAAC,GACd,AAAA,CAAA,EAAA,EAAA,QAAO,AAAP,EACH,CAAC,eAAgB,EAAO,CACxB,IAAM,AAAA,CAAA,EAAA,EAAA,SAAQ,AAAR,EAAU,iBAAiB,CAAC,GAAQ,IAAI,CAAC,AAAC,GAAa,G,G,E,Q,S,C,C,C,E,E,E,O,C,U,W,O,C,G,I,E,E,SCcrE,EAlBsB,AAAC,IACrB,GAAM,CAAC,EAAS,EAAW,CAAG,AAAA,CAAA,EAAA,EAAA,QAAO,AAAP,IAc9B,MAZA,AAAA,CAAA,EAAA,EAAA,SAAQ,AAAR,EAAU,KACR,IAAM,EAAQ,OAAO,UAAU,CAAC,EAC5B,CAAA,EAAM,OAAO,GAAK,GACpB,EAAW,EAAM,OAAO,EAG1B,IAAM,EAAW,IAAM,EAAW,EAAM,OAAO,EAG/C,OADA,EAAM,gBAAgB,CAAC,SAAU,GAC1B,IAAM,EAAM,mBAAmB,CAAC,SAAU,EACnD,EAAG,CAAC,EAAO,EAAQ,EAEZ,CACT,C,E","sources":["","js/React/components/Press/SingleTTNewsPage.tsx","js/React/components/CustomHooks/useSingleTTNews.tsx","js/React/components/CustomHooks/useMediaQuery.tsx"],"sourcesContent":["(function () {\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true, configurable: true});\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n var parcelRequire = $parcel$global[\"parcelRequire7bbe\"];\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"cByPq\", function(module, exports) {\n\n$parcel$defineInteropFlag(module.exports);\n\n$parcel$export(module.exports, \"default\", function () { return $07b3700553c46e4d$export$2e2bcd8739ae039; });\n\nvar $a9eYm = parcelRequire(\"a9eYm\");\n\nvar $dTCkE = parcelRequire(\"dTCkE\");\n\nvar $iFLGW = parcelRequire(\"iFLGW\");\n\nvar $N2wHE = parcelRequire(\"N2wHE\");\nparcelRequire(\"lLUSR\");\n\nvar $lj8Ba = parcelRequire(\"lj8Ba\");\n\nvar $1HGFx = parcelRequire(\"1HGFx\");\n\nvar $67EyS = parcelRequire(\"67EyS\");\nconst $07b3700553c46e4d$var$SingleTTNewsPage = ({ singleNewsId: singleNewsId, backLink: backLink, backText: backText })=>{\n const { data: newsItem, isLoading: isLoading } = (0, $iFLGW.default)(singleNewsId);\n const [cropImg, setCropImg] = (0, $dTCkE.useState)(\"\");\n const [cropImgMobile, setCropImgMobile] = (0, $dTCkE.useState)(\"\");\n const [bgBlurImg, setbgBlurImg] = (0, $dTCkE.useState)(\"\");\n const isBigScreen = (0, $67EyS.default)(\"(min-width: 560px)\");\n const [isLoadingImg, setIsLoadingImg] = (0, $dTCkE.useState)(true);\n (0, $dTCkE.useEffect)(()=>{\n async function cropImage() {\n if (newsItem?.mainImage?.url) {\n setCropImg(await (0, $1HGFx.AssetService).assetGetResizedImage(newsItem?.mainImage?.url, 780, 540, (0, $1HGFx.Fit).INSIDE, 80));\n setCropImgMobile(await (0, $1HGFx.AssetService).assetGetResizedImage(newsItem?.mainImage?.url, 680, 480, (0, $1HGFx.Fit).INSIDE, 80));\n setbgBlurImg(await (0, $1HGFx.AssetService).assetGetResizedImage(newsItem?.mainImage?.url, 100, 100, (0, $1HGFx.Fit).INSIDE, 60));\n setIsLoadingImg(false);\n }\n }\n cropImage();\n }, [\n newsItem?.mainImage?.url\n ]);\n (0, (/*@__PURE__*/$parcel$interopDefault($N2wHE))).locale(\"sv\");\n return /*#__PURE__*/ (0, $a9eYm.jsxs)((0, $a9eYm.Fragment), {\n children: [\n !isLoading && !isLoadingImg && /*#__PURE__*/ (0, $a9eYm.jsxs)((0, $a9eYm.Fragment), {\n children: [\n cropImg && /*#__PURE__*/ (0, $a9eYm.jsxs)(\"section\", {\n className: \"relative mx-auto mdplus:mt-6 max-w-2xl overflow-hidden hero-section\",\n children: [\n /*#__PURE__*/ (0, $a9eYm.jsxs)(\"picture\", {\n children: [\n isBigScreen === false && /*#__PURE__*/ (0, $a9eYm.jsx)(\"img\", {\n src: cropImgMobile,\n alt: newsItem?.mainImage?.caption ? newsItem?.mainImage?.caption : newsItem?.mainImage?.title,\n className: \"block w-full max-h-sm object-contain\"\n }),\n isBigScreen && /*#__PURE__*/ (0, $a9eYm.jsx)(\"img\", {\n src: cropImg,\n alt: newsItem?.mainImage?.caption ? newsItem?.mainImage?.caption : newsItem?.mainImage?.title,\n className: \"block mx-auto min-h-68 max-h-md object-contain\"\n })\n ]\n }),\n /*#__PURE__*/ (0, $a9eYm.jsx)(\"div\", {\n className: \"-z-10 absolute inset-0 bg-blue1100 bg-contain bg-no-repeat bg-center blur-[15px] scale-[2.5]\",\n style: {\n backgroundImage: `url(${bgBlurImg}`\n }\n })\n ]\n }),\n /*#__PURE__*/ (0, $a9eYm.jsx)(\"div\", {\n className: \"mx-auto px-3 xl:px-0 pt-4 lg:pt-6 pb-2 lg:pb-0 max-w-2xl\",\n children: /*#__PURE__*/ (0, $a9eYm.jsxs)(\"a\", {\n href: backLink,\n className: \"inline-flex items-center mb-2 hover:underline\",\n children: [\n /*#__PURE__*/ (0, $a9eYm.jsx)(\"img\", {\n width: 20,\n height: 10,\n className: \"mr-3 w-5 rotate-180 transform\",\n src: \"/Images/Icons/Arrows/arrow-right-black500.svg\",\n alt: \"Ikon pil tillbaka\"\n }),\n backText\n ]\n })\n }),\n /*#__PURE__*/ (0, $a9eYm.jsx)(\"section\", {\n className: \"lg:my-4 contentSection umbraco-section pressSection pressSingleSection\",\n children: /*#__PURE__*/ (0, $a9eYm.jsxs)(\"div\", {\n className: \"mx-auto px-3 xl:px-0 max-w-2xl pressContainer\",\n children: [\n newsItem?.title && /*#__PURE__*/ (0, $a9eYm.jsx)(\"h1\", {\n className: \"text-blue500 lg:text-4xl\",\n children: newsItem?.title\n }),\n newsItem?.published && /*#__PURE__*/ (0, $a9eYm.jsx)(\"p\", {\n className: \"mb-1 text-grey300 date\",\n children: (0, (/*@__PURE__*/$parcel$interopDefault($N2wHE)))(newsItem?.published).format(\"YYYY-MM-DD\")\n }),\n newsItem?.leadTextOrBodyStrip && /*#__PURE__*/ (0, $a9eYm.jsx)(\"p\", {\n className: \"my-3 md:my-5 leading-6 preamble\",\n children: newsItem?.leadTextOrBodyStrip\n }),\n newsItem?.body && /*#__PURE__*/ (0, $a9eYm.jsx)(\"div\", {\n className: \"font-ic leading-6 press-text\",\n dangerouslySetInnerHTML: {\n __html: newsItem?.body\n }\n }),\n newsItem?.documents && newsItem?.documents.length > 0 && /*#__PURE__*/ (0, $a9eYm.jsxs)((0, $a9eYm.Fragment), {\n children: [\n /*#__PURE__*/ (0, $a9eYm.jsx)(\"h4\", {\n className: \"font-icb\",\n children: \"Dokument\"\n }),\n /*#__PURE__*/ (0, $a9eYm.jsx)(\"p\", {\n className: \"text\",\n children: newsItem?.documents?.map((document)=>{\n return /*#__PURE__*/ (0, $a9eYm.jsx)(\"a\", {\n href: document?.url,\n children: document?.caption\n });\n })\n })\n ]\n })\n ]\n })\n })\n ]\n }),\n (isLoading || isLoadingImg) && /*#__PURE__*/ (0, $a9eYm.jsx)(\"div\", {\n className: \"flex justify-center items-center py-16\",\n children: /*#__PURE__*/ (0, $a9eYm.jsx)((0, $lj8Ba.default), {})\n })\n ]\n });\n};\nvar $07b3700553c46e4d$export$2e2bcd8739ae039 = $07b3700553c46e4d$var$SingleTTNewsPage;\n\n});\nparcelRegister(\"iFLGW\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", function () { return $9ceee12e71ebb403$export$2e2bcd8739ae039; });\n\nvar $4cyLg = parcelRequire(\"4cyLg\");\n\nvar $1HGFx = parcelRequire(\"1HGFx\");\nconst $9ceee12e71ebb403$var$useSingleTTNews = (newsId)=>{\n return (0, $4cyLg.useQuery)([\n \"singleTTNews\",\n newsId\n ], ()=>(0, $1HGFx.TtService).ttGetSingleTtNews(newsId).then((response)=>response));\n};\nvar $9ceee12e71ebb403$export$2e2bcd8739ae039 = $9ceee12e71ebb403$var$useSingleTTNews;\n\n});\n\nparcelRegister(\"67EyS\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", function () { return $23722fec40a37891$export$2e2bcd8739ae039; });\n\nvar $dTCkE = parcelRequire(\"dTCkE\");\nconst $23722fec40a37891$var$useMediaQuery = (query)=>{\n const [matches, setMatches] = (0, $dTCkE.useState)();\n (0, $dTCkE.useEffect)(()=>{\n const media = window.matchMedia(query);\n if (media.matches !== matches) setMatches(media.matches);\n const listener = ()=>setMatches(media.matches);\n media.addEventListener(\"change\", listener);\n return ()=>media.removeEventListener(\"change\", listener);\n }, [\n query,\n matches\n ]);\n return matches;\n};\nvar $23722fec40a37891$export$2e2bcd8739ae039 = $23722fec40a37891$var$useMediaQuery;\n\n});\n\n\n})();\n//# sourceMappingURL=SingleTTNewsPage.228bb49f.js.map\n","import { FC, useState, useEffect } from 'react';\nimport useSingleTTNews from '../CustomHooks/useSingleTTNews';\nimport moment from 'moment';\nimport 'moment/locale/sv';\n\nimport Loader from '../GeneralComponents/Loader';\nimport { AssetService, Fit } from '~js/React/services/generatedApi';\nimport useMediaQuery from '../CustomHooks/useMediaQuery';\n\ntype Props = {\n singleNewsId: string;\n backLink: string;\n backText: string;\n};\n\nconst SingleTTNewsPage: FC = ({ singleNewsId, backLink, backText }) => {\n const { data: newsItem, isLoading } = useSingleTTNews(singleNewsId);\n const [cropImg, setCropImg] = useState('');\n const [cropImgMobile, setCropImgMobile] = useState('');\n const [bgBlurImg, setbgBlurImg] = useState('');\n const isBigScreen = useMediaQuery('(min-width: 560px)');\n const [isLoadingImg, setIsLoadingImg] = useState(true);\n\n useEffect(() => {\n async function cropImage() {\n if (newsItem?.mainImage?.url) {\n setCropImg(\n await AssetService.assetGetResizedImage(\n newsItem?.mainImage?.url,\n 780,\n 540,\n Fit.INSIDE,\n 80\n )\n );\n setCropImgMobile(\n await AssetService.assetGetResizedImage(\n newsItem?.mainImage?.url,\n 680,\n 480,\n Fit.INSIDE,\n 80\n )\n );\n setbgBlurImg(\n await AssetService.assetGetResizedImage(\n newsItem?.mainImage?.url,\n 100,\n 100,\n Fit.INSIDE,\n 60\n )\n );\n setIsLoadingImg(false);\n }\n }\n cropImage();\n }, [newsItem?.mainImage?.url]);\n\n moment.locale('sv');\n\n return (\n <>\n {!isLoading && !isLoadingImg && (\n <>\n {cropImg && (\n
\n \n {isBigScreen === false && (\n \n )}\n {isBigScreen && (\n \n )}\n \n \n
\n )}\n
\n \n \n {backText}\n \n
\n
\n
\n {newsItem?.title && (\n

{newsItem?.title}

\n )}\n {newsItem?.published && (\n

\n {moment(newsItem?.published).format('YYYY-MM-DD')}\n

\n )}\n {newsItem?.leadTextOrBodyStrip && (\n

\n {newsItem?.leadTextOrBodyStrip}\n

\n )}\n {newsItem?.body && (\n
\n )}\n {newsItem?.documents && newsItem?.documents.length > 0 && (\n <>\n

Dokument

\n

\n {newsItem?.documents?.map((document) => {\n return {document?.caption};\n })}\n

\n \n )}\n \n
\n \n )}\n {(isLoading || isLoadingImg) && (\n
\n \n
\n )}\n \n );\n};\n\nexport default SingleTTNewsPage;\n","import { useQuery } from '@tanstack/react-query';\nimport { TtService } from '../../services/generatedApi';\n\nconst useSingleTTNews = (newsId: string) => {\n return useQuery(\n [\"singleTTNews\", newsId],\n () => TtService.ttGetSingleTtNews(newsId).then((response) => response)\n );\n}\n\nexport default useSingleTTNews","import { useState, useEffect } from 'react';\n\nconst useMediaQuery = (query: string) => {\n const [matches, setMatches] = useState();\n\n useEffect(() => {\n const media = window.matchMedia(query);\n if (media.matches !== matches) {\n setMatches(media.matches);\n }\n\n const listener = () => setMatches(media.matches);\n\n media.addEventListener('change', listener);\n return () => media.removeEventListener('change', listener);\n }, [query, matches]);\n\n return matches;\n};\n\nexport default useMediaQuery;\n"],"names":["$parcel$interopDefault","a","__esModule","default","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","parcelRequire","$parcel$global","globalThis","self","window","global","parcelRegister","register","module","exports","value","$07b3700553c46e4d$export$2e2bcd8739ae039","$a9eYm","$dTCkE","$iFLGW","$N2wHE","$lj8Ba","$1HGFx","$67EyS","singleNewsId","backLink","backText","data","newsItem","isLoading","cropImg","setCropImg","useState","cropImgMobile","setCropImgMobile","bgBlurImg","setbgBlurImg","isBigScreen","isLoadingImg","setIsLoadingImg","useEffect","cropImage","mainImage","url","AssetService","assetGetResizedImage","Fit","INSIDE","locale","jsxs","Fragment","children","className","jsx","src","alt","caption","title","style","backgroundImage","href","width","height","published","format","leadTextOrBodyStrip","body","dangerouslySetInnerHTML","__html","documents","length","map","document","$9ceee12e71ebb403$export$2e2bcd8739ae039","$4cyLg","newsId","useQuery","TtService","ttGetSingleTtNews","then","response","$23722fec40a37891$export$2e2bcd8739ae039","query","matches","setMatches","media","matchMedia","listener","addEventListener","removeEventListener"],"version":3,"file":"SingleTTNewsPage.228bb49f.js.map"}