import { d as defineEventHandler, g as getRouterParam, w as publicSettings, h as handleCache, c as createError, a8 as publicSettingsLastModified } from '../../../nitro/nitro.mjs';
import { i as isSessionRole } from '../../../_/session.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';
import '../../../_/getUser.mjs';
import '../../../_/jwt.mjs';
import 'jose';

const _key__get = defineEventHandler(async (evt) => {
  const allowed_settings = [
    "title",
    "description",
    "logo",
    "baseurl",
    "instance_name",
    "hostname",
    "about",
    "allow_registration",
    "allow_anon_event",
    "allow_multidate_event",
    "allow_recurrent_event",
    "allow_event_without_end_time",
    "allow_online_event",
    "show_download_media",
    "enable_moderation",
    "enable_report",
    "enable_federation",
    "enable_resources",
    "recurrent_event_visible",
    "hide_calendar",
    "allow_geolocation",
    "hide_thumbs",
    "hide_boosts"
  ];
  const key = getRouterParam(evt, "key");
  if (key && typeof publicSettings[key] != "undefined" && (allowed_settings.includes(key) || await isSessionRole(evt, "admin"))) {
    if (await handleCache(evt, publicSettingsLastModified[key])) return;
    return publicSettings[key];
  } else {
    throw createError({ statusCode: 404, message: "Cannot access this setting" });
  }
});

export { _key__get as default };
