"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var ota_software_update_requestor_element_exports = {};
__export(ota_software_update_requestor_element_exports, {
  OtaSoftwareUpdateRequestor: () => OtaSoftwareUpdateRequestor
});
module.exports = __toCommonJS(ota_software_update_requestor_element_exports);
var import_MatterDefinition = require("../MatterDefinition.js");
var import_elements = require("../../elements/index.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const OtaSoftwareUpdateRequestor = (0, import_elements.ClusterElement)(
  { name: "OtaSoftwareUpdateRequestor", id: 42, classification: "node" },
  (0, import_elements.AttributeElement)({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 1 }),
  (0, import_elements.AttributeElement)(
    {
      name: "DefaultOtaProviders",
      id: 0,
      type: "list",
      access: "RW F VA",
      conformance: "M",
      constraint: "desc",
      default: [],
      quality: "N"
    },
    (0, import_elements.FieldElement)({ name: "entry", type: "ProviderLocation" })
  ),
  (0, import_elements.AttributeElement)({ name: "UpdatePossible", id: 1, type: "bool", access: "R V", conformance: "M", default: true }),
  (0, import_elements.AttributeElement)({ name: "UpdateState", id: 2, type: "UpdateStateEnum", access: "R V", conformance: "M", default: 0 }),
  (0, import_elements.AttributeElement)({
    name: "UpdateStateProgress",
    id: 3,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "0 to 100",
    default: null,
    quality: "X Q"
  }),
  (0, import_elements.EventElement)(
    { name: "StateTransition", id: 0, access: "V", conformance: "M", priority: "info" },
    (0, import_elements.FieldElement)({ name: "PreviousState", id: 0, type: "UpdateStateEnum", conformance: "M", default: 0 }),
    (0, import_elements.FieldElement)({ name: "NewState", id: 1, type: "UpdateStateEnum", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Reason", id: 2, type: "ChangeReasonEnum", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "TargetSoftwareVersion", id: 3, type: "uint32", conformance: "M", default: null, quality: "X" })
  ),
  (0, import_elements.EventElement)(
    { name: "VersionApplied", id: 1, access: "V", conformance: "M", priority: "critical" },
    (0, import_elements.FieldElement)({ name: "SoftwareVersion", id: 0, type: "uint32", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ProductId", id: 1, type: "uint16", conformance: "M" })
  ),
  (0, import_elements.EventElement)(
    { name: "DownloadError", id: 2, access: "V", conformance: "M", priority: "info" },
    (0, import_elements.FieldElement)({ name: "SoftwareVersion", id: 0, type: "uint32", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "BytesDownloaded", id: 1, type: "uint64", conformance: "M" }),
    (0, import_elements.FieldElement)({
      name: "ProgressPercent",
      id: 2,
      type: "uint8",
      conformance: "M",
      constraint: "0 to 100",
      default: null,
      quality: "X"
    }),
    (0, import_elements.FieldElement)({ name: "PlatformCode", id: 3, type: "int64", conformance: "M", default: null, quality: "X" })
  ),
  (0, import_elements.CommandElement)(
    {
      name: "AnnounceOtaProvider",
      id: 0,
      access: "A",
      conformance: "O",
      direction: "request",
      response: "status"
    },
    (0, import_elements.FieldElement)({ name: "ProviderNodeId", id: 0, type: "node-id", access: "F", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "VendorId", id: 1, type: "vendor-id", access: "F", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "AnnouncementReason", id: 2, type: "AnnouncementReasonEnum", access: "F", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MetadataForNode", id: 3, type: "octstr", access: "F", conformance: "O", constraint: "max 512" }),
    (0, import_elements.FieldElement)({ name: "Endpoint", id: 4, type: "endpoint-no", access: "F", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "AnnouncementReasonEnum", type: "enum8" },
    (0, import_elements.FieldElement)({ name: "SimpleAnnouncement", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "UpdateAvailable", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "UrgentUpdateAvailable", id: 2, conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "UpdateStateEnum", type: "enum8" },
    (0, import_elements.FieldElement)({ name: "Unknown", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Idle", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Querying", id: 2, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "DelayedOnQuery", id: 3, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Downloading", id: 4, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Applying", id: 5, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "DelayedOnApply", id: 6, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "RollingBack", id: 7, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "DelayedOnUserConsent", id: 8, conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "ChangeReasonEnum", type: "enum8" },
    (0, import_elements.FieldElement)({ name: "Unknown", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Success", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Failure", id: 2, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "TimeOut", id: 3, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "DelayByProvider", id: 4, conformance: "O" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "ProviderLocation", type: "struct" },
    (0, import_elements.FieldElement)({ name: "ProviderNodeId", id: 1, type: "node-id", access: "F", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Endpoint", id: 2, type: "endpoint-no", access: "F", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  )
);
import_MatterDefinition.MatterDefinition.children.push(OtaSoftwareUpdateRequestor);
//# sourceMappingURL=ota-software-update-requestor.element.js.map
