@stigg/react-sdk 8.10.2 → 8.10.3

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.
@@ -1,24 +1,24 @@
1
- 'use strict';var chunk2FMVMEMY_cjs_js=require('./chunk-2FMVMEMY.cjs.js'),jsClientSdk=require('@stigg/js-client-sdk'),hi=require('react'),Wu=require('classnames'),Re=require('@mui/material/Grid'),Pc=require('lodash/compact'),reactNumberFormat=require('react-number-format'),jsxRuntime=require('react/jsx-runtime'),Za=require('lodash/isFunction'),Fo=require('lodash/isNil'),iu=require('react-spinners/ClipLoader'),react=require('@emotion/react'),Bo=require('dayjs'),Km=require('dayjs/plugin/utc'),qm=require('dayjs/plugin/relativeTime'),Jm=require('dayjs/plugin/advancedFormat'),ou=require('lodash/sum'),yu=require('currency-symbol-map'),wu=require('@mui/material/InputAdornment'),Pu=require('@mui/material/Button'),Su=require('@mui/material/TextField'),Nl=require('@mui/material/Divider'),Bu=require('@mui/material/OutlinedInput'),Au=require('@mui/material/Select'),Iu=require('@mui/material/MenuItem'),Fu=require('lodash/map'),ke=require('@mui/material/Box'),hg=require('react-switch'),Eg=require('lodash/countBy'),vg=require('lodash/uniq'),sc=require('lodash/sortBy'),Ug=require('lodash/merge'),Xe=require('react-loading-skeleton'),Jg=require('lodash/flatMap'),Ks=require('@mui/material/Tab'),Xg=require('lodash/isEmpty'),nf=require('@mui/material/Tabs'),cf=require('@mui/material/useMediaQuery'),reactFeather=require('react-feather'),Wf=require('@mui/material/Link'),$f=require('@mui/material/Tooltip'),$l=require('lodash/keyBy'),Ni=require('color'),qf=require('@mui/material/LinearProgress'),fy=require('lodash/padStart'),Ql=require('lodash/isUndefined'),sdk=require('@stigg/api-client-js/src/generated/sdk'),jn=require('lodash/lowerCase'),Ay=require('lodash/range'),immer=require('immer'),Uy=require('lodash/cloneDeep'),_y=require('lodash/remove'),reactStripeJs=require('@stripe/react-stripe-js'),$h=require('@mui/material/StepIcon'),Zx=require('lodash/partition'),Jh=require('@mui/material/CircularProgress'),qx=require('@mui/material/Paper'),Jx=require('@mui/material/Alert'),rC=require('@mui/material/Checkbox'),nC=require('@mui/material/FormControlLabel'),iC=require('lodash/isString'),YP=require('@mui/material/Autocomplete'),QP=require('@mui/material/Collapse'),_3x2=require('country-flag-icons/react/3x2'),fd=require('lodash/startCase'),yd=require('lodash/upperCase'),mx=require('react-lottie'),Vx=require('@mui/material/IconButton'),styles=require('@mui/material/styles'),Sb=require('@mui/material/Radio'),vb=require('@mui/material/Chip'),material=require('@mui/material'),DS=require('@mui/material/TableRow');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var hi__default=/*#__PURE__*/_interopDefault(hi);var Wu__default=/*#__PURE__*/_interopDefault(Wu);var Re__default=/*#__PURE__*/_interopDefault(Re);var Pc__default=/*#__PURE__*/_interopDefault(Pc);var Za__default=/*#__PURE__*/_interopDefault(Za);var Fo__default=/*#__PURE__*/_interopDefault(Fo);var iu__default=/*#__PURE__*/_interopDefault(iu);var Bo__default=/*#__PURE__*/_interopDefault(Bo);var Km__default=/*#__PURE__*/_interopDefault(Km);var qm__default=/*#__PURE__*/_interopDefault(qm);var Jm__default=/*#__PURE__*/_interopDefault(Jm);var ou__default=/*#__PURE__*/_interopDefault(ou);var yu__default=/*#__PURE__*/_interopDefault(yu);var wu__default=/*#__PURE__*/_interopDefault(wu);var Pu__default=/*#__PURE__*/_interopDefault(Pu);var Su__default=/*#__PURE__*/_interopDefault(Su);var Nl__default=/*#__PURE__*/_interopDefault(Nl);var Bu__default=/*#__PURE__*/_interopDefault(Bu);var Au__default=/*#__PURE__*/_interopDefault(Au);var Iu__default=/*#__PURE__*/_interopDefault(Iu);var Fu__default=/*#__PURE__*/_interopDefault(Fu);var ke__default=/*#__PURE__*/_interopDefault(ke);var hg__default=/*#__PURE__*/_interopDefault(hg);var Eg__default=/*#__PURE__*/_interopDefault(Eg);var vg__default=/*#__PURE__*/_interopDefault(vg);var sc__default=/*#__PURE__*/_interopDefault(sc);var Ug__default=/*#__PURE__*/_interopDefault(Ug);var Xe__default=/*#__PURE__*/_interopDefault(Xe);var Jg__default=/*#__PURE__*/_interopDefault(Jg);var Ks__default=/*#__PURE__*/_interopDefault(Ks);var Xg__default=/*#__PURE__*/_interopDefault(Xg);var nf__default=/*#__PURE__*/_interopDefault(nf);var cf__default=/*#__PURE__*/_interopDefault(cf);var Wf__default=/*#__PURE__*/_interopDefault(Wf);var $f__default=/*#__PURE__*/_interopDefault($f);var $l__default=/*#__PURE__*/_interopDefault($l);var Ni__default=/*#__PURE__*/_interopDefault(Ni);var qf__default=/*#__PURE__*/_interopDefault(qf);var fy__default=/*#__PURE__*/_interopDefault(fy);var Ql__default=/*#__PURE__*/_interopDefault(Ql);var jn__default=/*#__PURE__*/_interopDefault(jn);var Ay__default=/*#__PURE__*/_interopDefault(Ay);var Uy__default=/*#__PURE__*/_interopDefault(Uy);var _y__default=/*#__PURE__*/_interopDefault(_y);var $h__default=/*#__PURE__*/_interopDefault($h);var Zx__default=/*#__PURE__*/_interopDefault(Zx);var Jh__default=/*#__PURE__*/_interopDefault(Jh);var qx__default=/*#__PURE__*/_interopDefault(qx);var Jx__default=/*#__PURE__*/_interopDefault(Jx);var rC__default=/*#__PURE__*/_interopDefault(rC);var nC__default=/*#__PURE__*/_interopDefault(nC);var iC__default=/*#__PURE__*/_interopDefault(iC);var YP__default=/*#__PURE__*/_interopDefault(YP);var QP__default=/*#__PURE__*/_interopDefault(QP);var fd__default=/*#__PURE__*/_interopDefault(fd);var yd__default=/*#__PURE__*/_interopDefault(yd);var mx__default=/*#__PURE__*/_interopDefault(mx);var Vx__default=/*#__PURE__*/_interopDefault(Vx);var Sb__default=/*#__PURE__*/_interopDefault(Sb);var vb__default=/*#__PURE__*/_interopDefault(vb);var DS__default=/*#__PURE__*/_interopDefault(DS);function So(e,t,o){let r=o?` ${o}`:"";return (!e||e===1)&&t?`Up to ${t}${r}`:e&&e>1&&t?`${e}-${t}${r}`:e&&e>1?`Minimum ${e}${r}`:""}function se(e,t="en-US"){if(e==null)return;let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:0,fixedDecimalScale:true};return reactNumberFormat.numericFormatter(String(Math.round(e)),o)}function pn(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return reactNumberFormat.numericFormatter(String(e),o)}function Gt(e,t=1){if(e<1e6)return se(e)||"0";let o=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"}];for(let{value:r,suffix:n}of o)if(e>=r){let a=(e/r).toFixed(t);return a.includes(".")&&(a=a.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${a}${n}`}return se(e)||"0"}var Am=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
1
+ 'use strict';var chunkIL3DC53A_cjs_js=require('./chunk-IL3DC53A.cjs.js'),jsClientSdk=require('@stigg/js-client-sdk'),hi=require('react'),Wu=require('classnames'),Re=require('@mui/material/Grid'),xc=require('lodash/compact'),reactNumberFormat=require('react-number-format'),jsxRuntime=require('react/jsx-runtime'),Ya=require('lodash/isFunction'),Fo=require('lodash/isNil'),iu=require('react-spinners/ClipLoader'),react=require('@emotion/react'),Bo=require('dayjs'),Km=require('dayjs/plugin/utc'),qm=require('dayjs/plugin/relativeTime'),Jm=require('dayjs/plugin/advancedFormat'),ou=require('lodash/sum'),yu=require('currency-symbol-map'),wu=require('@mui/material/InputAdornment'),Pu=require('@mui/material/Button'),Su=require('@mui/material/TextField'),Ml=require('@mui/material/Divider'),Bu=require('@mui/material/OutlinedInput'),Au=require('@mui/material/Select'),Iu=require('@mui/material/MenuItem'),Fu=require('lodash/map'),ke=require('@mui/material/Box'),hg=require('react-switch'),Eg=require('lodash/countBy'),vg=require('lodash/uniq'),lc=require('lodash/sortBy'),Ug=require('lodash/merge'),Xe=require('react-loading-skeleton'),Jg=require('lodash/flatMap'),qs=require('@mui/material/Tab'),Xg=require('lodash/isEmpty'),nf=require('@mui/material/Tabs'),cf=require('@mui/material/useMediaQuery'),reactFeather=require('react-feather'),Wf=require('@mui/material/Link'),$f=require('@mui/material/Tooltip'),Gl=require('lodash/keyBy'),Ni=require('color'),qf=require('@mui/material/LinearProgress'),fy=require('lodash/padStart'),Kl=require('lodash/isUndefined'),sdk=require('@stigg/api-client-js/src/generated/sdk'),jn=require('lodash/lowerCase'),Ay=require('lodash/range'),immer=require('immer'),Uy=require('lodash/cloneDeep'),_y=require('lodash/remove'),reactStripeJs=require('@stripe/react-stripe-js'),$h=require('@mui/material/StepIcon'),Zx=require('lodash/partition'),Jh=require('@mui/material/CircularProgress'),qx=require('@mui/material/Paper'),Jx=require('@mui/material/Alert'),rC=require('@mui/material/Checkbox'),nC=require('@mui/material/FormControlLabel'),iC=require('lodash/isString'),YP=require('@mui/material/Autocomplete'),QP=require('@mui/material/Collapse'),_3x2=require('country-flag-icons/react/3x2'),yd=require('lodash/startCase'),hd=require('lodash/upperCase'),mx=require('react-lottie'),Vx=require('@mui/material/IconButton'),styles=require('@mui/material/styles'),Sb=require('@mui/material/Radio'),vb=require('@mui/material/Chip'),material=require('@mui/material'),DS=require('@mui/material/TableRow');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var hi__default=/*#__PURE__*/_interopDefault(hi);var Wu__default=/*#__PURE__*/_interopDefault(Wu);var Re__default=/*#__PURE__*/_interopDefault(Re);var xc__default=/*#__PURE__*/_interopDefault(xc);var Ya__default=/*#__PURE__*/_interopDefault(Ya);var Fo__default=/*#__PURE__*/_interopDefault(Fo);var iu__default=/*#__PURE__*/_interopDefault(iu);var Bo__default=/*#__PURE__*/_interopDefault(Bo);var Km__default=/*#__PURE__*/_interopDefault(Km);var qm__default=/*#__PURE__*/_interopDefault(qm);var Jm__default=/*#__PURE__*/_interopDefault(Jm);var ou__default=/*#__PURE__*/_interopDefault(ou);var yu__default=/*#__PURE__*/_interopDefault(yu);var wu__default=/*#__PURE__*/_interopDefault(wu);var Pu__default=/*#__PURE__*/_interopDefault(Pu);var Su__default=/*#__PURE__*/_interopDefault(Su);var Ml__default=/*#__PURE__*/_interopDefault(Ml);var Bu__default=/*#__PURE__*/_interopDefault(Bu);var Au__default=/*#__PURE__*/_interopDefault(Au);var Iu__default=/*#__PURE__*/_interopDefault(Iu);var Fu__default=/*#__PURE__*/_interopDefault(Fu);var ke__default=/*#__PURE__*/_interopDefault(ke);var hg__default=/*#__PURE__*/_interopDefault(hg);var Eg__default=/*#__PURE__*/_interopDefault(Eg);var vg__default=/*#__PURE__*/_interopDefault(vg);var lc__default=/*#__PURE__*/_interopDefault(lc);var Ug__default=/*#__PURE__*/_interopDefault(Ug);var Xe__default=/*#__PURE__*/_interopDefault(Xe);var Jg__default=/*#__PURE__*/_interopDefault(Jg);var qs__default=/*#__PURE__*/_interopDefault(qs);var Xg__default=/*#__PURE__*/_interopDefault(Xg);var nf__default=/*#__PURE__*/_interopDefault(nf);var cf__default=/*#__PURE__*/_interopDefault(cf);var Wf__default=/*#__PURE__*/_interopDefault(Wf);var $f__default=/*#__PURE__*/_interopDefault($f);var Gl__default=/*#__PURE__*/_interopDefault(Gl);var Ni__default=/*#__PURE__*/_interopDefault(Ni);var qf__default=/*#__PURE__*/_interopDefault(qf);var fy__default=/*#__PURE__*/_interopDefault(fy);var Kl__default=/*#__PURE__*/_interopDefault(Kl);var jn__default=/*#__PURE__*/_interopDefault(jn);var Ay__default=/*#__PURE__*/_interopDefault(Ay);var Uy__default=/*#__PURE__*/_interopDefault(Uy);var _y__default=/*#__PURE__*/_interopDefault(_y);var $h__default=/*#__PURE__*/_interopDefault($h);var Zx__default=/*#__PURE__*/_interopDefault(Zx);var Jh__default=/*#__PURE__*/_interopDefault(Jh);var qx__default=/*#__PURE__*/_interopDefault(qx);var Jx__default=/*#__PURE__*/_interopDefault(Jx);var rC__default=/*#__PURE__*/_interopDefault(rC);var nC__default=/*#__PURE__*/_interopDefault(nC);var iC__default=/*#__PURE__*/_interopDefault(iC);var YP__default=/*#__PURE__*/_interopDefault(YP);var QP__default=/*#__PURE__*/_interopDefault(QP);var yd__default=/*#__PURE__*/_interopDefault(yd);var hd__default=/*#__PURE__*/_interopDefault(hd);var mx__default=/*#__PURE__*/_interopDefault(mx);var Vx__default=/*#__PURE__*/_interopDefault(Vx);var Sb__default=/*#__PURE__*/_interopDefault(Sb);var vb__default=/*#__PURE__*/_interopDefault(vb);var DS__default=/*#__PURE__*/_interopDefault(DS);function So(e,t,o){let r=o?` ${o}`:"";return (!e||e===1)&&t?`Up to ${t}${r}`:e&&e>1&&t?`${e}-${t}${r}`:e&&e>1?`Minimum ${e}${r}`:""}function se(e,t="en-US"){if(e==null)return;let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:0,fixedDecimalScale:true};return reactNumberFormat.numericFormatter(String(Math.round(e)),o)}function pn(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return reactNumberFormat.numericFormatter(String(e),o)}function Gt(e,t=1){if(e<1e6)return se(e)||"0";let o=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"}];for(let{value:r,suffix:n}of o)if(e>=r){let a=(e/r).toFixed(t);return a.includes(".")&&(a=a.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${a}${n}`}return se(e)||"0"}var Am=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
2
2
  margin: 0;
3
- `,Im=chunk2FMVMEMY_cjs_js.e.div`
3
+ `,Im=chunkIL3DC53A_cjs_js.e.div`
4
4
  display: flex;
5
5
  align-items: center;
6
6
  gap: 16px;
7
- `,Fm=chunk2FMVMEMY_cjs_js.e.div`
7
+ `,Fm=chunkIL3DC53A_cjs_js.e.div`
8
8
  display: flex;
9
9
  align-items: center;
10
10
  flex-shrink: 0;
11
- `,Em=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.i)`
11
+ `,Em=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.i)`
12
12
  width: 24px;
13
13
  height: 24px;
14
14
  color: ${({theme:e})=>e.stigg.palette.primary};
15
- `;function To({displayName:e,className:t}){return jsxRuntime.jsxs(Im,{className:`stigg-entitlement-row-container ${t}`,children:[jsxRuntime.jsx(Fm,{children:jsxRuntime.jsx(Em,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsxRuntime.jsx(Am,{className:"stigg-entitlement-name",variant:"h6",color:"secondary",children:e})]})}function Lm(e){if(!e)return "";switch(e){case jsClientSdk.EntitlementResetPeriod.Day:return "per day";case jsClientSdk.EntitlementResetPeriod.Hour:return "per hour";case jsClientSdk.EntitlementResetPeriod.Week:return "per week";case jsClientSdk.EntitlementResetPeriod.Month:return "per month";case jsClientSdk.EntitlementResetPeriod.Year:return "per year";default:return ""}}function Nm({hasUnlimitedUsage:e,feature:t,resetPeriod:o,usageLimit:r,minUnitQuantity:n,maxUnitQuantity:i,isCustom:a,enumValues:l}){let s=n||i,c=`${o&&r?`${Lm(o)}`:""}`;if(l){let u=l.length===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${l.length} ${u}`}if(e)return `Unlimited ${t==null?void 0:t.featureUnitsPlural}`;if(a)return `Custom ${t==null?void 0:t.featureUnitsPlural}`;if(r){let u=r===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${se(r)} ${u} ${c}`}return s?So(n,i,t==null?void 0:t.featureUnitsPlural):t==null?void 0:t.displayName}function un(e){let i=e,{displayNameOverride:t,feature:o}=i,r=chunk2FMVMEMY_cjs_js.c(i,["displayNameOverride","feature"]),n=t||Nm(chunk2FMVMEMY_cjs_js.a({feature:o},r))||"";return jsxRuntime.jsx(To,{displayName:n,className:`stigg-entitlement-${o==null?void 0:o.refId}`})}function Rm(e){switch(e){case jsClientSdk.BillingPeriod.Monthly:return "per month";case jsClientSdk.BillingPeriod.Annually:return "per year";default:return ""}}function Um(e){var c,u,f;let{amount:t,customCurrency:o,displayNameOverride:r,billingPeriod:n}=e,i=t!=null?t:0;if(r)return r;let a=i===1?(c=o.units)==null?void 0:c.singular:(u=o.units)==null?void 0:u.plural,l=`${se(i)} ${a||o.displayName}`;(f=e.dependencyFeature)!=null&&f.featureUnits&&(l=`${l} / ${e.dependencyFeature.featureUnits}`);let s=Rm(n);return s?`${l} ${s}`:l}function gn({entitlement:e}){let t=Um(e);return jsxRuntime.jsx(To,{displayName:t,className:`stigg-credit-entitlement-${e.id}`})}function zt(e){return e.pricingModel===jsClientSdk.BillingModel.PerUnit&&!!e.topUpCustomCurrencyId}function $m(e){return zt(e)&&e.billingCadence===jsClientSdk.BillingCadence.OneOff}function Ot(e){return zt(e)&&e.isTieredPrice}function ko(e,t){return e.pricePoints.find(o=>o.billingPeriod===t&&Ot(o))}function wo(e){var t,o;return ((o=(t=e.tiers)==null?void 0:t.length)!=null?o:0)>1}function Gm(e){return e.pricingModel===jsClientSdk.BillingModel.CreditBased}function Ct(e){return !Gm(e)&&!$m(e)}function Ma(e){var t,o,r;return (t=e.customCurrency)!=null&&t.units?e.customCurrency.units.plural||e.customCurrency.units.singular||e.customCurrency.displayName:((o=e.feature)==null?void 0:o.unitsPlural)||((r=e.feature)==null?void 0:r.units)||""}function Hm(e){return e.__typename==="PackageCreditEntitlement"}function Wm(e){switch(e){case jsClientSdk.CreditCadence.Month:return jsClientSdk.BillingPeriod.Monthly;case jsClientSdk.CreditCadence.Year:return jsClientSdk.BillingPeriod.Annually}}var Zm=chunk2FMVMEMY_cjs_js.e.div`
15
+ `;function To({displayName:e,className:t}){return jsxRuntime.jsxs(Im,{className:`stigg-entitlement-row-container ${t}`,children:[jsxRuntime.jsx(Fm,{children:jsxRuntime.jsx(Em,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsxRuntime.jsx(Am,{className:"stigg-entitlement-name",variant:"h6",color:"secondary",children:e})]})}function Lm(e){if(!e)return "";switch(e){case jsClientSdk.EntitlementResetPeriod.Day:return "per day";case jsClientSdk.EntitlementResetPeriod.Hour:return "per hour";case jsClientSdk.EntitlementResetPeriod.Week:return "per week";case jsClientSdk.EntitlementResetPeriod.Month:return "per month";case jsClientSdk.EntitlementResetPeriod.Year:return "per year";default:return ""}}function Nm({hasUnlimitedUsage:e,feature:t,resetPeriod:o,usageLimit:r,minUnitQuantity:n,maxUnitQuantity:i,isCustom:a,enumValues:l}){let s=n||i,c=`${o&&r?`${Lm(o)}`:""}`;if(l){let u=l.length===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${l.length} ${u}`}if(e)return `Unlimited ${t==null?void 0:t.featureUnitsPlural}`;if(a)return `Custom ${t==null?void 0:t.featureUnitsPlural}`;if(r){let u=r===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${se(r)} ${u} ${c}`}return s?So(n,i,t==null?void 0:t.featureUnitsPlural):t==null?void 0:t.displayName}function un(e){let i=e,{displayNameOverride:t,feature:o}=i,r=chunkIL3DC53A_cjs_js.c(i,["displayNameOverride","feature"]),n=t||Nm(chunkIL3DC53A_cjs_js.a({feature:o},r))||"";return jsxRuntime.jsx(To,{displayName:n,className:`stigg-entitlement-${o==null?void 0:o.refId}`})}function Rm(e){switch(e){case jsClientSdk.BillingPeriod.Monthly:return "per month";case jsClientSdk.BillingPeriod.Annually:return "per year";default:return ""}}function Um(e){var c,u,f;let{amount:t,customCurrency:o,displayNameOverride:r,billingPeriod:n}=e,i=t!=null?t:0;if(r)return r;let a=i===1?(c=o.units)==null?void 0:c.singular:(u=o.units)==null?void 0:u.plural,l=`${se(i)} ${a||o.displayName}`;(f=e.dependencyFeature)!=null&&f.featureUnits&&(l=`${l} / ${e.dependencyFeature.featureUnits}`);let s=Rm(n);return s?`${l} ${s}`:l}function gn({entitlement:e}){let t=Um(e);return jsxRuntime.jsx(To,{displayName:t,className:`stigg-credit-entitlement-${e.id}`})}function zt(e){return e.pricingModel===jsClientSdk.BillingModel.PerUnit&&!!e.topUpCustomCurrencyId}function $m(e){return zt(e)&&e.billingCadence===jsClientSdk.BillingCadence.OneOff}function Ot(e){return zt(e)&&e.isTieredPrice}function ko(e,t){return e.pricePoints.find(o=>o.billingPeriod===t&&Ot(o))}function wo(e){var t,o;return ((o=(t=e.tiers)==null?void 0:t.length)!=null?o:0)>1}function Gm(e){return e.pricingModel===jsClientSdk.BillingModel.CreditBased}function Ct(e){return !Gm(e)&&!$m(e)}function Ra(e){var t,o,r;return (t=e.customCurrency)!=null&&t.units?e.customCurrency.units.plural||e.customCurrency.units.singular||e.customCurrency.displayName:((o=e.feature)==null?void 0:o.unitsPlural)||((r=e.feature)==null?void 0:r.units)||""}function Hm(e){return e.__typename==="PackageCreditEntitlement"}function Wm(e){switch(e){case jsClientSdk.CreditCadence.Month:return jsClientSdk.BillingPeriod.Monthly;case jsClientSdk.CreditCadence.Year:return jsClientSdk.BillingPeriod.Annually}}var Zm=chunkIL3DC53A_cjs_js.e.div`
16
16
  display: flex;
17
17
  flex-direction: column;
18
18
  gap: 16px;
19
- `;function Ym(e,t,o){if(t.entitlementsTitle)return t.entitlementsTitle(e);let r=o?"Includes:":"";return e.basePlan&&(r=`Everything in ${e.basePlan.displayName}${o?", plus:":""}`),r}function Da({plan:e,billingPeriod:t,paywallLocale:o,singleTierCreditCharge:r}){var c,u,f,y;let i=(((c=e.pricePoints)==null?void 0:c.filter(p=>p.billingPeriod===t))||[]).filter(p=>Ct(p)).filter(p=>(p==null?void 0:p.minUnitQuantity)&&(p==null?void 0:p.minUnitQuantity)>1||(p==null?void 0:p.maxUnitQuantity)).map(p=>{var g;return jsxRuntime.jsx(un,{feature:p!=null&&p.feature?{refId:p.feature.featureId,featureUnits:p.feature.units,featureUnitsPlural:p.feature.unitsPlural,unitQuantity:p.feature.unitQuantity,displayName:p.feature.displayName}:null,minUnitQuantity:p==null?void 0:p.minUnitQuantity,maxUnitQuantity:p==null?void 0:p.maxUnitQuantity},`priceUnitEntitlement-${(g=p==null?void 0:p.feature)==null?void 0:g.displayName}`)}),a=Pc__default.default(e.packageEntitlements).filter(p=>p.isGranted).filter(p=>{var g;return !((g=p.hiddenFromWidgets)!=null&&g.includes(jsClientSdk.WidgetType.Paywall))}),l=!!r,s=i.length>0||a.length>0||l;return jsxRuntime.jsxs(Zm,{className:"stigg-plan-entitlements-container",children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:true,children:Ym(e,o,s)}),i,r&&jsxRuntime.jsx(gn,{entitlement:{id:r.topUpCustomCurrencyId,amount:(y=(f=(u=r.tiers)==null?void 0:u[0])==null?void 0:f.upTo)!=null?y:0,customCurrency:r.customCurrency,billingPeriod:r.billingCadence===jsClientSdk.BillingCadence.Recurring?t:void 0}},`credit-charge-${r.topUpCustomCurrencyId}`),a.map(p=>Hm(p)?jsxRuntime.jsx(gn,{entitlement:chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},p),{billingPeriod:Wm(p.cadence)})},_a(p)):jsxRuntime.jsx(un,{displayNameOverride:p.displayNameOverride,feature:p.feature,resetPeriod:p.resetPeriod,hasUnlimitedUsage:p.hasUnlimitedUsage,usageLimit:p.usageLimit,enumValues:p.enumValues,isCustom:p.isCustom},_a(p)))]})}function _a(e){return `${e.__typename}:${e.id}`}var fn=(s=>(s.START_TRIAL="START_TRIAL",s.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",s.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",s.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",s.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",s.UPGRADE_PLAN="UPGRADE_PLAN",s.DOWNGRADE_PLAN="DOWNGRADE_PLAN",s.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES",s))(fn||{});Bo__default.default.extend(Km__default.default);Bo__default.default.extend(qm__default.default);Bo__default.default.extend(Jm__default.default);var Z=Bo__default.default;var hn=e=>Z.utc(e).format("MMMM Do, YYYY");function Ao(e){return String(e.scheduledExecutionTime)}function eu(e){return e!=null&&e.end?String(e.end):void 0}function Io({scheduledUpdate:e,subscriptionPrices:t,billingPeriodRange:o,options:r={}}){var a,l;if(!e)return {};let{withDate:n,postfix:i=""}=r;switch(e.subscriptionScheduleType){case jsClientSdk.SubscriptionScheduleType.Downgrade:{let s=n,c=eu(o);return Fo__default.default(s)&&c&&(s=!Z(Ao(e)).isSame(Z(c),"day")),{line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be downgraded to the ",jsxRuntime.jsxs("b",{children:[(a=e.targetPackage)==null?void 0:a.displayName," plan"]})," ",s?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",hn(Ao(e))]}):i,"."]}),line2:"Until then you still have access to your current plan."}}case jsClientSdk.SubscriptionScheduleType.BillingPeriod:{let s=e.scheduleVariables;return {line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your billing cycle will change to ",jsxRuntime.jsx("b",{children:(l=s.billingPeriod)==null?void 0:l.toLocaleLowerCase()})," ",n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",hn(Ao(e))]}):i,"."]})}}case jsClientSdk.SubscriptionScheduleType.UnitAmount:{let s=e.scheduleVariables,u=Pc__default.default(t==null?void 0:t.map(({feature:P})=>P)).find(({id:P})=>P===s.featureId),{featureUnits:f,featureUnitsPlural:y}=u||{},p=s.newUnitAmount===1?f:y,g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be updated to ",jsxRuntime.jsx("b",{children:s.newUnitAmount})," ",p," ",n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",hn(Ao(e))]}):i,"."]}),h=`Until then you still have access to your current ${f} count.`;return {line1:g,line2:h}}default:return {}}}function za(e){return e.feature&&(e.feature.unitQuantity!==1?e.feature.unitsPlural:e.feature.units)||""}function xn(e,t){let o=[...e];o.sort((r,n)=>r.upTo?n.upTo?r.upTo-n.upTo:-1:1);for(let r of o)if(r.upTo&&t<=r.upTo)return r;return o[o.length-1]}function Va(e,t,o){return t===jsClientSdk.BillingPeriod.Annually&&o?e/12:e}function Pn(e,t,o,r){let n=0;if(e.unitPrice){let i=Va(e.unitPrice.amount,o,r);n+=i*t;}return e.flatPrice&&(n+=Va(e.flatPrice.amount,o,r)),n}function bn(e,t,o,r){let n=t,i=0,a=0,l=[];for(;n>0&&a<e.length;){let c=e[a],{upTo:u}=c;if(Fo__default.default(u))l.push({unitQuantity:n,amount:Pn(c,n,o,r)}),n=0;else {let f=u-i,y=Math.min(n,f);l.push({unitQuantity:y,amount:Pn(c,y,o,r)}),n-=y,i=u;}a+=1;}let s=ou__default.default(l.map(({amount:c})=>c));return {breakdown:l,total:s}}function xt(e,t,o,r){if(!e.tiers)return 0;switch(e.tiersMode){case jsClientSdk.TiersMode.Volume:{let n=xn(e.tiers,t);return Pn(n,t,o,r)}case jsClientSdk.TiersMode.Graduated:return bn(e.tiers,t,o,r).total;default:return 0}}function Wt(e){return e==null?void 0:e.some(({unitPrice:t,upTo:o})=>t&&!Fo__default.default(o))}function Oa(e){return e==null?void 0:e.every(({unitPrice:t,upTo:o})=>!t||Fo__default.default(o))}function Ha(e,t){return (e==null?void 0:e[0].upTo)&&t<=e[0].upTo}function Eo({plan:e,billingPeriod:t,currentSubscription:o,currentSubscriptionOverride:r,selectDefaultTierIndex:n}){let i=e.pricePoints.filter(a=>a.billingPeriod===t&&a.isTieredPrice&&!Ot(a));if(i.length===1){let[a]=i,{featureId:l}=a.feature,s=n?n({plan:e}):0,c=a.tiers[s],u=Wt(a.tiers)?1:c.upTo||1;if(o&&o.plan.id===e.id){let y=o.prices.find(p=>{var g;return p.pricingModel===jsClientSdk.BillingModel.PerUnit&&p.tiersMode&&((g=p.feature)==null?void 0:g.featureId)===l});y&&(u=y.feature.unitQuantity||1);}if((r==null?void 0:r.planId)===e.id){let y=r.billableFeatures.find(p=>p.featureId===l);y&&(u=y.quantity);}let f={};return f[l]=u,f}return {}}function Wa({perUnitQuantityByFeature:e,plan:t,currentSubscription:o,currentSubscriptionOverride:r}){var u,f;if(!o)return 0;let n=o.prices.find(y=>y.pricingModel===jsClientSdk.BillingModel.PerUnit&&y.tiersMode),i=t.id===(r==null?void 0:r.planId);if(i&&(n=(u=t.pricePoints.find(y=>y.pricingModel===jsClientSdk.BillingModel.PerUnit&&y.tiersMode))!=null?u:n),!n)return 0;let{featureId:a,unitQuantity:l}=n.feature,s=l;if(i){let y=(f=r==null?void 0:r.billableFeatures)==null?void 0:f.find(p=>p.featureId===a);y&&(s=y.quantity);}if(Fo__default.default(s))return 0;let c=e[a];return c<s?-1:c>s?1:0}var lu=chunk2FMVMEMY_cjs_js.e(iu__default.default)`
19
+ `;function Ym(e,t,o){if(t.entitlementsTitle)return t.entitlementsTitle(e);let r=o?"Includes:":"";return e.basePlan&&(r=`Everything in ${e.basePlan.displayName}${o?", plus:":""}`),r}function $a({plan:e,billingPeriod:t,paywallLocale:o,singleTierCreditCharge:r}){var c,u,f,y;let i=(((c=e.pricePoints)==null?void 0:c.filter(p=>p.billingPeriod===t))||[]).filter(p=>Ct(p)).filter(p=>(p==null?void 0:p.minUnitQuantity)&&(p==null?void 0:p.minUnitQuantity)>1||(p==null?void 0:p.maxUnitQuantity)).map(p=>{var g;return jsxRuntime.jsx(un,{feature:p!=null&&p.feature?{refId:p.feature.featureId,featureUnits:p.feature.units,featureUnitsPlural:p.feature.unitsPlural,unitQuantity:p.feature.unitQuantity,displayName:p.feature.displayName}:null,minUnitQuantity:p==null?void 0:p.minUnitQuantity,maxUnitQuantity:p==null?void 0:p.maxUnitQuantity},`priceUnitEntitlement-${(g=p==null?void 0:p.feature)==null?void 0:g.displayName}`)}),a=xc__default.default(e.packageEntitlements).filter(p=>p.isGranted).filter(p=>{var g;return !((g=p.hiddenFromWidgets)!=null&&g.includes(jsClientSdk.WidgetType.Paywall))}),l=!!r,s=i.length>0||a.length>0||l;return jsxRuntime.jsxs(Zm,{className:"stigg-plan-entitlements-container",children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:true,children:Ym(e,o,s)}),i,r&&jsxRuntime.jsx(gn,{entitlement:{id:r.topUpCustomCurrencyId,amount:(y=(f=(u=r.tiers)==null?void 0:u[0])==null?void 0:f.upTo)!=null?y:0,customCurrency:r.customCurrency,billingPeriod:r.billingCadence===jsClientSdk.BillingCadence.Recurring?t:void 0}},`credit-charge-${r.topUpCustomCurrencyId}`),a.map(p=>Hm(p)?jsxRuntime.jsx(gn,{entitlement:chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},p),{billingPeriod:Wm(p.cadence)})},Da(p)):jsxRuntime.jsx(un,{displayNameOverride:p.displayNameOverride,feature:p.feature,resetPeriod:p.resetPeriod,hasUnlimitedUsage:p.hasUnlimitedUsage,usageLimit:p.usageLimit,enumValues:p.enumValues,isCustom:p.isCustom},Da(p)))]})}function Da(e){return `${e.__typename}:${e.id}`}var fn=(s=>(s.START_TRIAL="START_TRIAL",s.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",s.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",s.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",s.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",s.UPGRADE_PLAN="UPGRADE_PLAN",s.DOWNGRADE_PLAN="DOWNGRADE_PLAN",s.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES",s))(fn||{});Bo__default.default.extend(Km__default.default);Bo__default.default.extend(qm__default.default);Bo__default.default.extend(Jm__default.default);var Z=Bo__default.default;var hn=e=>Z.utc(e).format("MMMM Do, YYYY");function Ao(e){return String(e.scheduledExecutionTime)}function eu(e){return e!=null&&e.end?String(e.end):void 0}function Io({scheduledUpdate:e,subscriptionPrices:t,billingPeriodRange:o,options:r={}}){var a,l;if(!e)return {};let{withDate:n,postfix:i=""}=r;switch(e.subscriptionScheduleType){case jsClientSdk.SubscriptionScheduleType.Downgrade:{let s=n,c=eu(o);return Fo__default.default(s)&&c&&(s=!Z(Ao(e)).isSame(Z(c),"day")),{line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be downgraded to the ",jsxRuntime.jsxs("b",{children:[(a=e.targetPackage)==null?void 0:a.displayName," plan"]})," ",s?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",hn(Ao(e))]}):i,"."]}),line2:"Until then you still have access to your current plan."}}case jsClientSdk.SubscriptionScheduleType.BillingPeriod:{let s=e.scheduleVariables;return {line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your billing cycle will change to ",jsxRuntime.jsx("b",{children:(l=s.billingPeriod)==null?void 0:l.toLocaleLowerCase()})," ",n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",hn(Ao(e))]}):i,"."]})}}case jsClientSdk.SubscriptionScheduleType.UnitAmount:{let s=e.scheduleVariables,u=xc__default.default(t==null?void 0:t.map(({feature:P})=>P)).find(({id:P})=>P===s.featureId),{featureUnits:f,featureUnitsPlural:y}=u||{},p=s.newUnitAmount===1?f:y,g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be updated to ",jsxRuntime.jsx("b",{children:s.newUnitAmount})," ",p," ",n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",hn(Ao(e))]}):i,"."]}),h=`Until then you still have access to your current ${f} count.`;return {line1:g,line2:h}}default:return {}}}function Oa(e){return e.feature&&(e.feature.unitQuantity!==1?e.feature.unitsPlural:e.feature.units)||""}function xn(e,t){let o=[...e];o.sort((r,n)=>r.upTo?n.upTo?r.upTo-n.upTo:-1:1);for(let r of o)if(r.upTo&&t<=r.upTo)return r;return o[o.length-1]}function za(e,t,o){return t===jsClientSdk.BillingPeriod.Annually&&o?e/12:e}function Pn(e,t,o,r){let n=0;if(e.unitPrice){let i=za(e.unitPrice.amount,o,r);n+=i*t;}return e.flatPrice&&(n+=za(e.flatPrice.amount,o,r)),n}function bn(e,t,o,r){let n=t,i=0,a=0,l=[];for(;n>0&&a<e.length;){let c=e[a],{upTo:u}=c;if(Fo__default.default(u))l.push({unitQuantity:n,amount:Pn(c,n,o,r)}),n=0;else {let f=u-i,y=Math.min(n,f);l.push({unitQuantity:y,amount:Pn(c,y,o,r)}),n-=y,i=u;}a+=1;}let s=ou__default.default(l.map(({amount:c})=>c));return {breakdown:l,total:s}}function xt(e,t,o,r){if(!e.tiers)return 0;switch(e.tiersMode){case jsClientSdk.TiersMode.Volume:{let n=xn(e.tiers,t);return Pn(n,t,o,r)}case jsClientSdk.TiersMode.Graduated:return bn(e.tiers,t,o,r).total;default:return 0}}function Wt(e){return e==null?void 0:e.some(({unitPrice:t,upTo:o})=>t&&!Fo__default.default(o))}function Ha(e){return e==null?void 0:e.every(({unitPrice:t,upTo:o})=>!t||Fo__default.default(o))}function Wa(e,t){return (e==null?void 0:e[0].upTo)&&t<=e[0].upTo}function Eo({plan:e,billingPeriod:t,currentSubscription:o,currentSubscriptionOverride:r,selectDefaultTierIndex:n}){let i=e.pricePoints.filter(a=>a.billingPeriod===t&&a.isTieredPrice&&!Ot(a));if(i.length===1){let[a]=i,{featureId:l}=a.feature,s=n?n({plan:e}):0,c=a.tiers[s],u=Wt(a.tiers)?1:c.upTo||1;if(o&&o.plan.id===e.id){let y=o.prices.find(p=>{var g;return p.pricingModel===jsClientSdk.BillingModel.PerUnit&&p.tiersMode&&((g=p.feature)==null?void 0:g.featureId)===l});y&&(u=y.feature.unitQuantity||1);}if((r==null?void 0:r.planId)===e.id){let y=r.billableFeatures.find(p=>p.featureId===l);y&&(u=y.quantity);}let f={};return f[l]=u,f}return {}}function Za({perUnitQuantityByFeature:e,plan:t,currentSubscription:o,currentSubscriptionOverride:r}){var u,f;if(!o)return 0;let n=o.prices.find(y=>y.pricingModel===jsClientSdk.BillingModel.PerUnit&&y.tiersMode),i=t.id===(r==null?void 0:r.planId);if(i&&(n=(u=t.pricePoints.find(y=>y.pricingModel===jsClientSdk.BillingModel.PerUnit&&y.tiersMode))!=null?u:n),!n)return 0;let{featureId:a,unitQuantity:l}=n.feature,s=l;if(i){let y=(f=r==null?void 0:r.billableFeatures)==null?void 0:f.find(p=>p.featureId===a);y&&(s=y.quantity);}if(Fo__default.default(s))return 0;let c=e[a];return c<s?-1:c>s?1:0}var lu=chunkIL3DC53A_cjs_js.e(iu__default.default)`
20
20
  margin-left: 10px;
21
- `,cu=chunk2FMVMEMY_cjs_js.e.button`
21
+ `,cu=chunkIL3DC53A_cjs_js.e.button`
22
22
  cursor: ${({$disabled:e})=>e?"default":"pointer"};
23
23
  padding: 8px 12px;
24
24
  background-color: ${({theme:e})=>e.stigg.palette.backgroundButton};
@@ -37,12 +37,12 @@
37
37
  &:hover {
38
38
  background-color: ${({theme:e,$disabled:t})=>t?e.stigg.palette.backgroundButton:e.stigg.palette.outlinedHoverBackground};
39
39
  }
40
- `,du=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
40
+ `,du=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
41
41
  margin: 0;
42
42
  font-size: 15px;
43
- `,pu=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
43
+ `,pu=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
44
44
  min-height: 87px;
45
- `,mu=chunk2FMVMEMY_cjs_js.e.button`
45
+ `,mu=chunkIL3DC53A_cjs_js.e.button`
46
46
  background: none;
47
47
  border: none;
48
48
  padding: 0;
@@ -50,17 +50,17 @@
50
50
 
51
51
  text-decoration: underline;
52
52
  cursor: pointer;
53
- `,uu=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
53
+ `,uu=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
54
54
  margin-top: 8px;
55
55
  margin-bottom: 17px;
56
56
  min-height: 20px;
57
- `,gu=chunk2FMVMEMY_cjs_js.e.div`
57
+ `,gu=chunkIL3DC53A_cjs_js.e.div`
58
58
  display: flex;
59
59
  flex-direction: column;
60
60
  margin-top: 4px;
61
- align-self: ${({theme:e})=>chunk2FMVMEMY_cjs_js.j(e.stigg.layout.ctaAlignment)};
61
+ align-self: ${({theme:e})=>chunkIL3DC53A_cjs_js.j(e.stigg.layout.ctaAlignment)};
62
62
  width: 100%;
63
- `;function Ya({isNextPlan:e,customer:t,plan:o,billingPeriod:r,isCustomerOnTrial:n,onPlanSelected:i,paywallLocale:a,withTrialLeftRow:l,currentSubscription:s,currentSubscriptionOverride:c,perUnitQuantityByFeature:u}){let f=react.useTheme(),[y,p]=hi.useState(false),{currentPlan:g,custom:h,downgrade:P,startTrial:b,upgrade:x,startNew:A,switchToBillingPeriod:S,cancelScheduledUpdate:F}=a.planCTAButton,T=Za__default.default(P)?P(o):P,k=Za__default.default(x)?x(o):x,w={title:t?o.isLowerThanCurrentPlan?T:k:A,disabled:false,intentionType:o.isLowerThanCurrentPlan?"DOWNGRADE_PLAN":n?"UPGRADE_TRIAL_TO_PAID":"UPGRADE_PLAN"},I=o.pricingType===jsClientSdk.PricingType.Custom,{line1:E}=Io({scheduledUpdate:o.scheduledUpdate,options:{withDate:true}});if(o.isTriable&&!o.isCurrentCustomerPlan&&!n)w.title=b(o),w.intentionType="START_TRIAL";else if(o.isCurrentCustomerPlan&&!n)if(r===o.currentCustomerPlanBillingPeriod||o.pricingType&&[jsClientSdk.PricingType.Free,jsClientSdk.PricingType.Custom].includes(o.pricingType))switch(Wa({perUnitQuantityByFeature:u,plan:o,currentSubscription:s,currentSubscriptionOverride:c})){case -1:w.intentionType="CHANGE_UNIT_QUANTITY",w.title=T;break;case 1:w.intentionType="CHANGE_UNIT_QUANTITY",w.title=k;break;default:w.title=g,w.disabled=true;break}else w.title=S(r),w.intentionType="CHANGE_BILLING_PERIOD";else I&&(w.title=typeof h=="function"?h({plan:o,selectedBillingPeriod:r}):h,w.intentionType="REQUEST_CUSTOM_PLAN_ACCESS");e&&o.scheduledUpdate&&(w.disabled=false,w.title=F,w.intentionType="CANCEL_SCHEDULED_UPDATES");let L=y||w.disabled;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(gu,{className:"stigg-paywall-plan-button-layout",children:e&&E?jsxRuntime.jsxs(pu,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[E," ",jsxRuntime.jsx(mu,{color:"secondary",onClick:()=>{p(true),Promise.resolve(i(w.intentionType)).finally(()=>p(false));},children:w.title})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cu,{className:"stigg-paywall-plan-button","data-testid":`paywall-card-cta-${o.displayName}`,disabled:L,$disabled:L,onClick:()=>{p(true),Promise.resolve(i(w.intentionType)).finally(()=>p(false));},children:[jsxRuntime.jsx(du,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:w.title}),y&&jsxRuntime.jsx(lu,{color:f.stigg.palette.text.disabled,loading:true,size:16})]}),l?jsxRuntime.jsx(uu,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary",children:o.isCurrentCustomerPlan&&!Fo__default.default(o.trialDaysLeft)&&o.trialDaysLeft>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("b",{children:[o.trialDaysLeft," days"]})," left on your free trial"]})}):jsxRuntime.jsx("div",{style:{height:"20px"}})]})})})}var H=({amount:e,currency:t=jsClientSdk.Currency.Usd,locale:o,maximumFractionDigits:r=5,minimumFractionDigits:n=0,removeTrailingZero:i})=>{let a=t.toString(),l=yu__default.default(a),s=new Intl.NumberFormat(o,chunk2FMVMEMY_cjs_js.a({maximumFractionDigits:r,minimumFractionDigits:n,style:"currency",currency:a,trailingZeroDisplay:i?"stripIfInteger":"auto"},l?{currencyDisplay:"code"}:{})).format(e||0);return l&&(s=s.replace(a,l)),s=s.replace(/\s/g,""),s};function hu(e,t){var o,r;return e.blockSize&&e.blockSize>1?`for ${chunk2FMVMEMY_cjs_js.k(e.blockSize)} ${(r=(o=t.plural)!=null?o:t.units)!=null?r:""}`:`per ${t.units||""}`}function Cu(e,t,o){return zt(e)?o||1:(t==null?void 0:t[e.feature.featureId])||1}function Ka({planPrices:e,paywallCalculatedPrice:t,selectedBillingPeriod:o,locale:r,shouldShowMonthlyPriceAmount:n,paywallLocale:i,perUnitQuantityByFeature:a,creditChargeQuantity:l}){var A,S,F,T,k,w;let s=e.filter(I=>Ct(I)),c=t||s[0];if(!c)return {price:"",unit:"",tiers:void 0,tierUnits:void 0};let{amount:u,currency:f}=c,y=u||0,p=s.length===1,g=o===jsClientSdk.BillingPeriod.Annually&&n?y/12:y,h,P,b=i.price.pricePeriod(n?jsClientSdk.BillingPeriod.Monthly:jsClientSdk.BillingPeriod.Annually),x=b;for(let I of s)if(I.isTieredPrice&&I.tiers){let E=Cu(I,a,l);h=I.tiers,P=za(I),g+=xt(I,E,o,n);}if(p&&s[0]){let I=s[0],E=zt(I)?{units:(S=(A=I.customCurrency)==null?void 0:A.units)==null?void 0:S.singular,plural:(T=(F=I.customCurrency)==null?void 0:F.units)==null?void 0:T.plural}:{units:(k=I.feature)==null?void 0:k.units,plural:(w=I.feature)==null?void 0:w.unitsPlural},L=hu(I,E);I.pricingModel===jsClientSdk.BillingModel.PerUnit&&!I.isTieredPrice?x=`${L} ${b}`:I.pricingModel===jsClientSdk.BillingModel.UsageBased&&(x=L);}return {price:H({amount:g,currency:f,locale:r,minimumFractionDigits:2,removeTrailingZero:true}),unit:x,tiers:h,tierUnits:P}}function vo(e,t,o,r,n,i,a){var l;switch(e.pricingType){case jsClientSdk.PricingType.Free:return typeof o.price.free=="function"?o.price.free(e.paywallCurrency):o.price.free;case jsClientSdk.PricingType.Custom:return {price:typeof o.price.custom=="function"?o.price.custom({plan:e,selectedBillingPeriod:t}):o.price.custom};case jsClientSdk.PricingType.Paid:{let s=e.pricePoints.filter(f=>f.billingPeriod===t),c=(l=e.paywallCalculatedPricePoints)==null?void 0:l.find(f=>f.billingPeriod===t);if(!(s!=null&&s.length)&&!c)return {price:o.price.priceNotSet};let u={planPrices:s,paywallCalculatedPrice:c,selectedBillingPeriod:t,perUnitQuantityByFeature:i||{},creditChargeQuantity:a};return o.price.paid?o.price.paid(chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},u),{plan:e})):Ka(chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},u),{locale:r,shouldShowMonthlyPriceAmount:n,paywallLocale:o}))}default:return {price:""}}}var xu=chunk2FMVMEMY_cjs_js.e(Pu__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
63
+ `;function Qa({isNextPlan:e,customer:t,plan:o,billingPeriod:r,isCustomerOnTrial:n,onPlanSelected:i,paywallLocale:a,withTrialLeftRow:l,currentSubscription:s,currentSubscriptionOverride:c,perUnitQuantityByFeature:u}){let f=react.useTheme(),[y,p]=hi.useState(false),{currentPlan:g,custom:h,downgrade:P,startTrial:b,upgrade:x,startNew:A,switchToBillingPeriod:S,cancelScheduledUpdate:F}=a.planCTAButton,T=Ya__default.default(P)?P(o):P,k=Ya__default.default(x)?x(o):x,w={title:t?o.isLowerThanCurrentPlan?T:k:A,disabled:false,intentionType:o.isLowerThanCurrentPlan?"DOWNGRADE_PLAN":n?"UPGRADE_TRIAL_TO_PAID":"UPGRADE_PLAN"},I=o.pricingType===jsClientSdk.PricingType.Custom,{line1:E}=Io({scheduledUpdate:o.scheduledUpdate,options:{withDate:true}});if(o.isTriable&&!o.isCurrentCustomerPlan&&!n)w.title=b(o),w.intentionType="START_TRIAL";else if(o.isCurrentCustomerPlan&&!n)if(r===o.currentCustomerPlanBillingPeriod||o.pricingType&&[jsClientSdk.PricingType.Free,jsClientSdk.PricingType.Custom].includes(o.pricingType))switch(Za({perUnitQuantityByFeature:u,plan:o,currentSubscription:s,currentSubscriptionOverride:c})){case -1:w.intentionType="CHANGE_UNIT_QUANTITY",w.title=T;break;case 1:w.intentionType="CHANGE_UNIT_QUANTITY",w.title=k;break;default:w.title=g,w.disabled=true;break}else w.title=S(r),w.intentionType="CHANGE_BILLING_PERIOD";else I&&(w.title=typeof h=="function"?h({plan:o,selectedBillingPeriod:r}):h,w.intentionType="REQUEST_CUSTOM_PLAN_ACCESS");e&&o.scheduledUpdate&&(w.disabled=false,w.title=F,w.intentionType="CANCEL_SCHEDULED_UPDATES");let L=y||w.disabled;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(gu,{className:"stigg-paywall-plan-button-layout",children:e&&E?jsxRuntime.jsxs(pu,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[E," ",jsxRuntime.jsx(mu,{color:"secondary",onClick:()=>{p(true),Promise.resolve(i(w.intentionType)).finally(()=>p(false));},children:w.title})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cu,{className:"stigg-paywall-plan-button","data-testid":`paywall-card-cta-${o.displayName}`,disabled:L,$disabled:L,onClick:()=>{p(true),Promise.resolve(i(w.intentionType)).finally(()=>p(false));},children:[jsxRuntime.jsx(du,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:w.title}),y&&jsxRuntime.jsx(lu,{color:f.stigg.palette.text.disabled,loading:true,size:16})]}),l?jsxRuntime.jsx(uu,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary",children:o.isCurrentCustomerPlan&&!Fo__default.default(o.trialDaysLeft)&&o.trialDaysLeft>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("b",{children:[o.trialDaysLeft," days"]})," left on your free trial"]})}):jsxRuntime.jsx("div",{style:{height:"20px"}})]})})})}var H=({amount:e,currency:t=jsClientSdk.Currency.Usd,locale:o,maximumFractionDigits:r=5,minimumFractionDigits:n=0,removeTrailingZero:i})=>{let a=t.toString(),l=yu__default.default(a),s=new Intl.NumberFormat(o,chunkIL3DC53A_cjs_js.a({maximumFractionDigits:r,minimumFractionDigits:n,style:"currency",currency:a,trailingZeroDisplay:i?"stripIfInteger":"auto"},l?{currencyDisplay:"code"}:{})).format(e||0);return l&&(s=s.replace(a,l)),s=s.replace(/\s/g,""),s};function hu(e,t){var o,r;return e.blockSize&&e.blockSize>1?`for ${chunkIL3DC53A_cjs_js.k(e.blockSize)} ${(r=(o=t.plural)!=null?o:t.units)!=null?r:""}`:`per ${t.units||""}`}function Cu(e,t,o){return zt(e)?o||1:(t==null?void 0:t[e.feature.featureId])||1}function qa({planPrices:e,paywallCalculatedPrice:t,selectedBillingPeriod:o,locale:r,shouldShowMonthlyPriceAmount:n,paywallLocale:i,perUnitQuantityByFeature:a,creditChargeQuantity:l}){var A,S,F,T,k,w;let s=e.filter(I=>Ct(I)),c=t||s[0];if(!c)return {price:"",unit:"",tiers:void 0,tierUnits:void 0};let{amount:u,currency:f}=c,y=u||0,p=s.length===1,g=o===jsClientSdk.BillingPeriod.Annually&&n?y/12:y,h,P,b=i.price.pricePeriod(n?jsClientSdk.BillingPeriod.Monthly:jsClientSdk.BillingPeriod.Annually),x=b;for(let I of s)if(I.isTieredPrice&&I.tiers){let E=Cu(I,a,l);h=I.tiers,P=Oa(I),g+=xt(I,E,o,n);}if(p&&s[0]){let I=s[0],E=zt(I)?{units:(S=(A=I.customCurrency)==null?void 0:A.units)==null?void 0:S.singular,plural:(T=(F=I.customCurrency)==null?void 0:F.units)==null?void 0:T.plural}:{units:(k=I.feature)==null?void 0:k.units,plural:(w=I.feature)==null?void 0:w.unitsPlural},L=hu(I,E);I.pricingModel===jsClientSdk.BillingModel.PerUnit&&!I.isTieredPrice?x=`${L} ${b}`:I.pricingModel===jsClientSdk.BillingModel.UsageBased&&(x=L);}return {price:H({amount:g,currency:f,locale:r,minimumFractionDigits:2,removeTrailingZero:true}),unit:x,tiers:h,tierUnits:P}}function vo(e,t,o,r,n,i,a){var l;switch(e.pricingType){case jsClientSdk.PricingType.Free:return typeof o.price.free=="function"?o.price.free(e.paywallCurrency):o.price.free;case jsClientSdk.PricingType.Custom:return {price:typeof o.price.custom=="function"?o.price.custom({plan:e,selectedBillingPeriod:t}):o.price.custom};case jsClientSdk.PricingType.Paid:{let s=e.pricePoints.filter(f=>f.billingPeriod===t),c=(l=e.paywallCalculatedPricePoints)==null?void 0:l.find(f=>f.billingPeriod===t);if(!(s!=null&&s.length)&&!c)return {price:o.price.priceNotSet};let u={planPrices:s,paywallCalculatedPrice:c,selectedBillingPeriod:t,perUnitQuantityByFeature:i||{},creditChargeQuantity:a};return o.price.paid?o.price.paid(chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},u),{plan:e})):qa(chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},u),{locale:r,shouldShowMonthlyPriceAmount:n,paywallLocale:o}))}default:return {price:""}}}var xu=chunkIL3DC53A_cjs_js.e(Pu__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
64
64
  border-radius: 10px;
65
65
  text-transform: none;
66
66
  font-weight: 300;
@@ -71,10 +71,10 @@
71
71
  &:hover {
72
72
  background-color: ${({theme:e,$success:t,$error:o})=>t?e.stigg.palette.successDark:o?e.stigg.palette.errorDark:""};
73
73
  }
74
- `,te=o=>{var r=o,{variant:e="outlined"}=r,t=chunk2FMVMEMY_cjs_js.c(r,["variant"]);return jsxRuntime.jsx(xu,chunk2FMVMEMY_cjs_js.a({variant:e},t))};var pe=chunk2FMVMEMY_cjs_js.e(Su__default.default)(({theme:e})=>({"& .MuiOutlinedInput-root":{height:"42px",borderRadius:e.stigg.border.radius,fieldset:{borderColor:e.stigg.palette.outlinedBorder},"&:not(.Mui-focused):hover fieldset":{borderColor:e.stigg.palette.outlinedRestingBorder}},"& .MuiInputBase-input":chunk2FMVMEMY_cjs_js.a({padding:"8px 12px",borderRadius:e.stigg.border.radius,fontFamily:e.stigg.typography.fontFamily,color:e.stigg.palette.text.primary},e.stigg.typography.body),"& .Mui-error":{fontFamily:e.stigg.typography.fontFamily},"& .MuiFormHelperText-root":{whiteSpace:"nowrap"}}));var qa=chunk2FMVMEMY_cjs_js.e(Re__default.default)`
74
+ `,te=o=>{var r=o,{variant:e="outlined"}=r,t=chunkIL3DC53A_cjs_js.c(r,["variant"]);return jsxRuntime.jsx(xu,chunkIL3DC53A_cjs_js.a({variant:e},t))};var pe=chunkIL3DC53A_cjs_js.e(Su__default.default)(({theme:e})=>({"& .MuiOutlinedInput-root":{height:"42px",borderRadius:e.stigg.border.radius,fieldset:{borderColor:e.stigg.palette.outlinedBorder},"&:not(.Mui-focused):hover fieldset":{borderColor:e.stigg.palette.outlinedRestingBorder}},"& .MuiInputBase-input":chunkIL3DC53A_cjs_js.a({padding:"8px 12px",borderRadius:e.stigg.border.radius,fontFamily:e.stigg.typography.fontFamily,color:e.stigg.palette.text.primary},e.stigg.typography.body),"& .Mui-error":{fontFamily:e.stigg.typography.fontFamily},"& .MuiFormHelperText-root":{whiteSpace:"nowrap"}}));var Ja=chunkIL3DC53A_cjs_js.e(Re__default.default)`
75
75
  display: flex;
76
76
  flex-direction: column;
77
- `;function Ja(){return jsxRuntime.jsxs(qa,{container:true,children:[jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.l,{item:true,$gap:48,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:120,height:20})]}),jsxRuntime.jsx(Nl__default.default,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxRuntime.jsxs(qa,{item:true,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:120,height:20}),jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.m,{$gap:16,marginTop:3,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{height:20}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{height:20})]}),jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.l,{$gap:130,marginTop:3,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.n,{flex:1,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{height:20})}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.n,{flex:3,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{height:20})})]})]})]})}var bt=e=>e.target.blur();function Xa({width:e,tierUnits:t,value:o,handleChange:r,errorMessage:n}){return jsxRuntime.jsx(pe,{type:"number",onWheel:bt,fullWidth:true,error:!!n,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsxRuntime.jsx(wu__default.default,{position:"end",children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary",children:t})})},value:o,onChange:i=>{var l,s;let a=(l=i==null?void 0:i.target)!=null&&l.value?Number((s=i==null?void 0:i.target)==null?void 0:s.value):null;a&&r(a);}})}var Eu=chunk2FMVMEMY_cjs_js.e(Au__default.default)`
77
+ `;function Xa(){return jsxRuntime.jsxs(Ja,{container:true,children:[jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.l,{item:true,$gap:48,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:120,height:20})]}),jsxRuntime.jsx(Ml__default.default,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxRuntime.jsxs(Ja,{item:true,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:120,height:20}),jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.m,{$gap:16,marginTop:3,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{height:20}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{height:20})]}),jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.l,{$gap:130,marginTop:3,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.n,{flex:1,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{height:20})}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.n,{flex:3,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{height:20})})]})]})]})}var bt=e=>e.target.blur();function ja({width:e,tierUnits:t,value:o,handleChange:r,errorMessage:n}){return jsxRuntime.jsx(pe,{type:"number",onWheel:bt,fullWidth:true,error:!!n,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsxRuntime.jsx(wu__default.default,{position:"end",children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary",children:t})})},value:o,onChange:i=>{var l,s;let a=(l=i==null?void 0:i.target)!=null&&l.value?Number((s=i==null?void 0:i.target)==null?void 0:s.value):null;a&&r(a);}})}var Eu=chunkIL3DC53A_cjs_js.e(Au__default.default)`
78
78
  border-radius: 10px;
79
79
  min-height: 42px;
80
80
  min-width: 120px;
@@ -82,7 +82,7 @@
82
82
  &:hover .MuiOutlinedInput-notchedOutline {
83
83
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
84
84
  }
85
- `,vu=chunk2FMVMEMY_cjs_js.e(Bu__default.default)`
85
+ `,vu=chunkIL3DC53A_cjs_js.e(Bu__default.default)`
86
86
  & .MuiInputBase-input {
87
87
  padding: 10px 12px;
88
88
  }
@@ -90,34 +90,34 @@
90
90
  &.Mui-focused .MuiOutlinedInput-notchedOutline {
91
91
  border-color: ${({theme:e})=>e.stigg.palette.primary} !important;
92
92
  }
93
- `;function ja({value:e,componentId:t,tierUnits:o,tiers:r,handleChange:n,errorMessage:i}){return r?jsxRuntime.jsx(Eu,{value:e.toString(),fullWidth:true,error:!!i,onChange:a=>{var s,c;let l=(s=a==null?void 0:a.target)!=null&&s.value?Number((c=a==null?void 0:a.target)==null?void 0:c.value):null;l&&n(l);},id:t,input:jsxRuntime.jsx(vu,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:Fu__default.default(r,a=>{var l;return jsxRuntime.jsx(Iu__default.default,{className:"stigg-price-tier-menu-item-text",value:(l=a.upTo)==null?void 0:l.toString(),children:jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary",style:{lineHeight:"unset"},children:[se(a.upTo)," ",o]})},a.upTo)})}):null}var Mu=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
93
+ `;function es({value:e,componentId:t,tierUnits:o,tiers:r,handleChange:n,errorMessage:i}){return r?jsxRuntime.jsx(Eu,{value:e.toString(),fullWidth:true,error:!!i,onChange:a=>{var s,c;let l=(s=a==null?void 0:a.target)!=null&&s.value?Number((c=a==null?void 0:a.target)==null?void 0:c.value):null;l&&n(l);},id:t,input:jsxRuntime.jsx(vu,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:Fu__default.default(r,a=>{var l;return jsxRuntime.jsx(Iu__default.default,{className:"stigg-price-tier-menu-item-text",value:(l=a.upTo)==null?void 0:l.toString(),children:jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary",style:{lineHeight:"unset"},children:[se(a.upTo)," ",o]})},a.upTo)})}):null}var Mu=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
94
94
  min-height: 46px;
95
- `;function Kt(e){let{tiers:t,errorMessage:o}=e;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",justifyContent:"center",style:{width:"100%"},children:[jsxRuntime.jsx(Mu,{as:"div",className:"stigg-price-tier-select",children:Wt(t)?jsxRuntime.jsx(Xa,chunk2FMVMEMY_cjs_js.a({},e)):jsxRuntime.jsx(ja,chunk2FMVMEMY_cjs_js.a({},e))}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{style:{margin:"4px"},variant:"caption",color:"error",children:o})]})})}var _u=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
95
+ `;function Kt(e){let{tiers:t,errorMessage:o}=e;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",justifyContent:"center",style:{width:"100%"},children:[jsxRuntime.jsx(Mu,{as:"div",className:"stigg-price-tier-select",children:Wt(t)?jsxRuntime.jsx(ja,chunkIL3DC53A_cjs_js.a({},e)):jsxRuntime.jsx(es,chunkIL3DC53A_cjs_js.a({},e))}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{style:{margin:"4px"},variant:"caption",color:"error",children:o})]})})}var _u=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
96
96
  word-break: break-word;
97
97
  width: 100%;
98
- `,Du=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
98
+ `,Du=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
99
99
  white-space: nowrap;
100
- `,$u=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
100
+ `,$u=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
101
101
  white-space: normal;
102
102
  min-height: 39px;
103
- `;function Gu({plan:e,billingPeriod:t,hasMonthlyPrice:o,hasAnnuallyPrice:r,paywallLocale:n}){var l,s;let i=e.pricePoints.find(c=>c.billingPeriod===t),a="\u200E";return i&&o&&r&&(a=((s=(l=n.price).billingPeriod)==null?void 0:s.call(l,t))||`, billed ${t.toLowerCase()}`),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{as:"span",className:"stigg-price-billing-period-text",variant:"h6",color:"secondary",children:a})}var os=({showStartingAt:e,withUnitPriceRow:t,withStartingAtRow:o,withTiersRow:r,withCreditChargeRow:n,creditChargePrice:i,selectedCreditQuantity:a,setSelectedCreditQuantity:l,plan:s,billingPeriod:c,paywallLocale:u,locale:f,hasMonthlyPrice:y,hasAnnuallyPrice:p,perUnitQuantityByFeature:g,setPerUnitQuantityByFeature:h})=>{var w;let{price:P,unit:b,tiers:x,tierUnits:A}=vo(s,c,u,f,y,g,a),S=s.pricePoints.find(I=>I.billingPeriod===c&&I.isTieredPrice&&!Ot(I)),F=S?S.feature.featureId:void 0,T=(w=g[F||""])!=null?w:1,k=I=>{F&&h(E=>chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},E),{[F]:I}));};return jsxRuntime.jsx(_u,{as:"div",className:"stigg-price-text",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary",children:e?u.price.startingAtCaption:"\u200E"}),jsxRuntime.jsx($u,{className:"stigg-price-point",variant:"h1",children:P}),t&&jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"},children:[jsxRuntime.jsx(Du,{className:"stigg-price-unit-text",as:"span",variant:"h6",color:"secondary",children:b}),jsxRuntime.jsx(Gu,{plan:s,billingPeriod:c,hasAnnuallyPrice:p,hasMonthlyPrice:y,paywallLocale:u})]}),r?jsxRuntime.jsx(Kt,{componentId:`${s.id}_${F}_tier`,tiers:x,tierUnits:A,tiersMode:S==null?void 0:S.tiersMode,handleChange:k,value:T}):null,n?i?jsxRuntime.jsx(Kt,{componentId:`${s.id}_${i.topUpCustomCurrencyId}_credit_tier`,tiers:i.tiers,tierUnits:Ma(i),tiersMode:i.tiersMode,handleChange:l,value:a}):jsxRuntime.jsx("div",{style:{minHeight:"46px",opacity:0}}):null]})})};var Zu=chunk2FMVMEMY_cjs_js.e(Pu__default.default)`
103
+ `;function Gu({plan:e,billingPeriod:t,hasMonthlyPrice:o,hasAnnuallyPrice:r,paywallLocale:n}){var l,s;let i=e.pricePoints.find(c=>c.billingPeriod===t),a="\u200E";return i&&o&&r&&(a=((s=(l=n.price).billingPeriod)==null?void 0:s.call(l,t))||`, billed ${t.toLowerCase()}`),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{as:"span",className:"stigg-price-billing-period-text",variant:"h6",color:"secondary",children:a})}var rs=({showStartingAt:e,withUnitPriceRow:t,withStartingAtRow:o,withTiersRow:r,withCreditChargeRow:n,creditChargePrice:i,selectedCreditQuantity:a,setSelectedCreditQuantity:l,plan:s,billingPeriod:c,paywallLocale:u,locale:f,hasMonthlyPrice:y,hasAnnuallyPrice:p,perUnitQuantityByFeature:g,setPerUnitQuantityByFeature:h})=>{var w;let{price:P,unit:b,tiers:x,tierUnits:A}=vo(s,c,u,f,y,g,a),S=s.pricePoints.find(I=>I.billingPeriod===c&&I.isTieredPrice&&!Ot(I)),F=S?S.feature.featureId:void 0,T=(w=g[F||""])!=null?w:1,k=I=>{F&&h(E=>chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},E),{[F]:I}));};return jsxRuntime.jsx(_u,{as:"div",className:"stigg-price-text",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary",children:e?u.price.startingAtCaption:"\u200E"}),jsxRuntime.jsx($u,{className:"stigg-price-point",variant:"h1",children:P}),t&&jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"},children:[jsxRuntime.jsx(Du,{className:"stigg-price-unit-text",as:"span",variant:"h6",color:"secondary",children:b}),jsxRuntime.jsx(Gu,{plan:s,billingPeriod:c,hasAnnuallyPrice:p,hasMonthlyPrice:y,paywallLocale:u})]}),r?jsxRuntime.jsx(Kt,{componentId:`${s.id}_${F}_tier`,tiers:x,tierUnits:A,tiersMode:S==null?void 0:S.tiersMode,handleChange:k,value:T}):null,n?i?jsxRuntime.jsx(Kt,{componentId:`${s.id}_${i.topUpCustomCurrencyId}_credit_tier`,tiers:i.tiers,tierUnits:Ra(i),tiersMode:i.tiersMode,handleChange:l,value:a}):jsxRuntime.jsx("div",{style:{minHeight:"46px",opacity:0}}):null]})})};var Zu=chunkIL3DC53A_cjs_js.e(Pu__default.default)`
104
104
  padding: 0px;
105
105
  text-transform: none;
106
106
  margin-left: 0px;
107
- `,Yu=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
107
+ `,Yu=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
108
108
  font-size: 14px;
109
109
  font-weight: 500;
110
- `,Qu=chunk2FMVMEMY_cjs_js.e.div`
110
+ `,Qu=chunkIL3DC53A_cjs_js.e.div`
111
111
  width: 100%;
112
112
  gap: 10px;
113
- `,Ku=chunk2FMVMEMY_cjs_js.e.div`
113
+ `,Ku=chunkIL3DC53A_cjs_js.e.div`
114
114
  margin-top: 10px;
115
115
  overflow: hidden;
116
116
  display: flex;
117
117
  flex-direction: column;
118
118
  gap: 4px;
119
119
  width: 100%;
120
- `,qu=chunk2FMVMEMY_cjs_js.e.div`
120
+ `,qu=chunkIL3DC53A_cjs_js.e.div`
121
121
  display: flex;
122
122
  flex-direction: row;
123
123
  flex-wrap: nowrap;
@@ -126,7 +126,7 @@
126
126
  padding: 8px 0px;
127
127
  max-height: 44px;
128
128
  gap: 16px;
129
- `,Ju=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
129
+ `,Ju=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
130
130
  overflow: hidden;
131
131
  font-feature-settings:
132
132
  'liga' off,
@@ -137,17 +137,17 @@
137
137
  white-space: nowrap;
138
138
  min-width: 0;
139
139
  flex-shrink: 1;
140
- `,Xu=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.i)`
140
+ `,Xu=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.i)`
141
141
  width: 24px;
142
142
  height: 24px;
143
143
  color: ${({theme:e})=>e.stigg.palette.primary};
144
- `,ju=chunk2FMVMEMY_cjs_js.e.div`
144
+ `,ju=chunkIL3DC53A_cjs_js.e.div`
145
145
  flex: 1;
146
146
  min-width: 0;
147
- `,eg=chunk2FMVMEMY_cjs_js.e.div`
147
+ `,eg=chunkIL3DC53A_cjs_js.e.div`
148
148
  margin-top: 16px;
149
149
  display: flex;
150
- `,In=4;function Fn({addons:e,paywallLocale:t}){let[o,r]=hi.useState(false);if(!e||e.length===0)return null;let n=e.filter(l=>{var s;return !((s=l.hiddenFromWidgets)!=null&&s.includes(jsClientSdk.WidgetType.Paywall))}),i=()=>{r(!o);},a=o?n:n.slice(0,In);return a.length===0?null:jsxRuntime.jsxs(Qu,{className:"stigg-compatible-addons-container",children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-compatible-addons-header",color:"secondary",variant:"body1",bold:true,children:t.addonsTitle}),jsxRuntime.jsx(Ku,{className:"stigg-compatible-addons-list",children:a.map(l=>jsxRuntime.jsxs(qu,{className:Wu__default.default(`stigg-compatible-addon--${l.id}`,"stigg-compatible-addon-item"),children:[jsxRuntime.jsx(Xu,{icon:"Add",className:"stigg-compatible-addon-icon"}),jsxRuntime.jsx(ju,{className:"stigg-compatible-addon-content",children:jsxRuntime.jsx(Ju,{variant:"body1",color:"primary",className:"stigg-compatible-addon-name",children:l.displayName})})]},l.id))}),n.length>In&&jsxRuntime.jsx(eg,{children:jsxRuntime.jsx(Zu,{variant:"text",onClick:i,children:jsxRuntime.jsx(Yu,{color:"primary.main",children:o?"Show less":`Show ${n.length-In} more`})})})]})}var ig="66px",ag=chunk2FMVMEMY_cjs_js.e.div`
150
+ `,In=4;function Fn({addons:e,paywallLocale:t}){let[o,r]=hi.useState(false);if(!e||e.length===0)return null;let n=e.filter(l=>{var s;return !((s=l.hiddenFromWidgets)!=null&&s.includes(jsClientSdk.WidgetType.Paywall))}),i=()=>{r(!o);},a=o?n:n.slice(0,In);return a.length===0?null:jsxRuntime.jsxs(Qu,{className:"stigg-compatible-addons-container",children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-compatible-addons-header",color:"secondary",variant:"body1",bold:true,children:t.addonsTitle}),jsxRuntime.jsx(Ku,{className:"stigg-compatible-addons-list",children:a.map(l=>jsxRuntime.jsxs(qu,{className:Wu__default.default(`stigg-compatible-addon--${l.id}`,"stigg-compatible-addon-item"),children:[jsxRuntime.jsx(Xu,{icon:"Add",className:"stigg-compatible-addon-icon"}),jsxRuntime.jsx(ju,{className:"stigg-compatible-addon-content",children:jsxRuntime.jsx(Ju,{variant:"body1",color:"primary",className:"stigg-compatible-addon-name",children:l.displayName})})]},l.id))}),n.length>In&&jsxRuntime.jsx(eg,{children:jsxRuntime.jsx(Zu,{variant:"text",onClick:i,children:jsxRuntime.jsx(Yu,{color:"primary.main",children:o?"Show less":`Show ${n.length-In} more`})})})]})}var ig="66px",ag=chunkIL3DC53A_cjs_js.e.div`
151
151
  position: relative;
152
152
  background-color: ${({theme:e,$isCurrentPlan:t})=>t?e.stigg.palette.backgroundHighlight:e.stigg.palette.backgroundPaper};
153
153
  border: ${({theme:e,$isHighlighted:t})=>t?`3px solid ${e.stigg.palette.primary}`:`1px solid ${e.stigg.palette.outlinedBorder}`};
@@ -160,38 +160,38 @@
160
160
  align-items: flex-start;
161
161
  justify-content: flex-start;
162
162
  position: relative;
163
- `,sg=chunk2FMVMEMY_cjs_js.e.div`
163
+ `,sg=chunkIL3DC53A_cjs_js.e.div`
164
164
  margin-top: ${({$planHasEntitlements:e})=>e?"32px":"0px"};
165
- `,lg=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
165
+ `,lg=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
166
166
  padding-bottom: 8px;
167
- `,cg=chunk2FMVMEMY_cjs_js.e.div`
167
+ `,cg=chunkIL3DC53A_cjs_js.e.div`
168
168
  height: 2px;
169
169
  width: 100%;
170
170
  background-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
171
171
  margin-bottom: 40px;
172
- `,dg=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
172
+ `,dg=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
173
173
  text-align: ${({theme:e})=>e.stigg.layout.descriptionAlignment};
174
174
  min-height: ${({theme:e})=>e.stigg.layout.descriptionMinHeight};
175
- `,pg=chunk2FMVMEMY_cjs_js.e.div`
175
+ `,pg=chunkIL3DC53A_cjs_js.e.div`
176
176
  background-color: ${({theme:e})=>e.stigg.palette.primary};
177
177
  border-radius: 40px;
178
178
  position: absolute;
179
179
  top: -12px;
180
- `,mg=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
180
+ `,mg=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
181
181
  margin: 0;
182
182
  padding: 2px 8px;
183
- `,ug=chunk2FMVMEMY_cjs_js.e.div`
183
+ `,ug=chunkIL3DC53A_cjs_js.e.div`
184
184
  width: 100%;
185
185
  display: flex;
186
186
  flex-direction: column;
187
- align-items: ${({theme:e})=>chunk2FMVMEMY_cjs_js.j(e.stigg.layout.headerAlignment)};
188
- `,gg=chunk2FMVMEMY_cjs_js.e.div`
187
+ align-items: ${({theme:e})=>chunkIL3DC53A_cjs_js.j(e.stigg.layout.headerAlignment)};
188
+ `,gg=chunkIL3DC53A_cjs_js.e.div`
189
189
  position: absolute;
190
190
  top: 0;
191
191
  background-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
192
192
  border-radius: 0px 0px 10px 10px;
193
193
  padding: 3px 12px;
194
- `,fg=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.g)`
194
+ `,fg=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.g)`
195
195
  display: flex;
196
196
  height: 100%;
197
197
  margin-right: 4px;
@@ -199,7 +199,7 @@
199
199
  path {
200
200
  fill: ${({theme:e})=>e.stigg.palette.text.primary};
201
201
  }
202
- `;function yg({text:e="Next",iconsColor:t}){return jsxRuntime.jsx(gg,{children:jsxRuntime.jsxs(Re__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsx(fg,{$iconsColor:t}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:"primary",variant:"body1",children:e})]})})}function is({withUnitPriceRow:e,withTiersRow:t,withTrialLeftRow:o,withCreditChargeRow:r,customer:n,plan:i,billingPeriod:a,isHighlighted:l,currentSubscription:s,currentSubscriptionOverride:c,shouldShowDescriptionSection:u,hasMonthlyPrice:f,hasAnnuallyPrice:y,isCustomerOnTrial:p,onPlanSelected:g,paywallLocale:h,locale:P,withStartingAtRow:b,isCustomerInCustomPlan:x,selectDefaultTierIndex:A,hideCompatibleAddons:S}){var ut,z,ie;let F=i.isNextPlan&&i.isNextPlan(a),T=i.pricePoints.filter(ae=>ae.billingPeriod===a&&Ct(ae)),k=(ut=i.paywallCalculatedPricePoints)==null?void 0:ut.find(ae=>ae.billingPeriod===a),w=T.length>1&&!!(k!=null&&k.additionalChargesMayApply),I=!x||i.pricingType===jsClientSdk.PricingType.Custom,E=ko(i,a),L=E?wo(E):false,N=null;F?N=jsxRuntime.jsx(yg,{text:"Next plan"}):l&&h.highlightChip&&(N=jsxRuntime.jsx(pg,{className:"stigg-highlight-badge",children:jsxRuntime.jsx(mg,{className:"stigg-highlight-badge-text",color:"white",bold:true,children:h.highlightChip})}));let[$,R]=hi.useState(()=>Eo({plan:i,billingPeriod:a,currentSubscription:s,currentSubscriptionOverride:c,selectDefaultTierIndex:A})),[V,K]=hi.useState(()=>{var ae,Ee;return ((Ee=(ae=E==null?void 0:E.tiers)==null?void 0:ae[0])==null?void 0:Ee.upTo)||1});hi.useEffect(()=>{var ae,Ee;K(((Ee=(ae=E==null?void 0:E.tiers)==null?void 0:ae[0])==null?void 0:Ee.upTo)||1);},[a,E==null?void 0:E.tiers]);let Oe=ae=>{let Ee=Object.keys($).map(gt=>({featureId:gt,quantity:$[gt]})),ho=E!=null&&E.topUpCustomCurrencyId?[{topUpCustomCurrencyId:E.topUpCustomCurrencyId,quantity:V}]:void 0;return g(ae,Ee,ho)};return jsxRuntime.jsxs(ag,{className:Wu__default.default(`stigg-${i.id}`,"stigg-plan-offering-container",{"stigg-current-plan":i.isCurrentCustomerPlan}),$isHighlighted:l,$isCurrentPlan:i.isCurrentCustomerPlan,children:[N,jsxRuntime.jsxs(ug,{className:"stigg-header-wrapper",children:[jsxRuntime.jsx(lg,{className:"stigg-plan-header",variant:"h3",children:i.displayName}),u&&jsxRuntime.jsx(dg,{className:"stigg-plan-description",variant:"h6",color:"secondary",children:i.description}),jsxRuntime.jsx(os,{showStartingAt:w,withUnitPriceRow:e,withStartingAtRow:b,withTiersRow:t,withCreditChargeRow:r,creditChargePrice:L?E:void 0,selectedCreditQuantity:V,setSelectedCreditQuantity:K,plan:i,billingPeriod:a,paywallLocale:h,locale:P,hasAnnuallyPrice:y,hasMonthlyPrice:f,setPerUnitQuantityByFeature:R,perUnitQuantityByFeature:$}),I?jsxRuntime.jsx(Ya,{isNextPlan:F,customer:n,plan:i,currentSubscription:s,currentSubscriptionOverride:c,billingPeriod:a,isCustomerOnTrial:p,onPlanSelected:Oe,paywallLocale:h,withTrialLeftRow:o,perUnitQuantityByFeature:$}):jsxRuntime.jsx("div",{style:{height:ig}}),jsxRuntime.jsx(cg,{className:"stigg-plan-header-divider"})]}),jsxRuntime.jsx(Da,{plan:i,billingPeriod:a,paywallLocale:h,singleTierCreditCharge:L?void 0:E}),jsxRuntime.jsx(sg,{$planHasEntitlements:((ie=(z=i.packageEntitlements)==null?void 0:z.length)!=null?ie:0)>0,className:"stigg-addons-container",children:!S&&i.compatibleAddons&&i.compatibleAddons.length>0&&jsxRuntime.jsx(Fn,{addons:i.compatibleAddons,paywallLocale:h})})]})}var Cg=chunk2FMVMEMY_cjs_js.e.div`
202
+ `;function yg({text:e="Next",iconsColor:t}){return jsxRuntime.jsx(gg,{children:jsxRuntime.jsxs(Re__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsx(fg,{$iconsColor:t}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:"primary",variant:"body1",children:e})]})})}function as({withUnitPriceRow:e,withTiersRow:t,withTrialLeftRow:o,withCreditChargeRow:r,customer:n,plan:i,billingPeriod:a,isHighlighted:l,currentSubscription:s,currentSubscriptionOverride:c,shouldShowDescriptionSection:u,hasMonthlyPrice:f,hasAnnuallyPrice:y,isCustomerOnTrial:p,onPlanSelected:g,paywallLocale:h,locale:P,withStartingAtRow:b,isCustomerInCustomPlan:x,selectDefaultTierIndex:A,hideCompatibleAddons:S}){var ut,z,ie;let F=i.isNextPlan&&i.isNextPlan(a),T=i.pricePoints.filter(ae=>ae.billingPeriod===a&&Ct(ae)),k=(ut=i.paywallCalculatedPricePoints)==null?void 0:ut.find(ae=>ae.billingPeriod===a),w=T.length>1&&!!(k!=null&&k.additionalChargesMayApply),I=!x||i.pricingType===jsClientSdk.PricingType.Custom,E=ko(i,a),L=E?wo(E):false,N=null;F?N=jsxRuntime.jsx(yg,{text:"Next plan"}):l&&h.highlightChip&&(N=jsxRuntime.jsx(pg,{className:"stigg-highlight-badge",children:jsxRuntime.jsx(mg,{className:"stigg-highlight-badge-text",color:"white",bold:true,children:h.highlightChip})}));let[$,R]=hi.useState(()=>Eo({plan:i,billingPeriod:a,currentSubscription:s,currentSubscriptionOverride:c,selectDefaultTierIndex:A})),[V,K]=hi.useState(()=>{var ae,Ee;return ((Ee=(ae=E==null?void 0:E.tiers)==null?void 0:ae[0])==null?void 0:Ee.upTo)||1});hi.useEffect(()=>{var ae,Ee;K(((Ee=(ae=E==null?void 0:E.tiers)==null?void 0:ae[0])==null?void 0:Ee.upTo)||1);},[a,E==null?void 0:E.tiers]);let Oe=ae=>{let Ee=Object.keys($).map(gt=>({featureId:gt,quantity:$[gt]})),ho=E!=null&&E.topUpCustomCurrencyId?[{topUpCustomCurrencyId:E.topUpCustomCurrencyId,quantity:V}]:void 0;return g(ae,Ee,ho)};return jsxRuntime.jsxs(ag,{className:Wu__default.default(`stigg-${i.id}`,"stigg-plan-offering-container",{"stigg-current-plan":i.isCurrentCustomerPlan}),$isHighlighted:l,$isCurrentPlan:i.isCurrentCustomerPlan,children:[N,jsxRuntime.jsxs(ug,{className:"stigg-header-wrapper",children:[jsxRuntime.jsx(lg,{className:"stigg-plan-header",variant:"h3",children:i.displayName}),u&&jsxRuntime.jsx(dg,{className:"stigg-plan-description",variant:"h6",color:"secondary",children:i.description}),jsxRuntime.jsx(rs,{showStartingAt:w,withUnitPriceRow:e,withStartingAtRow:b,withTiersRow:t,withCreditChargeRow:r,creditChargePrice:L?E:void 0,selectedCreditQuantity:V,setSelectedCreditQuantity:K,plan:i,billingPeriod:a,paywallLocale:h,locale:P,hasAnnuallyPrice:y,hasMonthlyPrice:f,setPerUnitQuantityByFeature:R,perUnitQuantityByFeature:$}),I?jsxRuntime.jsx(Qa,{isNextPlan:F,customer:n,plan:i,currentSubscription:s,currentSubscriptionOverride:c,billingPeriod:a,isCustomerOnTrial:p,onPlanSelected:Oe,paywallLocale:h,withTrialLeftRow:o,perUnitQuantityByFeature:$}):jsxRuntime.jsx("div",{style:{height:ig}}),jsxRuntime.jsx(cg,{className:"stigg-plan-header-divider"})]}),jsxRuntime.jsx($a,{plan:i,billingPeriod:a,paywallLocale:h,singleTierCreditCharge:L?void 0:E}),jsxRuntime.jsx(sg,{$planHasEntitlements:((ie=(z=i.packageEntitlements)==null?void 0:z.length)!=null?ie:0)>0,className:"stigg-addons-container",children:!S&&i.compatibleAddons&&i.compatibleAddons.length>0&&jsxRuntime.jsx(Fn,{addons:i.compatibleAddons,paywallLocale:h})})]})}var Cg=chunkIL3DC53A_cjs_js.e.div`
203
203
  height: 40px;
204
204
  padding: 0 20px;
205
205
  margin-bottom: ${({theme:e})=>e.stigg.layout.switchBottomSpacing};
@@ -209,9 +209,9 @@
209
209
  display: flex;
210
210
  align-items: center;
211
211
  justify-content: center;
212
- `,as=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
212
+ `,ss=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
213
213
  margin: 0 8px;
214
- `,Pg=chunk2FMVMEMY_cjs_js.e(hg__default.default)`
214
+ `,Pg=chunkIL3DC53A_cjs_js.e(hg__default.default)`
215
215
  & .react-switch-bg {
216
216
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.switchBorder}`};
217
217
  background: ${({theme:e})=>e.stigg.palette.switchFill} !important;
@@ -222,7 +222,7 @@
222
222
  background: ${({theme:e})=>e.stigg.palette.switchHandle} !important;
223
223
  top: 0.5px !important;
224
224
  }
225
- `;function xg({discount:e,disabled:t}){return jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:t?"disabled":"primary",className:"stigg-discount-rate-text",children:[e,"% off"]})}function ss({discountRate:e,selectedBillingPeriod:t,onBillingPeriodChanged:o,availableBillingPeriods:r}){if(r.length<=1)return null;let n=t===jsClientSdk.BillingPeriod.Monthly;return jsxRuntime.jsxs(Cg,{className:"stigg-period-picker-container",children:[jsxRuntime.jsx(as,{variant:"h6",className:"stigg-monthly-period-text",color:n?"primary":"disabled",children:"Monthly"}),jsxRuntime.jsx(Pg,{className:"stigg-period-switch",uncheckedIcon:false,checkedIcon:false,height:16,width:33,onChange:i=>o(i?jsClientSdk.BillingPeriod.Annually:jsClientSdk.BillingPeriod.Monthly),checked:!n,borderRadius:10,handleDiameter:19}),jsxRuntime.jsx(as,{variant:"h6",className:"stigg-annual-period-text",color:n?"disabled":"primary",children:"Annual"}),e!==0&&jsxRuntime.jsx(xg,{discount:e,disabled:n})]})}function bg(e,t){if(!Fo__default.default(e)&&!Fo__default.default(t)){let o=t/12;return Math.round((e-o)/e*100)}return null}function ps(e,t){var r;let o;if(o=(r=e.paywallCalculatedPricePoints)==null?void 0:r.find(n=>n.billingPeriod===t),o||(o=e.pricePoints.find(n=>n.billingPeriod===t)),!(o!=null&&o.amount)){let n=e.pricePoints.find(i=>i.isTieredPrice&&i.billingPeriod===t);if(n)return xt(n,1)}return o==null?void 0:o.amount}function ms(e){return e.reduce((t,o)=>{let r=ps(o,jsClientSdk.BillingPeriod.Monthly),n=ps(o,jsClientSdk.BillingPeriod.Annually),i=bg(r,n);return i&&(t=Math.max(t,i)),t},0)}function Ln(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Nn(e,t){return e.some(o=>Ln(o,t))}function us(e,t,o){return e.filter(r=>r.pricingType!==jsClientSdk.PricingType.Paid||Ln(r,t)).filter(r=>!o||!o({plan:r}))}var wg=chunk2FMVMEMY_cjs_js.e.div`
225
+ `;function xg({discount:e,disabled:t}){return jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:t?"disabled":"primary",className:"stigg-discount-rate-text",children:[e,"% off"]})}function ls({discountRate:e,selectedBillingPeriod:t,onBillingPeriodChanged:o,availableBillingPeriods:r}){if(r.length<=1)return null;let n=t===jsClientSdk.BillingPeriod.Monthly;return jsxRuntime.jsxs(Cg,{className:"stigg-period-picker-container",children:[jsxRuntime.jsx(ss,{variant:"h6",className:"stigg-monthly-period-text",color:n?"primary":"disabled",children:"Monthly"}),jsxRuntime.jsx(Pg,{className:"stigg-period-switch",uncheckedIcon:false,checkedIcon:false,height:16,width:33,onChange:i=>o(i?jsClientSdk.BillingPeriod.Annually:jsClientSdk.BillingPeriod.Monthly),checked:!n,borderRadius:10,handleDiameter:19}),jsxRuntime.jsx(ss,{variant:"h6",className:"stigg-annual-period-text",color:n?"disabled":"primary",children:"Annual"}),e!==0&&jsxRuntime.jsx(xg,{discount:e,disabled:n})]})}function bg(e,t){if(!Fo__default.default(e)&&!Fo__default.default(t)){let o=t/12;return Math.round((e-o)/e*100)}return null}function ms(e,t){var r;let o;if(o=(r=e.paywallCalculatedPricePoints)==null?void 0:r.find(n=>n.billingPeriod===t),o||(o=e.pricePoints.find(n=>n.billingPeriod===t)),!(o!=null&&o.amount)){let n=e.pricePoints.find(i=>i.isTieredPrice&&i.billingPeriod===t);if(n)return xt(n,1)}return o==null?void 0:o.amount}function us(e){return e.reduce((t,o)=>{let r=ms(o,jsClientSdk.BillingPeriod.Monthly),n=ms(o,jsClientSdk.BillingPeriod.Annually),i=bg(r,n);return i&&(t=Math.max(t,i)),t},0)}function Ln(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Nn(e,t){return e.some(o=>Ln(o,t))}function gs(e,t,o){return e.filter(r=>r.pricingType!==jsClientSdk.PricingType.Paid||Ln(r,t)).filter(r=>!o||!o({plan:r}))}var wg=chunkIL3DC53A_cjs_js.e.div`
226
226
  color: ${({theme:e})=>e.stigg.palette.text.primary};
227
227
  display: flex;
228
228
  align-items: stretch;
@@ -230,7 +230,7 @@
230
230
  flex-wrap: wrap;
231
231
  padding: 10px 0;
232
232
  gap: ${({theme:e})=>e.stigg.layout.planMargin};
233
- `,Bg=chunk2FMVMEMY_cjs_js.e.div`
233
+ `,Bg=chunkIL3DC53A_cjs_js.e.div`
234
234
  display: flex;
235
235
  flex-direction: column;
236
236
  align-items: center;
@@ -238,17 +238,17 @@
238
238
  & * {
239
239
  box-sizing: border-box;
240
240
  }
241
- `,Ag=chunk2FMVMEMY_cjs_js.e.div`
241
+ `,Ag=chunkIL3DC53A_cjs_js.e.div`
242
242
  display: flex;
243
243
  flex-direction: column;
244
244
  align-items: center;
245
- `,fs=({plans:e,customer:t,currentSubscription:o,highlightedPlanId:r,selectedBillingPeriod:n,onBillingPeriodChanged:i,availableBillingPeriods:a,isCustomerOnTrial:l,onPlanSelected:s,paywallLocale:c,locale:u,shouldHidePlan:f,selectDefaultTierIndex:y,currentSubscriptionOverride:p,hideCompatibleAddons:g,showWatermark:h})=>{let P=ms(e),b=e.some(N=>!!N.description),x=Nn(e,jsClientSdk.BillingPeriod.Monthly),A=Nn(e,jsClientSdk.BillingPeriod.Annually),S=us(e,n,f),F=hi.useCallback((N,$,R,V)=>s({plan:N,customer:t,subscription:o,intentionType:$,selectedBillingPeriod:n,billableFeatures:R,billableCredits:V}),[t,n,o,s]),T=!!o&&o.plan.pricingType===jsClientSdk.PricingType.Custom,k=hi.useMemo(()=>S.some(N=>{var V;let $=N.pricePoints.filter(K=>K.billingPeriod===n),R=(V=N.paywallCalculatedPricePoints)==null?void 0:V.find(K=>K.billingPeriod===n);return $.length>1&&!!(R!=null&&R.additionalChargesMayApply)}),[n,S]),w=hi.useMemo(()=>S.some(N=>!!vo(N,n,c,u,x).unit),[n,x,u,c,S]),I=hi.useMemo(()=>!T&&S.some(N=>{let $=Eo({plan:N,billingPeriod:n,currentSubscription:o,currentSubscriptionOverride:p});return Object.values($).length>0}),[n,o,p,T,S]),E=S.some(N=>N.isCurrentCustomerPlan&&N.trialDaysLeft),L=hi.useMemo(()=>S.some(N=>{let $=ko(N,n);return !!$&&wo($)}),[n,S]);return jsxRuntime.jsx(Bg,{className:"stigg-paywall-container",children:jsxRuntime.jsxs(Ag,{className:"stigg-paywall-layout",children:[jsxRuntime.jsx(ss,{onBillingPeriodChanged:i,selectedBillingPeriod:n,availableBillingPeriods:a,discountRate:P}),jsxRuntime.jsx(wg,{className:"stigg-paywall-plans-layout",children:S.map(N=>jsxRuntime.jsx(is,{withUnitPriceRow:w,withTiersRow:I,withTrialLeftRow:E,withCreditChargeRow:L,shouldShowDescriptionSection:b,hasMonthlyPrice:x,hasAnnuallyPrice:A,plan:N,withStartingAtRow:k,currentSubscription:o,currentSubscriptionOverride:p,billingPeriod:n,isHighlighted:N.id===r,isCustomerOnTrial:l,onPlanSelected:($,R,V)=>F(N,$,R,V),paywallLocale:c,locale:u,customer:t,isCustomerInCustomPlan:T,selectDefaultTierIndex:y,hideCompatibleAddons:g},N.id))}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.q,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:h})]})})};function ys(e,t,o){let r=e.flatMap(l=>l.pricePoints).map(l=>l.billingPeriod),n=Eg__default.default(r),i=vg__default.default(r),a;if(o&&i.includes(o))a=o;else if(t){let l=t.find(s=>s.status===jsClientSdk.SubscriptionStatus.Active);l&&l.prices.length>0&&(a=l==null?void 0:l.prices[0].billingPeriod);}return a||(a=(n[jsClientSdk.BillingPeriod.Monthly]||0)>(n[jsClientSdk.BillingPeriod.Annually]||0)?jsClientSdk.BillingPeriod.Monthly:jsClientSdk.BillingPeriod.Annually),{defaultBillingPeriod:a,availableBillingPeriods:i}}function hs(e){return Z.utc(e).diff(Z.utc(),"days",false)+1}var Ro={h1:{fontSize:"24px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"16px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};function Je(e,t="px"){if(e)return `${e}${t}`}function Uo(e){if(!e)return "normal";switch(e){case jsClientSdk.FontWeight.Normal:return "normal";case jsClientSdk.FontWeight.Bold:return "bold";default:return "normal"}}function Jt(e,t){var r,n,i,a,l,s,c,u;let o=t||{h1:{fontSize:"32px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"24px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};return {fontFamilyUrl:(e==null?void 0:e.fontFamily)||void 0,h1:{fontSize:Je((r=e==null?void 0:e.h1)==null?void 0:r.fontSize)||o.h1.fontSize,fontWeight:Uo((n=e==null?void 0:e.h1)==null?void 0:n.fontWeight)||o.h1.fontWeight,semanticElement:o.h1.semanticElement},h2:{fontSize:Je((i=e==null?void 0:e.h2)==null?void 0:i.fontSize)||o.h2.fontSize,fontWeight:Uo((a=e==null?void 0:e.h2)==null?void 0:a.fontWeight)||o.h2.fontWeight,semanticElement:o.h2.semanticElement},h3:{fontSize:Je((l=e==null?void 0:e.h3)==null?void 0:l.fontSize)||o.h3.fontSize,fontWeight:Uo((s=e==null?void 0:e.h3)==null?void 0:s.fontWeight)||o.h3.fontWeight,semanticElement:o.h3.semanticElement},body:{fontSize:Je((c=e==null?void 0:e.body)==null?void 0:c.fontSize)||o.body.fontSize,fontWeight:Uo((u=e==null?void 0:e.body)==null?void 0:u.fontWeight)||o.body.fontWeight,semanticElement:o.body.semanticElement}}}function Rn(e){if(e)switch(e){case jsClientSdk.Alignment.Left:return "left";case jsClientSdk.Alignment.Center:return "center";case jsClientSdk.Alignment.Right:return "right";default:return}}function Ps(e){let{palette:t,customCss:o,typography:r}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Jt(r),customCss:o||void 0}}function xs(e){let{palette:t,layout:o,customCss:r,typography:n}=e;return {customCss:r||void 0,palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Jt(n),layout:{ctaAlignment:Rn(o==null?void 0:o.alignment),headerAlignment:Rn(o==null?void 0:o.alignment),descriptionAlignment:Rn(o==null?void 0:o.alignment),planMaxWidth:Je(o==null?void 0:o.planWidth),planMinWidth:Je(o==null?void 0:o.planWidth),planMargin:Je(o==null?void 0:o.planMargin),planPadding:Je(o==null?void 0:o.planPadding)}}}function bs(e){let{palette:t,typography:o,customCss:r}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0},backgroundHighlight:(t==null?void 0:t.summaryBackgroundColor)||void 0},typography:Jt(o,Ro),customCss:r||void 0}}function Ng(e){let t=true,o=(e==null?void 0:e.find(i=>i.status===jsClientSdk.SubscriptionStatus.InTrial))||null,r=o==null?void 0:o.plan,n=o!=null&&o.trialEndDate?hs(o.trialEndDate):void 0;return r||(t=false,o=(e==null?void 0:e.find(i=>i.status===jsClientSdk.SubscriptionStatus.Active))||null,r=o==null?void 0:o.plan),{currentSubscription:o,currentPlan:r,isCustomerOnTrial:t,trialDaysLeft:n}}function ws(e,t,o){var S,F;let{plans:r,currency:n,configuration:i,customer:a,activeSubscriptions:l,paywallCalculatedPricePoints:s}=e||{},{currentSubscription:c,currentPlan:u,isCustomerOnTrial:f,trialDaysLeft:y}=Ng(l),p=o==null?void 0:o({currentSubscription:c}),g=(c==null?void 0:c.scheduledUpdates)||[],h=(S=c==null?void 0:c.price)==null?void 0:S.billingPeriod,P=g.find(({subscriptionScheduleType:T})=>T===jsClientSdk.SubscriptionScheduleType.Downgrade),b=g.find(({subscriptionScheduleType:T})=>T===jsClientSdk.SubscriptionScheduleType.BillingPeriod),x=sc__default.default(r,T=>T.order).map(T=>{var E;let k=(E=a==null?void 0:a.eligibleForTrial)==null?void 0:E.find(L=>L.productId===T.product.id),w=p!=null&&p.planId?(p==null?void 0:p.planId)===T.id:T.id===(u==null?void 0:u.id),I=L=>{var V;let N=P==null?void 0:P.scheduleVariables,$=b==null?void 0:b.scheduleVariables,R=T.pricePoints.some(K=>K.billingPeriod===L);return P?((V=P.targetPackage)==null?void 0:V.refId)===T.id&&(!R||N.billingPeriod===L):b&&w?$.billingPeriod===L:false};return chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},T),{paywallCalculatedPricePoints:s==null?void 0:s.filter(L=>L.planId===T.id),isTriable:!Fo__default.default(T.defaultTrialConfig)&&(!k||k.eligible),isCurrentCustomerPlan:w,currentCustomerPlanBillingPeriod:h,isUpcomingPlan:false,trialDaysLeft:y,isNextPlan:I,paywallCurrency:n,scheduledUpdate:P||b})});if(r&&u){let T=u&&((F=r==null?void 0:r.find(k=>k.id===(u==null?void 0:u.id)))==null?void 0:F.order);Fo__default.default(T)||(x=x.map(k=>chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},k),{isLowerThanCurrentPlan:T>k.order})),t&&(x=x.filter(k=>k.order>=T)));}let A=i?xs(i):void 0;return {currentPlan:u,currentSubscription:c,currentSubscriptionOverride:p,isCustomerOnTrial:f,plans:x,paywallConfiguration:A}}function Bs({productId:e,resourceId:t,showOnlyEligiblePlans:o,billingCountryCode:r,preferredBillingPeriod:n,currentSubscriptionOverrideFn:i}){let{stigg:a,locale:l}=chunk2FMVMEMY_cjs_js.u(),[s,c]=hi.useState(jsClientSdk.BillingPeriod.Annually),[u,f]=hi.useState([]),[y,p]=hi.useState(null),[g,h]=hi.useState(true);hi.useEffect(()=>{chunk2FMVMEMY_cjs_js.d(null,null,function*(){try{h(!0),yield a.waitForInitialization();let x=yield a.getPaywall({productId:e,resourceId:t,billingCountryCode:r}),{availableBillingPeriods:A,defaultBillingPeriod:S}=ys(x.plans,x.activeSubscriptions,n);p(x),f(A),c(S);}catch(x){chunk2FMVMEMY_cjs_js.r.error(`Failed to load paywall ${x==null?void 0:x.message}`,x);}finally{h(false);}});},[a,e,a.isCustomerLoaded,r,t,n]);let P=ws(y,o,i);return chunk2FMVMEMY_cjs_js.a({customer:(y==null?void 0:y.customer)||null,isLoading:g,selectedBillingPeriod:s,setSelectedBillingPeriod:c,availableBillingPeriods:u,locale:l,configuration:P.paywallConfiguration,showWatermark:a.getShowWatermark()},P)}function Is(e){return Ug__default.default({highlightChip:"Recommended",addonsTitle:"Available add-ons:",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:o=>{var r;return `Start ${(r=o.defaultTrialConfig)==null?void 0:r.duration} day trial`},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:o=>o===jsClientSdk.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing",cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:o=>o===jsClientSdk.BillingPeriod.Monthly?"/ month":"/ year",free:o=>({price:`${o==null?void 0:o.symbol}0`}),custom:"Custom",priceNotSet:"Price not set"}},e)}var _g=e=>jsxRuntime.jsx("svg",chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M5.59 7.9899L2.125 4.5249C1.73524 4.13514 1.10365 4.13402 0.712509 4.52241V4.52241C0.319409 4.91274 0.318286 5.54819 0.710005 5.9399L5.59 10.8199L14.2948 2.11513C14.6843 1.72565 14.6843 1.09417 14.2948 0.704691V0.704691C13.9055 0.315381 13.2743 0.315184 12.8848 0.70425L5.59 7.9899Z",fill:"#B2BBD3"})})),Es=_g;var Dg=chunk2FMVMEMY_cjs_js.e.div`
245
+ `,ys=({plans:e,customer:t,currentSubscription:o,highlightedPlanId:r,selectedBillingPeriod:n,onBillingPeriodChanged:i,availableBillingPeriods:a,isCustomerOnTrial:l,onPlanSelected:s,paywallLocale:c,locale:u,shouldHidePlan:f,selectDefaultTierIndex:y,currentSubscriptionOverride:p,hideCompatibleAddons:g,showWatermark:h})=>{let P=us(e),b=e.some(N=>!!N.description),x=Nn(e,jsClientSdk.BillingPeriod.Monthly),A=Nn(e,jsClientSdk.BillingPeriod.Annually),S=gs(e,n,f),F=hi.useCallback((N,$,R,V)=>s({plan:N,customer:t,subscription:o,intentionType:$,selectedBillingPeriod:n,billableFeatures:R,billableCredits:V}),[t,n,o,s]),T=!!o&&o.plan.pricingType===jsClientSdk.PricingType.Custom,k=hi.useMemo(()=>S.some(N=>{var V;let $=N.pricePoints.filter(K=>K.billingPeriod===n),R=(V=N.paywallCalculatedPricePoints)==null?void 0:V.find(K=>K.billingPeriod===n);return $.length>1&&!!(R!=null&&R.additionalChargesMayApply)}),[n,S]),w=hi.useMemo(()=>S.some(N=>!!vo(N,n,c,u,x).unit),[n,x,u,c,S]),I=hi.useMemo(()=>!T&&S.some(N=>{let $=Eo({plan:N,billingPeriod:n,currentSubscription:o,currentSubscriptionOverride:p});return Object.values($).length>0}),[n,o,p,T,S]),E=S.some(N=>N.isCurrentCustomerPlan&&N.trialDaysLeft),L=hi.useMemo(()=>S.some(N=>{let $=ko(N,n);return !!$&&wo($)}),[n,S]);return jsxRuntime.jsx(Bg,{className:"stigg-paywall-container",children:jsxRuntime.jsxs(Ag,{className:"stigg-paywall-layout",children:[jsxRuntime.jsx(ls,{onBillingPeriodChanged:i,selectedBillingPeriod:n,availableBillingPeriods:a,discountRate:P}),jsxRuntime.jsx(wg,{className:"stigg-paywall-plans-layout",children:S.map(N=>jsxRuntime.jsx(as,{withUnitPriceRow:w,withTiersRow:I,withTrialLeftRow:E,withCreditChargeRow:L,shouldShowDescriptionSection:b,hasMonthlyPrice:x,hasAnnuallyPrice:A,plan:N,withStartingAtRow:k,currentSubscription:o,currentSubscriptionOverride:p,billingPeriod:n,isHighlighted:N.id===r,isCustomerOnTrial:l,onPlanSelected:($,R,V)=>F(N,$,R,V),paywallLocale:c,locale:u,customer:t,isCustomerInCustomPlan:T,selectDefaultTierIndex:y,hideCompatibleAddons:g},N.id))}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.q,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:h})]})})};function hs(e,t,o){let r=e.flatMap(l=>l.pricePoints).map(l=>l.billingPeriod),n=Eg__default.default(r),i=vg__default.default(r),a;if(o&&i.includes(o))a=o;else if(t){let l=t.find(s=>s.status===jsClientSdk.SubscriptionStatus.Active);l&&l.prices.length>0&&(a=l==null?void 0:l.prices[0].billingPeriod);}return a||(a=(n[jsClientSdk.BillingPeriod.Monthly]||0)>(n[jsClientSdk.BillingPeriod.Annually]||0)?jsClientSdk.BillingPeriod.Monthly:jsClientSdk.BillingPeriod.Annually),{defaultBillingPeriod:a,availableBillingPeriods:i}}function Cs(e){return Z.utc(e).diff(Z.utc(),"days",false)+1}var Ro={h1:{fontSize:"24px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"16px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};function Je(e,t="px"){if(e)return `${e}${t}`}function Uo(e){if(!e)return "normal";switch(e){case jsClientSdk.FontWeight.Normal:return "normal";case jsClientSdk.FontWeight.Bold:return "bold";default:return "normal"}}function Jt(e,t){var r,n,i,a,l,s,c,u;let o=t||{h1:{fontSize:"32px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"24px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};return {fontFamilyUrl:(e==null?void 0:e.fontFamily)||void 0,h1:{fontSize:Je((r=e==null?void 0:e.h1)==null?void 0:r.fontSize)||o.h1.fontSize,fontWeight:Uo((n=e==null?void 0:e.h1)==null?void 0:n.fontWeight)||o.h1.fontWeight,semanticElement:o.h1.semanticElement},h2:{fontSize:Je((i=e==null?void 0:e.h2)==null?void 0:i.fontSize)||o.h2.fontSize,fontWeight:Uo((a=e==null?void 0:e.h2)==null?void 0:a.fontWeight)||o.h2.fontWeight,semanticElement:o.h2.semanticElement},h3:{fontSize:Je((l=e==null?void 0:e.h3)==null?void 0:l.fontSize)||o.h3.fontSize,fontWeight:Uo((s=e==null?void 0:e.h3)==null?void 0:s.fontWeight)||o.h3.fontWeight,semanticElement:o.h3.semanticElement},body:{fontSize:Je((c=e==null?void 0:e.body)==null?void 0:c.fontSize)||o.body.fontSize,fontWeight:Uo((u=e==null?void 0:e.body)==null?void 0:u.fontWeight)||o.body.fontWeight,semanticElement:o.body.semanticElement}}}function Rn(e){if(e)switch(e){case jsClientSdk.Alignment.Left:return "left";case jsClientSdk.Alignment.Center:return "center";case jsClientSdk.Alignment.Right:return "right";default:return}}function xs(e){let{palette:t,customCss:o,typography:r}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Jt(r),customCss:o||void 0}}function bs(e){let{palette:t,layout:o,customCss:r,typography:n}=e;return {customCss:r||void 0,palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Jt(n),layout:{ctaAlignment:Rn(o==null?void 0:o.alignment),headerAlignment:Rn(o==null?void 0:o.alignment),descriptionAlignment:Rn(o==null?void 0:o.alignment),planMaxWidth:Je(o==null?void 0:o.planWidth),planMinWidth:Je(o==null?void 0:o.planWidth),planMargin:Je(o==null?void 0:o.planMargin),planPadding:Je(o==null?void 0:o.planPadding)}}}function Ss(e){let{palette:t,typography:o,customCss:r}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0},backgroundHighlight:(t==null?void 0:t.summaryBackgroundColor)||void 0},typography:Jt(o,Ro),customCss:r||void 0}}function Ng(e){let t=true,o=(e==null?void 0:e.find(i=>i.status===jsClientSdk.SubscriptionStatus.InTrial))||null,r=o==null?void 0:o.plan,n=o!=null&&o.trialEndDate?Cs(o.trialEndDate):void 0;return r||(t=false,o=(e==null?void 0:e.find(i=>i.status===jsClientSdk.SubscriptionStatus.Active))||null,r=o==null?void 0:o.plan),{currentSubscription:o,currentPlan:r,isCustomerOnTrial:t,trialDaysLeft:n}}function Bs(e,t,o){var S,F;let{plans:r,currency:n,configuration:i,customer:a,activeSubscriptions:l,paywallCalculatedPricePoints:s}=e||{},{currentSubscription:c,currentPlan:u,isCustomerOnTrial:f,trialDaysLeft:y}=Ng(l),p=o==null?void 0:o({currentSubscription:c}),g=(c==null?void 0:c.scheduledUpdates)||[],h=(S=c==null?void 0:c.price)==null?void 0:S.billingPeriod,P=g.find(({subscriptionScheduleType:T})=>T===jsClientSdk.SubscriptionScheduleType.Downgrade),b=g.find(({subscriptionScheduleType:T})=>T===jsClientSdk.SubscriptionScheduleType.BillingPeriod),x=lc__default.default(r,T=>T.order).map(T=>{var E;let k=(E=a==null?void 0:a.eligibleForTrial)==null?void 0:E.find(L=>L.productId===T.product.id),w=p!=null&&p.planId?(p==null?void 0:p.planId)===T.id:T.id===(u==null?void 0:u.id),I=L=>{var V;let N=P==null?void 0:P.scheduleVariables,$=b==null?void 0:b.scheduleVariables,R=T.pricePoints.some(K=>K.billingPeriod===L);return P?((V=P.targetPackage)==null?void 0:V.refId)===T.id&&(!R||N.billingPeriod===L):b&&w?$.billingPeriod===L:false};return chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},T),{paywallCalculatedPricePoints:s==null?void 0:s.filter(L=>L.planId===T.id),isTriable:!Fo__default.default(T.defaultTrialConfig)&&(!k||k.eligible),isCurrentCustomerPlan:w,currentCustomerPlanBillingPeriod:h,isUpcomingPlan:false,trialDaysLeft:y,isNextPlan:I,paywallCurrency:n,scheduledUpdate:P||b})});if(r&&u){let T=u&&((F=r==null?void 0:r.find(k=>k.id===(u==null?void 0:u.id)))==null?void 0:F.order);Fo__default.default(T)||(x=x.map(k=>chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},k),{isLowerThanCurrentPlan:T>k.order})),t&&(x=x.filter(k=>k.order>=T)));}let A=i?bs(i):void 0;return {currentPlan:u,currentSubscription:c,currentSubscriptionOverride:p,isCustomerOnTrial:f,plans:x,paywallConfiguration:A}}function As({productId:e,resourceId:t,showOnlyEligiblePlans:o,billingCountryCode:r,preferredBillingPeriod:n,currentSubscriptionOverrideFn:i}){let{stigg:a,locale:l}=chunkIL3DC53A_cjs_js.u(),[s,c]=hi.useState(jsClientSdk.BillingPeriod.Annually),[u,f]=hi.useState([]),[y,p]=hi.useState(null),[g,h]=hi.useState(true);hi.useEffect(()=>{chunkIL3DC53A_cjs_js.d(null,null,function*(){try{h(!0),yield a.waitForInitialization();let x=yield a.getPaywall({productId:e,resourceId:t,billingCountryCode:r}),{availableBillingPeriods:A,defaultBillingPeriod:S}=hs(x.plans,x.activeSubscriptions,n);p(x),f(A),c(S);}catch(x){chunkIL3DC53A_cjs_js.r.error(`Failed to load paywall ${x==null?void 0:x.message}`,x);}finally{h(false);}});},[a,e,a.isCustomerLoaded,r,t,n]);let P=Bs(y,o,i);return chunkIL3DC53A_cjs_js.a({customer:(y==null?void 0:y.customer)||null,isLoading:g,selectedBillingPeriod:s,setSelectedBillingPeriod:c,availableBillingPeriods:u,locale:l,configuration:P.paywallConfiguration,showWatermark:a.getShowWatermark()},P)}function Fs(e){return Ug__default.default({highlightChip:"Recommended",addonsTitle:"Available add-ons:",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:o=>{var r;return `Start ${(r=o.defaultTrialConfig)==null?void 0:r.duration} day trial`},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:o=>o===jsClientSdk.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing",cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:o=>o===jsClientSdk.BillingPeriod.Monthly?"/ month":"/ year",free:o=>({price:`${o==null?void 0:o.symbol}0`}),custom:"Custom",priceNotSet:"Price not set"}},e)}var _g=e=>jsxRuntime.jsx("svg",chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M5.59 7.9899L2.125 4.5249C1.73524 4.13514 1.10365 4.13402 0.712509 4.52241V4.52241C0.319409 4.91274 0.318286 5.54819 0.710005 5.9399L5.59 10.8199L14.2948 2.11513C14.6843 1.72565 14.6843 1.09417 14.2948 0.704691V0.704691C13.9055 0.315381 13.2743 0.315184 12.8848 0.70425L5.59 7.9899Z",fill:"#B2BBD3"})})),vs=_g;var Dg=chunkIL3DC53A_cjs_js.e.div`
246
246
  display: flex;
247
247
  flex-direction: column;
248
248
  align-items: center;
249
- `,Un=chunk2FMVMEMY_cjs_js.e(Es)`
249
+ `,Un=chunkIL3DC53A_cjs_js.e(vs)`
250
250
  margin-right: 16px;
251
- `,$g=chunk2FMVMEMY_cjs_js.e.div`
251
+ `,$g=chunkIL3DC53A_cjs_js.e.div`
252
252
  display: flex;
253
253
  flex-direction: column;
254
254
  align-items: flex-start;
@@ -260,25 +260,25 @@
260
260
  max-width: ${({theme:e})=>e.stigg.layout.planMaxWidth};
261
261
  min-height: 450px;
262
262
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
263
- `,Gg=chunk2FMVMEMY_cjs_js.e.div`
263
+ `,Gg=chunkIL3DC53A_cjs_js.e.div`
264
264
  display: flex;
265
265
  gap: ${({theme:e})=>e.stigg.layout.planMargin};
266
266
  flex-wrap: wrap;
267
267
  justify-content: center;
268
- `,_n=chunk2FMVMEMY_cjs_js.e.div`
268
+ `,_n=chunkIL3DC53A_cjs_js.e.div`
269
269
  display: flex;
270
270
  align-items: center;
271
271
  margin-bottom: 12px;
272
- `,Vg=chunk2FMVMEMY_cjs_js.e.div`
272
+ `,Vg=chunkIL3DC53A_cjs_js.e.div`
273
273
  margin-top: auto;
274
- `,zg=chunk2FMVMEMY_cjs_js.e.div`
274
+ `,zg=chunkIL3DC53A_cjs_js.e.div`
275
275
  width: 150px;
276
276
  margin-bottom: ${({theme:e})=>e.stigg.layout.switchBottomSpacing};
277
277
  padding: 12px 12px;
278
278
  border-radius: 10px;
279
279
  background-color: white;
280
280
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
281
- `;function Og(){return jsxRuntime.jsxs($g,{children:[jsxRuntime.jsx(Xe__default.default,{width:120,borderRadius:4}),jsxRuntime.jsx(Xe__default.default,{circle:true,width:40,height:40}),jsxRuntime.jsx(Xe__default.default,{style:{marginBottom:33},width:120,borderRadius:4}),jsxRuntime.jsxs(_n,{children:[jsxRuntime.jsx(Un,{}),jsxRuntime.jsx(Xe__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(_n,{children:[jsxRuntime.jsx(Un,{}),jsxRuntime.jsx(Xe__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(_n,{children:[jsxRuntime.jsx(Un,{}),jsxRuntime.jsx(Xe__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsx(Vg,{children:jsxRuntime.jsx(Xe__default.default,{height:50,borderRadius:4})})]})}function vs({skeletonPlanCount:e=3}){return jsxRuntime.jsxs(Dg,{className:"stigg-skeleton-loader-container",children:[jsxRuntime.jsx(zg,{className:"stigg-skeleton-loader-billing-period",children:jsxRuntime.jsx(Xe__default.default,{borderRadius:4})}),jsxRuntime.jsx(Gg,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsxRuntime.jsx(Og,{},o))})]})}var ee=hi__default.default.createContext(null);ee.displayName="CustomerPortalContext";var Y=()=>{let e=hi.useContext(ee);if(!e)throw new Error("Could not find Customer portal context; You need to wrap your customer portal components in an <CustomerPortalProvider> component.");return e};function he(e){return !!hi.useContext(e)}var Ns=({productId:e,resourceId:t,highlightedPlanId:o,showOnlyEligiblePlans:r,textOverrides:n,onPlanSelected:i,preferredBillingPeriod:a,onBillingPeriodChange:l,billingCountryCode:s,shouldHidePlan:c,selectDefaultTierIndex:u,currentSubscriptionOverride:f,hideCompatibleAddons:y,skeletonPlanCount:p=3})=>{let g=he(ee),h=false;if(g){let{isLoading:V,resourceId:K}=Y();h=V,t=K;}let{plans:P,customer:b,currentSubscription:x,currentSubscriptionOverride:A,isCustomerOnTrial:S,isLoading:F,selectedBillingPeriod:T,setSelectedBillingPeriod:k,availableBillingPeriods:w,locale:I,configuration:E,showWatermark:L}=Bs({productId:e,resourceId:t,showOnlyEligiblePlans:r,billingCountryCode:s,preferredBillingPeriod:a,currentSubscriptionOverrideFn:f}),N=Is(n),R=!P||F||h?jsxRuntime.jsx(vs,{skeletonPlanCount:p}):jsxRuntime.jsx(fs,{plans:P,customer:b,currentSubscription:x,currentSubscriptionOverride:A,selectedBillingPeriod:T,onBillingPeriodChanged:V=>{k(V),l&&l(V);},availableBillingPeriods:w,highlightedPlanId:o,isCustomerOnTrial:S,onPlanSelected:i,paywallLocale:N,locale:I,shouldHidePlan:c,selectDefaultTierIndex:u,hideCompatibleAddons:y,showWatermark:L});return g?R:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:E,children:R})};function Rs({resourceId:e,productId:t}){let{stigg:o,customerPortalUpdatedAt:r}=chunk2FMVMEMY_cjs_js.u(),[n,i]=hi.useState(false),[a,l]=hi.useState();return hi.useEffect(()=>{chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(o.isCustomerLoaded)try{i(!0);let c=yield o.getCustomerPortal({resourceId:e,productId:t});l(c);}catch(c){chunk2FMVMEMY_cjs_js.r.error(`Failed to load customer portal ${c==null?void 0:c.message}`,c);}finally{i(false);}});},[o,o.isCustomerLoaded,r,e,t]),{customerPortal:a,showWatermark:o.getShowWatermark(),isLoading:n}}function Us(e){return Ug__default.default({manageSubscription:"Manage",usageTabTitle:"Usage",addonsTabTitle:"Add-ons",promotionsTabTitle:"Promotions",promotionsSubtitle:"You were granted access to additional functionality at no additional cost.",contactSupportTitle:"Have questions about your subscription?",contactSupportLink:"Contact support",editBilling:"Edit billing details",invoicesTitle:"Invoices",viewInvoiceHistory:"View invoice history",editPaymentDetails:"Edit",paywallSectionTitle:"Plans",cancelScheduledUpdatesButtonTitle:"Cancel"},e)}function _s(e,t,o){var n,i,a,l;return {sectionTitleColor:(t==null?void 0:t.sectionTitleColor)||e.palette.text.secondary,planNameColor:(t==null?void 0:t.planNameColor)||e.palette.text.primary,backgroundColor:(t==null?void 0:t.backgroundColor)||((n=o==null?void 0:o.palette)==null?void 0:n.backgroundColor)||"white",borderColor:(t==null?void 0:t.borderColor)||((i=o==null?void 0:o.palette)==null?void 0:i.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(t==null?void 0:t.backgroundColor)||((a=o==null?void 0:o.palette)==null?void 0:a.backgroundColor)||"white",tabMaxHeight:(t==null?void 0:t.tabMaxHeight)||"380px",iconsColor:(t==null?void 0:t.iconsColor)||((l=o==null?void 0:o.palette)==null?void 0:l.iconsColor)||void 0,iconsBackgroundColor:t==null?void 0:t.iconsBackgroundColor}}function Do({children:e,textOverrides:t,theme:o,resourceId:r,productId:n}){let{customerPortalUpdatedAt:i}=chunk2FMVMEMY_cjs_js.u(),{customerPortal:a,isLoading:l,showWatermark:s}=Rs({resourceId:r,productId:n}),c=a!=null&&a.configuration?Ps(a.configuration):void 0,u=chunk2FMVMEMY_cjs_js.v(c),f=_s(u,o,a==null?void 0:a.configuration),y=Us(t);return jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:c,children:jsxRuntime.jsx(ee.Provider,{value:{customerPortal:a,isLoading:l,showWatermark:s,textOverrides:y,theme:f,resourceId:r},children:e},i==null?void 0:i.toString())})}var je=chunk2FMVMEMY_cjs_js.e(Pu__default.default)`
281
+ `;function Og(){return jsxRuntime.jsxs($g,{children:[jsxRuntime.jsx(Xe__default.default,{width:120,borderRadius:4}),jsxRuntime.jsx(Xe__default.default,{circle:true,width:40,height:40}),jsxRuntime.jsx(Xe__default.default,{style:{marginBottom:33},width:120,borderRadius:4}),jsxRuntime.jsxs(_n,{children:[jsxRuntime.jsx(Un,{}),jsxRuntime.jsx(Xe__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(_n,{children:[jsxRuntime.jsx(Un,{}),jsxRuntime.jsx(Xe__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(_n,{children:[jsxRuntime.jsx(Un,{}),jsxRuntime.jsx(Xe__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsx(Vg,{children:jsxRuntime.jsx(Xe__default.default,{height:50,borderRadius:4})})]})}function Ls({skeletonPlanCount:e=3}){return jsxRuntime.jsxs(Dg,{className:"stigg-skeleton-loader-container",children:[jsxRuntime.jsx(zg,{className:"stigg-skeleton-loader-billing-period",children:jsxRuntime.jsx(Xe__default.default,{borderRadius:4})}),jsxRuntime.jsx(Gg,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsxRuntime.jsx(Og,{},o))})]})}var ee=hi__default.default.createContext(null);ee.displayName="CustomerPortalContext";var Y=()=>{let e=hi.useContext(ee);if(!e)throw new Error("Could not find Customer portal context; You need to wrap your customer portal components in an <CustomerPortalProvider> component.");return e};function he(e){return !!hi.useContext(e)}var Ms=({productId:e,resourceId:t,highlightedPlanId:o,showOnlyEligiblePlans:r,textOverrides:n,onPlanSelected:i,preferredBillingPeriod:a,onBillingPeriodChange:l,billingCountryCode:s,shouldHidePlan:c,selectDefaultTierIndex:u,currentSubscriptionOverride:f,hideCompatibleAddons:y,skeletonPlanCount:p=3})=>{let g=he(ee),h=false;if(g){let{isLoading:V,resourceId:K}=Y();h=V,t=K;}let{plans:P,customer:b,currentSubscription:x,currentSubscriptionOverride:A,isCustomerOnTrial:S,isLoading:F,selectedBillingPeriod:T,setSelectedBillingPeriod:k,availableBillingPeriods:w,locale:I,configuration:E,showWatermark:L}=As({productId:e,resourceId:t,showOnlyEligiblePlans:r,billingCountryCode:s,preferredBillingPeriod:a,currentSubscriptionOverrideFn:f}),N=Fs(n),R=!P||F||h?jsxRuntime.jsx(Ls,{skeletonPlanCount:p}):jsxRuntime.jsx(ys,{plans:P,customer:b,currentSubscription:x,currentSubscriptionOverride:A,selectedBillingPeriod:T,onBillingPeriodChanged:V=>{k(V),l&&l(V);},availableBillingPeriods:w,highlightedPlanId:o,isCustomerOnTrial:S,onPlanSelected:i,paywallLocale:N,locale:I,shouldHidePlan:c,selectDefaultTierIndex:u,hideCompatibleAddons:y,showWatermark:L});return g?R:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:E,children:R})};function Us({resourceId:e,productId:t}){let{stigg:o,customerPortalUpdatedAt:r}=chunkIL3DC53A_cjs_js.u(),[n,i]=hi.useState(false),[a,l]=hi.useState();return hi.useEffect(()=>{chunkIL3DC53A_cjs_js.d(null,null,function*(){if(o.isCustomerLoaded)try{i(!0);let c=yield o.getCustomerPortal({resourceId:e,productId:t});l(c);}catch(c){chunkIL3DC53A_cjs_js.r.error(`Failed to load customer portal ${c==null?void 0:c.message}`,c);}finally{i(false);}});},[o,o.isCustomerLoaded,r,e,t]),{customerPortal:a,showWatermark:o.getShowWatermark(),isLoading:n}}function _s(e){return Ug__default.default({manageSubscription:"Manage",usageTabTitle:"Usage",addonsTabTitle:"Add-ons",promotionsTabTitle:"Promotions",promotionsSubtitle:"You were granted access to additional functionality at no additional cost.",contactSupportTitle:"Have questions about your subscription?",contactSupportLink:"Contact support",editBilling:"Edit billing details",invoicesTitle:"Invoices",viewInvoiceHistory:"View invoice history",editPaymentDetails:"Edit",paywallSectionTitle:"Plans",cancelScheduledUpdatesButtonTitle:"Cancel"},e)}function Ds(e,t,o){var n,i,a,l;return {sectionTitleColor:(t==null?void 0:t.sectionTitleColor)||e.palette.text.secondary,planNameColor:(t==null?void 0:t.planNameColor)||e.palette.text.primary,backgroundColor:(t==null?void 0:t.backgroundColor)||((n=o==null?void 0:o.palette)==null?void 0:n.backgroundColor)||"white",borderColor:(t==null?void 0:t.borderColor)||((i=o==null?void 0:o.palette)==null?void 0:i.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(t==null?void 0:t.backgroundColor)||((a=o==null?void 0:o.palette)==null?void 0:a.backgroundColor)||"white",tabMaxHeight:(t==null?void 0:t.tabMaxHeight)||"380px",iconsColor:(t==null?void 0:t.iconsColor)||((l=o==null?void 0:o.palette)==null?void 0:l.iconsColor)||void 0,iconsBackgroundColor:t==null?void 0:t.iconsBackgroundColor}}function Do({children:e,textOverrides:t,theme:o,resourceId:r,productId:n}){let{customerPortalUpdatedAt:i}=chunkIL3DC53A_cjs_js.u(),{customerPortal:a,isLoading:l,showWatermark:s}=Us({resourceId:r,productId:n}),c=a!=null&&a.configuration?xs(a.configuration):void 0,u=chunkIL3DC53A_cjs_js.v(c),f=Ds(u,o,a==null?void 0:a.configuration),y=_s(t);return jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:c,children:jsxRuntime.jsx(ee.Provider,{value:{customerPortal:a,isLoading:l,showWatermark:s,textOverrides:y,theme:f,resourceId:r},children:e},i==null?void 0:i.toString())})}var je=chunkIL3DC53A_cjs_js.e(Pu__default.default)`
282
282
  border-radius: 10px;
283
283
  padding: 8px 16px;
284
284
  text-transform: none;
@@ -287,7 +287,7 @@
287
287
  &:hover {
288
288
  border-color: ${({theme:e})=>e.stigg.palette.outlinedRestingBorder};
289
289
  }
290
- `;var Qg=e=>jsxRuntime.jsx("svg",chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.3333 2.5L17.5 6.66667L6.66667 17.5H2.5V13.3333L13.3333 2.5V2.5Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),Gs=Qg;var Ne=chunk2FMVMEMY_cjs_js.e.div`
290
+ `;var Qg=e=>jsxRuntime.jsx("svg",chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.3333 2.5L17.5 6.66667L6.66667 17.5H2.5V13.3333L13.3333 2.5V2.5Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),Vs=Qg;var Ne=chunkIL3DC53A_cjs_js.e.div`
291
291
  display: flex;
292
292
  align-items: center;
293
293
  justify-content: space-between;
@@ -297,11 +297,11 @@
297
297
  margin-bottom: 32px;
298
298
  }
299
299
  `};
300
- `;function Me({title:e,className:t,isLoading:o}){let{theme:r}=Y();return o?jsxRuntime.jsx(Xe__default.default,{width:120}):jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:t,overrideColor:r.sectionTitleColor,variant:"h3",bold:true,children:e})}var qg=chunk2FMVMEMY_cjs_js.e(Gs)`
300
+ `;function Me({title:e,className:t,isLoading:o}){let{theme:r}=Y();return o?jsxRuntime.jsx(Xe__default.default,{width:120}):jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:t,overrideColor:r.sectionTitleColor,variant:"h3",bold:true,children:e})}var qg=chunkIL3DC53A_cjs_js.e(Vs)`
301
301
  path {
302
302
  stroke: ${({theme:e})=>e.stigg.palette.primary};
303
303
  }
304
- `;function Hs({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxRuntime.jsxs(Ne,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsxRuntime.jsx(Me,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxRuntime.jsxs(je,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsxRuntime.jsx(qg,{className:"stigg-manage-subscription-button-image"}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1",children:o==null?void 0:o.manageSubscription})]})]})}function $o(){let{customerPortal:e}=Y(),t=Jg__default.default(e==null?void 0:e.subscriptions,o=>o.addons);return Xg__default.default(t)?null:jsxRuntime.jsx("div",{className:"stigg-addons-list-layout",children:t.map((o,r)=>jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{as:"span",className:"stigg-addon-list-item-text",variant:"body1",children:[o.quantity>1&&`${o.quantity} X `,o.displayName,r===t.length-1?"":", "]},o.addonId))})}function tf(e){return String(e.endDate)}var Ws=chunk2FMVMEMY_cjs_js.e.div`
304
+ `;function Ws({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxRuntime.jsxs(Ne,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsxRuntime.jsx(Me,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxRuntime.jsxs(je,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsxRuntime.jsx(qg,{className:"stigg-manage-subscription-button-image"}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1",children:o==null?void 0:o.manageSubscription})]})]})}function $o(){let{customerPortal:e}=Y(),t=Jg__default.default(e==null?void 0:e.subscriptions,o=>o.addons);return Xg__default.default(t)?null:jsxRuntime.jsx("div",{className:"stigg-addons-list-layout",children:t.map((o,r)=>jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{as:"span",className:"stigg-addon-list-item-text",variant:"body1",children:[o.quantity>1&&`${o.quantity} X `,o.displayName,r===t.length-1?"":", "]},o.addonId))})}function tf(e){return String(e.endDate)}var Zs=chunkIL3DC53A_cjs_js.e.div`
305
305
  display: flex;
306
306
  justify-content: space-between;
307
307
  align-items: center;
@@ -312,19 +312,19 @@
312
312
  & > *:first-of-type {
313
313
  max-width: 60%;
314
314
  }
315
- `;function of(e){var n;let{displayName:t,usageLimit:o,hasUnlimitedUsage:r}=e;return r?`Unlimited ${t}`:o?`${t} x ${(n=e.usageLimit)==null?void 0:n.toLocaleString()}`:t}function Vo(){let{customerPortal:e,textOverrides:t,theme:o}=Y(),r=e==null?void 0:e.promotionalEntitlements;return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:"secondary",children:t.promotionsSubtitle}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsxs(Ws,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",bold:true,children:"Feature"}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",bold:true,children:"Expiration date"})]}),r==null?void 0:r.map((n,i)=>jsxRuntime.jsxs(Ws,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",children:of(n)}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"disabled",children:n.endDate?Z.utc(tf(n)).format("MMM Do, YYYY"):"None"})]},`${n.displayName}-${i}`))]})]})}var Zs=chunk2FMVMEMY_cjs_js.e(nf__default.default)`
315
+ `;function of(e){var n;let{displayName:t,usageLimit:o,hasUnlimitedUsage:r}=e;return r?`Unlimited ${t}`:o?`${t} x ${(n=e.usageLimit)==null?void 0:n.toLocaleString()}`:t}function Vo(){let{customerPortal:e,textOverrides:t,theme:o}=Y(),r=e==null?void 0:e.promotionalEntitlements;return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:"secondary",children:t.promotionsSubtitle}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsxs(Zs,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",bold:true,children:"Feature"}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",bold:true,children:"Expiration date"})]}),r==null?void 0:r.map((n,i)=>jsxRuntime.jsxs(Zs,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",children:of(n)}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"disabled",children:n.endDate?Z.utc(tf(n)).format("MMM Do, YYYY"):"None"})]},`${n.displayName}-${i}`))]})]})}var Ys=chunkIL3DC53A_cjs_js.e(nf__default.default)`
316
316
  .MuiTabs-indicator {
317
317
  background-color: #001e6c;
318
318
  }
319
- `,Ys=chunk2FMVMEMY_cjs_js.e.div`
319
+ `,Qs=chunkIL3DC53A_cjs_js.e.div`
320
320
  width: 100%;
321
321
  flex: 1;
322
322
  margin-top: 16px;
323
- `,Qs=chunk2FMVMEMY_cjs_js.e(ke__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
323
+ `,Ks=chunkIL3DC53A_cjs_js.e(ke__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
324
324
  margin-top: 16px;
325
325
  max-height: ${({$maxHeight:e})=>e};
326
326
  overflow-y: auto;
327
- `;chunk2FMVMEMY_cjs_js.e.div`
327
+ `;chunkIL3DC53A_cjs_js.e.div`
328
328
  display: flex;
329
329
  flex-direction: column;
330
330
  padding: 24px;
@@ -333,28 +333,28 @@
333
333
  margin-bottom: 16px;
334
334
  row-gap: 16px;
335
335
  background-color: ${({$backgroundColor:e})=>e};
336
- `;function qs(e){let a=e,{children:t,value:o,index:r,maxHeight:n}=a,i=chunk2FMVMEMY_cjs_js.c(a,["children","value","index","maxHeight"]);return jsxRuntime.jsx("div",chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({role:"tabpanel",hidden:o!==r},i),{children:o===r&&jsxRuntime.jsx(Qs,{$maxHeight:n,children:t})}))}function Js({isSelected:e,label:t,icon:o}){let r=e?"primary":"secondary";return jsxRuntime.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.i,{icon:o,svgStrokeColor:r}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",bold:e,color:r,children:t})]})}function Xs({customerPortal:e,hiddenSections:t,textOverrides:o,theme:r}){let n=Jg__default.default(e.subscriptions,y=>y.addons),i=y=>t==null?void 0:t.some(p=>p===y),a=n.length>0&&!i("addons"),l=e.promotionalEntitlements.length>0&&!i("promotionalEntitlements"),[s,c]=hi.useState(a?1:2),u=(y,p)=>{c(p);};return a||l?jsxRuntime.jsxs(Ys,{children:[jsxRuntime.jsx(ke__default.default,{sx:{borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(Zs,{value:s,onChange:u,children:[a?jsxRuntime.jsx(Ks__default.default,{sx:{textTransform:"none"},value:1,label:jsxRuntime.jsx(Js,{isSelected:s===1,label:o.addonsTabTitle,icon:"Addons"})}):null,l?jsxRuntime.jsx(Ks__default.default,{sx:{textTransform:"none"},value:2,label:jsxRuntime.jsx(Js,{isSelected:s===2,label:o.promotionsTabTitle,icon:"Promotions"})}):null]})}),jsxRuntime.jsx(qs,{value:s,index:1,maxHeight:r.tabMaxHeight,children:jsxRuntime.jsx($o,{})}),jsxRuntime.jsx(qs,{value:s,index:2,maxHeight:r.tabMaxHeight,children:jsxRuntime.jsx(Vo,{})})]}):null}var js={xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536},Vn=e=>`(min-width: ${js[e]}px)`,oe=Object.keys(js).reduce((e,t)=>chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},e),{[t]:`@media ${Vn(t)}`}),{});function me(e){return cf__default.default(Vn(e))}var df=chunk2FMVMEMY_cjs_js.e.div`
336
+ `;function Js(e){let a=e,{children:t,value:o,index:r,maxHeight:n}=a,i=chunkIL3DC53A_cjs_js.c(a,["children","value","index","maxHeight"]);return jsxRuntime.jsx("div",chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({role:"tabpanel",hidden:o!==r},i),{children:o===r&&jsxRuntime.jsx(Ks,{$maxHeight:n,children:t})}))}function Xs({isSelected:e,label:t,icon:o}){let r=e?"primary":"secondary";return jsxRuntime.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.i,{icon:o,svgStrokeColor:r}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",bold:e,color:r,children:t})]})}function js({customerPortal:e,hiddenSections:t,textOverrides:o,theme:r}){let n=Jg__default.default(e.subscriptions,y=>y.addons),i=y=>t==null?void 0:t.some(p=>p===y),a=n.length>0&&!i("addons"),l=e.promotionalEntitlements.length>0&&!i("promotionalEntitlements"),[s,c]=hi.useState(a?1:2),u=(y,p)=>{c(p);};return a||l?jsxRuntime.jsxs(Qs,{children:[jsxRuntime.jsx(ke__default.default,{sx:{borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(Ys,{value:s,onChange:u,children:[a?jsxRuntime.jsx(qs__default.default,{sx:{textTransform:"none"},value:1,label:jsxRuntime.jsx(Xs,{isSelected:s===1,label:o.addonsTabTitle,icon:"Addons"})}):null,l?jsxRuntime.jsx(qs__default.default,{sx:{textTransform:"none"},value:2,label:jsxRuntime.jsx(Xs,{isSelected:s===2,label:o.promotionsTabTitle,icon:"Promotions"})}):null]})}),jsxRuntime.jsx(Js,{value:s,index:1,maxHeight:r.tabMaxHeight,children:jsxRuntime.jsx($o,{})}),jsxRuntime.jsx(Js,{value:s,index:2,maxHeight:r.tabMaxHeight,children:jsxRuntime.jsx(Vo,{})})]}):null}var el={xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536},Vn=e=>`(min-width: ${el[e]}px)`,oe=Object.keys(el).reduce((e,t)=>chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},e),{[t]:`@media ${Vn(t)}`}),{});function me(e){return cf__default.default(Vn(e))}var df=chunkIL3DC53A_cjs_js.e.div`
337
337
  display: flex;
338
338
  justify-content: space-between;
339
339
  flex-wrap: wrap;
340
- `,pf=chunk2FMVMEMY_cjs_js.e.div`
340
+ `,pf=chunkIL3DC53A_cjs_js.e.div`
341
341
  display: flex;
342
342
  flex-direction: column;
343
343
  gap: 32px;
344
- `;function tl(){let e=me("md");return jsxRuntime.jsxs(df,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxRuntime.jsxs(pf,{children:[jsxRuntime.jsx(Xe__default.default,{width:120}),jsxRuntime.jsx(Xe__default.default,{width:120})]}),jsxRuntime.jsx(Xe__default.default,{width:e?295:260,height:193})]})}function uf({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsxRuntime.jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function gf({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,r=o===jsClientSdk.BillingPeriod.Monthly?"annually":"monthly",n=o===jsClientSdk.BillingPeriod.Monthly?"monthly":"annually";return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",r," to a ",jsxRuntime.jsx("b",{children:n})," billing cycle"]})})]})}function ff({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:r,featureId:n}=o,a=Pc__default.default(e.prices.map(({feature:u})=>u)).find(u=>u.id===n);if(!a)return null;let{featureUnits:l,featureUnitsPlural:s}=a;return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsxRuntime.jsx("b",{children:l})," quantity to ",r," ",r===1?l:s]})})]})}function rl({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case jsClientSdk.SubscriptionScheduleType.Downgrade:return jsxRuntime.jsx(uf,{scheduleUpdate:e});case jsClientSdk.SubscriptionScheduleType.BillingPeriod:return jsxRuntime.jsx(gf,{scheduleUpdate:e});case jsClientSdk.SubscriptionScheduleType.UnitAmount:return jsxRuntime.jsx(ff,{scheduleUpdate:e,subscription:t});default:return null}}var xf=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
344
+ `;function ol(){let e=me("md");return jsxRuntime.jsxs(df,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxRuntime.jsxs(pf,{children:[jsxRuntime.jsx(Xe__default.default,{width:120}),jsxRuntime.jsx(Xe__default.default,{width:120})]}),jsxRuntime.jsx(Xe__default.default,{width:e?295:260,height:193})]})}function uf({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsxRuntime.jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function gf({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,r=o===jsClientSdk.BillingPeriod.Monthly?"annually":"monthly",n=o===jsClientSdk.BillingPeriod.Monthly?"monthly":"annually";return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",r," to a ",jsxRuntime.jsx("b",{children:n})," billing cycle"]})})]})}function ff({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:r,featureId:n}=o,a=xc__default.default(e.prices.map(({feature:u})=>u)).find(u=>u.id===n);if(!a)return null;let{featureUnits:l,featureUnitsPlural:s}=a;return jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsxRuntime.jsx("b",{children:l})," quantity to ",r," ",r===1?l:s]})})]})}function nl({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case jsClientSdk.SubscriptionScheduleType.Downgrade:return jsxRuntime.jsx(uf,{scheduleUpdate:e});case jsClientSdk.SubscriptionScheduleType.BillingPeriod:return jsxRuntime.jsx(gf,{scheduleUpdate:e});case jsClientSdk.SubscriptionScheduleType.UnitAmount:return jsxRuntime.jsx(ff,{scheduleUpdate:e,subscription:t});default:return null}}var xf=chunkIL3DC53A_cjs_js.e(ke__default.default)`
345
345
  border-bottom: ${({$borderColor:e})=>`1px solid ${e}`};
346
346
  border-top-left-radius: 10px;
347
347
  border-top-right-radius: 10px;
348
348
  margin: -64px -64px 64px -64px;
349
349
  padding: 24px 32px;
350
- `,bf=chunk2FMVMEMY_cjs_js.e(iu__default.default)`
350
+ `,bf=chunkIL3DC53A_cjs_js.e(iu__default.default)`
351
351
  margin-left: 4px;
352
- `,Sf=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.h)`
352
+ `,Sf=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.h)`
353
353
  color: ${({theme:e})=>e.stigg.palette.primary};
354
354
  path {
355
355
  fill: ${({theme:e})=>e.stigg.palette.primary};
356
356
  }
357
- `;function Tf({subscription:e}){let{scheduledUpdates:t}=e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Re__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsxRuntime.jsx(Re__default.default,{children:(t||[]).map(o=>jsxRuntime.jsx(rl,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function kf({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:r,line2:n}=Io({scheduledUpdate:o,subscriptionPrices:e.prices,billingPeriodRange:e.billingPeriodRange,options:{postfix:"at the end of the current billing period"}});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Re__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:r})})}),n&&jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:n})})]})}function nl({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:r}){let n=react.useTheme(),[i,a]=hi.useState(false),{scheduledUpdates:l}=e;if(!l||l.length===0)return null;let s=l.length===1;return jsxRuntime.jsx(xf,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:s?"center":"flex-start",gap:2,children:[jsxRuntime.jsx(Re__default.default,{item:true,display:"flex",children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.i,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsxRuntime.jsx(Re__default.default,{item:true,flex:1,children:s?jsxRuntime.jsx(kf,{subscription:e}):jsxRuntime.jsx(Tf,{subscription:e})}),!!t&&jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(je,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[i?jsxRuntime.jsx(bf,{loading:true,size:16,color:n.stigg.palette.text.disabled}):jsxRuntime.jsx(Sf,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:r})]})})]})})}var Ue=chunk2FMVMEMY_cjs_js.e.div`
357
+ `;function Tf({subscription:e}){let{scheduledUpdates:t}=e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Re__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsxRuntime.jsx(Re__default.default,{children:(t||[]).map(o=>jsxRuntime.jsx(nl,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function kf({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:r,line2:n}=Io({scheduledUpdate:o,subscriptionPrices:e.prices,billingPeriodRange:e.billingPeriodRange,options:{postfix:"at the end of the current billing period"}});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Re__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:r})})}),n&&jsxRuntime.jsx(Re__default.default,{children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:n})})]})}function il({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:r}){let n=react.useTheme(),[i,a]=hi.useState(false),{scheduledUpdates:l}=e;if(!l||l.length===0)return null;let s=l.length===1;return jsxRuntime.jsx(xf,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxRuntime.jsxs(Re__default.default,{container:true,alignItems:s?"center":"flex-start",gap:2,children:[jsxRuntime.jsx(Re__default.default,{item:true,display:"flex",children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.i,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsxRuntime.jsx(Re__default.default,{item:true,flex:1,children:s?jsxRuntime.jsx(kf,{subscription:e}):jsxRuntime.jsx(Tf,{subscription:e})}),!!t&&jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsxs(je,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[i?jsxRuntime.jsx(bf,{loading:true,size:16,color:n.stigg.palette.text.disabled}):jsxRuntime.jsx(Sf,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:r})]})})]})})}var Ue=chunkIL3DC53A_cjs_js.e.div`
358
358
  width: 100%;
359
359
  display: flex;
360
360
  flex-direction: column;
@@ -372,12 +372,12 @@
372
372
  ${oe.lg} {
373
373
  padding: 64px;
374
374
  }
375
- `;function sl({billingPeriod:e,rangeEnd:t,amount:o,currency:r}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",children:"Next estimated bill"}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h1",children:H({amount:o,currency:r,maximumFractionDigits:2})}),jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{as:"div",variant:"body1",color:"secondary",children:["Billed ",e===jsClientSdk.BillingPeriod.Monthly?"monthly":"annually"," on"," ",jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",as:"span",color:"primary",children:Z.utc(t).format("MMM Do, YYYY")})]}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:"* Additional tax rates may apply"})]})}function Ho({description:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"secondary",children:"No upcoming bill"}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:e})]})}var Ef=chunk2FMVMEMY_cjs_js.e.div`
375
+ `;function ll({billingPeriod:e,rangeEnd:t,amount:o,currency:r}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",children:"Next estimated bill"}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h1",children:H({amount:o,currency:r,maximumFractionDigits:2})}),jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{as:"div",variant:"body1",color:"secondary",children:["Billed ",e===jsClientSdk.BillingPeriod.Monthly?"monthly":"annually"," on"," ",jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",as:"span",color:"primary",children:Z.utc(t).format("MMM Do, YYYY")})]}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:"* Additional tax rates may apply"})]})}function Ho({description:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"secondary",children:"No upcoming bill"}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:e})]})}var Ef=chunkIL3DC53A_cjs_js.e.div`
376
376
  display: flex;
377
377
  flex-direction: column;
378
378
  align-items: left;
379
379
  gap: 8px;
380
- `,vf=chunk2FMVMEMY_cjs_js.e(Pu__default.default)`
380
+ `,vf=chunkIL3DC53A_cjs_js.e(Pu__default.default)`
381
381
  width: fit-content;
382
382
  &.MuiButton-root {
383
383
  padding: 0;
@@ -385,7 +385,7 @@
385
385
  background: none;
386
386
  }
387
387
  }
388
- `;function cl({onContactSupport:e,label:t,linkLabel:o}){let r=jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:e?"primary.main":"secondary",children:o});return jsxRuntime.jsxs(Ef,{className:"stigg-contact-support-layout",children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-contact-support-label",color:"secondary",children:t}),e?jsxRuntime.jsx(vf,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:e,children:r}):r]})}var Uf=chunk2FMVMEMY_cjs_js.e.div`
388
+ `;function dl({onContactSupport:e,label:t,linkLabel:o}){let r=jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:e?"primary.main":"secondary",children:o});return jsxRuntime.jsxs(Ef,{className:"stigg-contact-support-layout",children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-contact-support-label",color:"secondary",children:t}),e?jsxRuntime.jsx(vf,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:e,children:r}):r]})}var Uf=chunkIL3DC53A_cjs_js.e.div`
389
389
  max-height: 278px;
390
390
  display: flex;
391
391
  flex-direction: column;
@@ -394,7 +394,7 @@
394
394
  border: ${({$borderColor:e})=>`1px solid ${e}`};
395
395
  padding: 32px;
396
396
  gap: 16px;
397
- `;function dl({subscription:e,theme:t,textOverrides:o,onContactSupport:r}){var s,c,u,f,y,p,g;let{pricingType:n}=e,i,a=(c=(s=e.prices)==null?void 0:s.every(h=>h.billingModel!==jsClientSdk.BillingModel.UsageBased))!=null?c:true,l=(u=e.scheduledUpdates)==null?void 0:u.find(({subscriptionScheduleType:h,targetPackage:P})=>h===jsClientSdk.SubscriptionScheduleType.Downgrade&&(P==null?void 0:P.pricingType)===jsClientSdk.PricingType.Free);if(n===jsClientSdk.PricingType.Free)i=jsxRuntime.jsx(Ho,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(n===jsClientSdk.PricingType.Paid)if(l&&a)i=jsxRuntime.jsx(Ho,{description:"Your plan will be downgraded to a free plan, so you don\u2019t have any upcoming charges"});else if(e.status===jsClientSdk.SubscriptionStatus.InTrial)i=jsxRuntime.jsx(Ho,{description:`You\u2019re on a free trial of the ${e.planName} plan, so you don\u2019t have any upcoming charges`});else {let h=(y=(f=e.prices)==null?void 0:f[0])==null?void 0:y.billingPeriod,P=(p=e.billingPeriodRange)==null?void 0:p.end,b=(g=e.totalPrice)==null?void 0:g.total;h&&P&&b&&(i=jsxRuntime.jsx(sl,{billingPeriod:h,rangeEnd:P,amount:b.amount,currency:b.currency}));}else n===jsClientSdk.PricingType.Custom&&(i=jsxRuntime.jsx(cl,{onContactSupport:r,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsxRuntime.jsx(Uf,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:i})}var _f=e=>jsxRuntime.jsxs("svg",chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("path",{d:"M12.9469 13.5999H11.9344L11.935 10.7756C11.935 10.6288 11.87 10.4819 11.7557 10.3838L8.62061 7.91816L11.755 5.4532C11.8694 5.35507 11.9344 5.22444 11.9344 5.06132L11.935 2.40004H12.9475C13.225 2.40004 13.4375 2.18755 13.4375 1.91004C13.4375 1.63254 13.225 1.42004 12.9475 1.42004L3.05311 1.42067C2.77561 1.42067 2.56311 1.63316 2.56311 1.91067C2.56311 2.18817 2.77561 2.40067 3.05311 2.40067H4.06561L4.06498 5.06131C4.06498 5.20818 4.12998 5.35505 4.24436 5.45318L7.36244 7.91814L4.245 10.3837C4.13062 10.4819 4.06562 10.6125 4.06562 10.7756V13.5999H3.05313C2.77562 13.5999 2.56313 13.8124 2.56313 14.0899C2.56313 14.3674 2.77562 14.5799 3.05313 14.5799H12.9469C13.2244 14.5799 13.4369 14.3674 13.4369 14.0899C13.4369 13.8124 13.2244 13.5999 12.9469 13.5999ZM5.04498 2.39995H10.9551V4.81627L8.00002 7.16747L5.04498 4.81627V2.39995ZM5.04498 11.0206L8.00002 8.66939L10.9551 11.0044V13.5838H5.04498V11.0206Z",fill:"white"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.05303 1.25404L12.9474 1.25342C13.317 1.25342 13.6041 1.54053 13.6041 1.91008C13.6041 2.27964 13.317 2.56675 12.9474 2.56675H12.1016L12.101 5.06136V5.06136C12.101 5.2747 12.0135 5.45101 11.8635 5.57973L11.8581 5.58436L8.89014 7.9182L11.8642 10.2572C12.0164 10.3878 12.1016 10.5814 12.1016 10.7757L12.101 13.4333H12.9468C13.3164 13.4333 13.6035 13.7204 13.6035 14.09C13.6035 14.4595 13.3164 14.7466 12.9468 14.7466H3.05304C2.68349 14.7466 2.39638 14.4595 2.39638 14.09C2.39638 13.7204 2.68349 13.4333 3.05304 13.4333H3.89887V10.7757C3.89887 10.5623 3.98635 10.386 4.13639 10.2573L4.14144 10.253L7.09365 7.91821L4.13566 5.57982C3.98346 5.44923 3.89823 5.25562 3.89823 5.06135L3.89882 2.56738H3.05303C2.68348 2.56738 2.39636 2.28026 2.39636 1.91071C2.39636 1.54116 2.68348 1.25405 3.05303 1.25404V1.25404ZM12.9474 1.58675L3.05304 1.58738C2.86758 1.58738 2.7297 1.72525 2.7297 1.91071C2.7297 2.09617 2.86757 2.23404 3.05303 2.23404H4.23223L4.23157 5.06135V5.06135C4.23158 5.15983 4.27538 5.25908 4.35053 5.32476L7.63107 7.91815L4.35113 10.5123C4.2739 10.5795 4.23221 10.6639 4.23221 10.7757V13.7666H3.05304C2.86759 13.7666 2.72971 13.9045 2.72971 14.09C2.72971 14.2754 2.86759 14.4133 3.05304 14.4133H12.9468C13.1323 14.4133 13.2701 14.2754 13.2701 14.09C13.2701 13.9045 13.1323 13.7667 12.9468 13.7667H11.7676L11.7683 10.7757V10.7757C11.7683 10.6772 11.7245 10.5781 11.6495 10.5124L8.35092 7.91819L11.6489 5.32461C11.726 5.25743 11.7676 5.17306 11.7676 5.06136L11.7683 2.23342H12.9474C13.1329 2.23342 13.2708 2.09554 13.2708 1.91008C13.2708 1.72463 13.1329 1.58676 12.9474 1.58675V1.58675ZM4.87823 2.23332H11.1216V4.89669L7.99994 7.3805L4.87823 4.89669V2.23332ZM5.21157 2.56666V4.73593L7.99994 6.95452L10.7883 4.73593V2.56666H5.21157ZM7.99958 8.45673L11.1216 10.9237V13.7505H4.87823V10.9403L7.99958 8.45673ZM8.0003 8.88213L5.21157 11.101V13.4172H10.7883V11.0852L8.0003 8.88213Z",fill:"white"})]})),ml=_f;var Ze=chunk2FMVMEMY_cjs_js.e(n=>{var i=n,{children:e,className:t,placement:o="top"}=i,r=chunk2FMVMEMY_cjs_js.c(i,["children","className","placement"]);return jsxRuntime.jsx($f__default.default,chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({arrow:true,placement:o},r),{classes:{popper:t,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"},children:jsxRuntime.jsx("div",{children:e})}))})(({theme:e,$padding:t=8,$maxWidth:o=300})=>({[`& .${$f.tooltipClasses.tooltip}`]:{backgroundColor:e.stigg.palette.white,maxWidth:o,boxShadow:e.stigg.shadows.popover,padding:t,borderRadius:e.stigg.border.radius,color:e.stigg.palette.text.primary},[`& .${$f.tooltipClasses.arrow}`]:{color:e.stigg.palette.white}}));var Of=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
397
+ `;function pl({subscription:e,theme:t,textOverrides:o,onContactSupport:r}){var s,c,u,f,y,p,g;let{pricingType:n}=e,i,a=(c=(s=e.prices)==null?void 0:s.every(h=>h.billingModel!==jsClientSdk.BillingModel.UsageBased))!=null?c:true,l=(u=e.scheduledUpdates)==null?void 0:u.find(({subscriptionScheduleType:h,targetPackage:P})=>h===jsClientSdk.SubscriptionScheduleType.Downgrade&&(P==null?void 0:P.pricingType)===jsClientSdk.PricingType.Free);if(n===jsClientSdk.PricingType.Free)i=jsxRuntime.jsx(Ho,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(n===jsClientSdk.PricingType.Paid)if(l&&a)i=jsxRuntime.jsx(Ho,{description:"Your plan will be downgraded to a free plan, so you don\u2019t have any upcoming charges"});else if(e.status===jsClientSdk.SubscriptionStatus.InTrial)i=jsxRuntime.jsx(Ho,{description:`You\u2019re on a free trial of the ${e.planName} plan, so you don\u2019t have any upcoming charges`});else {let h=(y=(f=e.prices)==null?void 0:f[0])==null?void 0:y.billingPeriod,P=(p=e.billingPeriodRange)==null?void 0:p.end,b=(g=e.totalPrice)==null?void 0:g.total;h&&P&&b&&(i=jsxRuntime.jsx(ll,{billingPeriod:h,rangeEnd:P,amount:b.amount,currency:b.currency}));}else n===jsClientSdk.PricingType.Custom&&(i=jsxRuntime.jsx(dl,{onContactSupport:r,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsxRuntime.jsx(Uf,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:i})}var _f=e=>jsxRuntime.jsxs("svg",chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("path",{d:"M12.9469 13.5999H11.9344L11.935 10.7756C11.935 10.6288 11.87 10.4819 11.7557 10.3838L8.62061 7.91816L11.755 5.4532C11.8694 5.35507 11.9344 5.22444 11.9344 5.06132L11.935 2.40004H12.9475C13.225 2.40004 13.4375 2.18755 13.4375 1.91004C13.4375 1.63254 13.225 1.42004 12.9475 1.42004L3.05311 1.42067C2.77561 1.42067 2.56311 1.63316 2.56311 1.91067C2.56311 2.18817 2.77561 2.40067 3.05311 2.40067H4.06561L4.06498 5.06131C4.06498 5.20818 4.12998 5.35505 4.24436 5.45318L7.36244 7.91814L4.245 10.3837C4.13062 10.4819 4.06562 10.6125 4.06562 10.7756V13.5999H3.05313C2.77562 13.5999 2.56313 13.8124 2.56313 14.0899C2.56313 14.3674 2.77562 14.5799 3.05313 14.5799H12.9469C13.2244 14.5799 13.4369 14.3674 13.4369 14.0899C13.4369 13.8124 13.2244 13.5999 12.9469 13.5999ZM5.04498 2.39995H10.9551V4.81627L8.00002 7.16747L5.04498 4.81627V2.39995ZM5.04498 11.0206L8.00002 8.66939L10.9551 11.0044V13.5838H5.04498V11.0206Z",fill:"white"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.05303 1.25404L12.9474 1.25342C13.317 1.25342 13.6041 1.54053 13.6041 1.91008C13.6041 2.27964 13.317 2.56675 12.9474 2.56675H12.1016L12.101 5.06136V5.06136C12.101 5.2747 12.0135 5.45101 11.8635 5.57973L11.8581 5.58436L8.89014 7.9182L11.8642 10.2572C12.0164 10.3878 12.1016 10.5814 12.1016 10.7757L12.101 13.4333H12.9468C13.3164 13.4333 13.6035 13.7204 13.6035 14.09C13.6035 14.4595 13.3164 14.7466 12.9468 14.7466H3.05304C2.68349 14.7466 2.39638 14.4595 2.39638 14.09C2.39638 13.7204 2.68349 13.4333 3.05304 13.4333H3.89887V10.7757C3.89887 10.5623 3.98635 10.386 4.13639 10.2573L4.14144 10.253L7.09365 7.91821L4.13566 5.57982C3.98346 5.44923 3.89823 5.25562 3.89823 5.06135L3.89882 2.56738H3.05303C2.68348 2.56738 2.39636 2.28026 2.39636 1.91071C2.39636 1.54116 2.68348 1.25405 3.05303 1.25404V1.25404ZM12.9474 1.58675L3.05304 1.58738C2.86758 1.58738 2.7297 1.72525 2.7297 1.91071C2.7297 2.09617 2.86757 2.23404 3.05303 2.23404H4.23223L4.23157 5.06135V5.06135C4.23158 5.15983 4.27538 5.25908 4.35053 5.32476L7.63107 7.91815L4.35113 10.5123C4.2739 10.5795 4.23221 10.6639 4.23221 10.7757V13.7666H3.05304C2.86759 13.7666 2.72971 13.9045 2.72971 14.09C2.72971 14.2754 2.86759 14.4133 3.05304 14.4133H12.9468C13.1323 14.4133 13.2701 14.2754 13.2701 14.09C13.2701 13.9045 13.1323 13.7667 12.9468 13.7667H11.7676L11.7683 10.7757V10.7757C11.7683 10.6772 11.7245 10.5781 11.6495 10.5124L8.35092 7.91819L11.6489 5.32461C11.726 5.25743 11.7676 5.17306 11.7676 5.06136L11.7683 2.23342H12.9474C13.1329 2.23342 13.2708 2.09554 13.2708 1.91008C13.2708 1.72463 13.1329 1.58676 12.9474 1.58675V1.58675ZM4.87823 2.23332H11.1216V4.89669L7.99994 7.3805L4.87823 4.89669V2.23332ZM5.21157 2.56666V4.73593L7.99994 6.95452L10.7883 4.73593V2.56666H5.21157ZM7.99958 8.45673L11.1216 10.9237V13.7505H4.87823V10.9403L7.99958 8.45673ZM8.0003 8.88213L5.21157 11.101V13.4172H10.7883V11.0852L8.0003 8.88213Z",fill:"white"})]})),ul=_f;var Ze=chunkIL3DC53A_cjs_js.e(n=>{var i=n,{children:e,className:t,placement:o="top"}=i,r=chunkIL3DC53A_cjs_js.c(i,["children","className","placement"]);return jsxRuntime.jsx($f__default.default,chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({arrow:true,placement:o},r),{classes:{popper:t,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"},children:jsxRuntime.jsx("div",{children:e})}))})(({theme:e,$padding:t=8,$maxWidth:o=300})=>({[`& .${$f.tooltipClasses.tooltip}`]:{backgroundColor:e.stigg.palette.white,maxWidth:o,boxShadow:e.stigg.shadows.popover,padding:t,borderRadius:e.stigg.border.radius,color:e.stigg.palette.text.primary},[`& .${$f.tooltipClasses.arrow}`]:{color:e.stigg.palette.white}}));var Of=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
398
398
  display: ${({$display:e})=>e};
399
399
  -webkit-line-clamp: ${({$maxLines:e})=>e};
400
400
  -webkit-box-orient: vertical;
@@ -408,7 +408,7 @@
408
408
  ${({$bold:e})=>e&&react.css`
409
409
  font-weight: bold;
410
410
  `}
411
- `;function yl(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var Ae=({leaveDelay:e,children:t,variant:o,color:r,maxLines:n=1,wordBreak:i,bold:a,tooltipPlacement:l="top",className:s,display:c="-webkit-box",style:u,"data-testid":f})=>{let[y,p]=hi.useState(false),g=hi.useRef(null),h=jsxRuntime.jsx(Of,{ref:g,variant:o,color:r,$maxLines:n,$wordBreak:i,$bold:a,className:s,$display:c,style:u,"data-testid":f,children:t});hi.useEffect(()=>{if(g!=null&&g.current){let b=yl(g.current);p(b);}},[g]);let P=(g==null?void 0:g.current)&&yl(g.current);return jsxRuntime.jsx("span",{children:y||P?jsxRuntime.jsx(Ze,{placement:l,leaveDelay:e,title:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",children:t}),children:h}):h})};var Zf=chunk2FMVMEMY_cjs_js.e.div`
411
+ `;function hl(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var Ae=({leaveDelay:e,children:t,variant:o,color:r,maxLines:n=1,wordBreak:i,bold:a,tooltipPlacement:l="top",className:s,display:c="-webkit-box",style:u,"data-testid":f})=>{let[y,p]=hi.useState(false),g=hi.useRef(null),h=jsxRuntime.jsx(Of,{ref:g,variant:o,color:r,$maxLines:n,$wordBreak:i,$bold:a,className:s,$display:c,style:u,"data-testid":f,children:t});hi.useEffect(()=>{if(g!=null&&g.current){let b=hl(g.current);p(b);}},[g]);let P=(g==null?void 0:g.current)&&hl(g.current);return jsxRuntime.jsx("span",{children:y||P?jsxRuntime.jsx(Ze,{placement:l,leaveDelay:e,title:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",children:t}),children:h}):h})};var Zf=chunkIL3DC53A_cjs_js.e.div`
412
412
  width: 100%;
413
413
  display: flex;
414
414
  align-items: center;
@@ -417,48 +417,48 @@
417
417
  border-radius: 10px;
418
418
  padding: 8px 16px;
419
419
  margin-top: 16px;
420
- `,Yf=chunk2FMVMEMY_cjs_js.e(Wf__default.default)`
420
+ `,Yf=chunkIL3DC53A_cjs_js.e(Wf__default.default)`
421
421
  text-decoration-color: white;
422
422
  color: white;
423
423
  cursor: pointer;
424
- `;function Cl({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==jsClientSdk.SubscriptionStatus.InTrial?null:jsxRuntime.jsxs(Zf,{className:"stigg-subscription-trial-badge",children:[jsxRuntime.jsx(ml,{className:"stigg-subscription-trial-badge-image"}),jsxRuntime.jsx("div",{style:{flex:1,marginRight:4},children:jsxRuntime.jsxs(Ae,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white",children:[`${e.trialRemainingDays} days remaining in trial`,t&&` of the ${e.planName} plan`]})}),jsxRuntime.jsx(Yf,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:"white",children:"Upgrade plan"})})]})}function xl({mainSubscription:e,trialSubscription:t,onManageSubscription:o,theme:r}){return jsxRuntime.jsxs("div",{className:"stigg-subscription-view-layout",children:[jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:r.planNameColor,style:{marginTop:8},children:[e.planName," plan"]}),jsxRuntime.jsx(Cl,{subscription:t,includePlanName:(t==null?void 0:t.planName)!==e.planName,onManageSubscription:o})]})}var Yn=70;function et(e,t){return t===0?0:Math.min(Math.floor(e/t*100),100)}function bl(e){let t;return e<Yn?t="standard":e<100?t="warning":t="error",t}function Kf(e){return String(e.usagePeriodEnd)}function Sl(e){if(!e.resetPeriod||!e.usagePeriodEnd)return null;let t=Kf(e),o=r=>Z.utc(t).diff(Z.utc(),r);switch(e.resetPeriod){case jsClientSdk.EntitlementResetPeriod.Month:return `Resets monthly - in ${o("days")} days`;case jsClientSdk.EntitlementResetPeriod.Week:return `Resets weekly - in ${o("days")} days`;case jsClientSdk.EntitlementResetPeriod.Day:return `Resets daily - in ${o("hours")} hours`;case jsClientSdk.EntitlementResetPeriod.Hour:return `Resets hourly - in ${o("minutes")} minutes`;default:return null}}var Xf=chunk2FMVMEMY_cjs_js.e(qf__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
424
+ `;function Pl({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==jsClientSdk.SubscriptionStatus.InTrial?null:jsxRuntime.jsxs(Zf,{className:"stigg-subscription-trial-badge",children:[jsxRuntime.jsx(ul,{className:"stigg-subscription-trial-badge-image"}),jsxRuntime.jsx("div",{style:{flex:1,marginRight:4},children:jsxRuntime.jsxs(Ae,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white",children:[`${e.trialRemainingDays} days remaining in trial`,t&&` of the ${e.planName} plan`]})}),jsxRuntime.jsx(Yf,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:"white",children:"Upgrade plan"})})]})}function bl({mainSubscription:e,trialSubscription:t,onManageSubscription:o,theme:r}){return jsxRuntime.jsxs("div",{className:"stigg-subscription-view-layout",children:[jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:r.planNameColor,style:{marginTop:8},children:[e.planName," plan"]}),jsxRuntime.jsx(Pl,{subscription:t,includePlanName:(t==null?void 0:t.planName)!==e.planName,onManageSubscription:o})]})}var Yn=70;function et(e,t){return t===0?0:Math.min(Math.floor(e/t*100),100)}function Sl(e){let t;return e<Yn?t="standard":e<100?t="warning":t="error",t}function Kf(e){return String(e.usagePeriodEnd)}function Tl(e){if(!e.resetPeriod||!e.usagePeriodEnd)return null;let t=Kf(e),o=r=>Z.utc(t).diff(Z.utc(),r);switch(e.resetPeriod){case jsClientSdk.EntitlementResetPeriod.Month:return `Resets monthly - in ${o("days")} days`;case jsClientSdk.EntitlementResetPeriod.Week:return `Resets weekly - in ${o("days")} days`;case jsClientSdk.EntitlementResetPeriod.Day:return `Resets daily - in ${o("hours")} hours`;case jsClientSdk.EntitlementResetPeriod.Hour:return `Resets hourly - in ${o("minutes")} minutes`;default:return null}}var Xf=chunkIL3DC53A_cjs_js.e(qf__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
425
425
  height: 4px;
426
426
  background-color: ${({theme:e})=>Ni__default.default(e.stigg.palette.primary).alpha(.4).string()};
427
427
 
428
428
  span {
429
429
  background-color: ${({$progressStatus:e,theme:t})=>{switch(e){case "standard":return t.stigg.palette.primary;case "warning":return t.stigg.palette.warning;case "error":return t.stigg.palette.error;default:return t.stigg.palette.primary}}};
430
430
  }
431
- `;function Ko({currentUsage:e,usageLimit:t,classNamePrefix:o="stigg-usage-progress-bar"}){let r=et(e,t),n=bl(r);return jsxRuntime.jsx(Xf,{$progressStatus:n,className:`${o} ${o}-${n}`,variant:"determinate",value:r})}var oy=chunk2FMVMEMY_cjs_js.e(Nl__default.default)`
431
+ `;function Ko({currentUsage:e,usageLimit:t,classNamePrefix:o="stigg-usage-progress-bar"}){let r=et(e,t),n=Sl(r);return jsxRuntime.jsx(Xf,{$progressStatus:n,className:`${o} ${o}-${n}`,variant:"determinate",value:r})}var oy=chunkIL3DC53A_cjs_js.e(Ml__default.default)`
432
432
  border-style: dotted;
433
433
  border-bottom-width: 2px;
434
434
  border-color: ${({theme:e})=>Ni__default.default(e.stigg.palette.outlinedRestingBorder).alpha(.4).string()};
435
- `;function qo({entitlement:e}){return e.hasUnlimitedUsage?jsxRuntime.jsx(oy,{}):jsxRuntime.jsx(Ko,{currentUsage:e.currentUsage||0,usageLimit:e.usageLimit,classNamePrefix:"stigg-feature-usage-progress-bar"})}var kl=chunk2FMVMEMY_cjs_js.e(Pu__default.default)`
435
+ `;function qo({entitlement:e}){return e.hasUnlimitedUsage?jsxRuntime.jsx(oy,{}):jsxRuntime.jsx(Ko,{currentUsage:e.currentUsage||0,usageLimit:e.usageLimit,classNamePrefix:"stigg-feature-usage-progress-bar"})}var wl=chunkIL3DC53A_cjs_js.e(Pu__default.default)`
436
436
  text-transform: none;
437
437
  padding: 0;
438
438
  white-space: nowrap;
439
- `;function Xo({featureEntitlement:e,feature:t,onManageSubscription:o,onBuyMore:r,canBuyMore:n,canUpgradeSubscription:i,hasCustomSubscription:a}){return a||e.hasUnlimitedUsage||et(e.currentUsage||0,e.usageLimit)<Yn?null:n?r?jsxRuntime.jsx(kl,{variant:"text",onClick:()=>r(t,e),children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:"primary.main",children:"Buy more"})}):null:i&&o?jsxRuntime.jsx(kl,{variant:"text",onClick:()=>o({intentionType:"UPGRADE_PLAN"}),children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:"primary.main",children:"Upgrade"})}):null}function wl({amount:e,currency:t,blockSize:o,featureEntitlement:r,feature:n,hideChargePrice:i,onBuyMore:a,onManageSubscription:l,canUpgradeSubscription:s,hasCustomSubscription:c}){var u,f,y;return jsxRuntime.jsxs("div",{className:`stigg-charge-list-item stigg-charge-list-item-${r.feature.refId}`,style:{display:"flex",flexDirection:"column",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(Ae,{variant:"body1",color:"primary",children:n.displayName}),!i&&jsxRuntime.jsxs(Ae,{variant:"body1",color:"secondary",children:[H({amount:e,currency:t})," per ",o?`${o} `:"",o?n.featureUnitsPlural:n.featureUnits]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(Xo,{featureEntitlement:r,feature:n,canBuyMore:true,onBuyMore:a,onManageSubscription:l,canUpgradeSubscription:s,hasCustomSubscription:c}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"},children:r.hasUnlimitedUsage?(u=r.currentUsage)==null?void 0:u.toLocaleString():`${(f=r.currentUsage)==null?void 0:f.toLocaleString()} of ${(y=r.usageLimit)==null?void 0:y.toLocaleString()}`})]})]}),jsxRuntime.jsx(qo,{entitlement:r})]})}function Al({subscription:e,entitlements:t,onBuyMore:o,onManageSubscription:r,hasCustomSubscription:n,canUpgradeSubscription:i}){let a=$l__default.default(t,"feature.refId"),l=e.prices.filter(({feature:s,price:c})=>!!s&&a[s.refId]&&!!c);return l.length?jsxRuntime.jsx("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32},children:l.map(({feature:s,price:c,blockSize:u,billingModel:f})=>{if(!s||!c)return null;let y=a[s.refId];return !y||!y.feature?null:jsxRuntime.jsx(wl,{featureEntitlement:y,feature:y.feature,amount:c.amount,blockSize:u,currency:c.currency,hideChargePrice:f===jsClientSdk.BillingModel.PerUnit,onBuyMore:o,onManageSubscription:r,canUpgradeSubscription:i,hasCustomSubscription:n},s.refId)})}):null}function kt(e){return e.__typename==="FeatureEntitlement"}function er(e){return e.__typename==="CreditEntitlement"}function tr({onManageSubscription:e,onBuyMore:t,onCancelScheduledUpdates:o,onContactSupport:r,hiddenSections:n,cancelScheduledUpdatesButtonTitle:i}){let{customerPortal:a,isLoading:l,textOverrides:s,theme:c}=Y(),u=l||!a,{subscriptions:f,entitlementsV2:y,canUpgradeSubscription:p}=a||{},g=hi.useMemo(()=>y?y.filter(kt):[],[y]),h=f==null?void 0:f.find(({status:A})=>A===jsClientSdk.SubscriptionStatus.Active),P=f==null?void 0:f.find(({status:A})=>A===jsClientSdk.SubscriptionStatus.InTrial),b=(h==null?void 0:h.pricingType)===jsClientSdk.PricingType.Custom,x=h||P;return jsxRuntime.jsxs(Ue,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[!u&&h&&h.scheduledUpdates&&jsxRuntime.jsx(nl,{theme:c,subscription:h,onCancelScheduledUpdates:o,cancelScheduledUpdatesButtonTitle:i}),u||!x?jsxRuntime.jsx(tl,{}):jsxRuntime.jsxs("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64,flexWrap:"wrap"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[jsxRuntime.jsx(Hs,{onManageSubscription:e,hideManageButton:b,textOverrides:s}),jsxRuntime.jsx(xl,{mainSubscription:x,trialSubscription:P,theme:c,onManageSubscription:e}),h&&g.length>0&&jsxRuntime.jsx(Al,{subscription:h,entitlements:g,onBuyMore:t,onManageSubscription:e,canUpgradeSubscription:!!p,hasCustomSubscription:b}),jsxRuntime.jsx(Xs,{customerPortal:a,hiddenSections:n,textOverrides:s,theme:c})]}),jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24},children:jsxRuntime.jsx(dl,{subscription:x,theme:c,onContactSupport:r,textOverrides:s})})]})]})}var ly=chunk2FMVMEMY_cjs_js.e.div`
439
+ `;function Xo({featureEntitlement:e,feature:t,onManageSubscription:o,onBuyMore:r,canBuyMore:n,canUpgradeSubscription:i,hasCustomSubscription:a}){return a||e.hasUnlimitedUsage||et(e.currentUsage||0,e.usageLimit)<Yn?null:n?r?jsxRuntime.jsx(wl,{variant:"text",onClick:()=>r(t,e),children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:"primary.main",children:"Buy more"})}):null:i&&o?jsxRuntime.jsx(wl,{variant:"text",onClick:()=>o({intentionType:"UPGRADE_PLAN"}),children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:"primary.main",children:"Upgrade"})}):null}function Bl({amount:e,currency:t,blockSize:o,featureEntitlement:r,feature:n,hideChargePrice:i,onBuyMore:a,onManageSubscription:l,canUpgradeSubscription:s,hasCustomSubscription:c}){var u,f,y;return jsxRuntime.jsxs("div",{className:`stigg-charge-list-item stigg-charge-list-item-${r.feature.refId}`,style:{display:"flex",flexDirection:"column",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(Ae,{variant:"body1",color:"primary",children:n.displayName}),!i&&jsxRuntime.jsxs(Ae,{variant:"body1",color:"secondary",children:[H({amount:e,currency:t})," per ",o?`${o} `:"",o?n.featureUnitsPlural:n.featureUnits]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(Xo,{featureEntitlement:r,feature:n,canBuyMore:true,onBuyMore:a,onManageSubscription:l,canUpgradeSubscription:s,hasCustomSubscription:c}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"},children:r.hasUnlimitedUsage?(u=r.currentUsage)==null?void 0:u.toLocaleString():`${(f=r.currentUsage)==null?void 0:f.toLocaleString()} of ${(y=r.usageLimit)==null?void 0:y.toLocaleString()}`})]})]}),jsxRuntime.jsx(qo,{entitlement:r})]})}function Il({subscription:e,entitlements:t,onBuyMore:o,onManageSubscription:r,hasCustomSubscription:n,canUpgradeSubscription:i}){let a=Gl__default.default(t,"feature.refId"),l=e.prices.filter(({feature:s,price:c})=>!!s&&a[s.refId]&&!!c);return l.length?jsxRuntime.jsx("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32},children:l.map(({feature:s,price:c,blockSize:u,billingModel:f})=>{if(!s||!c)return null;let y=a[s.refId];return !y||!y.feature?null:jsxRuntime.jsx(Bl,{featureEntitlement:y,feature:y.feature,amount:c.amount,blockSize:u,currency:c.currency,hideChargePrice:f===jsClientSdk.BillingModel.PerUnit,onBuyMore:o,onManageSubscription:r,canUpgradeSubscription:i,hasCustomSubscription:n},s.refId)})}):null}function kt(e){return e.__typename==="FeatureEntitlement"}function er(e){return e.__typename==="CreditEntitlement"}function tr({onManageSubscription:e,onBuyMore:t,onCancelScheduledUpdates:o,onContactSupport:r,hiddenSections:n,cancelScheduledUpdatesButtonTitle:i}){let{customerPortal:a,isLoading:l,textOverrides:s,theme:c}=Y(),u=l||!a,{subscriptions:f,entitlementsV2:y,canUpgradeSubscription:p}=a||{},g=hi.useMemo(()=>y?y.filter(kt):[],[y]),h=f==null?void 0:f.find(({status:A})=>A===jsClientSdk.SubscriptionStatus.Active),P=f==null?void 0:f.find(({status:A})=>A===jsClientSdk.SubscriptionStatus.InTrial),b=(h==null?void 0:h.pricingType)===jsClientSdk.PricingType.Custom,x=h||P;return jsxRuntime.jsxs(Ue,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[!u&&h&&h.scheduledUpdates&&jsxRuntime.jsx(il,{theme:c,subscription:h,onCancelScheduledUpdates:o,cancelScheduledUpdatesButtonTitle:i}),u||!x?jsxRuntime.jsx(ol,{}):jsxRuntime.jsxs("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64,flexWrap:"wrap"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[jsxRuntime.jsx(Ws,{onManageSubscription:e,hideManageButton:b,textOverrides:s}),jsxRuntime.jsx(bl,{mainSubscription:x,trialSubscription:P,theme:c,onManageSubscription:e}),h&&g.length>0&&jsxRuntime.jsx(Il,{subscription:h,entitlements:g,onBuyMore:t,onManageSubscription:e,canUpgradeSubscription:!!p,hasCustomSubscription:b}),jsxRuntime.jsx(js,{customerPortal:a,hiddenSections:n,textOverrides:s,theme:c})]}),jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24},children:jsxRuntime.jsx(pl,{subscription:x,theme:c,onContactSupport:r,textOverrides:s})})]})]})}var ly=chunkIL3DC53A_cjs_js.e.div`
440
440
  display: flex;
441
441
  width: 100%;
442
442
  align-items: flex-end;
443
443
  justify-content: flex-end;
444
444
  margin-bottom: 24px;
445
- `;function El({showWatermark:e}){return jsxRuntime.jsx(ly,{className:"stigg-customer-portal-header-layout",children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.q,{source:"customer_portal",showWatermark:e})})}var dy=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
445
+ `;function vl({showWatermark:e}){return jsxRuntime.jsx(ly,{className:"stigg-customer-portal-header-layout",children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.q,{source:"customer_portal",showWatermark:e})})}var dy=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
446
446
  text-transform: none;
447
- `,py=chunk2FMVMEMY_cjs_js.e(reactFeather.ExternalLink)`
447
+ `,py=chunkIL3DC53A_cjs_js.e(reactFeather.ExternalLink)`
448
448
  color: ${({theme:e})=>e.stigg.palette.primary};
449
- `;function or({text:e,url:t,className:o}){return jsxRuntime.jsx(je,{className:o,variant:"outlined",startIcon:jsxRuntime.jsx(py,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsxRuntime.jsx(dy,{color:"primary.main",children:e})})}var rr=chunk2FMVMEMY_cjs_js.e.div`
449
+ `;function or({text:e,url:t,className:o}){return jsxRuntime.jsx(je,{className:o,variant:"outlined",startIcon:jsxRuntime.jsx(py,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsxRuntime.jsx(dy,{color:"primary.main",children:e})})}var rr=chunkIL3DC53A_cjs_js.e.div`
450
450
  display: flex;
451
451
  flex-direction: column;
452
452
  align-items: flex-start;
453
453
  gap: 16px;
454
454
  flex: 1 0 0;
455
- `,my=chunk2FMVMEMY_cjs_js.e.div`
455
+ `,my=chunkIL3DC53A_cjs_js.e.div`
456
456
  display: flex;
457
457
  align-items: flex-start;
458
458
  gap: 16px;
459
459
  align-self: stretch;
460
460
  flex-wrap: wrap;
461
- `;function Jn({title:e,rows:t}){return jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"secondary",bold:true,children:e}),t.map(({classNamePrefix:o,label:r,value:n,labelTypographyProps:i,valueTypographyProps:a})=>jsxRuntime.jsxs(my,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({className:`${o}-label`,variant:"body1",color:"secondary",style:{width:80}},i),{children:r})),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({className:`${o}-text`,variant:"body1",color:"secondary"},a),{children:n}))]},r))]})}function nr(){return jsxRuntime.jsx(Xe__default.default,{width:220,height:42})}function ar(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=Y(),n=me("md"),{billingInformation:i}=e||{},a=!i||t,l=[];if(a?l.push(jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(Xe__default.default,{width:220,height:12}),jsxRuntime.jsx(Xe__default.default,{width:220,height:12}),jsxRuntime.jsx(Xe__default.default,{width:220,height:12})]},"information-loading-data-top"),jsxRuntime.jsx(Nl__default.default,{orientation:"vertical",style:{minHeight:93,display:n?"block":"none"}},"information-loading-data-divider"),jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(Xe__default.default,{width:220,height:12}),jsxRuntime.jsx(Xe__default.default,{width:220,height:12}),jsxRuntime.jsx(Xe__default.default,{width:220,height:12})]},"information-loading-data-bottom")):(l.push(jsxRuntime.jsx(Jn,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(i==null?void 0:i.name)||"-",valueTypographyProps:i!=null&&i.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(i==null?void 0:i.email)||"-",valueTypographyProps:i!=null&&i.email?{}:{color:"disabled"}}]},"information-billing-data-billed-to")),i!=null&&i.defaultPaymentMethodId&&i.defaultPaymentMethodLast4Digits&&i.defaultPaymentExpirationMonth&&i.defaultPaymentExpirationYear&&(l.unshift(jsxRuntime.jsx(Nl__default.default,{orientation:"vertical",style:{minHeight:93,display:n?"block":"none"}},"information-billing-data-divider")),l.unshift(jsxRuntime.jsx(Jn,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:`Ending in ${i.defaultPaymentMethodLast4Digits}`},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:`${fy__default.default(i.defaultPaymentExpirationMonth.toString(),2,"0")}/${i.defaultPaymentExpirationYear}`}]},"information-billing-data-payment-method")))),!a&&!(i!=null&&i.name)&&!(i!=null&&i.email)&&!(i!=null&&i.defaultPaymentMethodId))return null;let s=a?jsxRuntime.jsx(nr,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(or,{url:e.billingPortalUrl,text:o.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return jsxRuntime.jsxs(Ue,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:[jsxRuntime.jsxs(Ne,{className:"stigg-payment-details-section-header",children:[jsxRuntime.jsx(Me,{isLoading:a,className:"stigg-payment-details-section-title",title:"Payment details"}),s]}),jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"stretch",gap:n?64:32,flexWrap:"wrap"},children:l})]})}var Ml=chunk2FMVMEMY_cjs_js.e(Ue)`
461
+ `;function Jn({title:e,rows:t}){return jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"secondary",bold:true,children:e}),t.map(({classNamePrefix:o,label:r,value:n,labelTypographyProps:i,valueTypographyProps:a})=>jsxRuntime.jsxs(my,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({className:`${o}-label`,variant:"body1",color:"secondary",style:{width:80}},i),{children:r})),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({className:`${o}-text`,variant:"body1",color:"secondary"},a),{children:n}))]},r))]})}function nr(){return jsxRuntime.jsx(Xe__default.default,{width:220,height:42})}function ar(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=Y(),n=me("md"),{billingInformation:i}=e||{},a=!i||t,l=[];if(a?l.push(jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(Xe__default.default,{width:220,height:12}),jsxRuntime.jsx(Xe__default.default,{width:220,height:12}),jsxRuntime.jsx(Xe__default.default,{width:220,height:12})]},"information-loading-data-top"),jsxRuntime.jsx(Ml__default.default,{orientation:"vertical",style:{minHeight:93,display:n?"block":"none"}},"information-loading-data-divider"),jsxRuntime.jsxs(rr,{children:[jsxRuntime.jsx(Xe__default.default,{width:220,height:12}),jsxRuntime.jsx(Xe__default.default,{width:220,height:12}),jsxRuntime.jsx(Xe__default.default,{width:220,height:12})]},"information-loading-data-bottom")):(l.push(jsxRuntime.jsx(Jn,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(i==null?void 0:i.name)||"-",valueTypographyProps:i!=null&&i.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(i==null?void 0:i.email)||"-",valueTypographyProps:i!=null&&i.email?{}:{color:"disabled"}}]},"information-billing-data-billed-to")),i!=null&&i.defaultPaymentMethodId&&i.defaultPaymentMethodLast4Digits&&i.defaultPaymentExpirationMonth&&i.defaultPaymentExpirationYear&&(l.unshift(jsxRuntime.jsx(Ml__default.default,{orientation:"vertical",style:{minHeight:93,display:n?"block":"none"}},"information-billing-data-divider")),l.unshift(jsxRuntime.jsx(Jn,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:`Ending in ${i.defaultPaymentMethodLast4Digits}`},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:`${fy__default.default(i.defaultPaymentExpirationMonth.toString(),2,"0")}/${i.defaultPaymentExpirationYear}`}]},"information-billing-data-payment-method")))),!a&&!(i!=null&&i.name)&&!(i!=null&&i.email)&&!(i!=null&&i.defaultPaymentMethodId))return null;let s=a?jsxRuntime.jsx(nr,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(or,{url:e.billingPortalUrl,text:o.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return jsxRuntime.jsxs(Ue,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:[jsxRuntime.jsxs(Ne,{className:"stigg-payment-details-section-header",children:[jsxRuntime.jsx(Me,{isLoading:a,className:"stigg-payment-details-section-title",title:"Payment details"}),s]}),jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"stretch",gap:n?64:32,flexWrap:"wrap"},children:l})]})}var Rl=chunkIL3DC53A_cjs_js.e(Ue)`
462
462
  position: relative;
463
463
 
464
464
  .stigg-paywall-layout {
@@ -480,10 +480,10 @@
480
480
  margin-right: auto;
481
481
  }
482
482
 
483
- .${chunk2FMVMEMY_cjs_js.p} {
483
+ .${chunkIL3DC53A_cjs_js.p} {
484
484
  display: none;
485
485
  }
486
- `;var Xn=hi.forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:r},n)=>e?jsxRuntime.jsxs(Ml,{className:"stigg-customer-portal-paywall-section",ref:n,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsxRuntime.jsx(Ne,{className:"stigg-customer-portal-paywall-header",children:jsxRuntime.jsx(Me,{isLoading:r,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);Xn.displayName="CustomerPortalPaywall";var Ul=chunk2FMVMEMY_cjs_js.e.div`
486
+ `;var Xn=hi.forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:r},n)=>e?jsxRuntime.jsxs(Rl,{className:"stigg-customer-portal-paywall-section",ref:n,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsxRuntime.jsx(Ne,{className:"stigg-customer-portal-paywall-header",children:jsxRuntime.jsx(Me,{isLoading:r,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);Xn.displayName="CustomerPortalPaywall";var _l=chunkIL3DC53A_cjs_js.e.div`
487
487
  width: 100%;
488
488
  display: flex;
489
489
  flex-direction: column;
@@ -492,13 +492,13 @@
492
492
  & * {
493
493
  box-sizing: border-box;
494
494
  }
495
- `,_l=chunk2FMVMEMY_cjs_js.e.div`
495
+ `,Dl=chunkIL3DC53A_cjs_js.e.div`
496
496
  width: 100%;
497
497
  display: flex;
498
498
  flex-direction: column;
499
499
  align-items: center;
500
500
  row-gap: 24px;
501
- `;var Gl=6;function zl({featureEntitlements:e,creditEntitlements:t,showAll:o}){let r=e.length+t.length,n=o?r:Math.min(r,Gl),i=e.slice(0,n),a=n-i.length,l=t.slice(0,Math.max(0,a)),s=r>Gl;return {entitlementsToShow:i,creditsToShow:l,totalItemsCount:r,showMoreVisible:s}}function Py(e){var t,o;return ((t=e.feature)==null?void 0:t.meterType)===jsClientSdk.MeterType.Fluctuating||((o=e.feature)==null?void 0:o.meterType)===jsClientSdk.MeterType.Incremental}function Ol(e,t){return t?e>2?4:6:12}function Vl(e){let t=[],o=[];for(let r of e)kt(r)?t.push(r):er(r)&&o.push(r);return {feature:t,credit:o}}function Hl({packageEntitlements:e,activeSubscription:t,filterEntitlements:o,filterPackageEntitlements:r}){var x,A;let{feature:n,credit:i}=Vl(e!=null?e:[]),a=n.filter(Py),l=$l__default.default((x=t==null?void 0:t.prices)!=null?x:[],"feature.refId"),s=$l__default.default(a,"feature.refId"),c=((A=t==null?void 0:t.prices)!=null?A:[]).map(S=>S.feature?s[S.feature.refId]:void 0).filter(S=>!!S),u=a.filter(S=>S.feature&&!l[S.feature.refId]),f=[...c,...u].filter(S=>S.usageLimit!==0),y=i.filter(S=>{var F;return ((F=S.usageLimit)!=null?F:0)>0}),p=[...f,...y],g=r?r({entitlements:p}).entitlements:[...o?o(f):f,...y],{feature:h,credit:P}=Vl(g),b=(t==null?void 0:t.pricingType)===jsClientSdk.PricingType.Custom;return {subscriptionPriceByFeature:l,filteredFeatureEntitlements:h,filteredCreditEntitlements:P,hasCustomSubscription:b}}function Wl({filterEntitlements:e,filterPackageEntitlements:t}){let[o,r]=hi.useState(false),n=me("md"),{customerPortal:i,isLoading:a}=Y(),l=hi.useMemo(()=>{var k;let F=i==null?void 0:i.entitlementsV2,T=(k=i==null?void 0:i.subscriptions)==null?void 0:k.find(w=>w.status===jsClientSdk.SubscriptionStatus.Active);return Hl({packageEntitlements:F,activeSubscription:T,filterEntitlements:e,filterPackageEntitlements:t})},[i==null?void 0:i.entitlementsV2,i==null?void 0:i.subscriptions,e,t]),{subscriptionPriceByFeature:s,filteredFeatureEntitlements:c,filteredCreditEntitlements:u,hasCustomSubscription:f}=l,y=a||!i,p=!!(i!=null&&i.canUpgradeSubscription),{entitlementsToShow:g,creditsToShow:h,totalItemsCount:P,showMoreVisible:b}=zl({featureEntitlements:c,creditEntitlements:u,showAll:o}),x=Ol(P,n),A=()=>r(F=>!F),S=!y&&c.length===0&&u.length===0;return {isLoadingData:y,entitlementsToShow:g,creditsToShow:h,subscriptionPriceByFeature:s,totalItemsCount:P,gridSizeXs:x,hasCustomSubscription:f,canUpgradeSubscription:p,showAll:o,toggleShowAll:A,hasNoItems:S,showMoreVisible:b}}function Bt(e,t,o){if(!t&&!o)return e;let r=jn__default.default(e);return r===jn__default.default(t||"")||r===jn__default.default(o||"")?e:`${e} (${o})`}function Zl(e){return Bt(e.displayName,e.featureUnits,e.featureUnitsPlural)}function Yl(e){var t,o,r;return Bt((t=e.currency)==null?void 0:t.displayName,(o=e.currency)==null?void 0:o.unitSingular,(r=e.currency)==null?void 0:r.unitPlural)}var sr=chunk2FMVMEMY_cjs_js.e.div`
501
+ `;var Vl=6;function Ol({featureEntitlements:e,creditEntitlements:t,showAll:o}){let r=e.length+t.length,n=o?r:Math.min(r,Vl),i=e.slice(0,n),a=n-i.length,l=t.slice(0,Math.max(0,a)),s=r>Vl;return {entitlementsToShow:i,creditsToShow:l,totalItemsCount:r,showMoreVisible:s}}function Py(e){var t,o;return ((t=e.feature)==null?void 0:t.meterType)===jsClientSdk.MeterType.Fluctuating||((o=e.feature)==null?void 0:o.meterType)===jsClientSdk.MeterType.Incremental}function Hl(e,t){return t?e>2?4:6:12}function zl(e){let t=[],o=[];for(let r of e)kt(r)?t.push(r):er(r)&&o.push(r);return {feature:t,credit:o}}function Wl({packageEntitlements:e,activeSubscription:t,filterEntitlements:o,filterPackageEntitlements:r}){var x,A;let{feature:n,credit:i}=zl(e!=null?e:[]),a=n.filter(Py),l=Gl__default.default((x=t==null?void 0:t.prices)!=null?x:[],"feature.refId"),s=Gl__default.default(a,"feature.refId"),c=((A=t==null?void 0:t.prices)!=null?A:[]).map(S=>S.feature?s[S.feature.refId]:void 0).filter(S=>!!S),u=a.filter(S=>S.feature&&!l[S.feature.refId]),f=[...c,...u].filter(S=>S.usageLimit!==0),y=i.filter(S=>{var F;return ((F=S.usageLimit)!=null?F:0)>0}),p=[...f,...y],g=r?r({entitlements:p}).entitlements:[...o?o(f):f,...y],{feature:h,credit:P}=zl(g),b=(t==null?void 0:t.pricingType)===jsClientSdk.PricingType.Custom;return {subscriptionPriceByFeature:l,filteredFeatureEntitlements:h,filteredCreditEntitlements:P,hasCustomSubscription:b}}function Zl({filterEntitlements:e,filterPackageEntitlements:t}){let[o,r]=hi.useState(false),n=me("md"),{customerPortal:i,isLoading:a}=Y(),l=hi.useMemo(()=>{var k;let F=i==null?void 0:i.entitlementsV2,T=(k=i==null?void 0:i.subscriptions)==null?void 0:k.find(w=>w.status===jsClientSdk.SubscriptionStatus.Active);return Wl({packageEntitlements:F,activeSubscription:T,filterEntitlements:e,filterPackageEntitlements:t})},[i==null?void 0:i.entitlementsV2,i==null?void 0:i.subscriptions,e,t]),{subscriptionPriceByFeature:s,filteredFeatureEntitlements:c,filteredCreditEntitlements:u,hasCustomSubscription:f}=l,y=a||!i,p=!!(i!=null&&i.canUpgradeSubscription),{entitlementsToShow:g,creditsToShow:h,totalItemsCount:P,showMoreVisible:b}=Ol({featureEntitlements:c,creditEntitlements:u,showAll:o}),x=Hl(P,n),A=()=>r(F=>!F),S=!y&&c.length===0&&u.length===0;return {isLoadingData:y,entitlementsToShow:g,creditsToShow:h,subscriptionPriceByFeature:s,totalItemsCount:P,gridSizeXs:x,hasCustomSubscription:f,canUpgradeSubscription:p,showAll:o,toggleShowAll:A,hasNoItems:S,showMoreVisible:b}}function Bt(e,t,o){if(!t&&!o)return e;let r=jn__default.default(e);return r===jn__default.default(t||"")||r===jn__default.default(o||"")?e:`${e} (${o})`}function Yl(e){return Bt(e.displayName,e.featureUnits,e.featureUnitsPlural)}function Ql(e){var t,o,r;return Bt((t=e.currency)==null?void 0:t.displayName,(o=e.currency)==null?void 0:o.unitSingular,(r=e.currency)==null?void 0:r.unitPlural)}var sr=chunkIL3DC53A_cjs_js.e.div`
502
502
  display: flex;
503
503
  flex-direction: column;
504
504
  padding: 24px;
@@ -508,12 +508,12 @@
508
508
  height: 100%;
509
509
 
510
510
  ${({theme:e,$highlight:t})=>t&&`background-color: ${e.stigg.palette.backgroundSection}`};
511
- `;function Kl({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:r,hasCustomSubscription:n,canUpgradeSubscription:i}){var s,c,u;let{theme:a}=Y(),l=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxRuntime.jsxs(sr,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx(Ae,{variant:"body1",children:e.feature&&Zl(e.feature)}),t&&jsxRuntime.jsx(Ze,{title:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",children:t.billingModel===sdk.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.i,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxRuntime.jsxs(Ae,{variant:"body1",color:l?"error":"primary","data-testid":`usage-data-${(s=e.feature)==null?void 0:s.refId}`,children:[(c=e.currentUsage)==null?void 0:c.toLocaleString(),!e.hasUnlimitedUsage&&` / ${(u=e.usageLimit)==null?void 0:u.toLocaleString()} (${et(e.currentUsage||0,e.usageLimit)}%)`]}),jsxRuntime.jsx(Xo,{featureEntitlement:e,feature:e.feature,onBuyMore:r,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:i,hasCustomSubscription:n})]}),jsxRuntime.jsx(qo,{entitlement:e}),!e.hasUnlimitedUsage&&!Ql__default.default(e.usageLimit)&&!Ql__default.default(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:"secondary",children:Sl(e)}):null,e.hasUnlimitedUsage&&jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:"secondary",children:"In current billing period"})]}):null}function ei({currentUsage:e,usageLimit:t}){return jsxRuntime.jsx(Ko,{currentUsage:e,usageLimit:t,classNamePrefix:"stigg-credit-usage-progress-bar"})}function ti(e){return Z(e).format("MMM D, YYYY h:mmA")}function oi(e){return Z(e).format("MMM D, YYYY")}function wy(e){let t=i=>Math.ceil(Z.utc(e).diff(Z.utc(),i,true)),o=t("days");if(o>1)return `in ${o} days`;let r=t("hours");return r>1?`in ${r} hours`:`in ${t("minutes")} minutes`}function cr(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Refreshes ${o?o(t):wy(t)}`}function dr({creditEntitlement:e}){let{theme:t,textOverrides:o}=Y(),{currency:r,currentUsage:n,usageLimit:i}=e,a=(n!=null?n:0)>(i!=null?i:0),l=et(n!=null?n:0,i!=null?i:0),s=Yl(e),c=cr({usagePeriodEnd:e.usagePeriodEnd?new Date(e.usagePeriodEnd):void 0,formatter:o.formatResetPeriod});return jsxRuntime.jsxs(sr,{$highlight:false,$borderColor:t.borderColor,className:"stigg-credit-usage-container",children:[jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:jsxRuntime.jsx(Ae,{variant:"body1",className:"stigg-credit-usage-title",children:s})}),jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:jsxRuntime.jsxs(Ae,{variant:"body1",color:a?"error":"primary",className:"stigg-credit-usage-value","data-testid":`credit-usage-data-${r.currencyId}`,children:[(n!=null?n:0).toLocaleString()," / ",(i!=null?i:0).toLocaleString()," (",l,"%)"]})}),jsxRuntime.jsx(ei,{currentUsage:n!=null?n:0,usageLimit:i!=null?i:0}),c&&jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:"secondary",children:c})]})}function Jl({featureEntitlements:e,creditEntitlements:t,subscriptionPriceByFeature:o,gridSizeXs:r,onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l}){return jsxRuntime.jsxs(Re__default.default,{container:true,spacing:4,children:[e.filter(s=>!!s.feature).map(s=>{let c=s.feature;return jsxRuntime.jsx(Re__default.default,{className:`stigg-entitlement-usage-${c.refId}`,item:true,xs:r,children:jsxRuntime.jsx(Kl,{entitlement:s,subscriptionPrice:o[c.refId],onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l})},c.refId)}),t.map(s=>jsxRuntime.jsx(Re__default.default,{className:`stigg-credit-usage-${s.currency.currencyId}`,item:true,xs:r,children:jsxRuntime.jsx(dr,{creditEntitlement:s})},s.currency.currencyId))]})}var jl=chunk2FMVMEMY_cjs_js.e.div`
511
+ `;function ql({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:r,hasCustomSubscription:n,canUpgradeSubscription:i}){var s,c,u;let{theme:a}=Y(),l=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxRuntime.jsxs(sr,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx(Ae,{variant:"body1",children:e.feature&&Yl(e.feature)}),t&&jsxRuntime.jsx(Ze,{title:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",children:t.billingModel===sdk.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.i,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxRuntime.jsxs(Ae,{variant:"body1",color:l?"error":"primary","data-testid":`usage-data-${(s=e.feature)==null?void 0:s.refId}`,children:[(c=e.currentUsage)==null?void 0:c.toLocaleString(),!e.hasUnlimitedUsage&&` / ${(u=e.usageLimit)==null?void 0:u.toLocaleString()} (${et(e.currentUsage||0,e.usageLimit)}%)`]}),jsxRuntime.jsx(Xo,{featureEntitlement:e,feature:e.feature,onBuyMore:r,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:i,hasCustomSubscription:n})]}),jsxRuntime.jsx(qo,{entitlement:e}),!e.hasUnlimitedUsage&&!Kl__default.default(e.usageLimit)&&!Kl__default.default(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:"secondary",children:Tl(e)}):null,e.hasUnlimitedUsage&&jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:"secondary",children:"In current billing period"})]}):null}function ei({currentUsage:e,usageLimit:t}){return jsxRuntime.jsx(Ko,{currentUsage:e,usageLimit:t,classNamePrefix:"stigg-credit-usage-progress-bar"})}function ti(e){return Z(e).format("MMM D, YYYY h:mmA")}function oi(e){return Z(e).format("MMM D, YYYY")}function wy(e){let t=i=>Math.ceil(Z.utc(e).diff(Z.utc(),i,true)),o=t("days");if(o>1)return `in ${o} days`;let r=t("hours");return r>1?`in ${r} hours`:`in ${t("minutes")} minutes`}function cr(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Refreshes ${o?o(t):wy(t)}`}function dr({creditEntitlement:e}){let{theme:t,textOverrides:o}=Y(),{currency:r,currentUsage:n,usageLimit:i}=e,a=(n!=null?n:0)>(i!=null?i:0),l=et(n!=null?n:0,i!=null?i:0),s=Ql(e),c=cr({usagePeriodEnd:e.usagePeriodEnd?new Date(e.usagePeriodEnd):void 0,formatter:o.formatResetPeriod});return jsxRuntime.jsxs(sr,{$highlight:false,$borderColor:t.borderColor,className:"stigg-credit-usage-container",children:[jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:jsxRuntime.jsx(Ae,{variant:"body1",className:"stigg-credit-usage-title",children:s})}),jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:jsxRuntime.jsxs(Ae,{variant:"body1",color:a?"error":"primary",className:"stigg-credit-usage-value","data-testid":`credit-usage-data-${r.currencyId}`,children:[(n!=null?n:0).toLocaleString()," / ",(i!=null?i:0).toLocaleString()," (",l,"%)"]})}),jsxRuntime.jsx(ei,{currentUsage:n!=null?n:0,usageLimit:i!=null?i:0}),c&&jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:"secondary",children:c})]})}function Xl({featureEntitlements:e,creditEntitlements:t,subscriptionPriceByFeature:o,gridSizeXs:r,onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l}){return jsxRuntime.jsxs(Re__default.default,{container:true,spacing:4,children:[e.filter(s=>!!s.feature).map(s=>{let c=s.feature;return jsxRuntime.jsx(Re__default.default,{className:`stigg-entitlement-usage-${c.refId}`,item:true,xs:r,children:jsxRuntime.jsx(ql,{entitlement:s,subscriptionPrice:o[c.refId],onManageSubscription:n,onBuyMore:i,hasCustomSubscription:a,canUpgradeSubscription:l})},c.refId)}),t.map(s=>jsxRuntime.jsx(Re__default.default,{className:`stigg-credit-usage-${s.currency.currencyId}`,item:true,xs:r,children:jsxRuntime.jsx(dr,{creditEntitlement:s})},s.currency.currencyId))]})}var ec=chunkIL3DC53A_cjs_js.e.div`
512
512
  margin-top: 32px;
513
- `;function ec(){let e=me("md");return jsxRuntime.jsx(Re__default.default,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:Ay__default.default(6).map(t=>jsxRuntime.jsx(Re__default.default,{item:true,xs:e?4:12,children:jsxRuntime.jsx(Xe__default.default,{width:280,height:120})},t))})}function tc({showAll:e,onToggle:t}){return jsxRuntime.jsx(jl,{children:jsxRuntime.jsx(je,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:e?jsxRuntime.jsx(reactFeather.Minus,{}):jsxRuntime.jsx(reactFeather.Plus,{}),onClick:t,children:e?"Show less":"Show more"})})}function ur({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}){let{textOverrides:n,theme:i}=Y(),{isLoadingData:a,entitlementsToShow:l,creditsToShow:s,subscriptionPriceByFeature:c,gridSizeXs:u,hasCustomSubscription:f,canUpgradeSubscription:y,showAll:p,toggleShowAll:g,hasNoItems:h,showMoreVisible:P}=Wl({filterEntitlements:o,filterPackageEntitlements:r});return h?null:jsxRuntime.jsxs(Ue,{className:"stigg-subscription-usage-layout",$backgroundColor:i.backgroundColor,$borderColor:i.borderColor,children:[jsxRuntime.jsx(Ne,{children:jsxRuntime.jsx(Me,{title:n.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsxRuntime.jsx(ec,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Jl,{featureEntitlements:l,creditEntitlements:s,subscriptionPriceByFeature:c,gridSizeXs:u,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:f,canUpgradeSubscription:y}),P&&jsxRuntime.jsx(tc,{showAll:p,onToggle:g})]})]})}function nc({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r,onCancelScheduledUpdates:n,onContactSupport:i,paywallComponent:a,hiddenSections:l}){let{customerPortal:s,textOverrides:c,theme:u,isLoading:f,showWatermark:y}=Y(),p=hi.useRef(null),g=({intentionType:x})=>{var A,S;e?e({intentionType:x,customerSubscriptions:(A=s==null?void 0:s.subscriptions)!=null?A:[]}):(S=p==null?void 0:p.current)==null||S.scrollIntoView({behavior:"smooth"});},h=!(l!=null&&l.some(x=>x==="usage")),P=!(l!=null&&l.some(x=>x==="paymentDetails"||x==="billingInformation")),b=!(l!=null&&l.some(x=>x==="invoices"||x==="billingInformation"));return jsxRuntime.jsxs(Ul,{className:"stigg-customer-portal-layout",children:[jsxRuntime.jsx(El,{showWatermark:y}),jsxRuntime.jsxs(_l,{className:"stigg-customer-portal-sections",children:[jsxRuntime.jsx(tr,{onCancelScheduledUpdates:n,onBuyMore:t,onManageSubscription:g,onContactSupport:i,hiddenSections:l,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),h&&jsxRuntime.jsx(ur,{onManageSubscription:g,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}),jsxRuntime.jsx(Xn,{ref:p,paywallComponent:a,theme:u,title:c.paywallSectionTitle,isLoading:!s||f}),P&&jsxRuntime.jsx(ar,{}),b&&jsxRuntime.jsx(gr,{})]})]})}function ac(i){var a=i,{textOverrides:e,theme:t,resourceId:o,productId:r}=a,n=chunk2FMVMEMY_cjs_js.c(a,["textOverrides","theme","resourceId","productId"]);return jsxRuntime.jsx(Do,{textOverrides:e,theme:t,resourceId:o,productId:r,children:jsxRuntime.jsx(nc,chunk2FMVMEMY_cjs_js.a({},n))})}function gr(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=Y(),n=!e||t,i=n?jsxRuntime.jsx(nr,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(or,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !n&&!(e!=null&&e.billingPortalUrl)?null:jsxRuntime.jsx(Ue,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:jsxRuntime.jsxs(Ne,{className:"stigg-invoices-section-header",children:[jsxRuntime.jsx(Me,{isLoading:n,className:"stigg-invoices-section-title",title:o.invoicesTitle}),i]})})}var lc=e=>sc__default.default(e,"displayName"),ii=e=>sc__default.default(e,"addon.displayName");function lt(e){var r,n;let t=(r=e.pricePoints)==null?void 0:r.some(i=>i.amount&&i.amount>0);return !!((n=e.hiddenFromWidgets)!=null&&n.includes(jsClientSdk.WidgetType.Checkout))&&!t}function Ry(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function cc({addon:e,currency:t,billingCountryCode:o}){return chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},e),{pricePoints:e.pricePoints.filter(r=>r.currency===t&&(o?r.billingCountryCode===o:true))})}function dc({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(r=>cc({addon:r,currency:o,billingCountryCode:t})))||[]}function pc({addons:e,billingPeriod:t,billingCountryCode:o,currency:r}){var n;return ((n=e==null?void 0:e.filter(i=>Ry(i.addon,t)))==null?void 0:n.map(i=>chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},i),{addon:cc({addon:i.addon,currency:r,billingCountryCode:o})})))||[]}function mc({activeSubscription:e,plan:t,billingCountryCode:o,billingPeriod:r}){var c,u;let n=[],i=((u=(c=t==null?void 0:t.pricePoints)==null?void 0:c[0])==null?void 0:u.currency)||jsClientSdk.Currency.Usd,a=dc({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:i}),l=lc(a.filter(f=>!lt(f))),s=pc({addons:e==null?void 0:e.addons,billingPeriod:r,billingCountryCode:o,currency:i});return s!=null&&s.length&&(a!=null&&a.length)&&(n=ii(s.filter(f=>a.some(y=>y.id===f.addon.id)))),{addons:n,initialAddons:Uy__default.default(n),availableAddons:l}}function $y(){let[,e]=_();return (t,o)=>e(r=>{if(lt(t))return;let n=r.addonsStep.addons.find(i=>i.addon.id===t.id);if(n){if(lt(n.addon))return;n.quantity=o;}else r.addonsStep.addons.push({addon:t,quantity:o}),r.addonsStep.addons=ii(r.addonsStep.addons);})}function Gy(){let[,e]=_();return t=>e(o=>{let r=o.addonsStep.addons.find(n=>n.addon.id===t);r&&lt(r.addon)||_y__default.default(o.addonsStep.addons,n=>n.addon.id===t);})}function Vy(){let[{addonsStep:e}]=_();return e}function uc(){let e=Vy();return chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},e),{setAddon:$y(),removeAddon:Gy()})}function zy(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}]=_();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}}function Oy(){let[,e]=_();return t=>e(o=>{o.widgetState.readOnly=t;})}function Hy(){let[,e]=_();return t=>e(o=>{o.widgetState.isValid=t;})}function Wy(){let[,e]=_();return t=>e(o=>{o.checkoutSuccess=t;})}function D(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}=zy();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r,setWidgetReadOnly:Oy(),setIsValid:Hy(),setCheckoutSuccess:Wy()}}function Qy(e){var t;return (t=e==null?void 0:e.plan)!=null&&t.pricePoints?chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},e),{plan:chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},e.plan),{pricePoints:e.plan.pricePoints.filter(o=>o.pricingModel!==jsClientSdk.BillingModel.CreditBased)})}):e}function fc({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:r}){let{stigg:n}=chunk2FMVMEMY_cjs_js.u(),[i,a]=hi.useState(true),[l,s]=hi.useState();return hi.useEffect(()=>{let c=()=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){try{let u=yield n.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});s(Qy(u));}catch(u){chunk2FMVMEMY_cjs_js.r.error(`Failed to load checkout ${u==null?void 0:u.message}`,u);}finally{a(false);}});if(r){a(false);let u=r({planId:e,resourceId:t,billingCountryCode:o});s(u);return}n.isCustomerLoaded&&(a(true),c());},[n,n.isCustomerLoaded,t,e,o,r]),{checkout:l,isLoading:i,showWatermark:n.getShowWatermark()}}var yr=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var ai=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Monthly)),si=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Annually)),hc=e=>ai(e)&&si(e);var xc=(e,t,o)=>e===sdk.BillingPeriod.Monthly&&t||e===sdk.BillingPeriod.Annually&&o?e:null,bc=({pricingModel:e})=>e===jsClientSdk.BillingModel.PerUnit;function qy(e,t,o){var i;if(!t)return [];let r=$l__default.default(e,"featureId"),n=$l__default.default(Pc__default.default((i=o==null?void 0:o.prices)==null?void 0:i.map(a=>{let{feature:l}=a;return !l||!bc(a)?null:{featureId:l.featureId,quantity:l.unitQuantity||null}})),"featureId");return Pc__default.default(t==null?void 0:t.map(a=>{var u,f,y;let l=(u=a.feature)==null?void 0:u.featureId;if(!l||!bc(a))return null;let s,c=((f=r[l])==null?void 0:f.quantity)||((y=n[l])==null?void 0:y.quantity);return s=yr(a,c||1),a.isTieredPrice&&!Wt(a.tiers)&&(s=xn(a.tiers,s).upTo),{featureId:l,quantity:s}}))}function Jy({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,l;let r=ai(e),n=si(e);if(o){let s=xc(o,r,n);if(s)return s}if(((a=t==null?void 0:t.plan)==null?void 0:a.id)===(e==null?void 0:e.id))return ((l=t==null?void 0:t.price)==null?void 0:l.billingPeriod)||sdk.BillingPeriod.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let s=xc(t==null?void 0:t.prices[0].billingPeriod,r,n);if(s)return s}return n?sdk.BillingPeriod.Annually:sdk.BillingPeriod.Monthly}function Sc({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:r,preconfiguredBillableFeatures:n}){let i=Jy({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(s=>s.billingPeriod===i),l=qy(n,a,o);return {billingPeriod:i,billableFeatures:l,billingCountryCode:r}}function Xy(){let[{planStep:e}]=_();return e}function jy(){let[,e]=_();return (t,o)=>e(r=>{let n=r.planStep.billableFeatures.find(i=>i.featureId===t);n?n.quantity=o:r.planStep.billableFeatures.push({featureId:t,quantity:o});})}function eh(){let[,e]=_();return t=>e(o=>{o.planStep.billingPeriod=t,o.addonsStep.addons=o.addonsStep.addons.filter(r=>r.addon.pricePoints.some(n=>n.billingPeriod===t));})}function be(){let e=Xy();return chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},e),{setBillingPeriod:eh(),setBillableFeature:jy()})}var kc=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],Tc={activeStep:0,completedSteps:[],steps:kc,isDisabled:false},oh=(e,t,o,r)=>{if(hc(e)&&!r)return false;let n=t.map(a=>a.featureId),i=o.map(a=>a.featureId);return !(n.length!==i.length||!n.every(a=>i.includes(a)))};function wc({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:r,availableCharges:n,preferredBillingPeriod:i,preconfiguredBillableFeatures:a}){if(e||!o)return Tc;let l=[];return t.includes("PLAN")&&oh(o,n,a,i)&&l.push("PLAN"),((r==null?void 0:r.length)===0||t.includes("ADDONS"))&&l.push("ADDONS"),chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},Tc),{steps:kc.filter(s=>!l.includes(s.key))})}function rh(){let[{progressBar:e}]=_();return e}function nh(){let[e,t]=_();return o=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){let{progressBar:r,planStep:n,addonsStep:i,paymentStep:a,onBeforeStepChange:l}=e;if(o!==r.activeStep&&l){let s=r.steps[r.activeStep],c=r.steps[o];if(s&&c){let u={planStep:n,addonsStep:i,paymentStep:a};if(!(yield l({from:s.key,to:c.key,state:u})))return}}t(({progressBar:s})=>{s.activeStep=o;});})}function ih(){let[,e]=_();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function ah(e){return e.completedSteps.length>=e.steps.length-1}function sh(){let[e,t]=_();return ()=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){let{progressBar:o,planStep:r,addonsStep:n,paymentStep:i,onBeforeStepChange:a}=e;if(o.isDisabled)return;let l=o.steps[o.activeStep],s=o.steps[o.activeStep+1];if(s&&a){let c={planStep:r,addonsStep:n,paymentStep:i};if(!(yield a({from:l.key,to:s.key,state:c})))return}t(({progressBar:c})=>{c.completedSteps.includes(c.activeStep)||c.completedSteps.push(c.activeStep),c.activeStep<c.steps.length-1&&(c.activeStep+=1);});})}function lh(){let[,e]=_();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function _e(){let e=rh();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:ah(e),setActiveStep:nh(),markStepAsCompleted:ih(),goNext:sh(),setIsDisabled:lh()}}function It(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:r}]=_();return chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},e),{addons:t.addons,promotionCode:o,billingAddress:r.billingAddress,taxPercentage:r.taxPercentage,taxId:r.taxId})}function hr({billingAddress:e,taxPercentage:t,taxIds:o,prorationBehavior:r}){if(!e&&!t&&!(o!=null&&o.length)&&!r)return {};let n=o!=null&&o.length?o==null?void 0:o.filter(i=>i.value&&i.type):void 0;return {billingInformation:chunk2FMVMEMY_cjs_js.a(chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a(chunk2FMVMEMY_cjs_js.a({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:n}),r?{prorationBehavior:r}:{})}}function ph(e){return e.pricingModel===jsClientSdk.BillingModel.PerUnit&&e.billingCadence===jsClientSdk.BillingCadence.Recurring&&!!e.topUpCustomCurrencyId}function mh(e){return e!=null&&e.pricePoints?e.pricePoints.some(ph):false}function Cr({resetBillingPeriod:e,activeSubscription:t}){if(!t)return {};let o=mh(t.plan);return e!==void 0?{billingCycleAnchor:e?jsClientSdk.SubscriptionBillingCycleAnchor.Now:jsClientSdk.SubscriptionBillingCycleAnchor.Unchanged,prorationBehavior:o?jsClientSdk.SubscriptionProrationBehavior.None:void 0}:o?{billingCycleAnchor:jsClientSdk.SubscriptionBillingCycleAnchor.Now,prorationBehavior:jsClientSdk.SubscriptionProrationBehavior.None}:{}}var yh=h=>chunk2FMVMEMY_cjs_js.d(null,[h],function*({stigg:e,customerId:t,resourceId:o,promotionCode:r,addons:n,billableFeatures:i,billingCountryCode:a,billingPeriod:l,billingAddress:s,taxPercentage:c,taxIds:u,plan:f,activeSubscription:y,resetBillingPeriod:p,onMockCheckoutPreview:g}){var F;let P=n.map(({addon:T,quantity:k})=>({addonId:T.id,quantity:k})),b=null,x=null,{prorationBehavior:A,billingCycleAnchor:S}=Cr({activeSubscription:y,resetBillingPeriod:p});try{if(t&&(f!=null&&f.id)){let T=chunk2FMVMEMY_cjs_js.a(chunk2FMVMEMY_cjs_js.a({customerId:t,planId:f.id,resourceId:o,billingCountryCode:a,addons:P,billingPeriod:l,promotionCode:r,billableFeatures:Xg__default.default(i)?void 0:i},hr({billingAddress:s,taxPercentage:c,taxIds:u,prorationBehavior:A})),S?{billingCycleAnchor:S}:{});b=g?g(T):yield e.previewSubscription(T);}}catch(T){let[,k]=((F=T==null?void 0:T.message)==null?void 0:F.split("Error:"))||[];x=k==null?void 0:k.trim();}return {subscriptionPreview:b,errorMessage:x}}),di=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=chunk2FMVMEMY_cjs_js.u(),o=It(),[{resourceId:r,resetBillingPeriod:n}]=_(),{checkoutState:i,widgetState:a}=D(),{plan:l,customer:s,activeSubscription:c}=i||{};return {previewSubscriptionAction:hi.useCallback((...y)=>chunk2FMVMEMY_cjs_js.d(null,[...y],function*({promotionCode:f}={}){return a.isValid?yh({stigg:t,customerId:s==null?void 0:s.id,resourceId:r,addons:o.addons,billableFeatures:o.billableFeatures,billingCountryCode:o.billingCountryCode,billingPeriod:o.billingPeriod,billingAddress:o.billingAddress,taxPercentage:o.taxPercentage,promotionCode:f!=null?f:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,plan:l,activeSubscription:c,resetBillingPeriod:n,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,s==null?void 0:s.id,l,r,n,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,a.isValid,c,e])}},hh=500,Ac=({onMockCheckoutPreview:e}={})=>{let[t,o]=hi.useState(null),[r,n]=hi.useState(null),[i,a]=hi.useState(false),{previewSubscriptionAction:l}=di({onMockCheckoutPreview:e});return hi.useEffect(()=>{let s=()=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){let{subscriptionPreview:u,errorMessage:f}=yield l();u&&(o(u),n(null)),f&&(n(f),o(null)),a(false);});a(true);let c=setTimeout(()=>{a(true),s();},hh);return ()=>{clearTimeout(c);}},[l]),{subscriptionPreview:t,isFetchingSubscriptionPreview:i,errorMessage:r}};function Ic({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function Ch(){let[,e]=_();return hi.useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function Ph(){let[,e]=_();return hi.useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function xh(){let[,e]=_();return hi.useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function bh(){let[{paymentStep:e}]=_();return e}function Sh(){let[,e]=_();return hi.useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function re(){let e=bh();return chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},e),{setUseNewPaymentMethod:Ch(),setErrorMessage:Ph(),setBillingAddress:xh(),setTaxId:Sh()})}function Ec(e){return Ug__default.default({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===jsClientSdk.BillingPeriod.Monthly?"Exclusively available on annual plans":"Exclusively available on monthly plans",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:({plan:o})=>`${o.displayName} plan`,addCouponCodeText:"Add promotion code",couponCodeTitle:"Promotion code",addonsSectionTitle:"Add-ons",discountsSectionTitle:"Discounts",onlyPayAsYouGoText:"Varies by usage",startsAtText:"Starts at ",proratedTotalDueText:"Prorated charge today",baseChargeText:()=>"Base charge",totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:({billingPeriod:o})=>`Billed ${o.toLowerCase()}`,appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:({credits:o})=>`Your account will be granted credits worth ${o} for unused time, which will be automatically applied to future payments.`,discountText:({discountDetails:o,currency:r})=>{let n=o.type===jsClientSdk.DiscountType.Percentage?`${o.value}% off`:`${H({amount:o.value,currency:r})}`,i;switch(o.durationType){case jsClientSdk.DiscountDurationType.Once:{i=" once";break}case jsClientSdk.DiscountDurationType.Repeating:{i=`${o.type===jsClientSdk.DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case jsClientSdk.DiscountDurationType.Forever:default:i="";}return `${n}${i}`},taxTitle:({taxDetails:o})=>`Tax (${o==null?void 0:o.percentage}%)`,changesWillApplyAtEndOfBillingPeriod:({billingPeriodEnd:o})=>`Your changes will take effect at the end of your current billing cycle on ${Z(o).format("MMMM D, YYYY")}.`,checkoutSuccessText:"Changes applied",payAsYouGoTooltipText:"Billed according to actual usage"},checkoutButton:{nextText:"Next",noChangesText:"No changes",updateText:"Update subscription",downgradeToFreeText:"Cancel subscription",upgradeText:"Subscribe"},downgradeToFree:{alertText:()=>"We\u2019re sorry to see you cancel your paid subscription \u{1F62D}",freePlanHeader:()=>"New plan",freePlanName:({plan:o})=>`${o.displayName}`,freePlanPriceText:()=>"Free",paidPlanHeader:()=>"Current plan",paidPlanName:({plan:o})=>`${o.displayName}`,paidPlanPriceText:({billingPeriod:o})=>`Paid plan${o?`, billed ${o.toLowerCase()}`:""}`},nextBillingCaption:()=>""},e)}var no={primary:"rgb(50, 126, 238)",textColor:"rgb(0, 30, 108)",backgroundColor:"rgb(255, 255, 255)",borderColor:"rgb(235, 237, 243)",summaryBackgroundColor:"rgb(109, 121, 144)"};function vc(e,t,o){let{palette:r}=e||{};return {primary:(t==null?void 0:t.primary)||(r==null?void 0:r.primary)||no.primary,textColor:(t==null?void 0:t.textColor)||(r==null?void 0:r.text.primary)||no.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(r==null?void 0:r.backgroundPaper)||no.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(r==null?void 0:r.outlinedBorder)||no.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(r==null?void 0:r.backgroundHighlight)||no.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var ui=hi__default.default.createContext(null);ui.displayName="CheckoutContext";var _=()=>{let e=hi.useContext(ui);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},vh=({children:e,initialState:t})=>{let[o,r]=hi.useState(t);hi.useEffect(()=>{r(t);},[t]);let n=hi.useCallback(l=>r(s=>immer.produce(s,c=>l(c))),[r]),[i,a]=hi.useMemo(()=>[o,n],[n,o]);return jsxRuntime.jsx(ui.Provider,{value:[i,a],children:e})};function Nc({children:e,textOverrides:t,theme:o,preferredBillingPeriod:r,billableFeatures:n,resourceId:i,planId:a,billingCountryCode:l,billingInformation:s,onMockCheckoutState:c,skipCheckoutSteps:u,onBeforeStepChange:f,resetBillingPeriod:y}){var A;let{checkout:p,isLoading:g,showWatermark:h}=fc({resourceId:i,planId:a,billingCountryCode:l,onMockCheckoutState:c}),P=p!=null&&p.configuration?bs(p.configuration):{typography:Jt(null,Ro)},b=chunk2FMVMEMY_cjs_js.v(P),x=hi.useMemo(()=>{var L,N;let S=vc(b,o,p==null?void 0:p.configuration),F=Ec(t),T=Sc({preferredBillingPeriod:r,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:l,preconfiguredBillableFeatures:n!=null?n:[]}),k=mc({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:T.billingPeriod}),w=Ic({customer:p==null?void 0:p.customer,taxPercentage:(L=s==null?void 0:s.taxDetails)==null?void 0:L.taxPercentage}),I=wc({isLoading:g,skipCheckoutSteps:u!=null?u:[],plan:p==null?void 0:p.plan,availableAddons:k.availableAddons,availableCharges:T.billableFeatures,preferredBillingPeriod:r,preconfiguredBillableFeatures:n!=null?n:[]});return {checkout:p,checkoutLocalization:F,stiggTheme:b,theme:S,progressBar:I,planStep:T,addonsStep:k,paymentStep:w,resourceId:(N=p==null?void 0:p.resource)==null?void 0:N.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:g},showWatermark:h,checkoutSuccess:false,onBeforeStepChange:f,resetBillingPeriod:y}},[r,l,p,g,u,(A=s==null?void 0:s.taxDetails)==null?void 0:A.taxPercentage,f,y]);return jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:P,children:jsxRuntime.jsx(vh,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var Mc="920px",Uc=chunk2FMVMEMY_cjs_js.e.div`
513
+ `;function tc(){let e=me("md");return jsxRuntime.jsx(Re__default.default,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:Ay__default.default(6).map(t=>jsxRuntime.jsx(Re__default.default,{item:true,xs:e?4:12,children:jsxRuntime.jsx(Xe__default.default,{width:280,height:120})},t))})}function oc({showAll:e,onToggle:t}){return jsxRuntime.jsx(ec,{children:jsxRuntime.jsx(je,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:e?jsxRuntime.jsx(reactFeather.Minus,{}):jsxRuntime.jsx(reactFeather.Plus,{}),onClick:t,children:e?"Show less":"Show more"})})}function ur({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}){let{textOverrides:n,theme:i}=Y(),{isLoadingData:a,entitlementsToShow:l,creditsToShow:s,subscriptionPriceByFeature:c,gridSizeXs:u,hasCustomSubscription:f,canUpgradeSubscription:y,showAll:p,toggleShowAll:g,hasNoItems:h,showMoreVisible:P}=Zl({filterEntitlements:o,filterPackageEntitlements:r});return h?null:jsxRuntime.jsxs(Ue,{className:"stigg-subscription-usage-layout",$backgroundColor:i.backgroundColor,$borderColor:i.borderColor,children:[jsxRuntime.jsx(Ne,{children:jsxRuntime.jsx(Me,{title:n.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsxRuntime.jsx(tc,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Xl,{featureEntitlements:l,creditEntitlements:s,subscriptionPriceByFeature:c,gridSizeXs:u,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:f,canUpgradeSubscription:y}),P&&jsxRuntime.jsx(oc,{showAll:p,onToggle:g})]})]})}function ic({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r,onCancelScheduledUpdates:n,onContactSupport:i,paywallComponent:a,hiddenSections:l}){let{customerPortal:s,textOverrides:c,theme:u,isLoading:f,showWatermark:y}=Y(),p=hi.useRef(null),g=({intentionType:x})=>{var A,S;e?e({intentionType:x,customerSubscriptions:(A=s==null?void 0:s.subscriptions)!=null?A:[]}):(S=p==null?void 0:p.current)==null||S.scrollIntoView({behavior:"smooth"});},h=!(l!=null&&l.some(x=>x==="usage")),P=!(l!=null&&l.some(x=>x==="paymentDetails"||x==="billingInformation")),b=!(l!=null&&l.some(x=>x==="invoices"||x==="billingInformation"));return jsxRuntime.jsxs(_l,{className:"stigg-customer-portal-layout",children:[jsxRuntime.jsx(vl,{showWatermark:y}),jsxRuntime.jsxs(Dl,{className:"stigg-customer-portal-sections",children:[jsxRuntime.jsx(tr,{onCancelScheduledUpdates:n,onBuyMore:t,onManageSubscription:g,onContactSupport:i,hiddenSections:l,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),h&&jsxRuntime.jsx(ur,{onManageSubscription:g,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:r}),jsxRuntime.jsx(Xn,{ref:p,paywallComponent:a,theme:u,title:c.paywallSectionTitle,isLoading:!s||f}),P&&jsxRuntime.jsx(ar,{}),b&&jsxRuntime.jsx(gr,{})]})]})}function sc(i){var a=i,{textOverrides:e,theme:t,resourceId:o,productId:r}=a,n=chunkIL3DC53A_cjs_js.c(a,["textOverrides","theme","resourceId","productId"]);return jsxRuntime.jsx(Do,{textOverrides:e,theme:t,resourceId:o,productId:r,children:jsxRuntime.jsx(ic,chunkIL3DC53A_cjs_js.a({},n))})}function gr(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:r}=Y(),n=!e||t,i=n?jsxRuntime.jsx(nr,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(or,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !n&&!(e!=null&&e.billingPortalUrl)?null:jsxRuntime.jsx(Ue,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:jsxRuntime.jsxs(Ne,{className:"stigg-invoices-section-header",children:[jsxRuntime.jsx(Me,{isLoading:n,className:"stigg-invoices-section-title",title:o.invoicesTitle}),i]})})}var cc=e=>lc__default.default(e,"displayName"),ii=e=>lc__default.default(e,"addon.displayName");function lt(e){var r,n;let t=(r=e.pricePoints)==null?void 0:r.some(i=>i.amount&&i.amount>0);return !!((n=e.hiddenFromWidgets)!=null&&n.includes(jsClientSdk.WidgetType.Checkout))&&!t}function Ry(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function dc({addon:e,currency:t,billingCountryCode:o}){return chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},e),{pricePoints:e.pricePoints.filter(r=>r.currency===t&&(o?r.billingCountryCode===o:true))})}function pc({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(r=>dc({addon:r,currency:o,billingCountryCode:t})))||[]}function mc({addons:e,billingPeriod:t,billingCountryCode:o,currency:r}){var n;return ((n=e==null?void 0:e.filter(i=>Ry(i.addon,t)))==null?void 0:n.map(i=>chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},i),{addon:dc({addon:i.addon,currency:r,billingCountryCode:o})})))||[]}function uc({activeSubscription:e,plan:t,billingCountryCode:o,billingPeriod:r}){var c,u;let n=[],i=((u=(c=t==null?void 0:t.pricePoints)==null?void 0:c[0])==null?void 0:u.currency)||jsClientSdk.Currency.Usd,a=pc({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:i}),l=cc(a.filter(f=>!lt(f))),s=mc({addons:e==null?void 0:e.addons,billingPeriod:r,billingCountryCode:o,currency:i});return s!=null&&s.length&&(a!=null&&a.length)&&(n=ii(s.filter(f=>a.some(y=>y.id===f.addon.id)))),{addons:n,initialAddons:Uy__default.default(n),availableAddons:l}}function $y(){let[,e]=_();return (t,o)=>e(r=>{if(lt(t))return;let n=r.addonsStep.addons.find(i=>i.addon.id===t.id);if(n){if(lt(n.addon))return;n.quantity=o;}else r.addonsStep.addons.push({addon:t,quantity:o}),r.addonsStep.addons=ii(r.addonsStep.addons);})}function Gy(){let[,e]=_();return t=>e(o=>{let r=o.addonsStep.addons.find(n=>n.addon.id===t);r&&lt(r.addon)||_y__default.default(o.addonsStep.addons,n=>n.addon.id===t);})}function Vy(){let[{addonsStep:e}]=_();return e}function gc(){let e=Vy();return chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},e),{setAddon:$y(),removeAddon:Gy()})}function zy(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}]=_();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}}function Oy(){let[,e]=_();return t=>e(o=>{o.widgetState.readOnly=t;})}function Hy(){let[,e]=_();return t=>e(o=>{o.widgetState.isValid=t;})}function Wy(){let[,e]=_();return t=>e(o=>{o.checkoutSuccess=t;})}function D(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r}=zy();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:r,setWidgetReadOnly:Oy(),setIsValid:Hy(),setCheckoutSuccess:Wy()}}function Qy(e){var t;return (t=e==null?void 0:e.plan)!=null&&t.pricePoints?chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},e),{plan:chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},e.plan),{pricePoints:e.plan.pricePoints.filter(o=>o.pricingModel!==jsClientSdk.BillingModel.CreditBased)})}):e}function yc({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:r}){let{stigg:n}=chunkIL3DC53A_cjs_js.u(),[i,a]=hi.useState(true),[l,s]=hi.useState();return hi.useEffect(()=>{let c=()=>chunkIL3DC53A_cjs_js.d(null,null,function*(){try{let u=yield n.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});s(Qy(u));}catch(u){chunkIL3DC53A_cjs_js.r.error(`Failed to load checkout ${u==null?void 0:u.message}`,u);}finally{a(false);}});if(r){a(false);let u=r({planId:e,resourceId:t,billingCountryCode:o});s(u);return}n.isCustomerLoaded&&(a(true),c());},[n,n.isCustomerLoaded,t,e,o,r]),{checkout:l,isLoading:i,showWatermark:n.getShowWatermark()}}var yr=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var ai=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Monthly)),si=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Annually)),Cc=e=>ai(e)&&si(e);var bc=(e,t,o)=>e===sdk.BillingPeriod.Monthly&&t||e===sdk.BillingPeriod.Annually&&o?e:null,Sc=({pricingModel:e})=>e===jsClientSdk.BillingModel.PerUnit;function qy(e,t,o){var i;if(!t)return [];let r=Gl__default.default(e,"featureId"),n=Gl__default.default(xc__default.default((i=o==null?void 0:o.prices)==null?void 0:i.map(a=>{let{feature:l}=a;return !l||!Sc(a)?null:{featureId:l.featureId,quantity:l.unitQuantity||null}})),"featureId");return xc__default.default(t==null?void 0:t.map(a=>{var u,f,y;let l=(u=a.feature)==null?void 0:u.featureId;if(!l||!Sc(a))return null;let s,c=((f=r[l])==null?void 0:f.quantity)||((y=n[l])==null?void 0:y.quantity);return s=yr(a,c||1),a.isTieredPrice&&!Wt(a.tiers)&&(s=xn(a.tiers,s).upTo),{featureId:l,quantity:s}}))}function Jy({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,l;let r=ai(e),n=si(e);if(o){let s=bc(o,r,n);if(s)return s}if(((a=t==null?void 0:t.plan)==null?void 0:a.id)===(e==null?void 0:e.id))return ((l=t==null?void 0:t.price)==null?void 0:l.billingPeriod)||sdk.BillingPeriod.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let s=bc(t==null?void 0:t.prices[0].billingPeriod,r,n);if(s)return s}return n?sdk.BillingPeriod.Annually:sdk.BillingPeriod.Monthly}function Tc({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:r,preconfiguredBillableFeatures:n}){let i=Jy({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(s=>s.billingPeriod===i),l=qy(n,a,o);return {billingPeriod:i,billableFeatures:l,billingCountryCode:r}}function Xy(){let[{planStep:e}]=_();return e}function jy(){let[,e]=_();return (t,o)=>e(r=>{let n=r.planStep.billableFeatures.find(i=>i.featureId===t);n?n.quantity=o:r.planStep.billableFeatures.push({featureId:t,quantity:o});})}function eh(){let[,e]=_();return t=>e(o=>{o.planStep.billingPeriod=t,o.addonsStep.addons=o.addonsStep.addons.filter(r=>r.addon.pricePoints.some(n=>n.billingPeriod===t));})}function be(){let e=Xy();return chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},e),{setBillingPeriod:eh(),setBillableFeature:jy()})}var wc=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],kc={activeStep:0,completedSteps:[],steps:wc,isDisabled:false},oh=(e,t,o,r)=>{if(Cc(e)&&!r)return false;let n=t.map(a=>a.featureId),i=o.map(a=>a.featureId);return !(n.length!==i.length||!n.every(a=>i.includes(a)))};function Bc({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:r,availableCharges:n,preferredBillingPeriod:i,preconfiguredBillableFeatures:a}){if(e||!o)return kc;let l=[];return t.includes("PLAN")&&oh(o,n,a,i)&&l.push("PLAN"),((r==null?void 0:r.length)===0||t.includes("ADDONS"))&&l.push("ADDONS"),chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},kc),{steps:wc.filter(s=>!l.includes(s.key))})}function rh(){let[{progressBar:e}]=_();return e}function nh(){let[e,t]=_();return o=>chunkIL3DC53A_cjs_js.d(null,null,function*(){let{progressBar:r,planStep:n,addonsStep:i,paymentStep:a,onBeforeStepChange:l}=e;if(o!==r.activeStep&&l){let s=r.steps[r.activeStep],c=r.steps[o];if(s&&c){let u={planStep:n,addonsStep:i,paymentStep:a};if(!(yield l({from:s.key,to:c.key,state:u})))return}}t(({progressBar:s})=>{s.activeStep=o;});})}function ih(){let[,e]=_();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function ah(e){return e.completedSteps.length>=e.steps.length-1}function sh(){let[e,t]=_();return ()=>chunkIL3DC53A_cjs_js.d(null,null,function*(){let{progressBar:o,planStep:r,addonsStep:n,paymentStep:i,onBeforeStepChange:a}=e;if(o.isDisabled)return;let l=o.steps[o.activeStep],s=o.steps[o.activeStep+1];if(s&&a){let c={planStep:r,addonsStep:n,paymentStep:i};if(!(yield a({from:l.key,to:s.key,state:c})))return}t(({progressBar:c})=>{c.completedSteps.includes(c.activeStep)||c.completedSteps.push(c.activeStep),c.activeStep<c.steps.length-1&&(c.activeStep+=1);});})}function lh(){let[,e]=_();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function _e(){let e=rh();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:ah(e),setActiveStep:nh(),markStepAsCompleted:ih(),goNext:sh(),setIsDisabled:lh()}}function It(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:r}]=_();return chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},e),{addons:t.addons,promotionCode:o,billingAddress:r.billingAddress,taxPercentage:r.taxPercentage,taxId:r.taxId})}function hr({billingAddress:e,taxPercentage:t,taxIds:o,prorationBehavior:r}){if(!e&&!t&&!(o!=null&&o.length)&&!r)return {};let n=o!=null&&o.length?o==null?void 0:o.filter(i=>i.value&&i.type):void 0;return {billingInformation:chunkIL3DC53A_cjs_js.a(chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a(chunkIL3DC53A_cjs_js.a({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:n}),r?{prorationBehavior:r}:{})}}function ph(e){return e.pricingModel===jsClientSdk.BillingModel.PerUnit&&e.billingCadence===jsClientSdk.BillingCadence.Recurring&&!!e.topUpCustomCurrencyId}function mh(e){return e!=null&&e.pricePoints?e.pricePoints.some(ph):false}function Cr({resetBillingPeriod:e,activeSubscription:t}){if(!t)return {};let o=mh(t.plan);return e!==void 0?{billingCycleAnchor:e?jsClientSdk.SubscriptionBillingCycleAnchor.Now:jsClientSdk.SubscriptionBillingCycleAnchor.Unchanged,prorationBehavior:o?jsClientSdk.SubscriptionProrationBehavior.None:void 0}:o?{billingCycleAnchor:jsClientSdk.SubscriptionBillingCycleAnchor.Now,prorationBehavior:jsClientSdk.SubscriptionProrationBehavior.None}:{}}var yh=h=>chunkIL3DC53A_cjs_js.d(null,[h],function*({stigg:e,customerId:t,resourceId:o,promotionCode:r,addons:n,billableFeatures:i,billingCountryCode:a,billingPeriod:l,billingAddress:s,taxPercentage:c,taxIds:u,plan:f,activeSubscription:y,resetBillingPeriod:p,onMockCheckoutPreview:g}){var F;let P=n.map(({addon:T,quantity:k})=>({addonId:T.id,quantity:k})),b=null,x=null,{prorationBehavior:A,billingCycleAnchor:S}=Cr({activeSubscription:y,resetBillingPeriod:p});try{if(t&&(f!=null&&f.id)){let T=chunkIL3DC53A_cjs_js.a(chunkIL3DC53A_cjs_js.a({customerId:t,planId:f.id,resourceId:o,billingCountryCode:a,addons:P,billingPeriod:l,promotionCode:r,billableFeatures:Xg__default.default(i)?void 0:i},hr({billingAddress:s,taxPercentage:c,taxIds:u,prorationBehavior:A})),S?{billingCycleAnchor:S}:{});b=g?g(T):yield e.previewSubscription(T);}}catch(T){let[,k]=((F=T==null?void 0:T.message)==null?void 0:F.split("Error:"))||[];x=k==null?void 0:k.trim();}return {subscriptionPreview:b,errorMessage:x}}),di=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=chunkIL3DC53A_cjs_js.u(),o=It(),[{resourceId:r,resetBillingPeriod:n}]=_(),{checkoutState:i,widgetState:a}=D(),{plan:l,customer:s,activeSubscription:c}=i||{};return {previewSubscriptionAction:hi.useCallback((...y)=>chunkIL3DC53A_cjs_js.d(null,[...y],function*({promotionCode:f}={}){return a.isValid?yh({stigg:t,customerId:s==null?void 0:s.id,resourceId:r,addons:o.addons,billableFeatures:o.billableFeatures,billingCountryCode:o.billingCountryCode,billingPeriod:o.billingPeriod,billingAddress:o.billingAddress,taxPercentage:o.taxPercentage,promotionCode:f!=null?f:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,plan:l,activeSubscription:c,resetBillingPeriod:n,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,s==null?void 0:s.id,l,r,n,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,a.isValid,c,e])}},hh=500,Ic=({onMockCheckoutPreview:e}={})=>{let[t,o]=hi.useState(null),[r,n]=hi.useState(null),[i,a]=hi.useState(false),{previewSubscriptionAction:l}=di({onMockCheckoutPreview:e});return hi.useEffect(()=>{let s=()=>chunkIL3DC53A_cjs_js.d(null,null,function*(){let{subscriptionPreview:u,errorMessage:f}=yield l();u&&(o(u),n(null)),f&&(n(f),o(null)),a(false);});a(true);let c=setTimeout(()=>{a(true),s();},hh);return ()=>{clearTimeout(c);}},[l]),{subscriptionPreview:t,isFetchingSubscriptionPreview:i,errorMessage:r}};function Fc({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function Ch(){let[,e]=_();return hi.useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function Ph(){let[,e]=_();return hi.useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function xh(){let[,e]=_();return hi.useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function bh(){let[{paymentStep:e}]=_();return e}function Sh(){let[,e]=_();return hi.useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function re(){let e=bh();return chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},e),{setUseNewPaymentMethod:Ch(),setErrorMessage:Ph(),setBillingAddress:xh(),setTaxId:Sh()})}function vc(e){return Ug__default.default({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===jsClientSdk.BillingPeriod.Monthly?"Exclusively available on annual plans":"Exclusively available on monthly plans",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:({plan:o})=>`${o.displayName} plan`,addCouponCodeText:"Add promotion code",couponCodeTitle:"Promotion code",addonsSectionTitle:"Add-ons",discountsSectionTitle:"Discounts",onlyPayAsYouGoText:"Varies by usage",startsAtText:"Starts at ",proratedTotalDueText:"Prorated charge today",baseChargeText:()=>"Base charge",totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:({billingPeriod:o})=>`Billed ${o.toLowerCase()}`,appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:({credits:o})=>`Your account will be granted credits worth ${o} for unused time, which will be automatically applied to future payments.`,discountText:({discountDetails:o,currency:r})=>{let n=o.type===jsClientSdk.DiscountType.Percentage?`${o.value}% off`:`${H({amount:o.value,currency:r})}`,i;switch(o.durationType){case jsClientSdk.DiscountDurationType.Once:{i=" once";break}case jsClientSdk.DiscountDurationType.Repeating:{i=`${o.type===jsClientSdk.DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case jsClientSdk.DiscountDurationType.Forever:default:i="";}return `${n}${i}`},taxTitle:({taxDetails:o})=>`Tax (${o==null?void 0:o.percentage}%)`,changesWillApplyAtEndOfBillingPeriod:({billingPeriodEnd:o})=>`Your changes will take effect at the end of your current billing cycle on ${Z(o).format("MMMM D, YYYY")}.`,checkoutSuccessText:"Changes applied",payAsYouGoTooltipText:"Billed according to actual usage"},checkoutButton:{nextText:"Next",noChangesText:"No changes",updateText:"Update subscription",downgradeToFreeText:"Cancel subscription",upgradeText:"Subscribe"},downgradeToFree:{alertText:()=>"We\u2019re sorry to see you cancel your paid subscription \u{1F62D}",freePlanHeader:()=>"New plan",freePlanName:({plan:o})=>`${o.displayName}`,freePlanPriceText:()=>"Free",paidPlanHeader:()=>"Current plan",paidPlanName:({plan:o})=>`${o.displayName}`,paidPlanPriceText:({billingPeriod:o})=>`Paid plan${o?`, billed ${o.toLowerCase()}`:""}`},nextBillingCaption:()=>""},e)}var no={primary:"rgb(50, 126, 238)",textColor:"rgb(0, 30, 108)",backgroundColor:"rgb(255, 255, 255)",borderColor:"rgb(235, 237, 243)",summaryBackgroundColor:"rgb(109, 121, 144)"};function Lc(e,t,o){let{palette:r}=e||{};return {primary:(t==null?void 0:t.primary)||(r==null?void 0:r.primary)||no.primary,textColor:(t==null?void 0:t.textColor)||(r==null?void 0:r.text.primary)||no.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(r==null?void 0:r.backgroundPaper)||no.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(r==null?void 0:r.outlinedBorder)||no.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(r==null?void 0:r.backgroundHighlight)||no.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var ui=hi__default.default.createContext(null);ui.displayName="CheckoutContext";var _=()=>{let e=hi.useContext(ui);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},vh=({children:e,initialState:t})=>{let[o,r]=hi.useState(t);hi.useEffect(()=>{r(t);},[t]);let n=hi.useCallback(l=>r(s=>immer.produce(s,c=>l(c))),[r]),[i,a]=hi.useMemo(()=>[o,n],[n,o]);return jsxRuntime.jsx(ui.Provider,{value:[i,a],children:e})};function Mc({children:e,textOverrides:t,theme:o,preferredBillingPeriod:r,billableFeatures:n,resourceId:i,planId:a,billingCountryCode:l,billingInformation:s,onMockCheckoutState:c,skipCheckoutSteps:u,onBeforeStepChange:f,resetBillingPeriod:y}){var A;let{checkout:p,isLoading:g,showWatermark:h}=yc({resourceId:i,planId:a,billingCountryCode:l,onMockCheckoutState:c}),P=p!=null&&p.configuration?Ss(p.configuration):{typography:Jt(null,Ro)},b=chunkIL3DC53A_cjs_js.v(P),x=hi.useMemo(()=>{var L,N;let S=Lc(b,o,p==null?void 0:p.configuration),F=vc(t),T=Tc({preferredBillingPeriod:r,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:l,preconfiguredBillableFeatures:n!=null?n:[]}),k=uc({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:T.billingPeriod}),w=Fc({customer:p==null?void 0:p.customer,taxPercentage:(L=s==null?void 0:s.taxDetails)==null?void 0:L.taxPercentage}),I=Bc({isLoading:g,skipCheckoutSteps:u!=null?u:[],plan:p==null?void 0:p.plan,availableAddons:k.availableAddons,availableCharges:T.billableFeatures,preferredBillingPeriod:r,preconfiguredBillableFeatures:n!=null?n:[]});return {checkout:p,checkoutLocalization:F,stiggTheme:b,theme:S,progressBar:I,planStep:T,addonsStep:k,paymentStep:w,resourceId:(N=p==null?void 0:p.resource)==null?void 0:N.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:g},showWatermark:h,checkoutSuccess:false,onBeforeStepChange:f,resetBillingPeriod:y}},[r,l,p,g,u,(A=s==null?void 0:s.taxDetails)==null?void 0:A.taxPercentage,f,y]);return jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:P,children:jsxRuntime.jsx(vh,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var Rc="920px",_c=chunkIL3DC53A_cjs_js.e.div`
514
514
  margin: auto;
515
515
  min-height: 760px;
516
- max-width: ${Mc};
516
+ max-width: ${Rc};
517
517
  display: flex;
518
518
  position: relative;
519
519
  flex-direction: column;
@@ -530,9 +530,9 @@
530
530
  ${oe.md} {
531
531
  padding: 32px;
532
532
  border-radius: 10px;
533
- width: ${Mc};
533
+ width: ${Rc};
534
534
  }
535
- `,_c=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
535
+ `,Dc=chunkIL3DC53A_cjs_js.e(ke__default.default)`
536
536
  display: flex;
537
537
  align-items: flex-start;
538
538
  gap: 32px;
@@ -543,7 +543,7 @@
543
543
  ${oe.md} {
544
544
  flex-direction: row;
545
545
  }
546
- `,Dc=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
546
+ `,$c=chunkIL3DC53A_cjs_js.e(ke__default.default)`
547
547
  display: flex;
548
548
  flex-direction: column;
549
549
  gap: 0;
@@ -553,18 +553,18 @@
553
553
  ${oe.md} {
554
554
  width: auto;
555
555
  }
556
- `;var Gc=chunk2FMVMEMY_cjs_js.e(qf__default.default,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t})=>({[`&.${qf.linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${qf.linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),Vc=chunk2FMVMEMY_cjs_js.e(Pu__default.default)({[`&.${Pu.buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),zc=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.i,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t,$shouldFill:o})=>({circle:{stroke:t?e.stigg.palette.primaryLight:e.stigg.palette.primary,fill:o?t?e.stigg.palette.primaryLight:e.stigg.palette.primary:void 0}}));var Hc=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o}=_e(),{widgetState:r}=D(),n=me("md"),i=hi.useRef(),{readOnly:a,isLoadingCheckoutData:l}=r,{activeStep:s,completedSteps:c,steps:u}=e||{},f=(s+1)*100/u.length,[y,p]=hi__default.default.useState(o);return hi.useEffect(()=>{n||i.current&&o!==y&&i.current.scrollIntoView({behavior:"smooth"}),p(o);},[o,n,y,p]),e.steps.length===1?null:jsxRuntime.jsxs(ke__default.default,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:i,children:[jsxRuntime.jsx(Gc,{variant:"determinate",value:f,$disabled:a}),jsxRuntime.jsx(Re__default.default,{container:true,display:"flex",children:u.map(({key:g,label:h},P)=>{let b=c.includes(P),x=a||P>s&&!b&&!c.includes(P-1)||s!==P&&e.isDisabled;return jsxRuntime.jsx(Re__default.default,{item:true,display:"flex",flexDirection:"row",flex:n?1:"auto",justifyContent:"flex-start",children:l?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:120,height:20,style:{marginTop:8}}):jsxRuntime.jsx(Vc,{onClick:()=>t(P),fullWidth:true,disabled:x,children:jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsxRuntime.jsx($h__default.default,{icon:jsxRuntime.jsx(zc,{icon:b?x?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:x,$shouldFill:b})}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:x?"primary.main.light":"primary.main",children:h})]})})},g)})})]})};var zh=[jsClientSdk.BillingModel.FlatFee,jsClientSdk.BillingModel.PerUnit,jsClientSdk.BillingModel.UsageBased],Oh=e=>sc__default.default(e,[t=>zh.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),xr=e=>hi.useMemo(()=>Oh(e),[e]);function Hh(){let[{promotionCode:e}]=_();return e}function Wh(){let[,e]=_();return t=>e(o=>{o.promotionCode=t;})}function Ft(){return {promotionCode:Hh(),setPromotionCode:Wh()}}var Zh=e=>jsxRuntime.jsx("svg",chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"plus",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M10 4.16666V15.8333",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M4.16699 10H15.8337",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),br=Zh;var Qh=chunk2FMVMEMY_cjs_js.e(br,{shouldForwardProp:e=>!e.startsWith("$")})`
556
+ `;var Vc=chunkIL3DC53A_cjs_js.e(qf__default.default,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t})=>({[`&.${qf.linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${qf.linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),zc=chunkIL3DC53A_cjs_js.e(Pu__default.default)({[`&.${Pu.buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),Oc=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.i,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$disabled:t,$shouldFill:o})=>({circle:{stroke:t?e.stigg.palette.primaryLight:e.stigg.palette.primary,fill:o?t?e.stigg.palette.primaryLight:e.stigg.palette.primary:void 0}}));var Wc=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o}=_e(),{widgetState:r}=D(),n=me("md"),i=hi.useRef(),{readOnly:a,isLoadingCheckoutData:l}=r,{activeStep:s,completedSteps:c,steps:u}=e||{},f=(s+1)*100/u.length,[y,p]=hi__default.default.useState(o);return hi.useEffect(()=>{n||i.current&&o!==y&&i.current.scrollIntoView({behavior:"smooth"}),p(o);},[o,n,y,p]),e.steps.length===1?null:jsxRuntime.jsxs(ke__default.default,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:i,children:[jsxRuntime.jsx(Vc,{variant:"determinate",value:f,$disabled:a}),jsxRuntime.jsx(Re__default.default,{container:true,display:"flex",children:u.map(({key:g,label:h},P)=>{let b=c.includes(P),x=a||P>s&&!b&&!c.includes(P-1)||s!==P&&e.isDisabled;return jsxRuntime.jsx(Re__default.default,{item:true,display:"flex",flexDirection:"row",flex:n?1:"auto",justifyContent:"flex-start",children:l?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:120,height:20,style:{marginTop:8}}):jsxRuntime.jsx(zc,{onClick:()=>t(P),fullWidth:true,disabled:x,children:jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsxRuntime.jsx($h__default.default,{icon:jsxRuntime.jsx(Oc,{icon:b?x?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:x,$shouldFill:b})}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:x?"primary.main.light":"primary.main",children:h})]})})},g)})})]})};var zh=[jsClientSdk.BillingModel.FlatFee,jsClientSdk.BillingModel.PerUnit,jsClientSdk.BillingModel.UsageBased],Oh=e=>lc__default.default(e,[t=>zh.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),xr=e=>hi.useMemo(()=>Oh(e),[e]);function Hh(){let[{promotionCode:e}]=_();return e}function Wh(){let[,e]=_();return t=>e(o=>{o.promotionCode=t;})}function Ft(){return {promotionCode:Hh(),setPromotionCode:Wh()}}var Zh=e=>jsxRuntime.jsx("svg",chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"plus",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M10 4.16666V15.8333",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M4.16699 10H15.8337",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),br=Zh;var Qh=chunkIL3DC53A_cjs_js.e(br,{shouldForwardProp:e=>!e.startsWith("$")})`
557
557
  margin-right: 8px;
558
558
  path {
559
559
  stroke: ${({theme:e,$disabled:t})=>t?e.stigg.palette.text.disabled:e.stigg.palette.primary};
560
560
  }
561
- `,Zc=({onAddClick:e,checkoutLocalization:t,disabled:o})=>jsxRuntime.jsxs(te,{disabled:o,fullWidth:true,className:"stigg-checkout-summary-add-coupon-code-button",sx:{textTransform:"none",justifyContent:"flex-start",color:o?"text.disabled":"primary.main"},variant:"text",size:"medium",onClick:e,children:[jsxRuntime.jsx(Qh,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-checkout-change-plan-button-text",color:o?"disabled":"primary.main",style:{lineHeight:"24px"},variant:"h3",children:t.summary.addCouponCodeText})]});var jh=chunk2FMVMEMY_cjs_js.e(te)`
561
+ `,Yc=({onAddClick:e,checkoutLocalization:t,disabled:o})=>jsxRuntime.jsxs(te,{disabled:o,fullWidth:true,className:"stigg-checkout-summary-add-coupon-code-button",sx:{textTransform:"none",justifyContent:"flex-start",color:o?"text.disabled":"primary.main"},variant:"text",size:"medium",onClick:e,children:[jsxRuntime.jsx(Qh,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-checkout-change-plan-button-text",color:o?"disabled":"primary.main",style:{lineHeight:"24px"},variant:"h3",children:t.summary.addCouponCodeText})]});var jh=chunkIL3DC53A_cjs_js.e(te)`
562
562
  padding: 4px 10px;
563
563
  min-width: unset;
564
564
  border-radius: ${({theme:e})=>e.stigg.border.radius};
565
565
  display: flex;
566
566
  align-items: center;
567
- `,Yc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:r}=Ft(),[n,i]=hi.useState(false),[a,l]=hi__default.default.useState(""),[s,c]=hi__default.default.useState(false),[u,f]=hi__default.default.useState(""),{previewSubscriptionAction:y}=di({onMockCheckoutPreview:o}),p=()=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){var P;c(true),f("");let{subscriptionPreview:g,errorMessage:h}=yield y({promotionCode:a});!h&&((P=g==null?void 0:g.immediateInvoice)!=null&&P.discountDetails)?(r(a.toUpperCase()),i(false)):h&&f(h),c(false);});return n?jsxRuntime.jsxs(Re__default.default,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:u?"error":e?"disabled":"primary.main",children:t.summary.couponCodeTitle}),jsxRuntime.jsx(pe,{disabled:e,autoFocus:true,variant:"outlined",fullWidth:true,error:!!u,value:a,onChange:g=>{l(g.target.value);},inputProps:{maxLength:20},onKeyDown:g=>{g.key==="Enter"&&(p(),g.preventDefault());},InputProps:{endAdornment:jsxRuntime.jsx(jh,{variant:"contained",disabled:e,onClick:()=>{p();},children:s?jsxRuntime.jsx(Jh__default.default,{size:18,sx:{color:"white"}}):jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.i,{style:{display:"flex"},icon:"ArrowForward"})})}}),!!u&&jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"error",children:u})]}):jsxRuntime.jsx(Zc,{disabled:e,onAddClick:()=>i(true),checkoutLocalization:t})};var tC=chunk2FMVMEMY_cjs_js.e(Re__default.default)`
567
+ `,Qc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:r}=Ft(),[n,i]=hi.useState(false),[a,l]=hi__default.default.useState(""),[s,c]=hi__default.default.useState(false),[u,f]=hi__default.default.useState(""),{previewSubscriptionAction:y}=di({onMockCheckoutPreview:o}),p=()=>chunkIL3DC53A_cjs_js.d(null,null,function*(){var P;c(true),f("");let{subscriptionPreview:g,errorMessage:h}=yield y({promotionCode:a});!h&&((P=g==null?void 0:g.immediateInvoice)!=null&&P.discountDetails)?(r(a.toUpperCase()),i(false)):h&&f(h),c(false);});return n?jsxRuntime.jsxs(Re__default.default,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:u?"error":e?"disabled":"primary.main",children:t.summary.couponCodeTitle}),jsxRuntime.jsx(pe,{disabled:e,autoFocus:true,variant:"outlined",fullWidth:true,error:!!u,value:a,onChange:g=>{l(g.target.value);},inputProps:{maxLength:20},onKeyDown:g=>{g.key==="Enter"&&(p(),g.preventDefault());},InputProps:{endAdornment:jsxRuntime.jsx(jh,{variant:"contained",disabled:e,onClick:()=>{p();},children:s?jsxRuntime.jsx(Jh__default.default,{size:18,sx:{color:"white"}}):jsxRuntime.jsx(chunkIL3DC53A_cjs_js.i,{style:{display:"flex"},icon:"ArrowForward"})})}}),!!u&&jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"error",children:u})]}):jsxRuntime.jsx(Yc,{disabled:e,onAddClick:()=>i(true),checkoutLocalization:t})};var tC=chunkIL3DC53A_cjs_js.e(Re__default.default)`
568
568
  width: auto;
569
569
  display: inline-flex;
570
570
  align-items: center;
@@ -573,7 +573,7 @@
573
573
  padding: 6px 8px;
574
574
  border-radius: ${({theme:e})=>e.stigg.border.radius};
575
575
  border: 1px solid ${({theme:e})=>e.stigg.palette.primary};
576
- `,Qc=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.i,{shouldForwardProp:e=>e!=="style"})`
576
+ `,Kc=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.i,{shouldForwardProp:e=>e!=="style"})`
577
577
  display: flex;
578
578
 
579
579
  g {
@@ -583,9 +583,9 @@
583
583
  path {
584
584
  fill: ${({theme:e,$shouldFill:t})=>t?e.stigg.palette.primary:void 0};
585
585
  }
586
- `,qc=({promotionCode:e,onClearPromotionCode:t})=>jsxRuntime.jsxs(tC,{container:true,children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsxRuntime.jsx(Qc,{icon:"Coupon"}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsx(te,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsxRuntime.jsx(Qc,{icon:"Close",$shouldFill:true})})})]});var oC=chunk2FMVMEMY_cjs_js.e.div`
586
+ `,Jc=({promotionCode:e,onClearPromotionCode:t})=>jsxRuntime.jsxs(tC,{container:true,children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsxRuntime.jsx(Kc,{icon:"Coupon"}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsx(te,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsxRuntime.jsx(Kc,{icon:"Close",$shouldFill:true})})})]});var oC=chunkIL3DC53A_cjs_js.e.div`
587
587
  margin: 16px 0;
588
- `,Jc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:r,setPromotionCode:n}=Ft();return jsxRuntime.jsx(oC,{children:r?jsxRuntime.jsx(qc,{promotionCode:r,onClearPromotionCode:()=>{n("");}}):jsxRuntime.jsx(Yc,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var Xc=({label:e,checked:t,onChange:o,onClick:r,value:n,disabled:i,dataTestId:a})=>jsxRuntime.jsx(nC__default.default,{onClick:r,value:n,control:jsxRuntime.jsx(rC__default.default,{checked:t,onChange:o,disabled:i,"data-testid":a}),label:iC__default.default(e)?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Ti=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:_3x2.AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:_3x2.AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:_3x2.AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:_3x2.AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:_3x2.AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:_3x2.AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:_3x2.AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:_3x2.AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:_3x2.AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:_3x2.AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:_3x2.BS,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:_3x2.BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:_3x2.BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:_3x2.BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:_3x2.BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:_3x2.BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:_3x2.BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:_3x2.BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:_3x2.BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:_3x2.BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:_3x2.BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:_3x2.BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:_3x2.BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:_3x2.BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:_3x2.KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:_3x2.CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:_3x2.CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:_3x2.CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:_3x2.CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:_3x2.CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:_3x2.CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:_3x2.CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:_3x2.CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:_3x2.CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:_3x2.CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:_3x2.CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:_3x2.CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:_3x2.CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:_3x2.HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:_3x2.HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:_3x2.CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:_3x2.CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:_3x2.DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:_3x2.DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:_3x2.EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:_3x2.EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:_3x2.SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:_3x2.EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:_3x2.ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:_3x2.EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:_3x2.FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:_3x2.FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:_3x2.GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:_3x2.DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:_3x2.DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:_3x2.GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:_3x2.GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:_3x2.HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:_3x2.HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:_3x2.HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:_3x2.IS,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:_3x2.IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:_3x2.ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:_3x2.IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:_3x2.IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:_3x2.IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:_3x2.JP,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:_3x2.JP,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:_3x2.JP,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:_3x2.KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:_3x2.KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:_3x2.KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:_3x2.LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:_3x2.LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:_3x2.LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:_3x2.LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:_3x2.LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:_3x2.LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:_3x2.MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:_3x2.MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:_3x2.MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:_3x2.MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:_3x2.MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:_3x2.MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:_3x2.MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:_3x2.ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:_3x2.MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:_3x2.NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:_3x2.NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:_3x2.NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:_3x2.NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:_3x2.MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:_3x2.NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:_3x2.NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:_3x2.OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:_3x2.PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:_3x2.PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:_3x2.PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:_3x2.PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:_3x2.RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:_3x2.RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:_3x2.RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:_3x2.RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:_3x2.SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:_3x2.SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:_3x2.RS,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:_3x2.SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:_3x2.SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:_3x2.SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:_3x2.SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:_3x2.SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:_3x2.ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:_3x2.KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:_3x2.ES,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:_3x2.ES,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:_3x2.SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:_3x2.SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:_3x2.CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:_3x2.CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:_3x2.TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:_3x2.TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:_3x2.TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:_3x2.TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:_3x2.TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:_3x2.UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:_3x2.UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:_3x2.AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:_3x2.GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:_3x2.GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:_3x2.US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:_3x2.UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:_3x2.UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:_3x2.UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:_3x2.VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:_3x2.VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:_3x2.ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:_3x2.ZW,example:"1234567890"}],WP="United States",ZP=" # ",Sr="us_ein",Tr=(e,t)=>`${e}${ZP}${t}`,ki=new Map(Ti.map(e=>[Tr(e.taxIdType,e.country),e])),vt=e=>ki.get(e),kr=Tr(Sr,WP);var wi=chunk2FMVMEMY_cjs_js.e(pe)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var JP=chunk2FMVMEMY_cjs_js.e(YP__default.default)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),wr=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)({});wr.defaultProps={variant:"body1",color:"secondary"};function hd(){let[e,t]=hi.useState(false),{billingAddress:o,taxId:r,setTaxId:n}=re(),[i,a]=hi.useState(kr),[l,s]=hi.useState(false),c=hi.useCallback((g,h,P)=>{n({type:h,value:P}),a(g);},[n,a]);hi.useEffect(()=>{s(false);},[o==null?void 0:o.country]),hi.useEffect(()=>{if(!(o!=null&&o.country)||l||!e)return;let g=Ti.find(h=>h.countryCode===o.country);g&&c(Tr(g.taxIdType,g.country),g.taxIdType,"");},[o,e,l,c]);let u=g=>{if(!g)return;let h=vt(g);if(h){if(s(true),r!=null&&r.value){c(g,h.taxIdType,r.value);return}a(g),r!=null&&r.type&&n(void 0);}},f=hi.useMemo(()=>Array.from(ki.keys()),[]),y=hi.useMemo(()=>f.find(g=>g===i)||null,[f,i]),p=hi.useMemo(()=>{let g=vt(i);return (g==null?void 0:g.example)||"Add your VAT/GST or local tax ID."},[i]);return hi.useEffect(()=>(e||(s(false),c(kr,Sr,"")),()=>{c(kr,Sr,"");}),[e,c]),jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(Re__default.default,{flexDirection:"row",container:true,gap:2,children:jsxRuntime.jsx(Xc,{checked:e,onChange:()=>t(g=>!g),label:jsxRuntime.jsx(wr,{children:"I'm purchasing as a business"})})}),jsxRuntime.jsx(QP__default.default,{in:e,children:jsxRuntime.jsxs(Re__default.default,{container:true,spacing:0,sx:{width:"100%"},children:[jsxRuntime.jsxs(Re__default.default,{item:true,xs:6,children:[jsxRuntime.jsx(wr,{children:"Tax ID Type"}),jsxRuntime.jsx(JP,{fullWidth:true,options:f,value:y,onChange:(g,h)=>u(h),renderInput:g=>jsxRuntime.jsx(wi,chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},g),{id:"id-type",InputProps:g.InputProps})),renderOption:(g,h)=>{let P=vt(h);if(!P)return null;let{taxIdType:b,country:x,FlagComponent:A}=P;return hi.createElement(Iu__default.default,chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},g),{key:h}),jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:[A&&jsxRuntime.jsx(A,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),fd__default.default(x)," - ",yd__default.default(b)]}))},getOptionLabel:g=>{let h=vt(g);return h?`${fd__default.default(h.country)} - ${yd__default.default(h.taxIdType)}`:g},ListboxProps:{sx:{maxHeight:200}}})]}),jsxRuntime.jsxs(Re__default.default,{item:true,xs:6,paddingLeft:"12px",children:[jsxRuntime.jsx(wr,{children:"Tax ID"}),jsxRuntime.jsx(wi,{id:"tax-id-value",placeholder:p,type:"text",fullWidth:true,value:(r==null?void 0:r.value)||"",onChange:g=>{let h=vt(i);h&&c(i,h.taxIdType,g.target.value);}})]})]})})]})}function Cd({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var g;let{checkoutState:r,checkoutLocalization:n,widgetState:i,setWidgetReadOnly:a}=D(),{setBillingAddress:l}=re(),{customer:s,configuration:c}=r||{},{readOnly:u}=i,f=!!(t!=null?t:(g=c==null?void 0:c.content)!=null&&g.collectPhoneNumber),y=hi.useMemo(()=>o&&!(s!=null&&s.billingId)&&!(s!=null&&s.paymentMethodDetails),[o,s==null?void 0:s.billingId,s==null?void 0:s.paymentMethodDetails]),p=h=>{if(!h.complete)return;let A=h.value.address,{postal_code:P}=A,b=chunk2FMVMEMY_cjs_js.c(A,["postal_code"]),x=chunk2FMVMEMY_cjs_js.a({postalCode:P},b);a(true),l(x),e?chunk2FMVMEMY_cjs_js.d(null,null,function*(){yield e({billingAddress:x}),a(false);}):a(false);};return jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:u?"none":void 0},children:[jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",children:n.newPaymentMethodBillingAddressTitle}),jsxRuntime.jsx(reactStripeJs.AddressElement,{onChange:p,options:{mode:"billing",fields:{phone:f?"always":"auto"},defaultValues:chunk2FMVMEMY_cjs_js.a({},(s==null?void 0:s.name)&&{name:s.name})}})]}),jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",children:n.newPaymentMethodCardTitle}),jsxRuntime.jsx(reactStripeJs.PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:u,terms:{card:"never"},defaultValues:{billingDetails:chunk2FMVMEMY_cjs_js.a(chunk2FMVMEMY_cjs_js.a({},(s==null?void 0:s.name)&&{name:s.name}),(s==null?void 0:s.email)&&{email:s.email})}}})]}),y&&jsxRuntime.jsx(hd,{})]})}function Pd(){let[e,t]=hi.useState(null),{checkoutState:o}=D(),{billingIntegration:r,setupSecret:n}=o||{};return hi.useEffect(()=>{if(r){let{billingIdentifier:i,credentials:a}=r;if(i!==jsClientSdk.BillingVendorIdentifier.Stripe)return;let{accountId:l,publicKey:s}=a;if(!l||!s){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(s,{stripeAccount:l}));});}},[r]),{stripePromise:e,setupIntentClientSecret:n}}function Br(){let e=It(),[{resourceId:t,resetBillingPeriod:o}]=_(),{checkoutState:r}=D(),{plan:n,activeSubscription:i}=r||{},a=e.addons.map(({addon:c,quantity:u})=>({addonId:c.id,quantity:u}));if(!(n!=null&&n.id))return;let{prorationBehavior:l,billingCycleAnchor:s}=Cr({activeSubscription:i,resetBillingPeriod:o});return chunk2FMVMEMY_cjs_js.a(chunk2FMVMEMY_cjs_js.a({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:a,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},hr({billingAddress:e.billingAddress,taxIds:e.taxId?[e.taxId]:void 0,prorationBehavior:l})),s?{billingCycleAnchor:s}:{})}var ix=[jsClientSdk.PaymentCollection.Failed,jsClientSdk.PaymentCollection.Processing];function ax(t){return chunk2FMVMEMY_cjs_js.d(this,arguments,function*({elements:e}){if(!e){let r="Stripe elements not initialized";return console.error(r),{success:false,errorMessage:r}}let{error:o}=yield e.submit();return o?(console.log(o.message),{success:false,errorMessage:o.message||""}):{success:true}})}function Li(o){return chunk2FMVMEMY_cjs_js.d(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var a,l;let r=e==null?void 0:e.subscription,n=(a=r==null?void 0:r.latestInvoice)==null?void 0:a.paymentSecret,i=r==null?void 0:r.paymentCollection;if(t&&n&&i===jsClientSdk.PaymentCollection.ActionRequired){let{error:s}=yield t.handleNextAction({clientSecret:n});if(s)return {errorMessage:s.message||""}}else if(i&&ix.includes(i))return {errorMessage:((l=r==null?void 0:r.latestInvoice)==null?void 0:l.errorMessage)||"An error occurred - try again later"};return {subscription:r}})}function sx(r){return chunk2FMVMEMY_cjs_js.d(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let n,i,{error:a}=yield e.confirmSetup({elements:t,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(a)a.type==="card_error"||a.type==="validation_error"?a.type==="card_error"&&(i=a.message||""):i="An unexpected error occurred.";else try{let{setupIntent:l}=yield e.retrieveSetupIntent(o);l!=null&&l.payment_method&&(n=l.payment_method);}catch(l){i="An unexpected error occurred.",console.error(l);}return {newPaymentMethodId:n,setupErrorMessage:i}})}function xd(r){return chunk2FMVMEMY_cjs_js.d(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let n=yield ax({elements:t});if(!n.success)return {success:false,errorMessage:n.errorMessage};let{newPaymentMethodId:i,setupErrorMessage:a}=yield sx({stripe:e,elements:t,clientSecret:o});return a||!i?{success:false,errorMessage:a}:{success:true,paymentMethodId:i}})}var bd={v:"5.12.1",fr:30,ip:0,op:201,w:700,h:700,nm:"Check",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shape Layer 8",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:315,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Shape Layer 7",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:270,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:3,ty:4,nm:"Shape Layer 6",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:225,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:4,ty:4,nm:"Shape Layer 5",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:5,ty:4,nm:"Shape Layer 4",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:135,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:6,ty:4,nm:"Shape Layer 3",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:90,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:7,ty:4,nm:"Shape Layer 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:45,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:8,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:9,ty:4,nm:"Check v",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:-1.9,ix:10},p:{a:0,k:[352,360,0],ix:2,l:2},a:{a:0,k:[-120.265,116.765,0],ix:1,l:2},s:{a:0,k:[278,278,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-161,123],[-137,148],[-79.531,85.531]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:5.5,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[0],y:[1]},o:{x:[.333],y:[0]},t:135,s:[0]},{t:148,s:[100]}],ix:1},e:{a:0,k:0,ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:135,op:201,st:-35,ct:1,bm:0},{ddd:0,ind:11,ty:4,nm:"Circle Stroke",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:7,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[4,-6,0],ix:1,l:2},s:{a:0,k:[132,132,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[306,306],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:false},{ty:"st",c:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:30,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:61,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:87,s:[1,1,1,1]},{t:136,s:[1,1,1,1]}],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:8,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[4,-6],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[50]},{t:122,s:[100]}],ix:1},e:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[45]},{t:122,s:[0]}],ix:2},o:{a:1,k:[{i:{x:[.474],y:[1]},o:{x:[.43],y:[0]},t:0,s:[-170.4]},{t:111,s:[-1250.4]}],ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:0,op:201,st:0,ct:1,bm:0},{ddd:0,ind:13,ty:1,nm:"Dark Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[350,350,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,sw:700,sh:700,sc:"#2d2d2d",ip:0,op:201,st:0,bm:0}],markers:[],props:{}};var Ar=5e3,ux=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
588
+ `,Xc=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:r,setPromotionCode:n}=Ft();return jsxRuntime.jsx(oC,{children:r?jsxRuntime.jsx(Jc,{promotionCode:r,onClearPromotionCode:()=>{n("");}}):jsxRuntime.jsx(Qc,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var jc=({label:e,checked:t,onChange:o,onClick:r,value:n,disabled:i,dataTestId:a})=>jsxRuntime.jsx(nC__default.default,{onClick:r,value:n,control:jsxRuntime.jsx(rC__default.default,{checked:t,onChange:o,disabled:i,"data-testid":a}),label:iC__default.default(e)?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Ti=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:_3x2.AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:_3x2.AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:_3x2.AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:_3x2.AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:_3x2.AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:_3x2.AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:_3x2.AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:_3x2.AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:_3x2.AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:_3x2.AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:_3x2.BS,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:_3x2.BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:_3x2.BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:_3x2.BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:_3x2.BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:_3x2.BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:_3x2.BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:_3x2.BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:_3x2.BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:_3x2.BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:_3x2.BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:_3x2.BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:_3x2.BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:_3x2.BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:_3x2.KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:_3x2.CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:_3x2.CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:_3x2.CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:_3x2.CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:_3x2.CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:_3x2.CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:_3x2.CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:_3x2.CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:_3x2.CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:_3x2.CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:_3x2.CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:_3x2.CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:_3x2.CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:_3x2.HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:_3x2.HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:_3x2.CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:_3x2.CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:_3x2.DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:_3x2.DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:_3x2.EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:_3x2.EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:_3x2.SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:_3x2.EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:_3x2.ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:_3x2.EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:_3x2.FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:_3x2.FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:_3x2.GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:_3x2.DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:_3x2.DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:_3x2.GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:_3x2.GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:_3x2.HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:_3x2.HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:_3x2.HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:_3x2.IS,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:_3x2.IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:_3x2.ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:_3x2.IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:_3x2.IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:_3x2.IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:_3x2.JP,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:_3x2.JP,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:_3x2.JP,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:_3x2.KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:_3x2.KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:_3x2.KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:_3x2.LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:_3x2.LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:_3x2.LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:_3x2.LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:_3x2.LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:_3x2.LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:_3x2.MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:_3x2.MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:_3x2.MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:_3x2.MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:_3x2.MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:_3x2.MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:_3x2.MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:_3x2.ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:_3x2.MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:_3x2.NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:_3x2.NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:_3x2.NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:_3x2.NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:_3x2.MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:_3x2.NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:_3x2.NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:_3x2.OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:_3x2.PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:_3x2.PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:_3x2.PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:_3x2.PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:_3x2.RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:_3x2.RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:_3x2.RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:_3x2.RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:_3x2.SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:_3x2.SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:_3x2.RS,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:_3x2.SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:_3x2.SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:_3x2.SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:_3x2.SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:_3x2.SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:_3x2.ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:_3x2.KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:_3x2.ES,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:_3x2.ES,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:_3x2.SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:_3x2.SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:_3x2.CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:_3x2.CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:_3x2.TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:_3x2.TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:_3x2.TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:_3x2.TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:_3x2.TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:_3x2.UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:_3x2.UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:_3x2.AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:_3x2.GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:_3x2.GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:_3x2.US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:_3x2.UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:_3x2.UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:_3x2.UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:_3x2.VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:_3x2.VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:_3x2.ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:_3x2.ZW,example:"1234567890"}],WP="United States",ZP=" # ",Sr="us_ein",Tr=(e,t)=>`${e}${ZP}${t}`,ki=new Map(Ti.map(e=>[Tr(e.taxIdType,e.country),e])),vt=e=>ki.get(e),kr=Tr(Sr,WP);var wi=chunkIL3DC53A_cjs_js.e(pe)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var JP=chunkIL3DC53A_cjs_js.e(YP__default.default)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),wr=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)({});wr.defaultProps={variant:"body1",color:"secondary"};function Cd(){let[e,t]=hi.useState(false),{billingAddress:o,taxId:r,setTaxId:n}=re(),[i,a]=hi.useState(kr),[l,s]=hi.useState(false),c=hi.useCallback((g,h,P)=>{n({type:h,value:P}),a(g);},[n,a]);hi.useEffect(()=>{s(false);},[o==null?void 0:o.country]),hi.useEffect(()=>{if(!(o!=null&&o.country)||l||!e)return;let g=Ti.find(h=>h.countryCode===o.country);g&&c(Tr(g.taxIdType,g.country),g.taxIdType,"");},[o,e,l,c]);let u=g=>{if(!g)return;let h=vt(g);if(h){if(s(true),r!=null&&r.value){c(g,h.taxIdType,r.value);return}a(g),r!=null&&r.type&&n(void 0);}},f=hi.useMemo(()=>Array.from(ki.keys()),[]),y=hi.useMemo(()=>f.find(g=>g===i)||null,[f,i]),p=hi.useMemo(()=>{let g=vt(i);return (g==null?void 0:g.example)||"Add your VAT/GST or local tax ID."},[i]);return hi.useEffect(()=>(e||(s(false),c(kr,Sr,"")),()=>{c(kr,Sr,"");}),[e,c]),jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(Re__default.default,{flexDirection:"row",container:true,gap:2,children:jsxRuntime.jsx(jc,{checked:e,onChange:()=>t(g=>!g),label:jsxRuntime.jsx(wr,{children:"I'm purchasing as a business"})})}),jsxRuntime.jsx(QP__default.default,{in:e,children:jsxRuntime.jsxs(Re__default.default,{container:true,spacing:0,sx:{width:"100%"},children:[jsxRuntime.jsxs(Re__default.default,{item:true,xs:6,children:[jsxRuntime.jsx(wr,{children:"Tax ID Type"}),jsxRuntime.jsx(JP,{fullWidth:true,options:f,value:y,onChange:(g,h)=>u(h),renderInput:g=>jsxRuntime.jsx(wi,chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},g),{id:"id-type",InputProps:g.InputProps})),renderOption:(g,h)=>{let P=vt(h);if(!P)return null;let{taxIdType:b,country:x,FlagComponent:A}=P;return hi.createElement(Iu__default.default,chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},g),{key:h}),jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:[A&&jsxRuntime.jsx(A,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),yd__default.default(x)," - ",hd__default.default(b)]}))},getOptionLabel:g=>{let h=vt(g);return h?`${yd__default.default(h.country)} - ${hd__default.default(h.taxIdType)}`:g},ListboxProps:{sx:{maxHeight:200}}})]}),jsxRuntime.jsxs(Re__default.default,{item:true,xs:6,paddingLeft:"12px",children:[jsxRuntime.jsx(wr,{children:"Tax ID"}),jsxRuntime.jsx(wi,{id:"tax-id-value",placeholder:p,type:"text",fullWidth:true,value:(r==null?void 0:r.value)||"",onChange:g=>{let h=vt(i);h&&c(i,h.taxIdType,g.target.value);}})]})]})})]})}function Pd({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var g;let{checkoutState:r,checkoutLocalization:n,widgetState:i,setWidgetReadOnly:a}=D(),{setBillingAddress:l}=re(),{customer:s,configuration:c}=r||{},{readOnly:u}=i,f=!!(t!=null?t:(g=c==null?void 0:c.content)!=null&&g.collectPhoneNumber),y=hi.useMemo(()=>o&&!(s!=null&&s.billingId)&&!(s!=null&&s.paymentMethodDetails),[o,s==null?void 0:s.billingId,s==null?void 0:s.paymentMethodDetails]),p=h=>{if(!h.complete)return;let A=h.value.address,{postal_code:P}=A,b=chunkIL3DC53A_cjs_js.c(A,["postal_code"]),x=chunkIL3DC53A_cjs_js.a({postalCode:P},b);a(true),l(x),e?chunkIL3DC53A_cjs_js.d(null,null,function*(){yield e({billingAddress:x}),a(false);}):a(false);};return jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:u?"none":void 0},children:[jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",children:n.newPaymentMethodBillingAddressTitle}),jsxRuntime.jsx(reactStripeJs.AddressElement,{onChange:p,options:{mode:"billing",fields:{phone:f?"always":"auto"},defaultValues:chunkIL3DC53A_cjs_js.a({},(s==null?void 0:s.name)&&{name:s.name})}})]}),jsxRuntime.jsxs(Re__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",children:n.newPaymentMethodCardTitle}),jsxRuntime.jsx(reactStripeJs.PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:u,terms:{card:"never"},defaultValues:{billingDetails:chunkIL3DC53A_cjs_js.a(chunkIL3DC53A_cjs_js.a({},(s==null?void 0:s.name)&&{name:s.name}),(s==null?void 0:s.email)&&{email:s.email})}}})]}),y&&jsxRuntime.jsx(Cd,{})]})}function xd(){let[e,t]=hi.useState(null),{checkoutState:o}=D(),{billingIntegration:r,setupSecret:n}=o||{};return hi.useEffect(()=>{if(r){let{billingIdentifier:i,credentials:a}=r;if(i!==jsClientSdk.BillingVendorIdentifier.Stripe)return;let{accountId:l,publicKey:s}=a;if(!l||!s){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(s,{stripeAccount:l}));});}},[r]),{stripePromise:e,setupIntentClientSecret:n}}function Br(){let e=It(),[{resourceId:t,resetBillingPeriod:o}]=_(),{checkoutState:r}=D(),{plan:n,activeSubscription:i}=r||{},a=e.addons.map(({addon:c,quantity:u})=>({addonId:c.id,quantity:u}));if(!(n!=null&&n.id))return;let{prorationBehavior:l,billingCycleAnchor:s}=Cr({activeSubscription:i,resetBillingPeriod:o});return chunkIL3DC53A_cjs_js.a(chunkIL3DC53A_cjs_js.a({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:a,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},hr({billingAddress:e.billingAddress,taxIds:e.taxId?[e.taxId]:void 0,prorationBehavior:l})),s?{billingCycleAnchor:s}:{})}var ix=[jsClientSdk.PaymentCollection.Failed,jsClientSdk.PaymentCollection.Processing];function ax(t){return chunkIL3DC53A_cjs_js.d(this,arguments,function*({elements:e}){if(!e){let r="Stripe elements not initialized";return console.error(r),{success:false,errorMessage:r}}let{error:o}=yield e.submit();return o?(console.log(o.message),{success:false,errorMessage:o.message||""}):{success:true}})}function Li(o){return chunkIL3DC53A_cjs_js.d(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var a,l;let r=e==null?void 0:e.subscription,n=(a=r==null?void 0:r.latestInvoice)==null?void 0:a.paymentSecret,i=r==null?void 0:r.paymentCollection;if(t&&n&&i===jsClientSdk.PaymentCollection.ActionRequired){let{error:s}=yield t.handleNextAction({clientSecret:n});if(s)return {errorMessage:s.message||""}}else if(i&&ix.includes(i))return {errorMessage:((l=r==null?void 0:r.latestInvoice)==null?void 0:l.errorMessage)||"An error occurred - try again later"};return {subscription:r}})}function sx(r){return chunkIL3DC53A_cjs_js.d(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let n,i,{error:a}=yield e.confirmSetup({elements:t,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(a)a.type==="card_error"||a.type==="validation_error"?a.type==="card_error"&&(i=a.message||""):i="An unexpected error occurred.";else try{let{setupIntent:l}=yield e.retrieveSetupIntent(o);l!=null&&l.payment_method&&(n=l.payment_method);}catch(l){i="An unexpected error occurred.",console.error(l);}return {newPaymentMethodId:n,setupErrorMessage:i}})}function bd(r){return chunkIL3DC53A_cjs_js.d(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let n=yield ax({elements:t});if(!n.success)return {success:false,errorMessage:n.errorMessage};let{newPaymentMethodId:i,setupErrorMessage:a}=yield sx({stripe:e,elements:t,clientSecret:o});return a||!i?{success:false,errorMessage:a}:{success:true,paymentMethodId:i}})}var Sd={v:"5.12.1",fr:30,ip:0,op:201,w:700,h:700,nm:"Check",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shape Layer 8",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:315,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Shape Layer 7",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:270,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:3,ty:4,nm:"Shape Layer 6",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:225,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:4,ty:4,nm:"Shape Layer 5",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:5,ty:4,nm:"Shape Layer 4",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:135,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:6,ty:4,nm:"Shape Layer 3",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:90,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:7,ty:4,nm:"Shape Layer 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:45,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:8,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:9,ty:4,nm:"Check v",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:-1.9,ix:10},p:{a:0,k:[352,360,0],ix:2,l:2},a:{a:0,k:[-120.265,116.765,0],ix:1,l:2},s:{a:0,k:[278,278,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-161,123],[-137,148],[-79.531,85.531]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:5.5,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[0],y:[1]},o:{x:[.333],y:[0]},t:135,s:[0]},{t:148,s:[100]}],ix:1},e:{a:0,k:0,ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:135,op:201,st:-35,ct:1,bm:0},{ddd:0,ind:11,ty:4,nm:"Circle Stroke",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:7,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[4,-6,0],ix:1,l:2},s:{a:0,k:[132,132,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[306,306],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:false},{ty:"st",c:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:30,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:61,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:87,s:[1,1,1,1]},{t:136,s:[1,1,1,1]}],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:8,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[4,-6],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[50]},{t:122,s:[100]}],ix:1},e:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[45]},{t:122,s:[0]}],ix:2},o:{a:1,k:[{i:{x:[.474],y:[1]},o:{x:[.43],y:[0]},t:0,s:[-170.4]},{t:111,s:[-1250.4]}],ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:0,op:201,st:0,ct:1,bm:0},{ddd:0,ind:13,ty:1,nm:"Dark Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[350,350,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,sw:700,sh:700,sc:"#2d2d2d",ip:0,op:201,st:0,bm:0}],markers:[],props:{}};var Ar=5e3,ux=chunkIL3DC53A_cjs_js.e(ke__default.default)`
589
589
  @keyframes blurFade {
590
590
  0% {
591
591
  background-color: ${({theme:e})=>Ni__default.default(e.stigg.palette.backgroundPaper).alpha(0).toString()};
@@ -616,7 +616,7 @@
616
616
  & path {
617
617
  stroke: ${({theme:e})=>e.stigg.palette.primary};
618
618
  }
619
- `,gx=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
619
+ `,gx=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
620
620
  @keyframes fadeIn {
621
621
  0% {
622
622
  opacity: 0;
@@ -631,19 +631,19 @@
631
631
 
632
632
  align-self: center;
633
633
  animation: fadeIn 5s ease-in forwards;
634
- `;function Td({checkoutLocalization:e}){let t=hi.useRef();return hi.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxRuntime.jsxs(ux,{className:"stigg-checkout-success-container",ref:t,children:[jsxRuntime.jsx(mx__default.default,{options:{animationData:bd,loop:false,autoplay:true},width:350,height:"auto",style:{display:"flex",justifyContent:"center"}}),jsxRuntime.jsx(gx,{variant:"h1",color:"primary.main",children:e.summary.checkoutSuccessText})]})}var Cx=e=>new Promise(t=>setTimeout(t,e));function kd({isMocked:e=false,onCheckout:t,onCheckoutCompleted:o,onSuccess:r,disableSuccessAnimation:n}){let{stigg:i}=chunk2FMVMEMY_cjs_js.u(),{useNewPaymentMethod:a}=re(),l=Br(),{checkoutState:s,widgetState:c,setWidgetReadOnly:u}=D(),{setupSecret:f,customer:y}=s||{},p=reactStripeJs.useStripe(),g=reactStripeJs.useElements();return {handleSubmit:P=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(P.preventDefault(),!l)return {success:false,errorMessage:"Unexpected error, please contact support."};let b=true,x,A=false,S;if(u(true),!e&&a){let w=yield xd({elements:g,stripe:p,setupIntentClientSecret:f});w.success?S=w.paymentMethodId:(x=w.errorMessage,b=false);}let F=chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},l),{paymentMethodId:S}),T=w=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){A=true;try{let I=yield i.applySubscription(w),E=yield Li({applySubscriptionResults:I,stripe:p});return {success:!E.errorMessage,errorMessage:E.errorMessage,results:I}}catch(I){return console.error(I),x=I==null?void 0:I.message,{success:false,errorMessage:x}}}),k;if(b)if(t){let w=yield t({customerId:y.id,checkoutParams:F,checkoutAction:T});if(w.errorMessage&&(x=w.errorMessage),!A&&w.results&&w.success){let I=yield Li({applySubscriptionResults:w.results,stripe:p});I.errorMessage&&(x=I.errorMessage,b=false);}b=b&&w.success&&!x,k=w.results;}else {let w=yield T(F);!w.success&&w.errorMessage&&(x=w.errorMessage),b=w.success&&!x,k=w.results;}return u(false),b&&r&&(r(),n||(yield Cx(Ar))),yield o({success:b,error:x}),{results:k,success:!x,errorMessage:x}}),isLoading:!!(c!=null&&c.readOnly)}}function wd(){return !!window.Zuora}function Bd(){let e=document.createElement("script");e.type="text/javascript",e.src="https://js.zuora.com/payment/v3/zuora.js",e.async=true,e.onerror=()=>{throw new Error("Failed to load Zuora library")},document.head.appendChild(e);}function Ad(e,t,o,r){return {locale:r||"en",region:(r==null?void 0:r.toUpperCase())||"US",currency:o,amount:"1",createPaymentSession:e,onComplete:t}}function Lt(){let{stigg:e}=chunk2FMVMEMY_cjs_js.u(),{setErrorMessage:t}=re(),{billingCountryCode:o}=be(),[r,n]=hi.useState(false),{checkoutState:i}=D(),{billingIntegration:a}=i||{},l=hi.useCallback(()=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(!(i!=null&&i.customer.id)||!(i!=null&&i.plan.id))throw new Error("Customer and plan are required");let{token:u}=yield e.createPaymentSession({planId:i.plan.id,billingCountryCode:o});return u}),[i,e,o]),s=hi.useCallback(()=>{try{wd()||Bd(),n(!0);}catch(u){t("Failed to initialize Zuora");}},[n,t]);return hi.useEffect(()=>{if(a){let{billingIdentifier:u}=a;u===jsClientSdk.BillingVendorIdentifier.Zuora&&s();}},[a,s]),{isZuoraIntegration:(a==null?void 0:a.billingIdentifier)===jsClientSdk.BillingVendorIdentifier.Zuora,isInitialized:r,createPaymentSession:l}}var Sx=e=>new Promise(t=>setTimeout(t,e));function Ir({onCheckout:e,onCheckoutCompleted:t,onSuccess:o,disableSuccessAnimation:r}){let{stigg:n}=chunk2FMVMEMY_cjs_js.u(),i=Br(),{checkoutState:a,setWidgetReadOnly:l,setCheckoutSuccess:s}=D(),{setErrorMessage:c}=re();return {handleZuoraSubmit:hi.useCallback(f=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){l(true);let y=true,p,g=i;if(!g)y=false,p="Unexpected error, please contact support.";else {let h=chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},g),{paymentMethodId:f}),P=b=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){try{return {success:!0,results:yield n.applySubscription(b)}}catch(x){return console.error(x),{success:false,errorMessage:(x==null?void 0:x.message)||"Failed to apply subscription"}}});try{if(e){let b=yield e({customerId:a.customer.id,checkoutParams:h,checkoutAction:P});b.errorMessage&&(p=b.errorMessage),y=y&&b.success&&!p;}else {let b=yield P(h);!b.success&&b.errorMessage&&(p=b.errorMessage),y=b.success&&!p;}}catch(b){y=false,p=b.message||"Failed to process checkout";}}return y?(s(true),o&&(o(),r||(yield Sx(Ar)))):c(p),l(false),yield t({success:y,error:p}),{success:y,errorMessage:p}}),[n,i,a,e,t,o,r,l,s,c])}}var Ie=({isLoading:e,width:t=50,height:o=16,children:r})=>e?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:t,height:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:r});var wx=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{var a,l,s,c;let{immediateInvoice:r}=e||{};if(!((l=(a=r==null?void 0:r.proration)==null?void 0:a.netAmount)!=null&&l.amount)||((c=(s=r==null?void 0:r.proration)==null?void 0:s.netAmount)==null?void 0:c.amount)>=0)return null;let n=r.proration.netAmount.amount*-1,i=H({amount:n,currency:r.proration.netAmount.currency,minimumFractionDigits:2});return jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-remaining-credits",children:jsxRuntime.jsx(Ie,{isLoading:t,width:"100%",children:o.summary.creditsForUnusedTimeText({credits:i})})})},Bx=({subscriptionPreview:e,activeSubscription:t,isFetchingSubscriptionPreview:o,checkoutLocalization:r})=>{if(!(e!=null&&e.hasScheduledUpdates)||!(t!=null&&t.currentBillingPeriodEnd))return null;let{currentBillingPeriodEnd:n}=t,i=typeof r.summary.changesWillApplyAtEndOfBillingPeriod=="function"?r.summary.changesWillApplyAtEndOfBillingPeriod({billingPeriodEnd:n}):r.summary.changesWillApplyAtEndOfBillingPeriod;return jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-scheduled-updates",children:jsxRuntime.jsx(Ie,{isLoading:o,width:"100%",children:i})})},Ax=({subscriptionPreview:e,activeSubscription:t,plan:o,isFetchingSubscriptionPreview:r,billingPeriod:n,checkoutLocalization:i})=>{let{promotionCode:a}=Ft();if(!e)return null;let l=i.nextBillingCaption({plan:o,subscriptionPreview:e,billingPeriod:n,activeSubscription:t,promotionCode:a});return jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-next-billing",children:jsxRuntime.jsx(Ie,{isLoading:r,width:"100%",children:l})})};function vd(e){return jsxRuntime.jsxs(ke__default.default,{className:"stigg-checkout-summary-captions",children:[jsxRuntime.jsx(wx,chunk2FMVMEMY_cjs_js.a({},e)),jsxRuntime.jsx(Bx,chunk2FMVMEMY_cjs_js.a({},e)),e.plan&&jsxRuntime.jsx(Ax,chunk2FMVMEMY_cjs_js.a({},e))]})}function Mi({quantity:e,totalAmount:t,pricingModel:o,billingPeriod:r,currency:n,blockSize:i,priceAmount:a,availableBillingPeriods:l}){let s=l==null?void 0:l.has(jsClientSdk.BillingPeriod.Monthly),c=o===jsClientSdk.BillingModel.PerUnit,u=i||1,f=r===jsClientSdk.BillingPeriod.Annually&&s,y=e&&(c||e>1)?`${chunk2FMVMEMY_cjs_js.k(e)} ${u>1?"for":"x"} `:"",p=f?" x 12 months":"",g=(a||t/e)/(f?12:1),h=H({amount:g,currency:n,minimumFractionDigits:2}),P=H({amount:t,currency:n,minimumFractionDigits:2});return `${y}${h}${p} ${p||y?` = ${P}`:""}`}function Nd(e){let{totalAmount:t,quantity:o,tiersMode:r,tiers:n,currency:i}=e;if(Oa(n)||r===jsClientSdk.TiersMode.Graduated&&!Ha(n,o)){let a=H({amount:t,currency:i,minimumFractionDigits:2});return `${chunk2FMVMEMY_cjs_js.k(o)} for ${a}`}return Mi(e)}function Lx(e,t){let{unitPrice:o,upTo:r}=e[t];if(!o)return "";if(t===0)return `First ${r}`;let i=(e[t-1].upTo||0)+1;return Fo__default.default(r)?`${chunk2FMVMEMY_cjs_js.k(i)} and above`:`Next ${chunk2FMVMEMY_cjs_js.k(i)} to ${chunk2FMVMEMY_cjs_js.k(r)}`}function Md({price:e,unitQuantity:t}){let o=e.tiers||[],{checkoutState:r}=D(),n=r==null?void 0:r.plan,{breakdown:i}=bn(o,t);return i.length===1?null:jsxRuntime.jsx(jsxRuntime.Fragment,{children:i.map(({unitQuantity:a,amount:l},s)=>jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Lx(o,s)}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Mi({quantity:a,totalAmount:l,currency:e.currency,pricingModel:e.pricingModel,billingPeriod:e.billingPeriod,tiers:e.tiers,tiersMode:e.tiersMode,blockSize:e.blockSize,priceAmount:e.amount,availableBillingPeriods:new Set(n==null?void 0:n.pricePoints.map(c=>c.billingPeriod))})})]})},s))})}var Rd=chunk2FMVMEMY_cjs_js.e(reactFeather.ChevronRight)`
634
+ `;function kd({checkoutLocalization:e}){let t=hi.useRef();return hi.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxRuntime.jsxs(ux,{className:"stigg-checkout-success-container",ref:t,children:[jsxRuntime.jsx(mx__default.default,{options:{animationData:Sd,loop:false,autoplay:true},width:350,height:"auto",style:{display:"flex",justifyContent:"center"}}),jsxRuntime.jsx(gx,{variant:"h1",color:"primary.main",children:e.summary.checkoutSuccessText})]})}var Cx=e=>new Promise(t=>setTimeout(t,e));function wd({isMocked:e=false,onCheckout:t,onCheckoutCompleted:o,onSuccess:r,disableSuccessAnimation:n}){let{stigg:i}=chunkIL3DC53A_cjs_js.u(),{useNewPaymentMethod:a}=re(),l=Br(),{checkoutState:s,widgetState:c,setWidgetReadOnly:u}=D(),{setupSecret:f,customer:y}=s||{},p=reactStripeJs.useStripe(),g=reactStripeJs.useElements();return {handleSubmit:P=>chunkIL3DC53A_cjs_js.d(null,null,function*(){if(P.preventDefault(),!l)return {success:false,errorMessage:"Unexpected error, please contact support."};let b=true,x,A=false,S;if(u(true),!e&&a){let w=yield bd({elements:g,stripe:p,setupIntentClientSecret:f});w.success?S=w.paymentMethodId:(x=w.errorMessage,b=false);}let F=chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},l),{paymentMethodId:S}),T=w=>chunkIL3DC53A_cjs_js.d(null,null,function*(){A=true;try{let I=yield i.applySubscription(w),E=yield Li({applySubscriptionResults:I,stripe:p});return {success:!E.errorMessage,errorMessage:E.errorMessage,results:I}}catch(I){return console.error(I),x=I==null?void 0:I.message,{success:false,errorMessage:x}}}),k;if(b)if(t){let w=yield t({customerId:y.id,checkoutParams:F,checkoutAction:T});if(w.errorMessage&&(x=w.errorMessage),!A&&w.results&&w.success){let I=yield Li({applySubscriptionResults:w.results,stripe:p});I.errorMessage&&(x=I.errorMessage,b=false);}b=b&&w.success&&!x,k=w.results;}else {let w=yield T(F);!w.success&&w.errorMessage&&(x=w.errorMessage),b=w.success&&!x,k=w.results;}return u(false),b&&r&&(r(),n||(yield Cx(Ar))),yield o({success:b,error:x}),{results:k,success:!x,errorMessage:x}}),isLoading:!!(c!=null&&c.readOnly)}}function Bd(){return !!window.Zuora}function Ad(){let e=document.createElement("script");e.type="text/javascript",e.src="https://js.zuora.com/payment/v3/zuora.js",e.async=true,e.onerror=()=>{throw new Error("Failed to load Zuora library")},document.head.appendChild(e);}function Id(e,t,o,r){return {locale:r||"en",region:(r==null?void 0:r.toUpperCase())||"US",currency:o,amount:"1",createPaymentSession:e,onComplete:t}}function Lt(){let{stigg:e}=chunkIL3DC53A_cjs_js.u(),{setErrorMessage:t}=re(),{billingCountryCode:o}=be(),[r,n]=hi.useState(false),{checkoutState:i}=D(),{billingIntegration:a}=i||{},l=hi.useCallback(()=>chunkIL3DC53A_cjs_js.d(null,null,function*(){if(!(i!=null&&i.customer.id)||!(i!=null&&i.plan.id))throw new Error("Customer and plan are required");let{token:u}=yield e.createPaymentSession({planId:i.plan.id,billingCountryCode:o});return u}),[i,e,o]),s=hi.useCallback(()=>{try{Bd()||Ad(),n(!0);}catch(u){t("Failed to initialize Zuora");}},[n,t]);return hi.useEffect(()=>{if(a){let{billingIdentifier:u}=a;u===jsClientSdk.BillingVendorIdentifier.Zuora&&s();}},[a,s]),{isZuoraIntegration:(a==null?void 0:a.billingIdentifier)===jsClientSdk.BillingVendorIdentifier.Zuora,isInitialized:r,createPaymentSession:l}}var Sx=e=>new Promise(t=>setTimeout(t,e));function Ir({onCheckout:e,onCheckoutCompleted:t,onSuccess:o,disableSuccessAnimation:r}){let{stigg:n}=chunkIL3DC53A_cjs_js.u(),i=Br(),{checkoutState:a,setWidgetReadOnly:l,setCheckoutSuccess:s}=D(),{setErrorMessage:c}=re();return {handleZuoraSubmit:hi.useCallback(f=>chunkIL3DC53A_cjs_js.d(null,null,function*(){l(true);let y=true,p,g=i;if(!g)y=false,p="Unexpected error, please contact support.";else {let h=chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},g),{paymentMethodId:f}),P=b=>chunkIL3DC53A_cjs_js.d(null,null,function*(){try{return {success:!0,results:yield n.applySubscription(b)}}catch(x){return console.error(x),{success:false,errorMessage:(x==null?void 0:x.message)||"Failed to apply subscription"}}});try{if(e){let b=yield e({customerId:a.customer.id,checkoutParams:h,checkoutAction:P});b.errorMessage&&(p=b.errorMessage),y=y&&b.success&&!p;}else {let b=yield P(h);!b.success&&b.errorMessage&&(p=b.errorMessage),y=b.success&&!p;}}catch(b){y=false,p=b.message||"Failed to process checkout";}}return y?(s(true),o&&(o(),r||(yield Sx(Ar)))):c(p),l(false),yield t({success:y,error:p}),{success:y,errorMessage:p}}),[n,i,a,e,t,o,r,l,s,c])}}var Ie=({isLoading:e,width:t=50,height:o=16,children:r})=>e?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:t,height:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:r});var wx=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{var a,l,s,c;let{immediateInvoice:r}=e||{};if(!((l=(a=r==null?void 0:r.proration)==null?void 0:a.netAmount)!=null&&l.amount)||((c=(s=r==null?void 0:r.proration)==null?void 0:s.netAmount)==null?void 0:c.amount)>=0)return null;let n=r.proration.netAmount.amount*-1,i=H({amount:n,currency:r.proration.netAmount.currency,minimumFractionDigits:2});return jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-remaining-credits",children:jsxRuntime.jsx(Ie,{isLoading:t,width:"100%",children:o.summary.creditsForUnusedTimeText({credits:i})})})},Bx=({subscriptionPreview:e,activeSubscription:t,isFetchingSubscriptionPreview:o,checkoutLocalization:r})=>{if(!(e!=null&&e.hasScheduledUpdates)||!(t!=null&&t.currentBillingPeriodEnd))return null;let{currentBillingPeriodEnd:n}=t,i=typeof r.summary.changesWillApplyAtEndOfBillingPeriod=="function"?r.summary.changesWillApplyAtEndOfBillingPeriod({billingPeriodEnd:n}):r.summary.changesWillApplyAtEndOfBillingPeriod;return jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-scheduled-updates",children:jsxRuntime.jsx(Ie,{isLoading:o,width:"100%",children:i})})},Ax=({subscriptionPreview:e,activeSubscription:t,plan:o,isFetchingSubscriptionPreview:r,billingPeriod:n,checkoutLocalization:i})=>{let{promotionCode:a}=Ft();if(!e)return null;let l=i.nextBillingCaption({plan:o,subscriptionPreview:e,billingPeriod:n,activeSubscription:t,promotionCode:a});return jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-next-billing",children:jsxRuntime.jsx(Ie,{isLoading:r,width:"100%",children:l})})};function Ld(e){return jsxRuntime.jsxs(ke__default.default,{className:"stigg-checkout-summary-captions",children:[jsxRuntime.jsx(wx,chunkIL3DC53A_cjs_js.a({},e)),jsxRuntime.jsx(Bx,chunkIL3DC53A_cjs_js.a({},e)),e.plan&&jsxRuntime.jsx(Ax,chunkIL3DC53A_cjs_js.a({},e))]})}function Mi({quantity:e,totalAmount:t,pricingModel:o,billingPeriod:r,currency:n,blockSize:i,priceAmount:a,availableBillingPeriods:l}){let s=l==null?void 0:l.has(jsClientSdk.BillingPeriod.Monthly),c=o===jsClientSdk.BillingModel.PerUnit,u=i||1,f=r===jsClientSdk.BillingPeriod.Annually&&s,y=e&&(c||e>1)?`${chunkIL3DC53A_cjs_js.k(e)} ${u>1?"for":"x"} `:"",p=f?" x 12 months":"",g=(a||t/e)/(f?12:1),h=H({amount:g,currency:n,minimumFractionDigits:2}),P=H({amount:t,currency:n,minimumFractionDigits:2});return `${y}${h}${p} ${p||y?` = ${P}`:""}`}function Md(e){let{totalAmount:t,quantity:o,tiersMode:r,tiers:n,currency:i}=e;if(Ha(n)||r===jsClientSdk.TiersMode.Graduated&&!Wa(n,o)){let a=H({amount:t,currency:i,minimumFractionDigits:2});return `${chunkIL3DC53A_cjs_js.k(o)} for ${a}`}return Mi(e)}function Lx(e,t){let{unitPrice:o,upTo:r}=e[t];if(!o)return "";if(t===0)return `First ${r}`;let i=(e[t-1].upTo||0)+1;return Fo__default.default(r)?`${chunkIL3DC53A_cjs_js.k(i)} and above`:`Next ${chunkIL3DC53A_cjs_js.k(i)} to ${chunkIL3DC53A_cjs_js.k(r)}`}function Rd({price:e,unitQuantity:t}){let o=e.tiers||[],{checkoutState:r}=D(),n=r==null?void 0:r.plan,{breakdown:i}=bn(o,t);return i.length===1?null:jsxRuntime.jsx(jsxRuntime.Fragment,{children:i.map(({unitQuantity:a,amount:l},s)=>jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Lx(o,s)}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Mi({quantity:a,totalAmount:l,currency:e.currency,pricingModel:e.pricingModel,billingPeriod:e.billingPeriod,tiers:e.tiers,tiersMode:e.tiersMode,blockSize:e.blockSize,priceAmount:e.amount,availableBillingPeriods:new Set(n==null?void 0:n.pricePoints.map(c=>c.billingPeriod))})})]})},s))})}var Ud=chunkIL3DC53A_cjs_js.e(reactFeather.ChevronRight)`
635
635
  height: ${({$size:e=24})=>`${e}px`};
636
636
  width: ${({$size:e=24})=>`${e}px`};
637
637
  transition: all 0.2s ease-in;
638
638
  ${({$isOpen:e})=>e&&"transform: rotate(90deg)"}
639
- `;var $e=chunk2FMVMEMY_cjs_js.e.div`
639
+ `;var $e=chunkIL3DC53A_cjs_js.e.div`
640
640
  & + & {
641
641
  margin-top: 16px;
642
642
  }
643
- `,Ox=chunk2FMVMEMY_cjs_js.e.div`
643
+ `,Ox=chunkIL3DC53A_cjs_js.e.div`
644
644
  margin-top: 16px;
645
645
  margin-left: 16px;
646
- `,Fe=chunk2FMVMEMY_cjs_js.e.div`
646
+ `,Fe=chunkIL3DC53A_cjs_js.e.div`
647
647
  display: flex;
648
648
  flex-direction: column;
649
649
  gap: 16px;
@@ -653,28 +653,28 @@
653
653
  align-items: center;
654
654
  justify-content: space-between;
655
655
  }
656
- `,Hx=({checkoutLocalization:e})=>{let t=jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsxRuntime.jsx(Ze,{placement:"left",title:t,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.i,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},vr=({checkoutLocalization:e,label:t,quantity:o,price:r})=>{let{checkoutState:n}=D(),i=n==null?void 0:n.plan,a=me("lg"),[l,s]=hi.useState(false),c=()=>s(h=>!h),u=r.pricingModel===jsClientSdk.BillingModel.UsageBased,f=r.isTieredPrice?xt(r,o):(r.amount||0)*Math.ceil(o/(r.blockSize||1)),y;r.tiersMode===jsClientSdk.TiersMode.Graduated&&r.tiers&&!Xg__default.default(r.tiers)&&!Fo__default.default(r.tiers[0].upTo)&&o>r.tiers[0].upTo&&(y=jsxRuntime.jsx(Md,{price:r,unitQuantity:o}));let g=jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:t});return y&&(g=jsxRuntime.jsx(Wf__default.default,{onClick:c,underline:"none",style:{cursor:"pointer"},children:g})),jsxRuntime.jsxs($e,{className:"stigg-checkout-summary-base-charges-container",children:[jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[g,!Fo__default.default(y)&&jsxRuntime.jsx(Vx__default.default,{onClick:c,sx:{padding:0},children:jsxRuntime.jsx(Rd,{$isOpen:l,$size:16})})]}),jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[u&&jsxRuntime.jsx(Hx,{checkoutLocalization:e}),jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:a?"nowrap":"break-spaces"},children:[Nd({totalAmount:f,quantity:o,currency:r.currency,pricingModel:r.pricingModel,billingPeriod:r.billingPeriod,tiers:r.tiers,tiersMode:r.tiersMode,blockSize:r.blockSize,priceAmount:r.amount,availableBillingPeriods:new Set(i==null?void 0:i.pricePoints.map(h=>h.billingPeriod))}),u&&" / unit"]})]})]}),!Fo__default.default(y)&&jsxRuntime.jsx(QP__default.default,{in:l,children:jsxRuntime.jsx(Ox,{children:y})})]})},Ud=({label:e})=>jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-end"},children:[jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:e})}),jsxRuntime.jsx(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),_d=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r,recurringInvoice:n}=e,{discount:i,discountDetails:a}=n||{};return !i||!a?null:jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:o.summary.discountText({discountDetails:a,currency:r.total.currency})}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:t?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:50,height:16}):H({amount:i.amount,currency:i.currency,minimumFractionDigits:2})})]})})},Dd=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r}=e||{},{credits:n}=r||{};return !n||!n.used||n.used.amount<=0?null:jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:t,children:H({amount:-1*n.used.amount,currency:n.used.currency,minimumFractionDigits:2})})})]})})},$d=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:r})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:r.summary.taxTitle({taxDetails:t})}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:o,children:H({amount:e==null?void 0:e.amount,currency:e==null?void 0:e.currency,minimumFractionDigits:2})})})]})});var Di=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
656
+ `,Hx=({checkoutLocalization:e})=>{let t=jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsxRuntime.jsx(Ze,{placement:"left",title:t,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.i,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},vr=({checkoutLocalization:e,label:t,quantity:o,price:r})=>{let{checkoutState:n}=D(),i=n==null?void 0:n.plan,a=me("lg"),[l,s]=hi.useState(false),c=()=>s(h=>!h),u=r.pricingModel===jsClientSdk.BillingModel.UsageBased,f=r.isTieredPrice?xt(r,o):(r.amount||0)*Math.ceil(o/(r.blockSize||1)),y;r.tiersMode===jsClientSdk.TiersMode.Graduated&&r.tiers&&!Xg__default.default(r.tiers)&&!Fo__default.default(r.tiers[0].upTo)&&o>r.tiers[0].upTo&&(y=jsxRuntime.jsx(Rd,{price:r,unitQuantity:o}));let g=jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:t});return y&&(g=jsxRuntime.jsx(Wf__default.default,{onClick:c,underline:"none",style:{cursor:"pointer"},children:g})),jsxRuntime.jsxs($e,{className:"stigg-checkout-summary-base-charges-container",children:[jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[g,!Fo__default.default(y)&&jsxRuntime.jsx(Vx__default.default,{onClick:c,sx:{padding:0},children:jsxRuntime.jsx(Ud,{$isOpen:l,$size:16})})]}),jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[u&&jsxRuntime.jsx(Hx,{checkoutLocalization:e}),jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:a?"nowrap":"break-spaces"},children:[Md({totalAmount:f,quantity:o,currency:r.currency,pricingModel:r.pricingModel,billingPeriod:r.billingPeriod,tiers:r.tiers,tiersMode:r.tiersMode,blockSize:r.blockSize,priceAmount:r.amount,availableBillingPeriods:new Set(i==null?void 0:i.pricePoints.map(h=>h.billingPeriod))}),u&&" / unit"]})]})]}),!Fo__default.default(y)&&jsxRuntime.jsx(QP__default.default,{in:l,children:jsxRuntime.jsx(Ox,{children:y})})]})},_d=({label:e})=>jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{style:{alignItems:"flex-end"},children:[jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:e})}),jsxRuntime.jsx(Re__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),Dd=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r,recurringInvoice:n}=e,{discount:i,discountDetails:a}=n||{};return !i||!a?null:jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:o.summary.discountText({discountDetails:a,currency:r.total.currency})}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:t?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:50,height:16}):H({amount:i.amount,currency:i.currency,minimumFractionDigits:2})})]})})},$d=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:r}=e||{},{credits:n}=r||{};return !n||!n.used||n.used.amount<=0?null:jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:t,children:H({amount:-1*n.used.amount,currency:n.used.currency,minimumFractionDigits:2})})})]})})},Gd=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:r})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:r.summary.taxTitle({taxDetails:t})}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:o,children:H({amount:e==null?void 0:e.amount,currency:e==null?void 0:e.currency,minimumFractionDigits:2})})})]})});var Di=chunkIL3DC53A_cjs_js.e(ke__default.default)`
657
657
  width: 100%;
658
658
  max-width: 470px;
659
659
  flex: 1.5;
660
- `,Lr=chunk2FMVMEMY_cjs_js.e(qx__default.default)`
660
+ `,Lr=chunkIL3DC53A_cjs_js.e(qx__default.default)`
661
661
  background: ${({theme:e})=>e.stigg.palette.backgroundHighlight};
662
662
  padding: 16px;
663
663
 
664
664
  ${oe.md} {
665
665
  border-radius: 10px;
666
666
  }
667
- `;Lr.defaultProps={elevation:0};var Xx=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
667
+ `;Lr.defaultProps={elevation:0};var Xx=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
668
668
  margin-bottom: 16px;
669
669
  font-weight: 500;
670
- `,Nt=chunk2FMVMEMY_cjs_js.e(Nl__default.default)`
670
+ `,Nt=chunkIL3DC53A_cjs_js.e(Ml__default.default)`
671
671
  margin: 16px 0;
672
- `,Vd=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
672
+ `,zd=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
673
673
  margin-bottom: 8px;
674
- `;function jx({isLastStep:e,checkoutHasChanges:t,isFreeDowngrade:o,checkoutLocalization:r,isPlanUpdate:n}){return e?t?n?r.checkoutButton.updateText:o?r.checkoutButton.downgradeToFreeText:r.checkoutButton.upgradeText:r.checkoutButton.noChangesText:r.checkoutButton.nextText}var zd=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:r,isFreeDowngrade:n,onMockCheckoutPreview:i,showWatermark:a})=>{var ga,fa,ya,ha;let[l,s]=hi.useState(false),{setErrorMessage:c,useNewPaymentMethod:u}=re(),f=_e(),y=It(),{checkoutState:p,checkoutLocalization:g,checkoutSuccess:h,widgetState:P}=D(),{plan:b,activeSubscription:x}=p||{},A=xr(((ga=b==null?void 0:b.pricePoints)==null?void 0:ga.filter(G=>G.billingPeriod===y.billingPeriod))||[]),[S,F]=Zx__default.default(A,G=>G.pricingModel===jsClientSdk.BillingModel.FlatFee),T=S[0],k=n||f.isCheckoutComplete&&f.isLastStep,{isZuoraIntegration:w}=Lt(),I=l||h,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,errorMessage:N}=Ac({onMockCheckoutPreview:i}),{handleSubmit:$,isLoading:R}=kd({isMocked:!!i,disableSuccessAnimation:r,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{s(true),f.markStepAsCompleted(f.progressBarState.activeStep);}}),{handleZuoraSubmit:V}=Ir({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:r,onSuccess:()=>{f.markStepAsCompleted(f.progressBarState.activeStep);}}),K=G=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(I)return;let we;w&&!u?we=yield V():we=yield $(G);let{errorMessage:ye}=we||{};ye?(c(ye),s(false)):c(void 0);}),Oe=w&&!u?P.readOnly:R,ut=G=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){Oe||(k?yield K(G):f.goNext());}),{immediateInvoice:z,recurringInvoice:ie}=E||{},ae=!!E&&(!!(z!=null&&z.proration)||!!E.hasScheduledUpdates),Ee=!o&&!n&&!w,ho=!!(ie!=null&&ie.discountDetails)&&!n,gt=Ee||ho,da=F.some(G=>G.pricingModel===jsClientSdk.BillingModel.UsageBased),an=da&&!T&&F.every(G=>G.pricingModel===jsClientSdk.BillingModel.UsageBased),pa=typeof g.summary.baseChargeText=="function"?g.summary.baseChargeText({billingPeriod:y.billingPeriod}):g.summary.baseChargeText,ma=hi.useMemo(()=>{var G,we;return (we=(G=y.addons)==null?void 0:G.filter(ye=>!lt(ye.addon)))!=null?we:[]},[y.addons]),ua=hi.useMemo(()=>ma.filter(G=>{var ye;return !!((ye=G.addon.pricePoints)==null?void 0:ye.find(ft=>ft.billingPeriod===y.billingPeriod))}).map(G=>{let we=G.addon.pricePoints.find(ft=>ft.billingPeriod===y.billingPeriod),ye=G.quantity&&G.quantity>0?G.quantity:1;return jsxRuntime.jsx(vr,{checkoutLocalization:g,label:G.addon.displayName,quantity:ye,price:we},G.addon.id)}),[ma,y.billingPeriod,g]);return jsxRuntime.jsxs(Di,{className:"stigg-checkout-summary-container",children:[jsxRuntime.jsxs(Lr,{children:[jsxRuntime.jsx(Xx,{variant:"h3",children:g.summary.title}),jsxRuntime.jsxs(Re__default.default,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.planName({plan:b})}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),T&&jsxRuntime.jsx(vr,{checkoutLocalization:g,label:pa,quantity:1,price:T}),!T&&n?jsxRuntime.jsx(Ud,{label:pa}):null,jsxRuntime.jsx(Re__default.default,{item:true,className:"stigg-checkout-summary-usage-charges-container",children:F.map((G,we)=>{var ft,Ca,Pa,xa,ba;let ye=(ft=y.billableFeatures)==null?void 0:ft.find(bm=>{var Sa;return bm.featureId===((Sa=G.feature)==null?void 0:Sa.featureId)});return jsxRuntime.jsx(vr,{checkoutLocalization:g,label:Bt(((Pa=G.feature)==null?void 0:Pa.displayName)||"",(xa=G.feature)==null?void 0:xa.units,(ba=G.feature)==null?void 0:ba.unitsPlural),quantity:(ye==null?void 0:ye.quantity)||1,price:G},((Ca=G.feature)==null?void 0:Ca.featureId)||`usage-charge-${we}`)})}),ua.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Re__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.addonsSectionTitle}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ua]}),!gt&&jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider"}),gt&&jsxRuntime.jsxs(Re__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.discountsSectionTitle}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Ee&&jsxRuntime.jsx(Jc,{disabled:Oe||L,checkoutLocalization:g,onMockCheckoutPreview:i}),ho&&E&&jsxRuntime.jsx(_d,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),gt&&jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider"}),jsxRuntime.jsx($d,{tax:ie==null?void 0:ie.tax,taxDetails:ie==null?void 0:ie.taxDetails,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),n?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Fe,{style:{marginTop:16},children:jsxRuntime.jsxs(Re__default.default,{display:"flex",flexDirection:"column",container:true,children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",justifyContent:"space-between",children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",children:g.summary.totalText}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",children:jsxRuntime.jsxs(Ie,{isLoading:L,children:[an?g.summary.onlyPayAsYouGoText:null,!an&&da?g.summary.startsAtText:null,an?null:H(chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({amount:0},ie==null?void 0:ie.total),{minimumFractionDigits:2}))]})})]}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:g.summary.totalBillingPeriodText({billingPeriod:y.billingPeriod})})})]})}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider"})]}),(fa=z==null?void 0:z.proration)!=null&&fa.hasProrations&&(z!=null&&z.subTotal)&&(z==null?void 0:z.subTotal.amount)>0?jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:g.summary.proratedTotalDueText}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:L,children:H({amount:Number(((ya=z==null?void 0:z.subTotal)==null?void 0:ya.amount)||0)+Number(((ha=z==null?void 0:z.tax)==null?void 0:ha.amount)||0),currency:z==null?void 0:z.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsxRuntime.jsx(Dd,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(Vd,{variant:"h6",children:g.summary.totalDueText}),jsxRuntime.jsx(Vd,{variant:"h6",children:jsxRuntime.jsx(Ie,{isLoading:L,children:H(chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({amount:0},z==null?void 0:z.total),{minimumFractionDigits:2}))})})]})}),jsxRuntime.jsx(vd,{plan:b,activeSubscription:x,subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g,billingPeriod:y.billingPeriod}),(!k||!w||w&&!u)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(te,{$success:I,$error:k&&n,disabled:Oe||L||f.progressBarState.isDisabled||k&&!ae||!!N,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:G=>{ut(G);},fullWidth:true,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.i,{icon:"Check",style:{display:"contents"}}):Oe||L?jsxRuntime.jsx(Jh__default.default,{size:20,sx:{color:"white"}}):jx({isLastStep:k,checkoutHasChanges:ae,isFreeDowngrade:n,checkoutLocalization:g,isPlanUpdate:!!x&&(x==null?void 0:x.plan.id)===(b==null?void 0:b.id)})})}),N&&jsxRuntime.jsx(Jx__default.default,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{overrideColor:"inherit",children:N})})]})]}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.q,{source:"checkout",showWatermark:a,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!r&&I&&jsxRuntime.jsx(Td,{checkoutLocalization:g})]})};var Od=({showWatermark:e})=>jsxRuntime.jsxs(Di,{children:[jsxRuntime.jsxs(Lr,{children:[jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.l,{$flexDirection:"column",$gap:24,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{width:120,height:20})]}),jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.l,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{height:20}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{height:20}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{height:20})]}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.n,{flex:1,marginTop:5,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.o,{height:34})})]}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.q,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var Wd=chunk2FMVMEMY_cjs_js.e(Re__default.default)`
674
+ `;function jx({isLastStep:e,checkoutHasChanges:t,isFreeDowngrade:o,checkoutLocalization:r,isPlanUpdate:n}){return e?t?n?r.checkoutButton.updateText:o?r.checkoutButton.downgradeToFreeText:r.checkoutButton.upgradeText:r.checkoutButton.noChangesText:r.checkoutButton.nextText}var Od=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:r,isFreeDowngrade:n,onMockCheckoutPreview:i,showWatermark:a})=>{var fa,ya,ha,Ca;let[l,s]=hi.useState(false),{setErrorMessage:c,useNewPaymentMethod:u}=re(),f=_e(),y=It(),{checkoutState:p,checkoutLocalization:g,checkoutSuccess:h,widgetState:P}=D(),{plan:b,activeSubscription:x}=p||{},A=xr(((fa=b==null?void 0:b.pricePoints)==null?void 0:fa.filter(G=>G.billingPeriod===y.billingPeriod))||[]),[S,F]=Zx__default.default(A,G=>G.pricingModel===jsClientSdk.BillingModel.FlatFee),T=S[0],k=n||f.isCheckoutComplete&&f.isLastStep,{isZuoraIntegration:w}=Lt(),I=l||h,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,errorMessage:N}=Ic({onMockCheckoutPreview:i}),{handleSubmit:$,isLoading:R}=wd({isMocked:!!i,disableSuccessAnimation:r,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{s(true),f.markStepAsCompleted(f.progressBarState.activeStep);}}),{handleZuoraSubmit:V}=Ir({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:r,onSuccess:()=>{f.markStepAsCompleted(f.progressBarState.activeStep);}}),K=G=>chunkIL3DC53A_cjs_js.d(null,null,function*(){if(I)return;let we;w&&!u?we=yield V():we=yield $(G);let{errorMessage:ye}=we||{};ye?(c(ye),s(false)):c(void 0);}),Oe=w&&!u?P.readOnly:R,ut=G=>chunkIL3DC53A_cjs_js.d(null,null,function*(){Oe||(k?yield K(G):f.goNext());}),{immediateInvoice:z,recurringInvoice:ie}=E||{},ae=!!E&&(!!(z!=null&&z.proration)||!!E.hasScheduledUpdates),Ee=!o&&!n&&!w,ho=!!(ie!=null&&ie.discountDetails)&&!n,gt=Ee||ho,pa=F.some(G=>G.pricingModel===jsClientSdk.BillingModel.UsageBased),an=pa&&!T&&F.every(G=>G.pricingModel===jsClientSdk.BillingModel.UsageBased),ma=typeof g.summary.baseChargeText=="function"?g.summary.baseChargeText({billingPeriod:y.billingPeriod}):g.summary.baseChargeText,ua=hi.useMemo(()=>{var G,we;return (we=(G=y.addons)==null?void 0:G.filter(ye=>!lt(ye.addon)))!=null?we:[]},[y.addons]),ga=hi.useMemo(()=>ua.filter(G=>{var ye;return !!((ye=G.addon.pricePoints)==null?void 0:ye.find(ft=>ft.billingPeriod===y.billingPeriod))}).map(G=>{let we=G.addon.pricePoints.find(ft=>ft.billingPeriod===y.billingPeriod),ye=G.quantity&&G.quantity>0?G.quantity:1;return jsxRuntime.jsx(vr,{checkoutLocalization:g,label:G.addon.displayName,quantity:ye,price:we},G.addon.id)}),[ua,y.billingPeriod,g]);return jsxRuntime.jsxs(Di,{className:"stigg-checkout-summary-container",children:[jsxRuntime.jsxs(Lr,{children:[jsxRuntime.jsx(Xx,{variant:"h3",children:g.summary.title}),jsxRuntime.jsxs(Re__default.default,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.planName({plan:b})}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),T&&jsxRuntime.jsx(vr,{checkoutLocalization:g,label:ma,quantity:1,price:T}),!T&&n?jsxRuntime.jsx(_d,{label:ma}):null,jsxRuntime.jsx(Re__default.default,{item:true,className:"stigg-checkout-summary-usage-charges-container",children:F.map((G,we)=>{var ft,Pa,xa,ba,Sa;let ye=(ft=y.billableFeatures)==null?void 0:ft.find(bm=>{var Ta;return bm.featureId===((Ta=G.feature)==null?void 0:Ta.featureId)});return jsxRuntime.jsx(vr,{checkoutLocalization:g,label:Bt(((xa=G.feature)==null?void 0:xa.displayName)||"",(ba=G.feature)==null?void 0:ba.units,(Sa=G.feature)==null?void 0:Sa.unitsPlural),quantity:(ye==null?void 0:ye.quantity)||1,price:G},((Pa=G.feature)==null?void 0:Pa.featureId)||`usage-charge-${we}`)})}),ga.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Re__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.addonsSectionTitle}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ga]}),!gt&&jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider"}),gt&&jsxRuntime.jsxs(Re__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:g.summary.discountsSectionTitle}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Ee&&jsxRuntime.jsx(Xc,{disabled:Oe||L,checkoutLocalization:g,onMockCheckoutPreview:i}),ho&&E&&jsxRuntime.jsx(Dd,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),gt&&jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider"}),jsxRuntime.jsx(Gd,{tax:ie==null?void 0:ie.tax,taxDetails:ie==null?void 0:ie.taxDetails,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),n?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Fe,{style:{marginTop:16},children:jsxRuntime.jsxs(Re__default.default,{display:"flex",flexDirection:"column",container:true,children:[jsxRuntime.jsxs(Re__default.default,{item:true,display:"flex",justifyContent:"space-between",children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",children:g.summary.totalText}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",children:jsxRuntime.jsxs(Ie,{isLoading:L,children:[an?g.summary.onlyPayAsYouGoText:null,!an&&pa?g.summary.startsAtText:null,an?null:H(chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({amount:0},ie==null?void 0:ie.total),{minimumFractionDigits:2}))]})})]}),jsxRuntime.jsx(Re__default.default,{item:true,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:g.summary.totalBillingPeriodText({billingPeriod:y.billingPeriod})})})]})}),jsxRuntime.jsx(Nt,{className:"stigg-checkout-summary-divider"})]}),(ya=z==null?void 0:z.proration)!=null&&ya.hasProrations&&(z!=null&&z.subTotal)&&(z==null?void 0:z.subTotal.amount)>0?jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:g.summary.proratedTotalDueText}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(Ie,{isLoading:L,children:H({amount:Number(((ha=z==null?void 0:z.subTotal)==null?void 0:ha.amount)||0)+Number(((Ca=z==null?void 0:z.tax)==null?void 0:Ca.amount)||0),currency:z==null?void 0:z.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsxRuntime.jsx($d,{subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g}),jsxRuntime.jsx($e,{children:jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(zd,{variant:"h6",children:g.summary.totalDueText}),jsxRuntime.jsx(zd,{variant:"h6",children:jsxRuntime.jsx(Ie,{isLoading:L,children:H(chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({amount:0},z==null?void 0:z.total),{minimumFractionDigits:2}))})})]})}),jsxRuntime.jsx(Ld,{plan:b,activeSubscription:x,subscriptionPreview:E,isFetchingSubscriptionPreview:L,checkoutLocalization:g,billingPeriod:y.billingPeriod}),(!k||!w||w&&!u)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(te,{$success:I,$error:k&&n,disabled:Oe||L||f.progressBarState.isDisabled||k&&!ae||!!N,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:G=>{ut(G);},fullWidth:true,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.i,{icon:"Check",style:{display:"contents"}}):Oe||L?jsxRuntime.jsx(Jh__default.default,{size:20,sx:{color:"white"}}):jx({isLastStep:k,checkoutHasChanges:ae,isFreeDowngrade:n,checkoutLocalization:g,isPlanUpdate:!!x&&(x==null?void 0:x.plan.id)===(b==null?void 0:b.id)})})}),N&&jsxRuntime.jsx(Jx__default.default,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{overrideColor:"inherit",children:N})})]})]}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.q,{source:"checkout",showWatermark:a,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!r&&I&&jsxRuntime.jsx(kd,{checkoutLocalization:g})]})};var Hd=({showWatermark:e})=>jsxRuntime.jsxs(Di,{children:[jsxRuntime.jsxs(Lr,{children:[jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.l,{$flexDirection:"column",$gap:24,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:120,height:20}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{width:120,height:20})]}),jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.l,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{height:20}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{height:20}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{height:20})]}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.n,{flex:1,marginTop:5,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.o,{height:34})})]}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.q,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var Zd=chunkIL3DC53A_cjs_js.e(Re__default.default)`
675
675
  width: 100%;
676
676
  gap: 8px;
677
- `,Zd=chunk2FMVMEMY_cjs_js.e(Re__default.default)`
677
+ `,Yd=chunkIL3DC53A_cjs_js.e(Re__default.default)`
678
678
  display: flex;
679
679
  flex-direction: column;
680
680
  gap: 16px;
@@ -689,7 +689,7 @@
689
689
  padding-top: 16px;
690
690
  padding-bottom: 16px;
691
691
  }
692
- `,Yd=chunk2FMVMEMY_cjs_js.e(te)`
692
+ `,Qd=chunkIL3DC53A_cjs_js.e(te)`
693
693
  min-width: unset;
694
694
  width: 41px;
695
695
  height: 41px;
@@ -700,40 +700,40 @@
700
700
  align-items: center;
701
701
  width: 100%;
702
702
  justify-content: flex-end;
703
- `;function qd({addon:e,addonState:t,hasChanges:o,errorMessage:r,isPriceForBillingPeriodAvailable:n,checkoutLocalization:i,handleQuantityChange:a,handleUndo:l,handleRemoveAddon:s}){var y;let c=me("lg"),u=!!t,f=e.maxQuantity!==1;return jsxRuntime.jsxs(tb,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsxRuntime.jsx(te,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:l,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:"primary.main",variant:"body1",children:"Undo"})}),u&&jsxRuntime.jsxs(Re__default.default,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[f&&jsxRuntime.jsx(pe,{id:`${e.id}-input`,type:"number",onWheel:bt,sx:c?{marginX:2,width:"100%"}:{flex:1},value:(y=t==null?void 0:t.quantity)!=null?y:"",error:!!r,helperText:r,FormHelperTextProps:{sx:{margin:"4px"}},onChange:p=>{var g,h;return a((g=p==null?void 0:p.target)!=null&&g.value?Number((h=p==null?void 0:p.target)==null?void 0:h.value):null)},onFocus:p=>p.target.select()}),jsxRuntime.jsx(Yd,{color:"error",onClick:s,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.i,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!u&&jsxRuntime.jsx(te,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!n,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{color:n?"primary.main":"disabled",variant:"body1",children:i.addAddonText})})]})}var nb=chunk2FMVMEMY_cjs_js.e(Re__default.default)`
703
+ `;function Jd({addon:e,addonState:t,hasChanges:o,errorMessage:r,isPriceForBillingPeriodAvailable:n,checkoutLocalization:i,handleQuantityChange:a,handleUndo:l,handleRemoveAddon:s}){var y;let c=me("lg"),u=!!t,f=e.maxQuantity!==1;return jsxRuntime.jsxs(tb,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsxRuntime.jsx(te,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:l,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:"primary.main",variant:"body1",children:"Undo"})}),u&&jsxRuntime.jsxs(Re__default.default,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[f&&jsxRuntime.jsx(pe,{id:`${e.id}-input`,type:"number",onWheel:bt,sx:c?{marginX:2,width:"100%"}:{flex:1},value:(y=t==null?void 0:t.quantity)!=null?y:"",error:!!r,helperText:r,FormHelperTextProps:{sx:{margin:"4px"}},onChange:p=>{var g,h;return a((g=p==null?void 0:p.target)!=null&&g.value?Number((h=p==null?void 0:p.target)==null?void 0:h.value):null)},onFocus:p=>p.target.select()}),jsxRuntime.jsx(Qd,{color:"error",onClick:s,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.i,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!u&&jsxRuntime.jsx(te,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!n,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{color:n?"primary.main":"disabled",variant:"body1",children:i.addAddonText})})]})}var nb=chunkIL3DC53A_cjs_js.e(Re__default.default)`
704
704
  display: flex;
705
705
  flex-direction: column;
706
706
  justify-content: center;
707
707
  width: 100%;
708
708
  height: 42px;
709
- `;function Jd({addon:e,billingPeriod:t,checkoutLocalization:o}){let r=e.pricePoints.find(n=>n.billingPeriod===t);return jsxRuntime.jsxs(nb,{item:true,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",lineHeight:"24px",children:e.displayName}),r?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${H({amount:r.amount,currency:r.currency,minimumFractionDigits:2})}/${t===jsClientSdk.BillingPeriod.Annually?"year":"month"}`}):jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function sb({addon:e,billingPeriod:t,addonState:o,initialAddonState:r,setAddon:n,removeAddon:i,checkoutLocalization:a,onAddonsValidationChange:l,onAddonChange:s}){let[c,u]=hi.useState(void 0),f=!!o&&!!r&&o.quantity!==r.quantity||!!r&&!o,y=e.pricePoints.some(P=>P.billingPeriod===t),p=P=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(!P||P<=0){l({addonId:e.id,isValid:false}),u("Minimum 1"),n(e,P!=null?P:null);return}let b=yield s==null?void 0:s({addon:e,quantity:P});u(b==null?void 0:b.errorMessage),l({addonId:e.id,isValid:!(b!=null&&b.disableNextStep)}),n(e,P);}),g=()=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){yield s==null?void 0:s({addon:e,quantity:0}),i(e.id),l({addonId:e.id,isValid:true});});return jsxRuntime.jsxs(Zd,{children:[jsxRuntime.jsx(Jd,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsxRuntime.jsx(qd,{addon:e,addonState:o,hasChanges:f,handleUndo:()=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(r){let P=yield s==null?void 0:s({addon:e,quantity:r.quantity});l({addonId:e.id,isValid:!(P!=null&&P.disableNextStep)}),n(e,r.quantity);}else yield g();l({addonId:e.id,isValid:true});}),errorMessage:c,handleQuantityChange:p,isPriceForBillingPeriodAvailable:y,checkoutLocalization:a,handleRemoveAddon:g})]})}function jd({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=D(),{billingPeriod:r}=be(),{setIsDisabled:n}=_e(),{initialAddons:i,addons:a,availableAddons:l,setAddon:s,removeAddon:c}=uc(),[u,f]=hi.useState((l==null?void 0:l.reduce((y,p)=>(y[p.id]=true,y),{}))||{});return hi.useEffect(()=>{let y=Object.values(u).some(p=>!p);n(y),o(!y);},[u,n,o]),jsxRuntime.jsx(Wd,{container:true,children:l==null?void 0:l.map(y=>{let p=a.find(h=>h.addon.id===y.id),g=i==null?void 0:i.find(h=>h.addon.id===y.id);return jsxRuntime.jsx(sb,{addon:y,billingPeriod:r,addonState:p,initialAddonState:g,setAddon:s,removeAddon:c,checkoutLocalization:t,onAddonsValidationChange:({addonId:h,isValid:P})=>f(chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},u),{[h]:P})),onAddonChange:e},y.id)})})}var Vi=chunk2FMVMEMY_cjs_js.e(Re__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
709
+ `;function Xd({addon:e,billingPeriod:t,checkoutLocalization:o}){let r=e.pricePoints.find(n=>n.billingPeriod===t);return jsxRuntime.jsxs(nb,{item:true,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",lineHeight:"24px",children:e.displayName}),r?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${H({amount:r.amount,currency:r.currency,minimumFractionDigits:2})}/${t===jsClientSdk.BillingPeriod.Annually?"year":"month"}`}):jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function sb({addon:e,billingPeriod:t,addonState:o,initialAddonState:r,setAddon:n,removeAddon:i,checkoutLocalization:a,onAddonsValidationChange:l,onAddonChange:s}){let[c,u]=hi.useState(void 0),f=!!o&&!!r&&o.quantity!==r.quantity||!!r&&!o,y=e.pricePoints.some(P=>P.billingPeriod===t),p=P=>chunkIL3DC53A_cjs_js.d(null,null,function*(){if(!P||P<=0){l({addonId:e.id,isValid:false}),u("Minimum 1"),n(e,P!=null?P:null);return}let b=yield s==null?void 0:s({addon:e,quantity:P});u(b==null?void 0:b.errorMessage),l({addonId:e.id,isValid:!(b!=null&&b.disableNextStep)}),n(e,P);}),g=()=>chunkIL3DC53A_cjs_js.d(null,null,function*(){yield s==null?void 0:s({addon:e,quantity:0}),i(e.id),l({addonId:e.id,isValid:true});});return jsxRuntime.jsxs(Yd,{children:[jsxRuntime.jsx(Xd,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsxRuntime.jsx(Jd,{addon:e,addonState:o,hasChanges:f,handleUndo:()=>chunkIL3DC53A_cjs_js.d(null,null,function*(){if(r){let P=yield s==null?void 0:s({addon:e,quantity:r.quantity});l({addonId:e.id,isValid:!(P!=null&&P.disableNextStep)}),n(e,r.quantity);}else yield g();l({addonId:e.id,isValid:true});}),errorMessage:c,handleQuantityChange:p,isPriceForBillingPeriodAvailable:y,checkoutLocalization:a,handleRemoveAddon:g})]})}function ep({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=D(),{billingPeriod:r}=be(),{setIsDisabled:n}=_e(),{initialAddons:i,addons:a,availableAddons:l,setAddon:s,removeAddon:c}=gc(),[u,f]=hi.useState((l==null?void 0:l.reduce((y,p)=>(y[p.id]=true,y),{}))||{});return hi.useEffect(()=>{let y=Object.values(u).some(p=>!p);n(y),o(!y);},[u,n,o]),jsxRuntime.jsx(Zd,{container:true,children:l==null?void 0:l.map(y=>{let p=a.find(h=>h.addon.id===y.id),g=i==null?void 0:i.find(h=>h.addon.id===y.id);return jsxRuntime.jsx(sb,{addon:y,billingPeriod:r,addonState:p,initialAddonState:g,setAddon:s,removeAddon:c,checkoutLocalization:t,onAddonsValidationChange:({addonId:h,isValid:P})=>f(chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},u),{[h]:P})),onAddonChange:e},y.id)})})}var Vi=chunkIL3DC53A_cjs_js.e(Re__default.default,{shouldForwardProp:e=>!e.startsWith("$")})`
710
710
  padding: 8px;
711
711
  border-radius: 10px;
712
712
  border: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
713
713
  cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
714
714
  opacity: ${({$disabled:e})=>e?.6:1};
715
- `,ep=chunk2FMVMEMY_cjs_js.e(Vi)`
715
+ `,tp=chunkIL3DC53A_cjs_js.e(Vi)`
716
716
  flex-direction: column;
717
717
  align-items: unset;
718
718
  ${({$hideBorders:e})=>e&&react.css`
719
719
  border: none;
720
720
  padding: 0;
721
721
  `}
722
- `,tp=chunk2FMVMEMY_cjs_js.e(Re__default.default)`
722
+ `,op=chunkIL3DC53A_cjs_js.e(Re__default.default)`
723
723
  display: flex;
724
724
  align-items: center;
725
725
  flex: 1;
726
726
  gap: 12px;
727
- `,op=chunk2FMVMEMY_cjs_js.e(Re__default.default)`
727
+ `,rp=chunkIL3DC53A_cjs_js.e(Re__default.default)`
728
728
  display: flex;
729
729
  flex-direction: column;
730
- `;var yb=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
730
+ `;var yb=chunkIL3DC53A_cjs_js.e(ke__default.default)`
731
731
  position: relative;
732
732
  max-width: 500px;
733
- `,hb=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
733
+ `,hb=chunkIL3DC53A_cjs_js.e(ke__default.default)`
734
734
  opacity: ${({$showLoading:e})=>e?.6:1};
735
735
  pointer-events: ${({$showLoading:e})=>e?"none":"auto"};
736
- `,Cb=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
736
+ `,Cb=chunkIL3DC53A_cjs_js.e(ke__default.default)`
737
737
  position: absolute;
738
738
  top: 40px;
739
739
  left: 0;
@@ -745,18 +745,18 @@
745
745
  justify-content: center;
746
746
  border-radius: 4px;
747
747
  z-index: 10;
748
- `,Pb=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
748
+ `,Pb=chunkIL3DC53A_cjs_js.e(ke__default.default)`
749
749
  display: flex;
750
750
  flex-direction: column;
751
751
  align-items: center;
752
752
  gap: 12px;
753
- `;function rp({onCheckout:e,onCheckoutCompleted:t}){var P,b,x;let{isZuoraIntegration:o,isInitialized:r,createPaymentSession:n}=Lt(),{setErrorMessage:i}=re(),{billingCountryCode:a}=be(),{checkoutState:l,widgetState:s}=D(),{handleZuoraSubmit:c}=Ir({onCheckout:e,onCheckoutCompleted:t}),u=hi.useRef(false),[f,y]=hi__default.default.useState(false),p=((x=(b=(P=l==null?void 0:l.plan)==null?void 0:P.pricePoints)==null?void 0:b[0])==null?void 0:x.currency)||jsClientSdk.Currency.Usd,{publishableKey:g}=l==null?void 0:l.billingIntegration.billingCredentials,h=hi.useCallback(A=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){var S;if(!A.success||!A.paymentMethodId){let F=((S=A.error)==null?void 0:S.message)||"Payment failed";i(F),yield t({success:false,error:F});return}yield c(A.paymentMethodId);}),[c,i,t]);return hi.useEffect(()=>(chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(!(!r||u.current)){y(true),i(void 0);try{u.current=!0;let S=window.Zuora(g),F=Ad(n,h,p,a);(yield S.createPaymentForm(F)).mount("#zuora_payment");}catch(S){u.current=false,i("Failed to render Zuora payment form");}finally{y(false);}}}),()=>{u.current=false;}),[r]),o?jsxRuntime.jsxs(yb,{children:[jsxRuntime.jsx(hb,{id:"zuora_payment",$showLoading:s.readOnly||f}),(s.readOnly||f)&&jsxRuntime.jsx(Cb,{children:jsxRuntime.jsx(Pb,{children:jsxRuntime.jsx(Jh__default.default,{size:28})})})]}):null}function ip({checked:e,text:t,subtitle:o,readOnly:r}){return jsxRuntime.jsxs(tp,{children:[jsxRuntime.jsx(Sb__default.default,{checked:e,disabled:r}),jsxRuntime.jsxs(op,{container:true,children:[jsxRuntime.jsx(Re__default.default,{item:true,children:t}),!Fo__default.default(o)&&jsxRuntime.jsx(Re__default.default,{item:true,children:o})]})]})}function ap({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:r}){if(!t)return null;let{last4Digits:n,expirationMonth:i,expirationYear:a}=t;return jsxRuntime.jsx(Vi,{item:true,onClick:r,$disabled:o,children:jsxRuntime.jsx(ip,{checked:e,readOnly:o,text:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",children:`Card ending in ${n}`}),subtitle:!!i&&!!a&&jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",children:`Expires ${i.toString().padStart(2,"0")}/${a}`})})})}function sp({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:r,checkoutLocalization:n,onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l,onCheckout:s,onCheckoutCompleted:c}){let{isZuoraIntegration:u}=Lt();return jsxRuntime.jsxs(ep,{item:true,$hideBorders:!e,onClick:o,$disabled:r,children:[e&&jsxRuntime.jsx(ip,{checked:t,readOnly:r,text:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",children:n.newPaymentMethodText})}),jsxRuntime.jsx(QP__default.default,{in:t,children:u?jsxRuntime.jsx(rp,{onCheckout:s,onCheckoutCompleted:c}):jsxRuntime.jsx(Cd,{onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l})})]})}var Bb=chunk2FMVMEMY_cjs_js.e(Re__default.default)`
753
+ `;function np({onCheckout:e,onCheckoutCompleted:t}){var P,b,x;let{isZuoraIntegration:o,isInitialized:r,createPaymentSession:n}=Lt(),{setErrorMessage:i}=re(),{billingCountryCode:a}=be(),{checkoutState:l,widgetState:s}=D(),{handleZuoraSubmit:c}=Ir({onCheckout:e,onCheckoutCompleted:t}),u=hi.useRef(false),[f,y]=hi__default.default.useState(false),p=((x=(b=(P=l==null?void 0:l.plan)==null?void 0:P.pricePoints)==null?void 0:b[0])==null?void 0:x.currency)||jsClientSdk.Currency.Usd,{publishableKey:g}=l==null?void 0:l.billingIntegration.billingCredentials,h=hi.useCallback(A=>chunkIL3DC53A_cjs_js.d(null,null,function*(){var S;if(!A.success||!A.paymentMethodId){let F=((S=A.error)==null?void 0:S.message)||"Payment failed";i(F),yield t({success:false,error:F});return}yield c(A.paymentMethodId);}),[c,i,t]);return hi.useEffect(()=>(chunkIL3DC53A_cjs_js.d(null,null,function*(){if(!(!r||u.current)){y(true),i(void 0);try{u.current=!0;let S=window.Zuora(g),F=Id(n,h,p,a);(yield S.createPaymentForm(F)).mount("#zuora_payment");}catch(S){u.current=false,i("Failed to render Zuora payment form");}finally{y(false);}}}),()=>{u.current=false;}),[r]),o?jsxRuntime.jsxs(yb,{children:[jsxRuntime.jsx(hb,{id:"zuora_payment",$showLoading:s.readOnly||f}),(s.readOnly||f)&&jsxRuntime.jsx(Cb,{children:jsxRuntime.jsx(Pb,{children:jsxRuntime.jsx(Jh__default.default,{size:28})})})]}):null}function ap({checked:e,text:t,subtitle:o,readOnly:r}){return jsxRuntime.jsxs(op,{children:[jsxRuntime.jsx(Sb__default.default,{checked:e,disabled:r}),jsxRuntime.jsxs(rp,{container:true,children:[jsxRuntime.jsx(Re__default.default,{item:true,children:t}),!Fo__default.default(o)&&jsxRuntime.jsx(Re__default.default,{item:true,children:o})]})]})}function sp({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:r}){if(!t)return null;let{last4Digits:n,expirationMonth:i,expirationYear:a}=t;return jsxRuntime.jsx(Vi,{item:true,onClick:r,$disabled:o,children:jsxRuntime.jsx(ap,{checked:e,readOnly:o,text:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",children:`Card ending in ${n}`}),subtitle:!!i&&!!a&&jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",children:`Expires ${i.toString().padStart(2,"0")}/${a}`})})})}function lp({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:r,checkoutLocalization:n,onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l,onCheckout:s,onCheckoutCompleted:c}){let{isZuoraIntegration:u}=Lt();return jsxRuntime.jsxs(tp,{item:true,$hideBorders:!e,onClick:o,$disabled:r,children:[e&&jsxRuntime.jsx(ap,{checked:t,readOnly:r,text:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",children:n.newPaymentMethodText})}),jsxRuntime.jsx(QP__default.default,{in:t,children:u?jsxRuntime.jsx(np,{onCheckout:s,onCheckoutCompleted:c}):jsxRuntime.jsx(Pd,{onBillingAddressChange:i,collectPhoneNumber:a,collectTaxId:l})})]})}var Bb=chunkIL3DC53A_cjs_js.e(Re__default.default)`
754
754
  display: flex;
755
755
  flex-direction: column;
756
756
  gap: 24px;
757
- `;function lp({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:r,onCheckoutCompleted:n}){let{checkoutState:i,checkoutLocalization:a,widgetState:l}=D(),{customer:s}=i||{},{errorMessage:c,useNewPaymentMethod:u,setUseNewPaymentMethod:f}=re(),{readOnly:y}=l,p=g=>{y||f(g);};return jsxRuntime.jsxs(Bb,{container:true,children:[!!c&&jsxRuntime.jsx(Jx__default.default,{severity:"error",sx:{alignItems:"center"},children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{overrideColor:"inherit",children:c})}),jsxRuntime.jsx(ap,{readOnly:y,checked:!u,paymentMethodDetails:s==null?void 0:s.paymentMethodDetails,onSelect:()=>p(false)}),jsxRuntime.jsx(sp,{hasExistingPaymentMethod:!!(s!=null&&s.paymentMethodDetails),readOnly:y,checked:u,checkoutLocalization:a,onSelect:()=>p(true),onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:r,onCheckoutCompleted:n})]})}var Dr=({onClick:e,checkoutLocalization:t,size:o})=>jsxRuntime.jsx(Pu__default.default,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:o,onClick:e,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"},children:t.changePlan})});function pp({allowChangePlan:e=false,onChangePlan:t}){let{checkoutState:o,checkoutLocalization:r}=D(),{plan:n}=o||{};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(ke__default.default,{sx:{marginBottom:"16px"},children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"},children:"Selected plan"}),jsxRuntime.jsxs(ke__default.default,{sx:{display:"flex",justifyContent:"space-between"},children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h1",children:n==null?void 0:n.displayName}),e&&t&&jsxRuntime.jsx(Dr,{onClick:()=>{t({currentPlan:n});},checkoutLocalization:r,size:"medium"})]})]}),jsxRuntime.jsx(Nl__default.default,{className:"stigg-checkout-plan-header-divider"})]})}function Hi(e){switch(e){case jsClientSdk.BillingPeriod.Annually:return "Annual";case jsClientSdk.BillingPeriod.Monthly:return "Monthly";default:return ""}}var gp=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
757
+ `;function cp({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:r,onCheckoutCompleted:n}){let{checkoutState:i,checkoutLocalization:a,widgetState:l}=D(),{customer:s}=i||{},{errorMessage:c,useNewPaymentMethod:u,setUseNewPaymentMethod:f}=re(),{readOnly:y}=l,p=g=>{y||f(g);};return jsxRuntime.jsxs(Bb,{container:true,children:[!!c&&jsxRuntime.jsx(Jx__default.default,{severity:"error",sx:{alignItems:"center"},children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{overrideColor:"inherit",children:c})}),jsxRuntime.jsx(sp,{readOnly:y,checked:!u,paymentMethodDetails:s==null?void 0:s.paymentMethodDetails,onSelect:()=>p(false)}),jsxRuntime.jsx(lp,{hasExistingPaymentMethod:!!(s!=null&&s.paymentMethodDetails),readOnly:y,checked:u,checkoutLocalization:a,onSelect:()=>p(true),onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:r,onCheckoutCompleted:n})]})}var Dr=({onClick:e,checkoutLocalization:t,size:o})=>jsxRuntime.jsx(Pu__default.default,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:o,onClick:e,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"},children:t.changePlan})});function mp({allowChangePlan:e=false,onChangePlan:t}){let{checkoutState:o,checkoutLocalization:r}=D(),{plan:n}=o||{};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(ke__default.default,{sx:{marginBottom:"16px"},children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"},children:"Selected plan"}),jsxRuntime.jsxs(ke__default.default,{sx:{display:"flex",justifyContent:"space-between"},children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h1",children:n==null?void 0:n.displayName}),e&&t&&jsxRuntime.jsx(Dr,{onClick:()=>{t({currentPlan:n});},checkoutLocalization:r,size:"medium"})]})]}),jsxRuntime.jsx(Ml__default.default,{className:"stigg-checkout-plan-header-divider"})]})}function Hi(e){switch(e){case jsClientSdk.BillingPeriod.Annually:return "Annual";case jsClientSdk.BillingPeriod.Monthly:return "Monthly";default:return ""}}var fp=chunkIL3DC53A_cjs_js.e(ke__default.default)`
758
758
  margin: 16px 0;
759
- `,fp=chunk2FMVMEMY_cjs_js.e.button`
759
+ `,yp=chunkIL3DC53A_cjs_js.e.button`
760
760
  cursor: ${({$disabled:e,$isOnlyBillingPeriod:t})=>e||t?"default":"pointer"};
761
761
  flex: 1;
762
762
  display: flex;
@@ -776,19 +776,19 @@
776
776
  background: none;
777
777
  }
778
778
  }
779
- `,yp=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
779
+ `,hp=chunkIL3DC53A_cjs_js.e(ke__default.default)`
780
780
  display: flex;
781
781
  gap: 16px;
782
782
  margin-top: 16px;
783
- `;chunk2FMVMEMY_cjs_js.e.div`
783
+ `;chunkIL3DC53A_cjs_js.e.div`
784
784
  display: flex;
785
785
  align-items: baseline;
786
786
  gap: 8px;
787
- `;chunk2FMVMEMY_cjs_js.e(vb__default.default)`
787
+ `;chunkIL3DC53A_cjs_js.e(vb__default.default)`
788
788
  & .MuiChip-label {
789
789
  font-size: 12px;
790
790
  }
791
- `;var hp=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:r}=be(),n=o===e;return jsxRuntime.jsxs(fp,{onClick:()=>r(e),$isActive:n,$isOnlyBillingPeriod:t,children:[jsxRuntime.jsx(Sb__default.default,{checked:n,onChange:()=>r(e),value:e,disabled:t,inputProps:{"aria-label":Hi(e)},sx:{padding:0,marginRight:"8px"}}),jsxRuntime.jsx(ke__default.default,{children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h3",color:"primary",children:Hi(e)})})]})};function Cp({plan:e,checkoutLocalization:t}){let[o,r]=Zx__default.default(e==null?void 0:e.pricePoints,i=>i.billingPeriod===jsClientSdk.BillingPeriod.Monthly),n=!!(o!=null&&o.length)&&!!(r!=null&&r.length);return n?jsxRuntime.jsxs(gp,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"primary",children:t.billingPeriodsTitle}),jsxRuntime.jsxs(yp,{children:[!!(o!=null&&o.length)&&jsxRuntime.jsx(hp,{billingPeriod:jsClientSdk.BillingPeriod.Monthly,isOnlyBillingPeriod:!n},jsClientSdk.BillingPeriod.Monthly),!!(r!=null&&r.length)&&jsxRuntime.jsx(hp,{billingPeriod:jsClientSdk.BillingPeriod.Annually,isOnlyBillingPeriod:!n},jsClientSdk.BillingPeriod.Annually)]})]}):null}var $b=chunk2FMVMEMY_cjs_js.e.div`
791
+ `;var Cp=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:r}=be(),n=o===e;return jsxRuntime.jsxs(yp,{onClick:()=>r(e),$isActive:n,$isOnlyBillingPeriod:t,children:[jsxRuntime.jsx(Sb__default.default,{checked:n,onChange:()=>r(e),value:e,disabled:t,inputProps:{"aria-label":Hi(e)},sx:{padding:0,marginRight:"8px"}}),jsxRuntime.jsx(ke__default.default,{children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h3",color:"primary",children:Hi(e)})})]})};function Pp({plan:e,checkoutLocalization:t}){let[o,r]=Zx__default.default(e==null?void 0:e.pricePoints,i=>i.billingPeriod===jsClientSdk.BillingPeriod.Monthly),n=!!(o!=null&&o.length)&&!!(r!=null&&r.length);return n?jsxRuntime.jsxs(fp,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"primary",children:t.billingPeriodsTitle}),jsxRuntime.jsxs(hp,{children:[!!(o!=null&&o.length)&&jsxRuntime.jsx(Cp,{billingPeriod:jsClientSdk.BillingPeriod.Monthly,isOnlyBillingPeriod:!n},jsClientSdk.BillingPeriod.Monthly),!!(r!=null&&r.length)&&jsxRuntime.jsx(Cp,{billingPeriod:jsClientSdk.BillingPeriod.Annually,isOnlyBillingPeriod:!n},jsClientSdk.BillingPeriod.Annually)]})]}):null}var $b=chunkIL3DC53A_cjs_js.e.div`
792
792
  display: flex;
793
793
  min-height: 60px;
794
794
  margin-top: 16px;
@@ -799,39 +799,39 @@
799
799
  align-items: flex-start;
800
800
  justify-content: space-between;
801
801
  }
802
- `,Gb=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
802
+ `,Gb=chunkIL3DC53A_cjs_js.e(ke__default.default)`
803
803
  display: flex;
804
804
  flex-direction: column;
805
805
  justify-content: center;
806
806
  width: 100%;
807
807
  height: 42px;
808
- `,Vb=chunk2FMVMEMY_cjs_js.e(chunk2FMVMEMY_cjs_js.f)`
808
+ `,Vb=chunkIL3DC53A_cjs_js.e(chunkIL3DC53A_cjs_js.f)`
809
809
  display: flex;
810
810
  align-items: center;
811
811
  justify-content: flex-end;
812
812
  width: 100%;
813
813
  min-height: 42px;
814
- `,zb=(e,t)=>{let{minUnitQuantity:o,maxUnitQuantity:r}=e;return !t||t<(o||1)?`Minimum ${o||1}`:r&&t>r?`Maximum ${r}`:""};function Ob({charge:e,setBillableFeature:t,billableFeature:o,onValidationChange:r,onBillableFeatureChange:n}){var g,h,P,b,x,A;let[i,a]=hi.useState(void 0),l=(g=e.feature)==null?void 0:g.featureId,s=!l,c=e.pricingModel===jsClientSdk.BillingModel.UsageBased,u=s?"Base charge":Bt(((h=e.feature)==null?void 0:h.displayName)||"",(P=e.feature)==null?void 0:P.units,(b=e.feature)==null?void 0:b.unitsPlural),f=!!(e!=null&&e.minUnitQuantity||e!=null&&e.maxUnitQuantity),y=S=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){var E,L;if(s||!l)return;let{minUnitQuantity:F,maxUnitQuantity:T}=e,k=(E=S==null?void 0:S.target)!=null&&E.value?Number((L=S==null?void 0:S.target)==null?void 0:L.value):null;if(!k||k<=0||F&&k<F||T&&k>T){r({featureId:l,isValid:false}),a(zb(e,k!=null?k:void 0)),t(l,k!=null?k:null);return}let w=yr(e,k),I=yield n==null?void 0:n({feature:e.feature,quantity:w});a(I==null?void 0:I.errorMessage),r({featureId:l,isValid:!(I!=null&&I.disableNextStep)}),t(l,w);}),p;if(s||c)p=`${H({amount:e.amount,currency:e.currency,locale:"en-us",minimumFractionDigits:2})}`,c&&(p+=" / unit");else if(e.isTieredPrice&&e.tiersMode&&l){let S=(o==null?void 0:o.quantity)||1;p=jsxRuntime.jsx(Kt,{componentId:`${l}-tiers`,tiers:e.tiers,tiersMode:e.tiersMode,value:S,errorMessage:i,handleChange:F=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){let T=yield n==null?void 0:n({feature:e.feature,quantity:F});a(T==null?void 0:T.errorMessage),r({featureId:l,isValid:!(T!=null&&T.disableNextStep)}),t(l,F);}),width:"100%"});}else p=jsxRuntime.jsx(pe,{sx:{width:"100%"},id:`${l}-input`,type:"number",onWheel:bt,error:!!i,helperText:i,FormHelperTextProps:{sx:{margin:"4px"}},value:(x=o==null?void 0:o.quantity)!=null?x:"",onChange:y});return jsxRuntime.jsxs($b,{children:[jsxRuntime.jsxs(Gb,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"primary",lineHeight:"24px",children:u}),f&&jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",lineHeight:"20px",children:So(e.minUnitQuantity,e.maxUnitQuantity,(A=e.feature)==null?void 0:A.unitsPlural)})]}),jsxRuntime.jsx(Vb,{variant:"h6",color:"primary",children:p})]})}function bp({plan:e,billingPeriod:t,onBillableFeatureChange:o}){var u;let{billableFeatures:r,setBillableFeature:n}=be(),{setIsDisabled:i}=_e(),{setIsValid:a}=D(),l=xr(((u=e==null?void 0:e.pricePoints)==null?void 0:u.filter(f=>f.billingPeriod===t))||[]),[s,c]=hi.useState(l==null?void 0:l.reduce((f,y)=>{var p;return f[((p=y.feature)==null?void 0:p.featureId)||"base-charge"]=true,f},{}));return hi.useEffect(()=>{let f=Object.values(s).some(y=>!y);i(f),a(!f);},[s,i,a]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:l==null?void 0:l.map(f=>{var p;let y=r.find(g=>{var h;return g.featureId===((h=f.feature)==null?void 0:h.featureId)});return jsxRuntime.jsx(Ob,{charge:f,setBillableFeature:n,billableFeature:y,onValidationChange:({featureId:g,isValid:h})=>c(P=>chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},P),{[g]:h})),onBillableFeatureChange:o},((p=f.feature)==null?void 0:p.featureId)||"base-charge")})})}var Sp=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
814
+ `,zb=(e,t)=>{let{minUnitQuantity:o,maxUnitQuantity:r}=e;return !t||t<(o||1)?`Minimum ${o||1}`:r&&t>r?`Maximum ${r}`:""};function Ob({charge:e,setBillableFeature:t,billableFeature:o,onValidationChange:r,onBillableFeatureChange:n}){var g,h,P,b,x,A;let[i,a]=hi.useState(void 0),l=(g=e.feature)==null?void 0:g.featureId,s=!l,c=e.pricingModel===jsClientSdk.BillingModel.UsageBased,u=s?"Base charge":Bt(((h=e.feature)==null?void 0:h.displayName)||"",(P=e.feature)==null?void 0:P.units,(b=e.feature)==null?void 0:b.unitsPlural),f=!!(e!=null&&e.minUnitQuantity||e!=null&&e.maxUnitQuantity),y=S=>chunkIL3DC53A_cjs_js.d(null,null,function*(){var E,L;if(s||!l)return;let{minUnitQuantity:F,maxUnitQuantity:T}=e,k=(E=S==null?void 0:S.target)!=null&&E.value?Number((L=S==null?void 0:S.target)==null?void 0:L.value):null;if(!k||k<=0||F&&k<F||T&&k>T){r({featureId:l,isValid:false}),a(zb(e,k!=null?k:void 0)),t(l,k!=null?k:null);return}let w=yr(e,k),I=yield n==null?void 0:n({feature:e.feature,quantity:w});a(I==null?void 0:I.errorMessage),r({featureId:l,isValid:!(I!=null&&I.disableNextStep)}),t(l,w);}),p;if(s||c)p=`${H({amount:e.amount,currency:e.currency,locale:"en-us",minimumFractionDigits:2})}`,c&&(p+=" / unit");else if(e.isTieredPrice&&e.tiersMode&&l){let S=(o==null?void 0:o.quantity)||1;p=jsxRuntime.jsx(Kt,{componentId:`${l}-tiers`,tiers:e.tiers,tiersMode:e.tiersMode,value:S,errorMessage:i,handleChange:F=>chunkIL3DC53A_cjs_js.d(null,null,function*(){let T=yield n==null?void 0:n({feature:e.feature,quantity:F});a(T==null?void 0:T.errorMessage),r({featureId:l,isValid:!(T!=null&&T.disableNextStep)}),t(l,F);}),width:"100%"});}else p=jsxRuntime.jsx(pe,{sx:{width:"100%"},id:`${l}-input`,type:"number",onWheel:bt,error:!!i,helperText:i,FormHelperTextProps:{sx:{margin:"4px"}},value:(x=o==null?void 0:o.quantity)!=null?x:"",onChange:y});return jsxRuntime.jsxs($b,{children:[jsxRuntime.jsxs(Gb,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"primary",lineHeight:"24px",children:u}),f&&jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",lineHeight:"20px",children:So(e.minUnitQuantity,e.maxUnitQuantity,(A=e.feature)==null?void 0:A.unitsPlural)})]}),jsxRuntime.jsx(Vb,{variant:"h6",color:"primary",children:p})]})}function Sp({plan:e,billingPeriod:t,onBillableFeatureChange:o}){var u;let{billableFeatures:r,setBillableFeature:n}=be(),{setIsDisabled:i}=_e(),{setIsValid:a}=D(),l=xr(((u=e==null?void 0:e.pricePoints)==null?void 0:u.filter(f=>f.billingPeriod===t))||[]),[s,c]=hi.useState(l==null?void 0:l.reduce((f,y)=>{var p;return f[((p=y.feature)==null?void 0:p.featureId)||"base-charge"]=true,f},{}));return hi.useEffect(()=>{let f=Object.values(s).some(y=>!y);i(f),a(!f);},[s,i,a]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:l==null?void 0:l.map(f=>{var p;let y=r.find(g=>{var h;return g.featureId===((h=f.feature)==null?void 0:h.featureId)});return jsxRuntime.jsx(Ob,{charge:f,setBillableFeature:n,billableFeature:y,onValidationChange:({featureId:g,isValid:h})=>c(P=>chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},P),{[g]:h})),onBillableFeatureChange:o},((p=f.feature)==null?void 0:p.featureId)||"base-charge")})})}var Tp=chunkIL3DC53A_cjs_js.e(ke__default.default)`
815
815
  width: 100%;
816
- `;var kp=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:r}=D(),{plan:n}=o||{},{billingPeriod:i}=be();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(pp,{allowChangePlan:true,onChangePlan:e}),jsxRuntime.jsxs(Sp,{children:[jsxRuntime.jsx(Cp,{plan:n,checkoutLocalization:r}),jsxRuntime.jsx(bp,{plan:n,billingPeriod:i,onBillableFeatureChange:t})]})]})};var Yb=e=>jsxRuntime.jsx("svg",chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"arrow-right",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M2.66699 8H13.3337",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M9.33301 4L13.333 8L9.33301 12",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})})),wp=Yb;var Bp=chunk2FMVMEMY_cjs_js.e(wp)`
816
+ `;var wp=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:r}=D(),{plan:n}=o||{},{billingPeriod:i}=be();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(mp,{allowChangePlan:true,onChangePlan:e}),jsxRuntime.jsxs(Tp,{children:[jsxRuntime.jsx(Pp,{plan:n,checkoutLocalization:r}),jsxRuntime.jsx(Sp,{plan:n,billingPeriod:i,onBillableFeatureChange:t})]})]})};var Yb=e=>jsxRuntime.jsx("svg",chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"arrow-right",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M2.66699 8H13.3337",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M9.33301 4L13.333 8L9.33301 12",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Bp=Yb;var Ap=chunkIL3DC53A_cjs_js.e(Bp)`
817
817
  path {
818
818
  stroke: ${({theme:e})=>e.stigg.palette.text.secondary};
819
819
  }
820
- `;var qb=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
820
+ `;var qb=chunkIL3DC53A_cjs_js.e(ke__default.default)`
821
821
  display: flex;
822
- `,Jb=chunk2FMVMEMY_cjs_js.e(Jx__default.default)`
822
+ `,Jb=chunkIL3DC53A_cjs_js.e(Jx__default.default)`
823
823
  margin-bottom: 16px;
824
- `,Xb=chunk2FMVMEMY_cjs_js.e(ke__default.default)`
824
+ `,Xb=chunkIL3DC53A_cjs_js.e(ke__default.default)`
825
825
  padding: 16px;
826
826
  border-radius: 10px;
827
827
  width: 100%;
828
828
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
829
- `,Ap=({headerText:e,planName:t,priceText:o})=>jsxRuntime.jsxs(Xb,{className:"stigg-checkout-downgrade-to-free-container",children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled",children:e}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:true,variant:"h3",color:"primary",children:t}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary",children:o})]}),Fp=({checkoutLocalization:e,activeSubscription:t,freePlan:o,allowChangePlan:r=false,onChangePlan:n})=>{let i;r&&n&&(i=jsxRuntime.jsx(Dr,{onClick:()=>{n({currentPlan:o});},checkoutLocalization:e,size:"small"}));let a=t.prices.length>0?t.prices[0].billingPeriod:void 0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Jb,{action:i,className:"stigg-checkout-downgrade-to-free-alert",severity:"info",children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{as:"span",color:"secondary",children:e.downgradeToFree.alertText({plan:t.plan})})}),jsxRuntime.jsxs(qb,{className:"stigg-checkout-downgrade-to-free-plans-container",children:[jsxRuntime.jsx(Ap,{headerText:e.downgradeToFree.paidPlanHeader({plan:t.plan}),planName:e.downgradeToFree.paidPlanName({plan:t.plan}),priceText:e.downgradeToFree.paidPlanPriceText({plan:t.plan,billingPeriod:a})}),jsxRuntime.jsx(Bp,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),jsxRuntime.jsx(Ap,{headerText:e.downgradeToFree.freePlanHeader({plan:o}),planName:e.downgradeToFree.freePlanName({plan:o}),priceText:e.downgradeToFree.freePlanPriceText({plan:o})})]})]})};var oS=(e,{onBillingAddressChange:t,onChangePlan:o,onBillableFeatureChange:r,onAddonChange:n,collectPhoneNumber:i,collectTaxId:a,onCheckout:l,onCheckoutCompleted:s})=>{switch(e.key){case "PLAN":return {content:jsxRuntime.jsx(kp,{onChangePlan:o,onBillableFeatureChange:r})};case "ADDONS":return {content:jsxRuntime.jsx(jd,{onAddonChange:n})};case "PAYMENT":return {content:jsxRuntime.jsx(lp,{onBillingAddressChange:t,collectPhoneNumber:i,collectTaxId:a,onCheckout:l,onCheckoutCompleted:s})};default:return {content:null}}};function Np({onCheckout:e,onCheckoutCompleted:t,onChangePlan:o,onBillingAddressChange:r,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:a,collectTaxId:l,disablePromotionCode:s,disableSuccessAnimation:c,onMockCheckoutPreview:u}){let{stripePromise:f,setupIntentClientSecret:y}=Pd(),[{stiggTheme:p,widgetState:g,theme:h,showWatermark:P}]=_(),{currentStep:b}=_e(),{isLoadingCheckoutData:x}=g,{checkoutState:A,checkoutLocalization:S}=D(),{plan:F,activeSubscription:T}=A||{},k=!!F&&F.pricingType===jsClientSdk.PricingType.Free&&!!T&&T.pricingType!==jsClientSdk.PricingType.Free,{content:w}=oS(b,{onBillingAddressChange:r,onChangePlan:o,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:a,collectTaxId:l,onCheckout:e,onCheckoutCompleted:t}),I=jsxRuntime.jsx(jsxRuntime.Fragment,{children:k?jsxRuntime.jsx(Fp,{freePlan:F,activeSubscription:T,allowChangePlan:true,checkoutLocalization:S,onChangePlan:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:w})}),E=hi.useMemo(()=>y?{clientSecret:y}:{mode:"setup",currency:"usd"},[y]);return jsxRuntime.jsx(reactStripeJs.Elements,{stripe:f,options:chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},E),{appearance:{theme:"stripe",variables:{colorText:p.palette.text.primary,colorPrimaryText:p.palette.text.primary,colorTextPlaceholder:p.palette.text.disabled,fontFamily:p.typography.fontFamily,colorBackground:h==null?void 0:h.paymentInputBackgroundColor,borderRadius:h==null?void 0:h.paymentInputBorderRadius},rules:h!=null&&h.paymentInputBorderColor?{".Input":{borderColor:h==null?void 0:h.paymentInputBorderColor}}:void 0}}),children:jsxRuntime.jsxs(Uc,{className:"stigg-checkout-layout",children:[!k&&jsxRuntime.jsx(Hc,{}),jsxRuntime.jsxs(_c,{children:[jsxRuntime.jsx(Dc,{children:x?jsxRuntime.jsx(Ja,{}):I}),x?jsxRuntime.jsx(Od,{showWatermark:P}):jsxRuntime.jsx(zd,{disablePromotionCode:s,disableSuccessAnimation:c,onCheckout:e,onCheckoutCompleted:t,isFreeDowngrade:k,onMockCheckoutPreview:u,showWatermark:P})]})]})},y)}var Rp=p=>{var g=p,{textOverrides:e,theme:t,resourceId:o,planId:r,preferredBillingPeriod:n,billingCountryCode:i,billableFeatures:a,billingInformation:l,onMockCheckoutState:s,skipCheckoutSteps:c,onBeforeStepChange:u,resetBillingPeriod:f}=g,y=chunk2FMVMEMY_cjs_js.c(g,["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState","skipCheckoutSteps","onBeforeStepChange","resetBillingPeriod"]);return jsxRuntime.jsx(Nc,{textOverrides:e,theme:t,resourceId:o,planId:r,preferredBillingPeriod:n,billingCountryCode:i,billableFeatures:a,billingInformation:l,onMockCheckoutState:s,skipCheckoutSteps:c,onBeforeStepChange:u,resetBillingPeriod:f,children:jsxRuntime.jsx(Np,chunk2FMVMEMY_cjs_js.a({},y))})};function iS(e){return hi.useMemo(()=>{let t=new URLSearchParams(window.location.search);return t.get(e)},[e,window.location.search])}var Ki=(r=>(r.IN_PROGRESS="IN_PROGRESS",r.SUCCEEDED="SUCCEEDED",r.FAILED="FAILED",r))(Ki||{}),_p=({onProvisionStart:e,onProvisionSucceeded:t,onProvisionFailed:o}={})=>{let{stigg:r}=chunk2FMVMEMY_cjs_js.u(),[n,i]=hi.useState("IN_PROGRESS"),[a,l]=hi.useState(false),s=iS("checkoutCompleted");return hi.useEffect(()=>{chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(!(!s||s.toLowerCase()==="false"||a)){l(true),e&&e();try{let u=yield r.waitForCheckoutCompleted();i("SUCCEEDED"),t&&t(u);}catch(u){console.error("Failed to wait for checkout to complete",u),i("FAILED"),o&&o(u);}finally{l(false);}}});},[r,s]),{isAwaitingCheckout:a,provisionStatus:n}};function aS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunk2FMVMEMY_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunk2FMVMEMY_cjs_js.x(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function cS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunk2FMVMEMY_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunk2FMVMEMY_cjs_js.y(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function mS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunk2FMVMEMY_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunk2FMVMEMY_cjs_js.z(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function fS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunk2FMVMEMY_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunk2FMVMEMY_cjs_js.B(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}var Rt=chunk2FMVMEMY_cjs_js.e.div`
829
+ `,Ip=({headerText:e,planName:t,priceText:o})=>jsxRuntime.jsxs(Xb,{className:"stigg-checkout-downgrade-to-free-container",children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled",children:e}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:true,variant:"h3",color:"primary",children:t}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary",children:o})]}),Ep=({checkoutLocalization:e,activeSubscription:t,freePlan:o,allowChangePlan:r=false,onChangePlan:n})=>{let i;r&&n&&(i=jsxRuntime.jsx(Dr,{onClick:()=>{n({currentPlan:o});},checkoutLocalization:e,size:"small"}));let a=t.prices.length>0?t.prices[0].billingPeriod:void 0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Jb,{action:i,className:"stigg-checkout-downgrade-to-free-alert",severity:"info",children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{as:"span",color:"secondary",children:e.downgradeToFree.alertText({plan:t.plan})})}),jsxRuntime.jsxs(qb,{className:"stigg-checkout-downgrade-to-free-plans-container",children:[jsxRuntime.jsx(Ip,{headerText:e.downgradeToFree.paidPlanHeader({plan:t.plan}),planName:e.downgradeToFree.paidPlanName({plan:t.plan}),priceText:e.downgradeToFree.paidPlanPriceText({plan:t.plan,billingPeriod:a})}),jsxRuntime.jsx(Ap,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),jsxRuntime.jsx(Ip,{headerText:e.downgradeToFree.freePlanHeader({plan:o}),planName:e.downgradeToFree.freePlanName({plan:o}),priceText:e.downgradeToFree.freePlanPriceText({plan:o})})]})]})};var oS=(e,{onBillingAddressChange:t,onChangePlan:o,onBillableFeatureChange:r,onAddonChange:n,collectPhoneNumber:i,collectTaxId:a,onCheckout:l,onCheckoutCompleted:s})=>{switch(e.key){case "PLAN":return {content:jsxRuntime.jsx(wp,{onChangePlan:o,onBillableFeatureChange:r})};case "ADDONS":return {content:jsxRuntime.jsx(ep,{onAddonChange:n})};case "PAYMENT":return {content:jsxRuntime.jsx(cp,{onBillingAddressChange:t,collectPhoneNumber:i,collectTaxId:a,onCheckout:l,onCheckoutCompleted:s})};default:return {content:null}}};function Mp({onCheckout:e,onCheckoutCompleted:t,onChangePlan:o,onBillingAddressChange:r,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:a,collectTaxId:l,disablePromotionCode:s,disableSuccessAnimation:c,onMockCheckoutPreview:u}){let{stripePromise:f,setupIntentClientSecret:y}=xd(),[{stiggTheme:p,widgetState:g,theme:h,showWatermark:P}]=_(),{currentStep:b}=_e(),{isLoadingCheckoutData:x}=g,{checkoutState:A,checkoutLocalization:S}=D(),{plan:F,activeSubscription:T}=A||{},k=!!F&&F.pricingType===jsClientSdk.PricingType.Free&&!!T&&T.pricingType!==jsClientSdk.PricingType.Free,{content:w}=oS(b,{onBillingAddressChange:r,onChangePlan:o,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:a,collectTaxId:l,onCheckout:e,onCheckoutCompleted:t}),I=jsxRuntime.jsx(jsxRuntime.Fragment,{children:k?jsxRuntime.jsx(Ep,{freePlan:F,activeSubscription:T,allowChangePlan:true,checkoutLocalization:S,onChangePlan:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:w})}),E=hi.useMemo(()=>y?{clientSecret:y}:{mode:"setup",currency:"usd"},[y]);return jsxRuntime.jsx(reactStripeJs.Elements,{stripe:f,options:chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},E),{appearance:{theme:"stripe",variables:{colorText:p.palette.text.primary,colorPrimaryText:p.palette.text.primary,colorTextPlaceholder:p.palette.text.disabled,fontFamily:p.typography.fontFamily,colorBackground:h==null?void 0:h.paymentInputBackgroundColor,borderRadius:h==null?void 0:h.paymentInputBorderRadius},rules:h!=null&&h.paymentInputBorderColor?{".Input":{borderColor:h==null?void 0:h.paymentInputBorderColor}}:void 0}}),children:jsxRuntime.jsxs(_c,{className:"stigg-checkout-layout",children:[!k&&jsxRuntime.jsx(Wc,{}),jsxRuntime.jsxs(Dc,{children:[jsxRuntime.jsx($c,{children:x?jsxRuntime.jsx(Xa,{}):I}),x?jsxRuntime.jsx(Hd,{showWatermark:P}):jsxRuntime.jsx(Od,{disablePromotionCode:s,disableSuccessAnimation:c,onCheckout:e,onCheckoutCompleted:t,isFreeDowngrade:k,onMockCheckoutPreview:u,showWatermark:P})]})]})},y)}var Up=p=>{var g=p,{textOverrides:e,theme:t,resourceId:o,planId:r,preferredBillingPeriod:n,billingCountryCode:i,billableFeatures:a,billingInformation:l,onMockCheckoutState:s,skipCheckoutSteps:c,onBeforeStepChange:u,resetBillingPeriod:f}=g,y=chunkIL3DC53A_cjs_js.c(g,["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState","skipCheckoutSteps","onBeforeStepChange","resetBillingPeriod"]);return jsxRuntime.jsx(Mc,{textOverrides:e,theme:t,resourceId:o,planId:r,preferredBillingPeriod:n,billingCountryCode:i,billableFeatures:a,billingInformation:l,onMockCheckoutState:s,skipCheckoutSteps:c,onBeforeStepChange:u,resetBillingPeriod:f,children:jsxRuntime.jsx(Mp,chunkIL3DC53A_cjs_js.a({},y))})};function iS(e){return hi.useMemo(()=>{let t=new URLSearchParams(window.location.search);return t.get(e)},[e,window.location.search])}var Ki=(r=>(r.IN_PROGRESS="IN_PROGRESS",r.SUCCEEDED="SUCCEEDED",r.FAILED="FAILED",r))(Ki||{}),Dp=({onProvisionStart:e,onProvisionSucceeded:t,onProvisionFailed:o}={})=>{let{stigg:r}=chunkIL3DC53A_cjs_js.u(),[n,i]=hi.useState("IN_PROGRESS"),[a,l]=hi.useState(false),s=iS("checkoutCompleted");return hi.useEffect(()=>{chunkIL3DC53A_cjs_js.d(null,null,function*(){if(!(!s||s.toLowerCase()==="false"||a)){l(true),e&&e();try{let u=yield r.waitForCheckoutCompleted();i("SUCCEEDED"),t&&t(u);}catch(u){console.error("Failed to wait for checkout to complete",u),i("FAILED"),o&&o(u);}finally{l(false);}}});},[r,s]),{isAwaitingCheckout:a,provisionStatus:n}};function aS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkIL3DC53A_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkIL3DC53A_cjs_js.x(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function cS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkIL3DC53A_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkIL3DC53A_cjs_js.y(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function mS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkIL3DC53A_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkIL3DC53A_cjs_js.z(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function fS(r){var n=r,{noAccessComponent:e,children:t}=n,o=chunkIL3DC53A_cjs_js.c(n,["noAccessComponent","children"]);let{hasAccess:i}=chunkIL3DC53A_cjs_js.B(o);return i?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}var Rt=chunkIL3DC53A_cjs_js.e.div`
830
830
  display: flex;
831
831
  align-items: center;
832
832
  justify-content: space-between;
833
833
  width: 100%;
834
- `;var Ut=chunk2FMVMEMY_cjs_js.e.button`
834
+ `;var Ut=chunkIL3DC53A_cjs_js.e.button`
835
835
  display: flex;
836
836
  align-items: center;
837
837
  gap: 4px;
@@ -857,27 +857,27 @@
857
857
  outline: 2px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.primary}};
858
858
  outline-offset: 2px;
859
859
  }
860
- `;var Ve=(e,t)=>e?chunk2FMVMEMY_cjs_js.k(e,{maximumFractionDigits:t!=null?t:void 0}):0,Gr=(e,t=true)=>{let{remaining:o,currency:r}=e,n=(o===1?r.unitSingular:r.unitPlural)||null,i=n!=null?n:r.displayName;return t&&i!=null?i:""},Vr=(e,t)=>t===0?e>0?100:0:Math.min(e/t*100,100);function zr({usagePeriodEnd:e,formatResetPeriod:t,className:o}){let r=cr({usagePeriodEnd:e,formatter:t});return r?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"caption",color:"secondary",className:o,children:r}):null}var PS=chunk2FMVMEMY_cjs_js.e.div`
860
+ `;var Ve=(e,t)=>e?chunkIL3DC53A_cjs_js.k(e,{maximumFractionDigits:t!=null?t:void 0}):0,Gr=(e,t=true)=>{let{remaining:o,currency:r}=e,n=(o===1?r.unitSingular:r.unitPlural)||null,i=n!=null?n:r.displayName;return t&&i!=null?i:""},Vr=(e,t)=>t===0?e>0?100:0:Math.min(e/t*100,100);function zr({usagePeriodEnd:e,formatResetPeriod:t,className:o}){let r=cr({usagePeriodEnd:e,formatter:t});return r?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"caption",color:"secondary",className:o,children:r}):null}var PS=chunkIL3DC53A_cjs_js.e.div`
861
861
  display: flex;
862
862
  flex-direction: column;
863
863
  gap: 4px;
864
- `,xS=chunk2FMVMEMY_cjs_js.e.div`
864
+ `,xS=chunkIL3DC53A_cjs_js.e.div`
865
865
  display: flex;
866
866
  flex-direction: row;
867
867
  gap: 4px;
868
868
  align-items: baseline;
869
- `;function $p({entitlement:e,decimalPlaces:t=null,showUnits:o=true,formatResetPeriod:r}){if(e.isFallback)return jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"disabled",className:"stigg-credit-balance-value-no-balance",children:"No balance data available"});let n=Gr(e,o),i=e.usageLimit-e.currentUsage,a=i<0;return jsxRuntime.jsxs(PS,{children:[jsxRuntime.jsxs(xS,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h3",color:a?"error":"primary",bold:true,className:"stigg-credit-balance-value-amount",children:Ve(i,t)}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-balance-value-suffix",children:n})]}),jsxRuntime.jsx(zr,{usagePeriodEnd:e.usagePeriodEnd,formatResetPeriod:r,className:"stigg-credit-balance-reset-period"})]})}var Hr=chunk2FMVMEMY_cjs_js.e(br)`
869
+ `;function Gp({entitlement:e,decimalPlaces:t=null,showUnits:o=true,formatResetPeriod:r}){if(e.isFallback)return jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"disabled",className:"stigg-credit-balance-value-no-balance",children:"No balance data available"});let n=Gr(e,o),i=e.usageLimit-e.currentUsage,a=i<0;return jsxRuntime.jsxs(PS,{children:[jsxRuntime.jsxs(xS,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h3",color:a?"error":"primary",bold:true,className:"stigg-credit-balance-value-amount",children:Ve(i,t)}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-balance-value-suffix",children:n})]}),jsxRuntime.jsx(zr,{usagePeriodEnd:e.usagePeriodEnd,formatResetPeriod:r,className:"stigg-credit-balance-reset-period"})]})}var Hr=chunkIL3DC53A_cjs_js.e(br)`
870
870
  width: 16px;
871
871
  height: 16px;
872
872
  path {
873
873
  stroke: ${({theme:e})=>{var t,o,r;return (r=(o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.text)==null?void 0:r.primary}};
874
874
  }
875
- `;var bS=chunk2FMVMEMY_cjs_js.e.div`
875
+ `;var bS=chunkIL3DC53A_cjs_js.e.div`
876
876
  display: flex;
877
877
  flex-direction: column;
878
878
  gap: 8px;
879
879
  width: 100%;
880
- `,SS=chunk2FMVMEMY_cjs_js.e.div`
880
+ `,SS=chunkIL3DC53A_cjs_js.e.div`
881
881
  display: flex;
882
882
  flex-direction: column;
883
883
  gap: 8px;
@@ -885,40 +885,40 @@
885
885
  border-radius: 8px;
886
886
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
887
887
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
888
- `;function Gp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a=chunk2FMVMEMY_cjs_js.u({optional:true}),l=a==null?void 0:a.theme,{title:s,addCredits:c,formatResetPeriod:u}=chunk2FMVMEMY_cjs_js.a(chunk2FMVMEMY_cjs_js.a({},chunk2FMVMEMY_cjs_js.G),t),f=chunk2FMVMEMY_cjs_js.A({currencyId:e}),y=jsxRuntime.jsx(bS,{className:"stigg-credit-balance-container",children:jsxRuntime.jsxs(SS,{className:"stigg-credit-balance-card",children:[jsxRuntime.jsxs(Rt,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:s}),n&&!f.isFallback&&jsxRuntime.jsxs(Ut,{type:"button",onClick:()=>n(f),className:"stigg-credit-balance-add-credits-button",children:[jsxRuntime.jsx(Hr,{className:"stigg-credit-balance-add-credits-icon"}),c]})]}),jsxRuntime.jsx($p,{entitlement:f,decimalPlaces:o,showUnits:r,formatResetPeriod:u})]})});return i?y:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:l,children:y})}var wS=hi.lazy(()=>import('./CreditUsageChart-K3F5B2BG.cjs.js').then(e=>({default:e.CreditUsageChart})));function zp(e){return jsxRuntime.jsx(hi.Suspense,{fallback:null,children:jsxRuntime.jsx(wS,chunk2FMVMEMY_cjs_js.a({},e))})}var BS=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,AS=chunk2FMVMEMY_cjs_js.e.div`
888
+ `;function Vp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a=chunkIL3DC53A_cjs_js.u({optional:true}),l=a==null?void 0:a.theme,{title:s,addCredits:c,formatResetPeriod:u}=chunkIL3DC53A_cjs_js.a(chunkIL3DC53A_cjs_js.a({},chunkIL3DC53A_cjs_js.G),t),f=chunkIL3DC53A_cjs_js.A({currencyId:e}),y=jsxRuntime.jsx(bS,{className:"stigg-credit-balance-container",children:jsxRuntime.jsxs(SS,{className:"stigg-credit-balance-card",children:[jsxRuntime.jsxs(Rt,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:s}),n&&!f.isFallback&&jsxRuntime.jsxs(Ut,{type:"button",onClick:()=>n(f),className:"stigg-credit-balance-add-credits-button",children:[jsxRuntime.jsx(Hr,{className:"stigg-credit-balance-add-credits-icon"}),c]})]}),jsxRuntime.jsx(Gp,{entitlement:f,decimalPlaces:o,showUnits:r,formatResetPeriod:u})]})});return i?y:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:l,children:y})}var wS=hi.lazy(()=>import('./CreditUsageChart-66WBH3UW.cjs.js').then(e=>({default:e.CreditUsageChart})));function Op(e){return jsxRuntime.jsx(hi.Suspense,{fallback:null,children:jsxRuntime.jsx(wS,chunkIL3DC53A_cjs_js.a({},e))})}var BS=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,AS=chunkIL3DC53A_cjs_js.e.div`
889
889
  width: 100%;
890
890
  height: 8px;
891
891
  background-color: ${({theme:e})=>e.stigg.palette.progress.background};
892
892
  border-radius: 4px;
893
893
  overflow: hidden;
894
- `,IS=chunk2FMVMEMY_cjs_js.e.div`
894
+ `,IS=chunkIL3DC53A_cjs_js.e.div`
895
895
  height: 100%;
896
896
  width: ${({percentage:e})=>Math.max(0,Math.min(100,e))}%;
897
897
  background-color: ${({theme:e,percentage:t,variant:o})=>BS(t,e.stigg,o)};
898
898
  border-radius: 4px;
899
899
  transition: width 0.3s ease-in-out;
900
- `;function Wr({percentage:e,className:t,variant:o="utilization"}){return jsxRuntime.jsx(AS,{className:t,children:jsxRuntime.jsx(IS,{percentage:e,variant:o})})}var FS=chunk2FMVMEMY_cjs_js.e.div`
900
+ `;function Wr({percentage:e,className:t,variant:o="utilization"}){return jsxRuntime.jsx(AS,{className:t,children:jsxRuntime.jsx(IS,{percentage:e,variant:o})})}var FS=chunkIL3DC53A_cjs_js.e.div`
901
901
  display: flex;
902
902
  flex-direction: row;
903
903
  justify-content: space-between;
904
904
  align-items: baseline;
905
905
  width: 100%;
906
- `,ES=chunk2FMVMEMY_cjs_js.e.div`
906
+ `,ES=chunkIL3DC53A_cjs_js.e.div`
907
907
  display: flex;
908
908
  flex-direction: row;
909
909
  gap: 4px;
910
910
  align-items: baseline;
911
- `,vS=chunk2FMVMEMY_cjs_js.e.div`
911
+ `,vS=chunkIL3DC53A_cjs_js.e.div`
912
912
  display: flex;
913
913
  flex-direction: row;
914
914
  gap: 4px;
915
915
  align-items: baseline;
916
- `,LS=({currentUsage:e,usageLimit:t})=>{let o=Vr(e,t);return jsxRuntime.jsx(Wr,{percentage:o,className:"stigg-credit-utilization-progress",variant:"utilization"})};function Hp({entitlement:e,decimalPlaces:t=null,showUnits:o=true,remainingLabel:r=chunk2FMVMEMY_cjs_js.H.remaining,formatResetPeriod:n}){if(e.isFallback)return jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"disabled",className:"stigg-credit-utilization-value-no-balance",children:"No balance data available"});let{currentUsage:i,usageLimit:a}=e,l=Gr(e,o),s=a-i,c=s<0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(FS,{children:[jsxRuntime.jsxs(ES,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-utilization-usage",children:Ve(i,t)}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-credit-utilization-separator",children:"/"}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-credit-utilization-total",children:Ve(a,t)}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-suffix",children:l})]}),jsxRuntime.jsxs(vS,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-remaining-label",children:r}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"caption",color:c?"error":"primary",bold:true,className:"stigg-credit-utilization-remaining-value",children:Ve(s,t)})]})]}),jsxRuntime.jsx(LS,{currentUsage:i,usageLimit:a}),jsxRuntime.jsx(zr,{usagePeriodEnd:e.usagePeriodEnd,formatResetPeriod:n,className:"stigg-credit-utilization-reset-period"})]})}var MS=chunk2FMVMEMY_cjs_js.e.div`
916
+ `,LS=({currentUsage:e,usageLimit:t})=>{let o=Vr(e,t);return jsxRuntime.jsx(Wr,{percentage:o,className:"stigg-credit-utilization-progress",variant:"utilization"})};function Wp({entitlement:e,decimalPlaces:t=null,showUnits:o=true,remainingLabel:r=chunkIL3DC53A_cjs_js.H.remaining,formatResetPeriod:n}){if(e.isFallback)return jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"disabled",className:"stigg-credit-utilization-value-no-balance",children:"No balance data available"});let{currentUsage:i,usageLimit:a}=e,l=Gr(e,o),s=a-i,c=s<0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(FS,{children:[jsxRuntime.jsxs(ES,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-utilization-usage",children:Ve(i,t)}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-credit-utilization-separator",children:"/"}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-credit-utilization-total",children:Ve(a,t)}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-suffix",children:l})]}),jsxRuntime.jsxs(vS,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-remaining-label",children:r}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"caption",color:c?"error":"primary",bold:true,className:"stigg-credit-utilization-remaining-value",children:Ve(s,t)})]})]}),jsxRuntime.jsx(LS,{currentUsage:i,usageLimit:a}),jsxRuntime.jsx(zr,{usagePeriodEnd:e.usagePeriodEnd,formatResetPeriod:n,className:"stigg-credit-utilization-reset-period"})]})}var MS=chunkIL3DC53A_cjs_js.e.div`
917
917
  display: flex;
918
918
  flex-direction: column;
919
919
  gap: 8px;
920
920
  width: 100%;
921
- `,RS=chunk2FMVMEMY_cjs_js.e.div`
921
+ `,RS=chunkIL3DC53A_cjs_js.e.div`
922
922
  display: flex;
923
923
  flex-direction: column;
924
924
  gap: 16px;
@@ -927,7 +927,7 @@
927
927
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
928
928
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
929
929
  min-height: 90px;
930
- `;function Wp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a=chunk2FMVMEMY_cjs_js.u({optional:true}),l=a==null?void 0:a.theme,s=chunk2FMVMEMY_cjs_js.A({currencyId:e}),{title:c,remaining:u,addCredits:f,formatResetPeriod:y}=chunk2FMVMEMY_cjs_js.a(chunk2FMVMEMY_cjs_js.a({},chunk2FMVMEMY_cjs_js.H),t),p=jsxRuntime.jsx(MS,{className:"stigg-credit-utilization-container",children:jsxRuntime.jsxs(RS,{className:"stigg-credit-utilization-card",children:[jsxRuntime.jsxs(Rt,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-credit-utilization-title",children:c}),n&&!s.isFallback&&jsxRuntime.jsxs(Ut,{type:"button",onClick:()=>n(s),className:"stigg-credit-utilization-add-credits-button",children:[jsxRuntime.jsx(Hr,{className:"stigg-credit-utilization-add-credits-icon"}),f]})]}),jsxRuntime.jsx(Hp,{entitlement:s,decimalPlaces:o,showUnits:r,remainingLabel:u,formatResetPeriod:y})]})});return i?p:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:l,children:p})}function Yr(e){let t=chunk2FMVMEMY_cjs_js.u(),o=t==null?void 0:t.stigg,r=t==null?void 0:t.updatedAt,n=hi.useCallback(()=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{return o.getCreditGrants({currencyId:e.currencyId,paging:e.paging})}catch(s){throw console.error("Error fetching credit grants:",s),s}}),[o,e.currencyId,e.paging,r]),{data:i,error:a,isLoading:l}=chunk2FMVMEMY_cjs_js.C({func:n});return hi.useMemo(()=>({creditGrants:(i==null?void 0:i.data)||[],paging:i==null?void 0:i.pageInfo,totalCount:i==null?void 0:i.totalCount,isLoading:l,error:a}),[i,a,l])}function Xi({skeletonRows:e,visibleHeadCells:t,hideLastRowBorder:o}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((r,n)=>jsxRuntime.jsx(DS__default.default,{children:t.map(i=>jsxRuntime.jsx(_t,{$alignment:i.alignment,$width:i.width,$maxWidth:i.maxWidth,$minWidth:i.minWidth,$isLastRow:n===e-1,$hideLastRowBorder:o,children:jsxRuntime.jsx(Xe__default.default,{width:i.width?parseInt(i.width.replace("px",""))-40:100,height:20})},String(i.id)))},n))})}function ji({data:e,visibleHeadCells:t,onRowClick:o,hideLastRowBorder:r}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((n,i)=>jsxRuntime.jsx(ea,{$clickable:!!o,onClick:()=>o&&o(n),children:t.map(a=>jsxRuntime.jsx(_t,{$alignment:a.alignment,$width:a.width,$maxWidth:a.maxWidth,$minWidth:a.minWidth,$isLastRow:i===e.length-1,$hideLastRowBorder:r,onClick:a.disableClick?l=>l.stopPropagation():void 0,children:jsxRuntime.jsx(ta,{$alignment:a.alignment,children:a.render(n)})},String(a.id)))},i))})}function qr({errorMessage:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"error",className:t,children:e||"An error occurred"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}function Jr({message:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",className:t,children:e||"No data available"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}var JS=chunk2FMVMEMY_cjs_js.e(material.TableContainer)`
930
+ `;function Zp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a=chunkIL3DC53A_cjs_js.u({optional:true}),l=a==null?void 0:a.theme,s=chunkIL3DC53A_cjs_js.A({currencyId:e}),{title:c,remaining:u,addCredits:f,formatResetPeriod:y}=chunkIL3DC53A_cjs_js.a(chunkIL3DC53A_cjs_js.a({},chunkIL3DC53A_cjs_js.H),t),p=jsxRuntime.jsx(MS,{className:"stigg-credit-utilization-container",children:jsxRuntime.jsxs(RS,{className:"stigg-credit-utilization-card",children:[jsxRuntime.jsxs(Rt,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-credit-utilization-title",children:c}),n&&!s.isFallback&&jsxRuntime.jsxs(Ut,{type:"button",onClick:()=>n(s),className:"stigg-credit-utilization-add-credits-button",children:[jsxRuntime.jsx(Hr,{className:"stigg-credit-utilization-add-credits-icon"}),f]})]}),jsxRuntime.jsx(Wp,{entitlement:s,decimalPlaces:o,showUnits:r,remainingLabel:u,formatResetPeriod:y})]})});return i?p:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:l,children:p})}function Yr(e){let t=chunkIL3DC53A_cjs_js.u(),o=t==null?void 0:t.stigg,r=t==null?void 0:t.updatedAt,n=hi.useCallback(()=>chunkIL3DC53A_cjs_js.d(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{return o.getCreditGrants({currencyId:e.currencyId,paging:e.paging})}catch(s){throw console.error("Error fetching credit grants:",s),s}}),[o,e.currencyId,e.paging,r]),{data:i,error:a,isLoading:l}=chunkIL3DC53A_cjs_js.C({func:n});return hi.useMemo(()=>({creditGrants:(i==null?void 0:i.data)||[],paging:i==null?void 0:i.pageInfo,totalCount:i==null?void 0:i.totalCount,isLoading:l,error:a}),[i,a,l])}function Xi({skeletonRows:e,visibleHeadCells:t,hideLastRowBorder:o}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((r,n)=>jsxRuntime.jsx(DS__default.default,{children:t.map(i=>jsxRuntime.jsx(_t,{$alignment:i.alignment,$width:i.width,$maxWidth:i.maxWidth,$minWidth:i.minWidth,$isLastRow:n===e-1,$hideLastRowBorder:o,children:jsxRuntime.jsx(Xe__default.default,{width:i.width?parseInt(i.width.replace("px",""))-40:100,height:20})},String(i.id)))},n))})}function ji({data:e,visibleHeadCells:t,onRowClick:o,hideLastRowBorder:r}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((n,i)=>jsxRuntime.jsx(ea,{$clickable:!!o,onClick:()=>o&&o(n),children:t.map(a=>jsxRuntime.jsx(_t,{$alignment:a.alignment,$width:a.width,$maxWidth:a.maxWidth,$minWidth:a.minWidth,$isLastRow:i===e.length-1,$hideLastRowBorder:r,onClick:a.disableClick?l=>l.stopPropagation():void 0,children:jsxRuntime.jsx(ta,{$alignment:a.alignment,children:a.render(n)})},String(a.id)))},i))})}function qr({errorMessage:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"error",className:t,children:e||"An error occurred"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}function Jr({message:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",className:t,children:e||"No data available"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}var JS=chunkIL3DC53A_cjs_js.e(material.TableContainer)`
931
931
  border-radius: 8px;
932
932
  border: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
933
933
  background-color: ${({theme:e})=>e.stigg.palette.backgroundPaper};
@@ -940,13 +940,13 @@
940
940
  align-items: center;
941
941
  justify-content: center;
942
942
  `}
943
- `,XS=chunk2FMVMEMY_cjs_js.e(material.Table)`
943
+ `,XS=chunkIL3DC53A_cjs_js.e(material.Table)`
944
944
  min-width: 600px;
945
945
  table-layout: auto;
946
946
  width: 100%;
947
- `,jS=chunk2FMVMEMY_cjs_js.e(material.Divider)`
947
+ `,jS=chunkIL3DC53A_cjs_js.e(material.Divider)`
948
948
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
949
- `,_t=chunk2FMVMEMY_cjs_js.e(material.TableCell)`
949
+ `,_t=chunkIL3DC53A_cjs_js.e(material.TableCell)`
950
950
  padding: 8px 12px;
951
951
  border-bottom: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
952
952
  text-align: ${({$alignment:e})=>e||"left"};
@@ -959,38 +959,38 @@
959
959
  ${({$minWidth:e})=>e&&`min-width: ${e};`}
960
960
 
961
961
  ${({$isLastRow:e,$hideLastRowBorder:t})=>e&&t&&"border-bottom: none;"}
962
- `,eT=chunk2FMVMEMY_cjs_js.e(_t)`
962
+ `,eT=chunkIL3DC53A_cjs_js.e(_t)`
963
963
  background-color: transparent;
964
- `,ea=chunk2FMVMEMY_cjs_js.e(material.TableRow)`
964
+ `,ea=chunkIL3DC53A_cjs_js.e(material.TableRow)`
965
965
  ${({$clickable:e,theme:t})=>e&&`
966
966
  cursor: pointer;
967
967
  &:hover {
968
968
  background-color: ${t.stigg.palette.backgroundHighlight};
969
969
  }
970
970
  `}
971
- `,ta=chunk2FMVMEMY_cjs_js.e.div`
971
+ `,ta=chunkIL3DC53A_cjs_js.e.div`
972
972
  display: flex;
973
973
  align-items: center;
974
974
  justify-content: ${({$alignment:e})=>{switch(e){case "center":return "center";case "right":return "flex-end";default:return "flex-start"}}};
975
975
  width: 100%;
976
- `,tT=chunk2FMVMEMY_cjs_js.e(material.TablePagination)`
976
+ `,tT=chunkIL3DC53A_cjs_js.e(material.TablePagination)`
977
977
  color: ${({theme:e})=>e.stigg.palette.text.secondary};
978
- `;function oT({visibleHeadCells:e}){return jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:e.map(t=>jsxRuntime.jsx(eT,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"caption",children:t.label})},String(t.id)))})})}function Xr({data:e,headCells:t,isLoading:o=false,error:r=null,emptyMessage:n,errorMessage:i,onRowClick:a,className:l,skeletonRows:s=3,hideLastRowBorder:c=true,pageSize:u,pageNum:f,totalCount:y,onPageChange:p}){let g=t.filter(P=>P.visible!==false),h=!!r||!o&&e.length===0;return jsxRuntime.jsx(JS,{className:l,$hasMinHeight:h,children:r?jsxRuntime.jsx(qr,{errorMessage:i,className:`${l}-error`}):!o&&e.length===0?jsxRuntime.jsx(Jr,{message:n,className:`${l}-empty`}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(XS,{children:[jsxRuntime.jsx(oT,{visibleHeadCells:g}),jsxRuntime.jsx(material.TableBody,{children:o?jsxRuntime.jsx(Xi,{skeletonRows:s,visibleHeadCells:g,hideLastRowBorder:c}):jsxRuntime.jsx(ji,{data:e,visibleHeadCells:g,onRowClick:a,hideLastRowBorder:c})})]}),!!(e!=null&&e.length)&&p&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(jS,{}),jsxRuntime.jsx(tT,{component:"div",rowsPerPage:u!=null?u:e.length,rowsPerPageOptions:[u!=null?u:e.length],count:y!=null?y:e.length,page:f!=null?f:1,onPageChange:p,labelDisplayedRows:({from:P,to:b,count:x})=>`${se(P)}-${se(b)} of ${x!==-1?se(x):`more than ${se(b)}`}`})]})]})})}var nT=chunk2FMVMEMY_cjs_js.e(vb__default.default)`
978
+ `;function oT({visibleHeadCells:e}){return jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:e.map(t=>jsxRuntime.jsx(eT,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"caption",children:t.label})},String(t.id)))})})}function Xr({data:e,headCells:t,isLoading:o=false,error:r=null,emptyMessage:n,errorMessage:i,onRowClick:a,className:l,skeletonRows:s=3,hideLastRowBorder:c=true,pageSize:u,pageNum:f,totalCount:y,onPageChange:p}){let g=t.filter(P=>P.visible!==false),h=!!r||!o&&e.length===0;return jsxRuntime.jsx(JS,{className:l,$hasMinHeight:h,children:r?jsxRuntime.jsx(qr,{errorMessage:i,className:`${l}-error`}):!o&&e.length===0?jsxRuntime.jsx(Jr,{message:n,className:`${l}-empty`}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(XS,{children:[jsxRuntime.jsx(oT,{visibleHeadCells:g}),jsxRuntime.jsx(material.TableBody,{children:o?jsxRuntime.jsx(Xi,{skeletonRows:s,visibleHeadCells:g,hideLastRowBorder:c}):jsxRuntime.jsx(ji,{data:e,visibleHeadCells:g,onRowClick:a,hideLastRowBorder:c})})]}),!!(e!=null&&e.length)&&p&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(jS,{}),jsxRuntime.jsx(tT,{component:"div",rowsPerPage:u!=null?u:e.length,rowsPerPageOptions:[u!=null?u:e.length],count:y!=null?y:e.length,page:f!=null?f:1,onPageChange:p,labelDisplayedRows:({from:P,to:b,count:x})=>`${se(P)}-${se(b)} of ${x!==-1?se(x):`more than ${se(b)}`}`})]})]})})}var nT=chunkIL3DC53A_cjs_js.e(vb__default.default)`
979
979
  font-size: 0.75rem;
980
980
  height: 24px;
981
981
  border-radius: 4px;
982
982
  border: none;
983
983
  background-color: ${({theme:e,$variant:t})=>{var o,r,n,i;return (i=(n=(r=(o=e==null?void 0:e.stigg)==null?void 0:o.palette)==null?void 0:r.statusChips)==null?void 0:n[t])==null?void 0:i.background}};
984
984
  color: ${({theme:e,$variant:t})=>{var o,r,n,i;return (i=(n=(r=(o=e==null?void 0:e.stigg)==null?void 0:o.palette)==null?void 0:r.statusChips)==null?void 0:n[t])==null?void 0:i.text}};
985
- `;function uo(i){var a=i,{variant:e,label:t,className:o,size:r="small"}=a,n=chunk2FMVMEMY_cjs_js.c(a,["variant","label","className","size"]);return jsxRuntime.jsx(nT,chunk2FMVMEMY_cjs_js.a({label:t,size:r,$variant:e,className:o},n))}function qp(e){return e.grantType===jsClientSdk.CreditGrantType.Overdraft}function Jp(e){if(e.voidedAt)return "VOIDED";let t=Z(),o=Z(e.effectiveAt),r=e.expireAt?Z(e.expireAt):null;return o.isAfter(t)?"SCHEDULED":r&&r.isBefore(t)?"EXPIRED":!qp(e)&&e.consumedAmount>=e.amount?"DEPLETED":"AVAILABLE"}function Xp(e,t){return qp(e)?`${Ve(e.consumedAmount,t)} / ${"\u221E"}`:`${Ve(e.consumedAmount,t)} / ${Ve(e.amount,t)}`}var jp=(e,t)=>{switch(e){case "AVAILABLE":return t.active;case "SCHEDULED":return t.scheduled;case "DEPLETED":return t.depleted;case "EXPIRED":return t.expired;case "VOIDED":return t.voided}},ra=e=>{switch(e){case "AVAILABLE":return "success";case "SCHEDULED":return "warning";case "EXPIRED":case "DEPLETED":return "neutral";case "VOIDED":return "error";default:return "neutral"}},em=(e,t)=>{if(e.automaticRechargeConfigurationId)return "Automatic recharge";switch(e.grantType){case jsClientSdk.CreditGrantType.Promotional:return "Promotional";case jsClientSdk.CreditGrantType.Paid:return "Top-up";case jsClientSdk.CreditGrantType.Recurring:return t.recurring;case jsClientSdk.CreditGrantType.Overdraft:return t.overdraft}};function tm({creditGrants:e,isLoading:t,error:o,localization:r,decimalPlaces:n,pageSize:i,pageNum:a,totalCount:l,onPageChange:s}){let c=e.map(f=>chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},f),{status:Jp(f)})),u=[{id:"effectiveAt",label:r.receivedAt,width:"205px",render:({effectiveAt:f})=>jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-effective-date",children:ti(f)})},{id:"grantType",label:r.grantType,width:"205px",render:f=>jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-grant-type",children:em(f,r)})},{id:"status",label:r.status,width:"205px",render:({status:f})=>{let y=jp(f,r),p=ra(f);return jsxRuntime.jsx(uo,{label:y,variant:p,className:"stigg-credit-grants-status-chip"})}},{id:"amount",label:r.balance,width:"205px",render:f=>jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-balance",children:Xp(f,n)})},{id:"expireAt",label:r.expiryDate,width:"205px",render:f=>jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-expiry-date",children:f.expireAt?oi(f.expireAt):"\u2014"})}];return jsxRuntime.jsx(Xr,{data:c,headCells:u,isLoading:t,error:o,emptyMessage:r.emptyState,loadingMessage:r.loadingState,errorMessage:r.errorState,className:"stigg-credit-grants-table",skeletonRows:(c==null?void 0:c.length)||3,pageNum:a,pageSize:i,totalCount:l,onPageChange:s})}var rm=(e,t,o)=>{let[r,n]=hi.useState(0),[i,a]=hi.useState(0);return {pageNumber:i,lastVisitedPage:r,pageChangeFunc:(s,c)=>{let u=c>i?{after:e==null?void 0:e.endCursor,first:o}:{before:e==null?void 0:e.startCursor,last:o};t(u),n(i),a(c);}}};var pT=10,mT=chunk2FMVMEMY_cjs_js.e.div`
985
+ `;function uo(i){var a=i,{variant:e,label:t,className:o,size:r="small"}=a,n=chunkIL3DC53A_cjs_js.c(a,["variant","label","className","size"]);return jsxRuntime.jsx(nT,chunkIL3DC53A_cjs_js.a({label:t,size:r,$variant:e,className:o},n))}function ra(e){return e.grantType===jsClientSdk.CreditGrantType.Overdraft}function Jp(e){if(e.voidedAt)return "VOIDED";let t=Z(),o=Z(e.effectiveAt),r=e.expireAt?Z(e.expireAt):null;return o.isAfter(t)?"SCHEDULED":r&&r.isBefore(t)?"EXPIRED":e.consumedAmount>=e.amount?"DEPLETED":"AVAILABLE"}function Xp(e,t){return ra(e)?`${Ve(e.consumedAmount,t)} / ${"\u221E"}`:`${Ve(e.consumedAmount,t)} / ${Ve(e.amount,t)}`}var jp=(e,t)=>{switch(e){case "AVAILABLE":return t.active;case "SCHEDULED":return t.scheduled;case "DEPLETED":return t.depleted;case "EXPIRED":return t.expired;case "VOIDED":return t.voided}},na=e=>{switch(e){case "AVAILABLE":return "success";case "SCHEDULED":return "warning";case "EXPIRED":case "DEPLETED":return "neutral";case "VOIDED":return "error";default:return "neutral"}},em=(e,t)=>{if(e.automaticRechargeConfigurationId)return "Automatic recharge";switch(e.grantType){case jsClientSdk.CreditGrantType.Promotional:return "Promotional";case jsClientSdk.CreditGrantType.Paid:return "Top-up";case jsClientSdk.CreditGrantType.Recurring:return t.recurring;case jsClientSdk.CreditGrantType.Overdraft:return t.overdraft}};function tm({creditGrants:e,isLoading:t,error:o,localization:r,decimalPlaces:n,pageSize:i,pageNum:a,totalCount:l,onPageChange:s}){let c=e.filter(f=>!ra(f)).map(f=>chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},f),{status:Jp(f)})),u=[{id:"effectiveAt",label:r.receivedAt,width:"205px",render:({effectiveAt:f})=>jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-effective-date",children:ti(f)})},{id:"grantType",label:r.grantType,width:"205px",render:f=>jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-grant-type",children:em(f,r)})},{id:"status",label:r.status,width:"205px",render:({status:f})=>{let y=jp(f,r),p=na(f);return jsxRuntime.jsx(uo,{label:y,variant:p,className:"stigg-credit-grants-status-chip"})}},{id:"amount",label:r.balance,width:"205px",render:f=>jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-balance",children:Xp(f,n)})},{id:"expireAt",label:r.expiryDate,width:"205px",render:f=>jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",className:"stigg-credit-grants-expiry-date",children:f.expireAt?oi(f.expireAt):"\u2014"})}];return jsxRuntime.jsx(Xr,{data:c,headCells:u,isLoading:t,error:o,emptyMessage:r.emptyState,loadingMessage:r.loadingState,errorMessage:r.errorState,className:"stigg-credit-grants-table",skeletonRows:(c==null?void 0:c.length)||3,pageNum:a,pageSize:i,totalCount:l,onPageChange:s})}var rm=(e,t,o)=>{let[r,n]=hi.useState(0),[i,a]=hi.useState(0);return {pageNumber:i,lastVisitedPage:r,pageChangeFunc:(s,c)=>{let u=c>i?{after:e==null?void 0:e.endCursor,first:o}:{before:e==null?void 0:e.startCursor,last:o};t(u),n(i),a(c);}}};var pT=10,mT=chunkIL3DC53A_cjs_js.e.div`
986
986
  display: flex;
987
987
  flex-direction: column;
988
988
  gap: 8px;
989
- `,uT=chunk2FMVMEMY_cjs_js.e.div`
989
+ `,uT=chunkIL3DC53A_cjs_js.e.div`
990
990
  display: flex;
991
991
  flex-direction: column;
992
992
  gap: 16px;
993
- `;function nm({currencyId:e,localization:t,decimalPlaces:o,pageSize:r=pT}){let n=chunk2FMVMEMY_cjs_js.u({optional:true}),i=n==null?void 0:n.stigg,a=n==null?void 0:n.theme,l=chunk2FMVMEMY_cjs_js.a(chunk2FMVMEMY_cjs_js.a({},chunk2FMVMEMY_cjs_js.I),t),[s,c]=hi.useState({first:r}),{creditGrants:u,isLoading:f,error:y,paging:p,totalCount:g}=Yr({currencyId:e,pageSize:r,paging:s}),{pageNumber:h,pageChangeFunc:P}=rm(p,c,r);return jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:a,children:jsxRuntime.jsxs(mT,{className:"stigg-credit-grants-container",children:[jsxRuntime.jsx(uT,{className:"stigg-credit-grants-card",children:jsxRuntime.jsx(tm,{creditGrants:u,isLoading:f,error:y,localization:l,decimalPlaces:o,pageSize:r,pageNum:h,totalCount:g,onPageChange:P})}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.q,{source:"grant_list",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:i==null?void 0:i.getShowWatermark()})]})})}var im=chunk2FMVMEMY_cjs_js.e.div`
993
+ `;function nm({currencyId:e,localization:t,decimalPlaces:o,pageSize:r=pT}){let n=chunkIL3DC53A_cjs_js.u({optional:true}),i=n==null?void 0:n.stigg,a=n==null?void 0:n.theme,l=chunkIL3DC53A_cjs_js.a(chunkIL3DC53A_cjs_js.a({},chunkIL3DC53A_cjs_js.I),t),[s,c]=hi.useState({first:r}),{creditGrants:u,isLoading:f,error:y,paging:p,totalCount:g}=Yr({currencyId:e,pageSize:r,paging:s}),{pageNumber:h,pageChangeFunc:P}=rm(p,c,r);return jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:a,children:jsxRuntime.jsxs(mT,{className:"stigg-credit-grants-container",children:[jsxRuntime.jsx(uT,{className:"stigg-credit-grants-card",children:jsxRuntime.jsx(tm,{creditGrants:u,isLoading:f,error:y,localization:l,decimalPlaces:o,pageSize:r,pageNum:h,totalCount:g,onPageChange:P})}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.q,{source:"grant_list",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:i==null?void 0:i.getShowWatermark()})]})})}var im=chunkIL3DC53A_cjs_js.e.div`
994
994
  display: flex;
995
995
  flex-direction: column;
996
996
  gap: 16px;
@@ -999,16 +999,16 @@
999
999
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1000
1000
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
1001
1001
  min-height: 90px;
1002
- `;var am=chunk2FMVMEMY_cjs_js.e.div`
1002
+ `;var am=chunkIL3DC53A_cjs_js.e.div`
1003
1003
  display: flex;
1004
1004
  align-items: center;
1005
1005
  gap: 4px;
1006
- `;var na=chunk2FMVMEMY_cjs_js.e.div`
1006
+ `;var ia=chunkIL3DC53A_cjs_js.e.div`
1007
1007
  display: flex;
1008
1008
  flex-direction: column;
1009
1009
  gap: 4px;
1010
1010
  width: 100%;
1011
- `;var sm=chunk2FMVMEMY_cjs_js.e.div`
1011
+ `;var sm=chunkIL3DC53A_cjs_js.e.div`
1012
1012
  display: flex;
1013
1013
  align-items: center;
1014
1014
  justify-content: center;
@@ -1016,26 +1016,26 @@
1016
1016
  min-height: 60px;
1017
1017
  border: 1px dashed ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1018
1018
  border-radius: 8px;
1019
- `;function tn(e){let t=chunk2FMVMEMY_cjs_js.u(),o=t==null?void 0:t.stigg,r=t==null?void 0:t.updatedAt,n=hi.useCallback(()=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){if(!o)throw new Error("Stigg SDK is not initialized. Please check your API configuration.");if(!o.isCustomerLoaded)return null;try{let s={customerId:e.customerId,currencyId:e.currencyId};return yield o.getAutomaticRechargeConfiguration(s)}catch(s){throw console.error("Error fetching automatic recharge configuration:",s),s}}),[o,e.customerId,e.currencyId,r]),{data:i,error:a,isLoading:l}=chunk2FMVMEMY_cjs_js.C({func:n});return {config:i,isLoading:l,error:a}}function lm({customerId:e,currencyId:t}){let{config:o,isLoading:r,error:n}=tn({customerId:e,currencyId:t}),i=hi.useMemo(()=>{if(!o)return {isConfigured:false,isEnabled:false,thresholdValue:0,targetBalance:0,currentMonthlySpend:0,maxSpendLimit:0,spendPercentage:0,showActiveState:false};let a=o.maxSpendLimit&&o.maxSpendLimit>0?Vr(o.currentMonthlySpend||0,o.maxSpendLimit):0,l=true,s=l&&o.isEnabled;return {isConfigured:l,isEnabled:o.isEnabled,thresholdValue:o.thresholdValue||0,targetBalance:o.targetBalance||0,currentMonthlySpend:o.currentMonthlySpend||0,maxSpendLimit:o.maxSpendLimit||0,spendPercentage:a,showActiveState:s}},[o]);return chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},i),{isLoading:r,error:n})}var cm=chunk2FMVMEMY_cjs_js.e(im)`
1019
+ `;function tn(e){let t=chunkIL3DC53A_cjs_js.u(),o=t==null?void 0:t.stigg,r=t==null?void 0:t.updatedAt,n=hi.useCallback(()=>chunkIL3DC53A_cjs_js.d(null,null,function*(){if(!o)throw new Error("Stigg SDK is not initialized. Please check your API configuration.");if(!o.isCustomerLoaded)return null;try{let s={customerId:e.customerId,currencyId:e.currencyId};return yield o.getAutomaticRechargeConfiguration(s)}catch(s){throw console.error("Error fetching automatic recharge configuration:",s),s}}),[o,e.customerId,e.currencyId,r]),{data:i,error:a,isLoading:l}=chunkIL3DC53A_cjs_js.C({func:n});return {config:i,isLoading:l,error:a}}function lm({customerId:e,currencyId:t}){let{config:o,isLoading:r,error:n}=tn({customerId:e,currencyId:t}),i=hi.useMemo(()=>{if(!o)return {isConfigured:false,isEnabled:false,thresholdValue:0,targetBalance:0,currentMonthlySpend:0,maxSpendLimit:0,spendPercentage:0,showActiveState:false};let a=o.maxSpendLimit&&o.maxSpendLimit>0?Vr(o.currentMonthlySpend||0,o.maxSpendLimit):0,l=true,s=l&&o.isEnabled;return {isConfigured:l,isEnabled:o.isEnabled,thresholdValue:o.thresholdValue||0,targetBalance:o.targetBalance||0,currentMonthlySpend:o.currentMonthlySpend||0,maxSpendLimit:o.maxSpendLimit||0,spendPercentage:a,showActiveState:s}},[o]);return chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},i),{isLoading:r,error:n})}var cm=chunkIL3DC53A_cjs_js.e(im)`
1020
1020
  width: 406px;
1021
1021
  box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.05);
1022
1022
  box-sizing: border-box;
1023
- `,dm=chunk2FMVMEMY_cjs_js.e.div`
1023
+ `,dm=chunkIL3DC53A_cjs_js.e.div`
1024
1024
  display: flex;
1025
1025
  align-items: center;
1026
1026
  justify-content: flex-start;
1027
- `;function pm(e,t){return e?Object.entries(t).reduce((o,[r,n])=>{let i=new RegExp(`{{\\s*${r}\\s*}}`,"g"),l=String(n!=null?n:"").replace(/\$/g,"$$$$");return o.replace(i,l)},e):""}function mm({customerId:e,currencyId:t,currencyUnit:o="Credits",billingCurrency:r="$",onManageClick:n,className:i,localization:a}){let{thresholdValue:l,targetBalance:s,currentMonthlySpend:c,maxSpendLimit:u,spendPercentage:f,showActiveState:y,isLoading:p,error:g}=lm({customerId:e,currencyId:t}),h=chunk2FMVMEMY_cjs_js.a(chunk2FMVMEMY_cjs_js.a({},chunk2FMVMEMY_cjs_js.K),a&&Object.fromEntries(Object.entries(a).filter(([x,A])=>A!==void 0))),P=pm(h.descriptionTemplate,{target:Gt(s),unit:o,threshold:Gt(l)}),b=pm(h.spendTemplate,{currency:r,current:Gt(c),limit:Gt(u)});return g?jsxRuntime.jsx(cm,{className:`stigg-auto-recharge-status stigg-auto-recharge-status-error ${i||""}`,children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"error",children:g.message||"Failed to load auto-recharge status"})}):jsxRuntime.jsxs(cm,{className:`stigg-auto-recharge-status ${i||""}`,children:[jsxRuntime.jsxs(Rt,{children:[jsxRuntime.jsxs(am,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-auto-recharge-title",children:h.title}),!p&&y&&jsxRuntime.jsx(uo,{variant:"success",label:h.activeLabel,className:"stigg-auto-recharge-status-chip",size:"small"})]}),p?jsxRuntime.jsx(Xe__default.default,{width:70,height:38,borderRadius:10}):jsxRuntime.jsx(Ut,{type:"button",onClick:n,className:"stigg-auto-recharge-manage-button","aria-label":`${h.manageButton} auto-recharge settings`,children:h.manageButton})]}),p?jsxRuntime.jsxs(na,{children:[jsxRuntime.jsx(Xe__default.default,{width:"100%",height:20}),jsxRuntime.jsx(Xe__default.default,{width:"100%",height:8,borderRadius:0}),jsxRuntime.jsx(dm,{children:jsxRuntime.jsx(Xe__default.default,{width:200,height:16})})]}):y?jsxRuntime.jsxs(na,{children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary",className:"stigg-auto-recharge-description",children:P}),jsxRuntime.jsx(Wr,{percentage:f,variant:"primary",className:"stigg-auto-recharge-progress"}),jsxRuntime.jsx(dm,{children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-spend",children:u>0?b:h.unlimitedSpendLimit})})]}):jsxRuntime.jsx(sm,{className:"stigg-auto-recharge-empty",children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-empty-text",children:h.emptyStateMessage})})]})}var hT=chunk2FMVMEMY_cjs_js.e.div`
1027
+ `;function pm(e,t){return e?Object.entries(t).reduce((o,[r,n])=>{let i=new RegExp(`{{\\s*${r}\\s*}}`,"g"),l=String(n!=null?n:"").replace(/\$/g,"$$$$");return o.replace(i,l)},e):""}function mm({customerId:e,currencyId:t,currencyUnit:o="Credits",billingCurrency:r="$",onManageClick:n,className:i,localization:a}){let{thresholdValue:l,targetBalance:s,currentMonthlySpend:c,maxSpendLimit:u,spendPercentage:f,showActiveState:y,isLoading:p,error:g}=lm({customerId:e,currencyId:t}),h=chunkIL3DC53A_cjs_js.a(chunkIL3DC53A_cjs_js.a({},chunkIL3DC53A_cjs_js.K),a&&Object.fromEntries(Object.entries(a).filter(([x,A])=>A!==void 0))),P=pm(h.descriptionTemplate,{target:Gt(s),unit:o,threshold:Gt(l)}),b=pm(h.spendTemplate,{currency:r,current:Gt(c),limit:Gt(u)});return g?jsxRuntime.jsx(cm,{className:`stigg-auto-recharge-status stigg-auto-recharge-status-error ${i||""}`,children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"error",children:g.message||"Failed to load auto-recharge status"})}):jsxRuntime.jsxs(cm,{className:`stigg-auto-recharge-status ${i||""}`,children:[jsxRuntime.jsxs(Rt,{children:[jsxRuntime.jsxs(am,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h6",color:"primary",className:"stigg-auto-recharge-title",children:h.title}),!p&&y&&jsxRuntime.jsx(uo,{variant:"success",label:h.activeLabel,className:"stigg-auto-recharge-status-chip",size:"small"})]}),p?jsxRuntime.jsx(Xe__default.default,{width:70,height:38,borderRadius:10}):jsxRuntime.jsx(Ut,{type:"button",onClick:n,className:"stigg-auto-recharge-manage-button","aria-label":`${h.manageButton} auto-recharge settings`,children:h.manageButton})]}),p?jsxRuntime.jsxs(ia,{children:[jsxRuntime.jsx(Xe__default.default,{width:"100%",height:20}),jsxRuntime.jsx(Xe__default.default,{width:"100%",height:8,borderRadius:0}),jsxRuntime.jsx(dm,{children:jsxRuntime.jsx(Xe__default.default,{width:200,height:16})})]}):y?jsxRuntime.jsxs(ia,{children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary",className:"stigg-auto-recharge-description",children:P}),jsxRuntime.jsx(Wr,{percentage:f,variant:"primary",className:"stigg-auto-recharge-progress"}),jsxRuntime.jsx(dm,{children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-spend",children:u>0?b:h.unlimitedSpendLimit})})]}):jsxRuntime.jsx(sm,{className:"stigg-auto-recharge-empty",children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-empty-text",children:h.emptyStateMessage})})]})}var hT=chunkIL3DC53A_cjs_js.e.div`
1028
1028
  display: flex;
1029
1029
  flex-direction: column;
1030
1030
  gap: 8px;
1031
1031
  width: 100%;
1032
- `;function um(e){let t=he(ee),o=chunk2FMVMEMY_cjs_js.u({optional:true}),r=o==null?void 0:o.theme,n=jsxRuntime.jsx(hT,{className:"stigg-auto-recharge-status-container",children:jsxRuntime.jsx(mm,chunk2FMVMEMY_cjs_js.a({},e))});return t?n:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:r,children:n})}function gm(e){return Ug__default.default({},{title:"Auto recharge settings",enableLabel:"Recharge credits automatically when balance is low",enableDescription:"Allow auto-recharge",thresholdFieldPrefix:"When",thresholdFieldSuffix:"balance goes below",thresholdTooltip:"The credit balance threshold that triggers an automatic recharge",thresholdFieldPlaceholder:"Enter threshold amount",thresholdFieldHint:"Current threshold: {{value}}",thresholdRequired:"Threshold amount is required",thresholdMin:"Threshold must be at least 0",thresholdMax:"Threshold must be less than {{max}}",targetFieldPrefix:"Then",targetFieldSuffix:"recharge balance up to",targetBalanceTooltip:"The target credit balance to reach after a recharge",targetFieldPlaceholder:"Enter target balance",targetFieldHint:"Current target: {{value}}",targetRequired:"Target balance is required",targetMin:"Target must be greater than threshold",targetMax:"Target cannot exceed {{max}}",spendLimitFieldPrefix:"Limit",spendLimitFieldSuffix:"total spend",spendLimitFieldPlaceholder:"0.00",spendLimitHelpText:"Limit recharging to spending cap when enabled",spendLimitPeriod:"month",spendLimitPositive:"Spend limit must be greater than 0",spendLimitMin:"Spend limit must be at least {{min}}",spendLimitMax:"Spend limit cannot exceed {{max}}",immediateRechargeWarning:"Recharge will run immediately after saving. Current balance is below threshold {{threshold}} {{currencyUnit}}.",spendLimitTooLowWarning:"Auto-recharge may not run. Current monthly spend (${{currentSpend}} USD) is approaching or exceeds the spend limit (${{spendLimit}} USD).",cancelButton:"Cancel",saveButton:"Save settings",editButton:"Edit",loadingState:"Loading automatic recharge settings...",errorState:"Failed to load automatic recharge settings",emptyState:"No automatic recharge configuration found"},e)}function nt(e,t={},o){var a,l,s,c;let r={};if(!e.enabled)return r;let n=parseFloat(e.thresholdAmount);!e.thresholdAmount||e.thresholdAmount.trim()===""?r.thresholdAmount=o.thresholdRequired||"Threshold amount is required":isNaN(n)?r.thresholdAmount="Threshold must be a valid number":n<0?r.thresholdAmount=o.thresholdMin||"Threshold must be at least 0":t.poolSize!==void 0&&n>=t.poolSize&&(r.thresholdAmount=((a=o.thresholdMax)==null?void 0:a.replace("{{max}}",String(t.poolSize)))||`Threshold must be less than ${t.poolSize}`);let i=parseFloat(e.targetBalance);if(!e.targetBalance||e.targetBalance.trim()===""?r.targetBalance=o.targetRequired||"Target balance is required":isNaN(i)?r.targetBalance="Target balance must be a valid number":!isNaN(n)&&i<=n?r.targetBalance=o.targetMin||"Target balance must be greater than threshold":t.poolSize!==void 0&&i>t.poolSize&&(r.targetBalance=((l=o.targetMax)==null?void 0:l.replace("{{max}}",String(t.poolSize)))||`Target balance cannot exceed ${t.poolSize}`),e.maxSpendLimit&&e.maxSpendLimit.trim()!==""){let u=parseFloat(e.maxSpendLimit);isNaN(u)?r.maxSpendLimit="Spend limit must be a valid number":u<=0?r.maxSpendLimit=o.spendLimitPositive||"Spend limit must be greater than 0":t.minSpendLimit!==void 0&&u<t.minSpendLimit?r.maxSpendLimit=((s=o.spendLimitMin)==null?void 0:s.replace("{{min}}",String(t.minSpendLimit)))||`Spend limit must be at least ${t.minSpendLimit}`:t.maxSpendLimit!==void 0&&u>t.maxSpendLimit&&(r.maxSpendLimit=((c=o.spendLimitMax)==null?void 0:c.replace("{{max}}",String(t.maxSpendLimit)))||`Spend limit cannot exceed ${t.maxSpendLimit}`);}return r}function rn({initialData:e,poolSize:t,localization:o}){var P,b,x,A,S,F,T,k,w,I,E,L,N,$;let[r,n]=hi.useState({enabled:(P=e==null?void 0:e.enabled)!=null?P:false,thresholdAmount:(x=(b=e==null?void 0:e.thresholdAmount)==null?void 0:b.toString())!=null?x:"",targetBalance:(S=(A=e==null?void 0:e.targetBalance)==null?void 0:A.toString())!=null?S:"",maxSpendLimit:(T=(F=e==null?void 0:e.maxSpendLimit)==null?void 0:F.toString())!=null?T:""}),[i,a]=hi.useState({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),l=nt({enabled:(k=e==null?void 0:e.enabled)!=null?k:false,thresholdAmount:(I=(w=e==null?void 0:e.thresholdAmount)==null?void 0:w.toString())!=null?I:"",targetBalance:(L=(E=e==null?void 0:e.targetBalance)==null?void 0:E.toString())!=null?L:"",maxSpendLimit:($=(N=e==null?void 0:e.maxSpendLimit)==null?void 0:N.toString())!=null?$:""},{poolSize:t},o),[s,c]=hi.useState(l);return {formData:r,errors:s,touched:i,handleEnabledChange:R=>{let V=R.target.checked;if(n(K=>chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},K),{enabled:V})),!V)c({}),a({});else {let K=nt(chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},r),{enabled:true}),{poolSize:t},o);c(K),a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true});}},handleFieldChange:R=>V=>{let K=V.target.value,Oe=chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},r),{[R]:K});n(Oe),a(z=>chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},z),{[R]:true}));let ut=nt(Oe,{poolSize:t},o);c(ut);},handleFieldBlur:R=>()=>{a(K=>chunk2FMVMEMY_cjs_js.b(chunk2FMVMEMY_cjs_js.a({},K),{[R]:true}));let V=nt(r,{poolSize:t},o);c(V);},getFieldError:R=>i[R]?s[R]:void 0,validate:()=>{let R=nt(r,{poolSize:t},o);return c(R),r.enabled&&a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),Object.keys(R).length===0},getFormValues:()=>{var R,V,K;return {enabled:r.enabled,thresholdAmount:(R=r.thresholdAmount)!=null&&R.trim()?parseFloat(r.thresholdAmount.trim()):void 0,targetBalance:(V=r.targetBalance)!=null&&V.trim()?parseFloat(r.targetBalance.trim()):void 0,maxSpendLimit:(K=r.maxSpendLimit)!=null&&K.trim()?parseFloat(r.maxSpendLimit.trim()):void 0}}}}var fo=chunk2FMVMEMY_cjs_js.e.div`
1032
+ `;function um(e){let t=he(ee),o=chunkIL3DC53A_cjs_js.u({optional:true}),r=o==null?void 0:o.theme,n=jsxRuntime.jsx(hT,{className:"stigg-auto-recharge-status-container",children:jsxRuntime.jsx(mm,chunkIL3DC53A_cjs_js.a({},e))});return t?n:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:r,children:n})}function gm(e){return Ug__default.default({},{title:"Auto recharge settings",enableLabel:"Recharge credits automatically when balance is low",enableDescription:"Allow auto-recharge",thresholdFieldPrefix:"When",thresholdFieldSuffix:"balance goes below",thresholdTooltip:"The credit balance threshold that triggers an automatic recharge",thresholdFieldPlaceholder:"Enter threshold amount",thresholdFieldHint:"Current threshold: {{value}}",thresholdRequired:"Threshold amount is required",thresholdMin:"Threshold must be at least 0",thresholdMax:"Threshold must be less than {{max}}",targetFieldPrefix:"Then",targetFieldSuffix:"recharge balance up to",targetBalanceTooltip:"The target credit balance to reach after a recharge",targetFieldPlaceholder:"Enter target balance",targetFieldHint:"Current target: {{value}}",targetRequired:"Target balance is required",targetMin:"Target must be greater than threshold",targetMax:"Target cannot exceed {{max}}",spendLimitFieldPrefix:"Limit",spendLimitFieldSuffix:"total spend",spendLimitFieldPlaceholder:"0.00",spendLimitHelpText:"Limit recharging to spending cap when enabled",spendLimitPeriod:"month",spendLimitPositive:"Spend limit must be greater than 0",spendLimitMin:"Spend limit must be at least {{min}}",spendLimitMax:"Spend limit cannot exceed {{max}}",immediateRechargeWarning:"Recharge will run immediately after saving. Current balance is below threshold {{threshold}} {{currencyUnit}}.",spendLimitTooLowWarning:"Auto-recharge may not run. Current monthly spend (${{currentSpend}} USD) is approaching or exceeds the spend limit (${{spendLimit}} USD).",cancelButton:"Cancel",saveButton:"Save settings",editButton:"Edit",loadingState:"Loading automatic recharge settings...",errorState:"Failed to load automatic recharge settings",emptyState:"No automatic recharge configuration found"},e)}function nt(e,t={},o){var a,l,s,c;let r={};if(!e.enabled)return r;let n=parseFloat(e.thresholdAmount);!e.thresholdAmount||e.thresholdAmount.trim()===""?r.thresholdAmount=o.thresholdRequired||"Threshold amount is required":isNaN(n)?r.thresholdAmount="Threshold must be a valid number":n<0?r.thresholdAmount=o.thresholdMin||"Threshold must be at least 0":t.poolSize!==void 0&&n>=t.poolSize&&(r.thresholdAmount=((a=o.thresholdMax)==null?void 0:a.replace("{{max}}",String(t.poolSize)))||`Threshold must be less than ${t.poolSize}`);let i=parseFloat(e.targetBalance);if(!e.targetBalance||e.targetBalance.trim()===""?r.targetBalance=o.targetRequired||"Target balance is required":isNaN(i)?r.targetBalance="Target balance must be a valid number":!isNaN(n)&&i<=n?r.targetBalance=o.targetMin||"Target balance must be greater than threshold":t.poolSize!==void 0&&i>t.poolSize&&(r.targetBalance=((l=o.targetMax)==null?void 0:l.replace("{{max}}",String(t.poolSize)))||`Target balance cannot exceed ${t.poolSize}`),e.maxSpendLimit&&e.maxSpendLimit.trim()!==""){let u=parseFloat(e.maxSpendLimit);isNaN(u)?r.maxSpendLimit="Spend limit must be a valid number":u<=0?r.maxSpendLimit=o.spendLimitPositive||"Spend limit must be greater than 0":t.minSpendLimit!==void 0&&u<t.minSpendLimit?r.maxSpendLimit=((s=o.spendLimitMin)==null?void 0:s.replace("{{min}}",String(t.minSpendLimit)))||`Spend limit must be at least ${t.minSpendLimit}`:t.maxSpendLimit!==void 0&&u>t.maxSpendLimit&&(r.maxSpendLimit=((c=o.spendLimitMax)==null?void 0:c.replace("{{max}}",String(t.maxSpendLimit)))||`Spend limit cannot exceed ${t.maxSpendLimit}`);}return r}function rn({initialData:e,poolSize:t,localization:o}){var P,b,x,A,S,F,T,k,w,I,E,L,N,$;let[r,n]=hi.useState({enabled:(P=e==null?void 0:e.enabled)!=null?P:false,thresholdAmount:(x=(b=e==null?void 0:e.thresholdAmount)==null?void 0:b.toString())!=null?x:"",targetBalance:(S=(A=e==null?void 0:e.targetBalance)==null?void 0:A.toString())!=null?S:"",maxSpendLimit:(T=(F=e==null?void 0:e.maxSpendLimit)==null?void 0:F.toString())!=null?T:""}),[i,a]=hi.useState({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),l=nt({enabled:(k=e==null?void 0:e.enabled)!=null?k:false,thresholdAmount:(I=(w=e==null?void 0:e.thresholdAmount)==null?void 0:w.toString())!=null?I:"",targetBalance:(L=(E=e==null?void 0:e.targetBalance)==null?void 0:E.toString())!=null?L:"",maxSpendLimit:($=(N=e==null?void 0:e.maxSpendLimit)==null?void 0:N.toString())!=null?$:""},{poolSize:t},o),[s,c]=hi.useState(l);return {formData:r,errors:s,touched:i,handleEnabledChange:R=>{let V=R.target.checked;if(n(K=>chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},K),{enabled:V})),!V)c({}),a({});else {let K=nt(chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},r),{enabled:true}),{poolSize:t},o);c(K),a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true});}},handleFieldChange:R=>V=>{let K=V.target.value,Oe=chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},r),{[R]:K});n(Oe),a(z=>chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},z),{[R]:true}));let ut=nt(Oe,{poolSize:t},o);c(ut);},handleFieldBlur:R=>()=>{a(K=>chunkIL3DC53A_cjs_js.b(chunkIL3DC53A_cjs_js.a({},K),{[R]:true}));let V=nt(r,{poolSize:t},o);c(V);},getFieldError:R=>i[R]?s[R]:void 0,validate:()=>{let R=nt(r,{poolSize:t},o);return c(R),r.enabled&&a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),Object.keys(R).length===0},getFormValues:()=>{var R,V,K;return {enabled:r.enabled,thresholdAmount:(R=r.thresholdAmount)!=null&&R.trim()?parseFloat(r.thresholdAmount.trim()):void 0,targetBalance:(V=r.targetBalance)!=null&&V.trim()?parseFloat(r.targetBalance.trim()):void 0,maxSpendLimit:(K=r.maxSpendLimit)!=null&&K.trim()?parseFloat(r.maxSpendLimit.trim()):void 0}}}}var fo=chunkIL3DC53A_cjs_js.e.div`
1033
1033
  display: flex;
1034
1034
  flex-direction: column;
1035
1035
  gap: 16px;
1036
1036
  width: 100%;
1037
1037
  max-width: 506px;
1038
- `,yo=chunk2FMVMEMY_cjs_js.e.div`
1038
+ `,yo=chunkIL3DC53A_cjs_js.e.div`
1039
1039
  display: flex;
1040
1040
  flex-direction: column;
1041
1041
  gap: 8px;
@@ -1044,12 +1044,12 @@
1044
1044
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1045
1045
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
1046
1046
  box-shadow: 1px 6px 14px 0px rgba(26, 26, 26, 0.1);
1047
- `,sa=chunk2FMVMEMY_cjs_js.e(reactFeather.Info)`
1047
+ `,la=chunkIL3DC53A_cjs_js.e(reactFeather.Info)`
1048
1048
  width: 12px;
1049
1049
  height: 12px;
1050
1050
  color: ${({theme:e})=>{var t,o,r;return (r=(o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.text)==null?void 0:r.secondary}};
1051
1051
  cursor: help;
1052
- `,la=chunk2FMVMEMY_cjs_js.e(Jx__default.default)`
1052
+ `,ca=chunkIL3DC53A_cjs_js.e(Jx__default.default)`
1053
1053
  font-family: custom-font, 'DM Sans', sans-serif;
1054
1054
  align-items: center;
1055
- `;function nn({customerId:e,currencyId:t,initialData:o,currencyUnit:r,poolSize:n,currentBalance:i,currentMonthlySpend:a,readOnly:l=false,localization:s,onSave:c,onCancel:u}){var E,L,N;let f=he(ee),y=chunk2FMVMEMY_cjs_js.u({optional:true}),p=y==null?void 0:y.theme,g=hi.useMemo(()=>gm(s),[s]),{formData:h,errors:P,handleEnabledChange:b,handleFieldChange:x,handleFieldBlur:A,getFieldError:S,validate:F,getFormValues:T}=rn({initialData:o,poolSize:n,localization:g}),k=hi.useMemo(()=>h.enabled?Object.keys(P).length>0:false,[P,h.enabled]),w=hi.useCallback(()=>{if(F()&&c){let $=T();c(chunk2FMVMEMY_cjs_js.a({customerId:e,currencyId:t},$));}},[F,c,T,e,t]),I=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsxs(yo,{className:"stigg-automatic-recharge-form-card",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:g.title}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",className:"stigg-automatic-recharge-form-subtitle",children:g.enableLabel})]}),jsxRuntime.jsx(ke__default.default,{display:"flex",flexDirection:"column",gap:1,children:jsxRuntime.jsx(nC__default.default,{control:jsxRuntime.jsx(rC__default.default,{checked:h.enabled,onChange:b,disabled:l}),label:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary",children:g.enableDescription}),className:"stigg-automatic-recharge-form-enable-checkbox"})}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-threshold-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.thresholdFieldPrefix})," ",g.thresholdFieldSuffix]}),jsxRuntime.jsx(Ze,{title:g.thresholdTooltip,children:jsxRuntime.jsx(sa,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.thresholdAmount,onValueChange:$=>{let R={target:{value:$.value}};x("thresholdAmount")(R);},onBlur:A("thresholdAmount"),placeholder:g.thresholdFieldPlaceholder,error:!!S("thresholdAmount"),helperText:(E=S("thresholdAmount"))!=null?E:"",disabled:l||!h.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:r}):void 0},className:"stigg-automatic-recharge-form-threshold-input"})]}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-target-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.targetFieldPrefix})," ",g.targetFieldSuffix]}),jsxRuntime.jsx(Ze,{title:g.targetBalanceTooltip,children:jsxRuntime.jsx(sa,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.targetBalance,onValueChange:$=>{let R={target:{value:$.value}};x("targetBalance")(R);},onBlur:A("targetBalance"),placeholder:g.targetFieldPlaceholder,error:!!S("targetBalance"),helperText:(L=S("targetBalance"))!=null?L:"",disabled:l||!h.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:r}):void 0},className:"stigg-automatic-recharge-form-target-input"})]}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-spend-limit-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.spendLimitFieldPrefix})," ",g.spendLimitFieldSuffix]}),jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:g.spendLimitHelpText})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.maxSpendLimit,onValueChange:$=>{let R={target:{value:$.value}};x("maxSpendLimit")(R);},onBlur:A("maxSpendLimit"),placeholder:g.spendLimitFieldPlaceholder,error:!!S("maxSpendLimit"),helperText:(N=S("maxSpendLimit"))!=null?N:"",disabled:l||!h.enabled,InputProps:{startAdornment:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxRuntime.jsxs(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:["/ ",g.spendLimitPeriod]})},className:"stigg-automatic-recharge-form-spend-limit-input"})]}),!l&&h.enabled&&h.thresholdAmount&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i!==void 0&&i<=parseFloat(h.thresholdAmount)&&jsxRuntime.jsx(la,{severity:"warning",className:"stigg-automatic-recharge-form-warning",children:g.immediateRechargeWarning.replace("{{threshold}}",se(parseFloat(h.thresholdAmount))||"0").replace("{{currencyUnit}}",r||"")}),h.maxSpendLimit&&h.maxSpendLimit.trim()!==""&&parseFloat(h.maxSpendLimit)>0&&a!==void 0&&a+0>=parseFloat(h.maxSpendLimit)&&jsxRuntime.jsx(la,{severity:"warning",className:"stigg-automatic-recharge-form-spend-limit-warning",children:g.spendLimitTooLowWarning.replace("{{currentSpend}}",pn(a)).replace("{{spendLimit}}",pn(parseFloat(h.maxSpendLimit)))})]}),!l&&jsxRuntime.jsxs(ke__default.default,{display:"flex",justifyContent:"flex-end",gap:1,pt:2,className:"stigg-automatic-recharge-form-actions",children:[u&&jsxRuntime.jsx(te,{variant:"outlined",onClick:u,className:"stigg-automatic-recharge-form-cancel-button",children:g.cancelButton}),c&&jsxRuntime.jsx(te,{variant:"contained",onClick:w,disabled:k,className:"stigg-automatic-recharge-form-save-button",children:g.saveButton})]})]})});return f?I:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:p,children:I})}function hm(){let e=chunk2FMVMEMY_cjs_js.u(),t=e==null?void 0:e.stigg,[o,r]=hi.useState(false),[n,i]=hi.useState(null);return {updateConfig:hi.useCallback(l=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){var s,c,u;if(!t||!t.isCustomerLoaded){let f=new Error("Stigg SDK not initialized or customer not loaded");throw i(f),f}r(true),i(null);try{let f={customerId:l.customerId,currencyId:l.currencyId,isEnabled:l.enabled,thresholdValue:(s=l.thresholdAmount)!=null?s:0,thresholdType:jsClientSdk.ThresholdType.CreditAmount,targetBalance:(c=l.targetBalance)!=null?c:0,maxSpendLimit:(u=l.maxSpendLimit)!=null?u:null},y=yield t.saveAutomaticRechargeConfiguration(f);return yield t.refresh(),r(!1),y}catch(f){let y=f instanceof Error?f:new Error("Failed to save automatic recharge configuration");throw console.error("Error saving automatic recharge configuration:",y),i(y),r(false),y}}),[t]),isLoading:o,error:n}}function xm({customerId:e,currencyId:t,currencyUnit:o,poolSize:r,readOnly:n=false,localization:i,onSave:a,onCancel:l}){var T;let s=he(ee),c=chunk2FMVMEMY_cjs_js.u({optional:true}),u=c==null?void 0:c.theme,{config:f,isLoading:y,error:p}=tn({customerId:e,currencyId:t}),g=chunk2FMVMEMY_cjs_js.A({currencyId:t}),{updateConfig:h,isLoading:P,error:b}=hm(),x=hi.useCallback(k=>chunk2FMVMEMY_cjs_js.d(null,null,function*(){try{yield h(k),a&&a(k);}catch(w){console.error("Failed to save automatic recharge configuration:",w);}}),[h,a]),A=f?{id:"",enabled:f.isEnabled,thresholdAmount:f.thresholdValue,targetBalance:f.targetBalance,maxSpendLimit:(T=f.maxSpendLimit)!=null?T:void 0,currencyId:f.currencyId,customerId:f.customerId}:void 0;if(y){let k=jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Xe__default.default,{width:300,height:24,style:{marginBottom:"16px"}}),jsxRuntime.jsx(Xe__default.default,{width:400,height:200})]});return s?k:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:u,children:k})}if(p){let k=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yo,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"error",children:p.message||"Failed to load automatic recharge configuration"})})});return s?k:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:u,children:k})}if(g.isFallback){let k=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yo,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"error",children:"Failed to load credit balance"})})});return s?k:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:u,children:k})}let S=o||g.currency.unitPlural||g.currency.displayName||"Credits",F=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b&&jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.f,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:b.message||"Failed to save automatic recharge configuration"}),jsxRuntime.jsx(nn,{customerId:e,currencyId:t,initialData:A,currencyUnit:S,poolSize:r,currentBalance:g.remaining,currentMonthlySpend:f==null?void 0:f.currentMonthlySpend,readOnly:n||P,localization:i,onSave:x,onCancel:l})]});return s?F:jsxRuntime.jsx(chunk2FMVMEMY_cjs_js.w,{componentTheme:u,children:F})}Object.defineProperty(exports,"StiggContext",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.s}});Object.defineProperty(exports,"StiggProvider",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.t}});Object.defineProperty(exports,"useActiveSubscriptions",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.D}});Object.defineProperty(exports,"useBooleanEntitlement",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.x}});Object.defineProperty(exports,"useCreditEntitlement",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.A}});Object.defineProperty(exports,"useCreditUsage",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.L}});Object.defineProperty(exports,"useCustomerPortal",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.F}});Object.defineProperty(exports,"useEnumEntitlement",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.B}});Object.defineProperty(exports,"useMeteredEntitlement",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.z}});Object.defineProperty(exports,"useNumericEntitlement",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.y}});Object.defineProperty(exports,"usePaywall",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.E}});Object.defineProperty(exports,"useStiggContext",{enumerable:true,get:function(){return chunk2FMVMEMY_cjs_js.u}});exports.AddonsList=$o;exports.AutoRechargeStatus=um;exports.AutomaticRechargeConfig=xm;exports.AutomaticRechargeConfigForm=nn;exports.BooleanEntitlementGuard=aS;exports.Checkout=Rp;exports.CreditBalance=Gp;exports.CreditGrants=nm;exports.CreditUsageChart=zp;exports.CreditUtilization=Wp;exports.CustomerPortal=ac;exports.CustomerPortalProvider=Do;exports.CustomerUsageData=ur;exports.EmptyState=Jr;exports.EnumEntitlementGuard=fS;exports.ErrorState=qr;exports.GenericTable=Xr;exports.InvoicesSection=gr;exports.MeteredEntitlementGuard=mS;exports.NumericEntitlementGuard=cS;exports.PaymentDetailsSection=ar;exports.Paywall=Ns;exports.Promotions=Vo;exports.ProvisionStatus=Ki;exports.StatusChip=uo;exports.SubscribeIntentionType=fn;exports.SubscriptionsOverview=tr;exports.formatDateOnly=oi;exports.formatDateTime=ti;exports.isCreditEntitlement=er;exports.isFeatureEntitlement=kt;exports.mapCreditGrantStatusToVariant=ra;exports.useAutomaticRechargeForm=rn;exports.useCreditGrants=Yr;exports.useWaitForCheckoutCompleted=_p;exports.validateAutomaticRechargeForm=nt;Object.keys(jsClientSdk).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return jsClientSdk[k]}})});
1055
+ `;function nn({customerId:e,currencyId:t,initialData:o,currencyUnit:r,poolSize:n,currentBalance:i,currentMonthlySpend:a,readOnly:l=false,localization:s,onSave:c,onCancel:u}){var E,L,N;let f=he(ee),y=chunkIL3DC53A_cjs_js.u({optional:true}),p=y==null?void 0:y.theme,g=hi.useMemo(()=>gm(s),[s]),{formData:h,errors:P,handleEnabledChange:b,handleFieldChange:x,handleFieldBlur:A,getFieldError:S,validate:F,getFormValues:T}=rn({initialData:o,poolSize:n,localization:g}),k=hi.useMemo(()=>h.enabled?Object.keys(P).length>0:false,[P,h.enabled]),w=hi.useCallback(()=>{if(F()&&c){let $=T();c(chunkIL3DC53A_cjs_js.a({customerId:e,currencyId:t},$));}},[F,c,T,e,t]),I=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsxs(yo,{className:"stigg-automatic-recharge-form-card",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:g.title}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",className:"stigg-automatic-recharge-form-subtitle",children:g.enableLabel})]}),jsxRuntime.jsx(ke__default.default,{display:"flex",flexDirection:"column",gap:1,children:jsxRuntime.jsx(nC__default.default,{control:jsxRuntime.jsx(rC__default.default,{checked:h.enabled,onChange:b,disabled:l}),label:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary",children:g.enableDescription}),className:"stigg-automatic-recharge-form-enable-checkbox"})}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-threshold-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.thresholdFieldPrefix})," ",g.thresholdFieldSuffix]}),jsxRuntime.jsx(Ze,{title:g.thresholdTooltip,children:jsxRuntime.jsx(la,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.thresholdAmount,onValueChange:$=>{let R={target:{value:$.value}};x("thresholdAmount")(R);},onBlur:A("thresholdAmount"),placeholder:g.thresholdFieldPlaceholder,error:!!S("thresholdAmount"),helperText:(E=S("thresholdAmount"))!=null?E:"",disabled:l||!h.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:r}):void 0},className:"stigg-automatic-recharge-form-threshold-input"})]}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-target-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.targetFieldPrefix})," ",g.targetFieldSuffix]}),jsxRuntime.jsx(Ze,{title:g.targetBalanceTooltip,children:jsxRuntime.jsx(la,{})})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.targetBalance,onValueChange:$=>{let R={target:{value:$.value}};x("targetBalance")(R);},onBlur:A("targetBalance"),placeholder:g.targetFieldPlaceholder,error:!!S("targetBalance"),helperText:(L=S("targetBalance"))!=null?L:"",disabled:l||!h.enabled,InputProps:{endAdornment:r?jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:r}):void 0},className:"stigg-automatic-recharge-form-target-input"})]}),jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-spend-limit-field",children:[jsxRuntime.jsxs(ke__default.default,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(ke__default.default,{component:"span",fontWeight:"bold",children:g.spendLimitFieldPrefix})," ",g.spendLimitFieldSuffix]}),jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:g.spendLimitHelpText})]}),jsxRuntime.jsx(reactNumberFormat.NumericFormat,{customInput:pe,fullWidth:true,thousandSeparator:true,value:h.maxSpendLimit,onValueChange:$=>{let R={target:{value:$.value}};x("maxSpendLimit")(R);},onBlur:A("maxSpendLimit"),placeholder:g.spendLimitFieldPlaceholder,error:!!S("maxSpendLimit"),helperText:(N=S("maxSpendLimit"))!=null?N:"",disabled:l||!h.enabled,InputProps:{startAdornment:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxRuntime.jsxs(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:["/ ",g.spendLimitPeriod]})},className:"stigg-automatic-recharge-form-spend-limit-input"})]}),!l&&h.enabled&&h.thresholdAmount&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i!==void 0&&i<=parseFloat(h.thresholdAmount)&&jsxRuntime.jsx(ca,{severity:"warning",className:"stigg-automatic-recharge-form-warning",children:g.immediateRechargeWarning.replace("{{threshold}}",se(parseFloat(h.thresholdAmount))||"0").replace("{{currencyUnit}}",r||"")}),h.maxSpendLimit&&h.maxSpendLimit.trim()!==""&&parseFloat(h.maxSpendLimit)>0&&a!==void 0&&a+0>=parseFloat(h.maxSpendLimit)&&jsxRuntime.jsx(ca,{severity:"warning",className:"stigg-automatic-recharge-form-spend-limit-warning",children:g.spendLimitTooLowWarning.replace("{{currentSpend}}",pn(a)).replace("{{spendLimit}}",pn(parseFloat(h.maxSpendLimit)))})]}),!l&&jsxRuntime.jsxs(ke__default.default,{display:"flex",justifyContent:"flex-end",gap:1,pt:2,className:"stigg-automatic-recharge-form-actions",children:[u&&jsxRuntime.jsx(te,{variant:"outlined",onClick:u,className:"stigg-automatic-recharge-form-cancel-button",children:g.cancelButton}),c&&jsxRuntime.jsx(te,{variant:"contained",onClick:w,disabled:k,className:"stigg-automatic-recharge-form-save-button",children:g.saveButton})]})]})});return f?I:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:p,children:I})}function hm(){let e=chunkIL3DC53A_cjs_js.u(),t=e==null?void 0:e.stigg,[o,r]=hi.useState(false),[n,i]=hi.useState(null);return {updateConfig:hi.useCallback(l=>chunkIL3DC53A_cjs_js.d(null,null,function*(){var s,c,u;if(!t||!t.isCustomerLoaded){let f=new Error("Stigg SDK not initialized or customer not loaded");throw i(f),f}r(true),i(null);try{let f={customerId:l.customerId,currencyId:l.currencyId,isEnabled:l.enabled,thresholdValue:(s=l.thresholdAmount)!=null?s:0,thresholdType:jsClientSdk.ThresholdType.CreditAmount,targetBalance:(c=l.targetBalance)!=null?c:0,maxSpendLimit:(u=l.maxSpendLimit)!=null?u:null},y=yield t.saveAutomaticRechargeConfiguration(f);return yield t.refresh(),r(!1),y}catch(f){let y=f instanceof Error?f:new Error("Failed to save automatic recharge configuration");throw console.error("Error saving automatic recharge configuration:",y),i(y),r(false),y}}),[t]),isLoading:o,error:n}}function xm({customerId:e,currencyId:t,currencyUnit:o,poolSize:r,readOnly:n=false,localization:i,onSave:a,onCancel:l}){var T;let s=he(ee),c=chunkIL3DC53A_cjs_js.u({optional:true}),u=c==null?void 0:c.theme,{config:f,isLoading:y,error:p}=tn({customerId:e,currencyId:t}),g=chunkIL3DC53A_cjs_js.A({currencyId:t}),{updateConfig:h,isLoading:P,error:b}=hm(),x=hi.useCallback(k=>chunkIL3DC53A_cjs_js.d(null,null,function*(){try{yield h(k),a&&a(k);}catch(w){console.error("Failed to save automatic recharge configuration:",w);}}),[h,a]),A=f?{id:"",enabled:f.isEnabled,thresholdAmount:f.thresholdValue,targetBalance:f.targetBalance,maxSpendLimit:(T=f.maxSpendLimit)!=null?T:void 0,currencyId:f.currencyId,customerId:f.customerId}:void 0;if(y){let k=jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Xe__default.default,{width:300,height:24,style:{marginBottom:"16px"}}),jsxRuntime.jsx(Xe__default.default,{width:400,height:200})]});return s?k:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:u,children:k})}if(p){let k=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yo,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"error",children:p.message||"Failed to load automatic recharge configuration"})})});return s?k:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:u,children:k})}if(g.isFallback){let k=jsxRuntime.jsx(fo,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yo,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"error",children:"Failed to load credit balance"})})});return s?k:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:u,children:k})}let S=o||g.currency.unitPlural||g.currency.displayName||"Credits",F=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b&&jsxRuntime.jsx(chunkIL3DC53A_cjs_js.f,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:b.message||"Failed to save automatic recharge configuration"}),jsxRuntime.jsx(nn,{customerId:e,currencyId:t,initialData:A,currencyUnit:S,poolSize:r,currentBalance:g.remaining,currentMonthlySpend:f==null?void 0:f.currentMonthlySpend,readOnly:n||P,localization:i,onSave:x,onCancel:l})]});return s?F:jsxRuntime.jsx(chunkIL3DC53A_cjs_js.w,{componentTheme:u,children:F})}Object.defineProperty(exports,"StiggContext",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.s}});Object.defineProperty(exports,"StiggProvider",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.t}});Object.defineProperty(exports,"useActiveSubscriptions",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.D}});Object.defineProperty(exports,"useBooleanEntitlement",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.x}});Object.defineProperty(exports,"useCreditEntitlement",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.A}});Object.defineProperty(exports,"useCreditUsage",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.L}});Object.defineProperty(exports,"useCustomerPortal",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.F}});Object.defineProperty(exports,"useEnumEntitlement",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.B}});Object.defineProperty(exports,"useMeteredEntitlement",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.z}});Object.defineProperty(exports,"useNumericEntitlement",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.y}});Object.defineProperty(exports,"usePaywall",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.E}});Object.defineProperty(exports,"useStiggContext",{enumerable:true,get:function(){return chunkIL3DC53A_cjs_js.u}});exports.AddonsList=$o;exports.AutoRechargeStatus=um;exports.AutomaticRechargeConfig=xm;exports.AutomaticRechargeConfigForm=nn;exports.BooleanEntitlementGuard=aS;exports.Checkout=Up;exports.CreditBalance=Vp;exports.CreditGrants=nm;exports.CreditUsageChart=Op;exports.CreditUtilization=Zp;exports.CustomerPortal=sc;exports.CustomerPortalProvider=Do;exports.CustomerUsageData=ur;exports.EmptyState=Jr;exports.EnumEntitlementGuard=fS;exports.ErrorState=qr;exports.GenericTable=Xr;exports.InvoicesSection=gr;exports.MeteredEntitlementGuard=mS;exports.NumericEntitlementGuard=cS;exports.PaymentDetailsSection=ar;exports.Paywall=Ms;exports.Promotions=Vo;exports.ProvisionStatus=Ki;exports.StatusChip=uo;exports.SubscribeIntentionType=fn;exports.SubscriptionsOverview=tr;exports.formatDateOnly=oi;exports.formatDateTime=ti;exports.isCreditEntitlement=er;exports.isFeatureEntitlement=kt;exports.mapCreditGrantStatusToVariant=na;exports.useAutomaticRechargeForm=rn;exports.useCreditGrants=Yr;exports.useWaitForCheckoutCompleted=Dp;exports.validateAutomaticRechargeForm=nt;Object.keys(jsClientSdk).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return jsClientSdk[k]}})});