"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 Introspection_exports = {};
__export(Introspection_exports, {
  Introspection: () => Introspection
});
module.exports = __toCommonJS(Introspection_exports);
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var Introspection;
((Introspection2) => {
  function propertyDescriptorOf(subject, name) {
    const descriptor = Reflect.getOwnPropertyDescriptor(subject, name);
    if (descriptor) {
      return descriptor;
    }
    const prototype = Reflect.getPrototypeOf(subject);
    if (prototype !== null) {
      return Introspection2.propertyDescriptorOf(prototype, name);
    }
  }
  Introspection2.propertyDescriptorOf = propertyDescriptorOf;
  function propertyDescriptorsOf(subject) {
    const descriptors = {};
    function addDescriptors(subject2) {
      const localDescriptors = Object.getOwnPropertyDescriptors(subject2);
      for (const name in localDescriptors) {
        if (descriptors[name] === void 0) {
          descriptors[name] = localDescriptors[name];
        }
      }
      const prototype = Reflect.getPrototypeOf(subject2);
      if (prototype !== null) {
        addDescriptors(prototype);
      }
    }
    addDescriptors(subject);
    return descriptors;
  }
  Introspection2.propertyDescriptorsOf = propertyDescriptorsOf;
  function propertyAccessibilityOf(subject, name) {
    const pd = propertyDescriptorOf(subject, name);
    if (pd) {
      return propertyDescriptorToAccessibility(pd);
    }
    return { readable: true, writable: true };
  }
  Introspection2.propertyAccessibilityOf = propertyAccessibilityOf;
  function objectAccessibilityOf(subject) {
    const accessibilty = {};
    const propertyDescriptors = Introspection2.propertyDescriptorsOf(subject);
    for (const name in propertyDescriptors) {
      accessibilty[name] = propertyDescriptorToAccessibility(propertyDescriptors[name]);
    }
    return accessibilty;
  }
  Introspection2.objectAccessibilityOf = objectAccessibilityOf;
  function propertyDescriptorToAccessibility(pd) {
    return {
      readable: !!(pd.get || !pd.set),
      writable: !!(pd.set || pd.writable)
    };
  }
  Introspection2.propertyDescriptorToAccessibility = propertyDescriptorToAccessibility;
})(Introspection || (Introspection = {}));
//# sourceMappingURL=Introspection.js.map
