{
  "namespace": "chest_ui",
  "chest_label": {
    "type": "label",
    "$offset|default": [7, 10],
    "offset": "$offset",
    "anchor_from": "top_left",
    "anchor_to": "top_left",
    "text": "#title_text",
    "size": ["90%", "default"],
    "color": "$title_text_color",
    "layer": 2
  },
  "chest_panel": {
    "type": "panel",
    "size": ["100%c", "100%c"],
    "controls": [
      {
        "inventory_chest_grid_image": {
          "type": "image",
          "size": [176, 96],
          "texture": "textures/ui/gui/inventory",
          "$single_chest_flag": "§c§h§e§s§t§s§i§n§v§e§n§t",
          "layer": 0,
          "controls": [
            {
              "title_label@chest_ui.chest_label": {
                "$offset": [7, 5]
              }
            },
            {
              "close_button@common.close_button": {
                "$close_button_offset": [-2, 1]
              }
            },
            {
              "inventory_grid": {
                "type": "grid",
                "grid_dimensions": [9, 4],
                "size": ["100% - 17px", "100% - 22px"],
                "offset": [8, 9],
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "grid_item_template": "chest_ui.chest_item",
                "$button": "chest_ui.chest_item",
                "collection_name": "form_buttons",
                "layer": 1
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#title_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#title_text - $single_chest_flag) = #title_text))",
              "target_property_name": "#visible"
            }
          ]
        }
      },
      {
        "single_chest_grid_image": {
          "type": "image",
          "size": [176, 130],
          "texture": "textures/ui/gui/generic_1",
          "$single_chest_flag": "§c§h§e§s§t§s§i§n§g§l§e§r",
          "layer": 0,
          "controls": [
            {
              "title_label@chest_ui.chest_label": {}
            },
            {
              "close_button@common.close_button": {
                "$close_button_offset": [-2, 2]
              }
            },
            {
              "single_chest_grid": {
                "type": "grid",
                "grid_dimensions": [9, 5],
                "size": ["100% - 17px", "100% - 32px"],
                "offset": [8, 22],
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "grid_item_template": "chest_ui.chest_item",
                "$button": "chest_ui.chest_item",
                "collection_name": "form_buttons",
                "layer": 1
              }
            },
            {
              "inventory_text": {
                "type": "label",
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "offset": [7, "100% - 90px"],
                "size": ["90%", "default"],
                "layer": 2,
                "color": "$title_text_color",
                "text": "container.inventory"
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#title_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#title_text - $single_chest_flag) = #title_text))",
              "target_property_name": "#visible"
            }
          ]
        }
      },
      {
        "tiny_chest_grid_image": {
          "type": "image",
          "size": [176, 130],
          "texture": "textures/ui/gui/generic_9",
          "$small_chest_flag": "§c§h§e§s§t§t§i§n§n§y§r",
          "layer": 0,
          "controls": [
            {
              "title_label@chest_ui.chest_label": {}
            },
            {
              "close_button@common.close_button": {
                "$close_button_offset": [-2, 2]
              }
            },
            {
              "small_chest_grid": {
                "type": "grid",
                "grid_dimensions": [9, 1],
                "size": ["100% - 14px", "100% - 112px"],
                "offset": [7, 21],
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "grid_item_template": "chest_ui.chest_item",
                "collection_name": "form_buttons",
                "layer": 1
              }
            },
            {
              "inventory_text": {
                "type": "label",
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "offset": [7, "100% - 90px"],
                "size": ["90%", "default"],
                "layer": 2,
                "color": "$title_text_color",
                "text": "container.inventory"
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#title_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#title_text - $small_chest_flag) = #title_text))",
              "target_property_name": "#visible"
            }
          ]
        }
      },
      {
        "small_chest_grid_image": {
          "type": "image",
          "size": [176, 166],
          "texture": "textures/ui/gui/generic_27",
          "$small_chest_flag": "§c§h§e§s§t§s§m§a§l§l",
          "layer": 0,
          "controls": [
            {
              "title_label@chest_ui.chest_label": {}
            },
            {
              "close_button@common.close_button": {
                "$close_button_offset": [-2, 2]
              }
            },
            {
              "small_chest_grid": {
                "type": "grid",
                "grid_dimensions": [9, 8],
                "size": ["100% - 14px", "100%  - 27px"],
                "offset": [7, 21],
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "grid_item_template": "chest_ui.chest_item",
                "collection_name": "form_buttons",
                "layer": 1
              }
            },
            {
              "inventory_text": {
                "type": "label",
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "offset": [7, "100% - 90px"],
                "size": ["90%", "default"],
                "layer": 2,
                "color": "$title_text_color",
                "text": "container.inventory"
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#title_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#title_text - $small_chest_flag) = #title_text))",
              "target_property_name": "#visible"
            }
          ]
        }
      },
      {
        "large_chest_grid_image": {
          "type": "image",
          "size": [176, 220],
          "texture": "textures/ui/gui/generic_54",
          "$large_chest_flag": "§c§h§e§s§t§l§a§r§g§e",
          "layer": 0,
          "controls": [
            {
              "chest_label@chest_ui.chest_label": {}
            },
            {
              "close_button@common.light_close_button": {
                "$close_button_offset": [-2, 2]
              }
            },
            {
              "large_chest_grid": {
                "type": "grid",
                "grid_dimensions": [9, 6],
                "size": ["100% - 17px", "100% - 112px"],
                "offset": [7, 21],
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "grid_item_template": "chest_ui.chest_item",
                "collection_name": "form_buttons",
                "layer": 1
              }
            },
            {
              "inventory_text": {
                "type": "label",
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "offset": [7, "100% - 90px"],
                "size": ["90%", "default"],
                "layer": 2,
                "color": "$title_text_color",
                "text": "container.inventory"
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#title_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#title_text - $large_chest_flag) = #title_text))",
              "target_property_name": "#visible"
            }
          ]
        }
      },
      {
        "quests_grid_image": {
          "type": "image",
          "size": [185, 128],
          "offset": [0, -5],
          "texture": "textures/ui/quests/chest_screen",
          "$quest_chest_flag": "§c§h§e§s§t§s§q§u§e§s§t§s",
          "layer": 0,
          "controls": [
            {
              "close_button@common.close_button": {
                "$close_button_offset": [-10, 52]
              }
            },
            {
              "quest_chest_grid": {
                "type": "grid",
                "grid_dimensions": [9, 3],
                "size": ["100% - 32px", "100% - 80px"],
                "offset": [17, 67],
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "grid_item_template": "chest_ui.chest_item",
                "collection_name": "form_buttons",
                "layer": 1
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#title_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#title_text - $quest_chest_flag) = #title_text))",
              "target_property_name": "#visible"
            }
          ]
        }
      },
      {
        "quests_grid_large_image": {
          "type": "image",
          "size": [185, 179],
          "offset": [0, -5],
          "texture": "textures/ui/quests/chest_screen_large",
          "$quest_chest_flag": "§c§h§e§s§t§s§l§u§e§s§t§s",
          "layer": 0,
          "controls": [
            {
              "close_button@common.close_button": {
                "$close_button_offset": [-10, 52]
              }
            },
            {
              "quest_chest_grid": {
                "type": "grid",
                "grid_dimensions": [9, 6],
                "size": ["100% - 32px", "100% - 80px"],
                "offset": [17, 67],
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "grid_item_template": "chest_ui.chest_item",
                "collection_name": "form_buttons",
                "layer": 1
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#title_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#title_text - $quest_chest_flag) = #title_text))",
              "target_property_name": "#visible"
            }
          ]
        }
      },
      {
        "backpack_grid": {
          "type": "image",
          "size": [245, 216],
          "offset": [0, -5],
          "texture": "textures/ui/gui/backpack",
          "$quest_chest_flag": "§c§h§e§s§t§s§b§a§c§k§p§a",
          "layer": 0,
          "controls": [
            {
              "close_button@common.close_button": {
                "$close_button_offset": [-20, 10]
              }
            },
            {
              "quest_chest_grid": {
                "type": "grid",
                "grid_dimensions": [9, 10],
                "size": ["100% - 83px", "100% - 36px"],
                "offset": [33, 41],
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "grid_item_template": "chest_ui.chest_item",
                "collection_name": "form_buttons",
                "layer": 1
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#title_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#title_text - $quest_chest_flag) = #title_text))",
              "target_property_name": "#visible"
            }
          ]
        }
      },
      {
        "auction_house_grid": {
          "type": "image",
          "size": [206, 186],
          "offset": [0, -5],
          "texture": "textures/ui/gui/auction",
          "$auction_house_chest_flag": "§c§h§e§s§t§a§u§c§t§i§o§n",
          "layer": 0,
          "controls": [
            {
              "close_button@common.close_button": {
                "$close_button_offset": [-20, 40]
              }
            },
            {
              "quest_chest_grid": {
                "type": "grid",
                "grid_dimensions": [9, 6],
                "size": ["100% - 47px", "100% - 78px"],
                "offset": [20, 58],
                "anchor_from": "top_left",
                "anchor_to": "top_left",
                "grid_item_template": "chest_ui.chest_item",
                "collection_name": "form_buttons",
                "layer": 1
              }
            }
          ],
          "bindings": [
            {
              "binding_name": "#title_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not ((#title_text - $auction_house_chest_flag) = #title_text))",
              "target_property_name": "#visible"
            }
          ]
        }
      }
    ]
  },
  "inventory_button@common.button": {
    "$pressed_button_name": "button.form_button_click",
    "default_control": "default",
    "hover_control": "hover",
    "pressed_control": "pressed",
    "offset": "$offset",
    "$texture_bindings": [
      {
        "binding_name": "#form_button_texture",
        "binding_type": "collection",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_type": "view",
        "source_property_name": "(not (('%.8s' * #form_button_texture) = 'textures'))",
        "target_property_name": "#visible"
      },
      {
        "binding_type": "view",
        "source_property_name": "(not ((#form_button_texture = '') or (#form_button_texture = 'loading')))",
        "target_property_name": "#visible"
      },
      {
        "binding_type": "view",
        "source_property_name": "(#form_button_texture * 1)",
        "target_property_name": "#item_id_aux"
      }
    ],
    "controls": [
      {
        "inventory_button_amount@chest_ui.inventory_button_amount": {}
      },
      {
        "default@chest_ui.default_control": {}
      },
      {
        "hover@chest_ui.hover_control": {}
      },
      {
        "pressed@chest_ui.pressed_control": {}
      }
    ]
  },
  "ui_chest_item@chest_ui.inventory_button": {
    "$offset": [0, 0],
    "bindings": [
      {
        "binding_type": "collection",
        "binding_condition": "none",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_type": "collection_details",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_name": "#form_button_text",
        "binding_type": "collection",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_type": "view",
        "source_property_name": "(('%.4s' * #form_button_text) = 'cht:')",
        "target_property_name": "#visible"
      }
    ]
  },
  "ui_inventory_item@chest_ui.inventory_button": {
    "$offset": [0, 8],
    "bindings": [
      {
        "binding_type": "collection",
        "binding_condition": "none",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_type": "collection_details",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_name": "#form_button_text",
        "binding_type": "collection",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_type": "view",
        "source_property_name": "(('%.4s' * #form_button_text) = 'inv:')",
        "target_property_name": "#visible"
      }
    ]
  },
  "ui_hot_bar_item@chest_ui.inventory_button": {
    "$offset": [0, 8],
    "bindings": [
      {
        "binding_type": "collection",
        "binding_condition": "none",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_type": "collection_details",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_name": "#form_button_text",
        "binding_type": "collection",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_type": "view",
        "source_property_name": "(('%.4s' * #form_button_text) = 'hot:')",
        "target_property_name": "#visible"
      }
    ]
  },
  "non_renderer_item": {
    "type": "image",
    "size": [16, 16],
    "bindings": [
      {
        "binding_name": "#form_button_texture",
        "binding_name_override": "#texture",
        "binding_type": "collection",
        "binding_collection_name": "form_buttons"
      },
      {
        "binding_type": "view",
        "source_property_name": "(not ((#texture = '') or (#texture = 'loading')))",
        "target_property_name": "#visible"
      },
      {
        "binding_type": "view",
        "source_property_name": "(('%.8s' * #texture) = 'textures')",
        "target_property_name": "#visible"
      }
    ]
  },
  "default_control": {
    "type": "panel",
    "size": ["100%c", "100%c"],
    "layer": 3,
    "controls": [
      {
        "item_block@beacon.item_renderer": {
          "size": [16, 16],
          "offset": "$offset",
          "bindings": "$texture_bindings"
        }
      },
      {
        "non_renderer_item@chest_ui.non_renderer_item": {
          "offset": "$offset"
        }
      }
    ]
  },
  "hover_control": {
    "type": "panel",
    "size": ["100%c", "100%c"],
    "offset": "$offset",
    "controls": [
      {
        "hovering_image": {
          "type": "panel",
          "size": [18, 18],
          "controls": [
            {
              "item_details": {
                "type": "custom",
                "renderer": "hover_text_renderer",
                "allow_clipping": false,
                "layer": 30,
                "bindings": [
                  {
                    "binding_name": "#form_button_text",
                    "binding_type": "collection",
                    "binding_collection_name": "form_buttons"
                  },
                  {
                    "binding_type": "view",
                    "source_property_name": "(#form_button_text - ('%.12s' * #form_button_text))",
                    "target_property_name": "#hover_text"
                  },
                  {
                    "binding_type": "collection_details",
                    "binding_collection_name": "form_buttons"
                  }
                ]
              }
            },
            {
              "item_block@beacon.item_renderer": {
                "size": [16, 16],
                "bindings": "$texture_bindings",
                "layer": 3,
                "offset": [1, 1]
              }
            },
            {
              "non_renderer_item@chest_ui.non_renderer_item": {
                "layer": 3
              }
            },
            {
              "highlight_slot": {
                "type": "image",
                "size": [18, 18],
                "texture": "textures/ui/highlight_slot",
                "layer": 0
              }
            },
            {
              "focus_border": {
                "type": "image",
                "size": [18, 18],
                "texture": "textures/ui/focus_border_white",
                "layer": 1
              }
            }
          ]
        }
      }
    ]
  },
  "pressed_control": {
    "type": "panel",
    "size": ["100%c", "100%c"],
    "controls": [
      {
        "item_block@beacon.item_renderer": {
          "size": [16, 16],
          "offset": "$offset",
          "bindings": "$texture_bindings"
        }
      },
      {
        "non_renderer_item@chest_ui.non_renderer_item": {
          "offset": "$offset"
        }
      }
    ]
  },
  "inventory_button_amount": {
    "type": "panel",
    "offset": "$offset",
    "controls": [
      {
        "item_amount": {
          "type": "label",
          "offset": [0, 1],
          "shadow": true,
          "text_alignment": "left",
          "anchor_from": "bottom_right",
          "anchor_to": "bottom_right",
          "color": "$tool_tip_text",
          "layer": 4,
          "text": "#stack_size",
          "bindings": [
            {
              "binding_type": "collection",
              "binding_condition": "none",
              "binding_collection_name": "form_buttons"
            },
            {
              "binding_type": "collection_details",
              "binding_collection_name": "form_buttons"
            },
            {
              "binding_name": "#form_button_text",
              "binding_type": "collection",
              "binding_collection_name": "form_buttons"
            },
            {
              "binding_type": "view",
              "source_property_name": "((#form_button_text - 'stack#01') = #form_button_text)",
              "target_property_name": "#visible"
            },
            {
              "binding_type": "view",
              "source_property_name": "(('§z') + (('%.12s' * #form_button_text) - ('%.10s' * #form_button_text)))",
              "target_property_name": "#stack_size"
            }
          ]
        }
      }
    ]
  },
  "chest_item": {
    "type": "stack_panel",
    "size": [16, 16],
    "layer": 2,
    "controls": [
      {
        "chest_item@chest_ui.ui_chest_item": {}
      },
      {
        "inventory_item@chest_ui.ui_inventory_item": {}
      },
      {
        "hot_bar_item@chest_ui.ui_hot_bar_item": {}
      }
    ]
  }
}
