"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 errors_exports = {};
__export(errors_exports, {
  AttributeNotPresentError: () => AttributeNotPresentError,
  BehaviorInitializationError: () => BehaviorInitializationError,
  EndpointBehaviorNotPresentError: () => EndpointBehaviorNotPresentError,
  EndpointBehaviorsError: () => EndpointBehaviorsError,
  EndpointPartsError: () => EndpointPartsError,
  EndpointReadFailedError: () => EndpointReadFailedError,
  InvalidGroupOperationError: () => InvalidGroupOperationError,
  PartNotFoundError: () => PartNotFoundError
});
module.exports = __toCommonJS(errors_exports);
var import_general = require("@matter/general");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
class BehaviorInitializationError extends import_general.MatterError {
  constructor(message, cause) {
    super(message);
    this.cause = cause;
  }
}
class EndpointBehaviorsError extends import_general.MatterAggregateError {
  constructor(causes) {
    super(causes, `Behaviors have errors`);
  }
}
class EndpointPartsError extends import_general.MatterError {
  constructor(causes) {
    let suffix;
    const causesArray = [...causes];
    if (causesArray.length) {
      suffix = `${causesArray.length === 1 ? "" : "s"} ${(0, import_general.describeList)("and", ...causesArray.map((cause) => cause.toString()))}`;
    } else {
      suffix = "";
    }
    super(`Error initializing part${suffix}`);
  }
}
class PartNotFoundError extends import_general.MatterError {
}
class EndpointBehaviorNotPresentError extends import_general.MatterError {
  constructor(behaviorId) {
    super(`Behavior "${behaviorId}" is not present on this endpoint`);
  }
}
class AttributeNotPresentError extends import_general.MatterError {
  constructor(behaviorId, attributeName) {
    super(`Attribute "${attributeName}" is not present on behavior "${behaviorId}"`);
  }
}
class EndpointReadFailedError extends import_general.MatterError {
  failed;
  partial;
  constructor(detail) {
    super(`Endpoint read failed for ${detail.failed.length} path(s)`);
    this.failed = detail.failed;
    this.partial = detail.partial;
  }
}
class InvalidGroupOperationError extends import_general.ImplementationError {
}
//# sourceMappingURL=errors.js.map
