"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 AttributeSubscriptionResponse_exports = {};
__export(AttributeSubscriptionResponse_exports, {
  AttributeSubscriptionResponse: () => AttributeSubscriptionResponse
});
module.exports = __toCommonJS(AttributeSubscriptionResponse_exports);
var import_general = require("@matter/general");
var import_AttributeReadResponse = require("./AttributeReadResponse.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
class AttributeSubscriptionResponse extends import_AttributeReadResponse.AttributeReadResponse {
  #dirty;
  #currentEndpointDirty;
  #currentClusterDirty;
  constructor(node, session, filter) {
    super(node, session);
    this.#dirty = filter;
  }
  get dirty() {
    return this.#dirty;
  }
  /** Guarded accessor for this.#currentEndpointFilter.  This should never be undefined */
  get currentEndpointDirty() {
    if (!this.#currentEndpointDirty) {
      throw new import_general.InternalError("currentEndpointFilter is not set. Should never happen");
    }
    return this.#currentEndpointDirty;
  }
  /** Guarded accessor for this.#currentCLusterFilter.  This should never be undefined */
  get currentClusterDirty() {
    if (!this.#currentClusterDirty) {
      throw new import_general.InternalError("currentClusterFilter is not set. Should never happen");
    }
    return this.#currentClusterDirty;
  }
  addConcrete(path) {
    const { endpointId, clusterId, attributeId } = path;
    if (this.#dirty[endpointId]?.[clusterId]?.has(attributeId) === void 0) {
      return;
    }
    super.addConcrete(path);
  }
  *readEndpointForWildcard(endpoint, path) {
    this.#currentEndpointDirty = this.#dirty[endpoint.id];
    if (this.#currentEndpointDirty === void 0) {
      return;
    }
    yield* super.readEndpointForWildcard(endpoint, path);
  }
  readClusterForWildcard(cluster, path) {
    this.#currentClusterDirty = this.currentEndpointDirty[cluster.type.id];
    if (this.#currentClusterDirty === void 0) {
      return;
    }
    super.readClusterForWildcard(cluster, path);
  }
  readAttributeForWildcard(attribute, path) {
    if (!this.currentClusterDirty.has(attribute.id)) {
      return;
    }
    super.readAttributeForWildcard(attribute, path);
  }
  addStatus() {
  }
}
//# sourceMappingURL=AttributeSubscriptionResponse.js.map
