{
  "namespace": "common_tabs",

  "empty_tab_content": {
    "type": "panel",
    "size": [ 0, 0 ]
  },

  "tab_image": {
    "type": "image",
    "texture": "$tab_texture"
  },

  "tab_panel": {
    "type": "panel",
    "$tab_content|default": "common_tabs.empty_tab_content",
    "$tab_image|default": "common_tabs.tab_image",

    "controls": [
      {
        "tab_image@$tab_image": {
          "size": [ "100%", "100%" ], // We need to explicitly set the size here.
          "layer": 2
        }
      },
      {
        "tab_content_sizer": {
          "type": "panel",
          "$tab_content_size|default": [ "100% - 4px", "100% - 4px" ],
          "size": "$tab_content_size",
          "controls": [
            {
              "tab_content@$tab_content": {
                "layer": 1
              }
            }
          ]
        }
      }
    ]
  },

  "base_tab": {
    "type": "panel",
    "$unchecked_text_color": "$tab_unchecked_text_color",
    "$unchecked_hover_text_color": "$tab_unchecked_hover_text_color",
    "$unchecked_locked_text_color": "$tab_unchecked_locked_text_color",
    "$unchecked_locked_hover_text_color": "$tab_unchecked_locked_hover_text_color",
    "$checked_text_color": "$tab_checked_text_color",
    "$checked_hover_text_color": "$tab_checked_hover_text_color",
    "$checked_locked_text_color": "$tab_checked_locked_text_color",
    "$checked_locked_hover_text_color": "$tab_checked_locked_hover_text_color",

    "$unchecked_secondary_text_color": "$tab_secondary_unchecked_text_color",
    "$unchecked_hover_secondary_text_color": "$tab_secondary_unchecked_hover_text_color",
    "$unchecked_locked_secondary_text_color": "$tab_secondary_unchecked_locked_text_color",
    "$unchecked_locked_hover_secondary_text_color": "$tab_secondary_unchecked_locked_hover_text_color",
    "$checked_secondary_text_color": "$tab_secondary_checked_text_color",
    "$checked_hover_secondary_text_color": "$tab_secondary_checked_hover_text_color",
    "$checked_locked_secondary_text_color": "$tab_secondary_checked_locked_text_color",
    "$checked_locked_hover_secondary_text_color": "$tab_secondary_checked_locked_hover_text_color",

    "$unchecked_glyph_color": "$tab_unchecked_glyph_color",
    "$unchecked_hover_glyph_color": "$tab_unchecked_hover_glyph_color",
    "$unchecked_locked_glyph_color": "$tab_unchecked_locked_glyph_color",
    "$unchecked_locked_hover_glyph_color": "$tab_unchecked_locked_hover_glyph_color",
    "$checked_glyph_color": "$tab_checked_glyph_color",
    "$checked_hover_glyph_color": "$tab_checked_hover_glyph_color",
    "$checked_locked_glyph_color": "$tab_checked_locked_glyph_color",
    "$checked_locked_hover_glyph_color": "$tab_checked_locked_hover_glyph_color",

    "$tab_view_binding_name|default": "tab",
    "$tab_panel|default": "common_tabs.tab_panel",

    "controls": [
      {
        "$tab_view_binding_name@common.toggle": {
          "controls": [
            {
              "unchecked@$tab_panel": {
                "$text_color": "$unchecked_text_color",
                "$secondary_text_color": "$unchecked_secondary_text_color",
                "$glyph_color": "$unchecked_glyph_color",
                "$tab_texture": "$unchecked_default_image",
                "$tab_state": "unchecked",
                "layer": 1
              }
            },
            {
              "unchecked_hover@$tab_panel": {
                "$text_color": "$unchecked_hover_text_color",
                "$secondary_text_color": "$unchecked_hover_secondary_text_color",
                "$glyph_color": "$unchecked_hover_glyph_color",
                "$tab_texture": "$unchecked_hover_image",
                "$tab_state": "unchecked_hover",
                "layer": 1
              }
            },
            {
              "unchecked_locked@$tab_panel": {
                "$text_color": "$unchecked_locked_text_color",
                "$secondary_text_color": "$unchecked_locked_secondary_text_color",
                "$glyph_color": "$unchecked_locked_glyph_color",
                "$tab_texture": "$unchecked_locked_image",
                "$tab_state": "unchecked_locked",
                "layer": 1
              }
            },
            {
              "unchecked_locked_hover@$tab_panel": {
                "$text_color": "$unchecked_locked_hover_text_color",
                "$secondary_text_color": "$unchecked_locked_hover_secondary_text_color",
                "$glyph_color": "$unchecked_locked_hover_glyph_color",
                "$tab_texture": "$unchecked_locked_hover_image",
                "$tab_state": "unchecked_locked_hover",
                "layer": 1
              }
            },
            {
              "checked@$tab_panel": {
                "$text_color": "$checked_text_color",
                "$secondary_text_color": "$checked_secondary_text_color",
                "$glyph_color": "$checked_glyph_color",
                "$tab_texture": "$checked_default_image",
                "$tab_state": "checked",
                "layer": 2
              }
            },
            {
              "checked_hover@$tab_panel": {
                "$text_color": "$checked_hover_text_color",
                "$secondary_text_color": "$checked_hover_secondary_text_color",
                "$glyph_color": "$checked_hover_glyph_color",
                "$tab_texture": "$checked_hover_image",
                "$tab_state": "checked_hover",
                "layer": 2
              }
            },
            {
              "checked_locked@$tab_panel": {
                "$text_color": "$checked_locked_text_color",
                "$secondary_text_color": "$checked_locked_secondary_text_color",
                "$glyph_color": "$checked_locked_glyph_color",
                "$tab_texture": "$checked_locked_image",
                "$tab_state": "checked_locked",
                "layer": 2
              }
            },
            {
              "checked_locked_hover@$tab_panel": {
                "$text_color": "$checked_locked_hover_text_color",
                "$secondary_text_color": "$checked_locked_hover_secondary_text_color",
                "$glyph_color": "$checked_locked_hover_glyph_color",
                "$tab_texture": "$checked_locked_hover_image",
                "$tab_state": "checked_locked_hover",
                "layer": 2
              }
            }
          ]
        }
      }
    ]
  },

  "tab_top@common_tabs.base_tab": {
    "$is_left_most_tab|default": false,
    "$is_right_most_tab|default": false,

    "variables": [
      {
        "requires": "($is_left_most_tab and not $is_right_most_tab)",
        "$unchecked_default_image": "textures/ui/TabTopBackLeftMost",
        "$unchecked_hover_image": "textures/ui/TabTopBackLeftMost",
        "$unchecked_locked_image": "textures/ui/TabTopBackLeftMost",
        "$unchecked_locked_hover_image": "textures/ui/TabTopBackLeftMost",

        "$checked_default_image": "textures/ui/TabTopFrontLeftMost",
        "$checked_hover_image": "textures/ui/TabTopFrontLeftMost",
        "$checked_locked_image": "textures/ui/TabTopFrontLeftMost",
        "$checked_locked_hover_image": "textures/ui/TabTopFrontLeftMost"
      },
      {
        "requires": "($is_right_most_tab and not $is_left_most_tab)",
        "$unchecked_default_image": "textures/ui/TabTopBackRightMost",
        "$unchecked_hover_image": "textures/ui/TabTopBackRightMost",
        "$unchecked_locked_image": "textures/ui/TabTopBackRightMost",
        "$unchecked_locked_hover_image": "textures/ui/TabTopBackRightMost",

        "$checked_default_image": "textures/ui/TabTopFrontRightMost",
        "$checked_hover_image": "textures/ui/TabTopFrontRightMost",
        "$checked_locked_image": "textures/ui/TabTopFrontRightMost",
        "$checked_locked_hover_image": "textures/ui/TabTopFrontRightMost"
      }
    ],

    "$unchecked_default_image": "textures/ui/TabTopBack",
    "$unchecked_hover_image": "textures/ui/TabTopBack",
    "$unchecked_locked_image": "textures/ui/TabTopBack",
    "$unchecked_locked_hover_image": "textures/ui/TabTopBack",

    "$checked_default_image|default": "textures/ui/TabTopFront",
    "$checked_hover_image|default": "textures/ui/TabTopFront",
    "$checked_locked_image|default": "textures/ui/TabTopFront",
    "$checked_locked_hover_image|default": "textures/ui/TabTopFront"
  },

  "tab_left@common_tabs.base_tab": {
    "$is_bottom_most_tab|default": false,
    "$is_top_most_tab|default": false,

    "variables": [
      {
        "requires": "($is_bottom_most_tab and not $is_top_most_tab)",
        "$unchecked_default_image": "textures/ui/TabLeftBackBottomMost",
        "$unchecked_hover_image": "textures/ui/TabLeftBackBottomMost",
        "$unchecked_locked_image": "textures/ui/TabLeftBackBottomMost",
        "$unchecked_locked_hover_image": "textures/ui/TabLeftBackBottomMost",

        "$checked_default_image": "textures/ui/TabLeftFrontBottomMost",
        "$checked_hover_image": "textures/ui/TabLeftFrontBottomMost",
        "$checked_locked_image": "textures/ui/TabLeftFrontBottomMost",
        "$checked_locked_hover_image": "textures/ui/TabLeftFrontBottomMost"
      },
      {
        "requires": "($is_top_most_tab and not $is_bottom_most_tab)",
        "$unchecked_default_image": "textures/ui/TabLeftBackTopMost",
        "$unchecked_hover_image": "textures/ui/TabLeftBackTopMost",
        "$unchecked_locked_image": "textures/ui/TabLeftBackTopMost",
        "$unchecked_locked_hover_image": "textures/ui/TabLeftBackTopMost",

        "$checked_default_image": "textures/ui/TabLeftFrontTopMost",
        "$checked_hover_image": "textures/ui/TabLeftFrontTopMost",
        "$checked_locked_image": "textures/ui/TabLeftFrontTopMost",
        "$checked_locked_hover_image": "textures/ui/TabLeftFrontTopMost"
      }
    ],


    "$unchecked_default_image": "textures/ui/TabLeftBack",
    "$unchecked_hover_image": "textures/ui/TabLeftBack",
    "$unchecked_locked_image": "textures/ui/TabLeftBack",
    "$unchecked_locked_hover_image": "textures/ui/TabLeftBack",

    "$checked_default_image|default": "textures/ui/TabLeftFront",
    "$checked_hover_image|default": "textures/ui/TabLeftFront",
    "$checked_locked_image|default": "textures/ui/TabLeftFront",
    "$checked_locked_hover_image|default": "textures/ui/TabLeftFront"
  },

  "tab_right@common_tabs.base_tab": {
    "$is_bottom_most_tab|default": false,
    "$is_top_most_tab|default": false,

    "variables": [
      {
        "requires": "($is_bottom_most_tab and not $is_top_most_tab)",
        "$unchecked_default_image": "textures/ui/TabRightBackBottomMost",
        "$unchecked_hover_image": "textures/ui/TabRightBackBottomMost",
        "$unchecked_locked_image": "textures/ui/TabRightBackBottomMost",
        "$unchecked_locked_hover_image": "textures/ui/TabRightBackBottomMost",

        "$checked_default_image": "textures/ui/TabRightFrontBottomMost",
        "$checked_hover_image": "textures/ui/TabRightFrontBottomMost",
        "$checked_locked_image": "textures/ui/TabRightFrontBottomMost",
        "$checked_locked_hover_image": "textures/ui/TabRightFrontBottomMost"
      },
      {
        "requires": "($is_top_most_tab and not $is_bottom_most_tab)",
        "$unchecked_default_image": "textures/ui/TabRightBackTopMost",
        "$unchecked_hover_image": "textures/ui/TabRightBackTopMost",
        "$unchecked_locked_image": "textures/ui/TabRightBackTopMost",
        "$unchecked_locked_hover_image": "textures/ui/TabRightBackTopMost",

        "$checked_default_image": "textures/ui/TabRightFrontTopMost",
        "$checked_hover_image": "textures/ui/TabRightFrontTopMost",
        "$checked_locked_image": "textures/ui/TabRightFrontTopMost",
        "$checked_locked_hover_image": "textures/ui/TabRightFrontTopMost"
      }
    ],

    "$unchecked_default_image": "textures/ui/TabRightBack",
    "$unchecked_hover_image": "textures/ui/TabRightBack",
    "$unchecked_locked_image": "textures/ui/TabRightBack",
    "$unchecked_locked_hover_image": "textures/ui/TabRightBack",

    "$checked_default_image|default": "textures/ui/TabRightFront",
    "$checked_hover_image|default": "textures/ui/TabRightFront",
    "$checked_locked_image|default": "textures/ui/TabRightFront",
    "$checked_locked_hover_image|default": "textures/ui/TabRightFront"
  }
}