{"version":3,"sources":["webpack:///./Avensia.Common/Features/Shared/Sigvaris/CampaignThemeButton/index.tsx","webpack:///./Avensia.Common/Features/Shared/Sigvaris/CampaignThemeButton/util.tsx"],"names":["props","themeColor","themeColorLight","themeColorDark","siteTheme","themeProps","themeType","colors","primary","secondary","primaryDark","ctaStyle","fillInBlock","createElement","css","as","to","target","children","mapCampaignTheme","OutlinedWhite","OutlinedGrey","OutlinedTheme","OutlinedThemeLight","OutlinedThemeDark","OutlinedBlack","White","Grey","Primary","PrimaryLight","PrimaryDark","Black","campaignThemeStyle","themeStyleProp","textColor","borderColor","hoverTextColor","backgroundColor","allSides","allSidesBorderWidth","hoverBackgroundColor","lightBlue","darkBlue","Object","assign","color","border","xy","width","style","bottom","getThemeStyle","setThemeProps"],"mappings":";0FAAA,qDAkBe,IAbqBA,IAChC,MAAM,WAAEC,EAAU,gBAAEC,EAAe,eAAEC,GAAmB,qBAAW,KAC7DC,EAAY,cACZC,EAAa,CACfC,UAAWN,EAAMM,UACjBL,WAAYA,GAA0BG,EAAUG,OAAOC,QACvDN,gBAAiBD,EAAaC,EAAkBE,EAAUG,OAAOE,UACjEN,eAAgBF,EAAaE,EAAiBC,EAAUG,OAAOG,YAC/DC,SAAUX,EAAMW,SAChBC,YAAaZ,EAAMY,aAEvB,OAAQ,IAAMC,cAAc,IAAe,CAAEC,IAAK,YAAmBT,GAAaU,GAAI,YAAiBf,GAAQgB,GAAIhB,EAAMgB,GAAIC,OAAQjB,EAAMiB,QAAUjB,EAAMkB,Y,iCChB/J,uJAMO,MAAMC,EAAoBnB,IAC7B,GAAuB,aAAnBA,EAAMW,SACN,OAAQX,EAAMe,IACV,IAAK,QACD,OAAO,IAAMK,cACjB,IAAK,OACD,OAAO,IAAMC,aACjB,IAAK,QACD,OAAO,IAAMC,cACjB,IAAK,aAEL,IAAK,YACD,OAAO,IAAMC,mBACjB,IAAK,YAEL,IAAK,WACD,OAAO,IAAMC,kBACjB,QACI,OAAO,IAAMC,kBAGpB,C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0BG,EAAUG,OAAOC,QACvDN,gBAAiBD,EAAaC,EAAkBE,EAAUG,OAAOE,UACjEN,eAAgBF,EAAaE,EAAiBC,EAAUG,OAAOG,YAC/DC,SAAUX,EAAMW,SAChBC,YAAaZ,EAAMY","file":"assets/7.chunk.75fc1664c40f4d395baf.js","sourcesContent":["import React, { useContext } from 'react';\r\nimport { DefaultButton } from 'Shared/Button';\r\nimport { CampaignBrandContext } from 'Pages/Campaign/CampaignBrandPageContext';\r\nimport { useCurrentTheme } from 'SiteLayout/Theming';\r\nimport { mapCampaignTheme, campaignThemeStyle } from './util';\r\nexport const CampaignThemeButton = (props) => {\r\n const { themeColor, themeColorLight, themeColorDark } = useContext(CampaignBrandContext);\r\n const siteTheme = useCurrentTheme();\r\n const themeProps = {\r\n themeType: props.themeType,\r\n themeColor: themeColor ? themeColor : siteTheme.colors.primary,\r\n themeColorLight: themeColor ? themeColorLight : siteTheme.colors.secondary,\r\n themeColorDark: themeColor ? themeColorDark : siteTheme.colors.primaryDark,\r\n ctaStyle: props.ctaStyle,\r\n fillInBlock: props.fillInBlock,\r\n };\r\n return (React.createElement(DefaultButton, { css: campaignThemeStyle(themeProps), as: mapCampaignTheme(props), to: props.to, target: props.target }, props.children));\r\n};\r\nexport default CampaignThemeButton;\r\n","import { useContext } from 'react';\r\nimport { Theme } from 'Shared/Button';\r\nimport { black, darkWhite, grey, lightBlack, lightGrey, thicker, thin, white } from 'Shared/Style';\r\nimport { CampaignBrandContext } from 'Pages/Campaign/CampaignBrandPageContext';\r\nimport { selector } from '@glitz/core';\r\nimport { useCurrentTheme } from 'SiteLayout/Theming';\r\nexport const mapCampaignTheme = (props) => {\r\n if (props.ctaStyle === 'outlined') {\r\n switch (props.as) {\r\n case 'white':\r\n return Theme.OutlinedWhite;\r\n case 'grey':\r\n return Theme.OutlinedGrey;\r\n case 'theme':\r\n return Theme.OutlinedTheme;\r\n case 'themeLight':\r\n return Theme.OutlinedThemeLight;\r\n case 'lightBlue':\r\n return Theme.OutlinedThemeLight;\r\n case 'themeDark':\r\n return Theme.OutlinedThemeDark;\r\n case 'darkBlue':\r\n return Theme.OutlinedThemeDark;\r\n default:\r\n return Theme.OutlinedBlack;\r\n }\r\n }\r\n else {\r\n if (props.themeColor && (props.themeType === 'themeDark' || props.themeType === 'darkBlue')) {\r\n return Theme.OutlinedThemeDark;\r\n }\r\n else {\r\n switch (props.as) {\r\n case 'white':\r\n return Theme.White;\r\n case 'grey':\r\n return Theme.Grey;\r\n case 'theme':\r\n return Theme.Primary;\r\n case 'themeLight':\r\n return Theme.PrimaryLight;\r\n case 'lightBlue':\r\n return Theme.PrimaryLight;\r\n case 'themeDark':\r\n return Theme.PrimaryDark;\r\n case 'darkBlue':\r\n return Theme.PrimaryDark;\r\n default:\r\n return Theme.Black;\r\n }\r\n }\r\n }\r\n};\r\nconst getThemeStyle = (props) => {\r\n const { ctaStyle, textColor, backgroundColor, borderColor, hoverTextColor, hoverBackgroundColor, allSides, allSidesBorderWidth = thin, } = props;\r\n if (ctaStyle === 'outlined') {\r\n return Object.assign(Object.assign({ color: textColor, backgroundColor: 'transparent' }, (borderColor && {\r\n border: {\r\n xy: {\r\n color: borderColor,\r\n width: thin,\r\n style: 'solid',\r\n },\r\n },\r\n })), selector(':not([disabled]):hover', {\r\n color: hoverTextColor,\r\n backgroundColor: hoverBackgroundColor,\r\n }));\r\n }\r\n return Object.assign(Object.assign({ color: textColor, backgroundColor: backgroundColor }, (borderColor && {\r\n border: Object.assign({ bottom: {\r\n color: borderColor,\r\n width: thicker,\r\n style: 'solid',\r\n } }, (allSides && {\r\n xy: {\r\n color: borderColor,\r\n width: allSidesBorderWidth,\r\n style: 'solid',\r\n },\r\n })),\r\n })), selector(':not([disabled]):hover', {\r\n color: hoverTextColor,\r\n backgroundColor: hoverBackgroundColor,\r\n }));\r\n};\r\nexport function campaignThemeStyle(props) {\r\n let themeStyleProp = {};\r\n let textColor = null;\r\n let borderColor = null;\r\n let hoverTextColor = null;\r\n let backgroundColor = null;\r\n let allSides = false;\r\n let allSidesBorderWidth = thin;\r\n let hoverBackgroundColor = null;\r\n const { themeColor, themeType, fillInBlock, themeColorDark, themeColorLight, ctaStyle } = props;\r\n // eslint-disable-next-line react-hooks/rules-of-hooks\r\n const siteTheme = useCurrentTheme();\r\n // Outlined button\r\n if (ctaStyle === 'outlined') {\r\n backgroundColor = 'transparent';\r\n if (themeType === 'themeDark') {\r\n textColor = white;\r\n borderColor = white;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColor;\r\n }\r\n else if (themeType === 'darkBlue') {\r\n textColor = siteTheme.colors.lightBlue;\r\n borderColor = white;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColor;\r\n }\r\n else if (themeType === 'themeLight') {\r\n textColor = themeColor;\r\n borderColor = themeColor;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColor;\r\n }\r\n else if (themeType === 'lightBlue') {\r\n textColor = siteTheme.colors.darkBlue;\r\n borderColor = siteTheme.colors.darkBlue;\r\n hoverTextColor = themeColorDark;\r\n hoverBackgroundColor = themeColorLight;\r\n }\r\n else if (themeType === 'theme') {\r\n textColor = white;\r\n backgroundColor = themeColorLight;\r\n borderColor = white;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColorDark;\r\n }\r\n else {\r\n textColor = themeColorDark;\r\n borderColor = themeColorDark;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColorDark;\r\n }\r\n if (fillInBlock) {\r\n if (themeType === 'grey') {\r\n textColor = grey;\r\n borderColor = grey;\r\n hoverTextColor = grey;\r\n hoverBackgroundColor = lightGrey;\r\n }\r\n else if (themeType === 'white') {\r\n textColor = white;\r\n borderColor = white;\r\n hoverTextColor = black;\r\n hoverBackgroundColor = lightGrey;\r\n }\r\n else if (themeType === 'black') {\r\n textColor = black;\r\n borderColor = black;\r\n hoverTextColor = black;\r\n hoverBackgroundColor = lightBlack;\r\n }\r\n else if (themeType === 'themeDark') {\r\n textColor = themeColorDark;\r\n borderColor = themeColorDark;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColorDark;\r\n }\r\n else if (themeType === 'darkBlue') {\r\n textColor = siteTheme.colors.darkBlue;\r\n borderColor = siteTheme.colors.darkBlue;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColor;\r\n }\r\n else if (themeType === 'themeLight') {\r\n textColor = themeColorLight;\r\n borderColor = themeColorLight;\r\n hoverTextColor = themeColor;\r\n hoverBackgroundColor = themeColorLight;\r\n }\r\n else if (themeType === 'lightBlue') {\r\n textColor = siteTheme.colors.lightBlue;\r\n borderColor = siteTheme.colors.lightBlue;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColorDark;\r\n }\r\n else if (themeType === 'theme') {\r\n textColor = themeColor;\r\n borderColor = themeColor;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColor;\r\n }\r\n }\r\n }\r\n // Solid Button\r\n else if (ctaStyle === 'solid') {\r\n if (fillInBlock) {\r\n if (themeType === 'themeDark') {\r\n textColor = white;\r\n backgroundColor = themeColorDark;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColor;\r\n }\r\n else if (themeType === 'themeLight') {\r\n textColor = themeColorDark;\r\n backgroundColor = themeColorLight;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColor;\r\n }\r\n else if (themeType === 'theme') {\r\n textColor = white;\r\n backgroundColor = themeColor;\r\n borderColor = themeColorDark;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColorDark;\r\n }\r\n else if (themeType === 'grey') {\r\n textColor = grey;\r\n backgroundColor = lightGrey;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColor;\r\n }\r\n else if (themeType === 'white') {\r\n allSides = true;\r\n textColor = black;\r\n backgroundColor = white;\r\n borderColor = white;\r\n hoverTextColor = black;\r\n hoverBackgroundColor = darkWhite;\r\n allSidesBorderWidth = thicker;\r\n }\r\n else if (themeType === 'black') {\r\n textColor = white;\r\n backgroundColor = black;\r\n hoverTextColor = black;\r\n hoverBackgroundColor = lightBlack;\r\n }\r\n else if (themeType === 'lightBlue') {\r\n textColor = white;\r\n backgroundColor = siteTheme.colors.lightBlue;\r\n borderColor = themeColorDark;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColorDark;\r\n }\r\n else if (themeType === 'darkBlue') {\r\n textColor = white;\r\n backgroundColor = siteTheme.colors.darkBlue;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColorDark;\r\n }\r\n }\r\n else {\r\n // For editor block and media gallery\r\n if (themeType === 'themeDark') {\r\n allSides = true;\r\n textColor = white;\r\n backgroundColor = 'transparent';\r\n borderColor = white;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColor;\r\n }\r\n else if (themeType === 'theme' || themeType === 'lightBlue') {\r\n textColor = themeColorDark;\r\n backgroundColor = themeColorLight;\r\n borderColor = 'transparent';\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColorDark;\r\n }\r\n else {\r\n textColor = white;\r\n backgroundColor = themeColor;\r\n borderColor = themeColorDark;\r\n hoverTextColor = white;\r\n hoverBackgroundColor = themeColorDark;\r\n }\r\n }\r\n }\r\n themeStyleProp = {\r\n textColor: textColor,\r\n backgroundColor: backgroundColor,\r\n borderColor: borderColor,\r\n hoverTextColor: hoverTextColor,\r\n hoverBackgroundColor: hoverBackgroundColor,\r\n allSides: allSides,\r\n allSidesBorderWidth: allSidesBorderWidth,\r\n ctaStyle: ctaStyle,\r\n };\r\n return getThemeStyle(themeStyleProp);\r\n}\r\nexport function setThemeProps(props) {\r\n // eslint-disable-next-line react-hooks/rules-of-hooks\r\n const { themeColor, themeColorLight, themeColorDark } = useContext(CampaignBrandContext);\r\n // eslint-disable-next-line react-hooks/rules-of-hooks\r\n const siteTheme = useCurrentTheme();\r\n const themeProps = {\r\n themeType: props.themeType,\r\n themeColor: themeColor ? themeColor : siteTheme.colors.primary,\r\n themeColorLight: themeColor ? themeColorLight : siteTheme.colors.secondary,\r\n themeColorDark: themeColor ? themeColorDark : siteTheme.colors.primaryDark,\r\n ctaStyle: props.ctaStyle,\r\n fillInBlock: props.fillInBlock,\r\n };\r\n return themeProps;\r\n}\r\n"],"sourceRoot":""}