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AAgB,GAAC,WAAW,IAAI,QAAQ,EAAE,CAAC,OAAe,CAAC,SAAS,CAAC,KAAE,CAAC;YAEnF,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;QACtF,CAAC;QACD,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { IRawStyle, mergeStyles } from '@uifabric/merge-styles';\nimport { DefaultPalette } from '../styles/DefaultPalette';\nimport { getTheme } from '../styles/index';\n\n/**\n * {@docCategory IColorClassNames}\n */\nexport interface IColorClassNames {\n themeDarker: string;\n themeDarkerHover: string;\n themeDarkerBackground: string;\n themeDarkerBackgroundHover: string;\n themeDarkerBorder: string;\n themeDarkerBorderHover: string;\n themeDark: string;\n themeDarkHover: string;\n themeDarkBackground: string;\n themeDarkBackgroundHover: string;\n themeDarkBorder: string;\n themeDarkBorderHover: string;\n themeDarkAlt: string;\n themeDarkAltHover: string;\n themeDarkAltBackground: string;\n themeDarkAltBackgroundHover: string;\n themeDarkAltBorder: string;\n themeDarkAltBorderHover: string;\n themePrimary: string;\n themePrimaryHover: string;\n themePrimaryBackground: string;\n themePrimaryBackgroundHover: string;\n themePrimaryBorder: string;\n themePrimaryBorderHover: string;\n themeSecondary: string;\n themeSecondaryHover: string;\n themeSecondaryBackground: string;\n themeSecondaryBackgroundHover: string;\n themeSecondaryBorder: string;\n themeSecondaryBorderHover: string;\n themeTertiary: string;\n themeTertiaryHover: string;\n themeTertiaryBackground: string;\n themeTertiaryBackgroundHover: string;\n themeTertiaryBorder: string;\n themeTertiaryBorderHover: string;\n themeLight: string;\n themeLightHover: string;\n themeLightBackground: string;\n themeLightBackgroundHover: string;\n themeLightBorder: string;\n themeLightBorderHover: string;\n themeLighter: string;\n themeLighterHover: string;\n themeLighterBackground: string;\n themeLighterBackgroundHover: string;\n themeLighterBorder: string;\n themeLighterBorderHover: string;\n themeLighterAlt: string;\n themeLighterAltHover: string;\n themeLighterAltBackground: string;\n themeLighterAltBackgroundHover: string;\n themeLighterAltBorder: string;\n themeLighterAltBorderHover: string;\n black: string;\n blackHover: string;\n blackBackground: string;\n blackBackgroundHover: string;\n blackBorder: string;\n blackBorderHover: string;\n blackTranslucent40: string;\n blackTranslucent40Hover: string;\n blackTranslucent40Background: string;\n blackTranslucent40BackgroundHover: string;\n blackTranslucent40Border: string;\n blackTranslucent40BorderHover: string;\n neutralDark: string;\n neutralDarkHover: string;\n neutralDarkBackground: string;\n neutralDarkBackgroundHover: string;\n neutralDarkBorder: string;\n neutralDarkBorderHover: string;\n neutralPrimary: string;\n neutralPrimaryHover: string;\n neutralPrimaryBackground: string;\n neutralPrimaryBackgroundHover: string;\n neutralPrimaryBorder: string;\n neutralPrimaryBorderHover: string;\n neutralPrimaryAlt: string;\n neutralPrimaryAltHover: string;\n neutralPrimaryAltBackground: string;\n neutralPrimaryAltBackgroundHover: string;\n neutralPrimaryAltBorder: string;\n neutralPrimaryAltBorderHover: string;\n neutralSecondary: string;\n neutralSecondaryHover: string;\n neutralSecondaryBackground: string;\n neutralSecondaryBackgroundHover: string;\n neutralSecondaryBorder: string;\n neutralSecondaryBorderHover: string;\n neutralSecondaryAlt: string;\n neutralSecondaryAltHover: string;\n neutralSecondaryAltBackground: string;\n neutralSecondaryAltBackgroundHover: string;\n neutralSecondaryAltBorder: string;\n neutralSecondaryAltBorderHover: string;\n neutralTertiary: string;\n neutralTertiaryHover: string;\n neutralTertiaryBackground: string;\n neutralTertiaryBackgroundHover: string;\n neutralTertiaryBorder: string;\n neutralTertiaryBorderHover: string;\n neutralTertiaryAlt: string;\n neutralTertiaryAltHover: string;\n neutralTertiaryAltBackground: string;\n neutralTertiaryAltBackgroundHover: string;\n neutralTertiaryAltBorder: string;\n neutralTertiaryAltBorderHover: string;\n neutralQuaternary: string;\n neutralQuaternaryHover: string;\n neutralQuaternaryBackground: string;\n neutralQuaternaryBackgroundHover: string;\n neutralQuaternaryBorder: string;\n neutralQuaternaryBorderHover: string;\n neutralQuaternaryAlt: string;\n neutralQuaternaryAltHover: string;\n neutralQuaternaryAltBackground: string;\n neutralQuaternaryAltBackgroundHover: string;\n neutralQuaternaryAltBorder: string;\n neutralQuaternaryAltBorderHover: string;\n neutralLight: string;\n neutralLightHover: string;\n neutralLightBackground: string;\n neutralLightBackgroundHover: string;\n neutralLightBorder: string;\n neutralLightBorderHover: string;\n neutralLighter: string;\n neutralLighterHover: string;\n neutralLighterBackground: string;\n neutralLighterBackgroundHover: string;\n neutralLighterBorder: string;\n neutralLighterBorderHover: string;\n neutralLighterAlt: string;\n neutralLighterAltHover: string;\n neutralLighterAltBackground: string;\n neutralLighterAltBackgroundHover: string;\n neutralLighterAltBorder: string;\n neutralLighterAltBorderHover: string;\n white: string;\n whiteHover: string;\n whiteBackground: string;\n whiteBackgroundHover: string;\n whiteBorder: string;\n whiteBorderHover: string;\n whiteTranslucent40: string;\n whiteTranslucent40Hover: string;\n whiteTranslucent40Background: string;\n whiteTranslucent40BackgroundHover: string;\n whiteTranslucent40Border: string;\n whiteTranslucent40BorderHover: string;\n yellow: string;\n yellowHover: string;\n yellowBackground: string;\n yellowBackgroundHover: string;\n yellowBorder: string;\n yellowBorderHover: string;\n yellowLight: string;\n yellowLightHover: string;\n yellowLightBackground: string;\n yellowLightBackgroundHover: string;\n yellowLightBorder: string;\n yellowLightBorderHover: string;\n orange: string;\n orangeHover: string;\n orangeBackground: string;\n orangeBackgroundHover: string;\n orangeBorder: string;\n orangeBorderHover: string;\n orangeLight: string;\n orangeLightHover: string;\n orangeLightBackground: string;\n orangeLightBackgroundHover: string;\n orangeLightBorder: string;\n orangeLightBorderHover: string;\n orangeLighter: string;\n orangeLighterHover: string;\n orangeLighterBackground: string;\n orangeLighterBackgroundHover: string;\n orangeLighterBorder: string;\n orangeLighterBorderHover: string;\n redDark: string;\n redDarkHover: string;\n redDarkBackground: string;\n redDarkBackgroundHover: string;\n redDarkBorder: string;\n redDarkBorderHover: string;\n red: string;\n redHover: string;\n redBackground: string;\n redBackgroundHover: string;\n redBorder: string;\n redBorderHover: string;\n magentaDark: string;\n magentaDarkHover: string;\n magentaDarkBackground: string;\n magentaDarkBackgroundHover: string;\n magentaDarkBorder: string;\n magentaDarkBorderHover: string;\n magenta: string;\n magentaHover: string;\n magentaBackground: string;\n magentaBackgroundHover: string;\n magentaBorder: string;\n magentaBorderHover: string;\n magentaLight: string;\n magentaLightHover: string;\n magentaLightBackground: string;\n magentaLightBackgroundHover: string;\n magentaLightBorder: string;\n magentaLightBorderHover: string;\n purpleDark: string;\n purpleDarkHover: string;\n purpleDarkBackground: string;\n purpleDarkBackgroundHover: string;\n purpleDarkBorder: string;\n purpleDarkBorderHover: string;\n purple: string;\n purpleHover: string;\n purpleBackground: string;\n purpleBackgroundHover: string;\n purpleBorder: string;\n purpleBorderHover: string;\n purpleLight: string;\n purpleLightHover: string;\n purpleLightBackground: string;\n purpleLightBackgroundHover: string;\n purpleLightBorder: string;\n purpleLightBorderHover: string;\n blueDark: string;\n blueDarkHover: string;\n blueDarkBackground: string;\n blueDarkBackgroundHover: string;\n blueDarkBorder: string;\n blueDarkBorderHover: string;\n blueMid: string;\n blueMidHover: string;\n blueMidBackground: string;\n blueMidBackgroundHover: string;\n blueMidBorder: string;\n blueMidBorderHover: string;\n blue: string;\n blueHover: string;\n blueBackground: string;\n blueBackgroundHover: string;\n blueBorder: string;\n blueBorderHover: string;\n blueLight: string;\n blueLightHover: string;\n blueLightBackground: string;\n blueLightBackgroundHover: string;\n blueLightBorder: string;\n blueLightBorderHover: string;\n tealDark: string;\n tealDarkHover: string;\n tealDarkBackground: string;\n tealDarkBackgroundHover: string;\n tealDarkBorder: string;\n tealDarkBorderHover: string;\n teal: string;\n tealHover: string;\n tealBackground: string;\n tealBackgroundHover: string;\n tealBorder: string;\n tealBorderHover: string;\n tealLight: string;\n tealLightHover: string;\n tealLightBackground: string;\n tealLightBackgroundHover: string;\n tealLightBorder: string;\n tealLightBorderHover: string;\n greenDark: string;\n greenDarkHover: string;\n greenDarkBackground: string;\n greenDarkBackgroundHover: string;\n greenDarkBorder: string;\n greenDarkBorderHover: string;\n green: string;\n greenHover: string;\n greenBackground: string;\n greenBackgroundHover: string;\n greenBorder: string;\n greenBorderHover: string;\n greenLight: string;\n greenLightHover: string;\n greenLightBackground: string;\n greenLightBackgroundHover: string;\n greenLightBorder: string;\n greenLightBorderHover: string;\n}\n\nexport const ColorClassNames: IColorClassNames = {} as IColorClassNames;\n\nfor (const colorName in DefaultPalette) {\n if (DefaultPalette.hasOwnProperty(colorName)) {\n // Foreground color\n _defineGetter(ColorClassNames, colorName, '', false, 'color');\n\n // Hover color\n _defineGetter(ColorClassNames, colorName, 'Hover', true, 'color');\n\n // Background color\n _defineGetter(ColorClassNames, colorName, 'Background', false, 'background');\n\n // Background hover\n _defineGetter(ColorClassNames, colorName, 'BackgroundHover', true, 'background');\n\n // Border color\n _defineGetter(ColorClassNames, colorName, 'Border', false, 'borderColor');\n\n // Border hover color\n _defineGetter(ColorClassNames, colorName, 'BorderHover', true, 'borderColor');\n }\n}\n\n/**\n * Defines a getter for the given class configuration.\n */\nfunction _defineGetter(\n obj: IColorClassNames,\n colorName: string,\n suffix: string,\n isHover: boolean,\n cssProperty: string,\n): void {\n Object.defineProperty(obj, colorName + suffix, {\n get: (): string => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const style: IRawStyle = { [cssProperty]: (getTheme().palette as any)[colorName] };\n\n return mergeStyles(isHover ? { selectors: { ':hover': style } } : style).toString();\n },\n enumerable: true,\n configurable: true,\n });\n}\n"]}
\No newline at end of file