"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var resolve_theme_exports = {};
__export(resolve_theme_exports, {
  resolveTheme: () => resolveTheme
});
module.exports = __toCommonJS(resolve_theme_exports);
var import_lodash = __toESM(require("lodash"));
var import_theme_constants = require("./theme-constants.js");
const resolveTheme = ({
  theme = {},
  environment,
  isMobile = false
}) => {
  const { useWixStyles, useNativeStyles, ...userTheme } = theme;
  const isWix = useWixStyles || environment === "businessManager" || environment === "wixel";
  const envPreset = useNativeStyles ? nativePreset : isWix ? wixPreset : liveSitePreset;
  const baseDefaults = isMobile ? THEME_DEFAULTS.mobile : THEME_DEFAULTS.desktop;
  return import_lodash.default.merge({}, baseDefaults, envPreset, userTheme, isWix ? wixPriorityOverrides : {});
};
const wixPreset = {
  palette: {
    actionColor: import_theme_constants.ACTION_COLOR_DEFAULT,
    bgColor: import_theme_constants.BG_COLOR_DEFAULT,
    textColor: import_theme_constants.TEXT_COLOR_DEFAULT
  },
  paletteConfig: {
    focusActionColor: import_theme_constants.ACTION_COLOR_DEFAULT,
    settingsActionColor: import_theme_constants.ACTION_COLOR_DEFAULT
  },
  settingsStyles: {
    dividers: {
      color: "#DFE5EB",
      height: "12px"
    },
    icons: {
      color: "#333853"
    },
    text: {
      color: "#333853",
      fontFamily: "Madefor"
    },
    whitebox: {
      borderRadius: "8px",
      boxShadow: "0 8px 8px 0 rgba(22, 45, 61, 0.12), 0 3px 24px 0 rgba(22, 45, 61, 0.18)"
    }
  }
};
const wixPriorityOverrides = {
  customStyles: {
    editor: {
      addPluginButton: {
        plusIconColor: import_theme_constants.ACTION_COLOR_DEFAULT
      }
    }
  }
};
const liveSitePreset = {
  palette: {},
  paletteConfig: {
    settingsActionColor: "#000000"
  },
  settingsStyles: {
    dividers: {
      color: "#ededed",
      height: "12px"
    },
    icons: {
      color: "#000000"
    },
    text: {
      color: "#000000",
      fontFamily: "HelveticaNeue,Helvetica,Arial"
    },
    whitebox: {
      borderRadius: "0px",
      boxShadow: "0 8px 8px 0 rgba(22, 45, 61, 0.12), 0 3px 24px 0 rgba(22, 45, 61, 0.18)"
    }
  }
};
const nativePreset = {
  nativeStyle: {
    text: {
      fontFamily: "Madefor",
      color: "#20303C"
    },
    primaryText: {
      fontWeight: 700
    },
    bgColor: {
      backgroundColor: "#F8F9FA"
    },
    secondary: {
      backgroundColor: "#E8ECF0"
    },
    whitebox: {
      borderRadius: "8px"
    },
    coverImage: {
      height: "70px",
      width: "70px",
      margin: "8px",
      border: "1px solid rgba(110, 120, 129, 0.1)"
    }
  }
};
const defaultCustomStyle = { fontWeight: "normal", fontStyle: "normal", lineHeight: "1.5" };
const defaultPalette = { bgColor: import_theme_constants.BG_COLOR_DEFAULT, textColor: import_theme_constants.TEXT_COLOR_DEFAULT };
const THEME_DEFAULTS = {
  desktop: {
    customStyles: {
      p: {
        ...defaultCustomStyle,
        fontSize: import_theme_constants.PARAGRAPH_FONT_SIZE
      },
      h1: {
        ...defaultCustomStyle,
        fontSize: import_theme_constants.HEADING_FONT_SIZES.h1
      },
      h2: {
        ...defaultCustomStyle,
        fontSize: import_theme_constants.HEADING_FONT_SIZES.h2
      },
      h3: {
        ...defaultCustomStyle,
        fontSize: import_theme_constants.HEADING_FONT_SIZES.h3
      },
      h4: {
        ...defaultCustomStyle,
        fontSize: import_theme_constants.HEADING_FONT_SIZES.h4
      },
      h5: {
        ...defaultCustomStyle,
        fontSize: import_theme_constants.HEADING_FONT_SIZES.h5
      },
      h6: {
        ...defaultCustomStyle,
        fontSize: import_theme_constants.HEADING_FONT_SIZES.h6
      },
      quote: {
        lineHeight: "1.5",
        fontSize: "18px"
      },
      codeBlock: {
        lineHeight: "1.5"
      }
    },
    palette: defaultPalette
  },
  mobile: {
    customStyles: {
      p: {
        ...defaultCustomStyle,
        fontSize: "14px"
      },
      h1: {
        ...defaultCustomStyle,
        fontSize: "32px"
      },
      h2: {
        ...defaultCustomStyle,
        fontSize: "24px"
      },
      h3: {
        ...defaultCustomStyle,
        fontSize: "20px"
      },
      h4: {
        ...defaultCustomStyle,
        fontSize: "20px"
      },
      h5: {
        ...defaultCustomStyle,
        fontSize: "16px"
      },
      h6: {
        ...defaultCustomStyle,
        fontSize: "14px"
      },
      quote: {
        lineHeight: "1.5",
        fontSize: "18px"
      },
      codeBlock: {
        lineHeight: "1.5"
      }
    },
    palette: defaultPalette
  }
};
//# sourceMappingURL=resolve-theme.js.map
