"use strict";
const client = require("@prisma/client");
const extensionAccelerate = require("@prisma/extension-accelerate");
const uuid = require("uuid");
const functions = require("@vercel/functions");
const cache = require("memory-cache");
const crypto = require("crypto");
const common = require("@nestjs/common");
const dayjs = require("dayjs");
const customParseFormat = require("dayjs/plugin/customParseFormat.js");
const duration = require("dayjs/plugin/duration.js");
const isBetween = require("dayjs/plugin/isBetween.js");
const isToday = require("dayjs/plugin/isToday.js");
const localizedFormat = require("dayjs/plugin/localizedFormat.js");
const minmax = require("dayjs/plugin/minMax.js");
const relativeTime = require("dayjs/plugin/relativeTime.js");
const timeZone = require("dayjs/plugin/timezone.js");
const toArray = require("dayjs/plugin/toArray.js");
const utc = require("dayjs/plugin/utc.js");
function _interopNamespaceDefault(e) {
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
  if (e) {
    for (const k in e) {
      if (k !== "default") {
        const d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: () => e[k]
        });
      }
    }
  }
  n.default = e;
  return Object.freeze(n);
}
const cache__namespace = /* @__PURE__ */ _interopNamespaceDefault(cache);
const SchedulingType = {
  ROUND_ROBIN: "ROUND_ROBIN",
  COLLECTIVE: "COLLECTIVE",
  MANAGED: "MANAGED"
};
const PeriodType = {
  UNLIMITED: "UNLIMITED",
  ROLLING: "ROLLING",
  ROLLING_WINDOW: "ROLLING_WINDOW",
  RANGE: "RANGE"
};
const CreationSource = {
  API_V1: "API_V1",
  API_V2: "API_V2",
  WEBAPP: "WEBAPP"
};
const UserPermissionRole = {
  USER: "USER",
  ADMIN: "ADMIN"
};
const CreditType = {
  MONTHLY: "MONTHLY",
  ADDITIONAL: "ADDITIONAL"
};
const MembershipRole = {
  MEMBER: "MEMBER",
  ADMIN: "ADMIN",
  OWNER: "OWNER"
};
const BookingStatus = {
  CANCELLED: "CANCELLED",
  ACCEPTED: "ACCEPTED",
  REJECTED: "REJECTED",
  PENDING: "PENDING",
  AWAITING_HOST: "AWAITING_HOST"
};
const EventTypeCustomInputType = {
  TEXT: "TEXT",
  TEXTLONG: "TEXTLONG",
  NUMBER: "NUMBER",
  BOOL: "BOOL",
  RADIO: "RADIO",
  PHONE: "PHONE"
};
const WebhookTriggerEvents = {
  BOOKING_CREATED: "BOOKING_CREATED",
  BOOKING_PAYMENT_INITIATED: "BOOKING_PAYMENT_INITIATED",
  BOOKING_PAID: "BOOKING_PAID",
  BOOKING_RESCHEDULED: "BOOKING_RESCHEDULED",
  BOOKING_REQUESTED: "BOOKING_REQUESTED",
  BOOKING_CANCELLED: "BOOKING_CANCELLED",
  BOOKING_REJECTED: "BOOKING_REJECTED",
  BOOKING_NO_SHOW_UPDATED: "BOOKING_NO_SHOW_UPDATED",
  FORM_SUBMITTED: "FORM_SUBMITTED",
  MEETING_ENDED: "MEETING_ENDED",
  MEETING_STARTED: "MEETING_STARTED",
  RECORDING_READY: "RECORDING_READY",
  INSTANT_MEETING: "INSTANT_MEETING",
  RECORDING_TRANSCRIPTION_GENERATED: "RECORDING_TRANSCRIPTION_GENERATED",
  OOO_CREATED: "OOO_CREATED",
  AFTER_HOSTS_CAL_VIDEO_NO_SHOW: "AFTER_HOSTS_CAL_VIDEO_NO_SHOW",
  AFTER_GUESTS_CAL_VIDEO_NO_SHOW: "AFTER_GUESTS_CAL_VIDEO_NO_SHOW",
  FORM_SUBMITTED_NO_EVENT: "FORM_SUBMITTED_NO_EVENT"
};
const AppCategories = {
  calendar: "calendar",
  messaging: "messaging",
  other: "other",
  payment: "payment",
  video: "video",
  web3: "web3",
  automation: "automation",
  analytics: "analytics",
  conferencing: "conferencing",
  crm: "crm"
};
const WorkflowTriggerEvents = {
  BEFORE_EVENT: "BEFORE_EVENT",
  EVENT_CANCELLED: "EVENT_CANCELLED",
  NEW_EVENT: "NEW_EVENT",
  AFTER_EVENT: "AFTER_EVENT",
  RESCHEDULE_EVENT: "RESCHEDULE_EVENT",
  AFTER_HOSTS_CAL_VIDEO_NO_SHOW: "AFTER_HOSTS_CAL_VIDEO_NO_SHOW",
  AFTER_GUESTS_CAL_VIDEO_NO_SHOW: "AFTER_GUESTS_CAL_VIDEO_NO_SHOW"
};
const WorkflowActions = {
  EMAIL_HOST: "EMAIL_HOST",
  EMAIL_ATTENDEE: "EMAIL_ATTENDEE",
  SMS_ATTENDEE: "SMS_ATTENDEE",
  SMS_NUMBER: "SMS_NUMBER",
  EMAIL_ADDRESS: "EMAIL_ADDRESS",
  WHATSAPP_ATTENDEE: "WHATSAPP_ATTENDEE",
  WHATSAPP_NUMBER: "WHATSAPP_NUMBER"
};
const TimeUnit = {
  DAY: "DAY",
  HOUR: "HOUR",
  MINUTE: "MINUTE"
};
const WorkflowTemplates = {
  REMINDER: "REMINDER",
  CUSTOM: "CUSTOM",
  CANCELLED: "CANCELLED",
  RESCHEDULED: "RESCHEDULED",
  COMPLETED: "COMPLETED",
  RATING: "RATING"
};
const WorkflowMethods = {
  EMAIL: "EMAIL",
  SMS: "SMS",
  WHATSAPP: "WHATSAPP"
};
const RRResetInterval = {
  MONTH: "MONTH",
  DAY: "DAY"
};
const RRTimestampBasis = {
  CREATED_AT: "CREATED_AT",
  START_TIME: "START_TIME"
};
const RedirectType = {
  UserEventType: "UserEventType",
  TeamEventType: "TeamEventType",
  User: "User",
  Team: "Team"
};
const SMSLockState = {
  LOCKED: "LOCKED",
  UNLOCKED: "UNLOCKED",
  REVIEW_NEEDED: "REVIEW_NEEDED"
};
const AttributeType = {
  TEXT: "TEXT",
  NUMBER: "NUMBER",
  SINGLE_SELECT: "SINGLE_SELECT",
  MULTI_SELECT: "MULTI_SELECT"
};
const AssignmentReasonEnum = {
  ROUTING_FORM_ROUTING: "ROUTING_FORM_ROUTING",
  ROUTING_FORM_ROUTING_FALLBACK: "ROUTING_FORM_ROUTING_FALLBACK",
  REASSIGNED: "REASSIGNED",
  RR_REASSIGNED: "RR_REASSIGNED",
  REROUTED: "REROUTED",
  SALESFORCE_ASSIGNMENT: "SALESFORCE_ASSIGNMENT"
};
const EventTypeAutoTranslatedField = {
  DESCRIPTION: "DESCRIPTION",
  TITLE: "TITLE"
};
const WatchlistType = {
  EMAIL: "EMAIL",
  DOMAIN: "DOMAIN",
  USERNAME: "USERNAME"
};
const WatchlistSeverity = {
  LOW: "LOW",
  MEDIUM: "MEDIUM",
  HIGH: "HIGH",
  CRITICAL: "CRITICAL"
};
const IncompleteBookingActionType = {
  SALESFORCE: "SALESFORCE"
};
const WorkflowContactType = {
  PHONE: "PHONE",
  EMAIL: "EMAIL"
};
class IdempotencyKeyService {
  static generate({
    startTime,
    endTime,
    userId,
    reassignedById
  }) {
    return uuid.v5(
      `${startTime.valueOf()}.${endTime.valueOf()}.${userId}${reassignedById ? `.${reassignedById}` : ""}`,
      uuid.v5.URL
    );
  }
}
function bookingIdempotencyKeyExtension() {
  return client.Prisma.defineExtension({
    query: {
      booking: {
        async create({ args, query }) {
          if (args.data.status === BookingStatus.ACCEPTED) {
            const idempotencyKey = IdempotencyKeyService.generate({
              startTime: args.data.startTime,
              endTime: args.data.endTime,
              userId: args.data.user?.connect?.id,
              reassignedById: args.data.reassignById
            });
            args.data.idempotencyKey = idempotencyKey;
          }
          return query(args);
        },
        async update({ args, query }) {
          if (args.data.status === BookingStatus.CANCELLED || args.data.status === BookingStatus.REJECTED) {
            args.data.idempotencyKey = null;
          }
          return query(args);
        },
        async updateMany({ args, query }) {
          if (args.data.status === BookingStatus.CANCELLED || args.data.status === BookingStatus.REJECTED) {
            args.data.idempotencyKey = null;
          }
          return query(args);
        }
      }
    }
  });
}
const checkUndefinedInValue = (where) => {
  if (where) {
    for (const key in where) {
      const whereInput = where[key];
      let message;
      if (whereInput === void 0) {
        message = `The value for the field "${key}" cannot be undefined.`;
        throw new Error(message);
      }
      if (whereInput === null) {
        continue;
      }
      if (whereInput.hasOwnProperty("in") && typeof whereInput.in === "undefined") {
        message = `The "in" value for the field "${key}" cannot be undefined.`;
        throw new Error(message);
      }
    }
  }
};
function disallowUndefinedDeleteUpdateManyExtension() {
  return client.Prisma.defineExtension({
    query: {
      $allModels: {
        async deleteMany({ args, query }) {
          checkUndefinedInValue(args.where);
          return query(args);
        },
        async updateMany({ args, query }) {
          checkUndefinedInValue(args.where);
          return query(args);
        }
      }
    }
  });
}
function excludeLockedUsersExtension() {
  return client.Prisma.defineExtension({
    query: {
      user: {
        async findUnique({ args, query }) {
          return excludeLockedUsers(args, query);
        },
        async findFirst({ args, query }) {
          return excludeLockedUsers(args, query);
        },
        async findMany({ args, query }) {
          return excludeLockedUsers(args, query);
        },
        async findUniqueOrThrow({ args, query }) {
          return excludeLockedUsers(args, query);
        },
        async findFirstOrThrow({ args, query }) {
          return excludeLockedUsers(args, query);
        }
      }
    }
  });
}
function safeJSONStringify(x) {
  try {
    return JSON.stringify(x);
  } catch {
    return "";
  }
}
async function excludeLockedUsers(args, query) {
  args.where = args.where || {};
  const whereString = safeJSONStringify(args.where);
  const shouldIncludeLocked = whereString.includes('"locked":');
  if (!shouldIncludeLocked) {
    args.where.locked = false;
  }
  return query(args);
}
function excludePendingPaymentsExtension() {
  return client.Prisma.defineExtension({
    query: {
      team: {
        async findUnique({ args, query }) {
          return excludePendingPayments(args, query);
        },
        async findFirst({ args, query }) {
          return excludePendingPayments(args, query);
        },
        async findMany({ args, query }) {
          return excludePendingPayments(args, query);
        },
        async findUniqueOrThrow({ args, query }) {
          return excludePendingPayments(args, query);
        },
        async findFirstOrThrow({ args, query }) {
          return excludePendingPayments(args, query);
        }
      }
    }
  });
}
async function excludePendingPayments(args, query) {
  args.where = args.where || {};
  if (args.where.pendingPayment === void 0) {
    args.where.pendingPayment = false;
  }
  return query(args);
}
const ALGORITHM = "aes256";
const INPUT_ENCODING = "utf8";
const OUTPUT_ENCODING = "hex";
const IV_LENGTH = 16;
const symmetricEncrypt = function(text, key) {
  const _key = Buffer.from(key, "latin1");
  const iv = crypto.randomBytes(IV_LENGTH);
  const cipher = crypto.createCipheriv(ALGORITHM, _key, iv);
  let ciphered = cipher.update(text, INPUT_ENCODING, OUTPUT_ENCODING);
  ciphered += cipher.final(OUTPUT_ENCODING);
  const ciphertext = `${iv.toString(OUTPUT_ENCODING)}:${ciphered}`;
  return ciphertext;
};
const symmetricDecrypt = function(text, key) {
  const _key = Buffer.from(key, "latin1");
  const components = text.split(":");
  const iv_from_ciphertext = Buffer.from(components.shift() || "", OUTPUT_ENCODING);
  const decipher = crypto.createDecipheriv(ALGORITHM, _key, iv_from_ciphertext);
  let deciphered = decipher.update(components.join(":"), OUTPUT_ENCODING, INPUT_ENCODING);
  deciphered += decipher.final(INPUT_ENCODING);
  return deciphered;
};
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result)
    __defProp(target, key, result);
  return result;
};
const LogLevel = {
  DEBUG: 0,
  INFO: 1,
  WARN: 2,
  ERROR: 3
};
let Logger = class {
  constructor(userSettings) {
    this.nestLogger = new common.Logger("LoggerBridge");
    this.prefix = "";
    this.settings = {
      ...Logger.defaultSettings,
      ...userSettings
    };
  }
  /**
   * Creates a new LoggerBridge instance with a specific prefix.
   * Useful for providing context from different parts of a library.
   * @param options - Configuration for the sub-logger.
   * @param options.prefix - An array of strings to join as the log prefix.
   * @returns A new LoggerBridge instance with the specified prefix.
   */
  getSubLogger(options) {
    const newLogger = new Logger();
    newLogger.prefix = options?.prefix?.join(" ") ?? "";
    return newLogger;
  }
  // --- Public logging methods ---
  info(...args) {
    this.settings.minLevel <= 1 && this.logInternal("log", ...args);
  }
  warn(...args) {
    this.settings.minLevel <= 2 && this.logInternal("warn", ...args);
  }
  error(...args) {
    this.settings.minLevel <= 3 && this.logInternal("error", ...args);
  }
  debug(...args) {
    this.settings.minLevel === 0 && this.logInternal("debug", ...args);
  }
  trace(...args) {
    this.settings.minLevel === 0 && this.logInternal("verbose", ...args);
  }
  fatal(...args) {
    const fatalMessage = `fatal: ${this.formatArgsAsString(args)}`;
    this.settings.minLevel <= 3 && this.logInternal("error", fatalMessage);
  }
  silly(...args) {
    const sillyMessage = `silly: ${this.formatArgsAsString(args)}`;
    this.settings.minLevel === 0 && this.logInternal("verbose", sillyMessage);
  }
  // --- Internal logging implementation ---
  /** Formats arguments into a single string */
  formatArgsAsString(args) {
    return args.map((arg) => {
      if (typeof arg === "string") {
        return arg;
      }
      try {
        return JSON.stringify(arg);
      } catch (e) {
        return "[Unserializable Object]";
      }
    }).join(" ");
  }
  /** Central method to forward logs to NestLogger */
  logInternal(level, ...args) {
    try {
      const formattedMessage = this.formatArgsAsString(args);
      const message = this.prefix ? `${this.prefix} ${formattedMessage}` : formattedMessage;
      switch (level) {
        case "log":
          this.nestLogger.log(message);
          break;
        case "warn":
          this.nestLogger.warn(message);
          break;
        case "error":
          this.nestLogger.error(message);
          break;
        case "debug":
          this.nestLogger.debug(message);
          break;
        case "verbose":
          this.nestLogger.verbose(message);
          break;
      }
    } catch (err) {
      this.nestLogger.error(
        `Could not bridge log message. Error: ${err instanceof Error ? err.message : String(err)}`
      );
    }
  }
};
Logger.defaultSettings = {
  minLevel: process?.env?.LOGGER_BRIDGE_LOG_LEVEL ? Number(process.env.LOGGER_BRIDGE_LOG_LEVEL) : LogLevel.INFO,
  // Default to INFO level
  displayTimestamp: true,
  logFormat: "pretty"
};
Logger = __decorateClass([
  common.Injectable({ scope: common.Scope.TRANSIENT })
], Logger);
const VERCEL_URL = process.env.NEXT_PUBLIC_VERCEL_URL ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}` : "";
const RAILWAY_STATIC_URL = process.env.RAILWAY_STATIC_URL ? `https://${process.env.RAILWAY_STATIC_URL}` : "";
const HEROKU_URL = process.env.HEROKU_APP_NAME ? `https://${process.env.HEROKU_APP_NAME}.herokuapp.com` : "";
const RENDER_URL = process.env.RENDER_EXTERNAL_URL ? `https://${process.env.RENDER_EXTERNAL_URL}` : "";
const CALCOM_ENV = process.env.CALCOM_ENV || process.env.NODE_ENV;
const IS_PRODUCTION = CALCOM_ENV === "production";
process.env.NODE_ENV === "production";
const ORGANIZER_EMAIL_EXEMPT_DOMAINS = process.env.ORGANIZER_EMAIL_EXEMPT_DOMAINS || "";
const IS_DEV = CALCOM_ENV === "development";
const SINGLE_ORG_SLUG = process.env.NEXT_PUBLIC_SINGLE_ORG_SLUG;
const WEBAPP_URL = process.env.NEXT_PUBLIC_WEBAPP_URL || VERCEL_URL || RAILWAY_STATIC_URL || HEROKU_URL || RENDER_URL || "http://localhost:3000";
const WEBAPP_URL_FOR_OAUTH = IS_PRODUCTION || IS_DEV ? WEBAPP_URL : "http://localhost:3000";
const BASE_URL = WEBAPP_URL;
const WEBSITE_URL = process.env.NEXT_PUBLIC_WEBSITE_URL || "https://cal.com";
const APP_NAME = process.env.NEXT_PUBLIC_APP_NAME || "Cal.com";
const SUPPORT_MAIL_ADDRESS = process.env.NEXT_PUBLIC_SUPPORT_MAIL_ADDRESS || "help@cal.com";
const COMPANY_NAME = process.env.NEXT_PUBLIC_COMPANY_NAME || "Cal.com, Inc.";
const SENDER_ID = process.env.NEXT_PUBLIC_SENDER_ID || "Cal";
const SENDER_NAME = process.env.NEXT_PUBLIC_SENDGRID_SENDER_NAME || "Cal.com";
const EMAIL_FROM_NAME = process.env.EMAIL_FROM_NAME || APP_NAME;
const CAL_URL = new URL(WEBAPP_URL).hostname.endsWith(".vercel.app") ? WEBAPP_URL : process.env.NEXT_PUBLIC_WEBSITE_URL || WEBAPP_URL;
const IS_CALCOM = WEBAPP_URL && (new URL(WEBAPP_URL).hostname.endsWith("cal.com") || new URL(WEBAPP_URL).hostname.endsWith("cal.dev") || new URL(WEBAPP_URL).hostname.endsWith("cal.qa") || new URL(WEBAPP_URL).hostname.endsWith("cal-staging.com"));
const CONSOLE_URL = new URL(WEBAPP_URL).hostname.endsWith(".cal.dev") || new URL(WEBAPP_URL).hostname.endsWith(".cal.qa") || new URL(WEBAPP_URL).hostname.endsWith(".cal-staging.com") || process.env.NODE_ENV !== "production" ? `https://console.cal.dev` : `https://console.cal.com`;
const CAL_DOMAINS = [".cal.com", ".cal.dev", ".cal.eu", ".cal.qa"];
const WEBAPP_HOSTNAME = new URL(WEBAPP_URL).hostname;
const IS_SELF_HOSTED = !CAL_DOMAINS.some((domain) => WEBAPP_HOSTNAME.endsWith(domain));
process.env.NEXT_PUBLIC_EMBED_LIB_URL || `${WEBAPP_URL}/embed/embed.js`;
const HOSTED_CAL_FEATURES = process.env.NEXT_PUBLIC_HOSTED_CAL_FEATURES || !IS_SELF_HOSTED;
parseInt(process.env.NEXT_PUBLIC_QUERY_RESERVATION_INTERVAL_SECONDS ?? "", 10) || 30;
parseInt(process.env.NEXT_PUBLIC_QUERY_RESERVATION_STALE_TIME_SECONDS ?? "", 10) || 20;
parseInt(process.env.NEXT_PUBLIC_QUERY_AVAILABLE_SLOTS_INTERVAL_SECONDS ?? "", 10) || 5 * 60;
process.env.NEXT_PUBLIC_INVALIDATE_AVAILABLE_SLOTS_ON_BOOKING_FORM === "1";
parseInt(process.env.NEXT_PUBLIC_QUICK_AVAILABILITY_ROLLOUT ?? "", 10) || 0;
process.env.NEXT_PUBLIC_WEBAPP_URL || `https://${process.env.VERCEL_URL}`;
const AVATAR_FALLBACK = "/avatar.svg";
const IS_STRIPE_ENABLED = !!(process.env.STRIPE_CLIENT_ID && process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY && process.env.STRIPE_PRIVATE_KEY);
!!process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY && HOSTED_CAL_FEATURES;
const MINUTES_TO_BOOK = process.env.NEXT_PUBLIC_MINUTES_TO_BOOK || "5";
process.env.NEXT_PUBLIC_ENABLE_PROFILE_SWITCHER === "1";
const ALLOWED_HOSTNAMES = JSON.parse(`[${process.env.ALLOWED_HOSTNAMES || ""}]`);
const RESERVED_SUBDOMAINS = JSON.parse(`[${process.env.RESERVED_SUBDOMAINS || ""}]`);
const ORGANIZATION_SELF_SERVE_MIN_SEATS = parseInt(
  process.env.NEXT_PUBLIC_ORGANIZATIONS_MIN_SELF_SERVE_SEATS || "5"
);
const ORGANIZATION_SELF_SERVE_PRICE = parseFloat(
  process.env.NEXT_PUBLIC_ORGANIZATIONS_SELF_SERVE_PRICE_NEW || "37"
);
process.env.E2E_TEST_MAILHOG_ENABLED === "1";
process.env.NEXT_PUBLIC_CALCOM_VERSION;
const APP_CREDENTIAL_SHARING_ENABLED = !!process.env.CALCOM_CREDENTIAL_SYNC_SECRET && !!process.env.CALCOM_APP_CREDENTIAL_ENCRYPTION_KEY;
const CREDENTIAL_SYNC_SECRET = process.env.CALCOM_CREDENTIAL_SYNC_SECRET;
const CREDENTIAL_SYNC_SECRET_HEADER_NAME = process.env.CALCOM_CREDENTIAL_SYNC_HEADER_NAME || "calcom-credential-sync-secret";
const CREDENTIAL_SYNC_ENDPOINT = process.env.CALCOM_CREDENTIAL_SYNC_ENDPOINT;
const SERVICE_ACCOUNT_ENCRYPTION_KEY = process.env.CALCOM_SERVICE_ACCOUNT_ENCRYPTION_KEY;
(IS_CALCOM || process.env.NEXT_PUBLIC_IS_E2E && IS_STRIPE_ENABLED) && process.env.NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE_MONTHLY;
Boolean(globalThis.window?.Meticulous?.isRunningAsTest);
parseInt(
  process.env.NEXT_PUBLIC_BOOKER_NUMBER_OF_DAYS_TO_LOAD ?? "0",
  0
);
process.env.NEXT_PUBLIC_CLOUDFLARE_SITEKEY;
process.env.NEXT_PUBLIC_CLOUDFLARE_USE_TURNSTILE_IN_BOOKER;
const MINIMUM_NUMBER_OF_ORG_SEATS = 30;
process.env.NEXT_PUBLIC_ORG_SELF_SERVE_ENABLED === "1";
const CALCOM_PRIVATE_API_ROUTE = process.env.CALCOM_PRIVATE_API_ROUTE || "https://goblin.cal.com";
process.env.NEXT_PUBLIC_WEBSITE_PRIVACY_POLICY_URL || "https://cal.com/privacy";
process.env.NEXT_PUBLIC_WEBSITE_TERMS_URL || "https://cal.com/terms";
const LINGO_DOT_DEV_API_KEY = process.env.LINGO_DOT_DEV_API_KEY;
const ROLLING_WINDOW_PERIOD_MAX_DAYS_TO_CHECK = 30 + 31;
const SCOPE_USERINFO_PROFILE = "https://www.googleapis.com/auth/userinfo.profile";
const GOOGLE_CALENDAR_SCOPES = [
  "https://www.googleapis.com/auth/calendar.events",
  "https://www.googleapis.com/auth/calendar.readonly"
];
process.env.DIRECTORY_IDS_TO_LOG?.split(",") || [];
const SCANNING_WORKFLOW_STEPS = !!(!IS_SELF_HOSTED && process.env.IFFY_API_KEY);
!!process.env.NEXT_PUBLIC_PLAIN_CHAT_ID && process.env.NEXT_PUBLIC_PLAIN_CHAT_ID !== "";
!!process.env.NEXT_PUBLIC_DUB_PROGRAM_ID && process.env.NEXT_PUBLIC_DUB_PROGRAM_ID !== "";
process.env.CAL_VIDEO_MEETING_LINK_FOR_TESTING;
const IS_SMS_CREDITS_ENABLED = !!process.env.NEXT_PUBLIC_STRIPE_CREDITS_PRICE_ID || !!process.env.NEXT_PUBLIC_IS_E2E;
const DATABASE_CHUNK_SIZE = parseInt(process.env.DATABASE_CHUNK_SIZE || "25", 10);
const logger = new Logger({
  minLevel: parseInt(process.env.NEXT_PUBLIC_LOGGER_LEVEL || "4"),
  maskValuesOfKeys: ["password", "passwordConfirmation", "credentials", "credential"],
  prettyLogTimeZone: IS_PRODUCTION ? "UTC" : "local",
  prettyErrorStackTemplate: "  • {{fileName}}	{{method}}\n	{{filePathWithLine}}",
  // default
  prettyErrorTemplate: "\n{{errorName}} {{errorMessage}}\nerror stack:\n{{errorStack}}",
  // default
  prettyLogTemplate: "{{hh}}:{{MM}}:{{ss}}:{{ms}} [{{logLevelName}}] ",
  // default with exclusion of `{{filePathWithLine}}`
  stylePrettyLogs: true,
  prettyLogStyles: {
    name: "yellow",
    dateIsoStr: "blue"
  }
});
const log = logger.getSubLogger({ prefix: ["getDeploymentKey"] });
async function getDeploymentKey(deploymentRepo) {
  if (process.env.CALCOM_LICENSE_KEY) {
    return process.env.CALCOM_LICENSE_KEY;
  }
  const licenseKey = await deploymentRepo.getLicenseKeyWithId(1);
  return licenseKey || "";
}
async function getDeploymentSignatureToken(deploymentRepo) {
  if (process.env.CAL_SIGNATURE_TOKEN) {
    return process.env.CAL_SIGNATURE_TOKEN;
  }
  const signatureTokenEncrypted = await deploymentRepo.getSignatureToken(1);
  if (!signatureTokenEncrypted) {
    log.error("Signature token not found in database or set in environment variable");
    return null;
  }
  const decryptedSignatureToken = symmetricDecrypt(
    signatureTokenEncrypted,
    process.env.CALENDSO_ENCRYPTION_KEY || ""
  );
  return decryptedSignatureToken || null;
}
const generateNonce = () => {
  return crypto.randomBytes(16).toString("hex");
};
const createSignature = (body, nonce, secretKey) => {
  return crypto.createHmac("sha256", secretKey).update(JSON.stringify(body) + nonce).digest("hex");
};
var UsageEvent = /* @__PURE__ */ ((UsageEvent2) => {
  UsageEvent2["BOOKING"] = "booking";
  UsageEvent2["USER"] = "user";
  return UsageEvent2;
})(UsageEvent || {});
class LicenseKeyService {
  // 24 hours in milliseconds
  // Private constructor to prevent direct instantiation
  constructor(licenseKey, signatureToken) {
    this.baseUrl = CALCOM_PRIVATE_API_ROUTE;
    this.CACHING_TIME = 864e5;
    this.baseUrl = CALCOM_PRIVATE_API_ROUTE;
    this.licenseKey = licenseKey;
    this.signatureToken = signatureToken;
  }
  // Static async factory method
  static async create(deploymentRepo) {
    const licenseKey = await getDeploymentKey(deploymentRepo);
    const signatureToken = await getDeploymentSignatureToken(deploymentRepo);
    const useNoop = !licenseKey || process.env.NEXT_PUBLIC_IS_E2E === "1";
    return !useNoop ? new LicenseKeyService(licenseKey, signatureToken) : new NoopLicenseKeyService();
  }
  async fetcher({
    url,
    body,
    licenseKey,
    options = {}
  }) {
    const nonce = generateNonce();
    const headers = {
      ...options.headers,
      "Content-Type": "application/json",
      nonce,
      "x-cal-license-key": licenseKey
    };
    if (!this.signatureToken) {
      logger.warn("CAL_SIGNATURE_TOKEN needs to be set to increment usage.");
    } else {
      const signature = createSignature(body || {}, nonce, this.signatureToken);
      headers["signature"] = signature;
    }
    return await fetch(url, {
      ...options,
      headers,
      body: JSON.stringify(body),
      // In case of hang, abort the operation after 2 seconds
      signal: AbortSignal.timeout(2e3)
    });
  }
  // Static method to validate a license key directly
  static async validateLicenseKey(licenseKey) {
    if (process.env.NEXT_PUBLIC_IS_E2E === "1")
      return true;
    const service = new LicenseKeyService(licenseKey, "");
    return service.checkLicense();
  }
  async incrementUsage(usageEvent) {
    try {
      const response = await this.fetcher({
        url: `${this.baseUrl}/v1/license/usage/increment?event=${usageEvent ?? "booking"}`,
        licenseKey: this.licenseKey,
        options: {
          method: "POST",
          mode: "cors"
        }
      });
      return await response.json();
    } catch (error) {
      console.error("Incrementing usage failed:", error);
      throw error;
    }
  }
  async checkLicense() {
    if (process.env.NEXT_PUBLIC_IS_E2E === "1")
      return true;
    const url = `${this.baseUrl}/v1/license/${this.licenseKey}`;
    const cachedResponse = cache__namespace.get(url);
    if (cachedResponse)
      return cachedResponse;
    try {
      const response = await this.fetcher({ url, licenseKey: this.licenseKey, options: { mode: "cors" } });
      const data = await response.json();
      cache__namespace.put(url, data.status, this.CACHING_TIME);
      return data.status;
    } catch (error) {
      console.error("Check license failed:", error);
      return false;
    }
  }
}
class NoopLicenseKeyService {
  async incrementUsage(_usageEvent) {
    return Promise.resolve();
  }
  async checkLicense() {
    return Promise.resolve(process.env.NEXT_PUBLIC_IS_E2E === "1");
  }
}
class LicenseKeySingleton {
  static {
    this.instance = null;
  }
  // eslint-disable-next-line @typescript-eslint/no-empty-function -- Private constructor to prevent direct instantiation
  constructor() {
  }
  static async getInstance(deploymentRepo) {
    if (!LicenseKeySingleton.instance) {
      LicenseKeySingleton.instance = await LicenseKeyService.create(deploymentRepo);
    }
    return LicenseKeySingleton.instance;
  }
}
class DeploymentRepository {
  constructor(prisma2) {
    this.prisma = prisma2;
  }
  async getLicenseKeyWithId(id) {
    const deployment = await this.prisma.deployment.findUnique({
      where: { id },
      select: { licenseKey: true }
    });
    return deployment?.licenseKey || null;
  }
  async getSignatureToken(id) {
    const deployment = await this.prisma.deployment.findUnique({
      where: { id },
      select: { signatureTokenEncrypted: true }
    });
    return deployment?.signatureTokenEncrypted || null;
  }
}
async function incrementUsage(prismaClient, event) {
  const deploymentRepo = new DeploymentRepository(prismaClient);
  try {
    const licenseKeyService = await LicenseKeySingleton.getInstance(deploymentRepo);
    await licenseKeyService.incrementUsage(event);
  } catch (e) {
    console.log(e);
  }
}
function usageTrackingExtention(prismaClient) {
  return client.Prisma.defineExtension({
    query: {
      booking: {
        async create({ args, query }) {
          functions.waitUntil(incrementUsage(prismaClient, UsageEvent.BOOKING));
          return query(args);
        }
      },
      user: {
        async create({ args, query }) {
          functions.waitUntil(incrementUsage(prismaClient, UsageEvent.USER));
          return query(args);
        }
      }
    }
  });
}
function middleware(prisma2) {
  prisma2.$use(async (params, next) => {
    if (params.model === "BookingReference") {
      if (params.action === "delete") {
        params.action = "update";
        params.args["data"] = { deleted: true };
      }
      if (params.action === "deleteMany") {
        params.action = "updateMany";
        if (params.args.data !== void 0) {
          params.args.data["deleted"] = true;
        } else {
          params.args["data"] = { deleted: true };
        }
      }
      if (params.action === "findUnique") {
        params.action = "findFirst";
        params.args.where["deleted"] = null;
      }
      if (params.action === "findMany" || params.action === "findFirst") {
        if (params.args.where !== void 0) {
          if (params.args.where.deleted === void 0) {
            params.args.where["deleted"] = null;
          }
        } else {
          params.args["where"] = { deleted: null };
        }
      }
    }
    return next(params);
  });
}
const safeAppSelect = {
  slug: true,
  dirName: true,
  /** Omitting to avoid frontend leaks */
  // keys: true,
  categories: true,
  createdAt: true,
  updatedAt: true,
  enabled: true
};
const bookingMinimalSelect = {
  id: true,
  title: true,
  userPrimaryEmail: true,
  description: true,
  customInputs: true,
  startTime: true,
  endTime: true,
  attendees: true,
  metadata: true
};
const credentialForCalendarServiceSelect = {
  id: true,
  appId: true,
  type: true,
  userId: true,
  user: {
    select: {
      email: true
    }
  },
  teamId: true,
  key: true,
  invalid: true,
  delegationCredentialId: true
};
const safeCredentialSelect = {
  id: true,
  type: true,
  /** Omitting to avoid frontend leaks */
  // key: true,
  userId: true,
  user: {
    select: {
      email: true
    }
  },
  teamId: true,
  appId: true,
  invalid: true,
  delegationCredentialId: true
};
const baseEventTypeSelect = {
  id: true,
  title: true,
  description: true,
  length: true,
  schedulingType: true,
  recurringEvent: true,
  slug: true,
  hidden: true,
  price: true,
  currency: true,
  lockTimeZoneToggleOnBookingPage: true,
  lockedTimeZone: true,
  requiresConfirmation: true,
  requiresBookerEmailVerification: true,
  canSendCalVideoTranscriptionEmails: true
};
const bookEventTypeSelect = {
  id: true,
  title: true,
  slug: true,
  description: true,
  length: true,
  locations: true,
  customInputs: true,
  periodType: true,
  periodDays: true,
  periodStartDate: true,
  periodEndDate: true,
  recurringEvent: true,
  lockTimeZoneToggleOnBookingPage: true,
  lockedTimeZone: true,
  requiresConfirmation: true,
  canSendCalVideoTranscriptionEmails: true,
  requiresBookerEmailVerification: true,
  metadata: true,
  periodCountCalendarDays: true,
  price: true,
  currency: true,
  disableGuests: true,
  userId: true,
  seatsPerTimeSlot: true,
  bookingFields: true,
  workflows: {
    include: {
      workflow: {
        include: {
          steps: true
        }
      }
    }
  },
  users: {
    select: {
      id: true,
      username: true,
      name: true,
      email: true,
      bio: true,
      avatarUrl: true,
      theme: true
    }
  },
  successRedirectUrl: true,
  team: {
    select: {
      logoUrl: true,
      parent: {
        select: {
          logoUrl: true,
          name: true
        }
      }
    }
  }
};
const availiblityPageEventTypeSelect = {
  id: true,
  title: true,
  availability: true,
  description: true,
  length: true,
  offsetStart: true,
  price: true,
  currency: true,
  periodType: true,
  periodStartDate: true,
  periodEndDate: true,
  periodDays: true,
  periodCountCalendarDays: true,
  locations: true,
  schedulingType: true,
  recurringEvent: true,
  requiresConfirmation: true,
  schedule: {
    select: {
      availability: true,
      timeZone: true
    }
  },
  hidden: true,
  userId: true,
  slug: true,
  minimumBookingNotice: true,
  beforeEventBuffer: true,
  afterEventBuffer: true,
  timeZone: true,
  metadata: true,
  slotInterval: true,
  seatsPerTimeSlot: true,
  users: {
    select: {
      id: true,
      avatarUrl: true,
      name: true,
      username: true,
      hideBranding: true,
      timeZone: true
    }
  },
  team: {
    select: {
      logoUrl: true,
      parent: {
        select: {
          logoUrl: true,
          name: true
        }
      }
    }
  }
};
const availabilityUserSelect = {
  id: true,
  timeZone: true,
  email: true,
  bufferTime: true,
  startTime: true,
  username: true,
  endTime: true,
  timeFormat: true,
  defaultScheduleId: true,
  // Relationships
  schedules: {
    select: {
      availability: {
        select: {
          date: true,
          startTime: true,
          endTime: true,
          days: true
        }
      },
      timeZone: true,
      id: true
    }
  },
  selectedCalendars: true,
  travelSchedules: true
};
const baseUserSelect = {
  name: true,
  destinationCalendar: true,
  locale: true,
  hideBranding: true,
  theme: true,
  brandColor: true,
  darkBrandColor: true,
  ...availabilityUserSelect
};
const userSelect = {
  select: {
    name: true,
    allowDynamicBooking: true,
    destinationCalendar: true,
    locale: true,
    hideBranding: true,
    theme: true,
    brandColor: true,
    darkBrandColor: true,
    metadata: true,
    locked: true,
    ...availabilityUserSelect
  }
};
const prismaOptions = {};
const globalForPrisma = global;
const loggerLevel = parseInt(process.env.NEXT_PUBLIC_LOGGER_LEVEL ?? "", 10);
if (!isNaN(loggerLevel)) {
  switch (loggerLevel) {
    case 5:
    case 6:
      prismaOptions.log = ["error"];
      break;
    case 4:
      prismaOptions.log = ["warn", "error"];
      break;
    case 3:
      prismaOptions.log = ["info", "error", "warn"];
      break;
    default:
      prismaOptions.log = ["query", "info", "error", "warn"];
      break;
  }
}
const prismaWithoutClientExtensions = globalForPrisma.prismaWithoutClientExtensions || new client.PrismaClient(prismaOptions);
const customPrisma = (options) => new client.PrismaClient({ ...prismaOptions, ...options }).$extends(usageTrackingExtention(prismaWithoutClientExtensions)).$extends(excludeLockedUsersExtension()).$extends(excludePendingPaymentsExtension()).$extends(bookingIdempotencyKeyExtension()).$extends(disallowUndefinedDeleteUpdateManyExtension()).$extends(extensionAccelerate.withAccelerate());
middleware(prismaWithoutClientExtensions);
const prismaWithClientExtensions = prismaWithoutClientExtensions.$extends(usageTrackingExtention(prismaWithoutClientExtensions)).$extends(excludeLockedUsersExtension()).$extends(excludePendingPaymentsExtension()).$extends(bookingIdempotencyKeyExtension()).$extends(disallowUndefinedDeleteUpdateManyExtension()).$extends(extensionAccelerate.withAccelerate());
const prisma = globalForPrisma.prismaWithClientExtensions || prismaWithClientExtensions;
const readonlyPrisma = process.env.INSIGHTS_DATABASE_URL ? customPrisma({
  datasources: { db: { url: process.env.INSIGHTS_DATABASE_URL } }
}) : prisma;
if (process.env.NODE_ENV !== "production") {
  globalForPrisma.prismaWithoutClientExtensions = prismaWithoutClientExtensions;
  globalForPrisma.prismaWithClientExtensions = prisma;
}
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  availabilityUserSelect,
  availiblityPageEventTypeSelect,
  baseEventTypeSelect,
  baseUserSelect,
  bookEventTypeSelect,
  bookingMinimalSelect,
  customPrisma,
  default: prisma,
  prisma,
  readonlyPrisma,
  safeAppSelect,
  safeCredentialSelect,
  userSelect
}, Symbol.toStringTag, { value: "Module" }));
const BusinessDaysPlugin = (options = {}, dayjsClass, dayjsFactory) => {
  const defaultWorkingWeekdays = [1, 2, 3, 4, 5];
  dayjsFactory.getWorkingWeekdays = function() {
    return options.workingWeekdays || defaultWorkingWeekdays;
  };
  dayjsFactory.setWorkingWeekdays = function(workingWeekdays) {
    options.workingWeekdays = workingWeekdays;
  };
  dayjsFactory.getHolidays = function() {
    return options.holidays || [];
  };
  dayjsFactory.setHolidays = function(holidays) {
    options.holidays = holidays;
  };
  dayjsFactory.getHolidayFormat = function() {
    return options.holidayFormat;
  };
  dayjsFactory.setHolidayFormat = function(holidayFormat) {
    options.holidayFormat = holidayFormat;
  };
  dayjsFactory.getAdditionalWorkingDays = function() {
    return options.additionalWorkingDays || [];
  };
  dayjsFactory.setAdditionalWorkingDays = function(additionalWorkingDays) {
    options.additionalWorkingDays = additionalWorkingDays;
  };
  dayjsFactory.getAdditionalWorkingDayFormat = function() {
    return options.additionalWorkingDayFormat;
  };
  dayjsFactory.setAdditionalWorkingDayFormat = function(additionalWorkingDayFormat) {
    options.additionalWorkingDayFormat = additionalWorkingDayFormat;
  };
  dayjsClass.prototype.isHoliday = function() {
    if (!options.holidays) {
      return false;
    }
    if (options.holidays.includes(this.format(options.holidayFormat))) {
      return true;
    }
    return false;
  };
  dayjsClass.prototype.isBusinessDay = function() {
    const workingWeekdays = options.workingWeekdays || defaultWorkingWeekdays;
    if (this.isHoliday()) {
      return false;
    }
    if (this.isAdditionalWorkingDay()) {
      return true;
    }
    if (workingWeekdays.includes(this.day())) {
      return true;
    }
    return false;
  };
  dayjsClass.prototype.isAdditionalWorkingDay = function() {
    if (!options.additionalWorkingDays) {
      return false;
    }
    if (options.additionalWorkingDays.includes(this.format(options.additionalWorkingDayFormat))) {
      return true;
    }
    return false;
  };
  dayjsClass.prototype.businessDaysAdd = function(days) {
    const numericDirection = days < 0 ? -1 : 1;
    let currentDay = this.clone();
    let daysRemaining = Math.abs(days);
    while (daysRemaining > 0) {
      currentDay = currentDay.add(numericDirection, `d`);
      if (currentDay.isBusinessDay()) {
        daysRemaining -= 1;
      }
    }
    return currentDay;
  };
  dayjsClass.prototype.businessDaysSubtract = function(days) {
    let currentDay = this.clone();
    currentDay = currentDay.businessDaysAdd(days * -1);
    return currentDay;
  };
  dayjsClass.prototype.businessDiff = function(date) {
    const day1 = this.clone();
    const day2 = date.clone();
    const isPositiveDiff = day1 >= day2;
    let start = isPositiveDiff ? day2 : day1;
    const end = isPositiveDiff ? day1 : day2;
    let daysBetween = 0;
    if (start.isSame(end)) {
      return daysBetween;
    }
    while (start < end) {
      if (start.isBusinessDay()) {
        daysBetween += 1;
      }
      start = start.add(1, `d`);
    }
    return isPositiveDiff ? daysBetween : -daysBetween;
  };
  dayjsClass.prototype.nextBusinessDay = function() {
    const searchLimit = 7;
    let currentDay = this.clone();
    let loopIndex = 1;
    while (loopIndex < searchLimit) {
      currentDay = currentDay.add(1, `day`);
      if (currentDay.isBusinessDay()) {
        break;
      }
      loopIndex += 1;
    }
    return currentDay;
  };
  dayjsClass.prototype.prevBusinessDay = function() {
    const searchLimit = 7;
    let currentDay = this.clone();
    let loopIndex = 1;
    while (loopIndex < searchLimit) {
      currentDay = currentDay.subtract(1, `day`);
      if (currentDay.isBusinessDay()) {
        break;
      }
      loopIndex += 1;
    }
    return currentDay;
  };
  dayjsClass.prototype.businessDaysInMonth = function() {
    if (!this.isValid()) {
      return [];
    }
    let currentDay = this.clone().startOf(`month`);
    const monthEnd = this.clone().endOf(`month`);
    const businessDays = [];
    let monthComplete = false;
    while (!monthComplete) {
      if (currentDay.isBusinessDay()) {
        businessDays.push(currentDay.clone());
      }
      currentDay = currentDay.add(1, `day`);
      if (currentDay.isAfter(monthEnd)) {
        monthComplete = true;
      }
    }
    return businessDays;
  };
  dayjsClass.prototype.lastBusinessDayOfMonth = function() {
    const businessDays = this.businessDaysInMonth();
    const lastBusinessDay = businessDays[businessDays.length - 1];
    return lastBusinessDay;
  };
  dayjsClass.prototype.businessWeeksInMonth = function() {
    if (!this.isValid()) {
      return [];
    }
    let currentDay = this.clone().startOf(`month`);
    const monthEnd = this.clone().endOf(`month`);
    const businessWeeks = [];
    let businessDays = [];
    let monthComplete = false;
    while (!monthComplete) {
      if (currentDay.isBusinessDay()) {
        businessDays.push(currentDay.clone());
      }
      if (currentDay.day() === 5 || currentDay.isSame(monthEnd, `day`)) {
        businessWeeks.push(businessDays);
        businessDays = [];
      }
      currentDay = currentDay.add(1, `day`);
      if (currentDay.isAfter(monthEnd)) {
        monthComplete = true;
      }
    }
    return businessWeeks;
  };
};
dayjs.extend(customParseFormat);
dayjs.extend(BusinessDaysPlugin);
dayjs.extend(isBetween);
dayjs.extend(isToday);
dayjs.extend(localizedFormat);
dayjs.extend(relativeTime);
dayjs.extend(timeZone);
dayjs.extend(toArray);
dayjs.extend(utc);
dayjs.extend(minmax);
dayjs.extend(duration);
exports.ALLOWED_HOSTNAMES = ALLOWED_HOSTNAMES;
exports.APP_CREDENTIAL_SHARING_ENABLED = APP_CREDENTIAL_SHARING_ENABLED;
exports.APP_NAME = APP_NAME;
exports.AVATAR_FALLBACK = AVATAR_FALLBACK;
exports.AppCategories = AppCategories;
exports.AssignmentReasonEnum = AssignmentReasonEnum;
exports.AttributeType = AttributeType;
exports.BASE_URL = BASE_URL;
exports.BookingStatus = BookingStatus;
exports.CAL_URL = CAL_URL;
exports.COMPANY_NAME = COMPANY_NAME;
exports.CONSOLE_URL = CONSOLE_URL;
exports.CREDENTIAL_SYNC_ENDPOINT = CREDENTIAL_SYNC_ENDPOINT;
exports.CREDENTIAL_SYNC_SECRET = CREDENTIAL_SYNC_SECRET;
exports.CREDENTIAL_SYNC_SECRET_HEADER_NAME = CREDENTIAL_SYNC_SECRET_HEADER_NAME;
exports.CreationSource = CreationSource;
exports.CreditType = CreditType;
exports.DATABASE_CHUNK_SIZE = DATABASE_CHUNK_SIZE;
exports.DeploymentRepository = DeploymentRepository;
exports.EMAIL_FROM_NAME = EMAIL_FROM_NAME;
exports.EventTypeAutoTranslatedField = EventTypeAutoTranslatedField;
exports.EventTypeCustomInputType = EventTypeCustomInputType;
exports.GOOGLE_CALENDAR_SCOPES = GOOGLE_CALENDAR_SCOPES;
exports.IS_PRODUCTION = IS_PRODUCTION;
exports.IS_SELF_HOSTED = IS_SELF_HOSTED;
exports.IS_SMS_CREDITS_ENABLED = IS_SMS_CREDITS_ENABLED;
exports.IdempotencyKeyService = IdempotencyKeyService;
exports.IncompleteBookingActionType = IncompleteBookingActionType;
exports.LINGO_DOT_DEV_API_KEY = LINGO_DOT_DEV_API_KEY;
exports.LicenseKeySingleton = LicenseKeySingleton;
exports.MINIMUM_NUMBER_OF_ORG_SEATS = MINIMUM_NUMBER_OF_ORG_SEATS;
exports.MINUTES_TO_BOOK = MINUTES_TO_BOOK;
exports.MembershipRole = MembershipRole;
exports.ORGANIZATION_SELF_SERVE_MIN_SEATS = ORGANIZATION_SELF_SERVE_MIN_SEATS;
exports.ORGANIZATION_SELF_SERVE_PRICE = ORGANIZATION_SELF_SERVE_PRICE;
exports.ORGANIZER_EMAIL_EXEMPT_DOMAINS = ORGANIZER_EMAIL_EXEMPT_DOMAINS;
exports.PeriodType = PeriodType;
exports.RESERVED_SUBDOMAINS = RESERVED_SUBDOMAINS;
exports.ROLLING_WINDOW_PERIOD_MAX_DAYS_TO_CHECK = ROLLING_WINDOW_PERIOD_MAX_DAYS_TO_CHECK;
exports.RRResetInterval = RRResetInterval;
exports.RRTimestampBasis = RRTimestampBasis;
exports.RedirectType = RedirectType;
exports.SCANNING_WORKFLOW_STEPS = SCANNING_WORKFLOW_STEPS;
exports.SCOPE_USERINFO_PROFILE = SCOPE_USERINFO_PROFILE;
exports.SENDER_ID = SENDER_ID;
exports.SENDER_NAME = SENDER_NAME;
exports.SERVICE_ACCOUNT_ENCRYPTION_KEY = SERVICE_ACCOUNT_ENCRYPTION_KEY;
exports.SINGLE_ORG_SLUG = SINGLE_ORG_SLUG;
exports.SMSLockState = SMSLockState;
exports.SUPPORT_MAIL_ADDRESS = SUPPORT_MAIL_ADDRESS;
exports.SchedulingType = SchedulingType;
exports.TimeUnit = TimeUnit;
exports.UserPermissionRole = UserPermissionRole;
exports.WEBAPP_URL = WEBAPP_URL;
exports.WEBAPP_URL_FOR_OAUTH = WEBAPP_URL_FOR_OAUTH;
exports.WEBSITE_URL = WEBSITE_URL;
exports.WatchlistSeverity = WatchlistSeverity;
exports.WatchlistType = WatchlistType;
exports.WebhookTriggerEvents = WebhookTriggerEvents;
exports.WorkflowActions = WorkflowActions;
exports.WorkflowContactType = WorkflowContactType;
exports.WorkflowMethods = WorkflowMethods;
exports.WorkflowTemplates = WorkflowTemplates;
exports.WorkflowTriggerEvents = WorkflowTriggerEvents;
exports.availabilityUserSelect = availabilityUserSelect;
exports.bookingMinimalSelect = bookingMinimalSelect;
exports.credentialForCalendarServiceSelect = credentialForCalendarServiceSelect;
exports.index = index;
exports.logger = logger;
exports.prisma = prisma;
exports.readonlyPrisma = readonlyPrisma;
exports.safeCredentialSelect = safeCredentialSelect;
exports.symmetricDecrypt = symmetricDecrypt;
exports.symmetricEncrypt = symmetricEncrypt;
exports.userSelect = userSelect;
