import { b9 as m, b1 as V, aK as L, bn as y, aJ as c, bo as q, b2 as D, aT as H, aX as $ } from "./index-THhC4TET.js";
import { memo as X, useState as Q } from "react";
import { C as W } from "./Card-BMojIAyq.js";
function Y(e, t) {
  var r = -1, a = e.length;
  for (t || (t = Array(a)); ++r < a; )
    t[r] = e[r];
  return t;
}
var J = Y, Z = Math.floor, z = Math.random;
function ee(e, t) {
  return e + Z(z() * (t - e + 1));
}
var te = ee, re = te;
function oe(e, t) {
  var r = -1, a = e.length, i = a - 1;
  for (t = t === void 0 ? a : t; ++r < t; ) {
    var o = re(r, i), s = e[o];
    e[o] = e[r], e[r] = s;
  }
  return e.length = t, e;
}
var U = oe, ae = J, ie = U;
function ne(e) {
  return ie(ae(e));
}
var se = ne;
function ce(e, t) {
  for (var r = -1, a = e == null ? 0 : e.length, i = Array(a); ++r < a; )
    i[r] = t(e[r], r, e);
  return i;
}
var le = ce, ue = le;
function pe(e, t) {
  return ue(t, function(r) {
    return e[r];
  });
}
var de = pe;
function fe(e, t) {
  for (var r = -1, a = Array(e); ++r < e; )
    a[r] = t(r);
  return a;
}
var me = fe, ge = typeof m == "object" && m && m.Object === Object && m, I = ge, be = I, he = typeof self == "object" && self && self.Object === Object && self, ve = be || he || Function("return this")(), P = ve, ye = P, je = ye.Symbol, F = je, A = F, E = Object.prototype, Te = E.hasOwnProperty, xe = E.toString, d = A ? A.toStringTag : void 0;
function $e(e) {
  var t = Te.call(e, d), r = e[d];
  try {
    e[d] = void 0;
    var a = !0;
  } catch {
  }
  var i = xe.call(e);
  return a && (t ? e[d] = r : delete e[d]), i;
}
var Ae = $e, we = Object.prototype, ke = we.toString;
function _e(e) {
  return ke.call(e);
}
var Oe = _e, w = F, Se = Ae, Le = Oe, Ue = "[object Null]", Ie = "[object Undefined]", k = w ? w.toStringTag : void 0;
function Pe(e) {
  return e == null ? e === void 0 ? Ie : Ue : k && k in Object(e) ? Se(e) : Le(e);
}
var j = Pe;
function Fe(e) {
  return e != null && typeof e == "object";
}
var T = Fe, Ee = j, Re = T, Ne = "[object Arguments]";
function Ce(e) {
  return Re(e) && Ee(e) == Ne;
}
var Ge = Ce, _ = Ge, Be = T, R = Object.prototype, Me = R.hasOwnProperty, Ke = R.propertyIsEnumerable, Ve = _(/* @__PURE__ */ function() {
  return arguments;
}()) ? _ : function(e) {
  return Be(e) && Me.call(e, "callee") && !Ke.call(e, "callee");
}, qe = Ve, De = Array.isArray, N = De, b = { exports: {} };
function He() {
  return !1;
}
var Xe = He;
b.exports;
(function(e, t) {
  var r = P, a = Xe, i = t && !t.nodeType && t, o = i && !0 && e && !e.nodeType && e, s = o && o.exports === i, u = s ? r.Buffer : void 0, p = u ? u.isBuffer : void 0, l = p || a;
  e.exports = l;
})(b, b.exports);
var Qe = b.exports, We = 9007199254740991, Ye = /^(?:0|[1-9]\d*)$/;
function Je(e, t) {
  var r = typeof e;
  return t = t ?? We, !!t && (r == "number" || r != "symbol" && Ye.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
var Ze = Je, ze = 9007199254740991;
function et(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= ze;
}
var C = et, tt = j, rt = C, ot = T, at = "[object Arguments]", it = "[object Array]", nt = "[object Boolean]", st = "[object Date]", ct = "[object Error]", lt = "[object Function]", ut = "[object Map]", pt = "[object Number]", dt = "[object Object]", ft = "[object RegExp]", mt = "[object Set]", gt = "[object String]", bt = "[object WeakMap]", ht = "[object ArrayBuffer]", vt = "[object DataView]", yt = "[object Float32Array]", jt = "[object Float64Array]", Tt = "[object Int8Array]", xt = "[object Int16Array]", $t = "[object Int32Array]", At = "[object Uint8Array]", wt = "[object Uint8ClampedArray]", kt = "[object Uint16Array]", _t = "[object Uint32Array]", n = {};
n[yt] = n[jt] = n[Tt] = n[xt] = n[$t] = n[At] = n[wt] = n[kt] = n[_t] = !0;
n[at] = n[it] = n[ht] = n[nt] = n[vt] = n[st] = n[ct] = n[lt] = n[ut] = n[pt] = n[dt] = n[ft] = n[mt] = n[gt] = n[bt] = !1;
function Ot(e) {
  return ot(e) && rt(e.length) && !!n[tt(e)];
}
var St = Ot;
function Lt(e) {
  return function(t) {
    return e(t);
  };
}
var Ut = Lt, h = { exports: {} };
h.exports;
(function(e, t) {
  var r = I, a = t && !t.nodeType && t, i = a && !0 && e && !e.nodeType && e, o = i && i.exports === a, s = o && r.process, u = function() {
    try {
      var p = i && i.require && i.require("util").types;
      return p || s && s.binding && s.binding("util");
    } catch {
    }
  }();
  e.exports = u;
})(h, h.exports);
var It = h.exports, Pt = St, Ft = Ut, O = It, S = O && O.isTypedArray, Et = S ? Ft(S) : Pt, Rt = Et, Nt = me, Ct = qe, Gt = N, Bt = Qe, Mt = Ze, Kt = Rt, Vt = Object.prototype, qt = Vt.hasOwnProperty;
function Dt(e, t) {
  var r = Gt(e), a = !r && Ct(e), i = !r && !a && Bt(e), o = !r && !a && !i && Kt(e), s = r || a || i || o, u = s ? Nt(e.length, String) : [], p = u.length;
  for (var l in e)
    (t || qt.call(e, l)) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
    (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    i && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    o && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
    Mt(l, p))) && u.push(l);
  return u;
}
var Ht = Dt, Xt = Object.prototype;
function Qt(e) {
  var t = e && e.constructor, r = typeof t == "function" && t.prototype || Xt;
  return e === r;
}
var Wt = Qt;
function Yt(e, t) {
  return function(r) {
    return e(t(r));
  };
}
var Jt = Yt, Zt = Jt, zt = Zt(Object.keys, Object), er = zt, tr = Wt, rr = er, or = Object.prototype, ar = or.hasOwnProperty;
function ir(e) {
  if (!tr(e))
    return rr(e);
  var t = [];
  for (var r in Object(e))
    ar.call(e, r) && r != "constructor" && t.push(r);
  return t;
}
var nr = ir;
function sr(e) {
  var t = typeof e;
  return e != null && (t == "object" || t == "function");
}
var cr = sr, lr = j, ur = cr, pr = "[object AsyncFunction]", dr = "[object Function]", fr = "[object GeneratorFunction]", mr = "[object Proxy]";
function gr(e) {
  if (!ur(e))
    return !1;
  var t = lr(e);
  return t == dr || t == fr || t == pr || t == mr;
}
var br = gr, hr = br, vr = C;
function yr(e) {
  return e != null && vr(e.length) && !hr(e);
}
var jr = yr, Tr = Ht, xr = nr, $r = jr;
function Ar(e) {
  return $r(e) ? Tr(e) : xr(e);
}
var wr = Ar, kr = de, _r = wr;
function Or(e) {
  return e == null ? [] : kr(e, _r(e));
}
var Sr = Or, Lr = U, Ur = Sr;
function Ir(e) {
  return Lr(Ur(e));
}
var Pr = Ir, Fr = se, Er = Pr, Rr = N;
function Nr(e) {
  var t = Rr(e) ? Fr : Er;
  return t(e);
}
var Cr = Nr;
const Gr = /* @__PURE__ */ V(Cr), Br = [
  {
    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"
  }
], g = Gr(Br).slice(0).reverse();
function Mr() {
  const { t: e } = L(), [t, r] = Q(() => {
    if (typeof window > "u")
      return g;
    try {
      const o = y.getItem("removedTipsIds");
      if (o !== null) {
        const s = o.split(",").map((p) => parseInt(p, 10));
        return g.filter((p) => s.indexOf(p.id) === -1);
      } else
        return g;
    } catch {
      return g;
    }
  }), a = (o) => {
    r((s) => {
      const u = y.getItem("removedTipsIds") || "", p = s.findIndex((l) => l.id === o);
      return y.setItem(
        "removedTipsIds",
        `${s[p].id.toString()}${u.length > 0 ? `,${u.split(",")}` : ""}`
      ), s.splice(p, 1), [...s];
    });
  }, i = t.slice(0).reverse();
  return /* @__PURE__ */ c.jsx(
    "div",
    {
      className: "hidden pb-4 pt-8 lg:grid",
      style: {
        gridTemplateColumns: "1fr"
      },
      children: t.map((o) => /* @__PURE__ */ c.jsx(
        "div",
        {
          className: "relative",
          style: {
            gridRowStart: 1,
            gridColumnStart: 1
          },
          children: /* @__PURE__ */ c.jsx(
            "div",
            {
              className: "relative",
              style: {
                transform: `scale(${1 - i.indexOf(o) / 20})`,
                top: -i.indexOf(o) * 10,
                opacity: `${1 - i.indexOf(o) / 7}`
              },
              children: /* @__PURE__ */ c.jsx(
                W,
                {
                  variant: "SidebarCard",
                  thumbnailUrl: o.thumbnailUrl,
                  mediaLink: o.mediaLink,
                  title: o.title,
                  description: o.description,
                  learnMore: { href: o.href, text: e("learn_more") },
                  actionButton: { onClick: () => a(o.id), child: e("dismiss") }
                }
              )
            }
          )
        },
        o.id
      ))
    }
  );
}
const Dr = X(Mr);
function Hr({
  title: e,
  description: t,
  background: r,
  features: a,
  buttons: i,
  isParentLoading: o,
  children: s,
  plan: u
}) {
  const { resolvedTheme: p } = q(), { t: l } = L(), { isPending: G, hasTeamPlan: B } = D(), { data: v } = H.viewer.teams.getUpgradeable.useQuery(), x = `${r}${p === "dark" ? "-dark" : ""}.jpg`, M = !1, K = !!(v != null && v[0]);
  return u === "team" && (B || K) || u === "enterprise" && M ? s : G ? /* @__PURE__ */ c.jsx(c.Fragment, { children: o }) : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
    /* @__PURE__ */ c.jsxs("div", { className: "relative flex min-h-[295px] w-full items-center justify-between overflow-hidden rounded-lg pb-10", children: [
      /* @__PURE__ */ c.jsxs("picture", { className: "absolute min-h-[295px] w-full rounded-lg object-cover", children: [
        /* @__PURE__ */ c.jsx("source", { srcSet: x, media: "(prefers-color-scheme: dark)" }),
        /* @__PURE__ */ c.jsx(
          "img",
          {
            className: "absolute min-h-[295px] w-full select-none rounded-lg object-cover object-left md:object-center",
            src: x,
            loading: "lazy",
            alt: e
          }
        )
      ] }),
      /* @__PURE__ */ c.jsxs("div", { className: "relative my-4 px-8 sm:px-14", children: [
        /* @__PURE__ */ c.jsx("h1", { className: $("font-cal text-3xl"), children: l(e) }),
        /* @__PURE__ */ c.jsx("p", { className: $("mb-8 mt-4 max-w-sm"), children: l(t) }),
        i
      ] })
    ] }),
    /* @__PURE__ */ c.jsx("div", { className: "mt-4 grid-cols-3 md:grid md:gap-4", children: a.map((f) => /* @__PURE__ */ c.jsxs("div", { className: "bg-muted mb-4 min-h-[180px] w-full rounded-md  p-8 md:mb-0", children: [
      f.icon,
      /* @__PURE__ */ c.jsx("h2", { className: "font-cal text-emphasis mt-4 text-lg", children: f.title }),
      /* @__PURE__ */ c.jsx("p", { className: "text-default", children: f.description })
    ] }, f.title)) })
  ] });
}
export {
  Dr as Tips,
  Hr as UpgradeTip
};
