{
	"$id": "https://yazi-rs.github.io/schemas/theme.json",
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"type": "object",
	"additionalProperties": true,
	"properties": {
		"$schema": {
			"default": "https://yazi-rs.github.io/schemas/theme.schema.json",
			"type": "string"
		},
		"flavor": {
			"type": "object",
			"properties": {
				"dark": { "type": "string" },
				"light": { "type": "string" }
			},
			"additionalProperties": false
		},
		"app": {
			"type": "object",
			"properties": {
				"overall": { "$ref": "#/$defs/style" }
			},
			"additionalProperties": false
		},
		"mgr": {
			"type": "object",
			"properties": {
				"cwd": {
					"$ref": "#/$defs/style"
				},
				"find_keyword": { "$ref": "#/$defs/style" },
				"find_position": { "$ref": "#/$defs/style" },
				"symlink_target": { "$ref": "#/$defs/style" },
				"marker_copied": { "$ref": "#/$defs/style" },
				"marker_cut": { "$ref": "#/$defs/style" },
				"marker_marked": { "$ref": "#/$defs/style" },
				"marker_selected": { "$ref": "#/$defs/style" },
				"marker_symbol": { "type": "string" },
				"count_copied": { "$ref": "#/$defs/style" },
				"count_cut": { "$ref": "#/$defs/style" },
				"count_selected": { "$ref": "#/$defs/style" },
				"border_symbol": { "type": "string" },
				"border_style": { "$ref": "#/$defs/style" },
				"syntect_theme": { "type": "string" }
			},
			"additionalProperties": false
		},
		"tabs": {
			"type": "object",
			"properties": {
				"active": { "$ref": "#/$defs/style" },
				"inactive": { "$ref": "#/$defs/style" },
				"sep_inner": {
					"type": "object",
					"properties": {
						"open": { "type": "string" },
						"close": { "type": "string" }
					},
					"additionalProperties": false
				},
				"sep_outer": {
					"type": "object",
					"properties": {
						"open": { "type": "string" },
						"close": { "type": "string" }
					},
					"additionalProperties": false
				}
			}
		},
		"mode": {
			"type": "object",
			"properties": {
				"normal_main": { "$ref": "#/$defs/style" },
				"normal_alt": { "$ref": "#/$defs/style" },
				"select_main": { "$ref": "#/$defs/style" },
				"select_alt": { "$ref": "#/$defs/style" },
				"unset_main": { "$ref": "#/$defs/style" },
				"unset_alt": { "$ref": "#/$defs/style" }
			},
			"additionalProperties": false
		},
		"indicator": {
			"type": "object",
			"properties": {
				"parent": { "$ref": "#/$defs/style" },
				"current": { "$ref": "#/$defs/style" },
				"preview": { "$ref": "#/$defs/style" },
				"padding": {
					"type": "object",
					"properties": {
						"open": { "type": "string" },
						"close": { "type": "string" }
					},
					"additionalProperties": false
				}
			},
			"additionalProperties": false
		},
		"status": {
			"type": "object",
			"properties": {
				"overall": { "$ref": "#/$defs/style" },
				"sep_left": {
					"type": "object",
					"properties": {
						"open": { "type": "string" },
						"close": { "type": "string" }
					},
					"additionalProperties": false
				},
				"sep_right": {
					"type": "object",
					"properties": {
						"open": { "type": "string" },
						"close": { "type": "string" }
					},
					"additionalProperties": false
				},
				"perm_sep": { "$ref": "#/$defs/style" },
				"perm_type": { "$ref": "#/$defs/style" },
				"perm_read": { "$ref": "#/$defs/style" },
				"perm_write": { "$ref": "#/$defs/style" },
				"perm_exec": { "$ref": "#/$defs/style" },
				"progress_label": { "$ref": "#/$defs/style" },
				"progress_normal": { "$ref": "#/$defs/style" },
				"progress_error": { "$ref": "#/$defs/style" }
			},
			"additionalProperties": false
		},
		"which": {
			"type": "object",
			"properties": {
				"border": { "$ref": "#/$defs/style" },
				"cols": { "type": "integer", "minimum": 1, "maximum": 3 },
				"mask": { "$ref": "#/$defs/style" },
				"cand": { "$ref": "#/$defs/style" },
				"rest": { "$ref": "#/$defs/style" },
				"desc": { "$ref": "#/$defs/style" },
				"separator": { "type": "string" },
				"separator_style": { "$ref": "#/$defs/style" }
			},
			"additionalProperties": false
		},
		"confirm": {
			"type": "object",
			"properties": {
				"border": { "$ref": "#/$defs/style" },
				"title": { "$ref": "#/$defs/style" },
				"body": { "$ref": "#/$defs/style" },
				"list": { "$ref": "#/$defs/style" },
				"btn_yes": { "$ref": "#/$defs/style" },
				"btn_no": { "$ref": "#/$defs/style" },
				"btn_labels": {
					"type": "array",
					"items": { "type": "string" },
					"minItems": 2,
					"maxItems": 2
				}
			},
			"additionalProperties": false
		},
		"spot": {
			"type": "object",
			"properties": {
				"border": { "$ref": "#/$defs/style" },
				"title": { "$ref": "#/$defs/style" },
				"tbl_col": { "$ref": "#/$defs/style" },
				"tbl_cell": { "$ref": "#/$defs/style" }
			},
			"additionalProperties": false
		},
		"notify": {
			"type": "object",
			"properties": {
				"title_info": { "$ref": "#/$defs/style" },
				"title_warn": { "$ref": "#/$defs/style" },
				"title_error": { "$ref": "#/$defs/style" },
				"icon_info": { "type": "string" },
				"icon_warn": { "type": "string" },
				"icon_error": { "type": "string" }
			},
			"additionalProperties": false
		},
		"pick": {
			"type": "object",
			"properties": {
				"border": { "$ref": "#/$defs/style" },
				"active": { "$ref": "#/$defs/style" },
				"inactive": { "$ref": "#/$defs/style" }
			},
			"additionalProperties": false
		},
		"input": {
			"type": "object",
			"properties": {
				"border": { "$ref": "#/$defs/style" },
				"title": { "$ref": "#/$defs/style" },
				"value": { "$ref": "#/$defs/style" },
				"selected": { "$ref": "#/$defs/style" }
			},
			"additionalProperties": false
		},
		"cmp": {
			"type": "object",
			"properties": {
				"border": { "$ref": "#/$defs/style" },
				"active": { "$ref": "#/$defs/style" },
				"inactive": { "$ref": "#/$defs/style" },
				"icon_file": { "type": "string" },
				"icon_folder": { "type": "string" },
				"icon_command": { "type": "string" }
			},
			"additionalProperties": false
		},
		"tasks": {
			"type": "object",
			"properties": {
				"border": { "$ref": "#/$defs/style" },
				"title": { "$ref": "#/$defs/style" },
				"hovered": { "$ref": "#/$defs/style" }
			},
			"additionalProperties": false
		},
		"help": {
			"type": "object",
			"properties": {
				"border": { "$ref": "#/$defs/style" },
				"chord": { "$ref": "#/$defs/style" },
				"action": { "$ref": "#/$defs/style" },
				"hovered": { "$ref": "#/$defs/style" }
			},
			"additionalProperties": false
		},
		"filetype": {
			"type": "object",
			"properties": {
				"rules": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"fg": { "$ref": "#/$defs/color" },
							"bg": { "$ref": "#/$defs/color" },
							"bold": { "type": "boolean" },
							"dim": { "type": "boolean" },
							"italic": { "type": "boolean" },
							"underline": { "type": "boolean" },
							"blink": { "type": "boolean" },
							"blink_rapid": { "type": "boolean" },
							"reversed": { "type": "boolean" },
							"hidden": { "type": "boolean" },
							"crossed": { "type": "boolean" },
							"mime": { "type": "string" },
							"url": { "type": "string" },
							"is": { "type": "string" }
						},
						"anyOf": [
							{
								"required": ["mime"]
							},
							{
								"required": ["url"]
							}
						],
						"additionalProperties": false
					}
				}
			},
			"additionalProperties": false
		},
		"icon": {
			"type": "object",
			"properties": {
				"globs": { "$ref": "#/$defs/glob_rules" },
				"prepend_globs": { "$ref": "#/$defs/glob_rules" },
				"append_globs": { "$ref": "#/$defs/glob_rules" },
				"dirs": { "$ref": "#/$defs/icon_rules" },
				"prepend_dirs": { "$ref": "#/$defs/icon_rules" },
				"append_dirs": { "$ref": "#/$defs/icon_rules" },
				"files": { "$ref": "#/$defs/icon_rules" },
				"prepend_files": { "$ref": "#/$defs/icon_rules" },
				"append_files": { "$ref": "#/$defs/icon_rules" },
				"exts": { "$ref": "#/$defs/icon_rules" },
				"prepend_exts": { "$ref": "#/$defs/icon_rules" },
				"append_exts": { "$ref": "#/$defs/icon_rules" },
				"conds": { "$ref": "#/$defs/cond_rules" },
				"prepend_conds": { "$ref": "#/$defs/cond_rules" },
				"append_conds": { "$ref": "#/$defs/cond_rules" }
			},
			"additionalProperties": false
		}
	},
	"$defs": {
		"color": {
			"oneOf": [
				{
					"type": "string",
					"pattern": "^#([0-9A-Fa-f]{6})$"
				},
				{
					"enum": [
						"reset",
						"black",
						"white",
						"red",
						"lightred",
						"green",
						"lightgreen",
						"yellow",
						"lightyellow",
						"blue",
						"lightblue",
						"magenta",
						"lightmagenta",
						"cyan",
						"lightcyan",
						"gray",
						"darkgray"
					]
				}
			]
		},
		"style": {
			"type": "object",
			"properties": {
				"fg": { "$ref": "#/$defs/color" },
				"bg": { "$ref": "#/$defs/color" },
				"bold": { "type": "boolean" },
				"dim": { "type": "boolean" },
				"italic": { "type": "boolean" },
				"underline": { "type": "boolean" },
				"blink": { "type": "boolean" },
				"blink_rapid": { "type": "boolean" },
				"reversed": { "type": "boolean" },
				"hidden": { "type": "boolean" },
				"crossed": { "type": "boolean" }
			}
		},
		"glob_rules": {
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"url": { "type": "string" },
					"text": { "type": "string" },
					"fg": { "$ref": "#/$defs/color" }
				},
				"required": ["url", "text"]
			}
		},
		"icon_rules": {
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"name": { "type": "string" },
					"text": { "type": "string" },
					"fg": { "$ref": "#/$defs/color" }
				},
				"required": ["name", "text"]
			}
		},
		"cond_rules": {
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"if": { "type": "string" },
					"text": { "type": "string" },
					"fg": { "$ref": "#/$defs/color" }
				},
				"anyOf": [
					{ "required": ["if", "text"] },
					{ "required": ["if", "fg"] }
				]
			}
		}
	}
}
