@schematichq/schematic-components 1.2.0 → 1.4.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.
@@ -573,10 +573,10 @@ var require_coreJsData = __commonJS({
573
573
  var require_isMasked = __commonJS({
574
574
  "node_modules/lodash/_isMasked.js"(exports, module) {
575
575
  var coreJsData = require_coreJsData();
576
- var maskSrcKey = function() {
576
+ var maskSrcKey = (function() {
577
577
  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
578
578
  return uid ? "Symbol(src)_1." + uid : "";
579
- }();
579
+ })();
580
580
  function isMasked(func) {
581
581
  return !!maskSrcKey && maskSrcKey in func;
582
582
  }
@@ -939,14 +939,14 @@ var require_Stack = __commonJS({
939
939
  var require_defineProperty = __commonJS({
940
940
  "node_modules/lodash/_defineProperty.js"(exports, module) {
941
941
  var getNative = require_getNative();
942
- var defineProperty = function() {
942
+ var defineProperty = (function() {
943
943
  try {
944
944
  var func = getNative(Object, "defineProperty");
945
945
  func({}, "", {});
946
946
  return func;
947
947
  } catch (e2) {
948
948
  }
949
- }();
949
+ })();
950
950
  module.exports = defineProperty;
951
951
  }
952
952
  });
@@ -1088,7 +1088,7 @@ var require_baseCreate = __commonJS({
1088
1088
  "node_modules/lodash/_baseCreate.js"(exports, module) {
1089
1089
  var isObject2 = require_isObject();
1090
1090
  var objectCreate = Object.create;
1091
- var baseCreate = /* @__PURE__ */ function() {
1091
+ var baseCreate = /* @__PURE__ */ (function() {
1092
1092
  function object() {
1093
1093
  }
1094
1094
  return function(proto) {
@@ -1103,7 +1103,7 @@ var require_baseCreate = __commonJS({
1103
1103
  object.prototype = void 0;
1104
1104
  return result;
1105
1105
  };
1106
- }();
1106
+ })();
1107
1107
  module.exports = baseCreate;
1108
1108
  }
1109
1109
  });
@@ -1175,9 +1175,9 @@ var require_isArguments = __commonJS({
1175
1175
  var objectProto = Object.prototype;
1176
1176
  var hasOwnProperty = objectProto.hasOwnProperty;
1177
1177
  var propertyIsEnumerable = objectProto.propertyIsEnumerable;
1178
- var isArguments = baseIsArguments(/* @__PURE__ */ function() {
1178
+ var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
1179
1179
  return arguments;
1180
- }()) ? baseIsArguments : function(value) {
1180
+ })()) ? baseIsArguments : function(value) {
1181
1181
  return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
1182
1182
  };
1183
1183
  module.exports = isArguments;
@@ -1339,7 +1339,7 @@ var require_nodeUtil = __commonJS({
1339
1339
  var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
1340
1340
  var moduleExports = freeModule && freeModule.exports === freeExports;
1341
1341
  var freeProcess = moduleExports && freeGlobal.process;
1342
- var nodeUtil = function() {
1342
+ var nodeUtil = (function() {
1343
1343
  try {
1344
1344
  var types = freeModule && freeModule.require && freeModule.require("util").types;
1345
1345
  if (types) {
@@ -1348,7 +1348,7 @@ var require_nodeUtil = __commonJS({
1348
1348
  return freeProcess && freeProcess.binding && freeProcess.binding("util");
1349
1349
  } catch (e2) {
1350
1350
  }
1351
- }();
1351
+ })();
1352
1352
  module.exports = nodeUtil;
1353
1353
  }
1354
1354
  });
@@ -1879,8 +1879,8 @@ function getPriceValue(billingPrice) {
1879
1879
  const price = typeof billingPrice.priceDecimal === "string" ? Number(billingPrice.priceDecimal) : billingPrice.price;
1880
1880
  return price;
1881
1881
  }
1882
- function getPlanPrice(plan, period = "month") {
1883
- const billingPrice = period === "year" ? plan.yearlyPrice : plan.monthlyPrice;
1882
+ function getPlanPrice(plan, period = "month", options2 = { useSelectedPeriod: true }) {
1883
+ const billingPrice = options2.useSelectedPeriod ? period === "year" ? plan.yearlyPrice : plan.monthlyPrice : plan.yearlyPrice && !plan.monthlyPrice ? plan.yearlyPrice : plan.monthlyPrice;
1884
1884
  if (billingPrice) {
1885
1885
  return { ...billingPrice, price: getPriceValue(billingPrice) };
1886
1886
  }
@@ -3547,7 +3547,7 @@ function he(t2) {
3547
3547
  for (var n = [], o2 = 1; o2 < arguments.length; o2++) n[o2 - 1] = arguments[o2];
3548
3548
  return false ? new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t2, " for more information.").concat(n.length > 0 ? " Args: ".concat(n.join(", ")) : "")) : new Error(de.apply(void 0, __spreadArray([pe[t2]], n, false)).trim());
3549
3549
  }
3550
- var fe = function() {
3550
+ var fe = (function() {
3551
3551
  function e2(e3) {
3552
3552
  this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e3;
3553
3553
  }
@@ -3573,7 +3573,7 @@ var fe = function() {
3573
3573
  for (var n = this.groupSizes[e3], o2 = this.indexOfGroup(e3), r2 = o2 + n, s2 = o2; s2 < r2; s2++) t2 += "".concat(this.tag.getRule(s2)).concat(g);
3574
3574
  return t2;
3575
3575
  }, e2;
3576
- }();
3576
+ })();
3577
3577
  var me = 1 << 30;
3578
3578
  var ye = /* @__PURE__ */ new Map();
3579
3579
  var ve = /* @__PURE__ */ new Map();
@@ -3615,24 +3615,24 @@ function Ce() {
3615
3615
  return "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : null;
3616
3616
  }
3617
3617
  var Ie = function(e2) {
3618
- var t2 = document.head, n = e2 || t2, o2 = document.createElement("style"), r2 = function(e3) {
3618
+ var t2 = document.head, n = e2 || t2, o2 = document.createElement("style"), r2 = (function(e3) {
3619
3619
  var t3 = Array.from(e3.querySelectorAll("style[".concat(f, "]")));
3620
3620
  return t3[t3.length - 1];
3621
- }(n), s2 = void 0 !== r2 ? r2.nextSibling : null;
3621
+ })(n), s2 = void 0 !== r2 ? r2.nextSibling : null;
3622
3622
  o2.setAttribute(f, m), o2.setAttribute(y, v);
3623
3623
  var i2 = Ce();
3624
3624
  return i2 && o2.setAttribute("nonce", i2), n.insertBefore(o2, s2), o2;
3625
3625
  };
3626
- var Ae = function() {
3626
+ var Ae = (function() {
3627
3627
  function e2(e3) {
3628
- this.element = Ie(e3), this.element.appendChild(document.createTextNode("")), this.sheet = function(e4) {
3628
+ this.element = Ie(e3), this.element.appendChild(document.createTextNode("")), this.sheet = (function(e4) {
3629
3629
  if (e4.sheet) return e4.sheet;
3630
3630
  for (var t2 = document.styleSheets, n = 0, o2 = t2.length; n < o2; n++) {
3631
3631
  var r2 = t2[n];
3632
3632
  if (r2.ownerNode === e4) return r2;
3633
3633
  }
3634
3634
  throw he(17);
3635
- }(this.element), this.length = 0;
3635
+ })(this.element), this.length = 0;
3636
3636
  }
3637
3637
  return e2.prototype.insertRule = function(e3, t2) {
3638
3638
  try {
@@ -3646,8 +3646,8 @@ var Ae = function() {
3646
3646
  var t2 = this.sheet.cssRules[e3];
3647
3647
  return t2 && t2.cssText ? t2.cssText : "";
3648
3648
  }, e2;
3649
- }();
3650
- var Oe = function() {
3649
+ })();
3650
+ var Oe = (function() {
3651
3651
  function e2(e3) {
3652
3652
  this.element = Ie(e3), this.nodes = this.element.childNodes, this.length = 0;
3653
3653
  }
@@ -3662,8 +3662,8 @@ var Oe = function() {
3662
3662
  }, e2.prototype.getRule = function(e3) {
3663
3663
  return e3 < this.length ? this.nodes[e3].textContent : "";
3664
3664
  }, e2;
3665
- }();
3666
- var De = function() {
3665
+ })();
3666
+ var De = (function() {
3667
3667
  function e2(e3) {
3668
3668
  this.rules = [], this.length = 0;
3669
3669
  }
@@ -3674,19 +3674,19 @@ var De = function() {
3674
3674
  }, e2.prototype.getRule = function(e3) {
3675
3675
  return e3 < this.length ? this.rules[e3] : "";
3676
3676
  }, e2;
3677
- }();
3677
+ })();
3678
3678
  var Re = S;
3679
3679
  var Te = { isServer: !S, useCSSOMInjection: !w };
3680
- var ke = function() {
3680
+ var ke = (function() {
3681
3681
  function e2(e3, n, o2) {
3682
3682
  void 0 === e3 && (e3 = C), void 0 === n && (n = {});
3683
3683
  var r2 = this;
3684
3684
  this.options = __assign(__assign({}, Te), e3), this.gs = n, this.names = new Map(o2), this.server = !!e3.isServer, !this.server && S && Re && (Re = false, _e(this)), ue(this, function() {
3685
- return function(e4) {
3685
+ return (function(e4) {
3686
3686
  for (var t2 = e4.getTag(), n2 = t2.length, o3 = "", r3 = function(n3) {
3687
- var r4 = function(e5) {
3687
+ var r4 = (function(e5) {
3688
3688
  return ve.get(e5);
3689
- }(n3);
3689
+ })(n3);
3690
3690
  if (void 0 === r4) return "continue";
3691
3691
  var s3 = e4.names.get(r4), i2 = t2.getGroup(n3);
3692
3692
  if (void 0 === s3 || !s3.size || 0 === i2.length) return "continue";
@@ -3696,7 +3696,7 @@ var ke = function() {
3696
3696
  }), o3 += "".concat(i2).concat(a2, '{content:"').concat(c2, '"}').concat(g);
3697
3697
  }, s2 = 0; s2 < n2; s2++) r3(s2);
3698
3698
  return o3;
3699
- }(r2);
3699
+ })(r2);
3700
3700
  });
3701
3701
  }
3702
3702
  return e2.registerId = function(e3) {
@@ -3708,10 +3708,10 @@ var ke = function() {
3708
3708
  }, e2.prototype.allocateGSInstance = function(e3) {
3709
3709
  return this.gs[e3] = (this.gs[e3] || 0) + 1;
3710
3710
  }, e2.prototype.getTag = function() {
3711
- return this.tag || (this.tag = (e3 = function(e4) {
3711
+ return this.tag || (this.tag = (e3 = (function(e4) {
3712
3712
  var t2 = e4.useCSSOMInjection, n = e4.target;
3713
3713
  return e4.isServer ? new De(n) : t2 ? new Ae(n) : new Oe(n);
3714
- }(this.options), new fe(e3)));
3714
+ })(this.options), new fe(e3)));
3715
3715
  var e3;
3716
3716
  }, e2.prototype.hasNameForId = function(e3, t2) {
3717
3717
  return this.names.has(e3) && this.names.get(e3).has(t2);
@@ -3730,7 +3730,7 @@ var ke = function() {
3730
3730
  }, e2.prototype.clearTag = function() {
3731
3731
  this.tag = void 0;
3732
3732
  }, e2;
3733
- }();
3733
+ })();
3734
3734
  var je = /&/g;
3735
3735
  var xe = /^\s*\/\/.*$/gm;
3736
3736
  function Ve(e2, t2) {
@@ -3783,7 +3783,7 @@ function Ye(e2) {
3783
3783
  }, [e2.shouldForwardProp, l2, u2]);
3784
3784
  return o.createElement($e.Provider, { value: d }, o.createElement(Le.Provider, { value: u2 }, e2.children));
3785
3785
  }
3786
- var We = function() {
3786
+ var We = (function() {
3787
3787
  function e2(e3, t2) {
3788
3788
  var n = this;
3789
3789
  this.inject = function(e4, t3) {
@@ -3797,7 +3797,7 @@ var We = function() {
3797
3797
  return e2.prototype.getName = function(e3) {
3798
3798
  return void 0 === e3 && (e3 = ze), this.name + e3.hash;
3799
3799
  }, e2;
3800
- }();
3800
+ })();
3801
3801
  var qe = function(e2) {
3802
3802
  return e2 >= "A" && e2 <= "Z";
3803
3803
  };
@@ -3841,7 +3841,7 @@ function Ze(e2) {
3841
3841
  return true;
3842
3842
  }
3843
3843
  var Ke = z(v);
3844
- var Qe = function() {
3844
+ var Qe = (function() {
3845
3845
  function e2(e3, t2, n) {
3846
3846
  this.rules = e3, this.staticRulesId = "", this.isStatic = false, this.componentId = t2, this.baseHash = M(Ke, t2), this.baseStyle = n, ke.registerId(t2);
3847
3847
  }
@@ -3872,12 +3872,12 @@ var Qe = function() {
3872
3872
  }
3873
3873
  return o2;
3874
3874
  }, e2;
3875
- }();
3875
+ })();
3876
3876
  var et = o.createContext(void 0);
3877
3877
  var tt = et.Consumer;
3878
3878
  function ot(e2) {
3879
3879
  var n = o.useContext(et), r2 = i(function() {
3880
- return function(e3, n2) {
3880
+ return (function(e3, n2) {
3881
3881
  if (!e3) throw he(14);
3882
3882
  if (re(e3)) {
3883
3883
  var o2 = e3(n2);
@@ -3886,21 +3886,21 @@ function ot(e2) {
3886
3886
  }
3887
3887
  if (Array.isArray(e3) || "object" != typeof e3) throw he(8);
3888
3888
  return n2 ? __assign(__assign({}, n2), e3) : e3;
3889
- }(e2.theme, n);
3889
+ })(e2.theme, n);
3890
3890
  }, [e2.theme, n]);
3891
3891
  return e2.children ? o.createElement(et.Provider, { value: r2 }, e2.children) : null;
3892
3892
  }
3893
3893
  var rt = {};
3894
3894
  var st = /* @__PURE__ */ new Set();
3895
3895
  function it(e2, r2, s2) {
3896
- var i2 = se(e2), a2 = e2, c2 = !L(e2), p2 = r2.attrs, d = void 0 === p2 ? _ : p2, h = r2.componentId, f2 = void 0 === h ? function(e3, t2) {
3896
+ var i2 = se(e2), a2 = e2, c2 = !L(e2), p2 = r2.attrs, d = void 0 === p2 ? _ : p2, h = r2.componentId, f2 = void 0 === h ? (function(e3, t2) {
3897
3897
  var n = "string" != typeof e3 ? "sc" : R(e3);
3898
3898
  rt[n] = (rt[n] || 0) + 1;
3899
3899
  var o2 = "".concat(n, "-").concat($(v + n + rt[n]));
3900
3900
  return t2 ? "".concat(t2, "-").concat(o2) : o2;
3901
- }(r2.displayName, r2.parentComponentId) : h, m2 = r2.displayName, y2 = void 0 === m2 ? function(e3) {
3901
+ })(r2.displayName, r2.parentComponentId) : h, m2 = r2.displayName, y2 = void 0 === m2 ? (function(e3) {
3902
3902
  return L(e3) ? "styled.".concat(e3) : "Styled(".concat(B(e3), ")");
3903
- }(e2) : m2, g2 = r2.displayName && r2.componentId ? "".concat(R(r2.displayName), "-").concat(r2.componentId) : r2.componentId || f2, S2 = i2 && a2.attrs ? a2.attrs.concat(d).filter(Boolean) : d, w2 = r2.shouldForwardProp;
3903
+ })(e2) : m2, g2 = r2.displayName && r2.componentId ? "".concat(R(r2.displayName), "-").concat(r2.componentId) : r2.componentId || f2, S2 = i2 && a2.attrs ? a2.attrs.concat(d).filter(Boolean) : d, w2 = r2.shouldForwardProp;
3904
3904
  if (i2 && a2.shouldForwardProp) {
3905
3905
  var b2 = a2.shouldForwardProp;
3906
3906
  if (r2.shouldForwardProp) {
@@ -3912,37 +3912,37 @@ function it(e2, r2, s2) {
3912
3912
  }
3913
3913
  var N2 = new Qe(s2, g2, i2 ? a2.componentStyle : void 0);
3914
3914
  function O2(e3, r3) {
3915
- return function(e4, r4, s3) {
3915
+ return (function(e4, r4, s3) {
3916
3916
  var i3 = e4.attrs, a3 = e4.componentStyle, c3 = e4.defaultProps, p3 = e4.foldedComponentIds, d2 = e4.styledComponentId, h2 = e4.target, f3 = o.useContext(et), m3 = Ge(), y3 = e4.shouldForwardProp || m3.shouldForwardProp;
3917
3917
  l(d2);
3918
- var v2 = I(r4, f3, c3) || C, g3 = function(e5, n, o2) {
3918
+ var v2 = I(r4, f3, c3) || C, g3 = (function(e5, n, o2) {
3919
3919
  for (var r5, s4 = __assign(__assign({}, n), { className: void 0, theme: o2 }), i4 = 0; i4 < e5.length; i4 += 1) {
3920
3920
  var a4 = re(r5 = e5[i4]) ? r5(s4) : r5;
3921
3921
  for (var c4 in a4) s4[c4] = "className" === c4 ? ie(s4[c4], a4[c4]) : "style" === c4 ? __assign(__assign({}, s4[c4]), a4[c4]) : a4[c4];
3922
3922
  }
3923
3923
  return n.className && (s4.className = ie(s4.className, n.className)), s4;
3924
- }(i3, r4, v2), S3 = g3.as || h2, w3 = {};
3924
+ })(i3, r4, v2), S3 = g3.as || h2, w3 = {};
3925
3925
  for (var b3 in g3) void 0 === g3[b3] || "$" === b3[0] || "as" === b3 || "theme" === b3 && g3.theme === v2 || ("forwardedAs" === b3 ? w3.as = g3.forwardedAs : y3 && !y3(b3, S3) || (w3[b3] = g3[b3], y3 || false || isPropValid(b3) || st.has(b3) || !A.has(S3) || (st.add(b3), console.warn('styled-components: it looks like an unknown prop "'.concat(b3, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
3926
- var E3 = function(e5, t2) {
3926
+ var E3 = (function(e5, t2) {
3927
3927
  var n = Ge(), o2 = e5.generateAndInjectStyles(t2, n.styleSheet, n.stylis);
3928
3928
  return l(o2), o2;
3929
- }(a3, g3);
3929
+ })(a3, g3);
3930
3930
  e4.warnTooManyClasses && e4.warnTooManyClasses(E3);
3931
3931
  var N3 = ie(p3, d2);
3932
3932
  return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[L(S3) && !A.has(S3) ? "class" : "className"] = N3, s3 && (w3.ref = s3), u(S3, w3);
3933
- }(D2, e3, r3);
3933
+ })(D2, e3, r3);
3934
3934
  }
3935
3935
  O2.displayName = y2;
3936
3936
  var D2 = o.forwardRef(O2);
3937
3937
  return D2.attrs = S2, D2.componentStyle = N2, D2.displayName = y2, D2.shouldForwardProp = w2, D2.foldedComponentIds = i2 ? ie(a2.foldedComponentIds, a2.styledComponentId) : "", D2.styledComponentId = g2, D2.target = i2 ? a2.target : e2, Object.defineProperty(D2, "defaultProps", { get: function() {
3938
3938
  return this._foldedDefaultProps;
3939
3939
  }, set: function(e3) {
3940
- this._foldedDefaultProps = i2 ? function(e4) {
3940
+ this._foldedDefaultProps = i2 ? (function(e4) {
3941
3941
  for (var t2 = [], n = 1; n < arguments.length; n++) t2[n - 1] = arguments[n];
3942
3942
  for (var o2 = 0, r3 = t2; o2 < r3.length; o2++) le(e4, r3[o2], true);
3943
3943
  return e4;
3944
- }({}, a2.defaultProps, e3) : e3;
3945
- } }), P(y2, g2), D2.warnTooManyClasses = /* @__PURE__ */ function(e3, t2) {
3944
+ })({}, a2.defaultProps, e3) : e3;
3945
+ } }), P(y2, g2), D2.warnTooManyClasses = /* @__PURE__ */ (function(e3, t2) {
3946
3946
  var n = {}, o2 = false;
3947
3947
  return function(r3) {
3948
3948
  if (!o2 && (n[r3] = true, Object.keys(n).length >= 200)) {
@@ -3950,7 +3950,7 @@ function it(e2, r2, s2) {
3950
3950
  console.warn("Over ".concat(200, " classes were generated for component ").concat(e3).concat(s3, ".\n") + "Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"), o2 = true, n = {};
3951
3951
  }
3952
3952
  };
3953
- }(y2, g2), ue(D2, function() {
3953
+ })(y2, g2), ue(D2, function() {
3954
3954
  return ".".concat(D2.styledComponentId);
3955
3955
  }), c2 && oe(D2, e2, { attrs: true, componentStyle: true, displayName: true, foldedComponentIds: true, shouldForwardProp: true, styledComponentId: true, target: true }), D2;
3956
3956
  }
@@ -3986,7 +3986,7 @@ var dt = pt;
3986
3986
  A.forEach(function(e2) {
3987
3987
  dt[e2] = pt(e2);
3988
3988
  });
3989
- var ht = function() {
3989
+ var ht = (function() {
3990
3990
  function e2(e3, t2) {
3991
3991
  this.rules = e3, this.componentId = t2, this.isStatic = Ze(e3), ke.registerId(this.componentId + 1);
3992
3992
  }
@@ -3998,7 +3998,7 @@ var ht = function() {
3998
3998
  }, e2.prototype.renderStyles = function(e3, t2, n, o2) {
3999
3999
  e3 > 2 && ke.registerId(this.componentId + e3), this.removeStyles(e3, n), this.createStyles(e3, t2, n, o2);
4000
4000
  }, e2;
4001
- }();
4001
+ })();
4002
4002
  function ft(n) {
4003
4003
  for (var r2 = [], s2 = 1; s2 < arguments.length; s2++) r2[s2 - 1] = arguments[s2];
4004
4004
  var i2 = lt.apply(void 0, __spreadArray([n], r2, false)), a2 = "sc-global-".concat($(JSON.stringify(i2))), c2 = new ht(i2, a2);
@@ -4028,7 +4028,7 @@ function mt(t2) {
4028
4028
  var r2 = ae(lt.apply(void 0, __spreadArray([t2], n, false))), s2 = $(r2);
4029
4029
  return new We(s2, r2);
4030
4030
  }
4031
- var vt = function() {
4031
+ var vt = (function() {
4032
4032
  function e2() {
4033
4033
  var e3 = this;
4034
4034
  this._emitSheetCSS = function() {
@@ -4056,7 +4056,7 @@ var vt = function() {
4056
4056
  }, e2.prototype.interleaveWithNodeStream = function(e3) {
4057
4057
  throw he(3);
4058
4058
  }, e2;
4059
- }();
4059
+ })();
4060
4060
  "undefined" != typeof navigator && "ReactNative" === navigator.product && console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");
4061
4061
  var St = "__sc-".concat(f, "__");
4062
4062
  "undefined" != typeof window && (window[St] || (window[St] = 0), 1 === window[St] && console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."), window[St] += 1);
@@ -4079,7 +4079,7 @@ attr.rem = function propAsRem(key, value) {
4079
4079
  };
4080
4080
 
4081
4081
  // src/hooks/useAvailablePlans.ts
4082
- function useAvailablePlans(activePeriod) {
4082
+ function useAvailablePlans(activePeriod, options2 = { useSelectedPeriod: true }) {
4083
4083
  const { data, settings } = useEmbed();
4084
4084
  const getAvailablePeriods = useCallback(() => {
4085
4085
  const periods = [];
@@ -4093,12 +4093,15 @@ function useAvailablePlans(activePeriod) {
4093
4093
  }, [data?.activePlans, data?.activeAddOns]);
4094
4094
  const getActivePlans = useCallback(
4095
4095
  (plans) => {
4096
- const activePlans = settings.mode === "edit" ? plans.slice() : plans.filter(
4097
- (plan) => activePeriod === "month" && plan.monthlyPrice || activePeriod === "year" && plan.yearlyPrice || plan.chargeType === ChargeType.oneTime
4098
- );
4096
+ const activePlans = settings.mode === "edit" ? plans.slice() : plans.filter((plan) => {
4097
+ if (options2.useSelectedPeriod) {
4098
+ return activePeriod === "month" && plan.monthlyPrice || activePeriod === "year" && plan.yearlyPrice || plan.chargeType === ChargeType.oneTime;
4099
+ }
4100
+ return plan.monthlyPrice || plan.yearlyPrice || plan.chargeType === ChargeType.oneTime;
4101
+ });
4099
4102
  return activePlans.map((plan) => ({ ...plan, isSelected: false }));
4100
4103
  },
4101
- [activePeriod, settings.mode]
4104
+ [activePeriod, options2.useSelectedPeriod, settings.mode]
4102
4105
  );
4103
4106
  return useMemo(() => {
4104
4107
  return {
@@ -4200,6 +4203,7 @@ var stub = () => {
4200
4203
  var initialContext = {
4201
4204
  ...initialState,
4202
4205
  hydratePublic: stub,
4206
+ hydrate: stub,
4203
4207
  hydrateComponent: stub,
4204
4208
  hydrateExternal: stub,
4205
4209
  getUpcomingInvoice: stub,
@@ -4648,6 +4652,26 @@ var postProcessor = {
4648
4652
  return value;
4649
4653
  }
4650
4654
  };
4655
+ var PATH_KEY = Symbol("i18next/PATH_KEY");
4656
+ function createProxy() {
4657
+ const state = [];
4658
+ const handler = /* @__PURE__ */ Object.create(null);
4659
+ let proxy;
4660
+ handler.get = (target, key) => {
4661
+ proxy?.revoke?.();
4662
+ if (key === PATH_KEY) return state;
4663
+ state.push(key);
4664
+ proxy = Proxy.revocable(target, handler);
4665
+ return proxy.proxy;
4666
+ };
4667
+ return Proxy.revocable(/* @__PURE__ */ Object.create(null), handler).proxy;
4668
+ }
4669
+ function keysFromSelector(selector, opts) {
4670
+ const {
4671
+ [PATH_KEY]: path
4672
+ } = selector(createProxy());
4673
+ return path.join(opts?.keySeparator ?? ".");
4674
+ }
4651
4675
  var checkedLoadedFor = {};
4652
4676
  var shouldHandleAsObject = (res) => !isString(res) && typeof res !== "boolean" && typeof res !== "number";
4653
4677
  var Translator = class _Translator extends EventEmitter {
@@ -4709,6 +4733,7 @@ var Translator = class _Translator extends EventEmitter {
4709
4733
  };
4710
4734
  if (!opt) opt = {};
4711
4735
  if (keys == null) return "";
4736
+ if (typeof keys === "function") keys = keysFromSelector(keys, opt);
4712
4737
  if (!Array.isArray(keys)) keys = [String(keys)];
4713
4738
  const returnDetails = opt.returnDetails !== void 0 ? opt.returnDetails : this.options.returnDetails;
4714
4739
  const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator;
@@ -4986,22 +5011,22 @@ var Translator = class _Translator extends EventEmitter {
4986
5011
  const zeroSuffix = `${this.options.pluralSeparator}zero`;
4987
5012
  const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
4988
5013
  if (needsPluralHandling) {
4989
- finalKeys.push(key + pluralSuffix);
4990
5014
  if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
4991
5015
  finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
4992
5016
  }
5017
+ finalKeys.push(key + pluralSuffix);
4993
5018
  if (needsZeroSuffixLookup) {
4994
5019
  finalKeys.push(key + zeroSuffix);
4995
5020
  }
4996
5021
  }
4997
5022
  if (needsContextHandling) {
4998
- const contextKey = `${key}${this.options.contextSeparator}${opt.context}`;
5023
+ const contextKey = `${key}${this.options.contextSeparator || "_"}${opt.context}`;
4999
5024
  finalKeys.push(contextKey);
5000
5025
  if (needsPluralHandling) {
5001
- finalKeys.push(contextKey + pluralSuffix);
5002
5026
  if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
5003
5027
  finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
5004
5028
  }
5029
+ finalKeys.push(contextKey + pluralSuffix);
5005
5030
  if (needsZeroSuffixLookup) {
5006
5031
  finalKeys.push(contextKey + zeroSuffix);
5007
5032
  }
@@ -5962,7 +5987,7 @@ var I18n = class _I18n extends EventEmitter {
5962
5987
  });
5963
5988
  const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
5964
5989
  if (usingLegacyFormatFunction) {
5965
- this.logger.warn(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
5990
+ this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
5966
5991
  }
5967
5992
  if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
5968
5993
  s2.formatter = createClassOnDemand(formatter);
@@ -6657,6 +6682,7 @@ var en_default = {
6657
6682
  "Add new payment method": "Add new payment method",
6658
6683
  "Add Seats": "Add More",
6659
6684
  "Add-ons": "Add-ons",
6685
+ "Add-ons Quantity": "Add-ons Quantity",
6660
6686
  Additional: "Additional",
6661
6687
  "After the trial, cancel no default": "After the trial, you will be lose access to {{planName}} plan and your subscription will be cancelled.",
6662
6688
  "After the trial, cancel": "After the trial, you will be downgraded to the {{defaultPlanName}} plan and your subscription will be cancelled.",
@@ -6727,6 +6753,7 @@ var en_default = {
6727
6753
  "Powered by": "Powered by",
6728
6754
  "Price by unit based on final tier reached.": "Price by unit based on final tier reached.",
6729
6755
  Proration: "Proration",
6756
+ "Quantity to pay for in advance": "Quantity to pay for in advance",
6730
6757
  "Remove add-on": "Remove add-on",
6731
6758
  Resets: "Resets {{date}}",
6732
6759
  "Save payment method": "Save payment method",
@@ -6741,6 +6768,7 @@ var en_default = {
6741
6768
  "Select payment method": "Select payment method",
6742
6769
  "Select plan": "Select plan",
6743
6770
  "Select quantity": "Select quantity",
6771
+ "Select quantities for add-ons": "Select quantities for add-ons",
6744
6772
  Selected: "Selected",
6745
6773
  "Selected plan or associated price is missing.": "Selected plan or associated price is missing.",
6746
6774
  "Session expired. Please refresh and try again.": "Session expired. Please refresh and try again.",
@@ -7787,6 +7815,33 @@ function CheckoutUnsubscribeResponseFromJSONTyped(json, ignoreDiscriminator) {
7787
7815
  };
7788
7816
  }
7789
7817
 
7818
+ // src/api/checkoutexternal/models/CurrencyBalance.ts
7819
+ function CurrencyBalanceFromJSON(json) {
7820
+ return CurrencyBalanceFromJSONTyped(json, false);
7821
+ }
7822
+ function CurrencyBalanceFromJSONTyped(json, ignoreDiscriminator) {
7823
+ if (json == null) {
7824
+ return json;
7825
+ }
7826
+ return {
7827
+ balance: json["balance"],
7828
+ currency: json["currency"]
7829
+ };
7830
+ }
7831
+
7832
+ // src/api/checkoutexternal/models/CompanyCustomerBalance.ts
7833
+ function CompanyCustomerBalanceFromJSON(json) {
7834
+ return CompanyCustomerBalanceFromJSONTyped(json, false);
7835
+ }
7836
+ function CompanyCustomerBalanceFromJSONTyped(json, ignoreDiscriminator) {
7837
+ if (json == null) {
7838
+ return json;
7839
+ }
7840
+ return {
7841
+ balances: json["balances"].map(CurrencyBalanceFromJSON)
7842
+ };
7843
+ }
7844
+
7790
7845
  // src/api/checkoutexternal/models/CompanyEventPeriodMetricsResponseData.ts
7791
7846
  function CompanyEventPeriodMetricsResponseDataFromJSON(json) {
7792
7847
  return CompanyEventPeriodMetricsResponseDataFromJSONTyped(json, false);
@@ -8047,12 +8102,12 @@ function EventSummaryResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8047
8102
  return json;
8048
8103
  }
8049
8104
  return {
8050
- companyCount: json["company_count"] == null ? void 0 : json["company_count"],
8105
+ companyCount: json["company_count"],
8051
8106
  environmentId: json["environment_id"],
8052
8107
  eventCount: json["event_count"],
8053
8108
  eventSubtype: json["event_subtype"],
8054
8109
  lastSeenAt: json["last_seen_at"] == null ? void 0 : new Date(json["last_seen_at"]),
8055
- userCount: json["user_count"] == null ? void 0 : json["user_count"]
8110
+ userCount: json["user_count"]
8056
8111
  };
8057
8112
  }
8058
8113
 
@@ -8617,6 +8672,7 @@ function ComponentHydrateResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8617
8672
  ),
8618
8673
  defaultPlan: json["default_plan"] == null ? void 0 : PlanDetailResponseDataFromJSON(json["default_plan"]),
8619
8674
  featureUsage: json["feature_usage"] == null ? void 0 : FeatureUsageDetailResponseDataFromJSON(json["feature_usage"]),
8675
+ showPeriodToggle: json["show_period_toggle"],
8620
8676
  stripeEmbed: json["stripe_embed"] == null ? void 0 : StripeEmbedInfoFromJSON(json["stripe_embed"]),
8621
8677
  subscription: json["subscription"] == null ? void 0 : CompanySubscriptionResponseDataFromJSON(json["subscription"]),
8622
8678
  trialPaymentMethodRequired: json["trial_payment_method_required"] == null ? void 0 : json["trial_payment_method_required"],
@@ -8668,6 +8724,20 @@ function DeletePaymentMethodResponseFromJSONTyped(json, ignoreDiscriminator) {
8668
8724
  };
8669
8725
  }
8670
8726
 
8727
+ // src/api/checkoutexternal/models/FetchCustomerBalanceResponse.ts
8728
+ function FetchCustomerBalanceResponseFromJSON(json) {
8729
+ return FetchCustomerBalanceResponseFromJSONTyped(json, false);
8730
+ }
8731
+ function FetchCustomerBalanceResponseFromJSONTyped(json, ignoreDiscriminator) {
8732
+ if (json == null) {
8733
+ return json;
8734
+ }
8735
+ return {
8736
+ data: CompanyCustomerBalanceFromJSON(json["data"]),
8737
+ params: json["params"]
8738
+ };
8739
+ }
8740
+
8671
8741
  // src/api/checkoutexternal/models/GetSetupIntentResponse.ts
8672
8742
  function GetSetupIntentResponseFromJSON(json) {
8673
8743
  return GetSetupIntentResponseFromJSONTyped(json, false);
@@ -8696,6 +8766,20 @@ function HydrateComponentResponseFromJSONTyped(json, ignoreDiscriminator) {
8696
8766
  };
8697
8767
  }
8698
8768
 
8769
+ // src/api/checkoutexternal/models/HydrateResponse.ts
8770
+ function HydrateResponseFromJSON(json) {
8771
+ return HydrateResponseFromJSONTyped(json, false);
8772
+ }
8773
+ function HydrateResponseFromJSONTyped(json, ignoreDiscriminator) {
8774
+ if (json == null) {
8775
+ return json;
8776
+ }
8777
+ return {
8778
+ data: ComponentHydrateResponseDataFromJSON(json["data"]),
8779
+ params: json["params"]
8780
+ };
8781
+ }
8782
+
8699
8783
  // src/api/checkoutexternal/models/HydrateUpcomingInvoiceResponse.ts
8700
8784
  function HydrateUpcomingInvoiceResponseFromJSON(json) {
8701
8785
  return HydrateUpcomingInvoiceResponseFromJSONTyped(json, false);
@@ -8991,6 +9075,38 @@ var CheckoutexternalApi = class extends BaseAPI {
8991
9075
  );
8992
9076
  return await response.value();
8993
9077
  }
9078
+ /**
9079
+ * Fetch customer balance
9080
+ */
9081
+ async fetchCustomerBalanceRaw(initOverrides) {
9082
+ const queryParameters = {};
9083
+ const headerParameters = {};
9084
+ if (this.configuration && this.configuration.apiKey) {
9085
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
9086
+ "X-Schematic-Api-Key"
9087
+ );
9088
+ }
9089
+ const response = await this.request(
9090
+ {
9091
+ path: `/checkout/balance`,
9092
+ method: "GET",
9093
+ headers: headerParameters,
9094
+ query: queryParameters
9095
+ },
9096
+ initOverrides
9097
+ );
9098
+ return new JSONApiResponse(
9099
+ response,
9100
+ (jsonValue) => FetchCustomerBalanceResponseFromJSON(jsonValue)
9101
+ );
9102
+ }
9103
+ /**
9104
+ * Fetch customer balance
9105
+ */
9106
+ async fetchCustomerBalance(initOverrides) {
9107
+ const response = await this.fetchCustomerBalanceRaw(initOverrides);
9108
+ return await response.value();
9109
+ }
8994
9110
  /**
8995
9111
  * Get setup intent
8996
9112
  */
@@ -9035,6 +9151,38 @@ var CheckoutexternalApi = class extends BaseAPI {
9035
9151
  );
9036
9152
  return await response.value();
9037
9153
  }
9154
+ /**
9155
+ * Hydrate
9156
+ */
9157
+ async hydrateRaw(initOverrides) {
9158
+ const queryParameters = {};
9159
+ const headerParameters = {};
9160
+ if (this.configuration && this.configuration.apiKey) {
9161
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
9162
+ "X-Schematic-Api-Key"
9163
+ );
9164
+ }
9165
+ const response = await this.request(
9166
+ {
9167
+ path: `/components/hydrate`,
9168
+ method: "GET",
9169
+ headers: headerParameters,
9170
+ query: queryParameters
9171
+ },
9172
+ initOverrides
9173
+ );
9174
+ return new JSONApiResponse(
9175
+ response,
9176
+ (jsonValue) => HydrateResponseFromJSON(jsonValue)
9177
+ );
9178
+ }
9179
+ /**
9180
+ * Hydrate
9181
+ */
9182
+ async hydrate(initOverrides) {
9183
+ const response = await this.hydrateRaw(initOverrides);
9184
+ return await response.value();
9185
+ }
9038
9186
  /**
9039
9187
  * Hydrate component
9040
9188
  */
@@ -9725,12 +9873,12 @@ function EventSummaryResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
9725
9873
  return json;
9726
9874
  }
9727
9875
  return {
9728
- companyCount: json["company_count"] == null ? void 0 : json["company_count"],
9876
+ companyCount: json["company_count"],
9729
9877
  environmentId: json["environment_id"],
9730
9878
  eventCount: json["event_count"],
9731
9879
  eventSubtype: json["event_subtype"],
9732
9880
  lastSeenAt: json["last_seen_at"] == null ? void 0 : new Date(json["last_seen_at"]),
9733
- userCount: json["user_count"] == null ? void 0 : json["user_count"]
9881
+ userCount: json["user_count"]
9734
9882
  };
9735
9883
  }
9736
9884
 
@@ -9931,6 +10079,32 @@ function FeatureDetailResponseDataFromJSONTyped6(json, ignoreDiscriminator) {
9931
10079
  };
9932
10080
  }
9933
10081
 
10082
+ // src/api/componentspublic/models/PlanCreditGrantView.ts
10083
+ function PlanCreditGrantViewFromJSON2(json) {
10084
+ return PlanCreditGrantViewFromJSONTyped3(json, false);
10085
+ }
10086
+ function PlanCreditGrantViewFromJSONTyped3(json, ignoreDiscriminator) {
10087
+ if (json == null) {
10088
+ return json;
10089
+ }
10090
+ return {
10091
+ createdAt: new Date(json["created_at"]),
10092
+ creditAmount: json["credit_amount"],
10093
+ creditDescription: json["credit_description"],
10094
+ creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
10095
+ creditId: json["credit_id"],
10096
+ creditName: json["credit_name"],
10097
+ id: json["id"],
10098
+ planId: json["plan_id"],
10099
+ planName: json["plan_name"],
10100
+ pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
10101
+ resetCadence: json["reset_cadence"],
10102
+ resetStart: json["reset_start"],
10103
+ singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
10104
+ updatedAt: new Date(json["updated_at"])
10105
+ };
10106
+ }
10107
+
9934
10108
  // src/api/componentspublic/models/PlanResponseData.ts
9935
10109
  function PlanResponseDataFromJSON2(json) {
9936
10110
  return PlanResponseDataFromJSONTyped4(json, false);
@@ -10014,6 +10188,9 @@ function PlanViewPublicResponseDataFromJSONTyped(json, ignoreDiscriminator) {
10014
10188
  ),
10015
10189
  icon: json["icon"],
10016
10190
  id: json["id"],
10191
+ includedCreditGrants: json["included_credit_grants"].map(
10192
+ PlanCreditGrantViewFromJSON2
10193
+ ),
10017
10194
  isCustom: json["is_custom"],
10018
10195
  isDefault: json["is_default"],
10019
10196
  isFree: json["is_free"],
@@ -10125,6 +10302,7 @@ var reducer = (state, action) => {
10125
10302
  };
10126
10303
  }
10127
10304
  case "HYDRATE_PUBLIC":
10305
+ case "HYDRATE":
10128
10306
  case "HYDRATE_COMPONENT":
10129
10307
  case "HYDRATE_EXTERNAL": {
10130
10308
  return {
@@ -10243,7 +10421,7 @@ var EmbedProvider = ({
10243
10421
  });
10244
10422
  const customHeaders = useMemo3(
10245
10423
  () => ({
10246
- "X-Schematic-Components-Version": "1.2.0",
10424
+ "X-Schematic-Components-Version": "1.4.0",
10247
10425
  "X-Schematic-Session-ID": sessionIdRef.current
10248
10426
  }),
10249
10427
  []
@@ -10279,6 +10457,28 @@ var EmbedProvider = ({
10279
10457
  () => (0, import_debounce.default)(hydratePublic, FETCH_DEBOUNCE_TIMEOUT, debounceOptions),
10280
10458
  [hydratePublic]
10281
10459
  );
10460
+ const hydrate = useCallback3(async () => {
10461
+ dispatch({ type: "HYDRATE_STARTED" });
10462
+ try {
10463
+ const response = await api.checkout?.hydrate();
10464
+ if (response) {
10465
+ dispatch({
10466
+ type: "HYDRATE",
10467
+ data: response.data
10468
+ });
10469
+ }
10470
+ return response?.data;
10471
+ } catch (err2) {
10472
+ dispatch({
10473
+ type: "ERROR",
10474
+ error: isError(err2) ? err2 : ERROR_UNKNOWN
10475
+ });
10476
+ }
10477
+ }, [api.checkout]);
10478
+ const debouncedHydrate = useMemo3(
10479
+ () => (0, import_debounce.default)(hydrate, FETCH_DEBOUNCE_TIMEOUT, debounceOptions),
10480
+ [hydrate]
10481
+ );
10282
10482
  const hydrateComponent = useCallback3(
10283
10483
  async (id) => {
10284
10484
  dispatch({ type: "HYDRATE_STARTED" });
@@ -10561,6 +10761,7 @@ var EmbedProvider = ({
10561
10761
  layout: state.layout,
10562
10762
  checkoutState: state.checkoutState,
10563
10763
  hydratePublic: debouncedHydratePublic,
10764
+ hydrate: debouncedHydrate,
10564
10765
  hydrateComponent: debouncedHydrateComponent,
10565
10766
  hydrateExternal: debouncedHydrateExternal,
10566
10767
  createSetupIntent: debouncedCreateSetupIntent,
@@ -12097,6 +12298,47 @@ var StageButton = ({
12097
12298
  );
12098
12299
  }
12099
12300
  if (checkoutStage === "addons") {
12301
+ const hasAddonsUsageStage = checkoutStages?.some(
12302
+ (stage) => stage.id === "addonsUsage"
12303
+ );
12304
+ const hasCreditsStage = checkoutStages?.some(
12305
+ (stage) => stage.id === "credits"
12306
+ );
12307
+ if (!isPaymentMethodRequired && !hasAddonsUsageStage && !hasCreditsStage) {
12308
+ return /* @__PURE__ */ jsx12(NoPaymentRequired, {});
12309
+ }
12310
+ return /* @__PURE__ */ jsx12(
12311
+ Button,
12312
+ {
12313
+ type: "button",
12314
+ disabled: isDisabled,
12315
+ onClick: async () => {
12316
+ setCheckoutStage?.(
12317
+ hasAddonsUsageStage ? "addonsUsage" : hasCreditsStage ? "credits" : "checkout"
12318
+ );
12319
+ },
12320
+ $isLoading: isLoading,
12321
+ $fullWidth: true,
12322
+ children: /* @__PURE__ */ jsxs8(
12323
+ Flex,
12324
+ {
12325
+ $gap: "0.5rem",
12326
+ $justifyContent: "center",
12327
+ $alignItems: "center",
12328
+ $padding: "0 1rem",
12329
+ children: [
12330
+ t2("Next"),
12331
+ ":",
12332
+ " ",
12333
+ hasAddonsUsageStage ? t2("Add-ons Quantity") : hasCreditsStage ? t2("Credits") : t2("Checkout"),
12334
+ /* @__PURE__ */ jsx12(Icon3, { name: "arrow-right" })
12335
+ ]
12336
+ }
12337
+ )
12338
+ }
12339
+ );
12340
+ }
12341
+ if (checkoutStage === "addonsUsage") {
12100
12342
  if (!isPaymentMethodRequired && !checkoutStages?.some((stage) => stage.id === "credits")) {
12101
12343
  return /* @__PURE__ */ jsx12(NoPaymentRequired, {});
12102
12344
  }
@@ -12992,6 +13234,22 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
12992
13234
  const { price, currency } = getAddOnPrice(addOn, period) || {};
12993
13235
  const isAddOnValid = isHydratedPlan(addOn) && addOn.valid;
12994
13236
  const isAddOnCurrent = isHydratedPlan(addOn) && addOn.current;
13237
+ const overageEntitlement = addOn.entitlements?.find(
13238
+ (entitlement) => entitlement.priceBehavior === "overage" /* Overage */
13239
+ );
13240
+ let overageInfo = null;
13241
+ if (overageEntitlement) {
13242
+ const priceData = period === "year" ? overageEntitlement.meteredYearlyPrice : overageEntitlement.meteredMonthlyPrice;
13243
+ if (priceData?.priceTier && priceData.priceTier.length >= 2) {
13244
+ const overageTier = priceData.priceTier[priceData.priceTier.length - 1];
13245
+ overageInfo = {
13246
+ softLimit: overageEntitlement.softLimit,
13247
+ perUnitPrice: overageTier.perUnitPriceDecimal ? Number(overageTier.perUnitPriceDecimal) : overageTier.perUnitPrice || 0,
13248
+ currency: priceData.currency || currency,
13249
+ featureName: overageEntitlement.feature?.name
13250
+ };
13251
+ }
13252
+ }
12995
13253
  return /* @__PURE__ */ jsxs10(
12996
13254
  Flex,
12997
13255
  {
@@ -13011,19 +13269,34 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13011
13269
  /* @__PURE__ */ jsxs10(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
13012
13270
  /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { display: "heading3", children: addOn.name }) }),
13013
13271
  addOn.description && /* @__PURE__ */ jsx14(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx14(Text, { children: addOn.description }) }),
13014
- (addOn[periodKey] || addOn.chargeType === ChargeType.oneTime) && /* @__PURE__ */ jsxs10(Box, { children: [
13015
- /* @__PURE__ */ jsx14(Text, { display: "heading2", children: formatCurrency(price ?? 0, currency) }),
13016
- /* @__PURE__ */ jsx14(
13017
- Text,
13018
- {
13019
- display: "heading2",
13020
- $size: 16 / 30 * settings.theme.typography.heading2.fontSize,
13021
- children: addOn.chargeType === ChargeType.oneTime ? /* @__PURE__ */ jsxs10(Fragment5, { children: [
13022
- " ",
13023
- t2("one time")
13024
- ] }) : `/${period}`
13025
- }
13026
- )
13272
+ (addOn[periodKey] || addOn.chargeType === ChargeType.oneTime) && /* @__PURE__ */ jsxs10(Flex, { $flexDirection: "column", $gap: "0.25rem", children: [
13273
+ /* @__PURE__ */ jsxs10(Box, { children: [
13274
+ /* @__PURE__ */ jsx14(Text, { display: "heading2", children: formatCurrency(price ?? 0, currency) }),
13275
+ /* @__PURE__ */ jsx14(
13276
+ Text,
13277
+ {
13278
+ display: "heading2",
13279
+ $size: 16 / 30 * settings.theme.typography.heading2.fontSize,
13280
+ children: addOn.chargeType === ChargeType.oneTime ? /* @__PURE__ */ jsxs10(Fragment5, { children: [
13281
+ " ",
13282
+ t2("one time")
13283
+ ] }) : `/${period}`
13284
+ }
13285
+ )
13286
+ ] }),
13287
+ overageInfo && overageInfo.softLimit && /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsxs10(Text, { $size: 0.875, style: { opacity: 0.8 }, children: [
13288
+ overageInfo.softLimit,
13289
+ " ",
13290
+ overageInfo.featureName || "units",
13291
+ " included, then",
13292
+ " ",
13293
+ formatCurrency(
13294
+ overageInfo.perUnitPrice,
13295
+ overageInfo.currency
13296
+ ),
13297
+ "/",
13298
+ overageInfo.featureName?.toLowerCase() || "unit"
13299
+ ] }) })
13027
13300
  ] }),
13028
13301
  isAddOnCurrent && /* @__PURE__ */ jsx14(
13029
13302
  Flex,
@@ -13444,7 +13717,8 @@ var Plan = ({
13444
13717
  selectedPlan,
13445
13718
  period,
13446
13719
  selectPlan,
13447
- shouldTrial
13720
+ shouldTrial,
13721
+ showPeriodToggle
13448
13722
  }) => {
13449
13723
  const { t: t2 } = useTranslation();
13450
13724
  const { data, settings } = useEmbed();
@@ -13483,8 +13757,9 @@ var Plan = ({
13483
13757
  $gap: "1rem",
13484
13758
  $flexGrow: 1,
13485
13759
  children: plans.map((plan, planIndex) => {
13486
- const { price: planPrice, currency: planCurrency } = getPlanPrice(plan, period) || {};
13487
- const credits = isHydratedPlan(plan) ? groupPlanCreditGrants(plan.includedCreditGrants) : [];
13760
+ const planPeriod = showPeriodToggle ? period : plan.yearlyPrice && !plan.monthlyPrice ? "year" /* Year */ : "month" /* Month */;
13761
+ const { price: planPrice, currency: planCurrency } = getPlanPrice(plan, planPeriod) || {};
13762
+ const credits = groupPlanCreditGrants(plan.includedCreditGrants);
13488
13763
  const hasUsageBasedEntitlements = plan.entitlements.some(
13489
13764
  (entitlement) => !!entitlement.priceBehavior
13490
13765
  );
@@ -13543,7 +13818,7 @@ var Plan = ({
13543
13818
  $size: 16 / 30 * settings.theme.typography.heading2.fontSize,
13544
13819
  children: [
13545
13820
  "/",
13546
- period
13821
+ planPeriod
13547
13822
  ]
13548
13823
  }
13549
13824
  )
@@ -13639,7 +13914,7 @@ var Plan = ({
13639
13914
  priceTier: entitlementPriceTiers,
13640
13915
  currency: entitlementCurrency,
13641
13916
  packageSize: entitlementPackageSize = 1
13642
- } = getEntitlementPrice(entitlement, period) || {};
13917
+ } = getEntitlementPrice(entitlement, planPeriod) || {};
13643
13918
  const metricPeriodName = getMetricPeriodName(entitlement);
13644
13919
  return /* @__PURE__ */ jsx18(
13645
13920
  Flex,
@@ -13685,13 +13960,13 @@ var Plan = ({
13685
13960
  " ",
13686
13961
  t2("per"),
13687
13962
  " ",
13688
- period
13963
+ planPeriod
13689
13964
  ] })
13690
13965
  ] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */ jsx18(
13691
13966
  TieredPricingDetails,
13692
13967
  {
13693
13968
  entitlement,
13694
- period
13969
+ period: planPeriod
13695
13970
  }
13696
13971
  ) : entitlement.priceBehavior === "credit_burndown" /* Credit */ && entitlement.valueCredit ? /* @__PURE__ */ jsxs14(Fragment8, { children: [
13697
13972
  entitlement.consumptionRate,
@@ -13748,7 +14023,7 @@ var Plan = ({
13748
14023
  ),
13749
14024
  entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs14(Fragment8, { children: [
13750
14025
  "/",
13751
- shortenPeriod(period)
14026
+ shortenPeriod(planPeriod)
13752
14027
  ] })
13753
14028
  ]
13754
14029
  }
@@ -13757,7 +14032,7 @@ var Plan = ({
13757
14032
  PricingTiersTooltip,
13758
14033
  {
13759
14034
  feature: entitlement.feature,
13760
- period,
14035
+ period: planPeriod,
13761
14036
  currency: entitlementCurrency,
13762
14037
  priceTiers: entitlementPriceTiers
13763
14038
  }
@@ -14014,26 +14289,32 @@ var CheckoutDialog = ({ top = 0 }) => {
14014
14289
  addOns: availableAddOns,
14015
14290
  periods: availablePeriods
14016
14291
  } = useAvailablePlans(planPeriod);
14017
- const { currentPlanId, currentEntitlements, trialPaymentMethodRequired } = useMemo9(() => {
14292
+ const {
14293
+ currentPlanId,
14294
+ currentEntitlements,
14295
+ showPeriodToggle,
14296
+ trialPaymentMethodRequired
14297
+ } = useMemo9(() => {
14018
14298
  if (isCheckoutData(data)) {
14019
14299
  return {
14020
14300
  currentPlanId: data.company?.plan?.id,
14021
14301
  currentEntitlements: data.featureUsage ? data.featureUsage.features : [],
14302
+ showPeriodToggle: data.showPeriodToggle,
14022
14303
  trialPaymentMethodRequired: data.trialPaymentMethodRequired === true
14023
14304
  };
14024
14305
  }
14025
14306
  return {
14026
14307
  currentPlanId: void 0,
14027
14308
  currentEntitlements: [],
14309
+ showPeriodToggle: true,
14028
14310
  trialPaymentMethodRequired: false
14029
14311
  };
14030
14312
  }, [data]);
14031
14313
  const [selectedPlan, setSelectedPlan] = useState9(
14032
14314
  () => {
14033
- const currentSelectedPlan = availablePlans.find(
14315
+ return availablePlans.find(
14034
14316
  (plan) => checkoutState?.planId ? plan.id === checkoutState.planId : isHydratedPlan(plan) && plan.current
14035
14317
  );
14036
- return currentSelectedPlan;
14037
14318
  }
14038
14319
  );
14039
14320
  const [shouldTrial, setShouldTrial] = useState9(false);
@@ -14066,6 +14347,23 @@ var CheckoutDialog = ({ top = 0 }) => {
14066
14347
  []
14067
14348
  )
14068
14349
  );
14350
+ const [addOnUsageBasedEntitlements, setAddOnUsageBasedEntitlements] = useState9(() => {
14351
+ if (!isCheckoutData(data)) return [];
14352
+ const currentAddOns = data.company?.addOns || [];
14353
+ return currentAddOns.flatMap((currentAddOn) => {
14354
+ const availableAddOn = availableAddOns.find(
14355
+ (available) => available.id === currentAddOn.id
14356
+ );
14357
+ if (!availableAddOn) return [];
14358
+ return availableAddOn.entitlements.reduce(
14359
+ createActiveUsageBasedEntitlementsReducer(
14360
+ currentEntitlements,
14361
+ planPeriod
14362
+ ),
14363
+ []
14364
+ );
14365
+ });
14366
+ });
14069
14367
  const payInAdvanceEntitlements = useMemo9(
14070
14368
  () => usageBasedEntitlements.filter(
14071
14369
  (entitlement) => entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */
@@ -14106,6 +14404,19 @@ var CheckoutDialog = ({ top = 0 }) => {
14106
14404
  description: t2("Optionally add features to your subscription")
14107
14405
  });
14108
14406
  }
14407
+ const hasUsageBasedAddOnSelected = addOns.some((addOn) => {
14408
+ return addOn.isSelected && addOn.entitlements.some((entitlement) => {
14409
+ return entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */;
14410
+ });
14411
+ });
14412
+ if (hasUsageBasedAddOnSelected) {
14413
+ stages.push({
14414
+ id: "addonsUsage",
14415
+ name: t2("Add-ons Quantity"),
14416
+ label: t2("Select quantities for add-ons"),
14417
+ description: t2("Quantity to pay for in advance")
14418
+ });
14419
+ }
14109
14420
  if (creditBundles.length > 0) {
14110
14421
  stages.push({
14111
14422
  id: "credits",
@@ -14137,6 +14448,9 @@ var CheckoutDialog = ({ top = 0 }) => {
14137
14448
  if (checkoutState?.addOnId) {
14138
14449
  return "addons";
14139
14450
  }
14451
+ if (checkoutState?.addOnUsage) {
14452
+ return "addonsUsage";
14453
+ }
14140
14454
  if (checkoutState?.usage) {
14141
14455
  return "usage";
14142
14456
  }
@@ -14144,7 +14458,19 @@ var CheckoutDialog = ({ top = 0 }) => {
14144
14458
  return "credits";
14145
14459
  }
14146
14460
  if (checkoutState?.planId !== currentPlanId) {
14147
- return checkoutStages.some((stage) => stage.id === "usage") ? "usage" : checkoutStages.some((stage) => stage.id === "addons") ? "addons" : checkoutStages.some((stage) => stage.id === "credits") ? "credits" : "plan";
14461
+ const hasUsageStage = checkoutStages.some(
14462
+ (stage) => stage.id === "usage"
14463
+ );
14464
+ const hasAddonsStage = checkoutStages.some(
14465
+ (stage) => stage.id === "addons"
14466
+ );
14467
+ const hasAddonsUsageStage = checkoutStages.some(
14468
+ (stage) => stage.id === "addonsUsage"
14469
+ );
14470
+ if (hasUsageStage) return "usage";
14471
+ if (hasAddonsStage) return "addons";
14472
+ if (hasAddonsUsageStage) return "addonsUsage";
14473
+ return "plan";
14148
14474
  }
14149
14475
  return "plan";
14150
14476
  });
@@ -14181,19 +14507,34 @@ var CheckoutDialog = ({ top = 0 }) => {
14181
14507
  },
14182
14508
  []
14183
14509
  ),
14184
- payInAdvance: (updates.payInAdvanceEntitlements || payInAdvanceEntitlements).reduce(
14185
- (acc, { meteredMonthlyPrice, meteredYearlyPrice, quantity }) => {
14186
- const priceId = (period === "year" ? meteredYearlyPrice : meteredMonthlyPrice)?.priceId;
14187
- if (priceId) {
14188
- acc.push({
14189
- priceId,
14190
- quantity
14191
- });
14192
- }
14193
- return acc;
14194
- },
14195
- []
14196
- ),
14510
+ payInAdvance: [
14511
+ ...(updates.payInAdvanceEntitlements || payInAdvanceEntitlements).reduce(
14512
+ (acc, { meteredMonthlyPrice, meteredYearlyPrice, quantity }) => {
14513
+ const priceId = (period === "year" ? meteredYearlyPrice : meteredMonthlyPrice)?.priceId;
14514
+ if (priceId) {
14515
+ acc.push({
14516
+ priceId,
14517
+ quantity
14518
+ });
14519
+ }
14520
+ return acc;
14521
+ },
14522
+ []
14523
+ ),
14524
+ ...(updates.addOnPayInAdvanceEntitlements || addOnUsageBasedEntitlements).reduce(
14525
+ (acc, { meteredMonthlyPrice, meteredYearlyPrice, quantity }) => {
14526
+ const priceId = (period === "year" ? meteredYearlyPrice : meteredMonthlyPrice)?.priceId;
14527
+ if (priceId) {
14528
+ acc.push({
14529
+ priceId,
14530
+ quantity
14531
+ });
14532
+ }
14533
+ return acc;
14534
+ },
14535
+ []
14536
+ )
14537
+ ],
14197
14538
  creditBundles: (updates.creditBundles || creditBundles).reduce(
14198
14539
  (acc, { id, count }) => {
14199
14540
  if (count > 0) {
@@ -14250,6 +14591,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14250
14591
  planPeriod,
14251
14592
  selectedPlan,
14252
14593
  payInAdvanceEntitlements,
14594
+ addOnUsageBasedEntitlements,
14253
14595
  addOns,
14254
14596
  creditBundles,
14255
14597
  shouldTrial,
@@ -14323,6 +14665,17 @@ var CheckoutDialog = ({ top = 0 }) => {
14323
14665
  ...addOn,
14324
14666
  ...addOn.id === id && { isSelected: !addOn.isSelected }
14325
14667
  }));
14668
+ const updatedAddOnEntitlements = updated.filter((addOn) => addOn.isSelected).flatMap(
14669
+ (addOn) => addOn.entitlements.filter(
14670
+ (entitlement) => entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */
14671
+ ).map((entitlement) => ({
14672
+ ...entitlement,
14673
+ allocation: entitlement.valueNumeric || 0,
14674
+ usage: 0,
14675
+ quantity: 1
14676
+ }))
14677
+ );
14678
+ setAddOnUsageBasedEntitlements(updatedAddOnEntitlements);
14326
14679
  handlePreviewCheckout({ addOns: updated });
14327
14680
  return updated;
14328
14681
  });
@@ -14363,6 +14716,23 @@ var CheckoutDialog = ({ top = 0 }) => {
14363
14716
  },
14364
14717
  [handlePreviewCheckout]
14365
14718
  );
14719
+ const updateAddOnEntitlementQuantity = useCallback9(
14720
+ (id, updatedQuantity) => {
14721
+ setAddOnUsageBasedEntitlements((prev2) => {
14722
+ const updated = prev2.map(
14723
+ (entitlement) => entitlement.id === id ? {
14724
+ ...entitlement,
14725
+ quantity: updatedQuantity
14726
+ } : entitlement
14727
+ );
14728
+ handlePreviewCheckout({
14729
+ addOnPayInAdvanceEntitlements: updated
14730
+ });
14731
+ return updated;
14732
+ });
14733
+ },
14734
+ [handlePreviewCheckout]
14735
+ );
14366
14736
  const updatePromoCode = useCallback9(
14367
14737
  async (code) => {
14368
14738
  handlePreviewCheckout({ promoCode: code });
@@ -14496,7 +14866,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14496
14866
  ),
14497
14867
  activeCheckoutStage.description && /* @__PURE__ */ jsx20(Text, { as: "p", children: activeCheckoutStage.description })
14498
14868
  ] }),
14499
- checkoutStage === "plan" && availablePeriods.length > 1 && /* @__PURE__ */ jsx20(
14869
+ checkoutStage === "plan" && showPeriodToggle && availablePeriods.length > 1 && /* @__PURE__ */ jsx20(
14500
14870
  PeriodToggle,
14501
14871
  {
14502
14872
  options: availablePeriods,
@@ -14516,7 +14886,8 @@ var CheckoutDialog = ({ top = 0 }) => {
14516
14886
  plans: availablePlans,
14517
14887
  selectedPlan,
14518
14888
  selectPlan,
14519
- shouldTrial
14889
+ shouldTrial,
14890
+ showPeriodToggle
14520
14891
  }
14521
14892
  ),
14522
14893
  checkoutStage === "usage" && /* @__PURE__ */ jsx20(
@@ -14538,6 +14909,16 @@ var CheckoutDialog = ({ top = 0 }) => {
14538
14909
  toggle: (id) => toggleAddOn(id)
14539
14910
  }
14540
14911
  ),
14912
+ checkoutStage === "addonsUsage" && /* @__PURE__ */ jsx20(
14913
+ Usage,
14914
+ {
14915
+ isLoading,
14916
+ period: planPeriod,
14917
+ selectedPlan,
14918
+ entitlements: addOnUsageBasedEntitlements,
14919
+ updateQuantity: updateAddOnEntitlementQuantity
14920
+ }
14921
+ ),
14541
14922
  checkoutStage === "credits" && /* @__PURE__ */ jsx20(
14542
14923
  Credits,
14543
14924
  {
@@ -17962,7 +18343,7 @@ var Plan2 = ({
17962
18343
  );
17963
18344
  const isActivePlan = isHydratedPlan(plan) && plan.current && currentPeriod === selectedPeriod;
17964
18345
  const { price: planPrice, currency: planCurrency } = getPlanPrice(plan, selectedPeriod) || {};
17965
- const credits = isHydratedPlan(plan) ? groupPlanCreditGrants(plan.includedCreditGrants) : [];
18346
+ const credits = groupPlanCreditGrants(plan.includedCreditGrants);
17966
18347
  const hasUsageBasedEntitlements = plan.entitlements.some(
17967
18348
  (entitlement) => !!entitlement.priceBehavior
17968
18349
  );
@@ -18256,8 +18637,8 @@ var PricingTable = forwardRef12(
18256
18637
  ({ className, callToActionUrl, callToActionTarget, onCallToAction, ...rest }, ref) => {
18257
18638
  const props = resolveDesignProps8(rest);
18258
18639
  const { t: t2 } = useTranslation();
18259
- const { data, settings, hydratePublic } = useEmbed();
18260
- const { currentPeriod, isStandalone } = useMemo26(() => {
18640
+ const { data, settings, isPending, hydratePublic } = useEmbed();
18641
+ const { currentPeriod, showPeriodToggle, isStandalone } = useMemo26(() => {
18261
18642
  if (isCheckoutData(data)) {
18262
18643
  const billingSubscription = data.company?.billingSubscription;
18263
18644
  const isTrialSubscription = billingSubscription?.status === "trialing";
@@ -18266,6 +18647,7 @@ var PricingTable = forwardRef12(
18266
18647
  currentPeriod: data.company?.plan?.planPeriod || "month",
18267
18648
  currentAddOns: data.company?.addOns || [],
18268
18649
  canCheckout: data.capabilities?.checkout ?? true,
18650
+ showPeriodToggle: data.showPeriodToggle ?? props.showPeriodToggle,
18269
18651
  isTrialSubscription,
18270
18652
  willSubscriptionCancel,
18271
18653
  isStandalone: false
@@ -18275,13 +18657,16 @@ var PricingTable = forwardRef12(
18275
18657
  currentPeriod: "month",
18276
18658
  currentAddOns: [],
18277
18659
  canCheckout: true,
18660
+ showPeriodToggle: props.showPeriodToggle,
18278
18661
  isTrialSubscription: false,
18279
18662
  willSubscriptionCancel: false,
18280
18663
  isStandalone: true
18281
18664
  };
18282
- }, [data]);
18665
+ }, [props.showPeriodToggle, data]);
18283
18666
  const [selectedPeriod, setSelectedPeriod] = useState17(currentPeriod);
18284
- const { plans, addOns, periods } = useAvailablePlans(selectedPeriod);
18667
+ const { plans, addOns, periods } = useAvailablePlans(selectedPeriod, {
18668
+ useSelectedPeriod: showPeriodToggle
18669
+ });
18285
18670
  const [entitlementCounts, setEntitlementCounts] = useState17(
18286
18671
  () => plans.reduce(entitlementCountsReducer, {})
18287
18672
  );
@@ -18308,6 +18693,19 @@ var PricingTable = forwardRef12(
18308
18693
  useEffect8(() => {
18309
18694
  setEntitlementCounts(plans.reduce(entitlementCountsReducer, {}));
18310
18695
  }, [plans]);
18696
+ if (isStandalone && isPending) {
18697
+ return /* @__PURE__ */ jsx46(
18698
+ Flex,
18699
+ {
18700
+ $width: "100%",
18701
+ $height: "100%",
18702
+ $alignItems: "center",
18703
+ $justifyContent: "center",
18704
+ $padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
18705
+ children: /* @__PURE__ */ jsx46(Loader, { $size: "2xl" })
18706
+ }
18707
+ );
18708
+ }
18311
18709
  const Wrapper = isStandalone ? Container : Fragment24;
18312
18710
  return /* @__PURE__ */ jsx46(Wrapper, { children: /* @__PURE__ */ jsxs38(
18313
18711
  FussyChild,
@@ -18342,7 +18740,7 @@ var PricingTable = forwardRef12(
18342
18740
  children: props.header.isVisible && props.plans.isVisible && plans.length > 0 && t2("Plans")
18343
18741
  }
18344
18742
  ),
18345
- props.showPeriodToggle && periods.length > 1 && /* @__PURE__ */ jsx46(
18743
+ showPeriodToggle && periods.length > 1 && /* @__PURE__ */ jsx46(
18346
18744
  PeriodToggle,
18347
18745
  {
18348
18746
  options: periods,
@@ -18363,24 +18761,27 @@ var PricingTable = forwardRef12(
18363
18761
  $display: "grid",
18364
18762
  $gridTemplateColumns: "repeat(auto-fill, minmax(320px, 1fr))",
18365
18763
  $gap: "1rem",
18366
- children: plans.map((plan, index, self2) => /* @__PURE__ */ jsx46(
18367
- Plan2,
18368
- {
18369
- plan,
18370
- index,
18371
- sharedProps: {
18372
- layout: props,
18373
- callToActionUrl,
18374
- callToActionTarget,
18375
- onCallToAction
18764
+ children: plans.map((plan, index, self2) => {
18765
+ const planPeriod = showPeriodToggle ? selectedPeriod : plan.yearlyPrice && !plan.monthlyPrice ? "year" /* Year */ : "month" /* Month */;
18766
+ return /* @__PURE__ */ jsx46(
18767
+ Plan2,
18768
+ {
18769
+ plan,
18770
+ index,
18771
+ sharedProps: {
18772
+ layout: props,
18773
+ callToActionUrl,
18774
+ callToActionTarget,
18775
+ onCallToAction
18776
+ },
18777
+ plans: self2,
18778
+ selectedPeriod: planPeriod,
18779
+ entitlementCounts,
18780
+ handleToggleShowAll
18376
18781
  },
18377
- plans: self2,
18378
- selectedPeriod,
18379
- entitlementCounts,
18380
- handleToggleShowAll
18381
- },
18382
- index
18383
- ))
18782
+ index
18783
+ );
18784
+ })
18384
18785
  }
18385
18786
  )
18386
18787
  ] }),
@@ -18407,20 +18808,23 @@ var PricingTable = forwardRef12(
18407
18808
  $display: "grid",
18408
18809
  $gridTemplateColumns: "repeat(auto-fill, minmax(320px, 1fr))",
18409
18810
  $gap: "1rem",
18410
- children: addOns.map((addOn, index) => /* @__PURE__ */ jsx46(
18411
- AddOn2,
18412
- {
18413
- addOn,
18414
- sharedProps: {
18415
- layout: props,
18416
- callToActionUrl,
18417
- callToActionTarget,
18418
- onCallToAction
18811
+ children: addOns.map((addOn, index) => {
18812
+ const addOnPeriod = showPeriodToggle ? selectedPeriod : addOn.yearlyPrice && !addOn.monthlyPrice ? "year" /* Year */ : "month" /* Month */;
18813
+ return /* @__PURE__ */ jsx46(
18814
+ AddOn2,
18815
+ {
18816
+ addOn,
18817
+ sharedProps: {
18818
+ layout: props,
18819
+ callToActionUrl,
18820
+ callToActionTarget,
18821
+ onCallToAction
18822
+ },
18823
+ selectedPeriod: addOnPeriod
18419
18824
  },
18420
- selectedPeriod
18421
- },
18422
- index
18423
- ))
18825
+ index
18826
+ );
18827
+ })
18424
18828
  }
18425
18829
  )
18426
18830
  ] }) })
@@ -23064,6 +23468,7 @@ export {
23064
23468
  Button,
23065
23469
  ButtonElement,
23066
23470
  Card,
23471
+ CheckoutDialog,
23067
23472
  Column,
23068
23473
  Container,
23069
23474
  Element,
@@ -23097,6 +23502,7 @@ export {
23097
23502
  UpcomingBill,
23098
23503
  Viewport,
23099
23504
  cardBoxShadow,
23505
+ createActiveUsageBasedEntitlementsReducer,
23100
23506
  defaultSettings,
23101
23507
  defaultTheme,
23102
23508
  iconsList,