{"version":3,"sources":["webpack:///./src/stories/Components/Cards/DownloadCard/DownloadCard.styles.ts","webpack:///./src/stories/Components/Cards/DownloadCard/DownloadCard.tsx","webpack:///./src/img/icons/ys+.svg","webpack:///./src/img/icons/ys.svg","webpack:///./src/helpers/date.ts","webpack:///./src/core/ecommerce/services/EcommerceService.ts"],"names":["Container","styled","section","brand","primary","alt","white","Tag","div","fonts","DaxPro","Regular","until","Device","TabletLarge","Inner","TopRow","DateBox","grey","grey96","Medium","Date","time","IconBox","Icon","span","ContentRow","Title","h4","Description","p","DownloadCardStyles","BaseRow","ButtonStyles","Button","Downloads","ItemType","DownloadCard","props","iconPath","useSpecificIconPath","icon","handleDownload","baseUrl","window","location","origin","substring","length","type","undefined","ApiService","request","method","slug","url","EcommerceService","GetDownloadPdfUrl","orderNumber","documentNumber","response","open","React","S","tag","date","translations","dateTime","formatDateISO","formatDateLong","iconPosition","YS","YSPlus","renderItemType","renderIcon","title","renderTopRightIcon","description","dangerouslySetInnerHTML","__html","downloads","branding","onClick","renderBottomRightIcon","as","src","_path","_path2","_path3","_path4","_extends","Object","assign","target","i","arguments","source","key","prototype","hasOwnProperty","call","apply","this","SvgYs","viewBox","xmlns","d","fill","fillRule","_g","formatStringDate","dateString","formatDate","value","toISOString","Intl","DateTimeFormat","day","month","year","format","useShortMonthName","formatDateShort","params","UrlResolver","getDomain","controller","safeRequest","result"],"mappings":"uMAKMA,EAAYC,IAAOC,QAAV,oFAAGD,CAAH,yMAIWE,IAAMC,QAAQC,IAGlBF,IAAMG,OAQtBC,EAAMN,IAAOO,IAAV,8EAAGP,CAAH,2OACLQ,IAAMC,OAAOC,QACKR,IAAMC,QAAQC,IACzBF,IAAMG,MASNM,YAAMC,IAAOC,cAOlBC,EAAQd,IAAOO,IAAV,gFAAGP,CAAH,qDAKLe,EAASf,IAAOO,IAAV,iFAAGP,CAAH,2FAMNgB,EAAUhB,IAAOO,IAAV,kFAAGP,CAAH,2HACSE,IAAMe,KAAKC,OAM3BV,IA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MACRC,KAAM,iBALd,YACUM,EADV,iDAQeA,EAASoE,QARxB,gCAUW,MAVX,2C,8EAYA,SAAoB/D,GAChB,OAAOuD,kBAAOvD,EAAM,mB,gCAGb,QAAIT","file":"default~MySolutions~TabbedSection~TechnicalLibrary-595ada65bf426225f32c.js","sourcesContent":["import brand from '@helpers/brand';\r\nimport { fonts } from '@helpers/fonts';\r\nimport { Device, until } from '@helpers/media';\r\nimport { ButtonStyles } from '@stories/Components/Buttons/Button/Button.styles';\r\nimport styled from 'styled-components';\r\nconst Container = styled.section `\r\n --tagHeight: 32px;\r\n\r\n position: relative;\r\n border-top: 2px solid ${brand.primary.alt};\r\n padding: 15px;\r\n margin-top: var(--tagHeight);\r\n background-color: ${brand.white};\r\n display: flex;\r\n flex-direction: column;\r\n\r\n &[data-has-tag='false'] {\r\n --tagHeight: 0;\r\n }\r\n`;\r\nconst Tag = styled.div `\r\n ${fonts.DaxPro.Regular};\r\n background-color: ${brand.primary.alt};\r\n color: ${brand.white};\r\n height: var(--tagHeight);\r\n position: absolute;\r\n bottom: 100%;\r\n left: 0;\r\n padding: 6px 15px;\r\n font-size: 16px;\r\n line-height: 18px;\r\n\r\n @media ${until(Device.TabletLarge)} {\r\n bottom: calc(100% + 5px);\r\n font-size: 14px;\r\n line-height: 16px;\r\n --tagHeight: 28px;\r\n }\r\n`;\r\nconst Inner = styled.div `\r\n height: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n`;\r\nconst TopRow = styled.div `\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: flex-start;\r\n margin-bottom: 10px;\r\n`;\r\nconst DateBox = styled.div `\r\n background-color: ${brand.grey.grey96};\r\n font-size: 14px;\r\n line-height: 16px;\r\n padding: 4px 7px;\r\n\r\n span {\r\n ${fonts.DaxPro.Medium};\r\n display: inline-block;\r\n padding-right: 2px;\r\n }\r\n`;\r\nconst Date = styled.time ``;\r\nconst IconBox = styled.div ``;\r\nconst Icon = styled.span `\r\n display: block;\r\n height: 40px;\r\n`;\r\nconst ContentRow = styled.div `\r\n margin-bottom: 24px;\r\n`;\r\nconst Title = styled.h4 `\r\n ${fonts.DaxPro.Medium};\r\n font-size: 18px;\r\n margin-bottom: 5px;\r\n`;\r\nconst Description = styled.p `\r\n ${fonts.DaxPro.Regular};\r\n font-size: 16px;\r\n line-height: 26px;\r\n`;\r\nconst BaseRow = styled.div `\r\n margin-top: auto;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n gap: 16px;\r\n\r\n ${ButtonStyles.Button} {\r\n margin-left: auto;\r\n }\r\n`;\r\nconst Downloads = styled.span `\r\n ${fonts.DaxPro.Medium};\r\n color: ${brand.primary.alt};\r\n font-size: 16px;\r\n line-height: 26px;\r\n\r\n @media ${until(Device.TabletLarge)} {\r\n font-size: 14px;\r\n }\r\n`;\r\nconst ItemType = styled.div `\r\n &[data-item-type='YS'] svg {\r\n height: 24px;\r\n }\r\n\r\n &[data-item-type='YSP'] svg {\r\n height: 30px;\r\n }\r\n`;\r\nconst DownloadCardStyles = {\r\n BaseRow,\r\n Container,\r\n ContentRow,\r\n Date,\r\n DateBox,\r\n Description,\r\n Downloads,\r\n Icon,\r\n IconBox,\r\n Inner,\r\n Tag,\r\n Title,\r\n TopRow,\r\n ItemType,\r\n};\r\nexport default DownloadCardStyles;\r\n","import ApiService from '@core/api/services/ApiService';\r\nimport EcommerceService from '@core/ecommerce/services/EcommerceService';\r\nimport { formatDateISO, formatDateLong } from '@helpers/date';\r\nimport { ReactComponent as YSPlus } from '@img/icons/ys+.svg';\r\nimport { ReactComponent as YS } from '@img/icons/ys.svg';\r\nimport Button from '@stories/Components/Buttons/Button/Button';\r\nimport * as React from 'react';\r\nimport S from './DownloadCard.styles';\r\nconst DownloadCard = (props) => {\r\n const iconPath = props.useSpecificIconPath\r\n ? '/SiteFiles/next-gen/src/img/icons/pdf-file.svg'\r\n : props.icon;\r\n const handleDownload = async () => {\r\n const baseUrl = window?.location?.origin?.substring(0, window?.location?.origin?.length);\r\n if (!props.type || props.type === undefined) {\r\n const response = await ApiService.request({\r\n method: 'GET',\r\n baseUrl: baseUrl,\r\n slug: props.url\r\n ? props.url\r\n : EcommerceService.GetDownloadPdfUrl({ orderNumber: props.documentNumber }),\r\n });\r\n if (!response.url) {\r\n return;\r\n }\r\n window.open(response.url, '_blank');\r\n return;\r\n }\r\n window.open(baseUrl + props.url);\r\n };\r\n const renderTopRightIcon = () => {\r\n switch (props.iconPosition) {\r\n default:\r\n case 'bottom-right': {\r\n if (!iconPath) {\r\n return null;\r\n }\r\n return React.createElement(S.IconBox, null, renderItemType(props.type));\r\n }\r\n case 'top-right': {\r\n if (!iconPath) {\r\n return null;\r\n }\r\n return renderIcon(iconPath ?? '', props.title ?? '');\r\n }\r\n }\r\n };\r\n const renderBottomRightIcon = () => {\r\n switch (props.iconPosition) {\r\n default:\r\n case 'bottom-right': {\r\n return renderIcon(iconPath ?? '', props.title ?? '');\r\n }\r\n case 'top-right': {\r\n return null;\r\n }\r\n }\r\n };\r\n return (React.createElement(S.Container, { \"data-has-tag\": props.tag ? true : false },\r\n props.tag && React.createElement(S.Tag, null, props.tag),\r\n React.createElement(S.Inner, null,\r\n React.createElement(S.TopRow, null,\r\n props.date && (React.createElement(S.DateBox, null,\r\n React.createElement(\"span\", null,\r\n props.translations &&\r\n props.translations['customerportal.download-card.document-publish']\r\n ? props.translations['customerportal.download-card.document-publish']\r\n : 'Published',\r\n \":\"),\r\n React.createElement(S.Date, { dateTime: formatDateISO(props.date) }, formatDateLong(props.date)))),\r\n renderTopRightIcon()),\r\n React.createElement(S.ContentRow, null,\r\n React.createElement(S.Title, null, props.title),\r\n !!props.description && (React.createElement(S.Description, { dangerouslySetInnerHTML: { __html: props.description } }))),\r\n React.createElement(S.BaseRow, null,\r\n !!props.downloads && (React.createElement(S.Downloads, null,\r\n props.downloads,\r\n ' ',\r\n props.translations &&\r\n props.translations['customerportal.download-card.downloads-text']\r\n ? props.translations['customerportal.download-card.downloads-text']\r\n : 'Downloads')),\r\n React.createElement(Button, { branding: \"grey\", title: props.translations && props.translations['customerportal.download-card.download-btn']\r\n ? props.translations['customerportal.download-card.download-btn']\r\n : 'Download', onClick: handleDownload }),\r\n renderBottomRightIcon()))));\r\n};\r\nexport default DownloadCard;\r\nfunction renderIcon(icon, title) {\r\n if (!icon) {\r\n return null;\r\n }\r\n if (typeof icon === 'string') {\r\n return React.createElement(S.Icon, { as: \"img\", \"aria-label\": title, src: icon });\r\n }\r\n return React.createElement(S.Icon, { as: icon, \"aria-label\": title });\r\n}\r\nfunction renderItemType(type) {\r\n switch (type) {\r\n default:\r\n return null;\r\n case 'YS':\r\n return (React.createElement(S.ItemType, { \"data-item-type\": type },\r\n React.createElement(YS, null)));\r\n case 'YSP':\r\n return (React.createElement(S.ItemType, { \"data-item-type\": type },\r\n React.createElement(YSPlus, null)));\r\n }\r\n}\r\n","var _path, _path2, _path3, _path4;\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport * as React from \"react\";\n\nfunction SvgYs(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 361.307 234.267\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M235.225 79.444h126.076V46.627H235.225v32.817\",\n fill: \"#f25b28\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M281.855 126.072h32.817V-.001h-32.817v126.073\",\n fill: \"#f25b28\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M174.1 234.267c-10.656 0-19.385-.82-26.19-2.46-6.802-1.638-12.827-4.179-18.073-7.622l9.098-27.787c3.442 2.295 7.418 4.18 11.926 5.657 4.508 1.474 9.632 2.213 15.37 2.213 6.885 0 12.377-1.804 16.476-5.41 4.097-3.607 6.146-8.525 6.146-14.754 0-5.573-1.721-10.164-5.164-13.77-3.442-3.607-10.368-7.746-20.778-12.418-10.41-4.672-18.238-11.148-23.484-19.425-5.246-8.278-7.868-17.008-7.868-26.19 0-14.753 4.917-27.13 14.753-37.129 9.836-10 22.788-15 38.853-15 9.016 0 16.68.82 22.992 2.459 6.312 1.64 11.844 4.098 16.599 7.377l-8.361 24.344a49.564 49.564 0 00-11.558-5.41c-4.098-1.311-8.688-1.967-13.77-1.967-13.607 0-20.41 6.474-20.41 19.426 0 5.738 1.803 10.41 5.41 14.015 3.606 3.607 11.189 7.992 22.746 13.156 11.558 5.164 19.795 11.763 24.714 19.795 4.917 8.033 7.377 17.294 7.377 27.786 0 15.245-5.288 27.91-15.861 37.99-10.574 10.084-24.222 15.124-40.943 15.124\",\n fill: \"#5a9f23\",\n fillRule: \"evenodd\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M84.59 160.744v71.064H44.756v-71.064L0 62.63h41.803l24.345 63.933 26.066-63.933h37.623\",\n fill: \"#4f4c4c\",\n fillRule: \"evenodd\"\n })));\n}\n\nexport default __webpack_public_path__ + \"3132fc406fc11c36d65c67ad20e1a8a5.svg\";\nexport { SvgYs as ReactComponent };","var _g;\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport * as React from \"react\";\n\nfunction SvgYs(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 299.84 226.067\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, props), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n fillRule: \"evenodd\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M226.073 226.067c-13.837 0-25.173-1.064-34.006-3.194-8.835-2.128-16.658-5.428-23.47-9.897l11.814-36.081c4.47 2.98 9.633 5.428 15.486 7.344 5.855 1.916 12.507 2.873 19.958 2.873 8.941 0 16.072-2.341 21.394-7.024 5.322-4.684 7.983-11.07 7.983-19.159 0-7.237-2.236-13.198-6.705-17.881-4.471-4.683-13.466-10.058-26.983-16.125-13.517-6.067-23.683-14.475-30.495-25.225-6.812-10.75-10.217-22.085-10.217-34.006 0-19.157 6.387-35.23 19.159-48.215C202.763 6.492 219.58 0 240.443 0c11.708 0 21.66 1.064 29.854 3.193 8.196 2.128 15.382 5.322 21.555 9.579l-10.857 31.61a64.353 64.353 0 00-15.008-7.023c-5.322-1.703-11.282-2.555-17.882-2.555-17.668 0-26.502 8.408-26.502 25.225 0 7.451 2.341 13.518 7.025 18.2 4.683 4.683 14.528 10.378 29.536 17.083 15.008 6.705 25.705 15.273 32.09 25.704 6.387 10.43 9.58 22.457 9.58 36.081 0 19.798-6.865 36.242-20.595 49.332-13.731 13.092-31.452 19.638-53.166 19.638\",\n fill: \"#5a9f23\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M109.843 130.595v92.28H58.115v-92.28L0 3.193h54.283l31.612 83.019L119.74 3.193h48.856\",\n fill: \"#4f4c4c\"\n }))));\n}\n\nexport default __webpack_public_path__ + \"7856977f37e10f7742fcd510285f7d5d.svg\";\nexport { SvgYs as ReactComponent };","export function formatStringDate(dateString) {\r\n const date = new Date(dateString);\r\n return formatDate(date);\r\n}\r\nexport function formatDateISO(value) {\r\n let date = value;\r\n if (typeof date === 'string') {\r\n date = new Date(date);\r\n }\r\n return date.toISOString();\r\n}\r\nexport function formatDate(value) {\r\n let date = value;\r\n if (typeof date === 'string') {\r\n date = new Date(date);\r\n }\r\n return new Intl.DateTimeFormat(undefined, {\r\n day: 'numeric',\r\n month: 'short',\r\n year: 'numeric',\r\n }).format(date);\r\n}\r\nexport function formatDateLong(value, useShortMonthName) {\r\n let date = value;\r\n if (typeof date === 'string') {\r\n date = new Date(date);\r\n }\r\n return new Intl.DateTimeFormat(undefined, {\r\n day: 'numeric',\r\n month: useShortMonthName ? 'short' : 'long',\r\n year: 'numeric',\r\n }).format(date);\r\n}\r\nexport function formatDateShort(value) {\r\n let date = value;\r\n if (typeof date === 'string') {\r\n date = new Date(date);\r\n }\r\n return new Intl.DateTimeFormat(undefined, {\r\n day: 'numeric',\r\n month: '2-digit',\r\n year: '2-digit',\r\n }).format(date);\r\n}\r\n","import ApiService from '@core/api/services/ApiService';\r\nimport UrlResolver from '@core/url-resolver/UrlResolver';\r\nimport format from 'date-fns/format';\r\nclass EcommerceService {\r\n async UpdateBasketItem(params) {\r\n const response = await ApiService.request({\r\n baseUrl: UrlResolver.getDomain(),\r\n controller: 'g42',\r\n method: 'PUT',\r\n slug: 'order/basket-item',\r\n params: { ...params },\r\n });\r\n return response;\r\n }\r\n async DeleteBasketItem(params) {\r\n const response = await ApiService.request({\r\n baseUrl: UrlResolver.getDomain(),\r\n controller: 'g42',\r\n method: 'DELETE',\r\n slug: 'order/remove-item',\r\n params: { ...params },\r\n });\r\n return response;\r\n }\r\n async UpdateOrder(params) {\r\n const response = await ApiService.request({\r\n baseUrl: UrlResolver.getDomain(),\r\n controller: 'g42',\r\n method: 'PUT',\r\n slug: 'order/latest',\r\n params: { ...params },\r\n });\r\n return response;\r\n }\r\n async SubmitOrder(params) {\r\n const response = await ApiService.request({\r\n baseUrl: UrlResolver.getDomain(),\r\n controller: 'g42',\r\n method: 'PUT',\r\n slug: 'order/submit-latest',\r\n params: { ...params },\r\n });\r\n return response;\r\n }\r\n GetDownloadPdfUrl(params) {\r\n return `/api/g42/hires/download-order?orderNumber=${params.orderNumber}`;\r\n }\r\n async extendHire(params) {\r\n const response = await ApiService.request({\r\n baseUrl: UrlResolver.getDomain(),\r\n controller: 'g42',\r\n method: 'PATCH',\r\n slug: 'hires/extend',\r\n params: { ...params },\r\n });\r\n return response;\r\n }\r\n async offHire(params) {\r\n const response = await ApiService.request({\r\n baseUrl: UrlResolver.getDomain(),\r\n controller: 'g42',\r\n method: 'PATCH',\r\n slug: 'hires/offhire',\r\n params: { ...params },\r\n });\r\n return response;\r\n }\r\n async fetchLatestOrder() {\r\n const response = await ApiService.safeRequest({\r\n baseUrl: UrlResolver.getDomain(),\r\n controller: 'g42',\r\n method: 'GET',\r\n slug: 'order/latest',\r\n });\r\n if (response) {\r\n return response.result;\r\n }\r\n return null;\r\n }\r\n getApiFormattedDate(date) {\r\n return format(date, 'yyyy-MM-dd');\r\n }\r\n}\r\nexport default new EcommerceService();\r\n"],"sourceRoot":""}