@bpinternal/billing-ui 0.14.3 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -905,10 +905,10 @@ class Ha extends sn {
905
905
  W && W.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
906
906
  }
907
907
  let B = [];
908
- const x = this.languageUtils.getFallbackCodes(this.options.fallbackLng, a.lng || this.language);
909
- if (this.options.saveMissingTo === "fallback" && x && x[0])
910
- for (let W = 0; W < x.length; W++)
911
- B.push(x[W]);
908
+ const P = this.languageUtils.getFallbackCodes(this.options.fallbackLng, a.lng || this.language);
909
+ if (this.options.saveMissingTo === "fallback" && P && P[0])
910
+ for (let W = 0; W < P.length; W++)
911
+ B.push(P[W]);
912
912
  else this.options.saveMissingTo === "all" ? B = this.languageUtils.toResolveHierarchy(a.lng || this.language) : B.push(a.lng || this.language);
913
913
  const H = (W, X, D) => {
914
914
  const ue = A && D !== h ? D : V;
@@ -4102,7 +4102,7 @@ const Ui = (t, e) => {
4102
4102
  "left-bottom"
4103
4103
  ], I = () => [...T(), z, U], k = () => ["auto", "hidden", "clip", "visible", "scroll"], A = () => ["auto", "contain", "none"], w = () => [z, U, d], E = () => [ht, "full", "auto", ...w()], L = () => [Ye, "none", "subgrid", z, U], O = () => ["auto", {
4104
4104
  span: ["full", Ye, z, U]
4105
- }, Ye, z, U], Z = () => [Ye, "auto", z, U], V = () => ["auto", "min", "max", "fr", z, U], $ = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], B = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], x = () => ["auto", ...w()], H = () => [ht, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...w()], W = () => [ht, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...w()], X = () => [ht, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...w()], D = () => [t, z, U], ue = () => [...T(), Ar, Ir, {
4105
+ }, Ye, z, U], Z = () => [Ye, "auto", z, U], V = () => ["auto", "min", "max", "fr", z, U], $ = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], B = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], P = () => ["auto", ...w()], H = () => [ht, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...w()], W = () => [ht, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...w()], X = () => [ht, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...w()], D = () => [t, z, U], ue = () => [...T(), Ar, Ir, {
4106
4106
  position: [z, U]
4107
4107
  }], ee = () => ["no-repeat", {
4108
4108
  repeat: ["", "x", "y", "space", "round"]
@@ -4116,7 +4116,7 @@ const Ui = (t, e) => {
4116
4116
  c,
4117
4117
  z,
4118
4118
  U
4119
- ], G = () => ["", ie, la, wt], P = () => ["solid", "dashed", "dotted", "double"], be = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], te = () => [ie, Tn, Ar, Ir], de = () => [
4119
+ ], G = () => ["", ie, la, wt], x = () => ["solid", "dashed", "dotted", "double"], be = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], te = () => [ie, Tn, Ar, Ir], de = () => [
4120
4120
  // Deprecated since Tailwind CSS v4.0.0
4121
4121
  "",
4122
4122
  "none",
@@ -4709,77 +4709,77 @@ const Ui = (t, e) => {
4709
4709
  * @see https://tailwindcss.com/docs/margin
4710
4710
  */
4711
4711
  m: [{
4712
- m: x()
4712
+ m: P()
4713
4713
  }],
4714
4714
  /**
4715
4715
  * Margin Inline
4716
4716
  * @see https://tailwindcss.com/docs/margin
4717
4717
  */
4718
4718
  mx: [{
4719
- mx: x()
4719
+ mx: P()
4720
4720
  }],
4721
4721
  /**
4722
4722
  * Margin Block
4723
4723
  * @see https://tailwindcss.com/docs/margin
4724
4724
  */
4725
4725
  my: [{
4726
- my: x()
4726
+ my: P()
4727
4727
  }],
4728
4728
  /**
4729
4729
  * Margin Inline Start
4730
4730
  * @see https://tailwindcss.com/docs/margin
4731
4731
  */
4732
4732
  ms: [{
4733
- ms: x()
4733
+ ms: P()
4734
4734
  }],
4735
4735
  /**
4736
4736
  * Margin Inline End
4737
4737
  * @see https://tailwindcss.com/docs/margin
4738
4738
  */
4739
4739
  me: [{
4740
- me: x()
4740
+ me: P()
4741
4741
  }],
4742
4742
  /**
4743
4743
  * Margin Block Start
4744
4744
  * @see https://tailwindcss.com/docs/margin
4745
4745
  */
4746
4746
  mbs: [{
4747
- mbs: x()
4747
+ mbs: P()
4748
4748
  }],
4749
4749
  /**
4750
4750
  * Margin Block End
4751
4751
  * @see https://tailwindcss.com/docs/margin
4752
4752
  */
4753
4753
  mbe: [{
4754
- mbe: x()
4754
+ mbe: P()
4755
4755
  }],
4756
4756
  /**
4757
4757
  * Margin Top
4758
4758
  * @see https://tailwindcss.com/docs/margin
4759
4759
  */
4760
4760
  mt: [{
4761
- mt: x()
4761
+ mt: P()
4762
4762
  }],
4763
4763
  /**
4764
4764
  * Margin Right
4765
4765
  * @see https://tailwindcss.com/docs/margin
4766
4766
  */
4767
4767
  mr: [{
4768
- mr: x()
4768
+ mr: P()
4769
4769
  }],
4770
4770
  /**
4771
4771
  * Margin Bottom
4772
4772
  * @see https://tailwindcss.com/docs/margin
4773
4773
  */
4774
4774
  mb: [{
4775
- mb: x()
4775
+ mb: P()
4776
4776
  }],
4777
4777
  /**
4778
4778
  * Margin Left
4779
4779
  * @see https://tailwindcss.com/docs/margin
4780
4780
  */
4781
4781
  ml: [{
4782
- ml: x()
4782
+ ml: P()
4783
4783
  }],
4784
4784
  /**
4785
4785
  * Space Between X
@@ -5072,7 +5072,7 @@ const Ui = (t, e) => {
5072
5072
  * @see https://tailwindcss.com/docs/text-decoration-style
5073
5073
  */
5074
5074
  "text-decoration-style": [{
5075
- decoration: [...P(), "wavy"]
5075
+ decoration: [...x(), "wavy"]
5076
5076
  }],
5077
5077
  /**
5078
5078
  * Text Decoration Thickness
@@ -5489,14 +5489,14 @@ const Ui = (t, e) => {
5489
5489
  * @see https://tailwindcss.com/docs/border-style
5490
5490
  */
5491
5491
  "border-style": [{
5492
- border: [...P(), "hidden", "none"]
5492
+ border: [...x(), "hidden", "none"]
5493
5493
  }],
5494
5494
  /**
5495
5495
  * Divide Style
5496
5496
  * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
5497
5497
  */
5498
5498
  "divide-style": [{
5499
- divide: [...P(), "hidden", "none"]
5499
+ divide: [...x(), "hidden", "none"]
5500
5500
  }],
5501
5501
  /**
5502
5502
  * Border Color
@@ -5587,7 +5587,7 @@ const Ui = (t, e) => {
5587
5587
  * @see https://tailwindcss.com/docs/outline-style
5588
5588
  */
5589
5589
  "outline-style": [{
5590
- outline: [...P(), "none", "hidden"]
5590
+ outline: [...x(), "none", "hidden"]
5591
5591
  }],
5592
5592
  /**
5593
5593
  * Outline Offset
@@ -7417,7 +7417,7 @@ const rd = ({
7417
7417
  onOpenChange: e,
7418
7418
  onSelectPlan: a,
7419
7419
  recommendedPlanId: n = "team",
7420
- defaultInterval: r = "year",
7420
+ defaultInterval: r = "month",
7421
7421
  excludePlanIds: s = [],
7422
7422
  planFeatures: o = {},
7423
7423
  featureDescriptions: i
@@ -7427,27 +7427,27 @@ const rd = ({
7427
7427
  Oe(() => {
7428
7428
  t && u.capture(we.PLAN_PICKER_VIEWED, { interval: h });
7429
7429
  }, [t, u]);
7430
- const I = (P) => {
7431
- P !== h && u.capture(we.PLAN_INTERVAL_TOGGLED, { interval: P }), g(P);
7432
- }, k = v == null ? void 0 : v.plan.current.interval, A = b == null ? void 0 : b.find((P) => P.id === (v == null ? void 0 : v.plan.current.planId)), w = v ? A ? _e(A) : "community" : void 0, E = ((M = v == null ? void 0 : v.plan.next) == null ? void 0 : M.planId) ?? null, L = !!E && E !== (v == null ? void 0 : v.plan.current.planId), O = T || w === "enterprise" || w === "managed", Z = Re(() => b ? b.filter(
7433
- (P) => _e(P) !== "managed" && _e(P) !== "enterprise" && !s.includes(P.id)
7434
- ).sort((P, be) => Wt.indexOf(_e(P)) - Wt.indexOf(_e(be))) : [], [b, s]), V = Re(() => nd(Z), [Z]), $ = Ql(), B = Re(() => {
7430
+ const I = (x) => {
7431
+ x !== h && u.capture(we.PLAN_INTERVAL_TOGGLED, { interval: x }), g(x);
7432
+ }, k = v == null ? void 0 : v.plan.current.interval, A = b == null ? void 0 : b.find((x) => x.id === (v == null ? void 0 : v.plan.current.planId)), w = v ? A ? _e(A) : "community" : void 0, E = ((M = v == null ? void 0 : v.plan.next) == null ? void 0 : M.planId) ?? null, L = !!E && E !== (v == null ? void 0 : v.plan.current.planId), O = T || w === "enterprise" || w === "managed", Z = Re(() => b ? b.filter(
7433
+ (x) => _e(x) !== "managed" && _e(x) !== "enterprise" && !s.includes(x.id)
7434
+ ).sort((x, be) => Wt.indexOf(_e(x)) - Wt.indexOf(_e(be))) : [], [b, s]), V = Re(() => nd(Z), [Z]), $ = Ql(), B = Re(() => {
7435
7435
  var te;
7436
7436
  if (Z.length === 0)
7437
7437
  return null;
7438
- const P = Z.find(
7438
+ const x = Z.find(
7439
7439
  (de) => _e(de) === n || de.id === n
7440
7440
  ), be = Z.find((de) => _e(de) === w);
7441
- return ((te = P ?? be ?? Z[0]) == null ? void 0 : te.id) ?? null;
7442
- }, [Z, n, w]), [x, H] = J(void 0), [W, X] = J(t);
7441
+ return ((te = x ?? be ?? Z[0]) == null ? void 0 : te.id) ?? null;
7442
+ }, [Z, n, w]), [P, H] = J(void 0), [W, X] = J(t);
7443
7443
  W !== t && (X(t), H(void 0));
7444
- const D = x === void 0 ? B : x, ue = ((G = (K = b == null ? void 0 : b.find((P) => _e(P) === "enterprise")) == null ? void 0 : K.metadata) == null ? void 0 : G.contact_url) ?? Is, ee = (P) => {
7444
+ const D = P === void 0 ? B : P, ue = ((G = (K = b == null ? void 0 : b.find((x) => _e(x) === "enterprise")) == null ? void 0 : K.metadata) == null ? void 0 : G.contact_url) ?? Is, ee = (x) => {
7445
7445
  S.mutate(
7446
- { planId: P.id, interval: h },
7446
+ { planId: x.id, interval: h },
7447
7447
  {
7448
7448
  onSuccess: () => {
7449
7449
  u.capture(we.PLAN_DOWNGRADED, {
7450
- plan_name: Ne(P.name),
7450
+ plan_name: Ne(x.name),
7451
7451
  interval: h,
7452
7452
  previous_plan_name: A ? Ne(A.name) : void 0
7453
7453
  }), c({ type: "success", message: m("upgradeDowngradeSuccess") });
@@ -7505,15 +7505,15 @@ const rd = ({
7505
7505
  }
7506
7506
  ) }),
7507
7507
  /* @__PURE__ */ p("div", { className: "bpb-upgrade__grid", children: [
7508
- C && [0, 1, 2].map((P) => /* @__PURE__ */ p("div", { className: "bpb-plan-card", "aria-hidden": !0, children: [
7508
+ C && [0, 1, 2].map((x) => /* @__PURE__ */ p("div", { className: "bpb-plan-card", "aria-hidden": !0, children: [
7509
7509
  /* @__PURE__ */ l(me, { width: 120, height: 22 }),
7510
7510
  /* @__PURE__ */ l(me, { width: 90, height: 40 }),
7511
7511
  /* @__PURE__ */ l(me, { width: "100%", height: 36, rounded: !0 }),
7512
7512
  /* @__PURE__ */ l(me, { width: "100%", height: 140 })
7513
- ] }, P)),
7514
- Z.map((P, be) => {
7513
+ ] }, x)),
7514
+ Z.map((x, be) => {
7515
7515
  var sa, oa;
7516
- const te = _e(P), de = td(P, h), pe = ad(P, h), ae = (((sa = P.prices.month) == null ? void 0 : sa.amount) ?? 0) <= 0, fe = te === w, se = fe && (w === "community" || h === k), Ee = te === w && w !== "community" && h !== k, st = !!E && P.id === E && !se, pt = w !== void 0 && Wt.indexOf(te) < Wt.indexOf(w), Pe = (te === n || P.id === n) && !se, Ze = fe && L ? "cancel_downgrade" : se ? "current" : Ee ? "switch_interval" : st ? "next" : pt ? "downgrade" : "upgrade", ta = be > 0 ? Z[be - 1] : void 0, aa = o[te] ?? $n[te], Et = P.features.conversation_sessions, Lt = Gn(_, P, h), Ot = P.features.ai_spend, Ea = Ot !== void 0 ? m("planFeatureAiUsageIncluded", {
7516
+ const te = _e(x), de = td(x, h), pe = ad(x, h), ae = (((sa = x.prices.month) == null ? void 0 : sa.amount) ?? 0) <= 0, fe = te === w, se = fe && (w === "community" || h === k), Ee = te === w && w !== "community" && h !== k, st = !!E && x.id === E && !se, pt = w !== void 0 && Wt.indexOf(te) < Wt.indexOf(w), Pe = (te === n || x.id === n) && !se, Ze = fe && L ? "cancel_downgrade" : se ? "current" : Ee ? "switch_interval" : st ? "next" : pt ? "downgrade" : "upgrade", ta = be > 0 ? Z[be - 1] : void 0, aa = o[te] ?? $n[te], Et = x.features.conversation_sessions, Lt = Gn(_, x, h), Ot = x.features.ai_spend, Ea = Ot !== void 0 ? m("planFeatureAiUsageIncluded", {
7517
7517
  amount: le(Ot / tt, (de == null ? void 0 : de.currency) ?? "usd", 0)
7518
7518
  }) : void 0, vn = Ot !== void 0 && Et ? m("planFeatureDescAiUsageIncluded", {
7519
7519
  rate: le(
@@ -7531,7 +7531,7 @@ const rd = ({
7531
7531
  description: (i == null ? void 0 : i["AI usage included"]) ?? vn
7532
7532
  }
7533
7533
  } : {}
7534
- }, na = S.isPending && (Ze === "downgrade" && ((oa = S.variables) == null ? void 0 : oa.planId) === P.id || Ze === "cancel_downgrade"), xe = Ne(P.name), mt = !$ || D === P.id, ra = pe !== null && de ? /* @__PURE__ */ p(Te, { children: [
7534
+ }, na = S.isPending && (Ze === "downgrade" && ((oa = S.variables) == null ? void 0 : oa.planId) === x.id || Ze === "cancel_downgrade"), xe = Ne(x.name), mt = !$ || D === x.id, ra = pe !== null && de ? /* @__PURE__ */ p(Te, { children: [
7535
7535
  /* @__PURE__ */ l("span", { className: "bpb-plan-card__currency", children: za(de.currency) }),
7536
7536
  /* @__PURE__ */ l("span", { className: "bpb-plan-card__amount", children: Number.isInteger(pe) ? pe : pe.toFixed(2).replace(/\.00$/, "") }),
7537
7537
  /* @__PURE__ */ l("span", { className: "bpb-plan-card__per", children: m("upgradePerMonthSuffix", { currency: de.currency.toUpperCase() }) })
@@ -7545,7 +7545,7 @@ const rd = ({
7545
7545
  $ && "bpb-plan-card--accordion",
7546
7546
  $ && mt && "is-expanded"
7547
7547
  ),
7548
- "data-plan-id": P.id,
7548
+ "data-plan-id": x.id,
7549
7549
  children: [
7550
7550
  $ ? (
7551
7551
  /* Name + price stay visible collapsed, so tiers compare. */
@@ -7555,7 +7555,7 @@ const rd = ({
7555
7555
  type: "button",
7556
7556
  className: "bpb-plan-card__summary",
7557
7557
  "aria-expanded": mt,
7558
- onClick: () => H(mt ? null : P.id),
7558
+ onClick: () => H(mt ? null : x.id),
7559
7559
  children: [
7560
7560
  /* @__PURE__ */ p("span", { className: "bpb-plan-card__summary-text", children: [
7561
7561
  /* @__PURE__ */ p("span", { className: "bpb-plan-card__name", children: [
@@ -7575,12 +7575,12 @@ const rd = ({
7575
7575
  xe,
7576
7576
  Pe && /* @__PURE__ */ l(Ja, { className: "bpb-plan-card__badge", children: m("upgradeRecommended") })
7577
7577
  ] }),
7578
- /* @__PURE__ */ l("p", { className: "bpb-plan-card__tagline", children: m(Pr[_e(P)]) }),
7578
+ /* @__PURE__ */ l("p", { className: "bpb-plan-card__tagline", children: m(Pr[_e(x)]) }),
7579
7579
  /* @__PURE__ */ l("div", { className: "bpb-plan-card__price", children: ra })
7580
7580
  ] })
7581
7581
  ),
7582
7582
  mt && /* @__PURE__ */ p(Te, { children: [
7583
- $ && /* @__PURE__ */ l("p", { className: "bpb-plan-card__tagline", children: m(Pr[_e(P)]) }),
7583
+ $ && /* @__PURE__ */ l("p", { className: "bpb-plan-card__tagline", children: m(Pr[_e(x)]) }),
7584
7584
  Et !== void 0 && /* @__PURE__ */ p("div", { className: "bpb-plan-card__allowance", children: [
7585
7585
  /* @__PURE__ */ p("div", { className: "bpb-plan-card__metric", children: [
7586
7586
  /* @__PURE__ */ l("span", { className: "bpb-plan-card__metric-value", children: ve(Et) }),
@@ -7601,7 +7601,7 @@ const rd = ({
7601
7601
  block: !0,
7602
7602
  disabled: O || S.isPending,
7603
7603
  loading: na,
7604
- onClick: () => ee(P),
7604
+ onClick: () => ee(x),
7605
7605
  children: m("upgradeDowngrade")
7606
7606
  }
7607
7607
  ),
@@ -7614,10 +7614,10 @@ const rd = ({
7614
7614
  title: O ? m("upgradePlanManaged") : void 0,
7615
7615
  onClick: () => {
7616
7616
  u.capture(we.PLAN_UPGRADE_INITIATED, {
7617
- plan_name: Ne(P.name),
7617
+ plan_name: Ne(x.name),
7618
7618
  interval: h,
7619
7619
  current_plan_name: A ? Ne(A.name) : void 0
7620
- }), a(P.id, h);
7620
+ }), a(x.id, h);
7621
7621
  },
7622
7622
  children: m(h === "year" ? "upgradeSwitchToAnnual" : "upgradeSwitchToMonthly")
7623
7623
  }
@@ -7631,10 +7631,10 @@ const rd = ({
7631
7631
  title: O ? m("upgradePlanManaged") : void 0,
7632
7632
  onClick: () => {
7633
7633
  u.capture(we.PLAN_UPGRADE_INITIATED, {
7634
- plan_name: Ne(P.name),
7634
+ plan_name: Ne(x.name),
7635
7635
  interval: h,
7636
7636
  current_plan_name: A ? Ne(A.name) : void 0
7637
- }), a(P.id, h);
7637
+ }), a(x.id, h);
7638
7638
  },
7639
7639
  children: m("upgradeUpgrade")
7640
7640
  }
@@ -7651,7 +7651,7 @@ const rd = ({
7651
7651
  ] })
7652
7652
  ]
7653
7653
  },
7654
- P.id
7654
+ x.id
7655
7655
  );
7656
7656
  })
7657
7657
  ] }),
@@ -7783,7 +7783,7 @@ const id = 4, ld = ({
7783
7783
  onSubscribe: d
7784
7784
  }) => {
7785
7785
  var H, W, X, D, ue;
7786
- const { locale: c } = ne(), { t: u } = ge(), { data: m } = Qt(), h = ((H = t == null ? void 0 : t.prices.month) == null ? void 0 : H.currency) ?? ((W = t == null ? void 0 : t.prices.year) == null ? void 0 : W.currency) ?? "usd", g = t == null ? void 0 : t.features.conversation_sessions, b = t && _e(t) === "community" ? u("conversationsUnit") : u("conversationsPerMonth"), C = t ? Gn(m, t, e) : null, _ = (a == null ? void 0 : a.costs.immediate.amountDue) ?? 0, v = (a == null ? void 0 : a.costs.immediate.accountBalance) ?? 0, N = (a == null ? void 0 : a.costs.nextCycle.total) ?? 0, S = a != null && a.nextBillingDate ? Pl(a.nextBillingDate, 1) : null, T = S && !Xa(S) ? ct(S, c) : null, I = t ? $n[_e(t)].slice(0, id) : [], k = t == null ? void 0 : t.features.ai_spend, A = k !== void 0 ? u("planFeatureAiUsageIncluded", { amount: le(k / tt, h, 0) }) : void 0, w = t ? ((X = t.prices[e]) == null ? void 0 : X.amount) ?? 0 : 0, E = (a == null ? void 0 : a.costs.immediate.lineItems) ?? [], L = E.filter((ee) => ee.type === "discount"), O = E.filter((ee) => ee.type === "proration_credit" || ee.type === "proration_charge").reduce((ee, ce) => ee + ce.amount, 0), Z = !!(a != null && a.subscription.plan.effectiveDate), V = ((D = t == null ? void 0 : t.prices.month) == null ? void 0 : D.amount) ?? 0, $ = ((ue = t == null ? void 0 : t.prices.year) == null ? void 0 : ue.amount) ?? 0, B = e === "year" && V > 0 && $ > 0 ? Math.round(V * 12 - $) : 0, x = Math.round(B / 12);
7786
+ const { locale: c } = ne(), { t: u } = ge(), { data: m } = Qt(), h = ((H = t == null ? void 0 : t.prices.month) == null ? void 0 : H.currency) ?? ((W = t == null ? void 0 : t.prices.year) == null ? void 0 : W.currency) ?? "usd", g = t == null ? void 0 : t.features.conversation_sessions, b = t && _e(t) === "community" ? u("conversationsUnit") : u("conversationsPerMonth"), C = t ? Gn(m, t, e) : null, _ = (a == null ? void 0 : a.costs.immediate.amountDue) ?? 0, v = (a == null ? void 0 : a.costs.immediate.accountBalance) ?? 0, N = (a == null ? void 0 : a.costs.nextCycle.total) ?? 0, S = a != null && a.nextBillingDate ? Pl(a.nextBillingDate, 1) : null, T = S && !Xa(S) ? ct(S, c) : null, I = t ? $n[_e(t)].slice(0, id) : [], k = t == null ? void 0 : t.features.ai_spend, A = k !== void 0 ? u("planFeatureAiUsageIncluded", { amount: le(k / tt, h, 0) }) : void 0, w = t ? ((X = t.prices[e]) == null ? void 0 : X.amount) ?? 0 : 0, E = (a == null ? void 0 : a.costs.immediate.lineItems) ?? [], L = E.filter((ee) => ee.type === "discount"), O = E.filter((ee) => ee.type === "proration_credit" || ee.type === "proration_charge").reduce((ee, ce) => ee + ce.amount, 0), Z = !!(a != null && a.subscription.plan.effectiveDate), V = ((D = t == null ? void 0 : t.prices.month) == null ? void 0 : D.amount) ?? 0, $ = ((ue = t == null ? void 0 : t.prices.year) == null ? void 0 : ue.amount) ?? 0, B = e === "year" && V > 0 && $ > 0 ? Math.round(V * 12 - $) : 0, P = Math.round(B / 12);
7787
7787
  return /* @__PURE__ */ p("div", { className: "bpb-summary-wrap", children: [
7788
7788
  /* @__PURE__ */ p("div", { className: "bpb-summary bpb-glow", children: [
7789
7789
  /* @__PURE__ */ l("h3", { className: "bpb-summary__title", children: t ? `${Ne(t.name)} plan` : /* @__PURE__ */ l(me, { width: 140, height: 24 }) }),
@@ -7869,7 +7869,7 @@ const id = 4, ld = ({
7869
7869
  B > 0 && /* @__PURE__ */ p("div", { className: "bpb-summary__savings", children: [
7870
7870
  /* @__PURE__ */ l(Hn, { size: 18, className: "bpb-summary__savings-icon" }),
7871
7871
  /* @__PURE__ */ l("span", { children: u("orderSavingsNote", {
7872
- monthlySavings: le(x, h, 0),
7872
+ monthlySavings: le(P, h, 0),
7873
7873
  yearlySavings: le(B, h, 0)
7874
7874
  }) })
7875
7875
  ] }),
@@ -8292,7 +8292,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8292
8292
  ] });
8293
8293
  }, gd = ({ planId: t, initialInterval: e, onSuccess: a }) => {
8294
8294
  var na;
8295
- const n = Gr(), r = Kr(), { email: s, toast: o, analytics: i, isDark: d } = ne(), { t: c } = ge(), [u, m] = J(e), [h, g] = J("payment"), [b, C] = J(null), [_, v] = J(!1), [N, S] = J(!1), [T, I] = J(!1), [k, A] = J(void 0), [w, E] = J(!1), [L, O] = J(""), [Z, V] = J(""), [$, B] = J(""), [x, H] = J(!1), [W, X] = J({}), [D, ue] = J(!1), ee = ls(), { data: ce } = rt(), { data: M } = $e(), { data: K, isLoading: G } = rs(), { data: P, isLoading: be, isError: te } = ss(), de = ce == null ? void 0 : ce.find((xe) => xe.id === t), pe = ((na = K == null ? void 0 : K.paymentMethod) == null ? void 0 : na.card) ?? null, ae = (P == null ? void 0 : P.address) ?? null;
8295
+ const n = Gr(), r = Kr(), { email: s, toast: o, analytics: i, isDark: d } = ne(), { t: c } = ge(), [u, m] = J(e), [h, g] = J("payment"), [b, C] = J(null), [_, v] = J(!1), [N, S] = J(!1), [T, I] = J(!1), [k, A] = J(void 0), [w, E] = J(!1), [L, O] = J(""), [Z, V] = J(""), [$, B] = J(""), [P, H] = J(!1), [W, X] = J({}), [D, ue] = J(!1), ee = ls(), { data: ce } = rt(), { data: M } = $e(), { data: K, isLoading: G } = rs(), { data: x, isLoading: be, isError: te } = ss(), de = ce == null ? void 0 : ce.find((xe) => xe.id === t), pe = ((na = K == null ? void 0 : K.paymentMethod) == null ? void 0 : na.card) ?? null, ae = (x == null ? void 0 : x.address) ?? null;
8296
8296
  Oe(() => {
8297
8297
  b === null && !G && K !== void 0 && C(pe ? "saved" : "new");
8298
8298
  }, [b, G, K, pe]), Oe(() => {
@@ -8310,7 +8310,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8310
8310
  i.capture(we.PAYMENT_METHOD_SELECTED, { method: xe === "saved" ? "saved_card" : "new_card" }), C(xe);
8311
8311
  }, Ea = (xe) => {
8312
8312
  v(xe), ue(!1);
8313
- }, vn = !!n && !!r && !!de && !be && !te && !se.isError && !!se.data && aa && Et && !x, _n = async () => {
8313
+ }, vn = !!n && !!r && !!de && !be && !te && !se.isError && !!se.data && aa && Et && !P, _n = async () => {
8314
8314
  var mt, ra, sa, oa;
8315
8315
  if (!n || !r || !de || be || te)
8316
8316
  return;
@@ -8363,13 +8363,13 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8363
8363
  };
8364
8364
  }
8365
8365
  }
8366
- const sr = w && L.trim() || qe || (P == null ? void 0 : P.name) || void 0, La = w && Z && $.trim() ? { type: Z, value: $.trim() } : void 0, mo = La ? [
8367
- ...((P == null ? void 0 : P.taxIds) ?? []).filter(
8366
+ const sr = w && L.trim() || qe || (x == null ? void 0 : x.name) || void 0, La = w && Z && $.trim() ? { type: Z, value: $.trim() } : void 0, mo = La ? [
8367
+ ...((x == null ? void 0 : x.taxIds) ?? []).filter(
8368
8368
  (He) => He.type !== La.type || He.value !== La.value
8369
8369
  ),
8370
8370
  La
8371
- ] : P == null ? void 0 : P.taxIds;
8372
- (Me || w || sr !== ((P == null ? void 0 : P.name) ?? void 0)) && await st.mutateAsync({
8371
+ ] : x == null ? void 0 : x.taxIds;
8372
+ (Me || w || sr !== ((x == null ? void 0 : x.name) ?? void 0)) && await st.mutateAsync({
8373
8373
  address: Me ?? ae ?? void 0,
8374
8374
  name: sr,
8375
8375
  taxIds: mo
@@ -8417,7 +8417,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8417
8417
  {
8418
8418
  stepNumber: 2,
8419
8419
  existingAddress: ae,
8420
- customerName: (P == null ? void 0 : P.name) ?? null,
8420
+ customerName: (x == null ? void 0 : x.name) ?? null,
8421
8421
  isLoading: be,
8422
8422
  editing: N,
8423
8423
  onEdit: () => S(!0),
@@ -8447,7 +8447,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8447
8447
  isLoadingPreview: se.isLoading,
8448
8448
  isPreviewError: se.isError,
8449
8449
  canSubscribe: vn,
8450
- isSubmitting: x,
8450
+ isSubmitting: P,
8451
8451
  submitError: W.general ?? null,
8452
8452
  onSubscribe: () => void _n()
8453
8453
  }
@@ -8541,8 +8541,8 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8541
8541
  return null;
8542
8542
  const M = {};
8543
8543
  for (const G of i) {
8544
- const P = o.addons[G.id];
8545
- M[G.id] = ((K = P == null ? void 0 : P.next) == null ? void 0 : K.quantity) ?? (P == null ? void 0 : P.current.quantity) ?? 0;
8544
+ const x = o.addons[G.id];
8545
+ M[G.id] = ((K = x == null ? void 0 : x.next) == null ? void 0 : K.quantity) ?? (x == null ? void 0 : x.current.quantity) ?? 0;
8546
8546
  }
8547
8547
  return M;
8548
8548
  }, [o, i]), S = m ?? N, T = Re(() => !i || !g ? [] : i.flatMap((M) => {
@@ -8556,14 +8556,14 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8556
8556
  [g, b, S]
8557
8557
  ), w = ns(A ?? { plan: { planId: "", interval: b } }, {
8558
8558
  enabled: !!A && I
8559
- }), E = ((D = g == null ? void 0 : g.prices[b]) == null ? void 0 : D.currency) ?? "usd", L = ((ue = w.data) == null ? void 0 : ue.costs.immediate.amountDue) ?? 0, O = (ee = w.data) == null ? void 0 : ee.nextBillingDate, Z = O && !Xa(O) ? ct(O, r) : null, V = ((ce = g == null ? void 0 : g.prices[b]) == null ? void 0 : ce.amount) ?? 0, $ = V + k, B = g && S ? Ll(g, i, S) : [], x = (M, K) => K === "bytes" ? Kt(M) : ve(M), H = (M, K) => {
8560
- const G = i == null ? void 0 : i.find((de) => de.id === M), P = G == null ? void 0 : G.increments;
8561
- if (!P || K <= 0)
8559
+ }), E = ((D = g == null ? void 0 : g.prices[b]) == null ? void 0 : D.currency) ?? "usd", L = ((ue = w.data) == null ? void 0 : ue.costs.immediate.amountDue) ?? 0, O = (ee = w.data) == null ? void 0 : ee.nextBillingDate, Z = O && !Xa(O) ? ct(O, r) : null, V = ((ce = g == null ? void 0 : g.prices[b]) == null ? void 0 : ce.amount) ?? 0, $ = V + k, B = g && S ? Ll(g, i, S) : [], P = (M, K) => K === "bytes" ? Kt(M) : ve(M), H = (M, K) => {
8560
+ const G = i == null ? void 0 : i.find((de) => de.id === M), x = G == null ? void 0 : G.increments;
8561
+ if (!x || K <= 0)
8562
8562
  return null;
8563
- const be = P.conversation_sessions ?? 0;
8563
+ const be = x.conversation_sessions ?? 0;
8564
8564
  if (be > 0)
8565
8565
  return s("addonsConvos", { n: ve(be * K) });
8566
- const te = P.file_storage ?? 0;
8566
+ const te = x.file_storage ?? 0;
8567
8567
  return te > 0 ? Kt(te * K) : null;
8568
8568
  }, W = () => {
8569
8569
  S && u.mutate(
@@ -8596,7 +8596,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8596
8596
  ) : /* @__PURE__ */ p(Te, { children: [
8597
8597
  /* @__PURE__ */ l("div", { className: "bpb-addons", children: T.map(({ addon: M, price: K }) => {
8598
8598
  var de;
8599
- const G = ((de = o == null ? void 0 : o.addons[M.id]) == null ? void 0 : de.current.quantity) ?? 0, P = (S == null ? void 0 : S[M.id]) ?? 0, be = P !== G ? P === 0 ? v ? s("addonRemovedOnDate", { activeNow: G, date: v }) : s("addonRemovedNextCycle", { activeNow: G }) : v ? s("addonChangedOnDate", { activeNow: G, pending: P, date: v }) : s("addonChangedNextCycle", { activeNow: G, pending: P }) : G > 0 ? s("addonActiveOnly", { count: G }) : null, te = H(M.id, P);
8599
+ const G = ((de = o == null ? void 0 : o.addons[M.id]) == null ? void 0 : de.current.quantity) ?? 0, x = (S == null ? void 0 : S[M.id]) ?? 0, be = x !== G ? x === 0 ? v ? s("addonRemovedOnDate", { activeNow: G, date: v }) : s("addonRemovedNextCycle", { activeNow: G }) : v ? s("addonChangedOnDate", { activeNow: G, pending: x, date: v }) : s("addonChangedNextCycle", { activeNow: G, pending: x }) : G > 0 ? s("addonActiveOnly", { count: G }) : null, te = H(M.id, x);
8600
8600
  return /* @__PURE__ */ p("div", { className: "bpb-addon-row", children: [
8601
8601
  /* @__PURE__ */ p("div", { className: "bpb-addon-row__info", children: [
8602
8602
  /* @__PURE__ */ l("span", { className: "bpb-addon-row__name", children: gt[M.id] ? s(gt[M.id]) : ja(M.name) }),
@@ -8611,7 +8611,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8611
8611
  {
8612
8612
  className: j(
8613
8613
  "bpb-addon-row__status",
8614
- P !== G && "bpb-addon-row__status--changed"
8614
+ x !== G && "bpb-addon-row__status--changed"
8615
8615
  ),
8616
8616
  children: be
8617
8617
  }
@@ -8623,7 +8623,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8623
8623
  fd,
8624
8624
  {
8625
8625
  "aria-label": `${gt[M.id] ? s(gt[M.id]) : ja(M.name)} quantity`,
8626
- value: P,
8626
+ value: x,
8627
8627
  onChange: (pe) => h({ ...S ?? {}, [M.id]: pe })
8628
8628
  }
8629
8629
  )
@@ -8642,9 +8642,9 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8642
8642
  return /* @__PURE__ */ p("div", { className: "bpb-manage-addons__limit-row", children: [
8643
8643
  /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-label", children: K ? s(K) : M.label }),
8644
8644
  /* @__PURE__ */ p("span", { className: "bpb-manage-addons__limit-values", children: [
8645
- /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-now", children: x(M.now, M.unit) }),
8645
+ /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-now", children: P(M.now, M.unit) }),
8646
8646
  /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-arrow", "aria-hidden": !0, children: "→" }),
8647
- /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-next", children: x(M.next, M.unit) })
8647
+ /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-next", children: P(M.next, M.unit) })
8648
8648
  ] })
8649
8649
  ] }, M.key);
8650
8650
  })
@@ -8794,7 +8794,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8794
8794
  onSuccess: a
8795
8795
  }) => {
8796
8796
  var pe;
8797
- const n = Gr(), r = Kr(), { toast: s, analytics: o } = ne(), { t: i } = ge(), { data: d, isLoading: c } = rs(), { data: u, isLoading: m } = ss(), h = ds(), g = cs(), b = ((pe = d == null ? void 0 : d.paymentMethod) == null ? void 0 : pe.card) ?? null, C = (u == null ? void 0 : u.address) ?? null, _ = (u == null ? void 0 : u.taxIds) ?? [], [v, N] = J(!1), [S, T] = J(!1), [I, k] = J(!1), [A, w] = J(!1), [E, L] = J(null), [O, Z] = J(!1), [V, $] = J(!1), [B, x] = J({}), [H, W] = J(C == null ? void 0 : C.country), [X, D] = J(_.length > 0), [ue, ee] = J(null), ce = ue ?? _.map((ae) => ({ type: ae.type, value: ae.value })), M = Ms(H), K = v || !b, G = (ae, fe) => ee(ce.map((se, Ee) => Ee === ae ? { ...se, ...fe } : se)), P = () => {
8797
+ const n = Gr(), r = Kr(), { toast: s, analytics: o } = ne(), { t: i } = ge(), { data: d, isLoading: c } = rs(), { data: u, isLoading: m } = ss(), h = ds(), g = cs(), b = ((pe = d == null ? void 0 : d.paymentMethod) == null ? void 0 : pe.card) ?? null, C = (u == null ? void 0 : u.address) ?? null, _ = (u == null ? void 0 : u.taxIds) ?? [], [v, N] = J(!1), [S, T] = J(!1), [I, k] = J(!1), [A, w] = J(!1), [E, L] = J(null), [O, Z] = J(!1), [V, $] = J(!1), [B, P] = J({}), [H, W] = J(C == null ? void 0 : C.country), [X, D] = J(_.length > 0), [ue, ee] = J(null), ce = ue ?? _.map((ae) => ({ type: ae.type, value: ae.value })), M = Ms(H), K = v || !b, G = (ae, fe) => ee(ce.map((se, Ee) => Ee === ae ? { ...se, ...fe } : se)), x = () => {
8798
8798
  var ae;
8799
8799
  return ee([...ce, { type: ((ae = M[0]) == null ? void 0 : ae.type) ?? "", value: "" }]);
8800
8800
  }, be = (ae) => ee(ce.filter((fe, se) => se !== ae)), te = async () => {
@@ -8830,10 +8830,10 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8830
8830
  return;
8831
8831
  const { complete: fe, value: se } = await ae.getValue();
8832
8832
  if (!fe || !se.address) {
8833
- x({ address: i("paymentAddressIncomplete") });
8833
+ P({ address: i("paymentAddressIncomplete") });
8834
8834
  return;
8835
8835
  }
8836
- $(!0), x({});
8836
+ $(!0), P({});
8837
8837
  try {
8838
8838
  const { address: Ee, name: st } = se, pt = ce.filter((Pe) => !!Pe.type && Pe.value.trim() !== "").map((Pe) => ({ type: Pe.type, value: Pe.value.trim() }));
8839
8839
  await g.mutateAsync({
@@ -8850,7 +8850,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8850
8850
  }), o.capture(we.BILLING_ADDRESS_UPDATED), s({ type: "success", message: i("paymentDetailsUpdated") }), a == null || a();
8851
8851
  } catch (Ee) {
8852
8852
  const st = Ee instanceof Error ? Ee : void 0, pt = Os(st, i("paymentAddressError"));
8853
- x(pt), pt.taxId && D(!0), s({ type: "error", message: i("paymentDetailsUpdateError") });
8853
+ P(pt), pt.taxId && D(!0), s({ type: "error", message: i("paymentDetailsUpdateError") });
8854
8854
  } finally {
8855
8855
  $(!1);
8856
8856
  }
@@ -8971,7 +8971,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8971
8971
  }
8972
8972
  )
8973
8973
  ] }, fe)),
8974
- /* @__PURE__ */ l("button", { type: "button", className: "bpb-link-button bpb-tax__add", onClick: P, children: i("paymentTaxAdd") }),
8974
+ /* @__PURE__ */ l("button", { type: "button", className: "bpb-link-button bpb-tax__add", onClick: x, children: i("paymentTaxAdd") }),
8975
8975
  B.taxId && /* @__PURE__ */ l("p", { role: "alert", className: "bpb-payment-dialog__field-error", children: B.taxId })
8976
8976
  ] })
8977
8977
  ] }),
@@ -13258,7 +13258,7 @@ const nu = ({
13258
13258
  period: i
13259
13259
  }) => {
13260
13260
  var $, B;
13261
- const { isOutdatedBilling: d, analytics: c, scope: u } = ne(), { t: m } = ge(), { data: h } = rt(), { data: g } = Qt(), { data: b } = $e({ enabled: !d }), { data: C } = Xt({ period: i, enabled: !d }), _ = t !== void 0, [v, N] = J(!1), S = h == null ? void 0 : h.find((x) => x.id === (b == null ? void 0 : b.plan.current.planId)), T = b ? S ? _e(S) === "community" : !0 : !1, I = Re(() => yn(C).find((x) => x.key === "conversation_sessions"), [C]), k = !_ && !d && T && !!I && I.pct / 100 >= Pc && !v && !Zs(zr, u, "modal"), A = _ ? !!t : k;
13261
+ const { isOutdatedBilling: d, analytics: c, scope: u } = ne(), { t: m } = ge(), { data: h } = rt(), { data: g } = Qt(), { data: b } = $e({ enabled: !d }), { data: C } = Xt({ period: i, enabled: !d }), _ = t !== void 0, [v, N] = J(!1), S = h == null ? void 0 : h.find((P) => P.id === (b == null ? void 0 : b.plan.current.planId)), T = b ? S ? _e(S) === "community" : !0 : !1, I = Re(() => yn(C).find((P) => P.key === "conversation_sessions"), [C]), k = !_ && !d && T && !!I && I.pct / 100 >= Pc && !v && !Zs(zr, u, "modal"), A = _ ? !!t : k;
13262
13262
  Oe(() => {
13263
13263
  A && c.capture(we.PLAN_PICKER_VIEWED, {
13264
13264
  source: _ ? "outgrow_free" : "outgrow_free_auto",
@@ -13267,10 +13267,10 @@ const nu = ({
13267
13267
  }, [A, _, c]);
13268
13268
  const w = () => {
13269
13269
  _ || (qs(zr, u, "modal"), N(!0)), e == null || e(!1);
13270
- }, E = Re(() => h ? h.filter((x) => {
13271
- const H = _e(x);
13270
+ }, E = Re(() => h ? h.filter((P) => {
13271
+ const H = _e(P);
13272
13272
  return H !== "community" && H !== "enterprise" && H !== "managed";
13273
- }).sort((x, H) => Wt.indexOf(_e(x)) - Wt.indexOf(_e(H))) : [], [h]), L = ((B = ($ = h == null ? void 0 : h.find((x) => _e(x) === "enterprise")) == null ? void 0 : $.metadata) == null ? void 0 : B.contact_url) ?? Is;
13273
+ }).sort((P, H) => Wt.indexOf(_e(P)) - Wt.indexOf(_e(H))) : [], [h]), L = ((B = ($ = h == null ? void 0 : h.find((P) => _e(P) === "enterprise")) == null ? void 0 : $.metadata) == null ? void 0 : B.contact_url) ?? Is;
13274
13274
  if (d || !A)
13275
13275
  return null;
13276
13276
  const O = (I == null ? void 0 : I.quota) ?? (S == null ? void 0 : S.features.conversation_sessions) ?? 100, Z = (I == null ? void 0 : I.used) ?? 0, V = I && I.pct > 0 ? Math.min(100, Math.max(5, Math.round(I.pct))) : 0;
@@ -13308,17 +13308,17 @@ const nu = ({
13308
13308
  }
13309
13309
  ) })
13310
13310
  ] }),
13311
- /* @__PURE__ */ l("div", { className: "bpb-outgrow__grid", children: E.map((x, H) => {
13312
- const W = _e(x), X = Rc(x, r), D = Ec(x, r), ue = W === n || x.id === n, ee = x.features.conversation_sessions, ce = Gn(g, x, r), M = H > 0 ? E[H - 1] : void 0, K = (s[W] ?? $n[W]).slice(0, Dc);
13311
+ /* @__PURE__ */ l("div", { className: "bpb-outgrow__grid", children: E.map((P, H) => {
13312
+ const W = _e(P), X = Rc(P, r), D = Ec(P, r), ue = W === n || P.id === n, ee = P.features.conversation_sessions, ce = Gn(g, P, r), M = H > 0 ? E[H - 1] : void 0, K = (s[W] ?? $n[W]).slice(0, Dc);
13313
13313
  return /* @__PURE__ */ p(
13314
13314
  "div",
13315
13315
  {
13316
13316
  className: j("bpb-plan-card", ue && "bpb-plan-card--highlighted bpb-glow"),
13317
- "data-plan-id": x.id,
13317
+ "data-plan-id": P.id,
13318
13318
  children: [
13319
13319
  /* @__PURE__ */ p("div", { className: "bpb-plan-card__header", children: [
13320
13320
  /* @__PURE__ */ p("h3", { className: "bpb-plan-card__name", children: [
13321
- Ne(x.name),
13321
+ Ne(P.name),
13322
13322
  ue && /* @__PURE__ */ l(Ja, { className: "bpb-plan-card__badge", children: m("upgradeRecommended") })
13323
13323
  ] }),
13324
13324
  /* @__PURE__ */ l("div", { className: "bpb-plan-card__price", children: D !== null && X ? /* @__PURE__ */ p(Te, { children: [
@@ -13353,13 +13353,13 @@ const nu = ({
13353
13353
  block: !0,
13354
13354
  onClick: () => {
13355
13355
  c.capture(we.PLAN_UPGRADE_INITIATED, {
13356
- plan_name: Ne(x.name),
13356
+ plan_name: Ne(P.name),
13357
13357
  interval: r,
13358
13358
  source: "outgrow_free"
13359
- }), a(x.id, r), w();
13359
+ }), a(P.id, r), w();
13360
13360
  },
13361
13361
  children: [
13362
- m("outgrowUpgradeTo", { planName: Ne(x.name) }),
13362
+ m("outgrowUpgradeTo", { planName: Ne(P.name) }),
13363
13363
  ue && /* @__PURE__ */ l(Xn, { size: 15 })
13364
13364
  ]
13365
13365
  }
@@ -13367,16 +13367,16 @@ const nu = ({
13367
13367
  /* @__PURE__ */ p("ul", { className: "bpb-plan-card__features", children: [
13368
13368
  M && /* @__PURE__ */ l("li", { className: "bpb-outgrow__features-lead", children: m("outgrowEverythingIn", { planName: Ne(M.name) }) }),
13369
13369
  K.map((G) => {
13370
- const P = er(G), be = Kn[G], te = be !== void 0 ? m(be.label) : G, de = (o == null ? void 0 : o[G]) ?? (be !== void 0 ? m(be.desc) : void 0);
13370
+ const x = er(G), be = Kn[G], te = be !== void 0 ? m(be.label) : G, de = (o == null ? void 0 : o[G]) ?? (be !== void 0 ? m(be.desc) : void 0);
13371
13371
  return /* @__PURE__ */ p("li", { children: [
13372
- /* @__PURE__ */ l("span", { className: "bpb-plan-card__feature-chip", children: /* @__PURE__ */ l(P, { size: 13 }) }),
13372
+ /* @__PURE__ */ l("span", { className: "bpb-plan-card__feature-chip", children: /* @__PURE__ */ l(x, { size: 13 }) }),
13373
13373
  de ? /* @__PURE__ */ l(Qa, { label: te, children: de }) : /* @__PURE__ */ l("span", { children: te })
13374
13374
  ] }, G);
13375
13375
  })
13376
13376
  ] })
13377
13377
  ]
13378
13378
  },
13379
- x.id
13379
+ P.id
13380
13380
  );
13381
13381
  }) }),
13382
13382
  /* @__PURE__ */ p("footer", { className: "bpb-outgrow__footer", children: [
@@ -13899,9 +13899,9 @@ const nu = ({
13899
13899
  ), S = ((X = b == null ? void 0 : b.prices[C]) == null ? void 0 : X.amount) ?? 0, T = (m ?? []).reduce((D, ue) => {
13900
13900
  const ee = b ? Wn(ue, b, C) : null;
13901
13901
  return D + (N[ue.id] ?? 0) * ((ee == null ? void 0 : ee.amount) ?? 0);
13902
- }, 0), I = S + T, k = C === "year" ? "/yr" : "/mo", A = Ol(b, m, N).find((D) => D.key === "conversation_sessions"), w = o(v === "community" ? "conversationsUnit" : "conversationsPerMonth"), E = v === "enterprise" || v === "managed", L = v !== "community" && !E, O = i == null ? void 0 : i.plan.next, Z = O && O.planId !== (g == null ? void 0 : g.planId), V = g == null ? void 0 : g.periodEnd, $ = L && !Z && V && !Xa(V) ? ct(V, n) : null, B = c == null ? void 0 : c.find((D) => D.id === (O == null ? void 0 : O.planId)), x = O == null ? void 0 : O.effectiveDate, H = Z && B && x ? o("planBannerDowngradesTo", {
13902
+ }, 0), I = S + T, k = C === "year" ? "/yr" : "/mo", A = Ol(b, m, N).find((D) => D.key === "conversation_sessions"), w = o(v === "community" ? "conversationsUnit" : "conversationsPerMonth"), E = v === "enterprise" || v === "managed", L = v !== "community" && !E, O = i == null ? void 0 : i.plan.next, Z = O && O.planId !== (g == null ? void 0 : g.planId), V = g == null ? void 0 : g.periodEnd, $ = L && !Z && V && !Xa(V) ? ct(V, n) : null, B = c == null ? void 0 : c.find((D) => D.id === (O == null ? void 0 : O.planId)), P = O == null ? void 0 : O.effectiveDate, H = Z && B && P ? o("planBannerDowngradesTo", {
13903
13903
  plan: Ne(B.name),
13904
- date: ct(x, n)
13904
+ date: ct(P, n)
13905
13905
  }) : null;
13906
13906
  return /* @__PURE__ */ p(
13907
13907
  "button",
@@ -14014,14 +14014,14 @@ const nu = ({
14014
14014
  ] }) : /* @__PURE__ */ p("div", { className: "bpb-plan-usage__head", children: [
14015
14015
  /* @__PURE__ */ l("span", { className: "bpb-plan-usage__plan", children: C ? Ne(C.name) : d("free") }),
14016
14016
  t && /* @__PURE__ */ l(yt, { size: 15, className: "bpb-plan-usage__chevron" })
14017
- ] }) }), x = j(
14017
+ ] }) }), P = j(
14018
14018
  "bpb-plan-usage bpb-scope",
14019
14019
  `bpb-plan-usage--${a}`,
14020
14020
  L && `bpb-plan-usage--${E}`,
14021
14021
  t && "bpb-plan-usage--clickable",
14022
14022
  r
14023
14023
  );
14024
- return t ? /* @__PURE__ */ l("button", { type: "button", className: x, style: s, onClick: t, children: B }) : /* @__PURE__ */ l("div", { className: x, style: s, children: B });
14024
+ return t ? /* @__PURE__ */ l("button", { type: "button", className: P, style: s, onClick: t, children: B }) : /* @__PURE__ */ l("div", { className: P, style: s, children: B });
14025
14025
  }, Fc = ({
14026
14026
  children: t,
14027
14027
  delay: e = 200,
@@ -14078,7 +14078,7 @@ const nu = ({
14078
14078
  /* @__PURE__ */ l("span", { className: "bpb-usage-pop__period", children: m("usagePopoverTitle", { date: V }) })
14079
14079
  ] }) }),
14080
14080
  I.map((B) => {
14081
- const x = B.pct > 0 ? Math.max(5, B.pct) : 0;
14081
+ const P = B.pct > 0 ? Math.max(5, B.pct) : 0;
14082
14082
  return /* @__PURE__ */ p("span", { className: "bpb-usage-pop__item", children: [
14083
14083
  /* @__PURE__ */ p("span", { className: "bpb-usage-pop__head", children: [
14084
14084
  /* @__PURE__ */ l("span", { className: "bpb-usage-pop__name", children: uo(B.key, m) }),
@@ -14092,7 +14092,7 @@ const nu = ({
14092
14092
  "span",
14093
14093
  {
14094
14094
  className: j("bpb-usage-pop__fill", `bpb-usage-pop__fill--${rr(B.pct)}`),
14095
- style: { width: `${x}%` }
14095
+ style: { width: `${P}%` }
14096
14096
  }
14097
14097
  ) })
14098
14098
  ] }, B.key);
@@ -14202,20 +14202,19 @@ const nu = ({
14202
14202
  refetch: v
14203
14203
  } = is(), N = Li(), [S, T] = J(null), [I, k] = J(!1), [A, w] = J(!1), [E, L] = J(!1), O = i || m || C, Z = d || h || _, V = () => {
14204
14204
  c(), g(), v();
14205
- }, $ = u == null ? void 0 : u.find((pe) => pe.id === (o == null ? void 0 : o.plan.current.planId)), B = o ? $ ? _e($) === "community" : !0 : !1, x = b == null ? void 0 : b[Vr], H = Re(() => {
14206
- const pe = (x == null ? void 0 : x.maxAmount) != null, fe = (x == null ? void 0 : x.targetType) === "credit_grant" && (x == null ? void 0 : x.thresholdType) === "remaining_amount" ? x == null ? void 0 : x.threshold : null;
14205
+ }, $ = u == null ? void 0 : u.find((pe) => pe.id === (o == null ? void 0 : o.plan.current.planId)), B = o ? $ ? _e($) === "community" : !0 : !1, P = b == null ? void 0 : b[Vr], H = Re(() => {
14206
+ const pe = (P == null ? void 0 : P.maxAmount) != null, fe = (P == null ? void 0 : P.targetType) === "credit_grant" && (P == null ? void 0 : P.thresholdType) === "remaining_amount" ? P == null ? void 0 : P.threshold : null;
14207
14207
  return {
14208
14208
  thresholdInput: fe != null ? String(Math.round(Pn(fe))) : "",
14209
- chunkInput: (x == null ? void 0 : x.chunkSize) != null ? String(Math.round(Pn(x.chunkSize))) : "",
14210
- limitInput: (x == null ? void 0 : x.maxAmount) != null ? String(Math.round(Pn(x.maxAmount))) : "",
14209
+ chunkInput: (P == null ? void 0 : P.chunkSize) != null ? String(Math.round(Pn(P.chunkSize))) : "",
14210
+ limitInput: (P == null ? void 0 : P.maxAmount) != null ? String(Math.round(Pn(P.maxAmount))) : "",
14211
14211
  hasLimit: pe
14212
14212
  };
14213
- }, [x]), W = S ?? H, X = (pe) => T({ ...W, ...pe }), D = Number(W.thresholdInput), ue = Number(W.chunkInput), ee = Number(W.limitInput), ce = W.thresholdInput.trim() !== "" && Zr(D), M = Zr(ue), K = !W.hasLimit || W.limitInput.trim() !== "" && Uc(ee, ue), G = I && !ce, P = A && !M, be = E && !K, te = W.thresholdInput !== H.thresholdInput || W.chunkInput !== H.chunkInput || W.limitInput !== H.limitInput || W.hasLimit !== H.hasLimit, de = () => {
14213
+ }, [P]), W = S ?? H, X = (pe) => T({ ...W, ...pe }), D = Number(W.thresholdInput), ue = Number(W.chunkInput), ee = Number(W.limitInput), ce = W.thresholdInput.trim() !== "" && Zr(D), M = Zr(ue), K = !W.hasLimit || W.limitInput.trim() !== "" && Uc(ee, ue), G = I && !ce, x = A && !M, be = E && !K, te = W.thresholdInput !== H.thresholdInput || W.chunkInput !== H.chunkInput || W.limitInput !== H.limitInput || W.hasLimit !== H.hasLimit, de = () => {
14214
14214
  N.mutate(
14215
14215
  {
14216
14216
  settings: {
14217
14217
  [Vr]: {
14218
- enabled: (x == null ? void 0 : x.enabled) ?? !1,
14219
14218
  targetType: "credit_grant",
14220
14219
  thresholdType: "remaining_amount",
14221
14220
  threshold: Dn(D),
@@ -14309,7 +14308,7 @@ const nu = ({
14309
14308
  {
14310
14309
  className: j(
14311
14310
  "bpb-auto-recharge-dialog__panel",
14312
- P && "bpb-auto-recharge-dialog__panel--invalid"
14311
+ x && "bpb-auto-recharge-dialog__panel--invalid"
14313
14312
  ),
14314
14313
  children: [
14315
14314
  /* @__PURE__ */ l("label", { className: "bpb-auto-recharge-dialog__amount-label", htmlFor: "auto-recharge-chunk", children: s("autoRechargeChunkLabel") }),
@@ -14338,9 +14337,9 @@ const nu = ({
14338
14337
  {
14339
14338
  className: j(
14340
14339
  "bpb-auto-recharge-dialog__hint",
14341
- P && "bpb-auto-recharge-dialog__hint--error"
14340
+ x && "bpb-auto-recharge-dialog__hint--error"
14342
14341
  ),
14343
- children: s(P ? "autoRechargeChunkError" : "autoRechargeChunkHint")
14342
+ children: s(x ? "autoRechargeChunkError" : "autoRechargeChunkHint")
14344
14343
  }
14345
14344
  )
14346
14345
  ] }),
@@ -14412,7 +14411,7 @@ const nu = ({
14412
14411
  ] }) })
14413
14412
  }
14414
14413
  ),
14415
- !(x != null && x.enabled) && (x == null ? void 0 : x.disabledReason) && /* @__PURE__ */ l("p", { className: "bpb-auto-recharge-dialog__disabled-note", role: "alert", children: s("autoRechargeDisabledReason", { reason: x.disabledReason }) }),
14414
+ !(P != null && P.enabled) && (P == null ? void 0 : P.disabledReason) && /* @__PURE__ */ l("p", { className: "bpb-auto-recharge-dialog__disabled-note", role: "alert", children: s("autoRechargeDisabledReason", { reason: P.disabledReason }) }),
14416
14415
  /* @__PURE__ */ p("div", { className: "bpb-auto-recharge-dialog__actions", children: [
14417
14416
  /* @__PURE__ */ l(ke, { variant: "outline", onClick: () => t(!1), disabled: N.isPending, children: s("cancel") }),
14418
14417
  /* @__PURE__ */ l(