import {
  StyledNavItem
} from "./chunk-VEVAU62B.mjs";

// tmp-babel/navigations/web/NavMini/NavSectionMini/NavList/NavItem/index.js
import React, { forwardRef } from "react";
import { ChevronIcon } from "@baseapp-frontend/design-system/components/web/icons";
import { Iconify } from "@baseapp-frontend/design-system/components/web/images";
import Box from "@mui/material/Box";
import Tooltip from "@mui/material/Tooltip";
import Link from "next/link";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
function _typeof(o) {
  "@babel/helpers - typeof";
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof(o);
}
var _excluded = ["itemData", "open", "depth", "active", "hasChild"];
function ownKeys(e, r) {
  var t = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e, r2).enumerable;
    })), t.push.apply(t, o);
  }
  return t;
}
function _objectSpread(e) {
  for (var r = 1; r < arguments.length; r++) {
    var t = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
      _defineProperty(e, r2, t[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
      Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
    });
  }
  return e;
}
function _defineProperty(e, r, t) {
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
}
function _toPropertyKey(t) {
  var i = _toPrimitive(t, "string");
  return "symbol" == _typeof(i) ? i : i + "";
}
function _toPrimitive(t, r) {
  if ("object" != _typeof(t) || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != _typeof(i)) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}
function _objectWithoutProperties(e, t) {
  if (null == e) return {};
  var o, r, i = _objectWithoutPropertiesLoose(e, t);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(e);
    for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
  }
  return i;
}
function _objectWithoutPropertiesLoose(r, e) {
  if (null == r) return {};
  var t = {};
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
    if (-1 !== e.indexOf(n)) continue;
    t[n] = r[n];
  }
  return t;
}
var NavItem = /* @__PURE__ */ forwardRef(function(_ref, ref) {
  var _ref$itemData = _ref.itemData, title = _ref$itemData.title, _ref$itemData$path = _ref$itemData.path, path = _ref$itemData$path === void 0 ? "" : _ref$itemData$path, icon = _ref$itemData.icon, info = _ref$itemData.info, disabled = _ref$itemData.disabled, caption = _ref$itemData.caption, _ref$itemData$externa = _ref$itemData.externalLink, externalLink = _ref$itemData$externa === void 0 ? false : _ref$itemData$externa, open = _ref.open, depth = _ref.depth, active = _ref.active, hasChild = _ref.hasChild, props = _objectWithoutProperties(_ref, _excluded);
  var subItem = depth !== 1;
  var content = /* @__PURE__ */ _jsxs(StyledNavItem, _objectSpread(_objectSpread({
    disableGutters: true,
    ref,
    open,
    depth,
    active,
    disabled,
    disableRipple: hasChild
  }, props), {}, {
    children: [/* @__PURE__ */ _jsxs("div", {
      className: "relative",
      children: [icon && /* @__PURE__ */ _jsx(Box, {
        component: "span",
        className: "icon",
        children: icon
      }), hasChild && /* @__PURE__ */ _jsx(ChevronIcon, {
        position: "right",
        sx: {
          position: "absolute"
        }
      })]
    }), title && /* @__PURE__ */ _jsx(Box, {
      component: "span",
      className: "label",
      children: title
    }), caption && /* @__PURE__ */ _jsx(Tooltip, {
      title: caption,
      arrow: true,
      placement: "right",
      children: /* @__PURE__ */ _jsx(Iconify, {
        width: 16,
        icon: "eva:info-outline",
        className: "caption"
      })
    }), info && subItem && /* @__PURE__ */ _jsx(Box, {
      component: "span",
      className: "info",
      children: info
    })]
  }));
  if (externalLink) return /* @__PURE__ */ _jsx(Link, {
    href: path,
    target: "_blank",
    rel: "noopener noreferrer",
    style: _objectSpread({
      color: "inherit",
      textDecoration: "none"
    }, disabled && {
      pointerEvents: "none"
    }),
    children: content
  });
  if (hasChild) return content;
  return /* @__PURE__ */ _jsx(Link, {
    href: path,
    style: _objectSpread({
      color: "inherit",
      textDecoration: "none"
    }, disabled && {
      pointerEvents: "none"
    }),
    children: content
  });
});
var NavItem_default = NavItem;

export {
  NavItem_default
};
//# sourceMappingURL=chunk-WVC4SV5N.mjs.map