"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
exports.TreeMouseEventTarget = void 0;
(function(TreeMouseEventTarget) {
  TreeMouseEventTarget[TreeMouseEventTarget["Unknown"] = 0] = "Unknown";
  TreeMouseEventTarget[TreeMouseEventTarget["Twistie"] = 1] = "Twistie";
  TreeMouseEventTarget[TreeMouseEventTarget["Element"] = 2] = "Element";
})(exports.TreeMouseEventTarget || (exports.TreeMouseEventTarget = {}));
class TreeError extends Error {
  constructor(user, message) {
    super(`TreeError [${user}] ${message}`);
  }
}
class WeakMapper {
  constructor(fn) {
    this.fn = fn;
    this._map = /* @__PURE__ */ new WeakMap();
  }
  map(key) {
    let result = this._map.get(key);
    if (!result) {
      result = this.fn(key);
      this._map.set(key, result);
    }
    return result;
  }
}
exports.TreeError = TreeError;
exports.WeakMapper = WeakMapper;
