"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.testerTheme = exports.TesterThemeReference = exports.lightnessOptions = void 0;
var tslib_1 = require("tslib");
var react_native_1 = require("react-native");
var android_theme_1 = require("@fluentui-react-native/android-theme");
var apple_theme_1 = require("@fluentui-react-native/apple-theme");
var default_theme_1 = require("@fluentui-react-native/default-theme");
var theme_1 = require("@fluentui-react-native/theme");
var applyBrand_1 = require("./applyBrand");
var applyTheme_1 = require("./applyTheme");
var themeOptions = { paletteName: 'TaskPane', appearance: 'dynamic' };
// Default applies to win32
var baseTheme = react_native_1.Platform.select({
    android: (0, android_theme_1.createAndroidTheme)(themeOptions),
    ios: (0, apple_theme_1.createAppleTheme)(),
    macos: (0, apple_theme_1.createAppleTheme)(),
    default: (0, default_theme_1.createDefaultTheme)(themeOptions),
});
var supportsHighContrastTokens = react_native_1.Platform.select({
    android: false,
    ios: false,
    macos: false,
    default: true,
});
exports.lightnessOptions = [
    { label: 'Auto', value: 'dynamic' },
    { label: 'Light', value: 'light' },
    { label: 'Dark', value: 'dark' },
    supportsHighContrastTokens && { label: 'High Contrast', value: 'highContrast' },
];
var TesterThemeReference = /** @class */ (function (_super) {
    tslib_1.__extends(TesterThemeReference, _super);
    function TesterThemeReference() {
        var _this = _super.call(this, baseTheme, function (parent) { return (0, applyTheme_1.applyTheme)(parent, _this._themeName, _this.options.appearance); }, function (parent) { return (0, applyBrand_1.applyBrand)(parent, _this._brand); }) || this;
        _this._themeName = react_native_1.Platform.OS === 'win32' ? 'Office' : 'Default';
        _this._brand = 'Default';
        _this.baseTheme = baseTheme;
        _this.options = themeOptions;
        return _this;
    }
    Object.defineProperty(TesterThemeReference.prototype, "themeName", {
        /** get/set the currently active theme */
        get: function () {
            return this._themeName;
        },
        set: function (newTheme) {
            if (newTheme !== this._themeName) {
                this._themeName = newTheme;
                this.invalidate();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TesterThemeReference.prototype, "appearance", {
        /** get/set the theme appearance */
        get: function () {
            return this.options.appearance;
        },
        set: function (lightness) {
            if (lightness !== this.options.appearance) {
                this.options.appearance = lightness;
                this.baseTheme.invalidate();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TesterThemeReference.prototype, "brand", {
        /** get/set the applied brand */
        get: function () {
            return this._brand;
        },
        set: function (newBrand) {
            if (newBrand !== this._brand) {
                this._brand = newBrand;
                this.invalidate();
            }
        },
        enumerable: false,
        configurable: true
    });
    return TesterThemeReference;
}(theme_1.ThemeReference));
exports.TesterThemeReference = TesterThemeReference;
exports.testerTheme = new TesterThemeReference();
//# sourceMappingURL=CustomThemes.js.map