import * as z from "zod";
import { b5 as eventTypeSlug, g as eventTypeLocations, am as eventTypeBookingFields, b6 as coerceToDate, h as recurringEventType, E as EventTypeMetaDataSchema, b7 as successRedirectUrl, a7 as intervalLimitsType, r as rrSegmentQueryValueSchema, b8 as emailSchema, at as eventTypeColor, ar as userMetadata, t as teamMetadataSchema, ai as bookingResponses, b9 as bookingMetadataSchema, ba as customInputOptionSchema, bb as RoutingFormSettings, bc as DeploymentTheme, bd as bookingSeatDataSchema, av as serviceAccountKeySchema, be as orgOnboardingInvitedMembersSchema, bf as orgOnboardingTeamsSchema } from "./orgDomains-eTg-cjth.js";
import { PeriodType, SchedulingType, IdentityProvider, UserPermissionRole, SMSLockState, CreationSource, RRResetInterval, RRTimestampBasis, CreditType, MembershipRole, BookingStatus, EventTypeCustomInputType, ReminderType, PaymentOption, WebhookTriggerEvents, TimeUnit, AppCategories, WorkflowActions, WorkflowTemplates, WorkflowTriggerEvents, WorkflowMethods, FeatureType, AccessScope, RedirectType, AttributeType, AssignmentReasonEnum, EventTypeAutoTranslatedField, WatchlistType, WatchlistSeverity, BillingPeriod, IncompleteBookingActionType, FilterSegmentScope, WorkflowContactType, RoleType } from "@prisma/client";
const _HostModel = z.object({
  userId: z.number().int(),
  eventTypeId: z.number().int(),
  isFixed: z.boolean(),
  priority: z.number().int().nullish(),
  weight: z.number().int().nullish(),
  weightAdjustment: z.number().int().nullish(),
  scheduleId: z.number().int().nullish(),
  createdAt: z.date()
});
const HostModel = z.lazy(() => _HostModel.extend({
  user: UserModel,
  eventType: EventTypeModel,
  schedule: ScheduleModel.nullish()
}));
const _CalVideoSettingsModel = z.object({
  eventTypeId: z.number().int(),
  disableRecordingForOrganizer: z.boolean(),
  disableRecordingForGuests: z.boolean(),
  enableAutomaticTranscription: z.boolean(),
  enableAutomaticRecordingForOrganizer: z.boolean(),
  redirectUrlOnExit: z.string().nullish(),
  disableTranscriptionForGuests: z.boolean(),
  disableTranscriptionForOrganizer: z.boolean(),
  createdAt: z.date(),
  updatedAt: z.date()
});
const CalVideoSettingsModel = z.lazy(() => _CalVideoSettingsModel.extend({
  eventType: EventTypeModel
}));
const literalSchema$k = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$k = z.lazy(() => z.union([literalSchema$k, z.array(jsonSchema$k), z.record(jsonSchema$k)]));
const _EventTypeModel = z.object({
  id: z.number().int(),
  title: z.string().min(1),
  slug: eventTypeSlug,
  description: z.string().nullish(),
  interfaceLanguage: z.string().nullish(),
  position: z.number().int(),
  locations: eventTypeLocations,
  length: z.number().int().min(1),
  offsetStart: z.number().int(),
  hidden: z.boolean(),
  userId: z.number().int().nullish(),
  profileId: z.number().int().nullish(),
  teamId: z.number().int().nullish(),
  useEventLevelSelectedCalendars: z.boolean(),
  eventName: z.string().nullish(),
  parentId: z.number().int().nullish(),
  bookingFields: eventTypeBookingFields,
  timeZone: z.string().nullish(),
  periodType: z.nativeEnum(PeriodType),
  periodStartDate: coerceToDate.nullish(),
  periodEndDate: coerceToDate.nullish(),
  periodDays: z.number().int().nullish(),
  periodCountCalendarDays: z.boolean().nullish(),
  lockTimeZoneToggleOnBookingPage: z.boolean(),
  lockedTimeZone: z.string().nullish(),
  requiresConfirmation: z.boolean(),
  requiresConfirmationWillBlockSlot: z.boolean(),
  requiresConfirmationForFreeEmail: z.boolean(),
  requiresBookerEmailVerification: z.boolean(),
  canSendCalVideoTranscriptionEmails: z.boolean(),
  autoTranslateDescriptionEnabled: z.boolean(),
  recurringEvent: recurringEventType,
  disableGuests: z.boolean(),
  hideCalendarNotes: z.boolean(),
  hideCalendarEventDetails: z.boolean(),
  minimumBookingNotice: z.number().int().min(0),
  beforeEventBuffer: z.number().int(),
  afterEventBuffer: z.number().int(),
  seatsPerTimeSlot: z.number().int().nullish(),
  onlyShowFirstAvailableSlot: z.boolean(),
  disableCancelling: z.boolean().nullish(),
  disableRescheduling: z.boolean().nullish(),
  seatsShowAttendees: z.boolean().nullish(),
  seatsShowAvailabilityCount: z.boolean().nullish(),
  schedulingType: z.nativeEnum(SchedulingType).nullish(),
  scheduleId: z.number().int().nullish(),
  allowReschedulingCancelledBookings: z.boolean().nullish(),
  price: z.number().int(),
  currency: z.string(),
  slotInterval: z.number().int().nullish(),
  metadata: EventTypeMetaDataSchema,
  successRedirectUrl: successRedirectUrl.nullish(),
  forwardParamsSuccessRedirect: z.boolean().nullish(),
  bookingLimits: intervalLimitsType,
  durationLimits: intervalLimitsType,
  isInstantEvent: z.boolean(),
  instantMeetingExpiryTimeOffsetInSeconds: z.number().int(),
  instantMeetingScheduleId: z.number().int().nullish(),
  instantMeetingParameters: z.string().array(),
  assignAllTeamMembers: z.boolean(),
  assignRRMembersUsingSegment: z.boolean(),
  rrSegmentQueryValue: rrSegmentQueryValueSchema,
  useEventTypeDestinationCalendarEmail: z.boolean(),
  isRRWeightsEnabled: z.boolean(),
  maxLeadThreshold: z.number().int().nullish(),
  includeNoShowInRRCalculation: z.boolean(),
  allowReschedulingPastBookings: z.boolean(),
  hideOrganizerEmail: z.boolean(),
  maxActiveBookingsPerBooker: z.number().int().nullish(),
  maxActiveBookingPerBookerOfferReschedule: z.boolean(),
  customReplyToEmail: emailSchema.nullish(),
  eventTypeColor,
  rescheduleWithSameRoundRobinHost: z.boolean(),
  secondaryEmailId: z.number().int().nullish(),
  useBookerTimezone: z.boolean(),
  restrictionScheduleId: z.number().int().nullish()
});
const EventTypeModel = z.lazy(() => _EventTypeModel.extend({
  hosts: HostModel.array(),
  users: UserModel.array(),
  owner: UserModel.nullish(),
  profile: ProfileModel.nullish(),
  team: TeamModel.nullish(),
  hashedLink: HashedLinkModel.array(),
  bookings: BookingModel.array(),
  availability: AvailabilityModel.array(),
  webhooks: WebhookModel.array(),
  destinationCalendar: DestinationCalendarModel.nullish(),
  customInputs: EventTypeCustomInputModel.array(),
  parent: EventTypeModel.nullish(),
  children: EventTypeModel.array(),
  schedule: ScheduleModel.nullish(),
  workflows: WorkflowsOnEventTypesModel.array(),
  instantMeetingSchedule: ScheduleModel.nullish(),
  aiPhoneCallConfig: AIPhoneCallConfigurationModel.nullish(),
  fieldTranslations: EventTypeTranslationModel.array(),
  selectedCalendars: SelectedCalendarModel.array(),
  calVideoSettings: CalVideoSettingsModel.nullish(),
  secondaryEmail: SecondaryEmailModel.nullish(),
  restrictionSchedule: ScheduleModel.nullish()
}));
const literalSchema$j = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$j = z.lazy(() => z.union([literalSchema$j, z.array(jsonSchema$j), z.record(jsonSchema$j)]));
const _CredentialModel = z.object({
  id: z.number().int(),
  type: z.string(),
  key: jsonSchema$j,
  userId: z.number().int().nullish(),
  teamId: z.number().int().nullish(),
  appId: z.string().nullish(),
  subscriptionId: z.string().nullish(),
  paymentStatus: z.string().nullish(),
  billingCycleStart: z.number().int().nullish(),
  invalid: z.boolean().nullish(),
  delegationCredentialId: z.string().nullish()
});
const CredentialModel = z.lazy(() => _CredentialModel.extend({
  user: UserModel.nullish(),
  team: TeamModel.nullish(),
  app: AppModel.nullish(),
  destinationCalendars: DestinationCalendarModel.array(),
  selectedCalendars: SelectedCalendarModel.array(),
  CalendarCache: CalendarCacheModel.array(),
  references: BookingReferenceModel.array(),
  delegationCredential: DelegationCredentialModel.nullish()
}));
const _DestinationCalendarModel = z.object({
  id: z.number().int(),
  integration: z.string(),
  externalId: z.string(),
  primaryEmail: emailSchema.nullish(),
  userId: z.number().int().nullish(),
  eventTypeId: z.number().int().nullish(),
  credentialId: z.number().int().nullish(),
  createdAt: z.date().nullish(),
  updatedAt: z.date().nullish(),
  delegationCredentialId: z.string().nullish(),
  domainWideDelegationCredentialId: z.string().nullish()
});
const DestinationCalendarModel = z.lazy(() => _DestinationCalendarModel.extend({
  user: UserModel.nullish(),
  booking: BookingModel.array(),
  eventType: EventTypeModel.nullish(),
  credential: CredentialModel.nullish(),
  delegationCredential: DelegationCredentialModel.nullish(),
  domainWideDelegation: DomainWideDelegationModel.nullish()
}));
const _UserPasswordModel = z.object({
  hash: z.string(),
  userId: z.number().int()
});
const UserPasswordModel = z.lazy(() => _UserPasswordModel.extend({
  user: UserModel
}));
const _TravelScheduleModel = z.object({
  id: z.number().int(),
  userId: z.number().int(),
  timeZone: z.string(),
  startDate: z.date(),
  endDate: z.date().nullish(),
  prevTimeZone: z.string().nullish()
});
const TravelScheduleModel = z.lazy(() => _TravelScheduleModel.extend({
  user: UserModel
}));
const literalSchema$i = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$i = z.lazy(() => z.union([literalSchema$i, z.array(jsonSchema$i), z.record(jsonSchema$i)]));
const _UserModel = z.object({
  id: z.number().int(),
  username: z.string().nullish(),
  name: z.string().nullish(),
  email: emailSchema,
  emailVerified: z.date().nullish(),
  bio: z.string().nullish(),
  avatarUrl: z.string().nullish(),
  timeZone: z.string(),
  weekStart: z.string(),
  startTime: z.number().int(),
  endTime: z.number().int(),
  bufferTime: z.number().int(),
  hideBranding: z.boolean(),
  theme: z.string().nullish(),
  appTheme: z.string().nullish(),
  createdDate: z.date(),
  trialEndsAt: z.date().nullish(),
  lastActiveAt: z.date().nullish(),
  defaultScheduleId: z.number().int().nullish(),
  completedOnboarding: z.boolean(),
  locale: z.string().nullish(),
  timeFormat: z.number().int().nullish(),
  twoFactorSecret: z.string().nullish(),
  twoFactorEnabled: z.boolean(),
  backupCodes: z.string().nullish(),
  identityProvider: z.nativeEnum(IdentityProvider),
  identityProviderId: z.string().nullish(),
  invitedTo: z.number().int().nullish(),
  brandColor: z.string().nullish(),
  darkBrandColor: z.string().nullish(),
  allowDynamicBooking: z.boolean().nullish(),
  allowSEOIndexing: z.boolean().nullish(),
  receiveMonthlyDigestEmail: z.boolean().nullish(),
  metadata: userMetadata,
  verified: z.boolean().nullish(),
  role: z.nativeEnum(UserPermissionRole),
  disableImpersonation: z.boolean(),
  organizationId: z.number().int().nullish(),
  locked: z.boolean(),
  movedToProfileId: z.number().int().nullish(),
  isPlatformManaged: z.boolean(),
  smsLockState: z.nativeEnum(SMSLockState),
  smsLockReviewedByAdmin: z.boolean(),
  referralLinkId: z.string().nullish(),
  creationSource: z.nativeEnum(CreationSource).nullish(),
  whitelistWorkflows: z.boolean()
});
const UserModel = z.lazy(() => _UserModel.extend({
  password: UserPasswordModel.nullish(),
  travelSchedules: TravelScheduleModel.array(),
  eventTypes: EventTypeModel.array(),
  credentials: CredentialModel.array(),
  teams: MembershipModel.array(),
  bookings: BookingModel.array(),
  schedules: ScheduleModel.array(),
  selectedCalendars: SelectedCalendarModel.array(),
  availability: AvailabilityModel.array(),
  webhooks: WebhookModel.array(),
  destinationCalendar: DestinationCalendarModel.nullish(),
  impersonatedUsers: ImpersonationsModel.array(),
  impersonatedBy: ImpersonationsModel.array(),
  apiKeys: ApiKeyModel.array(),
  accounts: AccountModel.array(),
  sessions: SessionModel.array(),
  Feedback: FeedbackModel.array(),
  ownedEventTypes: EventTypeModel.array(),
  workflows: WorkflowModel.array(),
  routingForms: App_RoutingForms_FormModel.array(),
  updatedRoutingForms: App_RoutingForms_FormModel.array(),
  verifiedNumbers: VerifiedNumberModel.array(),
  verifiedEmails: VerifiedEmailModel.array(),
  hosts: HostModel.array(),
  organization: TeamModel.nullish(),
  accessCodes: AccessCodeModel.array(),
  bookingRedirects: OutOfOfficeEntryModel.array(),
  bookingRedirectsTo: OutOfOfficeEntryModel.array(),
  platformOAuthClients: PlatformOAuthClientModel.array(),
  AccessToken: AccessTokenModel.array(),
  RefreshToken: RefreshTokenModel.array(),
  PlatformAuthorizationToken: PlatformAuthorizationTokenModel.array(),
  profiles: ProfileModel.array(),
  movedToProfile: ProfileModel.nullish(),
  secondaryEmails: SecondaryEmailModel.array(),
  OutOfOfficeReasons: OutOfOfficeReasonModel.array(),
  NotificationsSubscriptions: NotificationsSubscriptionsModel.array(),
  features: UserFeaturesModel.array(),
  reassignedBookings: BookingModel.array(),
  createdAttributeToUsers: AttributeToUserModel.array(),
  updatedAttributeToUsers: AttributeToUserModel.array(),
  createdTranslations: EventTypeTranslationModel.array(),
  updatedTranslations: EventTypeTranslationModel.array(),
  createdWatchlists: WatchlistModel.array(),
  updatedWatchlists: WatchlistModel.array(),
  BookingInternalNote: BookingInternalNoteModel.array(),
  createdOrganizationOnboardings: OrganizationOnboardingModel.array(),
  filterSegments: FilterSegmentModel.array(),
  filterSegmentPreferences: UserFilterSegmentPreferenceModel.array(),
  creditBalance: CreditBalanceModel.nullish()
}));
const _NotificationsSubscriptionsModel = z.object({
  id: z.number().int(),
  userId: z.number().int(),
  subscription: z.string()
});
const NotificationsSubscriptionsModel = z.lazy(() => _NotificationsSubscriptionsModel.extend({
  user: UserModel
}));
const _ProfileModel = z.object({
  id: z.number().int(),
  uid: z.string(),
  userId: z.number().int(),
  organizationId: z.number().int(),
  username: z.string(),
  createdAt: z.date(),
  updatedAt: z.date()
});
const ProfileModel = z.lazy(() => _ProfileModel.extend({
  user: UserModel,
  organization: TeamModel,
  eventTypes: EventTypeModel.array(),
  movedFromUser: UserModel.nullish()
}));
const literalSchema$h = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$h = z.lazy(() => z.union([literalSchema$h, z.array(jsonSchema$h), z.record(jsonSchema$h)]));
const _TeamModel = z.object({
  id: z.number().int(),
  name: z.string().min(1),
  slug: z.string().min(1).nullish(),
  logoUrl: z.string().nullish(),
  calVideoLogo: z.string().nullish(),
  appLogo: z.string().nullish(),
  appIconLogo: z.string().nullish(),
  bio: z.string().nullish(),
  hideBranding: z.boolean(),
  hideTeamProfileLink: z.boolean(),
  isPrivate: z.boolean(),
  hideBookATeamMember: z.boolean(),
  createdAt: z.date(),
  metadata: teamMetadataSchema,
  theme: z.string().nullish(),
  rrResetInterval: z.nativeEnum(RRResetInterval).nullish(),
  rrTimestampBasis: z.nativeEnum(RRTimestampBasis),
  brandColor: z.string().nullish(),
  darkBrandColor: z.string().nullish(),
  bannerUrl: z.string().nullish(),
  parentId: z.number().int().nullish(),
  timeFormat: z.number().int().nullish(),
  timeZone: z.string(),
  weekStart: z.string(),
  isOrganization: z.boolean(),
  pendingPayment: z.boolean(),
  isPlatform: z.boolean(),
  createdByOAuthClientId: z.string().nullish(),
  smsLockState: z.nativeEnum(SMSLockState),
  smsLockReviewedByAdmin: z.boolean(),
  bookingLimits: intervalLimitsType,
  includeManagedEventsInLimits: z.boolean()
});
const TeamModel = z.lazy(() => _TeamModel.extend({
  members: MembershipModel.array(),
  eventTypes: EventTypeModel.array(),
  workflows: WorkflowModel.array(),
  verifiedNumbers: VerifiedNumberModel.array(),
  verifiedEmails: VerifiedEmailModel.array(),
  parent: TeamModel.nullish(),
  children: TeamModel.array(),
  orgUsers: UserModel.array(),
  inviteTokens: VerificationTokenModel.array(),
  webhooks: WebhookModel.array(),
  routingForms: App_RoutingForms_FormModel.array(),
  apiKeys: ApiKeyModel.array(),
  credentials: CredentialModel.array(),
  accessCodes: AccessCodeModel.array(),
  organizationSettings: OrganizationSettingsModel.nullish(),
  instantMeetingTokens: InstantMeetingTokenModel.array(),
  orgProfiles: ProfileModel.array(),
  dsyncTeamGroupMapping: DSyncTeamGroupMappingModel.array(),
  platformOAuthClient: PlatformOAuthClientModel.array(),
  createdByOAuthClient: PlatformOAuthClientModel.nullish(),
  platformBilling: PlatformBillingModel.nullish(),
  activeOrgWorkflows: WorkflowsOnTeamsModel.array(),
  attributes: AttributeModel.array(),
  delegationCredentials: DelegationCredentialModel.array(),
  domainWideDelegations: DomainWideDelegationModel.array(),
  roles: RoleModel.array(),
  features: TeamFeaturesModel.array(),
  internalNotePresets: InternalNotePresetModel.array(),
  creditBalance: CreditBalanceModel.nullish(),
  organizationOnboarding: OrganizationOnboardingModel.nullish(),
  managedOrganization: ManagedOrganizationModel.nullish(),
  managedOrganizations: ManagedOrganizationModel.array(),
  filterSegments: FilterSegmentModel.array()
}));
const _CreditBalanceModel = z.object({
  id: z.string(),
  teamId: z.number().int().nullish(),
  userId: z.number().int().nullish(),
  additionalCredits: z.number().int(),
  limitReachedAt: z.date().nullish(),
  warningSentAt: z.date().nullish()
});
const CreditBalanceModel = z.lazy(() => _CreditBalanceModel.extend({
  team: TeamModel.nullish(),
  user: UserModel.nullish(),
  expenseLogs: CreditExpenseLogModel.array(),
  purchaseLogs: CreditPurchaseLogModel.array()
}));
const _CreditPurchaseLogModel = z.object({
  id: z.string(),
  creditBalanceId: z.string(),
  credits: z.number().int(),
  createdAt: z.date()
});
const CreditPurchaseLogModel = z.lazy(() => _CreditPurchaseLogModel.extend({
  creditBalance: CreditBalanceModel
}));
const _CreditExpenseLogModel = z.object({
  id: z.string(),
  creditBalanceId: z.string(),
  bookingUid: z.string().nullish(),
  credits: z.number().int().nullish(),
  creditType: z.nativeEnum(CreditType),
  date: z.date(),
  smsSid: z.string().nullish(),
  smsSegments: z.number().int().nullish()
});
const CreditExpenseLogModel = z.lazy(() => _CreditExpenseLogModel.extend({
  creditBalance: CreditBalanceModel,
  booking: BookingModel.nullish()
}));
const _OrganizationSettingsModel = z.object({
  id: z.number().int(),
  organizationId: z.number().int(),
  isOrganizationConfigured: z.boolean(),
  isOrganizationVerified: z.boolean(),
  orgAutoAcceptEmail: z.string(),
  lockEventTypeCreationForUsers: z.boolean(),
  adminGetsNoSlotsNotification: z.boolean(),
  isAdminReviewed: z.boolean(),
  isAdminAPIEnabled: z.boolean(),
  allowSEOIndexing: z.boolean(),
  orgProfileRedirectsToVerifiedDomain: z.boolean(),
  disablePhoneOnlySMSNotifications: z.boolean()
});
const OrganizationSettingsModel = z.lazy(() => _OrganizationSettingsModel.extend({
  organization: TeamModel,
  dSyncData: DSyncDataModel.nullish()
}));
const _MembershipModel = z.object({
  id: z.number().int(),
  teamId: z.number().int(),
  userId: z.number().int(),
  accepted: z.boolean(),
  role: z.nativeEnum(MembershipRole),
  customRoleId: z.string().nullish(),
  disableImpersonation: z.boolean(),
  createdAt: z.date().nullish(),
  updatedAt: z.date().nullish()
});
const MembershipModel = z.lazy(() => _MembershipModel.extend({
  customRole: RoleModel.nullish(),
  team: TeamModel,
  user: UserModel,
  AttributeToUser: AttributeToUserModel.array()
}));
const _VerificationTokenModel = z.object({
  id: z.number().int(),
  identifier: z.string(),
  token: z.string(),
  expires: z.date(),
  expiresInDays: z.number().int().nullish(),
  createdAt: z.date(),
  updatedAt: z.date(),
  teamId: z.number().int().nullish(),
  secondaryEmailId: z.number().int().nullish()
});
const VerificationTokenModel = z.lazy(() => _VerificationTokenModel.extend({
  team: TeamModel.nullish(),
  secondaryEmail: SecondaryEmailModel.nullish()
}));
const _InstantMeetingTokenModel = z.object({
  id: z.number().int(),
  token: z.string(),
  expires: z.date(),
  teamId: z.number().int(),
  bookingId: z.number().int().nullish(),
  createdAt: z.date(),
  updatedAt: z.date()
});
const InstantMeetingTokenModel = z.lazy(() => _InstantMeetingTokenModel.extend({
  team: TeamModel,
  booking: BookingModel.nullish()
}));
const _BookingReferenceModel = z.object({
  id: z.number().int(),
  type: z.string().min(1),
  uid: z.string().min(1),
  meetingId: z.string().nullish(),
  thirdPartyRecurringEventId: z.string().nullish(),
  meetingPassword: z.string().nullish(),
  meetingUrl: z.string().nullish(),
  bookingId: z.number().int().nullish(),
  externalCalendarId: z.string().nullish(),
  deleted: z.boolean().nullish(),
  credentialId: z.number().int().nullish(),
  delegationCredentialId: z.string().nullish(),
  domainWideDelegationCredentialId: z.string().nullish()
});
const BookingReferenceModel = z.lazy(() => _BookingReferenceModel.extend({
  booking: BookingModel.nullish(),
  credential: CredentialModel.nullish(),
  delegationCredential: DelegationCredentialModel.nullish(),
  domainWideDelegation: DomainWideDelegationModel.nullish()
}));
const _AttendeeModel = z.object({
  id: z.number().int(),
  email: z.string(),
  name: z.string(),
  timeZone: z.string(),
  phoneNumber: z.string().nullish(),
  locale: z.string().nullish(),
  bookingId: z.number().int().nullish(),
  noShow: z.boolean().nullish()
});
const AttendeeModel = z.lazy(() => _AttendeeModel.extend({
  booking: BookingModel.nullish(),
  bookingSeat: BookingSeatModel.nullish()
}));
const literalSchema$g = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$g = z.lazy(() => z.union([literalSchema$g, z.array(jsonSchema$g), z.record(jsonSchema$g)]));
const _BookingModel = z.object({
  id: z.number().int(),
  uid: z.string(),
  idempotencyKey: z.string().nullish(),
  userId: z.number().int().nullish(),
  userPrimaryEmail: emailSchema.nullish(),
  eventTypeId: z.number().int().nullish(),
  title: z.string(),
  description: z.string().nullish(),
  customInputs: jsonSchema$g,
  responses: bookingResponses,
  startTime: z.date(),
  endTime: z.date(),
  location: z.string().nullish(),
  createdAt: z.date(),
  updatedAt: z.date().nullish(),
  status: z.nativeEnum(BookingStatus),
  paid: z.boolean(),
  destinationCalendarId: z.number().int().nullish(),
  cancellationReason: z.string().nullish(),
  rejectionReason: z.string().nullish(),
  reassignReason: z.string().nullish(),
  reassignById: z.number().int().nullish(),
  dynamicEventSlugRef: z.string().nullish(),
  dynamicGroupSlugRef: z.string().nullish(),
  rescheduled: z.boolean().nullish(),
  fromReschedule: z.string().nullish(),
  recurringEventId: z.string().nullish(),
  smsReminderNumber: z.string().nullish(),
  scheduledJobs: z.string().array(),
  metadata: bookingMetadataSchema,
  isRecorded: z.boolean(),
  iCalUID: z.string().nullish(),
  iCalSequence: z.number().int(),
  rating: z.number().int().nullish(),
  ratingFeedback: z.string().nullish(),
  noShowHost: z.boolean().nullish(),
  oneTimePassword: z.string().nullish(),
  cancelledBy: z.string().email().nullish(),
  rescheduledBy: z.string().email().nullish(),
  creationSource: z.nativeEnum(CreationSource).nullish()
});
const BookingModel = z.lazy(() => _BookingModel.extend({
  user: UserModel.nullish(),
  references: BookingReferenceModel.array(),
  eventType: EventTypeModel.nullish(),
  attendees: AttendeeModel.array(),
  payment: PaymentModel.array(),
  destinationCalendar: DestinationCalendarModel.nullish(),
  reassignBy: UserModel.nullish(),
  workflowReminders: WorkflowReminderModel.array(),
  seatsReferences: BookingSeatModel.array(),
  instantMeetingToken: InstantMeetingTokenModel.nullish(),
  scheduledTriggers: WebhookScheduledTriggersModel.array(),
  routedFromRoutingFormReponse: App_RoutingForms_FormResponseModel.nullish(),
  assignmentReason: AssignmentReasonModel.array(),
  internalNote: BookingInternalNoteModel.array(),
  tracking: TrackingModel.nullish(),
  routingFormResponses: RoutingFormResponseDenormalizedModel.array(),
  expenseLogs: CreditExpenseLogModel.array()
}));
const _TrackingModel = z.object({
  id: z.number().int(),
  bookingId: z.number().int(),
  utm_source: z.string().nullish(),
  utm_medium: z.string().nullish(),
  utm_campaign: z.string().nullish(),
  utm_term: z.string().nullish(),
  utm_content: z.string().nullish()
});
const TrackingModel = z.lazy(() => _TrackingModel.extend({
  booking: BookingModel
}));
const _ScheduleModel = z.object({
  id: z.number().int(),
  userId: z.number().int(),
  name: z.string(),
  timeZone: z.string().nullish()
});
const ScheduleModel = z.lazy(() => _ScheduleModel.extend({
  user: UserModel,
  eventType: EventTypeModel.array(),
  instantMeetingEvents: EventTypeModel.array(),
  restrictionSchedule: EventTypeModel.array(),
  availability: AvailabilityModel.array(),
  Host: HostModel.array()
}));
const _AvailabilityModel = z.object({
  id: z.number().int(),
  userId: z.number().int().nullish(),
  eventTypeId: z.number().int().nullish(),
  days: z.number().int().array(),
  startTime: z.date(),
  endTime: z.date(),
  date: z.date().nullish(),
  scheduleId: z.number().int().nullish()
});
const AvailabilityModel = z.lazy(() => _AvailabilityModel.extend({
  user: UserModel.nullish(),
  eventType: EventTypeModel.nullish(),
  Schedule: ScheduleModel.nullish()
}));
const _SelectedCalendarModel = z.object({
  id: z.string(),
  userId: z.number().int(),
  integration: z.string(),
  externalId: z.string(),
  credentialId: z.number().int().nullish(),
  createdAt: z.date().nullish(),
  updatedAt: z.date().nullish(),
  googleChannelId: z.string().nullish(),
  googleChannelKind: z.string().nullish(),
  googleChannelResourceId: z.string().nullish(),
  googleChannelResourceUri: z.string().nullish(),
  googleChannelExpiration: z.string().nullish(),
  delegationCredentialId: z.string().nullish(),
  domainWideDelegationCredentialId: z.string().nullish(),
  error: z.string().nullish(),
  lastErrorAt: z.date().nullish(),
  watchAttempts: z.number().int(),
  unwatchAttempts: z.number().int(),
  maxAttempts: z.number().int(),
  eventTypeId: z.number().int().nullish()
});
const SelectedCalendarModel = z.lazy(() => _SelectedCalendarModel.extend({
  user: UserModel,
  credential: CredentialModel.nullish(),
  delegationCredential: DelegationCredentialModel.nullish(),
  domainWideDelegationCredential: DomainWideDelegationModel.nullish(),
  eventType: EventTypeModel.nullish()
}));
const literalSchema$f = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$f = z.lazy(() => z.union([literalSchema$f, z.array(jsonSchema$f), z.record(jsonSchema$f)]));
const _EventTypeCustomInputModel = z.object({
  id: z.number().int(),
  eventTypeId: z.number().int(),
  label: z.string(),
  type: z.nativeEnum(EventTypeCustomInputType),
  options: customInputOptionSchema,
  required: z.boolean(),
  placeholder: z.string()
});
const EventTypeCustomInputModel = z.lazy(() => _EventTypeCustomInputModel.extend({
  eventType: EventTypeModel
}));
z.object({
  id: z.string(),
  createdAt: z.date(),
  updatedAt: z.date(),
  email: z.string(),
  expires: z.date()
});
z.object({
  id: z.number().int(),
  referenceId: z.number().int(),
  reminderType: z.nativeEnum(ReminderType),
  elapsedMinutes: z.number().int(),
  createdAt: z.date()
});
const literalSchema$e = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$e = z.lazy(() => z.union([literalSchema$e, z.array(jsonSchema$e), z.record(jsonSchema$e)]));
const _PaymentModel = z.object({
  id: z.number().int(),
  uid: z.string(),
  appId: z.string().nullish(),
  bookingId: z.number().int(),
  amount: z.number().int(),
  fee: z.number().int(),
  currency: z.string(),
  success: z.boolean(),
  refunded: z.boolean(),
  data: jsonSchema$e,
  externalId: z.string(),
  paymentOption: z.nativeEnum(PaymentOption).nullish()
});
const PaymentModel = z.lazy(() => _PaymentModel.extend({
  app: AppModel.nullish(),
  booking: BookingModel.nullish()
}));
const _WebhookModel = z.object({
  id: z.string(),
  userId: z.number().int().nullish(),
  teamId: z.number().int().nullish(),
  eventTypeId: z.number().int().nullish(),
  platformOAuthClientId: z.string().nullish(),
  subscriberUrl: z.string().url(),
  payloadTemplate: z.string().nullish(),
  createdAt: z.date(),
  active: z.boolean(),
  eventTriggers: z.nativeEnum(WebhookTriggerEvents).array(),
  appId: z.string().nullish(),
  secret: z.string().nullish(),
  platform: z.boolean(),
  time: z.number().int().nullish(),
  timeUnit: z.nativeEnum(TimeUnit).nullish()
});
const WebhookModel = z.lazy(() => _WebhookModel.extend({
  user: UserModel.nullish(),
  team: TeamModel.nullish(),
  eventType: EventTypeModel.nullish(),
  platformOAuthClient: PlatformOAuthClientModel.nullish(),
  app: AppModel.nullish(),
  scheduledTriggers: WebhookScheduledTriggersModel.array()
}));
const _ImpersonationsModel = z.object({
  id: z.number().int(),
  createdAt: z.date(),
  impersonatedUserId: z.number().int(),
  impersonatedById: z.number().int()
});
const ImpersonationsModel = z.lazy(() => _ImpersonationsModel.extend({
  impersonatedUser: UserModel,
  impersonatedBy: UserModel
}));
const _ApiKeyModel = z.object({
  id: z.string(),
  userId: z.number().int(),
  teamId: z.number().int().nullish(),
  note: z.string().nullish(),
  createdAt: z.date(),
  expiresAt: z.date().nullish(),
  lastUsedAt: z.date().nullish(),
  hashedKey: z.string(),
  appId: z.string().nullish()
});
const ApiKeyModel = z.lazy(() => _ApiKeyModel.extend({
  user: UserModel.nullish(),
  team: TeamModel.nullish(),
  app: AppModel.nullish(),
  rateLimits: RateLimitModel.array()
}));
const _RateLimitModel = z.object({
  id: z.string(),
  name: z.string(),
  apiKeyId: z.string(),
  ttl: z.number().int(),
  limit: z.number().int(),
  blockDuration: z.number().int(),
  createdAt: z.date(),
  updatedAt: z.date()
});
const RateLimitModel = z.lazy(() => _RateLimitModel.extend({
  apiKey: ApiKeyModel
}));
const _HashedLinkModel = z.object({
  id: z.number().int(),
  link: z.string(),
  eventTypeId: z.number().int(),
  expiresAt: z.date().nullish(),
  maxUsageCount: z.number().int(),
  usageCount: z.number().int()
});
const HashedLinkModel = z.lazy(() => _HashedLinkModel.extend({
  eventType: EventTypeModel
}));
const _AccountModel = z.object({
  id: z.string(),
  userId: z.number().int(),
  type: z.string(),
  provider: z.string(),
  providerAccountId: z.string(),
  providerEmail: z.string().nullish(),
  refresh_token: z.string().nullish(),
  access_token: z.string().nullish(),
  expires_at: z.number().int().nullish(),
  token_type: z.string().nullish(),
  scope: z.string().nullish(),
  id_token: z.string().nullish(),
  session_state: z.string().nullish()
});
const AccountModel = z.lazy(() => _AccountModel.extend({
  user: UserModel.nullish()
}));
const _SessionModel = z.object({
  id: z.string(),
  sessionToken: z.string(),
  userId: z.number().int(),
  expires: z.date()
});
const SessionModel = z.lazy(() => _SessionModel.extend({
  user: UserModel.nullish()
}));
const literalSchema$d = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$d = z.lazy(() => z.union([literalSchema$d, z.array(jsonSchema$d), z.record(jsonSchema$d)]));
const _AppModel = z.object({
  slug: z.string(),
  dirName: z.string(),
  keys: jsonSchema$d,
  categories: z.nativeEnum(AppCategories).array(),
  createdAt: z.date(),
  updatedAt: z.date(),
  enabled: z.boolean()
});
const AppModel = z.lazy(() => _AppModel.extend({
  credentials: CredentialModel.array(),
  payments: PaymentModel.array(),
  Webhook: WebhookModel.array(),
  ApiKey: ApiKeyModel.array()
}));
const literalSchema$c = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$c = z.lazy(() => z.union([literalSchema$c, z.array(jsonSchema$c), z.record(jsonSchema$c)]));
const _App_RoutingForms_FormModel = z.object({
  id: z.string(),
  description: z.string().nullish(),
  position: z.number().int(),
  routes: jsonSchema$c,
  createdAt: z.date(),
  updatedAt: z.date(),
  name: z.string(),
  fields: jsonSchema$c,
  updatedById: z.number().int().nullish(),
  userId: z.number().int(),
  teamId: z.number().int().nullish(),
  disabled: z.boolean(),
  settings: RoutingFormSettings
});
const App_RoutingForms_FormModel = z.lazy(() => _App_RoutingForms_FormModel.extend({
  user: UserModel,
  updatedBy: UserModel.nullish(),
  team: TeamModel.nullish(),
  responses: App_RoutingForms_FormResponseModel.array(),
  queuedResponses: App_RoutingForms_QueuedFormResponseModel.array(),
  incompleteBookingActions: App_RoutingForms_IncompleteBookingActionsModel.array()
}));
const literalSchema$b = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$b = z.lazy(() => z.union([literalSchema$b, z.array(jsonSchema$b), z.record(jsonSchema$b)]));
const _App_RoutingForms_FormResponseModel = z.object({
  id: z.number().int(),
  uuid: z.string().nullish(),
  formFillerId: z.string(),
  formId: z.string(),
  response: jsonSchema$b,
  createdAt: z.date(),
  updatedAt: z.date().nullish(),
  routedToBookingUid: z.string().nullish(),
  chosenRouteId: z.string().nullish()
});
const App_RoutingForms_FormResponseModel = z.lazy(() => _App_RoutingForms_FormResponseModel.extend({
  form: App_RoutingForms_FormModel,
  routedToBooking: BookingModel.nullish(),
  routingFormResponseFields: RoutingFormResponseFieldModel.array(),
  routingFormResponses: RoutingFormResponseDenormalizedModel.array(),
  queuedFormResponse: App_RoutingForms_QueuedFormResponseModel.nullish()
}));
const literalSchema$a = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$a = z.lazy(() => z.union([literalSchema$a, z.array(jsonSchema$a), z.record(jsonSchema$a)]));
const _App_RoutingForms_QueuedFormResponseModel = z.object({
  id: z.string(),
  formId: z.string(),
  response: jsonSchema$a,
  chosenRouteId: z.string().nullish(),
  createdAt: z.date(),
  updatedAt: z.date().nullish(),
  actualResponseId: z.number().int().nullish()
});
const App_RoutingForms_QueuedFormResponseModel = z.lazy(() => _App_RoutingForms_QueuedFormResponseModel.extend({
  form: App_RoutingForms_FormModel,
  actualResponse: App_RoutingForms_FormResponseModel.nullish()
}));
const _RoutingFormResponseFieldModel = z.object({
  id: z.number().int(),
  responseId: z.number().int(),
  fieldId: z.string(),
  valueString: z.string().nullish(),
  valueNumber: z.number().nullish(),
  valueStringArray: z.string().array()
});
const RoutingFormResponseFieldModel = z.lazy(() => _RoutingFormResponseFieldModel.extend({
  response: App_RoutingForms_FormResponseModel,
  denormalized: RoutingFormResponseDenormalizedModel
}));
const _RoutingFormResponseDenormalizedModel = z.object({
  id: z.number().int(),
  uuid: z.string().nullish(),
  formId: z.string(),
  formName: z.string(),
  formTeamId: z.number().int().nullish(),
  formUserId: z.number().int(),
  bookingUid: z.string().nullish(),
  bookingId: z.number().int().nullish(),
  bookingStatus: z.nativeEnum(BookingStatus).nullish(),
  bookingStatusOrder: z.number().int().nullish(),
  bookingCreatedAt: z.date().nullish(),
  bookingStartTime: z.date().nullish(),
  bookingEndTime: z.date().nullish(),
  bookingUserId: z.number().int().nullish(),
  bookingUserName: z.string().nullish(),
  bookingUserEmail: z.string().nullish(),
  bookingUserAvatarUrl: z.string().nullish(),
  bookingAssignmentReason: z.string().nullish(),
  eventTypeId: z.number().int().nullish(),
  eventTypeParentId: z.number().int().nullish(),
  eventTypeSchedulingType: z.string().nullish(),
  createdAt: z.date(),
  utm_source: z.string().nullish(),
  utm_medium: z.string().nullish(),
  utm_campaign: z.string().nullish(),
  utm_term: z.string().nullish(),
  utm_content: z.string().nullish()
});
const RoutingFormResponseDenormalizedModel = z.lazy(() => _RoutingFormResponseDenormalizedModel.extend({
  booking: BookingModel.nullish(),
  response: App_RoutingForms_FormResponseModel,
  fields: RoutingFormResponseFieldModel.array()
}));
const _FeedbackModel = z.object({
  id: z.number().int(),
  date: z.date(),
  userId: z.number().int(),
  rating: z.string(),
  comment: z.string().nullish()
});
const FeedbackModel = z.lazy(() => _FeedbackModel.extend({
  user: UserModel
}));
const _WorkflowStepModel = z.object({
  id: z.number().int(),
  stepNumber: z.number().int(),
  action: z.nativeEnum(WorkflowActions),
  workflowId: z.number().int(),
  sendTo: z.string().nullish(),
  reminderBody: z.string().nullish(),
  emailSubject: z.string().nullish(),
  template: z.nativeEnum(WorkflowTemplates),
  numberRequired: z.boolean().nullish(),
  sender: z.string().nullish(),
  numberVerificationPending: z.boolean(),
  includeCalendarEvent: z.boolean(),
  verifiedAt: z.date().nullish()
});
const WorkflowStepModel = z.lazy(() => _WorkflowStepModel.extend({
  workflow: WorkflowModel,
  workflowReminders: WorkflowReminderModel.array()
}));
const _WorkflowModel = z.object({
  id: z.number().int(),
  position: z.number().int(),
  name: z.string(),
  userId: z.number().int().nullish(),
  teamId: z.number().int().nullish(),
  isActiveOnAll: z.boolean(),
  trigger: z.nativeEnum(WorkflowTriggerEvents),
  time: z.number().int().nullish(),
  timeUnit: z.nativeEnum(TimeUnit).nullish()
});
const WorkflowModel = z.lazy(() => _WorkflowModel.extend({
  user: UserModel.nullish(),
  team: TeamModel.nullish(),
  activeOn: WorkflowsOnEventTypesModel.array(),
  activeOnTeams: WorkflowsOnTeamsModel.array(),
  steps: WorkflowStepModel.array()
}));
const _AIPhoneCallConfigurationModel = z.object({
  id: z.number().int(),
  eventTypeId: z.number().int(),
  templateType: z.string(),
  schedulerName: z.string().nullish(),
  generalPrompt: z.string().nullish(),
  yourPhoneNumber: z.string(),
  numberToCall: z.string(),
  guestName: z.string().nullish(),
  guestEmail: z.string().nullish(),
  guestCompany: z.string().nullish(),
  enabled: z.boolean(),
  beginMessage: z.string().nullish(),
  llmId: z.string().nullish()
});
const AIPhoneCallConfigurationModel = z.lazy(() => _AIPhoneCallConfigurationModel.extend({
  eventType: EventTypeModel
}));
const _WorkflowsOnEventTypesModel = z.object({
  id: z.number().int(),
  workflowId: z.number().int(),
  eventTypeId: z.number().int()
});
const WorkflowsOnEventTypesModel = z.lazy(() => _WorkflowsOnEventTypesModel.extend({
  workflow: WorkflowModel,
  eventType: EventTypeModel
}));
const _WorkflowsOnTeamsModel = z.object({
  id: z.number().int(),
  workflowId: z.number().int(),
  teamId: z.number().int()
});
const WorkflowsOnTeamsModel = z.lazy(() => _WorkflowsOnTeamsModel.extend({
  workflow: WorkflowModel,
  team: TeamModel
}));
const literalSchema$9 = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$9 = z.lazy(() => z.union([literalSchema$9, z.array(jsonSchema$9), z.record(jsonSchema$9)]));
z.object({
  /**
   * This is a single row table, so we use a fixed id
   */
  id: z.number().int(),
  logo: z.string().nullish(),
  theme: DeploymentTheme,
  licenseKey: z.string().nullish(),
  signatureTokenEncrypted: z.string().nullish(),
  agreedLicenseAt: z.date().nullish()
});
const _WorkflowReminderModel = z.object({
  id: z.number().int(),
  uuid: z.string().nullish(),
  bookingUid: z.string().nullish(),
  method: z.nativeEnum(WorkflowMethods),
  scheduledDate: z.date(),
  referenceId: z.string().nullish(),
  scheduled: z.boolean(),
  workflowStepId: z.number().int().nullish(),
  cancelled: z.boolean().nullish(),
  seatReferenceId: z.string().nullish(),
  isMandatoryReminder: z.boolean().nullish(),
  retryCount: z.number().int()
});
const WorkflowReminderModel = z.lazy(() => _WorkflowReminderModel.extend({
  booking: BookingModel.nullish(),
  workflowStep: WorkflowStepModel.nullish()
}));
const _WebhookScheduledTriggersModel = z.object({
  id: z.number().int(),
  jobName: z.string().nullish(),
  subscriberUrl: z.string(),
  payload: z.string(),
  startAfter: z.date(),
  retryCount: z.number().int(),
  createdAt: z.date().nullish(),
  appId: z.string().nullish(),
  webhookId: z.string().nullish(),
  bookingId: z.number().int().nullish()
});
const WebhookScheduledTriggersModel = z.lazy(() => _WebhookScheduledTriggersModel.extend({
  webhook: WebhookModel.nullish(),
  booking: BookingModel.nullish()
}));
const literalSchema$8 = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$8 = z.lazy(() => z.union([literalSchema$8, z.array(jsonSchema$8), z.record(jsonSchema$8)]));
const _BookingSeatModel = z.object({
  id: z.number().int(),
  referenceUid: z.string(),
  bookingId: z.number().int(),
  attendeeId: z.number().int(),
  data: bookingSeatDataSchema,
  metadata: jsonSchema$8
});
const BookingSeatModel = z.lazy(() => _BookingSeatModel.extend({
  booking: BookingModel,
  attendee: AttendeeModel
}));
const _VerifiedNumberModel = z.object({
  id: z.number().int(),
  userId: z.number().int().nullish(),
  teamId: z.number().int().nullish(),
  phoneNumber: z.string()
});
const VerifiedNumberModel = z.lazy(() => _VerifiedNumberModel.extend({
  user: UserModel.nullish(),
  team: TeamModel.nullish()
}));
const _VerifiedEmailModel = z.object({
  id: z.number().int(),
  userId: z.number().int().nullish(),
  teamId: z.number().int().nullish(),
  email: z.string()
});
const VerifiedEmailModel = z.lazy(() => _VerifiedEmailModel.extend({
  user: UserModel.nullish(),
  team: TeamModel.nullish()
}));
const _FeatureModel = z.object({
  slug: z.string(),
  enabled: z.boolean(),
  description: z.string().nullish(),
  type: z.nativeEnum(FeatureType).nullish(),
  stale: z.boolean().nullish(),
  lastUsedAt: z.date().nullish(),
  createdAt: z.date().nullish(),
  updatedAt: z.date().nullish(),
  updatedBy: z.number().int().nullish()
});
const FeatureModel = z.lazy(() => _FeatureModel.extend({
  users: UserFeaturesModel.array(),
  teams: TeamFeaturesModel.array()
}));
const _UserFeaturesModel = z.object({
  userId: z.number().int(),
  featureId: z.string(),
  assignedAt: z.date(),
  assignedBy: z.string(),
  updatedAt: z.date()
});
const UserFeaturesModel = z.lazy(() => _UserFeaturesModel.extend({
  user: UserModel,
  feature: FeatureModel
}));
const _TeamFeaturesModel = z.object({
  teamId: z.number().int(),
  featureId: z.string(),
  assignedAt: z.date(),
  assignedBy: z.string(),
  updatedAt: z.date()
});
const TeamFeaturesModel = z.lazy(() => _TeamFeaturesModel.extend({
  team: TeamModel,
  feature: FeatureModel
}));
z.object({
  id: z.number().int(),
  eventTypeId: z.number().int(),
  userId: z.number().int(),
  slotUtcStartDate: z.date(),
  slotUtcEndDate: z.date(),
  uid: z.string(),
  releaseAt: z.date(),
  isSeat: z.boolean()
});
const _OAuthClientModel = z.object({
  clientId: z.string(),
  redirectUri: z.string(),
  clientSecret: z.string(),
  name: z.string(),
  logo: z.string().nullish()
});
const OAuthClientModel = z.lazy(() => _OAuthClientModel.extend({
  accessCodes: AccessCodeModel.array()
}));
const _AccessCodeModel = z.object({
  id: z.number().int(),
  code: z.string(),
  clientId: z.string().nullish(),
  expiresAt: z.date(),
  scopes: z.nativeEnum(AccessScope).array(),
  userId: z.number().int().nullish(),
  teamId: z.number().int().nullish()
});
const AccessCodeModel = z.lazy(() => _AccessCodeModel.extend({
  client: OAuthClientModel.nullish(),
  user: UserModel.nullish(),
  team: TeamModel.nullish()
}));
z.object({
  id: z.number().int(),
  uid: z.string(),
  eventTypeId: z.number().int().nullish(),
  title: z.string(),
  description: z.string().nullish(),
  startTime: z.date(),
  endTime: z.date(),
  createdAt: z.date(),
  updatedAt: z.date().nullish(),
  location: z.string().nullish(),
  paid: z.boolean(),
  status: z.nativeEnum(BookingStatus),
  rescheduled: z.boolean().nullish(),
  userId: z.number().int().nullish(),
  teamId: z.number().int().nullish(),
  eventLength: z.number().int().nullish(),
  eventParentId: z.number().int().nullish(),
  userEmail: z.string().nullish(),
  userName: z.string().nullish(),
  userUsername: z.string().nullish(),
  ratingFeedback: z.string().nullish(),
  rating: z.number().int().nullish(),
  noShowHost: z.boolean().nullish(),
  isTeamBooking: z.boolean()
});
const literalSchema$7 = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$7 = z.lazy(() => z.union([literalSchema$7, z.array(jsonSchema$7), z.record(jsonSchema$7)]));
const _CalendarCacheModel = z.object({
  id: z.string().nullish(),
  key: z.string(),
  value: jsonSchema$7,
  expiresAt: z.date(),
  updatedAt: z.date(),
  credentialId: z.number().int(),
  userId: z.number().int().nullish()
});
const CalendarCacheModel = z.lazy(() => _CalendarCacheModel.extend({
  credential: CredentialModel.nullish()
}));
z.object({
  id: z.number().int(),
  from: z.string(),
  fromOrgId: z.number().int(),
  type: z.nativeEnum(RedirectType),
  toUrl: z.string(),
  enabled: z.boolean(),
  createdAt: z.date(),
  updatedAt: z.date()
});
z.object({
  teamId: z.number().int(),
  userId: z.number().int(),
  data: z.string(),
  objectKey: z.string(),
  isBanner: z.boolean()
});
const _OutOfOfficeEntryModel = z.object({
  id: z.number().int(),
  uuid: z.string(),
  start: z.date(),
  end: z.date(),
  notes: z.string().nullish(),
  userId: z.number().int(),
  toUserId: z.number().int().nullish(),
  reasonId: z.number().int().nullish(),
  createdAt: z.date(),
  updatedAt: z.date()
});
const OutOfOfficeEntryModel = z.lazy(() => _OutOfOfficeEntryModel.extend({
  user: UserModel,
  toUser: UserModel.nullish(),
  reason: OutOfOfficeReasonModel.nullish()
}));
const _OutOfOfficeReasonModel = z.object({
  id: z.number().int(),
  emoji: z.string(),
  reason: z.string(),
  enabled: z.boolean(),
  userId: z.number().int().nullish()
});
const OutOfOfficeReasonModel = z.lazy(() => _OutOfOfficeReasonModel.extend({
  user: UserModel.nullish(),
  entries: OutOfOfficeEntryModel.array()
}));
const _PlatformOAuthClientModel = z.object({
  id: z.string(),
  name: z.string(),
  secret: z.string(),
  permissions: z.number().int(),
  logo: z.string().nullish(),
  redirectUris: z.string().array(),
  organizationId: z.number().int(),
  bookingRedirectUri: z.string().nullish(),
  bookingCancelRedirectUri: z.string().nullish(),
  bookingRescheduleRedirectUri: z.string().nullish(),
  areEmailsEnabled: z.boolean(),
  areDefaultEventTypesEnabled: z.boolean(),
  areCalendarEventsEnabled: z.boolean(),
  createdAt: z.date()
});
const PlatformOAuthClientModel = z.lazy(() => _PlatformOAuthClientModel.extend({
  users: UserModel.array(),
  organization: TeamModel,
  teams: TeamModel.array(),
  accessTokens: AccessTokenModel.array(),
  refreshToken: RefreshTokenModel.array(),
  authorizationTokens: PlatformAuthorizationTokenModel.array(),
  webhook: WebhookModel.array()
}));
const _PlatformAuthorizationTokenModel = z.object({
  id: z.string(),
  platformOAuthClientId: z.string(),
  userId: z.number().int(),
  createdAt: z.date()
});
const PlatformAuthorizationTokenModel = z.lazy(() => _PlatformAuthorizationTokenModel.extend({
  owner: UserModel,
  client: PlatformOAuthClientModel
}));
const _AccessTokenModel = z.object({
  id: z.number().int(),
  secret: z.string(),
  createdAt: z.date(),
  expiresAt: z.date(),
  platformOAuthClientId: z.string(),
  userId: z.number().int()
});
const AccessTokenModel = z.lazy(() => _AccessTokenModel.extend({
  owner: UserModel,
  client: PlatformOAuthClientModel
}));
const _RefreshTokenModel = z.object({
  id: z.number().int(),
  secret: z.string(),
  createdAt: z.date(),
  expiresAt: z.date(),
  platformOAuthClientId: z.string(),
  userId: z.number().int()
});
const RefreshTokenModel = z.lazy(() => _RefreshTokenModel.extend({
  owner: UserModel,
  client: PlatformOAuthClientModel
}));
const _DSyncDataModel = z.object({
  id: z.number().int(),
  directoryId: z.string(),
  tenant: z.string(),
  organizationId: z.number().int().nullish()
});
const DSyncDataModel = z.lazy(() => _DSyncDataModel.extend({
  org: OrganizationSettingsModel.nullish(),
  teamGroupMapping: DSyncTeamGroupMappingModel.array(),
  createdAttributeToUsers: AttributeToUserModel.array(),
  updatedAttributeToUsers: AttributeToUserModel.array()
}));
const _DSyncTeamGroupMappingModel = z.object({
  id: z.number().int(),
  organizationId: z.number().int(),
  teamId: z.number().int(),
  directoryId: z.string(),
  groupName: z.string()
});
const DSyncTeamGroupMappingModel = z.lazy(() => _DSyncTeamGroupMappingModel.extend({
  team: TeamModel,
  directory: DSyncDataModel
}));
const _SecondaryEmailModel = z.object({
  id: z.number().int(),
  userId: z.number().int(),
  email: z.string(),
  emailVerified: z.date().nullish()
});
const SecondaryEmailModel = z.lazy(() => _SecondaryEmailModel.extend({
  user: UserModel,
  verificationTokens: VerificationTokenModel.array(),
  eventTypes: EventTypeModel.array()
}));
z.object({
  id: z.string(),
  createdAt: z.date(),
  updatedAt: z.date(),
  scheduledAt: z.date(),
  succeededAt: z.date().nullish(),
  type: z.string(),
  payload: z.string(),
  attempts: z.number().int(),
  maxAttempts: z.number().int(),
  lastError: z.string().nullish(),
  lastFailedAttemptAt: z.date().nullish(),
  referenceUid: z.string().nullish()
});
const _ManagedOrganizationModel = z.object({
  managedOrganizationId: z.number().int(),
  managerOrganizationId: z.number().int(),
  createdAt: z.date()
});
const ManagedOrganizationModel = z.lazy(() => _ManagedOrganizationModel.extend({
  managedOrganization: TeamModel,
  managerOrganization: TeamModel
}));
const _PlatformBillingModel = z.object({
  id: z.number().int(),
  customerId: z.string(),
  subscriptionId: z.string().nullish(),
  priceId: z.string().nullish(),
  plan: z.string(),
  billingCycleStart: z.number().int().nullish(),
  billingCycleEnd: z.number().int().nullish(),
  overdue: z.boolean().nullish(),
  managerBillingId: z.number().int().nullish()
});
const PlatformBillingModel = z.lazy(() => _PlatformBillingModel.extend({
  managerBilling: PlatformBillingModel.nullish(),
  managedBillings: PlatformBillingModel.array(),
  team: TeamModel
}));
const _AttributeOptionModel = z.object({
  id: z.string(),
  attributeId: z.string(),
  value: z.string(),
  slug: z.string(),
  isGroup: z.boolean(),
  contains: z.string().array()
});
const AttributeOptionModel = z.lazy(() => _AttributeOptionModel.extend({
  attribute: AttributeModel,
  assignedUsers: AttributeToUserModel.array()
}));
const _AttributeModel = z.object({
  id: z.string(),
  teamId: z.number().int(),
  type: z.nativeEnum(AttributeType),
  name: z.string(),
  slug: z.string(),
  enabled: z.boolean(),
  usersCanEditRelation: z.boolean(),
  createdAt: z.date(),
  updatedAt: z.date(),
  isWeightsEnabled: z.boolean(),
  isLocked: z.boolean()
});
const AttributeModel = z.lazy(() => _AttributeModel.extend({
  team: TeamModel,
  options: AttributeOptionModel.array()
}));
const _AttributeToUserModel = z.object({
  id: z.string(),
  memberId: z.number().int(),
  attributeOptionId: z.string(),
  weight: z.number().int().nullish(),
  createdAt: z.date(),
  createdById: z.number().int().nullish(),
  createdByDSyncId: z.string().nullish(),
  updatedAt: z.date().nullish(),
  updatedById: z.number().int().nullish(),
  updatedByDSyncId: z.string().nullish()
});
const AttributeToUserModel = z.lazy(() => _AttributeToUserModel.extend({
  member: MembershipModel,
  attributeOption: AttributeOptionModel,
  createdBy: UserModel.nullish(),
  createdByDSync: DSyncDataModel.nullish(),
  updatedBy: UserModel.nullish(),
  updatedByDSync: DSyncDataModel.nullish()
}));
const _AssignmentReasonModel = z.object({
  id: z.number().int(),
  createdAt: z.date(),
  bookingId: z.number().int(),
  reasonEnum: z.nativeEnum(AssignmentReasonEnum),
  reasonString: z.string()
});
const AssignmentReasonModel = z.lazy(() => _AssignmentReasonModel.extend({
  booking: BookingModel
}));
const literalSchema$6 = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$6 = z.lazy(() => z.union([literalSchema$6, z.array(jsonSchema$6), z.record(jsonSchema$6)]));
const _DelegationCredentialModel = z.object({
  id: z.string(),
  workspacePlatformId: z.number().int(),
  serviceAccountKey: serviceAccountKeySchema,
  enabled: z.boolean(),
  lastEnabledAt: z.date().nullish(),
  lastDisabledAt: z.date().nullish(),
  organizationId: z.number().int(),
  domain: z.string(),
  createdAt: z.date(),
  updatedAt: z.date()
});
const DelegationCredentialModel = z.lazy(() => _DelegationCredentialModel.extend({
  workspacePlatform: WorkspacePlatformModel,
  organization: TeamModel,
  selectedCalendars: SelectedCalendarModel.array(),
  destinationCalendar: DestinationCalendarModel.array(),
  bookingReferences: BookingReferenceModel.array(),
  credentials: CredentialModel.array()
}));
const literalSchema$5 = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$5 = z.lazy(() => z.union([literalSchema$5, z.array(jsonSchema$5), z.record(jsonSchema$5)]));
const _DomainWideDelegationModel = z.object({
  id: z.string(),
  workspacePlatformId: z.number().int(),
  serviceAccountKey: serviceAccountKeySchema,
  enabled: z.boolean(),
  organizationId: z.number().int(),
  domain: z.string(),
  createdAt: z.date(),
  updatedAt: z.date()
});
const DomainWideDelegationModel = z.lazy(() => _DomainWideDelegationModel.extend({
  workspacePlatform: WorkspacePlatformModel,
  organization: TeamModel,
  selectedCalendars: SelectedCalendarModel.array(),
  destinationCalendar: DestinationCalendarModel.array(),
  bookingReferences: BookingReferenceModel.array()
}));
const literalSchema$4 = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$4 = z.lazy(() => z.union([literalSchema$4, z.array(jsonSchema$4), z.record(jsonSchema$4)]));
const _WorkspacePlatformModel = z.object({
  id: z.number().int(),
  slug: z.string().min(1),
  name: z.string().min(1),
  description: z.string(),
  defaultServiceAccountKey: serviceAccountKeySchema,
  createdAt: z.date(),
  updatedAt: z.date(),
  enabled: z.boolean()
});
const WorkspacePlatformModel = z.lazy(() => _WorkspacePlatformModel.extend({
  delegationCredentials: DelegationCredentialModel.array(),
  domainWideDelegations: DomainWideDelegationModel.array()
}));
const _EventTypeTranslationModel = z.object({
  uid: z.string(),
  eventTypeId: z.number().int(),
  field: z.nativeEnum(EventTypeAutoTranslatedField),
  sourceLocale: z.string(),
  targetLocale: z.string(),
  translatedText: z.string(),
  createdAt: z.date(),
  createdBy: z.number().int(),
  updatedAt: z.date(),
  updatedBy: z.number().int().nullish()
});
const EventTypeTranslationModel = z.lazy(() => _EventTypeTranslationModel.extend({
  eventType: EventTypeModel,
  creator: UserModel,
  updater: UserModel.nullish()
}));
const _WatchlistModel = z.object({
  id: z.string(),
  type: z.nativeEnum(WatchlistType),
  value: z.string(),
  description: z.string().nullish(),
  createdAt: z.date(),
  createdById: z.number().int(),
  updatedAt: z.date(),
  updatedById: z.number().int().nullish(),
  severity: z.nativeEnum(WatchlistSeverity)
});
const WatchlistModel = z.lazy(() => _WatchlistModel.extend({
  createdBy: UserModel,
  updatedBy: UserModel.nullish()
}));
const literalSchema$3 = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$3 = z.lazy(() => z.union([literalSchema$3, z.array(jsonSchema$3), z.record(jsonSchema$3)]));
const _OrganizationOnboardingModel = z.object({
  id: z.string(),
  createdById: z.number().int(),
  createdAt: z.date(),
  orgOwnerEmail: z.string(),
  error: z.string().nullish(),
  updatedAt: z.date(),
  organizationId: z.number().int().nullish(),
  billingPeriod: z.nativeEnum(BillingPeriod),
  pricePerSeat: z.number(),
  seats: z.number().int(),
  isPlatform: z.boolean(),
  name: z.string(),
  slug: z.string(),
  logo: z.string().nullish(),
  bio: z.string().nullish(),
  isDomainConfigured: z.boolean(),
  stripeCustomerId: z.string().nullish(),
  stripeSubscriptionId: z.string().nullish(),
  stripeSubscriptionItemId: z.string().nullish(),
  invitedMembers: orgOnboardingInvitedMembersSchema,
  teams: orgOnboardingTeamsSchema,
  isComplete: z.boolean()
});
const OrganizationOnboardingModel = z.lazy(() => _OrganizationOnboardingModel.extend({
  createdBy: UserModel,
  organization: TeamModel.nullish()
}));
const literalSchema$2 = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$2 = z.lazy(() => z.union([literalSchema$2, z.array(jsonSchema$2), z.record(jsonSchema$2)]));
const _App_RoutingForms_IncompleteBookingActionsModel = z.object({
  id: z.number().int(),
  formId: z.string(),
  actionType: z.nativeEnum(IncompleteBookingActionType),
  data: jsonSchema$2,
  enabled: z.boolean(),
  credentialId: z.number().int().nullish()
});
const App_RoutingForms_IncompleteBookingActionsModel = z.lazy(() => _App_RoutingForms_IncompleteBookingActionsModel.extend({
  form: App_RoutingForms_FormModel
}));
const _InternalNotePresetModel = z.object({
  id: z.number().int(),
  name: z.string(),
  cancellationReason: z.string().nullish(),
  teamId: z.number().int(),
  createdAt: z.date()
});
const InternalNotePresetModel = z.lazy(() => _InternalNotePresetModel.extend({
  team: TeamModel,
  BookingInternalNote: BookingInternalNoteModel.array()
}));
const literalSchema$1 = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema$1 = z.lazy(() => z.union([literalSchema$1, z.array(jsonSchema$1), z.record(jsonSchema$1)]));
const _FilterSegmentModel = z.object({
  id: z.number().int(),
  name: z.string(),
  tableIdentifier: z.string(),
  scope: z.nativeEnum(FilterSegmentScope),
  activeFilters: jsonSchema$1,
  sorting: jsonSchema$1,
  columnVisibility: jsonSchema$1,
  columnSizing: jsonSchema$1,
  perPage: z.number().int(),
  searchTerm: z.string().nullish(),
  createdAt: z.date(),
  updatedAt: z.date(),
  userId: z.number().int(),
  teamId: z.number().int().nullish()
});
const FilterSegmentModel = z.lazy(() => _FilterSegmentModel.extend({
  user: UserModel,
  team: TeamModel.nullish(),
  userPreferences: UserFilterSegmentPreferenceModel.array()
}));
const _UserFilterSegmentPreferenceModel = z.object({
  id: z.number().int(),
  userId: z.number().int(),
  tableIdentifier: z.string(),
  segmentId: z.number().int(),
  createdAt: z.date(),
  updatedAt: z.date()
});
const UserFilterSegmentPreferenceModel = z.lazy(() => _UserFilterSegmentPreferenceModel.extend({
  user: UserModel,
  segment: FilterSegmentModel
}));
const _BookingInternalNoteModel = z.object({
  id: z.number().int(),
  notePresetId: z.number().int().nullish(),
  text: z.string().nullish(),
  bookingId: z.number().int(),
  createdById: z.number().int(),
  createdAt: z.date()
});
const BookingInternalNoteModel = z.lazy(() => _BookingInternalNoteModel.extend({
  notePreset: InternalNotePresetModel.nullish(),
  booking: BookingModel,
  createdBy: UserModel
}));
z.object({
  id: z.number().int(),
  type: z.nativeEnum(WorkflowContactType),
  value: z.string(),
  optedOut: z.boolean(),
  createdAt: z.date(),
  updatedAt: z.date()
});
const _RoleModel = z.object({
  id: z.string(),
  name: z.string(),
  color: z.string().nullish(),
  description: z.string().nullish(),
  teamId: z.number().int().nullish(),
  createdAt: z.date(),
  updatedAt: z.date(),
  type: z.nativeEnum(RoleType)
});
const RoleModel = z.lazy(() => _RoleModel.extend({
  team: TeamModel.nullish(),
  permissions: RolePermissionModel.array(),
  memberships: MembershipModel.array()
}));
const _RolePermissionModel = z.object({
  id: z.string(),
  roleId: z.string(),
  resource: z.string(),
  action: z.string(),
  createdAt: z.date()
});
const RolePermissionModel = z.lazy(() => _RolePermissionModel.extend({
  role: RoleModel
}));
const literalSchema = z.union([z.string(), z.number(), z.boolean()]);
const jsonSchema = z.lazy(() => z.union([literalSchema, z.array(jsonSchema), z.record(jsonSchema)]));
z.object({
  id: z.number().int(),
  response: jsonSchema,
  responseLowercase: jsonSchema,
  formId: z.string(),
  formName: z.string(),
  formTeamId: z.number().int().nullish(),
  formUserId: z.number().int().nullish(),
  bookingUid: z.string().nullish(),
  bookingStatus: z.nativeEnum(BookingStatus).nullish(),
  bookingStatusOrder: z.number().int().nullish(),
  bookingCreatedAt: z.date().nullish(),
  bookingAttendees: jsonSchema,
  bookingUserId: z.number().int().nullish(),
  bookingUserName: z.string().nullish(),
  bookingUserEmail: z.string().nullish(),
  bookingUserAvatarUrl: z.string().nullish(),
  bookingAssignmentReason: z.string().nullish(),
  bookingAssignmentReasonLowercase: z.string().nullish(),
  bookingStartTime: z.date().nullish(),
  bookingEndTime: z.date().nullish(),
  createdAt: z.date(),
  utm_source: z.string().nullish(),
  utm_medium: z.string().nullish(),
  utm_campaign: z.string().nullish(),
  utm_term: z.string().nullish(),
  utm_content: z.string().nullish()
});
z.object({
  id: z.number().int(),
  uid: z.string().nullish(),
  eventTypeId: z.number().int().nullish(),
  title: z.string().nullish(),
  description: z.string().nullish(),
  startTime: z.date().nullish(),
  endTime: z.date().nullish(),
  createdAt: z.date().nullish(),
  location: z.string().nullish(),
  paid: z.boolean().nullish(),
  status: z.nativeEnum(BookingStatus).nullish(),
  rescheduled: z.boolean().nullish(),
  userId: z.number().int().nullish(),
  teamId: z.number().int().nullish(),
  eventLength: z.number().int().nullish(),
  timeStatus: z.string().nullish(),
  eventParentId: z.number().int().nullish(),
  userEmail: z.string().nullish(),
  username: z.string().nullish(),
  ratingFeedback: z.string().nullish(),
  rating: z.number().int().nullish(),
  noShowHost: z.boolean().nullish(),
  isTeamBooking: z.boolean()
});
z.object({
  id: z.number().int(),
  uid: z.string(),
  eventTypeId: z.number().int().nullish(),
  title: z.string(),
  description: z.string().nullish(),
  startTime: z.date(),
  endTime: z.date(),
  createdAt: z.date(),
  updatedAt: z.date().nullish(),
  location: z.string().nullish(),
  paid: z.boolean(),
  status: z.nativeEnum(BookingStatus),
  rescheduled: z.boolean().nullish(),
  userId: z.number().int().nullish(),
  teamId: z.number().int().nullish(),
  eventLength: z.number().int().nullish(),
  eventParentId: z.number().int().nullish(),
  userEmail: z.string().nullish(),
  userName: z.string().nullish(),
  userUsername: z.string().nullish(),
  ratingFeedback: z.string().nullish(),
  rating: z.number().int().nullish(),
  noShowHost: z.boolean().nullish(),
  isTeamBooking: z.boolean(),
  timeStatus: z.string().nullish()
});
export {
  _EventTypeModel as _
};
