import { bc as w, bd as L, be as T, b9 as S, bf as U, aL as v, bg as p, aK as t, bh as _, bi as N, aW as $, a_ as f } from "./index-GTnBs7av.js";
import { memo as A, useState as C } from "react";
import { C as R } from "./Card-Dw4u-rrW.js";
var F = Math.floor, I = Math.random;
function O(e, s) {
  return e + F(I() * (s - e + 1));
}
var E = O, V = E;
function M(e, s) {
  var r = -1, l = e.length, n = l - 1;
  for (s = s === void 0 ? l : s; ++r < s; ) {
    var i = V(r, n), o = e[i];
    e[i] = e[r], e[r] = o;
  }
  return e.length = s, e;
}
var b = M, P = w, q = b;
function G(e) {
  return q(P(e));
}
var B = G, H = L;
function K(e, s) {
  return H(s, function(r) {
    return e[r];
  });
}
var D = K, Q = D, W = T;
function Y(e) {
  return e == null ? [] : Q(e, W(e));
}
var Z = Y, z = b, J = Z;
function X(e) {
  return z(J(e));
}
var ee = X, te = B, ie = ee, se = U;
function oe(e) {
  var s = se(e) ? te : ie;
  return s(e);
}
var re = oe;
const ae = /* @__PURE__ */ S(re), ne = [
  {
    id: 13,
    thumbnailUrl: "https://img.youtube.com/vi/ihE8OYTdklg/0.jpg",
    mediaLink: "https://go.cal.com/ooo",
    title: "ooo.new",
    description: "Easily go out-of-office",
    href: "https://ooo.new"
  },
  {
    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/c7ZKFuLy1fg/0.jpg",
    mediaLink: "https://go.cal.com/routing-video",
    title: "Routing Forms, Workflows",
    description: "Ask screening questions of potential bookers to connect them with the right person",
    href: "https://cal.com/blog/cal-v-1-8"
  },
  {
    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/60HJt8DOVNo/0.jpg",
    mediaLink: "https://go.cal.com/dynamic-video",
    title: "Dynamic booking links",
    description: "Booking link that allows people to quickly schedule meetings.",
    href: "https://cal.com/blog/cal-v-1-9"
  }
], u = ae(ne).slice(0).reverse();
function le() {
  const { t: e } = v(), [s, r] = C(() => {
    if (typeof window > "u")
      return u;
    try {
      const i = p.getItem("removedTipsIds");
      if (i !== null) {
        const o = i.split(",").map((a) => parseInt(a, 10));
        return u.filter((a) => o.indexOf(a.id) === -1);
      } else
        return u;
    } catch {
      return u;
    }
  }), l = (i) => {
    r((o) => {
      const c = p.getItem("removedTipsIds") || "", a = o.findIndex((m) => m.id === i);
      return p.setItem(
        "removedTipsIds",
        `${o[a].id.toString()}${c.length > 0 ? `,${c.split(",")}` : ""}`
      ), o.splice(a, 1), [...o];
    });
  }, n = s.slice(0).reverse();
  return /* @__PURE__ */ t.jsx(
    "div",
    {
      className: "hidden pb-4 pt-8 lg:grid",
      style: {
        gridTemplateColumns: "1fr"
      },
      children: s.map((i) => /* @__PURE__ */ t.jsx(
        "div",
        {
          className: "relative",
          style: {
            gridRowStart: 1,
            gridColumnStart: 1
          },
          children: /* @__PURE__ */ t.jsx(
            "div",
            {
              className: "relative",
              style: {
                transform: `scale(${1 - n.indexOf(i) / 20})`,
                top: -n.indexOf(i) * 10,
                opacity: `${1 - n.indexOf(i) / 7}`
              },
              children: /* @__PURE__ */ t.jsx(
                R,
                {
                  variant: "SidebarCard",
                  thumbnailUrl: i.thumbnailUrl,
                  mediaLink: i.mediaLink,
                  title: i.title,
                  description: i.description,
                  learnMore: { href: i.href, text: e("learn_more") },
                  actionButton: { onClick: () => l(i.id), child: e("dismiss") }
                }
              )
            }
          )
        },
        i.id
      ))
    }
  );
}
const ue = A(le);
function he({
  title: e,
  description: s,
  background: r,
  features: l,
  buttons: n,
  isParentLoading: i,
  children: o,
  plan: c
}) {
  const { resolvedTheme: a } = _(), { t: m } = v(), { isPending: x, hasTeamPlan: y } = N(), { data: h } = $.viewer.teams.getUpgradeable.useQuery(), g = `${r}${a === "dark" ? "-dark" : ""}.jpg`, k = !1, j = !!(h != null && h[0]);
  return c === "team" && (y || j) ? /* @__PURE__ */ t.jsx(t.Fragment, { children: o }) : c === "enterprise" && k ? /* @__PURE__ */ t.jsx(t.Fragment, { children: o }) : x ? /* @__PURE__ */ t.jsx(t.Fragment, { children: i }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
    /* @__PURE__ */ t.jsxs("div", { className: "relative flex min-h-[295px] w-full items-center justify-between overflow-hidden rounded-lg pb-10", children: [
      /* @__PURE__ */ t.jsxs("picture", { className: "absolute min-h-[295px] w-full rounded-lg object-cover", children: [
        /* @__PURE__ */ t.jsx("source", { srcSet: g, media: "(prefers-color-scheme: dark)" }),
        /* @__PURE__ */ t.jsx(
          "img",
          {
            className: "absolute min-h-[295px] w-full select-none rounded-lg object-cover object-left md:object-center",
            src: g,
            loading: "lazy",
            alt: e
          }
        )
      ] }),
      /* @__PURE__ */ t.jsxs("div", { className: "relative my-4 px-8 sm:px-14", children: [
        /* @__PURE__ */ t.jsx("h1", { className: f("font-cal text-3xl"), children: m(e) }),
        /* @__PURE__ */ t.jsx("p", { className: f("mb-8 mt-4 max-w-sm"), children: m(s) }),
        n
      ] })
    ] }),
    /* @__PURE__ */ t.jsx("div", { className: "mt-4 grid-cols-3 md:grid md:gap-4", children: l.map((d) => /* @__PURE__ */ t.jsxs("div", { className: "bg-muted mb-4 min-h-[180px] w-full rounded-md  p-8 md:mb-0", children: [
      d.icon,
      /* @__PURE__ */ t.jsx("h2", { className: "font-cal text-emphasis mt-4 text-lg", children: d.title }),
      /* @__PURE__ */ t.jsx("p", { className: "text-default", children: d.description })
    ] }, d.title)) })
  ] });
}
export {
  ue as Tips,
  he as UpgradeTip
};
