/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MutableCluster } from "../cluster/mutation/MutableCluster.js";
import { OptionalFixedAttribute, FixedAttribute, Attribute } from "../cluster/Cluster.js";
import { TlvString } from "../tlv/TlvString.js";
import { TlvVendorId } from "../datatype/VendorId.js";
import { TlvUInt16, TlvEnum } from "../tlv/TlvNumber.js";
import { TlvField, TlvObject } from "../tlv/TlvObject.js";
import { TlvArray } from "../tlv/TlvArray.js";
import { AccessLevel } from "#model";
import { ClusterRegistry } from "../cluster/ClusterRegistry.js";
var ApplicationBasic;
((ApplicationBasic2) => {
  ApplicationBasic2.TlvApplication = TlvObject({
    /**
     * This field shall indicate the Connectivity Standards Alliance issued vendor ID for the catalog. The DIAL
     * registry shall use value 0x0000.
     *
     * It is assumed that Content App Platform providers (see Video Player Architecture section in [MatterDevLib])
     * will have their own catalog vendor ID (set to their own Vendor ID) and will assign an ApplicationID to each
     * Content App.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.3.4.2.1
     */
    catalogVendorId: TlvField(0, TlvUInt16),
    /**
     * This field shall indicate the application identifier, expressed as a string, such as "123456-5433",
     * "PruneVideo" or "Company X". This field shall be unique within a catalog.
     *
     * For the DIAL registry catalog, this value shall be the DIAL prefix.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.3.4.2.2
     */
    applicationId: TlvField(1, TlvString)
  });
  let ApplicationStatus;
  ((ApplicationStatus2) => {
    ApplicationStatus2[ApplicationStatus2["Stopped"] = 0] = "Stopped";
    ApplicationStatus2[ApplicationStatus2["ActiveVisibleFocus"] = 1] = "ActiveVisibleFocus";
    ApplicationStatus2[ApplicationStatus2["ActiveHidden"] = 2] = "ActiveHidden";
    ApplicationStatus2[ApplicationStatus2["ActiveVisibleNotFocus"] = 3] = "ActiveVisibleNotFocus";
  })(ApplicationStatus = ApplicationBasic2.ApplicationStatus || (ApplicationBasic2.ApplicationStatus = {}));
  ApplicationBasic2.ClusterInstance = MutableCluster({
    id: 1293,
    name: "ApplicationBasic",
    revision: 1,
    attributes: {
      /**
       * This attribute shall specify a human readable (displayable) name of the vendor for the Content App.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.3.5.1
       */
      vendorName: OptionalFixedAttribute(0, TlvString.bound({ maxLength: 32 })),
      /**
       * This attribute, if present, shall specify the Connectivity Standards Alliance assigned Vendor ID for the
       * Content App.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.3.5.2
       */
      vendorId: OptionalFixedAttribute(1, TlvVendorId),
      /**
       * This attribute shall specify a human readable (displayable) name of the Content App assigned by the
       * vendor. For example, "NPR On Demand". The maximum length of the ApplicationName attribute is 256 bytes of
       * UTF-8 characters.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.3.5.3
       */
      applicationName: FixedAttribute(2, TlvString),
      /**
       * This attribute, if present, shall specify a numeric ID assigned by the vendor to identify a specific
       * Content App made by them. If the Content App is certified by the Connectivity Standards Alliance, then
       * this would be the Product ID as specified by the vendor for the certification.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.3.5.4
       */
      productId: OptionalFixedAttribute(3, TlvUInt16),
      /**
       * This attribute shall specify a Content App which consists of an Application ID using a specified catalog.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.3.5.5
       */
      application: FixedAttribute(4, ApplicationBasic2.TlvApplication),
      /**
       * This attribute shall specify the current running status of the application.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.3.5.6
       */
      status: Attribute(5, TlvEnum()),
      /**
       * This attribute shall specify a human readable (displayable) version of the Content App assigned by the
       * vendor. The maximum length of the ApplicationVersion attribute is 32 bytes of UTF-8 characters.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.3.5.7
       */
      applicationVersion: FixedAttribute(6, TlvString.bound({ maxLength: 32 })),
      /**
       * This attribute is a list of vendor IDs. Each entry is a vendor-id.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.3.5.8
       */
      allowedVendorList: FixedAttribute(
        7,
        TlvArray(TlvVendorId),
        { default: [], readAcl: AccessLevel.Administer, writeAcl: AccessLevel.Administer }
      )
    }
  });
  ApplicationBasic2.Cluster = ApplicationBasic2.ClusterInstance;
  ApplicationBasic2.Complete = ApplicationBasic2.Cluster;
})(ApplicationBasic || (ApplicationBasic = {}));
const ApplicationBasicCluster = ApplicationBasic.Cluster;
ClusterRegistry.register(ApplicationBasic.Complete);
export {
  ApplicationBasic,
  ApplicationBasicCluster
};
//# sourceMappingURL=application-basic.js.map
