import { jsxs as c, jsx as i, Fragment as g } from "react/jsx-runtime";
import { av as N, aw as L, ax as S, al as j, ay as T, az as U, s as h, u as A, aA as I, y as R, aB as x, aC as _, aD as $, O as V } from "./index-MLgFWWYi.js";
import { memo as z, useState as Q } from "react";
var M = Math.floor, E = Math.random;
function O(t, r) {
  return t + M(E() * (r - t + 1));
}
var Z = O, q = Z;
function D(t, r) {
  var o = -1, n = t.length, a = n - 1;
  for (r = r === void 0 ? n : r; ++o < r; ) {
    var e = q(o, a), s = t[e];
    t[e] = t[o], t[o] = s;
  }
  return t.length = r, t;
}
var y = D, F = N, G = y;
function W(t) {
  return G(F(t));
}
var P = W, H = L;
function Y(t, r) {
  return H(r, function(o) {
    return t[o];
  });
}
var K = Y, J = K, X = S;
function B(t) {
  return t == null ? [] : J(t, X(t));
}
var ee = B, te = y, ie = ee;
function se(t) {
  return te(ie(t));
}
var re = se, ae = P, le = re, oe = T;
function de(t) {
  var r = oe(t) ? ae : le;
  return r(t);
}
var ne = de;
const ce = /* @__PURE__ */ j(ne), b = I("", {
  // Variants won't have any style by default. Style will only be applied if the variants are combined.
  // So, style is defined in compoundVariants.
  variants: {
    variant: {
      basic: "",
      ProfileCard: "",
      SidebarCard: ""
    },
    structure: {
      image: "",
      card: "",
      title: "",
      description: ""
    }
  },
  compoundVariants: [
    // Style for Basic Variants types
    {
      variant: "basic",
      structure: "image",
      className: "w-10 h-auto"
    },
    {
      variant: "basic",
      structure: "card",
      className: "p-5"
    },
    {
      variant: "basic",
      structure: "title",
      className: "text-base mt-4"
    },
    {
      variant: "basic",
      structure: "description",
      className: "text-sm leading-[18px] text-subtle font-normal"
    },
    // Style for ProfileCard Variant Types
    {
      variant: "ProfileCard",
      structure: "image",
      className: "w-9 h-auto rounded-full mb-4s"
    },
    {
      variant: "ProfileCard",
      structure: "card",
      className: "w-80 p-4 hover:bg-subtle"
    },
    {
      variant: "ProfileCard",
      structure: "title",
      className: "text-base"
    },
    {
      variant: "ProfileCard",
      structure: "description",
      className: "text-sm leading-[18px] text-subtle font-normal"
    },
    // Style for SidebarCard Variant Types
    {
      variant: "SidebarCard",
      structure: "image",
      className: "w-9 h-auto rounded-full mb-4s"
    },
    {
      variant: "SidebarCard",
      structure: "card",
      className: "w-full p-3 border border-subtle"
    },
    {
      variant: "SidebarCard",
      structure: "title",
      className: "text-sm font-cal"
    },
    {
      variant: "SidebarCard",
      structure: "description",
      className: "text-xs text-default line-clamp-2"
    }
  ]
});
function me({
  image: t,
  title: r,
  icon: o,
  description: n,
  variant: a,
  actionButton: e,
  containerProps: s,
  imageProps: l,
  mediaLink: d,
  thumbnailUrl: u,
  learnMore: m
}) {
  const p = m && m.href.startsWith("https") ? "a" : U;
  return /* @__PURE__ */ c(
    "div",
    {
      className: h(
        s == null ? void 0 : s.className,
        b({ variant: a, structure: "card" }),
        "bg-default border-subtle text-default flex flex-col justify-between rounded-md border"
      ),
      "data-testid": "card-container",
      ...s,
      children: [
        /* @__PURE__ */ c("div", { children: [
          o && o,
          t && /* @__PURE__ */ i(
            "img",
            {
              src: t,
              alt: l == null ? void 0 : l.alt,
              className: h(
                l == null ? void 0 : l.className,
                b({ variant: a, structure: "image" })
              ),
              ...l
            }
          ),
          /* @__PURE__ */ i(
            "h5",
            {
              title: r,
              className: h(
                b({ variant: a, structure: "title" }),
                "text-emphasis line-clamp-1 font-bold leading-5"
              ),
              children: r
            }
          ),
          n && /* @__PURE__ */ i(
            "p",
            {
              title: n.toString(),
              className: h(b({ variant: a, structure: "description" }), "pt-1"),
              children: n
            }
          )
        ] }),
        a === "SidebarCard" && /* @__PURE__ */ c(
          "a",
          {
            onClick: e == null ? void 0 : e.onClick,
            target: "_blank",
            rel: "noreferrer",
            href: d,
            "data-testid": e == null ? void 0 : e["data-testid"],
            className: "group relative my-3 flex aspect-video items-center overflow-hidden rounded",
            children: [
              /* @__PURE__ */ i("div", { className: "absolute inset-0 bg-black bg-opacity-50 transition group-hover:bg-opacity-40" }),
              /* @__PURE__ */ c(
                "svg",
                {
                  className: "text-inverted absolute left-1/2 top-1/2 h-8 w-8 -translate-x-1/2 -translate-y-1/2 transform rounded-full shadow-lg transition-all hover:-mt-px",
                  viewBox: "0 0 32 32",
                  fill: "none",
                  xmlns: "http://www.w3.org/2000/svg",
                  children: [
                    /* @__PURE__ */ i(
                      "path",
                      {
                        d: "M16 32C24.8366 32 32 24.8366 32 16C32 7.16344 24.8366 0 16 0C7.16344 0 0 7.16344 0 16C0 24.8366 7.16344 32 16 32Z",
                        fill: "white"
                      }
                    ),
                    /* @__PURE__ */ i(
                      "path",
                      {
                        d: "M12.1667 8.5L23.8334 16L12.1667 23.5V8.5Z",
                        fill: "#111827",
                        stroke: "#111827",
                        strokeWidth: "1.5",
                        strokeLinecap: "round",
                        strokeLinejoin: "round"
                      }
                    )
                  ]
                }
              ),
              /* @__PURE__ */ i("img", { alt: "play feature video", src: u })
            ]
          }
        ),
        a === "basic" && e && /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
          A,
          {
            color: "secondary",
            href: e == null ? void 0 : e.href,
            className: "mt-10",
            EndIcon: "arrow-right",
            "data-testid": e["data-testid"],
            children: e == null ? void 0 : e.child
          }
        ) }),
        a === "SidebarCard" && /* @__PURE__ */ c("div", { className: "mt-2 flex items-center justify-between", children: [
          m && /* @__PURE__ */ i(
            p,
            {
              href: m.href,
              onClick: e == null ? void 0 : e.onClick,
              target: "_blank",
              rel: "noreferrer",
              className: "text-default text-xs font-medium",
              children: m.text
            }
          ),
          (e == null ? void 0 : e.child) && /* @__PURE__ */ i(
            "button",
            {
              className: "text-default hover:text-emphasis p-0 text-xs font-normal",
              color: "minimal",
              "data-testid": e == null ? void 0 : e["data-testid"],
              onClick: e == null ? void 0 : e.onClick,
              children: e == null ? void 0 : e.child
            }
          )
        ] })
      ]
    }
  );
}
const he = [
  {
    id: 17,
    thumbnailUrl: "https://img.youtube.com/vi/fMHW6jYPIb8/0.jpg",
    mediaLink: "https://go.cal.com/embed-video",
    title: "Embed",
    description: "Embed your booking page on your website",
    href: "https://go.cal.com/embed-video"
  },
  {
    id: 16,
    thumbnailUrl: "https://img.youtube.com/vi/xopxmk2H4Ng/0.jpg",
    mediaLink: "https://go.cal.com/paid-booking",
    title: "Paid Bookings",
    description: "Charge for your time with Cal.com's paid bookings",
    href: "https://go.cal.com/paid-booking"
  },
  {
    id: 15,
    thumbnailUrl: "https://img.youtube.com/vi/ZjSD1yPgLLQ/0.jpg",
    mediaLink: "https://go.cal.com/instant-meetings-video",
    title: "Instant Meetings",
    description: "Book meetings instantly with a link",
    href: "https://go.cal.com/instant-meetings-video"
  },
  {
    id: 14,
    thumbnailUrl: "https://img.youtube.com/vi/IZ4-nUiIpvY/0.jpg",
    mediaLink: "https://go.cal.com/custom-attributes",
    title: "Custom Attributes",
    description: "Define roles and attributes for your teams",
    href: "https://go.cal.com/custom-attributes"
  },
  {
    id: 13,
    thumbnailUrl: "https://img.youtube.com/vi/TTAASLLPKk0/0.jpg",
    mediaLink: "https://go.cal.com/ooo-video",
    title: "ooo.new",
    description: "Easily go out-of-office",
    href: "https://go.cal.com/ooo-video"
  },
  {
    id: 12,
    thumbnailUrl: "https://cal.com/og-image-cal-ai.jpg",
    mediaLink: "https://go.cal.com/cal-ai",
    title: "Cal.ai",
    description: "Your personal AI scheduling assistant",
    href: "https://go.cal.com/cal-ai"
  },
  {
    id: 11,
    thumbnailUrl: "https://img.youtube.com/vi/KTg_qzA9NEc/0.jpg",
    mediaLink: "https://go.cal.com/insights",
    title: "Insights",
    description: "Get a better understanding of your business",
    href: "https://go.cal.com/insights"
  },
  {
    id: 10,
    thumbnailUrl: "https://img.youtube.com/vi/jvaBafzVUQc/0.jpg",
    mediaLink: "https://go.cal.com/video",
    title: "Cal Video",
    description: "Free video conferencing with recording",
    href: "https://go.cal.com/video"
  },
  {
    id: 9,
    thumbnailUrl: "https://img.youtube.com/vi/93iOmzHieCU/0.jpg",
    mediaLink: "https://go.cal.com/round-robin",
    title: "Round-Robin",
    description: "Create advanced group meetings with round-robin",
    href: "https://go.cal.com/round-robin"
  },
  {
    id: 8,
    thumbnailUrl: "https://img.youtube.com/vi/piKlAiibAFo/0.jpg",
    mediaLink: "https://go.cal.com/workflows",
    title: "Automate Workflows",
    description: "Make time work for you and automate tasks",
    href: "https://go.cal.com/workflows"
  },
  {
    id: 7,
    thumbnailUrl: "https://img.youtube.com/vi/UVXgo12cY4g/0.jpg",
    mediaLink: "https://go.cal.com/routing-forms",
    title: "Routing Forms",
    description: "Ask questions and route to the correct person",
    href: "https://go.cal.com/routing-forms"
  },
  {
    id: 6,
    thumbnailUrl: "https://img.youtube.com/vi/yGiZo1Ry5-8/0.jpg",
    mediaLink: "https://go.cal.com/recurring-video",
    title: "Recurring Bookings",
    description: "Learn how to create a recurring schedule",
    href: "https://go.cal.com/recurring-video"
  },
  {
    id: 5,
    thumbnailUrl: "https://img.youtube.com/vi/0v_nQtpxC_4/0.jpg",
    mediaLink: "https://go.cal.com/payments-video",
    title: "Accept Payments",
    description: "Charge for your time with Cal.com's Stripe App",
    href: "https://app.cal.com/apps/stripe"
  },
  {
    id: 4,
    thumbnailUrl: "https://img.youtube.com/vi/zGr_s-fG84k/0.jpg",
    mediaLink: "https://go.cal.com/confirmation-video",
    title: "Requires Confirmation",
    description: "Learn how to be in charge of your bookings",
    href: "https://cal.com/resources/feature/opt-in"
  },
  {
    id: 3,
    thumbnailUrl: "https://img.youtube.com/vi/-L8MCiT6uhQ/0.jpg",
    mediaLink: "https://youtu.be/-L8MCiT6uhQ?si=DRJzRNhN85hqAwBl",
    title: "Routing Forms, Workflows",
    description: "Ask screening questions of potential bookers to connect them with the right person",
    href: "https://youtu.be/-L8MCiT6uhQ?si=DRJzRNhN85hqAwBl"
  },
  {
    id: 2,
    thumbnailUrl: "https://img.youtube.com/vi/EAc46SPL6iA/0.jpg",
    mediaLink: "https://go.cal.com/teams-video",
    title: "How to set up Teams",
    description: "Learn how to use round-robin and collective events.",
    href: "https://cal.com/docs/enterprise-features/teams"
  },
  {
    id: 1,
    thumbnailUrl: "https://img.youtube.com/vi/VZ5PfQzzxBw/0.jpg",
    mediaLink: "https://youtu.be/VZ5PfQzzxBw?si=oB0LPSxG8dWIwg5a",
    title: "Dynamic booking links",
    description: "Booking link that allows people to quickly schedule meetings.",
    href: "https://youtu.be/VZ5PfQzzxBw?si=oB0LPSxG8dWIwg5a"
  }
], v = ce(he).slice(0).reverse();
function ue() {
  const { t } = R(), [r, o] = Q(() => {
    if (typeof window > "u")
      return v;
    try {
      const e = x.getItem("removedTipsIds");
      if (e !== null) {
        const s = e.split(",").map((d) => parseInt(d, 10));
        return v.filter((d) => s.indexOf(d.id) === -1);
      } else
        return v;
    } catch {
      return v;
    }
  }), n = (e) => {
    o((s) => {
      const l = x.getItem("removedTipsIds") || "", d = s.findIndex((u) => u.id === e);
      return d === -1 ? [...s] : (x.setItem(
        "removedTipsIds",
        `${s[d].id.toString()}${l.length > 0 ? `,${l}` : ""}`
      ), s.splice(d, 1), [...s]);
    });
  }, a = r.slice(0).reverse();
  return /* @__PURE__ */ i(
    "div",
    {
      className: "hidden pb-4 pt-8 lg:grid",
      style: {
        gridTemplateColumns: "1fr"
      },
      children: r.map((e) => {
        const s = a.indexOf(e) === 0;
        return /* @__PURE__ */ i(
          "div",
          {
            className: "relative",
            style: {
              gridRowStart: 1,
              gridColumnStart: 1
            },
            children: /* @__PURE__ */ i(
              "div",
              {
                className: "relative",
                style: {
                  transform: `scale(${1 - a.indexOf(e) / 20})`,
                  top: -a.indexOf(e) * 10,
                  opacity: `${1 - a.indexOf(e) / 7}`
                },
                children: /* @__PURE__ */ i(
                  me,
                  {
                    variant: "SidebarCard",
                    thumbnailUrl: e.thumbnailUrl,
                    mediaLink: s ? e.mediaLink : void 0,
                    title: e.title,
                    description: e.description,
                    learnMore: s ? { href: e.href, text: t("learn_more") } : void 0,
                    actionButton: s ? { onClick: () => n(e.id), child: t("dismiss") } : void 0,
                    containerProps: {
                      tabIndex: s ? void 0 : -1,
                      "aria-hidden": s ? void 0 : "true"
                    }
                  }
                )
              }
            )
          },
          e.id
        );
      })
    }
  );
}
const be = z(ue);
function ve({
  title: t,
  description: r,
  background: o,
  features: n,
  buttons: a,
  isParentLoading: e,
  children: s,
  plan: l
}) {
  const { resolvedTheme: d } = _(), { isPending: u, hasTeamPlan: m } = $(), { data: p } = V.viewer.teams.getUpgradeable.useQuery(), k = `${o}${d === "dark" ? "-dark" : ""}.jpg`, w = !1, C = !!(p != null && p[0]);
  return l === "team" && (m || C) ? /* @__PURE__ */ i(g, { children: s }) : l === "enterprise" && w ? /* @__PURE__ */ i(g, { children: s }) : u ? /* @__PURE__ */ i(g, { children: e }) : /* @__PURE__ */ c(g, { children: [
    /* @__PURE__ */ c("div", { className: "relative flex min-h-[295px] w-full items-center justify-between overflow-hidden rounded-lg pb-10", children: [
      /* @__PURE__ */ c("picture", { className: "absolute min-h-[295px] w-full rounded-lg object-cover", children: [
        /* @__PURE__ */ i("source", { srcSet: k, media: "(prefers-color-scheme: dark)" }),
        /* @__PURE__ */ i(
          "img",
          {
            className: "absolute min-h-[295px] w-full select-none rounded-lg object-cover object-left md:object-center",
            src: k,
            loading: "lazy",
            alt: t
          }
        )
      ] }),
      /* @__PURE__ */ c("div", { className: "relative my-4 px-8 sm:px-14", children: [
        /* @__PURE__ */ i("h1", { className: h("font-cal mt-4 text-3xl"), children: t }),
        /* @__PURE__ */ i("p", { className: h("mb-8 mt-4 max-w-sm"), children: r }),
        a
      ] })
    ] }),
    /* @__PURE__ */ i("div", { className: "mt-4 grid-cols-3 md:grid md:gap-4", children: n.map((f) => /* @__PURE__ */ c("div", { className: "bg-muted mb-4 min-h-[180px] w-full rounded-md  p-8 md:mb-0", children: [
      f.icon,
      /* @__PURE__ */ i("h2", { className: "font-cal text-emphasis mt-4 text-lg", children: f.title }),
      /* @__PURE__ */ i("p", { className: "text-default", children: f.description })
    ] }, f.title)) })
  ] });
}
export {
  be as Tips,
  ve as UpgradeTip
};
