hunk.code_window:     "@calcom/web#start": {
         "dependsOn": ["@calcom/prisma#db-deploy"]
       },
       "@calcom/website#build": {
         "dependsOn": ["$WEBSITE_BASE_URL"],
         "outputs": [".next/**"]
       },
       "build": {
  
hunk.labels: keep keep keep keep replace keep keep keep
hunk.after_edit:       "dependsOn": [
           "$NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE",
           "$NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE",
           "$NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE",
           "$NEXT_PUBLIC_STRIPE_PRO_PLAN_PRODUCT",
           "$NEXT_PUBLIC_STRIPE_PUBLIC_KEY",
           "$NEXT_PUBLIC_WEBAPP_URL",
           "$NEXT_PUBLIC_WEBSITE_URL",
           "$STRIPE_WEBHOOK_SECRET"
         ],
  
hunk.file_path: turbo.json
hunk.type: replace
file: import { Prisma } from "@prisma/client";
  import { GetServerSidePropsContext } from "next";
  import { JSONObject } from "superjson/dist/types";
  
  import { asStringOrThrow } from "@lib/asStringOrNull";
  import prisma from "@lib/prisma";
  import { inferSSRProps } from "@lib/types/inferSSRProps";
  
  import BookingPage from "@components/booking/pages/BookingPage";
  
  export type TeamBookingPageProps = inferSSRProps<typeof getServerSideProps>;
  
  export default function TeamBookingPage(props: TeamBookingPageProps) {
    return <BookingPage {...props} />;
  }
  
  export async function getServerSideProps(context: GetServerSidePropsContext) {
    const eventTypeId = parseInt(asStringOrThrow(context.query.type));
    if (typeof eventTypeId !== "number" || eventTypeId % 1 !== 0) {
      return {
        notFound: true,
      } as const;
    }
  
    const eventType = await prisma.eventType.findUnique({
      where: {
        id: eventTypeId,
      },
      select: {
        id: true,
        title: true,
        slug: true,
        description: true,
        length: true,
        locations: true,
        customInputs: true,
        periodType: true,
        periodDays: true,
        periodStartDate: true,
        periodEndDate: true,
        periodCountCalendarDays: true,
        disableGuests: true,
        price: true,
        currency: true,
        metadata: true,
        team: {
          select: {
            slug: true,
            name: true,
            logo: true,
          },
        },
        users: {
          select: {
            avatar: true,
            name: true,
          },
        },
      },
    });
  
    if (!eventType) return { notFound: true };
  
    const eventTypeObject = [eventType].map((e) => {
      return {
        ...e,
        metadata: (eventType.metadata || {}) as JSONObject,
        periodStartDate: e.periodStartDate?.toString() ?? null,
        periodEndDate: e.periodEndDate?.toString() ?? null,
      };
    })[0];
  
    async function getBooking() {
      return prisma.booking.findFirst({
        where: {
          uid: asStringOrThrow(context.query.rescheduleUid),
        },
        select: {
          description: true,
          attendees: {
            select: {
              email: true,
              name: true,
            },
          },
        },
      });
    }
  
    type Booking = Prisma.PromiseReturnType<typeof getBooking>;
    let booking: Booking | null = null;
  
    if (context.query.rescheduleUid) {
      booking = await getBooking();
    }
  
    return {
      props: {
        profile: {
          ...eventTypeObject.team,
          slug: "team/" + eventTypeObject.slug,
          image: eventTypeObject.team?.logo || null,
          theme: null /* Teams don't have a theme, and `BookingPage` uses it */,
          brandColor: null /* Teams don't have a brandColor, and `BookingPage` uses it */,
          darkBrandColor: null /* Teams don't have a darkBrandColor, and `BookingPage` uses it */,
        },
        eventType: eventTypeObject,
        booking,
      },
    };
  }
  