"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }"use client";



var _chunkFIG2RKZFcjs = require('./chunk-FIG2RKZF.cjs');

// src/utils/common.ts
var _clsx = require('clsx');
var _tailwindmerge = require('tailwind-merge');
function cn2(...inputs) {
  return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, inputs));
}
function delay(ms) {
  return new Promise((resolve) => setTimeout(resolve, ms));
}
function generateRandomString(length = 8) {
  const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  let result = "";
  for (let i = 0; i < length; i++) {
    result += chars.charAt(Math.floor(Math.random() * chars.length));
  }
  return result;
}
function truncateString(str, maxLength, suffix = "...") {
  if (str.length <= maxLength) return str;
  return str.substring(0, maxLength - suffix.length) + suffix;
}
function serializeJsonLd(schema) {
  return JSON.stringify(schema).replace(/</g, "\\u003c");
}
function deepClone(obj) {
  return JSON.parse(JSON.stringify(obj));
}
function getSlackCommunityJoinUrl() {
  const url = process.env.NEXT_PUBLIC_SLACK_COMMUNITY_JOIN_URL;
  if (!url) {
    console.warn("NEXT_PUBLIC_SLACK_COMMUNITY_JOIN_URL is not defined in environment variables");
    return "https://join.slack.com/t/openmsp/shared_invite/zt-36bl7mx0h-3~U2nFH6nqHqoTPXMaHEHA";
  }
  return url;
}

// src/utils/suggestion-url.ts
function buildSuggestionUrl(path, opts = {}) {
  const qs = new URLSearchParams();
  const { entityType, entityId } = opts;
  if (entityType && entityId !== void 0 && entityId !== null && entityId !== "") {
    qs.set("entityType", entityType);
    qs.set("entityId", String(entityId));
  }
  if (opts.count !== void 0) qs.set("count", String(opts.count));
  for (const [key, value] of Object.entries(_nullishCoalesce(opts.extraParams, () => ( {})))) {
    if (value !== void 0 && value !== "") qs.set(key, value);
  }
  const query = qs.toString();
  return `${_nullishCoalesce(opts.apiBaseUrl, () => ( ""))}${path}${query ? `?${query}` : ""}`;
}

// src/components/ui/chevron-button.tsx
_chunkFIG2RKZFcjs.init_cn.call(void 0, );
var _react = require('react'); var React = _interopRequireWildcard(_react);
var _lucidereact = require('lucide-react');
var _jsxruntime = require('react/jsx-runtime');
var ChevronButton = React.forwardRef(
  ({ className, direction = "down", size = "md", isExpanded, backgroundColor, borderColor, ...props }, ref) => {
    const Icon = (isExpanded ? _lucidereact.ChevronUp : _lucidereact.ChevronDown) || (direction === "up" ? _lucidereact.ChevronUp : _lucidereact.ChevronDown);
    const sizeClasses = {
      sm: "h-4 w-4",
      md: "h-5 w-5",
      lg: "h-6 w-6"
    };
    return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
      "button",
      {
        className: _chunkFIG2RKZFcjs.cn.call(void 0, 
          "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
          "h-10 px-4 py-2",
          className
        ),
        style: {
          backgroundColor,
          borderColor
        },
        ref,
        ...props,
        children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { className: sizeClasses[size] })
      }
    );
  }
);
ChevronButton.displayName = "ChevronButton";











exports.cn = cn2; exports.delay = delay; exports.generateRandomString = generateRandomString; exports.truncateString = truncateString; exports.serializeJsonLd = serializeJsonLd; exports.deepClone = deepClone; exports.getSlackCommunityJoinUrl = getSlackCommunityJoinUrl; exports.buildSuggestionUrl = buildSuggestionUrl; exports.ChevronButton = ChevronButton;
//# sourceMappingURL=chunk-7VMEOFEA.cjs.map