import { d as defineEventHandler, ac as useRuntimeConfig, U as User, E as Event, R as Resource, w as publicSettings } from '../../../nitro/nitro.mjs';
import 'luxon';
import '@sequelize/core';
import 'html-to-text';
import 'zod';
import 'crypto';
import 'node:fs';
import 'sharp';
import 'path';
import 'node:stream';
import 'jsdom';
import 'dompurify';
import 'mime-types';
import 'fs';
import 'fs/promises';
import 'linkify-html';
import '@peertube/http-signature';
import 'jsonld';
import 'lodash.intersection';
import 'email-templates';
import 'node:http';
import 'node:https';
import 'node:crypto';
import 'node:events';
import 'node:buffer';
import 'node:path';
import 'vue';
import 'vue-router';
import 'dotenv';
import 'url';
import 'bcryptjs';
import 'slugify';
import 'umzug';
import 'consola';
import '@sequelize/core/decorators-legacy';
import 'util';
import 'mitt';
import 'ical.js';
import 'node:url';
import 'fast-xml-parser';

const _nodeinfo_version__get = defineEventHandler(async (event) => {
  const config = useRuntimeConfig(event);
  const nodeinfo_version = event.context.params?.nodeinfo_version ?? "2.0";
  const usersCount = (await User.findAndCountAll()).count;
  const eventsCount = (await Event.findAndCountAll()).count;
  const resourcesCount = (await Resource.findAndCountAll()).count;
  return {
    metadata: {
      nodeDescription: publicSettings.description,
      nodeName: publicSettings.title,
      nodeTimezone: publicSettings.instance_timezone,
      nodeActor: publicSettings.instance_name
    },
    openRegistrations: publicSettings.allow_registration,
    protocols: ["activitypub"],
    services: { inbound: [], outbound: ["rss2.0"] },
    software: {
      name: "gancio",
      config: config.public.version,
      ...nodeinfo_version === "2.1" && { repository: "https://framagit.org/les/gancio" }
    },
    version: event.context?.params?.nodeinfo_version ?? "2.1",
    usage: {
      localComments: resourcesCount,
      localPosts: eventsCount,
      users: {
        total: usersCount
      }
    }
  };
});

export { _nodeinfo_version__get as default };
