{
  "$defs": {
    "LayerRef": {
      "additionalProperties": true,
      "description": "A reference to a renderable layer.\n\n`id` is application-defined — the conforming app must be able to\nresolve it to a layer in its own catalogue. Per-layer rendering hints\nbeyond the universal set (`visible`, `opacity`) belong in extensions\nand are expressed as namespaced extra keys\n(e.g. `\"raster-styling:palettes\": [...]`).",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "opacity": {
          "anyOf": [
            {
              "maximum": 1.0,
              "minimum": 0.0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Opacity"
        },
        "visible": {
          "default": true,
          "title": "Visible",
          "type": "boolean"
        }
      },
      "required": [
        "id"
      ],
      "title": "LayerRef",
      "type": "object"
    },
    "TimeWindow": {
      "description": "Time selection.\n\nEither a single `instant` OR a closed range `{start, end}` — the two\nare mutually exclusive. All fields `None` is allowed and means\n\"app default time.\"",
      "properties": {
        "end": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "date",
              "type": "string"
            },
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "End"
        },
        "instant": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "date",
              "type": "string"
            },
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Instant"
        },
        "start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "format": "date",
              "type": "string"
            },
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Start"
        }
      },
      "title": "TimeWindow",
      "type": "object"
    }
  },
  "$id": "https://geoui-intent-protocol.pages.dev/ext/compare/v1.0.0/schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Typed view of the ``compare:*`` fields on a GeoIntent.",
  "properties": {
    "active_side": {
      "default": "A",
      "description": "Which side is active / in front.",
      "enum": [
        "A",
        "B"
      ],
      "title": "Active Side",
      "type": "string"
    },
    "layers": {
      "description": "The B-side layer stack (the A side is the root layers).",
      "items": {
        "$ref": "#/$defs/LayerRef"
      },
      "minItems": 1,
      "title": "Layers",
      "type": "array"
    },
    "mode": {
      "default": "swipe",
      "description": "swipe (split), spy (lens) or opacity (blend).",
      "enum": [
        "swipe",
        "spy",
        "opacity"
      ],
      "title": "Mode",
      "type": "string"
    },
    "time": {
      "anyOf": [
        {
          "$ref": "#/$defs/TimeWindow"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Time for the B side; defaults to the root time."
    },
    "value": {
      "default": 50,
      "description": "Swiper position or opacity, 0–100.",
      "maximum": 100,
      "minimum": 0,
      "title": "Value",
      "type": "integer"
    }
  },
  "required": [
    "layers"
  ],
  "title": "CompareFields",
  "type": "object",
  "x-geoui": {
    "keys": [
      "compare:layers",
      "compare:active_side",
      "compare:time",
      "compare:mode",
      "compare:value"
    ],
    "name": "compare",
    "required": [
      "compare:layers"
    ],
    "scope": "intent",
    "summary": "Compare two layer stacks or two dates side by side (swipe, spy or opacity blend)."
  }
}
