var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellDraggable/components/TreeItem/TreeItem.tsx
var TreeItem_exports = {};
__export(TreeItem_exports, {
  TreeItem: () => TreeItem
});
module.exports = __toCommonJS(TreeItem_exports);
var import_classnames = __toESM(require("classnames"));
var import_react = __toESM(require("react"));
var import_components = require("../../components");
var import_TreeItem = require("./TreeItem.less");
var TreeItem = (0, import_react.forwardRef)((props, ref) => {
  const {
    childCount,
    clone,
    depth,
    disableSelection,
    disableInteraction,
    ghost,
    handleProps,
    indentationWidth,
    indicator,
    collapsed,
    onCollapse,
    onRemove,
    style,
    wrapperRef,
    item,
    renderItem,
    isBlocked,
    __designMode,
    ...otherProps
  } = props;
  if (renderItem) {
    return renderItem(props, ref);
  }
  return /* @__PURE__ */ import_react.default.createElement(
    "li",
    {
      className: (0, import_classnames.default)(
        "Wrapper",
        clone && "clone",
        ghost && "ghost",
        indicator && "indicator",
        disableSelection && "disableSelection",
        disableInteraction && "disableInteraction"
      ),
      ref: wrapperRef,
      style: {
        "--spacing": `${indentationWidth * depth}px`
      },
      ...otherProps
    },
    /* @__PURE__ */ import_react.default.createElement("div", { className: "TreeItem", ref, style }, /* @__PURE__ */ import_react.default.createElement(
      import_components.Handle,
      {
        ...__designMode === "design" ? {} : { ...handleProps }
      }
    ), onCollapse && /* @__PURE__ */ import_react.default.createElement(
      import_components.Action,
      {
        onClick: onCollapse,
        className: (0, import_classnames.default)("Collapse", collapsed && "collapsed")
      },
      collapseIcon
    ), /* @__PURE__ */ import_react.default.createElement("span", { className: "Text" }, item.id), !clone && onRemove && /* @__PURE__ */ import_react.default.createElement(import_components.Remove, { onClick: onRemove }), clone && childCount && childCount > 1 ? /* @__PURE__ */ import_react.default.createElement("span", { className: "Count" }, childCount) : null)
  );
});
var collapseIcon = /* @__PURE__ */ import_react.default.createElement("svg", { width: "10", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 70 41" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M30.76 39.2402C31.885 40.3638 33.41 40.995 35 40.995C36.59 40.995 38.115 40.3638 39.24 39.2402L68.24 10.2402C69.2998 9.10284 69.8768 7.59846 69.8494 6.04406C69.822 4.48965 69.1923 3.00657 68.093 1.90726C66.9937 0.807959 65.5106 0.178263 63.9562 0.150837C62.4018 0.123411 60.8974 0.700397 59.76 1.76024L35 26.5102L10.24 1.76024C9.10259 0.700397 7.59822 0.123411 6.04381 0.150837C4.4894 0.178263 3.00632 0.807959 1.90702 1.90726C0.807714 3.00657 0.178019 4.48965 0.150593 6.04406C0.123167 7.59846 0.700153 9.10284 1.75999 10.2402L30.76 39.2402Z" }));
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  TreeItem
});
