/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MatterDefinition } from "../MatterDefinition.js";
import {
  ClusterElement as Cluster,
  AttributeElement as Attribute,
  FieldElement as Field,
  CommandElement as Command,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const ServiceArea = Cluster(
  { name: "ServiceArea", id: 336, classification: "application" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 2 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "SELRUN", constraint: "0", title: "SelectWhileRunning" }),
    Field({ name: "PROG", constraint: "1", title: "ProgressReporting" }),
    Field({ name: "MAPS", constraint: "2", title: "Maps" })
  ),
  Attribute(
    { name: "SupportedAreas", id: 0, type: "list", access: "R V", conformance: "M", constraint: "max 255" },
    Field({ name: "entry", type: "AreaStruct" })
  ),
  Attribute(
    { name: "SupportedMaps", id: 1, type: "list", access: "R V", conformance: "MAPS", constraint: "max 255" },
    Field({ name: "entry", type: "MapStruct" })
  ),
  Attribute(
    {
      name: "SelectedAreas",
      id: 2,
      type: "list",
      access: "R V",
      conformance: "M",
      constraint: "desc",
      default: []
    },
    Field({ name: "entry", type: "uint32" })
  ),
  Attribute({
    name: "CurrentArea",
    id: 3,
    type: "uint32",
    access: "R V",
    conformance: "desc",
    constraint: "desc",
    default: null,
    quality: "X"
  }),
  Attribute({
    name: "EstimatedEndTime",
    id: 4,
    type: "epoch-s",
    access: "R V",
    conformance: "[CurrentArea]",
    default: null,
    quality: "X Q"
  }),
  Attribute(
    {
      name: "Progress",
      id: 5,
      type: "list",
      access: "R V",
      conformance: "PROG",
      constraint: "max 255",
      default: []
    },
    Field({ name: "entry", type: "ProgressStruct" })
  ),
  Command(
    {
      name: "SelectAreas",
      id: 0,
      access: "O",
      conformance: "M",
      direction: "request",
      response: "SelectAreasResponse"
    },
    Field(
      { name: "NewAreas", id: 0, type: "list", conformance: "M", constraint: "desc" },
      Field({ name: "entry", type: "uint32" })
    )
  ),
  Command(
    { name: "SelectAreasResponse", id: 1, access: "O", conformance: "M", direction: "response" },
    Field({ name: "Status", id: 0, type: "SelectAreasStatus", conformance: "M" }),
    Field({ name: "StatusText", id: 1, type: "string", conformance: "M", constraint: "max 256" })
  ),
  Command(
    {
      name: "SkipArea",
      id: 2,
      access: "O",
      conformance: "[CurrentArea | Progress]",
      direction: "request",
      response: "SkipAreaResponse"
    },
    Field({ name: "SkippedArea", id: 0, type: "uint32", conformance: "M", constraint: "desc" })
  ),
  Command(
    { name: "SkipAreaResponse", id: 3, access: "O", conformance: "SkipArea", direction: "response" },
    Field({ name: "Status", id: 0, type: "SkipAreaStatus", conformance: "M" }),
    Field({ name: "StatusText", id: 1, type: "string", conformance: "M", constraint: "max 256" })
  ),
  Datatype(
    { name: "LandmarkInfoStruct", type: "struct" },
    Field({ name: "LandmarkTag", id: 0, type: "tag", conformance: "M" }),
    Field({ name: "RelativePositionTag", id: 1, type: "tag", conformance: "M", quality: "X" })
  ),
  Datatype(
    { name: "AreaInfoStruct", type: "struct" },
    Field({ name: "LocationInfo", id: 0, type: "locationdesc", conformance: "M", quality: "X" }),
    Field({ name: "LandmarkInfo", id: 1, type: "LandmarkInfoStruct", conformance: "M", quality: "X" })
  ),
  Datatype(
    { name: "MapStruct", type: "struct" },
    Field({ name: "MapId", id: 0, type: "uint32", conformance: "M" }),
    Field({ name: "Name", id: 1, type: "string", conformance: "M", constraint: "max 64" })
  ),
  Datatype(
    { name: "AreaStruct", type: "struct" },
    Field({ name: "AreaId", id: 0, type: "uint32", conformance: "M" }),
    Field({ name: "MapId", id: 1, type: "uint32", conformance: "M", constraint: "desc", quality: "X" }),
    Field({ name: "AreaInfo", id: 2, type: "AreaInfoStruct", conformance: "M" })
  ),
  Datatype(
    { name: "ProgressStruct", type: "struct" },
    Field({ name: "AreaId", id: 0, type: "uint32", conformance: "M" }),
    Field({ name: "Status", id: 1, type: "OperationalStatusEnum", conformance: "M" }),
    Field({ name: "TotalOperationalTime", id: 2, type: "elapsed-s", conformance: "O", quality: "X" }),
    Field({ name: "EstimatedTime", id: 3, type: "elapsed-s", conformance: "O", quality: "X" })
  ),
  Datatype(
    { name: "OperationalStatusEnum", type: "enum8" },
    Field({ name: "Pending", id: 0, conformance: "M" }),
    Field({ name: "Operating", id: 1, conformance: "M" }),
    Field({ name: "Skipped", id: 2, conformance: "M" }),
    Field({ name: "Completed", id: 3, conformance: "M" })
  ),
  Datatype(
    { name: "SelectAreasStatus", type: "enum8" },
    Field({ name: "Success", id: 0, conformance: "M" }),
    Field({ name: "UnsupportedArea", id: 1, conformance: "M" }),
    Field({ name: "InvalidInMode", id: 2, conformance: "M" }),
    Field({ name: "InvalidSet", id: 3, conformance: "M" })
  ),
  Datatype(
    { name: "SkipAreaStatus", type: "enum8" },
    Field({ name: "Success", id: 0, conformance: "M" }),
    Field({ name: "InvalidAreaList", id: 1, conformance: "M" }),
    Field({ name: "InvalidInMode", id: 2, conformance: "M" }),
    Field({ name: "InvalidSkippedArea", id: 3, conformance: "M" })
  )
);
MatterDefinition.children.push(ServiceArea);
export {
  ServiceArea
};
//# sourceMappingURL=service-area.element.js.map
