/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { InternalError } from "@matter/general";
import { AttributeReadResponse } from "./AttributeReadResponse.js";
class AttributeSubscriptionResponse extends 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 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 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() {
  }
}
export {
  AttributeSubscriptionResponse
};
//# sourceMappingURL=AttributeSubscriptionResponse.js.map
