import { PALETTE_BACKGROUND_OFFSET } from "@tamagui/theme-builder";
var objectFromEntries = function (entries) {
  return Object.fromEntries(entries);
};
var objectKeys = function (obj) {
  return Object.keys(obj);
};
var getTemplates = function () {
  var lightTemplates = getBaseTemplates("light");
  var darkTemplates = getBaseTemplates("dark");
  var templates = {
    ...objectFromEntries(objectKeys(lightTemplates).map(function (name) {
      return [`light_${name}`, lightTemplates[name]];
    })),
    ...objectFromEntries(objectKeys(darkTemplates).map(function (name) {
      return [`dark_${name}`, darkTemplates[name]];
    }))
  };
  return templates;
};
var getBaseTemplates = function (scheme) {
  var isLight = scheme === "light";
  var lighten = isLight ? -1 : 1;
  var darken = -lighten;
  var background = PALETTE_BACKGROUND_OFFSET;
  var borderColor = background + 2;
  var color = -background;
  var makeSurface = function (offset) {
    var colorOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
    var clr = color - colorOffset;
    var bg = background + offset;
    var brdr = borderColor + offset;
    return {
      color: clr,
      colorHover: clr + (isLight ? 0 : lighten),
      colorPress: clr,
      colorFocus: clr + darken,
      background: bg,
      // hover lightens always
      backgroundHover: bg + lighten,
      // press darkens always
      backgroundPress: bg + darken,
      // focus: lightens in dark mode, darkens in light
      backgroundFocus: bg + offset,
      backgroundActive: bg,
      borderColor: brdr,
      borderColorHover: brdr + lighten,
      borderColorFocus: brdr,
      borderColorPress: brdr + darken
    };
  };
  var base = {
    accentBackground: 0,
    accentColor: -0,
    background0: 1,
    background02: 2,
    background04: 3,
    background06: 4,
    background08: 5,
    color1: background,
    color2: background + 1,
    color3: background + 2,
    color4: background + 3,
    color5: background + 4,
    color6: background + 5,
    color7: background + 6,
    color8: background + 7,
    color9: background + 8,
    color10: background + 9,
    color11: background + 10,
    color12: background + 11,
    color0: -1,
    color02: -2,
    color04: -3,
    color06: -4,
    color08: -5,
    // v5 = we make this actually 1 up (surface1 technically from before)
    // this way "generics" are automatically differentiated from base bg
    ...makeSurface(1),
    placeholderColor: color - 3,
    colorTransparent: -1
  };
  var surface1 = makeSurface(2, 1);
  var surface2 = makeSurface(3, 1);
  var surface3 = makeSurface(5, 1);
  var accent = Object.fromEntries(Object.entries(base).map(function (param) {
    var [key, index] = param;
    return [key, -index];
  }));
  return {
    base,
    surface1,
    surface2,
    surface3,
    accent
  };
};
var v5Templates = getTemplates();
export { v5Templates };
//# sourceMappingURL=v5-templates.native.js.map
