import {
  VERSION
} from "./chunk-Z7BGWB5J.js";

// src/analytics/analytics.js
import os from "os";
async function raiseEvent(eventData) {
  const url = "https://queue.simpleanalyticscdn.com/events";
  const userAgent = `@eventcatalog/eventcatalog@${VERSION} (${os.platform()}; ${os.arch()}; Node/${process.version})`;
  const headers = {
    "Content-Type": "application/json"
  };
  const payload = {
    type: "event",
    hostname: "eventcatalog.dev",
    event: "@eventcatalog/eventcatalog",
    metadata: {
      ...eventData,
      t: `t;${(/* @__PURE__ */ new Date()).toISOString()}`,
      ua: userAgent
    },
    ua: userAgent
  };
  try {
    const response = await fetch(url, {
      method: "POST",
      headers,
      body: JSON.stringify(payload)
    });
    if (!response.ok) {
      throw new Error(`Failed to raise analytics event: ${response.status}`);
    }
  } catch (error) {
  }
}

export {
  raiseEvent
};
