"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 ClientNodeEndpoints_exports = {};
__export(ClientNodeEndpoints_exports, {
  ClientNodeEndpoints: () => ClientNodeEndpoints
});
module.exports = __toCommonJS(ClientNodeEndpoints_exports);
var import_Endpoint = require("#endpoint/Endpoint.js");
var import_EndpointType = require("#endpoint/type/EndpointType.js");
var import_general = require("@matter/general");
var import_Endpoints = require("./Endpoints.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
class ClientNodeEndpoints extends import_Endpoints.Endpoints {
  /**
   * For nodes where the behavior/cluster structure can not be initialized automatically (e.g. by a subscription) or
   * when the subscription data misses special clusters, you can use this method to enable a cluster on a specific
   * endpoint.
   * The method adds the endpoint, if not existing.
   */
  require(endpointId, type = {}) {
    if (this.has(endpointId)) {
      return this.for(endpointId);
    }
    const endpoint = new import_Endpoint.Endpoint({
      id: `ep${endpointId}`,
      number: endpointId,
      type: (0, import_EndpointType.EndpointType)({
        name: `Unknown#${import_general.hex.word(type.deviceType ?? import_EndpointType.EndpointType.UNKNOWN_DEVICE_TYPE)}`,
        deviceType: import_EndpointType.EndpointType.UNKNOWN_DEVICE_TYPE,
        deviceRevision: import_EndpointType.EndpointType.UNKNOWN_DEVICE_REVISION,
        ...type
      })
    });
    this.node.parts.add(endpoint);
    return endpoint;
  }
}
//# sourceMappingURL=ClientNodeEndpoints.js.map
