{
  "Type": "Window",
  "Id": "leaders",
  "Title": "Commanders",
  "Icon": {
    "Type": "Asset",
    "Id": "UI/Icons/leaders.png"
  },
  "Classes": [
    "ps-window-holo"
  ],
  "State": "Maximized",
  "DisplayLocation": "Taskbar",
  "WindowGroup": "static_menu",
  "IsRestorable": false,
  "IsMinimizable": false,
  "Width": "100%",
  "Height": "100%",
  "Children": [
    {
      "Type": "Grid",
      "Id": "leaders_layout",
      "Width": "100%",
      "Height": "100%",
      "Flex": "1",
      "HorizontalAlignment": "Stretch",
      "VerticalAlignment": "Stretch",
      "ColumnDefinitions": [
        "320px",
        "16px",
        "1fr"
      ],
      "RowDefinitions": [
        "auto",
        "1fr",
        "auto"
      ],
      "Children": [
        {
          "Type": "Grid",
          "Id": "leaders_header",
          "Grid.Column": 0,
          "Grid.ColumnSpan": 3,
          "Grid.Row": 0,
          "Width": "100%",
          "ColumnDefinitions": [
            "1fr",
            "auto"
          ],
          "Children": [
            {
              "Type": "Checkbox",
              "Id": "leaders_auto_assign",
              "Grid.Column": 1,
              "Grid.Row": 0,
              "Label": "Automated Assignments",
              "IsChecked": false,
              "Command": "core.leaders_toggle_auto_assign"
            }
          ]
        },
        {
          "Type": "Grid",
          "Id": "leaders_content_grid",
          "Grid.Column": 0,
          "Grid.ColumnSpan": 3,
          "Grid.Row": 1,
          "Width": "100%",
          "Height": "100%",
          "Flex": "1",
          "VerticalAlignment": "Stretch",
          "ColumnDefinitions": [
            "320px",
            "16px",
            "1fr"
          ],
          "RowDefinitions": [
            "1fr"
          ],
          "Children": [
            {
              "Type": "Grid",
              "Id": "leaders_left_panel",
              "Grid.Column": 0,
              "Grid.Row": 0,
              "Width": "320px",
              "Height": "100%",
              "Flex": "1",
              "RowDefinitions": [
                "auto",
                "1fr"
              ],
              "Children": [
                {
                  "Type": "Input",
                  "Id": "leaders_tree_filter",
                  "Grid.Row": 0,
                  "Placeholder": "Search leaders\u2026",
                  "CommitOnInput": true,
                  "Command": "core.leaders_set_tree_filter"
                },
                {
                  "Type": "Tree",
                  "Id": "leaders_tree",
                  "Grid.Row": 1,
                  "Width": "320px",
                  "Height": "100%",
                  "VerticalAlignment": "Stretch",
                  "EnableVerticalScroll": true,
                  "DragDropEnabled": true,
                  "AllowReorder": true,
                  "AllowReparenting": true,
                  "ShowDragHandle": true,
                  "OnNodeMoved": "core.leaders_node_moved"
                }
              ]
            },
            {
              "Type": "Panel",
              "Id": "leaders_right_panel",
              "Grid.Column": 2,
              "Grid.Row": 0,
              "Width": "100%",
              "Height": "100%",
              "HorizontalAlignment": "Stretch",
              "VerticalAlignment": "Stretch",
              "Classes": [
                "ps-panel--borderless"
              ],
              "Padding": "0",
              "Children": [
                {
                  "Type": "ScrollBox",
                  "Id": "leaders_detail_scroll",
                  "Axis": "Both",
                  "Width": "100%",
                  "Height": "100%",
                  "Classes": [
                    "ps-scrollbox--borderless"
                  ],
                  "Children": [
                    {
                      "Type": "Grid",
                      "Id": "leaders_detail_stack",
                      "RowDefinitions": [
                        "28px",
                        "1fr"
                      ],
                      "ColumnDefinitions": [
                        "1fr"
                      ],
                      "Width": "100%",
                      "Height": "100%",
                      "Children": [
                        {
                          "Type": "Breadcrumbs",
                          "Id": "leaders_breadcrumbs",
                          "Grid.Row": 0,
                          "Grid.Column": 0,
                          "Width": "100%",
                          "SeparatorStyle": "chevron",
                          "Classes": [
                            "ps-breadcrumbs--compact"
                          ],
                          "Path": []
                        },
                        {
                          "Type": "Grid",
                          "Id": "leaders_body_grid",
                          "Grid.Row": 1,
                          "Grid.Column": 0,
                          "ColumnDefinitions": [
                            "1fr"
                          ],
                          "RowDefinitions": [
                            "1fr",
                            "1fr"
                          ],
                          "Gap": 16,
                          "Width": "100%",
                          "Height": "100%",
                          "VerticalAlignment": "Stretch",
                          "Children": [
                            {
                              "Type": "StackPanel",
                              "Grid.Column": 0,
                              "Grid.Row": 0,
                              "Orientation": "Vertical",
                              "Gap": 12,
                              "VerticalAlignment": "Top",
                              "Children": [
                                {
                                  "Type": "Alert",
                                  "Id": "leaders_detail_empty",
                                  "HorizontalAlignment": "Center",
                                  "VerticalAlignment": "Center",
                                  "Severity": "Info",
                                  "IsDismissible": false,
                                  "Message": "Select a leader to view details.",
                                  "Children": [
                                    {
                                      "Type": "Label",
                                      "Text": "",
                                      "Style": "Label.Subheading"
                                    }
                                  ]
                                },
                                {
                                  "Type": "StackPanel",
                                  "Id": "leaders_detail_sections",
                                  "Orientation": "Vertical",
                                  "Gap": 12,
                                  "IsVisible": false,
                                  "Children": [
                                    {
                                      "Type": "Grid",
                                      "Id": "leaders_row1_grid",
                                      "ColumnDefinitions": [
                                        "1fr",
                                        "1fr",
                                        "1fr"
                                      ],
                                      "RowDefinitions": [
                                        "auto"
                                      ],
                                      "Children": [
                                        {
                                          "Type": "Panel",
                                          "Id": "leaders_row1_left",
                                          "Grid.Column": 0,
                                          "Grid.Row": 0,
                                          "Margin": "0 0 8 0",
                                          "Classes": [
                                            "ps-panel--borderless"
                                          ],
                                          "Children": [
                                            {
                                              "Type": "StackPanel",
                                              "Orientation": "Vertical",
                                              "Gap": 8,
                                              "Children": [
                                                {
                                                  "Type": "PropertyGrid",
                                                  "Id": "leaders_profile_grid",
                                                  "Sections": []
                                                },
                                                {
                                                  "Type": "StackPanel",
                                                  "Orientation": "Horizontal",
                                                  "Gap": 16,
                                                  "Children": [
                                                    {
                                                      "Type": "Checkbox",
                                                      "Id": "leaders_story_character",
                                                      "Label": "Story Character",
                                                      "IsChecked": false,
                                                      "Command": "core.leaders_toggle_story_character"
                                                    },
                                                    {
                                                      "Type": "Checkbox",
                                                      "Id": "leaders_do_not_promote",
                                                      "Label": "Do Not Promote",
                                                      "IsChecked": false,
                                                      "Command": "core.leaders_toggle_do_not_promote"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "Type": "Panel",
                                          "Id": "leaders_row1_center",
                                          "Grid.Column": 1,
                                          "Grid.Row": 0,
                                          "Margin": "0 8 0 0",
                                          "Classes": [
                                            "ps-panel--borderless"
                                          ],
                                          "Children": [
                                            {
                                              "Type": "PropertyGrid",
                                              "Id": "leaders_stats_grid",
                                              "Sections": []
                                            }
                                          ]
                                        },
                                        {
                                          "Type": "Panel",
                                          "Id": "leaders_row1_right",
                                          "Grid.Column": 2,
                                          "Grid.Row": 0,
                                          "Classes": [
                                            "ps-panel--borderless"
                                          ],
                                          "Children": [
                                            {
                                              "Type": "Label",
                                              "Text": "History",
                                              "Style": "Label.Subheading"
                                            },
                                            {
                                              "Type": "DataGrid",
                                              "Id": "leaders_history_grid",
                                              "SelectionMode": "None",
                                              "Columns": [
                                                {
                                                  "Header": "Date",
                                                  "Field": "date",
                                                  "Width": "120px"
                                                },
                                                {
                                                  "Header": "Event",
                                                  "Field": "event",
                                                  "Width": "1fr"
                                                }
                                              ],
                                              "Rows": []
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "Type": "Grid",
                              "Grid.Column": 0,
                              "Grid.Row": 1,
                              "Columns": [
                                "1fr",
                                "2fr"
                              ],
                              "Rows": [
                                "auto"
                              ],
                              "Gap": 8,
                              "VerticalAlignment": "Top",
                              "Children": [
                                {
                                  "Type": "StackPanel",
                                  "Grid.Column": 0,
                                  "Orientation": "Vertical",
                                  "Gap": 8,
                                  "Children": [
                                    {
                                      "Type": "StackPanel",
                                      "Orientation": "Horizontal",
                                      "Gap": 8,
                                      "Children": [
                                        {
                                          "Type": "Select",
                                          "Id": "leaders_assignment_type_select",
                                          "Width": "260px",
                                          "Value": "",
                                          "Options": [],
                                          "Command": "core.leaders_assign_type_change"
                                        },
                                        {
                                          "Type": "Checkbox",
                                          "Id": "leaders_eligible_only",
                                          "Label": "Eligible Only",
                                          "IsChecked": false,
                                          "Command": "core.leaders_toggle_eligible_only"
                                        },
                                        {
                                          "Type": "Checkbox",
                                          "Id": "leaders_available_only",
                                          "Label": "Available Only",
                                          "IsChecked": false,
                                          "Command": "core.leaders_toggle_available_only"
                                        }
                                      ]
                                    },
                                    {
                                      "Type": "DataGrid",
                                      "Id": "leaders_assignment_grid",
                                      "SelectionMode": "Single",
                                      "OnSelectionChanged": "core.leaders_assignment_select",
                                      "Columns": [
                                        {
                                          "Header": "Rank",
                                          "Field": "rank",
                                          "Width": "50px"
                                        },
                                        {
                                          "Header": "Assignment",
                                          "Field": "assignment",
                                          "Width": "1fr"
                                        }
                                      ],
                                      "Rows": []
                                    }
                                  ]
                                },
                                {
                                  "Type": "StackPanel",
                                  "Grid.Column": 1,
                                  "Id": "leaders_search_panel",
                                  "Orientation": "Vertical",
                                  "Gap": 4,
                                  "Children": [
                                    {
                                      "Type": "StackPanel",
                                      "Orientation": "Horizontal",
                                      "Gap": 8,
                                      "VerticalAlignment": "Center",
                                      "Children": [
                                        {
                                          "Type": "Select",
                                          "Id": "leaders_search_type_select",
                                          "Width": "200px",
                                          "Placeholder": "Commander Type",
                                          "Value": "",
                                          "Options": [],
                                          "Command": "core.leaders_search_type_change"
                                        },
                                        {
                                          "Type": "Label",
                                          "Text": "Minimum Rank"
                                        },
                                        {
                                          "Type": "Select",
                                          "Id": "leaders_search_min_rank_select",
                                          "Width": "150px",
                                          "Value": "",
                                          "Options": [],
                                          "Command": "core.leaders_search_min_rank_change"
                                        },
                                        {
                                          "Type": "Label",
                                          "Text": "Maximum Rank"
                                        },
                                        {
                                          "Type": "Select",
                                          "Id": "leaders_search_max_rank_select",
                                          "Width": "150px",
                                          "Value": "",
                                          "Options": [],
                                          "Command": "core.leaders_search_max_rank_change"
                                        }
                                      ]
                                    },
                                    {
                                      "Type": "StackPanel",
                                      "Orientation": "Horizontal",
                                      "Gap": 8,
                                      "Children": [
                                        {
                                          "Type": "Select",
                                          "Id": "leaders_search_sort1_select",
                                          "Width": "160px",
                                          "Value": "",
                                          "Options": [],
                                          "Command": "core.leaders_search_sort1_change"
                                        },
                                        {
                                          "Type": "Select",
                                          "Id": "leaders_search_sort2_select",
                                          "Width": "160px",
                                          "Value": "",
                                          "Options": [],
                                          "Command": "core.leaders_search_sort2_change"
                                        },
                                        {
                                          "Type": "Select",
                                          "Id": "leaders_search_sort3_select",
                                          "Width": "160px",
                                          "Value": "",
                                          "Options": [],
                                          "Command": "core.leaders_search_sort3_change"
                                        },
                                        {
                                          "Type": "Select",
                                          "Id": "leaders_search_sort4_select",
                                          "Width": "160px",
                                          "Value": "",
                                          "Options": [],
                                          "Command": "core.leaders_search_sort4_change"
                                        }
                                      ]
                                    },
                                    {
                                      "Type": "DataGrid",
                                      "Id": "leaders_search_grid",
                                      "SelectionMode": "Single",
                                      "OnSelectionChanged": "core.leaders_search_select",
                                      "Columns": [
                                        {
                                          "Header": "Rank",
                                          "Field": "rank",
                                          "Width": "50px"
                                        },
                                        {
                                          "Header": "Commander",
                                          "Field": "name",
                                          "Width": "1fr"
                                        },
                                        {
                                          "Header": "Assignment",
                                          "Field": "assignment",
                                          "Width": "1fr"
                                        }
                                      ],
                                      "Rows": []
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "Type": "WrapPanel",
      "Id": "leaders_action_bar",
      "Grid.Column": 2,
      "Grid.Row": 2,
      "Orientation": "Horizontal",
      "Gap": 6,
      "Width": "100%",
      "Margin": "8px 0 0 0",
      "Children": [
        {
          "Type": "Button",
          "Id": "leaders_btn_rename",
          "Text": "Rename",
          "Command": "core.leaders_rename_open_btn",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_auto_rename",
          "Text": "Auto Rename",
          "Command": "core.leaders_auto_rename",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_assign",
          "Text": "Assign",
          "Command": "core.leaders_assign",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_unassign",
          "Text": "Unassign",
          "Command": "core.leaders_unassign",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_retire",
          "Text": "Retire",
          "Command": "core.leaders_retire",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_reassign_naval",
          "Text": "Reassign Naval",
          "Command": "core.leaders_reassign_naval_confirm",
          "IsEnabled": true
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_auto_rename_all",
          "Text": "Auto Rename All",
          "Command": "core.leaders_auto_rename_all",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_hide_medal_row",
          "Text": "Hide Medal Row",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_manage_medals",
          "Text": "Manage Medals",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_award_medals",
          "Text": "Award Medals",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_add_rank",
          "Text": "Add Rank",
          "Command": "core.leaders_add_rank_open",
          "IsEnabled": false
        },
        {
          "Type": "Button",
          "Id": "leaders_btn_delete_rank",
          "Text": "Delete Rank",
          "Command": "core.leaders_delete_rank_confirm",
          "IsEnabled": false
        }
      ]
    },
    {
      "Type": "Modal",
      "Id": "leaders_rename_modal",
      "IsVisible": false,
      "IsDismissible": true,
      "CloseOnBackdropClick": true,
      "CloseOnEscape": true,
      "Title": "Rename leader",
      "BadgeText": "Edit",
      "BadgeVariant": "edit",
      "CloseCommand": "core.leaders_rename_cancel",
      "Size": "Small",
      "Children": [
        {
          "Type": "StackPanel",
          "Orientation": "Vertical",
          "Gap": 8,
          "Children": [
            {
              "Type": "Label",
              "Id": "leaders_rename_prompt",
              "Text": "Enter a new name:"
            },
            {
              "Type": "Input",
              "Id": "leaders_rename_input",
              "Placeholder": "Name",
              "CommitOnInput": true,
              "Command": "core.leaders_rename_set_text"
            },
            {
              "Type": "StackPanel",
              "Orientation": "Horizontal",
              "HorizontalAlignment": "Right",
              "Gap": 8,
              "Margin": "10 0 0 0",
              "Children": [
                {
                  "Type": "Button",
                  "Text": "Back",
                  "Command": "core.leaders_rename_cancel"
                },
                {
                  "Type": "Button",
                  "Id": "leaders_rename_confirm",
                  "Text": "Rename",
                  "Command": "core.leaders_rename_commit"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "Type": "Modal",
      "Id": "leaders_assign_error_modal",
      "IsVisible": false,
      "IsDismissible": true,
      "CloseOnBackdropClick": true,
      "CloseOnEscape": true,
      "Title": "Assignment Error",
      "BadgeVariant": "warning",
      "CloseCommand": "core.leaders_assign_error_close",
      "Size": "Small",
      "Children": [
        {
          "Type": "Label",
          "Id": "leaders_assign_error_text",
          "Text": ""
        }
      ]
    },
    {
      "Type": "Modal",
      "Id": "leaders_reassign_confirm_modal",
      "IsVisible": false,
      "IsDismissible": true,
      "CloseOnBackdropClick": true,
      "CloseOnEscape": true,
      "Title": "Confirmation Required",
      "BadgeText": "Warning",
      "BadgeVariant": "warn",
      "AccentVariant": "Warning",
      "DisplayMode": "Glow",
      "CloseCommand": "core.leaders_reassign_naval_cancel",
      "Size": "Small",
      "Children": [
        {
          "Type": "Label",
          "Id": "leaders_reassign_confirm_text",
          "Text": "Are you sure you wish to unassign all naval commanders and run automated assignment?"
        }
      ],
      "FooterChildren": [
        {
          "Type": "Button",
          "Id": "leaders_reassign_confirm_btn",
          "Text": "Confirm",
          "Style": "Warning",
          "Command": "core.leaders_reassign_naval_execute"
        },
        {
          "Type": "Button",
          "Id": "leaders_reassign_cancel_btn",
          "Text": "Cancel",
          "Command": "core.leaders_reassign_naval_cancel"
        }
      ]
    },
    {
      "Type": "Modal",
      "Id": "leaders_add_rank_modal",
      "IsVisible": false,
      "IsDismissible": true,
      "CloseOnBackdropClick": true,
      "CloseOnEscape": true,
      "Title": "Add Rank",
      "CloseCommand": "core.leaders_add_rank_cancel",
      "Size": "Small",
      "Children": [
        {
          "Type": "StackPanel",
          "Orientation": "Vertical",
          "Gap": 8,
          "Children": [
            {
              "Type": "Label",
              "Text": "Enter Rank Name:"
            },
            {
              "Type": "Input",
              "Id": "leaders_add_rank_name",
              "Placeholder": "Rank name",
              "CommitOnInput": true,
              "Command": "core.leaders_add_rank_set_name"
            },
            {
              "Type": "Label",
              "Text": "Enter Rank Abbreviation:"
            },
            {
              "Type": "Input",
              "Id": "leaders_add_rank_abbrev",
              "Placeholder": "Abbreviation",
              "CommitOnInput": true,
              "Command": "core.leaders_add_rank_set_abbrev"
            }
          ]
        }
      ],
      "FooterChildren": [
        {
          "Type": "Button",
          "Id": "leaders_add_rank_confirm_btn",
          "Text": "Add",
          "Style": "Primary",
          "Command": "core.leaders_add_rank_confirm"
        },
        {
          "Type": "Button",
          "Id": "leaders_add_rank_cancel_btn",
          "Text": "Cancel",
          "Command": "core.leaders_add_rank_cancel"
        }
      ]
    },
    {
      "Type": "Modal",
      "Id": "leaders_delete_rank_modal",
      "IsVisible": false,
      "IsDismissible": true,
      "CloseOnBackdropClick": true,
      "CloseOnEscape": true,
      "Title": "Delete Rank",
      "BadgeText": "Warning",
      "BadgeVariant": "warn",
      "AccentVariant": "Warning",
      "DisplayMode": "Glow",
      "CloseCommand": "core.leaders_delete_rank_cancel",
      "Size": "Small",
      "Children": [
        {
          "Type": "Label",
          "Id": "leaders_delete_rank_text",
          "Text": ""
        }
      ],
      "FooterChildren": [
        {
          "Type": "Button",
          "Id": "leaders_delete_rank_confirm_btn",
          "Text": "Delete",
          "Style": "Warning",
          "Command": "core.leaders_delete_rank_execute"
        },
        {
          "Type": "Button",
          "Id": "leaders_delete_rank_cancel_btn",
          "Text": "Cancel",
          "Command": "core.leaders_delete_rank_cancel"
        }
      ]
    }
  ],
  "Background": "rgba(0,0,0,0.85)",
  "Padding": "16"
}
