"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 PeerCommunicationError_exports = {};
__export(PeerCommunicationError_exports, {
  CommissioningTransitionError: () => CommissioningTransitionError,
  FabricChangedError: () => FabricChangedError,
  FabricRemovedError: () => FabricRemovedError,
  FailsafeExpiredError: () => FailsafeExpiredError,
  OperationalAddressChangedError: () => OperationalAddressChangedError,
  PeerCommunicationError: () => PeerCommunicationError,
  PeerInitiatedCloseError: () => PeerInitiatedCloseError,
  PeerLeftError: () => PeerLeftError,
  PeerShutdownError: () => PeerShutdownError,
  PeerUnreachableError: () => PeerUnreachableError,
  PeerUnresponsiveError: () => PeerUnresponsiveError,
  TransientPeerCommunicationError: () => TransientPeerCommunicationError
});
module.exports = __toCommonJS(PeerCommunicationError_exports);
var import_general = require("@matter/general");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
class PeerCommunicationError extends import_general.MatterError {
}
class TransientPeerCommunicationError extends PeerCommunicationError {
}
class PeerUnreachableError extends TransientPeerCommunicationError {
  constructor(timeOffline) {
    super(`Peer has been unreachable for ${import_general.Duration.format(timeOffline)}`);
  }
}
class PeerUnresponsiveError extends TransientPeerCommunicationError {
  constructor(timeWaited) {
    super(
      `Peer is no longer responding to active session${timeWaited > 0 ? ` (timed out after ${import_general.Duration.format(timeWaited)})` : ""}`
    );
  }
}
class PeerShutdownError extends TransientPeerCommunicationError {
  constructor(message = "Peer reports shutdown") {
    super(message);
  }
}
class PeerInitiatedCloseError extends TransientPeerCommunicationError {
  constructor(message = "Session ended by peer") {
    super(message);
  }
}
class PeerLeftError extends PeerCommunicationError {
  constructor(message = "Peer has left the fabric") {
    super(message);
  }
}
class FabricRemovedError extends PeerCommunicationError {
  constructor(message = "This node is no longer a member of the fabric") {
    super(message);
  }
}
class FabricChangedError extends PeerCommunicationError {
  constructor(message = "The fabric associated with this session has changed") {
    super(message);
  }
}
class FailsafeExpiredError extends PeerCommunicationError {
  constructor(message = "Failsafe timer has expired") {
    super(message);
  }
}
class CommissioningTransitionError extends PeerCommunicationError {
}
class OperationalAddressChangedError extends PeerCommunicationError {
  constructor(message = "Peer's operational address has changed") {
    super(message);
  }
}
//# sourceMappingURL=PeerCommunicationError.js.map
